Skip to content
Browse files

Widget is version-aware

  • Loading branch information...
1 parent 9cbe41d commit 17fa4016647d44588ff45055c64e662188414806 @alecperkins committed Mar 5, 2012
Showing with 5 additions and 2 deletions.
  1. +4 −1 src/coffeetable.coffee
  2. +1 −1 src/template.html
View
5 src/coffeetable.coffee
@@ -19,6 +19,8 @@ Load `coffeetable-min.js` into the page:
# ## Settings and prep
+VERSION = [0,3,0]
+
# Default widget settings.
defaults =
# Automatically load jQuery and CoffeeScript if not found in page
@@ -76,7 +78,7 @@ template = """
<style type="text/css">
#__ID__{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;-webkit-box-shadow:0px 0px 4px #222;-moz-box-shadow:0px 0px 4px #222;box-shadow:0px 0px 4px #222;background:rgba(255,255,255,0.93);padding:0;border:2px solid #fff;z-index:2147483647;font-size:12px;font-family:Verdana,sans-serif;max-height:95%;max-width:60%;color:#000}#__ID__ div,#__ID__ span,#__ID__ applet,#__ID__ object,#__ID__ iframe,#__ID__ h1,#__ID__ h2,#__ID__ h3,#__ID__ h4,#__ID__ h5,#__ID__ h6,#__ID__ p,#__ID__ blockquote,#__ID__ pre,#__ID__ a,#__ID__ abbr,#__ID__ acronym,#__ID__ address,#__ID__ big,#__ID__ cite,#__ID__ code,#__ID__ del,#__ID__ dfn,#__ID__ em,#__ID__ img,#__ID__ ins,#__ID__ kbd,#__ID__ q,#__ID__ s,#__ID__ samp,#__ID__ small,#__ID__ strike,#__ID__ strong,#__ID__ sub,#__ID__ sup,#__ID__ tt,#__ID__ var,#__ID__ b,#__ID__ u,#__ID__ i,#__ID__ center,#__ID__ dl,#__ID__ dt,#__ID__ dd,#__ID__ ol,#__ID__ ul,#__ID__ li,#__ID__ fieldset,#__ID__ form,#__ID__ label,#__ID__ legend,#__ID__ table,#__ID__ caption,#__ID__ tbody,#__ID__ tfoot,#__ID__ thead,#__ID__ tr,#__ID__ th,#__ID__ td,#__ID__ article,#__ID__ aside,#__ID__ canvas,#__ID__ details,#__ID__ embed,#__ID__ figure,#__ID__ figcaption,#__ID__ footer,#__ID__ header,#__ID__ hgroup,#__ID__ menu,#__ID__ nav,#__ID__ output,#__ID__ ruby,#__ID__ section,#__ID__ summary,#__ID__ time,#__ID__ mark,#__ID__ audio,#__ID__ video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}#__ID__ table{border-collapse:collapse;border-spacing:0}#__ID__ caption,#__ID__ th,#__ID__ td{text-align:left;font-weight:normal;vertical-align:middle}#__ID__ q,#__ID__ blockquote{quotes:none}#__ID__ q:before,#__ID__ q:after,#__ID__ blockquote:before,#__ID__ blockquote:after{content:"";content:none}#__ID__ a img{border:none}#__ID__ *{visibility:visible;font-weight:500;-webkit-box-shadow:0px 0px 5px transparent;-moz-box-shadow:0px 0px 5px transparent;box-shadow:0px 0px 5px transparent;text-shadow:transparent 0px 0px 1px;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;margin:0;padding:0;position:static}#__ID__ ul{text-align:left}#__ID__ .toggle-widget{float:right !important;background:#fff !important;border:1px solid #ccc !important;color:#911 !important;cursor:pointer !important;height:20px !important;width:78px !important;display:block !important;min-width:78px !important;min-height:20px !important;font-size:12px !important;line-height:1em !important;font-weight:500 !important}#__ID__ .toggle-widget:active,#__ID__ .toggle-widget.active{background:#911 !important;color:#fff !important}#__ID__ .coffee-source{font-family:monospace;font-size:15px;min-width:400px;height:22px;margin:4px}#__ID__ .input{display:none}#__ID__ .history{margin:8px;padding:4px;font-family:monospace;list-style-type:circle;overflow-y:scroll}#__ID__ .history li{padding:4px 1em 4px 4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;position:relative}#__ID__ .history li:hover{list-style-type:disc}#__ID__ .history li.cs-error{color:orange}#__ID__ .history li.js-error{color:red}#__ID__ .history li.object span.result{cursor:pointer}#__ID__ .history li.property-value{list-style-type:none}#__ID__ .history li.property-value span.property{color:purple}#__ID__ .history li li{padding-left:3em}#__ID__ .history li button{cursor:pointer}#__ID__ .history li button.load{position:absolute;right:0;top:0;border:1px solid #ccc;padding:2px;background:#fff}#__ID__ .history li button.load:hover{background-color:rgba(255,255,0,0.2)}#__ID__ .history li button.load:active{background-color:rgba(255,255,0,0.8)}#__ID__ .history li button.expand{background:transparent;border:0;width:1em}#__ID__ .history li span.opened{display:none}#__ID__ .history li.open > button span.opened,#__ID__ .history li.open > span.value > button span.opened{display:inline}#__ID__ .history li.open > button span.closed,#__ID__ .history li.open > span.value > button span.closed{display:none}#__ID__ p.instructions{text-align:center}#__ID__ .clear,#__ID__ .replay{padding:4px;text-align:center;cursor:pointer;float:left;color:#555;font-variant:small-caps;display:none}#__ID__ .clear:hover,#__ID__ .replay:hover{color:#911}#__ID__ a{padding:4px;text-align:center;cursor:pointer;float:right;color:#555;font-variant:small-caps;text-decoration:none}#__ID__ input{vertical-align:middle}#__ID__ p.mode{padding:4px;margin:0;float:right;display:inline-block;width:80px;color:#555;font-variant:small-caps;display:none;text-align:right}#__ID__ .autosuggest{-webkit-box-shadow:0px 0px 4px #222;-moz-box-shadow:0px 0px 4px #222;box-shadow:0px 0px 4px #222;position:absolute;top:-2px;left:-260px;display:block;background:rgba(255,255,255,0.9);width:250px;overflow-y:scroll;font-family:monospace}#__ID__ .autosuggest li{padding:4px}#__ID__ .autosuggest li.heading{font-weight:bold;text-decoration:underline;list-style-type:none}#__ID__ .function{color:#292}#__ID__ .number{color:#229}#__ID__ .string{color:#922}#__ID__ .undefined{color:grey;font-style:italic}#__ID__ .object{color:#000}#__ID__ .boolean{color:#299}
</style>
- <button class="toggle-widget">CoffeeTable</button>
+ <button class="toggle-widget" title="CoffeeTable v#{ VERSION.join('.') }">CoffeeTable</button>
<span class="clear">clear</span><span class="replay">replay</span>
<a href="http://code.alecperkins.net/coffeetable/" target="_blank">?</a>
<p class="mode">multiline <input type="checkbox"></p>
@@ -753,6 +755,7 @@ window.CoffeeTable =
return
exec: (args...) ->
return ctExec(args...)
+ version: VERSION
View
2 src/template.html
@@ -2,7 +2,7 @@
<style type="text/css">
#__ID__{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;-webkit-box-shadow:0px 0px 4px #222;-moz-box-shadow:0px 0px 4px #222;box-shadow:0px 0px 4px #222;background:rgba(255,255,255,0.93);padding:0;border:2px solid #fff;z-index:2147483647;font-size:12px;font-family:Verdana,sans-serif;max-height:95%;max-width:60%;color:#000}#__ID__ div,#__ID__ span,#__ID__ applet,#__ID__ object,#__ID__ iframe,#__ID__ h1,#__ID__ h2,#__ID__ h3,#__ID__ h4,#__ID__ h5,#__ID__ h6,#__ID__ p,#__ID__ blockquote,#__ID__ pre,#__ID__ a,#__ID__ abbr,#__ID__ acronym,#__ID__ address,#__ID__ big,#__ID__ cite,#__ID__ code,#__ID__ del,#__ID__ dfn,#__ID__ em,#__ID__ img,#__ID__ ins,#__ID__ kbd,#__ID__ q,#__ID__ s,#__ID__ samp,#__ID__ small,#__ID__ strike,#__ID__ strong,#__ID__ sub,#__ID__ sup,#__ID__ tt,#__ID__ var,#__ID__ b,#__ID__ u,#__ID__ i,#__ID__ center,#__ID__ dl,#__ID__ dt,#__ID__ dd,#__ID__ ol,#__ID__ ul,#__ID__ li,#__ID__ fieldset,#__ID__ form,#__ID__ label,#__ID__ legend,#__ID__ table,#__ID__ caption,#__ID__ tbody,#__ID__ tfoot,#__ID__ thead,#__ID__ tr,#__ID__ th,#__ID__ td,#__ID__ article,#__ID__ aside,#__ID__ canvas,#__ID__ details,#__ID__ embed,#__ID__ figure,#__ID__ figcaption,#__ID__ footer,#__ID__ header,#__ID__ hgroup,#__ID__ menu,#__ID__ nav,#__ID__ output,#__ID__ ruby,#__ID__ section,#__ID__ summary,#__ID__ time,#__ID__ mark,#__ID__ audio,#__ID__ video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}#__ID__ table{border-collapse:collapse;border-spacing:0}#__ID__ caption,#__ID__ th,#__ID__ td{text-align:left;font-weight:normal;vertical-align:middle}#__ID__ q,#__ID__ blockquote{quotes:none}#__ID__ q:before,#__ID__ q:after,#__ID__ blockquote:before,#__ID__ blockquote:after{content:"";content:none}#__ID__ a img{border:none}#__ID__ *{visibility:visible;font-weight:500;-webkit-box-shadow:0px 0px 5px transparent;-moz-box-shadow:0px 0px 5px transparent;box-shadow:0px 0px 5px transparent;text-shadow:transparent 0px 0px 1px;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;margin:0;padding:0;position:static}#__ID__ ul{text-align:left}#__ID__ .toggle-widget{float:right !important;background:#fff !important;border:1px solid #ccc !important;color:#911 !important;cursor:pointer !important;height:20px !important;width:78px !important;display:block !important;min-width:78px !important;min-height:20px !important;font-size:12px !important;line-height:1em !important;font-weight:500 !important}#__ID__ .toggle-widget:active,#__ID__ .toggle-widget.active{background:#911 !important;color:#fff !important}#__ID__ .coffee-source{font-family:monospace;font-size:15px;min-width:400px;height:22px;margin:4px}#__ID__ .input{display:none}#__ID__ .history{margin:8px;padding:4px;font-family:monospace;list-style-type:circle;overflow-y:scroll}#__ID__ .history li{padding:4px 1em 4px 4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;position:relative}#__ID__ .history li:hover{list-style-type:disc}#__ID__ .history li.cs-error{color:orange}#__ID__ .history li.js-error{color:red}#__ID__ .history li.object span.result{cursor:pointer}#__ID__ .history li.property-value{list-style-type:none}#__ID__ .history li.property-value span.property{color:purple}#__ID__ .history li li{padding-left:3em}#__ID__ .history li button{cursor:pointer}#__ID__ .history li button.load{position:absolute;right:0;top:0;border:1px solid #ccc;padding:2px;background:#fff}#__ID__ .history li button.load:hover{background-color:rgba(255,255,0,0.2)}#__ID__ .history li button.load:active{background-color:rgba(255,255,0,0.8)}#__ID__ .history li button.expand{background:transparent;border:0;width:1em}#__ID__ .history li span.opened{display:none}#__ID__ .history li.open > button span.opened,#__ID__ .history li.open > span.value > button span.opened{display:inline}#__ID__ .history li.open > button span.closed,#__ID__ .history li.open > span.value > button span.closed{display:none}#__ID__ p.instructions{text-align:center}#__ID__ .clear,#__ID__ .replay{padding:4px;text-align:center;cursor:pointer;float:left;color:#555;font-variant:small-caps;display:none}#__ID__ .clear:hover,#__ID__ .replay:hover{color:#911}#__ID__ a{padding:4px;text-align:center;cursor:pointer;float:right;color:#555;font-variant:small-caps;text-decoration:none}#__ID__ input{vertical-align:middle}#__ID__ p.mode{padding:4px;margin:0;float:right;display:inline-block;width:80px;color:#555;font-variant:small-caps;display:none;text-align:right}#__ID__ .autosuggest{-webkit-box-shadow:0px 0px 4px #222;-moz-box-shadow:0px 0px 4px #222;box-shadow:0px 0px 4px #222;position:absolute;top:-2px;left:-260px;display:block;background:rgba(255,255,255,0.9);width:250px;overflow-y:scroll;font-family:monospace}#__ID__ .autosuggest li{padding:4px}#__ID__ .autosuggest li.heading{font-weight:bold;text-decoration:underline;list-style-type:none}#__ID__ .function{color:#292}#__ID__ .number{color:#229}#__ID__ .string{color:#922}#__ID__ .undefined{color:grey;font-style:italic}#__ID__ .object{color:#000}#__ID__ .boolean{color:#299}
</style>
- <button class="toggle-widget">CoffeeTable</button>
+ <button class="toggle-widget" title="CoffeeTable v#{ VERSION.join('.') }">CoffeeTable</button>
<span class="clear">clear</span><span class="replay">replay</span>
<a href="http://code.alecperkins.net/coffeetable/" target="_blank">?</a>
<p class="mode">multiline <input type="checkbox"></p>

0 comments on commit 17fa401

Please sign in to comment.
Something went wrong with that request. Please try again.