[490] | 1 | if (licenseAvailable == "!OK")
|
---|
| 2 | {
|
---|
[654] | 3 | $('#alert-services').modal('show');
|
---|
[553] | 4 | if (first_visit == '1') {
|
---|
[654] | 5 | $('#alert-services').modal('show');
|
---|
[490] | 6 | }
|
---|
| 7 | }
|
---|
[654] | 8 | if (first_visit == '1') {
|
---|
[661] | 9 |
|
---|
[662] | 10 | if (p_period == -1)
|
---|
[654] | 11 | {
|
---|
[661] | 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")
|
---|
[654] | 23 | {
|
---|
[661] | 24 | $('#update_user_info').modal({backdrop: 'static'});
|
---|
[654] | 25 | }
|
---|
| 26 | }
|
---|
[661] | 27 |
|
---|
[654] | 28 | }
|
---|
[490] | 29 |
|
---|
[654] | 30 |
|
---|
[580] | 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 | {
|
---|
[654] | 42 | $('#update_user_info').modal('hide');
|
---|
[661] | 43 |
|
---|
[580] | 44 | }
|
---|
| 45 | else
|
---|
| 46 | {
|
---|
| 47 | for (var key in result.errors)
|
---|
| 48 | {
|
---|
[654] | 49 | $("#" + result.errors[key]['field'] + ".error").html(result.errors[key]['content']);
|
---|
| 50 |
|
---|
[580] | 51 | }
|
---|
| 52 | }
|
---|
| 53 | }
|
---|
| 54 | });
|
---|
| 55 | });
|
---|
[661] | 56 |
|
---|
[490] | 57 | function showModal() {
|
---|
| 58 | console.log('Show modal!');
|
---|
[659] | 59 | $('#alert-services-package').modal('show');
|
---|
[490] | 60 | }
|
---|
| 61 |
|
---|
| 62 | $('#services-reg').click(function () {
|
---|
[654] | 63 | $('#alert-services').modal('hide');
|
---|
| 64 | window.location = url + "frontend/user/profile#services-register";
|
---|
[490] | 65 | });
|
---|
[555] | 66 |
|
---|
| 67 | $('#save-package').click(function () {
|
---|
[654] | 68 | DoSaveLecture();
|
---|
[555] | 69 | });
|
---|
| 70 |
|
---|
[490] | 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 |
|
---|
[654] | 120 | function DoSaveLecture() {
|
---|
| 121 | g_Flash.SetVariable("command", "Press Save");
|
---|
[555] | 122 | }
|
---|
| 123 |
|
---|
[654] | 124 | function DoOpenLecture(filename) {
|
---|
| 125 | g_Flash.SetVariable("openedFileName", filename);
|
---|
| 126 | g_Flash.SetVariable("command", "Open File");
|
---|
[650] | 127 | }
|
---|
| 128 |
|
---|
[490] | 129 | // Handle all the FSCommand messages in a Flash movie.
|
---|
| 130 | function LectorEditorOnline_DoFSCommand(command, args) {
|
---|
| 131 | switch (command) {
|
---|
| 132 | case "Set Title":
|
---|
| 133 | SetWindowTitle(args);
|
---|
| 134 | break;
|
---|
| 135 | case "Get Clipboard":
|
---|
| 136 | GetClipboardItem();
|
---|
| 137 | break;
|
---|
| 138 | case "Set Clipboard":
|
---|
| 139 | SetClipboardItem(args);
|
---|
| 140 | break;
|
---|
| 141 | case "Set State":
|
---|
[631] | 142 | //SetWindowState();
|
---|
[490] | 143 | break;
|
---|
| 144 | case "Quit":
|
---|
| 145 | window.open('', '_self').close();
|
---|
| 146 | break;
|
---|
| 147 | case "trace":
|
---|
| 148 | alert(args);
|
---|
| 149 | break;
|
---|
| 150 | case "Check License":
|
---|
| 151 | showModal();
|
---|
| 152 | break;
|
---|
| 153 | }
|
---|
| 154 | }
|
---|
| 155 | ;
|
---|
| 156 |
|
---|
| 157 | // Hook for Internet Explorer.
|
---|
| 158 | if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
|
---|
| 159 | document.write('<script language=\"VBScript\"\>\n');
|
---|
| 160 | document.write('On Error Resume Next\n');
|
---|
| 161 | document.write('Sub LectorEditorOnline_FSCommand(ByVal command, ByVal args)\n');
|
---|
| 162 | document.write(' Call LectorEditorOnline_DoFSCommand(command, args)\n');
|
---|
| 163 | document.write('End Sub\n');
|
---|
| 164 | document.write('</script\>\n');
|
---|
| 165 | }
|
---|
| 166 | ;
|
---|
| 167 |
|
---|
[650] | 168 |
|
---|
[490] | 169 | $(document).ready(function () {
|
---|
[654] | 170 | InitViolet();
|
---|
[650] | 171 | //$('#open-lecture').click(function(e){DoOpenLecture('http://sbgapi.violet.vn/space/file/id/7');});
|
---|
[654] | 172 |
|
---|
[490] | 173 | }) |
---|