source: pro-violet-viettel/sourcecode/assets/js/frontend/lecture.js @ 542

Last change on this file since 542 was 531, checked in by quyenla, 11 years ago

dang ki dich vu

  • Property svn:mime-type set to text/plain
File size: 3.1 KB
Line 
1
2if (licenseAvailable == "!OK")
3{
4 
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
17function 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
32var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
33var g_Flash = null;
34var g_cbData = "";
35
36function InitViolet() {
37    g_Flash = document.getElementById('LectorEditorOnline');
38    //g_Flash = $('#LectorEditorOnline');
39    //g_Flash = isInternetExplorer ? LectorEditorOnline : document.LectorEditorOnline;
40}
41;
42
43function 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
50function 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
59function 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
69function 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.
77function 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.
105if (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})
Note: See TracBrowser for help on using the repository browser.