1 | if (licenseAvailable == "!OK")
|
---|
2 | {
|
---|
3 | $('#alert-services').modal('show');
|
---|
4 | if (first_visit == '1') {
|
---|
5 | $('#alert-services').modal('show');
|
---|
6 | }
|
---|
7 | }
|
---|
8 | //if (first_visit == '1') {
|
---|
9 |
|
---|
10 | if (p_period == -1)
|
---|
11 | {
|
---|
12 | $('#alert-trial-services').modal('show');
|
---|
13 | $('#alert-trial-services').on('hidden.bs.modal', function () {
|
---|
14 | if (update_user_info == "1")
|
---|
15 | {
|
---|
16 | $('#update_user_info').modal({backdrop: 'static',keyboard: false,});
|
---|
17 | }
|
---|
18 | });
|
---|
19 | }
|
---|
20 | else
|
---|
21 | {
|
---|
22 | if (update_user_info == "1")
|
---|
23 | {
|
---|
24 | $('#update_user_info').modal({backdrop: 'static'});
|
---|
25 | }
|
---|
26 | }
|
---|
27 |
|
---|
28 | //}
|
---|
29 |
|
---|
30 |
|
---|
31 | $("#update_user_info.btn").click(function () {
|
---|
32 | $(".error").html("");
|
---|
33 | $.ajax({
|
---|
34 | url: 'user/update_info/',
|
---|
35 | type: 'POST',
|
---|
36 | data: $("#update_user_info.form").serialize(),
|
---|
37 | success: function (data, textStatus, jqXHR)
|
---|
38 | {
|
---|
39 | result = jQuery.parseJSON(data);
|
---|
40 | if (result.success == "1")
|
---|
41 | {
|
---|
42 | $('#update_user_info').modal('hide');
|
---|
43 |
|
---|
44 | }
|
---|
45 | else
|
---|
46 | {
|
---|
47 | for (var key in result.errors)
|
---|
48 | {
|
---|
49 | $("#" + result.errors[key]['field'] + ".error").html(result.errors[key]['content']);
|
---|
50 |
|
---|
51 | }
|
---|
52 | }
|
---|
53 | }
|
---|
54 | });
|
---|
55 | });
|
---|
56 |
|
---|
57 | function showModal() {
|
---|
58 | console.log('Show modal!');
|
---|
59 | $('#alert-services-package').modal('show');
|
---|
60 | }
|
---|
61 |
|
---|
62 | $('#services-reg').click(function () {
|
---|
63 | $('#alert-services').modal('hide');
|
---|
64 | window.location = url + "frontend/user/profile#services-register";
|
---|
65 | });
|
---|
66 |
|
---|
67 | $('#save-package').click(function () {
|
---|
68 | DoSaveLecture();
|
---|
69 | });
|
---|
70 |
|
---|
71 | $('#services-sign').click(function () {
|
---|
72 | $('#alert-services-reg').modal('hide');
|
---|
73 | $('#alert-services-reg-2').modal('show');
|
---|
74 | })
|
---|
75 |
|
---|
76 | var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
|
---|
77 | var g_Flash = null;
|
---|
78 | var g_cbData = "";
|
---|
79 |
|
---|
80 | function InitViolet() {
|
---|
81 | g_Flash = document.getElementById('LectorEditorOnline');
|
---|
82 | //g_Flash = $('#LectorEditorOnline');
|
---|
83 | //g_Flash = isInternetExplorer ? LectorEditorOnline : document.LectorEditorOnline;
|
---|
84 | }
|
---|
85 | ;
|
---|
86 |
|
---|
87 | function GetClipboardItem() {
|
---|
88 | var cbData = window.clipboardData ? window.clipboardData.getData('Text') : g_cbData;
|
---|
89 | g_Flash.SetVariable("clipboardData", cbData);
|
---|
90 | g_Flash.SetVariable("command", "Get Text");
|
---|
91 | }
|
---|
92 | ;
|
---|
93 |
|
---|
94 | function SetClipboardItem(args) {
|
---|
95 | if (window.clipboardData)
|
---|
96 | window.clipboardData.setData('Text', args);
|
---|
97 | else
|
---|
98 | g_cbData = args;
|
---|
99 | g_Flash.SetVariable("command", "Set OK");
|
---|
100 | }
|
---|
101 | ;
|
---|
102 |
|
---|
103 | function SetWindowTitle(fileName) {
|
---|
104 | if (fileName == "")
|
---|
105 | document.title = "Violet Online";
|
---|
106 | else {
|
---|
107 | var docName = fileName.substring(0, fileName.length - 4);
|
---|
108 | document.title = "Violet Online - " + docName;
|
---|
109 | }
|
---|
110 | }
|
---|
111 | ;
|
---|
112 |
|
---|
113 | function SetWindowState() {
|
---|
114 | var full = (g_Flash.width == "100%");
|
---|
115 | g_Flash.width = full ? "800" : "100%";
|
---|
116 | g_Flash.height = full ? "580" : "100%";
|
---|
117 | }
|
---|
118 | ;
|
---|
119 |
|
---|
120 | function DoSaveLecture() {
|
---|
121 | g_Flash.SetVariable("command", "Press Save");
|
---|
122 | }
|
---|
123 |
|
---|
124 | function DoOpenLecture(filename) {
|
---|
125 | g_Flash.SetVariable("openedFileName", filename);
|
---|
126 | g_Flash.SetVariable("command", "Open File");
|
---|
127 | }
|
---|
128 |
|
---|
129 | function DoCloseLecture () {
|
---|
130 | g_Flash.SetVariable("command", "Quit App");
|
---|
131 | }
|
---|
132 |
|
---|
133 | // Handle all the FSCommand messages in a Flash movie.
|
---|
134 | function LectorEditorOnline_DoFSCommand(command, args) {
|
---|
135 | switch (command) {
|
---|
136 | case "Set Title":
|
---|
137 | SetWindowTitle(args);
|
---|
138 | break;
|
---|
139 | case "Get Clipboard":
|
---|
140 | GetClipboardItem();
|
---|
141 | break;
|
---|
142 | case "Set Clipboard":
|
---|
143 | SetClipboardItem(args);
|
---|
144 | break;
|
---|
145 | case "Set State":
|
---|
146 | //SetWindowState();
|
---|
147 | break;
|
---|
148 | case "Quit":
|
---|
149 | window.open('', '_self').close();
|
---|
150 | break;
|
---|
151 | case "trace":
|
---|
152 | alert(args);
|
---|
153 | break;
|
---|
154 | case "Check License":
|
---|
155 | showModal();
|
---|
156 | break;
|
---|
157 | }
|
---|
158 | }
|
---|
159 | ;
|
---|
160 |
|
---|
161 | // Hook for Internet Explorer.
|
---|
162 | if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
|
---|
163 | document.write('<script language=\"VBScript\"\>\n');
|
---|
164 | document.write('On Error Resume Next\n');
|
---|
165 | document.write('Sub LectorEditorOnline_FSCommand(ByVal command, ByVal args)\n');
|
---|
166 | document.write(' Call LectorEditorOnline_DoFSCommand(command, args)\n');
|
---|
167 | document.write('End Sub\n');
|
---|
168 | document.write('</script\>\n');
|
---|
169 | }
|
---|
170 | ;
|
---|
171 |
|
---|
172 |
|
---|
173 | $(document).ready(function () {
|
---|
174 | InitViolet();
|
---|
175 | //$('#open-lecture').click(function(e){DoOpenLecture('http://sbgapi.violet.vn/space/file/id/7');});
|
---|
176 | var inFormOrLink = false;
|
---|
177 |
|
---|
178 | /*$( window ).bind('beforeunload',function(e) {
|
---|
179 | console.log('unload');
|
---|
180 | e.preventDefault();
|
---|
181 | });*/
|
---|
182 | }) |
---|