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