Skip to content
Snippets Groups Projects
Commit 494c43e0 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

Remove unused code and lib, on https frame

parent 14e1f01b
No related branches found
No related tags found
No related merge requests found
"use strict";window.XdUtils=window.XdUtils||function(){function a(a,b){var c,d=b||{};for(c in a)a.hasOwnProperty(c)&&(d[c]=a[c]);return d}return{extend:a}}(),window.xdLocalStorage=window.xdLocalStorage||function(){function a(a){j[a.id]&&(j[a.id](a),delete j[a.id])}function b(b){var c;try{c=JSON.parse(b.data)}catch(a){}c&&c.namespace===g&&("iframe-ready"===c.id?(l=!0,h.initCallback()):a(c))}function c(a,b,c,d){i++,j[i]=d;var e={namespace:g,id:i,action:a,key:b,value:c};f.contentWindow.postMessage(JSON.stringify(e),"*")}function d(a){h=XdUtils.extend(a,h);var c=document.createElement("div");window.addEventListener?window.addEventListener("message",b,!1):window.attachEvent("onmessage",b),c.innerHTML='<iframe id="'+h.iframeId+'" src='+h.iframeUrl+' style="display: none;"></iframe>',document.body.appendChild(c),f=document.getElementById(h.iframeId)}function e(){return k?!!l||(console.log("You must wait for iframe ready message before using the api."),!1):(console.log("You must call xdLocalStorage.init() before using it."),!1)}var f,g="cross-domain-local-message",h={iframeId:"cross-domain-iframe",iframeUrl:void 0,initCallback:function(){}},i=-1,j={},k=!1,l=!0;return{init:function(a){if(!a.iframeUrl)throw"You must specify iframeUrl";return k?void console.log("xdLocalStorage was already initialized!"):(k=!0,void("complete"===document.readyState?d(a):window.onload=function(){d(a)}))},setItem:function(a,b,d){e()&&c("set",a,b,d)},getItem:function(a,b){e()&&c("get",a,null,b)},removeItem:function(a,b){e()&&c("remove",a,null,b)},key:function(a,b){e()&&c("key",a,null,b)},getSize:function(a){e()&&c("size",null,null,a)},getLength:function(a){e()&&c("length",null,null,a)},clear:function(a){e()&&c("clear",null,null,a)},wasInit:function(){return k}}}(),angular.module("xdLocalStorage",[]).service("xdLocalStorage",["$q","$rootScope",function(a,b){function c(){if(!xdLocalStorage.wasInit())throw"You must init xdLocalStorage in app config before use";return f.promise}function d(d){var e=Array.prototype.slice.call(arguments,1);return c().then(function(){var c=a.defer();return xdLocalStorage[d].apply(this,e.concat(function(){var a=arguments[0];b.$apply(function(){c.resolve(a)})})),c.promise})}var e=!1,f=a.defer(),g=b.$watch(function(){return e},function(){f.resolve(!0),g()});return{init:function(c){var d=a.defer();return c.initCallback=function(){b.$apply(function(){e=!0,d.resolve()})},xdLocalStorage.init(c),d.promise},setItem:function(a,b){return d("setItem",a,b)},getItem:function(a){return d("getItem",a)},removeItem:function(a){return d("removeItem",a)},key:function(a){return d("key",a)},clear:function(){return d("clear")}}}]);
\ No newline at end of file
"use strict";window.XdUtils=window.XdUtils||function(){function a(a,b){var c,d=b||{};for(c in a)a.hasOwnProperty(c)&&(d[c]=a[c]);return d}return{extend:a}}(),function(){function a(a,b){var c=XdUtils.extend(b,l);c.id=a,parent.postMessage(JSON.stringify(c),"*")}function b(b,c){var d=localStorage.getItem(c),e={key:c,value:d};a(b,e)}function c(b,c,d){localStorage.setItem(c,d);var e=localStorage.getItem(c),f={success:e===d};a(b,f)}function d(b,c){localStorage.removeItem(c),a(b,{})}function e(b,c){var d=localStorage.key(c);a(b,{key:d})}function f(b){var c=JSON.stringify(localStorage).length;a(b,{size:c})}function g(b){var c=localStorage.length;a(b,{length:c})}function h(b){localStorage.clear(),a(b,{})}function i(a){var i;try{i=JSON.parse(a.data)}catch(a){}i&&i.namespace===k&&("set"===i.action?c(i.id,i.key,i.value):"get"===i.action?b(i.id,i.key):"remove"===i.action?d(i.id,i.key):"key"===i.action?e(i.id,i.key):"size"===i.action?f(i.id):"length"===i.action?g(i.id):"clear"===i.action&&h(i.id))}function j(){var a={namespace:k,id:"iframe-ready"};parent.postMessage(JSON.stringify(a),"*")}var k="cross-domain-local-message",l={namespace:k};window.addEventListener?window.addEventListener("message",i,!1):window.attachEvent("onmessage",i),j()}();
\ No newline at end of file
......@@ -174,9 +174,6 @@
</ion-list>
<iframe name="httpsFrame" style="display:none" ng-src="{{$root.detailFrame}}" >
</iframe>
</ion-content>
<!-- removeIf(device) -->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment