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