diff --git a/src/LiveDevelopment/main.js b/src/LiveDevelopment/main.js index 96b68c1fba3..318f8e7bf0e 100644 --- a/src/LiveDevelopment/main.js +++ b/src/LiveDevelopment/main.js @@ -1,24 +1,24 @@ /* * Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - * + * */ @@ -142,7 +142,7 @@ define(function main(require, exports, module) { /** Called on status change */ function _showStatusChangeReason(reason) { - // Destroy the previous twipsy (options are not updated otherwise) + // Destroy the previous twipsy (options are not updated otherwise) _$btnGoLive.twipsy("hide").removeData("twipsy"); // If there was no reason or the action was an explicit request by the user, don't show a twipsy @@ -178,7 +178,7 @@ define(function main(require, exports, module) { }); $(LiveDevelopment).on("statusChange", function statusChange(event, status, reason) { // status starts at -1 (error), so add one when looking up name and style - // See the comments at the top of LiveDevelopment.js for details on the + // See the comments at the top of LiveDevelopment.js for details on the // various status codes. _setLabel(_$btnGoLive, null, _statusStyle[status + 1], _statusTooltip[status + 1]); _showStatusChangeReason(reason); @@ -195,7 +195,7 @@ define(function main(require, exports, module) { function _setupGoLiveMenu() { $(LiveDevelopment).on("statusChange", function statusChange(event, status) { // Update the checkmark next to 'Live Preview' menu item - // Add checkmark when status is STATUS_ACTIVE; otherwise remove it + // Add checkmark when status is STATUS_ACTIVE; otherwise remove it CommandManager.get(Commands.FILE_LIVE_FILE_PREVIEW).setChecked(status === LiveDevelopment.STATUS_ACTIVE); CommandManager.get(Commands.FILE_LIVE_HIGHLIGHT).setEnabled(status === LiveDevelopment.STATUS_ACTIVE); }); @@ -257,8 +257,6 @@ define(function main(require, exports, module) { // init prefs prefs = PreferencesManager.getPreferenceStorage(module, {highlight: true}); - //TODO: Remove preferences migration code - PreferencesManager.handleClientIdChange(prefs, "com.adobe.brackets.live-development"); config.highlight = prefs.getValue("highlight"); diff --git a/src/brackets.js b/src/brackets.js index cde040b4184..16fa64ce559 100644 --- a/src/brackets.js +++ b/src/brackets.js @@ -216,8 +216,6 @@ define(function (require, exports, module) { // an old version that might not have set the "afterFirstLaunch" pref.) var prefs = PreferencesManager.getPreferenceStorage(module), deferred = new $.Deferred(); - //TODO: Remove preferences migration code - PreferencesManager.handleClientIdChange(prefs, "com.adobe.brackets.startup"); if (!params.get("skipSampleProjectLoad") && !prefs.getValue("afterFirstLaunch")) { prefs.setValue("afterFirstLaunch", "true"); diff --git a/src/document/DocumentManager.js b/src/document/DocumentManager.js index 37e1f0785f0..9b4b498b94a 100644 --- a/src/document/DocumentManager.js +++ b/src/document/DocumentManager.js @@ -1,24 +1,24 @@ /* * Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - * + * */ @@ -28,7 +28,7 @@ /** * DocumentManager maintains a list of currently 'open' Documents. It also owns the list of files in * the working set, and the notion of which Document is currently shown in the main editor UI area. - * + * * Document is the model for a file's contents; it dispatches events whenever those contents change. * To transiently inspect a file's content, simply get a Document and call getText() on it. However, * to be notified of Document changes or to modify a Document, you MUST call addRef() to ensure the @@ -36,7 +36,7 @@ * Documents are all Documents that are 'kept alive', i.e. have ref count > 0). * * To get a Document, call getDocumentForPath(); never new up a Document yourself. - * + * * Secretly, a Document may use an Editor instance to act as the model for its internal state. (This * is unavoidable because CodeMirror does not separate its model from its UI). Documents are not * modifiable until they have a backing 'master Editor'. Creation of the backing Editor is owned by @@ -54,7 +54,7 @@ * * - dirtyFlagChange -- When any Document's isDirty flag changes. The 2nd arg to the listener is the * Document whose flag changed. - * - documentSaved -- When a Document's changes have been saved. The 2nd arg to the listener is the + * - documentSaved -- When a Document's changes have been saved. The 2nd arg to the listener is the * Document that has been saved. * - documentRefreshed -- When a Document's contents have been reloaded from disk. The 2nd arg to the * listener is the Document that has been refreshed. @@ -72,7 +72,7 @@ * The 2nd arg to the listener is the array of removed FileEntry objects. * - workingSetSort -- When the workingSet array is reordered without additions or removals. * Listener receives no arguments. - * + * * - workingSetDisableAutoSorting -- Dispatched in addition to workingSetSort when the reorder was caused * by manual dragging and dropping. Listener receives no arguments. * @@ -82,7 +82,7 @@ * * These are jQuery events, so to listen for them you do something like this: * $(DocumentManager).on("eventname", handler); - * + * * Document objects themselves also dispatch some events - see Document docs for details. */ define(function (require, exports, module) { @@ -182,7 +182,7 @@ define(function (require, exports, module) { return _workingSet.slice(0); } - /** + /** * Returns the index of the file matching fullPath in the working set. * Returns -1 if not found. * @param {!string} fullPath @@ -198,7 +198,7 @@ define(function (require, exports, module) { }); } - /** + /** * Returns the index of the file matching fullPath in _workingSetAddedOrder. * Returns -1 if not found. * @param {!string} fullPath @@ -465,7 +465,7 @@ define(function (require, exports, module) { * Changes currentDocument to the given Document, firing currentDocumentChange, which in turn * causes this Document's main editor UI to be shown in the editor pane, updates the selection * in the file tree / working set UI, etc. This call may also add the item to the working set. - * + * * @param {!Document} document The Document to make current. May or may not already be in the * working set. */ @@ -543,7 +543,7 @@ define(function (require, exports, module) { .fail(function () { // File chosen to be switched to could not be opened, and the original file // is still in editor. Close it again so code will try to open the next file, - // or empty the editor if there are no other files. + // or empty the editor if there are no other files. closeFullEditor(file); }); } else { @@ -843,7 +843,7 @@ define(function (require, exports, module) { * @param {boolean} isFolder True if path is a folder; False if it is a file. */ function notifyPathNameChanged(oldName, newName, isFolder) { - // Update open documents. This will update _currentDocument too, since + // Update open documents. This will update _currentDocument too, since // the current document is always open. var keysToDelete = []; CollectionUtils.forEach(_openDocuments, function (doc, path) { @@ -875,7 +875,7 @@ define(function (require, exports, module) { } /** - * Called after a file or folder has been deleted. This function is responsible + * Called after a file or folder has been deleted. This function is responsible * for updating underlying model data and notifying all views of the change. * * @param {string} path The path of the file/folder that has been deleted @@ -980,8 +980,6 @@ define(function (require, exports, module) { // Setup preferences _prefs = PreferencesManager.getPreferenceStorage(module); - //TODO: Remove preferences migration code - PreferencesManager.handleClientIdChange(_prefs, "com.adobe.brackets.DocumentManager"); // Performance measurements PerfUtils.createPerfMeasurement("DOCUMENT_MANAGER_GET_DOCUMENT_FOR_PATH", "DocumentManager.getDocumentForPath()"); diff --git a/src/editor/Editor.js b/src/editor/Editor.js index 2f48ee98403..15c97832078 100644 --- a/src/editor/Editor.js +++ b/src/editor/Editor.js @@ -1,24 +1,24 @@ /* * Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - * + * */ @@ -38,7 +38,7 @@ * * For now, direct access to the underlying CodeMirror object is still possible via _codeMirror -- * but this is considered deprecated and may go away. - * + * * The Editor object dispatches the following events: * - keyEvent -- When any key event happens in the editor (whether it changes the text or not). * Event handlers are passed ({Editor}, {KeyboardEvent}). The 2nd arg is the raw DOM event. @@ -82,8 +82,6 @@ define(function (require, exports, module) { /** Editor preferences */ var _prefs = PreferencesManager.getPreferenceStorage(module, defaultPrefs); - //TODO: Remove preferences migration code - PreferencesManager.handleClientIdChange(_prefs, "com.adobe.brackets.Editor"); /** @type {boolean} Global setting: When inserting new text, use tab characters? (instead of spaces) */ var _useTabChar = _prefs.getValue("useTabChar"); @@ -120,13 +118,13 @@ define(function (require, exports, module) { */ function _handleTabKey(instance) { // Tab key handling is done as follows: - // 1. If the selection is before any text and the indentation is to the left of + // 1. If the selection is before any text and the indentation is to the left of // the proper indentation then indent it to the proper place. Otherwise, - // add another tab. In either case, move the insertion point to the + // add another tab. In either case, move the insertion point to the // beginning of the text. // 2. If the selection is multi-line, indent all the lines. - // 3. If the selection is after the first non-space character, and is an - // insertion point, insert a tab character or the appropriate number + // 3. If the selection is after the first non-space character, and is an + // insertion point, insert a tab character or the appropriate number // of spaces to pad to the nearest tab boundary. var from = instance.getCursor(true), to = instance.getCursor(false), @@ -171,7 +169,7 @@ define(function (require, exports, module) { /** * @private * Handle left arrow, right arrow, backspace and delete keys when soft tabs are used. - * @param {!CodeMirror} instance CodeMirror instance + * @param {!CodeMirror} instance CodeMirror instance * @param {number} direction Direction of movement: 1 for forward, -1 for backward * @param {function} functionName name of the CodeMirror function to call * @return {boolean} true if key was handled @@ -201,7 +199,7 @@ define(function (require, exports, module) { return false; } - // If we are on the tab boundary, jump by the full amount, + // If we are on the tab boundary, jump by the full amount, // but not beyond the start of the line. if (jump === 0) { jump = indentUnit; @@ -305,7 +303,7 @@ define(function (require, exports, module) { * * ALWAYS call destroy() when you are done with an Editor - otherwise it will leak a Document ref. * - * @param {!Document} document + * @param {!Document} document * @param {!boolean} makeMasterEditor If true, this Editor will set itself as the (secret) "master" * Editor for the Document. If false, this Editor will attach to the Document as a "slave"/ * secondary editor. @@ -492,7 +490,7 @@ define(function (require, exports, module) { }; - /** + /** * Selects all text and maintains the current scroll position. */ Editor.prototype.selectAllNoScroll = function () { @@ -650,7 +648,7 @@ define(function (require, exports, module) { /** - * Install event handlers on the CodeMirror instance, translating them into + * Install event handlers on the CodeMirror instance, translating them into * jQuery events on the Editor instance. */ Editor.prototype._installEditorListeners = function () { @@ -659,7 +657,7 @@ define(function (require, exports, module) { // onKeyEvent is an option in CodeMirror rather than an event--it's a // low-level hook for all keyboard events rather than a specific event. For // our purposes, though, it's convenient to treat it as an event internally, - // so we bridge it to jQuery events the same way we do ordinary CodeMirror + // so we bridge it to jQuery events the same way we do ordinary CodeMirror // events. this._codeMirror.setOption("onKeyEvent", function (instance, event) { $(self).triggerHandler("keyEvent", [self, event]); @@ -812,7 +810,7 @@ define(function (require, exports, module) { var $scrollerElement = $(this.getScrollerElement()); var editorHeight = $scrollerElement.height(); - // we need to make adjustments for the statusbar's padding on the bottom and the menu bar on top. + // we need to make adjustments for the statusbar's padding on the bottom and the menu bar on top. var statusBarHeight = $scrollerElement.outerHeight() - editorHeight; var menuBarHeight = $scrollerElement.offset().top; @@ -1242,7 +1240,7 @@ define(function (require, exports, module) { }; /** - * Sets the height of an inline widget in this editor. + * Sets the height of an inline widget in this editor. * @param {!InlineWidget} inlineWidget The widget whose height should be set. * @param {!number} height The height of the widget. * @param {boolean} ensureVisible Whether to scroll the entire widget into view. @@ -1304,7 +1302,7 @@ define(function (require, exports, module) { /** * @private * Get the starting line number for an inline widget. - * @param {!InlineWidget} inlineWidget + * @param {!InlineWidget} inlineWidget * @return {number} The line number of the widget or -1 if not found. */ Editor.prototype._getInlineWidgetLineNumber = function (inlineWidget) { @@ -1341,7 +1339,7 @@ define(function (require, exports, module) { */ Editor.prototype.refresh = function (handleResize) { // If focus is currently in a child of the CodeMirror editor (e.g. in an inline widget), but not in - // the CodeMirror input field itself, remember the focused item so we can restore focus after the + // the CodeMirror input field itself, remember the focused item so we can restore focus after the // refresh (which might cause the widget to be removed from the display list temporarily). var focusedItem = window.document.activeElement, restoreFocus = $.contains(this._codeMirror.getScrollerElement(), focusedItem); @@ -1407,7 +1405,7 @@ define(function (require, exports, module) { * A-B-A would return A as the mode, not null). * * @return {?(Object|string)} Name of syntax-highlighting mode, or object containing a "name" property - * naming the mode along with configuration options required by the mode. + * naming the mode along with configuration options required by the mode. * See {@link LanguageManager#getLanguageForPath()} and {@link Language#getMode()}. */ Editor.prototype.getModeForSelection = function () { diff --git a/src/extensions/default/RecentProjects/main.js b/src/extensions/default/RecentProjects/main.js index 654cfad26e0..97f11640fca 100644 --- a/src/extensions/default/RecentProjects/main.js +++ b/src/extensions/default/RecentProjects/main.js @@ -1,24 +1,24 @@ /* * Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - * + * */ /*jslint vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */ @@ -48,8 +48,6 @@ define(function (require, exports, module) { var KeyboardPrefs = JSON.parse(require("text!keyboard.json")); var prefs = PreferencesManager.getPreferenceStorage(module); - //TODO: Remove preferences migration code - PreferencesManager.handleClientIdChange(prefs, "com.adobe.brackets.brackets-recent-projects"); /** @const {string} Recent Projects commands ID */ var TOGGLE_DROPDOWN = "recentProjects.toggle"; diff --git a/src/preferences/PreferencesManager.js b/src/preferences/PreferencesManager.js index edf3f1f4cee..a8624bbe900 100644 --- a/src/preferences/PreferencesManager.js +++ b/src/preferences/PreferencesManager.js @@ -1,24 +1,24 @@ /* * Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - * + * */ @@ -107,7 +107,7 @@ define(function (require, exports, module) { * Retreive the preferences data for the given clientID. * @param {string|{id: string, uri: string}} clientID - A unique identifier or a requireJS module object * @param {string} defaults - Default preferences stored as JSON - * @return {PreferenceStorage} + * @return {PreferenceStorage} */ function getPreferenceStorage(clientID, defaults) { if (!clientID || (typeof clientID === "object" && (!clientID.id || !clientID.uri))) { @@ -172,29 +172,6 @@ define(function (require, exports, module) { _reset(); } } - - /** - * This method handles the copy of all old prefs to the new prefs - * TODO: remove All calls to this function and the function itself - * - * @param {!PreferenceStorage} newPrefs The new PreferenceStorage - * @param {!string} oldID The id of the old PreferenceStorage - */ - function handleClientIdChange(newPrefs, oldID) { - if (prefStorage[oldID]) { - var oldPrefs = getPreferenceStorage(oldID); - - if (!newPrefs.getValue("newClientID")) { - var data = oldPrefs.getAllValues(); - - if (!$.isEmptyObject(data)) { - newPrefs.setAllValues(data, true); - } - newPrefs.setValue("newClientID", true); - } - delete prefStorage[oldID]; - } - } // Check localStorage for a preferencesKey. Production and unit test keys // are used to keep preferences separate within the same storage implementation. @@ -215,7 +192,6 @@ define(function (require, exports, module) { // Public API exports.getPreferenceStorage = getPreferenceStorage; exports.savePreferences = savePreferences; - exports.handleClientIdChange = handleClientIdChange; exports.getClientID = getClientID; // Unit test use only diff --git a/src/project/ProjectManager.js b/src/project/ProjectManager.js index c5ea86057e5..abc5c36971b 100644 --- a/src/project/ProjectManager.js +++ b/src/project/ProjectManager.js @@ -1,24 +1,24 @@ /* * Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - * + * */ /*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ @@ -33,7 +33,7 @@ * - beforeProjectClose -- before _projectRoot changes * - beforeAppClose -- before Brackets quits entirely * - projectOpen -- after _projectRoot changes and the tree is re-rendered - * - projectRefresh -- when project tree is re-rendered for a reason other than + * - projectRefresh -- when project tree is re-rendered for a reason other than * a project being opened (e.g. from the Refresh command) * - projectFilesChange -- sent if one of the project files has changed-- * added, removed, renamed, etc. @@ -162,7 +162,7 @@ define(function (require, exports, module) { /** * @private * RegEx to validate if a filename is not allowed even if the system allows it. - * This is done to prevent cross-platform issues. + * This is done to prevent cross-platform issues. */ var _illegalFilenamesRegEx = /^(\.+|com[1-9]|lpt[1-9]|nul|con|prn|aux)$/i; @@ -476,8 +476,8 @@ define(function (require, exports, module) { var result = new $.Deferred(); // For #1542, make sure the tree is scrolled to the top before refreshing. - // If we try to do this later (e.g. after the tree has been refreshed), it - // doesn't seem to work properly. + // If we try to do this later (e.g. after the tree has been refreshed), it + // doesn't seem to work properly. $projectTreeContainer.scrollTop(0); // Instantiate tree widget @@ -739,7 +739,7 @@ define(function (require, exports, module) { .addClass(classToAdd); // This is a workaround for a part of issue #2085, where the file creation process - // depends on the open_node.jstree event being triggered, which doesn't happen on + // depends on the open_node.jstree event being triggered, which doesn't happen on // empty folders if (!wasNodeOpen) { treeNode.trigger("open_node.jstree"); @@ -835,7 +835,7 @@ define(function (require, exports, module) { /** * Initial project path is stored in prefs, which defaults to the welcome project on - * first launch. + * first launch. */ function getInitialProjectPath() { return updateWelcomeProjectPath(_prefs.getValue("projectPath")); @@ -845,7 +845,7 @@ define(function (require, exports, module) { * Loads the given folder as a project. Normally, you would call openProject() instead to let the * user choose a folder. * - * @param {string} rootPath Absolute path to the root folder of the project. + * @param {string} rootPath Absolute path to the root folder of the project. * If rootPath is undefined or null, the last open project will be restored. * @param {boolean=} isUpdating If true, indicates we're just updating the tree; * if false, a different project is being loaded. @@ -899,7 +899,7 @@ define(function (require, exports, module) { _projectRoot = rootEntry; _projectBaseUrl = _prefs.getValue(_getBaseUrlKey()) || ""; - // If this is the current welcome project, record it. In future launches, we always + // If this is the current welcome project, record it. In future launches, we always // want to substitute the welcome project for the current build instead of using an // outdated one (when loading recent projects or the last opened project). if (canonPath === _getWelcomeProjectPath()) { @@ -944,7 +944,7 @@ define(function (require, exports, module) { error.name ) ).done(function () { - // The project folder stored in preference doesn't exist, so load the default + // The project folder stored in preference doesn't exist, so load the default // project directory. // TODO (issue #267): When Brackets supports having no project directory // defined this code will need to change @@ -965,7 +965,7 @@ define(function (require, exports, module) { /** * Finds the tree node corresponding to the given file/folder (rejected if the path lies * outside the project, or if it doesn't exist). - * + * * @param {!Entry} entry FileEntry or DirectoryEntry to find * @return {$.Promise} Resolved with jQ obj for the jsTree tree node; or rejected if not found */ @@ -1050,7 +1050,7 @@ define(function (require, exports, module) { /** * Expands tree nodes to show the given file or folder and selects it. Silently no-ops if the * path lies outside the project, or if it doesn't exist. - * + * * @param {!Entry} entry FileEntry or DirectoryEntry to show * @return {$.Promise} Resolved when done; or rejected if not found */ @@ -1067,7 +1067,7 @@ define(function (require, exports, module) { * Open a new project. Currently, Brackets must always have a project open, so * this method handles both closing the current project and opening a new project. * - * @param {string=} path Optional absolute path to the root folder of the project. + * @param {string=} path Optional absolute path to the root folder of the project. * If path is undefined or null, displays a dialog where the user can choose a * folder to load. If the user cancels the dialog, nothing more happens. * @return {$.Promise} A promise object that will be resolved when the @@ -1500,7 +1500,7 @@ define(function (require, exports, module) { _findTreeNode(entry).done(function ($node) { _projectTree.one("delete_node.jstree", function () { // When a node is deleted, the previous node is automatically selected. - // This works fine as long as the previous node is a file, but doesn't + // This works fine as long as the previous node is a file, but doesn't // work so well if the node is a folder var sel = _projectTree.jstree("get_selected"), entry = sel ? sel.data("entry") : null; @@ -1570,8 +1570,6 @@ define(function (require, exports, module) { projectPath: _getWelcomeProjectPath() /* initialize to welcome project */ }; _prefs = PreferencesManager.getPreferenceStorage(module, defaults); - //TODO: Remove preferences migration code - PreferencesManager.handleClientIdChange(_prefs, "com.adobe.brackets.ProjectManager"); // Event Handlers $(FileViewController).on("documentSelectionFocusChange", _documentSelectionFocusChange); diff --git a/src/project/WorkingSetSort.js b/src/project/WorkingSetSort.js index a38f5ed1dd3..d33430b6309 100644 --- a/src/project/WorkingSetSort.js +++ b/src/project/WorkingSetSort.js @@ -1,24 +1,24 @@ /* * Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - * + * */ @@ -323,8 +323,6 @@ define(function (require, exports, module) { // Initialize PreferenceStorage _prefs = PreferencesManager.getPreferenceStorage(module, defaultPrefs); - //TODO: Remove preferences migration code - PreferencesManager.handleClientIdChange(_prefs, "com.adobe.brackets.WorkingSetSort"); // Initialize items dependent on extensions/workingSet AppInit.appReady(function () { diff --git a/src/utils/Resizer.js b/src/utils/Resizer.js index c4a1966f178..d4b10f7c28e 100644 --- a/src/utils/Resizer.js +++ b/src/utils/Resizer.js @@ -1,24 +1,24 @@ /* * Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - * + * */ /*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ @@ -27,10 +27,10 @@ /** * Resizer is a Module utility to inject resizing capabilities to any element * inside Brackets. - * - * On initialization, Resizer discovers all nodes tagged as "vert-resizable" - * and "horz-resizable" to add the resizer handler. Additionally, "top-resizer", - * "bottom-resizer", "left-resizer" and "right-resizer" classes control the + * + * On initialization, Resizer discovers all nodes tagged as "vert-resizable" + * and "horz-resizable" to add the resizer handler. Additionally, "top-resizer", + * "bottom-resizer", "left-resizer" and "right-resizer" classes control the * position of the resizer on the element. * * An element can be made resizable at any time using the `makeResizable()` API. @@ -38,7 +38,7 @@ * again in a subsequent launch. * * The resizable elements trigger a panelResizeStart, panelResizeUpdate and panelResizeEnd - * event that can be used to create performance optimizations (such as hiding/showing elements + * event that can be used to create performance optimizations (such as hiding/showing elements * while resizing), custom layout logic, etc. See makeResizable() for details on the events. * * A resizable element can be collapsed/expanded using the `show`, `hide` and `toggle` APIs or @@ -245,8 +245,8 @@ define(function (require, exports, module) { _prefs.setValue(elementID, elementPrefs); }); - // If the resizer is positioned right or bottom of the panel, we need to listen to - // reposition it if the element size changes externally + // If the resizer is positioned right or bottom of the panel, we need to listen to + // reposition it if the element size changes externally function repositionResizer(elementSize) { var resizerPosition = elementSize || 1; if (position === POSITION_RIGHT || position === POSITION_BOTTOM) { @@ -277,7 +277,7 @@ define(function (require, exports, module) { } function doRedraw() { - // only run this if the mouse is down so we don't constantly loop even + // only run this if the mouse is down so we don't constantly loop even // after we're done resizing. if (!isMouseDown) { return; @@ -298,7 +298,7 @@ define(function (require, exports, module) { $element.trigger("panelResizeStart", newSize); } - // Resize the main element to the new size. If there is a content element, + // Resize the main element to the new size. If there is a content element, // its size is the new size minus the size of the non-resizable elements resizeElement(newSize, (newSize - baseSize)); adjustSibling(newSize); @@ -409,8 +409,6 @@ define(function (require, exports, module) { // Init PreferenceStorage _prefs = PreferencesManager.getPreferenceStorage(module); - //TODO: Remove preferences migration code - PreferencesManager.handleClientIdChange(_prefs, module.id); // Scan DOM for horz-resizable and vert-resizable classes and make them resizable AppInit.htmlReady(function () { diff --git a/src/utils/UpdateNotification.js b/src/utils/UpdateNotification.js index f6fbe80fbe0..be4e7c18d90 100644 --- a/src/utils/UpdateNotification.js +++ b/src/utils/UpdateNotification.js @@ -1,24 +1,24 @@ /* * Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - * + * */ /*jslint vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */ @@ -49,8 +49,6 @@ define(function (require, exports, module) { // PreferenceStorage var _prefs = PreferencesManager.getPreferenceStorage(module, defaultPrefs); - //TODO: Remove preferences migration code - PreferencesManager.handleClientIdChange(_prefs, module.id); // This is the last version we notified the user about. If checkForUpdate() // is called with "false", only show the update notification dialog if there @@ -60,13 +58,13 @@ define(function (require, exports, module) { // Last time the versionInfoURL was fetched var _lastInfoURLFetchTime = _prefs.getValue("lastInfoURLFetchTime"); - // URL to load version info from. By default this is loaded no more than once a day. If + // URL to load version info from. By default this is loaded no more than once a day. If // you force an update check it is always loaded. // URL to fetch the version information. var _versionInfoURL; - // Information on all posted builds of Brackets. This is an Array, where each element is + // Information on all posted builds of Brackets. This is an Array, where each element is // an Object with the following fields: // // {Number} buildNumber Number of the build @@ -91,7 +89,7 @@ define(function (require, exports, module) { * * If force is true, the information is always fetched from _versionInfoURL. * If force is false, we try to use cached information. If more than - * 24 hours have passed since the last fetch, or if cached data can't be found, + * 24 hours have passed since the last fetch, or if cached data can't be found, * the data is fetched again. * * If new data is fetched and dontCache is false, the data is saved in preferences @@ -140,7 +138,7 @@ define(function (require, exports, module) { } }, error: function (jqXHR, status, error) { - // When loading data for unit tests, the error handler is + // When loading data for unit tests, the error handler is // called but the responseText is valid. Try to use it here, // but *don't* save the results in prefs. @@ -191,7 +189,7 @@ define(function (require, exports, module) { } /** - * Show a dialog that shows the update + * Show a dialog that shows the update */ function _showUpdateNotificationDialog(updates) { Dialogs.showModalDialogUsingTemplate(Mustache.render(UpdateDialogTemplate, Strings)) @@ -211,10 +209,10 @@ define(function (require, exports, module) { } /** - * Check for updates. If "force" is true, update notification dialogs are always displayed - * (if an update is available). If "force" is false, the update notification is only + * Check for updates. If "force" is true, update notification dialogs are always displayed + * (if an update is available). If "force" is false, the update notification is only * displayed for newly available updates. - * + * * If an update is available, show the "update available" notification icon in the title bar. * * @param {boolean} force If true, always show the notification dialog. @@ -257,7 +255,7 @@ define(function (require, exports, module) { // Get all available updates var allUpdates = _stripOldVersionInfo(versionInfo, _buildNumber); - // When running directly from GitHub source (as opposed to + // When running directly from GitHub source (as opposed to // an installed build), _buildNumber is 0. In this case, if the // test is not forced, don't show the update notification icon or // dialog. @@ -278,7 +276,7 @@ define(function (require, exports, module) { }); } - // Only show the update dialog if force = true, or if the user hasn't been + // Only show the update dialog if force = true, or if the user hasn't been // alerted of this update if (force || allUpdates[0].buildNumber > _lastNotifiedBuildNumber) { _showUpdateNotificationDialog(allUpdates);