Mercurial Hosting > nabble
diff src/nabble/modules/naml/social_dropdown_links.naml @ 0:7ecd1a4ef557
add content
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 21 Mar 2019 19:15:52 -0600 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/nabble/modules/naml/social_dropdown_links.naml Thu Mar 21 19:15:52 2019 -0600 @@ -0,0 +1,111 @@ +<override_macro name="post_dropdown" requires="node"> + <n.dropdown. + id="postdropdown[n.id/]" + text="[t]More[/t]" + title="[t]Click for more options[/t]" + loadOnClick="/template/NamlServlet.jtp?macro=post_dropdown_later&node=[n.id/]" + > + <n.menu_reply_to_author/> + <n.menu_edit_post/> + <n.menu_move_post/> + <n.menu_delete_post/> + <n.menu_change_post_date/> + <n.menu_print_post/> + <n.menu_permalink/> + <n.menu_raw_mail/> + <n.menu_social/> + </n.dropdown.> +</override_macro> + +<override_macro name="root_post_dropdown" requires="node"> + <n.dropdown. + id="rootdropdown[n.id/]" + text="[t]Options[/t]" + title="[t]Click for more options[/t]" + loadOnClick="/template/NamlServlet.jtp?macro=root_post_dropdown_later&node=[n.id/]" + > + <n.menu_topic_subscription/> + <n.menu_reply_to_author/> + <n.menu_edit_post/> + <n.menu_move_post/> + <n.menu_delete_topic/> + <n.menu_pin_topic/> + <n.menu_unpin_topic/> + <n.menu_lock_topic/> + <n.menu_unlock_topic/> + <n.menu_change_post_date/> + <n.menu_change_title_and_meta_tags/> + <n.menu_embed_post/> + <n.menu_print_post/> + <n.menu_permalink/> + <n.menu_raw_mail/> + <n.menu_social/> + </n.dropdown.> +</override_macro> + +<macro name="menu_social" requires="node"> + <n.if.not.app_or_root.is_private> + <then> + <n.set_var. name='links'> + <n.regex_replace_all. pattern="src=" replacement="s'+'rc="> + <n.javascript_string_encode.compress.> + <n.social_twitter/> + <n.social_facebook/> + <n.social_delicious/> + <n.social_google/> + <n.social_stumbleupon/> + <n.social_linkedin/> + <n.social_digg/> + </n.javascript_string_encode.compress.> + </n.regex_replace_all.> + </n.set_var.> + dropdown.add('social<n.id/>', '<n.var name='links'/>','white-space:nowrap'); + </then> + </n.if.not.app_or_root.is_private> +</macro> + +<macro name="social_img_style"> + width:16px;height:16px;margin-top:.2em;border:none; +</macro> + +<macro name="social_facebook" requires="node"> + <a href="[n.encode_url.]http://www.facebook.com/share.php?v=4&src=bm&u=[n.url/]&t=[n.subject/][/n.encode_url.]" title="Facebook" target="_blank" ignore="y"> + <img src="/images/social/facebook.png" style="[n.social_img_style/]"/> + </a> +</macro> + +<macro name="social_twitter" requires="node"> + <a href="[n.encode_url.]http://twitter.com/share?text=[n.subject/]&related=[n.root_node.subject/]&url=[n.url/][/n.encode_url.]" title="Twitter" target="_blank" ignore="y"> + <img src="/images/social/twitter.png" style="[n.social_img_style/]"/> + </a> +</macro> + +<macro name="social_delicious" requires="node"> + <a href="[n.encode_url.]http://del.icio.us/post?url=[n.url/]&title=[n.subject/][/n.encode_url.]" title="Delicious" target="_blank" ignore="y"> + <img src="/images/social/delicious.png" style="[n.social_img_style/]"/> + </a> +</macro> + +<macro name="social_digg" requires="node"> + <a href="[n.encode_url.]http://digg.com/submit?phase=2&url=[n.url/]&title=[n.subject/][/n.encode_url.]" title="Digg" target="_blank" ignore="y"> + <img src="/images/social/digg.png" style="[n.social_img_style/]"/> + </a> +</macro> + +<macro name="social_stumbleupon" requires="node"> + <a href="[n.encode_url.]http://www.stumbleupon.com/submit?url=[n.url/]&title=[n.subject/][/n.encode_url.]" title="Stumble Upon" target="_blank" ignore="y"> + <img src="/images/social/stumbleupon.png" style="[n.social_img_style/]"/> + </a> +</macro> + +<macro name="social_google" requires="node"> + <a href="[n.encode_url.]http://www.google.com/bookmarks/mark?op=add&bkmk=[n.url/]&title=[n.subject/][/n.encode_url.]" title="Google Bookmarks" target="_blank" ignore="y"> + <img src="/images/social/google.png" style="[n.social_img_style/]"/> + </a> +</macro> + +<macro name="social_linkedin" requires="node"> + <a href="[n.encode_url.]http://www.linkedin.com/shareArticle?mini=true&url=[n.url/]&title=[n.url/]&source=[n.root_node.subject/][/n.encode_url.]" title="LinkedIn" target="_blank" ignore="y"> + <img src="/images/social/linkedin.png" style="[n.social_img_style/]"/> + </a> +</macro> \ No newline at end of file