From 1bf526124d5e7f8949504b7f2ed225b201f66178 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 20 Jan 2013 22:34:27 +0000 Subject: [PATCH 1/7] 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 2/7] 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 3/7] 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 4/7] 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 6ae46ea8e33f40a8f98056f8ce37945e8a3f3a5b Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 22 Jan 2013 18:28:38 +0000 Subject: [PATCH 5/7] 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 9fa5b9506edc54df3b3fd6370b122877e4edc256 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Thu, 24 Jan 2013 13:43:42 +0100 Subject: [PATCH 6/7] Add links for installed plugins --- 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 a8b063041..03f6203b8 100644 --- a/src/static/js/admin/plugins.js +++ b/src/static/js/admin/plugins.js @@ -151,7 +151,11 @@ $(document).ready(function () { var row = $("#installed-plugin-template").clone(); for (attr in plugin.package) { - row.find("." + attr).html(plugin.package[attr]); + if(attr == "name"){ // Hack to rewrite URLS into name + row.find(".name").html(""+plugin.package[attr]+""); + }else{ + row.find("." + attr).html(plugin.package[attr]); + } } $("#installed-plugins").append(row); } From 3719ce7c5d2908886176b32bf923139ed06d7124 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Thu, 24 Jan 2013 13:50:49 +0100 Subject: [PATCH 7/7] [admin] Make links prettier --- src/static/css/admin.css | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/static/css/admin.css b/src/static/css/admin.css index b91850a65..d82da6aa3 100644 --- a/src/static/css/admin.css +++ b/src/static/css/admin.css @@ -128,3 +128,13 @@ td, th { #response{ display:inline; } + +a:link, a:visited, a:hover, a:focus { + color: #333333; + text-decoration: none; + border-bottom: #333333 1px dotted; +} + +a:focus, a:hover { + border-bottom: #333333 1px solid; +} \ No newline at end of file