Skip to content
This repository has been archived by the owner on Jun 20, 2018. It is now read-only.

Commit

Permalink
Remove dependency on RequireJS 1.x since Brackets is moving to 2.1.
Browse files Browse the repository at this point in the history
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
peterflynn committed Oct 27, 2012
1 parent fb6dc18 commit 6c9e3aa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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">\
Expand Down

1 comment on commit 6c9e3aa

@tpryan
Copy link
Contributor

@tpryan tpryan commented on 6c9e3aa Oct 30, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, @peterflynn.

Please sign in to comment.