Update Assets

This commit is contained in:
Michael RICOIS 2015-06-17 09:40:28 +00:00
parent ebb9c71832
commit 90a9db1af9
17 changed files with 6245 additions and 144 deletions

View File

@ -23,17 +23,16 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
->appendHttpEquiv('Content-Language', 'fr-FR'); ->appendHttpEquiv('Content-Language', 'fr-FR');
$view->headLink() $view->headLink()
->appendStylesheet('/libs/qtip/jquery.qtip.css', 'all') ->appendStylesheet('/libs/qtip/jquery.qtip.min.css', 'all')
->appendStylesheet('/libs/tree/themes/default/style.css') ->appendStylesheet('/libs/tree/themes/default/style.css')
->appendStylesheet('/libs/ui-1.10.3/themes/smoothness/jquery-ui.css', 'all') ->appendStylesheet('/libs/ui-1.10.3/themes/smoothness/jquery-ui.css', 'all')
->appendStylesheet($pathStyle.'/main.css', 'all'); ->appendStylesheet($pathStyle.'/main.css', 'all');
$view->headScript() $view->headScript()
->appendFile('/libs/jquery/jquery-1.10.1.min.js', 'text/javascript') ->appendFile('/libs/jquery/jquery-1.11.3.min.js', 'text/javascript')
->appendFile('/libs/jquery/jquery-migrate-1.2.1.min.js', 'text/javascript')
->appendFile('/libs/jquery/jquery.cookie.js', 'text/javascript') ->appendFile('/libs/jquery/jquery.cookie.js', 'text/javascript')
->appendFile('/libs/ui-1.10.3/jquery-ui.min.js', 'text/javascript') ->appendFile('/libs/ui-1.10.3/jquery-ui.min.js', 'text/javascript')
->appendFile('/libs/qtip/jquery.qtip.js', 'text/javascript') ->appendFile('/libs/qtip/jquery.qtip.min.js', 'text/javascript')
->appendFile($pathScript.'/scripts.js', 'text/javascript'); ->appendFile($pathScript.'/scripts.js', 'text/javascript');
$view->headTitle()->setSeparator(' - '); $view->headTitle()->setSeparator(' - ');

View File

@ -14,7 +14,7 @@ class EnrichissementController extends Zend_Controller_Action
public function fileformAction() public function fileformAction()
{ {
$this->view->headScript()->appendFile('/libs/form/jquery.form.js', 'text/javascript'); $this->view->headScript()->appendFile('/libs/form/jquery.form.min.js', 'text/javascript');
$this->view->headScript()->appendFile('/themes/default/scripts/jqueryprogressbar.js', 'text/javascript'); $this->view->headScript()->appendFile('/themes/default/scripts/jqueryprogressbar.js', 'text/javascript');
$this->view->assign('filesize', ini_get('upload_max_filesize')); $this->view->assign('filesize', ini_get('upload_max_filesize'));
} }

View File

@ -33,7 +33,7 @@ Les espaces seront remplacés par "_"
</span> </span>
</div> </div>
<script type="text/javascript" src="/libs/form/jquery.form.js"></script> <script type="text/javascript" src="/libs/form/jquery.form.min.js"></script>
<script> <script>
$('#dialog').dialog({ $('#dialog').dialog({
buttons: [ { buttons: [ {

View File

@ -1,5 +1,6 @@
<div id="header-logo"> <div id="header-logo">
<div id="logo"> <div id="logo">
<h1><!-- <a href="./"><img alt="ODEA" src="#"></a> -->Outils D'Extraction Automatique</h1> <img alt="ODEA" src="./themes/default/images/logos/logo.png" style="float:left;">
<h1>Outils D'Extraction Automatique</h1>
</div> </div>
</div> </div>

View File

@ -45,7 +45,7 @@ class Ciblage
* First of all we need to load the Sphinx API * First of all we need to load the Sphinx API
* @todo : Make a test and load the right version of API * @todo : Make a test and load the right version of API
*/ */
require_once 'sphinxapi/sphinxapi-2.0.4.php'; require_once 'sphinxapi/sphinxapi-2.2.9.php';
//Load configuration from registry //Load configuration from registry
$c = Zend_Registry::get('config'); $c = Zend_Registry::get('config');

File diff suppressed because it is too large Load Diff

View File

@ -1,16 +1,28 @@
/*! /*!
* jQuery Form Plugin * jQuery Form Plugin
* version: 3.14 (30-JUL-2012) * version: 3.51.0-2014.06.20
* @requires jQuery v1.3.2 or later * Requires jQuery v1.5 or later
* * Copyright (c) 2014 M. Alsup
* Examples and documentation at: http://malsup.com/jquery/form/ * Examples and documentation at: http://malsup.com/jquery/form/
* Project repository: https://github.com/malsup/form * Project repository: https://github.com/malsup/form
* Dual licensed under the MIT and GPL licenses: * Dual licensed under the MIT and GPL licenses.
* http://malsup.github.com/mit-license.txt * https://github.com/malsup/form#copyright-and-license
* http://malsup.github.com/gpl-license-v2.txt
*/ */
/*global ActiveXObject alert */ /*global ActiveXObject */
;(function($) {
// AMD support
(function (factory) {
"use strict";
if (typeof define === 'function' && define.amd) {
// using AMD; register as anon module
define(['jquery'], factory);
} else {
// no AMD; invoke directly
factory( (typeof(jQuery) != 'undefined') ? jQuery : window.Zepto );
}
}
(function($) {
"use strict"; "use strict";
/* /*
@ -57,6 +69,23 @@ var feature = {};
feature.fileapi = $("<input type='file'/>").get(0).files !== undefined; feature.fileapi = $("<input type='file'/>").get(0).files !== undefined;
feature.formdata = window.FormData !== undefined; feature.formdata = window.FormData !== undefined;
var hasProp = !!$.fn.prop;
// attr2 uses prop when it can but checks the return type for
// an expected string. this accounts for the case where a form
// contains inputs with names like "action" or "method"; in those
// cases "prop" returns the element
$.fn.attr2 = function() {
if ( ! hasProp ) {
return this.attr.apply(this, arguments);
}
var val = this.prop.apply(this, arguments);
if ( ( val && val.jquery ) || typeof val === 'string' ) {
return val;
}
return this.attr.apply(this, arguments);
};
/** /**
* ajaxSubmit() provides a mechanism for immediately submitting * ajaxSubmit() provides a mechanism for immediately submitting
* an HTML form using AJAX. * an HTML form using AJAX.
@ -75,9 +104,13 @@ $.fn.ajaxSubmit = function(options) {
if (typeof options == 'function') { if (typeof options == 'function') {
options = { success: options }; options = { success: options };
} }
else if ( options === undefined ) {
options = {};
}
method = options.type || this.attr2('method');
action = options.url || this.attr2('action');
method = this.attr('method');
action = this.attr('action');
url = (typeof action === 'string') ? $.trim(action) : ''; url = (typeof action === 'string') ? $.trim(action) : '';
url = url || window.location.href || ''; url = url || window.location.href || '';
if (url) { if (url) {
@ -88,7 +121,7 @@ $.fn.ajaxSubmit = function(options) {
options = $.extend(true, { options = $.extend(true, {
url: url, url: url,
success: $.ajaxSettings.success, success: $.ajaxSettings.success,
type: method || 'GET', type: method || $.ajaxSettings.type,
iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
}, options); }, options);
@ -171,8 +204,28 @@ $.fn.ajaxSubmit = function(options) {
} }
}; };
if (options.error) {
var oldError = options.error;
options.error = function(xhr, status, error) {
var context = options.context || this;
oldError.apply(context, [xhr, status, error, $form]);
};
}
if (options.complete) {
var oldComplete = options.complete;
options.complete = function(xhr, status) {
var context = options.context || this;
oldComplete.apply(context, [xhr, status, $form]);
};
}
// are there files to upload? // are there files to upload?
var fileInputs = $('input:file:enabled[value]', this); // [value] (issue #113)
// [value] (issue #113), also see comment:
// https://github.com/malsup/form/commit/588306aedba1de01388032d5f42a60159eea9228#commitcomment-2180219
var fileInputs = $('input[type=file]:enabled', this).filter(function() { return $(this).val() !== ''; });
var hasFileInputs = fileInputs.length > 0; var hasFileInputs = fileInputs.length > 0;
var mp = 'multipart/form-data'; var mp = 'multipart/form-data';
var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp); var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);
@ -181,6 +234,8 @@ $.fn.ajaxSubmit = function(options) {
log("fileAPI :" + fileAPI); log("fileAPI :" + fileAPI);
var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI; var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI;
var jqxhr;
// options.iframe allows user to force iframe mode // options.iframe allows user to force iframe mode
// 06-NOV-09: now defaulting to iframe mode if file input is detected // 06-NOV-09: now defaulting to iframe mode if file input is detected
if (options.iframe !== false && (options.iframe || shouldUseFrame)) { if (options.iframe !== false && (options.iframe || shouldUseFrame)) {
@ -188,28 +243,47 @@ $.fn.ajaxSubmit = function(options) {
// see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
if (options.closeKeepAlive) { if (options.closeKeepAlive) {
$.get(options.closeKeepAlive, function() { $.get(options.closeKeepAlive, function() {
fileUploadIframe(a); jqxhr = fileUploadIframe(a);
}); });
} }
else { else {
fileUploadIframe(a); jqxhr = fileUploadIframe(a);
} }
} }
else if ((hasFileInputs || multipart) && fileAPI) { else if ((hasFileInputs || multipart) && fileAPI) {
fileUploadXhr(a); jqxhr = fileUploadXhr(a);
} }
else { else {
$.ajax(options); jqxhr = $.ajax(options);
} }
$form.removeData('jqxhr').data('jqxhr', jqxhr);
// clear element array // clear element array
for (var k=0; k < elements.length; k++) for (var k=0; k < elements.length; k++) {
elements[k] = null; elements[k] = null;
}
// fire 'notify' event // fire 'notify' event
this.trigger('form-submit-notify', [this, options]); this.trigger('form-submit-notify', [this, options]);
return this; return this;
// utility fn for deep serialization
function deepSerialize(extraData){
var serialized = $.param(extraData, options.traditional).split('&');
var len = serialized.length;
var result = [];
var i, part;
for (i=0; i < len; i++) {
// #252; undo param space replacement
serialized[i] = serialized[i].replace(/\+/g,' ');
part = serialized[i].split('=');
// #278; use array instead of object storage, favoring array serializations
result.push([decodeURIComponent(part[0]), decodeURIComponent(part[1])]);
}
return result;
}
// XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz) // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz)
function fileUploadXhr(a) { function fileUploadXhr(a) {
var formdata = new FormData(); var formdata = new FormData();
@ -219,9 +293,12 @@ $.fn.ajaxSubmit = function(options) {
} }
if (options.extraData) { if (options.extraData) {
for (var p in options.extraData) var serializedData = deepSerialize(options.extraData);
if (options.extraData.hasOwnProperty(p)) for (i=0; i < serializedData.length; i++) {
formdata.append(p, options.extraData[p]); if (serializedData[i]) {
formdata.append(serializedData[i][0], serializedData[i][1]);
}
}
} }
options.data = null; options.data = null;
@ -230,15 +307,15 @@ $.fn.ajaxSubmit = function(options) {
contentType: false, contentType: false,
processData: false, processData: false,
cache: false, cache: false,
type: 'POST' type: method || 'POST'
}); });
if (options.uploadProgress) { if (options.uploadProgress) {
// workaround because jqXHR does not expose upload property // workaround because jqXHR does not expose upload property
s.xhr = function() { s.xhr = function() {
var xhr = jQuery.ajaxSettings.xhr(); var xhr = $.ajaxSettings.xhr();
if (xhr.upload) { if (xhr.upload) {
xhr.upload.onprogress = function(event) { xhr.upload.addEventListener('progress', function(event) {
var percent = 0; var percent = 0;
var position = event.loaded || event.position; /*event.position is deprecated*/ var position = event.loaded || event.position; /*event.position is deprecated*/
var total = event.total; var total = event.total;
@ -246,7 +323,7 @@ $.fn.ajaxSubmit = function(options) {
percent = Math.ceil(position / total * 100); percent = Math.ceil(position / total * 100);
} }
options.uploadProgress(event, position, total, percent); options.uploadProgress(event, position, total, percent);
}; }, false);
} }
return xhr; return xhr;
}; };
@ -255,47 +332,56 @@ $.fn.ajaxSubmit = function(options) {
s.data = null; s.data = null;
var beforeSend = s.beforeSend; var beforeSend = s.beforeSend;
s.beforeSend = function(xhr, o) { s.beforeSend = function(xhr, o) {
//Send FormData() provided by user
if (options.formData) {
o.data = options.formData;
}
else {
o.data = formdata; o.data = formdata;
if(beforeSend) }
if(beforeSend) {
beforeSend.call(this, xhr, o); beforeSend.call(this, xhr, o);
}
}; };
$.ajax(s); return $.ajax(s);
} }
// private function for handling file uploads (hat tip to YAHOO!) // private function for handling file uploads (hat tip to YAHOO!)
function fileUploadIframe(a) { function fileUploadIframe(a) {
var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle; var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
var useProp = !!$.fn.prop; var deferred = $.Deferred();
if ($(':input[name=submit],:input[id=submit]', form).length) { // #341
// if there is an input with a name or id of 'submit' then we won't be deferred.abort = function(status) {
// able to invoke the submit fn on the form (at least not x-browser) xhr.abort(status);
alert('Error: Form elements must not have name or id of "submit".'); };
return;
}
if (a) { if (a) {
// ensure that every serialized input is still enabled // ensure that every serialized input is still enabled
for (i=0; i < elements.length; i++) { for (i=0; i < elements.length; i++) {
el = $(elements[i]); el = $(elements[i]);
if ( useProp ) if ( hasProp ) {
el.prop('disabled', false); el.prop('disabled', false);
else }
else {
el.removeAttr('disabled'); el.removeAttr('disabled');
} }
} }
}
s = $.extend(true, {}, $.ajaxSettings, options); s = $.extend(true, {}, $.ajaxSettings, options);
s.context = s.context || s; s.context = s.context || s;
id = 'jqFormIO' + (new Date().getTime()); id = 'jqFormIO' + (new Date().getTime());
if (s.iframeTarget) { if (s.iframeTarget) {
$io = $(s.iframeTarget); $io = $(s.iframeTarget);
n = $io.attr('name'); n = $io.attr2('name');
if (!n) if (!n) {
$io.attr('name', id); $io.attr2('name', id);
else }
else {
id = n; id = n;
} }
}
else { else {
$io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />'); $io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />');
$io.css({ position: 'absolute', top: '-1000px', left: '-1000px' }); $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
@ -316,21 +402,26 @@ $.fn.ajaxSubmit = function(options) {
var e = (status === 'timeout' ? 'timeout' : 'aborted'); var e = (status === 'timeout' ? 'timeout' : 'aborted');
log('aborting upload... ' + e); log('aborting upload... ' + e);
this.aborted = 1; this.aborted = 1;
// #214
try { // #214, #257
if (io.contentWindow.document.execCommand) { if (io.contentWindow.document.execCommand) {
try { // #214
io.contentWindow.document.execCommand('Stop'); io.contentWindow.document.execCommand('Stop');
} catch(ignore) {}
} }
}
catch(ignore) {}
$io.attr('src', s.iframeSrc); // abort op in progress $io.attr('src', s.iframeSrc); // abort op in progress
xhr.error = e; xhr.error = e;
if (s.error) if (s.error) {
s.error.call(s.context, xhr, e, status); s.error.call(s.context, xhr, e, status);
if (g) }
if (g) {
$.event.trigger("ajaxError", [xhr, s, e]); $.event.trigger("ajaxError", [xhr, s, e]);
if (s.complete) }
if (s.complete) {
s.complete.call(s.context, xhr, e); s.complete.call(s.context, xhr, e);
} }
}
}; };
g = s.global; g = s.global;
@ -346,10 +437,12 @@ $.fn.ajaxSubmit = function(options) {
if (s.global) { if (s.global) {
$.active--; $.active--;
} }
return; deferred.reject();
return deferred;
} }
if (xhr.aborted) { if (xhr.aborted) {
return; deferred.reject();
return deferred;
} }
// add submitting element to data if we know it // add submitting element to data if we know it
@ -370,7 +463,36 @@ $.fn.ajaxSubmit = function(options) {
var SERVER_ABORT = 2; var SERVER_ABORT = 2;
function getDoc(frame) { function getDoc(frame) {
var doc = frame.contentWindow ? frame.contentWindow.document : frame.contentDocument ? frame.contentDocument : frame.document; /* it looks like contentWindow or contentDocument do not
* carry the protocol property in ie8, when running under ssl
* frame.document is the only valid response document, since
* the protocol is know but not on the other two objects. strange?
* "Same origin policy" http://en.wikipedia.org/wiki/Same_origin_policy
*/
var doc = null;
// IE8 cascading access check
try {
if (frame.contentWindow) {
doc = frame.contentWindow.document;
}
} catch(err) {
// IE8 access denied under ssl & missing protocol
log('cannot get iframe.contentWindow document: ' + err);
}
if (doc) { // successful getting content
return doc;
}
try { // simply checking may throw in ie8 under ssl or mismatched protocol
doc = frame.contentDocument ? frame.contentDocument : frame.document;
} catch(err) {
// last attempt
log('cannot get iframe.contentDocument: ' + err);
doc = frame.document;
}
return doc; return doc;
} }
@ -385,11 +507,14 @@ $.fn.ajaxSubmit = function(options) {
// take a breath so that pending repaints get some cpu time before the upload starts // take a breath so that pending repaints get some cpu time before the upload starts
function doSubmit() { function doSubmit() {
// make sure form attrs are set // make sure form attrs are set
var t = $form.attr('target'), a = $form.attr('action'); var t = $form.attr2('target'),
a = $form.attr2('action'),
mp = 'multipart/form-data',
et = $form.attr('enctype') || $form.attr('encoding') || mp;
// update form attrs in IE friendly way // update form attrs in IE friendly way
form.setAttribute('target',id); form.setAttribute('target',id);
if (!method) { if (!method || /post/i.test(method) ) {
form.setAttribute('method', 'POST'); form.setAttribute('method', 'POST');
} }
if (a != s.url) { if (a != s.url) {
@ -414,14 +539,16 @@ $.fn.ajaxSubmit = function(options) {
try { try {
var state = getDoc(io).readyState; var state = getDoc(io).readyState;
log('state = ' + state); log('state = ' + state);
if (state && state.toLowerCase() == 'uninitialized') if (state && state.toLowerCase() == 'uninitialized') {
setTimeout(checkState,50); setTimeout(checkState,50);
} }
}
catch(e) { catch(e) {
log('Server abort: ' , e, ' (', e.name, ')'); log('Server abort: ' , e, ' (', e.name, ')');
cb(SERVER_ABORT); cb(SERVER_ABORT);
if (timeoutHandle) if (timeoutHandle) {
clearTimeout(timeoutHandle); clearTimeout(timeoutHandle);
}
timeoutHandle = undefined; timeoutHandle = undefined;
} }
} }
@ -435,11 +562,11 @@ $.fn.ajaxSubmit = function(options) {
// if using the $.param format that allows for multiple values with the same name // if using the $.param format that allows for multiple values with the same name
if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) { if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {
extraInputs.push( extraInputs.push(
$('<input type="hidden" name="'+s.extraData[n].name+'">').attr('value',s.extraData[n].value) $('<input type="hidden" name="'+s.extraData[n].name+'">').val(s.extraData[n].value)
.appendTo(form)[0]); .appendTo(form)[0]);
} else { } else {
extraInputs.push( extraInputs.push(
$('<input type="hidden" name="'+n+'">').attr('value',s.extraData[n]) $('<input type="hidden" name="'+n+'">').val(s.extraData[n])
.appendTo(form)[0]); .appendTo(form)[0]);
} }
} }
@ -449,17 +576,27 @@ $.fn.ajaxSubmit = function(options) {
if (!s.iframeTarget) { if (!s.iframeTarget) {
// add iframe to doc and submit the form // add iframe to doc and submit the form
$io.appendTo('body'); $io.appendTo('body');
if (io.attachEvent) }
if (io.attachEvent) {
io.attachEvent('onload', cb); io.attachEvent('onload', cb);
else }
else {
io.addEventListener('load', cb, false); io.addEventListener('load', cb, false);
} }
setTimeout(checkState,15); setTimeout(checkState,15);
try {
form.submit(); form.submit();
} catch(err) {
// just in case form has element with name/id of 'submit'
var submitFn = document.createElement('form').submit;
submitFn.apply(form);
}
} }
finally { finally {
// reset attrs and remove "extra" input elements // reset attrs and remove "extra" input elements
form.setAttribute('action',a); form.setAttribute('action',a);
form.setAttribute('enctype', et); // #380
if(t) { if(t) {
form.setAttribute('target', t); form.setAttribute('target', t);
} else { } else {
@ -482,31 +619,35 @@ $.fn.ajaxSubmit = function(options) {
if (xhr.aborted || callbackProcessed) { if (xhr.aborted || callbackProcessed) {
return; return;
} }
try {
doc = getDoc(io); doc = getDoc(io);
} if(!doc) {
catch(ex) { log('cannot access response document');
log('cannot access response document: ', ex);
e = SERVER_ABORT; e = SERVER_ABORT;
} }
if (e === CLIENT_TIMEOUT_ABORT && xhr) { if (e === CLIENT_TIMEOUT_ABORT && xhr) {
xhr.abort('timeout'); xhr.abort('timeout');
deferred.reject(xhr, 'timeout');
return; return;
} }
else if (e == SERVER_ABORT && xhr) { else if (e == SERVER_ABORT && xhr) {
xhr.abort('server abort'); xhr.abort('server abort');
deferred.reject(xhr, 'error', 'server abort');
return; return;
} }
if (!doc || doc.location.href == s.iframeSrc) { if (!doc || doc.location.href == s.iframeSrc) {
// response not received yet // response not received yet
if (!timedOut) if (!timedOut) {
return; return;
} }
if (io.detachEvent) }
if (io.detachEvent) {
io.detachEvent('onload', cb); io.detachEvent('onload', cb);
else }
else {
io.removeEventListener('load', cb, false); io.removeEventListener('load', cb, false);
}
var status = 'success', errMsg; var status = 'success', errMsg;
try { try {
@ -533,11 +674,12 @@ $.fn.ajaxSubmit = function(options) {
var docRoot = doc.body ? doc.body : doc.documentElement; var docRoot = doc.body ? doc.body : doc.documentElement;
xhr.responseText = docRoot ? docRoot.innerHTML : null; xhr.responseText = docRoot ? docRoot.innerHTML : null;
xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc; xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
if (isXml) if (isXml) {
s.dataType = 'xml'; s.dataType = 'xml';
}
xhr.getResponseHeader = function(header){ xhr.getResponseHeader = function(header){
var headers = {'content-type': s.dataType}; var headers = {'content-type': s.dataType};
return headers[header]; return headers[header.toLowerCase()];
}; };
// support for XHR 'status' & 'statusText' emulation : // support for XHR 'status' & 'statusText' emulation :
if (docRoot) { if (docRoot) {
@ -575,15 +717,15 @@ $.fn.ajaxSubmit = function(options) {
try { try {
data = httpData(xhr, dt, s); data = httpData(xhr, dt, s);
} }
catch (e) { catch (err) {
status = 'parsererror'; status = 'parsererror';
xhr.error = errMsg = (e || status); xhr.error = errMsg = (err || status);
} }
} }
catch (e) { catch (err) {
log('error caught: ',e); log('error caught: ',err);
status = 'error'; status = 'error';
xhr.error = errMsg = (e || status); xhr.error = errMsg = (err || status);
} }
if (xhr.aborted) { if (xhr.aborted) {
@ -597,38 +739,52 @@ $.fn.ajaxSubmit = function(options) {
// ordering of these callbacks/triggers is odd, but that's how $.ajax does it // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
if (status === 'success') { if (status === 'success') {
if (s.success) if (s.success) {
s.success.call(s.context, data, 'success', xhr); s.success.call(s.context, data, 'success', xhr);
if (g) }
deferred.resolve(xhr.responseText, 'success', xhr);
if (g) {
$.event.trigger("ajaxSuccess", [xhr, s]); $.event.trigger("ajaxSuccess", [xhr, s]);
} }
}
else if (status) { else if (status) {
if (errMsg === undefined) if (errMsg === undefined) {
errMsg = xhr.statusText; errMsg = xhr.statusText;
if (s.error) }
if (s.error) {
s.error.call(s.context, xhr, status, errMsg); s.error.call(s.context, xhr, status, errMsg);
if (g) }
deferred.reject(xhr, 'error', errMsg);
if (g) {
$.event.trigger("ajaxError", [xhr, s, errMsg]); $.event.trigger("ajaxError", [xhr, s, errMsg]);
} }
}
if (g) if (g) {
$.event.trigger("ajaxComplete", [xhr, s]); $.event.trigger("ajaxComplete", [xhr, s]);
}
if (g && ! --$.active) { if (g && ! --$.active) {
$.event.trigger("ajaxStop"); $.event.trigger("ajaxStop");
} }
if (s.complete) if (s.complete) {
s.complete.call(s.context, xhr, status); s.complete.call(s.context, xhr, status);
}
callbackProcessed = true; callbackProcessed = true;
if (s.timeout) if (s.timeout) {
clearTimeout(timeoutHandle); clearTimeout(timeoutHandle);
}
// clean up // clean up
setTimeout(function() { setTimeout(function() {
if (!s.iframeTarget) if (!s.iframeTarget) {
$io.remove(); $io.remove();
}
else { //adding else to clean up existing iframe response.
$io.attr('src', s.iframeSrc);
}
xhr.responseXML = null; xhr.responseXML = null;
}, 100); }, 100);
} }
@ -656,9 +812,10 @@ $.fn.ajaxSubmit = function(options) {
data = xml ? xhr.responseXML : xhr.responseText; data = xml ? xhr.responseXML : xhr.responseText;
if (xml && data.documentElement.nodeName === 'parsererror') { if (xml && data.documentElement.nodeName === 'parsererror') {
if ($.error) if ($.error) {
$.error('parsererror'); $.error('parsererror');
} }
}
if (s && s.dataFilter) { if (s && s.dataFilter) {
data = s.dataFilter(data, type); data = s.dataFilter(data, type);
} }
@ -671,6 +828,8 @@ $.fn.ajaxSubmit = function(options) {
} }
return data; return data;
}; };
return deferred;
} }
}; };
@ -728,7 +887,7 @@ function doAjaxSubmit(e) {
var options = e.data; var options = e.data;
if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
e.preventDefault(); e.preventDefault();
$(this).ajaxSubmit(options); $(e.target).ajaxSubmit(options); // #365
} }
} }
@ -736,9 +895,9 @@ function captureSubmittingElement(e) {
/*jshint validthis:true */ /*jshint validthis:true */
var target = e.target; var target = e.target;
var $el = $(target); var $el = $(target);
if (!($el.is(":submit,input:image"))) { if (!($el.is("[type=submit],[type=image]"))) {
// is this a child element of the submit el? (ex: a span within a button) // is this a child element of the submit el? (ex: a span within a button)
var t = $el.closest(':submit'); var t = $el.closest('[type=submit]');
if (t.length === 0) { if (t.length === 0) {
return; return;
} }
@ -787,8 +946,23 @@ $.fn.formToArray = function(semantic, elements) {
} }
var form = this[0]; var form = this[0];
var formId = this.attr('id');
var els = semantic ? form.getElementsByTagName('*') : form.elements; var els = semantic ? form.getElementsByTagName('*') : form.elements;
if (!els) { var els2;
if (els && !/MSIE [678]/.test(navigator.userAgent)) { // #390
els = $(els).get(); // convert to standard array
}
// #386; account for inputs outside the form which use the 'form' attribute
if ( formId ) {
els2 = $(':input[form="' + formId + '"]').get(); // hat tip @thet
if ( els2.length ) {
els = (els || []).concat(els2);
}
}
if (!els || !els.length) {
return a; return a;
} }
@ -796,13 +970,13 @@ $.fn.formToArray = function(semantic, elements) {
for(i=0, max=els.length; i < max; i++) { for(i=0, max=els.length; i < max; i++) {
el = els[i]; el = els[i];
n = el.name; n = el.name;
if (!n) { if (!n || el.disabled) {
continue; continue;
} }
if (semantic && form.clk && el.type == "image") { if (semantic && form.clk && el.type == "image") {
// handle image inputs on the fly when semantic == true // handle image inputs on the fly when semantic == true
if(!el.disabled && form.clk == el) { if(form.clk == el) {
a.push({name: n, value: $(el).val(), type: el.type }); a.push({name: n, value: $(el).val(), type: el.type });
a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y}); a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
} }
@ -811,15 +985,17 @@ $.fn.formToArray = function(semantic, elements) {
v = $.fieldValue(el, true); v = $.fieldValue(el, true);
if (v && v.constructor == Array) { if (v && v.constructor == Array) {
if (elements) if (elements) {
elements.push(el); elements.push(el);
}
for(j=0, jmax=v.length; j < jmax; j++) { for(j=0, jmax=v.length; j < jmax; j++) {
a.push({name: n, value: v[j]}); a.push({name: n, value: v[j]});
} }
} }
else if (feature.fileapi && el.type == 'file' && !el.disabled) { else if (feature.fileapi && el.type == 'file') {
if (elements) if (elements) {
elements.push(el); elements.push(el);
}
var files = el.files; var files = el.files;
if (files.length) { if (files.length) {
for (j=0; j < files.length; j++) { for (j=0; j < files.length; j++) {
@ -832,8 +1008,9 @@ $.fn.formToArray = function(semantic, elements) {
} }
} }
else if (v !== null && typeof v != 'undefined') { else if (v !== null && typeof v != 'undefined') {
if (elements) if (elements) {
elements.push(el); elements.push(el);
}
a.push({name: n, value: v, type: el.type, required: el.required}); a.push({name: n, value: v, type: el.type, required: el.required});
} }
} }
@ -896,19 +1073,19 @@ $.fn.fieldSerialize = function(successful) {
* <input name="C" type="radio" value="C2" /> * <input name="C" type="radio" value="C2" />
* </fieldset></form> * </fieldset></form>
* *
* var v = $(':text').fieldValue(); * var v = $('input[type=text]').fieldValue();
* // if no values are entered into the text inputs * // if no values are entered into the text inputs
* v == ['',''] * v == ['','']
* // if values entered into the text inputs are 'foo' and 'bar' * // if values entered into the text inputs are 'foo' and 'bar'
* v == ['foo','bar'] * v == ['foo','bar']
* *
* var v = $(':checkbox').fieldValue(); * var v = $('input[type=checkbox]').fieldValue();
* // if neither checkbox is checked * // if neither checkbox is checked
* v === undefined * v === undefined
* // if both checkboxes are checked * // if both checkboxes are checked
* v == ['B1', 'B2'] * v == ['B1', 'B2']
* *
* var v = $(':radio').fieldValue(); * var v = $('input[type=radio]').fieldValue();
* // if neither radio is checked * // if neither radio is checked
* v === undefined * v === undefined
* // if first radio is checked * // if first radio is checked
@ -929,11 +1106,13 @@ $.fn.fieldValue = function(successful) {
if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) { if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
continue; continue;
} }
if (v.constructor == Array) if (v.constructor == Array) {
$.merge(val, v); $.merge(val, v);
else }
else {
val.push(v); val.push(v);
} }
}
return val; return val;
}; };
@ -966,7 +1145,7 @@ $.fieldValue = function(el, successful) {
if (op.selected) { if (op.selected) {
var v = op.value; var v = op.value;
if (!v) { // extra pain for IE... if (!v) { // extra pain for IE...
v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value; v = (op.attributes && op.attributes.value && !(op.attributes.value.specified)) ? op.text : op.value;
} }
if (one) { if (one) {
return v; return v;
@ -1009,15 +1188,23 @@ $.fn.clearFields = $.fn.clearInputs = function(includeHidden) {
else if (tag == 'select') { else if (tag == 'select') {
this.selectedIndex = -1; this.selectedIndex = -1;
} }
else if (t == "file") {
if (/MSIE/.test(navigator.userAgent)) {
$(this).replaceWith($(this).clone(true));
} else {
$(this).val('');
}
}
else if (includeHidden) { else if (includeHidden) {
// includeHidden can be the value true, or it can be a selector string // includeHidden can be the value true, or it can be a selector string
// indicating a special test; for example: // indicating a special test; for example:
// $('#myForm').clearForm('.special:hidden') // $('#myForm').clearForm('.special:hidden')
// the above would clean hidden inputs that have the class of 'special' // the above would clean hidden inputs that have the class of 'special'
if ( (includeHidden === true && /hidden/.test(t)) || if ( (includeHidden === true && /hidden/.test(t)) ||
(typeof includeHidden == 'string' && $(this).is(includeHidden)) ) (typeof includeHidden == 'string' && $(this).is(includeHidden)) ) {
this.value = ''; this.value = '';
} }
}
}); });
}; };
@ -1075,8 +1262,9 @@ $.fn.ajaxSubmit.debug = false;
// helper fn for console logging // helper fn for console logging
function log() { function log() {
if (!$.fn.ajaxSubmit.debug) if (!$.fn.ajaxSubmit.debug) {
return; return;
}
var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,''); var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
if (window.console && window.console.log) { if (window.console && window.console.log) {
window.console.log(msg); window.console.log(msg);
@ -1086,4 +1274,4 @@ function log() {
} }
} }
})(jQuery); }));

11
public/libs/form/jquery.form.min.js vendored Normal file

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

3
public/libs/qtip/jquery.qtip.min.css vendored Normal file

File diff suppressed because one or more lines are too long

5
public/libs/qtip/jquery.qtip.min.js vendored Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -110,7 +110,7 @@ body {
float: left; float: left;
font-weight: 300; font-weight: 300;
line-height: 1.375; line-height: 1.375;
margin: 0; margin: 10px 0 0 10px;
} }
#control a { #control a {