diff --git a/.DS_Store b/.DS_Store index 9e5de8c..e291428 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Android/plugin/ImageFilter.js b/Android/plugin/ImageFilter.js deleted file mode 100644 index 1ed5aef..0000000 --- a/Android/plugin/ImageFilter.js +++ /dev/null @@ -1,81 +0,0 @@ -var ImageFilter = function () {}; - -ImageFilter.prototype.clean = function (options) { - - PhoneGap.exec("ImageFilter.clean"); -}; -ImageFilter.prototype.none = function (done,options) { - //console.log(options+" "+done); - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - - return PhoneGap.exec(done,null,"ImageFilter","none",[defaults]); -}; -ImageFilter.prototype.sunnySide = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","sunnySide",[defaults]); -}; -ImageFilter.prototype.worn = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","worn",[defaults]); -}; -ImageFilter.prototype.vintage = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","vintage",[defaults]); -}; -ImageFilter.prototype.stark = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","stark",[defaults]); -}; -ImageFilter.prototype.pinhole = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","pinhole",[defaults]); -}; -ImageFilter.prototype.summer = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","summer",[defaults]); -}; -PhoneGap.addConstructor(function() { - PhoneGap.addPlugin("ImageFilter", new ImageFilter()); -}); \ No newline at end of file diff --git a/Android/plugin/com/phonegap/plugins/imageFilter/ImageFilter.java b/Android/plugin/com/phonegap/plugins/imageFilter/ImageFilter.java deleted file mode 100644 index 32c5be2..0000000 --- a/Android/plugin/com/phonegap/plugins/imageFilter/ImageFilter.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.phonegap.plugins.imageFilter; - -import org.json.JSONArray; - -import android.util.Log; - -import com.phonegap.api.Plugin; -import com.phonegap.api.PluginResult; -import com.phonegap.api.PluginResult.Status; - - -public class ImageFilter extends Plugin { - - @Override - public PluginResult execute(String action, JSONArray optionsArr, String callBackId){ - Log.d("imageFilter", "PLUGIN execute called with action: "+ action); - PluginResult result = null; - - final Filters filters = new Filters(); - - if(action.equalsIgnoreCase("none")){ - String fileInfo = filters.none(optionsArr); - result = new PluginResult(Status.OK, fileInfo); - } - if(action.equalsIgnoreCase("stark")){ - String fileInfo = filters.stark(optionsArr); - result = new PluginResult(Status.OK, fileInfo); - } - if(action.equalsIgnoreCase("sunnySide")){ - String fileInfo = filters.sunnyside(optionsArr); - result = new PluginResult(Status.OK, fileInfo); - } - if(action.equalsIgnoreCase("pinhole")){ - String fileInfo = filters.pinhole(optionsArr); - result = new PluginResult(Status.OK, fileInfo); - } - if(action.equalsIgnoreCase("vintage")){ - String fileInfo = filters.vintage(optionsArr); - result = new PluginResult(Status.OK, fileInfo); - } - if(action.equalsIgnoreCase("worn")){ - String fileInfo = filters.worn(optionsArr); - result = new PluginResult(Status.OK, fileInfo); - } - - return result; - } - -} \ No newline at end of file diff --git a/Android/project/AndroidManifest.xml b/Android/project/AndroidManifest.xml deleted file mode 100644 index 41606e7..0000000 --- a/Android/project/AndroidManifest.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Android/project/assets/www/css/style.css b/Android/project/assets/www/css/style.css deleted file mode 100644 index 8ea9325..0000000 --- a/Android/project/assets/www/css/style.css +++ /dev/null @@ -1,68 +0,0 @@ -*{ - margin:0px; -} -body { - height:100%; - width:100%; - font-family:'helvetica'; - font-size:12px; -} -#header { - width:320px; - position:relative; - top:0px; - left:0px; - margin-bottom:10px; -} -#wrapper { - width:100%; - margin:auto; - position:relative; -} -#buttons { - width:310px; - margin:auto; -} -.btn { - width:auto; - padding:10px; - background-color:#95abb7; - color:#fff; - font-size:15px; - border-radius:5px; - margin-bottom:10px; - font-weight:bold; - text-align:center; -} -.photo { - height:310px; - width:310px; - overflow:hidden; - position:relative; - margin:auto; - display:none; - margin-bottom:10px; -} -.photo img { - height:310px; - width:310px; -} -.filterIcon { - height:70px; - width:70px; - border-radius:5px; - overflow:hidden; - box-shadow:0px 0px 2px #222; -} -.filterText { - color:#222; - width:70px; - text-align:center; -} -.filter { - text-align:center; - width:70px; - float:left; - margin-right:10px; - margin-left:10px; -} \ No newline at end of file diff --git a/Android/project/assets/www/images/filters/none.png b/Android/project/assets/www/images/filters/none.png deleted file mode 100644 index e17ea9b..0000000 Binary files a/Android/project/assets/www/images/filters/none.png and /dev/null differ diff --git a/Android/project/assets/www/images/filters/stark.png b/Android/project/assets/www/images/filters/stark.png deleted file mode 100644 index 9fe311a..0000000 Binary files a/Android/project/assets/www/images/filters/stark.png and /dev/null differ diff --git a/Android/project/assets/www/images/filters/sunnySide.png b/Android/project/assets/www/images/filters/sunnySide.png deleted file mode 100644 index b73afe9..0000000 Binary files a/Android/project/assets/www/images/filters/sunnySide.png and /dev/null differ diff --git a/Android/project/assets/www/images/filters/vintage.png b/Android/project/assets/www/images/filters/vintage.png deleted file mode 100644 index 66618c8..0000000 Binary files a/Android/project/assets/www/images/filters/vintage.png and /dev/null differ diff --git a/Android/project/assets/www/images/filters/worn.png b/Android/project/assets/www/images/filters/worn.png deleted file mode 100644 index c5cd994..0000000 Binary files a/Android/project/assets/www/images/filters/worn.png and /dev/null differ diff --git a/Android/project/assets/www/images/header.png b/Android/project/assets/www/images/header.png deleted file mode 100644 index c8b4f49..0000000 Binary files a/Android/project/assets/www/images/header.png and /dev/null differ diff --git a/Android/project/assets/www/index.html b/Android/project/assets/www/index.html deleted file mode 100644 index e04a1cb..0000000 --- a/Android/project/assets/www/index.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
-
use camera
-
use library
-
- - - -
- -
- -
-
-
-
none
-
-
-
-
sunnySide
-
-
-
-
worn
-
-
-
-
vintage
-
-
-
-
stark
-
-
-
- - - -
-
- - diff --git a/Android/project/assets/www/js/core/jQuery.js b/Android/project/assets/www/js/core/jQuery.js deleted file mode 100644 index 198b3ff..0000000 --- a/Android/project/assets/www/js/core/jQuery.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.7.1 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; -f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() -{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/Android/project/assets/www/js/core/phonegap-1.4.1.js b/Android/project/assets/www/js/core/phonegap-1.4.1.js deleted file mode 100755 index 908b8a8..0000000 --- a/Android/project/assets/www/js/core/phonegap-1.4.1.js +++ /dev/null @@ -1,4586 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -// Version 1.2.0 - -if (typeof PhoneGap === "undefined") { - -/** - * The order of events during page load and PhoneGap startup is as follows: - * - * onDOMContentLoaded Internal event that is received when the web page is loaded and parsed. - * window.onload Body onload event. - * onNativeReady Internal event that indicates the PhoneGap native side is ready. - * onPhoneGapInit Internal event that kicks off creation of all PhoneGap JavaScript objects (runs constructors). - * onPhoneGapReady Internal event fired when all PhoneGap JavaScript objects have been created - * onPhoneGapInfoReady Internal event fired when device properties are available - * onDeviceReady User event fired to indicate that PhoneGap is ready - * onResume User event fired to indicate a start/resume lifecycle event - * onPause User event fired to indicate a pause lifecycle event - * onDestroy Internal event fired when app is being destroyed (User should use window.onunload event, not this one). - * - * The only PhoneGap events that user code should register for are: - * deviceready PhoneGap native code is initialized and PhoneGap APIs can be called from JavaScript - * pause App has moved to background - * resume App has returned to foreground - * - * Listeners can be registered as: - * document.addEventListener("deviceready", myDeviceReadyListener, false); - * document.addEventListener("resume", myResumeListener, false); - * document.addEventListener("pause", myPauseListener, false); - * - * The DOM lifecycle events should be used for saving and restoring state - * window.onload - * window.onunload - */ - -/** - * This represents the PhoneGap API itself, and provides a global namespace for accessing - * information about the state of PhoneGap. - * @class - */ -var PhoneGap = { - documentEventHandler: {}, // Collection of custom document event handlers - windowEventHandler: {} // Collection of custom window event handlers -}; - -/** - * List of resource files loaded by PhoneGap. - * This is used to ensure JS and other files are loaded only once. - */ -PhoneGap.resources = {base: true}; - -/** - * Determine if resource has been loaded by PhoneGap - * - * @param name - * @return - */ -PhoneGap.hasResource = function(name) { - return PhoneGap.resources[name]; -}; - -/** - * Add a resource to list of loaded resources by PhoneGap - * - * @param name - */ -PhoneGap.addResource = function(name) { - PhoneGap.resources[name] = true; -}; - -/** - * Custom pub-sub channel that can have functions subscribed to it - * @constructor - */ -PhoneGap.Channel = function (type) -{ - this.type = type; - this.handlers = {}; - this.guid = 0; - this.fired = false; - this.enabled = true; -}; - -/** - * Subscribes the given function to the channel. Any time that - * Channel.fire is called so too will the function. - * Optionally specify an execution context for the function - * and a guid that can be used to stop subscribing to the channel. - * Returns the guid. - */ -PhoneGap.Channel.prototype.subscribe = function(f, c, g) { - // need a function to call - if (f === null) { return; } - - var func = f; - if (typeof c === "object" && typeof f === "function") { func = PhoneGap.close(c, f); } - - g = g || func.observer_guid || f.observer_guid || this.guid++; - func.observer_guid = g; - f.observer_guid = g; - this.handlers[g] = func; - return g; -}; - -/** - * Like subscribe but the function is only called once and then it - * auto-unsubscribes itself. - */ -PhoneGap.Channel.prototype.subscribeOnce = function(f, c) { - var g = null; - var _this = this; - var m = function() { - f.apply(c || null, arguments); - _this.unsubscribe(g); - }; - if (this.fired) { - if (typeof c === "object" && typeof f === "function") { f = PhoneGap.close(c, f); } - f.apply(this, this.fireArgs); - } else { - g = this.subscribe(m); - } - return g; -}; - -/** - * Unsubscribes the function with the given guid from the channel. - */ -PhoneGap.Channel.prototype.unsubscribe = function(g) { - if (typeof g === "function") { g = g.observer_guid; } - this.handlers[g] = null; - delete this.handlers[g]; -}; - -/** - * Calls all functions subscribed to this channel. - */ -PhoneGap.Channel.prototype.fire = function(e) { - if (this.enabled) { - var fail = false; - var item, handler, rv; - for (item in this.handlers) { - if (this.handlers.hasOwnProperty(item)) { - handler = this.handlers[item]; - if (typeof handler === "function") { - rv = (handler.apply(this, arguments) === false); - fail = fail || rv; - } - } - } - this.fired = true; - this.fireArgs = arguments; - return !fail; - } - return true; -}; - -/** - * Calls the provided function only after all of the channels specified - * have been fired. - */ -PhoneGap.Channel.join = function(h, c) { - var i = c.length; - var f = function() { - if (!(--i)) { - h(); - } - }; - var len = i; - var j; - for (j=0; j - * - * @param name The plugin name - * @param obj The plugin object - */ -PhoneGap.addPlugin = function(name, obj) { - if (!window.plugins[name]) { - window.plugins[name] = obj; - } - else { - console.log("Error: Plugin "+name+" already exists."); - } -}; - -/** - * onDOMContentLoaded channel is fired when the DOM content - * of the page has been parsed. - */ -PhoneGap.onDOMContentLoaded = new PhoneGap.Channel('onDOMContentLoaded'); - -/** - * onNativeReady channel is fired when the PhoneGap native code - * has been initialized. - */ -PhoneGap.onNativeReady = new PhoneGap.Channel('onNativeReady'); - -/** - * onPhoneGapInit channel is fired when the web page is fully loaded and - * PhoneGap native code has been initialized. - */ -PhoneGap.onPhoneGapInit = new PhoneGap.Channel('onPhoneGapInit'); - -/** - * onPhoneGapReady channel is fired when the JS PhoneGap objects have been created. - */ -PhoneGap.onPhoneGapReady = new PhoneGap.Channel('onPhoneGapReady'); - -/** - * onPhoneGapInfoReady channel is fired when the PhoneGap device properties - * has been set. - */ -PhoneGap.onPhoneGapInfoReady = new PhoneGap.Channel('onPhoneGapInfoReady'); - -/** - * onPhoneGapConnectionReady channel is fired when the PhoneGap connection properties - * has been set. - */ -PhoneGap.onPhoneGapConnectionReady = new PhoneGap.Channel('onPhoneGapConnectionReady'); - -/** - * onDestroy channel is fired when the PhoneGap native code - * is destroyed. It is used internally. - * Window.onunload should be used by the user. - */ -PhoneGap.onDestroy = new PhoneGap.Channel('onDestroy'); -PhoneGap.onDestroy.subscribeOnce(function() { - PhoneGap.shuttingDown = true; -}); -PhoneGap.shuttingDown = false; - -// _nativeReady is global variable that the native side can set -// to signify that the native code is ready. It is a global since -// it may be called before any PhoneGap JS is ready. -if (typeof _nativeReady !== 'undefined') { PhoneGap.onNativeReady.fire(); } - -/** - * onDeviceReady is fired only after all PhoneGap objects are created and - * the device properties are set. - */ -PhoneGap.onDeviceReady = new PhoneGap.Channel('onDeviceReady'); - - -// Array of channels that must fire before "deviceready" is fired -PhoneGap.deviceReadyChannelsArray = [ PhoneGap.onPhoneGapReady, PhoneGap.onPhoneGapInfoReady, PhoneGap.onPhoneGapConnectionReady]; - -// Hashtable of user defined channels that must also fire before "deviceready" is fired -PhoneGap.deviceReadyChannelsMap = {}; - -/** - * Indicate that a feature needs to be initialized before it is ready to be used. - * This holds up PhoneGap's "deviceready" event until the feature has been initialized - * and PhoneGap.initComplete(feature) is called. - * - * @param feature {String} The unique feature name - */ -PhoneGap.waitForInitialization = function(feature) { - if (feature) { - var channel = new PhoneGap.Channel(feature); - PhoneGap.deviceReadyChannelsMap[feature] = channel; - PhoneGap.deviceReadyChannelsArray.push(channel); - } -}; - -/** - * Indicate that initialization code has completed and the feature is ready to be used. - * - * @param feature {String} The unique feature name - */ -PhoneGap.initializationComplete = function(feature) { - var channel = PhoneGap.deviceReadyChannelsMap[feature]; - if (channel) { - channel.fire(); - } -}; - -/** - * Create all PhoneGap objects once page has fully loaded and native side is ready. - */ -PhoneGap.Channel.join(function() { - - // Start listening for XHR callbacks - setTimeout(function() { - if (PhoneGap.UsePolling) { - PhoneGap.JSCallbackPolling(); - } - else { - var polling = prompt("usePolling", "gap_callbackServer:"); - PhoneGap.UsePolling = polling; - if (polling == "true") { - PhoneGap.UsePolling = true; - PhoneGap.JSCallbackPolling(); - } - else { - PhoneGap.UsePolling = false; - PhoneGap.JSCallback(); - } - } - }, 1); - - // Run PhoneGap constructors - PhoneGap.onPhoneGapInit.fire(); - - // Fire event to notify that all objects are created - PhoneGap.onPhoneGapReady.fire(); - - // Fire onDeviceReady event once all constructors have run and PhoneGap info has been - // received from native side, and any user defined initialization channels. - PhoneGap.Channel.join(function() { - // Let native code know we are inited on JS side - prompt("", "gap_init:"); - - PhoneGap.onDeviceReady.fire(); - }, PhoneGap.deviceReadyChannelsArray); - -}, [ PhoneGap.onDOMContentLoaded, PhoneGap.onNativeReady ]); - -// Listen for DOMContentLoaded and notify our channel subscribers -document.addEventListener('DOMContentLoaded', function() { - PhoneGap.onDOMContentLoaded.fire(); -}, false); - -// Intercept calls to document.addEventListener and watch for deviceready -PhoneGap.m_document_addEventListener = document.addEventListener; - -// Intercept calls to window.addEventListener -PhoneGap.m_window_addEventListener = window.addEventListener; - -/** - * Add a custom window event handler. - * - * @param {String} event The event name that callback handles - * @param {Function} callback The event handler - */ -PhoneGap.addWindowEventHandler = function(event, callback) { - PhoneGap.windowEventHandler[event] = callback; -}; - -/** - * Add a custom document event handler. - * - * @param {String} event The event name that callback handles - * @param {Function} callback The event handler - */ -PhoneGap.addDocumentEventHandler = function(event, callback) { - PhoneGap.documentEventHandler[event] = callback; -}; - -/** - * Intercept adding document event listeners and handle our own - * - * @param {Object} evt - * @param {Function} handler - * @param capture - */ -document.addEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - if (e === 'deviceready') { - PhoneGap.onDeviceReady.subscribeOnce(handler); - } - else { - // If subscribing to Android backbutton - if (e === 'backbutton') { - PhoneGap.exec(null, null, "App", "overrideBackbutton", [true]); - } - - // If subscribing to an event that is handled by a plugin - else if (typeof PhoneGap.documentEventHandler[e] !== "undefined") { - if (PhoneGap.documentEventHandler[e](e, handler, true)) { - return; // Stop default behavior - } - } - - PhoneGap.m_document_addEventListener.call(document, evt, handler, capture); - } -}; - -/** - * Intercept adding window event listeners and handle our own - * - * @param {Object} evt - * @param {Function} handler - * @param capture - */ -window.addEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - - // If subscribing to an event that is handled by a plugin - if (typeof PhoneGap.windowEventHandler[e] !== "undefined") { - if (PhoneGap.windowEventHandler[e](e, handler, true)) { - return; // Stop default behavior - } - } - - PhoneGap.m_window_addEventListener.call(window, evt, handler, capture); -}; - -// Intercept calls to document.removeEventListener and watch for events that -// are generated by PhoneGap native code -PhoneGap.m_document_removeEventListener = document.removeEventListener; - -// Intercept calls to window.removeEventListener -PhoneGap.m_window_removeEventListener = window.removeEventListener; - -/** - * Intercept removing document event listeners and handle our own - * - * @param {Object} evt - * @param {Function} handler - * @param capture - */ -document.removeEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - - // If unsubscribing to Android backbutton - if (e === 'backbutton') { - PhoneGap.exec(null, null, "App", "overrideBackbutton", [false]); - } - - // If unsubcribing from an event that is handled by a plugin - if (typeof PhoneGap.documentEventHandler[e] !== "undefined") { - if (PhoneGap.documentEventHandler[e](e, handler, false)) { - return; // Stop default behavior - } - } - - PhoneGap.m_document_removeEventListener.call(document, evt, handler, capture); -}; - -/** - * Intercept removing window event listeners and handle our own - * - * @param {Object} evt - * @param {Function} handler - * @param capture - */ -window.removeEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - - // If unsubcribing from an event that is handled by a plugin - if (typeof PhoneGap.windowEventHandler[e] !== "undefined") { - if (PhoneGap.windowEventHandler[e](e, handler, false)) { - return; // Stop default behavior - } - } - - PhoneGap.m_window_removeEventListener.call(window, evt, handler, capture); -}; - -/** - * Method to fire document event - * - * @param {String} type The event type to fire - * @param {Object} data Data to send with event - */ -PhoneGap.fireDocumentEvent = function(type, data) { - var e = document.createEvent('Events'); - e.initEvent(type); - if (data) { - for (var i in data) { - e[i] = data[i]; - } - } - document.dispatchEvent(e); -}; - -/** - * Method to fire window event - * - * @param {String} type The event type to fire - * @param {Object} data Data to send with event - */ -PhoneGap.fireWindowEvent = function(type, data) { - var e = document.createEvent('Events'); - e.initEvent(type); - if (data) { - for (var i in data) { - e[i] = data[i]; - } - } - window.dispatchEvent(e); -}; - -/** - * Does a deep clone of the object. - * - * @param obj - * @return {Object} - */ -PhoneGap.clone = function(obj) { - var i, retVal; - if(!obj) { - return obj; - } - - if(obj instanceof Array){ - retVal = []; - for(i = 0; i < obj.length; ++i){ - retVal.push(PhoneGap.clone(obj[i])); - } - return retVal; - } - - if (typeof obj === "function") { - return obj; - } - - if(!(obj instanceof Object)){ - return obj; - } - - if (obj instanceof Date) { - return obj; - } - - retVal = {}; - for(i in obj){ - if(!(i in retVal) || retVal[i] !== obj[i]) { - retVal[i] = PhoneGap.clone(obj[i]); - } - } - return retVal; -}; - -PhoneGap.callbackId = 0; -PhoneGap.callbacks = {}; -PhoneGap.callbackStatus = { - NO_RESULT: 0, - OK: 1, - CLASS_NOT_FOUND_EXCEPTION: 2, - ILLEGAL_ACCESS_EXCEPTION: 3, - INSTANTIATION_EXCEPTION: 4, - MALFORMED_URL_EXCEPTION: 5, - IO_EXCEPTION: 6, - INVALID_ACTION: 7, - JSON_EXCEPTION: 8, - ERROR: 9 - }; - - -/** - * Execute a PhoneGap command. It is up to the native side whether this action is synch or async. - * The native side can return: - * Synchronous: PluginResult object as a JSON string - * Asynchrounous: Empty string "" - * If async, the native side will PhoneGap.callbackSuccess or PhoneGap.callbackError, - * depending upon the result of the action. - * - * @param {Function} success The success callback - * @param {Function} fail The fail callback - * @param {String} service The name of the service to use - * @param {String} action Action to be run in PhoneGap - * @param {Array.} [args] Zero or more arguments to pass to the method - */ -PhoneGap.exec = function(success, fail, service, action, args) { - try { - var callbackId = service + PhoneGap.callbackId++; - if (success || fail) { - PhoneGap.callbacks[callbackId] = {success:success, fail:fail}; - } - - var r = prompt(JSON.stringify(args), "gap:"+JSON.stringify([service, action, callbackId, true])); - - // If a result was returned - if (r.length > 0) { - eval("var v="+r+";"); - - // If status is OK, then return value back to caller - if (v.status === PhoneGap.callbackStatus.OK) { - - // If there is a success callback, then call it now with - // returned value - if (success) { - try { - success(v.message); - } catch (e) { - console.log("Error in success callback: " + callbackId + " = " + e); - } - - // Clear callback if not expecting any more results - if (!v.keepCallback) { - delete PhoneGap.callbacks[callbackId]; - } - } - return v.message; - } - - // If no result - else if (v.status === PhoneGap.callbackStatus.NO_RESULT) { - - // Clear callback if not expecting any more results - if (!v.keepCallback) { - delete PhoneGap.callbacks[callbackId]; - } - } - - // If error, then display error - else { - console.log("Error: Status="+v.status+" Message="+v.message); - - // If there is a fail callback, then call it now with returned value - if (fail) { - try { - fail(v.message); - } - catch (e1) { - console.log("Error in error callback: "+callbackId+" = "+e1); - } - - // Clear callback if not expecting any more results - if (!v.keepCallback) { - delete PhoneGap.callbacks[callbackId]; - } - } - return null; - } - } - } catch (e2) { - console.log("Error: "+e2); - } -}; - -/** - * Called by native code when returning successful result from an action. - * - * @param callbackId - * @param args - */ -PhoneGap.callbackSuccess = function(callbackId, args) { - if (PhoneGap.callbacks[callbackId]) { - - // If result is to be sent to callback - if (args.status === PhoneGap.callbackStatus.OK) { - try { - if (PhoneGap.callbacks[callbackId].success) { - PhoneGap.callbacks[callbackId].success(args.message); - } - } - catch (e) { - console.log("Error in success callback: "+callbackId+" = "+e); - } - } - - // Clear callback if not expecting any more results - if (!args.keepCallback) { - delete PhoneGap.callbacks[callbackId]; - } - } -}; - -/** - * Called by native code when returning error result from an action. - * - * @param callbackId - * @param args - */ -PhoneGap.callbackError = function(callbackId, args) { - if (PhoneGap.callbacks[callbackId]) { - try { - if (PhoneGap.callbacks[callbackId].fail) { - PhoneGap.callbacks[callbackId].fail(args.message); - } - } - catch (e) { - console.log("Error in error callback: "+callbackId+" = "+e); - } - - // Clear callback if not expecting any more results - if (!args.keepCallback) { - delete PhoneGap.callbacks[callbackId]; - } - } -}; - -PhoneGap.JSCallbackPort = null; -PhoneGap.JSCallbackToken = null; - -/** - * This is only for Android. - * - * Internal function that uses XHR to call into PhoneGap Java code and retrieve - * any JavaScript code that needs to be run. This is used for callbacks from - * Java to JavaScript. - */ -PhoneGap.JSCallback = function() { - - // Exit if shutting down app - if (PhoneGap.shuttingDown) { - return; - } - - // If polling flag was changed, start using polling from now on - if (PhoneGap.UsePolling) { - PhoneGap.JSCallbackPolling(); - return; - } - - var xmlhttp = new XMLHttpRequest(); - - // Callback function when XMLHttpRequest is ready - xmlhttp.onreadystatechange=function(){ - if(xmlhttp.readyState === 4){ - - // Exit if shutting down app - if (PhoneGap.shuttingDown) { - return; - } - - // If callback has JavaScript statement to execute - if (xmlhttp.status === 200) { - - // Need to url decode the response - var msg = decodeURIComponent(xmlhttp.responseText); - setTimeout(function() { - try { - var t = eval(msg); - } - catch (e) { - // If we're getting an error here, seeing the message will help in debugging - console.log("JSCallback: Message from Server: " + msg); - console.log("JSCallback Error: "+e); - } - }, 1); - setTimeout(PhoneGap.JSCallback, 1); - } - - // If callback ping (used to keep XHR request from timing out) - else if (xmlhttp.status === 404) { - setTimeout(PhoneGap.JSCallback, 10); - } - - // If security error - else if (xmlhttp.status === 403) { - console.log("JSCallback Error: Invalid token. Stopping callbacks."); - } - - // If server is stopping - else if (xmlhttp.status === 503) { - console.log("JSCallback Server Closed: Stopping callbacks."); - } - - // If request wasn't GET - else if (xmlhttp.status === 400) { - console.log("JSCallback Error: Bad request. Stopping callbacks."); - } - - // If error, revert to polling - else { - console.log("JSCallback Error: Request failed."); - PhoneGap.UsePolling = true; - PhoneGap.JSCallbackPolling(); - } - } - }; - - if (PhoneGap.JSCallbackPort === null) { - PhoneGap.JSCallbackPort = prompt("getPort", "gap_callbackServer:"); - } - if (PhoneGap.JSCallbackToken === null) { - PhoneGap.JSCallbackToken = prompt("getToken", "gap_callbackServer:"); - } - xmlhttp.open("GET", "http://127.0.0.1:"+PhoneGap.JSCallbackPort+"/"+PhoneGap.JSCallbackToken , true); - xmlhttp.send(); -}; - -/** - * The polling period to use with JSCallbackPolling. - * This can be changed by the application. The default is 50ms. - */ -PhoneGap.JSCallbackPollingPeriod = 50; - -/** - * Flag that can be set by the user to force polling to be used or force XHR to be used. - */ -PhoneGap.UsePolling = false; // T=use polling, F=use XHR - -/** - * This is only for Android. - * - * Internal function that uses polling to call into PhoneGap Java code and retrieve - * any JavaScript code that needs to be run. This is used for callbacks from - * Java to JavaScript. - */ -PhoneGap.JSCallbackPolling = function() { - - // Exit if shutting down app - if (PhoneGap.shuttingDown) { - return; - } - - // If polling flag was changed, stop using polling from now on - if (!PhoneGap.UsePolling) { - PhoneGap.JSCallback(); - return; - } - - var msg = prompt("", "gap_poll:"); - if (msg) { - setTimeout(function() { - try { - var t = eval(""+msg); - } - catch (e) { - console.log("JSCallbackPolling: Message from Server: " + msg); - console.log("JSCallbackPolling Error: "+e); - } - }, 1); - setTimeout(PhoneGap.JSCallbackPolling, 1); - } - else { - setTimeout(PhoneGap.JSCallbackPolling, PhoneGap.JSCallbackPollingPeriod); - } -}; - -/** - * Create a UUID - * - * @return {String} - */ -PhoneGap.createUUID = function() { - return PhoneGap.UUIDcreatePart(4) + '-' + - PhoneGap.UUIDcreatePart(2) + '-' + - PhoneGap.UUIDcreatePart(2) + '-' + - PhoneGap.UUIDcreatePart(2) + '-' + - PhoneGap.UUIDcreatePart(6); -}; - -PhoneGap.UUIDcreatePart = function(length) { - var uuidpart = ""; - var i, uuidchar; - for (i=0; i frequency + 10 sec - PhoneGap.exec( - function(timeout) { - if (timeout < (frequency + 10000)) { - PhoneGap.exec(null, null, "Accelerometer", "setTimeout", [frequency + 10000]); - } - }, - function(e) { }, "Accelerometer", "getTimeout", []); - - // Start watch timer - var id = PhoneGap.createUUID(); - navigator.accelerometer.timers[id] = setInterval(function() { - PhoneGap.exec(successCallback, errorCallback, "Accelerometer", "getAcceleration", []); - }, (frequency ? frequency : 1)); - - return id; -}; - -/** - * Clears the specified accelerometer watch. - * - * @param {String} id The id of the watch returned from #watchAcceleration. - */ -Accelerometer.prototype.clearWatch = function(id) { - - // Stop javascript timer & remove from timer list - if (id && navigator.accelerometer.timers[id] !== undefined) { - clearInterval(navigator.accelerometer.timers[id]); - delete navigator.accelerometer.timers[id]; - } -}; - -PhoneGap.addConstructor(function() { - if (typeof navigator.accelerometer === "undefined") { - navigator.accelerometer = new Accelerometer(); - } -}); -} -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -if (!PhoneGap.hasResource("app")) { -PhoneGap.addResource("app"); -(function() { - -/** - * Constructor - * @constructor - */ -var App = function() {}; - -/** - * Clear the resource cache. - */ -App.prototype.clearCache = function() { - PhoneGap.exec(null, null, "App", "clearCache", []); -}; - -/** - * Load the url into the webview or into new browser instance. - * - * @param url The URL to load - * @param props Properties that can be passed in to the activity: - * wait: int => wait msec before loading URL - * loadingDialog: "Title,Message" => display a native loading dialog - * loadUrlTimeoutValue: int => time in msec to wait before triggering a timeout error - * clearHistory: boolean => clear webview history (default=false) - * openExternal: boolean => open in a new browser (default=false) - * - * Example: - * navigator.app.loadUrl("http://server/myapp/index.html", {wait:2000, loadingDialog:"Wait,Loading App", loadUrlTimeoutValue: 60000}); - */ -App.prototype.loadUrl = function(url, props) { - PhoneGap.exec(null, null, "App", "loadUrl", [url, props]); -}; - -/** - * Cancel loadUrl that is waiting to be loaded. - */ -App.prototype.cancelLoadUrl = function() { - PhoneGap.exec(null, null, "App", "cancelLoadUrl", []); -}; - -/** - * Clear web history in this web view. - * Instead of BACK button loading the previous web page, it will exit the app. - */ -App.prototype.clearHistory = function() { - PhoneGap.exec(null, null, "App", "clearHistory", []); -}; - -/** - * Go to previous page displayed. - * This is the same as pressing the backbutton on Android device. - */ -App.prototype.backHistory = function() { - PhoneGap.exec(null, null, "App", "backHistory", []); -}; - -/** - * Exit and terminate the application. - */ -App.prototype.exitApp = function() { - return PhoneGap.exec(null, null, "App", "exitApp", []); -}; - -PhoneGap.addConstructor(function() { - navigator.app = new App(); -}); -}()); -} -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -if (!PhoneGap.hasResource("battery")) { -PhoneGap.addResource("battery"); - -/** - * This class contains information about the current battery status. - * @constructor - */ -var Battery = function() { - this._level = null; - this._isPlugged = null; - this._batteryListener = []; - this._lowListener = []; - this._criticalListener = []; -}; - -/** - * Registers as an event producer for battery events. - * - * @param {Object} eventType - * @param {Object} handler - * @param {Object} add - */ -Battery.prototype.eventHandler = function(eventType, handler, add) { - var me = navigator.battery; - if (add) { - // If there are no current registered event listeners start the battery listener on native side. - if (me._batteryListener.length === 0 && me._lowListener.length === 0 && me._criticalListener.length === 0) { - PhoneGap.exec(me._status, me._error, "Battery", "start", []); - } - - // Register the event listener in the proper array - if (eventType === "batterystatus") { - if (me._batteryListener.indexOf(handler) === -1) { - me._batteryListener.push(handler); - } - } else if (eventType === "batterylow") { - if (me._lowListener.indexOf(handler) === -1) { - me._lowListener.push(handler); - } - } else if (eventType === "batterycritical") { - if (me._criticalListener.indexOf(handler) === -1) { - me._criticalListener.push(handler); - } - } - } else { - var pos = -1; - // Remove the event listener from the proper array - if (eventType === "batterystatus") { - pos = me._batteryListener.indexOf(handler); - if (pos > -1) { - me._batteryListener.splice(pos, 1); - } - } else if (eventType === "batterylow") { - pos = me._lowListener.indexOf(handler); - if (pos > -1) { - me._lowListener.splice(pos, 1); - } - } else if (eventType === "batterycritical") { - pos = me._criticalListener.indexOf(handler); - if (pos > -1) { - me._criticalListener.splice(pos, 1); - } - } - - // If there are no more registered event listeners stop the battery listener on native side. - if (me._batteryListener.length === 0 && me._lowListener.length === 0 && me._criticalListener.length === 0) { - PhoneGap.exec(null, null, "Battery", "stop", []); - } - } -}; - -/** - * Callback for battery status - * - * @param {Object} info keys: level, isPlugged - */ -Battery.prototype._status = function(info) { - if (info) { - var me = this; - var level = info.level; - if (me._level !== level || me._isPlugged !== info.isPlugged) { - // Fire batterystatus event - PhoneGap.fireWindowEvent("batterystatus", info); - - // Fire low battery event - if (level === 20 || level === 5) { - if (level === 20) { - PhoneGap.fireWindowEvent("batterylow", info); - } - else { - PhoneGap.fireWindowEvent("batterycritical", info); - } - } - } - me._level = level; - me._isPlugged = info.isPlugged; - } -}; - -/** - * Error callback for battery start - */ -Battery.prototype._error = function(e) { - console.log("Error initializing Battery: " + e); -}; - -PhoneGap.addConstructor(function() { - if (typeof navigator.battery === "undefined") { - navigator.battery = new Battery(); - PhoneGap.addWindowEventHandler("batterystatus", navigator.battery.eventHandler); - PhoneGap.addWindowEventHandler("batterylow", navigator.battery.eventHandler); - PhoneGap.addWindowEventHandler("batterycritical", navigator.battery.eventHandler); - } -}); -} -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -if (!PhoneGap.hasResource("camera")) { -PhoneGap.addResource("camera"); - -/** - * This class provides access to the device camera. - * - * @constructor - */ -var Camera = function() { - this.successCallback = null; - this.errorCallback = null; - this.options = null; -}; - -/** - * Format of image that returned from getPicture. - * - * Example: navigator.camera.getPicture(success, fail, - * { quality: 80, - * destinationType: Camera.DestinationType.DATA_URL, - * sourceType: Camera.PictureSourceType.PHOTOLIBRARY}) - */ -Camera.DestinationType = { - DATA_URL: 0, // Return base64 encoded string - FILE_URI: 1 // Return file uri (content://media/external/images/media/2 for Android) -}; -Camera.prototype.DestinationType = Camera.DestinationType; - -/** - * Encoding of image returned from getPicture. - * - * Example: navigator.camera.getPicture(success, fail, - * { quality: 80, - * destinationType: Camera.DestinationType.DATA_URL, - * sourceType: Camera.PictureSourceType.CAMERA, - * encodingType: Camera.EncodingType.PNG}) -*/ -Camera.EncodingType = { - JPEG: 0, // Return JPEG encoded image - PNG: 1 // Return PNG encoded image -}; -Camera.prototype.EncodingType = Camera.EncodingType; - -/** - * Type of pictures to select from. Only applicable when - * PictureSourceType is PHOTOLIBRARY or SAVEDPHOTOALBUM - * - * Example: navigator.camera.getPicture(success, fail, - * { quality: 80, - * destinationType: Camera.DestinationType.DATA_URL, - * sourceType: Camera.PictureSourceType.PHOTOLIBRARY, - * mediaType: Camera.MediaType.PICTURE}) - */ -Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, ONLY RETURNS URL - ALLMEDIA : 2 // allow selection from all media types -}; -Camera.prototype.MediaType = Camera.MediaType; - - -/** - * Source to getPicture from. - * - * Example: navigator.camera.getPicture(success, fail, - * { quality: 80, - * destinationType: Camera.DestinationType.DATA_URL, - * sourceType: Camera.PictureSourceType.PHOTOLIBRARY}) - */ -Camera.PictureSourceType = { - PHOTOLIBRARY : 0, // Choose image from picture library (same as SAVEDPHOTOALBUM for Android) - CAMERA : 1, // Take picture from camera - SAVEDPHOTOALBUM : 2 // Choose image from picture library (same as PHOTOLIBRARY for Android) -}; -Camera.prototype.PictureSourceType = Camera.PictureSourceType; - -/** - * Gets a picture from source defined by "options.sourceType", and returns the - * image as defined by the "options.destinationType" option. - - * The defaults are sourceType=CAMERA and destinationType=DATA_URL. - * - * @param {Function} successCallback - * @param {Function} errorCallback - * @param {Object} options - */ -Camera.prototype.getPicture = function(successCallback, errorCallback, options) { - - // successCallback required - if (typeof successCallback !== "function") { - console.log("Camera Error: successCallback is not a function"); - return; - } - - // errorCallback optional - if (errorCallback && (typeof errorCallback !== "function")) { - console.log("Camera Error: errorCallback is not a function"); - return; - } - - if (options === null || typeof options === "undefined") { - options = {}; - } - if (options.quality === null || typeof options.quality === "undefined") { - options.quality = 80; - } - if (options.maxResolution === null || typeof options.maxResolution === "undefined") { - options.maxResolution = 0; - } - if (options.destinationType === null || typeof options.destinationType === "undefined") { - options.destinationType = Camera.DestinationType.FILE_URI; - } - if (options.sourceType === null || typeof options.sourceType === "undefined") { - options.sourceType = Camera.PictureSourceType.CAMERA; - } - if (options.encodingType === null || typeof options.encodingType === "undefined") { - options.encodingType = Camera.EncodingType.JPEG; - } - if (options.mediaType === null || typeof options.mediaType === "undefined") { - options.mediaType = Camera.MediaType.PICTURE; - } - if (options.targetWidth === null || typeof options.targetWidth === "undefined") { - options.targetWidth = -1; - } - else if (typeof options.targetWidth === "string") { - var width = new Number(options.targetWidth); - if (isNaN(width) === false) { - options.targetWidth = width.valueOf(); - } - } - if (options.targetHeight === null || typeof options.targetHeight === "undefined") { - options.targetHeight = -1; - } - else if (typeof options.targetHeight === "string") { - var height = new Number(options.targetHeight); - if (isNaN(height) === false) { - options.targetHeight = height.valueOf(); - } - } - - PhoneGap.exec(successCallback, errorCallback, "Camera", "takePicture", [options]); -}; - -PhoneGap.addConstructor(function() { - if (typeof navigator.camera === "undefined") { - navigator.camera = new Camera(); - } -}); -} -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -if (!PhoneGap.hasResource("capture")) { -PhoneGap.addResource("capture"); - -/** - * Represents a single file. - * - * name {DOMString} name of the file, without path information - * fullPath {DOMString} the full path of the file, including the name - * type {DOMString} mime type - * lastModifiedDate {Date} last modified date - * size {Number} size of the file in bytes - */ -var MediaFile = function(name, fullPath, type, lastModifiedDate, size){ - this.name = name || null; - this.fullPath = fullPath || null; - this.type = type || null; - this.lastModifiedDate = lastModifiedDate || null; - this.size = size || 0; -}; - -/** - * Launch device camera application for recording video(s). - * - * @param {Function} successCB - * @param {Function} errorCB - */ -MediaFile.prototype.getFormatData = function(successCallback, errorCallback){ - PhoneGap.exec(successCallback, errorCallback, "Capture", "getFormatData", [this.fullPath, this.type]); -}; - -/** - * MediaFileData encapsulates format information of a media file. - * - * @param {DOMString} codecs - * @param {long} bitrate - * @param {long} height - * @param {long} width - * @param {float} duration - */ -var MediaFileData = function(codecs, bitrate, height, width, duration){ - this.codecs = codecs || null; - this.bitrate = bitrate || 0; - this.height = height || 0; - this.width = width || 0; - this.duration = duration || 0; -}; - -/** - * The CaptureError interface encapsulates all errors in the Capture API. - */ -var CaptureError = function(){ - this.code = null; -}; - -// Capture error codes -CaptureError.CAPTURE_INTERNAL_ERR = 0; -CaptureError.CAPTURE_APPLICATION_BUSY = 1; -CaptureError.CAPTURE_INVALID_ARGUMENT = 2; -CaptureError.CAPTURE_NO_MEDIA_FILES = 3; -CaptureError.CAPTURE_NOT_SUPPORTED = 20; - -/** - * The Capture interface exposes an interface to the camera and microphone of the hosting device. - */ -var Capture = function(){ - this.supportedAudioModes = []; - this.supportedImageModes = []; - this.supportedVideoModes = []; -}; - -/** - * Launch audio recorder application for recording audio clip(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureAudioOptions} options - */ -Capture.prototype.captureAudio = function(successCallback, errorCallback, options){ - PhoneGap.exec(successCallback, errorCallback, "Capture", "captureAudio", [options]); -}; - -/** - * Launch camera application for taking image(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureImageOptions} options - */ -Capture.prototype.captureImage = function(successCallback, errorCallback, options){ - PhoneGap.exec(successCallback, errorCallback, "Capture", "captureImage", [options]); -}; - -/** - * Launch camera application for taking image(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureImageOptions} options - */ -Capture.prototype._castMediaFile = function(pluginResult){ - var mediaFiles = []; - var i; - for (i = 0; i < pluginResult.message.length; i++) { - var mediaFile = new MediaFile(); - mediaFile.name = pluginResult.message[i].name; - mediaFile.fullPath = pluginResult.message[i].fullPath; - mediaFile.type = pluginResult.message[i].type; - mediaFile.lastModifiedDate = pluginResult.message[i].lastModifiedDate; - mediaFile.size = pluginResult.message[i].size; - mediaFiles.push(mediaFile); - } - pluginResult.message = mediaFiles; - return pluginResult; -}; - -/** - * Launch device camera application for recording video(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureVideoOptions} options - */ -Capture.prototype.captureVideo = function(successCallback, errorCallback, options){ - PhoneGap.exec(successCallback, errorCallback, "Capture", "captureVideo", [options]); -}; - -/** - * Encapsulates a set of parameters that the capture device supports. - */ -var ConfigurationData = function(){ - // The ASCII-encoded string in lower case representing the media type. - this.type = null; - // The height attribute represents height of the image or video in pixels. - // In the case of a sound clip this attribute has value 0. - this.height = 0; - // The width attribute represents width of the image or video in pixels. - // In the case of a sound clip this attribute has value 0 - this.width = 0; -}; - -/** - * Encapsulates all image capture operation configuration options. - */ -var CaptureImageOptions = function(){ - // Upper limit of images user can take. Value must be equal or greater than 1. - this.limit = 1; - // The selected image mode. Must match with one of the elements in supportedImageModes array. - this.mode = null; -}; - -/** - * Encapsulates all video capture operation configuration options. - */ -var CaptureVideoOptions = function(){ - // Upper limit of videos user can record. Value must be equal or greater than 1. - this.limit = 1; - // Maximum duration of a single video clip in seconds. - this.duration = 0; - // The selected video mode. Must match with one of the elements in supportedVideoModes array. - this.mode = null; -}; - -/** - * Encapsulates all audio capture operation configuration options. - */ -var CaptureAudioOptions = function(){ - // Upper limit of sound clips user can record. Value must be equal or greater than 1. - this.limit = 1; - // Maximum duration of a single sound clip in seconds. - this.duration = 0; - // The selected audio mode. Must match with one of the elements in supportedAudioModes array. - this.mode = null; -}; - -PhoneGap.addConstructor(function(){ - if (typeof navigator.device.capture === "undefined") { - navigator.device.capture = window.device.capture = new Capture(); - } -}); -} -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -if (!PhoneGap.hasResource("compass")) { -PhoneGap.addResource("compass"); - -var CompassError = function(){ - this.code = null; -}; - -// Capture error codes -CompassError.COMPASS_INTERNAL_ERR = 0; -CompassError.COMPASS_NOT_SUPPORTED = 20; - -var CompassHeading = function() { - this.magneticHeading = null; - this.trueHeading = null; - this.headingAccuracy = null; - this.timestamp = null; -}; - -/** - * This class provides access to device Compass data. - * @constructor - */ -var Compass = function() { - /** - * The last known Compass position. - */ - this.lastHeading = null; - - /** - * List of compass watch timers - */ - this.timers = {}; -}; - -Compass.ERROR_MSG = ["Not running", "Starting", "", "Failed to start"]; - -/** - * Asynchronously aquires the current heading. - * - * @param {Function} successCallback The function to call when the heading data is available - * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL) - * @param {PositionOptions} options The options for getting the heading data such as timeout. (OPTIONAL) - */ -Compass.prototype.getCurrentHeading = function(successCallback, errorCallback, options) { - - // successCallback required - if (typeof successCallback !== "function") { - console.log("Compass Error: successCallback is not a function"); - return; - } - - // errorCallback optional - if (errorCallback && (typeof errorCallback !== "function")) { - console.log("Compass Error: errorCallback is not a function"); - return; - } - - // Get heading - PhoneGap.exec(successCallback, errorCallback, "Compass", "getHeading", []); -}; - -/** - * Asynchronously aquires the heading repeatedly at a given interval. - * - * @param {Function} successCallback The function to call each time the heading data is available - * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL) - * @param {HeadingOptions} options The options for getting the heading data such as timeout and the frequency of the watch. (OPTIONAL) - * @return String The watch id that must be passed to #clearWatch to stop watching. - */ -Compass.prototype.watchHeading= function(successCallback, errorCallback, options) { - - // Default interval (100 msec) - var frequency = (options !== undefined) ? options.frequency : 100; - - // successCallback required - if (typeof successCallback !== "function") { - console.log("Compass Error: successCallback is not a function"); - return; - } - - // errorCallback optional - if (errorCallback && (typeof errorCallback !== "function")) { - console.log("Compass Error: errorCallback is not a function"); - return; - } - - // Make sure compass timeout > frequency + 10 sec - PhoneGap.exec( - function(timeout) { - if (timeout < (frequency + 10000)) { - PhoneGap.exec(null, null, "Compass", "setTimeout", [frequency + 10000]); - } - }, - function(e) { }, "Compass", "getTimeout", []); - - // Start watch timer to get headings - var id = PhoneGap.createUUID(); - navigator.compass.timers[id] = setInterval( - function() { - PhoneGap.exec(successCallback, errorCallback, "Compass", "getHeading", []); - }, (frequency ? frequency : 1)); - - return id; -}; - - -/** - * Clears the specified heading watch. - * - * @param {String} id The ID of the watch returned from #watchHeading. - */ -Compass.prototype.clearWatch = function(id) { - - // Stop javascript timer & remove from timer list - if (id && navigator.compass.timers[id]) { - clearInterval(navigator.compass.timers[id]); - delete navigator.compass.timers[id]; - } -}; - -Compass.prototype._castDate = function(pluginResult) { - if (pluginResult.message.timestamp) { - var timestamp = new Date(pluginResult.message.timestamp); - pluginResult.message.timestamp = timestamp; - } - return pluginResult; -}; - -PhoneGap.addConstructor(function() { - if (typeof navigator.compass === "undefined") { - navigator.compass = new Compass(); - } -}); -} -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -if (!PhoneGap.hasResource("contact")) { -PhoneGap.addResource("contact"); - -/** -* Contains information about a single contact. -* @constructor -* @param {DOMString} id unique identifier -* @param {DOMString} displayName -* @param {ContactName} name -* @param {DOMString} nickname -* @param {Array.} phoneNumbers array of phone numbers -* @param {Array.} emails array of email addresses -* @param {Array.} addresses array of addresses -* @param {Array.} ims instant messaging user ids -* @param {Array.} organizations -* @param {DOMString} birthday contact's birthday -* @param {DOMString} note user notes about contact -* @param {Array.} photos -* @param {Array.} categories -* @param {Array.} urls contact's web sites -*/ -var Contact = function (id, displayName, name, nickname, phoneNumbers, emails, addresses, - ims, organizations, birthday, note, photos, categories, urls) { - this.id = id || null; - this.rawId = null; - this.displayName = displayName || null; - this.name = name || null; // ContactName - this.nickname = nickname || null; - this.phoneNumbers = phoneNumbers || null; // ContactField[] - this.emails = emails || null; // ContactField[] - this.addresses = addresses || null; // ContactAddress[] - this.ims = ims || null; // ContactField[] - this.organizations = organizations || null; // ContactOrganization[] - this.birthday = birthday || null; - this.note = note || null; - this.photos = photos || null; // ContactField[] - this.categories = categories || null; // ContactField[] - this.urls = urls || null; // ContactField[] -}; - -/** - * ContactError. - * An error code assigned by an implementation when an error has occurreds - * @constructor - */ -var ContactError = function() { - this.code=null; -}; - -/** - * Error codes - */ -ContactError.UNKNOWN_ERROR = 0; -ContactError.INVALID_ARGUMENT_ERROR = 1; -ContactError.TIMEOUT_ERROR = 2; -ContactError.PENDING_OPERATION_ERROR = 3; -ContactError.IO_ERROR = 4; -ContactError.NOT_SUPPORTED_ERROR = 5; -ContactError.PERMISSION_DENIED_ERROR = 20; - -/** -* Removes contact from device storage. -* @param successCB success callback -* @param errorCB error callback -*/ -Contact.prototype.remove = function(successCB, errorCB) { - if (this.id === null) { - var errorObj = new ContactError(); - errorObj.code = ContactError.UNKNOWN_ERROR; - errorCB(errorObj); - } - else { - PhoneGap.exec(successCB, errorCB, "Contacts", "remove", [this.id]); - } -}; - -/** -* Creates a deep copy of this Contact. -* With the contact ID set to null. -* @return copy of this Contact -*/ -Contact.prototype.clone = function() { - var clonedContact = PhoneGap.clone(this); - var i; - clonedContact.id = null; - clonedContact.rawId = null; - // Loop through and clear out any id's in phones, emails, etc. - if (clonedContact.phoneNumbers) { - for (i = 0; i < clonedContact.phoneNumbers.length; i++) { - clonedContact.phoneNumbers[i].id = null; - } - } - if (clonedContact.emails) { - for (i = 0; i < clonedContact.emails.length; i++) { - clonedContact.emails[i].id = null; - } - } - if (clonedContact.addresses) { - for (i = 0; i < clonedContact.addresses.length; i++) { - clonedContact.addresses[i].id = null; - } - } - if (clonedContact.ims) { - for (i = 0; i < clonedContact.ims.length; i++) { - clonedContact.ims[i].id = null; - } - } - if (clonedContact.organizations) { - for (i = 0; i < clonedContact.organizations.length; i++) { - clonedContact.organizations[i].id = null; - } - } - if (clonedContact.tags) { - for (i = 0; i < clonedContact.tags.length; i++) { - clonedContact.tags[i].id = null; - } - } - if (clonedContact.photos) { - for (i = 0; i < clonedContact.photos.length; i++) { - clonedContact.photos[i].id = null; - } - } - if (clonedContact.urls) { - for (i = 0; i < clonedContact.urls.length; i++) { - clonedContact.urls[i].id = null; - } - } - return clonedContact; -}; - -/** -* Persists contact to device storage. -* @param successCB success callback -* @param errorCB error callback -*/ -Contact.prototype.save = function(successCB, errorCB) { - PhoneGap.exec(successCB, errorCB, "Contacts", "save", [this]); -}; - -/** -* Contact name. -* @constructor -* @param formatted -* @param familyName -* @param givenName -* @param middle -* @param prefix -* @param suffix -*/ -var ContactName = function(formatted, familyName, givenName, middle, prefix, suffix) { - this.formatted = formatted || null; - this.familyName = familyName || null; - this.givenName = givenName || null; - this.middleName = middle || null; - this.honorificPrefix = prefix || null; - this.honorificSuffix = suffix || null; -}; - -/** -* Generic contact field. -* @constructor -* @param {DOMString} id unique identifier, should only be set by native code -* @param type -* @param value -* @param pref -*/ -var ContactField = function(type, value, pref) { - this.id = null; - this.type = type || null; - this.value = value || null; - this.pref = pref || null; -}; - -/** -* Contact address. -* @constructor -* @param {DOMString} id unique identifier, should only be set by native code -* @param formatted -* @param streetAddress -* @param locality -* @param region -* @param postalCode -* @param country -*/ -var ContactAddress = function(pref, type, formatted, streetAddress, locality, region, postalCode, country) { - this.id = null; - this.pref = pref || null; - this.type = type || null; - this.formatted = formatted || null; - this.streetAddress = streetAddress || null; - this.locality = locality || null; - this.region = region || null; - this.postalCode = postalCode || null; - this.country = country || null; -}; - -/** -* Contact organization. -* @constructor -* @param {DOMString} id unique identifier, should only be set by native code -* @param name -* @param dept -* @param title -* @param startDate -* @param endDate -* @param location -* @param desc -*/ -var ContactOrganization = function(pref, type, name, dept, title) { - this.id = null; - this.pref = pref || null; - this.type = type || null; - this.name = name || null; - this.department = dept || null; - this.title = title || null; -}; - -/** -* Represents a group of Contacts. -* @constructor -*/ -var Contacts = function() { - this.inProgress = false; - this.records = []; -}; -/** -* Returns an array of Contacts matching the search criteria. -* @param fields that should be searched -* @param successCB success callback -* @param errorCB error callback -* @param {ContactFindOptions} options that can be applied to contact searching -* @return array of Contacts matching search criteria -*/ -Contacts.prototype.find = function(fields, successCB, errorCB, options) { - if (successCB === null) { - throw new TypeError("You must specify a success callback for the find command."); - } - if (fields === null || fields === "undefined" || fields.length === "undefined" || fields.length <= 0) { - if (typeof errorCB === "function") { - errorCB({"code": ContactError.INVALID_ARGUMENT_ERROR}); - } - } else { - PhoneGap.exec(successCB, errorCB, "Contacts", "search", [fields, options]); - } -}; - -/** -* This function creates a new contact, but it does not persist the contact -* to device storage. To persist the contact to device storage, invoke -* contact.save(). -* @param properties an object who's properties will be examined to create a new Contact -* @returns new Contact object -*/ -Contacts.prototype.create = function(properties) { - var i; - var contact = new Contact(); - for (i in properties) { - if (contact[i] !== 'undefined') { - contact[i] = properties[i]; - } - } - return contact; -}; - -/** -* This function returns and array of contacts. It is required as we need to convert raw -* JSON objects into concrete Contact objects. Currently this method is called after -* navigator.contacts.find but before the find methods success call back. -* -* @param jsonArray an array of JSON Objects that need to be converted to Contact objects. -* @returns an array of Contact objects -*/ -Contacts.prototype.cast = function(pluginResult) { - var contacts = []; - var i; - for (i=0; i][;base64], - * - * @param file {File} File object containing file properties - */ -FileReader.prototype.readAsDataURL = function(file) { - this.fileName = ""; - if (typeof file.fullPath === "undefined") { - this.fileName = file; - } else { - this.fileName = file.fullPath; - } - - // LOADING state - this.readyState = FileReader.LOADING; - - // If loadstart callback - if (typeof this.onloadstart === "function") { - this.onloadstart({"type":"loadstart", "target":this}); - } - - var me = this; - - // Read file - PhoneGap.exec( - // Success callback - function(r) { - var evt; - - // If DONE (cancelled), then don't do anything - if (me.readyState === FileReader.DONE) { - return; - } - - // Save result - me.result = r; - - // If onload callback - if (typeof me.onload === "function") { - me.onload({"type":"load", "target":me}); - } - - // DONE state - me.readyState = FileReader.DONE; - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend({"type":"loadend", "target":me}); - } - }, - // Error callback - function(e) { - var evt; - // If DONE (cancelled), then don't do anything - if (me.readyState === FileReader.DONE) { - return; - } - - // Save error - me.error = e; - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror({"type":"error", "target":me}); - } - - // DONE state - me.readyState = FileReader.DONE; - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend({"type":"loadend", "target":me}); - } - }, "File", "readAsDataURL", [this.fileName]); -}; - -/** - * Read file and return data as a binary data. - * - * @param file {File} File object containing file properties - */ -FileReader.prototype.readAsBinaryString = function(file) { - // TODO - Can't return binary data to browser. - this.fileName = file; -}; - -/** - * Read file and return data as a binary data. - * - * @param file {File} File object containing file properties - */ -FileReader.prototype.readAsArrayBuffer = function(file) { - // TODO - Can't return binary data to browser. - this.fileName = file; -}; - -//----------------------------------------------------------------------------- -// File Writer -//----------------------------------------------------------------------------- - -/** - * This class writes to the mobile device file system. - * - * For Android: - * The root directory is the root of the file system. - * To write to the SD card, the file name is "sdcard/my_file.txt" - * - * @constructor - * @param file {File} File object containing file properties - * @param append if true write to the end of the file, otherwise overwrite the file - */ -var FileWriter = function(file) { - this.fileName = ""; - this.length = 0; - if (file) { - this.fileName = file.fullPath || file; - this.length = file.size || 0; - } - // default is to write at the beginning of the file - this.position = 0; - - this.readyState = 0; // EMPTY - - this.result = null; - - // Error - this.error = null; - - // Event handlers - this.onwritestart = null; // When writing starts - this.onprogress = null; // While writing the file, and reporting partial file data - this.onwrite = null; // When the write has successfully completed. - this.onwriteend = null; // When the request has completed (either in success or failure). - this.onabort = null; // When the write has been aborted. For instance, by invoking the abort() method. - this.onerror = null; // When the write has failed (see errors). -}; - -// States -FileWriter.INIT = 0; -FileWriter.WRITING = 1; -FileWriter.DONE = 2; - -/** - * Abort writing file. - */ -FileWriter.prototype.abort = function() { - // check for invalid state - if (this.readyState === FileWriter.DONE || this.readyState === FileWriter.INIT) { - throw FileError.INVALID_STATE_ERR; - } - - // set error - var error = new FileError(), evt; - error.code = error.ABORT_ERR; - this.error = error; - - // If error callback - if (typeof this.onerror === "function") { - this.onerror({"type":"error", "target":this}); - } - // If abort callback - if (typeof this.onabort === "function") { - this.onabort({"type":"abort", "target":this}); - } - - this.readyState = FileWriter.DONE; - - // If write end callback - if (typeof this.onwriteend === "function") { - this.onwriteend({"type":"writeend", "target":this}); - } -}; - -/** - * Writes data to the file - * - * @param text to be written - */ -FileWriter.prototype.write = function(text) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw FileError.INVALID_STATE_ERR; - } - - // WRITING state - this.readyState = FileWriter.WRITING; - - var me = this; - - // If onwritestart callback - if (typeof me.onwritestart === "function") { - me.onwritestart({"type":"writestart", "target":me}); - } - - // Write file - PhoneGap.exec( - // Success callback - function(r) { - var evt; - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // position always increases by bytes written because file would be extended - me.position += r; - // The length of the file is now where we are done writing. - me.length = me.position; - - // If onwrite callback - if (typeof me.onwrite === "function") { - me.onwrite({"type":"write", "target":me}); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - me.onwriteend({"type":"writeend", "target":me}); - } - }, - // Error callback - function(e) { - var evt; - - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // Save error - me.error = e; - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror({"type":"error", "target":me}); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - me.onwriteend({"type":"writeend", "target":me}); - } - }, "File", "write", [this.fileName, text, this.position]); -}; - -/** - * Moves the file pointer to the location specified. - * - * If the offset is a negative number the position of the file - * pointer is rewound. If the offset is greater than the file - * size the position is set to the end of the file. - * - * @param offset is the location to move the file pointer to. - */ -FileWriter.prototype.seek = function(offset) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw FileError.INVALID_STATE_ERR; - } - - if (!offset) { - return; - } - - // See back from end of file. - if (offset < 0) { - this.position = Math.max(offset + this.length, 0); - } - // Offset is bigger then file size so set position - // to the end of the file. - else if (offset > this.length) { - this.position = this.length; - } - // Offset is between 0 and file size so set the position - // to start writing. - else { - this.position = offset; - } -}; - -/** - * Truncates the file to the size specified. - * - * @param size to chop the file at. - */ -FileWriter.prototype.truncate = function(size) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw FileError.INVALID_STATE_ERR; - } - - // WRITING state - this.readyState = FileWriter.WRITING; - - var me = this; - - // If onwritestart callback - if (typeof me.onwritestart === "function") { - me.onwritestart({"type":"writestart", "target":this}); - } - - // Write file - PhoneGap.exec( - // Success callback - function(r) { - var evt; - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // Update the length of the file - me.length = r; - me.position = Math.min(me.position, r); - - // If onwrite callback - if (typeof me.onwrite === "function") { - me.onwrite({"type":"write", "target":me}); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - me.onwriteend({"type":"writeend", "target":me}); - } - }, - // Error callback - function(e) { - var evt; - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // Save error - me.error = e; - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror({"type":"error", "target":me}); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - me.onwriteend({"type":"writeend", "target":me}); - } - }, "File", "truncate", [this.fileName, size]); -}; - -/** - * Information about the state of the file or directory - * - * @constructor - * {Date} modificationTime (readonly) - */ -var Metadata = function() { - this.modificationTime=null; -}; - -/** - * Supplies arguments to methods that lookup or create files and directories - * - * @constructor - * @param {boolean} create file or directory if it doesn't exist - * @param {boolean} exclusive if true the command will fail if the file or directory exists - */ -var Flags = function(create, exclusive) { - this.create = create || false; - this.exclusive = exclusive || false; -}; - -/** - * An interface representing a file system - * - * @constructor - * {DOMString} name the unique name of the file system (readonly) - * {DirectoryEntry} root directory of the file system (readonly) - */ -var FileSystem = function() { - this.name = null; - this.root = null; -}; - -/** - * An interface that lists the files and directories in a directory. - * @constructor - */ -var DirectoryReader = function(fullPath){ - this.fullPath = fullPath || null; -}; - -/** - * Returns a list of entries from a directory. - * - * @param {Function} successCallback is called with a list of entries - * @param {Function} errorCallback is called with a FileError - */ -DirectoryReader.prototype.readEntries = function(successCallback, errorCallback) { - PhoneGap.exec(successCallback, errorCallback, "File", "readEntries", [this.fullPath]); -}; - -/** - * An interface representing a directory on the file system. - * - * @constructor - * {boolean} isFile always false (readonly) - * {boolean} isDirectory always true (readonly) - * {DOMString} name of the directory, excluding the path leading to it (readonly) - * {DOMString} fullPath the absolute full path to the directory (readonly) - * {FileSystem} filesystem on which the directory resides (readonly) - */ -var DirectoryEntry = function() { - this.isFile = false; - this.isDirectory = true; - this.name = null; - this.fullPath = null; - this.filesystem = null; -}; - -/** - * Copies a directory to a new location - * - * @param {DirectoryEntry} parent the directory to which to copy the entry - * @param {DOMString} newName the new name of the entry, defaults to the current name - * @param {Function} successCallback is called with the new entry - * @param {Function} errorCallback is called with a FileError - */ -DirectoryEntry.prototype.copyTo = function(parent, newName, successCallback, errorCallback) { - PhoneGap.exec(successCallback, errorCallback, "File", "copyTo", [this.fullPath, parent, newName]); -}; - -/** - * Looks up the metadata of the entry - * - * @param {Function} successCallback is called with a Metadata object - * @param {Function} errorCallback is called with a FileError - */ -DirectoryEntry.prototype.getMetadata = function(successCallback, errorCallback) { - PhoneGap.exec(successCallback, errorCallback, "File", "getMetadata", [this.fullPath]); -}; - -/** - * Gets the parent of the entry - * - * @param {Function} successCallback is called with a parent entry - * @param {Function} errorCallback is called with a FileError - */ -DirectoryEntry.prototype.getParent = function(successCallback, errorCallback) { - PhoneGap.exec(successCallback, errorCallback, "File", "getParent", [this.fullPath]); -}; - -/** - * Moves a directory to a new location - * - * @param {DirectoryEntry} parent the directory to which to move the entry - * @param {DOMString} newName the new name of the entry, defaults to the current name - * @param {Function} successCallback is called with the new entry - * @param {Function} errorCallback is called with a FileError - */ -DirectoryEntry.prototype.moveTo = function(parent, newName, successCallback, errorCallback) { - PhoneGap.exec(successCallback, errorCallback, "File", "moveTo", [this.fullPath, parent, newName]); -}; - -/** - * Removes the entry - * - * @param {Function} successCallback is called with no parameters - * @param {Function} errorCallback is called with a FileError - */ -DirectoryEntry.prototype.remove = function(successCallback, errorCallback) { - PhoneGap.exec(successCallback, errorCallback, "File", "remove", [this.fullPath]); -}; - -/** - * Returns a URI that can be used to identify this entry. - * - * @param {DOMString} mimeType for a FileEntry, the mime type to be used to interpret the file, when loaded through this URI. - * @return uri - */ -DirectoryEntry.prototype.toURI = function(mimeType) { - return "file://" + this.fullPath; -}; - -/** - * Creates a new DirectoryReader to read entries from this directory - */ -DirectoryEntry.prototype.createReader = function(successCallback, errorCallback) { - return new DirectoryReader(this.fullPath); -}; - -/** - * Creates or looks up a directory - * - * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a directory - * @param {Flags} options to create or excluively create the directory - * @param {Function} successCallback is called with the new entry - * @param {Function} errorCallback is called with a FileError - */ -DirectoryEntry.prototype.getDirectory = function(path, options, successCallback, errorCallback) { - PhoneGap.exec(successCallback, errorCallback, "File", "getDirectory", [this.fullPath, path, options]); -}; - -/** - * Creates or looks up a file - * - * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a file - * @param {Flags} options to create or excluively create the file - * @param {Function} successCallback is called with the new entry - * @param {Function} errorCallback is called with a FileError - */ -DirectoryEntry.prototype.getFile = function(path, options, successCallback, errorCallback) { - PhoneGap.exec(successCallback, errorCallback, "File", "getFile", [this.fullPath, path, options]); -}; - -/** - * Deletes a directory and all of it's contents - * - * @param {Function} successCallback is called with no parameters - * @param {Function} errorCallback is called with a FileError - */ -DirectoryEntry.prototype.removeRecursively = function(successCallback, errorCallback) { - PhoneGap.exec(successCallback, errorCallback, "File", "removeRecursively", [this.fullPath]); -}; - -/** - * An interface representing a directory on the file system. - * - * @constructor - * {boolean} isFile always true (readonly) - * {boolean} isDirectory always false (readonly) - * {DOMString} name of the file, excluding the path leading to it (readonly) - * {DOMString} fullPath the absolute full path to the file (readonly) - * {FileSystem} filesystem on which the directory resides (readonly) - */ -var FileEntry = function() { - this.isFile = true; - this.isDirectory = false; - this.name = null; - this.fullPath = null; - this.filesystem = null; -}; - -/** - * Copies a file to a new location - * - * @param {DirectoryEntry} parent the directory to which to copy the entry - * @param {DOMString} newName the new name of the entry, defaults to the current name - * @param {Function} successCallback is called with the new entry - * @param {Function} errorCallback is called with a FileError - */ -FileEntry.prototype.copyTo = function(parent, newName, successCallback, errorCallback) { - PhoneGap.exec(successCallback, errorCallback, "File", "copyTo", [this.fullPath, parent, newName]); -}; - -/** - * Looks up the metadata of the entry - * - * @param {Function} successCallback is called with a Metadata object - * @param {Function} errorCallback is called with a FileError - */ -FileEntry.prototype.getMetadata = function(successCallback, errorCallback) { - PhoneGap.exec(successCallback, errorCallback, "File", "getMetadata", [this.fullPath]); -}; - -/** - * Gets the parent of the entry - * - * @param {Function} successCallback is called with a parent entry - * @param {Function} errorCallback is called with a FileError - */ -FileEntry.prototype.getParent = function(successCallback, errorCallback) { - PhoneGap.exec(successCallback, errorCallback, "File", "getParent", [this.fullPath]); -}; - -/** - * Moves a directory to a new location - * - * @param {DirectoryEntry} parent the directory to which to move the entry - * @param {DOMString} newName the new name of the entry, defaults to the current name - * @param {Function} successCallback is called with the new entry - * @param {Function} errorCallback is called with a FileError - */ -FileEntry.prototype.moveTo = function(parent, newName, successCallback, errorCallback) { - PhoneGap.exec(successCallback, errorCallback, "File", "moveTo", [this.fullPath, parent, newName]); -}; - -/** - * Removes the entry - * - * @param {Function} successCallback is called with no parameters - * @param {Function} errorCallback is called with a FileError - */ -FileEntry.prototype.remove = function(successCallback, errorCallback) { - PhoneGap.exec(successCallback, errorCallback, "File", "remove", [this.fullPath]); -}; - -/** - * Returns a URI that can be used to identify this entry. - * - * @param {DOMString} mimeType for a FileEntry, the mime type to be used to interpret the file, when loaded through this URI. - * @return uri - */ -FileEntry.prototype.toURI = function(mimeType) { - return "file://" + this.fullPath; -}; - -/** - * Creates a new FileWriter associated with the file that this FileEntry represents. - * - * @param {Function} successCallback is called with the new FileWriter - * @param {Function} errorCallback is called with a FileError - */ -FileEntry.prototype.createWriter = function(successCallback, errorCallback) { - this.file(function(filePointer) { - var writer = new FileWriter(filePointer); - - if (writer.fileName === null || writer.fileName === "") { - if (typeof errorCallback === "function") { - errorCallback({ - "code": FileError.INVALID_STATE_ERR - }); - } - } - - if (typeof successCallback === "function") { - successCallback(writer); - } - }, errorCallback); -}; - -/** - * Returns a File that represents the current state of the file that this FileEntry represents. - * - * @param {Function} successCallback is called with the new File object - * @param {Function} errorCallback is called with a FileError - */ -FileEntry.prototype.file = function(successCallback, errorCallback) { - PhoneGap.exec(successCallback, errorCallback, "File", "getFileMetadata", [this.fullPath]); -}; - -/** @constructor */ -var LocalFileSystem = function() { -}; - -// File error codes -LocalFileSystem.TEMPORARY = 0; -LocalFileSystem.PERSISTENT = 1; -LocalFileSystem.RESOURCE = 2; -LocalFileSystem.APPLICATION = 3; - -/** - * Requests a filesystem in which to store application data. - * - * @param {int} type of file system being requested - * @param {Function} successCallback is called with the new FileSystem - * @param {Function} errorCallback is called with a FileError - */ -LocalFileSystem.prototype.requestFileSystem = function(type, size, successCallback, errorCallback) { - if (type < 0 || type > 3) { - if (typeof errorCallback === "function") { - errorCallback({ - "code": FileError.SYNTAX_ERR - }); - } - } - else { - PhoneGap.exec(successCallback, errorCallback, "File", "requestFileSystem", [type, size]); - } -}; - -/** - * - * @param {DOMString} uri referring to a local file in a filesystem - * @param {Function} successCallback is called with the new entry - * @param {Function} errorCallback is called with a FileError - */ -LocalFileSystem.prototype.resolveLocalFileSystemURI = function(uri, successCallback, errorCallback) { - PhoneGap.exec(successCallback, errorCallback, "File", "resolveLocalFileSystemURI", [uri]); -}; - -/** -* This function returns and array of contacts. It is required as we need to convert raw -* JSON objects into concrete Contact objects. Currently this method is called after -* navigator.service.contacts.find but before the find methods success call back. -* -* @param a JSON Objects that need to be converted to DirectoryEntry or FileEntry objects. -* @returns an entry -*/ -LocalFileSystem.prototype._castFS = function(pluginResult) { - var entry = null; - entry = new DirectoryEntry(); - entry.isDirectory = pluginResult.message.root.isDirectory; - entry.isFile = pluginResult.message.root.isFile; - entry.name = pluginResult.message.root.name; - entry.fullPath = pluginResult.message.root.fullPath; - pluginResult.message.root = entry; - return pluginResult; -}; - -LocalFileSystem.prototype._castEntry = function(pluginResult) { - var entry = null; - if (pluginResult.message.isDirectory) { - entry = new DirectoryEntry(); - } - else if (pluginResult.message.isFile) { - entry = new FileEntry(); - } - entry.isDirectory = pluginResult.message.isDirectory; - entry.isFile = pluginResult.message.isFile; - entry.name = pluginResult.message.name; - entry.fullPath = pluginResult.message.fullPath; - pluginResult.message = entry; - return pluginResult; -}; - -LocalFileSystem.prototype._castEntries = function(pluginResult) { - var entries = pluginResult.message; - var retVal = []; - for (var i=0; i"); - $(".photo").show(); - filters.none(largeImage); - }, - fail:function(){ - - } -}; - -var filters = { - none: function (imageURI) { - plugins.ImageFilter.none(filters.rendered, { - image: imageURI, - save: 'false', - }); - }, - sunnySide: function (imageURI) { - plugins.ImageFilter.sunnySide(filters.rendered, { - image: imageURI, - save: 'false' - }); - }, - worn: function (imageURI) { - plugins.ImageFilter.worn(filters.rendered, { - image: imageURI, - save: 'false' - }); - }, - vintage: function (imageURI) { - plugins.ImageFilter.vintage(filters.rendered, { - image: imageURI, - save: 'false' - }); - }, - stark: function (imageURI) { - plugins.ImageFilter.stark(filters.rendered, { - image: imageURI, - save: 'false' - }); - }, - pinhole: function (imageURI) { - plugins.ImageFilter.pinhole(filters.rendered, { - image: imageURI, - save: 'true' - }); - }, - rendered: function (msg) { - var myRand=parseInt(Math.random()*99999999); - $(".photo").html(""); - } -} \ No newline at end of file diff --git a/Android/project/assets/www/js/plugins/ImageFilter.js b/Android/project/assets/www/js/plugins/ImageFilter.js deleted file mode 100644 index 1ed5aef..0000000 --- a/Android/project/assets/www/js/plugins/ImageFilter.js +++ /dev/null @@ -1,81 +0,0 @@ -var ImageFilter = function () {}; - -ImageFilter.prototype.clean = function (options) { - - PhoneGap.exec("ImageFilter.clean"); -}; -ImageFilter.prototype.none = function (done,options) { - //console.log(options+" "+done); - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - - return PhoneGap.exec(done,null,"ImageFilter","none",[defaults]); -}; -ImageFilter.prototype.sunnySide = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","sunnySide",[defaults]); -}; -ImageFilter.prototype.worn = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","worn",[defaults]); -}; -ImageFilter.prototype.vintage = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","vintage",[defaults]); -}; -ImageFilter.prototype.stark = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","stark",[defaults]); -}; -ImageFilter.prototype.pinhole = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","pinhole",[defaults]); -}; -ImageFilter.prototype.summer = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","summer",[defaults]); -}; -PhoneGap.addConstructor(function() { - PhoneGap.addPlugin("ImageFilter", new ImageFilter()); -}); \ No newline at end of file diff --git a/Android/project/bin/ImageFilter.apk b/Android/project/bin/ImageFilter.apk deleted file mode 100644 index 90b9718..0000000 Binary files a/Android/project/bin/ImageFilter.apk and /dev/null differ diff --git a/Android/project/bin/classes.dex b/Android/project/bin/classes.dex deleted file mode 100644 index e089f3d..0000000 Binary files a/Android/project/bin/classes.dex and /dev/null differ diff --git a/Android/project/bin/classes/com/drewdahlman/ImageFilter/App.class b/Android/project/bin/classes/com/drewdahlman/ImageFilter/App.class deleted file mode 100644 index a47761c..0000000 Binary files a/Android/project/bin/classes/com/drewdahlman/ImageFilter/App.class and /dev/null differ diff --git a/Android/project/bin/classes/com/drewdahlman/ImageFilter/R$attr.class b/Android/project/bin/classes/com/drewdahlman/ImageFilter/R$attr.class deleted file mode 100644 index 2bd99de..0000000 Binary files a/Android/project/bin/classes/com/drewdahlman/ImageFilter/R$attr.class and /dev/null differ diff --git a/Android/project/bin/classes/com/drewdahlman/ImageFilter/R$drawable.class b/Android/project/bin/classes/com/drewdahlman/ImageFilter/R$drawable.class deleted file mode 100644 index 43871bf..0000000 Binary files a/Android/project/bin/classes/com/drewdahlman/ImageFilter/R$drawable.class and /dev/null differ diff --git a/Android/project/bin/classes/com/drewdahlman/ImageFilter/R$layout.class b/Android/project/bin/classes/com/drewdahlman/ImageFilter/R$layout.class deleted file mode 100644 index da686fa..0000000 Binary files a/Android/project/bin/classes/com/drewdahlman/ImageFilter/R$layout.class and /dev/null differ diff --git a/Android/project/bin/classes/com/drewdahlman/ImageFilter/R$string.class b/Android/project/bin/classes/com/drewdahlman/ImageFilter/R$string.class deleted file mode 100644 index d3ffdc2..0000000 Binary files a/Android/project/bin/classes/com/drewdahlman/ImageFilter/R$string.class and /dev/null differ diff --git a/Android/project/bin/classes/com/drewdahlman/ImageFilter/R$xml.class b/Android/project/bin/classes/com/drewdahlman/ImageFilter/R$xml.class deleted file mode 100644 index 0e2c14e..0000000 Binary files a/Android/project/bin/classes/com/drewdahlman/ImageFilter/R$xml.class and /dev/null differ diff --git a/Android/project/bin/classes/com/drewdahlman/ImageFilter/R.class b/Android/project/bin/classes/com/drewdahlman/ImageFilter/R.class deleted file mode 100644 index a4cb8c1..0000000 Binary files a/Android/project/bin/classes/com/drewdahlman/ImageFilter/R.class and /dev/null differ diff --git a/Android/project/bin/classes/com/phonegap/plugins/imageFilter/Filters.class b/Android/project/bin/classes/com/phonegap/plugins/imageFilter/Filters.class deleted file mode 100644 index 59fd23d..0000000 Binary files a/Android/project/bin/classes/com/phonegap/plugins/imageFilter/Filters.class and /dev/null differ diff --git a/Android/project/bin/classes/com/phonegap/plugins/imageFilter/ImageFilter.class b/Android/project/bin/classes/com/phonegap/plugins/imageFilter/ImageFilter.class deleted file mode 100644 index 07ba1a7..0000000 Binary files a/Android/project/bin/classes/com/phonegap/plugins/imageFilter/ImageFilter.class and /dev/null differ diff --git a/Android/project/bin/res/drawable-hdpi/ic_launcher.png b/Android/project/bin/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index 882eb14..0000000 Binary files a/Android/project/bin/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/Android/project/bin/res/drawable-ldpi/ic_launcher.png b/Android/project/bin/res/drawable-ldpi/ic_launcher.png deleted file mode 100644 index 18689f6..0000000 Binary files a/Android/project/bin/res/drawable-ldpi/ic_launcher.png and /dev/null differ diff --git a/Android/project/bin/res/drawable-mdpi/ic_launcher.png b/Android/project/bin/res/drawable-mdpi/ic_launcher.png deleted file mode 100644 index 02e96b9..0000000 Binary files a/Android/project/bin/res/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/Android/project/bin/res/drawable/blackframe.png b/Android/project/bin/res/drawable/blackframe.png deleted file mode 100644 index 981f46c..0000000 Binary files a/Android/project/bin/res/drawable/blackframe.png and /dev/null differ diff --git a/Android/project/bin/res/drawable/painter.png b/Android/project/bin/res/drawable/painter.png deleted file mode 100644 index 89d94f6..0000000 Binary files a/Android/project/bin/res/drawable/painter.png and /dev/null differ diff --git a/Android/project/bin/res/drawable/vignette2.png b/Android/project/bin/res/drawable/vignette2.png deleted file mode 100644 index 8931249..0000000 Binary files a/Android/project/bin/res/drawable/vignette2.png and /dev/null differ diff --git a/Android/project/bin/res/drawable/vignette3.png b/Android/project/bin/res/drawable/vignette3.png deleted file mode 100644 index ad4e520..0000000 Binary files a/Android/project/bin/res/drawable/vignette3.png and /dev/null differ diff --git a/Android/project/bin/res/drawable/vignette4.png b/Android/project/bin/res/drawable/vignette4.png deleted file mode 100644 index 7329781..0000000 Binary files a/Android/project/bin/res/drawable/vignette4.png and /dev/null differ diff --git a/Android/project/bin/res/drawable/vintage.png b/Android/project/bin/res/drawable/vintage.png deleted file mode 100644 index 6fda93f..0000000 Binary files a/Android/project/bin/res/drawable/vintage.png and /dev/null differ diff --git a/Android/project/bin/resources.ap_ b/Android/project/bin/resources.ap_ deleted file mode 100644 index a01319d..0000000 Binary files a/Android/project/bin/resources.ap_ and /dev/null differ diff --git a/Android/project/gen/com/drewdahlman/ImageFilter/R.java b/Android/project/gen/com/drewdahlman/ImageFilter/R.java deleted file mode 100644 index df1fa22..0000000 --- a/Android/project/gen/com/drewdahlman/ImageFilter/R.java +++ /dev/null @@ -1,33 +0,0 @@ -/* AUTO-GENERATED FILE. DO NOT MODIFY. - * - * This class was automatically generated by the - * aapt tool from the resource data it found. It - * should not be modified by hand. - */ - -package com.drewdahlman.ImageFilter; - -public final class R { - public static final class attr { - } - public static final class drawable { - public static final int blackframe=0x7f020000; - public static final int ic_launcher=0x7f020001; - public static final int painter=0x7f020002; - public static final int vignette2=0x7f020003; - public static final int vignette3=0x7f020004; - public static final int vignette4=0x7f020005; - public static final int vintage=0x7f020006; - } - public static final class layout { - public static final int main=0x7f030000; - } - public static final class string { - public static final int app_name=0x7f050001; - public static final int hello=0x7f050000; - } - public static final class xml { - public static final int phonegap=0x7f040000; - public static final int plugins=0x7f040001; - } -} diff --git a/Android/project/libs/phonegap-1.4.1.jar b/Android/project/libs/phonegap-1.4.1.jar deleted file mode 100755 index a30e021..0000000 Binary files a/Android/project/libs/phonegap-1.4.1.jar and /dev/null differ diff --git a/Android/project/proguard.cfg b/Android/project/proguard.cfg deleted file mode 100644 index b1cdf17..0000000 --- a/Android/project/proguard.cfg +++ /dev/null @@ -1,40 +0,0 @@ --optimizationpasses 5 --dontusemixedcaseclassnames --dontskipnonpubliclibraryclasses --dontpreverify --verbose --optimizations !code/simplification/arithmetic,!field/*,!class/merging/* - --keep public class * extends android.app.Activity --keep public class * extends android.app.Application --keep public class * extends android.app.Service --keep public class * extends android.content.BroadcastReceiver --keep public class * extends android.content.ContentProvider --keep public class * extends android.app.backup.BackupAgentHelper --keep public class * extends android.preference.Preference --keep public class com.android.vending.licensing.ILicensingService - --keepclasseswithmembernames class * { - native ; -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet); -} - --keepclasseswithmembers class * { - public (android.content.Context, android.util.AttributeSet, int); -} - --keepclassmembers class * extends android.app.Activity { - public void *(android.view.View); -} - --keepclassmembers enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - --keep class * implements android.os.Parcelable { - public static final android.os.Parcelable$Creator *; -} diff --git a/Android/project/project.properties b/Android/project/project.properties deleted file mode 100644 index ea89160..0000000 --- a/Android/project/project.properties +++ /dev/null @@ -1,11 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "ant.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-8 diff --git a/Android/project/res/drawable-hdpi/ic_launcher.png b/Android/project/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index 8074c4c..0000000 Binary files a/Android/project/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/Android/project/res/drawable-ldpi/ic_launcher.png b/Android/project/res/drawable-ldpi/ic_launcher.png deleted file mode 100644 index 1095584..0000000 Binary files a/Android/project/res/drawable-ldpi/ic_launcher.png and /dev/null differ diff --git a/Android/project/res/drawable-mdpi/ic_launcher.png b/Android/project/res/drawable-mdpi/ic_launcher.png deleted file mode 100644 index a07c69f..0000000 Binary files a/Android/project/res/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/Android/project/res/drawable/blackframe.png b/Android/project/res/drawable/blackframe.png deleted file mode 100644 index be90f57..0000000 Binary files a/Android/project/res/drawable/blackframe.png and /dev/null differ diff --git a/Android/project/res/drawable/painter.png b/Android/project/res/drawable/painter.png deleted file mode 100644 index 604d8d3..0000000 Binary files a/Android/project/res/drawable/painter.png and /dev/null differ diff --git a/Android/project/res/drawable/vignette2.png b/Android/project/res/drawable/vignette2.png deleted file mode 100644 index d1f0a4f..0000000 Binary files a/Android/project/res/drawable/vignette2.png and /dev/null differ diff --git a/Android/project/res/drawable/vignette3.png b/Android/project/res/drawable/vignette3.png deleted file mode 100644 index d318950..0000000 Binary files a/Android/project/res/drawable/vignette3.png and /dev/null differ diff --git a/Android/project/res/drawable/vignette4.png b/Android/project/res/drawable/vignette4.png deleted file mode 100644 index ea02e9c..0000000 Binary files a/Android/project/res/drawable/vignette4.png and /dev/null differ diff --git a/Android/project/res/drawable/vintage.png b/Android/project/res/drawable/vintage.png deleted file mode 100644 index 0cdb0ea..0000000 Binary files a/Android/project/res/drawable/vintage.png and /dev/null differ diff --git a/Android/project/res/layout/main.xml b/Android/project/res/layout/main.xml deleted file mode 100644 index bc12cd8..0000000 --- a/Android/project/res/layout/main.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Android/project/res/values/strings.xml b/Android/project/res/values/strings.xml deleted file mode 100644 index 487ae00..0000000 --- a/Android/project/res/values/strings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - Hello World, App! - ImageFilter - - \ No newline at end of file diff --git a/Android/project/res/xml/phonegap.xml b/Android/project/res/xml/phonegap.xml deleted file mode 100755 index 97f31ea..0000000 --- a/Android/project/res/xml/phonegap.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/Android/project/res/xml/plugins.xml b/Android/project/res/xml/plugins.xml deleted file mode 100755 index 7187959..0000000 --- a/Android/project/res/xml/plugins.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Android/project/src/com/drewdahlman/ImageFilter/App.java b/Android/project/src/com/drewdahlman/ImageFilter/App.java deleted file mode 100644 index 82f0743..0000000 --- a/Android/project/src/com/drewdahlman/ImageFilter/App.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.drewdahlman.ImageFilter; - -import android.content.Context; -import android.os.Bundle; -import com.phonegap.*; - -public class App extends DroidGap { - public static Context context; - /** Called when the activity is first created. */ - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - super.loadUrl("file:///android_asset/www/index.html"); - context = getApplicationContext(); - - } -} \ No newline at end of file diff --git a/Android/project/src/com/phonegap/plugins/imageFilter/Filters.java b/Android/project/src/com/phonegap/plugins/imageFilter/Filters.java deleted file mode 100644 index 88a4fa1..0000000 --- a/Android/project/src/com/phonegap/plugins/imageFilter/Filters.java +++ /dev/null @@ -1,541 +0,0 @@ -package com.phonegap.plugins.imageFilter; -import org.json.JSONArray; -import org.json.JSONObject; -import android.util.Log; -import java.io.*; -import android.net.Uri; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.graphics.*; -import android.os.*; - -// CHANGE THIS TO YOUR PROJECT -import com.drewdahlman.ImageFilter.*; - -public class Filters{ - - public String none(JSONArray optionsArr) { - - // SET FILE PATH - /* - Be sure to change your storage directory here it is set to ImageFilter - */ - String filePath = ""; - File path = new File(Environment.getExternalStorageDirectory()+"/ImageFilter/"); - - // TMP.jpg is where we store our temporary version of the image - File NBBfile = new File(path, "tmp.jpg"); - - // CREATE FOLDERS IF NEEDED - try{ - boolean success = false; - - if(!path.exists()){ - success = path.mkdir(); - } - if (!success){ - Log.d("NONE","Folder not created."); - } - else{ - Log.d("NONE","Folder created!"); - } - } - catch (Exception e){ - e.printStackTrace(); - } - // GET URL TO IMAGE - final JSONObject options = optionsArr.optJSONObject(0); - String imageURL = options.optString("image"); - - // APPLY FILTER - /* - This is where we will apply our filters - */ - - - // create image bitmap - Bitmap bmp = BitmapFactory.decodeFile(imageURL); - if(bmp.getHeight() >= 655 || bmp.getWidth()>=655){ - bmp = Bitmap.createBitmap(bmp,0,0,655,655); - } - else { - bmp = Bitmap.createBitmap(bmp); - } - - // create image canvas - Canvas canvas = new Canvas(bmp); - Bitmap none = Bitmap.createBitmap(bmp); - canvas.drawBitmap(none,0,0,null); - - // SAVE IMAGE - try { - // OUTPUT STREAM - FileOutputStream out = new FileOutputStream(NBBfile); - none.compress(Bitmap.CompressFormat.JPEG, 100, out); - - // GET FILE PATH - Uri uri = Uri.fromFile(NBBfile); - filePath = uri.toString(); - - // RETURN FILE PATH - return filePath; - - } catch (Exception e) { - e.printStackTrace(); - } - return filePath; - } - public String stark(JSONArray optionsArr) { - - // SET FILE PATH - String filePath = ""; - File path = new File(Environment.getExternalStorageDirectory()+"/ImageFilter/"); - File NBBfile = new File(path, "tmp.jpg"); - - // CREATE FOLDERS IF NEEDED - try{ - boolean success = false; - - if(!path.exists()){ - success = path.mkdir(); - } - if (!success){ - Log.d("NONE","Folder not created."); - } - else{ - Log.d("NONE","Folder created!"); - } - - } - catch (Exception e){ - e.printStackTrace(); - } - - // GET URL TO IMAGE - final JSONObject options = optionsArr.optJSONObject(0); - String imageURL = options.optString("image"); - - // APPLY FILTER - - - // create image bitmap - Bitmap bmp = BitmapFactory.decodeFile(imageURL); - if(bmp.getHeight() >= 655 || bmp.getWidth()>=655){ - bmp = Bitmap.createBitmap(bmp,0,0,655,655); - } - else { - bmp = Bitmap.createBitmap(bmp); - } - - // create image canvas - Bitmap none = Bitmap.createBitmap(bmp); - - Canvas canvas = new Canvas(none); - canvas.drawBitmap(none,0,0,null); - - // BORDER - Context context = MyApplication.getAppContext(); - Bitmap border = BitmapFactory.decodeResource(context.getResources(),R.drawable.painter); - - - canvas.drawBitmap(border,0,0,null); - - Paint spaint = new Paint(); - ColorMatrix scm = new ColorMatrix(); - - scm.setSaturation(0); - final float m[] = scm.getArray(); - final float c = 1; - scm.set(new float[] { - m[ 0] * c, m[ 1] * c, m[ 2] * c, m[ 3] * c, m[ 4] * c + 15, - m[ 5] * c, m[ 6] * c, m[ 7] * c, m[ 8] * c, m[ 9] * c + 8, - m[10] * c, m[11] * c, m[12] * c, m[13] * c, m[14] * c + 10, - m[15] , m[16] , m[17] , m[18] , m[19] }); - - spaint.setColorFilter(new ColorMatrixColorFilter(scm)); - Matrix smatrix = new Matrix(); - canvas.drawBitmap(none, smatrix, spaint); - - Paint paint = new Paint(); - ColorMatrix cm = new ColorMatrix(); - - cm.set(new float[] { - 1, 0, 0, 0, -90, - 0, 1, 0, 0, -90, - 0, 0, 1, 0, -90, - 0, 0, 0, 1, 0 }); - paint.setColorFilter(new ColorMatrixColorFilter(cm)); - Matrix matrix = new Matrix(); - canvas.drawBitmap(none, matrix, paint); - - - // SAVE IMAGE - try { - - // OUTPUT STREAM - FileOutputStream out = new FileOutputStream(NBBfile); - none.compress(Bitmap.CompressFormat.JPEG, 100, out); - - // GET FILE PATH - Uri uri = Uri.fromFile(NBBfile); - filePath = uri.toString(); - - // RETURN FILE PATH - return filePath; - - - } catch (Exception e) { - e.printStackTrace(); - } - return filePath; - } - public String sunnyside(JSONArray optionsArr) { - - // SET FILE PATH - String filePath = ""; - File path = new File(Environment.getExternalStorageDirectory()+"/ImageFilter/"); - File NBBfile = new File(path, "tmp.jpg"); - - // CREATE FOLDERS IF NEEDED - try{ - boolean success = false; - - if(!path.exists()){ - success = path.mkdir(); - } - if (!success){ - Log.d("NONE","Folder not created."); - } - else{ - Log.d("NONE","Folder created!"); - } - - - } - catch (Exception e){ - e.printStackTrace(); - } - // GET URL TO IMAGE - final JSONObject options = optionsArr.optJSONObject(0); - String imageURL = options.optString("image"); - - // APPLY FILTER - - - // create image bitmap - Bitmap bmp = BitmapFactory.decodeFile(imageURL); - if(bmp.getHeight() >= 655 || bmp.getWidth()>=655){ - bmp = Bitmap.createBitmap(bmp,0,0,655,655); - } - else { - bmp = Bitmap.createBitmap(bmp); - } - - // create image canvas - Bitmap none = Bitmap.createBitmap(bmp); - - Canvas canvas = new Canvas(none); - canvas.drawBitmap(none,0,0,null); - - - /*Bitmap color = boost(none,1,1); - canvas.drawBitmap(color,0,0,null); - - Bitmap color2 = boost(none,2,1); - canvas.drawBitmap(color2,0,0,null);*/ - Paint paint = new Paint(); - ColorMatrix cm = new ColorMatrix(); - - cm.set(new float[] { - 1, 0, 0, 0, 10, - 0, 1, 0, 0, 10, - 0, 0, 1, 0, -60, - 0, 0, 0, 1, 0 }); - paint.setColorFilter(new ColorMatrixColorFilter(cm)); - Matrix matrix = new Matrix(); - canvas.drawBitmap(none, matrix, paint); - - // BORDER - - Bitmap border = BitmapFactory.decodeResource(App.context.getResources(),R.drawable.painter); - Bitmap scaledBorder = Bitmap.createScaledBitmap(border,655,655,false); - - canvas.drawBitmap(scaledBorder,0,0,null); - - - // SAVE IMAGE - try { - - // OUTPUT STREAM - FileOutputStream out = new FileOutputStream(NBBfile); - none.compress(Bitmap.CompressFormat.JPEG, 100, out); - - // GET FILE PATH - Uri uri = Uri.fromFile(NBBfile); - filePath = uri.toString(); - - // RETURN FILE PATH - return filePath; - - - } catch (Exception e) { - e.printStackTrace(); - } - return filePath; - } - public String pinhole(JSONArray optionsArr) { - - // SET FILE PATH - String filePath = ""; - File path = new File(Environment.getExternalStorageDirectory()+"/ImageFilter/"); - File NBBfile = new File(path, "tmp.jpg"); - - // CREATE FOLDERS IF NEEDED - try{ - boolean success = false; - - if(!path.exists()){ - success = path.mkdir(); - } - if (!success){ - Log.d("NONE","Folder not created."); - } - else{ - Log.d("NONE","Folder created!"); - } - - - } - catch (Exception e){ - e.printStackTrace(); - } - // GET URL TO IMAGE - final JSONObject options = optionsArr.optJSONObject(0); - String imageURL = options.optString("image"); - - // APPLY FILTER - - - // create image bitmap - Bitmap bmp = BitmapFactory.decodeFile(imageURL); - if(bmp.getHeight() >= 655 || bmp.getWidth()>=655){ - bmp = Bitmap.createBitmap(bmp,0,0,655,655); - } - else { - bmp = Bitmap.createBitmap(bmp); - } - - // create image canvas - Bitmap none = Bitmap.createBitmap(bmp); - - Canvas canvas = new Canvas(none); - canvas.drawBitmap(none,0,0,null); - - - - // BORDER - - Bitmap border = BitmapFactory.decodeResource(App.context.getResources(),R.drawable.vignette3); - Bitmap scaledBorder = Bitmap.createScaledBitmap(border,655,655,false); - - canvas.drawBitmap(scaledBorder,0,0,null); - - - // SAVE IMAGE - try { - - // OUTPUT STREAM - FileOutputStream out = new FileOutputStream(NBBfile); - none.compress(Bitmap.CompressFormat.JPEG, 100, out); - - // GET FILE PATH - Uri uri = Uri.fromFile(NBBfile); - filePath = uri.toString(); - - // RETURN FILE PATH - return filePath; - - - } catch (Exception e) { - e.printStackTrace(); - } - return filePath; - } - public String vintage(JSONArray optionsArr) { - - // SET FILE PATH - String filePath = ""; - File path = new File(Environment.getExternalStorageDirectory()+"/ImageFilter/"); - File NBBfile = new File(path, "tmp.jpg"); - - // CREATE FOLDERS IF NEEDED - try{ - boolean success = false; - - if(!path.exists()){ - success = path.mkdir(); - } - if (!success){ - Log.d("NONE","Folder not created."); - } - else{ - Log.d("NONE","Folder created!"); - } - - - } - catch (Exception e){ - e.printStackTrace(); - } - // GET URL TO IMAGE - final JSONObject options = optionsArr.optJSONObject(0); - String imageURL = options.optString("image"); - - // APPLY FILTER - - - // create image bitmap - Bitmap bmp = BitmapFactory.decodeFile(imageURL); - if(bmp.getHeight() >= 655 || bmp.getWidth()>=655){ - bmp = Bitmap.createBitmap(bmp,0,0,655,655); - } - else { - bmp = Bitmap.createBitmap(bmp); - } - - // create image canvas - Bitmap none = Bitmap.createBitmap(bmp); - - Canvas canvas = new Canvas(none); - canvas.drawBitmap(none,0,0,null); - - Paint paint = new Paint(); - ColorMatrix cm = new ColorMatrix(); - - cm.set(new float[] { - 1, 0, 0, 0, -60, - 0, 1, 0, 0, -60, - 0, 0, 1, 0, -60, - 0, 0, 0, 1, 0 }); - paint.setColorFilter(new ColorMatrixColorFilter(cm)); - Matrix matrix = new Matrix(); - canvas.drawBitmap(none, matrix, paint); - - // BORDER - - Bitmap border = BitmapFactory.decodeResource(App.context.getResources(),R.drawable.blackframe); - Bitmap scaledBorder = Bitmap.createScaledBitmap(border,655,655,false); - - canvas.drawBitmap(scaledBorder,0,0,null); - - - // SAVE IMAGE - try { - - // OUTPUT STREAM - FileOutputStream out = new FileOutputStream(NBBfile); - none.compress(Bitmap.CompressFormat.JPEG, 100, out); - - // GET FILE PATH - Uri uri = Uri.fromFile(NBBfile); - filePath = uri.toString(); - - // RETURN FILE PATH - return filePath; - - - } catch (Exception e) { - e.printStackTrace(); - } - return filePath; - } - public String worn(JSONArray optionsArr) { - - // SET FILE PATH - String filePath = ""; - File path = new File(Environment.getExternalStorageDirectory()+"/ImageFilter/"); - File NBBfile = new File(path, "tmp.jpg"); - - // CREATE FOLDERS IF NEEDED - try{ - boolean success = false; - - if(!path.exists()){ - success = path.mkdir(); - } - if (!success){ - Log.d("NONE","Folder not created."); - } - else{ - Log.d("NONE","Folder created!"); - } - - - } - catch (Exception e){ - e.printStackTrace(); - } - // GET URL TO IMAGE - final JSONObject options = optionsArr.optJSONObject(0); - String imageURL = options.optString("image"); - - // APPLY FILTER - - - // create image bitmap - Bitmap bmp = BitmapFactory.decodeFile(imageURL); - if(bmp.getHeight() >= 655 || bmp.getWidth()>=655){ - bmp = Bitmap.createBitmap(bmp,0,0,655,655); - } - else { - bmp = Bitmap.createBitmap(bmp); - } - - // create image canvas - Bitmap none = Bitmap.createBitmap(bmp); - - Canvas canvas = new Canvas(none); - canvas.drawBitmap(none,0,0,null); - - Paint paint = new Paint(); - ColorMatrix cm = new ColorMatrix(); - - cm.set(new float[] { - 1, 0, 0, 0, -60, - 0, 1, 0, 0, -60, - 0, 0, 1, 0, -90, - 0, 0, 0, 1, 0 }); - paint.setColorFilter(new ColorMatrixColorFilter(cm)); - Matrix matrix = new Matrix(); - canvas.drawBitmap(none, matrix, paint); - - // BORDER - - Bitmap border = BitmapFactory.decodeResource(App.context.getResources(),R.drawable.vignette4); - Bitmap scaledBorder = Bitmap.createScaledBitmap(border,655,655,false); - - canvas.drawBitmap(scaledBorder,0,0,null); - - - // SAVE IMAGE - try { - - // OUTPUT STREAM - FileOutputStream out = new FileOutputStream(NBBfile); - none.compress(Bitmap.CompressFormat.JPEG, 100, out); - - // GET FILE PATH - Uri uri = Uri.fromFile(NBBfile); - filePath = uri.toString(); - - // RETURN FILE PATH - return filePath; - - - } catch (Exception e) { - e.printStackTrace(); - } - return filePath; - } -} - diff --git a/Android/project/src/com/phonegap/plugins/imageFilter/ImageFilter.java b/Android/project/src/com/phonegap/plugins/imageFilter/ImageFilter.java deleted file mode 100644 index 32c5be2..0000000 --- a/Android/project/src/com/phonegap/plugins/imageFilter/ImageFilter.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.phonegap.plugins.imageFilter; - -import org.json.JSONArray; - -import android.util.Log; - -import com.phonegap.api.Plugin; -import com.phonegap.api.PluginResult; -import com.phonegap.api.PluginResult.Status; - - -public class ImageFilter extends Plugin { - - @Override - public PluginResult execute(String action, JSONArray optionsArr, String callBackId){ - Log.d("imageFilter", "PLUGIN execute called with action: "+ action); - PluginResult result = null; - - final Filters filters = new Filters(); - - if(action.equalsIgnoreCase("none")){ - String fileInfo = filters.none(optionsArr); - result = new PluginResult(Status.OK, fileInfo); - } - if(action.equalsIgnoreCase("stark")){ - String fileInfo = filters.stark(optionsArr); - result = new PluginResult(Status.OK, fileInfo); - } - if(action.equalsIgnoreCase("sunnySide")){ - String fileInfo = filters.sunnyside(optionsArr); - result = new PluginResult(Status.OK, fileInfo); - } - if(action.equalsIgnoreCase("pinhole")){ - String fileInfo = filters.pinhole(optionsArr); - result = new PluginResult(Status.OK, fileInfo); - } - if(action.equalsIgnoreCase("vintage")){ - String fileInfo = filters.vintage(optionsArr); - result = new PluginResult(Status.OK, fileInfo); - } - if(action.equalsIgnoreCase("worn")){ - String fileInfo = filters.worn(optionsArr); - result = new PluginResult(Status.OK, fileInfo); - } - - return result; - } - -} \ No newline at end of file diff --git a/Android/readme.md b/Android/readme.md deleted file mode 100644 index 74a7868..0000000 --- a/Android/readme.md +++ /dev/null @@ -1,19 +0,0 @@ -ImageFilter - -ImageFilter is an easy to use phonegap/Cordova plugin that allows you to apply filters to images and save them out as hi-res versions. - -Read more here http://www.drewdahlman.com/meusLabs/?p=181 - -To USE:
-
-plugins.ImageFilter.FILTER_NAME(
-	successCallback{
-	image:imageURI,
-	save:'false' // TRUE IF SAVE
-});
-
- -
NOTES:

- -UPDATES
- diff --git a/iOS/cordova/example/www/css/style.css b/iOS/cordova/example/www/css/style.css deleted file mode 100644 index 8ea9325..0000000 --- a/iOS/cordova/example/www/css/style.css +++ /dev/null @@ -1,68 +0,0 @@ -*{ - margin:0px; -} -body { - height:100%; - width:100%; - font-family:'helvetica'; - font-size:12px; -} -#header { - width:320px; - position:relative; - top:0px; - left:0px; - margin-bottom:10px; -} -#wrapper { - width:100%; - margin:auto; - position:relative; -} -#buttons { - width:310px; - margin:auto; -} -.btn { - width:auto; - padding:10px; - background-color:#95abb7; - color:#fff; - font-size:15px; - border-radius:5px; - margin-bottom:10px; - font-weight:bold; - text-align:center; -} -.photo { - height:310px; - width:310px; - overflow:hidden; - position:relative; - margin:auto; - display:none; - margin-bottom:10px; -} -.photo img { - height:310px; - width:310px; -} -.filterIcon { - height:70px; - width:70px; - border-radius:5px; - overflow:hidden; - box-shadow:0px 0px 2px #222; -} -.filterText { - color:#222; - width:70px; - text-align:center; -} -.filter { - text-align:center; - width:70px; - float:left; - margin-right:10px; - margin-left:10px; -} \ No newline at end of file diff --git a/iOS/cordova/example/www/images/filters/none.png b/iOS/cordova/example/www/images/filters/none.png deleted file mode 100644 index e17ea9b..0000000 Binary files a/iOS/cordova/example/www/images/filters/none.png and /dev/null differ diff --git a/iOS/cordova/example/www/images/filters/stark.png b/iOS/cordova/example/www/images/filters/stark.png deleted file mode 100644 index 9fe311a..0000000 Binary files a/iOS/cordova/example/www/images/filters/stark.png and /dev/null differ diff --git a/iOS/cordova/example/www/images/filters/sunnySide.png b/iOS/cordova/example/www/images/filters/sunnySide.png deleted file mode 100644 index b73afe9..0000000 Binary files a/iOS/cordova/example/www/images/filters/sunnySide.png and /dev/null differ diff --git a/iOS/cordova/example/www/images/filters/vintage.png b/iOS/cordova/example/www/images/filters/vintage.png deleted file mode 100644 index 66618c8..0000000 Binary files a/iOS/cordova/example/www/images/filters/vintage.png and /dev/null differ diff --git a/iOS/cordova/example/www/images/filters/worn.png b/iOS/cordova/example/www/images/filters/worn.png deleted file mode 100644 index c5cd994..0000000 Binary files a/iOS/cordova/example/www/images/filters/worn.png and /dev/null differ diff --git a/iOS/cordova/example/www/images/header.png b/iOS/cordova/example/www/images/header.png deleted file mode 100644 index c8b4f49..0000000 Binary files a/iOS/cordova/example/www/images/header.png and /dev/null differ diff --git a/iOS/cordova/example/www/index.html b/iOS/cordova/example/www/index.html deleted file mode 100644 index 34d7c98..0000000 --- a/iOS/cordova/example/www/index.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
-
use camera
-
use library
-
- - - -
- -
- -
-
-
-
none
-
-
-
-
sunnySide
-
-
-
-
worn
-
-
-
-
vintage
-
-
-
-
stark
-
-
-
- - - -
-
- - diff --git a/iOS/cordova/example/www/js/core/jQuery.js b/iOS/cordova/example/www/js/core/jQuery.js deleted file mode 100644 index 198b3ff..0000000 --- a/iOS/cordova/example/www/js/core/jQuery.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.7.1 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; -f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() -{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/iOS/cordova/example/www/js/core/phonegap-1.2.0.js b/iOS/cordova/example/www/js/core/phonegap-1.2.0.js deleted file mode 100644 index 31506d7..0000000 --- a/iOS/cordova/example/www/js/core/phonegap-1.2.0.js +++ /dev/null @@ -1,4098 +0,0 @@ -/* - * PhoneGap v1.2.0 is available under *either* the terms of the modified BSD license *or* the - * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text. - * - * Copyright (c) 2005-2010, Nitobi Software Inc. - * Copyright (c) 2010-2011, IBM Corporation - * Copyright (c) 2011, Codevise Solutions Ltd. - * Copyright (c) 2011, Proyectos Equis Ka, S.L. - * - */ - -if (typeof PhoneGap === "undefined") { - -if (typeof(DeviceInfo) !== 'object'){ - DeviceInfo = {}; -} -/** - * This represents the PhoneGap API itself, and provides a global namespace for accessing - * information about the state of PhoneGap. - * @class - */ -PhoneGap = { - // This queue holds the currently executing command and all pending - // commands executed with PhoneGap.exec(). - commandQueue: [], - // Indicates if we're currently in the middle of flushing the command - // queue on the native side. - commandQueueFlushing: false, - _constructors: [], - documentEventHandler: {}, // Collection of custom document event handlers - windowEventHandler: {} -}; - -/** - * List of resource files loaded by PhoneGap. - * This is used to ensure JS and other files are loaded only once. - */ -PhoneGap.resources = {base: true}; - -/** - * Determine if resource has been loaded by PhoneGap - * - * @param name - * @return - */ -PhoneGap.hasResource = function(name) { - return PhoneGap.resources[name]; -}; - -/** - * Add a resource to list of loaded resources by PhoneGap - * - * @param name - */ -PhoneGap.addResource = function(name) { - PhoneGap.resources[name] = true; -}; - -/** - * Boolean flag indicating if the PhoneGap API is available and initialized. - */ // TODO: Remove this, it is unused here ... -jm -PhoneGap.available = DeviceInfo.uuid != undefined; - -/** - * Add an initialization function to a queue that ensures it will run and initialize - * application constructors only once PhoneGap has been initialized. - * @param {Function} func The function callback you want run once PhoneGap is initialized - */ -PhoneGap.addConstructor = function(func) { - var state = document.readyState; - if ( ( state == 'loaded' || state == 'complete' ) && DeviceInfo.uuid != null ) - { - func(); - } - else - { - PhoneGap._constructors.push(func); - } -}; - -(function() - { - var timer = setInterval(function() - { - - var state = document.readyState; - - if ( ( state == 'loaded' || state == 'complete' ) && DeviceInfo.uuid != null ) - { - clearInterval(timer); // stop looking - // run our constructors list - while (PhoneGap._constructors.length > 0) - { - var constructor = PhoneGap._constructors.shift(); - try - { - constructor(); - } - catch(e) - { - if (typeof(console['log']) == 'function') - { - console.log("Failed to run constructor: " + console.processMessage(e)); - } - else - { - alert("Failed to run constructor: " + e.message); - } - } - } - // all constructors run, now fire the deviceready event - var e = document.createEvent('Events'); - e.initEvent('deviceready'); - document.dispatchEvent(e); - } - }, 1); -})(); - -// session id for calls -PhoneGap.sessionKey = 0; - -// centralized callbacks -PhoneGap.callbackId = 0; -PhoneGap.callbacks = {}; -PhoneGap.callbackStatus = { - NO_RESULT: 0, - OK: 1, - CLASS_NOT_FOUND_EXCEPTION: 2, - ILLEGAL_ACCESS_EXCEPTION: 3, - INSTANTIATION_EXCEPTION: 4, - MALFORMED_URL_EXCEPTION: 5, - IO_EXCEPTION: 6, - INVALID_ACTION: 7, - JSON_EXCEPTION: 8, - ERROR: 9 - }; - -/** - * Creates a gap bridge iframe used to notify the native code about queued - * commands. - * - * @private - */ -PhoneGap.createGapBridge = function() { - gapBridge = document.createElement("iframe"); - gapBridge.setAttribute("style", "display:none;"); - gapBridge.setAttribute("height","0px"); - gapBridge.setAttribute("width","0px"); - gapBridge.setAttribute("frameborder","0"); - document.documentElement.appendChild(gapBridge); - return gapBridge; -} - -/** - * Execute a PhoneGap command by queuing it and letting the native side know - * there are queued commands. The native side will then request all of the - * queued commands and execute them. - * - * Arguments may be in one of two formats: - * - * FORMAT ONE (preferable) - * The native side will call PhoneGap.callbackSuccess or - * PhoneGap.callbackError, depending upon the result of the action. - * - * @param {Function} success The success callback - * @param {Function} fail The fail callback - * @param {String} service The name of the service to use - * @param {String} action The name of the action to use - * @param {String[]} [args] Zero or more arguments to pass to the method - * - * FORMAT TWO - * @param {String} command Command to be run in PhoneGap, e.g. - * "ClassName.method" - * @param {String[]} [args] Zero or more arguments to pass to the method - * object parameters are passed as an array object - * [object1, object2] each object will be passed as - * JSON strings - */ -PhoneGap.exec = function() { - if (!PhoneGap.available) { - alert("ERROR: Attempting to call PhoneGap.exec()" - +" before 'deviceready'. Ignoring."); - return; - } - - var successCallback, failCallback, service, action, actionArgs; - var callbackId = null; - if (typeof arguments[0] !== "string") { - // FORMAT ONE - successCallback = arguments[0]; - failCallback = arguments[1]; - service = arguments[2]; - action = arguments[3]; - actionArgs = arguments[4]; - - // Since we need to maintain backwards compatibility, we have to pass - // an invalid callbackId even if no callback was provided since plugins - // will be expecting it. The PhoneGap.exec() implementation allocates - // an invalid callbackId and passes it even if no callbacks were given. - callbackId = 'INVALID'; - } else { - // FORMAT TWO - splitCommand = arguments[0].split("."); - action = splitCommand.pop(); - service = splitCommand.join("."); - actionArgs = Array.prototype.splice.call(arguments, 1); - } - - // Start building the command object. - var command = { - className: service, - methodName: action, - arguments: [] - }; - - // Register the callbacks and add the callbackId to the positional - // arguments if given. - if (successCallback || failCallback) { - callbackId = service + PhoneGap.callbackId++; - PhoneGap.callbacks[callbackId] = - {success:successCallback, fail:failCallback}; - } - if (callbackId != null) { - command.arguments.push(callbackId); - } - - for (var i = 0; i < actionArgs.length; ++i) { - var arg = actionArgs[i]; - if (arg == undefined || arg == null) { - continue; - } else if (typeof(arg) == 'object') { - command.options = arg; - } else { - command.arguments.push(arg); - } - } - - // Stringify and queue the command. We stringify to command now to - // effectively clone the command arguments in case they are mutated before - // the command is executed. - PhoneGap.commandQueue.push(JSON.stringify(command)); - - // If the queue length is 1, then that means it was empty before we queued - // the given command, so let the native side know that we have some - // commands to execute, unless the queue is currently being flushed, in - // which case the command will be picked up without notification. - if (PhoneGap.commandQueue.length == 1 && !PhoneGap.commandQueueFlushing) { - if (!PhoneGap.gapBridge) { - PhoneGap.gapBridge = PhoneGap.createGapBridge(); - } - - PhoneGap.gapBridge.src = "gap://ready"; - } -} - -/** - * Called by native code to retrieve all queued commands and clear the queue. - */ -PhoneGap.getAndClearQueuedCommands = function() { - json = JSON.stringify(PhoneGap.commandQueue); - PhoneGap.commandQueue = []; - return json; -} - -/** - * Called by native code when returning successful result from an action. - * - * @param callbackId - * @param args - * args.status - PhoneGap.callbackStatus - * args.message - return value - * args.keepCallback - 0 to remove callback, 1 to keep callback in PhoneGap.callbacks[] - */ -PhoneGap.callbackSuccess = function(callbackId, args) { - if (PhoneGap.callbacks[callbackId]) { - - // If result is to be sent to callback - if (args.status == PhoneGap.callbackStatus.OK) { - try { - if (PhoneGap.callbacks[callbackId].success) { - PhoneGap.callbacks[callbackId].success(args.message); - } - } - catch (e) { - console.log("Error in success callback: "+callbackId+" = "+e); - } - } - - // Clear callback if not expecting any more results - if (!args.keepCallback) { - delete PhoneGap.callbacks[callbackId]; - } - } -}; - -/** - * Called by native code when returning error result from an action. - * - * @param callbackId - * @param args - */ -PhoneGap.callbackError = function(callbackId, args) { - if (PhoneGap.callbacks[callbackId]) { - try { - if (PhoneGap.callbacks[callbackId].fail) { - PhoneGap.callbacks[callbackId].fail(args.message); - } - } - catch (e) { - console.log("Error in error callback: "+callbackId+" = "+e); - } - - // Clear callback if not expecting any more results - if (!args.keepCallback) { - delete PhoneGap.callbacks[callbackId]; - } - } -}; - - -/** - * Does a deep clone of the object. - * - * @param obj - * @return - */ -PhoneGap.clone = function(obj) { - if(!obj) { - return obj; - } - - if(obj instanceof Array){ - var retVal = new Array(); - for(var i = 0; i < obj.length; ++i){ - retVal.push(PhoneGap.clone(obj[i])); - } - return retVal; - } - - if (obj instanceof Function) { - return obj; - } - - if(!(obj instanceof Object)){ - return obj; - } - - if (obj instanceof Date) { - return obj; - } - - retVal = new Object(); - for(i in obj){ - if(!(i in retVal) || retVal[i] != obj[i]) { - retVal[i] = PhoneGap.clone(obj[i]); - } - } - return retVal; -}; - -// Intercept calls to document.addEventListener -PhoneGap.m_document_addEventListener = document.addEventListener; - -// Intercept calls to window.addEventListener -PhoneGap.m_window_addEventListener = window.addEventListener; - -/** - * Add a custom window event handler. - * - * @param {String} event The event name that callback handles - * @param {Function} callback The event handler - */ -PhoneGap.addWindowEventHandler = function(event, callback) { - PhoneGap.windowEventHandler[event] = callback; -} - -/** - * Add a custom document event handler. - * - * @param {String} event The event name that callback handles - * @param {Function} callback The event handler - */ -PhoneGap.addDocumentEventHandler = function(event, callback) { - PhoneGap.documentEventHandler[event] = callback; -} - -/** - * Intercept adding document event listeners and handle our own - * - * @param {Object} evt - * @param {Function} handler - * @param capture - */ -document.addEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - - // If subscribing to an event that is handled by a plugin - if (typeof PhoneGap.documentEventHandler[e] !== "undefined") { - if (PhoneGap.documentEventHandler[e](e, handler, true)) { - return; // Stop default behavior - } - } - - PhoneGap.m_document_addEventListener.call(document, evt, handler, capture); -}; - -/** - * Intercept adding window event listeners and handle our own - * - * @param {Object} evt - * @param {Function} handler - * @param capture - */ -window.addEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - - // If subscribing to an event that is handled by a plugin - if (typeof PhoneGap.windowEventHandler[e] !== "undefined") { - if (PhoneGap.windowEventHandler[e](e, handler, true)) { - return; // Stop default behavior - } - } - - PhoneGap.m_window_addEventListener.call(window, evt, handler, capture); -}; - -// Intercept calls to document.removeEventListener and watch for events that -// are generated by PhoneGap native code -PhoneGap.m_document_removeEventListener = document.removeEventListener; - -// Intercept calls to window.removeEventListener -PhoneGap.m_window_removeEventListener = window.removeEventListener; - -/** - * Intercept removing document event listeners and handle our own - * - * @param {Object} evt - * @param {Function} handler - * @param capture - */ -document.removeEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - - // If unsubcribing from an event that is handled by a plugin - if (typeof PhoneGap.documentEventHandler[e] !== "undefined") { - if (PhoneGap.documentEventHandler[e](e, handler, false)) { - return; // Stop default behavior - } - } - - PhoneGap.m_document_removeEventListener.call(document, evt, handler, capture); -}; - -/** - * Intercept removing window event listeners and handle our own - * - * @param {Object} evt - * @param {Function} handler - * @param capture - */ -window.removeEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - - // If unsubcribing from an event that is handled by a plugin - if (typeof PhoneGap.windowEventHandler[e] !== "undefined") { - if (PhoneGap.windowEventHandler[e](e, handler, false)) { - return; // Stop default behavior - } - } - - PhoneGap.m_window_removeEventListener.call(window, evt, handler, capture); -}; - -/** - * Method to fire document event - * - * @param {String} type The event type to fire - * @param {Object} data Data to send with event - */ -PhoneGap.fireDocumentEvent = function(type, data) { - var e = document.createEvent('Events'); - e.initEvent(type); - if (data) { - for (var i in data) { - e[i] = data[i]; - } - } - document.dispatchEvent(e); -}; - -/** - * Method to fire window event - * - * @param {String} type The event type to fire - * @param {Object} data Data to send with event - */ -PhoneGap.fireWindowEvent = function(type, data) { - var e = document.createEvent('Events'); - e.initEvent(type); - if (data) { - for (var i in data) { - e[i] = data[i]; - } - } - window.dispatchEvent(e); -}; - -/** - * Method to fire event from native code - * Leaving this generic version to handle problems with iOS 3.x. Is currently used by orientation and battery events - * Remove when iOS 3.x no longer supported and call fireWindowEvent or fireDocumentEvent directly - */ -PhoneGap.fireEvent = function(type, target, data) { - var e = document.createEvent('Events'); - e.initEvent(type); - if (data) { - for (var i in data) { - e[i] = data[i]; - } - } - target = target || document; - if (target.dispatchEvent === undefined) { // ie window.dispatchEvent is undefined in iOS 3.x - target = document; - } - - target.dispatchEvent(e); -}; -/** - * Create a UUID - * - * @return - */ -PhoneGap.createUUID = function() { - return PhoneGap.UUIDcreatePart(4) + '-' + - PhoneGap.UUIDcreatePart(2) + '-' + - PhoneGap.UUIDcreatePart(2) + '-' + - PhoneGap.UUIDcreatePart(2) + '-' + - PhoneGap.UUIDcreatePart(6); -}; - -PhoneGap.UUIDcreatePart = function(length) { - var uuidpart = ""; - for (var i=0; i -1) { - me._batteryListener.splice(pos, 1); - } - } else if (eventType === "batterylow") { - var pos = me._lowListener.indexOf(handler); - if (pos > -1) { - me._lowListener.splice(pos, 1); - } - } else if (eventType === "batterycritical") { - var pos = me._criticalListener.indexOf(handler); - if (pos > -1) { - me._criticalListener.splice(pos, 1); - } - } - - // If there are no more registered event listeners stop the battery listener on native side. - if (me._batteryListener.length === 0 && me._lowListener.length === 0 && me._criticalListener.length === 0) { - PhoneGap.exec(null, null, "com.phonegap.battery", "stop", []); - } - } -}; - -/** - * Callback for battery status - * - * @param {Object} info keys: level, isPlugged - */ -Battery.prototype._status = function(info) { - if (info) { - var me = this; - if (me._level != info.level || me._isPlugged != info.isPlugged) { - // Fire batterystatus event - //PhoneGap.fireWindowEvent("batterystatus", info); - // use this workaround since iOS 3.x does have window.dispatchEvent - PhoneGap.fireEvent("batterystatus", window, info); - - // Fire low battery event - if (info.level == 20 || info.level == 5) { - if (info.level == 20) { - //PhoneGap.fireWindowEvent("batterylow", info); - // use this workaround since iOS 3.x does not have window.dispatchEvent - PhoneGap.fireEvent("batterylow", window, info); - } - else { - //PhoneGap.fireWindowEvent("batterycritical", info); - // use this workaround since iOS 3.x does not have window.dispatchEvent - PhoneGap.fireEvent("batterycritical", window, info); - } - } - } - me._level = info.level; - me._isPlugged = info.isPlugged; - } -}; - -/** - * Error callback for battery start - */ -Battery.prototype._error = function(e) { - console.log("Error initializing Battery: " + e); -}; - -PhoneGap.addConstructor(function() { - if (typeof navigator.battery === "undefined") { - navigator.battery = new Battery(); - PhoneGap.addWindowEventHandler("batterystatus", navigator.battery.eventHandler); - PhoneGap.addWindowEventHandler("batterylow", navigator.battery.eventHandler); - PhoneGap.addWindowEventHandler("batterycritical", navigator.battery.eventHandler); - } -}); -}if (!PhoneGap.hasResource("camera")) { - PhoneGap.addResource("camera"); - - -/** - * This class provides access to the device camera. - * @constructor - */ -Camera = function() { - -} -/** - * Available Camera Options - * {boolean} allowEdit - true to allow editing image, default = false - * {number} quality 0-100 (low to high) default = 100 - * {Camera.DestinationType} destinationType default = DATA_URL - * {Camera.PictureSourceType} sourceType default = CAMERA - * {number} targetWidth - width in pixels to scale image default = 0 (no scaling) - * {number} targetHeight - height in pixels to scale image default = 0 (no scaling) - * {Camera.EncodingType} - encodingType default = JPEG - * {boolean} correctOrientation - Rotate the image to correct for the orientation of the device during capture (iOS only) - * {boolean} saveToPhotoAlbum - Save the image to the photo album on the device after capture (iOS only) - */ -/** - * Format of image that is returned from getPicture. - * - * Example: navigator.camera.getPicture(success, fail, - * { quality: 80, - * destinationType: Camera.DestinationType.DATA_URL, - * sourceType: Camera.PictureSourceType.PHOTOLIBRARY}) - */ -Camera.DestinationType = { - DATA_URL: 0, // Return base64 encoded string - FILE_URI: 1 // Return file uri -}; -Camera.prototype.DestinationType = Camera.DestinationType; - -/** - * Source to getPicture from. - * - * Example: navigator.camera.getPicture(success, fail, - * { quality: 80, - * destinationType: Camera.DestinationType.DATA_URL, - * sourceType: Camera.PictureSourceType.PHOTOLIBRARY}) - */ -Camera.PictureSourceType = { - PHOTOLIBRARY : 0, // Choose image from picture library - CAMERA : 1, // Take picture from camera - SAVEDPHOTOALBUM : 2 // Choose image from picture library -}; -Camera.prototype.PictureSourceType = Camera.PictureSourceType; - -/** - * Encoding of image returned from getPicture. - * - * Example: navigator.camera.getPicture(success, fail, - * { quality: 80, - * destinationType: Camera.DestinationType.DATA_URL, - * sourceType: Camera.PictureSourceType.CAMERA, - * encodingType: Camera.EncodingType.PNG}) - */ -Camera.EncodingType = { - JPEG: 0, // Return JPEG encoded image - PNG: 1 // Return PNG encoded image -}; -Camera.prototype.EncodingType = Camera.EncodingType; - -/** - * Type of pictures to select from. Only applicable when - * PictureSourceType is PHOTOLIBRARY or SAVEDPHOTOALBUM - * - * Example: navigator.camera.getPicture(success, fail, - * { quality: 80, - * destinationType: Camera.DestinationType.DATA_URL, - * sourceType: Camera.PictureSourceType.PHOTOLIBRARY, - * mediaType: Camera.MediaType.PICTURE}) - */ -Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, ONLY RETURNS URL - ALLMEDIA : 2 // allow selection from all media types -}; -Camera.prototype.MediaType = Camera.MediaType; - -/** - * Gets a picture from source defined by "options.sourceType", and returns the - * image as defined by the "options.destinationType" option. - - * The defaults are sourceType=CAMERA and destinationType=DATA_URL. - * - * @param {Function} successCallback - * @param {Function} errorCallback - * @param {Object} options - */ -Camera.prototype.getPicture = function(successCallback, errorCallback, options) { - // successCallback required - if (typeof successCallback != "function") { - console.log("Camera Error: successCallback is not a function"); - return; - } - - // errorCallback optional - if (errorCallback && (typeof errorCallback != "function")) { - console.log("Camera Error: errorCallback is not a function"); - return; - } - - PhoneGap.exec(successCallback, errorCallback, "com.phonegap.camera","getPicture",[options]); -}; - - - -PhoneGap.addConstructor(function() { - if (typeof navigator.camera == "undefined") navigator.camera = new Camera(); -}); -}; - -if (!PhoneGap.hasResource("device")) { - PhoneGap.addResource("device"); - -/** - * this represents the mobile device, and provides properties for inspecting the model, version, UUID of the - * phone, etc. - * @constructor - */ -Device = function() -{ - this.platform = null; - this.version = null; - this.name = null; - this.phonegap = null; - this.uuid = null; - try - { - this.platform = DeviceInfo.platform; - this.version = DeviceInfo.version; - this.name = DeviceInfo.name; - this.phonegap = DeviceInfo.gap; - this.uuid = DeviceInfo.uuid; - - } - catch(e) - { - // TODO: - } - this.available = PhoneGap.available = this.uuid != null; -} - -PhoneGap.addConstructor(function() { - if (typeof navigator.device === "undefined") { - navigator.device = window.device = new Device(); - } -}); -}; - -if (!PhoneGap.hasResource("capture")) { - PhoneGap.addResource("capture"); -/** - * The CaptureError interface encapsulates all errors in the Capture API. - */ -function CaptureError() { - this.code = null; -}; - -// Capture error codes -CaptureError.CAPTURE_INTERNAL_ERR = 0; -CaptureError.CAPTURE_APPLICATION_BUSY = 1; -CaptureError.CAPTURE_INVALID_ARGUMENT = 2; -CaptureError.CAPTURE_NO_MEDIA_FILES = 3; -CaptureError.CAPTURE_NOT_SUPPORTED = 20; - -/** - * The Capture interface exposes an interface to the camera and microphone of the hosting device. - */ -function Capture() { - this.supportedAudioModes = []; - this.supportedImageModes = []; - this.supportedVideoModes = []; -}; - -/** - * Launch audio recorder application for recording audio clip(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureAudioOptions} options - * - * No audio recorder to launch for iOS - return CAPTURE_NOT_SUPPORTED - */ -Capture.prototype.captureAudio = function(successCallback, errorCallback, options) { - /*if (errorCallback && typeof errorCallback === "function") { - errorCallback({ - "code": CaptureError.CAPTURE_NOT_SUPPORTED - }); - }*/ - PhoneGap.exec(successCallback, errorCallback, "com.phonegap.mediacapture", "captureAudio", [options]); -}; - -/** - * Launch camera application for taking image(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureImageOptions} options - */ -Capture.prototype.captureImage = function(successCallback, errorCallback, options) { - PhoneGap.exec(successCallback, errorCallback, "com.phonegap.mediacapture", "captureImage", [options]); -}; - -/** - * Launch camera application for taking image(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureImageOptions} options - */ -Capture.prototype._castMediaFile = function(pluginResult) { - var mediaFiles = []; - var i; - for (i=0; i} categories -* @param {ContactField[]} urls contact's web sites -*/ -var Contact = function(id, displayName, name, nickname, phoneNumbers, emails, addresses, - ims, organizations, birthday, note, photos, categories, urls) { - this.id = id || null; - this.displayName = displayName || null; - this.name = name || null; // ContactName - this.nickname = nickname || null; - this.phoneNumbers = phoneNumbers || null; // ContactField[] - this.emails = emails || null; // ContactField[] - this.addresses = addresses || null; // ContactAddress[] - this.ims = ims || null; // ContactField[] - this.organizations = organizations || null; // ContactOrganization[] - this.birthday = birthday || null; // JS Date - this.note = note || null; - this.photos = photos || null; // ContactField[] - this.categories = categories || null; - this.urls = urls || null; // ContactField[] -}; - -/** -* Converts Dates to milliseconds before sending to iOS -*/ -Contact.prototype.convertDatesOut = function() -{ - var dates = new Array("birthday"); - for (var i=0; i][;base64], - * - * @param file {File} File object containing file properties - */ -FileReader.prototype.readAsDataURL = function(file) { - this.fileName = ""; - - if (typeof file.fullPath === "undefined") { - this.fileName = file; - } else { - this.fileName = file.fullPath; - } - - // LOADING state - this.readyState = FileReader.LOADING; - - // If loadstart callback - if (typeof this.onloadstart === "function") { - var evt = File._createEvent("loadstart", this); - this.onloadstart(evt); - } - - var me = this; - - // Read file - navigator.fileMgr.readAsDataURL(this.fileName, - - // Success callback - function(r) { - var evt; - - // If DONE (cancelled), then don't do anything - if (me.readyState === FileReader.DONE) { - return; - } - - // Save result - me.result = r; - - // If onload callback - if (typeof me.onload === "function") { - evt = File._createEvent("load", me); - me.onload(evt); - } - - // DONE state - me.readyState = FileReader.DONE; - - // If onloadend callback - if (typeof me.onloadend === "function") { - evt = File._createEvent("loadend", me); - me.onloadend(evt); - } - }, - - // Error callback - function(e) { - var evt; - // If DONE (cancelled), then don't do anything - if (me.readyState === FileReader.DONE) { - return; - } - - // Save error - me.error = e; - - // If onerror callback - if (typeof me.onerror === "function") { - evt = File._createEvent("error", me); - me.onerror(evt); - } - - // DONE state - me.readyState = FileReader.DONE; - - // If onloadend callback - if (typeof me.onloadend === "function") { - evt = File._createEvent("loadend", me); - me.onloadend(evt); - } - } - ); -}; - -/** - * Read file and return data as a binary data. - * - * @param file The name of the file - */ -FileReader.prototype.readAsBinaryString = function(file) { - // TODO - Can't return binary data to browser. - this.fileName = file; -}; - -/** - * Read file and return data as a binary data. - * - * @param file The name of the file - */ -FileReader.prototype.readAsArrayBuffer = function(file) { - // TODO - Can't return binary data to browser. - this.fileName = file; -}; - -//----------------------------------------------------------------------------- -// File Writer -//----------------------------------------------------------------------------- - -/** - * This class writes to the mobile device file system. - * - @param file {File} a File object representing a file on the file system -*/ -FileWriter = function(file) { - this.fileName = ""; - this.length = 0; - if (file) { - this.fileName = file.fullPath || file; - this.length = file.size || 0; - } - - // default is to write at the beginning of the file - this.position = 0; - - this.readyState = 0; // EMPTY - - this.result = null; - - // Error - this.error = null; - - // Event handlers - this.onwritestart = null; // When writing starts - this.onprogress = null; // While writing the file, and reporting partial file data - this.onwrite = null; // When the write has successfully completed. - this.onwriteend = null; // When the request has completed (either in success or failure). - this.onabort = null; // When the write has been aborted. For instance, by invoking the abort() method. - this.onerror = null; // When the write has failed (see errors). -} - -// States -FileWriter.INIT = 0; -FileWriter.WRITING = 1; -FileWriter.DONE = 2; - -/** - * Abort writing file. - */ -FileWriter.prototype.abort = function() { - // check for invalid state - if (this.readyState === FileWriter.DONE || this.readyState === FileWriter.INIT) { - throw FileError.INVALID_STATE_ERR; - } - - // set error - var error = new FileError(), evt; - error.code = error.ABORT_ERR; - this.error = error; - - // If error callback - if (typeof this.onerror === "function") { - evt = File._createEvent("error", this); - this.onerror(evt); - } - // If abort callback - if (typeof this.onabort === "function") { - evt = File._createEvent("abort", this); - this.onabort(evt); - } - - this.readyState = FileWriter.DONE; - - // If write end callback - if (typeof this.onwriteend == "function") { - evt = File._createEvent("writeend", this); - this.onwriteend(evt); - } -}; - -/** - * @Deprecated: use write instead - * - * @param file to write the data to - * @param text to be written - * @param bAppend if true write to end of file, otherwise overwrite the file - */ -FileWriter.prototype.writeAsText = function(file, text, bAppend) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw FileError.INVALID_STATE_ERR; - } - - if (bAppend !== true) { - bAppend = false; // for null values - } - - this.fileName = file; - - // WRITING state - this.readyState = FileWriter.WRITING; - - var me = this; - - // If onwritestart callback - if (typeof me.onwritestart === "function") { - var evt = File._createEvent("writestart", me); - me.onwritestart(evt); - } - - - // Write file - navigator.fileMgr.writeAsText(file, text, bAppend, - // Success callback - function(r) { - var evt; - - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // Save result - me.result = r; - - // If onwrite callback - if (typeof me.onwrite === "function") { - evt = File._createEvent("write", me); - me.onwrite(evt); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - evt = File._createEvent("writeend", me); - me.onwriteend(evt); - } - }, - - // Error callback - function(e) { - var evt; - - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // Save error - me.error = e; - - // If onerror callback - if (typeof me.onerror === "function") { - evt = File._createEvent("error", me); - me.onerror(evt); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - evt = File._createEvent("writeend", me); - me.onwriteend(evt); - } - } - ); -}; - -/** - * Writes data to the file - * - * @param text to be written - */ -FileWriter.prototype.write = function(text) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw FileError.INVALID_STATE_ERR; - } - - // WRITING state - this.readyState = FileWriter.WRITING; - - var me = this; - - // If onwritestart callback - if (typeof me.onwritestart === "function") { - var evt = File._createEvent("writestart", me); - me.onwritestart(evt); - } - - // Write file - navigator.fileMgr.write(this.fileName, text, this.position, - - // Success callback - function(r) { - var evt; - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - - // position always increases by bytes written because file would be extended - me.position += r; - // The length of the file is now where we are done writing. - me.length = me.position; - - // If onwrite callback - if (typeof me.onwrite === "function") { - evt = File._createEvent("write", me); - me.onwrite(evt); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - evt = File._createEvent("writeend", me); - me.onwriteend(evt); - } - }, - - // Error callback - function(e) { - var evt; - - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // Save error - me.error = e; - - // If onerror callback - if (typeof me.onerror === "function") { - evt = File._createEvent("error", me); - me.onerror(evt); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - evt = File._createEvent("writeend", me); - me.onwriteend(evt); - } - } - ); - -}; - -/** - * Moves the file pointer to the location specified. - * - * If the offset is a negative number the position of the file - * pointer is rewound. If the offset is greater than the file - * size the position is set to the end of the file. - * - * @param offset is the location to move the file pointer to. - */ -FileWriter.prototype.seek = function(offset) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw FileError.INVALID_STATE_ERR; - } - - if (!offset) { - return; - } - - // See back from end of file. - if (offset < 0) { - this.position = Math.max(offset + this.length, 0); - } - // Offset is bigger then file size so set position - // to the end of the file. - else if (offset > this.length) { - this.position = this.length; - } - // Offset is between 0 and file size so set the position - // to start writing. - else { - this.position = offset; - } -}; - -/** - * Truncates the file to the size specified. - * - * @param size to chop the file at. - */ -FileWriter.prototype.truncate = function(size) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw FileError.INVALID_STATE_ERR; - } - // what if no size specified? - - // WRITING state - this.readyState = FileWriter.WRITING; - - var me = this; - - // If onwritestart callback - if (typeof me.onwritestart === "function") { - var evt = File._createEvent("writestart", me); - me.onwritestart(evt); - } - - // Write file - navigator.fileMgr.truncate(this.fileName, size, - - // Success callback - function(r) { - var evt; - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // Update the length of the file - me.length = r; - me.position = Math.min(me.position, r); - - // If onwrite callback - if (typeof me.onwrite === "function") { - evt = File._createEvent("write", me); - me.onwrite(evt); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - evt = File._createEvent("writeend", me); - me.onwriteend(evt); - } - }, - - // Error callback - function(e) { - var evt; - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // Save error - me.error = e; - - // If onerror callback - if (typeof me.onerror === "function") { - evt = File._createEvent("error", me); - me.onerror(evt); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - evt = File._createEvent("writeend", me); - me.onwriteend(evt); - } - } - ); -}; - -LocalFileSystem = function() { -}; - -// File error codes -LocalFileSystem.TEMPORARY = 0; -LocalFileSystem.PERSISTENT = 1; -LocalFileSystem.RESOURCE = 2; -LocalFileSystem.APPLICATION = 3; - -/** - * Requests a filesystem in which to store application data. - * - * @param {int} type of file system being requested - * @param {Function} successCallback is called with the new FileSystem - * @param {Function} errorCallback is called with a FileError - */ -LocalFileSystem.prototype.requestFileSystem = function(type, size, successCallback, errorCallback) { - if (type < 0 || type > 3) { - if (typeof errorCallback == "function") { - errorCallback({ - "code": FileError.SYNTAX_ERR - }); - } - } - else { - PhoneGap.exec(successCallback, errorCallback, "com.phonegap.file", "requestFileSystem", [type, size]); - } -}; - -/** - * - * @param {DOMString} uri referring to a local file in a filesystem - * @param {Function} successCallback is called with the new entry - * @param {Function} errorCallback is called with a FileError - */ -LocalFileSystem.prototype.resolveLocalFileSystemURI = function(uri, successCallback, errorCallback) { - PhoneGap.exec(successCallback, errorCallback, "com.phonegap.file", "resolveLocalFileSystemURI", [uri]); -}; - -/** -* This function is required as we need to convert raw -* JSON objects into concrete File and Directory objects. -* -* @param a JSON Objects that need to be converted to DirectoryEntry or FileEntry objects. -* @returns an entry -*/ -LocalFileSystem.prototype._castFS = function(pluginResult) { - var entry = null; - entry = new DirectoryEntry(); - entry.isDirectory = pluginResult.message.root.isDirectory; - entry.isFile = pluginResult.message.root.isFile; - entry.name = pluginResult.message.root.name; - entry.fullPath = pluginResult.message.root.fullPath; - pluginResult.message.root = entry; - return pluginResult; -} - -LocalFileSystem.prototype._castEntry = function(pluginResult) { - var entry = null; - if (pluginResult.message.isDirectory) { - entry = new DirectoryEntry(); - } - else if (pluginResult.message.isFile) { - entry = new FileEntry(); - } - entry.isDirectory = pluginResult.message.isDirectory; - entry.isFile = pluginResult.message.isFile; - entry.name = pluginResult.message.name; - entry.fullPath = pluginResult.message.fullPath; - pluginResult.message = entry; - return pluginResult; -} - -LocalFileSystem.prototype._castEntries = function(pluginResult) { - var entries = pluginResult.message; - var retVal = []; - for (i=0; i"); - $(".photo").show(); - - }, - onCameraFail: function (msg) { - console.log("ERROR! -" + msg); - } -}; - -var filters = { - none: function (imageURI) { - plugins.ImageFilter.none(filters.rendered, { - image: imageURI, - save: 'false', - }); - }, - sunnySide: function (imageURI) { - plugins.ImageFilter.sunnySide(filters.rendered, { - image: imageURI, - save: 'false' - }); - }, - worn: function (imageURI) { - plugins.ImageFilter.worn(filters.rendered, { - image: imageURI, - save: 'false' - }); - }, - vintage: function (imageURI) { - plugins.ImageFilter.vintage(filters.rendered, { - image: imageURI, - save: 'false' - }); - }, - stark: function (imageURI) { - plugins.ImageFilter.stark(filters.rendered, { - image: imageURI, - save: 'false' - }); - }, - rendered: function (msg) { - - $(".photo").html(""); - } -} \ No newline at end of file diff --git a/iOS/cordova/example/www/js/plugins/ImageFilter.js b/iOS/cordova/example/www/js/plugins/ImageFilter.js deleted file mode 100644 index 631b47f..0000000 --- a/iOS/cordova/example/www/js/plugins/ImageFilter.js +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright (c) 2012 Drew Dahlman MIT LICENSE -*/ - -var ImageFilter = function () {}; - -ImageFilter.prototype.clean = function (options) { - - cordova.exec("ImageFilter.clean"); -}; -ImageFilter.prototype.none = function (done,options) { - //console.log(options+" "+done); - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - - return cordova.exec(done,null,"ImageFilter","none",[defaults]); -}; -ImageFilter.prototype.sunnySide = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return cordova.exec(done,null,"ImageFilter","sunnySide",[defaults]); -}; -ImageFilter.prototype.worn = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return cordova.exec(done,null,"ImageFilter","worn",[defaults]); -}; -ImageFilter.prototype.vintage = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return cordova.exec(done,null,"ImageFilter","vintage",[defaults]); -}; -ImageFilter.prototype.stark = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return cordova.exec(done,null,"ImageFilter","stark",[defaults]); -}; -PhoneGap.addConstructor(function () { - if(!window.plugins) { - window.plugins = {}; - } - window.plugins.ImageFilter = new ImageFilter(); -}); \ No newline at end of file diff --git a/iOS/cordova/plugin/ImageFilter.js b/iOS/cordova/plugin/ImageFilter.js deleted file mode 100644 index 631b47f..0000000 --- a/iOS/cordova/plugin/ImageFilter.js +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright (c) 2012 Drew Dahlman MIT LICENSE -*/ - -var ImageFilter = function () {}; - -ImageFilter.prototype.clean = function (options) { - - cordova.exec("ImageFilter.clean"); -}; -ImageFilter.prototype.none = function (done,options) { - //console.log(options+" "+done); - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - - return cordova.exec(done,null,"ImageFilter","none",[defaults]); -}; -ImageFilter.prototype.sunnySide = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return cordova.exec(done,null,"ImageFilter","sunnySide",[defaults]); -}; -ImageFilter.prototype.worn = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return cordova.exec(done,null,"ImageFilter","worn",[defaults]); -}; -ImageFilter.prototype.vintage = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return cordova.exec(done,null,"ImageFilter","vintage",[defaults]); -}; -ImageFilter.prototype.stark = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return cordova.exec(done,null,"ImageFilter","stark",[defaults]); -}; -PhoneGap.addConstructor(function () { - if(!window.plugins) { - window.plugins = {}; - } - window.plugins.ImageFilter = new ImageFilter(); -}); \ No newline at end of file diff --git a/iOS/cordova/plugin/ImageFilter.m b/iOS/cordova/plugin/ImageFilter.m deleted file mode 100644 index 86976a1..0000000 --- a/iOS/cordova/plugin/ImageFilter.m +++ /dev/null @@ -1,408 +0,0 @@ -// -// ImageFilter.m -// -// Created by Drew Dahlman 2/25/2012. -// Copyright 2012 Drew Dahlman. All rights reserved. -// version 1.0 - -/* -Copyright (c) 2012 Drew Dahlman MIT LICENSE -*/ - -#import -#import "ImageFilter.h" -#import -@implementation ImageFilter -@synthesize callbackID; - -// For clean up purposes sometimes the apps will cache images, so this cleans things up --(void)clean:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options -{ - // Path to the Documents directory - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - if ([paths count] > 0) - { - NSError *error = nil; - NSFileManager *fileManager = [NSFileManager defaultManager]; - - // Print out the path to verify we are in the right place - NSString *directory = [paths objectAtIndex:0]; - NSLog(@"Directory: %@", directory); - - // For each file in the directory, create full path and delete the file - for (NSString *file in [fileManager contentsOfDirectoryAtPath:directory error:&error]) - { - NSString *filePath = [directory stringByAppendingPathComponent:file]; - NSLog(@"File : %@", filePath); - - BOOL fileDeleted = [fileManager removeItemAtPath:filePath error:&error]; - - if (fileDeleted != YES || error != nil) - { - - } - } - - } - NSLog(@"CLEAN!"); -} - -// FILTERS -// Each filter uses the CoreImage Framework, and can be changed and added to. -// If you wish to create a new filter use the none as a template. --(void)none:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options -{ - // Start by getting path to image - NSString *filePath = [options objectForKey:@"image"]; - // CREATE NSURL - NSURL *fileNameAndPath = [NSURL URLWithString:filePath]; - NSLog(@"FILE PATH: %@",fileNameAndPath); - - // DEFINE OUR CIImage - CIImage *beginImage = - [CIImage imageWithContentsOfURL:fileNameAndPath]; - CIContext *context = [CIContext contextWithOptions:nil]; - - // DO ALL MODIFICATIONS HERE. - - - // CREATE CIIMageRef from our CIImage - // Be sure to reference the correct CIImage in both the createCGIImage and fromRect - CGImageRef cgimg = - [context createCGImage:beginImage fromRect:[beginImage extent]]; - - // CREATE UIImage out of CIImage - UIImage *newImg = [UIImage imageWithCGImage:cgimg]; - - // GET IMAGE DATA AND CONSTRUCT URL TO THE APPS DOCUMENT FOLDER - NSData *imageData = UIImageJPEGRepresentation(newImg,1.0); - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsPath = [paths objectAtIndex:0]; - NSString *filePathB = [documentsPath stringByAppendingPathComponent:@"none.jpg"]; - - // SAVE IMAGE DATA TO DOCUMENTS FOLDER - [imageData writeToFile:filePathB atomically:YES]; - - // CHECK IF THE SAVE KEY IS SET TO TRU - NSString *save = [options objectForKey:@"save"]; - NSLog(@"SAVED: %@",save); - - // IF TRUE THEN SAVE IMAGE TO CAMERA ROLL - if([save isEqualToString:@"true"]){ - UIImageWriteToSavedPhotosAlbum(newImg, self,@selector(image:didFinishSavingWithError:contextInfo:), nil); - } - - // RELEASE OUR IMAGE AND DONE - CGImageRelease(cgimg); - - // CALLBACK TO JAVASCRIPT WITH IMAGE URI - self.callbackID = [arguments pop]; - - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK - messageAsString:filePathB]; - - /* Create JS to call the success function with the result */ - NSString *successScript = [pluginResult toSuccessCallbackString:self.callbackID]; - /* Output the script */ - [self writeJavascript:successScript]; - - - -} --(void)stark:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options -{ - - NSString *filePath = [options objectForKey:@"image"]; - NSURL *fileNameAndPath = [NSURL URLWithString:filePath]; - - CIImage *beginImage = - [CIImage imageWithContentsOfURL:fileNameAndPath]; - CIContext *context = [CIContext contextWithOptions:nil]; - - CIFilter *filter = [CIFilter filterWithName:@"CIColorControls" - keysAndValues: kCIInputImageKey, beginImage, - @"inputSaturation", [NSNumber numberWithFloat:.1], - @"inputContrast", [NSNumber numberWithFloat:1], - nil]; - CIImage *outputImage = [filter outputImage]; - - CIFilter *filterB = [CIFilter filterWithName:@"CIGammaAdjust" - keysAndValues: kCIInputImageKey, outputImage, - @"inputPower", [NSNumber numberWithFloat:1.5], - nil]; - - CIImage *outputImageB = [filterB outputImage]; - - CGImageRef cgimg = - [context createCGImage:outputImageB fromRect:[outputImageB extent]]; - UIImage *newImg = [UIImage imageWithCGImage:cgimg]; - - NSData *imageData = UIImageJPEGRepresentation(newImg,1.0); - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsPath = [paths objectAtIndex:0]; //Get the docs directory - - int r = arc4random() % 5000; - NSString *random = [NSString stringWithFormat:@"%d", r]; - NSString *tPathA = [documentsPath stringByAppendingPathComponent:@"stark"]; - NSString *tPathB = [tPathA stringByAppendingString:random]; - NSString *filePathB = [tPathB stringByAppendingString:@".jpg"]; - - [imageData writeToFile:filePathB atomically:YES]; - - NSString *save = [options objectForKey:@"save"]; - NSLog(@"SAVED: %@",save); - if([save isEqualToString:@"true"]){ - UIImageWriteToSavedPhotosAlbum(newImg, self,@selector(image:didFinishSavingWithError:contextInfo:), nil); - } - CGImageRelease(cgimg); - - // CALLBACK TO JAVASCRIPT WITH IMAGE URI - self.callbackID = [arguments pop]; - - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK - messageAsString:filePathB]; - - /* Create JS to call the success function with the result */ - NSString *successScript = [pluginResult toSuccessCallbackString:self.callbackID]; - /* Output the script */ - [self writeJavascript:successScript]; -} --(void)sunnySide:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options -{ - // FILTER - NSString *filePath = [options objectForKey:@"image"]; - NSURL *fileNameAndPath = [NSURL URLWithString:filePath]; - - CIImage *beginImage = - [CIImage imageWithContentsOfURL:fileNameAndPath]; - CIContext *context = [CIContext contextWithOptions:nil]; - - CIFilter *filter = [CIFilter filterWithName:@"CIWhitePointAdjust" - keysAndValues: kCIInputImageKey, beginImage, - @"inputColor",[CIColor colorWithRed:254 green:197 blue:0 alpha:1], - nil]; - CIImage *outputImage = [filter outputImage]; - - CIFilter *filterB = [CIFilter filterWithName:@"CITemperatureAndTint" - keysAndValues: kCIInputImageKey, outputImage, - @"inputNeutral",[CIVector vectorWithX:5500 Y:1300 Z:0], - @"inputTargetNeutral",[CIVector vectorWithX:4000 Y:0 Z:0], - nil]; - CIImage *outputImageB = [filterB outputImage]; - - NSString *bgPath = - [[NSBundle mainBundle] pathForResource:@"painter" ofType:@"png"]; - NSURL *bgPathName = [NSURL fileURLWithPath:bgPath]; - - CIImage *bgIMG = - [CIImage imageWithContentsOfURL:bgPathName]; - - CIFilter *filterD = [CIFilter filterWithName:@"CISourceOverCompositing" - keysAndValues: kCIInputImageKey, bgIMG, - @"inputBackgroundImage",outputImageB, - nil]; - CIImage *outputImageD = [filterD outputImage]; - - CGImageRef cgimg = - [context createCGImage:outputImageD fromRect:[outputImageD extent]]; - UIImage *newImg = [UIImage imageWithCGImage:cgimg]; - - NSData *imageData = UIImageJPEGRepresentation(newImg,1.0); - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsPath = [paths objectAtIndex:0]; //Get the docs directory - - int r = arc4random() % 5000; - NSString *random = [NSString stringWithFormat:@"%d", r]; - NSString *tPathA = [documentsPath stringByAppendingPathComponent:@"sunnyside"]; - NSString *tPathB = [tPathA stringByAppendingString:random]; - NSString *filePathB = [tPathB stringByAppendingString:@".jpg"]; - - [imageData writeToFile:filePathB atomically:YES]; - - NSString *save = [options objectForKey:@"save"]; - NSLog(@"SAVED: %@",save); - if([save isEqualToString:@"true"]){ - UIImageWriteToSavedPhotosAlbum(newImg, self,@selector(image:didFinishSavingWithError:contextInfo:), nil); - } - - CGImageRelease(cgimg); - - // CALLBACK TO JAVASCRIPT WITH IMAGE URI - self.callbackID = [arguments pop]; - - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK - messageAsString:filePathB]; - - /* Create JS to call the success function with the result */ - NSString *successScript = [pluginResult toSuccessCallbackString:self.callbackID]; - /* Output the script */ - [self writeJavascript:successScript]; - -} --(void)worn:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options -{ - // FILTER - NSString *filePath = [options objectForKey:@"image"]; - NSURL *fileNameAndPath = [NSURL URLWithString:filePath]; - - CIImage *beginImage = - [CIImage imageWithContentsOfURL:fileNameAndPath]; - CIContext *context = [CIContext contextWithOptions:nil]; - - CIFilter *filter = [CIFilter filterWithName:@"CIWhitePointAdjust" - keysAndValues: kCIInputImageKey, beginImage, - @"inputColor",[CIColor colorWithRed:212 green:235 blue:241 alpha:1], - nil]; - CIImage *outputImage = [filter outputImage]; - - CIFilter *filterB = [CIFilter filterWithName:@"CIColorControls" - keysAndValues: kCIInputImageKey, outputImage, - @"inputSaturation", [NSNumber numberWithFloat:.6], - @"inputContrast", [NSNumber numberWithFloat:1], - nil]; - CIImage *outputImageB = [filterB outputImage]; - - CIFilter *filterC = [CIFilter filterWithName:@"CITemperatureAndTint" - keysAndValues: kCIInputImageKey, outputImageB, - @"inputNeutral",[CIVector vectorWithX:6500 Y:2000 Z:0], - @"inputTargetNeutral",[CIVector vectorWithX:5200 Y:0 Z:0], - nil]; - CIImage *outputImageC = [filterC outputImage]; - - NSString *framePath = - [[NSBundle mainBundle] pathForResource:@"vignette4" ofType:@"png"]; - NSURL *framePathName = [NSURL fileURLWithPath:framePath]; - - CIImage *frameImg = - [CIImage imageWithContentsOfURL:framePathName]; - - CIFilter *filterD = [CIFilter filterWithName:@"CISourceOverCompositing" - keysAndValues: kCIInputImageKey, frameImg, - @"inputBackgroundImage",outputImageC, - nil]; - CIImage *outputImageD = [filterD outputImage]; - - CGImageRef cgimg = - [context createCGImage:outputImageD fromRect:[outputImageD extent]]; - UIImage *newImg = [UIImage imageWithCGImage:cgimg]; - - NSData *imageData = UIImageJPEGRepresentation(newImg,1.0); - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsPath = [paths objectAtIndex:0]; //Get the docs directory - - int r = arc4random() % 5000; - NSString *random = [NSString stringWithFormat:@"%d", r]; - NSString *tPathA = [documentsPath stringByAppendingPathComponent:@"worn"]; - NSString *tPathB = [tPathA stringByAppendingString:random]; - NSString *filePathB = [tPathB stringByAppendingString:@".jpg"]; - - [imageData writeToFile:filePathB atomically:YES]; - - NSString *save = [options objectForKey:@"save"]; - NSLog(@"SAVED: %@",save); - if([save isEqualToString:@"true"]){ - UIImageWriteToSavedPhotosAlbum(newImg, self,@selector(image:didFinishSavingWithError:contextInfo:), nil); - } - CGImageRelease(cgimg); - - // CALLBACK TO JAVASCRIPT WITH IMAGE URI - self.callbackID = [arguments pop]; - - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK - messageAsString:filePathB]; - - /* Create JS to call the success function with the result */ - NSString *successScript = [pluginResult toSuccessCallbackString:self.callbackID]; - /* Output the script */ - [self writeJavascript:successScript]; - -} --(void)vintage:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options -{ - // FILTER - NSString *filePath = [options objectForKey:@"image"]; - NSURL *fileNameAndPath = [NSURL URLWithString:filePath]; - - CIImage *beginImage = - [CIImage imageWithContentsOfURL:fileNameAndPath]; - CIContext *context = [CIContext contextWithOptions:nil]; - - CIFilter *filter = [CIFilter filterWithName:@"CIWhitePointAdjust" - keysAndValues: kCIInputImageKey, beginImage, - @"inputColor",[CIColor colorWithRed:121 green:195 blue:219 alpha:1], - nil]; - CIImage *outputImage = [filter outputImage]; - - CIFilter *filterB = [CIFilter filterWithName:@"CIColorControls" - keysAndValues: kCIInputImageKey, outputImage, - @"inputSaturation", [NSNumber numberWithFloat:.6], - @"inputContrast", [NSNumber numberWithFloat:1.1], - nil]; - CIImage *outputImageB = [filterB outputImage]; - - NSString *framePath = - [[NSBundle mainBundle] pathForResource:@"vintage" ofType:@"png"]; - NSURL *framePathName = [NSURL fileURLWithPath:framePath]; - - CIImage *frameImg = - [CIImage imageWithContentsOfURL:framePathName]; - - CIFilter *filterD = [CIFilter filterWithName:@"CISourceOverCompositing" - keysAndValues: kCIInputImageKey, frameImg, - @"inputBackgroundImage",outputImageB, - nil]; - CIImage *outputImageD = [filterD outputImage]; - - CGImageRef cgimg = - [context createCGImage:outputImageD fromRect:[outputImageD extent]]; - UIImage *newImg = [UIImage imageWithCGImage:cgimg]; - - NSData *imageData = UIImageJPEGRepresentation(newImg,1.0); - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsPath = [paths objectAtIndex:0]; //Get the docs directory - - int r = arc4random() % 5000; - NSString *random = [NSString stringWithFormat:@"%d", r]; - NSString *tPathA = [documentsPath stringByAppendingPathComponent:@"vintage"]; - NSString *tPathB = [tPathA stringByAppendingString:random]; - NSString *filePathB = [tPathB stringByAppendingString:@".jpg"]; - - [imageData writeToFile:filePathB atomically:YES]; - - NSString *save = [options objectForKey:@"save"]; - NSLog(@"SAVED: %@",save); - if([save isEqualToString:@"true"]){ - UIImageWriteToSavedPhotosAlbum(newImg, self,@selector(image:didFinishSavingWithError:contextInfo:), nil); - } - - CGImageRelease(cgimg); - - // CALLBACK TO JAVASCRIPT WITH IMAGE URI - self.callbackID = [arguments pop]; - - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK - messageAsString:filePathB]; - - /* Create JS to call the success function with the result */ - NSString *successScript = [pluginResult toSuccessCallbackString:self.callbackID]; - /* Output the script */ - [self writeJavascript:successScript]; -} - -// CAMERA ROLL SAVER -- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error - contextInfo:(void *)contextInfo -{ - // Was there an error? - if (error != NULL) - { - // Show error message... - NSLog(@"ERROR: %@",error); - } - else // No errors - { - // Show message image successfully saved - NSLog(@"IMAGE SAVED!"); - } -} -@end \ No newline at end of file diff --git a/iOS/cordova/plugin/frames/painter.png b/iOS/cordova/plugin/frames/painter.png deleted file mode 100644 index 604d8d3..0000000 Binary files a/iOS/cordova/plugin/frames/painter.png and /dev/null differ diff --git a/iOS/cordova/plugin/frames/vignette2.png b/iOS/cordova/plugin/frames/vignette2.png deleted file mode 100644 index d1f0a4f..0000000 Binary files a/iOS/cordova/plugin/frames/vignette2.png and /dev/null differ diff --git a/iOS/cordova/plugin/frames/vignette3.png b/iOS/cordova/plugin/frames/vignette3.png deleted file mode 100644 index d318950..0000000 Binary files a/iOS/cordova/plugin/frames/vignette3.png and /dev/null differ diff --git a/iOS/cordova/plugin/frames/vignette4.png b/iOS/cordova/plugin/frames/vignette4.png deleted file mode 100644 index ea02e9c..0000000 Binary files a/iOS/cordova/plugin/frames/vignette4.png and /dev/null differ diff --git a/iOS/cordova/plugin/frames/vintage.png b/iOS/cordova/plugin/frames/vintage.png deleted file mode 100644 index 0cdb0ea..0000000 Binary files a/iOS/cordova/plugin/frames/vintage.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter.xcodeproj/project.pbxproj b/iOS/cordova/project/ImageFilter/ImageFilter.xcodeproj/project.pbxproj deleted file mode 100644 index 41e0922..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter.xcodeproj/project.pbxproj +++ /dev/null @@ -1,584 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 3A7FBD8B153FB38200DCB67D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A7FBD8A153FB38200DCB67D /* Foundation.framework */; }; - 3A7FBD8D153FB38200DCB67D /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A7FBD8C153FB38200DCB67D /* UIKit.framework */; }; - 3A7FBD8F153FB38200DCB67D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A7FBD8E153FB38200DCB67D /* CoreGraphics.framework */; }; - 3A7FBD91153FB38200DCB67D /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A7FBD90153FB38200DCB67D /* AddressBook.framework */; }; - 3A7FBD93153FB38200DCB67D /* AddressBookUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A7FBD92153FB38200DCB67D /* AddressBookUI.framework */; }; - 3A7FBD95153FB38200DCB67D /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A7FBD94153FB38200DCB67D /* AudioToolbox.framework */; }; - 3A7FBD97153FB38200DCB67D /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A7FBD96153FB38200DCB67D /* AVFoundation.framework */; }; - 3A7FBD99153FB38200DCB67D /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A7FBD98153FB38200DCB67D /* CoreLocation.framework */; }; - 3A7FBD9B153FB38200DCB67D /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A7FBD9A153FB38200DCB67D /* MediaPlayer.framework */; }; - 3A7FBD9D153FB38200DCB67D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A7FBD9C153FB38200DCB67D /* QuartzCore.framework */; }; - 3A7FBD9F153FB38200DCB67D /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A7FBD9E153FB38200DCB67D /* SystemConfiguration.framework */; }; - 3A7FBDA1153FB38200DCB67D /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A7FBDA0153FB38200DCB67D /* MobileCoreServices.framework */; }; - 3A7FBDA3153FB38200DCB67D /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A7FBDA2153FB38200DCB67D /* CoreMedia.framework */; }; - 3A7FBDA9153FB38200DCB67D /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3A7FBDA7153FB38200DCB67D /* InfoPlist.strings */; }; - 3A7FBDAB153FB38200DCB67D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A7FBDAA153FB38200DCB67D /* main.m */; }; - 3A7FBDAE153FB38200DCB67D /* Cordova.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A7FBDAD153FB38200DCB67D /* Cordova.framework */; }; - 3A7FBDB3153FB38200DCB67D /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3A7FBDB1153FB38200DCB67D /* Localizable.strings */; }; - 3A7FBDB7153FB38200DCB67D /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3A7FBDB5153FB38200DCB67D /* Localizable.strings */; }; - 3A7FBDBB153FB38200DCB67D /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3A7FBDB9153FB38200DCB67D /* Localizable.strings */; }; - 3A7FBDBF153FB38300DCB67D /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3A7FBDBD153FB38300DCB67D /* Localizable.strings */; }; - 3A7FBDC2153FB38300DCB67D /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 3A7FBDC1153FB38300DCB67D /* icon.png */; }; - 3A7FBDC4153FB38300DCB67D /* icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3A7FBDC3153FB38300DCB67D /* icon@2x.png */; }; - 3A7FBDC6153FB38300DCB67D /* icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 3A7FBDC5153FB38300DCB67D /* icon-72.png */; }; - 3A7FBDC9153FB38300DCB67D /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 3A7FBDC8153FB38300DCB67D /* Default.png */; }; - 3A7FBDCB153FB38300DCB67D /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3A7FBDCA153FB38300DCB67D /* Default@2x.png */; }; - 3A7FBDCD153FB38300DCB67D /* Capture.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 3A7FBDCC153FB38300DCB67D /* Capture.bundle */; }; - 3A7FBDCF153FB38300DCB67D /* Cordova.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3A7FBDCE153FB38300DCB67D /* Cordova.plist */; }; - 3A7FBDD3153FB38300DCB67D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A7FBDD2153FB38300DCB67D /* AppDelegate.m */; }; - 3A7FBDD6153FB38300DCB67D /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A7FBDD5153FB38300DCB67D /* MainViewController.m */; }; - 3A7FBDD8153FB38300DCB67D /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3A7FBDD7153FB38300DCB67D /* MainViewController.xib */; }; - 3A7FBDDC153FB38300DCB67D /* verify.sh in Resources */ = {isa = PBXBuildFile; fileRef = 3A7FBDDB153FB38300DCB67D /* verify.sh */; }; - 3A7FBDE3153FB44D00DCB67D /* www in Resources */ = {isa = PBXBuildFile; fileRef = 3A7FBDE2153FB44D00DCB67D /* www */; }; - 3A7FBDE6153FB48D00DCB67D /* ImageFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A7FBDE5153FB48D00DCB67D /* ImageFilter.m */; }; - 3A7FBDED153FB49A00DCB67D /* painter.png in Resources */ = {isa = PBXBuildFile; fileRef = 3A7FBDE8153FB49A00DCB67D /* painter.png */; }; - 3A7FBDEE153FB49A00DCB67D /* vignette2.png in Resources */ = {isa = PBXBuildFile; fileRef = 3A7FBDE9153FB49A00DCB67D /* vignette2.png */; }; - 3A7FBDEF153FB49A00DCB67D /* vignette3.png in Resources */ = {isa = PBXBuildFile; fileRef = 3A7FBDEA153FB49A00DCB67D /* vignette3.png */; }; - 3A7FBDF0153FB49A00DCB67D /* vignette4.png in Resources */ = {isa = PBXBuildFile; fileRef = 3A7FBDEB153FB49A00DCB67D /* vignette4.png */; }; - 3A7FBDF1153FB49A00DCB67D /* vintage.png in Resources */ = {isa = PBXBuildFile; fileRef = 3A7FBDEC153FB49A00DCB67D /* vintage.png */; }; - 3A7FBDF3153FB50C00DCB67D /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A7FBDF2153FB50C00DCB67D /* CoreImage.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 3A7FBD86153FB38200DCB67D /* ImageFilter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ImageFilter.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 3A7FBD8A153FB38200DCB67D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 3A7FBD8C153FB38200DCB67D /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 3A7FBD8E153FB38200DCB67D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 3A7FBD90153FB38200DCB67D /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; }; - 3A7FBD92153FB38200DCB67D /* AddressBookUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBookUI.framework; path = System/Library/Frameworks/AddressBookUI.framework; sourceTree = SDKROOT; }; - 3A7FBD94153FB38200DCB67D /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; - 3A7FBD96153FB38200DCB67D /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; - 3A7FBD98153FB38200DCB67D /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; - 3A7FBD9A153FB38200DCB67D /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; }; - 3A7FBD9C153FB38200DCB67D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - 3A7FBD9E153FB38200DCB67D /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; - 3A7FBDA0153FB38200DCB67D /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; - 3A7FBDA2153FB38200DCB67D /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; - 3A7FBDA6153FB38200DCB67D /* ImageFilter-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ImageFilter-Info.plist"; sourceTree = ""; }; - 3A7FBDA8153FB38200DCB67D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 3A7FBDAA153FB38200DCB67D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 3A7FBDAC153FB38200DCB67D /* ImageFilter-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ImageFilter-Prefix.pch"; sourceTree = ""; }; - 3A7FBDAD153FB38200DCB67D /* Cordova.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cordova.framework; path = /Users/Shared/Cordova/Frameworks/Cordova.framework; sourceTree = ""; }; - 3A7FBDB2153FB38200DCB67D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Resources/en.lproj/Localizable.strings; sourceTree = ""; }; - 3A7FBDB6153FB38200DCB67D /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = Resources/es.lproj/Localizable.strings; sourceTree = ""; }; - 3A7FBDBA153FB38200DCB67D /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = Resources/de.lproj/Localizable.strings; sourceTree = ""; }; - 3A7FBDBE153FB38300DCB67D /* se */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = se; path = Resources/se.lproj/Localizable.strings; sourceTree = ""; }; - 3A7FBDC1153FB38300DCB67D /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = icon.png; path = Resources/icons/icon.png; sourceTree = ""; }; - 3A7FBDC3153FB38300DCB67D /* icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icon@2x.png"; path = "Resources/icons/icon@2x.png"; sourceTree = ""; }; - 3A7FBDC5153FB38300DCB67D /* icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icon-72.png"; path = "Resources/icons/icon-72.png"; sourceTree = ""; }; - 3A7FBDC8153FB38300DCB67D /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = Resources/splash/Default.png; sourceTree = ""; }; - 3A7FBDCA153FB38300DCB67D /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "Resources/splash/Default@2x.png"; sourceTree = ""; }; - 3A7FBDCC153FB38300DCB67D /* Capture.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = Capture.bundle; path = Resources/Capture.bundle; sourceTree = ""; }; - 3A7FBDCE153FB38300DCB67D /* Cordova.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Cordova.plist; sourceTree = ""; }; - 3A7FBDD1153FB38300DCB67D /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Classes/AppDelegate.h; sourceTree = ""; }; - 3A7FBDD2153FB38300DCB67D /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Classes/AppDelegate.m; sourceTree = ""; }; - 3A7FBDD4153FB38300DCB67D /* MainViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MainViewController.h; path = Classes/MainViewController.h; sourceTree = ""; }; - 3A7FBDD5153FB38300DCB67D /* MainViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MainViewController.m; path = Classes/MainViewController.m; sourceTree = ""; }; - 3A7FBDD7153FB38300DCB67D /* MainViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = MainViewController.xib; path = Classes/MainViewController.xib; sourceTree = ""; }; - 3A7FBDDA153FB38300DCB67D /* README */ = {isa = PBXFileReference; lastKnownFileType = text; name = README; path = Plugins/README; sourceTree = ""; }; - 3A7FBDDB153FB38300DCB67D /* verify.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = verify.sh; sourceTree = ""; }; - 3A7FBDE2153FB44D00DCB67D /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = ""; }; - 3A7FBDE4153FB48D00DCB67D /* ImageFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageFilter.h; sourceTree = ""; }; - 3A7FBDE5153FB48D00DCB67D /* ImageFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageFilter.m; sourceTree = ""; }; - 3A7FBDE8153FB49A00DCB67D /* painter.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = painter.png; path = frames/painter.png; sourceTree = ""; }; - 3A7FBDE9153FB49A00DCB67D /* vignette2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = vignette2.png; path = frames/vignette2.png; sourceTree = ""; }; - 3A7FBDEA153FB49A00DCB67D /* vignette3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = vignette3.png; path = frames/vignette3.png; sourceTree = ""; }; - 3A7FBDEB153FB49A00DCB67D /* vignette4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = vignette4.png; path = frames/vignette4.png; sourceTree = ""; }; - 3A7FBDEC153FB49A00DCB67D /* vintage.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = vintage.png; path = frames/vintage.png; sourceTree = ""; }; - 3A7FBDF2153FB50C00DCB67D /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = System/Library/Frameworks/CoreImage.framework; sourceTree = SDKROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 3A7FBD80153FB38200DCB67D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3A7FBDF3153FB50C00DCB67D /* CoreImage.framework in Frameworks */, - 3A7FBD8B153FB38200DCB67D /* Foundation.framework in Frameworks */, - 3A7FBD8D153FB38200DCB67D /* UIKit.framework in Frameworks */, - 3A7FBD8F153FB38200DCB67D /* CoreGraphics.framework in Frameworks */, - 3A7FBD91153FB38200DCB67D /* AddressBook.framework in Frameworks */, - 3A7FBD93153FB38200DCB67D /* AddressBookUI.framework in Frameworks */, - 3A7FBD95153FB38200DCB67D /* AudioToolbox.framework in Frameworks */, - 3A7FBD97153FB38200DCB67D /* AVFoundation.framework in Frameworks */, - 3A7FBD99153FB38200DCB67D /* CoreLocation.framework in Frameworks */, - 3A7FBD9B153FB38200DCB67D /* MediaPlayer.framework in Frameworks */, - 3A7FBD9D153FB38200DCB67D /* QuartzCore.framework in Frameworks */, - 3A7FBD9F153FB38200DCB67D /* SystemConfiguration.framework in Frameworks */, - 3A7FBDA1153FB38200DCB67D /* MobileCoreServices.framework in Frameworks */, - 3A7FBDA3153FB38200DCB67D /* CoreMedia.framework in Frameworks */, - 3A7FBDAE153FB38200DCB67D /* Cordova.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 3A7FBD83153FB38200DCB67D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 3A7FBD78153FB38200DCB67D = { - isa = PBXGroup; - children = ( - 3A7FBDA4153FB38200DCB67D /* ImageFilter */, - 3A7FBD89153FB38200DCB67D /* Frameworks */, - 3A7FBD87153FB38200DCB67D /* Products */, - ); - sourceTree = ""; - }; - 3A7FBD87153FB38200DCB67D /* Products */ = { - isa = PBXGroup; - children = ( - 3A7FBD86153FB38200DCB67D /* ImageFilter.app */, - ); - name = Products; - sourceTree = ""; - }; - 3A7FBD89153FB38200DCB67D /* Frameworks */ = { - isa = PBXGroup; - children = ( - 3A7FBDF2153FB50C00DCB67D /* CoreImage.framework */, - 3A7FBD8A153FB38200DCB67D /* Foundation.framework */, - 3A7FBD8C153FB38200DCB67D /* UIKit.framework */, - 3A7FBD8E153FB38200DCB67D /* CoreGraphics.framework */, - 3A7FBD90153FB38200DCB67D /* AddressBook.framework */, - 3A7FBD92153FB38200DCB67D /* AddressBookUI.framework */, - 3A7FBD94153FB38200DCB67D /* AudioToolbox.framework */, - 3A7FBD96153FB38200DCB67D /* AVFoundation.framework */, - 3A7FBD98153FB38200DCB67D /* CoreLocation.framework */, - 3A7FBD9A153FB38200DCB67D /* MediaPlayer.framework */, - 3A7FBD9C153FB38200DCB67D /* QuartzCore.framework */, - 3A7FBD9E153FB38200DCB67D /* SystemConfiguration.framework */, - 3A7FBDA0153FB38200DCB67D /* MobileCoreServices.framework */, - 3A7FBDA2153FB38200DCB67D /* CoreMedia.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 3A7FBDA4153FB38200DCB67D /* ImageFilter */ = { - isa = PBXGroup; - children = ( - 3A7FBDE2153FB44D00DCB67D /* www */, - 3A7FBDAD153FB38200DCB67D /* Cordova.framework */, - 3A7FBDAF153FB38200DCB67D /* Resources */, - 3A7FBDD0153FB38300DCB67D /* Classes */, - 3A7FBDD9153FB38300DCB67D /* Plugins */, - 3A7FBDA5153FB38200DCB67D /* Supporting Files */, - ); - path = ImageFilter; - sourceTree = ""; - }; - 3A7FBDA5153FB38200DCB67D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 3A7FBDA6153FB38200DCB67D /* ImageFilter-Info.plist */, - 3A7FBDA7153FB38200DCB67D /* InfoPlist.strings */, - 3A7FBDAA153FB38200DCB67D /* main.m */, - 3A7FBDAC153FB38200DCB67D /* ImageFilter-Prefix.pch */, - 3A7FBDCE153FB38300DCB67D /* Cordova.plist */, - 3A7FBDD7153FB38300DCB67D /* MainViewController.xib */, - 3A7FBDDB153FB38300DCB67D /* verify.sh */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 3A7FBDAF153FB38200DCB67D /* Resources */ = { - isa = PBXGroup; - children = ( - 3A7FBDE8153FB49A00DCB67D /* painter.png */, - 3A7FBDE9153FB49A00DCB67D /* vignette2.png */, - 3A7FBDEA153FB49A00DCB67D /* vignette3.png */, - 3A7FBDEB153FB49A00DCB67D /* vignette4.png */, - 3A7FBDEC153FB49A00DCB67D /* vintage.png */, - 3A7FBDCC153FB38300DCB67D /* Capture.bundle */, - 3A7FBDB0153FB38200DCB67D /* en.lproj */, - 3A7FBDB4153FB38200DCB67D /* es.lproj */, - 3A7FBDB8153FB38200DCB67D /* de.lproj */, - 3A7FBDBC153FB38200DCB67D /* se.lproj */, - 3A7FBDC0153FB38300DCB67D /* icons */, - 3A7FBDC7153FB38300DCB67D /* splash */, - ); - name = Resources; - sourceTree = ""; - }; - 3A7FBDB0153FB38200DCB67D /* en.lproj */ = { - isa = PBXGroup; - children = ( - 3A7FBDB1153FB38200DCB67D /* Localizable.strings */, - ); - name = en.lproj; - sourceTree = ""; - }; - 3A7FBDB4153FB38200DCB67D /* es.lproj */ = { - isa = PBXGroup; - children = ( - 3A7FBDB5153FB38200DCB67D /* Localizable.strings */, - ); - name = es.lproj; - sourceTree = ""; - }; - 3A7FBDB8153FB38200DCB67D /* de.lproj */ = { - isa = PBXGroup; - children = ( - 3A7FBDB9153FB38200DCB67D /* Localizable.strings */, - ); - name = de.lproj; - sourceTree = ""; - }; - 3A7FBDBC153FB38200DCB67D /* se.lproj */ = { - isa = PBXGroup; - children = ( - 3A7FBDBD153FB38300DCB67D /* Localizable.strings */, - ); - name = se.lproj; - sourceTree = ""; - }; - 3A7FBDC0153FB38300DCB67D /* icons */ = { - isa = PBXGroup; - children = ( - 3A7FBDC1153FB38300DCB67D /* icon.png */, - 3A7FBDC3153FB38300DCB67D /* icon@2x.png */, - 3A7FBDC5153FB38300DCB67D /* icon-72.png */, - ); - name = icons; - sourceTree = ""; - }; - 3A7FBDC7153FB38300DCB67D /* splash */ = { - isa = PBXGroup; - children = ( - 3A7FBDC8153FB38300DCB67D /* Default.png */, - 3A7FBDCA153FB38300DCB67D /* Default@2x.png */, - ); - name = splash; - sourceTree = ""; - }; - 3A7FBDD0153FB38300DCB67D /* Classes */ = { - isa = PBXGroup; - children = ( - 3A7FBDD1153FB38300DCB67D /* AppDelegate.h */, - 3A7FBDD2153FB38300DCB67D /* AppDelegate.m */, - 3A7FBDD4153FB38300DCB67D /* MainViewController.h */, - 3A7FBDD5153FB38300DCB67D /* MainViewController.m */, - ); - name = Classes; - sourceTree = ""; - }; - 3A7FBDD9153FB38300DCB67D /* Plugins */ = { - isa = PBXGroup; - children = ( - 3A7FBDE4153FB48D00DCB67D /* ImageFilter.h */, - 3A7FBDE5153FB48D00DCB67D /* ImageFilter.m */, - 3A7FBDDA153FB38300DCB67D /* README */, - ); - name = Plugins; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 3A7FBD85153FB38200DCB67D /* ImageFilter */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3A7FBDDF153FB38300DCB67D /* Build configuration list for PBXNativeTarget "ImageFilter" */; - buildPhases = ( - 3A7FBD7F153FB38200DCB67D /* Sources */, - 3A7FBD80153FB38200DCB67D /* Frameworks */, - 3A7FBD81153FB38200DCB67D /* Resources */, - 3A7FBD82153FB38200DCB67D /* Sources */, - 3A7FBD83153FB38200DCB67D /* Frameworks */, - 3A7FBD84153FB38200DCB67D /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = ImageFilter; - productName = ImageFilter; - productReference = 3A7FBD86153FB38200DCB67D /* ImageFilter.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 3A7FBD7A153FB38200DCB67D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0430; - ORGANIZATIONNAME = meusPartum; - }; - buildConfigurationList = 3A7FBD7D153FB38200DCB67D /* Build configuration list for PBXProject "ImageFilter" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - es, - de, - se, - ); - mainGroup = 3A7FBD78153FB38200DCB67D; - productRefGroup = 3A7FBD87153FB38200DCB67D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 3A7FBD85153FB38200DCB67D /* ImageFilter */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 3A7FBD81153FB38200DCB67D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3A7FBDA9153FB38200DCB67D /* InfoPlist.strings in Resources */, - 3A7FBDB3153FB38200DCB67D /* Localizable.strings in Resources */, - 3A7FBDB7153FB38200DCB67D /* Localizable.strings in Resources */, - 3A7FBDBB153FB38200DCB67D /* Localizable.strings in Resources */, - 3A7FBDBF153FB38300DCB67D /* Localizable.strings in Resources */, - 3A7FBDC2153FB38300DCB67D /* icon.png in Resources */, - 3A7FBDC4153FB38300DCB67D /* icon@2x.png in Resources */, - 3A7FBDC6153FB38300DCB67D /* icon-72.png in Resources */, - 3A7FBDC9153FB38300DCB67D /* Default.png in Resources */, - 3A7FBDCB153FB38300DCB67D /* Default@2x.png in Resources */, - 3A7FBDCD153FB38300DCB67D /* Capture.bundle in Resources */, - 3A7FBDCF153FB38300DCB67D /* Cordova.plist in Resources */, - 3A7FBDD8153FB38300DCB67D /* MainViewController.xib in Resources */, - 3A7FBDDC153FB38300DCB67D /* verify.sh in Resources */, - 3A7FBDE3153FB44D00DCB67D /* www in Resources */, - 3A7FBDED153FB49A00DCB67D /* painter.png in Resources */, - 3A7FBDEE153FB49A00DCB67D /* vignette2.png in Resources */, - 3A7FBDEF153FB49A00DCB67D /* vignette3.png in Resources */, - 3A7FBDF0153FB49A00DCB67D /* vignette4.png in Resources */, - 3A7FBDF1153FB49A00DCB67D /* vintage.png in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3A7FBD84153FB38200DCB67D /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/bash; - shellScript = "\n\t\t\t\t\t\t\t\tchmod 755 \"$PROJECT_DIR/$PROJECT_NAME/verify.sh\"\n\t\t\t\t\t\t\t\t\"$PROJECT_DIR/$PROJECT_NAME/verify.sh\"\n\t\t\t\t\t"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 3A7FBD7F153FB38200DCB67D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3A7FBDAB153FB38200DCB67D /* main.m in Sources */, - 3A7FBDD3153FB38300DCB67D /* AppDelegate.m in Sources */, - 3A7FBDD6153FB38300DCB67D /* MainViewController.m in Sources */, - 3A7FBDE6153FB48D00DCB67D /* ImageFilter.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 3A7FBD82153FB38200DCB67D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 3A7FBDA7153FB38200DCB67D /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 3A7FBDA8153FB38200DCB67D /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; - 3A7FBDB1153FB38200DCB67D /* Localizable.strings */ = { - isa = PBXVariantGroup; - children = ( - 3A7FBDB2153FB38200DCB67D /* en */, - ); - name = Localizable.strings; - sourceTree = ""; - }; - 3A7FBDB5153FB38200DCB67D /* Localizable.strings */ = { - isa = PBXVariantGroup; - children = ( - 3A7FBDB6153FB38200DCB67D /* es */, - ); - name = Localizable.strings; - sourceTree = ""; - }; - 3A7FBDB9153FB38200DCB67D /* Localizable.strings */ = { - isa = PBXVariantGroup; - children = ( - 3A7FBDBA153FB38200DCB67D /* de */, - ); - name = Localizable.strings; - sourceTree = ""; - }; - 3A7FBDBD153FB38300DCB67D /* Localizable.strings */ = { - isa = PBXVariantGroup; - children = ( - 3A7FBDBE153FB38300DCB67D /* se */, - ); - name = Localizable.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 3A7FBDDD153FB38300DCB67D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = ( - armv6, - "$(ARCHS_STANDARD_32_BIT)", - ); - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 3A7FBDDE153FB38300DCB67D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = ( - armv6, - "$(ARCHS_STANDARD_32_BIT)", - ); - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 3A7FBDE0153FB38300DCB67D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; - COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = /Users/Shared/Cordova/Frameworks; - GCC_DYNAMIC_NO_PIC = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "ImageFilter/ImageFilter-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1,", - "CORDOVA_FRAMEWORK=1", - ); - INFOPLIST_FILE = "ImageFilter/ImageFilter-Info.plist"; - OTHER_LDFLAGS = ( - "-weak_framework", - UIKit, - "-weak_framework", - AVFoundation, - "-weak_framework", - CoreMedia, - "-weak_library", - /usr/lib/libSystem.B.dylib, - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - 3A7FBDE1153FB38300DCB67D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - FRAMEWORK_SEARCH_PATHS = /Users/Shared/Cordova/Frameworks; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "ImageFilter/ImageFilter-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "NDEBUG=1,", - "CORDOVA_FRAMEWORK=1", - ); - INFOPLIST_FILE = "ImageFilter/ImageFilter-Info.plist"; - OTHER_LDFLAGS = ( - "-weak_framework", - UIKit, - "-weak_framework", - AVFoundation, - "-weak_framework", - CoreMedia, - "-weak_library", - /usr/lib/libSystem.B.dylib, - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 3A7FBD7D153FB38200DCB67D /* Build configuration list for PBXProject "ImageFilter" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3A7FBDDD153FB38300DCB67D /* Debug */, - 3A7FBDDE153FB38300DCB67D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 3A7FBDDF153FB38300DCB67D /* Build configuration list for PBXNativeTarget "ImageFilter" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3A7FBDE0153FB38300DCB67D /* Debug */, - 3A7FBDE1153FB38300DCB67D /* Release */, - ); - defaultConfigurationIsVisible = 0; - }; -/* End XCConfigurationList section */ - }; - rootObject = 3A7FBD7A153FB38200DCB67D /* Project object */; -} diff --git a/iOS/cordova/project/ImageFilter/ImageFilter.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/iOS/cordova/project/ImageFilter/ImageFilter.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index bab1a40..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/iOS/cordova/project/ImageFilter/ImageFilter.xcodeproj/project.xcworkspace/xcuserdata/drew.xcuserdatad/UserInterfaceState.xcuserstate b/iOS/cordova/project/ImageFilter/ImageFilter.xcodeproj/project.xcworkspace/xcuserdata/drew.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index e1f3d6a..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter.xcodeproj/project.xcworkspace/xcuserdata/drew.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter.xcodeproj/xcuserdata/drew.xcuserdatad/xcschemes/ImageFilter.xcscheme b/iOS/cordova/project/ImageFilter/ImageFilter.xcodeproj/xcuserdata/drew.xcuserdatad/xcschemes/ImageFilter.xcscheme deleted file mode 100644 index 6fe0c9b..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter.xcodeproj/xcuserdata/drew.xcuserdatad/xcschemes/ImageFilter.xcscheme +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/iOS/cordova/project/ImageFilter/ImageFilter.xcodeproj/xcuserdata/drew.xcuserdatad/xcschemes/xcschememanagement.plist b/iOS/cordova/project/ImageFilter/ImageFilter.xcodeproj/xcuserdata/drew.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 221e6b6..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter.xcodeproj/xcuserdata/drew.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - SchemeUserState - - ImageFilter.xcscheme - - orderHint - 0 - - - SuppressBuildableAutocreation - - 3A7FBD85153FB38200DCB67D - - primary - - - - - diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Classes/AppDelegate.h b/iOS/cordova/project/ImageFilter/ImageFilter/Classes/AppDelegate.h deleted file mode 100644 index cbd74ee..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/Classes/AppDelegate.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -// -// AppDelegate.h -// ImageFilter -// -// Created by Andrew Dahlman on 4/18/12. -// Copyright meusPartum 2012. All rights reserved. -// - -#import - -#ifdef CORDOVA_FRAMEWORK - #import -#else - #import "CDVViewController.h" -#endif - - -@interface AppDelegate : NSObject < UIApplicationDelegate > { - -} - -// invoke string is passed to your app on launch, this is only valid if you -// edit ImageFilter-Info.plist to add a protocol -// a simple tutorial can be found here : -// http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html - -@property (nonatomic, retain) IBOutlet UIWindow* window; -@property (nonatomic, retain) IBOutlet CDVViewController* viewController; - -@end - diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Classes/AppDelegate.m b/iOS/cordova/project/ImageFilter/ImageFilter/Classes/AppDelegate.m deleted file mode 100644 index 488198e..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/Classes/AppDelegate.m +++ /dev/null @@ -1,140 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -// -// AppDelegate.m -// ImageFilter -// -// Created by Andrew Dahlman on 4/18/12. -// Copyright meusPartum 2012. All rights reserved. -// - -#import "AppDelegate.h" -#import "MainViewController.h" - -#ifdef CORDOVA_FRAMEWORK - #import - #import -#else - #import "CDVPlugin.h" - #import "CDVURLProtocol.h" -#endif - - -@implementation AppDelegate - -@synthesize window, viewController; - -- (id) init -{ - /** If you need to do any extra app-specific initialization, you can do it here - * -jm - **/ - NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; - [cookieStorage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways]; - - [CDVURLProtocol registerURLProtocol]; - - return [super init]; -} - -#pragma UIApplicationDelegate implementation - -/** - * This is main kick off after the app inits, the views and Settings are setup here. (preferred - iOS4 and up) - */ -- (BOOL) application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions -{ - NSURL* url = [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey]; - NSString* invokeString = nil; - - if (url && [url isKindOfClass:[NSURL class]]) { - invokeString = [url absoluteString]; - NSLog(@"ImageFilter launchOptions = %@", url); - } - - CGRect screenBounds = [[UIScreen mainScreen] bounds]; - self.window = [[[UIWindow alloc] initWithFrame:screenBounds] autorelease]; - self.window.autoresizesSubviews = YES; - - CGRect viewBounds = [[UIScreen mainScreen] applicationFrame]; - - self.viewController = [[[MainViewController alloc] init] autorelease]; - self.viewController.useSplashScreen = YES; - self.viewController.wwwFolderName = @"www"; - self.viewController.startPage = @"index.html"; - self.viewController.invokeString = invokeString; - self.viewController.view.frame = viewBounds; - - // check whether the current orientation is supported: if it is, keep it, rather than forcing a rotation - BOOL forceStartupRotation = YES; - UIDeviceOrientation curDevOrientation = [[UIDevice currentDevice] orientation]; - - if (UIDeviceOrientationUnknown == curDevOrientation) { - // UIDevice isn't firing orientation notifications yet… go look at the status bar - curDevOrientation = (UIDeviceOrientation)[[UIApplication sharedApplication] statusBarOrientation]; - } - - if (UIDeviceOrientationIsValidInterfaceOrientation(curDevOrientation)) { - for (NSNumber *orient in self.viewController.supportedOrientations) { - if ([orient intValue] == curDevOrientation) { - forceStartupRotation = NO; - break; - } - } - } - - if (forceStartupRotation) { - NSLog(@"supportedOrientations: %@", self.viewController.supportedOrientations); - // The first item in the supportedOrientations array is the start orientation (guaranteed to be at least Portrait) - UIInterfaceOrientation newOrient = [[self.viewController.supportedOrientations objectAtIndex:0] intValue]; - NSLog(@"AppDelegate forcing status bar to: %d from: %d", newOrient, curDevOrientation); - [[UIApplication sharedApplication] setStatusBarOrientation:newOrient]; - } - - [self.window addSubview:self.viewController.view]; - [self.window makeKeyAndVisible]; - - return YES; -} - -// this happens while we are running ( in the background, or from within our own app ) -// only valid if ImageFilter-Info.plist specifies a protocol to handle -- (BOOL) application:(UIApplication*)application handleOpenURL:(NSURL*)url -{ - if (!url) { - return NO; - } - - // calls into javascript global function 'handleOpenURL' - NSString* jsString = [NSString stringWithFormat:@"handleOpenURL(\"%@\");", url]; - [self.viewController.webView stringByEvaluatingJavaScriptFromString:jsString]; - - // all plugins will get the notification, and their handlers will be called - [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]]; - - return YES; -} - -- (void) dealloc -{ - [super dealloc]; -} - -@end diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Classes/MainViewController.h b/iOS/cordova/project/ImageFilter/ImageFilter/Classes/MainViewController.h deleted file mode 100644 index fb32c83..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/Classes/MainViewController.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -// -// MainViewController.h -// ImageFilter -// -// Created by Andrew Dahlman on 4/18/12. -// Copyright meusPartum 2012. All rights reserved. -// - -#ifdef CORDOVA_FRAMEWORK - #import -#else - #import "CDVViewController.h" -#endif - -@interface MainViewController : CDVViewController - -@end diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Classes/MainViewController.m b/iOS/cordova/project/ImageFilter/ImageFilter/Classes/MainViewController.m deleted file mode 100644 index 3015530..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/Classes/MainViewController.m +++ /dev/null @@ -1,132 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -// -// MainViewController.h -// ImageFilter -// -// Created by Andrew Dahlman on 4/18/12. -// Copyright meusPartum 2012. All rights reserved. -// - -#import "MainViewController.h" - -@implementation MainViewController - -- (id) initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil -{ - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - // Custom initialization - } - return self; -} - -- (void) didReceiveMemoryWarning -{ - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -#pragma mark - View lifecycle - -- (void) viewDidLoad -{ - [super viewDidLoad]; - // Do any additional setup after loading the view from its nib. -} - -- (void) viewDidUnload -{ - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - -- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation -{ - // Return YES for supported orientations - return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation]; -} - -/* Comment out the block below to over-ride */ -/* -#pragma CDVCommandDelegate implementation - -- (id) getCommandInstance:(NSString*)className -{ - return [super getCommandInstance:className]; -} - -- (BOOL) execute:(CDVInvokedUrlCommand*)command -{ - return [super execute:command]; -} - -- (NSString*) pathForResource:(NSString*)resourcepath; -{ - return [super pathForResource:resourcepath]; -} - -- (void) registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className -{ - return [super registerPlugin:plugin withClassName:className]; -} -*/ - -#pragma UIWebDelegate implementation - -- (void) webViewDidFinishLoad:(UIWebView*) theWebView -{ - // only valid if ___PROJECTNAME__-Info.plist specifies a protocol to handle - if (self.invokeString) - { - // this is passed before the deviceready event is fired, so you can access it in js when you receive deviceready - NSString* jsString = [NSString stringWithFormat:@"var invokeString = \"%@\";", self.invokeString]; - [theWebView stringByEvaluatingJavaScriptFromString:jsString]; - } - - // Black base color for background matches the native apps - theWebView.backgroundColor = [UIColor blackColor]; - - return [super webViewDidFinishLoad:theWebView]; -} - -/* Comment out the block below to over-ride */ -/* - -- (void) webViewDidStartLoad:(UIWebView*)theWebView -{ - return [super webViewDidStartLoad:theWebView]; -} - -- (void) webView:(UIWebView*)theWebView didFailLoadWithError:(NSError*)error -{ - return [super webView:theWebView didFailLoadWithError:error]; -} - -- (BOOL) webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType -{ - return [super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType]; -} -*/ - -@end diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Classes/MainViewController.xib b/iOS/cordova/project/ImageFilter/ImageFilter/Classes/MainViewController.xib deleted file mode 100644 index 9837f57..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/Classes/MainViewController.xib +++ /dev/null @@ -1,118 +0,0 @@ - - - - 1280 - 11C25 - 1919 - 1138.11 - 566.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 916 - - - IBProxyObject - IBUIView - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - {{0, 20}, {320, 460}} - - - - 3 - MQA - - 2 - - - - IBCocoaTouchFramework - - - - - - - view - - - - 3 - - - - - - 0 - - - - - - 1 - - - - - -1 - - - File's Owner - - - -2 - - - - - - - MainViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - - 3 - - - - - MainViewController - UIViewController - - IBProjectSource - ./Classes/MainViewController.h - - - - - 0 - IBCocoaTouchFramework - YES - 3 - 916 - - diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Cordova.plist b/iOS/cordova/project/ImageFilter/ImageFilter/Cordova.plist deleted file mode 100644 index 274580a..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/Cordova.plist +++ /dev/null @@ -1,59 +0,0 @@ - - - - - UIWebViewBounce - - TopActivityIndicator - gray - EnableLocation - - EnableViewportScale - - AutoHideSplashScreen - - ShowSplashScreenSpinner - - MediaPlaybackRequiresUserAction - - AllowInlineMediaPlayback - - OpenAllWhitelistURLsInWebView - - ExternalHosts - - Plugins - - ImageFilter - ImageFilter - Compass - CDVLocation - Accelerometer - CDVAccelerometer - Camera - CDVCamera - NetworkStatus - CDVConnection - Contacts - CDVContacts - Debug Console - CDVDebugConsole - File - CDVFile - FileTransfer - CDVFileTransfer - Geolocation - CDVLocation - Notification - CDVNotification - Media - CDVSound - Capture - CDVCapture - SplashScreen - CDVSplashScreen - Battery - CDVBattery - - - diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/ImageFilter-Info.plist b/iOS/cordova/project/ImageFilter/ImageFilter/ImageFilter-Info.plist deleted file mode 100644 index 4fd3f6c..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/ImageFilter-Info.plist +++ /dev/null @@ -1,49 +0,0 @@ - - - - - CFBundleIconFiles - - icon.png - icon@2x.png - icon-72.png - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - CFBundleDevelopmentRegion - English - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - icon.png - CFBundleIdentifier - com.drewdahlman.ImageFilter - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - NSMainNibFile - - NSMainNibFile~ipad - - - diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/ImageFilter-Prefix.pch b/iOS/cordova/project/ImageFilter/ImageFilter/ImageFilter-Prefix.pch deleted file mode 100644 index 1f2aee1..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/ImageFilter-Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'ImageFilter' target in the 'ImageFilter' project -// - -#ifdef __OBJC__ - #import -#endif diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/ImageFilter.h b/iOS/cordova/project/ImageFilter/ImageFilter/ImageFilter.h deleted file mode 100644 index b286da1..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/ImageFilter.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// ImageFilter.h -// -// Created by Drew Dahlman 2/25/2012. -// Copyright 2012 Drew Dahlman. All rights reserved. -// version 1.0 - -// Current Filters: -// none -// stark -// sunnySide -// worn -// vintage - -/* -Copyright (c) 2012 Drew Dahlman MIT LICENSE -*/ - - -#import - -#ifdef CORDOVA_FRAMEWORK -#import -#else -#import "CDVPlugin.h" -#endif - - -@interface ImageFilter : CDVPlugin { - NSString* callbackID; -} -@property (nonatomic, retain) NSString* callbackID; - - -// GARBAGE -- (void)clean:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; - -// FILTERS -- (void)none:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; -- (void)stark:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; -- (void)sunnySide:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; -- (void)worn:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; -- (void)vintage:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; -@end diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Plugins/README b/iOS/cordova/project/ImageFilter/ImageFilter/Plugins/README deleted file mode 100644 index 438840d..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/Plugins/README +++ /dev/null @@ -1 +0,0 @@ -Put the .h and .m files of your plugin here. The .js files of your plugin belong in the www folder. \ No newline at end of file diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/controls_bg.png b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/controls_bg.png deleted file mode 100644 index 784e9c7..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/controls_bg.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/controls_bg@2x.png b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/controls_bg@2x.png deleted file mode 100644 index 1e28c6d..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/controls_bg@2x.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/controls_bg~ipad.png b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/controls_bg~ipad.png deleted file mode 100644 index efbef8a..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/controls_bg~ipad.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/microphone.png b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/microphone.png deleted file mode 100644 index 155b88c..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/microphone.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/microphone@2x.png b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/microphone@2x.png deleted file mode 100644 index 79ef16b..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/microphone@2x.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/microphone~ipad.png b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/microphone~ipad.png deleted file mode 100644 index ef1c472..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/microphone~ipad.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/record_button.png b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/record_button.png deleted file mode 100644 index ceb9589..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/record_button.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/record_button@2x.png b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/record_button@2x.png deleted file mode 100644 index d6ce302..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/record_button@2x.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/record_button~ipad.png b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/record_button~ipad.png deleted file mode 100644 index d8e24a4..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/record_button~ipad.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/recording_bg.png b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/recording_bg.png deleted file mode 100644 index bafc087..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/recording_bg.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/recording_bg@2x.png b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/recording_bg@2x.png deleted file mode 100644 index 798490b..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/recording_bg@2x.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/recording_bg~ipad.png b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/recording_bg~ipad.png deleted file mode 100644 index 3b467f6..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/recording_bg~ipad.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/stop_button.png b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/stop_button.png deleted file mode 100644 index 9c31838..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/stop_button.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/stop_button@2x.png b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/stop_button@2x.png deleted file mode 100644 index 8cf657e..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/stop_button@2x.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/stop_button~ipad.png b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/stop_button~ipad.png deleted file mode 100644 index 59bb7a5..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/Capture.bundle/stop_button~ipad.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/de.lproj/Localizable.strings b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/de.lproj/Localizable.strings deleted file mode 100644 index f1cdb42..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/de.lproj/Localizable.strings +++ /dev/null @@ -1,26 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - - -// accessibility label for recording button -"toggle audio recording" = "starten/beenden der Tonaufnahme"; -// notification spoken by VoiceOver when timed recording finishes -"timed recording complete" = "programmierte Aufnahme beendet"; -// accessibility hint for display of recorded elapsed time -"recorded time in minutes and seconds" = "aufgenommene Zeit in Minuten und Sekunden"; \ No newline at end of file diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/en.lproj/Localizable.strings b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/en.lproj/Localizable.strings deleted file mode 100644 index 8972684..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/en.lproj/Localizable.strings +++ /dev/null @@ -1,25 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -// accessibility label for recording button -"toggle audio recording" = "toggle audio recording"; -// notification spoken by VoiceOver when timed recording finishes -"timed recording complete" = "timed recording complete"; -// accessibility hint for display of recorded elapsed time -"recorded time in minutes and seconds" = "recorded time in minutes and seconds"; \ No newline at end of file diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/es.lproj/Localizable.strings b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/es.lproj/Localizable.strings deleted file mode 100644 index 23831e6..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/es.lproj/Localizable.strings +++ /dev/null @@ -1,25 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -// accessibility label for recording button -"toggle audio recording" = "grabación de audio cambiar"; -// notification spoken by VoiceOver when timed recording finishes -"timed recording complete" = "tiempo de grabación completo"; -// accessibility hint for display of recorded elapsed time -"recorded time in minutes and seconds" = "tiempo registrado en minutos y segundos"; \ No newline at end of file diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/icons/icon-72.png b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/icons/icon-72.png deleted file mode 100644 index 8c6e5df..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/icons/icon-72.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/icons/icon.png b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/icons/icon.png deleted file mode 100644 index b2571a7..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/icons/icon.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/icons/icon@2x.png b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/icons/icon@2x.png deleted file mode 100644 index d75098f..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/icons/icon@2x.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/se.lproj/Localizable.strings b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/se.lproj/Localizable.strings deleted file mode 100644 index 0af9646..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/se.lproj/Localizable.strings +++ /dev/null @@ -1,26 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - - -// accessibility label for recording button -"toggle audio recording" = "börja/avsluta inspelning"; -// notification spoken by VoiceOver when timed recording finishes -"timed recording complete" = "inspelning har avslutad"; -// accessibility hint for display of recorded elapsed time -"recorded time in minutes and seconds" = "inspelad tid in minuter och sekund"; \ No newline at end of file diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/splash/Default.png b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/splash/Default.png deleted file mode 100644 index 6fcba56..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/splash/Default.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/splash/Default@2x.png b/iOS/cordova/project/ImageFilter/ImageFilter/Resources/splash/Default@2x.png deleted file mode 100644 index bd24886..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/Resources/splash/Default@2x.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/en.lproj/InfoPlist.strings b/iOS/cordova/project/ImageFilter/ImageFilter/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28f..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/frames/painter.png b/iOS/cordova/project/ImageFilter/ImageFilter/frames/painter.png deleted file mode 100644 index 604d8d3..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/frames/painter.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/frames/vignette2.png b/iOS/cordova/project/ImageFilter/ImageFilter/frames/vignette2.png deleted file mode 100644 index d1f0a4f..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/frames/vignette2.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/frames/vignette3.png b/iOS/cordova/project/ImageFilter/ImageFilter/frames/vignette3.png deleted file mode 100644 index d318950..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/frames/vignette3.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/frames/vignette4.png b/iOS/cordova/project/ImageFilter/ImageFilter/frames/vignette4.png deleted file mode 100644 index ea02e9c..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/frames/vignette4.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/frames/vintage.png b/iOS/cordova/project/ImageFilter/ImageFilter/frames/vintage.png deleted file mode 100644 index 0cdb0ea..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/frames/vintage.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/main.m b/iOS/cordova/project/ImageFilter/ImageFilter/main.m deleted file mode 100644 index a628468..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/main.m +++ /dev/null @@ -1,35 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ -// -// main.m -// ImageFilter -// -// Created by Andrew Dahlman on 4/18/12. -// Copyright meusPartum 2012. All rights reserved. -// - -#import - -int main(int argc, char *argv[]) { - - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate"); - [pool release]; - return retVal; -} diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/verify.sh b/iOS/cordova/project/ImageFilter/ImageFilter/verify.sh deleted file mode 100755 index 0f6f037..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/verify.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - - -if [ ! -d "$PROJECT_DIR/www" ] ; then - cp -R /Users/Shared/Cordova/Frameworks/Cordova.framework/www "$PROJECT_DIR" -fi -# detect www folder reference in project, if missing, print warning -grep "{isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = \"\"; };" "$PROJECT_DIR/$PROJECT_NAME.xcodeproj/project.pbxproj" -rc=$? -if [ $rc != 0 ] ; then -echo -e "warning: Missing - Add $PROJECT_DIR/www as a folder reference in your project. Just drag and drop the folder into your project, into the Project Navigator of Xcode 4. Make sure you select the second radio-button: 'Create folder references for any added folders' (which will create a blue folder)" 1>&2 -fi \ No newline at end of file diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/www/css/style.css b/iOS/cordova/project/ImageFilter/ImageFilter/www/css/style.css deleted file mode 100644 index 8ea9325..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/www/css/style.css +++ /dev/null @@ -1,68 +0,0 @@ -*{ - margin:0px; -} -body { - height:100%; - width:100%; - font-family:'helvetica'; - font-size:12px; -} -#header { - width:320px; - position:relative; - top:0px; - left:0px; - margin-bottom:10px; -} -#wrapper { - width:100%; - margin:auto; - position:relative; -} -#buttons { - width:310px; - margin:auto; -} -.btn { - width:auto; - padding:10px; - background-color:#95abb7; - color:#fff; - font-size:15px; - border-radius:5px; - margin-bottom:10px; - font-weight:bold; - text-align:center; -} -.photo { - height:310px; - width:310px; - overflow:hidden; - position:relative; - margin:auto; - display:none; - margin-bottom:10px; -} -.photo img { - height:310px; - width:310px; -} -.filterIcon { - height:70px; - width:70px; - border-radius:5px; - overflow:hidden; - box-shadow:0px 0px 2px #222; -} -.filterText { - color:#222; - width:70px; - text-align:center; -} -.filter { - text-align:center; - width:70px; - float:left; - margin-right:10px; - margin-left:10px; -} \ No newline at end of file diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/www/images/filters/none.png b/iOS/cordova/project/ImageFilter/ImageFilter/www/images/filters/none.png deleted file mode 100644 index e17ea9b..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/www/images/filters/none.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/www/images/filters/stark.png b/iOS/cordova/project/ImageFilter/ImageFilter/www/images/filters/stark.png deleted file mode 100644 index 9fe311a..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/www/images/filters/stark.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/www/images/filters/sunnySide.png b/iOS/cordova/project/ImageFilter/ImageFilter/www/images/filters/sunnySide.png deleted file mode 100644 index b73afe9..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/www/images/filters/sunnySide.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/www/images/filters/vintage.png b/iOS/cordova/project/ImageFilter/ImageFilter/www/images/filters/vintage.png deleted file mode 100644 index 66618c8..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/www/images/filters/vintage.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/www/images/filters/worn.png b/iOS/cordova/project/ImageFilter/ImageFilter/www/images/filters/worn.png deleted file mode 100644 index c5cd994..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/www/images/filters/worn.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/www/images/header.png b/iOS/cordova/project/ImageFilter/ImageFilter/www/images/header.png deleted file mode 100644 index c8b4f49..0000000 Binary files a/iOS/cordova/project/ImageFilter/ImageFilter/www/images/header.png and /dev/null differ diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/www/index.html b/iOS/cordova/project/ImageFilter/ImageFilter/www/index.html deleted file mode 100644 index 5c47146..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/www/index.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
-
use camera
-
use library
-
- - - -
- -
- -
-
-
-
none
-
-
-
-
sunnySide
-
-
-
-
worn
-
-
-
-
vintage
-
-
-
-
stark
-
-
-
- - - -
-
- - diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/www/js/core/cordova-1.6.0.js b/iOS/cordova/project/ImageFilter/ImageFilter/www/js/core/cordova-1.6.0.js deleted file mode 100644 index 9f7cd45..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/www/js/core/cordova-1.6.0.js +++ /dev/null @@ -1,4506 +0,0 @@ -// File generated at :: Tue Apr 10 2012 12:28:18 GMT-0700 (PDT) - -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -;(function() { - -// file: lib/scripts/require.js -var require, - define; - -(function () { - var modules = {}; - - function build(module) { - var factory = module.factory; - module.exports = {}; - delete module.factory; - factory(require, module.exports, module); - return module.exports; - } - - require = function (id) { - if (!modules[id]) { - throw "module " + id + " not found"; - } - return modules[id].factory ? build(modules[id]) : modules[id].exports; - }; - - define = function (id, factory) { - if (modules[id]) { - throw "module " + id + " already defined"; - } - - modules[id] = { - id: id, - factory: factory - }; - }; - - define.remove = function (id) { - delete modules[id]; - }; - -})(); - -//Export for use in node -if (typeof module === "object" && typeof require === "function") { - module.exports.require = require; - module.exports.define = define; -} - -// file: lib/cordova.js -define("cordova", function(require, exports, module) { -var channel = require('cordova/channel'); -/** - * Intercept calls to addEventListener + removeEventListener and handle deviceready, - * resume, and pause events. - */ -var m_document_addEventListener = document.addEventListener; -var m_document_removeEventListener = document.removeEventListener; -var m_window_addEventListener = window.addEventListener; -var m_window_removeEventListener = window.removeEventListener; - -/** - * Houses custom event handlers to intercept on document + window event listeners. - */ -var documentEventHandlers = {}, - windowEventHandlers = {}; - -document.addEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - if (e == 'deviceready') { - channel.onDeviceReady.subscribeOnce(handler); - } else if (e == 'resume') { - channel.onResume.subscribe(handler); - // if subscribing listener after event has already fired, invoke the handler - if (channel.onResume.fired && handler instanceof Function) { - handler(); - } - } else if (e == 'pause') { - channel.onPause.subscribe(handler); - } else if (typeof documentEventHandlers[e] != 'undefined') { - documentEventHandlers[e].subscribe(handler); - } else { - m_document_addEventListener.call(document, evt, handler, capture); - } -}; - -window.addEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - if (typeof windowEventHandlers[e] != 'undefined') { - windowEventHandlers[e].subscribe(handler); - } else { - m_window_addEventListener.call(window, evt, handler, capture); - } -}; - -document.removeEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - // If unsubcribing from an event that is handled by a plugin - if (typeof documentEventHandlers[e] != "undefined") { - documentEventHandlers[e].unsubscribe(handler); - } else { - m_document_removeEventListener.call(document, evt, handler, capture); - } -}; - -window.removeEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - // If unsubcribing from an event that is handled by a plugin - if (typeof windowEventHandlers[e] != "undefined") { - windowEventHandlers[e].unsubscribe(handler); - } else { - m_window_removeEventListener.call(window, evt, handler, capture); - } -}; - -function createEvent(type, data) { - var event = document.createEvent('Events'); - event.initEvent(type, false, false); - if (data) { - for (var i in data) { - if (data.hasOwnProperty(i)) { - event[i] = data[i]; - } - } - } - return event; -} - -if(typeof window.console === "undefined") -{ - window.console = { - log:function(){} - }; -} - -var cordova = { - define:define, - require:require, - /** - * Methods to add/remove your own addEventListener hijacking on document + window. - */ - addWindowEventHandler:function(event, opts) { - return (windowEventHandlers[event] = channel.create(event, opts)); - }, - addDocumentEventHandler:function(event, opts) { - return (documentEventHandlers[event] = channel.create(event, opts)); - }, - removeWindowEventHandler:function(event) { - delete windowEventHandlers[event]; - }, - removeDocumentEventHandler:function(event) { - delete documentEventHandlers[event]; - }, - /** - * Retreive original event handlers that were replaced by Cordova - * - * @return object - */ - getOriginalHandlers: function() { - return {'document': {'addEventListener': m_document_addEventListener, 'removeEventListener': m_document_removeEventListener}, - 'window': {'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener}}; - }, - /** - * Method to fire event from native code - */ - fireDocumentEvent: function(type, data) { - var evt = createEvent(type, data); - if (typeof documentEventHandlers[type] != 'undefined') { - documentEventHandlers[type].fire(evt); - } else { - document.dispatchEvent(evt); - } - }, - fireWindowEvent: function(type, data) { - var evt = createEvent(type,data); - if (typeof windowEventHandlers[type] != 'undefined') { - windowEventHandlers[type].fire(evt); - } else { - window.dispatchEvent(evt); - } - }, - // TODO: this is Android only; think about how to do this better - shuttingDown:false, - UsePolling:false, - // END TODO - - // TODO: iOS only - // This queue holds the currently executing command and all pending - // commands executed with cordova.exec(). - commandQueue:[], - // Indicates if we're currently in the middle of flushing the command - // queue on the native side. - commandQueueFlushing:false, - // END TODO - /** - * Plugin callback mechanism. - */ - callbackId: 0, - callbacks: {}, - callbackStatus: { - NO_RESULT: 0, - OK: 1, - CLASS_NOT_FOUND_EXCEPTION: 2, - ILLEGAL_ACCESS_EXCEPTION: 3, - INSTANTIATION_EXCEPTION: 4, - MALFORMED_URL_EXCEPTION: 5, - IO_EXCEPTION: 6, - INVALID_ACTION: 7, - JSON_EXCEPTION: 8, - ERROR: 9 - }, - - /** - * Called by native code when returning successful result from an action. - * - * @param callbackId - * @param args - */ - callbackSuccess: function(callbackId, args) { - if (cordova.callbacks[callbackId]) { - - // If result is to be sent to callback - if (args.status == cordova.callbackStatus.OK) { - try { - if (cordova.callbacks[callbackId].success) { - cordova.callbacks[callbackId].success(args.message); - } - } - catch (e) { - console.log("Error in success callback: "+callbackId+" = "+e); - } - } - - // Clear callback if not expecting any more results - if (!args.keepCallback) { - delete cordova.callbacks[callbackId]; - } - } - }, - - /** - * Called by native code when returning error result from an action. - * - * @param callbackId - * @param args - */ - callbackError: function(callbackId, args) { - if (cordova.callbacks[callbackId]) { - try { - if (cordova.callbacks[callbackId].fail) { - cordova.callbacks[callbackId].fail(args.message); - } - } - catch (e) { - console.log("Error in error callback: "+callbackId+" = "+e); - } - - // Clear callback if not expecting any more results - if (!args.keepCallback) { - delete cordova.callbacks[callbackId]; - } - } - }, - // TODO: remove in 2.0. - addPlugin: function(name, obj) { - console.log("[DEPRECATION NOTICE] window.addPlugin and window.plugins will be removed in version 2.0."); - if (!window.plugins[name]) { - window.plugins[name] = obj; - } - else { - console.log("Error: Plugin "+name+" already exists."); - } - }, - - addConstructor: function(func) { - channel.onCordovaReady.subscribeOnce(function() { - try { - func(); - } catch(e) { - console.log("Failed to run constructor: " + e); - } - }); - } -}; - -/** - * Legacy variable for plugin support - * TODO: remove in 2.0. - */ -if (!window.PhoneGap) { - window.PhoneGap = cordova; -} - -/** - * Plugins object - * TODO: remove in 2.0. - */ -if (!window.plugins) { - window.plugins = {}; -} - -module.exports = cordova; - -}); - -// file: lib/common/builder.js -define("cordova/builder", function(require, exports, module) { -function each(objects, func, context) { - for (var prop in objects) { - if (objects.hasOwnProperty(prop)) { - func.apply(context, [objects[prop], prop]); - } - } -} - -function include(parent, objects, clobber, merge) { - each(objects, function (obj, key) { - try { - var result = obj.path ? require(obj.path) : {}; - - if (clobber) { - // Clobber if it doesn't exist. - if (typeof parent[key] === 'undefined') { - parent[key] = result; - } else if (typeof obj.path !== 'undefined') { - // If merging, merge properties onto parent, otherwise, clobber. - if (merge) { - recursiveMerge(parent[key], result); - } else { - parent[key] = result; - } - } - result = parent[key]; - } else { - // Overwrite if not currently defined. - if (typeof parent[key] == 'undefined') { - parent[key] = result; - } else if (merge && typeof obj.path !== 'undefined') { - // If merging, merge parent onto result - recursiveMerge(result, parent[key]); - parent[key] = result; - } else { - // Set result to what already exists, so we can build children into it if they exist. - result = parent[key]; - } - } - - if (obj.children) { - include(result, obj.children, clobber, merge); - } - } catch(e) { - utils.alert('Exception building cordova JS globals: ' + e + ' for key "' + key + '"'); - } - }); -} - -/** - * Merge properties from one object onto another recursively. Properties from - * the src object will overwrite existing target property. - * - * @param target Object to merge properties into. - * @param src Object to merge properties from. - */ -function recursiveMerge(target, src) { - for (var prop in src) { - if (src.hasOwnProperty(prop)) { - if (typeof target.prototype !== 'undefined' && target.prototype.constructor === target) { - // If the target object is a constructor override off prototype. - target.prototype[prop] = src[prop]; - } else { - target[prop] = typeof src[prop] === 'object' ? recursiveMerge( - target[prop], src[prop]) : src[prop]; - } - } - } - return target; -} - -module.exports = { - build: function (objects) { - return { - intoButDontClobber: function (target) { - include(target, objects, false, false); - }, - intoAndClobber: function(target) { - include(target, objects, true, false); - }, - intoAndMerge: function(target) { - include(target, objects, true, true); - } - }; - } -}; - -}); - -// file: lib/common/channel.js -define("cordova/channel", function(require, exports, module) { -/** - * Custom pub-sub "channel" that can have functions subscribed to it - * This object is used to define and control firing of events for - * cordova initialization. - * - * The order of events during page load and Cordova startup is as follows: - * - * onDOMContentLoaded Internal event that is received when the web page is loaded and parsed. - * onNativeReady Internal event that indicates the Cordova native side is ready. - * onCordovaReady Internal event fired when all Cordova JavaScript objects have been created. - * onCordovaInfoReady Internal event fired when device properties are available. - * onCordovaConnectionReady Internal event fired when the connection property has been set. - * onDeviceReady User event fired to indicate that Cordova is ready - * onResume User event fired to indicate a start/resume lifecycle event - * onPause User event fired to indicate a pause lifecycle event - * onDestroy Internal event fired when app is being destroyed (User should use window.onunload event, not this one). - * - * The only Cordova events that user code should register for are: - * deviceready Cordova native code is initialized and Cordova APIs can be called from JavaScript - * pause App has moved to background - * resume App has returned to foreground - * - * Listeners can be registered as: - * document.addEventListener("deviceready", myDeviceReadyListener, false); - * document.addEventListener("resume", myResumeListener, false); - * document.addEventListener("pause", myPauseListener, false); - * - * The DOM lifecycle events should be used for saving and restoring state - * window.onload - * window.onunload - * - */ - -/** - * Channel - * @constructor - * @param type String the channel name - * @param opts Object options to pass into the channel, currently - * supports: - * onSubscribe: callback that fires when - * something subscribes to the Channel. Sets - * context to the Channel. - * onUnsubscribe: callback that fires when - * something unsubscribes to the Channel. Sets - * context to the Channel. - */ -var Channel = function(type, opts) { - this.type = type; - this.handlers = {}; - this.numHandlers = 0; - this.guid = 0; - this.fired = false; - this.enabled = true; - this.events = { - onSubscribe:null, - onUnsubscribe:null - }; - if (opts) { - if (opts.onSubscribe) this.events.onSubscribe = opts.onSubscribe; - if (opts.onUnsubscribe) this.events.onUnsubscribe = opts.onUnsubscribe; - } - }, - channel = { - /** - * Calls the provided function only after all of the channels specified - * have been fired. - */ - join: function (h, c) { - var i = c.length; - var len = i; - var f = function() { - if (!(--i)) h(); - }; - for (var j=0; j} phoneNumbers array of phone numbers -* @param {Array.} emails array of email addresses -* @param {Array.} addresses array of addresses -* @param {Array.} ims instant messaging user ids -* @param {Array.} organizations -* @param {DOMString} birthday contact's birthday -* @param {DOMString} note user notes about contact -* @param {Array.} photos -* @param {Array.} categories -* @param {Array.} urls contact's web sites -*/ -var Contact = function (id, displayName, name, nickname, phoneNumbers, emails, addresses, - ims, organizations, birthday, note, photos, categories, urls) { - this.id = id || null; - this.rawId = null; - this.displayName = displayName || null; - this.name = name || null; // ContactName - this.nickname = nickname || null; - this.phoneNumbers = phoneNumbers || null; // ContactField[] - this.emails = emails || null; // ContactField[] - this.addresses = addresses || null; // ContactAddress[] - this.ims = ims || null; // ContactField[] - this.organizations = organizations || null; // ContactOrganization[] - this.birthday = birthday || null; - this.note = note || null; - this.photos = photos || null; // ContactField[] - this.categories = categories || null; // ContactField[] - this.urls = urls || null; // ContactField[] -}; - -/** -* Removes contact from device storage. -* @param successCB success callback -* @param errorCB error callback -*/ -Contact.prototype.remove = function(successCB, errorCB) { - var fail = function(code) { - errorCB(new ContactError(code)); - }; - if (this.id === null) { - fail(ContactError.UNKNOWN_ERROR); - } - else { - exec(successCB, fail, "Contacts", "remove", [this.id]); - } -}; - -/** -* Creates a deep copy of this Contact. -* With the contact ID set to null. -* @return copy of this Contact -*/ -Contact.prototype.clone = function() { - var clonedContact = utils.clone(this); - var i; - clonedContact.id = null; - clonedContact.rawId = null; - // Loop through and clear out any id's in phones, emails, etc. - if (clonedContact.phoneNumbers) { - for (i = 0; i < clonedContact.phoneNumbers.length; i++) { - clonedContact.phoneNumbers[i].id = null; - } - } - if (clonedContact.emails) { - for (i = 0; i < clonedContact.emails.length; i++) { - clonedContact.emails[i].id = null; - } - } - if (clonedContact.addresses) { - for (i = 0; i < clonedContact.addresses.length; i++) { - clonedContact.addresses[i].id = null; - } - } - if (clonedContact.ims) { - for (i = 0; i < clonedContact.ims.length; i++) { - clonedContact.ims[i].id = null; - } - } - if (clonedContact.organizations) { - for (i = 0; i < clonedContact.organizations.length; i++) { - clonedContact.organizations[i].id = null; - } - } - if (clonedContact.categories) { - for (i = 0; i < clonedContact.categories.length; i++) { - clonedContact.categories[i].id = null; - } - } - if (clonedContact.photos) { - for (i = 0; i < clonedContact.photos.length; i++) { - clonedContact.photos[i].id = null; - } - } - if (clonedContact.urls) { - for (i = 0; i < clonedContact.urls.length; i++) { - clonedContact.urls[i].id = null; - } - } - return clonedContact; -}; - -/** -* Persists contact to device storage. -* @param successCB success callback -* @param errorCB error callback -*/ -Contact.prototype.save = function(successCB, errorCB) { - var fail = function(code) { - errorCB(new ContactError(code)); - }; - var success = function(result) { - if (result) { - if (typeof successCB === 'function') { - var fullContact = require('cordova/plugin/contacts').create(result); - successCB(convertIn(fullContact)); - } - } - else { - // no Entry object returned - fail(ContactError.UNKNOWN_ERROR); - } - }; - var dupContact = convertOut(utils.clone(this)); - exec(success, fail, "Contacts", "save", [dupContact]); -}; - - -module.exports = Contact; - -}); - -// file: lib/common/plugin/ContactAddress.js -define("cordova/plugin/ContactAddress", function(require, exports, module) { -/** -* Contact address. -* @constructor -* @param {DOMString} id unique identifier, should only be set by native code -* @param formatted // NOTE: not a W3C standard -* @param streetAddress -* @param locality -* @param region -* @param postalCode -* @param country -*/ - -var ContactAddress = function(pref, type, formatted, streetAddress, locality, region, postalCode, country) { - this.id = null; - this.pref = (typeof pref != 'undefined' ? pref : false); - this.type = type || null; - this.formatted = formatted || null; - this.streetAddress = streetAddress || null; - this.locality = locality || null; - this.region = region || null; - this.postalCode = postalCode || null; - this.country = country || null; -}; - -module.exports = ContactAddress; - -}); - -// file: lib/common/plugin/ContactError.js -define("cordova/plugin/ContactError", function(require, exports, module) { -/** - * ContactError. - * An error code assigned by an implementation when an error has occured - * @constructor - */ -var ContactError = function(err) { - this.code = (typeof err != 'undefined' ? err : null); -}; - -/** - * Error codes - */ -ContactError.UNKNOWN_ERROR = 0; -ContactError.INVALID_ARGUMENT_ERROR = 1; -ContactError.TIMEOUT_ERROR = 2; -ContactError.PENDING_OPERATION_ERROR = 3; -ContactError.IO_ERROR = 4; -ContactError.NOT_SUPPORTED_ERROR = 5; -ContactError.PERMISSION_DENIED_ERROR = 20; - -module.exports = ContactError; - -}); - -// file: lib/common/plugin/ContactField.js -define("cordova/plugin/ContactField", function(require, exports, module) { -/** -* Generic contact field. -* @constructor -* @param {DOMString} id unique identifier, should only be set by native code // NOTE: not a W3C standard -* @param type -* @param value -* @param pref -*/ -var ContactField = function(type, value, pref) { - this.id = null; - this.type = type || null; - this.value = value || null; - this.pref = (typeof pref != 'undefined' ? pref : false); -}; - -module.exports = ContactField; - -}); - -// file: lib/common/plugin/ContactFindOptions.js -define("cordova/plugin/ContactFindOptions", function(require, exports, module) { -/** - * ContactFindOptions. - * @constructor - * @param filter used to match contacts against - * @param multiple boolean used to determine if more than one contact should be returned - */ - -var ContactFindOptions = function(filter, multiple) { - this.filter = filter || ''; - this.multiple = (typeof multiple != 'undefined' ? multiple : false); -}; - -module.exports = ContactFindOptions; - -}); - -// file: lib/common/plugin/ContactName.js -define("cordova/plugin/ContactName", function(require, exports, module) { -/** -* Contact name. -* @constructor -* @param formatted // NOTE: not part of W3C standard -* @param familyName -* @param givenName -* @param middle -* @param prefix -* @param suffix -*/ -var ContactName = function(formatted, familyName, givenName, middle, prefix, suffix) { - this.formatted = formatted || null; - this.familyName = familyName || null; - this.givenName = givenName || null; - this.middleName = middle || null; - this.honorificPrefix = prefix || null; - this.honorificSuffix = suffix || null; -}; - -module.exports = ContactName; - -}); - -// file: lib/common/plugin/ContactOrganization.js -define("cordova/plugin/ContactOrganization", function(require, exports, module) { -/** -* Contact organization. -* @constructor -* @param {DOMString} id unique identifier, should only be set by native code // NOTE: not a W3C standard -* @param name -* @param dept -* @param title -* @param startDate -* @param endDate -* @param location -* @param desc -*/ - -var ContactOrganization = function(pref, type, name, dept, title) { - this.id = null; - this.pref = (typeof pref != 'undefined' ? pref : false); - this.type = type || null; - this.name = name || null; - this.department = dept || null; - this.title = title || null; -}; - -module.exports = ContactOrganization; - -}); - -// file: lib/common/plugin/Coordinates.js -define("cordova/plugin/Coordinates", function(require, exports, module) { -/** - * This class contains position information. - * @param {Object} lat - * @param {Object} lng - * @param {Object} alt - * @param {Object} acc - * @param {Object} head - * @param {Object} vel - * @param {Object} altacc - * @constructor - */ -var Coordinates = function(lat, lng, alt, acc, head, vel, altacc) { - /** - * The latitude of the position. - */ - this.latitude = lat; - /** - * The longitude of the position, - */ - this.longitude = lng; - /** - * The accuracy of the position. - */ - this.accuracy = acc; - /** - * The altitude of the position. - */ - this.altitude = alt; - /** - * The direction the device is moving at the position. - */ - this.heading = head; - /** - * The velocity with which the device is moving at the position. - */ - this.speed = vel; - /** - * The altitude accuracy of the position. - */ - this.altitudeAccuracy = (altacc !== undefined) ? altacc : null; -}; - -module.exports = Coordinates; - -}); - -// file: lib/common/plugin/DirectoryEntry.js -define("cordova/plugin/DirectoryEntry", function(require, exports, module) { -var utils = require('cordova/utils'), - exec = require('cordova/exec'), - Entry = require('cordova/plugin/Entry'), - DirectoryReader = require('cordova/plugin/DirectoryReader'); - -/** - * An interface representing a directory on the file system. - * - * {boolean} isFile always false (readonly) - * {boolean} isDirectory always true (readonly) - * {DOMString} name of the directory, excluding the path leading to it (readonly) - * {DOMString} fullPath the absolute full path to the directory (readonly) - * {FileSystem} filesystem on which the directory resides (readonly) - */ -var DirectoryEntry = function(name, fullPath) { - DirectoryEntry.__super__.constructor.apply(this, [false, true, name, fullPath]); -}; - -utils.extend(DirectoryEntry, Entry); - -/** - * Creates a new DirectoryReader to read entries from this directory - */ -DirectoryEntry.prototype.createReader = function() { - return new DirectoryReader(this.fullPath); -}; - -/** - * Creates or looks up a directory - * - * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a directory - * @param {Flags} options to create or excluively create the directory - * @param {Function} successCallback is called with the new entry - * @param {Function} errorCallback is called with a FileError - */ -DirectoryEntry.prototype.getDirectory = function(path, options, successCallback, errorCallback) { - var win = typeof successCallback !== 'function' ? null : function(result) { - var entry = new DirectoryEntry(result.name, result.fullPath); - successCallback(entry); - }; - var fail = typeof errorCallback !== 'function' ? null : function(code) { - errorCallback(new FileError(code)); - }; - exec(win, fail, "File", "getDirectory", [this.fullPath, path, options]); -}; - -/** - * Deletes a directory and all of it's contents - * - * @param {Function} successCallback is called with no parameters - * @param {Function} errorCallback is called with a FileError - */ -DirectoryEntry.prototype.removeRecursively = function(successCallback, errorCallback) { - var fail = typeof errorCallback !== 'function' ? null : function(code) { - errorCallback(new FileError(code)); - }; - exec(successCallback, fail, "File", "removeRecursively", [this.fullPath]); -}; - -/** - * Creates or looks up a file - * - * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a file - * @param {Flags} options to create or excluively create the file - * @param {Function} successCallback is called with the new entry - * @param {Function} errorCallback is called with a FileError - */ -DirectoryEntry.prototype.getFile = function(path, options, successCallback, errorCallback) { - var win = typeof successCallback !== 'function' ? null : function(result) { - var FileEntry = require('cordova/plugin/FileEntry'); - var entry = new FileEntry(result.name, result.fullPath); - successCallback(entry); - }; - var fail = typeof errorCallback !== 'function' ? null : function(code) { - errorCallback(new FileError(code)); - }; - exec(win, fail, "File", "getFile", [this.fullPath, path, options]); -}; - -module.exports = DirectoryEntry; - -}); - -// file: lib/common/plugin/DirectoryReader.js -define("cordova/plugin/DirectoryReader", function(require, exports, module) { -var exec = require('cordova/exec'); - -/** - * An interface that lists the files and directories in a directory. - */ -function DirectoryReader(path) { - this.path = path || null; -} - -/** - * Returns a list of entries from a directory. - * - * @param {Function} successCallback is called with a list of entries - * @param {Function} errorCallback is called with a FileError - */ -DirectoryReader.prototype.readEntries = function(successCallback, errorCallback) { - var win = typeof successCallback !== 'function' ? null : function(result) { - var retVal = []; - for (var i=0; i][;base64], - * - * @param file {File} File object containing file properties - */ -FileReader.prototype.readAsDataURL = function(file) { - this.fileName = ""; - if (typeof file.fullPath === "undefined") { - this.fileName = file; - } else { - this.fileName = file.fullPath; - } - - // Already loading something - if (this.readyState == FileReader.LOADING) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - // LOADING state - this.readyState = FileReader.LOADING; - - // If loadstart callback - if (typeof this.onloadstart === "function") { - this.onloadstart(new ProgressEvent("loadstart", {target:this})); - } - - var me = this; - - // Read file - exec( - // Success callback - function(r) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileReader.DONE) { - return; - } - - // DONE state - me.readyState = FileReader.DONE; - - // Save result - me.result = r; - - // If onload callback - if (typeof me.onload === "function") { - me.onload(new ProgressEvent("load", {target:me})); - } - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, - // Error callback - function(e) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileReader.DONE) { - return; - } - - // DONE state - me.readyState = FileReader.DONE; - - me.result = null; - - // Save error - me.error = new FileError(e); - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror(new ProgressEvent("error", {target:me})); - } - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, "File", "readAsDataURL", [this.fileName]); -}; - -/** - * Read file and return data as a binary data. - * - * @param file {File} File object containing file properties - */ -FileReader.prototype.readAsBinaryString = function(file) { - // TODO - Can't return binary data to browser. - console.log('method "readAsBinaryString" is not supported at this time.'); -}; - -/** - * Read file and return data as a binary data. - * - * @param file {File} File object containing file properties - */ -FileReader.prototype.readAsArrayBuffer = function(file) { - // TODO - Can't return binary data to browser. - console.log('This method is not supported at this time.'); -}; - -module.exports = FileReader; - -}); - -// file: lib/common/plugin/FileSystem.js -define("cordova/plugin/FileSystem", function(require, exports, module) { -var DirectoryEntry = require('cordova/plugin/DirectoryEntry'); - -/** - * An interface representing a file system - * - * @constructor - * {DOMString} name the unique name of the file system (readonly) - * {DirectoryEntry} root directory of the file system (readonly) - */ -var FileSystem = function(name, root) { - this.name = name || null; - if (root) { - this.root = new DirectoryEntry(root.name, root.fullPath); - } -}; - -module.exports = FileSystem; - -}); - -// file: lib/common/plugin/FileTransfer.js -define("cordova/plugin/FileTransfer", function(require, exports, module) { -var exec = require('cordova/exec'); - -/** - * FileTransfer uploads a file to a remote server. - * @constructor - */ -var FileTransfer = function() {}; - -/** -* Given an absolute file path, uploads a file on the device to a remote server -* using a multipart HTTP request. -* @param filePath {String} Full path of the file on the device -* @param server {String} URL of the server to receive the file -* @param successCallback (Function} Callback to be invoked when upload has completed -* @param errorCallback {Function} Callback to be invoked upon error -* @param options {FileUploadOptions} Optional parameters such as file name and mimetype -* @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false -*/ -FileTransfer.prototype.upload = function(filePath, server, successCallback, errorCallback, options, trustAllHosts) { - // check for options - var fileKey = null; - var fileName = null; - var mimeType = null; - var params = null; - var chunkedMode = true; - if (options) { - fileKey = options.fileKey; - fileName = options.fileName; - mimeType = options.mimeType; - if (options.chunkedMode !== null || typeof options.chunkedMode !== "undefined") { - chunkedMode = options.chunkedMode; - } - if (options.params) { - params = options.params; - } - else { - params = {}; - } - } - - exec(successCallback, errorCallback, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode]); -}; - -/** - * Downloads a file form a given URL and saves it to the specified directory. - * @param source {String} URL of the server to receive the file - * @param target {String} Full path of the file on the device - * @param successCallback (Function} Callback to be invoked when upload has completed - * @param errorCallback {Function} Callback to be invoked upon error - */ -FileTransfer.prototype.download = function(source, target, successCallback, errorCallback) { - var win = function(result) { - var entry = null; - if (result.isDirectory) { - entry = new DirectoryEntry(); - } - else if (result.isFile) { - entry = new FileEntry(); - } - entry.isDirectory = result.isDirectory; - entry.isFile = result.isFile; - entry.name = result.name; - entry.fullPath = result.fullPath; - successCallback(entry); - }; - exec(win, errorCallback, 'FileTransfer', 'download', [source, target]); -}; - -module.exports = FileTransfer; - -}); - -// file: lib/common/plugin/FileTransferError.js -define("cordova/plugin/FileTransferError", function(require, exports, module) { -/** - * FileTransferError - * @constructor - */ -var FileTransferError = function(code) { - this.code = code || null; -}; - -FileTransferError.FILE_NOT_FOUND_ERR = 1; -FileTransferError.INVALID_URL_ERR = 2; -FileTransferError.CONNECTION_ERR = 3; - -module.exports = FileTransferError; - -}); - -// file: lib/common/plugin/FileUploadOptions.js -define("cordova/plugin/FileUploadOptions", function(require, exports, module) { -/** - * Options to customize the HTTP request used to upload files. - * @constructor - * @param fileKey {String} Name of file request parameter. - * @param fileName {String} Filename to be used by the server. Defaults to image.jpg. - * @param mimeType {String} Mimetype of the uploaded file. Defaults to image/jpeg. - * @param params {Object} Object with key: value params to send to the server. - */ -var FileUploadOptions = function(fileKey, fileName, mimeType, params) { - this.fileKey = fileKey || null; - this.fileName = fileName || null; - this.mimeType = mimeType || null; - this.params = params || null; -}; - -module.exports = FileUploadOptions; - -}); - -// file: lib/common/plugin/FileUploadResult.js -define("cordova/plugin/FileUploadResult", function(require, exports, module) { -/** - * FileUploadResult - * @constructor - */ -var FileUploadResult = function() { - this.bytesSent = 0; - this.responseCode = null; - this.response = null; -}; - -module.exports = FileUploadResult; - -}); - -// file: lib/common/plugin/FileWriter.js -define("cordova/plugin/FileWriter", function(require, exports, module) { -var exec = require('cordova/exec'), - FileError = require('cordova/plugin/FileError'); - ProgressEvent = require('cordova/plugin/ProgressEvent'); - -/** - * This class writes to the mobile device file system. - * - * For Android: - * The root directory is the root of the file system. - * To write to the SD card, the file name is "sdcard/my_file.txt" - * - * @constructor - * @param file {File} File object containing file properties - * @param append if true write to the end of the file, otherwise overwrite the file - */ -var FileWriter = function(file) { - this.fileName = ""; - this.length = 0; - if (file) { - this.fileName = file.fullPath || file; - this.length = file.size || 0; - } - // default is to write at the beginning of the file - this.position = 0; - - this.readyState = 0; // EMPTY - - this.result = null; - - // Error - this.error = null; - - // Event handlers - this.onwritestart = null; // When writing starts - this.onprogress = null; // While writing the file, and reporting partial file data - this.onwrite = null; // When the write has successfully completed. - this.onwriteend = null; // When the request has completed (either in success or failure). - this.onabort = null; // When the write has been aborted. For instance, by invoking the abort() method. - this.onerror = null; // When the write has failed (see errors). -}; - -// States -FileWriter.INIT = 0; -FileWriter.WRITING = 1; -FileWriter.DONE = 2; - -/** - * Abort writing file. - */ -FileWriter.prototype.abort = function() { - // check for invalid state - if (this.readyState === FileWriter.DONE || this.readyState === FileWriter.INIT) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - // set error - this.error = new FileError(FileError.ABORT_ERR); - - this.readyState = FileWriter.DONE; - - // If abort callback - if (typeof this.onabort === "function") { - this.onabort(new ProgressEvent("abort", {"target":this})); - } - - // If write end callback - if (typeof this.onwriteend === "function") { - this.onwriteend(new ProgressEvent("writeend", {"target":this})); - } -}; - -/** - * Writes data to the file - * - * @param text to be written - */ -FileWriter.prototype.write = function(text) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - // WRITING state - this.readyState = FileWriter.WRITING; - - var me = this; - - // If onwritestart callback - if (typeof me.onwritestart === "function") { - me.onwritestart(new ProgressEvent("writestart", {"target":me})); - } - - // Write file - exec( - // Success callback - function(r) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // position always increases by bytes written because file would be extended - me.position += r; - // The length of the file is now where we are done writing. - - me.length = me.position; - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwrite callback - if (typeof me.onwrite === "function") { - me.onwrite(new ProgressEvent("write", {"target":me})); - } - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - me.onwriteend(new ProgressEvent("writeend", {"target":me})); - } - }, - // Error callback - function(e) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // DONE state - me.readyState = FileWriter.DONE; - - // Save error - me.error = new FileError(e); - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror(new ProgressEvent("error", {"target":me})); - } - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - me.onwriteend(new ProgressEvent("writeend", {"target":me})); - } - }, "File", "write", [this.fileName, text, this.position]); -}; - -/** - * Moves the file pointer to the location specified. - * - * If the offset is a negative number the position of the file - * pointer is rewound. If the offset is greater than the file - * size the position is set to the end of the file. - * - * @param offset is the location to move the file pointer to. - */ -FileWriter.prototype.seek = function(offset) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - if (!offset && offset != 0) { - return; - } - - // See back from end of file. - if (offset < 0) { - this.position = Math.max(offset + this.length, 0); - } - // Offset is bigger then file size so set position - // to the end of the file. - else if (offset > this.length) { - this.position = this.length; - } - // Offset is between 0 and file size so set the position - // to start writing. - else { - this.position = offset; - } -}; - -/** - * Truncates the file to the size specified. - * - * @param size to chop the file at. - */ -FileWriter.prototype.truncate = function(size) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - // WRITING state - this.readyState = FileWriter.WRITING; - - var me = this; - - // If onwritestart callback - if (typeof me.onwritestart === "function") { - me.onwritestart(new ProgressEvent("writestart", {"target":this})); - } - - // Write file - exec( - // Success callback - function(r) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // DONE state - me.readyState = FileWriter.DONE; - - // Update the length of the file - me.length = r; - me.position = Math.min(me.position, r); - - // If onwrite callback - if (typeof me.onwrite === "function") { - me.onwrite(new ProgressEvent("write", {"target":me})); - } - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - me.onwriteend(new ProgressEvent("writeend", {"target":me})); - } - }, - // Error callback - function(e) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // DONE state - me.readyState = FileWriter.DONE; - - // Save error - me.error = new FileError(e); - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror(new ProgressEvent("error", {"target":me})); - } - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - me.onwriteend(new ProgressEvent("writeend", {"target":me})); - } - }, "File", "truncate", [this.fileName, size]); -}; - -module.exports = FileWriter; - -}); - -// file: lib/common/plugin/Flags.js -define("cordova/plugin/Flags", function(require, exports, module) { -/** - * Supplies arguments to methods that lookup or create files and directories. - * - * @param create - * {boolean} file or directory if it doesn't exist - * @param exclusive - * {boolean} used with create; if true the command will fail if - * target path exists - */ -function Flags(create, exclusive) { - this.create = create || false; - this.exclusive = exclusive || false; -} - -module.exports = Flags; - -}); - -// file: lib/common/plugin/LocalFileSystem.js -define("cordova/plugin/LocalFileSystem", function(require, exports, module) { -var exec = require('cordova/exec'); - -/** - * Represents a local file system. - */ -var LocalFileSystem = function() { - -}; - -LocalFileSystem.TEMPORARY = 0; //temporary, with no guarantee of persistence -LocalFileSystem.PERSISTENT = 1; //persistent - -module.exports = LocalFileSystem; - -}); - -// file: lib/common/plugin/Media.js -define("cordova/plugin/Media", function(require, exports, module) { -var utils = require('cordova/utils'), - exec = require('cordova/exec'); - -var mediaObjects = {}; - -/** - * This class provides access to the device media, interfaces to both sound and video - * - * @constructor - * @param src The file name or url to play - * @param successCallback The callback to be called when the file is done playing or recording. - * successCallback() - * @param errorCallback The callback to be called if there is an error. - * errorCallback(int errorCode) - OPTIONAL - * @param statusCallback The callback to be called when media status has changed. - * statusCallback(int statusCode) - OPTIONAL - */ -var Media = function(src, successCallback, errorCallback, statusCallback) { - - // successCallback optional - if (successCallback && (typeof successCallback !== "function")) { - console.log("Media Error: successCallback is not a function"); - return; - } - - // errorCallback optional - if (errorCallback && (typeof errorCallback !== "function")) { - console.log("Media Error: errorCallback is not a function"); - return; - } - - // statusCallback optional - if (statusCallback && (typeof statusCallback !== "function")) { - console.log("Media Error: statusCallback is not a function"); - return; - } - - this.id = utils.createUUID(); - mediaObjects[this.id] = this; - this.src = src; - this.successCallback = successCallback; - this.errorCallback = errorCallback; - this.statusCallback = statusCallback; - this._duration = -1; - this._position = -1; - exec(null, this.errorCallback, "Media", "create", [this.id, this.src]); -}; - -// Media messages -Media.MEDIA_STATE = 1; -Media.MEDIA_DURATION = 2; -Media.MEDIA_POSITION = 3; -Media.MEDIA_ERROR = 9; - -// Media states -Media.MEDIA_NONE = 0; -Media.MEDIA_STARTING = 1; -Media.MEDIA_RUNNING = 2; -Media.MEDIA_PAUSED = 3; -Media.MEDIA_STOPPED = 4; -Media.MEDIA_MSG = ["None", "Starting", "Running", "Paused", "Stopped"]; - -// "static" function to return existing objs. -Media.get = function(id) { - return mediaObjects[id]; -}; - -/** - * Start or resume playing audio file. - */ -Media.prototype.play = function(options) { - exec(null, null, "Media", "startPlayingAudio", [this.id, this.src, options]); -}; - -/** - * Stop playing audio file. - */ -Media.prototype.stop = function() { - var me = this; - exec(function() { - me._position = 0; - me.successCallback(); - }, this.errorCallback, "Media", "stopPlayingAudio", [this.id]); -}; - -/** - * Seek or jump to a new time in the track.. - */ -Media.prototype.seekTo = function(milliseconds) { - var me = this; - exec(function(p) { - me._position = p; - }, this.errorCallback, "Media", "seekToAudio", [this.id, milliseconds]); -}; - -/** - * Pause playing audio file. - */ -Media.prototype.pause = function() { - exec(null, this.errorCallback, "Media", "pausePlayingAudio", [this.id]); -}; - -/** - * Get duration of an audio file. - * The duration is only set for audio that is playing, paused or stopped. - * - * @return duration or -1 if not known. - */ -Media.prototype.getDuration = function() { - return this._duration; -}; - -/** - * Get position of audio. - */ -Media.prototype.getCurrentPosition = function(success, fail) { - var me = this; - exec(function(p) { - me._position = p; - success(p); - }, fail, "Media", "getCurrentPositionAudio", [this.id]); -}; - -/** - * Start recording audio file. - */ -Media.prototype.startRecord = function() { - exec(this.successCallback, this.errorCallback, "Media", "startRecordingAudio", [this.id, this.src]); -}; - -/** - * Stop recording audio file. - */ -Media.prototype.stopRecord = function() { - exec(this.successCallback, this.errorCallback, "Media", "stopRecordingAudio", [this.id]); -}; - -/** - * Release the resources. - */ -Media.prototype.release = function() { - exec(null, this.errorCallback, "Media", "release", [this.id]); -}; - -/** - * Adjust the volume. - */ -Media.prototype.setVolume = function(volume) { - exec(null, null, "Media", "setVolume", [this.id, volume]); -}; - -/** - * Audio has status update. - * PRIVATE - * - * @param id The media object id (string) - * @param status The status code (int) - * @param msg The status message (string) - */ -Media.onStatus = function(id, msg, value) { - var media = mediaObjects[id]; - // If state update - if (msg === Media.MEDIA_STATE) { - if (value === Media.MEDIA_STOPPED) { - if (media.successCallback) { - media.successCallback(); - } - } - if (media.statusCallback) { - media.statusCallback(value); - } - } - else if (msg === Media.MEDIA_DURATION) { - media._duration = value; - } - else if (msg === Media.MEDIA_ERROR) { - if (media.errorCallback) { - // value should be a MediaError object when msg == MEDIA_ERROR - media.errorCallback(value); - } - } - else if (msg === Media.MEDIA_POSITION) { - media._position = value; - } -}; - -module.exports = Media; - -}); - -// file: lib/common/plugin/MediaError.js -define("cordova/plugin/MediaError", function(require, exports, module) { -/** - * This class contains information about any Media errors. - * @constructor - */ -var MediaError = function(code, msg) { - this.code = (code !== undefined ? code : null); - this.message = msg || ""; -}; - -MediaError.MEDIA_ERR_NONE_ACTIVE = 0; -MediaError.MEDIA_ERR_ABORTED = 1; -MediaError.MEDIA_ERR_NETWORK = 2; -MediaError.MEDIA_ERR_DECODE = 3; -MediaError.MEDIA_ERR_NONE_SUPPORTED = 4; - -module.exports = MediaError; - -}); - -// file: lib/common/plugin/MediaFile.js -define("cordova/plugin/MediaFile", function(require, exports, module) { -var utils = require('cordova/utils'), - exec = require('cordova/exec'), - File = require('cordova/plugin/File'), - CaptureError = require('cordova/plugin/CaptureError'); -/** - * Represents a single file. - * - * name {DOMString} name of the file, without path information - * fullPath {DOMString} the full path of the file, including the name - * type {DOMString} mime type - * lastModifiedDate {Date} last modified date - * size {Number} size of the file in bytes - */ -var MediaFile = function(name, fullPath, type, lastModifiedDate, size){ - MediaFile.__super__.constructor.apply(this, arguments); -}; - -utils.extend(MediaFile, File); - -/** - * Request capture format data for a specific file and type - * - * @param {Function} successCB - * @param {Function} errorCB - */ -MediaFile.prototype.getFormatData = function(successCallback, errorCallback) { - if (typeof this.fullPath === "undefined" || this.fullPath === null) { - errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT)); - } else { - exec(successCallback, errorCallback, "Capture", "getFormatData", [this.fullPath, this.type]); - } -}; - -/** - * Casts a PluginResult message property (array of objects) to an array of MediaFile objects - * (used in Objective-C and Android) - * - * @param {PluginResult} pluginResult - */ -MediaFile.cast = function(pluginResult) { - var mediaFiles = []; - var i; - for (i=0; i.dispatchEvent - // need to first figure out how to implement EventTarget - } - } - return event; - }; - try { - var ev = createEvent({type:"abort",target:document}); - return function ProgressEvent(type, data) { - data.type = type; - return createEvent(data); - }; - } catch(e){ - */ - return function ProgressEvent(type, dict) { - this.type = type; - this.bubbles = false; - this.cancelBubble = false; - this.cancelable = false; - this.lengthComputable = false; - this.loaded = dict && dict.loaded ? dict.loaded : 0; - this.total = dict && dict.total ? dict.total : 0; - this.target = dict && dict.target ? dict.target : null; - }; - //} -})(); - -module.exports = ProgressEvent; - -}); - -// file: lib/common/plugin/accelerometer.js -define("cordova/plugin/accelerometer", function(require, exports, module) { -/** - * This class provides access to device accelerometer data. - * @constructor - */ -var utils = require("cordova/utils"), - exec = require("cordova/exec"); - -// Local singleton variables. -var timers = {}; - -var accelerometer = { - /** - * Asynchronously aquires the current acceleration. - * - * @param {Function} successCallback The function to call when the acceleration data is available - * @param {Function} errorCallback The function to call when there is an error getting the acceleration data. (OPTIONAL) - * @param {AccelerationOptions} options The options for getting the accelerometer data such as timeout. (OPTIONAL) - */ - getCurrentAcceleration: function(successCallback, errorCallback, options) { - - // successCallback required - if (typeof successCallback !== "function") { - console.log("Accelerometer Error: successCallback is not a function"); - return; - } - - // errorCallback optional - if (errorCallback && (typeof errorCallback !== "function")) { - console.log("Accelerometer Error: errorCallback is not a function"); - return; - } - - // Get acceleration - exec(successCallback, errorCallback, "Accelerometer", "getAcceleration", []); - }, - - /** - * Asynchronously aquires the acceleration repeatedly at a given interval. - * - * @param {Function} successCallback The function to call each time the acceleration data is available - * @param {Function} errorCallback The function to call when there is an error getting the acceleration data. (OPTIONAL) - * @param {AccelerationOptions} options The options for getting the accelerometer data such as timeout. (OPTIONAL) - * @return String The watch id that must be passed to #clearWatch to stop watching. - */ - watchAcceleration: function(successCallback, errorCallback, options) { - - // Default interval (10 sec) - var frequency = (options !== undefined && options.frequency !== undefined)? options.frequency : 10000; - - // successCallback required - if (typeof successCallback !== "function") { - console.log("Accelerometer Error: successCallback is not a function"); - return; - } - - // errorCallback optional - if (errorCallback && (typeof errorCallback !== "function")) { - console.log("Accelerometer Error: errorCallback is not a function"); - return; - } - - // Make sure accelerometer timeout > frequency + 10 sec - exec( - function(timeout) { - if (timeout < (frequency + 10000)) { - exec(null, null, "Accelerometer", "setTimeout", [frequency + 10000]); - } - }, - function(e) { }, "Accelerometer", "getTimeout", []); - - // Start watch timer - var id = utils.createUUID(); - timers[id] = window.setInterval(function() { - exec(successCallback, errorCallback, "Accelerometer", "getAcceleration", []); - }, (frequency ? frequency : 1)); - - return id; - }, - - /** - * Clears the specified accelerometer watch. - * - * @param {String} id The id of the watch returned from #watchAcceleration. - */ - clearWatch: function(id) { - - // Stop javascript timer & remove from timer list - if (id && timers[id] !== undefined) { - window.clearInterval(timers[id]); - delete timers[id]; - } - } -}; - -module.exports = accelerometer; - -}); - -// file: lib/common/plugin/battery.js -define("cordova/plugin/battery", function(require, exports, module) { -/** - * This class contains information about the current battery status. - * @constructor - */ -var cordova = require('cordova'), - exec = require('cordova/exec'); - -function handlers() { - return battery.channels.batterystatus.numHandlers + - battery.channels.batterylow.numHandlers + - battery.channels.batterycritical.numHandlers; -} - -var Battery = function() { - this._level = null; - this._isPlugged = null; - // Create new event handlers on the window (returns a channel instance) - var subscriptionEvents = { - onSubscribe:this.onSubscribe, - onUnsubscribe:this.onUnsubscribe - }; - this.channels = { - batterystatus:cordova.addWindowEventHandler("batterystatus", subscriptionEvents), - batterylow:cordova.addWindowEventHandler("batterylow", subscriptionEvents), - batterycritical:cordova.addWindowEventHandler("batterycritical", subscriptionEvents) - }; -}; -/** - * Event handlers for when callbacks get registered for the battery. - * Keep track of how many handlers we have so we can start and stop the native battery listener - * appropriately (and hopefully save on battery life!). - */ -Battery.prototype.onSubscribe = function() { - var me = battery; - // If we just registered the first handler, make sure native listener is started. - if (handlers() === 1) { - exec(me._status, me._error, "Battery", "start", []); - } -}; - -Battery.prototype.onUnsubscribe = function() { - var me = battery; - - // If we just unregistered the last handler, make sure native listener is stopped. - if (handlers() === 0) { - exec(null, null, "Battery", "stop", []); - } -}; - -/** - * Callback for battery status - * - * @param {Object} info keys: level, isPlugged - */ -Battery.prototype._status = function(info) { - if (info) { - var me = battery; - var level = info.level; - if (me._level !== level || me._isPlugged !== info.isPlugged) { - // Fire batterystatus event - cordova.fireWindowEvent("batterystatus", info); - - // Fire low battery event - if (level === 20 || level === 5) { - if (level === 20) { - cordova.fireWindowEvent("batterylow", info); - } - else { - cordova.fireWindowEvent("batterycritical", info); - } - } - } - me._level = level; - me._isPlugged = info.isPlugged; - } -}; - -/** - * Error callback for battery start - */ -Battery.prototype._error = function(e) { - console.log("Error initializing Battery: " + e); -}; - -var battery = new Battery(); - -module.exports = battery; - -}); - -// file: lib/common/plugin/capture.js -define("cordova/plugin/capture", function(require, exports, module) { -var exec = require('cordova/exec'), - MediaFile = require('cordova/plugin/MediaFile'); - -/** - * Launches a capture of different types. - * - * @param (DOMString} type - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureVideoOptions} options - */ -function _capture(type, successCallback, errorCallback, options) { - var win = function(pluginResult) { - var mediaFiles = []; - var i; - for (i = 0; i < pluginResult.length; i++) { - var mediaFile = new MediaFile(); - mediaFile.name = pluginResult[i].name; - mediaFile.fullPath = pluginResult[i].fullPath; - mediaFile.type = pluginResult[i].type; - mediaFile.lastModifiedDate = pluginResult[i].lastModifiedDate; - mediaFile.size = pluginResult[i].size; - mediaFiles.push(mediaFile); - } - successCallback(mediaFiles); - }; - exec(win, errorCallback, "Capture", type, [options]); -} -/** - * The Capture interface exposes an interface to the camera and microphone of the hosting device. - */ -function Capture() { - this.supportedAudioModes = []; - this.supportedImageModes = []; - this.supportedVideoModes = []; -} - -/** - * Launch audio recorder application for recording audio clip(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureAudioOptions} options - */ -Capture.prototype.captureAudio = function(successCallback, errorCallback, options){ - _capture("captureAudio", successCallback, errorCallback, options); -}; - -/** - * Launch camera application for taking image(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureImageOptions} options - */ -Capture.prototype.captureImage = function(successCallback, errorCallback, options){ - _capture("captureImage", successCallback, errorCallback, options); -}; - -/** - * Launch device camera application for recording video(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureVideoOptions} options - */ -Capture.prototype.captureVideo = function(successCallback, errorCallback, options){ - _capture("captureVideo", successCallback, errorCallback, options); -}; - - -module.exports = new Capture(); - -}); - -// file: lib/common/plugin/compass.js -define("cordova/plugin/compass", function(require, exports, module) { -var exec = require('cordova/exec'), - utils = require('cordova/utils'), - CompassHeading = require('cordova/plugin/CompassHeading'), - CompassError = require('cordova/plugin/CompassError'), - timers = {}, - compass = { - /** - * Asynchronously acquires the current heading. - * @param {Function} successCallback The function to call when the heading - * data is available - * @param {Function} errorCallback The function to call when there is an error - * getting the heading data. - * @param {CompassOptions} options The options for getting the heading data (not used). - */ - getCurrentHeading:function(successCallback, errorCallback, options) { - // successCallback required - if (typeof successCallback !== "function") { - console.log("Compass Error: successCallback is not a function"); - return; - } - - // errorCallback optional - if (errorCallback && (typeof errorCallback !== "function")) { - console.log("Compass Error: errorCallback is not a function"); - return; - } - - var win = function(result) { - var ch = new CompassHeading(result.magneticHeading, result.trueHeading, result.headingAccuracy, result.timestamp); - successCallback(ch); - }; - var fail = function(code) { - var ce = new CompassError(code); - errorCallback(ce); - } - - // Get heading - exec(win, fail, "Compass", "getHeading", [options]); - }, - - /** - * Asynchronously acquires the heading repeatedly at a given interval. - * @param {Function} successCallback The function to call each time the heading - * data is available - * @param {Function} errorCallback The function to call when there is an error - * getting the heading data. - * @param {HeadingOptions} options The options for getting the heading data - * such as timeout and the frequency of the watch. For iOS, filter parameter - * specifies to watch via a distance filter rather than time. - */ - watchHeading:function(successCallback, errorCallback, options) { - // Default interval (100 msec) - var frequency = (options !== undefined && options.frequency !== undefined) ? options.frequency : 100; - var filter = (options !== undefined && options.filter !== undefined) ? options.filter : 0; - - // successCallback required - if (typeof successCallback !== "function") { - console.log("Compass Error: successCallback is not a function"); - return; - } - - // errorCallback optional - if (errorCallback && (typeof errorCallback !== "function")) { - console.log("Compass Error: errorCallback is not a function"); - return; - } - - var id = utils.createUUID(); - if (filter > 0) { - // is an iOS request for watch by filter, no timer needed - timers[id] = "iOS"; - compass.getCurrentHeading(successCallback, errorCallback, options); - } else { - // Start watch timer to get headings - timers[id] = window.setInterval(function() { - compass.getCurrentHeading(successCallback, errorCallback); - }, frequency); - } - - return id; - }, - - /** - * Clears the specified heading watch. - * @param {String} watchId The ID of the watch returned from #watchHeading. - */ - clearWatch:function(id) { - // Stop javascript timer & remove from timer list - if (id && timers[id]) { - if (timers[id] != "iOS") { - clearInterval(timers[id]); - } else { - // is iOS watch by filter so call into device to stop - exec(null, null, "Compass", "stopHeading", []); - } - delete timers[id]; - } - } - }; - -module.exports = compass; - -}); - -// file: lib/common/plugin/contacts.js -define("cordova/plugin/contacts", function(require, exports, module) { -var exec = require('cordova/exec'), - ContactError = require('cordova/plugin/ContactError'), - Contact = require('cordova/plugin/Contact'); - -/** -* Represents a group of Contacts. -* @constructor -*/ -var contacts = { - /** - * Returns an array of Contacts matching the search criteria. - * @param fields that should be searched - * @param successCB success callback - * @param errorCB error callback - * @param {ContactFindOptions} options that can be applied to contact searching - * @return array of Contacts matching search criteria - */ - find:function(fields, successCB, errorCB, options) { - if (!successCB) { - throw new TypeError("You must specify a success callback for the find command."); - } - if (!fields || (fields instanceof Array && fields.length === 0)) { - if (typeof errorCB === "function") { - errorCB(new ContactError(ContactError.INVALID_ARGUMENT_ERROR)); - } - } else { - var win = function(result) { - var cs = []; - for (var i = 0, l = result.length; i < l; i++) { - cs.push(contacts.create(result[i])); - } - successCB(cs); - }; - exec(win, errorCB, "Contacts", "search", [fields, options]); - } - }, - - /** - * This function creates a new contact, but it does not persist the contact - * to device storage. To persist the contact to device storage, invoke - * contact.save(). - * @param properties an object who's properties will be examined to create a new Contact - * @returns new Contact object - */ - create:function(properties) { - var i; - var contact = new Contact(); - for (i in properties) { - if (typeof contact[i] !== 'undefined' && properties.hasOwnProperty(i)) { - contact[i] = properties[i]; - } - } - return contact; - } -}; - -module.exports = contacts; - -}); - -// file: lib/common/plugin/geolocation.js -define("cordova/plugin/geolocation", function(require, exports, module) { -var utils = require('cordova/utils'), - exec = require('cordova/exec'), - PositionError = require('cordova/plugin/PositionError'), - Position = require('cordova/plugin/Position'); - -var timers = {}; // list of timers in use - -// Returns default params, overrides if provided with values -function parseParameters(options) { - var opt = { - maximumAge: 10000, - enableHighAccuracy: false, - timeout: 10000 - }; - - if (options) { - if (options.maximumAge !== undefined) { - opt.maximumAge = options.maximumAge; - } - if (options.enableHighAccuracy !== undefined) { - opt.enableHighAccuracy = options.enableHighAccuracy; - } - if (options.timeout !== undefined) { - opt.timeout = options.timeout; - } - } - - return opt; -} - -var geolocation = { - /** - * Asynchronously aquires the current position. - * - * @param {Function} successCallback The function to call when the position data is available - * @param {Function} errorCallback The function to call when there is an error getting the heading position. (OPTIONAL) - * @param {PositionOptions} options The options for getting the position data. (OPTIONAL) - */ - getCurrentPosition:function(successCallback, errorCallback, options) { - options = parseParameters(options); - - var win = function(p) { - successCallback(new Position( - { - latitude:p.latitude, - longitude:p.longitude, - altitude:p.altitude, - accuracy:p.accuracy, - heading:p.heading, - velocity:p.velocity, - altitudeAccuracy:p.altitudeAccuracy - }, - p.timestamp || new Date() - )); - }; - var fail = function(e) { - errorCallback(new PositionError(e.code, e.message)); - }; - - exec(win, fail, "Geolocation", "getLocation", [options.enableHighAccuracy, options.timeout, options.maximumAge]); - }, - /** - * Asynchronously watches the geolocation for changes to geolocation. When a change occurs, - * the successCallback is called with the new location. - * - * @param {Function} successCallback The function to call each time the location data is available - * @param {Function} errorCallback The function to call when there is an error getting the location data. (OPTIONAL) - * @param {PositionOptions} options The options for getting the location data such as frequency. (OPTIONAL) - * @return String The watch id that must be passed to #clearWatch to stop watching. - */ - watchPosition:function(successCallback, errorCallback, options) { - options = parseParameters(options); - - var id = utils.createUUID(); - timers[id] = window.setInterval(function() { - geolocation.getCurrentPosition(successCallback, errorCallback, options); - }, options.timeout); - - return id; - }, - /** - * Clears the specified heading watch. - * - * @param {String} id The ID of the watch returned from #watchPosition - */ - clearWatch:function(id) { - if (id && timers[id] !== undefined) { - window.clearInterval(timers[id]); - delete timers[id]; - } - } -}; - -module.exports = geolocation; - -}); - -// file: lib/ios/plugin/ios/Contact.js -define("cordova/plugin/ios/Contact", function(require, exports, module) { -var exec = require('cordova/exec'), - ContactError = require('cordova/plugin/ContactError'); - -/** - * Provides iOS Contact.display API. - */ -module.exports = { - display : function(errorCB, options) { - /* - * Display a contact using the iOS Contact Picker UI - * NOT part of W3C spec so no official documentation - * - * @param errorCB error callback - * @param options object - * allowsEditing: boolean AS STRING - * "true" to allow editing the contact - * "false" (default) display contact - */ - - if (this.id == null) { - if (typeof errorCB === "function") { - var errorObj = new ContactError(ContactError.UNKNOWN_ERROR); - errorCB(errorObj); - } - } - else { - exec(null, errorCB, "Contacts","displayContact", [this.id, options]); - } - } -}; -}); - -// file: lib/ios/plugin/ios/Entry.js -define("cordova/plugin/ios/Entry", function(require, exports, module) { -module.exports = { - toURL:function() { - // TODO: refactor path in a cross-platform way so we can eliminate - // these kinds of platform-specific hacks. - return "file://localhost" + this.fullPath; - }, - toURI: function() { - console.log("DEPRECATED: Update your code to use 'toURL'"); - return "file://localhost" + this.fullPath; - } -}; - -}); - -// file: lib/ios/plugin/ios/FileReader.js -define("cordova/plugin/ios/FileReader", function(require, exports, module) { -var exec = require('cordova/exec'), - FileError = require('cordova/plugin/FileError'), - FileReader = require('cordova/plugin/FileReader'), - ProgressEvent = require('cordova/plugin/ProgressEvent'); - -module.exports = { - readAsText:function(file, encoding) { - // Figure out pathing - this.fileName = ''; - if (typeof file.fullPath === 'undefined') { - this.fileName = file; - } else { - this.fileName = file.fullPath; - } - - // Already loading something - if (this.readyState == FileReader.LOADING) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - // LOADING state - this.readyState = FileReader.LOADING; - - // If loadstart callback - if (typeof this.onloadstart === "function") { - this.onloadstart(new ProgressEvent("loadstart", {target:this})); - } - - // Default encoding is UTF-8 - var enc = encoding ? encoding : "UTF-8"; - - var me = this; - - // Read file - exec( - // Success callback - function(r) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileReader.DONE) { - return; - } - - // Save result - me.result = decodeURIComponent(r); - - // If onload callback - if (typeof me.onload === "function") { - me.onload(new ProgressEvent("load", {target:me})); - } - - // DONE state - me.readyState = FileReader.DONE; - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, - // Error callback - function(e) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileReader.DONE) { - return; - } - - // DONE state - me.readyState = FileReader.DONE; - - // null result - me.result = null; - - // Save error - me.error = new FileError(e); - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror(new ProgressEvent("error", {target:me})); - } - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, - "File", "readAsText", [this.fileName, enc]); - } -} - -}); - -// file: lib/ios/plugin/ios/console.js -define("cordova/plugin/ios/console", function(require, exports, module) { -var exec = require('cordova/exec'); - -/** - * String indentation/formatting - */ -function indent(str) { - return str.replace(/^/mg, " "); -} -/** - * Format a string for pretty logging - */ -function makeStructured(obj, depth) { - var str = ""; - for (var i in obj) { - try { - if (typeof(obj[i]) == 'object' && depth < maxDepth) { - str += i + ":\n" + indent(makeStructured(obj[i])) + "\n"; - } else { - str += i + " = " + indent(String(obj[i])).replace(/^ {4}/, "") + "\n"; - } - } catch(e) { - str += i + " = EXCEPTION: " + e.message + "\n"; - } - } - return str; -} - -/** - * This class provides access to the debugging console. - * @constructor - */ -var DebugConsole = function() { - this.winConsole = window.console; - this.logLevel = DebugConsole.INFO_LEVEL; -}; - -// from most verbose, to least verbose -DebugConsole.ALL_LEVEL = 1; // same as first level -DebugConsole.INFO_LEVEL = 1; -DebugConsole.WARN_LEVEL = 2; -DebugConsole.ERROR_LEVEL = 4; -DebugConsole.NONE_LEVEL = 8; - -DebugConsole.prototype.setLevel = function(level) { - this.logLevel = level; -}; - -/** - * Utility function for rendering and indenting strings, or serializing - * objects to a string capable of being printed to the console. - * @param {Object|String} message The string or object to convert to an indented string - * @private - */ -DebugConsole.prototype.processMessage = function(message, maxDepth) { - if (maxDepth === undefined) maxDepth = 0; - if (typeof(message) != 'object') { - return (this.isDeprecated ? "WARNING: debug object is deprecated, please use console object \n" + message : message); - } else { - return ("Object:\n" + makeStructured(message, maxDepth)); - } -}; - -/** - * Print a normal log message to the console - * @param {Object|String} message Message or object to print to the console - */ -DebugConsole.prototype.log = function(message, maxDepth) { - if (this.logLevel <= DebugConsole.INFO_LEVEL) - exec(null, null, 'Debug Console', 'log', - [ this.processMessage(message, maxDepth), { logLevel: 'INFO' } ] - ); - else - this.winConsole.log(message); -}; - -/** - * Print a warning message to the console - * @param {Object|String} message Message or object to print to the console - */ -DebugConsole.prototype.warn = function(message, maxDepth) { - if (this.logLevel <= DebugConsole.WARN_LEVEL) - exec(null, null, 'Debug Console', 'log', - [ this.processMessage(message, maxDepth), { logLevel: 'WARN' } ] - ); - else - this.winConsole.error(message); -}; - -/** - * Print an error message to the console - * @param {Object|String} message Message or object to print to the console - */ -DebugConsole.prototype.error = function(message, maxDepth) { - if (this.logLevel <= DebugConsole.ERROR_LEVEL) - exec(null, null, 'Debug Console', 'log', - [ this.processMessage(message, maxDepth), { logLevel: 'ERROR' } ] - ); - else - this.winConsole.error(message); -}; - -module.exports = new DebugConsole(); - -}); - -// file: lib/ios/plugin/ios/contacts.js -define("cordova/plugin/ios/contacts", function(require, exports, module) { -var exec = require('cordova/exec'); - -/** - * Provides iOS enhanced contacts API. - */ -module.exports = { - newContactUI : function(successCallback) { - /* - * Create a contact using the iOS Contact Picker UI - * NOT part of W3C spec so no official documentation - * - * returns: the id of the created contact as param to successCallback - */ - exec(successCallback, null, "Contacts","newContact", []); - }, - chooseContact : function(successCallback, options) { - /* - * Select a contact using the iOS Contact Picker UI - * NOT part of W3C spec so no official documentation - * - * @param errorCB error callback - * @param options object - * allowsEditing: boolean AS STRING - * "true" to allow editing the contact - * "false" (default) display contact - * - * returns: the id of the selected contact as param to successCallback - */ - exec(successCallback, null, "Contacts","chooseContact", [options]); - } -}; -}); - -// file: lib/ios/plugin/ios/device.js -define("cordova/plugin/ios/device", function(require, exports, module) { -/** - * this represents the mobile device, and provides properties for inspecting the model, version, UUID of the - * phone, etc. - * @constructor - */ -var exec = require('cordova/exec'), - utils = require('cordova/utils'), - channel = require('cordova/channel'); - -var Device = function() { - this.platform = null; - this.version = null; - this.name = null; - this.cordova = null; - this.uuid = null; -}; - -Device.prototype.setInfo = function(info) { - try { - this.platform = info.platform; - this.version = info.version; - this.name = info.name; - this.cordova = info.gap; - this.uuid = info.uuid; - channel.onCordovaInfoReady.fire(); - } catch(e) { - utils.alert('Error during device info setting in cordova/plugin/ios/device!'); - } -}; - -module.exports = new Device(); - -}); - -// file: lib/ios/plugin/ios/nativecomm.js -define("cordova/plugin/ios/nativecomm", function(require, exports, module) { -var cordova = require('cordova'); - -/** - * Called by native code to retrieve all queued commands and clear the queue. - */ -module.exports = function() { - var json = JSON.stringify(cordova.commandQueue); - cordova.commandQueue = []; - return json; -}; - -}); - -// file: lib/ios/plugin/ios/notification.js -define("cordova/plugin/ios/notification", function(require, exports, module) { -var Media = require('cordova/plugin/Media'); - -module.exports = { - beep:function(count) { - (new Media('beep.wav')).play(); - } -} - -}); - -// file: lib/common/plugin/network.js -define("cordova/plugin/network", function(require, exports, module) { -var exec = require('cordova/exec'), - cordova = require('cordova'), - channel = require('cordova/channel'); - -var NetworkConnection = function () { - this.type = null; - this._firstRun = true; - this._timer = null; - this.timeout = 500; - - var me = this; - - channel.onCordovaReady.subscribeOnce(function() { - me.getInfo(function (info) { - me.type = info; - if (info === "none") { - // set a timer if still offline at the end of timer send the offline event - me._timer = setTimeout(function(){ - cordova.fireDocumentEvent("offline"); - me._timer = null; - }, me.timeout); - } else { - // If there is a current offline event pending clear it - if (me._timer !== null) { - clearTimeout(me._timer); - me._timer = null; - } - cordova.fireDocumentEvent("online"); - } - - // should only fire this once - if (me._firstRun) { - me._firstRun = false; - channel.onCordovaConnectionReady.fire(); - } - }, - function (e) { - // If we can't get the network info we should still tell Cordova - // to fire the deviceready event. - if (me._firstRun) { - me._firstRun = false; - channel.onCordovaConnectionReady.fire(); - } - console.log("Error initializing Network Connection: " + e); - }); - }); -}; - -/** - * Get connection info - * - * @param {Function} successCallback The function to call when the Connection data is available - * @param {Function} errorCallback The function to call when there is an error getting the Connection data. (OPTIONAL) - */ -NetworkConnection.prototype.getInfo = function (successCallback, errorCallback) { - // Get info - exec(successCallback, errorCallback, "NetworkStatus", "getConnectionInfo", []); -}; - -module.exports = new NetworkConnection(); - -}); - -// file: lib/common/plugin/notification.js -define("cordova/plugin/notification", function(require, exports, module) { -var exec = require('cordova/exec'); - -/** - * Provides access to notifications on the device. - */ - -module.exports = { - - /** - * Open a native alert dialog, with a customizable title and button text. - * - * @param {String} message Message to print in the body of the alert - * @param {Function} completeCallback The callback that is called when user clicks on a button. - * @param {String} title Title of the alert dialog (default: Alert) - * @param {String} buttonLabel Label of the close button (default: OK) - */ - alert: function(message, completeCallback, title, buttonLabel) { - var _title = (title || "Alert"); - var _buttonLabel = (buttonLabel || "OK"); - exec(completeCallback, null, "Notification", "alert", [message, _title, _buttonLabel]); - }, - - /** - * Open a native confirm dialog, with a customizable title and button text. - * The result that the user selects is returned to the result callback. - * - * @param {String} message Message to print in the body of the alert - * @param {Function} resultCallback The callback that is called when user clicks on a button. - * @param {String} title Title of the alert dialog (default: Confirm) - * @param {String} buttonLabels Comma separated list of the labels of the buttons (default: 'OK,Cancel') - */ - confirm: function(message, resultCallback, title, buttonLabels) { - var _title = (title || "Confirm"); - var _buttonLabels = (buttonLabels || "OK,Cancel"); - exec(resultCallback, null, "Notification", "confirm", [message, _title, _buttonLabels]); - }, - - /** - * Causes the device to vibrate. - * - * @param {Integer} mills The number of milliseconds to vibrate for. - */ - vibrate: function(mills) { - exec(null, null, "Notification", "vibrate", [mills]); - }, - - /** - * Causes the device to beep. - * On Android, the default notification ringtone is played "count" times. - * - * @param {Integer} count The number of beeps. - */ - beep: function(count) { - exec(null, null, "Notification", "beep", [count]); - } -}; - -}); - -// file: lib/common/plugin/requestFileSystem.js -define("cordova/plugin/requestFileSystem", function(require, exports, module) { -var FileError = require('cordova/plugin/FileError'), - FileSystem = require('cordova/plugin/FileSystem'), - exec = require('cordova/exec'); - -/** - * Request a file system in which to store application data. - * @param type local file system type - * @param size indicates how much storage space, in bytes, the application expects to need - * @param successCallback invoked with a FileSystem object - * @param errorCallback invoked if error occurs retrieving file system - */ -var requestFileSystem = function(type, size, successCallback, errorCallback) { - var fail = function(code) { - if (typeof errorCallback === 'function') { - errorCallback(new FileError(code)); - } - }; - - if (type < 0 || type > 3) { - fail(FileError.SYNTAX_ERR); - } else { - // if successful, return a FileSystem object - var success = function(file_system) { - if (file_system) { - if (typeof successCallback === 'function') { - // grab the name and root from the file system object - var result = new FileSystem(file_system.name, file_system.root); - successCallback(result); - } - } - else { - // no FileSystem object returned - fail(FileError.NOT_FOUND_ERR); - } - }; - exec(success, fail, "File", "requestFileSystem", [type, size]); - } -}; - -module.exports = requestFileSystem; - -}); - -// file: lib/common/plugin/resolveLocalFileSystemURI.js -define("cordova/plugin/resolveLocalFileSystemURI", function(require, exports, module) { -var DirectoryEntry = require('cordova/plugin/DirectoryEntry'), - FileEntry = require('cordova/plugin/FileEntry'), - exec = require('cordova/exec'); - -/** - * Look up file system Entry referred to by local URI. - * @param {DOMString} uri URI referring to a local file or directory - * @param successCallback invoked with Entry object corresponding to URI - * @param errorCallback invoked if error occurs retrieving file system entry - */ -module.exports = function(uri, successCallback, errorCallback) { - // error callback - var fail = function(error) { - if (typeof errorCallback === 'function') { - errorCallback(new FileError(error)); - } - }; - // if successful, return either a file or directory entry - var success = function(entry) { - var result; - - if (entry) { - if (typeof successCallback === 'function') { - // create appropriate Entry object - result = (entry.isDirectory) ? new DirectoryEntry(entry.name, entry.fullPath) : new FileEntry(entry.name, entry.fullPath); - try { - successCallback(result); - } - catch (e) { - console.log('Error invoking callback: ' + e); - } - } - } - else { - // no Entry object returned - fail(FileError.NOT_FOUND_ERR); - } - }; - - exec(success, fail, "File", "resolveLocalFileSystemURI", [uri]); -}; - -}); - -// file: lib/common/utils.js -define("cordova/utils", function(require, exports, module) { -function UUIDcreatePart(length) { - var uuidpart = ""; - for (var i=0; i").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; -f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() -{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/www/js/init.js b/iOS/cordova/project/ImageFilter/ImageFilter/www/js/init.js deleted file mode 100644 index 04f34ee..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/www/js/init.js +++ /dev/null @@ -1,102 +0,0 @@ -// PROJECT: ImageFilter Phonegap Plugin -// AUTHOR: Drew Dahlman (www.drewdahlman.com) -// DATE: 2.25.2012 -// VERSION: 1.0 -/* -NOTES: -A few things to read before using this plugin. -Each filter is created with objective-c. Thus modifications to effects must be made there. -Applying a filter is simple - - -EXAMPLE: -plugins.ImageFilter.stark({ - image:imageURI, - save:'false' -}); - -*/ - -// GLOBAL VARS -var largeImage; - -var app = { - bodyLoad: function () { - document.addEventListener("deviceready", app.deviceReady, false); - }, - deviceReady: function () { - app.init(); - }, - init: function () { - - }, - useCamera: function () { - navigator.camera.getPicture(app.onCameraSuccess, app.onCameraFail, { - quality: 100, - destinationType: Camera.DestinationType.FILE_URI, - sourceType: Camera.PictureSourceType.CAMERA, - //allowEdit : true, - encodingType: Camera.EncodingType.JPEG, - targetWidth: 910, - targetHeight: 910, - saveToPhotoAlbum: false - }); - }, - useRoll: function () { - navigator.camera.getPicture(app.onCameraSuccess, app.onCameraFail, { - quality: 100, - destinationType: Camera.DestinationType.FILE_URI, - sourceType: Camera.PictureSourceType.PHOTOLIBRARY, - encodingType: Camera.EncodingType.JPEG, - targetWidth: 910, - targetHeight: 910, - saveToPhotoAlbum: false - }); - }, - onCameraSuccess: function (imageURI) { - - largeImage = imageURI; - $(".photo").html(""); - $(".photo").show(); - - }, - onCameraFail: function (msg) { - console.log("ERROR! -" + msg); - } -}; - -var filters = { - none: function (imageURI) { - plugins.ImageFilter.none(filters.rendered, { - image: imageURI, - save: 'false', - }); - }, - sunnySide: function (imageURI) { - plugins.ImageFilter.sunnySide(filters.rendered, { - image: imageURI, - save: 'false' - }); - }, - worn: function (imageURI) { - plugins.ImageFilter.worn(filters.rendered, { - image: imageURI, - save: 'false' - }); - }, - vintage: function (imageURI) { - plugins.ImageFilter.vintage(filters.rendered, { - image: imageURI, - save: 'false' - }); - }, - stark: function (imageURI) { - plugins.ImageFilter.stark(filters.rendered, { - image: imageURI, - save: 'false' - }); - }, - rendered: function (msg) { - - $(".photo").html(""); - } -} \ No newline at end of file diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/www/js/plugins/ImageFilter.js b/iOS/cordova/project/ImageFilter/ImageFilter/www/js/plugins/ImageFilter.js deleted file mode 100644 index 954b912..0000000 --- a/iOS/cordova/project/ImageFilter/ImageFilter/www/js/plugins/ImageFilter.js +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright (c) 2012 Drew Dahlman MIT LICENSE -*/ - -var ImageFilter = function () {}; - -ImageFilter.prototype.clean = function (options) { - - cordova.exec("ImageFilter.clean"); -}; -ImageFilter.prototype.none = function (done,options) { - //console.log(options+" "+done); - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - - return cordova.exec(done,null,"ImageFilter","none",[defaults]); -}; -ImageFilter.prototype.sunnySide = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return cordova.exec(done,null,"ImageFilter","sunnySide",[defaults]); -}; -ImageFilter.prototype.worn = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return cordova.exec(done,null,"ImageFilter","worn",[defaults]); -}; -ImageFilter.prototype.vintage = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return cordova.exec(done,null,"ImageFilter","vintage",[defaults]); -}; -ImageFilter.prototype.stark = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return cordova.exec(done,null,"ImageFilter","stark",[defaults]); -}; -cordova.addConstructor(function () { - if(!window.plugins) { - window.plugins = {}; - } - window.plugins.ImageFilter = new ImageFilter(); -}); \ No newline at end of file diff --git a/iOS/cordova/project/ImageFilter/www/cordova-1.6.0.js b/iOS/cordova/project/ImageFilter/www/cordova-1.6.0.js deleted file mode 100644 index 9f7cd45..0000000 --- a/iOS/cordova/project/ImageFilter/www/cordova-1.6.0.js +++ /dev/null @@ -1,4506 +0,0 @@ -// File generated at :: Tue Apr 10 2012 12:28:18 GMT-0700 (PDT) - -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -;(function() { - -// file: lib/scripts/require.js -var require, - define; - -(function () { - var modules = {}; - - function build(module) { - var factory = module.factory; - module.exports = {}; - delete module.factory; - factory(require, module.exports, module); - return module.exports; - } - - require = function (id) { - if (!modules[id]) { - throw "module " + id + " not found"; - } - return modules[id].factory ? build(modules[id]) : modules[id].exports; - }; - - define = function (id, factory) { - if (modules[id]) { - throw "module " + id + " already defined"; - } - - modules[id] = { - id: id, - factory: factory - }; - }; - - define.remove = function (id) { - delete modules[id]; - }; - -})(); - -//Export for use in node -if (typeof module === "object" && typeof require === "function") { - module.exports.require = require; - module.exports.define = define; -} - -// file: lib/cordova.js -define("cordova", function(require, exports, module) { -var channel = require('cordova/channel'); -/** - * Intercept calls to addEventListener + removeEventListener and handle deviceready, - * resume, and pause events. - */ -var m_document_addEventListener = document.addEventListener; -var m_document_removeEventListener = document.removeEventListener; -var m_window_addEventListener = window.addEventListener; -var m_window_removeEventListener = window.removeEventListener; - -/** - * Houses custom event handlers to intercept on document + window event listeners. - */ -var documentEventHandlers = {}, - windowEventHandlers = {}; - -document.addEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - if (e == 'deviceready') { - channel.onDeviceReady.subscribeOnce(handler); - } else if (e == 'resume') { - channel.onResume.subscribe(handler); - // if subscribing listener after event has already fired, invoke the handler - if (channel.onResume.fired && handler instanceof Function) { - handler(); - } - } else if (e == 'pause') { - channel.onPause.subscribe(handler); - } else if (typeof documentEventHandlers[e] != 'undefined') { - documentEventHandlers[e].subscribe(handler); - } else { - m_document_addEventListener.call(document, evt, handler, capture); - } -}; - -window.addEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - if (typeof windowEventHandlers[e] != 'undefined') { - windowEventHandlers[e].subscribe(handler); - } else { - m_window_addEventListener.call(window, evt, handler, capture); - } -}; - -document.removeEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - // If unsubcribing from an event that is handled by a plugin - if (typeof documentEventHandlers[e] != "undefined") { - documentEventHandlers[e].unsubscribe(handler); - } else { - m_document_removeEventListener.call(document, evt, handler, capture); - } -}; - -window.removeEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - // If unsubcribing from an event that is handled by a plugin - if (typeof windowEventHandlers[e] != "undefined") { - windowEventHandlers[e].unsubscribe(handler); - } else { - m_window_removeEventListener.call(window, evt, handler, capture); - } -}; - -function createEvent(type, data) { - var event = document.createEvent('Events'); - event.initEvent(type, false, false); - if (data) { - for (var i in data) { - if (data.hasOwnProperty(i)) { - event[i] = data[i]; - } - } - } - return event; -} - -if(typeof window.console === "undefined") -{ - window.console = { - log:function(){} - }; -} - -var cordova = { - define:define, - require:require, - /** - * Methods to add/remove your own addEventListener hijacking on document + window. - */ - addWindowEventHandler:function(event, opts) { - return (windowEventHandlers[event] = channel.create(event, opts)); - }, - addDocumentEventHandler:function(event, opts) { - return (documentEventHandlers[event] = channel.create(event, opts)); - }, - removeWindowEventHandler:function(event) { - delete windowEventHandlers[event]; - }, - removeDocumentEventHandler:function(event) { - delete documentEventHandlers[event]; - }, - /** - * Retreive original event handlers that were replaced by Cordova - * - * @return object - */ - getOriginalHandlers: function() { - return {'document': {'addEventListener': m_document_addEventListener, 'removeEventListener': m_document_removeEventListener}, - 'window': {'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener}}; - }, - /** - * Method to fire event from native code - */ - fireDocumentEvent: function(type, data) { - var evt = createEvent(type, data); - if (typeof documentEventHandlers[type] != 'undefined') { - documentEventHandlers[type].fire(evt); - } else { - document.dispatchEvent(evt); - } - }, - fireWindowEvent: function(type, data) { - var evt = createEvent(type,data); - if (typeof windowEventHandlers[type] != 'undefined') { - windowEventHandlers[type].fire(evt); - } else { - window.dispatchEvent(evt); - } - }, - // TODO: this is Android only; think about how to do this better - shuttingDown:false, - UsePolling:false, - // END TODO - - // TODO: iOS only - // This queue holds the currently executing command and all pending - // commands executed with cordova.exec(). - commandQueue:[], - // Indicates if we're currently in the middle of flushing the command - // queue on the native side. - commandQueueFlushing:false, - // END TODO - /** - * Plugin callback mechanism. - */ - callbackId: 0, - callbacks: {}, - callbackStatus: { - NO_RESULT: 0, - OK: 1, - CLASS_NOT_FOUND_EXCEPTION: 2, - ILLEGAL_ACCESS_EXCEPTION: 3, - INSTANTIATION_EXCEPTION: 4, - MALFORMED_URL_EXCEPTION: 5, - IO_EXCEPTION: 6, - INVALID_ACTION: 7, - JSON_EXCEPTION: 8, - ERROR: 9 - }, - - /** - * Called by native code when returning successful result from an action. - * - * @param callbackId - * @param args - */ - callbackSuccess: function(callbackId, args) { - if (cordova.callbacks[callbackId]) { - - // If result is to be sent to callback - if (args.status == cordova.callbackStatus.OK) { - try { - if (cordova.callbacks[callbackId].success) { - cordova.callbacks[callbackId].success(args.message); - } - } - catch (e) { - console.log("Error in success callback: "+callbackId+" = "+e); - } - } - - // Clear callback if not expecting any more results - if (!args.keepCallback) { - delete cordova.callbacks[callbackId]; - } - } - }, - - /** - * Called by native code when returning error result from an action. - * - * @param callbackId - * @param args - */ - callbackError: function(callbackId, args) { - if (cordova.callbacks[callbackId]) { - try { - if (cordova.callbacks[callbackId].fail) { - cordova.callbacks[callbackId].fail(args.message); - } - } - catch (e) { - console.log("Error in error callback: "+callbackId+" = "+e); - } - - // Clear callback if not expecting any more results - if (!args.keepCallback) { - delete cordova.callbacks[callbackId]; - } - } - }, - // TODO: remove in 2.0. - addPlugin: function(name, obj) { - console.log("[DEPRECATION NOTICE] window.addPlugin and window.plugins will be removed in version 2.0."); - if (!window.plugins[name]) { - window.plugins[name] = obj; - } - else { - console.log("Error: Plugin "+name+" already exists."); - } - }, - - addConstructor: function(func) { - channel.onCordovaReady.subscribeOnce(function() { - try { - func(); - } catch(e) { - console.log("Failed to run constructor: " + e); - } - }); - } -}; - -/** - * Legacy variable for plugin support - * TODO: remove in 2.0. - */ -if (!window.PhoneGap) { - window.PhoneGap = cordova; -} - -/** - * Plugins object - * TODO: remove in 2.0. - */ -if (!window.plugins) { - window.plugins = {}; -} - -module.exports = cordova; - -}); - -// file: lib/common/builder.js -define("cordova/builder", function(require, exports, module) { -function each(objects, func, context) { - for (var prop in objects) { - if (objects.hasOwnProperty(prop)) { - func.apply(context, [objects[prop], prop]); - } - } -} - -function include(parent, objects, clobber, merge) { - each(objects, function (obj, key) { - try { - var result = obj.path ? require(obj.path) : {}; - - if (clobber) { - // Clobber if it doesn't exist. - if (typeof parent[key] === 'undefined') { - parent[key] = result; - } else if (typeof obj.path !== 'undefined') { - // If merging, merge properties onto parent, otherwise, clobber. - if (merge) { - recursiveMerge(parent[key], result); - } else { - parent[key] = result; - } - } - result = parent[key]; - } else { - // Overwrite if not currently defined. - if (typeof parent[key] == 'undefined') { - parent[key] = result; - } else if (merge && typeof obj.path !== 'undefined') { - // If merging, merge parent onto result - recursiveMerge(result, parent[key]); - parent[key] = result; - } else { - // Set result to what already exists, so we can build children into it if they exist. - result = parent[key]; - } - } - - if (obj.children) { - include(result, obj.children, clobber, merge); - } - } catch(e) { - utils.alert('Exception building cordova JS globals: ' + e + ' for key "' + key + '"'); - } - }); -} - -/** - * Merge properties from one object onto another recursively. Properties from - * the src object will overwrite existing target property. - * - * @param target Object to merge properties into. - * @param src Object to merge properties from. - */ -function recursiveMerge(target, src) { - for (var prop in src) { - if (src.hasOwnProperty(prop)) { - if (typeof target.prototype !== 'undefined' && target.prototype.constructor === target) { - // If the target object is a constructor override off prototype. - target.prototype[prop] = src[prop]; - } else { - target[prop] = typeof src[prop] === 'object' ? recursiveMerge( - target[prop], src[prop]) : src[prop]; - } - } - } - return target; -} - -module.exports = { - build: function (objects) { - return { - intoButDontClobber: function (target) { - include(target, objects, false, false); - }, - intoAndClobber: function(target) { - include(target, objects, true, false); - }, - intoAndMerge: function(target) { - include(target, objects, true, true); - } - }; - } -}; - -}); - -// file: lib/common/channel.js -define("cordova/channel", function(require, exports, module) { -/** - * Custom pub-sub "channel" that can have functions subscribed to it - * This object is used to define and control firing of events for - * cordova initialization. - * - * The order of events during page load and Cordova startup is as follows: - * - * onDOMContentLoaded Internal event that is received when the web page is loaded and parsed. - * onNativeReady Internal event that indicates the Cordova native side is ready. - * onCordovaReady Internal event fired when all Cordova JavaScript objects have been created. - * onCordovaInfoReady Internal event fired when device properties are available. - * onCordovaConnectionReady Internal event fired when the connection property has been set. - * onDeviceReady User event fired to indicate that Cordova is ready - * onResume User event fired to indicate a start/resume lifecycle event - * onPause User event fired to indicate a pause lifecycle event - * onDestroy Internal event fired when app is being destroyed (User should use window.onunload event, not this one). - * - * The only Cordova events that user code should register for are: - * deviceready Cordova native code is initialized and Cordova APIs can be called from JavaScript - * pause App has moved to background - * resume App has returned to foreground - * - * Listeners can be registered as: - * document.addEventListener("deviceready", myDeviceReadyListener, false); - * document.addEventListener("resume", myResumeListener, false); - * document.addEventListener("pause", myPauseListener, false); - * - * The DOM lifecycle events should be used for saving and restoring state - * window.onload - * window.onunload - * - */ - -/** - * Channel - * @constructor - * @param type String the channel name - * @param opts Object options to pass into the channel, currently - * supports: - * onSubscribe: callback that fires when - * something subscribes to the Channel. Sets - * context to the Channel. - * onUnsubscribe: callback that fires when - * something unsubscribes to the Channel. Sets - * context to the Channel. - */ -var Channel = function(type, opts) { - this.type = type; - this.handlers = {}; - this.numHandlers = 0; - this.guid = 0; - this.fired = false; - this.enabled = true; - this.events = { - onSubscribe:null, - onUnsubscribe:null - }; - if (opts) { - if (opts.onSubscribe) this.events.onSubscribe = opts.onSubscribe; - if (opts.onUnsubscribe) this.events.onUnsubscribe = opts.onUnsubscribe; - } - }, - channel = { - /** - * Calls the provided function only after all of the channels specified - * have been fired. - */ - join: function (h, c) { - var i = c.length; - var len = i; - var f = function() { - if (!(--i)) h(); - }; - for (var j=0; j} phoneNumbers array of phone numbers -* @param {Array.} emails array of email addresses -* @param {Array.} addresses array of addresses -* @param {Array.} ims instant messaging user ids -* @param {Array.} organizations -* @param {DOMString} birthday contact's birthday -* @param {DOMString} note user notes about contact -* @param {Array.} photos -* @param {Array.} categories -* @param {Array.} urls contact's web sites -*/ -var Contact = function (id, displayName, name, nickname, phoneNumbers, emails, addresses, - ims, organizations, birthday, note, photos, categories, urls) { - this.id = id || null; - this.rawId = null; - this.displayName = displayName || null; - this.name = name || null; // ContactName - this.nickname = nickname || null; - this.phoneNumbers = phoneNumbers || null; // ContactField[] - this.emails = emails || null; // ContactField[] - this.addresses = addresses || null; // ContactAddress[] - this.ims = ims || null; // ContactField[] - this.organizations = organizations || null; // ContactOrganization[] - this.birthday = birthday || null; - this.note = note || null; - this.photos = photos || null; // ContactField[] - this.categories = categories || null; // ContactField[] - this.urls = urls || null; // ContactField[] -}; - -/** -* Removes contact from device storage. -* @param successCB success callback -* @param errorCB error callback -*/ -Contact.prototype.remove = function(successCB, errorCB) { - var fail = function(code) { - errorCB(new ContactError(code)); - }; - if (this.id === null) { - fail(ContactError.UNKNOWN_ERROR); - } - else { - exec(successCB, fail, "Contacts", "remove", [this.id]); - } -}; - -/** -* Creates a deep copy of this Contact. -* With the contact ID set to null. -* @return copy of this Contact -*/ -Contact.prototype.clone = function() { - var clonedContact = utils.clone(this); - var i; - clonedContact.id = null; - clonedContact.rawId = null; - // Loop through and clear out any id's in phones, emails, etc. - if (clonedContact.phoneNumbers) { - for (i = 0; i < clonedContact.phoneNumbers.length; i++) { - clonedContact.phoneNumbers[i].id = null; - } - } - if (clonedContact.emails) { - for (i = 0; i < clonedContact.emails.length; i++) { - clonedContact.emails[i].id = null; - } - } - if (clonedContact.addresses) { - for (i = 0; i < clonedContact.addresses.length; i++) { - clonedContact.addresses[i].id = null; - } - } - if (clonedContact.ims) { - for (i = 0; i < clonedContact.ims.length; i++) { - clonedContact.ims[i].id = null; - } - } - if (clonedContact.organizations) { - for (i = 0; i < clonedContact.organizations.length; i++) { - clonedContact.organizations[i].id = null; - } - } - if (clonedContact.categories) { - for (i = 0; i < clonedContact.categories.length; i++) { - clonedContact.categories[i].id = null; - } - } - if (clonedContact.photos) { - for (i = 0; i < clonedContact.photos.length; i++) { - clonedContact.photos[i].id = null; - } - } - if (clonedContact.urls) { - for (i = 0; i < clonedContact.urls.length; i++) { - clonedContact.urls[i].id = null; - } - } - return clonedContact; -}; - -/** -* Persists contact to device storage. -* @param successCB success callback -* @param errorCB error callback -*/ -Contact.prototype.save = function(successCB, errorCB) { - var fail = function(code) { - errorCB(new ContactError(code)); - }; - var success = function(result) { - if (result) { - if (typeof successCB === 'function') { - var fullContact = require('cordova/plugin/contacts').create(result); - successCB(convertIn(fullContact)); - } - } - else { - // no Entry object returned - fail(ContactError.UNKNOWN_ERROR); - } - }; - var dupContact = convertOut(utils.clone(this)); - exec(success, fail, "Contacts", "save", [dupContact]); -}; - - -module.exports = Contact; - -}); - -// file: lib/common/plugin/ContactAddress.js -define("cordova/plugin/ContactAddress", function(require, exports, module) { -/** -* Contact address. -* @constructor -* @param {DOMString} id unique identifier, should only be set by native code -* @param formatted // NOTE: not a W3C standard -* @param streetAddress -* @param locality -* @param region -* @param postalCode -* @param country -*/ - -var ContactAddress = function(pref, type, formatted, streetAddress, locality, region, postalCode, country) { - this.id = null; - this.pref = (typeof pref != 'undefined' ? pref : false); - this.type = type || null; - this.formatted = formatted || null; - this.streetAddress = streetAddress || null; - this.locality = locality || null; - this.region = region || null; - this.postalCode = postalCode || null; - this.country = country || null; -}; - -module.exports = ContactAddress; - -}); - -// file: lib/common/plugin/ContactError.js -define("cordova/plugin/ContactError", function(require, exports, module) { -/** - * ContactError. - * An error code assigned by an implementation when an error has occured - * @constructor - */ -var ContactError = function(err) { - this.code = (typeof err != 'undefined' ? err : null); -}; - -/** - * Error codes - */ -ContactError.UNKNOWN_ERROR = 0; -ContactError.INVALID_ARGUMENT_ERROR = 1; -ContactError.TIMEOUT_ERROR = 2; -ContactError.PENDING_OPERATION_ERROR = 3; -ContactError.IO_ERROR = 4; -ContactError.NOT_SUPPORTED_ERROR = 5; -ContactError.PERMISSION_DENIED_ERROR = 20; - -module.exports = ContactError; - -}); - -// file: lib/common/plugin/ContactField.js -define("cordova/plugin/ContactField", function(require, exports, module) { -/** -* Generic contact field. -* @constructor -* @param {DOMString} id unique identifier, should only be set by native code // NOTE: not a W3C standard -* @param type -* @param value -* @param pref -*/ -var ContactField = function(type, value, pref) { - this.id = null; - this.type = type || null; - this.value = value || null; - this.pref = (typeof pref != 'undefined' ? pref : false); -}; - -module.exports = ContactField; - -}); - -// file: lib/common/plugin/ContactFindOptions.js -define("cordova/plugin/ContactFindOptions", function(require, exports, module) { -/** - * ContactFindOptions. - * @constructor - * @param filter used to match contacts against - * @param multiple boolean used to determine if more than one contact should be returned - */ - -var ContactFindOptions = function(filter, multiple) { - this.filter = filter || ''; - this.multiple = (typeof multiple != 'undefined' ? multiple : false); -}; - -module.exports = ContactFindOptions; - -}); - -// file: lib/common/plugin/ContactName.js -define("cordova/plugin/ContactName", function(require, exports, module) { -/** -* Contact name. -* @constructor -* @param formatted // NOTE: not part of W3C standard -* @param familyName -* @param givenName -* @param middle -* @param prefix -* @param suffix -*/ -var ContactName = function(formatted, familyName, givenName, middle, prefix, suffix) { - this.formatted = formatted || null; - this.familyName = familyName || null; - this.givenName = givenName || null; - this.middleName = middle || null; - this.honorificPrefix = prefix || null; - this.honorificSuffix = suffix || null; -}; - -module.exports = ContactName; - -}); - -// file: lib/common/plugin/ContactOrganization.js -define("cordova/plugin/ContactOrganization", function(require, exports, module) { -/** -* Contact organization. -* @constructor -* @param {DOMString} id unique identifier, should only be set by native code // NOTE: not a W3C standard -* @param name -* @param dept -* @param title -* @param startDate -* @param endDate -* @param location -* @param desc -*/ - -var ContactOrganization = function(pref, type, name, dept, title) { - this.id = null; - this.pref = (typeof pref != 'undefined' ? pref : false); - this.type = type || null; - this.name = name || null; - this.department = dept || null; - this.title = title || null; -}; - -module.exports = ContactOrganization; - -}); - -// file: lib/common/plugin/Coordinates.js -define("cordova/plugin/Coordinates", function(require, exports, module) { -/** - * This class contains position information. - * @param {Object} lat - * @param {Object} lng - * @param {Object} alt - * @param {Object} acc - * @param {Object} head - * @param {Object} vel - * @param {Object} altacc - * @constructor - */ -var Coordinates = function(lat, lng, alt, acc, head, vel, altacc) { - /** - * The latitude of the position. - */ - this.latitude = lat; - /** - * The longitude of the position, - */ - this.longitude = lng; - /** - * The accuracy of the position. - */ - this.accuracy = acc; - /** - * The altitude of the position. - */ - this.altitude = alt; - /** - * The direction the device is moving at the position. - */ - this.heading = head; - /** - * The velocity with which the device is moving at the position. - */ - this.speed = vel; - /** - * The altitude accuracy of the position. - */ - this.altitudeAccuracy = (altacc !== undefined) ? altacc : null; -}; - -module.exports = Coordinates; - -}); - -// file: lib/common/plugin/DirectoryEntry.js -define("cordova/plugin/DirectoryEntry", function(require, exports, module) { -var utils = require('cordova/utils'), - exec = require('cordova/exec'), - Entry = require('cordova/plugin/Entry'), - DirectoryReader = require('cordova/plugin/DirectoryReader'); - -/** - * An interface representing a directory on the file system. - * - * {boolean} isFile always false (readonly) - * {boolean} isDirectory always true (readonly) - * {DOMString} name of the directory, excluding the path leading to it (readonly) - * {DOMString} fullPath the absolute full path to the directory (readonly) - * {FileSystem} filesystem on which the directory resides (readonly) - */ -var DirectoryEntry = function(name, fullPath) { - DirectoryEntry.__super__.constructor.apply(this, [false, true, name, fullPath]); -}; - -utils.extend(DirectoryEntry, Entry); - -/** - * Creates a new DirectoryReader to read entries from this directory - */ -DirectoryEntry.prototype.createReader = function() { - return new DirectoryReader(this.fullPath); -}; - -/** - * Creates or looks up a directory - * - * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a directory - * @param {Flags} options to create or excluively create the directory - * @param {Function} successCallback is called with the new entry - * @param {Function} errorCallback is called with a FileError - */ -DirectoryEntry.prototype.getDirectory = function(path, options, successCallback, errorCallback) { - var win = typeof successCallback !== 'function' ? null : function(result) { - var entry = new DirectoryEntry(result.name, result.fullPath); - successCallback(entry); - }; - var fail = typeof errorCallback !== 'function' ? null : function(code) { - errorCallback(new FileError(code)); - }; - exec(win, fail, "File", "getDirectory", [this.fullPath, path, options]); -}; - -/** - * Deletes a directory and all of it's contents - * - * @param {Function} successCallback is called with no parameters - * @param {Function} errorCallback is called with a FileError - */ -DirectoryEntry.prototype.removeRecursively = function(successCallback, errorCallback) { - var fail = typeof errorCallback !== 'function' ? null : function(code) { - errorCallback(new FileError(code)); - }; - exec(successCallback, fail, "File", "removeRecursively", [this.fullPath]); -}; - -/** - * Creates or looks up a file - * - * @param {DOMString} path either a relative or absolute path from this directory in which to look up or create a file - * @param {Flags} options to create or excluively create the file - * @param {Function} successCallback is called with the new entry - * @param {Function} errorCallback is called with a FileError - */ -DirectoryEntry.prototype.getFile = function(path, options, successCallback, errorCallback) { - var win = typeof successCallback !== 'function' ? null : function(result) { - var FileEntry = require('cordova/plugin/FileEntry'); - var entry = new FileEntry(result.name, result.fullPath); - successCallback(entry); - }; - var fail = typeof errorCallback !== 'function' ? null : function(code) { - errorCallback(new FileError(code)); - }; - exec(win, fail, "File", "getFile", [this.fullPath, path, options]); -}; - -module.exports = DirectoryEntry; - -}); - -// file: lib/common/plugin/DirectoryReader.js -define("cordova/plugin/DirectoryReader", function(require, exports, module) { -var exec = require('cordova/exec'); - -/** - * An interface that lists the files and directories in a directory. - */ -function DirectoryReader(path) { - this.path = path || null; -} - -/** - * Returns a list of entries from a directory. - * - * @param {Function} successCallback is called with a list of entries - * @param {Function} errorCallback is called with a FileError - */ -DirectoryReader.prototype.readEntries = function(successCallback, errorCallback) { - var win = typeof successCallback !== 'function' ? null : function(result) { - var retVal = []; - for (var i=0; i][;base64], - * - * @param file {File} File object containing file properties - */ -FileReader.prototype.readAsDataURL = function(file) { - this.fileName = ""; - if (typeof file.fullPath === "undefined") { - this.fileName = file; - } else { - this.fileName = file.fullPath; - } - - // Already loading something - if (this.readyState == FileReader.LOADING) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - // LOADING state - this.readyState = FileReader.LOADING; - - // If loadstart callback - if (typeof this.onloadstart === "function") { - this.onloadstart(new ProgressEvent("loadstart", {target:this})); - } - - var me = this; - - // Read file - exec( - // Success callback - function(r) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileReader.DONE) { - return; - } - - // DONE state - me.readyState = FileReader.DONE; - - // Save result - me.result = r; - - // If onload callback - if (typeof me.onload === "function") { - me.onload(new ProgressEvent("load", {target:me})); - } - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, - // Error callback - function(e) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileReader.DONE) { - return; - } - - // DONE state - me.readyState = FileReader.DONE; - - me.result = null; - - // Save error - me.error = new FileError(e); - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror(new ProgressEvent("error", {target:me})); - } - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, "File", "readAsDataURL", [this.fileName]); -}; - -/** - * Read file and return data as a binary data. - * - * @param file {File} File object containing file properties - */ -FileReader.prototype.readAsBinaryString = function(file) { - // TODO - Can't return binary data to browser. - console.log('method "readAsBinaryString" is not supported at this time.'); -}; - -/** - * Read file and return data as a binary data. - * - * @param file {File} File object containing file properties - */ -FileReader.prototype.readAsArrayBuffer = function(file) { - // TODO - Can't return binary data to browser. - console.log('This method is not supported at this time.'); -}; - -module.exports = FileReader; - -}); - -// file: lib/common/plugin/FileSystem.js -define("cordova/plugin/FileSystem", function(require, exports, module) { -var DirectoryEntry = require('cordova/plugin/DirectoryEntry'); - -/** - * An interface representing a file system - * - * @constructor - * {DOMString} name the unique name of the file system (readonly) - * {DirectoryEntry} root directory of the file system (readonly) - */ -var FileSystem = function(name, root) { - this.name = name || null; - if (root) { - this.root = new DirectoryEntry(root.name, root.fullPath); - } -}; - -module.exports = FileSystem; - -}); - -// file: lib/common/plugin/FileTransfer.js -define("cordova/plugin/FileTransfer", function(require, exports, module) { -var exec = require('cordova/exec'); - -/** - * FileTransfer uploads a file to a remote server. - * @constructor - */ -var FileTransfer = function() {}; - -/** -* Given an absolute file path, uploads a file on the device to a remote server -* using a multipart HTTP request. -* @param filePath {String} Full path of the file on the device -* @param server {String} URL of the server to receive the file -* @param successCallback (Function} Callback to be invoked when upload has completed -* @param errorCallback {Function} Callback to be invoked upon error -* @param options {FileUploadOptions} Optional parameters such as file name and mimetype -* @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false -*/ -FileTransfer.prototype.upload = function(filePath, server, successCallback, errorCallback, options, trustAllHosts) { - // check for options - var fileKey = null; - var fileName = null; - var mimeType = null; - var params = null; - var chunkedMode = true; - if (options) { - fileKey = options.fileKey; - fileName = options.fileName; - mimeType = options.mimeType; - if (options.chunkedMode !== null || typeof options.chunkedMode !== "undefined") { - chunkedMode = options.chunkedMode; - } - if (options.params) { - params = options.params; - } - else { - params = {}; - } - } - - exec(successCallback, errorCallback, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode]); -}; - -/** - * Downloads a file form a given URL and saves it to the specified directory. - * @param source {String} URL of the server to receive the file - * @param target {String} Full path of the file on the device - * @param successCallback (Function} Callback to be invoked when upload has completed - * @param errorCallback {Function} Callback to be invoked upon error - */ -FileTransfer.prototype.download = function(source, target, successCallback, errorCallback) { - var win = function(result) { - var entry = null; - if (result.isDirectory) { - entry = new DirectoryEntry(); - } - else if (result.isFile) { - entry = new FileEntry(); - } - entry.isDirectory = result.isDirectory; - entry.isFile = result.isFile; - entry.name = result.name; - entry.fullPath = result.fullPath; - successCallback(entry); - }; - exec(win, errorCallback, 'FileTransfer', 'download', [source, target]); -}; - -module.exports = FileTransfer; - -}); - -// file: lib/common/plugin/FileTransferError.js -define("cordova/plugin/FileTransferError", function(require, exports, module) { -/** - * FileTransferError - * @constructor - */ -var FileTransferError = function(code) { - this.code = code || null; -}; - -FileTransferError.FILE_NOT_FOUND_ERR = 1; -FileTransferError.INVALID_URL_ERR = 2; -FileTransferError.CONNECTION_ERR = 3; - -module.exports = FileTransferError; - -}); - -// file: lib/common/plugin/FileUploadOptions.js -define("cordova/plugin/FileUploadOptions", function(require, exports, module) { -/** - * Options to customize the HTTP request used to upload files. - * @constructor - * @param fileKey {String} Name of file request parameter. - * @param fileName {String} Filename to be used by the server. Defaults to image.jpg. - * @param mimeType {String} Mimetype of the uploaded file. Defaults to image/jpeg. - * @param params {Object} Object with key: value params to send to the server. - */ -var FileUploadOptions = function(fileKey, fileName, mimeType, params) { - this.fileKey = fileKey || null; - this.fileName = fileName || null; - this.mimeType = mimeType || null; - this.params = params || null; -}; - -module.exports = FileUploadOptions; - -}); - -// file: lib/common/plugin/FileUploadResult.js -define("cordova/plugin/FileUploadResult", function(require, exports, module) { -/** - * FileUploadResult - * @constructor - */ -var FileUploadResult = function() { - this.bytesSent = 0; - this.responseCode = null; - this.response = null; -}; - -module.exports = FileUploadResult; - -}); - -// file: lib/common/plugin/FileWriter.js -define("cordova/plugin/FileWriter", function(require, exports, module) { -var exec = require('cordova/exec'), - FileError = require('cordova/plugin/FileError'); - ProgressEvent = require('cordova/plugin/ProgressEvent'); - -/** - * This class writes to the mobile device file system. - * - * For Android: - * The root directory is the root of the file system. - * To write to the SD card, the file name is "sdcard/my_file.txt" - * - * @constructor - * @param file {File} File object containing file properties - * @param append if true write to the end of the file, otherwise overwrite the file - */ -var FileWriter = function(file) { - this.fileName = ""; - this.length = 0; - if (file) { - this.fileName = file.fullPath || file; - this.length = file.size || 0; - } - // default is to write at the beginning of the file - this.position = 0; - - this.readyState = 0; // EMPTY - - this.result = null; - - // Error - this.error = null; - - // Event handlers - this.onwritestart = null; // When writing starts - this.onprogress = null; // While writing the file, and reporting partial file data - this.onwrite = null; // When the write has successfully completed. - this.onwriteend = null; // When the request has completed (either in success or failure). - this.onabort = null; // When the write has been aborted. For instance, by invoking the abort() method. - this.onerror = null; // When the write has failed (see errors). -}; - -// States -FileWriter.INIT = 0; -FileWriter.WRITING = 1; -FileWriter.DONE = 2; - -/** - * Abort writing file. - */ -FileWriter.prototype.abort = function() { - // check for invalid state - if (this.readyState === FileWriter.DONE || this.readyState === FileWriter.INIT) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - // set error - this.error = new FileError(FileError.ABORT_ERR); - - this.readyState = FileWriter.DONE; - - // If abort callback - if (typeof this.onabort === "function") { - this.onabort(new ProgressEvent("abort", {"target":this})); - } - - // If write end callback - if (typeof this.onwriteend === "function") { - this.onwriteend(new ProgressEvent("writeend", {"target":this})); - } -}; - -/** - * Writes data to the file - * - * @param text to be written - */ -FileWriter.prototype.write = function(text) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - // WRITING state - this.readyState = FileWriter.WRITING; - - var me = this; - - // If onwritestart callback - if (typeof me.onwritestart === "function") { - me.onwritestart(new ProgressEvent("writestart", {"target":me})); - } - - // Write file - exec( - // Success callback - function(r) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // position always increases by bytes written because file would be extended - me.position += r; - // The length of the file is now where we are done writing. - - me.length = me.position; - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwrite callback - if (typeof me.onwrite === "function") { - me.onwrite(new ProgressEvent("write", {"target":me})); - } - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - me.onwriteend(new ProgressEvent("writeend", {"target":me})); - } - }, - // Error callback - function(e) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // DONE state - me.readyState = FileWriter.DONE; - - // Save error - me.error = new FileError(e); - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror(new ProgressEvent("error", {"target":me})); - } - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - me.onwriteend(new ProgressEvent("writeend", {"target":me})); - } - }, "File", "write", [this.fileName, text, this.position]); -}; - -/** - * Moves the file pointer to the location specified. - * - * If the offset is a negative number the position of the file - * pointer is rewound. If the offset is greater than the file - * size the position is set to the end of the file. - * - * @param offset is the location to move the file pointer to. - */ -FileWriter.prototype.seek = function(offset) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - if (!offset && offset != 0) { - return; - } - - // See back from end of file. - if (offset < 0) { - this.position = Math.max(offset + this.length, 0); - } - // Offset is bigger then file size so set position - // to the end of the file. - else if (offset > this.length) { - this.position = this.length; - } - // Offset is between 0 and file size so set the position - // to start writing. - else { - this.position = offset; - } -}; - -/** - * Truncates the file to the size specified. - * - * @param size to chop the file at. - */ -FileWriter.prototype.truncate = function(size) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - // WRITING state - this.readyState = FileWriter.WRITING; - - var me = this; - - // If onwritestart callback - if (typeof me.onwritestart === "function") { - me.onwritestart(new ProgressEvent("writestart", {"target":this})); - } - - // Write file - exec( - // Success callback - function(r) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // DONE state - me.readyState = FileWriter.DONE; - - // Update the length of the file - me.length = r; - me.position = Math.min(me.position, r); - - // If onwrite callback - if (typeof me.onwrite === "function") { - me.onwrite(new ProgressEvent("write", {"target":me})); - } - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - me.onwriteend(new ProgressEvent("writeend", {"target":me})); - } - }, - // Error callback - function(e) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // DONE state - me.readyState = FileWriter.DONE; - - // Save error - me.error = new FileError(e); - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror(new ProgressEvent("error", {"target":me})); - } - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - me.onwriteend(new ProgressEvent("writeend", {"target":me})); - } - }, "File", "truncate", [this.fileName, size]); -}; - -module.exports = FileWriter; - -}); - -// file: lib/common/plugin/Flags.js -define("cordova/plugin/Flags", function(require, exports, module) { -/** - * Supplies arguments to methods that lookup or create files and directories. - * - * @param create - * {boolean} file or directory if it doesn't exist - * @param exclusive - * {boolean} used with create; if true the command will fail if - * target path exists - */ -function Flags(create, exclusive) { - this.create = create || false; - this.exclusive = exclusive || false; -} - -module.exports = Flags; - -}); - -// file: lib/common/plugin/LocalFileSystem.js -define("cordova/plugin/LocalFileSystem", function(require, exports, module) { -var exec = require('cordova/exec'); - -/** - * Represents a local file system. - */ -var LocalFileSystem = function() { - -}; - -LocalFileSystem.TEMPORARY = 0; //temporary, with no guarantee of persistence -LocalFileSystem.PERSISTENT = 1; //persistent - -module.exports = LocalFileSystem; - -}); - -// file: lib/common/plugin/Media.js -define("cordova/plugin/Media", function(require, exports, module) { -var utils = require('cordova/utils'), - exec = require('cordova/exec'); - -var mediaObjects = {}; - -/** - * This class provides access to the device media, interfaces to both sound and video - * - * @constructor - * @param src The file name or url to play - * @param successCallback The callback to be called when the file is done playing or recording. - * successCallback() - * @param errorCallback The callback to be called if there is an error. - * errorCallback(int errorCode) - OPTIONAL - * @param statusCallback The callback to be called when media status has changed. - * statusCallback(int statusCode) - OPTIONAL - */ -var Media = function(src, successCallback, errorCallback, statusCallback) { - - // successCallback optional - if (successCallback && (typeof successCallback !== "function")) { - console.log("Media Error: successCallback is not a function"); - return; - } - - // errorCallback optional - if (errorCallback && (typeof errorCallback !== "function")) { - console.log("Media Error: errorCallback is not a function"); - return; - } - - // statusCallback optional - if (statusCallback && (typeof statusCallback !== "function")) { - console.log("Media Error: statusCallback is not a function"); - return; - } - - this.id = utils.createUUID(); - mediaObjects[this.id] = this; - this.src = src; - this.successCallback = successCallback; - this.errorCallback = errorCallback; - this.statusCallback = statusCallback; - this._duration = -1; - this._position = -1; - exec(null, this.errorCallback, "Media", "create", [this.id, this.src]); -}; - -// Media messages -Media.MEDIA_STATE = 1; -Media.MEDIA_DURATION = 2; -Media.MEDIA_POSITION = 3; -Media.MEDIA_ERROR = 9; - -// Media states -Media.MEDIA_NONE = 0; -Media.MEDIA_STARTING = 1; -Media.MEDIA_RUNNING = 2; -Media.MEDIA_PAUSED = 3; -Media.MEDIA_STOPPED = 4; -Media.MEDIA_MSG = ["None", "Starting", "Running", "Paused", "Stopped"]; - -// "static" function to return existing objs. -Media.get = function(id) { - return mediaObjects[id]; -}; - -/** - * Start or resume playing audio file. - */ -Media.prototype.play = function(options) { - exec(null, null, "Media", "startPlayingAudio", [this.id, this.src, options]); -}; - -/** - * Stop playing audio file. - */ -Media.prototype.stop = function() { - var me = this; - exec(function() { - me._position = 0; - me.successCallback(); - }, this.errorCallback, "Media", "stopPlayingAudio", [this.id]); -}; - -/** - * Seek or jump to a new time in the track.. - */ -Media.prototype.seekTo = function(milliseconds) { - var me = this; - exec(function(p) { - me._position = p; - }, this.errorCallback, "Media", "seekToAudio", [this.id, milliseconds]); -}; - -/** - * Pause playing audio file. - */ -Media.prototype.pause = function() { - exec(null, this.errorCallback, "Media", "pausePlayingAudio", [this.id]); -}; - -/** - * Get duration of an audio file. - * The duration is only set for audio that is playing, paused or stopped. - * - * @return duration or -1 if not known. - */ -Media.prototype.getDuration = function() { - return this._duration; -}; - -/** - * Get position of audio. - */ -Media.prototype.getCurrentPosition = function(success, fail) { - var me = this; - exec(function(p) { - me._position = p; - success(p); - }, fail, "Media", "getCurrentPositionAudio", [this.id]); -}; - -/** - * Start recording audio file. - */ -Media.prototype.startRecord = function() { - exec(this.successCallback, this.errorCallback, "Media", "startRecordingAudio", [this.id, this.src]); -}; - -/** - * Stop recording audio file. - */ -Media.prototype.stopRecord = function() { - exec(this.successCallback, this.errorCallback, "Media", "stopRecordingAudio", [this.id]); -}; - -/** - * Release the resources. - */ -Media.prototype.release = function() { - exec(null, this.errorCallback, "Media", "release", [this.id]); -}; - -/** - * Adjust the volume. - */ -Media.prototype.setVolume = function(volume) { - exec(null, null, "Media", "setVolume", [this.id, volume]); -}; - -/** - * Audio has status update. - * PRIVATE - * - * @param id The media object id (string) - * @param status The status code (int) - * @param msg The status message (string) - */ -Media.onStatus = function(id, msg, value) { - var media = mediaObjects[id]; - // If state update - if (msg === Media.MEDIA_STATE) { - if (value === Media.MEDIA_STOPPED) { - if (media.successCallback) { - media.successCallback(); - } - } - if (media.statusCallback) { - media.statusCallback(value); - } - } - else if (msg === Media.MEDIA_DURATION) { - media._duration = value; - } - else if (msg === Media.MEDIA_ERROR) { - if (media.errorCallback) { - // value should be a MediaError object when msg == MEDIA_ERROR - media.errorCallback(value); - } - } - else if (msg === Media.MEDIA_POSITION) { - media._position = value; - } -}; - -module.exports = Media; - -}); - -// file: lib/common/plugin/MediaError.js -define("cordova/plugin/MediaError", function(require, exports, module) { -/** - * This class contains information about any Media errors. - * @constructor - */ -var MediaError = function(code, msg) { - this.code = (code !== undefined ? code : null); - this.message = msg || ""; -}; - -MediaError.MEDIA_ERR_NONE_ACTIVE = 0; -MediaError.MEDIA_ERR_ABORTED = 1; -MediaError.MEDIA_ERR_NETWORK = 2; -MediaError.MEDIA_ERR_DECODE = 3; -MediaError.MEDIA_ERR_NONE_SUPPORTED = 4; - -module.exports = MediaError; - -}); - -// file: lib/common/plugin/MediaFile.js -define("cordova/plugin/MediaFile", function(require, exports, module) { -var utils = require('cordova/utils'), - exec = require('cordova/exec'), - File = require('cordova/plugin/File'), - CaptureError = require('cordova/plugin/CaptureError'); -/** - * Represents a single file. - * - * name {DOMString} name of the file, without path information - * fullPath {DOMString} the full path of the file, including the name - * type {DOMString} mime type - * lastModifiedDate {Date} last modified date - * size {Number} size of the file in bytes - */ -var MediaFile = function(name, fullPath, type, lastModifiedDate, size){ - MediaFile.__super__.constructor.apply(this, arguments); -}; - -utils.extend(MediaFile, File); - -/** - * Request capture format data for a specific file and type - * - * @param {Function} successCB - * @param {Function} errorCB - */ -MediaFile.prototype.getFormatData = function(successCallback, errorCallback) { - if (typeof this.fullPath === "undefined" || this.fullPath === null) { - errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT)); - } else { - exec(successCallback, errorCallback, "Capture", "getFormatData", [this.fullPath, this.type]); - } -}; - -/** - * Casts a PluginResult message property (array of objects) to an array of MediaFile objects - * (used in Objective-C and Android) - * - * @param {PluginResult} pluginResult - */ -MediaFile.cast = function(pluginResult) { - var mediaFiles = []; - var i; - for (i=0; i.dispatchEvent - // need to first figure out how to implement EventTarget - } - } - return event; - }; - try { - var ev = createEvent({type:"abort",target:document}); - return function ProgressEvent(type, data) { - data.type = type; - return createEvent(data); - }; - } catch(e){ - */ - return function ProgressEvent(type, dict) { - this.type = type; - this.bubbles = false; - this.cancelBubble = false; - this.cancelable = false; - this.lengthComputable = false; - this.loaded = dict && dict.loaded ? dict.loaded : 0; - this.total = dict && dict.total ? dict.total : 0; - this.target = dict && dict.target ? dict.target : null; - }; - //} -})(); - -module.exports = ProgressEvent; - -}); - -// file: lib/common/plugin/accelerometer.js -define("cordova/plugin/accelerometer", function(require, exports, module) { -/** - * This class provides access to device accelerometer data. - * @constructor - */ -var utils = require("cordova/utils"), - exec = require("cordova/exec"); - -// Local singleton variables. -var timers = {}; - -var accelerometer = { - /** - * Asynchronously aquires the current acceleration. - * - * @param {Function} successCallback The function to call when the acceleration data is available - * @param {Function} errorCallback The function to call when there is an error getting the acceleration data. (OPTIONAL) - * @param {AccelerationOptions} options The options for getting the accelerometer data such as timeout. (OPTIONAL) - */ - getCurrentAcceleration: function(successCallback, errorCallback, options) { - - // successCallback required - if (typeof successCallback !== "function") { - console.log("Accelerometer Error: successCallback is not a function"); - return; - } - - // errorCallback optional - if (errorCallback && (typeof errorCallback !== "function")) { - console.log("Accelerometer Error: errorCallback is not a function"); - return; - } - - // Get acceleration - exec(successCallback, errorCallback, "Accelerometer", "getAcceleration", []); - }, - - /** - * Asynchronously aquires the acceleration repeatedly at a given interval. - * - * @param {Function} successCallback The function to call each time the acceleration data is available - * @param {Function} errorCallback The function to call when there is an error getting the acceleration data. (OPTIONAL) - * @param {AccelerationOptions} options The options for getting the accelerometer data such as timeout. (OPTIONAL) - * @return String The watch id that must be passed to #clearWatch to stop watching. - */ - watchAcceleration: function(successCallback, errorCallback, options) { - - // Default interval (10 sec) - var frequency = (options !== undefined && options.frequency !== undefined)? options.frequency : 10000; - - // successCallback required - if (typeof successCallback !== "function") { - console.log("Accelerometer Error: successCallback is not a function"); - return; - } - - // errorCallback optional - if (errorCallback && (typeof errorCallback !== "function")) { - console.log("Accelerometer Error: errorCallback is not a function"); - return; - } - - // Make sure accelerometer timeout > frequency + 10 sec - exec( - function(timeout) { - if (timeout < (frequency + 10000)) { - exec(null, null, "Accelerometer", "setTimeout", [frequency + 10000]); - } - }, - function(e) { }, "Accelerometer", "getTimeout", []); - - // Start watch timer - var id = utils.createUUID(); - timers[id] = window.setInterval(function() { - exec(successCallback, errorCallback, "Accelerometer", "getAcceleration", []); - }, (frequency ? frequency : 1)); - - return id; - }, - - /** - * Clears the specified accelerometer watch. - * - * @param {String} id The id of the watch returned from #watchAcceleration. - */ - clearWatch: function(id) { - - // Stop javascript timer & remove from timer list - if (id && timers[id] !== undefined) { - window.clearInterval(timers[id]); - delete timers[id]; - } - } -}; - -module.exports = accelerometer; - -}); - -// file: lib/common/plugin/battery.js -define("cordova/plugin/battery", function(require, exports, module) { -/** - * This class contains information about the current battery status. - * @constructor - */ -var cordova = require('cordova'), - exec = require('cordova/exec'); - -function handlers() { - return battery.channels.batterystatus.numHandlers + - battery.channels.batterylow.numHandlers + - battery.channels.batterycritical.numHandlers; -} - -var Battery = function() { - this._level = null; - this._isPlugged = null; - // Create new event handlers on the window (returns a channel instance) - var subscriptionEvents = { - onSubscribe:this.onSubscribe, - onUnsubscribe:this.onUnsubscribe - }; - this.channels = { - batterystatus:cordova.addWindowEventHandler("batterystatus", subscriptionEvents), - batterylow:cordova.addWindowEventHandler("batterylow", subscriptionEvents), - batterycritical:cordova.addWindowEventHandler("batterycritical", subscriptionEvents) - }; -}; -/** - * Event handlers for when callbacks get registered for the battery. - * Keep track of how many handlers we have so we can start and stop the native battery listener - * appropriately (and hopefully save on battery life!). - */ -Battery.prototype.onSubscribe = function() { - var me = battery; - // If we just registered the first handler, make sure native listener is started. - if (handlers() === 1) { - exec(me._status, me._error, "Battery", "start", []); - } -}; - -Battery.prototype.onUnsubscribe = function() { - var me = battery; - - // If we just unregistered the last handler, make sure native listener is stopped. - if (handlers() === 0) { - exec(null, null, "Battery", "stop", []); - } -}; - -/** - * Callback for battery status - * - * @param {Object} info keys: level, isPlugged - */ -Battery.prototype._status = function(info) { - if (info) { - var me = battery; - var level = info.level; - if (me._level !== level || me._isPlugged !== info.isPlugged) { - // Fire batterystatus event - cordova.fireWindowEvent("batterystatus", info); - - // Fire low battery event - if (level === 20 || level === 5) { - if (level === 20) { - cordova.fireWindowEvent("batterylow", info); - } - else { - cordova.fireWindowEvent("batterycritical", info); - } - } - } - me._level = level; - me._isPlugged = info.isPlugged; - } -}; - -/** - * Error callback for battery start - */ -Battery.prototype._error = function(e) { - console.log("Error initializing Battery: " + e); -}; - -var battery = new Battery(); - -module.exports = battery; - -}); - -// file: lib/common/plugin/capture.js -define("cordova/plugin/capture", function(require, exports, module) { -var exec = require('cordova/exec'), - MediaFile = require('cordova/plugin/MediaFile'); - -/** - * Launches a capture of different types. - * - * @param (DOMString} type - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureVideoOptions} options - */ -function _capture(type, successCallback, errorCallback, options) { - var win = function(pluginResult) { - var mediaFiles = []; - var i; - for (i = 0; i < pluginResult.length; i++) { - var mediaFile = new MediaFile(); - mediaFile.name = pluginResult[i].name; - mediaFile.fullPath = pluginResult[i].fullPath; - mediaFile.type = pluginResult[i].type; - mediaFile.lastModifiedDate = pluginResult[i].lastModifiedDate; - mediaFile.size = pluginResult[i].size; - mediaFiles.push(mediaFile); - } - successCallback(mediaFiles); - }; - exec(win, errorCallback, "Capture", type, [options]); -} -/** - * The Capture interface exposes an interface to the camera and microphone of the hosting device. - */ -function Capture() { - this.supportedAudioModes = []; - this.supportedImageModes = []; - this.supportedVideoModes = []; -} - -/** - * Launch audio recorder application for recording audio clip(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureAudioOptions} options - */ -Capture.prototype.captureAudio = function(successCallback, errorCallback, options){ - _capture("captureAudio", successCallback, errorCallback, options); -}; - -/** - * Launch camera application for taking image(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureImageOptions} options - */ -Capture.prototype.captureImage = function(successCallback, errorCallback, options){ - _capture("captureImage", successCallback, errorCallback, options); -}; - -/** - * Launch device camera application for recording video(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureVideoOptions} options - */ -Capture.prototype.captureVideo = function(successCallback, errorCallback, options){ - _capture("captureVideo", successCallback, errorCallback, options); -}; - - -module.exports = new Capture(); - -}); - -// file: lib/common/plugin/compass.js -define("cordova/plugin/compass", function(require, exports, module) { -var exec = require('cordova/exec'), - utils = require('cordova/utils'), - CompassHeading = require('cordova/plugin/CompassHeading'), - CompassError = require('cordova/plugin/CompassError'), - timers = {}, - compass = { - /** - * Asynchronously acquires the current heading. - * @param {Function} successCallback The function to call when the heading - * data is available - * @param {Function} errorCallback The function to call when there is an error - * getting the heading data. - * @param {CompassOptions} options The options for getting the heading data (not used). - */ - getCurrentHeading:function(successCallback, errorCallback, options) { - // successCallback required - if (typeof successCallback !== "function") { - console.log("Compass Error: successCallback is not a function"); - return; - } - - // errorCallback optional - if (errorCallback && (typeof errorCallback !== "function")) { - console.log("Compass Error: errorCallback is not a function"); - return; - } - - var win = function(result) { - var ch = new CompassHeading(result.magneticHeading, result.trueHeading, result.headingAccuracy, result.timestamp); - successCallback(ch); - }; - var fail = function(code) { - var ce = new CompassError(code); - errorCallback(ce); - } - - // Get heading - exec(win, fail, "Compass", "getHeading", [options]); - }, - - /** - * Asynchronously acquires the heading repeatedly at a given interval. - * @param {Function} successCallback The function to call each time the heading - * data is available - * @param {Function} errorCallback The function to call when there is an error - * getting the heading data. - * @param {HeadingOptions} options The options for getting the heading data - * such as timeout and the frequency of the watch. For iOS, filter parameter - * specifies to watch via a distance filter rather than time. - */ - watchHeading:function(successCallback, errorCallback, options) { - // Default interval (100 msec) - var frequency = (options !== undefined && options.frequency !== undefined) ? options.frequency : 100; - var filter = (options !== undefined && options.filter !== undefined) ? options.filter : 0; - - // successCallback required - if (typeof successCallback !== "function") { - console.log("Compass Error: successCallback is not a function"); - return; - } - - // errorCallback optional - if (errorCallback && (typeof errorCallback !== "function")) { - console.log("Compass Error: errorCallback is not a function"); - return; - } - - var id = utils.createUUID(); - if (filter > 0) { - // is an iOS request for watch by filter, no timer needed - timers[id] = "iOS"; - compass.getCurrentHeading(successCallback, errorCallback, options); - } else { - // Start watch timer to get headings - timers[id] = window.setInterval(function() { - compass.getCurrentHeading(successCallback, errorCallback); - }, frequency); - } - - return id; - }, - - /** - * Clears the specified heading watch. - * @param {String} watchId The ID of the watch returned from #watchHeading. - */ - clearWatch:function(id) { - // Stop javascript timer & remove from timer list - if (id && timers[id]) { - if (timers[id] != "iOS") { - clearInterval(timers[id]); - } else { - // is iOS watch by filter so call into device to stop - exec(null, null, "Compass", "stopHeading", []); - } - delete timers[id]; - } - } - }; - -module.exports = compass; - -}); - -// file: lib/common/plugin/contacts.js -define("cordova/plugin/contacts", function(require, exports, module) { -var exec = require('cordova/exec'), - ContactError = require('cordova/plugin/ContactError'), - Contact = require('cordova/plugin/Contact'); - -/** -* Represents a group of Contacts. -* @constructor -*/ -var contacts = { - /** - * Returns an array of Contacts matching the search criteria. - * @param fields that should be searched - * @param successCB success callback - * @param errorCB error callback - * @param {ContactFindOptions} options that can be applied to contact searching - * @return array of Contacts matching search criteria - */ - find:function(fields, successCB, errorCB, options) { - if (!successCB) { - throw new TypeError("You must specify a success callback for the find command."); - } - if (!fields || (fields instanceof Array && fields.length === 0)) { - if (typeof errorCB === "function") { - errorCB(new ContactError(ContactError.INVALID_ARGUMENT_ERROR)); - } - } else { - var win = function(result) { - var cs = []; - for (var i = 0, l = result.length; i < l; i++) { - cs.push(contacts.create(result[i])); - } - successCB(cs); - }; - exec(win, errorCB, "Contacts", "search", [fields, options]); - } - }, - - /** - * This function creates a new contact, but it does not persist the contact - * to device storage. To persist the contact to device storage, invoke - * contact.save(). - * @param properties an object who's properties will be examined to create a new Contact - * @returns new Contact object - */ - create:function(properties) { - var i; - var contact = new Contact(); - for (i in properties) { - if (typeof contact[i] !== 'undefined' && properties.hasOwnProperty(i)) { - contact[i] = properties[i]; - } - } - return contact; - } -}; - -module.exports = contacts; - -}); - -// file: lib/common/plugin/geolocation.js -define("cordova/plugin/geolocation", function(require, exports, module) { -var utils = require('cordova/utils'), - exec = require('cordova/exec'), - PositionError = require('cordova/plugin/PositionError'), - Position = require('cordova/plugin/Position'); - -var timers = {}; // list of timers in use - -// Returns default params, overrides if provided with values -function parseParameters(options) { - var opt = { - maximumAge: 10000, - enableHighAccuracy: false, - timeout: 10000 - }; - - if (options) { - if (options.maximumAge !== undefined) { - opt.maximumAge = options.maximumAge; - } - if (options.enableHighAccuracy !== undefined) { - opt.enableHighAccuracy = options.enableHighAccuracy; - } - if (options.timeout !== undefined) { - opt.timeout = options.timeout; - } - } - - return opt; -} - -var geolocation = { - /** - * Asynchronously aquires the current position. - * - * @param {Function} successCallback The function to call when the position data is available - * @param {Function} errorCallback The function to call when there is an error getting the heading position. (OPTIONAL) - * @param {PositionOptions} options The options for getting the position data. (OPTIONAL) - */ - getCurrentPosition:function(successCallback, errorCallback, options) { - options = parseParameters(options); - - var win = function(p) { - successCallback(new Position( - { - latitude:p.latitude, - longitude:p.longitude, - altitude:p.altitude, - accuracy:p.accuracy, - heading:p.heading, - velocity:p.velocity, - altitudeAccuracy:p.altitudeAccuracy - }, - p.timestamp || new Date() - )); - }; - var fail = function(e) { - errorCallback(new PositionError(e.code, e.message)); - }; - - exec(win, fail, "Geolocation", "getLocation", [options.enableHighAccuracy, options.timeout, options.maximumAge]); - }, - /** - * Asynchronously watches the geolocation for changes to geolocation. When a change occurs, - * the successCallback is called with the new location. - * - * @param {Function} successCallback The function to call each time the location data is available - * @param {Function} errorCallback The function to call when there is an error getting the location data. (OPTIONAL) - * @param {PositionOptions} options The options for getting the location data such as frequency. (OPTIONAL) - * @return String The watch id that must be passed to #clearWatch to stop watching. - */ - watchPosition:function(successCallback, errorCallback, options) { - options = parseParameters(options); - - var id = utils.createUUID(); - timers[id] = window.setInterval(function() { - geolocation.getCurrentPosition(successCallback, errorCallback, options); - }, options.timeout); - - return id; - }, - /** - * Clears the specified heading watch. - * - * @param {String} id The ID of the watch returned from #watchPosition - */ - clearWatch:function(id) { - if (id && timers[id] !== undefined) { - window.clearInterval(timers[id]); - delete timers[id]; - } - } -}; - -module.exports = geolocation; - -}); - -// file: lib/ios/plugin/ios/Contact.js -define("cordova/plugin/ios/Contact", function(require, exports, module) { -var exec = require('cordova/exec'), - ContactError = require('cordova/plugin/ContactError'); - -/** - * Provides iOS Contact.display API. - */ -module.exports = { - display : function(errorCB, options) { - /* - * Display a contact using the iOS Contact Picker UI - * NOT part of W3C spec so no official documentation - * - * @param errorCB error callback - * @param options object - * allowsEditing: boolean AS STRING - * "true" to allow editing the contact - * "false" (default) display contact - */ - - if (this.id == null) { - if (typeof errorCB === "function") { - var errorObj = new ContactError(ContactError.UNKNOWN_ERROR); - errorCB(errorObj); - } - } - else { - exec(null, errorCB, "Contacts","displayContact", [this.id, options]); - } - } -}; -}); - -// file: lib/ios/plugin/ios/Entry.js -define("cordova/plugin/ios/Entry", function(require, exports, module) { -module.exports = { - toURL:function() { - // TODO: refactor path in a cross-platform way so we can eliminate - // these kinds of platform-specific hacks. - return "file://localhost" + this.fullPath; - }, - toURI: function() { - console.log("DEPRECATED: Update your code to use 'toURL'"); - return "file://localhost" + this.fullPath; - } -}; - -}); - -// file: lib/ios/plugin/ios/FileReader.js -define("cordova/plugin/ios/FileReader", function(require, exports, module) { -var exec = require('cordova/exec'), - FileError = require('cordova/plugin/FileError'), - FileReader = require('cordova/plugin/FileReader'), - ProgressEvent = require('cordova/plugin/ProgressEvent'); - -module.exports = { - readAsText:function(file, encoding) { - // Figure out pathing - this.fileName = ''; - if (typeof file.fullPath === 'undefined') { - this.fileName = file; - } else { - this.fileName = file.fullPath; - } - - // Already loading something - if (this.readyState == FileReader.LOADING) { - throw new FileError(FileError.INVALID_STATE_ERR); - } - - // LOADING state - this.readyState = FileReader.LOADING; - - // If loadstart callback - if (typeof this.onloadstart === "function") { - this.onloadstart(new ProgressEvent("loadstart", {target:this})); - } - - // Default encoding is UTF-8 - var enc = encoding ? encoding : "UTF-8"; - - var me = this; - - // Read file - exec( - // Success callback - function(r) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileReader.DONE) { - return; - } - - // Save result - me.result = decodeURIComponent(r); - - // If onload callback - if (typeof me.onload === "function") { - me.onload(new ProgressEvent("load", {target:me})); - } - - // DONE state - me.readyState = FileReader.DONE; - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, - // Error callback - function(e) { - // If DONE (cancelled), then don't do anything - if (me.readyState === FileReader.DONE) { - return; - } - - // DONE state - me.readyState = FileReader.DONE; - - // null result - me.result = null; - - // Save error - me.error = new FileError(e); - - // If onerror callback - if (typeof me.onerror === "function") { - me.onerror(new ProgressEvent("error", {target:me})); - } - - // If onloadend callback - if (typeof me.onloadend === "function") { - me.onloadend(new ProgressEvent("loadend", {target:me})); - } - }, - "File", "readAsText", [this.fileName, enc]); - } -} - -}); - -// file: lib/ios/plugin/ios/console.js -define("cordova/plugin/ios/console", function(require, exports, module) { -var exec = require('cordova/exec'); - -/** - * String indentation/formatting - */ -function indent(str) { - return str.replace(/^/mg, " "); -} -/** - * Format a string for pretty logging - */ -function makeStructured(obj, depth) { - var str = ""; - for (var i in obj) { - try { - if (typeof(obj[i]) == 'object' && depth < maxDepth) { - str += i + ":\n" + indent(makeStructured(obj[i])) + "\n"; - } else { - str += i + " = " + indent(String(obj[i])).replace(/^ {4}/, "") + "\n"; - } - } catch(e) { - str += i + " = EXCEPTION: " + e.message + "\n"; - } - } - return str; -} - -/** - * This class provides access to the debugging console. - * @constructor - */ -var DebugConsole = function() { - this.winConsole = window.console; - this.logLevel = DebugConsole.INFO_LEVEL; -}; - -// from most verbose, to least verbose -DebugConsole.ALL_LEVEL = 1; // same as first level -DebugConsole.INFO_LEVEL = 1; -DebugConsole.WARN_LEVEL = 2; -DebugConsole.ERROR_LEVEL = 4; -DebugConsole.NONE_LEVEL = 8; - -DebugConsole.prototype.setLevel = function(level) { - this.logLevel = level; -}; - -/** - * Utility function for rendering and indenting strings, or serializing - * objects to a string capable of being printed to the console. - * @param {Object|String} message The string or object to convert to an indented string - * @private - */ -DebugConsole.prototype.processMessage = function(message, maxDepth) { - if (maxDepth === undefined) maxDepth = 0; - if (typeof(message) != 'object') { - return (this.isDeprecated ? "WARNING: debug object is deprecated, please use console object \n" + message : message); - } else { - return ("Object:\n" + makeStructured(message, maxDepth)); - } -}; - -/** - * Print a normal log message to the console - * @param {Object|String} message Message or object to print to the console - */ -DebugConsole.prototype.log = function(message, maxDepth) { - if (this.logLevel <= DebugConsole.INFO_LEVEL) - exec(null, null, 'Debug Console', 'log', - [ this.processMessage(message, maxDepth), { logLevel: 'INFO' } ] - ); - else - this.winConsole.log(message); -}; - -/** - * Print a warning message to the console - * @param {Object|String} message Message or object to print to the console - */ -DebugConsole.prototype.warn = function(message, maxDepth) { - if (this.logLevel <= DebugConsole.WARN_LEVEL) - exec(null, null, 'Debug Console', 'log', - [ this.processMessage(message, maxDepth), { logLevel: 'WARN' } ] - ); - else - this.winConsole.error(message); -}; - -/** - * Print an error message to the console - * @param {Object|String} message Message or object to print to the console - */ -DebugConsole.prototype.error = function(message, maxDepth) { - if (this.logLevel <= DebugConsole.ERROR_LEVEL) - exec(null, null, 'Debug Console', 'log', - [ this.processMessage(message, maxDepth), { logLevel: 'ERROR' } ] - ); - else - this.winConsole.error(message); -}; - -module.exports = new DebugConsole(); - -}); - -// file: lib/ios/plugin/ios/contacts.js -define("cordova/plugin/ios/contacts", function(require, exports, module) { -var exec = require('cordova/exec'); - -/** - * Provides iOS enhanced contacts API. - */ -module.exports = { - newContactUI : function(successCallback) { - /* - * Create a contact using the iOS Contact Picker UI - * NOT part of W3C spec so no official documentation - * - * returns: the id of the created contact as param to successCallback - */ - exec(successCallback, null, "Contacts","newContact", []); - }, - chooseContact : function(successCallback, options) { - /* - * Select a contact using the iOS Contact Picker UI - * NOT part of W3C spec so no official documentation - * - * @param errorCB error callback - * @param options object - * allowsEditing: boolean AS STRING - * "true" to allow editing the contact - * "false" (default) display contact - * - * returns: the id of the selected contact as param to successCallback - */ - exec(successCallback, null, "Contacts","chooseContact", [options]); - } -}; -}); - -// file: lib/ios/plugin/ios/device.js -define("cordova/plugin/ios/device", function(require, exports, module) { -/** - * this represents the mobile device, and provides properties for inspecting the model, version, UUID of the - * phone, etc. - * @constructor - */ -var exec = require('cordova/exec'), - utils = require('cordova/utils'), - channel = require('cordova/channel'); - -var Device = function() { - this.platform = null; - this.version = null; - this.name = null; - this.cordova = null; - this.uuid = null; -}; - -Device.prototype.setInfo = function(info) { - try { - this.platform = info.platform; - this.version = info.version; - this.name = info.name; - this.cordova = info.gap; - this.uuid = info.uuid; - channel.onCordovaInfoReady.fire(); - } catch(e) { - utils.alert('Error during device info setting in cordova/plugin/ios/device!'); - } -}; - -module.exports = new Device(); - -}); - -// file: lib/ios/plugin/ios/nativecomm.js -define("cordova/plugin/ios/nativecomm", function(require, exports, module) { -var cordova = require('cordova'); - -/** - * Called by native code to retrieve all queued commands and clear the queue. - */ -module.exports = function() { - var json = JSON.stringify(cordova.commandQueue); - cordova.commandQueue = []; - return json; -}; - -}); - -// file: lib/ios/plugin/ios/notification.js -define("cordova/plugin/ios/notification", function(require, exports, module) { -var Media = require('cordova/plugin/Media'); - -module.exports = { - beep:function(count) { - (new Media('beep.wav')).play(); - } -} - -}); - -// file: lib/common/plugin/network.js -define("cordova/plugin/network", function(require, exports, module) { -var exec = require('cordova/exec'), - cordova = require('cordova'), - channel = require('cordova/channel'); - -var NetworkConnection = function () { - this.type = null; - this._firstRun = true; - this._timer = null; - this.timeout = 500; - - var me = this; - - channel.onCordovaReady.subscribeOnce(function() { - me.getInfo(function (info) { - me.type = info; - if (info === "none") { - // set a timer if still offline at the end of timer send the offline event - me._timer = setTimeout(function(){ - cordova.fireDocumentEvent("offline"); - me._timer = null; - }, me.timeout); - } else { - // If there is a current offline event pending clear it - if (me._timer !== null) { - clearTimeout(me._timer); - me._timer = null; - } - cordova.fireDocumentEvent("online"); - } - - // should only fire this once - if (me._firstRun) { - me._firstRun = false; - channel.onCordovaConnectionReady.fire(); - } - }, - function (e) { - // If we can't get the network info we should still tell Cordova - // to fire the deviceready event. - if (me._firstRun) { - me._firstRun = false; - channel.onCordovaConnectionReady.fire(); - } - console.log("Error initializing Network Connection: " + e); - }); - }); -}; - -/** - * Get connection info - * - * @param {Function} successCallback The function to call when the Connection data is available - * @param {Function} errorCallback The function to call when there is an error getting the Connection data. (OPTIONAL) - */ -NetworkConnection.prototype.getInfo = function (successCallback, errorCallback) { - // Get info - exec(successCallback, errorCallback, "NetworkStatus", "getConnectionInfo", []); -}; - -module.exports = new NetworkConnection(); - -}); - -// file: lib/common/plugin/notification.js -define("cordova/plugin/notification", function(require, exports, module) { -var exec = require('cordova/exec'); - -/** - * Provides access to notifications on the device. - */ - -module.exports = { - - /** - * Open a native alert dialog, with a customizable title and button text. - * - * @param {String} message Message to print in the body of the alert - * @param {Function} completeCallback The callback that is called when user clicks on a button. - * @param {String} title Title of the alert dialog (default: Alert) - * @param {String} buttonLabel Label of the close button (default: OK) - */ - alert: function(message, completeCallback, title, buttonLabel) { - var _title = (title || "Alert"); - var _buttonLabel = (buttonLabel || "OK"); - exec(completeCallback, null, "Notification", "alert", [message, _title, _buttonLabel]); - }, - - /** - * Open a native confirm dialog, with a customizable title and button text. - * The result that the user selects is returned to the result callback. - * - * @param {String} message Message to print in the body of the alert - * @param {Function} resultCallback The callback that is called when user clicks on a button. - * @param {String} title Title of the alert dialog (default: Confirm) - * @param {String} buttonLabels Comma separated list of the labels of the buttons (default: 'OK,Cancel') - */ - confirm: function(message, resultCallback, title, buttonLabels) { - var _title = (title || "Confirm"); - var _buttonLabels = (buttonLabels || "OK,Cancel"); - exec(resultCallback, null, "Notification", "confirm", [message, _title, _buttonLabels]); - }, - - /** - * Causes the device to vibrate. - * - * @param {Integer} mills The number of milliseconds to vibrate for. - */ - vibrate: function(mills) { - exec(null, null, "Notification", "vibrate", [mills]); - }, - - /** - * Causes the device to beep. - * On Android, the default notification ringtone is played "count" times. - * - * @param {Integer} count The number of beeps. - */ - beep: function(count) { - exec(null, null, "Notification", "beep", [count]); - } -}; - -}); - -// file: lib/common/plugin/requestFileSystem.js -define("cordova/plugin/requestFileSystem", function(require, exports, module) { -var FileError = require('cordova/plugin/FileError'), - FileSystem = require('cordova/plugin/FileSystem'), - exec = require('cordova/exec'); - -/** - * Request a file system in which to store application data. - * @param type local file system type - * @param size indicates how much storage space, in bytes, the application expects to need - * @param successCallback invoked with a FileSystem object - * @param errorCallback invoked if error occurs retrieving file system - */ -var requestFileSystem = function(type, size, successCallback, errorCallback) { - var fail = function(code) { - if (typeof errorCallback === 'function') { - errorCallback(new FileError(code)); - } - }; - - if (type < 0 || type > 3) { - fail(FileError.SYNTAX_ERR); - } else { - // if successful, return a FileSystem object - var success = function(file_system) { - if (file_system) { - if (typeof successCallback === 'function') { - // grab the name and root from the file system object - var result = new FileSystem(file_system.name, file_system.root); - successCallback(result); - } - } - else { - // no FileSystem object returned - fail(FileError.NOT_FOUND_ERR); - } - }; - exec(success, fail, "File", "requestFileSystem", [type, size]); - } -}; - -module.exports = requestFileSystem; - -}); - -// file: lib/common/plugin/resolveLocalFileSystemURI.js -define("cordova/plugin/resolveLocalFileSystemURI", function(require, exports, module) { -var DirectoryEntry = require('cordova/plugin/DirectoryEntry'), - FileEntry = require('cordova/plugin/FileEntry'), - exec = require('cordova/exec'); - -/** - * Look up file system Entry referred to by local URI. - * @param {DOMString} uri URI referring to a local file or directory - * @param successCallback invoked with Entry object corresponding to URI - * @param errorCallback invoked if error occurs retrieving file system entry - */ -module.exports = function(uri, successCallback, errorCallback) { - // error callback - var fail = function(error) { - if (typeof errorCallback === 'function') { - errorCallback(new FileError(error)); - } - }; - // if successful, return either a file or directory entry - var success = function(entry) { - var result; - - if (entry) { - if (typeof successCallback === 'function') { - // create appropriate Entry object - result = (entry.isDirectory) ? new DirectoryEntry(entry.name, entry.fullPath) : new FileEntry(entry.name, entry.fullPath); - try { - successCallback(result); - } - catch (e) { - console.log('Error invoking callback: ' + e); - } - } - } - else { - // no Entry object returned - fail(FileError.NOT_FOUND_ERR); - } - }; - - exec(success, fail, "File", "resolveLocalFileSystemURI", [uri]); -}; - -}); - -// file: lib/common/utils.js -define("cordova/utils", function(require, exports, module) { -function UUIDcreatePart(length) { - var uuidpart = ""; - for (var i=0; i - - - - - - - - - - - - - - -

Hey, it's Cordova!

-

Don't know how to get started? Check out our Getting Started Guide -
-

    -
  1. Check your console log for any white-list rejection errors.
  2. -
  3. Add your allowed hosts in Cordova.plist/ExternalHosts (wildcards OK, don't enter the URL scheme)
  4. -
- - diff --git a/iOS/phonegap/example/www/css/style.css b/iOS/phonegap/example/www/css/style.css deleted file mode 100644 index 8ea9325..0000000 --- a/iOS/phonegap/example/www/css/style.css +++ /dev/null @@ -1,68 +0,0 @@ -*{ - margin:0px; -} -body { - height:100%; - width:100%; - font-family:'helvetica'; - font-size:12px; -} -#header { - width:320px; - position:relative; - top:0px; - left:0px; - margin-bottom:10px; -} -#wrapper { - width:100%; - margin:auto; - position:relative; -} -#buttons { - width:310px; - margin:auto; -} -.btn { - width:auto; - padding:10px; - background-color:#95abb7; - color:#fff; - font-size:15px; - border-radius:5px; - margin-bottom:10px; - font-weight:bold; - text-align:center; -} -.photo { - height:310px; - width:310px; - overflow:hidden; - position:relative; - margin:auto; - display:none; - margin-bottom:10px; -} -.photo img { - height:310px; - width:310px; -} -.filterIcon { - height:70px; - width:70px; - border-radius:5px; - overflow:hidden; - box-shadow:0px 0px 2px #222; -} -.filterText { - color:#222; - width:70px; - text-align:center; -} -.filter { - text-align:center; - width:70px; - float:left; - margin-right:10px; - margin-left:10px; -} \ No newline at end of file diff --git a/iOS/phonegap/example/www/images/filters/none.png b/iOS/phonegap/example/www/images/filters/none.png deleted file mode 100644 index e17ea9b..0000000 Binary files a/iOS/phonegap/example/www/images/filters/none.png and /dev/null differ diff --git a/iOS/phonegap/example/www/images/filters/stark.png b/iOS/phonegap/example/www/images/filters/stark.png deleted file mode 100644 index 9fe311a..0000000 Binary files a/iOS/phonegap/example/www/images/filters/stark.png and /dev/null differ diff --git a/iOS/phonegap/example/www/images/filters/sunnySide.png b/iOS/phonegap/example/www/images/filters/sunnySide.png deleted file mode 100644 index b73afe9..0000000 Binary files a/iOS/phonegap/example/www/images/filters/sunnySide.png and /dev/null differ diff --git a/iOS/phonegap/example/www/images/filters/vintage.png b/iOS/phonegap/example/www/images/filters/vintage.png deleted file mode 100644 index 66618c8..0000000 Binary files a/iOS/phonegap/example/www/images/filters/vintage.png and /dev/null differ diff --git a/iOS/phonegap/example/www/images/filters/worn.png b/iOS/phonegap/example/www/images/filters/worn.png deleted file mode 100644 index c5cd994..0000000 Binary files a/iOS/phonegap/example/www/images/filters/worn.png and /dev/null differ diff --git a/iOS/phonegap/example/www/images/header.png b/iOS/phonegap/example/www/images/header.png deleted file mode 100644 index c8b4f49..0000000 Binary files a/iOS/phonegap/example/www/images/header.png and /dev/null differ diff --git a/iOS/phonegap/example/www/index.html b/iOS/phonegap/example/www/index.html deleted file mode 100644 index 34d7c98..0000000 --- a/iOS/phonegap/example/www/index.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
-
use camera
-
use library
-
- - - -
- -
- -
-
-
-
none
-
-
-
-
sunnySide
-
-
-
-
worn
-
-
-
-
vintage
-
-
-
-
stark
-
-
-
- - - -
-
- - diff --git a/iOS/phonegap/example/www/js/core/jQuery.js b/iOS/phonegap/example/www/js/core/jQuery.js deleted file mode 100644 index 198b3ff..0000000 --- a/iOS/phonegap/example/www/js/core/jQuery.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.7.1 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; -f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() -{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/iOS/phonegap/example/www/js/core/phonegap-1.2.0.js b/iOS/phonegap/example/www/js/core/phonegap-1.2.0.js deleted file mode 100644 index 31506d7..0000000 --- a/iOS/phonegap/example/www/js/core/phonegap-1.2.0.js +++ /dev/null @@ -1,4098 +0,0 @@ -/* - * PhoneGap v1.2.0 is available under *either* the terms of the modified BSD license *or* the - * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text. - * - * Copyright (c) 2005-2010, Nitobi Software Inc. - * Copyright (c) 2010-2011, IBM Corporation - * Copyright (c) 2011, Codevise Solutions Ltd. - * Copyright (c) 2011, Proyectos Equis Ka, S.L. - * - */ - -if (typeof PhoneGap === "undefined") { - -if (typeof(DeviceInfo) !== 'object'){ - DeviceInfo = {}; -} -/** - * This represents the PhoneGap API itself, and provides a global namespace for accessing - * information about the state of PhoneGap. - * @class - */ -PhoneGap = { - // This queue holds the currently executing command and all pending - // commands executed with PhoneGap.exec(). - commandQueue: [], - // Indicates if we're currently in the middle of flushing the command - // queue on the native side. - commandQueueFlushing: false, - _constructors: [], - documentEventHandler: {}, // Collection of custom document event handlers - windowEventHandler: {} -}; - -/** - * List of resource files loaded by PhoneGap. - * This is used to ensure JS and other files are loaded only once. - */ -PhoneGap.resources = {base: true}; - -/** - * Determine if resource has been loaded by PhoneGap - * - * @param name - * @return - */ -PhoneGap.hasResource = function(name) { - return PhoneGap.resources[name]; -}; - -/** - * Add a resource to list of loaded resources by PhoneGap - * - * @param name - */ -PhoneGap.addResource = function(name) { - PhoneGap.resources[name] = true; -}; - -/** - * Boolean flag indicating if the PhoneGap API is available and initialized. - */ // TODO: Remove this, it is unused here ... -jm -PhoneGap.available = DeviceInfo.uuid != undefined; - -/** - * Add an initialization function to a queue that ensures it will run and initialize - * application constructors only once PhoneGap has been initialized. - * @param {Function} func The function callback you want run once PhoneGap is initialized - */ -PhoneGap.addConstructor = function(func) { - var state = document.readyState; - if ( ( state == 'loaded' || state == 'complete' ) && DeviceInfo.uuid != null ) - { - func(); - } - else - { - PhoneGap._constructors.push(func); - } -}; - -(function() - { - var timer = setInterval(function() - { - - var state = document.readyState; - - if ( ( state == 'loaded' || state == 'complete' ) && DeviceInfo.uuid != null ) - { - clearInterval(timer); // stop looking - // run our constructors list - while (PhoneGap._constructors.length > 0) - { - var constructor = PhoneGap._constructors.shift(); - try - { - constructor(); - } - catch(e) - { - if (typeof(console['log']) == 'function') - { - console.log("Failed to run constructor: " + console.processMessage(e)); - } - else - { - alert("Failed to run constructor: " + e.message); - } - } - } - // all constructors run, now fire the deviceready event - var e = document.createEvent('Events'); - e.initEvent('deviceready'); - document.dispatchEvent(e); - } - }, 1); -})(); - -// session id for calls -PhoneGap.sessionKey = 0; - -// centralized callbacks -PhoneGap.callbackId = 0; -PhoneGap.callbacks = {}; -PhoneGap.callbackStatus = { - NO_RESULT: 0, - OK: 1, - CLASS_NOT_FOUND_EXCEPTION: 2, - ILLEGAL_ACCESS_EXCEPTION: 3, - INSTANTIATION_EXCEPTION: 4, - MALFORMED_URL_EXCEPTION: 5, - IO_EXCEPTION: 6, - INVALID_ACTION: 7, - JSON_EXCEPTION: 8, - ERROR: 9 - }; - -/** - * Creates a gap bridge iframe used to notify the native code about queued - * commands. - * - * @private - */ -PhoneGap.createGapBridge = function() { - gapBridge = document.createElement("iframe"); - gapBridge.setAttribute("style", "display:none;"); - gapBridge.setAttribute("height","0px"); - gapBridge.setAttribute("width","0px"); - gapBridge.setAttribute("frameborder","0"); - document.documentElement.appendChild(gapBridge); - return gapBridge; -} - -/** - * Execute a PhoneGap command by queuing it and letting the native side know - * there are queued commands. The native side will then request all of the - * queued commands and execute them. - * - * Arguments may be in one of two formats: - * - * FORMAT ONE (preferable) - * The native side will call PhoneGap.callbackSuccess or - * PhoneGap.callbackError, depending upon the result of the action. - * - * @param {Function} success The success callback - * @param {Function} fail The fail callback - * @param {String} service The name of the service to use - * @param {String} action The name of the action to use - * @param {String[]} [args] Zero or more arguments to pass to the method - * - * FORMAT TWO - * @param {String} command Command to be run in PhoneGap, e.g. - * "ClassName.method" - * @param {String[]} [args] Zero or more arguments to pass to the method - * object parameters are passed as an array object - * [object1, object2] each object will be passed as - * JSON strings - */ -PhoneGap.exec = function() { - if (!PhoneGap.available) { - alert("ERROR: Attempting to call PhoneGap.exec()" - +" before 'deviceready'. Ignoring."); - return; - } - - var successCallback, failCallback, service, action, actionArgs; - var callbackId = null; - if (typeof arguments[0] !== "string") { - // FORMAT ONE - successCallback = arguments[0]; - failCallback = arguments[1]; - service = arguments[2]; - action = arguments[3]; - actionArgs = arguments[4]; - - // Since we need to maintain backwards compatibility, we have to pass - // an invalid callbackId even if no callback was provided since plugins - // will be expecting it. The PhoneGap.exec() implementation allocates - // an invalid callbackId and passes it even if no callbacks were given. - callbackId = 'INVALID'; - } else { - // FORMAT TWO - splitCommand = arguments[0].split("."); - action = splitCommand.pop(); - service = splitCommand.join("."); - actionArgs = Array.prototype.splice.call(arguments, 1); - } - - // Start building the command object. - var command = { - className: service, - methodName: action, - arguments: [] - }; - - // Register the callbacks and add the callbackId to the positional - // arguments if given. - if (successCallback || failCallback) { - callbackId = service + PhoneGap.callbackId++; - PhoneGap.callbacks[callbackId] = - {success:successCallback, fail:failCallback}; - } - if (callbackId != null) { - command.arguments.push(callbackId); - } - - for (var i = 0; i < actionArgs.length; ++i) { - var arg = actionArgs[i]; - if (arg == undefined || arg == null) { - continue; - } else if (typeof(arg) == 'object') { - command.options = arg; - } else { - command.arguments.push(arg); - } - } - - // Stringify and queue the command. We stringify to command now to - // effectively clone the command arguments in case they are mutated before - // the command is executed. - PhoneGap.commandQueue.push(JSON.stringify(command)); - - // If the queue length is 1, then that means it was empty before we queued - // the given command, so let the native side know that we have some - // commands to execute, unless the queue is currently being flushed, in - // which case the command will be picked up without notification. - if (PhoneGap.commandQueue.length == 1 && !PhoneGap.commandQueueFlushing) { - if (!PhoneGap.gapBridge) { - PhoneGap.gapBridge = PhoneGap.createGapBridge(); - } - - PhoneGap.gapBridge.src = "gap://ready"; - } -} - -/** - * Called by native code to retrieve all queued commands and clear the queue. - */ -PhoneGap.getAndClearQueuedCommands = function() { - json = JSON.stringify(PhoneGap.commandQueue); - PhoneGap.commandQueue = []; - return json; -} - -/** - * Called by native code when returning successful result from an action. - * - * @param callbackId - * @param args - * args.status - PhoneGap.callbackStatus - * args.message - return value - * args.keepCallback - 0 to remove callback, 1 to keep callback in PhoneGap.callbacks[] - */ -PhoneGap.callbackSuccess = function(callbackId, args) { - if (PhoneGap.callbacks[callbackId]) { - - // If result is to be sent to callback - if (args.status == PhoneGap.callbackStatus.OK) { - try { - if (PhoneGap.callbacks[callbackId].success) { - PhoneGap.callbacks[callbackId].success(args.message); - } - } - catch (e) { - console.log("Error in success callback: "+callbackId+" = "+e); - } - } - - // Clear callback if not expecting any more results - if (!args.keepCallback) { - delete PhoneGap.callbacks[callbackId]; - } - } -}; - -/** - * Called by native code when returning error result from an action. - * - * @param callbackId - * @param args - */ -PhoneGap.callbackError = function(callbackId, args) { - if (PhoneGap.callbacks[callbackId]) { - try { - if (PhoneGap.callbacks[callbackId].fail) { - PhoneGap.callbacks[callbackId].fail(args.message); - } - } - catch (e) { - console.log("Error in error callback: "+callbackId+" = "+e); - } - - // Clear callback if not expecting any more results - if (!args.keepCallback) { - delete PhoneGap.callbacks[callbackId]; - } - } -}; - - -/** - * Does a deep clone of the object. - * - * @param obj - * @return - */ -PhoneGap.clone = function(obj) { - if(!obj) { - return obj; - } - - if(obj instanceof Array){ - var retVal = new Array(); - for(var i = 0; i < obj.length; ++i){ - retVal.push(PhoneGap.clone(obj[i])); - } - return retVal; - } - - if (obj instanceof Function) { - return obj; - } - - if(!(obj instanceof Object)){ - return obj; - } - - if (obj instanceof Date) { - return obj; - } - - retVal = new Object(); - for(i in obj){ - if(!(i in retVal) || retVal[i] != obj[i]) { - retVal[i] = PhoneGap.clone(obj[i]); - } - } - return retVal; -}; - -// Intercept calls to document.addEventListener -PhoneGap.m_document_addEventListener = document.addEventListener; - -// Intercept calls to window.addEventListener -PhoneGap.m_window_addEventListener = window.addEventListener; - -/** - * Add a custom window event handler. - * - * @param {String} event The event name that callback handles - * @param {Function} callback The event handler - */ -PhoneGap.addWindowEventHandler = function(event, callback) { - PhoneGap.windowEventHandler[event] = callback; -} - -/** - * Add a custom document event handler. - * - * @param {String} event The event name that callback handles - * @param {Function} callback The event handler - */ -PhoneGap.addDocumentEventHandler = function(event, callback) { - PhoneGap.documentEventHandler[event] = callback; -} - -/** - * Intercept adding document event listeners and handle our own - * - * @param {Object} evt - * @param {Function} handler - * @param capture - */ -document.addEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - - // If subscribing to an event that is handled by a plugin - if (typeof PhoneGap.documentEventHandler[e] !== "undefined") { - if (PhoneGap.documentEventHandler[e](e, handler, true)) { - return; // Stop default behavior - } - } - - PhoneGap.m_document_addEventListener.call(document, evt, handler, capture); -}; - -/** - * Intercept adding window event listeners and handle our own - * - * @param {Object} evt - * @param {Function} handler - * @param capture - */ -window.addEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - - // If subscribing to an event that is handled by a plugin - if (typeof PhoneGap.windowEventHandler[e] !== "undefined") { - if (PhoneGap.windowEventHandler[e](e, handler, true)) { - return; // Stop default behavior - } - } - - PhoneGap.m_window_addEventListener.call(window, evt, handler, capture); -}; - -// Intercept calls to document.removeEventListener and watch for events that -// are generated by PhoneGap native code -PhoneGap.m_document_removeEventListener = document.removeEventListener; - -// Intercept calls to window.removeEventListener -PhoneGap.m_window_removeEventListener = window.removeEventListener; - -/** - * Intercept removing document event listeners and handle our own - * - * @param {Object} evt - * @param {Function} handler - * @param capture - */ -document.removeEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - - // If unsubcribing from an event that is handled by a plugin - if (typeof PhoneGap.documentEventHandler[e] !== "undefined") { - if (PhoneGap.documentEventHandler[e](e, handler, false)) { - return; // Stop default behavior - } - } - - PhoneGap.m_document_removeEventListener.call(document, evt, handler, capture); -}; - -/** - * Intercept removing window event listeners and handle our own - * - * @param {Object} evt - * @param {Function} handler - * @param capture - */ -window.removeEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - - // If unsubcribing from an event that is handled by a plugin - if (typeof PhoneGap.windowEventHandler[e] !== "undefined") { - if (PhoneGap.windowEventHandler[e](e, handler, false)) { - return; // Stop default behavior - } - } - - PhoneGap.m_window_removeEventListener.call(window, evt, handler, capture); -}; - -/** - * Method to fire document event - * - * @param {String} type The event type to fire - * @param {Object} data Data to send with event - */ -PhoneGap.fireDocumentEvent = function(type, data) { - var e = document.createEvent('Events'); - e.initEvent(type); - if (data) { - for (var i in data) { - e[i] = data[i]; - } - } - document.dispatchEvent(e); -}; - -/** - * Method to fire window event - * - * @param {String} type The event type to fire - * @param {Object} data Data to send with event - */ -PhoneGap.fireWindowEvent = function(type, data) { - var e = document.createEvent('Events'); - e.initEvent(type); - if (data) { - for (var i in data) { - e[i] = data[i]; - } - } - window.dispatchEvent(e); -}; - -/** - * Method to fire event from native code - * Leaving this generic version to handle problems with iOS 3.x. Is currently used by orientation and battery events - * Remove when iOS 3.x no longer supported and call fireWindowEvent or fireDocumentEvent directly - */ -PhoneGap.fireEvent = function(type, target, data) { - var e = document.createEvent('Events'); - e.initEvent(type); - if (data) { - for (var i in data) { - e[i] = data[i]; - } - } - target = target || document; - if (target.dispatchEvent === undefined) { // ie window.dispatchEvent is undefined in iOS 3.x - target = document; - } - - target.dispatchEvent(e); -}; -/** - * Create a UUID - * - * @return - */ -PhoneGap.createUUID = function() { - return PhoneGap.UUIDcreatePart(4) + '-' + - PhoneGap.UUIDcreatePart(2) + '-' + - PhoneGap.UUIDcreatePart(2) + '-' + - PhoneGap.UUIDcreatePart(2) + '-' + - PhoneGap.UUIDcreatePart(6); -}; - -PhoneGap.UUIDcreatePart = function(length) { - var uuidpart = ""; - for (var i=0; i -1) { - me._batteryListener.splice(pos, 1); - } - } else if (eventType === "batterylow") { - var pos = me._lowListener.indexOf(handler); - if (pos > -1) { - me._lowListener.splice(pos, 1); - } - } else if (eventType === "batterycritical") { - var pos = me._criticalListener.indexOf(handler); - if (pos > -1) { - me._criticalListener.splice(pos, 1); - } - } - - // If there are no more registered event listeners stop the battery listener on native side. - if (me._batteryListener.length === 0 && me._lowListener.length === 0 && me._criticalListener.length === 0) { - PhoneGap.exec(null, null, "com.phonegap.battery", "stop", []); - } - } -}; - -/** - * Callback for battery status - * - * @param {Object} info keys: level, isPlugged - */ -Battery.prototype._status = function(info) { - if (info) { - var me = this; - if (me._level != info.level || me._isPlugged != info.isPlugged) { - // Fire batterystatus event - //PhoneGap.fireWindowEvent("batterystatus", info); - // use this workaround since iOS 3.x does have window.dispatchEvent - PhoneGap.fireEvent("batterystatus", window, info); - - // Fire low battery event - if (info.level == 20 || info.level == 5) { - if (info.level == 20) { - //PhoneGap.fireWindowEvent("batterylow", info); - // use this workaround since iOS 3.x does not have window.dispatchEvent - PhoneGap.fireEvent("batterylow", window, info); - } - else { - //PhoneGap.fireWindowEvent("batterycritical", info); - // use this workaround since iOS 3.x does not have window.dispatchEvent - PhoneGap.fireEvent("batterycritical", window, info); - } - } - } - me._level = info.level; - me._isPlugged = info.isPlugged; - } -}; - -/** - * Error callback for battery start - */ -Battery.prototype._error = function(e) { - console.log("Error initializing Battery: " + e); -}; - -PhoneGap.addConstructor(function() { - if (typeof navigator.battery === "undefined") { - navigator.battery = new Battery(); - PhoneGap.addWindowEventHandler("batterystatus", navigator.battery.eventHandler); - PhoneGap.addWindowEventHandler("batterylow", navigator.battery.eventHandler); - PhoneGap.addWindowEventHandler("batterycritical", navigator.battery.eventHandler); - } -}); -}if (!PhoneGap.hasResource("camera")) { - PhoneGap.addResource("camera"); - - -/** - * This class provides access to the device camera. - * @constructor - */ -Camera = function() { - -} -/** - * Available Camera Options - * {boolean} allowEdit - true to allow editing image, default = false - * {number} quality 0-100 (low to high) default = 100 - * {Camera.DestinationType} destinationType default = DATA_URL - * {Camera.PictureSourceType} sourceType default = CAMERA - * {number} targetWidth - width in pixels to scale image default = 0 (no scaling) - * {number} targetHeight - height in pixels to scale image default = 0 (no scaling) - * {Camera.EncodingType} - encodingType default = JPEG - * {boolean} correctOrientation - Rotate the image to correct for the orientation of the device during capture (iOS only) - * {boolean} saveToPhotoAlbum - Save the image to the photo album on the device after capture (iOS only) - */ -/** - * Format of image that is returned from getPicture. - * - * Example: navigator.camera.getPicture(success, fail, - * { quality: 80, - * destinationType: Camera.DestinationType.DATA_URL, - * sourceType: Camera.PictureSourceType.PHOTOLIBRARY}) - */ -Camera.DestinationType = { - DATA_URL: 0, // Return base64 encoded string - FILE_URI: 1 // Return file uri -}; -Camera.prototype.DestinationType = Camera.DestinationType; - -/** - * Source to getPicture from. - * - * Example: navigator.camera.getPicture(success, fail, - * { quality: 80, - * destinationType: Camera.DestinationType.DATA_URL, - * sourceType: Camera.PictureSourceType.PHOTOLIBRARY}) - */ -Camera.PictureSourceType = { - PHOTOLIBRARY : 0, // Choose image from picture library - CAMERA : 1, // Take picture from camera - SAVEDPHOTOALBUM : 2 // Choose image from picture library -}; -Camera.prototype.PictureSourceType = Camera.PictureSourceType; - -/** - * Encoding of image returned from getPicture. - * - * Example: navigator.camera.getPicture(success, fail, - * { quality: 80, - * destinationType: Camera.DestinationType.DATA_URL, - * sourceType: Camera.PictureSourceType.CAMERA, - * encodingType: Camera.EncodingType.PNG}) - */ -Camera.EncodingType = { - JPEG: 0, // Return JPEG encoded image - PNG: 1 // Return PNG encoded image -}; -Camera.prototype.EncodingType = Camera.EncodingType; - -/** - * Type of pictures to select from. Only applicable when - * PictureSourceType is PHOTOLIBRARY or SAVEDPHOTOALBUM - * - * Example: navigator.camera.getPicture(success, fail, - * { quality: 80, - * destinationType: Camera.DestinationType.DATA_URL, - * sourceType: Camera.PictureSourceType.PHOTOLIBRARY, - * mediaType: Camera.MediaType.PICTURE}) - */ -Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, ONLY RETURNS URL - ALLMEDIA : 2 // allow selection from all media types -}; -Camera.prototype.MediaType = Camera.MediaType; - -/** - * Gets a picture from source defined by "options.sourceType", and returns the - * image as defined by the "options.destinationType" option. - - * The defaults are sourceType=CAMERA and destinationType=DATA_URL. - * - * @param {Function} successCallback - * @param {Function} errorCallback - * @param {Object} options - */ -Camera.prototype.getPicture = function(successCallback, errorCallback, options) { - // successCallback required - if (typeof successCallback != "function") { - console.log("Camera Error: successCallback is not a function"); - return; - } - - // errorCallback optional - if (errorCallback && (typeof errorCallback != "function")) { - console.log("Camera Error: errorCallback is not a function"); - return; - } - - PhoneGap.exec(successCallback, errorCallback, "com.phonegap.camera","getPicture",[options]); -}; - - - -PhoneGap.addConstructor(function() { - if (typeof navigator.camera == "undefined") navigator.camera = new Camera(); -}); -}; - -if (!PhoneGap.hasResource("device")) { - PhoneGap.addResource("device"); - -/** - * this represents the mobile device, and provides properties for inspecting the model, version, UUID of the - * phone, etc. - * @constructor - */ -Device = function() -{ - this.platform = null; - this.version = null; - this.name = null; - this.phonegap = null; - this.uuid = null; - try - { - this.platform = DeviceInfo.platform; - this.version = DeviceInfo.version; - this.name = DeviceInfo.name; - this.phonegap = DeviceInfo.gap; - this.uuid = DeviceInfo.uuid; - - } - catch(e) - { - // TODO: - } - this.available = PhoneGap.available = this.uuid != null; -} - -PhoneGap.addConstructor(function() { - if (typeof navigator.device === "undefined") { - navigator.device = window.device = new Device(); - } -}); -}; - -if (!PhoneGap.hasResource("capture")) { - PhoneGap.addResource("capture"); -/** - * The CaptureError interface encapsulates all errors in the Capture API. - */ -function CaptureError() { - this.code = null; -}; - -// Capture error codes -CaptureError.CAPTURE_INTERNAL_ERR = 0; -CaptureError.CAPTURE_APPLICATION_BUSY = 1; -CaptureError.CAPTURE_INVALID_ARGUMENT = 2; -CaptureError.CAPTURE_NO_MEDIA_FILES = 3; -CaptureError.CAPTURE_NOT_SUPPORTED = 20; - -/** - * The Capture interface exposes an interface to the camera and microphone of the hosting device. - */ -function Capture() { - this.supportedAudioModes = []; - this.supportedImageModes = []; - this.supportedVideoModes = []; -}; - -/** - * Launch audio recorder application for recording audio clip(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureAudioOptions} options - * - * No audio recorder to launch for iOS - return CAPTURE_NOT_SUPPORTED - */ -Capture.prototype.captureAudio = function(successCallback, errorCallback, options) { - /*if (errorCallback && typeof errorCallback === "function") { - errorCallback({ - "code": CaptureError.CAPTURE_NOT_SUPPORTED - }); - }*/ - PhoneGap.exec(successCallback, errorCallback, "com.phonegap.mediacapture", "captureAudio", [options]); -}; - -/** - * Launch camera application for taking image(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureImageOptions} options - */ -Capture.prototype.captureImage = function(successCallback, errorCallback, options) { - PhoneGap.exec(successCallback, errorCallback, "com.phonegap.mediacapture", "captureImage", [options]); -}; - -/** - * Launch camera application for taking image(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureImageOptions} options - */ -Capture.prototype._castMediaFile = function(pluginResult) { - var mediaFiles = []; - var i; - for (i=0; i} categories -* @param {ContactField[]} urls contact's web sites -*/ -var Contact = function(id, displayName, name, nickname, phoneNumbers, emails, addresses, - ims, organizations, birthday, note, photos, categories, urls) { - this.id = id || null; - this.displayName = displayName || null; - this.name = name || null; // ContactName - this.nickname = nickname || null; - this.phoneNumbers = phoneNumbers || null; // ContactField[] - this.emails = emails || null; // ContactField[] - this.addresses = addresses || null; // ContactAddress[] - this.ims = ims || null; // ContactField[] - this.organizations = organizations || null; // ContactOrganization[] - this.birthday = birthday || null; // JS Date - this.note = note || null; - this.photos = photos || null; // ContactField[] - this.categories = categories || null; - this.urls = urls || null; // ContactField[] -}; - -/** -* Converts Dates to milliseconds before sending to iOS -*/ -Contact.prototype.convertDatesOut = function() -{ - var dates = new Array("birthday"); - for (var i=0; i][;base64], - * - * @param file {File} File object containing file properties - */ -FileReader.prototype.readAsDataURL = function(file) { - this.fileName = ""; - - if (typeof file.fullPath === "undefined") { - this.fileName = file; - } else { - this.fileName = file.fullPath; - } - - // LOADING state - this.readyState = FileReader.LOADING; - - // If loadstart callback - if (typeof this.onloadstart === "function") { - var evt = File._createEvent("loadstart", this); - this.onloadstart(evt); - } - - var me = this; - - // Read file - navigator.fileMgr.readAsDataURL(this.fileName, - - // Success callback - function(r) { - var evt; - - // If DONE (cancelled), then don't do anything - if (me.readyState === FileReader.DONE) { - return; - } - - // Save result - me.result = r; - - // If onload callback - if (typeof me.onload === "function") { - evt = File._createEvent("load", me); - me.onload(evt); - } - - // DONE state - me.readyState = FileReader.DONE; - - // If onloadend callback - if (typeof me.onloadend === "function") { - evt = File._createEvent("loadend", me); - me.onloadend(evt); - } - }, - - // Error callback - function(e) { - var evt; - // If DONE (cancelled), then don't do anything - if (me.readyState === FileReader.DONE) { - return; - } - - // Save error - me.error = e; - - // If onerror callback - if (typeof me.onerror === "function") { - evt = File._createEvent("error", me); - me.onerror(evt); - } - - // DONE state - me.readyState = FileReader.DONE; - - // If onloadend callback - if (typeof me.onloadend === "function") { - evt = File._createEvent("loadend", me); - me.onloadend(evt); - } - } - ); -}; - -/** - * Read file and return data as a binary data. - * - * @param file The name of the file - */ -FileReader.prototype.readAsBinaryString = function(file) { - // TODO - Can't return binary data to browser. - this.fileName = file; -}; - -/** - * Read file and return data as a binary data. - * - * @param file The name of the file - */ -FileReader.prototype.readAsArrayBuffer = function(file) { - // TODO - Can't return binary data to browser. - this.fileName = file; -}; - -//----------------------------------------------------------------------------- -// File Writer -//----------------------------------------------------------------------------- - -/** - * This class writes to the mobile device file system. - * - @param file {File} a File object representing a file on the file system -*/ -FileWriter = function(file) { - this.fileName = ""; - this.length = 0; - if (file) { - this.fileName = file.fullPath || file; - this.length = file.size || 0; - } - - // default is to write at the beginning of the file - this.position = 0; - - this.readyState = 0; // EMPTY - - this.result = null; - - // Error - this.error = null; - - // Event handlers - this.onwritestart = null; // When writing starts - this.onprogress = null; // While writing the file, and reporting partial file data - this.onwrite = null; // When the write has successfully completed. - this.onwriteend = null; // When the request has completed (either in success or failure). - this.onabort = null; // When the write has been aborted. For instance, by invoking the abort() method. - this.onerror = null; // When the write has failed (see errors). -} - -// States -FileWriter.INIT = 0; -FileWriter.WRITING = 1; -FileWriter.DONE = 2; - -/** - * Abort writing file. - */ -FileWriter.prototype.abort = function() { - // check for invalid state - if (this.readyState === FileWriter.DONE || this.readyState === FileWriter.INIT) { - throw FileError.INVALID_STATE_ERR; - } - - // set error - var error = new FileError(), evt; - error.code = error.ABORT_ERR; - this.error = error; - - // If error callback - if (typeof this.onerror === "function") { - evt = File._createEvent("error", this); - this.onerror(evt); - } - // If abort callback - if (typeof this.onabort === "function") { - evt = File._createEvent("abort", this); - this.onabort(evt); - } - - this.readyState = FileWriter.DONE; - - // If write end callback - if (typeof this.onwriteend == "function") { - evt = File._createEvent("writeend", this); - this.onwriteend(evt); - } -}; - -/** - * @Deprecated: use write instead - * - * @param file to write the data to - * @param text to be written - * @param bAppend if true write to end of file, otherwise overwrite the file - */ -FileWriter.prototype.writeAsText = function(file, text, bAppend) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw FileError.INVALID_STATE_ERR; - } - - if (bAppend !== true) { - bAppend = false; // for null values - } - - this.fileName = file; - - // WRITING state - this.readyState = FileWriter.WRITING; - - var me = this; - - // If onwritestart callback - if (typeof me.onwritestart === "function") { - var evt = File._createEvent("writestart", me); - me.onwritestart(evt); - } - - - // Write file - navigator.fileMgr.writeAsText(file, text, bAppend, - // Success callback - function(r) { - var evt; - - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // Save result - me.result = r; - - // If onwrite callback - if (typeof me.onwrite === "function") { - evt = File._createEvent("write", me); - me.onwrite(evt); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - evt = File._createEvent("writeend", me); - me.onwriteend(evt); - } - }, - - // Error callback - function(e) { - var evt; - - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // Save error - me.error = e; - - // If onerror callback - if (typeof me.onerror === "function") { - evt = File._createEvent("error", me); - me.onerror(evt); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - evt = File._createEvent("writeend", me); - me.onwriteend(evt); - } - } - ); -}; - -/** - * Writes data to the file - * - * @param text to be written - */ -FileWriter.prototype.write = function(text) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw FileError.INVALID_STATE_ERR; - } - - // WRITING state - this.readyState = FileWriter.WRITING; - - var me = this; - - // If onwritestart callback - if (typeof me.onwritestart === "function") { - var evt = File._createEvent("writestart", me); - me.onwritestart(evt); - } - - // Write file - navigator.fileMgr.write(this.fileName, text, this.position, - - // Success callback - function(r) { - var evt; - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - - // position always increases by bytes written because file would be extended - me.position += r; - // The length of the file is now where we are done writing. - me.length = me.position; - - // If onwrite callback - if (typeof me.onwrite === "function") { - evt = File._createEvent("write", me); - me.onwrite(evt); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - evt = File._createEvent("writeend", me); - me.onwriteend(evt); - } - }, - - // Error callback - function(e) { - var evt; - - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // Save error - me.error = e; - - // If onerror callback - if (typeof me.onerror === "function") { - evt = File._createEvent("error", me); - me.onerror(evt); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - evt = File._createEvent("writeend", me); - me.onwriteend(evt); - } - } - ); - -}; - -/** - * Moves the file pointer to the location specified. - * - * If the offset is a negative number the position of the file - * pointer is rewound. If the offset is greater than the file - * size the position is set to the end of the file. - * - * @param offset is the location to move the file pointer to. - */ -FileWriter.prototype.seek = function(offset) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw FileError.INVALID_STATE_ERR; - } - - if (!offset) { - return; - } - - // See back from end of file. - if (offset < 0) { - this.position = Math.max(offset + this.length, 0); - } - // Offset is bigger then file size so set position - // to the end of the file. - else if (offset > this.length) { - this.position = this.length; - } - // Offset is between 0 and file size so set the position - // to start writing. - else { - this.position = offset; - } -}; - -/** - * Truncates the file to the size specified. - * - * @param size to chop the file at. - */ -FileWriter.prototype.truncate = function(size) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw FileError.INVALID_STATE_ERR; - } - // what if no size specified? - - // WRITING state - this.readyState = FileWriter.WRITING; - - var me = this; - - // If onwritestart callback - if (typeof me.onwritestart === "function") { - var evt = File._createEvent("writestart", me); - me.onwritestart(evt); - } - - // Write file - navigator.fileMgr.truncate(this.fileName, size, - - // Success callback - function(r) { - var evt; - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // Update the length of the file - me.length = r; - me.position = Math.min(me.position, r); - - // If onwrite callback - if (typeof me.onwrite === "function") { - evt = File._createEvent("write", me); - me.onwrite(evt); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - evt = File._createEvent("writeend", me); - me.onwriteend(evt); - } - }, - - // Error callback - function(e) { - var evt; - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // Save error - me.error = e; - - // If onerror callback - if (typeof me.onerror === "function") { - evt = File._createEvent("error", me); - me.onerror(evt); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - evt = File._createEvent("writeend", me); - me.onwriteend(evt); - } - } - ); -}; - -LocalFileSystem = function() { -}; - -// File error codes -LocalFileSystem.TEMPORARY = 0; -LocalFileSystem.PERSISTENT = 1; -LocalFileSystem.RESOURCE = 2; -LocalFileSystem.APPLICATION = 3; - -/** - * Requests a filesystem in which to store application data. - * - * @param {int} type of file system being requested - * @param {Function} successCallback is called with the new FileSystem - * @param {Function} errorCallback is called with a FileError - */ -LocalFileSystem.prototype.requestFileSystem = function(type, size, successCallback, errorCallback) { - if (type < 0 || type > 3) { - if (typeof errorCallback == "function") { - errorCallback({ - "code": FileError.SYNTAX_ERR - }); - } - } - else { - PhoneGap.exec(successCallback, errorCallback, "com.phonegap.file", "requestFileSystem", [type, size]); - } -}; - -/** - * - * @param {DOMString} uri referring to a local file in a filesystem - * @param {Function} successCallback is called with the new entry - * @param {Function} errorCallback is called with a FileError - */ -LocalFileSystem.prototype.resolveLocalFileSystemURI = function(uri, successCallback, errorCallback) { - PhoneGap.exec(successCallback, errorCallback, "com.phonegap.file", "resolveLocalFileSystemURI", [uri]); -}; - -/** -* This function is required as we need to convert raw -* JSON objects into concrete File and Directory objects. -* -* @param a JSON Objects that need to be converted to DirectoryEntry or FileEntry objects. -* @returns an entry -*/ -LocalFileSystem.prototype._castFS = function(pluginResult) { - var entry = null; - entry = new DirectoryEntry(); - entry.isDirectory = pluginResult.message.root.isDirectory; - entry.isFile = pluginResult.message.root.isFile; - entry.name = pluginResult.message.root.name; - entry.fullPath = pluginResult.message.root.fullPath; - pluginResult.message.root = entry; - return pluginResult; -} - -LocalFileSystem.prototype._castEntry = function(pluginResult) { - var entry = null; - if (pluginResult.message.isDirectory) { - entry = new DirectoryEntry(); - } - else if (pluginResult.message.isFile) { - entry = new FileEntry(); - } - entry.isDirectory = pluginResult.message.isDirectory; - entry.isFile = pluginResult.message.isFile; - entry.name = pluginResult.message.name; - entry.fullPath = pluginResult.message.fullPath; - pluginResult.message = entry; - return pluginResult; -} - -LocalFileSystem.prototype._castEntries = function(pluginResult) { - var entries = pluginResult.message; - var retVal = []; - for (i=0; i"); - $(".photo").show(); - - }, - onCameraFail: function (msg) { - console.log("ERROR! -" + msg); - } -}; - -var filters = { - none: function (imageURI) { - plugins.ImageFilter.none(filters.rendered, { - image: imageURI, - save: 'false', - }); - }, - sunnySide: function (imageURI) { - plugins.ImageFilter.sunnySide(filters.rendered, { - image: imageURI, - save: 'false' - }); - }, - worn: function (imageURI) { - plugins.ImageFilter.worn(filters.rendered, { - image: imageURI, - save: 'false' - }); - }, - vintage: function (imageURI) { - plugins.ImageFilter.vintage(filters.rendered, { - image: imageURI, - save: 'false' - }); - }, - stark: function (imageURI) { - plugins.ImageFilter.stark(filters.rendered, { - image: imageURI, - save: 'false' - }); - }, - rendered: function (msg) { - - $(".photo").html(""); - } -} \ No newline at end of file diff --git a/iOS/phonegap/example/www/js/plugins/ImageFilter.js b/iOS/phonegap/example/www/js/plugins/ImageFilter.js deleted file mode 100644 index 4e01998..0000000 --- a/iOS/phonegap/example/www/js/plugins/ImageFilter.js +++ /dev/null @@ -1,64 +0,0 @@ -var ImageFilter = function () {}; - -ImageFilter.prototype.clean = function (options) { - - PhoneGap.exec("ImageFilter.clean"); -}; -ImageFilter.prototype.none = function (done,options) { - //console.log(options+" "+done); - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - - return PhoneGap.exec(done,null,"ImageFilter","none",[defaults]); -}; -ImageFilter.prototype.sunnySide = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","sunnySide",[defaults]); -}; -ImageFilter.prototype.worn = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","worn",[defaults]); -}; -ImageFilter.prototype.vintage = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","vintage",[defaults]); -}; -ImageFilter.prototype.stark = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","stark",[defaults]); -}; -PhoneGap.addConstructor(function () { - if(!window.plugins) { - window.plugins = {}; - } - window.plugins.ImageFilter = new ImageFilter(); -}); \ No newline at end of file diff --git a/iOS/phonegap/plugin/ImageFilter.h b/iOS/phonegap/plugin/ImageFilter.h deleted file mode 100644 index 5399ea4..0000000 --- a/iOS/phonegap/plugin/ImageFilter.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// ImageFilter.h -// -// Created by Drew Dahlman 2/25/2012. -// Copyright 2012 Drew Dahlman. All rights reserved. -// version 1.0 - -// Current Filters: -// none -// stark -// sunnySide -// worn -// vintage - -/* -Copyright (c) 2012 Drew Dahlman MIT LICENSE -*/ - - -#import - -#ifdef PHONEGAP_FRAMEWORK -#import -#else -#import "PGPlugin.h" -#endif - - -@interface ImageFilter : PGPlugin { - NSString* callbackID; -} -@property (nonatomic, retain) NSString* callbackID; - - -// GARBAGE -- (void)clean:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; - -// FILTERS -- (void)none:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; -- (void)stark:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; -- (void)sunnySide:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; -- (void)worn:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; -- (void)vintage:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; -@end diff --git a/iOS/phonegap/plugin/ImageFilter.js b/iOS/phonegap/plugin/ImageFilter.js deleted file mode 100644 index 04887ff..0000000 --- a/iOS/phonegap/plugin/ImageFilter.js +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright (c) 2012 Drew Dahlman MIT LICENSE -*/ - -var ImageFilter = function () {}; - -ImageFilter.prototype.clean = function (options) { - - PhoneGap.exec("ImageFilter.clean"); -}; -ImageFilter.prototype.none = function (done,options) { - //console.log(options+" "+done); - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - - return PhoneGap.exec(done,null,"ImageFilter","none",[defaults]); -}; -ImageFilter.prototype.sunnySide = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","sunnySide",[defaults]); -}; -ImageFilter.prototype.worn = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","worn",[defaults]); -}; -ImageFilter.prototype.vintage = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","vintage",[defaults]); -}; -ImageFilter.prototype.stark = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","stark",[defaults]); -}; -PhoneGap.addConstructor(function () { - if(!window.plugins) { - window.plugins = {}; - } - window.plugins.ImageFilter = new ImageFilter(); -}); \ No newline at end of file diff --git a/iOS/phonegap/plugin/ImageFilter.m b/iOS/phonegap/plugin/ImageFilter.m deleted file mode 100644 index f96b7f4..0000000 --- a/iOS/phonegap/plugin/ImageFilter.m +++ /dev/null @@ -1,407 +0,0 @@ -// -// ImageFilter.m -// -// Created by Drew Dahlman 2/25/2012. -// Copyright 2012 Drew Dahlman. All rights reserved. -// version 1.0 - -/* - Copyright (c) 2012 Drew Dahlman MIT LICENSE*/ - -#import -#import "ImageFilter.h" -#import -@implementation ImageFilter -@synthesize callbackID; - -// For clean up purposes sometimes the apps will cache images, so this cleans things up --(void)clean:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options -{ - // Path to the Documents directory - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - if ([paths count] > 0) - { - NSError *error = nil; - NSFileManager *fileManager = [NSFileManager defaultManager]; - - // Print out the path to verify we are in the right place - NSString *directory = [paths objectAtIndex:0]; - NSLog(@"Directory: %@", directory); - - // For each file in the directory, create full path and delete the file - for (NSString *file in [fileManager contentsOfDirectoryAtPath:directory error:&error]) - { - NSString *filePath = [directory stringByAppendingPathComponent:file]; - NSLog(@"File : %@", filePath); - - BOOL fileDeleted = [fileManager removeItemAtPath:filePath error:&error]; - - if (fileDeleted != YES || error != nil) - { - - } - } - - } - NSLog(@"CLEAN!"); -} - -// FILTERS -// Each filter uses the CoreImage Framework, and can be changed and added to. -// If you wish to create a new filter use the none as a template. --(void)none:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options -{ - // Start by getting path to image - NSString *filePath = [options objectForKey:@"image"]; - // CREATE NSURL - NSURL *fileNameAndPath = [NSURL URLWithString:filePath]; - NSLog(@"FILE PATH: %@",fileNameAndPath); - - // DEFINE OUR CIImage - CIImage *beginImage = - [CIImage imageWithContentsOfURL:fileNameAndPath]; - CIContext *context = [CIContext contextWithOptions:nil]; - - // DO ALL MODIFICATIONS HERE. - - - // CREATE CIIMageRef from our CIImage - // Be sure to reference the correct CIImage in both the createCGIImage and fromRect - CGImageRef cgimg = - [context createCGImage:beginImage fromRect:[beginImage extent]]; - - // CREATE UIImage out of CIImage - UIImage *newImg = [UIImage imageWithCGImage:cgimg]; - - // GET IMAGE DATA AND CONSTRUCT URL TO THE APPS DOCUMENT FOLDER - NSData *imageData = UIImageJPEGRepresentation(newImg,1.0); - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsPath = [paths objectAtIndex:0]; - NSString *filePathB = [documentsPath stringByAppendingPathComponent:@"none.jpg"]; - - // SAVE IMAGE DATA TO DOCUMENTS FOLDER - [imageData writeToFile:filePathB atomically:YES]; - - // CHECK IF THE SAVE KEY IS SET TO TRU - NSString *save = [options objectForKey:@"save"]; - NSLog(@"SAVED: %@",save); - - // IF TRUE THEN SAVE IMAGE TO CAMERA ROLL - if([save isEqualToString:@"true"]){ - UIImageWriteToSavedPhotosAlbum(newImg, self,@selector(image:didFinishSavingWithError:contextInfo:), nil); - } - - // RELEASE OUR IMAGE AND DONE - CGImageRelease(cgimg); - - // CALLBACK TO JAVASCRIPT WITH IMAGE URI - self.callbackID = [arguments pop]; - - PluginResult* pluginResult = [PluginResult resultWithStatus:PGCommandStatus_OK - messageAsString:filePathB]; - - /* Create JS to call the success function with the result */ - NSString *successScript = [pluginResult toSuccessCallbackString:self.callbackID]; - /* Output the script */ - [self writeJavascript:successScript]; - - - -} --(void)stark:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options -{ - - NSString *filePath = [options objectForKey:@"image"]; - NSURL *fileNameAndPath = [NSURL URLWithString:filePath]; - - CIImage *beginImage = - [CIImage imageWithContentsOfURL:fileNameAndPath]; - CIContext *context = [CIContext contextWithOptions:nil]; - - CIFilter *filter = [CIFilter filterWithName:@"CIColorControls" - keysAndValues: kCIInputImageKey, beginImage, - @"inputSaturation", [NSNumber numberWithFloat:.1], - @"inputContrast", [NSNumber numberWithFloat:1], - nil]; - CIImage *outputImage = [filter outputImage]; - - CIFilter *filterB = [CIFilter filterWithName:@"CIGammaAdjust" - keysAndValues: kCIInputImageKey, outputImage, - @"inputPower", [NSNumber numberWithFloat:1.5], - nil]; - - CIImage *outputImageB = [filterB outputImage]; - - CGImageRef cgimg = - [context createCGImage:outputImageB fromRect:[outputImageB extent]]; - UIImage *newImg = [UIImage imageWithCGImage:cgimg]; - - NSData *imageData = UIImageJPEGRepresentation(newImg,1.0); - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsPath = [paths objectAtIndex:0]; //Get the docs directory - - int r = arc4random() % 5000; - NSString *random = [NSString stringWithFormat:@"%d", r]; - NSString *tPathA = [documentsPath stringByAppendingPathComponent:@"stark"]; - NSString *tPathB = [tPathA stringByAppendingString:random]; - NSString *filePathB = [tPathB stringByAppendingString:@".jpg"]; - - [imageData writeToFile:filePathB atomically:YES]; - - NSString *save = [options objectForKey:@"save"]; - NSLog(@"SAVED: %@",save); - if([save isEqualToString:@"true"]){ - UIImageWriteToSavedPhotosAlbum(newImg, self,@selector(image:didFinishSavingWithError:contextInfo:), nil); - } - CGImageRelease(cgimg); - - // CALLBACK TO JAVASCRIPT WITH IMAGE URI - self.callbackID = [arguments pop]; - - PluginResult* pluginResult = [PluginResult resultWithStatus:PGCommandStatus_OK - messageAsString:filePathB]; - - /* Create JS to call the success function with the result */ - NSString *successScript = [pluginResult toSuccessCallbackString:self.callbackID]; - /* Output the script */ - [self writeJavascript:successScript]; -} --(void)sunnySide:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options -{ - // FILTER - NSString *filePath = [options objectForKey:@"image"]; - NSURL *fileNameAndPath = [NSURL URLWithString:filePath]; - - CIImage *beginImage = - [CIImage imageWithContentsOfURL:fileNameAndPath]; - CIContext *context = [CIContext contextWithOptions:nil]; - - CIFilter *filter = [CIFilter filterWithName:@"CIWhitePointAdjust" - keysAndValues: kCIInputImageKey, beginImage, - @"inputColor",[CIColor colorWithRed:254 green:197 blue:0 alpha:1], - nil]; - CIImage *outputImage = [filter outputImage]; - - CIFilter *filterB = [CIFilter filterWithName:@"CITemperatureAndTint" - keysAndValues: kCIInputImageKey, outputImage, - @"inputNeutral",[CIVector vectorWithX:5500 Y:1300 Z:0], - @"inputTargetNeutral",[CIVector vectorWithX:4000 Y:0 Z:0], - nil]; - CIImage *outputImageB = [filterB outputImage]; - - NSString *bgPath = - [[NSBundle mainBundle] pathForResource:@"painter" ofType:@"png"]; - NSURL *bgPathName = [NSURL fileURLWithPath:bgPath]; - - CIImage *bgIMG = - [CIImage imageWithContentsOfURL:bgPathName]; - - CIFilter *filterD = [CIFilter filterWithName:@"CISourceOverCompositing" - keysAndValues: kCIInputImageKey, bgIMG, - @"inputBackgroundImage",outputImageB, - nil]; - CIImage *outputImageD = [filterD outputImage]; - - CGImageRef cgimg = - [context createCGImage:outputImageD fromRect:[outputImageD extent]]; - UIImage *newImg = [UIImage imageWithCGImage:cgimg]; - - NSData *imageData = UIImageJPEGRepresentation(newImg,1.0); - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsPath = [paths objectAtIndex:0]; //Get the docs directory - - int r = arc4random() % 5000; - NSString *random = [NSString stringWithFormat:@"%d", r]; - NSString *tPathA = [documentsPath stringByAppendingPathComponent:@"sunnyside"]; - NSString *tPathB = [tPathA stringByAppendingString:random]; - NSString *filePathB = [tPathB stringByAppendingString:@".jpg"]; - - [imageData writeToFile:filePathB atomically:YES]; - - NSString *save = [options objectForKey:@"save"]; - NSLog(@"SAVED: %@",save); - if([save isEqualToString:@"true"]){ - UIImageWriteToSavedPhotosAlbum(newImg, self,@selector(image:didFinishSavingWithError:contextInfo:), nil); - } - - CGImageRelease(cgimg); - - // CALLBACK TO JAVASCRIPT WITH IMAGE URI - self.callbackID = [arguments pop]; - - PluginResult* pluginResult = [PluginResult resultWithStatus:PGCommandStatus_OK - messageAsString:filePathB]; - - /* Create JS to call the success function with the result */ - NSString *successScript = [pluginResult toSuccessCallbackString:self.callbackID]; - /* Output the script */ - [self writeJavascript:successScript]; - -} --(void)worn:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options -{ - // FILTER - NSString *filePath = [options objectForKey:@"image"]; - NSURL *fileNameAndPath = [NSURL URLWithString:filePath]; - - CIImage *beginImage = - [CIImage imageWithContentsOfURL:fileNameAndPath]; - CIContext *context = [CIContext contextWithOptions:nil]; - - CIFilter *filter = [CIFilter filterWithName:@"CIWhitePointAdjust" - keysAndValues: kCIInputImageKey, beginImage, - @"inputColor",[CIColor colorWithRed:212 green:235 blue:241 alpha:1], - nil]; - CIImage *outputImage = [filter outputImage]; - - CIFilter *filterB = [CIFilter filterWithName:@"CIColorControls" - keysAndValues: kCIInputImageKey, outputImage, - @"inputSaturation", [NSNumber numberWithFloat:.6], - @"inputContrast", [NSNumber numberWithFloat:1], - nil]; - CIImage *outputImageB = [filterB outputImage]; - - CIFilter *filterC = [CIFilter filterWithName:@"CITemperatureAndTint" - keysAndValues: kCIInputImageKey, outputImageB, - @"inputNeutral",[CIVector vectorWithX:6500 Y:2000 Z:0], - @"inputTargetNeutral",[CIVector vectorWithX:5200 Y:0 Z:0], - nil]; - CIImage *outputImageC = [filterC outputImage]; - - NSString *framePath = - [[NSBundle mainBundle] pathForResource:@"vignette4" ofType:@"png"]; - NSURL *framePathName = [NSURL fileURLWithPath:framePath]; - - CIImage *frameImg = - [CIImage imageWithContentsOfURL:framePathName]; - - CIFilter *filterD = [CIFilter filterWithName:@"CISourceOverCompositing" - keysAndValues: kCIInputImageKey, frameImg, - @"inputBackgroundImage",outputImageC, - nil]; - CIImage *outputImageD = [filterD outputImage]; - - CGImageRef cgimg = - [context createCGImage:outputImageD fromRect:[outputImageD extent]]; - UIImage *newImg = [UIImage imageWithCGImage:cgimg]; - - NSData *imageData = UIImageJPEGRepresentation(newImg,1.0); - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsPath = [paths objectAtIndex:0]; //Get the docs directory - - int r = arc4random() % 5000; - NSString *random = [NSString stringWithFormat:@"%d", r]; - NSString *tPathA = [documentsPath stringByAppendingPathComponent:@"worn"]; - NSString *tPathB = [tPathA stringByAppendingString:random]; - NSString *filePathB = [tPathB stringByAppendingString:@".jpg"]; - - [imageData writeToFile:filePathB atomically:YES]; - - NSString *save = [options objectForKey:@"save"]; - NSLog(@"SAVED: %@",save); - if([save isEqualToString:@"true"]){ - UIImageWriteToSavedPhotosAlbum(newImg, self,@selector(image:didFinishSavingWithError:contextInfo:), nil); - } - CGImageRelease(cgimg); - - // CALLBACK TO JAVASCRIPT WITH IMAGE URI - self.callbackID = [arguments pop]; - - PluginResult* pluginResult = [PluginResult resultWithStatus:PGCommandStatus_OK - messageAsString:filePathB]; - - /* Create JS to call the success function with the result */ - NSString *successScript = [pluginResult toSuccessCallbackString:self.callbackID]; - /* Output the script */ - [self writeJavascript:successScript]; - -} --(void)vintage:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options -{ - // FILTER - NSString *filePath = [options objectForKey:@"image"]; - NSURL *fileNameAndPath = [NSURL URLWithString:filePath]; - - CIImage *beginImage = - [CIImage imageWithContentsOfURL:fileNameAndPath]; - CIContext *context = [CIContext contextWithOptions:nil]; - - CIFilter *filter = [CIFilter filterWithName:@"CIWhitePointAdjust" - keysAndValues: kCIInputImageKey, beginImage, - @"inputColor",[CIColor colorWithRed:121 green:195 blue:219 alpha:1], - nil]; - CIImage *outputImage = [filter outputImage]; - - CIFilter *filterB = [CIFilter filterWithName:@"CIColorControls" - keysAndValues: kCIInputImageKey, outputImage, - @"inputSaturation", [NSNumber numberWithFloat:.6], - @"inputContrast", [NSNumber numberWithFloat:1.1], - nil]; - CIImage *outputImageB = [filterB outputImage]; - - NSString *framePath = - [[NSBundle mainBundle] pathForResource:@"vintage" ofType:@"png"]; - NSURL *framePathName = [NSURL fileURLWithPath:framePath]; - - CIImage *frameImg = - [CIImage imageWithContentsOfURL:framePathName]; - - CIFilter *filterD = [CIFilter filterWithName:@"CISourceOverCompositing" - keysAndValues: kCIInputImageKey, frameImg, - @"inputBackgroundImage",outputImageB, - nil]; - CIImage *outputImageD = [filterD outputImage]; - - CGImageRef cgimg = - [context createCGImage:outputImageD fromRect:[outputImageD extent]]; - UIImage *newImg = [UIImage imageWithCGImage:cgimg]; - - NSData *imageData = UIImageJPEGRepresentation(newImg,1.0); - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsPath = [paths objectAtIndex:0]; //Get the docs directory - - int r = arc4random() % 5000; - NSString *random = [NSString stringWithFormat:@"%d", r]; - NSString *tPathA = [documentsPath stringByAppendingPathComponent:@"vintage"]; - NSString *tPathB = [tPathA stringByAppendingString:random]; - NSString *filePathB = [tPathB stringByAppendingString:@".jpg"]; - - [imageData writeToFile:filePathB atomically:YES]; - - NSString *save = [options objectForKey:@"save"]; - NSLog(@"SAVED: %@",save); - if([save isEqualToString:@"true"]){ - UIImageWriteToSavedPhotosAlbum(newImg, self,@selector(image:didFinishSavingWithError:contextInfo:), nil); - } - - CGImageRelease(cgimg); - - // CALLBACK TO JAVASCRIPT WITH IMAGE URI - self.callbackID = [arguments pop]; - - PluginResult* pluginResult = [PluginResult resultWithStatus:PGCommandStatus_OK - messageAsString:filePathB]; - - /* Create JS to call the success function with the result */ - NSString *successScript = [pluginResult toSuccessCallbackString:self.callbackID]; - /* Output the script */ - [self writeJavascript:successScript]; -} - -// CAMERA ROLL SAVER -- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error - contextInfo:(void *)contextInfo -{ - // Was there an error? - if (error != NULL) - { - // Show error message... - NSLog(@"ERROR: %@",error); - } - else // No errors - { - // Show message image successfully saved - NSLog(@"IMAGE SAVED!"); - } -} -@end \ No newline at end of file diff --git a/iOS/phonegap/plugin/frames/painter.png b/iOS/phonegap/plugin/frames/painter.png deleted file mode 100644 index 604d8d3..0000000 Binary files a/iOS/phonegap/plugin/frames/painter.png and /dev/null differ diff --git a/iOS/phonegap/plugin/frames/vignette2.png b/iOS/phonegap/plugin/frames/vignette2.png deleted file mode 100644 index d1f0a4f..0000000 Binary files a/iOS/phonegap/plugin/frames/vignette2.png and /dev/null differ diff --git a/iOS/phonegap/plugin/frames/vignette3.png b/iOS/phonegap/plugin/frames/vignette3.png deleted file mode 100644 index d318950..0000000 Binary files a/iOS/phonegap/plugin/frames/vignette3.png and /dev/null differ diff --git a/iOS/phonegap/plugin/frames/vignette4.png b/iOS/phonegap/plugin/frames/vignette4.png deleted file mode 100644 index ea02e9c..0000000 Binary files a/iOS/phonegap/plugin/frames/vignette4.png and /dev/null differ diff --git a/iOS/phonegap/plugin/frames/vintage.png b/iOS/phonegap/plugin/frames/vintage.png deleted file mode 100644 index 0cdb0ea..0000000 Binary files a/iOS/phonegap/plugin/frames/vintage.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter.xcodeproj/project.pbxproj b/iOS/phonegap/project/ImageFilter.xcodeproj/project.pbxproj deleted file mode 100644 index 1581385..0000000 --- a/iOS/phonegap/project/ImageFilter.xcodeproj/project.pbxproj +++ /dev/null @@ -1,525 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 3AAF82A214FB25270084845C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AAF82A114FB25270084845C /* Foundation.framework */; }; - 3AAF82A414FB25270084845C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AAF82A314FB25270084845C /* UIKit.framework */; }; - 3AAF82A614FB25270084845C /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AAF82A514FB25270084845C /* CoreGraphics.framework */; }; - 3AAF82A814FB25270084845C /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AAF82A714FB25270084845C /* AddressBook.framework */; }; - 3AAF82AA14FB25270084845C /* AddressBookUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AAF82A914FB25270084845C /* AddressBookUI.framework */; }; - 3AAF82AC14FB25270084845C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AAF82AB14FB25270084845C /* AudioToolbox.framework */; }; - 3AAF82AE14FB25270084845C /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AAF82AD14FB25270084845C /* AVFoundation.framework */; }; - 3AAF82B014FB25270084845C /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AAF82AF14FB25270084845C /* CoreLocation.framework */; }; - 3AAF82B214FB25270084845C /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AAF82B114FB25270084845C /* MediaPlayer.framework */; }; - 3AAF82B414FB25270084845C /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AAF82B314FB25270084845C /* QuartzCore.framework */; }; - 3AAF82B614FB25270084845C /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AAF82B514FB25270084845C /* SystemConfiguration.framework */; }; - 3AAF82B814FB25270084845C /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AAF82B714FB25270084845C /* MobileCoreServices.framework */; }; - 3AAF82BA14FB25270084845C /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AAF82B914FB25270084845C /* CoreMedia.framework */; }; - 3AAF82C014FB25270084845C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3AAF82BE14FB25270084845C /* InfoPlist.strings */; }; - 3AAF82C214FB25270084845C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AAF82C114FB25270084845C /* main.m */; }; - 3AAF82C514FB25270084845C /* PhoneGap.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AAF82C414FB25270084845C /* PhoneGap.framework */; }; - 3AAF82CA14FB25270084845C /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3AAF82C814FB25270084845C /* Localizable.strings */; }; - 3AAF82CE14FB25270084845C /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3AAF82CC14FB25270084845C /* Localizable.strings */; }; - 3AAF82D114FB25270084845C /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 3AAF82D014FB25270084845C /* icon.png */; }; - 3AAF82D314FB25270084845C /* icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3AAF82D214FB25270084845C /* icon@2x.png */; }; - 3AAF82D514FB25270084845C /* icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 3AAF82D414FB25270084845C /* icon-72.png */; }; - 3AAF82D814FB25270084845C /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 3AAF82D714FB25270084845C /* Default.png */; }; - 3AAF82DA14FB25270084845C /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3AAF82D914FB25270084845C /* Default@2x.png */; }; - 3AAF82DC14FB25270084845C /* Capture.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 3AAF82DB14FB25270084845C /* Capture.bundle */; }; - 3AAF82DE14FB25270084845C /* PhoneGap.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3AAF82DD14FB25270084845C /* PhoneGap.plist */; }; - 3AAF82E214FB25270084845C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AAF82E114FB25270084845C /* AppDelegate.m */; }; - 3AAF82ED14FB25B40084845C /* www in Resources */ = {isa = PBXBuildFile; fileRef = 3AAF82EC14FB25B40084845C /* www */; }; - 3AAF82F214FB29AC0084845C /* init.js in Sources */ = {isa = PBXBuildFile; fileRef = 3AAF82F114FB29AC0084845C /* init.js */; }; - 3AAF82FE14FB2B9A0084845C /* style.css in Resources */ = {isa = PBXBuildFile; fileRef = 3AAF82FD14FB2B9A0084845C /* style.css */; }; - 3AAF830014FB2E690084845C /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AAF82FF14FB2E690084845C /* CoreImage.framework */; }; - 3AAF831014FBC28F0084845C /* painter.png in Resources */ = {isa = PBXBuildFile; fileRef = 3AAF830B14FBC28F0084845C /* painter.png */; }; - 3AAF831114FBC28F0084845C /* vignette2.png in Resources */ = {isa = PBXBuildFile; fileRef = 3AAF830C14FBC28F0084845C /* vignette2.png */; }; - 3AAF831214FBC28F0084845C /* vignette3.png in Resources */ = {isa = PBXBuildFile; fileRef = 3AAF830D14FBC28F0084845C /* vignette3.png */; }; - 3AAF831314FBC28F0084845C /* vignette4.png in Resources */ = {isa = PBXBuildFile; fileRef = 3AAF830E14FBC28F0084845C /* vignette4.png */; }; - 3AAF831414FBC28F0084845C /* vintage.png in Resources */ = {isa = PBXBuildFile; fileRef = 3AAF830F14FBC28F0084845C /* vintage.png */; }; - 3AAF832114FBF76E0084845C /* ImageFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3AAF832014FBF76E0084845C /* ImageFilter.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 3AAF829D14FB25270084845C /* ImageFilter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ImageFilter.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 3AAF82A114FB25270084845C /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 3AAF82A314FB25270084845C /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 3AAF82A514FB25270084845C /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 3AAF82A714FB25270084845C /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; }; - 3AAF82A914FB25270084845C /* AddressBookUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBookUI.framework; path = System/Library/Frameworks/AddressBookUI.framework; sourceTree = SDKROOT; }; - 3AAF82AB14FB25270084845C /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; - 3AAF82AD14FB25270084845C /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; - 3AAF82AF14FB25270084845C /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; - 3AAF82B114FB25270084845C /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; }; - 3AAF82B314FB25270084845C /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - 3AAF82B514FB25270084845C /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; - 3AAF82B714FB25270084845C /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; - 3AAF82B914FB25270084845C /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; - 3AAF82BD14FB25270084845C /* ImageFilter-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ImageFilter-Info.plist"; sourceTree = ""; }; - 3AAF82BF14FB25270084845C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 3AAF82C114FB25270084845C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 3AAF82C314FB25270084845C /* ImageFilter-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ImageFilter-Prefix.pch"; sourceTree = ""; }; - 3AAF82C414FB25270084845C /* PhoneGap.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PhoneGap.framework; path = /Users/Shared/PhoneGap/Frameworks/PhoneGap.framework; sourceTree = ""; }; - 3AAF82C914FB25270084845C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Resources/en.lproj/Localizable.strings; sourceTree = ""; }; - 3AAF82CD14FB25270084845C /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = Resources/es.lproj/Localizable.strings; sourceTree = ""; }; - 3AAF82D014FB25270084845C /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = icon.png; path = Resources/icons/icon.png; sourceTree = ""; }; - 3AAF82D214FB25270084845C /* icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icon@2x.png"; path = "Resources/icons/icon@2x.png"; sourceTree = ""; }; - 3AAF82D414FB25270084845C /* icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icon-72.png"; path = "Resources/icons/icon-72.png"; sourceTree = ""; }; - 3AAF82D714FB25270084845C /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = Resources/splash/Default.png; sourceTree = ""; }; - 3AAF82D914FB25270084845C /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "Resources/splash/Default@2x.png"; sourceTree = ""; }; - 3AAF82DB14FB25270084845C /* Capture.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = Capture.bundle; path = Resources/Capture.bundle; sourceTree = ""; }; - 3AAF82DD14FB25270084845C /* PhoneGap.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = PhoneGap.plist; sourceTree = ""; }; - 3AAF82E014FB25270084845C /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Classes/AppDelegate.h; sourceTree = ""; }; - 3AAF82E114FB25270084845C /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = Classes/AppDelegate.m; sourceTree = ""; }; - 3AAF82E414FB25270084845C /* README */ = {isa = PBXFileReference; lastKnownFileType = text; name = README; path = Plugins/README; sourceTree = ""; }; - 3AAF82EC14FB25B40084845C /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = ""; }; - 3AAF82F114FB29AC0084845C /* init.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = init.js; path = ImageFilter/www/js/init.js; sourceTree = ""; }; - 3AAF82FD14FB2B9A0084845C /* style.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; name = style.css; path = ImageFilter/www/css/style.css; sourceTree = ""; }; - 3AAF82FF14FB2E690084845C /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = System/Library/Frameworks/CoreImage.framework; sourceTree = SDKROOT; }; - 3AAF830B14FBC28F0084845C /* painter.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = painter.png; sourceTree = ""; }; - 3AAF830C14FBC28F0084845C /* vignette2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = vignette2.png; sourceTree = ""; }; - 3AAF830D14FBC28F0084845C /* vignette3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = vignette3.png; sourceTree = ""; }; - 3AAF830E14FBC28F0084845C /* vignette4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = vignette4.png; sourceTree = ""; }; - 3AAF830F14FBC28F0084845C /* vintage.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = vintage.png; sourceTree = ""; }; - 3AAF831F14FBF76E0084845C /* ImageFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageFilter.h; sourceTree = ""; }; - 3AAF832014FBF76E0084845C /* ImageFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageFilter.m; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 3AAF829714FB25270084845C /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3AAF830014FB2E690084845C /* CoreImage.framework in Frameworks */, - 3AAF82A214FB25270084845C /* Foundation.framework in Frameworks */, - 3AAF82A414FB25270084845C /* UIKit.framework in Frameworks */, - 3AAF82A614FB25270084845C /* CoreGraphics.framework in Frameworks */, - 3AAF82A814FB25270084845C /* AddressBook.framework in Frameworks */, - 3AAF82AA14FB25270084845C /* AddressBookUI.framework in Frameworks */, - 3AAF82AC14FB25270084845C /* AudioToolbox.framework in Frameworks */, - 3AAF82AE14FB25270084845C /* AVFoundation.framework in Frameworks */, - 3AAF82B014FB25270084845C /* CoreLocation.framework in Frameworks */, - 3AAF82B214FB25270084845C /* MediaPlayer.framework in Frameworks */, - 3AAF82B414FB25270084845C /* QuartzCore.framework in Frameworks */, - 3AAF82B614FB25270084845C /* SystemConfiguration.framework in Frameworks */, - 3AAF82B814FB25270084845C /* MobileCoreServices.framework in Frameworks */, - 3AAF82BA14FB25270084845C /* CoreMedia.framework in Frameworks */, - 3AAF82C514FB25270084845C /* PhoneGap.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 3AAF829A14FB25270084845C /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 3AAF828F14FB25270084845C = { - isa = PBXGroup; - children = ( - 3AAF82FD14FB2B9A0084845C /* style.css */, - 3AAF82F114FB29AC0084845C /* init.js */, - 3AAF82BB14FB25270084845C /* ImageFilter */, - 3AAF82A014FB25270084845C /* Frameworks */, - 3AAF829E14FB25270084845C /* Products */, - ); - sourceTree = ""; - }; - 3AAF829E14FB25270084845C /* Products */ = { - isa = PBXGroup; - children = ( - 3AAF829D14FB25270084845C /* ImageFilter.app */, - ); - name = Products; - sourceTree = ""; - }; - 3AAF82A014FB25270084845C /* Frameworks */ = { - isa = PBXGroup; - children = ( - 3AAF82FF14FB2E690084845C /* CoreImage.framework */, - 3AAF82A114FB25270084845C /* Foundation.framework */, - 3AAF82A314FB25270084845C /* UIKit.framework */, - 3AAF82A514FB25270084845C /* CoreGraphics.framework */, - 3AAF82A714FB25270084845C /* AddressBook.framework */, - 3AAF82A914FB25270084845C /* AddressBookUI.framework */, - 3AAF82AB14FB25270084845C /* AudioToolbox.framework */, - 3AAF82AD14FB25270084845C /* AVFoundation.framework */, - 3AAF82AF14FB25270084845C /* CoreLocation.framework */, - 3AAF82B114FB25270084845C /* MediaPlayer.framework */, - 3AAF82B314FB25270084845C /* QuartzCore.framework */, - 3AAF82B514FB25270084845C /* SystemConfiguration.framework */, - 3AAF82B714FB25270084845C /* MobileCoreServices.framework */, - 3AAF82B914FB25270084845C /* CoreMedia.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 3AAF82BB14FB25270084845C /* ImageFilter */ = { - isa = PBXGroup; - children = ( - 3AAF82EC14FB25B40084845C /* www */, - 3AAF82C414FB25270084845C /* PhoneGap.framework */, - 3AAF82C614FB25270084845C /* Resources */, - 3AAF82DF14FB25270084845C /* Classes */, - 3AAF82E314FB25270084845C /* Plugins */, - 3AAF82BC14FB25270084845C /* Supporting Files */, - ); - path = ImageFilter; - sourceTree = ""; - }; - 3AAF82BC14FB25270084845C /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 3AAF82BD14FB25270084845C /* ImageFilter-Info.plist */, - 3AAF82BE14FB25270084845C /* InfoPlist.strings */, - 3AAF82C114FB25270084845C /* main.m */, - 3AAF82C314FB25270084845C /* ImageFilter-Prefix.pch */, - 3AAF82DD14FB25270084845C /* PhoneGap.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 3AAF82C614FB25270084845C /* Resources */ = { - isa = PBXGroup; - children = ( - 3AAF830B14FBC28F0084845C /* painter.png */, - 3AAF830C14FBC28F0084845C /* vignette2.png */, - 3AAF830D14FBC28F0084845C /* vignette3.png */, - 3AAF830E14FBC28F0084845C /* vignette4.png */, - 3AAF830F14FBC28F0084845C /* vintage.png */, - 3AAF82DB14FB25270084845C /* Capture.bundle */, - 3AAF82C714FB25270084845C /* en.lproj */, - 3AAF82CB14FB25270084845C /* es.lproj */, - 3AAF82CF14FB25270084845C /* icons */, - 3AAF82D614FB25270084845C /* splash */, - ); - name = Resources; - sourceTree = ""; - }; - 3AAF82C714FB25270084845C /* en.lproj */ = { - isa = PBXGroup; - children = ( - 3AAF82C814FB25270084845C /* Localizable.strings */, - ); - name = en.lproj; - sourceTree = ""; - }; - 3AAF82CB14FB25270084845C /* es.lproj */ = { - isa = PBXGroup; - children = ( - 3AAF82CC14FB25270084845C /* Localizable.strings */, - ); - name = es.lproj; - sourceTree = ""; - }; - 3AAF82CF14FB25270084845C /* icons */ = { - isa = PBXGroup; - children = ( - 3AAF82D014FB25270084845C /* icon.png */, - 3AAF82D214FB25270084845C /* icon@2x.png */, - 3AAF82D414FB25270084845C /* icon-72.png */, - ); - name = icons; - sourceTree = ""; - }; - 3AAF82D614FB25270084845C /* splash */ = { - isa = PBXGroup; - children = ( - 3AAF82D714FB25270084845C /* Default.png */, - 3AAF82D914FB25270084845C /* Default@2x.png */, - ); - name = splash; - sourceTree = ""; - }; - 3AAF82DF14FB25270084845C /* Classes */ = { - isa = PBXGroup; - children = ( - 3AAF82E014FB25270084845C /* AppDelegate.h */, - 3AAF82E114FB25270084845C /* AppDelegate.m */, - ); - name = Classes; - sourceTree = ""; - }; - 3AAF82E314FB25270084845C /* Plugins */ = { - isa = PBXGroup; - children = ( - 3AAF831F14FBF76E0084845C /* ImageFilter.h */, - 3AAF832014FBF76E0084845C /* ImageFilter.m */, - 3AAF82E414FB25270084845C /* README */, - ); - name = Plugins; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 3AAF829C14FB25270084845C /* ImageFilter */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3AAF82E714FB25270084845C /* Build configuration list for PBXNativeTarget "ImageFilter" */; - buildPhases = ( - 3AAF829614FB25270084845C /* Sources */, - 3AAF829714FB25270084845C /* Frameworks */, - 3AAF829814FB25270084845C /* Resources */, - 3AAF829914FB25270084845C /* Sources */, - 3AAF829A14FB25270084845C /* Frameworks */, - 3AAF829B14FB25270084845C /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = ImageFilter; - productName = ImageFilter; - productReference = 3AAF829D14FB25270084845C /* ImageFilter.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 3AAF829114FB25270084845C /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0420; - }; - buildConfigurationList = 3AAF829414FB25270084845C /* Build configuration list for PBXProject "ImageFilter" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - es, - ); - mainGroup = 3AAF828F14FB25270084845C; - productRefGroup = 3AAF829E14FB25270084845C /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 3AAF829C14FB25270084845C /* ImageFilter */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 3AAF829814FB25270084845C /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3AAF82C014FB25270084845C /* InfoPlist.strings in Resources */, - 3AAF82CA14FB25270084845C /* Localizable.strings in Resources */, - 3AAF82CE14FB25270084845C /* Localizable.strings in Resources */, - 3AAF82D114FB25270084845C /* icon.png in Resources */, - 3AAF82D314FB25270084845C /* icon@2x.png in Resources */, - 3AAF82D514FB25270084845C /* icon-72.png in Resources */, - 3AAF82D814FB25270084845C /* Default.png in Resources */, - 3AAF82DA14FB25270084845C /* Default@2x.png in Resources */, - 3AAF82DC14FB25270084845C /* Capture.bundle in Resources */, - 3AAF82DE14FB25270084845C /* PhoneGap.plist in Resources */, - 3AAF82ED14FB25B40084845C /* www in Resources */, - 3AAF82FE14FB2B9A0084845C /* style.css in Resources */, - 3AAF831014FBC28F0084845C /* painter.png in Resources */, - 3AAF831114FBC28F0084845C /* vignette2.png in Resources */, - 3AAF831214FBC28F0084845C /* vignette3.png in Resources */, - 3AAF831314FBC28F0084845C /* vignette4.png in Resources */, - 3AAF831414FBC28F0084845C /* vintage.png in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3AAF829B14FB25270084845C /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/bash; - shellScript = "\n\t\t\t\t\t\t\t\tif [ ! -d \"$PROJECT_DIR/www\" ] ; then\n\t\t\t\t\t\t\t\t\tcp -R /Users/Shared/PhoneGap/Frameworks/PhoneGap.framework/www \"$PROJECT_DIR\"\n\t\t\t\t\t\t\t\tfi\n\t\t\t\t\t\t\t\t# detect www folder reference in project, if missing, print warning\n\t\t\t\t\t\t\t\tgrep \"{isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = \\\"\\\"; };\" \"$PROJECT_DIR/$PROJECT_NAME.xcodeproj/project.pbxproj\"\n\t\t\t\t\t\t\t\trc=$? \n\t\t\t\t\t\t\t\tif [ $rc != 0 ] ; then\n\t\t\t\t\t\t\t\techo -e \"warning: Missing - Add $PROJECT_DIR/www as a folder reference in your project. Just drag and drop the folder into your project, into the Project Navigator of Xcode 4. Make sure you select the second radio-button: 'Create folder references for any added folders' (which will create a blue folder)\" 1>&2\n\t\t\t\t\t\t\t\tfi\t\t\t\t\t\t\t"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 3AAF829614FB25270084845C /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3AAF82C214FB25270084845C /* main.m in Sources */, - 3AAF82E214FB25270084845C /* AppDelegate.m in Sources */, - 3AAF82F214FB29AC0084845C /* init.js in Sources */, - 3AAF832114FBF76E0084845C /* ImageFilter.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 3AAF829914FB25270084845C /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 3AAF82BE14FB25270084845C /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 3AAF82BF14FB25270084845C /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; - 3AAF82C814FB25270084845C /* Localizable.strings */ = { - isa = PBXVariantGroup; - children = ( - 3AAF82C914FB25270084845C /* en */, - ); - name = Localizable.strings; - sourceTree = ""; - }; - 3AAF82CC14FB25270084845C /* Localizable.strings */ = { - isa = PBXVariantGroup; - children = ( - 3AAF82CD14FB25270084845C /* es */, - ); - name = Localizable.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 3AAF82E514FB25270084845C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CLANG_ENABLE_OBJC_ARC = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_VERSION = com.apple.compilers.llvmgcc42; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 3.0; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 3AAF82E614FB25270084845C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CLANG_ENABLE_OBJC_ARC = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_VERSION = com.apple.compilers.llvmgcc42; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 3.0; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 3AAF82E814FB25270084845C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; - COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = /Users/Shared/PhoneGap/Frameworks; - GCC_DYNAMIC_NO_PIC = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "ImageFilter/ImageFilter-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = "PHONEGAP_FRAMEWORK=YES"; - INFOPLIST_FILE = "ImageFilter/ImageFilter-Info.plist"; - OTHER_LDFLAGS = ( - "-weak_framework", - UIKit, - "-weak_framework", - AVFoundation, - "-weak_framework", - CoreMedia, - "-weak_library", - /usr/lib/libSystem.B.dylib, - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - 3AAF82E914FB25270084845C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - FRAMEWORK_SEARCH_PATHS = /Users/Shared/PhoneGap/Frameworks; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "ImageFilter/ImageFilter-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = "PHONEGAP_FRAMEWORK=YES"; - INFOPLIST_FILE = "ImageFilter/ImageFilter-Info.plist"; - OTHER_LDFLAGS = ( - "-weak_framework", - UIKit, - "-weak_framework", - AVFoundation, - "-weak_framework", - CoreMedia, - "-weak_library", - /usr/lib/libSystem.B.dylib, - ); - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 3AAF829414FB25270084845C /* Build configuration list for PBXProject "ImageFilter" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3AAF82E514FB25270084845C /* Debug */, - 3AAF82E614FB25270084845C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 3AAF82E714FB25270084845C /* Build configuration list for PBXNativeTarget "ImageFilter" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3AAF82E814FB25270084845C /* Debug */, - 3AAF82E914FB25270084845C /* Release */, - ); - defaultConfigurationIsVisible = 0; - }; -/* End XCConfigurationList section */ - }; - rootObject = 3AAF829114FB25270084845C /* Project object */; -} diff --git a/iOS/phonegap/project/ImageFilter.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/iOS/phonegap/project/ImageFilter.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index bab1a40..0000000 --- a/iOS/phonegap/project/ImageFilter.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/iOS/phonegap/project/ImageFilter.xcodeproj/project.xcworkspace/xcuserdata/Drew.xcuserdatad/UserInterfaceState.xcuserstate b/iOS/phonegap/project/ImageFilter.xcodeproj/project.xcworkspace/xcuserdata/Drew.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index 87ab505..0000000 Binary files a/iOS/phonegap/project/ImageFilter.xcodeproj/project.xcworkspace/xcuserdata/Drew.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter.xcodeproj/xcuserdata/Drew.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/iOS/phonegap/project/ImageFilter.xcodeproj/xcuserdata/Drew.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist deleted file mode 100644 index cb611db..0000000 --- a/iOS/phonegap/project/ImageFilter.xcodeproj/xcuserdata/Drew.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/iOS/phonegap/project/ImageFilter.xcodeproj/xcuserdata/Drew.xcuserdatad/xcschemes/ImageFilter.xcscheme b/iOS/phonegap/project/ImageFilter.xcodeproj/xcuserdata/Drew.xcuserdatad/xcschemes/ImageFilter.xcscheme deleted file mode 100644 index db76db7..0000000 --- a/iOS/phonegap/project/ImageFilter.xcodeproj/xcuserdata/Drew.xcuserdatad/xcschemes/ImageFilter.xcscheme +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/iOS/phonegap/project/ImageFilter.xcodeproj/xcuserdata/Drew.xcuserdatad/xcschemes/xcschememanagement.plist b/iOS/phonegap/project/ImageFilter.xcodeproj/xcuserdata/Drew.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index a7a56da..0000000 --- a/iOS/phonegap/project/ImageFilter.xcodeproj/xcuserdata/Drew.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - SchemeUserState - - ImageFilter.xcscheme - - orderHint - 0 - - - SuppressBuildableAutocreation - - 3AAF829C14FB25270084845C - - primary - - - - - diff --git a/iOS/phonegap/project/ImageFilter/Classes/AppDelegate.h b/iOS/phonegap/project/ImageFilter/Classes/AppDelegate.h deleted file mode 100644 index d98dc89..0000000 --- a/iOS/phonegap/project/ImageFilter/Classes/AppDelegate.h +++ /dev/null @@ -1,29 +0,0 @@ -// -// AppDelegate.h -// ImageFilter -// -// Created by Andrew Dahlman on 2/26/12. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// - -#import -#ifdef PHONEGAP_FRAMEWORK - #import -#else - #import "PhoneGapDelegate.h" -#endif - -@interface AppDelegate : PhoneGapDelegate { - - NSString* invokeString; -} - -// invoke string is passed to your app on launch, this is only valid if you -// edit ImageFilter.plist to add a protocol -// a simple tutorial can be found here : -// http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html - -@property (copy) NSString* invokeString; - -@end - diff --git a/iOS/phonegap/project/ImageFilter/Classes/AppDelegate.m b/iOS/phonegap/project/ImageFilter/Classes/AppDelegate.m deleted file mode 100644 index 7c55dd5..0000000 --- a/iOS/phonegap/project/ImageFilter/Classes/AppDelegate.m +++ /dev/null @@ -1,112 +0,0 @@ -// -// AppDelegate.m -// ImageFilter -// -// Created by Andrew Dahlman on 2/26/12. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// - -#import "AppDelegate.h" -#ifdef PHONEGAP_FRAMEWORK - #import -#else - #import "PhoneGapViewController.h" -#endif - -@implementation AppDelegate - -@synthesize invokeString; - -- (id) init -{ - /** If you need to do any extra app-specific initialization, you can do it here - * -jm - **/ - return [super init]; -} - -/** - * This is main kick off after the app inits, the views and Settings are setup here. (preferred - iOS4 and up) - */ -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - - NSArray *keyArray = [launchOptions allKeys]; - if ([launchOptions objectForKey:[keyArray objectAtIndex:0]]!=nil) - { - NSURL *url = [launchOptions objectForKey:[keyArray objectAtIndex:0]]; - self.invokeString = [url absoluteString]; - NSLog(@"ImageFilter launchOptions = %@",url); - } - - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -// this happens while we are running ( in the background, or from within our own app ) -// only valid if ImageFilter.plist specifies a protocol to handle -- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url -{ - // must call super so all plugins will get the notification, and their handlers will be called - // super also calls into javascript global function 'handleOpenURL' - return [super application:application handleOpenURL:url]; -} - --(id) getCommandInstance:(NSString*)className -{ - /** You can catch your own commands here, if you wanted to extend the gap: protocol, or add your - * own app specific protocol to it. -jm - **/ - return [super getCommandInstance:className]; -} - -/** - Called when the webview finishes loading. This stops the activity view and closes the imageview - */ -- (void)webViewDidFinishLoad:(UIWebView *)theWebView -{ - // only valid if ImageFilter.plist specifies a protocol to handle - if(self.invokeString) - { - // this is passed before the deviceready event is fired, so you can access it in js when you receive deviceready - NSString* jsString = [NSString stringWithFormat:@"var invokeString = \"%@\";", self.invokeString]; - [theWebView stringByEvaluatingJavaScriptFromString:jsString]; - } - return [ super webViewDidFinishLoad:theWebView ]; -} - -- (void)webViewDidStartLoad:(UIWebView *)theWebView -{ - return [ super webViewDidStartLoad:theWebView ]; -} - -/** - * Fail Loading With Error - * Error - If the webpage failed to load display an error with the reason. - */ -- (void)webView:(UIWebView *)theWebView didFailLoadWithError:(NSError *)error -{ - return [ super webView:theWebView didFailLoadWithError:error ]; -} - -/** - * Start Loading Request - * This is where most of the magic happens... We take the request(s) and process the response. - * From here we can re direct links and other protocalls to different internal methods. - */ -- (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType -{ - return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ]; -} - - -- (BOOL) execute:(InvokedUrlCommand*)command -{ - return [ super execute:command]; -} - -- (void)dealloc -{ - [ super dealloc ]; -} - -@end diff --git a/iOS/phonegap/project/ImageFilter/ImageFilter-Info.plist b/iOS/phonegap/project/ImageFilter/ImageFilter-Info.plist deleted file mode 100644 index 4fd3f6c..0000000 --- a/iOS/phonegap/project/ImageFilter/ImageFilter-Info.plist +++ /dev/null @@ -1,49 +0,0 @@ - - - - - CFBundleIconFiles - - icon.png - icon@2x.png - icon-72.png - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - CFBundleDevelopmentRegion - English - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - icon.png - CFBundleIdentifier - com.drewdahlman.ImageFilter - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - NSMainNibFile - - NSMainNibFile~ipad - - - diff --git a/iOS/phonegap/project/ImageFilter/ImageFilter-Prefix.pch b/iOS/phonegap/project/ImageFilter/ImageFilter-Prefix.pch deleted file mode 100644 index 1f2aee1..0000000 --- a/iOS/phonegap/project/ImageFilter/ImageFilter-Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'ImageFilter' target in the 'ImageFilter' project -// - -#ifdef __OBJC__ - #import -#endif diff --git a/iOS/phonegap/project/ImageFilter/ImageFilter.h b/iOS/phonegap/project/ImageFilter/ImageFilter.h deleted file mode 100644 index 5399ea4..0000000 --- a/iOS/phonegap/project/ImageFilter/ImageFilter.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// ImageFilter.h -// -// Created by Drew Dahlman 2/25/2012. -// Copyright 2012 Drew Dahlman. All rights reserved. -// version 1.0 - -// Current Filters: -// none -// stark -// sunnySide -// worn -// vintage - -/* -Copyright (c) 2012 Drew Dahlman MIT LICENSE -*/ - - -#import - -#ifdef PHONEGAP_FRAMEWORK -#import -#else -#import "PGPlugin.h" -#endif - - -@interface ImageFilter : PGPlugin { - NSString* callbackID; -} -@property (nonatomic, retain) NSString* callbackID; - - -// GARBAGE -- (void)clean:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; - -// FILTERS -- (void)none:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; -- (void)stark:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; -- (void)sunnySide:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; -- (void)worn:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; -- (void)vintage:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; -@end diff --git a/iOS/phonegap/project/ImageFilter/ImageFilter.m b/iOS/phonegap/project/ImageFilter/ImageFilter.m deleted file mode 100644 index f96b7f4..0000000 --- a/iOS/phonegap/project/ImageFilter/ImageFilter.m +++ /dev/null @@ -1,407 +0,0 @@ -// -// ImageFilter.m -// -// Created by Drew Dahlman 2/25/2012. -// Copyright 2012 Drew Dahlman. All rights reserved. -// version 1.0 - -/* - Copyright (c) 2012 Drew Dahlman MIT LICENSE*/ - -#import -#import "ImageFilter.h" -#import -@implementation ImageFilter -@synthesize callbackID; - -// For clean up purposes sometimes the apps will cache images, so this cleans things up --(void)clean:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options -{ - // Path to the Documents directory - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - if ([paths count] > 0) - { - NSError *error = nil; - NSFileManager *fileManager = [NSFileManager defaultManager]; - - // Print out the path to verify we are in the right place - NSString *directory = [paths objectAtIndex:0]; - NSLog(@"Directory: %@", directory); - - // For each file in the directory, create full path and delete the file - for (NSString *file in [fileManager contentsOfDirectoryAtPath:directory error:&error]) - { - NSString *filePath = [directory stringByAppendingPathComponent:file]; - NSLog(@"File : %@", filePath); - - BOOL fileDeleted = [fileManager removeItemAtPath:filePath error:&error]; - - if (fileDeleted != YES || error != nil) - { - - } - } - - } - NSLog(@"CLEAN!"); -} - -// FILTERS -// Each filter uses the CoreImage Framework, and can be changed and added to. -// If you wish to create a new filter use the none as a template. --(void)none:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options -{ - // Start by getting path to image - NSString *filePath = [options objectForKey:@"image"]; - // CREATE NSURL - NSURL *fileNameAndPath = [NSURL URLWithString:filePath]; - NSLog(@"FILE PATH: %@",fileNameAndPath); - - // DEFINE OUR CIImage - CIImage *beginImage = - [CIImage imageWithContentsOfURL:fileNameAndPath]; - CIContext *context = [CIContext contextWithOptions:nil]; - - // DO ALL MODIFICATIONS HERE. - - - // CREATE CIIMageRef from our CIImage - // Be sure to reference the correct CIImage in both the createCGIImage and fromRect - CGImageRef cgimg = - [context createCGImage:beginImage fromRect:[beginImage extent]]; - - // CREATE UIImage out of CIImage - UIImage *newImg = [UIImage imageWithCGImage:cgimg]; - - // GET IMAGE DATA AND CONSTRUCT URL TO THE APPS DOCUMENT FOLDER - NSData *imageData = UIImageJPEGRepresentation(newImg,1.0); - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsPath = [paths objectAtIndex:0]; - NSString *filePathB = [documentsPath stringByAppendingPathComponent:@"none.jpg"]; - - // SAVE IMAGE DATA TO DOCUMENTS FOLDER - [imageData writeToFile:filePathB atomically:YES]; - - // CHECK IF THE SAVE KEY IS SET TO TRU - NSString *save = [options objectForKey:@"save"]; - NSLog(@"SAVED: %@",save); - - // IF TRUE THEN SAVE IMAGE TO CAMERA ROLL - if([save isEqualToString:@"true"]){ - UIImageWriteToSavedPhotosAlbum(newImg, self,@selector(image:didFinishSavingWithError:contextInfo:), nil); - } - - // RELEASE OUR IMAGE AND DONE - CGImageRelease(cgimg); - - // CALLBACK TO JAVASCRIPT WITH IMAGE URI - self.callbackID = [arguments pop]; - - PluginResult* pluginResult = [PluginResult resultWithStatus:PGCommandStatus_OK - messageAsString:filePathB]; - - /* Create JS to call the success function with the result */ - NSString *successScript = [pluginResult toSuccessCallbackString:self.callbackID]; - /* Output the script */ - [self writeJavascript:successScript]; - - - -} --(void)stark:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options -{ - - NSString *filePath = [options objectForKey:@"image"]; - NSURL *fileNameAndPath = [NSURL URLWithString:filePath]; - - CIImage *beginImage = - [CIImage imageWithContentsOfURL:fileNameAndPath]; - CIContext *context = [CIContext contextWithOptions:nil]; - - CIFilter *filter = [CIFilter filterWithName:@"CIColorControls" - keysAndValues: kCIInputImageKey, beginImage, - @"inputSaturation", [NSNumber numberWithFloat:.1], - @"inputContrast", [NSNumber numberWithFloat:1], - nil]; - CIImage *outputImage = [filter outputImage]; - - CIFilter *filterB = [CIFilter filterWithName:@"CIGammaAdjust" - keysAndValues: kCIInputImageKey, outputImage, - @"inputPower", [NSNumber numberWithFloat:1.5], - nil]; - - CIImage *outputImageB = [filterB outputImage]; - - CGImageRef cgimg = - [context createCGImage:outputImageB fromRect:[outputImageB extent]]; - UIImage *newImg = [UIImage imageWithCGImage:cgimg]; - - NSData *imageData = UIImageJPEGRepresentation(newImg,1.0); - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsPath = [paths objectAtIndex:0]; //Get the docs directory - - int r = arc4random() % 5000; - NSString *random = [NSString stringWithFormat:@"%d", r]; - NSString *tPathA = [documentsPath stringByAppendingPathComponent:@"stark"]; - NSString *tPathB = [tPathA stringByAppendingString:random]; - NSString *filePathB = [tPathB stringByAppendingString:@".jpg"]; - - [imageData writeToFile:filePathB atomically:YES]; - - NSString *save = [options objectForKey:@"save"]; - NSLog(@"SAVED: %@",save); - if([save isEqualToString:@"true"]){ - UIImageWriteToSavedPhotosAlbum(newImg, self,@selector(image:didFinishSavingWithError:contextInfo:), nil); - } - CGImageRelease(cgimg); - - // CALLBACK TO JAVASCRIPT WITH IMAGE URI - self.callbackID = [arguments pop]; - - PluginResult* pluginResult = [PluginResult resultWithStatus:PGCommandStatus_OK - messageAsString:filePathB]; - - /* Create JS to call the success function with the result */ - NSString *successScript = [pluginResult toSuccessCallbackString:self.callbackID]; - /* Output the script */ - [self writeJavascript:successScript]; -} --(void)sunnySide:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options -{ - // FILTER - NSString *filePath = [options objectForKey:@"image"]; - NSURL *fileNameAndPath = [NSURL URLWithString:filePath]; - - CIImage *beginImage = - [CIImage imageWithContentsOfURL:fileNameAndPath]; - CIContext *context = [CIContext contextWithOptions:nil]; - - CIFilter *filter = [CIFilter filterWithName:@"CIWhitePointAdjust" - keysAndValues: kCIInputImageKey, beginImage, - @"inputColor",[CIColor colorWithRed:254 green:197 blue:0 alpha:1], - nil]; - CIImage *outputImage = [filter outputImage]; - - CIFilter *filterB = [CIFilter filterWithName:@"CITemperatureAndTint" - keysAndValues: kCIInputImageKey, outputImage, - @"inputNeutral",[CIVector vectorWithX:5500 Y:1300 Z:0], - @"inputTargetNeutral",[CIVector vectorWithX:4000 Y:0 Z:0], - nil]; - CIImage *outputImageB = [filterB outputImage]; - - NSString *bgPath = - [[NSBundle mainBundle] pathForResource:@"painter" ofType:@"png"]; - NSURL *bgPathName = [NSURL fileURLWithPath:bgPath]; - - CIImage *bgIMG = - [CIImage imageWithContentsOfURL:bgPathName]; - - CIFilter *filterD = [CIFilter filterWithName:@"CISourceOverCompositing" - keysAndValues: kCIInputImageKey, bgIMG, - @"inputBackgroundImage",outputImageB, - nil]; - CIImage *outputImageD = [filterD outputImage]; - - CGImageRef cgimg = - [context createCGImage:outputImageD fromRect:[outputImageD extent]]; - UIImage *newImg = [UIImage imageWithCGImage:cgimg]; - - NSData *imageData = UIImageJPEGRepresentation(newImg,1.0); - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsPath = [paths objectAtIndex:0]; //Get the docs directory - - int r = arc4random() % 5000; - NSString *random = [NSString stringWithFormat:@"%d", r]; - NSString *tPathA = [documentsPath stringByAppendingPathComponent:@"sunnyside"]; - NSString *tPathB = [tPathA stringByAppendingString:random]; - NSString *filePathB = [tPathB stringByAppendingString:@".jpg"]; - - [imageData writeToFile:filePathB atomically:YES]; - - NSString *save = [options objectForKey:@"save"]; - NSLog(@"SAVED: %@",save); - if([save isEqualToString:@"true"]){ - UIImageWriteToSavedPhotosAlbum(newImg, self,@selector(image:didFinishSavingWithError:contextInfo:), nil); - } - - CGImageRelease(cgimg); - - // CALLBACK TO JAVASCRIPT WITH IMAGE URI - self.callbackID = [arguments pop]; - - PluginResult* pluginResult = [PluginResult resultWithStatus:PGCommandStatus_OK - messageAsString:filePathB]; - - /* Create JS to call the success function with the result */ - NSString *successScript = [pluginResult toSuccessCallbackString:self.callbackID]; - /* Output the script */ - [self writeJavascript:successScript]; - -} --(void)worn:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options -{ - // FILTER - NSString *filePath = [options objectForKey:@"image"]; - NSURL *fileNameAndPath = [NSURL URLWithString:filePath]; - - CIImage *beginImage = - [CIImage imageWithContentsOfURL:fileNameAndPath]; - CIContext *context = [CIContext contextWithOptions:nil]; - - CIFilter *filter = [CIFilter filterWithName:@"CIWhitePointAdjust" - keysAndValues: kCIInputImageKey, beginImage, - @"inputColor",[CIColor colorWithRed:212 green:235 blue:241 alpha:1], - nil]; - CIImage *outputImage = [filter outputImage]; - - CIFilter *filterB = [CIFilter filterWithName:@"CIColorControls" - keysAndValues: kCIInputImageKey, outputImage, - @"inputSaturation", [NSNumber numberWithFloat:.6], - @"inputContrast", [NSNumber numberWithFloat:1], - nil]; - CIImage *outputImageB = [filterB outputImage]; - - CIFilter *filterC = [CIFilter filterWithName:@"CITemperatureAndTint" - keysAndValues: kCIInputImageKey, outputImageB, - @"inputNeutral",[CIVector vectorWithX:6500 Y:2000 Z:0], - @"inputTargetNeutral",[CIVector vectorWithX:5200 Y:0 Z:0], - nil]; - CIImage *outputImageC = [filterC outputImage]; - - NSString *framePath = - [[NSBundle mainBundle] pathForResource:@"vignette4" ofType:@"png"]; - NSURL *framePathName = [NSURL fileURLWithPath:framePath]; - - CIImage *frameImg = - [CIImage imageWithContentsOfURL:framePathName]; - - CIFilter *filterD = [CIFilter filterWithName:@"CISourceOverCompositing" - keysAndValues: kCIInputImageKey, frameImg, - @"inputBackgroundImage",outputImageC, - nil]; - CIImage *outputImageD = [filterD outputImage]; - - CGImageRef cgimg = - [context createCGImage:outputImageD fromRect:[outputImageD extent]]; - UIImage *newImg = [UIImage imageWithCGImage:cgimg]; - - NSData *imageData = UIImageJPEGRepresentation(newImg,1.0); - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsPath = [paths objectAtIndex:0]; //Get the docs directory - - int r = arc4random() % 5000; - NSString *random = [NSString stringWithFormat:@"%d", r]; - NSString *tPathA = [documentsPath stringByAppendingPathComponent:@"worn"]; - NSString *tPathB = [tPathA stringByAppendingString:random]; - NSString *filePathB = [tPathB stringByAppendingString:@".jpg"]; - - [imageData writeToFile:filePathB atomically:YES]; - - NSString *save = [options objectForKey:@"save"]; - NSLog(@"SAVED: %@",save); - if([save isEqualToString:@"true"]){ - UIImageWriteToSavedPhotosAlbum(newImg, self,@selector(image:didFinishSavingWithError:contextInfo:), nil); - } - CGImageRelease(cgimg); - - // CALLBACK TO JAVASCRIPT WITH IMAGE URI - self.callbackID = [arguments pop]; - - PluginResult* pluginResult = [PluginResult resultWithStatus:PGCommandStatus_OK - messageAsString:filePathB]; - - /* Create JS to call the success function with the result */ - NSString *successScript = [pluginResult toSuccessCallbackString:self.callbackID]; - /* Output the script */ - [self writeJavascript:successScript]; - -} --(void)vintage:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options -{ - // FILTER - NSString *filePath = [options objectForKey:@"image"]; - NSURL *fileNameAndPath = [NSURL URLWithString:filePath]; - - CIImage *beginImage = - [CIImage imageWithContentsOfURL:fileNameAndPath]; - CIContext *context = [CIContext contextWithOptions:nil]; - - CIFilter *filter = [CIFilter filterWithName:@"CIWhitePointAdjust" - keysAndValues: kCIInputImageKey, beginImage, - @"inputColor",[CIColor colorWithRed:121 green:195 blue:219 alpha:1], - nil]; - CIImage *outputImage = [filter outputImage]; - - CIFilter *filterB = [CIFilter filterWithName:@"CIColorControls" - keysAndValues: kCIInputImageKey, outputImage, - @"inputSaturation", [NSNumber numberWithFloat:.6], - @"inputContrast", [NSNumber numberWithFloat:1.1], - nil]; - CIImage *outputImageB = [filterB outputImage]; - - NSString *framePath = - [[NSBundle mainBundle] pathForResource:@"vintage" ofType:@"png"]; - NSURL *framePathName = [NSURL fileURLWithPath:framePath]; - - CIImage *frameImg = - [CIImage imageWithContentsOfURL:framePathName]; - - CIFilter *filterD = [CIFilter filterWithName:@"CISourceOverCompositing" - keysAndValues: kCIInputImageKey, frameImg, - @"inputBackgroundImage",outputImageB, - nil]; - CIImage *outputImageD = [filterD outputImage]; - - CGImageRef cgimg = - [context createCGImage:outputImageD fromRect:[outputImageD extent]]; - UIImage *newImg = [UIImage imageWithCGImage:cgimg]; - - NSData *imageData = UIImageJPEGRepresentation(newImg,1.0); - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsPath = [paths objectAtIndex:0]; //Get the docs directory - - int r = arc4random() % 5000; - NSString *random = [NSString stringWithFormat:@"%d", r]; - NSString *tPathA = [documentsPath stringByAppendingPathComponent:@"vintage"]; - NSString *tPathB = [tPathA stringByAppendingString:random]; - NSString *filePathB = [tPathB stringByAppendingString:@".jpg"]; - - [imageData writeToFile:filePathB atomically:YES]; - - NSString *save = [options objectForKey:@"save"]; - NSLog(@"SAVED: %@",save); - if([save isEqualToString:@"true"]){ - UIImageWriteToSavedPhotosAlbum(newImg, self,@selector(image:didFinishSavingWithError:contextInfo:), nil); - } - - CGImageRelease(cgimg); - - // CALLBACK TO JAVASCRIPT WITH IMAGE URI - self.callbackID = [arguments pop]; - - PluginResult* pluginResult = [PluginResult resultWithStatus:PGCommandStatus_OK - messageAsString:filePathB]; - - /* Create JS to call the success function with the result */ - NSString *successScript = [pluginResult toSuccessCallbackString:self.callbackID]; - /* Output the script */ - [self writeJavascript:successScript]; -} - -// CAMERA ROLL SAVER -- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error - contextInfo:(void *)contextInfo -{ - // Was there an error? - if (error != NULL) - { - // Show error message... - NSLog(@"ERROR: %@",error); - } - else // No errors - { - // Show message image successfully saved - NSLog(@"IMAGE SAVED!"); - } -} -@end \ No newline at end of file diff --git a/iOS/phonegap/project/ImageFilter/PhoneGap.plist b/iOS/phonegap/project/ImageFilter/PhoneGap.plist deleted file mode 100644 index 618b700..0000000 --- a/iOS/phonegap/project/ImageFilter/PhoneGap.plist +++ /dev/null @@ -1,57 +0,0 @@ - - - - - DetectPhoneNumber - - TopActivityIndicator - gray - EnableLocation - - EnableAcceleration - - EnableViewportScale - - AutoHideSplashScreen - - ShowSplashScreenSpinner - - MediaPlaybackRequiresUserAction - - AllowInlineMediaPlayback - - OpenAllWhitelistURLsInWebView - - ExternalHosts - - Plugins - - ImageFilter - ImageFilter - com.phonegap.accelerometer - PGAccelerometer - com.phonegap.camera - PGCamera - com.phonegap.connection - PGConnection - com.phonegap.contacts - PGContacts - com.phonegap.debugconsole - PGDebugConsole - com.phonegap.file - PGFile - com.phonegap.filetransfer - PGFileTransfer - com.phonegap.geolocation - PGLocation - com.phonegap.notification - PGNotification - com.phonegap.media - PGSound - com.phonegap.mediacapture - PGCapture - com.phonegap.splashscreen - PGSplashScreen - - - diff --git a/iOS/phonegap/project/ImageFilter/Plugins/README b/iOS/phonegap/project/ImageFilter/Plugins/README deleted file mode 100644 index 438840d..0000000 --- a/iOS/phonegap/project/ImageFilter/Plugins/README +++ /dev/null @@ -1 +0,0 @@ -Put the .h and .m files of your plugin here. The .js files of your plugin belong in the www folder. \ No newline at end of file diff --git a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/controls_bg.png b/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/controls_bg.png deleted file mode 100644 index 784e9c7..0000000 Binary files a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/controls_bg.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/controls_bg@2x.png b/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/controls_bg@2x.png deleted file mode 100644 index 1e28c6d..0000000 Binary files a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/controls_bg@2x.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/controls_bg~ipad.png b/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/controls_bg~ipad.png deleted file mode 100644 index efbef8a..0000000 Binary files a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/controls_bg~ipad.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/microphone.png b/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/microphone.png deleted file mode 100644 index 155b88c..0000000 Binary files a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/microphone.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/microphone@2x.png b/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/microphone@2x.png deleted file mode 100644 index 79ef16b..0000000 Binary files a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/microphone@2x.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/microphone~ipad.png b/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/microphone~ipad.png deleted file mode 100644 index ef1c472..0000000 Binary files a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/microphone~ipad.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/record_button.png b/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/record_button.png deleted file mode 100644 index ceb9589..0000000 Binary files a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/record_button.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/record_button@2x.png b/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/record_button@2x.png deleted file mode 100644 index d6ce302..0000000 Binary files a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/record_button@2x.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/record_button~ipad.png b/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/record_button~ipad.png deleted file mode 100644 index d8e24a4..0000000 Binary files a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/record_button~ipad.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/recording_bg.png b/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/recording_bg.png deleted file mode 100644 index bafc087..0000000 Binary files a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/recording_bg.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/recording_bg@2x.png b/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/recording_bg@2x.png deleted file mode 100644 index 798490b..0000000 Binary files a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/recording_bg@2x.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/recording_bg~ipad.png b/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/recording_bg~ipad.png deleted file mode 100644 index 3b467f6..0000000 Binary files a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/recording_bg~ipad.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/stop_button.png b/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/stop_button.png deleted file mode 100644 index 9c31838..0000000 Binary files a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/stop_button.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/stop_button@2x.png b/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/stop_button@2x.png deleted file mode 100644 index 8cf657e..0000000 Binary files a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/stop_button@2x.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/stop_button~ipad.png b/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/stop_button~ipad.png deleted file mode 100644 index 59bb7a5..0000000 Binary files a/iOS/phonegap/project/ImageFilter/Resources/Capture.bundle/stop_button~ipad.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/Resources/en.lproj/Localizable.strings b/iOS/phonegap/project/ImageFilter/Resources/en.lproj/Localizable.strings deleted file mode 100644 index 6c4ec02..0000000 --- a/iOS/phonegap/project/ImageFilter/Resources/en.lproj/Localizable.strings +++ /dev/null @@ -1,14 +0,0 @@ -/* - * PhoneGap is available under *either* the terms of the modified BSD license *or* the - * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text. - * - * Copyright (c) 2011, IBM Corporation - */ - - -// accessibility label for recording button -"toggle audio recording" = "toggle audio recording"; -// notification spoken by VoiceOver when timed recording finishes -"timed recording complete" = "timed recording complete"; -// accessibility hint for display of recorded elapsed time -"recorded time in minutes and seconds" = "recorded time in minutes and seconds"; \ No newline at end of file diff --git a/iOS/phonegap/project/ImageFilter/Resources/es.lproj/Localizable.strings b/iOS/phonegap/project/ImageFilter/Resources/es.lproj/Localizable.strings deleted file mode 100644 index 5d8da61..0000000 --- a/iOS/phonegap/project/ImageFilter/Resources/es.lproj/Localizable.strings +++ /dev/null @@ -1,13 +0,0 @@ -/* - * PhoneGap is available under *either* the terms of the modified BSD license *or* the - * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text. - * - * Copyright (c) 2011, IBM Corporation - */ - -// accessibility label for recording button -"toggle audio recording" = "grabación de audio cambiar"; -// notification spoken by VoiceOver when timed recording finishes -"timed recording complete" = "tiempo de grabación completo"; -// accessibility hint for display of recorded elapsed time -"recorded time in minutes and seconds" = "tiempo registrado en minutos y segundos"; \ No newline at end of file diff --git a/iOS/phonegap/project/ImageFilter/Resources/icons/icon-72.png b/iOS/phonegap/project/ImageFilter/Resources/icons/icon-72.png deleted file mode 100644 index a2e4135..0000000 Binary files a/iOS/phonegap/project/ImageFilter/Resources/icons/icon-72.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/Resources/icons/icon.png b/iOS/phonegap/project/ImageFilter/Resources/icons/icon.png deleted file mode 100644 index 182b139..0000000 Binary files a/iOS/phonegap/project/ImageFilter/Resources/icons/icon.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/Resources/icons/icon@2x.png b/iOS/phonegap/project/ImageFilter/Resources/icons/icon@2x.png deleted file mode 100644 index 3d7b9d4..0000000 Binary files a/iOS/phonegap/project/ImageFilter/Resources/icons/icon@2x.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/Resources/splash/Default.png b/iOS/phonegap/project/ImageFilter/Resources/splash/Default.png deleted file mode 100755 index c8f2de5..0000000 Binary files a/iOS/phonegap/project/ImageFilter/Resources/splash/Default.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/Resources/splash/Default@2x.png b/iOS/phonegap/project/ImageFilter/Resources/splash/Default@2x.png deleted file mode 100755 index c071a20..0000000 Binary files a/iOS/phonegap/project/ImageFilter/Resources/splash/Default@2x.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/en.lproj/InfoPlist.strings b/iOS/phonegap/project/ImageFilter/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28f..0000000 --- a/iOS/phonegap/project/ImageFilter/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/iOS/phonegap/project/ImageFilter/main.m b/iOS/phonegap/project/ImageFilter/main.m deleted file mode 100644 index 08a5ce8..0000000 --- a/iOS/phonegap/project/ImageFilter/main.m +++ /dev/null @@ -1,17 +0,0 @@ -// -// main.m -// ImageFilter -// -// Created by Andrew Dahlman on 2/26/12. -// Copyright __MyCompanyName__ 2012. All rights reserved. -// - -#import - -int main(int argc, char *argv[]) { - - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate"); - [pool release]; - return retVal; -} diff --git a/iOS/phonegap/project/ImageFilter/painter.png b/iOS/phonegap/project/ImageFilter/painter.png deleted file mode 100644 index 604d8d3..0000000 Binary files a/iOS/phonegap/project/ImageFilter/painter.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/vignette2.png b/iOS/phonegap/project/ImageFilter/vignette2.png deleted file mode 100644 index d1f0a4f..0000000 Binary files a/iOS/phonegap/project/ImageFilter/vignette2.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/vignette3.png b/iOS/phonegap/project/ImageFilter/vignette3.png deleted file mode 100644 index d318950..0000000 Binary files a/iOS/phonegap/project/ImageFilter/vignette3.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/vignette4.png b/iOS/phonegap/project/ImageFilter/vignette4.png deleted file mode 100644 index ea02e9c..0000000 Binary files a/iOS/phonegap/project/ImageFilter/vignette4.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/vintage.png b/iOS/phonegap/project/ImageFilter/vintage.png deleted file mode 100644 index 0cdb0ea..0000000 Binary files a/iOS/phonegap/project/ImageFilter/vintage.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/www/css/style.css b/iOS/phonegap/project/ImageFilter/www/css/style.css deleted file mode 100644 index 8ea9325..0000000 --- a/iOS/phonegap/project/ImageFilter/www/css/style.css +++ /dev/null @@ -1,68 +0,0 @@ -*{ - margin:0px; -} -body { - height:100%; - width:100%; - font-family:'helvetica'; - font-size:12px; -} -#header { - width:320px; - position:relative; - top:0px; - left:0px; - margin-bottom:10px; -} -#wrapper { - width:100%; - margin:auto; - position:relative; -} -#buttons { - width:310px; - margin:auto; -} -.btn { - width:auto; - padding:10px; - background-color:#95abb7; - color:#fff; - font-size:15px; - border-radius:5px; - margin-bottom:10px; - font-weight:bold; - text-align:center; -} -.photo { - height:310px; - width:310px; - overflow:hidden; - position:relative; - margin:auto; - display:none; - margin-bottom:10px; -} -.photo img { - height:310px; - width:310px; -} -.filterIcon { - height:70px; - width:70px; - border-radius:5px; - overflow:hidden; - box-shadow:0px 0px 2px #222; -} -.filterText { - color:#222; - width:70px; - text-align:center; -} -.filter { - text-align:center; - width:70px; - float:left; - margin-right:10px; - margin-left:10px; -} \ No newline at end of file diff --git a/iOS/phonegap/project/ImageFilter/www/images/filters/none.png b/iOS/phonegap/project/ImageFilter/www/images/filters/none.png deleted file mode 100644 index e17ea9b..0000000 Binary files a/iOS/phonegap/project/ImageFilter/www/images/filters/none.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/www/images/filters/stark.png b/iOS/phonegap/project/ImageFilter/www/images/filters/stark.png deleted file mode 100644 index 9fe311a..0000000 Binary files a/iOS/phonegap/project/ImageFilter/www/images/filters/stark.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/www/images/filters/sunnySide.png b/iOS/phonegap/project/ImageFilter/www/images/filters/sunnySide.png deleted file mode 100644 index b73afe9..0000000 Binary files a/iOS/phonegap/project/ImageFilter/www/images/filters/sunnySide.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/www/images/filters/vintage.png b/iOS/phonegap/project/ImageFilter/www/images/filters/vintage.png deleted file mode 100644 index 66618c8..0000000 Binary files a/iOS/phonegap/project/ImageFilter/www/images/filters/vintage.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/www/images/filters/worn.png b/iOS/phonegap/project/ImageFilter/www/images/filters/worn.png deleted file mode 100644 index c5cd994..0000000 Binary files a/iOS/phonegap/project/ImageFilter/www/images/filters/worn.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/www/images/header.png b/iOS/phonegap/project/ImageFilter/www/images/header.png deleted file mode 100644 index c8b4f49..0000000 Binary files a/iOS/phonegap/project/ImageFilter/www/images/header.png and /dev/null differ diff --git a/iOS/phonegap/project/ImageFilter/www/index.html b/iOS/phonegap/project/ImageFilter/www/index.html deleted file mode 100644 index 34d7c98..0000000 --- a/iOS/phonegap/project/ImageFilter/www/index.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
-
use camera
-
use library
-
- - - -
- -
- -
-
-
-
none
-
-
-
-
sunnySide
-
-
-
-
worn
-
-
-
-
vintage
-
-
-
-
stark
-
-
-
- - - -
-
- - diff --git a/iOS/phonegap/project/ImageFilter/www/js/core/jQuery.js b/iOS/phonegap/project/ImageFilter/www/js/core/jQuery.js deleted file mode 100644 index 198b3ff..0000000 --- a/iOS/phonegap/project/ImageFilter/www/js/core/jQuery.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.7.1 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; -f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() -{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/iOS/phonegap/project/ImageFilter/www/js/core/phonegap-1.2.0.js b/iOS/phonegap/project/ImageFilter/www/js/core/phonegap-1.2.0.js deleted file mode 100644 index 31506d7..0000000 --- a/iOS/phonegap/project/ImageFilter/www/js/core/phonegap-1.2.0.js +++ /dev/null @@ -1,4098 +0,0 @@ -/* - * PhoneGap v1.2.0 is available under *either* the terms of the modified BSD license *or* the - * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text. - * - * Copyright (c) 2005-2010, Nitobi Software Inc. - * Copyright (c) 2010-2011, IBM Corporation - * Copyright (c) 2011, Codevise Solutions Ltd. - * Copyright (c) 2011, Proyectos Equis Ka, S.L. - * - */ - -if (typeof PhoneGap === "undefined") { - -if (typeof(DeviceInfo) !== 'object'){ - DeviceInfo = {}; -} -/** - * This represents the PhoneGap API itself, and provides a global namespace for accessing - * information about the state of PhoneGap. - * @class - */ -PhoneGap = { - // This queue holds the currently executing command and all pending - // commands executed with PhoneGap.exec(). - commandQueue: [], - // Indicates if we're currently in the middle of flushing the command - // queue on the native side. - commandQueueFlushing: false, - _constructors: [], - documentEventHandler: {}, // Collection of custom document event handlers - windowEventHandler: {} -}; - -/** - * List of resource files loaded by PhoneGap. - * This is used to ensure JS and other files are loaded only once. - */ -PhoneGap.resources = {base: true}; - -/** - * Determine if resource has been loaded by PhoneGap - * - * @param name - * @return - */ -PhoneGap.hasResource = function(name) { - return PhoneGap.resources[name]; -}; - -/** - * Add a resource to list of loaded resources by PhoneGap - * - * @param name - */ -PhoneGap.addResource = function(name) { - PhoneGap.resources[name] = true; -}; - -/** - * Boolean flag indicating if the PhoneGap API is available and initialized. - */ // TODO: Remove this, it is unused here ... -jm -PhoneGap.available = DeviceInfo.uuid != undefined; - -/** - * Add an initialization function to a queue that ensures it will run and initialize - * application constructors only once PhoneGap has been initialized. - * @param {Function} func The function callback you want run once PhoneGap is initialized - */ -PhoneGap.addConstructor = function(func) { - var state = document.readyState; - if ( ( state == 'loaded' || state == 'complete' ) && DeviceInfo.uuid != null ) - { - func(); - } - else - { - PhoneGap._constructors.push(func); - } -}; - -(function() - { - var timer = setInterval(function() - { - - var state = document.readyState; - - if ( ( state == 'loaded' || state == 'complete' ) && DeviceInfo.uuid != null ) - { - clearInterval(timer); // stop looking - // run our constructors list - while (PhoneGap._constructors.length > 0) - { - var constructor = PhoneGap._constructors.shift(); - try - { - constructor(); - } - catch(e) - { - if (typeof(console['log']) == 'function') - { - console.log("Failed to run constructor: " + console.processMessage(e)); - } - else - { - alert("Failed to run constructor: " + e.message); - } - } - } - // all constructors run, now fire the deviceready event - var e = document.createEvent('Events'); - e.initEvent('deviceready'); - document.dispatchEvent(e); - } - }, 1); -})(); - -// session id for calls -PhoneGap.sessionKey = 0; - -// centralized callbacks -PhoneGap.callbackId = 0; -PhoneGap.callbacks = {}; -PhoneGap.callbackStatus = { - NO_RESULT: 0, - OK: 1, - CLASS_NOT_FOUND_EXCEPTION: 2, - ILLEGAL_ACCESS_EXCEPTION: 3, - INSTANTIATION_EXCEPTION: 4, - MALFORMED_URL_EXCEPTION: 5, - IO_EXCEPTION: 6, - INVALID_ACTION: 7, - JSON_EXCEPTION: 8, - ERROR: 9 - }; - -/** - * Creates a gap bridge iframe used to notify the native code about queued - * commands. - * - * @private - */ -PhoneGap.createGapBridge = function() { - gapBridge = document.createElement("iframe"); - gapBridge.setAttribute("style", "display:none;"); - gapBridge.setAttribute("height","0px"); - gapBridge.setAttribute("width","0px"); - gapBridge.setAttribute("frameborder","0"); - document.documentElement.appendChild(gapBridge); - return gapBridge; -} - -/** - * Execute a PhoneGap command by queuing it and letting the native side know - * there are queued commands. The native side will then request all of the - * queued commands and execute them. - * - * Arguments may be in one of two formats: - * - * FORMAT ONE (preferable) - * The native side will call PhoneGap.callbackSuccess or - * PhoneGap.callbackError, depending upon the result of the action. - * - * @param {Function} success The success callback - * @param {Function} fail The fail callback - * @param {String} service The name of the service to use - * @param {String} action The name of the action to use - * @param {String[]} [args] Zero or more arguments to pass to the method - * - * FORMAT TWO - * @param {String} command Command to be run in PhoneGap, e.g. - * "ClassName.method" - * @param {String[]} [args] Zero or more arguments to pass to the method - * object parameters are passed as an array object - * [object1, object2] each object will be passed as - * JSON strings - */ -PhoneGap.exec = function() { - if (!PhoneGap.available) { - alert("ERROR: Attempting to call PhoneGap.exec()" - +" before 'deviceready'. Ignoring."); - return; - } - - var successCallback, failCallback, service, action, actionArgs; - var callbackId = null; - if (typeof arguments[0] !== "string") { - // FORMAT ONE - successCallback = arguments[0]; - failCallback = arguments[1]; - service = arguments[2]; - action = arguments[3]; - actionArgs = arguments[4]; - - // Since we need to maintain backwards compatibility, we have to pass - // an invalid callbackId even if no callback was provided since plugins - // will be expecting it. The PhoneGap.exec() implementation allocates - // an invalid callbackId and passes it even if no callbacks were given. - callbackId = 'INVALID'; - } else { - // FORMAT TWO - splitCommand = arguments[0].split("."); - action = splitCommand.pop(); - service = splitCommand.join("."); - actionArgs = Array.prototype.splice.call(arguments, 1); - } - - // Start building the command object. - var command = { - className: service, - methodName: action, - arguments: [] - }; - - // Register the callbacks and add the callbackId to the positional - // arguments if given. - if (successCallback || failCallback) { - callbackId = service + PhoneGap.callbackId++; - PhoneGap.callbacks[callbackId] = - {success:successCallback, fail:failCallback}; - } - if (callbackId != null) { - command.arguments.push(callbackId); - } - - for (var i = 0; i < actionArgs.length; ++i) { - var arg = actionArgs[i]; - if (arg == undefined || arg == null) { - continue; - } else if (typeof(arg) == 'object') { - command.options = arg; - } else { - command.arguments.push(arg); - } - } - - // Stringify and queue the command. We stringify to command now to - // effectively clone the command arguments in case they are mutated before - // the command is executed. - PhoneGap.commandQueue.push(JSON.stringify(command)); - - // If the queue length is 1, then that means it was empty before we queued - // the given command, so let the native side know that we have some - // commands to execute, unless the queue is currently being flushed, in - // which case the command will be picked up without notification. - if (PhoneGap.commandQueue.length == 1 && !PhoneGap.commandQueueFlushing) { - if (!PhoneGap.gapBridge) { - PhoneGap.gapBridge = PhoneGap.createGapBridge(); - } - - PhoneGap.gapBridge.src = "gap://ready"; - } -} - -/** - * Called by native code to retrieve all queued commands and clear the queue. - */ -PhoneGap.getAndClearQueuedCommands = function() { - json = JSON.stringify(PhoneGap.commandQueue); - PhoneGap.commandQueue = []; - return json; -} - -/** - * Called by native code when returning successful result from an action. - * - * @param callbackId - * @param args - * args.status - PhoneGap.callbackStatus - * args.message - return value - * args.keepCallback - 0 to remove callback, 1 to keep callback in PhoneGap.callbacks[] - */ -PhoneGap.callbackSuccess = function(callbackId, args) { - if (PhoneGap.callbacks[callbackId]) { - - // If result is to be sent to callback - if (args.status == PhoneGap.callbackStatus.OK) { - try { - if (PhoneGap.callbacks[callbackId].success) { - PhoneGap.callbacks[callbackId].success(args.message); - } - } - catch (e) { - console.log("Error in success callback: "+callbackId+" = "+e); - } - } - - // Clear callback if not expecting any more results - if (!args.keepCallback) { - delete PhoneGap.callbacks[callbackId]; - } - } -}; - -/** - * Called by native code when returning error result from an action. - * - * @param callbackId - * @param args - */ -PhoneGap.callbackError = function(callbackId, args) { - if (PhoneGap.callbacks[callbackId]) { - try { - if (PhoneGap.callbacks[callbackId].fail) { - PhoneGap.callbacks[callbackId].fail(args.message); - } - } - catch (e) { - console.log("Error in error callback: "+callbackId+" = "+e); - } - - // Clear callback if not expecting any more results - if (!args.keepCallback) { - delete PhoneGap.callbacks[callbackId]; - } - } -}; - - -/** - * Does a deep clone of the object. - * - * @param obj - * @return - */ -PhoneGap.clone = function(obj) { - if(!obj) { - return obj; - } - - if(obj instanceof Array){ - var retVal = new Array(); - for(var i = 0; i < obj.length; ++i){ - retVal.push(PhoneGap.clone(obj[i])); - } - return retVal; - } - - if (obj instanceof Function) { - return obj; - } - - if(!(obj instanceof Object)){ - return obj; - } - - if (obj instanceof Date) { - return obj; - } - - retVal = new Object(); - for(i in obj){ - if(!(i in retVal) || retVal[i] != obj[i]) { - retVal[i] = PhoneGap.clone(obj[i]); - } - } - return retVal; -}; - -// Intercept calls to document.addEventListener -PhoneGap.m_document_addEventListener = document.addEventListener; - -// Intercept calls to window.addEventListener -PhoneGap.m_window_addEventListener = window.addEventListener; - -/** - * Add a custom window event handler. - * - * @param {String} event The event name that callback handles - * @param {Function} callback The event handler - */ -PhoneGap.addWindowEventHandler = function(event, callback) { - PhoneGap.windowEventHandler[event] = callback; -} - -/** - * Add a custom document event handler. - * - * @param {String} event The event name that callback handles - * @param {Function} callback The event handler - */ -PhoneGap.addDocumentEventHandler = function(event, callback) { - PhoneGap.documentEventHandler[event] = callback; -} - -/** - * Intercept adding document event listeners and handle our own - * - * @param {Object} evt - * @param {Function} handler - * @param capture - */ -document.addEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - - // If subscribing to an event that is handled by a plugin - if (typeof PhoneGap.documentEventHandler[e] !== "undefined") { - if (PhoneGap.documentEventHandler[e](e, handler, true)) { - return; // Stop default behavior - } - } - - PhoneGap.m_document_addEventListener.call(document, evt, handler, capture); -}; - -/** - * Intercept adding window event listeners and handle our own - * - * @param {Object} evt - * @param {Function} handler - * @param capture - */ -window.addEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - - // If subscribing to an event that is handled by a plugin - if (typeof PhoneGap.windowEventHandler[e] !== "undefined") { - if (PhoneGap.windowEventHandler[e](e, handler, true)) { - return; // Stop default behavior - } - } - - PhoneGap.m_window_addEventListener.call(window, evt, handler, capture); -}; - -// Intercept calls to document.removeEventListener and watch for events that -// are generated by PhoneGap native code -PhoneGap.m_document_removeEventListener = document.removeEventListener; - -// Intercept calls to window.removeEventListener -PhoneGap.m_window_removeEventListener = window.removeEventListener; - -/** - * Intercept removing document event listeners and handle our own - * - * @param {Object} evt - * @param {Function} handler - * @param capture - */ -document.removeEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - - // If unsubcribing from an event that is handled by a plugin - if (typeof PhoneGap.documentEventHandler[e] !== "undefined") { - if (PhoneGap.documentEventHandler[e](e, handler, false)) { - return; // Stop default behavior - } - } - - PhoneGap.m_document_removeEventListener.call(document, evt, handler, capture); -}; - -/** - * Intercept removing window event listeners and handle our own - * - * @param {Object} evt - * @param {Function} handler - * @param capture - */ -window.removeEventListener = function(evt, handler, capture) { - var e = evt.toLowerCase(); - - // If unsubcribing from an event that is handled by a plugin - if (typeof PhoneGap.windowEventHandler[e] !== "undefined") { - if (PhoneGap.windowEventHandler[e](e, handler, false)) { - return; // Stop default behavior - } - } - - PhoneGap.m_window_removeEventListener.call(window, evt, handler, capture); -}; - -/** - * Method to fire document event - * - * @param {String} type The event type to fire - * @param {Object} data Data to send with event - */ -PhoneGap.fireDocumentEvent = function(type, data) { - var e = document.createEvent('Events'); - e.initEvent(type); - if (data) { - for (var i in data) { - e[i] = data[i]; - } - } - document.dispatchEvent(e); -}; - -/** - * Method to fire window event - * - * @param {String} type The event type to fire - * @param {Object} data Data to send with event - */ -PhoneGap.fireWindowEvent = function(type, data) { - var e = document.createEvent('Events'); - e.initEvent(type); - if (data) { - for (var i in data) { - e[i] = data[i]; - } - } - window.dispatchEvent(e); -}; - -/** - * Method to fire event from native code - * Leaving this generic version to handle problems with iOS 3.x. Is currently used by orientation and battery events - * Remove when iOS 3.x no longer supported and call fireWindowEvent or fireDocumentEvent directly - */ -PhoneGap.fireEvent = function(type, target, data) { - var e = document.createEvent('Events'); - e.initEvent(type); - if (data) { - for (var i in data) { - e[i] = data[i]; - } - } - target = target || document; - if (target.dispatchEvent === undefined) { // ie window.dispatchEvent is undefined in iOS 3.x - target = document; - } - - target.dispatchEvent(e); -}; -/** - * Create a UUID - * - * @return - */ -PhoneGap.createUUID = function() { - return PhoneGap.UUIDcreatePart(4) + '-' + - PhoneGap.UUIDcreatePart(2) + '-' + - PhoneGap.UUIDcreatePart(2) + '-' + - PhoneGap.UUIDcreatePart(2) + '-' + - PhoneGap.UUIDcreatePart(6); -}; - -PhoneGap.UUIDcreatePart = function(length) { - var uuidpart = ""; - for (var i=0; i -1) { - me._batteryListener.splice(pos, 1); - } - } else if (eventType === "batterylow") { - var pos = me._lowListener.indexOf(handler); - if (pos > -1) { - me._lowListener.splice(pos, 1); - } - } else if (eventType === "batterycritical") { - var pos = me._criticalListener.indexOf(handler); - if (pos > -1) { - me._criticalListener.splice(pos, 1); - } - } - - // If there are no more registered event listeners stop the battery listener on native side. - if (me._batteryListener.length === 0 && me._lowListener.length === 0 && me._criticalListener.length === 0) { - PhoneGap.exec(null, null, "com.phonegap.battery", "stop", []); - } - } -}; - -/** - * Callback for battery status - * - * @param {Object} info keys: level, isPlugged - */ -Battery.prototype._status = function(info) { - if (info) { - var me = this; - if (me._level != info.level || me._isPlugged != info.isPlugged) { - // Fire batterystatus event - //PhoneGap.fireWindowEvent("batterystatus", info); - // use this workaround since iOS 3.x does have window.dispatchEvent - PhoneGap.fireEvent("batterystatus", window, info); - - // Fire low battery event - if (info.level == 20 || info.level == 5) { - if (info.level == 20) { - //PhoneGap.fireWindowEvent("batterylow", info); - // use this workaround since iOS 3.x does not have window.dispatchEvent - PhoneGap.fireEvent("batterylow", window, info); - } - else { - //PhoneGap.fireWindowEvent("batterycritical", info); - // use this workaround since iOS 3.x does not have window.dispatchEvent - PhoneGap.fireEvent("batterycritical", window, info); - } - } - } - me._level = info.level; - me._isPlugged = info.isPlugged; - } -}; - -/** - * Error callback for battery start - */ -Battery.prototype._error = function(e) { - console.log("Error initializing Battery: " + e); -}; - -PhoneGap.addConstructor(function() { - if (typeof navigator.battery === "undefined") { - navigator.battery = new Battery(); - PhoneGap.addWindowEventHandler("batterystatus", navigator.battery.eventHandler); - PhoneGap.addWindowEventHandler("batterylow", navigator.battery.eventHandler); - PhoneGap.addWindowEventHandler("batterycritical", navigator.battery.eventHandler); - } -}); -}if (!PhoneGap.hasResource("camera")) { - PhoneGap.addResource("camera"); - - -/** - * This class provides access to the device camera. - * @constructor - */ -Camera = function() { - -} -/** - * Available Camera Options - * {boolean} allowEdit - true to allow editing image, default = false - * {number} quality 0-100 (low to high) default = 100 - * {Camera.DestinationType} destinationType default = DATA_URL - * {Camera.PictureSourceType} sourceType default = CAMERA - * {number} targetWidth - width in pixels to scale image default = 0 (no scaling) - * {number} targetHeight - height in pixels to scale image default = 0 (no scaling) - * {Camera.EncodingType} - encodingType default = JPEG - * {boolean} correctOrientation - Rotate the image to correct for the orientation of the device during capture (iOS only) - * {boolean} saveToPhotoAlbum - Save the image to the photo album on the device after capture (iOS only) - */ -/** - * Format of image that is returned from getPicture. - * - * Example: navigator.camera.getPicture(success, fail, - * { quality: 80, - * destinationType: Camera.DestinationType.DATA_URL, - * sourceType: Camera.PictureSourceType.PHOTOLIBRARY}) - */ -Camera.DestinationType = { - DATA_URL: 0, // Return base64 encoded string - FILE_URI: 1 // Return file uri -}; -Camera.prototype.DestinationType = Camera.DestinationType; - -/** - * Source to getPicture from. - * - * Example: navigator.camera.getPicture(success, fail, - * { quality: 80, - * destinationType: Camera.DestinationType.DATA_URL, - * sourceType: Camera.PictureSourceType.PHOTOLIBRARY}) - */ -Camera.PictureSourceType = { - PHOTOLIBRARY : 0, // Choose image from picture library - CAMERA : 1, // Take picture from camera - SAVEDPHOTOALBUM : 2 // Choose image from picture library -}; -Camera.prototype.PictureSourceType = Camera.PictureSourceType; - -/** - * Encoding of image returned from getPicture. - * - * Example: navigator.camera.getPicture(success, fail, - * { quality: 80, - * destinationType: Camera.DestinationType.DATA_URL, - * sourceType: Camera.PictureSourceType.CAMERA, - * encodingType: Camera.EncodingType.PNG}) - */ -Camera.EncodingType = { - JPEG: 0, // Return JPEG encoded image - PNG: 1 // Return PNG encoded image -}; -Camera.prototype.EncodingType = Camera.EncodingType; - -/** - * Type of pictures to select from. Only applicable when - * PictureSourceType is PHOTOLIBRARY or SAVEDPHOTOALBUM - * - * Example: navigator.camera.getPicture(success, fail, - * { quality: 80, - * destinationType: Camera.DestinationType.DATA_URL, - * sourceType: Camera.PictureSourceType.PHOTOLIBRARY, - * mediaType: Camera.MediaType.PICTURE}) - */ -Camera.MediaType = { - PICTURE: 0, // allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType - VIDEO: 1, // allow selection of video only, ONLY RETURNS URL - ALLMEDIA : 2 // allow selection from all media types -}; -Camera.prototype.MediaType = Camera.MediaType; - -/** - * Gets a picture from source defined by "options.sourceType", and returns the - * image as defined by the "options.destinationType" option. - - * The defaults are sourceType=CAMERA and destinationType=DATA_URL. - * - * @param {Function} successCallback - * @param {Function} errorCallback - * @param {Object} options - */ -Camera.prototype.getPicture = function(successCallback, errorCallback, options) { - // successCallback required - if (typeof successCallback != "function") { - console.log("Camera Error: successCallback is not a function"); - return; - } - - // errorCallback optional - if (errorCallback && (typeof errorCallback != "function")) { - console.log("Camera Error: errorCallback is not a function"); - return; - } - - PhoneGap.exec(successCallback, errorCallback, "com.phonegap.camera","getPicture",[options]); -}; - - - -PhoneGap.addConstructor(function() { - if (typeof navigator.camera == "undefined") navigator.camera = new Camera(); -}); -}; - -if (!PhoneGap.hasResource("device")) { - PhoneGap.addResource("device"); - -/** - * this represents the mobile device, and provides properties for inspecting the model, version, UUID of the - * phone, etc. - * @constructor - */ -Device = function() -{ - this.platform = null; - this.version = null; - this.name = null; - this.phonegap = null; - this.uuid = null; - try - { - this.platform = DeviceInfo.platform; - this.version = DeviceInfo.version; - this.name = DeviceInfo.name; - this.phonegap = DeviceInfo.gap; - this.uuid = DeviceInfo.uuid; - - } - catch(e) - { - // TODO: - } - this.available = PhoneGap.available = this.uuid != null; -} - -PhoneGap.addConstructor(function() { - if (typeof navigator.device === "undefined") { - navigator.device = window.device = new Device(); - } -}); -}; - -if (!PhoneGap.hasResource("capture")) { - PhoneGap.addResource("capture"); -/** - * The CaptureError interface encapsulates all errors in the Capture API. - */ -function CaptureError() { - this.code = null; -}; - -// Capture error codes -CaptureError.CAPTURE_INTERNAL_ERR = 0; -CaptureError.CAPTURE_APPLICATION_BUSY = 1; -CaptureError.CAPTURE_INVALID_ARGUMENT = 2; -CaptureError.CAPTURE_NO_MEDIA_FILES = 3; -CaptureError.CAPTURE_NOT_SUPPORTED = 20; - -/** - * The Capture interface exposes an interface to the camera and microphone of the hosting device. - */ -function Capture() { - this.supportedAudioModes = []; - this.supportedImageModes = []; - this.supportedVideoModes = []; -}; - -/** - * Launch audio recorder application for recording audio clip(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureAudioOptions} options - * - * No audio recorder to launch for iOS - return CAPTURE_NOT_SUPPORTED - */ -Capture.prototype.captureAudio = function(successCallback, errorCallback, options) { - /*if (errorCallback && typeof errorCallback === "function") { - errorCallback({ - "code": CaptureError.CAPTURE_NOT_SUPPORTED - }); - }*/ - PhoneGap.exec(successCallback, errorCallback, "com.phonegap.mediacapture", "captureAudio", [options]); -}; - -/** - * Launch camera application for taking image(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureImageOptions} options - */ -Capture.prototype.captureImage = function(successCallback, errorCallback, options) { - PhoneGap.exec(successCallback, errorCallback, "com.phonegap.mediacapture", "captureImage", [options]); -}; - -/** - * Launch camera application for taking image(s). - * - * @param {Function} successCB - * @param {Function} errorCB - * @param {CaptureImageOptions} options - */ -Capture.prototype._castMediaFile = function(pluginResult) { - var mediaFiles = []; - var i; - for (i=0; i} categories -* @param {ContactField[]} urls contact's web sites -*/ -var Contact = function(id, displayName, name, nickname, phoneNumbers, emails, addresses, - ims, organizations, birthday, note, photos, categories, urls) { - this.id = id || null; - this.displayName = displayName || null; - this.name = name || null; // ContactName - this.nickname = nickname || null; - this.phoneNumbers = phoneNumbers || null; // ContactField[] - this.emails = emails || null; // ContactField[] - this.addresses = addresses || null; // ContactAddress[] - this.ims = ims || null; // ContactField[] - this.organizations = organizations || null; // ContactOrganization[] - this.birthday = birthday || null; // JS Date - this.note = note || null; - this.photos = photos || null; // ContactField[] - this.categories = categories || null; - this.urls = urls || null; // ContactField[] -}; - -/** -* Converts Dates to milliseconds before sending to iOS -*/ -Contact.prototype.convertDatesOut = function() -{ - var dates = new Array("birthday"); - for (var i=0; i][;base64], - * - * @param file {File} File object containing file properties - */ -FileReader.prototype.readAsDataURL = function(file) { - this.fileName = ""; - - if (typeof file.fullPath === "undefined") { - this.fileName = file; - } else { - this.fileName = file.fullPath; - } - - // LOADING state - this.readyState = FileReader.LOADING; - - // If loadstart callback - if (typeof this.onloadstart === "function") { - var evt = File._createEvent("loadstart", this); - this.onloadstart(evt); - } - - var me = this; - - // Read file - navigator.fileMgr.readAsDataURL(this.fileName, - - // Success callback - function(r) { - var evt; - - // If DONE (cancelled), then don't do anything - if (me.readyState === FileReader.DONE) { - return; - } - - // Save result - me.result = r; - - // If onload callback - if (typeof me.onload === "function") { - evt = File._createEvent("load", me); - me.onload(evt); - } - - // DONE state - me.readyState = FileReader.DONE; - - // If onloadend callback - if (typeof me.onloadend === "function") { - evt = File._createEvent("loadend", me); - me.onloadend(evt); - } - }, - - // Error callback - function(e) { - var evt; - // If DONE (cancelled), then don't do anything - if (me.readyState === FileReader.DONE) { - return; - } - - // Save error - me.error = e; - - // If onerror callback - if (typeof me.onerror === "function") { - evt = File._createEvent("error", me); - me.onerror(evt); - } - - // DONE state - me.readyState = FileReader.DONE; - - // If onloadend callback - if (typeof me.onloadend === "function") { - evt = File._createEvent("loadend", me); - me.onloadend(evt); - } - } - ); -}; - -/** - * Read file and return data as a binary data. - * - * @param file The name of the file - */ -FileReader.prototype.readAsBinaryString = function(file) { - // TODO - Can't return binary data to browser. - this.fileName = file; -}; - -/** - * Read file and return data as a binary data. - * - * @param file The name of the file - */ -FileReader.prototype.readAsArrayBuffer = function(file) { - // TODO - Can't return binary data to browser. - this.fileName = file; -}; - -//----------------------------------------------------------------------------- -// File Writer -//----------------------------------------------------------------------------- - -/** - * This class writes to the mobile device file system. - * - @param file {File} a File object representing a file on the file system -*/ -FileWriter = function(file) { - this.fileName = ""; - this.length = 0; - if (file) { - this.fileName = file.fullPath || file; - this.length = file.size || 0; - } - - // default is to write at the beginning of the file - this.position = 0; - - this.readyState = 0; // EMPTY - - this.result = null; - - // Error - this.error = null; - - // Event handlers - this.onwritestart = null; // When writing starts - this.onprogress = null; // While writing the file, and reporting partial file data - this.onwrite = null; // When the write has successfully completed. - this.onwriteend = null; // When the request has completed (either in success or failure). - this.onabort = null; // When the write has been aborted. For instance, by invoking the abort() method. - this.onerror = null; // When the write has failed (see errors). -} - -// States -FileWriter.INIT = 0; -FileWriter.WRITING = 1; -FileWriter.DONE = 2; - -/** - * Abort writing file. - */ -FileWriter.prototype.abort = function() { - // check for invalid state - if (this.readyState === FileWriter.DONE || this.readyState === FileWriter.INIT) { - throw FileError.INVALID_STATE_ERR; - } - - // set error - var error = new FileError(), evt; - error.code = error.ABORT_ERR; - this.error = error; - - // If error callback - if (typeof this.onerror === "function") { - evt = File._createEvent("error", this); - this.onerror(evt); - } - // If abort callback - if (typeof this.onabort === "function") { - evt = File._createEvent("abort", this); - this.onabort(evt); - } - - this.readyState = FileWriter.DONE; - - // If write end callback - if (typeof this.onwriteend == "function") { - evt = File._createEvent("writeend", this); - this.onwriteend(evt); - } -}; - -/** - * @Deprecated: use write instead - * - * @param file to write the data to - * @param text to be written - * @param bAppend if true write to end of file, otherwise overwrite the file - */ -FileWriter.prototype.writeAsText = function(file, text, bAppend) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw FileError.INVALID_STATE_ERR; - } - - if (bAppend !== true) { - bAppend = false; // for null values - } - - this.fileName = file; - - // WRITING state - this.readyState = FileWriter.WRITING; - - var me = this; - - // If onwritestart callback - if (typeof me.onwritestart === "function") { - var evt = File._createEvent("writestart", me); - me.onwritestart(evt); - } - - - // Write file - navigator.fileMgr.writeAsText(file, text, bAppend, - // Success callback - function(r) { - var evt; - - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // Save result - me.result = r; - - // If onwrite callback - if (typeof me.onwrite === "function") { - evt = File._createEvent("write", me); - me.onwrite(evt); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - evt = File._createEvent("writeend", me); - me.onwriteend(evt); - } - }, - - // Error callback - function(e) { - var evt; - - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // Save error - me.error = e; - - // If onerror callback - if (typeof me.onerror === "function") { - evt = File._createEvent("error", me); - me.onerror(evt); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - evt = File._createEvent("writeend", me); - me.onwriteend(evt); - } - } - ); -}; - -/** - * Writes data to the file - * - * @param text to be written - */ -FileWriter.prototype.write = function(text) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw FileError.INVALID_STATE_ERR; - } - - // WRITING state - this.readyState = FileWriter.WRITING; - - var me = this; - - // If onwritestart callback - if (typeof me.onwritestart === "function") { - var evt = File._createEvent("writestart", me); - me.onwritestart(evt); - } - - // Write file - navigator.fileMgr.write(this.fileName, text, this.position, - - // Success callback - function(r) { - var evt; - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - - // position always increases by bytes written because file would be extended - me.position += r; - // The length of the file is now where we are done writing. - me.length = me.position; - - // If onwrite callback - if (typeof me.onwrite === "function") { - evt = File._createEvent("write", me); - me.onwrite(evt); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - evt = File._createEvent("writeend", me); - me.onwriteend(evt); - } - }, - - // Error callback - function(e) { - var evt; - - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // Save error - me.error = e; - - // If onerror callback - if (typeof me.onerror === "function") { - evt = File._createEvent("error", me); - me.onerror(evt); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - evt = File._createEvent("writeend", me); - me.onwriteend(evt); - } - } - ); - -}; - -/** - * Moves the file pointer to the location specified. - * - * If the offset is a negative number the position of the file - * pointer is rewound. If the offset is greater than the file - * size the position is set to the end of the file. - * - * @param offset is the location to move the file pointer to. - */ -FileWriter.prototype.seek = function(offset) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw FileError.INVALID_STATE_ERR; - } - - if (!offset) { - return; - } - - // See back from end of file. - if (offset < 0) { - this.position = Math.max(offset + this.length, 0); - } - // Offset is bigger then file size so set position - // to the end of the file. - else if (offset > this.length) { - this.position = this.length; - } - // Offset is between 0 and file size so set the position - // to start writing. - else { - this.position = offset; - } -}; - -/** - * Truncates the file to the size specified. - * - * @param size to chop the file at. - */ -FileWriter.prototype.truncate = function(size) { - // Throw an exception if we are already writing a file - if (this.readyState === FileWriter.WRITING) { - throw FileError.INVALID_STATE_ERR; - } - // what if no size specified? - - // WRITING state - this.readyState = FileWriter.WRITING; - - var me = this; - - // If onwritestart callback - if (typeof me.onwritestart === "function") { - var evt = File._createEvent("writestart", me); - me.onwritestart(evt); - } - - // Write file - navigator.fileMgr.truncate(this.fileName, size, - - // Success callback - function(r) { - var evt; - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // Update the length of the file - me.length = r; - me.position = Math.min(me.position, r); - - // If onwrite callback - if (typeof me.onwrite === "function") { - evt = File._createEvent("write", me); - me.onwrite(evt); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - evt = File._createEvent("writeend", me); - me.onwriteend(evt); - } - }, - - // Error callback - function(e) { - var evt; - // If DONE (cancelled), then don't do anything - if (me.readyState === FileWriter.DONE) { - return; - } - - // Save error - me.error = e; - - // If onerror callback - if (typeof me.onerror === "function") { - evt = File._createEvent("error", me); - me.onerror(evt); - } - - // DONE state - me.readyState = FileWriter.DONE; - - // If onwriteend callback - if (typeof me.onwriteend === "function") { - evt = File._createEvent("writeend", me); - me.onwriteend(evt); - } - } - ); -}; - -LocalFileSystem = function() { -}; - -// File error codes -LocalFileSystem.TEMPORARY = 0; -LocalFileSystem.PERSISTENT = 1; -LocalFileSystem.RESOURCE = 2; -LocalFileSystem.APPLICATION = 3; - -/** - * Requests a filesystem in which to store application data. - * - * @param {int} type of file system being requested - * @param {Function} successCallback is called with the new FileSystem - * @param {Function} errorCallback is called with a FileError - */ -LocalFileSystem.prototype.requestFileSystem = function(type, size, successCallback, errorCallback) { - if (type < 0 || type > 3) { - if (typeof errorCallback == "function") { - errorCallback({ - "code": FileError.SYNTAX_ERR - }); - } - } - else { - PhoneGap.exec(successCallback, errorCallback, "com.phonegap.file", "requestFileSystem", [type, size]); - } -}; - -/** - * - * @param {DOMString} uri referring to a local file in a filesystem - * @param {Function} successCallback is called with the new entry - * @param {Function} errorCallback is called with a FileError - */ -LocalFileSystem.prototype.resolveLocalFileSystemURI = function(uri, successCallback, errorCallback) { - PhoneGap.exec(successCallback, errorCallback, "com.phonegap.file", "resolveLocalFileSystemURI", [uri]); -}; - -/** -* This function is required as we need to convert raw -* JSON objects into concrete File and Directory objects. -* -* @param a JSON Objects that need to be converted to DirectoryEntry or FileEntry objects. -* @returns an entry -*/ -LocalFileSystem.prototype._castFS = function(pluginResult) { - var entry = null; - entry = new DirectoryEntry(); - entry.isDirectory = pluginResult.message.root.isDirectory; - entry.isFile = pluginResult.message.root.isFile; - entry.name = pluginResult.message.root.name; - entry.fullPath = pluginResult.message.root.fullPath; - pluginResult.message.root = entry; - return pluginResult; -} - -LocalFileSystem.prototype._castEntry = function(pluginResult) { - var entry = null; - if (pluginResult.message.isDirectory) { - entry = new DirectoryEntry(); - } - else if (pluginResult.message.isFile) { - entry = new FileEntry(); - } - entry.isDirectory = pluginResult.message.isDirectory; - entry.isFile = pluginResult.message.isFile; - entry.name = pluginResult.message.name; - entry.fullPath = pluginResult.message.fullPath; - pluginResult.message = entry; - return pluginResult; -} - -LocalFileSystem.prototype._castEntries = function(pluginResult) { - var entries = pluginResult.message; - var retVal = []; - for (i=0; i"); - $(".photo").show(); - - }, - onCameraFail: function (msg) { - console.log("ERROR! -" + msg); - } -}; - -var filters = { - none: function (imageURI) { - plugins.ImageFilter.none(filters.rendered, { - image: imageURI, - save: 'false', - }); - }, - sunnySide: function (imageURI) { - plugins.ImageFilter.sunnySide(filters.rendered, { - image: imageURI, - save: 'false' - }); - }, - worn: function (imageURI) { - plugins.ImageFilter.worn(filters.rendered, { - image: imageURI, - save: 'false' - }); - }, - vintage: function (imageURI) { - plugins.ImageFilter.vintage(filters.rendered, { - image: imageURI, - save: 'false' - }); - }, - stark: function (imageURI) { - plugins.ImageFilter.stark(filters.rendered, { - image: imageURI, - save: 'false' - }); - }, - rendered: function (msg) { - - $(".photo").html(""); - } -} \ No newline at end of file diff --git a/iOS/phonegap/project/ImageFilter/www/js/plugins/ImageFilter.js b/iOS/phonegap/project/ImageFilter/www/js/plugins/ImageFilter.js deleted file mode 100644 index 04887ff..0000000 --- a/iOS/phonegap/project/ImageFilter/www/js/plugins/ImageFilter.js +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright (c) 2012 Drew Dahlman MIT LICENSE -*/ - -var ImageFilter = function () {}; - -ImageFilter.prototype.clean = function (options) { - - PhoneGap.exec("ImageFilter.clean"); -}; -ImageFilter.prototype.none = function (done,options) { - //console.log(options+" "+done); - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - - return PhoneGap.exec(done,null,"ImageFilter","none",[defaults]); -}; -ImageFilter.prototype.sunnySide = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","sunnySide",[defaults]); -}; -ImageFilter.prototype.worn = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","worn",[defaults]); -}; -ImageFilter.prototype.vintage = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","vintage",[defaults]); -}; -ImageFilter.prototype.stark = function (done,options) { - var defaults = { - image: '', - save: '', - }; - for(var key in defaults) { - if(typeof options[key] !== "undefined") defaults[key] = options[key]; - } - return PhoneGap.exec(done,null,"ImageFilter","stark",[defaults]); -}; -PhoneGap.addConstructor(function () { - if(!window.plugins) { - window.plugins = {}; - } - window.plugins.ImageFilter = new ImageFilter(); -}); \ No newline at end of file diff --git a/iOS/readme.md b/iOS/readme.md deleted file mode 100644 index fb97652..0000000 --- a/iOS/readme.md +++ /dev/null @@ -1,73 +0,0 @@ -ImageFilter - -ImageFilter is an easy to use phonegap/Cordova plugin that allows you to apply filters to images and save them out as hi-res versions. - -Read more here http://www.drewdahlman.com/meusLabs/?p=138 - -To USE:
-
-plugins.ImageFilter.FILTER_NAME(
-	successCallback{
-	image:imageURI,
-	save:'false' // TRUE IF SAVE
-});
-
- -
NOTES:

-- This plugin requires iOS 5+ - -UPDATES
-- Addressed Image caching issue. ( thanks to zsprawl ) - -AVAILABLE CORE IMAGE FILTERS
-
-	CIAdditionCompositing
-	CIAffineTransform
-	CICheckerboardGenerator
-	CIColorBlendMode
-	CIColorBurnBlendMode
-	CIColorControls
-	CIColorCube
-	CIColorDodgeBlendMode
-	CIColorInvert
-	CIColorMatrix
-	CIColorMonochrome
-	CIConstantColorGenerator
-	CICrop
-	CIDarkenBlendMode
-	CIDifferenceBlendMode
-	CIExclusionBlendMode
-	CIExposureAdjust
-	CIFalseColor
-	CIGammaAdjust
-	CIGaussianGradient
-	CIHardLightBlendMode
-	CIHighlightShadowAdjust
-	CIHueAdjust
-	CIHueBlendMode
-	CILightenBlendMode
-	CILinearGradient
-	CILuminosityBlendMode
-	CIMaximumCompositing
-	CIMinimumCompositing
-	CIMultiplyBlendMode
-	CIMultiplyCompositing
-	CIOverlayBlendMode
-	CIRadialGradient
-	CISaturationBlendMode
-	CIScreenBlendMode
-	CISepiaTone
-	CISoftLightBlendMode
-	CISourceAtopCompositing
-	CISourceInCompositing
-	CISourceOutCompositing
-	CISourceOverCompositing
-	CIStraightenFilter
-	CIStripesGenerator
-	CITemperatureAndTint
-	CIToneCurve
-	CIVibrance
-	CIVignette
-	CIWhitePointAdjust
-
- diff --git a/plugin.xml b/plugin.xml new file mode 100644 index 0000000..428e2a8 --- /dev/null +++ b/plugin.xml @@ -0,0 +1,45 @@ + + + + + + + + ImageFilter + + + ImageFilter plugin for iOS, forked from https://github.com/DrewDahlman/ImageFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Android/plugin/com/phonegap/plugins/imageFilter/Filters.java b/src/android/Filters.java similarity index 59% rename from Android/plugin/com/phonegap/plugins/imageFilter/Filters.java rename to src/android/Filters.java index 88a4fa1..fb47926 100644 --- a/Android/plugin/com/phonegap/plugins/imageFilter/Filters.java +++ b/src/android/Filters.java @@ -1,51 +1,45 @@ -package com.phonegap.plugins.imageFilter; +package co.uk.ultimateweb.imagefilter; + import org.json.JSONArray; import org.json.JSONObject; -import android.util.Log; import java.io.*; import android.net.Uri; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.*; import android.os.*; +import android.content.Context; -// CHANGE THIS TO YOUR PROJECT -import com.drewdahlman.ImageFilter.*; +import co.uk.ultimateweb.imagefilter.*; public class Filters{ - public String none(JSONArray optionsArr) { + public String none(Context context, JSONArray optionsArr) { // SET FILE PATH /* Be sure to change your storage directory here it is set to ImageFilter */ String filePath = ""; - File path = new File(Environment.getExternalStorageDirectory()+"/ImageFilter/"); + File path = new File("/storage/emulated/0/Android" + context.getFilesDir().getPath().replace("data/data","data")+"/user/"); // TMP.jpg is where we store our temporary version of the image File NBBfile = new File(path, "tmp.jpg"); // CREATE FOLDERS IF NEEDED - try{ + /*try{ boolean success = false; if(!path.exists()){ success = path.mkdir(); } - if (!success){ - Log.d("NONE","Folder not created."); - } - else{ - Log.d("NONE","Folder created!"); - } } catch (Exception e){ - e.printStackTrace(); - } + return e.toString(); + }*/ // GET URL TO IMAGE final JSONObject options = optionsArr.optJSONObject(0); - String imageURL = options.optString("image"); + String imageURL = new File(path, options.optString("image")).getAbsolutePath(); // APPLY FILTER /* @@ -55,23 +49,27 @@ public String none(JSONArray optionsArr) { // create image bitmap Bitmap bmp = BitmapFactory.decodeFile(imageURL); - if(bmp.getHeight() >= 655 || bmp.getWidth()>=655){ + /*if(bmp.getHeight() >= 655 || bmp.getWidth()>=655){ bmp = Bitmap.createBitmap(bmp,0,0,655,655); } - else { + else {*/ bmp = Bitmap.createBitmap(bmp); - } + //} // create image canvas Canvas canvas = new Canvas(bmp); Bitmap none = Bitmap.createBitmap(bmp); - canvas.drawBitmap(none,0,0,null); + Bitmap mutableBitmap = none.copy(Bitmap.Config.ARGB_8888, true); + + canvas.drawBitmap(mutableBitmap,0,0,null); // SAVE IMAGE try { // OUTPUT STREAM FileOutputStream out = new FileOutputStream(NBBfile); - none.compress(Bitmap.CompressFormat.JPEG, 100, out); + mutableBitmap.compress(Bitmap.CompressFormat.JPEG, 100, out); + out.flush(); + out.close(); // GET FILE PATH Uri uri = Uri.fromFile(NBBfile); @@ -81,64 +79,56 @@ public String none(JSONArray optionsArr) { return filePath; } catch (Exception e) { - e.printStackTrace(); + return e.toString(); } - return filePath; } - public String stark(JSONArray optionsArr) { + public String stark(Context context, JSONArray optionsArr) { // SET FILE PATH String filePath = ""; - File path = new File(Environment.getExternalStorageDirectory()+"/ImageFilter/"); - File NBBfile = new File(path, "tmp.jpg"); + File path = new File("/storage/emulated/0/Android" + context.getFilesDir().getPath().replace("data/data","data")+"/user/"); + File NBBfile = new File(path, "tmp_stark.jpg"); // CREATE FOLDERS IF NEEDED - try{ + /*try{ boolean success = false; if(!path.exists()){ success = path.mkdir(); - } - if (!success){ - Log.d("NONE","Folder not created."); - } - else{ - Log.d("NONE","Folder created!"); - } - + } } catch (Exception e){ - e.printStackTrace(); - } + return e.toString(); + }*/ // GET URL TO IMAGE final JSONObject options = optionsArr.optJSONObject(0); - String imageURL = options.optString("image"); + String imageURL = new File(path, options.optString("image")).getAbsolutePath(); // APPLY FILTER // create image bitmap Bitmap bmp = BitmapFactory.decodeFile(imageURL); - if(bmp.getHeight() >= 655 || bmp.getWidth()>=655){ + /*if(bmp.getHeight() >= 655 || bmp.getWidth()>=655){ bmp = Bitmap.createBitmap(bmp,0,0,655,655); } - else { + else {*/ bmp = Bitmap.createBitmap(bmp); - } + //} // create image canvas Bitmap none = Bitmap.createBitmap(bmp); + Bitmap mutableBitmap = none.copy(Bitmap.Config.ARGB_8888, true); - Canvas canvas = new Canvas(none); - canvas.drawBitmap(none,0,0,null); + Canvas canvas = new Canvas(mutableBitmap); + canvas.drawBitmap(mutableBitmap,0,0,null); // BORDER - Context context = MyApplication.getAppContext(); - Bitmap border = BitmapFactory.decodeResource(context.getResources(),R.drawable.painter); - + //Context context = MyApplication.getAppContext(); + //Bitmap border = BitmapFactory.decodeResource(context.getResources(),R.drawable.painter); - canvas.drawBitmap(border,0,0,null); + //canvas.drawBitmap(border,0,0,null); Paint spaint = new Paint(); ColorMatrix scm = new ColorMatrix(); @@ -154,7 +144,7 @@ public String stark(JSONArray optionsArr) { spaint.setColorFilter(new ColorMatrixColorFilter(scm)); Matrix smatrix = new Matrix(); - canvas.drawBitmap(none, smatrix, spaint); + canvas.drawBitmap(mutableBitmap, smatrix, spaint); Paint paint = new Paint(); ColorMatrix cm = new ColorMatrix(); @@ -166,7 +156,7 @@ public String stark(JSONArray optionsArr) { 0, 0, 0, 1, 0 }); paint.setColorFilter(new ColorMatrixColorFilter(cm)); Matrix matrix = new Matrix(); - canvas.drawBitmap(none, matrix, paint); + canvas.drawBitmap(mutableBitmap, matrix, paint); // SAVE IMAGE @@ -174,7 +164,9 @@ public String stark(JSONArray optionsArr) { // OUTPUT STREAM FileOutputStream out = new FileOutputStream(NBBfile); - none.compress(Bitmap.CompressFormat.JPEG, 100, out); + mutableBitmap.compress(Bitmap.CompressFormat.JPEG, 100, out); + out.flush(); + out.close(); // GET FILE PATH Uri uri = Uri.fromFile(NBBfile); @@ -185,57 +177,49 @@ public String stark(JSONArray optionsArr) { } catch (Exception e) { - e.printStackTrace(); + return e.toString(); } - return filePath; } - public String sunnyside(JSONArray optionsArr) { + public String sunnyside(Context context, JSONArray optionsArr) { // SET FILE PATH String filePath = ""; - File path = new File(Environment.getExternalStorageDirectory()+"/ImageFilter/"); - File NBBfile = new File(path, "tmp.jpg"); + File path = new File("/storage/emulated/0/Android" + context.getFilesDir().getPath().replace("data/data","data")+"/user/"); + File NBBfile = new File(path, "tmp_sunnyside.jpg"); // CREATE FOLDERS IF NEEDED - try{ + /* try{ boolean success = false; if(!path.exists()){ success = path.mkdir(); } - if (!success){ - Log.d("NONE","Folder not created."); - } - else{ - Log.d("NONE","Folder created!"); - } - - } catch (Exception e){ - e.printStackTrace(); - } + return e.toString(); + }*/ // GET URL TO IMAGE final JSONObject options = optionsArr.optJSONObject(0); - String imageURL = options.optString("image"); + String imageURL = new File(path, options.optString("image")).getAbsolutePath(); // APPLY FILTER // create image bitmap Bitmap bmp = BitmapFactory.decodeFile(imageURL); - if(bmp.getHeight() >= 655 || bmp.getWidth()>=655){ + /*if(bmp.getHeight() >= 655 || bmp.getWidth()>=655){ bmp = Bitmap.createBitmap(bmp,0,0,655,655); } - else { + else {*/ bmp = Bitmap.createBitmap(bmp); - } + //} // create image canvas Bitmap none = Bitmap.createBitmap(bmp); + Bitmap mutableBitmap = none.copy(Bitmap.Config.ARGB_8888, true); - Canvas canvas = new Canvas(none); - canvas.drawBitmap(none,0,0,null); + Canvas canvas = new Canvas(mutableBitmap); + canvas.drawBitmap(mutableBitmap,0,0,null); /*Bitmap color = boost(none,1,1); @@ -253,14 +237,14 @@ public String sunnyside(JSONArray optionsArr) { 0, 0, 0, 1, 0 }); paint.setColorFilter(new ColorMatrixColorFilter(cm)); Matrix matrix = new Matrix(); - canvas.drawBitmap(none, matrix, paint); + canvas.drawBitmap(mutableBitmap, matrix, paint); // BORDER - Bitmap border = BitmapFactory.decodeResource(App.context.getResources(),R.drawable.painter); - Bitmap scaledBorder = Bitmap.createScaledBitmap(border,655,655,false); + //Bitmap border = BitmapFactory.decodeResource(App.context.getResources(),R.drawable.painter); + //Bitmap scaledBorder = Bitmap.createScaledBitmap(border,655,655,false); - canvas.drawBitmap(scaledBorder,0,0,null); + //canvas.drawBitmap(scaledBorder,0,0,null); // SAVE IMAGE @@ -268,8 +252,10 @@ public String sunnyside(JSONArray optionsArr) { // OUTPUT STREAM FileOutputStream out = new FileOutputStream(NBBfile); - none.compress(Bitmap.CompressFormat.JPEG, 100, out); - + mutableBitmap.compress(Bitmap.CompressFormat.JPEG, 100, out); + out.flush(); + out.close(); + // GET FILE PATH Uri uri = Uri.fromFile(NBBfile); filePath = uri.toString(); @@ -279,66 +265,58 @@ public String sunnyside(JSONArray optionsArr) { } catch (Exception e) { - e.printStackTrace(); + return e.toString(); } - return filePath; } - public String pinhole(JSONArray optionsArr) { + public String pinhole(Context context, JSONArray optionsArr) { // SET FILE PATH String filePath = ""; - File path = new File(Environment.getExternalStorageDirectory()+"/ImageFilter/"); - File NBBfile = new File(path, "tmp.jpg"); + File path = new File("/storage/emulated/0/Android" + context.getFilesDir().getPath().replace("data/data","data")+"/user/"); + File NBBfile = new File(path, "tmp_pinhole.jpg"); // CREATE FOLDERS IF NEEDED - try{ + /*try{ boolean success = false; if(!path.exists()){ success = path.mkdir(); } - if (!success){ - Log.d("NONE","Folder not created."); - } - else{ - Log.d("NONE","Folder created!"); - } - - } catch (Exception e){ - e.printStackTrace(); - } + return e.toString(); + }*/ // GET URL TO IMAGE final JSONObject options = optionsArr.optJSONObject(0); - String imageURL = options.optString("image"); + String imageURL = new File(path, options.optString("image")).getAbsolutePath(); // APPLY FILTER // create image bitmap Bitmap bmp = BitmapFactory.decodeFile(imageURL); - if(bmp.getHeight() >= 655 || bmp.getWidth()>=655){ + /*if(bmp.getHeight() >= 655 || bmp.getWidth()>=655){ bmp = Bitmap.createBitmap(bmp,0,0,655,655); } - else { + else {*/ bmp = Bitmap.createBitmap(bmp); - } + //} // create image canvas Bitmap none = Bitmap.createBitmap(bmp); + Bitmap mutableBitmap = none.copy(Bitmap.Config.ARGB_8888, true); - Canvas canvas = new Canvas(none); - canvas.drawBitmap(none,0,0,null); + Canvas canvas = new Canvas(mutableBitmap); + canvas.drawBitmap(mutableBitmap,0,0,null); // BORDER - Bitmap border = BitmapFactory.decodeResource(App.context.getResources(),R.drawable.vignette3); - Bitmap scaledBorder = Bitmap.createScaledBitmap(border,655,655,false); + //Bitmap border = BitmapFactory.decodeResource(App.context.getResources(),R.drawable.vignette3); + //Bitmap scaledBorder = Bitmap.createScaledBitmap(border,655,655,false); - canvas.drawBitmap(scaledBorder,0,0,null); + //canvas.drawBitmap(scaledBorder,0,0,null); // SAVE IMAGE @@ -346,7 +324,9 @@ public String pinhole(JSONArray optionsArr) { // OUTPUT STREAM FileOutputStream out = new FileOutputStream(NBBfile); - none.compress(Bitmap.CompressFormat.JPEG, 100, out); + mutableBitmap.compress(Bitmap.CompressFormat.JPEG, 100, out); + out.flush(); + out.close(); // GET FILE PATH Uri uri = Uri.fromFile(NBBfile); @@ -357,57 +337,49 @@ public String pinhole(JSONArray optionsArr) { } catch (Exception e) { - e.printStackTrace(); + return e.toString(); } - return filePath; } - public String vintage(JSONArray optionsArr) { + public String vintage(Context context, JSONArray optionsArr) { // SET FILE PATH String filePath = ""; - File path = new File(Environment.getExternalStorageDirectory()+"/ImageFilter/"); - File NBBfile = new File(path, "tmp.jpg"); + File path = new File("/storage/emulated/0/Android" + context.getFilesDir().getPath().replace("data/data","data")+"/user/"); + File NBBfile = new File(path, "tmp_vintage.jpg"); // CREATE FOLDERS IF NEEDED - try{ + /*try{ boolean success = false; if(!path.exists()){ success = path.mkdir(); } - if (!success){ - Log.d("NONE","Folder not created."); - } - else{ - Log.d("NONE","Folder created!"); - } - - } catch (Exception e){ - e.printStackTrace(); - } + return e.toString(); + }*/ // GET URL TO IMAGE final JSONObject options = optionsArr.optJSONObject(0); - String imageURL = options.optString("image"); + String imageURL = new File(path, options.optString("image")).getAbsolutePath(); // APPLY FILTER // create image bitmap Bitmap bmp = BitmapFactory.decodeFile(imageURL); - if(bmp.getHeight() >= 655 || bmp.getWidth()>=655){ + /*if(bmp.getHeight() >= 655 || bmp.getWidth()>=655){ bmp = Bitmap.createBitmap(bmp,0,0,655,655); } - else { + else {*/ bmp = Bitmap.createBitmap(bmp); - } + //} // create image canvas Bitmap none = Bitmap.createBitmap(bmp); + Bitmap mutableBitmap = none.copy(Bitmap.Config.ARGB_8888, true); - Canvas canvas = new Canvas(none); - canvas.drawBitmap(none,0,0,null); + Canvas canvas = new Canvas(mutableBitmap); + canvas.drawBitmap(mutableBitmap,0,0,null); Paint paint = new Paint(); ColorMatrix cm = new ColorMatrix(); @@ -419,14 +391,14 @@ public String vintage(JSONArray optionsArr) { 0, 0, 0, 1, 0 }); paint.setColorFilter(new ColorMatrixColorFilter(cm)); Matrix matrix = new Matrix(); - canvas.drawBitmap(none, matrix, paint); + canvas.drawBitmap(mutableBitmap, matrix, paint); // BORDER - Bitmap border = BitmapFactory.decodeResource(App.context.getResources(),R.drawable.blackframe); - Bitmap scaledBorder = Bitmap.createScaledBitmap(border,655,655,false); + //Bitmap border = BitmapFactory.decodeResource(App.context.getResources(),R.drawable.blackframe); + //Bitmap scaledBorder = Bitmap.createScaledBitmap(border,655,655,false); - canvas.drawBitmap(scaledBorder,0,0,null); + //canvas.drawBitmap(scaledBorder,0,0,null); // SAVE IMAGE @@ -434,8 +406,10 @@ public String vintage(JSONArray optionsArr) { // OUTPUT STREAM FileOutputStream out = new FileOutputStream(NBBfile); - none.compress(Bitmap.CompressFormat.JPEG, 100, out); - + mutableBitmap.compress(Bitmap.CompressFormat.JPEG, 100, out); + out.flush(); + out.close(); + // GET FILE PATH Uri uri = Uri.fromFile(NBBfile); filePath = uri.toString(); @@ -445,57 +419,49 @@ public String vintage(JSONArray optionsArr) { } catch (Exception e) { - e.printStackTrace(); + return e.toString(); } - return filePath; } - public String worn(JSONArray optionsArr) { + public String worn(Context context, JSONArray optionsArr) { // SET FILE PATH String filePath = ""; - File path = new File(Environment.getExternalStorageDirectory()+"/ImageFilter/"); - File NBBfile = new File(path, "tmp.jpg"); + File path = new File("/storage/emulated/0/Android" + context.getFilesDir().getPath().replace("data/data","data")+"/user/"); + File NBBfile = new File(path, "tmp_worn.jpg"); // CREATE FOLDERS IF NEEDED - try{ + /*try{ boolean success = false; if(!path.exists()){ success = path.mkdir(); } - if (!success){ - Log.d("NONE","Folder not created."); - } - else{ - Log.d("NONE","Folder created!"); - } - - } catch (Exception e){ - e.printStackTrace(); - } + return e.toString(); + }*/ // GET URL TO IMAGE final JSONObject options = optionsArr.optJSONObject(0); - String imageURL = options.optString("image"); + String imageURL = new File(path, options.optString("image")).getAbsolutePath(); // APPLY FILTER // create image bitmap Bitmap bmp = BitmapFactory.decodeFile(imageURL); - if(bmp.getHeight() >= 655 || bmp.getWidth()>=655){ + /*if(bmp.getHeight() >= 655 || bmp.getWidth()>=655){ bmp = Bitmap.createBitmap(bmp,0,0,655,655); } - else { + else {*/ bmp = Bitmap.createBitmap(bmp); - } + //} // create image canvas Bitmap none = Bitmap.createBitmap(bmp); + Bitmap mutableBitmap = none.copy(Bitmap.Config.ARGB_8888, true); - Canvas canvas = new Canvas(none); - canvas.drawBitmap(none,0,0,null); + Canvas canvas = new Canvas(mutableBitmap); + canvas.drawBitmap(mutableBitmap,0,0,null); Paint paint = new Paint(); ColorMatrix cm = new ColorMatrix(); @@ -507,14 +473,14 @@ public String worn(JSONArray optionsArr) { 0, 0, 0, 1, 0 }); paint.setColorFilter(new ColorMatrixColorFilter(cm)); Matrix matrix = new Matrix(); - canvas.drawBitmap(none, matrix, paint); + canvas.drawBitmap(mutableBitmap, matrix, paint); // BORDER - Bitmap border = BitmapFactory.decodeResource(App.context.getResources(),R.drawable.vignette4); - Bitmap scaledBorder = Bitmap.createScaledBitmap(border,655,655,false); + //Bitmap border = BitmapFactory.decodeResource(App.context.getResources(),R.drawable.vignette4); + //Bitmap scaledBorder = Bitmap.createScaledBitmap(border,655,655,false); - canvas.drawBitmap(scaledBorder,0,0,null); + //canvas.drawBitmap(scaledBorder,0,0,null); // SAVE IMAGE @@ -522,8 +488,10 @@ public String worn(JSONArray optionsArr) { // OUTPUT STREAM FileOutputStream out = new FileOutputStream(NBBfile); - none.compress(Bitmap.CompressFormat.JPEG, 100, out); - + mutableBitmap.compress(Bitmap.CompressFormat.JPEG, 100, out); + out.flush(); + out.close(); + // GET FILE PATH Uri uri = Uri.fromFile(NBBfile); filePath = uri.toString(); @@ -533,9 +501,8 @@ public String worn(JSONArray optionsArr) { } catch (Exception e) { - e.printStackTrace(); + return e.toString(); } - return filePath; } } diff --git a/src/android/ImageFilter.java b/src/android/ImageFilter.java new file mode 100644 index 0000000..fd2bf4e --- /dev/null +++ b/src/android/ImageFilter.java @@ -0,0 +1,60 @@ +package co.uk.ultimateweb.imagefilter; + +import org.apache.cordova.CordovaPlugin; +import org.apache.cordova.PluginResult; +import org.apache.cordova.CallbackContext; + +import org.json.JSONArray; +import org.json.JSONException; +import android.content.Context; + +import co.uk.ultimateweb.imagefilter.*; + +public class ImageFilter extends CordovaPlugin { + @Override + public boolean execute(String action, JSONArray data, CallbackContext callbackContext) throws JSONException { + boolean result = false; + + final Filters filters = new Filters(); + Context context = this.cordova.getActivity().getApplicationContext(); + + if(action.equalsIgnoreCase("none")){ + String fileInfo = filters.none(context, data); + //result = new PluginResult(Status.OK, fileInfo); + + result = true; + callbackContext.success(fileInfo); + } + if(action.equalsIgnoreCase("stark")){ + String fileInfo = filters.stark(context, data); + // result = new PluginResult(Status.OK, fileInfo); + + result = true; + callbackContext.success(fileInfo); + } + if(action.equalsIgnoreCase("sunnyside")){ + String fileInfo = filters.sunnyside(context, data); + //result = new PluginResult(Status.OK, fileInfo); + + result = true; + callbackContext.success(fileInfo); + } + + if(action.equalsIgnoreCase("vintage")){ + String fileInfo = filters.vintage(context, data); + //result = new PluginResult(Status.OK, fileInfo); + + result = true; + callbackContext.success(fileInfo); + } + if(action.equalsIgnoreCase("worn")){ + String fileInfo = filters.worn(context, data); + //result = new PluginResult(Status.OK, fileInfo); + + result = true; + callbackContext.success(fileInfo); + } + + return result; + } +} \ No newline at end of file diff --git a/iOS/cordova/plugin/ImageFilter.h b/src/ios/ImageFilter.h similarity index 82% rename from iOS/cordova/plugin/ImageFilter.h rename to src/ios/ImageFilter.h index 2350b0c..e255e62 100644 --- a/iOS/cordova/plugin/ImageFilter.h +++ b/src/ios/ImageFilter.h @@ -3,7 +3,10 @@ // // Created by Drew Dahlman 2/25/2012. // Copyright 2012 Drew Dahlman. All rights reserved. -// version 1.0 +// +// Updated by Henry Ruhl 4/20/2014 +// +// version 1.1 // Current Filters: // none @@ -17,20 +20,15 @@ Copyright (c) 2012 Drew Dahlman MIT LICENSE */ +#import #import -#ifdef CORDOVA_FRAMEWORK -#import -#else -#import "CDVPlugin.h" -#endif - - -@interface ImageFilter : PGPlugin { - NSString* callbackID; +@interface ImageFilter : CDVPlugin +{ + NSString* callbackID; } -@property (nonatomic, retain) NSString* callbackID; +@property (nonatomic, retain) NSString* callbackID; // GARBAGE - (void)clean:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; @@ -41,4 +39,4 @@ Copyright (c) 2012 Drew Dahlman MIT LICENSE - (void)sunnySide:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; - (void)worn:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; - (void)vintage:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; -@end +@end \ No newline at end of file diff --git a/iOS/cordova/project/ImageFilter/ImageFilter/ImageFilter.m b/src/ios/ImageFilter.m similarity index 60% rename from iOS/cordova/project/ImageFilter/ImageFilter/ImageFilter.m rename to src/ios/ImageFilter.m index 86976a1..0a84bf7 100644 --- a/iOS/cordova/project/ImageFilter/ImageFilter/ImageFilter.m +++ b/src/ios/ImageFilter.m @@ -3,21 +3,35 @@ // // Created by Drew Dahlman 2/25/2012. // Copyright 2012 Drew Dahlman. All rights reserved. -// version 1.0 +// +// Updated by Henry Ruhl 4/20/2014 +// +// version 1.1 /* Copyright (c) 2012 Drew Dahlman MIT LICENSE */ -#import #import "ImageFilter.h" + #import +#import + @implementation ImageFilter + @synthesize callbackID; // For clean up purposes sometimes the apps will cache images, so this cleans things up --(void)clean:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options +-(void)clean:(CDVInvokedUrlCommand*)command; { + NSString *result = @"Image = "; + + NSMutableDictionary* options = [command.arguments objectAtIndex:0]; + NSString *filePath = [options objectForKey:@"image"]; + + result = [result stringByAppendingString:filePath]; + result = [result stringByAppendingString:@" , Directory = "]; + // Path to the Documents directory NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); if ([paths count] > 0) @@ -29,11 +43,15 @@ -(void)clean:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options NSString *directory = [paths objectAtIndex:0]; NSLog(@"Directory: %@", directory); + result = [result stringByAppendingString:directory]; // For each file in the directory, create full path and delete the file for (NSString *file in [fileManager contentsOfDirectoryAtPath:directory error:&error]) { NSString *filePath = [directory stringByAppendingPathComponent:file]; NSLog(@"File : %@", filePath); + + result = [result stringByAppendingString:@" , File = "]; + result = [result stringByAppendingString:filePath]; BOOL fileDeleted = [fileManager removeItemAtPath:filePath error:&error]; @@ -44,6 +62,10 @@ -(void)clean:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options } } + + CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:result]; + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; + NSLog(@"CLEAN!"); } @@ -89,7 +111,7 @@ -(void)none:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options // IF TRUE THEN SAVE IMAGE TO CAMERA ROLL if([save isEqualToString:@"true"]){ - UIImageWriteToSavedPhotosAlbum(newImg, self,@selector(image:didFinishSavingWithError:contextInfo:), nil); + UIImageWriteToSavedPhotosAlbum(newImg, nil, nil, nil); } // RELEASE OUR IMAGE AND DONE @@ -109,12 +131,21 @@ -(void)none:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options } --(void)stark:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options +-(void)stark:(CDVInvokedUrlCommand*)command; { - - NSString *filePath = [options objectForKey:@"image"]; - NSURL *fileNameAndPath = [NSURL URLWithString:filePath]; - + // get options + NSMutableDictionary* options = [command.arguments objectAtIndex:0]; + + // get file path + NSString *filePath = [options objectForKey:@"image"]; + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); + NSString *oDocumentsPath = [paths objectAtIndex:0]; + oDocumentsPath = [oDocumentsPath stringByAppendingString:filePath]; + + // convert file path to imageurl + NSURL *fileNameAndPath = [NSURL fileURLWithPath:oDocumentsPath]; + + // do the filtering CIImage *beginImage = [CIImage imageWithContentsOfURL:fileNameAndPath]; CIContext *context = [CIContext contextWithOptions:nil]; @@ -133,13 +164,13 @@ -(void)stark:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options CIImage *outputImageB = [filterB outputImage]; - CGImageRef cgimg = - [context createCGImage:outputImageB fromRect:[outputImageB extent]]; + // convert the filtered image to a UIImage + CGImageRef cgimg = [context createCGImage:outputImageB fromRect:[outputImageB extent]]; UIImage *newImg = [UIImage imageWithCGImage:cgimg]; - + + // store the file in the docs directory NSData *imageData = UIImageJPEGRepresentation(newImg,1.0); - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsPath = [paths objectAtIndex:0]; //Get the docs directory + NSString *documentsPath = [paths objectAtIndex:0]; int r = arc4random() % 5000; NSString *random = [NSString stringWithFormat:@"%d", r]; @@ -149,30 +180,34 @@ -(void)stark:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options [imageData writeToFile:filePathB atomically:YES]; + // save the file if requested NSString *save = [options objectForKey:@"save"]; - NSLog(@"SAVED: %@",save); if([save isEqualToString:@"true"]){ - UIImageWriteToSavedPhotosAlbum(newImg, self,@selector(image:didFinishSavingWithError:contextInfo:), nil); + UIImageWriteToSavedPhotosAlbum(newImg, nil, nil, nil); } + + //release the image CGImageRelease(cgimg); - // CALLBACK TO JAVASCRIPT WITH IMAGE URI - self.callbackID = [arguments pop]; - - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK - messageAsString:filePathB]; - - /* Create JS to call the success function with the result */ - NSString *successScript = [pluginResult toSuccessCallbackString:self.callbackID]; - /* Output the script */ - [self writeJavascript:successScript]; + //callback with path + CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:filePathB]; + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; } --(void)sunnySide:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options +-(void)sunnySide:(CDVInvokedUrlCommand*)command; { - // FILTER - NSString *filePath = [options objectForKey:@"image"]; - NSURL *fileNameAndPath = [NSURL URLWithString:filePath]; - + // get options + NSMutableDictionary* options = [command.arguments objectAtIndex:0]; + + // get file path + NSString *filePath = [options objectForKey:@"image"]; + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); + NSString *oDocumentsPath = [paths objectAtIndex:0]; + oDocumentsPath = [oDocumentsPath stringByAppendingString:filePath]; + + // convert file path to imageurl + NSURL *fileNameAndPath = [NSURL fileURLWithPath:oDocumentsPath]; + + // do the filtering CIImage *beginImage = [CIImage imageWithContentsOfURL:fileNameAndPath]; CIContext *context = [CIContext contextWithOptions:nil]; @@ -190,26 +225,13 @@ -(void)sunnySide:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)opt nil]; CIImage *outputImageB = [filterB outputImage]; - NSString *bgPath = - [[NSBundle mainBundle] pathForResource:@"painter" ofType:@"png"]; - NSURL *bgPathName = [NSURL fileURLWithPath:bgPath]; - - CIImage *bgIMG = - [CIImage imageWithContentsOfURL:bgPathName]; - - CIFilter *filterD = [CIFilter filterWithName:@"CISourceOverCompositing" - keysAndValues: kCIInputImageKey, bgIMG, - @"inputBackgroundImage",outputImageB, - nil]; - CIImage *outputImageD = [filterD outputImage]; - - CGImageRef cgimg = - [context createCGImage:outputImageD fromRect:[outputImageD extent]]; + // convert the filtered image to a UIImage + CGImageRef cgimg = [context createCGImage:outputImageB fromRect:[outputImageB extent]]; UIImage *newImg = [UIImage imageWithCGImage:cgimg]; - NSData *imageData = UIImageJPEGRepresentation(newImg,1.0); - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsPath = [paths objectAtIndex:0]; //Get the docs directory + // store the file in the docs directory + NSData *imageData = UIImageJPEGRepresentation(newImg,1.0); + NSString *documentsPath = [paths objectAtIndex:0]; int r = arc4random() % 5000; NSString *random = [NSString stringWithFormat:@"%d", r]; @@ -219,36 +241,37 @@ -(void)sunnySide:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)opt [imageData writeToFile:filePathB atomically:YES]; + // save the file if requested NSString *save = [options objectForKey:@"save"]; - NSLog(@"SAVED: %@",save); - if([save isEqualToString:@"true"]){ - UIImageWriteToSavedPhotosAlbum(newImg, self,@selector(image:didFinishSavingWithError:contextInfo:), nil); + if([save isEqualToString:@"true"]){ + UIImageWriteToSavedPhotosAlbum(newImg, nil, nil, nil); } - + + //release the image CGImageRelease(cgimg); - // CALLBACK TO JAVASCRIPT WITH IMAGE URI - self.callbackID = [arguments pop]; - - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK - messageAsString:filePathB]; - - /* Create JS to call the success function with the result */ - NSString *successScript = [pluginResult toSuccessCallbackString:self.callbackID]; - /* Output the script */ - [self writeJavascript:successScript]; - + //callback with path + CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:filePathB]; + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; } --(void)worn:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options +-(void)worn:(CDVInvokedUrlCommand*)command; { - // FILTER - NSString *filePath = [options objectForKey:@"image"]; - NSURL *fileNameAndPath = [NSURL URLWithString:filePath]; - - CIImage *beginImage = - [CIImage imageWithContentsOfURL:fileNameAndPath]; + // get options + NSMutableDictionary* options = [command.arguments objectAtIndex:0]; + + // get file path + NSString *filePath = [options objectForKey:@"image"]; + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); + NSString *oDocumentsPath = [paths objectAtIndex:0]; + oDocumentsPath = [oDocumentsPath stringByAppendingString:filePath]; + + // convert file path to imageurl + NSURL *fileNameAndPath = [NSURL fileURLWithPath:oDocumentsPath]; + + // do the filtering + CIImage *beginImage = [CIImage imageWithContentsOfURL:fileNameAndPath]; CIContext *context = [CIContext contextWithOptions:nil]; - + CIFilter *filter = [CIFilter filterWithName:@"CIWhitePointAdjust" keysAndValues: kCIInputImageKey, beginImage, @"inputColor",[CIColor colorWithRed:212 green:235 blue:241 alpha:1], @@ -269,26 +292,13 @@ -(void)worn:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options nil]; CIImage *outputImageC = [filterC outputImage]; - NSString *framePath = - [[NSBundle mainBundle] pathForResource:@"vignette4" ofType:@"png"]; - NSURL *framePathName = [NSURL fileURLWithPath:framePath]; - - CIImage *frameImg = - [CIImage imageWithContentsOfURL:framePathName]; - - CIFilter *filterD = [CIFilter filterWithName:@"CISourceOverCompositing" - keysAndValues: kCIInputImageKey, frameImg, - @"inputBackgroundImage",outputImageC, - nil]; - CIImage *outputImageD = [filterD outputImage]; - - CGImageRef cgimg = - [context createCGImage:outputImageD fromRect:[outputImageD extent]]; + // convert the filtered image to a UIImage + CGImageRef cgimg = [context createCGImage:outputImageC fromRect:[outputImageC extent]]; UIImage *newImg = [UIImage imageWithCGImage:cgimg]; + // store the file in the docs directory NSData *imageData = UIImageJPEGRepresentation(newImg,1.0); - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsPath = [paths objectAtIndex:0]; //Get the docs directory + NSString *documentsPath = [paths objectAtIndex:0]; int r = arc4random() % 5000; NSString *random = [NSString stringWithFormat:@"%d", r]; @@ -298,31 +308,34 @@ -(void)worn:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options [imageData writeToFile:filePathB atomically:YES]; + // save the file if requested NSString *save = [options objectForKey:@"save"]; - NSLog(@"SAVED: %@",save); if([save isEqualToString:@"true"]){ - UIImageWriteToSavedPhotosAlbum(newImg, self,@selector(image:didFinishSavingWithError:contextInfo:), nil); + UIImageWriteToSavedPhotosAlbum(newImg, nil, nil, nil); } + + //release the image CGImageRelease(cgimg); - // CALLBACK TO JAVASCRIPT WITH IMAGE URI - self.callbackID = [arguments pop]; - - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK - messageAsString:filePathB]; - - /* Create JS to call the success function with the result */ - NSString *successScript = [pluginResult toSuccessCallbackString:self.callbackID]; - /* Output the script */ - [self writeJavascript:successScript]; - + //callback with path + CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:filePathB]; + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; } --(void)vintage:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options +-(void)vintage:(CDVInvokedUrlCommand*)command; { - // FILTER - NSString *filePath = [options objectForKey:@"image"]; - NSURL *fileNameAndPath = [NSURL URLWithString:filePath]; - + // get options + NSMutableDictionary* options = [command.arguments objectAtIndex:0]; + + // get file path + NSString *filePath = [options objectForKey:@"image"]; + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); + NSString *oDocumentsPath = [paths objectAtIndex:0]; + oDocumentsPath = [oDocumentsPath stringByAppendingString:filePath]; + + // convert file path to imageurl + NSURL *fileNameAndPath = [NSURL fileURLWithPath:oDocumentsPath]; + + // do the filtering CIImage *beginImage = [CIImage imageWithContentsOfURL:fileNameAndPath]; CIContext *context = [CIContext contextWithOptions:nil]; @@ -340,26 +353,13 @@ -(void)vintage:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)optio nil]; CIImage *outputImageB = [filterB outputImage]; - NSString *framePath = - [[NSBundle mainBundle] pathForResource:@"vintage" ofType:@"png"]; - NSURL *framePathName = [NSURL fileURLWithPath:framePath]; - - CIImage *frameImg = - [CIImage imageWithContentsOfURL:framePathName]; - - CIFilter *filterD = [CIFilter filterWithName:@"CISourceOverCompositing" - keysAndValues: kCIInputImageKey, frameImg, - @"inputBackgroundImage",outputImageB, - nil]; - CIImage *outputImageD = [filterD outputImage]; - - CGImageRef cgimg = - [context createCGImage:outputImageD fromRect:[outputImageD extent]]; + // convert the filtered image to a UIImage + CGImageRef cgimg = [context createCGImage:outputImageB fromRect:[outputImageB extent]]; UIImage *newImg = [UIImage imageWithCGImage:cgimg]; - NSData *imageData = UIImageJPEGRepresentation(newImg,1.0); - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsPath = [paths objectAtIndex:0]; //Get the docs directory + // store the file in the docs directory + NSData *imageData = UIImageJPEGRepresentation(newImg,1.0); + NSString *documentsPath = [paths objectAtIndex:0]; int r = arc4random() % 5000; NSString *random = [NSString stringWithFormat:@"%d", r]; @@ -369,40 +369,17 @@ -(void)vintage:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)optio [imageData writeToFile:filePathB atomically:YES]; + // save the file if requested NSString *save = [options objectForKey:@"save"]; - NSLog(@"SAVED: %@",save); if([save isEqualToString:@"true"]){ - UIImageWriteToSavedPhotosAlbum(newImg, self,@selector(image:didFinishSavingWithError:contextInfo:), nil); + UIImageWriteToSavedPhotosAlbum(newImg, nil, nil, nil); } - + + //release the image CGImageRelease(cgimg); - // CALLBACK TO JAVASCRIPT WITH IMAGE URI - self.callbackID = [arguments pop]; - - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK - messageAsString:filePathB]; - - /* Create JS to call the success function with the result */ - NSString *successScript = [pluginResult toSuccessCallbackString:self.callbackID]; - /* Output the script */ - [self writeJavascript:successScript]; -} - -// CAMERA ROLL SAVER -- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error - contextInfo:(void *)contextInfo -{ - // Was there an error? - if (error != NULL) - { - // Show error message... - NSLog(@"ERROR: %@",error); - } - else // No errors - { - // Show message image successfully saved - NSLog(@"IMAGE SAVED!"); - } + //callback with path + CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:filePathB]; + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; } @end \ No newline at end of file diff --git a/www/ImageFilter.js b/www/ImageFilter.js new file mode 100644 index 0000000..3e6f326 --- /dev/null +++ b/www/ImageFilter.js @@ -0,0 +1,85 @@ +/* +Copyright (c) 2012 Drew Dahlman MIT LICENSE +*/ + +var ImageFilter = function () {}; + +ImageFilter.prototype.clean = function (done, error, options) { + var defaults = { + image: '', + save: '', + }; + for(var key in defaults) { + if(typeof options[key] !== "undefined") defaults[key] = options[key]; + } + + return cordova.exec(done, error, "ImageFilter", "clean", [defaults]); +}; + +ImageFilter.prototype.none = function (done, error, options) { + //console.log(options+" "+done); + var defaults = { + image: '', + save: '', + }; + for(var key in defaults) { + if(typeof options[key] !== "undefined") defaults[key] = options[key]; + } + + return cordova.exec(done,error,"ImageFilter","none",[defaults]); +}; + +ImageFilter.prototype.sunnySide = function (done, error, options) { + var defaults = { + image: '', + save: '', + }; + for(var key in defaults) { + if(typeof options[key] !== "undefined") defaults[key] = options[key]; + } + return cordova.exec(done, error, "ImageFilter","sunnySide",[defaults]); +}; + +ImageFilter.prototype.worn = function (done, error ,options) { + var defaults = { + image: '', + save: '', + }; + for(var key in defaults) { + if(typeof options[key] !== "undefined") defaults[key] = options[key]; + } + return cordova.exec(done,error,"ImageFilter","worn",[defaults]); +}; + +ImageFilter.prototype.vintage = function (done,error,options) { + var defaults = { + image: '', + save: '', + }; + for(var key in defaults) { + if(typeof options[key] !== "undefined") defaults[key] = options[key]; + } + return cordova.exec(done,error,"ImageFilter","vintage",[defaults]); +}; + +ImageFilter.prototype.stark = function (done,error,options) { + var defaults = { + image: '', + save: '', + }; + for(var key in defaults) { + if(typeof options[key] !== "undefined") defaults[key] = options[key]; + } + return cordova.exec(done,error,"ImageFilter","stark",[defaults]); +}; + +ImageFilter.install = function () { + if (!window.plugins) { + window.plugins = {}; + } + + window.plugins.ImageFilter = new ImageFilter(); + return window.plugins.ImageFilter; +}; + +cordova.addConstructor(ImageFilter.install); \ No newline at end of file