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
handle = function(event, touch) { var session = $.gestures.session; var options = this.options; var now = $.now(); switch (event.type) { case $.EVENT_MOVE: if (now - flickStartTime > 300) { flickStartTime = now; session.flickStart = touch.center; } break; case $.EVENT_END: case $....
mui gesture flick[left|right|up|down] @param {type} $ @param {type} name @returns {undefined}
handle
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
handle = function(event, touch) { var session = $.gestures.session; var options = this.options; switch (event.type) { case $.EVENT_END: if (!touch.isFinal) { return; } var target = session.target; if (!target || (target.disabled || (target.classList && target.classList.contains('mui-disabl...
mui gesture tap and doubleTap @param {type} $ @param {type} name @returns {undefined}
handle
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
handle = function(event, touch) { var session = $.gestures.session; var options = this.options; switch (event.type) { case $.EVENT_START: clearTimeout(timer); timer = setTimeout(function() { $.trigger(session.target, name, touch); }, options.holdTimeout); break; case $.EVENT_MOVE: i...
mui gesture hold @param {type} $ @param {type} name @returns {undefined}
handle
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
handle = function(event, touch) { var session = $.gestures.session; var options = this.options; switch (event.type) { case $.EVENT_START: if ($.options.gestureConfig.hold) { timer && clearTimeout(timer); timer = setTimeout(function() { touch.hold = true; $.trigger(session.target, name...
mui gesture pinch @param {type} $ @param {type} name @returns {undefined}
handle
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
ajaxBeforeSend = function(xhr, settings) { var context = settings.context if(settings.beforeSend.call(context, xhr, settings) === false) { return false; } }
mui ajax @param {type} $ @returns {undefined}
ajaxBeforeSend
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
ajaxSuccess = function(data, xhr, settings) { settings.success.call(settings.context, data, 'success', xhr); ajaxComplete('success', xhr, settings); }
mui ajax @param {type} $ @returns {undefined}
ajaxSuccess
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
ajaxError = function(error, type, xhr, settings) { settings.error.call(settings.context, xhr, type, error); ajaxComplete(type, xhr, settings); }
mui ajax @param {type} $ @returns {undefined}
ajaxError
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
ajaxComplete = function(status, xhr, settings) { settings.complete.call(settings.context, xhr, status); }
mui ajax @param {type} $ @returns {undefined}
ajaxComplete
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
serialize = function(params, obj, traditional, scope) { var type, array = $.isArray(obj), hash = $.isPlainObject(obj); $.each(obj, function(key, value) { type = $.type(value); if(scope) { key = traditional ? scope : scope + '[' + (hash || type === 'object' || type === 'array' ? key : '') + ']'; ...
mui ajax @param {type} $ @returns {undefined}
serialize
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
serializeData = function(options) { if(options.processData && options.data && typeof options.data !== "string") { var contentType = options.contentType; if(!contentType && options.headers) { contentType = options.headers['Content-Type']; } if(contentType && ~contentType.indexOf(jsonType)) { //applicat...
mui ajax @param {type} $ @returns {undefined}
serializeData
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
appendQuery = function(url, query) { if(query === '') { return url; } return(url + '&' + query).replace(/[&?]{1,2}/, '?'); }
mui ajax @param {type} $ @returns {undefined}
appendQuery
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
mimeToDataType = function(mime) { if(mime) { mime = mime.split(';', 2)[0]; } return mime && (mime === htmlType ? 'html' : mime === jsonType ? 'json' : scriptTypeRE.test(mime) ? 'script' : xmlTypeRE.test(mime) && 'xml') || 'text'; }
mui ajax @param {type} $ @returns {undefined}
mimeToDataType
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
parseArguments = function(url, data, success, dataType) { if($.isFunction(data)) { dataType = success, success = data, data = undefined; } if(!$.isFunction(success)) { dataType = success, success = undefined; } return { url: url, data: data, success: success, dataType: dataType }; }
mui ajax @param {type} $ @returns {undefined}
parseArguments
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
setHeader = function(name, value) { headers[name.toLowerCase()] = [name, value]; }
mui ajax @param {type} $ @returns {undefined}
setHeader
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
findOffCanvasContainer = function(target) { parentNode = target.parentNode; if (parentNode) { if (parentNode.classList.contains(CLASS_OFF_CANVAS_WRAP)) { return parentNode; } else { parentNode = parentNode.parentNode; if (parentNode.classList.contains(CLASS_OFF_CANVAS_WRAP)) { return parentNo...
Popovers @param {type} $ @param {type} window @param {type} document @param {type} name @param {type} undefined @returns {undefined}
findOffCanvasContainer
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
handle = function(event, target) { if (target.tagName === 'A' && target.hash) { var offcanvas = document.getElementById(target.hash.replace('#', '')); if (offcanvas) { var container = findOffCanvasContainer(offcanvas); if (container) { $.targets._container = container; return offcanvas; } ...
Popovers @param {type} $ @param {type} window @param {type} document @param {type} name @param {type} undefined @returns {undefined}
handle
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
handle = function(event, target) { var className = target.className || ''; if (typeof className !== 'string') { //svg className(SVGAnimatedString) className = ''; } if (className && ~className.indexOf(CLASS_ACTION)) { if (target.classList.contains('mui-action-back')) { event.preventDefault(); } ...
Popovers @param {type} $ @param {type} window @param {type} document @param {type} name @param {type} undefined @returns {undefined}
handle
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
handle = function(event, target) { if (target.tagName === 'A' && target.hash) { var modal = document.getElementById(target.hash.replace('#', '')); if (modal && modal.classList.contains(CLASS_MODAL)) { return modal; } } return false; }
Popovers @param {type} $ @param {type} window @param {type} document @param {type} name @param {type} undefined @returns {undefined}
handle
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
handle = function(event, target) { if (target.tagName === 'A' && target.hash) { $.targets._popover = document.getElementById(target.hash.replace('#', '')); if ($.targets._popover && $.targets._popover.classList.contains(CLASS_POPOVER)) { return target; } else { $.targets._popover = null; } } r...
Popovers @param {type} $ @param {type} window @param {type} document @param {type} name @param {type} undefined @returns {undefined}
handle
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
onPopoverShown = function(e) { this.removeEventListener('webkitTransitionEnd', onPopoverShown); this.addEventListener($.EVENT_MOVE, $.preventDefault); $.trigger(this, 'shown', this); }
Popovers @param {type} $ @param {type} window @param {type} document @param {type} name @param {type} undefined @returns {undefined}
onPopoverShown
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
onPopoverHidden = function(e) { setStyle(this, 'none'); this.removeEventListener('webkitTransitionEnd', onPopoverHidden); this.removeEventListener($.EVENT_MOVE, $.preventDefault); $.trigger(this, 'hidden', this); }
Popovers @param {type} $ @param {type} window @param {type} document @param {type} name @param {type} undefined @returns {undefined}
onPopoverHidden
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
removeBackdrop = function(popover) { backdrop.setAttribute('style', 'opacity:0'); $.targets.popover = $.targets._popover = null; //reset removeBackdropTimer = $.later(function() { if (!popover.classList.contains(CLASS_ACTIVE) && backdrop.parentNode && backdrop.parentNode === document.body) { document.body....
Popovers @param {type} $ @param {type} window @param {type} document @param {type} name @param {type} undefined @returns {undefined}
removeBackdrop
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
setStyle = function(popover, display, top, left) { var style = popover.style; if (typeof display !== 'undefined') style.display = display; if (typeof top !== 'undefined') style.top = top + 'px'; if (typeof left !== 'undefined') style.left = left + 'px'; }
segmented-controllers @param {type} $ @param {type} window @param {type} document @param {type} undefined @returns {undefined}
setStyle
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
calPosition = function(popover, anchor, isActionSheet) { if (!popover || !anchor) { return; } if (isActionSheet) { //actionsheet setStyle(popover, 'block') return; } var wWidth = window.innerWidth; var wHeight = window.innerHeight; var pWidth = popover.offsetWidth; var pHeight = popover.offs...
segmented-controllers @param {type} $ @param {type} window @param {type} document @param {type} undefined @returns {undefined}
calPosition
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
handle = function(event, target) { if (target.classList && target.classList.contains(CLASS_SWITCH)) { return target; } return false; }
Tableviews @param {type} $ @param {type} window @param {type} document @returns {undefined}
handle
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
Toggle = function(element) { this.element = element; this.classList = this.element.classList; this.handle = this.element.querySelector(SELECTOR_SWITCH_HANDLE); this.init(); this.initEvent(); }
Tableviews @param {type} $ @param {type} window @param {type} document @returns {undefined}
Toggle
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
toggleActive = function(isActive) { if (isActive) { if (a) { a.classList.add(CLASS_ACTIVE); } else if (cell) { cell.classList.add(CLASS_ACTIVE); } } else { timer && timer.cancel(); if (a) { a.classList.remove(CLASS_ACTIVE); } else if (cell) { cell.classList.remove(CLASS_ACTIVE); ...
Tableviews @param {type} $ @param {type} window @param {type} document @returns {undefined}
toggleActive
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
updateTranslate = function() { if (translateX !== lastTranslateX) { if (buttonsRight && buttonsRight.length > 0) { progress = translateX / sliderActionRightWidth; if (translateX < -sliderActionRightWidth) { translateX = -sliderActionRightWidth - Math.pow(-translateX - sliderActionRightWidth, overFacto...
Tableviews @param {type} $ @param {type} window @param {type} document @returns {undefined}
updateTranslate
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
setTranslate = function(element, x) { if (element) { element.style.webkitTransform = 'translate(' + x + 'px,0)'; } }
Tableviews @param {type} $ @param {type} window @param {type} document @returns {undefined}
setTranslate
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
radioOrCheckboxClick = function(event) { var type = event.target && event.target.type || ''; if (type === 'radio' || type === 'checkbox') { return; } var classList = cell.classList; if (classList.contains('mui-radio')) { var input = cell.querySelector('input[type=radio]'); if (input) { // inpu...
Popup(alert,confirm,prompt) @param {Object} $ @param {Object} window @param {Object} document
radioOrCheckboxClick
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
createInput = function(placeholder) { return '<div class="' + CLASS_POPUP_INPUT + '"><input type="text" autofocus placeholder="' + (placeholder || '') + '"/></div>'; }
Popup(alert,confirm,prompt) @param {Object} $ @param {Object} window @param {Object} document
createInput
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
createInner = function(message, title, extra) { return '<div class="' + CLASS_POPUP_INNER + '"><div class="' + CLASS_POPUP_TITLE + '">' + title + '</div><div class="' + CLASS_POPUP_TEXT + '">' + message.replace(/\r\n/g, "<br/>").replace(/\n/g, "<br/>") + '</div>' + (extra || '') + '</div>'; }
Popup(alert,confirm,prompt) @param {Object} $ @param {Object} window @param {Object} document
createInner
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
createButtons = function(btnArray) { var length = btnArray.length; var btns = []; for (var i = 0; i < length; i++) { btns.push('<span class="' + CLASS_POPUP_BUTTON + (i === length - 1 ? (' ' + CLASS_POPUP_BUTTON_BOLD) : '') + '">' + btnArray[i] + '</span>'); } return ...
Popup(alert,confirm,prompt) @param {Object} $ @param {Object} window @param {Object} document
createButtons
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
removePopupElement = function() { popupElement.parentNode && popupElement.parentNode.removeChild(popupElement); popupElement = null; }
Popup(alert,confirm,prompt) @param {Object} $ @param {Object} window @param {Object} document
removePopupElement
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
closePopup = function() { if (popupStack.length) { popupStack[popupStack.length - 1]['close'](); return true; } else { return false; } }
Input(TODO resize) @param {type} $ @param {type} window @param {type} document @returns {undefined}
closePopup
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
closePopups = function() { while (popupStack.length) { popupStack[popupStack.length - 1]['close'](); } }
Input(TODO resize) @param {type} $ @param {type} window @param {type} document @returns {undefined}
closePopups
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
_findProgressbar = function(container) { container = $(container || 'body'); if (container.length === 0) return; container = container[0]; if (container.classList.contains(CLASS_PROGRESSBAR)) { return container; } var progressbars = container.querySelectorAll(SELECTOR_PROGRESSBAR); if (progressbars) { ...
Input(TODO resize) @param {type} $ @param {type} window @param {type} document @returns {undefined}
_findProgressbar
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
showProgressbar = function(container, progress, color) { if (typeof container === 'number') { color = progress; progress = container; container = 'body'; } container = $(container || 'body'); if (container.length === 0) return; container = container[0]; var progressbar; if (container.classList.co...
Input(TODO resize) @param {type} $ @param {type} window @param {type} document @returns {undefined}
showProgressbar
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
hideProgressbar = function(container) { var progressbar = _findProgressbar(container); if (!progressbar) { return; } var classList = progressbar.classList; if (!classList.contains(CLASS_PROGRESSBAR_IN) || classList.contains(CLASS_PROGRESSBAR_OUT)) { return; } classList.remove(CLASS_PROGRESSBAR_IN); ...
Input(TODO resize) @param {type} $ @param {type} window @param {type} document @returns {undefined}
hideProgressbar
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
setProgressbar = function(container, progress, speed) { if (typeof container === 'number') { speed = progress; progress = container; container = false; } var progressbar = _findProgressbar(container); if (!progressbar || progressbar.classList.contains(CLASS_PROGRESSBAR_INFINITE)) { return; } if ...
Input(TODO resize) @param {type} $ @param {type} window @param {type} document @returns {undefined}
setProgressbar
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
findRow = function(target) { for (; target && target !== document; target = target.parentNode) { if (target.classList && target.classList.contains(CLASS_INPUT_ROW)) { return target; } } return null; }
Input(TODO resize) @param {type} $ @param {type} window @param {type} document @returns {undefined}
findRow
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
Input = function(element, options) { this.element = element; this.options = options || { actions: 'clear' }; if (~this.options.actions.indexOf('slider')) { //slider this.sliderActionClass = CLASS_TOOLTIP + ' ' + CLASS_HIDDEN; this.sliderActionSelector = SELECTOR_TOOLTIP; } else { //clear,speech,searc...
Input(TODO resize) @param {type} $ @param {type} window @param {type} document @returns {undefined}
Input
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
Button = function(element, options) { this.element = element; this.options = $.extend({}, defaultOptions, options); if (!this.options.loadingText) { this.options.loadingText = defaultOptions.loadingText; } if (this.options.loadingIcon === null) { this.opti...
Button @param {type} $ @param {type} window @param {type} document @returns {undefined}
Button
javascript
dcloudio/mui
dist/js/mui.js
https://github.com/dcloudio/mui/blob/master/dist/js/mui.js
MIT
filterFn = function(fn) { return fn.type === event; }
mui delegate events @param {type} event @param {type} selector @param {type} callback @returns {undefined}
filterFn
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
function update(fn) { return function(value) { var classes = self.className.split(/\s+/), index = classes.indexOf(value); fn(classes, index, value); self.className = classes.join(" "); ...
mui fixed classList @param {type} document @returns {undefined}
update
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
getDistance = function(p1, p2, props) { if(!props) { props = ['x', 'y']; } var x = p2[props[0]] - p1[props[0]]; var y = p2[props[1]] - p1[props[1]]; return sqrt((x * x) + (y * y)); }
angle @param {type} p1 @param {type} p2 @returns {Number}
getDistance
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
getAngle = function(p1, p2, props) { if(!props) { props = ['x', 'y']; } var x = p2[props[0]] - p1[props[0]]; var y = p2[props[1]] - p1[props[1]]; return atan2(y, x) * 180 / Math.PI; }
rotation @param {Object} start @param {Object} end
getAngle
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
getDirection = function(x, y) { if(x === y) { return ''; } if(abs(x) >= abs(y)) { return x > 0 ? 'left' : 'right'; } return y > 0 ? 'up' : 'down'; }
detect gestures @param {type} event @param {type} touch @returns {undefined}
getDirection
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
getRotation = function(start, end) { var props = ['pageX', 'pageY']; return getAngle(end[1], end[0], props) - getAngle(start[1], start[0], props); }
detect gestures @param {type} event @param {type} touch @returns {undefined}
getRotation
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
handle = function(event, touch) { var session = $.gestures.session; var options = this.options; var now = $.now(); switch (event.type) { case $.EVENT_MOVE: if (now - flickStartTime > 300) { flickStartTime = now; session.flickStart = touch.center; } break; case $.EVENT_END: case $....
mui gesture flick[left|right|up|down] @param {type} $ @param {type} name @returns {undefined}
handle
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
handle = function(event, touch) { var session = $.gestures.session; var options = this.options; switch (event.type) { case $.EVENT_END: if (!touch.isFinal) { return; } var target = session.target; if (!target || (target.disabled || (target.classList && target.classList.contains('mui-disabl...
mui gesture tap and doubleTap @param {type} $ @param {type} name @returns {undefined}
handle
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
handle = function(event, touch) { var session = $.gestures.session; var options = this.options; switch (event.type) { case $.EVENT_START: clearTimeout(timer); timer = setTimeout(function() { $.trigger(session.target, name, touch); }, options.holdTimeout); break; case $.EVENT_MOVE: i...
mui gesture hold @param {type} $ @param {type} name @returns {undefined}
handle
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
handle = function(event, touch) { var session = $.gestures.session; var options = this.options; switch (event.type) { case $.EVENT_START: if ($.options.gestureConfig.hold) { timer && clearTimeout(timer); timer = setTimeout(function() { touch.hold = true; $.trigger(session.target, name...
mui gesture pinch @param {type} $ @param {type} name @returns {undefined}
handle
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
ajaxBeforeSend = function(xhr, settings) { var context = settings.context if(settings.beforeSend.call(context, xhr, settings) === false) { return false; } }
mui ajax @param {type} $ @returns {undefined}
ajaxBeforeSend
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
ajaxSuccess = function(data, xhr, settings) { settings.success.call(settings.context, data, 'success', xhr); ajaxComplete('success', xhr, settings); }
mui ajax @param {type} $ @returns {undefined}
ajaxSuccess
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
ajaxError = function(error, type, xhr, settings) { settings.error.call(settings.context, xhr, type, error); ajaxComplete(type, xhr, settings); }
mui ajax @param {type} $ @returns {undefined}
ajaxError
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
ajaxComplete = function(status, xhr, settings) { settings.complete.call(settings.context, xhr, status); }
mui ajax @param {type} $ @returns {undefined}
ajaxComplete
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
serialize = function(params, obj, traditional, scope) { var type, array = $.isArray(obj), hash = $.isPlainObject(obj); $.each(obj, function(key, value) { type = $.type(value); if(scope) { key = traditional ? scope : scope + '[' + (hash || type === 'object' || type === 'array' ? key : '') + ']'; ...
mui ajax @param {type} $ @returns {undefined}
serialize
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
serializeData = function(options) { if(options.processData && options.data && typeof options.data !== "string") { var contentType = options.contentType; if(!contentType && options.headers) { contentType = options.headers['Content-Type']; } if(contentType && ~contentType.indexOf(jsonType)) { //applicat...
mui ajax @param {type} $ @returns {undefined}
serializeData
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
appendQuery = function(url, query) { if(query === '') { return url; } return(url + '&' + query).replace(/[&?]{1,2}/, '?'); }
mui ajax @param {type} $ @returns {undefined}
appendQuery
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
mimeToDataType = function(mime) { if(mime) { mime = mime.split(';', 2)[0]; } return mime && (mime === htmlType ? 'html' : mime === jsonType ? 'json' : scriptTypeRE.test(mime) ? 'script' : xmlTypeRE.test(mime) && 'xml') || 'text'; }
mui ajax @param {type} $ @returns {undefined}
mimeToDataType
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
parseArguments = function(url, data, success, dataType) { if($.isFunction(data)) { dataType = success, success = data, data = undefined; } if(!$.isFunction(success)) { dataType = success, success = undefined; } return { url: url, data: data, success: success, dataType: dataType }; }
mui ajax @param {type} $ @returns {undefined}
parseArguments
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
setHeader = function(name, value) { headers[name.toLowerCase()] = [name, value]; }
mui ajax @param {type} $ @returns {undefined}
setHeader
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
findOffCanvasContainer = function(target) { parentNode = target.parentNode; if (parentNode) { if (parentNode.classList.contains(CLASS_OFF_CANVAS_WRAP)) { return parentNode; } else { parentNode = parentNode.parentNode; if (parentNode.classList.contains(CLASS_OFF_CANVAS_WRAP)) { return parentNo...
Popovers @param {type} $ @param {type} window @param {type} document @param {type} name @param {type} undefined @returns {undefined}
findOffCanvasContainer
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
handle = function(event, target) { if (target.tagName === 'A' && target.hash) { var offcanvas = document.getElementById(target.hash.replace('#', '')); if (offcanvas) { var container = findOffCanvasContainer(offcanvas); if (container) { $.targets._container = container; return offcanvas; } ...
Popovers @param {type} $ @param {type} window @param {type} document @param {type} name @param {type} undefined @returns {undefined}
handle
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
handle = function(event, target) { var className = target.className || ''; if (typeof className !== 'string') { //svg className(SVGAnimatedString) className = ''; } if (className && ~className.indexOf(CLASS_ACTION)) { if (target.classList.contains('mui-action-back')) { event.preventDefault(); } ...
Popovers @param {type} $ @param {type} window @param {type} document @param {type} name @param {type} undefined @returns {undefined}
handle
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
handle = function(event, target) { if (target.tagName === 'A' && target.hash) { var modal = document.getElementById(target.hash.replace('#', '')); if (modal && modal.classList.contains(CLASS_MODAL)) { return modal; } } return false; }
Popovers @param {type} $ @param {type} window @param {type} document @param {type} name @param {type} undefined @returns {undefined}
handle
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
handle = function(event, target) { if (target.tagName === 'A' && target.hash) { $.targets._popover = document.getElementById(target.hash.replace('#', '')); if ($.targets._popover && $.targets._popover.classList.contains(CLASS_POPOVER)) { return target; } else { $.targets._popover = null; } } r...
Popovers @param {type} $ @param {type} window @param {type} document @param {type} name @param {type} undefined @returns {undefined}
handle
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
onPopoverShown = function(e) { this.removeEventListener('webkitTransitionEnd', onPopoverShown); this.addEventListener($.EVENT_MOVE, $.preventDefault); $.trigger(this, 'shown', this); }
Popovers @param {type} $ @param {type} window @param {type} document @param {type} name @param {type} undefined @returns {undefined}
onPopoverShown
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
onPopoverHidden = function(e) { setStyle(this, 'none'); this.removeEventListener('webkitTransitionEnd', onPopoverHidden); this.removeEventListener($.EVENT_MOVE, $.preventDefault); $.trigger(this, 'hidden', this); }
Popovers @param {type} $ @param {type} window @param {type} document @param {type} name @param {type} undefined @returns {undefined}
onPopoverHidden
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
removeBackdrop = function(popover) { backdrop.setAttribute('style', 'opacity:0'); $.targets.popover = $.targets._popover = null; //reset removeBackdropTimer = $.later(function() { if (!popover.classList.contains(CLASS_ACTIVE) && backdrop.parentNode && backdrop.parentNode === document.body) { document.body....
Popovers @param {type} $ @param {type} window @param {type} document @param {type} name @param {type} undefined @returns {undefined}
removeBackdrop
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
setStyle = function(popover, display, top, left) { var style = popover.style; if (typeof display !== 'undefined') style.display = display; if (typeof top !== 'undefined') style.top = top + 'px'; if (typeof left !== 'undefined') style.left = left + 'px'; }
segmented-controllers @param {type} $ @param {type} window @param {type} document @param {type} undefined @returns {undefined}
setStyle
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
calPosition = function(popover, anchor, isActionSheet) { if (!popover || !anchor) { return; } if (isActionSheet) { //actionsheet setStyle(popover, 'block') return; } var wWidth = window.innerWidth; var wHeight = window.innerHeight; var pWidth = popover.offsetWidth; var pHeight = popover.offs...
segmented-controllers @param {type} $ @param {type} window @param {type} document @param {type} undefined @returns {undefined}
calPosition
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
handle = function(event, target) { if (target.classList && target.classList.contains(CLASS_SWITCH)) { return target; } return false; }
Tableviews @param {type} $ @param {type} window @param {type} document @returns {undefined}
handle
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
Toggle = function(element) { this.element = element; this.classList = this.element.classList; this.handle = this.element.querySelector(SELECTOR_SWITCH_HANDLE); this.init(); this.initEvent(); }
Tableviews @param {type} $ @param {type} window @param {type} document @returns {undefined}
Toggle
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
toggleActive = function(isActive) { if (isActive) { if (a) { a.classList.add(CLASS_ACTIVE); } else if (cell) { cell.classList.add(CLASS_ACTIVE); } } else { timer && timer.cancel(); if (a) { a.classList.remove(CLASS_ACTIVE); } else if (cell) { cell.classList.remove(CLASS_ACTIVE); ...
Tableviews @param {type} $ @param {type} window @param {type} document @returns {undefined}
toggleActive
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
updateTranslate = function() { if (translateX !== lastTranslateX) { if (buttonsRight && buttonsRight.length > 0) { progress = translateX / sliderActionRightWidth; if (translateX < -sliderActionRightWidth) { translateX = -sliderActionRightWidth - Math.pow(-translateX - sliderActionRightWidth, overFacto...
Tableviews @param {type} $ @param {type} window @param {type} document @returns {undefined}
updateTranslate
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
setTranslate = function(element, x) { if (element) { element.style.webkitTransform = 'translate(' + x + 'px,0)'; } }
Tableviews @param {type} $ @param {type} window @param {type} document @returns {undefined}
setTranslate
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
radioOrCheckboxClick = function(event) { var type = event.target && event.target.type || ''; if (type === 'radio' || type === 'checkbox') { return; } var classList = cell.classList; if (classList.contains('mui-radio')) { var input = cell.querySelector('input[type=radio]'); if (input) { // inpu...
Popup(alert,confirm,prompt) @param {Object} $ @param {Object} window @param {Object} document
radioOrCheckboxClick
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
createInput = function(placeholder) { return '<div class="' + CLASS_POPUP_INPUT + '"><input type="text" autofocus placeholder="' + (placeholder || '') + '"/></div>'; }
Popup(alert,confirm,prompt) @param {Object} $ @param {Object} window @param {Object} document
createInput
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
createInner = function(message, title, extra) { return '<div class="' + CLASS_POPUP_INNER + '"><div class="' + CLASS_POPUP_TITLE + '">' + title + '</div><div class="' + CLASS_POPUP_TEXT + '">' + message.replace(/\r\n/g, "<br/>").replace(/\n/g, "<br/>") + '</div>' + (extra || '') + '</div>'; }
Popup(alert,confirm,prompt) @param {Object} $ @param {Object} window @param {Object} document
createInner
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
createButtons = function(btnArray) { var length = btnArray.length; var btns = []; for (var i = 0; i < length; i++) { btns.push('<span class="' + CLASS_POPUP_BUTTON + (i === length - 1 ? (' ' + CLASS_POPUP_BUTTON_BOLD) : '') + '">' + btnArray[i] + '</span>'); } return ...
Popup(alert,confirm,prompt) @param {Object} $ @param {Object} window @param {Object} document
createButtons
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
removePopupElement = function() { popupElement.parentNode && popupElement.parentNode.removeChild(popupElement); popupElement = null; }
Popup(alert,confirm,prompt) @param {Object} $ @param {Object} window @param {Object} document
removePopupElement
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
closePopup = function() { if (popupStack.length) { popupStack[popupStack.length - 1]['close'](); return true; } else { return false; } }
Input(TODO resize) @param {type} $ @param {type} window @param {type} document @returns {undefined}
closePopup
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
closePopups = function() { while (popupStack.length) { popupStack[popupStack.length - 1]['close'](); } }
Input(TODO resize) @param {type} $ @param {type} window @param {type} document @returns {undefined}
closePopups
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
_findProgressbar = function(container) { container = $(container || 'body'); if (container.length === 0) return; container = container[0]; if (container.classList.contains(CLASS_PROGRESSBAR)) { return container; } var progressbars = container.querySelectorAll(SELECTOR_PROGRESSBAR); if (progressbars) { ...
Input(TODO resize) @param {type} $ @param {type} window @param {type} document @returns {undefined}
_findProgressbar
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
showProgressbar = function(container, progress, color) { if (typeof container === 'number') { color = progress; progress = container; container = 'body'; } container = $(container || 'body'); if (container.length === 0) return; container = container[0]; var progressbar; if (container.classList.co...
Input(TODO resize) @param {type} $ @param {type} window @param {type} document @returns {undefined}
showProgressbar
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
hideProgressbar = function(container) { var progressbar = _findProgressbar(container); if (!progressbar) { return; } var classList = progressbar.classList; if (!classList.contains(CLASS_PROGRESSBAR_IN) || classList.contains(CLASS_PROGRESSBAR_OUT)) { return; } classList.remove(CLASS_PROGRESSBAR_IN); ...
Input(TODO resize) @param {type} $ @param {type} window @param {type} document @returns {undefined}
hideProgressbar
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
setProgressbar = function(container, progress, speed) { if (typeof container === 'number') { speed = progress; progress = container; container = false; } var progressbar = _findProgressbar(container); if (!progressbar || progressbar.classList.contains(CLASS_PROGRESSBAR_INFINITE)) { return; } if ...
Input(TODO resize) @param {type} $ @param {type} window @param {type} document @returns {undefined}
setProgressbar
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
findRow = function(target) { for (; target && target !== document; target = target.parentNode) { if (target.classList && target.classList.contains(CLASS_INPUT_ROW)) { return target; } } return null; }
Input(TODO resize) @param {type} $ @param {type} window @param {type} document @returns {undefined}
findRow
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
Input = function(element, options) { this.element = element; this.options = options || { actions: 'clear' }; if (~this.options.actions.indexOf('slider')) { //slider this.sliderActionClass = CLASS_TOOLTIP + ' ' + CLASS_HIDDEN; this.sliderActionSelector = SELECTOR_TOOLTIP; } else { //clear,speech,searc...
Input(TODO resize) @param {type} $ @param {type} window @param {type} document @returns {undefined}
Input
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
Button = function(element, options) { this.element = element; this.options = $.extend({}, defaultOptions, options); if (!this.options.loadingText) { this.options.loadingText = defaultOptions.loadingText; } if (this.options.loadingIcon === null) { this.opti...
Button @param {type} $ @param {type} window @param {type} document @returns {undefined}
Button
javascript
dcloudio/mui
examples/hello-mui/js/mui.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/mui.js
MIT
webviewGroupContext = function(id, webviewOptions, groupContext) { this.id = id; this.url = webviewOptions.url; this.options = webviewOptions; this.groupContext = groupContext; this.webview = false; this.inited = false; }
@param {Object} id @param {Object} webviewOptions
webviewGroupContext
javascript
dcloudio/mui
examples/hello-mui/js/webviewGroup.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/webviewGroup.js
MIT
titleUpdate = function() { setTimeout(function() { self.webview.endPullToRefresh(); }.bind(this), 1000); self.webview.removeEventListener('titleUpdate', titleUpdate); }
@param {Object} id @param {Object} webviewOptions
titleUpdate
javascript
dcloudio/mui
examples/hello-mui/js/webviewGroup.js
https://github.com/dcloudio/mui/blob/master/examples/hello-mui/js/webviewGroup.js
MIT
createStandardXHR = function () { try { return new window.XMLHttpRequest(); } catch( e ) { return false; } }
Decodes a base64 string. @param {String} input The string to decode.
createStandardXHR
javascript
dcloudio/mui
examples/login/libs/easymob-webim-sdk/easemob.im-1.0.5.js
https://github.com/dcloudio/mui/blob/master/examples/login/libs/easymob-webim-sdk/easemob.im-1.0.5.js
MIT
createActiveXHR = function () { try { return new window.ActiveXObject( "Microsoft.XMLHTTP" ); } catch( e ) { return false; } }
Decodes a base64 string. @param {String} input The string to decode.
createActiveXHR
javascript
dcloudio/mui
examples/login/libs/easymob-webim-sdk/easemob.im-1.0.5.js
https://github.com/dcloudio/mui/blob/master/examples/login/libs/easymob-webim-sdk/easemob.im-1.0.5.js
MIT
xmlrequest = function (crossDomain){ crossDomain = crossDomain || true; var temp = createStandardXHR () || createActiveXHR(); if ("withCredentials" in temp) { return temp; } if(!crossDomain){ return temp; } if(window.XDomainRequest===undefined){ return temp; } var xhr = new XDomainRequest(); xhr.ready...
Decodes a base64 string. @param {String} input The string to decode.
xmlrequest
javascript
dcloudio/mui
examples/login/libs/easymob-webim-sdk/easemob.im-1.0.5.js
https://github.com/dcloudio/mui/blob/master/examples/login/libs/easymob-webim-sdk/easemob.im-1.0.5.js
MIT
function getIEVersion(){ var ua = navigator.userAgent,matches,tridentMap={'4':8,'5':9,'6':10,'7':11}; matches = ua.match(/MSIE (\d+)/i); if(matches&&matches[1]) { return +matches[1]; } matches = ua.match(/Trident\/(\d+)/i); if(matches&&matches[1]) { return tridentMa...
Decodes a base64 string. @param {String} input The string to decode.
getIEVersion
javascript
dcloudio/mui
examples/login/libs/easymob-webim-sdk/easemob.im-1.0.5.js
https://github.com/dcloudio/mui/blob/master/examples/login/libs/easymob-webim-sdk/easemob.im-1.0.5.js
MIT
getFileUrlFn = function(fileInputId) { var uri = { url : '', filename : '', filetype : '' }; if (window.URL && window.URL.createObjectURL) { var fileItems = document.getElementById(fileInputId).files; if (fileItems.length > 0) { var u = fileItems.item(0); uri.url = window.URL.createObjectURL(u); ...
Decodes a base64 string. @param {String} input The string to decode.
getFileUrlFn
javascript
dcloudio/mui
examples/login/libs/easymob-webim-sdk/easemob.im-1.0.5.js
https://github.com/dcloudio/mui/blob/master/examples/login/libs/easymob-webim-sdk/easemob.im-1.0.5.js
MIT
getFileSizeFn = function(fileInputId){ var file = document.getElementById(fileInputId) var fileSize = 0; if(file){ if(file.files){ if(file.files.length>0){ fileSize = file.files[0].size; } } else if(isIe){ file.select(); var fileobject = new ActiveXObject ("Scripting.FileSystemObject"); var ...
Decodes a base64 string. @param {String} input The string to decode.
getFileSizeFn
javascript
dcloudio/mui
examples/login/libs/easymob-webim-sdk/easemob.im-1.0.5.js
https://github.com/dcloudio/mui/blob/master/examples/login/libs/easymob-webim-sdk/easemob.im-1.0.5.js
MIT