From e1a1e6d575d98df329bd9142fb3da36805c28ff9 Mon Sep 17 00:00:00 2001 From: Sriram Date: Fri, 10 Jan 2014 21:58:18 +0530 Subject: [PATCH 001/151] chmod all sub files and folders in temp directory --- test/spec/SpecRunnerUtils.js | 69 +++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 25 deletions(-) diff --git a/test/spec/SpecRunnerUtils.js b/test/spec/SpecRunnerUtils.js index f82272f913a..eff93ef5597 100644 --- a/test/spec/SpecRunnerUtils.js +++ b/test/spec/SpecRunnerUtils.js @@ -240,35 +240,54 @@ define(function (require, exports, module) { } function _resetPermissionsOnSpecialTempFolders() { - var i, - folders = [], - baseDir = getTempDirectory(), - promise; - - folders.push(baseDir + "/cant_read_here"); - folders.push(baseDir + "/cant_write_here"); - - promise = Async.doSequentially(folders, function (folder) { - var deferred = new $.Deferred(); - - FileSystem.resolve(folder, function (err, entry) { - if (!err) { - // Change permissions if the directory exists - chmod(folder, "777").then(deferred.resolve, deferred.reject); + var entries = [], + result = new $.Deferred(), + promise, + entryPromise = new $.Deferred(), + tempDir; + + function visitor(entry) { + entries.push(entry.fullPath); + return true; + } + tempDir = FileSystem.getDirectoryForPath(getTempDirectory()); + tempDir.visit(visitor, function(err){ + if (!err) { + entryPromise.resolve(entries); + } else { + if (err === FileSystemError.NOT_FOUND) { + entryPromise.resolve(entries); } else { - if (err === FileSystemError.NOT_FOUND) { - // Resolve the promise since the folder to reset doesn't exist - deferred.resolve(); + entryPromise.reject(); + } + } + }); + entryPromise.done(function(entries){ + promise = Async.doSequentially(entries, function (entry) { + var deferred = new $.Deferred(); + + FileSystem.resolve(entry, function (err, item) { + if (!err) { + // Change permissions if the directory exists + chmod(entry, "777").then(deferred.resolve, deferred.reject); } else { - deferred.reject(); + if (err === FileSystemError.NOT_FOUND) { + // Resolve the promise since the folder to reset doesn't exist + deferred.resolve(); + } else { + deferred.reject(); + } } - } - }); - - return deferred.promise(); - }, true); + }); + + return deferred.promise(); + }, true); + promise.then(result.resolve, result.reject); + }).fail(function() { + result.reject(); + }); - return promise; + return result.promise(); } /** From 68832ec3eb92f4abfe3bfca0171afbe5ce1cdea5 Mon Sep 17 00:00:00 2001 From: petetnt Date: Fri, 26 Feb 2016 16:31:18 +0200 Subject: [PATCH 002/151] When flipping views, if the doc is already open on the other view, show it without closing the original pane --- src/view/Pane.js | 44 ++++++++++++++++++------------- test/spec/MainViewManager-test.js | 31 ++++++++++++++++++++++ 2 files changed, 56 insertions(+), 19 deletions(-) diff --git a/src/view/Pane.js b/src/view/Pane.js index 36b48cd96a4..faed7d9ed3b 100644 --- a/src/view/Pane.js +++ b/src/view/Pane.js @@ -211,6 +211,23 @@ define(function (require, exports, module) { return {indexRequested: requestIndex, index: index}; } + /** + * Ensures that the given pane is focused after other focus related events occur + * @params {string} paneId - paneId of the pane to focus + * @private + */ + function _ensurePaneIsFocused(paneId) { + var pane = MainViewManager._getPane(paneId); + + // Defer the focusing until other focus events have occurred. + setTimeout(function () { + // Focus has most likely changed: give it back to the given pane. + pane.focus(); + this._lastFocusedElement = pane.$el[0]; + MainViewManager.setActivePaneId(paneId); + }, 1); + } + /** * @typedef {!$el: jQuery, getFile:function():!File, updateLayout:function(forceRefresh:boolean), destroy:function(), getScrollPos:function():?, adjustScrollPos:function(state:Object=, heightDelta:number)=, getViewState:function():?*=, restoreViewState:function(viewState:!*)=, notifyContainerChange:function()=, notifyVisibilityChange:function(boolean)=} View */ @@ -245,9 +262,14 @@ define(function (require, exports, module) { var currentFile = self.getCurrentlyViewedFile(); var otherPaneId = self.id === FIRST_PANE ? SECOND_PANE : FIRST_PANE; var otherPane = MainViewManager._getPane(otherPaneId); + var sameDocInOtherView = otherPane.getViewForPath(currentFile.fullPath); - // If the same doc view is present in the destination pane prevent flip - if (otherPane.getViewForPath(currentFile.fullPath)) { + // If the same doc view is present in the destination, show the file instead of flipping it + if (sameDocInOtherView) { + CommandManager.execute(Commands.FILE_OPEN, {fullPath: currentFile.fullPath, + paneId: otherPaneId}).always(function () { + _ensurePaneIsFocused(otherPaneId); + }); return; } @@ -255,30 +277,14 @@ define(function (require, exports, module) { // give focus to the pane. This way it is possible to flip multiple panes to the active one // without losing focus. var activePaneIdBeforeFlip = MainViewManager.getActivePaneId(); - var currentFileOnOtherPaneIndex = otherPane.findInViewList(currentFile.fullPath); - // if the currentFile is already on other pane just close the current pane - if (currentFileOnOtherPaneIndex !== -1) { - CommandManager.execute(Commands.FILE_CLOSE, {File: currentFile, paneId: self.id}); - } - MainViewManager._moveView(self.id, otherPaneId, currentFile).always(function () { CommandManager.execute(Commands.FILE_OPEN, {fullPath: currentFile.fullPath, paneId: otherPaneId}).always(function () { - - var activePaneBeforeFlip = MainViewManager._getPane(activePaneIdBeforeFlip); - // Trigger view list changes for both panes self.trigger("viewListChange"); otherPane.trigger("viewListChange"); - - // Defer the focusing until other focus events have occurred. - setTimeout(function () { - // Focus has most likely changed: give it back to the original pane. - activePaneBeforeFlip.focus(); - self._lastFocusedElement = activePaneBeforeFlip.$el[0]; - MainViewManager.setActivePaneId(activePaneIdBeforeFlip); - }, 1); + _ensurePaneIsFocused(activePaneIdBeforeFlip); }); }); }); diff --git a/test/spec/MainViewManager-test.js b/test/spec/MainViewManager-test.js index 24cf3491f5a..35eaeca6670 100644 --- a/test/spec/MainViewManager-test.js +++ b/test/spec/MainViewManager-test.js @@ -449,6 +449,37 @@ define(function (require, exports, module) { expect(MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE)).toEqual(null); }); }); + it("should show the file instead of flipping if file is already open", function () { + runs(function () { + MainViewManager.setLayoutScheme(1, 2); + }); + runs(function () { + promise = CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, { fullPath: testPath + "/test.js", + paneId: "first-pane" }); + waitsForDone(promise, Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN); + }); + runs(function () { + promise = CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, { fullPath: testPath + "/test.js", + paneId: "second-pane" }); + waitsForDone(promise, Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN); + }); + runs(function () { + promise = CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, { fullPath: testPath + "/test.css", + paneId: "second-pane" }); + waitsForDone(promise, Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN); + }); + runs(function () { + MainViewManager._getPane("first-pane").$headerFlipViewBtn.trigger("click"); + }); + runs(function () { + MainViewManager.setActivePaneId("first-pane"); + expect(MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE).name).toEqual("test.js"); + expect(EditorManager.getCurrentFullEditor().document.file.name).toEqual("test.js"); + MainViewManager.setActivePaneId("second-pane"); + expect(MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE).name).toEqual("test.js"); + expect(EditorManager.getCurrentFullEditor().document.file.name).toEqual("test.js"); + }); + }); it("should merge two panes to the right", function () { runs(function () { MainViewManager.setLayoutScheme(1, 2); From 5e8528ddf52a3bb04171a1962c6c92039557f828 Mon Sep 17 00:00:00 2001 From: Chad Date: Sun, 22 May 2016 17:18:13 -0400 Subject: [PATCH 003/151] Make file stats available to indexFilter --- src/filesystem/Directory.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/filesystem/Directory.js b/src/filesystem/Directory.js index b0080b74b08..be8d9276603 100644 --- a/src/filesystem/Directory.js +++ b/src/filesystem/Directory.js @@ -170,9 +170,9 @@ define(function (require, exports, module) { names.forEach(function (name, index) { var entryPath = this.fullPath + name; - if (this._fileSystem._indexFilter(entryPath, name)) { - var entryStats = stats[index], - entry; + var entryStats = stats[index]; + if (this._fileSystem._indexFilter(entryPath, name, entryStats)) { + var entry; // Note: not all entries necessarily have associated stats. if (typeof entryStats === "string") { From d6ae906810b8e6afb43c88edcf0397b1dc1b0119 Mon Sep 17 00:00:00 2001 From: Amin Ullah Khan Date: Mon, 1 Feb 2016 20:16:43 +0500 Subject: [PATCH 004/151] Remove old preference system --- src/LiveDevelopment/main.js | 5 - src/document/DocumentManager.js | 25 -- src/editor/Editor.js | 15 - src/extensions/default/QuickView/main.js | 5 - src/extensions/default/RecentProjects/main.js | 2 - src/language/CodeInspection.js | 5 - src/preferences/PreferenceStorage.js | 272 ------------------ src/preferences/PreferencesManager.js | 260 +---------------- src/project/ProjectManager.js | 39 --- src/project/WorkingSetSort.js | 1 - src/search/FindBar.js | 1 - src/utils/Resizer.js | 18 -- src/utils/UpdateNotification.js | 6 - src/view/ViewCommandHandlers.js | 17 -- test/spec/PreferencesManager-test.js | 116 +------- 15 files changed, 3 insertions(+), 784 deletions(-) delete mode 100644 src/preferences/PreferenceStorage.js diff --git a/src/LiveDevelopment/main.js b/src/LiveDevelopment/main.js index dd48f245148..e7aabc6cdf1 100644 --- a/src/LiveDevelopment/main.js +++ b/src/LiveDevelopment/main.js @@ -363,11 +363,6 @@ define(function main(require, exports, module) { _updateHighlightCheckmark(); }); - PreferencesManager.convertPreferences(module, { - "highlight": "user livedev.highlight", - "afterFirstLaunch": "user livedev.afterFirstLaunch" - }, true); - config.highlight = PreferencesManager.getViewState("livedev.highlight"); // init commands diff --git a/src/document/DocumentManager.js b/src/document/DocumentManager.js index 5f1958999db..e2a477ded09 100644 --- a/src/document/DocumentManager.js +++ b/src/document/DocumentManager.js @@ -612,28 +612,6 @@ define(function (require, exports, module) { exports.trigger("documentSaved", doc); }); - /** - * @private - * Examine each preference key for migration of the working set files. - * If the key has a prefix of "files_/", then it is a working set files - * preference from old preference model. - * - * @param {string} key The key of the preference to be examined - * for migration of working set files. - * @return {?string} - the scope to which the preference is to be migrated - */ - function _checkPreferencePrefix(key) { - var pathPrefix = "files_"; - if (key.indexOf(pathPrefix) === 0) { - // Get the project path from the old preference key by stripping "files_". - var projectPath = key.substr(pathPrefix.length); - return "user project.files " + projectPath; - } - - return null; - } - - // Set up event dispatch EventDispatcher.makeEventDispatcher(exports); @@ -672,9 +650,6 @@ define(function (require, exports, module) { _proxyDeprecatedEvent("workingSetSort"); }); - - PreferencesManager.convertPreferences(module, {"files_": "user"}, true, _checkPreferencePrefix); - // Handle file saves that may affect preferences exports.on("documentSaved", function (e, doc) { PreferencesManager.fileChanged(doc.file.fullPath); diff --git a/src/editor/Editor.js b/src/editor/Editor.js index 99203dc8341..c7aa3ae628f 100644 --- a/src/editor/Editor.js +++ b/src/editor/Editor.js @@ -2594,21 +2594,6 @@ define(function (require, exports, module) { }); }); - /** - * @private - * - * Manage the conversion from old-style localStorage prefs to the new file-based ones. - */ - function _convertPreferences() { - var rules = {}; - editorOptions.forEach(function (setting) { - rules[setting] = "user"; - }); - PreferencesManager.convertPreferences(module, rules); - } - - _convertPreferences(); - // Define public API exports.Editor = Editor; exports.BOUNDARY_CHECK_NORMAL = BOUNDARY_CHECK_NORMAL; diff --git a/src/extensions/default/QuickView/main.js b/src/extensions/default/QuickView/main.js index 55486e615a2..e8c57773bd1 100644 --- a/src/extensions/default/QuickView/main.js +++ b/src/extensions/default/QuickView/main.js @@ -819,11 +819,6 @@ define(function (require, exports, module) { CommandManager.register(Strings.CMD_ENABLE_QUICK_VIEW, CMD_ENABLE_QUICK_VIEW, toggleEnableQuickView); Menus.getMenu(Menus.AppMenuBar.VIEW_MENU).addMenuItem(CMD_ENABLE_QUICK_VIEW, null, Menus.AFTER, Commands.VIEW_TOGGLE_INSPECTION); - // Convert old preferences - PreferencesManager.convertPreferences(module, { - "enabled": "user quickview.enabled" - }); - // Setup initial UI state setEnabled(prefs.get("enabled"), true); setExtensionlessImagePreview(prefs.get("extensionlessImagePreview"), true); diff --git a/src/extensions/default/RecentProjects/main.js b/src/extensions/default/RecentProjects/main.js index 041e23ac727..c37ad4cc80d 100644 --- a/src/extensions/default/RecentProjects/main.js +++ b/src/extensions/default/RecentProjects/main.js @@ -439,8 +439,6 @@ define(function (require, exports, module) { } } - PreferencesManager.convertPreferences(module, {"recentProjects": "user"}, true); - // Register command handlers CommandManager.register(Strings.CMD_TOGGLE_RECENT_PROJECTS, TOGGLE_DROPDOWN, handleKeyEvent); KeyBindingManager.addBinding(TOGGLE_DROPDOWN, KeyboardPrefs.recentProjects); diff --git a/src/language/CodeInspection.js b/src/language/CodeInspection.js index 986d0230a4f..e00a5e4e153 100644 --- a/src/language/CodeInspection.js +++ b/src/language/CodeInspection.js @@ -80,11 +80,6 @@ define(function (require, exports, module) { var prefs = PreferencesManager.getExtensionPrefs("linting"); - PreferencesManager.convertPreferences(module, { - "enabled": "user linting.enabled", - "collapsed": "user linting.collapsed" - }); - /** * When disabled, the errors panel is closed and the status bar icon is grayed out. * Takes precedence over _collapsed. diff --git a/src/preferences/PreferenceStorage.js b/src/preferences/PreferenceStorage.js deleted file mode 100644 index 08b74946214..00000000000 --- a/src/preferences/PreferenceStorage.js +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Copyright (c) 2012 - present 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 - * 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, - * 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 - * DEALINGS IN THE SOFTWARE. - * - */ - -/** - * PreferenceStorage defines an interface for persisting preference data as - * name/value pairs for a module or plugin. - * - * @deprecated Use PreferencesManager APIs instead. - */ -define(function (require, exports, module) { - "use strict"; - - var _ = require("thirdparty/lodash"); - - var PreferencesManager = require("preferences/PreferencesManager"), - DeprecationWarning = require("utils/DeprecationWarning"); - - /** - * @private - * Validate JSON keys and values. - */ - function _validateJSONPair(key, value) { - if (typeof key === "string") { - // validate temporary JSON - var temp = {}, - error = null; - temp[key] = value; - - try { - temp = JSON.parse(JSON.stringify(temp)); - } catch (err) { - error = err; - } - - // set value to JSON storage if no errors occurred - if (!error && (temp[key] !== undefined)) { - return true; - } else { - console.error("Value '" + value + "' for key '" + key + "' must be a valid JSON value"); - return false; - } - } else { - console.error("Preference key '" + key + "' must be a string"); - return false; - } - } - - /** - * @private - * Save to persistent storage. - */ - function _commit() { - PreferencesManager.savePreferences(); - } - - /** - * Creates a new PreferenceStorage object. - * @param {!string} clientID Unique identifier for PreferencesManager to - * associate this PreferenceStorage data with. - * @param {!object} json JSON object to persist preference data. - */ - function PreferenceStorage(clientID, json) { - this._clientID = clientID; - this._json = json; - } - - /** - * Unique clientID for this PreferenceStorage object. - * @return {!string} clientID - */ - PreferenceStorage.prototype.getClientID = function () { - return this._clientID; - }; - - /** - * Removes a preference from this PreferenceStorage object. - * @param {!string} key A unique identifier - */ - PreferenceStorage.prototype.remove = function (key) { - DeprecationWarning.deprecationWarning("remove is called to remove a preference '" + key + ",' use PreferencesManager.set (with value of undefined) instead."); - // remove value from JSON storage - delete this._json[key]; - _commit(); - }; - - /** - * Assigns a value for a key. Overwrites existing value if present. - * @param {!string} key A unique identifier - * @param {object} value A valid JSON value - */ - PreferenceStorage.prototype.setValue = function (key, value) { - DeprecationWarning.deprecationWarning("setValue is called to set preference '" + key + ",' use PreferencesManager.set instead."); - if (_validateJSONPair(key, value)) { - this._json[key] = value; - _commit(); - } - }; - - /** - * Retreive the value associated with the specified key. - * @param {!string} key Key name to lookup. - * @return {object} Returns the value for the key or undefined. - */ - PreferenceStorage.prototype.getValue = function (key) { - DeprecationWarning.deprecationWarning("getValue is called to get preference '" + key + ",' use PreferencesManager.get instead."); - return this._json[key]; - }; - - /** - * Return all name-value pairs as a single JSON object. - * @return {!object} JSON object containing name/value pairs for all keys - * in this PreferenceStorage object. - */ - PreferenceStorage.prototype.getAllValues = function () { - return JSON.parse(JSON.stringify(this._json)); - }; - - /** - * Writes name-value pairs from a JSON object as preference properties. - * Invalid JSON values report an error and all changes are discarded. - * - * @param {!object} obj A JSON object with zero or more preference properties to write. - * @param {boolean} append Defaults to false. When true, properties in the JSON object - * overwrite and/or append to the existing set of preference properties. When false, - * all existing preferences are deleted before writing new properties from the JSON object. - */ - PreferenceStorage.prototype.setAllValues = function (obj, append) { - DeprecationWarning.deprecationWarning("setAllValues is called to set preferences '" + Object.keys(obj) + ",' use PreferencesManager.set (probably with doNotSave flag) instead."); - - var self = this, - error = null; - - // validate all name/value pairs before committing - _.some(obj, function (value, key) { - try { - _validateJSONPair(key, value); - } catch (err) { - // fail fast - error = err; - return true; - } - }); - - // skip changes if any error is detected - if (error) { - console.error(error); - return; - } - - // delete all exiting properties if not appending - if (!append) { - _.forEach(this._json, function (value, key) { - delete self._json[key]; - }); - } - - // copy properties from incoming JSON object - _.forEach(obj, function (value, key) { - self._json[key] = value; - }); - - _commit(); - }; - - /** - * Converts preferences to the new-style file-based preferences according to the - * rules. (See PreferencesManager.ConvertPreferences for information about the rules). - * - * @param {Object} rules Conversion rules. - * @param {Array.} convertedKeys List of keys that were previously converted - * (will not be reconverted) - * @param {boolean=} isViewState If it is undefined or false, then the preferences - * listed in 'rules' are those normal user-editable preferences. Otherwise, - * they are view state settings. - * @param {function(string)=} prefCheckCallback Optional callback function that - * examines each preference key for migration. - * @return {Promise} promise that is resolved once the conversion is done. Callbacks are given a - * `complete` flag that denotes whether everything from this object - * was converted (making it safe to delete entirely). - */ - PreferenceStorage.prototype.convert = function (rules, convertedKeys, isViewState, prefCheckCallback) { - var prefs = this._json, - self = this, - complete = true, - manager = isViewState ? PreferencesManager.stateManager : PreferencesManager, - deferred = new $.Deferred(); - - if (!convertedKeys) { - convertedKeys = []; - } - - Object.keys(prefs).forEach(function (key) { - if (convertedKeys.indexOf(key) > -1) { - return; - } - - var rule = rules[key]; - if (!rule && prefCheckCallback) { - rule = prefCheckCallback(key); - } else if (prefCheckCallback) { - // Check whether we have a new preference key-value pair - // for an old preference. - var newRule = prefCheckCallback(key, prefs[key]); - if (newRule) { - rule = _.cloneDeep(newRule); - } - } - if (!rule) { - console.warn("Preferences conversion for ", self._clientID, " has no rule for", key); - complete = false; - } else if (_.isString(rule)) { - var parts = rule.split(" "); - if (parts[0] === "user") { - var newKey = parts.length > 1 ? parts[1] : key; - var options = null; - - if (parts.length > 2 && parts[2].indexOf("/") !== -1) { - var projectPath = rule.substr(rule.indexOf(parts[2])); - options = { location: { scope: "user", - layer: "project", - layerID: projectPath } }; - } - - manager.set(newKey, prefs[key], options); - convertedKeys.push(key); - } - } else if (_.isObject(rule)) { - Object.keys(rule).forEach(function (ruleKey) { - manager.set(ruleKey, rule[ruleKey]); - }); - convertedKeys.push(key); - } else { - complete = false; - } - }); - - if (convertedKeys.length > 0) { - manager.save().done(function () { - _commit(); - deferred.resolve(complete, convertedKeys); - }).fail(function (error) { - deferred.reject(error); - }); - } else { - deferred.resolve(complete, convertedKeys); - } - - return deferred.promise(); - }; - - exports.PreferenceStorage = PreferenceStorage; -}); diff --git a/src/preferences/PreferencesManager.js b/src/preferences/PreferencesManager.js index 50b0993d5e3..7f25560aee3 100644 --- a/src/preferences/PreferencesManager.js +++ b/src/preferences/PreferencesManager.js @@ -21,6 +21,7 @@ * */ +/*global define, console */ /*unittests: Preferences Manager */ /** @@ -30,198 +31,16 @@ define(function (require, exports, module) { "use strict"; - var OldPreferenceStorage = require("preferences/PreferenceStorage").PreferenceStorage, - AppInit = require("utils/AppInit"), + var AppInit = require("utils/AppInit"), Commands = require("command/Commands"), CommandManager = require("command/CommandManager"), - DeprecationWarning = require("utils/DeprecationWarning"), FileUtils = require("file/FileUtils"), - ExtensionLoader = require("utils/ExtensionLoader"), PreferencesBase = require("preferences/PreferencesBase"), FileSystem = require("filesystem/FileSystem"), Strings = require("strings"), PreferencesImpl = require("preferences/PreferencesImpl"), _ = require("thirdparty/lodash"); - /** - * The local storage ID - * @const - * @type {string} - */ - var PREFERENCES_CLIENT_ID = "com.adobe.brackets.preferences"; - - /** - * The prefix used in the generated client ID - * @const - * @type {string} - */ - var CLIENT_ID_PREFIX = "com.adobe.brackets."; - - // Private Properties - var preferencesKey, - prefStorage, - persistentStorage, - extensionPaths, - doLoadPreferences = false; - - - /** - * @private - * Returns an array with the extension paths used in Brackets. The result is stored on a - * private variable on the first call and used to return the value on the next calls. - * @return {Array.} - */ - function _getExtensionPaths() { - if (!extensionPaths) { - var dirPath = FileUtils.getNativeBracketsDirectoryPath(); - - extensionPaths = [ - dirPath + "/extensions/default/", - dirPath + "/extensions/dev/", - ExtensionLoader.getUserExtensionPath() + "/" - ]; - } - return extensionPaths; - } - - /** - * This method returns a standardized ClientID for a given requireJS module object - * @param {!{id: string, uri: string}} module - A requireJS module object - * @return {string} The ClientID - */ - function getClientID(module) { - var paths = exports._getExtensionPaths(); - var pathUrl, clientID; - - paths.some(function (path) { - if (module.uri.toLocaleLowerCase().indexOf(path.toLocaleLowerCase()) === 0) { - pathUrl = path; - return true; - } - }); - - if (pathUrl) { - clientID = CLIENT_ID_PREFIX + module.uri.replace(pathUrl, ""); - } else { - clientID = CLIENT_ID_PREFIX + module.id; - } - return clientID; - } - - /** - * Retreive the preferences data for the given clientID. - * @deprecated - * - * @param {string|{id: string, uri: string}} clientID - A unique identifier or a requireJS module object - * @param {string=} defaults - Default preferences stored as JSON - * @param {boolean=} _doNotCreate Do not create the storage if it does not already exist. Used for conversion. - * @return {PreferenceStorage} - */ - function getPreferenceStorage(clientID, defaults, _doNotCreate) { - // No one should be calling this to access the old preference storage except for - // migrating the old preferences to the new model. So if this is called without - // having _doNotCreate set to true, then the caller is using the old preferences model. - if (!_doNotCreate) { - var clientString = typeof clientID === "object" ? clientID.uri : clientID; - DeprecationWarning.deprecationWarning("PreferencesManager.getPreferenceStorage() called with client id '" + - clientString + "' has been deprecated. Use PreferencesManager.definePreference() instead."); - } - if (!clientID || (typeof clientID === "object" && (!clientID.id || !clientID.uri))) { - console.error("Invalid clientID"); - return; - } - if (typeof clientID === "object") { - clientID = getClientID(clientID); - } - - var prefs = prefStorage[clientID]; - - if (prefs === undefined) { - if (_doNotCreate) { - return; - } - // create a new empty preferences object - prefs = (defaults && JSON.stringify(defaults)) ? defaults : {}; - prefStorage[clientID] = prefs; - } else if (defaults) { - // add new defaults - _.forEach(defaults, function (value, key) { - if (prefs[key] === undefined) { - prefs[key] = value; - } - }); - } - - return new OldPreferenceStorage(clientID, prefs); - } - - /** - * Save all preference clients. - */ - function savePreferences() { - // save all preferences - persistentStorage.setItem(preferencesKey, JSON.stringify(prefStorage)); - } - - /** - * @private - * Reset preferences and callbacks - */ - function _reset() { - prefStorage = {}; - - // Note that storage.clear() is not used. Production and unit test code - // both rely on the same backing storage but unique item keys. - persistentStorage.setItem(preferencesKey, JSON.stringify(prefStorage)); - } - - /** - * @private - * Initialize persistent storage implementation - */ - function _initStorage(storage) { - persistentStorage = storage; - - if (doLoadPreferences) { - prefStorage = JSON.parse(persistentStorage.getItem(preferencesKey)); - } - - // initialize empty preferences if none were found in storage - if (!prefStorage) { - _reset(); - } - } - - // Check localStorage for a preferencesKey. Production and unit test keys - // are used to keep preferences separate within the same storage implementation. - preferencesKey = window.localStorage.getItem("preferencesKey"); - - if (!preferencesKey) { - // use default key if none is found - preferencesKey = PREFERENCES_CLIENT_ID; - doLoadPreferences = true; - } else { - // using a non-default key, check for additional settings - doLoadPreferences = !!(window.localStorage.getItem("doLoadPreferences")); - } - - // Use localStorage by default - _initStorage(window.localStorage); - - - // Public API - exports.getPreferenceStorage = getPreferenceStorage; - exports.savePreferences = savePreferences; - exports.getClientID = getClientID; - - - // Unit test use only - exports._reset = _reset; - exports._getExtensionPaths = _getExtensionPaths; - - // New code follows. The code above (with the exception of the imports) is - // deprecated. - var currentFilename = null, // the filename currently being edited currentLanguageId = null, // the language id of the file currently being edited projectDirectory = null, @@ -298,62 +117,6 @@ define(function (require, exports, module) { return PreferencesImpl.manager.getPrefixedSystem(prefix); } - /** - * Converts from the old localStorage-based preferences to the new-style - * preferences according to the "rules" given. - * - * `rules` is an object, the keys of which refer to the preference names. - * The value tells the converter what to do. The following values are available: - * - * * `user`: convert to a user-level preference - * * `user newkey`: convert to a user-level preference, changing the key to newkey - * - * Once a key has been converted, it will not be converted again. - * @deprecated - * - * @param {string|Object} clientID ClientID used in the old preferences - * @param {Object} rules Rules for conversion (as defined above) - * @param {boolean=} isViewState If it is undefined or false, then the preferences - * listed in 'rules' are those normal user-editable preferences. Otherwise, - * they are view state settings. - * @param {function(string)=} prefCheckCallback Optional callback function that - * examines each preference key for migration. - */ - function convertPreferences(clientID, rules, isViewState, prefCheckCallback) { - DeprecationWarning.deprecationWarning("PreferencesManager.convertPreferences() has been deprecated. " + - "Please upgrade to the current Preferences system " + - "(https://github.com/adobe/brackets/wiki/Preferences-System#conversion-from-the-pre-36-preferences-system)."); - PreferencesImpl.smUserScopeLoading.done(function () { - PreferencesImpl.userScopeLoading.done(function () { - if (!clientID || (typeof clientID === "object" && (!clientID.id || !clientID.uri))) { - console.error("Invalid clientID"); - return; - } - var prefs = getPreferenceStorage(clientID, null, true); - - if (!prefs) { - return; - } - - var prefsID = typeof clientID === "object" ? getClientID(clientID) : clientID; - if (prefStorage.convertedKeysMap === undefined) { - prefStorage.convertedKeysMap = {}; - } - var convertedKeysMap = prefStorage.convertedKeysMap; - - prefs.convert(rules, convertedKeysMap[prefsID], isViewState, prefCheckCallback) - .done(function (complete, convertedKeys) { - prefStorage.convertedKeysMap[prefsID] = convertedKeys; - savePreferences(); - }); - }).fail(function (error) { - console.error("Error while converting ", typeof clientID === "object" ? getClientID(clientID) : clientID); - console.error(error); - }); - }); - } - - // Constants for preference lookup contexts. /** @@ -522,23 +285,6 @@ define(function (require, exports, module) { CommandManager.register(Strings.CMD_OPEN_PREFERENCES, Commands.FILE_OPEN_PREFERENCES, _handleOpenPreferences); - /** - * Convenience function that sets a preference and then saves the file, mimicking the - * old behavior a bit more closely. - * @deprecated Use set instead. - * - * @param {string} id preference to set - * @param {*} value new value for the preference - * @param {{location: ?Object, context: ?Object|string}=} options Specific location in which to set the value or the context to use when setting the value - * @return {boolean} true if a value was set - */ - function setValueAndSave(id, value, options) { - DeprecationWarning.deprecationWarning("PreferencesManager.setValueAndSave() called for " + id + ". Use PreferencesManager.set() instead.", true); - var changed = exports.set(id, value, options).stored; - PreferencesImpl.manager.save(); - return changed; - } - /** * Convenience function that gets a view state * @@ -597,7 +343,6 @@ define(function (require, exports, module) { exports.getPreference = PreferencesImpl.manager.getPreference.bind(PreferencesImpl.manager); exports.getAllPreferences = PreferencesImpl.manager.getAllPreferences.bind(PreferencesImpl.manager); exports.getExtensionPrefs = getExtensionPrefs; - exports.setValueAndSave = setValueAndSave; exports.getViewState = getViewState; exports.setViewState = setViewState; exports.addScope = PreferencesImpl.manager.addScope.bind(PreferencesImpl.manager); @@ -606,5 +351,4 @@ define(function (require, exports, module) { exports.SETTINGS_FILENAME = PreferencesImpl.SETTINGS_FILENAME; exports.definePreference = PreferencesImpl.manager.definePreference.bind(PreferencesImpl.manager); exports.fileChanged = PreferencesImpl.manager.fileChanged.bind(PreferencesImpl.manager); - exports.convertPreferences = convertPreferences; }); diff --git a/src/project/ProjectManager.js b/src/project/ProjectManager.js index c004385e200..5cd287dc50c 100644 --- a/src/project/ProjectManager.js +++ b/src/project/ProjectManager.js @@ -1222,50 +1222,11 @@ define(function (require, exports, module) { ViewUtils.addScrollerShadow($projectTreeContainer[0]); }); - /** - * @private - * Examine each preference key for migration of project tree states. - * If the key has a prefix of "projectTreeState_/", then it is a project tree states - * preference from old preference model. - * - * @param {string} key The key of the preference to be examined - * for migration of project tree states. - * @return {?string} - the scope to which the preference is to be migrated - */ - function _checkPreferencePrefix(key) { - var pathPrefix = "projectTreeState_", - projectPath; - if (key.indexOf(pathPrefix) === 0) { - // Get the project path from the old preference key by stripping "projectTreeState_". - projectPath = key.substr(pathPrefix.length); - return "user project.treeState " + projectPath; - } - - pathPrefix = "projectBaseUrl_"; - if (key.indexOf(pathPrefix) === 0) { - // Get the project path from the old preference key by stripping "projectBaseUrl_[Directory " - // and "]". - projectPath = key.substr(key.indexOf(" ") + 1); - projectPath = projectPath.substr(0, projectPath.length - 1); - return "user project.baseUrl " + projectPath; - } - - return null; - } - - EventDispatcher.makeEventDispatcher(exports); // Init default project path to welcome project PreferencesManager.stateManager.definePreference("projectPath", "string", _getWelcomeProjectPath()); - PreferencesManager.convertPreferences(module, { - "projectPath": "user", - "projectTreeState_": "user", - "welcomeProjects": "user", - "projectBaseUrl_": "user" - }, true, _checkPreferencePrefix); - exports.on("projectOpen", _reloadProjectPreferencesScope); exports.on("projectOpen", _saveProjectPath); exports.on("beforeAppClose", _unwatchProjectRoot); diff --git a/src/project/WorkingSetSort.js b/src/project/WorkingSetSort.js index a654c31af3d..374577127e0 100644 --- a/src/project/WorkingSetSort.js +++ b/src/project/WorkingSetSort.js @@ -378,7 +378,6 @@ define(function (require, exports, module) { * Initialize default values for sorting preferences */ PreferencesManager.stateManager.definePreference("automaticSort", "boolean", false); - PreferencesManager.convertPreferences(module, {_LEGACY_SORT_PREF: "user", "automaticSort": "user"}, true); /** * Define a default sort method that's empty so that we diff --git a/src/search/FindBar.js b/src/search/FindBar.js index c96d5c357f9..b7561d87aa4 100644 --- a/src/search/FindBar.js +++ b/src/search/FindBar.js @@ -611,7 +611,6 @@ define(function (require, exports, module) { PreferencesManager.stateManager.definePreference("caseSensitive", "boolean", false); PreferencesManager.stateManager.definePreference("regexp", "boolean", false); - PreferencesManager.convertPreferences(module, {"caseSensitive": "user", "regexp": "user"}, true); exports.FindBar = FindBar; }); diff --git a/src/utils/Resizer.js b/src/utils/Resizer.js index 36d61cc3a88..f2ddc95cff2 100644 --- a/src/utils/Resizer.js +++ b/src/utils/Resizer.js @@ -538,24 +538,6 @@ define(function (require, exports, module) { } }); - /** - * @private - * Examine each preference key for migration of any panel state. - * - * @param {string} key The key of the preference to be examined - * for migration of panel states. - * @return {?string} - the scope to which the preference is to be migrated - */ - function _isPanelPreferences(key) { - if (key) { - return "user"; - } - - return null; - } - - PreferencesManager.convertPreferences(module, {"panelState": "user"}, true, _isPanelPreferences); - EventDispatcher.makeEventDispatcher(exports); exports.makeResizable = makeResizable; diff --git a/src/utils/UpdateNotification.js b/src/utils/UpdateNotification.js index 47ded1acb6d..9d649c0ef0e 100644 --- a/src/utils/UpdateNotification.js +++ b/src/utils/UpdateNotification.js @@ -61,12 +61,6 @@ define(function (require, exports, module) { // Data about available updates in the registry PreferencesManager.stateManager.definePreference("extensionUpdateInfo", "Array", []); - PreferencesManager.convertPreferences(module, { - "lastNotifiedBuildNumber": "user", - "lastInfoURLFetchTime": "user", - "updateInfo": "user" - }, true); - // 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. diff --git a/src/view/ViewCommandHandlers.js b/src/view/ViewCommandHandlers.js index c4818a6588c..15bb311a491 100644 --- a/src/view/ViewCommandHandlers.js +++ b/src/view/ViewCommandHandlers.js @@ -493,21 +493,6 @@ define(function (require, exports, module) { ThemeSettings.showDialog(); } - - /** - * @private - * Convert the old "fontSizeAdjustment" preference to the new view state. - * - * @param {string} key The key of the preference to be examined for migration - * of old preferences. Not used since we only have one in this module. - * @param {string} value The value of "fontSizeAdjustment" preference - * @return {Object} JSON object for the new view state equivalent to - * the old "fontSizeAdjustment" preference. - */ - function _convertToNewViewState(key, value) { - return { "fontSizeStyle": (DEFAULT_FONT_SIZE + value) + "px" }; - } - // Register command handlers CommandManager.register(Strings.CMD_INCREASE_FONT_SIZE, Commands.VIEW_INCREASE_FONT_SIZE, _handleIncreaseFontSize); CommandManager.register(Strings.CMD_DECREASE_FONT_SIZE, Commands.VIEW_DECREASE_FONT_SIZE, _handleDecreaseFontSize); @@ -516,8 +501,6 @@ define(function (require, exports, module) { CommandManager.register(Strings.CMD_SCROLL_LINE_DOWN, Commands.VIEW_SCROLL_LINE_DOWN, _handleScrollLineDown); CommandManager.register(Strings.CMD_THEMES, Commands.CMD_THEMES_OPEN_SETTINGS, _handleThemeSettings); - PreferencesManager.convertPreferences(module, {"fontSizeAdjustment": "user"}, true, _convertToNewViewState); - prefs.definePreference("fontSize", "string", DEFAULT_FONT_SIZE + "px", { description: Strings.DESCRIPTION_FONT_SIZE }).on("change", function () { diff --git a/test/spec/PreferencesManager-test.js b/test/spec/PreferencesManager-test.js index ab71331e0d4..8b0b39a3e55 100644 --- a/test/spec/PreferencesManager-test.js +++ b/test/spec/PreferencesManager-test.js @@ -27,81 +27,12 @@ define(function (require, exports, module) { 'use strict'; // Load dependent modules - var PreferenceStorage = require("preferences/PreferenceStorage").PreferenceStorage, - SpecRunnerUtils = require("spec/SpecRunnerUtils"), + var SpecRunnerUtils = require("spec/SpecRunnerUtils"), testPath = SpecRunnerUtils.getTestPath("/spec/PreferencesBase-test-files"), nonProjectFile = SpecRunnerUtils.getTestPath("/spec/PreferencesBase-test.js"), PreferencesManager, testWindow; - var CLIENT_ID = "PreferencesManager-test"; - - describe("PreferenceStorage", function () { - - it("should read initial preferences from JSON", function () { - var store = new PreferenceStorage(CLIENT_ID, {"foo": "bar", hello: "world"}); - expect(store.getValue("foo")).toBe("bar"); - expect(store.getValue("hello")).toBe("world"); - }); - - it("should store values as JSON", function () { - var json = {}; - var store = new PreferenceStorage(CLIENT_ID, json); - store.setValue("foo", 42); - - expect(json.foo).toEqual(42); - expect(store.getValue("foo")).toBe(42); - }); - - it("should output preferences as JSON", function () { - var store = new PreferenceStorage(CLIENT_ID, {}); - store.setValue("foo", 42); - var json = store.getAllValues(); - - expect(json.foo).toEqual(42); - }); - - it("should remove values", function () { - var store = new PreferenceStorage(CLIENT_ID, {"foo": "bar"}); - expect(store.getValue("foo")).toBe("bar"); - - store.remove("foo"); - expect(store.getValue("foo")).toBe(undefined); - }); - - it("should use setAllValues to append multiple new name/value pairs", function () { - var initial = {"foo": "bar"}; - var store = new PreferenceStorage(CLIENT_ID, initial); - - // append - store.setAllValues({"hello": ["world", "!"], "goodbye": 42}, true); - expect(store.getValue("foo")).toBe("bar"); - expect(store.getValue("hello")).toEqual(["world", "!"]); - expect(store.getValue("goodbye")).toBe(42); - - // overwrite - store.setAllValues({"winning": false}, false); - expect(store.getValue("foo")).toBe(undefined); - expect(store.getValue("hello")).toBe(undefined); - expect(store.getValue("goodbye")).toBe(undefined); - expect(store.getValue("winning")).toBe(false); - }); - - it("should throw errors for invalid values", function () { - var store = new PreferenceStorage(CLIENT_ID, {"foo": 42}); - - expect(store.getValue("foo")).toBe(42); - // function data is not valid JSON - store.setValue("foo", function () {}); - expect(store.getValue("foo")).toBe(42); - - // number key is not valid JSON - store.setValue(42, "bar"); - expect(store.getValue(42)).toBe(undefined); - }); - - }); - describe("PreferencesManager", function () { this.category = "integration"; @@ -120,13 +51,6 @@ define(function (require, exports, module) { SpecRunnerUtils.closeTestWindow(); }); - beforeEach(function () { - // SpecRunner.js already initializes the unit test instance of - // PreferencesManager to use the unit test key. All we need to do - // here is reset to clear callbacks and in-memory preferences. - PreferencesManager._reset(); - }); - it("should find preferences in the project", function () { var projectWithoutSettings = SpecRunnerUtils.getTestPath("/spec/WorkingSetView-test-files"), FileViewController = testWindow.brackets.test.FileViewController; @@ -152,43 +76,5 @@ define(function (require, exports, module) { expect(PreferencesManager.get("spaceUnits")).not.toBe(9); }); }); - - - // Old tests follow - it("should use default preferences", function () { - var store = PreferencesManager.getPreferenceStorage(CLIENT_ID, {foo: "default"}); - expect(store.getValue("foo")).toEqual("default"); - }); - - describe("Create clientID for preference store", function () { - it("should return clientID for module that exists in extension directories", function () { - spyOn(PreferencesManager, "_getExtensionPaths").andCallFake(function () { - return ['/local/Extension/Folder/Extensions/', - '/User/test/Library/Application Support/Brackets/extensions/user/', - 'c:/Program Files (x86)/Brackets/wwww/extensions/default/']; - }); - - var module = {id: 'utils/Resizer', uri: '/local/Extension/Folder/Extensions/utils/Resizer.js'}; - - var clientID = PreferencesManager.getClientID(module); - expect(clientID).toBe("com.adobe.brackets.utils/Resizer.js"); - - clientID = PreferencesManager.getClientID({id: 'main', uri: '/User/test/Library/Application Support/Brackets/extensions/user/HelloWorld/main.js'}); - expect(clientID).toBe("com.adobe.brackets.HelloWorld/main.js"); - - clientID = PreferencesManager.getClientID({id: 'main', uri: 'c:/Program Files (x86)/Brackets/wwww/extensions/default/JSLint/main.js'}); - expect(clientID).toBe("com.adobe.brackets.JSLint/main.js"); - }); - - it("should always return a clientID for a module that doesn't exist in extension directories", function () { - spyOn(PreferencesManager, "_getExtensionPaths").andCallFake(function () { - return []; // no extension directories - }); - - var clientID = PreferencesManager.getClientID({id: 'main', uri: '/path/is/not/an/Extension/directory/someExtension/main.js'}); - expect(clientID).toBe("com.adobe.brackets.main"); - }); - }); - }); }); From c6966d2cd0dffefc9f16dea323455d8aa64a6be8 Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Sun, 4 Sep 2016 23:59:27 +0200 Subject: [PATCH 005/151] Add a Code of Conduct --- CODE_OF_CONDUCT.md | 74 ++++++++++++++++++++++++++++++++++++++++++++++ README.md | 3 ++ 2 files changed, 77 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..620998fda66 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at [admin@brackets.io](mailto:admin@brackets.io). All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ \ No newline at end of file diff --git a/README.md b/README.md index 3bc231e10d4..310fb4ad66e 100644 --- a/README.md +++ b/README.md @@ -118,3 +118,6 @@ Not sure you needed the exclamation point there, but we like your enthusiasm. * **Blog:** http://blog.brackets.io/ * **IRC:** [#brackets on freenode](http://webchat.freenode.net/?channels=brackets) +--- + +Please note that this project is released with a [Contributor Code of Conduct](https://github.com/adobe/brackets/blob/master/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. \ No newline at end of file From fc5a11460fd824c69d0bf8a67e7a38d93fd9500c Mon Sep 17 00:00:00 2001 From: Shubham Yadav Date: Wed, 26 Oct 2016 15:21:18 +0530 Subject: [PATCH 006/151] Bumping version Number to 1.9 --- package.json | 4 ++-- src/config.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 950b6ba98fe..9e18985fdef 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "Brackets", - "version": "1.8.0-0", - "apiVersion": "1.8.0", + "version": "1.9.0-0", + "apiVersion": "1.9.0", "homepage": "http://brackets.io", "issues": { "url": "http://github.com/adobe/brackets/issues" diff --git a/src/config.json b/src/config.json index e769d723bcd..08735af05a2 100644 --- a/src/config.json +++ b/src/config.json @@ -23,8 +23,8 @@ "healthDataServerURL": "https://healthdev.brackets.io/healthDataLog" }, "name": "Brackets", - "version": "1.8.0-0", - "apiVersion": "1.8.0", + "version": "1.9.0-0", + "apiVersion": "1.9.0", "homepage": "http://brackets.io", "issues": { "url": "http://github.com/adobe/brackets/issues" From e78688aaa49af789726114721568637550bfaf86 Mon Sep 17 00:00:00 2001 From: "I-Chun (Arthur) Liu" Date: Fri, 28 Oct 2016 16:35:26 +0800 Subject: [PATCH 007/151] Add a feature to toggle between panes in the core #10555 (#12853) * Added the feature to toggle between panes as requested by petetnt in issues #10555 * Added the feature to toggle between panes as requested by petetnt in issues #10555 * Bumping version Number to 1.9 * Edited the files and added a unit test for this feature as requested by petetnt and swmitra * Removed duplicate/unnecessary code in Pane.js * Removed additional duplicate/unnecessary code in Pane.js * Edited 'should switch pane when alt-w is pressed' function in MainViewManager-test.js and the test is now passing * Revert package.json and src/config.json to previous commit * Added the feature to toggle between panes as requested by petetnt in issues #10555 * Added the feature to toggle between panes as requested by petetnt in issues #10555 * Edited the files and added a unit test for this feature as requested by petetnt and swmitra * Removed duplicate/unnecessary code in Pane.js * Removed additional duplicate/unnecessary code in Pane.js * Edited 'should switch pane when alt-w is pressed' function in MainViewManager-test.js and the test is now passing * Revert package.json and src/config.json to previous commit * Modified test code to test CMD_SWITCH_PANE_FOCUS * Removed unnecessary code in MainViewManager-test.js --- src/command/Commands.js | 1 + src/nls/root/strings.js | 1 + src/view/MainViewManager.js | 25 ++++++++++++++++++++++--- test/spec/MainViewManager-test.js | 28 ++++++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 3 deletions(-) diff --git a/src/command/Commands.js b/src/command/Commands.js index 03b1ec8d271..40eae36b16d 100644 --- a/src/command/Commands.js +++ b/src/command/Commands.js @@ -153,6 +153,7 @@ define(function (require, exports, module) { exports.CMD_SPLITVIEW_NONE = "cmd.splitViewNone"; // SidebarView.js _handleSplitNone() exports.CMD_SPLITVIEW_VERTICAL = "cmd.splitViewVertical"; // SidebarView.js _handleSplitVertical() exports.CMD_SPLITVIEW_HORIZONTAL = "cmd.splitViewHorizontal"; // SidebarView.js _handleSplitHorizontal() + exports.CMD_SWITCH_PANE_FOCUS = "cmd.switchPaneFocus"; // MainViewManager.js _switchPaneFocus() // File shell callbacks - string must MATCH string in native code (appshell/command_callbacks.h) exports.HELP_ABOUT = "help.about"; // HelpCommandHandlers.js _handleAboutDialog() diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index a0ee7f9e182..c504e64eb6f 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -418,6 +418,7 @@ define({ "CMD_SHOW_IN_EXPLORER" : "Show in Explorer", "CMD_SHOW_IN_FINDER" : "Show in Finder", "CMD_SHOW_IN_OS" : "Show in OS", + "CMD_SWITCH_PANE_FOCUS" : "Switch Pane Focus", // Help menu commands "HELP_MENU" : "Help", diff --git a/src/view/MainViewManager.js b/src/view/MainViewManager.js index 1b96c2c7938..1ae39be9940 100644 --- a/src/view/MainViewManager.js +++ b/src/view/MainViewManager.js @@ -92,7 +92,8 @@ define(function (require, exports, module) { AsyncUtils = require("utils/Async"), ViewUtils = require("utils/ViewUtils"), Resizer = require("utils/Resizer"), - Pane = require("view/Pane").Pane; + Pane = require("view/Pane").Pane, + KeyBindingManager = brackets.getModule("command/KeyBindingManager"); /** * Preference setting name for the MainView Saved State @@ -844,6 +845,19 @@ define(function (require, exports, module) { return result.promise(); } + /** + * Switch between panes + */ + function switchPaneFocus() { + var $firstPane = $('#first-pane'), $secondPane = $('#second-pane'); + if($firstPane.hasClass('active-pane')) { + $secondPane.click(); + } + else { + $firstPane.click(); + } + } + /** * DocumentManager.pathDeleted Event handler to remove a file * from the MRU list @@ -1616,6 +1630,10 @@ define(function (require, exports, module) { // get an event handler for workspace events and we don't listen // to the event before we've been initialized WorkspaceManager.on("workspaceUpdateLayout", _updateLayout); + + // Listen to key Alt-W to toggle between panes + CommandManager.register(Strings.CMD_SWITCH_PANE_FOCUS, Commands.CMD_SWITCH_PANE_FOCUS, switchPaneFocus); + KeyBindingManager.addBinding(Commands.CMD_SWITCH_PANE_FOCUS, {key: 'Alt-W'}); } /** @@ -1658,8 +1676,8 @@ define(function (require, exports, module) { return result; } - - + + /** * Setup a ready event to initialize ourself */ @@ -1729,6 +1747,7 @@ define(function (require, exports, module) { exports.getAllOpenFiles = getAllOpenFiles; exports.focusActivePane = focusActivePane; + exports.switchPaneFocus = switchPaneFocus; // Layout exports.setLayoutScheme = setLayoutScheme; diff --git a/test/spec/MainViewManager-test.js b/test/spec/MainViewManager-test.js index 4712b04159c..ac36df78757 100644 --- a/test/spec/MainViewManager-test.js +++ b/test/spec/MainViewManager-test.js @@ -536,6 +536,34 @@ define(function (require, exports, module) { expect(MainViewManager.getLayoutScheme()).toEqual({rows: 1, columns: 1}); }); }); + it("should switch pane when Commands.CMD_SWITCH_PANE_FOCUS is called", function () { + runs(function () { + MainViewManager.setLayoutScheme(1, 2); + }); + runs(function () { + $('#first-pane').click(); + CommandManager.execute(Commands.CMD_SWITCH_PANE_FOCUS); + expect(MainViewManager.getActivePaneId()).toEqual("second-pane"); + }); + runs(function () { + $('#second-pane').click(); + CommandManager.execute(Commands.CMD_SWITCH_PANE_FOCUS); + expect(MainViewManager.getActivePaneId()).toEqual("first-pane"); + }); + runs(function () { + MainViewManager.setLayoutScheme(2, 1); + }); + runs(function () { + $('#first-pane').click(); + CommandManager.execute(Commands.CMD_SWITCH_PANE_FOCUS); + expect(MainViewManager.getActivePaneId()).toEqual("second-pane"); + }); + runs(function () { + $('#second-pane').click(); + CommandManager.execute(Commands.CMD_SWITCH_PANE_FOCUS); + expect(MainViewManager.getActivePaneId()).toEqual("first-pane"); + }); + }); it("should activate pane when editor gains focus", function () { var editors = {}, handler = function (e, doc, editor, paneId) { From 469748561bb018bd3d201feea1c7487e887b9933 Mon Sep 17 00:00:00 2001 From: Chen-Heng Chang Date: Sun, 30 Oct 2016 04:00:40 -0500 Subject: [PATCH 008/151] fix InlineImageViewer example extension (#9191) * fix InlineImageViewer example extension * separate style of inline image viewer --- .../samples/InlineImageViewer/InlineImageViewer.html | 8 ++++---- src/extensions/samples/InlineImageViewer/main.js | 4 +++- src/extensions/samples/InlineImageViewer/style.css | 11 +++++++++++ 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 src/extensions/samples/InlineImageViewer/style.css diff --git a/src/extensions/samples/InlineImageViewer/InlineImageViewer.html b/src/extensions/samples/InlineImageViewer/InlineImageViewer.html index b173e3cf641..c6d8f549e1e 100644 --- a/src/extensions/samples/InlineImageViewer/InlineImageViewer.html +++ b/src/extensions/samples/InlineImageViewer/InlineImageViewer.html @@ -1,4 +1,4 @@ -
-
- -
\ No newline at end of file +
+
+ +
diff --git a/src/extensions/samples/InlineImageViewer/main.js b/src/extensions/samples/InlineImageViewer/main.js index 5201c479321..066b21f54a6 100644 --- a/src/extensions/samples/InlineImageViewer/main.js +++ b/src/extensions/samples/InlineImageViewer/main.js @@ -28,6 +28,7 @@ define(function (require, exports, module) { // Brackets modules var EditorManager = brackets.getModule("editor/EditorManager"), + ExtensionUtils = brackets.getModule("utils/ExtensionUtils"), ProjectManager = brackets.getModule("project/ProjectManager"); // Local modules @@ -45,7 +46,7 @@ define(function (require, exports, module) { // If the pos is at the beginning of a name, token will be the // preceding whitespace or dot. In that case, try the next pos. - if (!/\S/.match(token.string) || token.string === ".") { + if (!/\S/.test(token.string) || token.string === ".") { token = hostEditor._codeMirror.getTokenAt({line: pos.line, ch: pos.ch + 1}, true); } @@ -128,5 +129,6 @@ define(function (require, exports, module) { return result.promise(); } + ExtensionUtils.loadStyleSheet(module, "style.css"); EditorManager.registerInlineEditProvider(inlineImageViewerProvider); }); diff --git a/src/extensions/samples/InlineImageViewer/style.css b/src/extensions/samples/InlineImageViewer/style.css new file mode 100644 index 00000000000..6dff6d02e26 --- /dev/null +++ b/src/extensions/samples/InlineImageViewer/style.css @@ -0,0 +1,11 @@ +.inline-image-viewer .filename { + text-align: right; + padding-right: 1.5em; + line-height: 32px; +} + +.inline-image-viewer .image { + display: block; + margin: 0 auto; + opacity: 0; +} \ No newline at end of file From c77d4f860ee0a7fecb6917038467cddd6eb4e312 Mon Sep 17 00:00:00 2001 From: Valtteri Laitinen Date: Sun, 30 Oct 2016 18:10:21 +0200 Subject: [PATCH 009/151] Use standard CSS gradients in Color Editor (#12861) --- src/extensions/default/InlineColorEditor/ColorEditor.js | 2 +- src/extensions/default/InlineColorEditor/css/main.less | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/extensions/default/InlineColorEditor/ColorEditor.js b/src/extensions/default/InlineColorEditor/ColorEditor.js index 8e1132be7ce..79d1dee616e 100644 --- a/src/extensions/default/InlineColorEditor/ColorEditor.js +++ b/src/extensions/default/InlineColorEditor/ColorEditor.js @@ -171,7 +171,7 @@ define(function (require, exports, module) { // Update gradients in color square & opacity slider this.$selectionBase.css("background-color", colorObject.toHexString()); - this.$opacityGradient.css("background-image", "-webkit-gradient(linear, 0% 0%, 0% 100%, from(" + hueColor + "), to(transparent))"); + this.$opacityGradient.css("background-image", "linear-gradient(" + hueColor + ", transparent)"); // Update slider thumb positions this.$hueSelector.css("bottom", (this._hsv.h / 360 * 100) + "%"); diff --git a/src/extensions/default/InlineColorEditor/css/main.less b/src/extensions/default/InlineColorEditor/css/main.less index 8229e595e6f..4593ecdeaf9 100644 --- a/src/extensions/default/InlineColorEditor/css/main.less +++ b/src/extensions/default/InlineColorEditor/css/main.less @@ -135,10 +135,10 @@ float: left; } .color-editor section .color-selection-field .saturation-gradient { - background-image: -webkit-gradient(linear, 0% 50%, 100% 50%, from(#fff), to(rgba(255,255,255,0))); + background-image: linear-gradient(to left, hsla(0,0%,100%,0), #fff); } .color-editor section .color-selection-field .luminosity-gradient { - background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(transparent), to(#000)); + background-image: linear-gradient(hsla(0,0%,100%,0), #000); } .color-editor section .color-selection-field .selector-base { width: 12px; @@ -200,7 +200,7 @@ margin-right: 0px; } .color-editor section .hue-slider { - background-image: -webkit-linear-gradient(top, #f00, #f0f, #00f, #0ff, #0f0, #ff0, #f00); + background-image: linear-gradient(#f00, #f0f, #00f, #0ff, #0f0, #ff0, #f00); } .color-editor section footer { font-size: 100%; From 150c657acbac5c77bc83d85257b1862f25c783b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pete=20Nyk=C3=A4nen?= Date: Tue, 1 Nov 2016 10:25:15 +0200 Subject: [PATCH 010/151] Update ISSUE_TEMPLATE.md to cover platform differences (#12866) There are small differences between the platforms, as evident in https://github.com/adobe/brackets/issues/12864. This PR fixes that. Could someone check that the Linux version has the menu under Help, as I don't have a GUI machine at hand. --- ISSUE_TEMPLATE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index 74a662687cf..3e4397396b0 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -1,6 +1,6 @@ ### Prerequisites -* [ ] Can you reproduce the problem with `Debug \ Reload Without Extensions`? +* [ ] Can you reproduce the problem with `Debug -> Reload Without Extensions`? * [ ] Did you perform a cursory search to see if your bug or enhancement is already reported? * [ ] Did you read the [Troubleshooting guide](https://github.com/adobe/brackets/wiki/Troubleshooting)? @@ -24,4 +24,4 @@ For more information on how to contribute read [here](https://github.com/adobe/b ### Versions Please include the OS and what version of the OS you're running. -Please include the version of Brackets. You can find it under `Help \ About Brackets` +Please include the version of Brackets. You can find it under `Help -> About Brackets` (Windows and Linux) or `Brackets -> About Brackets` (macOS) From 491fab9694dde3e70cc12df39e6e3777698374b7 Mon Sep 17 00:00:00 2001 From: Colleen Orwin Date: Fri, 11 Nov 2016 15:33:43 -0500 Subject: [PATCH 011/151] English comments were changed to French --- samples/fr/Premiers pas/index.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/samples/fr/Premiers pas/index.html b/samples/fr/Premiers pas/index.html index cf1129c8ba2..084d8073b8d 100644 --- a/samples/fr/Premiers pas/index.html +++ b/samples/fr/Premiers pas/index.html @@ -14,7 +14,7 @@

PREMIERS PAS AVEC BRACKETS

Suivez le guide !

@@ -22,7 +22,7 @@

Suivez le guide !

Brackets se distingue des éditeurs traditionnels, @@ -30,7 +30,7 @@

Suivez le guide !

Projets Brackets

@@ -45,7 +45,7 @@

Projets Brackets

Edition rapide des codes CSS et JavaScript

@@ -71,7 +71,7 @@

Edition rapide des codes CSS et JavaScript

Affichage des modifications HTML et CSS en direct dans le navigateur

@@ -114,7 +114,7 @@

Vous en voulez plus ? Jetez un œil du côté des extensions !

Participer

@@ -155,4 +155,4 @@

Participer

[:::::::::::::: ::::::::::::::] [[[[[[[[[[[[[[[ ]]]]]]]]]]]]]]] ---> \ No newline at end of file +--> From 94ed8b3d42707a652cb3b6279deb73aceadc7570 Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Fri, 18 Nov 2016 03:38:02 +1100 Subject: [PATCH 012/151] improvements to file system events processing for search (#12885) * improvements to file system events processing * working on comments * jsdoc * little bit of optimization --- src/search/FindInFiles.js | 198 ++++++++++++++++++++++++++------------ 1 file changed, 137 insertions(+), 61 deletions(-) diff --git a/src/search/FindInFiles.js b/src/search/FindInFiles.js index 9e416b8fe17..02954dd3bae 100644 --- a/src/search/FindInFiles.js +++ b/src/search/FindInFiles.js @@ -73,12 +73,24 @@ define(function (require, exports, module) { var searchModel = new SearchModel(); /* Forward declarations */ - var _documentChangeHandler, _fileSystemChangeHandler, _fileNameChangeHandler, clearSearch; + var _documentChangeHandler, + _fileSystemChangeHandler, + _processCachedFileSystemEvents, + _debouncedFileSystemChangeHandler, + _fileNameChangeHandler, + clearSearch; + + /** + * Waits for FS changes to stack up until processing them + * (scripts like npm install can do a lot of movements on the disk) + * @const + */ + var FILE_SYSTEM_EVENT_DEBOUNCE_TIME = 100; /** Remove the listeners that were tracking potential search result changes */ function _removeListeners() { DocumentModule.off("documentChange", _documentChangeHandler); - FileSystem.off("change", _fileSystemChangeHandler); + FileSystem.off("change", _debouncedFileSystemChangeHandler); DocumentManager.off("fileNameChange", _fileNameChangeHandler); } @@ -88,7 +100,7 @@ define(function (require, exports, module) { _removeListeners(); DocumentModule.on("documentChange", _documentChangeHandler); - FileSystem.on("change", _fileSystemChangeHandler); + FileSystem.on("change", _debouncedFileSystemChangeHandler); DocumentManager.on("fileNameChange", _fileNameChangeHandler); } @@ -658,7 +670,7 @@ define(function (require, exports, module) { * @param {array} fileList The list of files that changed. */ function filesChanged(fileList) { - if (FindUtils.isNodeSearchDisabled() || fileList.length === 0) { + if (FindUtils.isNodeSearchDisabled() || !fileList || fileList.length === 0) { return; } var updateObject = { @@ -676,7 +688,7 @@ define(function (require, exports, module) { * @param {array} fileList The list of files that was removed. */ function filesRemoved(fileList) { - if (FindUtils.isNodeSearchDisabled()) { + if (FindUtils.isNodeSearchDisabled() || !fileList || fileList.length === 0) { return; } var updateObject = { @@ -732,69 +744,83 @@ define(function (require, exports, module) { /* * Remove existing search results that match the given entry's path - * @param {(File|Directory)} entry + * @param {Array.<(File|Directory)>} entries */ - function _removeSearchResultsForEntry(entry) { - Object.keys(searchModel.results).forEach(function (fullPath) { - if (fullPath === entry.fullPath || - (entry.isDirectory && fullPath.indexOf(entry.fullPath) === 0)) { - // node search : inform node that the file is removed - filesRemoved([fullPath]); - if (findOrReplaceInProgress) { - searchModel.removeResults(fullPath); - resultsChanged = true; + function _removeSearchResultsForEntries(entries) { + var fullPaths = []; + entries.forEach(function (entry) { + Object.keys(searchModel.results).forEach(function (fullPath) { + if (fullPath === entry.fullPath || + (entry.isDirectory && fullPath.indexOf(entry.fullPath) === 0)) { + // node search : inform node that the file is removed + fullPaths.push(fullPath); + if (findOrReplaceInProgress) { + searchModel.removeResults(fullPath); + resultsChanged = true; + } } - } + }); }); + // this should be called once with a large array instead of numerous calls with single items + filesRemoved(fullPaths); } /* - * Add new search results for this entry and all of its children - * @param {(File|Directory)} entry + * Add new search results for these entries and all of its children + * @param {Array.<(File|Directory)>} entries * @return {jQuery.Promise} Resolves when the results have been added */ - function _addSearchResultsForEntry(entry) { - var addedFiles = [], - addedFilePaths = [], - deferred = new $.Deferred(); - - // gather up added files - var visitor = function (child) { - // Replicate filtering that getAllFiles() does - if (ProjectManager.shouldShow(child)) { - if (child.isFile && _isReadableText(child.name)) { - // Re-check the filtering that the initial search applied - if (_inSearchScope(child)) { - addedFiles.push(child); - addedFilePaths.push(child.fullPath); + function _addSearchResultsForEntries(entries) { + var fullPaths = []; + return Async.doInParallel(entries, function (entry) { + var addedFiles = [], + addedFilePaths = [], + deferred = new $.Deferred(); + + // gather up added files + var visitor = function (child) { + // Replicate filtering that getAllFiles() does + if (ProjectManager.shouldShow(child)) { + if (child.isFile && _isReadableText(child.name)) { + // Re-check the filtering that the initial search applied + if (_inSearchScope(child)) { + addedFiles.push(child); + addedFilePaths.push(child.fullPath); + } } + return true; } - return true; - } - return false; - }; + return false; + }; - entry.visit(visitor, function (err) { - if (err) { - deferred.reject(err); - return; - } + entry.visit(visitor, function (err) { + if (err) { + deferred.reject(err); + return; + } - //node Search : inform node about the file changes - filesChanged(addedFilePaths); + //node Search : inform node about the file changes + //filesChanged(addedFilePaths); + fullPaths = fullPaths.concat(addedFilePaths); - if (findOrReplaceInProgress) { - // find additional matches in all added files - Async.doInParallel(addedFiles, function (file) { - return _doSearchInOneFile(file) - .done(function (foundMatches) { - resultsChanged = resultsChanged || foundMatches; - }); - }).always(deferred.resolve); - } - }); + if (findOrReplaceInProgress) { + // find additional matches in all added files + Async.doInParallel(addedFiles, function (file) { + return _doSearchInOneFile(file) + .done(function (foundMatches) { + resultsChanged = resultsChanged || foundMatches; + }); + }).always(deferred.resolve); + } else { + deferred.resolve(); + } + }); - return deferred.promise(); + return deferred.promise(); + }).always(function () { + // this should be called once with a large array instead of numerous calls with single items + filesChanged(fullPaths); + }); } if (!entry) { @@ -804,23 +830,23 @@ define(function (require, exports, module) { var addPromise; if (entry.isDirectory) { - if (!added || !removed || (added.length === 0 && removed.length === 0)) { + if (added.length === 0 && removed.length === 0) { // If the added or removed sets are null, must redo the search for the entire subtree - we // don't know which child files/folders may have been added or removed. - _removeSearchResultsForEntry(entry); + _removeSearchResultsForEntries([ entry ]); var deferred = $.Deferred(); addPromise = deferred.promise(); entry.getContents(function (err, entries) { - Async.doInParallel(entries, _addSearchResultsForEntry).always(deferred.resolve); + _addSearchResultsForEntries(entries).always(deferred.resolve); }); } else { - removed.forEach(_removeSearchResultsForEntry); - addPromise = Async.doInParallel(added, _addSearchResultsForEntry); + _removeSearchResultsForEntries(removed); + addPromise = _addSearchResultsForEntries(added); } } else { // entry.isFile - _removeSearchResultsForEntry(entry); - addPromise = _addSearchResultsForEntry(entry); + _removeSearchResultsForEntries([ entry ]); + addPromise = _addSearchResultsForEntries([ entry ]); } addPromise.always(function () { @@ -830,6 +856,56 @@ define(function (require, exports, module) { } }); }; + + /** + * This stores file system events emitted by watchers that were not yet processed + */ + var _cachedFileSystemEvents = []; + + /** + * Debounced function to process emitted file system events + * for cases when there's a lot of fs events emitted in a very short period of time + */ + _processCachedFileSystemEvents = _.debounce(function () { + // we need to reduce _cachedFileSystemEvents not to contain duplicates! + _cachedFileSystemEvents = _cachedFileSystemEvents.reduce(function (result, obj) { + var fullPath = obj.entry ? obj.entry.fullPath : null; + // merge added & removed + if (result[fullPath] && obj.isDirectory) { + obj.added = obj.added.concat(result[fullPath].added); + obj.removed = obj.removed.concat(result[fullPath].removed); + } + // use the latest event as base + result[fullPath] = obj; + return result; + }, {}); + _.forEach(_cachedFileSystemEvents, function (obj) { + _fileSystemChangeHandler(obj.event, obj.entry, obj.added, obj.removed); + }); + _cachedFileSystemEvents = []; + }, FILE_SYSTEM_EVENT_DEBOUNCE_TIME); + + /** + * Wrapper function for _fileSystemChangeHandler which handles all incoming fs events + * putting them to cache and executing a debounced function + */ + _debouncedFileSystemChangeHandler = function (event, entry, added, removed) { + // normalize this here so we don't need to handle null later + var isDirectory = false; + if (entry && entry.isDirectory) { + isDirectory = true; + added = added || []; + removed = removed || []; + } + _cachedFileSystemEvents.push({ + event: event, + entry: entry, + isDirectory: isDirectory, + added: added, + removed: removed + }); + _processCachedFileSystemEvents(); + }; /** * On project change, inform node about the new list of files that needs to be crawled. From 6daaeb592ec1a391251a3860f7e0180f2ca98f9c Mon Sep 17 00:00:00 2001 From: Amin Ullah Khan Date: Wed, 23 Nov 2016 23:47:26 +0500 Subject: [PATCH 013/151] Some more housekeeping --- src/document/DocumentCommandHandlers.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/document/DocumentCommandHandlers.js b/src/document/DocumentCommandHandlers.js index 81ad7c55a4e..ed718566d11 100644 --- a/src/document/DocumentCommandHandlers.js +++ b/src/document/DocumentCommandHandlers.js @@ -1375,8 +1375,6 @@ define(function (require, exports, module) { console.error(ex); } - PreferencesManager.savePreferences(); - postCloseHandler(); }) .fail(function () { From acd0dd0b7ca2b9a9af44fa372099eadd614ef771 Mon Sep 17 00:00:00 2001 From: Boris K Date: Sun, 27 Nov 2016 15:52:55 +0100 Subject: [PATCH 014/151] Bux fixed : clicking several times on the update notification icon opened multiple notification dialogs (#12921) --- src/utils/UpdateNotification.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/utils/UpdateNotification.js b/src/utils/UpdateNotification.js index 9d649c0ef0e..e7a220d797b 100644 --- a/src/utils/UpdateNotification.js +++ b/src/utils/UpdateNotification.js @@ -259,6 +259,9 @@ define(function (require, exports, module) { var $dlg = $(".update-dialog.instance"), $updateList = $dlg.find(".update-info"); + // Make the update notification icon clickable again + _addedClickHandler = false; + updates.Strings = Strings; $updateList.html(Mustache.render(UpdateListTemplate, updates)); } @@ -370,12 +373,14 @@ define(function (require, exports, module) { var $updateNotification = $("#update-notification"); $updateNotification.css("display", "block"); - if (!_addedClickHandler) { - _addedClickHandler = true; - $updateNotification.on("click", function () { + + $updateNotification.on("click", function () { + // Block the click until the Notification Dialog opens + if (!_addedClickHandler) { + _addedClickHandler = true; checkForUpdate(true); - }); - } + } + }); // Only show the update dialog if force = true, or if the user hasn't been // alerted of this update From ccd6eafdd5d31dca1e83f63e37b7912893f6fbd9 Mon Sep 17 00:00:00 2001 From: Nathan J Plummer Date: Sun, 27 Nov 2016 13:50:16 -0500 Subject: [PATCH 015/151] Move link to Linux Installation Guide to a more appropriate location. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index dda66500c0b..a8b8cbbe5e2 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,9 @@ The Linux version has most of the features of the Mac and Windows versions, but is still missing a few things. See the [Linux wiki page](https://github.com/adobe/brackets/wiki/Linux-Version) for a list of known issues and to find out how you can help. +Additionally, for a list of common Linux installation issues and workarounds you can [visit this guide](https://nathanjplummer.github.io/Brackets/). + + #### Usage By default, Brackets opens a folder containing some simple "Getting Started" content. @@ -57,9 +60,6 @@ Having problems starting Brackets the first time, or not sure how to use Bracket review [Troubleshooting](https://github.com/adobe/brackets/wiki/Troubleshooting), which helps you to fix common problems and find extra help if needed. -For a list of common Linux issues and workarounds you can [visit this guide](https://nathanjplummer.github.io/Brackets/). - - Helping Brackets ---------------- From 973cf51cfe0200819516b359473290fb14bcfb77 Mon Sep 17 00:00:00 2001 From: jamran7 Date: Tue, 6 Dec 2016 16:18:17 -0500 Subject: [PATCH 016/151] Browser issue (#12946) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Browser issue fix These two sections check for Urls being dragged in to the browser. * There was a bug in the unit test So for some reason this changed which I did not perform showed up in my master it seemed that one did not have access and the new one did. In the health status test under extension tests, the connection would timeout. * JSLint syntax fix JSLint want’s this instead of “==“. I had actually done a check with an online checker and I forgot to make the change. * Revert "There was a bug in the unit test" This reverts commit 887e3d5045964da383959fbe5218d7393bd6879a. * Simplify URI-list antipropagation These are the changes as requested by @petetnt. The behavior was packed into a function. Generally `types` is not null but was protected on the case it is. Files must be null or the length must be 0 now. * Indentation and spacing Fixed extra indentation and spacing issues * Clean comments Cleaned up the comments, some were redundant to the functions description. I gave the different cases of `types` values when files and text is dragged/dropped into Brackets. --- src/utils/DragAndDrop.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/utils/DragAndDrop.js b/src/utils/DragAndDrop.js index 1cda399de24..2acf4cd1a6c 100644 --- a/src/utils/DragAndDrop.js +++ b/src/utils/DragAndDrop.js @@ -61,6 +61,31 @@ define(function (require, exports, module) { // No valid entries found return false; } + + /** + * Determines if the event contains a type list that has a URI-list. + * If it does and contains an empty file list, then what is being dropped is a URL. + * If that is true then we stop the event propagation and default behavior to save Brackets editor from the browser taking over. + * @param {Array.} files Array of File objects from the event datastructure. URLs are the only drop item that would contain a URI-list. + * @param {event} event The event datastucture containing datatransfer information about the drag/drop event. Contains a type list which may or may not hold a URI-list depending on what was dragged/dropped. Interested if it does. + */ + function stopURIListPropagation(files, event) { + var types = event.dataTransfer.types; + + if ((!files || !files.length) && types) { // We only want to check if a string of text was dragged into the editor + types.forEach(function (value) { + //Draging text externally (dragging text from another file): types has "text/plain" and "text/html" + //Draging text internally (dragging text to another line): types has just "text/plain" + //Draging a file: types has "Files" + //Draging a url: types has "text/plain" and "text/uri-list" <-what we are interested in + if (value === "text/uri-list") { + event.stopPropagation(); + event.preventDefault(); + return; + } + }); + } + } /** * Open dropped files @@ -156,6 +181,9 @@ define(function (require, exports, module) { event = event.originalEvent || event; var files = event.dataTransfer.files; + + stopURIListPropagation(files, event); + if (files && files.length) { event.stopPropagation(); event.preventDefault(); @@ -174,6 +202,9 @@ define(function (require, exports, module) { event = event.originalEvent || event; var files = event.dataTransfer.files; + + stopURIListPropagation(files, event); + if (files && files.length) { event.stopPropagation(); event.preventDefault(); From 30fdf938024c8c788a89ed6f7007e85b5df28232 Mon Sep 17 00:00:00 2001 From: ficristo Date: Wed, 7 Dec 2016 10:59:22 +0100 Subject: [PATCH 017/151] Move npm dependencies inside src and add CodeMirror to them --- .gitignore | 3 ++ .gitmodules | 3 -- Gruntfile.js | 23 ++++++--- package.json | 5 -- src/config.json | 5 -- src/index.html | 2 +- src/main.js | 11 +++- .../npm-shrinkwrap.json | 50 ++++++++++--------- src/package.json | 9 ++++ src/thirdparty/CodeMirror | 1 - tasks/npm-install.js | 21 +++++--- test/SpecRunner.js | 12 ++++- 12 files changed, 88 insertions(+), 57 deletions(-) rename npm-shrinkwrap.json => src/npm-shrinkwrap.json (93%) create mode 100644 src/package.json delete mode 160000 src/thirdparty/CodeMirror diff --git a/.gitignore b/.gitignore index a7ff9346eee..b3ab55f4e4e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,9 @@ Thumbs.db /node_modules /npm-debug.log +# ignore node_modules inside src +/src/node_modules + # ignore compiled files /dist /src/.index.html diff --git a/.gitmodules b/.gitmodules index 99f7ae246b7..403668b6862 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "src/thirdparty/CodeMirror"] - path = src/thirdparty/CodeMirror - url = https://github.com/adobe/CodeMirror2.git [submodule "src/thirdparty/path-utils"] path = src/thirdparty/path-utils url = https://github.com/jblas/path-utils.git diff --git a/Gruntfile.js b/Gruntfile.js index 62278c7110e..1d8bca04992 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -65,6 +65,8 @@ module.exports = function (grunt) { cwd: 'src/', src: [ 'nls/{,*/}*.js', + 'package.json', + 'npm-shrinkwrap.json', 'xorigin.js', 'dependencies.js', 'thirdparty/requirejs/require.js', @@ -278,11 +280,6 @@ module.exports = function (grunt) { vendor : [ 'test/polyfills.js', /* For reference to why this polyfill is needed see Issue #7951. The need for this should go away once the version of phantomjs gets upgraded to 2.0 */ 'src/thirdparty/jquery-2.1.3.min.js', - 'src/thirdparty/CodeMirror/lib/codemirror.js', - 'src/thirdparty/CodeMirror/lib/util/dialog.js', - 'src/thirdparty/CodeMirror/lib/util/searchcursor.js', - 'src/thirdparty/CodeMirror/addon/edit/closetag.js', - 'src/thirdparty/CodeMirror/addon/selection/active-line.js', 'src/thirdparty/less-2.5.1.min.js' ], helpers : [ @@ -298,7 +295,19 @@ module.exports = function (grunt) { 'spec' : '../test/spec', 'text' : 'thirdparty/text/text', 'i18n' : 'thirdparty/i18n/i18n' - } + }, + map: { + "*": { + "thirdparty/CodeMirror2": "thirdparty/CodeMirror" + } + }, + packages: [ + { + name: "thirdparty/CodeMirror", + location: "node_modules/codemirror", + main: "lib/codemirror" + } + ] } } } @@ -323,7 +332,7 @@ module.exports = function (grunt) { }); // task: install - grunt.registerTask('install', ['write-config', 'less', 'npm-install-extensions']); + grunt.registerTask('install', ['write-config', 'less', 'npm-install-source']); // task: test grunt.registerTask('test', ['eslint', 'jasmine', 'nls-check']); diff --git a/package.json b/package.json index 9e18985fdef..bf3ab4515b4 100644 --- a/package.json +++ b/package.json @@ -12,11 +12,6 @@ "branch": "", "SHA": "" }, - "dependencies": { - "anymatch": "1.3.0", - "chokidar": "1.6.0", - "lodash": "4.15.0" - }, "devDependencies": { "glob": "7.0.6", "grunt": "0.4.5", diff --git a/src/config.json b/src/config.json index 08735af05a2..acd33ccc76a 100644 --- a/src/config.json +++ b/src/config.json @@ -35,11 +35,6 @@ "branch": "", "SHA": "" }, - "dependencies": { - "anymatch": "1.3.0", - "chokidar": "1.6.0", - "lodash": "4.15.0" - }, "devDependencies": { "glob": "7.0.6", "grunt": "0.4.5", diff --git a/src/index.html b/src/index.html index 72e6dce9d90..15ef0522d6c 100644 --- a/src/index.html +++ b/src/index.html @@ -34,7 +34,7 @@ - + diff --git a/src/main.js b/src/main.js index 5405651f971..8dd86b9a8a5 100644 --- a/src/main.js +++ b/src/main.js @@ -38,9 +38,16 @@ require.config({ map: { "*": { "thirdparty/CodeMirror2": "thirdparty/CodeMirror", - "thirdparty/react": "react" + "thirdparty/react": "react" } - } + }, + packages: [ + { + name: "thirdparty/CodeMirror", + location: "node_modules/codemirror", + main: "lib/codemirror" + } + ] }); if (window.location.search.indexOf("testEnvironment") > -1) { diff --git a/npm-shrinkwrap.json b/src/npm-shrinkwrap.json similarity index 93% rename from npm-shrinkwrap.json rename to src/npm-shrinkwrap.json index 23f1f90405c..736975205fe 100644 --- a/npm-shrinkwrap.json +++ b/src/npm-shrinkwrap.json @@ -1,6 +1,5 @@ { - "name": "Brackets", - "version": "1.8.0-0", + "name": "brackets-src", "dependencies": { "anymatch": { "version": "1.3.0", @@ -38,9 +37,9 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz" }, "binary-extensions": { - "version": "1.5.0", + "version": "1.8.0", "from": "binary-extensions@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.5.0.tgz" + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.8.0.tgz" }, "brace-expansion": { "version": "1.1.6", @@ -62,6 +61,11 @@ "from": "chokidar@1.6.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.6.0.tgz" }, + "codemirror": { + "version": "5.21.0", + "from": "codemirror@5.21.0", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.21.0.tgz" + }, "concat-map": { "version": "0.0.1", "from": "concat-map@0.0.1", @@ -98,13 +102,13 @@ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz" }, "for-in": { - "version": "0.1.5", + "version": "0.1.6", "from": "for-in@>=0.1.5 <0.2.0", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-0.1.5.tgz" + "resolved": "https://registry.npmjs.org/for-in/-/for-in-0.1.6.tgz" }, "for-own": { "version": "0.1.4", - "from": "for-own@>=0.1.3 <0.2.0", + "from": "for-own@>=0.1.4 <0.2.0", "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.4.tgz" }, "glob-base": { @@ -118,14 +122,14 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz" }, "graceful-fs": { - "version": "4.1.6", + "version": "4.1.11", "from": "graceful-fs@>=4.1.2 <5.0.0", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.6.tgz" + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz" }, "inherits": { - "version": "2.0.1", + "version": "2.0.3", "from": "inherits@>=2.0.1 <3.0.0", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" }, "is-binary-path": { "version": "1.0.1", @@ -188,9 +192,9 @@ "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz" }, "kind-of": { - "version": "3.0.4", + "version": "3.1.0", "from": "kind-of@>=3.0.2 <4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.0.4.tgz" + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.1.0.tgz" }, "lodash": { "version": "4.15.0", @@ -213,9 +217,9 @@ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.0.1.tgz" }, "object.omit": { - "version": "2.0.0", + "version": "2.0.1", "from": "object.omit@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.0.tgz" + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz" }, "parse-glob": { "version": "3.0.4", @@ -223,9 +227,9 @@ "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz" }, "path-is-absolute": { - "version": "1.0.0", + "version": "1.0.1", "from": "path-is-absolute@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" }, "preserve": { "version": "0.2.0", @@ -238,14 +242,14 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz" }, "randomatic": { - "version": "1.1.5", + "version": "1.1.6", "from": "randomatic@>=1.1.3 <2.0.0", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.5.tgz" + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.6.tgz" }, "readable-stream": { - "version": "2.1.5", + "version": "2.2.2", "from": "readable-stream@>=2.0.2 <3.0.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.5.tgz" + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.2.tgz" }, "readdirp": { "version": "2.1.0", @@ -263,9 +267,9 @@ "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz" }, "repeat-string": { - "version": "1.5.4", + "version": "1.6.1", "from": "repeat-string@>=1.5.2 <2.0.0", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.5.4.tgz" + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" }, "set-immediate-shim": { "version": "1.0.1", diff --git a/src/package.json b/src/package.json new file mode 100644 index 00000000000..1db74e6e3e5 --- /dev/null +++ b/src/package.json @@ -0,0 +1,9 @@ +{ + "name": "brackets-src", + "dependencies": { + "anymatch": "1.3.0", + "chokidar": "1.6.0", + "codemirror": "5.21.0", + "lodash": "4.15.0" + } +} diff --git a/src/thirdparty/CodeMirror b/src/thirdparty/CodeMirror deleted file mode 160000 index 40210a5aa08..00000000000 --- a/src/thirdparty/CodeMirror +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 40210a5aa08cbb81b3b6646da5509fb20be4a258 diff --git a/tasks/npm-install.js b/tasks/npm-install.js index 4020822fe13..39ea1d0421d 100644 --- a/tasks/npm-install.js +++ b/tasks/npm-install.js @@ -47,19 +47,18 @@ module.exports = function (grunt) { } grunt.registerTask("npm-install", "Install node_modules to the dist folder so it gets bundled with release", function () { - var npmShrinkwrapJSON = grunt.file.readJSON("npm-shrinkwrap.json"); - common.writeJSON(grunt, "dist/npm-shrinkwrap.json", npmShrinkwrapJSON); - - var packageJSON = grunt.file.readJSON("package.json"); - delete packageJSON.devDependencies; - delete packageJSON.scripts; // we don't want to run post-install scripts in dist folder - common.writeJSON(grunt, "dist/package.json", packageJSON); - var done = this.async(); runNpmInstall("dist", function (err) { return err ? done(false) : done(); }); }); + + grunt.registerTask("npm-install-src", "Install node_modules to the src folder", function () { + var done = this.async(); + runNpmInstall("src", function (err) { + return err ? done(false) : done(); + }); + }); grunt.registerTask("npm-install-extensions", "Install node_modules for default extensions which have package.json defined", function () { var _done = this.async(); @@ -80,4 +79,10 @@ module.exports = function (grunt) { }); }); + grunt.registerTask( + "npm-install-source", + "Install node_modules for src folder and default extensions which have package.json defined", + ["npm-install-src", "npm-install-extensions"] + ); + }; diff --git a/test/SpecRunner.js b/test/SpecRunner.js index 4e6ec8043d5..7c81d13238a 100644 --- a/test/SpecRunner.js +++ b/test/SpecRunner.js @@ -38,9 +38,17 @@ require.config({ }, map: { "*": { - "thirdparty/react": "react" + "thirdparty/CodeMirror2": "thirdparty/CodeMirror", + "thirdparty/react": "react" } - } + }, + packages: [ + { + name: "thirdparty/CodeMirror", + location: "node_modules/codemirror", + main: "lib/codemirror" + } + ] }); define(function (require, exports, module) { From 1936493c77b67b4f4bf40abbd8b3884cab30ef5c Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Wed, 14 Dec 2016 06:39:49 +1100 Subject: [PATCH 018/151] fixes 3 failing find-in-files tests (#12973) * fixes 3 failing find-in-files tests * implement proposed change --- src/search/SearchModel.js | 5 ++++- test/spec/FindInFiles-test.js | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/search/SearchModel.js b/src/search/SearchModel.js index 3e90e7affd6..9b53a66163c 100644 --- a/src/search/SearchModel.js +++ b/src/search/SearchModel.js @@ -111,6 +111,7 @@ define(function (require, exports, module) { * Clears out the model to an empty state. */ SearchModel.prototype.clear = function () { + var numMatchesBefore = this.numMatches; this.results = {}; this.queryInfo = null; this.queryExpr = null; @@ -120,7 +121,9 @@ define(function (require, exports, module) { this.numMatches = 0; this.foundMaximum = false; this.exceedsMaximum = false; - this.fireChanged(); + if (numMatchesBefore !== 0) { + this.fireChanged(); + } }; /** diff --git a/test/spec/FindInFiles-test.js b/test/spec/FindInFiles-test.js index 82dae5e0b13..c7e96083b31 100644 --- a/test/spec/FindInFiles-test.js +++ b/test/spec/FindInFiles-test.js @@ -785,6 +785,8 @@ define(function (require, exports, module) { gotChange = false; oldResults = null; wasQuickChange = false; + + FindInFiles.clearSearch(); // calls FindInFiles.searchModel.clear internally FindInFiles.searchModel.on("change.FindInFilesTest", function (event, quickChange) { gotChange = true; wasQuickChange = quickChange; From 00187c979c099f6c7d7f92da60e48e4a39dbd265 Mon Sep 17 00:00:00 2001 From: ficristo Date: Wed, 14 Dec 2016 20:08:36 +0100 Subject: [PATCH 019/151] Add will-change to css properties (#12982) --- src/extensions/default/CSSCodeHints/CSSProperties.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/extensions/default/CSSCodeHints/CSSProperties.json b/src/extensions/default/CSSCodeHints/CSSProperties.json index 253729a1153..4b22076b357 100644 --- a/src/extensions/default/CSSCodeHints/CSSProperties.json +++ b/src/extensions/default/CSSCodeHints/CSSProperties.json @@ -222,6 +222,7 @@ "white-space": {"values": ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "inherit"]}, "widows": {"values": ["inherit"]}, "width": {"values": ["auto", "inherit"]}, + "will-change": {"values": ["auto", "contents", "opacity", "scroll-position", "transform", "inherit", "initial", "unset"]}, "word-break": {"values": ["normal", "break-all", "keep-all"]}, "word-spacing": {"values": ["normal", "inherit"]}, "word-wrap": {"values": ["break-word", "normal"]}, From e6e29c2ba4a0a369eb2beb4a55edb64e0ece23ea Mon Sep 17 00:00:00 2001 From: Hassan Date: Sun, 11 Dec 2016 22:57:33 +0000 Subject: [PATCH 020/151] Fix some language/preferences bugs --- src/config.json | 4 ++-- src/language/LanguageManager.js | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/config.json b/src/config.json index acd33ccc76a..0e80f1843a0 100644 --- a/src/config.json +++ b/src/config.json @@ -20,7 +20,7 @@ "extension_url": "https://s3.amazonaws.com/extend.brackets/{0}/{0}-{1}.zip", "linting.enabled_by_default": true, "build_timestamp": "", - "healthDataServerURL": "https://healthdev.brackets.io/healthDataLog" + "healthDataServerURL": "https://health.brackets.io/healthDataLog" }, "name": "Brackets", "version": "1.9.0-0", @@ -73,4 +73,4 @@ "url": "https://github.com/adobe/brackets/blob/master/LICENSE" } ] -} +} \ No newline at end of file diff --git a/src/language/LanguageManager.js b/src/language/LanguageManager.js index 1b714c5ee9c..04509e7bc7c 100644 --- a/src/language/LanguageManager.js +++ b/src/language/LanguageManager.js @@ -1084,6 +1084,33 @@ define(function (require, exports, module) { _restoreOverriddenDefault(name, state); } }); + + // Look for invalid mappings and correct/restore them + newNames.forEach(function(name) { + var prefsLanguage = getLanguage(newMapping[name]), + currentLanguage = exports[state.get](name); + + if(prefsLanguage) { + // If the current language doesn't match the prefs language, update it + if(currentLanguage && currentLanguage.getId() !== prefsLanguage.getId()) { + currentLanguage[state.remove](name); + if(!overridden[name]) { + overridden[name] = currentLanguage.getId(); + } + prefsLanguage[state.add](name); + } + + // If the current language is undefined, use the language in prefs + if(!currentLanguage) { + prefsLanguage[state.add](name); + } + } else { + // If the language in prefs doesn't exist and is overriding a default, restore it + if(overridden[name]) { + _restoreOverriddenDefault(name, state); + } + } + }); state.last = newMapping; } From 9153349c2cac046d33553cb493bc14f282fcfec7 Mon Sep 17 00:00:00 2001 From: Hassan Date: Sun, 11 Dec 2016 22:58:53 +0000 Subject: [PATCH 021/151] Revert "Fix some language/preferences bugs" This reverts commit c2b23871c99cb2e0c2d266ba3c371b9635f78dc1. --- src/config.json | 4 ++-- src/language/LanguageManager.js | 27 --------------------------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/src/config.json b/src/config.json index 0e80f1843a0..acd33ccc76a 100644 --- a/src/config.json +++ b/src/config.json @@ -20,7 +20,7 @@ "extension_url": "https://s3.amazonaws.com/extend.brackets/{0}/{0}-{1}.zip", "linting.enabled_by_default": true, "build_timestamp": "", - "healthDataServerURL": "https://health.brackets.io/healthDataLog" + "healthDataServerURL": "https://healthdev.brackets.io/healthDataLog" }, "name": "Brackets", "version": "1.9.0-0", @@ -73,4 +73,4 @@ "url": "https://github.com/adobe/brackets/blob/master/LICENSE" } ] -} \ No newline at end of file +} diff --git a/src/language/LanguageManager.js b/src/language/LanguageManager.js index 04509e7bc7c..1b714c5ee9c 100644 --- a/src/language/LanguageManager.js +++ b/src/language/LanguageManager.js @@ -1084,33 +1084,6 @@ define(function (require, exports, module) { _restoreOverriddenDefault(name, state); } }); - - // Look for invalid mappings and correct/restore them - newNames.forEach(function(name) { - var prefsLanguage = getLanguage(newMapping[name]), - currentLanguage = exports[state.get](name); - - if(prefsLanguage) { - // If the current language doesn't match the prefs language, update it - if(currentLanguage && currentLanguage.getId() !== prefsLanguage.getId()) { - currentLanguage[state.remove](name); - if(!overridden[name]) { - overridden[name] = currentLanguage.getId(); - } - prefsLanguage[state.add](name); - } - - // If the current language is undefined, use the language in prefs - if(!currentLanguage) { - prefsLanguage[state.add](name); - } - } else { - // If the language in prefs doesn't exist and is overriding a default, restore it - if(overridden[name]) { - _restoreOverriddenDefault(name, state); - } - } - }); state.last = newMapping; } From 06c0a8b4c8404e4d7065654d5f7fdb3a429ffd80 Mon Sep 17 00:00:00 2001 From: Hassan Date: Sun, 11 Dec 2016 23:00:56 +0000 Subject: [PATCH 022/151] Fix some language/preferences bugs --- src/language/LanguageManager.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/language/LanguageManager.js b/src/language/LanguageManager.js index 1b714c5ee9c..04509e7bc7c 100644 --- a/src/language/LanguageManager.js +++ b/src/language/LanguageManager.js @@ -1084,6 +1084,33 @@ define(function (require, exports, module) { _restoreOverriddenDefault(name, state); } }); + + // Look for invalid mappings and correct/restore them + newNames.forEach(function(name) { + var prefsLanguage = getLanguage(newMapping[name]), + currentLanguage = exports[state.get](name); + + if(prefsLanguage) { + // If the current language doesn't match the prefs language, update it + if(currentLanguage && currentLanguage.getId() !== prefsLanguage.getId()) { + currentLanguage[state.remove](name); + if(!overridden[name]) { + overridden[name] = currentLanguage.getId(); + } + prefsLanguage[state.add](name); + } + + // If the current language is undefined, use the language in prefs + if(!currentLanguage) { + prefsLanguage[state.add](name); + } + } else { + // If the language in prefs doesn't exist and is overriding a default, restore it + if(overridden[name]) { + _restoreOverriddenDefault(name, state); + } + } + }); state.last = newMapping; } From 78d3a4250cb0c29389180b1b2d7f342149dceb5d Mon Sep 17 00:00:00 2001 From: Hassan Date: Mon, 12 Dec 2016 21:06:31 +0000 Subject: [PATCH 023/151] Add prefs update for non-default languages --- src/language/LanguageManager.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/language/LanguageManager.js b/src/language/LanguageManager.js index 04509e7bc7c..72ffaa9e6c4 100644 --- a/src/language/LanguageManager.js +++ b/src/language/LanguageManager.js @@ -997,6 +997,12 @@ define(function (require, exports, module) { delete _pendingLanguages[id]; }); } + + // Non-default languages should update prefs to fix any invalid mappings + if(_defaultLanguagesJSON[id] === undefined) { + _updateFromPrefs(_EXTENSION_MAP_PREF); + _updateFromPrefs(_NAME_MAP_PREF); + } return result.promise(); } From d019dcf0a4518ba70e561ab9a9e79ae98fa267cc Mon Sep 17 00:00:00 2001 From: Hassan Date: Tue, 13 Dec 2016 19:47:49 +0000 Subject: [PATCH 024/151] Updated fix Better way of dealing with this bug is just to remove invalid mappings from the prefs state, and force an _updateToPrefs call when defining a non-default language --- src/language/LanguageManager.js | 39 ++++++++++----------------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/src/language/LanguageManager.js b/src/language/LanguageManager.js index 72ffaa9e6c4..fc311978a4c 100644 --- a/src/language/LanguageManager.js +++ b/src/language/LanguageManager.js @@ -956,6 +956,14 @@ define(function (require, exports, module) { // store language to language map _languages[language.getId()] = language; + + // restore any preferences for non-default languages + if(!_defaultLanguagesJSON[language.getId()]) { + if(PreferencesManager) { + _updateFromPrefs(_EXTENSION_MAP_PREF); + _updateFromPrefs(_NAME_MAP_PREF); + } + } } if (!language._setId(id) || !language._setName(name) || @@ -997,13 +1005,6 @@ define(function (require, exports, module) { delete _pendingLanguages[id]; }); } - - // Non-default languages should update prefs to fix any invalid mappings - if(_defaultLanguagesJSON[id] === undefined) { - _updateFromPrefs(_EXTENSION_MAP_PREF); - _updateFromPrefs(_NAME_MAP_PREF); - } - return result.promise(); } @@ -1091,30 +1092,14 @@ define(function (require, exports, module) { } }); - // Look for invalid mappings and correct/restore them + // Look for invalid mappings and remove them newNames.forEach(function(name) { - var prefsLanguage = getLanguage(newMapping[name]), - currentLanguage = exports[state.get](name); - - if(prefsLanguage) { - // If the current language doesn't match the prefs language, update it - if(currentLanguage && currentLanguage.getId() !== prefsLanguage.getId()) { - currentLanguage[state.remove](name); - if(!overridden[name]) { - overridden[name] = currentLanguage.getId(); - } - prefsLanguage[state.add](name); - } - - // If the current language is undefined, use the language in prefs - if(!currentLanguage) { - prefsLanguage[state.add](name); - } - } else { - // If the language in prefs doesn't exist and is overriding a default, restore it + var language = getLanguage(newMapping[name]); + if(!language) { if(overridden[name]) { _restoreOverriddenDefault(name, state); } + delete newMapping[name]; } }); state.last = newMapping; From b7c2ceddf8f5409e9ee7666c17931c3933828f5a Mon Sep 17 00:00:00 2001 From: Hassan Date: Tue, 13 Dec 2016 19:49:02 +0000 Subject: [PATCH 025/151] Whitespace fix --- src/language/LanguageManager.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/language/LanguageManager.js b/src/language/LanguageManager.js index fc311978a4c..084f979c6c3 100644 --- a/src/language/LanguageManager.js +++ b/src/language/LanguageManager.js @@ -1005,6 +1005,7 @@ define(function (require, exports, module) { delete _pendingLanguages[id]; }); } + return result.promise(); } From 48fb2751b3bcab517acebe8d6055da6f1827d2b0 Mon Sep 17 00:00:00 2001 From: Hassan Date: Wed, 14 Dec 2016 22:56:34 +0000 Subject: [PATCH 026/151] Remove unnecessary extra loop --- src/language/LanguageManager.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/language/LanguageManager.js b/src/language/LanguageManager.js index 084f979c6c3..10bc52fe2e9 100644 --- a/src/language/LanguageManager.js +++ b/src/language/LanguageManager.js @@ -1082,6 +1082,15 @@ define(function (require, exports, module) { language[state.add](name); } } + if(!getLanguage(newMapping[name])) { + + // If the language doesn't exist, restore any overrides and remove it + // from the state. + if(overridden[name]) { + _restoreOverriddenDefault(name, state); + } + delete newMapping[name]; + } }); // Look for removed names (extensions or filenames) @@ -1092,17 +1101,6 @@ define(function (require, exports, module) { _restoreOverriddenDefault(name, state); } }); - - // Look for invalid mappings and remove them - newNames.forEach(function(name) { - var language = getLanguage(newMapping[name]); - if(!language) { - if(overridden[name]) { - _restoreOverriddenDefault(name, state); - } - delete newMapping[name]; - } - }); state.last = newMapping; } From 2b071d3df9055635124a61d97256caa8a9e5985a Mon Sep 17 00:00:00 2001 From: Hassan Date: Sat, 17 Dec 2016 04:51:33 +0000 Subject: [PATCH 027/151] Update prefs fix Check if a language isn't in the file extension map when it should be --- src/language/LanguageManager.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/language/LanguageManager.js b/src/language/LanguageManager.js index 10bc52fe2e9..da156da7cac 100644 --- a/src/language/LanguageManager.js +++ b/src/language/LanguageManager.js @@ -665,6 +665,11 @@ define(function (require, exports, module) { _fileExtensionToLanguageMap[extension] = this; } + this._wasModified(); + } else if(!_fileExtensionToLanguageMap[extension]) { + + // Language should be in the extension map but isn't + _fileExtensionToLanguageMap[extension] = this; this._wasModified(); } }; From f99290ec29c53bd3af278fa227b528f22b757a61 Mon Sep 17 00:00:00 2001 From: Hassan Date: Sat, 17 Dec 2016 23:00:21 +0000 Subject: [PATCH 028/151] Add a unit test --- test/spec/LanguageManager-test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/spec/LanguageManager-test.js b/test/spec/LanguageManager-test.js index 324673096e9..ce356b4dcd0 100644 --- a/test/spec/LanguageManager-test.js +++ b/test/spec/LanguageManager-test.js @@ -849,6 +849,22 @@ define(function (require, exports, module) { language = LanguageManager.getLanguageForPath("Gemfile"); expect(language.getId()).toBe("ruby"); }); + + it("should manage preferences for non-default languages", function() { + var language, + def = { id: "test", name: "Test", mode: ["null", "text/plain"] }; + PreferencesManager.set(LanguageManager._EXTENSION_MAP_PREF, { + extension: "test" + }); + PreferencesManager.set(LanguageManager._NAME_MAP_PREF, { + filename: "test" + }); + defineLanguage(def); + language = LanguageManager.getLanguageForExtension("extension"); + expect(language.getId()).toBe("test"); + language = LanguageManager.getLanguageForPath("filename"); + expect(language.getId()).toBe("test"); + }); }); describe("isBinary", function () { From c62e106d00a2263cbff808629e4f65f615d673ec Mon Sep 17 00:00:00 2001 From: Hassan Date: Mon, 19 Dec 2016 12:18:23 +0000 Subject: [PATCH 029/151] Remove redundant default language check --- src/language/LanguageManager.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/language/LanguageManager.js b/src/language/LanguageManager.js index da156da7cac..b3c222800dc 100644 --- a/src/language/LanguageManager.js +++ b/src/language/LanguageManager.js @@ -963,11 +963,9 @@ define(function (require, exports, module) { _languages[language.getId()] = language; // restore any preferences for non-default languages - if(!_defaultLanguagesJSON[language.getId()]) { - if(PreferencesManager) { - _updateFromPrefs(_EXTENSION_MAP_PREF); - _updateFromPrefs(_NAME_MAP_PREF); - } + if(PreferencesManager) { + _updateFromPrefs(_EXTENSION_MAP_PREF); + _updateFromPrefs(_NAME_MAP_PREF); } } From 4be271ed622cf64671d886e9534be70b1cd6cfc4 Mon Sep 17 00:00:00 2001 From: Amr El-Naggar Date: Thu, 22 Dec 2016 20:05:17 +0200 Subject: [PATCH 030/151] Add "replace all" button when doing find and replace (#12988) * Add replace all button when doing find and replace * Update the id of batch replace button in tests * Add test for replace all button * Addressing CR comments --- src/htmlContent/findreplace-bar.html | 6 ++- src/nls/root/strings.js | 3 +- src/search/FindBar.js | 13 ++++-- src/search/FindInFilesUI.js | 47 +++++++++++++++++-- src/search/FindReplace.js | 10 ++++- src/search/SearchResultsView.js | 4 +- src/styles/brackets.less | 12 +++-- test/spec/FindInFiles-test.js | 12 ++--- test/spec/FindReplace-test.js | 67 ++++++++++++++++++++-------- 9 files changed, 133 insertions(+), 41 deletions(-) diff --git a/src/htmlContent/findreplace-bar.html b/src/htmlContent/findreplace-bar.html index 42311e46a3e..e2f8c2b4aac 100644 --- a/src/htmlContent/findreplace-bar.html +++ b/src/htmlContent/findreplace-bar.html @@ -17,7 +17,11 @@ {{^multifile}} --> + --> {{/replace}} diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index c504e64eb6f..193cba4193e 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -153,7 +153,8 @@ define({ "FIND_NO_RESULTS" : "No results", "FIND_QUERY_PLACEHOLDER" : "Find\u2026", "REPLACE_PLACEHOLDER" : "Replace with\u2026", - "BUTTON_REPLACE_ALL" : "Batch\u2026", + "BUTTON_REPLACE_ALL" : "Replace All", + "BUTTON_REPLACE_BATCH" : "Batch\u2026", "BUTTON_REPLACE_ALL_IN_FILES" : "Replace\u2026", "BUTTON_REPLACE" : "Replace", "BUTTON_NEXT" : "\u25B6", diff --git a/src/search/FindBar.js b/src/search/FindBar.js index b7561d87aa4..317a0833b57 100644 --- a/src/search/FindBar.js +++ b/src/search/FindBar.js @@ -68,7 +68,8 @@ define(function (require, exports, module) { * Parameters are: * shiftKey - boolean, false for Find Next, true for Find Previous * - doReplace - when the user chooses to do a single replace. Use getReplaceText() to get the current replacement text. - * - doReplaceAll - when the user chooses to initiate a Replace All. Use getReplaceText() to get the current replacement text. + * - doReplaceBatch - when the user chooses to initiate a Replace All. Use getReplaceText() to get the current replacement text. + * - doReplaceAll - when the user chooses to perform a Replace All. Use getReplaceText() to get the current replacement text. *- close - when the find bar is closed * * @param {boolean=} options.multifile - true if this is a Find/Replace in Files (changes the behavior of Enter in @@ -244,7 +245,8 @@ define(function (require, exports, module) { var templateVars = _.clone(this._options); templateVars.Strings = Strings; - templateVars.replaceAllLabel = (templateVars.multifile ? Strings.BUTTON_REPLACE_ALL_IN_FILES : Strings.BUTTON_REPLACE_ALL); + templateVars.replaceBatchLabel = (templateVars.multifile ? Strings.BUTTON_REPLACE_ALL_IN_FILES : Strings.BUTTON_REPLACE_BATCH); + templateVars.replaceAllLabel = Strings.BUTTON_REPLACE_ALL; this._modalBar = new ModalBar(Mustache.render(_searchBarTemplate, templateVars), true); // 2nd arg = auto-close on Esc/blur @@ -324,7 +326,7 @@ define(function (require, exports, module) { } } else { HealthLogger.searchDone(HealthLogger.SEARCH_REPLACE_ALL); - self.trigger("doReplaceAll"); + self.trigger("doReplaceBatch"); } } else { // In the single file case, we just want to trigger a Find Next (or Find Previous @@ -352,6 +354,9 @@ define(function (require, exports, module) { .on("click", "#replace-yes", function (e) { self.trigger("doReplace"); }) + .on("click", "#replace-batch", function (e) { + self.trigger("doReplaceBatch"); + }) .on("click", "#replace-all", function (e) { self.trigger("doReplaceAll"); }) @@ -515,7 +520,7 @@ define(function (require, exports, module) { */ FindBar.prototype.enableReplace = function (enable) { if (this.isEnabled) { - this.$("#replace-yes, #replace-all").prop("disabled", !enable); + this.$("#replace-yes, #replace-batch, #replace-all").prop("disabled", !enable); } }; diff --git a/src/search/FindInFilesUI.js b/src/search/FindInFilesUI.js index 51a42e82055..45e9181fe27 100644 --- a/src/search/FindInFilesUI.js +++ b/src/search/FindInFilesUI.js @@ -61,6 +61,13 @@ define(function (require, exports, module) { /** @type {FindBar} Find bar containing the search UI. */ var _findBar = null; + /** + * @private + * Forward declaration for JSLint. + * @type {Function} + */ + var _finishReplaceBatch; + /** * Does a search in the given scope with the given filter. Shows the result list once the search is complete. * @param {{query: string, caseSensitive: boolean, isRegexp: boolean}} queryInfo Query info object @@ -106,6 +113,37 @@ define(function (require, exports, module) { }); } + /** + * Does a search in the given scope with the given filter. Replace the result list once the search is complete. + * @param {{query: string, caseSensitive: boolean, isRegexp: boolean}} queryInfo Query info object + * @param {?Entry} scope Project file/subfolder to search within; else searches whole project. + * @param {?string} filter A "compiled" filter as returned by FileFilters.compile(), or null for no filter + * @param {?string} replaceText If this is a replacement, the text to replace matches with. + * @param {?$.Promise} candidateFilesPromise If specified, a promise that should resolve with the same set of files that + * getCandidateFiles(scope) would return. + * @return {$.Promise} A promise that's resolved with the search results or rejected when the find competes. + */ + function searchAndReplaceResults(queryInfo, scope, filter, replaceText, candidateFilesPromise) { + return FindInFiles.doSearchInScope(queryInfo, scope, filter, replaceText, candidateFilesPromise) + .done(function (zeroFilesToken) { + // Done searching all files: replace all + if (FindInFiles.searchModel.hasResults()) { + _finishReplaceBatch(FindInFiles.searchModel); + + if (_findBar) { + _findBar.enable(true); + _findBar.focus(); + } + + } + StatusBar.hideBusyIndicator(); + }) + .fail(function (err) { + console.log("replace all failed: ", err); + StatusBar.hideBusyIndicator(); + }); + } + /** * @private * Displays a non-modal embedded dialog above the code mirror editor that allows the user to do @@ -222,7 +260,7 @@ define(function (require, exports, module) { if (showReplace) { // We shouldn't get a "doReplace" in this case, since the Replace button // is hidden when we set options.multifile. - _findBar.on("doReplaceAll.FindInFiles", startReplace); + _findBar.on("doReplaceBatch.FindInFiles", startReplace); } var oldModalBarHeight = _findBar._modalBar.height(); @@ -261,7 +299,7 @@ define(function (require, exports, module) { * Finish a replace across files operation when the user clicks "Replace" on the results panel. * @param {SearchModel} model The model for the search associated with ths replace. */ - function _finishReplaceAll(model) { + function _finishReplaceBatch(model) { var replaceText = model.replaceText; if (replaceText === null) { return; @@ -416,8 +454,8 @@ define(function (require, exports, module) { var model = FindInFiles.searchModel; _resultsView = new SearchResultsView(model, "find-in-files-results", "find-in-files.results"); _resultsView - .on("replaceAll", function () { - _finishReplaceAll(model); + .on("replaceBatch", function () { + _finishReplaceBatch(model); }) .on("close", function () { FindInFiles.clearSearch(); @@ -455,6 +493,7 @@ define(function (require, exports, module) { // Public exports exports.searchAndShowResults = searchAndShowResults; + exports.searchAndReplaceResults = searchAndReplaceResults; // For unit testing exports._showFindBar = _showFindBar; diff --git a/src/search/FindReplace.js b/src/search/FindReplace.js index 5426a2be839..d5322c25ec4 100644 --- a/src/search/FindReplace.js +++ b/src/search/FindReplace.js @@ -672,7 +672,10 @@ define(function (require, exports, module) { state = getSearchState(cm), replaceText = findBar.getReplaceText(); - if (all) { + if (all === null) { + findBar.close(); + FindInFilesUI.searchAndReplaceResults(state.queryInfo, editor.document.file, null, replaceText); + } else if (all) { findBar.close(); // Delegate to Replace in Files. FindInFilesUI.searchAndShowResults(state.queryInfo, editor.document.file, null, replaceText); @@ -702,8 +705,11 @@ define(function (require, exports, module) { .on("doReplace.FindReplace", function (e) { doReplace(editor, false); }) - .on("doReplaceAll.FindReplace", function (e) { + .on("doReplaceBatch.FindReplace", function (e) { doReplace(editor, true); + }) + .on("doReplaceAll.FindReplace", function (e) { + doReplace(editor, null); }); } diff --git a/src/search/SearchResultsView.js b/src/search/SearchResultsView.js index 8bf172af846..89aa083b13a 100644 --- a/src/search/SearchResultsView.js +++ b/src/search/SearchResultsView.js @@ -66,7 +66,7 @@ define(function (require, exports, module) { * @constructor * Handles the search results panel. * Dispatches the following events: - * replaceAll - when the "Replace" button is clicked. + * replaceBatch - when the "Replace" button is clicked. * close - when the panel is closed. * * @param {SearchModel} model The model that this view is showing. @@ -328,7 +328,7 @@ define(function (require, exports, module) { e.stopPropagation(); }) .on("click.searchResults", ".replace-checked", function (e) { - self.trigger("replaceAll"); + self.trigger("replaceBatch"); }); } }; diff --git a/src/styles/brackets.less b/src/styles/brackets.less index 8dfad1edc4e..08e4ce3df69 100644 --- a/src/styles/brackets.less +++ b/src/styles/brackets.less @@ -1670,7 +1670,7 @@ a, img { } // Make button pairs snug - #find-prev, #replace-yes, #find-case-sensitive { + #find-prev, #replace-yes, #replace-batch, #find-case-sensitive { border-right: none; margin-right: 0; } @@ -1679,10 +1679,16 @@ a, img { border-bottom-left-radius: 0; margin-left: 0; } - #replace-all.solo { - border-left: none; + #replace-batch { + border-radius: 0; margin-left: 0; } + #replace-batch.solo { + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; + border-left: none; + border-right: 1px solid #b2b5b5; + } // Make find field snug with options buttons // & replace snug with replace commands diff --git a/test/spec/FindInFiles-test.js b/test/spec/FindInFiles-test.js index c7e96083b31..47855104cf3 100644 --- a/test/spec/FindInFiles-test.js +++ b/test/spec/FindInFiles-test.js @@ -1716,7 +1716,7 @@ define(function (require, exports, module) { if (fromKeyboard) { SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_RETURN, "keydown", $("#replace-with").get(0)); } else { - $("#replace-all").click(); + $("#replace-batch").click(); } }); } @@ -1740,7 +1740,7 @@ define(function (require, exports, module) { openSearchBar(null, true); runs(function () { expect($("#replace-yes").length).toBe(0); - expect($("#replace-all").length).toBe(1); + expect($("#replace-batch").length).toBe(1); }); }); @@ -1749,7 +1749,7 @@ define(function (require, exports, module) { openSearchBar(null, true); runs(function () { $("#find-what").val("").trigger("input"); - expect($("#replace-all").is(":disabled")).toBe(true); + expect($("#replace-batch").is(":disabled")).toBe(true); }); }); @@ -1758,7 +1758,7 @@ define(function (require, exports, module) { openSearchBar(null, true); runs(function () { $("#find-what").val("my query").trigger("input"); - expect($("#replace-all").is(":disabled")).toBe(false); + expect($("#replace-batch").is(":disabled")).toBe(false); }); }); @@ -1768,7 +1768,7 @@ define(function (require, exports, module) { runs(function () { $("#find-regexp").click(); $("#find-what").val("[invalid").trigger("input"); - expect($("#replace-all").is(":disabled")).toBe(true); + expect($("#replace-batch").is(":disabled")).toBe(true); }); }); @@ -1778,7 +1778,7 @@ define(function (require, exports, module) { runs(function () { $("#find-regexp").click(); $("#find-what").val("[valid]").trigger("input"); - expect($("#replace-all").is(":disabled")).toBe(false); + expect($("#replace-batch").is(":disabled")).toBe(false); }); }); diff --git a/test/spec/FindReplace-test.js b/test/spec/FindReplace-test.js index 0001666de80..c0602fcd19e 100644 --- a/test/spec/FindReplace-test.js +++ b/test/spec/FindReplace-test.js @@ -1502,8 +1502,8 @@ define(function (require, exports, module) { twFindInFiles._searchDone = false; twFindInFiles._replaceDone = false; }); - - it("should find and replace all", function () { + + it("should find and replace all using replace all button", function () { var searchText = "require", replaceText = "brackets.getModule"; runs(function () { @@ -1518,6 +1518,37 @@ define(function (require, exports, module) { tw$("#replace-all").click(); }); + waitsFor(function () { + return twFindInFiles._replaceDone; + }, "replace finished"); + + runs(function () { + // Note: LINE_FIRST_REQUIRE and CH_REQUIRE_START refer to first call to "require", + // but not first instance of "require" in text + expectTextAtPositions(replaceText, [ + {line: 1, ch: 17}, + {line: LINE_FIRST_REQUIRE, ch: CH_REQUIRE_START}, + {line: LINE_FIRST_REQUIRE + 1, ch: CH_REQUIRE_START}, + {line: LINE_FIRST_REQUIRE + 2, ch: CH_REQUIRE_START} + ]); + }); + }); + + it("should find and replace all using batch replace button", function () { + var searchText = "require", + replaceText = "brackets.getModule"; + runs(function () { + twCommandManager.execute(Commands.CMD_REPLACE); + enterSearchText(searchText); + enterReplaceText(replaceText); + + expectSelection({start: {line: 1, ch: 17}, end: {line: 1, ch: 17 + searchText.length}}); + expect(myEditor.getSelectedText()).toBe(searchText); + + expect(tw$("#replace-batch").is(":enabled")).toBe(true); + tw$("#replace-batch").click(); + }); + waitsFor(function () { return twFindInFiles._searchDone; }, "search finished"); @@ -1553,8 +1584,8 @@ define(function (require, exports, module) { expectSelection({start: {line: 1, ch: 17}, end: {line: 1, ch: 17 + searchText.length}}); expect(myEditor.getSelectedText()).toBe(searchText); - expect(tw$("#replace-all").is(":enabled")).toBe(true); - tw$("#replace-all").click(); + expect(tw$("#replace-batch").is(":enabled")).toBe(true); + tw$("#replace-batch").click(); }); waitsFor(function () { @@ -1579,8 +1610,8 @@ define(function (require, exports, module) { expectSelection({start: {line: 1, ch: 17}, end: {line: 1, ch: 17 + searchText.length}}); expect(myEditor.getSelectedText()).toBe(searchText); - expect(tw$("#replace-all").is(":enabled")).toBe(true); - tw$("#replace-all").click(); + expect(tw$("#replace-batch").is(":enabled")).toBe(true); + tw$("#replace-batch").click(); }); waitsFor(function () { @@ -1632,8 +1663,8 @@ define(function (require, exports, module) { expectSelection(expectedMatch); expect(/foo/i.test(myEditor.getSelectedText())).toBe(true); - expect(tw$("#replace-all").is(":enabled")).toBe(true); - tw$("#replace-all").click(); + expect(tw$("#replace-batch").is(":enabled")).toBe(true); + tw$("#replace-batch").click(); }); waitsFor(function () { @@ -1672,8 +1703,8 @@ define(function (require, exports, module) { expectSelection(expectedMatch); expect(/foo/i.test(myEditor.getSelectedText())).toBe(true); - expect(tw$("#replace-all").is(":enabled")).toBe(true); - tw$("#replace-all").click(); + expect(tw$("#replace-batch").is(":enabled")).toBe(true); + tw$("#replace-batch").click(); }); waitsFor(function () { @@ -1712,8 +1743,8 @@ define(function (require, exports, module) { expectSelection(expectedMatch); expect(/foo/i.test(myEditor.getSelectedText())).toBe(true); - expect(tw$("#replace-all").is(":enabled")).toBe(true); - tw$("#replace-all").click(); + expect(tw$("#replace-batch").is(":enabled")).toBe(true); + tw$("#replace-batch").click(); }); waitsFor(function () { @@ -1752,8 +1783,8 @@ define(function (require, exports, module) { expectSelection(expectedMatch); expect(/foo/i.test(myEditor.getSelectedText())).toBe(true); - expect(tw$("#replace-all").is(":enabled")).toBe(true); - tw$("#replace-all").click(); + expect(tw$("#replace-batch").is(":enabled")).toBe(true); + tw$("#replace-batch").click(); }); waitsFor(function () { @@ -1792,8 +1823,8 @@ define(function (require, exports, module) { expectSelection(expectedMatch); expect(/foo/i.test(myEditor.getSelectedText())).toBe(true); - expect(tw$("#replace-all").is(":enabled")).toBe(true); - tw$("#replace-all").click(); + expect(tw$("#replace-batch").is(":enabled")).toBe(true); + tw$("#replace-batch").click(); }); waitsFor(function () { @@ -1832,8 +1863,8 @@ define(function (require, exports, module) { expectSelection(expectedMatch); expect(/foo/i.test(myEditor.getSelectedText())).toBe(true); - expect(tw$("#replace-all").is(":enabled")).toBe(true); - tw$("#replace-all").click(); + expect(tw$("#replace-batch").is(":enabled")).toBe(true); + tw$("#replace-batch").click(); }); waitsFor(function () { From 7732d934c3da9175f44b97a51a69c7fb2623959f Mon Sep 17 00:00:00 2001 From: Hassan Aslam Date: Fri, 23 Dec 2016 15:07:22 +0000 Subject: [PATCH 031/151] Issue #12859 Keyboard modifiers support for simulateKeyEvent (#12863) * Update simulateKeyEvent() to accept additional options * Fix missing ; error * Update error text * Add KeyboardEvent global to fix no-undef error * API limits . . . * Add requested changes & unit test * Remove object.assign() * Update method comments --- test/UnitTestSuite.js | 1 + test/spec/SpecRunnerUtils-test.js | 68 +++++++++++++++++++++++++++++++ test/spec/SpecRunnerUtils.js | 37 +++++++++-------- 3 files changed, 90 insertions(+), 16 deletions(-) create mode 100644 test/spec/SpecRunnerUtils-test.js diff --git a/test/UnitTestSuite.js b/test/UnitTestSuite.js index bf2e852dea8..b32c99f5977 100644 --- a/test/UnitTestSuite.js +++ b/test/UnitTestSuite.js @@ -78,6 +78,7 @@ define(function (require, exports, module) { require("spec/QuickOpen-test"); require("spec/QuickSearchField-test"); require("spec/RemoteFunctions-test"); + require("spec/SpecRunnerUtils-test"); require("spec/StringMatch-test"); require("spec/StringUtils-test"); require("spec/TextRange-test"); diff --git a/test/spec/SpecRunnerUtils-test.js b/test/spec/SpecRunnerUtils-test.js new file mode 100644 index 00000000000..93c4a3e6f3e --- /dev/null +++ b/test/spec/SpecRunnerUtils-test.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2013 - present 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 + * 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, + * 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 + * DEALINGS IN THE SOFTWARE. + * + */ + +/*global describe, it, expect, beforeEach, afterEach */ + +define(function (require, exports, module) { + 'use strict'; + + var SpecRunnerUtils = require("spec/SpecRunnerUtils"); + + describe("SpecRunnerUtils", function () { + describe("simulateKeyEvent", function () { + var mockElement, capturedEvent; + + beforeEach(function () { + mockElement = SpecRunnerUtils.createMockElement(); + mockElement.on("keydown", function(event) { + capturedEvent = event; + }); + }); + + afterEach(function () { + mockElement.remove(); + capturedEvent = null; + }); + + it("should create and dispatch a key event to an element", function () { + SpecRunnerUtils.simulateKeyEvent(82, "keydown", mockElement[0]); + expect(capturedEvent.keyCode).toEqual(82); + expect(capturedEvent.which).toEqual(82); + expect(capturedEvent.charCode).toEqual(82); + }); + + it("should create and dispatch a key event with modifiers to an element", function () { + var modifiers = { + ctrlKey: true, + altKey: true + }; + SpecRunnerUtils.simulateKeyEvent(82, "keydown", mockElement[0], modifiers); + expect(capturedEvent.keyCode).toEqual(82); + expect(capturedEvent.which).toEqual(82); + expect(capturedEvent.charCode).toEqual(82); + expect(capturedEvent.ctrlKey).toEqual(true); + expect(capturedEvent.altKey).toEqual(true); + }); + }); + }); +}); diff --git a/test/spec/SpecRunnerUtils.js b/test/spec/SpecRunnerUtils.js index 07c71a3e72f..96dae1a7ca3 100644 --- a/test/spec/SpecRunnerUtils.js +++ b/test/spec/SpecRunnerUtils.js @@ -21,7 +21,7 @@ * */ -/*global jasmine, expect, beforeEach, waitsFor, waitsForDone, runs, spyOn */ +/*global jasmine, expect, beforeEach, waitsFor, waitsForDone, runs, spyOn, KeyboardEvent */ define(function (require, exports, module) { 'use strict'; @@ -992,18 +992,29 @@ define(function (require, exports, module) { } /** - * Simulate key event. Found this code here: - * http://stackoverflow.com/questions/10455626/keydown-simulation-in-chrome-fires-normally-but-not-the-correct-key - * - * TODO: need parameter(s) for modifier keys - * + * Simulate a key event. * @param {Number} key Key code * @param (String) event Key event to simulate * @param {HTMLElement} element Element to receive event + * @param {KeyboardEventInit} options Optional arguments for key event */ - function simulateKeyEvent(key, event, element) { - var doc = element.ownerDocument, - oEvent = doc.createEvent('KeyboardEvent'); + function simulateKeyEvent(key, event, element, options) { + var doc = element.ownerDocument; + + if(typeof options === 'undefined') { + options = { + view: doc.defaultView, + bubbles: true, + cancelable: true, + keyIdentifer: key + }; + } else { + options.view = doc.defaultView; + options.bubbles = true; + options.cancelable = true; + options.keyIdentifier = key; + } + var oEvent = new KeyboardEvent(event, options); if (event !== "keydown" && event !== "keyup" && event !== "keypress") { console.log("SpecRunnerUtils.simulateKeyEvent() - unsupported keyevent: " + event); @@ -1029,15 +1040,9 @@ define(function (require, exports, module) { } }); - if (oEvent.initKeyboardEvent) { - oEvent.initKeyboardEvent(event, true, true, doc.defaultView, key, 0, false, false, false, false); - } else { - oEvent.initKeyEvent(event, true, true, doc.defaultView, false, false, false, false, key, 0); - } - oEvent.keyCodeVal = key; if (oEvent.keyCode !== key) { - console.log("keyCode mismatch " + oEvent.keyCode + "(" + oEvent.which + ")"); + console.log("SpecRunnerUtils.simulateKeyEvent() - keyCode mismatch: " + oEvent.keyCode); } element.dispatchEvent(oEvent); From f2751535be1d1b26963f9355f198fda15e36d4ae Mon Sep 17 00:00:00 2001 From: ficristo Date: Tue, 3 Jan 2017 09:15:35 +0100 Subject: [PATCH 032/151] Add a post install 'cleanup' for thirdparty dependencies --- .gitignore | 3 + Gruntfile.js | 42 +++--- npm-shrinkwrap.json | 286 ++++++++++++++++++++++++++++++++++++++++ package.json | 5 + src/config.json | 5 + src/index.html | 2 +- src/main.js | 9 +- src/npm-shrinkwrap.json | 280 --------------------------------------- src/package.json | 5 +- tasks/npm-install.js | 11 +- test/SpecRunner.js | 12 +- 11 files changed, 333 insertions(+), 327 deletions(-) create mode 100644 npm-shrinkwrap.json diff --git a/.gitignore b/.gitignore index b3ab55f4e4e..0442fa2a55c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,9 @@ Thumbs.db # ignore node_modules inside src /src/node_modules +#ignore file copied from node_modules to src/thirdparty +/src/thirdparty/CodeMirror + # ignore compiled files /dist /src/.index.html diff --git a/Gruntfile.js b/Gruntfile.js index 1d8bca04992..069f0928131 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -65,8 +65,6 @@ module.exports = function (grunt) { cwd: 'src/', src: [ 'nls/{,*/}*.js', - 'package.json', - 'npm-shrinkwrap.json', 'xorigin.js', 'dependencies.js', 'thirdparty/requirejs/require.js', @@ -105,13 +103,7 @@ module.exports = function (grunt) { '!extensions/default/*/thirdparty/**/*.htm{,l}', 'extensions/dev/*', 'extensions/samples/**/*', - 'thirdparty/CodeMirror/addon/{,*/}*', - 'thirdparty/CodeMirror/keymap/{,*/}*', - 'thirdparty/CodeMirror/lib/{,*/}*', - 'thirdparty/CodeMirror/mode/{,*/}*', - '!thirdparty/CodeMirror/mode/**/*.html', - '!thirdparty/CodeMirror/**/*test.js', - 'thirdparty/CodeMirror/theme/{,*/}*', + 'thirdparty/CodeMirror/**', 'thirdparty/i18n/*.js', 'thirdparty/text/*.js' ] @@ -124,6 +116,22 @@ module.exports = function (grunt) { src: ['jsTreeTheme.css', 'fonts/{,*/}*.*', 'images/*', 'brackets.min.css*'] } ] + }, + thirdparty: { + files: [ + { + expand: true, + dest: 'src/thirdparty/CodeMirror', + cwd: 'src/node_modules/codemirror', + src: [ + 'addon/{,*/}*', + 'keymap/{,*/}*', + 'lib/{,*/}*', + 'mode/{,*/}*', + 'theme/{,*/}*', + ] + } + ] } }, cleanempty: { @@ -295,19 +303,7 @@ module.exports = function (grunt) { 'spec' : '../test/spec', 'text' : 'thirdparty/text/text', 'i18n' : 'thirdparty/i18n/i18n' - }, - map: { - "*": { - "thirdparty/CodeMirror2": "thirdparty/CodeMirror" - } - }, - packages: [ - { - name: "thirdparty/CodeMirror", - location: "node_modules/codemirror", - main: "lib/codemirror" - } - ] + } } } } @@ -355,7 +351,7 @@ module.exports = function (grunt) { 'concat', /*'cssmin',*/ /*'uglify',*/ - 'copy', + 'copy:dist', 'npm-install', 'cleanempty', 'usemin', diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json new file mode 100644 index 00000000000..468bde46e56 --- /dev/null +++ b/npm-shrinkwrap.json @@ -0,0 +1,286 @@ +{ + "name": "Brackets", + "version": "1.9.0-0", + "dependencies": { + "anymatch": { + "version": "1.3.0", + "from": "anymatch@1.3.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.0.tgz" + }, + "arr-diff": { + "version": "2.0.0", + "from": "arr-diff@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz" + }, + "arr-flatten": { + "version": "1.0.1", + "from": "arr-flatten@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.0.1.tgz" + }, + "array-unique": { + "version": "0.2.1", + "from": "array-unique@>=0.2.1 <0.3.0", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz" + }, + "arrify": { + "version": "1.0.1", + "from": "arrify@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz" + }, + "async-each": { + "version": "1.0.1", + "from": "async-each@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz" + }, + "balanced-match": { + "version": "0.4.2", + "from": "balanced-match@>=0.4.1 <0.5.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz" + }, + "binary-extensions": { + "version": "1.8.0", + "from": "binary-extensions@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.8.0.tgz" + }, + "brace-expansion": { + "version": "1.1.6", + "from": "brace-expansion@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" + }, + "braces": { + "version": "1.8.5", + "from": "braces@>=1.8.2 <2.0.0", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz" + }, + "buffer-shims": { + "version": "1.0.0", + "from": "buffer-shims@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz" + }, + "chokidar": { + "version": "1.6.0", + "from": "chokidar@1.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.6.0.tgz" + }, + "concat-map": { + "version": "0.0.1", + "from": "concat-map@0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + }, + "core-util-is": { + "version": "1.0.2", + "from": "core-util-is@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" + }, + "expand-brackets": { + "version": "0.1.5", + "from": "expand-brackets@>=0.1.4 <0.2.0", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz" + }, + "expand-range": { + "version": "1.8.2", + "from": "expand-range@>=1.8.1 <2.0.0", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz" + }, + "extglob": { + "version": "0.3.2", + "from": "extglob@>=0.3.1 <0.4.0", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz" + }, + "filename-regex": { + "version": "2.0.0", + "from": "filename-regex@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.0.tgz" + }, + "fill-range": { + "version": "2.2.3", + "from": "fill-range@>=2.1.0 <3.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz" + }, + "for-in": { + "version": "0.1.6", + "from": "for-in@>=0.1.5 <0.2.0", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-0.1.6.tgz" + }, + "for-own": { + "version": "0.1.4", + "from": "for-own@>=0.1.4 <0.2.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.4.tgz" + }, + "glob-base": { + "version": "0.3.0", + "from": "glob-base@>=0.3.0 <0.4.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz" + }, + "glob-parent": { + "version": "2.0.0", + "from": "glob-parent@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz" + }, + "graceful-fs": { + "version": "4.1.11", + "from": "graceful-fs@>=4.1.2 <5.0.0", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz" + }, + "inherits": { + "version": "2.0.3", + "from": "inherits@>=2.0.1 <3.0.0", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + }, + "is-binary-path": { + "version": "1.0.1", + "from": "is-binary-path@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz" + }, + "is-buffer": { + "version": "1.1.4", + "from": "is-buffer@>=1.0.2 <2.0.0", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.4.tgz" + }, + "is-dotfile": { + "version": "1.0.2", + "from": "is-dotfile@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.2.tgz" + }, + "is-equal-shallow": { + "version": "0.1.3", + "from": "is-equal-shallow@>=0.1.3 <0.2.0", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz" + }, + "is-extendable": { + "version": "0.1.1", + "from": "is-extendable@>=0.1.1 <0.2.0", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz" + }, + "is-extglob": { + "version": "1.0.0", + "from": "is-extglob@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz" + }, + "is-glob": { + "version": "2.0.1", + "from": "is-glob@>=2.0.1 <3.0.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" + }, + "is-number": { + "version": "2.1.0", + "from": "is-number@>=2.1.0 <3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz" + }, + "is-posix-bracket": { + "version": "0.1.1", + "from": "is-posix-bracket@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz" + }, + "is-primitive": { + "version": "2.0.0", + "from": "is-primitive@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz" + }, + "isarray": { + "version": "1.0.0", + "from": "isarray@1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + }, + "isobject": { + "version": "2.1.0", + "from": "isobject@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz" + }, + "kind-of": { + "version": "3.1.0", + "from": "kind-of@>=3.0.2 <4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.1.0.tgz" + }, + "lodash": { + "version": "4.15.0", + "from": "lodash@4.15.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.15.0.tgz" + }, + "micromatch": { + "version": "2.3.11", + "from": "micromatch@>=2.1.5 <3.0.0", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz" + }, + "minimatch": { + "version": "3.0.3", + "from": "minimatch@>=3.0.2 <4.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz" + }, + "normalize-path": { + "version": "2.0.1", + "from": "normalize-path@>=2.0.1 <3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.0.1.tgz" + }, + "object.omit": { + "version": "2.0.1", + "from": "object.omit@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz" + }, + "parse-glob": { + "version": "3.0.4", + "from": "parse-glob@>=3.0.4 <4.0.0", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz" + }, + "path-is-absolute": { + "version": "1.0.1", + "from": "path-is-absolute@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + }, + "preserve": { + "version": "0.2.0", + "from": "preserve@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz" + }, + "process-nextick-args": { + "version": "1.0.7", + "from": "process-nextick-args@>=1.0.6 <1.1.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz" + }, + "randomatic": { + "version": "1.1.6", + "from": "randomatic@>=1.1.3 <2.0.0", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.6.tgz" + }, + "readable-stream": { + "version": "2.2.2", + "from": "readable-stream@>=2.0.2 <3.0.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.2.tgz" + }, + "readdirp": { + "version": "2.1.0", + "from": "readdirp@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz" + }, + "regex-cache": { + "version": "0.4.3", + "from": "regex-cache@>=0.4.2 <0.5.0", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz" + }, + "repeat-element": { + "version": "1.1.2", + "from": "repeat-element@>=1.1.2 <2.0.0", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz" + }, + "repeat-string": { + "version": "1.6.1", + "from": "repeat-string@>=1.5.2 <2.0.0", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" + }, + "set-immediate-shim": { + "version": "1.0.1", + "from": "set-immediate-shim@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz" + }, + "string_decoder": { + "version": "0.10.31", + "from": "string_decoder@>=0.10.0 <0.11.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + }, + "util-deprecate": { + "version": "1.0.2", + "from": "util-deprecate@>=1.0.1 <1.1.0", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + } + } +} diff --git a/package.json b/package.json index bf3ab4515b4..9e18985fdef 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,11 @@ "branch": "", "SHA": "" }, + "dependencies": { + "anymatch": "1.3.0", + "chokidar": "1.6.0", + "lodash": "4.15.0" + }, "devDependencies": { "glob": "7.0.6", "grunt": "0.4.5", diff --git a/src/config.json b/src/config.json index acd33ccc76a..08735af05a2 100644 --- a/src/config.json +++ b/src/config.json @@ -35,6 +35,11 @@ "branch": "", "SHA": "" }, + "dependencies": { + "anymatch": "1.3.0", + "chokidar": "1.6.0", + "lodash": "4.15.0" + }, "devDependencies": { "glob": "7.0.6", "grunt": "0.4.5", diff --git a/src/index.html b/src/index.html index 15ef0522d6c..72e6dce9d90 100644 --- a/src/index.html +++ b/src/index.html @@ -34,7 +34,7 @@ - + diff --git a/src/main.js b/src/main.js index 8dd86b9a8a5..38f0e36c5a1 100644 --- a/src/main.js +++ b/src/main.js @@ -40,14 +40,7 @@ require.config({ "thirdparty/CodeMirror2": "thirdparty/CodeMirror", "thirdparty/react": "react" } - }, - packages: [ - { - name: "thirdparty/CodeMirror", - location: "node_modules/codemirror", - main: "lib/codemirror" - } - ] + } }); if (window.location.search.indexOf("testEnvironment") > -1) { diff --git a/src/npm-shrinkwrap.json b/src/npm-shrinkwrap.json index 736975205fe..690dec9d75f 100644 --- a/src/npm-shrinkwrap.json +++ b/src/npm-shrinkwrap.json @@ -1,290 +1,10 @@ { "name": "brackets-src", "dependencies": { - "anymatch": { - "version": "1.3.0", - "from": "anymatch@1.3.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.0.tgz" - }, - "arr-diff": { - "version": "2.0.0", - "from": "arr-diff@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz" - }, - "arr-flatten": { - "version": "1.0.1", - "from": "arr-flatten@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.0.1.tgz" - }, - "array-unique": { - "version": "0.2.1", - "from": "array-unique@>=0.2.1 <0.3.0", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz" - }, - "arrify": { - "version": "1.0.1", - "from": "arrify@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz" - }, - "async-each": { - "version": "1.0.1", - "from": "async-each@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz" - }, - "balanced-match": { - "version": "0.4.2", - "from": "balanced-match@>=0.4.1 <0.5.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz" - }, - "binary-extensions": { - "version": "1.8.0", - "from": "binary-extensions@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.8.0.tgz" - }, - "brace-expansion": { - "version": "1.1.6", - "from": "brace-expansion@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" - }, - "braces": { - "version": "1.8.5", - "from": "braces@>=1.8.2 <2.0.0", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz" - }, - "buffer-shims": { - "version": "1.0.0", - "from": "buffer-shims@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz" - }, - "chokidar": { - "version": "1.6.0", - "from": "chokidar@1.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.6.0.tgz" - }, "codemirror": { "version": "5.21.0", "from": "codemirror@5.21.0", "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.21.0.tgz" - }, - "concat-map": { - "version": "0.0.1", - "from": "concat-map@0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - }, - "core-util-is": { - "version": "1.0.2", - "from": "core-util-is@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" - }, - "expand-brackets": { - "version": "0.1.5", - "from": "expand-brackets@>=0.1.4 <0.2.0", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz" - }, - "expand-range": { - "version": "1.8.2", - "from": "expand-range@>=1.8.1 <2.0.0", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz" - }, - "extglob": { - "version": "0.3.2", - "from": "extglob@>=0.3.1 <0.4.0", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz" - }, - "filename-regex": { - "version": "2.0.0", - "from": "filename-regex@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.0.tgz" - }, - "fill-range": { - "version": "2.2.3", - "from": "fill-range@>=2.1.0 <3.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz" - }, - "for-in": { - "version": "0.1.6", - "from": "for-in@>=0.1.5 <0.2.0", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-0.1.6.tgz" - }, - "for-own": { - "version": "0.1.4", - "from": "for-own@>=0.1.4 <0.2.0", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.4.tgz" - }, - "glob-base": { - "version": "0.3.0", - "from": "glob-base@>=0.3.0 <0.4.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz" - }, - "glob-parent": { - "version": "2.0.0", - "from": "glob-parent@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz" - }, - "graceful-fs": { - "version": "4.1.11", - "from": "graceful-fs@>=4.1.2 <5.0.0", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz" - }, - "inherits": { - "version": "2.0.3", - "from": "inherits@>=2.0.1 <3.0.0", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" - }, - "is-binary-path": { - "version": "1.0.1", - "from": "is-binary-path@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz" - }, - "is-buffer": { - "version": "1.1.4", - "from": "is-buffer@>=1.0.2 <2.0.0", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.4.tgz" - }, - "is-dotfile": { - "version": "1.0.2", - "from": "is-dotfile@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.2.tgz" - }, - "is-equal-shallow": { - "version": "0.1.3", - "from": "is-equal-shallow@>=0.1.3 <0.2.0", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz" - }, - "is-extendable": { - "version": "0.1.1", - "from": "is-extendable@>=0.1.1 <0.2.0", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz" - }, - "is-extglob": { - "version": "1.0.0", - "from": "is-extglob@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz" - }, - "is-glob": { - "version": "2.0.1", - "from": "is-glob@>=2.0.1 <3.0.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" - }, - "is-number": { - "version": "2.1.0", - "from": "is-number@>=2.1.0 <3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz" - }, - "is-posix-bracket": { - "version": "0.1.1", - "from": "is-posix-bracket@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz" - }, - "is-primitive": { - "version": "2.0.0", - "from": "is-primitive@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz" - }, - "isarray": { - "version": "1.0.0", - "from": "isarray@1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - }, - "isobject": { - "version": "2.1.0", - "from": "isobject@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz" - }, - "kind-of": { - "version": "3.1.0", - "from": "kind-of@>=3.0.2 <4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.1.0.tgz" - }, - "lodash": { - "version": "4.15.0", - "from": "lodash@4.15.0", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.15.0.tgz" - }, - "micromatch": { - "version": "2.3.11", - "from": "micromatch@>=2.1.5 <3.0.0", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz" - }, - "minimatch": { - "version": "3.0.3", - "from": "minimatch@>=3.0.2 <4.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz" - }, - "normalize-path": { - "version": "2.0.1", - "from": "normalize-path@>=2.0.1 <3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.0.1.tgz" - }, - "object.omit": { - "version": "2.0.1", - "from": "object.omit@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz" - }, - "parse-glob": { - "version": "3.0.4", - "from": "parse-glob@>=3.0.4 <4.0.0", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz" - }, - "path-is-absolute": { - "version": "1.0.1", - "from": "path-is-absolute@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" - }, - "preserve": { - "version": "0.2.0", - "from": "preserve@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz" - }, - "process-nextick-args": { - "version": "1.0.7", - "from": "process-nextick-args@>=1.0.6 <1.1.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz" - }, - "randomatic": { - "version": "1.1.6", - "from": "randomatic@>=1.1.3 <2.0.0", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.6.tgz" - }, - "readable-stream": { - "version": "2.2.2", - "from": "readable-stream@>=2.0.2 <3.0.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.2.tgz" - }, - "readdirp": { - "version": "2.1.0", - "from": "readdirp@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz" - }, - "regex-cache": { - "version": "0.4.3", - "from": "regex-cache@>=0.4.2 <0.5.0", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz" - }, - "repeat-element": { - "version": "1.1.2", - "from": "repeat-element@>=1.1.2 <2.0.0", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz" - }, - "repeat-string": { - "version": "1.6.1", - "from": "repeat-string@>=1.5.2 <2.0.0", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" - }, - "set-immediate-shim": { - "version": "1.0.1", - "from": "set-immediate-shim@>=1.0.1 <2.0.0", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz" - }, - "string_decoder": { - "version": "0.10.31", - "from": "string_decoder@>=0.10.0 <0.11.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" - }, - "util-deprecate": { - "version": "1.0.2", - "from": "util-deprecate@>=1.0.1 <1.1.0", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" } } } diff --git a/src/package.json b/src/package.json index 1db74e6e3e5..99ddd4fc1e0 100644 --- a/src/package.json +++ b/src/package.json @@ -1,9 +1,6 @@ { "name": "brackets-src", "dependencies": { - "anymatch": "1.3.0", - "chokidar": "1.6.0", - "codemirror": "5.21.0", - "lodash": "4.15.0" + "codemirror": "5.21.0" } } diff --git a/tasks/npm-install.js b/tasks/npm-install.js index 39ea1d0421d..f5924d3505a 100644 --- a/tasks/npm-install.js +++ b/tasks/npm-install.js @@ -47,6 +47,15 @@ module.exports = function (grunt) { } grunt.registerTask("npm-install", "Install node_modules to the dist folder so it gets bundled with release", function () { + var npmShrinkwrapJSON = grunt.file.readJSON("npm-shrinkwrap.json"); + common.writeJSON(grunt, "dist/npm-shrinkwrap.json", npmShrinkwrapJSON); + + var packageJSON = grunt.file.readJSON("package.json"); + delete packageJSON.devDependencies; + delete packageJSON.scripts; // we don't want to run post-install scripts in dist folder + common.writeJSON(grunt, "dist/package.json", packageJSON); + var packageJSON = grunt.file.readJSON("dist/package.json"); + var done = this.async(); runNpmInstall("dist", function (err) { return err ? done(false) : done(); @@ -82,7 +91,7 @@ module.exports = function (grunt) { grunt.registerTask( "npm-install-source", "Install node_modules for src folder and default extensions which have package.json defined", - ["npm-install-src", "npm-install-extensions"] + ["npm-install-src", "copy:thirdparty", "npm-install-extensions"] ); }; diff --git a/test/SpecRunner.js b/test/SpecRunner.js index 7c81d13238a..599c93f5ba8 100644 --- a/test/SpecRunner.js +++ b/test/SpecRunner.js @@ -38,17 +38,9 @@ require.config({ }, map: { "*": { - "thirdparty/CodeMirror2": "thirdparty/CodeMirror", - "thirdparty/react": "react" + "thirdparty/react": "react" } - }, - packages: [ - { - name: "thirdparty/CodeMirror", - location: "node_modules/codemirror", - main: "lib/codemirror" - } - ] + } }); define(function (require, exports, module) { From 6be6e292529e51e208ea0fd74837351ad469f889 Mon Sep 17 00:00:00 2001 From: Hassan Aslam Date: Thu, 5 Jan 2017 22:55:30 +0000 Subject: [PATCH 033/151] Fix for #12997: Live preview breaks on reload w/out editor (#13017) * Use _masterEditor if editor is null in HTMLDocument * Ensure editor exists during live preview + modify unit test * Formatting fix --- src/LiveDevelopment/Documents/HTMLDocument.js | 9 +++++++-- test/spec/LiveDevelopment-test.js | 15 ++++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/LiveDevelopment/Documents/HTMLDocument.js b/src/LiveDevelopment/Documents/HTMLDocument.js index 2b6e9ded4b7..30f45f45845 100644 --- a/src/LiveDevelopment/Documents/HTMLDocument.js +++ b/src/LiveDevelopment/Documents/HTMLDocument.js @@ -100,8 +100,13 @@ define(function HTMLDocumentModule(require, exports, module) { */ HTMLDocument.prototype.getResponseData = function getResponseData(enabled) { var body; - if (this._instrumentationEnabled && this.editor) { - body = HTMLInstrumentation.generateInstrumentedHTML(this.editor); + if (this._instrumentationEnabled) { + if (this.editor) { + body = HTMLInstrumentation.generateInstrumentedHTML(this.editor); + } else { + this.doc._ensureMasterEditor(); + body = HTMLInstrumentation.generateInstrumentedHTML(this.doc._masterEditor); + } } return { diff --git a/test/spec/LiveDevelopment-test.js b/test/spec/LiveDevelopment-test.js index fd79c28d0eb..c21c533c9c1 100644 --- a/test/spec/LiveDevelopment-test.js +++ b/test/spec/LiveDevelopment-test.js @@ -1103,7 +1103,9 @@ define(function (require, exports, module) { it("should reload the page when editing a non-live document", function () { var promise, jsdoc, - loadEventPromise; + loadEventPromise, + liveDoc, + liveResponse; runs(function () { // Setup reload spy @@ -1158,6 +1160,17 @@ define(function (require, exports, module) { runs(function () { expect(Inspector.Page.reload.callCount).toEqual(2); }); + + waitForLiveDoc(tempDir + "/simple1.html", function (doc) { + liveDoc = doc; + liveResponse = doc.getResponseData(); + }); + + runs(function () { + // Make sure a reload without an editor still sends back instrumented HTML + expect(liveDoc.editor).toBe(null); + expect(liveResponse.body.indexOf("data-brackets-id")).not.toBe(-1); + }); }); }); From bf41dc1a4fef73a381db04c4f374368229f91849 Mon Sep 17 00:00:00 2001 From: ficristo Date: Mon, 2 Jan 2017 09:11:13 +0100 Subject: [PATCH 034/151] Upgrade less from 2.5.1 to 2.7.2 --- .gitignore | 3 +- Gruntfile.js | 16 +- package.json | 2 +- src/config.json | 2 +- src/index.html | 2 +- src/npm-shrinkwrap.json | 441 +++++++++++++++++++++++++++++++ src/package.json | 3 +- src/thirdparty/less-2.5.1.min.js | 17 -- test/SpecRunner.html | 2 +- 9 files changed, 463 insertions(+), 25 deletions(-) delete mode 100644 src/thirdparty/less-2.5.1.min.js diff --git a/.gitignore b/.gitignore index 0442fa2a55c..ae51880ac86 100644 --- a/.gitignore +++ b/.gitignore @@ -10,8 +10,9 @@ Thumbs.db # ignore node_modules inside src /src/node_modules -#ignore file copied from node_modules to src/thirdparty +# ignore files copied from node_modules to src/thirdparty /src/thirdparty/CodeMirror +/src/thirdparty/less.min.js # ignore compiled files /dist diff --git a/Gruntfile.js b/Gruntfile.js index 069f0928131..25c14983dc0 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -130,6 +130,15 @@ module.exports = function (grunt) { 'mode/{,*/}*', 'theme/{,*/}*', ] + }, + { + expand: true, + flatten: true, + dest: 'src/thirdparty', + cwd: 'src/node_modules', + src: [ + 'less/dist/less.min.js' + ] } ] } @@ -286,9 +295,12 @@ module.exports = function (grunt) { specs : '<%= meta.specs %>', /* Keep in sync with test/SpecRunner.html dependencies */ vendor : [ - 'test/polyfills.js', /* For reference to why this polyfill is needed see Issue #7951. The need for this should go away once the version of phantomjs gets upgraded to 2.0 */ + // For reference to why this polyfill is needed see Issue #7951. + // The need for this should go away once the version of phantomjs gets upgraded to 2.0 + 'test/polyfills.js', + 'src/thirdparty/jquery-2.1.3.min.js', - 'src/thirdparty/less-2.5.1.min.js' + 'src/thirdparty/less.min.js' ], helpers : [ 'test/spec/PhantomHelper.js' diff --git a/package.json b/package.json index 9e18985fdef..6f05d07cd2e 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "grunt-contrib-clean": "0.4.1", "grunt-contrib-copy": "0.4.1", "grunt-contrib-htmlmin": "0.1.3", - "grunt-contrib-less": "1.0.1", + "grunt-contrib-less": "1.4.0", "grunt-contrib-requirejs": "0.4.1", "grunt-contrib-uglify": "0.2.0", "grunt-contrib-concat": "0.3.0", diff --git a/src/config.json b/src/config.json index 08735af05a2..78c75f94a01 100644 --- a/src/config.json +++ b/src/config.json @@ -56,7 +56,7 @@ "grunt-contrib-clean": "0.4.1", "grunt-contrib-copy": "0.4.1", "grunt-contrib-htmlmin": "0.1.3", - "grunt-contrib-less": "1.0.1", + "grunt-contrib-less": "1.4.0", "grunt-contrib-requirejs": "0.4.1", "grunt-contrib-uglify": "0.2.0", "grunt-contrib-concat": "0.3.0", diff --git a/src/index.html b/src/index.html index 72e6dce9d90..dd542c97a12 100644 --- a/src/index.html +++ b/src/index.html @@ -46,7 +46,7 @@ - + diff --git a/src/npm-shrinkwrap.json b/src/npm-shrinkwrap.json index 690dec9d75f..9283712df0a 100644 --- a/src/npm-shrinkwrap.json +++ b/src/npm-shrinkwrap.json @@ -1,10 +1,451 @@ { "name": "brackets-src", "dependencies": { + "ansi-regex": { + "version": "2.0.0", + "from": "ansi-regex@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" + }, + "ansi-styles": { + "version": "2.2.1", + "from": "ansi-styles@>=2.2.1 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "optional": true + }, + "asap": { + "version": "2.0.5", + "from": "asap@>=2.0.3 <2.1.0", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.5.tgz", + "optional": true + }, + "asn1": { + "version": "0.2.3", + "from": "asn1@>=0.2.3 <0.3.0", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "optional": true + }, + "assert-plus": { + "version": "0.2.0", + "from": "assert-plus@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "optional": true + }, + "asynckit": { + "version": "0.4.0", + "from": "asynckit@>=0.4.0 <0.5.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "optional": true + }, + "aws-sign2": { + "version": "0.6.0", + "from": "aws-sign2@>=0.6.0 <0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "optional": true + }, + "aws4": { + "version": "1.5.0", + "from": "aws4@>=1.2.1 <2.0.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.5.0.tgz", + "optional": true + }, + "bcrypt-pbkdf": { + "version": "1.0.0", + "from": "bcrypt-pbkdf@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.0.tgz", + "optional": true + }, + "boom": { + "version": "2.10.1", + "from": "boom@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz" + }, + "caseless": { + "version": "0.11.0", + "from": "caseless@>=0.11.0 <0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "optional": true + }, + "chalk": { + "version": "1.1.3", + "from": "chalk@>=1.1.1 <2.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "optional": true + }, "codemirror": { "version": "5.21.0", "from": "codemirror@5.21.0", "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.21.0.tgz" + }, + "combined-stream": { + "version": "1.0.5", + "from": "combined-stream@>=1.0.5 <1.1.0", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz" + }, + "commander": { + "version": "2.9.0", + "from": "commander@>=2.9.0 <3.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "optional": true + }, + "cryptiles": { + "version": "2.0.5", + "from": "cryptiles@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "optional": true + }, + "dashdash": { + "version": "1.14.1", + "from": "dashdash@>=1.12.0 <2.0.0", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "optional": true, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "from": "assert-plus@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "optional": true + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "from": "delayed-stream@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" + }, + "ecc-jsbn": { + "version": "0.1.1", + "from": "ecc-jsbn@>=0.1.1 <0.2.0", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "optional": true + }, + "errno": { + "version": "0.1.4", + "from": "errno@>=0.1.1 <0.2.0", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.4.tgz", + "optional": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "from": "escape-string-regexp@>=1.0.2 <2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "optional": true + }, + "extend": { + "version": "3.0.0", + "from": "extend@>=3.0.0 <3.1.0", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", + "optional": true + }, + "extsprintf": { + "version": "1.0.2", + "from": "extsprintf@1.0.2", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz" + }, + "forever-agent": { + "version": "0.6.1", + "from": "forever-agent@>=0.6.1 <0.7.0", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "optional": true + }, + "form-data": { + "version": "2.1.2", + "from": "form-data@>=2.1.1 <2.2.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.2.tgz", + "optional": true + }, + "generate-function": { + "version": "2.0.0", + "from": "generate-function@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", + "optional": true + }, + "generate-object-property": { + "version": "1.2.0", + "from": "generate-object-property@>=1.1.0 <2.0.0", + "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "optional": true + }, + "getpass": { + "version": "0.1.6", + "from": "getpass@>=0.1.1 <0.2.0", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.6.tgz", + "optional": true, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "from": "assert-plus@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "optional": true + } + } + }, + "graceful-fs": { + "version": "4.1.11", + "from": "graceful-fs@>=4.1.2 <5.0.0", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "optional": true + }, + "graceful-readlink": { + "version": "1.0.1", + "from": "graceful-readlink@>=1.0.0", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "optional": true + }, + "har-validator": { + "version": "2.0.6", + "from": "har-validator@>=2.0.6 <2.1.0", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", + "optional": true + }, + "has-ansi": { + "version": "2.0.0", + "from": "has-ansi@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "optional": true + }, + "hawk": { + "version": "3.1.3", + "from": "hawk@>=3.1.3 <3.2.0", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "optional": true + }, + "hoek": { + "version": "2.16.3", + "from": "hoek@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz" + }, + "http-signature": { + "version": "1.1.1", + "from": "http-signature@>=1.1.0 <1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "optional": true + }, + "image-size": { + "version": "0.5.1", + "from": "image-size@>=0.5.0 <0.6.0", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.1.tgz", + "optional": true + }, + "is-my-json-valid": { + "version": "2.15.0", + "from": "is-my-json-valid@>=2.12.4 <3.0.0", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz", + "optional": true + }, + "is-property": { + "version": "1.0.2", + "from": "is-property@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "optional": true + }, + "is-typedarray": { + "version": "1.0.0", + "from": "is-typedarray@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "optional": true + }, + "isstream": { + "version": "0.1.2", + "from": "isstream@>=0.1.2 <0.2.0", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "optional": true + }, + "jodid25519": { + "version": "1.0.2", + "from": "jodid25519@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz", + "optional": true + }, + "jsbn": { + "version": "0.1.0", + "from": "jsbn@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz", + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "from": "json-schema@0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "optional": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "from": "json-stringify-safe@>=5.0.1 <5.1.0", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "optional": true + }, + "jsonpointer": { + "version": "4.0.1", + "from": "jsonpointer@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", + "optional": true + }, + "jsprim": { + "version": "1.3.1", + "from": "jsprim@>=1.2.2 <2.0.0", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.3.1.tgz", + "optional": true + }, + "less": { + "version": "2.7.2", + "from": "less@latest", + "resolved": "https://registry.npmjs.org/less/-/less-2.7.2.tgz" + }, + "mime": { + "version": "1.3.4", + "from": "mime@>=1.2.11 <2.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", + "optional": true + }, + "mime-db": { + "version": "1.25.0", + "from": "mime-db@>=1.25.0 <1.26.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.25.0.tgz" + }, + "mime-types": { + "version": "2.1.13", + "from": "mime-types@>=2.1.7 <2.2.0", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.13.tgz" + }, + "minimist": { + "version": "0.0.8", + "from": "minimist@0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "optional": true + }, + "mkdirp": { + "version": "0.5.1", + "from": "mkdirp@>=0.5.0 <0.6.0", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "optional": true + }, + "oauth-sign": { + "version": "0.8.2", + "from": "oauth-sign@>=0.8.1 <0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "optional": true + }, + "pinkie": { + "version": "2.0.4", + "from": "pinkie@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "optional": true + }, + "pinkie-promise": { + "version": "2.0.1", + "from": "pinkie-promise@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "optional": true + }, + "promise": { + "version": "7.1.1", + "from": "promise@>=7.1.1 <8.0.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.1.1.tgz", + "optional": true + }, + "prr": { + "version": "0.0.0", + "from": "prr@>=0.0.0 <0.1.0", + "resolved": "https://registry.npmjs.org/prr/-/prr-0.0.0.tgz", + "optional": true + }, + "punycode": { + "version": "1.4.1", + "from": "punycode@>=1.4.1 <2.0.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "optional": true + }, + "qs": { + "version": "6.3.0", + "from": "qs@>=6.3.0 <6.4.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.0.tgz", + "optional": true + }, + "request": { + "version": "2.79.0", + "from": "request@>=2.72.0 <3.0.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", + "optional": true + }, + "sntp": { + "version": "1.0.9", + "from": "sntp@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "optional": true + }, + "source-map": { + "version": "0.5.6", + "from": "source-map@>=0.5.3 <0.6.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", + "optional": true + }, + "sshpk": { + "version": "1.10.1", + "from": "sshpk@>=1.7.0 <2.0.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.10.1.tgz", + "optional": true, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "from": "assert-plus@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "optional": true + } + } + }, + "stringstream": { + "version": "0.0.5", + "from": "stringstream@>=0.0.4 <0.1.0", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "optional": true + }, + "strip-ansi": { + "version": "3.0.1", + "from": "strip-ansi@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "optional": true + }, + "supports-color": { + "version": "2.0.0", + "from": "supports-color@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "optional": true + }, + "tough-cookie": { + "version": "2.3.2", + "from": "tough-cookie@>=2.3.0 <2.4.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", + "optional": true + }, + "tunnel-agent": { + "version": "0.4.3", + "from": "tunnel-agent@>=0.4.1 <0.5.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "optional": true + }, + "tweetnacl": { + "version": "0.14.5", + "from": "tweetnacl@>=0.14.0 <0.15.0", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "optional": true + }, + "uuid": { + "version": "3.0.1", + "from": "uuid@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz", + "optional": true + }, + "verror": { + "version": "1.3.6", + "from": "verror@1.3.6", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz", + "optional": true + }, + "xtend": { + "version": "4.0.1", + "from": "xtend@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "optional": true } } } diff --git a/src/package.json b/src/package.json index 99ddd4fc1e0..d6efd58485a 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,7 @@ { "name": "brackets-src", "dependencies": { - "codemirror": "5.21.0" + "codemirror": "5.21.0", + "less": "2.7.2" } } diff --git a/src/thirdparty/less-2.5.1.min.js b/src/thirdparty/less-2.5.1.min.js deleted file mode 100644 index 67b02a817bb..00000000000 --- a/src/thirdparty/less-2.5.1.min.js +++ /dev/null @@ -1,17 +0,0 @@ -/*! - * Less - Leaner CSS v2.5.1 - * http://lesscss.org - * - * Copyright (c) 2009-2015, Alexis Sellier - * Licensed under the Apache v2 License. - * - */ - - /** * @license Apache v2 - */ - -!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.less=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;d.length>g;g++)e(d[g]);return e}({1:[function(a,b){var c=a("./utils").addDataAttr,d=a("./browser");b.exports=function(a,b){c(b,d.currentScript(a)),void 0===b.isFileProtocol&&(b.isFileProtocol=/^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(a.location.protocol)),b.async=b.async||!1,b.fileAsync=b.fileAsync||!1,b.poll=b.poll||(b.isFileProtocol?1e3:1500),b.env=b.env||("127.0.0.1"==a.location.hostname||"0.0.0.0"==a.location.hostname||"localhost"==a.location.hostname||a.location.port&&a.location.port.length>0||b.isFileProtocol?"development":"production");var e=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(a.location.hash);e&&(b.dumpLineNumbers=e[1]),void 0===b.useFileCache&&(b.useFileCache=!0),void 0===b.onReady&&(b.onReady=!0)}},{"./browser":3,"./utils":9}],2:[function(a,b){a("promise/polyfill.js");var c=window.less||{};a("./add-default-options")(window,c);var d=b.exports=a("./index")(window,c);window.less=d,c.onReady&&(/!watch/.test(window.location.hash)&&d.watch(),d.registerStylesheetsImmediately(),d.pageLoadFinished=d.refresh("development"===d.env))},{"./add-default-options":1,"./index":7,"promise/polyfill.js":94}],3:[function(a,b){var c=a("./utils");b.exports={createCSS:function(a,b,d){var e=d.href||"",f="less:"+(d.title||c.extractId(e)),g=a.getElementById(f),h=!1,i=a.createElement("style");i.setAttribute("type","text/css"),d.media&&i.setAttribute("media",d.media),i.id=f,i.styleSheet||(i.appendChild(a.createTextNode(b)),h=null!==g&&g.childNodes.length>0&&i.childNodes.length>0&&g.firstChild.nodeValue===i.firstChild.nodeValue);var j=a.getElementsByTagName("head")[0];if(null===g||h===!1){var k=d&&d.nextSibling||null;k?k.parentNode.insertBefore(i,k):j.appendChild(i)}if(g&&h===!1&&g.parentNode.removeChild(g),i.styleSheet)try{i.styleSheet.cssText=b}catch(l){throw new Error("Couldn't reassign styleSheet.cssText.")}},currentScript:function(a){var b=a.document;return b.currentScript||function(){var a=b.getElementsByTagName("script");return a[a.length-1]}()}}},{"./utils":9}],4:[function(a,b){b.exports=function(a,b,c){var d=null;if("development"!==b.env)try{d="undefined"==typeof a.localStorage?null:a.localStorage}catch(e){}return{setCSS:function(a,b,e){if(d){c.info("saving "+a+" to cache.");try{d.setItem(a,e),d.setItem(a+":timestamp",b)}catch(f){c.error('failed to save "'+a+'" to local storage for caching.')}}},getCSS:function(a,b){var c=d&&d.getItem(a),e=d&&d.getItem(a+":timestamp");return e&&b.lastModified&&new Date(b.lastModified).valueOf()===new Date(e).valueOf()?c:void 0}}}},{}],5:[function(a,b){var c=a("./utils"),d=a("./browser");b.exports=function(a,b,e){function f(b,f){var g,h,i="less-error-message:"+c.extractId(f||""),j='
  • {content}
  • ',k=a.document.createElement("div"),l=[],m=b.filename||f,n=m.match(/([^\/]+(\?.*)?)$/)[1];k.id=i,k.className="less-error-message",h="

    "+(b.type||"Syntax")+"Error: "+(b.message||"There is an error in your .less file")+'

    in '+n+" ";var o=function(a,b,c){void 0!==a.extract[b]&&l.push(j.replace(/\{line\}/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};b.extract&&(o(b,0,""),o(b,1,"line"),o(b,2,""),h+="on line "+b.line+", column "+(b.column+1)+":

      "+l.join("")+"
    "),b.stack&&(b.extract||e.logLevel>=4)&&(h+="
    Stack Trace
    "+b.stack.split("\n").slice(1).join("
    ")),k.innerHTML=h,d.createCSS(a.document,[".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),k.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),"development"===e.env&&(g=setInterval(function(){var b=a.document,c=b.body;c&&(b.getElementById(i)?c.replaceChild(k,b.getElementById(i)):c.insertBefore(k,c.firstChild),clearInterval(g))},10))}function g(a,b){e.errorReporting&&"html"!==e.errorReporting?"console"===e.errorReporting?k(a,b):"function"==typeof e.errorReporting&&e.errorReporting("add",a,b):f(a,b)}function h(b){var d=a.document.getElementById("less-error-message:"+c.extractId(b));d&&d.parentNode.removeChild(d)}function i(){}function j(a){e.errorReporting&&"html"!==e.errorReporting?"console"===e.errorReporting?i(a):"function"==typeof e.errorReporting&&e.errorReporting("remove",a):h(a)}function k(a,c){var d="{line} {content}",f=a.filename||c,g=[],h=(a.type||"Syntax")+"Error: "+(a.message||"There is an error in your .less file")+" in "+f+" ",i=function(a,b,c){void 0!==a.extract[b]&&g.push(d.replace(/\{line\}/,(parseInt(a.line,10)||0)+(b-1)).replace(/\{class\}/,c).replace(/\{content\}/,a.extract[b]))};a.extract&&(i(a,0,""),i(a,1,"line"),i(a,2,""),h+="on line "+a.line+", column "+(a.column+1)+":\n"+g.join("\n")),a.stack&&(a.extract||e.logLevel>=4)&&(h+="\nStack Trace\n"+a.stack),b.logger.error(h)}return{add:g,remove:j}}},{"./browser":3,"./utils":9}],6:[function(a,b){b.exports=function(b,c){function d(){if(window.XMLHttpRequest&&!("file:"===window.location.protocol&&"ActiveXObject"in window))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){return c.error("browser doesn't support AJAX."),null}}var e=a("../less/environment/abstract-file-manager.js"),f={},g=function(){};return g.prototype=new e,g.prototype.alwaysMakePathsAbsolute=function(){return!0},g.prototype.join=function(a,b){return a?this.extractUrlParts(b,a).path:b},g.prototype.doXHR=function(a,e,f,g){function h(b,c,d){b.status>=200&&300>b.status?c(b.responseText,b.getResponseHeader("Last-Modified")):"function"==typeof d&&d(b.status,a)}var i=d(),j=b.isFileProtocol?b.fileAsync:b.async;"function"==typeof i.overrideMimeType&&i.overrideMimeType("text/css"),c.debug("XHR: Getting '"+a+"'"),i.open("GET",a,j),i.setRequestHeader("Accept",e||"text/x-less, text/css; q=0.9, */*; q=0.5"),i.send(null),b.isFileProtocol&&!b.fileAsync?0===i.status||i.status>=200&&300>i.status?f(i.responseText):g(i.status,a):j?i.onreadystatechange=function(){4==i.readyState&&h(i,f,g)}:h(i,f,g)},g.prototype.supports=function(){return!0},g.prototype.clearFileCache=function(){f={}},g.prototype.loadFile=function(a,b,c,d,e){b&&!this.isPathAbsolute(a)&&(a=b+a),c=c||{};var g=this.extractUrlParts(a,window.location.href),h=g.url;if(c.useFileCache&&f[h])try{var i=f[h];e(null,{contents:i,filename:h,webInfo:{lastModified:new Date}})}catch(j){e({filename:h,message:"Error loading file "+h+" error was "+j.message})}else this.doXHR(h,c.mime,function(a,b){f[h]=a,e(null,{contents:a,filename:h,webInfo:{lastModified:b}})},function(a,b){e({type:"File",message:"'"+b+"' wasn't found ("+a+")",href:h})})},g}},{"../less/environment/abstract-file-manager.js":14}],7:[function(a,b){var c=a("./utils").addDataAttr,d=a("./browser");b.exports=function(b,e){function f(a){return e.postProcessor&&"function"==typeof e.postProcessor&&(a=e.postProcessor.call(a,a)||a),a}function g(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function h(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){var d=c.concat(Array.prototype.slice.call(arguments,0));return a.apply(b,d)}}function i(a){for(var b,c=m.getElementsByTagName("style"),d=0;c.length>d;d++)if(b=c[d],b.type.match(t)){var f=g(e);f.modifyVars=a;var i=b.innerHTML||"";f.filename=m.location.href.replace(/#.*$/,""),n.render(i,f,h(function(a,b,c){b?r.add(b,"inline"):(a.type="text/css",a.styleSheet?a.styleSheet.cssText=c.css:a.innerHTML=c.css)},null,b))}}function j(a,b,d,h,i){function j(c){var e=c.contents,g=c.filename,i=c.webInfo,j={currentDirectory:q.getPath(g),filename:g,rootFilename:g,relativeUrls:k.relativeUrls};if(j.entryPath=j.currentDirectory,j.rootpath=k.rootpath||j.currentDirectory,i&&(i.remaining=h,!k.modifyVars)){var l=s.getCSS(g,i);if(!d&&l)return i.local=!0,void b(null,l,e,a,i,g)}r.remove(g),k.rootFileInfo=j,n.render(e,k,function(c,d){c?(c.href=g,b(c)):(d.css=f(d.css),k.modifyVars||s.setCSS(a.href,i.lastModified,d.css),b(null,d.css,e,a,i,g))})}var k=g(e);c(k,a),k.mime=a.type,i&&(k.modifyVars=i),q.loadFile(a.href,null,k,o,function(a,c){return a?void b(a):void j(c)})}function k(a,b,c){for(var d=0;n.sheets.length>d;d++)j(n.sheets[d],a,b,n.sheets.length-(d+1),c)}function l(){"development"===n.env&&(n.watchTimer=setInterval(function(){n.watchMode&&(q.clearFileCache(),k(function(a,c,e,f){a?r.add(a,a.href||f.href):c&&d.createCSS(b.document,c,f)}))},e.poll))}var m=b.document,n=a("../less")();n.options=e;var o=n.environment,p=a("./file-manager")(e,n.logger),q=new p;o.addFileManager(q),n.FileManager=p,a("./log-listener")(n,e);var r=a("./error-reporting")(b,n,e),s=n.cache=e.cache||a("./cache")(b,e,n.logger);e.functions&&n.functions.functionRegistry.addMultiple(e.functions);var t=/^text\/(x-)?less$/;return n.watch=function(){return n.watchMode||(n.env="development",l()),this.watchMode=!0,!0},n.unwatch=function(){return clearInterval(n.watchTimer),this.watchMode=!1,!1},n.registerStylesheetsImmediately=function(){var a=m.getElementsByTagName("link");n.sheets=[];for(var b=0;a.length>b;b++)("stylesheet/less"===a[b].rel||a[b].rel.match(/stylesheet/)&&a[b].type.match(t))&&n.sheets.push(a[b])},n.registerStylesheets=function(){return new Promise(function(a){n.registerStylesheetsImmediately(),a()})},n.modifyVars=function(a){return n.refresh(!0,a,!1)},n.refresh=function(a,c,e){return(a||e)&&e!==!1&&q.clearFileCache(),new Promise(function(e,f){var g,h,j;g=h=new Date,k(function(a,c,i,k,l){return a?(r.add(a,a.href||k.href),void f(a)):(n.logger.info(l.local?"loading "+k.href+" from cache.":"rendered "+k.href+" successfully."),d.createCSS(b.document,c,k),n.logger.info("css for "+k.href+" generated in "+(new Date-h)+"ms"),0===l.remaining&&(j=new Date-g,n.logger.info("less has finished. css generated in "+j+"ms"),e({startTime:g,endTime:h,totalMilliseconds:j,sheets:n.sheets.length})),void(h=new Date))},a,c),i(c)})},n.refreshStyles=i,n}},{"../less":29,"./browser":3,"./cache":4,"./error-reporting":5,"./file-manager":6,"./log-listener":8,"./utils":9}],8:[function(a,b){b.exports=function(a,b){var c=4,d=3,e=2,f=1;b.logLevel="undefined"!=typeof b.logLevel?b.logLevel:"development"===b.env?d:f,b.loggers||(b.loggers=[{debug:function(a){b.logLevel>=c&&console.log(a)},info:function(a){b.logLevel>=d&&console.log(a)},warn:function(a){b.logLevel>=e&&console.warn(a)},error:function(a){b.logLevel>=f&&console.error(a)}}]);for(var g=0;b.loggers.length>g;g++)a.logger.addListener(b.loggers[g])}},{}],9:[function(a,b){b.exports={extractId:function(a){return a.replace(/^[a-z-]+:\/+?[^\/]+/,"").replace(/[\?\&]livereload=\w+/,"").replace(/^\//,"").replace(/\.[a-zA-Z]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")},addDataAttr:function(a,b){for(var c in b.dataset)if(b.dataset.hasOwnProperty(c))if("env"===c||"dumpLineNumbers"===c||"rootpath"===c||"errorReporting"===c)a[c]=b.dataset[c];else try{a[c]=JSON.parse(b.dataset[c])}catch(d){}}}},{}],10:[function(a,b){var c={};b.exports=c;var d=function(a,b,c){if(a)for(var d=0;c.length>d;d++)a.hasOwnProperty(c[d])&&(b[c[d]]=a[c[d]])},e=["paths","relativeUrls","rootpath","strictImports","insecure","dumpLineNumbers","compress","syncImport","chunkInput","mime","useFileCache","processImports","reference","pluginManager"];c.Parse=function(a){d(a,this,e),"string"==typeof this.paths&&(this.paths=[this.paths])};var f=["paths","compress","ieCompat","strictMath","strictUnits","sourceMap","importMultiple","urlArgs","javascriptEnabled","pluginManager","importantScope"];c.Eval=function(a,b){d(a,this,f),"string"==typeof this.paths&&(this.paths=[this.paths]),this.frames=b||[],this.importantScope=this.importantScope||[]},c.Eval.prototype.inParenthesis=function(){this.parensStack||(this.parensStack=[]),this.parensStack.push(!0)},c.Eval.prototype.outOfParenthesis=function(){this.parensStack.pop()},c.Eval.prototype.isMathOn=function(){return this.strictMath?this.parensStack&&this.parensStack.length:!0},c.Eval.prototype.isPathRelative=function(a){return!/^(?:[a-z-]+:|\/|#)/i.test(a)},c.Eval.prototype.normalizePath=function(a){var b,c=a.split("/").reverse();for(a=[];0!==c.length;)switch(b=c.pop()){case".":break;case"..":0===a.length||".."===a[a.length-1]?a.push(b):a.pop();break;default:a.push(b)}return a.join("/")}},{}],11:[function(a,b){b.exports={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}},{}],12:[function(a,b){b.exports={colors:a("./colors"),unitConversions:a("./unit-conversions")}},{"./colors":11,"./unit-conversions":13}],13:[function(a,b){b.exports={length:{m:1,cm:.01,mm:.001,"in":.0254,px:.0254/96,pt:.0254/72,pc:.0254/72*12},duration:{s:1,ms:.001},angle:{rad:1/(2*Math.PI),deg:1/360,grad:.0025,turn:1}}},{}],14:[function(a,b){var c=function(){};c.prototype.getPath=function(a){var b=a.lastIndexOf("?");return b>0&&(a=a.slice(0,b)),b=a.lastIndexOf("/"),0>b&&(b=a.lastIndexOf("\\")),0>b?"":a.slice(0,b+1)},c.prototype.tryAppendExtension=function(a,b){return/(\.[a-z]*$)|([\?;].*)$/.test(a)?a:a+b},c.prototype.tryAppendLessExtension=function(a){return this.tryAppendExtension(a,".less")},c.prototype.supportsSync=function(){return!1},c.prototype.alwaysMakePathsAbsolute=function(){return!1},c.prototype.isPathAbsolute=function(a){return/^(?:[a-z-]+:|\/|\\|#)/i.test(a)},c.prototype.join=function(a,b){return a?a+b:b},c.prototype.pathDiff=function(a,b){var c,d,e,f,g=this.extractUrlParts(a),h=this.extractUrlParts(b),i="";if(g.hostPart!==h.hostPart)return"";for(d=Math.max(h.directories.length,g.directories.length),c=0;d>c&&h.directories[c]===g.directories[c];c++);for(f=h.directories.slice(c),e=g.directories.slice(c),c=0;f.length-1>c;c++)i+="../";for(c=0;e.length-1>c;c++)i+=e[c]+"/";return i},c.prototype.extractUrlParts=function(a,b){var c,d,e=/^((?:[a-z-]+:)?\/+?(?:[^\/\?#]*\/)|([\/\\]))?((?:[^\/\\\?#]*[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/i,f=a.match(e),g={},h=[];if(!f)throw new Error("Could not parse sheet href - '"+a+"'");if(b&&(!f[1]||f[2])){if(d=b.match(e),!d)throw new Error("Could not parse page url - '"+b+"'");f[1]=f[1]||d[1]||"",f[2]||(f[3]=d[3]+f[3])}if(f[3]){for(h=f[3].replace(/\\/g,"/").split("/"),c=0;h.length>c;c++)"."===h[c]&&(h.splice(c,1),c-=1);for(c=0;h.length>c;c++)".."===h[c]&&c>0&&(h.splice(c-1,2),c-=2)}return g.hostPart=f[1],g.directories=h,g.path=(f[1]||"")+h.join("/"),g.fileUrl=g.path+(f[4]||""),g.url=g.fileUrl+(f[5]||""),g},b.exports=c},{}],15:[function(a,b){var c=a("../logger"),d=function(a,b){this.fileManagers=b||[],a=a||{};for(var c=["encodeBase64","mimeLookup","charsetLookup","getSourceMapGenerator"],d=[],e=d.concat(c),f=0;e.length>f;f++){var g=e[f],h=a[g];h?this[g]=h.bind(a):d.length>f&&this.warn("missing required function in environment - "+g)}};d.prototype.getFileManager=function(a,b,d,e,f){a||c.warn("getFileManager called with no filename.. Please report this issue. continuing."),null==b&&c.warn("getFileManager called with null directory.. Please report this issue. continuing.");var g=this.fileManagers;d.pluginManager&&(g=[].concat(g).concat(d.pluginManager.getFileManagers()));for(var h=g.length-1;h>=0;h--){var i=g[h];if(i[f?"supportsSync":"supports"](a,b,d,e))return i}return null},d.prototype.addFileManager=function(a){this.fileManagers.push(a)},d.prototype.clearFileManagers=function(){this.fileManagers=[]},b.exports=d},{"../logger":31}],16:[function(a){function b(a,b,d){var e,f,g,h,i=b.alpha,j=d.alpha,k=[];g=j+i*(1-j);for(var l=0;3>l;l++)e=b.rgb[l]/255,f=d.rgb[l]/255,h=a(e,f),g&&(h=(j*f+i*(e-j*(e+f-h)))/g),k[l]=255*h;return new c(k,g)}var c=a("../tree/color"),d=a("./function-registry"),e={multiply:function(a,b){return a*b},screen:function(a,b){return a+b-a*b},overlay:function(a,b){return a*=2,1>=a?e.multiply(a,b):e.screen(a-1,b)},softlight:function(a,b){var c=1,d=a;return b>.5&&(d=1,c=a>.25?Math.sqrt(a):((16*a-12)*a+4)*a),a-(1-2*b)*d*(c-a)},hardlight:function(a,b){return e.overlay(b,a)},difference:function(a,b){return Math.abs(a-b)},exclusion:function(a,b){return a+b-2*a*b},average:function(a,b){return(a+b)/2},negation:function(a,b){return 1-Math.abs(a+b-1)}};for(var f in e)e.hasOwnProperty(f)&&(b[f]=b.bind(null,e[f]));d.addMultiple(b)},{"../tree/color":48,"./function-registry":21}],17:[function(a){function b(a){return Math.min(1,Math.max(0,a))}function c(a){return f.hsla(a.h,a.s,a.l,a.a)}function d(a){if(a instanceof g)return parseFloat(a.unit.is("%")?a.value/100:a.value);if("number"==typeof a)return a;throw{type:"Argument",message:"color functions take numbers as parameters"}}function e(a,b){return a instanceof g&&a.unit.is("%")?parseFloat(a.value*b/100):d(a)}var f,g=a("../tree/dimension"),h=a("../tree/color"),i=a("../tree/quoted"),j=a("../tree/anonymous"),k=a("./function-registry");f={rgb:function(a,b,c){return f.rgba(a,b,c,1)},rgba:function(a,b,c,f){var g=[a,b,c].map(function(a){return e(a,255)});return f=d(f),new h(g,f)},hsl:function(a,b,c){return f.hsla(a,b,c,1)},hsla:function(a,c,e,g){function h(a){return a=0>a?a+1:a>1?a-1:a,1>6*a?j+(i-j)*a*6:1>2*a?i:2>3*a?j+(i-j)*(2/3-a)*6:j}a=d(a)%360/360,c=b(d(c)),e=b(d(e)),g=b(d(g));var i=.5>=e?e*(c+1):e+c-e*c,j=2*e-i;return f.rgba(255*h(a+1/3),255*h(a),255*h(a-1/3),g)},hsv:function(a,b,c){return f.hsva(a,b,c,1)},hsva:function(a,b,c,e){a=d(a)%360/360*360,b=d(b),c=d(c),e=d(e);var g,h;g=Math.floor(a/60%6),h=a/60-g;var i=[c,c*(1-b),c*(1-h*b),c*(1-(1-h)*b)],j=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return f.rgba(255*i[j[g][0]],255*i[j[g][1]],255*i[j[g][2]],e)},hue:function(a){return new g(a.toHSL().h)},saturation:function(a){return new g(100*a.toHSL().s,"%")},lightness:function(a){return new g(100*a.toHSL().l,"%")},hsvhue:function(a){return new g(a.toHSV().h)},hsvsaturation:function(a){return new g(100*a.toHSV().s,"%")},hsvvalue:function(a){return new g(100*a.toHSV().v,"%")},red:function(a){return new g(a.rgb[0])},green:function(a){return new g(a.rgb[1])},blue:function(a){return new g(a.rgb[2])},alpha:function(a){return new g(a.toHSL().a)},luma:function(a){return new g(a.luma()*a.alpha*100,"%")},luminance:function(a){var b=.2126*a.rgb[0]/255+.7152*a.rgb[1]/255+.0722*a.rgb[2]/255;return new g(b*a.alpha*100,"%")},saturate:function(a,d,e){if(!a.rgb)return null;var f=a.toHSL();return f.s+="undefined"!=typeof e&&"relative"===e.value?f.s*d.value/100:d.value/100,f.s=b(f.s),c(f)},desaturate:function(a,d,e){var f=a.toHSL();return f.s-="undefined"!=typeof e&&"relative"===e.value?f.s*d.value/100:d.value/100,f.s=b(f.s),c(f)},lighten:function(a,d,e){var f=a.toHSL();return f.l+="undefined"!=typeof e&&"relative"===e.value?f.l*d.value/100:d.value/100,f.l=b(f.l),c(f)},darken:function(a,d,e){var f=a.toHSL();return f.l-="undefined"!=typeof e&&"relative"===e.value?f.l*d.value/100:d.value/100,f.l=b(f.l),c(f)},fadein:function(a,d,e){var f=a.toHSL();return f.a+="undefined"!=typeof e&&"relative"===e.value?f.a*d.value/100:d.value/100,f.a=b(f.a),c(f)},fadeout:function(a,d,e){var f=a.toHSL();return f.a-="undefined"!=typeof e&&"relative"===e.value?f.a*d.value/100:d.value/100,f.a=b(f.a),c(f)},fade:function(a,d){var e=a.toHSL();return e.a=d.value/100,e.a=b(e.a),c(e)},spin:function(a,b){var d=a.toHSL(),e=(d.h+b.value)%360;return d.h=0>e?360+e:e,c(d)},mix:function(a,b,c){a.toHSL&&b.toHSL||(console.log(b.type),console.dir(b)),c||(c=new g(50));var d=c.value/100,e=2*d-1,f=a.toHSL().a-b.toHSL().a,i=((e*f==-1?e:(e+f)/(1+e*f))+1)/2,j=1-i,k=[a.rgb[0]*i+b.rgb[0]*j,a.rgb[1]*i+b.rgb[1]*j,a.rgb[2]*i+b.rgb[2]*j],l=a.alpha*d+b.alpha*(1-d);return new h(k,l)},greyscale:function(a){return f.desaturate(a,new g(100))},contrast:function(a,b,c,e){if(!a.rgb)return null;if("undefined"==typeof c&&(c=f.rgba(255,255,255,1)),"undefined"==typeof b&&(b=f.rgba(0,0,0,1)),b.luma()>c.luma()){var g=c;c=b,b=g}return e="undefined"==typeof e?.43:d(e),a.luma()=t&&this.context.ieCompat!==!1?(g.warn("Skipped data-uri embedding of "+i+" because its size ("+s.length+" characters) exceeds IE8-safe "+t+" characters!"),f(this,e||a)):new d(new c('"'+s+'"',s,!1,this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../logger":31,"../tree/quoted":71,"../tree/url":78,"./function-registry":21}],19:[function(a,b){var c=a("../tree/keyword"),d=a("./function-registry"),e={eval:function(){var a=this.value_,b=this.error_;if(b)throw b;return null!=a?a?c.True:c.False:void 0},value:function(a){this.value_=a},error:function(a){this.error_=a},reset:function(){this.value_=this.error_=null}};d.add("default",e.eval.bind(e)),b.exports=e},{"../tree/keyword":63,"./function-registry":21}],20:[function(a,b){var c=a("../tree/expression"),d=function(a,b,c,d){this.name=a.toLowerCase(),this.index=c,this.context=b,this.currentFileInfo=d,this.func=b.frames[0].functionRegistry.get(this.name)};d.prototype.isValid=function(){return Boolean(this.func)},d.prototype.call=function(a){return Array.isArray(a)&&(a=a.filter(function(a){return"Comment"===a.type?!1:!0}).map(function(a){if("Expression"===a.type){var b=a.value.filter(function(a){return"Comment"===a.type?!1:!0});return 1===b.length?b[0]:new c(b)}return a})),this.func.apply(this,a)},b.exports=d},{"../tree/expression":57}],21:[function(a,b){function c(a){return{_data:{},add:function(a,b){a=a.toLowerCase(),this._data.hasOwnProperty(a),this._data[a]=b},addMultiple:function(a){Object.keys(a).forEach(function(b){this.add(b,a[b])}.bind(this))},get:function(b){return this._data[b]||a&&a.get(b)},inherit:function(){return c(this)}}}b.exports=c(null)},{}],22:[function(a,b){b.exports=function(b){var c={functionRegistry:a("./function-registry"),functionCaller:a("./function-caller")};return a("./default"),a("./color"),a("./color-blending"),a("./data-uri")(b),a("./math"),a("./number"),a("./string"),a("./svg")(b),a("./types"),c}},{"./color":17,"./color-blending":16,"./data-uri":18,"./default":19,"./function-caller":20,"./function-registry":21,"./math":23,"./number":24,"./string":25,"./svg":26,"./types":27}],23:[function(a){function b(a,b,d){if(!(d instanceof c))throw{type:"Argument",message:"argument must be a number"};return null==b?b=d.unit:d=d.unify(),new c(a(parseFloat(d.value)),b)}var c=a("../tree/dimension"),d=a("./function-registry"),e={ceil:null,floor:null,sqrt:null,abs:null,tan:"",sin:"",cos:"",atan:"rad",asin:"rad",acos:"rad"};for(var f in e)e.hasOwnProperty(f)&&(e[f]=b.bind(null,Math[f],e[f]));e.round=function(a,c){var d="undefined"==typeof c?0:c.value;return b(function(a){return a.toFixed(d)},null,a)},d.addMultiple(e)},{"../tree/dimension":54,"./function-registry":21}],24:[function(a){var b=a("../tree/dimension"),c=a("../tree/anonymous"),d=a("./function-registry"),e=function(a,d){switch(d=Array.prototype.slice.call(d),d.length){case 0:throw{type:"Argument",message:"one or more arguments required"}}var e,f,g,h,i,j,k,l,m=[],n={};for(e=0;d.length>e;e++)if(g=d[e],g instanceof b)if(h=""===g.unit.toString()&&void 0!==l?new b(g.value,l).unify():g.unify(),j=""===h.unit.toString()&&void 0!==k?k:h.unit.toString(),k=""!==j&&void 0===k||""!==j&&""===m[0].unify().unit.toString()?j:k,l=""!==j&&void 0===l?g.unit.toString():l,f=void 0!==n[""]&&""!==j&&j===k?n[""]:n[j],void 0!==f)i=""===m[f].unit.toString()&&void 0!==l?new b(m[f].value,l).unify():m[f].unify(),(a&&i.value>h.value||!a&&h.value>i.value)&&(m[f]=g);else{if(void 0!==k&&j!==k)throw{type:"Argument",message:"incompatible types"};n[j]=m.length,m.push(g)}else Array.isArray(d[e].value)&&Array.prototype.push.apply(d,Array.prototype.slice.call(d[e].value));return 1==m.length?m[0]:(d=m.map(function(a){return a.toCSS(this.context)}).join(this.context.compress?",":", "),new c((a?"min":"max")+"("+d+")"))};d.addMultiple({min:function(){return e(!0,arguments)},max:function(){return e(!1,arguments)},convert:function(a,b){return a.convertTo(b.value)},pi:function(){return new b(Math.PI)},mod:function(a,c){return new b(a.value%c.value,a.unit)},pow:function(a,c){if("number"==typeof a&&"number"==typeof c)a=new b(a),c=new b(c);else if(!(a instanceof b&&c instanceof b))throw{type:"Argument",message:"arguments must be numbers"};return new b(Math.pow(a.value,c.value),a.unit)},percentage:function(a){return new b(100*a.value,"%")}})},{"../tree/anonymous":44,"../tree/dimension":54,"./function-registry":21}],25:[function(a){var b=a("../tree/quoted"),c=a("../tree/anonymous"),d=a("../tree/javascript"),e=a("./function-registry");e.addMultiple({e:function(a){return new c(a instanceof d?a.evaluated:a.value)},escape:function(a){return new c(encodeURI(a.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},replace:function(a,c,d,e){var f=a.value;return d="Quoted"===d.type?d.value:d.toCSS(),f=f.replace(new RegExp(c.value,e?e.value:""),d),new b(a.quote||"",f,a.escaped)},"%":function(a){for(var c=Array.prototype.slice.call(arguments,1),d=a.value,e=0;c.length>e;e++)d=d.replace(/%[sda]/i,function(a){var b="Quoted"===c[e].type&&a.match(/s/i)?c[e].value:c[e].toCSS();return a.match(/[A-Z]$/)?encodeURIComponent(b):b});return d=d.replace(/%%/g,"%"),new b(a.quote||"",d,a.escaped)}})},{"../tree/anonymous":44,"../tree/javascript":61,"../tree/quoted":71,"./function-registry":21}],26:[function(a,b){b.exports=function(){var b=a("../tree/dimension"),c=a("../tree/color"),d=a("../tree/expression"),e=a("../tree/quoted"),f=a("../tree/url"),g=a("./function-registry");g.add("svg-gradient",function(a){function g(){throw{type:"Argument",message:"svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position] or direction, color list"}}var h,i,j,k,l,m,n,o,p="linear",q='x="0" y="0" width="1" height="1"',r={compress:!1},s=a.toCSS(r);switch(2==arguments.length?(arguments[1].value.length<2&&g(),h=arguments[1].value):arguments.length<3?g():h=Array.prototype.slice.call(arguments,1),s){case"to bottom":i='x1="0%" y1="0%" x2="0%" y2="100%"';break;case"to right":i='x1="0%" y1="0%" x2="100%" y2="0%"';break;case"to bottom right":i='x1="0%" y1="0%" x2="100%" y2="100%"';break;case"to top right":i='x1="0%" y1="100%" x2="100%" y2="0%"';break;case"ellipse":case"ellipse at center":p="radial",i='cx="50%" cy="50%" r="75%"',q='x="-50" y="-50" width="101" height="101"';break;default:throw{type:"Argument",message:"svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center'"}}for(j='<'+p+'Gradient id="gradient" gradientUnits="userSpaceOnUse" '+i+">", -k=0;h.length>k;k+=1)h[k]instanceof d?(l=h[k].value[0],m=h[k].value[1]):(l=h[k],m=void 0),l instanceof c&&((0===k||k+1===h.length)&&void 0===m||m instanceof b)||g(),n=m?m.toCSS(r):0===k?"0%":"100%",o=l.alpha,j+='o?' stop-opacity="'+o+'"':"")+"/>";return j+="',j=encodeURIComponent(j),j="data:image/svg+xml,"+j,new f(new e("'"+j+"'",j,!1,this.index,this.currentFileInfo),this.index,this.currentFileInfo)})}},{"../tree/color":48,"../tree/dimension":54,"../tree/expression":57,"../tree/quoted":71,"../tree/url":78,"./function-registry":21}],27:[function(a){var b=a("../tree/keyword"),c=a("../tree/detached-ruleset"),d=a("../tree/dimension"),e=a("../tree/color"),f=a("../tree/quoted"),g=a("../tree/anonymous"),h=a("../tree/url"),i=a("../tree/operation"),j=a("./function-registry"),k=function(a,c){return a instanceof c?b.True:b.False},l=function(a,c){if(void 0===c)throw{type:"Argument",message:"missing the required second argument to isunit."};if(c="string"==typeof c.value?c.value:c,"string"!=typeof c)throw{type:"Argument",message:"Second argument to isunit should be a unit or a string."};return a instanceof d&&a.unit.is(c)?b.True:b.False},m=function(a){var b=Array.isArray(a.value)?a.value:Array(a);return b};j.addMultiple({isruleset:function(a){return k(a,c)},iscolor:function(a){return k(a,e)},isnumber:function(a){return k(a,d)},isstring:function(a){return k(a,f)},iskeyword:function(a){return k(a,b)},isurl:function(a){return k(a,h)},ispixel:function(a){return l(a,"px")},ispercentage:function(a){return l(a,"%")},isem:function(a){return l(a,"em")},isunit:l,unit:function(a,c){if(!(a instanceof d))throw{type:"Argument",message:"the first argument to unit must be a number"+(a instanceof i?". Have you forgotten parenthesis?":"")};return c=c?c instanceof b?c.value:c.toCSS():"",new d(a.value,c)},"get-unit":function(a){return new g(a.unit)},extract:function(a,b){return b=b.value-1,m(a)[b]},length:function(a){return new d(m(a).length)}})},{"../tree/anonymous":44,"../tree/color":48,"../tree/detached-ruleset":53,"../tree/dimension":54,"../tree/keyword":63,"../tree/operation":69,"../tree/quoted":71,"../tree/url":78,"./function-registry":21}],28:[function(a,b){var c=a("./contexts"),d=a("./parser/parser"),e=a("./plugins/function-importer");b.exports=function(a){var b=function(a,b){this.rootFilename=b.filename,this.paths=a.paths||[],this.contents={},this.contentsIgnoredChars={},this.mime=a.mime,this.error=null,this.context=a,this.queue=[],this.files={}};return b.prototype.push=function(b,f,g,h,i){var j=this;this.queue.push(b);var k=function(a,c,d){j.queue.splice(j.queue.indexOf(b),1);var e=d===j.rootFilename;h.optional&&a?i(null,{rules:[]},!1,null):(j.files[d]=c,a&&!j.error&&(j.error=a),i(a,c,e,d))},l={relativeUrls:this.context.relativeUrls,entryPath:g.entryPath,rootpath:g.rootpath,rootFilename:g.rootFilename},m=a.getFileManager(b,g.currentDirectory,this.context,a);if(!m)return void k({message:"Could not find a file-manager for "+b});f&&(b=m.tryAppendExtension(b,h.plugin?".js":".less"));var n=function(a){var b=a.filename,f=a.contents.replace(/^\uFEFF/,"");l.currentDirectory=m.getPath(b),l.relativeUrls&&(l.rootpath=m.join(j.context.rootpath||"",m.pathDiff(l.currentDirectory,l.entryPath)),!m.isPathAbsolute(l.rootpath)&&m.alwaysMakePathsAbsolute()&&(l.rootpath=m.join(l.entryPath,l.rootpath))),l.filename=b;var i=new c.Parse(j.context);i.processImports=!1,j.contents[b]=f,(g.reference||h.reference)&&(l.reference=!0),h.plugin?new e(i,l).eval(f,function(a,c){k(a,c,b)}):h.inline?k(null,f,b):new d(i,j,l).parse(f,function(a,c){k(a,c,b)})},o=m.loadFile(b,g.currentDirectory,this.context,a,function(a,b){a?k(a):n(b)});o&&o.then(n,k)},b}},{"./contexts":10,"./parser/parser":36,"./plugins/function-importer":38}],29:[function(a,b){b.exports=function(b,c){var d,e,f,g,h,i={version:[2,5,1],data:a("./data"),tree:a("./tree"),Environment:h=a("./environment/environment"),AbstractFileManager:a("./environment/abstract-file-manager"),environment:b=new h(b,c),visitors:a("./visitors"),Parser:a("./parser/parser"),functions:a("./functions")(b),contexts:a("./contexts"),SourceMapOutput:d=a("./source-map-output")(b),SourceMapBuilder:e=a("./source-map-builder")(d,b),ParseTree:f=a("./parse-tree")(e),ImportManager:g=a("./import-manager")(b),render:a("./render")(b,f,g),parse:a("./parse")(b,f,g),LessError:a("./less-error"),transformTree:a("./transform-tree"),utils:a("./utils"),PluginManager:a("./plugin-manager"),logger:a("./logger")};return i}},{"./contexts":10,"./data":12,"./environment/abstract-file-manager":14,"./environment/environment":15,"./functions":22,"./import-manager":28,"./less-error":30,"./logger":31,"./parse":33,"./parse-tree":32,"./parser/parser":36,"./plugin-manager":37,"./render":39,"./source-map-builder":40,"./source-map-output":41,"./transform-tree":42,"./tree":60,"./utils":81,"./visitors":85}],30:[function(a,b){var c=a("./utils"),d=b.exports=function(a,b,d){Error.call(this);var e=a.filename||d;if(b&&e){var f=b.contents[e],g=c.getLocation(a.index,f),h=g.line,i=g.column,j=a.call&&c.getLocation(a.call,f).line,k=f.split("\n");this.type=a.type||"Syntax",this.filename=e,this.index=a.index,this.line="number"==typeof h?h+1:null,this.callLine=j+1,this.callExtract=k[j],this.column=i,this.extract=[k[h-1],k[h],k[h+1]]}this.message=a.message,this.stack=a.stack};if("undefined"==typeof Object.create){var e=function(){};e.prototype=Error.prototype,d.prototype=new e}else d.prototype=Object.create(Error.prototype);d.prototype.constructor=d},{"./utils":81}],31:[function(a,b){b.exports={error:function(a){this._fireEvent("error",a)},warn:function(a){this._fireEvent("warn",a)},info:function(a){this._fireEvent("info",a)},debug:function(a){this._fireEvent("debug",a)},addListener:function(a){this._listeners.push(a)},removeListener:function(a){for(var b=0;this._listeners.length>b;b++)if(this._listeners[b]===a)return void this._listeners.splice(b,1)},_fireEvent:function(a,b){for(var c=0;this._listeners.length>c;c++){var d=this._listeners[c][a];d&&d(b)}},_listeners:[]}},{}],32:[function(a,b){var c=a("./less-error"),d=a("./transform-tree"),e=a("./logger");b.exports=function(a){var b=function(a,b){this.root=a,this.imports=b};return b.prototype.toCSS=function(b){var f,g,h={};try{f=d(this.root,b)}catch(i){throw new c(i,this.imports)}try{var j=Boolean(b.compress);j&&e.warn("The compress option has been deprecated. We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css.");var k={compress:j,dumpLineNumbers:b.dumpLineNumbers,strictUnits:Boolean(b.strictUnits),numPrecision:8};b.sourceMap?(g=new a(b.sourceMap),h.css=g.toCSS(f,k,this.imports)):h.css=f.toCSS(k)}catch(i){throw new c(i,this.imports)}if(b.pluginManager)for(var l=b.pluginManager.getPostProcessors(),m=0;l.length>m;m++)h.css=l[m].process(h.css,{sourceMap:g,options:b,imports:this.imports});b.sourceMap&&(h.map=g.getExternalSourceMap()),h.imports=[];for(var n in this.imports.files)this.imports.files.hasOwnProperty(n)&&n!==this.imports.rootFilename&&h.imports.push(n);return h},b}},{"./less-error":30,"./logger":31,"./transform-tree":42}],33:[function(a,b){var c,d=a("./contexts"),e=a("./parser/parser"),f=a("./plugin-manager");b.exports=function(b,g,h){var i=function(b,g,j){if(g=g||{},"function"==typeof g&&(j=g,g={}),!j){c||(c="undefined"==typeof Promise?a("promise"):Promise);var k=this;return new c(function(a,c){i.call(k,b,g,function(b,d){b?c(b):a(d)})})}var l,m,n=new f(this);if(n.addPlugins(g.plugins),g.pluginManager=n,l=new d.Parse(g),g.rootFileInfo)m=g.rootFileInfo;else{var o=g.filename||"input",p=o.replace(/[^\/\\]*$/,"");m={filename:o,relativeUrls:l.relativeUrls,rootpath:l.rootpath||"",currentDirectory:p,entryPath:p,rootFilename:o},m.rootpath&&"/"!==m.rootpath.slice(-1)&&(m.rootpath+="/")}var q=new h(l,m);new e(l,q,m).parse(b,function(a,b){return a?j(a):void j(null,b,q,g)},g)};return i}},{"./contexts":10,"./parser/parser":36,"./plugin-manager":37,promise:void 0}],34:[function(a,b){b.exports=function(a,b){function c(b){var c=h-q;512>c&&!b||!c||(p.push(a.slice(q,h+1)),q=h+1)}var d,e,f,g,h,i,j,k,l,m=a.length,n=0,o=0,p=[],q=0;for(h=0;m>h;h++)if(j=a.charCodeAt(h),!(j>=97&&122>=j||34>j))switch(j){case 40:o++,e=h;continue;case 41:if(--o<0)return b("missing opening `(`",h);continue;case 59:o||c();continue;case 123:n++,d=h;continue;case 125:if(--n<0)return b("missing opening `{`",h);n||o||c();continue;case 92:if(m-1>h){h++;continue}return b("unescaped `\\`",h);case 34:case 39:case 96:for(l=0,i=h,h+=1;m>h;h++)if(k=a.charCodeAt(h),!(k>96)){if(k==j){l=1;break}if(92==k){if(h==m-1)return b("unescaped `\\`",h);h++}}if(l)continue;return b("unmatched `"+String.fromCharCode(j)+"`",i);case 47:if(o||h==m-1)continue;if(k=a.charCodeAt(h+1),47==k)for(h+=2;m>h&&(k=a.charCodeAt(h),!(13>=k)||10!=k&&13!=k);h++);else if(42==k){for(f=i=h,h+=2;m-1>h&&(k=a.charCodeAt(h),125==k&&(g=h),42!=k||47!=a.charCodeAt(h+1));h++);if(h==m-1)return b("missing closing `*/`",i);h++}continue;case 42:if(m-1>h&&47==a.charCodeAt(h+1))return b("unmatched `/*`",h);continue}return 0!==n?f>d&&g>f?b("missing closing `}` or `*/`",d):b("missing closing `}`",d):0!==o?b("missing closing `)`",e):(c(!0),p)}},{}],35:[function(a,b){var c=a("./chunker");b.exports=function(){var a,b,d,e,f,g,h,i=[],j={};j.save=function(){h=j.i,i.push({current:g,i:j.i,j:b})},j.restore=function(a){(j.i>d||j.i===d&&a&&!e)&&(d=j.i,e=a);var c=i.pop();g=c.current,h=j.i=c.i,b=c.j},j.forget=function(){i.pop()},j.isWhitespace=function(b){var c=j.i+(b||0),d=a.charCodeAt(c);return d===k||d===n||d===l||d===m},j.$re=function(a){j.i>h&&(g=g.slice(j.i-h),h=j.i);var b=a.exec(g);return b?(s(b[0].length),"string"==typeof b?b:1===b.length?b[0]:b):null},j.$char=function(b){return a.charAt(j.i)!==b?null:(s(1),b)},j.$str=function(b){for(var c=b.length,d=0;c>d;d++)if(a.charAt(j.i+d)!==b.charAt(d))return null;return s(c),b},j.$quoted=function(){var b=a.charAt(j.i);if("'"===b||'"'===b){for(var c=a.length,d=j.i,e=1;c>e+d;e++){var f=a.charAt(e+d);switch(f){case"\\":e++;continue;case"\r":case"\n":break;case b:var g=a.substr(d,e+1);return s(e+1),g}}return null}};var k=32,l=9,m=10,n=13,o=43,p=44,q=47,r=57;j.autoCommentAbsorb=!0,j.commentStore=[],j.finished=!1;var s=function(c){for(var d,e,i,o=j.i,p=b,r=j.i-h,t=j.i+g.length-r,u=j.i+=c,v=a;t>j.i;j.i++){if(d=v.charCodeAt(j.i),j.autoCommentAbsorb&&d===q){if(e=v.charAt(j.i+1),"/"===e){i={index:j.i,isLineComment:!0};var w=v.indexOf("\n",j.i+2);0>w&&(w=t),j.i=w,i.text=v.substr(i.i,j.i-i.i),j.commentStore.push(i);continue}if("*"===e){var x=v.indexOf("*/",j.i+2);if(x>=0){i={index:j.i,text:v.substr(j.i,x+2-j.i),isLineComment:!1},j.i+=i.text.length-1,j.commentStore.push(i);continue}}break}if(d!==k&&d!==m&&d!==l&&d!==n)break}if(g=g.slice(c+j.i-u+r),h=j.i,!g.length){if(f.length-1>b)return g=f[++b],s(0),!0;j.finished=!0}return o!==j.i||p!==b};return j.peek=function(b){if("string"==typeof b){for(var c=0;b.length>c;c++)if(a.charAt(j.i+c)!==b.charAt(c))return!1;return!0}return b.test(g)},j.peekChar=function(b){return a.charAt(j.i)===b},j.currentChar=function(){return a.charAt(j.i)},j.getInput=function(){return a},j.peekNotNumeric=function(){var b=a.charCodeAt(j.i);return b>r||o>b||b===q||b===p},j.start=function(e,i,k){a=e,j.i=b=h=d=0,f=i?c(e,k):[e],g=f[0],s(0)},j.end=function(){var b,c=j.i>=a.length;return d>j.i&&(b=e,j.i=d),{isFinished:c,furthest:j.i,furthestPossibleErrorMessage:b,furthestReachedEnd:j.i>=a.length-1,furthestChar:a[j.i]}},j}},{"./chunker":34}],36:[function(a,b){var c=a("../less-error"),d=a("../tree"),e=a("../visitors"),f=a("./parser-input"),g=a("../utils"),h=function i(a,b,h){function j(a,b){var c="[object Function]"===Object.prototype.toString.call(a)?a.call(n):o.$re(a);return c?c:void l(b||("string"==typeof a?"expected '"+a+"' got '"+o.currentChar()+"'":"unexpected token"))}function k(a,b){return o.$char(a)?a:void l(b||"expected '"+a+"' got '"+o.currentChar()+"'")}function l(a,d){throw new c({index:o.i,filename:h.filename,type:d||"Syntax",message:a},b)}function m(a){var b=h.filename;return{lineNumber:g.getLocation(a,o.getInput()).line+1,fileName:b}}var n,o=f();return{parse:function(f,g,j){var k,l,m,n,p=null,q="";if(l=j&&j.globalVars?i.serializeVars(j.globalVars)+"\n":"",m=j&&j.modifyVars?"\n"+i.serializeVars(j.modifyVars):"",a.pluginManager)for(var r=a.pluginManager.getPreProcessors(),s=0;r.length>s;s++)f=r[s].process(f,{context:a,imports:b,fileInfo:h});(l||j&&j.banner)&&(q=(j&&j.banner?j.banner:"")+l,n=b.contentsIgnoredChars,n[h.filename]=n[h.filename]||0,n[h.filename]+=q.length),f=f.replace(/\r\n?/g,"\n"),f=q+f.replace(/^\uFEFF/,"")+m,b.contents[h.filename]=f;try{o.start(f,a.chunkInput,function(a,d){throw new c({index:d,type:"Parse",message:a,filename:h.filename},b)}),k=new d.Ruleset(null,this.parsers.primary()),k.root=!0,k.firstRoot=!0}catch(t){return g(new c(t,b,h.filename))}var u=o.end();if(!u.isFinished){var v=u.furthestPossibleErrorMessage;v||(v="Unrecognised input","}"===u.furthestChar?v+=". Possibly missing opening '{'":")"===u.furthestChar?v+=". Possibly missing opening '('":u.furthestReachedEnd&&(v+=". Possibly missing something")),p=new c({type:"Parse",message:v,index:u.furthest,filename:h.filename},b)}var w=function(a){return a=p||a||b.error,a?(a instanceof c||(a=new c(a,b,h.filename)),g(a)):g(null,k)};return a.processImports===!1?w():void new e.ImportVisitor(b,w).run(k)},parsers:n={primary:function(){for(var a,b=this.mixin,c=[];;){for(;;){if(a=this.comment(),!a)break;c.push(a)}if(o.finished)break;if(o.peek("}"))break;if(a=this.extendRule())c=c.concat(a);else if(a=b.definition()||this.rule()||this.ruleset()||b.call()||this.rulesetCall()||this.directive())c.push(a);else{for(var d=!1;o.$char(";");)d=!0;if(!d)break}}return c},comment:function(){if(o.commentStore.length){var a=o.commentStore.shift();return new d.Comment(a.text,a.isLineComment,a.index,h)}},entities:{quoted:function(){var a,b=o.i,c=!1;return o.save(),o.$char("~")&&(c=!0),(a=o.$quoted())?(o.forget(),new d.Quoted(a.charAt(0),a.substr(1,a.length-2),c,b,h)):void o.restore()},keyword:function(){var a=o.$char("%")||o.$re(/^[_A-Za-z-][_A-Za-z0-9-]*/);return a?d.Color.fromKeyword(a)||new d.Keyword(a):void 0},call:function(){var a,b,c,e,f=o.i;if(!o.peek(/^url\(/i))return o.save(),(a=o.$re(/^([\w-]+|%|progid:[\w\.]+)\(/))?(a=a[1],b=a.toLowerCase(),"alpha"===b&&(e=n.alpha())?(o.forget(),e):(c=this.arguments(),o.$char(")")?(o.forget(),new d.Call(a,c,f,h)):void o.restore("Could not parse call arguments or missing ')'"))):void o.forget()},arguments:function(){for(var a,b=[];;){if(a=this.assignment()||n.expression(),!a)break;if(b.push(a),!o.$char(","))break}return b},literal:function(){return this.dimension()||this.color()||this.quoted()||this.unicodeDescriptor()},assignment:function(){var a,b;return o.save(),(a=o.$re(/^\w+(?=\s?=)/i))&&o.$char("=")&&(b=n.entity())?(o.forget(),new d.Assignment(a,b)):void o.restore()},url:function(){var a,b=o.i;return o.autoCommentAbsorb=!1,o.$str("url(")?(a=this.quoted()||this.variable()||o.$re(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/)||"",o.autoCommentAbsorb=!0,k(")"),new d.URL(null!=a.value||a instanceof d.Variable?a:new d.Anonymous(a),b,h)):void(o.autoCommentAbsorb=!0)},variable:function(){var a,b=o.i;return"@"===o.currentChar()&&(a=o.$re(/^@@?[\w-]+/))?new d.Variable(a,b,h):void 0},variableCurly:function(){var a,b=o.i;return"@"===o.currentChar()&&(a=o.$re(/^@\{([\w-]+)\}/))?new d.Variable("@"+a[1],b,h):void 0},color:function(){var a;if("#"===o.currentChar()&&(a=o.$re(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/))){var b=a.input.match(/^#([\w]+).*/);return b=b[1],b.match(/^[A-Fa-f0-9]+$/)||l("Invalid HEX color code"),new d.Color(a[1])}},dimension:function(){if(!o.peekNotNumeric()){var a=o.$re(/^([+-]?\d*\.?\d+)(%|[a-z]+)?/i);return a?new d.Dimension(a[1],a[2]):void 0}},unicodeDescriptor:function(){var a;return a=o.$re(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/),a?new d.UnicodeDescriptor(a[0]):void 0},javascript:function(){var a,b=o.i;o.save();var c=o.$char("~"),e=o.$char("`");return e?(a=o.$re(/^[^`]*`/))?(o.forget(),new d.JavaScript(a.substr(0,a.length-1),Boolean(c),b,h)):void o.restore("invalid javascript definition"):void o.restore()}},variable:function(){var a;return"@"===o.currentChar()&&(a=o.$re(/^(@[\w-]+)\s*:/))?a[1]:void 0},rulesetCall:function(){var a;return"@"===o.currentChar()&&(a=o.$re(/^(@[\w-]+)\s*\(\s*\)\s*;/))?new d.RulesetCall(a[1]):void 0},extend:function(a){var b,c,e,f,g,h=o.i;if(o.$str(a?"&:extend(":":extend(")){do{for(e=null,b=null;!(e=o.$re(/^(all)(?=\s*(\)|,))/))&&(c=this.element());)b?b.push(c):b=[c];e=e&&e[1],b||l("Missing target selector for :extend()."),g=new d.Extend(new d.Selector(b),e,h),f?f.push(g):f=[g]}while(o.$char(","));return j(/^\)/),a&&j(/^;/),f}},extendRule:function(){return this.extend(!0)},mixin:{call:function(){var a,b,c,e,f,g,i=o.currentChar(),j=!1,l=o.i;if("."===i||"#"===i){for(o.save();;){if(a=o.i,e=o.$re(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/),!e)break;c=new d.Element(f,e,a,h),b?b.push(c):b=[c],f=o.$char(">")}return b&&(o.$char("(")&&(g=this.args(!0).args,k(")")),n.important()&&(j=!0),n.end())?(o.forget(),new d.mixin.Call(b,g,l,h,j)):void o.restore()}},args:function(a){var b,c,e,f,g,h,i=n.entities,j={args:null,variadic:!1},k=[],m=[],p=[];for(o.save();;){if(a)h=n.detachedRuleset()||n.expression();else{if(o.commentStore.length=0,o.$str("...")){j.variadic=!0,o.$char(";")&&!b&&(b=!0),(b?m:p).push({variadic:!0});break}h=i.variable()||i.literal()||i.keyword()}if(!h)break;f=null,h.throwAwayComments&&h.throwAwayComments(),g=h;var q=null;if(a?h.value&&1==h.value.length&&(q=h.value[0]):q=h,q&&q instanceof d.Variable)if(o.$char(":")){if(k.length>0&&(b&&l("Cannot mix ; and , as delimiter types"),c=!0),g=n.detachedRuleset()||n.expression(),!g){if(!a)return o.restore(),j.args=[],j;l("could not understand value for named argument")}f=e=q.name}else{if(!a&&o.$str("...")){j.variadic=!0,o.$char(";")&&!b&&(b=!0),(b?m:p).push({name:h.name,variadic:!0});break}a||(e=f=q.name,g=null)}g&&k.push(g),p.push({name:f,value:g}),o.$char(",")||(o.$char(";")||b)&&(c&&l("Cannot mix ; and , as delimiter types"),b=!0,k.length>1&&(g=new d.Value(k)),m.push({name:e,value:g}),e=null,k=[],c=!1)}return o.forget(),j.args=b?m:p,j},definition:function(){var a,b,c,e,f=[],g=!1;if(!("."!==o.currentChar()&&"#"!==o.currentChar()||o.peek(/^[^{]*\}/)))if(o.save(),b=o.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){a=b[1];var h=this.args(!1);if(f=h.args,g=h.variadic,!o.$char(")"))return void o.restore("Missing closing ')'");if(o.commentStore.length=0,o.$str("when")&&(e=j(n.conditions,"expected condition")),c=n.block())return o.forget(),new d.mixin.Definition(a,f,c,e,g);o.restore()}else o.forget()}},entity:function(){var a=this.entities;return this.comment()||a.literal()||a.variable()||a.url()||a.call()||a.keyword()||a.javascript()},end:function(){return o.$char(";")||o.peek("}")},alpha:function(){var a;if(o.$re(/^opacity=/i))return a=o.$re(/^\d+/),a||(a=j(this.entities.variable,"Could not parse alpha")),k(")"),new d.Alpha(a)},element:function(){var a,b,c,e=o.i;return b=this.combinator(),a=o.$re(/^(?:\d+\.\d+|\d+)%/)||o.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||o.$char("*")||o.$char("&")||this.attribute()||o.$re(/^\([^&()@]+\)/)||o.$re(/^[\.#:](?=@)/)||this.entities.variableCurly(),a||(o.save(),o.$char("(")?(c=this.selector())&&o.$char(")")?(a=new d.Paren(c),o.forget()):o.restore("Missing closing ')'"):o.forget()),a?new d.Element(b,a,e,h):void 0},combinator:function(){var a=o.currentChar();if("/"===a){o.save();var b=o.$re(/^\/[a-z]+\//i);if(b)return o.forget(),new d.Combinator(b);o.restore()}if(">"===a||"+"===a||"~"===a||"|"===a||"^"===a){for(o.i++,"^"===a&&"^"===o.currentChar()&&(a="^^",o.i++);o.isWhitespace();)o.i++;return new d.Combinator(a)}return new d.Combinator(o.isWhitespace(-1)?" ":null)},lessSelector:function(){return this.selector(!0)},selector:function(a){for(var b,c,e,f,g,i,k,m=o.i;(a&&(c=this.extend())||a&&(i=o.$str("when"))||(f=this.element()))&&(i?k=j(this.conditions,"expected condition"):k?l("CSS guard can only be used at the end of selector"):c?g=g?g.concat(c):c:(g&&l("Extend can only be used at the end of selector"),e=o.currentChar(),b?b.push(f):b=[f],f=null),"{"!==e&&"}"!==e&&";"!==e&&","!==e&&")"!==e););return b?new d.Selector(b,g,k,m,h):void(g&&l("Extend must be used to extend a selector, it cannot be used on its own"))},attribute:function(){if(o.$char("[")){var a,b,c,e=this.entities;return(a=e.variableCurly())||(a=j(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),c=o.$re(/^[|~*$^]?=/),c&&(b=e.quoted()||o.$re(/^[0-9]+%/)||o.$re(/^[\w-]+/)||e.variableCurly()),k("]"),new d.Attribute(a,c,b)}},block:function(){var a;return o.$char("{")&&(a=this.primary())&&o.$char("}")?a:void 0},blockRuleset:function(){var a=this.block();return a&&(a=new d.Ruleset(null,a)),a},detachedRuleset:function(){var a=this.blockRuleset();return a?new d.DetachedRuleset(a):void 0},ruleset:function(){var b,c,e,f;for(o.save(),a.dumpLineNumbers&&(f=m(o.i));;){if(c=this.lessSelector(),!c)break;if(b?b.push(c):b=[c],o.commentStore.length=0,c.condition&&b.length>1&&l("Guards are only currently allowed on a single selector."),!o.$char(","))break;c.condition&&l("Guards are only currently allowed on a single selector."),o.commentStore.length=0}if(b&&(e=this.block())){o.forget();var g=new d.Ruleset(b,e,a.strictImports);return a.dumpLineNumbers&&(g.debugInfo=f),g}o.restore()},rule:function(b){var c,e,f,g,i,j=o.i,k=o.currentChar();if("."!==k&&"#"!==k&&"&"!==k&&":"!==k)if(o.save(),c=this.variable()||this.ruleProperty()){if(i="string"==typeof c,i&&(e=this.detachedRuleset()),o.commentStore.length=0,!e){g=!i&&c.length>1&&c.pop().value;var l=!b&&(a.compress||i);if(l&&(e=this.value()),!e&&(e=this.anonymousValue()))return o.forget(),new d.Rule(c,e,!1,g,j,h);l||e||(e=this.value()),f=this.important()}if(e&&this.end())return o.forget(),new d.Rule(c,e,f,g,j,h);if(o.restore(),e&&!b)return this.rule(!0)}else o.forget()},anonymousValue:function(){var a=o.$re(/^([^@+\/'"*`(;{}-]*);/);return a?new d.Anonymous(a[1]):void 0},"import":function(){var a,b,c=o.i,e=o.$re(/^@import?\s+/);if(e){var f=(e?this.importOptions():null)||{};if(a=this.entities.quoted()||this.entities.url())return b=this.mediaFeatures(),o.$char(";")||(o.i=c,l("missing semi-colon or unrecognised media features on import")),b=b&&new d.Value(b),new d.Import(a,b,f,c,h);o.i=c,l("malformed import statement")}},importOptions:function(){var a,b,c,d={};if(!o.$char("("))return null;do if(a=this.importOption()){switch(b=a,c=!0,b){case"css":b="less",c=!1;break;case"once":b="multiple",c=!1}if(d[b]=c,!o.$char(","))break}while(a);return k(")"),d},importOption:function(){var a=o.$re(/^(less|css|multiple|once|inline|reference|optional)/);return a?a[1]:void 0},mediaFeature:function(){var a,b,c=this.entities,e=[];o.save();do if(a=c.keyword()||c.variable())e.push(a);else if(o.$char("(")){if(b=this.property(),a=this.value(),!o.$char(")"))return o.restore("Missing closing ')'"),null;if(b&&a)e.push(new d.Paren(new d.Rule(b,a,null,null,o.i,h,!0)));else{if(!a)return o.restore("badly formed media feature definition"),null;e.push(new d.Paren(a))}}while(a);return o.forget(),e.length>0?new d.Expression(e):void 0},mediaFeatures:function(){var a,b=this.entities,c=[];do if(a=this.mediaFeature()){if(c.push(a),!o.$char(","))break}else if(a=b.variable(),a&&(c.push(a),!o.$char(",")))break;while(a);return c.length>0?c:null},media:function(){var b,c,e,f;return a.dumpLineNumbers&&(f=m(o.i)),o.save(),o.$str("@media")?(b=this.mediaFeatures(),(c=this.block())?(o.forget(),e=new d.Media(c,b,o.i,h),a.dumpLineNumbers&&(e.debugInfo=f),e):void o.restore("media definitions require block statements after any features")):void o.restore()},plugin:function(){var a,b=o.i,c=o.$re(/^@plugin?\s+/);if(c){var e={plugin:!0};if(a=this.entities.quoted()||this.entities.url())return o.$char(";")||(o.i=b,l("missing semi-colon on plugin")),new d.Import(a,null,e,b,h);o.i=b,l("malformed plugin statement")}},directive:function(){var b,c,e,f,g,i,j,k=o.i,n=!0,p=!0;if("@"===o.currentChar()){if(c=this["import"]()||this.plugin()||this.media())return c;if(o.save(),b=o.$re(/^@[a-z-]+/)){switch(f=b,"-"==b.charAt(1)&&b.indexOf("-",2)>0&&(f="@"+b.slice(b.indexOf("-",2)+1)),f){case"@counter-style":g=!0,n=!0;break;case"@charset":g=!0,n=!1;break;case"@namespace":i=!0,n=!1;break;case"@keyframes":g=!0;break;case"@host":case"@page":j=!0;break;case"@document":case"@supports":j=!0,p=!1}return o.commentStore.length=0,g?(c=this.entity(),c||l("expected "+b+" identifier")):i?(c=this.expression(),c||l("expected "+b+" expression")):j&&(c=(o.$re(/^[^{;]+/)||"").trim(),c&&(c=new d.Anonymous(c))),n&&(e=this.blockRuleset()),e||!n&&c&&o.$char(";")?(o.forget(),new d.Directive(b,c,e,k,h,a.dumpLineNumbers?m(k):null,!1,p)):void o.restore("directive options not recognised")}}},value:function(){var a,b=[];do if(a=this.expression(),a&&(b.push(a),!o.$char(",")))break;while(a);return b.length>0?new d.Value(b):void 0},important:function(){return"!"===o.currentChar()?o.$re(/^! *important/):void 0},sub:function(){var a,b;return o.save(),o.$char("(")?(a=this.addition(),a&&o.$char(")")?(o.forget(),b=new d.Expression([a]),b.parens=!0,b):void o.restore("Expected ')'")):void o.restore()},multiplication:function(){var a,b,c,e,f;if(a=this.operand()){for(f=o.isWhitespace(-1);;){if(o.peek(/^\/[*\/]/))break;if(o.save(),c=o.$char("/")||o.$char("*"),!c){o.forget();break}if(b=this.operand(),!b){o.restore();break}o.forget(),a.parensInOp=!0,b.parensInOp=!0,e=new d.Operation(c,[e||a,b],f),f=o.isWhitespace(-1)}return e||a}},addition:function(){var a,b,c,e,f;if(a=this.multiplication()){for(f=o.isWhitespace(-1);;){if(c=o.$re(/^[-+]\s+/)||!f&&(o.$char("+")||o.$char("-")),!c)break;if(b=this.multiplication(),!b)break;a.parensInOp=!0,b.parensInOp=!0,e=new d.Operation(c,[e||a,b],f),f=o.isWhitespace(-1)}return e||a}},conditions:function(){var a,b,c,e=o.i;if(a=this.condition()){for(;;){if(!o.peek(/^,\s*(not\s*)?\(/)||!o.$char(","))break;if(b=this.condition(),!b)break;c=new d.Condition("or",c||a,b,e)}return c||a}},condition:function(){var a,b,c,e,f=this.entities,g=o.i,h=!1;return o.$str("not")&&(h=!0),k("("),a=this.addition()||f.keyword()||f.quoted(),a?(o.$char(">")?e=o.$char("=")?">=":">":o.$char("<")?e=o.$char("=")?"<=":"<":o.$char("=")&&(e=o.$char(">")?"=>":o.$char("<")?"=<":"="),e?(b=this.addition()||f.keyword()||f.quoted(),b?c=new d.Condition(e,a,b,g,h):l("expected expression")):c=new d.Condition("=",a,new d.Keyword("true"),g,h),k(")"),o.$str("and")?new d.Condition("and",c,this.condition()):c):void 0},operand:function(){var a,b=this.entities;o.peek(/^-[@\(]/)&&(a=o.$char("-"));var c=this.sub()||b.dimension()||b.color()||b.variable()||b.call();return a&&(c.parensInOp=!0,c=new d.Negative(c)),c},expression:function(){var a,b,c=[];do a=this.comment(),a?c.push(a):(a=this.addition()||this.entity(),a&&(c.push(a),o.peek(/^\/[\/*]/)||(b=o.$char("/"),b&&c.push(new d.Anonymous(b)))));while(a);return c.length>0?new d.Expression(c):void 0},property:function(){var a=o.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);return a?a[1]:void 0},ruleProperty:function(){function a(a){var b=o.i,c=o.$re(a);return c?(f.push(b),e.push(c[1])):void 0}var b,c,e=[],f=[];o.save();var g=o.$re(/^([_a-zA-Z0-9-]+)\s*:/);if(g)return e=[new d.Keyword(g[1])],o.forget(),e;for(a(/^(\*?)/);;)if(!a(/^((?:[\w-]+)|(?:@\{[\w-]+\}))/))break;if(e.length>1&&a(/^((?:\+_|\+)?)\s*:/)){for(o.forget(),""===e[0]&&(e.shift(),f.shift()),c=0;e.length>c;c++)b=e[c],e[c]="@"!==b.charAt(0)?new d.Keyword(b):new d.Variable("@"+b.slice(2,-1),f[c],h);return e}o.restore()}}}};h.serializeVars=function(a){var b="";for(var c in a)if(Object.hasOwnProperty.call(a,c)){var d=a[c];b+=("@"===c[0]?"":"@")+c+": "+d+(";"===String(d).slice(-1)?"":";")}return b},b.exports=h},{"../less-error":30,"../tree":60,"../utils":81,"../visitors":85,"./parser-input":35}],37:[function(a,b){var c=function(a){this.less=a,this.visitors=[],this.preProcessors=[],this.postProcessors=[],this.installedPlugins=[],this.fileManagers=[]};c.prototype.addPlugins=function(a){if(a)for(var b=0;a.length>b;b++)this.addPlugin(a[b])},c.prototype.addPlugin=function(a){this.installedPlugins.push(a),a.install(this.less,this)},c.prototype.addVisitor=function(a){this.visitors.push(a)},c.prototype.addPreProcessor=function(a,b){var c;for(c=0;this.preProcessors.length>c&&!(this.preProcessors[c].priority>=b);c++);this.preProcessors.splice(c,0,{preProcessor:a,priority:b})},c.prototype.addPostProcessor=function(a,b){var c;for(c=0;this.postProcessors.length>c&&!(this.postProcessors[c].priority>=b);c++);this.postProcessors.splice(c,0,{postProcessor:a,priority:b})},c.prototype.addFileManager=function(a){this.fileManagers.push(a)},c.prototype.getPreProcessors=function(){for(var a=[],b=0;this.preProcessors.length>b;b++)a.push(this.preProcessors[b].preProcessor);return a},c.prototype.getPostProcessors=function(){for(var a=[],b=0;this.postProcessors.length>b;b++)a.push(this.postProcessors[b].postProcessor);return a},c.prototype.getVisitors=function(){return this.visitors},c.prototype.getFileManagers=function(){return this.fileManagers},b.exports=c},{}],38:[function(a,b){var c=a("../less-error"),d=a("../tree"),e=b.exports=function(a,b){this.fileInfo=b};e.prototype.eval=function(a,b){var e,f,g={};f={add:function(a,b){g[a]=b},addMultiple:function(a){Object.keys(a).forEach(function(b){g[b]=a[b]})}};try{e=new Function("functions","tree","fileInfo",a),e(f,d,this.fileInfo)}catch(h){b(new c({message:"Plugin evaluation error: '"+h.name+": "+h.message.replace(/["]/g,"'")+"'",filename:this.fileInfo.filename}),null)}b(null,{functions:g})}},{"../less-error":30,"../tree":60}],39:[function(a,b){var c;b.exports=function(b,d){var e=function(b,f,g){if("function"==typeof f&&(g=f,f={}),!g){c||(c="undefined"==typeof Promise?a("promise"):Promise);var h=this;return new c(function(a,c){e.call(h,b,f,function(b,d){b?c(b):a(d)})})}this.parse(b,f,function(a,b,c,e){if(a)return g(a);var f;try{var h=new d(b,c);f=h.toCSS(e)}catch(a){return g(a)}g(null,f)})};return e}},{promise:void 0}],40:[function(a,b){b.exports=function(a,b){var c=function(a){this.options=a};return c.prototype.toCSS=function(b,c,d){var e=new a({contentsIgnoredCharsMap:d.contentsIgnoredChars,rootNode:b,contentsMap:d.contents,sourceMapFilename:this.options.sourceMapFilename,sourceMapURL:this.options.sourceMapURL,outputFilename:this.options.sourceMapOutputFilename,sourceMapBasepath:this.options.sourceMapBasepath,sourceMapRootpath:this.options.sourceMapRootpath,outputSourceFiles:this.options.outputSourceFiles,sourceMapGenerator:this.options.sourceMapGenerator,sourceMapFileInline:this.options.sourceMapFileInline}),f=e.toCSS(c);return this.sourceMap=e.sourceMap,this.sourceMapURL=e.sourceMapURL,this.options.sourceMapInputFilename&&(this.sourceMapInputFilename=e.normalizeFilename(this.options.sourceMapInputFilename)),f+this.getCSSAppendage()},c.prototype.getCSSAppendage=function(){var a=this.sourceMapURL;if(this.options.sourceMapFileInline){if(void 0===this.sourceMap)return"";a="data:application/json;base64,"+b.encodeBase64(this.sourceMap)}return a?"/*# sourceMappingURL="+a+" */":""},c.prototype.getExternalSourceMap=function(){return this.sourceMap},c.prototype.setExternalSourceMap=function(a){this.sourceMap=a},c.prototype.isInline=function(){return this.options.sourceMapFileInline},c.prototype.getSourceMapURL=function(){return this.sourceMapURL},c.prototype.getOutputFilename=function(){return this.options.sourceMapOutputFilename},c.prototype.getInputFilename=function(){return this.sourceMapInputFilename},c}},{}],41:[function(a,b){b.exports=function(a){var b=function(b){this._css=[],this._rootNode=b.rootNode,this._contentsMap=b.contentsMap,this._contentsIgnoredCharsMap=b.contentsIgnoredCharsMap,b.sourceMapFilename&&(this._sourceMapFilename=b.sourceMapFilename.replace(/\\/g,"/")),this._outputFilename=b.outputFilename,this.sourceMapURL=b.sourceMapURL,b.sourceMapBasepath&&(this._sourceMapBasepath=b.sourceMapBasepath.replace(/\\/g,"/")), -b.sourceMapRootpath?(this._sourceMapRootpath=b.sourceMapRootpath.replace(/\\/g,"/"),"/"!==this._sourceMapRootpath.charAt(this._sourceMapRootpath.length-1)&&(this._sourceMapRootpath+="/")):this._sourceMapRootpath="",this._outputSourceFiles=b.outputSourceFiles,this._sourceMapGeneratorConstructor=a.getSourceMapGenerator(),this._lineNumber=0,this._column=0};return b.prototype.normalizeFilename=function(a){return a=a.replace(/\\/g,"/"),this._sourceMapBasepath&&0===a.indexOf(this._sourceMapBasepath)&&(a=a.substring(this._sourceMapBasepath.length),("\\"===a.charAt(0)||"/"===a.charAt(0))&&(a=a.substring(1))),(this._sourceMapRootpath||"")+a},b.prototype.add=function(a,b,c,d){if(a){var e,f,g,h,i;if(b){var j=this._contentsMap[b.filename];this._contentsIgnoredCharsMap[b.filename]&&(c-=this._contentsIgnoredCharsMap[b.filename],0>c&&(c=0),j=j.slice(this._contentsIgnoredCharsMap[b.filename])),j=j.substring(0,c),f=j.split("\n"),h=f[f.length-1]}if(e=a.split("\n"),g=e[e.length-1],b)if(d)for(i=0;e.length>i;i++)this._sourceMapGenerator.addMapping({generated:{line:this._lineNumber+i+1,column:0===i?this._column:0},original:{line:f.length+i,column:0===i?h.length:0},source:this.normalizeFilename(b.filename)});else this._sourceMapGenerator.addMapping({generated:{line:this._lineNumber+1,column:this._column},original:{line:f.length,column:h.length},source:this.normalizeFilename(b.filename)});1===e.length?this._column+=g.length:(this._lineNumber+=e.length-1,this._column=g.length),this._css.push(a)}},b.prototype.isEmpty=function(){return 0===this._css.length},b.prototype.toCSS=function(a){if(this._sourceMapGenerator=new this._sourceMapGeneratorConstructor({file:this._outputFilename,sourceRoot:null}),this._outputSourceFiles)for(var b in this._contentsMap)if(this._contentsMap.hasOwnProperty(b)){var c=this._contentsMap[b];this._contentsIgnoredCharsMap[b]&&(c=c.slice(this._contentsIgnoredCharsMap[b])),this._sourceMapGenerator.setSourceContent(this.normalizeFilename(b),c)}if(this._rootNode.genCSS(a,this),this._css.length>0){var d,e=JSON.stringify(this._sourceMapGenerator.toJSON());this.sourceMapURL?d=this.sourceMapURL:this._sourceMapFilename&&(d=this._sourceMapFilename),this.sourceMapURL=d,this.sourceMap=e}return this._css.join("")},b}},{}],42:[function(a,b){var c=a("./contexts"),d=a("./visitors"),e=a("./tree");b.exports=function(a,b){b=b||{};var f,g=b.variables,h=new c.Eval(b);"object"!=typeof g||Array.isArray(g)||(g=Object.keys(g).map(function(a){var b=g[a];return b instanceof e.Value||(b instanceof e.Expression||(b=new e.Expression([b])),b=new e.Value([b])),new e.Rule("@"+a,b,!1,null,0)}),h.frames=[new e.Ruleset(null,g)]);var i,j=[],k=[new d.JoinSelectorVisitor,new d.ExtendVisitor,new d.ToCSSVisitor({compress:Boolean(b.compress)})];if(b.pluginManager){var l=b.pluginManager.getVisitors();for(i=0;l.length>i;i++){var m=l[i];m.isPreEvalVisitor?j.push(m):m.isPreVisitor?k.splice(0,0,m):k.push(m)}}for(i=0;j.length>i;i++)j[i].run(a);for(f=a.eval(h),i=0;k.length>i;i++)k[i].run(f);return f}},{"./contexts":10,"./tree":60,"./visitors":85}],43:[function(a,b){var c=a("./node"),d=function(a){this.value=a};d.prototype=new c,d.prototype.type="Alpha",d.prototype.accept=function(a){this.value=a.visit(this.value)},d.prototype.eval=function(a){return this.value.eval?new d(this.value.eval(a)):this},d.prototype.genCSS=function(a,b){b.add("alpha(opacity="),this.value.genCSS?this.value.genCSS(a,b):b.add(this.value),b.add(")")},b.exports=d},{"./node":68}],44:[function(a,b){var c=a("./node"),d=function(a,b,c,d,e){this.value=a,this.index=b,this.mapLines=d,this.currentFileInfo=c,this.rulesetLike="undefined"==typeof e?!1:e};d.prototype=new c,d.prototype.type="Anonymous",d.prototype.eval=function(){return new d(this.value,this.index,this.currentFileInfo,this.mapLines,this.rulesetLike)},d.prototype.compare=function(a){return a.toCSS&&this.toCSS()===a.toCSS()?0:void 0},d.prototype.isRulesetLike=function(){return this.rulesetLike},d.prototype.genCSS=function(a,b){b.add(this.value,this.currentFileInfo,this.index,this.mapLines)},b.exports=d},{"./node":68}],45:[function(a,b){var c=a("./node"),d=function(a,b){this.key=a,this.value=b};d.prototype=new c,d.prototype.type="Assignment",d.prototype.accept=function(a){this.value=a.visit(this.value)},d.prototype.eval=function(a){return this.value.eval?new d(this.key,this.value.eval(a)):this},d.prototype.genCSS=function(a,b){b.add(this.key+"="),this.value.genCSS?this.value.genCSS(a,b):b.add(this.value)},b.exports=d},{"./node":68}],46:[function(a,b){var c=a("./node"),d=function(a,b,c){this.key=a,this.op=b,this.value=c};d.prototype=new c,d.prototype.type="Attribute",d.prototype.eval=function(a){return new d(this.key.eval?this.key.eval(a):this.key,this.op,this.value&&this.value.eval?this.value.eval(a):this.value)},d.prototype.genCSS=function(a,b){b.add(this.toCSS(a))},d.prototype.toCSS=function(a){var b=this.key.toCSS?this.key.toCSS(a):this.key;return this.op&&(b+=this.op,b+=this.value.toCSS?this.value.toCSS(a):this.value),"["+b+"]"},b.exports=d},{"./node":68}],47:[function(a,b){var c=a("./node"),d=a("../functions/function-caller"),e=function(a,b,c,d){this.name=a,this.args=b,this.index=c,this.currentFileInfo=d};e.prototype=new c,e.prototype.type="Call",e.prototype.accept=function(a){this.args&&(this.args=a.visitArray(this.args))},e.prototype.eval=function(a){var b,c=this.args.map(function(b){return b.eval(a)}),f=new d(this.name,a,this.index,this.currentFileInfo);if(f.isValid())try{if(b=f.call(c),null!=b)return b}catch(g){throw{type:g.type||"Runtime",message:"error evaluating function `"+this.name+"`"+(g.message?": "+g.message:""),index:this.index,filename:this.currentFileInfo.filename}}return new e(this.name,c,this.index,this.currentFileInfo)},e.prototype.genCSS=function(a,b){b.add(this.name+"(",this.currentFileInfo,this.index);for(var c=0;this.args.length>c;c++)this.args[c].genCSS(a,b),this.args.length>c+1&&b.add(", ");b.add(")")},b.exports=e},{"../functions/function-caller":20,"./node":68}],48:[function(a,b){function c(a,b){return Math.min(Math.max(a,0),b)}function d(a){return"#"+a.map(function(a){return a=c(Math.round(a),255),(16>a?"0":"")+a.toString(16)}).join("")}var e=a("./node"),f=a("../data/colors"),g=function(a,b){this.rgb=Array.isArray(a)?a:6==a.length?a.match(/.{2}/g).map(function(a){return parseInt(a,16)}):a.split("").map(function(a){return parseInt(a+a,16)}),this.alpha="number"==typeof b?b:1};g.prototype=new e,g.prototype.type="Color",g.prototype.luma=function(){var a=this.rgb[0]/255,b=this.rgb[1]/255,c=this.rgb[2]/255;return a=.03928>=a?a/12.92:Math.pow((a+.055)/1.055,2.4),b=.03928>=b?b/12.92:Math.pow((b+.055)/1.055,2.4),c=.03928>=c?c/12.92:Math.pow((c+.055)/1.055,2.4),.2126*a+.7152*b+.0722*c},g.prototype.genCSS=function(a,b){b.add(this.toCSS(a))},g.prototype.toCSS=function(a,b){var d,e,f=a&&a.compress&&!b;if(this.value)return this.value;if(e=this.fround(a,this.alpha),1>e)return"rgba("+this.rgb.map(function(a){return c(Math.round(a),255)}).concat(c(e,1)).join(","+(f?"":" "))+")";if(d=this.toRGB(),f){var g=d.split("");g[1]===g[2]&&g[3]===g[4]&&g[5]===g[6]&&(d="#"+g[1]+g[3]+g[5])}return d},g.prototype.operate=function(a,b,c){for(var d=[],e=this.alpha*(1-c.alpha)+c.alpha,f=0;3>f;f++)d[f]=this._operate(a,b,this.rgb[f],c.rgb[f]);return new g(d,e)},g.prototype.toRGB=function(){return d(this.rgb)},g.prototype.toHSL=function(){var a,b,c=this.rgb[0]/255,d=this.rgb[1]/255,e=this.rgb[2]/255,f=this.alpha,g=Math.max(c,d,e),h=Math.min(c,d,e),i=(g+h)/2,j=g-h;if(g===h)a=b=0;else{switch(b=i>.5?j/(2-g-h):j/(g+h),g){case c:a=(d-e)/j+(e>d?6:0);break;case d:a=(e-c)/j+2;break;case e:a=(c-d)/j+4}a/=6}return{h:360*a,s:b,l:i,a:f}},g.prototype.toHSV=function(){var a,b,c=this.rgb[0]/255,d=this.rgb[1]/255,e=this.rgb[2]/255,f=this.alpha,g=Math.max(c,d,e),h=Math.min(c,d,e),i=g,j=g-h;if(b=0===g?0:j/g,g===h)a=0;else{switch(g){case c:a=(d-e)/j+(e>d?6:0);break;case d:a=(e-c)/j+2;break;case e:a=(c-d)/j+4}a/=6}return{h:360*a,s:b,v:i,a:f}},g.prototype.toARGB=function(){return d([255*this.alpha].concat(this.rgb))},g.prototype.compare=function(a){return a.rgb&&a.rgb[0]===this.rgb[0]&&a.rgb[1]===this.rgb[1]&&a.rgb[2]===this.rgb[2]&&a.alpha===this.alpha?0:void 0},g.fromKeyword=function(a){var b,c=a.toLowerCase();return f.hasOwnProperty(c)?b=new g(f[c].slice(1)):"transparent"===c&&(b=new g([0,0,0],0)),b?(b.value=a,b):void 0},b.exports=g},{"../data/colors":11,"./node":68}],49:[function(a,b){var c=a("./node"),d=function(a){" "===a?(this.value=" ",this.emptyOrWhitespace=!0):(this.value=a?a.trim():"",this.emptyOrWhitespace=""===this.value)};d.prototype=new c,d.prototype.type="Combinator";var e={"":!0," ":!0,"|":!0};d.prototype.genCSS=function(a,b){var c=a.compress||e[this.value]?"":" ";b.add(c+this.value+c)},b.exports=d},{"./node":68}],50:[function(a,b){var c=a("./node"),d=a("./debug-info"),e=function(a,b,c,d){this.value=a,this.isLineComment=b,this.currentFileInfo=d};e.prototype=new c,e.prototype.type="Comment",e.prototype.genCSS=function(a,b){this.debugInfo&&b.add(d(a,this),this.currentFileInfo,this.index),b.add(this.value)},e.prototype.isSilent=function(a){var b=this.currentFileInfo&&this.currentFileInfo.reference&&!this.isReferenced,c=a.compress&&"!"!==this.value[2];return this.isLineComment||b||c},e.prototype.markReferenced=function(){this.isReferenced=!0},b.exports=e},{"./debug-info":52,"./node":68}],51:[function(a,b){var c=a("./node"),d=function(a,b,c,d,e){this.op=a.trim(),this.lvalue=b,this.rvalue=c,this.index=d,this.negate=e};d.prototype=new c,d.prototype.type="Condition",d.prototype.accept=function(a){this.lvalue=a.visit(this.lvalue),this.rvalue=a.visit(this.rvalue)},d.prototype.eval=function(a){var b=function(a,b,d){switch(a){case"and":return b&&d;case"or":return b||d;default:switch(c.compare(b,d)){case-1:return"<"===a||"=<"===a||"<="===a;case 0:return"="===a||">="===a||"=<"===a||"<="===a;case 1:return">"===a||">="===a;default:return!1}}}(this.op,this.lvalue.eval(a),this.rvalue.eval(a));return this.negate?!b:b},b.exports=d},{"./node":68}],52:[function(a,b){var c=function(a,b,d){var e="";if(a.dumpLineNumbers&&!a.compress)switch(a.dumpLineNumbers){case"comments":e=c.asComment(b);break;case"mediaquery":e=c.asMediaQuery(b);break;case"all":e=c.asComment(b)+(d||"")+c.asMediaQuery(b)}return e};c.asComment=function(a){return"/* line "+a.debugInfo.lineNumber+", "+a.debugInfo.fileName+" */\n"},c.asMediaQuery=function(a){var b=a.debugInfo.fileName;return/^[a-z]+:\/\//i.test(b)||(b="file://"+b),"@media -sass-debug-info{filename{font-family:"+b.replace(/([.:\/\\])/g,function(a){return"\\"==a&&(a="/"),"\\"+a})+"}line{font-family:\\00003"+a.debugInfo.lineNumber+"}}\n"},b.exports=c},{}],53:[function(a,b){var c=a("./node"),d=a("../contexts"),e=function(a,b){this.ruleset=a,this.frames=b};e.prototype=new c,e.prototype.type="DetachedRuleset",e.prototype.evalFirst=!0,e.prototype.accept=function(a){this.ruleset=a.visit(this.ruleset)},e.prototype.eval=function(a){var b=this.frames||a.frames.slice(0);return new e(this.ruleset,b)},e.prototype.callEval=function(a){return this.ruleset.eval(this.frames?new d.Eval(a,this.frames.concat(a.frames)):a)},b.exports=e},{"../contexts":10,"./node":68}],54:[function(a,b){var c=a("./node"),d=a("../data/unit-conversions"),e=a("./unit"),f=a("./color"),g=function(a,b){this.value=parseFloat(a),this.unit=b&&b instanceof e?b:new e(b?[b]:void 0)};g.prototype=new c,g.prototype.type="Dimension",g.prototype.accept=function(a){this.unit=a.visit(this.unit)},g.prototype.eval=function(){return this},g.prototype.toColor=function(){return new f([this.value,this.value,this.value])},g.prototype.genCSS=function(a,b){if(a&&a.strictUnits&&!this.unit.isSingular())throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: "+this.unit.toString());var c=this.fround(a,this.value),d=String(c);if(0!==c&&1e-6>c&&c>-1e-6&&(d=c.toFixed(20).replace(/0+$/,"")),a&&a.compress){if(0===c&&this.unit.isLength())return void b.add(d);c>0&&1>c&&(d=d.substr(1))}b.add(d),this.unit.genCSS(a,b)},g.prototype.operate=function(a,b,c){var d=this._operate(a,b,this.value,c.value),e=this.unit.clone();if("+"===b||"-"===b)if(0===e.numerator.length&&0===e.denominator.length)e=c.unit.clone(),this.unit.backupUnit&&(e.backupUnit=this.unit.backupUnit);else if(0===c.unit.numerator.length&&0===e.denominator.length);else{if(c=c.convertTo(this.unit.usedUnits()),a.strictUnits&&c.unit.toString()!==e.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+e.toString()+"' and '"+c.unit.toString()+"'.");d=this._operate(a,b,this.value,c.value)}else"*"===b?(e.numerator=e.numerator.concat(c.unit.numerator).sort(),e.denominator=e.denominator.concat(c.unit.denominator).sort(),e.cancel()):"/"===b&&(e.numerator=e.numerator.concat(c.unit.denominator).sort(),e.denominator=e.denominator.concat(c.unit.numerator).sort(),e.cancel());return new g(d,e)},g.prototype.compare=function(a){var b,d;if(!(a instanceof g))return void 0;if(this.unit.isEmpty()||a.unit.isEmpty())b=this,d=a;else if(b=this.unify(),d=a.unify(),0!==b.unit.compare(d.unit))return void 0;return c.numericCompare(b.value,d.value)},g.prototype.unify=function(){return this.convertTo({length:"px",duration:"s",angle:"rad"})},g.prototype.convertTo=function(a){var b,c,e,f,h,i=this.value,j=this.unit.clone(),k={};if("string"==typeof a){for(b in d)d[b].hasOwnProperty(a)&&(k={},k[b]=a);a=k}h=function(a,b){return e.hasOwnProperty(a)?(b?i/=e[a]/e[f]:i*=e[a]/e[f],f):a};for(c in a)a.hasOwnProperty(c)&&(f=a[c],e=d[c],j.map(h));return j.cancel(),new g(i,j)},b.exports=g},{"../data/unit-conversions":13,"./color":48,"./node":68,"./unit":77}],55:[function(a,b){var c=a("./node"),d=a("./selector"),e=a("./ruleset"),f=function(a,b,c,e,f,g,h,i){var j;if(this.name=a,this.value=b,c)for(Array.isArray(c)?this.rules=c:(this.rules=[c],this.rules[0].selectors=new d([],null,null,this.index,f).createEmptySelectors()),j=0;this.rules.length>j;j++)this.rules[j].allowImports=!0;this.index=e,this.currentFileInfo=f,this.debugInfo=g,this.isReferenced=h,this.isRooted=i||!1};f.prototype=new c,f.prototype.type="Directive",f.prototype.accept=function(a){var b=this.value,c=this.rules;c&&(this.rules=a.visitArray(c)),b&&(this.value=a.visit(b))},f.prototype.isRulesetLike=function(){return this.rules||!this.isCharset()},f.prototype.isCharset=function(){return"@charset"===this.name},f.prototype.genCSS=function(a,b){var c=this.value,d=this.rules;b.add(this.name,this.currentFileInfo,this.index),c&&(b.add(" "),c.genCSS(a,b)),d?this.outputRuleset(a,b,d):b.add(";")},f.prototype.eval=function(a){var b,c,d=this.value,e=this.rules;return b=a.mediaPath,c=a.mediaBlocks,a.mediaPath=[],a.mediaBlocks=[],d&&(d=d.eval(a)),e&&(e=[e[0].eval(a)],e[0].root=!0),a.mediaPath=b,a.mediaBlocks=c,new f(this.name,d,e,this.index,this.currentFileInfo,this.debugInfo,this.isReferenced,this.isRooted)},f.prototype.variable=function(a){return this.rules?e.prototype.variable.call(this.rules[0],a):void 0},f.prototype.find=function(){return this.rules?e.prototype.find.apply(this.rules[0],arguments):void 0},f.prototype.rulesets=function(){return this.rules?e.prototype.rulesets.apply(this.rules[0]):void 0},f.prototype.markReferenced=function(){var a,b;if(this.isReferenced=!0,this.rules)for(b=this.rules,a=0;b.length>a;a++)b[a].markReferenced&&b[a].markReferenced()},f.prototype.getIsReferenced=function(){return!this.currentFileInfo||!this.currentFileInfo.reference||this.isReferenced},f.prototype.outputRuleset=function(a,b,c){var d,e=c.length;if(a.tabLevel=(0|a.tabLevel)+1,a.compress){for(b.add("{"),d=0;e>d;d++)c[d].genCSS(a,b);return b.add("}"),void a.tabLevel--}var f="\n"+Array(a.tabLevel).join(" "),g=f+" ";if(e){for(b.add(" {"+g),c[0].genCSS(a,b),d=1;e>d;d++)b.add(g),c[d].genCSS(a,b);b.add(f+"}")}else b.add(" {"+f+"}");a.tabLevel--},b.exports=f},{"./node":68,"./ruleset":74,"./selector":75}],56:[function(a,b){var c=a("./node"),d=a("./paren"),e=a("./combinator"),f=function(a,b,c,d){this.combinator=a instanceof e?a:new e(a),this.value="string"==typeof b?b.trim():b?b:"",this.index=c,this.currentFileInfo=d};f.prototype=new c,f.prototype.type="Element",f.prototype.accept=function(a){var b=this.value;this.combinator=a.visit(this.combinator),"object"==typeof b&&(this.value=a.visit(b))},f.prototype.eval=function(a){return new f(this.combinator,this.value.eval?this.value.eval(a):this.value,this.index,this.currentFileInfo)},f.prototype.genCSS=function(a,b){b.add(this.toCSS(a),this.currentFileInfo,this.index)},f.prototype.toCSS=function(a){a=a||{};var b=this.value,c=a.firstSelector;return b instanceof d&&(a.firstSelector=!0),b=b.toCSS?b.toCSS(a):b,a.firstSelector=c,""===b&&"&"===this.combinator.value.charAt(0)?"":this.combinator.toCSS(a)+b},b.exports=f},{"./combinator":49,"./node":68,"./paren":70}],57:[function(a,b){var c=a("./node"),d=a("./paren"),e=a("./comment"),f=function(a){if(this.value=a,!a)throw new Error("Expression requires an array parameter")};f.prototype=new c,f.prototype.type="Expression",f.prototype.accept=function(a){this.value=a.visitArray(this.value)},f.prototype.eval=function(a){var b,c=this.parens&&!this.parensInOp,e=!1;return c&&a.inParenthesis(),this.value.length>1?b=new f(this.value.map(function(b){return b.eval(a)})):1===this.value.length?(this.value[0].parens&&!this.value[0].parensInOp&&(e=!0),b=this.value[0].eval(a)):b=this,c&&a.outOfParenthesis(),this.parens&&this.parensInOp&&!a.isMathOn()&&!e&&(b=new d(b)),b},f.prototype.genCSS=function(a,b){for(var c=0;this.value.length>c;c++)this.value[c].genCSS(a,b),this.value.length>c+1&&b.add(" ")},f.prototype.throwAwayComments=function(){this.value=this.value.filter(function(a){return!(a instanceof e)})},b.exports=f},{"./comment":50,"./node":68,"./paren":70}],58:[function(a,b){var c=a("./node"),d=function e(a,b,c){switch(this.selector=a,this.option=b,this.index=c,this.object_id=e.next_id++,this.parent_ids=[this.object_id],b){case"all":this.allowBefore=!0,this.allowAfter=!0;break;default:this.allowBefore=!1,this.allowAfter=!1}};d.next_id=0,d.prototype=new c,d.prototype.type="Extend",d.prototype.accept=function(a){this.selector=a.visit(this.selector)},d.prototype.eval=function(a){return new d(this.selector.eval(a),this.option,this.index)},d.prototype.clone=function(){return new d(this.selector,this.option,this.index)},d.prototype.findSelfSelectors=function(a){var b,c,d=[];for(b=0;a.length>b;b++)c=a[b].elements,b>0&&c.length&&""===c[0].combinator.value&&(c[0].combinator.value=" "),d=d.concat(a[b].elements);this.selfSelectors=[{elements:d}]},b.exports=d},{"./node":68}],59:[function(a,b){var c=a("./node"),d=a("./media"),e=a("./url"),f=a("./quoted"),g=a("./ruleset"),h=a("./anonymous"),i=function(a,b,c,d,e){if(this.options=c,this.index=d,this.path=a,this.features=b,this.currentFileInfo=e,void 0!==this.options.less||this.options.inline)this.css=!this.options.less||this.options.inline;else{var f=this.getPath();f&&/[#\.\&\?\/]css([\?;].*)?$/.test(f)&&(this.css=!0)}};i.prototype=new c,i.prototype.type="Import",i.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.path=a.visit(this.path),this.options.plugin||this.options.inline||!this.root||(this.root=a.visit(this.root))},i.prototype.genCSS=function(a,b){this.css&&void 0===this.path.currentFileInfo.reference&&(b.add("@import ",this.currentFileInfo,this.index),this.path.genCSS(a,b),this.features&&(b.add(" "),this.features.genCSS(a,b)),b.add(";"))},i.prototype.getPath=function(){return this.path instanceof e?this.path.value.value:this.path.value},i.prototype.isVariableImport=function(){var a=this.path;return a instanceof e&&(a=a.value),a instanceof f?a.containsVariables():!0},i.prototype.evalForImport=function(a){var b=this.path;return b instanceof e&&(b=b.value),new i(b.eval(a),this.features,this.options,this.index,this.currentFileInfo)},i.prototype.evalPath=function(a){var b=this.path.eval(a),c=this.currentFileInfo&&this.currentFileInfo.rootpath;if(!(b instanceof e)){if(c){var d=b.value;d&&a.isPathRelative(d)&&(b.value=c+d)}b.value=a.normalizePath(b.value)}return b},i.prototype.eval=function(a){var b,c,e=this.features&&this.features.eval(a);if(this.options.plugin)return c=a.frames[0]&&a.frames[0].functionRegistry,c&&this.root&&this.root.functions&&c.addMultiple(this.root.functions),[];if(this.skip&&("function"==typeof this.skip&&(this.skip=this.skip()),this.skip))return[];if(this.options.inline){var f=new h(this.root,0,{filename:this.importedFilename},!0,!0);return this.features?new d([f],this.features.value):[f]}if(this.css){var j=new i(this.evalPath(a),e,this.options,this.index);if(!j.css&&this.error)throw this.error;return j}return b=new g(null,this.root.rules.slice(0)),b.evalImports(a),this.features?new d(b.rules,this.features.value):b.rules},b.exports=i},{"./anonymous":44,"./media":64,"./node":68,"./quoted":71,"./ruleset":74,"./url":78}],60:[function(a,b){var c={};c.Node=a("./node"),c.Alpha=a("./alpha"),c.Color=a("./color"),c.Directive=a("./directive"),c.DetachedRuleset=a("./detached-ruleset"),c.Operation=a("./operation"),c.Dimension=a("./dimension"),c.Unit=a("./unit"),c.Keyword=a("./keyword"),c.Variable=a("./variable"),c.Ruleset=a("./ruleset"),c.Element=a("./element"),c.Attribute=a("./attribute"),c.Combinator=a("./combinator"),c.Selector=a("./selector"),c.Quoted=a("./quoted"),c.Expression=a("./expression"),c.Rule=a("./rule"),c.Call=a("./call"),c.URL=a("./url"),c.Import=a("./import"),c.mixin={Call:a("./mixin-call"),Definition:a("./mixin-definition")},c.Comment=a("./comment"),c.Anonymous=a("./anonymous"),c.Value=a("./value"),c.JavaScript=a("./javascript"),c.Assignment=a("./assignment"),c.Condition=a("./condition"),c.Paren=a("./paren"),c.Media=a("./media"),c.UnicodeDescriptor=a("./unicode-descriptor"),c.Negative=a("./negative"),c.Extend=a("./extend"),c.RulesetCall=a("./ruleset-call"),b.exports=c},{"./alpha":43,"./anonymous":44,"./assignment":45,"./attribute":46,"./call":47,"./color":48,"./combinator":49,"./comment":50,"./condition":51,"./detached-ruleset":53,"./dimension":54,"./directive":55,"./element":56,"./expression":57,"./extend":58,"./import":59,"./javascript":61,"./keyword":63,"./media":64,"./mixin-call":65,"./mixin-definition":66,"./negative":67,"./node":68,"./operation":69,"./paren":70,"./quoted":71,"./rule":72,"./ruleset":74,"./ruleset-call":73,"./selector":75,"./unicode-descriptor":76,"./unit":77,"./url":78,"./value":79,"./variable":80}],61:[function(a,b){var c=a("./js-eval-node"),d=a("./dimension"),e=a("./quoted"),f=a("./anonymous"),g=function(a,b,c,d){this.escaped=b,this.expression=a,this.index=c,this.currentFileInfo=d};g.prototype=new c,g.prototype.type="JavaScript",g.prototype.eval=function(a){var b=this.evaluateJavaScript(this.expression,a);return"number"==typeof b?new d(b):"string"==typeof b?new e('"'+b+'"',b,this.escaped,this.index):new f(Array.isArray(b)?b.join(", "):b)},b.exports=g},{"./anonymous":44,"./dimension":54,"./js-eval-node":62,"./quoted":71}],62:[function(a,b){var c=a("./node"),d=a("./variable"),e=function(){};e.prototype=new c,e.prototype.evaluateJavaScript=function(a,b){var c,e=this,f={};if(void 0!==b.javascriptEnabled&&!b.javascriptEnabled)throw{message:"You are using JavaScript, which has been disabled.",filename:this.currentFileInfo.filename,index:this.index};a=a.replace(/@\{([\w-]+)\}/g,function(a,c){return e.jsify(new d("@"+c,e.index,e.currentFileInfo).eval(b))});try{a=new Function("return ("+a+")")}catch(g){throw{message:"JavaScript evaluation error: "+g.message+" from `"+a+"`",filename:this.currentFileInfo.filename,index:this.index}}var h=b.frames[0].variables();for(var i in h)h.hasOwnProperty(i)&&(f[i.slice(1)]={value:h[i].value,toJS:function(){return this.value.eval(b).toCSS()}});try{c=a.call(f)}catch(g){throw{message:"JavaScript evaluation error: '"+g.name+": "+g.message.replace(/["]/g,"'")+"'",filename:this.currentFileInfo.filename,index:this.index}}return c},e.prototype.jsify=function(a){return Array.isArray(a.value)&&a.value.length>1?"["+a.value.map(function(a){return a.toCSS()}).join(", ")+"]":a.toCSS()},b.exports=e},{"./node":68,"./variable":80}],63:[function(a,b){var c=a("./node"),d=function(a){this.value=a};d.prototype=new c,d.prototype.type="Keyword",d.prototype.genCSS=function(a,b){if("%"===this.value)throw{type:"Syntax",message:"Invalid % without number"};b.add(this.value)},d.True=new d("true"),d.False=new d("false"),b.exports=d},{"./node":68}],64:[function(a,b){var c=a("./ruleset"),d=a("./value"),e=a("./selector"),f=a("./anonymous"),g=a("./expression"),h=a("./directive"),i=function(a,b,f,g){this.index=f,this.currentFileInfo=g;var h=new e([],null,null,this.index,this.currentFileInfo).createEmptySelectors();this.features=new d(b),this.rules=[new c(h,a)],this.rules[0].allowImports=!0};i.prototype=new h,i.prototype.type="Media",i.prototype.isRulesetLike=!0,i.prototype.accept=function(a){this.features&&(this.features=a.visit(this.features)),this.rules&&(this.rules=a.visitArray(this.rules))},i.prototype.genCSS=function(a,b){b.add("@media ",this.currentFileInfo,this.index),this.features.genCSS(a,b),this.outputRuleset(a,b,this.rules)},i.prototype.eval=function(a){a.mediaBlocks||(a.mediaBlocks=[],a.mediaPath=[]);var b=new i(null,[],this.index,this.currentFileInfo);this.debugInfo&&(this.rules[0].debugInfo=this.debugInfo,b.debugInfo=this.debugInfo);var c=!1;a.strictMath||(c=!0,a.strictMath=!0);try{b.features=this.features.eval(a)}finally{c&&(a.strictMath=!1)}return a.mediaPath.push(b),a.mediaBlocks.push(b),this.rules[0].functionRegistry=a.frames[0].functionRegistry.inherit(),a.frames.unshift(this.rules[0]),b.rules=[this.rules[0].eval(a)],a.frames.shift(),a.mediaPath.pop(),0===a.mediaPath.length?b.evalTop(a):b.evalNested(a)},i.prototype.evalTop=function(a){var b=this;if(a.mediaBlocks.length>1){var d=new e([],null,null,this.index,this.currentFileInfo).createEmptySelectors();b=new c(d,a.mediaBlocks),b.multiMedia=!0}return delete a.mediaBlocks,delete a.mediaPath,b},i.prototype.evalNested=function(a){var b,e,h=a.mediaPath.concat([this]);for(b=0;h.length>b;b++)e=h[b].features instanceof d?h[b].features.value:h[b].features,h[b]=Array.isArray(e)?e:[e];return this.features=new d(this.permute(h).map(function(a){for(a=a.map(function(a){return a.toCSS?a:new f(a)}),b=a.length-1;b>0;b--)a.splice(b,0,new f("and"));return new g(a)})),new c([],[])},i.prototype.permute=function(a){if(0===a.length)return[];if(1===a.length)return a[0];for(var b=[],c=this.permute(a.slice(1)),d=0;c.length>d;d++)for(var e=0;a[0].length>e;e++)b.push([a[0][e]].concat(c[d]));return b},i.prototype.bubbleSelectors=function(a){a&&(this.rules=[new c(a.slice(0),[this.rules[0]])])},b.exports=i},{"./anonymous":44,"./directive":55,"./expression":57,"./ruleset":74,"./selector":75,"./value":79}],65:[function(a,b){var c=a("./node"),d=a("./selector"),e=a("./mixin-definition"),f=a("../functions/default"),g=function(a,b,c,e,f){this.selector=new d(a),this.arguments=b&&b.length?b:null,this.index=c,this.currentFileInfo=e,this.important=f};g.prototype=new c,g.prototype.type="MixinCall",g.prototype.accept=function(a){this.selector&&(this.selector=a.visit(this.selector)),this.arguments&&(this.arguments=a.visitArray(this.arguments))},g.prototype.eval=function(a){function b(b,c){var d,e;for(k=0;2>k;k++){for(w[k]=!0,f.value(k),d=0;c.length>d&&w[k];d++)e=c[d],e.matchCondition&&(w[k]=w[k]&&e.matchCondition(null,a));b.matchCondition&&(w[k]=w[k]&&b.matchCondition(h,a))}return w[0]||w[1]?w[0]!=w[1]?w[1]?z:A:y:x}var c,d,g,h,i,j,k,l,m,n,o,p,q,r,s,t=[],u=!1,v=[],w=[],x=-1,y=0,z=1,A=2;for(h=this.arguments&&this.arguments.map(function(b){return{name:b.name,value:b.value.eval(a)}}),s=function(b){return b.matchArgs(null,a)},i=0;a.frames.length>i;i++)if((c=a.frames[i].find(this.selector,null,s)).length>0){for(m=!0,j=0;c.length>j;j++){for(d=c[j].rule,g=c[j].path,l=!1,k=0;a.frames.length>k;k++)if(!(d instanceof e)&&d===(a.frames[k].originalRuleset||a.frames[k])){l=!0;break}l||d.matchArgs(h,a)&&(o={mixin:d,group:b(d,g)},o.group!==x&&v.push(o),u=!0)}for(f.reset(),q=[0,0,0],j=0;v.length>j;j++)q[v[j].group]++;if(q[y]>0)p=A;else if(p=z,q[z]+q[A]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `"+this.format(h)+"`",index:this.index,filename:this.currentFileInfo.filename};for(j=0;v.length>j;j++)if(o=v[j].group,o===y||o===p)try{d=v[j].mixin,d instanceof e||(r=d.originalRuleset||d,d=new e("",[],d.rules,null,!1),d.originalRuleset=r),Array.prototype.push.apply(t,d.evalCall(a,h,this.important).rules)}catch(B){throw{message:B.message,index:this.index,filename:this.currentFileInfo.filename,stack:B.stack}}if(u){if(!this.currentFileInfo||!this.currentFileInfo.reference)for(i=0;t.length>i;i++)n=t[i],n.markReferenced&&n.markReferenced();return t}}throw m?{type:"Runtime",message:"No matching definition was found for `"+this.format(h)+"`",index:this.index,filename:this.currentFileInfo.filename}:{type:"Name",message:this.selector.toCSS().trim()+" is undefined",index:this.index,filename:this.currentFileInfo.filename}},g.prototype.format=function(a){return this.selector.toCSS().trim()+"("+(a?a.map(function(a){var b="";return a.name&&(b+=a.name+":"),b+=a.value.toCSS?a.value.toCSS():"???"}).join(", "):"")+")"},b.exports=g},{"../functions/default":19,"./mixin-definition":66,"./node":68,"./selector":75}],66:[function(a,b){var c=a("./selector"),d=a("./element"),e=a("./ruleset"),f=a("./rule"),g=a("./expression"),h=a("../contexts"),i=function(a,b,e,f,g,h){this.name=a,this.selectors=[new c([new d(null,a,this.index,this.currentFileInfo)])],this.params=b,this.condition=f,this.variadic=g,this.arity=b.length,this.rules=e,this._lookups={},this.required=b.reduce(function(a,b){return!b.name||b.name&&!b.value?a+1:a},0),this.frames=h};i.prototype=new e,i.prototype.type="MixinDefinition",i.prototype.evalFirst=!0,i.prototype.accept=function(a){this.params&&this.params.length&&(this.params=a.visitArray(this.params)),this.rules=a.visitArray(this.rules),this.condition&&(this.condition=a.visit(this.condition))},i.prototype.evalParams=function(a,b,c,d){var i,j,k,l,m,n,o,p,q=new e(null,null),r=this.params.slice(0),s=0;if(b.frames&&b.frames[0]&&b.frames[0].functionRegistry&&(q.functionRegistry=b.frames[0].functionRegistry.inherit()),b=new h.Eval(b,[q].concat(b.frames)),c)for(c=c.slice(0),s=c.length,k=0;s>k;k++)if(j=c[k],n=j&&j.name){for(o=!1,l=0;r.length>l;l++)if(!d[l]&&n===r[l].name){d[l]=j.value.eval(a),q.prependRule(new f(n,j.value.eval(a))),o=!0;break}if(o){c.splice(k,1),k--;continue}throw{type:"Runtime",message:"Named argument for "+this.name+" "+c[k].name+" not found"}}for(p=0,k=0;r.length>k;k++)if(!d[k]){if(j=c&&c[p],n=r[k].name)if(r[k].variadic){for(i=[],l=p;s>l;l++)i.push(c[l].value.eval(a));q.prependRule(new f(n,new g(i).eval(a)))}else{if(m=j&&j.value)m=m.eval(a);else{if(!r[k].value)throw{type:"Runtime",message:"wrong number of arguments for "+this.name+" ("+s+" for "+this.arity+")"};m=r[k].value.eval(b),q.resetCache()}q.prependRule(new f(n,m)),d[k]=m}if(r[k].variadic&&c)for(l=p;s>l;l++)d[l]=c[l].value.eval(a);p++}return q},i.prototype.makeImportant=function(){var a=this.rules?this.rules.map(function(a){return a.makeImportant?a.makeImportant(!0):a}):this.rules,b=new i(this.name,this.params,a,this.condition,this.variadic,this.frames);return b},i.prototype.eval=function(a){return new i(this.name,this.params,this.rules,this.condition,this.variadic,this.frames||a.frames.slice(0))},i.prototype.evalCall=function(a,b,c){var d,i,j=[],k=this.frames?this.frames.concat(a.frames):a.frames,l=this.evalParams(a,new h.Eval(a,k),b,j);return l.prependRule(new f("@arguments",new g(j).eval(a))),d=this.rules.slice(0),i=new e(null,d),i.originalRuleset=this,i=i.eval(new h.Eval(a,[this,l].concat(k))),c&&(i=i.makeImportant()),i},i.prototype.matchCondition=function(a,b){return this.condition&&!this.condition.eval(new h.Eval(b,[this.evalParams(b,new h.Eval(b,this.frames?this.frames.concat(b.frames):b.frames),a,[])].concat(this.frames||[]).concat(b.frames)))?!1:!0},i.prototype.matchArgs=function(a,b){var c,d=a&&a.length||0;if(this.variadic){if(this.required-1>d)return!1}else{ -if(this.required>d)return!1;if(d>this.params.length)return!1}c=Math.min(d,this.arity);for(var e=0;c>e;e++)if(!this.params[e].name&&!this.params[e].variadic&&a[e].value.eval(b).toCSS()!=this.params[e].value.eval(b).toCSS())return!1;return!0},b.exports=i},{"../contexts":10,"./element":56,"./expression":57,"./rule":72,"./ruleset":74,"./selector":75}],67:[function(a,b){var c=a("./node"),d=a("./operation"),e=a("./dimension"),f=function(a){this.value=a};f.prototype=new c,f.prototype.type="Negative",f.prototype.genCSS=function(a,b){b.add("-"),this.value.genCSS(a,b)},f.prototype.eval=function(a){return a.isMathOn()?new d("*",[new e(-1),this.value]).eval(a):new f(this.value.eval(a))},b.exports=f},{"./dimension":54,"./node":68,"./operation":69}],68:[function(a,b){var c=function(){};c.prototype.toCSS=function(a){var b=[];return this.genCSS(a,{add:function(a){b.push(a)},isEmpty:function(){return 0===b.length}}),b.join("")},c.prototype.genCSS=function(a,b){b.add(this.value)},c.prototype.accept=function(a){this.value=a.visit(this.value)},c.prototype.eval=function(){return this},c.prototype._operate=function(a,b,c,d){switch(b){case"+":return c+d;case"-":return c-d;case"*":return c*d;case"/":return c/d}},c.prototype.fround=function(a,b){var c=a&&a.numPrecision;return null==c?b:Number((b+2e-16).toFixed(c))},c.compare=function(a,b){if(a.compare&&"Quoted"!==b.type&&"Anonymous"!==b.type)return a.compare(b);if(b.compare)return-b.compare(a);if(a.type!==b.type)return void 0;if(a=a.value,b=b.value,!Array.isArray(a))return a===b?0:void 0;if(a.length!==b.length)return void 0;for(var d=0;a.length>d;d++)if(0!==c.compare(a[d],b[d]))return void 0;return 0},c.numericCompare=function(a,b){return b>a?-1:a===b?0:a>b?1:void 0},b.exports=c},{}],69:[function(a,b){var c=a("./node"),d=a("./color"),e=a("./dimension"),f=function(a,b,c){this.op=a.trim(),this.operands=b,this.isSpaced=c};f.prototype=new c,f.prototype.type="Operation",f.prototype.accept=function(a){this.operands=a.visit(this.operands)},f.prototype.eval=function(a){var b=this.operands[0].eval(a),c=this.operands[1].eval(a);if(a.isMathOn()){if(b instanceof e&&c instanceof d&&(b=b.toColor()),c instanceof e&&b instanceof d&&(c=c.toColor()),!b.operate)throw{type:"Operation",message:"Operation on an invalid type"};return b.operate(a,this.op,c)}return new f(this.op,[b,c],this.isSpaced)},f.prototype.genCSS=function(a,b){this.operands[0].genCSS(a,b),this.isSpaced&&b.add(" "),b.add(this.op),this.isSpaced&&b.add(" "),this.operands[1].genCSS(a,b)},b.exports=f},{"./color":48,"./dimension":54,"./node":68}],70:[function(a,b){var c=a("./node"),d=function(a){this.value=a};d.prototype=new c,d.prototype.type="Paren",d.prototype.genCSS=function(a,b){b.add("("),this.value.genCSS(a,b),b.add(")")},d.prototype.eval=function(a){return new d(this.value.eval(a))},b.exports=d},{"./node":68}],71:[function(a,b){var c=a("./node"),d=a("./js-eval-node"),e=a("./variable"),f=function(a,b,c,d,e){this.escaped=null==c?!0:c,this.value=b||"",this.quote=a.charAt(0),this.index=d,this.currentFileInfo=e};f.prototype=new d,f.prototype.type="Quoted",f.prototype.genCSS=function(a,b){this.escaped||b.add(this.quote,this.currentFileInfo,this.index),b.add(this.value),this.escaped||b.add(this.quote)},f.prototype.containsVariables=function(){return this.value.match(/(`([^`]+)`)|@\{([\w-]+)\}/)},f.prototype.eval=function(a){function b(a,b,c){var d=a;do a=d,d=a.replace(b,c);while(a!==d);return d}var c=this,d=this.value,g=function(b,d){return String(c.evaluateJavaScript(d,a))},h=function(b,d){var g=new e("@"+d,c.index,c.currentFileInfo).eval(a,!0);return g instanceof f?g.value:g.toCSS()};return d=b(d,/`([^`]+)`/g,g),d=b(d,/@\{([\w-]+)\}/g,h),new f(this.quote+d+this.quote,d,this.escaped,this.index,this.currentFileInfo)},f.prototype.compare=function(a){return"Quoted"!==a.type||this.escaped||a.escaped?a.toCSS&&this.toCSS()===a.toCSS()?0:void 0:c.numericCompare(this.value,a.value)},b.exports=f},{"./js-eval-node":62,"./node":68,"./variable":80}],72:[function(a,b){function c(a,b){var c,d="",e=b.length,f={add:function(a){d+=a}};for(c=0;e>c;c++)b[c].eval(a).genCSS(a,f);return d}var d=a("./node"),e=a("./value"),f=a("./keyword"),g=function(a,b,c,f,g,h,i,j){this.name=a,this.value=b instanceof d?b:new e([b]),this.important=c?" "+c.trim():"",this.merge=f,this.index=g,this.currentFileInfo=h,this.inline=i||!1,this.variable=void 0!==j?j:a.charAt&&"@"===a.charAt(0)};g.prototype=new d,g.prototype.type="Rule",g.prototype.genCSS=function(a,b){b.add(this.name+(a.compress?":":": "),this.currentFileInfo,this.index);try{this.value.genCSS(a,b)}catch(c){throw c.index=this.index,c.filename=this.currentFileInfo.filename,c}b.add(this.important+(this.inline||a.lastRule&&a.compress?"":";"),this.currentFileInfo,this.index)},g.prototype.eval=function(a){var b,d=!1,e=this.name,h=this.variable;"string"!=typeof e&&(e=1===e.length&&e[0]instanceof f?e[0].value:c(a,e),h=!1),"font"!==e||a.strictMath||(d=!0,a.strictMath=!0);try{if(a.importantScope.push({}),b=this.value.eval(a),!this.variable&&"DetachedRuleset"===b.type)throw{message:"Rulesets cannot be evaluated on a property.",index:this.index,filename:this.currentFileInfo.filename};var i=this.important,j=a.importantScope.pop();return!i&&j.important&&(i=j.important),new g(e,b,i,this.merge,this.index,this.currentFileInfo,this.inline,h)}catch(k){throw"number"!=typeof k.index&&(k.index=this.index,k.filename=this.currentFileInfo.filename),k}finally{d&&(a.strictMath=!1)}},g.prototype.makeImportant=function(){return new g(this.name,this.value,"!important",this.merge,this.index,this.currentFileInfo,this.inline)},b.exports=g},{"./keyword":63,"./node":68,"./value":79}],73:[function(a,b){var c=a("./node"),d=a("./variable"),e=function(a){this.variable=a};e.prototype=new c,e.prototype.type="RulesetCall",e.prototype.eval=function(a){var b=new d(this.variable).eval(a);return b.callEval(a)},b.exports=e},{"./node":68,"./variable":80}],74:[function(a,b){var c=a("./node"),d=a("./rule"),e=a("./selector"),f=a("./element"),g=a("./paren"),h=a("../contexts"),i=a("../functions/function-registry"),j=a("../functions/default"),k=a("./debug-info"),l=function(a,b,c){this.selectors=a,this.rules=b,this._lookups={},this.strictImports=c};l.prototype=new c,l.prototype.type="Ruleset",l.prototype.isRuleset=!0,l.prototype.isRulesetLike=!0,l.prototype.accept=function(a){this.paths?a.visitArray(this.paths,!0):this.selectors&&(this.selectors=a.visitArray(this.selectors)),this.rules&&this.rules.length&&(this.rules=a.visitArray(this.rules))},l.prototype.eval=function(a){var b,c,e,f,g=this.selectors,h=!1;if(g&&(c=g.length)){for(b=[],j.error({type:"Syntax",message:"it is currently only allowed in parametric mixin guards,"}),f=0;c>f;f++)e=g[f].eval(a),b.push(e),e.evaldCondition&&(h=!0);j.reset()}else h=!0;var k,m,n=this.rules?this.rules.slice(0):null,o=new l(b,n,this.strictImports);o.originalRuleset=this,o.root=this.root,o.firstRoot=this.firstRoot,o.allowImports=this.allowImports,this.debugInfo&&(o.debugInfo=this.debugInfo),h||(n.length=0),o.functionRegistry=function(a){for(var b,c=0,d=a.length;c!==d;++c)if(b=a[c].functionRegistry)return b;return i}(a.frames).inherit();var p=a.frames;p.unshift(o);var q=a.selectors;q||(a.selectors=q=[]),q.unshift(this.selectors),(o.root||o.allowImports||!o.strictImports)&&o.evalImports(a);var r=o.rules,s=r?r.length:0;for(f=0;s>f;f++)r[f].evalFirst&&(r[f]=r[f].eval(a));var t=a.mediaBlocks&&a.mediaBlocks.length||0;for(f=0;s>f;f++)"MixinCall"===r[f].type?(n=r[f].eval(a).filter(function(a){return a instanceof d&&a.variable?!o.variable(a.name):!0}),r.splice.apply(r,[f,1].concat(n)),s+=n.length-1,f+=n.length-1,o.resetCache()):"RulesetCall"===r[f].type&&(n=r[f].eval(a).rules.filter(function(a){return a instanceof d&&a.variable?!1:!0}),r.splice.apply(r,[f,1].concat(n)),s+=n.length-1,f+=n.length-1,o.resetCache());for(f=0;r.length>f;f++)k=r[f],k.evalFirst||(r[f]=k=k.eval?k.eval(a):k);for(f=0;r.length>f;f++)if(k=r[f],k instanceof l&&k.selectors&&1===k.selectors.length&&k.selectors[0].isJustParentSelector()){r.splice(f--,1);for(var u=0;k.rules.length>u;u++)m=k.rules[u],m instanceof d&&m.variable||r.splice(++f,0,m)}if(p.shift(),q.shift(),a.mediaBlocks)for(f=t;a.mediaBlocks.length>f;f++)a.mediaBlocks[f].bubbleSelectors(b);return o},l.prototype.evalImports=function(a){var b,c,d=this.rules;if(d)for(b=0;d.length>b;b++)"Import"===d[b].type&&(c=d[b].eval(a),c&&c.length?(d.splice.apply(d,[b,1].concat(c)),b+=c.length-1):d.splice(b,1,c),this.resetCache())},l.prototype.makeImportant=function(){var a=new l(this.selectors,this.rules.map(function(a){return a.makeImportant?a.makeImportant():a}),this.strictImports);return a},l.prototype.matchArgs=function(a){return!a||0===a.length},l.prototype.matchCondition=function(a,b){var c=this.selectors[this.selectors.length-1];return c.evaldCondition?c.condition&&!c.condition.eval(new h.Eval(b,b.frames))?!1:!0:!1},l.prototype.resetCache=function(){this._rulesets=null,this._variables=null,this._lookups={}},l.prototype.variables=function(){return this._variables||(this._variables=this.rules?this.rules.reduce(function(a,b){if(b instanceof d&&b.variable===!0&&(a[b.name]=b),"Import"===b.type&&b.root&&b.root.variables){var c=b.root.variables();for(var e in c)c.hasOwnProperty(e)&&(a[e]=c[e])}return a},{}):{}),this._variables},l.prototype.variable=function(a){return this.variables()[a]},l.prototype.rulesets=function(){if(!this.rules)return[];var a,b,c=[],d=this.rules,e=d.length;for(a=0;e>a;a++)b=d[a],b.isRuleset&&c.push(b);return c},l.prototype.prependRule=function(a){var b=this.rules;b?b.unshift(a):this.rules=[a]},l.prototype.find=function(a,b,c){b=b||this;var d,f,g=[],h=a.toCSS();return h in this._lookups?this._lookups[h]:(this.rulesets().forEach(function(h){if(h!==b)for(var i=0;h.selectors.length>i;i++)if(d=a.match(h.selectors[i])){if(a.elements.length>d){if(!c||c(h)){f=h.find(new e(a.elements.slice(d)),b,c);for(var j=0;f.length>j;++j)f[j].path.push(h);Array.prototype.push.apply(g,f)}}else g.push({rule:h,path:[]});break}}),this._lookups[h]=g,g)},l.prototype.genCSS=function(a,b){function c(a){return"boolean"==typeof a.isRulesetLike?a.isRulesetLike:"function"==typeof a.isRulesetLike?a.isRulesetLike():!1}var d,e,f,g,h,i=[],j=[];a.tabLevel=a.tabLevel||0,this.root||a.tabLevel++;var l,m=a.compress?"":Array(a.tabLevel+1).join(" "),n=a.compress?"":Array(a.tabLevel).join(" "),o=0,p=0;for(d=0;this.rules.length>d;d++)g=this.rules[d],"Comment"===g.type?(p===d&&p++,j.push(g)):g.isCharset&&g.isCharset()?(j.splice(o,0,g),o++,p++):"Import"===g.type?(j.splice(p,0,g),p++):j.push(g);if(j=i.concat(j),!this.root){f=k(a,this,n),f&&(b.add(f),b.add(n));var q,r=this.paths,s=r.length;for(l=a.compress?",":",\n"+n,d=0;s>d;d++)if(h=r[d],q=h.length)for(d>0&&b.add(l),a.firstSelector=!0,h[0].genCSS(a,b),a.firstSelector=!1,e=1;q>e;e++)h[e].genCSS(a,b);b.add((a.compress?"{":" {\n")+m)}for(d=0;j.length>d;d++){g=j[d],d+1===j.length&&(a.lastRule=!0);var t=a.lastRule;c(g)&&(a.lastRule=!1),g.genCSS?g.genCSS(a,b):g.value&&b.add(g.value.toString()),a.lastRule=t,a.lastRule?a.lastRule=!1:b.add(a.compress?"":"\n"+m)}this.root||(b.add(a.compress?"}":"\n"+n+"}"),a.tabLevel--),b.isEmpty()||a.compress||!this.firstRoot||b.add("\n")},l.prototype.markReferenced=function(){var a;if(this.selectors)for(a=0;this.selectors.length>a;a++)this.selectors[a].markReferenced();if(this.rules)for(a=0;this.rules.length>a;a++)this.rules[a].markReferenced&&this.rules[a].markReferenced()},l.prototype.getIsReferenced=function(){var a,b,c,d;if(this.paths)for(a=0;this.paths.length>a;a++)for(c=this.paths[a],b=0;c.length>b;b++)if(c[b].getIsReferenced&&c[b].getIsReferenced())return!0;if(this.selectors)for(a=0;this.selectors.length>a;a++)if(d=this.selectors[a],d.getIsReferenced&&d.getIsReferenced())return!0;return!1},l.prototype.joinSelectors=function(a,b,c){for(var d=0;c.length>d;d++)this.joinSelector(a,b,c[d])},l.prototype.joinSelector=function(a,b,c){function d(a,b){var c,d;if(0===a.length)c=new g(a[0]);else{var h=[];for(d=0;a.length>d;d++)h.push(new f(null,a[d],b.index,b.currentFileInfo));c=new g(new e(h))}return c}function h(a,b){var c,d;return c=new f(null,a,b.index,b.currentFileInfo),d=new e([c])}function i(a,b,c){function e(a){var b;return"Paren"!==a.value.type?null:(b=a.value.value,"Selector"!==b.type?null:b)}var g,m,n,o,p,q,r,s,t,u,v=!1;for(o=[],p=[[]],g=0;c.elements.length>g;g++)if(s=c.elements[g],"&"!==s.value){var w=e(s);if(null!=w){l(o,p);var x,y=[],z=[];for(x=i(y,b,w),v=v||x,n=0;y.length>n;n++){var A=h(d(y[n],s),s);k(p,[A],s,c,z)}p=z,o=[]}else o.push(s)}else{for(v=!0,q=[],l(o,p),m=0;p.length>m;m++)if(r=p[m],0===b.length)r.length>0&&r[0].elements.push(new f(s.combinator,"",s.index,s.currentFileInfo)),q.push(r);else for(n=0;b.length>n;n++){var B=j(r,b[n],s,c);q.push(B)}p=q,o=[]}for(l(o,p),g=0;p.length>g;g++)t=p[g].length,t>0&&(a.push(p[g]),u=p[g][t-1],p[g][t-1]=u.createDerived(u.elements,c.extendList));return v}function j(a,b,c,d){var e,g,h;if(e=[],a.length>0?(e=a.slice(0),g=e.pop(),h=d.createDerived(g.elements.slice(0))):h=d.createDerived([]),b.length>0){var i=c.combinator,j=b[0].elements[0];i.emptyOrWhitespace&&!j.combinator.emptyOrWhitespace&&(i=j.combinator),h.elements.push(new f(i,j.value,c.index,c.currentFileInfo)),h.elements=h.elements.concat(b[0].elements.slice(1))}return 0!==h.elements.length&&e.push(h),b.length>1&&(e=e.concat(b.slice(1))),e}function k(a,b,c,d,e){var f;for(f=0;a.length>f;f++){var g=j(a[f],b,c,d);e.push(g)}return e}function l(a,b){var c,d;if(0!==a.length){if(0===b.length)return void b.push([new e(a)]);for(c=0;b.length>c;c++)d=b[c],d.length>0?d[d.length-1]=d[d.length-1].createDerived(d[d.length-1].elements.concat(a)):d.push(new e(a))}}var m,n,o;if(n=[],o=i(n,b,c),!o)if(b.length>0)for(n=[],m=0;b.length>m;m++)n.push(b[m].concat(c));else n=[[c]];for(m=0;n.length>m;m++)a.push(n[m])},b.exports=l},{"../contexts":10,"../functions/default":19,"../functions/function-registry":21,"./debug-info":52,"./element":56,"./node":68,"./paren":70,"./rule":72,"./selector":75}],75:[function(a,b){var c=a("./node"),d=a("./element"),e=function(a,b,c,d,e,f){this.elements=a,this.extendList=b,this.condition=c,this.currentFileInfo=e||{},this.isReferenced=f,c||(this.evaldCondition=!0)};e.prototype=new c,e.prototype.type="Selector",e.prototype.accept=function(a){this.elements&&(this.elements=a.visitArray(this.elements)),this.extendList&&(this.extendList=a.visitArray(this.extendList)),this.condition&&(this.condition=a.visit(this.condition))},e.prototype.createDerived=function(a,b,c){c=null!=c?c:this.evaldCondition;var d=new e(a,b||this.extendList,null,this.index,this.currentFileInfo,this.isReferenced);return d.evaldCondition=c,d.mediaEmpty=this.mediaEmpty,d},e.prototype.createEmptySelectors=function(){var a=new d("","&",this.index,this.currentFileInfo),b=[new e([a],null,null,this.index,this.currentFileInfo)];return b[0].mediaEmpty=!0,b},e.prototype.match=function(a){var b,c,d=this.elements,e=d.length;if(a.CacheElements(),b=a._elements.length,0===b||b>e)return 0;for(c=0;b>c;c++)if(d[c].value!==a._elements[c])return 0;return b},e.prototype.CacheElements=function(){if(!this._elements){var a=this.elements.map(function(a){return a.combinator.value+(a.value.value||a.value)}).join("").match(/[,&#\*\.\w-]([\w-]|(\\.))*/g);a?"&"===a[0]&&a.shift():a=[],this._elements=a}},e.prototype.isJustParentSelector=function(){return!this.mediaEmpty&&1===this.elements.length&&"&"===this.elements[0].value&&(" "===this.elements[0].combinator.value||""===this.elements[0].combinator.value)},e.prototype.eval=function(a){var b=this.condition&&this.condition.eval(a),c=this.elements,d=this.extendList;return c=c&&c.map(function(b){return b.eval(a)}),d=d&&d.map(function(b){return b.eval(a)}),this.createDerived(c,d,b)},e.prototype.genCSS=function(a,b){var c,d;if(a&&a.firstSelector||""!==this.elements[0].combinator.value||b.add(" ",this.currentFileInfo,this.index),!this._css)for(c=0;this.elements.length>c;c++)d=this.elements[c],d.genCSS(a,b)},e.prototype.markReferenced=function(){this.isReferenced=!0},e.prototype.getIsReferenced=function(){return!this.currentFileInfo.reference||this.isReferenced},e.prototype.getIsOutput=function(){return this.evaldCondition},b.exports=e},{"./element":56,"./node":68}],76:[function(a,b){var c=a("./node"),d=function(a){this.value=a};d.prototype=new c,d.prototype.type="UnicodeDescriptor",b.exports=d},{"./node":68}],77:[function(a,b){var c=a("./node"),d=a("../data/unit-conversions"),e=function(a,b,c){this.numerator=a?a.slice(0).sort():[],this.denominator=b?b.slice(0).sort():[],c?this.backupUnit=c:a&&a.length&&(this.backupUnit=a[0])};e.prototype=new c,e.prototype.type="Unit",e.prototype.clone=function(){return new e(this.numerator.slice(0),this.denominator.slice(0),this.backupUnit)},e.prototype.genCSS=function(a,b){var c=a&&a.strictUnits;1===this.numerator.length?b.add(this.numerator[0]):!c&&this.backupUnit?b.add(this.backupUnit):!c&&this.denominator.length&&b.add(this.denominator[0])},e.prototype.toString=function(){var a,b=this.numerator.join("*");for(a=0;this.denominator.length>a;a++)b+="/"+this.denominator[a];return b},e.prototype.compare=function(a){return this.is(a.toString())?0:void 0},e.prototype.is=function(a){return this.toString().toUpperCase()===a.toUpperCase()},e.prototype.isLength=function(){return Boolean(this.toCSS().match(/px|em|%|in|cm|mm|pc|pt|ex/))},e.prototype.isEmpty=function(){return 0===this.numerator.length&&0===this.denominator.length},e.prototype.isSingular=function(){return 1>=this.numerator.length&&0===this.denominator.length},e.prototype.map=function(a){var b;for(b=0;this.numerator.length>b;b++)this.numerator[b]=a(this.numerator[b],!1);for(b=0;this.denominator.length>b;b++)this.denominator[b]=a(this.denominator[b],!0)},e.prototype.usedUnits=function(){var a,b,c={};b=function(b){return a.hasOwnProperty(b)&&!c[e]&&(c[e]=b),b};for(var e in d)d.hasOwnProperty(e)&&(a=d[e],this.map(b));return c},e.prototype.cancel=function(){var a,b,c={};for(b=0;this.numerator.length>b;b++)a=this.numerator[b],c[a]=(c[a]||0)+1;for(b=0;this.denominator.length>b;b++)a=this.denominator[b],c[a]=(c[a]||0)-1;this.numerator=[],this.denominator=[];for(a in c)if(c.hasOwnProperty(a)){var d=c[a];if(d>0)for(b=0;d>b;b++)this.numerator.push(a);else if(0>d)for(b=0;-d>b;b++)this.denominator.push(a)}this.numerator.sort(),this.denominator.sort()},b.exports=e},{"../data/unit-conversions":13,"./node":68}],78:[function(a,b){var c=a("./node"),d=function(a,b,c,d){this.value=a,this.currentFileInfo=c,this.index=b,this.isEvald=d};d.prototype=new c,d.prototype.type="Url",d.prototype.accept=function(a){this.value=a.visit(this.value)},d.prototype.genCSS=function(a,b){b.add("url("),this.value.genCSS(a,b),b.add(")")},d.prototype.eval=function(a){var b,c=this.value.eval(a);if(!this.isEvald&&(b=this.currentFileInfo&&this.currentFileInfo.rootpath,b&&"string"==typeof c.value&&a.isPathRelative(c.value)&&(c.quote||(b=b.replace(/[\(\)'"\s]/g,function(a){return"\\"+a})),c.value=b+c.value),c.value=a.normalizePath(c.value),a.urlArgs&&!c.value.match(/^\s*data:/))){var e=-1===c.value.indexOf("?")?"?":"&",f=e+a.urlArgs;-1!==c.value.indexOf("#")?c.value=c.value.replace("#",f+"#"):c.value+=f}return new d(c,this.index,this.currentFileInfo,!0)},b.exports=d},{"./node":68}],79:[function(a,b){var c=a("./node"),d=function(a){if(this.value=a,!a)throw new Error("Value requires an array argument")};d.prototype=new c,d.prototype.type="Value",d.prototype.accept=function(a){this.value&&(this.value=a.visitArray(this.value))},d.prototype.eval=function(a){return 1===this.value.length?this.value[0].eval(a):new d(this.value.map(function(b){return b.eval(a)}))},d.prototype.genCSS=function(a,b){var c;for(c=0;this.value.length>c;c++)this.value[c].genCSS(a,b),this.value.length>c+1&&b.add(a&&a.compress?",":", ")},b.exports=d},{"./node":68}],80:[function(a,b){var c=a("./node"),d=function(a,b,c){this.name=a,this.index=b,this.currentFileInfo=c||{}};d.prototype=new c,d.prototype.type="Variable",d.prototype.eval=function(a){var b,c=this.name;if(0===c.indexOf("@@")&&(c="@"+new d(c.slice(1),this.index,this.currentFileInfo).eval(a).value),this.evaluating)throw{type:"Name",message:"Recursive variable definition for "+c,filename:this.currentFileInfo.filename,index:this.index};if(this.evaluating=!0,b=this.find(a.frames,function(b){var d=b.variable(c);if(d){if(d.important){var e=a.importantScope[a.importantScope.length-1];e.important=d.important}return d.value.eval(a)}}))return this.evaluating=!1,b;throw{type:"Name",message:"variable "+c+" is undefined",filename:this.currentFileInfo.filename,index:this.index}},d.prototype.find=function(a,b){for(var c,d=0;a.length>d;d++)if(c=b.call(a,a[d]))return c;return null},b.exports=d},{"./node":68}],81:[function(a,b){b.exports={getLocation:function(a,b){for(var c=a+1,d=null,e=-1;--c>=0&&"\n"!==b.charAt(c);)e++;return"number"==typeof a&&(d=(b.slice(0,a).match(/\n/g)||"").length),{line:d,column:e}}}},{}],82:[function(a,b){var c=a("../tree"),d=a("./visitor"),e=a("../logger"),f=function(){this._visitor=new d(this),this.contexts=[],this.allExtendsStack=[[]]};f.prototype={run:function(a){return a=this._visitor.visit(a),a.allExtends=this.allExtendsStack[0],a},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitRuleset:function(a){if(!a.root){var b,d,e,f,g=[],h=a.rules,i=h?h.length:0;for(b=0;i>b;b++)a.rules[b]instanceof c.Extend&&(g.push(h[b]),a.extendOnEveryPath=!0);var j=a.paths;for(b=0;j.length>b;b++){var k=j[b],l=k[k.length-1],m=l.extendList;for(f=m?m.slice(0).concat(g):g,f&&(f=f.map(function(a){return a.clone()})),d=0;f.length>d;d++)this.foundExtends=!0,e=f[d],e.findSelfSelectors(k),e.ruleset=a,0===d&&(e.firstExtendOnThisSelectorPath=!0),this.allExtendsStack[this.allExtendsStack.length-1].push(e)}this.contexts.push(a.selectors)}},visitRulesetOut:function(a){a.root||(this.contexts.length=this.contexts.length-1)},visitMedia:function(a){a.allExtends=[],this.allExtendsStack.push(a.allExtends)},visitMediaOut:function(){this.allExtendsStack.length=this.allExtendsStack.length-1},visitDirective:function(a){a.allExtends=[],this.allExtendsStack.push(a.allExtends)},visitDirectiveOut:function(){this.allExtendsStack.length=this.allExtendsStack.length-1}};var g=function(){this._visitor=new d(this)};g.prototype={run:function(a){var b=new f;if(this.extendIndicies={},b.run(a),!b.foundExtends)return a;a.allExtends=a.allExtends.concat(this.doExtendChaining(a.allExtends,a.allExtends)),this.allExtendsStack=[a.allExtends];var c=this._visitor.visit(a);return this.checkExtendsForNonMatched(a.allExtends),c},checkExtendsForNonMatched:function(a){var b=this.extendIndicies;a.filter(function(a){return!a.hasFoundMatches&&1==a.parent_ids.length}).forEach(function(a){var c="_unknown_";try{c=a.selector.toCSS({})}catch(d){}b[a.index+" "+c]||(b[a.index+" "+c]=!0,e.warn("extend '"+c+"' has no matches"))})},doExtendChaining:function(a,b,d){var e,f,g,h,i,j,k,l,m=[],n=this;for(d=d||0,e=0;a.length>e;e++)for(f=0;b.length>f;f++)j=a[e],k=b[f],j.parent_ids.indexOf(k.object_id)>=0||(i=[k.selfSelectors[0]],g=n.findMatch(j,i),g.length&&(j.hasFoundMatches=!0,j.selfSelectors.forEach(function(a){h=n.extendSelector(g,i,a),l=new c.Extend(k.selector,k.option,0),l.selfSelectors=h,h[h.length-1].extendList=[l],m.push(l),l.ruleset=k.ruleset,l.parent_ids=l.parent_ids.concat(k.parent_ids,j.parent_ids),k.firstExtendOnThisSelectorPath&&(l.firstExtendOnThisSelectorPath=!0,k.ruleset.paths.push(h))})));if(m.length){if(this.extendChainCount++,d>100){var o="{unable to calculate}",p="{unable to calculate}";try{o=m[0].selfSelectors[0].toCSS(),p=m[0].selector.toCSS()}catch(q){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+o+":extend("+p+")"}}return m.concat(n.doExtendChaining(m,b,d+1))}return m},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitSelector:function(a,b){b.visitDeeper=!1},visitRuleset:function(a){if(!a.root){var b,c,d,e,f=this.allExtendsStack[this.allExtendsStack.length-1],g=[],h=this;for(d=0;f.length>d;d++)for(c=0;a.paths.length>c;c++)if(e=a.paths[c],!a.extendOnEveryPath){var i=e[e.length-1].extendList;i&&i.length||(b=this.findMatch(f[d],e),b.length&&(f[d].hasFoundMatches=!0,f[d].selfSelectors.forEach(function(a){g.push(h.extendSelector(b,e,a))})))}a.paths=a.paths.concat(g)}},findMatch:function(a,b){var c,d,e,f,g,h,i,j=this,k=a.selector.elements,l=[],m=[];for(c=0;b.length>c;c++)for(d=b[c],e=0;d.elements.length>e;e++)for(f=d.elements[e],(a.allowBefore||0===c&&0===e)&&l.push({pathIndex:c,index:e,matched:0,initialCombinator:f.combinator}),h=0;l.length>h;h++)i=l[h],g=f.combinator.value,""===g&&0===e&&(g=" "),!j.isElementValuesEqual(k[i.matched].value,f.value)||i.matched>0&&k[i.matched].combinator.value!==g?i=null:i.matched++,i&&(i.finished=i.matched===k.length,i.finished&&!a.allowAfter&&(d.elements.length>e+1||b.length>c+1)&&(i=null)),i?i.finished&&(i.length=k.length,i.endPathIndex=c,i.endPathElementIndex=e+1,l.length=0,m.push(i)):(l.splice(h,1),h--);return m},isElementValuesEqual:function(a,b){if("string"==typeof a||"string"==typeof b)return a===b;if(a instanceof c.Attribute)return a.op!==b.op||a.key!==b.key?!1:a.value&&b.value?(a=a.value.value||a.value,b=b.value.value||b.value,a===b):a.value||b.value?!1:!0;if(a=a.value,b=b.value,a instanceof c.Selector){if(!(b instanceof c.Selector)||a.elements.length!==b.elements.length)return!1;for(var d=0;a.elements.length>d;d++){if(a.elements[d].combinator.value!==b.elements[d].combinator.value&&(0!==d||(a.elements[d].combinator.value||" ")!==(b.elements[d].combinator.value||" ")))return!1;if(!this.isElementValuesEqual(a.elements[d].value,b.elements[d].value))return!1}return!0}return!1},extendSelector:function(a,b,d){var e,f,g,h,i,j=0,k=0,l=[];for(e=0;a.length>e;e++)h=a[e],f=b[h.pathIndex],g=new c.Element(h.initialCombinator,d.elements[0].value,d.elements[0].index,d.elements[0].currentFileInfo),h.pathIndex>j&&k>0&&(l[l.length-1].elements=l[l.length-1].elements.concat(b[j].elements.slice(k)),k=0,j++),i=f.elements.slice(k,h.index).concat([g]).concat(d.elements.slice(1)),j===h.pathIndex&&e>0?l[l.length-1].elements=l[l.length-1].elements.concat(i):(l=l.concat(b.slice(j,h.pathIndex)),l.push(new c.Selector(i))),j=h.endPathIndex,k=h.endPathElementIndex,k>=b[j].elements.length&&(k=0,j++);return b.length>j&&k>0&&(l[l.length-1].elements=l[l.length-1].elements.concat(b[j].elements.slice(k)),j++),l=l.concat(b.slice(j,b.length))},visitRulesetOut:function(){},visitMedia:function(a){var b=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);b=b.concat(this.doExtendChaining(b,a.allExtends)),this.allExtendsStack.push(b)},visitMediaOut:function(){var a=this.allExtendsStack.length-1;this.allExtendsStack.length=a},visitDirective:function(a){var b=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);b=b.concat(this.doExtendChaining(b,a.allExtends)),this.allExtendsStack.push(b)},visitDirectiveOut:function(){var a=this.allExtendsStack.length-1;this.allExtendsStack.length=a}},b.exports=g},{"../logger":31,"../tree":60,"./visitor":88}],83:[function(a,b){function c(a){this.imports=[],this.variableImports=[],this._onSequencerEmpty=a,this._currentDepth=0}c.prototype.addImport=function(a){var b=this,c={callback:a,args:null,isReady:!1};return this.imports.push(c),function(){c.args=Array.prototype.slice.call(arguments,0),c.isReady=!0,b.tryRun()}},c.prototype.addVariableImport=function(a){this.variableImports.push(a)},c.prototype.tryRun=function(){this._currentDepth++;try{for(;;){for(;this.imports.length>0;){var a=this.imports[0];if(!a.isReady)return;this.imports=this.imports.slice(1),a.callback.apply(null,a.args)}if(0===this.variableImports.length)break;var b=this.variableImports[0];this.variableImports=this.variableImports.slice(1),b()}}finally{this._currentDepth--}0===this._currentDepth&&this._onSequencerEmpty&&this._onSequencerEmpty()},b.exports=c},{}],84:[function(a,b){var c=a("../contexts"),d=a("./visitor"),e=a("./import-sequencer"),f=function(a,b){this._visitor=new d(this),this._importer=a,this._finish=b,this.context=new c.Eval,this.importCount=0,this.onceFileDetectionMap={},this.recursionDetector={},this._sequencer=new e(this._onSequencerEmpty.bind(this))};f.prototype={isReplacing:!1,run:function(a){try{this._visitor.visit(a)}catch(b){this.error=b}this.isFinished=!0,this._sequencer.tryRun()},_onSequencerEmpty:function(){this.isFinished&&this._finish(this.error)},visitImport:function(a,b){var d=a.options.inline;if(!a.css||d){var e=new c.Eval(this.context,this.context.frames.slice(0)),f=e.frames[0];this.importCount++,a.isVariableImport()?this._sequencer.addVariableImport(this.processImportNode.bind(this,a,e,f)):this.processImportNode(a,e,f)}b.visitDeeper=!1},processImportNode:function(a,b,c){var d,e=a.options.inline;try{d=a.evalForImport(b)}catch(f){f.filename||(f.index=a.index,f.filename=a.currentFileInfo.filename),a.css=!0,a.error=f}if(!d||d.css&&!e)this.importCount--,this.isFinished&&this._sequencer.tryRun();else{d.options.multiple&&(b.importMultiple=!0);for(var g=void 0===d.css,h=0;c.rules.length>h;h++)if(c.rules[h]===a){c.rules[h]=d;break}var i=this.onImported.bind(this,d,b),j=this._sequencer.addImport(i);this._importer.push(d.getPath(),g,d.currentFileInfo,d.options,j)}},onImported:function(a,b,c,d,e,f){c&&(c.filename||(c.index=a.index,c.filename=a.currentFileInfo.filename),this.error=c);var g=this,h=a.options.inline,i=a.options.plugin,j=e||f in g.recursionDetector;if(b.importMultiple||(a.skip=j?!0:function(){return f in g.onceFileDetectionMap?!0:(g.onceFileDetectionMap[f]=!0,!1)}),d&&(a.root=d,a.importedFilename=f,!(h||i||!b.importMultiple&&j))){g.recursionDetector[f]=!0;var k=this.context;this.context=b;try{this._visitor.visit(d)}catch(c){this.error=c}this.context=k}g.importCount--,g.isFinished&&g._sequencer.tryRun()},visitRule:function(a,b){"DetachedRuleset"===a.value.type?this.context.frames.unshift(a):b.visitDeeper=!1},visitRuleOut:function(a){"DetachedRuleset"===a.value.type&&this.context.frames.shift()},visitDirective:function(a){this.context.frames.unshift(a)},visitDirectiveOut:function(){this.context.frames.shift()},visitMixinDefinition:function(a){this.context.frames.unshift(a)},visitMixinDefinitionOut:function(){this.context.frames.shift()},visitRuleset:function(a){this.context.frames.unshift(a)},visitRulesetOut:function(){this.context.frames.shift()},visitMedia:function(a){this.context.frames.unshift(a.rules[0])},visitMediaOut:function(){this.context.frames.shift()}},b.exports=f},{"../contexts":10,"./import-sequencer":83,"./visitor":88}],85:[function(a,b){var c={Visitor:a("./visitor"),ImportVisitor:a("./import-visitor"),ExtendVisitor:a("./extend-visitor"),JoinSelectorVisitor:a("./join-selector-visitor"),ToCSSVisitor:a("./to-css-visitor")};b.exports=c},{"./extend-visitor":82,"./import-visitor":84,"./join-selector-visitor":86,"./to-css-visitor":87,"./visitor":88}],86:[function(a,b){var c=a("./visitor"),d=function(){this.contexts=[[]],this._visitor=new c(this)};d.prototype={run:function(a){return this._visitor.visit(a)},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitRuleset:function(a){var b,c=this.contexts[this.contexts.length-1],d=[];this.contexts.push(d),a.root||(b=a.selectors,b&&(b=b.filter(function(a){return a.getIsOutput()}),a.selectors=b.length?b:b=null,b&&a.joinSelectors(d,c,b)),b||(a.rules=null),a.paths=d)},visitRulesetOut:function(){this.contexts.length=this.contexts.length-1},visitMedia:function(a){var b=this.contexts[this.contexts.length-1];a.rules[0].root=0===b.length||b[0].multiMedia},visitDirective:function(a){var b=this.contexts[this.contexts.length-1];a.rules&&a.rules.length&&(a.rules[0].root=a.isRooted||0===b.length||null)}},b.exports=d},{"./visitor":88}],87:[function(a,b){var c=a("../tree"),d=a("./visitor"),e=function(a){this._visitor=new d(this),this._context=a};e.prototype={isReplacing:!0,run:function(a){return this._visitor.visit(a)},visitRule:function(a){return a.variable?void 0:a},visitMixinDefinition:function(a){ -a.frames=[]},visitExtend:function(){},visitComment:function(a){return a.isSilent(this._context)?void 0:a},visitMedia:function(a,b){return a.accept(this._visitor),b.visitDeeper=!1,a.rules.length?a:void 0},visitImport:function(a){return void 0!==a.path.currentFileInfo.reference&&a.css?void 0:a},visitDirective:function(a,b){function d(a){var b,c=a.rules;1!==c.length||c[0].paths&&0!==c[0].paths.length||(c=c[0].rules);for(var d=0;c.length>d;d++)if(b=c[d],b.getIsReferenced&&b.getIsReferenced())return!0;return!1}if("@charset"===a.name){if(!a.getIsReferenced())return;if(this.charset){if(a.debugInfo){var e=new c.Comment("/* "+a.toCSS(this._context).replace(/\n/g,"")+" */\n");return e.debugInfo=a.debugInfo,this._visitor.visit(e)}return}this.charset=!0}if(a.rules&&a.rules.length){if(this._mergeRules(a.rules[0].rules),a.accept(this._visitor),b.visitDeeper=!1,a.getIsReferenced())return a;if(!a.rules||!a.rules.length)return;if(d(a))return a.markReferenced(),a}else if(a.getIsReferenced())return a},checkPropertiesInRoot:function(a){for(var b,d=0;a.length>d;d++)if(b=a[d],b instanceof c.Rule&&!b.variable)throw{message:"properties must be inside selector blocks, they cannot be in the root.",index:b.index,filename:b.currentFileInfo?b.currentFileInfo.filename:null}},visitRuleset:function(a,b){var d,e=[];if(a.firstRoot&&this.checkPropertiesInRoot(a.rules),a.root)a.accept(this._visitor),b.visitDeeper=!1,(a.firstRoot||a.rules&&a.rules.length>0)&&e.splice(0,0,a);else{a.paths&&(a.paths=a.paths.filter(function(a){var b;for(" "===a[0].elements[0].combinator.value&&(a[0].elements[0].combinator=new c.Combinator("")),b=0;a.length>b;b++)if(a[b].getIsReferenced()&&a[b].getIsOutput())return!0;return!1}));for(var f=a.rules,g=f?f.length:0,h=0;g>h;)d=f[h],d&&d.rules?(e.push(this._visitor.visit(d)),f.splice(h,1),g--):h++;g>0?a.accept(this._visitor):a.rules=null,b.visitDeeper=!1,f=a.rules,f&&(this._mergeRules(f),f=a.rules),f&&(this._removeDuplicateRules(f),f=a.rules),f&&f.length>0&&a.paths.length>0&&e.splice(0,0,a)}return 1===e.length?e[0]:e},_removeDuplicateRules:function(a){if(a){var b,d,e,f={};for(e=a.length-1;e>=0;e--)if(d=a[e],d instanceof c.Rule)if(f[d.name]){b=f[d.name],b instanceof c.Rule&&(b=f[d.name]=[f[d.name].toCSS(this._context)]);var g=d.toCSS(this._context);-1!==b.indexOf(g)?a.splice(e,1):b.push(g)}else f[d.name]=d}},_mergeRules:function(a){if(a){for(var b,d,e,f={},g=0;a.length>g;g++)d=a[g],d instanceof c.Rule&&d.merge&&(e=[d.name,d.important?"!":""].join(","),f[e]?a.splice(g--,1):f[e]=[],f[e].push(d));Object.keys(f).map(function(a){function e(a){return new c.Expression(a.map(function(a){return a.value}))}function g(a){return new c.Value(a.map(function(a){return a}))}if(b=f[a],b.length>1){d=b[0];var h=[],i=[];b.map(function(a){"+"===a.merge&&(i.length>0&&h.push(e(i)),i=[]),i.push(a)}),h.push(e(i)),d.value=g(h)}})}}},b.exports=e},{"../tree":60,"./visitor":88}],88:[function(a,b){function c(a){return a}function d(a,b){var c,e;for(c in a)if(a.hasOwnProperty(c))switch(e=a[c],typeof e){case"function":e.prototype&&e.prototype.type&&(e.prototype.typeIndex=b++);break;case"object":b=d(e,b)}return b}var e=a("../tree"),f={visitDeeper:!0},g=!1,h=function(a){this._implementation=a,this._visitFnCache=[],g||(d(e,1),g=!0)};h.prototype={visit:function(a){if(!a)return a;var b=a.typeIndex;if(!b)return a;var d,e=this._visitFnCache,g=this._implementation,h=b<<1,i=1|h,j=e[h],k=e[i],l=f;if(l.visitDeeper=!0,j||(d="visit"+a.type,j=g[d]||c,k=g[d+"Out"]||c,e[h]=j,e[i]=k),j!==c){var m=j.call(g,a,l);g.isReplacing&&(a=m)}return l.visitDeeper&&a&&a.accept&&a.accept(this),k!=c&&k.call(g,a),a},visitArray:function(a,b){if(!a)return a;var c,d=a.length;if(b||!this._implementation.isReplacing){for(c=0;d>c;c++)this.visit(a[c]);return a}var e=[];for(c=0;d>c;c++){var f=this.visit(a[c]);void 0!==f&&(f.splice?f.length&&this.flatten(f,e):e.push(f))}return e},flatten:function(a,b){b||(b=[]);var c,d,e,f,g,h;for(d=0,c=a.length;c>d;d++)if(e=a[d],void 0!==e)if(e.splice)for(g=0,f=e.length;f>g;g++)h=e[g],void 0!==h&&(h.splice?h.length&&this.flatten(h,b):b.push(h));else b.push(e);return b}},b.exports=h},{"../tree":60}],89:[function(a,b){function c(){if(!g){g=!0;for(var a,b=f.length;b;){a=f,f=[];for(var c=-1;++ca;a++)b(k[a]);k=null}if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");var i=null,j=null,k=[],l=this;this.then=function(a,c){return new l.constructor(function(e,f){b(new d(a,c,e,f))})},e(a,c,g)}function d(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function e(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}var f=a("asap");b.exports=c},{asap:92}],91:[function(a,b){"use strict";function c(a){this.then=function(b){return"function"!=typeof b?this:new d(function(c,d){e(function(){try{c(b(a))}catch(e){d(e)}})})}}var d=a("./core.js"),e=a("asap");b.exports=d,c.prototype=d.prototype;var f=new c(!0),g=new c(!1),h=new c(null),i=new c(void 0),j=new c(0),k=new c("");d.resolve=function(a){if(a instanceof d)return a;if(null===a)return h;if(void 0===a)return i;if(a===!0)return f;if(a===!1)return g;if(0===a)return j;if(""===a)return k;if("object"==typeof a||"function"==typeof a)try{var b=a.then;if("function"==typeof b)return new d(b.bind(a))}catch(e){return new d(function(a,b){b(e)})}return new c(a)},d.all=function(a){var b=Array.prototype.slice.call(a);return new d(function(a,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}b[f]=g,0===--e&&a(b)}catch(i){c(i)}}if(0===b.length)return a([]);for(var e=b.length,f=0;b.length>f;f++)d(f,b[f])})},d.reject=function(a){return new d(function(b,c){c(a)})},d.race=function(a){return new d(function(b,c){a.forEach(function(a){d.resolve(a).then(b,c)})})},d.prototype["catch"]=function(a){return this.then(null,a)}},{"./core.js":90,asap:92}],92:[function(a,b){(function(a){function c(){for(;e.next;){e=e.next;var a=e.task;e.task=void 0;var b=e.domain;b&&(e.domain=void 0,b.enter());try{a()}catch(d){if(i)throw b&&b.exit(),setTimeout(c,0),b&&b.enter(),d;setTimeout(function(){throw d},0)}b&&b.exit()}g=!1}function d(b){f=f.next={task:b,domain:i&&a.domain,next:null},g||(g=!0,h())}var e={task:void 0,next:null},f=e,g=!1,h=void 0,i=!1;if("undefined"!=typeof a&&a.nextTick)i=!0,h=function(){a.nextTick(c)};else if("function"==typeof setImmediate)h="undefined"!=typeof window?setImmediate.bind(window,c):function(){setImmediate(c)};else if("undefined"!=typeof MessageChannel){var j=new MessageChannel;j.port1.onmessage=c,h=function(){j.port2.postMessage(0)}}else h=function(){setTimeout(c,0)};b.exports=d}).call(this,a("_process"))},{_process:89}],93:[function(){"function"!=typeof Promise.prototype.done&&(Promise.prototype.done=function(){var a=arguments.length?this.then.apply(this,arguments):this;a.then(null,function(a){setTimeout(function(){throw a},0)})})},{}],94:[function(a){a("asap");"undefined"==typeof Promise&&(Promise=a("./lib/core.js"),a("./lib/es6-extensions.js")),a("./polyfill-done.js")},{"./lib/core.js":90,"./lib/es6-extensions.js":91,"./polyfill-done.js":93,asap:92}]},{},[2])(2)}); \ No newline at end of file diff --git a/test/SpecRunner.html b/test/SpecRunner.html index edcca7d247c..8f7fd48b77a 100644 --- a/test/SpecRunner.html +++ b/test/SpecRunner.html @@ -36,7 +36,7 @@ - + From 565f0c827095435e94ef32fb7053608b4986a47a Mon Sep 17 00:00:00 2001 From: despoinakaz Date: Sun, 8 Jan 2017 19:02:03 +0200 Subject: [PATCH 035/151] Update strings.js (#13028) * Update strings.js * Update strings.js --- src/nls/el/strings.js | 65 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 60 insertions(+), 5 deletions(-) diff --git a/src/nls/el/strings.js b/src/nls/el/strings.js index 686ed0016ad..5e817eb6541 100644 --- a/src/nls/el/strings.js +++ b/src/nls/el/strings.js @@ -31,11 +31,18 @@ define({ "GENERIC_ERROR" : "(error {0})", "NOT_FOUND_ERR" : "Το αρχείο δεν βρέθηκε.", "NOT_READABLE_ERR" : "Το αρχείο δεν μπορεί να διαβαστεί.", + "EXCEEDS_MAX_FILE_SIZE" : "Αρχεία που ξεπερνούν τα {0} MB δεν μπορούν να ανοίξουν στο {APP_NAME}.", + "CONTENTS_MODIFIED_ERR" : "Το αρχείο έχει τροποποιηθεί εκτός του {APP_NAME}.", "NO_MODIFICATION_ALLOWED_ERR" : "Ο φάκελος δεν μπορεί να τροποποιηθεί.", "NO_MODIFICATION_ALLOWED_ERR_FILE" : "Δεν επιτρέπεται να κάνεις τροποποιήσεις.", "FILE_EXISTS_ERR" : "Αυτό το αρχείο ή ο φάκελος υπάρχουν ήδη.", "FILE" : "αρχείο", + "FILE_TITLE" : "Αρχείο", "DIRECTORY" : "φάκελος", + "DIRECTORY_TITLE" : "Φάκελος", + "FILENAMES_LEDE" : "Ονόματα αρχείων", + "FILENAME" : "Όνομα αρχείου", + "DIRECTORY_NAME" : "Όνομα φακέλου", // Project error strings "ERROR_LOADING_PROJECT" : "Σφάλμα φόρτωσης project", @@ -101,17 +108,22 @@ define({ "SAVE_CLOSE_MULTI_MESSAGE" : "Θέλετε να αποθηκεύσετε τις αλλαγές σας στα παρακάτω αρχεία;", "EXT_MODIFIED_TITLE" : "Εξωτερικές Αλλαγές", "CONFIRM_DELETE_TITLE" : "Επιβεβαίωση Διαγραφής", + "CONFIRM_FILE_DELETE" : "Είστε σίγουρος ότι θέλετε να διαγράψε το αρχείο {0}?", "CONFIRM_FOLDER_DELETE" : "Είστε σίγουρος ότι θέλετε να διαγράψετε τον φάκελο {0}?", "FILE_DELETED_TITLE" : "Το Αρχείο Διαγράφηκε", "EXT_MODIFIED_MESSAGE" : "Το {0} έχει τροποποιηθεί στο δίσκο, αλλά υπάρχουν και μη αποθηκευμένες αλλαγές στο {APP_NAME}.

    Ποια έκδοση θέλετε να κρατήσετε;", "EXT_DELETED_MESSAGE" : "Το {0} έχει διαγραφεί στον δίσκο, αλλά έχει μη αποθηκευμένες αλλαγές στο {APP_NAME}.

    Θέλετε να κρατήσετε τις αλλαγές σας;", // Find, Replace, Find in Files + "FIND_MATCH_INDEX" : "{0} από {1}", "FIND_NO_RESULTS" : "Δεν βρέθηκαν αποτελέσματα", + "FIND_QUERY_PLACEHOLDER" : "Εύρεση\u2026", + "REPLACE_PLACEHOLDER" : "Αντικατάσταση με\u2026", "BUTTON_YES" : "Ναι", "BUTTON_NO" : "Όχι", "BUTTON_REPLACE_ALL" : "Όλα\u2026", "BUTTON_REPLACE" : "Αντικατάσταση", + "BUTTON_REGEXP_HINT" : "Κανονική έκφραση", "BUTTON_NEXT" : "\u25B6", "BUTTON_PREV" : "\u25C0", @@ -125,6 +137,10 @@ define({ "RELEASE_NOTES" : "Release Notes", "NO_UPDATE_TITLE" : "Έχετε την τελευταία έκδοση!", "NO_UPDATE_MESSAGE" : "Τρέχετε την τελευταία έκδοση του {APP_NAME}.", + + //Find and replace + "FIND_REPLACE_TITLE_LABEL" : "Αντικατάσταση", + "FIND_REPLACE_TITLE_WITH" : "με", "FIND_IN_FILES_SCOPED" : "στο {0}", "FIND_IN_FILES_NO_SCOPE" : "στο project", @@ -135,6 +151,7 @@ define({ "FIND_IN_FILES_MORE_THAN" : "Πάνω από ", "FIND_IN_FILES_PAGING" : "{0}—{1}", "FIND_IN_FILES_FILE_PATH" : "{0} {2} {1}", // We shoudl use normal dashes on Windows instead of em dash eventually + "REPLACE_IN_FILES_ERRORS_TITLE" : "Αντικατάσταση λαθών", "ERROR_FETCHING_UPDATE_INFO_TITLE" : "Σφάλμα λήψης πληροφοριών αναβάθμισης", "ERROR_FETCHING_UPDATE_INFO_MSG" : "Προέκυψε σφάλμα κατά τη διαδικασία λήψης πληροφοριών της τελευταίας αναβάθμισης από τον server. Παρακαλούμε βεβαιωθείτε ότι είστε συνδεδεμένος στο internet και προσπαθήστε ξανά.", @@ -145,6 +162,7 @@ define({ "UNTITLED" : "Άτιτλο", "WORKING_FILES" : "Αρχεία Εργασίας", + /** * Keyboard modifier names */ @@ -160,6 +178,7 @@ define({ "STATUSBAR_SELECTION_CH_PLURAL" : " \u2014 επιλεγμένες {0} στήλες", "STATUSBAR_SELECTION_LINE_SINGULAR" : " \u2014 επιλεγμένη {0} γραμμή", "STATUSBAR_SELECTION_LINE_PLURAL" : " \u2014 επιλεγμένες {0} γραμμές", + "STATUSBAR_SELECTION_MULTIPLE" : " \u2014 {0} επιλογές", "STATUSBAR_INDENT_TOOLTIP_SPACES" : "Κάντε κλικ για να αλλάξετε τις εσοχές (indentation) σε κενά", "STATUSBAR_INDENT_TOOLTIP_TABS" : "Κάντε κλικ για να αλλάξετε τις εσοχές (indentation) σε tabs", "STATUSBAR_INDENT_SIZE_TOOLTIP_SPACES" : "Κάντε κλικ για να αλλάξετε τον αριθμό των κενών στις εσοχές", @@ -168,6 +187,9 @@ define({ "STATUSBAR_TAB_SIZE" : "Μέγεθος Tab:", "STATUSBAR_LINE_COUNT_SINGULAR" : "\u2014 {0} Γραμμή", "STATUSBAR_LINE_COUNT_PLURAL" : "\u2014 {0} Γραμμές", + "STATUSBAR_USER_EXTENSIONS_DISABLED" : "Οι επεκτάσεις απενεργοποιήθηκαν", + "STATUSBAR_LANG_TOOLTIP" : "Κάνε κλικ για να αλλάξεις τον τύπο του αρχείου", + "STATUSBAR_SET_DEFAULT_LANG" : "Ορισμός ως προεπιλογή για .{0} αρχεία", // CodeInspection: errors/warnings "SINGLE_ERROR" : "1 {0} Σφάλμα", @@ -176,7 +198,7 @@ define({ "LINT_DISABLED" : "Το Linting είναι απενεργοποιημένο", "NO_LINT_AVAILABLE" : "Δεν υπάρχει linter διαθέσιμος για {0}", "NOTHING_TO_LINT" : "Δεν υπάρχει κάτι για να γίνει lint", - + "LINTER_FAILED" : "{0} τερμάτισε με σφάλμα: {1}", /** * Command Name Constants @@ -188,7 +210,7 @@ define({ "CMD_FILE_NEW" : "Νέο Αρχείο", "CMD_FILE_NEW_FOLDER" : "Νέος Φάκελος", "CMD_FILE_OPEN" : "Άνοιγμα\u2026", - "CMD_ADD_TO_WORKING_SET" : "Πρόσθεση στα Αρχεία Εργασίας", + "CMD_ADD_TO_WORKING_SET" : "Προσθήκη στα Αρχεία Εργασίας", "CMD_OPEN_DROPPED_FILES" : "Άνοιγμα Αρχείων που ρίχτηκαν", "CMD_OPEN_FOLDER" : "Άνοιγμα Φακέλου\u2026", "CMD_FILE_CLOSE" : "Κλείσιμο", @@ -220,6 +242,8 @@ define({ "CMD_PASTE" : "Επικόλληση", "CMD_SELECT_ALL" : "Επιλογή Όλων", "CMD_SELECT_LINE" : "Επιλογή Γραμμής", + "CMD_ADD_CUR_TO_NEXT_LINE" : "Προσθήκη κέρσοσα στην επόμενη γραμμή", + "CMD_ADD_CUR_TO_PREV_LINE" : "Προσθήκη κέρσοσα στην προηγούμενη γραμμή", "CMD_FIND" : "Εύρεση", "CMD_FIND_IN_FILES" : "Εύρεση σε Αρχεία", "CMD_FIND_IN_SUBTREE" : "Εύρεση σε\u2026", @@ -271,6 +295,8 @@ define({ "CMD_CSS_QUICK_EDIT_NEW_RULE" : "Νέος Κανόνας", "CMD_NEXT_DOC" : "Επόμενο Έγγραφο", "CMD_PREV_DOC" : "Προηγούμενο Έγγραφο", + "CMD_NEXT_DOC_LIST_ORDER" : "Επόμενο έγγραφο στην λίστα", + "CMD_PREV_DOC_LIST_ORDER" : "Προηγούμενο έγγραφο στην λίστα", "CMD_SHOW_IN_TREE" : "Προβολή στο Δέντρο Αρχείων", "CMD_SHOW_IN_OS" : "Προβολή στο Λειτουργικό Σύστημα", @@ -278,10 +304,14 @@ define({ "HELP_MENU" : "Βοήθεια", "CMD_CHECK_FOR_UPDATE" : "Έλεγχος για Αναβαθμίσεις", "CMD_HOW_TO_USE_BRACKETS" : "Πώς να Χρησιμοποιήσετε το {APP_NAME}", + "CMD_SUPPORT" : "Υποστήριξη {APP_NAME}", "CMD_RELEASE_NOTES" : "Release Notes", + "CMD_SUGGEST" : "Πρότεινε Feature", + "CMD_HOMEPAGE" : "{APP_TITLE} Αρχική σελίδα", "CMD_SHOW_EXTENSIONS_FOLDER" : "Προβολή Φακέλου Επεκτάσεων", "CMD_TWITTER" : "{TWITTER_NAME} στο Twitter", "CMD_ABOUT" : "Σχετικά με το {APP_TITLE}", + "CMD_OPEN_PREFERENCES" : "Άνοιξε το αρχείο προτιμήσεων", // Strings for main-view.html "EXPERIMENTAL_BUILD" : "experimental build", @@ -324,16 +354,19 @@ define({ "UPDATE" : "Αναβάθμιση", "REMOVE" : "Κατάργηση", "OVERWRITE" : "Αντικατάσταση", + "DISABLE" : "Απενεργοποίηση", "CANT_REMOVE_DEV" : "Οι επεκτάσεις στο φάκελο \"dev\" πρέπει να διαγραφούν χειροκίνητα.", "CANT_UPDATE" : "Η αναβάθμιση δεν είναι συμβατή με αυτήν την έκδοση του {APP_NAME}.", + "CANT_UPDATE_DEV" : "Οι επεκτάσεις στον φάκελο \"dev\" δεν μπορούν να αναβαθμιστούν αυτόματα.", "INSTALL_EXTENSION_TITLE" : "Εγκατάσταση Επέκτασης", "UPDATE_EXTENSION_TITLE" : "Αναβάθμιση Επέκτασης", "INSTALL_EXTENSION_LABEL" : "URL Επέκτασης", "INSTALL_EXTENSION_HINT" : "URL αρχείου zip ή GitHub repo της επέκτασης", "INSTALLING_FROM" : "Εγκατάσταση επέκτασης από {0}\u2026", - "INSTALL_SUCCEEDED" : "Εγκατάσταση επιτυχής!", - "INSTALL_FAILED" : "Εγκατάσταση ανεπιτυχής.", + "INSTALL_SUCCEEDED" : "Επιτυχής Εγκατάσταση!", + "INSTALL_FAILED" : "Ανεπιτυχής Εγκατάσταση .", "CANCELING_INSTALL" : "Ακύρωση\u2026", + "VIEW_COMPLETE_DESCRIPTION" : "Προβολή αναλυτικής περιγραφής", "CANCELING_HUNG" : "Η ακύρωση της εγκατάστασης παίρνει πολύ ώρα. Κάποιο εσωτερικό σφάλμα μπορεί να έχει προκληθεί.", "INSTALL_CANCELED" : "Η εγκατάσταση ακυρώθηκε.", // These must match the error codes in ExtensionsDomain.Errors.* : @@ -407,13 +440,23 @@ define({ "DEBUG_MENU" : "Debug", "CMD_SHOW_DEV_TOOLS" : "Προβολή Developer Tools", "CMD_REFRESH_WINDOW" : "Επαναφόρτωση {APP_NAME}", + "CMD_RELOAD_WITHOUT_USER_EXTS" : "Επαναφόρτωση χωρίς τις επεκτάσεις", "CMD_NEW_BRACKETS_WINDOW" : "Νέο Παράθυρο {APP_NAME}", + "CMD_LAUNCH_SCRIPT_MAC" : "Εγκατάσταση συντόμευσης για την γραμμή εντολών", "CMD_SWITCH_LANGUAGE" : "Αλλαγή Γλώσσας", "CMD_RUN_UNIT_TESTS" : "Τρέξε Tests", "CMD_SHOW_PERF_DATA" : "Προβολή Δεδομένων Επίδοσης", "CMD_ENABLE_NODE_DEBUGGER" : "Ενεργοποίηση του Node Debugger", "CMD_LOG_NODE_STATE" : "Καταγραφή Node State στη Console", "CMD_RESTART_NODE" : "Επανεκκίνηση του Node", + "CMD_OPEN_BRACKETS_SOURCE" : "Άνοιξε τον κώδικα του {APP_NAME}", + + "CREATING_LAUNCH_SCRIPT_TITLE" : "{APP_NAME} Συντόμευση γραμμής εντολών", + "ERROR_CREATING_LAUNCH_SCRIPT" : "Ένα σφάλμα προέκυψε κατά την εγκατάσταση της συντόμευσης για την γραμμή εντολών. Παρακαλώ δοκίμασε αυτές τις προτείνομενες λύσεις.

    Αιτιολογία: {0}", + "ERROR_CLTOOLS_MKDIRFAILED" : "Αποτυχία δημιουργίας φακέλου του /usr/local/bin.", + "ERROR_CLTOOLS_SERVFAILED" : "Εσωτερικό σφάλμα.", + "ERROR_CLTOOLS_NOTSUPPORTED" : "Η συντόμευση για την γραμμή εντολών δεν υποστηρίζεται στο συγκεκριμένο λειτουργικό σύστημα.", + "LAUNCH_SCRIPT_CREATE_SUCCESS" : "Επιτυχία! Τώρα μπορείς εύκολα να τρέξεις το {APP_NAME} από την γραμμή εντολών: brackets myFile.txt για να ανοίξεις ένα αρχείο ή brackets myFolder για να αλλάξεις project.

    Μάθε περισσότεραγια το πώς να χρησιμοποιήσεις το {APP_NAME} από την γραμμή εντολών.", "LANGUAGE_TITLE" : "Αλλαγή Γλώσσας", "LANGUAGE_MESSAGE" : "Γλώσσες:", @@ -421,7 +464,17 @@ define({ "LANGUAGE_CANCEL" : "Ακύρωση", "LANGUAGE_SYSTEM_DEFAULT" : "Προεπιλογή Συστήματος", - // extensions/default/InlineTimingFunctionEditor + + // extensions/default/HealthData + "HEALTH_DATA_NOTIFICATION" : "Προτιμήσεις Health Report", + "HEALTH_FIRST_POPUP_TITLE" : "{APP_NAME} Health Report", + "HEALTH_DATA_DO_TRACK" : "Κοινοποίηση ανώνυμων πληροφοριών σχετικά με το πώς χρησιμοποιώ το {APP_NAME}", + "HEALTH_DATA_NOTIFICATION_MESSAGE" : "Προκειμένου να βελτιώσουμε το {APP_NAME}, στέλνουμε περιοδικά περιορισμένα, ανώνυμα στατιστικά στοιχεία στην Adobe σχετικά με το πώς χρησιμοποιείς το {APP_NAME}. Αυτές οι πληροφορίες βοηθάνε στην καταχώρηση προτεραιοτήτων στα χαρακτηριστικά,στην εύρεση σφαλμάτων και στον εντοπισμό προβλημάτων χρηστικότητας.

    Μπορείς να δεις τα δεδομένα σου ή να επιλέξεις να μην μοιραστείς κάποια επιλέγοντας Help > Health Report.

    Μάθε περισσότερα για το {APP_NAME} Health Report", + "HEALTH_DATA_PREVIEW" : "{APP_NAME} Health Report", + "HEALTH_DATA_PREVIEW_INTRO" : "

    Προκειμένου να βελτιώσουμε το {APP_NAME}, στέλνουμε περιοδικά περιορισμένα, ανώνυμα στατιστικά στοιχεία στην Adobe σχετικά με το πώς χρησιμοποιείς το {APP_NAME}. Αυτές οι πληροφορίες βοηθάνε στην καταχώρηση προτεραιοτήτων στα χαρακτηριστικά,στην εύρεση σφαλμάτων και στον εντοπισμό προβλημάτων χρηστικότητας. Μάθε περισσότερα για το {APP_NAME} Health Report και πόσο ωφελεί την κοινότητα του {APP_NAME} προστατεύοντας παράλληλα την ιδιωτικότητα σου..

    Παρακάτω βλέπεις μια προεπισκόπηση των δεδομένων που θα σταλούν στο επόμενο Health Report εφόσον είναι ενεργοποιημένο.

    ", + + + // extensions/default/InlineTimingFunctionEditor "INLINE_TIMING_EDITOR_TIME" : "Χρόνος", "INLINE_TIMING_EDITOR_PROGRESSION" : "Πρόοδος", @@ -451,3 +504,5 @@ define({ // extensions/default/WebPlatformDocs "DOCS_MORE_LINK" : "Διαβάστε Περισσότερα" }); + +/* Last translated for c16e34f867a027aa9b321f7ef1f4da106ce83edf */ From 24c99054fe27ba09e9d8db5e2e0506f5ba0fd854 Mon Sep 17 00:00:00 2001 From: Raymond Lim Date: Thu, 12 Jan 2017 23:55:25 -0800 Subject: [PATCH 036/151] Skip template literals (#13038) --- src/language/JSUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/language/JSUtils.js b/src/language/JSUtils.js index e0a172be377..e5c091b6150 100644 --- a/src/language/JSUtils.js +++ b/src/language/JSUtils.js @@ -137,7 +137,7 @@ define(function (require, exports, module) { } while (nextToken()) { - if (style !== "comment" && style !== "regexp" && style !== "string") { + if (style !== "comment" && style !== "regexp" && style !== "string" && style !== "string-2") { if (token === "{") { foundStartBrace = true; blockCount++; From a82f1a483754bb5e12d1b98e4f61c7334c64becc Mon Sep 17 00:00:00 2001 From: ficristo Date: Sat, 7 Jan 2017 11:31:48 +0100 Subject: [PATCH 037/151] Add a maxsize check for filetree resize and now it is possible to pass a percentage value --- src/htmlContent/main-view.html | 2 +- src/utils/Resizer.js | 70 +++++++++++++++++++++++++++++++++- 2 files changed, 69 insertions(+), 3 deletions(-) diff --git a/src/htmlContent/main-view.html b/src/htmlContent/main-view.html index 53c5c2ae3cb..5cf441c22dd 100644 --- a/src/htmlContent/main-view.html +++ b/src/htmlContent/main-view.html @@ -40,7 +40,7 @@
    -