Mercurial Hosting > nabble
comparison src/nabble/modules/naml/mobile.naml @ 0:7ecd1a4ef557
add content
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 21 Mar 2019 19:15:52 -0600 |
parents | |
children | 18cf4872fd7f |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:7ecd1a4ef557 |
---|---|
1 <namespace name="mobile"/> | |
2 | |
3 <macro name="html5" parameters="head,body"> | |
4 <n.html5_impl> | |
5 <head> | |
6 <n.head/> | |
7 </head> | |
8 <body> | |
9 <n.html5_top_bar/> | |
10 <n.body/> | |
11 <n.html5_nabble_footer/> | |
12 </body> | |
13 </n.html5_impl> | |
14 </macro> | |
15 | |
16 <macro name="html5_impl" parameters="head,body" requires="servlet"> | |
17 <n.page_start/> | |
18 <n.nabble_html> | |
19 <do> | |
20 <n.put_in_head.head/> | |
21 <n.body/> | |
22 <n.load_call_later_script/> | |
23 </do> | |
24 <output> | |
25 <![CDATA[<!DOCTYPE html>]]> | |
26 <html> | |
27 <head> | |
28 <![CDATA[<meta charset="utf-8"> | |
29 <meta name="viewport" content="width=device-width, initial-scale=1.0">]]> | |
30 <n.html5_stylesheets/> | |
31 <n.html5_javascript_libraries/> | |
32 <n.html_head_content/> | |
33 </head> | |
34 <body> | |
35 <div class="nabble macro_[n.page_template/]" id="nabble"> | |
36 <n.apply_filters.html_body_content/> | |
37 </div> | |
38 <n.bottom_scripts/> | |
39 <n.as_html_comments.site_information/> | |
40 </body> | |
41 </html> | |
42 </output> | |
43 </n.nabble_html> | |
44 </macro> | |
45 | |
46 <override_macro name="nabble_shared_scripts"> | |
47 <n.overridden/> | |
48 <script> | |
49 (function(a){(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))})(navigator.userAgent||navigator.vendor||window.opera); | |
50 | |
51 $(document).ready(function() { | |
52 if (jQuery.browser.mobile) { | |
53 $('a').each(function(){ | |
54 var href = $(this).attr('href'); | |
55 if (href.indexOf('/template/NamlServlet.jtp?macro=new_topic&') >= 0) { | |
56 $(this).attr('href',href.replace(/=new_topic&/, '=new_topic5&')).attr('target','top'); | |
57 } else if (href.indexOf('/template/NamlServlet.jtp?macro=reply&') >= 0) { | |
58 $(this).attr('href',href.replace(/=reply&/, '=reply5&')).attr('target','top');; | |
59 } | |
60 }); | |
61 } | |
62 }); | |
63 </script> | |
64 </override_macro> | |
65 | |
66 <macro name="html5_stylesheets"> | |
67 <link rel="stylesheet" href="/assets/bootstrap/css/bootstrap.min.css"/> | |
68 <style>body {background:transparent}</style> | |
69 <link rel="stylesheet" href="/nabble.css?v=[n.css_version/]" type="text/css" /> | |
70 <link rel="stylesheet" href="/template/NamlServlet.jtp?macro=site_style" type="text/css" /> | |
71 </macro> | |
72 | |
73 <macro name="html5_javascript_libraries"> | |
74 <script src="/assets/jquery/jquery-1.9.1.min.js"></script> | |
75 <script src="/assets/bootstrap/js/bootstrap.min.js"></script> | |
76 <script src="[n.html5_js_path/]" type="text/javascript"></script> | |
77 </macro> | |
78 | |
79 <macro name="html5_top_bar"> | |
80 <div class="top-bar"> | |
81 <div class="breadcrumbs pull-left"> | |
82 <n.breadcrumbs/> | |
83 </div> | |
84 <div class="pull-right"> | |
85 <n.html5_user_header/> | |
86 </div> | |
87 </div> | |
88 </macro> | |
89 | |
90 <macro name="html5_nabble_footer"> | |
91 <n.nabble_footer/> | |
92 </macro> | |
93 | |
94 <macro name="html5_user_header"> | |
95 <span style="white-space:nowrap;" id="nabble-user-header"></span> | |
96 <script type="text/javascript">Nabble.userHeader();</script> | |
97 </macro> | |
98 | |
99 <macro name="html5_js"> | |
100 var NabbleDropdown = {}; | |
101 <n.javascript_library/> | |
102 <n.html5_js_fix/> | |
103 </macro> | |
104 | |
105 <macro name="html5_js_fix"> | |
106 Nabble.userDropdown = function() { | |
107 var $t = $('#user-dd'); | |
108 if ($t.size() == 0) | |
109 return; | |
110 $t.empty(); | |
111 var elem = '<div class="dropdown user-menu">'; | |
112 elem += '<a class="dropdown-toggle" data-toggle="dropdown" href="javascript:void(0)">'+Nabble.escapeHTML(Nabble.username)+' <img src="/images/more.png" width="10" height="10"/></a>'; | |
113 elem += '<ul class="dropdown-menu light-bg-color" role="menu" aria-labelledby="dLabel" style="right:0;left:auto">'; | |
114 elem += '<li><a tabindex="-1" href="/template/NamlServlet.jtp?macro=user_nodes&user='+Nabble.userId+'">'+t_my_posts+'</a></li>'; | |
115 elem += '<li><a tabindex="-1" href="'+user_profile_path+'">'+t_account_settings+'</a></li>'; | |
116 elem += '<li><a tabindex="-1" href="javascript: void Nabble.logout()">'+t_logout+'</a></li>'; | |
117 elem += '</ul></div>'; | |
118 $t.html(elem); | |
119 }; | |
120 </macro> | |
121 | |
122 <macro name="html5_js_path"> | |
123 <n.encode_url.> | |
124 /template/NamlServlet.jtp?macro=html5_js&v=<n.javascript_version/> | |
125 </n.encode_url.> | |
126 </macro> | |
127 | |
128 <macro name="new_post5" parameters="page_name,mailing_list_etiquette,bottom,focus" requires="servlet"> | |
129 <n.mobile.> | |
130 <n.node_page.> | |
131 <n.handle_new_node_permission_error/> | |
132 <n.if.not.is_submitted_form> | |
133 <then> | |
134 <n.subject_field.set_value value="[n.page_node.default_reply_subject/]" /> | |
135 <n.alert_field.set_value value="[n.page_node.alert_default_value/]" /> | |
136 <n.init_new_post_custom_fields/> | |
137 </then> | |
138 <else> | |
139 <n.catch_exception. id="save-block"> | |
140 <n.handle_anonymous_submit/> | |
141 <n.check_antispam_submit bypass="preview"/> | |
142 <n.check_recent_post_limit/> | |
143 <n.create_child_of_page_node commit="[n.not.is_preview/]"> | |
144 <subject><n.subject_field.value/></subject> | |
145 <message><n.message_field.value/></message> | |
146 <is_html><n.html_format_field.value/></is_html> | |
147 <type><n.type_field.value/></type> | |
148 <kind>post</kind> | |
149 <do> | |
150 <n.remember_new_node/> | |
151 <n.if.not.is_preview> | |
152 <then> | |
153 <n.save_post/> | |
154 <n.save_new_post_custom_fields/> | |
155 <n.new_node.send_node_as_email/> | |
156 </then> | |
157 </n.if.not.is_preview> | |
158 </do> | |
159 </n.create_child_of_page_node> | |
160 <n.if.not.is_preview> | |
161 <then> | |
162 <n.new_node.save_alert_field/> | |
163 <n.redirect_to.new_node.url/> | |
164 </then> | |
165 </n.if.not.is_preview> | |
166 </n.catch_exception.> | |
167 </else> | |
168 </n.if.not.is_submitted_form> | |
169 <n.html5> | |
170 <head> | |
171 <META NAME="robots" CONTENT="noindex,nofollow"/> | |
172 <n.title.><n.page_name/></n.title.> | |
173 <n.focus/> | |
174 <style> | |
175 .title-row { | |
176 padding:.6em .8em; | |
177 font-weight:bold; | |
178 } | |
179 div.field-title { margin-top: 0; } | |
180 label { display:inline;vertical-align:-15%; } | |
181 #subject { width:90% } | |
182 </style> | |
183 </head> | |
184 <body> | |
185 <n.edit_header first_text="[n.page_name/]" second_text="[n.truncate. size='80'][n.page_node.subject/][/n.truncate.]" /> | |
186 | |
187 <n.if.is_submitted_form> | |
188 <then> | |
189 <n.if.has_exception for="save-block"> | |
190 <then.show_new_node_error/> | |
191 <else> | |
192 <n.if.is_preview> | |
193 <then.new_node.preview/> | |
194 </n.if.is_preview> | |
195 </else> | |
196 </n.if.has_exception> | |
197 </then> | |
198 </n.if.is_submitted_form> | |
199 | |
200 <n.subscription_reminder/> | |
201 | |
202 <n.form. onsubmit="return singleSubmit(this)"> | |
203 <n.type_field.hidden/> | |
204 <n.mailing_list_notice.mailing_list_etiquette/> | |
205 | |
206 <n.reply_form /> | |
207 | |
208 <div style="margin-top:1em"> | |
209 <n.antispam_submit_button class="toolbar action-button" value="[t]Post Message[/t]"/> | |
210 <input type="submit" class="toolbar action-button" name="preview" value="[t]Preview Message[/t]"/> | |
211 <t>or</t> | |
212 <a href="[n.page_node.url /]"><t>Cancel</t></a> | |
213 </div> | |
214 </n.form.> | |
215 | |
216 <n.hide_null.bottom/> | |
217 </body> | |
218 </n.html5> | |
219 </n.node_page.> | |
220 </n.mobile.> | |
221 </macro> | |
222 | |
223 <macro name="reply5" requires="servlet"> | |
224 <n.new_post5> | |
225 <page_name> | |
226 <t>Reply</t> | |
227 </page_name> | |
228 <focus> | |
229 <n.message_field.focus/> | |
230 </focus> | |
231 <mailing_list_etiquette> | |
232 <li><t>Quote what you reply to and trim it to only the relevant parts. This provides context for those who will read your message by email.</t></li> | |
233 <li><t>Avoid small talk such as "Thank you", "Great"... You can <n.page_node.reply_to_author_link.>send a private email</n.page_node.reply_to_author_link.> if you want.</t></li> | |
234 </mailing_list_etiquette> | |
235 <bottom> | |
236 <n.in_reply_to/> | |
237 </bottom> | |
238 </n.new_post5> | |
239 </macro> | |
240 | |
241 <macro name="editor_toolbar" parameters="textarea_id, original_text, node_id" requires="mobile"> | |
242 <n.put_in_head.> | |
243 <n.editor_stylesheet/> | |
244 <style> | |
245 .nabble div.toolbar { min-width: auto; max-width: none; } | |
246 </style> | |
247 <n.editor_shared_scripts textarea_id="[n.textarea_id/]" node_id="[n.node_id/]"/> | |
248 <script> | |
249 <![CDATA[ | |
250 $.browser = $.browser || {}; | |
251 | |
252 $(document).ready(function() { | |
253 $('div.toolbar').removeClass('shaded-bg-color'); | |
254 $('#message').removeAttr('style').css({width:'90%'}).attr('rows',15); | |
255 | |
256 $('div.toolbar button').each(function() { | |
257 var $btn = $(this); | |
258 if ($btn.text().length > 0) { | |
259 var img = $btn.html(); | |
260 $btn.html(img.match(/<img[^>]+>/)); | |
261 $btn.css('width','2.5em'); | |
262 } | |
263 }); | |
264 }); | |
265 ]]> | |
266 </script> | |
267 </n.put_in_head.> | |
268 | |
269 <div class="toolbar rounded-top shaded-bg-color"> | |
270 <table class="toobar"> | |
271 <tr> | |
272 <n.editor_quote_button original_text="[n.original_text/]"/> | |
273 <n.editor_insert_image_button/> | |
274 <n.editor_bold_button/> | |
275 <n.editor_italic_button/> | |
276 <n.editor_link_button/> | |
277 <n.editor_file_button/> | |
278 <n.editor_smiley_button/> | |
279 </tr> | |
280 </table> | |
281 </div> | |
282 </macro> | |
283 | |
284 <macro name="editor_file_button"> | |
285 <n.put_in_head.> | |
286 <script type="text/javascript"> | |
287 <![CDATA[ | |
288 Nabble.uploadFile = function() { | |
289 Nabble.closeWindows(); | |
290 var $fileDiv = $('#file-upload'); | |
291 var isOpen = $fileDiv.css("display") != 'none'; | |
292 var alreadyLoaded = window.fileuploader && $('#file-upload-form', window.fileuploader.document).size() == 1; | |
293 if (isOpen) | |
294 return; | |
295 else if (alreadyLoaded) | |
296 $fileDiv.show(); | |
297 else { | |
298 var f = ''; | |
299 if ($.browser && $.browser.msie) | |
300 f += '<br style="line-height:1px"/>'; | |
301 f += "<iframe id='fileuploader' name='fileuploader' src='/forum/UploadFile.jtp?node=" + nodeId + "' width='380' height='100' frameBorder='0' scrolling='no' allowtransparency='true'>"; | |
302 $fileDiv.html(f).show(); | |
303 } | |
304 }; | |
305 Nabble.uploadedFile = function(name) { | |
306 var textarea = Nabble.get(textareaID); | |
307 this.setSelection( textarea, '<nabble_a href="'+name+'">'+name+'</nabble_a>' ); | |
308 textarea.focus(); | |
309 Nabble.closeWindows(); | |
310 }; | |
311 ]]> | |
312 </script> | |
313 </n.put_in_head.> | |
314 <td class="nowrap has-dropdown"> | |
315 <div id="file-upload" class="editor-dropdown file-upload medium-border-color light-bg-color drop-shadow"></div> | |
316 <button type="button" onclick="Nabble.uploadFile()" class="toolbar file-upload" title="[t]Upload a file[/t]"> | |
317 <img src="/images/paperclip.png" border="0" height="12" alt="File" style="vertical-align:middle"/> | |
318 </button> | |
319 <n.tooltip use_title="true"/> | |
320 </td> | |
321 </macro> | |
322 | |
323 <macro name="new_topic5" requires="servlet"> | |
324 <n.new_post5> | |
325 <page_name> | |
326 <t>Post New Message</t> | |
327 </page_name> | |
328 <focus> | |
329 <n.subject_field.focus/> | |
330 </focus> | |
331 <mailing_list_etiquette> | |
332 <li><t>If you are posting a question, please try search first. Your question may have already been answered.</t></li> | |
333 <li><t>Don't post repeatedly. Wait for a few days. People will read your post by email.</t></li> | |
334 </mailing_list_etiquette> | |
335 </n.new_post5> | |
336 </macro> |