hjg
2024-01-17 efbf825aa2f845bc6f9b26b0fa10139c8071deef
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>iframe</title>
 
        <style>
            html,body{
                margin: 0;
                height: 100%;
                font: 13px/1.555 "Trebuchet MS", sans-serif;
            }
            a{
                color: #888;
                font-weight: bold;
                text-decoration: none;
                border-bottom: 1px solid #888;
            }
            .main-box {
                color:#252525;
                padding: 3px 5px;
                text-align: justify;
            }
            .main-box p{margin: 0 0 14px;}
            .main-box .cerr{
                color: #f00000;
                border-bottom-color: #f00000;
            }
        </style>
    </head>
    <body>
        <div id="content" class="main-box"></div>
        <iframe src="" frameborder="0" id="spelltext" name="spelltext" style="display:none; width: 100%" ></iframe>
        <iframe src="" frameborder="0" id="loadsuggestfirst" name="loadsuggestfirst" style="display:none; width: 100%" ></iframe>
        <iframe src="" frameborder="0" id="loadspellsuggestall" name="loadspellsuggestall" style="display:none; width: 100%" ></iframe>
        <iframe src="" frameborder="0" id="loadOptionsForm" name="loadOptionsForm" style="display:none; width: 100%" ></iframe>
        <script>
        (function(window) {
            // Constructor Manager PostMessage
 
            var ManagerPostMessage = function() {
                var _init = function(handler) {
                    if (document.addEventListener) {
                        window.addEventListener('message', handler, false);
                    } else {
                        window.attachEvent("onmessage", handler);
                    };
                };
                var _sendCmd = function(o) {
                    var str,
                        type = Object.prototype.toString,
                        fn = o.fn || null,
                        id = o.id || '',
                        target = o.target || window,
                        message = o.message || { 'id': id };
 
                    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);
                    target.postMessage(str, '*');
                };
 
                return {
                    init: _init,
                    send: _sendCmd
                };
            };
 
            var manageMessageTmp = new ManagerPostMessage;
 
 
                var appString = (function(){
                    var spell = parent.CKEDITOR.config.wsc.DefaultParams.scriptPath;
                    var serverUrl = parent.CKEDITOR.config.wsc.DefaultParams.serviceHost;
                    return serverUrl + spell;
                })();
 
                function loadScript(src, callback) {
                    var scriptTag = document.createElement("script");
                           scriptTag.type = "text/javascript";
                       callback ? callback : callback = function() {};
                    if(scriptTag.readyState) {
                        //IE
                        scriptTag.onreadystatechange = function() {
                            if (scriptTag.readyState == "loaded" ||
                            scriptTag.readyState == "complete") {
                                scriptTag.onreadystatechange = null;
                                setTimeout(function(){scriptTag.parentNode.removeChild(scriptTag)},1)
                                callback();
                            }
                        };
                    }else{
                        //Others
                        scriptTag.onload = function() {
                           setTimeout(function(){scriptTag.parentNode.removeChild(scriptTag)},1);
                           callback();
                        };
                    };
                    scriptTag.src = src;
                    document.getElementsByTagName("head")[0].appendChild(scriptTag);
                };
 
 
                window.onload = function(){
                     loadScript(appString, function(){
                        manageMessageTmp.send({
                            'id': 'iframeOnload',
                            'target': window.parent
                        });
                    });
                }
            })(this);
        </script>
    </body>
</html>