Coder Social home page Coder Social logo

uxrocket.factory's People

Contributors

bcinarli avatar ramesaliyev avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uxrocket.factory's Issues

Event namespaces

Each plugin should bind their events with their own namespaces. This is useful, especially during updating and unbinding plugin events.

Here are sample events our Clear plugin

keyup: 'keyup.uxClear',
focus: 'focus.uxClear',
input: 'input.uxClear',
click: 'click.uxClear'

Template is not replacing element more than once

When in single iteration, same key is not replaced more than once

template

<span class="{{class}}"></span>
<span class="{{class}}"></span>

output

<span class="some-class"></span>
<span class="undefined"></span>

Data objects on binded elements

For general usage, controlling and modifying elements we add some data values when a plugin binded.

Rocket Data

// data name uxRocket

uxRocket: {
    "hasWrapper": true, // when plugin wraps the element, set to true otherwise false
    "wrapper": "uxitd-clear-wrap", 
    "ready": "uxitd-clear-ready",
    "selected": selector, // the jQuery selector
    "options": options // plugin options
}

Plugin Data
Currently we are storing merged plugin options to element

var opts = $.extend({}, defaults, options, $(el).data(), {'selector': selector});

$el.data("uxClear", opts);

Note that: Plugin defaults can also modified both from options object while plugin binding or form data attributes on the element.

callBack vs promise

In stead of our previously defined callback methods mostly attached via data attributes e.g. data-on-ready="somefunc()", we should come with a promise like approach also at some point we also should support "legacy" callback definitions.

Jshint

Add a .jshinttrc and hinting tasks to grunt

setLayout method

Add setLayout method for plugins that need to wrap or add extra elements around the selected element.

  • It should copy the selected elements' classes to wrapper
  • It should not copy the "selector class" to the wrapper
  • It should not copy the "*-ready" class to wrapper

Required Classes in plugins

For jQuery modules we need same classes for backward compatibility and styling.

Here are the list of the required classes. For the new factory we can rename the class prefix to ux or rocket

  • Ready Class : uxitd-*-ready where * indicates the plugin name. e.g. uxitd-clear-ready . This class should added to selected element on plugin binding.
  • Generic Wrapper Class: uxitd-plugin-wrap. This class is present to make sure, we wrap element only once when more than one Rocket plugins binded to it.
  • Plugin Wrapper Class: uxitd-*-wrap where * indicates the plugin name. e.g. uxitd-clear-wrap .
  • Icon Class: uxitd-*-icon. This class is used when plugin attach an icon to element.

Also there are other helper classes according to plugin needs. Make sure that, we can easily define a class namespace for each plugin and use them during development.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.