From 33661021da84d2390fbbd77f06dd78bf779b93da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Tue, 22 Dec 2015 22:52:29 +0800 Subject: [PATCH] Minor bug fixes for astroedit sitefile snippet cancel not work cannot delete Article syntaxhighlighter disable quick-code added rss button --- .../AstroEdit/Visualizer/Snippet/SiteFile.js | 33 ++++++++++--------- botanjs/src/Astro/Blog/AstroEdit/_this.js | 2 +- .../src/Astro/Blog/Components/Entry/Blog.css | 4 +++ .../Components/ToggleButton/DeleteArticle.js | 3 +- .../src/Astro/Blog/Layout/Article/Latest.js | 1 - botanjs/src/Astro/Blog/Layout/Article/Tag.js | 5 +++ .../src/Astro/Blog/Layout/Article/_this.css | 6 ++++ botanjs/src/Astro/Bootstrap.js | 1 + 8 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 botanjs/src/Astro/Blog/Layout/Article/Tag.js create mode 100644 botanjs/src/Astro/Blog/Layout/Article/_this.css diff --git a/botanjs/src/Astro/Blog/AstroEdit/Visualizer/Snippet/SiteFile.js b/botanjs/src/Astro/Blog/AstroEdit/Visualizer/Snippet/SiteFile.js index 072ed83..9384f87 100644 --- a/botanjs/src/Astro/Blog/AstroEdit/Visualizer/Snippet/SiteFile.js +++ b/botanjs/src/Astro/Blog/AstroEdit/Visualizer/Snippet/SiteFile.js @@ -48,16 +48,19 @@ } // Popup MessageBox - new MessageBox("Insert site file" + new MessageBox( + "Insert site file" , Dand.wrape([ v_snippetInput , Dand.wrape([ input_preferred, Dand.textNode( "Preferred" ) ]) ]) - , "OK", "Cancel", visualizer.bind({ - code: v_snippetInput - , preferred: input_preferred - , stage: this._stage - })).show(); + , "OK", "Cancel" + , visualizer.bind({ + code: v_snippetInput + , preferred: input_preferred + , stage: this._stage + }) + ).show(); } , __applyData = function (e) @@ -210,16 +213,16 @@ getData( config.path.info + hash, __applyData.bind({stage: temp, hash: hash}), loadFailed ); } + i = { + _content: hash + , _preferred: preferred || "off" + , _stage: temp + }; + + // Set context menu + createContext( i, j, handler ); + } - - i = { - _content: hash - , _preferred: preferred || "off" - , _stage: temp - }; - - // Set context menu - createContext( i, j, handler ); }; if (override) diff --git a/botanjs/src/Astro/Blog/AstroEdit/_this.js b/botanjs/src/Astro/Blog/AstroEdit/_this.js index 803d841..6fe4e24 100644 --- a/botanjs/src/Astro/Blog/AstroEdit/_this.js +++ b/botanjs/src/Astro/Blog/AstroEdit/_this.js @@ -65,7 +65,7 @@ // Independent modules new Uploader( a_conf.paths.set_file ); new SiteLibrary( - Config.get( "BasePath" ) + base_path , a_conf.paths.get_files , a_conf.paths.set_file ); diff --git a/botanjs/src/Astro/Blog/Components/Entry/Blog.css b/botanjs/src/Astro/Blog/Components/Entry/Blog.css index 792da57..fe7e3fd 100644 --- a/botanjs/src/Astro/Blog/Components/Entry/Blog.css +++ b/botanjs/src/Astro/Blog/Components/Entry/Blog.css @@ -83,3 +83,7 @@ font-size: 1em; color: #76400C; } + +.highlighter-wrapper { + margin: 0 1em; +} diff --git a/botanjs/src/Astro/Blog/Components/ToggleButton/DeleteArticle.js b/botanjs/src/Astro/Blog/Components/ToggleButton/DeleteArticle.js index 47aae3c..8ae7e9c 100644 --- a/botanjs/src/Astro/Blog/Components/ToggleButton/DeleteArticle.js +++ b/botanjs/src/Astro/Blog/Components/ToggleButton/DeleteArticle.js @@ -14,6 +14,7 @@ var init = function() { + var aid = Dand.id( "b_entry", true ).getDAttribute( "aid" ); var stage = Dand.glass( "b_delete", true, Dand.id( "b_entry" ) ); if( !stage.length ) return; @@ -26,7 +27,7 @@ if( confirmed ) postData( "/ajax/del-article" - , { "article_id": stage.getDAttribute( "aid" ) } + , { "article_id": aid } , a_deleteSuccess , a_deleteFailed ); diff --git a/botanjs/src/Astro/Blog/Layout/Article/Latest.js b/botanjs/src/Astro/Blog/Layout/Article/Latest.js index 0f9db83..933a1dd 100644 --- a/botanjs/src/Astro/Blog/Layout/Article/Latest.js +++ b/botanjs/src/Astro/Blog/Layout/Article/Latest.js @@ -2,5 +2,4 @@ var ns = __namespace( "Astro.Blog.Layout.Article.Latest" ); // __import( "Astro.Blog.Components.Entry.Home" ); - // __import( "Astro.Blog.Components.Entry.Mega" ); })(); diff --git a/botanjs/src/Astro/Blog/Layout/Article/Tag.js b/botanjs/src/Astro/Blog/Layout/Article/Tag.js new file mode 100644 index 0000000..2a3e782 --- /dev/null +++ b/botanjs/src/Astro/Blog/Layout/Article/Tag.js @@ -0,0 +1,5 @@ +(function(){ + var ns = __namespace( "Astro.Blog.Layout.Article.Tag" ); + + // __import( "Astro.Blog.Components.Entry.List" ); +})(); diff --git a/botanjs/src/Astro/Blog/Layout/Article/_this.css b/botanjs/src/Astro/Blog/Layout/Article/_this.css new file mode 100644 index 0000000..c7e4557 --- /dev/null +++ b/botanjs/src/Astro/Blog/Layout/Article/_this.css @@ -0,0 +1,6 @@ +.rss-icon circle, .rss-icon path { + fill: #444; +} +.rss-icon:hover circle, .rss-icon:hover path { + fill: orangered; +} diff --git a/botanjs/src/Astro/Bootstrap.js b/botanjs/src/Astro/Bootstrap.js index bdb8071..4e03fed 100644 --- a/botanjs/src/Astro/Bootstrap.js +++ b/botanjs/src/Astro/Bootstrap.js @@ -43,6 +43,7 @@ /** @type {Libraries.SyntaxHighlighter} */ var synt = __import( SyntaxHighlighter ); synt.defaults["toolbar"] = false; + synt.defaults["quick-code"] = false; synt.highlight(); } };