git-svn-id: https://msi/svn/firstRepo/Management/trunk@32 0f545695-f87b-41b6-9a03-7f16563b5454

This commit is contained in:
2015-02-25 20:10:52 +00:00
parent 00cd1a3a61
commit 4b9fa8baa4
90 changed files with 443 additions and 4495 deletions
+2 -113
View File
@@ -27,29 +27,7 @@
jQueryPlugins: 'libs/jQueryPlugins', jQueryPlugins: 'libs/jQueryPlugins',
backbone: 'libs/backbone-min', backbone: 'libs/backbone-min',
text: 'libs/text', text: 'libs/text',
jqxcore: 'empty:', jqx: 'empty:'
jqxbuttons: 'empty:',
jqxpanel: 'empty:',
jqxscrollbar: 'empty:',
jqxtree: 'empty:',
jqxwindow: 'empty:',
jqxmenu: 'empty:',
jqxcombobox: 'empty:',
jqxdata: 'empty:',
jqxrating: 'empty:',
jqxtabs: 'empty:',
jqxlistbox: 'empty:',
jqxdropdownlist: 'empty:',
jqxdropdownbutton: 'empty:',
jqxeditor: 'empty:',
jqxcolorpicker: 'empty:',
jqxgrid: 'empty:',
jqxgrid_selection: 'empty:',
jqxgrid_columnsresize: 'empty:',
jqxgrid_filter: 'empty:',
jqxinput: 'empty:',
jqxdragdrop: 'empty:',
jqxnumberinput: 'empty:'
}, },
shim: { shim: {
jqm: { jqm: {
@@ -58,98 +36,9 @@
jQueryPlugins: { jQueryPlugins: {
deps: [ 'jquery' ] deps: [ 'jquery' ]
}, },
"jqxcore": { "jqx": {
export: "$", export: "$",
deps: ['jquery'] deps: ['jquery']
},
"jqxbuttons": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxwindow": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxpanel": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxscrollbar": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxtree": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxrating": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxinput": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxtabs": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxnumberinput": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxdropdownbutton": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxcolorpicker": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxeditor": {
export: "$",
deps: ['jquery', "jqxcore", "jqxscrollbar", "jqxcombobox", "jqxwindow",
"jqxcolorpicker", "jqxdropdownbutton", "jqxdropdownlist", "jqxlistbox", "jqxbuttons"]
},
"jqxgrid": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxgrid_selection": {
export: "$",
deps: ['jquery', "jqxcore", "jqxgrid"]
},
"jqxgrid_columnsresize": {
export: "$",
deps: ['jquery', "jqxcore", "jqxgrid"]
},
"jqxgrid_filter": {
export: "$",
deps: ['jquery', "jqxcore", "jqxgrid"]
},
"jqxmenu": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxcombobox": {
export: "$",
deps: ['jquery', "jqxcore", "jqxlistbox"]
},
"jqxdata": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxdragdrop": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxlistbox": {
export: "$",
deps: ['jquery', "jqxcore", "jqxscrollbar", "jqxdragdrop"]
},
"jqxdropdownlist": {
export: "$",
deps: ['jquery', "jqxcore", "jqxlistbox"]
} }
}, },
optimize: "uglify2", optimize: "uglify2",
+1 -1
View File
@@ -15,7 +15,7 @@
<meta http-equiv="Access-Control-Allow-Origin" content="*"/> <meta http-equiv="Access-Control-Allow-Origin" content="*"/>
<script type='text/javascript' src="js/libs/ua-parser.min.<?php echo filemtime('js/libs/ua-parser.min.js'); ?>.js"></script> <script type='text/javascript' src="js/libs/ua-parser.min.<?php echo filemtime('js/libs/ua-parser.min.js'); ?>.js"></script>
<script type='text/javascript' src="js/manifest.<?php echo filemtime('js/manifest.js'); ?>.js"></script> <script type='text/javascript' src="js/manifest.<?php echo filemtime('js/manifest.js'); ?>.js"></script>
<script data-main="js/config" src="js/libs/require.<?php echo filemtime('js/libs/require.js'); ?>.js"></script> <script data-main="js/config.<?php echo filemtime('js/config.js'); ?>" src="js/libs/require.<?php echo filemtime('js/libs/require.js'); ?>.js"></script>
</head> </head>
<body style="background-color: #1d1d1d;"> <body style="background-color: #1d1d1d;">
<div id="loadingFrm" style="text-align: center;"> <div id="loadingFrm" style="text-align: center;">
+2 -113
View File
@@ -8,123 +8,12 @@ requirejs.config({
backbone: 'libs/backbone-min', backbone: 'libs/backbone-min',
text: 'libs/text', text: 'libs/text',
jquery: pathJquery, jquery: pathJquery,
jqxcore: "libs/jqwidgets/jqxcore", jqx: 'libs/jqwidgets/jqx-all'
jqxbuttons: "libs/jqwidgets/jqxbuttons",
jqxpanel: "libs/jqwidgets/jqxpanel",
jqxscrollbar: "libs/jqwidgets/jqxscrollbar",
jqxtree: "libs/jqwidgets/jqxtree",
jqxwindow: "libs/jqwidgets/jqxwindow",
jqxmenu: "libs/jqwidgets/jqxmenu",
jqxcombobox: "libs/jqwidgets/jqxcombobox",
jqxdata: "libs/jqwidgets/jqxdata",
jqxrating: "libs/jqwidgets/jqxrating",
jqxtabs: "libs/jqwidgets/jqxtabs",
jqxlistbox: "libs/jqwidgets/jqxlistbox",
jqxdropdownlist: "libs/jqwidgets/jqxdropdownlist",
jqxdropdownbutton: "libs/jqwidgets/jqxdropdownbutton",
jqxeditor: "libs/jqwidgets/jqxeditor",
jqxcolorpicker: "libs/jqwidgets/jqxcolorpicker",
jqxgrid: "libs/jqwidgets/jqxgrid",
jqxgrid_selection: "libs/jqwidgets/jqxgrid.selection",
jqxgrid_columnsresize: "libs/jqwidgets/jqxgrid.columnsresize",
jqxgrid_filter: "libs/jqwidgets/jqxgrid.filter",
jqxinput: "libs/jqwidgets/jqxinput",
jqxdragdrop: "libs/jqwidgets/jqxdragdrop",
jqxnumberinput: "libs/jqwidgets/jqxnumberinput"
}, },
shim: { shim: {
"jqxcore": { "jqx": {
export: "$", export: "$",
deps: ['jquery'] deps: ['jquery']
},
"jqxbuttons": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxwindow": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxpanel": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxscrollbar": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxtree": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxrating": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxinput": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxtabs": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxnumberinput": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxdropdownbutton": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxcolorpicker": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxeditor": {
export: "$",
deps: ['jquery', "jqxcore", "jqxscrollbar", "jqxcombobox", "jqxwindow",
"jqxcolorpicker", "jqxdropdownbutton", "jqxdropdownlist", "jqxlistbox", "jqxbuttons"]
},
"jqxgrid": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxgrid_selection": {
export: "$",
deps: ['jquery', "jqxcore", "jqxgrid"]
},
"jqxgrid_columnsresize": {
export: "$",
deps: ['jquery', "jqxcore", "jqxgrid"]
},
"jqxgrid_filter": {
export: "$",
deps: ['jquery', "jqxcore", "jqxgrid"]
},
"jqxmenu": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxcombobox": {
export: "$",
deps: ['jquery', "jqxcore", "jqxlistbox"]
},
"jqxdata": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxdragdrop": {
export: "$",
deps: ['jquery', "jqxcore"]
},
"jqxlistbox": {
export: "$",
deps: ['jquery', "jqxcore", "jqxscrollbar", "jqxdragdrop"]
},
"jqxdropdownlist": {
export: "$",
deps: ['jquery', "jqxcore", "jqxlistbox"]
} }
}, },
deps:[ "main" ] deps:[ "main" ]
+1 -1
View File
@@ -1,4 +1,4 @@
define(['jquery', 'underscore', 'backbone', 'text!controls/window/windowTemplate.html', 'jqxwindow'], define(['jquery', 'underscore', 'backbone', 'text!controls/window/windowTemplate.html', 'jqx'],
function($, _, Backbone, windowTemplate){ function($, _, Backbone, windowTemplate){
var window = Backbone.View.extend({ var window = Backbone.View.extend({
+205 -169
View File
@@ -1,130 +1,136 @@
(function () { ;(function () {
'use strict'; 'use strict';
/** /**
* @preserve FastClick: polyfill to remove click delays on browsers with touch UIs. * @preserve FastClick: polyfill to remove click delays on browsers with touch UIs.
* *
* @version 1.0.3
* @codingstandard ftlabs-jsv2 * @codingstandard ftlabs-jsv2
* @copyright The Financial Times Limited [All Rights Reserved] * @copyright The Financial Times Limited [All Rights Reserved]
* @license MIT License (see LICENSE.txt) * @license MIT License (see LICENSE.txt)
*/ */
/*jslint browser:true, node:true*/ /*jslint browser:true, node:true*/
/*global define, Event, Node*/ /*global define, Event, Node*/
/** /**
* Instantiate fast-clicking listeners on the specified layer. * Instantiate fast-clicking listeners on the specified layer.
* *
* @constructor * @constructor
* @param {Element} layer The layer to listen on * @param {Element} layer The layer to listen on
* @param {Object} options The options to override the defaults * @param {Object} [options={}] The options to override the defaults
*/ */
function FastClick(layer, options) { function FastClick(layer, options) {
var oldOnClick; var oldOnClick;
options = options || {}; options = options || {};
/** /**
* Whether a click is currently being tracked. * Whether a click is currently being tracked.
* *
* @type boolean * @type boolean
*/ */
this.trackingClick = false; this.trackingClick = false;
/** /**
* Timestamp for when click tracking started. * Timestamp for when click tracking started.
* *
* @type number * @type number
*/ */
this.trackingClickStart = 0; this.trackingClickStart = 0;
/** /**
* The element being tracked for a click. * The element being tracked for a click.
* *
* @type EventTarget * @type EventTarget
*/ */
this.targetElement = null; this.targetElement = null;
/** /**
* X-coordinate of touch start event. * X-coordinate of touch start event.
* *
* @type number * @type number
*/ */
this.touchStartX = 0; this.touchStartX = 0;
/** /**
* Y-coordinate of touch start event. * Y-coordinate of touch start event.
* *
* @type number * @type number
*/ */
this.touchStartY = 0; this.touchStartY = 0;
/** /**
* ID of the last touch, retrieved from Touch.identifier. * ID of the last touch, retrieved from Touch.identifier.
* *
* @type number * @type number
*/ */
this.lastTouchIdentifier = 0; this.lastTouchIdentifier = 0;
/** /**
* Touchmove boundary, beyond which a click will be cancelled. * Touchmove boundary, beyond which a click will be cancelled.
* *
* @type number * @type number
*/ */
this.touchBoundary = options.touchBoundary || 10; this.touchBoundary = options.touchBoundary || 10;
/** /**
* The FastClick layer. * The FastClick layer.
* *
* @type Element * @type Element
*/ */
this.layer = layer; this.layer = layer;
/** /**
* The minimum time between tap(touchstart and touchend) events * The minimum time between tap(touchstart and touchend) events
* *
* @type number * @type number
*/ */
this.tapDelay = options.tapDelay || 200; this.tapDelay = options.tapDelay || 200;
/**
* The maximum time for a tap
*
* @type number
*/
this.tapTimeout = options.tapTimeout || 700;
if (FastClick.notNeeded(layer)) { if (FastClick.notNeeded(layer)) {
return; return;
} }
// Some old versions of Android don't have Function.prototype.bind // Some old versions of Android don't have Function.prototype.bind
function bind(method, context) { function bind(method, context) {
return function() { return method.apply(context, arguments); }; return function() { return method.apply(context, arguments); };
} }
var methods = ['onMouse', 'onClick', 'onTouchStart', 'onTouchMove', 'onTouchEnd', 'onTouchCancel']; var methods = ['onMouse', 'onClick', 'onTouchStart', 'onTouchMove', 'onTouchEnd', 'onTouchCancel'];
var context = this; var context = this;
for (var i = 0, l = methods.length; i < l; i++) { for (var i = 0, l = methods.length; i < l; i++) {
context[methods[i]] = bind(context[methods[i]], context); context[methods[i]] = bind(context[methods[i]], context);
} }
// Set up event handlers as required // Set up event handlers as required
if (deviceIsAndroid) { if (deviceIsAndroid) {
layer.addEventListener('mouseover', this.onMouse, true); layer.addEventListener('mouseover', this.onMouse, true);
layer.addEventListener('mousedown', this.onMouse, true); layer.addEventListener('mousedown', this.onMouse, true);
layer.addEventListener('mouseup', this.onMouse, true); layer.addEventListener('mouseup', this.onMouse, true);
} }
layer.addEventListener('click', this.onClick, true); layer.addEventListener('click', this.onClick, true);
layer.addEventListener('touchstart', this.onTouchStart, false); layer.addEventListener('touchstart', this.onTouchStart, false);
layer.addEventListener('touchmove', this.onTouchMove, false); layer.addEventListener('touchmove', this.onTouchMove, false);
layer.addEventListener('touchend', this.onTouchEnd, false); layer.addEventListener('touchend', this.onTouchEnd, false);
layer.addEventListener('touchcancel', this.onTouchCancel, false); layer.addEventListener('touchcancel', this.onTouchCancel, false);
// Hack is required for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2) // Hack is required for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
// which is how FastClick normally stops click events bubbling to callbacks registered on the FastClick // which is how FastClick normally stops click events bubbling to callbacks registered on the FastClick
// layer when they are cancelled. // layer when they are cancelled.
@@ -137,7 +143,7 @@
rmv.call(layer, type, callback, capture); rmv.call(layer, type, callback, capture);
} }
}; };
layer.addEventListener = function(type, callback, capture) { layer.addEventListener = function(type, callback, capture) {
var adv = Node.prototype.addEventListener; var adv = Node.prototype.addEventListener;
if (type === 'click') { if (type === 'click') {
@@ -151,12 +157,12 @@
} }
}; };
} }
// If a handler is already declared in the element's onclick attribute, it will be fired before // If a handler is already declared in the element's onclick attribute, it will be fired before
// FastClick's onClick handler. Fix this by pulling out the user-defined handler function and // FastClick's onClick handler. Fix this by pulling out the user-defined handler function and
// adding it as listener. // adding it as listener.
if (typeof layer.onclick === 'function') { if (typeof layer.onclick === 'function') {
// Android browser on at least 3.2 requires a new reference to the function in layer.onclick // Android browser on at least 3.2 requires a new reference to the function in layer.onclick
// - the old one won't work if passed to addEventListener directly. // - the old one won't work if passed to addEventListener directly.
oldOnClick = layer.onclick; oldOnClick = layer.onclick;
@@ -166,46 +172,52 @@
layer.onclick = null; layer.onclick = null;
} }
} }
/**
* Windows Phone 8.1 fakes user agent string to look like Android and iPhone.
*
* @type boolean
*/
var deviceIsWindowsPhone = navigator.userAgent.indexOf("Windows Phone") >= 0;
/** /**
* Android requires exceptions. * Android requires exceptions.
* *
* @type boolean * @type boolean
*/ */
var deviceIsAndroid = navigator.userAgent.indexOf('Android') > 0; var deviceIsAndroid = navigator.userAgent.indexOf('Android') > 0 && !deviceIsWindowsPhone;
/** /**
* iOS requires exceptions. * iOS requires exceptions.
* *
* @type boolean * @type boolean
*/ */
var deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent); var deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent) && !deviceIsWindowsPhone;
/** /**
* iOS 4 requires an exception for select elements. * iOS 4 requires an exception for select elements.
* *
* @type boolean * @type boolean
*/ */
var deviceIsIOS4 = deviceIsIOS && (/OS 4_\d(_\d)?/).test(navigator.userAgent); var deviceIsIOS4 = deviceIsIOS && (/OS 4_\d(_\d)?/).test(navigator.userAgent);
/** /**
* iOS 6.0(+?) requires the target element to be manually derived * iOS 6.0-7.* requires the target element to be manually derived
* *
* @type boolean * @type boolean
*/ */
var deviceIsIOSWithBadTarget = deviceIsIOS && (/OS ([6-9]|\d{2})_\d/).test(navigator.userAgent); var deviceIsIOSWithBadTarget = deviceIsIOS && (/OS [6-7]_\d/).test(navigator.userAgent);
/** /**
* BlackBerry requires exceptions. * BlackBerry requires exceptions.
* *
* @type boolean * @type boolean
*/ */
var deviceIsBlackBerry10 = navigator.userAgent.indexOf('BB10') > 0; var deviceIsBlackBerry10 = navigator.userAgent.indexOf('BB10') > 0;
/** /**
* Determine whether a given element requires a native click. * Determine whether a given element requires a native click.
* *
@@ -214,7 +226,7 @@
*/ */
FastClick.prototype.needsClick = function(target) { FastClick.prototype.needsClick = function(target) {
switch (target.nodeName.toLowerCase()) { switch (target.nodeName.toLowerCase()) {
// Don't send a synthetic click to disabled inputs (issue #62) // Don't send a synthetic click to disabled inputs (issue #62)
case 'button': case 'button':
case 'select': case 'select':
@@ -222,25 +234,26 @@
if (target.disabled) { if (target.disabled) {
return true; return true;
} }
break; break;
case 'input': case 'input':
// File inputs need real clicks on iOS 6 due to a browser bug (issue #68) // File inputs need real clicks on iOS 6 due to a browser bug (issue #68)
if ((deviceIsIOS && target.type === 'file') || target.disabled) { if ((deviceIsIOS && target.type === 'file') || target.disabled) {
return true; return true;
} }
break; break;
case 'label': case 'label':
case 'iframe': // iOS8 homescreen apps can prevent events bubbling into frames
case 'video': case 'video':
return true; return true;
} }
return (/\bneedsclick\b/).test(target.className); return (/\bneedsclick\b/).test(target.className);
}; };
/** /**
* Determine whether a given element requires a call to focus to simulate click into element. * Determine whether a given element requires a call to focus to simulate click into element.
* *
@@ -263,15 +276,15 @@
case 'submit': case 'submit':
return false; return false;
} }
// No point in attempting to focus disabled inputs // No point in attempting to focus disabled inputs
return !target.disabled && !target.readOnly; return !target.disabled && !target.readOnly;
default: default:
return (/\bneedsfocus\b/).test(target.className); return (/\bneedsfocus\b/).test(target.className);
} }
}; };
/** /**
* Send a click event to the specified element. * Send a click event to the specified element.
* *
@@ -280,38 +293,38 @@
*/ */
FastClick.prototype.sendClick = function(targetElement, event) { FastClick.prototype.sendClick = function(targetElement, event) {
var clickEvent, touch; var clickEvent, touch;
// On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect (#24) // On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect (#24)
if (document.activeElement && document.activeElement !== targetElement) { if (document.activeElement && document.activeElement !== targetElement) {
document.activeElement.blur(); document.activeElement.blur();
} }
touch = event.changedTouches[0]; touch = event.changedTouches[0];
// Synthesise a click event, with an extra attribute so it can be tracked // Synthesise a click event, with an extra attribute so it can be tracked
clickEvent = document.createEvent('MouseEvents'); clickEvent = document.createEvent('MouseEvents');
clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null); clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null);
clickEvent.forwardedTouchEvent = true; clickEvent.forwardedTouchEvent = true;
targetElement.dispatchEvent(clickEvent); targetElement.dispatchEvent(clickEvent);
}; };
FastClick.prototype.determineEventType = function(targetElement) { FastClick.prototype.determineEventType = function(targetElement) {
//Issue #159: Android Chrome Select Box does not open with a synthetic click event //Issue #159: Android Chrome Select Box does not open with a synthetic click event
if (deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') { if (deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') {
return 'mousedown'; return 'mousedown';
} }
return 'click'; return 'click';
}; };
/** /**
* @param {EventTarget|Element} targetElement * @param {EventTarget|Element} targetElement
*/ */
FastClick.prototype.focus = function(targetElement) { FastClick.prototype.focus = function(targetElement) {
var length; var length;
// Issue #160: on iOS 7, some input elements (e.g. date datetime month) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724. // Issue #160: on iOS 7, some input elements (e.g. date datetime month) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724.
if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month') { if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month') {
length = targetElement.value.length; length = targetElement.value.length;
@@ -320,8 +333,8 @@
targetElement.focus(); targetElement.focus();
} }
}; };
/** /**
* Check whether the given target element is a child of a scrollable layer and if so, set a flag on it. * Check whether the given target element is a child of a scrollable layer and if so, set a flag on it.
* *
@@ -329,9 +342,9 @@
*/ */
FastClick.prototype.updateScrollParent = function(targetElement) { FastClick.prototype.updateScrollParent = function(targetElement) {
var scrollParent, parentElement; var scrollParent, parentElement;
scrollParent = targetElement.fastClickScrollParent; scrollParent = targetElement.fastClickScrollParent;
// Attempt to discover whether the target element is contained within a scrollable layer. Re-check if the // Attempt to discover whether the target element is contained within a scrollable layer. Re-check if the
// target element was moved to another parent. // target element was moved to another parent.
if (!scrollParent || !scrollParent.contains(targetElement)) { if (!scrollParent || !scrollParent.contains(targetElement)) {
@@ -342,33 +355,33 @@
targetElement.fastClickScrollParent = parentElement; targetElement.fastClickScrollParent = parentElement;
break; break;
} }
parentElement = parentElement.parentElement; parentElement = parentElement.parentElement;
} while (parentElement); } while (parentElement);
} }
// Always update the scroll top tracker if possible. // Always update the scroll top tracker if possible.
if (scrollParent) { if (scrollParent) {
scrollParent.fastClickLastScrollTop = scrollParent.scrollTop; scrollParent.fastClickLastScrollTop = scrollParent.scrollTop;
} }
}; };
/** /**
* @param {EventTarget} targetElement * @param {EventTarget} targetElement
* @returns {Element|EventTarget} * @returns {Element|EventTarget}
*/ */
FastClick.prototype.getTargetElementFromEventTarget = function(eventTarget) { FastClick.prototype.getTargetElementFromEventTarget = function(eventTarget) {
// On some older browsers (notably Safari on iOS 4.1 - see issue #56) the event target may be a text node. // On some older browsers (notably Safari on iOS 4.1 - see issue #56) the event target may be a text node.
if (eventTarget.nodeType === Node.TEXT_NODE) { if (eventTarget.nodeType === Node.TEXT_NODE) {
return eventTarget.parentNode; return eventTarget.parentNode;
} }
return eventTarget; return eventTarget;
}; };
/** /**
* On touch start, record the position and scroll offset. * On touch start, record the position and scroll offset.
* *
@@ -377,25 +390,25 @@
*/ */
FastClick.prototype.onTouchStart = function(event) { FastClick.prototype.onTouchStart = function(event) {
var targetElement, touch, selection; var targetElement, touch, selection;
// Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111). // Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111).
if (event.targetTouches.length > 1) { if (event.targetTouches.length > 1) {
return true; return true;
} }
targetElement = this.getTargetElementFromEventTarget(event.target); targetElement = this.getTargetElementFromEventTarget(event.target);
touch = event.targetTouches[0]; touch = event.targetTouches[0];
if (deviceIsIOS) { if (deviceIsIOS) {
// Only trusted events will deselect text on iOS (issue #49) // Only trusted events will deselect text on iOS (issue #49)
selection = window.getSelection(); selection = window.getSelection();
if (selection.rangeCount && !selection.isCollapsed) { if (selection.rangeCount && !selection.isCollapsed) {
return true; return true;
} }
if (!deviceIsIOS4) { if (!deviceIsIOS4) {
// Weird things happen on iOS when an alert or confirm dialog is opened from a click event callback (issue #23): // Weird things happen on iOS when an alert or confirm dialog is opened from a click event callback (issue #23):
// when the user next taps anywhere else on the page, new touchstart and touchend events are dispatched // when the user next taps anywhere else on the page, new touchstart and touchend events are dispatched
// with the same identifier as the touch event that previously triggered the click that triggered the alert. // with the same identifier as the touch event that previously triggered the click that triggered the alert.
@@ -408,9 +421,9 @@
event.preventDefault(); event.preventDefault();
return false; return false;
} }
this.lastTouchIdentifier = touch.identifier; this.lastTouchIdentifier = touch.identifier;
// If the target element is a child of a scrollable layer (using -webkit-overflow-scrolling: touch) and: // If the target element is a child of a scrollable layer (using -webkit-overflow-scrolling: touch) and:
// 1) the user does a fling scroll on the scrollable layer // 1) the user does a fling scroll on the scrollable layer
// 2) the user stops the fling scroll with another tap // 2) the user stops the fling scroll with another tap
@@ -420,23 +433,23 @@
this.updateScrollParent(targetElement); this.updateScrollParent(targetElement);
} }
} }
this.trackingClick = true; this.trackingClick = true;
this.trackingClickStart = event.timeStamp; this.trackingClickStart = event.timeStamp;
this.targetElement = targetElement; this.targetElement = targetElement;
this.touchStartX = touch.pageX; this.touchStartX = touch.pageX;
this.touchStartY = touch.pageY; this.touchStartY = touch.pageY;
// Prevent phantom clicks on fast double-tap (issue #36) // Prevent phantom clicks on fast double-tap (issue #36)
if ((event.timeStamp - this.lastClickTime) < this.tapDelay) { if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
event.preventDefault(); event.preventDefault();
} }
return true; return true;
}; };
/** /**
* Based on a touchmove event object, check whether the touch has moved past a boundary since it started. * Based on a touchmove event object, check whether the touch has moved past a boundary since it started.
* *
@@ -445,15 +458,15 @@
*/ */
FastClick.prototype.touchHasMoved = function(event) { FastClick.prototype.touchHasMoved = function(event) {
var touch = event.changedTouches[0], boundary = this.touchBoundary; var touch = event.changedTouches[0], boundary = this.touchBoundary;
if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) { if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) {
return true; return true;
} }
return false; return false;
}; };
/** /**
* Update the last position. * Update the last position.
* *
@@ -464,17 +477,17 @@
if (!this.trackingClick) { if (!this.trackingClick) {
return true; return true;
} }
// If the touch has moved, cancel the click tracking // If the touch has moved, cancel the click tracking
if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) { if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) {
this.trackingClick = false; this.trackingClick = false;
this.targetElement = null; this.targetElement = null;
} }
return true; return true;
}; };
/** /**
* Attempt to find the labelled control for the given label element. * Attempt to find the labelled control for the given label element.
* *
@@ -482,23 +495,23 @@
* @returns {Element|null} * @returns {Element|null}
*/ */
FastClick.prototype.findControl = function(labelElement) { FastClick.prototype.findControl = function(labelElement) {
// Fast path for newer browsers supporting the HTML5 control attribute // Fast path for newer browsers supporting the HTML5 control attribute
if (labelElement.control !== undefined) { if (labelElement.control !== undefined) {
return labelElement.control; return labelElement.control;
} }
// All browsers under test that support touch events also support the HTML5 htmlFor attribute // All browsers under test that support touch events also support the HTML5 htmlFor attribute
if (labelElement.htmlFor) { if (labelElement.htmlFor) {
return document.getElementById(labelElement.htmlFor); return document.getElementById(labelElement.htmlFor);
} }
// If no for attribute exists, attempt to retrieve the first labellable descendant element // If no for attribute exists, attempt to retrieve the first labellable descendant element
// the list of which is defined here: http://www.w3.org/TR/html5/forms.html#category-label // the list of which is defined here: http://www.w3.org/TR/html5/forms.html#category-label
return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea'); return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea');
}; };
/** /**
* On touch end, determine whether to send a click event at once. * On touch end, determine whether to send a click event at once.
* *
@@ -507,38 +520,42 @@
*/ */
FastClick.prototype.onTouchEnd = function(event) { FastClick.prototype.onTouchEnd = function(event) {
var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement; var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
if (!this.trackingClick) { if (!this.trackingClick) {
return true; return true;
} }
// Prevent phantom clicks on fast double-tap (issue #36) // Prevent phantom clicks on fast double-tap (issue #36)
if ((event.timeStamp - this.lastClickTime) < this.tapDelay) { if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
this.cancelNextClick = true; this.cancelNextClick = true;
return true; return true;
} }
if ((event.timeStamp - this.trackingClickStart) > this.tapTimeout) {
return true;
}
// Reset to prevent wrong click cancel on input (issue #156). // Reset to prevent wrong click cancel on input (issue #156).
this.cancelNextClick = false; this.cancelNextClick = false;
this.lastClickTime = event.timeStamp; this.lastClickTime = event.timeStamp;
trackingClickStart = this.trackingClickStart; trackingClickStart = this.trackingClickStart;
this.trackingClick = false; this.trackingClick = false;
this.trackingClickStart = 0; this.trackingClickStart = 0;
// On some iOS devices, the targetElement supplied with the event is invalid if the layer // On some iOS devices, the targetElement supplied with the event is invalid if the layer
// is performing a transition or scroll, and has to be re-detected manually. Note that // is performing a transition or scroll, and has to be re-detected manually. Note that
// for this to function correctly, it must be called *after* the event target is checked! // for this to function correctly, it must be called *after* the event target is checked!
// See issue #57; also filed as rdar://13048589 . // See issue #57; also filed as rdar://13048589 .
if (deviceIsIOSWithBadTarget) { if (deviceIsIOSWithBadTarget) {
touch = event.changedTouches[0]; touch = event.changedTouches[0];
// In certain cases arguments of elementFromPoint can be negative, so prevent setting targetElement to null // In certain cases arguments of elementFromPoint can be negative, so prevent setting targetElement to null
targetElement = document.elementFromPoint(touch.pageX - window.pageXOffset, touch.pageY - window.pageYOffset) || targetElement; targetElement = document.elementFromPoint(touch.pageX - window.pageXOffset, touch.pageY - window.pageYOffset) || targetElement;
targetElement.fastClickScrollParent = this.targetElement.fastClickScrollParent; targetElement.fastClickScrollParent = this.targetElement.fastClickScrollParent;
} }
targetTagName = targetElement.tagName.toLowerCase(); targetTagName = targetElement.tagName.toLowerCase();
if (targetTagName === 'label') { if (targetTagName === 'label') {
forElement = this.findControl(targetElement); forElement = this.findControl(targetElement);
@@ -547,33 +564,33 @@
if (deviceIsAndroid) { if (deviceIsAndroid) {
return false; return false;
} }
targetElement = forElement; targetElement = forElement;
} }
} else if (this.needsFocus(targetElement)) { } else if (this.needsFocus(targetElement)) {
// Case 1: If the touch started a while ago (best guess is 100ms based on tests for issue #36) then focus will be triggered anyway. Return early and unset the target element reference so that the subsequent click will be allowed through. // Case 1: If the touch started a while ago (best guess is 100ms based on tests for issue #36) then focus will be triggered anyway. Return early and unset the target element reference so that the subsequent click will be allowed through.
// Case 2: Without this exception for input elements tapped when the document is contained in an iframe, then any inputted text won't be visible even though the value attribute is updated as the user types (issue #37). // Case 2: Without this exception for input elements tapped when the document is contained in an iframe, then any inputted text won't be visible even though the value attribute is updated as the user types (issue #37).
if ((event.timeStamp - trackingClickStart) > 100 || (deviceIsIOS && window.top !== window && targetTagName === 'input')) { if ((event.timeStamp - trackingClickStart) > 100 || (deviceIsIOS && window.top !== window && targetTagName === 'input')) {
this.targetElement = null; this.targetElement = null;
return false; return false;
} }
this.focus(targetElement); this.focus(targetElement);
this.sendClick(targetElement, event); this.sendClick(targetElement, event);
// Select elements need the event to go through on iOS 4, otherwise the selector menu won't open. // Select elements need the event to go through on iOS 4, otherwise the selector menu won't open.
// Also this breaks opening selects when VoiceOver is active on iOS6, iOS7 (and possibly others) // Also this breaks opening selects when VoiceOver is active on iOS6, iOS7 (and possibly others)
if (!deviceIsIOS || targetTagName !== 'select') { if (!deviceIsIOS || targetTagName !== 'select') {
this.targetElement = null; this.targetElement = null;
event.preventDefault(); event.preventDefault();
} }
return false; return false;
} }
if (deviceIsIOS && !deviceIsIOS4) { if (deviceIsIOS && !deviceIsIOS4) {
// Don't send a synthetic click event if the target element is contained within a parent layer that was scrolled // Don't send a synthetic click event if the target element is contained within a parent layer that was scrolled
// and this tap is being used to stop the scrolling (usually initiated by a fling - issue #42). // and this tap is being used to stop the scrolling (usually initiated by a fling - issue #42).
scrollParent = targetElement.fastClickScrollParent; scrollParent = targetElement.fastClickScrollParent;
@@ -581,18 +598,18 @@
return true; return true;
} }
} }
// Prevent the actual click from going though - unless the target node is marked as requiring // Prevent the actual click from going though - unless the target node is marked as requiring
// real clicks or if it is in the whitelist in which case only non-programmatic clicks are permitted. // real clicks or if it is in the whitelist in which case only non-programmatic clicks are permitted.
if (!this.needsClick(targetElement)) { if (!this.needsClick(targetElement)) {
event.preventDefault(); event.preventDefault();
this.sendClick(targetElement, event); this.sendClick(targetElement, event);
} }
return false; return false;
}; };
/** /**
* On touch cancel, stop tracking the click. * On touch cancel, stop tracking the click.
* *
@@ -602,8 +619,8 @@
this.trackingClick = false; this.trackingClick = false;
this.targetElement = null; this.targetElement = null;
}; };
/** /**
* Determine mouse events which should be permitted. * Determine mouse events which should be permitted.
* *
@@ -611,47 +628,47 @@
* @returns {boolean} * @returns {boolean}
*/ */
FastClick.prototype.onMouse = function(event) { FastClick.prototype.onMouse = function(event) {
// If a target element was never set (because a touch event was never fired) allow the event // If a target element was never set (because a touch event was never fired) allow the event
if (!this.targetElement) { if (!this.targetElement) {
return true; return true;
} }
if (event.forwardedTouchEvent) { if (event.forwardedTouchEvent) {
return true; return true;
} }
// Programmatically generated events targeting a specific element should be permitted // Programmatically generated events targeting a specific element should be permitted
if (!event.cancelable) { if (!event.cancelable) {
return true; return true;
} }
// Derive and check the target element to see whether the mouse event needs to be permitted; // Derive and check the target element to see whether the mouse event needs to be permitted;
// unless explicitly enabled, prevent non-touch click events from triggering actions, // unless explicitly enabled, prevent non-touch click events from triggering actions,
// to prevent ghost/doubleclicks. // to prevent ghost/doubleclicks.
if (!this.needsClick(this.targetElement) || this.cancelNextClick) { if (!this.needsClick(this.targetElement) || this.cancelNextClick) {
// Prevent any user-added listeners declared on FastClick element from being fired. // Prevent any user-added listeners declared on FastClick element from being fired.
if (event.stopImmediatePropagation) { if (event.stopImmediatePropagation) {
event.stopImmediatePropagation(); event.stopImmediatePropagation();
} else { } else {
// Part of the hack for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2) // Part of the hack for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
event.propagationStopped = true; event.propagationStopped = true;
} }
// Cancel the event // Cancel the event
event.stopPropagation(); event.stopPropagation();
event.preventDefault(); event.preventDefault();
return false; return false;
} }
// If the mouse event is permitted, return true for the action to go through. // If the mouse event is permitted, return true for the action to go through.
return true; return true;
}; };
/** /**
* On actual clicks, determine whether this is a touch-generated click, a click action occurring * On actual clicks, determine whether this is a touch-generated click, a click action occurring
* naturally after a delay after a touch (which needs to be cancelled to avoid duplication), or * naturally after a delay after a touch (which needs to be cancelled to avoid duplication), or
@@ -662,31 +679,31 @@
*/ */
FastClick.prototype.onClick = function(event) { FastClick.prototype.onClick = function(event) {
var permitted; var permitted;
// It's possible for another FastClick-like library delivered with third-party code to fire a click event before FastClick does (issue #44). In that case, set the click-tracking flag back to false and return early. This will cause onTouchEnd to return early. // It's possible for another FastClick-like library delivered with third-party code to fire a click event before FastClick does (issue #44). In that case, set the click-tracking flag back to false and return early. This will cause onTouchEnd to return early.
if (this.trackingClick) { if (this.trackingClick) {
this.targetElement = null; this.targetElement = null;
this.trackingClick = false; this.trackingClick = false;
return true; return true;
} }
// Very odd behaviour on iOS (issue #18): if a submit element is present inside a form and the user hits enter in the iOS simulator or clicks the Go button on the pop-up OS keyboard the a kind of 'fake' click event will be triggered with the submit-type input element as the target. // Very odd behaviour on iOS (issue #18): if a submit element is present inside a form and the user hits enter in the iOS simulator or clicks the Go button on the pop-up OS keyboard the a kind of 'fake' click event will be triggered with the submit-type input element as the target.
if (event.target.type === 'submit' && event.detail === 0) { if (event.target.type === 'submit' && event.detail === 0) {
return true; return true;
} }
permitted = this.onMouse(event); permitted = this.onMouse(event);
// Only unset targetElement if the click is not permitted. This will ensure that the check for !targetElement in onMouse fails and the browser's click doesn't go through. // Only unset targetElement if the click is not permitted. This will ensure that the check for !targetElement in onMouse fails and the browser's click doesn't go through.
if (!permitted) { if (!permitted) {
this.targetElement = null; this.targetElement = null;
} }
// If clicks are permitted, return true for the action to go through. // If clicks are permitted, return true for the action to go through.
return permitted; return permitted;
}; };
/** /**
* Remove all FastClick's event listeners. * Remove all FastClick's event listeners.
* *
@@ -694,21 +711,21 @@
*/ */
FastClick.prototype.destroy = function() { FastClick.prototype.destroy = function() {
var layer = this.layer; var layer = this.layer;
if (deviceIsAndroid) { if (deviceIsAndroid) {
layer.removeEventListener('mouseover', this.onMouse, true); layer.removeEventListener('mouseover', this.onMouse, true);
layer.removeEventListener('mousedown', this.onMouse, true); layer.removeEventListener('mousedown', this.onMouse, true);
layer.removeEventListener('mouseup', this.onMouse, true); layer.removeEventListener('mouseup', this.onMouse, true);
} }
layer.removeEventListener('click', this.onClick, true); layer.removeEventListener('click', this.onClick, true);
layer.removeEventListener('touchstart', this.onTouchStart, false); layer.removeEventListener('touchstart', this.onTouchStart, false);
layer.removeEventListener('touchmove', this.onTouchMove, false); layer.removeEventListener('touchmove', this.onTouchMove, false);
layer.removeEventListener('touchend', this.onTouchEnd, false); layer.removeEventListener('touchend', this.onTouchEnd, false);
layer.removeEventListener('touchcancel', this.onTouchCancel, false); layer.removeEventListener('touchcancel', this.onTouchCancel, false);
}; };
/** /**
* Check whether FastClick is needed. * Check whether FastClick is needed.
* *
@@ -718,20 +735,21 @@
var metaViewport; var metaViewport;
var chromeVersion; var chromeVersion;
var blackberryVersion; var blackberryVersion;
var firefoxVersion;
// Devices that don't support touch don't need FastClick // Devices that don't support touch don't need FastClick
if (typeof window.ontouchstart === 'undefined') { if (typeof window.ontouchstart === 'undefined') {
return true; return true;
} }
// Chrome version - zero for other browsers // Chrome version - zero for other browsers
chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1]; chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];
if (chromeVersion) { if (chromeVersion) {
if (deviceIsAndroid) { if (deviceIsAndroid) {
metaViewport = document.querySelector('meta[name=viewport]'); metaViewport = document.querySelector('meta[name=viewport]');
if (metaViewport) { if (metaViewport) {
// Chrome on Android with user-scalable="no" doesn't need FastClick (issue #89) // Chrome on Android with user-scalable="no" doesn't need FastClick (issue #89)
if (metaViewport.content.indexOf('user-scalable=no') !== -1) { if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
@@ -742,21 +760,21 @@
return true; return true;
} }
} }
// Chrome desktop doesn't need FastClick (issue #15) // Chrome desktop doesn't need FastClick (issue #15)
} else { } else {
return true; return true;
} }
} }
if (deviceIsBlackBerry10) { if (deviceIsBlackBerry10) {
blackberryVersion = navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/); blackberryVersion = navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/);
// BlackBerry 10.3+ does not require Fastclick library. // BlackBerry 10.3+ does not require Fastclick library.
// https://github.com/ftlabs/fastclick/issues/251 // https://github.com/ftlabs/fastclick/issues/251
if (blackberryVersion[1] >= 10 && blackberryVersion[2] >= 3) { if (blackberryVersion[1] >= 10 && blackberryVersion[2] >= 3) {
metaViewport = document.querySelector('meta[name=viewport]'); metaViewport = document.querySelector('meta[name=viewport]');
if (metaViewport) { if (metaViewport) {
// user-scalable=no eliminates click delay. // user-scalable=no eliminates click delay.
if (metaViewport.content.indexOf('user-scalable=no') !== -1) { if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
@@ -769,29 +787,47 @@
} }
} }
} }
// IE10 with -ms-touch-action: none, which disables double-tap-to-zoom (issue #97) // IE10 with -ms-touch-action: none or manipulation, which disables double-tap-to-zoom (issue #97)
if (layer.style.msTouchAction === 'none') { if (layer.style.msTouchAction === 'none' || layer.style.touchAction === 'manipulation') {
return true; return true;
} }
// Firefox version - zero for other browsers
firefoxVersion = +(/Firefox\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];
if (firefoxVersion >= 27) {
// Firefox 27+ does not have tap delay if the content is not zoomable - https://bugzilla.mozilla.org/show_bug.cgi?id=922896
metaViewport = document.querySelector('meta[name=viewport]');
if (metaViewport && (metaViewport.content.indexOf('user-scalable=no') !== -1 || document.documentElement.scrollWidth <= window.outerWidth)) {
return true;
}
}
// IE11: prefixed -ms-touch-action is no longer supported and it's recomended to use non-prefixed version
// http://msdn.microsoft.com/en-us/library/windows/apps/Hh767313.aspx
if (layer.style.touchAction === 'none' || layer.style.touchAction === 'manipulation') {
return true;
}
return false; return false;
}; };
/** /**
* Factory method for creating a FastClick object * Factory method for creating a FastClick object
* *
* @param {Element} layer The layer to listen on * @param {Element} layer The layer to listen on
* @param {Object} options The options to override the defaults * @param {Object} [options={}] The options to override the defaults
*/ */
FastClick.attach = function(layer, options) { FastClick.attach = function(layer, options) {
return new FastClick(layer, options); return new FastClick(layer, options);
}; };
if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define(function() { define(function() {
return FastClick; return FastClick;
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,7 +0,0 @@
/*
jQWidgets v3.7.0 (2015-Feb)
Copyright (c) 2011-2015 jQWidgets.
License: http://jqwidgets.com/license/
*/
(function(a){a.extend(a.jqx._jqxChart.prototype,{_moduleAnnotations:true,_renderAnnotation:function(f,g,c){var j=this.seriesGroups[f];var q=this.renderer;if(isNaN(f)){return}var l=this._get([this.getXAxisDataPointOffset(g.xValue,f),g.x]);var k=this._get([this.getValueAxisDataPointOffset(g.yValue,f),g.y]);var v=this._get([this.getXAxisDataPointOffset(g.xValue2,f),g.x2]);var e=this._get([this.getValueAxisDataPointOffset(g.yValue2,f),g.y2]);if(j.polar||j.spider){var r=this.getPolarDataPointOffset(g.xValue,g.yValue,f);if(r&&!isNaN(r.x)&&!isNaN(r.y)){l=r.x;k=r.y}else{l=g.x;k=g.y}}if(isNaN(k)||isNaN(l)){return false}if(j.orientation=="horizontal"){var w=l;l=k;k=w;w=v;v=e;e=w}if(g.offset){if(!isNaN(g.offset.x)){l+=g.offset.x;v+=g.offset.x}if(!isNaN(g.offset.y)){k+=g.offset.y;e+=g.offset.y}}var p=this._get([g.width,v-l]);var o=this._get([g.height,e-k]);var d;switch(g.type){case"rect":d=q.rect(l,k,p,o);break;case"circle":d=q.rect(l,k,g.radius);break;case"line":d=q.rect(l,k,v,e);break;case"path":d=q.path(g.path);break}q.attr(d,{fill:g.fillColor,stroke:g.lineColor,opacity:this._get([g.fillOpacity,g.opacity]),"stroke-opacity":this._get([g.lineOpacity,g.opacity]),"stroke-width":g.lineWidth,"stroke-dasharray":g.dashStyle||"none"});var u;if(g.text){var m=g.text;var z=0,h=0;if(m.offset){if(!isNaN(m.offset.x)){z+=m.offset.x}if(!isNaN(m.offset.y)){h+=m.offset.y}}u=q.text(m.value,l+z,k+h,NaN,NaN,m.angle,{},m.clip===true,m.horizontalAlignment||"center",m.verticalAlignment||"center",m.rotationPoint||"centermiddle");q.attr(u,{fill:m.fillColor,stroke:m.lineColor,"class":m["class"]})}var b=["click","mouseenter","mouseleave"];var n=this;for(var t=0;t<b.length;t++){var s=this._getEvent(b[t])||b[t];if(d){this.renderer.addHandler(d,s,function(){n._raiseAnnotationEvent(g,s)})}if(u){this.renderer.addHandler(u,s,function(){n._raiseAnnotationEvent(g,s)})}}},_raiseAnnotationEvent:function(b,c){this._raiseEvent("annotation_"+c,{annotation:b})}})})(jqxBaseFramework);
-7
View File
@@ -1,7 +0,0 @@
/*
jQWidgets v3.7.0 (2015-Feb)
Copyright (c) 2011-2015 jQWidgets.
License: http://jqwidgets.com/license/
*/
(function(a){a.extend(a.jqx._jqxChart.prototype,{_moduleApi:true,getItemsCount:function(f,b){var d=this.seriesGroups[f];if(!this._isSerieVisible(f,b)){return 0}var e=this._renderData;if(!d||!e||e.length<=f){return 0}var c=d.series[b];if(!c){return 0}return e[f].offsets[b].length},getXAxisRect:function(c){var b=this._renderData;if(!b||b.length<=c){return undefined}if(!b[c].xAxis){return undefined}return b[c].xAxis.rect},getXAxisLabels:function(k){var d=[];var l=this._renderData;if(!l||l.length<=k){return d}l=l[k].xAxis;if(!l){return d}var j=this.seriesGroups[k];if(j.polar||j.spider){for(var e=0;e<l.polarLabels.length;e++){var h=l.polarLabels[e];d.push({offset:{x:h.x,y:h.y},value:h.value})}return d}var c=this._getXAxis(k);var g=this.getXAxisRect(k);var b=c.position=="top"||c.position=="right";var f=j.orientation=="horizontal";for(var e=0;e<l.data.length;e++){if(f){d.push({offset:{x:g.x+(b?0:g.width),y:g.y+l.data.data[e]},value:l.data.xvalues[e]})}else{d.push({offset:{x:g.x+l.data.data[e],y:g.y+(b?g.height:0)},value:l.data.xvalues[e]})}}return d},getValueAxisRect:function(c){var b=this._renderData;if(!b||b.length<=c){return undefined}if(!b[c].valueAxis){return undefined}return b[c].valueAxis.rect},getValueAxisLabels:function(h){var c=[];var j=this._renderData;if(!j||j.length<=h){return c}j=j[h].valueAxis;if(!j){return c}var k=this._getValueAxis(h);var b=k.position=="top"||k.position=="right";var g=this.seriesGroups[h];var e=g.orientation=="horizontal";if(g.polar||g.spider){for(var d=0;d<j.polarLabels.length;d++){var f=j.polarLabels[d];c.push({offset:{x:f.x,y:f.y},value:f.value})}return c}for(var d=0;d<j.items.length;d++){if(e){c.push({offset:{x:j.itemOffsets[j.items[d]].x+j.itemWidth/2,y:j.rect.y+(b?j.rect.height:0)},value:j.items[d]})}else{c.push({offset:{x:j.rect.x+j.rect.width,y:j.itemOffsets[j.items[d]].y+j.itemWidth/2},value:j.items[d]})}}return c},getPlotAreaRect:function(){return this._plotRect},getRect:function(){return this._rect},getItemCoord:function(n,j,b){if(!this._isSerieVisible(n,j)||!this._renderData||this._renderData.length<=n){return{x:NaN,y:NaN}}var e=this.seriesGroups[n];var h=this._getItemCoord(n,j,b,false);if(this._isPieGroup(n)){h={x:h.x,y:h.y,innerRadius:h.innerRadius,outerRadius:h.outerRadius,fromAngle:h.fromAngle,toAngle:h.toAngle,centerOffset:h.centerOffset};return h}if(e.polar||e.spider){var l=this._renderData[n].xoffsets.data[b];var k=this._renderData[n].offsets[j][b];var m=this._toPolarCoord(this._renderData[n].polarCoords,this._plotRect,l,k.to);h.x=m.x;h.y=m.y;return h}var d=e.orientation=="horizontal";if(d){var c=h.x;h.x=h.y;h.y=c;h.width=h.x.from-h.x.to;h.x=h.x.to;var f=this.getXAxisRect(n);h.y+=-this._plotRect.x+f.y}else{h.height=h.y.from-h.y.to;h.y=h.y.to}if(e.type.indexOf("column")!=-1){var i=this._getColumnSerieWidthAndOffset(n,j);if(d){h.y+=i.offset;h.height=i.width}else{h.x+=i.offset;h.width=i.width}}return h},_getItemCoord:function(q,k,b,p){var f=this.seriesGroups[q],m,l;if(!f||!this._renderData){return{x:NaN,y:NaN}}var h=f.series[k];if(!h){return{x:NaN,y:NaN}}var j=this._plotRect;if(this._isPieGroup(q)){var o=this._renderData[q].offsets[k][b];if(!o){return{x:NaN,y:NaN}}if(p===false){return o}var e=(o.fromAngle+o.toAngle)/2*(Math.PI/180);var i=(o.innerRadius+o.outerRadius)/2;m=j.x+o.x+Math.cos(e)*i;l=j.y+o.y-Math.sin(e)*i}else{m=j.x+this._renderData[q].xoffsets.data[b];l=this._renderData[q].offsets[k][b];if(isNaN(m)||!l){return{x:NaN,y:NaN}}if(f.polar==true||f.spider==true){var n=this._getPolarAxisCoords(q,j);var d=this._toPolarCoord(n,j,m,l.from);var c=this._toPolarCoord(n,j,m,l.to);m=c.x;l={from:d.y,to:c.y}}if(p===false){return{x:m,y:l}}if(f.polar==true||f.spider==true){l=l.to}else{l=(l.from+l.to)/2}}return{x:m,y:l}},showToolTip:function(f,c,e,b,d){var g=this.getItemCoord(f,c,e);if(isNaN(g.x)||isNaN(g.y)){return}this._startTooltipTimer(f,c,e,g.x,g.y,b,d)},hideToolTip:function(c){if(isNaN(c)){c=0}var b=this;b._cancelTooltipTimer();setTimeout(function(){b._hideToolTip(0)},c)}})})(jqxBaseFramework);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-7
View File
@@ -1,7 +0,0 @@
/*
jQWidgets v3.7.0 (2015-Feb)
Copyright (c) 2011-2015 jQWidgets.
License: http://jqwidgets.com/license/
*/
(function(a){a.extend(a.jqx._jqxChart.prototype,{_moduleWaterfall:true,_isSummary:function(d,b){var e=this.seriesGroups[d];for(var c=0;c<e.series.length;c++){if(undefined===e.series[c].summary){continue}summaryValue=this._getDataValue(b,e.series[c].summary,d);if(undefined!==summaryValue){return true}}return false},_applyWaterfall:function(x,z,g,f,A,h,C,e,p){var o=this.seriesGroups[g];if(x.length==0){return x}var t=f;var b={};var c=[];var d=undefined;var D=[];for(var v=0;v<o.series.length;v++){D.push(this._isSerieVisible(g,v))}var r={};for(var w=0;w<z;w++){var m=f;var n=0;var l=this._isSummary(g,w);for(var v=0;v<x.length;v++){if(!D[v]){continue}var B=0;if(l){B=m==f?A:0;x[v][w].value=b[v];x[v][w].summary=true;d=x[v][w].value<B;if(e){d=!d}var s=0;if(!isNaN(h)){s=this._getDataPointOffsetDiff(x[v][w].value+n,n==0?A:n,B||A,h,C,f,e)}else{s=this._getDataPointOffsetDiff(x[v][w].value,B,B,NaN,C,f,e)}x[v][w].to=m+(d?s:-s);x[v][w].from=m;if(p){n+=x[v][w].value;m=x[v][w].to}continue}var u=p?-1:v;if(isNaN(x[v][w].value)){continue}if(undefined===r[u]){B=A;r[u]=true}d=x[v][w].value<B;if(e){d=!d}var q=NaN,s=NaN;if(!p){q=w==0?f:x[v][c[v]].to}else{q=t}var s=0;if(!isNaN(h)){s=this._getDataPointOffsetDiff(x[v][w].value+(isNaN(b[u])?0:b[u]),isNaN(b[u])?A:b[u],B||A,h,C,q,e)}else{s=this._getDataPointOffsetDiff(x[v][w].value,B,B,NaN,C,f,e)}x[v][w].to=t=q+(d?s:-s);x[v][w].from=q;if(isNaN(b[u])){b[u]=x[v][w].value}else{b[u]+=x[v][w].value}if(u==-1){if(isNaN(b[v])){b[v]=x[v][w].value}else{b[v]+=x[v][w].value}}if(!p){c[v]=w}}}return x}})})(jqxBaseFramework);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-7
View File
@@ -1,7 +0,0 @@
/*
jQWidgets v3.7.0 (2015-Feb)
Copyright (c) 2011-2015 jQWidgets.
License: http://jqwidgets.com/license/
*/
(function(a){a.jqx.jqxWidget("jqxDockPanel","",{});a.extend(a.jqx._jqxDockPanel.prototype,{defineInstance:function(){var b={width:null,height:null,lastchildfill:true,disabled:false,events:["layout"]};a.extend(true,this,b);return b},createInstance:function(c){var b=this;this.host.addClass(this.toThemeProperty("jqx-dockpanel"));this.host.addClass(this.toThemeProperty("jqx-rc-all"));this.childrenCount=a(this.host).children().length;this.host.wrapInner('<div style="overflow: hidden; width: 100%; height: 100%;" class="innerContainer"></div>');this.$wrapper=this.host.find(".innerContainer");this.$wrapper.css("position","relative");this.sizeCache=new Array();this.performLayout();a.jqx.utilities.resize(this.host,function(){b.refresh()})},render:function(){if(this.width!=null&&this.width.toString().indexOf("px")!=-1){this.host.width(this.width)}else{if(this.width!=undefined&&!isNaN(this.width)){this.host.width(this.width)}}if(this.height!=null&&this.height.toString().indexOf("px")!=-1){this.host.height(this.height)}else{if(this.height!=undefined&&!isNaN(this.height)){this.host.height(this.height)}}this.sizeCache=new Array();this.performLayout()},resize:function(c,b){this.width=c;this.height=b;this.render()},performLayout:function(){if(this.disabled){return}var e=this.childrenCount;var d=0;var c=0;var b=0;var h=0;var f=this;var g={width:this.host.width(),height:this.host.height()};if(this.sizeCache.length<this.$wrapper.children().length){a.each(this.$wrapper.children(),function(i){var k=a(this);k.css("position","absolute");var j={width:k.css("width"),height:k.css("height")};f.sizeCache[i]=j})}a.each(this.$wrapper.children(),function(j){var l=this.getAttribute("dock");if(l==undefined){l="left"}if(j==e-1&&f.lastchildfill){l="fill"}var k=a(this);k.css("position","absolute");k.css("width",f.sizeCache[j].width);k.css("height",f.sizeCache[j].height);var i={width:k.outerWidth(),height:k.outerHeight()};var m={x:b,y:h,width:Math.max(0,g.width-(b+d)),height:Math.max(0,g.height-(h+c))};if(j<e){switch(l){case"left":b+=i.width;m.width=i.width;break;case"top":h+=i.height;m.height=i.height;break;case"right":d+=i.width;m.x=Math.max(0,(g.width-d));m.width=i.width;break;case"bottom":c+=i.height;m.y=Math.max(0,(g.height-c));m.height=i.height;break}}k.css("left",m.x);k.css("top",m.y);k.css("width",m.width);k.css("height",m.height)});this._raiseevent(0)},destroy:function(){a.jqx.utilities.resize(this.host,null,true);this.host.remove()},_raiseevent:function(g,d,f){if(this.isInitialized!=undefined&&this.isInitialized==true){var c=this.events[g];var e=new a.Event(c);e.previousValue=d;e.currentValue=f;e.owner=this;var b=this.host.trigger(e);return b}},propertyChangedHandler:function(c,d,b,e){if(!this.isInitialized){return}c.render()},refresh:function(){this.render()}})})(jqxBaseFramework);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-7
View File
@@ -1,7 +0,0 @@
/*
jQWidgets v3.7.0 (2015-Feb)
Copyright (c) 2011-2015 jQWidgets.
License: http://jqwidgets.com/license/
*/
(function(a){a.extend(a.jqx._jqxGrid.prototype,{_calculateaggregate:function(g,j,h,c){var f=g.aggregates;if(!f){f=j}if(f){var e=new Array();for(var d=0;d<f.length;d++){if(f[d]=="count"){continue}e[e.length]=g.cellsformat}if(this.source&&this.source.getAggregatedData){if(c==undefined){c=this.getrows()}if(this.virtualmode){var c=new Array();a.each(this.source._source.records,function(){c.push(this)})}if(h==undefined||h==true){var b=this.source.getAggregatedData([{name:g.datafield,aggregates:f,formatStrings:e}],this.gridlocalization,c);return b}else{var b=this.source.getAggregatedData([{name:g.datafield,aggregates:f}],this.gridlocalization,c);return b}}}return null},getcolumnaggregateddata:function(c,g,h,d){var e=this.getcolumn(c);var j=(h==undefined||h==false)?false:h;if(g==null){return""}var b=e.aggregates;e.aggregates=null;var i=this._calculateaggregate(e,g,j,d);var f={};if(i){f=i[c]}e.aggregates=b;return f},refreshaggregates:function(){this._updatecolumnsaggregates()},renderaggregates:function(){this._updateaggregates()},_updatecolumnaggregates:function(d,g,b){var e=this;if(!g){b.children().remove();b.html("");if(d.aggregatesrenderer){var f={};if(d.aggregates){f=this.getcolumnaggregateddata(d.datafield,d.aggregates)}var c=d.aggregatesrenderer({},d,b,null);b.html(c)}return}b.children().remove();b.html("");if(d.aggregatesrenderer){if(g){var c=d.aggregatesrenderer(g[d.datafield],d,b,this.getcolumnaggregateddata(d.datafield,g[d.datafield]));b.html(c)}}else{a.each(g,function(){var i=this;for(f in i){var j=a('<div style="position: relative; margin: 4px; overflow: hidden;"></div>');var h=f;h=e._getaggregatename(h);j.html(h+":"+i[f]);if(e.rtl){j.addClass(e.toThemeProperty("jqx-rtl"))}b.append(j)}})}},_getaggregatetype:function(c){switch(c){case"min":case"max":case"count":case"avg":case"product":case"var":case"varp":case"stdev":case"stdevp":case"sum":return c}var b=c;for(var d in c){b=d;break}return b},_getaggregatename:function(c){var b=c;switch(c){case"min":b="Min";break;case"max":b="Max";break;case"count":b="Count";break;case"avg":b="Avg";break;case"product":b="Product";break;case"var":b="Var";break;case"stdevp":b="StDevP";break;case"stdev":b="StDev";break;case"varp":b="VarP";case"sum":b="Sum";break}if(c===b&&typeof(b)!="string"){for(var d in c){b=d;break}}return b},_updatecolumnsaggregates:function(){var f=this.getrows();var b=this.columns.records.length;if(undefined!=this.statusbar[0].cells){for(var e=0;e<b;e++){var g=a(this.statusbar[0].cells[e]);var d=this.columns.records[e];var c=this._calculateaggregate(d,null,true,f);this._updatecolumnaggregates(d,c,g)}}},_updateaggregates:function(){var b=a('<div style="position: relative;" id="statusrow'+this.element.id+'"></div>');var e=0;var l=this.columns.records.length;var k=this.toThemeProperty("jqx-grid-cell");if(this.rtl){k+=" "+this.toThemeProperty("jqx-grid-cell-rtl");e=-1}k+=" "+this.toThemeProperty("jqx-grid-cell-pinned");var m=l+10;var n=new Array();this.statusbar[0].cells=n;for(var g=0;g<l;g++){var f=this.columns.records[g];var h=this._calculateaggregate(f);var c=f.width;if(c<f.minwidth){c=f.minwidth}if(c>f.maxwidth){c=f.maxwidth}var d=k;if(f.cellsalign){d+=" "+this.toThemeProperty("jqx-"+f.cellsalign+"-align")}var i=a('<div style="overflow: hidden; position: absolute; height: 100%;" class="'+d+'"></div>');b.append(i);i.css("left",e);if(!this.rtl){i.css("z-index",m--)}else{i.css("z-index",m++)}i.width(c);i[0].left=e;if(!(f.hidden&&f.hideable)){e+=c}else{i.css("display","none")}n[n.length]=i[0];this._updatecolumnaggregates(f,h,i)}if(a.jqx.browser.msie&&a.jqx.browser.version<8){b.css("z-index",m--)}b.width(parseFloat(e)+2);b.height(this.statusbarheight);this.statusbar.children().remove();this.statusbar.append(b);this.statusbar.removeClass(this.toThemeProperty("jqx-widget-header"));this.statusbar.addClass(k);this.statusbar.css("border-bottom-color","transparent");this.statusbar.css("border-top-width","1px");if(this.rtl&&this.hScrollBar.css("visibility")!="hidden"){this._renderhorizontalscroll()}}})})(jqxBaseFramework);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+9 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,7 +1,7 @@
var myManifest = { var myManifest = {
Debug: false, Debug: false,
Name: "Il Management", Name: "Il Management",
Version: "0.1.8.1", Version: "0.2.0.1",
Author: "Denis Ironi", Author: "Denis Ironi",
Settings: { Settings: {
//DefaultURL: "http://localhost:8081/Service_Manut", //DefaultURL: "http://localhost:8081/Service_Manut",
+54 -22
View File
@@ -1,25 +1,32 @@
define(['jquery', 'underscore', 'backbone', 'text!modules/addingr/addingrViewTemplate.html', 'modules/base/baseView', define(['jquery', 'underscore', 'backbone', 'text!modules/addingr/addingrViewTemplate.html', 'modules/base/baseView',
'jqxbuttons', 'jqxdata', 'jqxdropdownlist', 'jqx'],
'jqxinput', 'jqxrating', 'jqxnumberinput'], function ($, _, Backbone, addingrViewTemplate, BaseView) {
function($, _, Backbone, addingrViewTemplate, BaseView) {
var AddIngrView = BaseView.extend({ var AddIngrView = BaseView.extend({
dataAdapter: undefined, dataAdapter: undefined,
//initialize template //initialize template
template: _.template(addingrViewTemplate), template: _.template(addingrViewTemplate),
initialize: function() { modifyItem: null,
ingrIndex: null,
initialize: function () {
AddIngrView.__super__.initialize.call(this); AddIngrView.__super__.initialize.call(this);
//this.header.title = "pippo"; //this.header.title = "pippo";
}, },
openDlg: function() openDlg: function (ingrIndex, item)
{ {
$("#ingrediente").jqxDropDownList('selectedIndex', -1); this.ingrIndex = typeof ingrIndex !== 'undefined' ? ingrIndex : null;
$("#unitMis").jqxDropDownList('selectedIndex', -1); this.modifyItem = typeof item !== 'undefined' ? item : {
$("#qty").jqxNumberInput('val', ''); "id_tipo_ingredienti": -1,
$("#nota").val(''); "nome_ingrediente": '',
"quantita": '',
"id_tipo_quantita": -1,
"unita": null,
"note": ''
};
$("#addIngrWindow").jqxWindow('open'); $("#addIngrWindow").jqxWindow('open');
this._updateUI(this.modifyItem);
}, },
validate: function() { validate: function () {
if ($("#ingrediente").val() === "22" && $("#nota").val() !== "") if ($("#ingrediente").val() === "22" && $("#nota").val() !== "")
return true; return true;
if ($("#ingrediente").val() > 0 && if ($("#ingrediente").val() > 0 &&
@@ -30,8 +37,25 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/addingr/addingrViewTem
return false; return false;
}, },
addBtnFn: undefined, addBtnFn: undefined,
_updateUI: function (item) {
var itemIngr = $("#ingrediente").jqxDropDownList('getItemByValue', parseInt(item.id_tipo_ingredienti));
if (itemIngr !== undefined) {
$("#ingrediente").jqxDropDownList({selectedIndex: itemIngr.index});
}else{
$("#ingrediente").jqxDropDownList({selectedIndex: -1});
}
var itemUnMis = $("#unitMis").jqxDropDownList('getItemByValue', parseInt(item.id_tipo_quantita));
if (itemUnMis !== undefined) {
$("#unitMis").jqxDropDownList({selectedIndex: itemUnMis.index});
} else {
$("#unitMis").jqxDropDownList({selectedIndex: -1});
}
$("#qty").jqxNumberInput('val', this.modifyItem.quantita);
$("#nota").val(this.modifyItem.note);
},
//render the content into div of view //render the content into div of view
render: function() { render: function () {
//this.header.title = "pippo"; //this.header.title = "pippo";
AddIngrView.__super__.render.call(this); AddIngrView.__super__.render.call(this);
var self = this; var self = this;
@@ -46,7 +70,7 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/addingr/addingrViewTem
autoOpen: false, autoOpen: false,
cancelButton: this.$el.find("#cancelIngrBtn"), cancelButton: this.$el.find("#cancelIngrBtn"),
modalOpacity: 0.01, modalOpacity: 0.01,
initContent: function() { initContent: function () {
var source = var source =
{ {
datatype: "jsonp", datatype: "jsonp",
@@ -64,10 +88,14 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/addingr/addingrViewTem
width: 200, width: 200,
height: 25, height: 25,
source: dataAdapter, source: dataAdapter,
selectedIndex: -1,
displayMember: "name", displayMember: "name",
valueMember: "tipo_ingredienti_id" valueMember: "tipo_ingredienti_id"
}); });
$("#ingrediente").on('bindingComplete', function (event) {
var item = $("#ingrediente").jqxDropDownList('getItemByValue', parseInt(self.modifyItem.id_tipo_ingredienti));
$("#ingrediente").jqxDropDownList({selectedIndex: item.index});
});
var sourceunitMis = var sourceunitMis =
{ {
datatype: "jsonp", datatype: "jsonp",
@@ -85,12 +113,14 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/addingr/addingrViewTem
width: 200, width: 200,
height: 25, height: 25,
source: dataAdapterunitMis, source: dataAdapterunitMis,
selectedIndex: -1,
displayMember: "name", displayMember: "name",
valueMember: "tipo_quantita_id" valueMember: "tipo_quantita_id"
}); });
$("#unitMis").on('bindingComplete', function (event) {
$("#ingrediente").on('select', {scope: self}, function(event) { var item = $("#unitMis").jqxDropDownList('getItemByValue', parseInt(self.modifyItem.id_tipo_quantita));
$("#unitMis").jqxDropDownList({selectedIndex: item.index});
});
$("#ingrediente").on('select', {scope: self}, function (event) {
if (event.args) { if (event.args) {
var item = event.args.item; var item = event.args.item;
if (item) { if (item) {
@@ -112,7 +142,7 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/addingr/addingrViewTem
$("#addIngrBtn").jqxButton({width: '48%', height: 40}); $("#addIngrBtn").jqxButton({width: '48%', height: 40});
$("#cancelIngrBtn").jqxButton({width: '48%', height: 40}); $("#cancelIngrBtn").jqxButton({width: '48%', height: 40});
$("#addIngrBtn").on('click', function() { $("#addIngrBtn").on('click', function () {
if (self.validate()) if (self.validate())
{ {
var newItem = { var newItem = {
@@ -123,21 +153,23 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/addingr/addingrViewTem
"unita": null, "unita": null,
"note": $("#nota").val() "note": $("#nota").val()
}; };
if($("#unitMis").jqxDropDownList('getSelectedItem') !== null) if ($("#unitMis").jqxDropDownList('getSelectedItem') !== null)
newItem.unita = $("#unitMis").jqxDropDownList('getSelectedItem').label; newItem.unita = $("#unitMis").jqxDropDownList('getSelectedItem').label;
if($("#unitMis").jqxDropDownList('getSelectedItem') !== null) if ($("#unitMis").jqxDropDownList('getSelectedItem') !== null)
newItem.id_tipo_quantita = $("#unitMis").jqxDropDownList('getSelectedItem').value; newItem.id_tipo_quantita = $("#unitMis").jqxDropDownList('getSelectedItem').value;
if (self.addBtnFn) if (self.addBtnFn)
self.addBtnFn(newItem); self.addBtnFn(self.ingrIndex, newItem);
$('#addIngrWindow').jqxWindow('close'); $('#addIngrWindow').jqxWindow('close');
} }
else else
alert("Inserire correttamente i dati"); alert("Inserire correttamente i dati");
}); });
self._updateUI(self.modifyItem);
} }
}); });
return this; return this;
+23 -7
View File
@@ -1,7 +1,5 @@
define(['jquery', 'underscore', 'backbone', 'text!modules/editricetta/editricettaViewTemplate.html', 'modules/base/baseView', define(['jquery', 'underscore', 'backbone', 'text!modules/editricetta/editricettaViewTemplate.html', 'modules/base/baseView',
'controls/window/window', 'modules/addingr/addingr', 'jqxbuttons', 'jqxgrid', 'jqxcombobox', 'jqxdata', 'jqxdropdownlist', 'controls/window/window', 'modules/addingr/addingr', 'jqx'],
'jqxgrid', 'jqxgrid_selection', 'jqxgrid_columnsresize', 'jqxgrid_filter',
'jqxtabs', 'jqxeditor', 'jqxinput', 'jqxrating', 'jqxnumberinput', 'jqxlistbox'],
function($, _, Backbone, editricettaViewTemplate, BaseView, Window, AddIngrDlg) { function($, _, Backbone, editricettaViewTemplate, BaseView, Window, AddIngrDlg) {
var EditRicetteView = BaseView.extend({ var EditRicetteView = BaseView.extend({
@@ -152,8 +150,9 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/editricetta/editricett
} }
else if (tab === 1) else if (tab === 1)
{ {
$("#add").jqxButton({width: '37%'}); $("#add").jqxButton({width: '22%'});
$("#remove").jqxButton({disabled: true, width: '37%'}); $("#remove").jqxButton({disabled: true, width: '22%'});
$("#modify").jqxButton({disabled: true, width: '22%'});
$('#add').on('click', function() { $('#add').on('click', function() {
self.addIngrDlg.openDlg(); self.addIngrDlg.openDlg();
@@ -167,6 +166,15 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/editricetta/editricett
$("#listbox").jqxListBox('source', items); $("#listbox").jqxListBox('source', items);
}); });
$('#modify').on('click', function() {
var indexSelected = $('#listbox').jqxListBox('getSelectedIndex');
var items = $("#listbox").jqxListBox('source');
var item = items[indexSelected];
self.addIngrDlg.openDlg(indexSelected, item);
});
$("#up").jqxButton({disabled: true, width: '8%'}); $("#up").jqxButton({disabled: true, width: '8%'});
$("#down").jqxButton({disabled: true, width: '8%'}); $("#down").jqxButton({disabled: true, width: '8%'});
@@ -243,6 +251,7 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/editricetta/editricett
$('#listbox').on('select', function(event) { $('#listbox').on('select', function(event) {
var args = event.args; var args = event.args;
if (args) { if (args) {
$("#modify").jqxButton({disabled: false});
$("#remove").jqxButton({disabled: false}); $("#remove").jqxButton({disabled: false});
if (args.index === 0) if (args.index === 0)
{ {
@@ -265,6 +274,7 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/editricetta/editricett
var args = event.args; var args = event.args;
if (args) { if (args) {
$("#remove").jqxButton({disabled: true}); $("#remove").jqxButton({disabled: true});
$("#modify").jqxButton({disabled: true});
} }
}); });
} }
@@ -338,9 +348,15 @@ define(['jquery', 'underscore', 'backbone', 'text!modules/editricetta/editricett
this.addIngrDlg.render(); this.addIngrDlg.render();
this.addIngrDlg.addBtnFn = function(item) { this.addIngrDlg.addBtnFn = function(index, item) {
var items = $("#listbox").jqxListBox('source'); var items = $("#listbox").jqxListBox('source');
items.push(item); if(index === null){
items.push(item);
}
else
{
items.splice(index, 1, item);
}
$("#listbox").jqxListBox('source', items); $("#listbox").jqxListBox('source', items);
}; };
@@ -38,10 +38,12 @@
</table> </table>
</div> </div>
<div> <div>
<input id="add" style="margin-right: 1%;" type="button" value="Aggiungi Ingrediente"/> <input id="add" style="margin-right: 1%;" type="button" value="Aggiungi"/>
<input id="modify" type="button" value="Modifica"/>
<input id="remove" type="button" value="Cancella"/>
<input id="up" style="margin-right: 1%;" type="button" value="Up"/> <input id="up" style="margin-right: 1%;" type="button" value="Up"/>
<input id="down" style="margin-right: 1%;" type="button" value="Down"/> <input id="down" style="margin-right: 1%;" type="button" value="Down"/>
<input id="remove" type="button" value="Cancella Ingrediente"/>
<div style="border: none;" id="listbox"></div> <div style="border: none;" id="listbox"></div>
</div> </div>
<div><textarea id="procedimento"></textarea></div> <div><textarea id="procedimento"></textarea></div>
+1 -1
View File
@@ -1,6 +1,6 @@
define(['jquery', 'underscore', 'backbone', 'text!modules/home/homeViewTemplate.html', define(['jquery', 'underscore', 'backbone', 'text!modules/home/homeViewTemplate.html',
'modules/base/baseView', 'modules/ricette/ricette', 'modules/editricetta/editricetta', 'modules/photos/photos', 'modules/base/baseView', 'modules/ricette/ricette', 'modules/editricetta/editricetta', 'modules/photos/photos',
'jqxbuttons', 'jqxmenu', 'jqxwindow'], 'jqx'],
function($, _, Backbone, homeViewTemplate, BaseView, RicetteView, EditRicettaView, PhotosView) { function($, _, Backbone, homeViewTemplate, BaseView, RicetteView, EditRicettaView, PhotosView) {
var HomeView = BaseView.extend({ var HomeView = BaseView.extend({
+1 -2
View File
@@ -1,6 +1,5 @@
define(['jquery', 'underscore', 'backbone', 'text!modules/photos/photosViewTemplate.html', 'modules/base/baseView', define(['jquery', 'underscore', 'backbone', 'text!modules/photos/photosViewTemplate.html', 'modules/base/baseView',
'controls/window/window', 'jqxdata', 'jqxdropdownlist', 'controls/window/window', 'jqx'],
'jqxgrid', 'jqxgrid_selection', 'jqxgrid_columnsresize', 'jqxgrid_filter'],
function($, _, Backbone, photosViewTemplate, BaseView, Window) { function($, _, Backbone, photosViewTemplate, BaseView, Window) {
var PhotosView = BaseView.extend({ var PhotosView = BaseView.extend({
+1 -2
View File
@@ -1,6 +1,5 @@
define(['jquery', 'underscore', 'backbone', 'text!modules/ricette/ricetteViewTemplate.html', 'modules/base/baseView', define(['jquery', 'underscore', 'backbone', 'text!modules/ricette/ricetteViewTemplate.html', 'modules/base/baseView',
'controls/window/window', 'modules/editricetta/editricetta', 'jqxdata', 'jqxdropdownlist', 'controls/window/window', 'modules/editricetta/editricetta', 'jqx'],
'jqxgrid', 'jqxgrid_selection', 'jqxgrid_columnsresize', 'jqxgrid_filter'],
function($, _, Backbone, ricetteViewTemplate, BaseView, Window, EditRicetta) { function($, _, Backbone, ricetteViewTemplate, BaseView, Window, EditRicetta) {
var RicetteView = BaseView.extend({ var RicetteView = BaseView.extend({