Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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.
  • Loading branch information...
commit 6c9e3aa5e966fcbea783809867d86417f42f70b8 1 parent fb6dc18
@peterflynn peterflynn authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 main.js
View
12 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 = $("<a>"),
- path2 = require.nameToUrl("icon.svg");
- path2 = path2.substring(0, path2.indexOf("icon.svg["));
+ var button = $("<a>");
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('<link rel="stylesheet" href="' + path2 + 'pgb.css">')
- .click(eve.f("pgb.button.click"));
+ }).click(eve.f("pgb.button.click"));
button.insertAfter("#toolbar-go-live");
var $panel = $('<div id="pgb-panel" class="bottom-panel">\

1 comment on commit 6c9e3aa

@tpryan
Collaborator

Looks good to me, @peterflynn.

Please sign in to comment.
Something went wrong with that request. Please try again.