Skip to content

Commit 64cfe41

Browse files
committed
Add editorconfig and cleanup the indentation
1 parent d246e58 commit 64cfe41

15 files changed

+103
-85
lines changed

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
8+
[*.json]
9+
indent_style = space
10+
indent_size = 2
11+
12+
[*.html]
13+
indent_style = space
14+
indent_size = 4
15+
16+
[*.{js,css}]
17+
indent_style = tab

Gruntfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = function(grunt) {
1+
module.exports = function (grunt) {
22
"use strict";
33

44
grunt.initConfig({
@@ -49,4 +49,4 @@ module.exports = function(grunt) {
4949

5050
grunt.registerTask('default', ['jshint', 'csslint', 'validation']);
5151
grunt.registerTask('prod', ['zip']);
52-
};
52+
};

css/panel.css

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ iframe {
4141
right: 0;
4242
top: 0;
4343
bottom: 0;
44-
background: rgba(0,0,0,0.5);
44+
background: rgba(0, 0, 0, 0.5);
4545
opacity: 0;
4646
z-index: 2;
4747
-webkit-transition: opacity 0.3s, visibility 0.3s;
@@ -98,14 +98,13 @@ iframe {
9898
z-index: 1;
9999
display: block;
100100

101-
background: rgba(255,255,255,0.75);
102-
-webkit-border-top-left-radius: 5px;
101+
background: rgba(255, 255, 255, 0.75);
103102
border-top-left-radius: 5px;
104103
padding-left: 5px;
105104
padding-top: 5px;
106105
}
107106

108-
#social-buttons iframe {
109-
margin-top: 3px;
110-
display: block;
111-
}
107+
#social-buttons iframe {
108+
margin-top: 3px;
109+
display: block;
110+
}

devtools.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
</head>
77
<body>
88
</body>
9-
</html>
9+
</html>

js/background.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
/*
2-
Allows to read, change and override settings kept in localStorage
2+
Allows to read, change and override settings kept in localStorage
33
4-
FIXME Can be replaced with chrome.storage.local as soon as http://crbug.com/178618 will be resolved
5-
FIXME Can be replaced with localStorage on the panel page as soon as http://crbug.com/319328 will be resolved
4+
FIXME Can be replaced with chrome.storage.local as soon as http://crbug.com/178618 will be resolved
5+
FIXME Can be replaced with localStorage on the panel page as soon as http://crbug.com/319328 will be resolved
66
*/
7-
chrome.runtime.onMessage.addListener(function(message, sender, callback){
7+
chrome.runtime.onMessage.addListener(function (message, sender, callback) {
88
"use strict";
99

10-
if(message.name === 'getSettings') {
10+
if (message.name === 'getSettings') {
1111
callback(localStorage);
12-
} else if(message.name === 'setSettings') {
12+
} else if (message.name === 'setSettings') {
1313
localStorage = message.data;
14-
} else if(message.name === 'changeSetting') {
14+
} else if (message.name === 'changeSetting') {
1515
localStorage[message.item] = message.value;
1616
}
17-
});
17+
});

js/devtools.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
chrome.devtools.panels.create("SnappySnippet", "gfx/devtools-logo.png", "panel.html", function (panel) {
2-
});
2+
});

js/filters/DefaultValueFilter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ function DefaultValueFilter() {
7070

7171
return output;
7272
};
73-
}
73+
}

js/filters/ShorthandPropertyFilter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function ShorthandPropertyFilter() {
8484
for (i = 0, l = longhands.length; i < l; i++) {
8585
blacklist[longhands[i]] = true;
8686
}
87-
} else if(!style[shorthand]) {
87+
} else if (!style[shorthand]) {
8888
blacklist[shorthand] = true;
8989
}
9090
}
@@ -117,4 +117,4 @@ function ShorthandPropertyFilter() {
117117

118118
return output;
119119
};
120-
}
120+
}

js/filters/WebkitPropertiesFilter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ function WebkitPropertiesFilter() {
3838

3939
return output;
4040
};
41-
}
41+
}

js/panel.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
restoreSettings();
3434

3535
/*
36-
SUBMITTING THE CODE TO CodePen/jsFiddle/jsBin
36+
SUBMITTING THE CODE TO CodePen/jsFiddle/jsBin
3737
*/
3838

3939
codepenForm.on('submit', function () {
@@ -62,7 +62,7 @@
6262
});
6363

6464
/*
65-
Event listeners
65+
Event listeners
6666
*/
6767

6868
propertiesCleanUpInput.on('change', persistSettingAndProcessSnapshot);
@@ -91,15 +91,15 @@
9191
return validator.test(prefix);
9292
}
9393

94-
idPrefix.on('change', function() {
94+
idPrefix.on('change', function () {
9595
var val = $(this).val(),
9696
parent = $(this).parent();
9797

9898
parent.removeClass('has-error').removeClass('has-success');
9999

100-
if(val.length === 0) {
100+
if (val.length === 0) {
101101
persistSettingAndProcessSnapshot.apply(this);
102-
} else if(isValidPrefix(val)) {
102+
} else if (isValidPrefix(val)) {
103103
parent.addClass('has-success');
104104
persistSettingAndProcessSnapshot.apply(this);
105105
} else {
@@ -108,7 +108,7 @@
108108
});
109109

110110
/*
111-
Settings - saving & restoring
111+
Settings - saving & restoring
112112
*/
113113

114114
function restoreSettings() {
@@ -126,7 +126,7 @@
126126
continue;
127127
}
128128

129-
if(el.is('[type=checkbox]')) {
129+
if (el.is('[type=checkbox]')) {
130130
//updating flat UI checkbox
131131
el.data('checkbox').setCheck(settings[prop] === "true" ? 'check' : 'uncheck');
132132
} else {
@@ -155,7 +155,7 @@
155155
}
156156

157157
/*
158-
Making & processing snippets
158+
Making & processing snippets
159159
*/
160160

161161
function makeSnapshot() {
@@ -228,7 +228,7 @@
228228

229229
styles = cssStringifier.process(styles);
230230

231-
if(isValidPrefix(idPrefix.val())) {
231+
if (isValidPrefix(idPrefix.val())) {
232232
prefix = idPrefix.val();
233233
}
234234

0 commit comments

Comments
 (0)