Commits

Brantley Harris  committed b27d9e1

Requirements work again...

  • Participants
  • Parent commits fa972f0

Comments (0)

Files changed (2)

File onpython3yet/media/js/site.js

     return s;
 };
 
-
 function PackageList(source) {
     var self = this;
     this.source = $(source);
                     });
     
     var hash = parseInt( window.location.hash.substring(1) );
-    console.log("Hash", hash);
     if (hash) {
         this.getMore( hash - this.offset );
     }
     $('.package-list').each(function() {
         new PackageList(this);
     });
-});
-
-/*
-
-// Namespaces:
-var site = {},
-    req = {};
-
-$(document).ready(function() {
-
+    
     $("#requirements-results").each(function(e) {
         var requirements = $(this).attr('data-requirements').split(';;;'),
             results = $('.results', this),
                 dataType: 'json',
                 data: {name: name},
                 success: function(data, textStatus, xhr) {
-                    req.onResultFetch(pkg, data);
+                    console.log('do something with data: ', data);
                 },
                 error: site.onAjaxError
             });
             pkid ++;
         });
     });
-
-    $("#show-more-packages").click(function(e) {
-        e.preventDefault();
-        var results = $("#depended-on-packages"),
-            start = parseInt(results.attr('data-offset'), 10),
-            url = results.attr('data-url'),
-            offset = start + 20;
-        $.ajax({
-            url: url,
-            type: 'GET',
-            dataType: 'json',
-            data: {start: start, offset: offset},
-            success: function(data, textStatus, xhr) {
-                results.attr('data-offset', offset);
-                $.each(data.packages, function(i, pkg) {
-                    var name = site.escapeHtml(pkg.name);
-                    var h = '<li><a href="' + pkg.show_pkg_url + '"' +
-                            ' title="' + name + ', ' + pkg.required_count +
-                            ' dependents">' + name + '</a></li>';
-                    results.append($(h));
-                });
-            },
-            error: site.onAjaxError
-        });
-    });
-
-});
-
-site.onAjaxError = function(xhr, textStatus, errorThrown) {
-    console.error("Ajax error: " + textStatus + " " + errorThrown);
-};
-
-req.onResultFetch = function(pkg, data) {
-    console.log('do something with data: ', data);
-};
-*/
+});

File onpython3yet/templates/packages/requirements.html

 {% extends 'base.html' %}
 
 {% block content %}
-
+    
     <div id="requirements-results"
          data-requirements="{{ requirements }}"
          data-url="{% url packages.query %}">