From 06e22d0d186cc52dd7260173083406a6895a07c6 Mon Sep 17 00:00:00 2001 From: eight Date: Tue, 9 Oct 2018 23:38:29 +0800 Subject: [PATCH] Change: add sections-editor --- background/navigator-util.js | 2 +- background/style-manager.js | 2 +- edit.html | 14 +- edit/beautify.js | 5 +- edit/codemirror-editing-hooks.js | 51 +- edit/edit.css | 12 + edit/edit.js | 292 +----------- edit/global-search.js | 4 +- edit/linter-report.js | 2 +- edit/sections-editor.js | 771 +++++++++++++++++++++++++++++++ edit/sections.js | 582 ----------------------- edit/source-editor.js | 3 + 12 files changed, 851 insertions(+), 889 deletions(-) create mode 100644 edit/sections-editor.js delete mode 100644 edit/sections.js diff --git a/background/navigator-util.js b/background/navigator-util.js index ea233aca..fe573049 100644 --- a/background/navigator-util.js +++ b/background/navigator-util.js @@ -14,7 +14,7 @@ const navigatorUtil = (() => { } function initUrlChange() { - if (!handler.urlChange) { + if (handler.urlChange) { return; } handler.urlChange = []; diff --git a/background/style-manager.js b/background/style-manager.js index 3946cd56..ce8fe20f 100644 --- a/background/style-manager.js +++ b/background/style-manager.js @@ -37,7 +37,7 @@ const styleManager = (() => { }); function handleLivePreviewConnections() { - chrome.runtime.onConnect(port => { + chrome.runtime.onConnect.addListener(port => { if (port.name !== 'livePreview') { return; } diff --git a/edit.html b/edit.html index 4fe6708b..e838a65b 100644 --- a/edit.html +++ b/edit.html @@ -137,8 +137,11 @@ - - -