commit 2778e12f38b7c3e1648aff3718de6dd4f82e3ff8
| author | 斟酌 鵬兄 <tgckpg@gmail.com> |
| date | 2015-10-20T18:22:49Z |
| subject | minor bug fixes |
commit 2778e12f38b7c3e1648aff3718de6dd4f82e3ff8
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date: 2015-10-20T18:22:49Z
minor bug fixes
---
.../Blog/AstroEdit/Visualizer/Snippet/Code.js | 2 +-
.../Blog/AstroEdit/Visualizer/Snippet/SiteFile.js | 46 ++++++++++++++--------
.../src/Astro/Blog/AstroEdit/Visualizer/_this.css | 5 +++
botanjs/src/Astro/Blog/Components/Entry/Block.css | 2 +-
4 files changed, 37 insertions(+), 18 deletions(-)
diff --git a/botanjs/src/Astro/Blog/AstroEdit/Visualizer/Snippet/Code.js b/botanjs/src/Astro/Blog/AstroEdit/Visualizer/Snippet/Code.js
index 205ca1b..564ef6d 100644
--- a/botanjs/src/Astro/Blog/AstroEdit/Visualizer/Snippet/Code.js
+++ b/botanjs/src/Astro/Blog/AstroEdit/Visualizer/Snippet/Code.js
@@ -23,7 +23,7 @@
, "AS3" , "as3"
, "bash" , "bash"
, "C#" , "csharp"
- , "C/C++" , "c"
+ , "C/C++" , "cpp"
, "CSS" , "css"
, "php" , "php"
, "Python" , "python"
diff --git a/botanjs/src/Astro/Blog/AstroEdit/Visualizer/Snippet/SiteFile.js b/botanjs/src/Astro/Blog/AstroEdit/Visualizer/Snippet/SiteFile.js
index 5871222..5395c1c 100644
--- a/botanjs/src/Astro/Blog/AstroEdit/Visualizer/Snippet/SiteFile.js
+++ b/botanjs/src/Astro/Blog/AstroEdit/Visualizer/Snippet/SiteFile.js
@@ -75,22 +75,22 @@
var keys = [ new IKey( "type", "radio" ), new IKey( "name", "size_grp" + Perf.uuid ) ];
var sid;
var selectionChanged = function ()
+ {
+ _stage.setAttribute( new DataKey( "size", this.size ) );
+ //// Handles the size selection
+ switch(this.size)
{
- _stage.setAttribute( new DataKey( "size", this.size ) );
- //// Handles the size selection
- switch(this.size)
- {
- case "small":
- _image.setAttribute( "src", config.path.image.small + _hash + ".jpg" );
- break;
- case "medium":
- _image.setAttribute( "src", config.path.image.medium + _hash + ".jpg" );
- break;
- case "large":
- _image.setAttribute( "src", config.path.image.large + _hash + ".jpg" );
- break;
- }
- };
+ case "small":
+ _image.setAttribute( "src", config.path.image.small + _hash + ".jpg" );
+ break;
+ case "medium":
+ _image.setAttribute( "src", config.path.image.medium + _hash + ".jpg" );
+ break;
+ case "large":
+ _image.setAttribute( "src", config.path.image.large + _hash + ".jpg" );
+ break;
+ }
+ };
this.stage.insertBefore( _image, desc );
@@ -111,6 +111,20 @@
IDOMElement(s).addEventListener("Change", selectionChanged.bind({size: "small"}));
IDOMElement(m).addEventListener("Change", selectionChanged.bind({size: "medium"}));
IDOMElement(l).addEventListener("Change", selectionChanged.bind({size: "large"}));
+
+ var hasValue = _stage.getDAttribute( "size" );
+ if( hasValue )
+ {
+ switch( hasValue )
+ {
+ case "small": s.checked = 1; break;
+ case "medium": m.checked = 1; break;
+ case "large": l.checked = 1; break;
+ }
+
+ selectionChanged.bind({ size: hasValue })();
+ }
+
break;
case "audio":
// TODO
@@ -143,7 +157,7 @@
]
, [
new DataKey( "value", hash )
- , new DataKey( "size", "large" )
+ , new DataKey( "size", override.size || "large" )
, new IKey( "style", "max-height: 150px;" )
]
);
diff --git a/botanjs/src/Astro/Blog/AstroEdit/Visualizer/_this.css b/botanjs/src/Astro/Blog/AstroEdit/Visualizer/_this.css
index 0dfa89c..e4c92df 100644
--- a/botanjs/src/Astro/Blog/AstroEdit/Visualizer/_this.css
+++ b/botanjs/src/Astro/Blog/AstroEdit/Visualizer/_this.css
@@ -48,6 +48,11 @@
margin-bottom: 0.5em;
}
+textarea.v_snippet_input {
+ font-family: monospace;
+ font-size: 1em;
+}
+
.v_instruction {
padding: 0.2em 0;
}
diff --git a/botanjs/src/Astro/Blog/Components/Entry/Block.css b/botanjs/src/Astro/Blog/Components/Entry/Block.css
index 3232879..631502e 100644
--- a/botanjs/src/Astro/Blog/Components/Entry/Block.css
+++ b/botanjs/src/Astro/Blog/Components/Entry/Block.css
@@ -4,7 +4,7 @@
width: 225px;
height: 325px;
- margin: 1em;
+ margin: 0 2em 2em 0;
position: relative;