This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.resize { cursor: row-resize; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* XmlHttpRequest's getAllResponseHeaders() method returns a string of response | |
* headers according to the format described here: | |
* http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders-method | |
* This method parses that string into a user-friendly key/value pair object. | |
*/ | |
function parseResponseHeaders(headerStr) { | |
var headers = {}; | |
if (!headerStr) { | |
return headers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (string) => { | |
return string.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// httpRequest | |
// Make Cross Origin http requests for JSON data. | |
// The first path is url, the second is a callback, as a JSON object. | |
// If XHR CORS is not supported then JSONP is used. "&callback=" is appended to the request URL. | |
// @author Andrew Dodson | |
function httpRequest(url,callback){ | |
// IE10, FF, Chrome | |
if('withCredentials' in new XMLHttpRequest()){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function data2blob(data, isBase64) { | |
var chars = ""; | |
if (isBase64) | |
chars = atob(data); | |
else | |
chars = data; | |
var bytes = new Array(chars.length); | |
for (var i = 0; i < chars.length; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Monokai цвета, которые можно использовать в консоли, например: | |
// console.log('%c%s', window.log_color.orange, 'Инициализация скрипта'); | |
window.log_color = { | |
green: [ | |
'color: #272822;', | |
'background-color: #A6E22E;', | |
'padding: 2px 10px;', | |
'width: 100%' | |
].join(' '), | |
red: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function updateURL() { | |
if (history.pushState) { | |
var baseUrl = window.location.protocol + "//" + window.location.host + window.location.pathname; | |
var newUrl = baseUrl + '?tyapk=awesome'; | |
history.pushState(null, null, newUrl); | |
} | |
else { | |
console.warn('History API не поддерживается'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Wrap gulp streams into fail-safe function for better error reporting | |
* Usage: | |
* gulp.task('less', wrapPipe(function(success, error) { | |
* return gulp.src('less/*.less') | |
* .pipe(less().on('error', error)) | |
* .pipe(gulp.dest('app/css')); | |
* })); | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var source = require('vinyl-source-stream'); | |
var buffer = require('vinyl-buffer'); | |
var browserify = require('browserify'); | |
var watchify = require('watchify'); | |
var babel = require('babelify'); | |
function compile(watch) { | |
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel)); |
OlderNewer