muu

DEPRECATED lightweight JS framework
git clone https://git.ce9e.org/muu.git

commit
72e8f0462a2354cbacaa4bd280b1e0a43de131c9
parent
b16b341033df34052b27dbf290f8d1e7804a6281
Author
Tobias Bengfort <tobias.bengfort@gmx.net>
Date
2015-08-28 12:07
add nosideeffects markers

Diffstat

M dist/muu-core.js 7 +++++++
M dist/muu.js 27 +++++++++++++++++++++++++++
M src/muu-directive.js 3 +++
M src/muu-dom-helpers.js 4 ++++
M src/muu-js-helpers.js 11 +++++++++++
M src/muu-location.js 8 ++++++++
M src/muu-template.js 1 +

7 files changed, 61 insertions, 0 deletions


diff --git a/dist/muu-core.js b/dist/muu-core.js

@@ -130,6 +130,7 @@
  130   130                  * @param {string} selector
  131   131                  * @return {Array.<Element>} All child elements that match the given
  132   132                  *     selector and are not isolated.
   -1   133                  * @nosideeffects
  133   134                  */
  134   135                 this.querySelectorAll = function(selector) {
  135   136                     var hits = root.querySelectorAll(selector);
@@ -153,6 +154,7 @@
  153   154                  * @param {String} selector
  154   155                  * @return {Element} First child element that matches the given
  155   156                  *     selector and is not isolated.
   -1   157                  * @nosideeffects
  156   158                  * @suppress {missingReturn}
  157   159                  */
  158   160                 this.querySelector = function(selector) {
@@ -175,6 +177,7 @@
  175   177                  * @param {string} name
  176   178                  * @param {*} [_default]
  177   179                  * @return {string|number|boolean|*}
   -1   180                  * @nosideeffects
  178   181                  */
  179   182                 this.getModel = function(name, _default) {
  180   183                     if (name === undefined) {
@@ -246,6 +249,7 @@
  246   249             /**
  247   250              * @param {string} string
  248   251              * @return {string} - escaped HTML
   -1   252              * @nosideeffects
  249   253              */
  250   254             $.escapeHtml = function(string) {
  251   255                 return String(string).replace(/[&<>"'\/]/g, function(s) {
@@ -263,6 +267,7 @@
  263   267              * @param {*} detail
  264   268              * @return {Event}
  265   269              * @see https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events
   -1   270              * @nosideeffects
  266   271              */
  267   272             $.createEvent = function(type, detail) {
  268   273                 if (typeof CustomEvent === 'function') {
@@ -312,6 +317,7 @@
  312   317              * @param {Node} desc
  313   318              * @param {Node} root
  314   319              * @return {boolean}
   -1   320              * @nosideeffects
  315   321              */
  316   322             $.isDescendant = function(desc, root) {
  317   323                  return !!desc && (desc === root || $.isDescendant(desc.parentNode, root));
@@ -368,6 +374,7 @@
  368   374              * @param {Array.<Element>} options
  369   375              * @return {string}
  370   376              * @suppress {missingReturn}
   -1   377              * @nosideeffects
  371   378              */
  372   379             $.getRadio = function(options) {
  373   380                 for (var i = 0; i < options.length; i++) {

diff --git a/dist/muu.js b/dist/muu.js

@@ -130,6 +130,7 @@
  130   130                  * @param {string} selector
  131   131                  * @return {Array.<Element>} All child elements that match the given
  132   132                  *     selector and are not isolated.
   -1   133                  * @nosideeffects
  133   134                  */
  134   135                 this.querySelectorAll = function(selector) {
  135   136                     var hits = root.querySelectorAll(selector);
@@ -153,6 +154,7 @@
  153   154                  * @param {String} selector
  154   155                  * @return {Element} First child element that matches the given
  155   156                  *     selector and is not isolated.
   -1   157                  * @nosideeffects
  156   158                  * @suppress {missingReturn}
  157   159                  */
  158   160                 this.querySelector = function(selector) {
@@ -175,6 +177,7 @@
  175   177                  * @param {string} name
  176   178                  * @param {*} [_default]
  177   179                  * @return {string|number|boolean|*}
   -1   180                  * @nosideeffects
  178   181                  */
  179   182                 this.getModel = function(name, _default) {
  180   183                     if (name === undefined) {
@@ -246,6 +249,7 @@
  246   249             /**
  247   250              * @param {string} string
  248   251              * @return {string} - escaped HTML
   -1   252              * @nosideeffects
  249   253              */
  250   254             $.escapeHtml = function(string) {
  251   255                 return String(string).replace(/[&<>"'\/]/g, function(s) {
@@ -263,6 +267,7 @@
  263   267              * @param {*} detail
  264   268              * @return {Event}
  265   269              * @see https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events
   -1   270              * @nosideeffects
  266   271              */
  267   272             $.createEvent = function(type, detail) {
  268   273                 if (typeof CustomEvent === 'function') {
@@ -312,6 +317,7 @@
  312   317              * @param {Node} desc
  313   318              * @param {Node} root
  314   319              * @return {boolean}
   -1   320              * @nosideeffects
  315   321              */
  316   322             $.isDescendant = function(desc, root) {
  317   323                  return !!desc && (desc === root || $.isDescendant(desc.parentNode, root));
@@ -368,6 +374,7 @@
  368   374              * @param {Array.<Element>} options
  369   375              * @return {string}
  370   376              * @suppress {missingReturn}
   -1   377              * @nosideeffects
  371   378              */
  372   379             $.getRadio = function(options) {
  373   380                 for (var i = 0; i < options.length; i++) {
@@ -406,6 +413,7 @@
  406   413             /**
  407   414              * @param {Object} value
  408   415              * @return {string}
   -1   416              * @nosideeffects
  409   417              */
  410   418             var objToString = function(value) {
  411   419                 return Object.prototype.toString.call(value);
@@ -414,6 +422,7 @@
  414   422             /**
  415   423              * @param {*} value
  416   424              * @return {boolean}
   -1   425              * @nosideeffects
  417   426              */
  418   427             _.isString = function(value) {
  419   428                 return typeof value === 'string' || objToString(value) === '[object String]';
@@ -423,12 +432,14 @@
  423   432              * @function
  424   433              * @param {*} value
  425   434              * @return {boolean}
   -1   435              * @nosideeffects
  426   436              */
  427   437             _.isArray = Array.isArray;
  428   438 
  429   439             /**
  430   440              * @param {*} value
  431   441              * @return {boolean}
   -1   442              * @nosideeffects
  432   443              */
  433   444             _.isFunction = function(value) {
  434   445                 return typeof value === 'function';
@@ -437,6 +448,7 @@
  437   448             /**
  438   449              * @param {Function} fn
  439   450              * @return {Function}
   -1   451              * @nosideeffects
  440   452              */
  441   453             _.once = function(fn) {
  442   454                 var result;
@@ -455,6 +467,7 @@
  455   467              * @param {Array} array
  456   468              * @param {*} value
  457   469              * @return {number}
   -1   470              * @nosideeffects
  458   471              */
  459   472             _.indexOf = function(array, value) {
  460   473                 if ('indexOf' in array) {
@@ -487,6 +500,7 @@
  487   500              * @param {Array} array
  488   501              * @param {Function} fn
  489   502              * @return {Array}
   -1   503              * @nosideeffects
  490   504              */
  491   505             _.map = function(array, fn) {
  492   506                 if ('map' in array) {
@@ -504,6 +518,7 @@
  504   518              * @param {Array} array
  505   519              * @param {Function} fn
  506   520              * @return {Array}
   -1   521              * @nosideeffects
  507   522              */
  508   523             _.filter = function(array, fn) {
  509   524                 if ('filter' in array) {
@@ -522,6 +537,7 @@
  522   537             /**
  523   538              * @param {Array.<Array>} arrays
  524   539              * @return {Array}
   -1   540              * @nosideeffects
  525   541              */
  526   542             _.union = function(arrays) {
  527   543                 var results = [];
@@ -539,6 +555,7 @@
  539   555              * @param {Array} a
  540   556              * @param {Array} b
  541   557              * @return {Array}
   -1   558              * @nosideeffects
  542   559              */
  543   560             _.difference = function(a, b) {
  544   561                 var results = [];
@@ -553,6 +570,7 @@
  553   570             /**
  554   571              * @param {Array} a
  555   572              * @return {Array}
   -1   573              * @nosideeffects
  556   574              */
  557   575             _.flatten = function(a) {
  558   576                 var o = [];
@@ -580,6 +598,7 @@
  580   598 
  581   599             /**
  582   600              * @return {string}
   -1   601              * @nosideeffects
  583   602              */
  584   603             loc.absUrl = function() {
  585   604                 return location.href;
@@ -587,6 +606,7 @@
  587   606 
  588   607             /**
  589   608              * @return {string}
   -1   609              * @nosideeffects
  590   610              *//**
  591   611              * @param {string} value
  592   612              * @param {boolean} [replace]
@@ -605,6 +625,7 @@
  605   625 
  606   626             /**
  607   627              * @return {string}
   -1   628              * @nosideeffects
  608   629              */
  609   630             loc.protocol = function() {
  610   631                 return location.protocol;
@@ -612,6 +633,7 @@
  612   633 
  613   634             /**
  614   635              * @return {string}
   -1   636              * @nosideeffects
  615   637              */
  616   638             loc.host = function() {
  617   639                 return location.host;
@@ -619,6 +641,7 @@
  619   641 
  620   642             /**
  621   643              * @return {string}
   -1   644              * @nosideeffects
  622   645              */
  623   646             loc.port = function() {
  624   647                 return location.port;
@@ -626,6 +649,7 @@
  626   649 
  627   650             /**
  628   651              * @return {string}
   -1   652              * @nosideeffects
  629   653              *//**
  630   654              * @param {string} value
  631   655              * @param {boolean} [replace]
@@ -660,6 +684,7 @@
  660   684 
  661   685             /**
  662   686              * @return {Object}
   -1   687              * @nosideeffects
  663   688              *//**
  664   689              * @param {string|object} value
  665   690              * @return {muu-location}
@@ -685,6 +710,7 @@
  685   710 
  686   711             /**
  687   712              * @return {string}
   -1   713              * @nosideeffects
  688   714              *//**
  689   715              * @param {string} value
  690   716              * @param {boolean} [replace]
@@ -989,6 +1015,7 @@
  989  1015          * @param {string} template
  990  1016          * @param {Object} data
  991  1017          * @return {string}
   -1  1018          * @nosideeffects
  992  1019          */
  993  1020         _define('muu-template', ['muu-js-helpers', 'muu-dom-helpers'], function(_, $) {
  994  1021             "use strict";

diff --git a/src/muu-directive.js b/src/muu-directive.js

@@ -84,6 +84,7 @@ define('muu-directive', ['muu-dom-helpers', 'muu-js-helpers', 'muu-update-dom'],
   84    84          * @param {string} selector
   85    85          * @return {Array.<Element>} All child elements that match the given
   86    86          *     selector and are not isolated.
   -1    87          * @nosideeffects
   87    88          */
   88    89         this.querySelectorAll = function(selector) {
   89    90             var hits = root.querySelectorAll(selector);
@@ -107,6 +108,7 @@ define('muu-directive', ['muu-dom-helpers', 'muu-js-helpers', 'muu-update-dom'],
  107   108          * @param {String} selector
  108   109          * @return {Element} First child element that matches the given
  109   110          *     selector and is not isolated.
   -1   111          * @nosideeffects
  110   112          * @suppress {missingReturn}
  111   113          */
  112   114         this.querySelector = function(selector) {
@@ -129,6 +131,7 @@ define('muu-directive', ['muu-dom-helpers', 'muu-js-helpers', 'muu-update-dom'],
  129   131          * @param {string} name
  130   132          * @param {*} [_default]
  131   133          * @return {string|number|boolean|*}
   -1   134          * @nosideeffects
  132   135          */
  133   136         this.getModel = function(name, _default) {
  134   137             if (name === undefined) {

diff --git a/src/muu-dom-helpers.js b/src/muu-dom-helpers.js

@@ -22,6 +22,7 @@ define("muu-dom-helpers", ['muu-js-helpers'], function(_) {
   22    22     /**
   23    23      * @param {string} string
   24    24      * @return {string} - escaped HTML
   -1    25      * @nosideeffects
   25    26      */
   26    27     $.escapeHtml = function(string) {
   27    28         return String(string).replace(/[&<>"'\/]/g, function(s) {
@@ -39,6 +40,7 @@ define("muu-dom-helpers", ['muu-js-helpers'], function(_) {
   39    40      * @param {*} detail
   40    41      * @return {Event}
   41    42      * @see https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events
   -1    43      * @nosideeffects
   42    44      */
   43    45     $.createEvent = function(type, detail) {
   44    46         if (typeof CustomEvent === 'function') {
@@ -88,6 +90,7 @@ define("muu-dom-helpers", ['muu-js-helpers'], function(_) {
   88    90      * @param {Node} desc
   89    91      * @param {Node} root
   90    92      * @return {boolean}
   -1    93      * @nosideeffects
   91    94      */
   92    95     $.isDescendant = function(desc, root) {
   93    96          return !!desc && (desc === root || $.isDescendant(desc.parentNode, root));
@@ -144,6 +147,7 @@ define("muu-dom-helpers", ['muu-js-helpers'], function(_) {
  144   147      * @param {Array.<Element>} options
  145   148      * @return {string}
  146   149      * @suppress {missingReturn}
   -1   150      * @nosideeffects
  147   151      */
  148   152     $.getRadio = function(options) {
  149   153         for (var i = 0; i < options.length; i++) {

diff --git a/src/muu-js-helpers.js b/src/muu-js-helpers.js

@@ -11,6 +11,7 @@ define('muu-js-helpers', [], function() {
   11    11     /**
   12    12      * @param {Object} value
   13    13      * @return {string}
   -1    14      * @nosideeffects
   14    15      */
   15    16     var objToString = function(value) {
   16    17         return Object.prototype.toString.call(value);
@@ -19,6 +20,7 @@ define('muu-js-helpers', [], function() {
   19    20     /**
   20    21      * @param {*} value
   21    22      * @return {boolean}
   -1    23      * @nosideeffects
   22    24      */
   23    25     _.isString = function(value) {
   24    26         return typeof value === 'string' || objToString(value) === '[object String]';
@@ -28,12 +30,14 @@ define('muu-js-helpers', [], function() {
   28    30      * @function
   29    31      * @param {*} value
   30    32      * @return {boolean}
   -1    33      * @nosideeffects
   31    34      */
   32    35     _.isArray = Array.isArray;
   33    36 
   34    37     /**
   35    38      * @param {*} value
   36    39      * @return {boolean}
   -1    40      * @nosideeffects
   37    41      */
   38    42     _.isFunction = function(value) {
   39    43         return typeof value === 'function';
@@ -42,6 +46,7 @@ define('muu-js-helpers', [], function() {
   42    46     /**
   43    47      * @param {Function} fn
   44    48      * @return {Function}
   -1    49      * @nosideeffects
   45    50      */
   46    51     _.once = function(fn) {
   47    52         var result;
@@ -60,6 +65,7 @@ define('muu-js-helpers', [], function() {
   60    65      * @param {Array} array
   61    66      * @param {*} value
   62    67      * @return {number}
   -1    68      * @nosideeffects
   63    69      */
   64    70     _.indexOf = function(array, value) {
   65    71         if ('indexOf' in array) {
@@ -92,6 +98,7 @@ define('muu-js-helpers', [], function() {
   92    98      * @param {Array} array
   93    99      * @param {Function} fn
   94   100      * @return {Array}
   -1   101      * @nosideeffects
   95   102      */
   96   103     _.map = function(array, fn) {
   97   104         if ('map' in array) {
@@ -109,6 +116,7 @@ define('muu-js-helpers', [], function() {
  109   116      * @param {Array} array
  110   117      * @param {Function} fn
  111   118      * @return {Array}
   -1   119      * @nosideeffects
  112   120      */
  113   121     _.filter = function(array, fn) {
  114   122         if ('filter' in array) {
@@ -127,6 +135,7 @@ define('muu-js-helpers', [], function() {
  127   135     /**
  128   136      * @param {Array.<Array>} arrays
  129   137      * @return {Array}
   -1   138      * @nosideeffects
  130   139      */
  131   140     _.union = function(arrays) {
  132   141         var results = [];
@@ -144,6 +153,7 @@ define('muu-js-helpers', [], function() {
  144   153      * @param {Array} a
  145   154      * @param {Array} b
  146   155      * @return {Array}
   -1   156      * @nosideeffects
  147   157      */
  148   158     _.difference = function(a, b) {
  149   159         var results = [];
@@ -158,6 +168,7 @@ define('muu-js-helpers', [], function() {
  158   168     /**
  159   169      * @param {Array} a
  160   170      * @return {Array}
   -1   171      * @nosideeffects
  161   172      */
  162   173     _.flatten = function(a) {
  163   174         var o = [];

diff --git a/src/muu-location.js b/src/muu-location.js

@@ -10,6 +10,7 @@ define('muu-location', ['muu-search'], function(q) {
   10    10 
   11    11     /**
   12    12      * @return {string}
   -1    13      * @nosideeffects
   13    14      */
   14    15     loc.absUrl = function() {
   15    16         return location.href;
@@ -17,6 +18,7 @@ define('muu-location', ['muu-search'], function(q) {
   17    18 
   18    19     /**
   19    20      * @return {string}
   -1    21      * @nosideeffects
   20    22      *//**
   21    23      * @param {string} value
   22    24      * @param {boolean} [replace]
@@ -35,6 +37,7 @@ define('muu-location', ['muu-search'], function(q) {
   35    37 
   36    38     /**
   37    39      * @return {string}
   -1    40      * @nosideeffects
   38    41      */
   39    42     loc.protocol = function() {
   40    43         return location.protocol;
@@ -42,6 +45,7 @@ define('muu-location', ['muu-search'], function(q) {
   42    45 
   43    46     /**
   44    47      * @return {string}
   -1    48      * @nosideeffects
   45    49      */
   46    50     loc.host = function() {
   47    51         return location.host;
@@ -49,6 +53,7 @@ define('muu-location', ['muu-search'], function(q) {
   49    53 
   50    54     /**
   51    55      * @return {string}
   -1    56      * @nosideeffects
   52    57      */
   53    58     loc.port = function() {
   54    59         return location.port;
@@ -56,6 +61,7 @@ define('muu-location', ['muu-search'], function(q) {
   56    61 
   57    62     /**
   58    63      * @return {string}
   -1    64      * @nosideeffects
   59    65      *//**
   60    66      * @param {string} value
   61    67      * @param {boolean} [replace]
@@ -90,6 +96,7 @@ define('muu-location', ['muu-search'], function(q) {
   90    96 
   91    97     /**
   92    98      * @return {Object}
   -1    99      * @nosideeffects
   93   100      *//**
   94   101      * @param {string|object} value
   95   102      * @return {muu-location}
@@ -115,6 +122,7 @@ define('muu-location', ['muu-search'], function(q) {
  115   122 
  116   123     /**
  117   124      * @return {string}
   -1   125      * @nosideeffects
  118   126      *//**
  119   127      * @param {string} value
  120   128      * @param {boolean} [replace]

diff --git a/src/muu-template.js b/src/muu-template.js

@@ -60,6 +60,7 @@
   60    60  * @param {string} template
   61    61  * @param {Object} data
   62    62  * @return {string}
   -1    63  * @nosideeffects
   63    64  */
   64    65 define('muu-template', ['muu-js-helpers', 'muu-dom-helpers'], function(_, $) {
   65    66     "use strict";