OSDN Git Service

e463a9688e5f2c232a558357be524ecbe19c6a50
[trpgtools-onweb/AjaxChat.git] / lib / js / main-js.php
1 <?php
2 /*
3  Ajax Chat for TRPG ver.2.6
4  (c)2007-2009 Cake All Rights Reserved.
5  Mail : cake_67@users.sourceforge.jp
6  Home : http://trpgtools-onweb.sourceforge.jp/
7  */
8 /*****************
9  *  JaveScriptライブラリ:チャット画面
10  *****************/
11
12 ?>
13
14 <script type="text/javascript">
15 <!--
16
17 //変数の設定
18 var deleteLastPastLog = '<?php print DELETE_LAST_PASTLOG;?>';
19 var maxNum = '<?php print MAX_NUM;?>';
20 var dateD = (new Date()).getTime();
21 var datetimeFormat = '<?php print DATETIME_FORMAT; ?>';
22 var showDatetime = '<?php print SHOW_DATETIME; ?>';
23 var showDatetimeYear = '<?php print SHOW_DATETIME_YEAR; ?>';
24 var showDatetimeSecond = '<?php print SHOW_DATETIME_SECOND; ?>';
25 var showMobileIcon = '<?php print SHOW_MOBILE_COM;?>';
26 var statusColor = '<?php print STATUS_COLOR; ?>';
27 var logfile = '<?php print RECENT_LOG;?>';
28 var mobileMark = '<?php show_mobile_icon(MOBILE_ICON, '', '', '', 'M', '', ''); ?>';
29 <?php if (USE_SE): ?>
30 var userSeSrc = '<?php print SE_USER; ?>';
31 var systemSeSrc = '<?php print SE_SYSTEM; ?>';
32 var userSeObj = new Image();
33 var systemSeObj = new Image();
34 userSeObj.src = userSeSrc;
35 systemSeObj.src = systemSeSrc;
36 <?php else: ?>
37 var useSe = false;
38 <?php endif; ?>
39
40 // ログイン・ログオフ
41 function login() {
42 <?php if (UNPUBLIC_LAST_PASTLOG): ?>
43     getLog(false);
44 <?php endif; ?>
45 <?php 
46 if (OFFWINDOW_MSG || (UNPUBLIC_LAST_PASTLOG && NO_LAST_PASTLOG_MSG)) {
47     print '    window.parent.document.getElementById("offline_win").style.display = "none";';
48 }
49 ?>
50
51     fontSizeChange("0");
52     lineSpaceChange("0");
53
54     Timer = setInterval('getLog(true)', getdata_on);
55 }
56 function logout() {
57     clearInterval(Timer);
58     Timer = setInterval('getLog(true)', getdata_off);
59 <?php 
60 if (OFFWINDOW_MSG || (UNPUBLIC_LAST_PASTLOG && NO_LAST_PASTLOG_MSG)) {
61     print '    window.parent.document.getElementById("offline_win").style.display = "";';
62 }
63 ?>
64     window.location.reload();
65 }
66 // 起動時の処理
67 $(function()
68 {
69 <?php if (!UNPUBLIC_LAST_PASTLOG): ?>
70     //現在ログの取得
71     getLog(true);
72     Timer = setInterval('getLog(true)', getdata_off);
73     showMember(true);
74 <?php else: ?>
75     $("#main_console").after('<?php print NO_LAST_PASTLOG_MSG; ?>');
76     showMember(false);
77 <?php endif; ?>
78
79     // ウィンドウサイズに合わせる
80     changeSize();
81
82     // 行間ライン変更
83     $('#line_hr').click(function(ev) {
84         var select = $('select#hr option:selected').next().val();
85         if (!select) {
86             select = '<?php print MAIN_BREAK_STYLE_DEFAULT; ?>';
87         }
88         lineSpaceHrChange(select);
89     });
90     $('select#hr').change(function(ev) {
91         var select = lineSpaneHrSelectChange($(':selected').val());
92         lineSpaceHrChange($(':selected').val());
93     });
94
95     // 発言音表示
96     if (useSe) {
97         $("#seConfig").hide();
98         $("#seSelect").hide();
99         if ($("#seSetting").attr("checked")) {
100             $("#seOn").show();
101             $("#seOff").hide();
102         } else {
103             $("#seOn").hide();
104             $("#seOff").show();
105         }
106     }
107 });
108
109 //-->
110 </script>