-17 Removals
+17 Additions

Created by:phpboost

1<script> 1<script>
2<!-- 2<!--
3function shoutbox_add_message() 3function shoutbox_add_message()
4{ 4{
5 var pseudo = jQuery("#shout-pseudo").val(); 5 var pseudo = jQuery("#shout-pseudo").val();
6 var contents = jQuery("#shout-contents").val(); 6 var contents = jQuery("#shout-contents").val();
7 7
8 if (pseudo && contents) 8 if (pseudo && contents)
9 { 9 {
10 jQuery.ajax({ 10 jQuery.ajax({
11 url: '${relative_url(ShoutboxUrlBuilder::ajax_add())}', 11 url: '${relative_url(ShoutboxUrlBuilder::ajax_add())}',
12 type: "post", 12 type: "post",
13 dataType: "json", 13 dataType: "json",
14 data: {'pseudo' : pseudo, 'contents' : contents, 'token' : '{TOKEN}'}, 14 data: {'pseudo' : pseudo, 'contents' : contents, 'token' : '{TOKEN}'},
15 beforeSend: function(){ 15 beforeSend: function(){
16 jQuery('#shoutbox-refresh').html('<i class="fa fa-spin fa-spinner"></i>'); 16 jQuery('#shoutbox-refresh').html('<i class="fa fa-spin fa-spinner"></i>');
17 }, 17 },
18 success: function(returnData){ 18 success: function(returnData){
19 if(returnData.code > 0) { 19 if(returnData.code > 0) {
20 shoutbox_refresh_messages_box(); 20 shoutbox_refresh_messages_box();
21 jQuery('#shout-contents').val(''); 21 jQuery('#shout-contents').val('');
22 } else { 22 } else {
23 switch(returnData.code) 23 switch(returnData.code)
24 { 24 {
25 case -1: 25 case -1:
26 alert(${escapejs(LangLoader::get_message('e_flood', 'errors'))}); 26 alert(${escapejs(LangLoader::get_message('e_flood', 'errors'))});
27 break; 27 break;
28 case -2: 28 case -2:
29 alert("{L_ALERT_LINK_FLOOD}"); 29 alert("{L_ALERT_LINK_FLOOD}");
30 break; 30 break;
31 case -3: 31 case -3:
32 alert(${escapejs(LangLoader::get_message('e_incomplete', 'errors'))}); 32 alert(${escapejs(LangLoader::get_message('e_incomplete', 'errors'))});
33 break; 33 break;
34 case -4: 34 case -4:
35 alert(${escapejs(LangLoader::get_message('error.auth', 'status-messages-common'))}); 35 alert(${escapejs(LangLoader::get_message('error.auth', 'status-messages-common'))});
36 break; 36 break;
37 } 37 }
38 } 38 }
39 jQuery('#shoutbox-refresh').html('<i class="fa fa-refresh"></i>'); 39 jQuery('#shoutbox-refresh').html('<i class="fa fa-refresh"></i>');
40 }, 40 },
41 error: function(e){ 41 error: function(e){
42 alert(${escapejs(LangLoader::get_message('csrf_invalid_token', 'status-messages-common'))}); 42 alert(${escapejs(LangLoader::get_message('csrf_invalid_token', 'status-messages-common'))});
43 } 43 }
44 }); 44 });
45 } else { 45 } else {
46 alert("${LangLoader::get_message('require_text', 'main')}"); 46 alert("${LangLoader::get_message('require_text', 'main')}");
47 return false; 47 return false;
48 } 48 }
49} 49}
50 50
51function shoutbox_delete_message(id_message) 51function shoutbox_delete_message(id_message)
52{ 52{
53 if (confirm(${escapejs(LangLoader::get_message('confirm.delete', 'status-messages-common'))})) 53 if (confirm(${escapejs(LangLoader::get_message('confirm.delete', 'status-messages-common'))}))
54 { 54 {
55 jQuery.ajax({ 55 jQuery.ajax({
56 url: '${relative_url(ShoutboxUrlBuilder::ajax_delete())}', 56 url: '${relative_url(ShoutboxUrlBuilder::ajax_delete())}',
57 type: "post", 57 type: "post",
58 dataType: "json", 58 dataType: "json",
59 data: {'id' : id_message, 'token' : '{TOKEN}'}, 59 data: {'id' : id_message, 'token' : '{TOKEN}'},
60 beforeSend: function(){ 60 beforeSend: function(){
61 jQuery('#shoutbox-refresh').html('<i class="fa fa-spin fa-spinner"></i>'); 61 jQuery('#shoutbox-refresh').html('<i class="fa fa-spin fa-spinner"></i>');
62 }, 62 },
63 success: function(returnData){ 63 success: function(returnData){
64 var code = returnData.code; 64 var code = returnData.code;
65 65
66 if(code > 0) { 66 if(code > 0) {
67 jQuery('#shoutbox-message-' + code).remove(); 67 jQuery('#shoutbox-message-' + code).remove();
68 } else { 68 } else {
69 alert("{@error.message.delete}"); 69 alert("{@error.message.delete}");
70 } 70 }
71 jQuery('#shoutbox-refresh').html('<i class="fa fa-refresh"></i>'); 71 jQuery('#shoutbox-refresh').html('<i class="fa fa-refresh"></i>');
72 }, 72 },
73 error: function(e){ 73 error: function(e){
74 alert(${escapejs(LangLoader::get_message('csrf_invalid_token', 'status-messages-common'))}); 74 alert(${escapejs(LangLoader::get_message('csrf_invalid_token', 'status-messages-common'))});
75 } 75 }
76 }); 76 });
77 } 77 }
78} 78}
79 79
80function shoutbox_refresh_messages_box() { 80function shoutbox_refresh_messages_box() {
81 jQuery.ajax({ 81 jQuery.ajax({
82 url: '${relative_url(ShoutboxUrlBuilder::ajax_refresh())}', 82 url: '${relative_url(ShoutboxUrlBuilder::ajax_refresh())}',
83 type: "post", 83 type: "post",
84 dataType: "json", 84 dataType: "json",
85 data: {'token' : '{TOKEN}'}, 85 data: {'token' : '{TOKEN}'},
86 beforeSend: function(){ 86 beforeSend: function(){
87 jQuery('#shoutbox-refresh').html('<i class="fa fa-spin fa-spinner"></i>'); 87 jQuery('#shoutbox-refresh').html('<i class="fa fa-spin fa-spinner"></i>');
88 }, 88 },
89 success: function(returnData){ 89 success: function(returnData){
90 jQuery('#shoutbox-messages-container').html(returnData); 90 jQuery('#shoutbox-messages-container').html(returnData);
91 91
92 jQuery('#shoutbox-refresh').html('<i class="fa fa-refresh"></i>'); 92 jQuery('#shoutbox-refresh').html('<i class="fa fa-refresh"></i>');
93 }, 93 },
94 error: function(e){ 94 error: function(e){
95 jQuery('#shoutbox-messages-container').html(e.responseText); 95 jQuery('#shoutbox-messages-container').html(e.responseText);
96 96
97 jQuery('#shoutbox-refresh').html('<i class="fa fa-refresh"></i>'); 97 jQuery('#shoutbox-refresh').html('<i class="fa fa-refresh"></i>');
98 } 98 }
99 }); 99 });
100} 100}
101 101
102# IF C_AUTOMATIC_REFRESH_ENABLED #setInterval(shoutbox_refresh_messages_box, {SHOUT_REFRESH_DELAY});# ENDIF # 102# IF C_AUTOMATIC_REFRESH_ENABLED #setInterval(shoutbox_refresh_messages_box, {SHOUT_REFRESH_DELAY});# ENDIF #
103--> 103-->
104</script> 104</script>
105# IF C_DISPLAY_SHOUT_BBCODE #<script src="{PATH_TO_ROOT}/BBCode/templates/js/bbcode.js"></script># ENDIF # 105# IF C_DISPLAY_SHOUT_BBCODE #<script src="{PATH_TO_ROOT}/BBCode/templates/js/bbcode.js"></script># ENDIF #
106 106
107<div id="shoutbox-messages-container"# IF C_HORIZONTAL # class="shout-horizontal" # ENDIF #># INCLUDE SHOUTBOX_MESSAGES #</div> 107<div id="shoutbox-messages-container"# IF C_HORIZONTAL # class="shout-horizontal" # ENDIF #># INCLUDE SHOUTBOX_MESSAGES #</div>
108# IF C_DISPLAY_FORM # 108# IF C_DISPLAY_FORM #
109<form action="#" method="post"> 109<form action="#" method="post">
110 <div class="shout-form-container shout-pseudo-container"> 110 <div class="shout-form-container shout-pseudo-container">
111 # IF NOT C_MEMBER # 111 # IF NOT C_MEMBER #
112 <label for="shout-pseudo"><span class="small">${LangLoader::get_message('form.name', 'common')}</span></label> 112 <label for="shout-pseudo"><span class="small">${LangLoader::get_message('form.name', 'common')}</span></label>
113 <input maxlength="25" type="text" name="shout-pseudo" id="shout-pseudo" class="shout-pseudo not-connected" value=" ${LangLoader::get_message('visitor', 'user-common')}"> 113 <input maxlength="25" type="text" name="shout-pseudo" id="shout-pseudo" class="shout-pseudo not-connected" value=" ${LangLoader::get_message('visitor', 'user-common')}">
114 # ELSE # 114 # ELSE #
115 <input type="hidden" name="shout-pseudo" id="shout-pseudo" class="shout-pseudo connected" value="{SHOUTBOX_PSEUDO}"> 115 <input type="hidden" name="shout-pseudo" id="shout-pseudo" class="shout-pseudo connected" value="{SHOUTBOX_PSEUDO}">
116 # ENDIF # 116 # ENDIF #
117 </div> 117 </div>
118 <div class="shout-form-container shout-contents-container"> 118 <div class="shout-form-container shout-contents-container">
119 <label for="shout-contents"><span class="small">${LangLoader::get_message('message', 'main')}</span></label> 119 <label for="shout-contents"><span class="small">${LangLoader::get_message('message', 'main')}</span></label>
120 <textarea id="shout-contents" name="shout-contents"# IF C_VALIDATE_ONKEYPRESS_ENTER # onkeypress="if(event.keyCode==13){shoutbox_add_message();}"# ENDIF # rows="2" cols="16"></textarea> 120 <textarea id="shout-contents" name="shout-contents"# IF C_VALIDATE_ONKEYPRESS_ENTER # onkeypress="if(event.keyCode==13){shoutbox_add_message();}"# ENDIF # rows="2" cols="16"></textarea>
121 </div> 121 </div>
122 <div id="shoutbox-bbcode-container" class="shout-spacing"> 122 <div id="shoutbox-bbcode-container" class="shout-spacing">
123 # IF C_DISPLAY_SHOUT_BBCODE # 123 # IF C_DISPLAY_SHOUT_BBCODE #
124 <ul> 124 <ul>
125 <li class="bbcode-elements"> 125 <li class="bbcode-elements">
126 <a href="javascript:bb_display_block('1', 'shout-contents');" onmouseover="bb_hide_block('1', 'shout-contents', 1);" onmouseout="bb_hide_block('1', 'shout-contents', 0);" class="fa bbcode-icon-smileys" title="${LangLoader::get_message('bb_smileys', 'common', 'BBCode')}"></a> 126 <a href="javascript:bb_display_block('1', 'shout-contents');" onmouseover="bb_hide_block('1', 'shout-contents', 1);" onmouseout="bb_hide_block('1', 'shout-contents', 0);"> <i class="fa fa-fw bbcode-icon-smileys" aria-hidden="true"></i><span class="sr-only">${LangLoader::get_message('bb_smileys', 'common', 'BBCode')}</span></a>
127 <div class="bbcode-block-container" style="display: none;" id="bb-block1shout-contents"> 127 <div class="bbcode-block-container" style="display: none;" id="bb-block1shout-contents">
128 <ul class="bbcode-block block-smileys" onmouseover="bb_hide_block('1', 'shout-contents', 1);" onmouseout="bb_hide_block('1', 'shout-contents', 0);"> 128 <ul class="bbcode-block block-smileys" onmouseover="bb_hide_block('1', 'shout-contents', 1);" onmouseout="bb_hide_block('1', 'shout-contents', 0);">
129 # START smileys # 129 # START smileys #
130 <li> 130 <li>
131 <a href="" onclick="insertbbcode('{smileys.CODE}', 'smile', 'shout-contents');return false;" class="bbcode-hover" title="{smileys.CODE}"><img src="{smileys.URL}" alt="{smileys.CODE}"></a> 131 <a href="" onclick="insertbbcode('{smileys.CODE}', 'smile', 'shout-contents');return false;" class="bbcode-hover" title="{smileys.CODE}"><img src="{smileys.URL}" alt="{smileys.CODE}" /></a>
132 </li> 132 </li>
133 # END smileys # 133 # END smileys #
134 </ul> 134 </ul>
135 </div> 135 </div>
136 </li> 136 </li>
137 <li class="bbcode-elements"> 137 <li class="bbcode-elements">
138 <a href="" class="fa bbcode-icon-bold# IF C_BOLD_DISABLED # icon-disabled# ENDIF #" onclick="# IF NOT C_BOLD_DISABLED #insertbbcode('[b]', '[/b]', 'shout-contents');# ENDIF #return false;" title="${LangLoader::get_message('bb_bold', 'common', 'BBCode')}"></a> 138 <a href="" onclick="# IF NOT C_BOLD_DISABLED #insertbbcode('[b]', '[/b]', 'shout-contents');# ENDIF #return false;" aria-label="${LangLoader::get_message('bb_bold', 'common', 'BBCode')}"><i class="fa fa-fw bbcode-icon-bold# IF C_BOLD_DISABLED # icon-disabled# ENDIF #" aria-hidden="true" title="${LangLoader::get_message('bb_bold', 'common', 'BBCode')}"></i></a>
139 </li> 139 </li>
140 <li class="bbcode-elements"> 140 <li class="bbcode-elements">
141 <a href="" class="fa bbcode-icon-italic# IF C_ITALIC_DISABLED # icon-disabled# ENDIF #" onclick="# IF NOT C_ITALIC_DISABLED #insertbbcode('[i]', '[/i]', 'shout-contents');# ENDIF #return false;" title="${LangLoader::get_message('bb_italic', 'common', 'BBCode')}"></a> 141 <a href="" onclick="# IF NOT C_ITALIC_DISABLED #insertbbcode('[i]', '[/i]', 'shout-contents');# ENDIF #return false;" aria-label="${LangLoader::get_message('bb_italic', 'common', 'BBCode')}"><i class="fa fa-fw bbcode-icon-italic# IF C_ITALIC_DISABLED # icon-disabled# ENDIF #" aria-hidden="true" title="${LangLoader::get_message('bb_italic', 'common', 'BBCode')}"></i></a>
142 </li> 142 </li>
143 <li class="bbcode-elements"> 143 <li class="bbcode-elements">
144 <a href="" class="fa bbcode-icon-underline# IF C_UNDERLINE_DISABLED # icon-disabled# ENDIF #" onclick="# IF NOT C_UNDERLINE_DISABLED #insertbbcode('[u]', '[/u]', 'shout-contents');# ENDIF #return false;" title="${LangLoader::get_message('bb_underline', 'common', 'BBCode')}"></a> 144 <a href="" onclick="# IF NOT C_UNDERLINE_DISABLED #insertbbcode('[u]', '[/u]', 'shout-contents');# ENDIF #return false;" aria-label="${LangLoader::get_message('bb_underline', 'common', 'BBCode')}"><i class="fa fa-fw bbcode-icon-underline# IF C_UNDERLINE_DISABLED # icon-disabled# ENDIF #" aria-hidden="true" title="${LangLoader::get_message('bb_underline', 'common', 'BBCode')}"></i></a>
145 </li> 145 </li>
146 <li class="bbcode-elements"> 146 <li class="bbcode-elements">
147 <a href="" class="fa bbcode-icon-strike# IF C_STRIKE_DISABLED # icon-disabled# ENDIF #" onclick="# IF NOT C_STRIKE_DISABLED #insertbbcode('[s]', '[/s]', 'shout-contents');# ENDIF #return false;" title="${LangLoader::get_message('bb_strike', 'common', 'BBCode')}"></a> 147 <a href="" onclick="# IF NOT C_STRIKE_DISABLED #insertbbcode('[s]', '[/s]', 'shout-contents');# ENDIF #return false;" aria-label="${LangLoader::get_message('bb_strike', 'common', 'BBCode')}"><i class="fa fa-fw bbcode-icon-strike# IF C_STRIKE_DISABLED # icon-disabled# ENDIF #" aria-hidden="true" title="${LangLoader::get_message('bb_strike', 'common', 'BBCode')}"></i></a>
148 </li> 148 </li>
149 </ul> 149 </ul>
150 # ENDIF # 150 # ENDIF #
151 </div> 151 </div>
152 <p class="shout-spacing"> 152 <p class="shout-spacing">
153 <button onclick="shoutbox_add_message();" type="button">${LangLoader::get_message('submit', 'main')}</button> 153 <button onclick="shoutbox_add_message();" type="button">${LangLoader::get_message('submit', 'main')}</button>
154 <input type="hidden" name="token" value="{TOKEN}"> 154 <input type="hidden" name="token" value="{TOKEN}">
155 <a href="" onclick="shoutbox_refresh_messages_box();return false;" id="shoutbox-refresh" title="${LangLoader::get_message('refresh', 'main')}"><i class="fa fa-refresh"></i></a> 155 <a href="" onclick="shoutbox_refresh_messages_box();return false;" id="shoutbox-refresh" aria-label="${LangLoader::get_message('refresh', 'main')}"><i class="fa fa-refresh" aria-hidden="true" title="${LangLoader::get_message('refresh', 'main')}"></i></a>
156 </p> 156 </p>
157</form> 157</form>
158# ELSE # 158# ELSE #
159 # IF C_DISPLAY_NO_WRITE_AUTHORIZATION_MESSAGE # 159 # IF C_DISPLAY_NO_WRITE_AUTHORIZATION_MESSAGE #
160 <div class="spacer"></div> 160 <div class="spacer"></div>
161 <span class="warning">{@error.post.unauthorized}</span> 161 <span class="message-helper warning">{@error.post.unauthorized}</span>
162 <p class="shout-spacing"> 162 <p class="shout-spacing">
163 <a href="" onclick="shoutbox_refresh_messages_box();return false;" id="shoutbox-refresh" title="${LangLoader::get_message('refresh', 'main')}"><i class="fa fa-refresh"></i></a> 163 <a href="" onclick="shoutbox_refresh_messages_box();return false;" id="shoutbox-refresh" aria-label="${LangLoader::get_message('refresh', 'main')}"><i class="fa fa-refresh" aria-hidden="true" title="${LangLoader::get_message('refresh', 'main')}"></i></a>
164 </p> 164 </p>
165 # ENDIF # 165 # ENDIF #
166# ENDIF # 166# ENDIF #
167<a class="small" href="${relative_url(ShoutboxUrlBuilder::home())}" title="{@archives.link}">{@archives}</a> 167<a class="small" href="${relative_url(ShoutboxUrlBuilder::home())}" title="{@archives.link}">{@archives}</a>
Editor
Original Text
Changed Text
Recommended videos