UPJS Extension Development

UPJS provides an extention mechanism for developers to add their own methods to UPJSObjects. To do so, UPJS implements a method for adding extension. In this tutorial, we will develop a simple extension for UPJS and add it to the UPJSObject. There are some key points for developing an UPJS Extension
  • Every UPJS Extension function can reach content of UPJSObject through “this.content”.
  • UPJS Extension should be registered to UPJSObjects by “_.addExtension(extensions)”
  • @extensions are of the form as follows:
{
addDIV : function(){//some function code},
addUL:function(){//some function code}
}
Lets write a function that recieves an array and creates a DIV element that contains UL-LI list.
   Download ULLIDIVCreator

UPJS Plugin Development

UPJS provides plugin development for developers to add their own plugin as a component to UPJS. To doso, UPJS implements a method for adding plugins and getting plugins whenever you want. In this tutorial, we will develop a simple plugin for UPJS and we will call it. There are some key points for developing an UPJS Plugin
  • Every UPJS Plugin should has a constructor that recieves content of UPJSObject.
  • UPJS Plugin should be registered to UPJSPlugins by “_.addPlugin(plugins)”
  • @plugins are of the form as follows:
{
fancyTextBox:function(content){//some function code},
fancyParagraph:function(content, properties){ //some function code }
}
Every UPJS Plugin can be called by “UPJSObject.getPlugin(name,arguments)”
@name is the name of the plugin
@arguments are for the parameters other than the content sequentially.
Lets write a function that recieves an html input element that is being cleared when it is clicked.
It can be used as follows.

   Download FancyTextBox