Skip to content

Commit

Permalink
Revert "Fix: adobe#1675 - Console User Interface (work by @raygervais) (
Browse files Browse the repository at this point in the history
#752)"

This reverts commit ca4f169.

There are changes in here not related to the PR.
  • Loading branch information
humphd committed May 9, 2017
1 parent ca4f169 commit 896adeb
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 493 deletions.
8 changes: 0 additions & 8 deletions locales/en-US/editor.properties
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,3 @@ ERROR_MOVING_FILE_DIALOG_HEADER=Move Error
UNEXPECTED_ERROR_MOVING_FILE=An unexpected error occurred when attempting to move {0} to {1}
# {0} is the name of the file/folder being moved and {1} is the name of the folder it is being moved to
ERROR_MOVING_FILE_SAME_NAME=A file or folder with the name {0} already exists in {1}. Consider renaming either one to continue.

# extensions/default/bramble/console
CONSOLE_TITLE=Console
CONSOLE_TOOLTIP=Open the JavaScript Console
CONSOLE_CLEAR=Clear
CONSOLE_CLEAR_TOOLTIP=Clear the Console
CONSOLE_CLOSE_TOOLTIP=Close the Console
CONSOLE_EMPTY_STRING=Empty String
3 changes: 0 additions & 3 deletions src/extensions/bramble-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@
"dist/extensions/default/bramble/stylesheets/style.css": [
"src/extensions/default/bramble/stylesheets/style.less"
],
"dist/extensions/default/bramble/stylesheets/consoleTheme.css": [
"src/extensions/default/bramble/stylesheets/consoleTheme.less"
],
"dist/extensions/default/bramble/stylesheets/lightTheme.css": [
"src/extensions/default/bramble/stylesheets/lightTheme.less"
],
Expand Down
8 changes: 0 additions & 8 deletions src/extensions/default/bramble/htmlContent/console.html

This file was deleted.

153 changes: 0 additions & 153 deletions src/extensions/default/bramble/lib/ConsoleInterfaceManager.js

This file was deleted.

12 changes: 3 additions & 9 deletions src/extensions/default/bramble/lib/ConsoleManager.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
define(function (require, exports, module) {
"use strict";

var ConsoleInterfaceManager = require("lib/ConsoleInterfaceManager"),
ConsoleManagerRemote = require("text!lib/ConsoleManagerRemote.js");
var ConsoleManagerRemote = require("text!lib/ConsoleManagerRemote.js");

function getRemoteScript() {
return "<script>\n" + ConsoleManagerRemote + "</script>\n";
Expand All @@ -16,13 +15,8 @@ define(function (require, exports, module) {
var args = data.args;
var type = data.type || "log";

if (type === "time" || type === "timeEnd"){
args[0] = type + ": " + args[0];
}

if (args) {
ConsoleInterfaceManager.add(type, args);
}
// TODO: Show this in Custom Console UI, see issue #1675 in Thimble
console[type].apply(console, args);
}

exports.getRemoteScript = getRemoteScript;
Expand Down
33 changes: 6 additions & 27 deletions src/extensions/default/bramble/lib/ConsoleManagerRemote.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
(function(transport, console) {
"use strict";

function transportSend(type, args) {
function transportSend(type, args) {
var data = {args: args, type: type};
transport.send("bramble-console", data);
}

// Implement standard console.* functions
["log",
"warn",
Expand All @@ -18,37 +18,16 @@
"timeEnd"].forEach(function(type) {
console[type] = function() {
var args = Array.prototype.slice.call(arguments);
var data = [];

// Flatten data to send, deal with Error objects
args.forEach(function(arg) {
if(arg instanceof Error) {
data.push(arg.message);
data.push(arg.stack);
} else {
data.push(arg);
}
});

transportSend(type, data);
transportSend(type, args);
};
});

// Implements global error handler for top-level errors
window.addEventListener("error", function(messageOrEvents) {
var message = messageOrEvents.message;
var error = messageOrEvents.error || {};
var stack = error.stack || "Error Interpretting Stack";

transportSend("error", [ message, stack ]);
}, false);


console.assert = function() {
var args = Array.prototype.slice.call(arguments);
var expr = args.shift();
if (!expr) {
args[0] = "Assertion Failed: " + args[0];
transportSend("error", args);
transportSend(args, "error");
}
};
}(window._Brackets_LiveDev_Transport, window.console));
4 changes: 2 additions & 2 deletions src/extensions/default/bramble/lib/PostMessageTransport.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ define(function (require, exports, module) {
ConsoleManager.handleConsoleRequest(msgObj.data);
return;
}

// Trigger message event
// Trigger message event
module.exports.trigger("message", [connId, msgObj.message]);
} else if (msgObj.type === "connect") {
Browser.setListener();
Expand Down
8 changes: 8 additions & 0 deletions src/extensions/default/bramble/lib/UI.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ define(function (require, exports, module) {
PreferencesManager.set("wordWrap", wordWrap);
}

var autoCloseTags = BrambleStartupState.ui("autoCloseTags") || { whenOpening: true, whenClosing: true, indentTags: [] };
PreferencesManager.set("closeTags", autoCloseTags);

var openSVGasXML = BrambleStartupState.ui("openSVGasXML");
if(typeof openSVGasXML === "boolean") {
PreferencesManager.set("openSVGasXML", openSVGasXML);
}

var allowJavaScript = BrambleStartupState.ui("allowJavaScript");
if(typeof allowJavaScript === "boolean") {
PreferencesManager.set("allowJavaScript", allowJavaScript);
Expand Down
Loading

0 comments on commit 896adeb

Please sign in to comment.