Ignore:
Timestamp:
Nov 13, 2014 6:27:55 PM (11 years ago)
Author:
quyenla
Message:

package resgister

Location:
pro-violet-viettel/sourcecode/assets/js/frontend
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/assets/js/frontend/lecture.js

    r483 r490  
    1         function showModal() {
    2                 console.log('Show modal!');
    3                 $('#alert-services').modal('show');
    4         }
    5        
    6         $('#services-reg').click(function() {
    7                 $('#alert-services').modal('hide');
    8                 $('#alert-services-reg').modal('show');
    9         });
    10         $('#services-sign').click(function() {
    11                 $('#alert-services-reg').modal('hide');
    12                 $('#alert-services-reg-2').modal('show');
    13         })     
    14        
    15         var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
    16         var g_Flash = null;
    17         var g_cbData = "";
    18        
    19         function InitViolet() {
    20           g_Flash = document.getElementById('LectorEditorOnline');
    21           //g_Flash = $('#LectorEditorOnline');
    22           //g_Flash = isInternetExplorer ? LectorEditorOnline : document.LectorEditorOnline;
    23         };
    24        
    25         function GetClipboardItem() {
    26           var cbData = window.clipboardData? window.clipboardData.getData('Text'): g_cbData;
    27           g_Flash.SetVariable("clipboardData", cbData);
    28           g_Flash.SetVariable("command", "Get Text");
    29         };
    30        
    31         function SetClipboardItem(args) {
    32           if (window.clipboardData) window.clipboardData.setData('Text', args);
    33           else g_cbData = args;
    34           g_Flash.SetVariable("command", "Set OK");
    35         };
    36        
    37         function SetWindowTitle(fileName) {
    38           if (fileName == "") document.title = "Violet Online";
    39           else {
    40             var docName = fileName.substring(0, fileName.length - 4);
    41             document.title = "Violet Online - " + docName;
    42           }
    43         };
    44        
    45         function SetWindowState() {
    46           var full = (g_Flash.width == "100%");
    47           g_Flash.width  = full? "800": "100%";
    48           g_Flash.height = full? "580": "100%";
    49         };
    50        
    51         // Handle all the FSCommand messages in a Flash movie.
    52         function LectorEditorOnline_DoFSCommand(command, args) {
    53           switch (command) {
    54             case "Set Title": SetWindowTitle(args); break;
    55             case "Get Clipboard": GetClipboardItem(); break;
    56             case "Set Clipboard": SetClipboardItem(args); break;
    57             case "Set State": SetWindowState(); break;
    58             case "Quit": window.open('','_self').close(); break;
    59             case "trace": alert(args); break;
    60             case "Check License": showModal(); break;
    61           }
    62         };
    63        
    64         // Hook for Internet Explorer.
    65         if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
    66           document.write('<script language=\"VBScript\"\>\n');
    67           document.write('On Error Resume Next\n');
    68           document.write('Sub LectorEditorOnline_FSCommand(ByVal command, ByVal args)\n');
    69           document.write('  Call LectorEditorOnline_DoFSCommand(command, args)\n');
    70           document.write('End Sub\n');
    71           document.write('</script\>\n');
    72         };
    731
    74         $(document).ready(function(){
    75                 InitViolet();
    76         })
     2if (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
     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})
  • pro-violet-viettel/sourcecode/assets/js/frontend/user.js

    r466 r490  
    2121        });
    2222}
     23$( "#package_register" ).submit(function( event )
     24{
     25                $.ajax({
     26                url: $(this).attr("action"),
     27                type: "POST",
     28                data: $("#package_register").serialize(),
     29                success: function (data, textStatus, jqXHR)
     30                {
     31                   
     32                    var results= jQuery.parseJSON(data);
     33                    $('#package_register_modal').replaceWith(results.modal);
     34                    $('#package_register_modal').modal('show');
     35                },
     36                error: function (jqXHR, textStatus, errorThrown)
     37                {
     38                    $(".ajaxloading").hide();
     39                }
     40            });
     41event.preventDefault();
     42});
Note: See TracChangeset for help on using the changeset viewer.