Skip to content

Commit

Permalink
fix control template
Browse files Browse the repository at this point in the history
  • Loading branch information
Ndragomirov committed May 26, 2014
1 parent 8b90290 commit 71c815c
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 25 deletions.
26 changes: 13 additions & 13 deletions dist/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ function program2(depth0,data) {
if (stack1 = helpers.desc) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.desc; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "</div>\n <div class=\"control-wrapper\">\n <input disabled=\"";
+ "</div>\n <div class=\"control-wrapper\">\n <input ";
options = {hash:{},data:data};
buffer += escapeExpression(((stack1 = helpers['h-disabled'] || depth0['h-disabled']),stack1 ? stack1.call(depth0, depth0, options) : helperMissing.call(depth0, "h-disabled", depth0, options)))
+ "\" data-type=";
+ " data-type=";
if (stack2 = helpers.type) { stack2 = stack2.call(depth0, {hash:{},data:data}); }
else { stack2 = depth0.type; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }
buffer += escapeExpression(stack2)
Expand Down Expand Up @@ -146,10 +146,10 @@ function program4(depth0,data) {
function program5(depth0,data,depth1) {

var buffer = "", stack1, stack2, options;
buffer += "\n <input disabled=\"";
buffer += "\n <input ";
options = {hash:{},data:data};
buffer += escapeExpression(((stack1 = helpers['h-disabled'] || depth0['h-disabled']),stack1 ? stack1.call(depth0, depth0, options) : helperMissing.call(depth0, "h-disabled", depth0, options)))
+ "\" data-type=\""
buffer += escapeExpression(((stack1 = helpers['h-disabled'] || depth0['h-disabled']),stack1 ? stack1.call(depth0, depth0, depth1, options) : helperMissing.call(depth0, "h-disabled", depth0, depth1, options)))
+ " data-type=\""
+ escapeExpression(((stack1 = depth1.type),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ "\" id=\"";
if (stack2 = helpers.id) { stack2 = stack2.call(depth0, {hash:{},data:data}); }
Expand Down Expand Up @@ -181,10 +181,10 @@ function program5(depth0,data,depth1) {
function program7(depth0,data) {

var buffer = "", stack1, stack2, options;
buffer += "\n <div class=\"control-wrapper\">\n <input disabled=\"";
buffer += "\n <div class=\"control-wrapper\">\n <input ";
options = {hash:{},data:data};
buffer += escapeExpression(((stack1 = helpers['h-disabled'] || depth0['h-disabled']),stack1 ? stack1.call(depth0, depth0, options) : helperMissing.call(depth0, "h-disabled", depth0, options)))
+ "\" data-type=";
+ " data-type=";
if (stack2 = helpers.type) { stack2 = stack2.call(depth0, {hash:{},data:data}); }
else { stack2 = depth0.type; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }
buffer += escapeExpression(stack2)
Expand All @@ -203,10 +203,10 @@ function program7(depth0,data) {
function program9(depth0,data) {

var buffer = "", stack1, stack2, options;
buffer += "\n <div class=\"control-wrapper\">\n <input disabled=\"";
buffer += "\n <div class=\"control-wrapper\">\n <input ";
options = {hash:{},data:data};
buffer += escapeExpression(((stack1 = helpers['h-disabled'] || depth0['h-disabled']),stack1 ? stack1.call(depth0, depth0, options) : helperMissing.call(depth0, "h-disabled", depth0, options)))
+ "\" type=\"checkbox\" id=\"";
+ " type=\"checkbox\" id=\"";
if (stack2 = helpers.id) { stack2 = stack2.call(depth0, {hash:{},data:data}); }
else { stack2 = depth0.id; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }
buffer += escapeExpression(stack2)
Expand Down Expand Up @@ -241,10 +241,10 @@ function program11(depth0,data) {
if (stack1 = helpers.desc) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.desc; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "</div>\n <div class=\"control-wrapper\">\n <select disabled=\"";
+ "</div>\n <div class=\"control-wrapper\">\n <select ";
options = {hash:{},data:data};
buffer += escapeExpression(((stack1 = helpers['h-disabled'] || depth0['h-disabled']),stack1 ? stack1.call(depth0, depth0, options) : helperMissing.call(depth0, "h-disabled", depth0, options)))
+ "\" data-type=";
+ " data-type=";
if (stack2 = helpers.type) { stack2 = stack2.call(depth0, {hash:{},data:data}); }
else { stack2 = depth0.type; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }
buffer += escapeExpression(stack2)
Expand Down Expand Up @@ -283,10 +283,10 @@ function program14(depth0,data) {
if (stack1 = helpers.desc) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.desc; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "</div>\n <div class=\"control-wrapper\">\n <input disabled=\"";
+ "</div>\n <div class=\"control-wrapper\">\n <input ";
options = {hash:{},data:data};
buffer += escapeExpression(((stack1 = helpers['h-disabled'] || depth0['h-disabled']),stack1 ? stack1.call(depth0, depth0, options) : helperMissing.call(depth0, "h-disabled", depth0, options)))
+ "\" data-type=";
+ " data-type=";
if (stack2 = helpers.type) { stack2 = stack2.call(depth0, {hash:{},data:data}); }
else { stack2 = depth0.type; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; }
buffer += escapeExpression(stack2)
Expand Down
5 changes: 3 additions & 2 deletions lib/handlebars-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Handlebars.registerHelper('h-selected', function (t, ctx){
return ctx.value === t.id ? 'selected' : '';
});

Handlebars.registerHelper('h-disabled', function (t, ctx){
return t.enabled ? 'false' : 'true';
Handlebars.registerHelper('h-disabled', function (t, parent){
var v = t.type ? t.enabled : parent && parent.enabled;
return v ? '' : 'disabled';
});
12 changes: 6 additions & 6 deletions lib/templates/control.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{#if range}}
<div class="control-desc">{{desc}}</div>
<div class="control-wrapper">
<input disabled="{{h-disabled this}}" data-type={{type}} data-id={{id}} type="range" value="{{value}}" min="{{min}}" max="{{max}}">
<input {{h-disabled this}} data-type={{type}} data-id={{id}} type="range" value="{{value}}" min="{{min}}" max="{{max}}">

<div class="range-helper">
<span class="range-helper-value"> {{value}} </span> <span>{{tip}}</span>
Expand All @@ -16,7 +16,7 @@
<div class="control-desc">{{desc}}</div>
<div class="control-wrapper">
{{#each opts}}
<input disabled="{{h-disabled this}}" data-type="{{../this.type}}" id="{{id}}" data-id={{../this.id}} name="{{../this.id}}" type="radio"
<input {{h-disabled this ../this}} data-type="{{../this.type}}" id="{{id}}" data-id={{../this.id}} name="{{../this.id}}" type="radio"
value="{{id}}" {{h-checked this ../this}}>

<label for="{{id}}">
Expand All @@ -30,13 +30,13 @@

{{#if button}}
<div class="control-wrapper">
<input disabled="{{h-disabled this}}" data-type={{type}} data-id={{id}} class="tviggr-dark-btn" type="button" value="{{desc}}">
<input {{h-disabled this}} data-type={{type}} data-id={{id}} class="tviggr-dark-btn" type="button" value="{{desc}}">
</div>
{{/if}}

{{#if checkbox}}
<div class="control-wrapper">
<input disabled="{{h-disabled this}}" type="checkbox" id="{{id}}" data-type={{type}} data-id={{id}} {{h-checked}} />
<input {{h-disabled this}} type="checkbox" id="{{id}}" data-type={{type}} data-id={{id}} {{h-checked}} />
<label for="{{id}}">
<span></span>

Expand All @@ -48,7 +48,7 @@
{{#if select}}
<div class="control-desc">{{desc}}</div>
<div class="control-wrapper">
<select disabled="{{h-disabled this}}" data-type={{type}} data-id={{id}}>
<select {{h-disabled this}} data-type={{type}} data-id={{id}}>
{{#each opts}}
<option value="{{id}}"
{{h-selected this ../this}} >{{name}}</option>
Expand All @@ -61,7 +61,7 @@
{{#if text}}
<div class="control-desc">{{desc}}</div>
<div class="control-wrapper">
<input disabled="{{h-disabled this}}" data-type={{type}} data-id={{id}} type="text" value="{{value}}">
<input {{h-disabled this}} data-type={{type}} data-id={{id}} type="text" value="{{value}}">
</div>
{{/if}}
</label>
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "Twitch Now",
"version" : "1.1.71",
"version" : "1.1.76",
"default_locale" : "en",
"manifest_version" : 2,
"description" : "Explore games & track your favorite streams on Twitch",
Expand Down
2 changes: 1 addition & 1 deletion manifests/chrome.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "Twitch Now",
"version" : "1.1.71",
"version" : "1.1.76",
"default_locale" : "en",
"manifest_version" : 2,
"description" : "Explore games & track your favorite streams on Twitch",
Expand Down
2 changes: 1 addition & 1 deletion manifests/opera.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "Twitch Now",
"version" : "1.1.71",
"version" : "1.1.76",
"default_locale" : "en",
"manifest_version" : 2,
"description" : "Explore games & track your favorite streams on Twitch",
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.1.71"
"version": "1.1.76"
}

0 comments on commit 71c815c

Please sign in to comment.