From 1bf526124d5e7f8949504b7f2ed225b201f66178 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 20 Jan 2013 22:34:27 +0000 Subject: [PATCH 01/32] resolve #1349 --- src/static/js/admin/plugins.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/static/js/admin/plugins.js b/src/static/js/admin/plugins.js index ddff767bf..2682d97d6 100644 --- a/src/static/js/admin/plugins.js +++ b/src/static/js/admin/plugins.js @@ -124,9 +124,16 @@ $(document).ready(function () { var version = '0.0.0'; // hack to access "versions" property of the npm package object for (version in data.results[plugin_name].versions) break; - for (attr in plugin) { - row.find("." + attr).html(plugin[attr]); + if(attr != "name"){ // Hack to rewrite URLS into name + row.find("." + attr).html(plugin[attr]); + }else{ + if(plugin['url']){ + row.find(".name").html(""+plugin[attr]+""); + }else{ + row.find(".name").html(plugin["name"]); + } + } } row.find(".version").html(version); From 4cbf3869c69f71730e7d298bb42802d9c312a8b0 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 20 Jan 2013 22:36:58 +0000 Subject: [PATCH 02/32] open in external window --- src/static/js/admin/plugins.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static/js/admin/plugins.js b/src/static/js/admin/plugins.js index 2682d97d6..2758290d2 100644 --- a/src/static/js/admin/plugins.js +++ b/src/static/js/admin/plugins.js @@ -129,7 +129,7 @@ $(document).ready(function () { row.find("." + attr).html(plugin[attr]); }else{ if(plugin['url']){ - row.find(".name").html(""+plugin[attr]+""); + row.find(".name").html(""+plugin[attr]+""); }else{ row.find(".name").html(plugin["name"]); } From 8bfa8a7e73143270df84fa180ce5656bfa404ed9 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 20 Jan 2013 22:42:32 +0000 Subject: [PATCH 03/32] better urls --- src/static/js/admin/plugins.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/static/js/admin/plugins.js b/src/static/js/admin/plugins.js index 2758290d2..b1387aa7f 100644 --- a/src/static/js/admin/plugins.js +++ b/src/static/js/admin/plugins.js @@ -129,6 +129,7 @@ $(document).ready(function () { row.find("." + attr).html(plugin[attr]); }else{ if(plugin['url']){ + plugin['url'] = plugin['url'].replace("registry.",""); row.find(".name").html(""+plugin[attr]+""); }else{ row.find(".name").html(plugin["name"]); From 441dd3785a59a3cd508dd5cf2f3709ce14dd5580 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 20 Jan 2013 23:11:59 +0000 Subject: [PATCH 04/32] fix issue #1110 --- src/static/js/admin/plugins.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/static/js/admin/plugins.js b/src/static/js/admin/plugins.js index b1387aa7f..8d1901d97 100644 --- a/src/static/js/admin/plugins.js +++ b/src/static/js/admin/plugins.js @@ -114,7 +114,11 @@ $(document).ready(function () { widget.data('total', data.total); widget.find('.offset').html(data.query.offset); - widget.find('.limit').html(data.query.offset + data.query.limit); + if (data.query.offset + data.query.limit > data.total){ + widget.find('.limit').html(data.total); + }else{ + widget.find('.limit').html(data.query.offset + data.query.limit); + } widget.find('.total').html(data.total); widget.find(".results *").remove(); From 159feceb2024b31308e98ad54551aa200dd360c8 Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 22 Jan 2013 18:17:15 +0000 Subject: [PATCH 05/32] fix import without params --- src/static/js/pad_impexp.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/static/js/pad_impexp.js b/src/static/js/pad_impexp.js index 257dfa667..745642569 100644 --- a/src/static/js/pad_impexp.js +++ b/src/static/js/pad_impexp.js @@ -212,10 +212,8 @@ var padimpexp = (function() //get /p/padname var pad_root_path = new RegExp(/.*\/p\/[^\/]+/).exec(document.location.pathname); - //get http://example.com/p/padname - var pad_root_url = document.location.href.replace(document.location.pathname, pad_root_path); - //strip out params IE ?noColor=true - pad_root_url = pad_root_url.substring(0, pad_root_url.indexOf('?')); + //get http://example.com/p/padname without Params + var pad_root_url = document.location.protocol + '//' + document.location.host + document.location.pathname; //i10l buttom import $('#importsubmitinput').val(html10n.get("pad.impexp.importbutton")); From 6ae46ea8e33f40a8f98056f8ce37945e8a3f3a5b Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 22 Jan 2013 18:28:38 +0000 Subject: [PATCH 06/32] fix issue where url was wrong for install --- src/static/js/admin/plugins.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/static/js/admin/plugins.js b/src/static/js/admin/plugins.js index 8d1901d97..a8b063041 100644 --- a/src/static/js/admin/plugins.js +++ b/src/static/js/admin/plugins.js @@ -47,13 +47,13 @@ $(document).ready(function () { $(".do-install").unbind('click').click(function (e) { var row = $(e.target).closest("tr"); doUpdate = true; - socket.emit("install", row.find(".name").html()); + socket.emit("install", row.find(".name").text()); }); $(".do-uninstall").unbind('click').click(function (e) { var row = $(e.target).closest("tr"); doUpdate = true; - socket.emit("uninstall", row.find(".name").html()); + socket.emit("uninstall", row.find(".name").text()); }); $(".do-prev-page").unbind('click').click(function (e) { @@ -129,15 +129,10 @@ $(document).ready(function () { // hack to access "versions" property of the npm package object for (version in data.results[plugin_name].versions) break; for (attr in plugin) { - if(attr != "name"){ // Hack to rewrite URLS into name - row.find("." + attr).html(plugin[attr]); + if(attr == "name"){ // Hack to rewrite URLS into name + row.find(".name").html(""+plugin[attr]+""); }else{ - if(plugin['url']){ - plugin['url'] = plugin['url'].replace("registry.",""); - row.find(".name").html(""+plugin[attr]+""); - }else{ - row.find(".name").html(plugin["name"]); - } + row.find("." + attr).html(plugin[attr]); } } row.find(".version").html(version); From b76f084f3a84df7199050acd3f11100c6a824040 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 23 Jan 2013 01:01:35 +0000 Subject: [PATCH 07/32] add eejs block for disconnect --- src/templates/pad.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/templates/pad.html b/src/templates/pad.html index 274a3b1a0..a2f0ffce8 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -328,10 +328,12 @@

+ <% e.begin_block("disconnected"); %>

+ <% e.end_block(); %>