From cc439df8bb3d8c4dec6038c87337e7fc462cbcfc Mon Sep 17 00:00:00 2001 From: David Humphrey Date: Tue, 15 Feb 2011 11:27:45 -0500 Subject: [PATCH] Style fix for quotes. --- plugins/mustache/popcorn.mustache.html | 82 +++++++++++------------ plugins/mustache/popcorn.mustache.js | 50 +++++++------- plugins/mustache/popcorn.mustache.unit.js | 18 ++--- 3 files changed, 75 insertions(+), 75 deletions(-) diff --git a/plugins/mustache/popcorn.mustache.html b/plugins/mustache/popcorn.mustache.html index 668ac2b..f0284fa 100644 --- a/plugins/mustache/popcorn.mustache.html +++ b/plugins/mustache/popcorn.mustache.html @@ -14,19 +14,19 @@ start: 5, // seconds end: 10, // seconds target: 'mustache-div', - template: "

{{header}}

" + - "{{#items}}" + - " {{#first}}" + - "
  • {{name}}
  • " + - " {{/first}}" + - " {{#link}}" + - '
  • {{name}}
  • ' + - " {{/link}}" + - "{{/items}}" + - "" + - "{{#empty}}" + - "

    The list is empty.

    " + - "{{/empty}}" , + template: '

    {{header}}

    ' + + '{{#items}}' + + ' {{#first}}' + + '
  • {{name}}
  • ' + + ' {{/first}}' + + ' {{#link}}' + + '
  • {{name}}
  • ' + + ' {{/link}}' + + '{{/items}}' + + ' + + '{{#empty}}' + + '

    The list is empty.

    ' + + '{{/empty}}' , data: '{' + ' "header": "Test 1", ' + @@ -46,26 +46,26 @@ end: 20, target: 'mustache-div', template: function(plugin, options) { - return "

    {{header}}

    " + - "{{#items}}" + - " {{#first}}" + - "
  • {{name}}
  • " + - " {{/first}}" + - " {{#link}}" + + return '

    {{header}}

    ' + + '{{#items}}' + + ' {{#first}}' + + '
  • {{name}}
  • ' + + ' {{/first}}' + + ' {{#link}}' + '
  • {{name}}
  • ' + - " {{/link}}" + - "{{/items}}" + - "" + - "{{#empty}}" + - "

    The list is empty.

    " + - "{{/empty}}" ; + ' {{/link}}' + + '{{/items}}' + + '' + + '{{#empty}}' + + '

    The list is empty.

    ' + + '{{/empty}}' ; }, data: { - header: "Test 2", + header: 'Test 2', items: [ - { name: "red", first: true, url: "#Red" }, - { name: "green", link: true, url: "#Green" }, - { name: "blue", link: true, url: "#Blue"} + { name: 'red', first: true, url: '#Red' }, + { name: 'green', link: true, url: '#Green' }, + { name: 'blue', link: true, url: '#Blue'} ], empty: false } @@ -77,19 +77,19 @@ end: 30, target: 'mustache-div', template: function(plugin, options) { - return "

    {{header}}

    " + - "{{#items}}" + - " {{#first}}" + - "
  • {{name}}
  • " + - " {{/first}}" + - " {{#link}}" + + return '

    {{header}}

    ' + + '{{#items}}' + + ' {{#first}}' + + '
  • {{name}}
  • ' + + ' {{/first}}' + + ' {{#link}}' + '
  • {{name}}
  • ' + - " {{/link}}" + - "{{/items}}" + - "" + - "{{#empty}}" + - "

    The list is empty.

    " + - "{{/empty}}" ; + ' {{/link}}' + + '{{/items}}' + + '' + + '{{#empty}}' + + '

    The list is empty.

    ' + + '{{/empty}}' ; }, data: function(plugin, options) { return JSON.parse('' + diff --git a/plugins/mustache/popcorn.mustache.js b/plugins/mustache/popcorn.mustache.js index abe69be..d15e387 100644 --- a/plugins/mustache/popcorn.mustache.js +++ b/plugins/mustache/popcorn.mustache.js @@ -4,12 +4,12 @@ // TODO: swap to getScript() (function() { - var mustacheUrl = "https://github.com/janl/mustache.js/raw/master/mustache.js"; + var mustacheUrl = 'https://github.com/janl/mustache.js/raw/master/mustache.js'; var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); - script.type = "text/javascript"; + script.type = 'text/javascript'; script.src = mustacheUrl; head.insertBefore( script, head.firstChild ); })(); @@ -50,22 +50,22 @@ start: 5, // seconds end: 15, // seconds target: 'mustache', - template: "

    {{header}}

    " + - "{{#bug}}" + - "{{/bug}}" + - "" + - "{{#items}}" + - " {{#first}}" + - "
  • {{name}}
  • " + - " {{/first}}" + - " {{#link}}" + + template: '

    {{header}}

    ' + + '{{#bug}}' + + '{{/bug}}' + + '' + + '{{#items}}' + + ' {{#first}}' + + '
  • {{name}}
  • ' + + ' {{/first}}' + + ' {{#link}}' + '
  • {{name}}
  • ' + - " {{/link}}" + - "{{/items}}" + - "" + - "{{#empty}}" + - "

    The list is empty.

    " + - "{{/empty}}" , + ' {{/link}}' + + '{{/items}}' + + '' + + '{{#empty}}' + + '

    The list is empty.

    ' + + '{{/empty}}' , data: '{' + ' "header": "Colors", ' + @@ -74,7 +74,7 @@ ' {"name": "green", "link": true, "url": "#Green"}, ' + ' {"name": "blue", "link": true, "url": "#Blue"} ' + ' ],' + - ' "empty": false' + + ' 'empty': false' + '}', dynamic: false // The json is not going to change, load it early. } ) @@ -96,7 +96,7 @@ * */ - Popcorn.plugin( "mustache" , function() { + Popcorn.plugin( 'mustache' , function() { function get( name, options ) { return options._instance[name]; @@ -109,10 +109,10 @@ return { manifest: { about: { - name: "Popcorn Mustache Plugin", - version: "0.1", - author: "David Humphrey (@humphd)", - website: "http://vocamus.net/dave" + name: 'Popcorn Mustache Plugin', + version: '0.1', + author: 'David Humphrey (@humphd)', + website: 'http://vocamus.net/dave' }, options: { start: {elem:'input', type:'text', label:'In'}, @@ -144,7 +144,7 @@ } else if ( typeOfTemplate === 'string' ) { set( 'template', options, options.template ); } else { - throw "Mustache Plugin Error: options.template must be a String or a Function."; + throw 'Mustache Plugin Error: options.template must be a String or a Function.'; } if ( typeOfData === 'function' ) { @@ -158,7 +158,7 @@ } else if ( typeOfData === 'object' ) { set( 'data', options, options.data ); } else { - throw "Mustache Plugin Error: options.data must be a String, Object, or Function."; + throw 'Mustache Plugin Error: options.data must be a String, Object, or Function.'; } }, diff --git a/plugins/mustache/popcorn.mustache.unit.js b/plugins/mustache/popcorn.mustache.unit.js index 53b3af2..d262081 100644 --- a/plugins/mustache/popcorn.mustache.unit.js +++ b/plugins/mustache/popcorn.mustache.unit.js @@ -1,6 +1,6 @@ -test("Popcorn Mustache Plugin", function () { +test('Popcorn Mustache Plugin', function () { - var popped = Popcorn("#video"), + var popped = Popcorn('#video'), expects = 5, count = 0, mustacheDiv = document.getElementById('mustache-div'); @@ -15,17 +15,17 @@ test("Popcorn Mustache Plugin", function () { stop(); - ok('mustache' in popped, "mustache is a method of the popped instance"); + ok('mustache' in popped, 'mustache is a method of the popped instance'); plus(); - equals ( mustacheDiv.innerHTML, "", "initially, there is nothing inside the mustache-div" ); + equals ( mustacheDiv.innerHTML, '', 'initially, there is nothing inside the mustache-div' ); plus(); // Static strings popped.mustache({ start: 1, // seconds end: 3, // seconds - template: "

    {{heading}}

    ", + template: '

    {{heading}}

    ', data: '{"heading": "mustache - test 1/3"}', target: 'mustache-div', dynamic: false @@ -36,7 +36,7 @@ test("Popcorn Mustache Plugin", function () { start: 5, // seconds end: 7, // seconds template: function(plugin, options) { - return "

    {{heading}}

    "; + return '

    {{heading}}

    '; }, data: function(plugin, options) { return JSON.parse('{"heading": "mustache - test 2/3"}'); @@ -49,9 +49,9 @@ test("Popcorn Mustache Plugin", function () { start: 9, // seconds end: 11, // seconds template: function(plugin, options) { - return "

    {{heading}}

    "; + return '

    {{heading}}

    '; }, - data: { heading: "mustache - test 3/3" }, + data: { heading: 'mustache - test 3/3' }, target: 'mustache-div', dynamic: false } ); @@ -62,7 +62,7 @@ test("Popcorn Mustache Plugin", function () { video.addEventListener('timeupdate', function() { function pass(a, b) { - ok( "

    mustache - test " + a + "/" + b + "<\/h1>" === mustacheDiv.innerHTML, "Mustache template rendered" ); + equals( '

    mustache - test ' + a + '/' + b + '<\/h1>', mustacheDiv.innerHTML, 'Mustache template rendered' ); plus(); } -- 2.43.0