From 8efafdfb97921a7fa30071078a008d41945fd16f Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Wed, 18 Jun 2014 00:36:48 +0200 Subject: [PATCH 001/120] Limit QuickView to literal color names in some languages --- src/extensions/default/QuickView/main.js | 32 ++++++++++--- .../default/QuickView/unittest-files/test.js | 10 +++++ src/extensions/default/QuickView/unittests.js | 45 +++++++++++++++++-- 3 files changed, 78 insertions(+), 9 deletions(-) create mode 100644 src/extensions/default/QuickView/unittest-files/test.js diff --git a/src/extensions/default/QuickView/main.js b/src/extensions/default/QuickView/main.js index 9c46dfb9252..dce1fc76396 100644 --- a/src/extensions/default/QuickView/main.js +++ b/src/extensions/default/QuickView/main.js @@ -37,7 +37,8 @@ define(function (require, exports, module) { Menus = brackets.getModule("command/Menus"), PreferencesManager = brackets.getModule("preferences/PreferencesManager"), Strings = brackets.getModule("strings"), - ViewUtils = brackets.getModule("utils/ViewUtils"); + ViewUtils = brackets.getModule("utils/ViewUtils"), + TokenUtils = brackets.getModule("utils/TokenUtils"); var previewContainerHTML = require("text!QuickViewTemplate.html"); @@ -53,6 +54,8 @@ define(function (require, exports, module) { POINTER_HEIGHT = 15, // Pointer height, used to shift popover above pointer (plus a little bit of space) POPOVER_HORZ_MARGIN = 5; // Horizontal margin + var literalLanguages = ["javascript", "php", "coffeescript"]; + prefs = PreferencesManager.getExtensionPrefs("quickview"); prefs.definePreference("enabled", "boolean", true); @@ -232,8 +235,10 @@ define(function (require, exports, module) { }; } - function execColorMatch(line) { - var colorMatch; + function execColorMatch(editor, line, pos) { + var colorMatch, + mode = TokenUtils.getModeAt(editor._codeMirror, pos).name, + literalCheck = literalLanguages.indexOf(mode) !== -1; function hyphenOnMatchBoundary(match, line) { var beforeIndex, afterIndex; @@ -251,11 +256,26 @@ define(function (require, exports, module) { return false; } + function checkForLiteral(match, line) { + if (match && match[0] && /^[a-z]+$/i.test(match[0])) { // only for color names, not for hex-/rgb-values + var beforeIndex = match.index - 1, + afterIndex = match.index + match[0].length; + + if (beforeIndex >= 0 && !/[\s"]/.test(line[beforeIndex])) { // not a literal, like Math.tan() + return true; + } + if (afterIndex < line.length && line[afterIndex] === "(") { // function, like green() + return true; + } + } + return false; + } // Hyphens do not count as a regex word boundary (\b), so check for those here do { colorMatch = colorRegEx.exec(line); - } while (colorMatch && hyphenOnMatchBoundary(colorMatch, line)); + } while (colorMatch && (hyphenOnMatchBoundary(colorMatch, line) || + (literalCheck && checkForLiteral(colorMatch, line)))); return colorMatch; } @@ -347,7 +367,7 @@ define(function (require, exports, module) { } var gradientMatch = execGradientMatch(line), - match = gradientMatch.match || execColorMatch(line), + match = gradientMatch.match || execColorMatch(editor, line, pos), cm = editor._codeMirror; while (match) { @@ -393,7 +413,7 @@ define(function (require, exports, module) { if (gradientMatch.match) { gradientMatch = execGradientMatch(line); } - match = gradientMatch.match || execColorMatch(line); + match = gradientMatch.match || execColorMatch(editor, line, pos); } return null; diff --git a/src/extensions/default/QuickView/unittest-files/test.js b/src/extensions/default/QuickView/unittest-files/test.js new file mode 100644 index 00000000000..2edb77ff7e2 --- /dev/null +++ b/src/extensions/default/QuickView/unittest-files/test.js @@ -0,0 +1,10 @@ +/* Sample JS for testing the QuickView extension. */ + +function green() { // generate green colors + var color = "green", + tan = Math.tan; + return tan(array["red"], array[red]); +} +darkgray +// #123456 +// :rgb(65, 43, 21) diff --git a/src/extensions/default/QuickView/unittests.js b/src/extensions/default/QuickView/unittests.js index 460e44284fe..586fb041cb3 100644 --- a/src/extensions/default/QuickView/unittests.js +++ b/src/extensions/default/QuickView/unittests.js @@ -41,7 +41,9 @@ define(function (require, exports, module) { Commands, EditorManager, QuickView, - editor; + editor, + testFile = "test.css", + oldFile; beforeEach(function () { // Create a new window that will be shared by ALL tests in this spec. @@ -62,13 +64,16 @@ define(function (require, exports, module) { runs(function () { SpecRunnerUtils.loadProjectInTestWindow(testFolder); }); + } + if (testFile !== oldFile) { runs(function () { - waitsForDone(SpecRunnerUtils.openProjectFiles(["test.css"]), "open test file"); + waitsForDone(SpecRunnerUtils.openProjectFiles([testFile]), "open test file: " + testFile); }); runs(function () { - editor = EditorManager.getCurrentFullEditor(); + editor = EditorManager.getCurrentFullEditor(); + oldFile = testFile; }); } }); @@ -191,9 +196,43 @@ define(function (require, exports, module) { expectNoPreviewAtPos(75, 18); // cursor on white in hyphenated word @bc-white }); }); + + describe("JavaScript file", function () { + runs(function () { + testFile = "test.js"; + }); + + it("should NOT show preview of color-named functions and object/array keys", function () { + runs(function () { + expectNoPreviewAtPos(2, 12); // cursor on green() + expectNoPreviewAtPos(4, 22); // cursor on Math.tan + expectNoPreviewAtPos(5, 14); // cursor on tan() + expectNoPreviewAtPos(5, 38); // cursor on array[red] + }); + }); + it("should show preview of literal color names", function () { + runs(function () { + checkColorAtPos("green", 2, 36); + checkColorAtPos("green", 3, 21); + checkColorAtPos("tan", 4, 11); + checkColorAtPos("red", 5, 25); + checkColorAtPos("darkgray", 7, 1); + }); + }); + it("should show preview of non-literal color codes", function () { + runs(function () { + checkColorAtPos("#123456", 8, 7); + checkColorAtPos("rgb(65, 43, 21)", 9, 8); + }); + }); + }); }); describe("Quick view gradients", function () { + runs(function () { + testFile = "test.css"; + }); + it("Should show linear gradient preview for those with vendor prefix", function () { runs(function () { var expectedGradient1 = "-webkit-linear-gradient(top, #d2dfed 0%, #c8d7eb 26%, #bed0ea 51%, #a6c0e3 51%, #afc7e8 62%, #bad0ef 75%, #99b5db 88%, #799bc8 100%)", From d4a5cb315704dff8d6f25c90fb3c83f375cfa8f3 Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Fri, 4 Jul 2014 20:59:59 +0200 Subject: [PATCH 002/120] Use whitelist instead of blacklist --- src/extensions/default/QuickView/main.js | 19 +++++-------------- src/extensions/default/QuickView/unittests.js | 12 ++++++------ 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/src/extensions/default/QuickView/main.js b/src/extensions/default/QuickView/main.js index dce1fc76396..96467c27705 100644 --- a/src/extensions/default/QuickView/main.js +++ b/src/extensions/default/QuickView/main.js @@ -54,7 +54,7 @@ define(function (require, exports, module) { POINTER_HEIGHT = 15, // Pointer height, used to shift popover above pointer (plus a little bit of space) POPOVER_HORZ_MARGIN = 5; // Horizontal margin - var literalLanguages = ["javascript", "php", "coffeescript"]; + var styleLanguages = ["css", "text/x-scss", "sass"]; prefs = PreferencesManager.getExtensionPrefs("quickview"); prefs.definePreference("enabled", "boolean", true); @@ -238,7 +238,7 @@ define(function (require, exports, module) { function execColorMatch(editor, line, pos) { var colorMatch, mode = TokenUtils.getModeAt(editor._codeMirror, pos).name, - literalCheck = literalLanguages.indexOf(mode) !== -1; + literalCheck = styleLanguages.indexOf(mode) === -1; function hyphenOnMatchBoundary(match, line) { var beforeIndex, afterIndex; @@ -256,26 +256,17 @@ define(function (require, exports, module) { return false; } - function checkForLiteral(match, line) { + function checkForLiteral(match) { if (match && match[0] && /^[a-z]+$/i.test(match[0])) { // only for color names, not for hex-/rgb-values - var beforeIndex = match.index - 1, - afterIndex = match.index + match[0].length; - - if (beforeIndex >= 0 && !/[\s"]/.test(line[beforeIndex])) { // not a literal, like Math.tan() - return true; - } - if (afterIndex < line.length && line[afterIndex] === "(") { // function, like green() - return true; - } + return true; } - return false; } // Hyphens do not count as a regex word boundary (\b), so check for those here do { colorMatch = colorRegEx.exec(line); } while (colorMatch && (hyphenOnMatchBoundary(colorMatch, line) || - (literalCheck && checkForLiteral(colorMatch, line)))); + (literalCheck && checkForLiteral(colorMatch)))); return colorMatch; } diff --git a/src/extensions/default/QuickView/unittests.js b/src/extensions/default/QuickView/unittests.js index 586fb041cb3..fe22393c074 100644 --- a/src/extensions/default/QuickView/unittests.js +++ b/src/extensions/default/QuickView/unittests.js @@ -210,13 +210,13 @@ define(function (require, exports, module) { expectNoPreviewAtPos(5, 38); // cursor on array[red] }); }); - it("should show preview of literal color names", function () { + it("should not show preview of literal color names", function () { runs(function () { - checkColorAtPos("green", 2, 36); - checkColorAtPos("green", 3, 21); - checkColorAtPos("tan", 4, 11); - checkColorAtPos("red", 5, 25); - checkColorAtPos("darkgray", 7, 1); + expectNoPreviewAtPos(2, 36); // green + expectNoPreviewAtPos(3, 21); // green + expectNoPreviewAtPos(4, 11); // tan + expectNoPreviewAtPos(5, 25); // red + expectNoPreviewAtPos(7, 1); // darkgray }); }); it("should show preview of non-literal color codes", function () { From 72584d60dce2b42262c098bb4e6e797aff9d5fc6 Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Sat, 5 Jul 2014 22:06:37 +0200 Subject: [PATCH 003/120] Only call getModeAt if needed --- src/extensions/default/QuickView/main.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/extensions/default/QuickView/main.js b/src/extensions/default/QuickView/main.js index 96467c27705..d65eed3b23b 100644 --- a/src/extensions/default/QuickView/main.js +++ b/src/extensions/default/QuickView/main.js @@ -237,8 +237,7 @@ define(function (require, exports, module) { function execColorMatch(editor, line, pos) { var colorMatch, - mode = TokenUtils.getModeAt(editor._codeMirror, pos).name, - literalCheck = styleLanguages.indexOf(mode) === -1; + literalCheck; function hyphenOnMatchBoundary(match, line) { var beforeIndex, afterIndex; @@ -265,8 +264,15 @@ define(function (require, exports, module) { // Hyphens do not count as a regex word boundary (\b), so check for those here do { colorMatch = colorRegEx.exec(line); - } while (colorMatch && (hyphenOnMatchBoundary(colorMatch, line) || - (literalCheck && checkForLiteral(colorMatch)))); + if (!colorMatch) { + break; + } + if (literalCheck === undefined) { + var mode = TokenUtils.getModeAt(editor._codeMirror, pos).name; + literalCheck = styleLanguages.indexOf(mode) === -1; + } + } while (hyphenOnMatchBoundary(colorMatch, line) || + (literalCheck && checkForLiteral(colorMatch))); return colorMatch; } From 6f268cce8cf538371399f34603ac73532cbe51b8 Mon Sep 17 00:00:00 2001 From: Peter Flynn Date: Tue, 5 Aug 2014 01:29:45 -0700 Subject: [PATCH 004/120] Show cause of error when opening drag-&-dropped files fails. Plumb the error code back from the FILE_OPEN command, and display errors in the existing bullet list error dialog used by DragAndDrop. --- src/document/DocumentCommandHandlers.js | 13 ++++++------- src/file/FileUtils.js | 9 +++++++++ src/nls/root/strings.js | 1 + src/utils/DragAndDrop.js | 22 ++++++++++++++++------ 4 files changed, 32 insertions(+), 13 deletions(-) diff --git a/src/document/DocumentCommandHandlers.js b/src/document/DocumentCommandHandlers.js index dfc9312ac93..eae664d3748 100644 --- a/src/document/DocumentCommandHandlers.js +++ b/src/document/DocumentCommandHandlers.js @@ -241,7 +241,7 @@ define(function (require, exports, module) { * @return {$.Promise} a jQuery promise that will either * - be resolved with a document for the specified file path or * - be resolved without document, i.e. when an image is displayed or - * - be rejected if the file can not be read. + * - be rejected with FileSystemError if the file can not be read. */ function doOpen(fullPath, silent) { var result = new $.Deferred(); @@ -255,7 +255,7 @@ define(function (require, exports, module) { return result.promise(); } - function _cleanup(fullFilePath) { + function _cleanup(fileError, fullFilePath) { if (!fullFilePath || EditorManager.showingCustomViewerForPath(fullFilePath)) { // We get here only after the user renames a file that makes it no longer belong to a // custom viewer but the file is still showing in the current custom viewer. This only @@ -270,21 +270,20 @@ define(function (require, exports, module) { DocumentManager.removeFromWorkingSet(FileSystem.getFileForPath(fullFilePath)); EditorManager.focusEditor(); } - result.reject(); + result.reject(fileError); } function _showErrorAndCleanUp(fileError, fullFilePath) { if (silent) { - _cleanup(fullFilePath); + _cleanup(fileError, fullFilePath); } else { FileUtils.showFileOpenError(fileError, fullFilePath).done(function () { - _cleanup(fullFilePath); + _cleanup(fileError, fullFilePath); }); } } if (!fullPath) { - console.error("doOpen() called without fullPath"); - result.reject(); + throw new Error("doOpen() called without fullPath"); } else { var perfTimerName = PerfUtils.markStart("Open File:\t" + fullPath); result.always(function () { diff --git a/src/file/FileUtils.js b/src/file/FileUtils.js index 4e503326e2c..8dddb1ed2f5 100644 --- a/src/file/FileUtils.js +++ b/src/file/FileUtils.js @@ -149,6 +149,10 @@ define(function (require, exports, module) { return text.replace(findAnyEol, eolStr); } + /** + * @param {!FileSystemError} name + * @return {!string} User-friendly, localized error message + */ function getFileErrorString(name) { // There are a few error codes that we have specific error messages for. The rest are // displayed with a generic "(error N)" message. @@ -171,6 +175,11 @@ define(function (require, exports, module) { return result; } + /** + * Shows an error dialog indicating that the given file could not be opened due to the given error + * @param {!FileSystemError} name + * @return {!Dialog} + */ function showFileOpenError(name, path) { return Dialogs.showModalDialog( DefaultDialogs.DIALOG_ID_ERROR, diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 7c4dc293ae4..cce9d6fb0e8 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -72,6 +72,7 @@ define({ "ENTRY_WITH_SAME_NAME_EXISTS" : "A file or directory with the name {0} already exists.", "ERROR_CREATING_FILE_TITLE" : "Error Creating {0}", "ERROR_CREATING_FILE" : "An error occurred when trying to create the {0} {1}. {2}", + "ERROR_MIXED_DRAGDROP" : "Cannot open a folder at the same time as opening other files.", // Application preferences corrupt error strings "ERROR_PREFS_CORRUPT_TITLE" : "Error Reading Preferences", diff --git a/src/utils/DragAndDrop.js b/src/utils/DragAndDrop.js index 3a5dbf3ee59..50ab28e9c47 100644 --- a/src/utils/DragAndDrop.js +++ b/src/utils/DragAndDrop.js @@ -99,6 +99,7 @@ define(function (require, exports, module) { */ function openDroppedFiles(files) { var errorFiles = [], + ERR_MULTIPLE_ITEMS_WITH_DIR = {}, filteredFiles = filterFilesToOpen(files); return Async.doInParallel(filteredFiles, function (path, idx) { @@ -122,8 +123,8 @@ define(function (require, exports, module) { .done(function () { result.resolve(); }) - .fail(function () { - errorFiles.push(path); + .fail(function (openErr) { + errorFiles.push({path: path, error: openErr}); result.reject(); }); } else if (!err && item.isDirectory && filteredFiles.length === 1) { @@ -137,7 +138,7 @@ define(function (require, exports, module) { result.reject(); }); } else { - errorFiles.push(path); + errorFiles.push({path: path, error: err || ERR_MULTIPLE_ITEMS_WITH_DIR}); result.reject(); } }); @@ -145,14 +146,23 @@ define(function (require, exports, module) { return result.promise(); }, false) .fail(function () { + function errorToString(err) { + if (err === ERR_MULTIPLE_ITEMS_WITH_DIR) { + return Strings.ERROR_MIXED_DRAGDROP; + } else { + return FileUtils.getFileErrorString(err); + } + } + if (errorFiles.length > 0) { var message = Strings.ERROR_OPENING_FILES; message += "
    "; - errorFiles.forEach(function (file) { + errorFiles.forEach(function (info) { message += "
  • " + - StringUtils.breakableUrl(ProjectManager.makeProjectRelativeIfPossible(file)) + - "
  • "; + StringUtils.breakableUrl(ProjectManager.makeProjectRelativeIfPossible(info.path)) + + " - " + errorToString(info.error) + + ""; }); message += "
"; From 64a418c4acd5a95c4abf06391705c95d3a24ccd6 Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Wed, 6 Aug 2014 11:44:07 +0200 Subject: [PATCH 005/120] Renamed var & method --- src/extensions/default/QuickView/main.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/extensions/default/QuickView/main.js b/src/extensions/default/QuickView/main.js index dd4a0657d79..e519605e1f1 100644 --- a/src/extensions/default/QuickView/main.js +++ b/src/extensions/default/QuickView/main.js @@ -237,7 +237,7 @@ define(function (require, exports, module) { function execColorMatch(editor, line, pos) { var colorMatch, - literalCheck; + ignoreNamedColors; function hyphenOnMatchBoundary(match, line) { var beforeIndex, afterIndex; @@ -255,7 +255,7 @@ define(function (require, exports, module) { return false; } - function checkForLiteral(match) { + function isNamedColor(match) { if (match && match[0] && /^[a-z]+$/i.test(match[0])) { // only for color names, not for hex-/rgb-values return true; } @@ -267,12 +267,12 @@ define(function (require, exports, module) { if (!colorMatch) { break; } - if (literalCheck === undefined) { + if (ignoreNamedColors === undefined) { var mode = TokenUtils.getModeAt(editor._codeMirror, pos).name; - literalCheck = styleLanguages.indexOf(mode) === -1; + ignoreNamedColors = styleLanguages.indexOf(mode) === -1; } } while (hyphenOnMatchBoundary(colorMatch, line) || - (literalCheck && checkForLiteral(colorMatch))); + (ignoreNamedColors && isNamedColor(colorMatch))); return colorMatch; } From e28cad61117af2768b90a0db5df6b7d63898feb5 Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Thu, 7 Aug 2014 01:31:40 +0200 Subject: [PATCH 006/120] Sprint -> Release --- Gruntfile.js | 6 +-- .../default/HTMLCodeHints/unittests.js | 2 +- src/language/CSSUtils.js | 6 +-- src/nls/root/strings.js | 2 +- src/utils/BuildInfoUtils.js | 4 +- src/utils/UpdateNotification.js | 2 +- tasks/build.js | 2 +- ...int-number.js => update-release-number.js} | 42 +++++++++---------- 8 files changed, 33 insertions(+), 33 deletions(-) rename tasks/{update-sprint-number.js => update-release-number.js} (76%) diff --git a/Gruntfile.js b/Gruntfile.js index 9cf1ac7f24f..28823e24b34 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -312,9 +312,9 @@ module.exports = function (grunt) { grunt.registerTask('test', ['jshint:all', 'jasmine']); // grunt.registerTask('test', ['jshint:all', 'jasmine', 'jasmine_node']); - // task: set-sprint - // Update sprint number in package.json and rewrite src/config.json - grunt.registerTask('set-sprint', ['update-sprint-number', 'write-config']); + // task: set-release + // Update version number in package.json and rewrite src/config.json + grunt.registerTask('set-release', ['update-release-number', 'write-config']); // task: build grunt.registerTask('build', [ diff --git a/src/extensions/default/HTMLCodeHints/unittests.js b/src/extensions/default/HTMLCodeHints/unittests.js index 0a0e5cc55a0..1033255ea64 100644 --- a/src/extensions/default/HTMLCodeHints/unittests.js +++ b/src/extensions/default/HTMLCodeHints/unittests.js @@ -447,7 +447,7 @@ define(function (require, exports, module) { // Expect no filtering - however, we offer some attributes (including first in the list) that // are specific to the tag, so we can't use the default "no filtering" empty arg here. - // (This smart filtering isn't officially part of the sprint, so no unit tests specifically + // (This smart filtering isn't officially part of the release, so no unit tests specifically // targeting that functionality yet). verifyAttrHints(hintList, "accept"); }); diff --git a/src/language/CSSUtils.js b/src/language/CSSUtils.js index f7704c26d19..6d242c2cd67 100644 --- a/src/language/CSSUtils.js +++ b/src/language/CSSUtils.js @@ -1018,7 +1018,7 @@ define(function (require, exports, module) { * Finds all instances of the specified selector in "text". * Returns an Array of Objects with start and end properties. * - * For Sprint 4, we only support simple selectors. This function will need to change + * For now, we only support simple selectors. This function will need to change * dramatically to support full selectors. * * FUTURE: (JRB) It would be nice to eventually use the browser/jquery to do the selector evaluation. @@ -1038,7 +1038,7 @@ define(function (require, exports, module) { var result = []; var i; - // For sprint 4 we only match the rightmost simple selector, and ignore + // For now, we only match the rightmost simple selector, and ignore // attribute selectors and pseudo selectors var classOrIdSelector = selector[0] === "." || selector[0] === "#"; var prefix = ""; @@ -1147,7 +1147,7 @@ define(function (require, exports, module) { /** * Return all rules matching the specified selector. - * For Sprint 4, we only look at the rightmost simple selector. For example, searching for ".foo" will + * For now, we only look at the rightmost simple selector. For example, searching for ".foo" will * match these rules: * .foo {} * div .foo {} diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 6d74adde667..4658c50ff7b 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -403,7 +403,7 @@ define({ "RELAUNCH_CHROME" : "Relaunch Chrome", "ABOUT" : "About", "CLOSE" : "Close", - "ABOUT_TEXT_LINE1" : "sprint {VERSION_MINOR} {BUILD_TYPE} {VERSION}", + "ABOUT_TEXT_LINE1" : "release {VERSION_MAJOR}.{VERSION_MINOR} {BUILD_TYPE} {VERSION}", "ABOUT_TEXT_BUILD_TIMESTAMP" : "build timestamp: ", "ABOUT_TEXT_LINE3" : "Notices, terms and conditions pertaining to third party software are located at {ADOBE_THIRD_PARTY} and incorporated by reference herein.", "ABOUT_TEXT_LINE4" : "Documentation and source at https://github.com/adobe/brackets/", diff --git a/src/utils/BuildInfoUtils.js b/src/utils/BuildInfoUtils.js index 7b7f7449a0e..c989b3a8e63 100644 --- a/src/utils/BuildInfoUtils.js +++ b/src/utils/BuildInfoUtils.js @@ -85,7 +85,7 @@ define(function (require, exports, module) { // Look for Git metadata on disk to load the SHAs for 'brackets'. Done on // startup instead of on demand because the version that's currently running is what was // loaded at startup (the src on disk may be updated to a different version later). - // Git metadata may be missing (e.g. in the per-sprint ZIP builds) - silently ignore if so. + // Git metadata may be missing (e.g. in the release builds) - silently ignore if so. var bracketsSrc = FileUtils.getNativeBracketsDirectoryPath(); // Assumes Brackets is a standalone repo and not a submodule (prior to brackets-shell, @@ -107,4 +107,4 @@ define(function (require, exports, module) { // FIXME (jasonsanjose): Since the move to brackets-shell, can't reliably get SHA for shell. // exports._getBracketsShellSHA = getBracketsShellSHA; -}); \ No newline at end of file +}); diff --git a/src/utils/UpdateNotification.js b/src/utils/UpdateNotification.js index 8a3d0b8bcf1..30f8b58067f 100644 --- a/src/utils/UpdateNotification.js +++ b/src/utils/UpdateNotification.js @@ -75,7 +75,7 @@ define(function (require, exports, module) { // an Object with the following fields: // // {Number} buildNumber Number of the build - // {String} versionString String representation of the build number (ie "Sprint 14") + // {String} versionString String representation of the build number (ie "Release 0.40") // {String} dateString Date of the build // {String} releaseNotesURL URL of the release notes for this build // {String} downloadURL URL to download this build diff --git a/tasks/build.js b/tasks/build.js index 7d76f93b283..bf3dd1a2894 100644 --- a/tasks/build.js +++ b/tasks/build.js @@ -40,7 +40,7 @@ module.exports = function (grunt) { json = {}; // count the number of commits for our version number - // ..- + // ..- return qexec("git log --format=%h", opts).then(function (stdout) { json.commits = stdout.toString().match(/[0-9a-f]\n/g).length; diff --git a/tasks/update-sprint-number.js b/tasks/update-release-number.js similarity index 76% rename from tasks/update-sprint-number.js rename to tasks/update-release-number.js index ebb24a83e71..1f25a88a634 100644 --- a/tasks/update-sprint-number.js +++ b/tasks/update-release-number.js @@ -1,24 +1,24 @@ /* * Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - * + * */ /*global module, require*/ @@ -26,21 +26,21 @@ module.exports = function (grunt) { "use strict"; var common = require("./lib/common")(grunt); - - // task: update-sprint-number + + // task: update-release-number // Updates the version property in package.json - grunt.registerTask('update-sprint-number', function () { + grunt.registerTask('update-release-number', function () { var path = "package.json", packageJSON = grunt.file.readJSON(path), - sprint = grunt.option("sprint") || 0, + release = grunt.option("release") || 0, versionNumberRegexp = /([0-9]+\.)([0-9]+)([\.\-a-zA-Z0-9]*)?/; - if (!sprint) { - grunt.fail.fatal("Please specify a sprint. e.g. grunt update-sprint-number --sprint=21"); + if (!release) { + grunt.fail.fatal("Please specify a release. e.g. grunt update-release-number --release=40"); } - - packageJSON.version = packageJSON.version.replace(versionNumberRegexp, "$1" + sprint + "$3"); - packageJSON.apiVersion = packageJSON.apiVersion.replace(versionNumberRegexp, "$1" + sprint + "$3"); + + packageJSON.version = packageJSON.version.replace(versionNumberRegexp, "$1" + release + "$3"); + packageJSON.apiVersion = packageJSON.apiVersion.replace(versionNumberRegexp, "$1" + release + "$3"); common.writeJSON(grunt, path, packageJSON); }); From 13fb6ae56b43c6abb7ca3f70e1599110bf9a42ec Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Thu, 7 Aug 2014 14:26:49 +0200 Subject: [PATCH 007/120] Uppercase Release --- src/nls/root/strings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 4658c50ff7b..029ef88a320 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -403,7 +403,7 @@ define({ "RELAUNCH_CHROME" : "Relaunch Chrome", "ABOUT" : "About", "CLOSE" : "Close", - "ABOUT_TEXT_LINE1" : "release {VERSION_MAJOR}.{VERSION_MINOR} {BUILD_TYPE} {VERSION}", + "ABOUT_TEXT_LINE1" : "Release {VERSION_MAJOR}.{VERSION_MINOR} {BUILD_TYPE} {VERSION}", "ABOUT_TEXT_BUILD_TIMESTAMP" : "build timestamp: ", "ABOUT_TEXT_LINE3" : "Notices, terms and conditions pertaining to third party software are located at {ADOBE_THIRD_PARTY} and incorporated by reference herein.", "ABOUT_TEXT_LINE4" : "Documentation and source at https://github.com/adobe/brackets/", From 015fa27fa0916781bf2bf74265b5c7c5131effee Mon Sep 17 00:00:00 2001 From: Randy Edmunds Date: Tue, 12 Aug 2014 09:14:40 -0700 Subject: [PATCH 008/120] add link to troubleshooting page to live preview error messages --- src/LiveDevelopment/LiveDevelopment.js | 26 +++++++++++++++----------- src/nls/root/strings.js | 6 +++--- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/LiveDevelopment/LiveDevelopment.js b/src/LiveDevelopment/LiveDevelopment.js index 3ef3d82f76c..75759684c25 100644 --- a/src/LiveDevelopment/LiveDevelopment.js +++ b/src/LiveDevelopment/LiveDevelopment.js @@ -619,7 +619,7 @@ define(function LiveDevelopment(require, exports, module) { Dialogs.showModalDialog( Dialogs.DIALOG_ID_ERROR, Strings.LIVE_DEVELOPMENT_ERROR_TITLE, - Strings.LIVE_DEV_LOADING_ERROR_MESSAGE + _append(Strings.LIVE_DEV_LOADING_ERROR_MESSAGE) ); }) .always(function () { @@ -1042,6 +1042,15 @@ define(function LiveDevelopment(require, exports, module) { }); } + /** + * Append a message to direct users to the troubleshooting page + * @param {string} msg Original message + * @return {string} Original message plus link to troubleshooting page. + */ + function _appendTroubleshootingMessage(msg) { + return msg + " " + StringUtils.format(Strings.LIVE_DEVELOPMENT_TROUBLESHOOTING, brackets.config.troubleshoot_url); + } + /** Triggered by Inspector.connect */ function _onConnect(event) { // When the browser navigates away from the primary live document @@ -1057,7 +1066,7 @@ define(function LiveDevelopment(require, exports, module) { Dialogs.showModalDialog( DefaultDialogs.DIALOG_ID_ERROR, Strings.LIVE_DEVELOPMENT_ERROR_TITLE, - Strings.LIVE_DEV_LOADING_ERROR_MESSAGE + _appendTroubleshootingMessage(Strings.LIVE_DEV_LOADING_ERROR_MESSAGE) ); }) .done(_onInterstitialPageLoad); @@ -1067,7 +1076,7 @@ define(function LiveDevelopment(require, exports, module) { Dialogs.showModalDialog( DefaultDialogs.DIALOG_ID_ERROR, Strings.LIVE_DEVELOPMENT_ERROR_TITLE, - Strings.LIVE_DEV_NEED_HTML_MESSAGE + _appendTroubleshootingMessage(Strings.LIVE_DEV_NEED_HTML_MESSAGE) ); _openDeferred.reject(); } @@ -1076,7 +1085,7 @@ define(function LiveDevelopment(require, exports, module) { Dialogs.showModalDialog( DefaultDialogs.DIALOG_ID_ERROR, Strings.LIVE_DEVELOPMENT_ERROR_TITLE, - Strings.LIVE_DEV_SERVER_NOT_READY_MESSAGE + _appendTroubleshootingMessage(Strings.LIVE_DEV_SERVER_NOT_READY_MESSAGE) ); _openDeferred.reject(); } @@ -1098,7 +1107,7 @@ define(function LiveDevelopment(require, exports, module) { var dialogPromise = Dialogs.showModalDialog( DefaultDialogs.DIALOG_ID_LIVE_DEVELOPMENT, Strings.LIVE_DEVELOPMENT_RELAUNCH_TITLE, - Strings.LIVE_DEVELOPMENT_ERROR_MESSAGE, + _appendTroubleshootingMessage(Strings.LIVE_DEVELOPMENT_ERROR_MESSAGE), [ { className: Dialogs.DIALOG_BTN_CLASS_LEFT, @@ -1166,15 +1175,10 @@ define(function LiveDevelopment(require, exports, module) { message = StringUtils.format(Strings.ERROR_LAUNCHING_BROWSER, err); } - // Append a message to direct users to the troubleshooting page. - if (message) { - message += " " + StringUtils.format(Strings.LIVE_DEVELOPMENT_TROUBLESHOOTING, brackets.config.troubleshoot_url); - } - Dialogs.showModalDialog( DefaultDialogs.DIALOG_ID_ERROR, Strings.ERROR_LAUNCHING_BROWSER_TITLE, - message + _appendTroubleshootingMessage(message) ); _openDeferred.reject("OPEN_LIVE_BROWSER"); diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 81839ac07c8..53394685098 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -92,11 +92,11 @@ define({ "LIVE_DEVELOPMENT_ERROR_TITLE" : "Live Preview Error", "LIVE_DEVELOPMENT_RELAUNCH_TITLE" : "Connecting to Browser", - "LIVE_DEVELOPMENT_ERROR_MESSAGE" : "In order for Live Preview to connect, Chrome needs to be relaunched with remote debugging enabled.

Would you like to relaunch Chrome and enable remote debugging?", - "LIVE_DEV_LOADING_ERROR_MESSAGE" : "Unable to load Live Preview page", + "LIVE_DEVELOPMENT_ERROR_MESSAGE" : "In order for Live Preview to connect, Chrome needs to be relaunched with remote debugging enabled.

Would you like to relaunch Chrome and enable remote debugging?

", + "LIVE_DEV_LOADING_ERROR_MESSAGE" : "Unable to load Live Preview page.", "LIVE_DEV_NEED_HTML_MESSAGE" : "Open an HTML file or make sure there is an index.html file in your project in order to launch live preview.", "LIVE_DEV_NEED_BASEURL_MESSAGE" : "To launch live preview with a server-side file, you need to specify a Base URL for this project.", - "LIVE_DEV_SERVER_NOT_READY_MESSAGE" : "Error starting up the HTTP server for live preview files. Please try again.", + "LIVE_DEV_SERVER_NOT_READY_MESSAGE" : "Error starting up the HTTP server for live preview files.", "LIVE_DEVELOPMENT_INFO_TITLE" : "Welcome to Live Preview!", "LIVE_DEVELOPMENT_INFO_MESSAGE" : "Live Preview connects {APP_NAME} to your browser. It launches a preview of your HTML file in the browser, then updates the preview instantly as you edit your code.

In this early version of {APP_NAME}, Live Preview only works with Google Chrome and updates live as you edit CSS or HTML files. Changes to JavaScript files are automatically reloaded when you save.

(You'll only see this message once.)", "LIVE_DEVELOPMENT_TROUBLESHOOTING" : "For more information, see Troubleshooting Live Preview connection errors.", From f62fec673ebebc187000e853dad18a9bddc5d0f7 Mon Sep 17 00:00:00 2001 From: Randy Edmunds Date: Tue, 12 Aug 2014 09:17:21 -0700 Subject: [PATCH 009/120] restore string --- src/nls/root/strings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 53394685098..0ea69539de6 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -96,7 +96,7 @@ define({ "LIVE_DEV_LOADING_ERROR_MESSAGE" : "Unable to load Live Preview page.", "LIVE_DEV_NEED_HTML_MESSAGE" : "Open an HTML file or make sure there is an index.html file in your project in order to launch live preview.", "LIVE_DEV_NEED_BASEURL_MESSAGE" : "To launch live preview with a server-side file, you need to specify a Base URL for this project.", - "LIVE_DEV_SERVER_NOT_READY_MESSAGE" : "Error starting up the HTTP server for live preview files.", + "LIVE_DEV_SERVER_NOT_READY_MESSAGE" : "Error starting up the HTTP server for live preview files. Please try again.", "LIVE_DEVELOPMENT_INFO_TITLE" : "Welcome to Live Preview!", "LIVE_DEVELOPMENT_INFO_MESSAGE" : "Live Preview connects {APP_NAME} to your browser. It launches a preview of your HTML file in the browser, then updates the preview instantly as you edit your code.

In this early version of {APP_NAME}, Live Preview only works with Google Chrome and updates live as you edit CSS or HTML files. Changes to JavaScript files are automatically reloaded when you save.

(You'll only see this message once.)", "LIVE_DEVELOPMENT_TROUBLESHOOTING" : "For more information, see Troubleshooting Live Preview connection errors.", From a7f41627f1c9607479484c19c878b1ff6d140e5b Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Wed, 13 Aug 2014 01:34:31 +0200 Subject: [PATCH 010/120] Quick Docs: Ignore vendor prefixes if needed --- src/extensions/default/WebPlatformDocs/main.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/extensions/default/WebPlatformDocs/main.js b/src/extensions/default/WebPlatformDocs/main.js index 6fe18a8dec0..ca9e1915b74 100644 --- a/src/extensions/default/WebPlatformDocs/main.js +++ b/src/extensions/default/WebPlatformDocs/main.js @@ -110,6 +110,10 @@ define(function (require, exports, module) { .done(function (cssDocs) { // Construct inline widget (if we have docs for this property) var cssPropDetails = cssDocs.PROPERTIES["css/properties/" + cssPropName]; + if (!cssPropDetails) { + cssPropName = cssPropName.replace(/^-\w+-/, ""); // remove possible vendor prefixes + cssPropDetails = cssDocs.PROPERTIES["css/properties/" + cssPropName]; + } if (cssPropDetails) { var inlineWidget = new InlineDocsViewer(cssPropName, cssPropDetails); inlineWidget.load(hostEditor); From 0efd0114c2574288bd2ab60ad28adc7f9992772d Mon Sep 17 00:00:00 2001 From: Randy Edmunds Date: Fri, 15 Aug 2014 09:11:36 -0700 Subject: [PATCH 011/120] fix typo --- src/LiveDevelopment/LiveDevelopment.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/LiveDevelopment/LiveDevelopment.js b/src/LiveDevelopment/LiveDevelopment.js index 75759684c25..e7f3d9344d9 100644 --- a/src/LiveDevelopment/LiveDevelopment.js +++ b/src/LiveDevelopment/LiveDevelopment.js @@ -262,6 +262,16 @@ define(function LiveDevelopment(require, exports, module) { }); } + /** + * @private + * Append a message to direct users to the troubleshooting page + * @param {string} msg Original message + * @return {string} Original message plus link to troubleshooting page. + */ + function _appendTroubleshootingMessage(msg) { + return msg + " " + StringUtils.format(Strings.LIVE_DEVELOPMENT_TROUBLESHOOTING, brackets.config.troubleshoot_url); + } + /** * @private * Close a live document @@ -619,7 +629,7 @@ define(function LiveDevelopment(require, exports, module) { Dialogs.showModalDialog( Dialogs.DIALOG_ID_ERROR, Strings.LIVE_DEVELOPMENT_ERROR_TITLE, - _append(Strings.LIVE_DEV_LOADING_ERROR_MESSAGE) + _appendTroubleshootingMessage(Strings.LIVE_DEV_LOADING_ERROR_MESSAGE) ); }) .always(function () { @@ -1042,15 +1052,6 @@ define(function LiveDevelopment(require, exports, module) { }); } - /** - * Append a message to direct users to the troubleshooting page - * @param {string} msg Original message - * @return {string} Original message plus link to troubleshooting page. - */ - function _appendTroubleshootingMessage(msg) { - return msg + " " + StringUtils.format(Strings.LIVE_DEVELOPMENT_TROUBLESHOOTING, brackets.config.troubleshoot_url); - } - /** Triggered by Inspector.connect */ function _onConnect(event) { // When the browser navigates away from the primary live document From 5a74b820debb299e04027abcc0c5dd503359e078 Mon Sep 17 00:00:00 2001 From: Peter Flynn Date: Thu, 21 Aug 2014 22:47:48 -0700 Subject: [PATCH 012/120] Add unit test to verify that FILE_OPEN command now returns error code when it fails. Also, cleanup: group image-related tests into a single describe() instead of a separate one per it(). --- test/spec/DocumentCommandHandlers-test.js | 38 +++++++++++++++-------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/test/spec/DocumentCommandHandlers-test.js b/test/spec/DocumentCommandHandlers-test.js index 6e5f160f6e9..116794acc0d 100644 --- a/test/spec/DocumentCommandHandlers-test.js +++ b/test/spec/DocumentCommandHandlers-test.js @@ -40,6 +40,7 @@ define(function (require, exports, module) { SpecRunnerUtils = require("spec/SpecRunnerUtils"), FileUtils = require("file/FileUtils"), StringUtils = require("utils/StringUtils"), + FileSystemError = require("filesystem/FileSystemError"), Editor = require("editor/Editor"); @@ -670,6 +671,25 @@ define(function (require, exports, module) { expect(DocumentManager.getCurrentDocument().getText()).toBe(TEST_JS_CONTENT); }); }); + + it("should resolve with FileSystemError when opening fails", function () { + runs(function () { + // Dismiss expected error dialog instantly so promise completes & test can proceed + spyOn(Dialogs, "showModalDialog").andCallFake(function (dlgClass, title, message, buttons) { + return {done: function (callback) { callback(Dialogs.DIALOG_BTN_OK); } }; + }); + + // Open nonexistent file to trigger error result + var promise = CommandManager.execute(Commands.FILE_OPEN, {fullPath: testPath + "/doesNotExist.js"}); + waitsForFail(promise, "FILE_OPEN"); + promise.fail(function (err) { + expect(err).toEqual(FileSystemError.NOT_FOUND); + }); + }); + runs(function () { + expect(DocumentManager.getCurrentDocument()).toBeNull(); + }); + }); }); describe("Save File", function () { @@ -1102,7 +1122,7 @@ define(function (require, exports, module) { }); }); - describe("Opens image file and validates EditorManager APIs", function () { + describe("Open image files", function () { it("should return null after opening an image", function () { var path = testPath + "/couz.png", promise; @@ -1120,10 +1140,8 @@ define(function (require, exports, module) { expect(d).toEqual(null); }); }); - }); - describe("Open image file while a text file is open", function () { - it("should fire currentDocumentChange and activeEditorChange events", function () { + it("opening image while text file open should fire currentDocumentChange and activeEditorChange events", function () { var promise, docChangeListener = jasmine.createSpy(), activeEditorChangeListener = jasmine.createSpy(); @@ -1152,10 +1170,8 @@ define(function (require, exports, module) { _$(EditorManager).off("activeEditorChange", activeEditorChangeListener); }); }); - }); - - describe("Open image file while neither text editor nor image file is open", function () { - it("should NOT fire currentDocumentChange and activeEditorChange events", function () { + + it("opening image while nothing open should NOT fire currentDocumentChange and activeEditorChange events", function () { var promise, docChangeListener = jasmine.createSpy(), @@ -1186,10 +1202,8 @@ define(function (require, exports, module) { }); }); - }); - describe("Open a text file while a text file is open", function () { - it("should fire currentDocumentChange and activeEditorChange events", function () { + it("opening text file while other text open should fire currentDocumentChange and activeEditorChange events", function () { var promise, docChangeListener = jasmine.createSpy(), @@ -1220,9 +1234,7 @@ define(function (require, exports, module) { _$(EditorManager).off("activeEditorChange", activeEditorChangeListener); }); }); - }); - describe("Opens text file and validates EditorManager APIs", function () { it("should return an editor after opening a text file", function () { var path = testPath + "/test.js", promise; From fcbe56a924611456025ac75cd6ee63407add6851 Mon Sep 17 00:00:00 2001 From: Randy Edmunds Date: Fri, 22 Aug 2014 10:49:59 -0700 Subject: [PATCH 013/120] change for code review --- src/LiveDevelopment/LiveDevelopment.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/LiveDevelopment/LiveDevelopment.js b/src/LiveDevelopment/LiveDevelopment.js index e7f3d9344d9..7d6177dbdc3 100644 --- a/src/LiveDevelopment/LiveDevelopment.js +++ b/src/LiveDevelopment/LiveDevelopment.js @@ -264,11 +264,11 @@ define(function LiveDevelopment(require, exports, module) { /** * @private - * Append a message to direct users to the troubleshooting page + * Make a message to direct users to the troubleshooting page * @param {string} msg Original message * @return {string} Original message plus link to troubleshooting page. */ - function _appendTroubleshootingMessage(msg) { + function _makeTroubleshootingMessage(msg) { return msg + " " + StringUtils.format(Strings.LIVE_DEVELOPMENT_TROUBLESHOOTING, brackets.config.troubleshoot_url); } @@ -629,7 +629,7 @@ define(function LiveDevelopment(require, exports, module) { Dialogs.showModalDialog( Dialogs.DIALOG_ID_ERROR, Strings.LIVE_DEVELOPMENT_ERROR_TITLE, - _appendTroubleshootingMessage(Strings.LIVE_DEV_LOADING_ERROR_MESSAGE) + _makeTroubleshootingMessage(Strings.LIVE_DEV_LOADING_ERROR_MESSAGE) ); }) .always(function () { @@ -1067,7 +1067,7 @@ define(function LiveDevelopment(require, exports, module) { Dialogs.showModalDialog( DefaultDialogs.DIALOG_ID_ERROR, Strings.LIVE_DEVELOPMENT_ERROR_TITLE, - _appendTroubleshootingMessage(Strings.LIVE_DEV_LOADING_ERROR_MESSAGE) + _makeTroubleshootingMessage(Strings.LIVE_DEV_LOADING_ERROR_MESSAGE) ); }) .done(_onInterstitialPageLoad); @@ -1077,7 +1077,7 @@ define(function LiveDevelopment(require, exports, module) { Dialogs.showModalDialog( DefaultDialogs.DIALOG_ID_ERROR, Strings.LIVE_DEVELOPMENT_ERROR_TITLE, - _appendTroubleshootingMessage(Strings.LIVE_DEV_NEED_HTML_MESSAGE) + _makeTroubleshootingMessage(Strings.LIVE_DEV_NEED_HTML_MESSAGE) ); _openDeferred.reject(); } @@ -1086,7 +1086,7 @@ define(function LiveDevelopment(require, exports, module) { Dialogs.showModalDialog( DefaultDialogs.DIALOG_ID_ERROR, Strings.LIVE_DEVELOPMENT_ERROR_TITLE, - _appendTroubleshootingMessage(Strings.LIVE_DEV_SERVER_NOT_READY_MESSAGE) + _makeTroubleshootingMessage(Strings.LIVE_DEV_SERVER_NOT_READY_MESSAGE) ); _openDeferred.reject(); } @@ -1108,7 +1108,7 @@ define(function LiveDevelopment(require, exports, module) { var dialogPromise = Dialogs.showModalDialog( DefaultDialogs.DIALOG_ID_LIVE_DEVELOPMENT, Strings.LIVE_DEVELOPMENT_RELAUNCH_TITLE, - _appendTroubleshootingMessage(Strings.LIVE_DEVELOPMENT_ERROR_MESSAGE), + _makeTroubleshootingMessage(Strings.LIVE_DEVELOPMENT_ERROR_MESSAGE), [ { className: Dialogs.DIALOG_BTN_CLASS_LEFT, @@ -1179,7 +1179,7 @@ define(function LiveDevelopment(require, exports, module) { Dialogs.showModalDialog( DefaultDialogs.DIALOG_ID_ERROR, Strings.ERROR_LAUNCHING_BROWSER_TITLE, - _appendTroubleshootingMessage(message) + _makeTroubleshootingMessage(message) ); _openDeferred.reject("OPEN_LIVE_BROWSER"); From 8c7fcda88baf9e04a573a6336246588a05e79734 Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Sun, 24 Aug 2014 10:57:08 +0200 Subject: [PATCH 014/120] Add LESS --- src/extensions/default/QuickView/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extensions/default/QuickView/main.js b/src/extensions/default/QuickView/main.js index 7712815fe0f..62f959fdc07 100644 --- a/src/extensions/default/QuickView/main.js +++ b/src/extensions/default/QuickView/main.js @@ -55,7 +55,7 @@ define(function (require, exports, module) { POINTER_HEIGHT = 15, // Pointer height, used to shift popover above pointer (plus a little bit of space) POPOVER_HORZ_MARGIN = 5; // Horizontal margin - var styleLanguages = ["css", "text/x-scss", "sass"]; + var styleLanguages = ["css", "text/x-less", "sass", "text/x-scss"]; prefs = PreferencesManager.getExtensionPrefs("quickview"); prefs.definePreference("enabled", "boolean", true); From df0d86e5c877508df0f6db772957b6b24f77b394 Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Mon, 25 Aug 2014 19:42:59 +0200 Subject: [PATCH 015/120] Navigate through Extension Manager tabs via Ctrl-(Shift)-Tab --- src/extensibility/ExtensionManagerDialog.js | 33 +++++++++++++++---- src/htmlContent/extension-manager-dialog.html | 2 +- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/extensibility/ExtensionManagerDialog.js b/src/extensibility/ExtensionManagerDialog.js index 854593ef92c..eea1bb3e60c 100644 --- a/src/extensibility/ExtensionManagerDialog.js +++ b/src/extensibility/ExtensionManagerDialog.js @@ -40,6 +40,7 @@ define(function (require, exports, module) { InstallExtensionDialog = require("extensibility/InstallExtensionDialog"), AppInit = require("utils/AppInit"), Async = require("utils/Async"), + KeyEvent = require("utils/KeyEvent"), ExtensionManager = require("extensibility/ExtensionManager"), ExtensionManagerView = require("extensibility/ExtensionManagerView").ExtensionManagerView, ExtensionManagerViewModel = require("extensibility/ExtensionManagerViewModel"); @@ -304,16 +305,36 @@ define(function (require, exports, module) { $dlg = dialog.getElement(); $search = $(".search", $dlg); $searchClear = $(".search-clear", $dlg); - + + function setActiveTab($tab) { + models[_activeTabIndex].scrollPos = $(".modal-body", $dlg).scrollTop(); + $tab.tab("show"); + $(".modal-body", $dlg).scrollTop(models[_activeTabIndex].scrollPos || 0); + $searchClear.click(); + } + // Dialog tabs $dlg.find(".nav-tabs a") .on("click", function (event) { - models[_activeTabIndex].scrollPos = $(".modal-body", $dlg).scrollTop(); - $(this).tab("show"); - $(".modal-body", $dlg).scrollTop(models[_activeTabIndex].scrollPos || 0); - $searchClear.click(); + setActiveTab($(this)); }); - + + // navigate through tabs via Ctrl-(Shift)-Tab + $dlg.on("keyup", function (event) { + if (event.keyCode === KeyEvent.DOM_VK_TAB && event.ctrlKey) { + var $tabs = $(".nav-tabs a", $dlg), + tabIndex = _activeTabIndex; + + if (event.shiftKey) { + tabIndex--; + } else { + tabIndex++; + } + tabIndex %= $tabs.length; + setActiveTab($tabs.eq(tabIndex)); + } + }); + // Update & hide/show the notification overlay on a tab's icon, based on its model's notifyCount function updateNotificationIcon(index) { var model = models[index], diff --git a/src/htmlContent/extension-manager-dialog.html b/src/htmlContent/extension-manager-dialog.html index c7528a73a7a..3a985284c06 100644 --- a/src/htmlContent/extension-manager-dialog.html +++ b/src/htmlContent/extension-manager-dialog.html @@ -1,4 +1,4 @@ -