532 | Snippet:
533 |
534 |
535 | Filter |
536 | Source |
537 | Rendered |
538 |
539 |
540 | linky filter |
541 |
542 | <div ng-bind-html="snippet | linky"> </div>
543 | |
544 |
545 |
546 | |
547 |
548 |
549 | linky target |
550 |
551 | <div ng-bind-html="snippetWithTarget | linky:'_blank'"> </div>
552 | |
553 |
554 |
555 | |
556 |
557 |
558 | no filter |
559 | <div ng-bind="snippet"> </div> |
560 | |
561 |
562 |
563 |
564 |
565 | it('should linkify the snippet with urls', function() {
566 | expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).
567 | toBe('Pretty text with some links: http://angularjs.org/, us@somewhere.org, ' +
568 | 'another@somewhere.org, and one more: ftp://127.0.0.1/.');
569 | expect(element.all(by.css('#linky-filter a')).count()).toEqual(4);
570 | });
571 |
572 | it('should not linkify snippet without the linky filter', function() {
573 | expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()).
574 | toBe('Pretty text with some links: http://angularjs.org/, mailto:us@somewhere.org, ' +
575 | 'another@somewhere.org, and one more: ftp://127.0.0.1/.');
576 | expect(element.all(by.css('#escaped-html a')).count()).toEqual(0);
577 | });
578 |
579 | it('should update', function() {
580 | element(by.model('snippet')).clear();
581 | element(by.model('snippet')).sendKeys('new http://link.');
582 | expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).
583 | toBe('new http://link.');
584 | expect(element.all(by.css('#linky-filter a')).count()).toEqual(1);
585 | expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText())
586 | .toBe('new http://link.');
587 | });
588 |
589 | it('should work with the target property', function() {
590 | expect(element(by.id('linky-target')).
591 | element(by.binding("snippetWithTarget | linky:'_blank'")).getText()).
592 | toBe('http://angularjs.org/');
593 | expect(element(by.css('#linky-target a')).getAttribute('target')).toEqual('_blank');
594 | });
595 |
596 |
597 | */
598 | angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {
599 | var LINKY_URL_REGEXP =
600 | /((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"]/,
601 | MAILTO_REGEXP = /^mailto:/;
602 |
603 | return function(text, target) {
604 | if (!text) return text;
605 | var match;
606 | var raw = text;
607 | var html = [];
608 | var url;
609 | var i;
610 | while ((match = raw.match(LINKY_URL_REGEXP))) {
611 | // We can not end in these as they are sometimes found at the end of the sentence
612 | url = match[0];
613 | // if we did not match ftp/http/mailto then assume mailto
614 | if (match[2] == match[3]) url = 'mailto:' + url;
615 | i = match.index;
616 | addText(raw.substr(0, i));
617 | addLink(url, match[0].replace(MAILTO_REGEXP, ''));
618 | raw = raw.substring(i + match[0].length);
619 | }
620 | addText(raw);
621 | return $sanitize(html.join(''));
622 |
623 | function addText(text) {
624 | if (!text) {
625 | return;
626 | }
627 | html.push(sanitizeText(text));
628 | }
629 |
630 | function addLink(url, text) {
631 | html.push('
');
640 | addText(text);
641 | html.push('');
642 | }
643 | };
644 | }]);
645 |
646 |
647 | })(window, window.angular);
648 |
--------------------------------------------------------------------------------
/www/lib/js/angular/angular-sanitize.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | AngularJS v1.2.25
3 | (c) 2010-2014 Google, Inc. http://angularjs.org
4 | License: MIT
5 | */
6 | (function(q,g,r){'use strict';function F(a){var d=[];t(d,g.noop).chars(a);return d.join("")}function m(a){var d={};a=a.split(",");var c;for(c=0;c
=c;e--)d.end&&d.end(f[e]);f.length=c}}"string"!==typeof a&&(a=null===a||"undefined"===typeof a?"":""+a);var b,l,f=[],n=a,h;for(f.last=function(){return f[f.length-1]};a;){h="";l=!0;if(f.last()&&y[f.last()])a=a.replace(RegExp("(.*)<\\s*\\/\\s*"+f.last()+"[^>]*>","i"),function(a,b){b=b.replace(I,"$1").replace(J,"$1");d.chars&&d.chars(s(b));return""}),e("",f.last());else{if(0===a.indexOf("\x3c!--"))b=a.indexOf("--",4),0<=b&&a.lastIndexOf("--\x3e",b)===b&&(d.comment&&d.comment(a.substring(4,
8 | b)),a=a.substring(b+3),l=!1);else if(z.test(a)){if(b=a.match(z))a=a.replace(b[0],""),l=!1}else if(K.test(a)){if(b=a.match(A))a=a.substring(b[0].length),b[0].replace(A,e),l=!1}else L.test(a)&&((b=a.match(B))?(b[4]&&(a=a.substring(b[0].length),b[0].replace(B,c)),l=!1):(h+="<",a=a.substring(1)));l&&(b=a.indexOf("<"),h+=0>b?a:a.substring(0,b),a=0>b?"":a.substring(b),d.chars&&d.chars(s(h)))}if(a==n)throw M("badparse",a);n=a}e()}function s(a){if(!a)return"";var d=N.exec(a);a=d[1];var c=d[3];if(d=d[2])p.innerHTML=
9 | d.replace(//g,">")}function t(a,d){var c=!1,e=g.bind(a,a.push);return{start:function(a,l,f){a=g.lowercase(a);!c&&y[a]&&(c=a);c||!0!==D[a]||(e("<"),e(a),g.forEach(l,function(c,f){var k=
10 | g.lowercase(f),l="img"===a&&"src"===k||"background"===k;!0!==Q[k]||!0===E[k]&&!d(c,l)||(e(" "),e(f),e('="'),e(C(c)),e('"'))}),e(f?"/>":">"))},end:function(a){a=g.lowercase(a);c||!0!==D[a]||(e(""),e(a),e(">"));a==c&&(c=!1)},chars:function(a){c||e(C(a))}}}var M=g.$$minErr("$sanitize"),B=/^<((?:[a-zA-Z])[\w:-]*)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*(>?)/,A=/^<\/\s*([\w:-]+)[^>]*>/,H=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,L=/^,
11 | K=/^<\//,I=/\x3c!--(.*?)--\x3e/g,z=/]*?)>/i,J=/"]/,c=/^mailto:/;return function(e,b){function l(a){a&&k.push(F(a))}function f(a,c){k.push("');l(c);k.push("")}
14 | if(!e)return e;for(var n,h=e,k=[],m,p;n=h.match(d);)m=n[0],n[2]==n[3]&&(m="mailto:"+m),p=n.index,l(h.substr(0,p)),f(m,n[0].replace(c,"")),h=h.substring(p+n[0].length);l(h);return a(k.join(""))}}])})(window,window.angular);
15 | //# sourceMappingURL=angular-sanitize.min.js.map
16 |
--------------------------------------------------------------------------------
/www/lib/js/require.js:
--------------------------------------------------------------------------------
1 | /*
2 | RequireJS 2.1.11 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
3 | Available via the MIT or new BSD license.
4 | see: http://github.com/jrburke/requirejs for details
5 | */
6 | var requirejs,require,define;
7 | (function(ca){function G(b){return"[object Function]"===M.call(b)}function H(b){return"[object Array]"===M.call(b)}function v(b,c){if(b){var d;for(d=0;dthis.depCount&&!this.defined){if(G(c)){if(this.events.error&&this.map.isDefine||h.onError!==da)try{f=i.execCb(b,c,e,f)}catch(d){a=d}else f=i.execCb(b,c,e,f);this.map.isDefine&&void 0===f&&((e=this.module)?f=e.exports:this.usingExports&&
19 | (f=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",w(this.error=a)}else f=c;this.exports=f;if(this.map.isDefine&&!this.ignore&&(p[b]=f,h.onResourceLoad))h.onResourceLoad(i,this.map,this.depMaps);y(b);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var a=
20 | this.map,b=a.id,d=m(a.prefix);this.depMaps.push(d);r(d,"defined",t(this,function(f){var d,g;g=j(ba,this.map.id);var J=this.map.name,u=this.map.parentMap?this.map.parentMap.name:null,p=i.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(f.normalize&&(J=f.normalize(J,function(a){return c(a,u,!0)})||""),f=m(a.prefix+"!"+J,this.map.parentMap),r(f,"defined",t(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),g=j(k,f.id)){this.depMaps.push(f);
21 | if(this.events.error)g.on("error",t(this,function(a){this.emit("error",a)}));g.enable()}}else g?(this.map.url=i.nameToUrl(g),this.load()):(d=t(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),d.error=t(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];B(k,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&y(a.map.id)});w(a)}),d.fromText=t(this,function(f,c){var g=a.name,J=m(g),k=O;c&&(f=c);k&&(O=!1);q(J);s(l.config,b)&&(l.config[g]=l.config[b]);try{h.exec(f)}catch(j){return w(C("fromtexteval",
22 | "fromText eval for "+b+" failed: "+j,j,[b]))}k&&(O=!0);this.depMaps.push(J);i.completeLoad(g);p([g],d)}),f.load(a.name,p,d,l))}));i.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){W[this.map.id]=this;this.enabling=this.enabled=!0;v(this.depMaps,t(this,function(a,b){var c,f;if("string"===typeof a){a=m(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=j(N,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;r(a,"defined",t(this,function(a){this.defineDep(b,
23 | a);this.check()}));this.errback&&r(a,"error",t(this,this.errback))}c=a.id;f=k[c];!s(N,c)&&(f&&!f.enabled)&&i.enable(a,this)}));B(this.pluginMaps,t(this,function(a){var b=j(k,a.id);b&&!b.enabled&&i.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){v(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};i={config:l,contextName:b,registry:k,defined:p,urlFetched:T,defQueue:A,Module:$,makeModuleMap:m,
24 | nextTick:h.nextTick,onError:w,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=l.shim,c={paths:!0,bundles:!0,config:!0,map:!0};B(a,function(a,b){c[b]?(l[b]||(l[b]={}),V(l[b],a,!0,!0)):l[b]=a});a.bundles&&B(a.bundles,function(a,b){v(a,function(a){a!==b&&(ba[a]=b)})});a.shim&&(B(a.shim,function(a,c){H(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=i.makeShimExports(a);b[c]=a}),l.shim=b);a.packages&&v(a.packages,function(a){var b,
25 | a="string"===typeof a?{name:a}:a;b=a.name;a.location&&(l.paths[b]=a.location);l.pkgs[b]=a.name+"/"+(a.main||"main").replace(ja,"").replace(R,"")});B(k,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=m(b))});if(a.deps||a.callback)i.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ca,arguments));return b||a.exports&&ea(a.exports)}},makeRequire:function(a,e){function g(f,c,d){var j,l;e.enableBuildCallback&&(c&&G(c))&&(c.__requireJsBuild=
26 | !0);if("string"===typeof f){if(G(c))return w(C("requireargs","Invalid require call"),d);if(a&&s(N,f))return N[f](k[a.id]);if(h.get)return h.get(i,f,a,g);j=m(f,a,!1,!0);j=j.id;return!s(p,j)?w(C("notloaded",'Module name "'+j+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):p[j]}L();i.nextTick(function(){L();l=q(m(null,a));l.skipMap=e.skipMap;l.init(f,c,d,{enabled:!0});D()});return g}e=e||{};V(g,{isBrowser:z,toUrl:function(b){var e,d=b.lastIndexOf("."),g=b.split("/")[0];if(-1!==
27 | d&&(!("."===g||".."===g)||1g.attachEvent.toString().indexOf("[native code"))&&!Z?(O=!0,g.attachEvent("onreadystatechange",b.onScriptLoad)):
34 | (g.addEventListener("load",b.onScriptLoad,!1),g.addEventListener("error",b.onScriptError,!1)),g.src=d,L=g,D?y.insertBefore(g,D):y.appendChild(g),L=null,g;if(fa)try{importScripts(d),b.completeLoad(c)}catch(j){b.onError(C("importscripts","importScripts failed for "+c+" at "+d,j,[c]))}};z&&!r.skipDataMain&&U(document.getElementsByTagName("script"),function(b){y||(y=b.parentNode);if(K=b.getAttribute("data-main"))return q=K,r.baseUrl||(E=q.split("/"),q=E.pop(),Q=E.length?E.join("/")+"/":"./",r.baseUrl=
35 | Q),q=q.replace(R,""),h.jsExtRegExp.test(q)&&(q=K),r.deps=r.deps?r.deps.concat(q):[q],!0});define=function(b,c,d){var g,h;"string"!==typeof b&&(d=c,c=b,b=null);H(c)||(d=c,c=null);!c&&G(d)&&(c=[],d.length&&(d.toString().replace(la,"").replace(ma,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));if(O){if(!(g=L))P&&"interactive"===P.readyState||U(document.getElementsByTagName("script"),function(b){if("interactive"===b.readyState)return P=b}),g=P;g&&(b||
36 | (b=g.getAttribute("data-requiremodule")),h=F[g.getAttribute("data-requirecontext")])}(h?h.defQueue:S).push([b,c,d])};define.amd={jQuery:!0};h.exec=function(b){return eval(b)};h(r)}})(this);
37 |
--------------------------------------------------------------------------------
/www/lib/js/text.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license RequireJS text 2.0.10 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
3 | * Available via the MIT or new BSD license.
4 | * see: http://github.com/requirejs/text for details
5 | */
6 | /*jslint regexp: true */
7 | /*global require, XMLHttpRequest, ActiveXObject,
8 | define, window, process, Packages,
9 | java, location, Components, FileUtils */
10 |
11 | define(['module'], function (module) {
12 | 'use strict';
13 |
14 | var text, fs, Cc, Ci, xpcIsWindows,
15 | progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'],
16 | xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,
17 | bodyRegExp = /]*>\s*([\s\S]+)\s*<\/body>/im,
18 | hasLocation = typeof location !== 'undefined' && location.href,
19 | defaultProtocol = hasLocation && location.protocol && location.protocol.replace(/\:/, ''),
20 | defaultHostName = hasLocation && location.hostname,
21 | defaultPort = hasLocation && (location.port || undefined),
22 | buildMap = {},
23 | masterConfig = (module.config && module.config()) || {};
24 |
25 | text = {
26 | version: '2.0.10',
27 |
28 | strip: function (content) {
29 | //Strips declarations so that external SVG and XML
30 | //documents can be added to a document without worry. Also, if the string
31 | //is an HTML document, only the part inside the body tag is returned.
32 | if (content) {
33 | content = content.replace(xmlRegExp, "");
34 | var matches = content.match(bodyRegExp);
35 | if (matches) {
36 | content = matches[1];
37 | }
38 | } else {
39 | content = "";
40 | }
41 | return content;
42 | },
43 |
44 | jsEscape: function (content) {
45 | return content.replace(/(['\\])/g, '\\$1')
46 | .replace(/[\f]/g, "\\f")
47 | .replace(/[\b]/g, "\\b")
48 | .replace(/[\n]/g, "\\n")
49 | .replace(/[\t]/g, "\\t")
50 | .replace(/[\r]/g, "\\r")
51 | .replace(/[\u2028]/g, "\\u2028")
52 | .replace(/[\u2029]/g, "\\u2029");
53 | },
54 |
55 | createXhr: masterConfig.createXhr || function () {
56 | //Would love to dump the ActiveX crap in here. Need IE 6 to die first.
57 | var xhr, i, progId;
58 | if (typeof XMLHttpRequest !== "undefined") {
59 | return new XMLHttpRequest();
60 | } else if (typeof ActiveXObject !== "undefined") {
61 | for (i = 0; i < 3; i += 1) {
62 | progId = progIds[i];
63 | try {
64 | xhr = new ActiveXObject(progId);
65 | } catch (e) {}
66 |
67 | if (xhr) {
68 | progIds = [progId]; // so faster next time
69 | break;
70 | }
71 | }
72 | }
73 |
74 | return xhr;
75 | },
76 |
77 | /**
78 | * Parses a resource name into its component parts. Resource names
79 | * look like: module/name.ext!strip, where the !strip part is
80 | * optional.
81 | * @param {String} name the resource name
82 | * @returns {Object} with properties "moduleName", "ext" and "strip"
83 | * where strip is a boolean.
84 | */
85 | parseName: function (name) {
86 | var modName, ext, temp,
87 | strip = false,
88 | index = name.indexOf("."),
89 | isRelative = name.indexOf('./') === 0 ||
90 | name.indexOf('../') === 0;
91 |
92 | if (index !== -1 && (!isRelative || index > 1)) {
93 | modName = name.substring(0, index);
94 | ext = name.substring(index + 1, name.length);
95 | } else {
96 | modName = name;
97 | }
98 |
99 | temp = ext || modName;
100 | index = temp.indexOf("!");
101 | if (index !== -1) {
102 | //Pull off the strip arg.
103 | strip = temp.substring(index + 1) === "strip";
104 | temp = temp.substring(0, index);
105 | if (ext) {
106 | ext = temp;
107 | } else {
108 | modName = temp;
109 | }
110 | }
111 |
112 | return {
113 | moduleName: modName,
114 | ext: ext,
115 | strip: strip
116 | };
117 | },
118 |
119 | xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/,
120 |
121 | /**
122 | * Is an URL on another domain. Only works for browser use, returns
123 | * false in non-browser environments. Only used to know if an
124 | * optimized .js version of a text resource should be loaded
125 | * instead.
126 | * @param {String} url
127 | * @returns Boolean
128 | */
129 | useXhr: function (url, protocol, hostname, port) {
130 | var uProtocol, uHostName, uPort,
131 | match = text.xdRegExp.exec(url);
132 | if (!match) {
133 | return true;
134 | }
135 | uProtocol = match[2];
136 | uHostName = match[3];
137 |
138 | uHostName = uHostName.split(':');
139 | uPort = uHostName[1];
140 | uHostName = uHostName[0];
141 |
142 | return (!uProtocol || uProtocol === protocol) &&
143 | (!uHostName || uHostName.toLowerCase() === hostname.toLowerCase()) &&
144 | ((!uPort && !uHostName) || uPort === port);
145 | },
146 |
147 | finishLoad: function (name, strip, content, onLoad) {
148 | content = strip ? text.strip(content) : content;
149 | if (masterConfig.isBuild) {
150 | buildMap[name] = content;
151 | }
152 | onLoad(content);
153 | },
154 |
155 | load: function (name, req, onLoad, config) {
156 | //Name has format: some.module.filext!strip
157 | //The strip part is optional.
158 | //if strip is present, then that means only get the string contents
159 | //inside a body tag in an HTML string. For XML/SVG content it means
160 | //removing the declarations so the content can be inserted
161 | //into the current doc without problems.
162 |
163 | // Do not bother with the work if a build and text will
164 | // not be inlined.
165 | if (config.isBuild && !config.inlineText) {
166 | onLoad();
167 | return;
168 | }
169 |
170 | masterConfig.isBuild = config.isBuild;
171 |
172 | var parsed = text.parseName(name),
173 | nonStripName = parsed.moduleName +
174 | (parsed.ext ? '.' + parsed.ext : ''),
175 | url = req.toUrl(nonStripName),
176 | useXhr = (masterConfig.useXhr) ||
177 | text.useXhr;
178 |
179 | // Do not load if it is an empty: url
180 | if (url.indexOf('empty:') === 0) {
181 | onLoad();
182 | return;
183 | }
184 |
185 | //Load the text. Use XHR if possible and in a browser.
186 | if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) {
187 | text.get(url, function (content) {
188 | text.finishLoad(name, parsed.strip, content, onLoad);
189 | }, function (err) {
190 | if (onLoad.error) {
191 | onLoad.error(err);
192 | }
193 | });
194 | } else {
195 | //Need to fetch the resource across domains. Assume
196 | //the resource has been optimized into a JS module. Fetch
197 | //by the module name + extension, but do not include the
198 | //!strip part to avoid file system issues.
199 | req([nonStripName], function (content) {
200 | text.finishLoad(parsed.moduleName + '.' + parsed.ext,
201 | parsed.strip, content, onLoad);
202 | });
203 | }
204 | },
205 |
206 | write: function (pluginName, moduleName, write, config) {
207 | if (buildMap.hasOwnProperty(moduleName)) {
208 | var content = text.jsEscape(buildMap[moduleName]);
209 | write.asModule(pluginName + "!" + moduleName,
210 | "define(function () { return '" +
211 | content +
212 | "';});\n");
213 | }
214 | },
215 |
216 | writeFile: function (pluginName, moduleName, req, write, config) {
217 | var parsed = text.parseName(moduleName),
218 | extPart = parsed.ext ? '.' + parsed.ext : '',
219 | nonStripName = parsed.moduleName + extPart,
220 | //Use a '.js' file name so that it indicates it is a
221 | //script that can be loaded across domains.
222 | fileName = req.toUrl(parsed.moduleName + extPart) + '.js';
223 |
224 | //Leverage own load() method to load plugin value, but only
225 | //write out values that do not have the strip argument,
226 | //to avoid any potential issues with ! in file names.
227 | text.load(nonStripName, req, function (value) {
228 | //Use own write() method to construct full module value.
229 | //But need to create shell that translates writeFile's
230 | //write() to the right interface.
231 | var textWrite = function (contents) {
232 | return write(fileName, contents);
233 | };
234 | textWrite.asModule = function (moduleName, contents) {
235 | return write.asModule(moduleName, fileName, contents);
236 | };
237 |
238 | text.write(pluginName, nonStripName, textWrite, config);
239 | }, config);
240 | }
241 | };
242 |
243 | if (masterConfig.env === 'node' || (!masterConfig.env &&
244 | typeof process !== "undefined" &&
245 | process.versions &&
246 | !!process.versions.node &&
247 | !process.versions['node-webkit'])) {
248 | //Using special require.nodeRequire, something added by r.js.
249 | fs = require.nodeRequire('fs');
250 |
251 | text.get = function (url, callback, errback) {
252 | try {
253 | var file = fs.readFileSync(url, 'utf8');
254 | //Remove BOM (Byte Mark Order) from utf8 files if it is there.
255 | if (file.indexOf('\uFEFF') === 0) {
256 | file = file.substring(1);
257 | }
258 | callback(file);
259 | } catch (e) {
260 | errback(e);
261 | }
262 | };
263 | } else if (masterConfig.env === 'xhr' || (!masterConfig.env &&
264 | text.createXhr())) {
265 | text.get = function (url, callback, errback, headers) {
266 | var xhr = text.createXhr(), header;
267 | xhr.open('GET', url, true);
268 |
269 | //Allow plugins direct access to xhr headers
270 | if (headers) {
271 | for (header in headers) {
272 | if (headers.hasOwnProperty(header)) {
273 | xhr.setRequestHeader(header.toLowerCase(), headers[header]);
274 | }
275 | }
276 | }
277 |
278 | //Allow overrides specified in config
279 | if (masterConfig.onXhr) {
280 | masterConfig.onXhr(xhr, url);
281 | }
282 |
283 | xhr.onreadystatechange = function (evt) {
284 | var status, err;
285 | //Do not explicitly handle errors, those should be
286 | //visible via console output in the browser.
287 | if (xhr.readyState === 4) {
288 | status = xhr.status;
289 | if (status > 399 && status < 600) {
290 | //An http 4xx or 5xx error. Signal an error.
291 | err = new Error(url + ' HTTP status: ' + status);
292 | err.xhr = xhr;
293 | errback(err);
294 | } else {
295 | callback(xhr.responseText);
296 | }
297 |
298 | if (masterConfig.onXhrComplete) {
299 | masterConfig.onXhrComplete(xhr, url);
300 | }
301 | }
302 | };
303 | xhr.send(null);
304 | };
305 | } else if (masterConfig.env === 'rhino' || (!masterConfig.env &&
306 | typeof Packages !== 'undefined' && typeof java !== 'undefined')) {
307 | //Why Java, why is this so awkward?
308 | text.get = function (url, callback) {
309 | var stringBuffer, line,
310 | encoding = "utf-8",
311 | file = new java.io.File(url),
312 | lineSeparator = java.lang.System.getProperty("line.separator"),
313 | input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)),
314 | content = '';
315 | try {
316 | stringBuffer = new java.lang.StringBuffer();
317 | line = input.readLine();
318 |
319 | // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324
320 | // http://www.unicode.org/faq/utf_bom.html
321 |
322 | // Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK:
323 | // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058
324 | if (line && line.length() && line.charAt(0) === 0xfeff) {
325 | // Eat the BOM, since we've already found the encoding on this file,
326 | // and we plan to concatenating this buffer with others; the BOM should
327 | // only appear at the top of a file.
328 | line = line.substring(1);
329 | }
330 |
331 | if (line !== null) {
332 | stringBuffer.append(line);
333 | }
334 |
335 | while ((line = input.readLine()) !== null) {
336 | stringBuffer.append(lineSeparator);
337 | stringBuffer.append(line);
338 | }
339 | //Make sure we return a JavaScript string and not a Java string.
340 | content = String(stringBuffer.toString()); //String
341 | } finally {
342 | input.close();
343 | }
344 | callback(content);
345 | };
346 | } else if (masterConfig.env === 'xpconnect' || (!masterConfig.env &&
347 | typeof Components !== 'undefined' && Components.classes &&
348 | Components.interfaces)) {
349 | //Avert your gaze!
350 | Cc = Components.classes,
351 | Ci = Components.interfaces;
352 | Components.utils['import']('resource://gre/modules/FileUtils.jsm');
353 | xpcIsWindows = ('@mozilla.org/windows-registry-key;1' in Cc);
354 |
355 | text.get = function (url, callback) {
356 | var inStream, convertStream, fileObj,
357 | readData = {};
358 |
359 | if (xpcIsWindows) {
360 | url = url.replace(/\//g, '\\');
361 | }
362 |
363 | fileObj = new FileUtils.File(url);
364 |
365 | //XPCOM, you so crazy
366 | try {
367 | inStream = Cc['@mozilla.org/network/file-input-stream;1']
368 | .createInstance(Ci.nsIFileInputStream);
369 | inStream.init(fileObj, 1, 0, false);
370 |
371 | convertStream = Cc['@mozilla.org/intl/converter-input-stream;1']
372 | .createInstance(Ci.nsIConverterInputStream);
373 | convertStream.init(inStream, "utf-8", inStream.available(),
374 | Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
375 |
376 | convertStream.readString(inStream.available(), readData);
377 | convertStream.close();
378 | inStream.close();
379 | callback(readData.value);
380 | } catch (e) {
381 | throw new Error((fileObj && fileObj.path || '') + ': ' + e);
382 | }
383 | };
384 | }
385 | return text;
386 | });
387 |
--------------------------------------------------------------------------------
/www/res/.pgbomit:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/.pgbomit
--------------------------------------------------------------------------------
/www/res/icon/android/icon-36-ldpi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/icon/android/icon-36-ldpi.png
--------------------------------------------------------------------------------
/www/res/icon/android/icon-48-mdpi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/icon/android/icon-48-mdpi.png
--------------------------------------------------------------------------------
/www/res/icon/android/icon-72-hdpi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/icon/android/icon-72-hdpi.png
--------------------------------------------------------------------------------
/www/res/icon/android/icon-96-xhdpi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/icon/android/icon-96-xhdpi.png
--------------------------------------------------------------------------------
/www/res/icon/bada-wac/icon-48-type5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/icon/bada-wac/icon-48-type5.png
--------------------------------------------------------------------------------
/www/res/icon/bada-wac/icon-50-type3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/icon/bada-wac/icon-50-type3.png
--------------------------------------------------------------------------------
/www/res/icon/bada-wac/icon-80-type4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/icon/bada-wac/icon-80-type4.png
--------------------------------------------------------------------------------
/www/res/icon/bada/icon-128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/icon/bada/icon-128.png
--------------------------------------------------------------------------------
/www/res/icon/blackberry/icon-80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/icon/blackberry/icon-80.png
--------------------------------------------------------------------------------
/www/res/icon/ios/icon-57-2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/icon/ios/icon-57-2x.png
--------------------------------------------------------------------------------
/www/res/icon/ios/icon-57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/icon/ios/icon-57.png
--------------------------------------------------------------------------------
/www/res/icon/ios/icon-72-2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/icon/ios/icon-72-2x.png
--------------------------------------------------------------------------------
/www/res/icon/ios/icon-72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/icon/ios/icon-72.png
--------------------------------------------------------------------------------
/www/res/icon/tizen/icon-128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/icon/tizen/icon-128.png
--------------------------------------------------------------------------------
/www/res/icon/webos/icon-64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/icon/webos/icon-64.png
--------------------------------------------------------------------------------
/www/res/icon/windows-phone/icon-173-tile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/icon/windows-phone/icon-173-tile.png
--------------------------------------------------------------------------------
/www/res/icon/windows-phone/icon-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/icon/windows-phone/icon-48.png
--------------------------------------------------------------------------------
/www/res/icon/windows-phone/icon-62-tile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/icon/windows-phone/icon-62-tile.png
--------------------------------------------------------------------------------
/www/res/screen/android/screen-hdpi-landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/android/screen-hdpi-landscape.png
--------------------------------------------------------------------------------
/www/res/screen/android/screen-hdpi-portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/android/screen-hdpi-portrait.png
--------------------------------------------------------------------------------
/www/res/screen/android/screen-ldpi-landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/android/screen-ldpi-landscape.png
--------------------------------------------------------------------------------
/www/res/screen/android/screen-ldpi-portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/android/screen-ldpi-portrait.png
--------------------------------------------------------------------------------
/www/res/screen/android/screen-mdpi-landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/android/screen-mdpi-landscape.png
--------------------------------------------------------------------------------
/www/res/screen/android/screen-mdpi-portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/android/screen-mdpi-portrait.png
--------------------------------------------------------------------------------
/www/res/screen/android/screen-xhdpi-landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/android/screen-xhdpi-landscape.png
--------------------------------------------------------------------------------
/www/res/screen/android/screen-xhdpi-portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/android/screen-xhdpi-portrait.png
--------------------------------------------------------------------------------
/www/res/screen/bada-wac/screen-type3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/bada-wac/screen-type3.png
--------------------------------------------------------------------------------
/www/res/screen/bada-wac/screen-type4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/bada-wac/screen-type4.png
--------------------------------------------------------------------------------
/www/res/screen/bada-wac/screen-type5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/bada-wac/screen-type5.png
--------------------------------------------------------------------------------
/www/res/screen/bada/screen-portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/bada/screen-portrait.png
--------------------------------------------------------------------------------
/www/res/screen/blackberry/screen-225.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/blackberry/screen-225.png
--------------------------------------------------------------------------------
/www/res/screen/ios/screen-ipad-landscape-2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/ios/screen-ipad-landscape-2x.png
--------------------------------------------------------------------------------
/www/res/screen/ios/screen-ipad-landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/ios/screen-ipad-landscape.png
--------------------------------------------------------------------------------
/www/res/screen/ios/screen-ipad-portrait-2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/ios/screen-ipad-portrait-2x.png
--------------------------------------------------------------------------------
/www/res/screen/ios/screen-ipad-portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/ios/screen-ipad-portrait.png
--------------------------------------------------------------------------------
/www/res/screen/ios/screen-iphone-landscape-2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/ios/screen-iphone-landscape-2x.png
--------------------------------------------------------------------------------
/www/res/screen/ios/screen-iphone-landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/ios/screen-iphone-landscape.png
--------------------------------------------------------------------------------
/www/res/screen/ios/screen-iphone-portrait-2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/ios/screen-iphone-portrait-2x.png
--------------------------------------------------------------------------------
/www/res/screen/ios/screen-iphone-portrait-568h-2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/ios/screen-iphone-portrait-568h-2x.png
--------------------------------------------------------------------------------
/www/res/screen/ios/screen-iphone-portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/ios/screen-iphone-portrait.png
--------------------------------------------------------------------------------
/www/res/screen/tizen/README.md:
--------------------------------------------------------------------------------
1 | # Tizen Splash Screen
2 |
3 | Splash screens are unsupported on the Tizen platform.
4 |
--------------------------------------------------------------------------------
/www/res/screen/webos/screen-64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/webos/screen-64.png
--------------------------------------------------------------------------------
/www/res/screen/windows-phone/screen-portrait.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paldom/angular-ionic-requirejs-phonegap-seed/46f0cdba041dcc05bf47693c7e741de8b5dde700/www/res/screen/windows-phone/screen-portrait.jpg
--------------------------------------------------------------------------------
/www/spec.html:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
22 | Jasmine Spec Runner
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/www/spec/helper.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | afterEach(function() {
20 | document.getElementById('stage').innerHTML = '';
21 | });
22 |
23 | var helper = {
24 | trigger: function(obj, name) {
25 | var e = document.createEvent('Event');
26 | e.initEvent(name, true, true);
27 | obj.dispatchEvent(e);
28 | },
29 | getComputedStyle: function(querySelector, property) {
30 | var element = document.querySelector(querySelector);
31 | return window.getComputedStyle(element).getPropertyValue(property);
32 | }
33 | };
34 |
--------------------------------------------------------------------------------
/www/spec/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | describe('app', function() {
20 | describe('initialize', function() {
21 | it('should bind deviceready', function() {
22 | runs(function() {
23 | spyOn(app, 'onDeviceReady');
24 | app.initialize();
25 | helper.trigger(window.document, 'deviceready');
26 | });
27 |
28 | waitsFor(function() {
29 | return (app.onDeviceReady.calls.length > 0);
30 | }, 'onDeviceReady should be called once', 500);
31 |
32 | runs(function() {
33 | expect(app.onDeviceReady).toHaveBeenCalled();
34 | });
35 | });
36 | });
37 |
38 | describe('onDeviceReady', function() {
39 | it('should report that it fired', function() {
40 | spyOn(app, 'receivedEvent');
41 | app.onDeviceReady();
42 | expect(app.receivedEvent).toHaveBeenCalledWith('deviceready');
43 | });
44 | });
45 |
46 | describe('receivedEvent', function() {
47 | beforeEach(function() {
48 | var el = document.getElementById('stage');
49 | el.innerHTML = ['',
50 | '
Listening
',
51 | '
Received
',
52 | '
'].join('\n');
53 | });
54 |
55 | it('should hide the listening element', function() {
56 | app.receivedEvent('deviceready');
57 | var displayStyle = helper.getComputedStyle('#deviceready .listening', 'display');
58 | expect(displayStyle).toEqual('none');
59 | });
60 |
61 | it('should show the received element', function() {
62 | app.receivedEvent('deviceready');
63 | var displayStyle = helper.getComputedStyle('#deviceready .received', 'display');
64 | expect(displayStyle).toEqual('block');
65 | });
66 | });
67 | });
68 |
--------------------------------------------------------------------------------
/www/spec/lib/jasmine-1.2.0/MIT.LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2008-2011 Pivotal Labs
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/www/spec/lib/jasmine-1.2.0/jasmine-html.js:
--------------------------------------------------------------------------------
1 | jasmine.HtmlReporterHelpers = {};
2 |
3 | jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) {
4 | var el = document.createElement(type);
5 |
6 | for (var i = 2; i < arguments.length; i++) {
7 | var child = arguments[i];
8 |
9 | if (typeof child === 'string') {
10 | el.appendChild(document.createTextNode(child));
11 | } else {
12 | if (child) {
13 | el.appendChild(child);
14 | }
15 | }
16 | }
17 |
18 | for (var attr in attrs) {
19 | if (attr == "className") {
20 | el[attr] = attrs[attr];
21 | } else {
22 | el.setAttribute(attr, attrs[attr]);
23 | }
24 | }
25 |
26 | return el;
27 | };
28 |
29 | jasmine.HtmlReporterHelpers.getSpecStatus = function(child) {
30 | var results = child.results();
31 | var status = results.passed() ? 'passed' : 'failed';
32 | if (results.skipped) {
33 | status = 'skipped';
34 | }
35 |
36 | return status;
37 | };
38 |
39 | jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) {
40 | var parentDiv = this.dom.summary;
41 | var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite';
42 | var parent = child[parentSuite];
43 |
44 | if (parent) {
45 | if (typeof this.views.suites[parent.id] == 'undefined') {
46 | this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views);
47 | }
48 | parentDiv = this.views.suites[parent.id].element;
49 | }
50 |
51 | parentDiv.appendChild(childElement);
52 | };
53 |
54 |
55 | jasmine.HtmlReporterHelpers.addHelpers = function(ctor) {
56 | for(var fn in jasmine.HtmlReporterHelpers) {
57 | ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn];
58 | }
59 | };
60 |
61 | jasmine.HtmlReporter = function(_doc) {
62 | var self = this;
63 | var doc = _doc || window.document;
64 |
65 | var reporterView;
66 |
67 | var dom = {};
68 |
69 | // Jasmine Reporter Public Interface
70 | self.logRunningSpecs = false;
71 |
72 | self.reportRunnerStarting = function(runner) {
73 | var specs = runner.specs() || [];
74 |
75 | if (specs.length == 0) {
76 | return;
77 | }
78 |
79 | createReporterDom(runner.env.versionString());
80 | doc.body.appendChild(dom.reporter);
81 |
82 | reporterView = new jasmine.HtmlReporter.ReporterView(dom);
83 | reporterView.addSpecs(specs, self.specFilter);
84 | };
85 |
86 | self.reportRunnerResults = function(runner) {
87 | reporterView && reporterView.complete();
88 | };
89 |
90 | self.reportSuiteResults = function(suite) {
91 | reporterView.suiteComplete(suite);
92 | };
93 |
94 | self.reportSpecStarting = function(spec) {
95 | if (self.logRunningSpecs) {
96 | self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
97 | }
98 | };
99 |
100 | self.reportSpecResults = function(spec) {
101 | reporterView.specComplete(spec);
102 | };
103 |
104 | self.log = function() {
105 | var console = jasmine.getGlobal().console;
106 | if (console && console.log) {
107 | if (console.log.apply) {
108 | console.log.apply(console, arguments);
109 | } else {
110 | console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
111 | }
112 | }
113 | };
114 |
115 | self.specFilter = function(spec) {
116 | if (!focusedSpecName()) {
117 | return true;
118 | }
119 |
120 | return spec.getFullName().indexOf(focusedSpecName()) === 0;
121 | };
122 |
123 | return self;
124 |
125 | function focusedSpecName() {
126 | var specName;
127 |
128 | (function memoizeFocusedSpec() {
129 | if (specName) {
130 | return;
131 | }
132 |
133 | var paramMap = [];
134 | var params = doc.location.search.substring(1).split('&');
135 |
136 | for (var i = 0; i < params.length; i++) {
137 | var p = params[i].split('=');
138 | paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
139 | }
140 |
141 | specName = paramMap.spec;
142 | })();
143 |
144 | return specName;
145 | }
146 |
147 | function createReporterDom(version) {
148 | dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' },
149 | dom.banner = self.createDom('div', { className: 'banner' },
150 | self.createDom('span', { className: 'title' }, "Jasmine "),
151 | self.createDom('span', { className: 'version' }, version)),
152 |
153 | dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}),
154 | dom.alert = self.createDom('div', {className: 'alert'}),
155 | dom.results = self.createDom('div', {className: 'results'},
156 | dom.summary = self.createDom('div', { className: 'summary' }),
157 | dom.details = self.createDom('div', { id: 'details' }))
158 | );
159 | }
160 | };
161 | jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter);jasmine.HtmlReporter.ReporterView = function(dom) {
162 | this.startedAt = new Date();
163 | this.runningSpecCount = 0;
164 | this.completeSpecCount = 0;
165 | this.passedCount = 0;
166 | this.failedCount = 0;
167 | this.skippedCount = 0;
168 |
169 | this.createResultsMenu = function() {
170 | this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'},
171 | this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: "#"}, '0 specs'),
172 | ' | ',
173 | this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: "#"}, '0 failing'));
174 |
175 | this.summaryMenuItem.onclick = function() {
176 | dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, '');
177 | };
178 |
179 | this.detailsMenuItem.onclick = function() {
180 | showDetails();
181 | };
182 | };
183 |
184 | this.addSpecs = function(specs, specFilter) {
185 | this.totalSpecCount = specs.length;
186 |
187 | this.views = {
188 | specs: {},
189 | suites: {}
190 | };
191 |
192 | for (var i = 0; i < specs.length; i++) {
193 | var spec = specs[i];
194 | this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views);
195 | if (specFilter(spec)) {
196 | this.runningSpecCount++;
197 | }
198 | }
199 | };
200 |
201 | this.specComplete = function(spec) {
202 | this.completeSpecCount++;
203 |
204 | if (isUndefined(this.views.specs[spec.id])) {
205 | this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom);
206 | }
207 |
208 | var specView = this.views.specs[spec.id];
209 |
210 | switch (specView.status()) {
211 | case 'passed':
212 | this.passedCount++;
213 | break;
214 |
215 | case 'failed':
216 | this.failedCount++;
217 | break;
218 |
219 | case 'skipped':
220 | this.skippedCount++;
221 | break;
222 | }
223 |
224 | specView.refresh();
225 | this.refresh();
226 | };
227 |
228 | this.suiteComplete = function(suite) {
229 | var suiteView = this.views.suites[suite.id];
230 | if (isUndefined(suiteView)) {
231 | return;
232 | }
233 | suiteView.refresh();
234 | };
235 |
236 | this.refresh = function() {
237 |
238 | if (isUndefined(this.resultsMenu)) {
239 | this.createResultsMenu();
240 | }
241 |
242 | // currently running UI
243 | if (isUndefined(this.runningAlert)) {
244 | this.runningAlert = this.createDom('a', {href: "?", className: "runningAlert bar"});
245 | dom.alert.appendChild(this.runningAlert);
246 | }
247 | this.runningAlert.innerHTML = "Running " + this.completeSpecCount + " of " + specPluralizedFor(this.totalSpecCount);
248 |
249 | // skipped specs UI
250 | if (isUndefined(this.skippedAlert)) {
251 | this.skippedAlert = this.createDom('a', {href: "?", className: "skippedAlert bar"});
252 | }
253 |
254 | this.skippedAlert.innerHTML = "Skipping " + this.skippedCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
255 |
256 | if (this.skippedCount === 1 && isDefined(dom.alert)) {
257 | dom.alert.appendChild(this.skippedAlert);
258 | }
259 |
260 | // passing specs UI
261 | if (isUndefined(this.passedAlert)) {
262 | this.passedAlert = this.createDom('span', {href: "?", className: "passingAlert bar"});
263 | }
264 | this.passedAlert.innerHTML = "Passing " + specPluralizedFor(this.passedCount);
265 |
266 | // failing specs UI
267 | if (isUndefined(this.failedAlert)) {
268 | this.failedAlert = this.createDom('span', {href: "?", className: "failingAlert bar"});
269 | }
270 | this.failedAlert.innerHTML = "Failing " + specPluralizedFor(this.failedCount);
271 |
272 | if (this.failedCount === 1 && isDefined(dom.alert)) {
273 | dom.alert.appendChild(this.failedAlert);
274 | dom.alert.appendChild(this.resultsMenu);
275 | }
276 |
277 | // summary info
278 | this.summaryMenuItem.innerHTML = "" + specPluralizedFor(this.runningSpecCount);
279 | this.detailsMenuItem.innerHTML = "" + this.failedCount + " failing";
280 | };
281 |
282 | this.complete = function() {
283 | dom.alert.removeChild(this.runningAlert);
284 |
285 | this.skippedAlert.innerHTML = "Ran " + this.runningSpecCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
286 |
287 | if (this.failedCount === 0) {
288 | dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, "Passing " + specPluralizedFor(this.passedCount)));
289 | } else {
290 | showDetails();
291 | }
292 |
293 | dom.banner.appendChild(this.createDom('span', {className: 'duration'}, "finished in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"));
294 | };
295 |
296 | return this;
297 |
298 | function showDetails() {
299 | if (dom.reporter.className.search(/showDetails/) === -1) {
300 | dom.reporter.className += " showDetails";
301 | }
302 | }
303 |
304 | function isUndefined(obj) {
305 | return typeof obj === 'undefined';
306 | }
307 |
308 | function isDefined(obj) {
309 | return !isUndefined(obj);
310 | }
311 |
312 | function specPluralizedFor(count) {
313 | var str = count + " spec";
314 | if (count > 1) {
315 | str += "s"
316 | }
317 | return str;
318 | }
319 |
320 | };
321 |
322 | jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView);
323 |
324 |
325 | jasmine.HtmlReporter.SpecView = function(spec, dom, views) {
326 | this.spec = spec;
327 | this.dom = dom;
328 | this.views = views;
329 |
330 | this.symbol = this.createDom('li', { className: 'pending' });
331 | this.dom.symbolSummary.appendChild(this.symbol);
332 |
333 | this.summary = this.createDom('div', { className: 'specSummary' },
334 | this.createDom('a', {
335 | className: 'description',
336 | href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
337 | title: this.spec.getFullName()
338 | }, this.spec.description)
339 | );
340 |
341 | this.detail = this.createDom('div', { className: 'specDetail' },
342 | this.createDom('a', {
343 | className: 'description',
344 | href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
345 | title: this.spec.getFullName()
346 | }, this.spec.getFullName())
347 | );
348 | };
349 |
350 | jasmine.HtmlReporter.SpecView.prototype.status = function() {
351 | return this.getSpecStatus(this.spec);
352 | };
353 |
354 | jasmine.HtmlReporter.SpecView.prototype.refresh = function() {
355 | this.symbol.className = this.status();
356 |
357 | switch (this.status()) {
358 | case 'skipped':
359 | break;
360 |
361 | case 'passed':
362 | this.appendSummaryToSuiteDiv();
363 | break;
364 |
365 | case 'failed':
366 | this.appendSummaryToSuiteDiv();
367 | this.appendFailureDetail();
368 | break;
369 | }
370 | };
371 |
372 | jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() {
373 | this.summary.className += ' ' + this.status();
374 | this.appendToSummary(this.spec, this.summary);
375 | };
376 |
377 | jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() {
378 | this.detail.className += ' ' + this.status();
379 |
380 | var resultItems = this.spec.results().getItems();
381 | var messagesDiv = this.createDom('div', { className: 'messages' });
382 |
383 | for (var i = 0; i < resultItems.length; i++) {
384 | var result = resultItems[i];
385 |
386 | if (result.type == 'log') {
387 | messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
388 | } else if (result.type == 'expect' && result.passed && !result.passed()) {
389 | messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
390 |
391 | if (result.trace.stack) {
392 | messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
393 | }
394 | }
395 | }
396 |
397 | if (messagesDiv.childNodes.length > 0) {
398 | this.detail.appendChild(messagesDiv);
399 | this.dom.details.appendChild(this.detail);
400 | }
401 | };
402 |
403 | jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView);jasmine.HtmlReporter.SuiteView = function(suite, dom, views) {
404 | this.suite = suite;
405 | this.dom = dom;
406 | this.views = views;
407 |
408 | this.element = this.createDom('div', { className: 'suite' },
409 | this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(this.suite.getFullName()) }, this.suite.description)
410 | );
411 |
412 | this.appendToSummary(this.suite, this.element);
413 | };
414 |
415 | jasmine.HtmlReporter.SuiteView.prototype.status = function() {
416 | return this.getSpecStatus(this.suite);
417 | };
418 |
419 | jasmine.HtmlReporter.SuiteView.prototype.refresh = function() {
420 | this.element.className += " " + this.status();
421 | };
422 |
423 | jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView);
424 |
425 | /* @deprecated Use jasmine.HtmlReporter instead
426 | */
427 | jasmine.TrivialReporter = function(doc) {
428 | this.document = doc || document;
429 | this.suiteDivs = {};
430 | this.logRunningSpecs = false;
431 | };
432 |
433 | jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
434 | var el = document.createElement(type);
435 |
436 | for (var i = 2; i < arguments.length; i++) {
437 | var child = arguments[i];
438 |
439 | if (typeof child === 'string') {
440 | el.appendChild(document.createTextNode(child));
441 | } else {
442 | if (child) { el.appendChild(child); }
443 | }
444 | }
445 |
446 | for (var attr in attrs) {
447 | if (attr == "className") {
448 | el[attr] = attrs[attr];
449 | } else {
450 | el.setAttribute(attr, attrs[attr]);
451 | }
452 | }
453 |
454 | return el;
455 | };
456 |
457 | jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
458 | var showPassed, showSkipped;
459 |
460 | this.outerDiv = this.createDom('div', { id: 'TrivialReporter', className: 'jasmine_reporter' },
461 | this.createDom('div', { className: 'banner' },
462 | this.createDom('div', { className: 'logo' },
463 | this.createDom('span', { className: 'title' }, "Jasmine"),
464 | this.createDom('span', { className: 'version' }, runner.env.versionString())),
465 | this.createDom('div', { className: 'options' },
466 | "Show ",
467 | showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }),
468 | this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
469 | showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }),
470 | this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped")
471 | )
472 | ),
473 |
474 | this.runnerDiv = this.createDom('div', { className: 'runner running' },
475 | this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
476 | this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
477 | this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
478 | );
479 |
480 | this.document.body.appendChild(this.outerDiv);
481 |
482 | var suites = runner.suites();
483 | for (var i = 0; i < suites.length; i++) {
484 | var suite = suites[i];
485 | var suiteDiv = this.createDom('div', { className: 'suite' },
486 | this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
487 | this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
488 | this.suiteDivs[suite.id] = suiteDiv;
489 | var parentDiv = this.outerDiv;
490 | if (suite.parentSuite) {
491 | parentDiv = this.suiteDivs[suite.parentSuite.id];
492 | }
493 | parentDiv.appendChild(suiteDiv);
494 | }
495 |
496 | this.startedAt = new Date();
497 |
498 | var self = this;
499 | showPassed.onclick = function(evt) {
500 | if (showPassed.checked) {
501 | self.outerDiv.className += ' show-passed';
502 | } else {
503 | self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
504 | }
505 | };
506 |
507 | showSkipped.onclick = function(evt) {
508 | if (showSkipped.checked) {
509 | self.outerDiv.className += ' show-skipped';
510 | } else {
511 | self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
512 | }
513 | };
514 | };
515 |
516 | jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
517 | var results = runner.results();
518 | var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
519 | this.runnerDiv.setAttribute("class", className);
520 | //do it twice for IE
521 | this.runnerDiv.setAttribute("className", className);
522 | var specs = runner.specs();
523 | var specCount = 0;
524 | for (var i = 0; i < specs.length; i++) {
525 | if (this.specFilter(specs[i])) {
526 | specCount++;
527 | }
528 | }
529 | var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s");
530 | message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s";
531 | this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild);
532 |
533 | this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString()));
534 | };
535 |
536 | jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
537 | var results = suite.results();
538 | var status = results.passed() ? 'passed' : 'failed';
539 | if (results.totalCount === 0) { // todo: change this to check results.skipped
540 | status = 'skipped';
541 | }
542 | this.suiteDivs[suite.id].className += " " + status;
543 | };
544 |
545 | jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) {
546 | if (this.logRunningSpecs) {
547 | this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
548 | }
549 | };
550 |
551 | jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
552 | var results = spec.results();
553 | var status = results.passed() ? 'passed' : 'failed';
554 | if (results.skipped) {
555 | status = 'skipped';
556 | }
557 | var specDiv = this.createDom('div', { className: 'spec ' + status },
558 | this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
559 | this.createDom('a', {
560 | className: 'description',
561 | href: '?spec=' + encodeURIComponent(spec.getFullName()),
562 | title: spec.getFullName()
563 | }, spec.description));
564 |
565 |
566 | var resultItems = results.getItems();
567 | var messagesDiv = this.createDom('div', { className: 'messages' });
568 | for (var i = 0; i < resultItems.length; i++) {
569 | var result = resultItems[i];
570 |
571 | if (result.type == 'log') {
572 | messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
573 | } else if (result.type == 'expect' && result.passed && !result.passed()) {
574 | messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
575 |
576 | if (result.trace.stack) {
577 | messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
578 | }
579 | }
580 | }
581 |
582 | if (messagesDiv.childNodes.length > 0) {
583 | specDiv.appendChild(messagesDiv);
584 | }
585 |
586 | this.suiteDivs[spec.suite.id].appendChild(specDiv);
587 | };
588 |
589 | jasmine.TrivialReporter.prototype.log = function() {
590 | var console = jasmine.getGlobal().console;
591 | if (console && console.log) {
592 | if (console.log.apply) {
593 | console.log.apply(console, arguments);
594 | } else {
595 | console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
596 | }
597 | }
598 | };
599 |
600 | jasmine.TrivialReporter.prototype.getLocation = function() {
601 | return this.document.location;
602 | };
603 |
604 | jasmine.TrivialReporter.prototype.specFilter = function(spec) {
605 | var paramMap = {};
606 | var params = this.getLocation().search.substring(1).split('&');
607 | for (var i = 0; i < params.length; i++) {
608 | var p = params[i].split('=');
609 | paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
610 | }
611 |
612 | if (!paramMap.spec) {
613 | return true;
614 | }
615 | return spec.getFullName().indexOf(paramMap.spec) === 0;
616 | };
617 |
--------------------------------------------------------------------------------
/www/spec/lib/jasmine-1.2.0/jasmine.css:
--------------------------------------------------------------------------------
1 | body { background-color: #eeeeee; padding: 0; margin: 5px; overflow-y: scroll; }
2 |
3 | #HTMLReporter { font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333333; }
4 | #HTMLReporter a { text-decoration: none; }
5 | #HTMLReporter a:hover { text-decoration: underline; }
6 | #HTMLReporter p, #HTMLReporter h1, #HTMLReporter h2, #HTMLReporter h3, #HTMLReporter h4, #HTMLReporter h5, #HTMLReporter h6 { margin: 0; line-height: 14px; }
7 | #HTMLReporter .banner, #HTMLReporter .symbolSummary, #HTMLReporter .summary, #HTMLReporter .resultMessage, #HTMLReporter .specDetail .description, #HTMLReporter .alert .bar, #HTMLReporter .stackTrace { padding-left: 9px; padding-right: 9px; }
8 | #HTMLReporter #jasmine_content { position: fixed; right: 100%; }
9 | #HTMLReporter .version { color: #aaaaaa; }
10 | #HTMLReporter .banner { margin-top: 14px; }
11 | #HTMLReporter .duration { color: #aaaaaa; float: right; }
12 | #HTMLReporter .symbolSummary { overflow: hidden; *zoom: 1; margin: 14px 0; }
13 | #HTMLReporter .symbolSummary li { display: block; float: left; height: 7px; width: 14px; margin-bottom: 7px; font-size: 16px; }
14 | #HTMLReporter .symbolSummary li.passed { font-size: 14px; }
15 | #HTMLReporter .symbolSummary li.passed:before { color: #5e7d00; content: "\02022"; }
16 | #HTMLReporter .symbolSummary li.failed { line-height: 9px; }
17 | #HTMLReporter .symbolSummary li.failed:before { color: #b03911; content: "x"; font-weight: bold; margin-left: -1px; }
18 | #HTMLReporter .symbolSummary li.skipped { font-size: 14px; }
19 | #HTMLReporter .symbolSummary li.skipped:before { color: #bababa; content: "\02022"; }
20 | #HTMLReporter .symbolSummary li.pending { line-height: 11px; }
21 | #HTMLReporter .symbolSummary li.pending:before { color: #aaaaaa; content: "-"; }
22 | #HTMLReporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; }
23 | #HTMLReporter .runningAlert { background-color: #666666; }
24 | #HTMLReporter .skippedAlert { background-color: #aaaaaa; }
25 | #HTMLReporter .skippedAlert:first-child { background-color: #333333; }
26 | #HTMLReporter .skippedAlert:hover { text-decoration: none; color: white; text-decoration: underline; }
27 | #HTMLReporter .passingAlert { background-color: #a6b779; }
28 | #HTMLReporter .passingAlert:first-child { background-color: #5e7d00; }
29 | #HTMLReporter .failingAlert { background-color: #cf867e; }
30 | #HTMLReporter .failingAlert:first-child { background-color: #b03911; }
31 | #HTMLReporter .results { margin-top: 14px; }
32 | #HTMLReporter #details { display: none; }
33 | #HTMLReporter .resultsMenu, #HTMLReporter .resultsMenu a { background-color: #fff; color: #333333; }
34 | #HTMLReporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; }
35 | #HTMLReporter.showDetails .summaryMenuItem:hover { text-decoration: underline; }
36 | #HTMLReporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; }
37 | #HTMLReporter.showDetails .summary { display: none; }
38 | #HTMLReporter.showDetails #details { display: block; }
39 | #HTMLReporter .summaryMenuItem { font-weight: bold; text-decoration: underline; }
40 | #HTMLReporter .summary { margin-top: 14px; }
41 | #HTMLReporter .summary .suite .suite, #HTMLReporter .summary .specSummary { margin-left: 14px; }
42 | #HTMLReporter .summary .specSummary.passed a { color: #5e7d00; }
43 | #HTMLReporter .summary .specSummary.failed a { color: #b03911; }
44 | #HTMLReporter .description + .suite { margin-top: 0; }
45 | #HTMLReporter .suite { margin-top: 14px; }
46 | #HTMLReporter .suite a { color: #333333; }
47 | #HTMLReporter #details .specDetail { margin-bottom: 28px; }
48 | #HTMLReporter #details .specDetail .description { display: block; color: white; background-color: #b03911; }
49 | #HTMLReporter .resultMessage { padding-top: 14px; color: #333333; }
50 | #HTMLReporter .resultMessage span.result { display: block; }
51 | #HTMLReporter .stackTrace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666666; border: 1px solid #ddd; background: white; white-space: pre; }
52 |
53 | #TrivialReporter { padding: 8px 13px; position: absolute; top: 0; bottom: 0; left: 0; right: 0; overflow-y: scroll; background-color: white; font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; /*.resultMessage {*/ /*white-space: pre;*/ /*}*/ }
54 | #TrivialReporter a:visited, #TrivialReporter a { color: #303; }
55 | #TrivialReporter a:hover, #TrivialReporter a:active { color: blue; }
56 | #TrivialReporter .run_spec { float: right; padding-right: 5px; font-size: .8em; text-decoration: none; }
57 | #TrivialReporter .banner { color: #303; background-color: #fef; padding: 5px; }
58 | #TrivialReporter .logo { float: left; font-size: 1.1em; padding-left: 5px; }
59 | #TrivialReporter .logo .version { font-size: .6em; padding-left: 1em; }
60 | #TrivialReporter .runner.running { background-color: yellow; }
61 | #TrivialReporter .options { text-align: right; font-size: .8em; }
62 | #TrivialReporter .suite { border: 1px outset gray; margin: 5px 0; padding-left: 1em; }
63 | #TrivialReporter .suite .suite { margin: 5px; }
64 | #TrivialReporter .suite.passed { background-color: #dfd; }
65 | #TrivialReporter .suite.failed { background-color: #fdd; }
66 | #TrivialReporter .spec { margin: 5px; padding-left: 1em; clear: both; }
67 | #TrivialReporter .spec.failed, #TrivialReporter .spec.passed, #TrivialReporter .spec.skipped { padding-bottom: 5px; border: 1px solid gray; }
68 | #TrivialReporter .spec.failed { background-color: #fbb; border-color: red; }
69 | #TrivialReporter .spec.passed { background-color: #bfb; border-color: green; }
70 | #TrivialReporter .spec.skipped { background-color: #bbb; }
71 | #TrivialReporter .messages { border-left: 1px dashed gray; padding-left: 1em; padding-right: 1em; }
72 | #TrivialReporter .passed { background-color: #cfc; display: none; }
73 | #TrivialReporter .failed { background-color: #fbb; }
74 | #TrivialReporter .skipped { color: #777; background-color: #eee; display: none; }
75 | #TrivialReporter .resultMessage span.result { display: block; line-height: 2em; color: black; }
76 | #TrivialReporter .resultMessage .mismatch { color: black; }
77 | #TrivialReporter .stackTrace { white-space: pre; font-size: .8em; margin-left: 10px; max-height: 5em; overflow: auto; border: 1px inset red; padding: 1em; background: #eef; }
78 | #TrivialReporter .finished-at { padding-left: 1em; font-size: .6em; }
79 | #TrivialReporter.show-passed .passed, #TrivialReporter.show-skipped .skipped { display: block; }
80 | #TrivialReporter #jasmine_content { position: fixed; right: 100%; }
81 | #TrivialReporter .runner { border: 1px solid gray; display: block; margin: 5px 0; padding: 2px 0 2px 10px; }
82 |
--------------------------------------------------------------------------------
/www/templates/about.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | This is a sample seed project for the Ionic Framework. Please cut it up and make it your own. Check out the
6 | docs
7 | for more info.
8 |
9 |
10 | Questions? Hit up the
11 | forum.
12 |
13 |
14 | Find a bug? Create an
15 | issue.
16 |
17 |
18 | What to help improve Ionic?
19 | Contribute.
20 |
21 |
22 | Stay up-to-date with the Ionic
23 | newsletterand
24 | twitteraccount.
25 |
26 |
27 | MIT Licensed. Happy coding.
28 |
29 |
30 |
Angular seed app: v
31 |
32 |
33 |
34 |
35 | Showing of 'interpolate' filter: {{ 'Current version is v%VERSION%.' | interpolate }}
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/www/templates/adopt.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
12 | Subscribe To Newsletter
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/www/templates/login.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
13 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/www/templates/pet-detail.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{ pet.description }}
4 |
5 | All Pets
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/www/templates/pet-index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{pet.title}}
8 | {{pet.description}}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/www/templates/tabs.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------