diff --git a/Gruntfile.js b/Gruntfile.js index cd6b83314..c6c72e6b5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -16,12 +16,12 @@ module.exports = function (grunt) { 'src/core/jquery.js', 'src/core/underscore.js', 'src/core/foundation.js', - 'src/core/mvc/**/*.js', + // 'src/core/mvc/**/*.js', 'src/core/base.js', 'src/core/ob.js', 'src/core/widget.js', - 'src/core/model.js', - 'src/core/view.js', + // 'src/core/model.js', + // 'src/core/view.js', 'src/core/shortcut.js', 'src/core/utils/*.js', 'src/core/behavior/behavior.js', @@ -29,8 +29,7 @@ module.exports = function (grunt) { 'src/core/**/*.js', 'src/data/data.js', - 'src/data/**/*.js', - 'src/config.js' + 'src/data/**/*.js' ], dest: 'dist/core.js' }, @@ -125,7 +124,7 @@ module.exports = function (grunt) { }, bundleJs: { - src: ['public/js/index.js', 'dist/core.js', 'dist/base.js', 'dist/case.js', 'dist/widget.js', 'public/js/**/*.js'], + src: ['dist/core.js', 'dist/base.js', 'dist/case.js', 'dist/widget.js', 'public/js/**/*.js', 'public/js/index.js'], dest: 'dist/bundle.js' }, @@ -139,7 +138,7 @@ module.exports = function (grunt) { dest: 'dist/config.js' }, demoJs: { - src: ['demo/app.js', 'demo/js/**/*.js',' demo/config.js'], + src: ['demo/app.js', 'demo/js/**/*.js', ' demo/config.js'], dest: 'dist/demo.js' }, demoCss: { @@ -157,32 +156,17 @@ module.exports = function (grunt) { 'src/core/jquery.js', 'src/core/underscore.js', 'src/core/foundation.js', - 'src/core/mvc/**/*.js', + // 'src/core/mvc/**/*.js', 'src/core/base.js', - 'src/core/alias.js', - 'src/core/events.js', - 'src/core/var.js', 'src/core/ob.js', 'src/core/widget.js', - 'src/core/model.js', - 'src/core/view.js', + // 'src/core/model.js', + // 'src/core/view.js', 'src/core/shortcut.js', - 'src/core/plugin.js', - 'src/core/controller.js', - 'src/core/proto/**/*.js', - 'src/core/utils/**/*.js', + 'src/core/utils/*.js', 'src/core/behavior/behavior.js', - 'src/core/behavior/**/*.js', 'src/core/wrapper/layout.js', - 'src/core/wrapper/**/*.js', - 'src/core/action/**/*.js', - 'src/core/adapter/**/*.js', - 'src/core/controller/**/*.js', - 'src/core/event/**/*.js', - 'src/core/func/**/*.js', - 'src/core/listener/**/*.js', - 'src/core/loader/**/*.js', - 'src/core/logic/**/*.js', + 'src/core/**/*.js', 'src/data/data.js', 'src/data/**/*.js', @@ -301,7 +285,7 @@ module.exports = function (grunt) { uglify: { options: { - banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n' + banner: '/*! <%= pkg.name %> */\n' }, dist: { files: { diff --git a/bi/base.css b/bi/base.css index 06c04b552..cce900ad7 100644 --- a/bi/base.css +++ b/bi/base.css @@ -682,7 +682,8 @@ li.CodeMirror-hint-active { .bi-theme-dark .bi-segment > .first-element { border-left: 1px solid #242640; } -.bi-button { +body .bi-button, +#body .bi-button { -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; @@ -693,131 +694,196 @@ li.CodeMirror-hint-active { cursor: pointer; font-size: 14px; } -.bi-button.block { +body .bi-button.block, +#body .bi-button.block { font-size: inherit; border-width: 0; -webkit-border-radius: 0px; -moz-border-radius: 0px; border-radius: 0px; } -.bi-button.clear { +body .bi-button.clear, +#body .bi-button.clear { font-size: inherit; border-width: 0; background-color: transparent; } -.bi-button.clear:hover, -.bi-button.clear:active { +body .bi-button.clear:hover, +#body .bi-button.clear:hover, +body .bi-button.clear:active, +#body .bi-button.clear:active { opacity: 0.75; filter: alpha(opacity=75); } -.bi-button.button-common, -.bi-button.button-common .b-font:before { +body .bi-button.button-common, +#body .bi-button.button-common, +body .bi-button.button-common .b-font:before, +#body .bi-button.button-common .b-font:before { color: #ffffff; } -.bi-button.button-common.clear, -.bi-button.button-common.clear .b-font:before { +body .bi-button.button-common.clear, +#body .bi-button.button-common.clear, +body .bi-button.button-common.clear .b-font:before, +#body .bi-button.button-common.clear .b-font:before { color: #3f8ce8; } -.bi-button.button-ignore { +body .bi-button.button-ignore, +#body .bi-button.button-ignore { background-color: #ffffff; border-color: #d4dadd; } -.bi-button.button-ignore, -.bi-button.button-ignore .b-font:before { +body .bi-button.button-ignore, +#body .bi-button.button-ignore, +body .bi-button.button-ignore .b-font:before, +#body .bi-button.button-ignore .b-font:before { color: #1a1a1a; } -.bi-button.button-ignore.clear { +body .bi-button.button-ignore.clear, +#body .bi-button.button-ignore.clear { background-color: transparent; border-width: 0; } -.bi-button.button-success { +body .bi-button.button-success, +#body .bi-button.button-success { background-color: #58cc7d; border-color: #58cc7d; } -.bi-button.button-success, -.bi-button.button-success .b-font:before { +body .bi-button.button-success, +#body .bi-button.button-success, +body .bi-button.button-success .b-font:before, +#body .bi-button.button-success .b-font:before { color: #ffffff; } -.bi-button.button-success.clear { +body .bi-button.button-success.clear, +#body .bi-button.button-success.clear { background-color: transparent; border-width: 0; } -.bi-button.button-success.clear, -.bi-button.button-success.clear .b-font:before { +body .bi-button.button-success.clear, +#body .bi-button.button-success.clear, +body .bi-button.button-success.clear .b-font:before, +#body .bi-button.button-success.clear .b-font:before { color: #0c6d23; } -.bi-button.button-warning { +body .bi-button.button-warning, +#body .bi-button.button-warning { background-color: #e85050; border-color: #e85050; } -.bi-button.button-warning, -.bi-button.button-warning .b-font:before { +body .bi-button.button-warning, +#body .bi-button.button-warning, +body .bi-button.button-warning .b-font:before, +#body .bi-button.button-warning .b-font:before { color: #ffffff; } -.bi-button.button-warning.clear { +body .bi-button.button-warning.clear, +#body .bi-button.button-warning.clear { background-color: transparent; border-width: 0; } -.bi-button.button-warning.clear, -.bi-button.button-warning.clear .b-font:before { +body .bi-button.button-warning.clear, +#body .bi-button.button-warning.clear, +body .bi-button.button-warning.clear .b-font:before, +#body .bi-button.button-warning.clear .b-font:before { color: #e85050; } -.bi-button.button-common.disabled, -.bi-button.button-success.disabled, -.bi-button.button-warning.disabled, -.bi-button.button-common.disabled.base-disabled, -.bi-button.button-success.disabled.base-disabled, -.bi-button.button-warning.disabled.base-disabled { +body .bi-button.button-common.disabled, +#body .bi-button.button-common.disabled, +body .bi-button.button-success.disabled, +#body .bi-button.button-success.disabled, +body .bi-button.button-warning.disabled, +#body .bi-button.button-warning.disabled, +body .bi-button.button-common.disabled.base-disabled, +#body .bi-button.button-common.disabled.base-disabled, +body .bi-button.button-success.disabled.base-disabled, +#body .bi-button.button-success.disabled.base-disabled, +body .bi-button.button-warning.disabled.base-disabled, +#body .bi-button.button-warning.disabled.base-disabled { background: #cccccc !important; border-color: #cccccc !important; } -.bi-button.button-common.disabled, -.bi-button.button-success.disabled, -.bi-button.button-warning.disabled, -.bi-button.button-common.disabled.base-disabled, -.bi-button.button-success.disabled.base-disabled, -.bi-button.button-warning.disabled.base-disabled, -.bi-button.button-common.disabled .b-font:before, -.bi-button.button-success.disabled .b-font:before, -.bi-button.button-warning.disabled .b-font:before, -.bi-button.button-common.disabled.base-disabled .b-font:before, -.bi-button.button-success.disabled.base-disabled .b-font:before, -.bi-button.button-warning.disabled.base-disabled .b-font:before { +body .bi-button.button-common.disabled, +#body .bi-button.button-common.disabled, +body .bi-button.button-success.disabled, +#body .bi-button.button-success.disabled, +body .bi-button.button-warning.disabled, +#body .bi-button.button-warning.disabled, +body .bi-button.button-common.disabled.base-disabled, +#body .bi-button.button-common.disabled.base-disabled, +body .bi-button.button-success.disabled.base-disabled, +#body .bi-button.button-success.disabled.base-disabled, +body .bi-button.button-warning.disabled.base-disabled, +#body .bi-button.button-warning.disabled.base-disabled, +body .bi-button.button-common.disabled .b-font:before, +#body .bi-button.button-common.disabled .b-font:before, +body .bi-button.button-success.disabled .b-font:before, +#body .bi-button.button-success.disabled .b-font:before, +body .bi-button.button-warning.disabled .b-font:before, +#body .bi-button.button-warning.disabled .b-font:before, +body .bi-button.button-common.disabled.base-disabled .b-font:before, +#body .bi-button.button-common.disabled.base-disabled .b-font:before, +body .bi-button.button-success.disabled.base-disabled .b-font:before, +#body .bi-button.button-success.disabled.base-disabled .b-font:before, +body .bi-button.button-warning.disabled.base-disabled .b-font:before, +#body .bi-button.button-warning.disabled.base-disabled .b-font:before { color: #ffffff !important; } -.bi-button.button-ignore.disabled { +body .bi-button.button-ignore.disabled, +#body .bi-button.button-ignore.disabled { background: #ffffff !important; border-color: #d4dadd !important; } -.bi-button.button-ignore.disabled, -.bi-button.button-ignore.disabled .b-font:before { +body .bi-button.button-ignore.disabled, +#body .bi-button.button-ignore.disabled, +body .bi-button.button-ignore.disabled .b-font:before, +#body .bi-button.button-ignore.disabled .b-font:before { color: #cccccc !important; } -.bi-button.button-common.disabled.clear, -.bi-button.button-success.disabled.clear, -.bi-button.button-warning.disabled.clear, -.bi-button.button-ignore.disabled.clear { +body .bi-button.button-common.disabled.clear, +#body .bi-button.button-common.disabled.clear, +body .bi-button.button-success.disabled.clear, +#body .bi-button.button-success.disabled.clear, +body .bi-button.button-warning.disabled.clear, +#body .bi-button.button-warning.disabled.clear, +body .bi-button.button-ignore.disabled.clear, +#body .bi-button.button-ignore.disabled.clear { background: transparent !important; border-width: 0 !important; } -.bi-button.button-common.disabled.clear, -.bi-button.button-success.disabled.clear, -.bi-button.button-warning.disabled.clear, -.bi-button.button-ignore.disabled.clear, -.bi-button.button-common.disabled.clear .b-font:before, -.bi-button.button-success.disabled.clear .b-font:before, -.bi-button.button-warning.disabled.clear .b-font:before, -.bi-button.button-ignore.disabled.clear .b-font:before { +body .bi-button.button-common.disabled.clear, +#body .bi-button.button-common.disabled.clear, +body .bi-button.button-success.disabled.clear, +#body .bi-button.button-success.disabled.clear, +body .bi-button.button-warning.disabled.clear, +#body .bi-button.button-warning.disabled.clear, +body .bi-button.button-ignore.disabled.clear, +#body .bi-button.button-ignore.disabled.clear, +body .bi-button.button-common.disabled.clear .b-font:before, +#body .bi-button.button-common.disabled.clear .b-font:before, +body .bi-button.button-success.disabled.clear .b-font:before, +#body .bi-button.button-success.disabled.clear .b-font:before, +body .bi-button.button-warning.disabled.clear .b-font:before, +#body .bi-button.button-warning.disabled.clear .b-font:before, +body .bi-button.button-ignore.disabled.clear .b-font:before, +#body .bi-button.button-ignore.disabled.clear .b-font:before { color: #cccccc !important; } -.bi-button.button-common.disabled.clear:hover, -.bi-button.button-success.disabled.clear:hover, -.bi-button.button-warning.disabled.clear:hover, -.bi-button.button-ignore.disabled.clear:hover, -.bi-button.button-common.disabled.clear:active, -.bi-button.button-success.disabled.clear:active, -.bi-button.button-warning.disabled.clear:active, -.bi-button.button-ignore.disabled.clear:active { +body .bi-button.button-common.disabled.clear:hover, +#body .bi-button.button-common.disabled.clear:hover, +body .bi-button.button-success.disabled.clear:hover, +#body .bi-button.button-success.disabled.clear:hover, +body .bi-button.button-warning.disabled.clear:hover, +#body .bi-button.button-warning.disabled.clear:hover, +body .bi-button.button-ignore.disabled.clear:hover, +#body .bi-button.button-ignore.disabled.clear:hover, +body .bi-button.button-common.disabled.clear:active, +#body .bi-button.button-common.disabled.clear:active, +body .bi-button.button-success.disabled.clear:active, +#body .bi-button.button-success.disabled.clear:active, +body .bi-button.button-warning.disabled.clear:active, +#body .bi-button.button-warning.disabled.clear:active, +body .bi-button.button-ignore.disabled.clear:active, +#body .bi-button.button-ignore.disabled.clear:active { opacity: 1; filter: alpha(opacity=100); } @@ -884,7 +950,8 @@ li.CodeMirror-hint-active { filter: alpha(opacity=0); z-index: 2; } -.bi-input { +.bi-input, +.bi-textarea { border: none; outline: none; background-color: transparent; @@ -893,10 +960,12 @@ li.CodeMirror-hint-active { width: 100%; height: 100%; } -.bi-input.bi-input-focus { +.bi-input.bi-input-focus, +.bi-textarea.bi-input-focus { border: none; } -.bi-input.bi-input-error { +.bi-input.bi-input-error, +.bi-textarea.bi-input-error { border: none; color: #e85050 !important; } diff --git a/bi/base.js b/bi/base.js index 73fd05147..50e78a4ec 100644 --- a/bi/base.js +++ b/bi/base.js @@ -1,33801 +1,33664 @@ -/*! - * jQuery Mousewheel 3.1.13 - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license - * http://jquery.org/license - */ - -(function (factory) { - if ( typeof define === 'function' && define.amd ) { - // AMD. Register as an anonymous module. - define(['../core/jquery'], factory); - } else if (typeof exports === 'object') { - // Node/CommonJS style for Browserify - module.exports = factory; - } else { - // Browser globals - factory(jQuery); - } -}(function ($) { - - var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'], - toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ? - ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'], - slice = Array.prototype.slice, - nullLowestDeltaTimeout, lowestDelta; - - if ( $.event.fixHooks ) { - for ( var i = toFix.length; i; ) { - $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks; - } - } - - var special = $.event.special.mousewheel = { - version: '3.1.12', - - setup: function() { - if ( this.addEventListener ) { - for ( var i = toBind.length; i; ) { - this.addEventListener( toBind[--i], handler, false ); - } - } else { - this.onmousewheel = handler; - } - }, - - teardown: function() { - if ( this.removeEventListener ) { - for ( var i = toBind.length; i; ) { - this.removeEventListener( toBind[--i], handler, false ); - } - } else { - this.onmousewheel = null; - } - }, - - settings: { - adjustOldDeltas: true, // see shouldAdjustOldDeltas() below - normalizeOffset: true // calls getBoundingClientRect for each event - } - }; - - $.fn.extend({ - mousewheel: function(fn) { - return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel'); - }, - - unmousewheel: function(fn) { - return this.unbind('mousewheel', fn); - } - }); - - - function handler(event) { - var orgEvent = event || window.event, - args = slice.call(arguments, 1), - delta = 0, - deltaX = 0, - deltaY = 0, - absDelta = 0, - offsetX = 0, - offsetY = 0; - event = $.event.fix(orgEvent); - event.type = 'mousewheel'; - - // Old school scrollwheel delta - if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; } - if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; } - if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; } - if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; } - - // Firefox < 17 horizontal scrolling related to DOMMouseScroll event - if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { - deltaX = deltaY * -1; - deltaY = 0; - } - - // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy - delta = deltaY === 0 ? deltaX : deltaY; - - // New school wheel delta (wheel event) - if ( 'deltaY' in orgEvent ) { - deltaY = orgEvent.deltaY * -1; - delta = deltaY; - } - if ( 'deltaX' in orgEvent ) { - deltaX = orgEvent.deltaX; - if ( deltaY === 0 ) { delta = deltaX * -1; } - } - - // No change actually happened, no reason to go any further - if ( deltaY === 0 && deltaX === 0 ) { return; } - - // Need to convert lines and pages to pixels if we aren't already in pixels - // There are three delta modes: - // * deltaMode 0 is by pixels, nothing to do - // * deltaMode 1 is by lines - // * deltaMode 2 is by pages - if ( orgEvent.deltaMode === 1 ) { - var lineHeight = 40; - delta *= lineHeight; - deltaY *= lineHeight; - deltaX *= lineHeight; - } else if ( orgEvent.deltaMode === 2 ) { - var pageHeight = 800; - delta *= pageHeight; - deltaY *= pageHeight; - deltaX *= pageHeight; - } - - // Store lowest absolute delta to normalize the delta values - absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) ); - - if ( !lowestDelta || absDelta < lowestDelta ) { - lowestDelta = absDelta; - - // Adjust older deltas if necessary - if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) { - lowestDelta /= 40; - } - } - - // Adjust older deltas if necessary - if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) { - // Divide all the things by 40! - delta /= 40; - deltaX /= 40; - deltaY /= 40; - } - - // Get a whole, normalized value for the deltas - delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta); - deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta); - deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta); - - // Normalise offsetX and offsetY properties - if ( special.settings.normalizeOffset && this.getBoundingClientRect ) { - var boundingRect = this.getBoundingClientRect(); - offsetX = event.clientX - boundingRect.left; - offsetY = event.clientY - boundingRect.top; - } - - // Add information to the event object - event.deltaX = deltaX; - event.deltaY = deltaY; - event.deltaFactor = lowestDelta; - event.offsetX = offsetX; - event.offsetY = offsetY; - // Go ahead and set deltaMode to 0 since we converted to pixels - // Although this is a little odd since we overwrite the deltaX/Y - // properties with normalized deltas. - event.deltaMode = 0; - - // Add event and delta to the front of the arguments - args.unshift(event, delta, deltaX, deltaY); - - // Clearout lowestDelta after sometime to better - // handle multiple device types that give different - // a different lowestDelta - // Ex: trackpad = 3 and mouse wheel = 120 - if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); } - nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200); - - return ($.event.dispatch || $.event.handle).apply(this, args); - } - - function nullLowestDelta() { - lowestDelta = null; - } - - function shouldAdjustOldDeltas(orgEvent, absDelta) { - // If this is an older event and the delta is divisable by 120, - // then we are assuming that the browser is treating this as an - // older mouse wheel event and that we should divide the deltas - // by 40 to try and get a more usable deltaFactor. - // Side note, this actually impacts the reported scroll distance - // in older browsers and can cause scrolling to be slower than native. - // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false. - return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0; - } - -}));/** - * jQuery "splendid textchange" plugin - * http://benalpert.com/2013/06/18/a-near-perfect-oninput-shim-for-ie-8-and-9.html - * - * (c) 2013 Ben Alpert, released under the MIT license - */ - -(function($) { - - var testNode = document.createElement("input"); - var isInputSupported = "oninput" in testNode && - (!("documentMode" in document) || document.documentMode > 9); - - var hasInputCapabilities = function(elem) { - // The HTML5 spec lists many more types than `text` and `password` on - // which the input event is triggered but none of them exist in IE 8 or - // 9, so we don't check them here. - // TODO: