code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
function extractFiles(items, fileList, allowDir, multiple) {
var maxFiles = upload.getValidationAttr(attr, scope, 'maxFiles');
if (maxFiles == null) {
maxFiles = Number.MAX_VALUE;
}
var maxTotalSize = upload.getValidationAttr(attr, scope, 'maxTotalSize');
if (maxTotalSize == null) ... | Conserve aspect ratio of the original region. Useful when shrinking/enlarging
images to fit into a certain area.
Source: http://stackoverflow.com/a/14731922
@param {Number} srcWidth Source area width
@param {Number} srcHeight Source area height
@param {Number} maxWidth Nestable area maximum available width
@param {Nu... | extractFiles | javascript | danialfarid/ng-file-upload | dist/ng-file-upload.js | https://github.com/danialfarid/ng-file-upload/blob/master/dist/ng-file-upload.js | MIT |
function traverseFileTree(entry, path) {
var defer = $q.defer();
if (entry != null) {
if (entry.isDirectory) {
var promises = [upload.emptyPromise()];
if (includeDir) {
var file = {type: 'directory'};
file.name = file.path = (path || '') + en... | Conserve aspect ratio of the original region. Useful when shrinking/enlarging
images to fit into a certain area.
Source: http://stackoverflow.com/a/14731922
@param {Number} srcWidth Source area width
@param {Number} srcHeight Source area height
@param {Number} maxWidth Nestable area maximum available width
@param {Nu... | traverseFileTree | javascript | danialfarid/ng-file-upload | dist/ng-file-upload.js | https://github.com/danialfarid/ng-file-upload/blob/master/dist/ng-file-upload.js | MIT |
readEntries = function () {
dirReader.readEntries(function (results) {
try {
if (!results.length) {
angular.forEach(entries.slice(0), function (e) {
if (files.length <= maxFiles && totalSize <= maxTotalSize) {
... | Conserve aspect ratio of the original region. Useful when shrinking/enlarging
images to fit into a certain area.
Source: http://stackoverflow.com/a/14731922
@param {Number} srcWidth Source area width
@param {Number} srcHeight Source area height
@param {Number} maxWidth Nestable area maximum available width
@param {Nu... | readEntries | javascript | danialfarid/ng-file-upload | dist/ng-file-upload.js | https://github.com/danialfarid/ng-file-upload/blob/master/dist/ng-file-upload.js | MIT |
function dropAvailable() {
var div = document.createElement('div');
return ('draggable' in div) && ('ondrop' in div) && !/Edge\/12./i.test(navigator.userAgent);
} | Conserve aspect ratio of the original region. Useful when shrinking/enlarging
images to fit into a certain area.
Source: http://stackoverflow.com/a/14731922
@param {Number} srcWidth Source area width
@param {Number} srcHeight Source area height
@param {Number} maxWidth Nestable area maximum available width
@param {Nu... | dropAvailable | javascript | danialfarid/ng-file-upload | dist/ng-file-upload.js | https://github.com/danialfarid/ng-file-upload/blob/master/dist/ng-file-upload.js | MIT |
function applyTransform(ctx, orientation, width, height) {
switch (orientation) {
case 2:
return ctx.transform(-1, 0, 0, 1, width, 0);
case 3:
return ctx.transform(-1, 0, 0, -1, width, height);
case 4:
return ctx.transform(1, 0, 0, -1, 0, height);
case 5:
retu... | Conserve aspect ratio of the original region. Useful when shrinking/enlarging
images to fit into a certain area.
Source: http://stackoverflow.com/a/14731922
@param {Number} srcWidth Source area width
@param {Number} srcHeight Source area height
@param {Number} maxWidth Nestable area maximum available width
@param {Nu... | applyTransform | javascript | danialfarid/ng-file-upload | dist/ng-file-upload.js | https://github.com/danialfarid/ng-file-upload/blob/master/dist/ng-file-upload.js | MIT |
function arrayBufferToBase64(buffer) {
var binary = '';
var bytes = new Uint8Array(buffer);
var len = bytes.byteLength;
for (var i = 0; i < len; i++) {
binary += String.fromCharCode(bytes[i]);
}
return window.btoa(binary);
} | Conserve aspect ratio of the original region. Useful when shrinking/enlarging
images to fit into a certain area.
Source: http://stackoverflow.com/a/14731922
@param {Number} srcWidth Source area width
@param {Number} srcHeight Source area height
@param {Number} maxWidth Nestable area maximum available width
@param {Nu... | arrayBufferToBase64 | javascript | danialfarid/ng-file-upload | dist/ng-file-upload.js | https://github.com/danialfarid/ng-file-upload/blob/master/dist/ng-file-upload.js | MIT |
_extend = function (dst){
var args = arguments, i = 1, _ext = function (val, key){ dst[key] = val; };
for( ; i < args.length; i++ ){
_each(args[i], _ext);
}
return dst;
} | Merge the contents of two or more objects together into the first object | _extend | javascript | danialfarid/ng-file-upload | src/FileAPI.js | https://github.com/danialfarid/ng-file-upload/blob/master/src/FileAPI.js | MIT |
function Image(file){
if( file instanceof Image ){
var img = new Image(file.file);
api.extend(img.matrix, file.matrix);
return img;
}
else if( !(this instanceof Image) ){
return new Image(file);
}
this.file = file;
this.size = file.size || 100;
this.matrix = {
sx: 0,
sy: 0,
sw: ... | Remove drag'n'drop
@param {HTMLElement} el
@param {Function} onHover
@param {Function} onDrop | Image | javascript | danialfarid/ng-file-upload | src/FileAPI.js | https://github.com/danialfarid/ng-file-upload/blob/master/src/FileAPI.js | MIT |
fn = function (){
var
x = over.x|0
, y = over.y|0
, w = over.w || img.width
, h = over.h || img.height
, rel = over.rel
;
// center | right | left
x = (rel == 1 || rel == 4 || rel == 7) ? (dw - w + x)/2 : (rel == 2 || rel == 5 || rel == 8 ? dw - (w + x) : x);
... | Remove drag'n'drop
@param {HTMLElement} el
@param {Function} onHover
@param {Function} onDrop | fn | javascript | danialfarid/ng-file-upload | src/FileAPI.js | https://github.com/danialfarid/ng-file-upload/blob/master/src/FileAPI.js | MIT |
function _transform(err, img){
// img -- info object
var
images = {}
, queue = api.queue(function (err){
fn(err, images);
})
;
if( !err ){
api.each(transform, function (params, name){
if( !queue.isFail() ){
var ImgTrans = new Image(img.nodeType ? img : file), isFn = typeof... | Remove drag'n'drop
@param {HTMLElement} el
@param {Function} onHover
@param {Function} onDrop | _transform | javascript | danialfarid/ng-file-upload | src/FileAPI.js | https://github.com/danialfarid/ng-file-upload/blob/master/src/FileAPI.js | MIT |
_complete = function (err){
_this._active = !err;
clearTimeout(_failId);
clearTimeout(_successId);
// api.event.off(video, 'loadedmetadata', _complete);
callback && callback(err, _this);
} | Start camera streaming
@param {Function} callback | _complete | javascript | danialfarid/ng-file-upload | src/FileAPI.js | https://github.com/danialfarid/ng-file-upload/blob/master/src/FileAPI.js | MIT |
doneFn = function (err){
if( err ){
callback(err);
}
else {
// Get camera
var cam = Camera.get(el);
if( options.start ){
cam.start(callback);
}
else {
callback(null, cam);
}
}
} | Publish camera element into container
@static
@param {HTMLElement} el
@param {Object} options
@param {Function} [callback] | doneFn | javascript | danialfarid/ng-file-upload | src/FileAPI.js | https://github.com/danialfarid/ng-file-upload/blob/master/src/FileAPI.js | MIT |
function _px(val){
return val >= 0 ? val + 'px' : val;
} | Add "px" postfix, if value is a number
@private
@param {*} val
@return {String} | _px | javascript | danialfarid/ng-file-upload | src/FileAPI.js | https://github.com/danialfarid/ng-file-upload/blob/master/src/FileAPI.js | MIT |
function _detectVideoSignal(video){
var canvas = document.createElement('canvas'), ctx, res = false;
try {
ctx = canvas.getContext('2d');
ctx.drawImage(video, 0, 0, 1, 1);
res = ctx.getImageData(0, 0, 1, 1).data[4] != 255;
}
catch( e ){}
return res;
} | @private
@param {HTMLVideoElement} video
@return {Boolean} | _detectVideoSignal | javascript | danialfarid/ng-file-upload | src/FileAPI.js | https://github.com/danialfarid/ng-file-upload/blob/master/src/FileAPI.js | MIT |
function _wrap(fn) {
var id = fn.wid = api.uid();
api.Flash._fn[id] = fn;
return 'FileAPI.Flash._fn.' + id;
} | FileAPI fallback to Flash
@flash-developer "Vladimir Demidov" <v.demidov@corp.mail.ru> | _wrap | javascript | danialfarid/ng-file-upload | src/FileAPI.js | https://github.com/danialfarid/ng-file-upload/blob/master/src/FileAPI.js | MIT |
function _unwrap(fn) {
try {
api.Flash._fn[fn.wid] = null;
delete api.Flash._fn[fn.wid];
} catch (e) {
}
} | FileAPI fallback to Flash
@flash-developer "Vladimir Demidov" <v.demidov@corp.mail.ru> | _unwrap | javascript | danialfarid/ng-file-upload | src/FileAPI.js | https://github.com/danialfarid/ng-file-upload/blob/master/src/FileAPI.js | MIT |
calculateAspectRatioFit = function (srcWidth, srcHeight, maxWidth, maxHeight, centerCrop) {
var ratio = centerCrop ? Math.max(maxWidth / srcWidth, maxHeight / srcHeight) :
Math.min(maxWidth / srcWidth, maxHeight / srcHeight);
return {
width: srcWidth * ratio, height: srcHeight * ratio,
marginX... | Conserve aspect ratio of the original region. Useful when shrinking/enlarging
images to fit into a certain area.
Source: http://stackoverflow.com/a/14731922
@param {Number} srcWidth Source area width
@param {Number} srcHeight Source area height
@param {Number} maxWidth Nestable area maximum available width
@param {Nu... | calculateAspectRatioFit | javascript | danialfarid/ng-file-upload | src/resize.js | https://github.com/danialfarid/ng-file-upload/blob/master/src/resize.js | MIT |
resize = function (imagen, width, height, quality, type, ratio, centerCrop, resizeIf) {
var deferred = $q.defer();
var canvasElement = document.createElement('canvas');
var imageElement = document.createElement('img');
imageElement.setAttribute('style', 'visibility:hidden;position:fixed;z-index:-100000'... | Conserve aspect ratio of the original region. Useful when shrinking/enlarging
images to fit into a certain area.
Source: http://stackoverflow.com/a/14731922
@param {Number} srcWidth Source area width
@param {Number} srcHeight Source area height
@param {Number} maxWidth Nestable area maximum available width
@param {Nu... | resize | javascript | danialfarid/ng-file-upload | src/resize.js | https://github.com/danialfarid/ng-file-upload/blob/master/src/resize.js | MIT |
function sendHttp(config) {
config.method = config.method || 'POST';
config.headers = config.headers || {};
var deferred = config._deferred = config._deferred || $q.defer();
var promise = deferred.promise;
function notifyProgress(e) {
if (deferred.notify) {
deferred.notify(e);
... | !
AngularJS file upload directives and services. Supoorts: file upload/drop/paste, resume, cancel/abort,
progress, resize, thumbnail, preview, validation and CORS
@author Danial <danial.farid@gmail.com>
@version <%= pkg.version %> | sendHttp | javascript | danialfarid/ng-file-upload | src/upload.js | https://github.com/danialfarid/ng-file-upload/blob/master/src/upload.js | MIT |
function notifyProgress(e) {
if (deferred.notify) {
deferred.notify(e);
}
if (promise.progressFunc) {
$timeout(function () {
promise.progressFunc(e);
});
}
} | !
AngularJS file upload directives and services. Supoorts: file upload/drop/paste, resume, cancel/abort,
progress, resize, thumbnail, preview, validation and CORS
@author Danial <danial.farid@gmail.com>
@version <%= pkg.version %> | notifyProgress | javascript | danialfarid/ng-file-upload | src/upload.js | https://github.com/danialfarid/ng-file-upload/blob/master/src/upload.js | MIT |
function getNotifyEvent(n) {
if (config._start != null && resumeSupported) {
return {
loaded: n.loaded + config._start,
total: (config._file && config._file.size) || n.total,
type: n.type, config: config,
lengthComputable: true, target: n.target
};
} e... | !
AngularJS file upload directives and services. Supoorts: file upload/drop/paste, resume, cancel/abort,
progress, resize, thumbnail, preview, validation and CORS
@author Danial <danial.farid@gmail.com>
@version <%= pkg.version %> | getNotifyEvent | javascript | danialfarid/ng-file-upload | src/upload.js | https://github.com/danialfarid/ng-file-upload/blob/master/src/upload.js | MIT |
function uploadWithAngular() {
$http(config).then(function (r) {
if (resumeSupported && config._chunkSize && !config._finished && config._file) {
var fileSize = config._file && config._file.size || 0;
notifyProgress({
loaded: Math.min(config._end, fileSize),
... | !
AngularJS file upload directives and services. Supoorts: file upload/drop/paste, resume, cancel/abort,
progress, resize, thumbnail, preview, validation and CORS
@author Danial <danial.farid@gmail.com>
@version <%= pkg.version %> | uploadWithAngular | javascript | danialfarid/ng-file-upload | src/upload.js | https://github.com/danialfarid/ng-file-upload/blob/master/src/upload.js | MIT |
function copy(obj) {
var clone = {};
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
clone[key] = obj[key];
}
}
return clone;
} | !
AngularJS file upload directives and services. Supoorts: file upload/drop/paste, resume, cancel/abort,
progress, resize, thumbnail, preview, validation and CORS
@author Danial <danial.farid@gmail.com>
@version <%= pkg.version %> | copy | javascript | danialfarid/ng-file-upload | src/upload.js | https://github.com/danialfarid/ng-file-upload/blob/master/src/upload.js | MIT |
function toResumeFile(file, formData) {
if (file._ngfBlob) return file;
config._file = config._file || file;
if (config._start != null && resumeSupported) {
if (config._end && config._end >= file.size) {
config._finished = true;
config._end = file.size;
}
va... | !
AngularJS file upload directives and services. Supoorts: file upload/drop/paste, resume, cancel/abort,
progress, resize, thumbnail, preview, validation and CORS
@author Danial <danial.farid@gmail.com>
@version <%= pkg.version %> | toResumeFile | javascript | danialfarid/ng-file-upload | src/upload.js | https://github.com/danialfarid/ng-file-upload/blob/master/src/upload.js | MIT |
function addFieldToFormData(formData, val, key) {
if (val !== undefined) {
if (angular.isDate(val)) {
val = val.toISOString();
}
if (angular.isString(val)) {
formData.append(key, val);
} else if (upload.isFile(val)) {
var file = toResumeFile(val, formD... | !
AngularJS file upload directives and services. Supoorts: file upload/drop/paste, resume, cancel/abort,
progress, resize, thumbnail, preview, validation and CORS
@author Danial <danial.farid@gmail.com>
@version <%= pkg.version %> | addFieldToFormData | javascript | danialfarid/ng-file-upload | src/upload.js | https://github.com/danialfarid/ng-file-upload/blob/master/src/upload.js | MIT |
function digestConfig() {
config._chunkSize = upload.translateScalars(config.resumeChunkSize);
config._chunkSize = config._chunkSize ? parseInt(config._chunkSize.toString()) : null;
config.headers = config.headers || {};
config.headers['Content-Type'] = undefined;
config.transformRequest ... | !
AngularJS file upload directives and services. Supoorts: file upload/drop/paste, resume, cancel/abort,
progress, resize, thumbnail, preview, validation and CORS
@author Danial <danial.farid@gmail.com>
@version <%= pkg.version %> | digestConfig | javascript | danialfarid/ng-file-upload | src/upload.js | https://github.com/danialfarid/ng-file-upload/blob/master/src/upload.js | MIT |
work = function() {
setTimeout(function() {
if (!NProgress.status) return;
NProgress.trickle();
work();
}, Settings.trickleSpeed);
} | Shows the progress bar.
This is the same as setting the status to 0%, except that it doesn't go backwards.
NProgress.start(); | work | javascript | rstacruz/nprogress | nprogress.js | https://github.com/rstacruz/nprogress/blob/master/nprogress.js | MIT |
function toBarPerc(n) {
return (-1 + n) * 100;
} | (Internal) converts a percentage (`0..1`) to a bar translateX
percentage (`-100%..0%`). | toBarPerc | javascript | rstacruz/nprogress | nprogress.js | https://github.com/rstacruz/nprogress/blob/master/nprogress.js | MIT |
function barPositionCSS(n, speed, ease) {
var barCSS;
if (Settings.positionUsing === 'translate3d') {
barCSS = { transform: 'translate3d('+toBarPerc(n)+'%,0,0)' };
} else if (Settings.positionUsing === 'translate') {
barCSS = { transform: 'translate('+toBarPerc(n)+'%,0)' };
} else {
b... | (Internal) returns the correct CSS for changing the bar's
position given an n percentage, and speed and ease from Settings | barPositionCSS | javascript | rstacruz/nprogress | nprogress.js | https://github.com/rstacruz/nprogress/blob/master/nprogress.js | MIT |
function next() {
var fn = pending.shift();
if (fn) {
fn(next);
}
} | (Internal) Queues a function to be executed. | next | javascript | rstacruz/nprogress | nprogress.js | https://github.com/rstacruz/nprogress/blob/master/nprogress.js | MIT |
function camelCase(string) {
return string.replace(/^-ms-/, 'ms-').replace(/-([\da-z])/gi, function(match, letter) {
return letter.toUpperCase();
});
} | (Internal) Applies css properties to an element, similar to the jQuery
css method.
While this helper does assist with vendor prefixed property names, it
does not perform any manipulation of values prior to setting styles. | camelCase | javascript | rstacruz/nprogress | nprogress.js | https://github.com/rstacruz/nprogress/blob/master/nprogress.js | MIT |
function getVendorProp(name) {
var style = document.body.style;
if (name in style) return name;
var i = cssPrefixes.length,
capName = name.charAt(0).toUpperCase() + name.slice(1),
vendorName;
while (i--) {
vendorName = cssPrefixes[i] + capName;
if (vendorName... | (Internal) Applies css properties to an element, similar to the jQuery
css method.
While this helper does assist with vendor prefixed property names, it
does not perform any manipulation of values prior to setting styles. | getVendorProp | javascript | rstacruz/nprogress | nprogress.js | https://github.com/rstacruz/nprogress/blob/master/nprogress.js | MIT |
function getStyleProp(name) {
name = camelCase(name);
return cssProps[name] || (cssProps[name] = getVendorProp(name));
} | (Internal) Applies css properties to an element, similar to the jQuery
css method.
While this helper does assist with vendor prefixed property names, it
does not perform any manipulation of values prior to setting styles. | getStyleProp | javascript | rstacruz/nprogress | nprogress.js | https://github.com/rstacruz/nprogress/blob/master/nprogress.js | MIT |
function applyCss(element, prop, value) {
prop = getStyleProp(prop);
element.style[prop] = value;
} | (Internal) Applies css properties to an element, similar to the jQuery
css method.
While this helper does assist with vendor prefixed property names, it
does not perform any manipulation of values prior to setting styles. | applyCss | javascript | rstacruz/nprogress | nprogress.js | https://github.com/rstacruz/nprogress/blob/master/nprogress.js | MIT |
function hasClass(element, name) {
var list = typeof element == 'string' ? element : classList(element);
return list.indexOf(' ' + name + ' ') >= 0;
} | (Internal) Determines if an element or space separated list of class names contains a class name. | hasClass | javascript | rstacruz/nprogress | nprogress.js | https://github.com/rstacruz/nprogress/blob/master/nprogress.js | MIT |
function addClass(element, name) {
var oldList = classList(element),
newList = oldList + name;
if (hasClass(oldList, name)) return;
// Trim the opening space.
element.className = newList.substring(1);
} | (Internal) Adds a class to an element. | addClass | javascript | rstacruz/nprogress | nprogress.js | https://github.com/rstacruz/nprogress/blob/master/nprogress.js | MIT |
function removeClass(element, name) {
var oldList = classList(element),
newList;
if (!hasClass(element, name)) return;
// Replace the class name.
newList = oldList.replace(' ' + name + ' ', ' ');
// Trim the opening and closing spaces.
element.className = newList.substring(1, newList.... | (Internal) Removes a class from an element. | removeClass | javascript | rstacruz/nprogress | nprogress.js | https://github.com/rstacruz/nprogress/blob/master/nprogress.js | MIT |
function classList(element) {
return (' ' + (element && element.className || '') + ' ').replace(/\s+/gi, ' ');
} | (Internal) Gets a space separated list of the class names on the element.
The list is wrapped with a single space on each end to facilitate finding
matches within the list. | classList | javascript | rstacruz/nprogress | nprogress.js | https://github.com/rstacruz/nprogress/blob/master/nprogress.js | MIT |
function removeElement(element) {
element && element.parentNode && element.parentNode.removeChild(element);
} | (Internal) Removes an element from the DOM. | removeElement | javascript | rstacruz/nprogress | nprogress.js | https://github.com/rstacruz/nprogress/blob/master/nprogress.js | MIT |
static k_combinations(set, k) {
var i, j, combs, head, tailcombs;
if (k > set.length || k <= 0) {
return [];
}
if (k === set.length) {
return [set];
}
if (k === 1) {
combs = [];
for (i = 0; i < set.length; i++) {
combs.push([set[i]]);
}
return combs;
}
// Assert ... | K-combinations
Get k-sized combinations of elements in a set.
Usage:
k_combinations(set, k)
Parameters:
set: Array of objects of any type. They are treated as unique.
k: size of combinations to search for.
Return:
Array of found combinations, size of a combination is k.
Examples:
k_combinations([1, 2, 3... | k_combinations | javascript | CharlieHess/slack-poker-bot | util/combinations.js | https://github.com/CharlieHess/slack-poker-bot/blob/master/util/combinations.js | MIT |
static combinations(set) {
var k, i, combs, k_combs;
combs = [];
// Calculate all non-empty k-combinations
for (k = 1; k <= set.length; k++) {
k_combs = Combinations.k_combinations(set, k);
for (i = 0; i < k_combs.length; i++) {
combs.push(k_combs[i]);
}
}
return combs;
} | Combinations
Get all possible combinations of elements in a set.
Usage:
combinations(set)
Examples:
combinations([1, 2, 3])
-> [[1],[2],[3],[1,2],[1,3],[2,3],[1,2,3]]
combinations([1])
-> [[1]] | combinations | javascript | CharlieHess/slack-poker-bot | util/combinations.js | https://github.com/CharlieHess/slack-poker-bot/blob/master/util/combinations.js | MIT |
U = function (a, b) {
if (!a) {
return '';
}
b = b || 'x';
var c = '';
var d = 0;
var e;
for (d; d < a.length; d += 1) a.charCodeAt(d) >= 55296 && a.charCodeAt(d) <= 56319 ? (e = (65536 + 1024 * (Number(a.charCodeAt(d)) - 55296) + Number(a.charCodeAt(... | @Keyboard.js
@author zhangxinxu
@version
Created: 17-06-13 | U | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
static get observedAttributes () {
return ['open'];
} | @Pagination.js
@author sunmeiye
@version
@Created: 20-06-07
@edit: 20-06-07 | observedAttributes | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
static get defaults () {
return {
eventType: 'click',
history: false,
autoplay: 3000
};
} | @Pagination.js
@author sunmeiye
@version
@Created: 20-06-07
@edit: 20-06-07 | defaults | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
get eventType () {
let strEventType = this.getAttribute('eventtype') || Tab.defaults.eventType;
if (strEventType == 'hover') {
strEventType = 'mouseenter';
}
return strEventType;
} | @Pagination.js
@author sunmeiye
@version
@Created: 20-06-07
@edit: 20-06-07 | eventType | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
set eventType (value) {
this.setAttribute('eventtype', value);
} | @Pagination.js
@author sunmeiye
@version
@Created: 20-06-07
@edit: 20-06-07 | eventType | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
get history () {
return this.hasAttribute('history') || Tab.defaults.history;
} | @Pagination.js
@author sunmeiye
@version
@Created: 20-06-07
@edit: 20-06-07 | history | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
set history (value) {
this.toggleAttribute('history', value);
} | @Pagination.js
@author sunmeiye
@version
@Created: 20-06-07
@edit: 20-06-07 | history | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
get autoplay () {
let strAttrAutoplay = this.getAttribute('autoplay');
if (typeof strAttrAutoplay !== 'string') {
return false;
}
if (/^\d+$/.test(strAttrAutoplay)) {
return strAttrAutoplay * 1;
}
return Tab.defaults.autoplay;
} | @Pagination.js
@author sunmeiye
@version
@Created: 20-06-07
@edit: 20-06-07 | autoplay | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
set autoplay (value) {
if (!value && value !== '') {
this.removeAttribute('autoplay');
} else {
this.setAttribute('autoplay', value);
}
} | @Pagination.js
@author sunmeiye
@version
@Created: 20-06-07
@edit: 20-06-07 | autoplay | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
get name () {
return this.getAttribute('name');
} | @Pagination.js
@author sunmeiye
@version
@Created: 20-06-07
@edit: 20-06-07 | name | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
set name (value) {
this.setAttribute('name', value);
} | @Pagination.js
@author sunmeiye
@version
@Created: 20-06-07
@edit: 20-06-07 | name | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
get htmlFor () {
return this.getAttribute('for');
} | @Pagination.js
@author sunmeiye
@version
@Created: 20-06-07
@edit: 20-06-07 | htmlFor | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
get target () {
return this.getAttribute('target');
} | @Pagination.js
@author sunmeiye
@version
@Created: 20-06-07
@edit: 20-06-07 | target | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
set target (value) {
this.setAttribute('target', value);
} | @Pagination.js
@author sunmeiye
@version
@Created: 20-06-07
@edit: 20-06-07 | target | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
get open () {
return this.hasAttribute('open');
} | @Pagination.js
@author sunmeiye
@version
@Created: 20-06-07
@edit: 20-06-07 | open | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
set open (value) {
this.toggleAttribute('open', value);
} | @Pagination.js
@author sunmeiye
@version
@Created: 20-06-07
@edit: 20-06-07 | open | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
setParams (options) {
this.params = this.params || {};
options = options || {};
Object.assign(this.params, options);
} | @Pagination.js
@author sunmeiye
@version
@Created: 20-06-07
@edit: 20-06-07 | setParams | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
get reverse () {
return this.getAttribute('reverse') !== null || this.classList.contains('reverse');
} | @LightTip.js
@author popeyesailorman(yangfan)
@version
@Created: 20-05-15
@edit: 20-05-15 | reverse | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
set reverse (value) {
if (value) {
this.setAttribute('reverse', '');
} else {
this.removeAttribute('reverse');
}
} | @LightTip.js
@author popeyesailorman(yangfan)
@version
@Created: 20-05-15
@edit: 20-05-15 | reverse | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
get htmlFor () {
return this.getAttribute('for');
} | @LightTip.js
@author popeyesailorman(yangfan)
@version
@Created: 20-05-15
@edit: 20-05-15 | htmlFor | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
set htmlFor (v) {
this.setAttribute('for', v);
} | @LightTip.js
@author popeyesailorman(yangfan)
@version
@Created: 20-05-15
@edit: 20-05-15 | htmlFor | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
get align () {
return this.getAttribute('align') || 'auto';
} | @LightTip.js
@author popeyesailorman(yangfan)
@version
@Created: 20-05-15
@edit: 20-05-15 | align | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
set align (v) {
this.setAttribute('align', v);
} | @LightTip.js
@author popeyesailorman(yangfan)
@version
@Created: 20-05-15
@edit: 20-05-15 | align | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
get eventType () {
return this.getAttribute('eventtype') || 'hover';
} | @LightTip.js
@author popeyesailorman(yangfan)
@version
@Created: 20-05-15
@edit: 20-05-15 | eventType | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
set eventType (v) {
this.setAttribute('eventtype', v);
} | @LightTip.js
@author popeyesailorman(yangfan)
@version
@Created: 20-05-15
@edit: 20-05-15 | eventType | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
get trigger () {
const htmlFor = this.htmlFor;
let eleTrigger;
if (htmlFor) {
eleTrigger = document.getElementById(htmlFor);
}
return eleTrigger || this;
} | @LightTip.js
@author popeyesailorman(yangfan)
@version
@Created: 20-05-15
@edit: 20-05-15 | trigger | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
hide () {
if (!this.target) {
return;
}
this.target.style.display = 'none';
this.trigger.dispatchEvent(new CustomEvent('hide', {
detail: {
type: 'ui-tips'
}
}));
} | @LightTip.js
@author popeyesailorman(yangfan)
@version
@Created: 20-05-15
@edit: 20-05-15 | hide | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
remove () {
if (this.parentElement) {
this.parentElement.removeChild(this);
}
this.open = false;
} | @Range.js
@author xboxyan
@version
@created: 20-04-30 | remove | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
show () {
if (this.time > 0) {
this.open = true;
}
} | @Range.js
@author xboxyan
@version
@created: 20-04-30 | show | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
hide () {
this.open = false;
} | @Range.js
@author xboxyan
@version
@created: 20-04-30 | hide | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
static allHide (exclude) {
ErrorTip.collectionErrorTip.forEach(obj => {
if (exclude != obj) {
obj.hide();
}
});
} | @Range.js
@author xboxyan
@version
@created: 20-04-30 | allHide | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
get () {
return !!(this.classList.contains(CL) || this.matches(CL));
} | @Color.js
@author zhangxinxu
@version
@created 16-06-03
@edited 20-07-16 @Gwokhov | get | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
set (flag) {
let action = 'remove';
if (flag) {
action = 'add';
if (this.loading) {
return flag;
}
}
let strClassButton = CL.replace(LOADING, 'button');
if (this.classList.contains(strClassBut... | @Color.js
@author zhangxinxu
@version
@created 16-06-03
@edited 20-07-16 @Gwokhov | set | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
get () {
return document.validate.getValidity(this);
} | @Pagination.js
@author XboxYan(yanwenbin)
@version
@Created: 20-04-22
@edit: 20-04-22 | get | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
get () {
return document.validate.getReportText(this);
} | @Pagination.js
@author XboxYan(yanwenbin)
@version
@Created: 20-04-22
@edit: 20-04-22 | get | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
value () {
return this.validity.valid;
} | @Pagination.js
@author XboxYan(yanwenbin)
@version
@Created: 20-04-22
@edit: 20-04-22 | value | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
value (content) {
return document.validate.reportValidity(this, content);
} | @Pagination.js
@author XboxYan(yanwenbin)
@version
@Created: 20-04-22
@edit: 20-04-22 | value | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
value () {
return document.validate.checkValidity(this);
} | @Pagination.js
@author XboxYan(yanwenbin)
@version
@Created: 20-04-22
@edit: 20-04-22 | value | javascript | yued-fe/lulu | theme/edge/js/common/all.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/all.js | MIT |
static get observedAttributes () {
return ['disabled'];
} | @Color.js
@author zhangxinxu
@version
@created 16-06-03
@edited 20-07-16 @Gwokhov | observedAttributes | javascript | yued-fe/lulu | theme/edge/js/common/ui/Color.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/ui/Color.js | MIT |
constructor () {
super();
this.setProperty();
} | @Color.js
@author zhangxinxu
@version
@created 16-06-03
@edited 20-07-16 @Gwokhov | constructor | javascript | yued-fe/lulu | theme/edge/js/common/ui/Color.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/ui/Color.js | MIT |
static addClass (...arg) {
return ['ui', 'color', ...arg].join('-');
} | @Color.js
@author zhangxinxu
@version
@created 16-06-03
@edited 20-07-16 @Gwokhov | addClass | javascript | yued-fe/lulu | theme/edge/js/common/ui/Color.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/ui/Color.js | MIT |
hue2rgb = function (p, q, t) {
if (t < 0) t += 1;
if (t > 1) t -= 1;
if (t < 1 / 6) return p + (q - p) * 6 * t;
if (t < 1 / 2) return q;
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
return p;
} | @Color.js
@author zhangxinxu
@version
@created 16-06-03
@edited 20-07-16 @Gwokhov | hue2rgb | javascript | yued-fe/lulu | theme/edge/js/common/ui/Color.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/ui/Color.js | MIT |
hue2rgb = function (p, q, t) {
if (t < 0) t += 1;
if (t > 1) t -= 1;
if (t < 1 / 6) return p + (q - p) * 6 * t;
if (t < 1 / 2) return q;
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
return p;
} | @Color.js
@author zhangxinxu
@version
@created 16-06-03
@edited 20-07-16 @Gwokhov | hue2rgb | javascript | yued-fe/lulu | theme/edge/js/common/ui/Color.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/ui/Color.js | MIT |
get type () {
return this.getAttribute('type') || 'color';
} | @Color.js
@author zhangxinxu
@version
@created 16-06-03
@edited 20-07-16 @Gwokhov | type | javascript | yued-fe/lulu | theme/edge/js/common/ui/Color.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/ui/Color.js | MIT |
set type (v) {
return this.setAttribute('type', v || 'color');
} | @Color.js
@author zhangxinxu
@version
@created 16-06-03
@edited 20-07-16 @Gwokhov | type | javascript | yued-fe/lulu | theme/edge/js/common/ui/Color.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/ui/Color.js | MIT |
static get observedAttributes () {
return ['open', 'target'];
} | @Drop.js
@author zhangxinxu
@version
@created 15-06-30
@edited 20-07-08 edit by wanglei | observedAttributes | javascript | yued-fe/lulu | theme/edge/js/common/ui/Drop.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/ui/Drop.js | MIT |
static get defaults () {
return {
eventtype: 'click',
position: '7-5'
};
} | @Drop.js
@author zhangxinxu
@version
@created 15-06-30
@edited 20-07-08 edit by wanglei | defaults | javascript | yued-fe/lulu | theme/edge/js/common/ui/Drop.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/ui/Drop.js | MIT |
static allHide (exclude) {
ErrorTip.collectionErrorTip.forEach(obj => {
if (exclude != obj) {
obj.hide();
}
});
} | @ErrorTip.js
@author zhangxinxu
@version
@created: 15-07-01
@edited: 20-07-07 edit by peter.qiyuanhao | allHide | javascript | yued-fe/lulu | theme/edge/js/common/ui/ErrorTip.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/ui/ErrorTip.js | MIT |
U = function (a, b) {
if (!a) {
return '';
}
b = b || 'x';
var c = '';
var d = 0;
var e;
for (d; d < a.length; d += 1) a.charCodeAt(d) >= 55296 && a.charCodeAt(d) <= 56319 ? (e = (65536 + 1024 * (Number(a.charCodeAt(d)) - 55296) + Number(a.charCodeAt(... | @Keyboard.js
@author zhangxinxu
@version
Created: 17-06-13 | U | javascript | yued-fe/lulu | theme/edge/js/common/ui/Keyboard.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/ui/Keyboard.js | MIT |
static get observedAttributes () {
return ['open'];
} | @LightTip.js
@author popeyesailorman(yangfan)
@version
@Created: 20-05-15
@edit: 20-05-15 | observedAttributes | javascript | yued-fe/lulu | theme/edge/js/common/ui/LightTip.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/ui/LightTip.js | MIT |
constructor () {
super();
if (arguments.length) {
LightTip.custom.apply(this, arguments);
}
} | @LightTip.js
@author popeyesailorman(yangfan)
@version
@Created: 20-05-15
@edit: 20-05-15 | constructor | javascript | yued-fe/lulu | theme/edge/js/common/ui/LightTip.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/ui/LightTip.js | MIT |
get type () {
return this.getAttribute('type');
} | @LightTip.js
@author popeyesailorman(yangfan)
@version
@Created: 20-05-15
@edit: 20-05-15 | type | javascript | yued-fe/lulu | theme/edge/js/common/ui/LightTip.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/ui/LightTip.js | MIT |
get time () {
let strTime = this.getAttribute('time');
if (!isNaN(strTime) && !isNaN(parseFloat(strTime))) {
return Number(strTime);
}
return 3000;
} | @LightTip.js
@author popeyesailorman(yangfan)
@version
@Created: 20-05-15
@edit: 20-05-15 | time | javascript | yued-fe/lulu | theme/edge/js/common/ui/LightTip.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/ui/LightTip.js | MIT |
set type (value) {
this.setAttribute('type', value);
} | @LightTip.js
@author popeyesailorman(yangfan)
@version
@Created: 20-05-15
@edit: 20-05-15 | type | javascript | yued-fe/lulu | theme/edge/js/common/ui/LightTip.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/ui/LightTip.js | MIT |
set time (value) {
this.setAttribute('time', value);
} | @LightTip.js
@author popeyesailorman(yangfan)
@version
@Created: 20-05-15
@edit: 20-05-15 | time | javascript | yued-fe/lulu | theme/edge/js/common/ui/LightTip.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/ui/LightTip.js | MIT |
get open () {
return this.hasAttribute('open');
} | @LightTip.js
@author popeyesailorman(yangfan)
@version
@Created: 20-05-15
@edit: 20-05-15 | open | javascript | yued-fe/lulu | theme/edge/js/common/ui/LightTip.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/ui/LightTip.js | MIT |
set open (value) {
this.toggleAttribute('open', value);
} | @LightTip.js
@author popeyesailorman(yangfan)
@version
@Created: 20-05-15
@edit: 20-05-15 | open | javascript | yued-fe/lulu | theme/edge/js/common/ui/LightTip.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/ui/LightTip.js | MIT |
static success (text, time = 3000) {
return this.custom(text, 'success', time);
} | @LightTip.js
@author popeyesailorman(yangfan)
@version
@Created: 20-05-15
@edit: 20-05-15 | success | javascript | yued-fe/lulu | theme/edge/js/common/ui/LightTip.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/ui/LightTip.js | MIT |
static error (text, time = 3000) {
return this.custom(text, 'error', time);
} | @LightTip.js
@author popeyesailorman(yangfan)
@version
@Created: 20-05-15
@edit: 20-05-15 | error | javascript | yued-fe/lulu | theme/edge/js/common/ui/LightTip.js | https://github.com/yued-fe/lulu/blob/master/theme/edge/js/common/ui/LightTip.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.