mongo_request_logger 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +9 -0
- data/README.md +3 -11
- data/angular/.gitignore +8 -0
- data/angular/README.md +143 -0
- data/angular/app/css/.gitignore +0 -0
- data/angular/app/css/app.css +30 -0
- data/angular/app/img/.gitignore +0 -0
- data/{public → angular/app}/img/flags/ad.png +0 -0
- data/{public → angular/app}/img/flags/ae.png +0 -0
- data/{public → angular/app}/img/flags/af.png +0 -0
- data/{public → angular/app}/img/flags/ag.png +0 -0
- data/{public → angular/app}/img/flags/ai.png +0 -0
- data/{public → angular/app}/img/flags/al.png +0 -0
- data/{public → angular/app}/img/flags/am.png +0 -0
- data/{public → angular/app}/img/flags/an.png +0 -0
- data/{public → angular/app}/img/flags/ao.png +0 -0
- data/{public → angular/app}/img/flags/ar.png +0 -0
- data/{public → angular/app}/img/flags/as.png +0 -0
- data/{public → angular/app}/img/flags/at.png +0 -0
- data/{public → angular/app}/img/flags/au.png +0 -0
- data/{public → angular/app}/img/flags/aw.png +0 -0
- data/{public → angular/app}/img/flags/ax.png +0 -0
- data/{public → angular/app}/img/flags/az.png +0 -0
- data/{public → angular/app}/img/flags/ba.png +0 -0
- data/{public → angular/app}/img/flags/bb.png +0 -0
- data/{public → angular/app}/img/flags/bd.png +0 -0
- data/{public → angular/app}/img/flags/be.png +0 -0
- data/{public → angular/app}/img/flags/bf.png +0 -0
- data/{public → angular/app}/img/flags/bg.png +0 -0
- data/{public → angular/app}/img/flags/bh.png +0 -0
- data/{public → angular/app}/img/flags/bi.png +0 -0
- data/{public → angular/app}/img/flags/bj.png +0 -0
- data/{public → angular/app}/img/flags/bm.png +0 -0
- data/{public → angular/app}/img/flags/bn.png +0 -0
- data/{public → angular/app}/img/flags/bo.png +0 -0
- data/{public → angular/app}/img/flags/br.png +0 -0
- data/{public → angular/app}/img/flags/bs.png +0 -0
- data/{public → angular/app}/img/flags/bt.png +0 -0
- data/{public → angular/app}/img/flags/bv.png +0 -0
- data/{public → angular/app}/img/flags/bw.png +0 -0
- data/{public → angular/app}/img/flags/by.png +0 -0
- data/{public → angular/app}/img/flags/bz.png +0 -0
- data/{public → angular/app}/img/flags/ca.png +0 -0
- data/{public → angular/app}/img/flags/catalonia.png +0 -0
- data/{public → angular/app}/img/flags/cc.png +0 -0
- data/{public → angular/app}/img/flags/cd.png +0 -0
- data/{public → angular/app}/img/flags/cf.png +0 -0
- data/{public → angular/app}/img/flags/cg.png +0 -0
- data/{public → angular/app}/img/flags/ch.png +0 -0
- data/{public → angular/app}/img/flags/ci.png +0 -0
- data/{public → angular/app}/img/flags/ck.png +0 -0
- data/{public → angular/app}/img/flags/cl.png +0 -0
- data/{public → angular/app}/img/flags/cm.png +0 -0
- data/{public → angular/app}/img/flags/cn.png +0 -0
- data/{public → angular/app}/img/flags/co.png +0 -0
- data/{public → angular/app}/img/flags/cr.png +0 -0
- data/{public → angular/app}/img/flags/cs.png +0 -0
- data/{public → angular/app}/img/flags/cu.png +0 -0
- data/{public → angular/app}/img/flags/cv.png +0 -0
- data/{public → angular/app}/img/flags/cx.png +0 -0
- data/{public → angular/app}/img/flags/cy.png +0 -0
- data/{public → angular/app}/img/flags/cz.png +0 -0
- data/{public → angular/app}/img/flags/de.png +0 -0
- data/{public → angular/app}/img/flags/dj.png +0 -0
- data/{public → angular/app}/img/flags/dk.png +0 -0
- data/{public → angular/app}/img/flags/dm.png +0 -0
- data/{public → angular/app}/img/flags/do.png +0 -0
- data/{public → angular/app}/img/flags/dz.png +0 -0
- data/{public → angular/app}/img/flags/ec.png +0 -0
- data/{public → angular/app}/img/flags/ee.png +0 -0
- data/{public → angular/app}/img/flags/eg.png +0 -0
- data/{public → angular/app}/img/flags/eh.png +0 -0
- data/{public → angular/app}/img/flags/england.png +0 -0
- data/{public → angular/app}/img/flags/er.png +0 -0
- data/{public → angular/app}/img/flags/es.png +0 -0
- data/{public → angular/app}/img/flags/et.png +0 -0
- data/{public → angular/app}/img/flags/europeanunion.png +0 -0
- data/{public → angular/app}/img/flags/fam.png +0 -0
- data/{public → angular/app}/img/flags/fi.png +0 -0
- data/{public → angular/app}/img/flags/fj.png +0 -0
- data/{public → angular/app}/img/flags/fk.png +0 -0
- data/{public → angular/app}/img/flags/fm.png +0 -0
- data/{public → angular/app}/img/flags/fo.png +0 -0
- data/{public → angular/app}/img/flags/fr.png +0 -0
- data/{public → angular/app}/img/flags/ga.png +0 -0
- data/{public → angular/app}/img/flags/gb.png +0 -0
- data/{public → angular/app}/img/flags/gd.png +0 -0
- data/{public → angular/app}/img/flags/ge.png +0 -0
- data/{public → angular/app}/img/flags/gf.png +0 -0
- data/{public → angular/app}/img/flags/gh.png +0 -0
- data/{public → angular/app}/img/flags/gi.png +0 -0
- data/{public → angular/app}/img/flags/gl.png +0 -0
- data/{public → angular/app}/img/flags/gm.png +0 -0
- data/{public → angular/app}/img/flags/gn.png +0 -0
- data/{public → angular/app}/img/flags/gp.png +0 -0
- data/{public → angular/app}/img/flags/gq.png +0 -0
- data/{public → angular/app}/img/flags/gr.png +0 -0
- data/{public → angular/app}/img/flags/gs.png +0 -0
- data/{public → angular/app}/img/flags/gt.png +0 -0
- data/{public → angular/app}/img/flags/gu.png +0 -0
- data/{public → angular/app}/img/flags/gw.png +0 -0
- data/{public → angular/app}/img/flags/gy.png +0 -0
- data/{public → angular/app}/img/flags/hk.png +0 -0
- data/{public → angular/app}/img/flags/hm.png +0 -0
- data/{public → angular/app}/img/flags/hn.png +0 -0
- data/{public → angular/app}/img/flags/hr.png +0 -0
- data/{public → angular/app}/img/flags/ht.png +0 -0
- data/{public → angular/app}/img/flags/hu.png +0 -0
- data/{public → angular/app}/img/flags/id.png +0 -0
- data/{public → angular/app}/img/flags/ie.png +0 -0
- data/{public → angular/app}/img/flags/il.png +0 -0
- data/{public → angular/app}/img/flags/in.png +0 -0
- data/{public → angular/app}/img/flags/io.png +0 -0
- data/{public → angular/app}/img/flags/iq.png +0 -0
- data/{public → angular/app}/img/flags/ir.png +0 -0
- data/{public → angular/app}/img/flags/is.png +0 -0
- data/{public → angular/app}/img/flags/it.png +0 -0
- data/{public → angular/app}/img/flags/jm.png +0 -0
- data/{public → angular/app}/img/flags/jo.png +0 -0
- data/{public → angular/app}/img/flags/jp.png +0 -0
- data/{public → angular/app}/img/flags/ke.png +0 -0
- data/{public → angular/app}/img/flags/kg.png +0 -0
- data/{public → angular/app}/img/flags/kh.png +0 -0
- data/{public → angular/app}/img/flags/ki.png +0 -0
- data/{public → angular/app}/img/flags/km.png +0 -0
- data/{public → angular/app}/img/flags/kn.png +0 -0
- data/{public → angular/app}/img/flags/kp.png +0 -0
- data/{public → angular/app}/img/flags/kr.png +0 -0
- data/{public → angular/app}/img/flags/kw.png +0 -0
- data/{public → angular/app}/img/flags/ky.png +0 -0
- data/{public → angular/app}/img/flags/kz.png +0 -0
- data/{public → angular/app}/img/flags/la.png +0 -0
- data/{public → angular/app}/img/flags/lb.png +0 -0
- data/{public → angular/app}/img/flags/lc.png +0 -0
- data/{public → angular/app}/img/flags/li.png +0 -0
- data/{public → angular/app}/img/flags/lk.png +0 -0
- data/{public → angular/app}/img/flags/lr.png +0 -0
- data/{public → angular/app}/img/flags/ls.png +0 -0
- data/{public → angular/app}/img/flags/lt.png +0 -0
- data/{public → angular/app}/img/flags/lu.png +0 -0
- data/{public → angular/app}/img/flags/lv.png +0 -0
- data/{public → angular/app}/img/flags/ly.png +0 -0
- data/{public → angular/app}/img/flags/ma.png +0 -0
- data/{public → angular/app}/img/flags/mc.png +0 -0
- data/{public → angular/app}/img/flags/md.png +0 -0
- data/{public → angular/app}/img/flags/me.png +0 -0
- data/{public → angular/app}/img/flags/mg.png +0 -0
- data/{public → angular/app}/img/flags/mh.png +0 -0
- data/{public → angular/app}/img/flags/mk.png +0 -0
- data/{public → angular/app}/img/flags/ml.png +0 -0
- data/{public → angular/app}/img/flags/mm.png +0 -0
- data/{public → angular/app}/img/flags/mn.png +0 -0
- data/{public → angular/app}/img/flags/mo.png +0 -0
- data/{public → angular/app}/img/flags/mp.png +0 -0
- data/{public → angular/app}/img/flags/mq.png +0 -0
- data/{public → angular/app}/img/flags/mr.png +0 -0
- data/{public → angular/app}/img/flags/ms.png +0 -0
- data/{public → angular/app}/img/flags/mt.png +0 -0
- data/{public → angular/app}/img/flags/mu.png +0 -0
- data/{public → angular/app}/img/flags/mv.png +0 -0
- data/{public → angular/app}/img/flags/mw.png +0 -0
- data/{public → angular/app}/img/flags/mx.png +0 -0
- data/{public → angular/app}/img/flags/my.png +0 -0
- data/{public → angular/app}/img/flags/mz.png +0 -0
- data/{public → angular/app}/img/flags/na.png +0 -0
- data/{public → angular/app}/img/flags/nc.png +0 -0
- data/{public → angular/app}/img/flags/ne.png +0 -0
- data/{public → angular/app}/img/flags/nf.png +0 -0
- data/{public → angular/app}/img/flags/ng.png +0 -0
- data/{public → angular/app}/img/flags/ni.png +0 -0
- data/{public → angular/app}/img/flags/nl.png +0 -0
- data/{public → angular/app}/img/flags/no.png +0 -0
- data/{public → angular/app}/img/flags/np.png +0 -0
- data/{public → angular/app}/img/flags/nr.png +0 -0
- data/{public → angular/app}/img/flags/nu.png +0 -0
- data/{public → angular/app}/img/flags/nz.png +0 -0
- data/{public → angular/app}/img/flags/om.png +0 -0
- data/{public → angular/app}/img/flags/pa.png +0 -0
- data/{public → angular/app}/img/flags/pe.png +0 -0
- data/{public → angular/app}/img/flags/pf.png +0 -0
- data/{public → angular/app}/img/flags/pg.png +0 -0
- data/{public → angular/app}/img/flags/ph.png +0 -0
- data/{public → angular/app}/img/flags/pk.png +0 -0
- data/{public → angular/app}/img/flags/pl.png +0 -0
- data/{public → angular/app}/img/flags/pm.png +0 -0
- data/{public → angular/app}/img/flags/pn.png +0 -0
- data/{public → angular/app}/img/flags/pr.png +0 -0
- data/{public → angular/app}/img/flags/ps.png +0 -0
- data/{public → angular/app}/img/flags/pt.png +0 -0
- data/{public → angular/app}/img/flags/pw.png +0 -0
- data/{public → angular/app}/img/flags/py.png +0 -0
- data/{public → angular/app}/img/flags/qa.png +0 -0
- data/{public → angular/app}/img/flags/re.png +0 -0
- data/{public → angular/app}/img/flags/ro.png +0 -0
- data/{public → angular/app}/img/flags/rs.png +0 -0
- data/{public → angular/app}/img/flags/ru.png +0 -0
- data/{public → angular/app}/img/flags/rw.png +0 -0
- data/{public → angular/app}/img/flags/sa.png +0 -0
- data/{public → angular/app}/img/flags/sb.png +0 -0
- data/{public → angular/app}/img/flags/sc.png +0 -0
- data/{public → angular/app}/img/flags/scotland.png +0 -0
- data/{public → angular/app}/img/flags/sd.png +0 -0
- data/{public → angular/app}/img/flags/se.png +0 -0
- data/{public → angular/app}/img/flags/sg.png +0 -0
- data/{public → angular/app}/img/flags/sh.png +0 -0
- data/{public → angular/app}/img/flags/si.png +0 -0
- data/{public → angular/app}/img/flags/sj.png +0 -0
- data/{public → angular/app}/img/flags/sk.png +0 -0
- data/{public → angular/app}/img/flags/sl.png +0 -0
- data/{public → angular/app}/img/flags/sm.png +0 -0
- data/{public → angular/app}/img/flags/sn.png +0 -0
- data/{public → angular/app}/img/flags/so.png +0 -0
- data/{public → angular/app}/img/flags/sr.png +0 -0
- data/{public → angular/app}/img/flags/st.png +0 -0
- data/{public → angular/app}/img/flags/sv.png +0 -0
- data/{public → angular/app}/img/flags/sy.png +0 -0
- data/{public → angular/app}/img/flags/sz.png +0 -0
- data/{public → angular/app}/img/flags/tc.png +0 -0
- data/{public → angular/app}/img/flags/td.png +0 -0
- data/{public → angular/app}/img/flags/tf.png +0 -0
- data/{public → angular/app}/img/flags/tg.png +0 -0
- data/{public → angular/app}/img/flags/th.png +0 -0
- data/{public → angular/app}/img/flags/tj.png +0 -0
- data/{public → angular/app}/img/flags/tk.png +0 -0
- data/{public → angular/app}/img/flags/tl.png +0 -0
- data/{public → angular/app}/img/flags/tm.png +0 -0
- data/{public → angular/app}/img/flags/tn.png +0 -0
- data/{public → angular/app}/img/flags/to.png +0 -0
- data/{public → angular/app}/img/flags/tr.png +0 -0
- data/{public → angular/app}/img/flags/tt.png +0 -0
- data/{public → angular/app}/img/flags/tv.png +0 -0
- data/{public → angular/app}/img/flags/tw.png +0 -0
- data/{public → angular/app}/img/flags/tz.png +0 -0
- data/{public → angular/app}/img/flags/ua.png +0 -0
- data/{public → angular/app}/img/flags/ug.png +0 -0
- data/{public → angular/app}/img/flags/uk.png +0 -0
- data/{public → angular/app}/img/flags/um.png +0 -0
- data/{public → angular/app}/img/flags/us.png +0 -0
- data/{public → angular/app}/img/flags/uy.png +0 -0
- data/{public → angular/app}/img/flags/uz.png +0 -0
- data/{public → angular/app}/img/flags/va.png +0 -0
- data/{public → angular/app}/img/flags/vc.png +0 -0
- data/{public → angular/app}/img/flags/ve.png +0 -0
- data/{public → angular/app}/img/flags/vg.png +0 -0
- data/{public → angular/app}/img/flags/vi.png +0 -0
- data/{public → angular/app}/img/flags/vn.png +0 -0
- data/{public → angular/app}/img/flags/vu.png +0 -0
- data/{public → angular/app}/img/flags/wales.png +0 -0
- data/{public → angular/app}/img/flags/wf.png +0 -0
- data/{public → angular/app}/img/flags/ws.png +0 -0
- data/{public → angular/app}/img/flags/ye.png +0 -0
- data/{public → angular/app}/img/flags/yt.png +0 -0
- data/{public → angular/app}/img/flags/za.png +0 -0
- data/{public → angular/app}/img/flags/zm.png +0 -0
- data/{public → angular/app}/img/flags/zw.png +0 -0
- data/angular/app/js/app.js +9 -0
- data/angular/app/js/controllers.js +184 -0
- data/angular/app/js/directives.js +7 -0
- data/angular/app/js/filters.js +34 -0
- data/angular/app/js/services.js +6 -0
- data/angular/app/lib/angular-ui/angular-ui-ieshiv.js +81 -0
- data/angular/app/lib/angular-ui/angular-ui-ieshiv.min.js +7 -0
- data/angular/app/lib/angular-ui/angular-ui.css +50 -0
- data/angular/app/lib/angular-ui/angular-ui.js +1316 -0
- data/angular/app/lib/angular-ui/angular-ui.min.css +1 -0
- data/angular/app/lib/angular-ui/angular-ui.min.js +7 -0
- data/angular/app/lib/angular/angular-cookies.js +171 -0
- data/angular/app/lib/angular/angular-cookies.min.js +7 -0
- data/angular/app/lib/angular/angular-loader.js +276 -0
- data/angular/app/lib/angular/angular-loader.min.js +7 -0
- data/angular/app/lib/angular/angular-resource.js +445 -0
- data/angular/app/lib/angular/angular-resource.min.js +10 -0
- data/angular/app/lib/angular/angular-sanitize.js +535 -0
- data/angular/app/lib/angular/angular-sanitize.min.js +13 -0
- data/angular/app/lib/angular/angular.js +14604 -0
- data/angular/app/lib/angular/angular.min.js +160 -0
- data/angular/app/lib/angular/version.txt +1 -0
- data/angular/app/lib/bootstrap/css/bootstrap.css +6103 -0
- data/angular/app/lib/bootstrap/css/bootstrap.min.css +868 -0
- data/{public → angular/app/lib/bootstrap}/img/glyphicons-halflings-white.png +0 -0
- data/angular/app/lib/bootstrap/img/glyphicons-halflings.png +0 -0
- data/{public → angular/app/lib/bootstrap}/js/bootstrap.js +1210 -865
- data/angular/app/lib/bootstrap/js/bootstrap.min.js +7 -0
- data/{public/js → angular/app/lib/jquery}/jquery-1.7.2.min.js +0 -0
- data/angular/app/partials/.gitignore +0 -0
- data/angular/app/partials/logs.html +91 -0
- data/angular/app/partials/page.html +18 -0
- data/angular/config/testacular-e2e.conf.js +22 -0
- data/angular/config/testacular.conf.js +20 -0
- data/angular/logs/.gitignore +2 -0
- data/angular/scripts/e2e-test.bat +11 -0
- data/angular/scripts/e2e-test.sh +9 -0
- data/angular/scripts/test.bat +11 -0
- data/angular/scripts/test.sh +9 -0
- data/angular/scripts/watchr.rb +19 -0
- data/angular/scripts/web-server.js +244 -0
- data/angular/test/e2e/runner.html +10 -0
- data/angular/test/e2e/scenarios.js +45 -0
- data/angular/test/lib/angular/angular-mocks.js +1764 -0
- data/angular/test/lib/angular/angular-scenario.js +26066 -0
- data/angular/test/lib/angular/version.txt +1 -0
- data/angular/test/unit/controllersSpec.js +31 -0
- data/angular/test/unit/directivesSpec.js +19 -0
- data/angular/test/unit/filtersSpec.js +19 -0
- data/angular/test/unit/servicesSpec.js +14 -0
- data/config.ru +1 -2
- data/lib/mongo_request_logger/adapters/mongo.rb +1 -1
- data/lib/mongo_request_logger/adapters/moped.rb +1 -1
- data/lib/mongo_request_logger/log_message.rb +22 -7
- data/lib/mongo_request_logger/version.rb +1 -1
- data/lib/mongo_request_logger/viewer.rb +40 -15
- data/spec/mongo_logger_spec.rb +1 -1
- data/spec/moped_logger_spec.rb +1 -1
- data/views/index.erb +69 -0
- metadata +318 -275
- data/public/css/bootstrap-responsive.css +0 -815
- data/public/css/bootstrap-responsive.min.css +0 -9
- data/public/css/bootstrap.css +0 -4983
- data/public/css/bootstrap.min.css +0 -9
- data/public/img/glyphicons-halflings.png +0 -0
- data/public/js/bootstrap.min.js +0 -6
- data/public/js/logs.js +0 -194
- data/views/layout.erb +0 -61
- data/views/log_page.erb +0 -22
- data/views/logs.erb +0 -76
@@ -0,0 +1 @@
|
|
1
|
+
.ui-resetwrap{position:relative;display:inline-block}.ui-reset{position:absolute;top:0;right:0;z-index:2;display:none;height:100%;cursor:pointer}.ui-resetwrap:hover .ui-reset{display:block}.ui-currency-pos{color:green}.ui-currency-neg{color:red}.ui-currency-zero{color:blue}.ui-currency-pos.ui-bignum,.ui-currency-neg.ui-smallnum{font-size:110%}.ui-match{background:yellow}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/**
|
2
|
+
* AngularUI - The companion suite for AngularJS
|
3
|
+
* @version v0.3.2 - 2012-12-04
|
4
|
+
* @link http://angular-ui.github.com
|
5
|
+
* @license MIT License, http://www.opensource.org/licenses/MIT
|
6
|
+
*/
|
7
|
+
angular.module("ui.config",[]).value("ui.config",{}),angular.module("ui.filters",["ui.config"]),angular.module("ui.directives",["ui.config"]),angular.module("ui",["ui.filters","ui.directives","ui.config"]),angular.module("ui.directives").directive("uiSortable",["ui.config",function(e){var t;return t={},e.sortable!=null&&angular.extend(t,e.sortable),{require:"?ngModel",link:function(e,n,r,i){var s,o,u,a,f;return u=angular.extend({},t,e.$eval(r.uiOptions)),i!=null&&(s=function(e,t){return t.item.data("ui-sortable-start",t.item.index())},o=function(t,n){var r,s;return s=n.item.data("ui-sortable-start"),r=n.item.index(),i.$modelValue.splice(r,0,i.$modelValue.splice(s,1)[0]),e.$apply()},a=u.start,u.start=function(t,n){return s(t,n),typeof a=="function"&&a(t,n),e.$apply()},f=u.update,u.update=function(t,n){return o(t,n),typeof f=="function"&&f(t,n),e.$apply()}),n.sortable(u)}}}]),angular.module("ui.directives").directive("uiJq",["ui.config",function(e){return{restrict:"A",compile:function(t,n){if(!angular.isFunction(t[n.uiJq]))throw new Error('ui-jq: The "'+n.uiJq+'" function does not exist');var r=e.jq&&e.jq[n.uiJq];return function(e,t,n){var i=[],s="change";n.uiOptions?(i=e.$eval("["+n.uiOptions+"]"),angular.isObject(r)&&angular.isObject(i[0])&&(i[0]=angular.extend(r,i[0]))):r&&(i=[r]),n.ngModel&&t.is("select,input,textarea")&&(i&&angular.isObject(i[0])&&i[0].ngChange!==undefined&&(s=i[0].ngChange),s&&t.on(s,function(){t.trigger("input")})),t[n.uiJq].apply(t,i)}}}}]),angular.module("ui.directives").directive("uiEvent",["$parse",function(e){return function(t,n,r){var i=t.$eval(r.uiEvent);angular.forEach(i,function(r,i){var s=e(r);n.bind(i,function(e){var n=Array.prototype.slice.call(arguments);n=n.splice(1),t.$apply(function(){s(t,{$event:e,$params:n})})})})}}]),angular.module("ui.directives").directive("uiMask",[function(){return{require:"ngModel",link:function(e,t,n,r){r.$render=function(){var i=r.$viewValue||"";t.val(i),t.mask(e.$eval(n.uiMask))},r.$parsers.push(function(e){var n=t.isMaskValid()||angular.isUndefined(t.isMaskValid())&&t.val().length>0;return r.$setValidity("mask",n),n?e:undefined}),t.bind("keyup",function(){e.$apply(function(){r.$setViewValue(t.mask())})})}}}]),angular.module("ui.directives").directive("uiModal",["$timeout",function(e){return{restrict:"EAC",require:"ngModel",link:function(t,n,r,i){n.addClass("modal hide"),n.on("shown",function(){n.find("[autofocus]").focus()}),t.$watch(r.ngModel,function(e){n.modal(e&&"show"||"hide")}),n.on(jQuery.support.transition&&"shown"||"show",function(){e(function(){i.$setViewValue(!0)})}),n.on(jQuery.support.transition&&"hidden"||"hide",function(){e(function(){i.$setViewValue(!1)})})}}}]),angular.module("ui.directives").directive("uiReset",["ui.config",function(e){var t=null;return e.reset!==undefined&&(t=e.reset),{require:"ngModel",link:function(e,n,r,i){var s;s=angular.element('<a class="ui-reset" />'),n.wrap('<span class="ui-resetwrap" />').after(s),s.bind("click",function(n){n.preventDefault(),e.$apply(function(){r.uiReset?i.$setViewValue(e.$eval(r.uiReset)):i.$setViewValue(t),i.$render()})})}}}]),function(){function t(e,t,n,r){angular.forEach(t.split(" "),function(t){var i={type:"map-"+t};google.maps.event.addListener(n,t,function(t){r.trigger(angular.extend({},i,t)),e.$$phase||e.$apply()})})}function n(n,r){e.directive(n,[function(){return{restrict:"A",link:function(e,i,s){e.$watch(s[n],function(n){t(e,r,n,i)})}}}])}var e=angular.module("ui.directives");e.directive("uiMap",["ui.config","$parse",function(e,n){var r="bounds_changed center_changed click dblclick drag dragend dragstart heading_changed idle maptypeid_changed mousemove mouseout mouseover projection_changed resize rightclick tilesloaded tilt_changed zoom_changed",i=e.map||{};return{restrict:"A",link:function(e,s,o){var u=angular.extend({},i,e.$eval(o.uiOptions)),a=new google.maps.Map(s[0],u),f=n(o.uiMap);f.assign(e,a),t(e,r,a,s)}}}]),e.directive("uiMapInfoWindow",["ui.config","$parse","$compile",function(e,n,r){var i="closeclick content_change domready position_changed zindex_changed",s=e.mapInfoWindow||{};return{link:function(e,o,u){var a=angular.extend({},s,e.$eval(u.uiOptions));a.content=o[0];var f=n(u.uiMapInfoWindow),l=f(e);l||(l=new google.maps.InfoWindow(a),f.assign(e,l)),t(e,i,l,o),o.replaceWith("<div></div>");var c=l.open;l.open=function(n,i,s,u,a,f){r(o.contents())(e),c.call(l,n,i,s,u,a,f)}}}}]),n("uiMapMarker","animation_changed click clickable_changed cursor_changed dblclick drag dragend draggable_changed dragstart flat_changed icon_changed mousedown mouseout mouseover mouseup position_changed rightclick shadow_changed shape_changed title_changed visible_changed zindex_changed"),n("uiMapPolyline","click dblclick mousedown mousemove mouseout mouseover mouseup rightclick"),n("uiMapPolygon","click dblclick mousedown mousemove mouseout mouseover mouseup rightclick"),n("uiMapRectangle","bounds_changed click dblclick mousedown mousemove mouseout mouseover mouseup rightclick"),n("uiMapCircle","center_changed click dblclick mousedown mousemove mouseout mouseover mouseup radius_changed rightclick"),n("uiMapGroundOverlay","click dblclick")}(),angular.module("ui.directives").factory("keypressHelper",["$parse",function(t){var n={8:"backspace",9:"tab",13:"enter",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"delete"},r=function(e){return e.charAt(0).toUpperCase()+e.slice(1)};return function(e,i,s,o){var u,a=[];u=i.$eval(o["ui"+r(e)]),angular.forEach(u,function(e,n){var r,i;i=t(e),angular.forEach(n.split(" "),function(e){r={expression:i,keys:{}},angular.forEach(e.split("-"),function(e){r.keys[e]=!0}),a.push(r)})}),s.bind(e,function(t){var r=t.metaKey||t.altKey,s=t.ctrlKey,o=t.shiftKey,u=t.keyCode;e==="keypress"&&!o&&u>=97&&u<=122&&(u-=32),angular.forEach(a,function(e){var u=e.keys[n[t.keyCode]]||e.keys[t.keyCode.toString()]||!1,a=e.keys.alt||!1,f=e.keys.ctrl||!1,l=e.keys.shift||!1;u&&a==r&&f==s&&l==o&&i.$apply(function(){e.expression(i,{$event:t})})})})}}]),angular.module("ui.directives").directive("uiKeydown",["keypressHelper",function(e){return{link:function(t,n,r){e("keydown",t,n,r)}}}]),angular.module("ui.directives").directive("uiKeypress",["keypressHelper",function(e){return{link:function(t,n,r){e("keypress",t,n,r)}}}]),angular.module("ui.directives").directive("uiKeyup",["keypressHelper",function(e){return{link:function(t,n,r){e("keyup",t,n,r)}}}]),angular.module("ui.directives").directive("uiValidate",function(){return{restrict:"A",require:"ngModel",link:function(e,t,n,r){var i,s=n.uiValidate;s=e.$eval(s);if(!s)return;angular.isFunction(s)&&(s={validator:s}),angular.forEach(s,function(e,t){i=function(n){return e(n)?(r.$setValidity(t,!0),n):(r.$setValidity(t,!1),undefined)},r.$formatters.push(i),r.$parsers.push(i)})}}}),angular.module("ui.directives").directive("uiAnimate",["ui.config","$timeout",function(e,t){var n={};return angular.isString(e.animate)?n["class"]=e.animate:e.animate&&(n=e.animate),{restrict:"A",link:function(e,r,i){var s={};i.uiAnimate&&(s=e.$eval(i.uiAnimate),angular.isString(s)&&(s={"class":s})),s=angular.extend({"class":"ui-animate"},n,s),r.addClass(s["class"]),t(function(){r.removeClass(s["class"])},20,!1)}}}]),angular.module("ui.directives").directive("uiSelect2",["ui.config","$http",function(e,t){var n={};return e.select2&&angular.extend(n,e.select2),{require:"?ngModel",compile:function(e,t){var r,i,s,o=e.is("select"),u=t.multiple!==undefined;return e.is("select")&&(i=e.find("option[ng-repeat], option[data-ng-repeat]"),i.length&&(s=i.attr("ng-repeat")||i.attr("data-ng-repeat"),r=jQuery.trim(s.split("|")[0]).split(" ").pop())),function(e,t,i,s){var a=angular.extend({},n,e.$eval(i.uiSelect2));o?(delete a.multiple,delete a.initSelection):u&&(a.multiple=!0);if(s){s.$render=function(){o?t.select2("val",s.$modelValue):u&&!s.$modelValue?t.select2("data",[]):t.select2("data",s.$modelValue)},r&&e.$watch(r,function(e,n,r){if(!e)return;setTimeout(function(){t.select2("val",s.$viewValue),t.trigger("change")})});if(!o){t.bind("change",function(){e.$apply(function(){s.$setViewValue(t.select2("data"))})});if(a.initSelection){var f=a.initSelection;a.initSelection=function(e,t){f(e,function(e){s.$setViewValue(e),t(e)})}}}}i.$observe("disabled",function(e){t.select2(e&&"disable"||"enable")}),e.$watch(i.ngMultiple,function(e){t.select2(a)}),t.val(e.$eval(i.ngModel)),setTimeout(function(){t.select2(a)})}}}}]),angular.module("ui.directives").directive("uiCodemirror",["ui.config","$parse",function(e,t){"use strict";return e.codemirror=e.codemirror||{},{require:"ngModel",link:function(n,r,i,s){if(!r.is("textarea"))throw new Error("ui-codemirror can only be applied to a textarea element");var o,u=t(i.uiCodemirror),a=function(e){var t=e.getValue();t!==s.$viewValue&&(s.$setViewValue(t),n.$apply())},f=function(t){t=angular.extend({},t,e.codemirror);var n=t.onChange;n?t.onChange=function(e){a(e),n(e)}:t.onChange=a,o&&o.toTextArea(),o=CodeMirror.fromTextArea(r[0],t)};f(u()),n.$watch(u,f,!0),s.$formatters.push(function(e){if(angular.isUndefined(e)||e===null)return"";if(angular.isObject(e)||angular.isArray(e))throw new Error("ui-codemirror cannot use an object or an array as a model");return e}),s.$render=function(){o.setValue(s.$viewValue)}}}}]),angular.module("ui.directives").directive("uiTinymce",["ui.config",function(e){return e.tinymce=e.tinymce||{},{require:"ngModel",link:function(t,n,r,i){var s,o={onchange_callback:function(e){e.isDirty()&&(e.save(),i.$setViewValue(n.val()),t.$$phase||t.$apply())},handle_event_callback:function(e){return this.isDirty()&&(this.save(),i.$setViewValue(n.val()),t.$$phase||t.$apply()),!0},setup:function(e){e.onSetContent.add(function(e,r){e.isDirty()&&(e.save(),i.$setViewValue(n.val()),t.$$phase||t.$apply())})}};r.uiTinymce?s=t.$eval(r.uiTinymce):s={},angular.extend(o,e.tinymce,s),setTimeout(function(){n.tinymce(o)})}}}]),angular.module("ui.directives").directive("uiIf",[function(){return{transclude:"element",priority:1e3,terminal:!0,restrict:"A",compile:function(e,t,n){return function(e,t,r){t[0].doNotMove=!0;var i=r.uiIf,s,o;e.$watch(i,function(r){s&&(s.remove(),s=null),o&&(o.$destroy(),o=null),r&&(o=e.$new(),n(o,function(e){s=e,t.after(e)})),t.parent().trigger("$childrenChanged")})}}}}]),angular.module("ui.directives").directive("uiScrollfix",["$window",function(e){"use strict";return{link:function(t,n,r){var i=n.offset().top;r.uiScrollfix?r.uiScrollfix.charAt(0)==="-"?r.uiScrollfix=i-r.uiScrollfix.substr(1):r.uiScrollfix.charAt(0)==="+"&&(r.uiScrollfix=i+parseFloat(r.uiScrollfix.substr(1))):r.uiScrollfix=i,angular.element(e).on("scroll.ui-scrollfix",function(){var t;if(angular.isDefined(e.pageYOffset))t=e.pageYOffset;else{var i=document.compatMode&&document.compatMode!=="BackCompat"?document.documentElement:document.body;t=i.scrollTop}!n.hasClass("ui-scrollfix")&&t>r.uiScrollfix?n.addClass("ui-scrollfix"):n.hasClass("ui-scrollfix")&&t<r.uiScrollfix&&n.removeClass("ui-scrollfix")})}}}]),angular.module("ui.directives").directive("uiCalendar",["ui.config","$parse",function(e,t){return e.uiCalendar=e.uiCalendar||{},{require:"ngModel",restrict:"A",scope:{events:"=ngModel"},link:function(n,r,i){function o(){var t,s={header:{left:"prev,next today",center:"title",right:"month,agendaWeek,agendaDay"},eventMouseover:function(e,t,n){n.name!=="agendaDay"&&$(t.target).attr("title",e.title)},events:n.events};i.uiCalendar?t=n.$eval(i.uiCalendar):t={},angular.extend(s,e.uiCalendar,t),r.html("").fullCalendar(s)}var s=t(i.ngModel);o(),n.$watch("events.length",function(e,t){o()},!0)}}}]),angular.module("ui.directives").directive("uiShow",[function(){return function(e,t,n){e.$watch(n.uiShow,function(e,n){e?t.addClass("ui-show"):t.removeClass("ui-show")})}}]).directive("uiHide",[function(){return function(e,t,n){e.$watch(n.uiHide,function(e,n){e?t.addClass("ui-hide"):t.removeClass("ui-hide")})}}]).directive("uiToggle",[function(){return function(e,t,n){e.$watch(n.uiToggle,function(e,n){e?t.removeClass("ui-hide").addClass("ui-show"):t.removeClass("ui-show").addClass("ui-hide")})}}]),angular.module("ui.directives").directive("uiCurrency",["ui.config","currencyFilter",function(e,t){var n={pos:"ui-currency-pos",neg:"ui-currency-neg",zero:"ui-currency-zero"};return e.currency&&angular.extend(n,e.currency),{restrict:"EAC",require:"ngModel",link:function(e,r,i,s){var o,u,a;o=angular.extend({},n,e.$eval(i.uiCurrency)),u=function(e){var n;return n=e*1,n>0?r.addClass(o.pos):r.removeClass(o.pos),n<0?r.addClass(o.neg):r.removeClass(o.neg),n===0?r.addClass(o.zero):r.removeClass(o.zero),e===""?r.text(""):r.text(t(n,o.symbol)),!0},s.$render=function(){a=s.$viewValue,r.val(a),u(a)}}}}]),angular.module("ui.directives").directive("uiDate",["ui.config",function(e){"use strict";var t;return t={},angular.isObject(e.date)&&angular.extend(t,e.date),{require:"?ngModel",link:function(t,n,r,i){var s=function(){return angular.extend({},e.date,t.$eval(r.uiDate))},o=function(){var e=s();if(i){var r=function(){t.$apply(function(){var e=n.datepicker("getDate");n.datepicker("setDate",n.val()),i.$setViewValue(e)})};if(e.onSelect){var o=e.onSelect;e.onSelect=function(e,t){return r(),o(e,t)}}else e.onSelect=r;n.bind("change",r),i.$render=function(){var e=i.$viewValue;if(angular.isDefined(e)&&e!==null&&!angular.isDate(e))throw new Error("ng-Model value must be a Date object - currently it is a "+typeof e+" - use ui-date-format to convert it from a string");n.datepicker("setDate",e)}}n.datepicker("destroy"),n.datepicker(e),i.$render()};t.$watch(s,o,!0)}}}]).directive("uiDateFormat",[function(){var e={require:"ngModel",link:function(e,t,n,r){if(n.uiDateFormat==="")r.$formatters.push(function(e){if(angular.isString(e))return new Date(e)}),r.$parsers.push(function(e){if(e)return e.toISOString()});else{var i=n.uiDateFormat;r.$formatters.push(function(e){if(angular.isString(e))return $.datepicker.parseDate(i,e)}),r.$parsers.push(function(e){if(e)return $.datepicker.formatDate(i,e)})}}};return e}]),angular.module("ui.filters").filter("highlight",function(){return function(e,t,n){return t||angular.isNumber(t)?(e=e.toString(),t=t.toString(),n?e.split(t).join('<span class="ui-match">'+t+"</span>"):e.replace(new RegExp(t,"gi"),'<span class="ui-match">$&</span>')):e}}),angular.module("ui.filters").filter("format",function(){return function(e,t){if(!e)return e;var n=e.toString(),r;return t===undefined?n:!angular.isArray(t)&&!angular.isObject(t)?n.split("$0").join(t):(r=angular.isArray(t)&&"$"||":",angular.forEach(t,function(e,t){n=n.split(r+t).join(e)}),n)}}),angular.module("ui.filters").filter("unique",function(){return function(e,t){if(t===!1)return e;if((t||angular.isUndefined(t))&&angular.isArray(e)){var n={},r=[],i=function(e){return angular.isObject(e)&&angular.isString(t)?e[t]:e};angular.forEach(e,function(e){var t,n=!1;for(var s=0;s<r.length;s++)if(angular.equals(i(r[s]),i(e))){n=!0;break}n||r.push(e)}),e=r}return e}}),angular.module("ui.filters").filter("inflector",function(){function e(e){return e.replace(/^([a-z])|\s+([a-z])/g,function(e){return e.toUpperCase()})}function t(e,t){return e.replace(/[A-Z]/g,function(e){return t+e})}var n={humanize:function(n){return e(t(n," ").split("_").join(" "))},underscore:function(e){return e.substr(0,1).toLowerCase()+t(e.substr(1),"_").toLowerCase().split(" ").join("_")},variable:function(t){return t=t.substr(0,1).toLowerCase()+e(t.split("_").join(" ")).substr(1).split(" ").join(""),t}};return function(e,t,r){return t!==!1&&angular.isString(e)?(t=t||"humanize",n[t](e)):e}});
|
@@ -0,0 +1,171 @@
|
|
1
|
+
/**
|
2
|
+
* @license AngularJS v1.0.4
|
3
|
+
* (c) 2010-2012 Google, Inc. http://angularjs.org
|
4
|
+
* License: MIT
|
5
|
+
*/
|
6
|
+
(function(window, angular, undefined) {
|
7
|
+
'use strict';
|
8
|
+
|
9
|
+
/**
|
10
|
+
* @ngdoc overview
|
11
|
+
* @name ngCookies
|
12
|
+
*/
|
13
|
+
|
14
|
+
|
15
|
+
angular.module('ngCookies', ['ng']).
|
16
|
+
/**
|
17
|
+
* @ngdoc object
|
18
|
+
* @name ngCookies.$cookies
|
19
|
+
* @requires $browser
|
20
|
+
*
|
21
|
+
* @description
|
22
|
+
* Provides read/write access to browser's cookies.
|
23
|
+
*
|
24
|
+
* Only a simple Object is exposed and by adding or removing properties to/from
|
25
|
+
* this object, new cookies are created/deleted at the end of current $eval.
|
26
|
+
*
|
27
|
+
* @example
|
28
|
+
*/
|
29
|
+
factory('$cookies', ['$rootScope', '$browser', function ($rootScope, $browser) {
|
30
|
+
var cookies = {},
|
31
|
+
lastCookies = {},
|
32
|
+
lastBrowserCookies,
|
33
|
+
runEval = false,
|
34
|
+
copy = angular.copy,
|
35
|
+
isUndefined = angular.isUndefined;
|
36
|
+
|
37
|
+
//creates a poller fn that copies all cookies from the $browser to service & inits the service
|
38
|
+
$browser.addPollFn(function() {
|
39
|
+
var currentCookies = $browser.cookies();
|
40
|
+
if (lastBrowserCookies != currentCookies) { //relies on browser.cookies() impl
|
41
|
+
lastBrowserCookies = currentCookies;
|
42
|
+
copy(currentCookies, lastCookies);
|
43
|
+
copy(currentCookies, cookies);
|
44
|
+
if (runEval) $rootScope.$apply();
|
45
|
+
}
|
46
|
+
})();
|
47
|
+
|
48
|
+
runEval = true;
|
49
|
+
|
50
|
+
//at the end of each eval, push cookies
|
51
|
+
//TODO: this should happen before the "delayed" watches fire, because if some cookies are not
|
52
|
+
// strings or browser refuses to store some cookies, we update the model in the push fn.
|
53
|
+
$rootScope.$watch(push);
|
54
|
+
|
55
|
+
return cookies;
|
56
|
+
|
57
|
+
|
58
|
+
/**
|
59
|
+
* Pushes all the cookies from the service to the browser and verifies if all cookies were stored.
|
60
|
+
*/
|
61
|
+
function push() {
|
62
|
+
var name,
|
63
|
+
value,
|
64
|
+
browserCookies,
|
65
|
+
updated;
|
66
|
+
|
67
|
+
//delete any cookies deleted in $cookies
|
68
|
+
for (name in lastCookies) {
|
69
|
+
if (isUndefined(cookies[name])) {
|
70
|
+
$browser.cookies(name, undefined);
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
//update all cookies updated in $cookies
|
75
|
+
for(name in cookies) {
|
76
|
+
value = cookies[name];
|
77
|
+
if (!angular.isString(value)) {
|
78
|
+
if (angular.isDefined(lastCookies[name])) {
|
79
|
+
cookies[name] = lastCookies[name];
|
80
|
+
} else {
|
81
|
+
delete cookies[name];
|
82
|
+
}
|
83
|
+
} else if (value !== lastCookies[name]) {
|
84
|
+
$browser.cookies(name, value);
|
85
|
+
updated = true;
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
//verify what was actually stored
|
90
|
+
if (updated){
|
91
|
+
updated = false;
|
92
|
+
browserCookies = $browser.cookies();
|
93
|
+
|
94
|
+
for (name in cookies) {
|
95
|
+
if (cookies[name] !== browserCookies[name]) {
|
96
|
+
//delete or reset all cookies that the browser dropped from $cookies
|
97
|
+
if (isUndefined(browserCookies[name])) {
|
98
|
+
delete cookies[name];
|
99
|
+
} else {
|
100
|
+
cookies[name] = browserCookies[name];
|
101
|
+
}
|
102
|
+
updated = true;
|
103
|
+
}
|
104
|
+
}
|
105
|
+
}
|
106
|
+
}
|
107
|
+
}]).
|
108
|
+
|
109
|
+
|
110
|
+
/**
|
111
|
+
* @ngdoc object
|
112
|
+
* @name ngCookies.$cookieStore
|
113
|
+
* @requires $cookies
|
114
|
+
*
|
115
|
+
* @description
|
116
|
+
* Provides a key-value (string-object) storage, that is backed by session cookies.
|
117
|
+
* Objects put or retrieved from this storage are automatically serialized or
|
118
|
+
* deserialized by angular's toJson/fromJson.
|
119
|
+
* @example
|
120
|
+
*/
|
121
|
+
factory('$cookieStore', ['$cookies', function($cookies) {
|
122
|
+
|
123
|
+
return {
|
124
|
+
/**
|
125
|
+
* @ngdoc method
|
126
|
+
* @name ngCookies.$cookieStore#get
|
127
|
+
* @methodOf ngCookies.$cookieStore
|
128
|
+
*
|
129
|
+
* @description
|
130
|
+
* Returns the value of given cookie key
|
131
|
+
*
|
132
|
+
* @param {string} key Id to use for lookup.
|
133
|
+
* @returns {Object} Deserialized cookie value.
|
134
|
+
*/
|
135
|
+
get: function(key) {
|
136
|
+
return angular.fromJson($cookies[key]);
|
137
|
+
},
|
138
|
+
|
139
|
+
/**
|
140
|
+
* @ngdoc method
|
141
|
+
* @name ngCookies.$cookieStore#put
|
142
|
+
* @methodOf ngCookies.$cookieStore
|
143
|
+
*
|
144
|
+
* @description
|
145
|
+
* Sets a value for given cookie key
|
146
|
+
*
|
147
|
+
* @param {string} key Id for the `value`.
|
148
|
+
* @param {Object} value Value to be stored.
|
149
|
+
*/
|
150
|
+
put: function(key, value) {
|
151
|
+
$cookies[key] = angular.toJson(value);
|
152
|
+
},
|
153
|
+
|
154
|
+
/**
|
155
|
+
* @ngdoc method
|
156
|
+
* @name ngCookies.$cookieStore#remove
|
157
|
+
* @methodOf ngCookies.$cookieStore
|
158
|
+
*
|
159
|
+
* @description
|
160
|
+
* Remove given cookie
|
161
|
+
*
|
162
|
+
* @param {string} key Id of the key-value pair to delete.
|
163
|
+
*/
|
164
|
+
remove: function(key) {
|
165
|
+
delete $cookies[key];
|
166
|
+
}
|
167
|
+
};
|
168
|
+
|
169
|
+
}]);
|
170
|
+
|
171
|
+
})(window, window.angular);
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/*
|
2
|
+
AngularJS v1.0.4
|
3
|
+
(c) 2010-2012 Google, Inc. http://angularjs.org
|
4
|
+
License: MIT
|
5
|
+
*/
|
6
|
+
(function(m,f,l){'use strict';f.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(d,c){var b={},g={},h,i=!1,j=f.copy,k=f.isUndefined;c.addPollFn(function(){var a=c.cookies();h!=a&&(h=a,j(a,g),j(a,b),i&&d.$apply())})();i=!0;d.$watch(function(){var a,e,d;for(a in g)k(b[a])&&c.cookies(a,l);for(a in b)e=b[a],f.isString(e)?e!==g[a]&&(c.cookies(a,e),d=!0):f.isDefined(g[a])?b[a]=g[a]:delete b[a];if(d)for(a in e=c.cookies(),b)b[a]!==e[a]&&(k(e[a])?delete b[a]:b[a]=e[a])});return b}]).factory("$cookieStore",
|
7
|
+
["$cookies",function(d){return{get:function(c){return f.fromJson(d[c])},put:function(c,b){d[c]=f.toJson(b)},remove:function(c){delete d[c]}}}])})(window,window.angular);
|
@@ -0,0 +1,276 @@
|
|
1
|
+
/**
|
2
|
+
* @license AngularJS v1.0.4
|
3
|
+
* (c) 2010-2012 Google, Inc. http://angularjs.org
|
4
|
+
* License: MIT
|
5
|
+
*/
|
6
|
+
|
7
|
+
(
|
8
|
+
|
9
|
+
/**
|
10
|
+
* @ngdoc interface
|
11
|
+
* @name angular.Module
|
12
|
+
* @description
|
13
|
+
*
|
14
|
+
* Interface for configuring angular {@link angular.module modules}.
|
15
|
+
*/
|
16
|
+
|
17
|
+
function setupModuleLoader(window) {
|
18
|
+
|
19
|
+
function ensure(obj, name, factory) {
|
20
|
+
return obj[name] || (obj[name] = factory());
|
21
|
+
}
|
22
|
+
|
23
|
+
return ensure(ensure(window, 'angular', Object), 'module', function() {
|
24
|
+
/** @type {Object.<string, angular.Module>} */
|
25
|
+
var modules = {};
|
26
|
+
|
27
|
+
/**
|
28
|
+
* @ngdoc function
|
29
|
+
* @name angular.module
|
30
|
+
* @description
|
31
|
+
*
|
32
|
+
* The `angular.module` is a global place for creating and registering Angular modules. All
|
33
|
+
* modules (angular core or 3rd party) that should be available to an application must be
|
34
|
+
* registered using this mechanism.
|
35
|
+
*
|
36
|
+
*
|
37
|
+
* # Module
|
38
|
+
*
|
39
|
+
* A module is a collocation of services, directives, filters, and configuration information. Module
|
40
|
+
* is used to configure the {@link AUTO.$injector $injector}.
|
41
|
+
*
|
42
|
+
* <pre>
|
43
|
+
* // Create a new module
|
44
|
+
* var myModule = angular.module('myModule', []);
|
45
|
+
*
|
46
|
+
* // register a new service
|
47
|
+
* myModule.value('appName', 'MyCoolApp');
|
48
|
+
*
|
49
|
+
* // configure existing services inside initialization blocks.
|
50
|
+
* myModule.config(function($locationProvider) {
|
51
|
+
'use strict';
|
52
|
+
* // Configure existing providers
|
53
|
+
* $locationProvider.hashPrefix('!');
|
54
|
+
* });
|
55
|
+
* </pre>
|
56
|
+
*
|
57
|
+
* Then you can create an injector and load your modules like this:
|
58
|
+
*
|
59
|
+
* <pre>
|
60
|
+
* var injector = angular.injector(['ng', 'MyModule'])
|
61
|
+
* </pre>
|
62
|
+
*
|
63
|
+
* However it's more likely that you'll just use
|
64
|
+
* {@link ng.directive:ngApp ngApp} or
|
65
|
+
* {@link angular.bootstrap} to simplify this process for you.
|
66
|
+
*
|
67
|
+
* @param {!string} name The name of the module to create or retrieve.
|
68
|
+
* @param {Array.<string>=} requires If specified then new module is being created. If unspecified then the
|
69
|
+
* the module is being retrieved for further configuration.
|
70
|
+
* @param {Function} configFn Optional configuration function for the module. Same as
|
71
|
+
* {@link angular.Module#config Module#config()}.
|
72
|
+
* @returns {module} new module with the {@link angular.Module} api.
|
73
|
+
*/
|
74
|
+
return function module(name, requires, configFn) {
|
75
|
+
if (requires && modules.hasOwnProperty(name)) {
|
76
|
+
modules[name] = null;
|
77
|
+
}
|
78
|
+
return ensure(modules, name, function() {
|
79
|
+
if (!requires) {
|
80
|
+
throw Error('No module: ' + name);
|
81
|
+
}
|
82
|
+
|
83
|
+
/** @type {!Array.<Array.<*>>} */
|
84
|
+
var invokeQueue = [];
|
85
|
+
|
86
|
+
/** @type {!Array.<Function>} */
|
87
|
+
var runBlocks = [];
|
88
|
+
|
89
|
+
var config = invokeLater('$injector', 'invoke');
|
90
|
+
|
91
|
+
/** @type {angular.Module} */
|
92
|
+
var moduleInstance = {
|
93
|
+
// Private state
|
94
|
+
_invokeQueue: invokeQueue,
|
95
|
+
_runBlocks: runBlocks,
|
96
|
+
|
97
|
+
/**
|
98
|
+
* @ngdoc property
|
99
|
+
* @name angular.Module#requires
|
100
|
+
* @propertyOf angular.Module
|
101
|
+
* @returns {Array.<string>} List of module names which must be loaded before this module.
|
102
|
+
* @description
|
103
|
+
* Holds the list of modules which the injector will load before the current module is loaded.
|
104
|
+
*/
|
105
|
+
requires: requires,
|
106
|
+
|
107
|
+
/**
|
108
|
+
* @ngdoc property
|
109
|
+
* @name angular.Module#name
|
110
|
+
* @propertyOf angular.Module
|
111
|
+
* @returns {string} Name of the module.
|
112
|
+
* @description
|
113
|
+
*/
|
114
|
+
name: name,
|
115
|
+
|
116
|
+
|
117
|
+
/**
|
118
|
+
* @ngdoc method
|
119
|
+
* @name angular.Module#provider
|
120
|
+
* @methodOf angular.Module
|
121
|
+
* @param {string} name service name
|
122
|
+
* @param {Function} providerType Construction function for creating new instance of the service.
|
123
|
+
* @description
|
124
|
+
* See {@link AUTO.$provide#provider $provide.provider()}.
|
125
|
+
*/
|
126
|
+
provider: invokeLater('$provide', 'provider'),
|
127
|
+
|
128
|
+
/**
|
129
|
+
* @ngdoc method
|
130
|
+
* @name angular.Module#factory
|
131
|
+
* @methodOf angular.Module
|
132
|
+
* @param {string} name service name
|
133
|
+
* @param {Function} providerFunction Function for creating new instance of the service.
|
134
|
+
* @description
|
135
|
+
* See {@link AUTO.$provide#factory $provide.factory()}.
|
136
|
+
*/
|
137
|
+
factory: invokeLater('$provide', 'factory'),
|
138
|
+
|
139
|
+
/**
|
140
|
+
* @ngdoc method
|
141
|
+
* @name angular.Module#service
|
142
|
+
* @methodOf angular.Module
|
143
|
+
* @param {string} name service name
|
144
|
+
* @param {Function} constructor A constructor function that will be instantiated.
|
145
|
+
* @description
|
146
|
+
* See {@link AUTO.$provide#service $provide.service()}.
|
147
|
+
*/
|
148
|
+
service: invokeLater('$provide', 'service'),
|
149
|
+
|
150
|
+
/**
|
151
|
+
* @ngdoc method
|
152
|
+
* @name angular.Module#value
|
153
|
+
* @methodOf angular.Module
|
154
|
+
* @param {string} name service name
|
155
|
+
* @param {*} object Service instance object.
|
156
|
+
* @description
|
157
|
+
* See {@link AUTO.$provide#value $provide.value()}.
|
158
|
+
*/
|
159
|
+
value: invokeLater('$provide', 'value'),
|
160
|
+
|
161
|
+
/**
|
162
|
+
* @ngdoc method
|
163
|
+
* @name angular.Module#constant
|
164
|
+
* @methodOf angular.Module
|
165
|
+
* @param {string} name constant name
|
166
|
+
* @param {*} object Constant value.
|
167
|
+
* @description
|
168
|
+
* Because the constant are fixed, they get applied before other provide methods.
|
169
|
+
* See {@link AUTO.$provide#constant $provide.constant()}.
|
170
|
+
*/
|
171
|
+
constant: invokeLater('$provide', 'constant', 'unshift'),
|
172
|
+
|
173
|
+
/**
|
174
|
+
* @ngdoc method
|
175
|
+
* @name angular.Module#filter
|
176
|
+
* @methodOf angular.Module
|
177
|
+
* @param {string} name Filter name.
|
178
|
+
* @param {Function} filterFactory Factory function for creating new instance of filter.
|
179
|
+
* @description
|
180
|
+
* See {@link ng.$filterProvider#register $filterProvider.register()}.
|
181
|
+
*/
|
182
|
+
filter: invokeLater('$filterProvider', 'register'),
|
183
|
+
|
184
|
+
/**
|
185
|
+
* @ngdoc method
|
186
|
+
* @name angular.Module#controller
|
187
|
+
* @methodOf angular.Module
|
188
|
+
* @param {string} name Controller name.
|
189
|
+
* @param {Function} constructor Controller constructor function.
|
190
|
+
* @description
|
191
|
+
* See {@link ng.$controllerProvider#register $controllerProvider.register()}.
|
192
|
+
*/
|
193
|
+
controller: invokeLater('$controllerProvider', 'register'),
|
194
|
+
|
195
|
+
/**
|
196
|
+
* @ngdoc method
|
197
|
+
* @name angular.Module#directive
|
198
|
+
* @methodOf angular.Module
|
199
|
+
* @param {string} name directive name
|
200
|
+
* @param {Function} directiveFactory Factory function for creating new instance of
|
201
|
+
* directives.
|
202
|
+
* @description
|
203
|
+
* See {@link ng.$compileProvider#directive $compileProvider.directive()}.
|
204
|
+
*/
|
205
|
+
directive: invokeLater('$compileProvider', 'directive'),
|
206
|
+
|
207
|
+
/**
|
208
|
+
* @ngdoc method
|
209
|
+
* @name angular.Module#config
|
210
|
+
* @methodOf angular.Module
|
211
|
+
* @param {Function} configFn Execute this function on module load. Useful for service
|
212
|
+
* configuration.
|
213
|
+
* @description
|
214
|
+
* Use this method to register work which needs to be performed on module loading.
|
215
|
+
*/
|
216
|
+
config: config,
|
217
|
+
|
218
|
+
/**
|
219
|
+
* @ngdoc method
|
220
|
+
* @name angular.Module#run
|
221
|
+
* @methodOf angular.Module
|
222
|
+
* @param {Function} initializationFn Execute this function after injector creation.
|
223
|
+
* Useful for application initialization.
|
224
|
+
* @description
|
225
|
+
* Use this method to register work which should be performed when the injector is done
|
226
|
+
* loading all modules.
|
227
|
+
*/
|
228
|
+
run: function(block) {
|
229
|
+
runBlocks.push(block);
|
230
|
+
return this;
|
231
|
+
}
|
232
|
+
};
|
233
|
+
|
234
|
+
if (configFn) {
|
235
|
+
config(configFn);
|
236
|
+
}
|
237
|
+
|
238
|
+
return moduleInstance;
|
239
|
+
|
240
|
+
/**
|
241
|
+
* @param {string} provider
|
242
|
+
* @param {string} method
|
243
|
+
* @param {String=} insertMethod
|
244
|
+
* @returns {angular.Module}
|
245
|
+
*/
|
246
|
+
function invokeLater(provider, method, insertMethod) {
|
247
|
+
return function() {
|
248
|
+
invokeQueue[insertMethod || 'push']([provider, method, arguments]);
|
249
|
+
return moduleInstance;
|
250
|
+
}
|
251
|
+
}
|
252
|
+
});
|
253
|
+
};
|
254
|
+
});
|
255
|
+
|
256
|
+
}
|
257
|
+
)(window);
|
258
|
+
|
259
|
+
/**
|
260
|
+
* Closure compiler type information
|
261
|
+
*
|
262
|
+
* @typedef { {
|
263
|
+
* requires: !Array.<string>,
|
264
|
+
* invokeQueue: !Array.<Array.<*>>,
|
265
|
+
*
|
266
|
+
* service: function(string, Function):angular.Module,
|
267
|
+
* factory: function(string, Function):angular.Module,
|
268
|
+
* value: function(string, *):angular.Module,
|
269
|
+
*
|
270
|
+
* filter: function(string, Function):angular.Module,
|
271
|
+
*
|
272
|
+
* init: function(Function):angular.Module
|
273
|
+
* } }
|
274
|
+
*/
|
275
|
+
angular.Module;
|
276
|
+
|