diff options
author | Fulup Ar Foll <fulup@iot.bzh> | 2015-12-16 17:15:43 +0100 |
---|---|---|
committer | Fulup Ar Foll <fulup@iot.bzh> | 2015-12-16 17:15:43 +0100 |
commit | 475508baa9f0b21087eb85048d51af342aa09692 (patch) | |
tree | f3e944401efc59c68110f54fcea7f569e928a42f /afb-client/app/Frontend/services | |
parent | f7e443f996dceb928a047d06e45f59579f1fbc0e (diff) |
Add the app!!!
Diffstat (limited to 'afb-client/app/Frontend/services')
-rw-r--r-- | afb-client/app/Frontend/services/ConfigApp.js | 25 | ||||
-rw-r--r-- | afb-client/app/Frontend/services/JQueryEmu.js | 42 |
2 files changed, 67 insertions, 0 deletions
diff --git a/afb-client/app/Frontend/services/ConfigApp.js b/afb-client/app/Frontend/services/ConfigApp.js new file mode 100644 index 0000000..f36d79b --- /dev/null +++ b/afb-client/app/Frontend/services/ConfigApp.js @@ -0,0 +1,25 @@ +(function () { + 'use strict'; + + // _all modules only reference dependencies + angular.module('ConfigApp', []) + + // Factory is a singleton and share its context within all instances. + .factory('ConfigApp', function () { + + + var myConfig = { + paths: { // Warning paths should end with / + images : 'images/', + avatars: 'images/avatars/' + }, + + api: { // Warning paths should end with / + token : '/api/token/' + } + }; + + return myConfig; + }); + +})();
\ No newline at end of file diff --git a/afb-client/app/Frontend/services/JQueryEmu.js b/afb-client/app/Frontend/services/JQueryEmu.js new file mode 100644 index 0000000..5112052 --- /dev/null +++ b/afb-client/app/Frontend/services/JQueryEmu.js @@ -0,0 +1,42 @@ +(function () { + 'use strict'; + + // _all modules only reference dependencies + angular.module('JQueryEmu', []) + + // Factory is a singleton and share its context within all instances. + .factory('JQemu', function () { + + // JQueryLight cannot search a tag within ancestrors + var parent = function (element, selector) { + var parent = element; + var search = selector.toUpperCase(); + while (parent[0]) { + if (search === parent[0].tagName) { + return parent; + } // HTMLDivElement properties + parent = parent.parent(); + } + }; + + // JQueryLight cannot search by type + var findByType= function (element, selector) { + var search = selector.toLowerCase(); + var children = element.children(); + while (children[0]) { + if (search === children[0].type) { + return children; + } // HTMLDivElement properties + children = children.next(); + } + }; + + var myMethods = { + parent: parent, + findByType: findByType + }; + + return myMethods; + }); + +})();
\ No newline at end of file |