You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2014/01/22 18:11:01 UTC

[1/2] git commit: [#4257] Fixed page controls not showing on last page of activity stream

Updated Branches:
  refs/heads/cj/4257 e523a2266 -> 37cfa4039


[#4257] Fixed page controls not showing on last page of activity stream

Signed-off-by: Cory Johns <cj...@slashdotmedia.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/c816fe86
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/c816fe86
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/c816fe86

Branch: refs/heads/cj/4257
Commit: c816fe8621862b62ab797c12e24b57dbd13169cc
Parents: e523a22
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue Jan 21 23:25:57 2014 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue Jan 21 23:33:56 2014 +0000

----------------------------------------------------------------------
 ForgeActivity/forgeactivity/main.py              | 17 ++++++++++-------
 ForgeActivity/forgeactivity/templates/index.html |  4 ++--
 2 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c816fe86/ForgeActivity/forgeactivity/main.py
----------------------------------------------------------------------
diff --git a/ForgeActivity/forgeactivity/main.py b/ForgeActivity/forgeactivity/main.py
index 7f29dd9..03632a3 100644
--- a/ForgeActivity/forgeactivity/main.py
+++ b/ForgeActivity/forgeactivity/main.py
@@ -102,15 +102,18 @@ class ForgeActivityController(BaseController):
 
         following = g.director.is_connected(c.user, followee)
         timeline = g.director.get_timeline(followee, page=kw.get('page', 0),
-                                           limit=kw.get('limit', 100), actor_only=actor_only,
+                                           limit=kw.get('limit', 100),
+                                           actor_only=actor_only,
                                            filter_func=perm_check(c.user))
+        page = asint(kw.get('page', 0))
+        limit = asint(kw.get('limit', 100))
         return dict(
-                followee=followee,
-                following=following,
-                timeline=timeline,
-                page=asint(kw.get('page', 0)),
-                limit=asint(kw.get('limit', 100)),
-            )
+            followee=followee,
+            following=following,
+            timeline=timeline,
+            page=page,
+            limit=limit,
+            has_more=len(timeline) == limit)
 
     @expose('jinja:forgeactivity:templates/index.html')
     @with_trailing_slash

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c816fe86/ForgeActivity/forgeactivity/templates/index.html
----------------------------------------------------------------------
diff --git a/ForgeActivity/forgeactivity/templates/index.html b/ForgeActivity/forgeactivity/templates/index.html
index 11bdf36..48615cb 100644
--- a/ForgeActivity/forgeactivity/templates/index.html
+++ b/ForgeActivity/forgeactivity/templates/index.html
@@ -42,12 +42,12 @@
 
 <div class="activity">
   {% if not timeline %}
-    No activity to display.
+    No {% if page > 0 %} more {% endif %} activity to display.
   {% else %}
     <ul class="timeline" data-limit="{{limit}}">
         {% include 'forgeactivity:templates/timeline.html' %}
     </ul>
-    {{c.page_list.display(limit=1, page=page, count=page+1, show_label=False, show_if_single_page=True, force_next=True)}}
   {% endif %}
+  {{c.page_list.display(limit=1, page=page, count=page+1, show_label=False, show_if_single_page=True, force_next=has_more)}}
 </div>
 {% endblock %}


[2/2] git commit: [#4257] Ugly hack to fix Access Denied error in IE

Posted by jo...@apache.org.
[#4257] Ugly hack to fix Access Denied error in IE

It seems that some combination of IE11, jQuery 1.8.0, and possibly
something else on our page, doing $('<li>elem</li>') causes IE to raise
an "Access denied" error claiming that we're attempting cross-site
javascript iframe access.  However, doing $('#elem').append('<li>elem</li>')
works fine.  I'd prefer to upgrade jQuery but this is a quicker work-around.

Signed-off-by: Cory Johns <cj...@slashdotmedia.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/37cfa403
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/37cfa403
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/37cfa403

Branch: refs/heads/cj/4257
Commit: 37cfa4039e00bb028b580940c318fafc89f9bf8d
Parents: c816fe8
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Wed Jan 22 17:05:58 2014 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed Jan 22 17:06:10 2014 +0000

----------------------------------------------------------------------
 .../forgeactivity/nf/activity/js/activity.js         | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/37cfa403/ForgeActivity/forgeactivity/nf/activity/js/activity.js
----------------------------------------------------------------------
diff --git a/ForgeActivity/forgeactivity/nf/activity/js/activity.js b/ForgeActivity/forgeactivity/nf/activity/js/activity.js
index f6807d7..80b79d8 100644
--- a/ForgeActivity/forgeactivity/nf/activity/js/activity.js
+++ b/ForgeActivity/forgeactivity/nf/activity/js/activity.js
@@ -164,16 +164,21 @@ $(function() {
         }
         var newerText = newer ? 'newer' : 'older';
         $.get(url, function(html) {
-            var $html = $(html);
             var $timeline = $('.timeline');
-            var newPage = $html.data('page');
+            var empty = html.match(/^\s*$/);
+            var newestPage = newer && $('.timeline li:first').data('page') <= 1;
             var limit = $('.timeline').data('limit');
+            var fullPage = true;
             saveScrollPosition();
-            if ($html.length < limit || newPage == 0) {
+            if (!empty) {
+                $timeline[newer ? 'prepend' : 'append'](html);
+                var newPage = $timeline.find('li:' + (newer ? 'first' : 'last')).data('page');
+                fullPage = $timeline.find('li:timeline-page('+newPage+')').length == limit;
+                pageOut(!newer);
+            }
+            if (empty || !fullPage || newestPage) {
                 makeNoMore(newer);
             }
-            $timeline[newer ? 'prepend' : 'append']($html);
-            pageOut(!newer);
             if (ASOptions.useShowMore) {
                 // this has to be here instead of showMoreLink handler to
                 // ensure that scroll changes between added / removed content