muu

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

commit
7e34e9f2e67fbe215151d9c0829441331e8fb9ce
parent
ea7472e26fa1921300d72e597bb5f1a838da0c63
Author
Tobias Bengfort <tobias.bengfort@gmx.net>
Date
2016-02-19 23:17
loose the "muu-" prefix for modules

Diffstat

M .doc/tutorials/phonecat.md 2 +-
M Makefile 2 +-
M README.md 4 ++--
R src/muu-directive.js -> src/directive.js 6 +++---
R src/muu-dom-helpers.js -> src/dom-helpers.js 6 +++---
R src/muu.js -> src/index.js 6 +++---
R src/muu-js-helpers.js -> src/js-helpers.js 6 +++---
R src/muu-location.js -> src/location.js 20 ++++++++++----------
R src/muu-registry.js -> src/registry.js 8 ++++----
R src/muu-search.js -> src/search.js 2 +-
R src/muu-template.js -> src/template.js 4 ++--
R src/muu-update-dom.js -> src/update-dom.js 4 ++--
M test/run.js 2 +-
M test/test-directive.js 2 +-
M test/test-dom-helpers.js 2 +-
M test/test-js-helpers.js 2 +-
M test/test-registry.js 2 +-
M test/test-search.js 2 +-
M test/test-template.js 2 +-
M test/test-update-dom.js 2 +-

20 files changed, 43 insertions, 43 deletions


diff --git a/.doc/tutorials/phonecat.md b/.doc/tutorials/phonecat.md

@@ -41,7 +41,7 @@ written on your screen.
   41    41 
   42    42 *muu can work with any templating system. See {@link Registry} on that. By
   43    43 default (and in this tutorial), the minimal build-in templating engine is used.
   44    -1 For details on that, see {@link module:muu-template}.*
   -1    44 For details on that, see {@link module:template}.*
   45    45 
   46    46 In this example, we want to create a catalog that displays a list of phones.
   47    47 We can start off with this simple template:

diff --git a/Makefile b/Makefile

@@ -1,6 +1,6 @@
    1     1 dist/muu.js: JS := src/*.js
    2     2 dist/muu-core.js: LODASH := 1
    3    -1 dist/muu-core.js: JS := src/muu-directive.js src/muu-dom-helpers.js src/muu.js src/muu-registry.js src/muu-update-dom.js
   -1     3 dist/muu-core.js: JS := src/index.js src/directive.js src/dom-helpers.js src/registry.js src/update-dom.js
    4     4 
    5     5 all: dist/muu.min.js dist/muu-core.min.js
    6     6 

diff --git a/README.md b/README.md

@@ -98,7 +98,7 @@ basically a mere methodology rather than code*.
   98    98 I started out using [lodash](https://lodash.com/) for JavaScript helpers,
   99    99 [jquery](https://jquery.com/) for DOM helpers and
  100   100 [mustache](mustache.github.io) as templating system. I later switched to custom
  101    -1 code ({@link module:muu-js-helpers}, {@link module:muu-dom-helpers} and {@link
  102    -1 module:muu-template}). But switching back to more stable libraries should be fairly
   -1   101 code ({@link module:js-helpers}, {@link module:dom-helpers} and {@link
   -1   102 module:template}). But switching back to more stable libraries should be fairly
  103   103 simple. In the case of templating, you can even select an engine in the {@link
  104   104 Registry} configuration.

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

@@ -1,9 +1,9 @@
    1     1 /**
    2     2  * Exports the {@link Directive} class.
    3    -1  * @module muu-directive
   -1     3  * @module directive
    4     4  * @ignore
    5     5  */
    6    -1 define('muu-directive', ['muu-dom-helpers', 'muu-js-helpers'], function($, _) {
   -1     6 define('directive', ['dom-helpers', 'js-helpers'], function($, _) {
    7     7     "use strict";
    8     8 
    9     9     /**
@@ -54,7 +54,7 @@ define('muu-directive', ['muu-dom-helpers', 'muu-js-helpers'], function($, _) {
   54    54          * Rerender `template` with `data` and push the changes to the DOM.
   55    55          *
   56    56          * @param {Object.<string, *>} data
   57    -1          * @see {@link module:muu-update-dom} for details.
   -1    57          * @see {@link module:update-dom} for details.
   58    58          * @see The templating system can be defined in the {@link Registry}.
   59    59          */
   60    60         this.update = function(data) {

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

@@ -1,8 +1,8 @@
    1     1 /**
    2     2  * DOM related helper functions
    3    -1  * @module muu-dom-helpers
   -1     3  * @module dom-helpers
    4     4  */
    5    -1 define("muu-dom-helpers", ['muu-js-helpers'], function(_) {
   -1     5 define("dom-helpers", ['js-helpers'], function(_) {
    6     6     "use strict";
    7     7 
    8     8     var entityMap = {
@@ -14,7 +14,7 @@ define("muu-dom-helpers", ['muu-js-helpers'], function(_) {
   14    14         '/': '&#x2F;'
   15    15     };
   16    16 
   17    -1     /** @lends module:muu-dom-helpers */
   -1    17     /** @lends module:dom-helpers */
   18    18     var $ = {};
   19    19 
   20    20     $.DELAY = 1000;

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

@@ -2,12 +2,12 @@
    2     2  * This module gives access to the following objects:
    3     3  *
    4     4  * -   `Registry` - {@link Registry}
    5    -1  * -   `$` - {@link module:muu-dom-helpers}
    6    -1  * -   `$location` - {@link module:muu-location}
   -1     5  * -   `$` - {@link module:dom-helpers}
   -1     6  * -   `$location` - {@link module:location}
    7     7  *
    8     8  * @module muu
    9     9  */
   10    -1 define('muu', ['muu-registry', 'muu-dom-helpers', 'muu-location'], function(Registry, $, $location) {
   -1    10 define('muu', ['registry', 'dom-helpers', 'location'], function(Registry, $, $location) {
   11    11     "use strict";
   12    12 
   13    13     var module = {};

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

@@ -1,11 +1,11 @@
    1     1 /**
    2     2  * Minimal implementation of an underscore/lodash subset.
    3    -1  * @module muu-js-helpers
   -1     3  * @module js-helpers
    4     4  */
    5    -1 define('muu-js-helpers', [], function() {
   -1     5 define('js-helpers', [], function() {
    6     6     "use strict";
    7     7 
    8    -1     /** @lends module:muu-js-helpers */
   -1     8     /** @lends module:js-helpers */
    9     9     var _ = {};
   10    10 
   11    11     /**

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

@@ -1,11 +1,11 @@
    1     1 /**
    2     2  * angular inspired location service.
    3    -1  * @module muu-location
   -1     3  * @module location
    4     4  */
    5    -1 define('muu-location', ['muu-search'], function(q) {
   -1     5 define('location', ['search'], function(q) {
    6     6     "use strict";
    7     7 
    8    -1     /** @lends module:muu-location */
   -1     8     /** @lends module:location */
    9     9     var loc = {};
   10    10 
   11    11     /**
@@ -22,7 +22,7 @@ define('muu-location', ['muu-search'], function(q) {
   22    22      *//**
   23    23      * @param {string} value
   24    24      * @param {boolean} [replace]
   25    -1      * @return {muu-location}
   -1    25      * @return {location}
   26    26      */
   27    27     loc.url = function(value, replace) {
   28    28         if (value === undefined) {
@@ -65,7 +65,7 @@ define('muu-location', ['muu-search'], function(q) {
   65    65      *//**
   66    66      * @param {string} value
   67    67      * @param {boolean} [replace]
   68    -1      * @return {muu-location}
   -1    68      * @return {location}
   69    69      */
   70    70     loc.path = function(value, replace) {
   71    71         if (value === undefined) {
@@ -99,12 +99,12 @@ define('muu-location', ['muu-search'], function(q) {
   99    99      * @nosideeffects
  100   100      *//**
  101   101      * @param {string|object} value
  102    -1      * @return {muu-location}
   -1   102      * @return {location}
  103   103      *//**
  104   104      * @param {string} key
  105   105      * @param {*} value
  106   106      * @param {boolean} [replace]
  107    -1      * @return {muu-location}
   -1   107      * @return {location}
  108   108      */
  109   109     loc.search = function(key, value, replace) {
  110   110         if (key !== undefined) {
@@ -126,7 +126,7 @@ define('muu-location', ['muu-search'], function(q) {
  126   126      *//**
  127   127      * @param {string} value
  128   128      * @param {boolean} [replace]
  129    -1      * @return {muu-location}
   -1   129      * @return {location}
  130   130      */
  131   131     loc.hash = function(value, replace) {
  132   132         if (value === undefined) {
@@ -145,7 +145,7 @@ define('muu-location', ['muu-search'], function(q) {
  145   145     /**
  146   146      * @param {string} eventName
  147   147      * @param {Function} fn
  148    -1      * @return {muu-location}
   -1   148      * @return {location}
  149   149      */
  150   150     loc.addEventListener = function(eventName, fn) {
  151   151         if (eventName === 'change') {
@@ -157,7 +157,7 @@ define('muu-location', ['muu-search'], function(q) {
  157   157     /**
  158   158      * @param {string} eventName
  159   159      * @param {Function} fn
  160    -1      * @return {muu-location}
   -1   160      * @return {location}
  161   161      */
  162   162     loc.removeEventListener = function(eventName, fn) {
  163   163         if (eventName === 'change') {

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

@@ -1,9 +1,9 @@
    1     1 /**
    2     2  * Exports the {@link Registry} class.
    3    -1  * @module muu-registry
   -1     3  * @module registry
    4     4  * @ignore
    5     5  */
    6    -1 define('muu-registry', ['muu-template', 'muu-update-dom', 'muu-directive', 'muu-js-helpers', 'muu-dom-helpers'], function(muuTemplate, muuUpdateDOM, Directive, _, $) {
   -1     6 define('registry', ['template', 'update-dom', 'directive', 'js-helpers', 'dom-helpers'], function(muuTemplate, muuUpdateDOM, Directive, _, $) {
    7     7     "use strict";
    8     8 
    9     9     /**
@@ -14,9 +14,9 @@ define('muu-registry', ['muu-template', 'muu-update-dom', 'muu-directive', 'muu-
   14    14      *   directive objects are available as properties from the DOM as
   15    15      *   `element.directive`.
   16    16      * - **renderer** - `{function(string, Object): string}` - The template
   17    -1      *   renderer to be used. Defaults to {@link module:muu-template}.
   -1    17      *   renderer to be used. Defaults to {@link module:template}.
   18    18      * - **updateDOM** - `{function(Node, string)}` - The DOM updater to be
   19    -1      *   used. Defaults to {@link module:muu-update-dom}.
   -1    19      *   used. Defaults to {@link module:update-dom}.
   20    20      */
   21    21     var Registry = function(config) {
   22    22         var self = this;

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

@@ -1,4 +1,4 @@
    1    -1 define('muu-search', ['muu-js-helpers'], function(_) {
   -1     1 define('search', ['js-helpers'], function(_) {
    2     2     "use strict";
    3     3 
    4     4     var q = {};

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

@@ -56,13 +56,13 @@
   56    56  * muuTemplate('{{#this}}{{this}}{{/this}}', [1, 2]);
   57    57  * ```
   58    58  *
   59    -1  * @module muu-template
   -1    59  * @module template
   60    60  * @param {string} template
   61    61  * @param {Object} data
   62    62  * @return {string}
   63    63  * @nosideeffects
   64    64  */
   65    -1 define('muu-template', ['muu-js-helpers', 'muu-dom-helpers'], function(_, $) {
   -1    65 define('template', ['js-helpers', 'dom-helpers'], function(_, $) {
   66    66     "use strict";
   67    67 
   68    68     var openTag = '{{';

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

@@ -19,11 +19,11 @@
   19    19  *
   20    20  * All classes prefixed with `muu-` will be preserved.
   21    21  *
   22    -1  * @module muu-update-dom
   -1    22  * @module update-dom
   23    23  * @param {Node} target
   24    24  * @param {string} html
   25    25  */
   26    -1 define('muu-update-dom', ['muu-js-helpers'], function(_) {
   -1    26 define('update-dom', ['js-helpers'], function(_) {
   27    27     "use strict";
   28    28 
   29    29     var updateAttributes = function(target, source) {

diff --git a/test/run.js b/test/run.js

@@ -11,7 +11,7 @@ if (window.blanket) {
   11    11 require({
   12    12     baseUrl: '../src/'
   13    13 }, [
   14    -1     'muu-dom-helpers',
   -1    14     'dom-helpers',
   15    15     '../test/test-dom-helpers',
   16    16     '../test/test-js-helpers.js',
   17    17     '../test/test-template.js',

diff --git a/test/test-directive.js b/test/test-directive.js

@@ -1,5 +1,5 @@
    1     1 /* global define, describe, it, expect, beforeEach, sinon */
    2    -1 define(['muu-directive', 'muu-update-dom', 'muu-js-helpers', 'muu-dom-helpers'], function(Directive, updateDOM, _, $) {
   -1     2 define(['directive', 'update-dom', 'js-helpers', 'dom-helpers'], function(Directive, updateDOM, _, $) {
    3     3     "use strict";
    4     4 
    5     5     describe('muuDirective', function() {

diff --git a/test/test-dom-helpers.js b/test/test-dom-helpers.js

@@ -1,5 +1,5 @@
    1     1 /* global define, describe, it, beforeEach, expect, sinon */
    2    -1 define(['muu-dom-helpers'], function($) {
   -1     2 define(['dom-helpers'], function($) {
    3     3     "use strict";
    4     4 
    5     5     describe('muuDomHelpers', function() {

diff --git a/test/test-js-helpers.js b/test/test-js-helpers.js

@@ -1,5 +1,5 @@
    1     1 /* global define, describe, it, beforeEach, afterEach, expect, sinon */
    2    -1 define(['muu-js-helpers'], function(_) {
   -1     2 define(['js-helpers'], function(_) {
    3     3     "use strict";
    4     4 
    5     5     var monkeyPatchArray = function(feature, tests) {

diff --git a/test/test-registry.js b/test/test-registry.js

@@ -1,5 +1,5 @@
    1     1 /* global define, describe, it, expect, beforeEach, sinon */
    2    -1 define(['muu-registry', 'muu-directive', 'muu-js-helpers'], function(Registry, Directive, _) {
   -1     2 define(['registry', 'directive', 'js-helpers'], function(Registry, Directive, _) {
    3     3     "use strict";
    4     4 
    5     5     describe('Registry', function() {

diff --git a/test/test-search.js b/test/test-search.js

@@ -1,5 +1,5 @@
    1     1 /* global define, describe, it, expect */
    2    -1 define(['muu-search'], function(q) {
   -1     2 define(['search'], function(q) {
    3     3     "use strict";
    4     4 
    5     5     describe('search', function() {

diff --git a/test/test-template.js b/test/test-template.js

@@ -1,5 +1,5 @@
    1     1 /* global define, describe, it, expect */
    2    -1 define(['muu-template'], function(muuTemplate) {
   -1     2 define(['template'], function(muuTemplate) {
    3     3     "use strict";
    4     4 
    5     5     describe('muuTemplate', function() {

diff --git a/test/test-update-dom.js b/test/test-update-dom.js

@@ -1,5 +1,5 @@
    1     1 /* global define, describe, it, beforeEach, expect */
    2    -1 define(['muu-update-dom'], function(updateDOM) {
   -1     2 define(['update-dom'], function(updateDOM) {
    3     3     "use strict";
    4     4 
    5     5     var n = function(s) {