You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/05/23 22:03:24 UTC
[01/30] git commit: Support for custom downloaders. Eg: Customized
versions of the App Harness can use Guids to download apps etc.
Updated Branches:
refs/heads/master f456ae48f -> d2d24aeaa
Support for custom downloaders.
Eg: Customized versions of the App Harness can use Guids to download apps etc.
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/33e263f5
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/33e263f5
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/33e263f5
Branch: refs/heads/master
Commit: 33e263f56f6020fa7b626b00e216256896b45b7b
Parents: 28404d5
Author: Shravan Narayan <sh...@google.com>
Authored: Wed May 1 16:10:53 2013 -0400
Committer: Shravan Narayan <sh...@google.com>
Committed: Wed May 1 22:20:09 2013 -0400
----------------------------------------------------------------------
www/index.html | 1 +
www/js/AddCtrl.js | 8 ++--
www/js/AppsService.js | 63 ++++++++++++++++++++++++------
www/js/KnownExtensionDownloader.js | 43 +++++++++++++++++++++
www/js/ResourcesLoader.js | 2 +-
www/views/add.html | 11 ++---
6 files changed, 104 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/33e263f5/www/index.html
----------------------------------------------------------------------
diff --git a/www/index.html b/www/index.html
index 89aff26..f48fc97 100644
--- a/www/index.html
+++ b/www/index.html
@@ -9,6 +9,7 @@
<script type="text/javascript" src="js/AppConstants.js"></script>
<script type="text/javascript" src="js/ResourcesLoader.js"></script>
<script type="text/javascript" src="js/AppsService.js"></script>
+ <script type="text/javascript" src="js/KnownExtensionDownloader.js"></script>
<script type="text/javascript" src="js/CdvhPackageHandler.js"></script>
<script type="text/javascript" src="js/ListCtrl.js"></script>
<script type="text/javascript" src="js/AddCtrl.js"></script>
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/33e263f5/www/js/AddCtrl.js
----------------------------------------------------------------------
diff --git a/www/js/AddCtrl.js b/www/js/AddCtrl.js
index a2f3b32..09a1c50 100644
--- a/www/js/AddCtrl.js
+++ b/www/js/AddCtrl.js
@@ -3,14 +3,14 @@
/* global myApp */
myApp.controller("AddCtrl", ["$scope", "AppsService", function ($scope, AppsService) {
- $scope.addApp = function(appName, appSource, appUrl) {
- if(appSource === "urlToPackage") {
- if(!appUrl) {
+ $scope.addApp = function(appName, appSource, appSourcePattern) {
+ if(appSource === "pattern") {
+ if(!appSourcePattern) {
alert("Url not specified");
return;
}
- AppsService.addAppFromUrl(appName, appUrl)
+ AppsService.addAppFromPattern(appName, appSourcePattern)
.then(function() {
alert("Successfully installed");
}, function(error) {
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/33e263f5/www/js/AppsService.js
----------------------------------------------------------------------
diff --git a/www/js/AppsService.js b/www/js/AppsService.js
index def3d40..7cc4891 100644
--- a/www/js/AppsService.js
+++ b/www/js/AppsService.js
@@ -4,48 +4,55 @@
myApp.factory("AppsService", [ "ResourcesLoader", "INSTALL_DIRECTORY", "TEMP_DIRECTORY", "APPS_JSON", "METADATA_JSON", function(ResourcesLoader, INSTALL_DIRECTORY, TEMP_DIRECTORY, APPS_JSON, METADATA_JSON) {
var platformId = cordova.require("cordova/platform").id;
+ // downloaders that know how to download from certain patterns.
+ // Eg: The KnownExtensionDownloader MAY know how to download from any uri's that end in known extensions
+ var downloadHandlers = [];
// handlers that have registered to unpack certain extensions during the installation of an app
var extensionHandlers = {};
- function grabExtensionFromUrl(url) {
- var lastSegment = url.split("#")[0].split("?")[0].split("/").pop();
+ function grabExtensionFromUri(uri) {
+ var lastSegment = uri.split("#")[0].split("?")[0].split("/").pop();
var dotLocation = lastSegment.lastIndexOf(".");
var extension = (dotLocation !== -1)? lastSegment.substring(dotLocation + 1) : "";
return extension;
}
- function addNewAppFromUrl(appName, appUrl) {
- var extension = grabExtensionFromUrl(appUrl);
- var fileName = TEMP_DIRECTORY + appName + "." + extension;
+ function addNewAppFromPattern(appName, appSourcePattern) {
var _fullFilePath;
return ResourcesLoader.deleteDirectory(INSTALL_DIRECTORY + appName)
.then(function(){
- return ResourcesLoader.downloadFromUrl(appUrl, fileName);
+ for(var i = 0; i < downloadHandlers.length; i++){
+ if(downloadHandlers[i].handler.canHandleSourcePattern(appSourcePattern)){
+ return downloadHandlers[i].handler.downloadFromPattern(appName, appSourcePattern, TEMP_DIRECTORY);
+ }
+ }
+ throw new Error("App Harness does not know how to install an app from the pattern: " + appSourcePattern);
})
.then(function(fullFilePath){
_fullFilePath = fullFilePath;
return ResourcesLoader.ensureDirectoryExists(INSTALL_DIRECTORY + appName);
})
.then(function(directoryPath){
+ var extension = grabExtensionFromUri(appSourcePattern);
if(!extensionHandlers[extension]) {
throw new Error("No handler for extension " + extension + " found");
}
return extensionHandlers[extension].extractPackageToDirectory(_fullFilePath, directoryPath);
})
.then(function(){
- return registerApp(appName, "urlToPackage", appUrl);
+ return registerApp(appName, "pattern", appSourcePattern);
});
}
- function registerApp(appName, appSource, appUrl) {
+ function registerApp(appName, appSource, appSourcePattern) {
return ResourcesLoader.readJSONFileContents(APPS_JSON)
.then(function(result){
result.installedApps = result.installedApps || [];
result.installedApps.push({
"Name" : appName,
"Source" : appSource,
- "Url" : appUrl
+ "Data" : appSourcePattern
});
return ResourcesLoader.writeJSONFileContents(APPS_JSON, result);
});
@@ -156,13 +163,13 @@
});
},
- addAppFromUrl : function(appName, appUrl) {
+ addAppFromPattern : function(appName, appSourcePattern) {
return this.getAppsList()
.then(function(appsList){
if(appsList.indexOf(appName) !== -1) {
throw new Error("An app with this name already exists");
}
- return addNewAppFromUrl(appName, appUrl);
+ return addNewAppFromPattern(appName, appSourcePattern);
});
},
@@ -180,12 +187,36 @@
});
},
+ registerPatternDownloader : function(handler, priority){
+ if(!handler) {
+ throw new Error("Expected handler");
+ }
+ if(typeof(handler.canHandleSourcePattern) !== "function") {
+ throw new Error("Expected function for bool handler.canHandleSourcePattern(string pattern) to exist");
+ }
+ if(typeof(handler.downloadFromPattern) !== "function") {
+ throw new Error("Expected function for (string fullFilePath or QPromise) handler.downloadFromPattern(string appName, string pattern, string tempDirectory) to exist");
+ }
+ if(!priority) {
+ // Assign a default priority
+ priority = 500;
+ }
+ var i = 0;
+ var objToInsert = { "priority" : priority, "handler" : handler };
+ for(i = 0; i < downloadHandlers.length; i++){
+ if(downloadHandlers[i].priority > objToInsert.priority) {
+ break;
+ }
+ }
+ downloadHandlers.splice(i, 0, objToInsert);
+ },
+
registerPackageHandler : function(extension, handler) {
if(!extension) {
throw new Error("Expcted extension");
}
if(!handler || typeof(handler.extractPackageToDirectory) !== "function") {
- throw new Error("Expected function for handler.extractPackageToDirectory to exist");
+ throw new Error("Expected function for void handler.extractPackageToDirectory(string fullFilePath, string directoryPath) to exist");
}
if(handler[extension]) {
throw new Error("Handler already exists for the extension: " + extension);
@@ -196,8 +227,14 @@
updateApp : function(appName){
return removeApp(appName, true)
.then(function(entry){
- return addNewAppFromUrl(entry.Name, entry.Url);
+ if(entry.Source === "pattern") {
+ return addNewAppFromPattern(entry.Name, entry.Data);
+ }
});
+ },
+
+ getKnownExtensions : function() {
+ return Object.keys(extensionHandlers);
}
};
}]);
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/33e263f5/www/js/KnownExtensionDownloader.js
----------------------------------------------------------------------
diff --git a/www/js/KnownExtensionDownloader.js b/www/js/KnownExtensionDownloader.js
new file mode 100644
index 0000000..cec413a
--- /dev/null
+++ b/www/js/KnownExtensionDownloader.js
@@ -0,0 +1,43 @@
+(function(){
+ "use strict";
+ /* global myApp */
+ myApp.run(["AppsService", "ResourcesLoader", function(AppsService, ResourcesLoader){
+
+ function isUri(pattern){
+ var regexUri = /^(?:([a-z0-9+.-]+:\/\/)((?:(?:[a-z0-9-._~!$&'()*+,;=:]|%[0-9A-F]{2})*)@)?((?:[a-z0-9-._~!$&'()*+,;=]|%[0-9A-F]{2})*)(:(?:\d*))?(\/(?:[a-z0-9-._~!$&'()*+,;=:@\/]|%[0-9A-F]{2})*)?|([a-z0-9+.-]+:)(\/?(?:[a-z0-9-._~!$&'()*+,;=:@]|%[0-9A-F]{2})+(?:[a-z0-9-._~!$&'()*+,;=:@\/]|%[0-9A-F]{2})*)?)(\?(?:[a-z0-9-._~!$&'()*+,;=:\/?@]|%[0-9A-F]{2})*)?(#(?:[a-z0-9-._~!$&'()*+,;=:\/?@]|%[0-9A-F]{2})*)?$/i;
+ var ret = (pattern.search(regexUri) !== -1);
+ return ret;
+ }
+
+ function grabExtensionFromUri(uri) {
+ var lastSegment = uri.split("#")[0].split("?")[0].split("/").pop();
+ var dotLocation = lastSegment.lastIndexOf(".");
+ var extension = (dotLocation !== -1)? lastSegment.substring(dotLocation + 1) : "";
+ return extension;
+ }
+
+ // Note the priority given has no meaning in and of itself. It is used solely to compare if any other component has higher priority.
+ AppsService.registerPatternDownloader({
+ canHandleSourcePattern : function (pattern) {
+ var canHandle = false;
+ if(isUri(pattern)) {
+ var currentExtension = grabExtensionFromUri(pattern);
+ if(currentExtension) {
+ var knownExtensions = AppsService.getKnownExtensions();
+ if(knownExtensions.indexOf(currentExtension) !== -1){
+ canHandle = true;
+ }
+ }
+ }
+ return canHandle;
+ },
+
+ downloadFromPattern : function (appName, pattern, tempDirectory) {
+ var extension = grabExtensionFromUri(pattern);
+ var fileName = tempDirectory + appName + "." + extension;
+ return ResourcesLoader.downloadFromUrl(pattern, fileName);
+ }
+ }, 500 /* assign a priority */);
+
+ }]);
+})();
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/33e263f5/www/js/ResourcesLoader.js
----------------------------------------------------------------------
diff --git a/www/js/ResourcesLoader.js b/www/js/ResourcesLoader.js
index c26e465..a11e27b 100644
--- a/www/js/ResourcesLoader.js
+++ b/www/js/ResourcesLoader.js
@@ -10,7 +10,6 @@
var deferred = Q.defer();
if(!initialised) {
- initialised = true;
var failedFileSystemLookUp = function (error) {
var errorString = "An error occurred while reading the file system.";
@@ -22,6 +21,7 @@
var success = function(_fs) {
fs = _fs;
+ initialised = true;
deferred.resolve(fs);
};
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/33e263f5/www/views/add.html
----------------------------------------------------------------------
diff --git a/www/views/add.html b/www/views/add.html
index d767141..902c46d 100644
--- a/www/views/add.html
+++ b/www/views/add.html
@@ -6,13 +6,12 @@
<span ng-show="addForm.appName.$error.maxlength">Too long</span>
<br />
- <input type="radio" ng-model="appSource" name="appSource" value="urlToPackage" ng-init="appUrlChecked=true; appSource='urlToPackage'" ng-checked="appUrlChecked" />
- <label for="inputAppUrl">Enter the URL to a file</label><br />
- <input id="inputAppUrl" type="url" name="appUrl" ng-model="appUrl" ng-disabled="!appUrlChecked" ng-required="appUrlChecked" />
- <span ng-show="addForm.appUrl.$error.required">Required</span>
- <span ng-show="addForm.appUrl.$error.url">Not a URL</span>
+ <input type="radio" ng-model="appSource" name="appSource" value="pattern" ng-init="appPatternChecked=true; appSource='pattern'" ng-checked="appPatternChecked" />
+ <label for="inputAppPattern">Enter the URL to a file</label><br />
+ <input id="inputAppPattern" type="text" name="appSourcePattern" ng-model="appSourcePattern" ng-disabled="!appPatternChecked" ng-required="appPatternChecked" />
+ <span ng-show="addForm.appSourcePattern.$error.required">Required</span>
<br />
- <button ng-click="addApp(appName, appSource, appUrl)" ng-disabled="!(addForm.$valid)">Add</button>
+ <button ng-click="addApp(appName, appSource, appSourcePattern)" ng-disabled="!(addForm.$valid)">Add</button>
<br />
<a href="#/">Back To Main Menu</a>
</form>
\ No newline at end of file
[11/30] New filenames.Url aliases.(New AppBundle plugin needed).Desc
cont below Android has a bug where the web view will not throw intercept
events if you are navigating to a location that matches a filename in your
bundle. Thus in order to support url
Posted by ag...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/cdvah_js/libs/q.min.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/libs/q.min.js b/www/cdvah_js/libs/q.min.js
new file mode 100644
index 0000000..7a27b9a
--- /dev/null
+++ b/www/cdvah_js/libs/q.min.js
@@ -0,0 +1,19 @@
+(function(k){"function"===typeof bootstrap?bootstrap("promise",k):"object"===typeof exports?module.exports=k():"function"===typeof define&&define.amd?define(k):"undefined"!==typeof ses?ses.ok()&&(ses.makeQ=k):Q=k()})(function(){function k(a){var b=Function.call;return function(){return b.apply(a,arguments)}}function L(a,b){b.stack&&("object"===typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(M))&&(a.stack=N(a.stack)+"\n"+M+"\n"+N(b.stack))}function N(a){for(var a=a.split("\n"),b=[],d=0;d<a.length;++d){var j=
+a[d],c;if(c=/at .+ \((.*):(\d+):\d+\)/.exec(j)){var g=c[2];c=c[1]===O&&g>=aa&&g<=ba}else c=!1;!c&&!(-1!==j.indexOf("(module.js:")||-1!==j.indexOf("(node.js:"))&&b.push(j)}return b.join("\n")}function P(){if(Error.captureStackTrace){var a,b,d=Error.prepareStackTrace;Error.prepareStackTrace=function(d,c){a=c[1].getFileName();b=c[1].getLineNumber()};Error().stack;Error.prepareStackTrace=d;O=a;return b}}function c(a){return p(a)}function i(){function a(a){b&&(j=p(a),t(b,function(a,b){l(function(){j.promiseDispatch.apply(j,
+b)})},void 0),d=b=void 0)}var b=[],d=[],j,e=C(i.prototype),g=C(m.prototype);g.promiseDispatch=function(a,c,g){var e=h(arguments);b?(b.push(e),"when"===c&&g[1]&&d.push(g[1])):l(function(){j.promiseDispatch.apply(j,e)})};g.valueOf=function(){if(b)return g;var a=o(j);u(a)&&(j=a);return a};Error.captureStackTrace&&0<c.longStackJumpLimit&&(Error.captureStackTrace(g,i),g.stack=g.stack.substring(g.stack.indexOf("\n")+1));e.promise=g;e.resolve=a;e.fulfill=function(b){a(D(b))};e.reject=function(b){a(n(b))};
+e.notify=function(a){b&&t(d,function(b,d){l(function(){d(a)})},void 0)};return e}function m(a,b,d,c,e){void 0===b&&(b=function(a){return n(Error("Promise does not support operation: "+a))});var g=C(m.prototype);g.promiseDispatch=function(d,c,j){var e;try{e=a[c]?a[c].apply(g,j):b.call(g,c,j)}catch(f){e=n(f)}d&&d(e)};d&&(g.valueOf=d);e&&(g.exception=c);return g}function o(a){return u(a)?a.valueOf():a}function u(a){return a&&"function"===typeof a.promiseDispatch}function E(a){return a&&"function"===
+typeof a.then}function F(a){return!E(o(a))}function R(a){a=o(a);return u(a)&&"exception"in a}function n(a){var b=m({when:function(b){if(b){var c=ca(G,this);-1!==c&&(v.splice(c,1),G.splice(c,1))}return b?b(a):this}},function(){return n(a)},function(){return this},a,!0);!S&&("undefined"!==typeof window&&!window.Touch&&window.console)&&console.log("Should be empty:",v);S=!0;G.push(b);v.push(a);return b}function D(a){return m({when:function(){return a},get:function(b){return a[b]},set:function(b,d){a[b]=
+d},"delete":function(b){delete a[b]},post:function(b,d){return null===b||void 0===b?a.apply(void 0,d):a[b].apply(a,d)},apply:function(b,d){return a.apply(b,d)},keys:function(){return da(a)}},void 0,function(){return a})}function p(a){if(u(a))return a;a=o(a);if(E(a)){var b=a,d=i();l(function(){try{b.then(d.resolve,d.reject,d.notify)}catch(a){d.reject(a)}});return d.promise}return D(a)}function f(a,b,d,j){function e(a){try{return"function"===typeof b?b(a):a}catch(d){return n(d)}}function g(a){if("function"===
+typeof d){L(a,k);try{return d(a)}catch(b){return n(b)}}return n(a)}var f=i(),h=!1,k=p(a);l(function(){k.promiseDispatch(function(a){h||(h=!0,f.resolve(e(a)))},"when",[function(a){h||(h=!0,f.resolve(g(a)))}])});k.promiseDispatch(void 0,"when",[void 0,function(a){var b,d=!1;try{b="function"===typeof j?j(a):a}catch(e){if(d=!0,c.onerror)c.onerror(e);else throw e;}d||f.notify(b)}]);return f.promise}function T(a,b,d){return f(a,function(a){return A(a).then(function(a){return b.apply(void 0,a)},d)},d)}function w(a,
+b,d){var c=i();l(function(){p(a).promiseDispatch(c.resolve,b,d)});return c.promise}function q(a){return function(b){var d=h(arguments,1);return w(b,a,d)}}function U(a,b){var d=h(arguments,2);return H(a,b,d)}function r(a,b){return w(a,"apply",[void 0,b])}function I(a){var b=h(arguments,1);return r(a,b)}function A(a){return f(a,function(a){var d=0,c=i();t(a,function(e,g,h){F(g)?a[h]=o(g):(++d,f(g,function(e){a[h]=e;0===--d&&c.resolve(a)},c.reject))},void 0);0===d&&c.resolve(a);return c.promise})}function V(a,
+b){return f(a,void 0,b)}var aa=P(),O,W=function(){},l;if("undefined"!==typeof process)l=process.nextTick;else if("function"===typeof setImmediate)l="undefined"!==typeof window?setImmediate.bind(window):setImmediate;else{var X=function(){--s;if(++J>=x){J=0;x*=4;for(var a=y&&Math.min(y-1,x);s<a;)++s,B()}for(;y;)--y,z=z.next,a=z.task,z.task=void 0,a();J=0},z={task:void 0,next:null},Y=z,x=2,s=0,y=0,J=0,B;l=function(a){Y=Y.next={task:a,next:null};s<++y&&s<x&&(++s,B())};if("undefined"!==typeof MessageChannel){var Z=
+new MessageChannel;Z.port1.onmessage=X;B=function(){Z.port2.postMessage(0)}}else B=function(){setTimeout(X,0)}}var h=k(Array.prototype.slice),t=k(Array.prototype.reduce||function(a,b){var d=0,c=this.length;if(1===arguments.length){do{if(d in this){b=this[d++];break}if(++d>=c)throw new TypeError;}while(1)}for(;d<c;d++)d in this&&(b=a(b,this[d],d));return b}),ca=k(Array.prototype.indexOf||function(a){for(var b=0;b<this.length;b++)if(this[b]===a)return b;return-1}),$=k(Array.prototype.map||function(a,
+b){var d=this,c=[];t(d,function(e,g,f){c.push(a.call(b,g,f,d))},void 0);return c}),C=Object.create||function(a){function b(){}b.prototype=a;return new b},ea=k(Object.prototype.hasOwnProperty),da=Object.keys||function(a){var b=[],d;for(d in a)ea(a,d)&&b.push(d);return b},fa=k(Object.prototype.toString),K;K="undefined"!==typeof ReturnValue?ReturnValue:function(a){this.value=a};c.longStackJumpLimit=1;var M="From previous event:";c.nextTick=l;c.defer=i;i.prototype.makeNodeResolver=function(){var a=this;
+return function(b,d){b?a.reject(b):2<arguments.length?a.resolve(h(arguments,1)):a.resolve(d)}};c.promise=function(a){var b=i();I(a,b.resolve,b.reject,b.notify).fail(b.reject);return b.promise};c.makePromise=m;m.prototype.then=function(a,b,d){return f(this,a,b,d)};m.prototype.thenResolve=function(a){return f(this,function(){return a})};m.prototype.thenReject=function(a){return f(this,function(){throw a;})};t("isFulfilled isRejected isPending dispatch when spread get put set del delete post send invoke keys fapply fcall fbind all allResolved timeout delay catch finally fail fin progress done nfcall nfapply nfbind denodeify nbind ncall napply nbind npost nsend ninvoke nodeify".split(" "),
+function(a,b){m.prototype[b]=function(){return c[b].apply(c,[this].concat(h(arguments)))}},void 0);m.prototype.toSource=function(){return this.toString()};m.prototype.toString=function(){return"[object Promise]"};c.nearer=o;c.isPromise=u;c.isPromiseAlike=E;c.isPending=function(a){return!F(a)&&!R(a)};c.isFulfilled=F;c.isRejected=R;var G=[],v=[],S;if("undefined"!==typeof process&&process.on)process.on("exit",function(){for(var a=0;a<v.length;a++){var b=v[a];b&&"undefined"!==typeof b.stack?console.warn("Unhandled rejected promise:",
+b.stack):console.warn("Unhandled rejected promise (no stack):",b)}});c.reject=n;c.fulfill=D;c.resolve=p;c.master=function(a){return m({isDef:function(){}},function(b,d){return w(a,b,d)},function(){return o(a)})};c.when=f;c.spread=T;c.async=function(a){return function(){function b(a,b){var h;try{h=d[a](b)}catch(i){return"[object StopIteration]"===fa(i)||i instanceof K?i.value:n(i)}return f(h,c,e)}var d=a.apply(this,arguments),c=b.bind(b,"send"),e=b.bind(b,"throw");return c()}};c["return"]=function(a){throw new K(a);
+};c.promised=function(a){return function(){return T([this,A(arguments)],function(b,d){return a.apply(b,d)})}};c.dispatch=w;c.dispatcher=q;c.get=q("get");c.set=q("set");c["delete"]=c.del=q("delete");var H=c.post=q("post");c.send=U;c.invoke=U;c.fapply=r;c["try"]=I;c.fcall=I;c.fbind=function(a){var b=h(arguments,1);return function(){var d=b.concat(h(arguments));return w(a,"apply",[this,d])}};c.keys=q("keys");c.all=A;c.allResolved=function(a){return f(a,function(a){a=$(a,p);return f(A($(a,function(a){return f(a,
+W,W)})),function(){return a})})};c["catch"]=c.fail=V;c.progress=function(a,b){return f(a,void 0,void 0,b)};c["finally"]=c.fin=function(a,b){return f(a,function(a){return f(b(),function(){return a})},function(a){return f(b(),function(){return n(a)})})};c.done=function(a,b,d,j){var e=function(b){l(function(){L(b,a);if(c.onerror)c.onerror(b);else throw b;})},b=b||d||j?f(a,b,d,j):a;"object"===typeof process&&(process&&process.domain)&&(e=process.domain.bind(e));V(b,e)};c.timeout=function(a,b){var d=i(),
+c=setTimeout(function(){d.reject(Error("Timed out after "+b+" ms"))},b);f(a,function(a){clearTimeout(c);d.resolve(a)},function(a){clearTimeout(c);d.reject(a)},d.notify);return d.promise};c.delay=function(a,b){void 0===b&&(b=a,a=void 0);var d=i();f(a,void 0,void 0,d.notify);setTimeout(function(){d.resolve(a)},b);return d.promise};c.nfapply=function(a,b){var d=h(b),c=i();d.push(c.makeNodeResolver());r(a,d).fail(c.reject);return c.promise};c.nfcall=function(a){var b=h(arguments,1),d=i();b.push(d.makeNodeResolver());
+r(a,b).fail(d.reject);return d.promise};c.nfbind=function(a){var b=h(arguments,1);return function(){var d=b.concat(h(arguments)),c=i();d.push(c.makeNodeResolver());r(a,d).fail(c.reject);return c.promise}};c.denodeify=c.nfbind;c.nbind=function(a,b){var d=h(arguments,2);return function(){var c=d.concat(h(arguments)),e=i();c.push(e.makeNodeResolver());r(function(){return a.apply(b,arguments)},c).fail(e.reject);return e.promise}};c.npost=function(a,b,d){var d=h(d||[]),c=i();d.push(c.makeNodeResolver());
+H(a,b,d).fail(c.reject);return c.promise};c.nsend=function(a,b){var c=h(arguments,2),f=i();c.push(f.makeNodeResolver());H(a,b,c).fail(f.reject);return f.promise};c.ninvoke=c.nsend;c.nodeify=function(a,b){if(b)a.then(function(a){l(function(){b(null,a)})},function(a){l(function(){b(a)})});else return a};var ba=P();return c});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/cdvah_views/add.html
----------------------------------------------------------------------
diff --git a/www/cdvah_views/add.html b/www/cdvah_views/add.html
new file mode 100644
index 0000000..902c46d
--- /dev/null
+++ b/www/cdvah_views/add.html
@@ -0,0 +1,17 @@
+<form name="addForm" ng-controller="AddCtrl">
+ <label for="inputAppName">Enter the App Name</label><br />
+ <input type="text" name="appName" ng-model="appName" ng-pattern="/^[\w ]*$/" ng-maxlength="64" required />
+ <span ng-show="addForm.appName.$error.required">Required</span>
+ <span ng-show="addForm.appName.$error.pattern">Invalid characters used</span>
+ <span ng-show="addForm.appName.$error.maxlength">Too long</span>
+ <br />
+
+ <input type="radio" ng-model="appSource" name="appSource" value="pattern" ng-init="appPatternChecked=true; appSource='pattern'" ng-checked="appPatternChecked" />
+ <label for="inputAppPattern">Enter the URL to a file</label><br />
+ <input id="inputAppPattern" type="text" name="appSourcePattern" ng-model="appSourcePattern" ng-disabled="!appPatternChecked" ng-required="appPatternChecked" />
+ <span ng-show="addForm.appSourcePattern.$error.required">Required</span>
+ <br />
+ <button ng-click="addApp(appName, appSource, appSourcePattern)" ng-disabled="!(addForm.$valid)">Add</button>
+ <br />
+ <a href="#/">Back To Main Menu</a>
+</form>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/cdvah_views/list.html
----------------------------------------------------------------------
diff --git a/www/cdvah_views/list.html b/www/cdvah_views/list.html
new file mode 100644
index 0000000..b73f196
--- /dev/null
+++ b/www/cdvah_views/list.html
@@ -0,0 +1,12 @@
+<ul>
+ <li ng-repeat="app in appsList">
+ <p>{{app.Name}}</p>
+ <p>Installed on: {{app.Installed}}</p>
+ <button ng-click="launchApp(app.Name)">Launch</button>
+ <button ng-click="updateApp(app.Name)">Update</button>
+ <button ng-click="removeApp(app.Name)">Remove</button>
+ </li>
+</ul>
+<button ng-click="loadAppsList()">Reload Apps List</button>
+<br />
+<a href="#/add">Add new App</a>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/contextMenu.html
----------------------------------------------------------------------
diff --git a/www/contextMenu.html b/www/contextMenu.html
deleted file mode 100644
index c1e04fc..0000000
--- a/www/contextMenu.html
+++ /dev/null
@@ -1,53 +0,0 @@
-<!-- Keep stylesheet as a part of the html as this file gets injected into the app -->
-<style>
-#__cordovaappharness_contextMenu_div
-{
- position: fixed;
- left : 0px;
- top : 0px;
- z-index: 2000;
- background-color:rgba(0,0,0,0.75);
- width: 100%;
- height: 100%;
- display: none;
-}
-#__cordovaappharness_contextMenu_div p
-{
- color: white;
- text-align: center;
-}
-#__cordovaappharness_contextMenu_div ul
-{
- list-style-type: none;
- margin-left: 20%;
- margin-right: 20%;
- padding: 0;
- width: 60%;
-}
-#__cordovaappharness_contextMenu_div li
-{
- margin-bottom: 0.5cm;
-}
-#__cordovaappharness_contextMenu_div li, #__cordovaappharness_contextMenu_div button
-{
- width: 100%;
- height: 1cm;
-}
-</style>
-<div id="__cordovaappharness_contextMenu_div">
- <p>Tap Anywhere to Close</p>
- <ul>
- <li>
- <a href="app-bundle:///index.html#/?updateLastLaunched=true"><button>Update</button></a>
- </li>
- <li>
- <a href="app-bundle:///index.html#/?lastLaunched=true"><button>Restart</button></a>
- </li>
- <li>
- <button id="__cordovaappharness_contextMenu_firebug_button">Firebug</button>
- </li>
- <li>
- <a href="app-bundle:///index.html"><button>Back to Main Menu</button></a>
- </li>
- </ul>
-</div>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/index.html
----------------------------------------------------------------------
diff --git a/www/index.html b/www/index.html
deleted file mode 100644
index f48fc97..0000000
--- a/www/index.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Cordova App Harness</title>
- <script type="text/javascript" src="cordova.js"></script>
- <script type="text/javascript" src="js/libs/q.min.js"></script>
- <script type="text/javascript" src="js/libs/angular.min.js"></script>
- <script type="text/javascript" src="js/app.js"></script>
- <script type="text/javascript" src="js/AppConstants.js"></script>
- <script type="text/javascript" src="js/ResourcesLoader.js"></script>
- <script type="text/javascript" src="js/AppsService.js"></script>
- <script type="text/javascript" src="js/KnownExtensionDownloader.js"></script>
- <script type="text/javascript" src="js/CdvhPackageHandler.js"></script>
- <script type="text/javascript" src="js/ListCtrl.js"></script>
- <script type="text/javascript" src="js/AddCtrl.js"></script>
- </head>
- <body ng-app="CordovaAppHarness" ng-view>
- </body>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/js/AddCtrl.js
----------------------------------------------------------------------
diff --git a/www/js/AddCtrl.js b/www/js/AddCtrl.js
deleted file mode 100644
index 09a1c50..0000000
--- a/www/js/AddCtrl.js
+++ /dev/null
@@ -1,24 +0,0 @@
-(function(){
- "use strict";
- /* global myApp */
- myApp.controller("AddCtrl", ["$scope", "AppsService", function ($scope, AppsService) {
-
- $scope.addApp = function(appName, appSource, appSourcePattern) {
- if(appSource === "pattern") {
- if(!appSourcePattern) {
- alert("Url not specified");
- return;
- }
-
- AppsService.addAppFromPattern(appName, appSourcePattern)
- .then(function() {
- alert("Successfully installed");
- }, function(error) {
- console.error(error);
- alert("Unable to add application because: \n" + JSON.stringify(error));
- });
- }
- };
- }]);
-
-})();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/js/AppConstants.js
----------------------------------------------------------------------
diff --git a/www/js/AppConstants.js b/www/js/AppConstants.js
deleted file mode 100644
index 81f8b4d..0000000
--- a/www/js/AppConstants.js
+++ /dev/null
@@ -1,12 +0,0 @@
-(function() {
- var TEMP_DIRECTORY = "cordova_app_harness_tempDir/";
- var INSTALL_DIRECTORY = "cordova_app_harness_installed_apps/";
- var APPS_JSON = "cordova_app_harness_installed_apps/apps.json";
- var METADATA_JSON = "cordova_app_harness_installed_apps/metadata.json";
-
- /* global myApp */
- myApp.value("TEMP_DIRECTORY", TEMP_DIRECTORY);
- myApp.value("INSTALL_DIRECTORY", INSTALL_DIRECTORY);
- myApp.value("APPS_JSON", APPS_JSON);
- myApp.value("METADATA_JSON", METADATA_JSON);
-})();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/js/AppsService.js
----------------------------------------------------------------------
diff --git a/www/js/AppsService.js b/www/js/AppsService.js
deleted file mode 100644
index 8868c07..0000000
--- a/www/js/AppsService.js
+++ /dev/null
@@ -1,253 +0,0 @@
-(function() {
- "use strict";
- /* global myApp */
- myApp.factory("AppsService", [ "ResourcesLoader", "INSTALL_DIRECTORY", "TEMP_DIRECTORY", "APPS_JSON", "METADATA_JSON", function(ResourcesLoader, INSTALL_DIRECTORY, TEMP_DIRECTORY, APPS_JSON, METADATA_JSON) {
-
- var platformId = cordova.require("cordova/platform").id;
- // downloaders that know how to download from certain patterns.
- // Eg: The KnownExtensionDownloader MAY know how to download from any uri's that end in known extensions
- var downloadHandlers = [];
- // handlers that have registered to unpack certain extensions during the installation of an app
- var extensionHandlers = {};
-
- function grabExtensionFromUri(uri) {
- var lastSegment = uri.split("#")[0].split("?")[0].split("/").pop();
- var dotLocation = lastSegment.lastIndexOf(".");
- var extension = (dotLocation !== -1)? lastSegment.substring(dotLocation + 1) : "";
- return extension;
- }
-
- function addNewAppFromPattern(appName, appSourcePattern) {
- var _fullFilePath;
-
- return ResourcesLoader.deleteDirectory(INSTALL_DIRECTORY + appName)
- .then(function(){
- for(var i = 0; i < downloadHandlers.length; i++){
- if(downloadHandlers[i].handler.canHandleSourcePattern(appSourcePattern)){
- return downloadHandlers[i].handler.downloadFromPattern(appName, appSourcePattern, TEMP_DIRECTORY);
- }
- }
- throw new Error("App Harness does not know how to install an app from the pattern: " + appSourcePattern);
- })
- .then(function(fullFilePath){
- _fullFilePath = fullFilePath;
- return ResourcesLoader.ensureDirectoryExists(INSTALL_DIRECTORY + appName);
- })
- .then(function(directoryPath){
- var extension = grabExtensionFromUri(appSourcePattern);
- if(!extensionHandlers[extension]) {
- throw new Error("No handler for extension " + extension + " found");
- }
- return extensionHandlers[extension].extractPackageToDirectory(_fullFilePath, directoryPath);
- })
- .then(function(){
- return registerApp(appName, "pattern", appSourcePattern);
- });
- }
-
- function registerApp(appName, appSource, appSourcePattern) {
- return ResourcesLoader.readJSONFileContents(APPS_JSON)
- .then(function(result){
- result.installedApps = result.installedApps || [];
- result.installedApps.push({
- "Name" : appName,
- "Source" : appSource,
- "Data" : appSourcePattern
- "Installed" : (new Date()).toLocaleString()
- });
- return ResourcesLoader.writeJSONFileContents(APPS_JSON, result);
- });
- }
-
- function cleanPath(path){
- if(path.indexOf("file://") === 0){
- path = path.substring("file://".length);
- }
- // remove trailing slash
- return (path.substring(path.length - 1) === "/") ? path.substring(0, path.length - 1) : path;
- }
-
- function getAppStartPageFromConfig(configFile, appBaseDirectory) {
- configFile = cleanPath(configFile);
- appBaseDirectory = cleanPath(appBaseDirectory);
-
- return ResourcesLoader.readFileContents(configFile)
- .then(function(contents){
- if(!contents) {
- throw new Error("Config file is empty. Unable to find a start page for your app.");
- } else {
- var startLocation = appBaseDirectory + "/index.html";
- var parser = new DOMParser();
- var xmlDoc = parser.parseFromString(contents, "text/xml");
- var els = xmlDoc.getElementsByTagName("content");
-
- if(els.length > 0) {
- // go through all "content" elements looking for the "src" attribute in reverse order
- for(var i = els.length - 1; i >= 0; i--) {
- var el = els[i];
- var srcValue = el.getAttribute("src");
- if(srcValue) {
- // Relative url's only currently
- startLocation = appBaseDirectory + "/" + srcValue;
- break;
- }
- }
- }
-
- return startLocation;
- }
- });
- }
-
- function removeApp(appName){
- var entry;
- return ResourcesLoader.ensureDirectoryExists(APPS_JSON)
- .then(function() {
- return ResourcesLoader.readJSONFileContents(APPS_JSON);
- })
- .then(function(result){
- result.installedApps = result.installedApps || [];
-
- for(var i = 0; i < result.installedApps.length; i++){
- if(result.installedApps[i].Name === appName) {
- entry = result.installedApps.splice(i, 1)[0];
- break;
- }
- }
-
- if(!entry) {
- throw new Error("The app " + appName + " was not found.");
- }
-
- return ResourcesLoader.writeJSONFileContents(APPS_JSON, result);
- })
- .then(function(){
- return ResourcesLoader.deleteDirectory(INSTALL_DIRECTORY + appName);
- })
- .then(function(){
- return entry;
- });
- }
-
- return {
- //return promise with the array of apps
- getAppsList : function(getFullEntries) {
- return ResourcesLoader.ensureDirectoryExists(APPS_JSON)
- .then(function() {
- return ResourcesLoader.readJSONFileContents(APPS_JSON);
- })
- .then(function(result){
- result.installedApps = result.installedApps || [];
- var newAppsList = [];
-
- for(var i = 0; i < result.installedApps.length; i++){
- if(getFullEntries) {
- newAppsList.push(result.installedApps[i]);
- } else {
- newAppsList.push(result.installedApps[i].Name);
- }
- }
-
- return newAppsList;
- });
- },
-
- launchApp : function(appName) {
- return ResourcesLoader.readJSONFileContents(METADATA_JSON)
- .then(function(settings){
- settings = settings || {};
- settings.lastLaunched = appName;
- return ResourcesLoader.writeJSONFileContents(METADATA_JSON, settings);
- })
- .then(function(){
- return ResourcesLoader.getFullFilePath(INSTALL_DIRECTORY + appName);
- })
- .then(function(appLocation) {
- var appPlatformLocation = cleanPath(appLocation) + "/" + platformId;
- return getAppStartPageFromConfig(appPlatformLocation + "/config.xml", appPlatformLocation + "/www/");
- })
- .then(function(startLocation) {
- //ensure we use a file uri
- if(startLocation.search("file://") !== 0){
- startLocation = "file://" + startLocation;
- }
- window.location = startLocation;
- });
- },
-
- addAppFromPattern : function(appName, appSourcePattern) {
- return this.getAppsList(false /* App names only */)
- .then(function(appsList){
- if(appsList.indexOf(appName) !== -1) {
- throw new Error("An app with this name already exists");
- }
- return addNewAppFromPattern(appName, appSourcePattern);
- });
- },
-
- uninstallApp : function(appName) {
- return removeApp(appName);
- },
-
- getLastRunApp : function() {
- return ResourcesLoader.readJSONFileContents(METADATA_JSON)
- .then(function(settings){
- if(!settings || !settings.lastLaunched) {
- throw new Error("No App has been launched yet");
- }
- return settings.lastLaunched;
- });
- },
-
- registerPatternDownloader : function(handler, priority){
- if(!handler) {
- throw new Error("Expected handler");
- }
- if(typeof(handler.canHandleSourcePattern) !== "function") {
- throw new Error("Expected function for bool handler.canHandleSourcePattern(string pattern) to exist");
- }
- if(typeof(handler.downloadFromPattern) !== "function") {
- throw new Error("Expected function for (string fullFilePath or QPromise) handler.downloadFromPattern(string appName, string pattern, string tempDirectory) to exist");
- }
- if(!priority) {
- // Assign a default priority
- priority = 500;
- }
- var i = 0;
- var objToInsert = { "priority" : priority, "handler" : handler };
- for(i = 0; i < downloadHandlers.length; i++){
- if(downloadHandlers[i].priority > objToInsert.priority) {
- break;
- }
- }
- downloadHandlers.splice(i, 0, objToInsert);
- },
-
- registerPackageHandler : function(extension, handler) {
- if(!extension) {
- throw new Error("Expcted extension");
- }
- if(!handler || typeof(handler.extractPackageToDirectory) !== "function") {
- throw new Error("Expected function for void handler.extractPackageToDirectory(string fullFilePath, string directoryPath) to exist");
- }
- if(handler[extension]) {
- throw new Error("Handler already exists for the extension: " + extension);
- }
- extensionHandlers[extension] = handler;
- },
-
- updateApp : function(appName){
- return removeApp(appName)
- .then(function(entry){
- if(entry.Source === "pattern") {
- return addNewAppFromPattern(entry.Name, entry.Data);
- }
- });
- },
-
- getKnownExtensions : function() {
- return Object.keys(extensionHandlers);
- }
- };
- }]);
-})();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/js/CdvhPackageHandler.js
----------------------------------------------------------------------
diff --git a/www/js/CdvhPackageHandler.js b/www/js/CdvhPackageHandler.js
deleted file mode 100644
index 212cd4b..0000000
--- a/www/js/CdvhPackageHandler.js
+++ /dev/null
@@ -1,60 +0,0 @@
-(function(){
- "use strict";
- /* global myApp */
- myApp.run(["AppsService", "ResourcesLoader", function(AppsService, ResourcesLoader){
-
- var platformId = cordova.require("cordova/platform").id;
-
- function copyFile(startUrl, targetLocation){
- /************ Begin Work around for File system bug ************/
- if(targetLocation.indexOf("file://") === 0) {
- targetLocation = targetLocation.substring("file://".length);
- }
- /************ End Work around for File system bug **************/
- return ResourcesLoader.xhrGet(startUrl)
- .then(function(xhr){
- return ResourcesLoader.ensureDirectoryExists(targetLocation)
- .then(function(){
- return ResourcesLoader.writeFileContents(targetLocation, xhr.responseText);
- });
- });
- }
-
- var appendScript = function() {
- console.log("Injecting menu script");
- var contextScript = document.createElement("script");
- contextScript.setAttribute("type","text/javascript");
- contextScript.setAttribute("src", "app-bundle:///js/ContextMenu.js");
- document.getElementsByTagName("head")[0].appendChild(contextScript);
- };
-
- AppsService.registerPackageHandler("cdvh", {
- extractPackageToDirectory : function (fileName, outputDirectory){
- var dataToAppend = "\n(" + appendScript.toString() + ")();";
- var platformDirectory = outputDirectory + "/" + platformId + "/www/";
- var cordovaFile = platformDirectory + "cordova.js";
- var pluginsFile = platformDirectory + "cordova_plugins.json";
-
- // We need to
- // 1) Modify the cordova.js file
- // 2) Copy the cordova_plugins.json we have, as the app that is being installed may have other plugins included which aren't in the harness.
- // If we allow unavailable plugins to be included in this file, the plugin initialiser breaks
- return ResourcesLoader.extractZipFile(fileName, outputDirectory)
- .then(function(){
- return ResourcesLoader.doesFileExist(cordovaFile);
- })
- .then(function(fileExists){
- if(fileExists){
- return Q.all([
- ResourcesLoader.appendFileContents(cordovaFile, dataToAppend),
- copyFile("app-bundle:///cdvh_files/www/cordova_plugins.json", pluginsFile)
- ]);
- } else {
- throw new Error("The package does not seem to have the files required for the platform: " + platformId);
- }
- });
- }
- });
-
- }]);
-})();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/js/ContextMenu.js
----------------------------------------------------------------------
diff --git a/www/js/ContextMenu.js b/www/js/ContextMenu.js
deleted file mode 100644
index 239a76c..0000000
--- a/www/js/ContextMenu.js
+++ /dev/null
@@ -1,84 +0,0 @@
-(function () {
-
- function initialise() {
- var contextHTMLUrl = "app-bundle:///contextMenu.html";
- var xhr = new window.XMLHttpRequest();
- xhr.onreadystatechange=function()
- {
- if (xhr.readyState==4 && xhr.status==200)
- {
- var stringifiedHtml = xhr.responseText;
- onInject(stringifiedHtml);
- }
- };
- // retrieve the context menu
- xhr.open("GET", contextHTMLUrl, true);
- xhr.send();
-
- loadFirebug(false);
- attachErrorListener();
- }
-
- function onInject(stringifiedHtml) {
-
- document.body.innerHTML += stringifiedHtml;
-
- var contextDiv = "__cordovaappharness_contextMenu_div";
- var showFirebugButton = "__cordovaappharness_contextMenu_firebug_button";
-
- // Setup the listeners to toggle the context menu
- document.addEventListener("touchmove", function (event) {
- if(event.touches.length >= 3) {
- document.getElementById(contextDiv).style.display = "inline";
- }
- }, false);
-
- document.getElementById(contextDiv).onclick = function() {
- document.getElementById(contextDiv).style.display = "none";
- };
-
- var firstTime = true;
- document.getElementById(showFirebugButton).onclick = function(){
- try {
- if(firstTime){
- console.warn("Note that messages logged to the console at the app startup may not be visible here.");
- console.warn("Do not use the close button on Firebug. Your console logs will be cleared. Use minimize instead.");
- firstTime = false;
- }
- window.Firebug.chrome.open();
- } catch(e) {
- // hack - FirebugLite appears to have several bugs. One of which is - open firebug, user shuts down FirebugLite through the UI.
- // FirebugLite is now in a bad state of neither being usable or removable. Any calls to open throw an error.
- // The following lines removes the flags that FirebugLite looks for manually and makes it think it has not loaded it yet
- // Then FirebugLite is loaded into the page again
- // This hack should be revisited when FirebugLite moves from version 1.4
- // Either the hack won't be needed anymore or the hack should be checked too see if it still works.
- var el = document.getElementById("FirebugLite");
- if(el) {
- el.setAttribute("id", "");
- }
- delete console.firebuglite;
- loadFirebug(true);
- }
- };
- }
-
- function loadFirebug(startOpened){
- var el = document.createElement("script");
- el.setAttribute("id", "FirebugLite");
- el.setAttribute("src", "https://getfirebug.com/firebug-lite.js");
- el.setAttribute("FirebugLite", "4");
- el.innerHTML = el.innerHTML = "{ debug : false, startOpened : " + startOpened + ", showIconWhenHidden : false, saveCommandLineHistory : true, saveCookies : false }";
- document.head.appendChild(el);
- }
-
- // FirebugLite doesn't catch errors from window.onerror like desktop browser's dev tools do. So we add it manually.
- function attachErrorListener(){
- window.onerror = function(msg, url, line) {
- console.error("Error: " + msg + " on line: " + line + " in file: " + url);
- };
- }
-
- initialise();
-})();
-
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/js/KnownExtensionDownloader.js
----------------------------------------------------------------------
diff --git a/www/js/KnownExtensionDownloader.js b/www/js/KnownExtensionDownloader.js
deleted file mode 100644
index cec413a..0000000
--- a/www/js/KnownExtensionDownloader.js
+++ /dev/null
@@ -1,43 +0,0 @@
-(function(){
- "use strict";
- /* global myApp */
- myApp.run(["AppsService", "ResourcesLoader", function(AppsService, ResourcesLoader){
-
- function isUri(pattern){
- var regexUri = /^(?:([a-z0-9+.-]+:\/\/)((?:(?:[a-z0-9-._~!$&'()*+,;=:]|%[0-9A-F]{2})*)@)?((?:[a-z0-9-._~!$&'()*+,;=]|%[0-9A-F]{2})*)(:(?:\d*))?(\/(?:[a-z0-9-._~!$&'()*+,;=:@\/]|%[0-9A-F]{2})*)?|([a-z0-9+.-]+:)(\/?(?:[a-z0-9-._~!$&'()*+,;=:@]|%[0-9A-F]{2})+(?:[a-z0-9-._~!$&'()*+,;=:@\/]|%[0-9A-F]{2})*)?)(\?(?:[a-z0-9-._~!$&'()*+,;=:\/?@]|%[0-9A-F]{2})*)?(#(?:[a-z0-9-._~!$&'()*+,;=:\/?@]|%[0-9A-F]{2})*)?$/i;
- var ret = (pattern.search(regexUri) !== -1);
- return ret;
- }
-
- function grabExtensionFromUri(uri) {
- var lastSegment = uri.split("#")[0].split("?")[0].split("/").pop();
- var dotLocation = lastSegment.lastIndexOf(".");
- var extension = (dotLocation !== -1)? lastSegment.substring(dotLocation + 1) : "";
- return extension;
- }
-
- // Note the priority given has no meaning in and of itself. It is used solely to compare if any other component has higher priority.
- AppsService.registerPatternDownloader({
- canHandleSourcePattern : function (pattern) {
- var canHandle = false;
- if(isUri(pattern)) {
- var currentExtension = grabExtensionFromUri(pattern);
- if(currentExtension) {
- var knownExtensions = AppsService.getKnownExtensions();
- if(knownExtensions.indexOf(currentExtension) !== -1){
- canHandle = true;
- }
- }
- }
- return canHandle;
- },
-
- downloadFromPattern : function (appName, pattern, tempDirectory) {
- var extension = grabExtensionFromUri(pattern);
- var fileName = tempDirectory + appName + "." + extension;
- return ResourcesLoader.downloadFromUrl(pattern, fileName);
- }
- }, 500 /* assign a priority */);
-
- }]);
-})();
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/js/ListCtrl.js
----------------------------------------------------------------------
diff --git a/www/js/ListCtrl.js b/www/js/ListCtrl.js
deleted file mode 100644
index d906f7c..0000000
--- a/www/js/ListCtrl.js
+++ /dev/null
@@ -1,94 +0,0 @@
-(function(){
- "use strict";
- /* global myApp */
- myApp.controller("ListCtrl", [ "$scope", "$routeParams", "AppsService", function ($scope, $routeParams, AppsService) {
-
- $scope.appsList = [];
-
- function initialise() {
- if($routeParams.lastLaunched) {
- return AppsService.getLastRunApp()
- .then(AppsService.launchApp, function(e){
- e = e || {};
- console.error("Error launching last run app: " + e.message);
- alert("Error launching last run app. Please try again.");
- });
- }
- else if($routeParams.updateLastLaunched) {
- var app;
- // updating may take a while so we show the apps list like we normally do
- return $scope.loadAppsList(true)
- .then(AppsService.getLastRunApp)
- .then(function(_app){
- app = _app;
- return AppsService.updateApp(app);
- })
- .then(function(){
- return AppsService.launchApp(app);
- }, function(e){
- e = e || {};
- console.error("Error updating last run app: " + e.message);
- alert("Error updating last run app. Please try again.");
- });
- }
- else {
- return $scope.loadAppsList(true);
- }
- }
-
- $scope.loadAppsList = function(callApply) {
- return AppsService.getAppsList(true /* get full information about the app */)
- .then(function(newAppsList){
- newAppsList.sort(function(a, b){
- if(a.Name < b.Name) {
- return -1;
- } else if(a.Name > b.Name) {
- return 1;
- }
- return 0;
- });
- //clear the old apps list
- $scope.appsList.splice(0, $scope.appsList.length);
- angular.extend($scope.appsList, newAppsList);
- if(callApply) {
- $scope.$apply();
- }
- }, function(error){
- var str = "There was an error retrieving the apps list";
- console.error(str + JSON.stringify(error));
- alert(str);
- });
- };
-
- $scope.launchApp = function(app){
- return AppsService.launchApp(app)
- .then(null, function(error){
- console.error("Error during loading of app " + app + ": " + error);
- alert("Something went wrong during the loading of the app. Please try again.");
- });
- };
-
- $scope.updateApp = function(app) {
- return AppsService.updateApp(app)
- .then(function(){
- alert("Updated successfully");
- }, function(error){
- console.error("Error during updating of app " + app + ": " + error);
- alert("Something went wrong during the updating of the app. Please try again.");
- });
- };
-
- $scope.removeApp = function(app) {
- var shouldUninstall = confirm("Are you sure you want to uninstall " + app + "?");
- if(shouldUninstall) {
- return AppsService.uninstallApp(app)
- .then(function() { $scope.loadAppsList(true); }, function(error){
- console.error("Error during uninstall of app " + app + ": " + error);
- alert("Something went wrong during the uninstall of the app. Please try again.");
- });
- }
- };
-
- document.addEventListener("deviceready", initialise, false);
- }]);
-})();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/js/ResourcesLoader.js
----------------------------------------------------------------------
diff --git a/www/js/ResourcesLoader.js b/www/js/ResourcesLoader.js
deleted file mode 100644
index 8aa52a9..0000000
--- a/www/js/ResourcesLoader.js
+++ /dev/null
@@ -1,404 +0,0 @@
-(function() {
- "use strict";
-
- /* global myApp */
- myApp.factory("ResourcesLoader", [ "$window", function ($window) {
- var fs;
- var initialised = false;
-
- function initialiseFileSystem() {
- var deferred = Q.defer();
-
- if(!initialised) {
-
- var failedFileSystemLookUp = function (error) {
- var errorString = "An error occurred while reading the file system.";
- if(error) {
- errorString += " " + JSON.stringify(error);
- }
- deferred.reject(new Error(errorString));
- };
-
- var success = function(_fs) {
- fs = _fs;
- initialised = true;
- deferred.resolve(fs);
- };
-
- try {
- $window.requestFileSystem($window.LocalFileSystem.PERSISTENT, 0, success, failedFileSystemLookUp);
- } catch (e) {
- failedFileSystemLookUp(e);
- }
- } else {
- deferred.resolve(fs);
- }
-
- return deferred.promise;
- }
-
- //promise returns full path to downloaded file
- function downloadFromUrl(url, fullFilePath) {
- var deferred = Q.defer();
-
- try {
- var downloadFail = function(error) {
- var str = "There was an error while downloading the file " + JSON.stringify(error);
- deferred.reject(new Error(str));
- };
-
- var downloadSuccess = function(fileEntry) {
- deferred.resolve(fileEntry.fullPath);
- };
-
- var fileTransfer = new $window.FileTransfer();
- var uri = encodeURI(url);
- fileTransfer.download(uri, fullFilePath, downloadSuccess, downloadFail);
- } catch(e) {
- deferred.reject(new Error(e));
- } finally {
- return deferred.promise;
- }
- }
-
- function trim(str) {
- return str && str.replace(/^\s+|\s+$/g, "");
- }
-
- function fixFilePath(path) {
- if(path && path.indexOf("file://") === 0) {
- path = path.substring("file://".length);
- }
- return path;
- }
-
- //promise returns the directory entry
- function getDirectoryEntry(directoryName) {
- var deferred = Q.defer();
-
- try {
- var errorWhileGettingDirectoryEntry = function(error) {
- var str = "There was an error while getting the directory entry for directory " + directoryName + " " + JSON.stringify(error);
- deferred.reject(new Error(str));
- };
- var success = function(directoryEntry) {
- deferred.resolve(directoryEntry);
- };
- fs.root.getDirectory(directoryName, {create: true, exclusive: false}, success, errorWhileGettingDirectoryEntry);
- } catch(e) {
- deferred.reject(new Error(e));
- } finally {
- return deferred.promise;
- }
- }
-
- //promise returns the file entry
- function getFileEntry(fileName, createFlag) {
- var deferred = Q.defer();
-
- try {
- var errorWhileGettingFileEntry = function(error) {
- var str = "There was an error while getting the file entry for file " + fileName + " " + JSON.stringify(error);
- deferred.reject(new Error(str));
- };
- var success = function(fileEntry) {
- deferred.resolve(fileEntry);
- };
- // !! - ensures a boolean value
- fs.root.getFile(fileName, {create: !!createFlag, exclusive: false}, success, errorWhileGettingFileEntry);
- } catch(e) {
- deferred.reject(new Error(e));
- } finally {
- return deferred.promise;
- }
- }
-
- //promise returns the file
- function getFile(fileName) {
- return getFileEntry(fileName, true /* create */).
- then(function(fileEntry){
- var deferred = Q.defer();
-
- try {
- var errorWhileGettingFile = function(error) {
- var str = "There was an error while getting the file for file " + fileName + " " + JSON.stringify(error);
- deferred.reject(new Error(str));
- };
-
- fileEntry.file(deferred.resolve, errorWhileGettingFile);
- } catch(e) {
- deferred.reject(new Error(e));
- } finally {
- return deferred.promise;
- }
- });
- }
-
- function truncateToDirectoryPath(path) {
- //remove the filename if it exists
- var lastLevelIndex = path.search(/[\w ]+(\.[\w ]+)+$/g);
- if(lastLevelIndex !== -1) {
- path = path.substring(0, lastLevelIndex);
- }
- return path;
- }
-
- function getPathSegments(path){
- //truncate leading and trailing slashes
- if(path.charAt(0) === "/"){
- path = path.substring(1);
- }
- if(path.charAt(path.length - 1) === "/"){
- path = path.substring(0, path.length - 1);
- }
- var segments = path.split("/");
- return segments;
- }
-
- function ensureSingleDirectoryExists(directory){
- var deferred = Q.defer();
-
- var gotDirEntry = function(dirEntry) {
- deferred.resolve(dirEntry.fullPath);
- };
-
- var failedToGetDirEntry = function(error) {
- var str = "There was an error checking the directory: " + directory + " " + JSON.stringify(error);
- deferred.reject(new Error(str));
- };
-
- fs.root.getDirectory(directory, {create: true, exclusive: false}, gotDirEntry, failedToGetDirEntry);
- return deferred.promise;
- }
-
- function writeToFile(fileName, contents, append) {
- return getFileEntry(fileName, true)
- .then(function(fileEntry){
- var deferred = Q.defer();
-
- var errorGettingFileWriter = function(error) {
- var str = "There was an error writing the file." + JSON.stringify(error);
- deferred.reject(new Error(str));
- };
-
- var gotFileWriter = function(writer) {
- writer.onwrite = deferred.resolve;
- writer.onerror = function(evt) {
- deferred.reject(new Error(evt));
- };
- if(append){
- writer.seek(writer.length);
- }
- writer.write(contents);
- };
- fileEntry.createWriter(gotFileWriter, errorGettingFileWriter);
- return deferred.promise;
- });
- }
-
- return {
- doesFileExist : function(fileName){
- return initialiseFileSystem()
- .then(function(){
- return getFileEntry(fileName, false /* create */);
- })
- .then(function(){
- return true;
- }, function(){
- return false;
- });
- },
-
- // returns a promise with a full path to the dir
- ensureDirectoryExists : function(directory) {
- return initialiseFileSystem()
- .then(function(){
- directory = truncateToDirectoryPath(directory);
- directory = fixFilePath(directory);
- var segments = getPathSegments(directory);
- var currentDir = directory.charAt(0) === "/"? "/" : "";
- var promiseArr = [];
- while(segments.length !== 0) {
- currentDir += segments.shift() + "/";
- promiseArr.push(ensureSingleDirectoryExists(currentDir));
- }
- return Q.all(promiseArr);
- })
- .then(function(paths){
- return paths[paths.length - 1];
- });
- },
-
- // promise returns full path to file
- getFullFilePath : function(filePath) {
- return initialiseFileSystem()
- .then(function(){
- var deferred = Q.defer();
-
- // Use the file's parent folder to get the full path
- var directory = filePath;
- var fileName = "";
-
- //remove the filename if it exists
- var lastLevelIndex = directory.search(/\/[\w ]+\.[\w ]+$/g);
- if(lastLevelIndex !== -1) {
- directory = filePath.substring(0, lastLevelIndex);
- fileName = filePath.substring(lastLevelIndex + 1);
- }
-
- //we need the directory name w.r.t the root, so remove any slashes in the beginning
- if(directory.charAt(0) === "/") {
- directory = directory.substring(1);
- }
-
- var gotFullPath = function(dirEntry) {
- var fullFilePath = dirEntry.fullPath + "/" + fileName;
- deferred.resolve(fullFilePath);
- };
-
- var failedToGetFullPath = function(error) {
- var str = "There was an error getting the full path of file: " + filePath + " " + JSON.stringify(error);
- deferred.reject(new Error(str));
- };
-
- fs.root.getDirectory(directory, {create: true, exclusive: false}, gotFullPath, failedToGetFullPath);
- return deferred.promise;
- });
- },
-
- // returns a promise with a full path to the downloaded file
- downloadFromUrl : function(url, filePath) {
- var self = this;
- return initialiseFileSystem()
- .then(function(){
- return self.ensureDirectoryExists(filePath);
- })
- .then(function(){
- return self.getFullFilePath(filePath);
- })
- .then(function(fullFilePath){
- return downloadFromUrl(url, fullFilePath);
- });
- },
-
- //returns a promise with the contents of the file
- readFileContents : function(fileName) {
- return initialiseFileSystem()
- .then(function(){
- return getFile(fileName);
- })
- .then(function(file){
- var deferred = Q.defer();
-
- var reader = new $window.FileReader();
- reader.onload = function(evt) {
- var text = evt.target.result;
- deferred.resolve(text);
- };
- reader.onerror = function(evt) {
- deferred.reject(new Error(evt));
- };
- reader.readAsText(file);
-
- return deferred.promise;
- });
- },
-
- //returns a promise with the json contents of the file
- readJSONFileContents : function(fileName) {
- return this.readFileContents(fileName)
- .then(function (text) {
- text = trim(text);
- var resultJson = {};
- if(text) {
- resultJson = JSON.parse(text);
- }
- return resultJson;
- });
- },
-
- //returns a promise when file is written
- writeFileContents : function(fileName, contents) {
- return initialiseFileSystem()
- .then(function(){
- return writeToFile(fileName, contents, false /* append */);
- });
- },
-
- //returns a promise when file is appended
- appendFileContents : function(fileName, contents) {
- return initialiseFileSystem()
- .then(function(){
- return writeToFile(fileName, contents, true /* append */);
- });
- },
-
- //returns a promise when json file is written
- writeJSONFileContents : function(fileName, contents) {
- var stringContents;
- if(typeof contents === "string") {
- stringContents = contents;
- } else {
- stringContents = JSON.stringify(contents);
- }
- return this.writeFileContents(fileName, stringContents);
- },
-
- deleteDirectory : function(directoryName) {
- return initialiseFileSystem()
- .then(function(){
- return getDirectoryEntry(directoryName);
- })
- .then(function(dirEntry){
- var deferred = Q.defer();
- var failedToDeleteDirectory = function(error) {
- var str = "There was an error deleting the directory: " + directoryName + " " + JSON.stringify(error);
- deferred.reject(new Error(str));
- };
- dirEntry.removeRecursively(deferred.resolve, failedToDeleteDirectory);
- return deferred.promise;
- });
- },
-
- extractZipFile : function(fileName, outputDirectory){
- var deferred = Q.defer();
-
- //will throw an exception if the zip plugin is not loaded
- try {
- var onZipDone = function(returnCode) {
- if(returnCode !== 0) {
- deferred.reject(new Error("Something went wrong during the unzipping of: " + fileName));
- } else {
- deferred.resolve();
- }
- };
-
- /* global zip */
- zip.unzip(fileName, outputDirectory, onZipDone);
- } catch(e) {
- deferred.reject(e);
- } finally {
- return deferred.promise;
- }
- },
-
- xhrGet : function(url) {
- var deferred = Q.defer();
- var xhr = new XMLHttpRequest();
- xhr.onreadystatechange = function() {
- if (xhr.readyState === 4) {
- if(xhr.status === 200) {
- deferred.resolve(xhr);
- } else {
- deferred.reject("XHR return status: " + xhr.statusText);
- }
- }
- };
- xhr.open("GET", url, true);
- xhr.send();
- return deferred.promise;
- }
- };
- }]);
-
-})();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/js/app.js
----------------------------------------------------------------------
diff --git a/www/js/app.js b/www/js/app.js
deleted file mode 100644
index 962571e..0000000
--- a/www/js/app.js
+++ /dev/null
@@ -1,11 +0,0 @@
-var myApp = angular.module("CordovaAppHarness", []);
-myApp.config(["$routeProvider", function($routeProvider){
- $routeProvider.when("/", {
- templateUrl: "views/list.html",
- controller: "ListCtrl"
- });
- $routeProvider.when("/add", {
- templateUrl: "views/add.html",
- controller: "AddCtrl"
- });
-}]);
\ No newline at end of file
[03/30] git commit: Merge pull request #17 from shravanrn/url_handler
Posted by ag...@apache.org.
Merge pull request #17 from shravanrn/url_handler
Support for custom downloaders.
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/c2757ea0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/c2757ea0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/c2757ea0
Branch: refs/heads/master
Commit: c2757ea048def96c0535108ff708fea860eedfdf
Parents: 28404d5 33e263f
Author: Braden Shepherdson <br...@gmail.com>
Authored: Thu May 2 14:46:06 2013 -0700
Committer: Braden Shepherdson <br...@gmail.com>
Committed: Thu May 2 14:46:06 2013 -0700
----------------------------------------------------------------------
www/index.html | 1 +
www/js/AddCtrl.js | 8 ++--
www/js/AppsService.js | 63 ++++++++++++++++++++++++------
www/js/KnownExtensionDownloader.js | 43 +++++++++++++++++++++
www/js/ResourcesLoader.js | 2 +-
www/views/add.html | 11 ++---
6 files changed, 104 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
[02/30] git commit: Firebug integration.
Posted by ag...@apache.org.
Firebug integration.
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/7d0e7174
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/7d0e7174
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/7d0e7174
Branch: refs/heads/master
Commit: 7d0e71748fefffaf5c50e7b3ea3b1d270bc87268
Parents: 28404d5
Author: Shravan Narayan <sh...@google.com>
Authored: Wed May 1 22:11:28 2013 -0400
Committer: Shravan Narayan <sh...@google.com>
Committed: Thu May 2 00:29:47 2013 -0400
----------------------------------------------------------------------
www/contextMenu.html | 3 ++
www/js/ContextMenu.js | 47 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 50 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/7d0e7174/www/contextMenu.html
----------------------------------------------------------------------
diff --git a/www/contextMenu.html b/www/contextMenu.html
index 3f30fd3..c1e04fc 100644
--- a/www/contextMenu.html
+++ b/www/contextMenu.html
@@ -44,6 +44,9 @@
<a href="app-bundle:///index.html#/?lastLaunched=true"><button>Restart</button></a>
</li>
<li>
+ <button id="__cordovaappharness_contextMenu_firebug_button">Firebug</button>
+ </li>
+ <li>
<a href="app-bundle:///index.html"><button>Back to Main Menu</button></a>
</li>
</ul>
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/7d0e7174/www/js/ContextMenu.js
----------------------------------------------------------------------
diff --git a/www/js/ContextMenu.js b/www/js/ContextMenu.js
index 3e64487..16d6f08 100644
--- a/www/js/ContextMenu.js
+++ b/www/js/ContextMenu.js
@@ -14,6 +14,9 @@
// retrieve the context menu
xhr.open("GET", contextHTMLUrl, true);
xhr.send();
+
+ loadFirebug(false);
+ attachErrorListener();
}
function onInject(stringifiedHtml) {
@@ -21,6 +24,8 @@
document.body.innerHTML += stringifiedHtml;
var contextDiv = "__cordovaappharness_contextMenu_div";
+ var showFirebugButton = "__cordovaappharness_contextMenu_firebug_button";
+
// Setup the listeners to toggle the context menu
document.addEventListener("touchmove", function (event) {
if(event.touches.length >= 3) {
@@ -31,6 +36,48 @@
document.getElementById(contextDiv).onclick = function() {
document.getElementById(contextDiv).style.display = "none";
};
+
+ var firstTime = true;
+ document.getElementById(showFirebugButton).onclick = function(){
+ try {
+ if(firstTime){
+ console.warn("Note that messages logged to the console at the app startup may not be visible here.");
+ console.warn("Do not use the close button on Firebug. Your console logs will be cleared. Use minimize instead.");
+ firstTime = false;
+ }
+ window.Firebug.chrome.open();
+ } catch(e) {
+ // hack - FirebugLite appears to have several bugs. One of which is - open firebug, user shuts down FirebugLite through the UI.
+ // FirebugLite is now in a bad state of neither being usable or removable. Any calls to open throw an error.
+ // The following lines removes the flags that FirebugLite looks for manually and makes it think it has not loaded it yet
+ // Then FirebugLite is loaded into the page again
+ // This hack should be revisited when FirebugLite moves from version 1.4
+ // Either the hack won't be needed anymore or the hack should be checked too see if it still works.
+ var el = document.getElementById("FirebugLite");
+ if(el) {
+ el.setAttribute("id", "");
+ }
+ delete console.firebuglite;
+ loadFirebug(true);
+ }
+ };
+ }
+
+ function loadFirebug(startOpened){
+ var el = document.createElement("script");
+ el.setAttribute("id", "FirebugLite");
+ el.setAttribute("src", "https://getfirebug.com/firebug-lite.js");
+ el.setAttribute("FirebugLite", "4");
+ el.innerHTML = el.innerHTML = "{ debug : false, startOpened : " + startOpened + ", showIconWhenHidden : false, saveCommandLineHistory : true, saveCookies : false }";
+ document.head.appendChild(el);
+ console.log("test");
+ }
+
+ // FirebugLite doesn't catch errors from window.onerror like desktop browser's dev tools do. So we add it manually.
+ function attachErrorListener(){
+ window.onerror = function(msg, url, line) {
+ console.error("Error: " + msg + " on line: " + line + " in file: " + url);
+ };
}
initialise();
[21/30] git commit: Small UI & code fixes.Test cordova serve apps'
config.xml during install
Posted by ag...@apache.org.
Small UI & code fixes.Test cordova serve apps' config.xml during install
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/633074b6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/633074b6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/633074b6
Branch: refs/heads/master
Commit: 633074b6234e3fe8c001651c98486c763ad0bba9
Parents: aee835b
Author: Shravan Narayan <sh...@google.com>
Authored: Thu May 16 13:56:19 2013 -0400
Committer: Braden Shepherdson <br...@google.com>
Committed: Thu May 16 15:11:42 2013 -0400
----------------------------------------------------------------------
README.md | 52 +++++++++++++++++++++++++++++----
www/cdvah_js/AddCtrl.js | 17 ++++++----
www/cdvah_js/AppBundleAlias.js | 1 -
www/cdvah_js/AppsService.js | 22 +++++++++++++-
www/cdvah_js/ListCtrl.js | 6 ++--
www/cdvah_js/ResourcesLoader.js | 2 +-
www/cdvah_views/add.html | 4 +-
www/cdvah_views/list.html | 2 +-
8 files changed, 83 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/633074b6/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 9e4c631..986bb1a 100644
--- a/README.md
+++ b/README.md
@@ -6,10 +6,9 @@ An App harness for Cordova that can download and run Cordova apps as well as Chr
##Setting up environment
* Clone the the cordova-app-harness, cordova-android, cordova-ios, cordova-js, plugman, cordova-cli, zip(https://github.com/MobileChromeApps/zip) and AppBundle(https://github.com/MobileChromeApps/AppBundle) repos into folders of the same name in a common directory - eg 'Repo'.
-* Use the future branch of plugman and cordova-cli
+* Use the future branch for cordova-cli and master everywhere else
* Link these plugman and cordova-cli of this branch as the globally symlinked plugman and cordova-cli commands. (You may want to see 'npm link')
* Build the cordova-js repo and grab the cordova.android.js and cordova.ios.js
-* Note this project uses a slightly modified version of cordova.android.js and cordova.ios.js
* Replace the cordova-cli/lib/cordova-android/framework/assets/js/cordova.android.js and the cordova-cli/lib/cordova-ios/CordovaLib/cordova.ios.js files with the ones above
* Build the cordova-android repository and generate new cordova.jar
* Run the following commands
@@ -27,18 +26,57 @@ An App harness for Cordova that can download and run Cordova apps as well as Chr
* Replace the contents of CordovaAppHarness/platforms/ios/CordovaLib with /Repo/cordova-ios/CordovaLib
* Go to eclipse and got to new, other, android, android project from existing code. Navigate to CordovaAppHarness/platforms/android and then add the project
* Double click the .xcodeproj file in CordovaAppHarnessNew/platforms/ios/
+* Ensure the config.xml for android (Project Folder In IDE/res/xml/config.xml) and ios (Project Folder In IDE/config.xml) have the content tag's src set to
+
+ <content src="app-bundle:///cdvah_index.html" />
+
+* Ensure the config.xml for ios has the tag
+
+ <access origin="app-bundle://*" />
+
* You can now build the app harness from the ides or with cordova compile
-##Using the app
+##Features
+* Install and test multiple applications.
+* Run apps locally or run them directly from cordova serve.
+* Edit and Refresh workflow with cordova serve.
+* In App context menu to switch between apps.
+* Firebug Lite and Weinre support for debugging.
+* Support for bundle paths such as "file:///android_asset/www" - These point to the tested application's bundle and not the app harness' bundle. (In development)
-* Run the packapp script and point it to a cordova project. This will package the app into a cdvh file. (Note: it is expected that you add all relevant platforms. For example, if you want to test on the iphone, you need to have added the ios platform to the project)
+##Install an app in the harness
+
+* Install the app in one of the two ways below
+
+###Test by installing the app on the phone through app harness
+* Run the packapp script and point it to a cordova project of the app you want to test. This will package the app into a cdvh file. (Note: it is expected that you have added all relevant platforms. For example, if you want to test on the iphone, you need to have added the ios platform to the project)
Repo/cordova-app-harness/packapp -p ./TestApp TestApp.cdvh
* Upload the the cdvh onto any hosting site.
* Run the app harness
* Click add new app
-* Give a name and the url to the zip.
+* Give a name and the url to the cdvh file.
+
+ Name: App1
+ URL to file: http://www.somesite.com/myapp.cdvh
+
+###Test by using cordova serve
+* Go to cordova project of the app you want to test in a terminal and run.
+ cordova prepare
+ cordova serve <platform>
+* If you want to test the app in an actual device, find the network address of your computer by running
+ ifconfig
+* If you are running this on a simulator, you can use "http://localhost" as your address
+* Click add new app
+* Choose the option "Enter the URL to the server hosting the app"
+* Give a name and the url as follows. Let's assume the network address discovered above is a.b.c.d
+
+ Name: App1
+ URL to server: http://a.b.c.d:8000/config.xml
+
* Go back to the main screen after you see the prompt "successfully installed"
-* Click launch on the newly installed app
+
+##Running an app in the harness
+* Click launch on the installed app
* See if the app looks as expected
* Use the 3 finger tap to access the app menu while testing your app
-* Press Back to Main Menu to return to the main screen
+* The context menu that pops up, will allow you to return to the main screen, restart or update the app, open a firebug console in the device, setup remote debugging using weinre etc.
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/633074b6/www/cdvah_js/AddCtrl.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/AddCtrl.js b/www/cdvah_js/AddCtrl.js
index 8827b1d..4fc52a4 100644
--- a/www/cdvah_js/AddCtrl.js
+++ b/www/cdvah_js/AddCtrl.js
@@ -26,13 +26,16 @@
serviceCall = AppsService.addAppFromServe($scope.appData.appName, $scope.appData.appSourceServe);
}
- serviceCall && serviceCall.then(function() {
- alert("Successfully installed");
- }, function(error) {
- console.error(error);
- alert("Unable to add application because: \n" + error);
- });
-
+ if(serviceCall){
+ serviceCall.then(function() {
+ alert("Successfully installed");
+ }, function(error) {
+ console.error(error);
+ alert("Unable to add application because: \n" + error);
+ });
+ } else {
+ alert("Add application error: Unrecognized application source - " + $scope.appData.appSource);
+ }
};
}]);
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/633074b6/www/cdvah_js/AppBundleAlias.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/AppBundleAlias.js b/www/cdvah_js/AppBundleAlias.js
index 7c244a6..05fdd4d 100644
--- a/www/cdvah_js/AppBundleAlias.js
+++ b/www/cdvah_js/AppBundleAlias.js
@@ -39,7 +39,6 @@
}
AppsService.addPreLaunchHook(function(appEntry, appInstallLocation, wwwLocation) {
- console.log("Adding aliases for " + appEntry.Name);
wwwLocation += (wwwLocation.charAt(wwwLocation.length - 1) === "/")? "" : "/";
appInstallLocation += (appInstallLocation.charAt(appInstallLocation.length - 1) === "/")? "" : "/";
//Make any direct references to the bundle paths such as file:///android_asset point to the installed location without redirecting
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/633074b6/www/cdvah_js/AppsService.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/AppsService.js b/www/cdvah_js/AppsService.js
index f7def39..0e59e3b 100644
--- a/www/cdvah_js/AppsService.js
+++ b/www/cdvah_js/AppsService.js
@@ -277,7 +277,27 @@
},
addAppFromServe : function(appName, appSourceServe) {
- return isUniqueApp(appName)
+ return ResourcesLoader.readFileContents(appSourceServe)
+ .then(function(contents){
+ if(!contents){
+ throw new Error("The contents of config.xml at " + appSourceServe + " could not be read.");
+ }
+ })
+ .then(null, function(error){
+ // Code reaches here either because the get request to config.xml fails or config.xml is empty
+ var continueInstall = confirm("The contents of config.xml at " + appSourceServe + " could not be read.\n" +
+ "Have you run cordova serve?\n\n" +
+ "Press OK to continue the install process. Note that the config.xml should be visible before you start the app.");
+ if(!continueInstall){
+ throw error;
+ }
+ })
+ .then(function(){
+ return isUniqueApp(appName);
+ })
+ .then(function(){
+ return ResourcesLoader.deleteDirectory(INSTALL_DIRECTORY + appName);
+ })
.then(function(){
return addNewAppFromServe(appName, appSourceServe);
});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/633074b6/www/cdvah_js/ListCtrl.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/ListCtrl.js b/www/cdvah_js/ListCtrl.js
index 326f394..938b5b2 100644
--- a/www/cdvah_js/ListCtrl.js
+++ b/www/cdvah_js/ListCtrl.js
@@ -32,7 +32,7 @@
return AppsService.getLastRunApp()
.then(AppsService.launchApp, function(e){
e = e || {};
- console.error("Error launching last run app: " + e.message);
+ console.error("Error launching last run app: " + e);
alert("Error launching last run app. Please try again.");
});
}
@@ -49,7 +49,7 @@
return AppsService.launchApp(app);
}, function(e){
e = e || {};
- console.error("Error updating last run app: " + e.message);
+ console.error("Error updating last run app: " + e);
alert("Error updating last run app. Please try again.");
});
}
@@ -78,7 +78,7 @@
}
}, function(error){
var str = "There was an error retrieving the apps list";
- console.error(str + JSON.stringify(error));
+ console.error(str + ": " + error);
alert(str);
});
};
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/633074b6/www/cdvah_js/ResourcesLoader.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/ResourcesLoader.js b/www/cdvah_js/ResourcesLoader.js
index 1f84681..e6c5ae8 100644
--- a/www/cdvah_js/ResourcesLoader.js
+++ b/www/cdvah_js/ResourcesLoader.js
@@ -229,7 +229,7 @@
if(xhr.status === 200) {
deferred.resolve(xhr);
} else {
- deferred.reject("XHR return status: " + xhr.statusText);
+ deferred.reject("XHR return status: " + xhr.status + " for url: " + url);
}
}
};
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/633074b6/www/cdvah_views/add.html
----------------------------------------------------------------------
diff --git a/www/cdvah_views/add.html b/www/cdvah_views/add.html
index 77778e6..edb4dfb 100644
--- a/www/cdvah_views/add.html
+++ b/www/cdvah_views/add.html
@@ -8,12 +8,12 @@
<input type="radio" ng-model="appData.appSource" name="appSource" value="pattern" ng-checked="appData.appSource=='pattern'" />
<label for="inputAppPattern">Enter the URL to a file</label><br />
- <input id="inputAppPattern" type="text" name="appSourcePattern" ng-model="appData.appSourcePattern" ng-disabled="appData.appSource!='pattern'" ng-required="appSource=='pattern'" />
+ <input id="inputAppPattern" type="text" name="appSourcePattern" ng-model="appData.appSourcePattern" ng-disabled="appData.appSource!='pattern'" ng-required="appData.appSource=='pattern'" autocorrect="off" autocapitalize="off" />
<span ng-show="addForm.appSourcePattern.$error.required">Required</span>
<br />
<input type="radio" ng-model="appData.appSource" name="appSource" value="serve" ng-checked="appData.appSource=='serve'" />
<label for="inputAppServe">Enter the URL to the server hosting the app</label><br />
- <input id="inputAppServe" type="text" name="appSourceServe" ng-model="appData.appSourceServe" ng-disabled="appData.appSource!='serve'" ng-pattern="/.*\/config.xml(\?.*|#.*)?$/" ng-required="appSource=='serve'" />
+ <input id="inputAppServe" type="text" name="appSourceServe" ng-model="appData.appSourceServe" ng-disabled="appData.appSource!='serve'" ng-pattern="/.*\/config.xml(\?.*|#.*)?$/" ng-required="appData.appSource=='serve'" autocorrect="off" autocapitalize="off" />
<span ng-show="addForm.appSourceServe.$error.required">Required</span>
<span ng-show="addForm.appSourceServe.$error.pattern">Url must point to a config.xml file</span>
<br />
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/633074b6/www/cdvah_views/list.html
----------------------------------------------------------------------
diff --git a/www/cdvah_views/list.html b/www/cdvah_views/list.html
index b73f196..b563845 100644
--- a/www/cdvah_views/list.html
+++ b/www/cdvah_views/list.html
@@ -3,7 +3,7 @@
<p>{{app.Name}}</p>
<p>Installed on: {{app.Installed}}</p>
<button ng-click="launchApp(app.Name)">Launch</button>
- <button ng-click="updateApp(app.Name)">Update</button>
+ <button ng-click="updateApp(app.Name)" ng-disabled="app.Source==='serve'">Update</button>
<button ng-click="removeApp(app.Name)">Remove</button>
</li>
</ul>
[08/30] git commit: Merge pull request #20 from
shravanrn/platform_package_fix
Posted by ag...@apache.org.
Merge pull request #20 from shravanrn/platform_package_fix
Package platform www folders so platforms specific files are picked up.
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/ea7823e4
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/ea7823e4
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/ea7823e4
Branch: refs/heads/master
Commit: ea7823e4246dfd8f113a84970df2524ce2bfb719
Parents: 6ac6b46 eba56cc
Author: Braden Shepherdson <br...@gmail.com>
Authored: Fri May 3 11:27:04 2013 -0700
Committer: Braden Shepherdson <br...@gmail.com>
Committed: Fri May 3 11:27:04 2013 -0700
----------------------------------------------------------------------
README.md | 3 +-
hooks/after_prepare/cordovajsmenu.js | 60 ------------------------
packapp | 63 ++++++++++++++++----------
www/js/AppsService.js | 25 +++++++----
www/js/CdvhPackageHandler.js | 34 ++++++++++++--
www/js/ContextMenu.js | 1 -
www/js/ResourcesLoader.js | 70 ++++++++++++++++++++---------
7 files changed, 135 insertions(+), 121 deletions(-)
----------------------------------------------------------------------
[25/30] git commit: Readme update. Conflicts: README.md
Posted by ag...@apache.org.
Readme update.
Conflicts:
README.md
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/11053930
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/11053930
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/11053930
Branch: refs/heads/master
Commit: 110539309608b3b09cd0cd7e0fdc1a3cada5a68a
Parents: 9f0d462
Author: Shravan Narayan <sh...@google.com>
Authored: Thu May 16 14:14:09 2013 -0400
Committer: Braden Shepherdson <br...@google.com>
Committed: Thu May 16 15:35:06 2013 -0400
----------------------------------------------------------------------
README.md | 26 ++++++++++++++++++++++++--
1 files changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/11053930/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 69d9524..8e87aff 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ An App harness for Cordova that can download and run Cordova apps as well as Chr
##Setting up environment
-* Clone the the `cordova-app-harness`, `cordova-android`, `cordova-ios`, `cordova-js`, `plugman`, `cordova-cli`, `zip` ([](https://github.com/MobileChromeApps/zip)) and `AppBundle` ([](https://github.com/MobileChromeApps/AppBundle)) repos into folders of the same name in a common directory - eg 'Repo'.
+* Clone the the `cordova-app-harness`, `cordova-android`, `cordova-ios`, `cordova-js`, `chrome-cordova`, `plugman`, `cordova-cli`, `zip` ([](https://github.com/MobileChromeApps/zip)) and `AppBundle` ([](https://github.com/MobileChromeApps/AppBundle)) repos into folders of the same name in a common directory - eg 'Repo'.
* Use the `future` branch for `cordova-cli` and `master` everywhere else
* Link these `plugman` and `cordova-cli` of this branch as the globally symlinked `plugman` and `cordova-cli` commands. (You may want to see `npm link`)
* Build the `cordova-js` repo and grab the `cordova.android.js` and `cordova.ios.js`
@@ -19,6 +19,7 @@ An App harness for Cordova that can download and run Cordova apps as well as Chr
cordova platform add ios
cordova plugin add ../Repo/AppBundle
cordova plugin add ../Repo/zip/
+ cordova plugin add ../Repo/chrome-cordova/plugins/*
cp -rf ../Repo/cordova-app-harness/www app/www
cordova prepare
@@ -30,15 +31,25 @@ An App harness for Cordova that can download and run Cordova apps as well as Chr
<content src="app-bundle:///cdvah_index.html" />
-* Ensure the `config.xml` for iOS has the tag
+* Remove the additional `content` tag added by the `chrome-cordova` plugins later in the file. The line to remove should be something like
+
+ <content src="chrome-extension://sdfsdfdfssf/chromeapp.html" />
+
+* Ensure the config.xml for ios has the tags
<access origin="app-bundle://*" />
+ <access origin="chrome-extension://*" />
+
+* Open the `cordova_plugins.json` file in Eclipse and Xcode and ensure replace the contents with
+
+ [{"file":"plugins/AppBundle/appBundle.js","id":"AppBundle.AppBundle"},{"file":"plugins/zip/zip.js","id":"zip.Zip","clobbers":["zip"]}]
* You can now build the app harness from the IDEs or with `cordova compile`
##Features
* Install and test multiple applications.
+* Install crx files directly or from the Chrome App Store.
* Run apps locally or run them directly from `cordova serve`.
* Edit and Refresh workflow with `cordova serve`.
* In App context menu to switch between apps.
@@ -62,6 +73,17 @@ An App harness for Cordova that can download and run Cordova apps as well as Chr
Name: App1
URL to file: http://www.somesite.com/myapp.cdvh
+###Test by installing a chrome extension
+* Upload the the crx file onto any hosting site or the chrome apps store.
+* Run the app harness
+* Click add new app
+* Give a name and the url to the crx file.
+
+ Name: App1
+ URL to file: http://www.somesite.com/myapp.crx
+
+* Alternately you can use the url of the app in the apps store for example https://chrome.google.com/webstore/detail/appName/appid
+
###Test by using cordova serve
* Go to cordova project of the app you want to test in a terminal and run.
cordova prepare
[24/30] git commit: Support installation of crx files
Posted by ag...@apache.org.
Support installation of crx files
Conflicts:
www/index.html
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/4d4e0b46
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/4d4e0b46
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/4d4e0b46
Branch: refs/heads/master
Commit: 4d4e0b46caec4db39cb2d3113c208657939029f6
Parents: 6492417
Author: Shravan Narayan <sh...@google.com>
Authored: Fri Apr 26 14:39:15 2013 -0400
Committer: Braden Shepherdson <br...@google.com>
Committed: Thu May 16 15:29:29 2013 -0400
----------------------------------------------------------------------
www/cdvah_index.html | 1 +
www/cdvah_js/CrxPackageHandler.js | 54 ++++
www/crx_files/config.android.xml | 47 +++
www/crx_files/config.ios.xml | 51 ++++
www/crx_files/www/chromeapp.html | 15 +
www/crx_files/www/chromeappstyles.css | 14 +
www/crx_files/www/chromebgpage.html | 11 +
www/crx_files/www/cordova_plugins.json | 1 +
www/crx_files/www/plugins/chrome.common/events.js | 53 ++++
.../www/plugins/chrome.fileSystem/fileSystem.js | 142 ++++++++++
www/crx_files/www/plugins/chrome.i18n/i18n.js | 185 ++++++++++++
.../www/plugins/chrome.identity/identity.js | 161 +++++++++++
www/crx_files/www/plugins/chrome.socket/socket.js | 216 +++++++++++++++
.../www/plugins/chrome.storage/storage.js | 202 ++++++++++++++
.../www/plugins/chrome/api/app/runtime.js | 7 +
www/crx_files/www/plugins/chrome/api/app/window.js | 156 +++++++++++
www/crx_files/www/plugins/chrome/api/bootstrap.js | 13 +
.../www/plugins/chrome/api/helpers/stubs.js | 11 +
www/crx_files/www/plugins/chrome/api/mobile.js | 58 ++++
www/crx_files/www/plugins/chrome/api/runtime.js | 58 ++++
20 files changed, 1456 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/4d4e0b46/www/cdvah_index.html
----------------------------------------------------------------------
diff --git a/www/cdvah_index.html b/www/cdvah_index.html
index 8850f80..3eaede1 100644
--- a/www/cdvah_index.html
+++ b/www/cdvah_index.html
@@ -14,6 +14,7 @@
<script type="text/javascript" src="cdvah_js/AppBundleAlias.js"></script>
<script type="text/javascript" src="cdvah_js/KnownExtensionDownloader.js"></script>
<script type="text/javascript" src="cdvah_js/CdvhPackageHandler.js"></script>
+ <script type="text/javascript" src="cdvah_js/CrxPackageHandler.js"></script>
<script type="text/javascript" src="cdvah_js/ListCtrl.js"></script>
<script type="text/javascript" src="cdvah_js/AddCtrl.js"></script>
</head>
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/4d4e0b46/www/cdvah_js/CrxPackageHandler.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/CrxPackageHandler.js b/www/cdvah_js/CrxPackageHandler.js
new file mode 100644
index 0000000..2627fd7
--- /dev/null
+++ b/www/cdvah_js/CrxPackageHandler.js
@@ -0,0 +1,54 @@
+(function(){
+ "use strict";
+ /* global myApp */
+ myApp.run(["AppsService", "ResourcesLoader", function(AppsService, ResourcesLoader){
+
+ function copyFile(startUrl, targetLocation){
+ /************ Begin Work around for File system bug ************/
+ if(targetLocation.indexOf("file://") === 0) {
+ targetLocation = targetLocation.substring("file://".length);
+ }
+ /************ End Work around for File system bug **************/
+ return ResourcesLoader.xhrGet(startUrl)
+ .then(function(xhr){
+ return ResourcesLoader.ensureDirectoryExists(targetLocation)
+ .then(function(){
+ return ResourcesLoader.writeFileContents(targetLocation, xhr.responseText);
+ });
+ });
+ }
+
+ AppsService.registerPackageHandler("crx", {
+ extractPackageToDirectory : function (fileName, outputDirectory){
+ return ResourcesLoader.ensureDirectoryExists(outputDirectory + "/www")
+ .then(function(){
+ return ResourcesLoader.extractZipFile(fileName, outputDirectory + "/www");
+ })
+ .then(function(){
+ return Q.all([
+ copyFile("cdv-app-harness:///direct/cordova.js", outputDirectory + "/www/cordova.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/config.android.xml", outputDirectory + "/config.android.xml"),
+ copyFile("cdv-app-harness:///direct/crx_files/config.ios.xml", outputDirectory + "/config.ios.xml"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/cordova_plugins.json", outputDirectory + "/www/cordova_plugins.json"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/chromeapp.html", outputDirectory + "/www/chromeapp.html"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/chromeappstyles.css", outputDirectory + "/www/chromeappstyles.css"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/chromebgpage.html", outputDirectory + "/www/chromebgpage.html"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/app/runtime.js", outputDirectory + "/www/plugins/chrome/api/app/runtime.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/app/window.js", outputDirectory + "/www/plugins/chrome/api/app/window.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/bootstrap.js", outputDirectory + "/www/plugins/chrome/api/bootstrap.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/helpers/stubs.js", outputDirectory + "/www/plugins/chrome/api/helpers/stubs.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/mobile.js", outputDirectory + "/www/plugins/chrome/api/mobile.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/runtime.js", outputDirectory + "/www/plugins/chrome/api/runtime.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.common/events.js", outputDirectory + "/www/plugins/chrome.common/events.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.fileSystem/fileSystem.js", outputDirectory + "/www/plugins/chrome.fileSystem/fileSystem.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.i18n/i18n.js", outputDirectory + "/www/plugins/chrome.i18n/i18n.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.identity/identity.js", outputDirectory + "/www/plugins/chrome.identity/identity.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.socket/socket.js", outputDirectory + "/www/plugins/chrome.socket/socket.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.storage/storage.js", outputDirectory + "/www/plugins/chrome.storage/storage.js")
+ ]);
+ });
+ }
+ });
+
+ }]);
+})();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/4d4e0b46/www/crx_files/config.android.xml
----------------------------------------------------------------------
diff --git a/www/crx_files/config.android.xml b/www/crx_files/config.android.xml
new file mode 100644
index 0000000..27da959
--- /dev/null
+++ b/www/crx_files/config.android.xml
@@ -0,0 +1,47 @@
+<?xml version='1.0' encoding='utf-8'?>
+<cordova>
+ <content src="index.html" />
+ <log level="DEBUG" />
+ <plugins>
+ <plugin name="App" value="org.apache.cordova.App" />
+ <plugin name="Geolocation" value="org.apache.cordova.GeoBroker" />
+ <plugin name="Device" value="org.apache.cordova.Device" />
+ <plugin name="Accelerometer" value="org.apache.cordova.AccelListener" />
+ <plugin name="Compass" value="org.apache.cordova.CompassListener" />
+ <plugin name="Media" value="org.apache.cordova.AudioHandler" />
+ <plugin name="Camera" value="org.apache.cordova.CameraLauncher" />
+ <plugin name="Contacts" value="org.apache.cordova.ContactManager" />
+ <plugin name="File" value="org.apache.cordova.FileUtils" />
+ <plugin name="NetworkStatus" value="org.apache.cordova.NetworkManager" />
+ <plugin name="Notification" value="org.apache.cordova.Notification" />
+ <plugin name="Storage" value="org.apache.cordova.Storage" />
+ <plugin name="FileTransfer" value="org.apache.cordova.FileTransfer" />
+ <plugin name="Capture" value="org.apache.cordova.Capture" />
+ <plugin name="Battery" value="org.apache.cordova.BatteryListener" />
+ <plugin name="SplashScreen" value="org.apache.cordova.SplashScreen" />
+ <plugin name="Echo" value="org.apache.cordova.Echo" />
+ <plugin name="Globalization" value="org.apache.cordova.Globalization" />
+ <plugin name="InAppBrowser" value="org.apache.cordova.InAppBrowser" />
+ <plugin name="Zip" value="org.apache.cordova.Zip" />
+ <plugin name="ChromeExtensionURLs" value="com.google.cordova.ChromeExtensionURLs">
+ <url-filter value="chrome-extension://" />
+ </plugin>
+ <plugin name="ChromeI18n" onload="true" value="com.google.cordova.ChromeI18n" />
+ <plugin name="ChromeIdentity" value="com.google.cordova.ChromeIdentity" />
+ <plugin name="ChromeSocket" value="com.google.cordova.ChromeSocket" />
+ <plugin name="ChromeStorage" value="com.google.cordova.ChromeStorage" />
+ <plugin name="CordovaAppHarnessRedirect" value="org.apache.cordova.cordovaappharness.CordovaAppHarnessRedirect">
+ <url-filter value="cdv-app-harness://" />
+ </plugin>
+ </plugins>
+ <content src="chromeapp.html" />
+ <access origin="*" />
+ <access origin="chrome-extension://*" />
+ <access origin="cdv-app-harness://*" />
+ <preference name="useBrowserHistory" value="true" />
+ <preference name="exit-on-suspend" value="false" />
+ <preference name="phonegap-version" value="1.9.0" />
+ <preference name="orientation" value="default" />
+ <preference name="target-device" value="universal" />
+ <preference name="fullscreen" value="false" />
+</cordova>
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/4d4e0b46/www/crx_files/config.ios.xml
----------------------------------------------------------------------
diff --git a/www/crx_files/config.ios.xml b/www/crx_files/config.ios.xml
new file mode 100644
index 0000000..bfba1c9
--- /dev/null
+++ b/www/crx_files/config.ios.xml
@@ -0,0 +1,51 @@
+<?xml version='1.0' encoding='utf-8'?>
+<widget>
+ <content src="index.html" />
+ <plugins>
+ <plugin name="Device" value="CDVDevice" />
+ <plugin name="Logger" value="CDVLogger" />
+ <plugin name="Compass" value="CDVLocation" />
+ <plugin name="Accelerometer" value="CDVAccelerometer" />
+ <plugin name="Camera" value="CDVCamera" />
+ <plugin name="NetworkStatus" value="CDVConnection" />
+ <plugin name="Contacts" value="CDVContacts" />
+ <plugin name="Debug Console" value="CDVDebugConsole" />
+ <plugin name="Echo" value="CDVEcho" />
+ <plugin name="File" value="CDVFile" />
+ <plugin name="FileTransfer" value="CDVFileTransfer" />
+ <plugin name="Geolocation" value="CDVLocation" />
+ <plugin name="Notification" value="CDVNotification" />
+ <plugin name="Media" value="CDVSound" />
+ <plugin name="Capture" value="CDVCapture" />
+ <plugin name="SplashScreen" value="CDVSplashScreen" />
+ <plugin name="Battery" value="CDVBattery" />
+ <plugin name="Globalization" value="CDVGlobalization" />
+ <plugin name="InAppBrowser" value="CDVInAppBrowser" />
+ <plugin name="Zip" value="Zip" />
+ <plugin name="ChromeExtensionURLs" onload="true" value="ChromeExtensionURLs" />
+ <plugin name="ChromeI18n" value="ChromeI18n" />
+ <plugin name="ChromeSocket" value="ChromeSocket" />
+ <plugin name="ChromeStorage" value="ChromeStorage" />
+ <plugin name="CordovaAppHarnessRedirect" onload="true" value="CordovaAppHarnessRedirect" />
+ </plugins>
+ <content src="chromeapp.html" />
+ <access origin="*" />
+ <access origin="chrome-extension://*" />
+ <access origin="cdv-app-harness://*" />
+ <preference name="KeyboardDisplayRequiresUserAction" value="true" />
+ <preference name="SuppressesIncrementalRendering" value="false" />
+ <preference name="UIWebViewBounce" value="true" />
+ <preference name="TopActivityIndicator" value="gray" />
+ <preference name="EnableLocation" value="false" />
+ <preference name="EnableViewportScale" value="false" />
+ <preference name="AutoHideSplashScreen" value="true" />
+ <preference name="ShowSplashScreenSpinner" value="true" />
+ <preference name="MediaPlaybackRequiresUserAction" value="false" />
+ <preference name="AllowInlineMediaPlayback" value="false" />
+ <preference name="OpenAllWhitelistURLsInWebView" value="false" />
+ <preference name="BackupWebStorage" value="cloud" />
+ <preference name="phonegap-version" value="1.9.0" />
+ <preference name="orientation" value="default" />
+ <preference name="target-device" value="universal" />
+ <preference name="fullscreen" value="false" />
+</widget>
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/4d4e0b46/www/crx_files/www/chromeapp.html
----------------------------------------------------------------------
diff --git a/www/crx_files/www/chromeapp.html b/www/crx_files/www/chromeapp.html
new file mode 100644
index 0000000..3cbd68d
--- /dev/null
+++ b/www/crx_files/www/chromeapp.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<!--
+Copyright (c) 2012 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+-->
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta name="format-detection" content="telephone=no">
+ <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
+ <script src="cordova.js"></script>
+ </head>
+ <body></body>
+</html>
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/4d4e0b46/www/crx_files/www/chromeappstyles.css
----------------------------------------------------------------------
diff --git a/www/crx_files/www/chromeappstyles.css b/www/crx_files/www/chromeappstyles.css
new file mode 100644
index 0000000..277f4fe
--- /dev/null
+++ b/www/crx_files/www/chromeappstyles.css
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2012 The Chromium Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/*
+ * Contains extra user-agent styles to apply to all Chrome App windows.
+ *
+ * These should be kept in sync with:
+ * http://code.google.com/searchframe#OAMlx_jo-ck/src/chrome/renderer/resources/extensions/platform_app.css
+ */
+body { -webkit-user-select: none; }
+html, body { overflow: hidden; }
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/4d4e0b46/www/crx_files/www/chromebgpage.html
----------------------------------------------------------------------
diff --git a/www/crx_files/www/chromebgpage.html b/www/crx_files/www/chromebgpage.html
new file mode 100644
index 0000000..b732eaa
--- /dev/null
+++ b/www/crx_files/www/chromebgpage.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<!--
+Copyright (c) 2012 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+-->
+<html>
+ <body>
+ <script>parent.chrome.mobile.impl.bgInit(this)</script>
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/4d4e0b46/www/crx_files/www/cordova_plugins.json
----------------------------------------------------------------------
diff --git a/www/crx_files/www/cordova_plugins.json b/www/crx_files/www/cordova_plugins.json
new file mode 100644
index 0000000..fe11f7c
--- /dev/null
+++ b/www/crx_files/www/cordova_plugins.json
@@ -0,0 +1 @@
+[{"file":"plugins/chrome/api/bootstrap.js","id":"chrome.bootstrap","runs":true},{"file":"plugins/chrome/api/app/runtime.js","id":"chrome.app.runtime","clobbers":["chrome.app.runtime"]},{"file":"plugins/chrome/api/app/window.js","id":"chrome.app.window","clobbers":["chrome.app.window"]},{"file":"plugins/chrome/api/helpers/stubs.js","id":"chrome.helpers.stubs"},{"file":"plugins/chrome/api/mobile.js","id":"chrome.mobile.impl","clobbers":["chrome.mobile.impl"]},{"file":"plugins/chrome/api/runtime.js","id":"chrome.runtime","clobbers":["chrome.runtime"]},{"file":"plugins/chrome.common/events.js","id":"chrome.common.events","clobbers":["chrome.Event"]},{"file":"plugins/chrome.fileSystem/fileSystem.js","id":"chrome.fileSystem.FileSystem","clobbers":["chrome.fileSystem"]},{"file":"plugins/chrome.i18n/i18n.js","id":"chrome.i18n.I18n","clobbers":["chrome.i18n"]},{"file":"plugins/chrome.identity/identity.js","id":"chrome.identity.Identity","clobbers":["chrome.identity","chrome.experimental.iden
tity"]},{"file":"plugins/chrome.socket/socket.js","id":"chrome.socket.Socket","clobbers":["chrome.socket"]},{"file":"plugins/chrome.storage/storage.js","id":"chrome.storage.Storage","clobbers":["chrome.storage"]}]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/4d4e0b46/www/crx_files/www/plugins/chrome.common/events.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome.common/events.js b/www/crx_files/www/plugins/chrome.common/events.js
new file mode 100644
index 0000000..6f868b1
--- /dev/null
+++ b/www/crx_files/www/plugins/chrome.common/events.js
@@ -0,0 +1,53 @@
+cordova.define("chrome.common.events", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var Event = function(opt_eventName) {
+ this.name = opt_eventName || '';
+ this.listeners = [];
+};
+
+// Deliberately not filtering functions that are already added.
+// I tested on desktop and it will call your callback once for each addListener.
+Event.prototype.addListener = function(cb) {
+ this.listeners.push(cb);
+};
+
+Event.prototype.findListener_ = function(cb) {
+ for(var i = 0; i < this.listeners.length; i++) {
+ if (this.listeners[i] == cb) {
+ return i;
+ }
+ }
+
+ return -1;
+};
+
+Event.prototype.removeListener = function(cb) {
+ var index = this.findListener_(cb);
+ if (index >= 0) {
+ this.listeners.splice(index, 1);
+ }
+};
+
+Event.prototype.hasListener = function(cb) {
+ return this.findListener_(cb) >= 0;
+};
+
+Event.prototype.hasListeners = function() {
+ return this.listeners.length > 0;
+};
+
+Event.prototype.fire = function() {
+ for (var i = 0; i < this.listeners.length; i++) {
+ this.listeners[i].apply(this, arguments);
+ }
+};
+
+// Stubs since we don't support Rules.
+Event.prototype.addRules = function() { };
+Event.prototype.getRules = function() { };
+Event.prototype.removeRules = function() { };
+
+module.exports = Event;
+});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/4d4e0b46/www/crx_files/www/plugins/chrome.fileSystem/fileSystem.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome.fileSystem/fileSystem.js b/www/crx_files/www/plugins/chrome.fileSystem/fileSystem.js
new file mode 100644
index 0000000..ce613e5
--- /dev/null
+++ b/www/crx_files/www/plugins/chrome.fileSystem/fileSystem.js
@@ -0,0 +1,142 @@
+cordova.define("chrome.fileSystem.FileSystem", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var platformId = cordova.require('cordova/platform').id;
+var FileEntry = cordova.require('cordova/plugin/FileEntry');
+
+exports.getDisplayPath = function(fileEntry, callback) {
+ callback(fileEntry.fullPath);
+};
+
+exports.getWritableEntry = function(fileEntry, callback) {
+ callback(null);
+};
+
+exports.isWritableEntry = function(fileEntry, callback) {
+ callback(false);
+};
+
+exports.chooseEntry = function(options, callback) {
+ // Ensure that the type is either unspecified or specified as 'openFile', as nothing else is supported.
+ if (options.type && options.type != 'openFile') {
+ // TODO(maxw): Determine a "more correct" way to fail here.
+ callback(null);
+ return;
+ }
+
+ // Create the callback for getFile.
+ // It creates a file entry and passes it to the chooseEntry callback.
+ var onFileReceived = function(nativeUri) {
+ var onUriResolved = function(fileEntry) {
+ callback(fileEntry);
+ };
+
+ var onUriResolveError = function(e) {
+ console.log(e.target.error.code);
+ };
+
+ resolveLocalFileSystemURI(nativeUri, onUriResolved, onUriResolveError);
+ };
+
+ if (platformId == 'ios') {
+ getFileIos(options, onFileReceived);
+ } else if (platformId == 'android') {
+ getFileAndroid(options, onFileReceived);
+ }
+};
+
+function getFileIos(options, onFileReceivedCallback) {
+ // Determine the media type.
+ var mediaType = determineMediaType(options.accepts, options.acceptsAllTypes);
+
+ // Prepare the options for getting the file.
+ var getFileOptions = { destinationType: navigator.camera.DestinationType.NATIVE_URI,
+ sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY,
+ mediaType: mediaType };
+
+ // Use the camera to get an image or video.
+ navigator.camera.getPicture(onFileReceivedCallback, null, getFileOptions);
+}
+
+function getFileAndroid(options, onFileReceivedCallback) {
+ var AndroidFileChooser = cordova.require('cordova/plugin/android/filechooser');
+
+ // Determine the relevant mime types.
+ var mimeTypes = determineMimeTypes(options.accepts, options.acceptsAllTypes);
+
+ // Use the file chooser to get a file.
+ AndroidFileChooser.chooseFile(onFileReceivedCallback, null, mimeTypes);
+}
+
+function determineMediaType(acceptOptions, acceptsAllTypes) {
+ if (acceptsAllTypes) {
+ return navigator.camera.MediaType.ALLMEDIA;
+ }
+
+ var imageMimeTypeRegex = /^image\//;
+ var videoMimeTypeRegex = /^video\//;
+ var imageExtensionRegex = /^(?:jpg|png)$/;
+ var videoExtensionRegex = /^mov$/;
+ var imagesAllowed = false;
+ var videosAllowed = false;
+
+ // Iterate through all accept options.
+ // If we see anything image related, allow images. If we see anything video related, allow videos.
+ if (acceptOptions) {
+ for (var i = 0; i < acceptOptions.length; i++) {
+ if (acceptOptions[i].mimeTypes) {
+ for (var j = 0; j < acceptOptions[i].mimeTypes.length; j++) {
+ if (imageMimeTypeRegex.test(acceptOptions[i].mimeTypes[j])) {
+ imagesAllowed = true;
+ } else if (videoMimeTypeRegex.test(acceptOptions[i].mimeTypes[j])) {
+ videosAllowed = true;
+ }
+ }
+ }
+ if (acceptOptions[i].extensions) {
+ for (var k = 0; k < acceptOptions[i].extensions.length; k++) {
+ if (imageExtensionRegex.test(acceptOptions[i].extensions[k])) {
+ imagesAllowed = true;
+ } else if (videoExtensionRegex.test(acceptOptions[i].extensions[k])) {
+ videosAllowed = true;
+ }
+ }
+ }
+ }
+ }
+
+ if (imagesAllowed && !videosAllowed) {
+ return navigator.camera.MediaType.PICTURE;
+ } else if (!imagesAllowed && videosAllowed) {
+ return navigator.camera.MediaType.VIDEO;
+ }
+
+ return navigator.camera.MediaType.ALLMEDIA;
+}
+
+function determineMimeTypes(acceptOptions, acceptsAllTypes) {
+ if (acceptsAllTypes) {
+ return [ '*/*' ];
+ }
+
+ // Pull out all the mime types.
+ // TODO(maxw): Determine mime types from extensions and add them to the returned list.
+ var mimeTypes = [ ];
+ if (acceptOptions) {
+ for (var i = 0; i < acceptOptions.length; i++) {
+ if (acceptOptions[i].mimeTypes) {
+ for (var j = 0; j < acceptOptions[i].mimeTypes.length; j++) {
+ mimeTypes.push(acceptOptions[i].mimeTypes[j]);
+ }
+ }
+ }
+ }
+
+ if (mimeTypes.length !== 0) {
+ return mimeTypes;
+ }
+
+ return [ '*/*' ];
+}
+});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/4d4e0b46/www/crx_files/www/plugins/chrome.i18n/i18n.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome.i18n/i18n.js b/www/crx_files/www/plugins/chrome.i18n/i18n.js
new file mode 100644
index 0000000..905466c
--- /dev/null
+++ b/www/crx_files/www/plugins/chrome.i18n/i18n.js
@@ -0,0 +1,185 @@
+cordova.define("chrome.i18n.I18n", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var exec = cordova.require('cordova/exec');
+var runtime = require('chrome.runtime');
+
+exports.getAcceptLanguages = function(callback) {
+ // In the chrome implementation, acceptLanguage value can change with updates so we make a native call to get the system language
+ exec(callback, callback, 'ChromeI18n', 'getAcceptLanguages', []);
+};
+
+exports.getMessage = function(messageName, substitutions) {
+ // In the chrome implementation, the locale to translate to DOES NOT change with updates, it is keyed of window.navigator.language which is static for a session.
+ // This is implemented in _getLocalesToUse()
+ if(
+ (typeof messageName !== 'string') ||
+ (Array.isArray(substitutions) && substitutions.length > 9)
+ ) {
+ return;
+ }
+ messageName = messageName.toLowerCase();
+ var ret = '';
+ var localeChain = _getLocalesToUse();
+ var contentsForMessageName = _getMessageFromMessageJson(messageName, localeChain);
+ if(contentsForMessageName) {
+ ret = _applySubstitutions(contentsForMessageName, substitutions);
+ }
+ return ret;
+};
+
+function _endsWith(string, endString) {
+ if(endString.length > string.length) {
+ return false;
+ } else {
+ return (string.lastIndexOf(endString) === string.length - endString.length);
+ }
+}
+
+function _getFilePathForLocale(locale) {
+ return 'locales/' + locale.toLowerCase() + '/messages.json';
+}
+
+function _toLowerCaseMessageAndPlaceholders(obj) {
+ if(typeof obj !== 'undefined') {
+ var newObj = {};
+ for(var field in obj) {
+ if(obj[field].placeholders) {
+ var newPlaceholders = {};
+ for(var placeholderField in obj[field].placeholders) {
+ newPlaceholders[placeholderField.toLowerCase()] = obj[field].placeholders[placeholderField];
+ }
+ obj[field].placeholders = newPlaceholders;
+ }
+ newObj[field.toLowerCase()] = obj[field];
+ }
+ return newObj;
+ }
+}
+
+function _getDefaultLocale() {
+ var manifestJson = runtime.getManifest();
+ if(manifestJson.default_locale) {
+ return manifestJson.default_locale;
+ } else {
+ throw new Error('Default locale not defined');
+ }
+}
+
+var memoizedJsonContents = {};
+function _getMessageFromMessageJson(messageName, localeChain) {
+ for(var i = 0; i < localeChain.length; i++) {
+ var locale = localeChain[i];
+ if (!memoizedJsonContents[locale]) {
+ var fileName = _getFilePathForLocale(locale);
+ var xhr = new XMLHttpRequest();
+ xhr.open('GET', fileName, false /* sync */);
+ xhr.send(null);
+ var contents = eval('(' + xhr.responseText + ')');
+ // convert all fields to lower case to check case insensitively
+ contents = _toLowerCaseMessageAndPlaceholders(contents);
+ memoizedJsonContents[locale] = contents;
+ }
+ if(memoizedJsonContents[locale][messageName]) {
+ return memoizedJsonContents[locale][messageName];
+ }
+ }
+}
+
+function _isLocaleAvailable(locale) {
+ var fileName = _getFilePathForLocale(locale);
+ var xhr = new XMLHttpRequest();
+ xhr.open('HEAD', fileName, false /* sync */);
+ xhr.send(null);
+ availableLocales[locale] = (xhr.status === 200);
+}
+
+var chosenLocales;
+function _getLocalesToUse() {
+ if(!chosenLocales) {
+ // language returned by window.navigator is in format en-US, need to change it to en_us
+ var windowLocale = window.navigator.language.replace('-', '_').toLowerCase();
+ var localesToUse = [windowLocale];
+ // Construct fallback chain
+ var lastIndex;
+ while((lastIndex = windowLocale.lastIndexOf('_')) !== -1) {
+ windowLocale = windowLocale.substring(0, lastIndex);
+ localesToUse.push(windowLocale);
+ }
+ var defaultLocale = _getDefaultLocale().toLowerCase();
+ if(localesToUse.indexOf(defaultLocale) == -1) {
+ localesToUse.push(defaultLocale);
+ }
+
+ chosenLocales = [] ;
+ for(var i = 0; i < localesToUse.length; i++) {
+ var currentLocale = localesToUse[i];
+ if(_isLocaleAvailable(currentLocale)) {
+ chosenLocales.push(currentLocale);
+ }
+ }
+ }
+ if(chosenLocales.length == 0) {
+ throw new Error('No usable locale.');
+ }
+ return chosenLocales;
+}
+
+function _getSubstitutionString(match, substitutions) {
+ if(match == '$$') {
+ return '$';
+ } else if(match == '$') {
+ return '';
+ }
+ else {
+ var locBaseOne = parseInt(match.substring(1));
+ if(isNaN(locBaseOne) || locBaseOne <= 0) {
+ return '';
+ }
+
+ if(substitutions[locBaseOne - 1]) {
+ return substitutions[locBaseOne - 1];
+ } else {
+ return '';
+ }
+ }
+}
+
+function _getPlaceholderText(placeholders, substitutions, match) {
+ // Switch to lower case to do case insensitive checking for matches
+ var placeholderField = match.substring(1, match.length - 1);
+ placeholderField = placeholderField.toLowerCase();
+ if(placeholders[placeholderField]) {
+ // form $1, $2 etc or '$$' or '$'
+ var placeholderText = placeholders[placeholderField].content.replace(/\$(([0-9]+)|\$)?/g, function(match) {
+ var substitutionString = _getSubstitutionString(match, substitutions);
+ return substitutionString;
+ });
+ return placeholderText;
+ } else {
+ return '';
+ }
+}
+
+function _applySubstitutions(messageObject, substitutions) {
+ if(typeof substitutions === 'undefined') {
+ substitutions = [];
+ } else if(Object.prototype.toString.call(substitutions) !== '[object Array]') {
+ substitutions = [substitutions];
+ }
+ // Look for any strings of form $WORD$ eg: $1stName$, form $1, $2 etc or any lone '$'
+ // Order of preference is as in this comment
+ var ret = messageObject.message.replace( /\$(([0-9a-zA-Z_]*\$)|([0-9]*))?/g, function(matchedString) {
+ // check which category of matchedString it is
+ if(matchedString.match(/\$[0-9a-zA-Z_]+\$/)) { // form $WORD$
+ var placeholderText = _getPlaceholderText(messageObject.placeholders, substitutions, matchedString);
+ return placeholderText;
+ } else { // form $1, $2 etc or '$$' or '$'
+ var substitutionString = _getSubstitutionString(matchedString, substitutions);
+ return substitutionString;
+ }
+ });
+ return ret;
+}
+});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/4d4e0b46/www/crx_files/www/plugins/chrome.identity/identity.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome.identity/identity.js b/www/crx_files/www/plugins/chrome.identity/identity.js
new file mode 100644
index 0000000..54f1597
--- /dev/null
+++ b/www/crx_files/www/plugins/chrome.identity/identity.js
@@ -0,0 +1,161 @@
+cordova.define("chrome.identity.Identity", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var platformId = cordova.require('cordova/platform').id;
+var runtime = require('chrome.runtime');
+
+exports.TokenDetails = function(interactive) {
+ this.interactive = interactive || false;
+};
+
+exports.WebAuthFlowDetails = function(url, interactive, width, height, left, top) {
+ if (typeof url == 'undefined') {
+ throw new Error('Url required');
+ }
+ this.url = url;
+ this.interactive = interactive || false;
+ this.width = width;
+ this.height = height;
+ this.left = left;
+ this.top = top;
+};
+
+exports.getAuthToken = function(details, callback) {
+ if(typeof details == 'function') {
+ callback = details;
+ details = new exports.TokenDetails();
+ }
+ if (typeof callback == 'undefined') {
+ chrome.runtime.lastError = { 'message' : 'Callback function required' };
+ // Not calling callback as it wasnt provided
+ return;
+ }
+ var win = function(token) {
+ callback(token);
+ };
+ var fail = function() {
+ callback();
+ };
+
+ if (platformId == 'android') {
+ // Use native implementation for logging into google accounts
+ cordova.exec(win, fail, 'ChromeIdentity', 'getAuthToken', [details]);
+ } else {
+ // Use web app oauth flow
+ _getAuthTokenJS(win, fail, details);
+ }
+};
+
+exports.launchWebAuthFlow = function(details, callback) {
+ var failed = false;
+ var failMessage;
+ if (typeof details == 'undefined') {
+ failed = true;
+ failMessage = 'WebAuthFlowDetails required';
+ } else if (typeof callback == 'undefined') {
+ failed = true;
+ failMessage = 'Callback function required';
+ }
+
+ if(failed === true) {
+ chrome.runtime.lastError = { 'message' : failMessage };
+ // Not calling callback as it wasnt provided
+ return;
+ }
+
+ var finalURL = details.url;
+ var extractedRedirectedURL = _getParameterFromUrl(finalURL, 'redirect_uri', '?', '#');
+
+ if(typeof extractedRedirectedURL == 'undefined') {
+ chrome.runtime.lastError = { 'message' : 'launchWebAuthFlow: Parameter redirect_uri not found.' };
+ callback();
+ } else {
+ _launchInAppBrowser(finalURL, extractedRedirectedURL, callback);
+ }
+};
+
+function _getAuthTokenJS(win, fail , details) {
+ var failed = false;
+ var failMessage;
+ if(!details.interactive) {
+ // We cannot support non interactive mode.
+ // This requires the ability to use invisible InAppBrowser windows, which is not currently supported
+ failed = true;
+ failMessage = 'Unsupported mode - Non interactive mode is not supported';
+ }
+ var manifestJson = runtime.getManifest();
+ if(typeof manifestJson == 'undefined') {
+ failed = true;
+ failMessage = 'manifest.json is not defined';
+ } else if(typeof manifestJson.oauth2 == 'undefined') {
+ failed = true;
+ failMessage = 'oauth2 missing from manifest.json';
+ } else if(typeof manifestJson.oauth2.client_id == 'undefined') {
+ failed = true;
+ failMessage = 'client_id missing from manifest.json';
+ } else if(typeof manifestJson.oauth2.scopes == 'undefined') {
+ failed = true;
+ failMessage = 'scopes missing from manifest.json';
+ }
+
+ if(failed === true) {
+ chrome.runtime.lastError = { 'message' : failMessage };
+ fail();
+ }
+
+ var authURLBase = 'https://accounts.google.com/o/oauth2/auth?response_type=token';
+ var redirect_uri = 'http://www.google.com';
+ var client_id = manifestJson.oauth2.client_id;
+ var scope = manifestJson.oauth2.scopes;
+ var finalURL = authURLBase + '&redirect_uri=' + encodeURIComponent(redirect_uri) + '&client_id=' + encodeURIComponent(client_id) + '&scope=' + encodeURIComponent(scope.join('&'));
+
+ _launchInAppBrowser(finalURL, redirect_uri, function(newLoc) {
+ var token = _getParameterFromUrl(newLoc, 'access_token', '#');
+ if(typeof token == 'undefined') {
+ chrome.runtime.lastError = { 'message' : 'The redirect uri did not have the access token' };
+ fail();
+ } else {
+ win(token);
+ }
+ });
+}
+
+function _getParameterFromUrl(url, param, startString, endString) {
+ var splitUrl = url;
+ var urlParts;
+ if(typeof startString != 'undefined') {
+ urlParts = splitUrl.split(startString);
+ if(urlParts.length < 2) {
+ return;
+ } else {
+ splitUrl = urlParts[1];
+ }
+ }
+ if(typeof endString != 'undefined') {
+ urlParts = splitUrl.split(endString);
+ splitUrl = urlParts[0];
+ }
+ var vars = splitUrl.split('&');
+ for (var i = 0; i < vars.length; i++) {
+ var pair = vars[i].split('=');
+ // If first entry with this name
+ if (pair[0] === param) {
+ return decodeURIComponent(pair[1]);
+ }
+ }
+}
+
+function _launchInAppBrowser(authURL, redirectedURL, callback) {
+ var oAuthBrowser = window.open(authURL, '_blank', 'location=yes');
+ var listener = function(event) {
+ var newLoc = event.url;
+ if(newLoc.indexOf(redirectedURL) === 0 && newLoc.indexOf('#') !== -1) {
+ oAuthBrowser.removeEventListener('loadstart', listener);
+ oAuthBrowser.close();
+ callback(newLoc);
+ }
+ };
+ oAuthBrowser.addEventListener('loadstart', listener);
+}
+});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/4d4e0b46/www/crx_files/www/plugins/chrome.socket/socket.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome.socket/socket.js b/www/crx_files/www/plugins/chrome.socket/socket.js
new file mode 100644
index 0000000..389eec9
--- /dev/null
+++ b/www/crx_files/www/plugins/chrome.socket/socket.js
@@ -0,0 +1,216 @@
+cordova.define("chrome.socket.Socket", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var platform = cordova.require('cordova/platform');
+var exec = cordova.require('cordova/exec');
+
+exports.create = function(socketMode, stuff, callback) {
+ if (typeof stuff == 'function') {
+ callback = stuff;
+ stuff = {};
+ }
+ var win = callback && function(socketId) {
+ var socketInfo = {
+ socketId: socketId
+ };
+ callback(socketInfo);
+ };
+ exec(win, null, 'ChromeSocket', 'create', [socketMode]);
+};
+
+exports.destroy = function(socketId) {
+ exec(null, null, 'ChromeSocket', 'destroy', [socketId]);
+};
+
+
+exports.connect = function(socketId, address, port, callback) {
+ var win = callback && function() {
+ callback(0);
+ };
+ var fail = callback && function() {
+ callback(-1);
+ };
+ exec(win, fail, 'ChromeSocket', 'connect', [socketId, address, port]);
+};
+
+exports.bind = function(socketId, address, port, callback) {
+ var win = callback && function() {
+ callback(0);
+ };
+ var fail = callback && function() {
+ callback(-1);
+ };
+ exec(win, fail, 'ChromeSocket', 'bind', [socketId, address, port]);
+};
+
+exports.disconnect = function(socketId) {
+ exec(null, null, 'ChromeSocket', 'disconnect', [socketId]);
+};
+
+
+exports.read = function(socketId, bufferSize, callback) {
+ if (typeof bufferSize == 'function') {
+ callback = bufferSize;
+ bufferSize = 0;
+ }
+ var win = callback && function(data) {
+ var readInfo = {
+ resultCode: data.byteLength || 1,
+ data: data
+ };
+ callback(readInfo);
+ };
+ var fail = callback && function() {
+ var readInfo = {
+ resultCode: 0
+ };
+ callback(readInfo);
+ };
+ exec(win, fail, 'ChromeSocket', 'read', [socketId, bufferSize]);
+};
+
+exports.write = function(socketId, data, callback) {
+ var type = Object.prototype.toString.call(data).slice(8, -1);
+ if (type != 'ArrayBuffer') {
+ throw new Error('chrome.socket.write - data is not an ArrayBuffer! (Got: ' + type + ')');
+ }
+ var win = callback && function(bytesWritten) {
+ var writeInfo = {
+ bytesWritten: bytesWritten
+ };
+ callback(writeInfo);
+ };
+ var fail = callback && function() {
+ var writeInfo = {
+ bytesWritten: 0
+ };
+ callback(writeInfo);
+ };
+ exec(win, fail, 'ChromeSocket', 'write', [socketId, data]);
+};
+
+
+exports.recvFrom = function(socketId, bufferSize, callback) {
+ if (typeof bufferSize == 'function') {
+ callback = bufferSize;
+ bufferSize = 0;
+ }
+ var win;
+ if (platform.id == 'android') {
+ win = callback && (function() {
+ var data;
+ var call = 0;
+ return function(arg) {
+ if (call === 0) {
+ data = arg;
+ call++;
+ } else {
+ var recvFromInfo = {
+ resultCode: data.byteLength || 1,
+ data: data,
+ address: arg.address,
+ port: arg.port
+ };
+
+ callback(recvFromInfo);
+ }
+ };
+ })();
+ } else {
+ win = callback && function(data, address, port) {
+ var recvFromInfo = {
+ resultCode: data.byteLength || 1,
+ data: data,
+ address: address,
+ port: port
+ };
+ callback(recvFromInfo);
+ };
+ }
+
+ var fail = callback && function() {
+ var readInfo = {
+ resultCode: 0
+ };
+ callback(readInfo);
+ };
+ exec(win, fail, 'ChromeSocket', 'recvFrom', [socketId, bufferSize]);
+};
+
+exports.sendTo = function(socketId, data, address, port, callback) {
+ var type = Object.prototype.toString.call(data).slice(8, -1);
+ if (type != 'ArrayBuffer') {
+ throw new Error('chrome.socket.write - data is not an ArrayBuffer! (Got: ' + type + ')');
+ }
+ var win = callback && function(bytesWritten) {
+ var writeInfo = {
+ bytesWritten: bytesWritten
+ };
+ callback(writeInfo);
+ };
+ var fail = callback && function() {
+ var writeInfo = {
+ bytesWritten: 0
+ };
+ callback(writeInfo);
+ };
+ exec(win, fail, 'ChromeSocket', 'sendTo', [{ socketId: socketId, address: address, port: port }, data]);
+};
+
+
+exports.listen = function(socketId, address, port, backlog, callback) {
+ if (typeof backlog == 'function') {
+ callback = backlog;
+ backlog = 0;
+ }
+ var win = callback && function() {
+ callback(0);
+ };
+ var fail = callback && function() {
+ callback(-1);
+ };
+ exec(win, fail, 'ChromeSocket', 'listen', [socketId, address, port, backlog]);
+};
+
+exports.accept = function(socketId, callback) {
+ var win = callback && function(acceptedSocketId) {
+ var acceptInfo = {
+ resultCode: 0,
+ socketId: acceptedSocketId
+ };
+ callback(acceptInfo);
+ };
+ exec(win, null, 'ChromeSocket', 'accept', [socketId]);
+};
+
+
+exports.setKeepAlive = function() {
+ console.warn('chrome.socket.setKeepAlive not implemented yet');
+};
+
+exports.setNoDelay = function() {
+ console.warn('chrome.socket.setNoDelay not implemented yet');
+};
+
+exports.getInfo = function(socketId, callback) {
+ if (platform.id == 'android') {
+ console.warn('chrome.socket.getInfo not implemented yet');
+ return;
+ }
+ var win = callback && function(result) {
+ result.connected = !!result.connected;
+ callback(result);
+ };
+ exec(win, null, 'ChromeSocket', 'getInfo', [socketId]);
+};
+
+exports.getNetworkList = function(callback) {
+ if (platform.id == 'android') {
+ console.warn('chrome.socket.getNetworkList not implemented yet');
+ return;
+ }
+ exec(callback, null, 'ChromeSocket', 'getNetworkList', []);
+};
+
+});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/4d4e0b46/www/crx_files/www/plugins/chrome.storage/storage.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome.storage/storage.js b/www/crx_files/www/plugins/chrome.storage/storage.js
new file mode 100644
index 0000000..4d6da75
--- /dev/null
+++ b/www/crx_files/www/plugins/chrome.storage/storage.js
@@ -0,0 +1,202 @@
+cordova.define("chrome.storage.Storage", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var exports = module.exports;
+var exec = cordova.require('cordova/exec');
+
+function StorageChange(oldValue, newValue) {
+ this.oldValue = oldValue;
+ this.newValue = newValue;
+}
+
+function _jsonReplacer(key) {
+ // Don't use the value passed in since it has already gone through toJSON().
+ var value = this[key];
+ // Refer to:
+ // chrome/src/content/renderer/v8_value_converter_impl.cc&l=165
+ if (value && (typeof value == 'object' || typeof value == 'function')) {
+ var typeName = Object.prototype.toString.call(value).slice(8, -1);
+ if (typeName != 'Array' && typeName != 'Object') {
+ value = {};
+ }
+ }
+ return value;
+}
+
+function _scrubValues(o) {
+ if (typeof o != 'undefined') {
+ var t = JSON.stringify(o, _jsonReplacer);
+ return JSON.parse(t);
+ }
+}
+
+function _calculateChanges(oldKeyVals, newKeyVals) {
+ var ret = {};
+ for(var key in newKeyVals) {
+ if (newKeyVals.hasOwnProperty(key)) {
+ ret[key] = new StorageChange(oldKeyVals[key], newKeyVals[key]);
+ }
+ }
+ return ret;
+}
+
+function _convertToObject(obj) {
+ var ret;
+ if (Array.isArray(obj)) {
+ ret = {};
+ for(var i = 0; i < obj.length; i++) {
+ ret[obj[i]] = undefined;
+ }
+ } else if (typeof obj == 'object') {
+ ret = obj;
+ } else if (typeof obj === 'string') {
+ ret = {};
+ ret[obj] = undefined;
+ }
+ return ret;
+}
+
+function StorageArea(syncStorage, changedEvent) {
+ this._sync = syncStorage;
+ this._changedEvent = changedEvent;
+}
+
+StorageArea.prototype._getAreaName = function() {
+ return (this._sync? 'sync' : 'local');
+};
+
+StorageArea.prototype.get = function(keys, callback) {
+ if (typeof keys == 'function') {
+ callback = keys;
+ keys = null;
+ } else if (typeof keys === 'string') {
+ keys = [keys];
+ }
+ var win = callback && function(args) {
+ callback(args);
+ };
+ var fail = callback && function() {
+ callback();
+ };
+ var param = _scrubValues(keys);
+ exec(win, fail, 'ChromeStorage', 'get', [this._sync, param]);
+};
+
+StorageArea.prototype.getBytesInUse = function(keys, callback) {
+ if (typeof keys == 'function') {
+ callback = keys;
+ keys = null;
+ } else if (typeof keys === 'string') {
+ keys = [keys];
+ }
+ var win = callback && function(bytes) {
+ callback(bytes);
+ };
+ var fail = callback && function() {
+ callback(-1);
+ };
+ var param = _scrubValues(keys);
+ exec(win, fail, 'ChromeStorage', 'getBytesInUse', [this._sync, param]);
+};
+
+StorageArea.prototype.set = function(keyVals, callback) {
+ if (typeof keyVals == 'function') {
+ callback = keyVals;
+ keyVals = null;
+ }
+ var self = this;
+ var param = _scrubValues(keyVals);
+ var fail = callback && function() {
+ callback(-1);
+ };
+ var win;
+ if(self._changedEvent.hasListeners()) {
+ win = function(oldKeyVals) {
+ if(callback) {
+ callback(0);
+ }
+ var newKeyVals = _convertToObject(param);
+ var storageChanges = _calculateChanges(oldKeyVals, newKeyVals);
+ self._changedEvent.fire(storageChanges, self._getAreaName());
+ };
+ } else {
+ win = callback && function() {
+ callback(0);
+ };
+ }
+ exec(win, fail, 'ChromeStorage', 'set', [self._sync, param]);
+};
+
+StorageArea.prototype.remove = function(keys, callback) {
+ if (typeof keys == 'function') {
+ callback = keys;
+ keys = null;
+ } else if (typeof keys === 'string') {
+ keys = [keys];
+ }
+ var self = this;
+ var param = _scrubValues(keys);
+ var fail = callback && function() {
+ callback(-1);
+ };
+ var win;
+ if(self._changedEvent.hasListeners()) {
+ win = function(oldKeyVals) {
+ if(callback) {
+ callback(0);
+ }
+ var newKeyVals = _convertToObject(Object.keys(oldKeyVals));
+ var storageChanges = _calculateChanges(oldKeyVals, newKeyVals);
+ self._changedEvent.fire(storageChanges, self._getAreaName());
+ };
+ } else {
+ win = callback && function() {
+ callback(0);
+ };
+ }
+ exec(win, fail, 'ChromeStorage', 'remove', [self._sync, param]);
+};
+
+StorageArea.prototype.clear = function(callback) {
+ var self = this;
+ var fail = callback && function() {
+ callback(-1);
+ };
+ var win;
+ if(self._changedEvent.hasListeners()) {
+ win = function(oldKeyVals) {
+ if(callback) {
+ callback(0);
+ }
+ var newKeyVals = _convertToObject(Object.keys(oldKeyVals));
+ var storageChanges = _calculateChanges(oldKeyVals, newKeyVals);
+ self._changedEvent.fire(storageChanges, self._getAreaName());
+ };
+ } else {
+ win = callback && function() {
+ callback(0);
+ };
+ }
+ exec(win, fail, 'ChromeStorage', 'clear', [self._sync]);
+};
+
+// TODO(braden): How do we want to handle this event when we're not in a Chrome app?
+var Event = require('chrome.common.events');
+if (Event) {
+ exports.onChanged = new Event('onChanged');
+}
+
+var local = new StorageArea(false, exports.onChanged);
+local.QUOTA_BYTES = 5242880;
+var sync = new StorageArea(true, exports.onChanged);
+sync.MAX_ITEMS = 512;
+sync.MAX_WRITE_OPERATIONS_PER_HOUR = 1000;
+sync.QUOTA_BYTES_PER_ITEM = 4096;
+sync.MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE = 10;
+sync.QUOTA_BYTES = 102400;
+
+exports.local = local;
+exports.sync = sync;
+
+});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/4d4e0b46/www/crx_files/www/plugins/chrome/api/app/runtime.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome/api/app/runtime.js b/www/crx_files/www/plugins/chrome/api/app/runtime.js
new file mode 100644
index 0000000..4a2288c
--- /dev/null
+++ b/www/crx_files/www/plugins/chrome/api/app/runtime.js
@@ -0,0 +1,7 @@
+cordova.define("chrome.app.runtime", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var Event = require('chrome.common.events');
+exports.onLaunched = new Event('onLaunched');
+});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/4d4e0b46/www/crx_files/www/plugins/chrome/api/app/window.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome/api/app/window.js b/www/crx_files/www/plugins/chrome/api/app/window.js
new file mode 100644
index 0000000..3a6484d
--- /dev/null
+++ b/www/crx_files/www/plugins/chrome/api/app/window.js
@@ -0,0 +1,156 @@
+cordova.define("chrome.app.window", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var Event = require('chrome.common.events');
+var mobile = require('chrome.mobile.impl');
+
+// The AppWindow created by chrome.app.window.create.
+var createdAppWindow = null;
+var dummyNode = document.createElement('a');
+
+function AppWindow() {
+ this.contentWindow = mobile.fgWindow;
+ this.id = '';
+}
+
+function unsupportedApi(api) {
+ return function() {
+ console.warn(api + ' is not supported on mobile.');
+ };
+}
+
+AppWindow.prototype = {
+ restore: unsupportedApi('AppWindow.restore'),
+ moveTo: unsupportedApi('AppWindow.moveTo'),
+ clearAttention: unsupportedApi('AppWindow.clearAttention'),
+ minimize: unsupportedApi('AppWindow.minimize'),
+ drawAttention: unsupportedApi('AppWindow.drawAttention'),
+ focus: unsupportedApi('AppWindow.focus'),
+ resizeTo: unsupportedApi('AppWindow.resizeTo'),
+ maximize: unsupportedApi('AppWindow.maximize'),
+ close: unsupportedApi('AppWindow.close'),
+ setBounds: unsupportedApi('AppWindow.setBounds'),
+ onBoundsChanged: new Event('onBoundsChanged'),
+ onClosed: new Event('onClosed')
+};
+AppWindow.prototype.getBounds = function() {
+ return {
+ width: 0,
+ height: 0,
+ left: 0,
+ top: 0
+ };
+};
+
+function copyAttributes(srcNode, destNode) {
+ var attrs = srcNode.attributes;
+ for (var i = 0, attr; attr = attrs[i]; ++i) {
+ destNode.setAttribute(attr.name, attr.value);
+ }
+}
+
+function applyAttributes(attrText, destNode) {
+ dummyNode.innerHTML = '<a ' + attrText + '>';
+ copyAttributes(dummyNode.firstChild, destNode);
+}
+
+// Evals the scripts serially since sometimes browsers don't execute
+// them in the order they are injected :(.
+// TODO: This is clearly slower for multiple scripts. We could maybe see if
+// injecting after DOM mutation events fire?
+function evalScripts(rootNode, afterFunc) {
+ var scripts = Array.prototype.slice.call(rootNode.getElementsByTagName('script'));
+ var doc = rootNode.ownerDocument;
+ function helper() {
+ var script = scripts.shift();
+ if (!script) {
+ afterFunc && afterFunc();
+ // Don't bother with inline scripts since they aren't evalled on desktop.
+ } else if (script.src) {
+ var replacement = doc.createElement('script');
+ copyAttributes(script, replacement);
+ replacement.onload = helper;
+ script.parentNode.replaceChild(replacement, script);
+ } else {
+ helper();
+ }
+ }
+ helper();
+}
+
+function rewritePage(pageContent, filePath) {
+ var fgBody = mobile.fgWindow.document.body;
+ var fgHead = fgBody.previousElementSibling;
+
+ // fgHead.innerHTML causes a DOMException on Android 2.3.
+ while (fgHead.lastChild) {
+ fgHead.removeChild(fgHead.lastChild);
+ }
+
+ var startIndex = pageContent.search(/<html([\s\S]*?)>/i);
+ if (startIndex != -1) {
+ startIndex += RegExp.lastMatch.length;
+ // Copy over the attributes of the <html> tag.
+ applyAttributes(RegExp.lastParen, fgBody.parentNode);
+ } else {
+ startIndex = 0;
+ }
+
+ function afterBase() {
+ fgHead.insertAdjacentHTML('beforeend', headHtml);
+ evalScripts(fgHead, function() {
+ mobile.eventIframe.insertAdjacentHTML('afterend', pageContent);
+ evalScripts(fgBody)
+ });
+ }
+ // Put everything before the body tag in the head.
+ var endIndex = pageContent.search(/<body([\s\S]*?)>/i);
+ if (endIndex == -1) {
+ mobile.eventIframe.insertAdjacentHTML('afterend', 'Load error: Page is missing body tag.');
+ } else {
+ applyAttributes(RegExp.lastParen, fgBody);
+
+ // Don't bother removing the <body>, </body>, </html>. The browser's sanitizer removes them for us.
+ var headHtml = pageContent.slice(startIndex, endIndex);
+ pageContent = pageContent.slice(endIndex);
+
+ fgHead.insertAdjacentHTML('beforeend', '<link rel="stylesheet" href="chromeappstyles.css">');
+ var baseUrl = filePath.replace(/\/.*?$/, '');
+ if (baseUrl != filePath) {
+ fgHead.insertAdjacentHTML('beforeend', '<base href="' + encodeURIComponent(baseUrl) + '/">\n');
+ // setTimeout required for <base> to take effect for <link> elements (browser bug).
+ window.setTimeout(afterBase, 0);
+ } else {
+ afterBase();
+ }
+ }
+}
+
+exports.create = function(filePath, options, callback) {
+ if (createdAppWindow) {
+ console.log('ERROR - chrome.app.window.create called multiple times. This is unsupported.');
+ return;
+ }
+ createdAppWindow = new AppWindow();
+ var xhr = new XMLHttpRequest();
+ xhr.open('GET', filePath, true);
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState == 4) {
+ // Call the callback before the page contents loads.
+ if (callback) {
+ callback(createdAppWindow);
+ }
+ var pageContent = xhr.responseText || 'Page load failed.';
+ rewritePage(pageContent, filePath);
+ cordova.fireWindowEvent('DOMContentReady');
+ cordova.fireWindowEvent('load');
+ }
+ };
+ xhr.send();
+};
+
+exports.current = function() {
+ return window == mobile.fgWindow ? createdAppWindow : null;
+};
+});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/4d4e0b46/www/crx_files/www/plugins/chrome/api/bootstrap.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome/api/bootstrap.js b/www/crx_files/www/plugins/chrome/api/bootstrap.js
new file mode 100644
index 0000000..51c28dc
--- /dev/null
+++ b/www/crx_files/www/plugins/chrome/api/bootstrap.js
@@ -0,0 +1,13 @@
+cordova.define("chrome.bootstrap", function(require, exports, module) {// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Initialization code for the Chrome plugins API.
+// Adds a deviceready listener that initializes the Chrome wrapper.
+
+console.log('adding event');
+document.addEventListener('deviceready', function() {
+ console.log('deviceready caught');
+ require('chrome.mobile.impl').init();
+});
+});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/4d4e0b46/www/crx_files/www/plugins/chrome/api/helpers/stubs.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome/api/helpers/stubs.js b/www/crx_files/www/plugins/chrome/api/helpers/stubs.js
new file mode 100644
index 0000000..ef57b83
--- /dev/null
+++ b/www/crx_files/www/plugins/chrome/api/helpers/stubs.js
@@ -0,0 +1,11 @@
+cordova.define("chrome.helpers.stubs", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+exports.createStub = function(obj, propName, value) {
+ obj.__defineGetter__(propName, function() {
+ console.warn('Access made to stub: ' + obj.__namespace__ + '.' + propName);
+ return value;
+ });
+};
+});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/4d4e0b46/www/crx_files/www/plugins/chrome/api/mobile.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome/api/mobile.js b/www/crx_files/www/plugins/chrome/api/mobile.js
new file mode 100644
index 0000000..28af8b8
--- /dev/null
+++ b/www/crx_files/www/plugins/chrome/api/mobile.js
@@ -0,0 +1,58 @@
+cordova.define("chrome.mobile.impl", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var chrome = window.chrome;
+
+exports.fgWindow = window;
+exports.bgWindow = null;
+exports.eventIframe = null;
+
+function createBgChrome() {
+ return {
+ __proto__: chrome,
+ app: {
+ __proto__: chrome.app,
+ window: {
+ __proto__: chrome.app.window,
+ current: function() { return null; }
+ }
+ }
+ };
+}
+
+exports.init = function() {
+ // Self-destruct so that code in here can be GC'ed.
+ exports.init = null;
+ var iframe = document.createElement('iframe');
+ iframe.src = 'chromebgpage.html';
+ iframe.style.display = 'none';
+ exports.eventIframe = iframe;
+ document.body.appendChild(iframe);
+};
+
+exports.bgInit = function(bgWnd) {
+ // Self-destruct so that code in here can be GC'ed.
+ exports.bgInit = null;
+ exports.bgWindow = bgWnd;
+ bgWnd.chrome = createBgChrome();
+ bgWnd.cordova = cordova;
+ exports.fgWindow.opener = exports.bgWindow;
+
+ function onLoad() {
+ bgWnd.removeEventListener('load', onLoad, false);
+ setTimeout(function() {
+ chrome.app.runtime.onLaunched.fire();
+ }, 0);
+ }
+ bgWnd.addEventListener('load', onLoad, false);
+
+ var manifestJson = chrome.runtime.getManifest();
+ var scripts = manifestJson.app.background.scripts;
+ var toWrite = '';
+ for (var i = 0, src; src = scripts[i]; ++i) {
+ toWrite += '<script src="' + encodeURI(src) + '"></sc' + 'ript>\n';
+ }
+ bgWnd.document.write(toWrite);
+};
+});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/4d4e0b46/www/crx_files/www/plugins/chrome/api/runtime.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome/api/runtime.js b/www/crx_files/www/plugins/chrome/api/runtime.js
new file mode 100644
index 0000000..58b3970
--- /dev/null
+++ b/www/crx_files/www/plugins/chrome/api/runtime.js
@@ -0,0 +1,58 @@
+cordova.define("chrome.runtime", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var argscheck = cordova.require('cordova/argscheck');
+var Event = require('chrome.common.events');
+var stubs = require('chrome.helpers.stubs');
+var mobile = require('chrome.mobile.impl');
+var manifestJson = null;
+
+exports.onSuspend = new Event('onSuspend');
+exports.onInstalled = new Event('onInstalled');
+exports.onStartup = new Event('onStartup');
+exports.onSuspendCanceled = new Event('onSuspendCanceled');
+exports.onUpdateAvailable = new Event('onUpdateAvailable');
+
+var original_addListener = exports.onSuspend.addListener;
+
+// Uses a trampoline to bind the Cordova pause event on the first call.
+exports.onSuspend.addListener = function(f) {
+ window.document.addEventListener('pause', exports.onSuspend.fire, false);
+ exports.onSuspend.addListener = original_addListener;
+ exports.onSuspend.addListener(f);
+};
+
+exports.getManifest = function() {
+ if (!manifestJson) {
+ var xhr = new XMLHttpRequest();
+ xhr.open('GET', 'manifest.json', false /* sync */);
+ xhr.send(null);
+ manifestJson = eval('(' + xhr.responseText + ')'); //JSON.parse(xhr.responseText);
+ }
+ return manifestJson;
+};
+
+exports.getBackgroundPage = function(callback) {
+ argscheck.checkArgs('f', 'chrome.runtime.getBackgroundPage', arguments);
+ setTimeout(function() {
+ callback(mobile.bgWindow);
+ }, 0);
+};
+
+exports.getURL = function(subResource) {
+ argscheck.checkArgs('s', 'chrome.runtime.getURL', arguments);
+ if (subResource.charAt(0) == '/') {
+ subResource = subResource.slice(1);
+ }
+ var prefix = location.href.replace(/[^\/]*$/, '');
+ return prefix + subResource;
+};
+
+exports.reload = function() {
+ location.reload();
+};
+
+stubs.createStub(exports, 'id', '{appId}');
+stubs.createStub(exports, 'requestUpdateCheck', function(){});
+});
[19/30] git commit: Merge pull request #22 from shravanrn/serve
Posted by ag...@apache.org.
Merge pull request #22 from shravanrn/serve
Add apps hosted by cordova serve + Bugfixes to app installation and ResourcesLoader
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/9c28a5e1
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/9c28a5e1
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/9c28a5e1
Branch: refs/heads/master
Commit: 9c28a5e1b9a56267a54469caae5346a82a454284
Parents: 616378c 830dc5d
Author: Braden Shepherdson <br...@gmail.com>
Authored: Thu May 16 11:20:50 2013 -0700
Committer: Braden Shepherdson <br...@gmail.com>
Committed: Thu May 16 11:20:50 2013 -0700
----------------------------------------------------------------------
www/cdvah_contextMenu.html | 87 ++++++-----
www/cdvah_index.html | 2 +
www/cdvah_js/AddCtrl.js | 39 ++++--
www/cdvah_js/AppBundleAlias.js | 32 ++++-
www/cdvah_js/AppsService.js | 217 ++++++++++++++++++--------
www/cdvah_js/CdvhPackageHandler.js | 12 +--
www/cdvah_js/ContextMenu.js | 117 ++++++++------
www/cdvah_js/ContextMenuInjectScript.js | 13 ++
www/cdvah_js/ListCtrl.js | 2 +-
www/cdvah_js/ResourcesLoader.js | 148 +++++++++++-------
www/cdvah_js/ServeCordovaJSHandler.js | 25 +++
www/cdvah_views/add.html | 14 ++-
12 files changed, 460 insertions(+), 248 deletions(-)
----------------------------------------------------------------------
[20/30] git commit: Weinre support.
Posted by ag...@apache.org.
Weinre support.
Conflicts:
www/cdvah_js/ContextMenu.js
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/aee835bf
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/aee835bf
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/aee835bf
Branch: refs/heads/master
Commit: aee835bf06db3d3785a07cf0a89d07326c1bc44d
Parents: 9c28a5e
Author: Shravan Narayan <sh...@google.com>
Authored: Sun May 12 14:08:38 2013 -0400
Committer: Braden Shepherdson <br...@google.com>
Committed: Thu May 16 14:37:16 2013 -0400
----------------------------------------------------------------------
www/cdvah_contextMenu.html | 67 ++++++++++++++++++++------
www/cdvah_js/AppsService.js | 2 +-
www/cdvah_js/CdvhPackageHandler.js | 4 +-
www/cdvah_js/ContextMenu.js | 15 ++++++
www/cdvah_js/ContextMenuInjectScript.js | 11 ++++-
www/cdvah_js/ServeCordovaJSHandler.js | 2 +-
6 files changed, 81 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/aee835bf/www/cdvah_contextMenu.html
----------------------------------------------------------------------
diff --git a/www/cdvah_contextMenu.html b/www/cdvah_contextMenu.html
index 6c0e5c1..c00aacb 100644
--- a/www/cdvah_contextMenu.html
+++ b/www/cdvah_contextMenu.html
@@ -1,23 +1,19 @@
<!DOCTYPE html>
-<html>
+<html onclick="parent.postMessage('ContextMenuHide', '*');">
<head>
<style>
body
{
- position: fixed;
- left : 0px;
- top : 0px;
- z-index: 2000;
background-color:rgba(0,0,0,0.75);
width: 100%;
height: 100%;
}
- body p
+ p, label
{
color: white;
text-align: center;
}
- body ul
+ ul
{
list-style-type: none;
margin-left: 20%;
@@ -25,31 +21,72 @@
padding: 0;
width: 60%;
}
- body li
+ li
{
margin-bottom: 0.5cm;
+ width : 100%;
+ min-height: 1cm;
+ border-bottom: 1px solid grey;
}
- body li, body button
+ .fullwidthElement
{
width: 100%;
- height: 1cm;
+ min-height: 1cm;
+ }
+ .halfwidthElement
+ {
+ min-height: 1cm;
+ width: 48%;
+ padding-left: 0;
+ padding-right: 0;
}
</style>
+ <script type="text/javascript">
+ var currentWeinreName;
+
+ function updateWeinreName(){
+ var newName = document.getElementById("WeinreName").value;
+ if(newName !== currentWeinreName){
+ var el = document.getElementById("WeinreLink");
+ var newVal = "http://debug.phonegap.com/client/#" + newName;
+ el.href = newVal;
+ el.innerText = newVal;
+ parent.postMessage("ContextMenuWeinre:" + newName, "*");
+ currentWeinreName = newName;
+ }
+ }
+
+ // Set up listener for incoming messages
+ window.addEventListener("message", function(e){
+ if(e.data.indexOf("AppHarnessAppName:") === 0){
+ var appName = e.data.substring("AppHarnessAppName:".length);
+ document.getElementById("WeinreName").value = appName;
+ }
+ } , false);
+ </script>
</head>
-<body onclick="parent.postMessage('ContextMenuHide', '*');">
+<body>
<p>Tap Anywhere to Close</p>
<ul>
<li>
- <button onclick="parent.postMessage('ContextMenuUpdate', '*');">Update</button>
+ <button class="fullwidthElement" onclick="parent.postMessage('ContextMenuUpdate', '*');">Update</button>
+ </li>
+ <li>
+ <button class="fullwidthElement" onclick="parent.postMessage('ContextMenuRestart', '*');">Restart</button>
</li>
<li>
- <button onclick="parent.postMessage('ContextMenuRestart', '*');">Restart</button>
+ <button class="fullwidthElement" onclick="parent.postMessage('ContextMenuFirebug', '*');">Firebug</button>
</li>
<li>
- <button onclick="parent.postMessage('ContextMenuFirebug', '*');">Firebug</button>
+ <label for="WeinreName"><p>Phonegap Weinre</p></label>
+ <br />
+ <input class="halfwidthElement" id="WeinreName" type="text" value="default" onclick="event.stopPropagation();" />
+ <button class="halfwidthElement" onclick="updateWeinreName();">Add PhoneGap Weinre Link</button>
+ <br />
+ <a href="http://debug.phonegap.com/client/#default"><p id="WeinreLink"></p></a>
</li>
<li>
- <button onclick="parent.postMessage('ContextMenuMainMenu', '*');">Back to Main Menu</button>
+ <button class="fullwidthElement" onclick="parent.postMessage('ContextMenuMainMenu', '*');">Back to Main Menu</button>
</li>
</ul>
</body>
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/aee835bf/www/cdvah_js/AppsService.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/AppsService.js b/www/cdvah_js/AppsService.js
index 34358ce..f7def39 100644
--- a/www/cdvah_js/AppsService.js
+++ b/www/cdvah_js/AppsService.js
@@ -40,7 +40,7 @@
if(!extensionHandlers[extension]) {
throw new Error("No handler for extension " + extension + " found");
}
- return extensionHandlers[extension].extractPackageToDirectory(fullFilePath, directoryPath);
+ return extensionHandlers[extension].extractPackageToDirectory(appName, fullFilePath, directoryPath);
})
.then(function(){
return registerApp(appName, "pattern", appSourcePattern);
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/aee835bf/www/cdvah_js/CdvhPackageHandler.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/CdvhPackageHandler.js b/www/cdvah_js/CdvhPackageHandler.js
index edf5245..bea8280 100644
--- a/www/cdvah_js/CdvhPackageHandler.js
+++ b/www/cdvah_js/CdvhPackageHandler.js
@@ -21,8 +21,8 @@
}
AppsService.registerPackageHandler("cdvh", {
- extractPackageToDirectory : function (fileName, outputDirectory){
- var dataToAppend = "\n(" + ContextMenuInjectScript.toString() + ")();";
+ extractPackageToDirectory : function (appName, fileName, outputDirectory){
+ var dataToAppend = ContextMenuInjectScript.getInjectString(appName);
var platformDirectory = outputDirectory + "/" + platformId + "/www/";
var cordovaFile = platformDirectory + "cordova.js";
var pluginsFile = platformDirectory + "cordova_plugins.json";
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/aee835bf/www/cdvah_js/ContextMenu.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/ContextMenu.js b/www/cdvah_js/ContextMenu.js
index bcfa1b6..48d5ac8 100644
--- a/www/cdvah_js/ContextMenu.js
+++ b/www/cdvah_js/ContextMenu.js
@@ -2,6 +2,7 @@
function initialise() {
setupIframe();
+ sendAppNameToIframe();
setupIframeMessaging();
loadFirebug(false);
attachErrorListener();
@@ -23,6 +24,15 @@
}, false);
}
+ function sendAppNameToIframe(){
+ if(window.__cordovaAppHarnessAppName){
+ var el = document.getElementById(contextMenuIframe);
+ el.onload = function(){
+ el.contentWindow.postMessage("AppHarnessAppName:" + window.__cordovaAppHarnessAppName, "*");
+ };
+ }
+ }
+
function onContextMenuUpdateClicked(){
window.location = "app-bundle:///cdvah_index.html#/?updateLastLaunched=true";
}
@@ -59,6 +69,11 @@
function onContextMenuHideClicked(){
document.getElementById(contextMenuIframe).style.display = "none";
}
+ function onContextMenuWeinreNameChanged(newName){
+ var el = document.createElement("script");
+ el.setAttribute("src", "http://debug.phonegap.com/target/target-script-min.js#" + newName);
+ document.head.appendChild(el);
+ }
var messageHandler = {
"ContextMenuUpdate" : onContextMenuUpdateClicked,
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/aee835bf/www/cdvah_js/ContextMenuInjectScript.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/ContextMenuInjectScript.js b/www/cdvah_js/ContextMenuInjectScript.js
index 7525b70..70c06aa 100644
--- a/www/cdvah_js/ContextMenuInjectScript.js
+++ b/www/cdvah_js/ContextMenuInjectScript.js
@@ -2,12 +2,21 @@
"use strict";
/* global myApp */
myApp.factory("ContextMenuInjectScript", [ function () {
- return function() {
+ var toInject = function() {
console.log("Injecting menu script");
var contextScript = document.createElement("script");
contextScript.setAttribute("type","text/javascript");
contextScript.setAttribute("src", "app-bundle:///cdvah_js/ContextMenu.js");
+ window.__cordovaAppHarnessAppName = "appPlaceHolder";
document.getElementsByTagName("head")[0].appendChild(contextScript);
};
+
+ return {
+ getInjectString : function(appName){
+ var string = "\n(" + toInject.toString() + ")();";
+ string = string.replace("appPlaceHolder", appName);
+ return string;
+ }
+ };
}]);
})();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/aee835bf/www/cdvah_js/ServeCordovaJSHandler.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/ServeCordovaJSHandler.js b/www/cdvah_js/ServeCordovaJSHandler.js
index 0154c64..55bad69 100644
--- a/www/cdvah_js/ServeCordovaJSHandler.js
+++ b/www/cdvah_js/ServeCordovaJSHandler.js
@@ -14,7 +14,7 @@
return ResourcesLoader.xhrGet(cordovaJSPath);
})
.then(function(xhr){
- var dataToAppend = "\n(" + ContextMenuInjectScript.toString() + ")();";
+ var dataToAppend = ContextMenuInjectScript.getInjectString(appEntry.Name);
var completeText = xhr.responseText + dataToAppend;
appInstallLocation += (appInstallLocation.charAt(appInstallLocation.length - 1) === "/")? "" : "/";
return ResourcesLoader.writeFileContents(appInstallLocation + "cordova.js", completeText);
[04/30] git commit: Merge pull request #18 from shravanrn/bookmarklets
Posted by ag...@apache.org.
Merge pull request #18 from shravanrn/bookmarklets
Firebug integration.
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/1352f29c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/1352f29c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/1352f29c
Branch: refs/heads/master
Commit: 1352f29c46a303c3e5e9bbb02ea19ef338b7ab09
Parents: c2757ea 7d0e717
Author: Braden Shepherdson <br...@gmail.com>
Authored: Thu May 2 14:48:42 2013 -0700
Committer: Braden Shepherdson <br...@gmail.com>
Committed: Thu May 2 14:48:42 2013 -0700
----------------------------------------------------------------------
www/contextMenu.html | 3 ++
www/js/ContextMenu.js | 47 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 50 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
[22/30] git commit: Some Markdown formatting cleanup.
Posted by ag...@apache.org.
Some Markdown formatting cleanup.
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/6492417b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/6492417b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/6492417b
Branch: refs/heads/master
Commit: 6492417bdaa8b1eaa8fc44097c45e9f2c2897308
Parents: 633074b
Author: Braden Shepherdson <br...@google.com>
Authored: Thu May 16 15:20:54 2013 -0400
Committer: Braden Shepherdson <br...@google.com>
Committed: Thu May 16 15:20:54 2013 -0400
----------------------------------------------------------------------
README.md | 43 +++++++++++++++++++++++--------------------
1 files changed, 23 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/6492417b/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 986bb1a..69d9524 100644
--- a/README.md
+++ b/README.md
@@ -5,12 +5,12 @@ An App harness for Cordova that can download and run Cordova apps as well as Chr
##Setting up environment
-* Clone the the cordova-app-harness, cordova-android, cordova-ios, cordova-js, plugman, cordova-cli, zip(https://github.com/MobileChromeApps/zip) and AppBundle(https://github.com/MobileChromeApps/AppBundle) repos into folders of the same name in a common directory - eg 'Repo'.
-* Use the future branch for cordova-cli and master everywhere else
-* Link these plugman and cordova-cli of this branch as the globally symlinked plugman and cordova-cli commands. (You may want to see 'npm link')
-* Build the cordova-js repo and grab the cordova.android.js and cordova.ios.js
-* Replace the cordova-cli/lib/cordova-android/framework/assets/js/cordova.android.js and the cordova-cli/lib/cordova-ios/CordovaLib/cordova.ios.js files with the ones above
-* Build the cordova-android repository and generate new cordova.jar
+* Clone the the `cordova-app-harness`, `cordova-android`, `cordova-ios`, `cordova-js`, `plugman`, `cordova-cli`, `zip` ([](https://github.com/MobileChromeApps/zip)) and `AppBundle` ([](https://github.com/MobileChromeApps/AppBundle)) repos into folders of the same name in a common directory - eg 'Repo'.
+* Use the `future` branch for `cordova-cli` and `master` everywhere else
+* Link these `plugman` and `cordova-cli` of this branch as the globally symlinked `plugman` and `cordova-cli` commands. (You may want to see `npm link`)
+* Build the `cordova-js` repo and grab the `cordova.android.js` and `cordova.ios.js`
+* Replace the `cordova-cli/lib/cordova-android/framework/assets/js/cordova.android.js` and the `cordova-cli/lib/cordova-ios/CordovaLib/cordova.ios.js` files with the ones above
+* Build the `cordova-android` repository and generate new `cordova.jar`
* Run the following commands
cordova create CordovaAppHarness
@@ -22,36 +22,39 @@ An App harness for Cordova that can download and run Cordova apps as well as Chr
cp -rf ../Repo/cordova-app-harness/www app/www
cordova prepare
-* Put the cordova.jar in the CordovaAppHarness/platforms/android/libs folder. (Note you may want to link the cordova-android project directly instead of adding a built jar so you can easily make changes to cordova-android and test the app harness)
-* Replace the contents of CordovaAppHarness/platforms/ios/CordovaLib with /Repo/cordova-ios/CordovaLib
-* Go to eclipse and got to new, other, android, android project from existing code. Navigate to CordovaAppHarness/platforms/android and then add the project
-* Double click the .xcodeproj file in CordovaAppHarnessNew/platforms/ios/
-* Ensure the config.xml for android (Project Folder In IDE/res/xml/config.xml) and ios (Project Folder In IDE/config.xml) have the content tag's src set to
+* Put the `cordova.jar` in the `CordovaAppHarness/platforms/android/libs` folder. (Note you may want to link the `cordova-android` project directly instead of adding a built jar so you can easily make changes to `cordova-android` and test the app harness)
+* Replace the contents of `CordovaAppHarness/platforms/ios/CordovaLib` with `/Repo/cordova-ios/CordovaLib`
+* Go to Eclipse and got to new, other, android, android project from existing code. Navigate to `CordovaAppHarness/platforms/android` and then add the project
+* Double click the `.xcodeproj` file in `CordovaAppHarnessNew/platforms/ios/`
+* Ensure the `config.xml` for Android (Project Folder In IDE/res/xml/config.xml) and iOS (Project Folder In IDE/config.xml) have the content tag's `src` set to
<content src="app-bundle:///cdvah_index.html" />
-* Ensure the config.xml for ios has the tag
+* Ensure the `config.xml` for iOS has the tag
<access origin="app-bundle://*" />
-* You can now build the app harness from the ides or with cordova compile
+* You can now build the app harness from the IDEs or with `cordova compile`
##Features
+
* Install and test multiple applications.
-* Run apps locally or run them directly from cordova serve.
-* Edit and Refresh workflow with cordova serve.
+* Run apps locally or run them directly from `cordova serve`.
+* Edit and Refresh workflow with `cordova serve`.
* In App context menu to switch between apps.
* Firebug Lite and Weinre support for debugging.
-* Support for bundle paths such as "file:///android_asset/www" - These point to the tested application's bundle and not the app harness' bundle. (In development)
+* Support for bundle paths such as `file:///android_asset/www` - These point to the tested application's bundle and not the app harness' bundle. (In development)
##Install an app in the harness
* Install the app in one of the two ways below
###Test by installing the app on the phone through app harness
-* Run the packapp script and point it to a cordova project of the app you want to test. This will package the app into a cdvh file. (Note: it is expected that you have added all relevant platforms. For example, if you want to test on the iphone, you need to have added the ios platform to the project)
+* Run the `packapp` script and point it to a cordova project of the app you want to test. This will package the app into a `cdvh` file. (Note: it is expected that you have added all relevant platforms. For example, if you want to test on the iphone, you need to have added the ios platform to the project)
+
Repo/cordova-app-harness/packapp -p ./TestApp TestApp.cdvh
-* Upload the the cdvh onto any hosting site.
+
+* Upload the the `cdvh` onto any hosting site.
* Run the app harness
* Click add new app
* Give a name and the url to the cdvh file.
@@ -65,10 +68,10 @@ An App harness for Cordova that can download and run Cordova apps as well as Chr
cordova serve <platform>
* If you want to test the app in an actual device, find the network address of your computer by running
ifconfig
-* If you are running this on a simulator, you can use "http://localhost" as your address
+* If you are running this on a simulator, you can use `http://localhost` as your address
* Click add new app
* Choose the option "Enter the URL to the server hosting the app"
-* Give a name and the url as follows. Let's assume the network address discovered above is a.b.c.d
+* Give a name and the url as follows. Let's assume the network address discovered above is `a.b.c.d`
Name: App1
URL to server: http://a.b.c.d:8000/config.xml
[06/30] git commit: Merge pull request #19 from shravanrn/lastModified
Posted by ag...@apache.org.
Merge pull request #19 from shravanrn/lastModified
Display date and time of app installation
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/6ac6b468
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/6ac6b468
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/6ac6b468
Branch: refs/heads/master
Commit: 6ac6b4686b864444e5c9eddfb63b008cc54bcbc7
Parents: 1352f29 7531ee5
Author: Braden Shepherdson <br...@gmail.com>
Authored: Thu May 2 15:04:23 2013 -0700
Committer: Braden Shepherdson <br...@gmail.com>
Committed: Thu May 2 15:04:23 2013 -0700
----------------------------------------------------------------------
www/js/AppsService.js | 15 ++++++++++-----
www/js/ListCtrl.js | 11 +++++++++--
www/views/list.html | 10 +++++-----
3 files changed, 24 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
[26/30] git commit: Readme update. String to Regex conversion bugfix.
Posted by ag...@apache.org.
Readme update. String to Regex conversion bugfix.
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/7d48f4a9
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/7d48f4a9
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/7d48f4a9
Branch: refs/heads/master
Commit: 7d48f4a97a301b4754c1896e39e2009423b6eecd
Parents: 1105393
Author: Shravan Narayan <sh...@google.com>
Authored: Thu May 16 22:58:23 2013 -0400
Committer: Shravan Narayan <sh...@google.com>
Committed: Thu May 16 22:58:23 2013 -0400
----------------------------------------------------------------------
README.md | 13 +++++++++----
www/cdvah_js/AppBundleAlias.js | 35 ++++++++++++++++++++++++-----------
2 files changed, 33 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/7d48f4a9/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 8e87aff..5610c12 100644
--- a/README.md
+++ b/README.md
@@ -86,11 +86,16 @@ An App harness for Cordova that can download and run Cordova apps as well as Chr
###Test by using cordova serve
* Go to cordova project of the app you want to test in a terminal and run.
- cordova prepare
+
cordova serve <platform>
-* If you want to test the app in an actual device, find the network address of your computer by running
- ifconfig
-* If you are running this on a simulator, you can use `http://localhost` as your address
+
+* Open a new terminal to the same location and run
+
+ cordova prepare
+
+* If you want to test the app in an actual device, find the network address of your computer by running ifconfig
+ If you are running this on the iOS simulator, you can use "http://localhost" as your address
+ If you are running this on the android simulator, you can use "http://10.0.2.2" as your address
* Click add new app
* Choose the option "Enter the URL to the server hosting the app"
* Give a name and the url as follows. Let's assume the network address discovered above is `a.b.c.d`
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/7d48f4a9/www/cdvah_js/AppBundleAlias.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/AppBundleAlias.js b/www/cdvah_js/AppBundleAlias.js
index 05fdd4d..5e1bbb8 100644
--- a/www/cdvah_js/AppBundleAlias.js
+++ b/www/cdvah_js/AppBundleAlias.js
@@ -24,18 +24,31 @@
}
}
+ function replaceCharWithString(string, searchChar, replaceString){
+ var ret = "";
+ for(var i = 0; i < string.length; i++){
+ if(string[i] === searchChar){
+ ret += replaceString;
+ } else {
+ ret += string[i];
+ }
+ }
+ return ret;
+ }
+
function getRegex(string){
- return string.replace("[", "\\[")
- .replace("\\", "\\\\")
- .replace("^", "\\^")
- .replace("$", "\\$")
- .replace(".", "\\.")
- .replace("|", "\\|")
- .replace("?", "\\?")
- .replace("*", "\\*")
- .replace("+", "\\+")
- .replace("(", "\\(")
- .replace(")", "\\)");
+ string = replaceCharWithString(string, "\\", "\\\\");
+ string = replaceCharWithString(string, "[", "\\[");
+ string = replaceCharWithString(string, "^", "\\^");
+ string = replaceCharWithString(string, "$", "\\$");
+ string = replaceCharWithString(string, ".", "\\.");
+ string = replaceCharWithString(string, "|", "\\|");
+ string = replaceCharWithString(string, "?", "\\?");
+ string = replaceCharWithString(string, "*", "\\*");
+ string = replaceCharWithString(string, "+", "\\+");
+ string = replaceCharWithString(string, "(", "\\(");
+ string = replaceCharWithString(string, ")", "\\)");
+ return string;
}
AppsService.addPreLaunchHook(function(appEntry, appInstallLocation, wwwLocation) {
[17/30] git commit: Menu for apps from serve. Menu now in
iframe.Priority for startup hooks. Cleaned up AngularJS usage.
Posted by ag...@apache.org.
Menu for apps from serve. Menu now in iframe.Priority for startup hooks.
Cleaned up AngularJS usage.
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/94edf0c1
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/94edf0c1
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/94edf0c1
Branch: refs/heads/master
Commit: 94edf0c11d8c6b05d803e5dabc8ad2969ee932b9
Parents: 636794a
Author: Shravan Narayan <sh...@google.com>
Authored: Fri May 10 15:50:52 2013 -0400
Committer: Shravan Narayan <sh...@google.com>
Committed: Fri May 10 15:50:52 2013 -0400
----------------------------------------------------------------------
www/cdvah_contextMenu.html | 87 ++++++++++----------
www/cdvah_index.html | 2 +
www/cdvah_js/AddCtrl.js | 35 +++++---
www/cdvah_js/AppBundleAlias.js | 32 ++++++-
www/cdvah_js/AppsService.js | 112 ++++++++++++++++----------
www/cdvah_js/CdvhPackageHandler.js | 12 +---
www/cdvah_js/ContextMenu.js | 110 ++++++++++++++-----------
www/cdvah_js/ContextMenuInjectScript.js | 13 +++
www/cdvah_js/ResourcesLoader.js | 4 +-
www/cdvah_js/ServeCordovaJSHandler.js | 25 ++++++
www/cdvah_views/add.html | 12 ++--
11 files changed, 273 insertions(+), 171 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/94edf0c1/www/cdvah_contextMenu.html
----------------------------------------------------------------------
diff --git a/www/cdvah_contextMenu.html b/www/cdvah_contextMenu.html
index 8f515c9..6c0e5c1 100644
--- a/www/cdvah_contextMenu.html
+++ b/www/cdvah_contextMenu.html
@@ -1,53 +1,56 @@
-<!-- Keep stylesheet as a part of the html as this file gets injected into the app -->
-<style>
-#__cordovaappharness_contextMenu_div
-{
- position: fixed;
- left : 0px;
- top : 0px;
- z-index: 2000;
- background-color:rgba(0,0,0,0.75);
- width: 100%;
- height: 100%;
- display: none;
-}
-#__cordovaappharness_contextMenu_div p
-{
- color: white;
- text-align: center;
-}
-#__cordovaappharness_contextMenu_div ul
-{
- list-style-type: none;
- margin-left: 20%;
- margin-right: 20%;
- padding: 0;
- width: 60%;
-}
-#__cordovaappharness_contextMenu_div li
-{
- margin-bottom: 0.5cm;
-}
-#__cordovaappharness_contextMenu_div li, #__cordovaappharness_contextMenu_div button
-{
- width: 100%;
- height: 1cm;
-}
-</style>
-<div id="__cordovaappharness_contextMenu_div">
+<!DOCTYPE html>
+<html>
+<head>
+ <style>
+ body
+ {
+ position: fixed;
+ left : 0px;
+ top : 0px;
+ z-index: 2000;
+ background-color:rgba(0,0,0,0.75);
+ width: 100%;
+ height: 100%;
+ }
+ body p
+ {
+ color: white;
+ text-align: center;
+ }
+ body ul
+ {
+ list-style-type: none;
+ margin-left: 20%;
+ margin-right: 20%;
+ padding: 0;
+ width: 60%;
+ }
+ body li
+ {
+ margin-bottom: 0.5cm;
+ }
+ body li, body button
+ {
+ width: 100%;
+ height: 1cm;
+ }
+ </style>
+</head>
+<body onclick="parent.postMessage('ContextMenuHide', '*');">
<p>Tap Anywhere to Close</p>
<ul>
<li>
- <a href="app-bundle:///cdvah_index.html#/?updateLastLaunched=true"><button>Update</button></a>
+ <button onclick="parent.postMessage('ContextMenuUpdate', '*');">Update</button>
</li>
<li>
- <a href="app-bundle:///cdvah_index.html#/?lastLaunched=true"><button>Restart</button></a>
+ <button onclick="parent.postMessage('ContextMenuRestart', '*');">Restart</button>
</li>
<li>
- <button id="__cordovaappharness_contextMenu_firebug_button">Firebug</button>
+ <button onclick="parent.postMessage('ContextMenuFirebug', '*');">Firebug</button>
</li>
<li>
- <a href="app-bundle:///cdvah_index.html"><button>Back to Main Menu</button></a>
+ <button onclick="parent.postMessage('ContextMenuMainMenu', '*');">Back to Main Menu</button>
</li>
</ul>
-</div>
\ No newline at end of file
+</body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/94edf0c1/www/cdvah_index.html
----------------------------------------------------------------------
diff --git a/www/cdvah_index.html b/www/cdvah_index.html
index b33fe29..8850f80 100644
--- a/www/cdvah_index.html
+++ b/www/cdvah_index.html
@@ -7,6 +7,8 @@
<script type="text/javascript" src="cdvah_js/libs/angular.min.js"></script>
<script type="text/javascript" src="cdvah_js/app.js"></script>
<script type="text/javascript" src="cdvah_js/AppConstants.js"></script>
+ <script type="text/javascript" src="cdvah_js/ContextMenuInjectScript.js"></script>
+ <script type="text/javascript" src="cdvah_js/ServeCordovaJSHandler.js"></script>
<script type="text/javascript" src="cdvah_js/ResourcesLoader.js"></script>
<script type="text/javascript" src="cdvah_js/AppsService.js"></script>
<script type="text/javascript" src="cdvah_js/AppBundleAlias.js"></script>
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/94edf0c1/www/cdvah_js/AddCtrl.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/AddCtrl.js b/www/cdvah_js/AddCtrl.js
index 7f6a34c..b536d87 100644
--- a/www/cdvah_js/AddCtrl.js
+++ b/www/cdvah_js/AddCtrl.js
@@ -3,28 +3,37 @@
/* global myApp */
myApp.controller("AddCtrl", ["$scope", "AppsService", function ($scope, AppsService) {
- $scope.addApp = function(appName, appSource, appSourcePattern, appSourceServe) {
+ $scope.appData = {
+ appName : "",
+ appSource : "pattern",
+ appSourcePattern : "",
+ appSourceServe : ""
+ };
+
+ $scope.addApp = function() {
var serviceCall;
- if(appSource === "pattern") {
- if(!appSourcePattern) {
+ if($scope.appData.appSource === "pattern") {
+ if(!$scope.appData.appSourcePattern) {
alert("Url of package not specified");
return;
}
- serviceCall = AppsService.addAppFromPattern(appName, appSourcePattern);
- } else if(appSource === "serve") {
- if(!appSourceServe) {
+ serviceCall = AppsService.addAppFromPattern($scope.appData.appName, $scope.appData.appSourcePattern);
+ } else if($scope.appData.appSource === "serve") {
+ if(!$scope.appData.appSourceServe) {
alert("Url of config file not specified");
return;
}
- serviceCall = AppsService.addAppFromServe(appName, appSourceServe);
+ serviceCall = AppsService.addAppFromServe($scope.appData.appName, $scope.appData.appSourceServe);
}
- serviceCall.then(function() {
- alert("Successfully installed");
- }, function(error) {
- console.error(error);
- alert("Unable to add application because: \n" + error);
- });
+ if(serviceCall) {
+ serviceCall.then(function() {
+ alert("Successfully installed");
+ }, function(error) {
+ console.error(error);
+ alert("Unable to add application because: \n" + error);
+ });
+ }
};
}]);
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/94edf0c1/www/cdvah_js/AppBundleAlias.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/AppBundleAlias.js b/www/cdvah_js/AppBundleAlias.js
index 1bdfbf8..7c244a6 100644
--- a/www/cdvah_js/AppBundleAlias.js
+++ b/www/cdvah_js/AppBundleAlias.js
@@ -24,13 +24,35 @@
}
}
- AppsService.addPreLaunchHook(function(appName, wwwLocation) {
- console.log("Adding aliases for " + appName);
+ function getRegex(string){
+ return string.replace("[", "\\[")
+ .replace("\\", "\\\\")
+ .replace("^", "\\^")
+ .replace("$", "\\$")
+ .replace(".", "\\.")
+ .replace("|", "\\|")
+ .replace("?", "\\?")
+ .replace("*", "\\*")
+ .replace("+", "\\+")
+ .replace("(", "\\(")
+ .replace(")", "\\)");
+ }
+
+ AppsService.addPreLaunchHook(function(appEntry, appInstallLocation, wwwLocation) {
+ console.log("Adding aliases for " + appEntry.Name);
wwwLocation += (wwwLocation.charAt(wwwLocation.length - 1) === "/")? "" : "/";
- wwwLocation = (wwwLocation.indexOf("file://") === 0) ? wwwLocation : "file://" + wwwLocation;
+ appInstallLocation += (appInstallLocation.charAt(appInstallLocation.length - 1) === "/")? "" : "/";
//Make any direct references to the bundle paths such as file:///android_asset point to the installed location without redirecting
//{BUNDLE_WWW} in the regex is automatically replaced by the appBundle component
- return aliasUri("^{BUNDLE_WWW}.*", "^{BUNDLE_WWW}", wwwLocation, false /* redirect */);
- });
+ return aliasUri("^{BUNDLE_WWW}.*", "^{BUNDLE_WWW}", wwwLocation, false /* redirect */)
+ .then(function(){
+ //For cordova serve apps, we additionally have to redirect requests to the original cordova.js to a modified cordova.js we have locally
+ if(appEntry.Source === "serve"){
+ var regexWWWLoc = getRegex(wwwLocation);
+ var regex = "^" + regexWWWLoc + "cordova.js(\\?|#.*)?";
+ return aliasUri(regex, regex, appInstallLocation + "cordova.js", false);
+ }
+ });
+ }, 500 /* Give it a priority */);
}]);
})();
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/94edf0c1/www/cdvah_js/AppsService.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/AppsService.js b/www/cdvah_js/AppsService.js
index 824cb8a..f0d1b86 100644
--- a/www/cdvah_js/AppsService.js
+++ b/www/cdvah_js/AppsService.js
@@ -48,7 +48,13 @@
}
function addNewAppFromServe(appName, appSourceServe){
- return registerApp(appName, "serve", appSourceServe);
+ return ResourcesLoader.deleteDirectory(INSTALL_DIRECTORY + appName)
+ .then(function(){
+ return ResourcesLoader.ensureDirectoryExists(INSTALL_DIRECTORY + appName + "/" + platformId);
+ })
+ .then(function(){
+ return registerApp(appName, "serve", appSourceServe);
+ });
}
function registerApp(appName, appSource, appSourceData) {
@@ -70,12 +76,13 @@
}
function getAppStartPageFromConfig(configFile, appBaseLocation) {
+ appBaseLocation += (appBaseLocation.charAt(appBaseLocation.length - 1) === "/")? "" : "/";
return ResourcesLoader.readFileContents(configFile)
.then(function(contents){
if(!contents) {
throw new Error("Config file is empty. Unable to find a start page for your app.");
} else {
- var startLocation = appBaseLocation + "/index.html";
+ var startLocation = appBaseLocation + "index.html";
var parser = new DOMParser();
var xmlDoc = parser.parseFromString(contents, "text/xml");
var els = xmlDoc.getElementsByTagName("content");
@@ -90,7 +97,7 @@
startLocation = srcValue;
} else {
srcValue = srcValue.charAt(0) === "/" ? srcValue.substring(1) : srcValue;
- startLocation = appBaseLocation + "/" + srcValue;
+ startLocation = appBaseLocation + srcValue;
}
break;
}
@@ -110,18 +117,15 @@
})
.then(function(result){
result.installedApps = result.installedApps || [];
-
for(var i = 0; i < result.installedApps.length; i++){
if(result.installedApps[i].Name === appName) {
entry = result.installedApps.splice(i, 1)[0];
break;
}
}
-
if(!entry) {
throw new Error("The app " + appName + " was not found.");
}
-
return ResourcesLoader.writeJSONFileContents(APPS_JSON, result);
})
.then(function(){
@@ -162,8 +166,7 @@
});
}
- function getWWWDirAndStartPageFromConfigForApp(appName){
- var platformWWWLocation;
+ function getAppEntry(appName){
return getAppsList(true /* Get full app entry */)
.then(function(appEntries){
var entry;
@@ -176,14 +179,27 @@
if(!entry){
throw new Error("Could not find the app " + appName + " in the installed apps");
}
+ return entry;
+ });
+ }
+
+ // On success, this function returns the following paths
+ // appInstallLocation - INSTALL_DIR/app/platform/
+ // platformWWWLocation - location containing the html, css and js files
+ // configLocation - location of config.xml
+ // startLocation - the path of the page to start the app with
+ function getAppPathsForAppEntry(entry){
+ var appPaths = {};
+ return ResourcesLoader.getFullFilePath(INSTALL_DIRECTORY + entry.Name + "/" + platformId)
+ .then(function(platformLocation){
+ if(!isPathAbsolute(platformLocation)){
+ // assume file uri
+ platformLocation = "file://" + platformLocation;
+ }
+ appPaths.appInstallLocation = platformLocation;
if(entry.Source === "pattern"){
- return ResourcesLoader.getFullFilePath(INSTALL_DIRECTORY + appName + "/" + platformId)
- .then(function(platformLocation){
- return {
- platformWWWLocation : platformLocation + "/www/",
- configLocation : platformLocation + "/config.xml"
- };
- });
+ appPaths.platformWWWLocation = platformLocation + "/www/";
+ appPaths.configLocation = platformLocation + "/config.xml";
} else if(entry.Source === "serve"){
var configFile = entry.Data;
var location = configFile.indexOf("/config.xml");
@@ -192,26 +208,30 @@
}
//grab path including upto last slash
var appLocation = configFile.substring(0, location + 1);
- return {
- platformWWWLocation : appLocation,
- configLocation : configFile
- };
+ appPaths.platformWWWLocation = appLocation;
+ appPaths.configLocation = configFile;
} else {
throw new Error("Unknown app source: " + entry.Source);
}
- })
- .then(function(appPaths){
- platformWWWLocation = appPaths.platformWWWLocation;
return getAppStartPageFromConfig(appPaths.configLocation, appPaths.platformWWWLocation);
})
.then(function(startLocation){
- return {
- startLocation : startLocation,
- platformWWWLocation : platformWWWLocation
- };
+ appPaths.startLocation = startLocation;
+ return appPaths;
});
}
+ function insertObjectAtPriority(objArr, handler, priority){
+ var i = 0;
+ var objToInsert = { "priority" : priority, "handler" : handler };
+ for(i = 0; i < objArr.length; i++){
+ if(objArr[i].priority > objToInsert.priority) {
+ break;
+ }
+ }
+ objArr.splice(i, 0, objToInsert);
+ }
+
return {
//return promise with the array of apps
getAppsList : function(getFullEntries) {
@@ -219,6 +239,7 @@
},
launchApp : function(appName) {
+ var appEntry;
var startLocation;
return ResourcesLoader.readJSONFileContents(METADATA_JSON)
.then(function(settings){
@@ -227,15 +248,21 @@
return ResourcesLoader.writeJSONFileContents(METADATA_JSON, settings);
})
.then(function(){
- return getWWWDirAndStartPageFromConfigForApp(appName);
+ return getAppEntry(appName);
})
- .then(function(startLocationAndWWWLocation){
- startLocation = startLocationAndWWWLocation.startLocation;
- var promises = [];
- for (var i = preLaunchHooks.length - 1; i >= 0; i--) {
- promises.push(preLaunchHooks[i](appName, startLocationAndWWWLocation.platformWWWLocation));
- }
- return Q.all(promises);
+ .then(function(_appEntry){
+ appEntry = _appEntry;
+ return getAppPathsForAppEntry(appEntry);
+ })
+ .then(function(appPaths){
+ startLocation = appPaths.startLocation;
+ var result = Q.resolve(0 /* dummy value to set up chain */);
+ preLaunchHooks.forEach(function (currHook) {
+ result = result.then(function(){
+ return currHook.handler(appEntry, appPaths.appInstallLocation, appPaths.platformWWWLocation);
+ });
+ });
+ return result;
})
.then(function() {
window.location = startLocation;
@@ -284,14 +311,7 @@
// Assign a default priority
priority = 500;
}
- var i = 0;
- var objToInsert = { "priority" : priority, "handler" : handler };
- for(i = 0; i < downloadHandlers.length; i++){
- if(downloadHandlers[i].priority > objToInsert.priority) {
- break;
- }
- }
- downloadHandlers.splice(i, 0, objToInsert);
+ insertObjectAtPriority(downloadHandlers, handler, priority);
},
registerPackageHandler : function(extension, handler) {
@@ -320,11 +340,15 @@
return Object.keys(extensionHandlers);
},
- addPreLaunchHook : function(handler){
+ addPreLaunchHook : function(handler, priority){
if(!handler || typeof(handler) !== "function") {
throw new Error("Expected (QPromise or void) function(appName, wwwLocation) for handler");
}
- preLaunchHooks.push(handler);
+ if(!priority) {
+ // Assign a default priority
+ priority = 500;
+ }
+ insertObjectAtPriority(preLaunchHooks, handler, priority);
}
};
}]);
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/94edf0c1/www/cdvah_js/CdvhPackageHandler.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/CdvhPackageHandler.js b/www/cdvah_js/CdvhPackageHandler.js
index 1ea25ce..edf5245 100644
--- a/www/cdvah_js/CdvhPackageHandler.js
+++ b/www/cdvah_js/CdvhPackageHandler.js
@@ -1,7 +1,7 @@
(function(){
"use strict";
/* global myApp */
- myApp.run(["AppsService", "ResourcesLoader", function(AppsService, ResourcesLoader){
+ myApp.run(["AppsService", "ResourcesLoader", "ContextMenuInjectScript", function(AppsService, ResourcesLoader, ContextMenuInjectScript){
var platformId = cordova.require("cordova/platform").id;
@@ -20,17 +20,9 @@
});
}
- var appendScript = function() {
- console.log("Injecting menu script");
- var contextScript = document.createElement("script");
- contextScript.setAttribute("type","text/javascript");
- contextScript.setAttribute("src", "app-bundle:///cdvah_js/ContextMenu.js");
- document.getElementsByTagName("head")[0].appendChild(contextScript);
- };
-
AppsService.registerPackageHandler("cdvh", {
extractPackageToDirectory : function (fileName, outputDirectory){
- var dataToAppend = "\n(" + appendScript.toString() + ")();";
+ var dataToAppend = "\n(" + ContextMenuInjectScript.toString() + ")();";
var platformDirectory = outputDirectory + "/" + platformId + "/www/";
var cordovaFile = platformDirectory + "cordova.js";
var pluginsFile = platformDirectory + "cordova_plugins.json";
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/94edf0c1/www/cdvah_js/ContextMenu.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/ContextMenu.js b/www/cdvah_js/ContextMenu.js
index 8854480..452f656 100644
--- a/www/cdvah_js/ContextMenu.js
+++ b/www/cdvah_js/ContextMenu.js
@@ -1,65 +1,79 @@
(function () {
function initialise() {
- var contextHTMLUrl = "app-bundle:///cdvah_contextMenu.html";
- var xhr = new window.XMLHttpRequest();
- xhr.onreadystatechange=function()
- {
- if (xhr.readyState==4 && xhr.status==200)
- {
- var stringifiedHtml = xhr.responseText;
- onInject(stringifiedHtml);
- }
- };
- // retrieve the context menu
- xhr.open("GET", contextHTMLUrl, true);
- xhr.send();
-
+ setupIframe();
+ setupIframeMessaging();
loadFirebug(false);
attachErrorListener();
}
- function onInject(stringifiedHtml) {
-
- document.body.innerHTML += stringifiedHtml;
-
- var contextDiv = "__cordovaappharness_contextMenu_div";
- var showFirebugButton = "__cordovaappharness_contextMenu_firebug_button";
-
+ var contextMenuIframe = "__cordovaappharness_contextMenu_iframe";
+ function setupIframe(){
+ var contextHTMLUrl = "app-bundle:///cdvah_contextMenu.html";
+ var el = document.createElement("iframe");
+ el.setAttribute("id", contextMenuIframe);
+ el.setAttribute("src", contextHTMLUrl);
+ el.setAttribute("style", "position: fixed; left : 0px; top : 0px; z-index: 2000; width: 100%; height: 100%; display : none;");
+ document.body.appendChild(el);
// Setup the listeners to toggle the context menu
document.addEventListener("touchmove", function (event) {
if(event.touches.length >= 3) {
- document.getElementById(contextDiv).style.display = "inline";
+ document.getElementById(contextMenuIframe).style.display = "inline";
}
}, false);
+ }
- document.getElementById(contextDiv).onclick = function() {
- document.getElementById(contextDiv).style.display = "none";
- };
- var firstTime = true;
- document.getElementById(showFirebugButton).onclick = function(){
- try {
- if(firstTime){
- console.warn("Note that messages logged to the console at the app startup may not be visible here.");
- console.warn("Do not use the close button on Firebug. Your console logs will be cleared. Use minimize instead.");
- firstTime = false;
- }
- window.Firebug.chrome.open();
- } catch(e) {
- // hack - FirebugLite appears to have several bugs. One of which is - open firebug, user shuts down FirebugLite through the UI.
- // FirebugLite is now in a bad state of neither being usable or removable. Any calls to open throw an error.
- // The following lines removes the flags that FirebugLite looks for manually and makes it think it has not loaded it yet
- // Then FirebugLite is loaded into the page again
- // This hack should be revisited when FirebugLite moves from version 1.4
- // Either the hack won't be needed anymore or the hack should be checked too see if it still works.
- var el = document.getElementById("FirebugLite");
- if(el) {
- el.setAttribute("id", "");
- }
- delete console.firebuglite;
- loadFirebug(true);
+ function setupIframeMessaging(){
+ window.addEventListener("message", function(e){
+ if(e.data === "ContextMenuUpdate"){
+ onContextMenuUpdateClicked();
+ } else if(e.data === "ContextMenuRestart"){
+ onContextMenuRestartClicked();
+ } else if(e.data === "ContextMenuFirebug"){
+ onContextMenuFirebugClicked();
+ } else if(e.data === "ContextMenuMainMenu"){
+ onContextMenuMainMenuClicked();
+ }else if(e.data === "ContextMenuHide"){
+ onContextMenuHideClicked();
}
- };
+ } , false);
+ }
+
+ function onContextMenuUpdateClicked(){
+ window.location = "app-bundle:///cdvah_index.html#/?updateLastLaunched=true";
+ }
+ function onContextMenuRestartClicked(){
+ window.location = "app-bundle:///cdvah_index.html#/?lastLaunched=true";
+ }
+ var firebugFirstOpen = true;
+ function onContextMenuFirebugClicked(){
+ try {
+ if(firebugFirstOpen){
+ console.warn("Note that messages logged to the console at the app startup may not be visible here.");
+ console.warn("Do not use the close button on Firebug. Your console logs will be cleared. Use minimize instead.");
+ firebugFirstOpen = false;
+ }
+ window.Firebug.chrome.open();
+ } catch(e) {
+ // hack - FirebugLite appears to have several bugs. One of which is - open firebug, user shuts down FirebugLite through the UI.
+ // FirebugLite is now in a bad state of neither being usable or removable. Any calls to open throw an error.
+ // The following lines removes the flags that FirebugLite looks for manually and makes it think it has not loaded it yet
+ // Then FirebugLite is loaded into the page again
+ // This hack should be revisited when FirebugLite moves from version 1.4
+ // Either the hack won't be needed anymore or the hack should be checked too see if it still works.
+ var el = document.getElementById("FirebugLite");
+ if(el) {
+ el.setAttribute("id", "");
+ }
+ delete console.firebuglite;
+ loadFirebug(true);
+ }
+ }
+ function onContextMenuMainMenuClicked(){
+ window.location = "app-bundle:///cdvah_index.html";
+ }
+ function onContextMenuHideClicked(){
+ document.getElementById(contextMenuIframe).style.display = "none";
}
function loadFirebug(startOpened){
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/94edf0c1/www/cdvah_js/ContextMenuInjectScript.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/ContextMenuInjectScript.js b/www/cdvah_js/ContextMenuInjectScript.js
new file mode 100644
index 0000000..7525b70
--- /dev/null
+++ b/www/cdvah_js/ContextMenuInjectScript.js
@@ -0,0 +1,13 @@
+(function() {
+ "use strict";
+ /* global myApp */
+ myApp.factory("ContextMenuInjectScript", [ function () {
+ return function() {
+ console.log("Injecting menu script");
+ var contextScript = document.createElement("script");
+ contextScript.setAttribute("type","text/javascript");
+ contextScript.setAttribute("src", "app-bundle:///cdvah_js/ContextMenu.js");
+ document.getElementsByTagName("head")[0].appendChild(contextScript);
+ };
+ }]);
+})();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/94edf0c1/www/cdvah_js/ResourcesLoader.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/ResourcesLoader.js b/www/cdvah_js/ResourcesLoader.js
index e1df6db..b1e55ee 100644
--- a/www/cdvah_js/ResourcesLoader.js
+++ b/www/cdvah_js/ResourcesLoader.js
@@ -426,9 +426,7 @@
}
},
- xhrGet : function(url) {
- return xhrGet(url);
- }
+ xhrGet : xhrGet
};
}]);
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/94edf0c1/www/cdvah_js/ServeCordovaJSHandler.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/ServeCordovaJSHandler.js b/www/cdvah_js/ServeCordovaJSHandler.js
new file mode 100644
index 0000000..0154c64
--- /dev/null
+++ b/www/cdvah_js/ServeCordovaJSHandler.js
@@ -0,0 +1,25 @@
+(function(){
+ "use strict";
+ /* global myApp */
+ myApp.run(["AppsService", "ResourcesLoader", "ContextMenuInjectScript", function(AppsService, ResourcesLoader, ContextMenuInjectScript){
+
+ AppsService.addPreLaunchHook(function(appEntry, appInstallLocation , wwwLocation) {
+ if(appEntry.Source === "serve"){
+ return Q.fcall(function(){
+ // We can't inject the context menu script into cordova.js remotely
+ // So we create a local copy of the cordova.js used by the server,
+ // append the context menu script (requests for cordova.js are routed to it)
+ wwwLocation += (wwwLocation.charAt(wwwLocation.length - 1) === "/")? "" : "/";
+ var cordovaJSPath = wwwLocation + "cordova.js";
+ return ResourcesLoader.xhrGet(cordovaJSPath);
+ })
+ .then(function(xhr){
+ var dataToAppend = "\n(" + ContextMenuInjectScript.toString() + ")();";
+ var completeText = xhr.responseText + dataToAppend;
+ appInstallLocation += (appInstallLocation.charAt(appInstallLocation.length - 1) === "/")? "" : "/";
+ return ResourcesLoader.writeFileContents(appInstallLocation + "cordova.js", completeText);
+ });
+ }
+ }, 250 /* Give it a priority */);
+ }]);
+})();
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/94edf0c1/www/cdvah_views/add.html
----------------------------------------------------------------------
diff --git a/www/cdvah_views/add.html b/www/cdvah_views/add.html
index af318b8..77778e6 100644
--- a/www/cdvah_views/add.html
+++ b/www/cdvah_views/add.html
@@ -1,23 +1,23 @@
<form name="addForm" ng-controller="AddCtrl">
<label for="inputAppName">Enter the App Name</label><br />
- <input type="text" name="appName" ng-model="appName" ng-pattern="/^[\w ]*$/" ng-maxlength="64" required />
+ <input type="text" name="appName" ng-model="appData.appName" ng-pattern="/^[\w ]*$/" ng-maxlength="64" required />
<span ng-show="addForm.appName.$error.required">Required</span>
<span ng-show="addForm.appName.$error.pattern">Invalid characters used</span>
<span ng-show="addForm.appName.$error.maxlength">Too long</span>
<br />
- <input type="radio" ng-model="appSource" name="appSource" value="pattern" ng-init="appSource='pattern'" ng-checked="appSource=='pattern'" />
+ <input type="radio" ng-model="appData.appSource" name="appSource" value="pattern" ng-checked="appData.appSource=='pattern'" />
<label for="inputAppPattern">Enter the URL to a file</label><br />
- <input id="inputAppPattern" type="text" name="appSourcePattern" ng-model="appSourcePattern" ng-disabled="appSource!='pattern'" ng-required="appSource=='pattern'" />
+ <input id="inputAppPattern" type="text" name="appSourcePattern" ng-model="appData.appSourcePattern" ng-disabled="appData.appSource!='pattern'" ng-required="appSource=='pattern'" />
<span ng-show="addForm.appSourcePattern.$error.required">Required</span>
<br />
- <input type="radio" ng-model="appSource" name="appSource" value="serve" ng-checked="appSource=='serve'" />
+ <input type="radio" ng-model="appData.appSource" name="appSource" value="serve" ng-checked="appData.appSource=='serve'" />
<label for="inputAppServe">Enter the URL to the server hosting the app</label><br />
- <input id="inputAppServe" type="text" name="appSourceServe" ng-model="appSourceServe" ng-disabled="appSource!='serve'" ng-pattern="/.*\/config.xml(\?.*|#.*)?$/" ng-required="appSource=='serve'" />
+ <input id="inputAppServe" type="text" name="appSourceServe" ng-model="appData.appSourceServe" ng-disabled="appData.appSource!='serve'" ng-pattern="/.*\/config.xml(\?.*|#.*)?$/" ng-required="appSource=='serve'" />
<span ng-show="addForm.appSourceServe.$error.required">Required</span>
<span ng-show="addForm.appSourceServe.$error.pattern">Url must point to a config.xml file</span>
<br />
- <button ng-click="addApp(appName, appSource, appSourcePattern, appSourceServe)" ng-disabled="!(addForm.$valid)">Add</button>
+ <button ng-click="addApp()" ng-disabled="!(addForm.$valid)">Add</button>
<br />
<a href="#/">Back To Main Menu</a>
</form>
\ No newline at end of file
[13/30] git commit: New filenames.Url aliases.(New AppBundle plugin
needed).Desc cont below Android has a bug where the web view will not throw
intercept events if you are navigating to a location that matches a filename
in your bundle. Thus in order to
Posted by ag...@apache.org.
New filenames.Url aliases.(New AppBundle plugin needed).Desc cont below
Android has a bug where the web view will not throw intercept events if you are navigating to a location that matches a filename in your bundle. Thus in order to support url aliasing, we need to ensure there is no collision of the running app's(the app running in the harness) filenames and the app harness file names.
Added pre launch hooks that so we can attach things to do before launching an app.
Url Aliasing - support for using bundle directories Eg:"file:///android_asset/www/index.html" in your app.
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/771f02b2
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/771f02b2
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/771f02b2
Branch: refs/heads/master
Commit: 771f02b25dea717fbfb2009cc5c2ec9012a52478
Parents: eba56cc
Author: Shravan Narayan <sh...@google.com>
Authored: Tue May 7 19:02:01 2013 -0400
Committer: Shravan Narayan <sh...@google.com>
Committed: Tue May 7 19:23:33 2013 -0400
----------------------------------------------------------------------
.jshintignore | 2 +-
checkjs | 2 +-
packapp | 2 +-
www/cdvah_contextMenu.html | 53 ++++
www/cdvah_index.html | 20 ++
www/cdvah_js/AddCtrl.js | 24 ++
www/cdvah_js/AppBundleAlias.js | 36 +++
www/cdvah_js/AppConstants.js | 12 +
www/cdvah_js/AppsService.js | 276 +++++++++++++++++
www/cdvah_js/CdvhPackageHandler.js | 60 ++++
www/cdvah_js/ContextMenu.js | 83 +++++
www/cdvah_js/KnownExtensionDownloader.js | 43 +++
www/cdvah_js/ListCtrl.js | 117 +++++++
www/cdvah_js/ResourcesLoader.js | 404 +++++++++++++++++++++++++
www/cdvah_js/app.js | 11 +
www/cdvah_js/libs/angular.min.js | 173 +++++++++++
www/cdvah_js/libs/q.min.js | 19 ++
www/cdvah_views/add.html | 17 +
www/cdvah_views/list.html | 12 +
www/contextMenu.html | 53 ----
www/index.html | 19 --
www/js/AddCtrl.js | 24 --
www/js/AppConstants.js | 12 -
www/js/AppsService.js | 253 ----------------
www/js/CdvhPackageHandler.js | 60 ----
www/js/ContextMenu.js | 84 -----
www/js/KnownExtensionDownloader.js | 43 ---
www/js/ListCtrl.js | 94 ------
www/js/ResourcesLoader.js | 404 -------------------------
www/js/app.js | 11 -
www/js/libs/angular.min.js | 173 -----------
www/js/libs/q.min.js | 19 --
www/views/add.html | 17 -
www/views/list.html | 12 -
34 files changed, 1363 insertions(+), 1281 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/.jshintignore
----------------------------------------------------------------------
diff --git a/.jshintignore b/.jshintignore
index e491595..4e6ee77 100644
--- a/.jshintignore
+++ b/.jshintignore
@@ -1 +1 @@
-www/js/libs/*
\ No newline at end of file
+www/cdvah_js/libs/*
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/checkjs
----------------------------------------------------------------------
diff --git a/checkjs b/checkjs
index 200d824..b62fa32 100755
--- a/checkjs
+++ b/checkjs
@@ -22,4 +22,4 @@
# ./checkjs
#
echo "Running jsHint"
-jshint www/js/ --verbose --show-non-errors
+jshint www/cdvah_js/ --verbose --show-non-errors
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/packapp
----------------------------------------------------------------------
diff --git a/packapp b/packapp
index dd1202c..74dd08f 100755
--- a/packapp
+++ b/packapp
@@ -81,4 +81,4 @@ fi
cd packtempDir
zip -r $ORIG_DIR/$FILE_NAME android ios >/dev/null
cd ..
-# rm -rf packtempDir
\ No newline at end of file
+rm -rf packtempDir
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/cdvah_contextMenu.html
----------------------------------------------------------------------
diff --git a/www/cdvah_contextMenu.html b/www/cdvah_contextMenu.html
new file mode 100644
index 0000000..8f515c9
--- /dev/null
+++ b/www/cdvah_contextMenu.html
@@ -0,0 +1,53 @@
+<!-- Keep stylesheet as a part of the html as this file gets injected into the app -->
+<style>
+#__cordovaappharness_contextMenu_div
+{
+ position: fixed;
+ left : 0px;
+ top : 0px;
+ z-index: 2000;
+ background-color:rgba(0,0,0,0.75);
+ width: 100%;
+ height: 100%;
+ display: none;
+}
+#__cordovaappharness_contextMenu_div p
+{
+ color: white;
+ text-align: center;
+}
+#__cordovaappharness_contextMenu_div ul
+{
+ list-style-type: none;
+ margin-left: 20%;
+ margin-right: 20%;
+ padding: 0;
+ width: 60%;
+}
+#__cordovaappharness_contextMenu_div li
+{
+ margin-bottom: 0.5cm;
+}
+#__cordovaappharness_contextMenu_div li, #__cordovaappharness_contextMenu_div button
+{
+ width: 100%;
+ height: 1cm;
+}
+</style>
+<div id="__cordovaappharness_contextMenu_div">
+ <p>Tap Anywhere to Close</p>
+ <ul>
+ <li>
+ <a href="app-bundle:///cdvah_index.html#/?updateLastLaunched=true"><button>Update</button></a>
+ </li>
+ <li>
+ <a href="app-bundle:///cdvah_index.html#/?lastLaunched=true"><button>Restart</button></a>
+ </li>
+ <li>
+ <button id="__cordovaappharness_contextMenu_firebug_button">Firebug</button>
+ </li>
+ <li>
+ <a href="app-bundle:///cdvah_index.html"><button>Back to Main Menu</button></a>
+ </li>
+ </ul>
+</div>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/cdvah_index.html
----------------------------------------------------------------------
diff --git a/www/cdvah_index.html b/www/cdvah_index.html
new file mode 100644
index 0000000..b33fe29
--- /dev/null
+++ b/www/cdvah_index.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Cordova App Harness</title>
+ <script type="text/javascript" src="cordova.js"></script>
+ <script type="text/javascript" src="cdvah_js/libs/q.min.js"></script>
+ <script type="text/javascript" src="cdvah_js/libs/angular.min.js"></script>
+ <script type="text/javascript" src="cdvah_js/app.js"></script>
+ <script type="text/javascript" src="cdvah_js/AppConstants.js"></script>
+ <script type="text/javascript" src="cdvah_js/ResourcesLoader.js"></script>
+ <script type="text/javascript" src="cdvah_js/AppsService.js"></script>
+ <script type="text/javascript" src="cdvah_js/AppBundleAlias.js"></script>
+ <script type="text/javascript" src="cdvah_js/KnownExtensionDownloader.js"></script>
+ <script type="text/javascript" src="cdvah_js/CdvhPackageHandler.js"></script>
+ <script type="text/javascript" src="cdvah_js/ListCtrl.js"></script>
+ <script type="text/javascript" src="cdvah_js/AddCtrl.js"></script>
+ </head>
+ <body ng-app="CordovaAppHarness" ng-view>
+ </body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/cdvah_js/AddCtrl.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/AddCtrl.js b/www/cdvah_js/AddCtrl.js
new file mode 100644
index 0000000..09a1c50
--- /dev/null
+++ b/www/cdvah_js/AddCtrl.js
@@ -0,0 +1,24 @@
+(function(){
+ "use strict";
+ /* global myApp */
+ myApp.controller("AddCtrl", ["$scope", "AppsService", function ($scope, AppsService) {
+
+ $scope.addApp = function(appName, appSource, appSourcePattern) {
+ if(appSource === "pattern") {
+ if(!appSourcePattern) {
+ alert("Url not specified");
+ return;
+ }
+
+ AppsService.addAppFromPattern(appName, appSourcePattern)
+ .then(function() {
+ alert("Successfully installed");
+ }, function(error) {
+ console.error(error);
+ alert("Unable to add application because: \n" + JSON.stringify(error));
+ });
+ }
+ };
+ }]);
+
+})();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/cdvah_js/AppBundleAlias.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/AppBundleAlias.js b/www/cdvah_js/AppBundleAlias.js
new file mode 100644
index 0000000..1bdfbf8
--- /dev/null
+++ b/www/cdvah_js/AppBundleAlias.js
@@ -0,0 +1,36 @@
+(function(){
+ "use strict";
+ /* global myApp */
+ myApp.run(["AppsService", function(AppsService){
+
+ // URI aliasing : the ability to launch an app in the harness, query the document.location and get the same location as would have been got if you run the app separately
+ // Without URI aliasing, document.location in the harness would give something like file:///APP_HARNESS_INSTALLED_APPS_LOCATION/www/index.html
+
+ function aliasUri(sourceUriMatchRegex, sourceUriReplaceRegex, replaceString, redirectToReplacedUrl){
+ var deferred = Q.defer();
+ var appBundle = cordova.require("AppBundle.AppBundle");
+ try {
+ appBundle.addAlias(sourceUriMatchRegex, sourceUriReplaceRegex, replaceString, redirectToReplacedUrl, function(succeded){
+ if(succeded){
+ deferred.resolve();
+ } else {
+ deferred.reject(new Error("Unable to set up uri aliasing"));
+ }
+ });
+ } catch(e) {
+ deferred.reject(new Error(e));
+ } finally {
+ return deferred.promise;
+ }
+ }
+
+ AppsService.addPreLaunchHook(function(appName, wwwLocation) {
+ console.log("Adding aliases for " + appName);
+ wwwLocation += (wwwLocation.charAt(wwwLocation.length - 1) === "/")? "" : "/";
+ wwwLocation = (wwwLocation.indexOf("file://") === 0) ? wwwLocation : "file://" + wwwLocation;
+ //Make any direct references to the bundle paths such as file:///android_asset point to the installed location without redirecting
+ //{BUNDLE_WWW} in the regex is automatically replaced by the appBundle component
+ return aliasUri("^{BUNDLE_WWW}.*", "^{BUNDLE_WWW}", wwwLocation, false /* redirect */);
+ });
+ }]);
+})();
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/cdvah_js/AppConstants.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/AppConstants.js b/www/cdvah_js/AppConstants.js
new file mode 100644
index 0000000..81f8b4d
--- /dev/null
+++ b/www/cdvah_js/AppConstants.js
@@ -0,0 +1,12 @@
+(function() {
+ var TEMP_DIRECTORY = "cordova_app_harness_tempDir/";
+ var INSTALL_DIRECTORY = "cordova_app_harness_installed_apps/";
+ var APPS_JSON = "cordova_app_harness_installed_apps/apps.json";
+ var METADATA_JSON = "cordova_app_harness_installed_apps/metadata.json";
+
+ /* global myApp */
+ myApp.value("TEMP_DIRECTORY", TEMP_DIRECTORY);
+ myApp.value("INSTALL_DIRECTORY", INSTALL_DIRECTORY);
+ myApp.value("APPS_JSON", APPS_JSON);
+ myApp.value("METADATA_JSON", METADATA_JSON);
+})();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/cdvah_js/AppsService.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/AppsService.js b/www/cdvah_js/AppsService.js
new file mode 100644
index 0000000..f961cc9
--- /dev/null
+++ b/www/cdvah_js/AppsService.js
@@ -0,0 +1,276 @@
+(function() {
+ "use strict";
+ /* global myApp */
+ myApp.factory("AppsService", [ "ResourcesLoader", "INSTALL_DIRECTORY", "TEMP_DIRECTORY", "APPS_JSON", "METADATA_JSON", function(ResourcesLoader, INSTALL_DIRECTORY, TEMP_DIRECTORY, APPS_JSON, METADATA_JSON) {
+
+ var platformId = cordova.require("cordova/platform").id;
+ // downloaders that know how to download from certain patterns.
+ // Eg: The KnownExtensionDownloader MAY know how to download from any uri's that end in known extensions
+ var downloadHandlers = [];
+ // handlers that have registered to unpack certain extensions during the installation of an app
+ var extensionHandlers = {};
+ // functions to run before launching an app
+ var preLaunchHooks = [];
+
+ function grabExtensionFromUri(uri) {
+ var lastSegment = uri.split("#")[0].split("?")[0].split("/").pop();
+ var dotLocation = lastSegment.lastIndexOf(".");
+ var extension = (dotLocation !== -1)? lastSegment.substring(dotLocation + 1) : "";
+ return extension;
+ }
+
+ function addNewAppFromPattern(appName, appSourcePattern) {
+ var _fullFilePath;
+
+ return ResourcesLoader.deleteDirectory(INSTALL_DIRECTORY + appName)
+ .then(function(){
+ for(var i = 0; i < downloadHandlers.length; i++){
+ if(downloadHandlers[i].handler.canHandleSourcePattern(appSourcePattern)){
+ return downloadHandlers[i].handler.downloadFromPattern(appName, appSourcePattern, TEMP_DIRECTORY);
+ }
+ }
+ throw new Error("App Harness does not know how to install an app from the pattern: " + appSourcePattern);
+ })
+ .then(function(fullFilePath){
+ _fullFilePath = fullFilePath;
+ return ResourcesLoader.ensureDirectoryExists(INSTALL_DIRECTORY + appName);
+ })
+ .then(function(directoryPath){
+ var extension = grabExtensionFromUri(appSourcePattern);
+ if(!extensionHandlers[extension]) {
+ throw new Error("No handler for extension " + extension + " found");
+ }
+ return extensionHandlers[extension].extractPackageToDirectory(_fullFilePath, directoryPath);
+ })
+ .then(function(){
+ return registerApp(appName, "pattern", appSourcePattern);
+ });
+ }
+
+ function registerApp(appName, appSource, appSourcePattern) {
+ return ResourcesLoader.readJSONFileContents(APPS_JSON)
+ .then(function(result){
+ result.installedApps = result.installedApps || [];
+ result.installedApps.push({
+ "Name" : appName,
+ "Source" : appSource,
+ "Data" : appSourcePattern,
+ "Installed" : (new Date()).toLocaleString()
+ });
+ return ResourcesLoader.writeJSONFileContents(APPS_JSON, result);
+ });
+ }
+
+ function cleanPath(path){
+ if(path.indexOf("file://") === 0){
+ path = path.substring("file://".length);
+ }
+ // remove trailing slash
+ return (path.substring(path.length - 1) === "/") ? path.substring(0, path.length - 1) : path;
+ }
+
+ function isPathAbsolute(path){
+ return (path.match(/^[a-zA-Z0-9]+:/) != null);
+ }
+
+ function getAppStartPageFromConfig(configFile, appBaseDirectory) {
+ configFile = cleanPath(configFile);
+ appBaseDirectory = "file://" + cleanPath(appBaseDirectory);
+
+ return ResourcesLoader.readFileContents(configFile)
+ .then(function(contents){
+ if(!contents) {
+ throw new Error("Config file is empty. Unable to find a start page for your app.");
+ } else {
+ var startLocation = appBaseDirectory + "/index.html";
+ var parser = new DOMParser();
+ var xmlDoc = parser.parseFromString(contents, "text/xml");
+ var els = xmlDoc.getElementsByTagName("content");
+
+ if(els.length > 0) {
+ // go through all "content" elements looking for the "src" attribute in reverse order
+ for(var i = els.length - 1; i >= 0; i--) {
+ var el = els[i];
+ var srcValue = el.getAttribute("src");
+ if(srcValue) {
+ if(isPathAbsolute(srcValue)) {
+ startLocation = srcValue;
+ } else {
+ srcValue = srcValue.charAt(0) === "/" ? srcValue.substring(1) : srcValue;
+ startLocation = appBaseDirectory + "/" + srcValue;
+ }
+ break;
+ }
+ }
+ }
+
+ return startLocation;
+ }
+ });
+ }
+
+ function removeApp(appName){
+ var entry;
+ return ResourcesLoader.ensureDirectoryExists(APPS_JSON)
+ .then(function() {
+ return ResourcesLoader.readJSONFileContents(APPS_JSON);
+ })
+ .then(function(result){
+ result.installedApps = result.installedApps || [];
+
+ for(var i = 0; i < result.installedApps.length; i++){
+ if(result.installedApps[i].Name === appName) {
+ entry = result.installedApps.splice(i, 1)[0];
+ break;
+ }
+ }
+
+ if(!entry) {
+ throw new Error("The app " + appName + " was not found.");
+ }
+
+ return ResourcesLoader.writeJSONFileContents(APPS_JSON, result);
+ })
+ .then(function(){
+ return ResourcesLoader.deleteDirectory(INSTALL_DIRECTORY + appName);
+ })
+ .then(function(){
+ return entry;
+ });
+ }
+
+ return {
+ //return promise with the array of apps
+ getAppsList : function(getFullEntries) {
+ return ResourcesLoader.ensureDirectoryExists(APPS_JSON)
+ .then(function() {
+ return ResourcesLoader.readJSONFileContents(APPS_JSON);
+ })
+ .then(function(result){
+ result.installedApps = result.installedApps || [];
+ var newAppsList = [];
+
+ for(var i = 0; i < result.installedApps.length; i++){
+ if(getFullEntries) {
+ newAppsList.push(result.installedApps[i]);
+ } else {
+ newAppsList.push(result.installedApps[i].Name);
+ }
+ }
+
+ return newAppsList;
+ });
+ },
+
+ launchApp : function(appName) {
+ var platformWWWLocation;
+ var startLocation;
+ return ResourcesLoader.readJSONFileContents(METADATA_JSON)
+ .then(function(settings){
+ settings = settings || {};
+ settings.lastLaunched = appName;
+ return ResourcesLoader.writeJSONFileContents(METADATA_JSON, settings);
+ })
+ .then(function(){
+ return ResourcesLoader.getFullFilePath(INSTALL_DIRECTORY + appName + "/" + platformId);
+ })
+ .then(function(platformLocation){
+ platformWWWLocation = platformLocation + "/www/";
+ return getAppStartPageFromConfig(platformLocation + "/config.xml", platformWWWLocation);
+ })
+ .then(function(_startLocation){
+ startLocation = _startLocation;
+ var promises = [];
+ for (var i = preLaunchHooks.length - 1; i >= 0; i--) {
+ promises.push(preLaunchHooks[i](appName, platformWWWLocation));
+ }
+ return Q.all(promises);
+ })
+ .then(function() {
+ window.location = startLocation;
+ });
+ },
+
+ addAppFromPattern : function(appName, appSourcePattern) {
+ return this.getAppsList(false /* App names only */)
+ .then(function(appsList){
+ if(appsList.indexOf(appName) !== -1) {
+ throw new Error("An app with this name already exists");
+ }
+ return addNewAppFromPattern(appName, appSourcePattern);
+ });
+ },
+
+ uninstallApp : function(appName) {
+ return removeApp(appName);
+ },
+
+ getLastRunApp : function() {
+ return ResourcesLoader.readJSONFileContents(METADATA_JSON)
+ .then(function(settings){
+ if(!settings || !settings.lastLaunched) {
+ throw new Error("No App has been launched yet");
+ }
+ return settings.lastLaunched;
+ });
+ },
+
+ registerPatternDownloader : function(handler, priority){
+ if(!handler) {
+ throw new Error("Expected handler");
+ }
+ if(typeof(handler.canHandleSourcePattern) !== "function") {
+ throw new Error("Expected function for bool handler.canHandleSourcePattern(string pattern) to exist");
+ }
+ if(typeof(handler.downloadFromPattern) !== "function") {
+ throw new Error("Expected function for (string fullFilePath or QPromise) handler.downloadFromPattern(string appName, string pattern, string tempDirectory) to exist");
+ }
+ if(!priority) {
+ // Assign a default priority
+ priority = 500;
+ }
+ var i = 0;
+ var objToInsert = { "priority" : priority, "handler" : handler };
+ for(i = 0; i < downloadHandlers.length; i++){
+ if(downloadHandlers[i].priority > objToInsert.priority) {
+ break;
+ }
+ }
+ downloadHandlers.splice(i, 0, objToInsert);
+ },
+
+ registerPackageHandler : function(extension, handler) {
+ if(!extension) {
+ throw new Error("Expcted extension");
+ }
+ if(!handler || typeof(handler.extractPackageToDirectory) !== "function") {
+ throw new Error("Expected function for void handler.extractPackageToDirectory(string fullFilePath, string directoryPath) to exist");
+ }
+ if(handler[extension]) {
+ throw new Error("Handler already exists for the extension: " + extension);
+ }
+ extensionHandlers[extension] = handler;
+ },
+
+ updateApp : function(appName){
+ return removeApp(appName)
+ .then(function(entry){
+ if(entry.Source === "pattern") {
+ return addNewAppFromPattern(entry.Name, entry.Data);
+ }
+ });
+ },
+
+ getKnownExtensions : function() {
+ return Object.keys(extensionHandlers);
+ },
+
+ addPreLaunchHook : function(handler){
+ if(!handler || typeof(handler) !== "function") {
+ throw new Error("Expected (QPromise or void) function(appName, wwwLocation) for handler");
+ }
+ preLaunchHooks.push(handler);
+ }
+ };
+ }]);
+})();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/cdvah_js/CdvhPackageHandler.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/CdvhPackageHandler.js b/www/cdvah_js/CdvhPackageHandler.js
new file mode 100644
index 0000000..1ea25ce
--- /dev/null
+++ b/www/cdvah_js/CdvhPackageHandler.js
@@ -0,0 +1,60 @@
+(function(){
+ "use strict";
+ /* global myApp */
+ myApp.run(["AppsService", "ResourcesLoader", function(AppsService, ResourcesLoader){
+
+ var platformId = cordova.require("cordova/platform").id;
+
+ function copyFile(startUrl, targetLocation){
+ /************ Begin Work around for File system bug ************/
+ if(targetLocation.indexOf("file://") === 0) {
+ targetLocation = targetLocation.substring("file://".length);
+ }
+ /************ End Work around for File system bug **************/
+ return ResourcesLoader.xhrGet(startUrl)
+ .then(function(xhr){
+ return ResourcesLoader.ensureDirectoryExists(targetLocation)
+ .then(function(){
+ return ResourcesLoader.writeFileContents(targetLocation, xhr.responseText);
+ });
+ });
+ }
+
+ var appendScript = function() {
+ console.log("Injecting menu script");
+ var contextScript = document.createElement("script");
+ contextScript.setAttribute("type","text/javascript");
+ contextScript.setAttribute("src", "app-bundle:///cdvah_js/ContextMenu.js");
+ document.getElementsByTagName("head")[0].appendChild(contextScript);
+ };
+
+ AppsService.registerPackageHandler("cdvh", {
+ extractPackageToDirectory : function (fileName, outputDirectory){
+ var dataToAppend = "\n(" + appendScript.toString() + ")();";
+ var platformDirectory = outputDirectory + "/" + platformId + "/www/";
+ var cordovaFile = platformDirectory + "cordova.js";
+ var pluginsFile = platformDirectory + "cordova_plugins.json";
+
+ // We need to
+ // 1) Modify the cordova.js file
+ // 2) Copy the cordova_plugins.json we have, as the app that is being installed may have other plugins included which aren't in the harness.
+ // If we allow unavailable plugins to be included in this file, the plugin initialiser breaks
+ return ResourcesLoader.extractZipFile(fileName, outputDirectory)
+ .then(function(){
+ return ResourcesLoader.doesFileExist(cordovaFile);
+ })
+ .then(function(fileExists){
+ if(fileExists){
+ return Q.all([
+ ResourcesLoader.appendFileContents(cordovaFile, dataToAppend),
+ copyFile("app-bundle:///cdvh_files/www/cordova_plugins.json", pluginsFile)
+ ]);
+ } else {
+ throw new Error("The package does not seem to have the files required for the platform: " + platformId);
+ }
+ });
+ }
+ });
+
+ }]);
+})();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/cdvah_js/ContextMenu.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/ContextMenu.js b/www/cdvah_js/ContextMenu.js
new file mode 100644
index 0000000..8854480
--- /dev/null
+++ b/www/cdvah_js/ContextMenu.js
@@ -0,0 +1,83 @@
+(function () {
+
+ function initialise() {
+ var contextHTMLUrl = "app-bundle:///cdvah_contextMenu.html";
+ var xhr = new window.XMLHttpRequest();
+ xhr.onreadystatechange=function()
+ {
+ if (xhr.readyState==4 && xhr.status==200)
+ {
+ var stringifiedHtml = xhr.responseText;
+ onInject(stringifiedHtml);
+ }
+ };
+ // retrieve the context menu
+ xhr.open("GET", contextHTMLUrl, true);
+ xhr.send();
+
+ loadFirebug(false);
+ attachErrorListener();
+ }
+
+ function onInject(stringifiedHtml) {
+
+ document.body.innerHTML += stringifiedHtml;
+
+ var contextDiv = "__cordovaappharness_contextMenu_div";
+ var showFirebugButton = "__cordovaappharness_contextMenu_firebug_button";
+
+ // Setup the listeners to toggle the context menu
+ document.addEventListener("touchmove", function (event) {
+ if(event.touches.length >= 3) {
+ document.getElementById(contextDiv).style.display = "inline";
+ }
+ }, false);
+
+ document.getElementById(contextDiv).onclick = function() {
+ document.getElementById(contextDiv).style.display = "none";
+ };
+ var firstTime = true;
+ document.getElementById(showFirebugButton).onclick = function(){
+ try {
+ if(firstTime){
+ console.warn("Note that messages logged to the console at the app startup may not be visible here.");
+ console.warn("Do not use the close button on Firebug. Your console logs will be cleared. Use minimize instead.");
+ firstTime = false;
+ }
+ window.Firebug.chrome.open();
+ } catch(e) {
+ // hack - FirebugLite appears to have several bugs. One of which is - open firebug, user shuts down FirebugLite through the UI.
+ // FirebugLite is now in a bad state of neither being usable or removable. Any calls to open throw an error.
+ // The following lines removes the flags that FirebugLite looks for manually and makes it think it has not loaded it yet
+ // Then FirebugLite is loaded into the page again
+ // This hack should be revisited when FirebugLite moves from version 1.4
+ // Either the hack won't be needed anymore or the hack should be checked too see if it still works.
+ var el = document.getElementById("FirebugLite");
+ if(el) {
+ el.setAttribute("id", "");
+ }
+ delete console.firebuglite;
+ loadFirebug(true);
+ }
+ };
+ }
+
+ function loadFirebug(startOpened){
+ var el = document.createElement("script");
+ el.setAttribute("id", "FirebugLite");
+ el.setAttribute("src", "https://getfirebug.com/firebug-lite.js");
+ el.setAttribute("FirebugLite", "4");
+ el.innerHTML = el.innerHTML = "{ debug : false, startOpened : " + startOpened + ", showIconWhenHidden : false, saveCommandLineHistory : true, saveCookies : false }";
+ document.head.appendChild(el);
+ }
+
+ // FirebugLite doesn't catch errors from window.onerror like desktop browser's dev tools do. So we add it manually.
+ function attachErrorListener(){
+ window.onerror = function(msg, url, line) {
+ console.error("Error: " + msg + " on line: " + line + " in file: " + url);
+ };
+ }
+
+ initialise();
+})();
+
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/cdvah_js/KnownExtensionDownloader.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/KnownExtensionDownloader.js b/www/cdvah_js/KnownExtensionDownloader.js
new file mode 100644
index 0000000..cec413a
--- /dev/null
+++ b/www/cdvah_js/KnownExtensionDownloader.js
@@ -0,0 +1,43 @@
+(function(){
+ "use strict";
+ /* global myApp */
+ myApp.run(["AppsService", "ResourcesLoader", function(AppsService, ResourcesLoader){
+
+ function isUri(pattern){
+ var regexUri = /^(?:([a-z0-9+.-]+:\/\/)((?:(?:[a-z0-9-._~!$&'()*+,;=:]|%[0-9A-F]{2})*)@)?((?:[a-z0-9-._~!$&'()*+,;=]|%[0-9A-F]{2})*)(:(?:\d*))?(\/(?:[a-z0-9-._~!$&'()*+,;=:@\/]|%[0-9A-F]{2})*)?|([a-z0-9+.-]+:)(\/?(?:[a-z0-9-._~!$&'()*+,;=:@]|%[0-9A-F]{2})+(?:[a-z0-9-._~!$&'()*+,;=:@\/]|%[0-9A-F]{2})*)?)(\?(?:[a-z0-9-._~!$&'()*+,;=:\/?@]|%[0-9A-F]{2})*)?(#(?:[a-z0-9-._~!$&'()*+,;=:\/?@]|%[0-9A-F]{2})*)?$/i;
+ var ret = (pattern.search(regexUri) !== -1);
+ return ret;
+ }
+
+ function grabExtensionFromUri(uri) {
+ var lastSegment = uri.split("#")[0].split("?")[0].split("/").pop();
+ var dotLocation = lastSegment.lastIndexOf(".");
+ var extension = (dotLocation !== -1)? lastSegment.substring(dotLocation + 1) : "";
+ return extension;
+ }
+
+ // Note the priority given has no meaning in and of itself. It is used solely to compare if any other component has higher priority.
+ AppsService.registerPatternDownloader({
+ canHandleSourcePattern : function (pattern) {
+ var canHandle = false;
+ if(isUri(pattern)) {
+ var currentExtension = grabExtensionFromUri(pattern);
+ if(currentExtension) {
+ var knownExtensions = AppsService.getKnownExtensions();
+ if(knownExtensions.indexOf(currentExtension) !== -1){
+ canHandle = true;
+ }
+ }
+ }
+ return canHandle;
+ },
+
+ downloadFromPattern : function (appName, pattern, tempDirectory) {
+ var extension = grabExtensionFromUri(pattern);
+ var fileName = tempDirectory + appName + "." + extension;
+ return ResourcesLoader.downloadFromUrl(pattern, fileName);
+ }
+ }, 500 /* assign a priority */);
+
+ }]);
+})();
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/cdvah_js/ListCtrl.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/ListCtrl.js b/www/cdvah_js/ListCtrl.js
new file mode 100644
index 0000000..5dd0794
--- /dev/null
+++ b/www/cdvah_js/ListCtrl.js
@@ -0,0 +1,117 @@
+(function(){
+ "use strict";
+ /* global myApp */
+ myApp.controller("ListCtrl", [ "$scope", "$routeParams", "AppsService", function ($scope, $routeParams, AppsService) {
+
+ $scope.appsList = [];
+
+ function clearAppBundleAliases(){
+ var deferred = Q.defer();
+ var appBundle = cordova.require("AppBundle.AppBundle");
+
+ try {
+ appBundle.clearAllAliases(function(succeded){
+ if(succeded){
+ deferred.resolve();
+ } else {
+ deferred.reject(new Error("Unable to clear old url aliases. Please restart App Harness."));
+ }
+ });
+ } catch(e) {
+ deferred.reject(new Error(e));
+ } finally {
+ return deferred.promise;
+ }
+ }
+
+ function initialise() {
+ //if we are navigating here after running an app, reset any aliases set for the app by app harness or any aliases setup by the previous app
+ return clearAppBundleAliases()
+ .then(function(){
+ if($routeParams.lastLaunched) {
+ return AppsService.getLastRunApp()
+ .then(AppsService.launchApp, function(e){
+ e = e || {};
+ console.error("Error launching last run app: " + e.message);
+ alert("Error launching last run app. Please try again.");
+ });
+ }
+ else if($routeParams.updateLastLaunched) {
+ var app;
+ // updating may take a while so we show the apps list like we normally do
+ return $scope.loadAppsList(true)
+ .then(AppsService.getLastRunApp)
+ .then(function(_app){
+ app = _app;
+ return AppsService.updateApp(app);
+ })
+ .then(function(){
+ return AppsService.launchApp(app);
+ }, function(e){
+ e = e || {};
+ console.error("Error updating last run app: " + e.message);
+ alert("Error updating last run app. Please try again.");
+ });
+ }
+ else {
+ return $scope.loadAppsList(true);
+ }
+ });
+ }
+
+ $scope.loadAppsList = function(callApply) {
+ return AppsService.getAppsList(true /* get full information about the app */)
+ .then(function(newAppsList){
+ newAppsList.sort(function(a, b){
+ if(a.Name < b.Name) {
+ return -1;
+ } else if(a.Name > b.Name) {
+ return 1;
+ }
+ return 0;
+ });
+ //clear the old apps list
+ $scope.appsList.splice(0, $scope.appsList.length);
+ angular.extend($scope.appsList, newAppsList);
+ if(callApply) {
+ $scope.$apply();
+ }
+ }, function(error){
+ var str = "There was an error retrieving the apps list";
+ console.error(str + JSON.stringify(error));
+ alert(str);
+ });
+ };
+
+ $scope.launchApp = function(app){
+ return AppsService.launchApp(app)
+ .then(null, function(error){
+ console.error("Error during loading of app " + app + ": " + error);
+ alert("Something went wrong during the loading of the app. Please try again.");
+ });
+ };
+
+ $scope.updateApp = function(app) {
+ return AppsService.updateApp(app)
+ .then(function(){
+ alert("Updated successfully");
+ }, function(error){
+ console.error("Error during updating of app " + app + ": " + error);
+ alert("Something went wrong during the updating of the app. Please try again.");
+ });
+ };
+
+ $scope.removeApp = function(app) {
+ var shouldUninstall = confirm("Are you sure you want to uninstall " + app + "?");
+ if(shouldUninstall) {
+ return AppsService.uninstallApp(app)
+ .then(function() { $scope.loadAppsList(true); }, function(error){
+ console.error("Error during uninstall of app " + app + ": " + error);
+ alert("Something went wrong during the uninstall of the app. Please try again.");
+ });
+ }
+ };
+
+ document.addEventListener("deviceready", initialise, false);
+ }]);
+})();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/cdvah_js/ResourcesLoader.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/ResourcesLoader.js b/www/cdvah_js/ResourcesLoader.js
new file mode 100644
index 0000000..d9ca013
--- /dev/null
+++ b/www/cdvah_js/ResourcesLoader.js
@@ -0,0 +1,404 @@
+(function() {
+ "use strict";
+
+ /* global myApp */
+ myApp.factory("ResourcesLoader", [ "$window", function ($window) {
+ var fs;
+ var initialised = false;
+
+ function initialiseFileSystem() {
+ var deferred = Q.defer();
+
+ if(!initialised) {
+
+ var failedFileSystemLookUp = function (error) {
+ var errorString = "An error occurred while reading the file system.";
+ if(error) {
+ errorString += " " + JSON.stringify(error);
+ }
+ deferred.reject(new Error(errorString));
+ };
+
+ var success = function(_fs) {
+ fs = _fs;
+ initialised = true;
+ deferred.resolve(fs);
+ };
+
+ try {
+ $window.requestFileSystem($window.LocalFileSystem.PERSISTENT, 0, success, failedFileSystemLookUp);
+ } catch (e) {
+ failedFileSystemLookUp(e);
+ }
+ } else {
+ deferred.resolve(fs);
+ }
+
+ return deferred.promise;
+ }
+
+ //promise returns full path to downloaded file
+ function downloadFromUrl(url, fullFilePath) {
+ var deferred = Q.defer();
+
+ try {
+ var downloadFail = function(error) {
+ var str = "There was an error while downloading the file " + JSON.stringify(error);
+ deferred.reject(new Error(str));
+ };
+
+ var downloadSuccess = function(fileEntry) {
+ deferred.resolve(fileEntry.fullPath);
+ };
+
+ var fileTransfer = new $window.FileTransfer();
+ var uri = encodeURI(url);
+ fileTransfer.download(uri, fullFilePath, downloadSuccess, downloadFail);
+ } catch(e) {
+ deferred.reject(new Error(e));
+ } finally {
+ return deferred.promise;
+ }
+ }
+
+ function trim(str) {
+ return str && str.replace(/^\s+|\s+$/g, "");
+ }
+
+ function fixFilePath(path) {
+ if(path && path.indexOf("file://") === 0) {
+ path = path.substring("file://".length);
+ }
+ return path;
+ }
+
+ //promise returns the directory entry
+ function getDirectoryEntry(directoryName) {
+ var deferred = Q.defer();
+
+ try {
+ var errorWhileGettingDirectoryEntry = function(error) {
+ var str = "There was an error while getting the directory entry for directory " + directoryName + " " + JSON.stringify(error);
+ deferred.reject(new Error(str));
+ };
+ var success = function(directoryEntry) {
+ deferred.resolve(directoryEntry);
+ };
+ fs.root.getDirectory(directoryName, {create: true, exclusive: false}, success, errorWhileGettingDirectoryEntry);
+ } catch(e) {
+ deferred.reject(new Error(e));
+ } finally {
+ return deferred.promise;
+ }
+ }
+
+ //promise returns the file entry
+ function getFileEntry(fileName, createFlag) {
+ var deferred = Q.defer();
+
+ try {
+ var errorWhileGettingFileEntry = function(error) {
+ var str = "There was an error while getting the file entry for file " + fileName + " " + JSON.stringify(error);
+ deferred.reject(new Error(str));
+ };
+ var success = function(fileEntry) {
+ deferred.resolve(fileEntry);
+ };
+ // !! - ensures a boolean value
+ fs.root.getFile(fixFilePath(fileName), {create: !!createFlag, exclusive: false}, success, errorWhileGettingFileEntry);
+ } catch(e) {
+ deferred.reject(new Error(e));
+ } finally {
+ return deferred.promise;
+ }
+ }
+
+ //promise returns the file
+ function getFile(fileName) {
+ return getFileEntry(fileName, true /* create */).
+ then(function(fileEntry){
+ var deferred = Q.defer();
+
+ try {
+ var errorWhileGettingFile = function(error) {
+ var str = "There was an error while getting the file for file " + fileName + " " + JSON.stringify(error);
+ deferred.reject(new Error(str));
+ };
+
+ fileEntry.file(deferred.resolve, errorWhileGettingFile);
+ } catch(e) {
+ deferred.reject(new Error(e));
+ } finally {
+ return deferred.promise;
+ }
+ });
+ }
+
+ function truncateToDirectoryPath(path) {
+ //remove the filename if it exists
+ var lastLevelIndex = path.search(/[\w ]+(\.[\w ]+)+$/g);
+ if(lastLevelIndex !== -1) {
+ path = path.substring(0, lastLevelIndex);
+ }
+ return path;
+ }
+
+ function getPathSegments(path){
+ //truncate leading and trailing slashes
+ if(path.charAt(0) === "/"){
+ path = path.substring(1);
+ }
+ if(path.charAt(path.length - 1) === "/"){
+ path = path.substring(0, path.length - 1);
+ }
+ var segments = path.split("/");
+ return segments;
+ }
+
+ function ensureSingleDirectoryExists(directory){
+ var deferred = Q.defer();
+
+ var gotDirEntry = function(dirEntry) {
+ deferred.resolve(dirEntry.fullPath);
+ };
+
+ var failedToGetDirEntry = function(error) {
+ var str = "There was an error checking the directory: " + directory + " " + JSON.stringify(error);
+ deferred.reject(new Error(str));
+ };
+
+ fs.root.getDirectory(directory, {create: true, exclusive: false}, gotDirEntry, failedToGetDirEntry);
+ return deferred.promise;
+ }
+
+ function writeToFile(fileName, contents, append) {
+ return getFileEntry(fileName, true)
+ .then(function(fileEntry){
+ var deferred = Q.defer();
+
+ var errorGettingFileWriter = function(error) {
+ var str = "There was an error writing the file." + JSON.stringify(error);
+ deferred.reject(new Error(str));
+ };
+
+ var gotFileWriter = function(writer) {
+ writer.onwrite = deferred.resolve;
+ writer.onerror = function(evt) {
+ deferred.reject(new Error(evt));
+ };
+ if(append){
+ writer.seek(writer.length);
+ }
+ writer.write(contents);
+ };
+ fileEntry.createWriter(gotFileWriter, errorGettingFileWriter);
+ return deferred.promise;
+ });
+ }
+
+ return {
+ doesFileExist : function(fileName){
+ return initialiseFileSystem()
+ .then(function(){
+ return getFileEntry(fileName, false /* create */);
+ })
+ .then(function(){
+ return true;
+ }, function(){
+ return false;
+ });
+ },
+
+ // returns a promise with a full path to the dir
+ ensureDirectoryExists : function(directory) {
+ return initialiseFileSystem()
+ .then(function(){
+ directory = truncateToDirectoryPath(directory);
+ directory = fixFilePath(directory);
+ var segments = getPathSegments(directory);
+ var currentDir = directory.charAt(0) === "/"? "/" : "";
+ var promiseArr = [];
+ while(segments.length !== 0) {
+ currentDir += segments.shift() + "/";
+ promiseArr.push(ensureSingleDirectoryExists(currentDir));
+ }
+ return Q.all(promiseArr);
+ })
+ .then(function(paths){
+ return paths[paths.length - 1];
+ });
+ },
+
+ // promise returns full path to file
+ getFullFilePath : function(filePath) {
+ return initialiseFileSystem()
+ .then(function(){
+ var deferred = Q.defer();
+
+ // Use the file's parent folder to get the full path
+ var directory = filePath;
+ var fileName = "";
+
+ //remove the filename if it exists
+ var lastLevelIndex = directory.search(/\/[\w ]+\.[\w ]+$/g);
+ if(lastLevelIndex !== -1) {
+ directory = filePath.substring(0, lastLevelIndex);
+ fileName = filePath.substring(lastLevelIndex + 1);
+ }
+
+ //we need the directory name w.r.t the root, so remove any slashes in the beginning
+ if(directory.charAt(0) === "/") {
+ directory = directory.substring(1);
+ }
+
+ var gotFullPath = function(dirEntry) {
+ var fullFilePath = dirEntry.fullPath + "/" + fileName;
+ deferred.resolve(fullFilePath);
+ };
+
+ var failedToGetFullPath = function(error) {
+ var str = "There was an error getting the full path of file: " + filePath + " " + JSON.stringify(error);
+ deferred.reject(new Error(str));
+ };
+
+ fs.root.getDirectory(directory, {create: true, exclusive: false}, gotFullPath, failedToGetFullPath);
+ return deferred.promise;
+ });
+ },
+
+ // returns a promise with a full path to the downloaded file
+ downloadFromUrl : function(url, filePath) {
+ var self = this;
+ return initialiseFileSystem()
+ .then(function(){
+ return self.ensureDirectoryExists(filePath);
+ })
+ .then(function(){
+ return self.getFullFilePath(filePath);
+ })
+ .then(function(fullFilePath){
+ return downloadFromUrl(url, fullFilePath);
+ });
+ },
+
+ //returns a promise with the contents of the file
+ readFileContents : function(fileName) {
+ return initialiseFileSystem()
+ .then(function(){
+ return getFile(fileName);
+ })
+ .then(function(file){
+ var deferred = Q.defer();
+
+ var reader = new $window.FileReader();
+ reader.onload = function(evt) {
+ var text = evt.target.result;
+ deferred.resolve(text);
+ };
+ reader.onerror = function(evt) {
+ deferred.reject(new Error(evt));
+ };
+ reader.readAsText(file);
+
+ return deferred.promise;
+ });
+ },
+
+ //returns a promise with the json contents of the file
+ readJSONFileContents : function(fileName) {
+ return this.readFileContents(fileName)
+ .then(function (text) {
+ text = trim(text);
+ var resultJson = {};
+ if(text) {
+ resultJson = JSON.parse(text);
+ }
+ return resultJson;
+ });
+ },
+
+ //returns a promise when file is written
+ writeFileContents : function(fileName, contents) {
+ return initialiseFileSystem()
+ .then(function(){
+ return writeToFile(fileName, contents, false /* append */);
+ });
+ },
+
+ //returns a promise when file is appended
+ appendFileContents : function(fileName, contents) {
+ return initialiseFileSystem()
+ .then(function(){
+ return writeToFile(fileName, contents, true /* append */);
+ });
+ },
+
+ //returns a promise when json file is written
+ writeJSONFileContents : function(fileName, contents) {
+ var stringContents;
+ if(typeof contents === "string") {
+ stringContents = contents;
+ } else {
+ stringContents = JSON.stringify(contents);
+ }
+ return this.writeFileContents(fileName, stringContents);
+ },
+
+ deleteDirectory : function(directoryName) {
+ return initialiseFileSystem()
+ .then(function(){
+ return getDirectoryEntry(directoryName);
+ })
+ .then(function(dirEntry){
+ var deferred = Q.defer();
+ var failedToDeleteDirectory = function(error) {
+ var str = "There was an error deleting the directory: " + directoryName + " " + JSON.stringify(error);
+ deferred.reject(new Error(str));
+ };
+ dirEntry.removeRecursively(deferred.resolve, failedToDeleteDirectory);
+ return deferred.promise;
+ });
+ },
+
+ extractZipFile : function(fileName, outputDirectory){
+ var deferred = Q.defer();
+
+ //will throw an exception if the zip plugin is not loaded
+ try {
+ var onZipDone = function(returnCode) {
+ if(returnCode !== 0) {
+ deferred.reject(new Error("Something went wrong during the unzipping of: " + fileName));
+ } else {
+ deferred.resolve();
+ }
+ };
+
+ /* global zip */
+ zip.unzip(fileName, outputDirectory, onZipDone);
+ } catch(e) {
+ deferred.reject(e);
+ } finally {
+ return deferred.promise;
+ }
+ },
+
+ xhrGet : function(url) {
+ var deferred = Q.defer();
+ var xhr = new XMLHttpRequest();
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState === 4) {
+ if(xhr.status === 200) {
+ deferred.resolve(xhr);
+ } else {
+ deferred.reject("XHR return status: " + xhr.statusText);
+ }
+ }
+ };
+ xhr.open("GET", url, true);
+ xhr.send();
+ return deferred.promise;
+ }
+ };
+ }]);
+
+})();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/cdvah_js/app.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/app.js b/www/cdvah_js/app.js
new file mode 100644
index 0000000..a2d5488
--- /dev/null
+++ b/www/cdvah_js/app.js
@@ -0,0 +1,11 @@
+var myApp = angular.module("CordovaAppHarness", []);
+myApp.config(["$routeProvider", function($routeProvider){
+ $routeProvider.when("/", {
+ templateUrl: "cdvah_views/list.html",
+ controller: "ListCtrl"
+ });
+ $routeProvider.when("/add", {
+ templateUrl: "cdvah_views/add.html",
+ controller: "AddCtrl"
+ });
+}]);
\ No newline at end of file
[29/30] git commit: Merge pull request #23 from shravanrn/regex_bugfix
Posted by ag...@apache.org.
Merge pull request #23 from shravanrn/regex_bugfix
Readme update. String to Regex conversion bugfix.
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/d8f748cf
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/d8f748cf
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/d8f748cf
Branch: refs/heads/master
Commit: d8f748cf67f07900a44bc53474844e73dc96187d
Parents: 09b1b9e 7d48f4a
Author: Braden Shepherdson <br...@gmail.com>
Authored: Wed May 22 10:49:17 2013 -0700
Committer: Braden Shepherdson <br...@gmail.com>
Committed: Wed May 22 10:49:17 2013 -0700
----------------------------------------------------------------------
README.md | 13 +++++++++----
www/cdvah_js/AppBundleAlias.js | 35 ++++++++++++++++++++++++-----------
2 files changed, 33 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
[28/30] git commit: Revert "Support installation of crx files"
Posted by ag...@apache.org.
Revert "Support installation of crx files"
This reverts commit 4d4e0b46caec4db39cb2d3113c208657939029f6.
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/09b1b9e3
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/09b1b9e3
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/09b1b9e3
Branch: refs/heads/master
Commit: 09b1b9e3c61d4dd385e21739e4446917f0a24f6e
Parents: 6d9f5c9
Author: Braden Shepherdson <br...@gmail.com>
Authored: Fri May 17 12:27:35 2013 -0400
Committer: Braden Shepherdson <br...@gmail.com>
Committed: Fri May 17 12:27:35 2013 -0400
----------------------------------------------------------------------
www/cdvah_index.html | 1 -
www/cdvah_js/CrxPackageHandler.js | 54 ----
www/crx_files/config.android.xml | 47 ---
www/crx_files/config.ios.xml | 51 ----
www/crx_files/www/chromeapp.html | 15 -
www/crx_files/www/chromeappstyles.css | 14 -
www/crx_files/www/chromebgpage.html | 11 -
www/crx_files/www/cordova_plugins.json | 1 -
www/crx_files/www/plugins/chrome.common/events.js | 53 ----
.../www/plugins/chrome.fileSystem/fileSystem.js | 142 ----------
www/crx_files/www/plugins/chrome.i18n/i18n.js | 185 ------------
.../www/plugins/chrome.identity/identity.js | 161 -----------
www/crx_files/www/plugins/chrome.socket/socket.js | 216 ---------------
.../www/plugins/chrome.storage/storage.js | 202 --------------
.../www/plugins/chrome/api/app/runtime.js | 7 -
www/crx_files/www/plugins/chrome/api/app/window.js | 156 -----------
www/crx_files/www/plugins/chrome/api/bootstrap.js | 13 -
.../www/plugins/chrome/api/helpers/stubs.js | 11 -
www/crx_files/www/plugins/chrome/api/mobile.js | 58 ----
www/crx_files/www/plugins/chrome/api/runtime.js | 58 ----
20 files changed, 0 insertions(+), 1456 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/09b1b9e3/www/cdvah_index.html
----------------------------------------------------------------------
diff --git a/www/cdvah_index.html b/www/cdvah_index.html
index 3eaede1..8850f80 100644
--- a/www/cdvah_index.html
+++ b/www/cdvah_index.html
@@ -14,7 +14,6 @@
<script type="text/javascript" src="cdvah_js/AppBundleAlias.js"></script>
<script type="text/javascript" src="cdvah_js/KnownExtensionDownloader.js"></script>
<script type="text/javascript" src="cdvah_js/CdvhPackageHandler.js"></script>
- <script type="text/javascript" src="cdvah_js/CrxPackageHandler.js"></script>
<script type="text/javascript" src="cdvah_js/ListCtrl.js"></script>
<script type="text/javascript" src="cdvah_js/AddCtrl.js"></script>
</head>
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/09b1b9e3/www/cdvah_js/CrxPackageHandler.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/CrxPackageHandler.js b/www/cdvah_js/CrxPackageHandler.js
deleted file mode 100644
index 2627fd7..0000000
--- a/www/cdvah_js/CrxPackageHandler.js
+++ /dev/null
@@ -1,54 +0,0 @@
-(function(){
- "use strict";
- /* global myApp */
- myApp.run(["AppsService", "ResourcesLoader", function(AppsService, ResourcesLoader){
-
- function copyFile(startUrl, targetLocation){
- /************ Begin Work around for File system bug ************/
- if(targetLocation.indexOf("file://") === 0) {
- targetLocation = targetLocation.substring("file://".length);
- }
- /************ End Work around for File system bug **************/
- return ResourcesLoader.xhrGet(startUrl)
- .then(function(xhr){
- return ResourcesLoader.ensureDirectoryExists(targetLocation)
- .then(function(){
- return ResourcesLoader.writeFileContents(targetLocation, xhr.responseText);
- });
- });
- }
-
- AppsService.registerPackageHandler("crx", {
- extractPackageToDirectory : function (fileName, outputDirectory){
- return ResourcesLoader.ensureDirectoryExists(outputDirectory + "/www")
- .then(function(){
- return ResourcesLoader.extractZipFile(fileName, outputDirectory + "/www");
- })
- .then(function(){
- return Q.all([
- copyFile("cdv-app-harness:///direct/cordova.js", outputDirectory + "/www/cordova.js"),
- copyFile("cdv-app-harness:///direct/crx_files/config.android.xml", outputDirectory + "/config.android.xml"),
- copyFile("cdv-app-harness:///direct/crx_files/config.ios.xml", outputDirectory + "/config.ios.xml"),
- copyFile("cdv-app-harness:///direct/crx_files/www/cordova_plugins.json", outputDirectory + "/www/cordova_plugins.json"),
- copyFile("cdv-app-harness:///direct/crx_files/www/chromeapp.html", outputDirectory + "/www/chromeapp.html"),
- copyFile("cdv-app-harness:///direct/crx_files/www/chromeappstyles.css", outputDirectory + "/www/chromeappstyles.css"),
- copyFile("cdv-app-harness:///direct/crx_files/www/chromebgpage.html", outputDirectory + "/www/chromebgpage.html"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/app/runtime.js", outputDirectory + "/www/plugins/chrome/api/app/runtime.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/app/window.js", outputDirectory + "/www/plugins/chrome/api/app/window.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/bootstrap.js", outputDirectory + "/www/plugins/chrome/api/bootstrap.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/helpers/stubs.js", outputDirectory + "/www/plugins/chrome/api/helpers/stubs.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/mobile.js", outputDirectory + "/www/plugins/chrome/api/mobile.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/runtime.js", outputDirectory + "/www/plugins/chrome/api/runtime.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.common/events.js", outputDirectory + "/www/plugins/chrome.common/events.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.fileSystem/fileSystem.js", outputDirectory + "/www/plugins/chrome.fileSystem/fileSystem.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.i18n/i18n.js", outputDirectory + "/www/plugins/chrome.i18n/i18n.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.identity/identity.js", outputDirectory + "/www/plugins/chrome.identity/identity.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.socket/socket.js", outputDirectory + "/www/plugins/chrome.socket/socket.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.storage/storage.js", outputDirectory + "/www/plugins/chrome.storage/storage.js")
- ]);
- });
- }
- });
-
- }]);
-})();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/09b1b9e3/www/crx_files/config.android.xml
----------------------------------------------------------------------
diff --git a/www/crx_files/config.android.xml b/www/crx_files/config.android.xml
deleted file mode 100644
index 27da959..0000000
--- a/www/crx_files/config.android.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<cordova>
- <content src="index.html" />
- <log level="DEBUG" />
- <plugins>
- <plugin name="App" value="org.apache.cordova.App" />
- <plugin name="Geolocation" value="org.apache.cordova.GeoBroker" />
- <plugin name="Device" value="org.apache.cordova.Device" />
- <plugin name="Accelerometer" value="org.apache.cordova.AccelListener" />
- <plugin name="Compass" value="org.apache.cordova.CompassListener" />
- <plugin name="Media" value="org.apache.cordova.AudioHandler" />
- <plugin name="Camera" value="org.apache.cordova.CameraLauncher" />
- <plugin name="Contacts" value="org.apache.cordova.ContactManager" />
- <plugin name="File" value="org.apache.cordova.FileUtils" />
- <plugin name="NetworkStatus" value="org.apache.cordova.NetworkManager" />
- <plugin name="Notification" value="org.apache.cordova.Notification" />
- <plugin name="Storage" value="org.apache.cordova.Storage" />
- <plugin name="FileTransfer" value="org.apache.cordova.FileTransfer" />
- <plugin name="Capture" value="org.apache.cordova.Capture" />
- <plugin name="Battery" value="org.apache.cordova.BatteryListener" />
- <plugin name="SplashScreen" value="org.apache.cordova.SplashScreen" />
- <plugin name="Echo" value="org.apache.cordova.Echo" />
- <plugin name="Globalization" value="org.apache.cordova.Globalization" />
- <plugin name="InAppBrowser" value="org.apache.cordova.InAppBrowser" />
- <plugin name="Zip" value="org.apache.cordova.Zip" />
- <plugin name="ChromeExtensionURLs" value="com.google.cordova.ChromeExtensionURLs">
- <url-filter value="chrome-extension://" />
- </plugin>
- <plugin name="ChromeI18n" onload="true" value="com.google.cordova.ChromeI18n" />
- <plugin name="ChromeIdentity" value="com.google.cordova.ChromeIdentity" />
- <plugin name="ChromeSocket" value="com.google.cordova.ChromeSocket" />
- <plugin name="ChromeStorage" value="com.google.cordova.ChromeStorage" />
- <plugin name="CordovaAppHarnessRedirect" value="org.apache.cordova.cordovaappharness.CordovaAppHarnessRedirect">
- <url-filter value="cdv-app-harness://" />
- </plugin>
- </plugins>
- <content src="chromeapp.html" />
- <access origin="*" />
- <access origin="chrome-extension://*" />
- <access origin="cdv-app-harness://*" />
- <preference name="useBrowserHistory" value="true" />
- <preference name="exit-on-suspend" value="false" />
- <preference name="phonegap-version" value="1.9.0" />
- <preference name="orientation" value="default" />
- <preference name="target-device" value="universal" />
- <preference name="fullscreen" value="false" />
-</cordova>
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/09b1b9e3/www/crx_files/config.ios.xml
----------------------------------------------------------------------
diff --git a/www/crx_files/config.ios.xml b/www/crx_files/config.ios.xml
deleted file mode 100644
index bfba1c9..0000000
--- a/www/crx_files/config.ios.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<widget>
- <content src="index.html" />
- <plugins>
- <plugin name="Device" value="CDVDevice" />
- <plugin name="Logger" value="CDVLogger" />
- <plugin name="Compass" value="CDVLocation" />
- <plugin name="Accelerometer" value="CDVAccelerometer" />
- <plugin name="Camera" value="CDVCamera" />
- <plugin name="NetworkStatus" value="CDVConnection" />
- <plugin name="Contacts" value="CDVContacts" />
- <plugin name="Debug Console" value="CDVDebugConsole" />
- <plugin name="Echo" value="CDVEcho" />
- <plugin name="File" value="CDVFile" />
- <plugin name="FileTransfer" value="CDVFileTransfer" />
- <plugin name="Geolocation" value="CDVLocation" />
- <plugin name="Notification" value="CDVNotification" />
- <plugin name="Media" value="CDVSound" />
- <plugin name="Capture" value="CDVCapture" />
- <plugin name="SplashScreen" value="CDVSplashScreen" />
- <plugin name="Battery" value="CDVBattery" />
- <plugin name="Globalization" value="CDVGlobalization" />
- <plugin name="InAppBrowser" value="CDVInAppBrowser" />
- <plugin name="Zip" value="Zip" />
- <plugin name="ChromeExtensionURLs" onload="true" value="ChromeExtensionURLs" />
- <plugin name="ChromeI18n" value="ChromeI18n" />
- <plugin name="ChromeSocket" value="ChromeSocket" />
- <plugin name="ChromeStorage" value="ChromeStorage" />
- <plugin name="CordovaAppHarnessRedirect" onload="true" value="CordovaAppHarnessRedirect" />
- </plugins>
- <content src="chromeapp.html" />
- <access origin="*" />
- <access origin="chrome-extension://*" />
- <access origin="cdv-app-harness://*" />
- <preference name="KeyboardDisplayRequiresUserAction" value="true" />
- <preference name="SuppressesIncrementalRendering" value="false" />
- <preference name="UIWebViewBounce" value="true" />
- <preference name="TopActivityIndicator" value="gray" />
- <preference name="EnableLocation" value="false" />
- <preference name="EnableViewportScale" value="false" />
- <preference name="AutoHideSplashScreen" value="true" />
- <preference name="ShowSplashScreenSpinner" value="true" />
- <preference name="MediaPlaybackRequiresUserAction" value="false" />
- <preference name="AllowInlineMediaPlayback" value="false" />
- <preference name="OpenAllWhitelistURLsInWebView" value="false" />
- <preference name="BackupWebStorage" value="cloud" />
- <preference name="phonegap-version" value="1.9.0" />
- <preference name="orientation" value="default" />
- <preference name="target-device" value="universal" />
- <preference name="fullscreen" value="false" />
-</widget>
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/09b1b9e3/www/crx_files/www/chromeapp.html
----------------------------------------------------------------------
diff --git a/www/crx_files/www/chromeapp.html b/www/crx_files/www/chromeapp.html
deleted file mode 100644
index 3cbd68d..0000000
--- a/www/crx_files/www/chromeapp.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!DOCTYPE html>
-<!--
-Copyright (c) 2012 The Chromium Authors. All rights reserved.
-Use of this source code is governed by a BSD-style license that can be
-found in the LICENSE file.
--->
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="format-detection" content="telephone=no">
- <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
- <script src="cordova.js"></script>
- </head>
- <body></body>
-</html>
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/09b1b9e3/www/crx_files/www/chromeappstyles.css
----------------------------------------------------------------------
diff --git a/www/crx_files/www/chromeappstyles.css b/www/crx_files/www/chromeappstyles.css
deleted file mode 100644
index 277f4fe..0000000
--- a/www/crx_files/www/chromeappstyles.css
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright (c) 2012 The Chromium Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/*
- * Contains extra user-agent styles to apply to all Chrome App windows.
- *
- * These should be kept in sync with:
- * http://code.google.com/searchframe#OAMlx_jo-ck/src/chrome/renderer/resources/extensions/platform_app.css
- */
-body { -webkit-user-select: none; }
-html, body { overflow: hidden; }
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/09b1b9e3/www/crx_files/www/chromebgpage.html
----------------------------------------------------------------------
diff --git a/www/crx_files/www/chromebgpage.html b/www/crx_files/www/chromebgpage.html
deleted file mode 100644
index b732eaa..0000000
--- a/www/crx_files/www/chromebgpage.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE html>
-<!--
-Copyright (c) 2012 The Chromium Authors. All rights reserved.
-Use of this source code is governed by a BSD-style license that can be
-found in the LICENSE file.
--->
-<html>
- <body>
- <script>parent.chrome.mobile.impl.bgInit(this)</script>
- </body>
-</html>
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/09b1b9e3/www/crx_files/www/cordova_plugins.json
----------------------------------------------------------------------
diff --git a/www/crx_files/www/cordova_plugins.json b/www/crx_files/www/cordova_plugins.json
deleted file mode 100644
index fe11f7c..0000000
--- a/www/crx_files/www/cordova_plugins.json
+++ /dev/null
@@ -1 +0,0 @@
-[{"file":"plugins/chrome/api/bootstrap.js","id":"chrome.bootstrap","runs":true},{"file":"plugins/chrome/api/app/runtime.js","id":"chrome.app.runtime","clobbers":["chrome.app.runtime"]},{"file":"plugins/chrome/api/app/window.js","id":"chrome.app.window","clobbers":["chrome.app.window"]},{"file":"plugins/chrome/api/helpers/stubs.js","id":"chrome.helpers.stubs"},{"file":"plugins/chrome/api/mobile.js","id":"chrome.mobile.impl","clobbers":["chrome.mobile.impl"]},{"file":"plugins/chrome/api/runtime.js","id":"chrome.runtime","clobbers":["chrome.runtime"]},{"file":"plugins/chrome.common/events.js","id":"chrome.common.events","clobbers":["chrome.Event"]},{"file":"plugins/chrome.fileSystem/fileSystem.js","id":"chrome.fileSystem.FileSystem","clobbers":["chrome.fileSystem"]},{"file":"plugins/chrome.i18n/i18n.js","id":"chrome.i18n.I18n","clobbers":["chrome.i18n"]},{"file":"plugins/chrome.identity/identity.js","id":"chrome.identity.Identity","clobbers":["chrome.identity","chrome.experimental.iden
tity"]},{"file":"plugins/chrome.socket/socket.js","id":"chrome.socket.Socket","clobbers":["chrome.socket"]},{"file":"plugins/chrome.storage/storage.js","id":"chrome.storage.Storage","clobbers":["chrome.storage"]}]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/09b1b9e3/www/crx_files/www/plugins/chrome.common/events.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome.common/events.js b/www/crx_files/www/plugins/chrome.common/events.js
deleted file mode 100644
index 6f868b1..0000000
--- a/www/crx_files/www/plugins/chrome.common/events.js
+++ /dev/null
@@ -1,53 +0,0 @@
-cordova.define("chrome.common.events", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var Event = function(opt_eventName) {
- this.name = opt_eventName || '';
- this.listeners = [];
-};
-
-// Deliberately not filtering functions that are already added.
-// I tested on desktop and it will call your callback once for each addListener.
-Event.prototype.addListener = function(cb) {
- this.listeners.push(cb);
-};
-
-Event.prototype.findListener_ = function(cb) {
- for(var i = 0; i < this.listeners.length; i++) {
- if (this.listeners[i] == cb) {
- return i;
- }
- }
-
- return -1;
-};
-
-Event.prototype.removeListener = function(cb) {
- var index = this.findListener_(cb);
- if (index >= 0) {
- this.listeners.splice(index, 1);
- }
-};
-
-Event.prototype.hasListener = function(cb) {
- return this.findListener_(cb) >= 0;
-};
-
-Event.prototype.hasListeners = function() {
- return this.listeners.length > 0;
-};
-
-Event.prototype.fire = function() {
- for (var i = 0; i < this.listeners.length; i++) {
- this.listeners[i].apply(this, arguments);
- }
-};
-
-// Stubs since we don't support Rules.
-Event.prototype.addRules = function() { };
-Event.prototype.getRules = function() { };
-Event.prototype.removeRules = function() { };
-
-module.exports = Event;
-});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/09b1b9e3/www/crx_files/www/plugins/chrome.fileSystem/fileSystem.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome.fileSystem/fileSystem.js b/www/crx_files/www/plugins/chrome.fileSystem/fileSystem.js
deleted file mode 100644
index ce613e5..0000000
--- a/www/crx_files/www/plugins/chrome.fileSystem/fileSystem.js
+++ /dev/null
@@ -1,142 +0,0 @@
-cordova.define("chrome.fileSystem.FileSystem", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var platformId = cordova.require('cordova/platform').id;
-var FileEntry = cordova.require('cordova/plugin/FileEntry');
-
-exports.getDisplayPath = function(fileEntry, callback) {
- callback(fileEntry.fullPath);
-};
-
-exports.getWritableEntry = function(fileEntry, callback) {
- callback(null);
-};
-
-exports.isWritableEntry = function(fileEntry, callback) {
- callback(false);
-};
-
-exports.chooseEntry = function(options, callback) {
- // Ensure that the type is either unspecified or specified as 'openFile', as nothing else is supported.
- if (options.type && options.type != 'openFile') {
- // TODO(maxw): Determine a "more correct" way to fail here.
- callback(null);
- return;
- }
-
- // Create the callback for getFile.
- // It creates a file entry and passes it to the chooseEntry callback.
- var onFileReceived = function(nativeUri) {
- var onUriResolved = function(fileEntry) {
- callback(fileEntry);
- };
-
- var onUriResolveError = function(e) {
- console.log(e.target.error.code);
- };
-
- resolveLocalFileSystemURI(nativeUri, onUriResolved, onUriResolveError);
- };
-
- if (platformId == 'ios') {
- getFileIos(options, onFileReceived);
- } else if (platformId == 'android') {
- getFileAndroid(options, onFileReceived);
- }
-};
-
-function getFileIos(options, onFileReceivedCallback) {
- // Determine the media type.
- var mediaType = determineMediaType(options.accepts, options.acceptsAllTypes);
-
- // Prepare the options for getting the file.
- var getFileOptions = { destinationType: navigator.camera.DestinationType.NATIVE_URI,
- sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY,
- mediaType: mediaType };
-
- // Use the camera to get an image or video.
- navigator.camera.getPicture(onFileReceivedCallback, null, getFileOptions);
-}
-
-function getFileAndroid(options, onFileReceivedCallback) {
- var AndroidFileChooser = cordova.require('cordova/plugin/android/filechooser');
-
- // Determine the relevant mime types.
- var mimeTypes = determineMimeTypes(options.accepts, options.acceptsAllTypes);
-
- // Use the file chooser to get a file.
- AndroidFileChooser.chooseFile(onFileReceivedCallback, null, mimeTypes);
-}
-
-function determineMediaType(acceptOptions, acceptsAllTypes) {
- if (acceptsAllTypes) {
- return navigator.camera.MediaType.ALLMEDIA;
- }
-
- var imageMimeTypeRegex = /^image\//;
- var videoMimeTypeRegex = /^video\//;
- var imageExtensionRegex = /^(?:jpg|png)$/;
- var videoExtensionRegex = /^mov$/;
- var imagesAllowed = false;
- var videosAllowed = false;
-
- // Iterate through all accept options.
- // If we see anything image related, allow images. If we see anything video related, allow videos.
- if (acceptOptions) {
- for (var i = 0; i < acceptOptions.length; i++) {
- if (acceptOptions[i].mimeTypes) {
- for (var j = 0; j < acceptOptions[i].mimeTypes.length; j++) {
- if (imageMimeTypeRegex.test(acceptOptions[i].mimeTypes[j])) {
- imagesAllowed = true;
- } else if (videoMimeTypeRegex.test(acceptOptions[i].mimeTypes[j])) {
- videosAllowed = true;
- }
- }
- }
- if (acceptOptions[i].extensions) {
- for (var k = 0; k < acceptOptions[i].extensions.length; k++) {
- if (imageExtensionRegex.test(acceptOptions[i].extensions[k])) {
- imagesAllowed = true;
- } else if (videoExtensionRegex.test(acceptOptions[i].extensions[k])) {
- videosAllowed = true;
- }
- }
- }
- }
- }
-
- if (imagesAllowed && !videosAllowed) {
- return navigator.camera.MediaType.PICTURE;
- } else if (!imagesAllowed && videosAllowed) {
- return navigator.camera.MediaType.VIDEO;
- }
-
- return navigator.camera.MediaType.ALLMEDIA;
-}
-
-function determineMimeTypes(acceptOptions, acceptsAllTypes) {
- if (acceptsAllTypes) {
- return [ '*/*' ];
- }
-
- // Pull out all the mime types.
- // TODO(maxw): Determine mime types from extensions and add them to the returned list.
- var mimeTypes = [ ];
- if (acceptOptions) {
- for (var i = 0; i < acceptOptions.length; i++) {
- if (acceptOptions[i].mimeTypes) {
- for (var j = 0; j < acceptOptions[i].mimeTypes.length; j++) {
- mimeTypes.push(acceptOptions[i].mimeTypes[j]);
- }
- }
- }
- }
-
- if (mimeTypes.length !== 0) {
- return mimeTypes;
- }
-
- return [ '*/*' ];
-}
-});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/09b1b9e3/www/crx_files/www/plugins/chrome.i18n/i18n.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome.i18n/i18n.js b/www/crx_files/www/plugins/chrome.i18n/i18n.js
deleted file mode 100644
index 905466c..0000000
--- a/www/crx_files/www/plugins/chrome.i18n/i18n.js
+++ /dev/null
@@ -1,185 +0,0 @@
-cordova.define("chrome.i18n.I18n", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var exec = cordova.require('cordova/exec');
-var runtime = require('chrome.runtime');
-
-exports.getAcceptLanguages = function(callback) {
- // In the chrome implementation, acceptLanguage value can change with updates so we make a native call to get the system language
- exec(callback, callback, 'ChromeI18n', 'getAcceptLanguages', []);
-};
-
-exports.getMessage = function(messageName, substitutions) {
- // In the chrome implementation, the locale to translate to DOES NOT change with updates, it is keyed of window.navigator.language which is static for a session.
- // This is implemented in _getLocalesToUse()
- if(
- (typeof messageName !== 'string') ||
- (Array.isArray(substitutions) && substitutions.length > 9)
- ) {
- return;
- }
- messageName = messageName.toLowerCase();
- var ret = '';
- var localeChain = _getLocalesToUse();
- var contentsForMessageName = _getMessageFromMessageJson(messageName, localeChain);
- if(contentsForMessageName) {
- ret = _applySubstitutions(contentsForMessageName, substitutions);
- }
- return ret;
-};
-
-function _endsWith(string, endString) {
- if(endString.length > string.length) {
- return false;
- } else {
- return (string.lastIndexOf(endString) === string.length - endString.length);
- }
-}
-
-function _getFilePathForLocale(locale) {
- return 'locales/' + locale.toLowerCase() + '/messages.json';
-}
-
-function _toLowerCaseMessageAndPlaceholders(obj) {
- if(typeof obj !== 'undefined') {
- var newObj = {};
- for(var field in obj) {
- if(obj[field].placeholders) {
- var newPlaceholders = {};
- for(var placeholderField in obj[field].placeholders) {
- newPlaceholders[placeholderField.toLowerCase()] = obj[field].placeholders[placeholderField];
- }
- obj[field].placeholders = newPlaceholders;
- }
- newObj[field.toLowerCase()] = obj[field];
- }
- return newObj;
- }
-}
-
-function _getDefaultLocale() {
- var manifestJson = runtime.getManifest();
- if(manifestJson.default_locale) {
- return manifestJson.default_locale;
- } else {
- throw new Error('Default locale not defined');
- }
-}
-
-var memoizedJsonContents = {};
-function _getMessageFromMessageJson(messageName, localeChain) {
- for(var i = 0; i < localeChain.length; i++) {
- var locale = localeChain[i];
- if (!memoizedJsonContents[locale]) {
- var fileName = _getFilePathForLocale(locale);
- var xhr = new XMLHttpRequest();
- xhr.open('GET', fileName, false /* sync */);
- xhr.send(null);
- var contents = eval('(' + xhr.responseText + ')');
- // convert all fields to lower case to check case insensitively
- contents = _toLowerCaseMessageAndPlaceholders(contents);
- memoizedJsonContents[locale] = contents;
- }
- if(memoizedJsonContents[locale][messageName]) {
- return memoizedJsonContents[locale][messageName];
- }
- }
-}
-
-function _isLocaleAvailable(locale) {
- var fileName = _getFilePathForLocale(locale);
- var xhr = new XMLHttpRequest();
- xhr.open('HEAD', fileName, false /* sync */);
- xhr.send(null);
- availableLocales[locale] = (xhr.status === 200);
-}
-
-var chosenLocales;
-function _getLocalesToUse() {
- if(!chosenLocales) {
- // language returned by window.navigator is in format en-US, need to change it to en_us
- var windowLocale = window.navigator.language.replace('-', '_').toLowerCase();
- var localesToUse = [windowLocale];
- // Construct fallback chain
- var lastIndex;
- while((lastIndex = windowLocale.lastIndexOf('_')) !== -1) {
- windowLocale = windowLocale.substring(0, lastIndex);
- localesToUse.push(windowLocale);
- }
- var defaultLocale = _getDefaultLocale().toLowerCase();
- if(localesToUse.indexOf(defaultLocale) == -1) {
- localesToUse.push(defaultLocale);
- }
-
- chosenLocales = [] ;
- for(var i = 0; i < localesToUse.length; i++) {
- var currentLocale = localesToUse[i];
- if(_isLocaleAvailable(currentLocale)) {
- chosenLocales.push(currentLocale);
- }
- }
- }
- if(chosenLocales.length == 0) {
- throw new Error('No usable locale.');
- }
- return chosenLocales;
-}
-
-function _getSubstitutionString(match, substitutions) {
- if(match == '$$') {
- return '$';
- } else if(match == '$') {
- return '';
- }
- else {
- var locBaseOne = parseInt(match.substring(1));
- if(isNaN(locBaseOne) || locBaseOne <= 0) {
- return '';
- }
-
- if(substitutions[locBaseOne - 1]) {
- return substitutions[locBaseOne - 1];
- } else {
- return '';
- }
- }
-}
-
-function _getPlaceholderText(placeholders, substitutions, match) {
- // Switch to lower case to do case insensitive checking for matches
- var placeholderField = match.substring(1, match.length - 1);
- placeholderField = placeholderField.toLowerCase();
- if(placeholders[placeholderField]) {
- // form $1, $2 etc or '$$' or '$'
- var placeholderText = placeholders[placeholderField].content.replace(/\$(([0-9]+)|\$)?/g, function(match) {
- var substitutionString = _getSubstitutionString(match, substitutions);
- return substitutionString;
- });
- return placeholderText;
- } else {
- return '';
- }
-}
-
-function _applySubstitutions(messageObject, substitutions) {
- if(typeof substitutions === 'undefined') {
- substitutions = [];
- } else if(Object.prototype.toString.call(substitutions) !== '[object Array]') {
- substitutions = [substitutions];
- }
- // Look for any strings of form $WORD$ eg: $1stName$, form $1, $2 etc or any lone '$'
- // Order of preference is as in this comment
- var ret = messageObject.message.replace( /\$(([0-9a-zA-Z_]*\$)|([0-9]*))?/g, function(matchedString) {
- // check which category of matchedString it is
- if(matchedString.match(/\$[0-9a-zA-Z_]+\$/)) { // form $WORD$
- var placeholderText = _getPlaceholderText(messageObject.placeholders, substitutions, matchedString);
- return placeholderText;
- } else { // form $1, $2 etc or '$$' or '$'
- var substitutionString = _getSubstitutionString(matchedString, substitutions);
- return substitutionString;
- }
- });
- return ret;
-}
-});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/09b1b9e3/www/crx_files/www/plugins/chrome.identity/identity.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome.identity/identity.js b/www/crx_files/www/plugins/chrome.identity/identity.js
deleted file mode 100644
index 54f1597..0000000
--- a/www/crx_files/www/plugins/chrome.identity/identity.js
+++ /dev/null
@@ -1,161 +0,0 @@
-cordova.define("chrome.identity.Identity", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var platformId = cordova.require('cordova/platform').id;
-var runtime = require('chrome.runtime');
-
-exports.TokenDetails = function(interactive) {
- this.interactive = interactive || false;
-};
-
-exports.WebAuthFlowDetails = function(url, interactive, width, height, left, top) {
- if (typeof url == 'undefined') {
- throw new Error('Url required');
- }
- this.url = url;
- this.interactive = interactive || false;
- this.width = width;
- this.height = height;
- this.left = left;
- this.top = top;
-};
-
-exports.getAuthToken = function(details, callback) {
- if(typeof details == 'function') {
- callback = details;
- details = new exports.TokenDetails();
- }
- if (typeof callback == 'undefined') {
- chrome.runtime.lastError = { 'message' : 'Callback function required' };
- // Not calling callback as it wasnt provided
- return;
- }
- var win = function(token) {
- callback(token);
- };
- var fail = function() {
- callback();
- };
-
- if (platformId == 'android') {
- // Use native implementation for logging into google accounts
- cordova.exec(win, fail, 'ChromeIdentity', 'getAuthToken', [details]);
- } else {
- // Use web app oauth flow
- _getAuthTokenJS(win, fail, details);
- }
-};
-
-exports.launchWebAuthFlow = function(details, callback) {
- var failed = false;
- var failMessage;
- if (typeof details == 'undefined') {
- failed = true;
- failMessage = 'WebAuthFlowDetails required';
- } else if (typeof callback == 'undefined') {
- failed = true;
- failMessage = 'Callback function required';
- }
-
- if(failed === true) {
- chrome.runtime.lastError = { 'message' : failMessage };
- // Not calling callback as it wasnt provided
- return;
- }
-
- var finalURL = details.url;
- var extractedRedirectedURL = _getParameterFromUrl(finalURL, 'redirect_uri', '?', '#');
-
- if(typeof extractedRedirectedURL == 'undefined') {
- chrome.runtime.lastError = { 'message' : 'launchWebAuthFlow: Parameter redirect_uri not found.' };
- callback();
- } else {
- _launchInAppBrowser(finalURL, extractedRedirectedURL, callback);
- }
-};
-
-function _getAuthTokenJS(win, fail , details) {
- var failed = false;
- var failMessage;
- if(!details.interactive) {
- // We cannot support non interactive mode.
- // This requires the ability to use invisible InAppBrowser windows, which is not currently supported
- failed = true;
- failMessage = 'Unsupported mode - Non interactive mode is not supported';
- }
- var manifestJson = runtime.getManifest();
- if(typeof manifestJson == 'undefined') {
- failed = true;
- failMessage = 'manifest.json is not defined';
- } else if(typeof manifestJson.oauth2 == 'undefined') {
- failed = true;
- failMessage = 'oauth2 missing from manifest.json';
- } else if(typeof manifestJson.oauth2.client_id == 'undefined') {
- failed = true;
- failMessage = 'client_id missing from manifest.json';
- } else if(typeof manifestJson.oauth2.scopes == 'undefined') {
- failed = true;
- failMessage = 'scopes missing from manifest.json';
- }
-
- if(failed === true) {
- chrome.runtime.lastError = { 'message' : failMessage };
- fail();
- }
-
- var authURLBase = 'https://accounts.google.com/o/oauth2/auth?response_type=token';
- var redirect_uri = 'http://www.google.com';
- var client_id = manifestJson.oauth2.client_id;
- var scope = manifestJson.oauth2.scopes;
- var finalURL = authURLBase + '&redirect_uri=' + encodeURIComponent(redirect_uri) + '&client_id=' + encodeURIComponent(client_id) + '&scope=' + encodeURIComponent(scope.join('&'));
-
- _launchInAppBrowser(finalURL, redirect_uri, function(newLoc) {
- var token = _getParameterFromUrl(newLoc, 'access_token', '#');
- if(typeof token == 'undefined') {
- chrome.runtime.lastError = { 'message' : 'The redirect uri did not have the access token' };
- fail();
- } else {
- win(token);
- }
- });
-}
-
-function _getParameterFromUrl(url, param, startString, endString) {
- var splitUrl = url;
- var urlParts;
- if(typeof startString != 'undefined') {
- urlParts = splitUrl.split(startString);
- if(urlParts.length < 2) {
- return;
- } else {
- splitUrl = urlParts[1];
- }
- }
- if(typeof endString != 'undefined') {
- urlParts = splitUrl.split(endString);
- splitUrl = urlParts[0];
- }
- var vars = splitUrl.split('&');
- for (var i = 0; i < vars.length; i++) {
- var pair = vars[i].split('=');
- // If first entry with this name
- if (pair[0] === param) {
- return decodeURIComponent(pair[1]);
- }
- }
-}
-
-function _launchInAppBrowser(authURL, redirectedURL, callback) {
- var oAuthBrowser = window.open(authURL, '_blank', 'location=yes');
- var listener = function(event) {
- var newLoc = event.url;
- if(newLoc.indexOf(redirectedURL) === 0 && newLoc.indexOf('#') !== -1) {
- oAuthBrowser.removeEventListener('loadstart', listener);
- oAuthBrowser.close();
- callback(newLoc);
- }
- };
- oAuthBrowser.addEventListener('loadstart', listener);
-}
-});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/09b1b9e3/www/crx_files/www/plugins/chrome.socket/socket.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome.socket/socket.js b/www/crx_files/www/plugins/chrome.socket/socket.js
deleted file mode 100644
index 389eec9..0000000
--- a/www/crx_files/www/plugins/chrome.socket/socket.js
+++ /dev/null
@@ -1,216 +0,0 @@
-cordova.define("chrome.socket.Socket", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var platform = cordova.require('cordova/platform');
-var exec = cordova.require('cordova/exec');
-
-exports.create = function(socketMode, stuff, callback) {
- if (typeof stuff == 'function') {
- callback = stuff;
- stuff = {};
- }
- var win = callback && function(socketId) {
- var socketInfo = {
- socketId: socketId
- };
- callback(socketInfo);
- };
- exec(win, null, 'ChromeSocket', 'create', [socketMode]);
-};
-
-exports.destroy = function(socketId) {
- exec(null, null, 'ChromeSocket', 'destroy', [socketId]);
-};
-
-
-exports.connect = function(socketId, address, port, callback) {
- var win = callback && function() {
- callback(0);
- };
- var fail = callback && function() {
- callback(-1);
- };
- exec(win, fail, 'ChromeSocket', 'connect', [socketId, address, port]);
-};
-
-exports.bind = function(socketId, address, port, callback) {
- var win = callback && function() {
- callback(0);
- };
- var fail = callback && function() {
- callback(-1);
- };
- exec(win, fail, 'ChromeSocket', 'bind', [socketId, address, port]);
-};
-
-exports.disconnect = function(socketId) {
- exec(null, null, 'ChromeSocket', 'disconnect', [socketId]);
-};
-
-
-exports.read = function(socketId, bufferSize, callback) {
- if (typeof bufferSize == 'function') {
- callback = bufferSize;
- bufferSize = 0;
- }
- var win = callback && function(data) {
- var readInfo = {
- resultCode: data.byteLength || 1,
- data: data
- };
- callback(readInfo);
- };
- var fail = callback && function() {
- var readInfo = {
- resultCode: 0
- };
- callback(readInfo);
- };
- exec(win, fail, 'ChromeSocket', 'read', [socketId, bufferSize]);
-};
-
-exports.write = function(socketId, data, callback) {
- var type = Object.prototype.toString.call(data).slice(8, -1);
- if (type != 'ArrayBuffer') {
- throw new Error('chrome.socket.write - data is not an ArrayBuffer! (Got: ' + type + ')');
- }
- var win = callback && function(bytesWritten) {
- var writeInfo = {
- bytesWritten: bytesWritten
- };
- callback(writeInfo);
- };
- var fail = callback && function() {
- var writeInfo = {
- bytesWritten: 0
- };
- callback(writeInfo);
- };
- exec(win, fail, 'ChromeSocket', 'write', [socketId, data]);
-};
-
-
-exports.recvFrom = function(socketId, bufferSize, callback) {
- if (typeof bufferSize == 'function') {
- callback = bufferSize;
- bufferSize = 0;
- }
- var win;
- if (platform.id == 'android') {
- win = callback && (function() {
- var data;
- var call = 0;
- return function(arg) {
- if (call === 0) {
- data = arg;
- call++;
- } else {
- var recvFromInfo = {
- resultCode: data.byteLength || 1,
- data: data,
- address: arg.address,
- port: arg.port
- };
-
- callback(recvFromInfo);
- }
- };
- })();
- } else {
- win = callback && function(data, address, port) {
- var recvFromInfo = {
- resultCode: data.byteLength || 1,
- data: data,
- address: address,
- port: port
- };
- callback(recvFromInfo);
- };
- }
-
- var fail = callback && function() {
- var readInfo = {
- resultCode: 0
- };
- callback(readInfo);
- };
- exec(win, fail, 'ChromeSocket', 'recvFrom', [socketId, bufferSize]);
-};
-
-exports.sendTo = function(socketId, data, address, port, callback) {
- var type = Object.prototype.toString.call(data).slice(8, -1);
- if (type != 'ArrayBuffer') {
- throw new Error('chrome.socket.write - data is not an ArrayBuffer! (Got: ' + type + ')');
- }
- var win = callback && function(bytesWritten) {
- var writeInfo = {
- bytesWritten: bytesWritten
- };
- callback(writeInfo);
- };
- var fail = callback && function() {
- var writeInfo = {
- bytesWritten: 0
- };
- callback(writeInfo);
- };
- exec(win, fail, 'ChromeSocket', 'sendTo', [{ socketId: socketId, address: address, port: port }, data]);
-};
-
-
-exports.listen = function(socketId, address, port, backlog, callback) {
- if (typeof backlog == 'function') {
- callback = backlog;
- backlog = 0;
- }
- var win = callback && function() {
- callback(0);
- };
- var fail = callback && function() {
- callback(-1);
- };
- exec(win, fail, 'ChromeSocket', 'listen', [socketId, address, port, backlog]);
-};
-
-exports.accept = function(socketId, callback) {
- var win = callback && function(acceptedSocketId) {
- var acceptInfo = {
- resultCode: 0,
- socketId: acceptedSocketId
- };
- callback(acceptInfo);
- };
- exec(win, null, 'ChromeSocket', 'accept', [socketId]);
-};
-
-
-exports.setKeepAlive = function() {
- console.warn('chrome.socket.setKeepAlive not implemented yet');
-};
-
-exports.setNoDelay = function() {
- console.warn('chrome.socket.setNoDelay not implemented yet');
-};
-
-exports.getInfo = function(socketId, callback) {
- if (platform.id == 'android') {
- console.warn('chrome.socket.getInfo not implemented yet');
- return;
- }
- var win = callback && function(result) {
- result.connected = !!result.connected;
- callback(result);
- };
- exec(win, null, 'ChromeSocket', 'getInfo', [socketId]);
-};
-
-exports.getNetworkList = function(callback) {
- if (platform.id == 'android') {
- console.warn('chrome.socket.getNetworkList not implemented yet');
- return;
- }
- exec(callback, null, 'ChromeSocket', 'getNetworkList', []);
-};
-
-});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/09b1b9e3/www/crx_files/www/plugins/chrome.storage/storage.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome.storage/storage.js b/www/crx_files/www/plugins/chrome.storage/storage.js
deleted file mode 100644
index 4d6da75..0000000
--- a/www/crx_files/www/plugins/chrome.storage/storage.js
+++ /dev/null
@@ -1,202 +0,0 @@
-cordova.define("chrome.storage.Storage", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var exports = module.exports;
-var exec = cordova.require('cordova/exec');
-
-function StorageChange(oldValue, newValue) {
- this.oldValue = oldValue;
- this.newValue = newValue;
-}
-
-function _jsonReplacer(key) {
- // Don't use the value passed in since it has already gone through toJSON().
- var value = this[key];
- // Refer to:
- // chrome/src/content/renderer/v8_value_converter_impl.cc&l=165
- if (value && (typeof value == 'object' || typeof value == 'function')) {
- var typeName = Object.prototype.toString.call(value).slice(8, -1);
- if (typeName != 'Array' && typeName != 'Object') {
- value = {};
- }
- }
- return value;
-}
-
-function _scrubValues(o) {
- if (typeof o != 'undefined') {
- var t = JSON.stringify(o, _jsonReplacer);
- return JSON.parse(t);
- }
-}
-
-function _calculateChanges(oldKeyVals, newKeyVals) {
- var ret = {};
- for(var key in newKeyVals) {
- if (newKeyVals.hasOwnProperty(key)) {
- ret[key] = new StorageChange(oldKeyVals[key], newKeyVals[key]);
- }
- }
- return ret;
-}
-
-function _convertToObject(obj) {
- var ret;
- if (Array.isArray(obj)) {
- ret = {};
- for(var i = 0; i < obj.length; i++) {
- ret[obj[i]] = undefined;
- }
- } else if (typeof obj == 'object') {
- ret = obj;
- } else if (typeof obj === 'string') {
- ret = {};
- ret[obj] = undefined;
- }
- return ret;
-}
-
-function StorageArea(syncStorage, changedEvent) {
- this._sync = syncStorage;
- this._changedEvent = changedEvent;
-}
-
-StorageArea.prototype._getAreaName = function() {
- return (this._sync? 'sync' : 'local');
-};
-
-StorageArea.prototype.get = function(keys, callback) {
- if (typeof keys == 'function') {
- callback = keys;
- keys = null;
- } else if (typeof keys === 'string') {
- keys = [keys];
- }
- var win = callback && function(args) {
- callback(args);
- };
- var fail = callback && function() {
- callback();
- };
- var param = _scrubValues(keys);
- exec(win, fail, 'ChromeStorage', 'get', [this._sync, param]);
-};
-
-StorageArea.prototype.getBytesInUse = function(keys, callback) {
- if (typeof keys == 'function') {
- callback = keys;
- keys = null;
- } else if (typeof keys === 'string') {
- keys = [keys];
- }
- var win = callback && function(bytes) {
- callback(bytes);
- };
- var fail = callback && function() {
- callback(-1);
- };
- var param = _scrubValues(keys);
- exec(win, fail, 'ChromeStorage', 'getBytesInUse', [this._sync, param]);
-};
-
-StorageArea.prototype.set = function(keyVals, callback) {
- if (typeof keyVals == 'function') {
- callback = keyVals;
- keyVals = null;
- }
- var self = this;
- var param = _scrubValues(keyVals);
- var fail = callback && function() {
- callback(-1);
- };
- var win;
- if(self._changedEvent.hasListeners()) {
- win = function(oldKeyVals) {
- if(callback) {
- callback(0);
- }
- var newKeyVals = _convertToObject(param);
- var storageChanges = _calculateChanges(oldKeyVals, newKeyVals);
- self._changedEvent.fire(storageChanges, self._getAreaName());
- };
- } else {
- win = callback && function() {
- callback(0);
- };
- }
- exec(win, fail, 'ChromeStorage', 'set', [self._sync, param]);
-};
-
-StorageArea.prototype.remove = function(keys, callback) {
- if (typeof keys == 'function') {
- callback = keys;
- keys = null;
- } else if (typeof keys === 'string') {
- keys = [keys];
- }
- var self = this;
- var param = _scrubValues(keys);
- var fail = callback && function() {
- callback(-1);
- };
- var win;
- if(self._changedEvent.hasListeners()) {
- win = function(oldKeyVals) {
- if(callback) {
- callback(0);
- }
- var newKeyVals = _convertToObject(Object.keys(oldKeyVals));
- var storageChanges = _calculateChanges(oldKeyVals, newKeyVals);
- self._changedEvent.fire(storageChanges, self._getAreaName());
- };
- } else {
- win = callback && function() {
- callback(0);
- };
- }
- exec(win, fail, 'ChromeStorage', 'remove', [self._sync, param]);
-};
-
-StorageArea.prototype.clear = function(callback) {
- var self = this;
- var fail = callback && function() {
- callback(-1);
- };
- var win;
- if(self._changedEvent.hasListeners()) {
- win = function(oldKeyVals) {
- if(callback) {
- callback(0);
- }
- var newKeyVals = _convertToObject(Object.keys(oldKeyVals));
- var storageChanges = _calculateChanges(oldKeyVals, newKeyVals);
- self._changedEvent.fire(storageChanges, self._getAreaName());
- };
- } else {
- win = callback && function() {
- callback(0);
- };
- }
- exec(win, fail, 'ChromeStorage', 'clear', [self._sync]);
-};
-
-// TODO(braden): How do we want to handle this event when we're not in a Chrome app?
-var Event = require('chrome.common.events');
-if (Event) {
- exports.onChanged = new Event('onChanged');
-}
-
-var local = new StorageArea(false, exports.onChanged);
-local.QUOTA_BYTES = 5242880;
-var sync = new StorageArea(true, exports.onChanged);
-sync.MAX_ITEMS = 512;
-sync.MAX_WRITE_OPERATIONS_PER_HOUR = 1000;
-sync.QUOTA_BYTES_PER_ITEM = 4096;
-sync.MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE = 10;
-sync.QUOTA_BYTES = 102400;
-
-exports.local = local;
-exports.sync = sync;
-
-});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/09b1b9e3/www/crx_files/www/plugins/chrome/api/app/runtime.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome/api/app/runtime.js b/www/crx_files/www/plugins/chrome/api/app/runtime.js
deleted file mode 100644
index 4a2288c..0000000
--- a/www/crx_files/www/plugins/chrome/api/app/runtime.js
+++ /dev/null
@@ -1,7 +0,0 @@
-cordova.define("chrome.app.runtime", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var Event = require('chrome.common.events');
-exports.onLaunched = new Event('onLaunched');
-});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/09b1b9e3/www/crx_files/www/plugins/chrome/api/app/window.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome/api/app/window.js b/www/crx_files/www/plugins/chrome/api/app/window.js
deleted file mode 100644
index 3a6484d..0000000
--- a/www/crx_files/www/plugins/chrome/api/app/window.js
+++ /dev/null
@@ -1,156 +0,0 @@
-cordova.define("chrome.app.window", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var Event = require('chrome.common.events');
-var mobile = require('chrome.mobile.impl');
-
-// The AppWindow created by chrome.app.window.create.
-var createdAppWindow = null;
-var dummyNode = document.createElement('a');
-
-function AppWindow() {
- this.contentWindow = mobile.fgWindow;
- this.id = '';
-}
-
-function unsupportedApi(api) {
- return function() {
- console.warn(api + ' is not supported on mobile.');
- };
-}
-
-AppWindow.prototype = {
- restore: unsupportedApi('AppWindow.restore'),
- moveTo: unsupportedApi('AppWindow.moveTo'),
- clearAttention: unsupportedApi('AppWindow.clearAttention'),
- minimize: unsupportedApi('AppWindow.minimize'),
- drawAttention: unsupportedApi('AppWindow.drawAttention'),
- focus: unsupportedApi('AppWindow.focus'),
- resizeTo: unsupportedApi('AppWindow.resizeTo'),
- maximize: unsupportedApi('AppWindow.maximize'),
- close: unsupportedApi('AppWindow.close'),
- setBounds: unsupportedApi('AppWindow.setBounds'),
- onBoundsChanged: new Event('onBoundsChanged'),
- onClosed: new Event('onClosed')
-};
-AppWindow.prototype.getBounds = function() {
- return {
- width: 0,
- height: 0,
- left: 0,
- top: 0
- };
-};
-
-function copyAttributes(srcNode, destNode) {
- var attrs = srcNode.attributes;
- for (var i = 0, attr; attr = attrs[i]; ++i) {
- destNode.setAttribute(attr.name, attr.value);
- }
-}
-
-function applyAttributes(attrText, destNode) {
- dummyNode.innerHTML = '<a ' + attrText + '>';
- copyAttributes(dummyNode.firstChild, destNode);
-}
-
-// Evals the scripts serially since sometimes browsers don't execute
-// them in the order they are injected :(.
-// TODO: This is clearly slower for multiple scripts. We could maybe see if
-// injecting after DOM mutation events fire?
-function evalScripts(rootNode, afterFunc) {
- var scripts = Array.prototype.slice.call(rootNode.getElementsByTagName('script'));
- var doc = rootNode.ownerDocument;
- function helper() {
- var script = scripts.shift();
- if (!script) {
- afterFunc && afterFunc();
- // Don't bother with inline scripts since they aren't evalled on desktop.
- } else if (script.src) {
- var replacement = doc.createElement('script');
- copyAttributes(script, replacement);
- replacement.onload = helper;
- script.parentNode.replaceChild(replacement, script);
- } else {
- helper();
- }
- }
- helper();
-}
-
-function rewritePage(pageContent, filePath) {
- var fgBody = mobile.fgWindow.document.body;
- var fgHead = fgBody.previousElementSibling;
-
- // fgHead.innerHTML causes a DOMException on Android 2.3.
- while (fgHead.lastChild) {
- fgHead.removeChild(fgHead.lastChild);
- }
-
- var startIndex = pageContent.search(/<html([\s\S]*?)>/i);
- if (startIndex != -1) {
- startIndex += RegExp.lastMatch.length;
- // Copy over the attributes of the <html> tag.
- applyAttributes(RegExp.lastParen, fgBody.parentNode);
- } else {
- startIndex = 0;
- }
-
- function afterBase() {
- fgHead.insertAdjacentHTML('beforeend', headHtml);
- evalScripts(fgHead, function() {
- mobile.eventIframe.insertAdjacentHTML('afterend', pageContent);
- evalScripts(fgBody)
- });
- }
- // Put everything before the body tag in the head.
- var endIndex = pageContent.search(/<body([\s\S]*?)>/i);
- if (endIndex == -1) {
- mobile.eventIframe.insertAdjacentHTML('afterend', 'Load error: Page is missing body tag.');
- } else {
- applyAttributes(RegExp.lastParen, fgBody);
-
- // Don't bother removing the <body>, </body>, </html>. The browser's sanitizer removes them for us.
- var headHtml = pageContent.slice(startIndex, endIndex);
- pageContent = pageContent.slice(endIndex);
-
- fgHead.insertAdjacentHTML('beforeend', '<link rel="stylesheet" href="chromeappstyles.css">');
- var baseUrl = filePath.replace(/\/.*?$/, '');
- if (baseUrl != filePath) {
- fgHead.insertAdjacentHTML('beforeend', '<base href="' + encodeURIComponent(baseUrl) + '/">\n');
- // setTimeout required for <base> to take effect for <link> elements (browser bug).
- window.setTimeout(afterBase, 0);
- } else {
- afterBase();
- }
- }
-}
-
-exports.create = function(filePath, options, callback) {
- if (createdAppWindow) {
- console.log('ERROR - chrome.app.window.create called multiple times. This is unsupported.');
- return;
- }
- createdAppWindow = new AppWindow();
- var xhr = new XMLHttpRequest();
- xhr.open('GET', filePath, true);
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4) {
- // Call the callback before the page contents loads.
- if (callback) {
- callback(createdAppWindow);
- }
- var pageContent = xhr.responseText || 'Page load failed.';
- rewritePage(pageContent, filePath);
- cordova.fireWindowEvent('DOMContentReady');
- cordova.fireWindowEvent('load');
- }
- };
- xhr.send();
-};
-
-exports.current = function() {
- return window == mobile.fgWindow ? createdAppWindow : null;
-};
-});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/09b1b9e3/www/crx_files/www/plugins/chrome/api/bootstrap.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome/api/bootstrap.js b/www/crx_files/www/plugins/chrome/api/bootstrap.js
deleted file mode 100644
index 51c28dc..0000000
--- a/www/crx_files/www/plugins/chrome/api/bootstrap.js
+++ /dev/null
@@ -1,13 +0,0 @@
-cordova.define("chrome.bootstrap", function(require, exports, module) {// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Initialization code for the Chrome plugins API.
-// Adds a deviceready listener that initializes the Chrome wrapper.
-
-console.log('adding event');
-document.addEventListener('deviceready', function() {
- console.log('deviceready caught');
- require('chrome.mobile.impl').init();
-});
-});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/09b1b9e3/www/crx_files/www/plugins/chrome/api/helpers/stubs.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome/api/helpers/stubs.js b/www/crx_files/www/plugins/chrome/api/helpers/stubs.js
deleted file mode 100644
index ef57b83..0000000
--- a/www/crx_files/www/plugins/chrome/api/helpers/stubs.js
+++ /dev/null
@@ -1,11 +0,0 @@
-cordova.define("chrome.helpers.stubs", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-exports.createStub = function(obj, propName, value) {
- obj.__defineGetter__(propName, function() {
- console.warn('Access made to stub: ' + obj.__namespace__ + '.' + propName);
- return value;
- });
-};
-});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/09b1b9e3/www/crx_files/www/plugins/chrome/api/mobile.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome/api/mobile.js b/www/crx_files/www/plugins/chrome/api/mobile.js
deleted file mode 100644
index 28af8b8..0000000
--- a/www/crx_files/www/plugins/chrome/api/mobile.js
+++ /dev/null
@@ -1,58 +0,0 @@
-cordova.define("chrome.mobile.impl", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var chrome = window.chrome;
-
-exports.fgWindow = window;
-exports.bgWindow = null;
-exports.eventIframe = null;
-
-function createBgChrome() {
- return {
- __proto__: chrome,
- app: {
- __proto__: chrome.app,
- window: {
- __proto__: chrome.app.window,
- current: function() { return null; }
- }
- }
- };
-}
-
-exports.init = function() {
- // Self-destruct so that code in here can be GC'ed.
- exports.init = null;
- var iframe = document.createElement('iframe');
- iframe.src = 'chromebgpage.html';
- iframe.style.display = 'none';
- exports.eventIframe = iframe;
- document.body.appendChild(iframe);
-};
-
-exports.bgInit = function(bgWnd) {
- // Self-destruct so that code in here can be GC'ed.
- exports.bgInit = null;
- exports.bgWindow = bgWnd;
- bgWnd.chrome = createBgChrome();
- bgWnd.cordova = cordova;
- exports.fgWindow.opener = exports.bgWindow;
-
- function onLoad() {
- bgWnd.removeEventListener('load', onLoad, false);
- setTimeout(function() {
- chrome.app.runtime.onLaunched.fire();
- }, 0);
- }
- bgWnd.addEventListener('load', onLoad, false);
-
- var manifestJson = chrome.runtime.getManifest();
- var scripts = manifestJson.app.background.scripts;
- var toWrite = '';
- for (var i = 0, src; src = scripts[i]; ++i) {
- toWrite += '<script src="' + encodeURI(src) + '"></sc' + 'ript>\n';
- }
- bgWnd.document.write(toWrite);
-};
-});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/09b1b9e3/www/crx_files/www/plugins/chrome/api/runtime.js
----------------------------------------------------------------------
diff --git a/www/crx_files/www/plugins/chrome/api/runtime.js b/www/crx_files/www/plugins/chrome/api/runtime.js
deleted file mode 100644
index 58b3970..0000000
--- a/www/crx_files/www/plugins/chrome/api/runtime.js
+++ /dev/null
@@ -1,58 +0,0 @@
-cordova.define("chrome.runtime", function(require, exports, module) {// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var argscheck = cordova.require('cordova/argscheck');
-var Event = require('chrome.common.events');
-var stubs = require('chrome.helpers.stubs');
-var mobile = require('chrome.mobile.impl');
-var manifestJson = null;
-
-exports.onSuspend = new Event('onSuspend');
-exports.onInstalled = new Event('onInstalled');
-exports.onStartup = new Event('onStartup');
-exports.onSuspendCanceled = new Event('onSuspendCanceled');
-exports.onUpdateAvailable = new Event('onUpdateAvailable');
-
-var original_addListener = exports.onSuspend.addListener;
-
-// Uses a trampoline to bind the Cordova pause event on the first call.
-exports.onSuspend.addListener = function(f) {
- window.document.addEventListener('pause', exports.onSuspend.fire, false);
- exports.onSuspend.addListener = original_addListener;
- exports.onSuspend.addListener(f);
-};
-
-exports.getManifest = function() {
- if (!manifestJson) {
- var xhr = new XMLHttpRequest();
- xhr.open('GET', 'manifest.json', false /* sync */);
- xhr.send(null);
- manifestJson = eval('(' + xhr.responseText + ')'); //JSON.parse(xhr.responseText);
- }
- return manifestJson;
-};
-
-exports.getBackgroundPage = function(callback) {
- argscheck.checkArgs('f', 'chrome.runtime.getBackgroundPage', arguments);
- setTimeout(function() {
- callback(mobile.bgWindow);
- }, 0);
-};
-
-exports.getURL = function(subResource) {
- argscheck.checkArgs('s', 'chrome.runtime.getURL', arguments);
- if (subResource.charAt(0) == '/') {
- subResource = subResource.slice(1);
- }
- var prefix = location.href.replace(/[^\/]*$/, '');
- return prefix + subResource;
-};
-
-exports.reload = function() {
- location.reload();
-};
-
-stubs.createStub(exports, 'id', '{appId}');
-stubs.createStub(exports, 'requestUpdateCheck', function(){});
-});
[12/30] New filenames.Url aliases.(New AppBundle plugin needed).Desc
cont below Android has a bug where the web view will not throw intercept
events if you are navigating to a location that matches a filename in your
bundle. Thus in order to support url
Posted by ag...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/cdvah_js/libs/angular.min.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/libs/angular.min.js b/www/cdvah_js/libs/angular.min.js
new file mode 100644
index 0000000..486d5e1
--- /dev/null
+++ b/www/cdvah_js/libs/angular.min.js
@@ -0,0 +1,173 @@
+/*
+ AngularJS v1.1.4
+ (c) 2010-2012 Google, Inc. http://angularjs.org
+ License: MIT
+*/
+(function(M,V,s){'use strict';function gc(){var b=M.angular;M.angular=hc;return b}function o(b,a,c){var d;if(b)if(I(b))for(d in b)d!="prototype"&&d!="length"&&d!="name"&&b.hasOwnProperty(d)&&a.call(c,b[d],d);else if(b.forEach&&b.forEach!==o)b.forEach(a,c);else if(!b||typeof b.length!=="number"?0:typeof b.hasOwnProperty!="function"&&typeof b.constructor!="function"||b instanceof P||ca&&b instanceof ca||Da.call(b)!=="[object Object]"||typeof b.callee==="function")for(d=0;d<b.length;d++)a.call(c,b[d],
+d);else for(d in b)b.hasOwnProperty(d)&&a.call(c,b[d],d);return b}function rb(b){var a=[],c;for(c in b)b.hasOwnProperty(c)&&a.push(c);return a.sort()}function ic(b,a,c){for(var d=rb(b),e=0;e<d.length;e++)a.call(c,b[d[e]],d[e]);return d}function sb(b){return function(a,c){b(c,a)}}function Ea(){for(var b=Z.length,a;b;){b--;a=Z[b].charCodeAt(0);if(a==57)return Z[b]="A",Z.join("");if(a==90)Z[b]="0";else return Z[b]=String.fromCharCode(a+1),Z.join("")}Z.unshift("0");return Z.join("")}function y(b){o(arguments,
+function(a){a!==b&&o(a,function(a,d){b[d]=a})});return b}function K(b){return parseInt(b,10)}function Fa(b,a){return y(new (y(function(){},{prototype:b})),a)}function t(){}function pa(b){return b}function Q(b){return function(){return b}}function u(b){return typeof b=="undefined"}function w(b){return typeof b!="undefined"}function L(b){return b!=null&&typeof b=="object"}function x(b){return typeof b=="string"}function Za(b){return typeof b=="number"}function qa(b){return Da.apply(b)=="[object Date]"}
+function C(b){return Da.apply(b)=="[object Array]"}function I(b){return typeof b=="function"}function ra(b){return b&&b.document&&b.location&&b.alert&&b.setInterval}function S(b){return x(b)?b.replace(/^\s*/,"").replace(/\s*$/,""):b}function jc(b){return b&&(b.nodeName||b.bind&&b.find)}function $a(b,a,c){var d=[];o(b,function(b,f,i){d.push(a.call(c,b,f,i))});return d}function Ga(b,a){if(b.indexOf)return b.indexOf(a);for(var c=0;c<b.length;c++)if(a===b[c])return c;return-1}function sa(b,a){var c=Ga(b,
+a);c>=0&&b.splice(c,1);return a}function W(b,a){if(ra(b)||b&&b.$evalAsync&&b.$watch)throw Error("Can't copy Window or Scope");if(a){if(b===a)throw Error("Can't copy equivalent objects or arrays");if(C(b))for(var c=a.length=0;c<b.length;c++)a.push(W(b[c]));else for(c in o(a,function(b,c){delete a[c]}),b)a[c]=W(b[c])}else(a=b)&&(C(b)?a=W(b,[]):qa(b)?a=new Date(b.getTime()):L(b)&&(a=W(b,{})));return a}function kc(b,a){var a=a||{},c;for(c in b)b.hasOwnProperty(c)&&c.substr(0,2)!=="$$"&&(a[c]=b[c]);return a}
+function ja(b,a){if(b===a)return!0;if(b===null||a===null)return!1;if(b!==b&&a!==a)return!0;var c=typeof b,d;if(c==typeof a&&c=="object")if(C(b)){if((c=b.length)==a.length){for(d=0;d<c;d++)if(!ja(b[d],a[d]))return!1;return!0}}else if(qa(b))return qa(a)&&b.getTime()==a.getTime();else{if(b&&b.$evalAsync&&b.$watch||a&&a.$evalAsync&&a.$watch||ra(b)||ra(a))return!1;c={};for(d in b)if(!(d.charAt(0)==="$"||I(b[d]))){if(!ja(b[d],a[d]))return!1;c[d]=!0}for(d in a)if(!c[d]&&d.charAt(0)!=="$"&&a[d]!==s&&!I(a[d]))return!1;
+return!0}return!1}function ab(b,a){var c=arguments.length>2?ka.call(arguments,2):[];return I(a)&&!(a instanceof RegExp)?c.length?function(){return arguments.length?a.apply(b,c.concat(ka.call(arguments,0))):a.apply(b,c)}:function(){return arguments.length?a.apply(b,arguments):a.call(b)}:a}function lc(b,a){var c=a;/^\$+/.test(b)?c=s:ra(a)?c="$WINDOW":a&&V===a?c="$DOCUMENT":a&&a.$evalAsync&&a.$watch&&(c="$SCOPE");return c}function da(b,a){return JSON.stringify(b,lc,a?" ":null)}function tb(b){return x(b)?
+JSON.parse(b):b}function Ha(b){b&&b.length!==0?(b=J(""+b),b=!(b=="f"||b=="0"||b=="false"||b=="no"||b=="n"||b=="[]")):b=!1;return b}function ta(b){b=v(b).clone();try{b.html("")}catch(a){}var c=v("<div>").append(b).html();try{return b[0].nodeType===3?J(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+J(b)})}catch(d){return J(c)}}function bb(b){var a={},c,d;o((b||"").split("&"),function(b){b&&(c=b.split("="),d=decodeURIComponent(c[0]),a[d]=w(c[1])?decodeURIComponent(c[1]):!0)});
+return a}function ub(b){var a=[];o(b,function(b,d){a.push(ua(d,!0)+(b===!0?"":"="+ua(b,!0)))});return a.length?a.join("&"):""}function cb(b){return ua(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ua(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,a?"%20":"+")}function mc(b,a){function c(a){a&&d.push(a)}var d=[b],e,f,i=["ng:app","ng-app","x-ng-app","data-ng-app"],h=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;
+o(i,function(a){i[a]=!0;c(V.getElementById(a));a=a.replace(":","\\:");b.querySelectorAll&&(o(b.querySelectorAll("."+a),c),o(b.querySelectorAll("."+a+"\\:"),c),o(b.querySelectorAll("["+a+"]"),c))});o(d,function(a){if(!e){var b=h.exec(" "+a.className+" ");b?(e=a,f=(b[2]||"").replace(/\s+/g,",")):o(a.attributes,function(b){if(!e&&i[b.name])e=a,f=b.value})}});e&&a(e,f?[f]:[])}function vb(b,a){var c=function(){b=v(b);a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);a.unshift("ng");
+var c=wb(a);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},d=/^NG_DEFER_BOOTSTRAP!/;if(M&&!d.test(M.name))return c();M.name=M.name.replace(d,"");Ia.resumeBootstrap=function(b){o(b,function(b){a.push(b)});c()}}function db(b,a){a=a||"_";return b.replace(nc,function(b,d){return(d?a:"")+b.toLowerCase()})}function eb(b,a,c){if(!b)throw Error("Argument '"+(a||"?")+"' is "+(c||"required"));return b}function va(b,
+a,c){c&&C(b)&&(b=b[b.length-1]);eb(I(b),a,"not a function, got "+(b&&typeof b=="object"?b.constructor.name||"Object":typeof b));return b}function oc(b){function a(a,b,e){return a[b]||(a[b]=e())}return a(a(b,"angular",Object),"module",function(){var b={};return function(d,e,f){e&&b.hasOwnProperty(d)&&(b[d]=null);return a(b,d,function(){function a(c,d,e){return function(){b[e||"push"]([c,d,arguments]);return m}}if(!e)throw Error("No module: "+d);var b=[],c=[],g=a("$injector","invoke"),m={_invokeQueue:b,
+_runBlocks:c,requires:e,name:d,provider:a("$provide","provider"),factory:a("$provide","factory"),service:a("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),animation:a("$animationProvider","register"),filter:a("$filterProvider","register"),controller:a("$controllerProvider","register"),directive:a("$compileProvider","directive"),config:g,run:function(a){c.push(a);return this}};f&&g(f);return m})}})}function Ja(b){return b.replace(pc,function(a,b,d,e){return e?
+d.toUpperCase():d}).replace(qc,"Moz$1")}function fb(b,a){function c(){var e;for(var b=[this],c=a,i,h,j,g,m,k;b.length;){i=b.shift();h=0;for(j=i.length;h<j;h++){g=v(i[h]);c?g.triggerHandler("$destroy"):c=!c;m=0;for(e=(k=g.children()).length,g=e;m<g;m++)b.push(ca(k[m]))}}return d.apply(this,arguments)}var d=ca.fn[b],d=d.$original||d;c.$original=d;ca.fn[b]=c}function P(b){if(b instanceof P)return b;if(!(this instanceof P)){if(x(b)&&b.charAt(0)!="<")throw Error("selectors not implemented");return new P(b)}if(x(b)){var a=
+V.createElement("div");a.innerHTML="<div> </div>"+b;a.removeChild(a.firstChild);gb(this,a.childNodes);this.remove()}else gb(this,b)}function hb(b){return b.cloneNode(!0)}function wa(b){xb(b);for(var a=0,b=b.childNodes||[];a<b.length;a++)wa(b[a])}function yb(b,a,c){var d=$(b,"events");$(b,"handle")&&(u(a)?o(d,function(a,c){ib(b,c,a);delete d[c]}):u(c)?(ib(b,a,d[a]),delete d[a]):sa(d[a],c))}function xb(b){var a=b[Ka],c=La[a];c&&(c.handle&&(c.events.$destroy&&c.handle({},"$destroy"),yb(b)),delete La[a],
+b[Ka]=s)}function $(b,a,c){var d=b[Ka],d=La[d||-1];if(w(c))d||(b[Ka]=d=++rc,d=La[d]={}),d[a]=c;else return d&&d[a]}function zb(b,a,c){var d=$(b,"data"),e=w(c),f=!e&&w(a),i=f&&!L(a);!d&&!i&&$(b,"data",d={});if(e)d[a]=c;else if(f)if(i)return d&&d[a];else y(d,a);else return d}function Ma(b,a){return(" "+b.className+" ").replace(/[\n\t]/g," ").indexOf(" "+a+" ")>-1}function Ab(b,a){a&&o(a.split(" "),function(a){b.className=S((" "+b.className+" ").replace(/[\n\t]/g," ").replace(" "+S(a)+" "," "))})}function Bb(b,
+a){a&&o(a.split(" "),function(a){if(!Ma(b,a))b.className=S(b.className+" "+S(a))})}function gb(b,a){if(a)for(var a=!a.nodeName&&w(a.length)&&!ra(a)?a:[a],c=0;c<a.length;c++)b.push(a[c])}function Cb(b,a){return Na(b,"$"+(a||"ngController")+"Controller")}function Na(b,a,c){b=v(b);for(b[0].nodeType==9&&(b=b.find("html"));b.length;){if(c=b.data(a))return c;b=b.parent()}}function Db(b,a){var c=Oa[a.toLowerCase()];return c&&Eb[b.nodeName]&&c}function sc(b,a){var c=function(c,e){if(!c.preventDefault)c.preventDefault=
+function(){c.returnValue=!1};if(!c.stopPropagation)c.stopPropagation=function(){c.cancelBubble=!0};if(!c.target)c.target=c.srcElement||V;if(u(c.defaultPrevented)){var f=c.preventDefault;c.preventDefault=function(){c.defaultPrevented=!0;f.call(c)};c.defaultPrevented=!1}c.isDefaultPrevented=function(){return c.defaultPrevented};o(a[e||c.type],function(a){a.call(b,c)});X<=8?(c.preventDefault=null,c.stopPropagation=null,c.isDefaultPrevented=null):(delete c.preventDefault,delete c.stopPropagation,delete c.isDefaultPrevented)};
+c.elem=b;return c}function la(b){var a=typeof b,c;if(a=="object"&&b!==null)if(typeof(c=b.$$hashKey)=="function")c=b.$$hashKey();else{if(c===s)c=b.$$hashKey=Ea()}else c=b;return a+":"+c}function Pa(b){o(b,this.put,this)}function Fb(b){var a,c;if(typeof b=="function"){if(!(a=b.$inject))a=[],c=b.toString().replace(tc,""),c=c.match(uc),o(c[1].split(vc),function(b){b.replace(wc,function(b,c,d){a.push(d)})}),b.$inject=a}else C(b)?(c=b.length-1,va(b[c],"fn"),a=b.slice(0,c)):va(b,"fn",!0);return a}function wb(b){function a(a){return function(b,
+c){if(L(b))o(b,sb(a));else return a(b,c)}}function c(a,b){if(I(b)||C(b))b=k.instantiate(b);if(!b.$get)throw Error("Provider "+a+" must define $get factory method.");return m[a+h]=b}function d(a,b){return c(a,{$get:b})}function e(a){var b=[];o(a,function(a){if(!g.get(a))if(g.put(a,!0),x(a)){var c=xa(a);b=b.concat(e(c.requires)).concat(c._runBlocks);try{for(var d=c._invokeQueue,c=0,h=d.length;c<h;c++){var f=d[c],n=k.get(f[0]);n[f[1]].apply(n,f[2])}}catch(j){throw j.message&&(j.message+=" from "+a),
+j;}}else if(I(a))try{b.push(k.invoke(a))}catch(i){throw i.message&&(i.message+=" from "+a),i;}else if(C(a))try{b.push(k.invoke(a))}catch(l){throw l.message&&(l.message+=" from "+String(a[a.length-1])),l;}else va(a,"module")});return b}function f(a,b){function c(d){if(typeof d!=="string")throw Error("Service name expected");if(a.hasOwnProperty(d)){if(a[d]===i)throw Error("Circular dependency: "+j.join(" <- "));return a[d]}else try{return j.unshift(d),a[d]=i,a[d]=b(d)}finally{j.shift()}}function d(a,
+b,e){var g=[],h=Fb(a),f,j,n;j=0;for(f=h.length;j<f;j++)n=h[j],g.push(e&&e.hasOwnProperty(n)?e[n]:c(n));a.$inject||(a=a[f]);switch(b?-1:g.length){case 0:return a();case 1:return a(g[0]);case 2:return a(g[0],g[1]);case 3:return a(g[0],g[1],g[2]);case 4:return a(g[0],g[1],g[2],g[3]);case 5:return a(g[0],g[1],g[2],g[3],g[4]);case 6:return a(g[0],g[1],g[2],g[3],g[4],g[5]);case 7:return a(g[0],g[1],g[2],g[3],g[4],g[5],g[6]);case 8:return a(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7]);case 9:return a(g[0],g[1],
+g[2],g[3],g[4],g[5],g[6],g[7],g[8]);case 10:return a(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9]);default:return a.apply(b,g)}}return{invoke:d,instantiate:function(a,b){var c=function(){},e;c.prototype=(C(a)?a[a.length-1]:a).prototype;c=new c;e=d(a,c,b);return L(e)?e:c},get:c,annotate:Fb}}var i={},h="Provider",j=[],g=new Pa,m={$provide:{provider:a(c),factory:a(d),service:a(function(a,b){return d(a,["$injector",function(a){return a.instantiate(b)}])}),value:a(function(a,b){return d(a,Q(b))}),
+constant:a(function(a,b){m[a]=b;l[a]=b}),decorator:function(a,b){var c=k.get(a+h),d=c.$get;c.$get=function(){var a=q.invoke(d,c);return q.invoke(b,null,{$delegate:a})}}}},k=m.$injector=f(m,function(){throw Error("Unknown provider: "+j.join(" <- "));}),l={},q=l.$injector=f(l,function(a){a=k.get(a+h);return q.invoke(a.$get,a)});o(e(b),function(a){q.invoke(a||t)});return q}function xc(){var b=!0;this.disableAutoScrolling=function(){b=!1};this.$get=["$window","$location","$rootScope",function(a,c,d){function e(a){var b=
+null;o(a,function(a){!b&&J(a.nodeName)==="a"&&(b=a)});return b}function f(){var b=c.hash(),d;b?(d=i.getElementById(b))?d.scrollIntoView():(d=e(i.getElementsByName(b)))?d.scrollIntoView():b==="top"&&a.scrollTo(0,0):a.scrollTo(0,0)}var i=a.document;b&&d.$watch(function(){return c.hash()},function(){d.$evalAsync(f)});return f}]}function Gb(b){this.register=function(a,c){b.factory(Ja(a)+"Animation",c)};this.$get=["$injector",function(a){return function(b){if(b)try{return a.get(Ja(b)+"Animation")}catch(d){}}}]}
+function yc(b,a,c,d){function e(a){try{a.apply(null,ka.call(arguments,1))}finally{if(n--,n===0)for(;B.length;)try{B.pop()()}catch(b){c.error(b)}}}function f(a,b){(function z(){o(r,function(a){a()});p=b(z,a)})()}function i(){E!=h.url()&&(E=h.url(),o(G,function(a){a(h.url())}))}var h=this,j=a[0],g=b.location,m=b.history,k=b.setTimeout,l=b.clearTimeout,q={};h.isMock=!1;var n=0,B=[];h.$$completeOutstandingRequest=e;h.$$incOutstandingRequestCount=function(){n++};h.notifyWhenNoOutstandingRequests=function(a){o(r,
+function(a){a()});n===0?a():B.push(a)};var r=[],p;h.addPollFn=function(a){u(p)&&f(100,k);r.push(a);return a};var E=g.href,D=a.find("base");h.url=function(a,b){if(a){if(E!=a)return E=a,d.history?b?m.replaceState(null,"",a):(m.pushState(null,"",a),D.attr("href",D.attr("href"))):b?g.replace(a):g.href=a,h}else return g.href.replace(/%27/g,"'")};var G=[],R=!1;h.onUrlChange=function(a){R||(d.history&&v(b).bind("popstate",i),d.hashchange?v(b).bind("hashchange",i):h.addPollFn(i),R=!0);G.push(a);return a};
+h.baseHref=function(){var a=D.attr("href");return a?a.replace(/^https?\:\/\/[^\/]*/,""):""};var A={},H="",F=h.baseHref();h.cookies=function(a,b){var d,e,g,h;if(a)if(b===s)j.cookie=escape(a)+"=;path="+F+";expires=Thu, 01 Jan 1970 00:00:00 GMT";else{if(x(b))d=(j.cookie=escape(a)+"="+escape(b)+";path="+F).length+1,d>4096&&c.warn("Cookie '"+a+"' possibly not set or overflowed because it was too large ("+d+" > 4096 bytes)!")}else{if(j.cookie!==H){H=j.cookie;d=H.split("; ");A={};for(g=0;g<d.length;g++)e=
+d[g],h=e.indexOf("="),h>0&&(A[unescape(e.substring(0,h))]=unescape(e.substring(h+1)))}return A}};h.defer=function(a,b){var c;n++;c=k(function(){delete q[c];e(a)},b||0);q[c]=!0;return c};h.defer.cancel=function(a){return q[a]?(delete q[a],l(a),e(t),!0):!1}}function zc(){this.$get=["$window","$log","$sniffer","$document",function(b,a,c,d){return new yc(b,d,a,c)}]}function Ac(){this.$get=function(){function b(b,d){function e(a){if(a!=k){if(l){if(l==a)l=a.n}else l=a;f(a.n,a.p);f(a,k);k=a;k.n=null}}function f(a,
+b){if(a!=b){if(a)a.p=b;if(b)b.n=a}}if(b in a)throw Error("cacheId "+b+" taken");var i=0,h=y({},d,{id:b}),j={},g=d&&d.capacity||Number.MAX_VALUE,m={},k=null,l=null;return a[b]={put:function(a,b){var c=m[a]||(m[a]={key:a});e(c);if(!u(b))return a in j||i++,j[a]=b,i>g&&this.remove(l.key),b},get:function(a){var b=m[a];if(b)return e(b),j[a]},remove:function(a){var b=m[a];if(b){if(b==k)k=b.p;if(b==l)l=b.n;f(b.n,b.p);delete m[a];delete j[a];i--}},removeAll:function(){j={};i=0;m={};k=l=null},destroy:function(){m=
+h=j=null;delete a[b]},info:function(){return y({},h,{size:i})}}}var a={};b.info=function(){var b={};o(a,function(a,e){b[e]=a.info()});return b};b.get=function(b){return a[b]};return b}}function Bc(){this.$get=["$cacheFactory",function(b){return b("templates")}]}function Hb(b){var a={},c="Directive",d=/^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,e=/(([\d\w\-_]+)(?:\:([^;]+))?;?)/,f="Template must have exactly one root element. was: ",i=/^\s*(https?|ftp|mailto|file):/;this.directive=function j(d,e){x(d)?
+(eb(e,"directive"),a.hasOwnProperty(d)||(a[d]=[],b.factory(d+c,["$injector","$exceptionHandler",function(b,c){var e=[];o(a[d],function(a){try{var f=b.invoke(a);if(I(f))f={compile:Q(f)};else if(!f.compile&&f.link)f.compile=Q(f.link);f.priority=f.priority||0;f.name=f.name||d;f.require=f.require||f.controller&&f.name;f.restrict=f.restrict||"A";e.push(f)}catch(j){c(j)}});return e}])),a[d].push(e)):o(d,sb(j));return this};this.urlSanitizationWhitelist=function(a){return w(a)?(i=a,this):i};this.$get=["$injector",
+"$interpolate","$exceptionHandler","$http","$templateCache","$parse","$controller","$rootScope","$document",function(b,g,m,k,l,q,n,B,r){function p(a,b,c){a instanceof v||(a=v(a));o(a,function(b,c){b.nodeType==3&&b.nodeValue.match(/\S+/)&&(a[c]=v(b).wrap("<span></span>").parent()[0])});var d=D(a,b,a,c);return function(b,c){eb(b,"scope");for(var e=c?za.clone.call(a):a,g=0,f=e.length;g<f;g++){var j=e[g];(j.nodeType==1||j.nodeType==9)&&e.eq(g).data("$scope",b)}E(e,"ng-scope");c&&c(e,b);d&&d(b,e,e);return e}}
+function E(a,b){try{a.addClass(b)}catch(c){}}function D(a,b,c,d){function e(a,c,d,f){var j,i,l,m,n,k,q,p=[];n=0;for(k=c.length;n<k;n++)p.push(c[n]);q=n=0;for(k=g.length;n<k;q++)i=p[q],c=g[n++],j=g[n++],c?(c.scope?(l=a.$new(L(c.scope)),v(i).data("$scope",l)):l=a,(m=c.transclude)||!f&&b?c(j,l,i,d,function(b){return function(c){var d=a.$new();d.$$transcluded=!0;return b(d,c).bind("$destroy",ab(d,d.$destroy))}}(m||b)):c(j,l,i,s,f)):j&&j(a,i.childNodes,s,f)}for(var g=[],f,j,i,l=0;l<a.length;l++)j=new ya,
+f=G(a[l],[],j,d),j=(f=f.length?R(f,a[l],j,b,c):null)&&f.terminal||!a[l].childNodes||!a[l].childNodes.length?null:D(a[l].childNodes,f?f.transclude:b),g.push(f),g.push(j),i=i||f||j;return i?e:null}function G(a,b,c,g){var f=c.$attr,j;switch(a.nodeType){case 1:A(b,aa(jb(a).toLowerCase()),"E",g);var i,l,n;j=a.attributes;for(var m=0,k=j&&j.length;m<k;m++)if(i=j[m],i.specified)l=i.name,n=aa(l),ha.test(n)&&(l=n.substr(6).toLowerCase()),n=aa(l.toLowerCase()),f[n]=l,c[n]=i=S(X&&l=="href"?decodeURIComponent(a.getAttribute(l,
+2)):i.value),Db(a,n)&&(c[n]=!0),z(a,b,i,n),A(b,n,"A",g);a=a.className;if(x(a)&&a!=="")for(;j=e.exec(a);)n=aa(j[2]),A(b,n,"C",g)&&(c[n]=S(j[3])),a=a.substr(j.index+j[0].length);break;case 3:ga(b,a.nodeValue);break;case 8:try{if(j=d.exec(a.nodeValue))n=aa(j[1]),A(b,n,"M",g)&&(c[n]=S(j[2]))}catch(q){}}b.sort(N);return b}function R(a,b,c,d,e){function j(a,b){if(a)a.require=z.require,B.push(a);if(b)b.require=z.require,r.push(b)}function i(a,b){var c,d="data",e=!1;if(x(a)){for(;(c=a.charAt(0))=="^"||c==
+"?";)a=a.substr(1),c=="^"&&(d="inheritedData"),e=e||c=="?";c=b[d]("$"+a+"Controller");if(!c&&!e)throw Error("No controller: "+a);}else C(a)&&(c=[],o(a,function(a){c.push(i(a,b))}));return c}function l(a,d,e,f,j){var k,p,D,G,H;k=b===e?c:kc(c,new ya(v(e),c.$attr));p=k.$$element;if(ba){var z=/^\s*([@=&])(\??)\s*(\w*)\s*$/,F=d.$parent||d;o(ba.scope,function(a,b){var c=a.match(z)||[],e=c[3]||b,f=c[2]=="?",c=c[1],j,l,i;d.$$isolateBindings[b]=c+e;switch(c){case "@":k.$observe(e,function(a){d[b]=a});k.$$observers[e].$$scope=
+F;k[e]&&(d[b]=g(k[e])(F));break;case "=":if(f&&!k[e])break;l=q(k[e]);i=l.assign||function(){j=d[b]=l(F);throw Error(Ib+k[e]+" (directive: "+ba.name+")");};j=d[b]=l(F);d.$watch(function(){var a=l(F);a!==d[b]&&(a!==j?j=d[b]=a:i(F,a=j=d[b]));return a});break;case "&":l=q(k[e]);d[b]=function(a){return l(F,a)};break;default:throw Error("Invalid isolate scope definition for directive "+ba.name+": "+a);}})}ha&&o(ha,function(a){var b={$scope:d,$element:p,$attrs:k,$transclude:j};H=a.controller;H=="@"&&(H=
+k[a.name]);p.data("$"+a.name+"Controller",n(H,b))});f=0;for(D=B.length;f<D;f++)try{G=B[f],G(d,p,k,G.require&&i(G.require,p))}catch(E){m(E,ta(p))}a&&a(d,e.childNodes,s,j);f=0;for(D=r.length;f<D;f++)try{G=r[f],G(d,p,k,G.require&&i(G.require,p))}catch(N){m(N,ta(p))}}for(var k=-Number.MAX_VALUE,B=[],r=[],D=null,ba=null,N=null,A=c.$$element=v(b),z,T,R,ga,ia=d,ha,t,y,w=0,u=a.length;w<u;w++){z=a[w];R=s;if(k>z.priority)break;if(y=z.scope)ea("isolated scope",ba,z,A),L(y)&&(E(A,"ng-isolate-scope"),ba=z),E(A,
+"ng-scope"),D=D||z;T=z.name;if(y=z.controller)ha=ha||{},ea("'"+T+"' controller",ha[T],z,A),ha[T]=z;if(y=z.transclude)ea("transclusion",ga,z,A),ga=z,k=z.priority,y=="element"?(R=v(b),A=c.$$element=v(V.createComment(" "+T+": "+c[T]+" ")),b=A[0],fa(e,v(R[0]),b),ia=p(R,d,k)):(R=v(hb(b)).contents(),A.html(""),ia=p(R,d));if(z.template)if(ea("template",N,z,A),N=z,y=I(z.template)?z.template(A,c):z.template,y=Jb(y),z.replace){R=v("<div>"+S(y)+"</div>").contents();b=R[0];if(R.length!=1||b.nodeType!==1)throw Error(f+
+y);fa(e,A,b);T={$attr:{}};a=a.concat(G(b,a.splice(w+1,a.length-(w+1)),T));H(c,T);u=a.length}else A.html(y);if(z.templateUrl)ea("template",N,z,A),N=z,l=F(a.splice(w,a.length-w),l,A,c,e,z.replace,ia),u=a.length;else if(z.compile)try{t=z.compile(A,c,ia),I(t)?j(null,t):t&&j(t.pre,t.post)}catch(J){m(J,ta(A))}if(z.terminal)l.terminal=!0,k=Math.max(k,z.priority)}l.scope=D&&D.scope;l.transclude=ga&&ia;return l}function A(d,e,g,f){var l=!1;if(a.hasOwnProperty(e))for(var i,e=b.get(e+c),n=0,k=e.length;n<k;n++)try{if(i=
+e[n],(f===s||f>i.priority)&&i.restrict.indexOf(g)!=-1)d.push(i),l=!0}catch(q){m(q)}return l}function H(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;o(a,function(d,e){e.charAt(0)!="$"&&(b[e]&&(d+=(e==="style"?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});o(b,function(b,g){g=="class"?(E(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):g=="style"?e.attr("style",e.attr("style")+";"+b):g.charAt(0)!="$"&&!a.hasOwnProperty(g)&&(a[g]=b,d[g]=c[g])})}function F(a,b,c,d,e,g,j){var i=[],n,m,q=c[0],p=a.shift(),ya=y({},
+p,{controller:null,templateUrl:null,transclude:null,scope:null}),p=I(p.templateUrl)?p.templateUrl(c,d):p.templateUrl;c.html("");k.get(p,{cache:l}).success(function(l){var k,p,l=Jb(l);if(g){p=v("<div>"+S(l)+"</div>").contents();k=p[0];if(p.length!=1||k.nodeType!==1)throw Error(f+l);l={$attr:{}};fa(e,c,k);G(k,a,l);H(d,l)}else k=q,c.html(l);a.unshift(ya);n=R(a,k,d,j);for(m=D(c[0].childNodes,j);i.length;){var B=i.shift(),l=i.shift();p=i.shift();var r=i.shift(),F=k;l!==q&&(F=hb(k),fa(p,v(l),F));n(function(){b(m,
+B,F,e,r)},B,F,e,r)}i=null}).error(function(a,b,c,d){throw Error("Failed to load template: "+d.url);});return function(a,c,d,e,g){i?(i.push(c),i.push(d),i.push(e),i.push(g)):n(function(){b(m,c,d,e,g)},c,d,e,g)}}function N(a,b){return b.priority-a.priority}function ea(a,b,c,d){if(b)throw Error("Multiple directives ["+b.name+", "+c.name+"] asking for "+a+" on: "+ta(d));}function ga(a,b){var c=g(b,!0);c&&a.push({priority:0,compile:Q(function(a,b){var d=b.parent(),e=d.data("$binding")||[];e.push(c);E(d.data("$binding",
+e),"ng-binding");a.$watch(c,function(a){b[0].nodeValue=a})})})}function z(a,b,c,d){var e=g(c,!0);e&&b.push({priority:100,compile:Q(function(a,b,c){b=c.$$observers||(c.$$observers={});if(e=g(c[d],!0))c[d]=e(a),(b[d]||(b[d]=[])).$$inter=!0,(c.$$observers&&c.$$observers[d].$$scope||a).$watch(e,function(a){c.$set(d,a)})})})}function fa(a,b,c){var d=b[0],e=d.parentNode,g,f;if(a){g=0;for(f=a.length;g<f;g++)if(a[g]==d){a[g]=c;break}}e&&e.replaceChild(c,d);c[v.expando]=d[v.expando];b[0]=c}var ya=function(a,
+b){this.$$element=a;this.$attr=b||{}};ya.prototype={$normalize:aa,$set:function(a,b,c,d){var e=Db(this.$$element[0],a),g=this.$$observers;e&&(this.$$element.prop(a,b),d=e);this[a]=b;d?this.$attr[a]=d:(d=this.$attr[a])||(this.$attr[a]=d=db(a,"-"));if(jb(this.$$element[0])==="A"&&a==="href")ba.setAttribute("href",b),e=ba.href,e.match(i)||(this[a]=b="unsafe:"+e);c!==!1&&(b===null||b===s?this.$$element.removeAttr(d):this.$$element.attr(d,b));g&&o(g[a],function(a){try{a(b)}catch(c){m(c)}})},$observe:function(a,
+b){var c=this,d=c.$$observers||(c.$$observers={}),e=d[a]||(d[a]=[]);e.push(b);B.$evalAsync(function(){e.$$inter||b(c[a])});return b}};var ba=r[0].createElement("a"),T=g.startSymbol(),ia=g.endSymbol(),Jb=T=="{{"||ia=="}}"?pa:function(a){return a.replace(/\{\{/g,T).replace(/}}/g,ia)},ha=/^ngAttr[A-Z]/;return p}]}function aa(b){return Ja(b.replace(Cc,""))}function Dc(){var b={};this.register=function(a,c){L(a)?y(b,a):b[a]=c};this.$get=["$injector","$window",function(a,c){return function(d,e){if(x(d)){var f=
+d,d=b.hasOwnProperty(f)?b[f]:kb(e.$scope,f,!0)||kb(c,f,!0);va(d,f,!0)}return a.instantiate(d,e)}}]}function Ec(){this.$get=["$window",function(b){return v(b.document)}]}function Fc(){this.$get=["$log",function(b){return function(a,c){b.error.apply(b,arguments)}}]}function Gc(){var b="{{",a="}}";this.startSymbol=function(a){return a?(b=a,this):b};this.endSymbol=function(b){return b?(a=b,this):a};this.$get=["$parse","$exceptionHandler",function(c,d){function e(e,j){for(var g,m,k=0,l=[],q=e.length,n=
+!1,B=[];k<q;)(g=e.indexOf(b,k))!=-1&&(m=e.indexOf(a,g+f))!=-1?(k!=g&&l.push(e.substring(k,g)),l.push(k=c(n=e.substring(g+f,m))),k.exp=n,k=m+i,n=!0):(k!=q&&l.push(e.substring(k)),k=q);if(!(q=l.length))l.push(""),q=1;if(!j||n)return B.length=q,k=function(a){try{for(var b=0,c=q,g;b<c;b++){if(typeof(g=l[b])=="function")g=g(a),g==null||g==s?g="":typeof g!="string"&&(g=da(g));B[b]=g}return B.join("")}catch(f){d(Error("Error while interpolating: "+e+"\n"+f.toString()))}},k.exp=e,k.parts=l,k}var f=b.length,
+i=a.length;e.startSymbol=function(){return b};e.endSymbol=function(){return a};return e}]}function Kb(b){for(var b=b.split("/"),a=b.length;a--;)b[a]=cb(b[a]);return b.join("/")}function Aa(b,a){var c=lb.exec(b),c={protocol:c[1],host:c[3],port:K(c[5])||Ba[c[1]]||null,path:c[6]||"/",search:c[8],hash:c[10]};if(a)a.$$protocol=c.protocol,a.$$host=c.host,a.$$port=c.port;return c}function ma(b,a,c){return b+"://"+a+(c==Ba[b]?"":":"+c)}function Hc(b,a,c){var d=Aa(b);return decodeURIComponent(d.path)!=a||
+u(d.hash)||d.hash.indexOf(c)!==0?b:ma(d.protocol,d.host,d.port)+a.substr(0,a.lastIndexOf("/"))+d.hash.substr(c.length)}function Ic(b,a,c){var d=Aa(b);if(decodeURIComponent(d.path)==a&&!u(d.hash)&&d.hash.indexOf(c)===0)return b;else{var e=d.search&&"?"+d.search||"",f=d.hash&&"#"+d.hash||"",i=a.substr(0,a.lastIndexOf("/")),h=d.path.substr(i.length);if(d.path.indexOf(i)!==0)throw Error('Invalid url "'+b+'", missing path prefix "'+i+'" !');return ma(d.protocol,d.host,d.port)+a+"#"+c+h+e+f}}function mb(b,
+a,c){a=a||"";this.$$parse=function(b){var c=Aa(b,this);if(c.path.indexOf(a)!==0)throw Error('Invalid url "'+b+'", missing path prefix "'+a+'" !');this.$$path=decodeURIComponent(c.path.substr(a.length));this.$$search=bb(c.search);this.$$hash=c.hash&&decodeURIComponent(c.hash)||"";this.$$compose()};this.$$compose=function(){var b=ub(this.$$search),c=this.$$hash?"#"+cb(this.$$hash):"";this.$$url=Kb(this.$$path)+(b?"?"+b:"")+c;this.$$absUrl=ma(this.$$protocol,this.$$host,this.$$port)+a+this.$$url};this.$$rewriteAppUrl=
+function(a){if(a.indexOf(c)==0)return a};this.$$parse(b)}function Qa(b,a,c){var d;this.$$parse=function(b){var c=Aa(b,this);if(c.hash&&c.hash.indexOf(a)!==0)throw Error('Invalid url "'+b+'", missing hash prefix "'+a+'" !');d=c.path+(c.search?"?"+c.search:"");c=Jc.exec((c.hash||"").substr(a.length));this.$$path=c[1]?(c[1].charAt(0)=="/"?"":"/")+decodeURIComponent(c[1]):"";this.$$search=bb(c[3]);this.$$hash=c[5]&&decodeURIComponent(c[5])||"";this.$$compose()};this.$$compose=function(){var b=ub(this.$$search),
+c=this.$$hash?"#"+cb(this.$$hash):"";this.$$url=Kb(this.$$path)+(b?"?"+b:"")+c;this.$$absUrl=ma(this.$$protocol,this.$$host,this.$$port)+d+(this.$$url?"#"+a+this.$$url:"")};this.$$rewriteAppUrl=function(a){if(a.indexOf(c)==0)return a};this.$$parse(b)}function Lb(b,a,c,d){Qa.apply(this,arguments);this.$$rewriteAppUrl=function(b){if(b.indexOf(c)==0)return c+d+"#"+a+b.substr(c.length)}}function Ra(b){return function(){return this[b]}}function Mb(b,a){return function(c){if(u(c))return this[b];this[b]=
+a(c);this.$$compose();return this}}function Kc(){var b="",a=!1;this.hashPrefix=function(a){return w(a)?(b=a,this):b};this.html5Mode=function(b){return w(b)?(a=b,this):a};this.$get=["$rootScope","$browser","$sniffer","$rootElement",function(c,d,e,f){function i(a){c.$broadcast("$locationChangeSuccess",h.absUrl(),a)}var h,j,g,m=d.url(),k=Aa(m);a?(j=d.baseHref()||"/",g=j.substr(0,j.lastIndexOf("/")),k=ma(k.protocol,k.host,k.port)+g+"/",h=e.history?new mb(Hc(m,j,b),g,k):new Lb(Ic(m,j,b),b,k,j.substr(g.length+
+1))):(k=ma(k.protocol,k.host,k.port)+(k.path||"")+(k.search?"?"+k.search:"")+"#"+b+"/",h=new Qa(m,b,k));f.bind("click",function(a){if(!a.ctrlKey&&!(a.metaKey||a.which==2)){for(var b=v(a.target);J(b[0].nodeName)!=="a";)if(b[0]===f[0]||!(b=b.parent())[0])return;var d=b.prop("href"),e=h.$$rewriteAppUrl(d);d&&!b.attr("target")&&e&&(h.$$parse(e),c.$apply(),a.preventDefault(),M.angular["ff-684208-preventDefault"]=!0)}});h.absUrl()!=m&&d.url(h.absUrl(),!0);d.onUrlChange(function(a){h.absUrl()!=a&&(c.$evalAsync(function(){var b=
+h.absUrl();h.$$parse(a);i(b)}),c.$$phase||c.$digest())});var l=0;c.$watch(function(){var a=d.url(),b=h.$$replace;if(!l||a!=h.absUrl())l++,c.$evalAsync(function(){c.$broadcast("$locationChangeStart",h.absUrl(),a).defaultPrevented?h.$$parse(a):(d.url(h.absUrl(),b),i(a))});h.$$replace=!1;return l});return h}]}function Lc(){var b=!0,a=this;this.debugEnabled=function(a){return w(a)?(b=a,this):b};this.$get=["$window",function(c){function d(a){a instanceof Error&&(a.stack?a=a.message&&a.stack.indexOf(a.message)===
+-1?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=c.console||{},e=b[a]||b.log||t;return e.apply?function(){var a=[];o(arguments,function(b){a.push(d(b))});return e.apply(b,a)}:function(a,b){e(a,b)}}return{log:e("log"),warn:e("warn"),info:e("info"),error:e("error"),debug:function(){var c=e("debug");return function(){b&&c.apply(a,arguments)}}()}}]}function Mc(b,a){function c(a){return a.indexOf(r)!=-1}function d(a){a=a||
+1;return n+a<b.length?b.charAt(n+a):!1}function e(a){return"0"<=a&&a<="9"}function f(a){return a==" "||a=="\r"||a=="\t"||a=="\n"||a=="\u000b"||a=="\u00a0"}function i(a){return"a"<=a&&a<="z"||"A"<=a&&a<="Z"||"_"==a||a=="$"}function h(a){return a=="-"||a=="+"||e(a)}function j(a,c,d){d=d||n;throw Error("Lexer Error: "+a+" at column"+(w(c)?"s "+c+"-"+n+" ["+b.substring(c,d)+"]":" "+d)+" in expression ["+b+"].");}function g(){for(var a="",c=n;n<b.length;){var g=J(b.charAt(n));if(g=="."||e(g))a+=g;else{var f=
+d();if(g=="e"&&h(f))a+=g;else if(h(g)&&f&&e(f)&&a.charAt(a.length-1)=="e")a+=g;else if(h(g)&&(!f||!e(f))&&a.charAt(a.length-1)=="e")j("Invalid exponent");else break}n++}a*=1;l.push({index:c,text:a,json:!0,fn:function(){return a}})}function m(){for(var c="",d=n,g,h,j;n<b.length;){var k=b.charAt(n);if(k=="."||i(k)||e(k))k=="."&&(g=n),c+=k;else break;n++}if(g)for(h=n;h<b.length;){k=b.charAt(h);if(k=="("){j=c.substr(g-d+1);c=c.substr(0,g-d);n=h;break}if(f(k))h++;else break}d={index:d,text:c};if(Ca.hasOwnProperty(c))d.fn=
+d.json=Ca[c];else{var m=Nb(c,a);d.fn=y(function(a,b){return m(a,b)},{assign:function(a,b){return Ob(a,c,b)}})}l.push(d);j&&(l.push({index:g,text:".",json:!1}),l.push({index:g+1,text:j,json:!1}))}function k(a){var c=n;n++;for(var d="",e=a,g=!1;n<b.length;){var h=b.charAt(n);e+=h;if(g)h=="u"?(h=b.substring(n+1,n+5),h.match(/[\da-f]{4}/i)||j("Invalid unicode escape [\\u"+h+"]"),n+=4,d+=String.fromCharCode(parseInt(h,16))):(g=Nc[h],d+=g?g:h),g=!1;else if(h=="\\")g=!0;else if(h==a){n++;l.push({index:c,
+text:e,string:d,json:!0,fn:function(){return d}});return}else d+=h;n++}j("Unterminated quote",c)}for(var l=[],q,n=0,B=[],r,p=":";n<b.length;){r=b.charAt(n);if(c("\"'"))k(r);else if(e(r)||c(".")&&e(d()))g();else if(i(r)){if(m(),"{,".indexOf(p)!=-1&&B[0]=="{"&&(q=l[l.length-1]))q.json=q.text.indexOf(".")==-1}else if(c("(){}[].,;:"))l.push({index:n,text:r,json:":[,".indexOf(p)!=-1&&c("{[")||c("}]:,")}),c("{[")&&B.unshift(r),c("}]")&&B.shift(),n++;else if(f(r)){n++;continue}else{var E=r+d(),D=E+d(2),
+G=Ca[r],o=Ca[E],A=Ca[D];A?(l.push({index:n,text:D,fn:A}),n+=3):o?(l.push({index:n,text:E,fn:o}),n+=2):G?(l.push({index:n,text:r,fn:G,json:"[,:".indexOf(p)!=-1&&c("+-")}),n+=1):j("Unexpected next character ",n,n+1)}p=r}return l}function Oc(b,a,c,d){function e(a,c){throw Error("Syntax Error: Token '"+c.text+"' "+a+" at column "+(c.index+1)+" of the expression ["+b+"] starting at ["+b.substring(c.index)+"].");}function f(){if(F.length===0)throw Error("Unexpected end of expression: "+b);return F[0]}function i(a,
+b,c,d){if(F.length>0){var e=F[0],g=e.text;if(g==a||g==b||g==c||g==d||!a&&!b&&!c&&!d)return e}return!1}function h(b,c,d,g){return(b=i(b,c,d,g))?(a&&!b.json&&e("is not valid json",b),F.shift(),b):!1}function j(a){h(a)||e("is unexpected, expecting ["+a+"]",i())}function g(a,b){return y(function(c,d){return a(c,d,b)},{constant:b.constant})}function m(a,b,c){return y(function(d,e){return b(d,e,a,c)},{constant:a.constant&&c.constant})}function k(){for(var a=[];;)if(F.length>0&&!i("}",")",";","]")&&a.push(fa()),
+!h(";"))return a.length==1?a[0]:function(b,c){for(var d,e=0;e<a.length;e++){var g=a[e];g&&(d=g(b,c))}return d}}function l(){for(var a=h(),b=c(a.text),d=[];;)if(a=h(":"))d.push(N());else{var e=function(a,c,e){for(var e=[e],g=0;g<d.length;g++)e.push(d[g](a,c));return b.apply(a,e)};return function(){return e}}}function q(){for(var a=n(),b;;)if(b=h("||"))a=m(a,b.fn,n());else return a}function n(){var a=B(),b;if(b=h("&&"))a=m(a,b.fn,n());return a}function B(){var a=r(),b;if(b=h("==","!=","===","!=="))a=
+m(a,b.fn,B());return a}function r(){var a;a=p();for(var b;b=h("+","-");)a=m(a,b.fn,p());if(b=h("<",">","<=",">="))a=m(a,b.fn,r());return a}function p(){for(var a=E(),b;b=h("*","/","%");)a=m(a,b.fn,E());return a}function E(){var a;return h("+")?D():(a=h("-"))?m(A,a.fn,E()):(a=h("!"))?g(a.fn,E()):D()}function D(){var a;if(h("("))a=fa(),j(")");else if(h("["))a=G();else if(h("{"))a=o();else{var b=h();(a=b.fn)||e("not a primary expression",b);if(b.json)a.constant=a.literal=!0}for(var c;b=h("(","[",".");)b.text===
+"("?(a=ea(a,c),c=null):b.text==="["?(c=a,a=z(a)):b.text==="."?(c=a,a=ga(a)):e("IMPOSSIBLE");return a}function G(){var a=[],b=!0;if(f().text!="]"){do{var c=N();a.push(c);c.constant||(b=!1)}while(h(","))}j("]");return y(function(b,c){for(var d=[],e=0;e<a.length;e++)d.push(a[e](b,c));return d},{literal:!0,constant:b})}function o(){var a=[],b=!0;if(f().text!="}"){do{var c=h(),c=c.string||c.text;j(":");var d=N();a.push({key:c,value:d});d.constant||(b=!1)}while(h(","))}j("}");return y(function(b,c){for(var d=
+{},e=0;e<a.length;e++){var g=a[e],h=g.value(b,c);d[g.key]=h}return d},{literal:!0,constant:b})}var A=Q(0),H,F=Mc(b,d),N=function(){var a=q(),c,d;return(d=h("="))?(a.assign||e("implies assignment but ["+b.substring(0,d.index)+"] can not be assigned to",d),c=q(),function(b,d){return a.assign(b,c(b,d),d)}):a},ea=function(a,b){var c=[];if(f().text!=")"){do c.push(N());while(h(","))}j(")");return function(d,e){for(var g=[],h=b?b(d,e):d,f=0;f<c.length;f++)g.push(c[f](d,e));f=a(d,e)||t;return f.apply?f.apply(h,
+g):f(g[0],g[1],g[2],g[3],g[4])}},ga=function(a){var b=h().text,c=Nb(b,d);return y(function(b,d){return c(a(b,d),d)},{assign:function(c,d,e){return Ob(a(c,e),b,d)}})},z=function(a){var b=N();j("]");return y(function(c,d){var e=a(c,d),g=b(c,d),h;if(!e)return s;if((e=e[g])&&e.then){h=e;if(!("$$v"in e))h.$$v=s,h.then(function(a){h.$$v=a});e=e.$$v}return e},{assign:function(c,d,e){return a(c,e)[b(c,e)]=d}})},fa=function(){for(var a=N(),b;;)if(b=h("|"))a=m(a,b.fn,l());else return a};a?(N=q,ea=ga=z=fa=function(){e("is not valid json",
+{text:b,index:0})},H=D()):H=k();F.length!==0&&e("is an unexpected token",F[0]);H.literal=!!H.literal;H.constant=!!H.constant;return H}function Ob(b,a,c){for(var a=a.split("."),d=0;a.length>1;d++){var e=a.shift(),f=b[e];f||(f={},b[e]=f);b=f}return b[a.shift()]=c}function kb(b,a,c){if(!a)return b;for(var a=a.split("."),d,e=b,f=a.length,i=0;i<f;i++)d=a[i],b&&(b=(e=b)[d]);return!c&&I(b)?ab(e,b):b}function Pb(b,a,c,d,e){return function(f,i){var h=i&&i.hasOwnProperty(b)?i:f,j;if(h===null||h===s)return h;
+if((h=h[b])&&h.then){if(!("$$v"in h))j=h,j.$$v=s,j.then(function(a){j.$$v=a});h=h.$$v}if(!a||h===null||h===s)return h;if((h=h[a])&&h.then){if(!("$$v"in h))j=h,j.$$v=s,j.then(function(a){j.$$v=a});h=h.$$v}if(!c||h===null||h===s)return h;if((h=h[c])&&h.then){if(!("$$v"in h))j=h,j.$$v=s,j.then(function(a){j.$$v=a});h=h.$$v}if(!d||h===null||h===s)return h;if((h=h[d])&&h.then){if(!("$$v"in h))j=h,j.$$v=s,j.then(function(a){j.$$v=a});h=h.$$v}if(!e||h===null||h===s)return h;if((h=h[e])&&h.then){if(!("$$v"in
+h))j=h,j.$$v=s,j.then(function(a){j.$$v=a});h=h.$$v}return h}}function Nb(b,a){if(nb.hasOwnProperty(b))return nb[b];var c=b.split("."),d=c.length,e;if(a)e=d<6?Pb(c[0],c[1],c[2],c[3],c[4]):function(a,b){var e=0,g;do g=Pb(c[e++],c[e++],c[e++],c[e++],c[e++])(a,b),b=s,a=g;while(e<d);return g};else{var f="var l, fn, p;\n";o(c,function(a,b){f+="if(s === null || s === undefined) return s;\nl=s;\ns="+(b?"s":'((k&&k.hasOwnProperty("'+a+'"))?k:s)')+'["'+a+'"];\nif (s && s.then) {\n if (!("$$v" in s)) {\n p=s;\n p.$$v = undefined;\n p.then(function(v) {p.$$v=v;});\n}\n s=s.$$v\n}\n'});
+f+="return s;";e=Function("s","k",f);e.toString=function(){return f}}return nb[b]=e}function Pc(){var b={};this.$get=["$filter","$sniffer",function(a,c){return function(d){switch(typeof d){case "string":return b.hasOwnProperty(d)?b[d]:b[d]=Oc(d,!1,a,c.csp);case "function":return d;default:return t}}}]}function Qc(){this.$get=["$rootScope","$exceptionHandler",function(b,a){return Rc(function(a){b.$evalAsync(a)},a)}]}function Rc(b,a){function c(a){return a}function d(a){return i(a)}var e=function(){var h=
+[],j,g;return g={resolve:function(a){if(h){var c=h;h=s;j=f(a);c.length&&b(function(){for(var a,b=0,d=c.length;b<d;b++)a=c[b],j.then(a[0],a[1])})}},reject:function(a){g.resolve(i(a))},promise:{then:function(b,g){var f=e(),i=function(d){try{f.resolve((b||c)(d))}catch(e){a(e),f.reject(e)}},n=function(b){try{f.resolve((g||d)(b))}catch(c){a(c),f.reject(c)}};h?h.push([i,n]):j.then(i,n);return f.promise}}}},f=function(a){return a&&a.then?a:{then:function(c){var d=e();b(function(){d.resolve(c(a))});return d.promise}}},
+i=function(a){return{then:function(c,g){var f=e();b(function(){f.resolve((g||d)(a))});return f.promise}}};return{defer:e,reject:i,when:function(h,j,g){var m=e(),k,l=function(b){try{return(j||c)(b)}catch(d){return a(d),i(d)}},q=function(b){try{return(g||d)(b)}catch(c){return a(c),i(c)}};b(function(){f(h).then(function(a){k||(k=!0,m.resolve(f(a).then(l,q)))},function(a){k||(k=!0,m.resolve(q(a)))})});return m.promise},all:function(a){var b=e(),c=0,d=C(a)?[]:{};o(a,function(a,e){c++;f(a).then(function(a){d.hasOwnProperty(e)||
+(d[e]=a,--c||b.resolve(d))},function(a){d.hasOwnProperty(e)||b.reject(a)})});c===0&&b.resolve(d);return b.promise}}}function Sc(){var b={};this.when=function(a,c){b[a]=y({reloadOnSearch:!0,caseInsensitiveMatch:!1},c);if(a){var d=a[a.length-1]=="/"?a.substr(0,a.length-1):a+"/";b[d]={redirectTo:a}}return this};this.otherwise=function(a){this.when(null,a);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$http","$templateCache",function(a,c,d,e,f,i,h){function j(a,b,c){for(var b=
+"^"+b.replace(/[-\/\\^$:*+?.()|[\]{}]/g,"\\$&")+"$",d="",e=[],g={},f=/\\([:*])(\w+)/g,h,j=0;(h=f.exec(b))!==null;){d+=b.slice(j,h.index);switch(h[1]){case ":":d+="([^\\/]*)";break;case "*":d+="(.*)"}e.push(h[2]);j=f.lastIndex}d+=b.substr(j);var i=a.match(RegExp(d,c.caseInsensitiveMatch?"i":""));i&&o(e,function(a,b){g[a]=i[b+1]});return i?g:null}function g(){var b=m(),g=q.current;if(b&&g&&b.$$route===g.$$route&&ja(b.pathParams,g.pathParams)&&!b.reloadOnSearch&&!l)g.params=b.params,W(g.params,d),a.$broadcast("$routeUpdate",
+g);else if(b||g)l=!1,a.$broadcast("$routeChangeStart",b,g),(q.current=b)&&b.redirectTo&&(x(b.redirectTo)?c.path(k(b.redirectTo,b.params)).search(b.params).replace():c.url(b.redirectTo(b.pathParams,c.path(),c.search())).replace()),e.when(b).then(function(){if(b){var a=y({},b.resolve),c;o(a,function(b,c){a[c]=x(b)?f.get(b):f.invoke(b)});if(w(c=b.template))I(c)&&(c=c(b.params));else if(w(c=b.templateUrl))if(I(c)&&(c=c(b.params)),w(c))b.loadedTemplateUrl=c,c=i.get(c,{cache:h}).then(function(a){return a.data});
+w(c)&&(a.$template=c);return e.all(a)}}).then(function(c){if(b==q.current){if(b)b.locals=c,W(b.params,d);a.$broadcast("$routeChangeSuccess",b,g)}},function(c){b==q.current&&a.$broadcast("$routeChangeError",b,g,c)})}function m(){var a,d;o(b,function(b,e){if(!d&&(a=j(c.path(),e,b)))d=Fa(b,{params:y({},c.search(),a),pathParams:a}),d.$$route=b});return d||b[null]&&Fa(b[null],{params:{},pathParams:{}})}function k(a,b){var c=[];o((a||"").split(":"),function(a,d){if(d==0)c.push(a);else{var e=a.match(/(\w+)(.*)/),
+g=e[1];c.push(b[g]);c.push(e[2]||"");delete b[g]}});return c.join("")}var l=!1,q={routes:b,reload:function(){l=!0;a.$evalAsync(g)}};a.$on("$locationChangeSuccess",g);return q}]}function Tc(){this.$get=Q({})}function Uc(){var b=10;this.digestTtl=function(a){arguments.length&&(b=a);return b};this.$get=["$injector","$exceptionHandler","$parse",function(a,c,d){function e(){this.$id=Ea();this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;
+this["this"]=this.$root=this;this.$$destroyed=!1;this.$$asyncQueue=[];this.$$listeners={};this.$$isolateBindings={}}function f(a){if(j.$$phase)throw Error(j.$$phase+" already in progress");j.$$phase=a}function i(a,b){var c=d(a);va(c,b);return c}function h(){}e.prototype={$new:function(a){if(I(a))throw Error("API-CHANGE: Use $controller to instantiate controllers.");a?(a=new e,a.$root=this.$root):(a=function(){},a.prototype=this,a=new a,a.$id=Ea());a["this"]=a;a.$$listeners={};a.$parent=this;a.$$watchers=
+a.$$nextSibling=a.$$childHead=a.$$childTail=null;a.$$prevSibling=this.$$childTail;this.$$childHead?this.$$childTail=this.$$childTail.$$nextSibling=a:this.$$childHead=this.$$childTail=a;return a},$watch:function(a,b,c){var d=i(a,"watch"),e=this.$$watchers,f={fn:b,last:h,get:d,exp:a,eq:!!c};if(!I(b)){var j=i(b||t,"listener");f.fn=function(a,b,c){j(c)}}if(typeof a=="string"&&d.constant){var r=f.fn;f.fn=function(a,b,c){r.call(this,a,b,c);sa(e,f)}}if(!e)e=this.$$watchers=[];e.unshift(f);return function(){sa(e,
+f)}},$watchCollection:function(a,b){var c=this,e,f,h=0,j=d(a),i=[],p={},o=0;return this.$watch(function(){f=j(c);var a,b;if(L(f))if(C(f)){if(e!==i)e=i,o=e.length=0,h++;a=f.length;if(o!==a)h++,e.length=o=a;for(b=0;b<a;b++)e[b]!==f[b]&&(h++,e[b]=f[b])}else{e!==p&&(e=p={},o=0,h++);a=0;for(b in f)f.hasOwnProperty(b)&&(a++,e.hasOwnProperty(b)?e[b]!==f[b]&&(h++,e[b]=f[b]):(o++,e[b]=f[b],h++));if(o>a)for(b in h++,e)e.hasOwnProperty(b)&&!f.hasOwnProperty(b)&&(o--,delete e[b])}else e!==f&&(e=f,h++);return h},
+function(){b(f,e,c)})},$digest:function(){var a,d,e,i,q=this.$$asyncQueue,n,o,r=b,p,E=[],D,G;f("$digest");do{o=!1;for(p=this;q.length;)try{p.$eval(q.shift())}catch(s){c(s)}do{if(i=p.$$watchers)for(n=i.length;n--;)try{if(a=i[n],(d=a.get(p))!==(e=a.last)&&!(a.eq?ja(d,e):typeof d=="number"&&typeof e=="number"&&isNaN(d)&&isNaN(e)))o=!0,a.last=a.eq?W(d):d,a.fn(d,e===h?d:e,p),r<5&&(D=4-r,E[D]||(E[D]=[]),G=I(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):a.exp,G+="; newVal: "+da(d)+"; oldVal: "+da(e),E[D].push(G))}catch(A){c(A)}if(!(i=
+p.$$childHead||p!==this&&p.$$nextSibling))for(;p!==this&&!(i=p.$$nextSibling);)p=p.$parent}while(p=i);if(o&&!r--)throw j.$$phase=null,Error(b+" $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: "+da(E));}while(o||q.length);j.$$phase=null},$destroy:function(){if(!(j==this||this.$$destroyed)){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;if(a.$$childHead==this)a.$$childHead=this.$$nextSibling;if(a.$$childTail==this)a.$$childTail=this.$$prevSibling;
+if(this.$$prevSibling)this.$$prevSibling.$$nextSibling=this.$$nextSibling;if(this.$$nextSibling)this.$$nextSibling.$$prevSibling=this.$$prevSibling;this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null}},$eval:function(a,b){return d(a)(this,b)},$evalAsync:function(a){this.$$asyncQueue.push(a)},$apply:function(a){try{return f("$apply"),this.$eval(a)}catch(b){c(b)}finally{j.$$phase=null;try{j.$digest()}catch(d){throw c(d),d;}}},$on:function(a,b){var c=this.$$listeners[a];
+c||(this.$$listeners[a]=c=[]);c.push(b);return function(){c[Ga(c,b)]=null}},$emit:function(a,b){var d=[],e,f=this,h=!1,i={name:a,targetScope:f,stopPropagation:function(){h=!0},preventDefault:function(){i.defaultPrevented=!0},defaultPrevented:!1},j=[i].concat(ka.call(arguments,1)),p,o;do{e=f.$$listeners[a]||d;i.currentScope=f;p=0;for(o=e.length;p<o;p++)if(e[p])try{if(e[p].apply(null,j),h)return i}catch(D){c(D)}else e.splice(p,1),p--,o--;f=f.$parent}while(f);return i},$broadcast:function(a,b){var d=
+this,e=this,f={name:a,targetScope:this,preventDefault:function(){f.defaultPrevented=!0},defaultPrevented:!1},h=[f].concat(ka.call(arguments,1)),i,j;do{d=e;f.currentScope=d;e=d.$$listeners[a]||[];i=0;for(j=e.length;i<j;i++)if(e[i])try{e[i].apply(null,h)}catch(p){c(p)}else e.splice(i,1),i--,j--;if(!(e=d.$$childHead||d!==this&&d.$$nextSibling))for(;d!==this&&!(e=d.$$nextSibling);)d=d.$parent}while(d=e);return f}};var j=new e;return j}]}function Vc(){this.$get=["$window","$document",function(b,a){var c=
+{},d=K((/android (\d+)/.exec(J((b.navigator||{}).userAgent))||[])[1]),e=a[0]||{},f,i=/^(Moz|webkit|O|ms)(?=[A-Z])/,h=e.body&&e.body.style,j=!1;if(h){for(var g in h)if(j=i.exec(g)){f=j[0];f=f.substr(0,1).toUpperCase()+f.substr(1);break}j=!!(f+"Transition"in h)}return{history:!(!b.history||!b.history.pushState||d<4),hashchange:"onhashchange"in b&&(!e.documentMode||e.documentMode>7),hasEvent:function(a){if(a=="input"&&X==9)return!1;if(u(c[a])){var b=e.createElement("div");c[a]="on"+a in b}return c[a]},
+csp:e.securityPolicy?e.securityPolicy.isActive:!1,vendorPrefix:f,supportsTransitions:j}}]}function Wc(){this.$get=Q(M)}function Qb(b){var a={},c,d,e;if(!b)return a;o(b.split("\n"),function(b){e=b.indexOf(":");c=J(S(b.substr(0,e)));d=S(b.substr(e+1));c&&(a[c]?a[c]+=", "+d:a[c]=d)});return a}function Xc(b,a){var c=Yc.exec(b);if(c==null)return!0;var d={protocol:c[2],host:c[4],port:K(c[6])||Ba[c[2]]||null,relativeProtocol:c[2]===s||c[2]===""},c=lb.exec(a),c={protocol:c[1],host:c[3],port:K(c[5])||Ba[c[1]]||
+null};return(d.protocol==c.protocol||d.relativeProtocol)&&d.host==c.host&&(d.port==c.port||d.relativeProtocol&&c.port==Ba[c.protocol])}function Rb(b){var a=L(b)?b:s;return function(c){a||(a=Qb(b));return c?a[J(c)]||null:a}}function Sb(b,a,c){if(I(c))return c(b,a);o(c,function(c){b=c(b,a)});return b}function Zc(){var b=/^\s*(\[|\{[^\{])/,a=/[\}\]]\s*$/,c=/^\)\]\}',?\n/,d=this.defaults={transformResponse:[function(d){x(d)&&(d=d.replace(c,""),b.test(d)&&a.test(d)&&(d=tb(d,!0)));return d}],transformRequest:[function(a){return L(a)&&
+Da.apply(a)!=="[object File]"?da(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:{"Content-Type":"application/json;charset=utf-8"},put:{"Content-Type":"application/json;charset=utf-8"}},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"},e=this.interceptors=[],f=this.responseInterceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(a,b,c,g,m,k){function l(a){function c(a){var b=y({},a,{data:Sb(a.data,a.headers,e.transformResponse)});
+return 200<=a.status&&a.status<300?b:m.reject(b)}var e={transformRequest:d.transformRequest,transformResponse:d.transformResponse},g={};y(e,a);e.headers=g;e.method=na(e.method);y(g,d.headers.common,d.headers[J(e.method)],a.headers);(a=Xc(e.url,b.url())?b.cookies()[e.xsrfCookieName||d.xsrfCookieName]:s)&&(g[e.xsrfHeaderName||d.xsrfHeaderName]=a);var f=[function(a){var b=Sb(a.data,Rb(g),a.transformRequest);u(a.data)&&delete g["Content-Type"];if(u(a.withCredentials)&&!u(d.withCredentials))a.withCredentials=
+d.withCredentials;return q(a,b,g).then(c,c)},s],j=m.when(e);for(o(r,function(a){(a.request||a.requestError)&&f.unshift(a.request,a.requestError);(a.response||a.responseError)&&f.push(a.response,a.responseError)});f.length;)var a=f.shift(),i=f.shift(),j=j.then(a,i);j.success=function(a){j.then(function(b){a(b.data,b.status,b.headers,e)});return j};j.error=function(a){j.then(null,function(b){a(b.data,b.status,b.headers,e)});return j};return j}function q(b,c,e){function f(a,b,c){o&&(200<=a&&a<300?o.put(s,
+[a,b,Qb(c)]):o.remove(s));h(b,a,c);g.$apply()}function h(a,c,d){c=Math.max(c,0);(200<=c&&c<300?k.resolve:k.reject)({data:a,status:c,headers:Rb(d),config:b})}function j(){var a=Ga(l.pendingRequests,b);a!==-1&&l.pendingRequests.splice(a,1)}var k=m.defer(),q=k.promise,o,r,s=n(b.url,b.params);l.pendingRequests.push(b);q.then(j,j);if((b.cache||d.cache)&&b.cache!==!1&&b.method=="GET")o=L(b.cache)?b.cache:L(d.cache)?d.cache:B;if(o)if(r=o.get(s))if(r.then)return r.then(j,j),r;else C(r)?h(r[1],r[0],W(r[2])):
+h(r,200,{});else o.put(s,q);r||a(b.method,s,c,f,e,b.timeout,b.withCredentials,b.responseType);return q}function n(a,b){if(!b)return a;var c=[];ic(b,function(a,b){a==null||a==s||(C(a)||(a=[a]),o(a,function(a){L(a)&&(a=da(a));c.push(ua(b)+"="+ua(a))}))});return a+(a.indexOf("?")==-1?"?":"&")+c.join("&")}var B=c("$http"),r=[];o(e,function(a){r.unshift(x(a)?k.get(a):k.invoke(a))});o(f,function(a,b){var c=x(a)?k.get(a):k.invoke(a);r.splice(b,0,{response:function(a){return c(m.when(a))},responseError:function(a){return c(m.reject(a))}})});
+l.pendingRequests=[];(function(a){o(arguments,function(a){l[a]=function(b,c){return l(y(c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){o(arguments,function(a){l[a]=function(b,c,d){return l(y(d||{},{method:a,url:b,data:c}))}})})("post","put");l.defaults=d;return l}]}function $c(){this.$get=["$browser","$window","$document",function(b,a,c){return ad(b,bd,b.defer,a.angular.callbacks,c[0],a.location.protocol.replace(":",""))}]}function ad(b,a,c,d,e,f){function i(a,b){var c=
+e.createElement("script"),d=function(){e.body.removeChild(c);b&&b()};c.type="text/javascript";c.src=a;X?c.onreadystatechange=function(){/loaded|complete/.test(c.readyState)&&d()}:c.onload=c.onerror=d;e.body.appendChild(c)}return function(e,j,g,m,k,l,q,n){function B(a,c,d,e){c=(j.match(lb)||["",f])[1]=="file"?d?200:404:c;a(c==1223?204:c,d,e);b.$$completeOutstandingRequest(t)}b.$$incOutstandingRequestCount();j=j||b.url();if(J(e)=="jsonp"){var r="_"+(d.counter++).toString(36);d[r]=function(a){d[r].data=
+a};i(j.replace("JSON_CALLBACK","angular.callbacks."+r),function(){d[r].data?B(m,200,d[r].data):B(m,-2);delete d[r]})}else{var p=new a;p.open(e,j,!0);o(k,function(a,b){a&&p.setRequestHeader(b,a)});var s;p.onreadystatechange=function(){if(p.readyState==4){var a=p.getAllResponseHeaders(),b=["Cache-Control","Content-Language","Content-Type","Expires","Last-Modified","Pragma"];a||(a="",o(b,function(b){var c=p.getResponseHeader(b);c&&(a+=b+": "+c+"\n")}));B(m,s||p.status,p.responseType?p.response:p.responseText,
+a)}};if(q)p.withCredentials=!0;if(n)p.responseType=n;p.send(g||"");l>0&&c(function(){s=-1;p.abort()},l)}}}function cd(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4",posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),
+SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(b){return b===1?"one":"other"}}}}function dd(){this.$get=["$rootScope","$browser","$q",
+"$exceptionHandler",function(b,a,c,d){function e(e,h,j){var g=c.defer(),m=g.promise,k=w(j)&&!j,h=a.defer(function(){try{g.resolve(e())}catch(a){g.reject(a),d(a)}k||b.$apply()},h),j=function(){delete f[m.$$timeoutId]};m.$$timeoutId=h;f[h]=g;m.then(j,j);return m}var f={};e.cancel=function(b){return b&&b.$$timeoutId in f?(f[b.$$timeoutId].reject("canceled"),a.defer.cancel(b.$$timeoutId)):!1};return e}]}function Tb(b){function a(a,e){return b.factory(a+c,e)}var c="Filter";this.register=a;this.$get=["$injector",
+function(a){return function(b){return a.get(b+c)}}];a("currency",Ub);a("date",Vb);a("filter",ed);a("json",fd);a("limitTo",gd);a("lowercase",hd);a("number",Wb);a("orderBy",Xb);a("uppercase",id)}function ed(){return function(b,a,c){if(!C(b))return b;var d=[];d.check=function(a){for(var b=0;b<d.length;b++)if(!d[b](a))return!1;return!0};switch(typeof c){case "function":break;case "boolean":if(c==!0){c=function(a,b){return Ia.equals(a,b)};break}default:c=function(a,b){b=(""+b).toLowerCase();return(""+
+a).toLowerCase().indexOf(b)>-1}}var e=function(a,b){if(typeof b=="string"&&b.charAt(0)==="!")return!e(a,b.substr(1));switch(typeof a){case "boolean":case "number":case "string":return c(a,b);case "object":switch(typeof b){case "object":return c(a,b);default:for(var d in a)if(d.charAt(0)!=="$"&&e(a[d],b))return!0}return!1;case "array":for(d=0;d<a.length;d++)if(e(a[d],b))return!0;return!1;default:return!1}};switch(typeof a){case "boolean":case "number":case "string":a={$:a};case "object":for(var f in a)f==
+"$"?function(){if(a[f]){var b=f;d.push(function(c){return e(c,a[b])})}}():function(){if(a[f]){var b=f;d.push(function(c){return e(kb(c,b),a[b])})}}();break;case "function":d.push(a);break;default:return b}for(var i=[],h=0;h<b.length;h++){var j=b[h];d.check(j)&&i.push(j)}return i}}function Ub(b){var a=b.NUMBER_FORMATS;return function(b,d){if(u(d))d=a.CURRENCY_SYM;return Yb(b,a.PATTERNS[1],a.GROUP_SEP,a.DECIMAL_SEP,2).replace(/\u00A4/g,d)}}function Wb(b){var a=b.NUMBER_FORMATS;return function(b,d){return Yb(b,
+a.PATTERNS[0],a.GROUP_SEP,a.DECIMAL_SEP,d)}}function Yb(b,a,c,d,e){if(isNaN(b)||!isFinite(b))return"";var f=b<0,b=Math.abs(b),i=b+"",h="",j=[],g=!1;if(i.indexOf("e")!==-1){var m=i.match(/([\d\.]+)e(-?)(\d+)/);m&&m[2]=="-"&&m[3]>e+1?i="0":(h=i,g=!0)}if(!g){i=(i.split(Zb)[1]||"").length;u(e)&&(e=Math.min(Math.max(a.minFrac,i),a.maxFrac));var i=Math.pow(10,e),b=Math.round(b*i)/i,b=(""+b).split(Zb),i=b[0],b=b[1]||"",g=0,m=a.lgSize,k=a.gSize;if(i.length>=m+k)for(var g=i.length-m,l=0;l<g;l++)(g-l)%k===
+0&&l!==0&&(h+=c),h+=i.charAt(l);for(l=g;l<i.length;l++)(i.length-l)%m===0&&l!==0&&(h+=c),h+=i.charAt(l);for(;b.length<e;)b+="0";e&&e!=="0"&&(h+=d+b.substr(0,e))}j.push(f?a.negPre:a.posPre);j.push(h);j.push(f?a.negSuf:a.posSuf);return j.join("")}function ob(b,a,c){var d="";b<0&&(d="-",b=-b);for(b=""+b;b.length<a;)b="0"+b;c&&(b=b.substr(b.length-a));return d+b}function O(b,a,c,d){return function(e){e=e["get"+b]();if(c>0||e>-c)e+=c;e===0&&c==-12&&(e=12);return ob(e,a,d)}}function Sa(b,a){return function(c,
+d){var e=c["get"+b](),f=na(a?"SHORT"+b:b);return d[f][e]}}function Vb(b){function a(a){var b;if(b=a.match(c)){var a=new Date(0),f=0,i=0,h=b[8]?a.setUTCFullYear:a.setFullYear,j=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=K(b[9]+b[10]),i=K(b[9]+b[11]));h.call(a,K(b[1]),K(b[2])-1,K(b[3]));j.call(a,K(b[4]||0)-f,K(b[5]||0)-i,K(b[6]||0),K(b[7]||0))}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e){var f="",i=[],h,j,e=e||
+"mediumDate",e=b.DATETIME_FORMATS[e]||e;x(c)&&(c=jd.test(c)?K(c):a(c));Za(c)&&(c=new Date(c));if(!qa(c))return c;for(;e;)(j=kd.exec(e))?(i=i.concat(ka.call(j,1)),e=i.pop()):(i.push(e),e=null);o(i,function(a){h=ld[a];f+=h?h(c,b.DATETIME_FORMATS):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return f}}function fd(){return function(b){return da(b,!0)}}function gd(){return function(b,a){if(!C(b)&&!x(b))return b;a=K(a);if(x(b))return a?a>=0?b.slice(0,a):b.slice(a,b.length):"";var c=[],d,e;a>b.length?a=
+b.length:a<-b.length&&(a=-b.length);a>0?(d=0,e=a):(d=b.length+a,e=b.length);for(;d<e;d++)c.push(b[d]);return c}}function Xb(b){return function(a,c,d){function e(a,b){return Ha(b)?function(b,c){return a(c,b)}:a}if(!C(a))return a;if(!c)return a;for(var c=C(c)?c:[c],c=$a(c,function(a){var c=!1,d=a||pa;if(x(a)){if(a.charAt(0)=="+"||a.charAt(0)=="-")c=a.charAt(0)=="-",a=a.substring(1);d=b(a)}return e(function(a,b){var c;c=d(a);var e=d(b),f=typeof c,h=typeof e;f==h?(f=="string"&&(c=c.toLowerCase()),f==
+"string"&&(e=e.toLowerCase()),c=c===e?0:c<e?-1:1):c=f<h?-1:1;return c},c)}),f=[],i=0;i<a.length;i++)f.push(a[i]);return f.sort(e(function(a,b){for(var d=0;d<c.length;d++){var e=c[d](a,b);if(e!==0)return e}return 0},d))}}function Y(b){I(b)&&(b={link:b});b.restrict=b.restrict||"AC";return Q(b)}function $b(b,a){function c(a,c){c=c?"-"+db(c,"-"):"";b.removeClass((a?Ta:Ua)+c).addClass((a?Ua:Ta)+c)}var d=this,e=b.parent().controller("form")||Va,f=0,i=d.$error={},h=[];d.$name=a.name;d.$dirty=!1;d.$pristine=
+!0;d.$valid=!0;d.$invalid=!1;e.$addControl(d);b.addClass(oa);c(!0);d.$addControl=function(a){h.push(a);a.$name&&!d.hasOwnProperty(a.$name)&&(d[a.$name]=a)};d.$removeControl=function(a){a.$name&&d[a.$name]===a&&delete d[a.$name];o(i,function(b,c){d.$setValidity(c,!0,a)});sa(h,a)};d.$setValidity=function(a,b,h){var k=i[a];if(b){if(k&&(sa(k,h),!k.length)){f--;if(!f)c(b),d.$valid=!0,d.$invalid=!1;i[a]=!1;c(!0,a);e.$setValidity(a,!0,d)}}else{f||c(b);if(k){if(Ga(k,h)!=-1)return}else i[a]=k=[],f++,c(!1,
+a),e.$setValidity(a,!1,d);k.push(h);d.$valid=!1;d.$invalid=!0}};d.$setDirty=function(){b.removeClass(oa).addClass(Wa);d.$dirty=!0;d.$pristine=!1;e.$setDirty()};d.$setPristine=function(){b.removeClass(Wa).addClass(oa);d.$dirty=!1;d.$pristine=!0;o(h,function(a){a.$setPristine()})}}function U(b){return u(b)||b===""||b===null||b!==b}function Xa(b,a,c,d,e,f){var i=function(){var e=a.val();if(Ha(c.ngTrim||"T"))e=S(e);d.$viewValue!==e&&b.$apply(function(){d.$setViewValue(e)})};if(e.hasEvent("input"))a.bind("input",
+i);else{var h;a.bind("keydown",function(a){a=a.keyCode;a===91||15<a&&a<19||37<=a&&a<=40||h||(h=f.defer(function(){i();h=null}))});a.bind("change",i)}d.$render=function(){a.val(U(d.$viewValue)?"":d.$viewValue)};var j=c.ngPattern,g=function(a,b){return U(b)||a.test(b)?(d.$setValidity("pattern",!0),b):(d.$setValidity("pattern",!1),s)};j&&(j.match(/^\/(.*)\/$/)?(j=RegExp(j.substr(1,j.length-2)),e=function(a){return g(j,a)}):e=function(a){var c=b.$eval(j);if(!c||!c.test)throw Error("Expected "+j+" to be a RegExp but was "+
+c);return g(c,a)},d.$formatters.push(e),d.$parsers.push(e));if(c.ngMinlength){var m=K(c.ngMinlength),e=function(a){return!U(a)&&a.length<m?(d.$setValidity("minlength",!1),s):(d.$setValidity("minlength",!0),a)};d.$parsers.push(e);d.$formatters.push(e)}if(c.ngMaxlength){var k=K(c.ngMaxlength),e=function(a){return!U(a)&&a.length>k?(d.$setValidity("maxlength",!1),s):(d.$setValidity("maxlength",!0),a)};d.$parsers.push(e);d.$formatters.push(e)}}function pb(b,a){b="ngClass"+b;return Y(function(c,d,e){function f(b){if(a===
+!0||c.$index%2===a)j&&b!==j&&i(j),h(b);j=b}function i(a){L(a)&&!C(a)&&(a=$a(a,function(a,b){if(a)return b}));d.removeClass(C(a)?a.join(" "):a)}function h(a){L(a)&&!C(a)&&(a=$a(a,function(a,b){if(a)return b}));a&&d.addClass(C(a)?a.join(" "):a)}var j=s;c.$watch(e[b],f,!0);e.$observe("class",function(){var a=c.$eval(e[b]);f(a,a)});b!=="ngClass"&&c.$watch("$index",function(d,f){var j=d%2;j!==f%2&&(j==a?h(c.$eval(e[b])):i(c.$eval(e[b])))})})}var J=function(b){return x(b)?b.toLowerCase():b},na=function(b){return x(b)?
+b.toUpperCase():b},X=K((/msie (\d+)/.exec(J(navigator.userAgent))||[])[1]),v,ca,ka=[].slice,Ya=[].push,Da=Object.prototype.toString,hc=M.angular,Ia=M.angular||(M.angular={}),xa,jb,Z=["0","0","0"];t.$inject=[];pa.$inject=[];jb=X<9?function(b){b=b.nodeName?b:b[0];return b.scopeName&&b.scopeName!="HTML"?na(b.scopeName+":"+b.nodeName):b.nodeName}:function(b){return b.nodeName?b.nodeName:b[0].nodeName};var nc=/[A-Z]/g,md={full:"1.1.4",major:1,minor:1,dot:4,codeName:"quantum-manipulation"},La=P.cache={},
+Ka=P.expando="ng-"+(new Date).getTime(),rc=1,ac=M.document.addEventListener?function(b,a,c){b.addEventListener(a,c,!1)}:function(b,a,c){b.attachEvent("on"+a,c)},ib=M.document.removeEventListener?function(b,a,c){b.removeEventListener(a,c,!1)}:function(b,a,c){b.detachEvent("on"+a,c)},pc=/([\:\-\_]+(.))/g,qc=/^moz([A-Z])/,za=P.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;V.readyState==="complete"?setTimeout(a):(this.bind("DOMContentLoaded",a),P(M).bind("load",a))},toString:function(){var b=
+[];o(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return b>=0?v(this[b]):v(this[this.length+b])},length:0,push:Ya,sort:[].sort,splice:[].splice},Oa={};o("multiple,selected,checked,disabled,readOnly,required,open".split(","),function(b){Oa[J(b)]=b});var Eb={};o("input,select,option,textarea,button,form,details".split(","),function(b){Eb[na(b)]=!0});o({data:zb,inheritedData:Na,scope:function(b){return Na(b,"$scope")},controller:Cb,injector:function(b){return Na(b,"$injector")},
+removeAttr:function(b,a){b.removeAttribute(a)},hasClass:Ma,css:function(b,a,c){a=Ja(a);if(w(c))b.style[a]=c;else{var d;X<=8&&(d=b.currentStyle&&b.currentStyle[a],d===""&&(d="auto"));d=d||b.style[a];X<=8&&(d=d===""?s:d);return d}},attr:function(b,a,c){var d=J(a);if(Oa[d])if(w(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||t).specified?d:s;else if(w(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),b===null?
+s:b},prop:function(b,a,c){if(w(c))b[a]=c;else return b[a]},text:y(X<9?function(b,a){if(b.nodeType==1){if(u(a))return b.innerText;b.innerText=a}else{if(u(a))return b.nodeValue;b.nodeValue=a}}:function(b,a){if(u(a))return b.textContent;b.textContent=a},{$dv:""}),val:function(b,a){if(u(a))return b.value;b.value=a},html:function(b,a){if(u(a))return b.innerHTML;for(var c=0,d=b.childNodes;c<d.length;c++)wa(d[c]);b.innerHTML=a}},function(b,a){P.prototype[a]=function(a,d){var e,f;if((b.length==2&&b!==Ma&&
+b!==Cb?a:d)===s)if(L(a)){for(e=0;e<this.length;e++)if(b===zb)b(this[e],a);else for(f in a)b(this[e],f,a[f]);return this}else{if(this.length)return b(this[0],a,d)}else{for(e=0;e<this.length;e++)b(this[e],a,d);return this}return b.$dv}});o({removeData:xb,dealoc:wa,bind:function a(c,d,e){var f=$(c,"events"),i=$(c,"handle");f||$(c,"events",f={});i||$(c,"handle",i=sc(c,f));o(d.split(" "),function(d){var j=f[d];if(!j){if(d=="mouseenter"||d=="mouseleave"){var g=0;f.mouseenter=[];f.mouseleave=[];a(c,"mouseover",
+function(a){g++;g==1&&i(a,"mouseenter")});a(c,"mouseout",function(a){g--;g==0&&i(a,"mouseleave")})}else ac(c,d,i),f[d]=[];j=f[d]}j.push(e)})},unbind:yb,replaceWith:function(a,c){var d,e=a.parentNode;wa(a);o(new P(c),function(c){d?e.insertBefore(c,d.nextSibling):e.replaceChild(c,a);d=c})},children:function(a){var c=[];o(a.childNodes,function(a){a.nodeType===1&&c.push(a)});return c},contents:function(a){return a.childNodes||[]},append:function(a,c){o(new P(c),function(c){(a.nodeType===1||a.nodeType===
+11)&&a.appendChild(c)})},prepend:function(a,c){if(a.nodeType===1){var d=a.firstChild;o(new P(c),function(c){d?a.insertBefore(c,d):(a.appendChild(c),d=c)})}},wrap:function(a,c){var c=v(c)[0],d=a.parentNode;d&&d.replaceChild(c,a);c.appendChild(a)},remove:function(a){wa(a);var c=a.parentNode;c&&c.removeChild(a)},after:function(a,c){var d=a,e=a.parentNode;o(new P(c),function(a){e.insertBefore(a,d.nextSibling);d=a})},addClass:Bb,removeClass:Ab,toggleClass:function(a,c,d){u(d)&&(d=!Ma(a,c));(d?Bb:Ab)(a,
+c)},parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},next:function(a){if(a.nextElementSibling)return a.nextElementSibling;for(a=a.nextSibling;a!=null&&a.nodeType!==1;)a=a.nextSibling;return a},find:function(a,c){return a.getElementsByTagName(c)},clone:hb,triggerHandler:function(a,c){var d=($(a,"events")||{})[c];o(d,function(c){c.call(a,null)})}},function(a,c){P.prototype[c]=function(c,e){for(var f,i=0;i<this.length;i++)f==s?(f=a(this[i],c,e),f!==s&&(f=v(f))):gb(f,a(this[i],c,e));
+return f==s?this:f}});Pa.prototype={put:function(a,c){this[la(a)]=c},get:function(a){return this[la(a)]},remove:function(a){var c=this[a=la(a)];delete this[a];return c}};var uc=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,vc=/,/,wc=/^\s*(_?)(\S+?)\1\s*$/,tc=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;Gb.$inject=["$provide"];var nd=function(){this.$get=["$animation","$window","$sniffer",function(a,c,d){function e(a){a.css("display","")}function f(a){a.css("display","none")}function i(a,c,d){d?d.after(a):c.append(a)}
+function h(a){a.remove()}function j(a,c,d){i(a,c,d)}return function(g,m){function k(e,f,h){var i=l&&g.$eval(l),e=l?L(i)?i[e]:i+"-"+e:"",j=(i=a(e))&&i.setup,k=i&&i.start;if(e){var m=e+"-setup",q=e+"-start";return function(a,e,g){function i(){h(a,e,g);a.removeClass(m);a.removeClass(q)}if(!d.supportsTransitions&&!j&&!k)f(a,e,g),h(a,e,g);else{a.addClass(m);f(a,e,g);if(a.length==0)return i();var l=(j||t)(a);c.setTimeout(function(){a.addClass(q);if(k)k(a,i,l);else if(I(c.getComputedStyle)){var e=d.vendorPrefix+
+"Transition",f=0;o(a,function(a){a=c.getComputedStyle(a)||{};f=Math.max(parseFloat(a.transitionDuration)||parseFloat(a[e+"Duration"])||0,f)});c.setTimeout(i,f*1E3)}else i()},1)}}}else return function(a,c,d){f(a,c,d);h(a,c,d)}}var l=m.ngAnimate,q={};q.enter=k("enter",i,t);q.leave=k("leave",t,h);q.move=k("move",j,t);q.show=k("show",e,t);q.hide=k("hide",t,f);return q}}]},Ib="Non-assignable model expression: ";Hb.$inject=["$provide"];var Cc=/^(x[\:\-_]|data[\:\-_])/i,lb=/^([^:]+):\/\/(\w+:{0,1}\w*@)?(\{?[\w\.-]*\}?)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?$/,
+bc=/^([^\?#]*)?(\?([^#]*))?(#(.*))?$/,Jc=bc,Ba={http:80,https:443,ftp:21};mb.prototype={$$replace:!1,absUrl:Ra("$$absUrl"),url:function(a,c){if(u(a))return this.$$url;var d=bc.exec(a);d[1]&&this.path(decodeURIComponent(d[1]));if(d[2]||d[1])this.search(d[3]||"");this.hash(d[5]||"",c);return this},protocol:Ra("$$protocol"),host:Ra("$$host"),port:Ra("$$port"),path:Mb("$$path",function(a){return a.charAt(0)=="/"?a:"/"+a}),search:function(a,c){if(u(a))return this.$$search;w(c)?c===null?delete this.$$search[a]:
+this.$$search[a]=c:this.$$search=x(a)?bb(a):a;this.$$compose();return this},hash:Mb("$$hash",pa),replace:function(){this.$$replace=!0;return this}};Qa.prototype=Fa(mb.prototype);Lb.prototype=Fa(Qa.prototype);var Ca={"null":function(){return null},"true":function(){return!0},"false":function(){return!1},undefined:t,"+":function(a,c,d,e){d=d(a,c);e=e(a,c);return w(d)?w(e)?d+e:d:w(e)?e:s},"-":function(a,c,d,e){d=d(a,c);e=e(a,c);return(w(d)?d:0)-(w(e)?e:0)},"*":function(a,c,d,e){return d(a,c)*e(a,c)},
+"/":function(a,c,d,e){return d(a,c)/e(a,c)},"%":function(a,c,d,e){return d(a,c)%e(a,c)},"^":function(a,c,d,e){return d(a,c)^e(a,c)},"=":t,"===":function(a,c,d,e){return d(a,c)===e(a,c)},"!==":function(a,c,d,e){return d(a,c)!==e(a,c)},"==":function(a,c,d,e){return d(a,c)==e(a,c)},"!=":function(a,c,d,e){return d(a,c)!=e(a,c)},"<":function(a,c,d,e){return d(a,c)<e(a,c)},">":function(a,c,d,e){return d(a,c)>e(a,c)},"<=":function(a,c,d,e){return d(a,c)<=e(a,c)},">=":function(a,c,d,e){return d(a,c)>=e(a,
+c)},"&&":function(a,c,d,e){return d(a,c)&&e(a,c)},"||":function(a,c,d,e){return d(a,c)||e(a,c)},"&":function(a,c,d,e){return d(a,c)&e(a,c)},"|":function(a,c,d,e){return e(a,c)(a,c,d(a,c))},"!":function(a,c,d){return!d(a,c)}},Nc={n:"\n",f:"\u000c",r:"\r",t:"\t",v:"\u000b","'":"'",'"':'"'},nb={},Yc=/^(([^:]+):)?\/\/(\w+:{0,1}\w*@)?([\w\.-]*)?(:([0-9]+))?(.*)$/,bd=M.XMLHttpRequest||function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(c){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(d){}throw Error("This browser does not support XMLHttpRequest.");
+};Tb.$inject=["$provide"];Ub.$inject=["$locale"];Wb.$inject=["$locale"];var Zb=".",ld={yyyy:O("FullYear",4),yy:O("FullYear",2,0,!0),y:O("FullYear",1),MMMM:Sa("Month"),MMM:Sa("Month",!0),MM:O("Month",2,1),M:O("Month",1,1),dd:O("Date",2),d:O("Date",1),HH:O("Hours",2),H:O("Hours",1),hh:O("Hours",2,-12),h:O("Hours",1,-12),mm:O("Minutes",2),m:O("Minutes",1),ss:O("Seconds",2),s:O("Seconds",1),sss:O("Milliseconds",3),EEEE:Sa("Day"),EEE:Sa("Day",!0),a:function(a,c){return a.getHours()<12?c.AMPMS[0]:c.AMPMS[1]},
+Z:function(a){var a=-1*a.getTimezoneOffset(),c=a>=0?"+":"";c+=ob(Math[a>0?"floor":"ceil"](a/60),2)+ob(Math.abs(a%60),2);return c}},kd=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,jd=/^\d+$/;Vb.$inject=["$locale"];var hd=Q(J),id=Q(na);Xb.$inject=["$parse"];var od=Q({restrict:"E",compile:function(a,c){X<=8&&(!c.href&&!c.name&&c.$set("href",""),a.append(V.createComment("IE fix")));return function(a,c){c.bind("click",function(a){c.attr("href")||a.preventDefault()})}}}),
+qb={};o(Oa,function(a,c){var d=aa("ng-"+c);qb[d]=function(){return{priority:100,compile:function(){return function(a,f,i){a.$watch(i[d],function(a){i.$set(c,!!a)})}}}}});o(["src","href"],function(a){var c=aa("ng-"+a);qb[c]=function(){return{priority:99,link:function(d,e,f){f.$observe(c,function(c){c&&(f.$set(a,c),X&&e.prop(a,f[a]))})}}}});var Va={$addControl:t,$removeControl:t,$setValidity:t,$setDirty:t,$setPristine:t};$b.$inject=["$element","$attrs","$scope"];var Ya=function(a){return["$timeout",
+function(c){var d={name:"form",restrict:"E",controller:$b,compile:function(){return{pre:function(a,d,i,h){if(!i.action){var j=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1};ac(d[0],"submit",j);d.bind("$destroy",function(){c(function(){ib(d[0],"submit",j)},0,!1)})}var g=d.parent().controller("form"),m=i.name||i.ngForm;m&&(a[m]=h);g&&d.bind("$destroy",function(){g.$removeControl(h);m&&(a[m]=s);y(h,Va)})}}}};return a?y(W(d),{restrict:"EAC"}):d}]},pd=Ya(),qd=Ya(!0),rd=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,
+sd=/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/,td=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,cc={text:Xa,number:function(a,c,d,e,f,i){Xa(a,c,d,e,f,i);e.$parsers.push(function(a){var c=U(a);return c||td.test(a)?(e.$setValidity("number",!0),a===""?null:c?a:parseFloat(a)):(e.$setValidity("number",!1),s)});e.$formatters.push(function(a){return U(a)?"":""+a});if(d.min){var h=parseFloat(d.min),a=function(a){return!U(a)&&a<h?(e.$setValidity("min",!1),s):(e.$setValidity("min",!0),a)};e.$parsers.push(a);
+e.$formatters.push(a)}if(d.max){var j=parseFloat(d.max),d=function(a){return!U(a)&&a>j?(e.$setValidity("max",!1),s):(e.$setValidity("max",!0),a)};e.$parsers.push(d);e.$formatters.push(d)}e.$formatters.push(function(a){return U(a)||Za(a)?(e.$setValidity("number",!0),a):(e.$setValidity("number",!1),s)})},url:function(a,c,d,e,f,i){Xa(a,c,d,e,f,i);a=function(a){return U(a)||rd.test(a)?(e.$setValidity("url",!0),a):(e.$setValidity("url",!1),s)};e.$formatters.push(a);e.$parsers.push(a)},email:function(a,
+c,d,e,f,i){Xa(a,c,d,e,f,i);a=function(a){return U(a)||sd.test(a)?(e.$setValidity("email",!0),a):(e.$setValidity("email",!1),s)};e.$formatters.push(a);e.$parsers.push(a)},radio:function(a,c,d,e){u(d.name)&&c.attr("name",Ea());c.bind("click",function(){c[0].checked&&a.$apply(function(){e.$setViewValue(d.value)})});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e){var f=d.ngTrueValue,i=d.ngFalseValue;x(f)||(f=!0);x(i)||(i=!1);c.bind("click",
+function(){a.$apply(function(){e.$setViewValue(c[0].checked)})});e.$render=function(){c[0].checked=e.$viewValue};e.$formatters.push(function(a){return a===f});e.$parsers.push(function(a){return a?f:i})},hidden:t,button:t,submit:t,reset:t},dc=["$browser","$sniffer",function(a,c){return{restrict:"E",require:"?ngModel",link:function(d,e,f,i){i&&(cc[J(f.type)]||cc.text)(d,e,f,i,c,a)}}}],Ua="ng-valid",Ta="ng-invalid",oa="ng-pristine",Wa="ng-dirty",ud=["$scope","$exceptionHandler","$attrs","$element","$parse",
+function(a,c,d,e,f){function i(a,c){c=c?"-"+db(c,"-"):"";e.removeClass((a?Ta:Ua)+c).addClass((a?Ua:Ta)+c)}this.$modelValue=this.$viewValue=Number.NaN;this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$name=d.name;var h=f(d.ngModel),j=h.assign;if(!j)throw Error(Ib+d.ngModel+" ("+ta(e)+")");this.$render=t;var g=e.inheritedData("$formController")||Va,m=0,k=this.$error={};e.addClass(oa);i(!0);this.$setValidity=function(a,
+c){if(k[a]!==!c){if(c){if(k[a]&&m--,!m)i(!0),this.$valid=!0,this.$invalid=!1}else i(!1),this.$invalid=!0,this.$valid=!1,m++;k[a]=!c;i(c,a);g.$setValidity(a,c,this)}};this.$setPristine=function(){this.$dirty=!1;this.$pristine=!0;e.removeClass(Wa).addClass(oa)};this.$setViewValue=function(d){this.$viewValue=d;if(this.$pristine)this.$dirty=!0,this.$pristine=!1,e.removeClass(oa).addClass(Wa),g.$setDirty();o(this.$parsers,function(a){d=a(d)});if(this.$modelValue!==d)this.$modelValue=d,j(a,d),o(this.$viewChangeListeners,
+function(a){try{a()}catch(d){c(d)}})};var l=this;a.$watch(function(){var c=h(a);if(l.$modelValue!==c){var d=l.$formatters,e=d.length;for(l.$modelValue=c;e--;)c=d[e](c);if(l.$viewValue!==c)l.$viewValue=c,l.$render()}})}],vd=function(){return{require:["ngModel","^?form"],controller:ud,link:function(a,c,d,e){var f=e[0],i=e[1]||Va;i.$addControl(f);c.bind("$destroy",function(){i.$removeControl(f)})}}},wd=Q({require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),
+ec=function(){return{require:"?ngModel",link:function(a,c,d,e){if(e){d.required=!0;var f=function(a){if(d.required&&(U(a)||a===!1))e.$setValidity("required",!1);else return e.$setValidity("required",!0),a};e.$formatters.push(f);e.$parsers.unshift(f);d.$observe("required",function(){f(e.$viewValue)})}}}},xd=function(){return{require:"ngModel",link:function(a,c,d,e){var f=(a=/\/(.*)\//.exec(d.ngList))&&RegExp(a[1])||d.ngList||",";e.$parsers.push(function(a){var c=[];a&&o(a.split(f),function(a){a&&c.push(S(a))});
+return c});e.$formatters.push(function(a){return C(a)?a.join(", "):s})}}},yd=/^(true|false|\d+)$/,zd=function(){return{priority:100,compile:function(a,c){return yd.test(c.ngValue)?function(a,c,f){f.$set("value",a.$eval(f.ngValue))}:function(a,c,f){a.$watch(f.ngValue,function(a){f.$set("value",a,!1)})}}}},Ad=Y(function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBind);a.$watch(d.ngBind,function(a){c.text(a==s?"":a)})}),Bd=["$interpolate",function(a){return function(c,d,e){c=a(d.attr(e.$attr.ngBindTemplate));
+d.addClass("ng-binding").data("$binding",c);e.$observe("ngBindTemplate",function(a){d.text(a)})}}],Cd=[function(){return function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBindHtmlUnsafe);a.$watch(d.ngBindHtmlUnsafe,function(a){c.html(a||"")})}}],Dd=pb("",!0),Ed=pb("Odd",0),Fd=pb("Even",1),Gd=Y({compile:function(a,c){c.$set("ngCloak",s);a.removeClass("ng-cloak")}}),Hd=[function(){return{scope:!0,controller:"@"}}],Id=["$sniffer",function(a){return{priority:1E3,compile:function(){a.csp=!0}}}],
+fc={};o("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress".split(" "),function(a){var c=aa("ng-"+a);fc[c]=["$parse",function(d){return function(e,f,i){var h=d(i[c]);f.bind(J(a),function(a){e.$apply(function(){h(e,{$event:a})})})}}]});var Jd=Y(function(a,c,d){c.bind("submit",function(){a.$apply(d.ngSubmit)})}),Kd=["$http","$templateCache","$anchorScroll","$compile","$animator",function(a,c,d,e,f){return{restrict:"ECA",terminal:!0,compile:function(i,
+h){var j=h.ngInclude||h.src,g=h.onload||"",m=h.autoscroll;return function(h,i,o){var n=f(h,o),s=0,r,p=function(){r&&(r.$destroy(),r=null);n.leave(i.contents(),i)};h.$watch(j,function(f){var j=++s;f?a.get(f,{cache:c}).success(function(a){j===s&&(r&&r.$destroy(),r=h.$new(),n.leave(i.contents(),i),a=v("<div/>").html(a).contents(),n.enter(a,i),e(a)(r),w(m)&&(!m||h.$eval(m))&&d(),r.$emit("$includeContentLoaded"),h.$eval(g))}).error(function(){j===s&&p()}):p()})}}}}],Ld=Y({compile:function(){return{pre:function(a,
+c,d){a.$eval(d.ngInit)}}}}),Md=Y({terminal:!0,priority:1E3}),Nd=["$locale","$interpolate",function(a,c){var d=/{}/g;return{restrict:"EA",link:function(e,f,i){var h=i.count,j=f.attr(i.$attr.when),g=i.offset||0,m=e.$eval(j),k={},l=c.startSymbol(),q=c.endSymbol();o(m,function(a,e){k[e]=c(a.replace(d,l+h+"-"+g+q))});e.$watch(function(){var c=parseFloat(e.$eval(h));return isNaN(c)?"":(m[c]||(c=a.pluralCat(c-g)),k[c](e,f,!0))},function(a){f.text(a)})}}}],Od=["$parse","$animator",function(a,c){return{transclude:"element",
+priority:1E3,terminal:!0,compile:function(d,e,f){return function(d,e,j){var g=c(d,j),m=j.ngRepeat,k=m.match(/^\s*(.+)\s+in\s+(.*?)\s*(\s+track\s+by\s+(.+)\s*)?$/),l,q,n,s,r,p={$id:la};if(!k)throw Error("Expected ngRepeat in form of '_item_ in _collection_[ track by _id_]' but got '"+m+"'.");j=k[1];n=k[2];(k=k[4])?(l=a(k),q=function(a,c,e){r&&(p[r]=a);p[s]=c;p.$index=e;return l(d,p)}):q=function(a,c){return la(c)};k=j.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!k)throw Error("'item' in 'item in collection' should be identifier or (key, value) but got '"+
+j+"'.");s=k[3]||k[1];r=k[2];var y={};d.$watchCollection(n,function(a){var c,j,k=e,l,n={},p,t,v,z,w,u,x=[];if(C(a))w=a;else{w=[];for(v in a)a.hasOwnProperty(v)&&v.charAt(0)!="$"&&w.push(v);w.sort()}p=w.length;j=x.length=w.length;for(c=0;c<j;c++)if(v=a===w?c:w[c],z=a[v],l=q(v,z,c),u=y[l])delete y[l],n[l]=u,x[c]=u;else if(n.hasOwnProperty(l))throw o(x,function(a){a&&a.element&&(y[a.id]=a)}),Error("Duplicates in a repeater are not allowed. Repeater: "+m);else x[c]={id:l};for(v in y)if(y.hasOwnProperty(v))u=
+y[v],g.leave(u.element),u.element[0].$$NG_REMOVED=!0,u.scope.$destroy();c=0;for(j=w.length;c<j;c++){v=a===w?c:w[c];z=a[v];u=x[c];if(u.element){t=u.scope;l=k[0];do l=l.nextSibling;while(l&&l.$$NG_REMOVED);u.element[0]!=l&&g.move(u.element,null,k);k=u.element}else t=d.$new();t[s]=z;r&&(t[r]=v);t.$index=c;t.$first=c===0;t.$last=c===p-1;t.$middle=!(t.$first||t.$last);u.element||f(t,function(a){g.enter(a,null,k);k=a;u.scope=t;u.element=a;n[u.id]=u})}y=n})}}}}],Pd=["$animator",function(a){return function(c,
+d,e){var f=a(c,e);c.$watch(e.ngShow,function(a){f[Ha(a)?"show":"hide"](d)})}}],Qd=["$animator",function(a){return function(c,d,e){var f=a(c,e);c.$watch(e.ngHide,function(a){f[Ha(a)?"hide":"show"](d)})}}],Rd=Y(function(a,c,d){a.$watch(d.ngStyle,function(a,d){d&&a!==d&&o(d,function(a,d){c.css(d,"")});a&&c.css(a)},!0)}),Sd=["$animator",function(a){return{restrict:"EA",require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(c,d,e,f){var i=a(c,e),h,j,g=[];c.$watch(e.ngSwitch||
+e.on,function(a){for(var d=0,l=g.length;d<l;d++)g[d].$destroy(),i.leave(j[d]);j=[];g=[];if(h=f.cases["!"+a]||f.cases["?"])c.$eval(e.change),o(h,function(a){var d=c.$new();g.push(d);a.transclude(d,function(c){var d=a.element;j.push(c);i.enter(c,d.parent(),d)})})})}}}],Td=Y({transclude:"element",priority:500,require:"^ngSwitch",compile:function(a,c,d){return function(a,f,i,h){h.cases["!"+c.ngSwitchWhen]=h.cases["!"+c.ngSwitchWhen]||[];h.cases["!"+c.ngSwitchWhen].push({transclude:d,element:f})}}}),Ud=
+Y({transclude:"element",priority:500,require:"^ngSwitch",compile:function(a,c,d){return function(a,c,i,h){h.cases["?"]=h.cases["?"]||[];h.cases["?"].push({transclude:d,element:c})}}}),Vd=Y({controller:["$transclude","$element",function(a,c){a(function(a){c.append(a)})}]}),Wd=["$http","$templateCache","$route","$anchorScroll","$compile","$controller","$animator",function(a,c,d,e,f,i,h){return{restrict:"ECA",terminal:!0,link:function(a,c,m){function k(){var h=d.current&&d.current.locals,k=h&&h.$template;
+if(k){n.leave(c.contents(),c);l&&(l.$destroy(),l=null);n.enter(v("<div></div>").html(k).contents(),c);var k=f(c.contents()),m=d.current;l=m.scope=a.$new();if(m.controller)h.$scope=l,h=i(m.controller,h),c.children().data("$ngControllerController",h);k(l);l.$emit("$viewContentLoaded");l.$eval(o);e()}else n.leave(c.contents(),c),l&&(l.$destroy(),l=null)}var l,o=m.onload||"",n=h(a,m);a.$on("$routeChangeSuccess",k);k()}}}],Xd=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(c,
+d){d.type=="text/ng-template"&&a.put(d.id,c[0].text)}}}],Yd=Q({terminal:!0}),Zd=["$compile","$parse",function(a,c){var d=/^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w\d]*)|(?:\(\s*([\$\w][\$\w\d]*)\s*,\s*([\$\w][\$\w\d]*)\s*\)))\s+in\s+(.*)$/,e={$setViewValue:t};return{restrict:"E",require:["select","?ngModel"],controller:["$element","$scope","$attrs",function(a,c,d){var j=this,g={},m=e,k;j.databound=d.ngModel;j.init=function(a,c,d){m=a;k=d};j.addOption=function(c){g[c]=
+!0;m.$viewValue==c&&(a.val(c),k.parent()&&k.remove())};j.removeOption=function(a){this.hasOption(a)&&(delete g[a],m.$viewValue==a&&this.renderUnknownOption(a))};j.renderUnknownOption=function(c){c="? "+la(c)+" ?";k.val(c);a.prepend(k);a.val(c);k.prop("selected",!0)};j.hasOption=function(a){return g.hasOwnProperty(a)};c.$on("$destroy",function(){j.renderUnknownOption=t})}],link:function(e,i,h,j){function g(a,c,d,e){d.$render=function(){var a=d.$viewValue;e.hasOption(a)?(x.parent()&&x.remove(),c.val(a),
+a===""&&p.prop("selected",!0)):u(a)&&p?c.val(""):e.renderUnknownOption(a)};c.bind("change",function(){a.$apply(function(){x.parent()&&x.remove();d.$setViewValue(c.val())})})}function m(a,c,d){var e;d.$render=function(){var a=new Pa(d.$viewValue);o(c.find("option"),function(c){c.selected=w(a.get(c.value))})};a.$watch(function(){ja(e,d.$viewValue)||(e=W(d.$viewValue),d.$render())});c.bind("change",function(){a.$apply(function(){var a=[];o(c.find("option"),function(c){c.selected&&a.push(c.value)});d.$setViewValue(a)})})}
+function k(e,f,h){function g(){var a={"":[]},c=[""],d,i,t,v,u;t=h.$modelValue;v=p(e)||[];var w=l?rb(v):v,z,x,A;x={};u=!1;var B,C;if(n)u=new Pa(t);else if(t===null||r)a[""].push({selected:t===null,id:"",label:""}),u=!0;for(A=0;z=w.length,A<z;A++){x[k]=v[l?x[l]=w[A]:A];d=m(e,x)||"";if(!(i=a[d]))i=a[d]=[],c.push(d);n?d=u.remove(o(e,x))!=s:(d=t===o(e,x),u=u||d);B=j(e,x);B=B===s?"":B;i.push({id:l?w[A]:A,label:B,selected:d})}!n&&!u&&a[""].unshift({id:"?",label:"",selected:!0});x=0;for(w=c.length;x<w;x++){d=
+c[x];i=a[d];if(q.length<=x)t={element:D.clone().attr("label",d),label:i.label},v=[t],q.push(v),f.append(t.element);else if(v=q[x],t=v[0],t.label!=d)t.element.attr("label",t.label=d);B=null;A=0;for(z=i.length;A<z;A++)if(d=i[A],u=v[A+1]){B=u.element;if(u.label!==d.label)B.text(u.label=d.label);if(u.id!==d.id)B.val(u.id=d.id);if(u.element.selected!==d.selected)B.prop("selected",u.selected=d.selected)}else d.id===""&&r?C=r:(C=y.clone()).val(d.id).attr("selected",d.selected).text(d.label),v.push({element:C,
+label:d.label,id:d.id,selected:d.selected}),B?B.after(C):t.element.append(C),B=C;for(A++;v.length>A;)v.pop().element.remove()}for(;q.length>x;)q.pop()[0].element.remove()}var i;if(!(i=t.match(d)))throw Error("Expected ngOptions in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '"+t+"'.");var j=c(i[2]||i[1]),k=i[4]||i[6],l=i[5],m=c(i[3]||""),o=c(i[2]?i[1]:k),p=c(i[7]),q=[[{element:f,label:""}]];r&&(a(r)(e),r.removeClass("ng-scope"),r.remove());f.html("");f.bind("change",
+function(){e.$apply(function(){var a,c=p(e)||[],d={},g,i,j,m,r,t;if(n){i=[];m=0;for(t=q.length;m<t;m++){a=q[m];j=1;for(r=a.length;j<r;j++)if((g=a[j].element)[0].selected)g=g.val(),l&&(d[l]=g),d[k]=c[g],i.push(o(e,d))}}else g=f.val(),g=="?"?i=s:g==""?i=null:(d[k]=c[g],l&&(d[l]=g),i=o(e,d));h.$setViewValue(i)})});h.$render=g;e.$watch(g)}if(j[1]){for(var l=j[0],q=j[1],n=h.multiple,t=h.ngOptions,r=!1,p,y=v(V.createElement("option")),D=v(V.createElement("optgroup")),x=y.clone(),j=0,C=i.children(),A=C.length;j<
+A;j++)if(C[j].value==""){p=r=C.eq(j);break}l.init(q,r,x);if(n&&(h.required||h.ngRequired)){var H=function(a){q.$setValidity("required",!h.required||a&&a.length);return a};q.$parsers.push(H);q.$formatters.unshift(H);h.$observe("required",function(){H(q.$viewValue)})}t?k(e,i,q):n?m(e,i,q):g(e,i,q,l)}}}}],$d=["$interpolate",function(a){var c={addOption:t,removeOption:t};return{restrict:"E",priority:100,compile:function(d,e){if(u(e.value)){var f=a(d.text(),!0);f||e.$set("value",d.text())}return function(a,
+d,e){var g=d.parent(),m=g.data("$selectController")||g.parent().data("$selectController");m&&m.databound?d.prop("selected",!1):m=c;f?a.$watch(f,function(a,c){e.$set("value",a);a!==c&&m.removeOption(c);m.addOption(a)}):m.addOption(e.value);d.bind("$destroy",function(){m.removeOption(e.value)})}}}}],ae=Q({restrict:"E",terminal:!0});(ca=M.jQuery)?(v=ca,y(ca.fn,{scope:za.scope,controller:za.controller,injector:za.injector,inheritedData:za.inheritedData}),fb("remove",!0),fb("empty"),fb("html")):v=P;Ia.element=
+v;(function(a){y(a,{bootstrap:vb,copy:W,extend:y,equals:ja,element:v,forEach:o,injector:wb,noop:t,bind:ab,toJson:da,fromJson:tb,identity:pa,isUndefined:u,isDefined:w,isString:x,isFunction:I,isObject:L,isNumber:Za,isElement:jc,isArray:C,version:md,isDate:qa,lowercase:J,uppercase:na,callbacks:{counter:0},noConflict:gc});xa=oc(M);try{xa("ngLocale")}catch(c){xa("ngLocale",[]).provider("$locale",cd)}xa("ng",["ngLocale"],["$provide",function(a){a.provider("$compile",Hb).directive({a:od,input:dc,textarea:dc,
+form:pd,script:Xd,select:Zd,style:ae,option:$d,ngBind:Ad,ngBindHtmlUnsafe:Cd,ngBindTemplate:Bd,ngClass:Dd,ngClassEven:Fd,ngClassOdd:Ed,ngCsp:Id,ngCloak:Gd,ngController:Hd,ngForm:qd,ngHide:Qd,ngInclude:Kd,ngInit:Ld,ngNonBindable:Md,ngPluralize:Nd,ngRepeat:Od,ngShow:Pd,ngSubmit:Jd,ngStyle:Rd,ngSwitch:Sd,ngSwitchWhen:Td,ngSwitchDefault:Ud,ngOptions:Yd,ngView:Wd,ngTransclude:Vd,ngModel:vd,ngList:xd,ngChange:wd,required:ec,ngRequired:ec,ngValue:zd}).directive(qb).directive(fc);a.provider({$anchorScroll:xc,
+$animation:Gb,$animator:nd,$browser:zc,$cacheFactory:Ac,$controller:Dc,$document:Ec,$exceptionHandler:Fc,$filter:Tb,$interpolate:Gc,$http:Zc,$httpBackend:$c,$location:Kc,$log:Lc,$parse:Pc,$route:Sc,$routeParams:Tc,$rootScope:Uc,$q:Qc,$sniffer:Vc,$templateCache:Bc,$timeout:dd,$window:Wc})}])})(Ia);v(V).ready(function(){mc(V,vb)})})(window,document);angular.element(document).find("head").append('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak{display:none;}ng\\:form{display:block;}</style>');
[23/30] git commit: Support chrome webstore links. Updated to support
new app dir structure.
Posted by ag...@apache.org.
Support chrome webstore links. Updated to support new app dir structure.
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/9f0d462b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/9f0d462b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/9f0d462b
Branch: refs/heads/master
Commit: 9f0d462b4b1fd9137765fe8d85e076146daf4abc
Parents: 4d4e0b4
Author: Shravan Narayan <sh...@google.com>
Authored: Sun May 12 01:12:14 2013 -0400
Committer: Braden Shepherdson <br...@google.com>
Committed: Thu May 16 15:29:29 2013 -0400
----------------------------------------------------------------------
www/cdvah_index.html | 1 +
www/cdvah_js/CrxDownloader.js | 31 ++++++++++++++++
www/cdvah_js/CrxPackageHandler.js | 60 ++++++++++++++++++--------------
3 files changed, 66 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/9f0d462b/www/cdvah_index.html
----------------------------------------------------------------------
diff --git a/www/cdvah_index.html b/www/cdvah_index.html
index 3eaede1..77bbd2b 100644
--- a/www/cdvah_index.html
+++ b/www/cdvah_index.html
@@ -13,6 +13,7 @@
<script type="text/javascript" src="cdvah_js/AppsService.js"></script>
<script type="text/javascript" src="cdvah_js/AppBundleAlias.js"></script>
<script type="text/javascript" src="cdvah_js/KnownExtensionDownloader.js"></script>
+ <script type="text/javascript" src="cdvah_js/CrxDownloader.js"></script>
<script type="text/javascript" src="cdvah_js/CdvhPackageHandler.js"></script>
<script type="text/javascript" src="cdvah_js/CrxPackageHandler.js"></script>
<script type="text/javascript" src="cdvah_js/ListCtrl.js"></script>
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/9f0d462b/www/cdvah_js/CrxDownloader.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/CrxDownloader.js b/www/cdvah_js/CrxDownloader.js
new file mode 100644
index 0000000..0388a08
--- /dev/null
+++ b/www/cdvah_js/CrxDownloader.js
@@ -0,0 +1,31 @@
+(function(){
+ "use strict";
+ /* global myApp */
+ myApp.run(["AppsService", "ResourcesLoader", function(AppsService, ResourcesLoader){
+
+ function isChromeWebStoreUri(pattern){
+ var regexUri = /^https:\/\/chrome.google.com\/webstore\/detail\/.*?\/[a-z]{32}((\?|#|\/).*)?$/;
+ var ret = (pattern.search(regexUri) !== -1);
+ return ret;
+ }
+
+ AppsService.registerPatternDownloader({
+ canHandleSourcePattern : isChromeWebStoreUri,
+
+ downloadFromPattern : function (appName, pattern, tempDirectory) {
+ var fileName = tempDirectory + appName + ".crx";
+ var chromeAppIdRegex = /^https:\/\/chrome\.google\.com\/webstore\/detail\/.*?\/([a-z]{32})/;
+ // Two results expected.
+ // 1 - the entire match of the regex
+ // 2 - the match of the capture group i.e. the app id
+ var matches = pattern.match(chromeAppIdRegex);
+ if(!matches || matches.length !== 2){
+ throw new Error("Invalid url for chrome web store");
+ }
+ var sourceUrl = "https://clients2.google.com/service/update2/crx?response=redirect&x=id%3D" + matches[1] + "%26uc";
+ return ResourcesLoader.downloadFromUrl(sourceUrl, fileName);
+ }
+ }, 500 /* assign a priority */);
+
+ }]);
+})();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/9f0d462b/www/cdvah_js/CrxPackageHandler.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/CrxPackageHandler.js b/www/cdvah_js/CrxPackageHandler.js
index 2627fd7..e4b4e7b 100644
--- a/www/cdvah_js/CrxPackageHandler.js
+++ b/www/cdvah_js/CrxPackageHandler.js
@@ -1,7 +1,9 @@
(function(){
"use strict";
/* global myApp */
- myApp.run(["AppsService", "ResourcesLoader", function(AppsService, ResourcesLoader){
+ myApp.run(["AppsService", "ResourcesLoader", "ContextMenuInjectScript", function(AppsService, ResourcesLoader, ContextMenuInjectScript){
+
+ var platformId = cordova.require("cordova/platform").id;
function copyFile(startUrl, targetLocation){
/************ Begin Work around for File system bug ************/
@@ -19,36 +21,42 @@
}
AppsService.registerPackageHandler("crx", {
- extractPackageToDirectory : function (fileName, outputDirectory){
- return ResourcesLoader.ensureDirectoryExists(outputDirectory + "/www")
- .then(function(){
- return ResourcesLoader.extractZipFile(fileName, outputDirectory + "/www");
- })
+ extractPackageToDirectory : function (appName, fileName, outputDirectory){
+ var dataToAppend = ContextMenuInjectScript.getInjectString(appName);
+ var platformDirectory = outputDirectory + "/" + platformId + "/";
+ var platformWWWDirectory = platformDirectory + "www/";
+ var cordovaFile = platformWWWDirectory + "cordova.js";
+
+ // We need to
+ // 1) Copy over the files required to convert a crx to a normal web app
+ // 2) Modify the cordova.js file
+ return ResourcesLoader.extractZipFile(fileName, platformWWWDirectory)
.then(function(){
return Q.all([
- copyFile("cdv-app-harness:///direct/cordova.js", outputDirectory + "/www/cordova.js"),
- copyFile("cdv-app-harness:///direct/crx_files/config.android.xml", outputDirectory + "/config.android.xml"),
- copyFile("cdv-app-harness:///direct/crx_files/config.ios.xml", outputDirectory + "/config.ios.xml"),
- copyFile("cdv-app-harness:///direct/crx_files/www/cordova_plugins.json", outputDirectory + "/www/cordova_plugins.json"),
- copyFile("cdv-app-harness:///direct/crx_files/www/chromeapp.html", outputDirectory + "/www/chromeapp.html"),
- copyFile("cdv-app-harness:///direct/crx_files/www/chromeappstyles.css", outputDirectory + "/www/chromeappstyles.css"),
- copyFile("cdv-app-harness:///direct/crx_files/www/chromebgpage.html", outputDirectory + "/www/chromebgpage.html"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/app/runtime.js", outputDirectory + "/www/plugins/chrome/api/app/runtime.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/app/window.js", outputDirectory + "/www/plugins/chrome/api/app/window.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/bootstrap.js", outputDirectory + "/www/plugins/chrome/api/bootstrap.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/helpers/stubs.js", outputDirectory + "/www/plugins/chrome/api/helpers/stubs.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/mobile.js", outputDirectory + "/www/plugins/chrome/api/mobile.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/runtime.js", outputDirectory + "/www/plugins/chrome/api/runtime.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.common/events.js", outputDirectory + "/www/plugins/chrome.common/events.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.fileSystem/fileSystem.js", outputDirectory + "/www/plugins/chrome.fileSystem/fileSystem.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.i18n/i18n.js", outputDirectory + "/www/plugins/chrome.i18n/i18n.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.identity/identity.js", outputDirectory + "/www/plugins/chrome.identity/identity.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.socket/socket.js", outputDirectory + "/www/plugins/chrome.socket/socket.js"),
- copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.storage/storage.js", outputDirectory + "/www/plugins/chrome.storage/storage.js")
+ copyFile("app-bundle:///cordova.js", cordovaFile),
+ copyFile("app-bundle:///crx_files/config." + platformId + ".xml", platformDirectory + "config.xml"),
+ copyFile("app-bundle:///crx_files/www/cordova_plugins.json", platformWWWDirectory + "cordova_plugins.json"),
+ copyFile("app-bundle:///crx_files/www/chromeapp.html", platformWWWDirectory + "chromeapp.html"),
+ copyFile("app-bundle:///crx_files/www/chromeappstyles.css", platformWWWDirectory + "chromeappstyles.css"),
+ copyFile("app-bundle:///crx_files/www/chromebgpage.html", platformWWWDirectory + "chromebgpage.html"),
+ copyFile("app-bundle:///crx_files/www/plugins/chrome/api/app/runtime.js", platformWWWDirectory + "plugins/chrome/api/app/runtime.js"),
+ copyFile("app-bundle:///crx_files/www/plugins/chrome/api/app/window.js", platformWWWDirectory + "plugins/chrome/api/app/window.js"),
+ copyFile("app-bundle:///crx_files/www/plugins/chrome/api/bootstrap.js", platformWWWDirectory + "plugins/chrome/api/bootstrap.js"),
+ copyFile("app-bundle:///crx_files/www/plugins/chrome/api/helpers/stubs.js", platformWWWDirectory + "plugins/chrome/api/helpers/stubs.js"),
+ copyFile("app-bundle:///crx_files/www/plugins/chrome/api/mobile.js", platformWWWDirectory + "plugins/chrome/api/mobile.js"),
+ copyFile("app-bundle:///crx_files/www/plugins/chrome/api/runtime.js", platformWWWDirectory + "plugins/chrome/api/runtime.js"),
+ copyFile("app-bundle:///crx_files/www/plugins/chrome.common/events.js", platformWWWDirectory + "plugins/chrome.common/events.js"),
+ copyFile("app-bundle:///crx_files/www/plugins/chrome.fileSystem/fileSystem.js", platformWWWDirectory + "plugins/chrome.fileSystem/fileSystem.js"),
+ copyFile("app-bundle:///crx_files/www/plugins/chrome.i18n/i18n.js", platformWWWDirectory + "plugins/chrome.i18n/i18n.js"),
+ copyFile("app-bundle:///crx_files/www/plugins/chrome.identity/identity.js", platformWWWDirectory + "plugins/chrome.identity/identity.js"),
+ copyFile("app-bundle:///crx_files/www/plugins/chrome.socket/socket.js", platformWWWDirectory + "plugins/chrome.socket/socket.js"),
+ copyFile("app-bundle:///crx_files/www/plugins/chrome.storage/storage.js", platformWWWDirectory + "plugins/chrome.storage/storage.js")
]);
+ })
+ .then(function(){
+ return ResourcesLoader.appendFileContents(cordovaFile, dataToAppend);
});
}
});
-
}]);
})();
\ No newline at end of file
[10/30] New filenames.Url aliases.(New AppBundle plugin needed).Desc
cont below Android has a bug where the web view will not throw intercept
events if you are navigating to a location that matches a filename in your
bundle. Thus in order to support url
Posted by ag...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/js/libs/angular.min.js
----------------------------------------------------------------------
diff --git a/www/js/libs/angular.min.js b/www/js/libs/angular.min.js
deleted file mode 100644
index 486d5e1..0000000
--- a/www/js/libs/angular.min.js
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- AngularJS v1.1.4
- (c) 2010-2012 Google, Inc. http://angularjs.org
- License: MIT
-*/
-(function(M,V,s){'use strict';function gc(){var b=M.angular;M.angular=hc;return b}function o(b,a,c){var d;if(b)if(I(b))for(d in b)d!="prototype"&&d!="length"&&d!="name"&&b.hasOwnProperty(d)&&a.call(c,b[d],d);else if(b.forEach&&b.forEach!==o)b.forEach(a,c);else if(!b||typeof b.length!=="number"?0:typeof b.hasOwnProperty!="function"&&typeof b.constructor!="function"||b instanceof P||ca&&b instanceof ca||Da.call(b)!=="[object Object]"||typeof b.callee==="function")for(d=0;d<b.length;d++)a.call(c,b[d],
-d);else for(d in b)b.hasOwnProperty(d)&&a.call(c,b[d],d);return b}function rb(b){var a=[],c;for(c in b)b.hasOwnProperty(c)&&a.push(c);return a.sort()}function ic(b,a,c){for(var d=rb(b),e=0;e<d.length;e++)a.call(c,b[d[e]],d[e]);return d}function sb(b){return function(a,c){b(c,a)}}function Ea(){for(var b=Z.length,a;b;){b--;a=Z[b].charCodeAt(0);if(a==57)return Z[b]="A",Z.join("");if(a==90)Z[b]="0";else return Z[b]=String.fromCharCode(a+1),Z.join("")}Z.unshift("0");return Z.join("")}function y(b){o(arguments,
-function(a){a!==b&&o(a,function(a,d){b[d]=a})});return b}function K(b){return parseInt(b,10)}function Fa(b,a){return y(new (y(function(){},{prototype:b})),a)}function t(){}function pa(b){return b}function Q(b){return function(){return b}}function u(b){return typeof b=="undefined"}function w(b){return typeof b!="undefined"}function L(b){return b!=null&&typeof b=="object"}function x(b){return typeof b=="string"}function Za(b){return typeof b=="number"}function qa(b){return Da.apply(b)=="[object Date]"}
-function C(b){return Da.apply(b)=="[object Array]"}function I(b){return typeof b=="function"}function ra(b){return b&&b.document&&b.location&&b.alert&&b.setInterval}function S(b){return x(b)?b.replace(/^\s*/,"").replace(/\s*$/,""):b}function jc(b){return b&&(b.nodeName||b.bind&&b.find)}function $a(b,a,c){var d=[];o(b,function(b,f,i){d.push(a.call(c,b,f,i))});return d}function Ga(b,a){if(b.indexOf)return b.indexOf(a);for(var c=0;c<b.length;c++)if(a===b[c])return c;return-1}function sa(b,a){var c=Ga(b,
-a);c>=0&&b.splice(c,1);return a}function W(b,a){if(ra(b)||b&&b.$evalAsync&&b.$watch)throw Error("Can't copy Window or Scope");if(a){if(b===a)throw Error("Can't copy equivalent objects or arrays");if(C(b))for(var c=a.length=0;c<b.length;c++)a.push(W(b[c]));else for(c in o(a,function(b,c){delete a[c]}),b)a[c]=W(b[c])}else(a=b)&&(C(b)?a=W(b,[]):qa(b)?a=new Date(b.getTime()):L(b)&&(a=W(b,{})));return a}function kc(b,a){var a=a||{},c;for(c in b)b.hasOwnProperty(c)&&c.substr(0,2)!=="$$"&&(a[c]=b[c]);return a}
-function ja(b,a){if(b===a)return!0;if(b===null||a===null)return!1;if(b!==b&&a!==a)return!0;var c=typeof b,d;if(c==typeof a&&c=="object")if(C(b)){if((c=b.length)==a.length){for(d=0;d<c;d++)if(!ja(b[d],a[d]))return!1;return!0}}else if(qa(b))return qa(a)&&b.getTime()==a.getTime();else{if(b&&b.$evalAsync&&b.$watch||a&&a.$evalAsync&&a.$watch||ra(b)||ra(a))return!1;c={};for(d in b)if(!(d.charAt(0)==="$"||I(b[d]))){if(!ja(b[d],a[d]))return!1;c[d]=!0}for(d in a)if(!c[d]&&d.charAt(0)!=="$"&&a[d]!==s&&!I(a[d]))return!1;
-return!0}return!1}function ab(b,a){var c=arguments.length>2?ka.call(arguments,2):[];return I(a)&&!(a instanceof RegExp)?c.length?function(){return arguments.length?a.apply(b,c.concat(ka.call(arguments,0))):a.apply(b,c)}:function(){return arguments.length?a.apply(b,arguments):a.call(b)}:a}function lc(b,a){var c=a;/^\$+/.test(b)?c=s:ra(a)?c="$WINDOW":a&&V===a?c="$DOCUMENT":a&&a.$evalAsync&&a.$watch&&(c="$SCOPE");return c}function da(b,a){return JSON.stringify(b,lc,a?" ":null)}function tb(b){return x(b)?
-JSON.parse(b):b}function Ha(b){b&&b.length!==0?(b=J(""+b),b=!(b=="f"||b=="0"||b=="false"||b=="no"||b=="n"||b=="[]")):b=!1;return b}function ta(b){b=v(b).clone();try{b.html("")}catch(a){}var c=v("<div>").append(b).html();try{return b[0].nodeType===3?J(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+J(b)})}catch(d){return J(c)}}function bb(b){var a={},c,d;o((b||"").split("&"),function(b){b&&(c=b.split("="),d=decodeURIComponent(c[0]),a[d]=w(c[1])?decodeURIComponent(c[1]):!0)});
-return a}function ub(b){var a=[];o(b,function(b,d){a.push(ua(d,!0)+(b===!0?"":"="+ua(b,!0)))});return a.length?a.join("&"):""}function cb(b){return ua(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ua(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,a?"%20":"+")}function mc(b,a){function c(a){a&&d.push(a)}var d=[b],e,f,i=["ng:app","ng-app","x-ng-app","data-ng-app"],h=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;
-o(i,function(a){i[a]=!0;c(V.getElementById(a));a=a.replace(":","\\:");b.querySelectorAll&&(o(b.querySelectorAll("."+a),c),o(b.querySelectorAll("."+a+"\\:"),c),o(b.querySelectorAll("["+a+"]"),c))});o(d,function(a){if(!e){var b=h.exec(" "+a.className+" ");b?(e=a,f=(b[2]||"").replace(/\s+/g,",")):o(a.attributes,function(b){if(!e&&i[b.name])e=a,f=b.value})}});e&&a(e,f?[f]:[])}function vb(b,a){var c=function(){b=v(b);a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);a.unshift("ng");
-var c=wb(a);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},d=/^NG_DEFER_BOOTSTRAP!/;if(M&&!d.test(M.name))return c();M.name=M.name.replace(d,"");Ia.resumeBootstrap=function(b){o(b,function(b){a.push(b)});c()}}function db(b,a){a=a||"_";return b.replace(nc,function(b,d){return(d?a:"")+b.toLowerCase()})}function eb(b,a,c){if(!b)throw Error("Argument '"+(a||"?")+"' is "+(c||"required"));return b}function va(b,
-a,c){c&&C(b)&&(b=b[b.length-1]);eb(I(b),a,"not a function, got "+(b&&typeof b=="object"?b.constructor.name||"Object":typeof b));return b}function oc(b){function a(a,b,e){return a[b]||(a[b]=e())}return a(a(b,"angular",Object),"module",function(){var b={};return function(d,e,f){e&&b.hasOwnProperty(d)&&(b[d]=null);return a(b,d,function(){function a(c,d,e){return function(){b[e||"push"]([c,d,arguments]);return m}}if(!e)throw Error("No module: "+d);var b=[],c=[],g=a("$injector","invoke"),m={_invokeQueue:b,
-_runBlocks:c,requires:e,name:d,provider:a("$provide","provider"),factory:a("$provide","factory"),service:a("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),animation:a("$animationProvider","register"),filter:a("$filterProvider","register"),controller:a("$controllerProvider","register"),directive:a("$compileProvider","directive"),config:g,run:function(a){c.push(a);return this}};f&&g(f);return m})}})}function Ja(b){return b.replace(pc,function(a,b,d,e){return e?
-d.toUpperCase():d}).replace(qc,"Moz$1")}function fb(b,a){function c(){var e;for(var b=[this],c=a,i,h,j,g,m,k;b.length;){i=b.shift();h=0;for(j=i.length;h<j;h++){g=v(i[h]);c?g.triggerHandler("$destroy"):c=!c;m=0;for(e=(k=g.children()).length,g=e;m<g;m++)b.push(ca(k[m]))}}return d.apply(this,arguments)}var d=ca.fn[b],d=d.$original||d;c.$original=d;ca.fn[b]=c}function P(b){if(b instanceof P)return b;if(!(this instanceof P)){if(x(b)&&b.charAt(0)!="<")throw Error("selectors not implemented");return new P(b)}if(x(b)){var a=
-V.createElement("div");a.innerHTML="<div> </div>"+b;a.removeChild(a.firstChild);gb(this,a.childNodes);this.remove()}else gb(this,b)}function hb(b){return b.cloneNode(!0)}function wa(b){xb(b);for(var a=0,b=b.childNodes||[];a<b.length;a++)wa(b[a])}function yb(b,a,c){var d=$(b,"events");$(b,"handle")&&(u(a)?o(d,function(a,c){ib(b,c,a);delete d[c]}):u(c)?(ib(b,a,d[a]),delete d[a]):sa(d[a],c))}function xb(b){var a=b[Ka],c=La[a];c&&(c.handle&&(c.events.$destroy&&c.handle({},"$destroy"),yb(b)),delete La[a],
-b[Ka]=s)}function $(b,a,c){var d=b[Ka],d=La[d||-1];if(w(c))d||(b[Ka]=d=++rc,d=La[d]={}),d[a]=c;else return d&&d[a]}function zb(b,a,c){var d=$(b,"data"),e=w(c),f=!e&&w(a),i=f&&!L(a);!d&&!i&&$(b,"data",d={});if(e)d[a]=c;else if(f)if(i)return d&&d[a];else y(d,a);else return d}function Ma(b,a){return(" "+b.className+" ").replace(/[\n\t]/g," ").indexOf(" "+a+" ")>-1}function Ab(b,a){a&&o(a.split(" "),function(a){b.className=S((" "+b.className+" ").replace(/[\n\t]/g," ").replace(" "+S(a)+" "," "))})}function Bb(b,
-a){a&&o(a.split(" "),function(a){if(!Ma(b,a))b.className=S(b.className+" "+S(a))})}function gb(b,a){if(a)for(var a=!a.nodeName&&w(a.length)&&!ra(a)?a:[a],c=0;c<a.length;c++)b.push(a[c])}function Cb(b,a){return Na(b,"$"+(a||"ngController")+"Controller")}function Na(b,a,c){b=v(b);for(b[0].nodeType==9&&(b=b.find("html"));b.length;){if(c=b.data(a))return c;b=b.parent()}}function Db(b,a){var c=Oa[a.toLowerCase()];return c&&Eb[b.nodeName]&&c}function sc(b,a){var c=function(c,e){if(!c.preventDefault)c.preventDefault=
-function(){c.returnValue=!1};if(!c.stopPropagation)c.stopPropagation=function(){c.cancelBubble=!0};if(!c.target)c.target=c.srcElement||V;if(u(c.defaultPrevented)){var f=c.preventDefault;c.preventDefault=function(){c.defaultPrevented=!0;f.call(c)};c.defaultPrevented=!1}c.isDefaultPrevented=function(){return c.defaultPrevented};o(a[e||c.type],function(a){a.call(b,c)});X<=8?(c.preventDefault=null,c.stopPropagation=null,c.isDefaultPrevented=null):(delete c.preventDefault,delete c.stopPropagation,delete c.isDefaultPrevented)};
-c.elem=b;return c}function la(b){var a=typeof b,c;if(a=="object"&&b!==null)if(typeof(c=b.$$hashKey)=="function")c=b.$$hashKey();else{if(c===s)c=b.$$hashKey=Ea()}else c=b;return a+":"+c}function Pa(b){o(b,this.put,this)}function Fb(b){var a,c;if(typeof b=="function"){if(!(a=b.$inject))a=[],c=b.toString().replace(tc,""),c=c.match(uc),o(c[1].split(vc),function(b){b.replace(wc,function(b,c,d){a.push(d)})}),b.$inject=a}else C(b)?(c=b.length-1,va(b[c],"fn"),a=b.slice(0,c)):va(b,"fn",!0);return a}function wb(b){function a(a){return function(b,
-c){if(L(b))o(b,sb(a));else return a(b,c)}}function c(a,b){if(I(b)||C(b))b=k.instantiate(b);if(!b.$get)throw Error("Provider "+a+" must define $get factory method.");return m[a+h]=b}function d(a,b){return c(a,{$get:b})}function e(a){var b=[];o(a,function(a){if(!g.get(a))if(g.put(a,!0),x(a)){var c=xa(a);b=b.concat(e(c.requires)).concat(c._runBlocks);try{for(var d=c._invokeQueue,c=0,h=d.length;c<h;c++){var f=d[c],n=k.get(f[0]);n[f[1]].apply(n,f[2])}}catch(j){throw j.message&&(j.message+=" from "+a),
-j;}}else if(I(a))try{b.push(k.invoke(a))}catch(i){throw i.message&&(i.message+=" from "+a),i;}else if(C(a))try{b.push(k.invoke(a))}catch(l){throw l.message&&(l.message+=" from "+String(a[a.length-1])),l;}else va(a,"module")});return b}function f(a,b){function c(d){if(typeof d!=="string")throw Error("Service name expected");if(a.hasOwnProperty(d)){if(a[d]===i)throw Error("Circular dependency: "+j.join(" <- "));return a[d]}else try{return j.unshift(d),a[d]=i,a[d]=b(d)}finally{j.shift()}}function d(a,
-b,e){var g=[],h=Fb(a),f,j,n;j=0;for(f=h.length;j<f;j++)n=h[j],g.push(e&&e.hasOwnProperty(n)?e[n]:c(n));a.$inject||(a=a[f]);switch(b?-1:g.length){case 0:return a();case 1:return a(g[0]);case 2:return a(g[0],g[1]);case 3:return a(g[0],g[1],g[2]);case 4:return a(g[0],g[1],g[2],g[3]);case 5:return a(g[0],g[1],g[2],g[3],g[4]);case 6:return a(g[0],g[1],g[2],g[3],g[4],g[5]);case 7:return a(g[0],g[1],g[2],g[3],g[4],g[5],g[6]);case 8:return a(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7]);case 9:return a(g[0],g[1],
-g[2],g[3],g[4],g[5],g[6],g[7],g[8]);case 10:return a(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9]);default:return a.apply(b,g)}}return{invoke:d,instantiate:function(a,b){var c=function(){},e;c.prototype=(C(a)?a[a.length-1]:a).prototype;c=new c;e=d(a,c,b);return L(e)?e:c},get:c,annotate:Fb}}var i={},h="Provider",j=[],g=new Pa,m={$provide:{provider:a(c),factory:a(d),service:a(function(a,b){return d(a,["$injector",function(a){return a.instantiate(b)}])}),value:a(function(a,b){return d(a,Q(b))}),
-constant:a(function(a,b){m[a]=b;l[a]=b}),decorator:function(a,b){var c=k.get(a+h),d=c.$get;c.$get=function(){var a=q.invoke(d,c);return q.invoke(b,null,{$delegate:a})}}}},k=m.$injector=f(m,function(){throw Error("Unknown provider: "+j.join(" <- "));}),l={},q=l.$injector=f(l,function(a){a=k.get(a+h);return q.invoke(a.$get,a)});o(e(b),function(a){q.invoke(a||t)});return q}function xc(){var b=!0;this.disableAutoScrolling=function(){b=!1};this.$get=["$window","$location","$rootScope",function(a,c,d){function e(a){var b=
-null;o(a,function(a){!b&&J(a.nodeName)==="a"&&(b=a)});return b}function f(){var b=c.hash(),d;b?(d=i.getElementById(b))?d.scrollIntoView():(d=e(i.getElementsByName(b)))?d.scrollIntoView():b==="top"&&a.scrollTo(0,0):a.scrollTo(0,0)}var i=a.document;b&&d.$watch(function(){return c.hash()},function(){d.$evalAsync(f)});return f}]}function Gb(b){this.register=function(a,c){b.factory(Ja(a)+"Animation",c)};this.$get=["$injector",function(a){return function(b){if(b)try{return a.get(Ja(b)+"Animation")}catch(d){}}}]}
-function yc(b,a,c,d){function e(a){try{a.apply(null,ka.call(arguments,1))}finally{if(n--,n===0)for(;B.length;)try{B.pop()()}catch(b){c.error(b)}}}function f(a,b){(function z(){o(r,function(a){a()});p=b(z,a)})()}function i(){E!=h.url()&&(E=h.url(),o(G,function(a){a(h.url())}))}var h=this,j=a[0],g=b.location,m=b.history,k=b.setTimeout,l=b.clearTimeout,q={};h.isMock=!1;var n=0,B=[];h.$$completeOutstandingRequest=e;h.$$incOutstandingRequestCount=function(){n++};h.notifyWhenNoOutstandingRequests=function(a){o(r,
-function(a){a()});n===0?a():B.push(a)};var r=[],p;h.addPollFn=function(a){u(p)&&f(100,k);r.push(a);return a};var E=g.href,D=a.find("base");h.url=function(a,b){if(a){if(E!=a)return E=a,d.history?b?m.replaceState(null,"",a):(m.pushState(null,"",a),D.attr("href",D.attr("href"))):b?g.replace(a):g.href=a,h}else return g.href.replace(/%27/g,"'")};var G=[],R=!1;h.onUrlChange=function(a){R||(d.history&&v(b).bind("popstate",i),d.hashchange?v(b).bind("hashchange",i):h.addPollFn(i),R=!0);G.push(a);return a};
-h.baseHref=function(){var a=D.attr("href");return a?a.replace(/^https?\:\/\/[^\/]*/,""):""};var A={},H="",F=h.baseHref();h.cookies=function(a,b){var d,e,g,h;if(a)if(b===s)j.cookie=escape(a)+"=;path="+F+";expires=Thu, 01 Jan 1970 00:00:00 GMT";else{if(x(b))d=(j.cookie=escape(a)+"="+escape(b)+";path="+F).length+1,d>4096&&c.warn("Cookie '"+a+"' possibly not set or overflowed because it was too large ("+d+" > 4096 bytes)!")}else{if(j.cookie!==H){H=j.cookie;d=H.split("; ");A={};for(g=0;g<d.length;g++)e=
-d[g],h=e.indexOf("="),h>0&&(A[unescape(e.substring(0,h))]=unescape(e.substring(h+1)))}return A}};h.defer=function(a,b){var c;n++;c=k(function(){delete q[c];e(a)},b||0);q[c]=!0;return c};h.defer.cancel=function(a){return q[a]?(delete q[a],l(a),e(t),!0):!1}}function zc(){this.$get=["$window","$log","$sniffer","$document",function(b,a,c,d){return new yc(b,d,a,c)}]}function Ac(){this.$get=function(){function b(b,d){function e(a){if(a!=k){if(l){if(l==a)l=a.n}else l=a;f(a.n,a.p);f(a,k);k=a;k.n=null}}function f(a,
-b){if(a!=b){if(a)a.p=b;if(b)b.n=a}}if(b in a)throw Error("cacheId "+b+" taken");var i=0,h=y({},d,{id:b}),j={},g=d&&d.capacity||Number.MAX_VALUE,m={},k=null,l=null;return a[b]={put:function(a,b){var c=m[a]||(m[a]={key:a});e(c);if(!u(b))return a in j||i++,j[a]=b,i>g&&this.remove(l.key),b},get:function(a){var b=m[a];if(b)return e(b),j[a]},remove:function(a){var b=m[a];if(b){if(b==k)k=b.p;if(b==l)l=b.n;f(b.n,b.p);delete m[a];delete j[a];i--}},removeAll:function(){j={};i=0;m={};k=l=null},destroy:function(){m=
-h=j=null;delete a[b]},info:function(){return y({},h,{size:i})}}}var a={};b.info=function(){var b={};o(a,function(a,e){b[e]=a.info()});return b};b.get=function(b){return a[b]};return b}}function Bc(){this.$get=["$cacheFactory",function(b){return b("templates")}]}function Hb(b){var a={},c="Directive",d=/^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,e=/(([\d\w\-_]+)(?:\:([^;]+))?;?)/,f="Template must have exactly one root element. was: ",i=/^\s*(https?|ftp|mailto|file):/;this.directive=function j(d,e){x(d)?
-(eb(e,"directive"),a.hasOwnProperty(d)||(a[d]=[],b.factory(d+c,["$injector","$exceptionHandler",function(b,c){var e=[];o(a[d],function(a){try{var f=b.invoke(a);if(I(f))f={compile:Q(f)};else if(!f.compile&&f.link)f.compile=Q(f.link);f.priority=f.priority||0;f.name=f.name||d;f.require=f.require||f.controller&&f.name;f.restrict=f.restrict||"A";e.push(f)}catch(j){c(j)}});return e}])),a[d].push(e)):o(d,sb(j));return this};this.urlSanitizationWhitelist=function(a){return w(a)?(i=a,this):i};this.$get=["$injector",
-"$interpolate","$exceptionHandler","$http","$templateCache","$parse","$controller","$rootScope","$document",function(b,g,m,k,l,q,n,B,r){function p(a,b,c){a instanceof v||(a=v(a));o(a,function(b,c){b.nodeType==3&&b.nodeValue.match(/\S+/)&&(a[c]=v(b).wrap("<span></span>").parent()[0])});var d=D(a,b,a,c);return function(b,c){eb(b,"scope");for(var e=c?za.clone.call(a):a,g=0,f=e.length;g<f;g++){var j=e[g];(j.nodeType==1||j.nodeType==9)&&e.eq(g).data("$scope",b)}E(e,"ng-scope");c&&c(e,b);d&&d(b,e,e);return e}}
-function E(a,b){try{a.addClass(b)}catch(c){}}function D(a,b,c,d){function e(a,c,d,f){var j,i,l,m,n,k,q,p=[];n=0;for(k=c.length;n<k;n++)p.push(c[n]);q=n=0;for(k=g.length;n<k;q++)i=p[q],c=g[n++],j=g[n++],c?(c.scope?(l=a.$new(L(c.scope)),v(i).data("$scope",l)):l=a,(m=c.transclude)||!f&&b?c(j,l,i,d,function(b){return function(c){var d=a.$new();d.$$transcluded=!0;return b(d,c).bind("$destroy",ab(d,d.$destroy))}}(m||b)):c(j,l,i,s,f)):j&&j(a,i.childNodes,s,f)}for(var g=[],f,j,i,l=0;l<a.length;l++)j=new ya,
-f=G(a[l],[],j,d),j=(f=f.length?R(f,a[l],j,b,c):null)&&f.terminal||!a[l].childNodes||!a[l].childNodes.length?null:D(a[l].childNodes,f?f.transclude:b),g.push(f),g.push(j),i=i||f||j;return i?e:null}function G(a,b,c,g){var f=c.$attr,j;switch(a.nodeType){case 1:A(b,aa(jb(a).toLowerCase()),"E",g);var i,l,n;j=a.attributes;for(var m=0,k=j&&j.length;m<k;m++)if(i=j[m],i.specified)l=i.name,n=aa(l),ha.test(n)&&(l=n.substr(6).toLowerCase()),n=aa(l.toLowerCase()),f[n]=l,c[n]=i=S(X&&l=="href"?decodeURIComponent(a.getAttribute(l,
-2)):i.value),Db(a,n)&&(c[n]=!0),z(a,b,i,n),A(b,n,"A",g);a=a.className;if(x(a)&&a!=="")for(;j=e.exec(a);)n=aa(j[2]),A(b,n,"C",g)&&(c[n]=S(j[3])),a=a.substr(j.index+j[0].length);break;case 3:ga(b,a.nodeValue);break;case 8:try{if(j=d.exec(a.nodeValue))n=aa(j[1]),A(b,n,"M",g)&&(c[n]=S(j[2]))}catch(q){}}b.sort(N);return b}function R(a,b,c,d,e){function j(a,b){if(a)a.require=z.require,B.push(a);if(b)b.require=z.require,r.push(b)}function i(a,b){var c,d="data",e=!1;if(x(a)){for(;(c=a.charAt(0))=="^"||c==
-"?";)a=a.substr(1),c=="^"&&(d="inheritedData"),e=e||c=="?";c=b[d]("$"+a+"Controller");if(!c&&!e)throw Error("No controller: "+a);}else C(a)&&(c=[],o(a,function(a){c.push(i(a,b))}));return c}function l(a,d,e,f,j){var k,p,D,G,H;k=b===e?c:kc(c,new ya(v(e),c.$attr));p=k.$$element;if(ba){var z=/^\s*([@=&])(\??)\s*(\w*)\s*$/,F=d.$parent||d;o(ba.scope,function(a,b){var c=a.match(z)||[],e=c[3]||b,f=c[2]=="?",c=c[1],j,l,i;d.$$isolateBindings[b]=c+e;switch(c){case "@":k.$observe(e,function(a){d[b]=a});k.$$observers[e].$$scope=
-F;k[e]&&(d[b]=g(k[e])(F));break;case "=":if(f&&!k[e])break;l=q(k[e]);i=l.assign||function(){j=d[b]=l(F);throw Error(Ib+k[e]+" (directive: "+ba.name+")");};j=d[b]=l(F);d.$watch(function(){var a=l(F);a!==d[b]&&(a!==j?j=d[b]=a:i(F,a=j=d[b]));return a});break;case "&":l=q(k[e]);d[b]=function(a){return l(F,a)};break;default:throw Error("Invalid isolate scope definition for directive "+ba.name+": "+a);}})}ha&&o(ha,function(a){var b={$scope:d,$element:p,$attrs:k,$transclude:j};H=a.controller;H=="@"&&(H=
-k[a.name]);p.data("$"+a.name+"Controller",n(H,b))});f=0;for(D=B.length;f<D;f++)try{G=B[f],G(d,p,k,G.require&&i(G.require,p))}catch(E){m(E,ta(p))}a&&a(d,e.childNodes,s,j);f=0;for(D=r.length;f<D;f++)try{G=r[f],G(d,p,k,G.require&&i(G.require,p))}catch(N){m(N,ta(p))}}for(var k=-Number.MAX_VALUE,B=[],r=[],D=null,ba=null,N=null,A=c.$$element=v(b),z,T,R,ga,ia=d,ha,t,y,w=0,u=a.length;w<u;w++){z=a[w];R=s;if(k>z.priority)break;if(y=z.scope)ea("isolated scope",ba,z,A),L(y)&&(E(A,"ng-isolate-scope"),ba=z),E(A,
-"ng-scope"),D=D||z;T=z.name;if(y=z.controller)ha=ha||{},ea("'"+T+"' controller",ha[T],z,A),ha[T]=z;if(y=z.transclude)ea("transclusion",ga,z,A),ga=z,k=z.priority,y=="element"?(R=v(b),A=c.$$element=v(V.createComment(" "+T+": "+c[T]+" ")),b=A[0],fa(e,v(R[0]),b),ia=p(R,d,k)):(R=v(hb(b)).contents(),A.html(""),ia=p(R,d));if(z.template)if(ea("template",N,z,A),N=z,y=I(z.template)?z.template(A,c):z.template,y=Jb(y),z.replace){R=v("<div>"+S(y)+"</div>").contents();b=R[0];if(R.length!=1||b.nodeType!==1)throw Error(f+
-y);fa(e,A,b);T={$attr:{}};a=a.concat(G(b,a.splice(w+1,a.length-(w+1)),T));H(c,T);u=a.length}else A.html(y);if(z.templateUrl)ea("template",N,z,A),N=z,l=F(a.splice(w,a.length-w),l,A,c,e,z.replace,ia),u=a.length;else if(z.compile)try{t=z.compile(A,c,ia),I(t)?j(null,t):t&&j(t.pre,t.post)}catch(J){m(J,ta(A))}if(z.terminal)l.terminal=!0,k=Math.max(k,z.priority)}l.scope=D&&D.scope;l.transclude=ga&&ia;return l}function A(d,e,g,f){var l=!1;if(a.hasOwnProperty(e))for(var i,e=b.get(e+c),n=0,k=e.length;n<k;n++)try{if(i=
-e[n],(f===s||f>i.priority)&&i.restrict.indexOf(g)!=-1)d.push(i),l=!0}catch(q){m(q)}return l}function H(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;o(a,function(d,e){e.charAt(0)!="$"&&(b[e]&&(d+=(e==="style"?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});o(b,function(b,g){g=="class"?(E(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):g=="style"?e.attr("style",e.attr("style")+";"+b):g.charAt(0)!="$"&&!a.hasOwnProperty(g)&&(a[g]=b,d[g]=c[g])})}function F(a,b,c,d,e,g,j){var i=[],n,m,q=c[0],p=a.shift(),ya=y({},
-p,{controller:null,templateUrl:null,transclude:null,scope:null}),p=I(p.templateUrl)?p.templateUrl(c,d):p.templateUrl;c.html("");k.get(p,{cache:l}).success(function(l){var k,p,l=Jb(l);if(g){p=v("<div>"+S(l)+"</div>").contents();k=p[0];if(p.length!=1||k.nodeType!==1)throw Error(f+l);l={$attr:{}};fa(e,c,k);G(k,a,l);H(d,l)}else k=q,c.html(l);a.unshift(ya);n=R(a,k,d,j);for(m=D(c[0].childNodes,j);i.length;){var B=i.shift(),l=i.shift();p=i.shift();var r=i.shift(),F=k;l!==q&&(F=hb(k),fa(p,v(l),F));n(function(){b(m,
-B,F,e,r)},B,F,e,r)}i=null}).error(function(a,b,c,d){throw Error("Failed to load template: "+d.url);});return function(a,c,d,e,g){i?(i.push(c),i.push(d),i.push(e),i.push(g)):n(function(){b(m,c,d,e,g)},c,d,e,g)}}function N(a,b){return b.priority-a.priority}function ea(a,b,c,d){if(b)throw Error("Multiple directives ["+b.name+", "+c.name+"] asking for "+a+" on: "+ta(d));}function ga(a,b){var c=g(b,!0);c&&a.push({priority:0,compile:Q(function(a,b){var d=b.parent(),e=d.data("$binding")||[];e.push(c);E(d.data("$binding",
-e),"ng-binding");a.$watch(c,function(a){b[0].nodeValue=a})})})}function z(a,b,c,d){var e=g(c,!0);e&&b.push({priority:100,compile:Q(function(a,b,c){b=c.$$observers||(c.$$observers={});if(e=g(c[d],!0))c[d]=e(a),(b[d]||(b[d]=[])).$$inter=!0,(c.$$observers&&c.$$observers[d].$$scope||a).$watch(e,function(a){c.$set(d,a)})})})}function fa(a,b,c){var d=b[0],e=d.parentNode,g,f;if(a){g=0;for(f=a.length;g<f;g++)if(a[g]==d){a[g]=c;break}}e&&e.replaceChild(c,d);c[v.expando]=d[v.expando];b[0]=c}var ya=function(a,
-b){this.$$element=a;this.$attr=b||{}};ya.prototype={$normalize:aa,$set:function(a,b,c,d){var e=Db(this.$$element[0],a),g=this.$$observers;e&&(this.$$element.prop(a,b),d=e);this[a]=b;d?this.$attr[a]=d:(d=this.$attr[a])||(this.$attr[a]=d=db(a,"-"));if(jb(this.$$element[0])==="A"&&a==="href")ba.setAttribute("href",b),e=ba.href,e.match(i)||(this[a]=b="unsafe:"+e);c!==!1&&(b===null||b===s?this.$$element.removeAttr(d):this.$$element.attr(d,b));g&&o(g[a],function(a){try{a(b)}catch(c){m(c)}})},$observe:function(a,
-b){var c=this,d=c.$$observers||(c.$$observers={}),e=d[a]||(d[a]=[]);e.push(b);B.$evalAsync(function(){e.$$inter||b(c[a])});return b}};var ba=r[0].createElement("a"),T=g.startSymbol(),ia=g.endSymbol(),Jb=T=="{{"||ia=="}}"?pa:function(a){return a.replace(/\{\{/g,T).replace(/}}/g,ia)},ha=/^ngAttr[A-Z]/;return p}]}function aa(b){return Ja(b.replace(Cc,""))}function Dc(){var b={};this.register=function(a,c){L(a)?y(b,a):b[a]=c};this.$get=["$injector","$window",function(a,c){return function(d,e){if(x(d)){var f=
-d,d=b.hasOwnProperty(f)?b[f]:kb(e.$scope,f,!0)||kb(c,f,!0);va(d,f,!0)}return a.instantiate(d,e)}}]}function Ec(){this.$get=["$window",function(b){return v(b.document)}]}function Fc(){this.$get=["$log",function(b){return function(a,c){b.error.apply(b,arguments)}}]}function Gc(){var b="{{",a="}}";this.startSymbol=function(a){return a?(b=a,this):b};this.endSymbol=function(b){return b?(a=b,this):a};this.$get=["$parse","$exceptionHandler",function(c,d){function e(e,j){for(var g,m,k=0,l=[],q=e.length,n=
-!1,B=[];k<q;)(g=e.indexOf(b,k))!=-1&&(m=e.indexOf(a,g+f))!=-1?(k!=g&&l.push(e.substring(k,g)),l.push(k=c(n=e.substring(g+f,m))),k.exp=n,k=m+i,n=!0):(k!=q&&l.push(e.substring(k)),k=q);if(!(q=l.length))l.push(""),q=1;if(!j||n)return B.length=q,k=function(a){try{for(var b=0,c=q,g;b<c;b++){if(typeof(g=l[b])=="function")g=g(a),g==null||g==s?g="":typeof g!="string"&&(g=da(g));B[b]=g}return B.join("")}catch(f){d(Error("Error while interpolating: "+e+"\n"+f.toString()))}},k.exp=e,k.parts=l,k}var f=b.length,
-i=a.length;e.startSymbol=function(){return b};e.endSymbol=function(){return a};return e}]}function Kb(b){for(var b=b.split("/"),a=b.length;a--;)b[a]=cb(b[a]);return b.join("/")}function Aa(b,a){var c=lb.exec(b),c={protocol:c[1],host:c[3],port:K(c[5])||Ba[c[1]]||null,path:c[6]||"/",search:c[8],hash:c[10]};if(a)a.$$protocol=c.protocol,a.$$host=c.host,a.$$port=c.port;return c}function ma(b,a,c){return b+"://"+a+(c==Ba[b]?"":":"+c)}function Hc(b,a,c){var d=Aa(b);return decodeURIComponent(d.path)!=a||
-u(d.hash)||d.hash.indexOf(c)!==0?b:ma(d.protocol,d.host,d.port)+a.substr(0,a.lastIndexOf("/"))+d.hash.substr(c.length)}function Ic(b,a,c){var d=Aa(b);if(decodeURIComponent(d.path)==a&&!u(d.hash)&&d.hash.indexOf(c)===0)return b;else{var e=d.search&&"?"+d.search||"",f=d.hash&&"#"+d.hash||"",i=a.substr(0,a.lastIndexOf("/")),h=d.path.substr(i.length);if(d.path.indexOf(i)!==0)throw Error('Invalid url "'+b+'", missing path prefix "'+i+'" !');return ma(d.protocol,d.host,d.port)+a+"#"+c+h+e+f}}function mb(b,
-a,c){a=a||"";this.$$parse=function(b){var c=Aa(b,this);if(c.path.indexOf(a)!==0)throw Error('Invalid url "'+b+'", missing path prefix "'+a+'" !');this.$$path=decodeURIComponent(c.path.substr(a.length));this.$$search=bb(c.search);this.$$hash=c.hash&&decodeURIComponent(c.hash)||"";this.$$compose()};this.$$compose=function(){var b=ub(this.$$search),c=this.$$hash?"#"+cb(this.$$hash):"";this.$$url=Kb(this.$$path)+(b?"?"+b:"")+c;this.$$absUrl=ma(this.$$protocol,this.$$host,this.$$port)+a+this.$$url};this.$$rewriteAppUrl=
-function(a){if(a.indexOf(c)==0)return a};this.$$parse(b)}function Qa(b,a,c){var d;this.$$parse=function(b){var c=Aa(b,this);if(c.hash&&c.hash.indexOf(a)!==0)throw Error('Invalid url "'+b+'", missing hash prefix "'+a+'" !');d=c.path+(c.search?"?"+c.search:"");c=Jc.exec((c.hash||"").substr(a.length));this.$$path=c[1]?(c[1].charAt(0)=="/"?"":"/")+decodeURIComponent(c[1]):"";this.$$search=bb(c[3]);this.$$hash=c[5]&&decodeURIComponent(c[5])||"";this.$$compose()};this.$$compose=function(){var b=ub(this.$$search),
-c=this.$$hash?"#"+cb(this.$$hash):"";this.$$url=Kb(this.$$path)+(b?"?"+b:"")+c;this.$$absUrl=ma(this.$$protocol,this.$$host,this.$$port)+d+(this.$$url?"#"+a+this.$$url:"")};this.$$rewriteAppUrl=function(a){if(a.indexOf(c)==0)return a};this.$$parse(b)}function Lb(b,a,c,d){Qa.apply(this,arguments);this.$$rewriteAppUrl=function(b){if(b.indexOf(c)==0)return c+d+"#"+a+b.substr(c.length)}}function Ra(b){return function(){return this[b]}}function Mb(b,a){return function(c){if(u(c))return this[b];this[b]=
-a(c);this.$$compose();return this}}function Kc(){var b="",a=!1;this.hashPrefix=function(a){return w(a)?(b=a,this):b};this.html5Mode=function(b){return w(b)?(a=b,this):a};this.$get=["$rootScope","$browser","$sniffer","$rootElement",function(c,d,e,f){function i(a){c.$broadcast("$locationChangeSuccess",h.absUrl(),a)}var h,j,g,m=d.url(),k=Aa(m);a?(j=d.baseHref()||"/",g=j.substr(0,j.lastIndexOf("/")),k=ma(k.protocol,k.host,k.port)+g+"/",h=e.history?new mb(Hc(m,j,b),g,k):new Lb(Ic(m,j,b),b,k,j.substr(g.length+
-1))):(k=ma(k.protocol,k.host,k.port)+(k.path||"")+(k.search?"?"+k.search:"")+"#"+b+"/",h=new Qa(m,b,k));f.bind("click",function(a){if(!a.ctrlKey&&!(a.metaKey||a.which==2)){for(var b=v(a.target);J(b[0].nodeName)!=="a";)if(b[0]===f[0]||!(b=b.parent())[0])return;var d=b.prop("href"),e=h.$$rewriteAppUrl(d);d&&!b.attr("target")&&e&&(h.$$parse(e),c.$apply(),a.preventDefault(),M.angular["ff-684208-preventDefault"]=!0)}});h.absUrl()!=m&&d.url(h.absUrl(),!0);d.onUrlChange(function(a){h.absUrl()!=a&&(c.$evalAsync(function(){var b=
-h.absUrl();h.$$parse(a);i(b)}),c.$$phase||c.$digest())});var l=0;c.$watch(function(){var a=d.url(),b=h.$$replace;if(!l||a!=h.absUrl())l++,c.$evalAsync(function(){c.$broadcast("$locationChangeStart",h.absUrl(),a).defaultPrevented?h.$$parse(a):(d.url(h.absUrl(),b),i(a))});h.$$replace=!1;return l});return h}]}function Lc(){var b=!0,a=this;this.debugEnabled=function(a){return w(a)?(b=a,this):b};this.$get=["$window",function(c){function d(a){a instanceof Error&&(a.stack?a=a.message&&a.stack.indexOf(a.message)===
--1?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=c.console||{},e=b[a]||b.log||t;return e.apply?function(){var a=[];o(arguments,function(b){a.push(d(b))});return e.apply(b,a)}:function(a,b){e(a,b)}}return{log:e("log"),warn:e("warn"),info:e("info"),error:e("error"),debug:function(){var c=e("debug");return function(){b&&c.apply(a,arguments)}}()}}]}function Mc(b,a){function c(a){return a.indexOf(r)!=-1}function d(a){a=a||
-1;return n+a<b.length?b.charAt(n+a):!1}function e(a){return"0"<=a&&a<="9"}function f(a){return a==" "||a=="\r"||a=="\t"||a=="\n"||a=="\u000b"||a=="\u00a0"}function i(a){return"a"<=a&&a<="z"||"A"<=a&&a<="Z"||"_"==a||a=="$"}function h(a){return a=="-"||a=="+"||e(a)}function j(a,c,d){d=d||n;throw Error("Lexer Error: "+a+" at column"+(w(c)?"s "+c+"-"+n+" ["+b.substring(c,d)+"]":" "+d)+" in expression ["+b+"].");}function g(){for(var a="",c=n;n<b.length;){var g=J(b.charAt(n));if(g=="."||e(g))a+=g;else{var f=
-d();if(g=="e"&&h(f))a+=g;else if(h(g)&&f&&e(f)&&a.charAt(a.length-1)=="e")a+=g;else if(h(g)&&(!f||!e(f))&&a.charAt(a.length-1)=="e")j("Invalid exponent");else break}n++}a*=1;l.push({index:c,text:a,json:!0,fn:function(){return a}})}function m(){for(var c="",d=n,g,h,j;n<b.length;){var k=b.charAt(n);if(k=="."||i(k)||e(k))k=="."&&(g=n),c+=k;else break;n++}if(g)for(h=n;h<b.length;){k=b.charAt(h);if(k=="("){j=c.substr(g-d+1);c=c.substr(0,g-d);n=h;break}if(f(k))h++;else break}d={index:d,text:c};if(Ca.hasOwnProperty(c))d.fn=
-d.json=Ca[c];else{var m=Nb(c,a);d.fn=y(function(a,b){return m(a,b)},{assign:function(a,b){return Ob(a,c,b)}})}l.push(d);j&&(l.push({index:g,text:".",json:!1}),l.push({index:g+1,text:j,json:!1}))}function k(a){var c=n;n++;for(var d="",e=a,g=!1;n<b.length;){var h=b.charAt(n);e+=h;if(g)h=="u"?(h=b.substring(n+1,n+5),h.match(/[\da-f]{4}/i)||j("Invalid unicode escape [\\u"+h+"]"),n+=4,d+=String.fromCharCode(parseInt(h,16))):(g=Nc[h],d+=g?g:h),g=!1;else if(h=="\\")g=!0;else if(h==a){n++;l.push({index:c,
-text:e,string:d,json:!0,fn:function(){return d}});return}else d+=h;n++}j("Unterminated quote",c)}for(var l=[],q,n=0,B=[],r,p=":";n<b.length;){r=b.charAt(n);if(c("\"'"))k(r);else if(e(r)||c(".")&&e(d()))g();else if(i(r)){if(m(),"{,".indexOf(p)!=-1&&B[0]=="{"&&(q=l[l.length-1]))q.json=q.text.indexOf(".")==-1}else if(c("(){}[].,;:"))l.push({index:n,text:r,json:":[,".indexOf(p)!=-1&&c("{[")||c("}]:,")}),c("{[")&&B.unshift(r),c("}]")&&B.shift(),n++;else if(f(r)){n++;continue}else{var E=r+d(),D=E+d(2),
-G=Ca[r],o=Ca[E],A=Ca[D];A?(l.push({index:n,text:D,fn:A}),n+=3):o?(l.push({index:n,text:E,fn:o}),n+=2):G?(l.push({index:n,text:r,fn:G,json:"[,:".indexOf(p)!=-1&&c("+-")}),n+=1):j("Unexpected next character ",n,n+1)}p=r}return l}function Oc(b,a,c,d){function e(a,c){throw Error("Syntax Error: Token '"+c.text+"' "+a+" at column "+(c.index+1)+" of the expression ["+b+"] starting at ["+b.substring(c.index)+"].");}function f(){if(F.length===0)throw Error("Unexpected end of expression: "+b);return F[0]}function i(a,
-b,c,d){if(F.length>0){var e=F[0],g=e.text;if(g==a||g==b||g==c||g==d||!a&&!b&&!c&&!d)return e}return!1}function h(b,c,d,g){return(b=i(b,c,d,g))?(a&&!b.json&&e("is not valid json",b),F.shift(),b):!1}function j(a){h(a)||e("is unexpected, expecting ["+a+"]",i())}function g(a,b){return y(function(c,d){return a(c,d,b)},{constant:b.constant})}function m(a,b,c){return y(function(d,e){return b(d,e,a,c)},{constant:a.constant&&c.constant})}function k(){for(var a=[];;)if(F.length>0&&!i("}",")",";","]")&&a.push(fa()),
-!h(";"))return a.length==1?a[0]:function(b,c){for(var d,e=0;e<a.length;e++){var g=a[e];g&&(d=g(b,c))}return d}}function l(){for(var a=h(),b=c(a.text),d=[];;)if(a=h(":"))d.push(N());else{var e=function(a,c,e){for(var e=[e],g=0;g<d.length;g++)e.push(d[g](a,c));return b.apply(a,e)};return function(){return e}}}function q(){for(var a=n(),b;;)if(b=h("||"))a=m(a,b.fn,n());else return a}function n(){var a=B(),b;if(b=h("&&"))a=m(a,b.fn,n());return a}function B(){var a=r(),b;if(b=h("==","!=","===","!=="))a=
-m(a,b.fn,B());return a}function r(){var a;a=p();for(var b;b=h("+","-");)a=m(a,b.fn,p());if(b=h("<",">","<=",">="))a=m(a,b.fn,r());return a}function p(){for(var a=E(),b;b=h("*","/","%");)a=m(a,b.fn,E());return a}function E(){var a;return h("+")?D():(a=h("-"))?m(A,a.fn,E()):(a=h("!"))?g(a.fn,E()):D()}function D(){var a;if(h("("))a=fa(),j(")");else if(h("["))a=G();else if(h("{"))a=o();else{var b=h();(a=b.fn)||e("not a primary expression",b);if(b.json)a.constant=a.literal=!0}for(var c;b=h("(","[",".");)b.text===
-"("?(a=ea(a,c),c=null):b.text==="["?(c=a,a=z(a)):b.text==="."?(c=a,a=ga(a)):e("IMPOSSIBLE");return a}function G(){var a=[],b=!0;if(f().text!="]"){do{var c=N();a.push(c);c.constant||(b=!1)}while(h(","))}j("]");return y(function(b,c){for(var d=[],e=0;e<a.length;e++)d.push(a[e](b,c));return d},{literal:!0,constant:b})}function o(){var a=[],b=!0;if(f().text!="}"){do{var c=h(),c=c.string||c.text;j(":");var d=N();a.push({key:c,value:d});d.constant||(b=!1)}while(h(","))}j("}");return y(function(b,c){for(var d=
-{},e=0;e<a.length;e++){var g=a[e],h=g.value(b,c);d[g.key]=h}return d},{literal:!0,constant:b})}var A=Q(0),H,F=Mc(b,d),N=function(){var a=q(),c,d;return(d=h("="))?(a.assign||e("implies assignment but ["+b.substring(0,d.index)+"] can not be assigned to",d),c=q(),function(b,d){return a.assign(b,c(b,d),d)}):a},ea=function(a,b){var c=[];if(f().text!=")"){do c.push(N());while(h(","))}j(")");return function(d,e){for(var g=[],h=b?b(d,e):d,f=0;f<c.length;f++)g.push(c[f](d,e));f=a(d,e)||t;return f.apply?f.apply(h,
-g):f(g[0],g[1],g[2],g[3],g[4])}},ga=function(a){var b=h().text,c=Nb(b,d);return y(function(b,d){return c(a(b,d),d)},{assign:function(c,d,e){return Ob(a(c,e),b,d)}})},z=function(a){var b=N();j("]");return y(function(c,d){var e=a(c,d),g=b(c,d),h;if(!e)return s;if((e=e[g])&&e.then){h=e;if(!("$$v"in e))h.$$v=s,h.then(function(a){h.$$v=a});e=e.$$v}return e},{assign:function(c,d,e){return a(c,e)[b(c,e)]=d}})},fa=function(){for(var a=N(),b;;)if(b=h("|"))a=m(a,b.fn,l());else return a};a?(N=q,ea=ga=z=fa=function(){e("is not valid json",
-{text:b,index:0})},H=D()):H=k();F.length!==0&&e("is an unexpected token",F[0]);H.literal=!!H.literal;H.constant=!!H.constant;return H}function Ob(b,a,c){for(var a=a.split("."),d=0;a.length>1;d++){var e=a.shift(),f=b[e];f||(f={},b[e]=f);b=f}return b[a.shift()]=c}function kb(b,a,c){if(!a)return b;for(var a=a.split("."),d,e=b,f=a.length,i=0;i<f;i++)d=a[i],b&&(b=(e=b)[d]);return!c&&I(b)?ab(e,b):b}function Pb(b,a,c,d,e){return function(f,i){var h=i&&i.hasOwnProperty(b)?i:f,j;if(h===null||h===s)return h;
-if((h=h[b])&&h.then){if(!("$$v"in h))j=h,j.$$v=s,j.then(function(a){j.$$v=a});h=h.$$v}if(!a||h===null||h===s)return h;if((h=h[a])&&h.then){if(!("$$v"in h))j=h,j.$$v=s,j.then(function(a){j.$$v=a});h=h.$$v}if(!c||h===null||h===s)return h;if((h=h[c])&&h.then){if(!("$$v"in h))j=h,j.$$v=s,j.then(function(a){j.$$v=a});h=h.$$v}if(!d||h===null||h===s)return h;if((h=h[d])&&h.then){if(!("$$v"in h))j=h,j.$$v=s,j.then(function(a){j.$$v=a});h=h.$$v}if(!e||h===null||h===s)return h;if((h=h[e])&&h.then){if(!("$$v"in
-h))j=h,j.$$v=s,j.then(function(a){j.$$v=a});h=h.$$v}return h}}function Nb(b,a){if(nb.hasOwnProperty(b))return nb[b];var c=b.split("."),d=c.length,e;if(a)e=d<6?Pb(c[0],c[1],c[2],c[3],c[4]):function(a,b){var e=0,g;do g=Pb(c[e++],c[e++],c[e++],c[e++],c[e++])(a,b),b=s,a=g;while(e<d);return g};else{var f="var l, fn, p;\n";o(c,function(a,b){f+="if(s === null || s === undefined) return s;\nl=s;\ns="+(b?"s":'((k&&k.hasOwnProperty("'+a+'"))?k:s)')+'["'+a+'"];\nif (s && s.then) {\n if (!("$$v" in s)) {\n p=s;\n p.$$v = undefined;\n p.then(function(v) {p.$$v=v;});\n}\n s=s.$$v\n}\n'});
-f+="return s;";e=Function("s","k",f);e.toString=function(){return f}}return nb[b]=e}function Pc(){var b={};this.$get=["$filter","$sniffer",function(a,c){return function(d){switch(typeof d){case "string":return b.hasOwnProperty(d)?b[d]:b[d]=Oc(d,!1,a,c.csp);case "function":return d;default:return t}}}]}function Qc(){this.$get=["$rootScope","$exceptionHandler",function(b,a){return Rc(function(a){b.$evalAsync(a)},a)}]}function Rc(b,a){function c(a){return a}function d(a){return i(a)}var e=function(){var h=
-[],j,g;return g={resolve:function(a){if(h){var c=h;h=s;j=f(a);c.length&&b(function(){for(var a,b=0,d=c.length;b<d;b++)a=c[b],j.then(a[0],a[1])})}},reject:function(a){g.resolve(i(a))},promise:{then:function(b,g){var f=e(),i=function(d){try{f.resolve((b||c)(d))}catch(e){a(e),f.reject(e)}},n=function(b){try{f.resolve((g||d)(b))}catch(c){a(c),f.reject(c)}};h?h.push([i,n]):j.then(i,n);return f.promise}}}},f=function(a){return a&&a.then?a:{then:function(c){var d=e();b(function(){d.resolve(c(a))});return d.promise}}},
-i=function(a){return{then:function(c,g){var f=e();b(function(){f.resolve((g||d)(a))});return f.promise}}};return{defer:e,reject:i,when:function(h,j,g){var m=e(),k,l=function(b){try{return(j||c)(b)}catch(d){return a(d),i(d)}},q=function(b){try{return(g||d)(b)}catch(c){return a(c),i(c)}};b(function(){f(h).then(function(a){k||(k=!0,m.resolve(f(a).then(l,q)))},function(a){k||(k=!0,m.resolve(q(a)))})});return m.promise},all:function(a){var b=e(),c=0,d=C(a)?[]:{};o(a,function(a,e){c++;f(a).then(function(a){d.hasOwnProperty(e)||
-(d[e]=a,--c||b.resolve(d))},function(a){d.hasOwnProperty(e)||b.reject(a)})});c===0&&b.resolve(d);return b.promise}}}function Sc(){var b={};this.when=function(a,c){b[a]=y({reloadOnSearch:!0,caseInsensitiveMatch:!1},c);if(a){var d=a[a.length-1]=="/"?a.substr(0,a.length-1):a+"/";b[d]={redirectTo:a}}return this};this.otherwise=function(a){this.when(null,a);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$http","$templateCache",function(a,c,d,e,f,i,h){function j(a,b,c){for(var b=
-"^"+b.replace(/[-\/\\^$:*+?.()|[\]{}]/g,"\\$&")+"$",d="",e=[],g={},f=/\\([:*])(\w+)/g,h,j=0;(h=f.exec(b))!==null;){d+=b.slice(j,h.index);switch(h[1]){case ":":d+="([^\\/]*)";break;case "*":d+="(.*)"}e.push(h[2]);j=f.lastIndex}d+=b.substr(j);var i=a.match(RegExp(d,c.caseInsensitiveMatch?"i":""));i&&o(e,function(a,b){g[a]=i[b+1]});return i?g:null}function g(){var b=m(),g=q.current;if(b&&g&&b.$$route===g.$$route&&ja(b.pathParams,g.pathParams)&&!b.reloadOnSearch&&!l)g.params=b.params,W(g.params,d),a.$broadcast("$routeUpdate",
-g);else if(b||g)l=!1,a.$broadcast("$routeChangeStart",b,g),(q.current=b)&&b.redirectTo&&(x(b.redirectTo)?c.path(k(b.redirectTo,b.params)).search(b.params).replace():c.url(b.redirectTo(b.pathParams,c.path(),c.search())).replace()),e.when(b).then(function(){if(b){var a=y({},b.resolve),c;o(a,function(b,c){a[c]=x(b)?f.get(b):f.invoke(b)});if(w(c=b.template))I(c)&&(c=c(b.params));else if(w(c=b.templateUrl))if(I(c)&&(c=c(b.params)),w(c))b.loadedTemplateUrl=c,c=i.get(c,{cache:h}).then(function(a){return a.data});
-w(c)&&(a.$template=c);return e.all(a)}}).then(function(c){if(b==q.current){if(b)b.locals=c,W(b.params,d);a.$broadcast("$routeChangeSuccess",b,g)}},function(c){b==q.current&&a.$broadcast("$routeChangeError",b,g,c)})}function m(){var a,d;o(b,function(b,e){if(!d&&(a=j(c.path(),e,b)))d=Fa(b,{params:y({},c.search(),a),pathParams:a}),d.$$route=b});return d||b[null]&&Fa(b[null],{params:{},pathParams:{}})}function k(a,b){var c=[];o((a||"").split(":"),function(a,d){if(d==0)c.push(a);else{var e=a.match(/(\w+)(.*)/),
-g=e[1];c.push(b[g]);c.push(e[2]||"");delete b[g]}});return c.join("")}var l=!1,q={routes:b,reload:function(){l=!0;a.$evalAsync(g)}};a.$on("$locationChangeSuccess",g);return q}]}function Tc(){this.$get=Q({})}function Uc(){var b=10;this.digestTtl=function(a){arguments.length&&(b=a);return b};this.$get=["$injector","$exceptionHandler","$parse",function(a,c,d){function e(){this.$id=Ea();this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;
-this["this"]=this.$root=this;this.$$destroyed=!1;this.$$asyncQueue=[];this.$$listeners={};this.$$isolateBindings={}}function f(a){if(j.$$phase)throw Error(j.$$phase+" already in progress");j.$$phase=a}function i(a,b){var c=d(a);va(c,b);return c}function h(){}e.prototype={$new:function(a){if(I(a))throw Error("API-CHANGE: Use $controller to instantiate controllers.");a?(a=new e,a.$root=this.$root):(a=function(){},a.prototype=this,a=new a,a.$id=Ea());a["this"]=a;a.$$listeners={};a.$parent=this;a.$$watchers=
-a.$$nextSibling=a.$$childHead=a.$$childTail=null;a.$$prevSibling=this.$$childTail;this.$$childHead?this.$$childTail=this.$$childTail.$$nextSibling=a:this.$$childHead=this.$$childTail=a;return a},$watch:function(a,b,c){var d=i(a,"watch"),e=this.$$watchers,f={fn:b,last:h,get:d,exp:a,eq:!!c};if(!I(b)){var j=i(b||t,"listener");f.fn=function(a,b,c){j(c)}}if(typeof a=="string"&&d.constant){var r=f.fn;f.fn=function(a,b,c){r.call(this,a,b,c);sa(e,f)}}if(!e)e=this.$$watchers=[];e.unshift(f);return function(){sa(e,
-f)}},$watchCollection:function(a,b){var c=this,e,f,h=0,j=d(a),i=[],p={},o=0;return this.$watch(function(){f=j(c);var a,b;if(L(f))if(C(f)){if(e!==i)e=i,o=e.length=0,h++;a=f.length;if(o!==a)h++,e.length=o=a;for(b=0;b<a;b++)e[b]!==f[b]&&(h++,e[b]=f[b])}else{e!==p&&(e=p={},o=0,h++);a=0;for(b in f)f.hasOwnProperty(b)&&(a++,e.hasOwnProperty(b)?e[b]!==f[b]&&(h++,e[b]=f[b]):(o++,e[b]=f[b],h++));if(o>a)for(b in h++,e)e.hasOwnProperty(b)&&!f.hasOwnProperty(b)&&(o--,delete e[b])}else e!==f&&(e=f,h++);return h},
-function(){b(f,e,c)})},$digest:function(){var a,d,e,i,q=this.$$asyncQueue,n,o,r=b,p,E=[],D,G;f("$digest");do{o=!1;for(p=this;q.length;)try{p.$eval(q.shift())}catch(s){c(s)}do{if(i=p.$$watchers)for(n=i.length;n--;)try{if(a=i[n],(d=a.get(p))!==(e=a.last)&&!(a.eq?ja(d,e):typeof d=="number"&&typeof e=="number"&&isNaN(d)&&isNaN(e)))o=!0,a.last=a.eq?W(d):d,a.fn(d,e===h?d:e,p),r<5&&(D=4-r,E[D]||(E[D]=[]),G=I(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):a.exp,G+="; newVal: "+da(d)+"; oldVal: "+da(e),E[D].push(G))}catch(A){c(A)}if(!(i=
-p.$$childHead||p!==this&&p.$$nextSibling))for(;p!==this&&!(i=p.$$nextSibling);)p=p.$parent}while(p=i);if(o&&!r--)throw j.$$phase=null,Error(b+" $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: "+da(E));}while(o||q.length);j.$$phase=null},$destroy:function(){if(!(j==this||this.$$destroyed)){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;if(a.$$childHead==this)a.$$childHead=this.$$nextSibling;if(a.$$childTail==this)a.$$childTail=this.$$prevSibling;
-if(this.$$prevSibling)this.$$prevSibling.$$nextSibling=this.$$nextSibling;if(this.$$nextSibling)this.$$nextSibling.$$prevSibling=this.$$prevSibling;this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null}},$eval:function(a,b){return d(a)(this,b)},$evalAsync:function(a){this.$$asyncQueue.push(a)},$apply:function(a){try{return f("$apply"),this.$eval(a)}catch(b){c(b)}finally{j.$$phase=null;try{j.$digest()}catch(d){throw c(d),d;}}},$on:function(a,b){var c=this.$$listeners[a];
-c||(this.$$listeners[a]=c=[]);c.push(b);return function(){c[Ga(c,b)]=null}},$emit:function(a,b){var d=[],e,f=this,h=!1,i={name:a,targetScope:f,stopPropagation:function(){h=!0},preventDefault:function(){i.defaultPrevented=!0},defaultPrevented:!1},j=[i].concat(ka.call(arguments,1)),p,o;do{e=f.$$listeners[a]||d;i.currentScope=f;p=0;for(o=e.length;p<o;p++)if(e[p])try{if(e[p].apply(null,j),h)return i}catch(D){c(D)}else e.splice(p,1),p--,o--;f=f.$parent}while(f);return i},$broadcast:function(a,b){var d=
-this,e=this,f={name:a,targetScope:this,preventDefault:function(){f.defaultPrevented=!0},defaultPrevented:!1},h=[f].concat(ka.call(arguments,1)),i,j;do{d=e;f.currentScope=d;e=d.$$listeners[a]||[];i=0;for(j=e.length;i<j;i++)if(e[i])try{e[i].apply(null,h)}catch(p){c(p)}else e.splice(i,1),i--,j--;if(!(e=d.$$childHead||d!==this&&d.$$nextSibling))for(;d!==this&&!(e=d.$$nextSibling);)d=d.$parent}while(d=e);return f}};var j=new e;return j}]}function Vc(){this.$get=["$window","$document",function(b,a){var c=
-{},d=K((/android (\d+)/.exec(J((b.navigator||{}).userAgent))||[])[1]),e=a[0]||{},f,i=/^(Moz|webkit|O|ms)(?=[A-Z])/,h=e.body&&e.body.style,j=!1;if(h){for(var g in h)if(j=i.exec(g)){f=j[0];f=f.substr(0,1).toUpperCase()+f.substr(1);break}j=!!(f+"Transition"in h)}return{history:!(!b.history||!b.history.pushState||d<4),hashchange:"onhashchange"in b&&(!e.documentMode||e.documentMode>7),hasEvent:function(a){if(a=="input"&&X==9)return!1;if(u(c[a])){var b=e.createElement("div");c[a]="on"+a in b}return c[a]},
-csp:e.securityPolicy?e.securityPolicy.isActive:!1,vendorPrefix:f,supportsTransitions:j}}]}function Wc(){this.$get=Q(M)}function Qb(b){var a={},c,d,e;if(!b)return a;o(b.split("\n"),function(b){e=b.indexOf(":");c=J(S(b.substr(0,e)));d=S(b.substr(e+1));c&&(a[c]?a[c]+=", "+d:a[c]=d)});return a}function Xc(b,a){var c=Yc.exec(b);if(c==null)return!0;var d={protocol:c[2],host:c[4],port:K(c[6])||Ba[c[2]]||null,relativeProtocol:c[2]===s||c[2]===""},c=lb.exec(a),c={protocol:c[1],host:c[3],port:K(c[5])||Ba[c[1]]||
-null};return(d.protocol==c.protocol||d.relativeProtocol)&&d.host==c.host&&(d.port==c.port||d.relativeProtocol&&c.port==Ba[c.protocol])}function Rb(b){var a=L(b)?b:s;return function(c){a||(a=Qb(b));return c?a[J(c)]||null:a}}function Sb(b,a,c){if(I(c))return c(b,a);o(c,function(c){b=c(b,a)});return b}function Zc(){var b=/^\s*(\[|\{[^\{])/,a=/[\}\]]\s*$/,c=/^\)\]\}',?\n/,d=this.defaults={transformResponse:[function(d){x(d)&&(d=d.replace(c,""),b.test(d)&&a.test(d)&&(d=tb(d,!0)));return d}],transformRequest:[function(a){return L(a)&&
-Da.apply(a)!=="[object File]"?da(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:{"Content-Type":"application/json;charset=utf-8"},put:{"Content-Type":"application/json;charset=utf-8"}},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"},e=this.interceptors=[],f=this.responseInterceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(a,b,c,g,m,k){function l(a){function c(a){var b=y({},a,{data:Sb(a.data,a.headers,e.transformResponse)});
-return 200<=a.status&&a.status<300?b:m.reject(b)}var e={transformRequest:d.transformRequest,transformResponse:d.transformResponse},g={};y(e,a);e.headers=g;e.method=na(e.method);y(g,d.headers.common,d.headers[J(e.method)],a.headers);(a=Xc(e.url,b.url())?b.cookies()[e.xsrfCookieName||d.xsrfCookieName]:s)&&(g[e.xsrfHeaderName||d.xsrfHeaderName]=a);var f=[function(a){var b=Sb(a.data,Rb(g),a.transformRequest);u(a.data)&&delete g["Content-Type"];if(u(a.withCredentials)&&!u(d.withCredentials))a.withCredentials=
-d.withCredentials;return q(a,b,g).then(c,c)},s],j=m.when(e);for(o(r,function(a){(a.request||a.requestError)&&f.unshift(a.request,a.requestError);(a.response||a.responseError)&&f.push(a.response,a.responseError)});f.length;)var a=f.shift(),i=f.shift(),j=j.then(a,i);j.success=function(a){j.then(function(b){a(b.data,b.status,b.headers,e)});return j};j.error=function(a){j.then(null,function(b){a(b.data,b.status,b.headers,e)});return j};return j}function q(b,c,e){function f(a,b,c){o&&(200<=a&&a<300?o.put(s,
-[a,b,Qb(c)]):o.remove(s));h(b,a,c);g.$apply()}function h(a,c,d){c=Math.max(c,0);(200<=c&&c<300?k.resolve:k.reject)({data:a,status:c,headers:Rb(d),config:b})}function j(){var a=Ga(l.pendingRequests,b);a!==-1&&l.pendingRequests.splice(a,1)}var k=m.defer(),q=k.promise,o,r,s=n(b.url,b.params);l.pendingRequests.push(b);q.then(j,j);if((b.cache||d.cache)&&b.cache!==!1&&b.method=="GET")o=L(b.cache)?b.cache:L(d.cache)?d.cache:B;if(o)if(r=o.get(s))if(r.then)return r.then(j,j),r;else C(r)?h(r[1],r[0],W(r[2])):
-h(r,200,{});else o.put(s,q);r||a(b.method,s,c,f,e,b.timeout,b.withCredentials,b.responseType);return q}function n(a,b){if(!b)return a;var c=[];ic(b,function(a,b){a==null||a==s||(C(a)||(a=[a]),o(a,function(a){L(a)&&(a=da(a));c.push(ua(b)+"="+ua(a))}))});return a+(a.indexOf("?")==-1?"?":"&")+c.join("&")}var B=c("$http"),r=[];o(e,function(a){r.unshift(x(a)?k.get(a):k.invoke(a))});o(f,function(a,b){var c=x(a)?k.get(a):k.invoke(a);r.splice(b,0,{response:function(a){return c(m.when(a))},responseError:function(a){return c(m.reject(a))}})});
-l.pendingRequests=[];(function(a){o(arguments,function(a){l[a]=function(b,c){return l(y(c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){o(arguments,function(a){l[a]=function(b,c,d){return l(y(d||{},{method:a,url:b,data:c}))}})})("post","put");l.defaults=d;return l}]}function $c(){this.$get=["$browser","$window","$document",function(b,a,c){return ad(b,bd,b.defer,a.angular.callbacks,c[0],a.location.protocol.replace(":",""))}]}function ad(b,a,c,d,e,f){function i(a,b){var c=
-e.createElement("script"),d=function(){e.body.removeChild(c);b&&b()};c.type="text/javascript";c.src=a;X?c.onreadystatechange=function(){/loaded|complete/.test(c.readyState)&&d()}:c.onload=c.onerror=d;e.body.appendChild(c)}return function(e,j,g,m,k,l,q,n){function B(a,c,d,e){c=(j.match(lb)||["",f])[1]=="file"?d?200:404:c;a(c==1223?204:c,d,e);b.$$completeOutstandingRequest(t)}b.$$incOutstandingRequestCount();j=j||b.url();if(J(e)=="jsonp"){var r="_"+(d.counter++).toString(36);d[r]=function(a){d[r].data=
-a};i(j.replace("JSON_CALLBACK","angular.callbacks."+r),function(){d[r].data?B(m,200,d[r].data):B(m,-2);delete d[r]})}else{var p=new a;p.open(e,j,!0);o(k,function(a,b){a&&p.setRequestHeader(b,a)});var s;p.onreadystatechange=function(){if(p.readyState==4){var a=p.getAllResponseHeaders(),b=["Cache-Control","Content-Language","Content-Type","Expires","Last-Modified","Pragma"];a||(a="",o(b,function(b){var c=p.getResponseHeader(b);c&&(a+=b+": "+c+"\n")}));B(m,s||p.status,p.responseType?p.response:p.responseText,
-a)}};if(q)p.withCredentials=!0;if(n)p.responseType=n;p.send(g||"");l>0&&c(function(){s=-1;p.abort()},l)}}}function cd(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4",posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),
-SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(b){return b===1?"one":"other"}}}}function dd(){this.$get=["$rootScope","$browser","$q",
-"$exceptionHandler",function(b,a,c,d){function e(e,h,j){var g=c.defer(),m=g.promise,k=w(j)&&!j,h=a.defer(function(){try{g.resolve(e())}catch(a){g.reject(a),d(a)}k||b.$apply()},h),j=function(){delete f[m.$$timeoutId]};m.$$timeoutId=h;f[h]=g;m.then(j,j);return m}var f={};e.cancel=function(b){return b&&b.$$timeoutId in f?(f[b.$$timeoutId].reject("canceled"),a.defer.cancel(b.$$timeoutId)):!1};return e}]}function Tb(b){function a(a,e){return b.factory(a+c,e)}var c="Filter";this.register=a;this.$get=["$injector",
-function(a){return function(b){return a.get(b+c)}}];a("currency",Ub);a("date",Vb);a("filter",ed);a("json",fd);a("limitTo",gd);a("lowercase",hd);a("number",Wb);a("orderBy",Xb);a("uppercase",id)}function ed(){return function(b,a,c){if(!C(b))return b;var d=[];d.check=function(a){for(var b=0;b<d.length;b++)if(!d[b](a))return!1;return!0};switch(typeof c){case "function":break;case "boolean":if(c==!0){c=function(a,b){return Ia.equals(a,b)};break}default:c=function(a,b){b=(""+b).toLowerCase();return(""+
-a).toLowerCase().indexOf(b)>-1}}var e=function(a,b){if(typeof b=="string"&&b.charAt(0)==="!")return!e(a,b.substr(1));switch(typeof a){case "boolean":case "number":case "string":return c(a,b);case "object":switch(typeof b){case "object":return c(a,b);default:for(var d in a)if(d.charAt(0)!=="$"&&e(a[d],b))return!0}return!1;case "array":for(d=0;d<a.length;d++)if(e(a[d],b))return!0;return!1;default:return!1}};switch(typeof a){case "boolean":case "number":case "string":a={$:a};case "object":for(var f in a)f==
-"$"?function(){if(a[f]){var b=f;d.push(function(c){return e(c,a[b])})}}():function(){if(a[f]){var b=f;d.push(function(c){return e(kb(c,b),a[b])})}}();break;case "function":d.push(a);break;default:return b}for(var i=[],h=0;h<b.length;h++){var j=b[h];d.check(j)&&i.push(j)}return i}}function Ub(b){var a=b.NUMBER_FORMATS;return function(b,d){if(u(d))d=a.CURRENCY_SYM;return Yb(b,a.PATTERNS[1],a.GROUP_SEP,a.DECIMAL_SEP,2).replace(/\u00A4/g,d)}}function Wb(b){var a=b.NUMBER_FORMATS;return function(b,d){return Yb(b,
-a.PATTERNS[0],a.GROUP_SEP,a.DECIMAL_SEP,d)}}function Yb(b,a,c,d,e){if(isNaN(b)||!isFinite(b))return"";var f=b<0,b=Math.abs(b),i=b+"",h="",j=[],g=!1;if(i.indexOf("e")!==-1){var m=i.match(/([\d\.]+)e(-?)(\d+)/);m&&m[2]=="-"&&m[3]>e+1?i="0":(h=i,g=!0)}if(!g){i=(i.split(Zb)[1]||"").length;u(e)&&(e=Math.min(Math.max(a.minFrac,i),a.maxFrac));var i=Math.pow(10,e),b=Math.round(b*i)/i,b=(""+b).split(Zb),i=b[0],b=b[1]||"",g=0,m=a.lgSize,k=a.gSize;if(i.length>=m+k)for(var g=i.length-m,l=0;l<g;l++)(g-l)%k===
-0&&l!==0&&(h+=c),h+=i.charAt(l);for(l=g;l<i.length;l++)(i.length-l)%m===0&&l!==0&&(h+=c),h+=i.charAt(l);for(;b.length<e;)b+="0";e&&e!=="0"&&(h+=d+b.substr(0,e))}j.push(f?a.negPre:a.posPre);j.push(h);j.push(f?a.negSuf:a.posSuf);return j.join("")}function ob(b,a,c){var d="";b<0&&(d="-",b=-b);for(b=""+b;b.length<a;)b="0"+b;c&&(b=b.substr(b.length-a));return d+b}function O(b,a,c,d){return function(e){e=e["get"+b]();if(c>0||e>-c)e+=c;e===0&&c==-12&&(e=12);return ob(e,a,d)}}function Sa(b,a){return function(c,
-d){var e=c["get"+b](),f=na(a?"SHORT"+b:b);return d[f][e]}}function Vb(b){function a(a){var b;if(b=a.match(c)){var a=new Date(0),f=0,i=0,h=b[8]?a.setUTCFullYear:a.setFullYear,j=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=K(b[9]+b[10]),i=K(b[9]+b[11]));h.call(a,K(b[1]),K(b[2])-1,K(b[3]));j.call(a,K(b[4]||0)-f,K(b[5]||0)-i,K(b[6]||0),K(b[7]||0))}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e){var f="",i=[],h,j,e=e||
-"mediumDate",e=b.DATETIME_FORMATS[e]||e;x(c)&&(c=jd.test(c)?K(c):a(c));Za(c)&&(c=new Date(c));if(!qa(c))return c;for(;e;)(j=kd.exec(e))?(i=i.concat(ka.call(j,1)),e=i.pop()):(i.push(e),e=null);o(i,function(a){h=ld[a];f+=h?h(c,b.DATETIME_FORMATS):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return f}}function fd(){return function(b){return da(b,!0)}}function gd(){return function(b,a){if(!C(b)&&!x(b))return b;a=K(a);if(x(b))return a?a>=0?b.slice(0,a):b.slice(a,b.length):"";var c=[],d,e;a>b.length?a=
-b.length:a<-b.length&&(a=-b.length);a>0?(d=0,e=a):(d=b.length+a,e=b.length);for(;d<e;d++)c.push(b[d]);return c}}function Xb(b){return function(a,c,d){function e(a,b){return Ha(b)?function(b,c){return a(c,b)}:a}if(!C(a))return a;if(!c)return a;for(var c=C(c)?c:[c],c=$a(c,function(a){var c=!1,d=a||pa;if(x(a)){if(a.charAt(0)=="+"||a.charAt(0)=="-")c=a.charAt(0)=="-",a=a.substring(1);d=b(a)}return e(function(a,b){var c;c=d(a);var e=d(b),f=typeof c,h=typeof e;f==h?(f=="string"&&(c=c.toLowerCase()),f==
-"string"&&(e=e.toLowerCase()),c=c===e?0:c<e?-1:1):c=f<h?-1:1;return c},c)}),f=[],i=0;i<a.length;i++)f.push(a[i]);return f.sort(e(function(a,b){for(var d=0;d<c.length;d++){var e=c[d](a,b);if(e!==0)return e}return 0},d))}}function Y(b){I(b)&&(b={link:b});b.restrict=b.restrict||"AC";return Q(b)}function $b(b,a){function c(a,c){c=c?"-"+db(c,"-"):"";b.removeClass((a?Ta:Ua)+c).addClass((a?Ua:Ta)+c)}var d=this,e=b.parent().controller("form")||Va,f=0,i=d.$error={},h=[];d.$name=a.name;d.$dirty=!1;d.$pristine=
-!0;d.$valid=!0;d.$invalid=!1;e.$addControl(d);b.addClass(oa);c(!0);d.$addControl=function(a){h.push(a);a.$name&&!d.hasOwnProperty(a.$name)&&(d[a.$name]=a)};d.$removeControl=function(a){a.$name&&d[a.$name]===a&&delete d[a.$name];o(i,function(b,c){d.$setValidity(c,!0,a)});sa(h,a)};d.$setValidity=function(a,b,h){var k=i[a];if(b){if(k&&(sa(k,h),!k.length)){f--;if(!f)c(b),d.$valid=!0,d.$invalid=!1;i[a]=!1;c(!0,a);e.$setValidity(a,!0,d)}}else{f||c(b);if(k){if(Ga(k,h)!=-1)return}else i[a]=k=[],f++,c(!1,
-a),e.$setValidity(a,!1,d);k.push(h);d.$valid=!1;d.$invalid=!0}};d.$setDirty=function(){b.removeClass(oa).addClass(Wa);d.$dirty=!0;d.$pristine=!1;e.$setDirty()};d.$setPristine=function(){b.removeClass(Wa).addClass(oa);d.$dirty=!1;d.$pristine=!0;o(h,function(a){a.$setPristine()})}}function U(b){return u(b)||b===""||b===null||b!==b}function Xa(b,a,c,d,e,f){var i=function(){var e=a.val();if(Ha(c.ngTrim||"T"))e=S(e);d.$viewValue!==e&&b.$apply(function(){d.$setViewValue(e)})};if(e.hasEvent("input"))a.bind("input",
-i);else{var h;a.bind("keydown",function(a){a=a.keyCode;a===91||15<a&&a<19||37<=a&&a<=40||h||(h=f.defer(function(){i();h=null}))});a.bind("change",i)}d.$render=function(){a.val(U(d.$viewValue)?"":d.$viewValue)};var j=c.ngPattern,g=function(a,b){return U(b)||a.test(b)?(d.$setValidity("pattern",!0),b):(d.$setValidity("pattern",!1),s)};j&&(j.match(/^\/(.*)\/$/)?(j=RegExp(j.substr(1,j.length-2)),e=function(a){return g(j,a)}):e=function(a){var c=b.$eval(j);if(!c||!c.test)throw Error("Expected "+j+" to be a RegExp but was "+
-c);return g(c,a)},d.$formatters.push(e),d.$parsers.push(e));if(c.ngMinlength){var m=K(c.ngMinlength),e=function(a){return!U(a)&&a.length<m?(d.$setValidity("minlength",!1),s):(d.$setValidity("minlength",!0),a)};d.$parsers.push(e);d.$formatters.push(e)}if(c.ngMaxlength){var k=K(c.ngMaxlength),e=function(a){return!U(a)&&a.length>k?(d.$setValidity("maxlength",!1),s):(d.$setValidity("maxlength",!0),a)};d.$parsers.push(e);d.$formatters.push(e)}}function pb(b,a){b="ngClass"+b;return Y(function(c,d,e){function f(b){if(a===
-!0||c.$index%2===a)j&&b!==j&&i(j),h(b);j=b}function i(a){L(a)&&!C(a)&&(a=$a(a,function(a,b){if(a)return b}));d.removeClass(C(a)?a.join(" "):a)}function h(a){L(a)&&!C(a)&&(a=$a(a,function(a,b){if(a)return b}));a&&d.addClass(C(a)?a.join(" "):a)}var j=s;c.$watch(e[b],f,!0);e.$observe("class",function(){var a=c.$eval(e[b]);f(a,a)});b!=="ngClass"&&c.$watch("$index",function(d,f){var j=d%2;j!==f%2&&(j==a?h(c.$eval(e[b])):i(c.$eval(e[b])))})})}var J=function(b){return x(b)?b.toLowerCase():b},na=function(b){return x(b)?
-b.toUpperCase():b},X=K((/msie (\d+)/.exec(J(navigator.userAgent))||[])[1]),v,ca,ka=[].slice,Ya=[].push,Da=Object.prototype.toString,hc=M.angular,Ia=M.angular||(M.angular={}),xa,jb,Z=["0","0","0"];t.$inject=[];pa.$inject=[];jb=X<9?function(b){b=b.nodeName?b:b[0];return b.scopeName&&b.scopeName!="HTML"?na(b.scopeName+":"+b.nodeName):b.nodeName}:function(b){return b.nodeName?b.nodeName:b[0].nodeName};var nc=/[A-Z]/g,md={full:"1.1.4",major:1,minor:1,dot:4,codeName:"quantum-manipulation"},La=P.cache={},
-Ka=P.expando="ng-"+(new Date).getTime(),rc=1,ac=M.document.addEventListener?function(b,a,c){b.addEventListener(a,c,!1)}:function(b,a,c){b.attachEvent("on"+a,c)},ib=M.document.removeEventListener?function(b,a,c){b.removeEventListener(a,c,!1)}:function(b,a,c){b.detachEvent("on"+a,c)},pc=/([\:\-\_]+(.))/g,qc=/^moz([A-Z])/,za=P.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;V.readyState==="complete"?setTimeout(a):(this.bind("DOMContentLoaded",a),P(M).bind("load",a))},toString:function(){var b=
-[];o(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return b>=0?v(this[b]):v(this[this.length+b])},length:0,push:Ya,sort:[].sort,splice:[].splice},Oa={};o("multiple,selected,checked,disabled,readOnly,required,open".split(","),function(b){Oa[J(b)]=b});var Eb={};o("input,select,option,textarea,button,form,details".split(","),function(b){Eb[na(b)]=!0});o({data:zb,inheritedData:Na,scope:function(b){return Na(b,"$scope")},controller:Cb,injector:function(b){return Na(b,"$injector")},
-removeAttr:function(b,a){b.removeAttribute(a)},hasClass:Ma,css:function(b,a,c){a=Ja(a);if(w(c))b.style[a]=c;else{var d;X<=8&&(d=b.currentStyle&&b.currentStyle[a],d===""&&(d="auto"));d=d||b.style[a];X<=8&&(d=d===""?s:d);return d}},attr:function(b,a,c){var d=J(a);if(Oa[d])if(w(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||t).specified?d:s;else if(w(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),b===null?
-s:b},prop:function(b,a,c){if(w(c))b[a]=c;else return b[a]},text:y(X<9?function(b,a){if(b.nodeType==1){if(u(a))return b.innerText;b.innerText=a}else{if(u(a))return b.nodeValue;b.nodeValue=a}}:function(b,a){if(u(a))return b.textContent;b.textContent=a},{$dv:""}),val:function(b,a){if(u(a))return b.value;b.value=a},html:function(b,a){if(u(a))return b.innerHTML;for(var c=0,d=b.childNodes;c<d.length;c++)wa(d[c]);b.innerHTML=a}},function(b,a){P.prototype[a]=function(a,d){var e,f;if((b.length==2&&b!==Ma&&
-b!==Cb?a:d)===s)if(L(a)){for(e=0;e<this.length;e++)if(b===zb)b(this[e],a);else for(f in a)b(this[e],f,a[f]);return this}else{if(this.length)return b(this[0],a,d)}else{for(e=0;e<this.length;e++)b(this[e],a,d);return this}return b.$dv}});o({removeData:xb,dealoc:wa,bind:function a(c,d,e){var f=$(c,"events"),i=$(c,"handle");f||$(c,"events",f={});i||$(c,"handle",i=sc(c,f));o(d.split(" "),function(d){var j=f[d];if(!j){if(d=="mouseenter"||d=="mouseleave"){var g=0;f.mouseenter=[];f.mouseleave=[];a(c,"mouseover",
-function(a){g++;g==1&&i(a,"mouseenter")});a(c,"mouseout",function(a){g--;g==0&&i(a,"mouseleave")})}else ac(c,d,i),f[d]=[];j=f[d]}j.push(e)})},unbind:yb,replaceWith:function(a,c){var d,e=a.parentNode;wa(a);o(new P(c),function(c){d?e.insertBefore(c,d.nextSibling):e.replaceChild(c,a);d=c})},children:function(a){var c=[];o(a.childNodes,function(a){a.nodeType===1&&c.push(a)});return c},contents:function(a){return a.childNodes||[]},append:function(a,c){o(new P(c),function(c){(a.nodeType===1||a.nodeType===
-11)&&a.appendChild(c)})},prepend:function(a,c){if(a.nodeType===1){var d=a.firstChild;o(new P(c),function(c){d?a.insertBefore(c,d):(a.appendChild(c),d=c)})}},wrap:function(a,c){var c=v(c)[0],d=a.parentNode;d&&d.replaceChild(c,a);c.appendChild(a)},remove:function(a){wa(a);var c=a.parentNode;c&&c.removeChild(a)},after:function(a,c){var d=a,e=a.parentNode;o(new P(c),function(a){e.insertBefore(a,d.nextSibling);d=a})},addClass:Bb,removeClass:Ab,toggleClass:function(a,c,d){u(d)&&(d=!Ma(a,c));(d?Bb:Ab)(a,
-c)},parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},next:function(a){if(a.nextElementSibling)return a.nextElementSibling;for(a=a.nextSibling;a!=null&&a.nodeType!==1;)a=a.nextSibling;return a},find:function(a,c){return a.getElementsByTagName(c)},clone:hb,triggerHandler:function(a,c){var d=($(a,"events")||{})[c];o(d,function(c){c.call(a,null)})}},function(a,c){P.prototype[c]=function(c,e){for(var f,i=0;i<this.length;i++)f==s?(f=a(this[i],c,e),f!==s&&(f=v(f))):gb(f,a(this[i],c,e));
-return f==s?this:f}});Pa.prototype={put:function(a,c){this[la(a)]=c},get:function(a){return this[la(a)]},remove:function(a){var c=this[a=la(a)];delete this[a];return c}};var uc=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,vc=/,/,wc=/^\s*(_?)(\S+?)\1\s*$/,tc=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;Gb.$inject=["$provide"];var nd=function(){this.$get=["$animation","$window","$sniffer",function(a,c,d){function e(a){a.css("display","")}function f(a){a.css("display","none")}function i(a,c,d){d?d.after(a):c.append(a)}
-function h(a){a.remove()}function j(a,c,d){i(a,c,d)}return function(g,m){function k(e,f,h){var i=l&&g.$eval(l),e=l?L(i)?i[e]:i+"-"+e:"",j=(i=a(e))&&i.setup,k=i&&i.start;if(e){var m=e+"-setup",q=e+"-start";return function(a,e,g){function i(){h(a,e,g);a.removeClass(m);a.removeClass(q)}if(!d.supportsTransitions&&!j&&!k)f(a,e,g),h(a,e,g);else{a.addClass(m);f(a,e,g);if(a.length==0)return i();var l=(j||t)(a);c.setTimeout(function(){a.addClass(q);if(k)k(a,i,l);else if(I(c.getComputedStyle)){var e=d.vendorPrefix+
-"Transition",f=0;o(a,function(a){a=c.getComputedStyle(a)||{};f=Math.max(parseFloat(a.transitionDuration)||parseFloat(a[e+"Duration"])||0,f)});c.setTimeout(i,f*1E3)}else i()},1)}}}else return function(a,c,d){f(a,c,d);h(a,c,d)}}var l=m.ngAnimate,q={};q.enter=k("enter",i,t);q.leave=k("leave",t,h);q.move=k("move",j,t);q.show=k("show",e,t);q.hide=k("hide",t,f);return q}}]},Ib="Non-assignable model expression: ";Hb.$inject=["$provide"];var Cc=/^(x[\:\-_]|data[\:\-_])/i,lb=/^([^:]+):\/\/(\w+:{0,1}\w*@)?(\{?[\w\.-]*\}?)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?$/,
-bc=/^([^\?#]*)?(\?([^#]*))?(#(.*))?$/,Jc=bc,Ba={http:80,https:443,ftp:21};mb.prototype={$$replace:!1,absUrl:Ra("$$absUrl"),url:function(a,c){if(u(a))return this.$$url;var d=bc.exec(a);d[1]&&this.path(decodeURIComponent(d[1]));if(d[2]||d[1])this.search(d[3]||"");this.hash(d[5]||"",c);return this},protocol:Ra("$$protocol"),host:Ra("$$host"),port:Ra("$$port"),path:Mb("$$path",function(a){return a.charAt(0)=="/"?a:"/"+a}),search:function(a,c){if(u(a))return this.$$search;w(c)?c===null?delete this.$$search[a]:
-this.$$search[a]=c:this.$$search=x(a)?bb(a):a;this.$$compose();return this},hash:Mb("$$hash",pa),replace:function(){this.$$replace=!0;return this}};Qa.prototype=Fa(mb.prototype);Lb.prototype=Fa(Qa.prototype);var Ca={"null":function(){return null},"true":function(){return!0},"false":function(){return!1},undefined:t,"+":function(a,c,d,e){d=d(a,c);e=e(a,c);return w(d)?w(e)?d+e:d:w(e)?e:s},"-":function(a,c,d,e){d=d(a,c);e=e(a,c);return(w(d)?d:0)-(w(e)?e:0)},"*":function(a,c,d,e){return d(a,c)*e(a,c)},
-"/":function(a,c,d,e){return d(a,c)/e(a,c)},"%":function(a,c,d,e){return d(a,c)%e(a,c)},"^":function(a,c,d,e){return d(a,c)^e(a,c)},"=":t,"===":function(a,c,d,e){return d(a,c)===e(a,c)},"!==":function(a,c,d,e){return d(a,c)!==e(a,c)},"==":function(a,c,d,e){return d(a,c)==e(a,c)},"!=":function(a,c,d,e){return d(a,c)!=e(a,c)},"<":function(a,c,d,e){return d(a,c)<e(a,c)},">":function(a,c,d,e){return d(a,c)>e(a,c)},"<=":function(a,c,d,e){return d(a,c)<=e(a,c)},">=":function(a,c,d,e){return d(a,c)>=e(a,
-c)},"&&":function(a,c,d,e){return d(a,c)&&e(a,c)},"||":function(a,c,d,e){return d(a,c)||e(a,c)},"&":function(a,c,d,e){return d(a,c)&e(a,c)},"|":function(a,c,d,e){return e(a,c)(a,c,d(a,c))},"!":function(a,c,d){return!d(a,c)}},Nc={n:"\n",f:"\u000c",r:"\r",t:"\t",v:"\u000b","'":"'",'"':'"'},nb={},Yc=/^(([^:]+):)?\/\/(\w+:{0,1}\w*@)?([\w\.-]*)?(:([0-9]+))?(.*)$/,bd=M.XMLHttpRequest||function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(c){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(d){}throw Error("This browser does not support XMLHttpRequest.");
-};Tb.$inject=["$provide"];Ub.$inject=["$locale"];Wb.$inject=["$locale"];var Zb=".",ld={yyyy:O("FullYear",4),yy:O("FullYear",2,0,!0),y:O("FullYear",1),MMMM:Sa("Month"),MMM:Sa("Month",!0),MM:O("Month",2,1),M:O("Month",1,1),dd:O("Date",2),d:O("Date",1),HH:O("Hours",2),H:O("Hours",1),hh:O("Hours",2,-12),h:O("Hours",1,-12),mm:O("Minutes",2),m:O("Minutes",1),ss:O("Seconds",2),s:O("Seconds",1),sss:O("Milliseconds",3),EEEE:Sa("Day"),EEE:Sa("Day",!0),a:function(a,c){return a.getHours()<12?c.AMPMS[0]:c.AMPMS[1]},
-Z:function(a){var a=-1*a.getTimezoneOffset(),c=a>=0?"+":"";c+=ob(Math[a>0?"floor":"ceil"](a/60),2)+ob(Math.abs(a%60),2);return c}},kd=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,jd=/^\d+$/;Vb.$inject=["$locale"];var hd=Q(J),id=Q(na);Xb.$inject=["$parse"];var od=Q({restrict:"E",compile:function(a,c){X<=8&&(!c.href&&!c.name&&c.$set("href",""),a.append(V.createComment("IE fix")));return function(a,c){c.bind("click",function(a){c.attr("href")||a.preventDefault()})}}}),
-qb={};o(Oa,function(a,c){var d=aa("ng-"+c);qb[d]=function(){return{priority:100,compile:function(){return function(a,f,i){a.$watch(i[d],function(a){i.$set(c,!!a)})}}}}});o(["src","href"],function(a){var c=aa("ng-"+a);qb[c]=function(){return{priority:99,link:function(d,e,f){f.$observe(c,function(c){c&&(f.$set(a,c),X&&e.prop(a,f[a]))})}}}});var Va={$addControl:t,$removeControl:t,$setValidity:t,$setDirty:t,$setPristine:t};$b.$inject=["$element","$attrs","$scope"];var Ya=function(a){return["$timeout",
-function(c){var d={name:"form",restrict:"E",controller:$b,compile:function(){return{pre:function(a,d,i,h){if(!i.action){var j=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1};ac(d[0],"submit",j);d.bind("$destroy",function(){c(function(){ib(d[0],"submit",j)},0,!1)})}var g=d.parent().controller("form"),m=i.name||i.ngForm;m&&(a[m]=h);g&&d.bind("$destroy",function(){g.$removeControl(h);m&&(a[m]=s);y(h,Va)})}}}};return a?y(W(d),{restrict:"EAC"}):d}]},pd=Ya(),qd=Ya(!0),rd=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,
-sd=/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/,td=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,cc={text:Xa,number:function(a,c,d,e,f,i){Xa(a,c,d,e,f,i);e.$parsers.push(function(a){var c=U(a);return c||td.test(a)?(e.$setValidity("number",!0),a===""?null:c?a:parseFloat(a)):(e.$setValidity("number",!1),s)});e.$formatters.push(function(a){return U(a)?"":""+a});if(d.min){var h=parseFloat(d.min),a=function(a){return!U(a)&&a<h?(e.$setValidity("min",!1),s):(e.$setValidity("min",!0),a)};e.$parsers.push(a);
-e.$formatters.push(a)}if(d.max){var j=parseFloat(d.max),d=function(a){return!U(a)&&a>j?(e.$setValidity("max",!1),s):(e.$setValidity("max",!0),a)};e.$parsers.push(d);e.$formatters.push(d)}e.$formatters.push(function(a){return U(a)||Za(a)?(e.$setValidity("number",!0),a):(e.$setValidity("number",!1),s)})},url:function(a,c,d,e,f,i){Xa(a,c,d,e,f,i);a=function(a){return U(a)||rd.test(a)?(e.$setValidity("url",!0),a):(e.$setValidity("url",!1),s)};e.$formatters.push(a);e.$parsers.push(a)},email:function(a,
-c,d,e,f,i){Xa(a,c,d,e,f,i);a=function(a){return U(a)||sd.test(a)?(e.$setValidity("email",!0),a):(e.$setValidity("email",!1),s)};e.$formatters.push(a);e.$parsers.push(a)},radio:function(a,c,d,e){u(d.name)&&c.attr("name",Ea());c.bind("click",function(){c[0].checked&&a.$apply(function(){e.$setViewValue(d.value)})});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e){var f=d.ngTrueValue,i=d.ngFalseValue;x(f)||(f=!0);x(i)||(i=!1);c.bind("click",
-function(){a.$apply(function(){e.$setViewValue(c[0].checked)})});e.$render=function(){c[0].checked=e.$viewValue};e.$formatters.push(function(a){return a===f});e.$parsers.push(function(a){return a?f:i})},hidden:t,button:t,submit:t,reset:t},dc=["$browser","$sniffer",function(a,c){return{restrict:"E",require:"?ngModel",link:function(d,e,f,i){i&&(cc[J(f.type)]||cc.text)(d,e,f,i,c,a)}}}],Ua="ng-valid",Ta="ng-invalid",oa="ng-pristine",Wa="ng-dirty",ud=["$scope","$exceptionHandler","$attrs","$element","$parse",
-function(a,c,d,e,f){function i(a,c){c=c?"-"+db(c,"-"):"";e.removeClass((a?Ta:Ua)+c).addClass((a?Ua:Ta)+c)}this.$modelValue=this.$viewValue=Number.NaN;this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$name=d.name;var h=f(d.ngModel),j=h.assign;if(!j)throw Error(Ib+d.ngModel+" ("+ta(e)+")");this.$render=t;var g=e.inheritedData("$formController")||Va,m=0,k=this.$error={};e.addClass(oa);i(!0);this.$setValidity=function(a,
-c){if(k[a]!==!c){if(c){if(k[a]&&m--,!m)i(!0),this.$valid=!0,this.$invalid=!1}else i(!1),this.$invalid=!0,this.$valid=!1,m++;k[a]=!c;i(c,a);g.$setValidity(a,c,this)}};this.$setPristine=function(){this.$dirty=!1;this.$pristine=!0;e.removeClass(Wa).addClass(oa)};this.$setViewValue=function(d){this.$viewValue=d;if(this.$pristine)this.$dirty=!0,this.$pristine=!1,e.removeClass(oa).addClass(Wa),g.$setDirty();o(this.$parsers,function(a){d=a(d)});if(this.$modelValue!==d)this.$modelValue=d,j(a,d),o(this.$viewChangeListeners,
-function(a){try{a()}catch(d){c(d)}})};var l=this;a.$watch(function(){var c=h(a);if(l.$modelValue!==c){var d=l.$formatters,e=d.length;for(l.$modelValue=c;e--;)c=d[e](c);if(l.$viewValue!==c)l.$viewValue=c,l.$render()}})}],vd=function(){return{require:["ngModel","^?form"],controller:ud,link:function(a,c,d,e){var f=e[0],i=e[1]||Va;i.$addControl(f);c.bind("$destroy",function(){i.$removeControl(f)})}}},wd=Q({require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),
-ec=function(){return{require:"?ngModel",link:function(a,c,d,e){if(e){d.required=!0;var f=function(a){if(d.required&&(U(a)||a===!1))e.$setValidity("required",!1);else return e.$setValidity("required",!0),a};e.$formatters.push(f);e.$parsers.unshift(f);d.$observe("required",function(){f(e.$viewValue)})}}}},xd=function(){return{require:"ngModel",link:function(a,c,d,e){var f=(a=/\/(.*)\//.exec(d.ngList))&&RegExp(a[1])||d.ngList||",";e.$parsers.push(function(a){var c=[];a&&o(a.split(f),function(a){a&&c.push(S(a))});
-return c});e.$formatters.push(function(a){return C(a)?a.join(", "):s})}}},yd=/^(true|false|\d+)$/,zd=function(){return{priority:100,compile:function(a,c){return yd.test(c.ngValue)?function(a,c,f){f.$set("value",a.$eval(f.ngValue))}:function(a,c,f){a.$watch(f.ngValue,function(a){f.$set("value",a,!1)})}}}},Ad=Y(function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBind);a.$watch(d.ngBind,function(a){c.text(a==s?"":a)})}),Bd=["$interpolate",function(a){return function(c,d,e){c=a(d.attr(e.$attr.ngBindTemplate));
-d.addClass("ng-binding").data("$binding",c);e.$observe("ngBindTemplate",function(a){d.text(a)})}}],Cd=[function(){return function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBindHtmlUnsafe);a.$watch(d.ngBindHtmlUnsafe,function(a){c.html(a||"")})}}],Dd=pb("",!0),Ed=pb("Odd",0),Fd=pb("Even",1),Gd=Y({compile:function(a,c){c.$set("ngCloak",s);a.removeClass("ng-cloak")}}),Hd=[function(){return{scope:!0,controller:"@"}}],Id=["$sniffer",function(a){return{priority:1E3,compile:function(){a.csp=!0}}}],
-fc={};o("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress".split(" "),function(a){var c=aa("ng-"+a);fc[c]=["$parse",function(d){return function(e,f,i){var h=d(i[c]);f.bind(J(a),function(a){e.$apply(function(){h(e,{$event:a})})})}}]});var Jd=Y(function(a,c,d){c.bind("submit",function(){a.$apply(d.ngSubmit)})}),Kd=["$http","$templateCache","$anchorScroll","$compile","$animator",function(a,c,d,e,f){return{restrict:"ECA",terminal:!0,compile:function(i,
-h){var j=h.ngInclude||h.src,g=h.onload||"",m=h.autoscroll;return function(h,i,o){var n=f(h,o),s=0,r,p=function(){r&&(r.$destroy(),r=null);n.leave(i.contents(),i)};h.$watch(j,function(f){var j=++s;f?a.get(f,{cache:c}).success(function(a){j===s&&(r&&r.$destroy(),r=h.$new(),n.leave(i.contents(),i),a=v("<div/>").html(a).contents(),n.enter(a,i),e(a)(r),w(m)&&(!m||h.$eval(m))&&d(),r.$emit("$includeContentLoaded"),h.$eval(g))}).error(function(){j===s&&p()}):p()})}}}}],Ld=Y({compile:function(){return{pre:function(a,
-c,d){a.$eval(d.ngInit)}}}}),Md=Y({terminal:!0,priority:1E3}),Nd=["$locale","$interpolate",function(a,c){var d=/{}/g;return{restrict:"EA",link:function(e,f,i){var h=i.count,j=f.attr(i.$attr.when),g=i.offset||0,m=e.$eval(j),k={},l=c.startSymbol(),q=c.endSymbol();o(m,function(a,e){k[e]=c(a.replace(d,l+h+"-"+g+q))});e.$watch(function(){var c=parseFloat(e.$eval(h));return isNaN(c)?"":(m[c]||(c=a.pluralCat(c-g)),k[c](e,f,!0))},function(a){f.text(a)})}}}],Od=["$parse","$animator",function(a,c){return{transclude:"element",
-priority:1E3,terminal:!0,compile:function(d,e,f){return function(d,e,j){var g=c(d,j),m=j.ngRepeat,k=m.match(/^\s*(.+)\s+in\s+(.*?)\s*(\s+track\s+by\s+(.+)\s*)?$/),l,q,n,s,r,p={$id:la};if(!k)throw Error("Expected ngRepeat in form of '_item_ in _collection_[ track by _id_]' but got '"+m+"'.");j=k[1];n=k[2];(k=k[4])?(l=a(k),q=function(a,c,e){r&&(p[r]=a);p[s]=c;p.$index=e;return l(d,p)}):q=function(a,c){return la(c)};k=j.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!k)throw Error("'item' in 'item in collection' should be identifier or (key, value) but got '"+
-j+"'.");s=k[3]||k[1];r=k[2];var y={};d.$watchCollection(n,function(a){var c,j,k=e,l,n={},p,t,v,z,w,u,x=[];if(C(a))w=a;else{w=[];for(v in a)a.hasOwnProperty(v)&&v.charAt(0)!="$"&&w.push(v);w.sort()}p=w.length;j=x.length=w.length;for(c=0;c<j;c++)if(v=a===w?c:w[c],z=a[v],l=q(v,z,c),u=y[l])delete y[l],n[l]=u,x[c]=u;else if(n.hasOwnProperty(l))throw o(x,function(a){a&&a.element&&(y[a.id]=a)}),Error("Duplicates in a repeater are not allowed. Repeater: "+m);else x[c]={id:l};for(v in y)if(y.hasOwnProperty(v))u=
-y[v],g.leave(u.element),u.element[0].$$NG_REMOVED=!0,u.scope.$destroy();c=0;for(j=w.length;c<j;c++){v=a===w?c:w[c];z=a[v];u=x[c];if(u.element){t=u.scope;l=k[0];do l=l.nextSibling;while(l&&l.$$NG_REMOVED);u.element[0]!=l&&g.move(u.element,null,k);k=u.element}else t=d.$new();t[s]=z;r&&(t[r]=v);t.$index=c;t.$first=c===0;t.$last=c===p-1;t.$middle=!(t.$first||t.$last);u.element||f(t,function(a){g.enter(a,null,k);k=a;u.scope=t;u.element=a;n[u.id]=u})}y=n})}}}}],Pd=["$animator",function(a){return function(c,
-d,e){var f=a(c,e);c.$watch(e.ngShow,function(a){f[Ha(a)?"show":"hide"](d)})}}],Qd=["$animator",function(a){return function(c,d,e){var f=a(c,e);c.$watch(e.ngHide,function(a){f[Ha(a)?"hide":"show"](d)})}}],Rd=Y(function(a,c,d){a.$watch(d.ngStyle,function(a,d){d&&a!==d&&o(d,function(a,d){c.css(d,"")});a&&c.css(a)},!0)}),Sd=["$animator",function(a){return{restrict:"EA",require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(c,d,e,f){var i=a(c,e),h,j,g=[];c.$watch(e.ngSwitch||
-e.on,function(a){for(var d=0,l=g.length;d<l;d++)g[d].$destroy(),i.leave(j[d]);j=[];g=[];if(h=f.cases["!"+a]||f.cases["?"])c.$eval(e.change),o(h,function(a){var d=c.$new();g.push(d);a.transclude(d,function(c){var d=a.element;j.push(c);i.enter(c,d.parent(),d)})})})}}}],Td=Y({transclude:"element",priority:500,require:"^ngSwitch",compile:function(a,c,d){return function(a,f,i,h){h.cases["!"+c.ngSwitchWhen]=h.cases["!"+c.ngSwitchWhen]||[];h.cases["!"+c.ngSwitchWhen].push({transclude:d,element:f})}}}),Ud=
-Y({transclude:"element",priority:500,require:"^ngSwitch",compile:function(a,c,d){return function(a,c,i,h){h.cases["?"]=h.cases["?"]||[];h.cases["?"].push({transclude:d,element:c})}}}),Vd=Y({controller:["$transclude","$element",function(a,c){a(function(a){c.append(a)})}]}),Wd=["$http","$templateCache","$route","$anchorScroll","$compile","$controller","$animator",function(a,c,d,e,f,i,h){return{restrict:"ECA",terminal:!0,link:function(a,c,m){function k(){var h=d.current&&d.current.locals,k=h&&h.$template;
-if(k){n.leave(c.contents(),c);l&&(l.$destroy(),l=null);n.enter(v("<div></div>").html(k).contents(),c);var k=f(c.contents()),m=d.current;l=m.scope=a.$new();if(m.controller)h.$scope=l,h=i(m.controller,h),c.children().data("$ngControllerController",h);k(l);l.$emit("$viewContentLoaded");l.$eval(o);e()}else n.leave(c.contents(),c),l&&(l.$destroy(),l=null)}var l,o=m.onload||"",n=h(a,m);a.$on("$routeChangeSuccess",k);k()}}}],Xd=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(c,
-d){d.type=="text/ng-template"&&a.put(d.id,c[0].text)}}}],Yd=Q({terminal:!0}),Zd=["$compile","$parse",function(a,c){var d=/^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w\d]*)|(?:\(\s*([\$\w][\$\w\d]*)\s*,\s*([\$\w][\$\w\d]*)\s*\)))\s+in\s+(.*)$/,e={$setViewValue:t};return{restrict:"E",require:["select","?ngModel"],controller:["$element","$scope","$attrs",function(a,c,d){var j=this,g={},m=e,k;j.databound=d.ngModel;j.init=function(a,c,d){m=a;k=d};j.addOption=function(c){g[c]=
-!0;m.$viewValue==c&&(a.val(c),k.parent()&&k.remove())};j.removeOption=function(a){this.hasOption(a)&&(delete g[a],m.$viewValue==a&&this.renderUnknownOption(a))};j.renderUnknownOption=function(c){c="? "+la(c)+" ?";k.val(c);a.prepend(k);a.val(c);k.prop("selected",!0)};j.hasOption=function(a){return g.hasOwnProperty(a)};c.$on("$destroy",function(){j.renderUnknownOption=t})}],link:function(e,i,h,j){function g(a,c,d,e){d.$render=function(){var a=d.$viewValue;e.hasOption(a)?(x.parent()&&x.remove(),c.val(a),
-a===""&&p.prop("selected",!0)):u(a)&&p?c.val(""):e.renderUnknownOption(a)};c.bind("change",function(){a.$apply(function(){x.parent()&&x.remove();d.$setViewValue(c.val())})})}function m(a,c,d){var e;d.$render=function(){var a=new Pa(d.$viewValue);o(c.find("option"),function(c){c.selected=w(a.get(c.value))})};a.$watch(function(){ja(e,d.$viewValue)||(e=W(d.$viewValue),d.$render())});c.bind("change",function(){a.$apply(function(){var a=[];o(c.find("option"),function(c){c.selected&&a.push(c.value)});d.$setViewValue(a)})})}
-function k(e,f,h){function g(){var a={"":[]},c=[""],d,i,t,v,u;t=h.$modelValue;v=p(e)||[];var w=l?rb(v):v,z,x,A;x={};u=!1;var B,C;if(n)u=new Pa(t);else if(t===null||r)a[""].push({selected:t===null,id:"",label:""}),u=!0;for(A=0;z=w.length,A<z;A++){x[k]=v[l?x[l]=w[A]:A];d=m(e,x)||"";if(!(i=a[d]))i=a[d]=[],c.push(d);n?d=u.remove(o(e,x))!=s:(d=t===o(e,x),u=u||d);B=j(e,x);B=B===s?"":B;i.push({id:l?w[A]:A,label:B,selected:d})}!n&&!u&&a[""].unshift({id:"?",label:"",selected:!0});x=0;for(w=c.length;x<w;x++){d=
-c[x];i=a[d];if(q.length<=x)t={element:D.clone().attr("label",d),label:i.label},v=[t],q.push(v),f.append(t.element);else if(v=q[x],t=v[0],t.label!=d)t.element.attr("label",t.label=d);B=null;A=0;for(z=i.length;A<z;A++)if(d=i[A],u=v[A+1]){B=u.element;if(u.label!==d.label)B.text(u.label=d.label);if(u.id!==d.id)B.val(u.id=d.id);if(u.element.selected!==d.selected)B.prop("selected",u.selected=d.selected)}else d.id===""&&r?C=r:(C=y.clone()).val(d.id).attr("selected",d.selected).text(d.label),v.push({element:C,
-label:d.label,id:d.id,selected:d.selected}),B?B.after(C):t.element.append(C),B=C;for(A++;v.length>A;)v.pop().element.remove()}for(;q.length>x;)q.pop()[0].element.remove()}var i;if(!(i=t.match(d)))throw Error("Expected ngOptions in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '"+t+"'.");var j=c(i[2]||i[1]),k=i[4]||i[6],l=i[5],m=c(i[3]||""),o=c(i[2]?i[1]:k),p=c(i[7]),q=[[{element:f,label:""}]];r&&(a(r)(e),r.removeClass("ng-scope"),r.remove());f.html("");f.bind("change",
-function(){e.$apply(function(){var a,c=p(e)||[],d={},g,i,j,m,r,t;if(n){i=[];m=0;for(t=q.length;m<t;m++){a=q[m];j=1;for(r=a.length;j<r;j++)if((g=a[j].element)[0].selected)g=g.val(),l&&(d[l]=g),d[k]=c[g],i.push(o(e,d))}}else g=f.val(),g=="?"?i=s:g==""?i=null:(d[k]=c[g],l&&(d[l]=g),i=o(e,d));h.$setViewValue(i)})});h.$render=g;e.$watch(g)}if(j[1]){for(var l=j[0],q=j[1],n=h.multiple,t=h.ngOptions,r=!1,p,y=v(V.createElement("option")),D=v(V.createElement("optgroup")),x=y.clone(),j=0,C=i.children(),A=C.length;j<
-A;j++)if(C[j].value==""){p=r=C.eq(j);break}l.init(q,r,x);if(n&&(h.required||h.ngRequired)){var H=function(a){q.$setValidity("required",!h.required||a&&a.length);return a};q.$parsers.push(H);q.$formatters.unshift(H);h.$observe("required",function(){H(q.$viewValue)})}t?k(e,i,q):n?m(e,i,q):g(e,i,q,l)}}}}],$d=["$interpolate",function(a){var c={addOption:t,removeOption:t};return{restrict:"E",priority:100,compile:function(d,e){if(u(e.value)){var f=a(d.text(),!0);f||e.$set("value",d.text())}return function(a,
-d,e){var g=d.parent(),m=g.data("$selectController")||g.parent().data("$selectController");m&&m.databound?d.prop("selected",!1):m=c;f?a.$watch(f,function(a,c){e.$set("value",a);a!==c&&m.removeOption(c);m.addOption(a)}):m.addOption(e.value);d.bind("$destroy",function(){m.removeOption(e.value)})}}}}],ae=Q({restrict:"E",terminal:!0});(ca=M.jQuery)?(v=ca,y(ca.fn,{scope:za.scope,controller:za.controller,injector:za.injector,inheritedData:za.inheritedData}),fb("remove",!0),fb("empty"),fb("html")):v=P;Ia.element=
-v;(function(a){y(a,{bootstrap:vb,copy:W,extend:y,equals:ja,element:v,forEach:o,injector:wb,noop:t,bind:ab,toJson:da,fromJson:tb,identity:pa,isUndefined:u,isDefined:w,isString:x,isFunction:I,isObject:L,isNumber:Za,isElement:jc,isArray:C,version:md,isDate:qa,lowercase:J,uppercase:na,callbacks:{counter:0},noConflict:gc});xa=oc(M);try{xa("ngLocale")}catch(c){xa("ngLocale",[]).provider("$locale",cd)}xa("ng",["ngLocale"],["$provide",function(a){a.provider("$compile",Hb).directive({a:od,input:dc,textarea:dc,
-form:pd,script:Xd,select:Zd,style:ae,option:$d,ngBind:Ad,ngBindHtmlUnsafe:Cd,ngBindTemplate:Bd,ngClass:Dd,ngClassEven:Fd,ngClassOdd:Ed,ngCsp:Id,ngCloak:Gd,ngController:Hd,ngForm:qd,ngHide:Qd,ngInclude:Kd,ngInit:Ld,ngNonBindable:Md,ngPluralize:Nd,ngRepeat:Od,ngShow:Pd,ngSubmit:Jd,ngStyle:Rd,ngSwitch:Sd,ngSwitchWhen:Td,ngSwitchDefault:Ud,ngOptions:Yd,ngView:Wd,ngTransclude:Vd,ngModel:vd,ngList:xd,ngChange:wd,required:ec,ngRequired:ec,ngValue:zd}).directive(qb).directive(fc);a.provider({$anchorScroll:xc,
-$animation:Gb,$animator:nd,$browser:zc,$cacheFactory:Ac,$controller:Dc,$document:Ec,$exceptionHandler:Fc,$filter:Tb,$interpolate:Gc,$http:Zc,$httpBackend:$c,$location:Kc,$log:Lc,$parse:Pc,$route:Sc,$routeParams:Tc,$rootScope:Uc,$q:Qc,$sniffer:Vc,$templateCache:Bc,$timeout:dd,$window:Wc})}])})(Ia);v(V).ready(function(){mc(V,vb)})})(window,document);angular.element(document).find("head").append('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak{display:none;}ng\\:form{display:block;}</style>');
[30/30] git commit: Merge remote-tracking branch
'mobile_chrome_apps/master'
Posted by ag...@apache.org.
Merge remote-tracking branch 'mobile_chrome_apps/master'
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/d2d24aea
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/d2d24aea
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/d2d24aea
Branch: refs/heads/master
Commit: d2d24aeaae4bda6ae89c9554306909d062b10c40
Parents: f456ae4 d8f748c
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu May 23 16:03:04 2013 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu May 23 16:03:04 2013 -0400
----------------------------------------------------------------------
.jshintignore | 2 +-
README.md | 107 +++++--
checkjs | 2 +-
hooks/after_prepare/cordovajsmenu.js | 60 ----
packapp | 63 +++--
www/cdvah_contextMenu.html | 93 ++++++
www/cdvah_index.html | 22 ++
www/cdvah_js/AddCtrl.js | 42 +++
www/cdvah_js/AppBundleAlias.js | 70 ++++
www/cdvah_js/AppConstants.js | 12 +
www/cdvah_js/AppsService.js | 375 +++++++++++++++++++++
www/cdvah_js/CdvhPackageHandler.js | 52 +++
www/cdvah_js/ContextMenu.js | 119 +++++++
www/cdvah_js/ContextMenuInjectScript.js | 22 ++
www/cdvah_js/KnownExtensionDownloader.js | 43 +++
www/cdvah_js/ListCtrl.js | 117 +++++++
www/cdvah_js/ResourcesLoader.js | 438 +++++++++++++++++++++++++
www/cdvah_js/ServeCordovaJSHandler.js | 25 ++
www/cdvah_js/app.js | 11 +
www/cdvah_js/libs/angular.min.js | 173 ++++++++++
www/cdvah_js/libs/q.min.js | 19 +
www/cdvah_views/add.html | 23 ++
www/cdvah_views/list.html | 12 +
www/contextMenu.html | 50 ---
www/index.html | 18 -
www/js/AddCtrl.js | 24 --
www/js/AppConstants.js | 12 -
www/js/AppsService.js | 204 ------------
www/js/CdvhPackageHandler.js | 34 --
www/js/ContextMenu.js | 38 ---
www/js/ListCtrl.js | 87 -----
www/js/ResourcesLoader.js | 376 ---------------------
www/js/app.js | 11 -
www/js/libs/angular.min.js | 173 ----------
www/js/libs/q.min.js | 19 -
www/views/add.html | 18 -
www/views/list.html | 12 -
37 files changed, 1796 insertions(+), 1182 deletions(-)
----------------------------------------------------------------------
[15/30] git commit: Merge pull request #21 from shravanrn/url_alias
Posted by ag...@apache.org.
Merge pull request #21 from shravanrn/url_alias
New filenames. Url aliases (New AppBundle plugin needed). Description continued below.
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/616378ce
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/616378ce
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/616378ce
Branch: refs/heads/master
Commit: 616378ceea95b89a5b3116e1c47cb81a4722d758
Parents: ea7823e dd4d655
Author: Braden Shepherdson <br...@gmail.com>
Authored: Wed May 8 15:04:16 2013 -0700
Committer: Braden Shepherdson <br...@gmail.com>
Committed: Wed May 8 15:04:16 2013 -0700
----------------------------------------------------------------------
.jshintignore | 2 +-
checkjs | 2 +-
packapp | 2 +-
www/cdvah_contextMenu.html | 53 ++++
www/cdvah_index.html | 20 ++
www/cdvah_js/AddCtrl.js | 24 ++
www/cdvah_js/AppBundleAlias.js | 36 +++
www/cdvah_js/AppConstants.js | 12 +
www/cdvah_js/AppsService.js | 276 +++++++++++++++++
www/cdvah_js/CdvhPackageHandler.js | 60 ++++
www/cdvah_js/ContextMenu.js | 83 +++++
www/cdvah_js/KnownExtensionDownloader.js | 43 +++
www/cdvah_js/ListCtrl.js | 117 +++++++
www/cdvah_js/ResourcesLoader.js | 404 +++++++++++++++++++++++++
www/cdvah_js/app.js | 11 +
www/cdvah_js/libs/angular.min.js | 173 +++++++++++
www/cdvah_js/libs/q.min.js | 19 ++
www/cdvah_views/add.html | 17 +
www/cdvah_views/list.html | 12 +
www/contextMenu.html | 53 ----
www/index.html | 19 --
www/js/AddCtrl.js | 24 --
www/js/AppConstants.js | 12 -
www/js/AppsService.js | 253 ----------------
www/js/CdvhPackageHandler.js | 60 ----
www/js/ContextMenu.js | 84 -----
www/js/KnownExtensionDownloader.js | 43 ---
www/js/ListCtrl.js | 94 ------
www/js/ResourcesLoader.js | 404 -------------------------
www/js/app.js | 11 -
www/js/libs/angular.min.js | 173 -----------
www/js/libs/q.min.js | 19 --
www/views/add.html | 17 -
www/views/list.html | 12 -
34 files changed, 1363 insertions(+), 1281 deletions(-)
----------------------------------------------------------------------
[05/30] git commit: Display date and time of app installation
Posted by ag...@apache.org.
Display date and time of app installation
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/7531ee5d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/7531ee5d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/7531ee5d
Branch: refs/heads/master
Commit: 7531ee5d1554aad104a33b387c8e681ed60310f5
Parents: 1352f29
Author: Shravan Narayan <sh...@google.com>
Authored: Thu May 2 14:26:47 2013 -0400
Committer: Shravan Narayan <sh...@google.com>
Committed: Thu May 2 17:55:46 2013 -0400
----------------------------------------------------------------------
www/js/AppsService.js | 15 ++++++++++-----
www/js/ListCtrl.js | 11 +++++++++--
www/views/list.html | 10 +++++-----
3 files changed, 24 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/7531ee5d/www/js/AppsService.js
----------------------------------------------------------------------
diff --git a/www/js/AppsService.js b/www/js/AppsService.js
index 7cc4891..17a1638 100644
--- a/www/js/AppsService.js
+++ b/www/js/AppsService.js
@@ -53,6 +53,7 @@
"Name" : appName,
"Source" : appSource,
"Data" : appSourcePattern
+ "Installed" : (new Date()).toLocaleString()
});
return ResourcesLoader.writeJSONFileContents(APPS_JSON, result);
});
@@ -124,7 +125,7 @@
return {
//return promise with the array of apps
- getAppsList : function() {
+ getAppsList : function(getFullEntries) {
return ResourcesLoader.ensureDirectoryExists(APPS_JSON)
.then(function() {
return ResourcesLoader.readJSONFileContents(APPS_JSON);
@@ -134,7 +135,11 @@
var newAppsList = [];
for(var i = 0; i < result.installedApps.length; i++){
- newAppsList.push(result.installedApps[i].Name);
+ if(getFullEntries) {
+ newAppsList.push(result.installedApps[i]);
+ } else {
+ newAppsList.push(result.installedApps[i].Name);
+ }
}
return newAppsList;
@@ -164,7 +169,7 @@
},
addAppFromPattern : function(appName, appSourcePattern) {
- return this.getAppsList()
+ return this.getAppsList(false /* App names only */)
.then(function(appsList){
if(appsList.indexOf(appName) !== -1) {
throw new Error("An app with this name already exists");
@@ -174,7 +179,7 @@
},
uninstallApp : function(appName) {
- return removeApp(appName, true);
+ return removeApp(appName);
},
getLastRunApp : function() {
@@ -225,7 +230,7 @@
},
updateApp : function(appName){
- return removeApp(appName, true)
+ return removeApp(appName)
.then(function(entry){
if(entry.Source === "pattern") {
return addNewAppFromPattern(entry.Name, entry.Data);
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/7531ee5d/www/js/ListCtrl.js
----------------------------------------------------------------------
diff --git a/www/js/ListCtrl.js b/www/js/ListCtrl.js
index b3a11be..d906f7c 100644
--- a/www/js/ListCtrl.js
+++ b/www/js/ListCtrl.js
@@ -37,9 +37,16 @@
}
$scope.loadAppsList = function(callApply) {
- return AppsService.getAppsList()
+ return AppsService.getAppsList(true /* get full information about the app */)
.then(function(newAppsList){
- newAppsList.sort();
+ newAppsList.sort(function(a, b){
+ if(a.Name < b.Name) {
+ return -1;
+ } else if(a.Name > b.Name) {
+ return 1;
+ }
+ return 0;
+ });
//clear the old apps list
$scope.appsList.splice(0, $scope.appsList.length);
angular.extend($scope.appsList, newAppsList);
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/7531ee5d/www/views/list.html
----------------------------------------------------------------------
diff --git a/www/views/list.html b/www/views/list.html
index 1735b8d..c111953 100644
--- a/www/views/list.html
+++ b/www/views/list.html
@@ -1,10 +1,10 @@
<ul>
<li ng-repeat="app in appsList">
- <p>{{app}}</p>
- <button ng-click="launchApp(app)">Launch</button>
- <button ng-click="refreshApp(app)">Update</button>
- <button ng-click="removeApp(app)">Remove</button>
- <br />
+ <p>{{app.Name}}</p>
+ <p>Installed on: {{app.Installed}}</p>
+ <button ng-click="launchApp(app.Name)">Launch</button>
+ <button ng-click="refreshApp(app.Name)">Update</button>
+ <button ng-click="removeApp(app.Name)">Remove</button>
</li>
</ul>
<button ng-click="loadAppsList()">Reload Apps List</button>
[16/30] git commit: Add apps hosted by cordova serve. (Context menu
not injected into app)
Posted by ag...@apache.org.
Add apps hosted by cordova serve. (Context menu not injected into app)
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/636794a8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/636794a8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/636794a8
Branch: refs/heads/master
Commit: 636794a83fe4e89e592ca61bd927295d0feb23c4
Parents: dd4d655
Author: Shravan Narayan <sh...@google.com>
Authored: Wed May 8 17:52:15 2013 -0400
Committer: Shravan Narayan <sh...@google.com>
Committed: Wed May 8 18:38:55 2013 -0400
----------------------------------------------------------------------
www/cdvah_js/AddCtrl.js | 28 ++++--
www/cdvah_js/AppsService.js | 151 +++++++++++++++++++++++-----------
www/cdvah_js/ListCtrl.js | 2 +-
www/cdvah_js/ResourcesLoader.js | 97 ++++++++++++++--------
www/cdvah_views/add.html | 12 ++-
5 files changed, 195 insertions(+), 95 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/636794a8/www/cdvah_js/AddCtrl.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/AddCtrl.js b/www/cdvah_js/AddCtrl.js
index 09a1c50..7f6a34c 100644
--- a/www/cdvah_js/AddCtrl.js
+++ b/www/cdvah_js/AddCtrl.js
@@ -3,21 +3,29 @@
/* global myApp */
myApp.controller("AddCtrl", ["$scope", "AppsService", function ($scope, AppsService) {
- $scope.addApp = function(appName, appSource, appSourcePattern) {
+ $scope.addApp = function(appName, appSource, appSourcePattern, appSourceServe) {
+ var serviceCall;
if(appSource === "pattern") {
if(!appSourcePattern) {
- alert("Url not specified");
+ alert("Url of package not specified");
return;
}
-
- AppsService.addAppFromPattern(appName, appSourcePattern)
- .then(function() {
- alert("Successfully installed");
- }, function(error) {
- console.error(error);
- alert("Unable to add application because: \n" + JSON.stringify(error));
- });
+ serviceCall = AppsService.addAppFromPattern(appName, appSourcePattern);
+ } else if(appSource === "serve") {
+ if(!appSourceServe) {
+ alert("Url of config file not specified");
+ return;
+ }
+ serviceCall = AppsService.addAppFromServe(appName, appSourceServe);
}
+
+ serviceCall.then(function() {
+ alert("Successfully installed");
+ }, function(error) {
+ console.error(error);
+ alert("Unable to add application because: \n" + error);
+ });
+
};
}]);
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/636794a8/www/cdvah_js/AppsService.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/AppsService.js b/www/cdvah_js/AppsService.js
index 9afe5a3..824cb8a 100644
--- a/www/cdvah_js/AppsService.js
+++ b/www/cdvah_js/AppsService.js
@@ -47,42 +47,35 @@
});
}
- function registerApp(appName, appSource, appSourcePattern) {
+ function addNewAppFromServe(appName, appSourceServe){
+ return registerApp(appName, "serve", appSourceServe);
+ }
+
+ function registerApp(appName, appSource, appSourceData) {
return ResourcesLoader.readJSONFileContents(APPS_JSON)
.then(function(result){
result.installedApps = result.installedApps || [];
result.installedApps.push({
"Name" : appName,
"Source" : appSource,
- "Data" : appSourcePattern,
+ "Data" : appSourceData,
"Installed" : (new Date()).toLocaleString()
});
return ResourcesLoader.writeJSONFileContents(APPS_JSON, result);
});
}
- function cleanPath(path){
- if(path.indexOf("file://") === 0){
- path = path.substring("file://".length);
- }
- // remove trailing slash
- return (path.substring(path.length - 1) === "/") ? path.substring(0, path.length - 1) : path;
- }
-
function isPathAbsolute(path){
return (path.match(/^[a-z0-9+.-]+:/) != null);
}
- function getAppStartPageFromConfig(configFile, appBaseDirectory) {
- configFile = cleanPath(configFile);
- appBaseDirectory = "file://" + cleanPath(appBaseDirectory);
-
+ function getAppStartPageFromConfig(configFile, appBaseLocation) {
return ResourcesLoader.readFileContents(configFile)
.then(function(contents){
if(!contents) {
throw new Error("Config file is empty. Unable to find a start page for your app.");
} else {
- var startLocation = appBaseDirectory + "/index.html";
+ var startLocation = appBaseLocation + "/index.html";
var parser = new DOMParser();
var xmlDoc = parser.parseFromString(contents, "text/xml");
var els = xmlDoc.getElementsByTagName("content");
@@ -97,7 +90,7 @@
startLocation = srcValue;
} else {
srcValue = srcValue.charAt(0) === "/" ? srcValue.substring(1) : srcValue;
- startLocation = appBaseDirectory + "/" + srcValue;
+ startLocation = appBaseLocation + "/" + srcValue;
}
break;
}
@@ -139,31 +132,93 @@
});
}
- return {
- //return promise with the array of apps
- getAppsList : function(getFullEntries) {
- return ResourcesLoader.ensureDirectoryExists(APPS_JSON)
- .then(function() {
- return ResourcesLoader.readJSONFileContents(APPS_JSON);
- })
- .then(function(result){
- result.installedApps = result.installedApps || [];
- var newAppsList = [];
+ function getAppsList(getFullEntries){
+ return ResourcesLoader.ensureDirectoryExists(APPS_JSON)
+ .then(function() {
+ return ResourcesLoader.readJSONFileContents(APPS_JSON);
+ })
+ .then(function(result){
+ result.installedApps = result.installedApps || [];
+ var newAppsList = [];
- for(var i = 0; i < result.installedApps.length; i++){
- if(getFullEntries) {
- newAppsList.push(result.installedApps[i]);
- } else {
- newAppsList.push(result.installedApps[i].Name);
- }
+ for(var i = 0; i < result.installedApps.length; i++){
+ if(getFullEntries) {
+ newAppsList.push(result.installedApps[i]);
+ } else {
+ newAppsList.push(result.installedApps[i].Name);
}
+ }
- return newAppsList;
- });
+ return newAppsList;
+ });
+ }
+
+ function isUniqueApp(appName){
+ return getAppsList(false /* App names only */)
+ .then(function(appsList){
+ if(appsList.indexOf(appName) !== -1) {
+ throw new Error("An app with this name already exists");
+ }
+ });
+ }
+
+ function getWWWDirAndStartPageFromConfigForApp(appName){
+ var platformWWWLocation;
+ return getAppsList(true /* Get full app entry */)
+ .then(function(appEntries){
+ var entry;
+ for(var i = 0; i < appEntries.length; i++){
+ if(appEntries[i].Name === appName){
+ entry = appEntries[i];
+ break;
+ }
+ }
+ if(!entry){
+ throw new Error("Could not find the app " + appName + " in the installed apps");
+ }
+ if(entry.Source === "pattern"){
+ return ResourcesLoader.getFullFilePath(INSTALL_DIRECTORY + appName + "/" + platformId)
+ .then(function(platformLocation){
+ return {
+ platformWWWLocation : platformLocation + "/www/",
+ configLocation : platformLocation + "/config.xml"
+ };
+ });
+ } else if(entry.Source === "serve"){
+ var configFile = entry.Data;
+ var location = configFile.indexOf("/config.xml");
+ if(location === -1){
+ throw new Error("The location of config.xml provided is invalid. Expected the location to end with 'config.xml'");
+ }
+ //grab path including upto last slash
+ var appLocation = configFile.substring(0, location + 1);
+ return {
+ platformWWWLocation : appLocation,
+ configLocation : configFile
+ };
+ } else {
+ throw new Error("Unknown app source: " + entry.Source);
+ }
+ })
+ .then(function(appPaths){
+ platformWWWLocation = appPaths.platformWWWLocation;
+ return getAppStartPageFromConfig(appPaths.configLocation, appPaths.platformWWWLocation);
+ })
+ .then(function(startLocation){
+ return {
+ startLocation : startLocation,
+ platformWWWLocation : platformWWWLocation
+ };
+ });
+ }
+
+ return {
+ //return promise with the array of apps
+ getAppsList : function(getFullEntries) {
+ return getAppsList(getFullEntries);
},
launchApp : function(appName) {
- var platformWWWLocation;
var startLocation;
return ResourcesLoader.readJSONFileContents(METADATA_JSON)
.then(function(settings){
@@ -172,17 +227,13 @@
return ResourcesLoader.writeJSONFileContents(METADATA_JSON, settings);
})
.then(function(){
- return ResourcesLoader.getFullFilePath(INSTALL_DIRECTORY + appName + "/" + platformId);
- })
- .then(function(platformLocation){
- platformWWWLocation = platformLocation + "/www/";
- return getAppStartPageFromConfig(platformLocation + "/config.xml", platformWWWLocation);
+ return getWWWDirAndStartPageFromConfigForApp(appName);
})
- .then(function(_startLocation){
- startLocation = _startLocation;
+ .then(function(startLocationAndWWWLocation){
+ startLocation = startLocationAndWWWLocation.startLocation;
var promises = [];
for (var i = preLaunchHooks.length - 1; i >= 0; i--) {
- promises.push(preLaunchHooks[i](appName, platformWWWLocation));
+ promises.push(preLaunchHooks[i](appName, startLocationAndWWWLocation.platformWWWLocation));
}
return Q.all(promises);
})
@@ -192,15 +243,19 @@
},
addAppFromPattern : function(appName, appSourcePattern) {
- return this.getAppsList(false /* App names only */)
- .then(function(appsList){
- if(appsList.indexOf(appName) !== -1) {
- throw new Error("An app with this name already exists");
- }
+ return isUniqueApp(appName)
+ .then(function(){
return addNewAppFromPattern(appName, appSourcePattern);
});
},
+ addAppFromServe : function(appName, appSourceServe) {
+ return isUniqueApp(appName)
+ .then(function(){
+ return addNewAppFromServe(appName, appSourceServe);
+ });
+ },
+
uninstallApp : function(appName) {
return removeApp(appName);
},
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/636794a8/www/cdvah_js/ListCtrl.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/ListCtrl.js b/www/cdvah_js/ListCtrl.js
index 5dd0794..326f394 100644
--- a/www/cdvah_js/ListCtrl.js
+++ b/www/cdvah_js/ListCtrl.js
@@ -87,7 +87,7 @@
return AppsService.launchApp(app)
.then(null, function(error){
console.error("Error during loading of app " + app + ": " + error);
- alert("Something went wrong during the loading of the app. Please try again.");
+ alert("Something went wrong during the loading of the app. Please try again." + error);
});
};
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/636794a8/www/cdvah_js/ResourcesLoader.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/ResourcesLoader.js b/www/cdvah_js/ResourcesLoader.js
index d9ca013..e1df6db 100644
--- a/www/cdvah_js/ResourcesLoader.js
+++ b/www/cdvah_js/ResourcesLoader.js
@@ -72,6 +72,14 @@
return path;
}
+ function getScheme(uri){
+ var ret = uri.match(/^[a-z0-9+.-]+(?=:)/);
+ if(!ret){
+ return;
+ }
+ return ret[0];
+ }
+
//promise returns the directory entry
function getDirectoryEntry(directoryName) {
var deferred = Q.defer();
@@ -196,6 +204,23 @@
});
}
+ function xhrGet(url){
+ var deferred = Q.defer();
+ var xhr = new XMLHttpRequest();
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState === 4) {
+ if(xhr.status === 200) {
+ deferred.resolve(xhr);
+ } else {
+ deferred.reject("XHR return status: " + xhr.statusText);
+ }
+ }
+ };
+ xhr.open("GET", url, true);
+ xhr.send();
+ return deferred.promise;
+ }
+
return {
doesFileExist : function(fileName){
return initialiseFileSystem()
@@ -283,24 +308,37 @@
//returns a promise with the contents of the file
readFileContents : function(fileName) {
- return initialiseFileSystem()
- .then(function(){
- return getFile(fileName);
- })
- .then(function(file){
- var deferred = Q.defer();
-
- var reader = new $window.FileReader();
- reader.onload = function(evt) {
- var text = evt.target.result;
- deferred.resolve(text);
- };
- reader.onerror = function(evt) {
- deferred.reject(new Error(evt));
- };
- reader.readAsText(file);
-
- return deferred.promise;
+ return Q.fcall(function(){
+ var scheme = getScheme(fileName);
+ // assume file scheme by default
+ if(!scheme || scheme === "file") {
+ return initialiseFileSystem()
+ .then(function(){
+ return getFile(fileName);
+ })
+ .then(function(file){
+ var deferred = Q.defer();
+
+ var reader = new $window.FileReader();
+ reader.onload = function(evt) {
+ var text = evt.target.result;
+ deferred.resolve(text);
+ };
+ reader.onerror = function(evt) {
+ deferred.reject(new Error(evt));
+ };
+ reader.readAsText(file);
+
+ return deferred.promise;
+ });
+ } else if(scheme === "http" || scheme === "https") {
+ return xhrGet(fileName)
+ .then(function(xhr){
+ return xhr.responseText;
+ });
+ } else {
+ throw new Error("Cannot read file " + fileName);
+ }
});
},
@@ -321,7 +359,13 @@
writeFileContents : function(fileName, contents) {
return initialiseFileSystem()
.then(function(){
- return writeToFile(fileName, contents, false /* append */);
+ var scheme = getScheme(fileName);
+ // assume file scheme by default
+ if(!scheme || scheme === "file") {
+ return writeToFile(fileName, contents, false /* append */);
+ } else {
+ throw new Error("Cannot write to " + fileName);
+ }
});
},
@@ -383,20 +427,7 @@
},
xhrGet : function(url) {
- var deferred = Q.defer();
- var xhr = new XMLHttpRequest();
- xhr.onreadystatechange = function() {
- if (xhr.readyState === 4) {
- if(xhr.status === 200) {
- deferred.resolve(xhr);
- } else {
- deferred.reject("XHR return status: " + xhr.statusText);
- }
- }
- };
- xhr.open("GET", url, true);
- xhr.send();
- return deferred.promise;
+ return xhrGet(url);
}
};
}]);
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/636794a8/www/cdvah_views/add.html
----------------------------------------------------------------------
diff --git a/www/cdvah_views/add.html b/www/cdvah_views/add.html
index 902c46d..af318b8 100644
--- a/www/cdvah_views/add.html
+++ b/www/cdvah_views/add.html
@@ -6,12 +6,18 @@
<span ng-show="addForm.appName.$error.maxlength">Too long</span>
<br />
- <input type="radio" ng-model="appSource" name="appSource" value="pattern" ng-init="appPatternChecked=true; appSource='pattern'" ng-checked="appPatternChecked" />
+ <input type="radio" ng-model="appSource" name="appSource" value="pattern" ng-init="appSource='pattern'" ng-checked="appSource=='pattern'" />
<label for="inputAppPattern">Enter the URL to a file</label><br />
- <input id="inputAppPattern" type="text" name="appSourcePattern" ng-model="appSourcePattern" ng-disabled="!appPatternChecked" ng-required="appPatternChecked" />
+ <input id="inputAppPattern" type="text" name="appSourcePattern" ng-model="appSourcePattern" ng-disabled="appSource!='pattern'" ng-required="appSource=='pattern'" />
<span ng-show="addForm.appSourcePattern.$error.required">Required</span>
<br />
- <button ng-click="addApp(appName, appSource, appSourcePattern)" ng-disabled="!(addForm.$valid)">Add</button>
+ <input type="radio" ng-model="appSource" name="appSource" value="serve" ng-checked="appSource=='serve'" />
+ <label for="inputAppServe">Enter the URL to the server hosting the app</label><br />
+ <input id="inputAppServe" type="text" name="appSourceServe" ng-model="appSourceServe" ng-disabled="appSource!='serve'" ng-pattern="/.*\/config.xml(\?.*|#.*)?$/" ng-required="appSource=='serve'" />
+ <span ng-show="addForm.appSourceServe.$error.required">Required</span>
+ <span ng-show="addForm.appSourceServe.$error.pattern">Url must point to a config.xml file</span>
+ <br />
+ <button ng-click="addApp(appName, appSource, appSourcePattern, appSourceServe)" ng-disabled="!(addForm.$valid)">Add</button>
<br />
<a href="#/">Back To Main Menu</a>
</form>
\ No newline at end of file
[14/30] git commit: Absolute url check bug fix
Posted by ag...@apache.org.
Absolute url check bug fix
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/dd4d6555
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/dd4d6555
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/dd4d6555
Branch: refs/heads/master
Commit: dd4d65551b4524fc06c6076e312b4963fa9f89a7
Parents: 771f02b
Author: Shravan Narayan <sh...@google.com>
Authored: Wed May 8 10:56:13 2013 -0400
Committer: Shravan Narayan <sh...@google.com>
Committed: Wed May 8 10:56:13 2013 -0400
----------------------------------------------------------------------
www/cdvah_js/AppsService.js | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/dd4d6555/www/cdvah_js/AppsService.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/AppsService.js b/www/cdvah_js/AppsService.js
index f961cc9..9afe5a3 100644
--- a/www/cdvah_js/AppsService.js
+++ b/www/cdvah_js/AppsService.js
@@ -70,7 +70,7 @@
}
function isPathAbsolute(path){
- return (path.match(/^[a-zA-Z0-9]+:/) != null);
+ return (path.match(/^[a-z0-9+.-]+:/) != null);
}
function getAppStartPageFromConfig(configFile, appBaseDirectory) {
[07/30] git commit: Package platform www folders so platforms
specific files are picked up.
Posted by ag...@apache.org.
Package platform www folders so platforms specific files are picked up.
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/eba56cc5
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/eba56cc5
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/eba56cc5
Branch: refs/heads/master
Commit: eba56cc50572388572ac019edc4afb6d152c31be
Parents: 6ac6b46
Author: Shravan Narayan <sh...@google.com>
Authored: Thu May 2 17:31:51 2013 -0400
Committer: Shravan Narayan <sh...@google.com>
Committed: Thu May 2 18:25:11 2013 -0400
----------------------------------------------------------------------
README.md | 3 +-
hooks/after_prepare/cordovajsmenu.js | 60 ------------------------
packapp | 63 ++++++++++++++++----------
www/js/AppsService.js | 25 +++++++----
www/js/CdvhPackageHandler.js | 34 ++++++++++++--
www/js/ContextMenu.js | 1 -
www/js/ResourcesLoader.js | 70 ++++++++++++++++++++---------
7 files changed, 135 insertions(+), 121 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/eba56cc5/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index abaae73..9e4c631 100644
--- a/README.md
+++ b/README.md
@@ -21,7 +21,6 @@ An App harness for Cordova that can download and run Cordova apps as well as Chr
cordova plugin add ../Repo/AppBundle
cordova plugin add ../Repo/zip/
cp -rf ../Repo/cordova-app-harness/www app/www
- cp -rf ../Repo/cordova-app-harness/hooks .cordova/hooks
cordova prepare
* Put the cordova.jar in the CordovaAppHarness/platforms/android/libs folder. (Note you may want to link the cordova-android project directly instead of adding a built jar so you can easily make changes to cordova-android and test the app harness)
@@ -33,7 +32,7 @@ An App harness for Cordova that can download and run Cordova apps as well as Chr
##Using the app
* Run the packapp script and point it to a cordova project. This will package the app into a cdvh file. (Note: it is expected that you add all relevant platforms. For example, if you want to test on the iphone, you need to have added the ios platform to the project)
- Repo/cordova-app-harness/zipapp ./TestApp TestApp.cdvh
+ Repo/cordova-app-harness/packapp -p ./TestApp TestApp.cdvh
* Upload the the cdvh onto any hosting site.
* Run the app harness
* Click add new app
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/eba56cc5/hooks/after_prepare/cordovajsmenu.js
----------------------------------------------------------------------
diff --git a/hooks/after_prepare/cordovajsmenu.js b/hooks/after_prepare/cordovajsmenu.js
deleted file mode 100755
index bbc976d..0000000
--- a/hooks/after_prepare/cordovajsmenu.js
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/usr/bin/env node
-
-var fs = require('fs');
-var path = require('path');
-
-var androidAppend = function() {
- var location = document.location.toString();
- if(location.indexOf("file:///android_asset") === 0 || location.search("app-bundle:///") === 0) {
- console.log("Not injecting");
- } else {
- console.log("Injecting menu script");
- var contextScript = document.createElement('script');
- contextScript.setAttribute("type","text/javascript");
- contextScript.setAttribute("src", "app-bundle:///js/ContextMenu.js");
- document.getElementsByTagName("head")[0].appendChild(contextScript);
- }
-};
-
-var iosAppend = function() {
- var location = document.location.toString();
- //Match file:///SOME_PATH/Applications/SOME_GUID/SOME_NAME.app/SOME_PATH
- var regex = /^file:\/\/\/.*?\/Applications\/(\{{0,1}([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}\}{0,1})\/.*?\.app/g;
- if(location.search(regex) === 0 || location.search("app-bundle:///") === 0) {
- console.log("Not injecting");
- } else {
- console.log("Injecting menu script");
- var contextScript = document.createElement('script');
- contextScript.setAttribute("type","text/javascript");
- contextScript.setAttribute("src", "app-bundle:///js/ContextMenu.js");
- document.getElementsByTagName("head")[0].appendChild(contextScript);
- }
-};
-
-console.log("Modifying cordova.js");
-
-var androidCordova = path.join('.', 'platforms', 'android', 'assets', 'www', 'cordova.js');
-
-if (fs.existsSync(androidCordova)) {
- var dataToAppend = '\n(' + androidAppend.toString() + ')();'
- fs.appendFile(androidCordova, dataToAppend, function (err) {
- if(err) {
- console.error("Error appending to cordova.js for android: " + err);
- }
- });
-} else {
- console.error("cordova.js not found for android");
-}
-
-var iosCordova = path.join('.', 'platforms', 'ios', 'www', 'cordova.js');
-
-if (fs.existsSync(iosCordova)) {
- var dataToAppend = '\n(' + iosAppend.toString() + ')();'
- fs.appendFile(iosCordova, dataToAppend, function (err) {
- if(err) {
- console.error("Error appending to cordova.js for ios: " + err);
- }
- });
-} else {
- console.error("cordova.js not found for ios");
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/eba56cc5/packapp
----------------------------------------------------------------------
diff --git a/packapp b/packapp
index d43ec5a..dd1202c 100755
--- a/packapp
+++ b/packapp
@@ -19,18 +19,40 @@
# package a cordova project into a cdvh for app harness (zip file with a specific file and folder layout)
#
# USAGE
-# ./packapp project_directory [packageName.cdhv]
-#
+# ./packapp project_directory [packageName.cdvh]
+
+USAGE_STRING="Usage: packapp [-p] project_directory [packageName.cdvh]\n\t-p Runs cordova prepare before packaging the app"
+
if [ $# -lt 1 ]
then
- echo "Usage: packapp project_directory [packageName.cdhv]"
+ echo -e $USAGE_STRING
exit -1
fi
-ORIG_DIR=$(pwd)
+RUN_PREPARE=
+while getopts ":hp" option; do
+ case $option in
+ h) echo -e $USAGE_STRING; exit ;;
+ p) RUN_PREPARE=1 ;;
+ ?) echo "error: option -$OPTARG is not implemented"; exit ;;
+ esac
+done
+# remove the options from the positional parameters
+shift $(( OPTIND - 1 ))
+
+ORIG_DIR=$(pwd)
+
+# switch to project directory
cd $1
+
+if [ ! -z "$RUN_PREPARE" ]
+then
+ echo "Running Prepare"
+ cordova prepare
+fi
+
FILE_NAME=$(basename "`pwd`" ).cdvh
if [ $# -ge 2 ]
@@ -38,32 +60,25 @@ then
FILE_NAME=$2
fi
+mkdir packtempDir
+
if [ -d "./platforms/android" ]
then
echo "Platform: android found"
- cp -f ./platforms/android/res/xml/config.xml ./app/config.android.xml
- if [ -f "./app/config.android.xml" ]
- then
- echo "Platform: android added successfully"
- else
- echo "Unable to locate config.xml for android"
- fi
+ mkdir packtempDir/android
+ cp -f ./platforms/android/res/xml/config.xml ./packtempDir/android/config.xml
+ cp -rf ./platforms/android/assets/www ./packtempDir/android/www
fi
-
if [ -d "./platforms/ios" ]
then
echo "Platform: ios found"
- find ./platforms/ios/ -name config.xml -exec cp {} ./app/config.ios.xml \;
- if [ -f "./app/config.ios.xml" ]
- then
- echo "Platform: ios added successfully"
- else
- echo "Unable to locate config.xml for ios"
- fi
+ mkdir packtempDir/ios
+ IOS_PROJ_DIR=$(find ./platforms/ios -name config.xml -exec dirname {} \;)
+ cp -f $IOS_PROJ_DIR/config.xml ./packtempDir/ios/config.xml
+ cp -rf ./platforms/ios/www ./packtempDir/ios/www
fi
-
-cd ./app
-zip -r $ORIG_DIR/$FILE_NAME www config.*.xml
-
-rm config.*.xml
\ No newline at end of file
+cd packtempDir
+zip -r $ORIG_DIR/$FILE_NAME android ios >/dev/null
+cd ..
+# rm -rf packtempDir
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/eba56cc5/www/js/AppsService.js
----------------------------------------------------------------------
diff --git a/www/js/AppsService.js b/www/js/AppsService.js
index 17a1638..8868c07 100644
--- a/www/js/AppsService.js
+++ b/www/js/AppsService.js
@@ -59,19 +59,24 @@
});
}
- function getAppStartPageFromAppLocation(appLocation) {
- if(appLocation.indexOf("file://") === 0){
- appLocation = appLocation.substring("file://".length);
+ function cleanPath(path){
+ if(path.indexOf("file://") === 0){
+ path = path.substring("file://".length);
}
- appLocation += (appLocation.substring(appLocation.length - 1) === "/") ? "" : "/";
- var configFile = appLocation + "config." + platformId + ".xml";
+ // remove trailing slash
+ return (path.substring(path.length - 1) === "/") ? path.substring(0, path.length - 1) : path;
+ }
+
+ function getAppStartPageFromConfig(configFile, appBaseDirectory) {
+ configFile = cleanPath(configFile);
+ appBaseDirectory = cleanPath(appBaseDirectory);
return ResourcesLoader.readFileContents(configFile)
.then(function(contents){
if(!contents) {
- throw new Error("config.xml for your platform is empty. Check if the zip package contains config.xml for your platform");
+ throw new Error("Config file is empty. Unable to find a start page for your app.");
} else {
- var startLocation = appLocation + "www/index.html";
+ var startLocation = appBaseDirectory + "/index.html";
var parser = new DOMParser();
var xmlDoc = parser.parseFromString(contents, "text/xml");
var els = xmlDoc.getElementsByTagName("content");
@@ -82,7 +87,8 @@
var el = els[i];
var srcValue = el.getAttribute("src");
if(srcValue) {
- startLocation = appLocation + "www/" + srcValue;
+ // Relative url's only currently
+ startLocation = appBaseDirectory + "/" + srcValue;
break;
}
}
@@ -157,7 +163,8 @@
return ResourcesLoader.getFullFilePath(INSTALL_DIRECTORY + appName);
})
.then(function(appLocation) {
- return getAppStartPageFromAppLocation(appLocation);
+ var appPlatformLocation = cleanPath(appLocation) + "/" + platformId;
+ return getAppStartPageFromConfig(appPlatformLocation + "/config.xml", appPlatformLocation + "/www/");
})
.then(function(startLocation) {
//ensure we use a file uri
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/eba56cc5/www/js/CdvhPackageHandler.js
----------------------------------------------------------------------
diff --git a/www/js/CdvhPackageHandler.js b/www/js/CdvhPackageHandler.js
index 7d4a41e..212cd4b 100644
--- a/www/js/CdvhPackageHandler.js
+++ b/www/js/CdvhPackageHandler.js
@@ -3,6 +3,8 @@
/* global myApp */
myApp.run(["AppsService", "ResourcesLoader", function(AppsService, ResourcesLoader){
+ var platformId = cordova.require("cordova/platform").id;
+
function copyFile(startUrl, targetLocation){
/************ Begin Work around for File system bug ************/
if(targetLocation.indexOf("file://") === 0) {
@@ -18,14 +20,38 @@
});
}
+ var appendScript = function() {
+ console.log("Injecting menu script");
+ var contextScript = document.createElement("script");
+ contextScript.setAttribute("type","text/javascript");
+ contextScript.setAttribute("src", "app-bundle:///js/ContextMenu.js");
+ document.getElementsByTagName("head")[0].appendChild(contextScript);
+ };
+
AppsService.registerPackageHandler("cdvh", {
extractPackageToDirectory : function (fileName, outputDirectory){
+ var dataToAppend = "\n(" + appendScript.toString() + ")();";
+ var platformDirectory = outputDirectory + "/" + platformId + "/www/";
+ var cordovaFile = platformDirectory + "cordova.js";
+ var pluginsFile = platformDirectory + "cordova_plugins.json";
+
+ // We need to
+ // 1) Modify the cordova.js file
+ // 2) Copy the cordova_plugins.json we have, as the app that is being installed may have other plugins included which aren't in the harness.
+ // If we allow unavailable plugins to be included in this file, the plugin initialiser breaks
return ResourcesLoader.extractZipFile(fileName, outputDirectory)
.then(function(){
- return Q.all([
- copyFile("app-bundle:///cordova.js", outputDirectory + "/www/cordova.js"),
- copyFile("app-bundle:///cdvh_files/www/cordova_plugins.json", outputDirectory + "/www/cordova_plugins.json")
- ]);
+ return ResourcesLoader.doesFileExist(cordovaFile);
+ })
+ .then(function(fileExists){
+ if(fileExists){
+ return Q.all([
+ ResourcesLoader.appendFileContents(cordovaFile, dataToAppend),
+ copyFile("app-bundle:///cdvh_files/www/cordova_plugins.json", pluginsFile)
+ ]);
+ } else {
+ throw new Error("The package does not seem to have the files required for the platform: " + platformId);
+ }
});
}
});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/eba56cc5/www/js/ContextMenu.js
----------------------------------------------------------------------
diff --git a/www/js/ContextMenu.js b/www/js/ContextMenu.js
index 16d6f08..239a76c 100644
--- a/www/js/ContextMenu.js
+++ b/www/js/ContextMenu.js
@@ -70,7 +70,6 @@
el.setAttribute("FirebugLite", "4");
el.innerHTML = el.innerHTML = "{ debug : false, startOpened : " + startOpened + ", showIconWhenHidden : false, saveCommandLineHistory : true, saveCookies : false }";
document.head.appendChild(el);
- console.log("test");
}
// FirebugLite doesn't catch errors from window.onerror like desktop browser's dev tools do. So we add it manually.
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/eba56cc5/www/js/ResourcesLoader.js
----------------------------------------------------------------------
diff --git a/www/js/ResourcesLoader.js b/www/js/ResourcesLoader.js
index a11e27b..8aa52a9 100644
--- a/www/js/ResourcesLoader.js
+++ b/www/js/ResourcesLoader.js
@@ -93,7 +93,7 @@
}
//promise returns the file entry
- function getFileEntry(fileName) {
+ function getFileEntry(fileName, createFlag) {
var deferred = Q.defer();
try {
@@ -104,7 +104,8 @@
var success = function(fileEntry) {
deferred.resolve(fileEntry);
};
- fs.root.getFile(fileName, {create: true, exclusive: false}, success, errorWhileGettingFileEntry);
+ // !! - ensures a boolean value
+ fs.root.getFile(fileName, {create: !!createFlag, exclusive: false}, success, errorWhileGettingFileEntry);
} catch(e) {
deferred.reject(new Error(e));
} finally {
@@ -114,7 +115,7 @@
//promise returns the file
function getFile(fileName) {
- return getFileEntry(fileName).
+ return getFileEntry(fileName, true /* create */).
then(function(fileEntry){
var deferred = Q.defer();
@@ -170,7 +171,44 @@
return deferred.promise;
}
+ function writeToFile(fileName, contents, append) {
+ return getFileEntry(fileName, true)
+ .then(function(fileEntry){
+ var deferred = Q.defer();
+
+ var errorGettingFileWriter = function(error) {
+ var str = "There was an error writing the file." + JSON.stringify(error);
+ deferred.reject(new Error(str));
+ };
+
+ var gotFileWriter = function(writer) {
+ writer.onwrite = deferred.resolve;
+ writer.onerror = function(evt) {
+ deferred.reject(new Error(evt));
+ };
+ if(append){
+ writer.seek(writer.length);
+ }
+ writer.write(contents);
+ };
+ fileEntry.createWriter(gotFileWriter, errorGettingFileWriter);
+ return deferred.promise;
+ });
+ }
+
return {
+ doesFileExist : function(fileName){
+ return initialiseFileSystem()
+ .then(function(){
+ return getFileEntry(fileName, false /* create */);
+ })
+ .then(function(){
+ return true;
+ }, function(){
+ return false;
+ });
+ },
+
// returns a promise with a full path to the dir
ensureDirectoryExists : function(directory) {
return initialiseFileSystem()
@@ -283,25 +321,15 @@
writeFileContents : function(fileName, contents) {
return initialiseFileSystem()
.then(function(){
- return getFileEntry(fileName);
- })
- .then(function(fileEntry){
- var deferred = Q.defer();
-
- var errorGettingFileWriter = function(error) {
- var str = "There was an error writing the file." + JSON.stringify(error);
- deferred.reject(new Error(str));
- };
+ return writeToFile(fileName, contents, false /* append */);
+ });
+ },
- var gotFileWriter = function(writer) {
- writer.onwrite = deferred.resolve;
- writer.onerror = function(evt) {
- deferred.reject(new Error(evt));
- };
- writer.write(contents);
- };
- fileEntry.createWriter(gotFileWriter, errorGettingFileWriter);
- return deferred.promise;
+ //returns a promise when file is appended
+ appendFileContents : function(fileName, contents) {
+ return initialiseFileSystem()
+ .then(function(){
+ return writeToFile(fileName, contents, true /* append */);
});
},
[18/30] git commit: Bugfixes. Extension extraction,
Uri encoding during app download. Unzip.
Posted by ag...@apache.org.
Bugfixes. Extension extraction, Uri encoding during app download. Unzip.
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/830dc5d9
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/830dc5d9
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/830dc5d9
Branch: refs/heads/master
Commit: 830dc5d9d1883f9c1e712ef259c434d288bd9fde
Parents: 94edf0c
Author: Shravan Narayan <sh...@google.com>
Authored: Sun May 12 01:11:04 2013 -0400
Committer: Shravan Narayan <sh...@google.com>
Committed: Mon May 13 18:07:18 2013 -0400
----------------------------------------------------------------------
www/cdvah_js/AddCtrl.js | 14 ++++-----
www/cdvah_js/AppsService.js | 10 +++---
www/cdvah_js/ContextMenu.js | 39 ++++++++++++++++-----------
www/cdvah_js/ResourcesLoader.js | 49 ++++++++++++++++++---------------
4 files changed, 61 insertions(+), 51 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/830dc5d9/www/cdvah_js/AddCtrl.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/AddCtrl.js b/www/cdvah_js/AddCtrl.js
index b536d87..8827b1d 100644
--- a/www/cdvah_js/AddCtrl.js
+++ b/www/cdvah_js/AddCtrl.js
@@ -26,14 +26,12 @@
serviceCall = AppsService.addAppFromServe($scope.appData.appName, $scope.appData.appSourceServe);
}
- if(serviceCall) {
- serviceCall.then(function() {
- alert("Successfully installed");
- }, function(error) {
- console.error(error);
- alert("Unable to add application because: \n" + error);
- });
- }
+ serviceCall && serviceCall.then(function() {
+ alert("Successfully installed");
+ }, function(error) {
+ console.error(error);
+ alert("Unable to add application because: \n" + error);
+ });
};
}]);
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/830dc5d9/www/cdvah_js/AppsService.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/AppsService.js b/www/cdvah_js/AppsService.js
index f0d1b86..34358ce 100644
--- a/www/cdvah_js/AppsService.js
+++ b/www/cdvah_js/AppsService.js
@@ -20,7 +20,7 @@
}
function addNewAppFromPattern(appName, appSourcePattern) {
- var _fullFilePath;
+ var fullFilePath;
return ResourcesLoader.deleteDirectory(INSTALL_DIRECTORY + appName)
.then(function(){
@@ -31,16 +31,16 @@
}
throw new Error("App Harness does not know how to install an app from the pattern: " + appSourcePattern);
})
- .then(function(fullFilePath){
- _fullFilePath = fullFilePath;
+ .then(function(_fullFilePath){
+ fullFilePath = _fullFilePath;
return ResourcesLoader.ensureDirectoryExists(INSTALL_DIRECTORY + appName);
})
.then(function(directoryPath){
- var extension = grabExtensionFromUri(appSourcePattern);
+ var extension = grabExtensionFromUri(fullFilePath);
if(!extensionHandlers[extension]) {
throw new Error("No handler for extension " + extension + " found");
}
- return extensionHandlers[extension].extractPackageToDirectory(_fullFilePath, directoryPath);
+ return extensionHandlers[extension].extractPackageToDirectory(fullFilePath, directoryPath);
})
.then(function(){
return registerApp(appName, "pattern", appSourcePattern);
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/830dc5d9/www/cdvah_js/ContextMenu.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/ContextMenu.js b/www/cdvah_js/ContextMenu.js
index 452f656..bcfa1b6 100644
--- a/www/cdvah_js/ContextMenu.js
+++ b/www/cdvah_js/ContextMenu.js
@@ -23,22 +23,6 @@
}, false);
}
- function setupIframeMessaging(){
- window.addEventListener("message", function(e){
- if(e.data === "ContextMenuUpdate"){
- onContextMenuUpdateClicked();
- } else if(e.data === "ContextMenuRestart"){
- onContextMenuRestartClicked();
- } else if(e.data === "ContextMenuFirebug"){
- onContextMenuFirebugClicked();
- } else if(e.data === "ContextMenuMainMenu"){
- onContextMenuMainMenuClicked();
- }else if(e.data === "ContextMenuHide"){
- onContextMenuHideClicked();
- }
- } , false);
- }
-
function onContextMenuUpdateClicked(){
window.location = "app-bundle:///cdvah_index.html#/?updateLastLaunched=true";
}
@@ -76,6 +60,29 @@
document.getElementById(contextMenuIframe).style.display = "none";
}
+ var messageHandler = {
+ "ContextMenuUpdate" : onContextMenuUpdateClicked,
+ "ContextMenuRestart" : onContextMenuRestartClicked,
+ "ContextMenuFirebug" : onContextMenuFirebugClicked,
+ "ContextMenuMainMenu" : onContextMenuMainMenuClicked,
+ "ContextMenuHide" : onContextMenuHideClicked,
+ "ContextMenuWeinre" : onContextMenuWeinreNameChanged
+ };
+ function setupIframeMessaging(){
+ window.addEventListener("message", function(e){
+ var messageParts = [ e.data ];
+ var location = e.data.indexOf(":");
+ if(location !== -1){
+ messageParts = [ e.data.substring(0, location),
+ e.data.substring(location + 1)
+ ];
+ }
+ if(messageHandler[messageParts[0]]){
+ messageHandler[messageParts[0]](messageParts[1]);
+ }
+ } , false);
+ }
+
function loadFirebug(startOpened){
var el = document.createElement("script");
el.setAttribute("id", "FirebugLite");
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/830dc5d9/www/cdvah_js/ResourcesLoader.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/ResourcesLoader.js b/www/cdvah_js/ResourcesLoader.js
index b1e55ee..1f84681 100644
--- a/www/cdvah_js/ResourcesLoader.js
+++ b/www/cdvah_js/ResourcesLoader.js
@@ -52,8 +52,7 @@
};
var fileTransfer = new $window.FileTransfer();
- var uri = encodeURI(url);
- fileTransfer.download(uri, fullFilePath, downloadSuccess, downloadFail);
+ fileTransfer.download(url, fullFilePath, downloadSuccess, downloadFail);
} catch(e) {
deferred.reject(new Error(e));
} finally {
@@ -179,6 +178,24 @@
return deferred.promise;
}
+ function ensureDirectoryExists(directory){
+ return Q.fcall(function(){
+ directory = truncateToDirectoryPath(directory);
+ directory = fixFilePath(directory);
+ var segments = getPathSegments(directory);
+ var currentDir = directory.charAt(0) === "/"? "/" : "";
+ var promiseArr = [];
+ while(segments.length !== 0) {
+ currentDir += segments.shift() + "/";
+ promiseArr.push(ensureSingleDirectoryExists(currentDir));
+ }
+ return Q.all(promiseArr);
+ })
+ .then(function(paths){
+ return paths[paths.length - 1];
+ });
+ }
+
function writeToFile(fileName, contents, append) {
return getFileEntry(fileName, true)
.then(function(fileEntry){
@@ -238,19 +255,7 @@
ensureDirectoryExists : function(directory) {
return initialiseFileSystem()
.then(function(){
- directory = truncateToDirectoryPath(directory);
- directory = fixFilePath(directory);
- var segments = getPathSegments(directory);
- var currentDir = directory.charAt(0) === "/"? "/" : "";
- var promiseArr = [];
- while(segments.length !== 0) {
- currentDir += segments.shift() + "/";
- promiseArr.push(ensureSingleDirectoryExists(currentDir));
- }
- return Q.all(promiseArr);
- })
- .then(function(paths){
- return paths[paths.length - 1];
+ return ensureDirectoryExists(directory);
});
},
@@ -405,10 +410,13 @@
},
extractZipFile : function(fileName, outputDirectory){
- var deferred = Q.defer();
+ return initialiseFileSystem()
+ .then(function(){
+ return ensureDirectoryExists(outputDirectory);
+ })
+ .then(function(){
+ var deferred = Q.defer();
- //will throw an exception if the zip plugin is not loaded
- try {
var onZipDone = function(returnCode) {
if(returnCode !== 0) {
deferred.reject(new Error("Something went wrong during the unzipping of: " + fileName));
@@ -419,11 +427,8 @@
/* global zip */
zip.unzip(fileName, outputDirectory, onZipDone);
- } catch(e) {
- deferred.reject(e);
- } finally {
return deferred.promise;
- }
+ });
},
xhrGet : xhrGet
[27/30] git commit: Revert "Support chrome webstore links. Updated to
support new app dir structure."
Posted by ag...@apache.org.
Revert "Support chrome webstore links. Updated to support new app dir structure."
This reverts commit 9f0d462b4b1fd9137765fe8d85e076146daf4abc.
Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/6d9f5c9a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/6d9f5c9a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/6d9f5c9a
Branch: refs/heads/master
Commit: 6d9f5c9af590e228a989ed4457e4dd0f45e9ea98
Parents: 1105393
Author: Braden Shepherdson <br...@gmail.com>
Authored: Fri May 17 12:27:05 2013 -0400
Committer: Braden Shepherdson <br...@gmail.com>
Committed: Fri May 17 12:27:05 2013 -0400
----------------------------------------------------------------------
www/cdvah_index.html | 1 -
www/cdvah_js/CrxDownloader.js | 31 ----------------
www/cdvah_js/CrxPackageHandler.js | 60 ++++++++++++++------------------
3 files changed, 26 insertions(+), 66 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/6d9f5c9a/www/cdvah_index.html
----------------------------------------------------------------------
diff --git a/www/cdvah_index.html b/www/cdvah_index.html
index 77bbd2b..3eaede1 100644
--- a/www/cdvah_index.html
+++ b/www/cdvah_index.html
@@ -13,7 +13,6 @@
<script type="text/javascript" src="cdvah_js/AppsService.js"></script>
<script type="text/javascript" src="cdvah_js/AppBundleAlias.js"></script>
<script type="text/javascript" src="cdvah_js/KnownExtensionDownloader.js"></script>
- <script type="text/javascript" src="cdvah_js/CrxDownloader.js"></script>
<script type="text/javascript" src="cdvah_js/CdvhPackageHandler.js"></script>
<script type="text/javascript" src="cdvah_js/CrxPackageHandler.js"></script>
<script type="text/javascript" src="cdvah_js/ListCtrl.js"></script>
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/6d9f5c9a/www/cdvah_js/CrxDownloader.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/CrxDownloader.js b/www/cdvah_js/CrxDownloader.js
deleted file mode 100644
index 0388a08..0000000
--- a/www/cdvah_js/CrxDownloader.js
+++ /dev/null
@@ -1,31 +0,0 @@
-(function(){
- "use strict";
- /* global myApp */
- myApp.run(["AppsService", "ResourcesLoader", function(AppsService, ResourcesLoader){
-
- function isChromeWebStoreUri(pattern){
- var regexUri = /^https:\/\/chrome.google.com\/webstore\/detail\/.*?\/[a-z]{32}((\?|#|\/).*)?$/;
- var ret = (pattern.search(regexUri) !== -1);
- return ret;
- }
-
- AppsService.registerPatternDownloader({
- canHandleSourcePattern : isChromeWebStoreUri,
-
- downloadFromPattern : function (appName, pattern, tempDirectory) {
- var fileName = tempDirectory + appName + ".crx";
- var chromeAppIdRegex = /^https:\/\/chrome\.google\.com\/webstore\/detail\/.*?\/([a-z]{32})/;
- // Two results expected.
- // 1 - the entire match of the regex
- // 2 - the match of the capture group i.e. the app id
- var matches = pattern.match(chromeAppIdRegex);
- if(!matches || matches.length !== 2){
- throw new Error("Invalid url for chrome web store");
- }
- var sourceUrl = "https://clients2.google.com/service/update2/crx?response=redirect&x=id%3D" + matches[1] + "%26uc";
- return ResourcesLoader.downloadFromUrl(sourceUrl, fileName);
- }
- }, 500 /* assign a priority */);
-
- }]);
-})();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/6d9f5c9a/www/cdvah_js/CrxPackageHandler.js
----------------------------------------------------------------------
diff --git a/www/cdvah_js/CrxPackageHandler.js b/www/cdvah_js/CrxPackageHandler.js
index e4b4e7b..2627fd7 100644
--- a/www/cdvah_js/CrxPackageHandler.js
+++ b/www/cdvah_js/CrxPackageHandler.js
@@ -1,9 +1,7 @@
(function(){
"use strict";
/* global myApp */
- myApp.run(["AppsService", "ResourcesLoader", "ContextMenuInjectScript", function(AppsService, ResourcesLoader, ContextMenuInjectScript){
-
- var platformId = cordova.require("cordova/platform").id;
+ myApp.run(["AppsService", "ResourcesLoader", function(AppsService, ResourcesLoader){
function copyFile(startUrl, targetLocation){
/************ Begin Work around for File system bug ************/
@@ -21,42 +19,36 @@
}
AppsService.registerPackageHandler("crx", {
- extractPackageToDirectory : function (appName, fileName, outputDirectory){
- var dataToAppend = ContextMenuInjectScript.getInjectString(appName);
- var platformDirectory = outputDirectory + "/" + platformId + "/";
- var platformWWWDirectory = platformDirectory + "www/";
- var cordovaFile = platformWWWDirectory + "cordova.js";
-
- // We need to
- // 1) Copy over the files required to convert a crx to a normal web app
- // 2) Modify the cordova.js file
- return ResourcesLoader.extractZipFile(fileName, platformWWWDirectory)
+ extractPackageToDirectory : function (fileName, outputDirectory){
+ return ResourcesLoader.ensureDirectoryExists(outputDirectory + "/www")
.then(function(){
- return Q.all([
- copyFile("app-bundle:///cordova.js", cordovaFile),
- copyFile("app-bundle:///crx_files/config." + platformId + ".xml", platformDirectory + "config.xml"),
- copyFile("app-bundle:///crx_files/www/cordova_plugins.json", platformWWWDirectory + "cordova_plugins.json"),
- copyFile("app-bundle:///crx_files/www/chromeapp.html", platformWWWDirectory + "chromeapp.html"),
- copyFile("app-bundle:///crx_files/www/chromeappstyles.css", platformWWWDirectory + "chromeappstyles.css"),
- copyFile("app-bundle:///crx_files/www/chromebgpage.html", platformWWWDirectory + "chromebgpage.html"),
- copyFile("app-bundle:///crx_files/www/plugins/chrome/api/app/runtime.js", platformWWWDirectory + "plugins/chrome/api/app/runtime.js"),
- copyFile("app-bundle:///crx_files/www/plugins/chrome/api/app/window.js", platformWWWDirectory + "plugins/chrome/api/app/window.js"),
- copyFile("app-bundle:///crx_files/www/plugins/chrome/api/bootstrap.js", platformWWWDirectory + "plugins/chrome/api/bootstrap.js"),
- copyFile("app-bundle:///crx_files/www/plugins/chrome/api/helpers/stubs.js", platformWWWDirectory + "plugins/chrome/api/helpers/stubs.js"),
- copyFile("app-bundle:///crx_files/www/plugins/chrome/api/mobile.js", platformWWWDirectory + "plugins/chrome/api/mobile.js"),
- copyFile("app-bundle:///crx_files/www/plugins/chrome/api/runtime.js", platformWWWDirectory + "plugins/chrome/api/runtime.js"),
- copyFile("app-bundle:///crx_files/www/plugins/chrome.common/events.js", platformWWWDirectory + "plugins/chrome.common/events.js"),
- copyFile("app-bundle:///crx_files/www/plugins/chrome.fileSystem/fileSystem.js", platformWWWDirectory + "plugins/chrome.fileSystem/fileSystem.js"),
- copyFile("app-bundle:///crx_files/www/plugins/chrome.i18n/i18n.js", platformWWWDirectory + "plugins/chrome.i18n/i18n.js"),
- copyFile("app-bundle:///crx_files/www/plugins/chrome.identity/identity.js", platformWWWDirectory + "plugins/chrome.identity/identity.js"),
- copyFile("app-bundle:///crx_files/www/plugins/chrome.socket/socket.js", platformWWWDirectory + "plugins/chrome.socket/socket.js"),
- copyFile("app-bundle:///crx_files/www/plugins/chrome.storage/storage.js", platformWWWDirectory + "plugins/chrome.storage/storage.js")
- ]);
+ return ResourcesLoader.extractZipFile(fileName, outputDirectory + "/www");
})
.then(function(){
- return ResourcesLoader.appendFileContents(cordovaFile, dataToAppend);
+ return Q.all([
+ copyFile("cdv-app-harness:///direct/cordova.js", outputDirectory + "/www/cordova.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/config.android.xml", outputDirectory + "/config.android.xml"),
+ copyFile("cdv-app-harness:///direct/crx_files/config.ios.xml", outputDirectory + "/config.ios.xml"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/cordova_plugins.json", outputDirectory + "/www/cordova_plugins.json"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/chromeapp.html", outputDirectory + "/www/chromeapp.html"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/chromeappstyles.css", outputDirectory + "/www/chromeappstyles.css"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/chromebgpage.html", outputDirectory + "/www/chromebgpage.html"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/app/runtime.js", outputDirectory + "/www/plugins/chrome/api/app/runtime.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/app/window.js", outputDirectory + "/www/plugins/chrome/api/app/window.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/bootstrap.js", outputDirectory + "/www/plugins/chrome/api/bootstrap.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/helpers/stubs.js", outputDirectory + "/www/plugins/chrome/api/helpers/stubs.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/mobile.js", outputDirectory + "/www/plugins/chrome/api/mobile.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome/api/runtime.js", outputDirectory + "/www/plugins/chrome/api/runtime.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.common/events.js", outputDirectory + "/www/plugins/chrome.common/events.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.fileSystem/fileSystem.js", outputDirectory + "/www/plugins/chrome.fileSystem/fileSystem.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.i18n/i18n.js", outputDirectory + "/www/plugins/chrome.i18n/i18n.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.identity/identity.js", outputDirectory + "/www/plugins/chrome.identity/identity.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.socket/socket.js", outputDirectory + "/www/plugins/chrome.socket/socket.js"),
+ copyFile("cdv-app-harness:///direct/crx_files/www/plugins/chrome.storage/storage.js", outputDirectory + "/www/plugins/chrome.storage/storage.js")
+ ]);
});
}
});
+
}]);
})();
\ No newline at end of file
[09/30] New filenames.Url aliases.(New AppBundle plugin needed).Desc
cont below Android has a bug where the web view will not throw intercept
events if you are navigating to a location that matches a filename in your
bundle. Thus in order to support url
Posted by ag...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/js/libs/q.min.js
----------------------------------------------------------------------
diff --git a/www/js/libs/q.min.js b/www/js/libs/q.min.js
deleted file mode 100644
index 7a27b9a..0000000
--- a/www/js/libs/q.min.js
+++ /dev/null
@@ -1,19 +0,0 @@
-(function(k){"function"===typeof bootstrap?bootstrap("promise",k):"object"===typeof exports?module.exports=k():"function"===typeof define&&define.amd?define(k):"undefined"!==typeof ses?ses.ok()&&(ses.makeQ=k):Q=k()})(function(){function k(a){var b=Function.call;return function(){return b.apply(a,arguments)}}function L(a,b){b.stack&&("object"===typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(M))&&(a.stack=N(a.stack)+"\n"+M+"\n"+N(b.stack))}function N(a){for(var a=a.split("\n"),b=[],d=0;d<a.length;++d){var j=
-a[d],c;if(c=/at .+ \((.*):(\d+):\d+\)/.exec(j)){var g=c[2];c=c[1]===O&&g>=aa&&g<=ba}else c=!1;!c&&!(-1!==j.indexOf("(module.js:")||-1!==j.indexOf("(node.js:"))&&b.push(j)}return b.join("\n")}function P(){if(Error.captureStackTrace){var a,b,d=Error.prepareStackTrace;Error.prepareStackTrace=function(d,c){a=c[1].getFileName();b=c[1].getLineNumber()};Error().stack;Error.prepareStackTrace=d;O=a;return b}}function c(a){return p(a)}function i(){function a(a){b&&(j=p(a),t(b,function(a,b){l(function(){j.promiseDispatch.apply(j,
-b)})},void 0),d=b=void 0)}var b=[],d=[],j,e=C(i.prototype),g=C(m.prototype);g.promiseDispatch=function(a,c,g){var e=h(arguments);b?(b.push(e),"when"===c&&g[1]&&d.push(g[1])):l(function(){j.promiseDispatch.apply(j,e)})};g.valueOf=function(){if(b)return g;var a=o(j);u(a)&&(j=a);return a};Error.captureStackTrace&&0<c.longStackJumpLimit&&(Error.captureStackTrace(g,i),g.stack=g.stack.substring(g.stack.indexOf("\n")+1));e.promise=g;e.resolve=a;e.fulfill=function(b){a(D(b))};e.reject=function(b){a(n(b))};
-e.notify=function(a){b&&t(d,function(b,d){l(function(){d(a)})},void 0)};return e}function m(a,b,d,c,e){void 0===b&&(b=function(a){return n(Error("Promise does not support operation: "+a))});var g=C(m.prototype);g.promiseDispatch=function(d,c,j){var e;try{e=a[c]?a[c].apply(g,j):b.call(g,c,j)}catch(f){e=n(f)}d&&d(e)};d&&(g.valueOf=d);e&&(g.exception=c);return g}function o(a){return u(a)?a.valueOf():a}function u(a){return a&&"function"===typeof a.promiseDispatch}function E(a){return a&&"function"===
-typeof a.then}function F(a){return!E(o(a))}function R(a){a=o(a);return u(a)&&"exception"in a}function n(a){var b=m({when:function(b){if(b){var c=ca(G,this);-1!==c&&(v.splice(c,1),G.splice(c,1))}return b?b(a):this}},function(){return n(a)},function(){return this},a,!0);!S&&("undefined"!==typeof window&&!window.Touch&&window.console)&&console.log("Should be empty:",v);S=!0;G.push(b);v.push(a);return b}function D(a){return m({when:function(){return a},get:function(b){return a[b]},set:function(b,d){a[b]=
-d},"delete":function(b){delete a[b]},post:function(b,d){return null===b||void 0===b?a.apply(void 0,d):a[b].apply(a,d)},apply:function(b,d){return a.apply(b,d)},keys:function(){return da(a)}},void 0,function(){return a})}function p(a){if(u(a))return a;a=o(a);if(E(a)){var b=a,d=i();l(function(){try{b.then(d.resolve,d.reject,d.notify)}catch(a){d.reject(a)}});return d.promise}return D(a)}function f(a,b,d,j){function e(a){try{return"function"===typeof b?b(a):a}catch(d){return n(d)}}function g(a){if("function"===
-typeof d){L(a,k);try{return d(a)}catch(b){return n(b)}}return n(a)}var f=i(),h=!1,k=p(a);l(function(){k.promiseDispatch(function(a){h||(h=!0,f.resolve(e(a)))},"when",[function(a){h||(h=!0,f.resolve(g(a)))}])});k.promiseDispatch(void 0,"when",[void 0,function(a){var b,d=!1;try{b="function"===typeof j?j(a):a}catch(e){if(d=!0,c.onerror)c.onerror(e);else throw e;}d||f.notify(b)}]);return f.promise}function T(a,b,d){return f(a,function(a){return A(a).then(function(a){return b.apply(void 0,a)},d)},d)}function w(a,
-b,d){var c=i();l(function(){p(a).promiseDispatch(c.resolve,b,d)});return c.promise}function q(a){return function(b){var d=h(arguments,1);return w(b,a,d)}}function U(a,b){var d=h(arguments,2);return H(a,b,d)}function r(a,b){return w(a,"apply",[void 0,b])}function I(a){var b=h(arguments,1);return r(a,b)}function A(a){return f(a,function(a){var d=0,c=i();t(a,function(e,g,h){F(g)?a[h]=o(g):(++d,f(g,function(e){a[h]=e;0===--d&&c.resolve(a)},c.reject))},void 0);0===d&&c.resolve(a);return c.promise})}function V(a,
-b){return f(a,void 0,b)}var aa=P(),O,W=function(){},l;if("undefined"!==typeof process)l=process.nextTick;else if("function"===typeof setImmediate)l="undefined"!==typeof window?setImmediate.bind(window):setImmediate;else{var X=function(){--s;if(++J>=x){J=0;x*=4;for(var a=y&&Math.min(y-1,x);s<a;)++s,B()}for(;y;)--y,z=z.next,a=z.task,z.task=void 0,a();J=0},z={task:void 0,next:null},Y=z,x=2,s=0,y=0,J=0,B;l=function(a){Y=Y.next={task:a,next:null};s<++y&&s<x&&(++s,B())};if("undefined"!==typeof MessageChannel){var Z=
-new MessageChannel;Z.port1.onmessage=X;B=function(){Z.port2.postMessage(0)}}else B=function(){setTimeout(X,0)}}var h=k(Array.prototype.slice),t=k(Array.prototype.reduce||function(a,b){var d=0,c=this.length;if(1===arguments.length){do{if(d in this){b=this[d++];break}if(++d>=c)throw new TypeError;}while(1)}for(;d<c;d++)d in this&&(b=a(b,this[d],d));return b}),ca=k(Array.prototype.indexOf||function(a){for(var b=0;b<this.length;b++)if(this[b]===a)return b;return-1}),$=k(Array.prototype.map||function(a,
-b){var d=this,c=[];t(d,function(e,g,f){c.push(a.call(b,g,f,d))},void 0);return c}),C=Object.create||function(a){function b(){}b.prototype=a;return new b},ea=k(Object.prototype.hasOwnProperty),da=Object.keys||function(a){var b=[],d;for(d in a)ea(a,d)&&b.push(d);return b},fa=k(Object.prototype.toString),K;K="undefined"!==typeof ReturnValue?ReturnValue:function(a){this.value=a};c.longStackJumpLimit=1;var M="From previous event:";c.nextTick=l;c.defer=i;i.prototype.makeNodeResolver=function(){var a=this;
-return function(b,d){b?a.reject(b):2<arguments.length?a.resolve(h(arguments,1)):a.resolve(d)}};c.promise=function(a){var b=i();I(a,b.resolve,b.reject,b.notify).fail(b.reject);return b.promise};c.makePromise=m;m.prototype.then=function(a,b,d){return f(this,a,b,d)};m.prototype.thenResolve=function(a){return f(this,function(){return a})};m.prototype.thenReject=function(a){return f(this,function(){throw a;})};t("isFulfilled isRejected isPending dispatch when spread get put set del delete post send invoke keys fapply fcall fbind all allResolved timeout delay catch finally fail fin progress done nfcall nfapply nfbind denodeify nbind ncall napply nbind npost nsend ninvoke nodeify".split(" "),
-function(a,b){m.prototype[b]=function(){return c[b].apply(c,[this].concat(h(arguments)))}},void 0);m.prototype.toSource=function(){return this.toString()};m.prototype.toString=function(){return"[object Promise]"};c.nearer=o;c.isPromise=u;c.isPromiseAlike=E;c.isPending=function(a){return!F(a)&&!R(a)};c.isFulfilled=F;c.isRejected=R;var G=[],v=[],S;if("undefined"!==typeof process&&process.on)process.on("exit",function(){for(var a=0;a<v.length;a++){var b=v[a];b&&"undefined"!==typeof b.stack?console.warn("Unhandled rejected promise:",
-b.stack):console.warn("Unhandled rejected promise (no stack):",b)}});c.reject=n;c.fulfill=D;c.resolve=p;c.master=function(a){return m({isDef:function(){}},function(b,d){return w(a,b,d)},function(){return o(a)})};c.when=f;c.spread=T;c.async=function(a){return function(){function b(a,b){var h;try{h=d[a](b)}catch(i){return"[object StopIteration]"===fa(i)||i instanceof K?i.value:n(i)}return f(h,c,e)}var d=a.apply(this,arguments),c=b.bind(b,"send"),e=b.bind(b,"throw");return c()}};c["return"]=function(a){throw new K(a);
-};c.promised=function(a){return function(){return T([this,A(arguments)],function(b,d){return a.apply(b,d)})}};c.dispatch=w;c.dispatcher=q;c.get=q("get");c.set=q("set");c["delete"]=c.del=q("delete");var H=c.post=q("post");c.send=U;c.invoke=U;c.fapply=r;c["try"]=I;c.fcall=I;c.fbind=function(a){var b=h(arguments,1);return function(){var d=b.concat(h(arguments));return w(a,"apply",[this,d])}};c.keys=q("keys");c.all=A;c.allResolved=function(a){return f(a,function(a){a=$(a,p);return f(A($(a,function(a){return f(a,
-W,W)})),function(){return a})})};c["catch"]=c.fail=V;c.progress=function(a,b){return f(a,void 0,void 0,b)};c["finally"]=c.fin=function(a,b){return f(a,function(a){return f(b(),function(){return a})},function(a){return f(b(),function(){return n(a)})})};c.done=function(a,b,d,j){var e=function(b){l(function(){L(b,a);if(c.onerror)c.onerror(b);else throw b;})},b=b||d||j?f(a,b,d,j):a;"object"===typeof process&&(process&&process.domain)&&(e=process.domain.bind(e));V(b,e)};c.timeout=function(a,b){var d=i(),
-c=setTimeout(function(){d.reject(Error("Timed out after "+b+" ms"))},b);f(a,function(a){clearTimeout(c);d.resolve(a)},function(a){clearTimeout(c);d.reject(a)},d.notify);return d.promise};c.delay=function(a,b){void 0===b&&(b=a,a=void 0);var d=i();f(a,void 0,void 0,d.notify);setTimeout(function(){d.resolve(a)},b);return d.promise};c.nfapply=function(a,b){var d=h(b),c=i();d.push(c.makeNodeResolver());r(a,d).fail(c.reject);return c.promise};c.nfcall=function(a){var b=h(arguments,1),d=i();b.push(d.makeNodeResolver());
-r(a,b).fail(d.reject);return d.promise};c.nfbind=function(a){var b=h(arguments,1);return function(){var d=b.concat(h(arguments)),c=i();d.push(c.makeNodeResolver());r(a,d).fail(c.reject);return c.promise}};c.denodeify=c.nfbind;c.nbind=function(a,b){var d=h(arguments,2);return function(){var c=d.concat(h(arguments)),e=i();c.push(e.makeNodeResolver());r(function(){return a.apply(b,arguments)},c).fail(e.reject);return e.promise}};c.npost=function(a,b,d){var d=h(d||[]),c=i();d.push(c.makeNodeResolver());
-H(a,b,d).fail(c.reject);return c.promise};c.nsend=function(a,b){var c=h(arguments,2),f=i();c.push(f.makeNodeResolver());H(a,b,c).fail(f.reject);return f.promise};c.ninvoke=c.nsend;c.nodeify=function(a,b){if(b)a.then(function(a){l(function(){b(null,a)})},function(a){l(function(){b(a)})});else return a};var ba=P();return c});
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/views/add.html
----------------------------------------------------------------------
diff --git a/www/views/add.html b/www/views/add.html
deleted file mode 100644
index 902c46d..0000000
--- a/www/views/add.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<form name="addForm" ng-controller="AddCtrl">
- <label for="inputAppName">Enter the App Name</label><br />
- <input type="text" name="appName" ng-model="appName" ng-pattern="/^[\w ]*$/" ng-maxlength="64" required />
- <span ng-show="addForm.appName.$error.required">Required</span>
- <span ng-show="addForm.appName.$error.pattern">Invalid characters used</span>
- <span ng-show="addForm.appName.$error.maxlength">Too long</span>
- <br />
-
- <input type="radio" ng-model="appSource" name="appSource" value="pattern" ng-init="appPatternChecked=true; appSource='pattern'" ng-checked="appPatternChecked" />
- <label for="inputAppPattern">Enter the URL to a file</label><br />
- <input id="inputAppPattern" type="text" name="appSourcePattern" ng-model="appSourcePattern" ng-disabled="!appPatternChecked" ng-required="appPatternChecked" />
- <span ng-show="addForm.appSourcePattern.$error.required">Required</span>
- <br />
- <button ng-click="addApp(appName, appSource, appSourcePattern)" ng-disabled="!(addForm.$valid)">Add</button>
- <br />
- <a href="#/">Back To Main Menu</a>
-</form>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/771f02b2/www/views/list.html
----------------------------------------------------------------------
diff --git a/www/views/list.html b/www/views/list.html
deleted file mode 100644
index c111953..0000000
--- a/www/views/list.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<ul>
- <li ng-repeat="app in appsList">
- <p>{{app.Name}}</p>
- <p>Installed on: {{app.Installed}}</p>
- <button ng-click="launchApp(app.Name)">Launch</button>
- <button ng-click="refreshApp(app.Name)">Update</button>
- <button ng-click="removeApp(app.Name)">Remove</button>
- </li>
-</ul>
-<button ng-click="loadAppsList()">Reload Apps List</button>
-<br />
-<a href="#/add">Add new App</a>
\ No newline at end of file