source: pro-violet-viettel/sourcecode/application/modules/frontend/views/flashscript.php @ 539

Last change on this file since 539 was 483, checked in by dungnv, 11 years ago
File size: 2.3 KB
Line 
1<script type="text/javascript" language="JavaScript">
2<!--//
3
4var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
5var g_Flash = null;
6var g_cbData = "";
7
8function InitViolet() {
9  console.log('onload');
10  g_Flash = document.getElementById('LectorEditorOnline');
11  //g_Flash = isInternetExplorer ? LectorEditorOnline : document.LectorEditorOnline;
12
13  console.log(LectorEditorOnline);
14}
15
16function GetClipboardItem() {
17  var cbData = window.clipboardData? window.clipboardData.getData('Text'): g_cbData;
18  g_Flash.SetVariable("clipboardData", cbData);
19  g_Flash.SetVariable("command", "Get Text");
20}
21
22function SetClipboardItem(args) {
23  if (window.clipboardData) window.clipboardData.setData('Text', args);
24  else g_cbData = args;
25  g_Flash.SetVariable("command", "Set OK");
26}
27
28function SetWindowTitle(fileName) {
29  if (fileName == "") document.title = "Violet Online";
30  else {
31    var docName = fileName.substring(0, fileName.length - 4);
32    document.title = "Violet Online - " + docName;
33  }
34}
35
36function SetWindowState() {
37  var full = (g_Flash.width == "100%");
38  g_Flash.width  = full? "800": "100%";
39  g_Flash.height = full? "580": "100%";
40}
41
42// Handle all the FSCommand messages in a Flash movie.
43function LectorEditorOnline_DoFSCommand(command, args) {
44
45  switch (command) {
46    case "Set Title": SetWindowTitle(args); break;
47    case "Get Clipboard": GetClipboardItem(); break;
48    case "Set Clipboard": SetClipboardItem(args); break;
49    case "Set State": SetWindowState(); break;
50    case "Quit": window.open('','_self').close(); break;
51    case "trace": alert(args); break;
52    case "Check License": alert('Bạn chưa đăng kÜ sá»­ dụng dịch vụ!'); break;
53  }
54}
55
56// Hook for Internet Explorer.
57if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
58  document.write('<script language=\"VBScript\"\>\n');
59  document.write('On Error Resume Next\n');
60  document.write('Sub LectorEditorOnline_FSCommand(ByVal command, ByVal args)\n');
61  document.write('  Call LectorEditorOnline_DoFSCommand(command, args)\n');
62  document.write('End Sub\n');
63  document.write('</script\>\n');
64}
65
66//-->
67</script>
Note: See TracBrowser for help on using the repository browser.