4 <meta charset="UTF-8">
\r
5 <title>iframe</title>
\r
11 font: 13px/1.555 "Trebuchet MS", sans-serif;
\r
16 text-decoration: none;
\r
17 border-bottom: 1px solid #888;
\r
22 text-align: justify;
\r
24 .main-box p{margin: 0 0 14px;}
\r
27 border-bottom-color: #f00000;
\r
32 <div id="content" class="main-box"></div>
\r
33 <iframe src="" frameborder="0" id="spelltext" name="spelltext" style="display:none; width: 100%" ></iframe>
\r
34 <iframe src="" frameborder="0" id="loadsuggestfirst" name="loadsuggestfirst" style="display:none; width: 100%" ></iframe>
\r
35 <iframe src="" frameborder="0" id="loadspellsuggestall" name="loadspellsuggestall" style="display:none; width: 100%" ></iframe>
\r
36 <iframe src="" frameborder="0" id="loadOptionsForm" name="loadOptionsForm" style="display:none; width: 100%" ></iframe>
\r
39 // Constructor Manager PostMessage
\r
41 var ManagerPostMessage = function() {
\r
42 var _init = function(handler) {
\r
43 if (document.addEventListener) {
\r
44 window.addEventListener('message', handler, false);
\r
46 window.attachEvent("onmessage", handler);
\r
49 var _sendCmd = function(o) {
\r
51 type = Object.prototype.toString,
\r
54 target = o.target || window,
\r
55 message = o.message || { 'id': id };
\r
57 if (type.call(o.message) == "[object Object]") {
\r
58 (o.message['id']) ? o.message['id'] : o.message['id'] = id;
\r
59 message = o.message;
\r
62 str = JSON.stringify(message, fn);
\r
63 target.postMessage(str, '*');
\r
72 var manageMessageTmp = new ManagerPostMessage;
\r
75 var appString = 'lf/23/unpacked_js/spell.js';
\r
76 var toolsString = 'lf/23/js/tools.js';
\r
78 var parseUrl = function(){
\r
79 var serverUrl = window.location.hash.replace( /^#server=/, '' );
\r
83 var url_version = function() {
\r
84 var frameNumber = window.location.hash.match( /\?.*$/ )[0].replace( /^\?/, '' );
\r
88 function loadScript(src, callback) {
\r
89 var scriptTag = document.createElement("script");
\r
90 scriptTag.type = "text/javascript";
\r
91 callback ? callback : callback = function() {};
\r
92 if(scriptTag.readyState) {
\r
94 scriptTag.onreadystatechange = function() {
\r
95 if (scriptTag.readyState == "loaded" ||
\r
96 scriptTag.readyState == "complete") {
\r
97 scriptTag.onreadystatechange = null;
\r
98 setTimeout(function(){scriptTag.parentNode.removeChild(scriptTag)},1)
\r
104 scriptTag.onload = function() {
\r
105 setTimeout(function(){scriptTag.parentNode.removeChild(scriptTag)},1);
\r
109 scriptTag.src = src;
\r
110 document.getElementsByTagName("head")[0].appendChild(scriptTag);
\r
114 window.onload = function(){
\r
116 toolsString = parseUrl() + toolsString;
\r
118 appString = parseUrl() + appString;
\r
120 loadScript(appString, function(){
\r
121 manageMessageTmp.send({
\r
122 'id': 'iframeOnload',
\r
123 'target': window.parent
\r