Skip to content

Commit a0ed90b

Browse files
committed
* fixed jshint warnings;
* rework gulp (time 3s of build now)
1 parent 348b0c1 commit a0ed90b

File tree

8 files changed

+57
-60
lines changed

8 files changed

+57
-60
lines changed

.github/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ These modules are combined through [browserify](http://browserify.org/) into a s
1414
To build the library, uses [gulp](http://gulpjs.com/) task runner.
1515

1616
* You need to have the dependencies listed in the package.json available, use `npm install` to load them;
17-
* Install [gulp](https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md#getting-started) globally;
18-
* Install [jasmine](https://github.com/jasmine/jasmine#installation) globally. Uses for tests;
17+
* Install [gulp](https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md#getting-started) and globally;
18+
* Install [jasmine](https://github.com/jasmine/jasmine#installation) globally;
1919
* Change the 'version' properties in next files:
2020
* ./bower.json;
2121
* ./package.json;

gulpfile.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ gulp.task('build', function () {
3131
this.emit('end');
3232
})
3333
.pipe(source('quickblox.js'))
34-
.pipe(buffer())
3534
.pipe(uglify()).on('error', function(error){
3635
notify('Uglify Error <%= error.message %>');
3736
this.emit('end');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"scripts": {
8282
"setDependencies": "npm i && npm install -g gulp-cli && npm install -g jasmine",
8383
"lint": "jshint src --reporter=node_modules/jshint-stylish",
84-
"build": "npm run lint && gulp transform && gulp uglify",
84+
"build": "npm run lint && gulp build",
8585
"develop": "cross-env NODE_ENV=develop gulp",
8686
"start": "gulp connect"
8787
}

quickblox.min.js

Lines changed: 40 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/modules/qbChat.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ PrivacyListProxy.prototype = {
12181218
return iq;
12191219
}
12201220

1221-
for (var index = 0, i = 0, len = listUserId.length; index < len; index++, i = i + 2) {
1221+
for (var index = 0, j = 0, len = listUserId.length; index < len; index++, j = j + 2) {
12221222
userId = listUserId[index];
12231223
mutualBlock = listPrivacy[userId].mutualBlock;
12241224

@@ -1228,23 +1228,23 @@ PrivacyListProxy.prototype = {
12281228

12291229
if(mutualBlock && userAction === 'deny'){
12301230
iq = createPrivacyItemMutal(iq, {
1231-
order: i+1,
1231+
order: j+1,
12321232
jidOrMuc: userJid,
12331233
userAction: userAction
12341234
});
12351235
iq = createPrivacyItemMutal(iq, {
1236-
order: i+2,
1236+
order: j+2,
12371237
jidOrMuc: userMuc,
12381238
userAction: userAction
12391239
}).up().up();
12401240
} else {
12411241
iq = createPrivacyItem(iq, {
1242-
order: i+1,
1242+
order: j+1,
12431243
jidOrMuc: userJid,
12441244
userAction: userAction
12451245
});
12461246
iq = createPrivacyItem(iq, {
1247-
order: i+2,
1247+
order: j+2,
12481248
jidOrMuc: userMuc,
12491249
userAction: userAction
12501250
});

src/modules/qbChatHelpers.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ var qbChatHelpers = {
185185

186186
if (nodeTextContentSize > 4096) {
187187
var wholeNodeContent = "";
188-
for(var j=0; j<extraParams.childNodes[i].childNodes.length; ++j){
189-
wholeNodeContent += extraParams.childNodes[i].childNodes[j].textContent;
188+
for(var k=0; k<extraParams.childNodes[i].childNodes.length; ++k){
189+
wholeNodeContent += extraParams.childNodes[i].childNodes[k].textContent;
190190
}
191191
extension[extraParams.childNodes[i].tagName] = wholeNodeContent;
192192
} else {
@@ -202,14 +202,14 @@ var qbChatHelpers = {
202202
extension.attachments = attachments;
203203
}
204204
} else if(utils.getEnv().node) {
205-
for (var i = 0, len = extraParams.children.length; i < len; i++) {
206-
if(extraParams.children[i].name === 'dialog_id') {
205+
for (var c = 0, lenght = extraParams.children.length; c < lenght; c++) {
206+
if(extraParams.children[c].name === 'dialog_id') {
207207
dialogId = extraParams.getChildText('dialog_id');
208208
extension.dialog_id = dialogId;
209209
}
210210

211-
if(extraParams.children[i].children.length === 1) {
212-
var child = extraParams.children[i];
211+
if(extraParams.children[c].children.length === 1) {
212+
var child = extraParams.children[c];
213213

214214
extension[child.name] = child.children[0];
215215
}

src/modules/qbLocation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function GeoProxy(service){
2222
}
2323

2424
GeoProxy.prototype = {
25-
25+
2626
create: function(params, callback){
2727
Utils.QBLog('[GeoProxy]', 'create', params);
2828

src/qbUtils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ var Utils = {
183183
}
184184

185185
if(this.loggers){
186-
for(var i=0;i<this.loggers.length;++i){
187-
this.loggers[i](arguments);
186+
for(var j=0;j<this.loggers.length;++j){
187+
this.loggers[j](arguments);
188188
}
189189
}
190190
},

0 commit comments

Comments
 (0)