changeset 2907:54face4c8ae9 nb

fixes #469 removed toggle text, used title attribute
author Vipul Sharma <vipul.sharma20@gmail.com>
date Sun, 01 Mar 2015 18:57:54 +0530
parents ac10a2e3eaf6
children b5af7d54c352 6a43800d50cb
files MoinMoin/static/js/common.js MoinMoin/templates/link_list_item_panel.html MoinMoin/templates/link_list_no_item_panel.html MoinMoin/templates/sitemap.html MoinMoin/templates/utils.html
diffstat 5 files changed, 17 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/static/js/common.js	Fri Feb 13 21:14:01 2015 +0100
+++ b/MoinMoin/static/js/common.js	Sun Mar 01 18:57:54 2015 +0530
@@ -242,22 +242,6 @@
 };
 
 
-
-// OnMouseOver show the fqname of the item else only show the value/id.
-function togglefqname() {
-    "use strict";
-    var fullname, value;
-    $(".moin-fqname").hover(function () {
-        fullname = $(this).attr('data-fqname');
-        value = $(this).html();
-        $(this).html(fullname);
-    }, function () {
-        $(this).html(value);
-    });
-}
-$(document).ready(togglefqname);
-
-
 // Executed when user clicks insert-name button defined in modify.html.
 // When a page with subitems is modified, a subitems sidebar is present. User may
 // position caret in textarea and click button to insert name into textarea.
--- a/MoinMoin/templates/link_list_item_panel.html	Fri Feb 13 21:14:01 2015 +0100
+++ b/MoinMoin/templates/link_list_item_panel.html	Sun Mar 01 18:57:54 2015 +0530
@@ -1,4 +1,5 @@
 {% extends theme("show.html") %}
+{% from "utils.html" import item_panel %}
 {% block content %}
     {% if headline %}
         <h1>{{ headline }}</h1>
@@ -7,7 +8,7 @@
         Total: {{ fq_names|count }}
         <ul class="moin-link-list">
             {% for fq_name in fq_names|sort(attribute='value') %}
-                <li><a class="moin-fqname" href="{{ url_for('frontend.show_item', item_name=fq_name) }}" data-fqname="{{ fq_name }}">{{ fq_name.value }}</a></li>
+                {{ item_panel(fq_name) }}
             {% endfor %}
         </ul>
     {% endif %}
--- a/MoinMoin/templates/link_list_no_item_panel.html	Fri Feb 13 21:14:01 2015 +0100
+++ b/MoinMoin/templates/link_list_no_item_panel.html	Sun Mar 01 18:57:54 2015 +0530
@@ -1,4 +1,5 @@
 {% extends theme("layout.html") %}
+{% from "utils.html" import item_panel %}
 {% block content %}
     {% if headline %}
         <h1>{{ headline }}</h1>
@@ -7,13 +8,7 @@
         <h2>Total: {{ fq_names|count }}</h2>
         <ul class="moin-link-list">
             {% for fq_name in fq_names|sort(attribute='value') %}
-                <li>
-                    <a class="moin-fqname"
-                       href="{{ url_for('frontend.show_item', item_name=fq_name) }}"
-                       data-fqname="{{ fq_name }}">
-                           {{ fq_name.value }}
-                    </a>
-                </li>
+                {{ item_panel(fq_name) }}
             {% endfor %}
         </ul>
     {% endif %}
--- a/MoinMoin/templates/sitemap.html	Fri Feb 13 21:14:01 2015 +0100
+++ b/MoinMoin/templates/sitemap.html	Sun Mar 01 18:57:54 2015 +0530
@@ -20,7 +20,7 @@
                     <a href="{{ url_for('frontend.sitemap', item_name=entry) }}">
                         <span class="fa fa-sitemap"></span>
                     </a>
-                    <a class="moin-fqname" href="{{ url_for('frontend.show_item', item_name=entry) }}" data-fqname="{{ entry }}">
+                    <a class="moin-fqname" href="{{ url_for('frontend.show_item', item_name=entry) }}">
                         {{ entry.value }}
                     </a>
                 </li>
--- a/MoinMoin/templates/utils.html	Fri Feb 13 21:14:01 2015 +0100
+++ b/MoinMoin/templates/utils.html	Sun Mar 01 18:57:54 2015 +0530
@@ -262,3 +262,15 @@
         {% endif %}
     </ul>
 {% endmacro %}
+
+{% macro item_panel(fq_name) %}
+    <li>
+        <a class="moin-fqname"
+           href="{{ url_for('frontend.show_item', item_name=fq_name) }}"
+           {% if fq_name.value != fq_name|string %}
+               title="{{ fq_name }}"
+           {% endif %}>
+           {{ fq_name.value }}
+       </a>
+    </li>
+{% endmacro %}