1 |
|
---|
2 | if (licenseAvailable == "!OK")
|
---|
3 | {
|
---|
4 | showModal();
|
---|
5 | var ck = document.cookie;
|
---|
6 |
|
---|
7 | if (document.cookie.indexOf("open") >= 0) {
|
---|
8 | }
|
---|
9 | else
|
---|
10 | {
|
---|
11 | showModal();
|
---|
12 | document.cookie = "open=1";
|
---|
13 | }
|
---|
14 |
|
---|
15 | }
|
---|
16 |
|
---|
17 | function showModal() {
|
---|
18 | console.log('Show modal!');
|
---|
19 | $('#alert-services').modal('show');
|
---|
20 | }
|
---|
21 |
|
---|
22 | $('#services-reg').click(function () {
|
---|
23 | window.location=url+"frontend/user/profile#services-register";
|
---|
24 | $('#alert-services').modal('hide');
|
---|
25 | // $('#alert-services-reg').modal('show');
|
---|
26 | });
|
---|
27 | $('#services-sign').click(function () {
|
---|
28 | $('#alert-services-reg').modal('hide');
|
---|
29 | $('#alert-services-reg-2').modal('show');
|
---|
30 | })
|
---|
31 |
|
---|
32 | var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
|
---|
33 | var g_Flash = null;
|
---|
34 | var g_cbData = "";
|
---|
35 |
|
---|
36 | function InitViolet() {
|
---|
37 | g_Flash = document.getElementById('LectorEditorOnline');
|
---|
38 | //g_Flash = $('#LectorEditorOnline');
|
---|
39 | //g_Flash = isInternetExplorer ? LectorEditorOnline : document.LectorEditorOnline;
|
---|
40 | }
|
---|
41 | ;
|
---|
42 |
|
---|
43 | function GetClipboardItem() {
|
---|
44 | var cbData = window.clipboardData ? window.clipboardData.getData('Text') : g_cbData;
|
---|
45 | g_Flash.SetVariable("clipboardData", cbData);
|
---|
46 | g_Flash.SetVariable("command", "Get Text");
|
---|
47 | }
|
---|
48 | ;
|
---|
49 |
|
---|
50 | function SetClipboardItem(args) {
|
---|
51 | if (window.clipboardData)
|
---|
52 | window.clipboardData.setData('Text', args);
|
---|
53 | else
|
---|
54 | g_cbData = args;
|
---|
55 | g_Flash.SetVariable("command", "Set OK");
|
---|
56 | }
|
---|
57 | ;
|
---|
58 |
|
---|
59 | function SetWindowTitle(fileName) {
|
---|
60 | if (fileName == "")
|
---|
61 | document.title = "Violet Online";
|
---|
62 | else {
|
---|
63 | var docName = fileName.substring(0, fileName.length - 4);
|
---|
64 | document.title = "Violet Online - " + docName;
|
---|
65 | }
|
---|
66 | }
|
---|
67 | ;
|
---|
68 |
|
---|
69 | function SetWindowState() {
|
---|
70 | var full = (g_Flash.width == "100%");
|
---|
71 | g_Flash.width = full ? "800" : "100%";
|
---|
72 | g_Flash.height = full ? "580" : "100%";
|
---|
73 | }
|
---|
74 | ;
|
---|
75 |
|
---|
76 | // Handle all the FSCommand messages in a Flash movie.
|
---|
77 | function LectorEditorOnline_DoFSCommand(command, args) {
|
---|
78 | switch (command) {
|
---|
79 | case "Set Title":
|
---|
80 | SetWindowTitle(args);
|
---|
81 | break;
|
---|
82 | case "Get Clipboard":
|
---|
83 | GetClipboardItem();
|
---|
84 | break;
|
---|
85 | case "Set Clipboard":
|
---|
86 | SetClipboardItem(args);
|
---|
87 | break;
|
---|
88 | case "Set State":
|
---|
89 | SetWindowState();
|
---|
90 | break;
|
---|
91 | case "Quit":
|
---|
92 | window.open('', '_self').close();
|
---|
93 | break;
|
---|
94 | case "trace":
|
---|
95 | alert(args);
|
---|
96 | break;
|
---|
97 | case "Check License":
|
---|
98 | showModal();
|
---|
99 | break;
|
---|
100 | }
|
---|
101 | }
|
---|
102 | ;
|
---|
103 |
|
---|
104 | // Hook for Internet Explorer.
|
---|
105 | if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
|
---|
106 | document.write('<script language=\"VBScript\"\>\n');
|
---|
107 | document.write('On Error Resume Next\n');
|
---|
108 | document.write('Sub LectorEditorOnline_FSCommand(ByVal command, ByVal args)\n');
|
---|
109 | document.write(' Call LectorEditorOnline_DoFSCommand(command, args)\n');
|
---|
110 | document.write('End Sub\n');
|
---|
111 | document.write('</script\>\n');
|
---|
112 | }
|
---|
113 | ;
|
---|
114 |
|
---|
115 | $(document).ready(function () {
|
---|
116 | InitViolet();
|
---|
117 | }) |
---|