[extensions-web] js: Port Uninstall message to mustache



commit 54370ccc18da776d1fc38aad11180569b2f2b23d
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Mar 30 18:40:40 2012 -0400

    js: Port Uninstall message to mustache

 sweettooth/static/js/extensions.js                 |    9 +--------
 .../js/templates/extensions/uninstall.mustache     |    1 +
 sweettooth/static/js/templates/templatedata.js     |    2 +-
 3 files changed, 3 insertions(+), 9 deletions(-)
---
diff --git a/sweettooth/static/js/extensions.js b/sweettooth/static/js/extensions.js
index c2f702b..e4dcb88 100644
--- a/sweettooth/static/js/extensions.js
+++ b/sweettooth/static/js/extensions.js
@@ -199,14 +199,7 @@ function($, messages, dbusProxy, extensionUtils, templates) {
                                 if (result) {
                                     $elem.fadeOut({ queue: false }).slideUp({ queue: false });
 
-                                    // Construct a dummy <p> node as we need something
-                                    // to stuff everything else in...
-                                    var messageHTML = $("<p>You uninstalled </p>").
-                                        append($('<b>').text(extension.name)).
-                                        append(". ").
-                                        append($('<a>', {'href': '#'}).text("Undo?")).html();
-
-                                    var $message = messages.addInfo(messageHTML);
+                                    var $message = messages.addInfo(templates.extensions.uninstall(extension));
                                     $message.delegate('a', 'click', reinstall);
                                     $elem.data('undo-uninstall-message', $message);
                                 }
diff --git a/sweettooth/static/js/templates/extensions/uninstall.mustache b/sweettooth/static/js/templates/extensions/uninstall.mustache
new file mode 100644
index 0000000..ce579ff
--- /dev/null
+++ b/sweettooth/static/js/templates/extensions/uninstall.mustache
@@ -0,0 +1 @@
+You uninstalled <b>{{name}}. <a href="#">Undo?</a>
diff --git a/sweettooth/static/js/templates/templatedata.js b/sweettooth/static/js/templates/templatedata.js
index d86ba0d..a652219 100644
--- a/sweettooth/static/js/templates/templatedata.js
+++ b/sweettooth/static/js/templates/templatedata.js
@@ -1,4 +1,4 @@
 
 "use strict";
 
-define({"paginator": {"loading_page": "<div class=\"loading-page\">\n  Loading page... please wait.\n</div>"}, "messages": {"cannot_list_errors": "GNOME Shell Extensions cannot automatically detect any errors.", "cannot_list_local": "GNOME Shell Extensions cannot list your installed extensions.", "dummy_proxy": "You do not appear to have an up to date version of GNOME3. You won't be able to install extensions from here. See the <a href=\"about/#old-version\">about page</a> for more information."}, "upgrade": {"need_upgrade": "You have version {{current_version}} of \"{{extension_name}}\". The latest version is version {{latest_version}}. Click here to upgrade.", "latest_version": "You have the latest version of {{extension_name}}."}, "extensions": {}});
+define({"paginator": {"loading_page": "<div class=\"loading-page\">\n  Loading page... please wait.\n</div>"}, "messages": {"cannot_list_errors": "GNOME Shell Extensions cannot automatically detect any errors.", "cannot_list_local": "GNOME Shell Extensions cannot list your installed extensions.", "dummy_proxy": "You do not appear to have an up to date version of GNOME3. You won't be able to install extensions from here. See the <a href=\"about/#old-version\">about page</a> for more information."}, "upgrade": {"need_upgrade": "You have version {{current_version}} of \"{{extension_name}}\". The latest version is version {{latest_version}}. Click here to upgrade.", "latest_version": "You have the latest version of {{extension_name}}."}, "extensions": {"uninstall": "You uninstalled <b>{{name}}. <a href=\"#\">Undo?</a>"}});



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]