]> git.wh0rd.org - tt-rss.git/blobdiff - lib/dojo/behavior.js.uncompressed.js
modify dojo rebuild script to remove uncompressed files
[tt-rss.git] / lib / dojo / behavior.js.uncompressed.js
index 4270501d19364f70f884f780ab9cf7e5ef1ec855..508081f377a1c99837be90a6a70465b592f6ec12 100644 (file)
@@ -1,27 +1,26 @@
-define("dojo/behavior", ["./_base/kernel", "./_base/lang", "./_base/array", "./_base/connect", "./query", "./ready"], function(dojo, lang, darray, connect, query, ready) {
-       // module:
-       //              dojo/behavior
-       // summary:
-       //              TODOC
+define("dojo/behavior", ["./_base/kernel", "./_base/lang", "./_base/array", "./_base/connect", "./query", "./ready"],
+function(dojo, lang, darray, connect, query, ready){
+
+// module:
+//             dojo/behavior
 
+dojo.deprecated("dojo.behavior", "Use dojo/on with event delegation (on.selector())");
 
-dojo.behavior = new function(){
+var Behavior = function(){
        // summary:
-       //              Utility for unobtrusive/progressive event binding, DOM traversal,
-       //              and manipulation.
-       //
+       //              Deprecated.   dojo/behavior's functionality can be achieved using event delegation using dojo/on
+       //              and on.selector().
        // description:
-       //
        //              A very simple, lightweight mechanism for applying code to
-       //              existing documents, based around `dojo.query` (CSS3 selectors) for node selection,
-       //              and a simple two-command API: `dojo.behavior.add()` and `dojo.behavior.apply()`;
+       //              existing documents, based around `dojo/query` (CSS3 selectors) for node selection,
+       //              and a simple two-command API: `add()` and `apply()`;
        //
        //              Behaviors apply to a given page, and are registered following the syntax
-       //              options described by `dojo.behavior.add` to match nodes to actions, or "behaviors".
+       //              options described by `add()` to match nodes to actions, or "behaviors".
        //
        //              Added behaviors are applied to the current DOM when .apply() is called,
        //              matching only new nodes found since .apply() was last called.
-       //
+
        function arrIn(obj, name){
                if(!obj[name]){ obj[name] = []; }
                return obj[name];
@@ -68,8 +67,8 @@ dojo.behavior = new function(){
                //              If the value corresponding to the ID key is a function and not a
                //              list, it's treated as though it was the value of "found".
                //
-               //              dojo.behavior.add() can be called any number of times before
-               //              the DOM is ready. `dojo.behavior.apply()` is called automatically
+               //              dojo/behavior.add() can be called any number of times before
+               //              the DOM is ready. `dojo/behavior.apply()` is called automatically
                //              by `dojo.addOnLoad`, though can be called to re-apply previously added
                //              behaviors anytime the DOM changes.
                //
@@ -79,7 +78,7 @@ dojo.behavior = new function(){
                //              Simple list of properties. "found" is special. "Found" is assumed if
                //              no property object for a given selector, and property is a function.
                //
-               //      |       dojo.behavior.add({
+               //      |       behavior.add({
                //      |               "#id": {
                //      |                       "found": function(element){
                //      |                               // node match found
@@ -96,15 +95,15 @@ dojo.behavior = new function(){
                // example:
                //               If property is a string, a dojo.publish will be issued on the channel:
                //
-               //      |       dojo.behavior.add({
-               //      |               // dojo.publish() whenever class="noclick" found on anchors
+               //      |       behavior.add({
+               //      |               // topic.publish() whenever class="noclick" found on anchors
                //      |               "a.noclick": "/got/newAnchor",
                //      |               "div.wrapper": {
                //      |                       "onclick": "/node/wasClicked"
                //      |               }
                //      |       });
-               //      |       dojo.subscribe("/got/newAnchor", function(node){
-               //      |               // handle node finding when dojo.behavior.apply() is called,
+               //      |       topic.subscribe("/got/newAnchor", function(node){
+               //      |               // handle node finding when dojo/behavior.apply() is called,
                //      |               // provided a newly matched node is found.
                //      |       });
                //
@@ -112,7 +111,7 @@ dojo.behavior = new function(){
                //              Scoping can be accomplished by passing an object as a property to
                //              a connection handle (on*):
                //
-               //      |       dojo.behavior.add({
+               //      |       behavior.add({
                //      |                       "#id": {
                //      |                               // like calling dojo.hitch(foo,"bar"). execute foo.bar() in scope of foo
                //      |                               "onmouseenter": { targetObj: foo, targetFunc: "bar" },
@@ -121,9 +120,9 @@ dojo.behavior = new function(){
                //      |       });
                //
                // example:
-               //              Bahaviors match on CSS3 Selectors, powered by dojo.query. Example selectors:
+               //              Behaviors match on CSS3 Selectors, powered by dojo/query. Example selectors:
                //
-               //      |       dojo.behavior.add({
+               //      |       behavior.add({
                //      |               // match all direct descendants
                //      |               "#id4 > *": function(element){
                //      |                       // ...
@@ -203,7 +202,7 @@ dojo.behavior = new function(){
                //              will be added to the nodes.
                //
                //              apply() is called once automatically by `dojo.addOnLoad`, so
-               //              registering behaviors with `dojo.behavior.add` before the DOM is
+               //              registering behaviors with `dojo/behavior.add()` before the DOM is
                //              ready is acceptable, provided the dojo.behavior module is ready.
                //
                //              Calling appy() manually after manipulating the DOM is required
@@ -242,6 +241,8 @@ dojo.behavior = new function(){
        };
 };
 
+dojo.behavior = new Behavior();
+
 ready(dojo.behavior, "apply"); // FIXME: should this use a priority? before/after parser priority?
 
 return dojo.behavior;