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

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

first show modal

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