Skip to content

Commit

Permalink
Merge 33fa4cc into 25dcc59
Browse files Browse the repository at this point in the history
  • Loading branch information
stellarator committed Apr 4, 2016
2 parents 25dcc59 + 33fa4cc commit a5c751a
Show file tree
Hide file tree
Showing 14 changed files with 130 additions and 130 deletions.
12 changes: 7 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
"camelcase": 2,
"quotes": [2, "single"],
"no-mixed-spaces-and-tabs": [2, "smart-tabs"],
"space-after-function-name": 2,
"space-before-function-paren": 2,
"space-in-parens": 2,
"space-in-brackets": 2,
"object-curly-spacing": 2,
"array-bracket-spacing": 2,
"computed-property-spacing": 2,
"space-before-blocks": 2,
"space-after-keywords": 2,
"keyword-spacing": 2,
"no-lonely-if": 2,
"comma-style": 2,
"indent": 2,
"indent": [2, 4, {"SwitchCase": 1}],
"no-underscore-dangle": 0,
"no-use-before-define": "nofunc",
"no-use-before-define": 0,
"no-constant-condition": 0,
"no-multi-spaces": 0,
"strict": 0,
Expand Down
4 changes: 2 additions & 2 deletions gulp/tasks/clean.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var gulp = require('gulp');
var del = require('del');

gulp.task('clean', function (cb) {
del(['dist', 'gulp/tmp'], cb);
gulp.task('clean', function () {
del(['dist', 'gulp/tmp']);
});
4 changes: 2 additions & 2 deletions gulp/tasks/generateSprites.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ gulp.task('generateSprites', [
cssTemplate: 'gulp/sprite-template.mustache',
imgName: 'sprite.' + skinName + '.png',
cssName: 'sprite.' + skinName + '.less',
engine: 'pngsmith'
engine: 'pixelsmith'
}));
var spriteData2x = gulp.src(png2xList)
.pipe(error.handle())
Expand All @@ -44,7 +44,7 @@ gulp.task('generateSprites', [
//padding: 1, // генерирует неправильные смещения :(
imgName: 'sprite@2x.' + skinName + '.png',
cssName: 'sprite@2x.' + skinName + '.less',
engine: 'pngsmith'
engine: 'pixelsmith'
}));

return es.concat(
Expand Down
6 changes: 3 additions & 3 deletions gulp/util/buildCSS.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var autoprefixer = require('gulp-autoprefixer');
var minify = require('gulp-minify-css');
var clean = require('gulp-clean-css');
var remember = require('gulp-remember');
var concat = require('gulp-concat');
var header = require('gulp-header');
Expand Down Expand Up @@ -69,10 +69,10 @@ module.exports = function (options) {
.pipe(cache('css.' + options.suffix))
.pipe(header(lessPrerequirements))
.pipe(less())
.pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
.pipe(autoprefixer({browsers: ['last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4']}))
.pipe(remember('css.' + options.suffix))
.pipe(concat('styles.' + (options.suffix ? options.suffix + '.' : '') + 'css'))
.pipe(gulpif(util.env.release, minify()))
.pipe(gulpif(util.env.release, clean()))
.pipe(header(config.copyright))
.pipe(map(stat.save));
};
106 changes: 53 additions & 53 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"api"
],
"scripts": {
"start": "node app.js",
"start": "node app",
"test": "gulp test",
"lint": "gulp lint"
},
Expand All @@ -17,69 +17,69 @@
"url": "git://github.com/2gis/maps-api-2.0.git"
},
"dependencies": {
"cli-color": "0.3.2",
"cors": "^2.5.3",
"del": "^1.1.1",
"dustjs-helpers": "1.6.1",
"dustjs-linkedin": "2.6.1",
"event-stream": "^3.2.2",
"express": "^4.11.2",
"glob": "^4.3.5",
"gulp": "^3.8.11",
"gulp-autoprefixer": "^2.1.0",
"gulp-bump": "0.1.13",
"gulp-cached": "^1.1.0",
"gulp-concat": "^2.2.0",
"gulp-dust": "^2.0.0",
"gulp-eslint": "^0.7.0",
"cli-color": "^1.x",
"cors": "^2.x",
"del": "^2.x",
"dustjs-helpers": "1.7.3",
"dustjs-linkedin": "2.7.2",
"event-stream": "^3.x",
"express": "^4.x",
"glob": "^7.x",
"gulp": "^3.x",
"gulp-autoprefixer": "^3.x",
"gulp-bump": "^2.x",
"gulp-cached": "^1.x",
"gulp-clean-css": "^2.x",
"gulp-concat": "^2.x",
"gulp-dust": "^3.x",
"gulp-eslint": "^2.x",
"gulp-file": "0.2.0",
"gulp-flatten": "0.0.4",
"gulp-footer": "^1.0.5",
"gulp-git": "^1.0.0",
"gulp-header": "1.2.2",
"gulp-if": "^1.2.5",
"gulp-imagemin": "^2.2.0",
"gulp-less": "^3.0.0",
"gulp-minify-css": "^0.5.1",
"gulp-notify": "^2.2.0",
"gulp-plumber": "0.6.6",
"gulp-flatten": "0.2.0",
"gulp-footer": "^1.x",
"gulp-git": "^1.x",
"gulp-header": "^1.x",
"gulp-if": "^2.x",
"gulp-imagemin": "^2.x",
"gulp-less": "^3.x",
"gulp-notify": "^2.x",
"gulp-plumber": "^1.x",
"gulp-remember": "^0.3.0",
"gulp-rename": "^1.2.0",
"gulp-replace": "^0.5.3",
"gulp-rename": "^1.x",
"gulp-replace": "^0.5.4",
"gulp-rsvg": "^1.0.1",
"gulp-sourcemaps": "^1.3.0",
"gulp-uglify": "^1.1.0",
"gulp-util": "^3.0.3",
"gulp.spritesmith": "^3.2.0",
"happen": "~0.2.0",
"html5shiv": "^3.7.2",
"image-size": "0.3.5",
"karma": "^0.13.10",
"gulp-sourcemaps": "^1.x",
"gulp-uglify": "^1.x",
"gulp-util": "^3.x",
"gulp.spritesmith": "^6.x",
"happen": "~0.3.0",
"html5shiv": "^3.x",
"image-size": "0.5.0",
"karma": "^0.13.22",
"leaflet": "git://github.com/Leaflet/Leaflet.git#07039e05a9d2d2e20ecaba3fc9ebd25db9ff72fc",
"less": "^2.4.0",
"lodash": "^4.3.0",
"less": "^2.x",
"lodash": "^4.x",
"map-stream": "0.1.0",
"marked": "0.3.3",
"mkdirp": "0.5.0",
"marked": "0.3.5",
"mkdirp": "0.5.1",
"optimist": "^0.6.1",
"pngsmith": "^0.1.3",
"pretty-bytes": "^1.0.2",
"request": "^2.53.0",
"require-dir": "^0.1.0",
"run-sequence": "^1.0.2",
"streamqueue": "^1.1.0"
"pixelsmith": "^2.x",
"pretty-bytes": "^3.x",
"request": "^2.x",
"require-dir": "^0.3.0",
"run-sequence": "^1.x",
"streamqueue": "^1.x"
},
"devDependencies": {
"coveralls": "^2.11.2",
"coveralls": "^2.x",
"karma-chrome-launcher": "^0.2.0",
"karma-coverage": "^0.5.2",
"karma-coverage": "^0.5.5",
"karma-expect": "^1.1.0",
"karma-firefox-launcher": "^0.1.6",
"karma-firefox-launcher": "^0.1.0",
"karma-mocha": "^0.2.0",
"karma-mocha-reporter": "^1.1.1",
"karma-mocha-reporter": "^2.x",
"karma-opera-launcher": "^0.3.0",
"karma-phantomjs-launcher": "^0.2.1",
"karma-sinon": "^1.0.4",
"mock-geolocation": "^1.0.9"
"karma-phantomjs-launcher": "^1.x",
"karma-sinon": "^1.x",
"mock-geolocation": "^1.x"
}
}
62 changes: 31 additions & 31 deletions src/DGAjax/src/DGAjax.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ DG.ajax = (function () {
// Segment location into parts
ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || [];

function handleReadyState(r, success, error) {
function handleReadyState (r, success, error) {
return function () {
// use _aborted to mitigate against IE err c00c023f
// (can't read props on aborted request objects)
Expand All @@ -91,7 +91,7 @@ DG.ajax = (function () {
};
}

function setHeaders(http, o) {
function setHeaders (http, o) {
var headers = o.headers || {},
h;

Expand All @@ -111,21 +111,21 @@ DG.ajax = (function () {
}
}

function setCredentials(http, o) {
function setCredentials (http, o) {
if (typeof o.withCredentials !== 'undefined' && typeof http.withCredentials !== 'undefined') {
http.withCredentials = !!o.withCredentials;
}
}

function generalCallback(data) {
function generalCallback (data) {
lastValue = data;
}

function urlappend(url, s) {
function urlappend (url, s) {
return url + (/\?/.test(url) ? '&' : '?') + s;
}

function handleJsonp(o, fn, err, url) {
function handleJsonp (o, fn, err, url) {
var reqId = uniqid++,
cbkey = o.jsonpCallback || 'callback', // the 'callback' key
cbval = o.jsonpCallbackName || callbackPrefix,
Expand Down Expand Up @@ -197,7 +197,7 @@ DG.ajax = (function () {
};
}

function getRequest(fn, err) {
function getRequest (fn, err) {
var o = this.options,
method = (o.type || 'GET').toUpperCase(),
url = typeof o === 'string' ? o : o.url,
Expand Down Expand Up @@ -242,7 +242,7 @@ DG.ajax = (function () {
return http;
}

function buildParams(prefix, obj, traditional, add) {
function buildParams (prefix, obj, traditional, add) {
var name, i, v,
rbracket = /\[\]$/;

Expand Down Expand Up @@ -270,12 +270,12 @@ DG.ajax = (function () {
}
}

function setType(url) {
function setType (url) {
var m = url.match(/\.(json|jsonp|html|xml)(\?|$)/);
return m ? m[1] : 'js';
}

function isCrossDomain(url) {
function isCrossDomain (url) {
var parts = rurl.exec(url.toLowerCase());
return !!(parts &&
(parts[1] !== ajaxLocParts[1] || parts[2] !== ajaxLocParts[2] ||
Expand All @@ -284,7 +284,7 @@ DG.ajax = (function () {
);
}

function doRequest(o) {
function doRequest (o) {

if (!('crossDomain' in o)) {
o.crossDomain = isCrossDomain(o.url);
Expand Down Expand Up @@ -313,7 +313,7 @@ DG.ajax = (function () {
}, o.timeout);
}

function complete(resp) {
function complete (resp) {
if (o.timeout) {
clearTimeout(self.timeout);
}
Expand All @@ -325,7 +325,7 @@ DG.ajax = (function () {
}
}

function success(resp) {
function success (resp) {
resp = (type !== 'jsonp') ? self.request : resp;
// use global data filter on response text
var filteredResponse = globalSetupOptions.dataFilter(resp.responseText, type),
Expand All @@ -339,30 +339,30 @@ DG.ajax = (function () {
/* eslint-disable no-eval */
if (r) {
switch (type) {
case 'json':
try {
resp = win.JSON ? win.JSON.parse(r) : eval('(' + r + ')');
} catch (err) {
return error(resp, 'Could not parse JSON in response', err);
}
break;
case 'js':
resp = eval('(' + r + ')');
break;
case 'html':
resp = r;
break;
case 'xml':
resp = resp.responseXML && resp.responseXML.parseError && resp.responseXML.parseError.errorCode && resp.responseXML.parseError.reason ? null : resp.responseXML;
break;
case 'json':
try {
resp = win.JSON ? win.JSON.parse(r) : eval('(' + r + ')');
} catch (err) {
return error(resp, 'Could not parse JSON in response', err);
}
break;
case 'js':
resp = eval('(' + r + ')');
break;
case 'html':
resp = r;
break;
case 'xml':
resp = resp.responseXML && resp.responseXML.parseError && resp.responseXML.parseError.errorCode && resp.responseXML.parseError.reason ? null : resp.responseXML;
break;
}
}
/* eslint-enable no-eval */
self._responseArgs.resp = resp;
complete(resp);
}

function error(resp, msg, t) {
function error (resp, msg, t) {
resp = self.request;
self._responseArgs.resp = resp;
self._responseArgs.msg = msg;
Expand All @@ -377,7 +377,7 @@ DG.ajax = (function () {
return self;
}

function Ajax(url, options) {
function Ajax (url, options) {

if (Object.prototype.toString.call(url) === '[object Object]') {
options = url;
Expand Down

0 comments on commit a5c751a

Please sign in to comment.