cn.js
上传用户:momo1981
上传日期:2016-03-11
资源大小:6001k
文件大小:813k
源码类别:

中间件编程

开发平台:

Java

  1.         },
  2.         setProperties:{
  3.             $desc:"设置当前模板的参数.",
  4.             $rtn:"[self]",
  5.             $paras:[
  6.                 "key [必需参数] : 模板空位名.",
  7.                 "value [可选参数] : Any. 模板空位的值"
  8.             ],
  9.             $snippet:[
  10.             "var id='linb.temp.tt2'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  11.         "n// n"+
  12.     "var t=new linb.Template(); t.setTemplate({'':'<div  onclick=[$e]>{pre} {items} {next}</div>',items:'<p onclick=[$e] onmouseover=[$e]>{id} : {caption}</p>'}).setProperties({pre:'{{{',next:'}}}'}).setProperties('items',[{id:1,caption:'a1'},{id:2,caption:'a2'}]).setEvents({onClick:function(p){alert(p.domId)},items:{onClick:function(p,e,s){alert(p.domId);}}}); linb(id).append(t);"+
  13.             "}"
  14.             ]
  15.         },
  16.         setTemplate:{
  17.             $desc:"设置模板的HTML串.",
  18.             $rtn:"[self]",
  19.             $paras:[
  20.                 "key [必需参数] : 模板键.",
  21.                 "value [可选参数] : String, 模板键值."
  22.             ],
  23.             $snippet:[
  24.             "var id='linb.temp.tt3'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  25.         "n// n"+
  26.     "var t=new linb.Template(); t.setTemplate('<div  onclick=[$e]>{pre} {items} {next}</div>').setTemplate('items','<p onclick=[$e] onmouseover=[$e]>{id} : {caption}</p>').setProperties({pre:'{{{',next:'}}}',items:[{id:1,caption:'a1'},{id:2,caption:'a2'}]}).setEvents({onClick:function(p){alert(p.domId)},items:{onClick:function(p,e,s){alert(p.domId);}}}); linb(id).append(t);"+
  27.             "}"
  28.             ]
  29.         }
  30.     }
  31. });
  32. _.set(linb.Locale,["cn","doc","linb","Com"], {
  33.     constructor:{
  34.         $desc:"linb.Com的构造函数",
  35.         $paras:[
  36.             "properties [可选参数] : key/value(any) pairs. the Com properties object. 默认为 {}.",
  37.             "events [可选参数] : key/value(Function) pairs. the Com event object. 默认为 {}.",
  38.             "host [可选参数] : object. the Com's host object. 默认为 itself."
  39.         ],
  40.         $snippet:[
  41.             "var order=[], com = new linb.Com({"+
  42.             "    $1:1"+
  43.             "  },"+
  44.             "  {"+
  45.             "    beforeCreated:function(){order.push('beforeCreated'); linb.log('beforeCreated');},"+
  46.             "    onCreated:function(){order.push('onCreated'); linb.log('onCreated');},"+
  47.             "    onLoadBaseClass:function(c,t,key){order.push('onLoadBaseClass: '+key); linb.log('onLoadBaseClass: '+key); },"+
  48.             "    onIniResource:function(){order.push('onIniResource'); linb.log('onIniResource');},"+
  49.             "    beforeIniComponents:function(){order.push('beforeIniComponents'); linb.log('beforeIniComponents');},"+
  50.             "    afterIniComponents:function(){order.push('afterIniComponents'); linb.log('afterIniComponents');},"+
  51.             "    onLoadReqiredClass:function(c,t,key){order.push('onLoadReqiredClass: '+key); linb.log('onLoadReqiredClass: '+key);},"+
  52.             "    onReady:function(){order.push('onReady'); linb.log('onReady');},"+
  53.             "    onRender:function(com){order.push('onRender'); linb.log('onRender'); com.dialog1.setHtml(order.join('<br />'));}"+
  54.             "  });"+
  55.             "com.base=['linb.UI','linb.Date'];"+
  56.             "com.required=['linb.UI.Dialog','linb.UI.Button'];"+
  57.             "com.iniComponents=function(){order.push('iniComponents'); return (new linb.UI.Dialog()).host(this, 'dialog2').setWidth(150).setHeight(150).get() };"+
  58.             "com.iniResource=function(){order.push('iniResource'); };"+
  59.             "com.iniExComs=function(){order.push('iniExComs'); };"+
  60.             "var abox=com.getComponents();"+
  61.             "abox.merge((new linb.UI.Dialog()).host(com, 'dialog1'));"+
  62.             "com.setComponents(abox);"+
  63.             "com.show(function(com){"+
  64.             "   order.push('onEnd'); "+
  65.             "});",
  66.             "Class('App1','linb.Com',{" +
  67.             "    Instance:{" +
  68.             "        base : ['linb.UI', 'linb.Date']," +
  69.             "        required : ['linb.UI.Dialog', 'linb.UI.Button']," +
  70.             "        events:{" +
  71.             "            beforeCreated : function(com){" +
  72.             "                com._info=[];" +
  73.             "                com._info.push('beforeCreated');" +
  74.             "                linb.log('beforeCreated');" +
  75.             "            }," +
  76.             "            onCreated : function(com){" +
  77.             "                com._info.push('onCreated');" +
  78.             "                linb.log('onCreated');" +
  79.             "            }," +
  80.             "            onLoadBaseClass : function(com, t, key){" +
  81.             "                com._info.push('onLoadBaseClass: ' + key);" +
  82.             "                linb.log('onLoadBaseClass: ' + key);" +
  83.             "            }," +
  84.             "            onIniResource : function(com){" +
  85.             "                com._info.push('onIniResource');" +
  86.             "                linb.log('onIniResource');" +
  87.             "            }," +
  88.             "            beforeIniComponents : function(com){" +
  89.             "                com._info.push('beforeIniComponents');" +
  90.             "                linb.log('beforeIniComponents');" +
  91.             "            }," +
  92.             "            afterIniComponents : function(com){" +
  93.             "                com._info.push('afterIniComponents');" +
  94.             "                linb.log('afterIniComponents');" +
  95.             "            }," +
  96.             "            onLoadReqiredClass : function(com, t, key){" +
  97.             "                com._info.push('onLoadReqiredClass: ' + key);" +
  98.             "                linb.log('onLoadReqiredClass: ' + key);" +
  99.             "            }," +
  100.             "            onReady : function(com){" +
  101.             "                com._info.push('onReady');" +
  102.             "                linb.log('onReady');" +
  103.             "            }," +
  104.             "            onRender : function(com){" +
  105.             "                com._info.push('onRender');" +
  106.             "                linb.log('onRender');" +
  107.             "                com.dialog1.setHtml(com._info.join('<br />'));" +
  108.             "            }" +
  109.             "        }," +
  110.             "        customAppend:function(parent,showId,threadid){" +
  111.             "            this.dialog1.show(parent);" +
  112.             "        }," +
  113.             "        iniComponents : function(){" +
  114.             "            this._info.push('iniComponents');n" +
  115.             "            // [[code created by jsLinb UI Buildern" +
  116.             "            var host=this, children=[], append=function(child){children.push(child.get(0))};" +
  117.             "            append((new linb.UI.Dialog)" +
  118.             "                .host(host,'dialog1')" +
  119.             "                .setWidth(450)" +
  120.             "                .setHeight(450)" +
  121.             "            );" +
  122.             "            return children;n" +
  123.             "            // ]]code created by jsLinb UI Buildern" +
  124.             "        }," +
  125.             "        iniResource : function(){" +
  126.             "            this._info.push('iniResource');" +
  127.             "        }," +
  128.             "        iniExComs : function(){" +
  129.             "            this._info.push('iniExComs');" +
  130.             "        }" +
  131.             "    }" +
  132.             "});" +
  133.             "var com = new App1;" +
  134.             "com.show();",
  135.             "Class('App2','linb.Com',{" +
  136.             "    Instance:{" +
  137.             "        base : ['linb.UI']," +
  138.             "        required : ['linb.UI.Dialog']," +
  139.             "        events:{" +
  140.             "            beforeCreated : '_trace'," +
  141.             "            onCreated : '_trace'," +
  142.             "            onLoadBaseClass : '_trace'," +
  143.             "            onIniResource : '_trace'," +
  144.             "            beforeIniComponents : '_trace'," +
  145.             "            afterIniComponents : '_trace'," +
  146.             "            onLoadReqiredClass : '_trace'," +
  147.             "            onReady : '_trace'," +
  148.             "            onRender : '_trace'," +
  149.             "        }," +
  150.             "        customAppend:function(parent,showId,threadid){" +
  151.             "            this.dialog1.show(parent);" +
  152.             "        }," +
  153.             "        iniComponents : function(){" +
  154.             "            this._info.push('iniComponents');n" +
  155.             "            // [[code created by jsLinb UI Buildern" +
  156.             "            var host=this, children=[], append=function(child){children.push(child.get(0))};" +
  157.             "            append((new linb.UI.Dialog)" +
  158.             "                .host(host,'dialog1')" +
  159.             "                .setWidth(350)" +
  160.             "                .setHeight(450)" +
  161.             "            );" +
  162.             "            return children;n" +
  163.             "            // ]]code created by jsLinb UI Buildern" +
  164.             "        }," +
  165.             "        iniResource : function(){" +
  166.             "            this._info.push('iniResource');" +
  167.             "        }," +
  168.             "        iniExComs : function(){" +
  169.             "            this._info.push('iniExComs');" +
  170.             "        }, " +
  171.             "        _trace : function(com, threadid){" +
  172.             "            com._info.push(com.$lastEvent);" +
  173.             "        }" +
  174.             "    }" +
  175.             "});" +
  176.             "var com = new App2;" +
  177.             "com._info=[];"+
  178.             "com.show(function(com){com.dialog1.setHtml(com._info.join('<br />'));});"
  179.         ]
  180.     },
  181.     'load':{
  182.         $desc:"从远程文件加载一个 linb.Com 的代码,然后新建它的 linb.Com 的实例,最后返回这个实例.",
  183.         $paras:[
  184.             "cls [必需参数] : String, the full class path name(e.g. 'linb.App').",
  185.             "onEnd [可选参数]: Function, arguments : [the current linb.Com object]. This function will be called after the process is end.",
  186.             "lang [可选参数] : String, language name.(e.g. 'en').",
  187.             "showUI [可选参数] : Bool, indicates whether or not it shows the Com UI. 默认为 true;"
  188.         ],
  189.         $snippet:[
  190.             "////Uses the beblow line to load a specified application, and append its UI to 'document.body' if its UI exits. n"+
  191.             "//linb.Com.load('RootClassName',function(){alert('ok')},'en')n",
  192.             "linb.Com.load('App.Test1',function(){alert('ok')});",
  193.             "linb.Com.load('App.Test1',function(com){com.show(function(){alert('ok')},SPA.mainLayout,'main')},null,false)"
  194.         ]
  195.     },
  196.     prototype:{
  197.         render:{
  198.             $desc:'To render the inner UI Components',
  199.             $rtn:"[self]",
  200.             $demo:"You have to call this function after the com was created. And linb.Com.show will trigger this function automatically."
  201.         },
  202.         setComponents:{
  203.             $desc:"Sets the current Com's Components.",
  204.             $rtn:"[self]",
  205.             $paras:[
  206.                 "obj [Reqired] : linb.absObj object."
  207.             ],
  208.             $snippet:[
  209.                 "linb.SC('App.Test1',function(){var com=new this; com.create(function(com){com.setComponents((new linb.UI.Button()).host(window,'btn') ); alert(com.getComponents().get(0).alias); });},false);"
  210.             ]
  211.         },
  212.         getComponents:{
  213.             $desc:"Gets all Components in a specified linb.Com object.",
  214.             $rtn:"linb.absObj object",
  215.             $snippet:[
  216.                 "Class('App1','linb.Com',{" +
  217.                 "   Instance:{"+
  218.                 "        iniComponents : function(){" +
  219.                 "            var host=this, children=[], append=function(child){children.push(child.get(0))};" +
  220.                 "            append((new linb.DataBinder)" +
  221.                 "                .host(host,'db1')" +
  222.                 "                .setName('db1')" +
  223.                 "            );" +
  224.                 "            append((new linb.UI.Dialog)" +
  225.                 "                .host(host,'dialog1')" +
  226.                 "                .setWidth(350)" +
  227.                 "                .setHeight(450)" +
  228.                 "            );" +
  229.                 "            return children;n" +
  230.                 "        }" +
  231.                 "   }" +
  232.                 "});"+
  233.                 "var com=new App1;"+
  234.                 "com.create(function(com){alert(com.getComponents().get(0).alias);});"
  235.             ]
  236.         },
  237.         getUIComponents:{
  238.             $desc:"获取指定linb.Com对象包含的所有UI组件.",
  239.             $rtn:"linb.UI Object",
  240.             $snippet:[
  241.                 "Class('App1','linb.Com',{" +
  242.                 "   Instance:{"+
  243.                 "        iniComponents : function(){" +
  244.                 "            var host=this, children=[], append=function(child){children.push(child.get(0))};" +
  245.                 "            append((new linb.DataBinder)" +
  246.                 "                .host(host,'db1')" +
  247.                 "                .setName('db1')" +
  248.                 "            );" +
  249.                 "            append((new linb.UI.Dialog)" +
  250.                 "                .host(host,'dialog1')" +
  251.                 "                .setWidth(350)" +
  252.                 "                .setHeight(450)" +
  253.                 "            );" +
  254.                 "            return children;n" +
  255.                 "        }" +
  256.                 "   }" +
  257.                 "});"+
  258.                 "var com=new App1;"+
  259.                 "com.create(function(com){alert(com.getUIComponents().get(0).alias);});"
  260.             ]
  261.         },
  262.         getEvents:{
  263.             $desc:"获取Com对象上的所有事件处理函数.",
  264.             $rtn:"Object , String or Function",
  265.             $paras:[
  266.                 "key [可选参数] : String"
  267.             ],
  268.             $snippet:[
  269.                 "linb.SC('App.Test1',function(){var com=new this; com.create(function(com){alert(_.serialize(com.getEvents()))});},false);",
  270.                 "linb.SC('App.Test1',function(){var com=new this; com.create(function(com){alert(_.serialize(com.getEvents('onReady')))});},false);"
  271.             ]
  272.         },
  273.         setEvents:{
  274.             $desc:"将一系列的事件处理函数(或一个带有key的事件处理函数)附加到Com对象。",
  275.             $rtn:"[self]",
  276.             $paras:[
  277.                 "key [必需参数] : key/value(Function) pairs or String. 一系列的事件处理函数或key值.",
  278.                 "value [可选参数] : Function, event function."
  279.             ],
  280.             $snippet:[
  281.                 "linb.SC('App.Test1',function(){var com=new this; com.create(function(com){com.setEvents('onA',function(){}); alert(com.getEvents('onA'))});},false);"
  282.             ]
  283.         },
  284.         create:{
  285.             $desc:"使用异步方式生成Com对象.",
  286.             $paras:[
  287.                 "onEnd [Optiona] : Function. 回调函数,在Com对象成功生成后执行。",
  288.                 "threadid [可选参数] : String, 内部线程id."
  289.             ],
  290.             $snippet:[
  291.                 "linb.SC('App.Test1',function(){var com=new this; com.create(function(com){alert('created!')});},false);"
  292.             ]
  293.         },
  294.         show:{
  295.             $desc:"显示Com对象.",
  296.             $paras:[
  297.                 "onEnd [Optiona] : Function. 回调函数,在Com对象成功显示后执行。",
  298.                 "parent [可选参数] : 父DOM节点或linb.UI对象.",
  299.                 "subId [可选参数] : String, 该参数在parent为linb.UI对象时有效。该子id. The sub id that Determines the [target] will be added to which sub DOM node. 该参数也可以设置成[false], that means the [target] will be appended to DOM only, no link created between the [target] UIProfiles and the parent UIProfile.",
  300.                 "threadid [可选参数] : String, 内部线程id."
  301.             ],
  302.             $snippet:[
  303.                 "linb.SC('App.Test1',function(){var com=new this; com.show(function(){});},false);"
  304.             ]
  305.         },
  306.         requestData:{
  307.             $desc:"执行一组linb.absIO对象.",
  308.             $paras:[
  309.                 "group [Require] : Array, linb.absIO 对象数组.",
  310.                 "threadid [可选参数] : String, the 内部线程id.",
  311.                 "onEnd [可选参数]:  Function, 回调函数, 在linb.absIO对象数组全部完成后回调."
  312.             ],
  313.             $memo:"通常情况下, 该函数被函数'fillUI'调用,用来请求服务器数据并且填充UI."
  314.         },
  315.         composeUI:{
  316.             $desc:"组成当前Com对象的UI.",
  317.             $paras:[
  318.                 "threadid [可选参数] : String, 内部线程id.",
  319.                 "onEnd [可选参数]:  Function, the 回调函数, it must be called in the current composeUI function.",
  320.                 "flag [可选参数] : Bool, a parameter for user to Determines whether or not  the current UI will be forced to compose."
  321.             ],
  322.             $memo:"需被子类重载."
  323.         },
  324.         fillUI:{
  325.             $desc:"Fills the current Com's UI.",
  326.             $paras:[
  327.                 "threadid [可选参数] : String, the 内部线程id.",
  328.                 "onEnd [可选参数]:  Function, 回调函数, 会被fillUI函数调用.",
  329.                 "flag [可选参数] : Bool, 使用该参数指定当前UI是否被强行填充."
  330.             ],
  331.             $memo:"需被子类重载."
  332.         },
  333.         destroy:{
  334.             $desc:"销毁对象.",
  335.             $memo:"通常情况下, 程序员不必直接调用该函数."
  336.         },
  337.         iniComponents:{
  338.             $desc:"生成内部的组件并返回内部组件数组(linb.absObj object).",
  339.             $rtn:"Array, linb.absObj对象数组.",
  340.             $snippet:[
  341.                 "Class('App1','linb.Com',{" +
  342.                 "   Instance:{"+
  343.                 "        iniComponents : function(){" +
  344.                 "            var host=this, children=[], append=function(child){children.push(child.get(0))};" +
  345.                 "            append((new linb.DataBinder)" +
  346.                 "                .host(host,'db1')" +
  347.                 "                .setName('db1')" +
  348.                 "            );" +
  349.                 "            append((new linb.UI.Dialog)" +
  350.                 "                .host(host,'dialog1')" +
  351.                 "                .setWidth(350)" +
  352.                 "                .setHeight(450)" +
  353.                 "            );" +
  354.                 "            return children;n" +
  355.                 "        }" +
  356.                 "   }" +
  357.                 "});"+
  358.                 "var com=new App1;"+
  359.                 "com.create(function(com){alert(com.getUIComponents().get(0).alias);});"
  360.             ]
  361.         },
  362.         getProperties:{
  363.             $desc:"取得Com对象所有的属性或某个指定的属性.",
  364.             $rtn:"Any",
  365.             $paras:[
  366.                 "key [可选参数] : String, 属性名称。"
  367.             ],
  368.             $snippet:[
  369.                 "linb.SC('App.Test1',function(){var com=new this; com.create(function(com){alert(_.serialize(com.getProperties()))});},false);",
  370.                 "linb.SC('App.Test1',function(){var com=new this; com.create(function(com){alert(com.getProperties('p1'))});},false);"
  371.             ]
  372.         },
  373.         setProperties:{
  374.             $desc:"设置Com对象的一系列的属性或某个指定的属性.",
  375.             $rtn:"[self]",
  376.             $paras:[
  377.                 "key [必需参数] : 键值对 or String. 属性或key数组.",
  378.                 "value [可选参数] : Any, a property value."
  379.             ],
  380.             $snippet:[
  381.                 "linb.SC('App.Test1',function(){var com=new this; com.create(function(com){com.setProperties('p3','p3 value'); alert(com.getProperties('p3'))});},false);"
  382.             ]
  383.         },
  384.         setHost:{
  385.             $desc:"设置host对象.",
  386.             $rtn:"[self]",
  387.             $paras:[
  388.                 "host [Requied] : Object, host对象.",
  389.                 "alias [可选参数] : String, 别名."
  390.             ],
  391.             $snippet:[
  392.                 "linb.SC('App.Test1',function(){var com=new this; com.create(function(com){com.setHost(window,'com_alias'); alert(com.getHost()===window); alert(window.com_alias)});},false);"
  393.             ]
  394.         },
  395.         getHost:{
  396.             $des:"获取host对象.",
  397.             $rtn:"Object",
  398.             $snippet:[
  399.                 "linb.SC('App.Test1',function(){var com=new this; com.create(function(com){com.setHost(window,'com_alias'); alert(com.getHost()===window); alert(window.com_alias)});},false);"
  400.             ]
  401.         },
  402.         beforeCreated:{
  403.             $desc:'Fired before com is created.',
  404.             $paras:[
  405.                 'com : linb.Com object.',
  406.                 'threadid : String, thread id.'
  407.             ],
  408.             $memo:'See constructor.'
  409.         },
  410.         onCreated:{
  411.             $desc:'Fired when com is created.',
  412.             $paras:[
  413.                 'com : linb.Com object.',
  414.                 'threadid : String, thread id.'
  415.             ],
  416.             $memo:'See constructor.'
  417.         },
  418.         onLoadBaseClass:{
  419.             $desc:'Fired when com loads base classes.',
  420.             $paras:[
  421.                 'com : linb.Com object.',
  422.                 'threadid : String, thread id.',
  423.                 'key: String, base class name.'
  424.             ],
  425.             $memo:'See constructor.'
  426.         },
  427.         onIniResource:{
  428.             $desc:'Fired when com loads resources.',
  429.             $paras:[
  430.                 'com : linb.Com object.',
  431.                 'threadid : String, thread id.',
  432.                 'key: String, base class name.'
  433.             ],
  434.             $memo:'See constructor.'
  435.         },
  436.         beforeIniComponents:{
  437.             $desc:'Fired beofre com object initializes inner components.',
  438.             $paras:[
  439.                 'com : linb.Com object.',
  440.                 'threadid : String, thread id.'
  441.             ],
  442.             $memo:'See constructor.'
  443.         },
  444.         afterIniComponents:{
  445.             $desc:'Fired after com object initializes inner components.',
  446.             $paras:[
  447.                 'com : linb.Com object.',
  448.                 'threadid : String, thread id.'
  449.             ],
  450.             $memo:'See constructor.'
  451.         },
  452.         onLoadRequiredClass:{
  453.             $desc:'Fired when com loads requried Classes.',
  454.             $paras:[
  455.                 'com : linb.Com object.',
  456.                 'threadid : String, thread id.',
  457.                 'key: String, class name.'
  458.             ],
  459.             $memo:'See constructor.'
  460.         },
  461.         onReady:{
  462.             $desc:'Fired when com is ready.',
  463.             $paras:[
  464.                 'com : linb.Com object.',
  465.                 'threadid : String, thread id.'
  466.             ],
  467.             $memo:'See constructor.'
  468.         },
  469.         onRender:{
  470.             $desc:'Fired when com is added to DOM.',
  471.             $paras:[
  472.                 'com : linb.Com object.',
  473.                 'threadid : String, thread id.'
  474.             ],
  475.             $memo:'See constructor.'
  476.         }
  477.     }
  478. });
  479. _.set(linb.Locale,["cn","doc","linb","ComFactory"], {
  480.     setProfile:{
  481.         $desc:"设置应用模块工厂(ComFatory)的profile.",
  482.         $rtn:'[self]',
  483.         $paras:[
  484.             "key [必需参数] : String或键值对.",
  485.             "value [可选参数] : String 或 键值对."
  486.         ],
  487.         $snippet:[
  488.             "linb.ComFactory.setProfile({test1:'App.Test1',test2:'App.Test2'});"+
  489.             "linb.ComFactory.setProfile('test1','App.Test1');"+
  490.             "linb.ComFactory.setProfile({test1:{cls:'App.Test1'},test2:{cls:'App.Test2'}});"+
  491.             "linb.ComFactory.setProfile('test1',{cls:'App.Test1',props:{dlgCaption:'dialog caption'}});"+
  492.             "alert(_.serialize(linb.ComFactory.getProfile()));"+
  493.             "alert(linb.ComFactory.getProfile('test1'));"
  494.         ]
  495.     },
  496.     getProfile:{
  497.         $desc:"获取应用模块工厂(ComFatory)的profile.",
  498.         $rtn:'String 或 键值对',
  499.         $paras:[
  500.             "key [可选参数] : String."
  501.         ],
  502.         $snippet:[
  503.             "linb.ComFactory.setProfile({test1:'App.Test1',test2:'App.Test2'});"+
  504.             "alert(linb.ComFactory.getProfile());"+
  505.             "alert(linb.ComFactory.getProfile('test1'));"
  506.         ]
  507.     },
  508.     broadcast:{
  509.         $desc:"广播一个消息(function)到所有的应用模块(linb.Com)中.",
  510.         $paras:[
  511.             "fun [必需参数] : Function, 要广播的函数."
  512.         ],
  513.         $snippet:[
  514.             "linb.SC('App.Test1',function(){linb.ComFactory.setCom('test1', (new this));},false);"+
  515.             "linb.SC('App.Test2',function(){linb.ComFactory.setCom('test2',(new this));},false);"+
  516.             "linb.ComFactory.broadcast(function(i){alert(i + ' / ' + this.KEY)});"
  517.         ]
  518.     },
  519.     destroyAll:{
  520.         $desc:"销毁应用模块工厂(ComFatory)加载的所有模块.",
  521.         $snippet:[
  522.             "linb.SC('App.Test1',function(){linb.ComFactory.setCom('test1',(new this));},false);"+
  523.             "linb.SC('App.Test2',function(){linb.ComFactory.setCom('test2',(new this));},false);"+
  524.             "linb.ComFactory.destroyAll();"+
  525.             "alert(linb.ComFactory.getComFromCache('test'));"
  526.         ]
  527.     },
  528.     getComFromCache:{
  529.         $desc:"获取一个缓存中已经存在的应用模块对象(Com object).",
  530.         $rtn:"Com object or null. 应用模块对象(Com object),不存在则返回null",
  531.         $paras:[
  532.             "id [必需参数] : String, 应用模块对象id."
  533.         ],
  534.         $snippet:[
  535.             "linb.SC('App.Test1',function(){linb.ComFactory.setCom('test1',(new this));},false);"+
  536.             "linb.SC('App.Test2',function(){linb.ComFactory.setCom('test2',(new this));},false);"+
  537.             "alert(linb.ComFactory.getComFromCache('test1').KEY);"
  538.         ]
  539.     },
  540.     getCom :{
  541.         $desc:"获取一个缓存中已经存在的应用模块对象(Com object), 如果不存在,则加载应用模块对应的js文件,再生成应用模块对象(Com object).",
  542.         $rtn:"Com object or null.  应用模块对象(Com object),不存在并加载js文件失败时返回null",
  543.         $paras:[
  544.             "id [必需参数] : String, 应用模块对象id.",
  545.             "onEnd [可选参数] : Function, the 回调函数, 生成应用模块对象(Com object)成功后被调用.",
  546.             "threadid [可选参数] : String, 内部线程id",
  547.             "singleton[Optional] : Bool, 默认为 true. If singleton is false, that indicates ComFactory won't get it from the cache, and won't cache the result."
  548.         ],
  549.         $snippet:[
  550.             "linb.ComFactory.destroyAll();"+
  551.             "linb.ComFactory.setProfile({test1:'App.Test1',test2:'App.Test2'});"+
  552.             "linb.ComFactory.getCom('test1',function(){alert('The Com loaded successfully.')});"
  553.         ]
  554.     },
  555.     setCom:{
  556.         $desc:"设置一个应用模块对象(Com object),并和一个Com id关联.",
  557.         $rtn:"[self]",
  558.         $paras:[
  559.             "id [必需参数] : String, Com id关联.",
  560.             "obj [必需参数] : Object, 应用模块对象(Com object)."
  561.         ],
  562.         $snippet:[
  563.             "linb.SC('App.Test1',function(){linb.ComFactory.setCom('test1',(new this));},false);"+
  564.             "linb.SC('App.Test2',function(){linb.ComFactory.setCom('test2',(new this));},false);"+
  565.             "alert(linb.ComFactory.getComFromCache('test1').KEY);"
  566.         ]
  567.     },
  568.     newCom :{
  569.         $desc:"生成一个新的应用模块类, 或加载一个应用模块类, 生成并返回它.",
  570.         $paras:[
  571.             "cls [必需参数] : String, 应用模块类的路径名字.",
  572.             "onEnd [可选参数] : Function, the 回调函数,加载应用模块类成功后被调用.",
  573.             "threadid [可选参数] : String, the inner threadid"
  574.         ],
  575.         $snippet:[
  576.             "linb.ComFactory.destroyAll();"+
  577.             "linb.ComFactory.newCom('App.Test1',function(){alert('The com loaded successfully.')});"
  578.         ]
  579.     },
  580.     prepareWidgets:{
  581.         $desc:"在后台加载并生成一些列的小器件, 这些小器件需要在当前的应用类中的[required]部分被定义.",
  582.         $snippet:[
  583.             "//linb.ComFactory.prepareWidgets();"
  584.         ]
  585.     },
  586.     prepareComs:{
  587.         $desc:"在后台加载并生成一些列的应用模块, 这些模块需要在profile中事先被定义.",
  588.         $snippet:[
  589.             "//linb.ComFactory.setProfile({test1:'App.Test1',test2:'App.Test2'});n"+
  590.             "//linb.ComFactory.prepareWidgets(['test1','test2']);"
  591.         ]
  592.     },
  593.     storeCom:{
  594.         $desc:"存储一个应用模块. (切断和父DOM节点的关联, 并存放到一个隐藏的div.)",
  595.         $paras:[
  596.             "id [Require] : 应用模块id."
  597.         ],
  598.         $snippet:[
  599.             "linb.ComFactory.destroyAll();"+
  600.             "linb.ComFactory.setProfile('test1',{cls:'App.Test1',props:{dlgCaption:'dialog caption'}});"+
  601.             "linb.ComFactory.getCom('test1',function(){ this.showDlg(); _.asyRun(function(){linb.ComFactory.storeCom('test1')},1000); });"
  602.         ]
  603.     }
  604. });
  605. _.set(linb.Locale,["cn","doc","linb","DomProfile"], {
  606. });
  607. _.set(linb.Locale,["cn","doc","linb","DataBinder"], {
  608.     constructor:{
  609.         $desc:"生成一个databinder对象."
  610.     },
  611.     destroyAll:{
  612.         $desc:"销毁所有linb.DataBinder对象.",
  613.         $snippet:[
  614.             "//linb.DataBinder.destroyAll()"
  615.         ]
  616.     },
  617.     getFromName:{
  618.         $desc:"获取名字为指定值的linb.DataBinder对象.",
  619.         $rtn:'linb.DataBinder object.',
  620.         $paras:[
  621.             "name [必需参数] : String, DataBinder名字."
  622.         ],
  623.         $snippet:[
  624.             "var db=new linb.DataBinder();db.setName('abc');"+
  625.             "alert(db=linb.DataBinder.getFromName('abc'));"+
  626.             "db.destroy();"+
  627.             "alert(linb.DataBinder.getFromName('abc'));"
  628.         ]
  629.     },
  630.     prototype:{
  631.         checkValid:{
  632.             $desc:"检查所有绑定值是否有效. 例如: 用户输入了字符到数字框里面,而数字框又绑定了databinder, 这个函数就会返回[false].",
  633.             $rtn:"Bool"
  634.         },
  635.         destroy:{
  636.             $desc:"销毁该对象.",
  637.             $memo:"Usually, we do not need to call this function manually."
  638.         },
  639.         setName:{
  640.             $desc:"设置数据绑定器的名称.",
  641.             $rtn:'[self]',
  642.             $paras:[
  643.                 "value [必需参数] : String, 名字字符串"
  644.             ],
  645.             $memo:"参看'getValue'代码片段. "
  646.         },
  647.         getUI:{
  648.             $desc:"获取绑定在本对象上的UI.",
  649.             $rtn:'linb.UI object.',
  650.             $memo:"To see the 'getValue' snippets. ",
  651.             $snippet:[
  652.                 "var id='linb.temp.ui'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  653.                 "linb(id).append(new linb.UI.Input({position:'relative',dataBinder:'abc'}));"+
  654.                 "alert(linb.DataBinder.getFromName('abc').getUI().serialize());"+
  655.                 "}"
  656.             ]
  657.         },
  658.         getName:{
  659.             $desc:"返回数据绑定器名字.",
  660.             $rtn:'String',
  661.             $memo:"参看'getValue'代码片段. "
  662.         },
  663.         getValue:{
  664.             $desc:"获取键值对, that includes the values of all those bound linb.absValue profiles.",
  665.             $rtn:"key/value pairs object.",
  666.             $snippet:[
  667.                 "var id='linb.temp.cv'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  668.                 "var db1=new linb.DataBinder,i1=new linb.UI.Input({position:'relative'}), i2=new linb.UI.Input({position:'relative'}); db1.setName('db1'); i1.setValue('aaa').setDataBinder('db1').setDataField('i1'); i2.setValue('bbb').setDataBinder('db1').setDataField('i2');"+
  669.                 "linb(id).append(i1).append(i2);"+
  670.                 "alert(db1.getName());"+
  671.                 "alert(_.serialize(db1.getValue()));"+
  672.                 "_.asyRun(function(){"+
  673.                 "   db1.resetValue({i1:'111',i2:'222'});"+
  674.                 "   alert(_.serialize(db1.getValue()));"+
  675.                 "},3000);"+
  676.                 "}"
  677.             ]
  678.         },
  679.         resetValue:{
  680.             $desc:"设置或重设被绑定linb.absValue的值.",
  681.             $rtn:"[self].",
  682.             $paras:[
  683.                 "hash [可选参数] : a key/value pairs object. 如果参数没有被设定, 被绑定的linb.absValue profiles 将被重设为初始值."
  684.             ],
  685.             $memo:"参看'getValue'代码片段. "
  686.         }
  687.     }
  688. });
  689. _.set(linb.Locale,["cn","doc","linb","Tips"], {
  690.     AUTOHIDETIME:{
  691.         $desc:"指示多少毫秒后tip自动隐藏. 该参数在MOABLE设置为[true]时有效.",
  692.         $snippet:["alert(linb.Tips.AUTOHIDETIME)"]
  693.     },
  694.     DELAYTIME:{
  695.         $desc:"指示在function 'linb.Tips.show'调用后多少毫秒后显示tip.",
  696.         $snippet:["alert(linb.Tips.DELAYTIME)"]
  697.     },
  698.     MAXWIDTH:{
  699.         $desc:"tooltips的最大宽度.",
  700.         $snippet:["alert(linb.Tips.MAXWIDTH)"]
  701.     },
  702.     MOVABLE:{
  703.         $desc:"指示tip是否跟随鼠标移动.",
  704.         $snippet:["alert(linb.Tips.MOVABLE)"]
  705.     },
  706.     TIPSKEY:{
  707.         $desc:"tooltips的键. 默认为'tips'.",
  708.         $snippet:["alert(linb.Tips.TIPSKEY)"]
  709.     },
  710.     getTips:{
  711.         $desc:"获取tips显示的字符串.",
  712.         $snippet:[
  713.             "linb.Tips.show({left:100,top:100}, 'a string');"+
  714.             "alert(linb.Tips.getTips());"+
  715.             "linb.Tips.hide();"+
  716.             "alert(linb.Tips.getTips());"
  717.         ]
  718.     },
  719.     hide:{
  720.         $desc:"隐藏tooltips.",
  721.         $snippet:[
  722.             "linb.Tips.show({left:100,top:100}, 'a string'); _.asyRun(function(){linb.Tips.hide()},1000); _.asyRun(function(){linb.Tips.show({left:100,top:100}, {tips:'an object with a \'tips\' key'})},2000); _.asyRun(function(){linb.Tips.hide()},3000); _.asyRun(function(){linb.Tips.show({left:100,top:100}, {any:'an object with a customizable key'},'any')},4000);_.asyRun(function(){linb.Tips.hide()},5000);"
  723.         ]
  724.     },
  725.     show:{
  726.         $desc:"显示tooltips.",
  727.         $paras:[
  728.             "pos [必需参数] : {left:Number,top:Number}, the position of the tooltips.",
  729.             "item [必需参数] : String or Object, to provide the tooltips content.",
  730.             "key [可选参数] : String, the tips key. 默认为 'tips'."
  731.         ],
  732.         $snippet:[
  733.             "linb.Tips.show({left:100,top:100}, 'a string'); _.asyRun(function(){linb.Tips.hide()},1000); _.asyRun(function(){linb.Tips.show({left:100,top:100}, {tips:'an object with a \'tips\' key'})},2000); _.asyRun(function(){linb.Tips.hide()},3000); _.asyRun(function(){linb.Tips.show({left:100,top:100}, {any:'an object with a customizable key'},'any')},4000);_.asyRun(function(){linb.Tips.hide()},5000);"
  734.         ]
  735.     }
  736. });
  737. _.set(linb.Locale,["cn","doc","linb","Coder"], {
  738.     formatText:{
  739.         $desc:"将js/css/php/html代码片段格式化为更加可读的格式.",
  740.         $rtn:"String",
  741.         $paras:[
  742.             "code [必需参数] : String, 代码片段.",
  743.             "type [可选参数] : String, 代码片段类型. 默认是 'js'"
  744.         ],
  745.         $snippet:[
  746.             "alert(linb.Coder.formatText('var a=function(){var a=1;var b=2;var c={a:1,b:2};};'))",
  747.             "alert(linb.Coder.formatText('.cls{left:0;top:0}','css'))",
  748.             "alert(linb.Coder.formatText('<div><p>1</p><p>2</p><p><span>3</span>4</p></div>','html'))",
  749.             "alert(linb.Coder.formatText(' foreach ($d as $k => $v){print $k.$v;}','php'))"
  750.         ]
  751.     },
  752.     formatHTML:{
  753.         $desc:"将js/css/php/html代码片段转化为更可读的HTML.",
  754.         $rtn:"String",
  755.         $paras:[
  756.             "code [必需参数] : String, code snippet.",
  757.             "type [可选参数] : String, code type. Defalut is 'js'",
  758.             "paras [可选参数] : Array of String. Commands, e.g. ['plain','run']",
  759.             "id [可选参数] : String, the output HTML DOM id.",
  760.             "height [可选参数] : Number, the output HTML height."
  761.         ],
  762.         $snippet:[
  763.             "var str=linb.Coder.formatHTML('var a=function(){var a=1;var b=2;var c={a:1,b:2};};alert(1);','js',['plain','run'],'i-d'); linb.UI.Dialog.alert('linb.Coder', str)",
  764.             "var str=linb.Coder.formatHTML('.cls{left:0;top:0}','css'); linb.UI.Dialog.alert('linb.Coder', str)",
  765.             "var str=linb.Coder.formatHTML('<div><p>1</p><p>2</p><p><span>3</span>4</p></div>','html'); linb.UI.Dialog.alert('linb.Coder', str)",
  766.             "var str=linb.Coder.formatHTML(' foreach ($d as $k => $v){print $k.$v;}','php',['plain']); linb.UI.Dialog.alert('linb.Coder', str)"
  767.         ]
  768.     },
  769.     formatAll:{
  770.         $desc:"将js/css/php/html代码片段转化为HTML. 相当于formatText + formatHTML.",
  771.         $rtn:"String",
  772.         $paras:[
  773.             "code [必需参数] : String, 代码片段.",
  774.             "type [可选参数] : String, 代码类型. 默认的 'js'",
  775.             "paras [可选参数] : Array of String. 指令, 例如 ['plain','run']",
  776.             "id [可选参数] : String, the output HTML DOM id.",
  777.             "height [可选参数] : Number, 输出的HTML高度."
  778.         ],
  779.         $snippet:[
  780.             "var str=linb.Coder.formatAll('var a=function(){var a=1;var b=2;var c={a:1,b:2};};alert(1);','js',['plain','run'],'i-d'); linb.UI.Dialog.alert('linb.Coder', str)",
  781.             "var str=linb.Coder.formatAll('.cls{left:0;top:0}','css'); linb.UI.Dialog.alert('linb.Coder', str)",
  782.             "var str=linb.Coder.formatAll('<div><p>1</p><p>2</p><p><span>3</span>4</p></div>','html'); linb.UI.Dialog.alert('linb.Coder', str)",
  783.             "var str=linb.Coder.formatAll(' foreach ($d as $k => $v){print $k.$v;}','php',['plain']); linb.UI.Dialog.alert('linb.Coder', str)"
  784.         ]
  785.     },
  786.     replace:{
  787.         $desc:"高级字符串替换.",
  788.         $rtn:"String",
  789.         $paras:[
  790.             "str [必需参数] : string, 目标串.",
  791.             "reg [必需参数] : Array: [string, string] 或 [RegExp, string].",
  792.             "replace [可选参数] : String, 替换串.",
  793.             "ignore_case [可选参数] : Bool, 指示是否忽略大小写。."
  794.         ],
  795.         $snippet:[
  796.             'alert(linb.Coder.replace("aAa","a","*",true));'+
  797.             'alert(linb.Coder.replace("aAa","a","*",false));'+
  798.             'alert(linb.Coder.replace("aAa","a","*"));'+
  799.             'alert(linb.Coder.replace("aAa",/a/,"*"));'+
  800.             'alert(linb.Coder.replace("aAa",["a","*"]));'+
  801.             'alert(linb.Coder.replace("aAa",[["a","*"]]));',
  802.             'alert(linb.Coder.replace("aAa",[["a","*"],[/A/,"-"]]))',
  803.             '//Use "$0" to protect "ab" in the string: n alert(linb.Coder.replace("aba",[["ab","$0"],["a","*"]]))',
  804.             'alert(linb.Coder.replace("aba ab a",[["ab","$0"],["a",function(s,i){return s[i].toUpperCase();}]]))'
  805.         ]
  806.     },
  807.     applyById:{
  808.         $desc:"将linb.Coder应用于给定id的所有元素.",
  809.         $paras:[
  810.             "id [必需参数] : String, DOM id.",
  811.             "formatAll [可选参数] : Bool, 指示使用'formatAll'还是'formatHTML', 默认为'formatHTML'."
  812.         ],
  813.         $memo:"该函数仅用于突出显示."
  814.     }
  815. });
  816. _.set(linb.Locale,["cn","doc","linb","absList"], {
  817.     prototype:{
  818.         fireItemClickEvent:{
  819.             $desc:"当list中的某一项被选择时调用.",
  820.             $paras:[
  821.                 "subId [必需参数] : String, 项的id."
  822.             ],
  823.             $snippet:[
  824.                 "var id='linb.temp.tabs6'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:200px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  825.                 "var o;linb(id).prepend(o=(new linb.UI.Tabs({height:'auto',items:[{id:'a',caption:'a a'},{id:'b',caption:'b b'},{id:'c',caption:'c c'}]})));"+
  826.                 "_.asyRun(function(){o.fireItemClickEvent('b')},1000);"+
  827.                 "}"
  828.             ]
  829.         },
  830.         updateItem:{
  831.             $desc:"Updates the specified item(key or value) and the corresponding DOM Element.",
  832.             $rtn:"String",
  833.             $paras:[
  834.                 "id [Required] : String. The node id.",
  835.                 "options [Required] : object. a key/value pairs."
  836.             ],
  837.             $snippet:[
  838.                 "var id='linb.temp.absl0-1'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  839.                 "var o=new linb.UI.TreeBar({width:'auto',iniFold:true,height:'auto',dock:'none',position:'relative',items:[{id:'a',caption:'a'},{id:'b',caption:'b'},{id:'c',caption:'c',sub:[{id:'cz',caption:'cz'}]}]});"+
  840.                 "linb(id).prepend(o);"+
  841.                 "_.asyRun(function(){o.updateItem('b',{caption:'bbb', image:'img/img.gif', imagePos:'left -16px'})},1000);" +
  842.                 "}"
  843.             ]
  844.         },
  845.         getItems:{
  846.             $desc:"获取所有项.",
  847.             $rtn:"String",
  848.             $snippet:[
  849.                 "var id='linb.temp.absl1'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  850.                 "var o;linb(id).prepend(o=new linb.UI.List({position:'relative',items:[{id:'a',caption:'a'},{id:'b',caption:'b'},{id:'c',caption:'c'}]}))"+
  851.                 "_.asyRun(function(){alert(_.serialize(o.getItems()))});"+
  852.                 "}"
  853.             ]
  854.         },
  855.         setItems:{
  856.             $desc:"设置项, 并刷新界面.",
  857.             $rtn:"[self]",
  858.             $paras:[
  859.                 "value [必需参数] : Array, 项数组.",
  860.                 "flag [可选参数] : Bool, 强制设置该属性值,即使属性已经设置为该值. 默认为 [false]."
  861.             ],
  862.             $snippet:[
  863.                 "var id='linb.temp.absl2'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  864.                 "var o;linb(id).prepend(o=new linb.UI.List({position:'relative',items:[{id:'a',caption:'a'},{id:'b',caption:'b'},{id:'c',caption:'c'}]}))"+
  865.                 "_.asyRun(function(){o.setItems([{id:'aaa',caption:'bbb'}])});"+
  866.                 "}"
  867.             ]
  868.         },
  869.         insertItems:{
  870.             $desc:"添加一些项.",
  871.             $rtn:"[self]",
  872.             $paras:[
  873.                 "arr [必需参数] : Array. 项数组.",
  874.                 "base [可选参数] : String. 基准项id.",
  875.                 "before [可选参数] : Bool. 指示在基准项前还是项后插入. 默认为项后;"
  876.             ],
  877.             $snippet:[
  878.                 "var id='linb.temp.absl3'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  879.                 "var o;linb(id).prepend(o=new linb.UI.List({position:'relative',items:[{id:'a',caption:'a'},{id:'b',caption:'b'},{id:'c',caption:'c'}]}));"+
  880.                 "_.asyRun(function(){o.insertItems([{id:'a1',caption:'a1'}],'b',true)},1000);"+
  881.                 "_.asyRun(function(){o.insertItems([{id:'c1',caption:'c1'}],'c',false)},2000);"+
  882.                 "_.asyRun(function(){o.insertItems([{id:'a0',caption:'a0'}],null,true)},3000);"+
  883.                 "_.asyRun(function(){o.insertItems([{id:'c2',caption:'c2'}],null,false)},4000);"+
  884.                 "_.asyRun(function(){o.insertItems([{id:'h',caption:'h'},{id:'i',caption:'i'}])},5000);"+
  885.                 "}"
  886.             ]
  887.         },
  888.         removeItems:{
  889.             $desc:"移除一系列项.",
  890.             $rtn:"String",
  891.             $paras:[
  892.                 "arr [必需参数] : Array. 要移除的项id数组."
  893.             ],
  894.             $snippet:[
  895.                 "var id='linb.temp.absl4'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  896.                 "var o;linb(id).prepend(o=new linb.UI.List({position:'relative',items:[{id:'a',caption:'a'},{id:'b',caption:'b'},{id:'c',caption:'c'}]}));"+
  897.                 "_.asyRun(function(){o.removeItems(['a','b'])},1000);"+
  898.                 "}"
  899.             ]
  900.         },
  901.         clearItems:{
  902.             $desc:"移除所有的项.",
  903.             $rtn:"String",
  904.             $paras:[
  905.                 "key [可选参数] : String. 包含所有项的临时键. 默认为 'ITEMS'."
  906.             ],
  907.             $snippet:[
  908.                 "var id='linb.temp.absl5'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  909.                 "var o;linb(id).prepend(o=new linb.UI.List({position:'relative',items:[{id:'a',caption:'a'},{id:'b',caption:'b'},{id:'c',caption:'c'}]}));"+
  910.                 "_.asyRun(function(){o.clearItems()},1000);"+
  911.                 "}"
  912.             ]
  913.         },
  914.         getListKey:{
  915.             $desc:"获取列表键.",
  916.             $rtn:"String",
  917.             $snippet:[
  918.                 "var id='linb.temp.abs6'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  919.                 "linb.UI.cacheData('test',[{id:'a',caption:'a'},{id:'b',caption:'b'},{id:'c',caption:'c'}]);"+
  920.                 "linb.UI.cacheData('test2',[{id:'aa',caption:'aa'},{id:'bb',caption:'bb'},{id:'cc',caption:'cc'}]);"+
  921.                 "var o;linb(id).prepend(o=new linb.UI.List({position:'relative',listKey:'test'}));"+
  922.                 "_.asyRun(function(){alert(o.getListKey())});"+
  923.                 "}"
  924.             ]
  925.         },
  926.         setListKey:{
  927.             $desc:"设置列表键.",
  928.             $rtn:"[self]",
  929.             $paras:[
  930.                 "value [必需参数] : String, 列表键.",
  931.                 "flag [可选参数] : Bool, 强制设置该属性值,即使属性已经设置为该值. 默认为 [false]."
  932.             ],
  933.             $snippet:[
  934.                 "var id='linb.temp.abs7'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  935.                 "linb.UI.cacheData('test',[{id:'a',caption:'a'},{id:'b',caption:'b'},{id:'c',caption:'c'}]);"+
  936.                 "linb.UI.cacheData('test2',[{id:'aa',caption:'aa'},{id:'bb',caption:'bb'},{id:'cc',caption:'cc'}]);"+
  937.                 "var o;linb(id).prepend(o=new linb.UI.List({position:'relative',listKey:'test'}));"+
  938.                 "_.asyRun(function(){o.setListKey('test2')},1000);"+
  939.                 "}"
  940.             ]
  941.         },
  942.         getItemByItemId:{
  943.             $desc:"获取id为指定值的项对象.",
  944.             $rtn:"key/value pairs.",
  945.             $paras:[
  946.                 "itemId [必需参数] :String, 项id."
  947.             ],
  948.             $snippet:[
  949.                 "var pro=linb.UIProfile.getFromDomId('linb.UI.TreeBar:a:').boxing();alert(_.serialize( pro.getItemByItemId('Namespace') ))"
  950.             ]
  951.         },
  952.         getItemByDom:{
  953.             $desc:"获取DOM节点或DOM id对应的项对象.",
  954.             $rtn:"key/value pairs.",
  955.             $paras:[
  956.                 "src [必需参数] : DOM节点或DOM id."
  957.             ],
  958.             $snippet:[
  959.                 "var pro=linb.UIProfile.getFromDomId('linb.UI.TreeBar:a:').boxing();alert(_.serialize( pro.getItemByDom('linb.UI.TreeBar-ITEM:a:a') ))"
  960.             ]
  961.         },
  962.         getSubIdByItemId:{
  963.             $desc:"获取项的子项id.",
  964.             $rtn:"String",
  965.             $paras:[
  966.                 "itemId [必需参数] :String, 项id."
  967.             ],
  968.             $snippet:[
  969.                 "var pro=linb.UIProfile.getFromDomId('linb.UI.TreeBar:a:').boxing();alert(pro.getSubIdByItemId('Namespace') )"
  970.             ]
  971.         },
  972.         getSubNodeByItemId:{
  973.             $desc:"获取子项对应的DOM元素.",
  974.             $rtn:"String",
  975.             $paras:[
  976.                 "itemId [必需参数] :String, 项id."
  977.             ],
  978.             $snippet:[
  979.                 "var pro=linb.UIProfile.getFromDomId('linb.UI.TreeBar:a:').boxing();alert(pro.getSubNodeByItemId('Namespace') )"
  980.             ]
  981.         }
  982.     }
  983. });
  984. _.set(linb.Locale,["cn","doc","linb","absValue"], {
  985.     prototype:{
  986.         getDataBinder:{
  987.             $desc:"获取绑定的数据绑定器名称",
  988.             $rtn:"String",
  989.             $snippet:[
  990.                 "var id='linb.temp.absv1'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:100px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  991.                 "var o;linb(id).prepend(o=new linb.UI.Input);"+
  992.                 "_.asyRun(function(){o.setDataBinder('db1'); alert(o.getDataBinder())},1000)"+
  993.                 "}"
  994.             ]
  995.         },
  996.         setDataBinder:{
  997.             $desc:"设置数据绑定器名称.",
  998.             $rtn:"[self]",
  999.             $paras:[
  1000.                 "value [必需参数] : String.",
  1001.                 "flag [可选参数] : Bool, 强制设置该属性值,即使属性已经设置为该值. 默认为 [false]."
  1002.             ],
  1003.             $snippet:[
  1004.                 "var id='linb.temp.absv2'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:100px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1005.                 "var o;linb(id).prepend(o=new linb.UI.Input);"+
  1006.                 "_.asyRun(function(){o.setDataBinder('db1'); alert(o.getDataBinder())},1000)"+
  1007.                 "}"
  1008.             ]
  1009.         },
  1010.         getDataField:{
  1011.             $desc:"获取数据字段名称",
  1012.             $rtn:"String",
  1013.             $snippet:[
  1014.                 "var id='linb.temp.absv3'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:100px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1015.                 "var o;linb(id).prepend(o=new linb.UI.Input);"+
  1016.                 "_.asyRun(function(){o.setDataField('field1'); alert(o.getDataField())},1000)"+
  1017.                 "}"
  1018.             ]
  1019.         },
  1020.         setDataField:{
  1021.             $desc:"设置数据字段名称.",
  1022.             $rtn:"[self]",
  1023.             $paras:[
  1024.                 "value [必需参数] : String.",
  1025.                 "flag [可选参数] : Bool, 强制设置该属性值,即使属性已经设置为该值. 默认为 [false]."
  1026.             ],
  1027.             $snippet:[
  1028.                 "var id='linb.temp.absv4'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:100px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1029.                 "var o;linb(id).prepend(o=new linb.UI.Input);"+
  1030.                 "_.asyRun(function(){o.setDataField('field1'); alert(o.getDataField())},1000)"+
  1031.                 "}"
  1032.             ]
  1033.         },
  1034.         getUIValue:{
  1035.             $desc:"获取用户界面值",
  1036.             $rtn:"Any",
  1037.             $snippet:[
  1038.                 "var id='linb.temp.absv7'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:100px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1039.                 "var o;linb(id).prepend(o=new linb.UI.Input({value:'ini'}));"+
  1040.                 "_.asyRun(function(){alert(o.getUIValue())},1000)"+
  1041.                 "}"
  1042.             ]
  1043.         },
  1044.         setUIValue:{
  1045.             $desc:"设置用户界面值和控件值",
  1046.             $rtn:"[self]",
  1047.             $paras:[
  1048.                 "value [必需参数] : Any.",
  1049.                 "force [可选参数] : Bool. 强行赋值,即使赋值和现有值已经相同. 默认为 [false]."
  1050.             ],
  1051.             $snippet:[
  1052.                 "var id='linb.temp.absv81'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:100px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1053.                 "var o;linb(id).prepend(o=new linb.UI.Input({value:'ini'}));"+
  1054.                 "_.asyRun(function(){o.setUIValue('ini2'); alert(o.getUIValue());},1000)"+
  1055.                 "}"
  1056.             ],
  1057.             $memo:"调用该函数时,以下两个事件将被触发beforeUIValueSet and afterUIValueSet."
  1058.         },
  1059.         updateValue:{
  1060.             $desc:"将内部值更新为界面值",
  1061.             $rtn:"[self]",
  1062.             $snippet:[
  1063.                 "var id='linb.temp.absv82'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:100px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1064.                 "var o;linb(id).prepend(o=new linb.UI.Input({value:'ini'}));"+
  1065.                 "_.asyRun(function(){o.setUIValue('ini2').updateValue(); alert(o.getValue());},1000)"+
  1066.                 "}"
  1067.             ]
  1068.         },
  1069.         getValue:{
  1070.             $desc:"获取内部值",
  1071.             $rtn:"Any",
  1072.             $snippet:[
  1073.                 "var id='linb.temp.absv9'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:100px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1074.                 "var o;linb(id).prepend(o=new linb.UI.Input({value:'ini'}));"+
  1075.                 "_.asyRun(function(){alert(o.getValue())},1000)"+
  1076.                 "}"
  1077.             ]
  1078.         },
  1079.         setValue:{
  1080.             $desc:"设置内部值,界面值,和控件值",
  1081.             $rtn:"[self]",
  1082.             $paras:[
  1083.                 "value [必需参数] : Any.",
  1084.                 "flag [可选参数] : Bool, force to set the value even if the same value already exists. 默认为 [false]."
  1085.             ],
  1086.             $snippet:[
  1087.                 "var id='linb.temp.absv10'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:100px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1088.                 "var o;linb(id).prepend(o=new linb.UI.Input({value:'ini'}));"+
  1089.                 "_.asyRun(function(){o.setValue('ini2'); alert(o.getValue());},1000)"+
  1090.                 "}"
  1091.             ],
  1092.             $memo:"调用该函数时,以下两个事件将被触发: beforeValueSet and afterValueSet."
  1093.         },
  1094.         checkValid:{
  1095.             $desc:"检查界面值是否有效",
  1096.             $rtn:"Bool",
  1097.             $snippet:[
  1098.                 "var id='linb.temp.absv11'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:100px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1099.                 "var o;linb(id).prepend(o=new linb.UI.Input({value:'ini',valueFormat:'^-?\\d\\d*$'}));"+
  1100.                 "_.asyRun(function(){alert(o.checkValid());},1000)"+
  1101.                 "}"
  1102.             ]
  1103.         },
  1104.         isDirtied:{
  1105.             $desc:"判断界面值已经被修改.",
  1106.             $rtn:"Bool",
  1107.             $snippet:[
  1108.                 "var id='linb.temp.absv13'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:100px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1109.                 "var o;linb(id).prepend(o=new linb.UI.Input({value:'ini'}));"+
  1110.                 "_.asyRun(function(){o.setUIValue('ini2');alert(o.isDirtied());},1000)"+
  1111.                 "}"
  1112.             ]
  1113.         },
  1114.         resetValue:{
  1115.             $desc:"重新设置内部值, 界面值和控件值。 该函数不会触发任何事件.",
  1116.             $rtn:'[self]',
  1117.             $paras:[
  1118.                 "value [可选参数] : Any, 重设的新值. 默认为 ''."
  1119.             ],
  1120.             $snippet:[
  1121.                 "var id='linb.temp.absv14'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:100px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1122.                 "var o;linb(id).prepend(o=new linb.UI.Input({value:'ini'}));"+
  1123.                 "o.setUIValue('ini2');_.asyRun(function(){o.resetValue('ini2');},1000)"+
  1124.                 "}"
  1125.             ]
  1126.         },
  1127.         beforeUIValueSet:{
  1128.             $desc:"在setUIValue调用之前被调用. 返回false会阻止setUIValue被调用.",
  1129.             $paras:[
  1130.                 "profile : linb.UIProfile.",
  1131.                 "oldValue : 旧的界面值.",
  1132.                 "newValue : 新的界面值."
  1133.             ],
  1134.             $snippet:[
  1135.                 "var id='linb.temp.absv15'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:100px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1136.                 "var o;linb(id).prepend(o=new linb.UI.Input({value:'ini'}));"+
  1137.                 "var arr=[];"+
  1138.                 "o.beforeUIValueSet(function(p,o,v){arr.push('beforeUIValueSet: '+o+'->'+v)}).afterUIValueSet(function(p,o,v){arr.push('afterUIValueSet: '+o+'->'+v)}).beforeValueSet(function(p,o,v){arr.push('beforeValueSet: '+o+'->'+v)}).afterValueSet(function(p,o,v){arr.push('afterValueSet: '+o+'->'+v)});"+
  1139.                 "_.asyRun(function(){o.setUIValue('ini2');},100);"+
  1140.                 "_.asyRun(function(){o.setValue('ini3');},200);"+
  1141.                 "_.asyRun(function(){alert(arr.join('\n'));},220);"+
  1142.                 "}"
  1143.             ]
  1144.         },
  1145.         afterUIValueSet:{
  1146.             $desc:"在setUIValue调用之后被调用.",
  1147.             $paras:[
  1148.                 "profile : linb.UIProfile.",
  1149.                 "oldValue : 旧的界面值.",
  1150.                 "newValue : 新的界面值."
  1151.             ],
  1152.             $snippet:[
  1153.                 "var id='linb.temp.absv16'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:100px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1154.                 "var o;linb(id).prepend(o=new linb.UI.Input({value:'ini'}));"+
  1155.                 "var arr=[];"+
  1156.                 "o.beforeUIValueSet(function(p,o,v){arr.push('beforeUIValueSet: '+o+'->'+v)}).afterUIValueSet(function(p,o,v){arr.push('afterUIValueSet: '+o+'->'+v)}).beforeValueSet(function(p,o,v){arr.push('beforeValueSet: '+o+'->'+v)}).afterValueSet(function(p,o,v){arr.push('afterValueSet: '+o+'->'+v)});"+
  1157.                 "_.asyRun(function(){o.setUIValue('ini2');},100);"+
  1158.                 "_.asyRun(function(){o.setValue('ini3');},200);"+
  1159.                "_.asyRun(function(){alert(arr.join('\n'));},220);"+
  1160.                 "}"
  1161.             ]
  1162.         },
  1163.         beforeValueSet:{
  1164.             $desc:"在setValue调用之前被调用. 返回false会阻止setValue被调用.",
  1165.             $paras:[
  1166.                 "profile : linb.UIProfile.",
  1167.                 "oldValue : 旧的内部值.",
  1168.                 "newValue : 新的内部值."
  1169.             ],
  1170.             $snippet:[
  1171.                 "var id='linb.temp.absv17'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:100px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1172.                 "var o;linb(id).prepend(o=new linb.UI.Input({value:'ini'}));"+
  1173.                 "var arr=[];"+
  1174.                 "o.beforeUIValueSet(function(p,o,v){arr.push('beforeUIValueSet: '+o+'->'+v)}).afterUIValueSet(function(p,o,v){arr.push('afterUIValueSet: '+o+'->'+v)}).beforeValueSet(function(p,o,v){arr.push('beforeValueSet: '+o+'->'+v)}).afterValueSet(function(p,o,v){arr.push('afterValueSet: '+o+'->'+v)});"+
  1175.                 "_.asyRun(function(){o.setUIValue('ini2');},100);"+
  1176.                 "_.asyRun(function(){o.setValue('ini3');},200);"+
  1177.                "_.asyRun(function(){alert(arr.join('\n'));},220);"+
  1178.                 "}"
  1179.             ]
  1180.         },
  1181.         afterValueSet:{
  1182.             $desc:"在setValue调用之后被调用.",
  1183.             $paras:[
  1184.                 "profile : linb.UIProfile.",
  1185.                 "oldValue : 旧的内部值.",
  1186.                 "newValue : 新的内部值."
  1187.             ],
  1188.             $snippet:[
  1189.                 "var id='linb.temp.absv18'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:100px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1190.                 "var o;linb(id).prepend(o=new linb.UI.Input({value:'ini'}));"+
  1191.                 "var arr=[];"+
  1192.                 "o.beforeUIValueSet(function(p,o,v){arr.push('beforeUIValueSet: '+o+'->'+v)}).afterUIValueSet(function(p,o,v){arr.push('afterUIValueSet: '+o+'->'+v)}).beforeValueSet(function(p,o,v){arr.push('beforeValueSet: '+o+'->'+v)}).afterValueSet(function(p,o,v){arr.push('afterValueSet: '+o+'->'+v)});"+
  1193.                 "_.asyRun(function(){o.setUIValue('ini2');},100);"+
  1194.                 "_.asyRun(function(){o.setValue('ini3');},200);"+
  1195.                "_.asyRun(function(){alert(arr.join('\n'));},220);"+
  1196.                 "}"
  1197.             ]
  1198.         },
  1199.         beforeDirtyMark:{
  1200.             $desc:"在_setDirtyMark调用之前被调用. 返回false将阻止设置脏标志.",
  1201.             $paras:[
  1202.                 "profile : linb.UIProfile.",
  1203.                 "dirty : 脏标志."
  1204.             ],
  1205.             $snippet:[
  1206.                 "var id='linb.temp.absv19'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:100px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1207.                 "var o1,o2;linb(id).prepend(o1=new linb.UI.Input({value:'111',position:'relative'})).prepend(o2=new linb.UI.Input({value:'111',position:'relative'}));"+
  1208.                 "o1.beforeDirtyMark(function(p,dirty){p.getSubNode('INPUT').css('background',dirty?'#00ff00':'');return false;});"+
  1209.                 "_.asyRun(function(){o1.setUIValue('ini');o2.setUIValue('ini');},1000);"+
  1210.                 "_.asyRun(function(){o1.setUIValue('111');o2.setUIValue('111');},2000);"+
  1211.                 "}"
  1212.             ]
  1213.         }
  1214.     }
  1215. });
  1216. _.set(linb.Locale,["cn","doc","linb","absPlus"], {
  1217.     prototype:{
  1218.         getDragKey:{
  1219.             $desc:"获取拖动时的标志键",
  1220.             $rtn:"String",
  1221.             $snippet:[
  1222.                 "var id='linb.temp.d1'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:100px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1223.                 "var btn;linb(id).prepend(btn=new linb.UI.Button);"+
  1224.                 "_.asyRun(function(){btn.setDragKey('a'); alert(btn.getDragKey())},1000)"+
  1225.                 "}"
  1226.             ]
  1227.         },
  1228.         setDragKey:{
  1229.             $desc:"设置拖动时的标志键",
  1230.             $rtn:"[self]",
  1231.             $snippet:[
  1232.                 "var id='linb.temp.d2'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:100px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1233.                 "var btn;linb(id).prepend(btn=new linb.UI.Button);"+
  1234.                 "_.asyRun(function(){btn.setDragKey('a'); alert(btn.getDragKey())},1000)"+
  1235.                 "}"
  1236.             ]
  1237.         },
  1238.         getDropKeys:{
  1239.             $desc:"获取鼠标丢下时的标志键",
  1240.             $rtn:"String",
  1241.             $snippet:[
  1242.                 "var id='linb.temp.d3'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:100px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1243.                 "var btn;linb(id).prepend(btn=new linb.UI.Block({position:'relative',border:true}));"+
  1244.                 "_.asyRun(function(){btn.setDropKeys('a:b'); alert(btn.getDropKeys())},1000)"+
  1245.                 "}"
  1246.             ]
  1247.         },
  1248.         setDropKeys:{
  1249.             $desc:"设置鼠标丢下时的标志键",
  1250.             $rtn:"[self]",
  1251.             $snippet:[
  1252.                 "var id='linb.temp.d4'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;height:100px;width:300px;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1253.                 "var btn;linb(id).prepend(btn=new linb.UI.Block({position:'relative',border:true}));"+
  1254.                 "_.asyRun(function(){btn.setDropKeys('a:b'); alert(btn.getDropKeys())},1000)"+
  1255.                 "}"
  1256.             ]
  1257.         },
  1258.         addPanel:{
  1259.             $desc:"添加一个面板.",
  1260.             $paras:[
  1261.                 "para [必需参数] : 键值对.",
  1262.                 "children [必需参数] : Array. 面板的子控件.",
  1263.                 "item [可选参数] : Object"
  1264.             ],
  1265.             $snippet:[
  1266.                 "var id='linb.temp.d5'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1267.                 "var panel, tabs;"+
  1268.                 "linb(id).prepend(panel=new linb.UI.Panel({height:100,width:100,dock:'none',position:'relative'}));"+
  1269.                 "panel.append(new linb.UI.Button);"+
  1270.                 "linb(id).prepend(tabs=new linb.UI.Tabs({position:'relative',width:200, height:100, dock:'none',items:[{id:'a',caption:'a'},{id:'b',caption:'b'}]}));"+
  1271.                 "_.asyRun(function(){tabs.addPanel(panel.getPanelPara(), panel.getPanelChildren()); panel.removePanel();},1000);"+
  1272.                 "}"
  1273.             ]
  1274.         },
  1275.         removePanel:{
  1276.             $desc:"移除面板.",
  1277.             $snippet:[
  1278.                 "var id='linb.temp.d6'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1279.                 "var panel, tabs;"+
  1280.                 "linb(id).prepend(panel=new linb.UI.Panel({height:100,width:100,dock:'none',position:'relative'}));"+
  1281.                 "panel.append(new linb.UI.Button);"+
  1282.                 "linb(id).prepend(tabs=new linb.UI.Tabs({position:'relative',width:200, height:100, dock:'none',items:[{id:'a',caption:'a'},{id:'b',caption:'b'}]}));"+
  1283.                 "_.asyRun(function(){tabs.addPanel(panel.getPanelPara(), panel.getPanelChildren()); panel.removePanel();},1000);"+
  1284.                 "}"
  1285.             ]
  1286.         },
  1287.         getPanelPara:{
  1288.             $desc:"获取面板参数.",
  1289.             $snippet:[
  1290.                 "var id='linb.temp.d8'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1291.                 "var panel, tabs;"+
  1292.                 "linb(id).prepend(panel=new linb.UI.Panel({height:100,width:100,dock:'none',position:'relative'}));"+
  1293.                 "panel.append(new linb.UI.Button);"+
  1294.                 "linb(id).prepend(tabs=new linb.UI.Tabs({position:'relative',width:200, height:100, dock:'none',items:[{id:'a',caption:'a'},{id:'b',caption:'b'}]}));"+
  1295.                 "_.asyRun(function(){tabs.addPanel(panel.getPanelPara(), panel.getPanelChildren()); panel.removePanel();},1000);"+
  1296.                 "}"
  1297.             ]
  1298.         },
  1299.         getPanelChildren:{
  1300.             $desc:"获取面板的子控件.",
  1301.             $snippet:[
  1302.                 "var id='linb.temp.d9'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1303.                 "var panel, tabs;"+
  1304.                 "linb(id).prepend(panel=new linb.UI.Panel({height:100,width:100,dock:'none',position:'relative'}));"+
  1305.                 "panel.append(new linb.UI.Button);"+
  1306.                 "linb(id).prepend(tabs=new linb.UI.Tabs({position:'relative',width:200, height:100, dock:'none',items:[{id:'a',caption:'a'},{id:'b',caption:'b'}]}));"+
  1307.                 "_.asyRun(function(){tabs.addPanel(panel.getPanelPara(), panel.getPanelChildren()); panel.removePanel();},1000);"+
  1308.                 "}"
  1309.             ]
  1310.         },
  1311.         onHotKeydown:{
  1312.             $desc:"当热键按下时被调用.",
  1313.             $paras:[
  1314.                 "profile : linb.UIProfile.",
  1315.                 "key : String, 按下的字符.",
  1316.                 "control: Number, 1 or 0, 标志'control'是否被按下.",
  1317.                 "shift: Number, 1 or 0, 标志'shift'是否被按下.",
  1318.                 "alt: Number, 1 or 0, 标志'alt'是否被按下.",
  1319.                 "e : DOM 事件.",
  1320.                 "src : 事件发生的DOM元素."
  1321.             ],
  1322.             $snippet:[
  1323.                 "var id='linb.temp.c1'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1324.                 "var w, arr;linb(id).prepend(w=new linb.UI.Widget({position:'relative'}));"+
  1325.                 "w.setCustomStyle('KEY','border:solid 1px').getSubNode('BORDER').append(linb.create('<input />'));"+
  1326.                 "w.onHotKeydown(function( profile, key, control, shift, alt, e, src ){arr=[];arr.push(['onHotKeydown',key,control,shift,alt])});"+
  1327.                 "w.onHotKeypress(function( profile, key, control, shift, alt, e, src ){arr.push(['onHotKeypress',key,control,shift,alt]); });"+
  1328.                 "w.onHotKeyup(function( profile, key, control, shift, alt, e, src ){arr.push(['onHotKeyup',key,control,shift,alt]);alert(arr);});"+
  1329.                 "}"
  1330.             ]
  1331.         },
  1332.         onHotKeyup:{
  1333.             $desc:"当热键弹起时被调用..",
  1334.             $paras:[
  1335.                 "profile : linb.UIProfile.",
  1336.                 "key : String, 按下的字符.",
  1337.                 "control: Number, 1 or 0, 标志'control'是否被按下.",
  1338.                 "shift: Number, 1 or 0, 标志'shift'是否被按下.",
  1339.                 "alt: Number, 1 or 0, 标志'alt'是否被按下.",
  1340.                 "e : DOM 事件.",
  1341.                 "src : 事件发生的DOM元素."
  1342.             ],
  1343.             $snippet:[
  1344.                 "var id='linb.temp.c2'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1345.                 "var w, arr;linb(id).prepend(w=new linb.UI.Widget({position:'relative'}));"+
  1346.                 "w.setCustomStyle('KEY','border:solid 1px').getSubNode('BORDER').append(linb.create('<input />'));"+
  1347.                 "w.onHotKeydown(function( profile, key, control, shift, alt, e, src ){arr=[];arr.push(['onHotKeydown',key,control,shift,alt])});"+
  1348.                 "w.onHotKeypress(function( profile, key, control, shift, alt, e, src ){arr.push(['onHotKeypress',key,control,shift,alt]); });"+
  1349.                 "w.onHotKeyup(function( profile, key, control, shift, alt, e, src ){arr.push(['onHotKeyup',key,control,shift,alt]);alert(arr);});"+
  1350.                 "}"
  1351.             ]
  1352.         },
  1353.         onHotKeypress:{
  1354.             $desc:"当热键被按后调用.",
  1355.             $paras:[
  1356.                 "profile : linb.UIProfile.",
  1357.                 "key : String, 按下的字符.",
  1358.                 "control: Number, 1 or 0, 标志'control'是否被按下.",
  1359.                 "shift: Number, 1 or 0, 标志'shift'是否被按下.",
  1360.                 "alt: Number, 1 or 0, 标志'alt'是否被按下.",
  1361.                 "e : DOM 事件.",
  1362.                 "src : 事件发生的DOM元素."
  1363.             ],
  1364.             $snippet:[
  1365.                 "var id='linb.temp.c3'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1366.                 "var w, arr;linb(id).prepend(w=new linb.UI.Widget({position:'relative'}));"+
  1367.                 "w.setCustomStyle('KEY','border:solid 1px').getSubNode('BORDER').append(linb.create('<input />'));"+
  1368.                 "w.onHotKeydown(function( profile, key, control, shift, alt, e, src ){arr=[];arr.push(['onHotKeydown',key,control,shift,alt])});"+
  1369.                 "w.onHotKeypress(function( profile, key, control, shift, alt, e, src ){arr.push(['onHotKeypress',key,control,shift,alt]); });"+
  1370.                 "w.onHotKeyup(function( profile, key, control, shift, alt, e, src ){arr.push(['onHotKeyup',key,control,shift,alt]);alert(arr);});"+
  1371.                 "}"
  1372.             ]
  1373.         },
  1374.         onDragEnter:{
  1375.             $desc:"当用户拖动某个对象到该对象上空时.",
  1376.             $paras:[
  1377.                 "profile : linb.UIProfile.",
  1378.                 "e : DOM事件元素.",
  1379.                 "src : 事件发生的DOM元素.",
  1380.                 "key : String, 被拖动物体的拖动标志串.",
  1381.                 "data : Object, 拖动物体代表的数据.",
  1382.                 "item : Object, 被拖动物体的项."
  1383.             ],
  1384.             $snippet:[
  1385.                 "var id='linb.temp.ab1'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1386.                 "var block,btn1,btn2;linb(id).prepend(block=new linb.UI.Block({position:'relative',width:'200',border:true,dropKeys:['test']})).prepend(btn1=new linb.UI.Button({position:'relative'})).prepend(btn2=new linb.UI.Button({position:'relative'}));"+
  1387.                 "btn2.get(0).$noDrop=true;"+
  1388.                 "btn1.dragable('test',btn1.getDomId());"+
  1389.                 "btn2.dragable('test','abc');"+
  1390.                 "block.onDragEnter(function(p,e,n,k,d,i){block.setHtml(k+':'+d+' onDragEnter')});"+
  1391.                 "block.onDragLeave(function(p,e,n,k,d,i){block.setHtml(k+':'+d+' onDragLeave')});"+
  1392.                 "block.onDrop(function(p,e,n,k,d,i){block.setHtml(k+':'+d+' onDrop')});"+
  1393.                 "block.onDropMarkClear(function(p,e,n,k,d,i){block.getSubNode('PANEL').css('background','#fff')});"+
  1394.                 "block.onDropMarkShow(function(p,e,n,k,d,i){block.getSubNode('PANEL').css('background','#ccc')});"+
  1395.                 "block.onDropTest(function(p,e,n,k,d,i){return d!='abc';});"+
  1396.                 "}"
  1397.             ]
  1398.         },
  1399.         onDragLeave:{
  1400.             $desc:"当用户拖动某个对象离开该对象上空时.",
  1401.             $paras:[
  1402.                 "profile : linb.UIProfile.",
  1403.                 "e : DOM事件元素.",
  1404.                 "src : 事件发生的DOM元素.",
  1405.                 "key : String, 被拖动物体的拖动标志串.",
  1406.                 "data : Object, 拖动物体代表的数据.",
  1407.                 "item : Object, 被拖动物体的项."
  1408.             ],
  1409.             $snippet:[
  1410.                 "var id='linb.temp.ab2'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1411.                 "var block,btn1,btn2;linb(id).prepend(block=new linb.UI.Block({position:'relative',width:'200',border:true,dropKeys:['test']})).prepend(btn1=new linb.UI.Button({position:'relative'})).prepend(btn2=new linb.UI.Button({position:'relative'}));"+
  1412.                 "btn2.get(0).$noDrop=true;"+
  1413.                 "btn1.dragable('test',btn1.getDomId());"+
  1414.                 "btn2.dragable('test','abc');"+
  1415.                 "block.onDragEnter(function(p,e,n,k,d,i){block.setHtml(k+':'+d+' onDragEnter')});"+
  1416.                 "block.onDragLeave(function(p,e,n,k,d,i){block.setHtml(k+':'+d+' onDragLeave')});"+
  1417.                 "block.onDrop(function(p,e,n,k,d,i){block.setHtml(k+':'+d+' onDrop')});"+
  1418.                 "block.onDropMarkClear(function(p,e,n,k,d,i){block.getSubNode('PANEL').css('background','#fff')});"+
  1419.                 "block.onDropMarkShow(function(p,e,n,k,d,i){block.getSubNode('PANEL').css('background','#ccc')});"+
  1420.                 "block.onDropTest(function(p,e,n,k,d,i){return d!='abc';});"+
  1421.                 "}"
  1422.             ]
  1423.         },
  1424.         onDrop:{
  1425.             $desc:"当用户拖动某个对象在该对象上空放下时.",
  1426.             $paras:[
  1427.                 "profile : linb.UIProfile.",
  1428.                 "e : DOM事件元素.",
  1429.                 "src : 事件发生的DOM元素.",
  1430.                 "node : 被拖动对象的DOM元素.",
  1431.                 "key : String, 被拖动物体的拖动标志串.",
  1432.                 "data : Object, 拖动物体代表的数据.",
  1433.                 "item : Object, 被拖动物体的项."
  1434.             ],
  1435.             $snippet:[
  1436.                 "var id='linb.temp.ab3'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1437.                 "var block,btn1,btn2;linb(id).prepend(block=new linb.UI.Block({position:'relative',width:'200',border:true,dropKeys:['test']})).prepend(btn1=new linb.UI.Button({position:'relative'})).prepend(btn2=new linb.UI.Button({position:'relative'}));"+
  1438.                 "btn2.get(0).$noDrop=true;"+
  1439.                 "btn1.dragable('test',btn1.getDomId());"+
  1440.                 "btn2.dragable('test','abc');"+
  1441.                 "block.onDragEnter(function(p,e,n,k,d,i){block.setHtml(k+':'+d+' onDragEnter')});"+
  1442.                 "block.onDragLeave(function(p,e,n,k,d,i){block.setHtml(k+':'+d+' onDragLeave')});"+
  1443.                 "block.onDrop(function(p,e,n,k,d,i){block.setHtml(k+':'+d+' onDrop')});"+
  1444.                 "block.onDropMarkClear(function(p,e,n,k,d,i){block.getSubNode('PANEL').css('background','#fff')});"+
  1445.                 "block.onDropMarkShow(function(p,e,n,k,d,i){block.getSubNode('PANEL').css('background','#ccc')});"+
  1446.                 "block.onDropTest(function(p,e,n,k,d,i){return d!='abc';});"+
  1447.                 "}"
  1448.             ]
  1449.         },
  1450.         onDropMarkClear:{
  1451.             $desc:"当丢放标志被清除时调用.",
  1452.             $paras:[
  1453.                 "profile : linb.UIProfile.",
  1454.                 "e : DOM事件元素.",
  1455.                 "src : 事件发生的DOM元素.",
  1456.                 "key : String, 被拖动物体的拖动标志串.",
  1457.                 "data : Object, 拖动物体代表的数据.",
  1458.                 "item : Object, 被拖动物体的项."
  1459.             ],
  1460.             $snippet:[
  1461.                 "var id='linb.temp.ab4'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1462.                 "var block,btn1,btn2;linb(id).prepend(block=new linb.UI.Block({position:'relative',width:'200',border:true,dropKeys:['test']})).prepend(btn1=new linb.UI.Button({position:'relative'})).prepend(btn2=new linb.UI.Button({position:'relative'}));"+
  1463.                 "btn2.get(0).$noDrop=true;"+
  1464.                 "btn1.dragable('test',btn1.getDomId());"+
  1465.                 "btn2.dragable('test','abc');"+
  1466.                 "block.onDragEnter(function(p,e,n,k,d,i){block.setHtml(k+':'+d+' onDragEnter')});"+
  1467.                 "block.onDragLeave(function(p,e,n,k,d,i){block.setHtml(k+':'+d+' onDragLeave')});"+
  1468.                 "block.onDrop(function(p,e,n,k,d,i){block.setHtml(k+':'+d+' onDrop')});"+
  1469.                 "block.onDropMarkClear(function(p,e,n,k,d,i){block.getSubNode('PANEL').css('background','#fff')});"+
  1470.                 "block.onDropMarkShow(function(p,e,n,k,d,i){block.getSubNode('PANEL').css('background','#ccc')});"+
  1471.                 "block.onDropTest(function(p,e,n,k,d,i){return d!='abc';});"+
  1472.                 "}"
  1473.             ]
  1474.         },
  1475.         onDropMarkShow:{
  1476.             $desc:"当丢放标志被显示时调用.",
  1477.             $paras:[
  1478.                 "profile : linb.UIProfile.",
  1479.                 "e : DOM事件元素.",
  1480.                 "src : 事件发生的DOM元素.",
  1481.                 "key : String, 被拖动物体的拖动标志串.",
  1482.                 "data : Object, 拖动物体代表的数据.",
  1483.                 "item : Object, 被拖动物体的项."
  1484.             ],
  1485.             $snippet:[
  1486.                 "var id='linb.temp.ab5'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1487.                 "var block,btn1,btn2;linb(id).prepend(block=new linb.UI.Block({position:'relative',width:'200',border:true,dropKeys:['test']})).prepend(btn1=new linb.UI.Button({position:'relative'})).prepend(btn2=new linb.UI.Button({position:'relative'}));"+
  1488.                 "btn2.get(0).$noDrop=true;"+
  1489.                 "btn1.dragable('test',btn1.getDomId());"+
  1490.                 "btn2.dragable('test','abc');"+
  1491.                 "block.onDragEnter(function(p,e,n,k,d,i){block.setHtml(k+':'+d+' onDragEnter')});"+
  1492.                 "block.onDragLeave(function(p,e,n,k,d,i){block.setHtml(k+':'+d+' onDragLeave')});"+
  1493.                 "block.onDrop(function(p,e,n,k,d,i){block.setHtml(k+':'+d+' onDrop')});"+
  1494.                 "block.onDropMarkClear(function(p,e,n,k,d,i){block.getSubNode('PANEL').css('background','#fff')});"+
  1495.                 "block.onDropMarkShow(function(p,e,n,k,d,i){block.getSubNode('PANEL').css('background','#ccc')});"+
  1496.                 "block.onDropTest(function(p,e,n,k,d,i){return d!='abc';});"+
  1497.                 "}"
  1498.             ]
  1499.         },
  1500.         onDropTest:{
  1501.             $desc:"当判断该对象是否接受拖动时被调用.",
  1502.             $paras:[
  1503.                 "profile : linb.UIProfile.",
  1504.                 "e : DOM事件元素.",
  1505.                 "src : 事件发生的DOM元素.",
  1506.                 "key : String, 被拖动物体的拖动标志串.",
  1507.                 "data : Object, 拖动物体代表的数据.",
  1508.                 "item : Object, 被拖动物体的项."
  1509.             ],
  1510.             $snippet:[
  1511.                 "var id='linb.temp.ab61'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1512.                 "var block,btn1,btn2;linb(id).prepend(block=new linb.UI.Block({position:'relative',width:'200',border:true,dropKeys:['test']})).prepend(btn1=new linb.UI.Button({position:'relative'})).prepend(btn2=new linb.UI.Button({position:'relative'}));"+
  1513.                 "btn2.get(0).$noDrop=true;"+
  1514.                 "btn1.dragable('test',btn1.getDomId());"+
  1515.                 "btn2.dragable('test','abc');"+
  1516.                 "block.onDragEnter(function(p,e,n,k,d,i){block.setHtml(k+':'+d+' onDragEnter')});"+
  1517.                 "block.onDragLeave(function(p,e,n,k,d,i){block.setHtml(k+':'+d+' onDragLeave')});"+
  1518.                 "block.onDrop(function(p,e,n,k,d,i){block.setHtml(k+':'+d+' onDrop')});"+
  1519.                 "block.onDropMarkClear(function(p,e,n,k,d,i){block.getSubNode('PANEL').css('background','#fff')});"+
  1520.                 "block.onDropMarkShow(function(p,e,n,k,d,i){block.getSubNode('PANEL').css('background','#ccc')});"+
  1521.                 "block.onDropTest(function(p,e,n,k,d,i){return d!='abc';});"+
  1522.                 "}"
  1523.             ]
  1524.         },
  1525.         onStartDrag:{
  1526.             $desc:"当用户开始拖动该对象时调用.",
  1527.             $paras:[
  1528.                 "profile : linb.UIProfile.",
  1529.                 "e : DOM事件元素.",
  1530.                 "src : 事件发生的DOM元素."
  1531.             ],
  1532.             $snippet:[
  1533.                 "var id='linb.temp.ab661'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1534.                 "var list1,list2;linb(id).prepend(list1=new linb.UI.List({position:'relative',width:'200',border:true,dragKey:'test',items:['aa','bb','cc']})).prepend(list2=new linb.UI.List({position:'relative',width:'200',border:true,dragKey:'test',items:['aa','bb','cc']}));"+
  1535.                 "list2.onStartDrag(function(p,e,n){return false;});"+
  1536.                 "list1.onStartDrag(function(p,e,n){linb.message('onStartDrag');});"+
  1537.                 "list1.onDragStop(function(p,e,n){linb.message('onDragStop');});"+
  1538.                 "}"
  1539.             ]
  1540.         },
  1541.         onDragstop:{
  1542.             $desc:"当用户结束拖动该对象时调用.",
  1543.             $paras:[
  1544.                 "profile : linb.UIProfile.",
  1545.                 "e : DOM事件元素.",
  1546.                 "src : 事件发生的DOM元素."
  1547.             ],
  1548.             $snippet:[
  1549.                 "var id='linb.temp.ab662'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1550.                 "var list1,list2;linb(id).prepend(list1=new linb.UI.List({position:'relative',width:'200',border:true,dragKey:'test',items:['aa','bb','cc']})).prepend(list2=new linb.UI.List({position:'relative',width:'200',border:true,dragKey:'test',items:['aa','bb','cc']}));"+
  1551.                 "list2.onStartDrag(function(p,e,n){return false;});"+
  1552.                 "list1.onStartDrag(function(p,e,n){linb.message('onStartDrag');});"+
  1553.                 "list1.onDragStop(function(p,e,n){linb.message('onDragStop');});"+
  1554.                 "}"
  1555.             ]
  1556.         },
  1557.         beforeClickEffect:{
  1558.             $desc:"当用户单击控件的某一部分,控件响应该事件,要改变外观(例如反白等)时被调用. 返回false时, 默认的效果(如反白)将不会被显示.",
  1559.             $paras:[
  1560.                 "profile : linb.UIProfile.",
  1561.                 "item : Object, 数据项对象.",
  1562.                 "e : DOM事件元素.",
  1563.                 "src : 事件发生的DOM元素.",
  1564.                 "type : String, 'mousedown'或'mouseup'."
  1565.             ],
  1566.             $snippet:[
  1567.                 "var id='linb.temp.ab7'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1568.                 "var btn;linb(id).append(btn=new linb.UI.Button({position:'relative'}));"+
  1569.                 "btn.beforeClickEffect(function(p,i,e,s,t){linb([s]).css('border',t=='mousedown'?'solid 1px;':'');return false;});"+
  1570.                 "}"
  1571.             ]
  1572.         },
  1573.         beforeHoverEffect:{
  1574.             $desc:"当鼠标悬停在控件的某一部分上,控件响应该事件,要改变外观(例如反白等)时被调用. 返回false时, 默认的效果(如反白)将不会被显示.",
  1575.             $paras:[
  1576.                 "profile : linb.UIProfile.",
  1577.                 "item : Object, 数据项对象.",
  1578.                 "e : DOM事件元素.",
  1579.                 "src : 事件发生的DOM元素.",
  1580.                 "type : String, 'mousedown'或'mouseup'."
  1581.             ],
  1582.             $snippet:[
  1583.                 "var id='linb.temp.ab8'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1584.                 "var btn;linb(id).append(btn=new linb.UI.Button({position:'relative'}));"+
  1585.                 "btn.beforeHoverEffect(function(p,i,e,s,t){linb([s]).css('border',t=='mouseover'?'solid 1px;':'');return false;});"+
  1586.                 "}"
  1587.             ]
  1588.         },
  1589.         beforeNextFocus:{
  1590.             $desc:"在下一个控件获取焦点时调用. 返回false可以阻止下一个控件获取焦点.",
  1591.             $paras:[
  1592.                 "profile : linb.UIProfile.",
  1593.                 "e : DOM事件元素.",
  1594.                 "shift: Bool, 指示用户是否按下了Shift键.",
  1595.                 "src : 事件发生的DOM元素."
  1596.             ],
  1597.             $snippet:[
  1598.                 "var id='linb.temp.ab9'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1599.                 "var btn;linb(id).append(new linb.UI.Button({position:'relative'})).append(new linb.UI.Button({position:'relative'})).append(btn=new linb.UI.Button({position:'relative'})).append(new linb.UI.Button({position:'relative'}));"+
  1600.                 "btn.beforeNextFocus(function(){return false;});"+
  1601.                 "}"
  1602.             ]
  1603.         }
  1604.     }
  1605. });
  1606. _.set(linb.Locale,["cn","doc","linb","UI"], {
  1607.     buildCSSText:{
  1608.         $desc:"由指定的键/值对生成CSS样式.",
  1609.         $rtn:"String. CSS样式",
  1610.         $paras:[
  1611.             "hash [必需参数] : 键/值对."
  1612.         ],
  1613.         $snippet:[
  1614.             "alert(linb.UI.Button.buildCSSText({KEY:{left:linb.browser.ie?0:null,overflow:linb.browser.gek?'auto':null,'font-size':'12px'},BORDER:{'_line-height':10,'-moz-display':'none'}}));"+
  1615.             "alert(linb.UI.Button.buildCSSText({KEY:{left:linb.browser.ie?0:null,overflow:linb.browser.gek?'auto':null,'font-size':'12px'},BORDER:{'_line-height':10,'-moz-display':'none'}},'mac'));"
  1616.         ]
  1617.     },
  1618.     getTheme:{
  1619.         $desc:"获取皮肤键字符串.",
  1620.         $rtn:"String",
  1621.         $snippet:[
  1622.             "alert(linb.UI.getTheme());"
  1623.         ]
  1624.     },
  1625.     setTheme:{
  1626.         $desc:"设置皮肤键字符串.",
  1627.         $rtn:"[self]",
  1628.         $paras:[
  1629.             "key [可选参数] : String, 皮肤键字符串."
  1630.         ],
  1631.         $snippet:[
  1632.             "//linb.UI.setTheme('xp')"
  1633.         ]
  1634.     },
  1635.     adjustData:{
  1636.         $desc:"调整输入的键/值对,输出合适的数据格式以便UI控件生成.",
  1637.         $rtn:"key/value pairs.",
  1638.         $paras:[
  1639.             "profile [必需参数] : 目标profile",
  1640.             "hashIn [必需参数] : 键/值对, 输入参数.",
  1641.             "hashOut [可选参数] : 键/值对, 输出参数."
  1642.         ],
  1643.         $snippet:[
  1644.             "alert(_.serialize(linb.UI.adjustData(null, {a:1,b:2,c:'$date.MS',d:'@linb.ini.path',renderer:function(){return 'cap';}})))"
  1645.         ]
  1646.     },
  1647.     addTemplateKeys:{
  1648.         $desc:"添加一系列模板键到当前的UI控件.",
  1649.         $rtn:'[self]',
  1650.         $paras:[
  1651.             "arr [必需参数] : Array, 模板键数组."
  1652.         ],
  1653.         $snippet:[
  1654.             "alert(_.serialize(linb.UI.Div.$Keys)); alert(_.serialize(linb.UI.Div.addTemplateKeys(['A','B']).$Keys))"
  1655.         ],
  1656.         $memo:"一般情况下,程序员无需直接调用该函数."
  1657.     },
  1658.     getAppearance:{
  1659.         $desc:"获取控件外表对象",
  1660.         $rtn:'object',
  1661.         $snippet:[
  1662.             "alert(_.serialize(linb.UI.Div.getAppearance()))"
  1663.         ],
  1664.         $memo:"一般情况下,程序员无需直接调用该函数."
  1665.     },
  1666.     getTemplate:{
  1667.         $desc:"从一个缓存id中设置获取模板对象.",
  1668.         $rtn:'object',
  1669.         $paras:[
  1670.             "cacheId [可选参数] : String."
  1671.         ],
  1672.         $snippet:[
  1673.             "alert(_.serialize(linb.UI.Div.getTemplate()))"
  1674.         ],
  1675.         $memo:"一般情况下,程序员无需直接调用该函数."
  1676.     },
  1677.     getBehavior:{
  1678.         $desc:"获取控件行为对象.",
  1679.         $rtn:'object',
  1680.         $snippet:[
  1681.             "alert(_.serialize(linb.UI.Link.getBehavior()))"
  1682.         ],
  1683.         $memo:"一般情况下,程序员无需直接调用该函数."
  1684.     },
  1685.     setAppearance:{
  1686.         $desc:"设置控件外表对象.",
  1687.         $rtn:'[self]',
  1688.         $paras:[
  1689.             "hash [必需参数] : key/value pairs."
  1690.         ],
  1691.         $memo:"一般情况下,程序员无需直接调用该函数."
  1692.     },
  1693.     setTemplate:{
  1694.         $desc:"设置一个模板对象到指定的缓存id中.",
  1695.         $rtn:'[self]',
  1696.         $paras:[
  1697.             "hash [必需参数] : key/value pairs.",
  1698.             "cacheId [可选参数] : String."
  1699.         ],
  1700.         $memo:"一般情况下,程序员无需直接调用该函数."
  1701.     },
  1702.     setBehavior:{
  1703.         $desc:"设置行为对象.",
  1704.         $rtn:'[self]',
  1705.         $memo:"一般情况下,程序员无需直接调用该函数."
  1706.     },
  1707.     cacheData:{
  1708.         $desc:"缓存数据或移除缓存数据。并为该缓存数据指定一个唯一标志.",
  1709.         $rtn:'[self]',
  1710.         $paras:[
  1711.             "key [必需参数] : String, 缓存数据的唯一标志.",
  1712.             "data [可选参数] : Any. 如果设置为undefined, 则移除标志为key的缓存数据."
  1713.         ],
  1714.         $snippet:[
  1715.             "linb.UI.cacheData('a',1); alert(linb.UI.getCachedData('a')); linb.UI.cacheData('a')"
  1716.         ]
  1717.     },
  1718.     getCachedData:{
  1719.         $desc:"获取指定标志的缓存数据.",
  1720.         $rtn:"Any",
  1721.         $paras:[
  1722.             "key [必需参数] : String, cache key."
  1723.         ],
  1724.         $snippet:[
  1725.             "linb.UI.cacheData('a',1); alert(linb.UI.getCachedData('a')); linb.UI.cacheData('a')"
  1726.         ]
  1727.     },
  1728.     getDragData:{
  1729.         $desc:"获取拖动数据.",
  1730.         $rtn:"Object",
  1731.         $paras:[
  1732.             "profile [必需参数] : 目标profile对象",
  1733.             "node [必需参数] : 相关的DOM元素."
  1734.         ],
  1735.         $memo:"一般情况下,程序员无需直接调用该函数. 该函数会被部分子类覆盖."
  1736.     },
  1737.     getDragKey:{
  1738.         $desc:"获取拖动时的键名字.",
  1739.         $rtn:"String",
  1740.         $paras:[
  1741.             "profile [必需参数] : 目标profile对象",
  1742.             "node [必需参数] : 相关的DOM元素."
  1743.         ],
  1744.         $memo:"一般情况下,程序员无需直接调用该函数. 该函数会被部分子类覆盖."
  1745.     },
  1746.     getDropKeys:{
  1747.         $desc:"设置拖动时的键名字.",
  1748.         $rtn:"Array",
  1749.         $paras:[
  1750.             "profile [必需参数] : the target profile",
  1751.             "node [必需参数] : the related DOM element."
  1752.         ],
  1753.         $memo:"一般情况下,程序员无需直接调用该函数. 该函数会被部分子类覆盖."
  1754.     },
  1755.     unserialize:{
  1756.         $desc:"将JSON字符串或数组反序列化为linb.UI对象.",
  1757.         $rtn:"linb.UI object",
  1758.         $paras:[
  1759.             "target [必需参数] : String or Array.",
  1760.             "keepSerialId [可选参数] : Bool. 指示是否保留序列号. 默认为 [false]."
  1761.         ],
  1762.         $snippet:[
  1763.             "var s=linb.UIProfile.getFromDomId('logo').boxing().serialize(false); alert(_.serialize(s)); alert(linb.UI.unserialize(s))"
  1764.         ]
  1765.     },
  1766.     prototype:{
  1767.         busy:{
  1768.             $desc:"将鼠标显示为沙漏(并将一个div覆盖在当前控件上). ",
  1769.             $rtn:"[self]",
  1770.             $paras:[
  1771.                 "message [可选参数] : String, 说明文字.",
  1772.                 "html [可选参数] : String, 说明html字符串.",
  1773.                 "key [可选参数] : String, 覆盖div的父key. 默认为 'BORDER'."
  1774.             ],
  1775.             $snippet:[
  1776.                 "var id='linb.temp.tl1'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1777.                 "var o=new linb.UI.TimeLine({position:'relative'});"+
  1778.                 "linb(id).prepend(o);"+
  1779.                 "o.busy('Loading message');"+
  1780.                 "_.asyRun(function(){o.free()},1000);"+
  1781.                 "}"
  1782.             ]
  1783.         },
  1784.         free:{
  1785.             $desc:"将鼠标显示为正常(并将覆盖div移除).",
  1786.             $rtn:"[self]",
  1787.             $snippet:[
  1788.                 "var id='linb.temp.tl2'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:20px;position:relative;">' + '<button style="position:absolute; bottom:0px; z-index:2;" onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1789.                 "var o=new linb.UI.TimeLine({position:'relative'});"+
  1790.                 "linb(id).prepend(o);"+
  1791.                 "o.busy('Loading message');"+
  1792.                 "_.asyRun(function(){o.free()},1000);"+
  1793.                 "}"
  1794.             ]
  1795.         },
  1796.         resize:{
  1797.             $desc:"触发onresize事件.",
  1798.             $rtn:"[self]"
  1799.         },
  1800.         getChildren:{
  1801.             $desc:"Gets the current widget's children.",
  1802.             $rtn:"linb.UI object",
  1803.             $paras:[
  1804.                 "subId [Optional] : String, the sub id."
  1805.             ],
  1806.             $snippet:[
  1807.                 "var id='linb.temp.ui-1e'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1808.                 "var tabs;linb(id).prepend(tabs=linb.create({key:'linb.UI.Tabs',properties:{dock:'none',width:200,height:100,position:'relative',items:['a','b','c'],value:'a'},children:[[{key:'linb.UI.Button'},'a'],[{key:'linb.UI.Button'},'b'],[{key:'linb.UI.Button'},'c']]}));"+
  1809.                 "_.asyRun(function(){alert(tabs.getChildren().get().length);alert(tabs.getChildren('a').get().length);},1000);"+
  1810.                 "}"
  1811.             ]
  1812.         },
  1813.         toHtml:{
  1814.             $desc:"To build HTML string from the current object, and returns it.",
  1815.             $rtn:"String",
  1816.             $snippet:[
  1817.                 "alert(linb.UIProfile.getFromDomId('logo').boxing().toHtml())"
  1818.             ]
  1819.         },
  1820.         getRenderer:{
  1821.             $desc:"获取渲染函数.",
  1822.             $rtn:"Function",
  1823.             $snippet:[
  1824.                 "var id='linb.temp.ui-1'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1825.                 "var link=new linb.UI.Link({position:'relative'});"+
  1826.                 "link.setRenderer(function(item){return '['+item.caption+']'});"+
  1827.                 "linb(id).prepend(link);"+
  1828.                 "_.asyRun(function(){alert(link.getRenderer());},1000);"+
  1829.                 "}"
  1830.             ]
  1831.         },
  1832.         setRenderer:{
  1833.             $desc:"设置渲染函数.",
  1834.             $rtn:"[self]",
  1835.             $paras:[
  1836.                 "value [必需参数] : Function",
  1837.                 "flag [可选参数] : Bool, force to set the property value even if the same property value already exists. 默认为 [false]."
  1838.             ],
  1839.             $snippet:[
  1840.                 "var id='linb.temp.ui-2'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1841.                 "var link=new linb.UI.Link({position:'relative'});"+
  1842.                 "link.setRenderer(function(item){return '<span style="width:15px;height:15px;background:url(img/img.gif)"></span> ['+item.caption+']'});"+
  1843.                 "linb(id).prepend(link);"+
  1844.                 "_.asyRun(function(){alert(link.getRenderer());},1000);"+
  1845.                 "}"
  1846.             ]
  1847.         },
  1848.         getRoot:{
  1849.             $desc:"获取根(linb.Dom)对象.",
  1850.             $rtn:"linb.Dom element",
  1851.             $snippet:[
  1852.             "alert(linb.UIProfile.getFromDomId('logo').boxing().getRoot());"
  1853.             ]
  1854.         },
  1855.         getRootNode:{
  1856.             $desc:"获取根DOM元素.",
  1857.             $rtn:"DOM element",
  1858.             $snippet:[
  1859.             "alert(linb.UIProfile.getFromDomId('logo').boxing().getRootNode());"
  1860.             ]
  1861.         },
  1862.         append:{
  1863.             $desc:"添加一系列的linb.UIProfile到当前对象上.",
  1864.             $rtn:"[self]",
  1865.             $paras:[
  1866.                 "target [必需参数] : a linb.UI ojbect(including a set of linb.UIProfile objects).",
  1867.                 "subId [可选参数] : String, the sub id that Determines the [target] will be added to which sub DOM node. This parameter can be [false] too, that means the [target] will be appended to DOM only, no link created between the [target] UIProfiles and the parent UIProfile."
  1868.             ],
  1869.             $snippet:[
  1870.                 "var id='linb.temp.ui2'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+
  1871.                 "var block,btn1,btn2;linb(id).prepend(block=new linb.UI.Block({border:true}));"+
  1872.                 "block.append(btn1=new linb.UI.Button({position:'relative'})).append(btn2=new linb.UI.Button({position:'relative'}), false);"+
  1873.                 "alert(btn1.get(0).parent===block.get(0));alert(btn2.get(0).parent);"+
  1874.                 "}"
  1875.             ]
  1876.         },
  1877.         removeChildren:{
  1878.             $desc:"移除内部所有的子控件.",
  1879.             $rtn:"[self]",
  1880.             $paras:[
  1881.                 "subId [可选参数] : String, the sub id that Determines which profile will be removeed."
  1882.             ],
  1883.             $snippet:[
  1884.                 "var id='linb.temp.ui2'; if(!linb.Dom.byId(id)){this.prepend(linb.create('<div id='+id+' style="border:solid 1px;padding:10px;">' + '<br /><button onclick="linb(this).parent().remove()">remove this example</button>' + '</div>'));"+