Skip to content

Commit d403430

Browse files
committed
Switch from single to double quotes
1 parent 795cf5f commit d403430

12 files changed

+41
-41
lines changed

Diff for: patterns/amd+commonjs/pluginCore.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
(function ( name, definition ){
1212
var theModule = definition(),
1313
// this is considered "safe":
14-
hasDefine = typeof define === 'function' && define.amd,
15-
// hasDefine = typeof define === 'function',
16-
hasExports = typeof module !== 'undefined' && module.exports;
14+
hasDefine = typeof define === "function" && define.amd,
15+
// hasDefine = typeof define === "function",
16+
hasExports = typeof module !== "undefined" && module.exports;
1717

1818
if ( hasDefine ){ // AMD Module
1919
define(theModule);
@@ -22,7 +22,7 @@
2222
} else { // Assign to common namespaces or simply the global object (window)
2323
(this.jQuery || this.ender || this.$ || this)[name] = theModule;
2424
}
25-
})( 'core', function () {
25+
})( "core", function () {
2626
var module = this;
2727
module.plugins = [];
2828
module.highlightColor = "yellow";
@@ -35,12 +35,12 @@
3535
// colors
3636
module.highlight = function(el,strColor){
3737
if(this.jQuery){
38-
jQuery(el).css('background', strColor);
38+
jQuery(el).css("background", strColor);
3939
}
4040
}
4141
return {
4242
highlightAll:function(){
43-
module.highlight('div', module.highlightColor);
43+
module.highlight("div", module.highlightColor);
4444
}
4545
};
4646

Diff for: patterns/amd+commonjs/pluginExtension.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
(function ( name, definition ) {
44
var theModule = definition(),
5-
hasDefine = typeof define === 'function',
6-
hasExports = typeof module !== 'undefined' && module.exports;
5+
hasDefine = typeof define === "function",
6+
hasExports = typeof module !== "undefined" && module.exports;
77

88
if ( hasDefine ) { // AMD Module
99
define(theModule);
@@ -26,15 +26,15 @@
2626
}
2727

2828
}
29-
})('core.plugin', function () {
29+
})("core.plugin", function () {
3030

3131
// Define your module here and return the public API.
3232
// This code could be easily adapted with the core to
3333
// allow for methods that overwrite and extend core functionality
3434
// in order to expand the highlight method to do more if you wish.
3535
return {
3636
setGreen: function ( el ) {
37-
highlight(el, 'green');
37+
highlight(el, "green");
3838
},
3939
setRed: function ( el ) {
4040
highlight(el, errorColor);

Diff for: patterns/amd+commonjs/usage.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@
55
<script type="text/javascript">
66

77
$(function(){
8-
// Our plugin 'core' is exposed under a core namespace in
8+
// Our plugin "core" is exposed under a core namespace in
99
// this example, which we first cache
1010
var core = $.core;
1111

1212
// Then use use some of the built-in core functionality to
1313
// highlight all divs in the page yellow
1414
core.highlightAll();
1515

16-
// Access the plugins (extensions) loaded into the 'plugin'
16+
// Access the plugins (extensions) loaded into the "plugin"
1717
// namespace of our core module:
1818

1919
// Set the first div in the page to have a green background.
2020
core.plugin.setGreen("div:first");
21-
// Here we're making use of the core's 'highlight' method
21+
// Here we're making use of the core's "highlight" method
2222
// under the hood from a plugin loaded in after it
2323

24-
// Set the last div to the 'errorColor' property defined in
24+
// Set the last div to the "errorColor" property defined in
2525
// our core module/plugin. If you review the code further down,
2626
// you'll see how easy it is to consume properties and methods
2727
// between the core and other plugins
28-
core.plugin.setRed('div:last');
28+
core.plugin.setRed("div:last");
2929
});
3030

3131
</script>

Diff for: patterns/jquery.basic.plugin-boilerplate.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
// regularly referenced in your plugin).
2525

2626
// Create the defaults once
27-
var pluginName = 'defaultPluginName',
27+
var pluginName = "defaultPluginName",
2828
defaults = {
2929
propertyName: "value"
3030
};
@@ -66,8 +66,8 @@
6666
// preventing against multiple instantiations
6767
$.fn[pluginName] = function ( options ) {
6868
return this.each(function () {
69-
if (!$.data(this, 'plugin_' + pluginName)) {
70-
$.data(this, 'plugin_' + pluginName,
69+
if (!$.data(this, "plugin_" + pluginName)) {
70+
$.data(this, "plugin_" + pluginName,
7171
new Plugin( this, options ));
7272
}
7373
});

Diff for: patterns/jquery.best.options.plugin-boilerplate.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
}
3333
});
3434
})({
35-
property : 'value',
36-
otherProperty : 'value'
35+
property : "value",
36+
otherProperty : "value"
3737
}, jQuery, window, document);

Diff for: patterns/jquery.highly-configurable.plugin.boilerplate.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
// to support customization of the plugin on a per-element
2222
// basis. For example,
2323
// <div class=item' data-plugin-options='{"message":"Goodbye World!"}'></div>
24-
this.metadata = this.$elem.data( 'plugin-options' );
24+
this.metadata = this.$elem.data( "plugin-options" );
2525
};
2626

2727
// the plugin prototype
2828
Plugin.prototype = {
2929
defaults: {
30-
message: 'Hello world!'
30+
message: "Hello world!"
3131
},
3232

3333
init: function() {

Diff for: patterns/jquery.prototypal-inheritance.plugin-boilerplate.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ var myObject = {
3232
myMethod: function( msg ){
3333
// You have direct access to the associated and cached
3434
// jQuery element
35-
console.log('myMethod triggered');
35+
console.log("myMethod triggered");
3636
// this.$elem.append('<p>'+msg+'</p>');
3737
}
3838
};
3939

4040
// Object.create support test, and fallback for browsers without it
41-
if ( typeof Object.create !== 'function' ) {
41+
if ( typeof Object.create !== "function" ) {
4242
Object.create = function (o) {
4343
function F() {}
4444
F.prototype = o;

Diff for: patterns/jquery.widget-factory.bridge.boilerplate.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ widgetName.prototype = {
6262

6363
// notice no underscore is used for public methods
6464
publicFunction: function(){
65-
console.log('public function');
65+
console.log("public function");
6666
},
6767

6868
// underscores are used for private methods
6969
_privateFunction: function(){
70-
console.log('private function');
70+
console.log("private function");
7171
}
7272
};
7373

Diff for: patterns/jquery.widget-factory.mobile-plugin.boilerplate.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@
5757
// [uiObject] )
5858
// eg. this._trigger( "hover", e /*where e.type ==
5959
// "mouseenter"*/, { hovered: $(e.target)});
60-
console.log('method B called');
60+
console.log("method B called");
6161
//this.methodA();
6262
},
6363

6464
methodA: function ( event ) {
65-
this._trigger('dataChanged', event, {
66-
key: 'someValue'
65+
this._trigger("dataChanged", event, {
66+
key: "someValue"
6767
});
6868
},
6969

Diff for: patterns/jquery.widget-factory.plugin-boilerplate.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@
5252
// [uiObject] )
5353
// eg. this._trigger( "hover", e /*where e.type ==
5454
// "mouseenter"*/, { hovered: $(e.target)});
55-
console.log('methodB called');
55+
console.log("methodB called");
5656
},
5757

5858
methodA: function ( event ) {
59-
this._trigger('dataChanged', event, {
60-
key: 'someValue'
59+
this._trigger("dataChanged", event, {
60+
key: "someValue"
6161
});
6262
},
6363

Diff for: patterns/jquery.widget-factory.requirejs.boilerplate.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ define(["jquery", "jqueryui"], function ($) {
6161
// subscribe to
6262
//signature: _trigger( "callbackName" , [eventObject],
6363
// [uiObject] )
64-
console.log('methodB called');
64+
console.log("methodB called");
6565
},
6666

6767
methodA: function ( event ) {
68-
this._trigger('dataChanged', event, {
69-
key: 'someValue'
68+
this._trigger("dataChanged", event, {
69+
key: "someValue"
7070
});
7171
},
7272

Diff for: scripts/main.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
requirejs.config({
22
paths: {
3-
'jquery': 'http://code.jquery.com/jquery-1.8.3.min',
4-
'jqueryui': 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min',
5-
'boilerplate': '../patterns/jquery.widget-factory.requirejs.boilerplate'
3+
"jquery": "http://code.jquery.com/jquery-1.8.3.min",
4+
"jqueryui": "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min",
5+
"boilerplate": "../patterns/jquery.widget-factory.requirejs.boilerplate"
66
}
77
});
88

9-
require(['jquery', 'jqueryui', 'boilerplate'], function ($, ui, boilerplate) {
9+
require(["jquery", "jqueryui", "boilerplate"], function ($, ui, boilerplate) {
1010
$(function () {
11-
var instance = ($('body').myWidget());
11+
var instance = ($("body").myWidget());
1212
console.log(instance);
1313

14-
instance.myWidget('methodB');
14+
instance.myWidget("methodB");
1515
});
1616
});

0 commit comments

Comments
 (0)