Commits

Stanislas Guerra committed 0fca9e5

Remove the jquery prefix of the js filename because it is not a jquery plugin.
Remove as well the django prefix on the css and js files.

  • Participants
  • Parent commits a69f556

Comments (0)

Files changed (5)

     {% load url from future %}
     {% block extrastyle %}
       {{ block.super }}
-      <link rel="stylesheet" type="text/css" href="{% static "css/django-foldable-list-filter.css" %}" />
+      <link rel="stylesheet" type="text/css" href="{% static "css/foldable-list-filter.css" %}" />
     {% endblock %}
 
     {% block extrahead %}
     {{ block.super }}
-    <script type="text/javascript" src="{% static "js/jquery.django-foldable-list-filter.js" %}"></script>
+    <script type="text/javascript" src="{% static "js/foldable-list-filter.js" %}"></script>
     <script type="text/javascript" src="{% static "js/jquery.cookie.js" %}"></script>
     {% endblock %}
 

File css/django-foldable-list-filter.css

-#changelist-filter h3 {
-    cursor: pointer;
-    background: url("../images/foldable-list-filter.png") no-repeat scroll left -14px transparent;
-    padding-left: 16px;
-}
-
-#changelist-filter h3.closed {
-    background-position: -15px 0;
-}
-#changelist-filter h3.closed + ul li:not(.selected) {
-    display: none;
-}

File css/foldable-list-filter.css

+#changelist-filter h3 {
+    cursor: pointer;
+    background: url("../images/foldable-list-filter.png") no-repeat scroll left -14px transparent;
+    padding-left: 16px;
+}
+
+#changelist-filter h3.closed {
+    background-position: -15px 0;
+}
+#changelist-filter h3.closed + ul li:not(.selected) {
+    display: none;
+}

File js/foldable-list-filter.js

+(function($) {
+    $(document).ready(function(){
+        var foldable_list_filter = {
+            filters: $("#changelist-filter h3"),
+            cookie_name: "list_filter_closed",
+            delim: "|",
+            opened_class: "opened",
+            closed_class: "closed",
+            list_filter_closed: [],
+            update_cookie: function(action, index) {
+                if ($.isFunction($.cookie)) {
+                    var list_filter_closed = foldable_list_filter.get_list_filter_closed();
+                    if (action == foldable_list_filter.closed_class) {
+                        list_filter_closed.push(index.toString());
+                    } else {
+                        list_filter_closed.splice(list_filter_closed.indexOf(index.toString()), 1);
+                    }
+                    $.cookie(foldable_list_filter.cookie_name,
+                             list_filter_closed.join(foldable_list_filter.delim));
+                }
+            },
+            get_list_filter_closed: function() {
+                return ($.cookie(foldable_list_filter.cookie_name) || "")
+                                             .split(foldable_list_filter.delim)
+            }
+        };
+
+        if ($.isFunction($.cookie)) {
+            foldable_list_filter.list_filter_closed = foldable_list_filter.get_list_filter_closed();
+        }
+
+        foldable_list_filter.filters.each(function(i, elt){
+            var h3 = $(this);
+            var statut_class = foldable_list_filter.opened_class;
+            if (foldable_list_filter.list_filter_closed.indexOf(i.toString()) != -1) {
+                statut_class = foldable_list_filter.closed_class;
+            }
+            h3.addClass("filter "+statut_class);
+        });
+
+
+        foldable_list_filter.filters.click(function(){
+            if ($(this).hasClass(foldable_list_filter.opened_class)) { // Closing.
+                $(this).next().find('li:not(.selected)').slideUp();
+                $(this).removeClass(foldable_list_filter.opened_class)
+                       .addClass(foldable_list_filter.closed_class);
+                foldable_list_filter.update_cookie(
+                        foldable_list_filter.closed_class,
+                        foldable_list_filter.filters.index($(this))
+                );
+            } else { // Opening.
+                $(this).next().find('li:not(.selected)').slideDown();
+                $(this).removeClass(foldable_list_filter.closed_class)
+                       .addClass(foldable_list_filter.opened_class);
+                foldable_list_filter.update_cookie(
+                        foldable_list_filter.opened_class,
+                        foldable_list_filter.filters.index($(this))
+                );
+            }
+        });
+    });
+
+})(django.jQuery);

File js/jquery.django-foldable-list-filter.js

-(function($) {
-    $(document).ready(function(){
-        var foldable_list_filter = {
-            filters: $("#changelist-filter h3"),
-            cookie_name: "list_filter_closed",
-            delim: "|",
-            opened_class: "opened",
-            closed_class: "closed",
-            list_filter_closed: [],
-            update_cookie: function(action, index) {
-                if ($.isFunction($.cookie)) {
-                    var list_filter_closed = foldable_list_filter.get_list_filter_closed();
-                    if (action == foldable_list_filter.closed_class) {
-                        list_filter_closed.push(index.toString());
-                    } else {
-                        list_filter_closed.splice(list_filter_closed.indexOf(index.toString()), 1);
-                    }
-                    $.cookie(foldable_list_filter.cookie_name,
-                             list_filter_closed.join(foldable_list_filter.delim));
-                }
-            },
-            get_list_filter_closed: function() {
-                return ($.cookie(foldable_list_filter.cookie_name) || "")
-                                             .split(foldable_list_filter.delim)
-            }
-        };
-
-        if ($.isFunction($.cookie)) {
-            foldable_list_filter.list_filter_closed = foldable_list_filter.get_list_filter_closed();
-        }
-
-        foldable_list_filter.filters.each(function(i, elt){
-            var h3 = $(this);
-            var statut_class = foldable_list_filter.opened_class;
-            if (foldable_list_filter.list_filter_closed.indexOf(i.toString()) != -1) {
-                statut_class = foldable_list_filter.closed_class;
-            }
-            h3.addClass("filter "+statut_class);
-        });
-
-
-        foldable_list_filter.filters.click(function(){
-            if ($(this).hasClass(foldable_list_filter.opened_class)) { // Closing.
-                $(this).next().find('li:not(.selected)').slideUp();
-                $(this).removeClass(foldable_list_filter.opened_class)
-                       .addClass(foldable_list_filter.closed_class);
-                foldable_list_filter.update_cookie(
-                        foldable_list_filter.closed_class,
-                        foldable_list_filter.filters.index($(this))
-                );
-            } else { // Opening.
-                $(this).next().find('li:not(.selected)').slideDown();
-                $(this).removeClass(foldable_list_filter.closed_class)
-                       .addClass(foldable_list_filter.opened_class);
-                foldable_list_filter.update_cookie(
-                        foldable_list_filter.opened_class,
-                        foldable_list_filter.filters.index($(this))
-                );
-            }
-        });
-    });
-
-})(django.jQuery);