From 092a980e0f10c3d5a0f320539a5e2f6d9ebd2300 Mon Sep 17 00:00:00 2001 From: Jon Wolfe Date: Sun, 1 Jul 2012 20:34:17 -0400 Subject: [PATCH 1/4] Update source to adhere to style guide for quotes. Fixes issue #1100. --- src/LiveDevelopment/Agents/CSSAgent.js | 2 +- src/LiveDevelopment/Agents/ConsoleAgent.js | 2 +- src/LiveDevelopment/Agents/DOMAgent.js | 2 +- src/LiveDevelopment/Agents/DOMHelpers.js | 8 +- src/LiveDevelopment/Agents/DOMNode.js | 2 +- src/LiveDevelopment/Agents/EditAgent.js | 2 +- src/LiveDevelopment/Agents/GotoAgent.js | 6 +- src/LiveDevelopment/Agents/HighlightAgent.js | 2 +- src/LiveDevelopment/Agents/NetworkAgent.js | 2 +- src/LiveDevelopment/Agents/RemoteAgent.js | 2 +- src/LiveDevelopment/Agents/RemoteFunctions.js | 2 +- src/LiveDevelopment/Agents/ScriptAgent.js | 2 +- src/LiveDevelopment/Documents/CSSDocument.js | 2 +- src/LiveDevelopment/Documents/HTMLDocument.js | 2 +- src/LiveDevelopment/Documents/JSDocument.js | 2 +- src/LiveDevelopment/Inspector/Inspector.js | 2 +- src/LiveDevelopment/Inspector/jsdoc.rb | 170 +++++++++--------- src/LiveDevelopment/LiveDevelopment.js | 6 +- src/LiveDevelopment/main.js | 2 +- src/brackets.js | 6 +- src/command/CommandManager.js | 2 +- src/command/Commands.js | 2 +- src/command/KeyBindingManager.js | 2 +- src/command/Menus.js | 6 +- src/debug/DebugCommandHandlers.js | 2 +- src/document/ChangedDocumentTracker.js | 2 +- src/document/DocumentCommandHandlers.js | 2 +- src/document/DocumentManager.js | 2 +- src/document/TextRange.js | 2 +- src/editor/CSSInlineEditor.js | 2 +- src/editor/CodeHintManager.js | 2 +- src/editor/Editor.js | 2 +- src/editor/EditorCommandHandlers.js | 2 +- src/editor/EditorManager.js | 2 +- src/editor/EditorUtils.js | 4 +- src/editor/InlineTextEditor.js | 2 +- src/editor/InlineWidget.js | 6 +- src/editor/MultiRangeInlineEditor.js | 4 +- .../default/JavaScriptQuickEdit/main.js | 2 +- .../default/JavaScriptQuickEdit/unittests.js | 4 +- src/extensions/default/QuickOpenCSS/main.js | 2 +- src/extensions/default/QuickOpenHTML/main.js | 2 +- .../default/QuickOpenJavaScript/main.js | 2 +- .../disabled/ContextMenuTest/main.js | 2 +- .../disabled/InlineImageViewer/main.js | 2 +- .../disabled/TypingSpeedLogger/main.js | 2 +- .../disabled/circular_dependency_test/main.js | 2 +- .../circular_dependency_test/secondary.js | 2 +- src/file/FileUtils.js | 2 +- src/file/NativeFileSystem.js | 4 +- src/language/CSSUtils.js | 4 +- src/language/HTMLUtils.js | 8 +- src/language/JSLintUtils.js | 4 +- src/language/JSUtils.js | 2 +- src/preferences/PreferenceStorage.js | 2 +- src/preferences/PreferencesManager.js | 2 +- src/project/FileIndexManager.js | 2 +- src/project/FileSyncManager.js | 2 +- src/project/FileViewController.js | 2 +- src/project/ProjectManager.js | 2 +- src/project/SidebarView.js | 2 +- src/project/WorkingSetView.js | 2 +- src/search/FindInFiles.js | 10 +- src/search/QuickOpen.js | 12 +- src/strings.js | 8 +- src/thirdparty/CodeMirror2 | 1 - src/utils/Async.js | 2 +- src/utils/BuildInfoUtils.js | 2 +- src/utils/ExtensionLoader.js | 2 +- src/utils/ExtensionUtils.js | 2 +- src/utils/NativeApp.js | 2 +- src/utils/PerfUtils.js | 2 +- src/utils/ShellAPI.js | 2 +- src/utils/StringUtils.js | 14 +- src/utils/ViewUtils.js | 2 +- src/view/ViewCommandHandlers.js | 2 +- src/widgets/Dialogs.js | 6 +- 77 files changed, 202 insertions(+), 203 deletions(-) delete mode 160000 src/thirdparty/CodeMirror2 diff --git a/src/LiveDevelopment/Agents/CSSAgent.js b/src/LiveDevelopment/Agents/CSSAgent.js index 97f89677ec9..f727103c937 100644 --- a/src/LiveDevelopment/Agents/CSSAgent.js +++ b/src/LiveDevelopment/Agents/CSSAgent.js @@ -31,7 +31,7 @@ */ define(function CSSAgent(require, exports, module) { - 'use strict'; + "use strict"; var Inspector = require("LiveDevelopment/Inspector/Inspector"); diff --git a/src/LiveDevelopment/Agents/ConsoleAgent.js b/src/LiveDevelopment/Agents/ConsoleAgent.js index 29b0e462870..a58c646abc3 100644 --- a/src/LiveDevelopment/Agents/ConsoleAgent.js +++ b/src/LiveDevelopment/Agents/ConsoleAgent.js @@ -30,7 +30,7 @@ * local console. */ define(function ConsoleAgent(require, exports, module) { - 'use strict'; + "use strict"; var Inspector = require("LiveDevelopment/Inspector/Inspector"); diff --git a/src/LiveDevelopment/Agents/DOMAgent.js b/src/LiveDevelopment/Agents/DOMAgent.js index eea4d33f126..5f676d807e9 100644 --- a/src/LiveDevelopment/Agents/DOMAgent.js +++ b/src/LiveDevelopment/Agents/DOMAgent.js @@ -36,7 +36,7 @@ * the document. */ define(function DOMAgent(require, exports, module) { - 'use strict'; + "use strict"; var Inspector = require("LiveDevelopment/Inspector/Inspector"); var RemoteAgent = require("LiveDevelopment/Agents/RemoteAgent"); diff --git a/src/LiveDevelopment/Agents/DOMHelpers.js b/src/LiveDevelopment/Agents/DOMHelpers.js index 056bc542248..a45195a0b72 100644 --- a/src/LiveDevelopment/Agents/DOMHelpers.js +++ b/src/LiveDevelopment/Agents/DOMHelpers.js @@ -29,7 +29,7 @@ * DOMHelpers is a collection of functions used by the DOMAgent exports `eachNode(src, callback)` */ define(function DOMHelpersModule(require, exports, module) { - 'use strict'; + "use strict"; /** Test if the given character is a quote character * {char} source character @@ -145,8 +145,8 @@ define(function DOMHelpersModule(require, exports, module) { function _extractAttributes(content) { // remove the node name and the closing bracket and optional slash - content = content.replace(/^<\S+\s*/, ''); - content = content.replace(/\s*\/?>$/, ''); + content = content.replace(/^<\S+\s*/, ""); + content = content.replace(/\s*\/?>$/, ""); if (content.length === 0) { return; } @@ -205,7 +205,7 @@ define(function DOMHelpersModule(require, exports, module) { } // closed node (/ at the end) - if (content[content.length - 2] === '/') { + if (content[content.length - 2] === "/") { payload.closed = true; } } diff --git a/src/LiveDevelopment/Agents/DOMNode.js b/src/LiveDevelopment/Agents/DOMNode.js index c0d50676132..31927e6c135 100644 --- a/src/LiveDevelopment/Agents/DOMNode.js +++ b/src/LiveDevelopment/Agents/DOMNode.js @@ -33,7 +33,7 @@ * iterated using `each()` or `find()`. `dump` shows the entire tree on the console. */ define(function DOMNodeModule(require, exports, module) { - 'use strict'; + "use strict"; var DOMHelpers = require("LiveDevelopment/Agents/DOMHelpers"); diff --git a/src/LiveDevelopment/Agents/EditAgent.js b/src/LiveDevelopment/Agents/EditAgent.js index 624e308209f..c867e9c711f 100644 --- a/src/LiveDevelopment/Agents/EditAgent.js +++ b/src/LiveDevelopment/Agents/EditAgent.js @@ -30,7 +30,7 @@ * document. */ define(function EditAgent(require, exports, module) { - 'use strict'; + "use strict"; var Inspector = require("LiveDevelopment/Inspector/Inspector"); var DOMAgent = require("LiveDevelopment/Agents/DOMAgent"); diff --git a/src/LiveDevelopment/Agents/GotoAgent.js b/src/LiveDevelopment/Agents/GotoAgent.js index 7005e570bb9..1a40553c87d 100644 --- a/src/LiveDevelopment/Agents/GotoAgent.js +++ b/src/LiveDevelopment/Agents/GotoAgent.js @@ -29,7 +29,7 @@ * GotoAgent constructs and responds to the in-browser goto dialog. */ define(function GotoAgent(require, exports, module) { - 'use strict'; + "use strict"; var Inspector = require("LiveDevelopment/Inspector/Inspector"); var DOMAgent = require("LiveDevelopment/Agents/DOMAgent"); @@ -54,7 +54,7 @@ define(function GotoAgent(require, exports, module) { * @param {string} URL */ function _fileFromURL(url) { - var comp = url.split('/'); + var comp = url.split("/"); return comp[comp.length - 1]; } @@ -171,7 +171,7 @@ define(function GotoAgent(require, exports, module) { var matches = /^(.*):([^:]+)$/.exec(url); if (matches) { url = matches[1]; - location = matches[2].split(','); + location = matches[2].split(","); if (location.length === 1) { location = parseInt(location[0], 10); } else { diff --git a/src/LiveDevelopment/Agents/HighlightAgent.js b/src/LiveDevelopment/Agents/HighlightAgent.js index 95f897a5351..d9e7fca0286 100644 --- a/src/LiveDevelopment/Agents/HighlightAgent.js +++ b/src/LiveDevelopment/Agents/HighlightAgent.js @@ -30,7 +30,7 @@ * highlight requests, and allows highlighting nodes and rules in the browser. */ define(function HighlightAgent(require, exports, module) { - 'use strict'; + "use strict"; var Inspector = require("LiveDevelopment/Inspector/Inspector"); var RemoteAgent = require("LiveDevelopment/Agents/RemoteAgent"); diff --git a/src/LiveDevelopment/Agents/NetworkAgent.js b/src/LiveDevelopment/Agents/NetworkAgent.js index 09e79379641..9cabc7939da 100644 --- a/src/LiveDevelopment/Agents/NetworkAgent.js +++ b/src/LiveDevelopment/Agents/NetworkAgent.js @@ -30,7 +30,7 @@ * `wasURLRequested(url)` to query whether a resource was loaded. */ define(function NetworkAgent(require, exports, module) { - 'use strict'; + "use strict"; var Inspector = require("LiveDevelopment/Inspector/Inspector"); diff --git a/src/LiveDevelopment/Agents/RemoteAgent.js b/src/LiveDevelopment/Agents/RemoteAgent.js index df2fad7f257..f00ab972880 100644 --- a/src/LiveDevelopment/Agents/RemoteAgent.js +++ b/src/LiveDevelopment/Agents/RemoteAgent.js @@ -32,7 +32,7 @@ * Inspector named "Remote.EVENT". */ define(function RemoteAgent(require, exports, module) { - 'use strict'; + "use strict"; var Inspector = require("LiveDevelopment/Inspector/Inspector"); diff --git a/src/LiveDevelopment/Agents/RemoteFunctions.js b/src/LiveDevelopment/Agents/RemoteFunctions.js index 7db7f89d7f8..07006a94183 100644 --- a/src/LiveDevelopment/Agents/RemoteFunctions.js +++ b/src/LiveDevelopment/Agents/RemoteFunctions.js @@ -31,7 +31,7 @@ * exported functions. */ function RemoteFunctions() { - 'use strict'; + "use strict"; var _body = window.document.getElementsByTagName("body")[0]; // the document body var _sourceHighlight; // the highlighted element in the source diff --git a/src/LiveDevelopment/Agents/ScriptAgent.js b/src/LiveDevelopment/Agents/ScriptAgent.js index e527a5889f2..d6dde99e816 100644 --- a/src/LiveDevelopment/Agents/ScriptAgent.js +++ b/src/LiveDevelopment/Agents/ScriptAgent.js @@ -30,7 +30,7 @@ * interfaces with the remote debugger. */ define(function ScriptAgent(require, exports, module) { - 'use strict'; + "use strict"; var Inspector = require("LiveDevelopment/Inspector/Inspector"); var DOMAgent = require("LiveDevelopment/Agents/DOMAgent"); diff --git a/src/LiveDevelopment/Documents/CSSDocument.js b/src/LiveDevelopment/Documents/CSSDocument.js index 6f754e25d01..1f50a614c87 100644 --- a/src/LiveDevelopment/Documents/CSSDocument.js +++ b/src/LiveDevelopment/Documents/CSSDocument.js @@ -46,7 +46,7 @@ * 2nd argument to the listener will be this CSSDocument. */ define(function CSSDocumentModule(require, exports, module) { - 'use strict'; + "use strict"; var Inspector = require("LiveDevelopment/Inspector/Inspector"); var CSSAgent = require("LiveDevelopment/Agents/CSSAgent"); diff --git a/src/LiveDevelopment/Documents/HTMLDocument.js b/src/LiveDevelopment/Documents/HTMLDocument.js index 0fe1cc0871a..9b967502447 100644 --- a/src/LiveDevelopment/Documents/HTMLDocument.js +++ b/src/LiveDevelopment/Documents/HTMLDocument.js @@ -42,7 +42,7 @@ * editor. */ define(function HTMLDocumentModule(require, exports, module) { - 'use strict'; + "use strict"; var Inspector = require("LiveDevelopment/Inspector/Inspector"); var DOMAgent = require("LiveDevelopment/Agents/DOMAgent"); diff --git a/src/LiveDevelopment/Documents/JSDocument.js b/src/LiveDevelopment/Documents/JSDocument.js index 27df2f4869a..d2cb2cbbd3c 100644 --- a/src/LiveDevelopment/Documents/JSDocument.js +++ b/src/LiveDevelopment/Documents/JSDocument.js @@ -43,7 +43,7 @@ * line is missing. */ define(function JSDocumentModule(require, exports, module) { - 'use strict'; + "use strict"; var Inspector = require("LiveDevelopment/Inspector/Inspector"); var ScriptAgent = require("LiveDevelopment/Agents/ScriptAgent"); diff --git a/src/LiveDevelopment/Inspector/Inspector.js b/src/LiveDevelopment/Inspector/Inspector.js index 7d856f0ab0b..29c0435e926 100644 --- a/src/LiveDevelopment/Inspector/Inspector.js +++ b/src/LiveDevelopment/Inspector/Inspector.js @@ -81,7 +81,7 @@ * that stores all returned values as an object. */ define(function Inspector(require, exports, module) { - 'use strict'; + "use strict"; var _messageId = 1; // id used for remote method calls, auto-incrementing var _messageCallbacks = {}; // {id -> function} for remote method calls diff --git a/src/LiveDevelopment/Inspector/jsdoc.rb b/src/LiveDevelopment/Inspector/jsdoc.rb index 1b7c523ce29..393f99d6ebf 100644 --- a/src/LiveDevelopment/Inspector/jsdoc.rb +++ b/src/LiveDevelopment/Inspector/jsdoc.rb @@ -27,14 +27,14 @@ # Required Ruby Gems # json date open-uri -require 'rubygems' -require 'json' -require 'date' -require 'open-uri' +require "rubygems" +require "json" +require "date" +require "open-uri" -#INSPECTOR_URL = 'http://svn.webkit.org/repository/webkit/trunk/Source/WebCore/inspector/Inspector.json' -INSPECTOR_URL = 'Inspector.json' -OUTPUT = 'inspector.html' +#INSPECTOR_URL = "http://svn.webkit.org/repository/webkit/trunk/Source/WebCore/inspector/Inspector.json" +INSPECTOR_URL = "Inspector.json" +OUTPUT = "inspector.html" class NilClass def empty? @@ -53,15 +53,15 @@ def upcaseFirst class JSDoc def typedef(domain, info) - return '[' + typedef(domain, info['items']) + ']' if info['items'] - if info['$ref'] - ref = info['$ref'] - ref = domain + '.' + ref unless ref =~ /\./ - r = "#{ref}" if info['$ref'] - elsif info['enum'] - r = "( #{info['enum'].join ' | '} )" + return "[" + typedef(domain, info["items"]) + "]" if info["items"] + if info["$ref"] + ref = info["$ref"] + ref = domain + "." + ref unless ref =~ /\./ + r = "#{ref}" if info["$ref"] + elsif info["enum"] + r = "( #{info["enum"].join " | "} )" else - r = info['type'].upcaseFirst + r = info["type"].upcaseFirst end r end @@ -73,9 +73,9 @@ def initialize(input, output) def open @in = JSON.parse(File.open(@input).read) - @in['domains'].sort! { |a,b| a['domain'] <=> b['domain'] } - @version = "#{@in['version']['major']}.#{@in['version']['minor']}" - File.open(@output, 'w') do |out| + @in["domains"].sort! { |a,b| a["domain"] <=> b["domain"] } + @version = "#{@in["version"]["major"]}.#{@in["version"]["minor"]}" + File.open(@output, "w") do |out| @out = out yield end @@ -85,7 +85,7 @@ def run open do writeDocument do writeTOC - @in['domains'].each { |domain| writeDomain domain } + @in["domains"].each { |domain| writeDomain domain } end end end @@ -97,41 +97,41 @@ def write(*args) def writeParams(domain, params, prefixLine = false) return unless params write prefixLine if prefixLine - write '
' + write "
" params.each do |p| - name = p['name'] - description = " #{p['description']}" if p['description'] + name = p["name"] + description = " #{p["description"]}" if p["description"] type = typedef domain, p - name += ' (optional)' if p['optional'] + name += " (optional)" if p["optional"] write "
#{name}
" write "
#{type}#{description}
" end - write '
' + write "
" end def writeTOCLine(domain, info) - info['name'] ||= info['id'] - uid = "#{domain}.#{info['name']}" - description = info['description'] ? ": #{info['description'].gsub(/<[^>]*>/, '')}" : '' - write "
  • #{uid}#{description}
  • " + info["name"] ||= info["id"] + uid = "#{domain}.#{info["name"]}" + description = info["description"] ? ": #{info["description"].gsub(/<[^>]*>/, "")}" : "" + write "
  • #{uid}#{description}
  • " end def writeTOCDomain(info) - domain = info['domain'] - unless info['types'].empty? - write 'Type', '' + domain = info["domain"] + unless info["types"].empty? + write "Type", "" end - unless info['commands'].empty? - write 'Command', '' + unless info["commands"].empty? + write "Command", "" end - unless info['events'].empty? - write 'Event', '' + unless info["events"].empty? + write "Event", "" end end @@ -163,10 +163,10 @@ def writeDocument $(_domain).show(); speed = 0; } else { -speed = 'fast'; +speed = "fast"; } -$('html, body').animate({ -scrollTop: symbol.offset().top - 70 + 'px' +$("html, body").animate({ +scrollTop: symbol.offset().top - 70 + "px" }, speed); if (domainAndName.length > 1) symbol.effect("highlight", { color: "#ffc"}, 1000); }); @@ -194,29 +194,29 @@ def writeDocument Domains ', '', '', '', '', '', '
    ' + @in["domains"].each { |info| write "
  • #{info['domain']}
  • " } + write "", "", "", "
    ", "", "", "
    " yield - write '
    ', '", "", "" end def writeTOC - write '
    ', '

    Table of Contents

    ' - @in['domains'].each do |info| - domain = info['domain'] - write "

    #{info['domain']}

    " + write "
    ", "

    Table of Contents

    " + @in["domains"].each do |info| + domain = info["domain"] + write "

    #{info['domain']}

    " writeTOCDomain info end - write '
    ' + write "
    " end def writeDomain(info) - domain, description = info['domain'], info['description'] - types, commands, events = info['types'], info['commands'], info['events'] - write "
    " + domain, description = info["domain"], info["description"] + types, commands, events = info["types"], info["commands"], info["events"] + write "
    " write "

    #{domain}

    " write "

    #{description}

    " writeTOCDomain info @@ -229,57 +229,57 @@ def writeDomain(info) if events events.each { |info| writeEvent domain, info } end - write '
    ' + write "
    " end def writeType(domain, info) - name, description = info['id'], info['description'] - type, enum, properties = info['type'], info['enum'], info['properties'] - write "
    " - write "

    #{domain}.#{name} Type

    " + name, description = info["id"], info["description"] + type, enum, properties = info["type"], info["enum"], info["properties"] + write "
    " + write "

    #{domain}.#{name} Type

    " write "

    #{description}

    " if description - if type != 'object' - write '
    ' + if type != "object" + write "
    " write "
    #{typedef domain, info}
    " - write '
    ' + write "
    " end writeParams domain, properties - write '
    ' + write "
    " end def writeCommand(domain, info) - name, description = info['name'], info['description'] - parameters, returns = info['parameters'], info['returns'] - write "
    " - write "

    #{domain}.#{name} Command

    " + name, description = info["name"], info["description"] + parameters, returns = info["parameters"], info["returns"] + write "
    " + write "

    #{domain}.#{name} Command

    " write "

    #{description}

    " if description writeParams domain, parameters - writeParams domain, returns, '

    Callback Parameters:

    ' - write '

    Code Example:

    ', '
    '
    -		paramNames = parameters.collect { |p| p['name'] } if parameters
    +		writeParams domain, returns, "

    Callback Parameters:

    " + write "

    Code Example:

    ", "
    "
    +		paramNames = parameters.collect { |p| p["name"] } if parameters
     		paramNames ||= []
     		if returns
    -			returnNames = returns.collect { |p| p['name'] }
    -			paramNames << "function callback(res) {\n\t// res = {#{returnNames.join ', '}}\n}"
    +			returnNames = returns.collect { |p| p["name"] }
    +			paramNames << "function callback(res) {\n\t// res = {#{returnNames.join ", "}}\n}"
     		end
     		write "// WebInspector Command: #{domain}.#{name}"
    -		write "#{domain}.#{name}(#{paramNames.join ', '});"
    -		write '
    ', '
    ' + write "#{domain}.#{name}(#{paramNames.join ", "});" + write "", "
    " end def writeEvent(domain, info) - name, description = info['name'], info['description'] - parameters = info['parameters'] - write "
    " - write "

    #{domain}.#{name} Event

    " + name, description = info["name"], info["description"] + parameters = info["parameters"] + write "
    " + write "

    #{domain}.#{name} Event

    " write "

    #{description}

    " if description writeParams domain, parameters - write '

    Code Example:

    ', '
    '
    -		paramNames = parameters.collect { |p| p['name'] } if parameters
    +		write "

    Code Example:

    ", "
    "
    +		paramNames = parameters.collect { |p| p["name"] } if parameters
     		paramNames ||= []
     		write "// WebInspector Event: #{domain}.#{name}"
    -		write "function on#{name.upcaseFirst}(res) {\n\t// res = {#{paramNames.join ', '}}\n}"
    -		write '
    ', '
    ' + write "function on#{name.upcaseFirst}(res) {\n\t// res = {#{paramNames.join ", "}}\n}" + write "", "
    " end end diff --git a/src/LiveDevelopment/LiveDevelopment.js b/src/LiveDevelopment/LiveDevelopment.js index c094d833e2b..97b33fa418d 100644 --- a/src/LiveDevelopment/LiveDevelopment.js +++ b/src/LiveDevelopment/LiveDevelopment.js @@ -51,7 +51,7 @@ * 3: Active */ define(function LiveDevelopment(require, exports, module) { - 'use strict'; + "use strict"; var DocumentManager = require("document/DocumentManager"); var EditorManager = require("editor/EditorManager"); @@ -298,7 +298,7 @@ define(function LiveDevelopment(require, exports, module) { // For Sprint 6, we only open live development connections for HTML files // FUTURE: Remove this test when we support opening connections for different // file types. - if (!doc.extension || doc.extension.indexOf('htm') !== 0) { + if (!doc.extension || doc.extension.indexOf("htm") !== 0) { showWrongDocError(); return; } @@ -398,7 +398,7 @@ define(function LiveDevelopment(require, exports, module) { _openDocument(doc, editor); } else { /* FUTURE: support live connections for docments other than html */ - if (doc.extension && doc.extension.indexOf('htm') === 0 && doc.file.fullPath !== _htmlDocumentPath) { + if (doc.extension && doc.extension.indexOf("htm") === 0 && doc.file.fullPath !== _htmlDocumentPath) { close(); window.setTimeout(open); _htmlDocumentPath = doc.file.fullPath; diff --git a/src/LiveDevelopment/main.js b/src/LiveDevelopment/main.js index 127f667f659..b82326aaa91 100644 --- a/src/LiveDevelopment/main.js +++ b/src/LiveDevelopment/main.js @@ -36,7 +36,7 @@ * @require DocumentManager */ define(function main(require, exports, module) { - 'use strict'; + "use strict"; var DocumentManager = require("document/DocumentManager"), Commands = require("command/Commands"), diff --git a/src/brackets.js b/src/brackets.js index b2d026251c0..1c249fd0987 100644 --- a/src/brackets.js +++ b/src/brackets.js @@ -42,7 +42,7 @@ require.config({ * a global object, window.brackets. */ define(function (require, exports, module) { - 'use strict'; + "use strict"; // Load dependent non-module scripts require("widgets/bootstrap-dropdown"); @@ -133,7 +133,7 @@ define(function (require, exports, module) { // // Taken from: // http://stackoverflow.com/questions/3277182/how-to-get-the-global-object-in-javascript - var Fn = Function, global = (new Fn('return this'))(); + var Fn = Function, global = (new Fn("return this"))(); if (!global.brackets) { global.brackets = {}; } @@ -277,7 +277,7 @@ define(function (require, exports, module) { // Add the platform (mac or win) to the body tag so we can have platform-specific CSS rules $("body").addClass("platform-" + brackets.platform); - EditorManager.setEditorHolder($('#editor-holder')); + EditorManager.setEditorHolder($("#editor-holder")); // Let the user know Brackets doesn't run in a web browser yet if (brackets.inBrowser) { diff --git a/src/command/CommandManager.js b/src/command/CommandManager.js index 282099b0a27..2dc8c4c515b 100644 --- a/src/command/CommandManager.js +++ b/src/command/CommandManager.js @@ -30,7 +30,7 @@ * of the application. */ define(function (require, exports, module) { - 'use strict'; + "use strict"; /** * Map of all registered global commands diff --git a/src/command/Commands.js b/src/command/Commands.js index 57c907ea2d2..d1e5e549434 100644 --- a/src/command/Commands.js +++ b/src/command/Commands.js @@ -26,7 +26,7 @@ /*global define */ define(function (require, exports, module) { - 'use strict'; + "use strict"; /** * List of constants for global command IDs. diff --git a/src/command/KeyBindingManager.js b/src/command/KeyBindingManager.js index b0335559706..00aa897f54c 100644 --- a/src/command/KeyBindingManager.js +++ b/src/command/KeyBindingManager.js @@ -29,7 +29,7 @@ * Manages the mapping of keyboard inputs to commands. */ define(function (require, exports, module) { - 'use strict'; + "use strict"; var CommandManager = require("command/CommandManager"); diff --git a/src/command/Menus.js b/src/command/Menus.js index 104bbd986ef..66e6eece6ae 100644 --- a/src/command/Menus.js +++ b/src/command/Menus.js @@ -26,7 +26,7 @@ /*global define, $, brackets, window, MouseEvent */ define(function (require, exports, module) { - 'use strict'; + "use strict"; // Load dependent modules var Commands = require("command/Commands"), @@ -154,7 +154,7 @@ define(function (require, exports, module) { var $shortcut = $menuItem.find(".menu-shortcut"); if ($shortcut.length === 0) { - $shortcut = $(""); + $shortcut = $(""); $menuItem.append($shortcut); } @@ -378,7 +378,7 @@ define(function (require, exports, module) { // create MenuItem DOM if (name === DIVIDER) { - $menuItem = $("

  • "); + $menuItem = $("

  • "); } else { // Create the HTML Menu $menuItem = $("
  • "); diff --git a/src/debug/DebugCommandHandlers.js b/src/debug/DebugCommandHandlers.js index 15c84b88356..34beccb4788 100644 --- a/src/debug/DebugCommandHandlers.js +++ b/src/debug/DebugCommandHandlers.js @@ -26,7 +26,7 @@ /*global define, $, brackets, window */ define(function (require, exports, module) { - 'use strict'; + "use strict"; var Commands = require("command/Commands"), CommandManager = require("command/CommandManager"), diff --git a/src/document/ChangedDocumentTracker.js b/src/document/ChangedDocumentTracker.js index a364d023c0f..e2d5efa4f29 100644 --- a/src/document/ChangedDocumentTracker.js +++ b/src/document/ChangedDocumentTracker.js @@ -29,7 +29,7 @@ * Defines a ChangedDocumentTracker class to monitor changes to files in the current project. */ define(function (require, exports, module) { - 'use strict'; + "use strict"; var DocumentManager = require("document/DocumentManager"), ProjectManager = require("project/ProjectManager"); diff --git a/src/document/DocumentCommandHandlers.js b/src/document/DocumentCommandHandlers.js index a070ec6fb8d..1311125c317 100644 --- a/src/document/DocumentCommandHandlers.js +++ b/src/document/DocumentCommandHandlers.js @@ -26,7 +26,7 @@ /*global define, $, brackets, PathUtils, window */ define(function (require, exports, module) { - 'use strict'; + "use strict"; require("thirdparty/path-utils/path-utils.min"); diff --git a/src/document/DocumentManager.js b/src/document/DocumentManager.js index 76d29770e3d..c837ac4b340 100644 --- a/src/document/DocumentManager.js +++ b/src/document/DocumentManager.js @@ -65,7 +65,7 @@ * $(DocumentManager).on("eventname", handler); */ define(function (require, exports, module) { - 'use strict'; + "use strict"; var NativeFileSystem = require("file/NativeFileSystem").NativeFileSystem, ProjectManager = require("project/ProjectManager"), diff --git a/src/document/TextRange.js b/src/document/TextRange.js index d3fb0219501..fe34de5e0fe 100644 --- a/src/document/TextRange.js +++ b/src/document/TextRange.js @@ -28,7 +28,7 @@ /** */ define(function (require, exports, module) { - 'use strict'; + "use strict"; /** * @constructor diff --git a/src/editor/CSSInlineEditor.js b/src/editor/CSSInlineEditor.js index 9f8a12c8010..bd3e10839b7 100644 --- a/src/editor/CSSInlineEditor.js +++ b/src/editor/CSSInlineEditor.js @@ -26,7 +26,7 @@ /*global define, $, CodeMirror, window */ define(function (require, exports, module) { - 'use strict'; + "use strict"; // Load dependent modules var CSSUtils = require("language/CSSUtils"), diff --git a/src/editor/CodeHintManager.js b/src/editor/CodeHintManager.js index e2afbb8e4d7..fb2289bc50e 100644 --- a/src/editor/CodeHintManager.js +++ b/src/editor/CodeHintManager.js @@ -26,7 +26,7 @@ /*global define, $, window */ define(function (require, exports, module) { - 'use strict'; + "use strict"; // Load dependent modules var HTMLUtils = require("language/HTMLUtils"), diff --git a/src/editor/Editor.js b/src/editor/Editor.js index 3df0e351388..c38dc5000cc 100644 --- a/src/editor/Editor.js +++ b/src/editor/Editor.js @@ -59,7 +59,7 @@ * $(editorInstance).on("eventname", handler); */ define(function (require, exports, module) { - 'use strict'; + "use strict"; var EditorManager = require("editor/EditorManager"), Commands = require("command/Commands"), diff --git a/src/editor/EditorCommandHandlers.js b/src/editor/EditorCommandHandlers.js index e0d7c9edb39..9af5e93e237 100644 --- a/src/editor/EditorCommandHandlers.js +++ b/src/editor/EditorCommandHandlers.js @@ -29,7 +29,7 @@ * Text-editing commands that apply to whichever Editor is currently focused */ define(function (require, exports, module) { - 'use strict'; + "use strict"; // Load dependent modules var Commands = require("command/Commands"), diff --git a/src/editor/EditorManager.js b/src/editor/EditorManager.js index fad857bc88c..4fc11b8ad61 100644 --- a/src/editor/EditorManager.js +++ b/src/editor/EditorManager.js @@ -38,7 +38,7 @@ * - focusedEditorChange -- When the focused editor (full or inline) changes and size/visibility are complete. */ define(function (require, exports, module) { - 'use strict'; + "use strict"; // Load dependent modules var FileUtils = require("file/FileUtils"), diff --git a/src/editor/EditorUtils.js b/src/editor/EditorUtils.js index aa85ed2addb..e0f568dfa48 100644 --- a/src/editor/EditorUtils.js +++ b/src/editor/EditorUtils.js @@ -29,7 +29,7 @@ * Set of utilites for working with the code editor */ define(function (require, exports, module) { - 'use strict'; + "use strict"; require("thirdparty/path-utils/path-utils.min"); require("thirdparty/CodeMirror2/mode/xml/xml"); @@ -59,7 +59,7 @@ define(function (require, exports, module) { if (!ext) { ext = fileUrl; } - if (ext.charAt(0) === '.') { + if (ext.charAt(0) === ".") { ext = ext.substr(1); } diff --git a/src/editor/InlineTextEditor.js b/src/editor/InlineTextEditor.js index d91b3458e53..8f1bb7cf889 100644 --- a/src/editor/InlineTextEditor.js +++ b/src/editor/InlineTextEditor.js @@ -27,7 +27,7 @@ /*global define, $, CodeMirror, window */ define(function (require, exports, module) { - 'use strict'; + "use strict"; // Load dependent modules var DocumentManager = require("document/DocumentManager"), diff --git a/src/editor/InlineWidget.js b/src/editor/InlineWidget.js index 2d935aac344..1b28bf59250 100644 --- a/src/editor/InlineWidget.js +++ b/src/editor/InlineWidget.js @@ -26,7 +26,7 @@ /*global define, $, CodeMirror, window */ define(function (require, exports, module) { - 'use strict'; + "use strict"; // Load dependent modules var EditorManager = require("editor/EditorManager"); @@ -39,8 +39,8 @@ define(function (require, exports, module) { // create the outer wrapper div this.htmlContent = window.document.createElement("div"); this.$htmlContent = $(this.htmlContent).addClass("inline-widget"); - this.$htmlContent.append('
    ') - .append('
    '); + this.$htmlContent.append("
    ") + .append("
    "); } InlineWidget.prototype.htmlContent = null; InlineWidget.prototype.$htmlContent = null; diff --git a/src/editor/MultiRangeInlineEditor.js b/src/editor/MultiRangeInlineEditor.js index 112ee5a4858..4f96dbe0565 100644 --- a/src/editor/MultiRangeInlineEditor.js +++ b/src/editor/MultiRangeInlineEditor.js @@ -37,7 +37,7 @@ */ define(function (require, exports, module) { - 'use strict'; + "use strict"; // Load dependent modules var TextRange = require("document/TextRange").TextRange, @@ -125,7 +125,7 @@ define(function (require, exports, module) { this._onClick = this._onClick.bind(this); // Create DOM to hold editors and related list - this.$editorsDiv = $(window.document.createElement('div')).addClass("inlineEditorHolder"); + this.$editorsDiv = $(window.document.createElement("div")).addClass("inlineEditorHolder"); // Outer container for border-left and scrolling this.$relatedContainer = $(window.document.createElement("div")).addClass("related-container"); diff --git a/src/extensions/default/JavaScriptQuickEdit/main.js b/src/extensions/default/JavaScriptQuickEdit/main.js index 44df6927e50..463fc078140 100644 --- a/src/extensions/default/JavaScriptQuickEdit/main.js +++ b/src/extensions/default/JavaScriptQuickEdit/main.js @@ -26,7 +26,7 @@ /*global define, brackets, $ */ define(function (require, exports, module) { - 'use strict'; + "use strict"; // Brackets modules var MultiRangeInlineEditor = brackets.getModule("editor/MultiRangeInlineEditor").MultiRangeInlineEditor, diff --git a/src/extensions/default/JavaScriptQuickEdit/unittests.js b/src/extensions/default/JavaScriptQuickEdit/unittests.js index ddfc2c2b2d4..cfd30658fa3 100644 --- a/src/extensions/default/JavaScriptQuickEdit/unittests.js +++ b/src/extensions/default/JavaScriptQuickEdit/unittests.js @@ -26,7 +26,7 @@ /*global define, describe, it, xit, expect, beforeEach, afterEach, waitsFor, runs, $, brackets, waitsForDone */ define(function (require, exports, module) { - 'use strict'; + "use strict"; var CommandManager, // loaded from brackets.test EditorManager, // loaded from brackets.test @@ -337,7 +337,7 @@ define(function (require, exports, module) { ]; runs(function () { - extensionRequire = testWindow.brackets.getModule('utils/ExtensionLoader').getRequireContextForExtension('JavaScriptQuickEdit'); + extensionRequire = testWindow.brackets.getModule("utils/ExtensionLoader").getRequireContextForExtension("JavaScriptQuickEdit"); JavaScriptQuickEdit = extensionRequire("main"); waitsForDone(SpecRunnerUtils.openProjectFiles(["ui/jquery.effects.core.js"]), "openProjectFiles"); diff --git a/src/extensions/default/QuickOpenCSS/main.js b/src/extensions/default/QuickOpenCSS/main.js index 0d24060c65c..ad7615c81ed 100644 --- a/src/extensions/default/QuickOpenCSS/main.js +++ b/src/extensions/default/QuickOpenCSS/main.js @@ -27,7 +27,7 @@ define(function (require, exports, module) { - 'use strict'; + "use strict"; var EditorManager = brackets.getModule("editor/EditorManager"), QuickOpen = brackets.getModule("search/QuickOpen"), diff --git a/src/extensions/default/QuickOpenHTML/main.js b/src/extensions/default/QuickOpenHTML/main.js index e7582514e99..8b8b705ef02 100644 --- a/src/extensions/default/QuickOpenHTML/main.js +++ b/src/extensions/default/QuickOpenHTML/main.js @@ -27,7 +27,7 @@ define(function (require, exports, module) { - 'use strict'; + "use strict"; var EditorManager = brackets.getModule("editor/EditorManager"), QuickOpen = brackets.getModule("search/QuickOpen"), diff --git a/src/extensions/default/QuickOpenJavaScript/main.js b/src/extensions/default/QuickOpenJavaScript/main.js index 4fc7f610186..be4609d7b06 100644 --- a/src/extensions/default/QuickOpenJavaScript/main.js +++ b/src/extensions/default/QuickOpenJavaScript/main.js @@ -27,7 +27,7 @@ define(function (require, exports, module) { - 'use strict'; + "use strict"; var EditorManager = brackets.getModule("editor/EditorManager"), QuickOpen = brackets.getModule("search/QuickOpen"), diff --git a/src/extensions/disabled/ContextMenuTest/main.js b/src/extensions/disabled/ContextMenuTest/main.js index de6aef38025..0252315dda2 100644 --- a/src/extensions/disabled/ContextMenuTest/main.js +++ b/src/extensions/disabled/ContextMenuTest/main.js @@ -26,7 +26,7 @@ /*global define, brackets, $ */ define(function (require, exports, module) { - 'use strict'; + "use strict"; // Brackets modules var CommandManager = brackets.getModule("command/CommandManager"), diff --git a/src/extensions/disabled/InlineImageViewer/main.js b/src/extensions/disabled/InlineImageViewer/main.js index 13074668a07..f36472362aa 100644 --- a/src/extensions/disabled/InlineImageViewer/main.js +++ b/src/extensions/disabled/InlineImageViewer/main.js @@ -26,7 +26,7 @@ /*global define, brackets, $ */ define(function (require, exports, module) { - 'use strict'; + "use strict"; // Brackets modules var EditorManager = brackets.getModule("editor/EditorManager"), diff --git a/src/extensions/disabled/TypingSpeedLogger/main.js b/src/extensions/disabled/TypingSpeedLogger/main.js index ed52d0bbe3d..6dbff09fdcf 100644 --- a/src/extensions/disabled/TypingSpeedLogger/main.js +++ b/src/extensions/disabled/TypingSpeedLogger/main.js @@ -26,7 +26,7 @@ /*global define, brackets, $, window */ define(function (require, exports, module) { - 'use strict'; + "use strict"; var EditorManager = brackets.getModule("editor/EditorManager"), PerfUtils = brackets.getModule("utils/PerfUtils"); diff --git a/src/extensions/disabled/circular_dependency_test/main.js b/src/extensions/disabled/circular_dependency_test/main.js index ec1c562aaad..52e69cf1cf1 100644 --- a/src/extensions/disabled/circular_dependency_test/main.js +++ b/src/extensions/disabled/circular_dependency_test/main.js @@ -26,7 +26,7 @@ /*global define, $ */ define(function (require, exports, module) { - 'use strict'; + "use strict"; console.log("loading foo!"); diff --git a/src/extensions/disabled/circular_dependency_test/secondary.js b/src/extensions/disabled/circular_dependency_test/secondary.js index 890af6d1407..ef3f4bc1bfd 100644 --- a/src/extensions/disabled/circular_dependency_test/secondary.js +++ b/src/extensions/disabled/circular_dependency_test/secondary.js @@ -26,7 +26,7 @@ /*global define, $, window */ define(function (require, exports, module) { - 'use strict'; + "use strict"; console.log("and a file that foo depends on!"); diff --git a/src/file/FileUtils.js b/src/file/FileUtils.js index 38fc8a6d7be..92a8ea33c79 100644 --- a/src/file/FileUtils.js +++ b/src/file/FileUtils.js @@ -29,7 +29,7 @@ * Set of utilites for working with files and text content. */ define(function (require, exports, module) { - 'use strict'; + "use strict"; var NativeFileSystem = require("file/NativeFileSystem").NativeFileSystem, PerfUtils = require("utils/PerfUtils"), diff --git a/src/file/NativeFileSystem.js b/src/file/NativeFileSystem.js index fb684126876..834d3455a9b 100644 --- a/src/file/NativeFileSystem.js +++ b/src/file/NativeFileSystem.js @@ -25,7 +25,7 @@ /*global $, define, brackets, FileError, InvalidateStateError */ define(function (require, exports, module) { - 'use strict'; + "use strict"; var Async = require("utils/Async"); @@ -189,7 +189,7 @@ define(function (require, exports, module) { if (fullPath) { // add trailing "/" to directory paths - if (isDirectory && (fullPath.charAt(fullPath.length - 1) !== '/')) { + if (isDirectory && (fullPath.charAt(fullPath.length - 1) !== "/")) { fullPath = fullPath.concat("/"); } } diff --git a/src/language/CSSUtils.js b/src/language/CSSUtils.js index 186c6f9e70d..1f34d645a71 100644 --- a/src/language/CSSUtils.js +++ b/src/language/CSSUtils.js @@ -32,7 +32,7 @@ * Set of utilities for simple parsing of CSS text. */ define(function (require, exports, module) { - 'use strict'; + "use strict"; var Async = require("utils/Async"), DocumentManager = require("document/DocumentManager"), @@ -255,7 +255,7 @@ define(function (require, exports, module) { if (ruleStartChar !== -1) { return false; // already included } - if (stream.start > 0 && lines[line].substr(0, stream.start).indexOf('}') !== -1) { + if (stream.start > 0 && lines[line].substr(0, stream.start).indexOf("}") !== -1) { return false; // on same line as '}', so it's for previous rule } return true; diff --git a/src/language/HTMLUtils.js b/src/language/HTMLUtils.js index 6db950d07c6..c399209d9c4 100644 --- a/src/language/HTMLUtils.js +++ b/src/language/HTMLUtils.js @@ -26,7 +26,7 @@ /*global define, $ */ define(function (require, exports, module) { - 'use strict'; + "use strict"; //constants var TAG_NAME = "tagName", @@ -141,7 +141,7 @@ define(function (require, exports, module) { //If this is a fully quoted value, return the whole //thing regardless of position if (attrValue.length > 1 && - (startChar === "'" || startChar === '"') && + (startChar === "'" || startChar === "\"") && endChar === startChar) { //strip the quotes and return; attrValue = attrValue.substring(1, attrValue.length - 1); @@ -159,7 +159,7 @@ define(function (require, exports, module) { //If the attrValue start with a quote, trim that now startChar = attrValue.charAt(0); - if (startChar === "'" || startChar === '"') { + if (startChar === "'" || startChar === "\"") { attrValue = attrValue.substring(1); offset--; } @@ -330,7 +330,7 @@ define(function (require, exports, module) { if (ctx.token.className === "tag") { //check to see if this is the closing of a tag (either the start or end) if (ctx.token.string === ">" || - (ctx.token.string.charAt(0) === '<' && ctx.token.string.charAt(1) === '/')) { + (ctx.token.string.charAt(0) === "<" && ctx.token.string.charAt(1) === "/")) { return createTagInfo(); } diff --git a/src/language/JSLintUtils.js b/src/language/JSLintUtils.js index b7bf88e0763..47710c5666d 100644 --- a/src/language/JSLintUtils.js +++ b/src/language/JSLintUtils.js @@ -30,7 +30,7 @@ * */ define(function (require, exports, module) { - 'use strict'; + "use strict"; // Load dependent non-module scripts require("thirdparty/path-utils/path-utils.min"); @@ -99,7 +99,7 @@ define(function (require, exports, module) { perfTimerDOM = PerfUtils.markStart("JSLint DOM:\t" + (!currentDoc || currentDoc.file.fullPath)); if (!result) { - var $errorTable = $("") + var $errorTable = $("
    ") .append(""); var $selectedRow; diff --git a/src/language/JSUtils.js b/src/language/JSUtils.js index 1e6a87da3c3..902828ec574 100644 --- a/src/language/JSUtils.js +++ b/src/language/JSUtils.js @@ -28,7 +28,7 @@ * Set of utilities for simple parsing of JS text. */ define(function (require, exports, module) { - 'use strict'; + "use strict"; // Load brackets modules var Async = require("utils/Async"), diff --git a/src/preferences/PreferenceStorage.js b/src/preferences/PreferenceStorage.js index a858e054c33..7780cb4b46d 100644 --- a/src/preferences/PreferenceStorage.js +++ b/src/preferences/PreferenceStorage.js @@ -29,7 +29,7 @@ * name/value pairs for a module or plugin. */ define(function (require, exports, module) { - 'use strict'; + "use strict"; var PreferencesManager = require("preferences/PreferencesManager"); diff --git a/src/preferences/PreferencesManager.js b/src/preferences/PreferencesManager.js index 434ae96794b..9e3f1bdd199 100644 --- a/src/preferences/PreferencesManager.js +++ b/src/preferences/PreferencesManager.js @@ -30,7 +30,7 @@ * */ define(function (require, exports, module) { - 'use strict'; + "use strict"; var PreferenceStorage = require("preferences/PreferenceStorage").PreferenceStorage; diff --git a/src/project/FileIndexManager.js b/src/project/FileIndexManager.js index a28f28748bd..773b91c2cda 100644 --- a/src/project/FileIndexManager.js +++ b/src/project/FileIndexManager.js @@ -37,7 +37,7 @@ define(function (require, exports, module) { - 'use strict'; + "use strict"; var NativeFileSystem = require("file/NativeFileSystem").NativeFileSystem, PerfUtils = require("utils/PerfUtils"), diff --git a/src/project/FileSyncManager.js b/src/project/FileSyncManager.js index 4ad00ca28e1..958d95af599 100644 --- a/src/project/FileSyncManager.js +++ b/src/project/FileSyncManager.js @@ -37,7 +37,7 @@ * DocumentManager directly. DocumentManager, the tree UI, etc. then all listen to that model for changes. */ define(function (require, exports, module) { - 'use strict'; + "use strict"; // Load dependent modules var ProjectManager = require("project/ProjectManager"), diff --git a/src/project/FileViewController.js b/src/project/FileViewController.js index 7eba73badf3..890f95c7faf 100644 --- a/src/project/FileViewController.js +++ b/src/project/FileViewController.js @@ -39,7 +39,7 @@ */ define(function (require, exports, module) { - 'use strict'; + "use strict"; // Load dependent modules var DocumentManager = require("document/DocumentManager"), diff --git a/src/project/ProjectManager.js b/src/project/ProjectManager.js index 167f113d8f3..d5b5898179f 100644 --- a/src/project/ProjectManager.js +++ b/src/project/ProjectManager.js @@ -37,7 +37,7 @@ * $(ProjectManager).on("eventname", handler); */ define(function (require, exports, module) { - 'use strict'; + "use strict"; // Load dependent non-module scripts require("thirdparty/jstree_pre1.0_fix_1/jquery.jstree"); diff --git a/src/project/SidebarView.js b/src/project/SidebarView.js index 02c6222051d..43a7425575d 100644 --- a/src/project/SidebarView.js +++ b/src/project/SidebarView.js @@ -26,7 +26,7 @@ /*global define, $, document, window */ define(function (require, exports, module) { - 'use strict'; + "use strict"; var ProjectManager = require("project/ProjectManager"), WorkingSetView = require("project/WorkingSetView"), diff --git a/src/project/WorkingSetView.js b/src/project/WorkingSetView.js index f1511030550..a99c0054147 100644 --- a/src/project/WorkingSetView.js +++ b/src/project/WorkingSetView.js @@ -30,7 +30,7 @@ * The UI allows the user to see what files are open/dirty and allows them to close files and specify the current editor. */ define(function (require, exports, module) { - 'use strict'; + "use strict"; // Load dependent modules var DocumentManager = require("document/DocumentManager"), diff --git a/src/search/FindInFiles.js b/src/search/FindInFiles.js index 6c5cb765c06..2c0d8304f00 100644 --- a/src/search/FindInFiles.js +++ b/src/search/FindInFiles.js @@ -40,7 +40,7 @@ define(function (require, exports, module) { - 'use strict'; + "use strict"; var Async = require("utils/Async"), CommandManager = require("command/CommandManager"), @@ -72,7 +72,7 @@ define(function (require, exports, module) { var wrap = $("#editor-holder")[0]; this.dialog = wrap.insertBefore(window.document.createElement("div"), wrap.firstChild); this.dialog.className = "CodeMirror-dialog"; - this.dialog.innerHTML = '
    ' + template + '
    '; + this.dialog.innerHTML = "
    " + template + "
    "; }; /** @@ -95,10 +95,10 @@ define(function (require, exports, module) { * @returns {$.Promise} that is resolved with the string to search for */ FindInFilesDialog.prototype.showDialog = function (initialString) { - var dialogHTML = 'Find in Files: (Use /re/ syntax for regexp search)'; + var dialogHTML = "Find in Files: (Use /re/ syntax for regexp search)"; this.result = new $.Deferred(); this._createDialogDiv(dialogHTML); - var $searchField = $('input#findInFilesInput'); + var $searchField = $("input#findInFilesInput"); var that = this; $searchField.attr("value", initialString || ""); @@ -164,7 +164,7 @@ define(function (require, exports, module) { var $searchResultsDiv = $("#search-results"); if (searchResults && searchResults.length) { - var $resultTable = $("
    ") + var $resultTable = $("
    ") .append(""); // Count the total number of matches diff --git a/src/search/QuickOpen.js b/src/search/QuickOpen.js index 90e9a0c651f..ede73426de2 100644 --- a/src/search/QuickOpen.js +++ b/src/search/QuickOpen.js @@ -39,7 +39,7 @@ define(function (require, exports, module) { - 'use strict'; + "use strict"; var FileIndexManager = require("project/FileIndexManager"), DocumentManager = require("document/DocumentManager"), @@ -444,7 +444,7 @@ define(function (require, exports, module) { function _handleResultsFormatter(item) { - var query = $('input#quickOpenSearch').val(); + var query = $("input#quickOpenSearch").val(); if (currentPlugin) { // Plugins use their own formatter or the default formatter @@ -468,7 +468,7 @@ define(function (require, exports, module) { } return "
  • " + displayName + - "
    " + rPath + "
  • "; + "
    " + rPath + ""; } } @@ -479,7 +479,7 @@ define(function (require, exports, module) { initialString = prefix + initialString; - var $field = $('input#quickOpenSearch'); + var $field = $("input#quickOpenSearch"); if ($field) { $field.val(initialString); $field.get(0).setSelectionRange(prefix.length, initialString.length); @@ -527,9 +527,9 @@ define(function (require, exports, module) { FileIndexManager.getFileInfoList("all") .done(function (files) { fileList = files; - var dialogHTML = 'Quick Open: '; + var dialogHTML = "Quick Open: "; that._createDialogDiv(dialogHTML); - that.$searchField = $('input#quickOpenSearch'); + that.$searchField = $("input#quickOpenSearch"); that.$searchField.smartAutoComplete({ diff --git a/src/strings.js b/src/strings.js index 90798dd339a..dc459e77dbb 100644 --- a/src/strings.js +++ b/src/strings.js @@ -26,7 +26,7 @@ define(function (require, exports, module) { - 'use strict'; + "use strict"; // General file io error strings exports.GENERIC_ERROR = "(error {0})"; @@ -73,7 +73,7 @@ define(function (require, exports, module) { exports.LIVE_DEVELOPMENT_ERROR_TITLE = "Live Development Error"; exports.LIVE_DEVELOPMENT_ERROR_MESSAGE = "A live development connection to Chrome could not be established. " + "For live development to work, Chrome needs to be started with remote debugging enabled." - + "

    Would you like to relaunch Chrome and enable remote debugging?"; + + "

    Would you like to relaunch Chrome and enable remote debugging?"; exports.LIVE_DEV_NEED_HTML_MESSAGE = "Open an HTML file in order to launch live preview."; exports.LIVE_DEV_STATUS_TIP_NOT_CONNECTED = "Live File Preview"; @@ -86,10 +86,10 @@ define(function (require, exports, module) { exports.SAVE_CLOSE_MULTI_MESSAGE = "Do you want to save your changes to the following files?"; exports.EXT_MODIFIED_TITLE = "External Changes"; exports.EXT_MODIFIED_MESSAGE = "{0} has been modified on disk, but also has unsaved changes in Brackets." - + "

    " + + "

    " + "Which version do you want to keep?"; exports.EXT_DELETED_MESSAGE = "{0} has been deleted on disk, but has unsaved changes in Brackets." - + "

    " + + "

    " + "Do you want to keep your changes?"; exports.OPEN_FILE = "Open File"; diff --git a/src/thirdparty/CodeMirror2 b/src/thirdparty/CodeMirror2 deleted file mode 160000 index 9fa9ea78fb2..00000000000 --- a/src/thirdparty/CodeMirror2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9fa9ea78fb2278fdb95d72fa035422548e91afa5 diff --git a/src/utils/Async.js b/src/utils/Async.js index 18b238838c6..e56dd27faae 100644 --- a/src/utils/Async.js +++ b/src/utils/Async.js @@ -29,7 +29,7 @@ * Utilities for working with Deferred, Promise, and other asynchronous processes. */ define(function (require, exports, module) { - 'use strict'; + "use strict"; // Further ideas for Async utilities... // - Utilities for blocking UI until a Promise completes? diff --git a/src/utils/BuildInfoUtils.js b/src/utils/BuildInfoUtils.js index 987b59eedf1..6ce84df65f2 100644 --- a/src/utils/BuildInfoUtils.js +++ b/src/utils/BuildInfoUtils.js @@ -29,7 +29,7 @@ * Utilities for determining the current "build number" / version */ define(function (require, exports, module) { - 'use strict'; + "use strict"; var NativeFileSystem = require("file/NativeFileSystem").NativeFileSystem, FileUtils = require("file/FileUtils"); diff --git a/src/utils/ExtensionLoader.js b/src/utils/ExtensionLoader.js index fab0783dd60..954e2f08980 100644 --- a/src/utils/ExtensionLoader.js +++ b/src/utils/ExtensionLoader.js @@ -30,7 +30,7 @@ */ define(function (require, exports, module) { - 'use strict'; + "use strict"; var NativeFileSystem = require("file/NativeFileSystem").NativeFileSystem, FileUtils = require("file/FileUtils"), diff --git a/src/utils/ExtensionUtils.js b/src/utils/ExtensionUtils.js index c894be03df1..dae8570d4e6 100644 --- a/src/utils/ExtensionUtils.js +++ b/src/utils/ExtensionUtils.js @@ -29,7 +29,7 @@ * ExtensionUtils defines utility methods for implementing extensions. */ define(function (require, exports, module) { - 'use strict'; + "use strict"; /** * Loads a style sheet relative to the extension module. diff --git a/src/utils/NativeApp.js b/src/utils/NativeApp.js index 209497b42a0..084b957c54c 100644 --- a/src/utils/NativeApp.js +++ b/src/utils/NativeApp.js @@ -25,7 +25,7 @@ /*global $, define, brackets, FileError */ define(function (require, exports, module) { - 'use strict'; + "use strict"; var Async = require("utils/Async"); diff --git a/src/utils/PerfUtils.js b/src/utils/PerfUtils.js index d248ccf5b51..207c880b0a4 100644 --- a/src/utils/PerfUtils.js +++ b/src/utils/PerfUtils.js @@ -28,7 +28,7 @@ * This is a collection of utility functions for gathering performance data. */ define(function (require, exports, module) { - 'use strict'; + "use strict"; /** * Flag to enable/disable performance data gathering. Default is true (enabled) diff --git a/src/utils/ShellAPI.js b/src/utils/ShellAPI.js index d406f09455b..315b53b6eeb 100644 --- a/src/utils/ShellAPI.js +++ b/src/utils/ShellAPI.js @@ -29,7 +29,7 @@ * This is JavaScript API exposed to the native shell when Brackets is run in a native shell rather than a browser. */ define(function (require, exports, module) { - 'use strict'; + "use strict"; // Load dependent modules var CommandManager = require("command/CommandManager"); diff --git a/src/utils/StringUtils.js b/src/utils/StringUtils.js index cb9eaa1cb6e..610e149912a 100644 --- a/src/utils/StringUtils.js +++ b/src/utils/StringUtils.js @@ -29,7 +29,7 @@ * */ define(function (require, exports, module) { - 'use strict'; + "use strict"; /** * Format a string by replacing placeholder symbols with passed in arguments. @@ -45,17 +45,17 @@ define(function (require, exports, module) { // arguments[0] is the base string, so we need to adjust index values here var args = [].slice.call(arguments, 1); return str.replace(/\{(\d+)\}/g, function (match, num) { - return typeof args[num] !== 'undefined' ? args[num] : match; + return typeof args[num] !== "undefined" ? args[num] : match; }); } function htmlEscape(str) { return String(str) - .replace(/&/g, '&') - .replace(/"/g, '"') - .replace(/'/g, ''') - .replace(//g, '>'); + .replace(/&/g, "&") + .replace(/"/g, """) + .replace(/"/g, "'") + .replace(//g, ">"); } function regexEscape(str) { diff --git a/src/utils/ViewUtils.js b/src/utils/ViewUtils.js index bb8c1611cf6..e8ade4beb64 100644 --- a/src/utils/ViewUtils.js +++ b/src/utils/ViewUtils.js @@ -26,7 +26,7 @@ /*global define, $, window */ define(function (require, exports, module) { - 'use strict'; + "use strict"; var SCROLL_SHADOW_HEIGHT = 5; diff --git a/src/view/ViewCommandHandlers.js b/src/view/ViewCommandHandlers.js index 4c9de2fbb4d..2e67402ed37 100644 --- a/src/view/ViewCommandHandlers.js +++ b/src/view/ViewCommandHandlers.js @@ -25,7 +25,7 @@ /*global define, window, $ */ define(function (require, exports, module) { - 'use strict'; + "use strict"; var Commands = require("command/Commands"), CommandManager = require("command/CommandManager"), diff --git a/src/widgets/Dialogs.js b/src/widgets/Dialogs.js index 0f53cc47db8..ea4b919e70c 100644 --- a/src/widgets/Dialogs.js +++ b/src/widgets/Dialogs.js @@ -29,7 +29,7 @@ * Utilities for creating and managing standard modal dialogs. */ define(function (require, exports, module) { - 'use strict'; + "use strict"; var KeyBindingManager = require("command/KeyBindingManager"); @@ -71,7 +71,7 @@ define(function (require, exports, module) { this.find(".dialog-button:focus").click(); } else if (brackets.platform === "mac") { // CMD+D Don't Save - if (e.metaKey && (which === 'D')) { + if (e.metaKey && (which === "D")) { if (_hasButton(this, DIALOG_BTN_DONTSAVE)) { buttonId = DIALOG_BTN_DONTSAVE; } @@ -81,7 +81,7 @@ define(function (require, exports, module) { } } else { // if (brackets.platform === "win") { // 'N' Don't Save - if (which === 'N') { + if (which === "N") { if (_hasButton(this, DIALOG_BTN_DONTSAVE)) { buttonId = DIALOG_BTN_DONTSAVE; } From 3de273a943fe0399f78f0aff60f648226cf0b32e Mon Sep 17 00:00:00 2001 From: Jon Wolfe Date: Mon, 9 Jul 2012 14:04:37 -0400 Subject: [PATCH 2/4] Fix some incorrect quotes --- src/language/HTMLUtils.js | 4 ++-- src/utils/StringUtils.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/language/HTMLUtils.js b/src/language/HTMLUtils.js index c399209d9c4..7e016c0848d 100644 --- a/src/language/HTMLUtils.js +++ b/src/language/HTMLUtils.js @@ -141,7 +141,7 @@ define(function (require, exports, module) { //If this is a fully quoted value, return the whole //thing regardless of position if (attrValue.length > 1 && - (startChar === "'" || startChar === "\"") && + (startChar === "'" || startChar === '"') && endChar === startChar) { //strip the quotes and return; attrValue = attrValue.substring(1, attrValue.length - 1); @@ -159,7 +159,7 @@ define(function (require, exports, module) { //If the attrValue start with a quote, trim that now startChar = attrValue.charAt(0); - if (startChar === "'" || startChar === "\"") { + if (startChar === "'" || startChar === '"') { attrValue = attrValue.substring(1); offset--; } diff --git a/src/utils/StringUtils.js b/src/utils/StringUtils.js index 610e149912a..21ef65a48f2 100644 --- a/src/utils/StringUtils.js +++ b/src/utils/StringUtils.js @@ -53,7 +53,7 @@ define(function (require, exports, module) { return String(str) .replace(/&/g, "&") .replace(/"/g, """) - .replace(/"/g, "'") + .replace(/'/g, "'") .replace(//g, ">"); } From 419c09d5809cdb3a270394cf2098d8aca631bbcf Mon Sep 17 00:00:00 2001 From: Jon Wolfe Date: Mon, 9 Jul 2012 14:54:32 -0400 Subject: [PATCH 3/4] Updated quotes and syntax to fix errors --- src/LiveDevelopment/Inspector/jsdoc.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/LiveDevelopment/Inspector/jsdoc.rb b/src/LiveDevelopment/Inspector/jsdoc.rb index 393f99d6ebf..4cf1f96c012 100644 --- a/src/LiveDevelopment/Inspector/jsdoc.rb +++ b/src/LiveDevelopment/Inspector/jsdoc.rb @@ -53,13 +53,13 @@ def upcaseFirst class JSDoc def typedef(domain, info) - return "[" + typedef(domain, info["items"]) + "]" if info["items"] + return "[" + typedef(domain, info['items']) + "]" if info['items'] if info["$ref"] ref = info["$ref"] ref = domain + "." + ref unless ref =~ /\./ r = "#{ref}" if info["$ref"] elsif info["enum"] - r = "( #{info["enum"].join " | "} )" + r = "( #{info['enum'].join " | "} )" else r = info["type"].upcaseFirst end @@ -74,7 +74,7 @@ def initialize(input, output) def open @in = JSON.parse(File.open(@input).read) @in["domains"].sort! { |a,b| a["domain"] <=> b["domain"] } - @version = "#{@in["version"]["major"]}.#{@in["version"]["minor"]}" + @version = "#{@in['version']['major']}.#{@in['version']['minor']}" File.open(@output, "w") do |out| @out = out yield @@ -100,9 +100,9 @@ def writeParams(domain, params, prefixLine = false) write "
    " params.each do |p| name = p["name"] - description = " #{p["description"]}" if p["description"] + description = " #{p['description']}" if p['description'] type = typedef domain, p - name += " (optional)" if p["optional"] + name += " (optional)" if p['optional'] write "
    #{name}
    " write "
    #{type}#{description}
    " end @@ -111,25 +111,25 @@ def writeParams(domain, params, prefixLine = false) def writeTOCLine(domain, info) info["name"] ||= info["id"] - uid = "#{domain}.#{info["name"]}" - description = info["description"] ? ": #{info["description"].gsub(/<[^>]*>/, "")}" : "" + uid = "#{domain}.#{info['name']}" + description = info['description'] ? ": #{info['description'].gsub(/<[^>]*>/, "")}" : "" write "
  • #{uid}#{description}
  • " end def writeTOCDomain(info) domain = info["domain"] unless info["types"].empty? - write "Type", "
      " + write "Type", "
        " info["types"].each { |p| writeTOCLine domain, p } write "
      " end unless info["commands"].empty? - write "Command", "
        " + write "Command", "
          " info["commands"].each { |p| writeTOCLine domain, p } write "
        " end unless info["events"].empty? - write "Event", "
          " + write "Event", "
            " info["events"].each { |p| writeTOCLine domain, p } write "
          " end @@ -204,7 +204,7 @@ def writeDocument end def writeTOC - write "
          ", "

          Table of Contents

          " + write "
          ", "

          Table of Contents

          " @in["domains"].each do |info| domain = info["domain"] write "

          #{info['domain']}

          " From a305af351b5dc0c9b688d9b06a204ac8468511d3 Mon Sep 17 00:00:00 2001 From: Jon Wolfe Date: Mon, 9 Jul 2012 15:44:34 -0400 Subject: [PATCH 4/4] Fixing nested single quotes. Reverted to escaped nested doubles around single. --- src/LiveDevelopment/Inspector/jsdoc.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LiveDevelopment/Inspector/jsdoc.rb b/src/LiveDevelopment/Inspector/jsdoc.rb index 4cf1f96c012..ed4467032a5 100644 --- a/src/LiveDevelopment/Inspector/jsdoc.rb +++ b/src/LiveDevelopment/Inspector/jsdoc.rb @@ -207,7 +207,7 @@ def writeTOC write "
          ", "

          Table of Contents

          " @in["domains"].each do |info| domain = info["domain"] - write "

          #{info['domain']}

          " + write "

          #{info['domain']}

          " writeTOCDomain info end write "
          "