From a83bcd6868fb59f93a72beb80d29db42f7335228 Mon Sep 17 00:00:00 2001 From: Allen Bargi Date: Thu, 13 Feb 2014 23:25:30 +0100 Subject: [PATCH] delete custom code localStorage on save if the custom code in empty --- ARCHIVE.todo | 28 +++++++++- TODO.todo | 55 ++++++------------- .../js/controllers/preview_controller.coffee | 1 + app/templates/_links.ejs | 2 +- 4 files changed, 47 insertions(+), 39 deletions(-) diff --git a/ARCHIVE.todo b/ARCHIVE.todo index ab6eb6fd..f7f34da6 100644 --- a/ARCHIVE.todo +++ b/ARCHIVE.todo @@ -1,5 +1,30 @@ -___________________ Archive: + ✔ ---- v. 0.5 -------------------- @done + ✔ deploy parser to heroku @done (14-02-13 19:56) @project(TODO v. 0.5) + ✔ language mapper @done (14-02-13 19:05) @project(TODO v. 0.5) + ✔ BUG: reset color does not remove the key and produce invalid themes @done (14-02-13 16:31) @project(TODO v. 0.5) + ✔ retina images for UI @done (14-02-13 15:59) @project(TODO) + ✔ bring textpow inline and improve it @done (14-02-13 15:58) @project(ruby parser) + ✔ save external file directly from url @done (14-02-13 15:46) @project(TODO v. 0.5) + ✔ smarter link to open themes in non-raw mode @done (14-02-13 14:54) @project(TODO v. 0.5) + ✔ back/forward buttons are not working (IMP) @done (14-02-12 21:31) @project(TODO v. 0.5) + ✔ external file remove %20 @done (14-02-12 21:03) @project(TODO v. 0.5) + ✔ using custom fonts for UI @done (14-02-12 20:48) @project(TODO v. 0.5) + ✔ stop animation on scrollintoview when adding new scroll @done (14-02-12 15:18) @project(TODO v. 0.5) + ✔ BUG: color adjust hud goes under bottom bottons @done (14-02-12 15:02) @project(TODO v. 0.5) + ✔ open original theme url is broken @done (14-02-12 15:01) @project(TODO v. 0.5) + ✔ BUG: edit popovers after loading new theme does not work @done (14-02-12 15:00) @project(TODO v. 0.5) + ✔ ng-cloak on stats page @done (14-02-12 04:13) @project(TODO v. 0.5) + ✔ scroll scope into view with animation when hovering over code @done (14-02-12 04:03) @project(TODO v. 0.5) + ✔ slide in animation for headers in gallery! @done (14-02-12 03:11) @project(TODO v. 0.5) + ✔ scope bar is broken @done (14-02-12 03:09) @project(TODO v. 0.5) + ✔ remember external URL in localstorage and show it in sidebar @done (14-02-10 22:18) @project(TODO v. 0.5) + ✔ update path after delete local file? @done (14-02-10 12:19) @project(TODO v. 0.5) + ✔ also clean up last_theme cookie in case the local file gets deleted @done (14-02-10 12:17) @project(TODO v. 0.5) + ✔ update path after loading local files @done (14-02-10 11:58) @project(TODO v. 0.5) + ✔ load local files @done (14-02-10 11:58) @project(TODO v. 0.5) + ✔ add open from URL button @done (14-02-09 20:40) @project(TODO v. 0.5) + ✘ replace B,I,U ckeckboxes with button groups @cancelled (14-01-27 13:29) @project(TODO) ✔ ---- v. 0.4 -------------------- @done ✔ color picker issues @done (14-01-26 23:27) @project(BUG) ✔ if name is empty use the scope, shortened (example https://raw2.github.com/hanakin/CodeRunner-sublime-theme/master/CodeRunner.tmTheme) @done (14-01-26 22:26) @@ -51,6 +76,7 @@ Archive: ✔ search for scopes @done (13-05-01 01:35) ✔ toggle buttons for Global/Scope/Settings @done (13-05-01 00:41) ✔ a settings button with the ability to edit name/author/uuid/comments @done (13-05-01 00:42) + ✔ ---- v. 0.2 -------------------- @done ✔ Add scope statistic @done (13-04-30 17:18) ✔ use spinner.js @done (13-04-30 17:18) ✔ bottom of the gallery list is not accessible @done (13-04-30 12:52) diff --git a/TODO.todo b/TODO.todo index 1aa47e7f..fffb0865 100644 --- a/TODO.todo +++ b/TODO.todo @@ -1,5 +1,8 @@ TODO v. 0.5: + ☐ update readme + ☐ add changelog + ☐ BUG: save does not work (gallery/local/external) ☐ BUG: deleting from local/external does not trun off loading ☐ do not store hashkey to localstorge @@ -15,7 +18,7 @@ TODO v. 0.5: ☐ BUG: reverse the order of scope bar values, match with what is reported in sublime ☐ add color input boxes with real color values to edit popovers - ☐ more lang support (PHP Perl GO LESS SCSS) + ☐ more lang support (PHP Perl GO LESS SCSS C C++ Lua XML Markdown Latex) Later: ☐ favorites @@ -26,9 +29,9 @@ Later: ☐ new button ☐ use infinite scroll on gallery (https://github.com/BinaryMuse/ngInfiniteScroll) ☐ setting color with transparency (different alpha channel representation) + ☐ BUG: multi-line scopes like comments or css rules + ☐ if no scope is found open new popover and fill it in? -Scope bar: - ☐ if no scope is found open new popover and fill it in TODO: ☐ document on wiki: how to integrate with editor @@ -68,20 +71,22 @@ Low: ☐ upgrade bootstrap More Languages Support: - ☐ PHP - ☐ Perl + ☐ C# + ☐ C/C++ + ☐ Erlang ☐ GO + ☐ Haskell + ☐ Latex ☐ LESS - ☐ SCSS - ☐ Shell + ☐ Lua ☐ Markdown - ☐ C/C++ - ☐ C# ☐ Objective-C - ☐ Haskell - ☐ Erlang + ☐ Perl + ☐ PHP ☐ Scala - ☐ Lua + ☐ SCSS + ☐ Shell + ☐ E XML DID YOU KNOW YOU CAN: ☐ drag and drop and reorder scopes @@ -131,28 +136,4 @@ TmThemeEditor Companion: ___________________ Archive: - ✔ deploy parser to heroku @done (14-02-13 19:56) @project(TODO v. 0.5) - ✔ language mapper @done (14-02-13 19:05) @project(TODO v. 0.5) - ✔ BUG: reset color does not remove the key and produce invalid themes @done (14-02-13 16:31) @project(TODO v. 0.5) - ✔ retina images for UI @done (14-02-13 15:59) @project(TODO) - ✔ bring textpow inline and improve it @done (14-02-13 15:58) @project(ruby parser) - ✔ save external file directly from url @done (14-02-13 15:46) @project(TODO v. 0.5) - ✔ smarter link to open themes in non-raw mode @done (14-02-13 14:54) @project(TODO v. 0.5) - ✔ back/forward buttons are not working (IMP) @done (14-02-12 21:31) @project(TODO v. 0.5) - ✔ external file remove %20 @done (14-02-12 21:03) @project(TODO v. 0.5) - ✔ using custom fonts for UI @done (14-02-12 20:48) @project(TODO v. 0.5) - ✔ stop animation on scrollintoview when adding new scroll @done (14-02-12 15:18) @project(TODO v. 0.5) - ✔ BUG: color adjust hud goes under bottom bottons @done (14-02-12 15:02) @project(TODO v. 0.5) - ✔ open original theme url is broken @done (14-02-12 15:01) @project(TODO v. 0.5) - ✔ BUG: edit popovers after loading new theme does not work @done (14-02-12 15:00) @project(TODO v. 0.5) - ✔ ng-cloak on stats page @done (14-02-12 04:13) @project(TODO v. 0.5) - ✔ scroll scope into view with animation when hovering over code @done (14-02-12 04:03) @project(TODO v. 0.5) - ✔ slide in animation for headers in gallery! @done (14-02-12 03:11) @project(TODO v. 0.5) - ✔ scope bar is broken @done (14-02-12 03:09) @project(TODO v. 0.5) - ✔ remember external URL in localstorage and show it in sidebar @done (14-02-10 22:18) @project(TODO v. 0.5) - ✔ update path after delete local file? @done (14-02-10 12:19) @project(TODO v. 0.5) - ✔ also clean up last_theme cookie in case the local file gets deleted @done (14-02-10 12:17) @project(TODO v. 0.5) - ✔ update path after loading local files @done (14-02-10 11:58) @project(TODO v. 0.5) - ✔ load local files @done (14-02-10 11:58) @project(TODO v. 0.5) - ✔ add open from URL button @done (14-02-09 20:40) @project(TODO v. 0.5) - ✘ replace B,I,U ckeckboxes with button groups @cancelled (14-01-27 13:29) @project(TODO) + ✔ delete custom code localStorage on save @done (14-02-13 23:24) @project(TODO v. 0.5) diff --git a/app/assets/js/controllers/preview_controller.coffee b/app/assets/js/controllers/preview_controller.coffee index 650dbaf4..c52b93d5 100644 --- a/app/assets/js/controllers/preview_controller.coffee +++ b/app/assets/js/controllers/preview_controller.coffee @@ -26,6 +26,7 @@ Application.controller 'previewController', ['$scope', '$http', '$rootScope','th $scope.custom_code_editor_visible = false throbber.off() else + localStorage.removeItem('custom_code') $http.get("/files/samples/pre-compiled/#{$scope.current_lang.toLowerCase()}.html").success (data) -> $scope.colorized = $sce.trustAsHtml(data) $scope.custom_code_editor_visible = false diff --git a/app/templates/_links.ejs b/app/templates/_links.ejs index 821bbdb5..03668b72 100644 --- a/app/templates/_links.ejs +++ b/app/templates/_links.ejs @@ -1,7 +1,7 @@