瀏覽代碼

Merge pull request #1865 from system19/develop

Update jquery.min.js & jquery-ui.min.js - qunit.js & css - jquery.ui.timepicker-addon.js & css
version-14
Rushabh Mehta 9 年之前
committed by GitHub
父節點
當前提交
cb23c53df9
共有 7 個檔案被更改,包括 4631 行新增1919 行删除
  1. +11
    -6
      frappe/public/js/lib/jquery/jquery-ui.min.js
  2. +195
    -91
      frappe/public/js/lib/jquery/jquery.hotkeys.js
  3. +4
    -4
      frappe/public/js/lib/jquery/jquery.min.js
  4. +20
    -1
      frappe/public/js/lib/jquery/jquery.ui.timepicker-addon.css
  5. +249
    -103
      frappe/public/js/lib/jquery/jquery.ui.timepicker-addon.js
  6. +232
    -61
      frappe/public/js/lib/jquery/qunit.css
  7. +3920
    -1653
      frappe/public/js/lib/jquery/qunit.js

+ 11
- 6
frappe/public/js/lib/jquery/jquery-ui.min.js
文件差異過大導致無法顯示
查看文件


+ 195
- 91
frappe/public/js/lib/jquery/jquery.hotkeys.js 查看文件

@@ -1,100 +1,204 @@
/*jslint browser: true*/
/*jslint jquery: true*/

/*
* jQuery Hotkeys Plugin
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Based upon the plugin by Tzury Bar Yochay:
* http://github.com/tzuryby/hotkeys
* https://github.com/tzuryby/jquery.hotkeys
*
* Original idea by:
* Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
*/

(function(jQuery){
jQuery.hotkeys = {
version: "0.8",

specialKeys: {
8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause",
20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home",
37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del",
96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7",
104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/",
112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8",
120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 191: "/", 224: "meta"
},
shiftNums: {
"`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&",
"8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<",
".": ">", "/": "?", "\\": "|"
}
};

function keyHandler( handleObj ) {
// Only care when a possible input has been specified
if ( typeof handleObj.data !== "string" ) {
return;
}
var origHandler = handleObj.handler,
keys = handleObj.data.toLowerCase().split(" "),
textAcceptingInputTypes = ["text", "password", "number", "email", "url", "range", "date", "month", "week", "time", "datetime", "datetime-local", "search", "color"];
handleObj.handler = function( event ) {
// Don't fire in text-accepting inputs that we didn't directly bind to
// if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) ||
// jQuery.inArray(event.target.type, textAcceptingInputTypes) > -1 ) ) {
// return;
// }
// Keypress represents characters, not special keys
var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[ event.which ],
character = String.fromCharCode( event.which ).toLowerCase(),
key, modif = "", possible = {};

// check combinations (alt|ctrl|shift+anything)
if ( event.altKey && special !== "alt" ) {
modif += "alt+";
}

if ( event.ctrlKey && special !== "ctrl" ) {
modif += "ctrl+";
}
// TODO: Need to make sure this works consistently across platforms
if ( event.metaKey && !event.ctrlKey && special !== "meta" ) {
modif += "meta+";
}

if ( event.shiftKey && special !== "shift" ) {
modif += "shift+";
}

if ( special ) {
possible[ modif + special ] = true;

} else {
possible[ modif + character ] = true;
possible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true;

// "$" can be triggered as "Shift+4" or "Shift+$" or just "$"
if ( modif === "shift+" ) {
possible[ jQuery.hotkeys.shiftNums[ character ] ] = true;
}
}

for ( var i = 0, l = keys.length; i < l; i++ ) {
if ( possible[ keys[i] ] ) {
return origHandler.apply( this, arguments );
}
}
};
}

jQuery.each([ "keydown", "keyup", "keypress" ], function() {
jQuery.event.special[ this ] = { add: keyHandler };
});

})( jQuery );
*/

/*
* One small change is: now keys are passed by object { keys: '...' }
* Might be useful, when you want to pass some other data to your handler
*/

(function(jQuery) {

jQuery.hotkeys = {
version: "0.2.0",

specialKeys: {
8: "backspace",
9: "tab",
10: "return",
13: "return",
16: "shift",
17: "ctrl",
18: "alt",
19: "pause",
20: "capslock",
27: "esc",
32: "space",
33: "pageup",
34: "pagedown",
35: "end",
36: "home",
37: "left",
38: "up",
39: "right",
40: "down",
45: "insert",
46: "del",
59: ";",
61: "=",
96: "0",
97: "1",
98: "2",
99: "3",
100: "4",
101: "5",
102: "6",
103: "7",
104: "8",
105: "9",
106: "*",
107: "+",
109: "-",
110: ".",
111: "/",
112: "f1",
113: "f2",
114: "f3",
115: "f4",
116: "f5",
117: "f6",
118: "f7",
119: "f8",
120: "f9",
121: "f10",
122: "f11",
123: "f12",
144: "numlock",
145: "scroll",
173: "-",
186: ";",
187: "=",
188: ",",
189: "-",
190: ".",
191: "/",
192: "`",
219: "[",
220: "\\",
221: "]",
222: "'"
},

shiftNums: {
"`": "~",
"1": "!",
"2": "@",
"3": "#",
"4": "$",
"5": "%",
"6": "^",
"7": "&",
"8": "*",
"9": "(",
"0": ")",
"-": "_",
"=": "+",
";": ": ",
"'": "\"",
",": "<",
".": ">",
"/": "?",
"\\": "|"
},

// excludes: button, checkbox, file, hidden, image, password, radio, reset, search, submit, url
textAcceptingInputTypes: [
"text", "password", "number", "email", "url", "range", "date", "month", "week", "time", "datetime",
"datetime-local", "search", "color", "tel"],

// default input types not to bind to unless bound directly
textInputTypes: /textarea|input|select/i,

options: {
filterInputAcceptingElements: true,
filterTextInputs: true,
filterContentEditable: true
}
};

function keyHandler(handleObj) {
if (typeof handleObj.data === "string") {
handleObj.data = {
keys: handleObj.data
};
}

// Only care when a possible input has been specified
if (!handleObj.data || !handleObj.data.keys || typeof handleObj.data.keys !== "string") {
return;
}

var origHandler = handleObj.handler,
keys = handleObj.data.keys.toLowerCase().split(" ");

handleObj.handler = function(event) {
// Don't fire in text-accepting inputs that we didn't directly bind to
if (this !== event.target &&
(jQuery.hotkeys.options.filterInputAcceptingElements &&
jQuery.hotkeys.textInputTypes.test(event.target.nodeName) ||
(jQuery.hotkeys.options.filterContentEditable && jQuery(event.target).attr('contenteditable')) ||
(jQuery.hotkeys.options.filterTextInputs &&
jQuery.inArray(event.target.type, jQuery.hotkeys.textAcceptingInputTypes) > -1))) {
return;
}

var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[event.which],
character = String.fromCharCode(event.which).toLowerCase(),
modif = "",
possible = {};

jQuery.each(["alt", "ctrl", "shift"], function(index, specialKey) {

if (event[specialKey + 'Key'] && special !== specialKey) {
modif += specialKey + '+';
}
});

// metaKey is triggered off ctrlKey erronously
if (event.metaKey && !event.ctrlKey && special !== "meta") {
modif += "meta+";
}

if (event.metaKey && special !== "meta" && modif.indexOf("alt+ctrl+shift+") > -1) {
modif = modif.replace("alt+ctrl+shift+", "hyper+");
}

if (special) {
possible[modif + special] = true;
}
else {
possible[modif + character] = true;
possible[modif + jQuery.hotkeys.shiftNums[character]] = true;

// "$" can be triggered as "Shift+4" or "Shift+$" or just "$"
if (modif === "shift+") {
possible[jQuery.hotkeys.shiftNums[character]] = true;
}
}

for (var i = 0, l = keys.length; i < l; i++) {
if (possible[keys[i]]) {
return origHandler.apply(this, arguments);
}
}
};
}

jQuery.each(["keydown", "keyup", "keypress"], function() {
jQuery.event.special[this] = {
add: keyHandler
};
});

})(jQuery || this.jQuery || window.jQuery);

+ 4
- 4
frappe/public/js/lib/jquery/jquery.min.js
文件差異過大導致無法顯示
查看文件


+ 20
- 1
frappe/public/js/lib/jquery/jquery.ui.timepicker-addon.css 查看文件

@@ -4,8 +4,27 @@
.ui-timepicker-div dl dd { margin: 0 10px 10px 40%; }
.ui-timepicker-div td { font-size: 90%; }
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
.ui-timepicker-div .ui_tpicker_unit_hide{ display: none; }

.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input { background: none; color: inherit; border: none; outline: none; border-bottom: solid 1px #555; width: 95%; }
.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input:focus { border-bottom-color: #aaa; }

.ui-timepicker-rtl{ direction: rtl; }
.ui-timepicker-rtl dl { text-align: right; padding: 0 5px 0 0; }
.ui-timepicker-rtl dl dt{ float: right; clear: right; }
.ui-timepicker-rtl dl dd { margin: 0 40% 10px 10px; }
.ui-timepicker-rtl dl dd { margin: 0 40% 10px 10px; }

/* Shortened version style */
.ui-timepicker-div.ui-timepicker-oneLine { padding-right: 2px; }
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time,
.ui-timepicker-div.ui-timepicker-oneLine dt { display: none; }
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time_label { display: block; padding-top: 2px; }
.ui-timepicker-div.ui-timepicker-oneLine dl { text-align: right; }
.ui-timepicker-div.ui-timepicker-oneLine dl dd,
.ui-timepicker-div.ui-timepicker-oneLine dl dd > div { display:inline-block; margin:0; }
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_minute:before,
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_second:before { content:':'; display:inline-block; }
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_millisec:before,
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_microsec:before { content:'.'; display:inline-block; }
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide,
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide:before{ display: none; }

+ 249
- 103
frappe/public/js/lib/jquery/jquery.ui.timepicker-addon.js 查看文件

@@ -1,7 +1,13 @@
/*! jQuery Timepicker Addon - v1.4.3 - 2013-11-30
/*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20
* http://trentrichardson.com/examples/timepicker
* Copyright (c) 2013 Trent Richardson; Licensed MIT */
(function ($) {
* Copyright (c) 2016 Trent Richardson; Licensed MIT */
(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery', 'jquery-ui'], factory);
} else {
factory(jQuery);
}
}(function ($) {

/*
* Lets not redefine timepicker, Prevent "Uncaught RangeError: Maximum call stack size exceeded"
@@ -16,11 +22,11 @@
*/
$.extend($.ui, {
timepicker: {
version: "1.4.3"
version: "1.6.3"
}
});

/*
/*
* Timepicker manager.
* Use the singleton instance of this class, $.timepicker, to interact with the time picker.
* Settings for (groups of) time pickers are maintained in an instance object,
@@ -48,6 +54,7 @@
this._defaults = { // Global defaults for all the datetime picker instances
showButtonPanel: true,
timeOnly: false,
timeOnlyShowDate: false,
showHour: null,
showMinute: null,
showSecond: null,
@@ -78,6 +85,8 @@
microsecMax: 999,
minDateTime: null,
maxDateTime: null,
maxTime: null,
minTime: null,
onSelect: null,
hourGrid: 0,
minuteGrid: 0,
@@ -90,6 +99,7 @@
altTimeFormat: null,
altSeparator: null,
altTimeSuffix: null,
altRedirectFocus: true,
pickerTimeFormat: null,
pickerTimeSuffix: null,
showTimepicker: true,
@@ -97,8 +107,10 @@
addSliderAccess: false,
sliderAccessArgs: null,
controlType: 'slider',
oneLine: false,
defaultValue: null,
parse: 'strict'
parse: 'strict',
afterInject: null
};
$.extend(this._defaults, this.regional['']);
};
@@ -114,6 +126,8 @@
millisec_slider: null,
microsec_slider: null,
timezone_select: null,
maxTime: null,
minTime: null,
hour: 0,
minute: 0,
second: 0,
@@ -139,7 +153,7 @@
support: {},
control: null,

/*
/*
* Override the default settings for all instances of the time picker.
* @param {Object} settings object - the new settings to use as defaults (anonymous object)
* @return {Object} the manager object
@@ -179,7 +193,7 @@
},
onChangeMonthYear: function (year, month, dp_inst) {
// Update the time as well : this prevents the time from disappearing from the $input field.
tp_inst._updateDateTime(dp_inst);
// tp_inst._updateDateTime(dp_inst);
if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) {
tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst);
}
@@ -195,7 +209,7 @@
};
for (i in overrides) {
if (overrides.hasOwnProperty(i)) {
fns[i] = opts[i] || null;
fns[i] = opts[i] || this._defaults[i] || null;
}
}

@@ -212,7 +226,7 @@

// detect which units are supported
tp_inst.support = detectSupport(
tp_inst._defaults.timeFormat +
tp_inst._defaults.timeFormat +
(tp_inst._defaults.pickerTimeFormat ? tp_inst._defaults.pickerTimeFormat : '') +
(tp_inst._defaults.altTimeFormat ? tp_inst._defaults.altTimeFormat : ''));

@@ -260,11 +274,14 @@
tp_inst.$input = $input;

if (tp_inst._defaults.altField) {
tp_inst.$altInput = $(tp_inst._defaults.altField).css({
cursor: 'pointer'
}).focus(function () {
$input.trigger("focus");
});
tp_inst.$altInput = $(tp_inst._defaults.altField);
if (tp_inst._defaults.altRedirectFocus === true) {
tp_inst.$altInput.css({
cursor: 'pointer'
}).focus(function () {
$input.trigger("focus");
});
}
}

if (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime === 0) {
@@ -298,11 +315,12 @@
* add our sliders to the calendar
*/
_addTimePicker: function (dp_inst) {
var currDT = (this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val();
var currDT = $.trim((this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val());

this.timeDefined = this._parseTime(currDT);
this._limitMinMaxDateTime(dp_inst, false);
this._injectTimePicker();
this._afterInject();
},

/*
@@ -339,6 +357,16 @@
}
},

/*
* Handle callback option after injecting timepicker
*/
_afterInject: function() {
var o = this.inst.settings;
if ($.isFunction(o.afterInject)) {
o.afterInject.call(this);
}
},

/*
* generate and inject html for timepicker into ui datepicker
*/
@@ -357,9 +385,9 @@

// Prevent displaying twice
if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) {
var noDisplay = ' style="display:none;"',
html = '<div class="ui-timepicker-div' + (o.isRTL ? ' ui-timepicker-rtl' : '') + '"><dl>' + '<dt class="ui_tpicker_time_label"' + ((o.showTime) ? '' : noDisplay) + '>' + o.timeText + '</dt>' +
'<dd class="ui_tpicker_time"' + ((o.showTime) ? '' : noDisplay) + '></dd>';
var noDisplay = ' ui_tpicker_unit_hide',
html = '<div class="ui-timepicker-div' + (o.isRTL ? ' ui-timepicker-rtl' : '') + (o.oneLine && o.controlType === 'select' ? ' ui-timepicker-oneLine' : '') + '"><dl>' + '<dt class="ui_tpicker_time_label' + ((o.showTime) ? '' : noDisplay) + '">' + o.timeText + '</dt>' +
'<dd class="ui_tpicker_time '+ ((o.showTime) ? '' : noDisplay) + '"><input class="ui_tpicker_time_input" ' + (o.timeInput ? '' : 'disabled') + '/></dd>';

// Create the markup
for (i = 0, l = this.units.length; i < l; i++) {
@@ -373,8 +401,8 @@
max[litem] = parseInt((o[litem + 'Max'] - ((o[litem + 'Max'] - o[litem + 'Min']) % o['step' + uitem])), 10);
gridSize[litem] = 0;

html += '<dt class="ui_tpicker_' + litem + '_label"' + (show ? '' : noDisplay) + '>' + o[litem + 'Text'] + '</dt>' +
'<dd class="ui_tpicker_' + litem + '"><div class="ui_tpicker_' + litem + '_slider"' + (show ? '' : noDisplay) + '></div>';
html += '<dt class="ui_tpicker_' + litem + '_label' + (show ? '' : noDisplay) + '">' + o[litem + 'Text'] + '</dt>' +
'<dd class="ui_tpicker_' + litem + (show ? '' : noDisplay) + '"><div class="ui_tpicker_' + litem + '_slider' + (show ? '' : noDisplay) + '"></div>';

if (show && o[litem + 'Grid'] > 0) {
html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';
@@ -397,11 +425,11 @@
}
html += '</dd>';
}
// Timezone
var showTz = o.showTimezone !== null ? o.showTimezone : this.support.timezone;
html += '<dt class="ui_tpicker_timezone_label"' + (showTz ? '' : noDisplay) + '>' + o.timezoneText + '</dt>';
html += '<dd class="ui_tpicker_timezone" ' + (showTz ? '' : noDisplay) + '></dd>';
html += '<dt class="ui_tpicker_timezone_label' + (showTz ? '' : noDisplay) + '">' + o.timezoneText + '</dt>';
html += '<dd class="ui_tpicker_timezone' + (showTz ? '' : noDisplay) + '"></dd>';

// Create the elements from string
html += '</dl></div>';
@@ -412,7 +440,7 @@
$tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all">' + '<div class="ui-datepicker-title">' + o.timeOnlyTitle + '</div>' + '</div>');
$dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide();
}
// add sliders, adjust grids, add events
for (i = 0, l = tp_inst.units.length; i < l; i++) {
litem = tp_inst.units[i];
@@ -447,7 +475,7 @@
}
}
}
tp_inst.control.value(tp_inst, tp_inst[f + '_slider'], litem, n);

tp_inst._onTimeChange();
@@ -484,9 +512,10 @@
this.timezone_select.change(function () {
tp_inst._onTimeChange();
tp_inst._onSelectHandler();
tp_inst._afterInject();
});
// End timezone options
// inject timepicker into datepicker
var $buttonPanel = $dp.find('.ui-datepicker-buttonpane');
if ($buttonPanel.length) {
@@ -495,7 +524,21 @@
$dp.append($tp);
}

this.$timeObj = $tp.find('.ui_tpicker_time');
this.$timeObj = $tp.find('.ui_tpicker_time_input');
this.$timeObj.change(function () {
var timeFormat = tp_inst.inst.settings.timeFormat;
var parsedTime = $.datepicker.parseTime(timeFormat, this.value);
var update = new Date();
if (parsedTime) {
update.setHours(parsedTime.hour);
update.setMinutes(parsedTime.minute);
update.setSeconds(parsedTime.second);
$.datepicker._setTime(tp_inst.inst, update);
} else {
this.value = tp_inst.formattedTime;
this.blur();
}
});

if (this.inst !== null) {
var timeDefined = this.timeDefined;
@@ -508,7 +551,7 @@
var sliderAccessArgs = this._defaults.sliderAccessArgs,
rtl = this._defaults.isRTL;
sliderAccessArgs.isRTL = rtl;
setTimeout(function () { // fix for inline mode
if ($tp.find('.ui-slider-access').length === 0) {
$tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs);
@@ -660,6 +703,44 @@
}
}

if (dp_inst.settings.minTime!==null) {
var tempMinTime=new Date("01/01/1970 " + dp_inst.settings.minTime);
if (this.hour<tempMinTime.getHours()) {
this.hour=this._defaults.hourMin=tempMinTime.getHours();
this.minute=this._defaults.minuteMin=tempMinTime.getMinutes();
} else if (this.hour===tempMinTime.getHours() && this.minute<tempMinTime.getMinutes()) {
this.minute=this._defaults.minuteMin=tempMinTime.getMinutes();
} else {
if (this._defaults.hourMin<tempMinTime.getHours()) {
this._defaults.hourMin=tempMinTime.getHours();
this._defaults.minuteMin=tempMinTime.getMinutes();
} else if (this._defaults.hourMin===tempMinTime.getHours()===this.hour && this._defaults.minuteMin<tempMinTime.getMinutes()) {
this._defaults.minuteMin=tempMinTime.getMinutes();
} else {
this._defaults.minuteMin=0;
}
}
}

if (dp_inst.settings.maxTime!==null) {
var tempMaxTime=new Date("01/01/1970 " + dp_inst.settings.maxTime);
if (this.hour>tempMaxTime.getHours()) {
this.hour=this._defaults.hourMax=tempMaxTime.getHours();
this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes();
} else if (this.hour===tempMaxTime.getHours() && this.minute>tempMaxTime.getMinutes()) {
this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes();
} else {
if (this._defaults.hourMax>tempMaxTime.getHours()) {
this._defaults.hourMax=tempMaxTime.getHours();
this._defaults.minuteMax=tempMaxTime.getMinutes();
} else if (this._defaults.hourMax===tempMaxTime.getHours()===this.hour && this._defaults.minuteMax>tempMaxTime.getMinutes()) {
this._defaults.minuteMax=tempMaxTime.getMinutes();
} else {
this._defaults.minuteMax=59;
}
}
}

if (adjustSliders !== undefined && adjustSliders === true) {
var hourMax = parseInt((this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)), 10),
minMax = parseInt((this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)), 10),
@@ -668,23 +749,23 @@
microsecMax = parseInt((this._defaults.microsecMax - ((this._defaults.microsecMax - this._defaults.microsecMin) % this._defaults.stepMicrosec)), 10);

if (this.hour_slider) {
this.control.options(this, this.hour_slider, 'hour', { min: this._defaults.hourMin, max: hourMax });
this.control.options(this, this.hour_slider, 'hour', { min: this._defaults.hourMin, max: hourMax, step: this._defaults.stepHour });
this.control.value(this, this.hour_slider, 'hour', this.hour - (this.hour % this._defaults.stepHour));
}
if (this.minute_slider) {
this.control.options(this, this.minute_slider, 'minute', { min: this._defaults.minuteMin, max: minMax });
this.control.options(this, this.minute_slider, 'minute', { min: this._defaults.minuteMin, max: minMax, step: this._defaults.stepMinute });
this.control.value(this, this.minute_slider, 'minute', this.minute - (this.minute % this._defaults.stepMinute));
}
if (this.second_slider) {
this.control.options(this, this.second_slider, 'second', { min: this._defaults.secondMin, max: secMax });
this.control.options(this, this.second_slider, 'second', { min: this._defaults.secondMin, max: secMax, step: this._defaults.stepSecond });
this.control.value(this, this.second_slider, 'second', this.second - (this.second % this._defaults.stepSecond));
}
if (this.millisec_slider) {
this.control.options(this, this.millisec_slider, 'millisec', { min: this._defaults.millisecMin, max: millisecMax });
this.control.options(this, this.millisec_slider, 'millisec', { min: this._defaults.millisecMin, max: millisecMax, step: this._defaults.stepMillisec });
this.control.value(this, this.millisec_slider, 'millisec', this.millisec - (this.millisec % this._defaults.stepMillisec));
}
if (this.microsec_slider) {
this.control.options(this, this.microsec_slider, 'microsec', { min: this._defaults.microsecMin, max: microsecMax });
this.control.options(this, this.microsec_slider, 'microsec', { min: this._defaults.microsecMin, max: microsecMax, step: this._defaults.stepMicrosec });
this.control.value(this, this.microsec_slider, 'microsec', this.microsec - (this.microsec % this._defaults.stepMicrosec));
}
}
@@ -753,11 +834,11 @@
// If the update was done using the sliders, update the input field.
var hasChanged = (
hour !== parseInt(this.hour,10) || // sliders should all be numeric
minute !== parseInt(this.minute,10) ||
second !== parseInt(this.second,10) ||
millisec !== parseInt(this.millisec,10) ||
microsec !== parseInt(this.microsec,10) ||
(this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) ||
minute !== parseInt(this.minute,10) ||
second !== parseInt(this.second,10) ||
millisec !== parseInt(this.millisec,10) ||
microsec !== parseInt(this.microsec,10) ||
(this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) ||
(this.timezone !== null && timezone !== this.timezone.toString()) // could be numeric or "EST" format, so use toString()
);

@@ -796,17 +877,22 @@
this.formattedTime = $.datepicker.formatTime(o.timeFormat, this, o);
if (this.$timeObj) {
if (pickerTimeFormat === o.timeFormat) {
this.$timeObj.text(this.formattedTime + pickerTimeSuffix);
this.$timeObj.val(this.formattedTime + pickerTimeSuffix);
}
else {
this.$timeObj.text($.datepicker.formatTime(pickerTimeFormat, this, o) + pickerTimeSuffix);
this.$timeObj.val($.datepicker.formatTime(pickerTimeFormat, this, o) + pickerTimeSuffix);
}
if (this.$timeObj[0].setSelectionRange) {
var sPos = this.$timeObj[0].selectionStart;
var ePos = this.$timeObj[0].selectionEnd;
this.$timeObj[0].setSelectionRange(sPos, ePos);
}
}

this.timeDefined = true;
if (hasChanged) {
this._updateDateTime();
this.$input.focus();
//this.$input.focus(); // may automatically open the picker on setDate
}
},

@@ -827,8 +913,8 @@
*/
_updateDateTime: function (dp_inst) {
dp_inst = this.inst || dp_inst;
var dtTmp = (dp_inst.currentYear > 0?
new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay) :
var dtTmp = (dp_inst.currentYear > 0?
new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay) :
new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
dt = $.datepicker._daylightSavingAdjust(dtTmp),
//dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
@@ -838,7 +924,7 @@
timeAvailable = dt !== null && this.timeDefined;
this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg);
var formattedDateTime = this.formattedDate;
// if a slider was changed but datepicker doesn't have a value yet, set it
if (dp_inst.lastVal === "") {
dp_inst.currentYear = dp_inst.selectedYear;
@@ -848,16 +934,16 @@

/*
* remove following lines to force every changes in date picker to change the input value
* Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker.
* Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker.
* If the user manually empty the value in the input field, the date picker will never change selected value.
*/
//if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) {
// return;
//}

if (this._defaults.timeOnly === true) {
if (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === false) {
formattedDateTime = this.formattedTime;
} else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) {
} else if ((this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) || (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === true)) {
formattedDateTime += this._defaults.separator + this.formattedTime + this._defaults.timeSuffix;
}

@@ -871,9 +957,9 @@
} else if (this.$altInput) {
this.$input.val(formattedDateTime);
var altFormattedDateTime = '',
altSeparator = this._defaults.altSeparator ? this._defaults.altSeparator : this._defaults.separator,
altTimeSuffix = this._defaults.altTimeSuffix ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;
altSeparator = this._defaults.altSeparator !== null ? this._defaults.altSeparator : this._defaults.separator,
altTimeSuffix = this._defaults.altTimeSuffix !== null ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;
if (!this._defaults.timeOnly) {
if (this._defaults.altFormat) {
altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg);
@@ -887,7 +973,7 @@
}
}

if (this._defaults.altTimeFormat) {
if (this._defaults.altTimeFormat !== null) {
altFormattedDateTime += $.datepicker.formatTime(this._defaults.altTimeFormat, this, this._defaults) + altTimeSuffix;
}
else {
@@ -940,7 +1026,7 @@
stop: function (event, ui) {
tp_inst._onSelectHandler();
}
});
});
},
options: function (tp_inst, obj, unit, opts, val) {
if (tp_inst._defaults.isRTL) {
@@ -953,7 +1039,7 @@
}
return obj.slider(opts);
}
var min = opts.min,
var min = opts.min,
max = opts.max;
opts.min = opts.max = null;
if (min !== undefined) {
@@ -985,7 +1071,7 @@
// select methods
select: {
create: function (tp_inst, obj, unit, val, min, max, step) {
var sel = '<select class="ui-timepicker-select" data-unit="' + unit + '" data-min="' + min + '" data-max="' + max + '" data-step="' + step + '">',
var sel = '<select class="ui-timepicker-select ui-state-default ui-corner-all" data-unit="' + unit + '" data-min="' + min + '" data-max="' + max + '" data-step="' + step + '">',
format = tp_inst._defaults.pickerTimeFormat || tp_inst._defaults.timeFormat;

for (var i = min; i <= max; i += step) {
@@ -1004,6 +1090,7 @@
$(sel).appendTo(obj).change(function (e) {
tp_inst._onTimeChange();
tp_inst._onSelectHandler();
tp_inst._afterInject();
});

return obj;
@@ -1015,10 +1102,10 @@
if (val === undefined) {
return $t.data(opts);
}
o[opts] = val;
o[opts] = val;
}
else { o = opts; }
return tp_inst.control.create(tp_inst, obj, $t.data('unit'), $t.val(), o.min || $t.data('min'), o.max || $t.data('max'), o.step || $t.data('step'));
return tp_inst.control.create(tp_inst, obj, $t.data('unit'), $t.val(), o.min>=0 ? o.min : $t.data('min'), o.max || $t.data('max'), o.step || $t.data('step'));
},
value: function (tp_inst, obj, unit, val) {
var $t = obj.children('select');
@@ -1059,7 +1146,7 @@
var tmp_args = arguments;

if (typeof(o) === 'string') {
if (o === 'getDate') {
if (o === 'getDate' || (o === 'option' && tmp_args.length === 2 && typeof (tmp_args[1]) === 'string')) {
return $.fn.datepicker.apply($(this[0]), tmp_args);
} else {
return this.each(function () {
@@ -1182,7 +1269,7 @@
ampm = '';
resTime.ampm = '';
} else {
ampm = $.inArray(treg[order.t].toUpperCase(), o.amNames) !== -1 ? 'AM' : 'PM';
ampm = $.inArray(treg[order.t].toUpperCase(), $.map(o.amNames, function (x,i) { return x.toUpperCase(); })) !== -1 ? 'AM' : 'PM';
resTime.ampm = o[ampm === 'AM' ? 'amNames' : 'pmNames'][0];
}
}
@@ -1250,11 +1337,11 @@
}
catch (err2) {
$.timepicker.log("Unable to parse \ntimeString: " + s + "\ntimeFormat: " + f);
}
}
}
return false;
}; // end looseParse
if (typeof o.parse === "function") {
return o.parse(timeFormat, timeString, o);
}
@@ -1340,14 +1427,17 @@
$.datepicker._base_selectDate = $.datepicker._selectDate;
$.datepicker._selectDate = function (id, dateStr) {
var inst = this._getInst($(id)[0]),
tp_inst = this._get(inst, 'timepicker');
tp_inst = this._get(inst, 'timepicker'),
was_inline;

if (tp_inst) {
if (tp_inst && inst.settings.showTimepicker) {
tp_inst._limitMinMaxDateTime(inst, true);
was_inline = inst.inline;
inst.inline = inst.stay_open = true;
//This way the onSelect handler called from calendarpicker get the full dateTime
this._base_selectDate(id, dateStr);
inst.inline = inst.stay_open = false;
inst.inline = was_inline;
inst.stay_open = false;
this._notifyChange(inst);
this._updateDatepicker(inst);
} else {
@@ -1400,11 +1490,11 @@
.replace(/tT/g, ampm ? 'AaPpMm' : '')
.replace(/T/g, ampm ? 'AP' : '')
.replace(/tt/g, ampm ? 'apm' : '')
.replace(/t/g, ampm ? 'ap' : '') +
" " + tp_inst._defaults.separator +
tp_inst._defaults.timeSuffix +
(tz ? tp_inst._defaults.timezoneList.join('') : '') +
(tp_inst._defaults.amNames.join('')) + (tp_inst._defaults.pmNames.join('')) +
.replace(/t/g, ampm ? 'ap' : '') +
" " + tp_inst._defaults.separator +
tp_inst._defaults.timeSuffix +
(tz ? tp_inst._defaults.timezoneList.join('') : '') +
(tp_inst._defaults.amNames.join('')) + (tp_inst._defaults.pmNames.join('')) +
dateChars,
chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);
return event.ctrlKey || (chr < ' ' || !dateChars || datetimeChars.indexOf(chr) > -1);
@@ -1427,11 +1517,11 @@
var altFormat = tp_inst._defaults.altFormat || tp_inst._defaults.dateFormat,
date = this._getDate(inst),
formatCfg = $.datepicker._getFormatConfig(inst),
altFormattedDateTime = '',
altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator,
altFormattedDateTime = '',
altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator,
altTimeSuffix = tp_inst._defaults.altTimeSuffix ? tp_inst._defaults.altTimeSuffix : tp_inst._defaults.timeSuffix,
altTimeFormat = tp_inst._defaults.altTimeFormat !== null ? tp_inst._defaults.altTimeFormat : tp_inst._defaults.timeFormat;
altFormattedDateTime += $.datepicker.formatTime(altTimeFormat, tp_inst, tp_inst._defaults) + altTimeSuffix;
if (!tp_inst._defaults.timeOnly && !tp_inst._defaults.altFieldTimeOnly && date !== null) {
if (tp_inst._defaults.altFormat) {
@@ -1441,7 +1531,7 @@
altFormattedDateTime = tp_inst.formattedDate + altSeparator + altFormattedDateTime;
}
}
$(altField).val(altFormattedDateTime);
$(altField).val( inst.input.val() ? altFormattedDateTime : "");
}
}
else {
@@ -1471,18 +1561,23 @@
};

/*
* override "Today" button to also grab the time.
* override "Today" button to also grab the time and set it to input field.
*/
$.datepicker._base_gotoToday = $.datepicker._gotoToday;
$.datepicker._gotoToday = function (id) {
var inst = this._getInst($(id)[0]),
$dp = inst.dpDiv;
var inst = this._getInst($(id)[0]);
this._base_gotoToday(id);
var tp_inst = this._get(inst, 'timepicker');
selectLocalTimezone(tp_inst);
if (!tp_inst) {
return;
}

var tzoffset = $.timepicker.timezoneOffsetNumber(tp_inst.timezone);
var now = new Date();
now.setMinutes(now.getMinutes() + now.getTimezoneOffset() + parseInt(tzoffset, 10));
this._setTime(inst, now);
$('.ui-datepicker-today', $dp).click();
this._setDate(inst, now);
tp_inst._onSelectHandler();
};

/*
@@ -1534,7 +1629,7 @@
tp_inst.millisec = date ? date.getMilliseconds() : defaults.millisec;
tp_inst.microsec = date ? date.getMicroseconds() : defaults.microsec;

//check if within min/max times..
//check if within min/max times..
tp_inst._limitMinMaxDateTime(inst, true);

tp_inst._onTimeChange();
@@ -1579,16 +1674,18 @@
* override setDate() to allow setting time too within Date object
*/
$.datepicker._base_setDateDatepicker = $.datepicker._setDateDatepicker;
$.datepicker._setDateDatepicker = function (target, date) {
$.datepicker._setDateDatepicker = function (target, _date) {
var inst = this._getInst(target);
var date = _date;
if (!inst) {
return;
}

if (typeof(date) === 'string') {
date = new Date(date);
if (typeof(_date) === 'string') {
date = new Date(_date);
if (!date.getTime()) {
$.timepicker.log("Error creating Date object from string.");
this._base_setDateDatepicker.apply(this, arguments);
date = $(target).datepicker('getDate');
}
}

@@ -1600,9 +1697,9 @@
} else {
tp_date = date;
}
// This is important if you are using the timezone option, javascript's Date
// object will only return the timezone offset for the current locale, so we
// This is important if you are using the timezone option, javascript's Date
// object will only return the timezone offset for the current locale, so we
// adjust it accordingly. If not using timezone option this won't matter..
// If a timezone is different in tp, keep the timezone as is
if (tp_inst && tp_date) {
@@ -1610,8 +1707,8 @@
if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
tp_inst.timezone = tp_date.getTimezoneOffset() * -1;
}
date = $.timepicker.timezoneAdjust(date, tp_inst.timezone);
tp_date = $.timepicker.timezoneAdjust(tp_date, tp_inst.timezone);
date = $.timepicker.timezoneAdjust(date, $.timepicker.timezoneOffsetString(-date.getTimezoneOffset()), tp_inst.timezone);
tp_date = $.timepicker.timezoneAdjust(tp_date, $.timepicker.timezoneOffsetString(-tp_date.getTimezoneOffset()), tp_inst.timezone);
}

this._updateDatepicker(inst);
@@ -1638,19 +1735,39 @@
}

var date = this._getDate(inst);
if (date && tp_inst._parseTime($(target).val(), tp_inst.timeOnly)) {

var currDT = null;

if (tp_inst.$altInput && tp_inst._defaults.altFieldTimeOnly) {
currDT = tp_inst.$input.val() + ' ' + tp_inst.$altInput.val();
}
else if (tp_inst.$input.get(0).tagName !== 'INPUT' && tp_inst.$altInput) {
/**
* in case the datetimepicker has been applied to a non-input tag for inline UI,
* and the user has not configured the plugin to display only time in altInput,
* pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied)
*
* @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values
*/
currDT = tp_inst.$altInput.val();
}
else {
currDT = tp_inst.$input.val();
}

if (date && tp_inst._parseTime(currDT, !inst.settings.timeOnly)) {
date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
date.setMicroseconds(tp_inst.microsec);

// This is important if you are using the timezone option, javascript's Date
// object will only return the timezone offset for the current locale, so we
// This is important if you are using the timezone option, javascript's Date
// object will only return the timezone offset for the current locale, so we
// adjust it accordingly. If not using timezone option this won't matter..
if (tp_inst.timezone != null) {
// look out for DST if tz wasn't specified
if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
tp_inst.timezone = date.getTimezoneOffset() * -1;
}
date = $.timepicker.timezoneAdjust(date, tp_inst.timezone);
date = $.timepicker.timezoneAdjust(date, tp_inst.timezone, $.timepicker.timezoneOffsetString(-date.getTimezoneOffset()));
}
}
return date;
@@ -1712,7 +1829,10 @@
onselect = null,
overrides = tp_inst._defaults.evnts,
fns = {},
prop;
prop,
ret,
oldVal,
$target;
if (typeof name === 'string') { // if min/max was set with the string
if (name === 'minDate' || name === 'minDateTime') {
min = value;
@@ -1770,13 +1890,24 @@
} else if (onselect) {
tp_inst._defaults.onSelect = onselect;
}

// Datepicker will override our date when we call _base_optionDatepicker when
// calling minDate/maxDate, so we will first grab the value, call
// _base_optionDatepicker, then set our value back.
if(min || max){
$target = $(target);
oldVal = $target.datetimepicker('getDate');
ret = this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);
$target.datetimepicker('setDate', oldVal);
return ret;
}
}
if (value === undefined) {
return this._base_optionDatepicker.call($.datepicker, target, name);
}
return this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);
};
/*
* jQuery isEmptyObject does not check hasOwnProperty - if someone has added to the object prototype,
* it will return false for all objects
@@ -1934,7 +2065,7 @@
hours = (off - minutes) / 60,
iso = iso8601 ? ':' : '',
tz = (off >= 0 ? '+' : '-') + ('0' + Math.abs(hours)).slice(-2) + iso + ('0' + Math.abs(minutes)).slice(-2);
if (tz === '+00:00') {
return 'Z';
}
@@ -1954,7 +2085,7 @@
}

if (!/^(\-|\+)\d{4}$/.test(normalized)) { // possibly a user defined tz, so just give it back
return tzString;
return parseInt(tzString, 10);
}

return ((normalized.substr(0, 1) === '-' ? -1 : 1) * // plus or minus
@@ -1965,13 +2096,15 @@
/**
* No way to set timezone in js Date, so we must adjust the minutes to compensate. (think setDate, getDate)
* @param {Date} date
* @param {string} fromTimezone formatted like "+0500", "-1245"
* @param {string} toTimezone formatted like "+0500", "-1245"
* @return {Date}
*/
$.timepicker.timezoneAdjust = function (date, toTimezone) {
$.timepicker.timezoneAdjust = function (date, fromTimezone, toTimezone) {
var fromTz = $.timepicker.timezoneOffsetNumber(fromTimezone);
var toTz = $.timepicker.timezoneOffsetNumber(toTimezone);
if (!isNaN(toTz)) {
date.setMinutes(date.getMinutes() + -date.getTimezoneOffset() - toTz);
date.setMinutes(date.getMinutes() + (-fromTz) - (-toTz));
}
return date;
};
@@ -2034,6 +2167,13 @@
end: {} // options for end picker
}, options);

// for the mean time this fixes an issue with calling getDate with timepicker()
var timeOnly = false;
if(method === 'timepicker'){
timeOnly = true;
method = 'datetimepicker';
}

function checkDates(changed, other) {
var startdt = startTime[method]('getDate'),
enddt = endTime[method]('getDate'),
@@ -2071,12 +2211,14 @@
date.setMilliseconds(date.getMilliseconds() - options.minInterval);
}
}

if (date.getTime) {
other[method].call(other, 'option', option, date);
}
}

$.fn[method].call(startTime, $.extend({
timeOnly: timeOnly,
onClose: function (dateText, inst) {
checkDates($(this), endTime);
},
@@ -2085,6 +2227,7 @@
}
}, options, options.start));
$.fn[method].call(endTime, $.extend({
timeOnly: timeOnly,
onClose: function (dateText, inst) {
checkDates($(this), startTime);
},
@@ -2094,8 +2237,10 @@
}, options, options.end));

checkDates(startTime, endTime);

selected(startTime, endTime, 'minDate');
selected(endTime, startTime, 'maxDate');

return $([startTime.get(0), endTime.get(0)]);
};

@@ -2104,9 +2249,10 @@
* @param {Object} err pass any type object to log to the console during error or debugging
* @return {void}
*/
$.timepicker.log = function (err) {
if (window.console) {
window.console.log(err);
$.timepicker.log = function () {
// Older IE (9, maybe 10) throw error on accessing `window.console.log.apply`, so check first.
if (window.console && window.console.log && window.console.log.apply) {
window.console.log.apply(window.console, Array.prototype.slice.call(arguments));
}
};

@@ -2140,6 +2286,6 @@
/*
* Keep up with the version
*/
$.timepicker.version = "1.4.3";
$.timepicker.version = "1.6.3";

})(jQuery);
}));

+ 232
- 61
frappe/public/js/lib/jquery/qunit.css 查看文件

@@ -1,86 +1,212 @@
/**
* QUnit v1.11.0 - A JavaScript Unit Testing Framework
/*!
* QUnit 2.0.0
* https://qunitjs.com/
*
* http://qunitjs.com
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
* Date: 2016-06-16T17:09Z
*/

/** Font Family and Sizes */

#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult {
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
}

#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
#qunit-testrunner-toolbar, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
#qunit-tests { font-size: smaller; }


/** Resets */

#qunit-tests, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
#qunit-tests, #qunit-header, #qunit-banner, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
margin: 0;
padding: 0;
}


/** Header */
/** Header (excluding toolbar) */

#qunit-header {
padding: 0.5em 0 0.5em 1em;

color: #8699a4;
background-color: #0d3349;
color: #8699A4;
background-color: #0D3349;

font-size: 1.5em;
line-height: 1em;
font-weight: normal;
font-weight: 400;

border-radius: 5px 5px 0 0;
-moz-border-radius: 5px 5px 0 0;
-webkit-border-top-right-radius: 5px;
-webkit-border-top-left-radius: 5px;
}

#qunit-header a {
text-decoration: none;
color: #c2ccd1;
color: #C2CCD1;
}

#qunit-header a:hover,
#qunit-header a:focus {
color: #fff;
}

#qunit-testrunner-toolbar label {
display: inline-block;
padding: 0 .5em 0 .1em;
color: #FFF;
}

#qunit-banner {
height: 5px;
}

#qunit-testrunner-toolbar {
padding: 0.5em 0 0.5em 2em;
color: #5E740B;
background-color: #eee;
overflow: hidden;
#qunit-filteredTest {
padding: 0.5em 1em 0.5em 1em;
color: #366097;
background-color: #F4FF77;
}

#qunit-userAgent {
padding: 0.5em 0 0.5em 2.5em;
background-color: #2b81af;
color: #fff;
padding: 0.5em 1em 0.5em 1em;
color: #FFF;
background-color: #2B81AF;
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
}

#qunit-modulefilter-container {

/** Toolbar */

#qunit-testrunner-toolbar {
padding: 0.5em 1em 0.5em 1em;
color: #5E740B;
background-color: #EEE;
}

#qunit-testrunner-toolbar .clearfix {
height: 0;
clear: both;
}

#qunit-testrunner-toolbar label {
display: inline-block;
}

#qunit-testrunner-toolbar input[type=checkbox],
#qunit-testrunner-toolbar input[type=radio] {
margin: 3px;
vertical-align: -2px;
}

#qunit-testrunner-toolbar input[type=text] {
box-sizing: border-box;
height: 1.6em;
}

.qunit-url-config,
.qunit-filter,
#qunit-modulefilter {
display: inline-block;
line-height: 2.1em;
}

.qunit-filter,
#qunit-modulefilter {
float: right;
position: relative;
margin-left: 1em;
}

.qunit-url-config label {
margin-right: 0.5em;
}

#qunit-modulefilter-search {
box-sizing: border-box;
width: 400px;
}

#qunit-modulefilter-search-container:after {
position: absolute;
right: 0.3em;
content: "\25bc";
color: black;
}

#qunit-modulefilter-dropdown {
/* align with #qunit-modulefilter-search */
box-sizing: border-box;
width: 400px;
position: absolute;
right: 0;
top: 50%;
margin-top: 0.8em;

border: 1px solid #D3D3D3;
border-top: none;
border-radius: 0 0 .25em .25em;
color: #000;
background-color: #F5F5F5;
z-index: 99;
}

#qunit-modulefilter-dropdown a {
color: inherit;
text-decoration: none;
}

#qunit-modulefilter-dropdown .clickable.checked {
font-weight: bold;
color: #000;
background-color: #D2E0E6;
}

#qunit-modulefilter-dropdown .clickable:hover {
color: #FFF;
background-color: #0D3349;
}

#qunit-modulefilter-actions {
display: block;
overflow: auto;

/* align with #qunit-modulefilter-dropdown-list */
font: smaller/1.5em sans-serif;
}

#qunit-modulefilter-dropdown #qunit-modulefilter-actions > * {
box-sizing: border-box;
max-height: 2.8em;
display: block;
padding: 0.4em;
}

#qunit-modulefilter-dropdown #qunit-modulefilter-actions > button {
float: right;
font: inherit;
}

#qunit-modulefilter-dropdown #qunit-modulefilter-actions > :last-child {
/* insert padding to align with checkbox margins */
padding-left: 3px;
}

#qunit-modulefilter-dropdown-list {
max-height: 200px;
overflow-y: auto;
margin: 0;
border-top: 2px groove threedhighlight;
padding: 0.4em 0 0;
font: smaller/1.5em sans-serif;
}

#qunit-modulefilter-dropdown-list li {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

#qunit-modulefilter-dropdown-list .clickable {
display: block;
padding-left: 0.15em;
}


/** Tests: Pass/Fail */

#qunit-tests {
@@ -88,24 +214,55 @@
}

#qunit-tests li {
padding: 0.4em 0.5em 0.4em 2.5em;
border-bottom: 1px solid #fff;
padding: 0.4em 1em 0.4em 1em;
border-bottom: 1px solid #FFF;
list-style-position: inside;
}

#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running {
#qunit-tests > li {
display: none;
}

#qunit-tests li.running,
#qunit-tests li.pass,
#qunit-tests li.fail,
#qunit-tests li.skipped {
display: list-item;
}

#qunit-tests.hidepass {
position: relative;
}

#qunit-tests.hidepass li.running,
#qunit-tests.hidepass li.pass {
visibility: hidden;
position: absolute;
width: 0;
height: 0;
padding: 0;
border: 0;
margin: 0;
}

#qunit-tests li strong {
cursor: pointer;
}

#qunit-tests li.skipped strong {
cursor: default;
}

#qunit-tests li a {
padding: 0.5em;
color: #c2ccd1;
color: #C2CCD1;
text-decoration: none;
}

#qunit-tests li p a {
padding: 0.25em;
color: #6B6464;
}
#qunit-tests li a:hover,
#qunit-tests li a:focus {
color: #000;
@@ -120,11 +277,13 @@
margin-top: 0.5em;
padding: 0.5em;

background-color: #fff;
background-color: #FFF;

border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}

.qunit-source {
margin: 0.6em 0 0.3em;
}

.qunit-collapsed {
@@ -133,13 +292,13 @@

#qunit-tests table {
border-collapse: collapse;
margin-top: .2em;
margin-top: 0.2em;
}

#qunit-tests th {
text-align: right;
vertical-align: top;
padding: 0 .5em 0 0;
padding: 0 0.5em 0 0;
}

#qunit-tests td {
@@ -153,26 +312,26 @@
}

#qunit-tests del {
background-color: #e0f2be;
color: #374e0c;
color: #374E0C;
background-color: #E0F2BE;
text-decoration: none;
}

#qunit-tests ins {
background-color: #ffcaca;
color: #500;
background-color: #FFCACA;
text-decoration: none;
}

/*** Test Counts */

#qunit-tests b.counts { color: black; }
#qunit-tests b.counts { color: #000; }
#qunit-tests b.passed { color: #5E740B; }
#qunit-tests b.failed { color: #710909; }

#qunit-tests li li {
padding: 5px;
background-color: #fff;
background-color: #FFF;
border-bottom: none;
list-style-position: inside;
}
@@ -180,8 +339,8 @@
/*** Passing Styles */

#qunit-tests li li.pass {
color: #3c510c;
background-color: #fff;
color: #3C510C;
background-color: #FFF;
border-left: 10px solid #C6E746;
}

@@ -189,7 +348,7 @@
#qunit-tests .pass .test-name { color: #366097; }

#qunit-tests .pass .test-actual,
#qunit-tests .pass .test-expected { color: #999999; }
#qunit-tests .pass .test-expected { color: #999; }

#qunit-banner.qunit-pass { background-color: #C6E746; }

@@ -197,40 +356,52 @@

#qunit-tests li li.fail {
color: #710909;
background-color: #fff;
background-color: #FFF;
border-left: 10px solid #EE5757;
white-space: pre;
}

#qunit-tests > li:last-child {
border-radius: 0 0 5px 5px;
-moz-border-radius: 0 0 5px 5px;
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
}

#qunit-tests .fail { color: #000000; background-color: #EE5757; }
#qunit-tests .fail { color: #000; background-color: #EE5757; }
#qunit-tests .fail .test-name,
#qunit-tests .fail .module-name { color: #000000; }
#qunit-tests .fail .module-name { color: #000; }

#qunit-tests .fail .test-actual { color: #EE5757; }
#qunit-tests .fail .test-expected { color: green; }
#qunit-tests .fail .test-expected { color: #008000; }

#qunit-banner.qunit-fail { background-color: #EE5757; }

/*** Skipped tests */

#qunit-tests .skipped {
background-color: #EBECE9;
}

#qunit-tests .qunit-skipped-label {
background-color: #F4FF77;
display: inline-block;
font-style: normal;
color: #366097;
line-height: 1.8em;
padding: 0 0.5em;
margin: -0.4em 0.4em -0.4em 0;
}

/** Result */

#qunit-testresult {
padding: 0.5em 0.5em 0.5em 2.5em;
padding: 0.5em 1em 0.5em 1em;

color: #2b81af;
color: #2B81AF;
background-color: #D2E0E6;

border-bottom: 1px solid white;
border-bottom: 1px solid #FFF;
}
#qunit-testresult .module-name {
font-weight: bold;
font-weight: 700;
}

/** Fixture */
@@ -241,4 +412,4 @@
left: -10000px;
width: 1000px;
height: 1000px;
}
}

+ 3920
- 1653
frappe/public/js/lib/jquery/qunit.js
文件差異過大導致無法顯示
查看文件


Loading…
取消
儲存