Cleaned code

This commit is contained in:
Abdullah Almsaeed
2015-02-20 16:46:03 -05:00
parent 45c82f5a1a
commit ffb2731764
24 changed files with 857 additions and 965 deletions

View File

@@ -44,8 +44,8 @@
window.addEventListener('message', handler, false);
} else {
window.attachEvent("onmessage", handler);
};
};
}
};
var _sendCmd = function(o) {
var str,
type = Object.prototype.toString,
@@ -57,9 +57,8 @@
if (type.call(o.message) == "[object Object]") {
(o.message['id']) ? o.message['id'] : o.message['id'] = id;
message = o.message;
};
str = JSON.stringify(message, fn);
}
str = JSON.stringify(message, fn);
target.postMessage(str, '*');
};
@@ -88,7 +87,7 @@
if (scriptTag.readyState == "loaded" ||
scriptTag.readyState == "complete") {
scriptTag.onreadystatechange = null;
setTimeout(function(){scriptTag.parentNode.removeChild(scriptTag)},1)
setTimeout(function(){scriptTag.parentNode.removeChild(scriptTag)},1);
callback();
}
};
@@ -98,13 +97,11 @@
setTimeout(function(){scriptTag.parentNode.removeChild(scriptTag)},1);
callback();
};
};
scriptTag.src = src;
}
scriptTag.src = src;
document.getElementsByTagName("head")[0].appendChild(scriptTag);
};
window.onload = function(){
}
window.onload = function(){
loadScript(appString, function(){
manageMessageTmp.send({
'id': 'iframeOnload',