From 6c9e3aa5e966fcbea783809867d86417f42f70b8 Mon Sep 17 00:00:00 2001 From: Peter Flynn Date: Fri, 26 Oct 2012 17:41:46 -0700 Subject: [PATCH] Remove dependency on RequireJS 1.x since Brackets is moving to 2.1. Use the standard Brackets utility function to load CSS instead of relying on require.nameToUrl(), which has been removed in Require 2.x. --- main.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.js b/main.js index 0334aec..ab682e5 100644 --- a/main.js +++ b/main.js @@ -43,6 +43,7 @@ define(function (require, exports, module) { Menus = brackets.getModule("command/Menus"), Dialogs = brackets.getModule("widgets/Dialogs"), FileUtils = brackets.getModule("file/FileUtils"), + ExtensionUtils = brackets.getModule("utils/ExtensionUtils"), eve, format = (function () { var tokenRegex = /\{([^\}]+)\}/g, @@ -83,9 +84,7 @@ define(function (require, exports, module) { var PGB_COMMAND_ID = "phonegap.build"; // package-style naming to avoid collisions CommandManager.register(Strings.COMMAND_NAME, PGB_COMMAND_ID, eve.f("pgb.button.click")); - var button = $(""), - path2 = require.nameToUrl("icon.svg"); - path2 = path2.substring(0, path2.indexOf("icon.svg[")); + var button = $(""); function zipProject(id) { var rootPath = ProjectManager.getProjectRoot().fullPath, @@ -221,14 +220,15 @@ define(function (require, exports, module) { xhr.send(form); } } - + + ExtensionUtils.loadStyleSheet(module, "pgb.css"); + button.attr({ title: Strings.COMMAND_NAME, id: "pgb-btn", href: "#", "class": "disabled" - }).html('') - .click(eve.f("pgb.button.click")); + }).click(eve.f("pgb.button.click")); button.insertAfter("#toolbar-go-live"); var $panel = $('
\