gallery migrated to new ui
This commit is contained in:
parent
91b1cf6edc
commit
3287a2ef17
1
vendor/built_in_modules/gallery/app/assets/javascripts/file-upload/canvas-to-blob.min.js
vendored
Normal file
1
vendor/built_in_modules/gallery/app/assets/javascripts/file-upload/canvas-to-blob.min.js
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
(function(a){"use strict";var b=a.HTMLCanvasElement&&a.HTMLCanvasElement.prototype,c=a.Blob&&function(){try{return Boolean(new Blob)}catch(a){return!1}}(),d=c&&a.Uint8Array&&function(){try{return(new Blob([new Uint8Array(100)])).size===100}catch(a){return!1}}(),e=a.BlobBuilder||a.WebKitBlobBuilder||a.MozBlobBuilder||a.MSBlobBuilder,f=(c||e)&&a.atob&&a.ArrayBuffer&&a.Uint8Array&&function(a){var b,f,g,h,i,j;a.split(",")[0].indexOf("base64")>=0?b=atob(a.split(",")[1]):b=decodeURIComponent(a.split(",")[1]),f=new ArrayBuffer(b.length),g=new Uint8Array(f);for(h=0;h<b.length;h+=1)g[h]=b.charCodeAt(h);return i=a.split(",")[0].split(":")[1].split(";")[0],c?new Blob([d?g:f],{type:i}):(j=new e,j.append(f),j.getBlob(i))};a.HTMLCanvasElement&&!b.toBlob&&(b.mozGetAsFile?b.toBlob=function(a,c,d){d&&b.toDataURL&&f?a(f(this.toDataURL(c,d))):a(this.mozGetAsFile("blob",c))}:b.toDataURL&&f&&(b.toBlob=function(a,b,c){a(f(this.toDataURL(b,c)))})),typeof define=="function"&&define.amd?define(function(){return f}):a.dataURLtoBlob=f})(this);
|
19
vendor/built_in_modules/gallery/app/assets/javascripts/file-upload/drop-zone.js
vendored
Normal file
19
vendor/built_in_modules/gallery/app/assets/javascripts/file-upload/drop-zone.js
vendored
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
$(document).bind('dragover', function (e) {
|
||||||
|
var dropZone = $('#dropzone'),
|
||||||
|
timeout = window.dropZoneTimeout;
|
||||||
|
if (!timeout) {
|
||||||
|
dropZone.removeAttr('style').addClass('in');
|
||||||
|
} else {
|
||||||
|
clearTimeout(timeout);
|
||||||
|
};
|
||||||
|
if (e.target === dropZone[0]) {
|
||||||
|
dropZone.addClass('hover');
|
||||||
|
} else {
|
||||||
|
dropZone.removeClass('hover');
|
||||||
|
};
|
||||||
|
window.dropZoneTimeout = setTimeout(function () {
|
||||||
|
window.dropZoneTimeout = null;
|
||||||
|
dropZone.removeClass('in hover');
|
||||||
|
$('.files').checkListLength();
|
||||||
|
}, 100);
|
||||||
|
});
|
223
vendor/built_in_modules/gallery/app/assets/javascripts/file-upload/jquery.fileupload-fp.js
vendored
Normal file
223
vendor/built_in_modules/gallery/app/assets/javascripts/file-upload/jquery.fileupload-fp.js
vendored
Normal file
|
@ -0,0 +1,223 @@
|
||||||
|
/*
|
||||||
|
* jQuery File Upload File Processing Plugin 1.2.1
|
||||||
|
* https://github.com/blueimp/jQuery-File-Upload
|
||||||
|
*
|
||||||
|
* Copyright 2012, Sebastian Tschan
|
||||||
|
* https://blueimp.net
|
||||||
|
*
|
||||||
|
* Licensed under the MIT license:
|
||||||
|
* http://www.opensource.org/licenses/MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*jslint nomen: true, unparam: true, regexp: true */
|
||||||
|
/*global define, window, document */
|
||||||
|
|
||||||
|
(function (factory) {
|
||||||
|
'use strict';
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// Register as an anonymous AMD module:
|
||||||
|
define([
|
||||||
|
'jquery',
|
||||||
|
'load-image',
|
||||||
|
'canvas-to-blob',
|
||||||
|
'./jquery.fileupload'
|
||||||
|
], factory);
|
||||||
|
} else {
|
||||||
|
// Browser globals:
|
||||||
|
factory(
|
||||||
|
window.jQuery,
|
||||||
|
window.loadImage
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}(function ($, loadImage) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// The File Upload FP version extends the fileupload widget
|
||||||
|
// with file processing functionality:
|
||||||
|
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
|
||||||
|
|
||||||
|
options: {
|
||||||
|
// The list of file processing actions:
|
||||||
|
process: [
|
||||||
|
/*
|
||||||
|
{
|
||||||
|
action: 'load',
|
||||||
|
fileTypes: /^image\/(gif|jpeg|png)$/,
|
||||||
|
maxFileSize: 20000000 // 20MB
|
||||||
|
},
|
||||||
|
{
|
||||||
|
action: 'resize',
|
||||||
|
maxWidth: 1920,
|
||||||
|
maxHeight: 1200,
|
||||||
|
minWidth: 800,
|
||||||
|
minHeight: 600
|
||||||
|
},
|
||||||
|
{
|
||||||
|
action: 'save'
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
],
|
||||||
|
|
||||||
|
// The add callback is invoked as soon as files are added to the
|
||||||
|
// fileupload widget (via file input selection, drag & drop or add
|
||||||
|
// API call). See the basic file upload widget for more information:
|
||||||
|
add: function (e, data) {
|
||||||
|
$(this).fileupload('process', data).done(function () {
|
||||||
|
data.submit();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
processActions: {
|
||||||
|
// Loads the image given via data.files and data.index
|
||||||
|
// as img element if the browser supports canvas.
|
||||||
|
// Accepts the options fileTypes (regular expression)
|
||||||
|
// and maxFileSize (integer) to limit the files to load:
|
||||||
|
load: function (data, options) {
|
||||||
|
var that = this,
|
||||||
|
file = data.files[data.index],
|
||||||
|
dfd = $.Deferred();
|
||||||
|
if (window.HTMLCanvasElement &&
|
||||||
|
window.HTMLCanvasElement.prototype.toBlob &&
|
||||||
|
($.type(options.maxFileSize) !== 'number' ||
|
||||||
|
file.size < options.maxFileSize) &&
|
||||||
|
(!options.fileTypes ||
|
||||||
|
options.fileTypes.test(file.type))) {
|
||||||
|
loadImage(
|
||||||
|
file,
|
||||||
|
function (img) {
|
||||||
|
if (!img.src) {
|
||||||
|
return dfd.rejectWith(that, [data]);
|
||||||
|
}
|
||||||
|
data.img = img;
|
||||||
|
dfd.resolveWith(that, [data]);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
dfd.rejectWith(that, [data]);
|
||||||
|
}
|
||||||
|
return dfd.promise();
|
||||||
|
},
|
||||||
|
// Resizes the image given as data.img and updates
|
||||||
|
// data.canvas with the resized image as canvas element.
|
||||||
|
// Accepts the options maxWidth, maxHeight, minWidth and
|
||||||
|
// minHeight to scale the given image:
|
||||||
|
resize: function (data, options) {
|
||||||
|
var img = data.img,
|
||||||
|
canvas;
|
||||||
|
options = $.extend({canvas: true}, options);
|
||||||
|
if (img) {
|
||||||
|
canvas = loadImage.scale(img, options);
|
||||||
|
if (canvas.width !== img.width ||
|
||||||
|
canvas.height !== img.height) {
|
||||||
|
data.canvas = canvas;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
},
|
||||||
|
// Saves the processed image given as data.canvas
|
||||||
|
// inplace at data.index of data.files:
|
||||||
|
save: function (data, options) {
|
||||||
|
// Do nothing if no processing has happened:
|
||||||
|
if (!data.canvas) {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
var that = this,
|
||||||
|
file = data.files[data.index],
|
||||||
|
name = file.name,
|
||||||
|
dfd = $.Deferred(),
|
||||||
|
callback = function (blob) {
|
||||||
|
if (!blob.name) {
|
||||||
|
if (file.type === blob.type) {
|
||||||
|
blob.name = file.name;
|
||||||
|
} else if (file.name) {
|
||||||
|
blob.name = file.name.replace(
|
||||||
|
/\..+$/,
|
||||||
|
'.' + blob.type.substr(6)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Store the created blob at the position
|
||||||
|
// of the original file in the files list:
|
||||||
|
data.files[data.index] = blob;
|
||||||
|
dfd.resolveWith(that, [data]);
|
||||||
|
};
|
||||||
|
// Use canvas.mozGetAsFile directly, to retain the filename, as
|
||||||
|
// Gecko doesn't support the filename option for FormData.append:
|
||||||
|
if (data.canvas.mozGetAsFile) {
|
||||||
|
callback(data.canvas.mozGetAsFile(
|
||||||
|
(/^image\/(jpeg|png)$/.test(file.type) && name) ||
|
||||||
|
((name && name.replace(/\..+$/, '')) ||
|
||||||
|
'blob') + '.png',
|
||||||
|
file.type
|
||||||
|
));
|
||||||
|
} else {
|
||||||
|
data.canvas.toBlob(callback, file.type);
|
||||||
|
}
|
||||||
|
return dfd.promise();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// Resizes the file at the given index and stores the created blob at
|
||||||
|
// the original position of the files list, returns a Promise object:
|
||||||
|
_processFile: function (files, index, options) {
|
||||||
|
var that = this,
|
||||||
|
dfd = $.Deferred().resolveWith(that, [{
|
||||||
|
files: files,
|
||||||
|
index: index
|
||||||
|
}]),
|
||||||
|
chain = dfd.promise();
|
||||||
|
that._processing += 1;
|
||||||
|
$.each(options.process, function (i, settings) {
|
||||||
|
chain = chain.pipe(function (data) {
|
||||||
|
return that.processActions[settings.action]
|
||||||
|
.call(this, data, settings);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
chain.always(function () {
|
||||||
|
that._processing -= 1;
|
||||||
|
if (that._processing === 0) {
|
||||||
|
that.element
|
||||||
|
.removeClass('fileupload-processing');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (that._processing === 1) {
|
||||||
|
that.element.addClass('fileupload-processing');
|
||||||
|
}
|
||||||
|
return chain;
|
||||||
|
},
|
||||||
|
|
||||||
|
// Processes the files given as files property of the data parameter,
|
||||||
|
// returns a Promise object that allows to bind a done handler, which
|
||||||
|
// will be invoked after processing all files (inplace) is done:
|
||||||
|
process: function (data) {
|
||||||
|
var that = this,
|
||||||
|
options = $.extend({}, this.options, data);
|
||||||
|
if (options.process && options.process.length &&
|
||||||
|
this._isXHRUpload(options)) {
|
||||||
|
$.each(data.files, function (index, file) {
|
||||||
|
that._processingQueue = that._processingQueue.pipe(
|
||||||
|
function () {
|
||||||
|
var dfd = $.Deferred();
|
||||||
|
that._processFile(data.files, index, options)
|
||||||
|
.always(function () {
|
||||||
|
dfd.resolveWith(that);
|
||||||
|
});
|
||||||
|
return dfd.promise();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return this._processingQueue;
|
||||||
|
},
|
||||||
|
|
||||||
|
_create: function () {
|
||||||
|
this._super();
|
||||||
|
this._processing = 0;
|
||||||
|
this._processingQueue = $.Deferred().resolveWith(this)
|
||||||
|
.promise();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}));
|
812
vendor/built_in_modules/gallery/app/assets/javascripts/file-upload/jquery.fileupload-ui.js
vendored
Normal file
812
vendor/built_in_modules/gallery/app/assets/javascripts/file-upload/jquery.fileupload-ui.js
vendored
Normal file
|
@ -0,0 +1,812 @@
|
||||||
|
/*
|
||||||
|
* jQuery File Upload User Interface Plugin 7.4
|
||||||
|
* https://github.com/blueimp/jQuery-File-Upload
|
||||||
|
*
|
||||||
|
* Copyright 2010, Sebastian Tschan
|
||||||
|
* https://blueimp.net
|
||||||
|
*
|
||||||
|
* Licensed under the MIT license:
|
||||||
|
* http://www.opensource.org/licenses/MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*jslint nomen: true, unparam: true, regexp: true */
|
||||||
|
/*global define, window, URL, webkitURL, FileReader */
|
||||||
|
|
||||||
|
(function (factory) {
|
||||||
|
'use strict';
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// Register as an anonymous AMD module:
|
||||||
|
define([
|
||||||
|
'jquery',
|
||||||
|
'tmpl',
|
||||||
|
'load-image',
|
||||||
|
'./jquery.fileupload-fp'
|
||||||
|
], factory);
|
||||||
|
} else {
|
||||||
|
// Browser globals:
|
||||||
|
factory(
|
||||||
|
window.jQuery,
|
||||||
|
window.tmpl,
|
||||||
|
window.loadImage
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}(function ($, tmpl, loadImage) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// The UI version extends the file upload widget
|
||||||
|
// and adds complete user interface interaction:
|
||||||
|
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
|
||||||
|
|
||||||
|
options: {
|
||||||
|
// By default, files added to the widget are uploaded as soon
|
||||||
|
// as the user clicks on the start buttons. To enable automatic
|
||||||
|
// uploads, set the following option to true:
|
||||||
|
autoUpload: false,
|
||||||
|
// The following option limits the number of files that are
|
||||||
|
// allowed to be uploaded using this widget:
|
||||||
|
maxNumberOfFiles: undefined,
|
||||||
|
// The maximum allowed file size:
|
||||||
|
maxFileSize: undefined,
|
||||||
|
// The minimum allowed file size:
|
||||||
|
minFileSize: undefined,
|
||||||
|
// The regular expression for allowed file types, matches
|
||||||
|
// against either file type or file name:
|
||||||
|
acceptFileTypes: /.+$/i,
|
||||||
|
// The regular expression to define for which files a preview
|
||||||
|
// image is shown, matched against the file type:
|
||||||
|
previewSourceFileTypes: /^image\/(gif|jpeg|png)$/,
|
||||||
|
// The maximum file size of images that are to be displayed as preview:
|
||||||
|
previewSourceMaxFileSize: 5000000, // 5MB
|
||||||
|
// The maximum width of the preview images:
|
||||||
|
previewMaxWidth: 80,
|
||||||
|
// The maximum height of the preview images:
|
||||||
|
previewMaxHeight: 80,
|
||||||
|
// By default, preview images are displayed as canvas elements
|
||||||
|
// if supported by the browser. Set the following option to false
|
||||||
|
// to always display preview images as img elements:
|
||||||
|
previewAsCanvas: true,
|
||||||
|
// The ID of the upload template:
|
||||||
|
uploadTemplateId: 'template-upload',
|
||||||
|
// The ID of the download template:
|
||||||
|
downloadTemplateId: 'template-download',
|
||||||
|
// The container for the list of files. If undefined, it is set to
|
||||||
|
// an element with class "files" inside of the widget element:
|
||||||
|
filesContainer: undefined,
|
||||||
|
// By default, files are appended to the files container.
|
||||||
|
// Set the following option to true, to prepend files instead:
|
||||||
|
prependFiles: false,
|
||||||
|
// The expected data type of the upload response, sets the dataType
|
||||||
|
// option of the $.ajax upload requests:
|
||||||
|
dataType: 'json',
|
||||||
|
|
||||||
|
// The add callback is invoked as soon as files are added to the fileupload
|
||||||
|
// widget (via file input selection, drag & drop or add API call).
|
||||||
|
// See the basic file upload widget for more information:
|
||||||
|
add: function (e, data) {
|
||||||
|
var that = $(this).data('blueimp-fileupload') ||
|
||||||
|
$(this).data('fileupload'),
|
||||||
|
options = that.options,
|
||||||
|
files = data.files;
|
||||||
|
$(this).fileupload('process', data).done(function () {
|
||||||
|
that._adjustMaxNumberOfFiles(-files.length);
|
||||||
|
data.maxNumberOfFilesAdjusted = true;
|
||||||
|
data.files.valid = data.isValidated = that._validate(files);
|
||||||
|
data.context = that._renderUpload(files).data('data', data);
|
||||||
|
options.filesContainer[
|
||||||
|
options.prependFiles ? 'prepend' : 'append'
|
||||||
|
](data.context);
|
||||||
|
that._renderPreviews(data);
|
||||||
|
that._forceReflow(data.context);
|
||||||
|
that._transition(data.context).done(
|
||||||
|
function () {
|
||||||
|
if ((that._trigger('added', e, data) !== false) &&
|
||||||
|
(options.autoUpload || data.autoUpload) &&
|
||||||
|
data.autoUpload !== false && data.isValidated) {
|
||||||
|
data.submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
$('.files').checkListLength();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// Callback for the start of each file upload request:
|
||||||
|
send: function (e, data) {
|
||||||
|
var that = $(this).data('blueimp-fileupload') ||
|
||||||
|
$(this).data('fileupload');
|
||||||
|
if (!data.isValidated) {
|
||||||
|
if (!data.maxNumberOfFilesAdjusted) {
|
||||||
|
that._adjustMaxNumberOfFiles(-data.files.length);
|
||||||
|
data.maxNumberOfFilesAdjusted = true;
|
||||||
|
}
|
||||||
|
if (!that._validate(data.files)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (data.context && data.dataType &&
|
||||||
|
data.dataType.substr(0, 6) === 'iframe') {
|
||||||
|
// Iframe Transport does not support progress events.
|
||||||
|
// In lack of an indeterminate progress bar, we set
|
||||||
|
// the progress to 100%, showing the full animated bar:
|
||||||
|
data.context
|
||||||
|
.find('.progress').addClass(
|
||||||
|
!$.support.transition && 'progress-animated'
|
||||||
|
)
|
||||||
|
.attr('aria-valuenow', 100)
|
||||||
|
.find('.bar').css(
|
||||||
|
'width',
|
||||||
|
'100%'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return that._trigger('sent', e, data);
|
||||||
|
},
|
||||||
|
// Callback for successful uploads:
|
||||||
|
done: function (e, data) {
|
||||||
|
var that = $(this).data('blueimp-fileupload') ||
|
||||||
|
$(this).data('fileupload'),
|
||||||
|
files = that._getFilesFromResponse(data),
|
||||||
|
template,
|
||||||
|
deferred;
|
||||||
|
if (data.context) {
|
||||||
|
data.context.each(function (index) {
|
||||||
|
var file = files[index] ||
|
||||||
|
{error: 'Empty file upload result'},
|
||||||
|
deferred = that._addFinishedDeferreds();
|
||||||
|
if (file.error) {
|
||||||
|
that._adjustMaxNumberOfFiles(1);
|
||||||
|
}
|
||||||
|
that._transition($(this)).done(
|
||||||
|
function () {
|
||||||
|
var node = $(this);
|
||||||
|
template = that._renderDownload([file])
|
||||||
|
.replaceAll(node);
|
||||||
|
that._forceReflow(template);
|
||||||
|
that._transition(template).done(
|
||||||
|
function () {
|
||||||
|
data.context = $(this);
|
||||||
|
that._trigger('completed', e, data);
|
||||||
|
that._trigger('finished', e, data);
|
||||||
|
deferred.resolve();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (files.length) {
|
||||||
|
$.each(files, function (index, file) {
|
||||||
|
if (data.maxNumberOfFilesAdjusted && file.error) {
|
||||||
|
that._adjustMaxNumberOfFiles(1);
|
||||||
|
} else if (!data.maxNumberOfFilesAdjusted &&
|
||||||
|
!file.error) {
|
||||||
|
that._adjustMaxNumberOfFiles(-1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
data.maxNumberOfFilesAdjusted = true;
|
||||||
|
}
|
||||||
|
template = that._renderDownload(files)
|
||||||
|
.appendTo(that.options.filesContainer);
|
||||||
|
that._forceReflow(template);
|
||||||
|
deferred = that._addFinishedDeferreds();
|
||||||
|
that._transition(template).done(
|
||||||
|
function () {
|
||||||
|
data.context = $(this);
|
||||||
|
that._trigger('completed', e, data);
|
||||||
|
that._trigger('finished', e, data);
|
||||||
|
deferred.resolve();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Callback for failed (abort or error) uploads:
|
||||||
|
fail: function (e, data) {
|
||||||
|
var that = $(this).data('blueimp-fileupload') ||
|
||||||
|
$(this).data('fileupload'),
|
||||||
|
template,
|
||||||
|
deferred;
|
||||||
|
if (data.maxNumberOfFilesAdjusted) {
|
||||||
|
that._adjustMaxNumberOfFiles(data.files.length);
|
||||||
|
}
|
||||||
|
if (data.context) {
|
||||||
|
data.context.each(function (index) {
|
||||||
|
if (data.errorThrown !== 'abort') {
|
||||||
|
var file = data.files[index];
|
||||||
|
file.error = file.error || data.errorThrown ||
|
||||||
|
true;
|
||||||
|
deferred = that._addFinishedDeferreds();
|
||||||
|
that._transition($(this)).done(
|
||||||
|
function () {
|
||||||
|
var node = $(this);
|
||||||
|
template = that._renderDownload([file])
|
||||||
|
.replaceAll(node);
|
||||||
|
that._forceReflow(template);
|
||||||
|
that._transition(template).done(
|
||||||
|
function () {
|
||||||
|
data.context = $(this);
|
||||||
|
that._trigger('failed', e, data);
|
||||||
|
that._trigger('finished', e, data);
|
||||||
|
deferred.resolve();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
deferred = that._addFinishedDeferreds();
|
||||||
|
that._transition($(this)).done(
|
||||||
|
function () {
|
||||||
|
$(this).remove();
|
||||||
|
that._trigger('failed', e, data);
|
||||||
|
that._trigger('finished', e, data);
|
||||||
|
deferred.resolve();
|
||||||
|
$('.files').checkListLength();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (data.errorThrown !== 'abort') {
|
||||||
|
data.context = that._renderUpload(data.files)
|
||||||
|
.appendTo(that.options.filesContainer)
|
||||||
|
.data('data', data);
|
||||||
|
that._forceReflow(data.context);
|
||||||
|
deferred = that._addFinishedDeferreds();
|
||||||
|
that._transition(data.context).done(
|
||||||
|
function () {
|
||||||
|
data.context = $(this);
|
||||||
|
that._trigger('failed', e, data);
|
||||||
|
that._trigger('finished', e, data);
|
||||||
|
deferred.resolve();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
that._trigger('failed', e, data);
|
||||||
|
that._trigger('finished', e, data);
|
||||||
|
that._addFinishedDeferreds().resolve();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Callback for upload progress events:
|
||||||
|
progress: function (e, data) {
|
||||||
|
if (data.context) {
|
||||||
|
var progress = parseInt(data.loaded / data.total * 100, 10);
|
||||||
|
data.context.find('.progress')
|
||||||
|
.attr('aria-valuenow', progress)
|
||||||
|
.find('.bar').css(
|
||||||
|
'width',
|
||||||
|
progress + '%'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Callback for global upload progress events:
|
||||||
|
progressall: function (e, data) {
|
||||||
|
var $this = $(this),
|
||||||
|
progress = parseInt(data.loaded / data.total * 100, 10),
|
||||||
|
globalProgressNode = $this.find('.fileupload-progress'),
|
||||||
|
extendedProgressNode = globalProgressNode
|
||||||
|
.find('.progress-extended');
|
||||||
|
if (extendedProgressNode.length) {
|
||||||
|
extendedProgressNode.html(
|
||||||
|
($this.data('blueimp-fileupload') || $this.data('fileupload'))
|
||||||
|
._renderExtendedProgress(data)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
globalProgressNode
|
||||||
|
.find('.progress')
|
||||||
|
.attr('aria-valuenow', progress)
|
||||||
|
.find('.bar').css(
|
||||||
|
'width',
|
||||||
|
progress + '%'
|
||||||
|
);
|
||||||
|
},
|
||||||
|
// Callback for uploads start, equivalent to the global ajaxStart event:
|
||||||
|
start: function (e) {
|
||||||
|
var that = $(this).data('blueimp-fileupload') ||
|
||||||
|
$(this).data('fileupload');
|
||||||
|
that._resetFinishedDeferreds();
|
||||||
|
that._transition($(this).find('.fileupload-progress')).done(
|
||||||
|
function () {
|
||||||
|
that._trigger('started', e);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
// Callback for uploads stop, equivalent to the global ajaxStop event:
|
||||||
|
stop: function (e) {
|
||||||
|
var that = $(this).data('blueimp-fileupload') ||
|
||||||
|
$(this).data('fileupload'),
|
||||||
|
deferred = that._addFinishedDeferreds();
|
||||||
|
$.when.apply($, that._getFinishedDeferreds())
|
||||||
|
.done(function () {
|
||||||
|
that._trigger('stopped', e);
|
||||||
|
});
|
||||||
|
that._transition($(this).find('.fileupload-progress')).done(
|
||||||
|
function () {
|
||||||
|
$(this).find('.progress')
|
||||||
|
.attr('aria-valuenow', '0')
|
||||||
|
.find('.bar').css('width', '0%');
|
||||||
|
$(this).find('.progress-extended').html(' ');
|
||||||
|
deferred.resolve();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
// Callback for file deletion:
|
||||||
|
destroy: function (e, data) {
|
||||||
|
var that = $(this).data('blueimp-fileupload') ||
|
||||||
|
$(this).data('fileupload');
|
||||||
|
if (data.url) {
|
||||||
|
$.ajax(data);
|
||||||
|
that._adjustMaxNumberOfFiles(1);
|
||||||
|
}
|
||||||
|
that._transition(data.context).done(
|
||||||
|
function () {
|
||||||
|
$(this).remove();
|
||||||
|
that._trigger('destroyed', e, data);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_resetFinishedDeferreds: function () {
|
||||||
|
this._finishedUploads = [];
|
||||||
|
},
|
||||||
|
|
||||||
|
_addFinishedDeferreds: function (deferred) {
|
||||||
|
if (!deferred) {
|
||||||
|
deferred = $.Deferred();
|
||||||
|
}
|
||||||
|
this._finishedUploads.push(deferred);
|
||||||
|
return deferred;
|
||||||
|
},
|
||||||
|
|
||||||
|
_getFinishedDeferreds: function () {
|
||||||
|
return this._finishedUploads;
|
||||||
|
},
|
||||||
|
|
||||||
|
_getFilesFromResponse: function (data) {
|
||||||
|
if (data.result && $.isArray(data.result.files)) {
|
||||||
|
return data.result.files;
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
},
|
||||||
|
|
||||||
|
// Link handler, that allows to download files
|
||||||
|
// by drag & drop of the links to the desktop:
|
||||||
|
_enableDragToDesktop: function () {
|
||||||
|
var link = $(this),
|
||||||
|
url = link.prop('href'),
|
||||||
|
name = link.prop('download'),
|
||||||
|
type = 'application/octet-stream';
|
||||||
|
link.bind('dragstart', function (e) {
|
||||||
|
try {
|
||||||
|
e.originalEvent.dataTransfer.setData(
|
||||||
|
'DownloadURL',
|
||||||
|
[type, name, url].join(':')
|
||||||
|
);
|
||||||
|
} catch (err) {}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
_adjustMaxNumberOfFiles: function (operand) {
|
||||||
|
if (typeof this.options.maxNumberOfFiles === 'number') {
|
||||||
|
this.options.maxNumberOfFiles += operand;
|
||||||
|
if (this.options.maxNumberOfFiles < 1) {
|
||||||
|
this._disableFileInputButton();
|
||||||
|
} else {
|
||||||
|
this._enableFileInputButton();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_formatFileSize: function (bytes) {
|
||||||
|
if (typeof bytes !== 'number') {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
if (bytes >= 1000000000) {
|
||||||
|
return (bytes / 1000000000).toFixed(2) + ' GB';
|
||||||
|
}
|
||||||
|
if (bytes >= 1000000) {
|
||||||
|
return (bytes / 1000000).toFixed(2) + ' MB';
|
||||||
|
}
|
||||||
|
return (bytes / 1000).toFixed(2) + ' KB';
|
||||||
|
},
|
||||||
|
|
||||||
|
_formatBitrate: function (bits) {
|
||||||
|
if (typeof bits !== 'number') {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
if (bits >= 1000000000) {
|
||||||
|
return (bits / 1000000000).toFixed(2) + ' Gbit/s';
|
||||||
|
}
|
||||||
|
if (bits >= 1000000) {
|
||||||
|
return (bits / 1000000).toFixed(2) + ' Mbit/s';
|
||||||
|
}
|
||||||
|
if (bits >= 1000) {
|
||||||
|
return (bits / 1000).toFixed(2) + ' kbit/s';
|
||||||
|
}
|
||||||
|
return bits.toFixed(2) + ' bit/s';
|
||||||
|
},
|
||||||
|
|
||||||
|
_formatTime: function (seconds) {
|
||||||
|
var date = new Date(seconds * 1000),
|
||||||
|
days = parseInt(seconds / 86400, 10);
|
||||||
|
days = days ? days + 'd ' : '';
|
||||||
|
return days +
|
||||||
|
('0' + date.getUTCHours()).slice(-2) + ':' +
|
||||||
|
('0' + date.getUTCMinutes()).slice(-2) + ':' +
|
||||||
|
('0' + date.getUTCSeconds()).slice(-2);
|
||||||
|
},
|
||||||
|
|
||||||
|
_formatPercentage: function (floatValue) {
|
||||||
|
return (floatValue * 100).toFixed(2) + ' %';
|
||||||
|
},
|
||||||
|
|
||||||
|
_renderExtendedProgress: function (data) {
|
||||||
|
return this._formatBitrate(data.bitrate) + ' | ' +
|
||||||
|
this._formatTime(
|
||||||
|
(data.total - data.loaded) * 8 / data.bitrate
|
||||||
|
) + ' | ' +
|
||||||
|
this._formatPercentage(
|
||||||
|
data.loaded / data.total
|
||||||
|
) + ' | ' +
|
||||||
|
this._formatFileSize(data.loaded) + ' / ' +
|
||||||
|
this._formatFileSize(data.total);
|
||||||
|
},
|
||||||
|
|
||||||
|
_hasError: function (file) {
|
||||||
|
if (file.error) {
|
||||||
|
return file.error;
|
||||||
|
}
|
||||||
|
// The number of added files is subtracted from
|
||||||
|
// maxNumberOfFiles before validation, so we check if
|
||||||
|
// maxNumberOfFiles is below 0 (instead of below 1):
|
||||||
|
if (this.options.maxNumberOfFiles < 0) {
|
||||||
|
return 'Maximum number of files exceeded';
|
||||||
|
}
|
||||||
|
// Files are accepted if either the file type or the file name
|
||||||
|
// matches against the acceptFileTypes regular expression, as
|
||||||
|
// only browsers with support for the File API report the type:
|
||||||
|
if (!(this.options.acceptFileTypes.test(file.type) ||
|
||||||
|
this.options.acceptFileTypes.test(file.name))) {
|
||||||
|
return 'Filetype not allowed';
|
||||||
|
}
|
||||||
|
if (this.options.maxFileSize &&
|
||||||
|
file.size > this.options.maxFileSize) {
|
||||||
|
return 'File is too big';
|
||||||
|
}
|
||||||
|
if (typeof file.size === 'number' &&
|
||||||
|
file.size < this.options.minFileSize) {
|
||||||
|
return 'File is too small';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
|
||||||
|
_validate: function (files) {
|
||||||
|
var that = this,
|
||||||
|
valid = !!files.length;
|
||||||
|
$.each(files, function (index, file) {
|
||||||
|
file.error = that._hasError(file);
|
||||||
|
if (file.error) {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return valid;
|
||||||
|
},
|
||||||
|
|
||||||
|
_renderTemplate: function (func, files) {
|
||||||
|
if (!func) {
|
||||||
|
return $();
|
||||||
|
}
|
||||||
|
var result = func({
|
||||||
|
files: files,
|
||||||
|
formatFileSize: this._formatFileSize,
|
||||||
|
options: this.options
|
||||||
|
});
|
||||||
|
if (result instanceof $) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return $(this.options.templatesContainer).html(result).children();
|
||||||
|
},
|
||||||
|
|
||||||
|
_renderPreview: function (file, node) {
|
||||||
|
var that = this,
|
||||||
|
options = this.options,
|
||||||
|
dfd = $.Deferred();
|
||||||
|
return ((loadImage && loadImage(
|
||||||
|
file,
|
||||||
|
function (img) {
|
||||||
|
node.append(img);
|
||||||
|
that._forceReflow(node);
|
||||||
|
that._transition(node).done(function () {
|
||||||
|
dfd.resolveWith(node);
|
||||||
|
});
|
||||||
|
if (!$.contains(that.document[0].body, node[0])) {
|
||||||
|
// If the element is not part of the DOM,
|
||||||
|
// transition events are not triggered,
|
||||||
|
// so we have to resolve manually:
|
||||||
|
dfd.resolveWith(node);
|
||||||
|
}
|
||||||
|
node.on('remove', function () {
|
||||||
|
// If the element is removed before the
|
||||||
|
// transition finishes, transition events are
|
||||||
|
// not triggered, resolve manually:
|
||||||
|
dfd.resolveWith(node);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
{
|
||||||
|
maxWidth: options.previewMaxWidth,
|
||||||
|
maxHeight: options.previewMaxHeight,
|
||||||
|
canvas: options.previewAsCanvas
|
||||||
|
}
|
||||||
|
)) || dfd.resolveWith(node)) && dfd;
|
||||||
|
},
|
||||||
|
|
||||||
|
_renderPreviews: function (data) {
|
||||||
|
var that = this,
|
||||||
|
options = this.options;
|
||||||
|
data.context.find('.preview span').each(function (index, element) {
|
||||||
|
var file = data.files[index];
|
||||||
|
if (options.previewSourceFileTypes.test(file.type) &&
|
||||||
|
($.type(options.previewSourceMaxFileSize) !== 'number' ||
|
||||||
|
file.size < options.previewSourceMaxFileSize)) {
|
||||||
|
that._processingQueue = that._processingQueue.pipe(function () {
|
||||||
|
var dfd = $.Deferred(),
|
||||||
|
ev = $.Event('previewdone', {
|
||||||
|
target: element
|
||||||
|
});
|
||||||
|
that._renderPreview(file, $(element)).done(
|
||||||
|
function () {
|
||||||
|
that._trigger(ev.type, ev, data);
|
||||||
|
dfd.resolveWith(that);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return dfd.promise();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return this._processingQueue;
|
||||||
|
},
|
||||||
|
|
||||||
|
_renderUpload: function (files) {
|
||||||
|
return this._renderTemplate(
|
||||||
|
this.options.uploadTemplate,
|
||||||
|
files
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
_renderDownload: function (files) {
|
||||||
|
return this._renderTemplate(
|
||||||
|
this.options.downloadTemplate,
|
||||||
|
files
|
||||||
|
).find('a[download]').each(this._enableDragToDesktop).end();
|
||||||
|
},
|
||||||
|
|
||||||
|
_startHandler: function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var button = $(e.currentTarget),
|
||||||
|
template = button.closest('.template-upload'),
|
||||||
|
data = template.data('data');
|
||||||
|
if (data && data.submit && !data.jqXHR && data.submit()) {
|
||||||
|
button.prop('disabled', true);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_cancelHandler: function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var template = $(e.currentTarget).closest('.template-upload'),
|
||||||
|
data = template.data('data') || {};
|
||||||
|
if (!data.jqXHR) {
|
||||||
|
data.errorThrown = 'abort';
|
||||||
|
this._trigger('fail', e, data);
|
||||||
|
} else {
|
||||||
|
data.jqXHR.abort();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_deleteHandler: function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var button = $(e.currentTarget);
|
||||||
|
this._trigger('destroy', e, $.extend({
|
||||||
|
context: button.closest('.template-download'),
|
||||||
|
type: 'DELETE',
|
||||||
|
dataType: this.options.dataType
|
||||||
|
}, button.data()));
|
||||||
|
$('.files').checkListLength({
|
||||||
|
onlyOne: 1,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
_forceReflow: function (node) {
|
||||||
|
return $.support.transition && node.length &&
|
||||||
|
node[0].offsetWidth;
|
||||||
|
},
|
||||||
|
|
||||||
|
_transition: function (node) {
|
||||||
|
var dfd = $.Deferred();
|
||||||
|
if ($.support.transition && node.hasClass('fade') && node.is(':visible')) {
|
||||||
|
node.bind(
|
||||||
|
$.support.transition.end,
|
||||||
|
function (e) {
|
||||||
|
// Make sure we don't respond to other transitions events
|
||||||
|
// in the container element, e.g. from button elements:
|
||||||
|
if (e.target === node[0]) {
|
||||||
|
node.unbind($.support.transition.end);
|
||||||
|
dfd.resolveWith(node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
).toggleClass('in');
|
||||||
|
} else {
|
||||||
|
node.toggleClass('in');
|
||||||
|
dfd.resolveWith(node);
|
||||||
|
}
|
||||||
|
return dfd;
|
||||||
|
},
|
||||||
|
|
||||||
|
_initButtonBarEventHandlers: function () {
|
||||||
|
var fileUploadButtonBar = this.element.find('.fileupload-buttonbar'),
|
||||||
|
filesList = this.options.filesContainer;
|
||||||
|
this._on(fileUploadButtonBar.find('.start'), {
|
||||||
|
click: function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
filesList.find('.start').click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this._on(fileUploadButtonBar.find('.cancel'), {
|
||||||
|
click: function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
filesList.find('.cancel').click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this._on(fileUploadButtonBar.find('.delete'), {
|
||||||
|
click: function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
filesList.find('.toggle:checked')
|
||||||
|
.closest('.template-download')
|
||||||
|
.find('.delete').click();
|
||||||
|
fileUploadButtonBar.find('.toggle')
|
||||||
|
.prop('checked', false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this._on(fileUploadButtonBar.find('.toggle'), {
|
||||||
|
change: function (e) {
|
||||||
|
filesList.find('.toggle').prop(
|
||||||
|
'checked',
|
||||||
|
$(e.currentTarget).is(':checked')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
_destroyButtonBarEventHandlers: function () {
|
||||||
|
this._off(
|
||||||
|
this.element.find('.fileupload-buttonbar')
|
||||||
|
.find('.start, .cancel, .delete'),
|
||||||
|
'click'
|
||||||
|
);
|
||||||
|
this._off(
|
||||||
|
this.element.find('.fileupload-buttonbar .toggle'),
|
||||||
|
'change.'
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
_initEventHandlers: function () {
|
||||||
|
this._super();
|
||||||
|
this._on(this.options.filesContainer, {
|
||||||
|
'click .start': this._startHandler,
|
||||||
|
'click .cancel': this._cancelHandler,
|
||||||
|
'click .delete': this._deleteHandler
|
||||||
|
});
|
||||||
|
this._initButtonBarEventHandlers();
|
||||||
|
},
|
||||||
|
|
||||||
|
_destroyEventHandlers: function () {
|
||||||
|
this._destroyButtonBarEventHandlers();
|
||||||
|
this._off(this.options.filesContainer, 'click');
|
||||||
|
this._super();
|
||||||
|
},
|
||||||
|
|
||||||
|
_enableFileInputButton: function () {
|
||||||
|
this.element.find('.fileinput-button input')
|
||||||
|
.prop('disabled', false)
|
||||||
|
.parent().removeClass('disabled');
|
||||||
|
},
|
||||||
|
|
||||||
|
_disableFileInputButton: function () {
|
||||||
|
this.element.find('.fileinput-button input')
|
||||||
|
.prop('disabled', true)
|
||||||
|
.parent().addClass('disabled');
|
||||||
|
},
|
||||||
|
|
||||||
|
_initTemplates: function () {
|
||||||
|
var options = this.options;
|
||||||
|
options.templatesContainer = this.document[0].createElement(
|
||||||
|
options.filesContainer.prop('nodeName')
|
||||||
|
);
|
||||||
|
if (tmpl) {
|
||||||
|
if (options.uploadTemplateId) {
|
||||||
|
options.uploadTemplate = tmpl(options.uploadTemplateId);
|
||||||
|
}
|
||||||
|
if (options.downloadTemplateId) {
|
||||||
|
options.downloadTemplate = tmpl(options.downloadTemplateId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_initFilesContainer: function () {
|
||||||
|
var options = this.options;
|
||||||
|
if (options.filesContainer === undefined) {
|
||||||
|
options.filesContainer = this.element.find('.files');
|
||||||
|
} else if (!(options.filesContainer instanceof $)) {
|
||||||
|
options.filesContainer = $(options.filesContainer);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_stringToRegExp: function (str) {
|
||||||
|
var parts = str.split('/'),
|
||||||
|
modifiers = parts.pop();
|
||||||
|
parts.shift();
|
||||||
|
return new RegExp(parts.join('/'), modifiers);
|
||||||
|
},
|
||||||
|
|
||||||
|
_initRegExpOptions: function () {
|
||||||
|
var options = this.options;
|
||||||
|
if ($.type(options.acceptFileTypes) === 'string') {
|
||||||
|
options.acceptFileTypes = this._stringToRegExp(
|
||||||
|
options.acceptFileTypes
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if ($.type(options.previewSourceFileTypes) === 'string') {
|
||||||
|
options.previewSourceFileTypes = this._stringToRegExp(
|
||||||
|
options.previewSourceFileTypes
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_initSpecialOptions: function () {
|
||||||
|
this._super();
|
||||||
|
this._initFilesContainer();
|
||||||
|
this._initTemplates();
|
||||||
|
this._initRegExpOptions();
|
||||||
|
},
|
||||||
|
|
||||||
|
_setOption: function (key, value) {
|
||||||
|
this._super(key, value);
|
||||||
|
if (key === 'maxNumberOfFiles') {
|
||||||
|
this._adjustMaxNumberOfFiles(0);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_create: function () {
|
||||||
|
this._super();
|
||||||
|
this._refreshOptionsList.push(
|
||||||
|
'filesContainer',
|
||||||
|
'uploadTemplateId',
|
||||||
|
'downloadTemplateId'
|
||||||
|
);
|
||||||
|
if (!this._processingQueue) {
|
||||||
|
this._processingQueue = $.Deferred().resolveWith(this).promise();
|
||||||
|
this.process = function () {
|
||||||
|
return this._processingQueue;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
this._resetFinishedDeferreds();
|
||||||
|
},
|
||||||
|
|
||||||
|
enable: function () {
|
||||||
|
var wasDisabled = false;
|
||||||
|
if (this.options.disabled) {
|
||||||
|
wasDisabled = true;
|
||||||
|
}
|
||||||
|
this._super();
|
||||||
|
if (wasDisabled) {
|
||||||
|
this.element.find('input, button').prop('disabled', false);
|
||||||
|
this._enableFileInputButton();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
disable: function () {
|
||||||
|
if (!this.options.disabled) {
|
||||||
|
this.element.find('input, button').prop('disabled', true);
|
||||||
|
this._disableFileInputButton();
|
||||||
|
}
|
||||||
|
this._super();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}));
|
1149
vendor/built_in_modules/gallery/app/assets/javascripts/file-upload/jquery.fileupload.js
vendored
Normal file
1149
vendor/built_in_modules/gallery/app/assets/javascripts/file-upload/jquery.fileupload.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -1,18 +1,27 @@
|
||||||
/*
|
/*
|
||||||
* jQuery Iframe Transport Plugin 1.2.3
|
* jQuery Iframe Transport Plugin 1.6.1
|
||||||
* https://github.com/blueimp/jQuery-File-Upload
|
* https://github.com/blueimp/jQuery-File-Upload
|
||||||
*
|
*
|
||||||
* Copyright 2011, Sebastian Tschan
|
* Copyright 2011, Sebastian Tschan
|
||||||
* https://blueimp.net
|
* https://blueimp.net
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license:
|
* Licensed under the MIT license:
|
||||||
* http://creativecommons.org/licenses/MIT/
|
* http://www.opensource.org/licenses/MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*jslint unparam: true */
|
/*jslint unparam: true, nomen: true */
|
||||||
/*global jQuery */
|
/*global define, window, document */
|
||||||
|
|
||||||
(function ($) {
|
(function (factory) {
|
||||||
|
'use strict';
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// Register as an anonymous AMD module:
|
||||||
|
define(['jquery'], factory);
|
||||||
|
} else {
|
||||||
|
// Browser globals:
|
||||||
|
factory(window.jQuery);
|
||||||
|
}
|
||||||
|
}(function ($) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// Helper variable to create unique names for the transport iframes:
|
// Helper variable to create unique names for the transport iframes:
|
||||||
|
@ -21,17 +30,32 @@
|
||||||
// The iframe transport accepts three additional options:
|
// The iframe transport accepts three additional options:
|
||||||
// options.fileInput: a jQuery collection of file input fields
|
// options.fileInput: a jQuery collection of file input fields
|
||||||
// options.paramName: the parameter name for the file form data,
|
// options.paramName: the parameter name for the file form data,
|
||||||
// overrides the name property of the file input field(s)
|
// overrides the name property of the file input field(s),
|
||||||
|
// can be a string or an array of strings.
|
||||||
// options.formData: an array of objects with name and value properties,
|
// options.formData: an array of objects with name and value properties,
|
||||||
// equivalent to the return data of .serializeArray(), e.g.:
|
// equivalent to the return data of .serializeArray(), e.g.:
|
||||||
// [{name: a, value: 1}, {name: b, value: 2}]
|
// [{name: 'a', value: 1}, {name: 'b', value: 2}]
|
||||||
$.ajaxTransport('iframe', function (options, originalOptions, jqXHR) {
|
$.ajaxTransport('iframe', function (options) {
|
||||||
if (options.type === 'POST' || options.type === 'GET') {
|
if (options.async) {
|
||||||
var form,
|
var form,
|
||||||
iframe;
|
iframe,
|
||||||
|
addParamChar;
|
||||||
return {
|
return {
|
||||||
send: function (headers, completeCallback) {
|
send: function (_, completeCallback) {
|
||||||
form = $('<form style="display:none;"></form>');
|
form = $('<form style="display:none;"></form>');
|
||||||
|
form.attr('accept-charset', options.formAcceptCharset);
|
||||||
|
addParamChar = /\?/.test(options.url) ? '&' : '?';
|
||||||
|
// XDomainRequest only supports GET and POST:
|
||||||
|
if (options.type === 'DELETE') {
|
||||||
|
options.url = options.url + addParamChar + '_method=DELETE';
|
||||||
|
options.type = 'POST';
|
||||||
|
} else if (options.type === 'PUT') {
|
||||||
|
options.url = options.url + addParamChar + '_method=PUT';
|
||||||
|
options.type = 'POST';
|
||||||
|
} else if (options.type === 'PATCH') {
|
||||||
|
options.url = options.url + addParamChar + '_method=PATCH';
|
||||||
|
options.type = 'POST';
|
||||||
|
}
|
||||||
// javascript:false as initial iframe src
|
// javascript:false as initial iframe src
|
||||||
// prevents warning popups on HTTPS in IE6.
|
// prevents warning popups on HTTPS in IE6.
|
||||||
// IE versions below IE8 cannot set the name property of
|
// IE versions below IE8 cannot set the name property of
|
||||||
|
@ -41,7 +65,9 @@
|
||||||
'<iframe src="javascript:false;" name="iframe-transport-' +
|
'<iframe src="javascript:false;" name="iframe-transport-' +
|
||||||
(counter += 1) + '"></iframe>'
|
(counter += 1) + '"></iframe>'
|
||||||
).bind('load', function () {
|
).bind('load', function () {
|
||||||
var fileInputClones;
|
var fileInputClones,
|
||||||
|
paramNames = $.isArray(options.paramName) ?
|
||||||
|
options.paramName : [options.paramName];
|
||||||
iframe
|
iframe
|
||||||
.unbind('load')
|
.unbind('load')
|
||||||
.bind('load', function () {
|
.bind('load', function () {
|
||||||
|
@ -92,8 +118,11 @@
|
||||||
return fileInputClones[index];
|
return fileInputClones[index];
|
||||||
});
|
});
|
||||||
if (options.paramName) {
|
if (options.paramName) {
|
||||||
options.fileInput.each(function () {
|
options.fileInput.each(function (index) {
|
||||||
$(this).prop('name', options.paramName);
|
$(this).prop(
|
||||||
|
'name',
|
||||||
|
paramNames[index] || options.paramName
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Appending the file input fields to the hidden form
|
// Appending the file input fields to the hidden form
|
||||||
|
@ -115,7 +144,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
form.append(iframe).appendTo('body');
|
form.append(iframe).appendTo(document.body);
|
||||||
},
|
},
|
||||||
abort: function () {
|
abort: function () {
|
||||||
if (iframe) {
|
if (iframe) {
|
||||||
|
@ -139,18 +168,18 @@
|
||||||
$.ajaxSetup({
|
$.ajaxSetup({
|
||||||
converters: {
|
converters: {
|
||||||
'iframe text': function (iframe) {
|
'iframe text': function (iframe) {
|
||||||
return iframe.find('body').text();
|
return iframe && $(iframe[0].body).text();
|
||||||
},
|
},
|
||||||
'iframe json': function (iframe) {
|
'iframe json': function (iframe) {
|
||||||
return $.parseJSON(iframe.find('body').text());
|
return iframe && $.parseJSON($(iframe[0].body).text());
|
||||||
},
|
},
|
||||||
'iframe html': function (iframe) {
|
'iframe html': function (iframe) {
|
||||||
return iframe.find('body').html();
|
return iframe && $(iframe[0].body).html();
|
||||||
},
|
},
|
||||||
'iframe script': function (iframe) {
|
'iframe script': function (iframe) {
|
||||||
return $.globalEval(iframe.find('body').text());
|
return iframe && $.globalEval($(iframe[0].body).text());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}(jQuery));
|
}));
|
1
vendor/built_in_modules/gallery/app/assets/javascripts/file-upload/load-image.min.js
vendored
Normal file
1
vendor/built_in_modules/gallery/app/assets/javascripts/file-upload/load-image.min.js
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
(function(e){"use strict";var t=function(e,a,n){var r,i,c=document.createElement("img");if(c.onerror=a,c.onload=function(){!i||n&&n.noRevoke||t.revokeObjectURL(i),a&&a(t.scale(c,n))},t.isInstanceOf("Blob",e)||t.isInstanceOf("File",e))r=i=t.createObjectURL(e),c._type=e.type;else{if("string"!=typeof e)return!1;r=e,n&&n.crossOrigin&&(c.crossOrigin=n.crossOrigin)}return r?(c.src=r,c):t.readFile(e,function(e){var t=e.target;t&&t.result?c.src=t.result:a&&a(e)})},a=window.createObjectURL&&window||window.URL&&URL.revokeObjectURL&&URL||window.webkitURL&&webkitURL;t.isInstanceOf=function(e,t){return Object.prototype.toString.call(t)==="[object "+e+"]"},t.detectSubsampling=function(e){var t,a,n=e.width,r=e.height;return n*r>1048576?(t=document.createElement("canvas"),t.width=t.height=1,a=t.getContext("2d"),a.drawImage(e,-n+1,0),0===a.getImageData(0,0,1,1).data[3]):!1},t.detectVerticalSquash=function(e,t){var a,n,r,i,c,o=document.createElement("canvas"),d=o.getContext("2d");for(o.width=1,o.height=t,d.drawImage(e,0,0),a=d.getImageData(0,0,1,t).data,n=0,r=t,i=t;i>n;)c=a[4*(i-1)+3],0===c?r=i:n=i,i=r+n>>1;return i/t||1},t.renderImageToCanvas=function(e,a,n,r){var i,c,o,d,g,h,s,u,l=e.width,m=e.height,f=a.getContext("2d"),w=1024,v=document.createElement("canvas");for(f.save(),t.detectSubsampling(e)&&(l/=2,m/=2),i=t.detectVerticalSquash(e,m),v.width=v.height=w,c=v.getContext("2d"),o=Math.ceil(w*n/l),d=Math.ceil(w*r/m/i),h=0,u=0;m>u;){for(g=0,s=0;l>s;)c.clearRect(0,0,w,w),c.drawImage(e,-s,-u),f.drawImage(v,0,0,w,w,g,h,o,d),s+=w,g+=o;u+=w,h+=d}f.restore(),v=c=null},t.scale=function(e,a){a=a||{};var n=document.createElement("canvas"),r=e.width,i=e.height,c=Math.max((a.minWidth||r)/r,(a.minHeight||i)/i);return c>1&&(r=Math.ceil(r*c),i=Math.ceil(i*c)),c=Math.min((a.maxWidth||r)/r,(a.maxHeight||i)/i),1>c&&(r=Math.ceil(r*c),i=Math.ceil(i*c)),e.getContext||a.canvas&&n.getContext?(n.width=r,n.height=i,"image/jpeg"===e._type?t.renderImageToCanvas(e,n,r,i):n.getContext("2d").drawImage(e,0,0,r,i),n):(e.width=r,e.height=i,e)},t.createObjectURL=function(e){return a?a.createObjectURL(e):!1},t.revokeObjectURL=function(e){return a?a.revokeObjectURL(e):!1},t.readFile=function(e,t){if(window.FileReader&&FileReader.prototype.readAsDataURL){var a=new FileReader;return a.onload=a.onerror=t,a.readAsDataURL(e),a}return!1},"function"==typeof define&&define.amd?define(function(){return t}):e.loadImage=t})(this);
|
|
@ -0,0 +1,13 @@
|
||||||
|
//https://github.com/blueimp/jQuery-File-Upload
|
||||||
|
$(function () {
|
||||||
|
'use strict';
|
||||||
|
// Initialize the jQuery File Upload widget:
|
||||||
|
$('#fileupload').fileupload({
|
||||||
|
maxFileSize: 5000000,
|
||||||
|
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
|
||||||
|
dropZone: $('#dropzone'),
|
||||||
|
headers:{
|
||||||
|
'X-CSRF-Token': $('meta[name="csrf-token"]').attr("content")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
1
vendor/built_in_modules/gallery/app/assets/javascripts/file-upload/tmpl.min.js
vendored
Normal file
1
vendor/built_in_modules/gallery/app/assets/javascripts/file-upload/tmpl.min.js
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
(function(a){"use strict";var b=function(a,c){var d=/[^\w\-\.:]/.test(a)?new Function(b.arg+",tmpl","var _e=tmpl.encode"+b.helper+",_s='"+a.replace(b.regexp,b.func)+"';return _s;"):b.cache[a]=b.cache[a]||b(b.load(a));return c?d(c,b):function(a){return d(a,b)}};b.cache={},b.load=function(a){return document.getElementById(a).innerHTML},b.regexp=/([\s'\\])(?![^%]*%\})|(?:\{%(=|#)([\s\S]+?)%\})|(\{%)|(%\})/g,b.func=function(a,b,c,d,e,f){if(b)return{"\n":"\\n","\r":"\\r","\t":"\\t"," ":" "}[a]||"\\"+a;if(c)return c==="="?"'+_e("+d+")+'":"'+("+d+"||'')+'";if(e)return"';";if(f)return"_s+='"},b.encReg=/[<>&"'\x00]/g,b.encMap={"<":"<",">":">","&":"&",'"':""","'":"'"},b.encode=function(a){return String(a||"").replace(b.encReg,function(a){return b.encMap[a]||""})},b.arg="o",b.helper=",print=function(s,e){_s+=e&&(s||'')||_e(s);},include=function(s,d){_s+=tmpl(s,d);}",typeof define=="function"&&define.amd?define(function(){return b}):a.tmpl=b})(this);
|
530
vendor/built_in_modules/gallery/app/assets/javascripts/file-upload/vendor/jquery.ui.widget.js
vendored
Normal file
530
vendor/built_in_modules/gallery/app/assets/javascripts/file-upload/vendor/jquery.ui.widget.js
vendored
Normal file
|
@ -0,0 +1,530 @@
|
||||||
|
/*
|
||||||
|
* jQuery UI Widget 1.10.1+amd
|
||||||
|
* https://github.com/blueimp/jQuery-File-Upload
|
||||||
|
*
|
||||||
|
* Copyright 2013 jQuery Foundation and other contributors
|
||||||
|
* Released under the MIT license.
|
||||||
|
* http://jquery.org/license
|
||||||
|
*
|
||||||
|
* http://api.jqueryui.com/jQuery.widget/
|
||||||
|
*/
|
||||||
|
|
||||||
|
(function (factory) {
|
||||||
|
if (typeof define === "function" && define.amd) {
|
||||||
|
// Register as an anonymous AMD module:
|
||||||
|
define(["jquery"], factory);
|
||||||
|
} else {
|
||||||
|
// Browser globals:
|
||||||
|
factory(jQuery);
|
||||||
|
}
|
||||||
|
}(function( $, undefined ) {
|
||||||
|
|
||||||
|
var uuid = 0,
|
||||||
|
slice = Array.prototype.slice,
|
||||||
|
_cleanData = $.cleanData;
|
||||||
|
$.cleanData = function( elems ) {
|
||||||
|
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
|
||||||
|
try {
|
||||||
|
$( elem ).triggerHandler( "remove" );
|
||||||
|
// http://bugs.jquery.com/ticket/8235
|
||||||
|
} catch( e ) {}
|
||||||
|
}
|
||||||
|
_cleanData( elems );
|
||||||
|
};
|
||||||
|
|
||||||
|
$.widget = function( name, base, prototype ) {
|
||||||
|
var fullName, existingConstructor, constructor, basePrototype,
|
||||||
|
// proxiedPrototype allows the provided prototype to remain unmodified
|
||||||
|
// so that it can be used as a mixin for multiple widgets (#8876)
|
||||||
|
proxiedPrototype = {},
|
||||||
|
namespace = name.split( "." )[ 0 ];
|
||||||
|
|
||||||
|
name = name.split( "." )[ 1 ];
|
||||||
|
fullName = namespace + "-" + name;
|
||||||
|
|
||||||
|
if ( !prototype ) {
|
||||||
|
prototype = base;
|
||||||
|
base = $.Widget;
|
||||||
|
}
|
||||||
|
|
||||||
|
// create selector for plugin
|
||||||
|
$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
|
||||||
|
return !!$.data( elem, fullName );
|
||||||
|
};
|
||||||
|
|
||||||
|
$[ namespace ] = $[ namespace ] || {};
|
||||||
|
existingConstructor = $[ namespace ][ name ];
|
||||||
|
constructor = $[ namespace ][ name ] = function( options, element ) {
|
||||||
|
// allow instantiation without "new" keyword
|
||||||
|
if ( !this._createWidget ) {
|
||||||
|
return new constructor( options, element );
|
||||||
|
}
|
||||||
|
|
||||||
|
// allow instantiation without initializing for simple inheritance
|
||||||
|
// must use "new" keyword (the code above always passes args)
|
||||||
|
if ( arguments.length ) {
|
||||||
|
this._createWidget( options, element );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// extend with the existing constructor to carry over any static properties
|
||||||
|
$.extend( constructor, existingConstructor, {
|
||||||
|
version: prototype.version,
|
||||||
|
// copy the object used to create the prototype in case we need to
|
||||||
|
// redefine the widget later
|
||||||
|
_proto: $.extend( {}, prototype ),
|
||||||
|
// track widgets that inherit from this widget in case this widget is
|
||||||
|
// redefined after a widget inherits from it
|
||||||
|
_childConstructors: []
|
||||||
|
});
|
||||||
|
|
||||||
|
basePrototype = new base();
|
||||||
|
// we need to make the options hash a property directly on the new instance
|
||||||
|
// otherwise we'll modify the options hash on the prototype that we're
|
||||||
|
// inheriting from
|
||||||
|
basePrototype.options = $.widget.extend( {}, basePrototype.options );
|
||||||
|
$.each( prototype, function( prop, value ) {
|
||||||
|
if ( !$.isFunction( value ) ) {
|
||||||
|
proxiedPrototype[ prop ] = value;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
proxiedPrototype[ prop ] = (function() {
|
||||||
|
var _super = function() {
|
||||||
|
return base.prototype[ prop ].apply( this, arguments );
|
||||||
|
},
|
||||||
|
_superApply = function( args ) {
|
||||||
|
return base.prototype[ prop ].apply( this, args );
|
||||||
|
};
|
||||||
|
return function() {
|
||||||
|
var __super = this._super,
|
||||||
|
__superApply = this._superApply,
|
||||||
|
returnValue;
|
||||||
|
|
||||||
|
this._super = _super;
|
||||||
|
this._superApply = _superApply;
|
||||||
|
|
||||||
|
returnValue = value.apply( this, arguments );
|
||||||
|
|
||||||
|
this._super = __super;
|
||||||
|
this._superApply = __superApply;
|
||||||
|
|
||||||
|
return returnValue;
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
});
|
||||||
|
constructor.prototype = $.widget.extend( basePrototype, {
|
||||||
|
// TODO: remove support for widgetEventPrefix
|
||||||
|
// always use the name + a colon as the prefix, e.g., draggable:start
|
||||||
|
// don't prefix for widgets that aren't DOM-based
|
||||||
|
widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix : name
|
||||||
|
}, proxiedPrototype, {
|
||||||
|
constructor: constructor,
|
||||||
|
namespace: namespace,
|
||||||
|
widgetName: name,
|
||||||
|
widgetFullName: fullName
|
||||||
|
});
|
||||||
|
|
||||||
|
// If this widget is being redefined then we need to find all widgets that
|
||||||
|
// are inheriting from it and redefine all of them so that they inherit from
|
||||||
|
// the new version of this widget. We're essentially trying to replace one
|
||||||
|
// level in the prototype chain.
|
||||||
|
if ( existingConstructor ) {
|
||||||
|
$.each( existingConstructor._childConstructors, function( i, child ) {
|
||||||
|
var childPrototype = child.prototype;
|
||||||
|
|
||||||
|
// redefine the child widget using the same prototype that was
|
||||||
|
// originally used, but inherit from the new version of the base
|
||||||
|
$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
|
||||||
|
});
|
||||||
|
// remove the list of existing child constructors from the old constructor
|
||||||
|
// so the old child constructors can be garbage collected
|
||||||
|
delete existingConstructor._childConstructors;
|
||||||
|
} else {
|
||||||
|
base._childConstructors.push( constructor );
|
||||||
|
}
|
||||||
|
|
||||||
|
$.widget.bridge( name, constructor );
|
||||||
|
};
|
||||||
|
|
||||||
|
$.widget.extend = function( target ) {
|
||||||
|
var input = slice.call( arguments, 1 ),
|
||||||
|
inputIndex = 0,
|
||||||
|
inputLength = input.length,
|
||||||
|
key,
|
||||||
|
value;
|
||||||
|
for ( ; inputIndex < inputLength; inputIndex++ ) {
|
||||||
|
for ( key in input[ inputIndex ] ) {
|
||||||
|
value = input[ inputIndex ][ key ];
|
||||||
|
if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
|
||||||
|
// Clone objects
|
||||||
|
if ( $.isPlainObject( value ) ) {
|
||||||
|
target[ key ] = $.isPlainObject( target[ key ] ) ?
|
||||||
|
$.widget.extend( {}, target[ key ], value ) :
|
||||||
|
// Don't extend strings, arrays, etc. with objects
|
||||||
|
$.widget.extend( {}, value );
|
||||||
|
// Copy everything else by reference
|
||||||
|
} else {
|
||||||
|
target[ key ] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return target;
|
||||||
|
};
|
||||||
|
|
||||||
|
$.widget.bridge = function( name, object ) {
|
||||||
|
var fullName = object.prototype.widgetFullName || name;
|
||||||
|
$.fn[ name ] = function( options ) {
|
||||||
|
var isMethodCall = typeof options === "string",
|
||||||
|
args = slice.call( arguments, 1 ),
|
||||||
|
returnValue = this;
|
||||||
|
|
||||||
|
// allow multiple hashes to be passed on init
|
||||||
|
options = !isMethodCall && args.length ?
|
||||||
|
$.widget.extend.apply( null, [ options ].concat(args) ) :
|
||||||
|
options;
|
||||||
|
|
||||||
|
if ( isMethodCall ) {
|
||||||
|
this.each(function() {
|
||||||
|
var methodValue,
|
||||||
|
instance = $.data( this, fullName );
|
||||||
|
if ( !instance ) {
|
||||||
|
return $.error( "cannot call methods on " + name + " prior to initialization; " +
|
||||||
|
"attempted to call method '" + options + "'" );
|
||||||
|
}
|
||||||
|
if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
|
||||||
|
return $.error( "no such method '" + options + "' for " + name + " widget instance" );
|
||||||
|
}
|
||||||
|
methodValue = instance[ options ].apply( instance, args );
|
||||||
|
if ( methodValue !== instance && methodValue !== undefined ) {
|
||||||
|
returnValue = methodValue && methodValue.jquery ?
|
||||||
|
returnValue.pushStack( methodValue.get() ) :
|
||||||
|
methodValue;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.each(function() {
|
||||||
|
var instance = $.data( this, fullName );
|
||||||
|
if ( instance ) {
|
||||||
|
instance.option( options || {} )._init();
|
||||||
|
} else {
|
||||||
|
$.data( this, fullName, new object( options, this ) );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
$.Widget = function( /* options, element */ ) {};
|
||||||
|
$.Widget._childConstructors = [];
|
||||||
|
|
||||||
|
$.Widget.prototype = {
|
||||||
|
widgetName: "widget",
|
||||||
|
widgetEventPrefix: "",
|
||||||
|
defaultElement: "<div>",
|
||||||
|
options: {
|
||||||
|
disabled: false,
|
||||||
|
|
||||||
|
// callbacks
|
||||||
|
create: null
|
||||||
|
},
|
||||||
|
_createWidget: function( options, element ) {
|
||||||
|
element = $( element || this.defaultElement || this )[ 0 ];
|
||||||
|
this.element = $( element );
|
||||||
|
this.uuid = uuid++;
|
||||||
|
this.eventNamespace = "." + this.widgetName + this.uuid;
|
||||||
|
this.options = $.widget.extend( {},
|
||||||
|
this.options,
|
||||||
|
this._getCreateOptions(),
|
||||||
|
options );
|
||||||
|
|
||||||
|
this.bindings = $();
|
||||||
|
this.hoverable = $();
|
||||||
|
this.focusable = $();
|
||||||
|
|
||||||
|
if ( element !== this ) {
|
||||||
|
$.data( element, this.widgetFullName, this );
|
||||||
|
this._on( true, this.element, {
|
||||||
|
remove: function( event ) {
|
||||||
|
if ( event.target === element ) {
|
||||||
|
this.destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.document = $( element.style ?
|
||||||
|
// element within the document
|
||||||
|
element.ownerDocument :
|
||||||
|
// element is window or document
|
||||||
|
element.document || element );
|
||||||
|
this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
|
||||||
|
}
|
||||||
|
|
||||||
|
this._create();
|
||||||
|
this._trigger( "create", null, this._getCreateEventData() );
|
||||||
|
this._init();
|
||||||
|
},
|
||||||
|
_getCreateOptions: $.noop,
|
||||||
|
_getCreateEventData: $.noop,
|
||||||
|
_create: $.noop,
|
||||||
|
_init: $.noop,
|
||||||
|
|
||||||
|
destroy: function() {
|
||||||
|
this._destroy();
|
||||||
|
// we can probably remove the unbind calls in 2.0
|
||||||
|
// all event bindings should go through this._on()
|
||||||
|
this.element
|
||||||
|
.unbind( this.eventNamespace )
|
||||||
|
// 1.9 BC for #7810
|
||||||
|
// TODO remove dual storage
|
||||||
|
.removeData( this.widgetName )
|
||||||
|
.removeData( this.widgetFullName )
|
||||||
|
// support: jquery <1.6.3
|
||||||
|
// http://bugs.jquery.com/ticket/9413
|
||||||
|
.removeData( $.camelCase( this.widgetFullName ) );
|
||||||
|
this.widget()
|
||||||
|
.unbind( this.eventNamespace )
|
||||||
|
.removeAttr( "aria-disabled" )
|
||||||
|
.removeClass(
|
||||||
|
this.widgetFullName + "-disabled " +
|
||||||
|
"ui-state-disabled" );
|
||||||
|
|
||||||
|
// clean up events and states
|
||||||
|
this.bindings.unbind( this.eventNamespace );
|
||||||
|
this.hoverable.removeClass( "ui-state-hover" );
|
||||||
|
this.focusable.removeClass( "ui-state-focus" );
|
||||||
|
},
|
||||||
|
_destroy: $.noop,
|
||||||
|
|
||||||
|
widget: function() {
|
||||||
|
return this.element;
|
||||||
|
},
|
||||||
|
|
||||||
|
option: function( key, value ) {
|
||||||
|
var options = key,
|
||||||
|
parts,
|
||||||
|
curOption,
|
||||||
|
i;
|
||||||
|
|
||||||
|
if ( arguments.length === 0 ) {
|
||||||
|
// don't return a reference to the internal hash
|
||||||
|
return $.widget.extend( {}, this.options );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( typeof key === "string" ) {
|
||||||
|
// handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
|
||||||
|
options = {};
|
||||||
|
parts = key.split( "." );
|
||||||
|
key = parts.shift();
|
||||||
|
if ( parts.length ) {
|
||||||
|
curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
|
||||||
|
for ( i = 0; i < parts.length - 1; i++ ) {
|
||||||
|
curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
|
||||||
|
curOption = curOption[ parts[ i ] ];
|
||||||
|
}
|
||||||
|
key = parts.pop();
|
||||||
|
if ( value === undefined ) {
|
||||||
|
return curOption[ key ] === undefined ? null : curOption[ key ];
|
||||||
|
}
|
||||||
|
curOption[ key ] = value;
|
||||||
|
} else {
|
||||||
|
if ( value === undefined ) {
|
||||||
|
return this.options[ key ] === undefined ? null : this.options[ key ];
|
||||||
|
}
|
||||||
|
options[ key ] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this._setOptions( options );
|
||||||
|
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
_setOptions: function( options ) {
|
||||||
|
var key;
|
||||||
|
|
||||||
|
for ( key in options ) {
|
||||||
|
this._setOption( key, options[ key ] );
|
||||||
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
_setOption: function( key, value ) {
|
||||||
|
this.options[ key ] = value;
|
||||||
|
|
||||||
|
if ( key === "disabled" ) {
|
||||||
|
this.widget()
|
||||||
|
.toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value )
|
||||||
|
.attr( "aria-disabled", value );
|
||||||
|
this.hoverable.removeClass( "ui-state-hover" );
|
||||||
|
this.focusable.removeClass( "ui-state-focus" );
|
||||||
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
|
enable: function() {
|
||||||
|
return this._setOption( "disabled", false );
|
||||||
|
},
|
||||||
|
disable: function() {
|
||||||
|
return this._setOption( "disabled", true );
|
||||||
|
},
|
||||||
|
|
||||||
|
_on: function( suppressDisabledCheck, element, handlers ) {
|
||||||
|
var delegateElement,
|
||||||
|
instance = this;
|
||||||
|
|
||||||
|
// no suppressDisabledCheck flag, shuffle arguments
|
||||||
|
if ( typeof suppressDisabledCheck !== "boolean" ) {
|
||||||
|
handlers = element;
|
||||||
|
element = suppressDisabledCheck;
|
||||||
|
suppressDisabledCheck = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// no element argument, shuffle and use this.element
|
||||||
|
if ( !handlers ) {
|
||||||
|
handlers = element;
|
||||||
|
element = this.element;
|
||||||
|
delegateElement = this.widget();
|
||||||
|
} else {
|
||||||
|
// accept selectors, DOM elements
|
||||||
|
element = delegateElement = $( element );
|
||||||
|
this.bindings = this.bindings.add( element );
|
||||||
|
}
|
||||||
|
|
||||||
|
$.each( handlers, function( event, handler ) {
|
||||||
|
function handlerProxy() {
|
||||||
|
// allow widgets to customize the disabled handling
|
||||||
|
// - disabled as an array instead of boolean
|
||||||
|
// - disabled class as method for disabling individual parts
|
||||||
|
if ( !suppressDisabledCheck &&
|
||||||
|
( instance.options.disabled === true ||
|
||||||
|
$( this ).hasClass( "ui-state-disabled" ) ) ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return ( typeof handler === "string" ? instance[ handler ] : handler )
|
||||||
|
.apply( instance, arguments );
|
||||||
|
}
|
||||||
|
|
||||||
|
// copy the guid so direct unbinding works
|
||||||
|
if ( typeof handler !== "string" ) {
|
||||||
|
handlerProxy.guid = handler.guid =
|
||||||
|
handler.guid || handlerProxy.guid || $.guid++;
|
||||||
|
}
|
||||||
|
|
||||||
|
var match = event.match( /^(\w+)\s*(.*)$/ ),
|
||||||
|
eventName = match[1] + instance.eventNamespace,
|
||||||
|
selector = match[2];
|
||||||
|
if ( selector ) {
|
||||||
|
delegateElement.delegate( selector, eventName, handlerProxy );
|
||||||
|
} else {
|
||||||
|
element.bind( eventName, handlerProxy );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
_off: function( element, eventName ) {
|
||||||
|
eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace;
|
||||||
|
element.unbind( eventName ).undelegate( eventName );
|
||||||
|
},
|
||||||
|
|
||||||
|
_delay: function( handler, delay ) {
|
||||||
|
function handlerProxy() {
|
||||||
|
return ( typeof handler === "string" ? instance[ handler ] : handler )
|
||||||
|
.apply( instance, arguments );
|
||||||
|
}
|
||||||
|
var instance = this;
|
||||||
|
return setTimeout( handlerProxy, delay || 0 );
|
||||||
|
},
|
||||||
|
|
||||||
|
_hoverable: function( element ) {
|
||||||
|
this.hoverable = this.hoverable.add( element );
|
||||||
|
this._on( element, {
|
||||||
|
mouseenter: function( event ) {
|
||||||
|
$( event.currentTarget ).addClass( "ui-state-hover" );
|
||||||
|
},
|
||||||
|
mouseleave: function( event ) {
|
||||||
|
$( event.currentTarget ).removeClass( "ui-state-hover" );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
_focusable: function( element ) {
|
||||||
|
this.focusable = this.focusable.add( element );
|
||||||
|
this._on( element, {
|
||||||
|
focusin: function( event ) {
|
||||||
|
$( event.currentTarget ).addClass( "ui-state-focus" );
|
||||||
|
},
|
||||||
|
focusout: function( event ) {
|
||||||
|
$( event.currentTarget ).removeClass( "ui-state-focus" );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
_trigger: function( type, event, data ) {
|
||||||
|
var prop, orig,
|
||||||
|
callback = this.options[ type ];
|
||||||
|
|
||||||
|
data = data || {};
|
||||||
|
event = $.Event( event );
|
||||||
|
event.type = ( type === this.widgetEventPrefix ?
|
||||||
|
type :
|
||||||
|
this.widgetEventPrefix + type ).toLowerCase();
|
||||||
|
// the original event may come from any element
|
||||||
|
// so we need to reset the target on the new event
|
||||||
|
event.target = this.element[ 0 ];
|
||||||
|
|
||||||
|
// copy original event properties over to the new event
|
||||||
|
orig = event.originalEvent;
|
||||||
|
if ( orig ) {
|
||||||
|
for ( prop in orig ) {
|
||||||
|
if ( !( prop in event ) ) {
|
||||||
|
event[ prop ] = orig[ prop ];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.element.trigger( event, data );
|
||||||
|
return !( $.isFunction( callback ) &&
|
||||||
|
callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
|
||||||
|
event.isDefaultPrevented() );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
|
||||||
|
$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
|
||||||
|
if ( typeof options === "string" ) {
|
||||||
|
options = { effect: options };
|
||||||
|
}
|
||||||
|
var hasOptions,
|
||||||
|
effectName = !options ?
|
||||||
|
method :
|
||||||
|
options === true || typeof options === "number" ?
|
||||||
|
defaultEffect :
|
||||||
|
options.effect || defaultEffect;
|
||||||
|
options = options || {};
|
||||||
|
if ( typeof options === "number" ) {
|
||||||
|
options = { duration: options };
|
||||||
|
}
|
||||||
|
hasOptions = !$.isEmptyObject( options );
|
||||||
|
options.complete = callback;
|
||||||
|
if ( options.delay ) {
|
||||||
|
element.delay( options.delay );
|
||||||
|
}
|
||||||
|
if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
|
||||||
|
element[ method ]( options );
|
||||||
|
} else if ( effectName !== method && element[ effectName ] ) {
|
||||||
|
element[ effectName ]( options.duration, options.easing, callback );
|
||||||
|
} else {
|
||||||
|
element.queue(function( next ) {
|
||||||
|
$( this )[ method ]();
|
||||||
|
if ( callback ) {
|
||||||
|
callback.call( element[ 0 ] );
|
||||||
|
}
|
||||||
|
next();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
}));
|
|
@ -1 +1,105 @@
|
||||||
//= require galleryAPI
|
!function ($) {
|
||||||
|
$.fn.checkListLength = function (param){
|
||||||
|
_defaultSettings = {
|
||||||
|
onlyOne: null,
|
||||||
|
};
|
||||||
|
_set = $.extend(_defaultSettings, param);
|
||||||
|
$this = this;
|
||||||
|
$li = this.children('li');
|
||||||
|
$dropzone = $('#dropzone');
|
||||||
|
if(($li.length - _set.onlyOne) == 0) {
|
||||||
|
$('#dropzone').fadeIn(300);
|
||||||
|
} else {
|
||||||
|
$('#dropzone').fadeOut(300);
|
||||||
|
};
|
||||||
|
$('#file-list').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true });
|
||||||
|
}
|
||||||
|
}(window.jQuery);
|
||||||
|
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
var $container = $('.gallery'),
|
||||||
|
$containerData = $container.data();
|
||||||
|
|
||||||
|
$container.imagesLoaded( function(){
|
||||||
|
var $albumname = $('.albumname'),
|
||||||
|
$img = $('.rgalbum img');
|
||||||
|
$img.muImageResize({width: 200, height:200});
|
||||||
|
if($containerData.galleryId == 'gallery') {
|
||||||
|
$container.masonry({
|
||||||
|
itemSelector : '.rgalbum',
|
||||||
|
isAnimated: true,
|
||||||
|
});
|
||||||
|
$albumname.each(function(i) {
|
||||||
|
var $imgH = $(this).prevAll($img).height(),
|
||||||
|
$H = $(this).height()+20,
|
||||||
|
$fontSize = parseInt($(this).css('font-size'));
|
||||||
|
$lineHeight = parseInt($(this).css('line-height'));
|
||||||
|
if($H > $imgH) {
|
||||||
|
$(this).css({
|
||||||
|
'bottom': "auto",
|
||||||
|
'top': 0,
|
||||||
|
});
|
||||||
|
$(this).hover(function() {
|
||||||
|
$(this).stop(true, true).delay(500).animate({
|
||||||
|
'top': '-='+($H-$imgH),
|
||||||
|
},($H-$imgH)*10)
|
||||||
|
},function() {
|
||||||
|
$(this).stop(true, true);
|
||||||
|
$(this).css({
|
||||||
|
'bottom': "auto",
|
||||||
|
'top': 0,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
});
|
||||||
|
$('#orbit_gallery').delegate('.icons-tag','click',function(){
|
||||||
|
$(this).parents('.gallery_info').nextAll('.albumtag').slideToggle(300, function() {
|
||||||
|
$container.masonry({
|
||||||
|
itemSelector : '.rgalbum',
|
||||||
|
isAnimated: true,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.add-imgs').on({
|
||||||
|
click: function() {
|
||||||
|
$('#fileupload').slideToggle(300, function() {
|
||||||
|
if(!$(this).is(':hidden')) {
|
||||||
|
$('.add-imgs').html('<i class="icons-cross-2"></i> Close panel');
|
||||||
|
$('.rgbody').stop(true, false).animate({'padding-bottom': 280}, 300);
|
||||||
|
} else {
|
||||||
|
$('.add-imgs').html('<i class="icons-plus"></i> Add Image');
|
||||||
|
$('.files').empty()
|
||||||
|
$('#file-list').checkListLength();
|
||||||
|
$('.rgbody').stop(true, false).animate({'padding-bottom': 0}, 300);
|
||||||
|
fetchNewImages();
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var fetchNewImages = function(){
|
||||||
|
var lastid = $("li.rgalbum:last").data("image-id"),
|
||||||
|
albumid = $("#fileupload_aid").val();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url : "/panel/gallery/back_end/new_images",
|
||||||
|
data : {"last_image_id" : lastid, "album_id" : albumid},
|
||||||
|
success : function(data){
|
||||||
|
var $e = $(data);
|
||||||
|
$imgs = $e.find("img");
|
||||||
|
$imgs.muImageResize({width: 200, height:200});
|
||||||
|
$("#imgholder").append($e);
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,211 +10,7 @@ var galleryAPI = function(){
|
||||||
this.albumArea = $("#orbit_gallery");
|
this.albumArea = $("#orbit_gallery");
|
||||||
this.loadArea = null;
|
this.loadArea = null;
|
||||||
this.tagList = $("ul#gallery_tag_list");
|
this.tagList = $("ul#gallery_tag_list");
|
||||||
this.initialize = function(callbackFn){
|
|
||||||
$(document).ready(function(){
|
|
||||||
bindHandlers();
|
|
||||||
})
|
|
||||||
var bindHandlers = function(){
|
|
||||||
$("#filter .filter_btns a").click(function(){
|
|
||||||
if(!$(this).hasClass("active")){
|
|
||||||
$(this).addClass("active");
|
|
||||||
if(g.urlVars.length == 0)
|
|
||||||
window.location = "albums?" + $(this).attr("href");
|
|
||||||
else
|
|
||||||
window.location = window.location.href +"&"+ $(this).attr("href");
|
|
||||||
}else{
|
|
||||||
$(this).removeClass("active");
|
|
||||||
var loc = window.location.href;
|
|
||||||
var url = loc.replace($(this).attr("href")+"&","");
|
|
||||||
if(url == loc)
|
|
||||||
url = loc.replace($(this).attr("href"),"");
|
|
||||||
|
|
||||||
if(url.charAt(url.length-1)=="&" || url.charAt(url.length-1)=="?")
|
|
||||||
url = url.substr(0,url.length-1);
|
|
||||||
window.location = url;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
$("#filter .filter-clear a").click(function(){
|
|
||||||
var loc = window.location.href;
|
|
||||||
var url = null;
|
|
||||||
var forwhat = $(this).attr("for");
|
|
||||||
$("#filter ."+forwhat+" a.active").each(function(){
|
|
||||||
$(this).removeClass("active");
|
|
||||||
url = loc.replace($(this).attr("href")+"&","");
|
|
||||||
if(url == loc)
|
|
||||||
url = loc.replace($(this).attr("href"),"");
|
|
||||||
|
|
||||||
if(url.charAt(url.length-1)=="&" || url.charAt(url.length-1)=="?")
|
|
||||||
url = url.substr(0,url.length-1);
|
|
||||||
loc = url;
|
|
||||||
})
|
|
||||||
window.location = url;
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
this.makeNewAlbum = function(path){
|
|
||||||
$.get(path,function(html){
|
|
||||||
rcom.modalWindow({loadHtml:html,width:320,height:320,"closeBtn":false},function(dom){
|
|
||||||
$("form#new_gallery_album").submit(function(){
|
|
||||||
var validated = true;
|
|
||||||
$(this).find(".error").removeClass("error");
|
|
||||||
$(this).find(".validate").each(function(){
|
|
||||||
if(!$(this).val()){
|
|
||||||
validated = false;
|
|
||||||
$(this).parent().addClass("error");
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if(!validated)
|
|
||||||
return false;
|
|
||||||
})
|
|
||||||
dom.find("#album_name_close_btn").click(function(){
|
|
||||||
rcom.modalWindowClose();
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.deleteAlbum = function(id){
|
|
||||||
if(confirm("<%= I18n.t('gallery.del_album?') %>")){
|
|
||||||
$.ajax({
|
|
||||||
type: "DELETE",
|
|
||||||
url : id,
|
|
||||||
success : function(){
|
|
||||||
window.location = "../albums";
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.loadAlbums = function(id){
|
|
||||||
g.albumArea.find(".rghead .rgfn a").click(function(){g.makeNewAlbum($(this).attr("href"))});
|
|
||||||
g.albumArea.addClass('o_gallery');
|
|
||||||
g.albumArea.find("#imgholder").empty();
|
|
||||||
if(id!="all"){
|
|
||||||
var cids = [];
|
|
||||||
var tids = [];
|
|
||||||
var href = null;
|
|
||||||
console.log(cids);
|
|
||||||
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
|
||||||
for(var i = 0; i < hashes.length; i++){
|
|
||||||
hash = hashes[i].split('=');
|
|
||||||
if(hash[0]=="cat"){
|
|
||||||
cids.push(hash[1]);
|
|
||||||
href = "cat="+hash[1];
|
|
||||||
}else if(hash[0]=="tag"){
|
|
||||||
tids.push(hash[1]);
|
|
||||||
href = "tag="+hash[1];
|
|
||||||
}
|
|
||||||
$("#filter .filter_btns a[href='"+href+"']").addClass("active");
|
|
||||||
}
|
|
||||||
if(cids.length == 0)
|
|
||||||
cids = "all";
|
|
||||||
}else{
|
|
||||||
var cids = "all";
|
|
||||||
}
|
|
||||||
$.getJSON("get_albums",{cid:cids,tid:tids},function(categories){
|
|
||||||
$.each(categories,function(x,category){
|
|
||||||
$.each(category,function(i,album){
|
|
||||||
album.description = (album.description?album.description:"<%= I18n.t('gallery.no_description') %>")
|
|
||||||
if(album.cover == "default")
|
|
||||||
var $img = $("<div class='rgalbum'><a title='"+album.description+"' href='"+album.show_path+"'><img src='../../../assets/gallery/default.jpg' /></a><span class='albumname'>"+album.name+"</span><span class='categoryname'>"+album.category_name+"</span><span class='tagnames'></span></div>");
|
|
||||||
else
|
|
||||||
var $img = $("<div class='rgalbum'><a title='"+album.description+"' href='"+album.show_path+"'><img src='"+album.cover_path+"' /></a><span class='albumname'>"+album.name+"</span><span class='categoryname'>"+album.category_name+"</span><span class='tagnames'></span></div>");
|
|
||||||
var tag_string = "";
|
|
||||||
for(tag in album.tag_names){
|
|
||||||
tag_string+= '<span class="label label-tags">' + album.tag_names[tag] + '</span>';
|
|
||||||
}
|
|
||||||
$img.find(".tagnames").html(tag_string);
|
|
||||||
g.albumArea.find("#imgholder").append($img);
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.loadImages = function(id){
|
|
||||||
var panelopen = false;
|
|
||||||
$('.bt-tag').click(function(){
|
|
||||||
$(this).toggleClass("active");
|
|
||||||
var $tag_panel = $('#tag_panel'),
|
|
||||||
tag_panel_position = 0;
|
|
||||||
|
|
||||||
if( $tag_panel.css('right') == '0px' ){
|
|
||||||
tag_panel_position = -200;
|
|
||||||
}
|
|
||||||
$tag_panel.animate({'right':tag_panel_position}, 300);
|
|
||||||
|
|
||||||
g.albumArea
|
|
||||||
.delay(200)
|
|
||||||
.animate({'margin-right':tag_panel_position+200},300);
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
g.albumArea.find("#tag_search_box").keyup(function(e){
|
|
||||||
sval = $(this).val();
|
|
||||||
if(sval == "<%= I18n.t('gallery.search_tags') %>")
|
|
||||||
sval = "";
|
|
||||||
sval = sval.replace(/(^\s*)|(\s*$)/g,'');
|
|
||||||
if(sval){
|
|
||||||
var re1 = new RegExp("^[\u4E00-\uFA29]*$"); //Chinese character range
|
|
||||||
var re2 = new RegExp("^[\uE7C7-\uE7F3]*$");
|
|
||||||
if ((re1.test(sval) && (re2.test(sval)))){
|
|
||||||
$("#gallery_tag_list li span:not(:contains("+sval+"))").parent().slideUp();
|
|
||||||
}else{
|
|
||||||
$("#gallery_tag_list li span:not(:containsi("+sval+"))").parent().slideUp();
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
$("#gallery_tag_list li").slideDown();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
g.albumArea.find("#tag_panel .bt-save").click(function(){
|
|
||||||
g.saveTags(id,"album");
|
|
||||||
})
|
|
||||||
g.albumArea.find(".rghead .rgfn .bt-add").click(function(){
|
|
||||||
showUploadPanel();
|
|
||||||
})
|
|
||||||
g.albumArea.find(".rghead .rgfn .bt-del").click(function(){
|
|
||||||
g.deleteAlbum(id);
|
|
||||||
})
|
|
||||||
$("#upload_panel_holder").remove();
|
|
||||||
var uploadpanel = $('<div id="upload_panel_holder"><div class="rgfn"><a class="bt-cls btn btn-primary pull-right" title="Close" href="" onclick="return false;"><i class="icon-remove icon-white"></i>Close Panel</a></div></div>');
|
|
||||||
var frame = $('<iframe id="upload_panel" width="100%" scrolling="no" height="294" frameborder="0" src="'+id+'/upload_panel"></iframe>');
|
|
||||||
uploadpanel.find(".bt-cls").click(function(){
|
|
||||||
uploadpanel.hide("slide");
|
|
||||||
frame.remove();
|
|
||||||
g.loadImages(id);
|
|
||||||
panelopen = false;
|
|
||||||
})
|
|
||||||
var showUploadPanel = function(){
|
|
||||||
if(!panelopen){
|
|
||||||
uploadpanel.prepend(frame);
|
|
||||||
uploadpanel.show("slide");
|
|
||||||
panelopen = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
g.albumArea.addClass('o_album');
|
|
||||||
g.albumArea.find(".rghead .rgfn").append(uploadpanel);
|
|
||||||
g.albumArea.find("#imgholder").empty();
|
|
||||||
$.getJSON(id+"/imgs",function(album){
|
|
||||||
$.each(album.images,function(i,image){
|
|
||||||
var thumb = image.file.thumb.url;
|
|
||||||
image.description = (image.description?image.description:"<%= I18n.t('gallery.no_description') %>")
|
|
||||||
var $img = $("<div class='rgphoto'><a title='"+image.description+"' href='"+image.theater_link+"'><img src='"+thumb+"'/></a></div>");
|
|
||||||
g.albumArea.find("#imgholder").append($img);
|
|
||||||
})
|
|
||||||
g.tagList.find("input").attr("checked",false);
|
|
||||||
if(typeof album.tag_names == "undefined"){
|
|
||||||
$.each(album.tags,function(i,tag){
|
|
||||||
g.tagList.find("li[data-content="+tag+"] input").attr("checked",true);
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
$.each(album.tag_names,function(i,tagname){
|
|
||||||
$li = $("<li><label>"+tagname+"</label><span style='display:none;'>"+tagname+"</span></li>");
|
|
||||||
g.tagList.append($li);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.loadTheater = function(id){
|
this.loadTheater = function(id){
|
||||||
var imageArray;
|
var imageArray;
|
||||||
var imagecount = 0;
|
var imagecount = 0;
|
||||||
|
@ -460,132 +256,6 @@ var galleryAPI = function(){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.editAlbum = function(id){
|
|
||||||
var bindHandlers = function(){
|
|
||||||
$(".nav .nav-tabs a").click(function(){
|
|
||||||
$(".tab_content .tab-pane").hide();
|
|
||||||
})
|
|
||||||
$(".description_loader .edit_fn .bt-cover").click(function(){
|
|
||||||
$(".bt-cover").removeClass("setcover active btn-primary");
|
|
||||||
$(".bt-cover span").removeClass("icon-white icon-star").addClass("icon-star-empty");
|
|
||||||
$(this).addClass("setcover active btn-primary");
|
|
||||||
$(this).find("span").removeClass("icon-star-empty").addClass("icon-white icon-star");
|
|
||||||
$.post("set_cover",{"imageid":$(this).attr("for")});
|
|
||||||
})
|
|
||||||
$(".description_loader .edit_fn .bt-dels").click(function(){
|
|
||||||
$(this)
|
|
||||||
.toggleClass("setdelete btn-danger active")
|
|
||||||
.find('span').toggleClass('icon-white');
|
|
||||||
if($(".description_loader .edit_fn .setdelete").length > 0)
|
|
||||||
g.albumArea.find(".rghead .rgfn .bt-save").show();
|
|
||||||
|
|
||||||
if($(this).hasClass("active")){
|
|
||||||
$(this).parent().parent().find("input.del_field").val(true);
|
|
||||||
}else{
|
|
||||||
$(this).parent().parent().find("input.del_field").val(false);
|
|
||||||
}
|
|
||||||
delete_cover();
|
|
||||||
})
|
|
||||||
var delete_cover = function(){
|
|
||||||
if($(".description_loader .setcover").parent().find(".bt-dels").hasClass("active")){
|
|
||||||
$("input.del_cover").val(true);
|
|
||||||
}else{
|
|
||||||
$("input.del_cover").val(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var current_element_for_tags = null;
|
|
||||||
var current_element_no = null;
|
|
||||||
$('.bt-tag').click(function(){
|
|
||||||
var has_class = false;
|
|
||||||
if($(this).hasClass("active"))
|
|
||||||
has_class = true;
|
|
||||||
|
|
||||||
$('.bt-tag').removeClass("active");
|
|
||||||
$(this).toggleClass("active");
|
|
||||||
var count = 0;
|
|
||||||
$('.bt-tag').each(function(){
|
|
||||||
if($(this).hasClass("active"))
|
|
||||||
count++;
|
|
||||||
})
|
|
||||||
if(has_class){
|
|
||||||
$(this).removeClass("active");
|
|
||||||
count = 0;
|
|
||||||
}
|
|
||||||
var $tag_panel = $('#tag_panel'),
|
|
||||||
tag_panel_position = 0;
|
|
||||||
if(count == 1)
|
|
||||||
tag_panel_position = 0
|
|
||||||
else if(count == 0){
|
|
||||||
if( $tag_panel.css('right') == '0px' ){
|
|
||||||
tag_panel_position = -200;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$tag_panel.animate({'right':tag_panel_position}, 300);
|
|
||||||
|
|
||||||
g.albumArea
|
|
||||||
.delay(200)
|
|
||||||
.animate({'margin-right':tag_panel_position+200},300);
|
|
||||||
|
|
||||||
current_element_for_tags = $(this).attr("href");
|
|
||||||
if(count == 1){
|
|
||||||
current_element_no = $(this).parent().attr("no");
|
|
||||||
if(imageTagArray[current_element_no].id == current_element_for_tags){
|
|
||||||
g.tagList.find("input").attr("checked",false);
|
|
||||||
for(tag in imageTagArray[current_element_no].tags){
|
|
||||||
g.tagList.find("li[data-content="+imageTagArray[current_element_no].tags[tag]+"] input").attr("checked",true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
g.albumArea.find("#tag_search_box").keyup(function(e){
|
|
||||||
sval = $(this).val();
|
|
||||||
if(sval == "<%= I18n.t('gallery.search_tags') %>")
|
|
||||||
sval = "";
|
|
||||||
sval = sval.replace(/(^\s*)|(\s*$)/g,'');
|
|
||||||
if(sval){
|
|
||||||
var re1 = new RegExp("^[\u4E00-\uFA29]*$"); //Chinese character range
|
|
||||||
var re2 = new RegExp("^[\uE7C7-\uE7F3]*$");
|
|
||||||
if ((re1.test(sval) && (re2.test(sval)))){
|
|
||||||
$("#gallery_tag_list li span:not(:contains("+sval+"))").parent().slideUp();
|
|
||||||
}else{
|
|
||||||
$("#gallery_tag_list li span:not(:containsi("+sval+"))").parent().slideUp();
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
$("#gallery_tag_list li").slideDown();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
g.albumArea.find("#tag_panel .bt-save").click(function(){
|
|
||||||
g.saveTags(current_element_for_tags,"pic",function(tagids){
|
|
||||||
imageTagArray[current_element_no].tags = tagids;
|
|
||||||
})
|
|
||||||
})
|
|
||||||
var tempval;
|
|
||||||
$(".txtchange").focus(function(){
|
|
||||||
tempval = $(this).val();
|
|
||||||
}).keyup(function(){
|
|
||||||
if($(this).val() != tempval)
|
|
||||||
g.albumArea.find(".rghead .rgfn .bt-save").show();
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
g.albumArea.addClass('o_album_edit');
|
|
||||||
var imageTagArray = null;
|
|
||||||
$.getJSON("images_tags",function(data){
|
|
||||||
imageTagArray = eval(data);
|
|
||||||
})
|
|
||||||
bindHandlers();
|
|
||||||
}
|
|
||||||
this.saveTags = function(id,tagsfor,callbackFn){
|
|
||||||
var tagids = new Array();
|
|
||||||
g.tagList.find("li input:checked").each(function(){
|
|
||||||
tagids.push($(this).parent().attr("data-content"));
|
|
||||||
})
|
|
||||||
$.post("../save_tags",{"id":id,"tag":tagsfor,"tids":tagids},function(){
|
|
||||||
if(typeof callbackFn == "function")
|
|
||||||
callbackFn.call(this,tagids);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
galleryAPI.prototype.locale = "en";
|
galleryAPI.prototype.locale = "en";
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
//= require galleryAPI
|
File diff suppressed because it is too large
Load Diff
|
@ -1,414 +0,0 @@
|
||||||
/*!
|
|
||||||
* jQuery UI 1.8.16
|
|
||||||
*
|
|
||||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
|
||||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
||||||
* http://jquery.org/license
|
|
||||||
*
|
|
||||||
* http://docs.jquery.com/UI
|
|
||||||
*/
|
|
||||||
(function(a,d){function c(h,g){var i=h.nodeName.toLowerCase();if("area"===i){g=h.parentNode;i=g.name;if(!h.href||!i||g.nodeName.toLowerCase()!=="map")return false;h=a("img[usemap=#"+i+"]")[0];return!!h&&e(h)}return(/input|select|textarea|button|object/.test(i)?!h.disabled:"a"==i?h.href||g:g)&&e(h)}function e(h){return!a(h).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(!a.ui.version){a.extend(a.ui,{version:"1.8.16",
|
|
||||||
keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(h,g){return typeof h==="number"?this.each(function(){var i=
|
|
||||||
this;setTimeout(function(){a(i).focus();g&&g.call(i)},h)}):this._focus.apply(this,arguments)},scrollParent:function(){var h;h=a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,
|
|
||||||
"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!h.length?a(document):h},zIndex:function(h){if(h!==d)return this.css("zIndex",h);if(this.length){h=a(this[0]);for(var g;h.length&&h[0]!==document;){g=h.css("position");if(g==="absolute"||g==="relative"||g==="fixed"){g=parseInt(h.css("zIndex"),10);if(!isNaN(g)&&g!==0)return g}h=h.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":
|
|
||||||
"mousedown")+".ui-disableSelection",function(h){h.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(h,g){function i(l,o,n,k){a.each(b,function(){o-=parseFloat(a.curCSS(l,"padding"+this,true))||0;if(n)o-=parseFloat(a.curCSS(l,"border"+this+"Width",true))||0;if(k)o-=parseFloat(a.curCSS(l,"margin"+this,true))||0});return o}var b=g==="Width"?["Left","Right"]:["Top","Bottom"],f=g.toLowerCase(),j={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,
|
|
||||||
outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+g]=function(l){if(l===d)return j["inner"+g].call(this);return this.each(function(){a(this).css(f,i(this,l)+"px")})};a.fn["outer"+g]=function(l,o){if(typeof l!=="number")return j["outer"+g].call(this,l);return this.each(function(){a(this).css(f,i(this,l,true,o)+"px")})}});a.extend(a.expr[":"],{data:function(h,g,i){return!!a.data(h,i[3])},focusable:function(h){return c(h,!isNaN(a.attr(h,"tabindex")))},tabbable:function(h){var g=a.attr(h,
|
|
||||||
"tabindex"),i=isNaN(g);return(i||g>=0)&&c(h,!i)}});a(function(){var h=document.body,g=h.appendChild(g=document.createElement("div"));a.extend(g.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=g.offsetHeight===100;a.support.selectstart="onselectstart"in g;h.removeChild(g).style.display="none"});a.extend(a.ui,{plugin:{add:function(h,g,i){h=a.ui[h].prototype;for(var b in i){h.plugins[b]=h.plugins[b]||[];h.plugins[b].push([g,i[b]])}},call:function(h,g,i){if((g=h.plugins[g])&&
|
|
||||||
h.element[0].parentNode)for(var b=0;b<g.length;b++)h.options[g[b][0]]&&g[b][1].apply(h.element,i)}},contains:function(h,g){return document.compareDocumentPosition?h.compareDocumentPosition(g)&16:h!==g&&h.contains(g)},hasScroll:function(h,g){if(a(h).css("overflow")==="hidden")return false;g=g&&g==="left"?"scrollLeft":"scrollTop";var i=false;if(h[g]>0)return true;h[g]=1;i=h[g]>0;h[g]=0;return i},isOverAxis:function(h,g,i){return h>g&&h<g+i},isOver:function(h,g,i,b,f,j){return a.ui.isOverAxis(h,i,f)&&
|
|
||||||
a.ui.isOverAxis(g,b,j)}})}})(jQuery);
|
|
||||||
(function(a,d){if(a.cleanData){var c=a.cleanData;a.cleanData=function(h){for(var g=0,i;(i=h[g])!=null;g++)try{a(i).triggerHandler("remove")}catch(b){}c(h)}}else{var e=a.fn.remove;a.fn.remove=function(h,g){return this.each(function(){if(!g)if(!h||a.filter(h,[this]).length)a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(i){}});return e.call(a(this),h,g)})}}a.widget=function(h,g,i){var b=h.split(".")[0],f;h=h.split(".")[1];f=b+"-"+h;if(!i){i=g;g=a.Widget}a.expr[":"][f]=
|
|
||||||
function(j){return!!a.data(j,h)};a[b]=a[b]||{};a[b][h]=function(j,l){arguments.length&&this._createWidget(j,l)};g=new g;g.options=a.extend(true,{},g.options);a[b][h].prototype=a.extend(true,g,{namespace:b,widgetName:h,widgetEventPrefix:a[b][h].prototype.widgetEventPrefix||h,widgetBaseClass:f},i);a.widget.bridge(h,a[b][h])};a.widget.bridge=function(h,g){a.fn[h]=function(i){var b=typeof i==="string",f=Array.prototype.slice.call(arguments,1),j=this;i=!b&&f.length?a.extend.apply(null,[true,i].concat(f)):
|
|
||||||
i;if(b&&i.charAt(0)==="_")return j;b?this.each(function(){var l=a.data(this,h),o=l&&a.isFunction(l[i])?l[i].apply(l,f):l;if(o!==l&&o!==d){j=o;return false}}):this.each(function(){var l=a.data(this,h);l?l.option(i||{})._init():a.data(this,h,new g(i,this))});return j}};a.Widget=function(h,g){arguments.length&&this._createWidget(h,g)};a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(h,g){a.data(g,this.widgetName,this);this.element=a(g);this.options=
|
|
||||||
a.extend(true,{},this.options,this._getCreateOptions(),h);var i=this;this.element.bind("remove."+this.widgetName,function(){i.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+
|
|
||||||
"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(h,g){var i=h;if(arguments.length===0)return a.extend({},this.options);if(typeof h==="string"){if(g===d)return this.options[h];i={};i[h]=g}this._setOptions(i);return this},_setOptions:function(h){var g=this;a.each(h,function(i,b){g._setOption(i,b)});return this},_setOption:function(h,g){this.options[h]=g;if(h==="disabled")this.widget()[g?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",
|
|
||||||
g);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(h,g,i){var b=this.options[h];g=a.Event(g);g.type=(h===this.widgetEventPrefix?h:this.widgetEventPrefix+h).toLowerCase();i=i||{};if(g.originalEvent){h=a.event.props.length;for(var f;h;){f=a.event.props[--h];g[f]=g.originalEvent[f]}}this.element.trigger(g,i);return!(a.isFunction(b)&&b.call(this.element[0],g,i)===false||g.isDefaultPrevented())}}})(jQuery);
|
|
||||||
(function(a){var d=false;a(document).mouseup(function(){d=false});a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var c=this;this.element.bind("mousedown."+this.widgetName,function(e){return c._mouseDown(e)}).bind("click."+this.widgetName,function(e){if(true===a.data(e.target,c.widgetName+".preventClickEvent")){a.removeData(e.target,c.widgetName+".preventClickEvent");e.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+
|
|
||||||
this.widgetName)},_mouseDown:function(c){if(!d){this._mouseStarted&&this._mouseUp(c);this._mouseDownEvent=c;var e=this,h=c.which==1,g=typeof this.options.cancel=="string"&&c.target.nodeName?a(c.target).closest(this.options.cancel).length:false;if(!h||g||!this._mouseCapture(c))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(c)&&this._mouseDelayMet(c)){this._mouseStarted=
|
|
||||||
this._mouseStart(c)!==false;if(!this._mouseStarted){c.preventDefault();return true}}true===a.data(c.target,this.widgetName+".preventClickEvent")&&a.removeData(c.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(i){return e._mouseMove(i)};this._mouseUpDelegate=function(i){return e._mouseUp(i)};a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);c.preventDefault();return d=true}},_mouseMove:function(c){if(a.browser.msie&&
|
|
||||||
!(document.documentMode>=9)&&!c.button)return this._mouseUp(c);if(this._mouseStarted){this._mouseDrag(c);return c.preventDefault()}if(this._mouseDistanceMet(c)&&this._mouseDelayMet(c))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,c)!==false)?this._mouseDrag(c):this._mouseUp(c);return!this._mouseStarted},_mouseUp:function(c){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=
|
|
||||||
false;c.target==this._mouseDownEvent.target&&a.data(c.target,this.widgetName+".preventClickEvent",true);this._mouseStop(c)}return false},_mouseDistanceMet:function(c){return Math.max(Math.abs(this._mouseDownEvent.pageX-c.pageX),Math.abs(this._mouseDownEvent.pageY-c.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
|
|
||||||
(function(a){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
|
|
||||||
"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(d){var c=
|
|
||||||
this.options;if(this.helper||c.disabled||a(d.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(d);if(!this.handle)return false;if(c.iframeFix)a(c.iframeFix===true?"iframe":c.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(a(this).offset()).appendTo("body")});return true},_mouseStart:function(d){var c=this.options;
|
|
||||||
this.helper=this._createHelper(d);this._cacheHelperProportions();if(a.ui.ddmanager)a.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:d.pageX-this.offset.left,top:d.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});
|
|
||||||
this.originalPosition=this.position=this._generatePosition(d);this.originalPageX=d.pageX;this.originalPageY=d.pageY;c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt);c.containment&&this._setContainment();if(this._trigger("start",d)===false){this._clear();return false}this._cacheHelperProportions();a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,d);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(d,true);a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,d);return true},
|
|
||||||
_mouseDrag:function(d,c){this.position=this._generatePosition(d);this.positionAbs=this._convertPositionTo("absolute");if(!c){c=this._uiHash();if(this._trigger("drag",d,c)===false){this._mouseUp({});return false}this.position=c.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,d);return false},_mouseStop:function(d){var c=
|
|
||||||
false;if(a.ui.ddmanager&&!this.options.dropBehaviour)c=a.ui.ddmanager.drop(this,d);if(this.dropped){c=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===true||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var e=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,
|
|
||||||
10),function(){e._trigger("stop",d)!==false&&e._clear()})}else this._trigger("stop",d)!==false&&this._clear();return false},_mouseUp:function(d){this.options.iframeFix===true&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,d);return a.ui.mouse.prototype._mouseUp.call(this,d)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(d){var c=!this.options.handle||
|
|
||||||
!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==d.target)c=true});return c},_createHelper:function(d){var c=this.options;d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[d])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo);d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&
|
|
||||||
d.css("position","absolute");return d},_adjustOffsetFromHelper:function(d){if(typeof d=="string")d=d.split(" ");if(a.isArray(d))d={left:+d[0],top:+d[1]||0};if("left"in d)this.offset.click.left=d.left+this.margins.left;if("right"in d)this.offset.click.left=this.helperProportions.width-d.right+this.margins.left;if("top"in d)this.offset.click.top=d.top+this.margins.top;if("bottom"in d)this.offset.click.top=this.helperProportions.height-d.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=
|
|
||||||
this.helper.offsetParent();var d=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){d.left+=this.scrollParent.scrollLeft();d.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)d={top:0,left:0};return{top:d.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:d.left+(parseInt(this.offsetParent.css("borderLeftWidth"),
|
|
||||||
10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var d=this.element.position();return{top:d.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:d.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),
|
|
||||||
10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var d=this.options;if(d.containment=="parent")d.containment=this.helper[0].parentNode;if(d.containment=="document"||d.containment=="window")this.containment=[d.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,d.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,
|
|
||||||
(d.containment=="document"?0:a(window).scrollLeft())+a(d.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d.containment=="document"?0:a(window).scrollTop())+(a(d.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(d.containment)&&d.containment.constructor!=Array){d=a(d.containment);var c=d[0];if(c){d.offset();var e=a(c).css("overflow")!=
|
|
||||||
"hidden";this.containment=[(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0),(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0),(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),
|
|
||||||
10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=d}}else if(d.containment.constructor==Array)this.containment=d.containment},_convertPositionTo:function(d,c){if(!c)c=this.position;d=d=="absolute"?1:-1;var e=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=/(html|body)/i.test(e[0].tagName);return{top:c.top+
|
|
||||||
this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():h?0:e.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():h?0:e.scrollLeft())*d)}},_generatePosition:function(d){var c=this.options,e=this.cssPosition=="absolute"&&
|
|
||||||
!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=/(html|body)/i.test(e[0].tagName),g=d.pageX,i=d.pageY;if(this.originalPosition){var b;if(this.containment){if(this.relative_container){b=this.relative_container.offset();b=[this.containment[0]+b.left,this.containment[1]+b.top,this.containment[2]+b.left,this.containment[3]+b.top]}else b=this.containment;if(d.pageX-this.offset.click.left<b[0])g=b[0]+this.offset.click.left;
|
|
||||||
if(d.pageY-this.offset.click.top<b[1])i=b[1]+this.offset.click.top;if(d.pageX-this.offset.click.left>b[2])g=b[2]+this.offset.click.left;if(d.pageY-this.offset.click.top>b[3])i=b[3]+this.offset.click.top}if(c.grid){i=c.grid[1]?this.originalPageY+Math.round((i-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;i=b?!(i-this.offset.click.top<b[1]||i-this.offset.click.top>b[3])?i:!(i-this.offset.click.top<b[1])?i-c.grid[1]:i+c.grid[1]:i;g=c.grid[0]?this.originalPageX+Math.round((g-this.originalPageX)/
|
|
||||||
c.grid[0])*c.grid[0]:this.originalPageX;g=b?!(g-this.offset.click.left<b[0]||g-this.offset.click.left>b[2])?g:!(g-this.offset.click.left<b[0])?g-c.grid[0]:g+c.grid[0]:g}}return{top:i-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():h?0:e.scrollTop()),left:g-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<
|
|
||||||
526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():h?0:e.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(d,c,e){e=e||this._uiHash();a.ui.plugin.call(this,d,[c,e]);if(d=="drag")this.positionAbs=this._convertPositionTo("absolute");return a.Widget.prototype._trigger.call(this,d,c,
|
|
||||||
e)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});a.extend(a.ui.draggable,{version:"1.8.16"});a.ui.plugin.add("draggable","connectToSortable",{start:function(d,c){var e=a(this).data("draggable"),h=e.options,g=a.extend({},c,{item:e.element});e.sortables=[];a(h.connectToSortable).each(function(){var i=a.data(this,"sortable");if(i&&!i.options.disabled){e.sortables.push({instance:i,shouldRevert:i.options.revert});
|
|
||||||
i.refreshPositions();i._trigger("activate",d,g)}})},stop:function(d,c){var e=a(this).data("draggable"),h=a.extend({},c,{item:e.element});a.each(e.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;e.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(d);this.instance.options.helper=this.instance.options._helper;e.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=
|
|
||||||
false;this.instance._trigger("deactivate",d,h)}})},drag:function(d,c){var e=a(this).data("draggable"),h=this;a.each(e.sortables,function(){this.instance.positionAbs=e.positionAbs;this.instance.helperProportions=e.helperProportions;this.instance.offset.click=e.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(h).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",true);
|
|
||||||
this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return c.helper[0]};d.target=this.instance.currentItem[0];this.instance._mouseCapture(d,true);this.instance._mouseStart(d,true,true);this.instance.offset.click.top=e.offset.click.top;this.instance.offset.click.left=e.offset.click.left;this.instance.offset.parent.left-=e.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=e.offset.parent.top-this.instance.offset.parent.top;
|
|
||||||
e._trigger("toSortable",d);e.dropped=this.instance.element;e.currentItem=e.element;this.instance.fromOutside=e}this.instance.currentItem&&this.instance._mouseDrag(d)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",d,this.instance._uiHash(this.instance));this.instance._mouseStop(d,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&
|
|
||||||
this.instance.placeholder.remove();e._trigger("fromSortable",d);e.dropped=false}})}});a.ui.plugin.add("draggable","cursor",{start:function(){var d=a("body"),c=a(this).data("draggable").options;if(d.css("cursor"))c._cursor=d.css("cursor");d.css("cursor",c.cursor)},stop:function(){var d=a(this).data("draggable").options;d._cursor&&a("body").css("cursor",d._cursor)}});a.ui.plugin.add("draggable","opacity",{start:function(d,c){d=a(c.helper);c=a(this).data("draggable").options;if(d.css("opacity"))c._opacity=
|
|
||||||
d.css("opacity");d.css("opacity",c.opacity)},stop:function(d,c){d=a(this).data("draggable").options;d._opacity&&a(c.helper).css("opacity",d._opacity)}});a.ui.plugin.add("draggable","scroll",{start:function(){var d=a(this).data("draggable");if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML")d.overflowOffset=d.scrollParent.offset()},drag:function(d){var c=a(this).data("draggable"),e=c.options,h=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!e.axis||e.axis!=
|
|
||||||
"x")if(c.overflowOffset.top+c.scrollParent[0].offsetHeight-d.pageY<e.scrollSensitivity)c.scrollParent[0].scrollTop=h=c.scrollParent[0].scrollTop+e.scrollSpeed;else if(d.pageY-c.overflowOffset.top<e.scrollSensitivity)c.scrollParent[0].scrollTop=h=c.scrollParent[0].scrollTop-e.scrollSpeed;if(!e.axis||e.axis!="y")if(c.overflowOffset.left+c.scrollParent[0].offsetWidth-d.pageX<e.scrollSensitivity)c.scrollParent[0].scrollLeft=h=c.scrollParent[0].scrollLeft+e.scrollSpeed;else if(d.pageX-c.overflowOffset.left<
|
|
||||||
e.scrollSensitivity)c.scrollParent[0].scrollLeft=h=c.scrollParent[0].scrollLeft-e.scrollSpeed}else{if(!e.axis||e.axis!="x")if(d.pageY-a(document).scrollTop()<e.scrollSensitivity)h=a(document).scrollTop(a(document).scrollTop()-e.scrollSpeed);else if(a(window).height()-(d.pageY-a(document).scrollTop())<e.scrollSensitivity)h=a(document).scrollTop(a(document).scrollTop()+e.scrollSpeed);if(!e.axis||e.axis!="y")if(d.pageX-a(document).scrollLeft()<e.scrollSensitivity)h=a(document).scrollLeft(a(document).scrollLeft()-
|
|
||||||
e.scrollSpeed);else if(a(window).width()-(d.pageX-a(document).scrollLeft())<e.scrollSensitivity)h=a(document).scrollLeft(a(document).scrollLeft()+e.scrollSpeed)}h!==false&&a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(c,d)}});a.ui.plugin.add("draggable","snap",{start:function(){var d=a(this).data("draggable"),c=d.options;d.snapElements=[];a(c.snap.constructor!=String?c.snap.items||":data(draggable)":c.snap).each(function(){var e=a(this),h=e.offset();this!=d.element[0]&&d.snapElements.push({item:this,
|
|
||||||
width:e.outerWidth(),height:e.outerHeight(),top:h.top,left:h.left})})},drag:function(d,c){for(var e=a(this).data("draggable"),h=e.options,g=h.snapTolerance,i=c.offset.left,b=i+e.helperProportions.width,f=c.offset.top,j=f+e.helperProportions.height,l=e.snapElements.length-1;l>=0;l--){var o=e.snapElements[l].left,n=o+e.snapElements[l].width,k=e.snapElements[l].top,m=k+e.snapElements[l].height;if(o-g<i&&i<n+g&&k-g<f&&f<m+g||o-g<i&&i<n+g&&k-g<j&&j<m+g||o-g<b&&b<n+g&&k-g<f&&f<m+g||o-g<b&&b<n+g&&k-g<j&&
|
|
||||||
j<m+g){if(h.snapMode!="inner"){var p=Math.abs(k-j)<=g,q=Math.abs(m-f)<=g,s=Math.abs(o-b)<=g,r=Math.abs(n-i)<=g;if(p)c.position.top=e._convertPositionTo("relative",{top:k-e.helperProportions.height,left:0}).top-e.margins.top;if(q)c.position.top=e._convertPositionTo("relative",{top:m,left:0}).top-e.margins.top;if(s)c.position.left=e._convertPositionTo("relative",{top:0,left:o-e.helperProportions.width}).left-e.margins.left;if(r)c.position.left=e._convertPositionTo("relative",{top:0,left:n}).left-e.margins.left}var u=
|
|
||||||
p||q||s||r;if(h.snapMode!="outer"){p=Math.abs(k-f)<=g;q=Math.abs(m-j)<=g;s=Math.abs(o-i)<=g;r=Math.abs(n-b)<=g;if(p)c.position.top=e._convertPositionTo("relative",{top:k,left:0}).top-e.margins.top;if(q)c.position.top=e._convertPositionTo("relative",{top:m-e.helperProportions.height,left:0}).top-e.margins.top;if(s)c.position.left=e._convertPositionTo("relative",{top:0,left:o}).left-e.margins.left;if(r)c.position.left=e._convertPositionTo("relative",{top:0,left:n-e.helperProportions.width}).left-e.margins.left}if(!e.snapElements[l].snapping&&
|
|
||||||
(p||q||s||r||u))e.options.snap.snap&&e.options.snap.snap.call(e.element,d,a.extend(e._uiHash(),{snapItem:e.snapElements[l].item}));e.snapElements[l].snapping=p||q||s||r||u}else{e.snapElements[l].snapping&&e.options.snap.release&&e.options.snap.release.call(e.element,d,a.extend(e._uiHash(),{snapItem:e.snapElements[l].item}));e.snapElements[l].snapping=false}}}});a.ui.plugin.add("draggable","stack",{start:function(){var d=a(this).data("draggable").options;d=a.makeArray(a(d.stack)).sort(function(e,h){return(parseInt(a(e).css("zIndex"),
|
|
||||||
10)||0)-(parseInt(a(h).css("zIndex"),10)||0)});if(d.length){var c=parseInt(d[0].style.zIndex)||0;a(d).each(function(e){this.style.zIndex=c+e});this[0].style.zIndex=c+d.length}}});a.ui.plugin.add("draggable","zIndex",{start:function(d,c){d=a(c.helper);c=a(this).data("draggable").options;if(d.css("zIndex"))c._zIndex=d.css("zIndex");d.css("zIndex",c.zIndex)},stop:function(d,c){d=a(this).data("draggable").options;d._zIndex&&a(c.helper).css("zIndex",d._zIndex)}})})(jQuery);
|
|
||||||
(function(a){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var d=this.options,c=d.accept;this.isover=0;this.isout=1;this.accept=a.isFunction(c)?c:function(e){return e.is(c)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};a.ui.ddmanager.droppables[d.scope]=a.ui.ddmanager.droppables[d.scope]||[];a.ui.ddmanager.droppables[d.scope].push(this);
|
|
||||||
d.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var d=a.ui.ddmanager.droppables[this.options.scope],c=0;c<d.length;c++)d[c]==this&&d.splice(c,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(d,c){if(d=="accept")this.accept=a.isFunction(c)?c:function(e){return e.is(c)};a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(d){var c=a.ui.ddmanager.current;this.options.activeClass&&
|
|
||||||
this.element.addClass(this.options.activeClass);c&&this._trigger("activate",d,this.ui(c))},_deactivate:function(d){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);c&&this._trigger("deactivate",d,this.ui(c))},_over:function(d){var c=a.ui.ddmanager.current;if(!(!c||(c.currentItem||c.element)[0]==this.element[0]))if(this.accept.call(this.element[0],c.currentItem||c.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass);
|
|
||||||
this._trigger("over",d,this.ui(c))}},_out:function(d){var c=a.ui.ddmanager.current;if(!(!c||(c.currentItem||c.element)[0]==this.element[0]))if(this.accept.call(this.element[0],c.currentItem||c.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",d,this.ui(c))}},_drop:function(d,c){var e=c||a.ui.ddmanager.current;if(!e||(e.currentItem||e.element)[0]==this.element[0])return false;var h=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var g=
|
|
||||||
a.data(this,"droppable");if(g.options.greedy&&!g.options.disabled&&g.options.scope==e.options.scope&&g.accept.call(g.element[0],e.currentItem||e.element)&&a.ui.intersect(e,a.extend(g,{offset:g.element.offset()}),g.options.tolerance)){h=true;return false}});if(h)return false;if(this.accept.call(this.element[0],e.currentItem||e.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop",
|
|
||||||
d,this.ui(e));return this.element}return false},ui:function(d){return{draggable:d.currentItem||d.element,helper:d.helper,position:d.position,offset:d.positionAbs}}});a.extend(a.ui.droppable,{version:"1.8.16"});a.ui.intersect=function(d,c,e){if(!c.offset)return false;var h=(d.positionAbs||d.position.absolute).left,g=h+d.helperProportions.width,i=(d.positionAbs||d.position.absolute).top,b=i+d.helperProportions.height,f=c.offset.left,j=f+c.proportions.width,l=c.offset.top,o=l+c.proportions.height;
|
|
||||||
switch(e){case "fit":return f<=h&&g<=j&&l<=i&&b<=o;case "intersect":return f<h+d.helperProportions.width/2&&g-d.helperProportions.width/2<j&&l<i+d.helperProportions.height/2&&b-d.helperProportions.height/2<o;case "pointer":return a.ui.isOver((d.positionAbs||d.position.absolute).top+(d.clickOffset||d.offset.click).top,(d.positionAbs||d.position.absolute).left+(d.clickOffset||d.offset.click).left,l,f,c.proportions.height,c.proportions.width);case "touch":return(i>=l&&i<=o||b>=l&&b<=o||i<l&&b>o)&&(h>=
|
|
||||||
f&&h<=j||g>=f&&g<=j||h<f&&g>j);default:return false}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(d,c){var e=a.ui.ddmanager.droppables[d.options.scope]||[],h=c?c.type:null,g=(d.currentItem||d.element).find(":data(droppable)").andSelf(),i=0;a:for(;i<e.length;i++)if(!(e[i].options.disabled||d&&!e[i].accept.call(e[i].element[0],d.currentItem||d.element))){for(var b=0;b<g.length;b++)if(g[b]==e[i].element[0]){e[i].proportions.height=0;continue a}e[i].visible=e[i].element.css("display")!=
|
|
||||||
"none";if(e[i].visible){h=="mousedown"&&e[i]._activate.call(e[i],c);e[i].offset=e[i].element.offset();e[i].proportions={width:e[i].element[0].offsetWidth,height:e[i].element[0].offsetHeight}}}},drop:function(d,c){var e=false;a.each(a.ui.ddmanager.droppables[d.options.scope]||[],function(){if(this.options){if(!this.options.disabled&&this.visible&&a.ui.intersect(d,this,this.options.tolerance))e=e||this._drop.call(this,c);if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],d.currentItem||
|
|
||||||
d.element)){this.isout=1;this.isover=0;this._deactivate.call(this,c)}}});return e},dragStart:function(d,c){d.element.parents(":not(body,html)").bind("scroll.droppable",function(){d.options.refreshPositions||a.ui.ddmanager.prepareOffsets(d,c)})},drag:function(d,c){d.options.refreshPositions&&a.ui.ddmanager.prepareOffsets(d,c);a.each(a.ui.ddmanager.droppables[d.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var e=a.ui.intersect(d,this,this.options.tolerance);
|
|
||||||
if(e=!e&&this.isover==1?"isout":e&&this.isover==0?"isover":null){var h;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");if(g.length){h=a.data(g[0],"droppable");h.greedyChild=e=="isover"?1:0}}if(h&&e=="isover"){h.isover=0;h.isout=1;h._out.call(h,c)}this[e]=1;this[e=="isout"?"isover":"isout"]=0;this[e=="isover"?"_over":"_out"].call(this,c);if(h&&e=="isout"){h.isout=0;h.isover=1;h._over.call(h,c)}}}})},dragStop:function(d,c){d.element.parents(":not(body,html)").unbind("scroll.droppable");
|
|
||||||
d.options.refreshPositions||a.ui.ddmanager.prepareOffsets(d,c)}}})(jQuery);
|
|
||||||
(function(a){a.widget("ui.resizable",a.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var e=this,h=this.options;this.element.addClass("ui-resizable");a.extend(this,{_aspectRatio:!!h.aspectRatio,aspectRatio:h.aspectRatio,originalElement:this.element,
|
|
||||||
_proportionallyResizeElements:[],_helper:h.helper||h.ghost||h.animate?h.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&a.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(a('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),
|
|
||||||
top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=
|
|
||||||
this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=h.handles||(!a(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",
|
|
||||||
nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var g=this.handles.split(",");this.handles={};for(var i=0;i<g.length;i++){var b=a.trim(g[i]),f=a('<div class="ui-resizable-handle '+("ui-resizable-"+b)+'"></div>');/sw|se|ne|nw/.test(b)&&f.css({zIndex:++h.zIndex});"se"==b&&f.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[b]=".ui-resizable-"+b;this.element.append(f)}}this._renderAxis=function(j){j=j||this.element;for(var l in this.handles){if(this.handles[l].constructor==
|
|
||||||
String)this.handles[l]=a(this.handles[l],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var o=a(this.handles[l],this.element),n=0;n=/sw|ne|nw|se|n|s/.test(l)?o.outerHeight():o.outerWidth();o=["padding",/ne|nw|n/.test(l)?"Top":/se|sw|s/.test(l)?"Bottom":/^e$/.test(l)?"Right":"Left"].join("");j.css(o,n);this._proportionallyResize()}a(this.handles[l])}};this._renderAxis(this.element);this._handles=a(".ui-resizable-handle",this.element).disableSelection();
|
|
||||||
this._handles.mouseover(function(){if(!e.resizing){if(this.className)var j=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);e.axis=j&&j[1]?j[1]:"se"}});if(h.autoHide){this._handles.hide();a(this.element).addClass("ui-resizable-autohide").hover(function(){if(!h.disabled){a(this).removeClass("ui-resizable-autohide");e._handles.show()}},function(){if(!h.disabled)if(!e.resizing){a(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();
|
|
||||||
var e=function(g){a(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var h=this.element;h.after(this.originalElement.css({position:h.css("position"),width:h.outerWidth(),height:h.outerHeight(),top:h.css("top"),left:h.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_mouseCapture:function(e){var h=
|
|
||||||
false;for(var g in this.handles)if(a(this.handles[g])[0]==e.target)h=true;return!this.options.disabled&&h},_mouseStart:function(e){var h=this.options,g=this.element.position(),i=this.element;this.resizing=true;this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()};if(i.is(".ui-draggable")||/absolute/.test(i.css("position")))i.css({position:"absolute",top:g.top,left:g.left});a.browser.opera&&/relative/.test(i.css("position"))&&i.css({position:"relative",top:"auto",left:"auto"});
|
|
||||||
this._renderProxy();g=d(this.helper.css("left"));var b=d(this.helper.css("top"));if(h.containment){g+=a(h.containment).scrollLeft()||0;b+=a(h.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:g,top:b};this.size=this._helper?{width:i.outerWidth(),height:i.outerHeight()}:{width:i.width(),height:i.height()};this.originalSize=this._helper?{width:i.outerWidth(),height:i.outerHeight()}:{width:i.width(),height:i.height()};this.originalPosition={left:g,top:b};this.sizeDiff=
|
|
||||||
{width:i.outerWidth()-i.width(),height:i.outerHeight()-i.height()};this.originalMousePosition={left:e.pageX,top:e.pageY};this.aspectRatio=typeof h.aspectRatio=="number"?h.aspectRatio:this.originalSize.width/this.originalSize.height||1;h=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor",h=="auto"?this.axis+"-resize":h);i.addClass("ui-resizable-resizing");this._propagate("start",e);return true},_mouseDrag:function(e){var h=this.helper,g=this.originalMousePosition,i=this._change[this.axis];
|
|
||||||
if(!i)return false;g=i.apply(this,[e,e.pageX-g.left||0,e.pageY-g.top||0]);this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey)g=this._updateRatio(g,e);g=this._respectSize(g,e);this._propagate("resize",e);h.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(g);this._trigger("resize",e,this.ui());return false},
|
|
||||||
_mouseStop:function(e){this.resizing=false;var h=this.options,g=this;if(this._helper){var i=this._proportionallyResizeElements,b=i.length&&/textarea/i.test(i[0].nodeName);i=b&&a.ui.hasScroll(i[0],"left")?0:g.sizeDiff.height;b=b?0:g.sizeDiff.width;b={width:g.helper.width()-b,height:g.helper.height()-i};i=parseInt(g.element.css("left"),10)+(g.position.left-g.originalPosition.left)||null;var f=parseInt(g.element.css("top"),10)+(g.position.top-g.originalPosition.top)||null;h.animate||this.element.css(a.extend(b,
|
|
||||||
{top:f,left:i}));g.helper.height(g.size.height);g.helper.width(g.size.width);this._helper&&!h.animate&&this._proportionallyResize()}a("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",e);this._helper&&this.helper.remove();return false},_updateVirtualBoundaries:function(e){var h=this.options,g,i,b;h={minWidth:c(h.minWidth)?h.minWidth:0,maxWidth:c(h.maxWidth)?h.maxWidth:Infinity,minHeight:c(h.minHeight)?h.minHeight:0,maxHeight:c(h.maxHeight)?h.maxHeight:
|
|
||||||
Infinity};if(this._aspectRatio||e){e=h.minHeight*this.aspectRatio;i=h.minWidth/this.aspectRatio;g=h.maxHeight*this.aspectRatio;b=h.maxWidth/this.aspectRatio;if(e>h.minWidth)h.minWidth=e;if(i>h.minHeight)h.minHeight=i;if(g<h.maxWidth)h.maxWidth=g;if(b<h.maxHeight)h.maxHeight=b}this._vBoundaries=h},_updateCache:function(e){this.offset=this.helper.offset();if(c(e.left))this.position.left=e.left;if(c(e.top))this.position.top=e.top;if(c(e.height))this.size.height=e.height;if(c(e.width))this.size.width=
|
|
||||||
e.width},_updateRatio:function(e){var h=this.position,g=this.size,i=this.axis;if(c(e.height))e.width=e.height*this.aspectRatio;else if(c(e.width))e.height=e.width/this.aspectRatio;if(i=="sw"){e.left=h.left+(g.width-e.width);e.top=null}if(i=="nw"){e.top=h.top+(g.height-e.height);e.left=h.left+(g.width-e.width)}return e},_respectSize:function(e){var h=this._vBoundaries,g=this.axis,i=c(e.width)&&h.maxWidth&&h.maxWidth<e.width,b=c(e.height)&&h.maxHeight&&h.maxHeight<e.height,f=c(e.width)&&h.minWidth&&
|
|
||||||
h.minWidth>e.width,j=c(e.height)&&h.minHeight&&h.minHeight>e.height;if(f)e.width=h.minWidth;if(j)e.height=h.minHeight;if(i)e.width=h.maxWidth;if(b)e.height=h.maxHeight;var l=this.originalPosition.left+this.originalSize.width,o=this.position.top+this.size.height,n=/sw|nw|w/.test(g);g=/nw|ne|n/.test(g);if(f&&n)e.left=l-h.minWidth;if(i&&n)e.left=l-h.maxWidth;if(j&&g)e.top=o-h.minHeight;if(b&&g)e.top=o-h.maxHeight;if((h=!e.width&&!e.height)&&!e.left&&e.top)e.top=null;else if(h&&!e.top&&e.left)e.left=
|
|
||||||
null;return e},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e=this.helper||this.element,h=0;h<this._proportionallyResizeElements.length;h++){var g=this._proportionallyResizeElements[h];if(!this.borderDif){var i=[g.css("borderTopWidth"),g.css("borderRightWidth"),g.css("borderBottomWidth"),g.css("borderLeftWidth")],b=[g.css("paddingTop"),g.css("paddingRight"),g.css("paddingBottom"),g.css("paddingLeft")];this.borderDif=a.map(i,function(f,j){f=parseInt(f,10)||
|
|
||||||
0;j=parseInt(b[j],10)||0;return f+j})}a.browser.msie&&(a(e).is(":hidden")||a(e).parents(":hidden").length)||g.css({height:e.height()-this.borderDif[0]-this.borderDif[2]||0,width:e.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var e=this.options;this.elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||a('<div style="overflow:hidden;"></div>');var h=a.browser.msie&&a.browser.version<7,g=h?1:0;h=h?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+
|
|
||||||
h,height:this.element.outerHeight()+h,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++e.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(e,h){return{width:this.originalSize.width+h}},w:function(e,h){return{left:this.originalPosition.left+h,width:this.originalSize.width-h}},n:function(e,h,g){return{top:this.originalPosition.top+g,height:this.originalSize.height-g}},s:function(e,h,g){return{height:this.originalSize.height+
|
|
||||||
g}},se:function(e,h,g){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,h,g]))},sw:function(e,h,g){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,h,g]))},ne:function(e,h,g){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,h,g]))},nw:function(e,h,g){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,h,g]))}},_propagate:function(e,h){a.ui.plugin.call(this,e,[h,this.ui()]);
|
|
||||||
e!="resize"&&this._trigger(e,h,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});a.extend(a.ui.resizable,{version:"1.8.16"});a.ui.plugin.add("resizable","alsoResize",{start:function(){var e=a(this).data("resizable").options,h=function(g){a(g).each(function(){var i=a(this);i.data("resizable-alsoresize",{width:parseInt(i.width(),
|
|
||||||
10),height:parseInt(i.height(),10),left:parseInt(i.css("left"),10),top:parseInt(i.css("top"),10),position:i.css("position")})})};if(typeof e.alsoResize=="object"&&!e.alsoResize.parentNode)if(e.alsoResize.length){e.alsoResize=e.alsoResize[0];h(e.alsoResize)}else a.each(e.alsoResize,function(g){h(g)});else h(e.alsoResize)},resize:function(e,h){var g=a(this).data("resizable");e=g.options;var i=g.originalSize,b=g.originalPosition,f={height:g.size.height-i.height||0,width:g.size.width-i.width||0,top:g.position.top-
|
|
||||||
b.top||0,left:g.position.left-b.left||0},j=function(l,o){a(l).each(function(){var n=a(this),k=a(this).data("resizable-alsoresize"),m={},p=o&&o.length?o:n.parents(h.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(p,function(q,s){if((q=(k[s]||0)+(f[s]||0))&&q>=0)m[s]=q||null});if(a.browser.opera&&/relative/.test(n.css("position"))){g._revertToRelativePosition=true;n.css({position:"absolute",top:"auto",left:"auto"})}n.css(m)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?
|
|
||||||
a.each(e.alsoResize,function(l,o){j(l,o)}):j(e.alsoResize)},stop:function(){var e=a(this).data("resizable"),h=e.options,g=function(i){a(i).each(function(){var b=a(this);b.css({position:b.data("resizable-alsoresize").position})})};if(e._revertToRelativePosition){e._revertToRelativePosition=false;typeof h.alsoResize=="object"&&!h.alsoResize.nodeType?a.each(h.alsoResize,function(i){g(i)}):g(h.alsoResize)}a(this).removeData("resizable-alsoresize")}});a.ui.plugin.add("resizable","animate",{stop:function(e){var h=
|
|
||||||
a(this).data("resizable"),g=h.options,i=h._proportionallyResizeElements,b=i.length&&/textarea/i.test(i[0].nodeName),f=b&&a.ui.hasScroll(i[0],"left")?0:h.sizeDiff.height;b={width:h.size.width-(b?0:h.sizeDiff.width),height:h.size.height-f};f=parseInt(h.element.css("left"),10)+(h.position.left-h.originalPosition.left)||null;var j=parseInt(h.element.css("top"),10)+(h.position.top-h.originalPosition.top)||null;h.element.animate(a.extend(b,j&&f?{top:j,left:f}:{}),{duration:g.animateDuration,easing:g.animateEasing,
|
|
||||||
step:function(){var l={width:parseInt(h.element.css("width"),10),height:parseInt(h.element.css("height"),10),top:parseInt(h.element.css("top"),10),left:parseInt(h.element.css("left"),10)};i&&i.length&&a(i[0]).css({width:l.width,height:l.height});h._updateCache(l);h._propagate("resize",e)}})}});a.ui.plugin.add("resizable","containment",{start:function(){var e=a(this).data("resizable"),h=e.element,g=e.options.containment;if(h=g instanceof a?g.get(0):/parent/.test(g)?h.parent().get(0):g){e.containerElement=
|
|
||||||
a(h);if(/document/.test(g)||g==document){e.containerOffset={left:0,top:0};e.containerPosition={left:0,top:0};e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight}}else{var i=a(h),b=[];a(["Top","Right","Left","Bottom"]).each(function(l,o){b[l]=d(i.css("padding"+o))});e.containerOffset=i.offset();e.containerPosition=i.position();e.containerSize={height:i.innerHeight()-b[3],width:i.innerWidth()-b[1]};g=e.containerOffset;
|
|
||||||
var f=e.containerSize.height,j=e.containerSize.width;j=a.ui.hasScroll(h,"left")?h.scrollWidth:j;f=a.ui.hasScroll(h)?h.scrollHeight:f;e.parentData={element:h,left:g.left,top:g.top,width:j,height:f}}}},resize:function(e){var h=a(this).data("resizable"),g=h.options,i=h.containerOffset,b=h.position;e=h._aspectRatio||e.shiftKey;var f={top:0,left:0},j=h.containerElement;if(j[0]!=document&&/static/.test(j.css("position")))f=i;if(b.left<(h._helper?i.left:0)){h.size.width+=h._helper?h.position.left-i.left:
|
|
||||||
h.position.left-f.left;if(e)h.size.height=h.size.width/g.aspectRatio;h.position.left=g.helper?i.left:0}if(b.top<(h._helper?i.top:0)){h.size.height+=h._helper?h.position.top-i.top:h.position.top;if(e)h.size.width=h.size.height*g.aspectRatio;h.position.top=h._helper?i.top:0}h.offset.left=h.parentData.left+h.position.left;h.offset.top=h.parentData.top+h.position.top;g=Math.abs((h._helper?h.offset.left-f.left:h.offset.left-f.left)+h.sizeDiff.width);i=Math.abs((h._helper?h.offset.top-f.top:h.offset.top-
|
|
||||||
i.top)+h.sizeDiff.height);b=h.containerElement.get(0)==h.element.parent().get(0);f=/relative|absolute/.test(h.containerElement.css("position"));if(b&&f)g-=h.parentData.left;if(g+h.size.width>=h.parentData.width){h.size.width=h.parentData.width-g;if(e)h.size.height=h.size.width/h.aspectRatio}if(i+h.size.height>=h.parentData.height){h.size.height=h.parentData.height-i;if(e)h.size.width=h.size.height*h.aspectRatio}},stop:function(){var e=a(this).data("resizable"),h=e.options,g=e.containerOffset,i=e.containerPosition,
|
|
||||||
b=e.containerElement,f=a(e.helper),j=f.offset(),l=f.outerWidth()-e.sizeDiff.width;f=f.outerHeight()-e.sizeDiff.height;e._helper&&!h.animate&&/relative/.test(b.css("position"))&&a(this).css({left:j.left-i.left-g.left,width:l,height:f});e._helper&&!h.animate&&/static/.test(b.css("position"))&&a(this).css({left:j.left-i.left-g.left,width:l,height:f})}});a.ui.plugin.add("resizable","ghost",{start:function(){var e=a(this).data("resizable"),h=e.options,g=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:0.25,
|
|
||||||
display:"block",position:"relative",height:g.height,width:g.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof h.ghost=="string"?h.ghost:"");e.ghost.appendTo(e.helper)},resize:function(){var e=a(this).data("resizable");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=a(this).data("resizable");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}});a.ui.plugin.add("resizable","grid",{resize:function(){var e=
|
|
||||||
a(this).data("resizable"),h=e.options,g=e.size,i=e.originalSize,b=e.originalPosition,f=e.axis;h.grid=typeof h.grid=="number"?[h.grid,h.grid]:h.grid;var j=Math.round((g.width-i.width)/(h.grid[0]||1))*(h.grid[0]||1);h=Math.round((g.height-i.height)/(h.grid[1]||1))*(h.grid[1]||1);if(/^(se|s|e)$/.test(f)){e.size.width=i.width+j;e.size.height=i.height+h}else if(/^(ne)$/.test(f)){e.size.width=i.width+j;e.size.height=i.height+h;e.position.top=b.top-h}else{if(/^(sw)$/.test(f)){e.size.width=i.width+j;e.size.height=
|
|
||||||
i.height+h}else{e.size.width=i.width+j;e.size.height=i.height+h;e.position.top=b.top-h}e.position.left=b.left-j}}});var d=function(e){return parseInt(e,10)||0},c=function(e){return!isNaN(parseInt(e,10))}})(jQuery);
|
|
||||||
(function(a){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var d=this;this.element.addClass("ui-selectable");this.dragged=false;var c;this.refresh=function(){c=a(d.options.filter,d.element[0]);c.each(function(){var e=a(this),h=e.offset();a.data(this,"selectable-item",{element:this,$element:e,left:h.left,top:h.top,right:h.left+e.outerWidth(),bottom:h.top+e.outerHeight(),startselected:false,selected:e.hasClass("ui-selected"),
|
|
||||||
selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})};this.refresh();this.selectees=c.addClass("ui-selectee");this._mouseInit();this.helper=a("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(d){var c=this;this.opos=[d.pageX,
|
|
||||||
d.pageY];if(!this.options.disabled){var e=this.options;this.selectees=a(e.filter,this.element[0]);this._trigger("start",d);a(e.appendTo).append(this.helper);this.helper.css({left:d.clientX,top:d.clientY,width:0,height:0});e.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var h=a.data(this,"selectable-item");h.startselected=true;if(!d.metaKey){h.$element.removeClass("ui-selected");h.selected=false;h.$element.addClass("ui-unselecting");h.unselecting=true;c._trigger("unselecting",
|
|
||||||
d,{unselecting:h.element})}});a(d.target).parents().andSelf().each(function(){var h=a.data(this,"selectable-item");if(h){var g=!d.metaKey||!h.$element.hasClass("ui-selected");h.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");h.unselecting=!g;h.selecting=g;(h.selected=g)?c._trigger("selecting",d,{selecting:h.element}):c._trigger("unselecting",d,{unselecting:h.element});return false}})}},_mouseDrag:function(d){var c=this;this.dragged=true;if(!this.options.disabled){var e=
|
|
||||||
this.options,h=this.opos[0],g=this.opos[1],i=d.pageX,b=d.pageY;if(h>i){var f=i;i=h;h=f}if(g>b){f=b;b=g;g=f}this.helper.css({left:h,top:g,width:i-h,height:b-g});this.selectees.each(function(){var j=a.data(this,"selectable-item");if(!(!j||j.element==c.element[0])){var l=false;if(e.tolerance=="touch")l=!(j.left>i||j.right<h||j.top>b||j.bottom<g);else if(e.tolerance=="fit")l=j.left>h&&j.right<i&&j.top>g&&j.bottom<b;if(l){if(j.selected){j.$element.removeClass("ui-selected");j.selected=false}if(j.unselecting){j.$element.removeClass("ui-unselecting");
|
|
||||||
j.unselecting=false}if(!j.selecting){j.$element.addClass("ui-selecting");j.selecting=true;c._trigger("selecting",d,{selecting:j.element})}}else{if(j.selecting)if(d.metaKey&&j.startselected){j.$element.removeClass("ui-selecting");j.selecting=false;j.$element.addClass("ui-selected");j.selected=true}else{j.$element.removeClass("ui-selecting");j.selecting=false;if(j.startselected){j.$element.addClass("ui-unselecting");j.unselecting=true}c._trigger("unselecting",d,{unselecting:j.element})}if(j.selected)if(!d.metaKey&&
|
|
||||||
!j.startselected){j.$element.removeClass("ui-selected");j.selected=false;j.$element.addClass("ui-unselecting");j.unselecting=true;c._trigger("unselecting",d,{unselecting:j.element})}}}});return false}},_mouseStop:function(d){var c=this;this.dragged=false;a(".ui-unselecting",this.element[0]).each(function(){var e=a.data(this,"selectable-item");e.$element.removeClass("ui-unselecting");e.unselecting=false;e.startselected=false;c._trigger("unselected",d,{unselected:e.element})});a(".ui-selecting",this.element[0]).each(function(){var e=
|
|
||||||
a.data(this,"selectable-item");e.$element.removeClass("ui-selecting").addClass("ui-selected");e.selecting=false;e.selected=true;e.startselected=true;c._trigger("selected",d,{selected:e.element})});this._trigger("stop",d);this.helper.remove();return false}});a.extend(a.ui.selectable,{version:"1.8.16"})})(jQuery);
|
|
||||||
(function(a){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var d=this.options;this.containerCache={};this.element.addClass("ui-sortable");
|
|
||||||
this.refresh();this.floating=this.items.length?d.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var d=this.items.length-1;d>=0;d--)this.items[d].item.removeData("sortable-item");return this},_setOption:function(d,c){if(d===
|
|
||||||
"disabled"){this.options[d]=c;this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")}else a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(d,c){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(d);var e=null,h=this;a(d.target).parents().each(function(){if(a.data(this,"sortable-item")==h){e=a(this);return false}});if(a.data(d.target,"sortable-item")==h)e=a(d.target);if(!e)return false;if(this.options.handle&&
|
|
||||||
!c){var g=false;a(this.options.handle,e).find("*").andSelf().each(function(){if(this==d.target)g=true});if(!g)return false}this.currentItem=e;this._removeCurrentsFromItems();return true},_mouseStart:function(d,c,e){c=this.options;var h=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(d);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,
|
|
||||||
left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:d.pageX-this.offset.left,top:d.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(d);this.originalPageX=d.pageX;this.originalPageY=d.pageY;c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};
|
|
||||||
this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();c.containment&&this._setContainment();if(c.cursor){if(a("body").css("cursor"))this._storedCursor=a("body").css("cursor");a("body").css("cursor",c.cursor)}if(c.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",c.opacity)}if(c.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",c.zIndex)}if(this.scrollParent[0]!=
|
|
||||||
document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",d,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!e)for(e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("activate",d,h._uiHash(this));if(a.ui.ddmanager)a.ui.ddmanager.current=this;a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,d);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(d);
|
|
||||||
return true},_mouseDrag:function(d){this.position=this._generatePosition(d);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var c=this.options,e=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-d.pageY<c.scrollSensitivity)this.scrollParent[0].scrollTop=e=this.scrollParent[0].scrollTop+c.scrollSpeed;else if(d.pageY-this.overflowOffset.top<
|
|
||||||
c.scrollSensitivity)this.scrollParent[0].scrollTop=e=this.scrollParent[0].scrollTop-c.scrollSpeed;if(this.overflowOffset.left+this.scrollParent[0].offsetWidth-d.pageX<c.scrollSensitivity)this.scrollParent[0].scrollLeft=e=this.scrollParent[0].scrollLeft+c.scrollSpeed;else if(d.pageX-this.overflowOffset.left<c.scrollSensitivity)this.scrollParent[0].scrollLeft=e=this.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(d.pageY-a(document).scrollTop()<c.scrollSensitivity)e=a(document).scrollTop(a(document).scrollTop()-
|
|
||||||
c.scrollSpeed);else if(a(window).height()-(d.pageY-a(document).scrollTop())<c.scrollSensitivity)e=a(document).scrollTop(a(document).scrollTop()+c.scrollSpeed);if(d.pageX-a(document).scrollLeft()<c.scrollSensitivity)e=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed);else if(a(window).width()-(d.pageX-a(document).scrollLeft())<c.scrollSensitivity)e=a(document).scrollLeft(a(document).scrollLeft()+c.scrollSpeed)}e!==false&&a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,
|
|
||||||
d)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(c=this.items.length-1;c>=0;c--){e=this.items[c];var h=e.item[0],g=this._intersectsWithPointer(e);if(g)if(h!=this.currentItem[0]&&this.placeholder[g==1?"next":"prev"]()[0]!=h&&!a.ui.contains(this.placeholder[0],h)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],
|
|
||||||
h):true)){this.direction=g==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(e))this._rearrange(d,e);else break;this._trigger("change",d,this._uiHash());break}}this._contactContainers(d);a.ui.ddmanager&&a.ui.ddmanager.drag(this,d);this._trigger("sort",d,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(d,c){if(d){a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,d);if(this.options.revert){var e=this;c=e.placeholder.offset();
|
|
||||||
e.reverting=true;a(this.helper).animate({left:c.left-this.offset.parent.left-e.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:c.top-this.offset.parent.top-e.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){e._clear(d)})}else this._clear(d,c);return false}},cancel:function(){var d=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):
|
|
||||||
this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,d._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,d._uiHash(this));this.containers[c].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();a.extend(this,{helper:null,
|
|
||||||
dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(d){var c=this._getItemsAsjQuery(d&&d.connected),e=[];d=d||{};a(c).each(function(){var h=(a(d.item||this).attr(d.attribute||"id")||"").match(d.expression||/(.+)[-=_](.+)/);if(h)e.push((d.key||h[1]+"[]")+"="+(d.key&&d.expression?h[1]:h[2]))});!e.length&&d.key&&e.push(d.key+"=");return e.join("&")},
|
|
||||||
toArray:function(d){var c=this._getItemsAsjQuery(d&&d.connected),e=[];d=d||{};c.each(function(){e.push(a(d.item||this).attr(d.attribute||"id")||"")});return e},_intersectsWith:function(d){var c=this.positionAbs.left,e=c+this.helperProportions.width,h=this.positionAbs.top,g=h+this.helperProportions.height,i=d.left,b=i+d.width,f=d.top,j=f+d.height,l=this.offset.click.top,o=this.offset.click.left;l=h+l>f&&h+l<j&&c+o>i&&c+o<b;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||
|
|
||||||
this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>d[this.floating?"width":"height"]?l:i<c+this.helperProportions.width/2&&e-this.helperProportions.width/2<b&&f<h+this.helperProportions.height/2&&g-this.helperProportions.height/2<j},_intersectsWithPointer:function(d){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,d.top,d.height);d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,d.left,d.width);c=c&&d;d=this._getDragVerticalDirection();
|
|
||||||
var e=this._getDragHorizontalDirection();if(!c)return false;return this.floating?e&&e=="right"||d=="down"?2:1:d&&(d=="down"?2:1)},_intersectsWithSides:function(d){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,d.top+d.height/2,d.height);d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,d.left+d.width/2,d.width);var e=this._getDragVerticalDirection(),h=this._getDragHorizontalDirection();return this.floating&&h?h=="right"&&d||h=="left"&&!d:e&&(e=="down"&&c||e=="up"&&!c)},
|
|
||||||
_getDragVerticalDirection:function(){var d=this.positionAbs.top-this.lastPositionAbs.top;return d!=0&&(d>0?"down":"up")},_getDragHorizontalDirection:function(){var d=this.positionAbs.left-this.lastPositionAbs.left;return d!=0&&(d>0?"right":"left")},refresh:function(d){this._refreshItems(d);this.refreshPositions();return this},_connectWith:function(){var d=this.options;return d.connectWith.constructor==String?[d.connectWith]:d.connectWith},_getItemsAsjQuery:function(d){var c=[],e=[],h=this._connectWith();
|
|
||||||
if(h&&d)for(d=h.length-1;d>=0;d--)for(var g=a(h[d]),i=g.length-1;i>=0;i--){var b=a.data(g[i],"sortable");if(b&&b!=this&&!b.options.disabled)e.push([a.isFunction(b.options.items)?b.options.items.call(b.element):a(b.options.items,b.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),b])}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),
|
|
||||||
this]);for(d=e.length-1;d>=0;d--)e[d][0].each(function(){c.push(this)});return a(c)},_removeCurrentsFromItems:function(){for(var d=this.currentItem.find(":data(sortable-item)"),c=0;c<this.items.length;c++)for(var e=0;e<d.length;e++)d[e]==this.items[c].item[0]&&this.items.splice(c,1)},_refreshItems:function(d){this.items=[];this.containers=[this];var c=this.items,e=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],d,{item:this.currentItem}):a(this.options.items,this.element),
|
|
||||||
this]],h=this._connectWith();if(h)for(var g=h.length-1;g>=0;g--)for(var i=a(h[g]),b=i.length-1;b>=0;b--){var f=a.data(i[b],"sortable");if(f&&f!=this&&!f.options.disabled){e.push([a.isFunction(f.options.items)?f.options.items.call(f.element[0],d,{item:this.currentItem}):a(f.options.items,f.element),f]);this.containers.push(f)}}for(g=e.length-1;g>=0;g--){d=e[g][1];h=e[g][0];b=0;for(i=h.length;b<i;b++){f=a(h[b]);f.data("sortable-item",d);c.push({item:f,instance:d,width:0,height:0,left:0,top:0})}}},refreshPositions:function(d){if(this.offsetParent&&
|
|
||||||
this.helper)this.offset.parent=this._getParentOffset();for(var c=this.items.length-1;c>=0;c--){var e=this.items[c];if(!(e.instance!=this.currentContainer&&this.currentContainer&&e.item[0]!=this.currentItem[0])){var h=this.options.toleranceElement?a(this.options.toleranceElement,e.item):e.item;if(!d){e.width=h.outerWidth();e.height=h.outerHeight()}h=h.offset();e.left=h.left;e.top=h.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(c=
|
|
||||||
this.containers.length-1;c>=0;c--){h=this.containers[c].element.offset();this.containers[c].containerCache.left=h.left;this.containers[c].containerCache.top=h.top;this.containers[c].containerCache.width=this.containers[c].element.outerWidth();this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(d){var c=d||this,e=c.options;if(!e.placeholder||e.placeholder.constructor==String){var h=e.placeholder;e.placeholder={element:function(){var g=
|
|
||||||
a(document.createElement(c.currentItem[0].nodeName)).addClass(h||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!h)g.style.visibility="hidden";return g},update:function(g,i){if(!(h&&!e.forcePlaceholderSize)){i.height()||i.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10));i.width()||i.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||
|
|
||||||
0,10))}}}}c.placeholder=a(e.placeholder.element.call(c.element,c.currentItem));c.currentItem.after(c.placeholder);e.placeholder.update(c,c.placeholder)},_contactContainers:function(d){for(var c=null,e=null,h=this.containers.length-1;h>=0;h--)if(!a.ui.contains(this.currentItem[0],this.containers[h].element[0]))if(this._intersectsWith(this.containers[h].containerCache)){if(!(c&&a.ui.contains(this.containers[h].element[0],c.element[0]))){c=this.containers[h];e=h}}else if(this.containers[h].containerCache.over){this.containers[h]._trigger("out",
|
|
||||||
d,this._uiHash(this));this.containers[h].containerCache.over=0}if(c)if(this.containers.length===1){this.containers[e]._trigger("over",d,this._uiHash(this));this.containers[e].containerCache.over=1}else if(this.currentContainer!=this.containers[e]){c=1E4;h=null;for(var g=this.positionAbs[this.containers[e].floating?"left":"top"],i=this.items.length-1;i>=0;i--)if(a.ui.contains(this.containers[e].element[0],this.items[i].item[0])){var b=this.items[i][this.containers[e].floating?"left":"top"];if(Math.abs(b-
|
|
||||||
g)<c){c=Math.abs(b-g);h=this.items[i]}}if(h||this.options.dropOnEmpty){this.currentContainer=this.containers[e];h?this._rearrange(d,h,null,true):this._rearrange(d,null,this.containers[e].element,true);this._trigger("change",d,this._uiHash());this.containers[e]._trigger("change",d,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[e]._trigger("over",d,this._uiHash(this));this.containers[e].containerCache.over=1}}},_createHelper:function(d){var c=
|
|
||||||
this.options;d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[d,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;d.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]);if(d[0]==this.currentItem[0])this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};if(d[0].style.width==
|
|
||||||
""||c.forceHelperSize)d.width(this.currentItem.width());if(d[0].style.height==""||c.forceHelperSize)d.height(this.currentItem.height());return d},_adjustOffsetFromHelper:function(d){if(typeof d=="string")d=d.split(" ");if(a.isArray(d))d={left:+d[0],top:+d[1]||0};if("left"in d)this.offset.click.left=d.left+this.margins.left;if("right"in d)this.offset.click.left=this.helperProportions.width-d.right+this.margins.left;if("top"in d)this.offset.click.top=d.top+this.margins.top;if("bottom"in d)this.offset.click.top=
|
|
||||||
this.helperProportions.height-d.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var d=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){d.left+=this.scrollParent.scrollLeft();d.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)d=
|
|
||||||
{top:0,left:0};return{top:d.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:d.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var d=this.currentItem.position();return{top:d.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:d.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),
|
|
||||||
10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var d=this.options;if(d.containment=="parent")d.containment=this.helper[0].parentNode;if(d.containment=="document"||d.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(d.containment=="document"?
|
|
||||||
document:window).width()-this.helperProportions.width-this.margins.left,(a(d.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(d.containment)){var c=a(d.containment)[0];d=a(d.containment).offset();var e=a(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),
|
|
||||||
10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(d,c){if(!c)c=
|
|
||||||
this.position;d=d=="absolute"?1:-1;var e=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=/(html|body)/i.test(e[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():h?0:e.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&
|
|
||||||
this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():h?0:e.scrollLeft())*d)}},_generatePosition:function(d){var c=this.options,e=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=/(html|body)/i.test(e[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();
|
|
||||||
var g=d.pageX,i=d.pageY;if(this.originalPosition){if(this.containment){if(d.pageX-this.offset.click.left<this.containment[0])g=this.containment[0]+this.offset.click.left;if(d.pageY-this.offset.click.top<this.containment[1])i=this.containment[1]+this.offset.click.top;if(d.pageX-this.offset.click.left>this.containment[2])g=this.containment[2]+this.offset.click.left;if(d.pageY-this.offset.click.top>this.containment[3])i=this.containment[3]+this.offset.click.top}if(c.grid){i=this.originalPageY+Math.round((i-
|
|
||||||
this.originalPageY)/c.grid[1])*c.grid[1];i=this.containment?!(i-this.offset.click.top<this.containment[1]||i-this.offset.click.top>this.containment[3])?i:!(i-this.offset.click.top<this.containment[1])?i-c.grid[1]:i+c.grid[1]:i;g=this.originalPageX+Math.round((g-this.originalPageX)/c.grid[0])*c.grid[0];g=this.containment?!(g-this.offset.click.left<this.containment[0]||g-this.offset.click.left>this.containment[2])?g:!(g-this.offset.click.left<this.containment[0])?g-c.grid[0]:g+c.grid[0]:g}}return{top:i-
|
|
||||||
this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():h?0:e.scrollTop()),left:g-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():h?0:e.scrollLeft())}},_rearrange:function(d,c,e,h){e?e[0].appendChild(this.placeholder[0]):c.item[0].parentNode.insertBefore(this.placeholder[0],
|
|
||||||
this.direction=="down"?c.item[0]:c.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var g=this,i=this.counter;window.setTimeout(function(){i==g.counter&&g.refreshPositions(!h)},0)},_clear:function(d,c){this.reverting=false;var e=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var h in this._storedCSS)if(this._storedCSS[h]=="auto"||this._storedCSS[h]=="static")this._storedCSS[h]=
|
|
||||||
"";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!c&&e.push(function(g){this._trigger("receive",g,this._uiHash(this.fromOutside))});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!c)e.push(function(g){this._trigger("update",g,this._uiHash())});if(!a.ui.contains(this.element[0],this.currentItem[0])){c||e.push(function(g){this._trigger("remove",
|
|
||||||
g,this._uiHash())});for(h=this.containers.length-1;h>=0;h--)if(a.ui.contains(this.containers[h].element[0],this.currentItem[0])&&!c){e.push(function(g){return function(i){g._trigger("receive",i,this._uiHash(this))}}.call(this,this.containers[h]));e.push(function(g){return function(i){g._trigger("update",i,this._uiHash(this))}}.call(this,this.containers[h]))}}for(h=this.containers.length-1;h>=0;h--){c||e.push(function(g){return function(i){g._trigger("deactivate",i,this._uiHash(this))}}.call(this,
|
|
||||||
this.containers[h]));if(this.containers[h].containerCache.over){e.push(function(g){return function(i){g._trigger("out",i,this._uiHash(this))}}.call(this,this.containers[h]));this.containers[h].containerCache.over=0}}this._storedCursor&&a("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",
|
|
||||||
d,this._uiHash());for(h=0;h<e.length;h++)e[h].call(this,d);this._trigger("stop",d,this._uiHash())}return false}c||this._trigger("beforeStop",d,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!c){for(h=0;h<e.length;h++)e[h].call(this,d);this._trigger("stop",d,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){a.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()},
|
|
||||||
_uiHash:function(d){var c=d||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:d?d.element:null}}});a.extend(a.ui.sortable,{version:"1.8.16"})})(jQuery);
|
|
||||||
jQuery.effects||function(a,d){function c(n){var k;if(n&&n.constructor==Array&&n.length==3)return n;if(k=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(n))return[parseInt(k[1],10),parseInt(k[2],10),parseInt(k[3],10)];if(k=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(n))return[parseFloat(k[1])*2.55,parseFloat(k[2])*2.55,parseFloat(k[3])*2.55];if(k=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(n))return[parseInt(k[1],
|
|
||||||
16),parseInt(k[2],16),parseInt(k[3],16)];if(k=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(n))return[parseInt(k[1]+k[1],16),parseInt(k[2]+k[2],16),parseInt(k[3]+k[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(n))return j.transparent;return j[a.trim(n).toLowerCase()]}function e(n,k){var m;do{m=a.curCSS(n,k);if(m!=""&&m!="transparent"||a.nodeName(n,"body"))break;k="backgroundColor"}while(n=n.parentNode);return c(m)}function h(){var n=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,
|
|
||||||
k={},m,p;if(n&&n.length&&n[0]&&n[n[0]])for(var q=n.length;q--;){m=n[q];if(typeof n[m]=="string"){p=m.replace(/\-(\w)/g,function(s,r){return r.toUpperCase()});k[p]=n[m]}}else for(m in n)if(typeof n[m]==="string")k[m]=n[m];return k}function g(n){var k,m;for(k in n){m=n[k];if(m==null||a.isFunction(m)||k in o||/scrollbar/.test(k)||!/color/i.test(k)&&isNaN(parseFloat(m)))delete n[k]}return n}function i(n,k){var m={_:0},p;for(p in k)if(n[p]!=k[p])m[p]=k[p];return m}function b(n,k,m,p){if(typeof n=="object"){p=
|
|
||||||
k;m=null;k=n;n=k.effect}if(a.isFunction(k)){p=k;m=null;k={}}if(typeof k=="number"||a.fx.speeds[k]){p=m;m=k;k={}}if(a.isFunction(m)){p=m;m=null}k=k||{};m=m||k.duration;m=a.fx.off?0:typeof m=="number"?m:m in a.fx.speeds?a.fx.speeds[m]:a.fx.speeds._default;p=p||k.complete;return[n,k,m,p]}function f(n){if(!n||typeof n==="number"||a.fx.speeds[n])return true;if(typeof n==="string"&&!a.effects[n])return true;return false}a.effects={};a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor",
|
|
||||||
"borderTopColor","borderColor","color","outlineColor"],function(n,k){a.fx.step[k]=function(m){if(!m.colorInit){m.start=e(m.elem,k);m.end=c(m.end);m.colorInit=true}m.elem.style[k]="rgb("+Math.max(Math.min(parseInt(m.pos*(m.end[0]-m.start[0])+m.start[0],10),255),0)+","+Math.max(Math.min(parseInt(m.pos*(m.end[1]-m.start[1])+m.start[1],10),255),0)+","+Math.max(Math.min(parseInt(m.pos*(m.end[2]-m.start[2])+m.start[2],10),255),0)+")"}});var j={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,
|
|
||||||
0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,
|
|
||||||
211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},l=["add","remove","toggle"],o={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(n,k,m,
|
|
||||||
p){if(a.isFunction(m)){p=m;m=null}return this.queue(function(){var q=a(this),s=q.attr("style")||" ",r=g(h.call(this)),u,v=q.attr("class");a.each(l,function(w,x){n[x]&&q[x+"Class"](n[x])});u=g(h.call(this));q.attr("class",v);q.animate(i(r,u),{queue:false,duration:k,easing:m,complete:function(){a.each(l,function(w,x){n[x]&&q[x+"Class"](n[x])});if(typeof q.attr("style")=="object"){q.attr("style").cssText="";q.attr("style").cssText=s}else q.attr("style",s);p&&p.apply(this,arguments);a.dequeue(this)}})})};
|
|
||||||
a.fn.extend({_addClass:a.fn.addClass,addClass:function(n,k,m,p){return k?a.effects.animateClass.apply(this,[{add:n},k,m,p]):this._addClass(n)},_removeClass:a.fn.removeClass,removeClass:function(n,k,m,p){return k?a.effects.animateClass.apply(this,[{remove:n},k,m,p]):this._removeClass(n)},_toggleClass:a.fn.toggleClass,toggleClass:function(n,k,m,p,q){return typeof k=="boolean"||k===d?m?a.effects.animateClass.apply(this,[k?{add:n}:{remove:n},m,p,q]):this._toggleClass(n,k):a.effects.animateClass.apply(this,
|
|
||||||
[{toggle:n},k,m,p])},switchClass:function(n,k,m,p,q){return a.effects.animateClass.apply(this,[{add:k,remove:n},m,p,q])}});a.extend(a.effects,{version:"1.8.16",save:function(n,k){for(var m=0;m<k.length;m++)k[m]!==null&&n.data("ec.storage."+k[m],n[0].style[k[m]])},restore:function(n,k){for(var m=0;m<k.length;m++)k[m]!==null&&n.css(k[m],n.data("ec.storage."+k[m]))},setMode:function(n,k){if(k=="toggle")k=n.is(":hidden")?"show":"hide";return k},getBaseline:function(n,k){var m;switch(n[0]){case "top":m=
|
|
||||||
0;break;case "middle":m=0.5;break;case "bottom":m=1;break;default:m=n[0]/k.height}switch(n[1]){case "left":n=0;break;case "center":n=0.5;break;case "right":n=1;break;default:n=n[1]/k.width}return{x:n,y:m}},createWrapper:function(n){if(n.parent().is(".ui-effects-wrapper"))return n.parent();var k={width:n.outerWidth(true),height:n.outerHeight(true),"float":n.css("float")},m=a("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),
|
|
||||||
p=document.activeElement;n.wrap(m);if(n[0]===p||a.contains(n[0],p))a(p).focus();m=n.parent();if(n.css("position")=="static"){m.css({position:"relative"});n.css({position:"relative"})}else{a.extend(k,{position:n.css("position"),zIndex:n.css("z-index")});a.each(["top","left","bottom","right"],function(q,s){k[s]=n.css(s);if(isNaN(parseInt(k[s],10)))k[s]="auto"});n.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return m.css(k).show()},removeWrapper:function(n){var k,m=document.activeElement;
|
|
||||||
if(n.parent().is(".ui-effects-wrapper")){k=n.parent().replaceWith(n);if(n[0]===m||a.contains(n[0],m))a(m).focus();return k}return n},setTransition:function(n,k,m,p){p=p||{};a.each(k,function(q,s){unit=n.cssUnit(s);if(unit[0]>0)p[s]=unit[0]*m+unit[1]});return p}});a.fn.extend({effect:function(n){var k=b.apply(this,arguments),m={options:k[1],duration:k[2],callback:k[3]};k=m.options.mode;var p=a.effects[n];if(a.fx.off||!p)return k?this[k](m.duration,m.callback):this.each(function(){m.callback&&m.callback.call(this)});
|
|
||||||
return p.call(this,m)},_show:a.fn.show,show:function(n){if(f(n))return this._show.apply(this,arguments);else{var k=b.apply(this,arguments);k[1].mode="show";return this.effect.apply(this,k)}},_hide:a.fn.hide,hide:function(n){if(f(n))return this._hide.apply(this,arguments);else{var k=b.apply(this,arguments);k[1].mode="hide";return this.effect.apply(this,k)}},__toggle:a.fn.toggle,toggle:function(n){if(f(n)||typeof n==="boolean"||a.isFunction(n))return this.__toggle.apply(this,arguments);else{var k=b.apply(this,
|
|
||||||
arguments);k[1].mode="toggle";return this.effect.apply(this,k)}},cssUnit:function(n){var k=this.css(n),m=[];a.each(["em","px","%","pt"],function(p,q){if(k.indexOf(q)>0)m=[parseFloat(k),q]});return m}});a.easing.jswing=a.easing.swing;a.extend(a.easing,{def:"easeOutQuad",swing:function(n,k,m,p,q){return a.easing[a.easing.def](n,k,m,p,q)},easeInQuad:function(n,k,m,p,q){return p*(k/=q)*k+m},easeOutQuad:function(n,k,m,p,q){return-p*(k/=q)*(k-2)+m},easeInOutQuad:function(n,k,m,p,q){if((k/=q/2)<1)return p/
|
|
||||||
2*k*k+m;return-p/2*(--k*(k-2)-1)+m},easeInCubic:function(n,k,m,p,q){return p*(k/=q)*k*k+m},easeOutCubic:function(n,k,m,p,q){return p*((k=k/q-1)*k*k+1)+m},easeInOutCubic:function(n,k,m,p,q){if((k/=q/2)<1)return p/2*k*k*k+m;return p/2*((k-=2)*k*k+2)+m},easeInQuart:function(n,k,m,p,q){return p*(k/=q)*k*k*k+m},easeOutQuart:function(n,k,m,p,q){return-p*((k=k/q-1)*k*k*k-1)+m},easeInOutQuart:function(n,k,m,p,q){if((k/=q/2)<1)return p/2*k*k*k*k+m;return-p/2*((k-=2)*k*k*k-2)+m},easeInQuint:function(n,k,m,
|
|
||||||
p,q){return p*(k/=q)*k*k*k*k+m},easeOutQuint:function(n,k,m,p,q){return p*((k=k/q-1)*k*k*k*k+1)+m},easeInOutQuint:function(n,k,m,p,q){if((k/=q/2)<1)return p/2*k*k*k*k*k+m;return p/2*((k-=2)*k*k*k*k+2)+m},easeInSine:function(n,k,m,p,q){return-p*Math.cos(k/q*(Math.PI/2))+p+m},easeOutSine:function(n,k,m,p,q){return p*Math.sin(k/q*(Math.PI/2))+m},easeInOutSine:function(n,k,m,p,q){return-p/2*(Math.cos(Math.PI*k/q)-1)+m},easeInExpo:function(n,k,m,p,q){return k==0?m:p*Math.pow(2,10*(k/q-1))+m},easeOutExpo:function(n,
|
|
||||||
k,m,p,q){return k==q?m+p:p*(-Math.pow(2,-10*k/q)+1)+m},easeInOutExpo:function(n,k,m,p,q){if(k==0)return m;if(k==q)return m+p;if((k/=q/2)<1)return p/2*Math.pow(2,10*(k-1))+m;return p/2*(-Math.pow(2,-10*--k)+2)+m},easeInCirc:function(n,k,m,p,q){return-p*(Math.sqrt(1-(k/=q)*k)-1)+m},easeOutCirc:function(n,k,m,p,q){return p*Math.sqrt(1-(k=k/q-1)*k)+m},easeInOutCirc:function(n,k,m,p,q){if((k/=q/2)<1)return-p/2*(Math.sqrt(1-k*k)-1)+m;return p/2*(Math.sqrt(1-(k-=2)*k)+1)+m},easeInElastic:function(n,k,m,
|
|
||||||
p,q){n=1.70158;var s=0,r=p;if(k==0)return m;if((k/=q)==1)return m+p;s||(s=q*0.3);if(r<Math.abs(p)){r=p;n=s/4}else n=s/(2*Math.PI)*Math.asin(p/r);return-(r*Math.pow(2,10*(k-=1))*Math.sin((k*q-n)*2*Math.PI/s))+m},easeOutElastic:function(n,k,m,p,q){n=1.70158;var s=0,r=p;if(k==0)return m;if((k/=q)==1)return m+p;s||(s=q*0.3);if(r<Math.abs(p)){r=p;n=s/4}else n=s/(2*Math.PI)*Math.asin(p/r);return r*Math.pow(2,-10*k)*Math.sin((k*q-n)*2*Math.PI/s)+p+m},easeInOutElastic:function(n,k,m,p,q){n=1.70158;var s=
|
|
||||||
0,r=p;if(k==0)return m;if((k/=q/2)==2)return m+p;s||(s=q*0.3*1.5);if(r<Math.abs(p)){r=p;n=s/4}else n=s/(2*Math.PI)*Math.asin(p/r);if(k<1)return-0.5*r*Math.pow(2,10*(k-=1))*Math.sin((k*q-n)*2*Math.PI/s)+m;return r*Math.pow(2,-10*(k-=1))*Math.sin((k*q-n)*2*Math.PI/s)*0.5+p+m},easeInBack:function(n,k,m,p,q,s){if(s==d)s=1.70158;return p*(k/=q)*k*((s+1)*k-s)+m},easeOutBack:function(n,k,m,p,q,s){if(s==d)s=1.70158;return p*((k=k/q-1)*k*((s+1)*k+s)+1)+m},easeInOutBack:function(n,k,m,p,q,s){if(s==d)s=1.70158;
|
|
||||||
if((k/=q/2)<1)return p/2*k*k*(((s*=1.525)+1)*k-s)+m;return p/2*((k-=2)*k*(((s*=1.525)+1)*k+s)+2)+m},easeInBounce:function(n,k,m,p,q){return p-a.easing.easeOutBounce(n,q-k,0,p,q)+m},easeOutBounce:function(n,k,m,p,q){return(k/=q)<1/2.75?p*7.5625*k*k+m:k<2/2.75?p*(7.5625*(k-=1.5/2.75)*k+0.75)+m:k<2.5/2.75?p*(7.5625*(k-=2.25/2.75)*k+0.9375)+m:p*(7.5625*(k-=2.625/2.75)*k+0.984375)+m},easeInOutBounce:function(n,k,m,p,q){if(k<q/2)return a.easing.easeInBounce(n,k*2,0,p,q)*0.5+m;return a.easing.easeOutBounce(n,
|
|
||||||
k*2-q,0,p,q)*0.5+p*0.5+m}})}(jQuery);
|
|
||||||
(function(a){a.effects.blind=function(d){return this.queue(function(){var c=a(this),e=["position","top","bottom","left","right"],h=a.effects.setMode(c,d.options.mode||"hide"),g=d.options.direction||"vertical";a.effects.save(c,e);c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),b=g=="vertical"?"height":"width";g=g=="vertical"?i.height():i.width();h=="show"&&i.css(b,0);var f={};f[b]=h=="show"?g:0;i.animate(f,d.duration,d.options.easing,function(){h=="hide"&&c.hide();a.effects.restore(c,
|
|
||||||
e);a.effects.removeWrapper(c);d.callback&&d.callback.apply(c[0],arguments);c.dequeue()})})}})(jQuery);
|
|
||||||
(function(a){a.effects.bounce=function(d){return this.queue(function(){var c=a(this),e=["position","top","bottom","left","right"],h=a.effects.setMode(c,d.options.mode||"effect"),g=d.options.direction||"up",i=d.options.distance||20,b=d.options.times||5,f=d.duration||250;/show|hide/.test(h)&&e.push("opacity");a.effects.save(c,e);c.show();a.effects.createWrapper(c);var j=g=="up"||g=="down"?"top":"left";g=g=="up"||g=="left"?"pos":"neg";i=d.options.distance||(j=="top"?c.outerHeight({margin:true})/3:c.outerWidth({margin:true})/
|
|
||||||
3);if(h=="show")c.css("opacity",0).css(j,g=="pos"?-i:i);if(h=="hide")i/=b*2;h!="hide"&&b--;if(h=="show"){var l={opacity:1};l[j]=(g=="pos"?"+=":"-=")+i;c.animate(l,f/2,d.options.easing);i/=2;b--}for(l=0;l<b;l++){var o={},n={};o[j]=(g=="pos"?"-=":"+=")+i;n[j]=(g=="pos"?"+=":"-=")+i;c.animate(o,f/2,d.options.easing).animate(n,f/2,d.options.easing);i=h=="hide"?i*2:i/2}if(h=="hide"){l={opacity:0};l[j]=(g=="pos"?"-=":"+=")+i;c.animate(l,f/2,d.options.easing,function(){c.hide();a.effects.restore(c,e);a.effects.removeWrapper(c);
|
|
||||||
d.callback&&d.callback.apply(this,arguments)})}else{o={};n={};o[j]=(g=="pos"?"-=":"+=")+i;n[j]=(g=="pos"?"+=":"-=")+i;c.animate(o,f/2,d.options.easing).animate(n,f/2,d.options.easing,function(){a.effects.restore(c,e);a.effects.removeWrapper(c);d.callback&&d.callback.apply(this,arguments)})}c.queue("fx",function(){c.dequeue()});c.dequeue()})}})(jQuery);
|
|
||||||
(function(a){a.effects.clip=function(d){return this.queue(function(){var c=a(this),e=["position","top","bottom","left","right","height","width"],h=a.effects.setMode(c,d.options.mode||"hide"),g=d.options.direction||"vertical";a.effects.save(c,e);c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"});i=c[0].tagName=="IMG"?i:c;var b={size:g=="vertical"?"height":"width",position:g=="vertical"?"top":"left"};g=g=="vertical"?i.height():i.width();if(h=="show"){i.css(b.size,0);i.css(b.position,
|
|
||||||
g/2)}var f={};f[b.size]=h=="show"?g:0;f[b.position]=h=="show"?0:g/2;i.animate(f,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){h=="hide"&&c.hide();a.effects.restore(c,e);a.effects.removeWrapper(c);d.callback&&d.callback.apply(c[0],arguments);c.dequeue()}})})}})(jQuery);
|
|
||||||
(function(a){a.effects.drop=function(d){return this.queue(function(){var c=a(this),e=["position","top","bottom","left","right","opacity"],h=a.effects.setMode(c,d.options.mode||"hide"),g=d.options.direction||"left";a.effects.save(c,e);c.show();a.effects.createWrapper(c);var i=g=="up"||g=="down"?"top":"left";g=g=="up"||g=="left"?"pos":"neg";var b=d.options.distance||(i=="top"?c.outerHeight({margin:true})/2:c.outerWidth({margin:true})/2);if(h=="show")c.css("opacity",0).css(i,g=="pos"?-b:b);var f={opacity:h==
|
|
||||||
"show"?1:0};f[i]=(h=="show"?g=="pos"?"+=":"-=":g=="pos"?"-=":"+=")+b;c.animate(f,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){h=="hide"&&c.hide();a.effects.restore(c,e);a.effects.removeWrapper(c);d.callback&&d.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);
|
|
||||||
(function(a){a.effects.explode=function(d){return this.queue(function(){var c=d.options.pieces?Math.round(Math.sqrt(d.options.pieces)):3,e=d.options.pieces?Math.round(Math.sqrt(d.options.pieces)):3;d.options.mode=d.options.mode=="toggle"?a(this).is(":visible")?"hide":"show":d.options.mode;var h=a(this).show().css("visibility","hidden"),g=h.offset();g.top-=parseInt(h.css("marginTop"),10)||0;g.left-=parseInt(h.css("marginLeft"),10)||0;for(var i=h.outerWidth(true),b=h.outerHeight(true),f=0;f<c;f++)for(var j=
|
|
||||||
0;j<e;j++)h.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-j*(i/e),top:-f*(b/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:i/e,height:b/c,left:g.left+j*(i/e)+(d.options.mode=="show"?(j-Math.floor(e/2))*(i/e):0),top:g.top+f*(b/c)+(d.options.mode=="show"?(f-Math.floor(c/2))*(b/c):0),opacity:d.options.mode=="show"?0:1}).animate({left:g.left+j*(i/e)+(d.options.mode=="show"?0:(j-Math.floor(e/2))*(i/e)),top:g.top+
|
|
||||||
f*(b/c)+(d.options.mode=="show"?0:(f-Math.floor(c/2))*(b/c)),opacity:d.options.mode=="show"?1:0},d.duration||500);setTimeout(function(){d.options.mode=="show"?h.css({visibility:"visible"}):h.css({visibility:"visible"}).hide();d.callback&&d.callback.apply(h[0]);h.dequeue();a("div.ui-effects-explode").remove()},d.duration||500)})}})(jQuery);
|
|
||||||
(function(a){a.effects.fade=function(d){return this.queue(function(){var c=a(this),e=a.effects.setMode(c,d.options.mode||"hide");c.animate({opacity:e},{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){d.callback&&d.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);
|
|
||||||
(function(a){a.effects.fold=function(d){return this.queue(function(){var c=a(this),e=["position","top","bottom","left","right"],h=a.effects.setMode(c,d.options.mode||"hide"),g=d.options.size||15,i=!!d.options.horizFirst,b=d.duration?d.duration/2:a.fx.speeds._default/2;a.effects.save(c,e);c.show();var f=a.effects.createWrapper(c).css({overflow:"hidden"}),j=h=="show"!=i,l=j?["width","height"]:["height","width"];j=j?[f.width(),f.height()]:[f.height(),f.width()];var o=/([0-9]+)%/.exec(g);if(o)g=parseInt(o[1],
|
|
||||||
10)/100*j[h=="hide"?0:1];if(h=="show")f.css(i?{height:0,width:g}:{height:g,width:0});i={};o={};i[l[0]]=h=="show"?j[0]:g;o[l[1]]=h=="show"?j[1]:0;f.animate(i,b,d.options.easing).animate(o,b,d.options.easing,function(){h=="hide"&&c.hide();a.effects.restore(c,e);a.effects.removeWrapper(c);d.callback&&d.callback.apply(c[0],arguments);c.dequeue()})})}})(jQuery);
|
|
||||||
(function(a){a.effects.highlight=function(d){return this.queue(function(){var c=a(this),e=["backgroundImage","backgroundColor","opacity"],h=a.effects.setMode(c,d.options.mode||"show"),g={backgroundColor:c.css("backgroundColor")};if(h=="hide")g.opacity=0;a.effects.save(c,e);c.show().css({backgroundImage:"none",backgroundColor:d.options.color||"#ffff99"}).animate(g,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){h=="hide"&&c.hide();a.effects.restore(c,e);h=="show"&&!a.support.opacity&&
|
|
||||||
this.style.removeAttribute("filter");d.callback&&d.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);
|
|
||||||
(function(a){a.effects.pulsate=function(d){return this.queue(function(){var c=a(this),e=a.effects.setMode(c,d.options.mode||"show");times=(d.options.times||5)*2-1;duration=d.duration?d.duration/2:a.fx.speeds._default/2;isVisible=c.is(":visible");animateTo=0;if(!isVisible){c.css("opacity",0).show();animateTo=1}if(e=="hide"&&isVisible||e=="show"&&!isVisible)times--;for(e=0;e<times;e++){c.animate({opacity:animateTo},duration,d.options.easing);animateTo=(animateTo+1)%2}c.animate({opacity:animateTo},duration,
|
|
||||||
d.options.easing,function(){animateTo==0&&c.hide();d.callback&&d.callback.apply(this,arguments)});c.queue("fx",function(){c.dequeue()}).dequeue()})}})(jQuery);
|
|
||||||
(function(a){a.effects.puff=function(d){return this.queue(function(){var c=a(this),e=a.effects.setMode(c,d.options.mode||"hide"),h=parseInt(d.options.percent,10)||150,g=h/100,i={height:c.height(),width:c.width()};a.extend(d.options,{fade:true,mode:e,percent:e=="hide"?h:100,from:e=="hide"?i:{height:i.height*g,width:i.width*g}});c.effect("scale",d.options,d.duration,d.callback);c.dequeue()})};a.effects.scale=function(d){return this.queue(function(){var c=a(this),e=a.extend(true,{},d.options),h=a.effects.setMode(c,
|
|
||||||
d.options.mode||"effect"),g=parseInt(d.options.percent,10)||(parseInt(d.options.percent,10)==0?0:h=="hide"?0:100),i=d.options.direction||"both",b=d.options.origin;if(h!="effect"){e.origin=b||["middle","center"];e.restore=true}b={height:c.height(),width:c.width()};c.from=d.options.from||(h=="show"?{height:0,width:0}:b);g={y:i!="horizontal"?g/100:1,x:i!="vertical"?g/100:1};c.to={height:b.height*g.y,width:b.width*g.x};if(d.options.fade){if(h=="show"){c.from.opacity=0;c.to.opacity=1}if(h=="hide"){c.from.opacity=
|
|
||||||
1;c.to.opacity=0}}e.from=c.from;e.to=c.to;e.mode=h;c.effect("size",e,d.duration,d.callback);c.dequeue()})};a.effects.size=function(d){return this.queue(function(){var c=a(this),e=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],g=["width","height","overflow"],i=["fontSize"],b=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],f=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],
|
|
||||||
j=a.effects.setMode(c,d.options.mode||"effect"),l=d.options.restore||false,o=d.options.scale||"both",n=d.options.origin,k={height:c.height(),width:c.width()};c.from=d.options.from||k;c.to=d.options.to||k;if(n){n=a.effects.getBaseline(n,k);c.from.top=(k.height-c.from.height)*n.y;c.from.left=(k.width-c.from.width)*n.x;c.to.top=(k.height-c.to.height)*n.y;c.to.left=(k.width-c.to.width)*n.x}var m={from:{y:c.from.height/k.height,x:c.from.width/k.width},to:{y:c.to.height/k.height,x:c.to.width/k.width}};
|
|
||||||
if(o=="box"||o=="both"){if(m.from.y!=m.to.y){e=e.concat(b);c.from=a.effects.setTransition(c,b,m.from.y,c.from);c.to=a.effects.setTransition(c,b,m.to.y,c.to)}if(m.from.x!=m.to.x){e=e.concat(f);c.from=a.effects.setTransition(c,f,m.from.x,c.from);c.to=a.effects.setTransition(c,f,m.to.x,c.to)}}if(o=="content"||o=="both")if(m.from.y!=m.to.y){e=e.concat(i);c.from=a.effects.setTransition(c,i,m.from.y,c.from);c.to=a.effects.setTransition(c,i,m.to.y,c.to)}a.effects.save(c,l?e:h);c.show();a.effects.createWrapper(c);
|
|
||||||
c.css("overflow","hidden").css(c.from);if(o=="content"||o=="both"){b=b.concat(["marginTop","marginBottom"]).concat(i);f=f.concat(["marginLeft","marginRight"]);g=e.concat(b).concat(f);c.find("*[width]").each(function(){child=a(this);l&&a.effects.save(child,g);var p={height:child.height(),width:child.width()};child.from={height:p.height*m.from.y,width:p.width*m.from.x};child.to={height:p.height*m.to.y,width:p.width*m.to.x};if(m.from.y!=m.to.y){child.from=a.effects.setTransition(child,b,m.from.y,child.from);
|
|
||||||
child.to=a.effects.setTransition(child,b,m.to.y,child.to)}if(m.from.x!=m.to.x){child.from=a.effects.setTransition(child,f,m.from.x,child.from);child.to=a.effects.setTransition(child,f,m.to.x,child.to)}child.css(child.from);child.animate(child.to,d.duration,d.options.easing,function(){l&&a.effects.restore(child,g)})})}c.animate(c.to,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){c.to.opacity===0&&c.css("opacity",c.from.opacity);j=="hide"&&c.hide();a.effects.restore(c,
|
|
||||||
l?e:h);a.effects.removeWrapper(c);d.callback&&d.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);
|
|
||||||
(function(a){a.effects.shake=function(d){return this.queue(function(){var c=a(this),e=["position","top","bottom","left","right"];a.effects.setMode(c,d.options.mode||"effect");var h=d.options.direction||"left",g=d.options.distance||20,i=d.options.times||3,b=d.duration||d.options.duration||140;a.effects.save(c,e);c.show();a.effects.createWrapper(c);var f=h=="up"||h=="down"?"top":"left",j=h=="up"||h=="left"?"pos":"neg";h={};var l={},o={};h[f]=(j=="pos"?"-=":"+=")+g;l[f]=(j=="pos"?"+=":"-=")+g*2;o[f]=
|
|
||||||
(j=="pos"?"-=":"+=")+g*2;c.animate(h,b,d.options.easing);for(g=1;g<i;g++)c.animate(l,b,d.options.easing).animate(o,b,d.options.easing);c.animate(l,b,d.options.easing).animate(h,b/2,d.options.easing,function(){a.effects.restore(c,e);a.effects.removeWrapper(c);d.callback&&d.callback.apply(this,arguments)});c.queue("fx",function(){c.dequeue()});c.dequeue()})}})(jQuery);
|
|
||||||
(function(a){a.effects.slide=function(d){return this.queue(function(){var c=a(this),e=["position","top","bottom","left","right"],h=a.effects.setMode(c,d.options.mode||"show"),g=d.options.direction||"left";a.effects.save(c,e);c.show();a.effects.createWrapper(c).css({overflow:"hidden"});var i=g=="up"||g=="down"?"top":"left";g=g=="up"||g=="left"?"pos":"neg";var b=d.options.distance||(i=="top"?c.outerHeight({margin:true}):c.outerWidth({margin:true}));if(h=="show")c.css(i,g=="pos"?isNaN(b)?"-"+b:-b:b);
|
|
||||||
var f={};f[i]=(h=="show"?g=="pos"?"+=":"-=":g=="pos"?"-=":"+=")+b;c.animate(f,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){h=="hide"&&c.hide();a.effects.restore(c,e);a.effects.removeWrapper(c);d.callback&&d.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);
|
|
||||||
(function(a){a.effects.transfer=function(d){return this.queue(function(){var c=a(this),e=a(d.options.to),h=e.offset();e={top:h.top,left:h.left,height:e.innerHeight(),width:e.innerWidth()};h=c.offset();var g=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(d.options.className).css({top:h.top,left:h.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(e,d.duration,d.options.easing,function(){g.remove();d.callback&&d.callback.apply(c[0],arguments);
|
|
||||||
c.dequeue()})})}})(jQuery);
|
|
||||||
(function(a){a.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var d=this,c=d.options;d.running=0;d.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");d.headers=
|
|
||||||
d.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c.disabled||a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){c.disabled||a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){c.disabled||a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){c.disabled||a(this).removeClass("ui-state-focus")});d.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
|
|
||||||
if(c.navigation){var e=d.element.find("a").filter(c.navigationFilter).eq(0);if(e.length){var h=e.closest(".ui-accordion-header");d.active=h.length?h:e.closest(".ui-accordion-content").prev()}}d.active=d._findActive(d.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");d.active.next().addClass("ui-accordion-content-active");d._createIcons();d.resize();d.element.attr("role","tablist");d.headers.attr("role","tab").bind("keydown.accordion",
|
|
||||||
function(g){return d._keydown(g)}).next().attr("role","tabpanel");d.headers.not(d.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();d.active.length?d.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):d.headers.eq(0).attr("tabIndex",0);a.browser.safari||d.headers.find("a").attr("tabIndex",-1);c.event&&d.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(g){d._clickHandler.call(d,g,this);g.preventDefault()})},_createIcons:function(){var d=
|
|
||||||
this.options;if(d.icons){a("<span></span>").addClass("ui-icon "+d.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(d.icons.header).toggleClass(d.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var d=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex");
|
|
||||||
this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(d.autoHeight||d.fillHeight)c.css("height","");return a.Widget.prototype.destroy.call(this)},_setOption:function(d,c){a.Widget.prototype._setOption.apply(this,arguments);d=="active"&&this.activate(c);if(d=="icons"){this._destroyIcons();
|
|
||||||
c&&this._createIcons()}if(d=="disabled")this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(d){if(!(this.options.disabled||d.altKey||d.ctrlKey)){var c=a.ui.keyCode,e=this.headers.length,h=this.headers.index(d.target),g=false;switch(d.keyCode){case c.RIGHT:case c.DOWN:g=this.headers[(h+1)%e];break;case c.LEFT:case c.UP:g=this.headers[(h-1+e)%e];break;case c.SPACE:case c.ENTER:this._clickHandler({target:d.target},d.target);
|
|
||||||
d.preventDefault()}if(g){a(d.target).attr("tabIndex",-1);a(g).attr("tabIndex",0);g.focus();return false}return true}},resize:function(){var d=this.options,c;if(d.fillSpace){if(a.browser.msie){var e=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height();a.browser.msie&&this.element.parent().css("overflow",e);this.headers.each(function(){c-=a(this).outerHeight(true)});this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+
|
|
||||||
a(this).height()))}).css("overflow","auto")}else if(d.autoHeight){c=0;this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c)}return this},activate:function(d){this.options.active=d;d=this._findActive(d)[0];this._clickHandler({target:d},d);return this},_findActive:function(d){return d?typeof d==="number"?this.headers.filter(":eq("+d+")"):this.headers.not(this.headers.not(d)):d===false?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(d,c){var e=this.options;
|
|
||||||
if(!e.disabled)if(d.target){d=a(d.currentTarget||c);c=d[0]===this.active[0];e.active=e.collapsible&&c?false:this.headers.index(d);if(!(this.running||!e.collapsible&&c)){var h=this.active;f=d.next();i=this.active.next();b={options:e,newHeader:c&&e.collapsible?a([]):d,oldHeader:this.active,newContent:c&&e.collapsible?a([]):f,oldContent:i};var g=this.headers.index(this.active[0])>this.headers.index(d[0]);this.active=c?a([]):d;this._toggle(f,i,b,c,g);h.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(e.icons.headerSelected).addClass(e.icons.header);
|
|
||||||
if(!c){d.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(e.icons.header).addClass(e.icons.headerSelected);d.next().addClass("ui-accordion-content-active")}}}else if(e.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(e.icons.headerSelected).addClass(e.icons.header);this.active.next().addClass("ui-accordion-content-active");var i=this.active.next(),
|
|
||||||
b={options:e,newHeader:a([]),oldHeader:e.active,newContent:a([]),oldContent:i},f=this.active=a([]);this._toggle(f,i,b)}},_toggle:function(d,c,e,h,g){var i=this,b=i.options;i.toShow=d;i.toHide=c;i.data=e;var f=function(){if(i)return i._completed.apply(i,arguments)};i._trigger("changestart",null,i.data);i.running=c.size()===0?d.size():c.size();if(b.animated){e={};e=b.collapsible&&h?{toShow:a([]),toHide:c,complete:f,down:g,autoHeight:b.autoHeight||b.fillSpace}:{toShow:d,toHide:c,complete:f,down:g,autoHeight:b.autoHeight||
|
|
||||||
b.fillSpace};if(!b.proxied)b.proxied=b.animated;if(!b.proxiedDuration)b.proxiedDuration=b.duration;b.animated=a.isFunction(b.proxied)?b.proxied(e):b.proxied;b.duration=a.isFunction(b.proxiedDuration)?b.proxiedDuration(e):b.proxiedDuration;h=a.ui.accordion.animations;var j=b.duration,l=b.animated;if(l&&!h[l]&&!a.easing[l])l="slide";h[l]||(h[l]=function(o){this.slide(o,{easing:l,duration:j||700})});h[l](e)}else{if(b.collapsible&&h)d.toggle();else{c.hide();d.show()}f(true)}c.prev().attr({"aria-expanded":"false",
|
|
||||||
"aria-selected":"false",tabIndex:-1}).blur();d.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(d){this.running=d?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});a.extend(a.ui.accordion,{version:"1.8.16",
|
|
||||||
animations:{slide:function(d,c){d=a.extend({easing:"swing",duration:300},d,c);if(d.toHide.size())if(d.toShow.size()){var e=d.toShow.css("overflow"),h=0,g={},i={},b;c=d.toShow;b=c[0].style.width;c.width(parseInt(c.parent().width(),10)-parseInt(c.css("paddingLeft"),10)-parseInt(c.css("paddingRight"),10)-(parseInt(c.css("borderLeftWidth"),10)||0)-(parseInt(c.css("borderRightWidth"),10)||0));a.each(["height","paddingTop","paddingBottom"],function(f,j){i[j]="hide";f=(""+a.css(d.toShow[0],j)).match(/^([\d+-.]+)(.*)$/);
|
|
||||||
g[j]={value:f[1],unit:f[2]||"px"}});d.toShow.css({height:0,overflow:"hidden"}).show();d.toHide.filter(":hidden").each(d.complete).end().filter(":visible").animate(i,{step:function(f,j){if(j.prop=="height")h=j.end-j.start===0?0:(j.now-j.start)/(j.end-j.start);d.toShow[0].style[j.prop]=h*g[j.prop].value+g[j.prop].unit},duration:d.duration,easing:d.easing,complete:function(){d.autoHeight||d.toShow.css("height","");d.toShow.css({width:b,overflow:e});d.complete()}})}else d.toHide.animate({height:"hide",
|
|
||||||
paddingTop:"hide",paddingBottom:"hide"},d);else d.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},d)},bounceslide:function(d){this.slide(d,{easing:d.down?"easeOutBounce":"swing",duration:d.down?1E3:200})}}})})(jQuery);
|
|
||||||
(function(a){var d=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var c=this,e=this.element[0].ownerDocument,h;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(g){if(!(c.options.disabled||c.element.propAttr("readOnly"))){h=
|
|
||||||
false;var i=a.ui.keyCode;switch(g.keyCode){case i.PAGE_UP:c._move("previousPage",g);break;case i.PAGE_DOWN:c._move("nextPage",g);break;case i.UP:c._move("previous",g);g.preventDefault();break;case i.DOWN:c._move("next",g);g.preventDefault();break;case i.ENTER:case i.NUMPAD_ENTER:if(c.menu.active){h=true;g.preventDefault()}case i.TAB:if(!c.menu.active)return;c.menu.select(g);break;case i.ESCAPE:c.element.val(c.term);c.close(g);break;default:clearTimeout(c.searching);c.searching=setTimeout(function(){if(c.term!=
|
|
||||||
c.element.val()){c.selectedItem=null;c.search(null,g)}},c.options.delay);break}}}).bind("keypress.autocomplete",function(g){if(h){h=false;g.preventDefault()}}).bind("focus.autocomplete",function(){if(!c.options.disabled){c.selectedItem=null;c.previous=c.element.val()}}).bind("blur.autocomplete",function(g){if(!c.options.disabled){clearTimeout(c.searching);c.closing=setTimeout(function(){c.close(g);c._change(g)},150)}});this._initSource();this.response=function(){return c._response.apply(c,arguments)};
|
|
||||||
this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",e)[0]).mousedown(function(g){var i=c.menu.element[0];a(g.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(b){b.target!==c.element[0]&&b.target!==i&&!a.ui.contains(i,b.target)&&c.close()})},1);setTimeout(function(){clearTimeout(c.closing)},13)}).menu({focus:function(g,i){i=i.item.data("item.autocomplete");false!==c._trigger("focus",g,{item:i})&&/^key/.test(g.originalEvent.type)&&
|
|
||||||
c.element.val(i.value)},selected:function(g,i){var b=i.item.data("item.autocomplete"),f=c.previous;if(c.element[0]!==e.activeElement){c.element.focus();c.previous=f;setTimeout(function(){c.previous=f;c.selectedItem=b},1)}false!==c._trigger("select",g,{item:b})&&c.element.val(b.value);c.term=c.element.val();c.close(g);c.selectedItem=b},blur:function(){c.menu.element.is(":visible")&&c.element.val()!==c.term&&c.element.val(c.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");
|
|
||||||
a.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();a.Widget.prototype.destroy.call(this)},_setOption:function(c,e){a.Widget.prototype._setOption.apply(this,arguments);c==="source"&&this._initSource();if(c==="appendTo")this.menu.element.appendTo(a(e||"body",this.element[0].ownerDocument)[0]);c==="disabled"&&
|
|
||||||
e&&this.xhr&&this.xhr.abort()},_initSource:function(){var c=this,e,h;if(a.isArray(this.options.source)){e=this.options.source;this.source=function(g,i){i(a.ui.autocomplete.filter(e,g.term))}}else if(typeof this.options.source==="string"){h=this.options.source;this.source=function(g,i){c.xhr&&c.xhr.abort();c.xhr=a.ajax({url:h,data:g,dataType:"json",autocompleteRequest:++d,success:function(b){this.autocompleteRequest===d&&i(b)},error:function(){this.autocompleteRequest===d&&i([])}})}}else this.source=
|
|
||||||
this.options.source},search:function(c,e){c=c!=null?c:this.element.val();this.term=this.element.val();if(c.length<this.options.minLength)return this.close(e);clearTimeout(this.closing);if(this._trigger("search",e)!==false)return this._search(c)},_search:function(c){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:c},this.response)},_response:function(c){if(!this.options.disabled&&c&&c.length){c=this._normalize(c);this._suggest(c);this._trigger("open")}else this.close();
|
|
||||||
this.pending--;this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(c){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",c)}},_change:function(c){this.previous!==this.element.val()&&this._trigger("change",c,{item:this.selectedItem})},_normalize:function(c){if(c.length&&c[0].label&&c[0].value)return c;return a.map(c,function(e){if(typeof e==="string")return{label:e,value:e};return a.extend({label:e.label||
|
|
||||||
e.value,value:e.value||e.label},e)})},_suggest:function(c){var e=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(e,c);this.menu.deactivate();this.menu.refresh();e.show();this._resizeMenu();e.position(a.extend({of:this.element},this.options.position));this.options.autoFocus&&this.menu.next(new a.Event("mouseover"))},_resizeMenu:function(){var c=this.menu.element;c.outerWidth(Math.max(c.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(c,e){var h=this;
|
|
||||||
a.each(e,function(g,i){h._renderItem(c,i)})},_renderItem:function(c,e){return a("<li></li>").data("item.autocomplete",e).append(a("<a></a>").text(e.label)).appendTo(c)},_move:function(c,e){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(c)||this.menu.last()&&/^next/.test(c)){this.element.val(this.term);this.menu.deactivate()}else this.menu[c](e);else this.search(null,e)},widget:function(){return this.menu.element}});a.extend(a.ui.autocomplete,{escapeRegex:function(c){return c.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,
|
|
||||||
"\\$&")},filter:function(c,e){var h=new RegExp(a.ui.autocomplete.escapeRegex(e),"i");return a.grep(c,function(g){return h.test(g.label||g.value||g)})}})})(jQuery);
|
|
||||||
(function(a){a.widget("ui.menu",{_create:function(){var d=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(a(c.target).closest(".ui-menu-item a").length){c.preventDefault();d.select(c)}});this.refresh()},refresh:function(){var d=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",
|
|
||||||
-1).mouseenter(function(c){d.activate(c,a(this).parent())}).mouseleave(function(){d.deactivate()})},activate:function(d,c){this.deactivate();if(this.hasScroll()){var e=c.offset().top-this.element.offset().top,h=this.element.scrollTop(),g=this.element.height();if(e<0)this.element.scrollTop(h+e);else e>=g&&this.element.scrollTop(h+e-g+c.height())}this.active=c.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",d,{item:c})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");
|
|
||||||
this._trigger("blur");this.active=null}},next:function(d){this.move("next",".ui-menu-item:first",d)},previous:function(d){this.move("prev",".ui-menu-item:last",d)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(d,c,e){if(this.active){d=this.active[d+"All"](".ui-menu-item").eq(0);d.length?this.activate(e,d):this.activate(e,this.element.children(c))}else this.activate(e,
|
|
||||||
this.element.children(c))},nextPage:function(d){if(this.hasScroll())if(!this.active||this.last())this.activate(d,this.element.children(".ui-menu-item:first"));else{var c=this.active.offset().top,e=this.element.height(),h=this.element.children(".ui-menu-item").filter(function(){var g=a(this).offset().top-c-e+a(this).height();return g<10&&g>-10});h.length||(h=this.element.children(".ui-menu-item:last"));this.activate(d,h)}else this.activate(d,this.element.children(".ui-menu-item").filter(!this.active||
|
|
||||||
this.last()?":first":":last"))},previousPage:function(d){if(this.hasScroll())if(!this.active||this.first())this.activate(d,this.element.children(".ui-menu-item:last"));else{var c=this.active.offset().top,e=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var h=a(this).offset().top-c+e-a(this).height();return h<10&&h>-10});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(d,result)}else this.activate(d,this.element.children(".ui-menu-item").filter(!this.active||
|
|
||||||
this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[a.fn.prop?"prop":"attr"]("scrollHeight")},select:function(d){this._trigger("selected",d,{item:this.active})}})})(jQuery);
|
|
||||||
(function(a){var d,c,e,h,g=function(){var b=a(this).find(":ui-button");setTimeout(function(){b.button("refresh")},1)},i=function(b){var f=b.name,j=b.form,l=a([]);if(f)l=j?a(j).find("[name='"+f+"']"):a("[name='"+f+"']",b.ownerDocument).filter(function(){return!this.form});return l};a.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",g);if(typeof this.options.disabled!==
|
|
||||||
"boolean")this.options.disabled=this.element.propAttr("disabled");this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var b=this,f=this.options,j=this.type==="checkbox"||this.type==="radio",l="ui-state-hover"+(!j?" ui-state-active":"");if(f.label===null)f.label=this.buttonElement.html();if(this.element.is(":disabled"))f.disabled=true;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",function(){if(!f.disabled){a(this).addClass("ui-state-hover");
|
|
||||||
this===d&&a(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){f.disabled||a(this).removeClass(l)}).bind("click.button",function(o){if(f.disabled){o.preventDefault();o.stopImmediatePropagation()}});this.element.bind("focus.button",function(){b.buttonElement.addClass("ui-state-focus")}).bind("blur.button",function(){b.buttonElement.removeClass("ui-state-focus")});if(j){this.element.bind("change.button",function(){h||b.refresh()});this.buttonElement.bind("mousedown.button",function(o){if(!f.disabled){h=
|
|
||||||
false;c=o.pageX;e=o.pageY}}).bind("mouseup.button",function(o){if(!f.disabled)if(c!==o.pageX||e!==o.pageY)h=true})}if(this.type==="checkbox")this.buttonElement.bind("click.button",function(){if(f.disabled||h)return false;a(this).toggleClass("ui-state-active");b.buttonElement.attr("aria-pressed",b.element[0].checked)});else if(this.type==="radio")this.buttonElement.bind("click.button",function(){if(f.disabled||h)return false;a(this).addClass("ui-state-active");b.buttonElement.attr("aria-pressed","true");
|
|
||||||
var o=b.element[0];i(o).not(o).map(function(){return a(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")});else{this.buttonElement.bind("mousedown.button",function(){if(f.disabled)return false;a(this).addClass("ui-state-active");d=this;a(document).one("mouseup",function(){d=null})}).bind("mouseup.button",function(){if(f.disabled)return false;a(this).removeClass("ui-state-active")}).bind("keydown.button",function(o){if(f.disabled)return false;if(o.keyCode==a.ui.keyCode.SPACE||
|
|
||||||
o.keyCode==a.ui.keyCode.ENTER)a(this).addClass("ui-state-active")}).bind("keyup.button",function(){a(this).removeClass("ui-state-active")});this.buttonElement.is("a")&&this.buttonElement.keyup(function(o){o.keyCode===a.ui.keyCode.SPACE&&a(this).click()})}this._setOption("disabled",f.disabled);this._resetButton()},_determineButtonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.element.is(":radio")?"radio":this.element.is("input")?"input":"button";if(this.type==="checkbox"||this.type===
|
|
||||||
"radio"){var b=this.element.parents().filter(":last"),f="label[for='"+this.element.attr("id")+"']";this.buttonElement=b.find(f);if(!this.buttonElement.length){b=b.length?b.siblings():this.element.siblings();this.buttonElement=b.filter(f);if(!this.buttonElement.length)this.buttonElement=b.find(f)}this.element.addClass("ui-helper-hidden-accessible");(b=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",b)}else this.buttonElement=this.element},
|
|
||||||
widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());this.hasTitle||this.buttonElement.removeAttr("title");
|
|
||||||
a.Widget.prototype.destroy.call(this)},_setOption:function(b,f){a.Widget.prototype._setOption.apply(this,arguments);if(b==="disabled")f?this.element.propAttr("disabled",true):this.element.propAttr("disabled",false);else this._resetButton()},refresh:function(){var b=this.element.is(":disabled");b!==this.options.disabled&&this._setOption("disabled",b);if(this.type==="radio")i(this.element[0]).each(function(){a(this).is(":checked")?a(this).button("widget").addClass("ui-state-active").attr("aria-pressed",
|
|
||||||
"true"):a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")});else if(this.type==="checkbox")this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false")},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var b=this.buttonElement.removeClass("ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only"),
|
|
||||||
f=a("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),j=this.options.icons,l=j.primary&&j.secondary,o=[];if(j.primary||j.secondary){if(this.options.text)o.push("ui-button-text-icon"+(l?"s":j.primary?"-primary":"-secondary"));j.primary&&b.prepend("<span class='ui-button-icon-primary ui-icon "+j.primary+"'></span>");j.secondary&&b.append("<span class='ui-button-icon-secondary ui-icon "+j.secondary+"'></span>");if(!this.options.text){o.push(l?"ui-button-icons-only":
|
|
||||||
"ui-button-icon-only");this.hasTitle||b.attr("title",f)}}else o.push("ui-button-text-only");b.addClass(o.join(" "))}}});a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,f){b==="disabled"&&this.buttons.button("option",b,f);a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")===
|
|
||||||
"ltr";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(b?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");
|
|
||||||
a.Widget.prototype.destroy.call(this)}})})(jQuery);
|
|
||||||
(function(a,d){function c(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=
|
|
||||||
"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su",
|
|
||||||
"Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",
|
|
||||||
minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false,disabled:false};a.extend(this._defaults,this.regional[""]);this.dpDiv=e(a('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function e(b){return b.bind("mouseout",
|
|
||||||
function(f){f=a(f.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");f.length&&f.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(f){f=a(f.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(a.datepicker._isDisabledDatepicker(i.inline?b.parent()[0]:i.input[0])||!f.length)){f.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
|
|
||||||
f.addClass("ui-state-hover");f.hasClass("ui-datepicker-prev")&&f.addClass("ui-datepicker-prev-hover");f.hasClass("ui-datepicker-next")&&f.addClass("ui-datepicker-next-hover")}})}function h(b,f){a.extend(b,f);for(var j in f)if(f[j]==null||f[j]==d)b[j]=f[j];return b}a.extend(a.ui,{datepicker:{version:"1.8.16"}});var g=(new Date).getTime(),i;a.extend(c.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},
|
|
||||||
setDefaults:function(b){h(this._defaults,b||{});return this},_attachDatepicker:function(b,f){var j=null;for(var l in this._defaults){var o=b.getAttribute("date:"+l);if(o){j=j||{};try{j[l]=eval(o)}catch(n){j[l]=o}}}l=b.nodeName.toLowerCase();o=l=="div"||l=="span";if(!b.id){this.uuid+=1;b.id="dp"+this.uuid}var k=this._newInst(a(b),o);k.settings=a.extend({},f||{},j||{});if(l=="input")this._connectDatepicker(b,k);else o&&this._inlineDatepicker(b,k)},_newInst:function(b,f){return{id:b[0].id.replace(/([^A-Za-z0-9_-])/g,
|
|
||||||
"\\\\$1"),input:b,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:f,dpDiv:!f?this.dpDiv:e(a('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(b,f){var j=a(b);f.append=a([]);f.trigger=a([]);if(!j.hasClass(this.markerClassName)){this._attachments(j,f);j.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",
|
|
||||||
function(l,o,n){f.settings[o]=n}).bind("getData.datepicker",function(l,o){return this._get(f,o)});this._autoSize(f);a.data(b,"datepicker",f);f.settings.disabled&&this._disableDatepicker(b)}},_attachments:function(b,f){var j=this._get(f,"appendText"),l=this._get(f,"isRTL");f.append&&f.append.remove();if(j){f.append=a('<span class="'+this._appendClass+'">'+j+"</span>");b[l?"before":"after"](f.append)}b.unbind("focus",this._showDatepicker);f.trigger&&f.trigger.remove();j=this._get(f,"showOn");if(j==
|
|
||||||
"focus"||j=="both")b.focus(this._showDatepicker);if(j=="button"||j=="both"){j=this._get(f,"buttonText");var o=this._get(f,"buttonImage");f.trigger=a(this._get(f,"buttonImageOnly")?a("<img/>").addClass(this._triggerClass).attr({src:o,alt:j,title:j}):a('<button type="button"></button>').addClass(this._triggerClass).html(o==""?j:a("<img/>").attr({src:o,alt:j,title:j})));b[l?"before":"after"](f.trigger);f.trigger.click(function(){a.datepicker._datepickerShowing&&a.datepicker._lastInput==b[0]?a.datepicker._hideDatepicker():
|
|
||||||
a.datepicker._showDatepicker(b[0]);return false})}},_autoSize:function(b){if(this._get(b,"autoSize")&&!b.inline){var f=new Date(2009,11,20),j=this._get(b,"dateFormat");if(j.match(/[DM]/)){var l=function(o){for(var n=0,k=0,m=0;m<o.length;m++)if(o[m].length>n){n=o[m].length;k=m}return k};f.setMonth(l(this._get(b,j.match(/MM/)?"monthNames":"monthNamesShort")));f.setDate(l(this._get(b,j.match(/DD/)?"dayNames":"dayNamesShort"))+20-f.getDay())}b.input.attr("size",this._formatDate(b,f).length)}},_inlineDatepicker:function(b,
|
|
||||||
f){var j=a(b);if(!j.hasClass(this.markerClassName)){j.addClass(this.markerClassName).append(f.dpDiv).bind("setData.datepicker",function(l,o,n){f.settings[o]=n}).bind("getData.datepicker",function(l,o){return this._get(f,o)});a.data(b,"datepicker",f);this._setDate(f,this._getDefaultDate(f),true);this._updateDatepicker(f);this._updateAlternate(f);f.settings.disabled&&this._disableDatepicker(b);f.dpDiv.css("display","block")}},_dialogDatepicker:function(b,f,j,l,o){b=this._dialogInst;if(!b){this.uuid+=
|
|
||||||
1;this._dialogInput=a('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);a("body").append(this._dialogInput);b=this._dialogInst=this._newInst(this._dialogInput,false);b.settings={};a.data(this._dialogInput[0],"datepicker",b)}h(b.settings,l||{});f=f&&f.constructor==Date?this._formatDate(b,f):f;this._dialogInput.val(f);this._pos=o?o.length?o:[o.pageX,o.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/
|
|
||||||
2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");b.settings.onSelect=j;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);a.blockUI&&a.blockUI(this.dpDiv);a.data(this._dialogInput[0],"datepicker",b);return this},_destroyDatepicker:function(b){var f=
|
|
||||||
a(b),j=a.data(b,"datepicker");if(f.hasClass(this.markerClassName)){var l=b.nodeName.toLowerCase();a.removeData(b,"datepicker");if(l=="input"){j.append.remove();j.trigger.remove();f.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(l=="div"||l=="span")f.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(b){var f=a(b),j=a.data(b,"datepicker");if(f.hasClass(this.markerClassName)){var l=
|
|
||||||
b.nodeName.toLowerCase();if(l=="input"){b.disabled=false;j.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(l=="div"||l=="span"){f=f.children("."+this._inlineClass);f.children().removeClass("ui-state-disabled");f.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=a.map(this._disabledInputs,function(o){return o==b?null:o})}},_disableDatepicker:function(b){var f=a(b),j=a.data(b,
|
|
||||||
"datepicker");if(f.hasClass(this.markerClassName)){var l=b.nodeName.toLowerCase();if(l=="input"){b.disabled=true;j.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(l=="div"||l=="span"){f=f.children("."+this._inlineClass);f.children().addClass("ui-state-disabled");f.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=a.map(this._disabledInputs,function(o){return o==
|
|
||||||
b?null:o});this._disabledInputs[this._disabledInputs.length]=b}},_isDisabledDatepicker:function(b){if(!b)return false;for(var f=0;f<this._disabledInputs.length;f++)if(this._disabledInputs[f]==b)return true;return false},_getInst:function(b){try{return a.data(b,"datepicker")}catch(f){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(b,f,j){var l=this._getInst(b);if(arguments.length==2&&typeof f=="string")return f=="defaults"?a.extend({},a.datepicker._defaults):l?f=="all"?
|
|
||||||
a.extend({},l.settings):this._get(l,f):null;var o=f||{};if(typeof f=="string"){o={};o[f]=j}if(l){this._curInst==l&&this._hideDatepicker();var n=this._getDateDatepicker(b,true),k=this._getMinMaxDate(l,"min"),m=this._getMinMaxDate(l,"max");h(l.settings,o);if(k!==null&&o.dateFormat!==d&&o.minDate===d)l.settings.minDate=this._formatDate(l,k);if(m!==null&&o.dateFormat!==d&&o.maxDate===d)l.settings.maxDate=this._formatDate(l,m);this._attachments(a(b),l);this._autoSize(l);this._setDate(l,n);this._updateAlternate(l);
|
|
||||||
this._updateDatepicker(l)}},_changeDatepicker:function(b,f,j){this._optionDatepicker(b,f,j)},_refreshDatepicker:function(b){(b=this._getInst(b))&&this._updateDatepicker(b)},_setDateDatepicker:function(b,f){if(b=this._getInst(b)){this._setDate(b,f);this._updateDatepicker(b);this._updateAlternate(b)}},_getDateDatepicker:function(b,f){(b=this._getInst(b))&&!b.inline&&this._setDateFromField(b,f);return b?this._getDate(b):null},_doKeyDown:function(b){var f=a.datepicker._getInst(b.target),j=true,l=f.dpDiv.is(".ui-datepicker-rtl");
|
|
||||||
f._keyEvent=true;if(a.datepicker._datepickerShowing)switch(b.keyCode){case 9:a.datepicker._hideDatepicker();j=false;break;case 13:j=a("td."+a.datepicker._dayOverClass+":not(."+a.datepicker._currentClass+")",f.dpDiv);j[0]&&a.datepicker._selectDay(b.target,f.selectedMonth,f.selectedYear,j[0]);if(b=a.datepicker._get(f,"onSelect")){j=a.datepicker._formatDate(f);b.apply(f.input?f.input[0]:null,[j,f])}else a.datepicker._hideDatepicker();return false;case 27:a.datepicker._hideDatepicker();break;case 33:a.datepicker._adjustDate(b.target,
|
|
||||||
b.ctrlKey?-a.datepicker._get(f,"stepBigMonths"):-a.datepicker._get(f,"stepMonths"),"M");break;case 34:a.datepicker._adjustDate(b.target,b.ctrlKey?+a.datepicker._get(f,"stepBigMonths"):+a.datepicker._get(f,"stepMonths"),"M");break;case 35:if(b.ctrlKey||b.metaKey)a.datepicker._clearDate(b.target);j=b.ctrlKey||b.metaKey;break;case 36:if(b.ctrlKey||b.metaKey)a.datepicker._gotoToday(b.target);j=b.ctrlKey||b.metaKey;break;case 37:if(b.ctrlKey||b.metaKey)a.datepicker._adjustDate(b.target,l?+1:-1,"D");j=
|
|
||||||
b.ctrlKey||b.metaKey;if(b.originalEvent.altKey)a.datepicker._adjustDate(b.target,b.ctrlKey?-a.datepicker._get(f,"stepBigMonths"):-a.datepicker._get(f,"stepMonths"),"M");break;case 38:if(b.ctrlKey||b.metaKey)a.datepicker._adjustDate(b.target,-7,"D");j=b.ctrlKey||b.metaKey;break;case 39:if(b.ctrlKey||b.metaKey)a.datepicker._adjustDate(b.target,l?-1:+1,"D");j=b.ctrlKey||b.metaKey;if(b.originalEvent.altKey)a.datepicker._adjustDate(b.target,b.ctrlKey?+a.datepicker._get(f,"stepBigMonths"):+a.datepicker._get(f,
|
|
||||||
"stepMonths"),"M");break;case 40:if(b.ctrlKey||b.metaKey)a.datepicker._adjustDate(b.target,+7,"D");j=b.ctrlKey||b.metaKey;break;default:j=false}else if(b.keyCode==36&&b.ctrlKey)a.datepicker._showDatepicker(this);else j=false;if(j){b.preventDefault();b.stopPropagation()}},_doKeyPress:function(b){var f=a.datepicker._getInst(b.target);if(a.datepicker._get(f,"constrainInput")){f=a.datepicker._possibleChars(a.datepicker._get(f,"dateFormat"));var j=String.fromCharCode(b.charCode==d?b.keyCode:b.charCode);
|
|
||||||
return b.ctrlKey||b.metaKey||j<" "||!f||f.indexOf(j)>-1}},_doKeyUp:function(b){b=a.datepicker._getInst(b.target);if(b.input.val()!=b.lastVal)try{if(a.datepicker.parseDate(a.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,a.datepicker._getFormatConfig(b))){a.datepicker._setDateFromField(b);a.datepicker._updateAlternate(b);a.datepicker._updateDatepicker(b)}}catch(f){a.datepicker.log(f)}return true},_showDatepicker:function(b){b=b.target||b;if(b.nodeName.toLowerCase()!="input")b=a("input",
|
|
||||||
b.parentNode)[0];if(!(a.datepicker._isDisabledDatepicker(b)||a.datepicker._lastInput==b)){var f=a.datepicker._getInst(b);if(a.datepicker._curInst&&a.datepicker._curInst!=f){a.datepicker._datepickerShowing&&a.datepicker._triggerOnClose(a.datepicker._curInst);a.datepicker._curInst.dpDiv.stop(true,true)}var j=a.datepicker._get(f,"beforeShow");j=j?j.apply(b,[b,f]):{};if(j!==false){h(f.settings,j);f.lastVal=null;a.datepicker._lastInput=b;a.datepicker._setDateFromField(f);if(a.datepicker._inDialog)b.value=
|
|
||||||
"";if(!a.datepicker._pos){a.datepicker._pos=a.datepicker._findPos(b);a.datepicker._pos[1]+=b.offsetHeight}var l=false;a(b).parents().each(function(){l|=a(this).css("position")=="fixed";return!l});if(l&&a.browser.opera){a.datepicker._pos[0]-=document.documentElement.scrollLeft;a.datepicker._pos[1]-=document.documentElement.scrollTop}j={left:a.datepicker._pos[0],top:a.datepicker._pos[1]};a.datepicker._pos=null;f.dpDiv.empty();f.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});a.datepicker._updateDatepicker(f);
|
|
||||||
j=a.datepicker._checkOffset(f,j,l);f.dpDiv.css({position:a.datepicker._inDialog&&a.blockUI?"static":l?"fixed":"absolute",display:"none",left:j.left+"px",top:j.top+"px"});if(!f.inline){j=a.datepicker._get(f,"showAnim");var o=a.datepicker._get(f,"duration"),n=function(){var k=f.dpDiv.find("iframe.ui-datepicker-cover");if(k.length){var m=a.datepicker._getBorders(f.dpDiv);k.css({left:-m[0],top:-m[1],width:f.dpDiv.outerWidth(),height:f.dpDiv.outerHeight()})}};f.dpDiv.zIndex(a(b).zIndex()+1);a.datepicker._datepickerShowing=
|
|
||||||
true;a.effects&&a.effects[j]?f.dpDiv.show(j,a.datepicker._get(f,"showOptions"),o,n):f.dpDiv[j||"show"](j?o:null,n);if(!j||!o)n();f.input.is(":visible")&&!f.input.is(":disabled")&&f.input.focus();a.datepicker._curInst=f}}}},_updateDatepicker:function(b){this.maxRows=4;var f=a.datepicker._getBorders(b.dpDiv);i=b;b.dpDiv.empty().append(this._generateHTML(b));var j=b.dpDiv.find("iframe.ui-datepicker-cover");j.length&&j.css({left:-f[0],top:-f[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()});
|
|
||||||
b.dpDiv.find("."+this._dayOverClass+" a").mouseover();f=this._getNumberOfMonths(b);j=f[1];b.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");j>1&&b.dpDiv.addClass("ui-datepicker-multi-"+j).css("width",17*j+"em");b.dpDiv[(f[0]!=1||f[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");b.dpDiv[(this._get(b,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");b==a.datepicker._curInst&&a.datepicker._datepickerShowing&&b.input&&b.input.is(":visible")&&
|
|
||||||
!b.input.is(":disabled")&&b.input[0]!=document.activeElement&&b.input.focus();if(b.yearshtml){var l=b.yearshtml;setTimeout(function(){l===b.yearshtml&&b.yearshtml&&b.dpDiv.find("select.ui-datepicker-year:first").replaceWith(b.yearshtml);l=b.yearshtml=null},0)}},_getBorders:function(b){var f=function(j){return{thin:1,medium:2,thick:3}[j]||j};return[parseFloat(f(b.css("border-left-width"))),parseFloat(f(b.css("border-top-width")))]},_checkOffset:function(b,f,j){var l=b.dpDiv.outerWidth(),o=b.dpDiv.outerHeight(),
|
|
||||||
n=b.input?b.input.outerWidth():0,k=b.input?b.input.outerHeight():0,m=document.documentElement.clientWidth+a(document).scrollLeft(),p=document.documentElement.clientHeight+a(document).scrollTop();f.left-=this._get(b,"isRTL")?l-n:0;f.left-=j&&f.left==b.input.offset().left?a(document).scrollLeft():0;f.top-=j&&f.top==b.input.offset().top+k?a(document).scrollTop():0;f.left-=Math.min(f.left,f.left+l>m&&m>l?Math.abs(f.left+l-m):0);f.top-=Math.min(f.top,f.top+o>p&&p>o?Math.abs(o+k):0);return f},_findPos:function(b){for(var f=
|
|
||||||
this._get(this._getInst(b),"isRTL");b&&(b.type=="hidden"||b.nodeType!=1||a.expr.filters.hidden(b));)b=b[f?"previousSibling":"nextSibling"];b=a(b).offset();return[b.left,b.top]},_triggerOnClose:function(b){var f=this._get(b,"onClose");if(f)f.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b])},_hideDatepicker:function(b){var f=this._curInst;if(!(!f||b&&f!=a.data(b,"datepicker")))if(this._datepickerShowing){b=this._get(f,"showAnim");var j=this._get(f,"duration"),l=function(){a.datepicker._tidyDialog(f);
|
|
||||||
this._curInst=null};a.effects&&a.effects[b]?f.dpDiv.hide(b,a.datepicker._get(f,"showOptions"),j,l):f.dpDiv[b=="slideDown"?"slideUp":b=="fadeIn"?"fadeOut":"hide"](b?j:null,l);b||l();a.datepicker._triggerOnClose(f);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(a.blockUI){a.unblockUI();a("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(b){b.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},
|
|
||||||
_checkExternalClick:function(b){if(a.datepicker._curInst){b=a(b.target);b[0].id!=a.datepicker._mainDivId&&b.parents("#"+a.datepicker._mainDivId).length==0&&!b.hasClass(a.datepicker.markerClassName)&&!b.hasClass(a.datepicker._triggerClass)&&a.datepicker._datepickerShowing&&!(a.datepicker._inDialog&&a.blockUI)&&a.datepicker._hideDatepicker()}},_adjustDate:function(b,f,j){b=a(b);var l=this._getInst(b[0]);if(!this._isDisabledDatepicker(b[0])){this._adjustInstDate(l,f+(j=="M"?this._get(l,"showCurrentAtPos"):
|
|
||||||
0),j);this._updateDatepicker(l)}},_gotoToday:function(b){b=a(b);var f=this._getInst(b[0]);if(this._get(f,"gotoCurrent")&&f.currentDay){f.selectedDay=f.currentDay;f.drawMonth=f.selectedMonth=f.currentMonth;f.drawYear=f.selectedYear=f.currentYear}else{var j=new Date;f.selectedDay=j.getDate();f.drawMonth=f.selectedMonth=j.getMonth();f.drawYear=f.selectedYear=j.getFullYear()}this._notifyChange(f);this._adjustDate(b)},_selectMonthYear:function(b,f,j){b=a(b);var l=this._getInst(b[0]);l["selected"+(j=="M"?
|
|
||||||
"Month":"Year")]=l["draw"+(j=="M"?"Month":"Year")]=parseInt(f.options[f.selectedIndex].value,10);this._notifyChange(l);this._adjustDate(b)},_selectDay:function(b,f,j,l){var o=a(b);if(!(a(l).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0]))){o=this._getInst(o[0]);o.selectedDay=o.currentDay=a("a",l).html();o.selectedMonth=o.currentMonth=f;o.selectedYear=o.currentYear=j;this._selectDate(b,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear))}},_clearDate:function(b){b=a(b);
|
|
||||||
this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(b,f){b=this._getInst(a(b)[0]);f=f!=null?f:this._formatDate(b);b.input&&b.input.val(f);this._updateAlternate(b);var j=this._get(b,"onSelect");if(j)j.apply(b.input?b.input[0]:null,[f,b]);else b.input&&b.input.trigger("change");if(b.inline)this._updateDatepicker(b);else{this._hideDatepicker();this._lastInput=b.input[0];typeof b.input[0]!="object"&&b.input.focus();this._lastInput=null}},_updateAlternate:function(b){var f=this._get(b,"altField");
|
|
||||||
if(f){var j=this._get(b,"altFormat")||this._get(b,"dateFormat"),l=this._getDate(b),o=this.formatDate(j,l,this._getFormatConfig(b));a(f).each(function(){a(this).val(o)})}},noWeekends:function(b){b=b.getDay();return[b>0&&b<6,""]},iso8601Week:function(b){b=new Date(b.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var f=b.getTime();b.setMonth(0);b.setDate(1);return Math.floor(Math.round((f-b)/864E5)/7)+1},parseDate:function(b,f,j){if(b==null||f==null)throw"Invalid arguments";f=typeof f=="object"?
|
|
||||||
f.toString():f+"";if(f=="")return null;var l=(j?j.shortYearCutoff:null)||this._defaults.shortYearCutoff;l=typeof l!="string"?l:(new Date).getFullYear()%100+parseInt(l,10);for(var o=(j?j.dayNamesShort:null)||this._defaults.dayNamesShort,n=(j?j.dayNames:null)||this._defaults.dayNames,k=(j?j.monthNamesShort:null)||this._defaults.monthNamesShort,m=(j?j.monthNames:null)||this._defaults.monthNames,p=j=-1,q=-1,s=-1,r=false,u=function(z){(z=H+1<b.length&&b.charAt(H+1)==z)&&H++;return z},v=function(z){var I=
|
|
||||||
u(z);z=new RegExp("^\\d{1,"+(z=="@"?14:z=="!"?20:z=="y"&&I?4:z=="o"?3:2)+"}");z=f.substring(y).match(z);if(!z)throw"Missing number at position "+y;y+=z[0].length;return parseInt(z[0],10)},w=function(z,I,N){z=a.map(u(z)?N:I,function(D,E){return[[E,D]]}).sort(function(D,E){return-(D[1].length-E[1].length)});var J=-1;a.each(z,function(D,E){D=E[1];if(f.substr(y,D.length).toLowerCase()==D.toLowerCase()){J=E[0];y+=D.length;return false}});if(J!=-1)return J+1;else throw"Unknown name at position "+y;},x=
|
|
||||||
function(){if(f.charAt(y)!=b.charAt(H))throw"Unexpected literal at position "+y;y++},y=0,H=0;H<b.length;H++)if(r)if(b.charAt(H)=="'"&&!u("'"))r=false;else x();else switch(b.charAt(H)){case "d":q=v("d");break;case "D":w("D",o,n);break;case "o":s=v("o");break;case "m":p=v("m");break;case "M":p=w("M",k,m);break;case "y":j=v("y");break;case "@":var C=new Date(v("@"));j=C.getFullYear();p=C.getMonth()+1;q=C.getDate();break;case "!":C=new Date((v("!")-this._ticksTo1970)/1E4);j=C.getFullYear();p=C.getMonth()+
|
|
||||||
1;q=C.getDate();break;case "'":if(u("'"))x();else r=true;break;default:x()}if(y<f.length)throw"Extra/unparsed characters found in date: "+f.substring(y);if(j==-1)j=(new Date).getFullYear();else if(j<100)j+=(new Date).getFullYear()-(new Date).getFullYear()%100+(j<=l?0:-100);if(s>-1){p=1;q=s;do{l=this._getDaysInMonth(j,p-1);if(q<=l)break;p++;q-=l}while(1)}C=this._daylightSavingAdjust(new Date(j,p-1,q));if(C.getFullYear()!=j||C.getMonth()+1!=p||C.getDate()!=q)throw"Invalid date";return C},ATOM:"yy-mm-dd",
|
|
||||||
COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(b,f,j){if(!f)return"";var l=(j?j.dayNamesShort:null)||this._defaults.dayNamesShort,o=(j?j.dayNames:null)||this._defaults.dayNames,n=(j?j.monthNamesShort:null)||this._defaults.monthNamesShort;j=(j?j.monthNames:
|
|
||||||
null)||this._defaults.monthNames;var k=function(u){(u=r+1<b.length&&b.charAt(r+1)==u)&&r++;return u},m=function(u,v,w){v=""+v;if(k(u))for(;v.length<w;)v="0"+v;return v},p=function(u,v,w,x){return k(u)?x[v]:w[v]},q="",s=false;if(f)for(var r=0;r<b.length;r++)if(s)if(b.charAt(r)=="'"&&!k("'"))s=false;else q+=b.charAt(r);else switch(b.charAt(r)){case "d":q+=m("d",f.getDate(),2);break;case "D":q+=p("D",f.getDay(),l,o);break;case "o":q+=m("o",Math.round(((new Date(f.getFullYear(),f.getMonth(),f.getDate())).getTime()-
|
|
||||||
(new Date(f.getFullYear(),0,0)).getTime())/864E5),3);break;case "m":q+=m("m",f.getMonth()+1,2);break;case "M":q+=p("M",f.getMonth(),n,j);break;case "y":q+=k("y")?f.getFullYear():(f.getYear()%100<10?"0":"")+f.getYear()%100;break;case "@":q+=f.getTime();break;case "!":q+=f.getTime()*1E4+this._ticksTo1970;break;case "'":if(k("'"))q+="'";else s=true;break;default:q+=b.charAt(r)}return q},_possibleChars:function(b){for(var f="",j=false,l=function(n){(n=o+1<b.length&&b.charAt(o+1)==n)&&o++;return n},o=
|
|
||||||
0;o<b.length;o++)if(j)if(b.charAt(o)=="'"&&!l("'"))j=false;else f+=b.charAt(o);else switch(b.charAt(o)){case "d":case "m":case "y":case "@":f+="0123456789";break;case "D":case "M":return null;case "'":if(l("'"))f+="'";else j=true;break;default:f+=b.charAt(o)}return f},_get:function(b,f){return b.settings[f]!==d?b.settings[f]:this._defaults[f]},_setDateFromField:function(b,f){if(b.input.val()!=b.lastVal){var j=this._get(b,"dateFormat"),l=b.lastVal=b.input?b.input.val():null,o,n;o=n=this._getDefaultDate(b);
|
|
||||||
var k=this._getFormatConfig(b);try{o=this.parseDate(j,l,k)||n}catch(m){this.log(m);l=f?"":l}b.selectedDay=o.getDate();b.drawMonth=b.selectedMonth=o.getMonth();b.drawYear=b.selectedYear=o.getFullYear();b.currentDay=l?o.getDate():0;b.currentMonth=l?o.getMonth():0;b.currentYear=l?o.getFullYear():0;this._adjustInstDate(b)}},_getDefaultDate:function(b){return this._restrictMinMax(b,this._determineDate(b,this._get(b,"defaultDate"),new Date))},_determineDate:function(b,f,j){var l=function(n){var k=new Date;
|
|
||||||
k.setDate(k.getDate()+n);return k},o=function(n){try{return a.datepicker.parseDate(a.datepicker._get(b,"dateFormat"),n,a.datepicker._getFormatConfig(b))}catch(k){}var m=(n.toLowerCase().match(/^c/)?a.datepicker._getDate(b):null)||new Date,p=m.getFullYear(),q=m.getMonth();m=m.getDate();for(var s=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,r=s.exec(n);r;){switch(r[2]||"d"){case "d":case "D":m+=parseInt(r[1],10);break;case "w":case "W":m+=parseInt(r[1],10)*7;break;case "m":case "M":q+=parseInt(r[1],10);m=
|
|
||||||
Math.min(m,a.datepicker._getDaysInMonth(p,q));break;case "y":case "Y":p+=parseInt(r[1],10);m=Math.min(m,a.datepicker._getDaysInMonth(p,q));break}r=s.exec(n)}return new Date(p,q,m)};if(f=(f=f==null||f===""?j:typeof f=="string"?o(f):typeof f=="number"?isNaN(f)?j:l(f):new Date(f.getTime()))&&f.toString()=="Invalid Date"?j:f){f.setHours(0);f.setMinutes(0);f.setSeconds(0);f.setMilliseconds(0)}return this._daylightSavingAdjust(f)},_daylightSavingAdjust:function(b){if(!b)return null;b.setHours(b.getHours()>
|
|
||||||
12?b.getHours()+2:0);return b},_setDate:function(b,f,j){var l=!f,o=b.selectedMonth,n=b.selectedYear;f=this._restrictMinMax(b,this._determineDate(b,f,new Date));b.selectedDay=b.currentDay=f.getDate();b.drawMonth=b.selectedMonth=b.currentMonth=f.getMonth();b.drawYear=b.selectedYear=b.currentYear=f.getFullYear();if((o!=b.selectedMonth||n!=b.selectedYear)&&!j)this._notifyChange(b);this._adjustInstDate(b);if(b.input)b.input.val(l?"":this._formatDate(b))},_getDate:function(b){return!b.currentYear||b.input&&
|
|
||||||
b.input.val()==""?null:this._daylightSavingAdjust(new Date(b.currentYear,b.currentMonth,b.currentDay))},_generateHTML:function(b){var f=new Date;f=this._daylightSavingAdjust(new Date(f.getFullYear(),f.getMonth(),f.getDate()));var j=this._get(b,"isRTL"),l=this._get(b,"showButtonPanel"),o=this._get(b,"hideIfNoPrevNext"),n=this._get(b,"navigationAsDateFormat"),k=this._getNumberOfMonths(b),m=this._get(b,"showCurrentAtPos"),p=this._get(b,"stepMonths"),q=k[0]!=1||k[1]!=1,s=this._daylightSavingAdjust(!b.currentDay?
|
|
||||||
new Date(9999,9,9):new Date(b.currentYear,b.currentMonth,b.currentDay)),r=this._getMinMaxDate(b,"min"),u=this._getMinMaxDate(b,"max");m=b.drawMonth-m;var v=b.drawYear;if(m<0){m+=12;v--}if(u){var w=this._daylightSavingAdjust(new Date(u.getFullYear(),u.getMonth()-k[0]*k[1]+1,u.getDate()));for(w=r&&w<r?r:w;this._daylightSavingAdjust(new Date(v,m,1))>w;){m--;if(m<0){m=11;v--}}}b.drawMonth=m;b.drawYear=v;w=this._get(b,"prevText");w=!n?w:this.formatDate(w,this._daylightSavingAdjust(new Date(v,m-p,1)),this._getFormatConfig(b));
|
|
||||||
w=this._canAdjustMonth(b,-1,v,m)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+g+".datepicker._adjustDate('#"+b.id+"', -"+p+", 'M');\" title=\""+w+'"><span class="ui-icon ui-icon-circle-triangle-'+(j?"e":"w")+'">'+w+"</span></a>":o?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+w+'"><span class="ui-icon ui-icon-circle-triangle-'+(j?"e":"w")+'">'+w+"</span></a>";var x=this._get(b,"nextText");x=!n?x:this.formatDate(x,this._daylightSavingAdjust(new Date(v,
|
|
||||||
m+p,1)),this._getFormatConfig(b));o=this._canAdjustMonth(b,+1,v,m)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+g+".datepicker._adjustDate('#"+b.id+"', +"+p+", 'M');\" title=\""+x+'"><span class="ui-icon ui-icon-circle-triangle-'+(j?"w":"e")+'">'+x+"</span></a>":o?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+x+'"><span class="ui-icon ui-icon-circle-triangle-'+(j?"w":"e")+'">'+x+"</span></a>";p=this._get(b,"currentText");x=this._get(b,"gotoCurrent")&&
|
|
||||||
b.currentDay?s:f;p=!n?p:this.formatDate(p,x,this._getFormatConfig(b));n=!b.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+g+'.datepicker._hideDatepicker();">'+this._get(b,"closeText")+"</button>":"";l=l?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(j?n:"")+(this._isInRange(b,x)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+
|
|
||||||
g+".datepicker._gotoToday('#"+b.id+"');\">"+p+"</button>":"")+(j?"":n)+"</div>":"";n=parseInt(this._get(b,"firstDay"),10);n=isNaN(n)?0:n;p=this._get(b,"showWeek");x=this._get(b,"dayNames");this._get(b,"dayNamesShort");var y=this._get(b,"dayNamesMin"),H=this._get(b,"monthNames"),C=this._get(b,"monthNamesShort"),z=this._get(b,"beforeShowDay"),I=this._get(b,"showOtherMonths"),N=this._get(b,"selectOtherMonths");this._get(b,"calculateWeek");for(var J=this._getDefaultDate(b),D="",E=0;E<k[0];E++){var P=
|
|
||||||
"";this.maxRows=4;for(var L=0;L<k[1];L++){var Q=this._daylightSavingAdjust(new Date(v,m,b.selectedDay)),B=" ui-corner-all",F="";if(q){F+='<div class="ui-datepicker-group';if(k[1]>1)switch(L){case 0:F+=" ui-datepicker-group-first";B=" ui-corner-"+(j?"right":"left");break;case k[1]-1:F+=" ui-datepicker-group-last";B=" ui-corner-"+(j?"left":"right");break;default:F+=" ui-datepicker-group-middle";B="";break}F+='">'}F+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+B+'">'+(/all|left/.test(B)&&
|
|
||||||
E==0?j?o:w:"")+(/all|right/.test(B)&&E==0?j?w:o:"")+this._generateMonthYearHeader(b,m,v,r,u,E>0||L>0,H,C)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var G=p?'<th class="ui-datepicker-week-col">'+this._get(b,"weekHeader")+"</th>":"";for(B=0;B<7;B++){var A=(B+n)%7;G+="<th"+((B+n+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+x[A]+'">'+y[A]+"</span></th>"}F+=G+"</tr></thead><tbody>";G=this._getDaysInMonth(v,m);if(v==b.selectedYear&&m==b.selectedMonth)b.selectedDay=Math.min(b.selectedDay,
|
|
||||||
G);B=(this._getFirstDayOfMonth(v,m)-n+7)%7;G=Math.ceil((B+G)/7);this.maxRows=G=q?this.maxRows>G?this.maxRows:G:G;A=this._daylightSavingAdjust(new Date(v,m,1-B));for(var R=0;R<G;R++){F+="<tr>";var S=!p?"":'<td class="ui-datepicker-week-col">'+this._get(b,"calculateWeek")(A)+"</td>";for(B=0;B<7;B++){var M=z?z.apply(b.input?b.input[0]:null,[A]):[true,""],K=A.getMonth()!=m,O=K&&!N||!M[0]||r&&A<r||u&&A>u;S+='<td class="'+((B+n+6)%7>=5?" ui-datepicker-week-end":"")+(K?" ui-datepicker-other-month":"")+(A.getTime()==
|
|
||||||
Q.getTime()&&m==b.selectedMonth&&b._keyEvent||J.getTime()==A.getTime()&&J.getTime()==Q.getTime()?" "+this._dayOverClass:"")+(O?" "+this._unselectableClass+" ui-state-disabled":"")+(K&&!I?"":" "+M[1]+(A.getTime()==s.getTime()?" "+this._currentClass:"")+(A.getTime()==f.getTime()?" ui-datepicker-today":""))+'"'+((!K||I)&&M[2]?' title="'+M[2]+'"':"")+(O?"":' onclick="DP_jQuery_'+g+".datepicker._selectDay('#"+b.id+"',"+A.getMonth()+","+A.getFullYear()+', this);return false;"')+">"+(K&&!I?" ":O?'<span class="ui-state-default">'+
|
|
||||||
A.getDate()+"</span>":'<a class="ui-state-default'+(A.getTime()==f.getTime()?" ui-state-highlight":"")+(A.getTime()==s.getTime()?" ui-state-active":"")+(K?" ui-priority-secondary":"")+'" href="#">'+A.getDate()+"</a>")+"</td>";A.setDate(A.getDate()+1);A=this._daylightSavingAdjust(A)}F+=S+"</tr>"}m++;if(m>11){m=0;v++}F+="</tbody></table>"+(q?"</div>"+(k[0]>0&&L==k[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");P+=F}D+=P}D+=l+(a.browser.msie&&parseInt(a.browser.version,10)<7&&!b.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':
|
|
||||||
"");b._keyEvent=false;return D},_generateMonthYearHeader:function(b,f,j,l,o,n,k,m){var p=this._get(b,"changeMonth"),q=this._get(b,"changeYear"),s=this._get(b,"showMonthAfterYear"),r='<div class="ui-datepicker-title">',u="";if(n||!p)u+='<span class="ui-datepicker-month">'+k[f]+"</span>";else{k=l&&l.getFullYear()==j;var v=o&&o.getFullYear()==j;u+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+g+".datepicker._selectMonthYear('#"+b.id+"', this, 'M');\" >";for(var w=0;w<12;w++)if((!k||w>=l.getMonth())&&
|
|
||||||
(!v||w<=o.getMonth()))u+='<option value="'+w+'"'+(w==f?' selected="selected"':"")+">"+m[w]+"</option>";u+="</select>"}s||(r+=u+(n||!(p&&q)?" ":""));if(!b.yearshtml){b.yearshtml="";if(n||!q)r+='<span class="ui-datepicker-year">'+j+"</span>";else{m=this._get(b,"yearRange").split(":");var x=(new Date).getFullYear();k=function(y){y=y.match(/c[+-].*/)?j+parseInt(y.substring(1),10):y.match(/[+-].*/)?x+parseInt(y,10):parseInt(y,10);return isNaN(y)?x:y};f=k(m[0]);m=Math.max(f,k(m[1]||""));f=l?Math.max(f,
|
|
||||||
l.getFullYear()):f;m=o?Math.min(m,o.getFullYear()):m;for(b.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+g+".datepicker._selectMonthYear('#"+b.id+"', this, 'Y');\" >";f<=m;f++)b.yearshtml+='<option value="'+f+'"'+(f==j?' selected="selected"':"")+">"+f+"</option>";b.yearshtml+="</select>";r+=b.yearshtml;b.yearshtml=null}}r+=this._get(b,"yearSuffix");if(s)r+=(n||!(p&&q)?" ":"")+u;r+="</div>";return r},_adjustInstDate:function(b,f,j){var l=b.drawYear+(j=="Y"?f:0),o=b.drawMonth+
|
|
||||||
(j=="M"?f:0);f=Math.min(b.selectedDay,this._getDaysInMonth(l,o))+(j=="D"?f:0);l=this._restrictMinMax(b,this._daylightSavingAdjust(new Date(l,o,f)));b.selectedDay=l.getDate();b.drawMonth=b.selectedMonth=l.getMonth();b.drawYear=b.selectedYear=l.getFullYear();if(j=="M"||j=="Y")this._notifyChange(b)},_restrictMinMax:function(b,f){var j=this._getMinMaxDate(b,"min");b=this._getMinMaxDate(b,"max");f=j&&f<j?j:f;return f=b&&f>b?b:f},_notifyChange:function(b){var f=this._get(b,"onChangeMonthYear");if(f)f.apply(b.input?
|
|
||||||
b.input[0]:null,[b.selectedYear,b.selectedMonth+1,b])},_getNumberOfMonths:function(b){b=this._get(b,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(b,f){return this._determineDate(b,this._get(b,f+"Date"),null)},_getDaysInMonth:function(b,f){return 32-this._daylightSavingAdjust(new Date(b,f,32)).getDate()},_getFirstDayOfMonth:function(b,f){return(new Date(b,f,1)).getDay()},_canAdjustMonth:function(b,f,j,l){var o=this._getNumberOfMonths(b);j=this._daylightSavingAdjust(new Date(j,
|
|
||||||
l+(f<0?f:o[0]*o[1]),1));f<0&&j.setDate(this._getDaysInMonth(j.getFullYear(),j.getMonth()));return this._isInRange(b,j)},_isInRange:function(b,f){var j=this._getMinMaxDate(b,"min");b=this._getMinMaxDate(b,"max");return(!j||f.getTime()>=j.getTime())&&(!b||f.getTime()<=b.getTime())},_getFormatConfig:function(b){var f=this._get(b,"shortYearCutoff");f=typeof f!="string"?f:(new Date).getFullYear()%100+parseInt(f,10);return{shortYearCutoff:f,dayNamesShort:this._get(b,"dayNamesShort"),dayNames:this._get(b,
|
|
||||||
"dayNames"),monthNamesShort:this._get(b,"monthNamesShort"),monthNames:this._get(b,"monthNames")}},_formatDate:function(b,f,j,l){if(!f){b.currentDay=b.selectedDay;b.currentMonth=b.selectedMonth;b.currentYear=b.selectedYear}f=f?typeof f=="object"?f:this._daylightSavingAdjust(new Date(l,j,f)):this._daylightSavingAdjust(new Date(b.currentYear,b.currentMonth,b.currentDay));return this.formatDate(this._get(b,"dateFormat"),f,this._getFormatConfig(b))}});a.fn.datepicker=function(b){if(!this.length)return this;
|
|
||||||
if(!a.datepicker.initialized){a(document).mousedown(a.datepicker._checkExternalClick).find("body").append(a.datepicker.dpDiv);a.datepicker.initialized=true}var f=Array.prototype.slice.call(arguments,1);if(typeof b=="string"&&(b=="isDisabled"||b=="getDate"||b=="widget"))return a.datepicker["_"+b+"Datepicker"].apply(a.datepicker,[this[0]].concat(f));if(b=="option"&&arguments.length==2&&typeof arguments[1]=="string")return a.datepicker["_"+b+"Datepicker"].apply(a.datepicker,[this[0]].concat(f));return this.each(function(){typeof b==
|
|
||||||
"string"?a.datepicker["_"+b+"Datepicker"].apply(a.datepicker,[this].concat(f)):a.datepicker._attachDatepicker(this,b)})};a.datepicker=new c;a.datepicker.initialized=false;a.datepicker.uuid=(new Date).getTime();a.datepicker.version="1.8.16";window["DP_jQuery_"+g]=a})(jQuery);
|
|
||||||
(function(a,d){var c={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},e={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},h=a.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};a.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,
|
|
||||||
position:{my:"center",at:"center",collision:"fit",using:function(g){var i=a(this).css(g).offset().top;i<0&&a(this).css("top",g.top-i)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var g=this,i=g.options,b=i.title||" ",f=a.ui.dialog.getTitleId(g.element),j=(g.uiDialog=a("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+
|
|
||||||
i.dialogClass).css({zIndex:i.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){if(i.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===a.ui.keyCode.ESCAPE){g.close(n);n.preventDefault()}}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(n){g.moveToTop(false,n)});g.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(j);var l=(g.uiDialogTitlebar=a("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(j),
|
|
||||||
o=a('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){o.addClass("ui-state-hover")},function(){o.removeClass("ui-state-hover")}).focus(function(){o.addClass("ui-state-focus")}).blur(function(){o.removeClass("ui-state-focus")}).click(function(n){g.close(n);return false}).appendTo(l);(g.uiDialogTitlebarCloseText=a("<span></span>")).addClass("ui-icon ui-icon-closethick").text(i.closeText).appendTo(o);a("<span></span>").addClass("ui-dialog-title").attr("id",
|
|
||||||
f).html(b).prependTo(l);if(a.isFunction(i.beforeclose)&&!a.isFunction(i.beforeClose))i.beforeClose=i.beforeclose;l.find("*").add(l).disableSelection();i.draggable&&a.fn.draggable&&g._makeDraggable();i.resizable&&a.fn.resizable&&g._makeResizable();g._createButtons(i.buttons);g._isOpen=false;a.fn.bgiframe&&j.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var g=this;g.overlay&&g.overlay.destroy();g.uiDialog.hide();g.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");
|
|
||||||
g.uiDialog.remove();g.originalTitle&&g.element.attr("title",g.originalTitle);return g},widget:function(){return this.uiDialog},close:function(g){var i=this,b,f;if(false!==i._trigger("beforeClose",g)){i.overlay&&i.overlay.destroy();i.uiDialog.unbind("keypress.ui-dialog");i._isOpen=false;if(i.options.hide)i.uiDialog.hide(i.options.hide,function(){i._trigger("close",g)});else{i.uiDialog.hide();i._trigger("close",g)}a.ui.dialog.overlay.resize();if(i.options.modal){b=0;a(".ui-dialog").each(function(){if(this!==
|
|
||||||
i.uiDialog[0]){f=a(this).css("z-index");isNaN(f)||(b=Math.max(b,f))}});a.ui.dialog.maxZ=b}return i}},isOpen:function(){return this._isOpen},moveToTop:function(g,i){var b=this,f=b.options;if(f.modal&&!g||!f.stack&&!f.modal)return b._trigger("focus",i);if(f.zIndex>a.ui.dialog.maxZ)a.ui.dialog.maxZ=f.zIndex;if(b.overlay){a.ui.dialog.maxZ+=1;b.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)}g={scrollTop:b.element.scrollTop(),scrollLeft:b.element.scrollLeft()};a.ui.dialog.maxZ+=1;
|
|
||||||
b.uiDialog.css("z-index",a.ui.dialog.maxZ);b.element.attr(g);b._trigger("focus",i);return b},open:function(){if(!this._isOpen){var g=this,i=g.options,b=g.uiDialog;g.overlay=i.modal?new a.ui.dialog.overlay(g):null;g._size();g._position(i.position);b.show(i.show);g.moveToTop(true);i.modal&&b.bind("keypress.ui-dialog",function(f){if(f.keyCode===a.ui.keyCode.TAB){var j=a(":tabbable",this),l=j.filter(":first");j=j.filter(":last");if(f.target===j[0]&&!f.shiftKey){l.focus(1);return false}else if(f.target===
|
|
||||||
l[0]&&f.shiftKey){j.focus(1);return false}}});a(g.element.find(":tabbable").get().concat(b.find(".ui-dialog-buttonpane :tabbable").get().concat(b.get()))).eq(0).focus();g._isOpen=true;g._trigger("open");return g}},_createButtons:function(g){var i=this,b=false,f=a("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),j=a("<div></div>").addClass("ui-dialog-buttonset").appendTo(f);i.uiDialog.find(".ui-dialog-buttonpane").remove();typeof g==="object"&&g!==null&&a.each(g,
|
|
||||||
function(){return!(b=true)});if(b){a.each(g,function(l,o){o=a.isFunction(o)?{click:o,text:l}:o;var n=a('<button type="button"></button>').click(function(){o.click.apply(i.element[0],arguments)}).appendTo(j);a.each(o,function(k,m){if(k!=="click")k in h?n[k](m):n.attr(k,m)});a.fn.button&&n.button()});f.appendTo(i.uiDialog)}},_makeDraggable:function(){function g(l){return{position:l.position,offset:l.offset}}var i=this,b=i.options,f=a(document),j;i.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",
|
|
||||||
handle:".ui-dialog-titlebar",containment:"document",start:function(l,o){j=b.height==="auto"?"auto":a(this).height();a(this).height(a(this).height()).addClass("ui-dialog-dragging");i._trigger("dragStart",l,g(o))},drag:function(l,o){i._trigger("drag",l,g(o))},stop:function(l,o){b.position=[o.position.left-f.scrollLeft(),o.position.top-f.scrollTop()];a(this).removeClass("ui-dialog-dragging").height(j);i._trigger("dragStop",l,g(o));a.ui.dialog.overlay.resize()}})},_makeResizable:function(g){function i(l){return{originalPosition:l.originalPosition,
|
|
||||||
originalSize:l.originalSize,position:l.position,size:l.size}}g=g===d?this.options.resizable:g;var b=this,f=b.options,j=b.uiDialog.css("position");g=typeof g==="string"?g:"n,e,s,w,se,sw,ne,nw";b.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:b.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:b._minHeight(),handles:g,start:function(l,o){a(this).addClass("ui-dialog-resizing");b._trigger("resizeStart",l,i(o))},resize:function(l,o){b._trigger("resize",
|
|
||||||
l,i(o))},stop:function(l,o){a(this).removeClass("ui-dialog-resizing");f.height=a(this).height();f.width=a(this).width();b._trigger("resizeStop",l,i(o));a.ui.dialog.overlay.resize()}}).css("position",j).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var g=this.options;return g.height==="auto"?g.minHeight:Math.min(g.minHeight,g.height)},_position:function(g){var i=[],b=[0,0],f;if(g){if(typeof g==="string"||typeof g==="object"&&"0"in g){i=g.split?g.split(" "):
|
|
||||||
[g[0],g[1]];if(i.length===1)i[1]=i[0];a.each(["left","top"],function(j,l){if(+i[j]===i[j]){b[j]=i[j];i[j]=l}});g={my:i.join(" "),at:i.join(" "),offset:b.join(" ")}}g=a.extend({},a.ui.dialog.prototype.options.position,g)}else g=a.ui.dialog.prototype.options.position;(f=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},g));f||this.uiDialog.hide()},_setOptions:function(g){var i=this,b={},f=false;a.each(g,function(j,l){i._setOption(j,l);
|
|
||||||
if(j in c)f=true;if(j in e)b[j]=l});f&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",b)},_setOption:function(g,i){var b=this,f=b.uiDialog;switch(g){case "beforeclose":g="beforeClose";break;case "buttons":b._createButtons(i);break;case "closeText":b.uiDialogTitlebarCloseText.text(""+i);break;case "dialogClass":f.removeClass(b.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+i);break;case "disabled":i?f.addClass("ui-dialog-disabled"):
|
|
||||||
f.removeClass("ui-dialog-disabled");break;case "draggable":var j=f.is(":data(draggable)");j&&!i&&f.draggable("destroy");!j&&i&&b._makeDraggable();break;case "position":b._position(i);break;case "resizable":(j=f.is(":data(resizable)"))&&!i&&f.resizable("destroy");j&&typeof i==="string"&&f.resizable("option","handles",i);!j&&i!==false&&b._makeResizable(i);break;case "title":a(".ui-dialog-title",b.uiDialogTitlebar).html(""+(i||" "));break}a.Widget.prototype._setOption.apply(b,arguments)},_size:function(){var g=
|
|
||||||
this.options,i,b,f=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(g.minWidth>g.width)g.width=g.minWidth;i=this.uiDialog.css({height:"auto",width:g.width}).height();b=Math.max(0,g.minHeight-i);if(g.height==="auto")if(a.support.minHeight)this.element.css({minHeight:b,height:"auto"});else{this.uiDialog.show();g=this.element.css("height","auto").height();f||this.uiDialog.hide();this.element.height(Math.max(g,b))}else this.element.height(Math.max(g.height-
|
|
||||||
i,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});a.extend(a.ui.dialog,{version:"1.8.16",uuid:0,maxZ:0,getTitleId:function(g){g=g.attr("id");if(!g){this.uuid+=1;g=this.uuid}return"ui-dialog-title-"+g},overlay:function(g){this.$el=a.ui.dialog.overlay.create(g)}});a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(g){return g+".dialog-overlay"}).join(" "),
|
|
||||||
create:function(g){if(this.instances.length===0){setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()<a.ui.dialog.overlay.maxZ)return false})},1);a(document).bind("keydown.dialog-overlay",function(b){if(g.options.closeOnEscape&&!b.isDefaultPrevented()&&b.keyCode&&b.keyCode===a.ui.keyCode.ESCAPE){g.close(b);b.preventDefault()}});a(window).bind("resize.dialog-overlay",a.ui.dialog.overlay.resize)}var i=(this.oldInstances.pop()||
|
|
||||||
a("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});a.fn.bgiframe&&i.bgiframe();this.instances.push(i);return i},destroy:function(g){var i=a.inArray(g,this.instances);i!=-1&&this.oldInstances.push(this.instances.splice(i,1)[0]);this.instances.length===0&&a([document,window]).unbind(".dialog-overlay");g.remove();var b=0;a.each(this.instances,function(){b=Math.max(b,this.css("z-index"))});this.maxZ=b},height:function(){var g,i;if(a.browser.msie&&
|
|
||||||
a.browser.version<7){g=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);i=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return g<i?a(window).height()+"px":g+"px"}else return a(document).height()+"px"},width:function(){var g,i;if(a.browser.msie){g=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);i=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return g<i?a(window).width()+"px":g+"px"}else return a(document).width()+
|
|
||||||
"px"},resize:function(){var g=a([]);a.each(a.ui.dialog.overlay.instances,function(){g=g.add(this)});g.css({width:0,height:0}).css({width:a.ui.dialog.overlay.width(),height:a.ui.dialog.overlay.height()})}});a.extend(a.ui.dialog.overlay.prototype,{destroy:function(){a.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
|
|
||||||
(function(a){a.ui=a.ui||{};var d=/left|center|right/,c=/top|center|bottom/,e=a.fn.position,h=a.fn.offset;a.fn.position=function(g){if(!g||!g.of)return e.apply(this,arguments);g=a.extend({},g);var i=a(g.of),b=i[0],f=(g.collision||"flip").split(" "),j=g.offset?g.offset.split(" "):[0,0],l,o,n;if(b.nodeType===9){l=i.width();o=i.height();n={top:0,left:0}}else if(b.setTimeout){l=i.width();o=i.height();n={top:i.scrollTop(),left:i.scrollLeft()}}else if(b.preventDefault){g.at="left top";l=o=0;n={top:g.of.pageY,
|
|
||||||
left:g.of.pageX}}else{l=i.outerWidth();o=i.outerHeight();n=i.offset()}a.each(["my","at"],function(){var k=(g[this]||"").split(" ");if(k.length===1)k=d.test(k[0])?k.concat(["center"]):c.test(k[0])?["center"].concat(k):["center","center"];k[0]=d.test(k[0])?k[0]:"center";k[1]=c.test(k[1])?k[1]:"center";g[this]=k});if(f.length===1)f[1]=f[0];j[0]=parseInt(j[0],10)||0;if(j.length===1)j[1]=j[0];j[1]=parseInt(j[1],10)||0;if(g.at[0]==="right")n.left+=l;else if(g.at[0]==="center")n.left+=l/2;if(g.at[1]==="bottom")n.top+=
|
|
||||||
o;else if(g.at[1]==="center")n.top+=o/2;n.left+=j[0];n.top+=j[1];return this.each(function(){var k=a(this),m=k.outerWidth(),p=k.outerHeight(),q=parseInt(a.curCSS(this,"marginLeft",true))||0,s=parseInt(a.curCSS(this,"marginTop",true))||0,r=m+q+(parseInt(a.curCSS(this,"marginRight",true))||0),u=p+s+(parseInt(a.curCSS(this,"marginBottom",true))||0),v=a.extend({},n),w;if(g.my[0]==="right")v.left-=m;else if(g.my[0]==="center")v.left-=m/2;if(g.my[1]==="bottom")v.top-=p;else if(g.my[1]==="center")v.top-=
|
|
||||||
p/2;v.left=Math.round(v.left);v.top=Math.round(v.top);w={left:v.left-q,top:v.top-s};a.each(["left","top"],function(x,y){a.ui.position[f[x]]&&a.ui.position[f[x]][y](v,{targetWidth:l,targetHeight:o,elemWidth:m,elemHeight:p,collisionPosition:w,collisionWidth:r,collisionHeight:u,offset:j,my:g.my,at:g.at})});a.fn.bgiframe&&k.bgiframe();k.offset(a.extend(v,{using:g.using}))})};a.ui.position={fit:{left:function(g,i){var b=a(window);b=i.collisionPosition.left+i.collisionWidth-b.width()-b.scrollLeft();g.left=
|
|
||||||
b>0?g.left-b:Math.max(g.left-i.collisionPosition.left,g.left)},top:function(g,i){var b=a(window);b=i.collisionPosition.top+i.collisionHeight-b.height()-b.scrollTop();g.top=b>0?g.top-b:Math.max(g.top-i.collisionPosition.top,g.top)}},flip:{left:function(g,i){if(i.at[0]!=="center"){var b=a(window);b=i.collisionPosition.left+i.collisionWidth-b.width()-b.scrollLeft();var f=i.my[0]==="left"?-i.elemWidth:i.my[0]==="right"?i.elemWidth:0,j=i.at[0]==="left"?i.targetWidth:-i.targetWidth,l=-2*i.offset[0];g.left+=
|
|
||||||
i.collisionPosition.left<0?f+j+l:b>0?f+j+l:0}},top:function(g,i){if(i.at[1]!=="center"){var b=a(window);b=i.collisionPosition.top+i.collisionHeight-b.height()-b.scrollTop();var f=i.my[1]==="top"?-i.elemHeight:i.my[1]==="bottom"?i.elemHeight:0,j=i.at[1]==="top"?i.targetHeight:-i.targetHeight,l=-2*i.offset[1];g.top+=i.collisionPosition.top<0?f+j+l:b>0?f+j+l:0}}}};if(!a.offset.setOffset){a.offset.setOffset=function(g,i){if(/static/.test(a.curCSS(g,"position")))g.style.position="relative";var b=a(g),
|
|
||||||
f=b.offset(),j=parseInt(a.curCSS(g,"top",true),10)||0,l=parseInt(a.curCSS(g,"left",true),10)||0;f={top:i.top-f.top+j,left:i.left-f.left+l};"using"in i?i.using.call(g,f):b.css(f)};a.fn.offset=function(g){var i=this[0];if(!i||!i.ownerDocument)return null;if(g)return this.each(function(){a.offset.setOffset(this,g)});return h.call(this)}}})(jQuery);
|
|
||||||
(function(a,d){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=a("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");
|
|
||||||
this.valueDiv.remove();a.Widget.prototype.destroy.apply(this,arguments)},value:function(c){if(c===d)return this._value();this._setOption("value",c);return this},_setOption:function(c,e){if(c==="value"){this.options.value=e;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var c=this.options.value;if(typeof c!=="number")c=0;return Math.min(this.options.max,Math.max(this.min,c))},_percentage:function(){return 100*
|
|
||||||
this._value()/this.options.max},_refreshValue:function(){var c=this.value(),e=this._percentage();if(this.oldValue!==c){this.oldValue=c;this._trigger("change")}this.valueDiv.toggle(c>this.min).toggleClass("ui-corner-right",c===this.options.max).width(e.toFixed(0)+"%");this.element.attr("aria-valuenow",c)}});a.extend(a.ui.progressbar,{version:"1.8.16"})})(jQuery);
|
|
||||||
(function(a){a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var d=this,c=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),h=c.values&&c.values.length||1,g=[];this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+
|
|
||||||
this.orientation+" ui-widget ui-widget-content ui-corner-all"+(c.disabled?" ui-slider-disabled ui-disabled":""));this.range=a([]);if(c.range){if(c.range===true){if(!c.values)c.values=[this._valueMin(),this._valueMin()];if(c.values.length&&c.values.length!==2)c.values=[c.values[0],c.values[0]]}this.range=a("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(c.range==="min"||c.range==="max"?" ui-slider-range-"+c.range:""))}for(var i=e.length;i<h;i+=1)g.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");
|
|
||||||
this.handles=e.add(a(g.join("")).appendTo(d.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(b){b.preventDefault()}).hover(function(){c.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(c.disabled)a(this).blur();else{a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(b){a(this).data("index.ui-slider-handle",
|
|
||||||
b)});this.handles.keydown(function(b){var f=true,j=a(this).data("index.ui-slider-handle"),l,o,n;if(!d.options.disabled){switch(b.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:f=false;if(!d._keySliding){d._keySliding=true;a(this).addClass("ui-state-active");l=d._start(b,j);if(l===false)return}break}n=d.options.step;l=d.options.values&&d.options.values.length?
|
|
||||||
(o=d.values(j)):(o=d.value());switch(b.keyCode){case a.ui.keyCode.HOME:o=d._valueMin();break;case a.ui.keyCode.END:o=d._valueMax();break;case a.ui.keyCode.PAGE_UP:o=d._trimAlignValue(l+(d._valueMax()-d._valueMin())/5);break;case a.ui.keyCode.PAGE_DOWN:o=d._trimAlignValue(l-(d._valueMax()-d._valueMin())/5);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(l===d._valueMax())return;o=d._trimAlignValue(l+n);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(l===d._valueMin())return;o=d._trimAlignValue(l-
|
|
||||||
n);break}d._slide(b,j,o);return f}}).keyup(function(b){var f=a(this).data("index.ui-slider-handle");if(d._keySliding){d._keySliding=false;d._stop(b,f);d._change(b,f);a(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();
|
|
||||||
return this},_mouseCapture:function(d){var c=this.options,e,h,g,i,b;if(c.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();e=this._normValueFromMouse({x:d.pageX,y:d.pageY});h=this._valueMax()-this._valueMin()+1;i=this;this.handles.each(function(f){var j=Math.abs(e-i.values(f));if(h>j){h=j;g=a(this);b=f}});if(c.range===true&&this.values(1)===c.min){b+=1;g=a(this.handles[b])}if(this._start(d,b)===false)return false;
|
|
||||||
this._mouseSliding=true;i._handleIndex=b;g.addClass("ui-state-active").focus();c=g.offset();this._clickOffset=!a(d.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:d.pageX-c.left-g.width()/2,top:d.pageY-c.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(d,b,e);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(d){var c=
|
|
||||||
this._normValueFromMouse({x:d.pageX,y:d.pageY});this._slide(d,this._handleIndex,c);return false},_mouseStop:function(d){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(d,this._handleIndex);this._change(d,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(d){var c;if(this.orientation==="horizontal"){c=
|
|
||||||
this.elementSize.width;d=d.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{c=this.elementSize.height;d=d.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}c=d/c;if(c>1)c=1;if(c<0)c=0;if(this.orientation==="vertical")c=1-c;d=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+c*d)},_start:function(d,c){var e={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){e.value=this.values(c);
|
|
||||||
e.values=this.values()}return this._trigger("start",d,e)},_slide:function(d,c,e){var h;if(this.options.values&&this.options.values.length){h=this.values(c?0:1);if(this.options.values.length===2&&this.options.range===true&&(c===0&&e>h||c===1&&e<h))e=h;if(e!==this.values(c)){h=this.values();h[c]=e;d=this._trigger("slide",d,{handle:this.handles[c],value:e,values:h});this.values(c?0:1);d!==false&&this.values(c,e,true)}}else if(e!==this.value()){d=this._trigger("slide",d,{handle:this.handles[c],value:e});
|
|
||||||
d!==false&&this.value(e)}},_stop:function(d,c){var e={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){e.value=this.values(c);e.values=this.values()}this._trigger("stop",d,e)},_change:function(d,c){if(!this._keySliding&&!this._mouseSliding){var e={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){e.value=this.values(c);e.values=this.values()}this._trigger("change",d,e)}},value:function(d){if(arguments.length){this.options.value=
|
|
||||||
this._trimAlignValue(d);this._refreshValue();this._change(null,0)}else return this._value()},values:function(d,c){var e,h,g;if(arguments.length>1){this.options.values[d]=this._trimAlignValue(c);this._refreshValue();this._change(null,d)}else if(arguments.length)if(a.isArray(arguments[0])){e=this.options.values;h=arguments[0];for(g=0;g<e.length;g+=1){e[g]=this._trimAlignValue(h[g]);this._change(null,g)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(d):
|
|
||||||
this.value();else return this._values()},_setOption:function(d,c){var e,h=0;if(a.isArray(this.options.values))h=this.options.values.length;a.Widget.prototype._setOption.apply(this,arguments);switch(d){case "disabled":if(c){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.propAttr("disabled",true);this.element.addClass("ui-disabled")}else{this.handles.propAttr("disabled",false);this.element.removeClass("ui-disabled")}break;case "orientation":this._detectOrientation();
|
|
||||||
this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(e=0;e<h;e+=1)this._change(null,e);this._animateOff=false;break}},_value:function(){var d=this.options.value;return d=this._trimAlignValue(d)},_values:function(d){var c,e;if(arguments.length){c=this.options.values[d];
|
|
||||||
return c=this._trimAlignValue(c)}else{c=this.options.values.slice();for(e=0;e<c.length;e+=1)c[e]=this._trimAlignValue(c[e]);return c}},_trimAlignValue:function(d){if(d<=this._valueMin())return this._valueMin();if(d>=this._valueMax())return this._valueMax();var c=this.options.step>0?this.options.step:1,e=(d-this._valueMin())%c;d=d-e;if(Math.abs(e)*2>=c)d+=e>0?c:-c;return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var d=
|
|
||||||
this.options.range,c=this.options,e=this,h=!this._animateOff?c.animate:false,g,i={},b,f,j,l;if(this.options.values&&this.options.values.length)this.handles.each(function(o){g=(e.values(o)-e._valueMin())/(e._valueMax()-e._valueMin())*100;i[e.orientation==="horizontal"?"left":"bottom"]=g+"%";a(this).stop(1,1)[h?"animate":"css"](i,c.animate);if(e.options.range===true)if(e.orientation==="horizontal"){if(o===0)e.range.stop(1,1)[h?"animate":"css"]({left:g+"%"},c.animate);if(o===1)e.range[h?"animate":"css"]({width:g-
|
|
||||||
b+"%"},{queue:false,duration:c.animate})}else{if(o===0)e.range.stop(1,1)[h?"animate":"css"]({bottom:g+"%"},c.animate);if(o===1)e.range[h?"animate":"css"]({height:g-b+"%"},{queue:false,duration:c.animate})}b=g});else{f=this.value();j=this._valueMin();l=this._valueMax();g=l!==j?(f-j)/(l-j)*100:0;i[e.orientation==="horizontal"?"left":"bottom"]=g+"%";this.handle.stop(1,1)[h?"animate":"css"](i,c.animate);if(d==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[h?"animate":"css"]({width:g+"%"},
|
|
||||||
c.animate);if(d==="max"&&this.orientation==="horizontal")this.range[h?"animate":"css"]({width:100-g+"%"},{queue:false,duration:c.animate});if(d==="min"&&this.orientation==="vertical")this.range.stop(1,1)[h?"animate":"css"]({height:g+"%"},c.animate);if(d==="max"&&this.orientation==="vertical")this.range[h?"animate":"css"]({height:100-g+"%"},{queue:false,duration:c.animate})}}});a.extend(a.ui.slider,{version:"1.8.16"})})(jQuery);
|
|
||||||
(function(a,d){function c(){return++h}function e(){return++g}var h=0,g=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading…</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(i,b){if(i=="selected")this.options.collapsible&&
|
|
||||||
b==this.options.selected||this.select(b);else{this.options[i]=b;this._tabify()}},_tabId:function(i){return i.title&&i.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+c()},_sanitizeSelector:function(i){return i.replace(/:/g,"\\:")},_cookie:function(){var i=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+e());return a.cookie.apply(null,[i].concat(a.makeArray(arguments)))},_ui:function(i,b){return{tab:i,panel:b,index:this.anchors.index(i)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var i=
|
|
||||||
a(this);i.html(i.data("label.tabs")).removeData("label.tabs")})},_tabify:function(i){function b(r,u){r.css("display","");!a.support.opacity&&u.opacity&&r[0].style.removeAttribute("filter")}var f=this,j=this.options,l=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=a(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);this.anchors.each(function(r,u){var v=a(u).attr("href"),w=v.split("#")[0],x;if(w&&(w===location.toString().split("#")[0]||
|
|
||||||
(x=a("base")[0])&&w===x.href)){v=u.hash;u.href=v}if(l.test(v))f.panels=f.panels.add(f.element.find(f._sanitizeSelector(v)));else if(v&&v!=="#"){a.data(u,"href.tabs",v);a.data(u,"load.tabs",v.replace(/#.*$/,""));v=f._tabId(u);u.href="#"+v;u=f.element.find("#"+v);if(!u.length){u=a(j.panelTemplate).attr("id",v).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(f.panels[r-1]||f.list);u.data("destroy.tabs",true)}f.panels=f.panels.add(u)}else j.disabled.push(r)});if(i){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");
|
|
||||||
this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(j.selected===d){location.hash&&this.anchors.each(function(r,u){if(u.hash==location.hash){j.selected=r;return false}});if(typeof j.selected!=="number"&&j.cookie)j.selected=parseInt(f._cookie(),10);if(typeof j.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)j.selected=
|
|
||||||
this.lis.index(this.lis.filter(".ui-tabs-selected"));j.selected=j.selected||(this.lis.length?0:-1)}else if(j.selected===null)j.selected=-1;j.selected=j.selected>=0&&this.anchors[j.selected]||j.selected<0?j.selected:0;j.disabled=a.unique(j.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(r){return f.lis.index(r)}))).sort();a.inArray(j.selected,j.disabled)!=-1&&j.disabled.splice(a.inArray(j.selected,j.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");
|
|
||||||
if(j.selected>=0&&this.anchors.length){f.element.find(f._sanitizeSelector(f.anchors[j.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(j.selected).addClass("ui-tabs-selected ui-state-active");f.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[j.selected],f.element.find(f._sanitizeSelector(f.anchors[j.selected].hash))[0]))});this.load(j.selected)}a(window).bind("unload",function(){f.lis.add(f.anchors).unbind(".tabs");f.lis=f.anchors=f.panels=null})}else j.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));
|
|
||||||
this.element[j.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");j.cookie&&this._cookie(j.selected,j.cookie);i=0;for(var o;o=this.lis[i];i++)a(o)[a.inArray(i,j.disabled)!=-1&&!a(o).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");j.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(j.event!=="mouseover"){var n=function(r,u){u.is(":not(.ui-state-disabled)")&&u.addClass("ui-state-"+r)},k=function(r,u){u.removeClass("ui-state-"+
|
|
||||||
r)};this.lis.bind("mouseover.tabs",function(){n("hover",a(this))});this.lis.bind("mouseout.tabs",function(){k("hover",a(this))});this.anchors.bind("focus.tabs",function(){n("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){k("focus",a(this).closest("li"))})}var m,p;if(j.fx)if(a.isArray(j.fx)){m=j.fx[0];p=j.fx[1]}else m=p=j.fx;var q=p?function(r,u){a(r).closest("li").addClass("ui-tabs-selected ui-state-active");u.hide().removeClass("ui-tabs-hide").animate(p,p.duration||"normal",
|
|
||||||
function(){b(u,p);f._trigger("show",null,f._ui(r,u[0]))})}:function(r,u){a(r).closest("li").addClass("ui-tabs-selected ui-state-active");u.removeClass("ui-tabs-hide");f._trigger("show",null,f._ui(r,u[0]))},s=m?function(r,u){u.animate(m,m.duration||"normal",function(){f.lis.removeClass("ui-tabs-selected ui-state-active");u.addClass("ui-tabs-hide");b(u,m);f.element.dequeue("tabs")})}:function(r,u){f.lis.removeClass("ui-tabs-selected ui-state-active");u.addClass("ui-tabs-hide");f.element.dequeue("tabs")};
|
|
||||||
this.anchors.bind(j.event+".tabs",function(){var r=this,u=a(r).closest("li"),v=f.panels.filter(":not(.ui-tabs-hide)"),w=f.element.find(f._sanitizeSelector(r.hash));if(u.hasClass("ui-tabs-selected")&&!j.collapsible||u.hasClass("ui-state-disabled")||u.hasClass("ui-state-processing")||f.panels.filter(":animated").length||f._trigger("select",null,f._ui(this,w[0]))===false){this.blur();return false}j.selected=f.anchors.index(this);f.abort();if(j.collapsible)if(u.hasClass("ui-tabs-selected")){j.selected=
|
|
||||||
-1;j.cookie&&f._cookie(j.selected,j.cookie);f.element.queue("tabs",function(){s(r,v)}).dequeue("tabs");this.blur();return false}else if(!v.length){j.cookie&&f._cookie(j.selected,j.cookie);f.element.queue("tabs",function(){q(r,w)});f.load(f.anchors.index(this));this.blur();return false}j.cookie&&f._cookie(j.selected,j.cookie);if(w.length){v.length&&f.element.queue("tabs",function(){s(r,v)});f.element.queue("tabs",function(){q(r,w)});f.load(f.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";
|
|
||||||
a.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(i){if(typeof i=="string")i=this.anchors.index(this.anchors.filter("[href$="+i+"]"));return i},destroy:function(){var i=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var b=
|
|
||||||
a.data(this,"href.tabs");if(b)this.href=b;var f=a(this).unbind(".tabs");a.each(["href","load","cache"],function(j,l){f.removeData(l+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});i.cookie&&this._cookie(null,i.cookie);return this},add:function(i,
|
|
||||||
b,f){if(f===d)f=this.anchors.length;var j=this,l=this.options;b=a(l.tabTemplate.replace(/#\{href\}/g,i).replace(/#\{label\}/g,b));i=!i.indexOf("#")?i.replace("#",""):this._tabId(a("a",b)[0]);b.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var o=j.element.find("#"+i);o.length||(o=a(l.panelTemplate).attr("id",i).data("destroy.tabs",true));o.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(f>=this.lis.length){b.appendTo(this.list);o.appendTo(this.list[0].parentNode)}else{b.insertBefore(this.lis[f]);
|
|
||||||
o.insertBefore(this.panels[f])}l.disabled=a.map(l.disabled,function(n){return n>=f?++n:n});this._tabify();if(this.anchors.length==1){l.selected=0;b.addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){j._trigger("show",null,j._ui(j.anchors[0],j.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[f],this.panels[f]));return this},remove:function(i){i=this._getIndex(i);var b=this.options,f=this.lis.eq(i).remove(),j=this.panels.eq(i).remove();
|
|
||||||
if(f.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(i+(i+1<this.anchors.length?1:-1));b.disabled=a.map(a.grep(b.disabled,function(l){return l!=i}),function(l){return l>=i?--l:l});this._tabify();this._trigger("remove",null,this._ui(f.find("a")[0],j[0]));return this},enable:function(i){i=this._getIndex(i);var b=this.options;if(a.inArray(i,b.disabled)!=-1){this.lis.eq(i).removeClass("ui-state-disabled");b.disabled=a.grep(b.disabled,function(f){return f!=i});this._trigger("enable",null,
|
|
||||||
this._ui(this.anchors[i],this.panels[i]));return this}},disable:function(i){i=this._getIndex(i);var b=this.options;if(i!=b.selected){this.lis.eq(i).addClass("ui-state-disabled");b.disabled.push(i);b.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[i],this.panels[i]))}return this},select:function(i){i=this._getIndex(i);if(i==-1)if(this.options.collapsible&&this.options.selected!=-1)i=this.options.selected;else return this;this.anchors.eq(i).trigger(this.options.event+".tabs");return this},
|
|
||||||
load:function(i){i=this._getIndex(i);var b=this,f=this.options,j=this.anchors.eq(i)[0],l=a.data(j,"load.tabs");this.abort();if(!l||this.element.queue("tabs").length!==0&&a.data(j,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(i).addClass("ui-state-processing");if(f.spinner){var o=a("span",j);o.data("label.tabs",o.html()).html(f.spinner)}this.xhr=a.ajax(a.extend({},f.ajaxOptions,{url:l,success:function(n,k){b.element.find(b._sanitizeSelector(j.hash)).html(n);b._cleanup();f.cache&&a.data(j,
|
|
||||||
"cache.tabs",true);b._trigger("load",null,b._ui(b.anchors[i],b.panels[i]));try{f.ajaxOptions.success(n,k)}catch(m){}},error:function(n,k){b._cleanup();b._trigger("load",null,b._ui(b.anchors[i],b.panels[i]));try{f.ajaxOptions.error(n,k,i,j)}catch(m){}}}));b.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},
|
|
||||||
url:function(i,b){this.anchors.eq(i).removeData("cache.tabs").data("load.tabs",b);return this},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.8.16"});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(i,b){var f=this,j=this.options,l=f._rotate||(f._rotate=function(o){clearTimeout(f.rotation);f.rotation=setTimeout(function(){var n=j.selected;f.select(++n<f.anchors.length?n:0)},i);o&&o.stopPropagation()});b=f._unrotate||(f._unrotate=!b?function(o){o.clientX&&
|
|
||||||
f.rotate(null)}:function(){t=j.selected;l()});if(i){this.element.bind("tabsshow",l);this.anchors.bind(j.event+".tabs",b);l()}else{clearTimeout(f.rotation);this.element.unbind("tabsshow",l);this.anchors.unbind(j.event+".tabs",b);delete this._rotate;delete this._unrotate}return this}})})(jQuery);
|
|
|
@ -1,651 +0,0 @@
|
||||||
/*
|
|
||||||
* jQuery File Upload User Interface Plugin 5.0.20
|
|
||||||
* https://github.com/blueimp/jQuery-File-Upload
|
|
||||||
*
|
|
||||||
* Copyright 2010, Sebastian Tschan
|
|
||||||
* https://blueimp.net
|
|
||||||
*
|
|
||||||
* Licensed under the MIT license:
|
|
||||||
* http://creativecommons.org/licenses/MIT/
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*jslint white: true, nomen: true, unparam: true, regexp: true */
|
|
||||||
/*global window, document, URL, webkitURL, FileReader, jQuery */
|
|
||||||
|
|
||||||
(function ($) {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
// The UI version extends the basic fileupload widget and adds
|
|
||||||
// a complete user interface based on the given upload/download
|
|
||||||
// templates.
|
|
||||||
$.widget('blueimpUI.fileupload', $.blueimp.fileupload, {
|
|
||||||
|
|
||||||
options: {
|
|
||||||
// By default, files added to the widget are uploaded as soon
|
|
||||||
// as the user clicks on the start buttons. To enable automatic
|
|
||||||
// uploads, set the following option to true:
|
|
||||||
autoUpload: false,
|
|
||||||
// The following option limits the number of files that are
|
|
||||||
// allowed to be uploaded using this widget:
|
|
||||||
maxNumberOfFiles: undefined,
|
|
||||||
// The maximum allowed file size:
|
|
||||||
maxFileSize: undefined,
|
|
||||||
// The minimum allowed file size:
|
|
||||||
minFileSize: 1,
|
|
||||||
// The regular expression for allowed file types, matches
|
|
||||||
// against either file type or file name:
|
|
||||||
acceptFileTypes: /.+$/i,
|
|
||||||
// The regular expression to define for which files a preview
|
|
||||||
// image is shown, matched against the file type:
|
|
||||||
previewFileTypes: /^image\/(gif|jpeg|png)$/,
|
|
||||||
// The maximum width of the preview images:
|
|
||||||
previewMaxWidth: 80,
|
|
||||||
// The maximum height of the preview images:
|
|
||||||
previewMaxHeight: 80,
|
|
||||||
// By default, preview images are displayed as canvas elements
|
|
||||||
// if supported by the browser. Set the following option to false
|
|
||||||
// to always display preview images as img elements:
|
|
||||||
previewAsCanvas: true,
|
|
||||||
// The file upload template that is given as first argument to the
|
|
||||||
// jQuery.tmpl method to render the file uploads:
|
|
||||||
uploadTemplate: $('#template-upload'),
|
|
||||||
// The file download template, that is given as first argument to the
|
|
||||||
// jQuery.tmpl method to render the file downloads:
|
|
||||||
downloadTemplate: $('#template-download'),
|
|
||||||
// The expected data type of the upload response, sets the dataType
|
|
||||||
// option of the $.ajax upload requests:
|
|
||||||
dataType: 'json',
|
|
||||||
|
|
||||||
// The add callback is invoked as soon as files are added to the fileupload
|
|
||||||
// widget (via file input selection, drag & drop or add API call).
|
|
||||||
// See the basic file upload widget for more information:
|
|
||||||
add: function (e, data) {
|
|
||||||
var that = $(this).data('fileupload');
|
|
||||||
that._adjustMaxNumberOfFiles(-data.files.length);
|
|
||||||
data.isAdjusted = true;
|
|
||||||
data.isValidated = that._validate(data.files);
|
|
||||||
data.context = that._renderUpload(data.files)
|
|
||||||
.appendTo($(this).find('.files')).fadeIn(function () {
|
|
||||||
// Fix for IE7 and lower:
|
|
||||||
$(this).show();
|
|
||||||
}).data('data', data);
|
|
||||||
if ((that.options.autoUpload || data.autoUpload) &&
|
|
||||||
data.isValidated) {
|
|
||||||
data.jqXHR = data.submit();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// Callback for the start of each file upload request:
|
|
||||||
send: function (e, data) {
|
|
||||||
if (!data.isValidated) {
|
|
||||||
var that = $(this).data('fileupload');
|
|
||||||
if (!data.isAdjusted) {
|
|
||||||
that._adjustMaxNumberOfFiles(-data.files.length);
|
|
||||||
}
|
|
||||||
if (!that._validate(data.files)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (data.context && data.dataType &&
|
|
||||||
data.dataType.substr(0, 6) === 'iframe') {
|
|
||||||
// Iframe Transport does not support progress events.
|
|
||||||
// In lack of an indeterminate progress bar, we set
|
|
||||||
// the progress to 100%, showing the full animated bar:
|
|
||||||
data.context.find('.ui-progressbar').progressbar(
|
|
||||||
'value',
|
|
||||||
parseInt(100, 10)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// Callback for successful uploads:
|
|
||||||
done: function (e, data) {
|
|
||||||
var that = $(this).data('fileupload');
|
|
||||||
if (data.context) {
|
|
||||||
data.context.each(function (index) {
|
|
||||||
var file = ($.isArray(data.result) &&
|
|
||||||
data.result[index]) || {error: 'emptyResult'};
|
|
||||||
if (file.error) {
|
|
||||||
that._adjustMaxNumberOfFiles(1);
|
|
||||||
}
|
|
||||||
$(this).fadeOut(function () {
|
|
||||||
that._renderDownload([file])
|
|
||||||
.css('display', 'none')
|
|
||||||
.replaceAll(this)
|
|
||||||
.fadeIn(function () {
|
|
||||||
// Fix for IE7 and lower:
|
|
||||||
$(this).show();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
that._renderDownload(data.result)
|
|
||||||
.css('display', 'none')
|
|
||||||
.appendTo($(this).find('.files'))
|
|
||||||
.fadeIn(function () {
|
|
||||||
// Fix for IE7 and lower:
|
|
||||||
$(this).show();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// Callback for failed (abort or error) uploads:
|
|
||||||
fail: function (e, data) {
|
|
||||||
var that = $(this).data('fileupload');
|
|
||||||
that._adjustMaxNumberOfFiles(data.files.length);
|
|
||||||
if (data.context) {
|
|
||||||
data.context.each(function (index) {
|
|
||||||
$(this).fadeOut(function () {
|
|
||||||
if (data.errorThrown !== 'abort') {
|
|
||||||
var file = data.files[index];
|
|
||||||
file.error = file.error || data.errorThrown ||
|
|
||||||
true;
|
|
||||||
that._renderDownload([file])
|
|
||||||
.css('display', 'none')
|
|
||||||
.replaceAll(this)
|
|
||||||
.fadeIn(function () {
|
|
||||||
// Fix for IE7 and lower:
|
|
||||||
$(this).show();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
data.context.remove();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else if (data.errorThrown !== 'abort') {
|
|
||||||
that._adjustMaxNumberOfFiles(-data.files.length);
|
|
||||||
data.context = that._renderUpload(data.files)
|
|
||||||
.css('display', 'none')
|
|
||||||
.appendTo($(this).find('.files'))
|
|
||||||
.fadeIn(function () {
|
|
||||||
// Fix for IE7 and lower:
|
|
||||||
$(this).show();
|
|
||||||
}).data('data', data);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// Callback for upload progress events:
|
|
||||||
progress: function (e, data) {
|
|
||||||
if (data.context) {
|
|
||||||
data.context.find('.ui-progressbar').progressbar(
|
|
||||||
'value',
|
|
||||||
parseInt(data.loaded / data.total * 100, 10)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// Callback for global upload progress events:
|
|
||||||
progressall: function (e, data) {
|
|
||||||
$(this).find('.fileupload-progressbar').progressbar(
|
|
||||||
'value',
|
|
||||||
parseInt(data.loaded / data.total * 100, 10)
|
|
||||||
);
|
|
||||||
},
|
|
||||||
// Callback for uploads start, equivalent to the global ajaxStart event:
|
|
||||||
start: function () {
|
|
||||||
$(this).find('.fileupload-progressbar')
|
|
||||||
.progressbar('value', 0).fadeIn();
|
|
||||||
},
|
|
||||||
// Callback for uploads stop, equivalent to the global ajaxStop event:
|
|
||||||
stop: function () {
|
|
||||||
$(this).find('.fileupload-progressbar').fadeOut();
|
|
||||||
},
|
|
||||||
// Callback for file deletion:
|
|
||||||
destroy: function (e, data) {
|
|
||||||
var that = $(this).data('fileupload');
|
|
||||||
if (data.url) {
|
|
||||||
$.ajax(data)
|
|
||||||
.success(function () {
|
|
||||||
that._adjustMaxNumberOfFiles(1);
|
|
||||||
$(this).fadeOut(function () {
|
|
||||||
$(this).remove();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
that._adjustMaxNumberOfFiles(1);
|
|
||||||
data.context.fadeOut(function () {
|
|
||||||
$(this).remove();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// Scales the given image (img HTML element)
|
|
||||||
// using the given options.
|
|
||||||
// Returns a canvas object if the canvas option is true
|
|
||||||
// and the browser supports canvas, else the scaled image:
|
|
||||||
_scaleImage: function (img, options) {
|
|
||||||
options = options || {};
|
|
||||||
var canvas = document.createElement('canvas'),
|
|
||||||
scale = Math.min(
|
|
||||||
(options.maxWidth || img.width) / img.width,
|
|
||||||
(options.maxHeight || img.height) / img.height
|
|
||||||
);
|
|
||||||
if (scale >= 1) {
|
|
||||||
scale = Math.max(
|
|
||||||
(options.minWidth || img.width) / img.width,
|
|
||||||
(options.minHeight || img.height) / img.height
|
|
||||||
);
|
|
||||||
}
|
|
||||||
img.width = parseInt(img.width * scale, 10);
|
|
||||||
img.height = parseInt(img.height * scale, 10);
|
|
||||||
if (!options.canvas || !canvas.getContext) {
|
|
||||||
return img;
|
|
||||||
}
|
|
||||||
canvas.width = img.width;
|
|
||||||
canvas.height = img.height;
|
|
||||||
canvas.getContext('2d')
|
|
||||||
.drawImage(img, 0, 0, img.width, img.height);
|
|
||||||
return canvas;
|
|
||||||
},
|
|
||||||
|
|
||||||
_createObjectURL: function (file) {
|
|
||||||
var undef = 'undefined',
|
|
||||||
urlAPI = (typeof window.createObjectURL !== undef && window) ||
|
|
||||||
(typeof URL !== undef && URL) ||
|
|
||||||
(typeof webkitURL !== undef && webkitURL);
|
|
||||||
return urlAPI ? urlAPI.createObjectURL(file) : false;
|
|
||||||
},
|
|
||||||
|
|
||||||
_revokeObjectURL: function (url) {
|
|
||||||
var undef = 'undefined',
|
|
||||||
urlAPI = (typeof window.revokeObjectURL !== undef && window) ||
|
|
||||||
(typeof URL !== undef && URL) ||
|
|
||||||
(typeof webkitURL !== undef && webkitURL);
|
|
||||||
return urlAPI ? urlAPI.revokeObjectURL(url) : false;
|
|
||||||
},
|
|
||||||
|
|
||||||
// Loads a given File object via FileReader interface,
|
|
||||||
// invokes the callback with a data url:
|
|
||||||
_loadFile: function (file, callback) {
|
|
||||||
if (typeof FileReader !== 'undefined' &&
|
|
||||||
FileReader.prototype.readAsDataURL) {
|
|
||||||
var fileReader = new FileReader();
|
|
||||||
fileReader.onload = function (e) {
|
|
||||||
callback(e.target.result);
|
|
||||||
};
|
|
||||||
fileReader.readAsDataURL(file);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
|
|
||||||
// Loads an image for a given File object.
|
|
||||||
// Invokes the callback with an img or optional canvas
|
|
||||||
// element (if supported by the browser) as parameter:
|
|
||||||
_loadImage: function (file, callback, options) {
|
|
||||||
var that = this,
|
|
||||||
url,
|
|
||||||
img;
|
|
||||||
if (!options || !options.fileTypes ||
|
|
||||||
options.fileTypes.test(file.type)) {
|
|
||||||
url = this._createObjectURL(file);
|
|
||||||
img = $('<img>').bind('load', function () {
|
|
||||||
$(this).unbind('load');
|
|
||||||
that._revokeObjectURL(url);
|
|
||||||
callback(that._scaleImage(img[0], options));
|
|
||||||
});
|
|
||||||
if (url) {
|
|
||||||
img.prop('src', url);
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return this._loadFile(file, function (url) {
|
|
||||||
img.prop('src', url);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
|
|
||||||
// Link handler, that allows to download files
|
|
||||||
// by drag & drop of the links to the desktop:
|
|
||||||
_enableDragToDesktop: function () {
|
|
||||||
var link = $(this),
|
|
||||||
url = link.prop('href'),
|
|
||||||
name = decodeURIComponent(url.split('/').pop())
|
|
||||||
.replace(/:/g, '-'),
|
|
||||||
type = 'application/octet-stream';
|
|
||||||
link.bind('dragstart', function (e) {
|
|
||||||
try {
|
|
||||||
e.originalEvent.dataTransfer.setData(
|
|
||||||
'DownloadURL',
|
|
||||||
[type, name, url].join(':')
|
|
||||||
);
|
|
||||||
} catch (err) {}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
_adjustMaxNumberOfFiles: function (operand) {
|
|
||||||
if (typeof this.options.maxNumberOfFiles === 'number') {
|
|
||||||
this.options.maxNumberOfFiles += operand;
|
|
||||||
if (this.options.maxNumberOfFiles < 1) {
|
|
||||||
this._disableFileInputButton();
|
|
||||||
} else {
|
|
||||||
this._enableFileInputButton();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_formatFileSize: function (file) {
|
|
||||||
if (typeof file.size !== 'number') {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
if (file.size >= 1000000000) {
|
|
||||||
return (file.size / 1000000000).toFixed(2) + ' GB';
|
|
||||||
}
|
|
||||||
if (file.size >= 1000000) {
|
|
||||||
return (file.size / 1000000).toFixed(2) + ' MB';
|
|
||||||
}
|
|
||||||
return (file.size / 1000).toFixed(2) + ' KB';
|
|
||||||
},
|
|
||||||
|
|
||||||
_hasError: function (file) {
|
|
||||||
if (file.error) {
|
|
||||||
return file.error;
|
|
||||||
}
|
|
||||||
// The number of added files is subtracted from
|
|
||||||
// maxNumberOfFiles before validation, so we check if
|
|
||||||
// maxNumberOfFiles is below 0 (instead of below 1):
|
|
||||||
if (this.options.maxNumberOfFiles < 0) {
|
|
||||||
return 'maxNumberOfFiles';
|
|
||||||
}
|
|
||||||
// Files are accepted if either the file type or the file name
|
|
||||||
// matches against the acceptFileTypes regular expression, as
|
|
||||||
// only browsers with support for the File API report the type:
|
|
||||||
if (!(this.options.acceptFileTypes.test(file.type) ||
|
|
||||||
this.options.acceptFileTypes.test(file.name))) {
|
|
||||||
return 'acceptFileTypes';
|
|
||||||
}
|
|
||||||
if (this.options.maxFileSize &&
|
|
||||||
file.size > this.options.maxFileSize) {
|
|
||||||
return 'maxFileSize';
|
|
||||||
}
|
|
||||||
if (typeof file.size === 'number' &&
|
|
||||||
file.size < this.options.minFileSize) {
|
|
||||||
return 'minFileSize';
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
|
|
||||||
_validate: function (files) {
|
|
||||||
var that = this,
|
|
||||||
valid = !!files.length;
|
|
||||||
$.each(files, function (index, file) {
|
|
||||||
file.error = that._hasError(file);
|
|
||||||
if (file.error) {
|
|
||||||
valid = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return valid;
|
|
||||||
},
|
|
||||||
|
|
||||||
_uploadTemplateHelper: function (file) {
|
|
||||||
file.sizef = this._formatFileSize(file);
|
|
||||||
return file;
|
|
||||||
},
|
|
||||||
|
|
||||||
_renderUploadTemplate: function (files) {
|
|
||||||
var that = this;
|
|
||||||
return $.tmpl(
|
|
||||||
this.options.uploadTemplate,
|
|
||||||
$.map(files, function (file) {
|
|
||||||
return that._uploadTemplateHelper(file);
|
|
||||||
})
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
_renderUpload: function (files) {
|
|
||||||
var that = this,
|
|
||||||
options = this.options,
|
|
||||||
tmpl = this._renderUploadTemplate(files),
|
|
||||||
isValidated = this._validate(files);
|
|
||||||
if (!(tmpl instanceof $)) {
|
|
||||||
return $();
|
|
||||||
}
|
|
||||||
tmpl.css('display', 'none');
|
|
||||||
// .slice(1).remove().end().first() removes all but the first
|
|
||||||
// element and selects only the first for the jQuery collection:
|
|
||||||
tmpl.find('.progress div').slice(
|
|
||||||
isValidated ? 1 : 0
|
|
||||||
).remove().end().first()
|
|
||||||
.progressbar();
|
|
||||||
tmpl.find('.start button').slice(
|
|
||||||
this.options.autoUpload || !isValidated ? 0 : 1
|
|
||||||
).remove().end().first()
|
|
||||||
.button({
|
|
||||||
text: false,
|
|
||||||
icons: {primary: 'ui-icon-circle-arrow-e'}
|
|
||||||
});
|
|
||||||
tmpl.find('.cancel button').slice(1).remove().end().first()
|
|
||||||
.button({
|
|
||||||
text: false,
|
|
||||||
icons: {primary: 'ui-icon-cancel'}
|
|
||||||
});
|
|
||||||
tmpl.find('.preview').each(function (index, node) {
|
|
||||||
that._loadImage(
|
|
||||||
files[index],
|
|
||||||
function (img) {
|
|
||||||
$(img).hide().appendTo(node).fadeIn();
|
|
||||||
},
|
|
||||||
{
|
|
||||||
maxWidth: options.previewMaxWidth,
|
|
||||||
maxHeight: options.previewMaxHeight,
|
|
||||||
fileTypes: options.previewFileTypes,
|
|
||||||
canvas: options.previewAsCanvas
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
return tmpl;
|
|
||||||
},
|
|
||||||
|
|
||||||
_downloadTemplateHelper: function (file) {
|
|
||||||
file.sizef = this._formatFileSize(file);
|
|
||||||
return file;
|
|
||||||
},
|
|
||||||
|
|
||||||
_renderDownloadTemplate: function (files) {
|
|
||||||
var that = this;
|
|
||||||
return $.tmpl(
|
|
||||||
this.options.downloadTemplate,
|
|
||||||
$.map(files, function (file) {
|
|
||||||
return that._downloadTemplateHelper(file);
|
|
||||||
})
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
_renderDownload: function (files) {
|
|
||||||
var tmpl = this._renderDownloadTemplate(files);
|
|
||||||
if (!(tmpl instanceof $)) {
|
|
||||||
return $();
|
|
||||||
}
|
|
||||||
tmpl.css('display', 'none');
|
|
||||||
tmpl.find('.delete button').button({
|
|
||||||
text: false,
|
|
||||||
icons: {primary: 'ui-icon-trash'}
|
|
||||||
});
|
|
||||||
tmpl.find('a').each(this._enableDragToDesktop);
|
|
||||||
return tmpl;
|
|
||||||
},
|
|
||||||
|
|
||||||
_startHandler: function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
var tmpl = $(this).closest('.template-upload'),
|
|
||||||
data = tmpl.data('data');
|
|
||||||
if (data && data.submit && !data.jqXHR) {
|
|
||||||
data.jqXHR = data.submit();
|
|
||||||
if (data.jqXHR) {
|
|
||||||
$(this).fadeOut();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_cancelHandler: function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
var tmpl = $(this).closest('.template-upload'),
|
|
||||||
data = tmpl.data('data') || {};
|
|
||||||
if (!data.jqXHR) {
|
|
||||||
data.errorThrown = 'abort';
|
|
||||||
e.data.fileupload._trigger('fail', e, data);
|
|
||||||
} else {
|
|
||||||
data.jqXHR.abort();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_deleteHandler: function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
var button = $(this);
|
|
||||||
e.data.fileupload._trigger('destroy', e, {
|
|
||||||
context: button.closest('.template-download'),
|
|
||||||
url: button.attr('data-url'),
|
|
||||||
type: button.attr('data-type'),
|
|
||||||
dataType: e.data.fileupload.options.dataType
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
_initEventHandlers: function () {
|
|
||||||
$.blueimp.fileupload.prototype._initEventHandlers.call(this);
|
|
||||||
var eventData = {fileupload: this};
|
|
||||||
this.element.find('.files')
|
|
||||||
.delegate(
|
|
||||||
'.start button',
|
|
||||||
'click.' + this.options.namespace,
|
|
||||||
eventData,
|
|
||||||
this._startHandler
|
|
||||||
)
|
|
||||||
.delegate(
|
|
||||||
'.cancel button',
|
|
||||||
'click.' + this.options.namespace,
|
|
||||||
eventData,
|
|
||||||
this._cancelHandler
|
|
||||||
)
|
|
||||||
.delegate(
|
|
||||||
'.delete button',
|
|
||||||
'click.' + this.options.namespace,
|
|
||||||
eventData,
|
|
||||||
this._deleteHandler
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
_destroyEventHandlers: function () {
|
|
||||||
this.element.find('.files')
|
|
||||||
.undelegate('.start button', 'click.' + this.options.namespace)
|
|
||||||
.undelegate('.cancel button', 'click.' + this.options.namespace)
|
|
||||||
.undelegate('.delete button', 'click.' + this.options.namespace);
|
|
||||||
$.blueimp.fileupload.prototype._destroyEventHandlers.call(this);
|
|
||||||
},
|
|
||||||
|
|
||||||
_initFileUploadButtonBar: function () {
|
|
||||||
var fileUploadButtonBar = this.element.find('.fileupload-buttonbar'),
|
|
||||||
filesList = this.element.find('.files'),
|
|
||||||
ns = this.options.namespace;
|
|
||||||
fileUploadButtonBar
|
|
||||||
.addClass('ui-widget-header ui-corner-top');
|
|
||||||
this.element.find('.fileinput-button').each(function () {
|
|
||||||
var fileInput = $(this).find('input:file').detach();
|
|
||||||
$(this).button({icons: {primary: 'ui-icon-plusthick'}})
|
|
||||||
.append(fileInput);
|
|
||||||
});
|
|
||||||
fileUploadButtonBar.find('.start')
|
|
||||||
.button({icons: {primary: 'ui-icon-circle-arrow-e'}})
|
|
||||||
.bind('click.' + ns, function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
filesList.find('.start button').click();
|
|
||||||
});
|
|
||||||
fileUploadButtonBar.find('.cancel')
|
|
||||||
.button({icons: {primary: 'ui-icon-cancel'}})
|
|
||||||
.bind('click.' + ns, function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
filesList.find('.cancel button').click();
|
|
||||||
});
|
|
||||||
fileUploadButtonBar.find('.delete')
|
|
||||||
.button({icons: {primary: 'ui-icon-trash'}})
|
|
||||||
.bind('click.' + ns, function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
filesList.find('.delete button').click();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
_destroyFileUploadButtonBar: function () {
|
|
||||||
this.element.find('.fileupload-buttonbar')
|
|
||||||
.removeClass('ui-widget-header ui-corner-top');
|
|
||||||
this.element.find('.fileinput-button').each(function () {
|
|
||||||
var fileInput = $(this).find('input:file').detach();
|
|
||||||
$(this).button('destroy')
|
|
||||||
.append(fileInput);
|
|
||||||
});
|
|
||||||
this.element.find('.fileupload-buttonbar button')
|
|
||||||
.unbind('click.' + this.options.namespace)
|
|
||||||
.button('destroy');
|
|
||||||
},
|
|
||||||
|
|
||||||
_enableFileInputButton: function () {
|
|
||||||
this.element.find('.fileinput-button input:file:disabled')
|
|
||||||
.each(function () {
|
|
||||||
var fileInput = $(this),
|
|
||||||
button = fileInput.parent();
|
|
||||||
fileInput.detach().prop('disabled', false);
|
|
||||||
button.button('enable').append(fileInput);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
_disableFileInputButton: function () {
|
|
||||||
this.element.find('.fileinput-button input:file:enabled')
|
|
||||||
.each(function () {
|
|
||||||
var fileInput = $(this),
|
|
||||||
button = fileInput.parent();
|
|
||||||
fileInput.detach().prop('disabled', true);
|
|
||||||
button.button('disable').append(fileInput);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
_initTemplates: function () {
|
|
||||||
// Handle cases where the templates are defined
|
|
||||||
// after the widget library has been included:
|
|
||||||
if (this.options.uploadTemplate instanceof $ &&
|
|
||||||
!this.options.uploadTemplate.length) {
|
|
||||||
this.options.uploadTemplate = $(
|
|
||||||
this.options.uploadTemplate.selector
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (this.options.downloadTemplate instanceof $ &&
|
|
||||||
!this.options.downloadTemplate.length) {
|
|
||||||
this.options.downloadTemplate = $(
|
|
||||||
this.options.downloadTemplate.selector
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_create: function () {
|
|
||||||
$.blueimp.fileupload.prototype._create.call(this);
|
|
||||||
this._initTemplates();
|
|
||||||
this.element
|
|
||||||
.addClass('ui-widget');
|
|
||||||
this._initFileUploadButtonBar();
|
|
||||||
this.element.find('.fileupload-content')
|
|
||||||
.addClass('ui-widget-content ui-corner-bottom');
|
|
||||||
this.element.find('.fileupload-progressbar')
|
|
||||||
.hide().progressbar();
|
|
||||||
},
|
|
||||||
|
|
||||||
destroy: function () {
|
|
||||||
this.element.find('.fileupload-progressbar')
|
|
||||||
.progressbar('destroy');
|
|
||||||
this.element.find('.fileupload-content')
|
|
||||||
.removeClass('ui-widget-content ui-corner-bottom');
|
|
||||||
this._destroyFileUploadButtonBar();
|
|
||||||
this.element.removeClass('ui-widget');
|
|
||||||
$.blueimp.fileupload.prototype.destroy.call(this);
|
|
||||||
},
|
|
||||||
|
|
||||||
enable: function () {
|
|
||||||
$.blueimp.fileupload.prototype.enable.call(this);
|
|
||||||
this.element.find(':ui-button').not('.fileinput-button')
|
|
||||||
.button('enable');
|
|
||||||
this._enableFileInputButton();
|
|
||||||
},
|
|
||||||
|
|
||||||
disable: function () {
|
|
||||||
this.element.find(':ui-button').not('.fileinput-button')
|
|
||||||
.button('disable');
|
|
||||||
this._disableFileInputButton();
|
|
||||||
$.blueimp.fileupload.prototype.disable.call(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
}(jQuery));
|
|
|
@ -1,782 +0,0 @@
|
||||||
/*
|
|
||||||
* jQuery File Upload Plugin 5.4.4
|
|
||||||
* https://github.com/blueimp/jQuery-File-Upload
|
|
||||||
*
|
|
||||||
* Copyright 2010, Sebastian Tschan
|
|
||||||
* https://blueimp.net
|
|
||||||
*
|
|
||||||
* Licensed under the MIT license:
|
|
||||||
* http://creativecommons.org/licenses/MIT/
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*jslint white: true, nomen: true, unparam: true, regexp: true */
|
|
||||||
/*global document, XMLHttpRequestUpload, Blob, File, FormData, location, jQuery */
|
|
||||||
|
|
||||||
(function ($) {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
// The fileupload widget listens for change events on file input fields defined
|
|
||||||
// via fileInput setting and paste or drop events of the given dropZone.
|
|
||||||
// In addition to the default jQuery Widget methods, the fileupload widget
|
|
||||||
// exposes the "add" and "send" methods, to add or directly send files using
|
|
||||||
// the fileupload API.
|
|
||||||
// By default, files added via file input selection, paste, drag & drop or
|
|
||||||
// "add" method are uploaded immediately, but it is possible to override
|
|
||||||
// the "add" callback option to queue file uploads.
|
|
||||||
$.widget('blueimp.fileupload', {
|
|
||||||
|
|
||||||
options: {
|
|
||||||
// The namespace used for event handler binding on the dropZone and
|
|
||||||
// fileInput collections.
|
|
||||||
// If not set, the name of the widget ("fileupload") is used.
|
|
||||||
namespace: undefined,
|
|
||||||
// The drop target collection, by the default the complete document.
|
|
||||||
// Set to null or an empty collection to disable drag & drop support:
|
|
||||||
dropZone: $(document),
|
|
||||||
// The file input field collection, that is listened for change events.
|
|
||||||
// If undefined, it is set to the file input fields inside
|
|
||||||
// of the widget element on plugin initialization.
|
|
||||||
// Set to null or an empty collection to disable the change listener.
|
|
||||||
fileInput: undefined,
|
|
||||||
// By default, the file input field is replaced with a clone after
|
|
||||||
// each input field change event. This is required for iframe transport
|
|
||||||
// queues and allows change events to be fired for the same file
|
|
||||||
// selection, but can be disabled by setting the following option to false:
|
|
||||||
replaceFileInput: true,
|
|
||||||
// The parameter name for the file form data (the request argument name).
|
|
||||||
// If undefined or empty, the name property of the file input field is
|
|
||||||
// used, or "files[]" if the file input name property is also empty:
|
|
||||||
paramName: undefined,
|
|
||||||
// By default, each file of a selection is uploaded using an individual
|
|
||||||
// request for XHR type uploads. Set to false to upload file
|
|
||||||
// selections in one request each:
|
|
||||||
singleFileUploads: true,
|
|
||||||
// To limit the number of files uploaded with one XHR request,
|
|
||||||
// set the following option to an integer greater than 0:
|
|
||||||
limitMultiFileUploads: undefined,
|
|
||||||
// Set the following option to true to issue all file upload requests
|
|
||||||
// in a sequential order:
|
|
||||||
sequentialUploads: false,
|
|
||||||
// To limit the number of concurrent uploads,
|
|
||||||
// set the following option to an integer greater than 0:
|
|
||||||
limitConcurrentUploads: undefined,
|
|
||||||
// Set the following option to true to force iframe transport uploads:
|
|
||||||
forceIframeTransport: false,
|
|
||||||
// By default, XHR file uploads are sent as multipart/form-data.
|
|
||||||
// The iframe transport is always using multipart/form-data.
|
|
||||||
// Set to false to enable non-multipart XHR uploads:
|
|
||||||
multipart: true,
|
|
||||||
// To upload large files in smaller chunks, set the following option
|
|
||||||
// to a preferred maximum chunk size. If set to 0, null or undefined,
|
|
||||||
// or the browser does not support the required Blob API, files will
|
|
||||||
// be uploaded as a whole.
|
|
||||||
maxChunkSize: undefined,
|
|
||||||
// When a non-multipart upload or a chunked multipart upload has been
|
|
||||||
// aborted, this option can be used to resume the upload by setting
|
|
||||||
// it to the size of the already uploaded bytes. This option is most
|
|
||||||
// useful when modifying the options object inside of the "add" or
|
|
||||||
// "send" callbacks, as the options are cloned for each file upload.
|
|
||||||
uploadedBytes: undefined,
|
|
||||||
// By default, failed (abort or error) file uploads are removed from the
|
|
||||||
// global progress calculation. Set the following option to false to
|
|
||||||
// prevent recalculating the global progress data:
|
|
||||||
recalculateProgress: true,
|
|
||||||
|
|
||||||
// Additional form data to be sent along with the file uploads can be set
|
|
||||||
// using this option, which accepts an array of objects with name and
|
|
||||||
// value properties, a function returning such an array, a FormData
|
|
||||||
// object (for XHR file uploads), or a simple object.
|
|
||||||
// The form of the first fileInput is given as parameter to the function:
|
|
||||||
formData: function (form) {
|
|
||||||
return form.serializeArray();
|
|
||||||
},
|
|
||||||
|
|
||||||
// The add callback is invoked as soon as files are added to the fileupload
|
|
||||||
// widget (via file input selection, drag & drop, paste or add API call).
|
|
||||||
// If the singleFileUploads option is enabled, this callback will be
|
|
||||||
// called once for each file in the selection for XHR file uplaods, else
|
|
||||||
// once for each file selection.
|
|
||||||
// The upload starts when the submit method is invoked on the data parameter.
|
|
||||||
// The data object contains a files property holding the added files
|
|
||||||
// and allows to override plugin options as well as define ajax settings.
|
|
||||||
// Listeners for this callback can also be bound the following way:
|
|
||||||
// .bind('fileuploadadd', func);
|
|
||||||
// data.submit() returns a Promise object and allows to attach additional
|
|
||||||
// handlers using jQuery's Deferred callbacks:
|
|
||||||
// data.submit().done(func).fail(func).always(func);
|
|
||||||
add: function (e, data) {
|
|
||||||
data.submit();
|
|
||||||
},
|
|
||||||
|
|
||||||
// Other callbacks:
|
|
||||||
// Callback for the submit event of each file upload:
|
|
||||||
// submit: function (e, data) {}, // .bind('fileuploadsubmit', func);
|
|
||||||
// Callback for the start of each file upload request:
|
|
||||||
// send: function (e, data) {}, // .bind('fileuploadsend', func);
|
|
||||||
// Callback for successful uploads:
|
|
||||||
// done: function (e, data) {}, // .bind('fileuploaddone', func);
|
|
||||||
// Callback for failed (abort or error) uploads:
|
|
||||||
// fail: function (e, data) {}, // .bind('fileuploadfail', func);
|
|
||||||
// Callback for completed (success, abort or error) requests:
|
|
||||||
// always: function (e, data) {}, // .bind('fileuploadalways', func);
|
|
||||||
// Callback for upload progress events:
|
|
||||||
// progress: function (e, data) {}, // .bind('fileuploadprogress', func);
|
|
||||||
// Callback for global upload progress events:
|
|
||||||
// progressall: function (e, data) {}, // .bind('fileuploadprogressall', func);
|
|
||||||
// Callback for uploads start, equivalent to the global ajaxStart event:
|
|
||||||
// start: function (e) {}, // .bind('fileuploadstart', func);
|
|
||||||
// Callback for uploads stop, equivalent to the global ajaxStop event:
|
|
||||||
// stop: function (e) {}, // .bind('fileuploadstop', func);
|
|
||||||
// Callback for change events of the fileInput collection:
|
|
||||||
// change: function (e, data) {}, // .bind('fileuploadchange', func);
|
|
||||||
// Callback for paste events to the dropZone collection:
|
|
||||||
// paste: function (e, data) {}, // .bind('fileuploadpaste', func);
|
|
||||||
// Callback for drop events of the dropZone collection:
|
|
||||||
// drop: function (e, data) {}, // .bind('fileuploaddrop', func);
|
|
||||||
// Callback for dragover events of the dropZone collection:
|
|
||||||
// dragover: function (e) {}, // .bind('fileuploaddragover', func);
|
|
||||||
|
|
||||||
// The plugin options are used as settings object for the ajax calls.
|
|
||||||
// The following are jQuery ajax settings required for the file uploads:
|
|
||||||
processData: false,
|
|
||||||
contentType: false,
|
|
||||||
cache: false
|
|
||||||
},
|
|
||||||
|
|
||||||
// A list of options that require a refresh after assigning a new value:
|
|
||||||
_refreshOptionsList: ['namespace', 'dropZone', 'fileInput'],
|
|
||||||
|
|
||||||
_isXHRUpload: function (options) {
|
|
||||||
var undef = 'undefined';
|
|
||||||
return !options.forceIframeTransport &&
|
|
||||||
typeof XMLHttpRequestUpload !== undef && typeof File !== undef &&
|
|
||||||
(!options.multipart || typeof FormData !== undef);
|
|
||||||
},
|
|
||||||
|
|
||||||
_getFormData: function (options) {
|
|
||||||
var formData;
|
|
||||||
if (typeof options.formData === 'function') {
|
|
||||||
return options.formData(options.form);
|
|
||||||
} else if ($.isArray(options.formData)) {
|
|
||||||
return options.formData;
|
|
||||||
} else if (options.formData) {
|
|
||||||
formData = [];
|
|
||||||
$.each(options.formData, function (name, value) {
|
|
||||||
formData.push({name: name, value: value});
|
|
||||||
});
|
|
||||||
return formData;
|
|
||||||
}
|
|
||||||
return [];
|
|
||||||
},
|
|
||||||
|
|
||||||
_getTotal: function (files) {
|
|
||||||
var total = 0;
|
|
||||||
$.each(files, function (index, file) {
|
|
||||||
total += file.size || 1;
|
|
||||||
});
|
|
||||||
return total;
|
|
||||||
},
|
|
||||||
|
|
||||||
_onProgress: function (e, data) {
|
|
||||||
if (e.lengthComputable) {
|
|
||||||
var total = data.total || this._getTotal(data.files),
|
|
||||||
loaded = parseInt(
|
|
||||||
e.loaded / e.total * (data.chunkSize || total),
|
|
||||||
10
|
|
||||||
) + (data.uploadedBytes || 0);
|
|
||||||
this._loaded += loaded - (data.loaded || data.uploadedBytes || 0);
|
|
||||||
data.lengthComputable = true;
|
|
||||||
data.loaded = loaded;
|
|
||||||
data.total = total;
|
|
||||||
// Trigger a custom progress event with a total data property set
|
|
||||||
// to the file size(s) of the current upload and a loaded data
|
|
||||||
// property calculated accordingly:
|
|
||||||
this._trigger('progress', e, data);
|
|
||||||
// Trigger a global progress event for all current file uploads,
|
|
||||||
// including ajax calls queued for sequential file uploads:
|
|
||||||
this._trigger('progressall', e, {
|
|
||||||
lengthComputable: true,
|
|
||||||
loaded: this._loaded,
|
|
||||||
total: this._total
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_initProgressListener: function (options) {
|
|
||||||
var that = this,
|
|
||||||
xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr();
|
|
||||||
// Accesss to the native XHR object is required to add event listeners
|
|
||||||
// for the upload progress event:
|
|
||||||
if (xhr.upload && xhr.upload.addEventListener) {
|
|
||||||
xhr.upload.addEventListener('progress', function (e) {
|
|
||||||
that._onProgress(e, options);
|
|
||||||
}, false);
|
|
||||||
options.xhr = function () {
|
|
||||||
return xhr;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_initXHRData: function (options) {
|
|
||||||
var formData,
|
|
||||||
file = options.files[0];
|
|
||||||
if (!options.multipart || options.blob) {
|
|
||||||
// For non-multipart uploads and chunked uploads,
|
|
||||||
// file meta data is not part of the request body,
|
|
||||||
// so we transmit this data as part of the HTTP headers.
|
|
||||||
// For cross domain requests, these headers must be allowed
|
|
||||||
// via Access-Control-Allow-Headers or removed using
|
|
||||||
// the beforeSend callback:
|
|
||||||
options.headers = $.extend(options.headers, {
|
|
||||||
'X-File-Name': file.name,
|
|
||||||
'X-File-Type': file.type,
|
|
||||||
'X-File-Size': file.size
|
|
||||||
});
|
|
||||||
if (!options.blob) {
|
|
||||||
// Non-chunked non-multipart upload:
|
|
||||||
options.contentType = file.type;
|
|
||||||
options.data = file;
|
|
||||||
} else if (!options.multipart) {
|
|
||||||
// Chunked non-multipart upload:
|
|
||||||
options.contentType = 'application/octet-stream';
|
|
||||||
options.data = options.blob;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (options.multipart && typeof FormData !== 'undefined') {
|
|
||||||
if (options.formData instanceof FormData) {
|
|
||||||
formData = options.formData;
|
|
||||||
} else {
|
|
||||||
formData = new FormData();
|
|
||||||
$.each(this._getFormData(options), function (index, field) {
|
|
||||||
formData.append(field.name, field.value);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (options.blob) {
|
|
||||||
formData.append(options.paramName, options.blob);
|
|
||||||
} else {
|
|
||||||
$.each(options.files, function (index, file) {
|
|
||||||
// File objects are also Blob instances.
|
|
||||||
// This check allows the tests to run with
|
|
||||||
// dummy objects:
|
|
||||||
if (file instanceof Blob) {
|
|
||||||
formData.append(options.paramName, file);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
options.data = formData;
|
|
||||||
}
|
|
||||||
// Blob reference is not needed anymore, free memory:
|
|
||||||
options.blob = null;
|
|
||||||
},
|
|
||||||
|
|
||||||
_initIframeSettings: function (options) {
|
|
||||||
// Setting the dataType to iframe enables the iframe transport:
|
|
||||||
options.dataType = 'iframe ' + (options.dataType || '');
|
|
||||||
// The iframe transport accepts a serialized array as form data:
|
|
||||||
options.formData = this._getFormData(options);
|
|
||||||
},
|
|
||||||
|
|
||||||
_initDataSettings: function (options) {
|
|
||||||
if (this._isXHRUpload(options)) {
|
|
||||||
if (!this._chunkedUpload(options, true)) {
|
|
||||||
if (!options.data) {
|
|
||||||
this._initXHRData(options);
|
|
||||||
}
|
|
||||||
this._initProgressListener(options);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this._initIframeSettings(options);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_initFormSettings: function (options) {
|
|
||||||
// Retrieve missing options from the input field and the
|
|
||||||
// associated form, if available:
|
|
||||||
if (!options.form || !options.form.length) {
|
|
||||||
options.form = $(options.fileInput.prop('form'));
|
|
||||||
}
|
|
||||||
if (!options.paramName) {
|
|
||||||
options.paramName = options.fileInput.prop('name') ||
|
|
||||||
'files[]';
|
|
||||||
}
|
|
||||||
if (!options.url) {
|
|
||||||
options.url = options.form.prop('action') || location.href;
|
|
||||||
}
|
|
||||||
// The HTTP request method must be "POST" or "PUT":
|
|
||||||
options.type = (options.type || options.form.prop('method') || '')
|
|
||||||
.toUpperCase();
|
|
||||||
if (options.type !== 'POST' && options.type !== 'PUT') {
|
|
||||||
options.type = 'POST';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_getAJAXSettings: function (data) {
|
|
||||||
var options = $.extend({}, this.options, data);
|
|
||||||
this._initFormSettings(options);
|
|
||||||
this._initDataSettings(options);
|
|
||||||
return options;
|
|
||||||
},
|
|
||||||
|
|
||||||
// Maps jqXHR callbacks to the equivalent
|
|
||||||
// methods of the given Promise object:
|
|
||||||
_enhancePromise: function (promise) {
|
|
||||||
promise.success = promise.done;
|
|
||||||
promise.error = promise.fail;
|
|
||||||
promise.complete = promise.always;
|
|
||||||
return promise;
|
|
||||||
},
|
|
||||||
|
|
||||||
// Creates and returns a Promise object enhanced with
|
|
||||||
// the jqXHR methods abort, success, error and complete:
|
|
||||||
_getXHRPromise: function (resolveOrReject, context, args) {
|
|
||||||
var dfd = $.Deferred(),
|
|
||||||
promise = dfd.promise();
|
|
||||||
context = context || this.options.context || promise;
|
|
||||||
if (resolveOrReject === true) {
|
|
||||||
dfd.resolveWith(context, args);
|
|
||||||
} else if (resolveOrReject === false) {
|
|
||||||
dfd.rejectWith(context, args);
|
|
||||||
}
|
|
||||||
promise.abort = dfd.promise;
|
|
||||||
return this._enhancePromise(promise);
|
|
||||||
},
|
|
||||||
|
|
||||||
// Uploads a file in multiple, sequential requests
|
|
||||||
// by splitting the file up in multiple blob chunks.
|
|
||||||
// If the second parameter is true, only tests if the file
|
|
||||||
// should be uploaded in chunks, but does not invoke any
|
|
||||||
// upload requests:
|
|
||||||
_chunkedUpload: function (options, testOnly) {
|
|
||||||
var that = this,
|
|
||||||
file = options.files[0],
|
|
||||||
fs = file.size,
|
|
||||||
ub = options.uploadedBytes = options.uploadedBytes || 0,
|
|
||||||
mcs = options.maxChunkSize || fs,
|
|
||||||
// Use the Blob methods with the slice implementation
|
|
||||||
// according to the W3C Blob API specification:
|
|
||||||
slice = file.webkitSlice || file.mozSlice || file.slice,
|
|
||||||
upload,
|
|
||||||
n,
|
|
||||||
jqXHR,
|
|
||||||
pipe;
|
|
||||||
if (!(this._isXHRUpload(options) && slice && (ub || mcs < fs)) ||
|
|
||||||
options.data) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (testOnly) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (ub >= fs) {
|
|
||||||
file.error = 'uploadedBytes';
|
|
||||||
return this._getXHRPromise(false);
|
|
||||||
}
|
|
||||||
// n is the number of blobs to upload,
|
|
||||||
// calculated via filesize, uploaded bytes and max chunk size:
|
|
||||||
n = Math.ceil((fs - ub) / mcs);
|
|
||||||
// The chunk upload method accepting the chunk number as parameter:
|
|
||||||
upload = function (i) {
|
|
||||||
if (!i) {
|
|
||||||
return that._getXHRPromise(true);
|
|
||||||
}
|
|
||||||
// Upload the blobs in sequential order:
|
|
||||||
return upload(i -= 1).pipe(function () {
|
|
||||||
// Clone the options object for each chunk upload:
|
|
||||||
var o = $.extend({}, options);
|
|
||||||
o.blob = slice.call(
|
|
||||||
file,
|
|
||||||
ub + i * mcs,
|
|
||||||
ub + (i + 1) * mcs
|
|
||||||
);
|
|
||||||
// Store the current chunk size, as the blob itself
|
|
||||||
// will be dereferenced after data processing:
|
|
||||||
o.chunkSize = o.blob.size;
|
|
||||||
// Process the upload data (the blob and potential form data):
|
|
||||||
that._initXHRData(o);
|
|
||||||
// Add progress listeners for this chunk upload:
|
|
||||||
that._initProgressListener(o);
|
|
||||||
jqXHR = ($.ajax(o) || that._getXHRPromise(false, o.context))
|
|
||||||
.done(function () {
|
|
||||||
// Create a progress event if upload is done and
|
|
||||||
// no progress event has been invoked for this chunk:
|
|
||||||
if (!o.loaded) {
|
|
||||||
that._onProgress($.Event('progress', {
|
|
||||||
lengthComputable: true,
|
|
||||||
loaded: o.chunkSize,
|
|
||||||
total: o.chunkSize
|
|
||||||
}), o);
|
|
||||||
}
|
|
||||||
options.uploadedBytes = o.uploadedBytes +=
|
|
||||||
o.chunkSize;
|
|
||||||
});
|
|
||||||
return jqXHR;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
// Return the piped Promise object, enhanced with an abort method,
|
|
||||||
// which is delegated to the jqXHR object of the current upload,
|
|
||||||
// and jqXHR callbacks mapped to the equivalent Promise methods:
|
|
||||||
pipe = upload(n);
|
|
||||||
pipe.abort = function () {
|
|
||||||
return jqXHR.abort();
|
|
||||||
};
|
|
||||||
return this._enhancePromise(pipe);
|
|
||||||
},
|
|
||||||
|
|
||||||
_beforeSend: function (e, data) {
|
|
||||||
if (this._active === 0) {
|
|
||||||
// the start callback is triggered when an upload starts
|
|
||||||
// and no other uploads are currently running,
|
|
||||||
// equivalent to the global ajaxStart event:
|
|
||||||
this._trigger('start');
|
|
||||||
}
|
|
||||||
this._active += 1;
|
|
||||||
// Initialize the global progress values:
|
|
||||||
this._loaded += data.uploadedBytes || 0;
|
|
||||||
this._total += this._getTotal(data.files);
|
|
||||||
},
|
|
||||||
|
|
||||||
_onDone: function (result, textStatus, jqXHR, options) {
|
|
||||||
if (!this._isXHRUpload(options)) {
|
|
||||||
// Create a progress event for each iframe load:
|
|
||||||
this._onProgress($.Event('progress', {
|
|
||||||
lengthComputable: true,
|
|
||||||
loaded: 1,
|
|
||||||
total: 1
|
|
||||||
}), options);
|
|
||||||
}
|
|
||||||
options.result = result;
|
|
||||||
options.textStatus = textStatus;
|
|
||||||
options.jqXHR = jqXHR;
|
|
||||||
this._trigger('done', null, options);
|
|
||||||
},
|
|
||||||
|
|
||||||
_onFail: function (jqXHR, textStatus, errorThrown, options) {
|
|
||||||
options.jqXHR = jqXHR;
|
|
||||||
options.textStatus = textStatus;
|
|
||||||
options.errorThrown = errorThrown;
|
|
||||||
this._trigger('fail', null, options);
|
|
||||||
if (options.recalculateProgress) {
|
|
||||||
// Remove the failed (error or abort) file upload from
|
|
||||||
// the global progress calculation:
|
|
||||||
this._loaded -= options.loaded || options.uploadedBytes || 0;
|
|
||||||
this._total -= options.total || this._getTotal(options.files);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_onAlways: function (jqXHR, textStatus, options) {
|
|
||||||
this._active -= 1;
|
|
||||||
options.jqXHR = jqXHR;
|
|
||||||
options.textStatus = textStatus;
|
|
||||||
this._trigger('always', null, options);
|
|
||||||
if (this._active === 0) {
|
|
||||||
// The stop callback is triggered when all uploads have
|
|
||||||
// been completed, equivalent to the global ajaxStop event:
|
|
||||||
this._trigger('stop');
|
|
||||||
// Reset the global progress values:
|
|
||||||
this._loaded = this._total = 0;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_onSend: function (e, data) {
|
|
||||||
var that = this,
|
|
||||||
jqXHR,
|
|
||||||
slot,
|
|
||||||
pipe,
|
|
||||||
options = that._getAJAXSettings(data),
|
|
||||||
send = function (resolve, args) {
|
|
||||||
that._sending += 1;
|
|
||||||
jqXHR = jqXHR || (
|
|
||||||
(resolve !== false &&
|
|
||||||
that._trigger('send', e, options) !== false &&
|
|
||||||
(that._chunkedUpload(options) || $.ajax(options))) ||
|
|
||||||
that._getXHRPromise(false, options.context, args)
|
|
||||||
).done(function (result, textStatus, jqXHR) {
|
|
||||||
that._onDone(result, textStatus, jqXHR, options);
|
|
||||||
}).fail(function (jqXHR, textStatus, errorThrown) {
|
|
||||||
that._onFail(jqXHR, textStatus, errorThrown, options);
|
|
||||||
}).complete(function (jqXHR, textStatus) {
|
|
||||||
// jqXHR.complete() will be deprecated in jQuery 1.8,
|
|
||||||
// but is preferable over jqXHR.always() due to this bug:
|
|
||||||
// http://bugs.jquery.com/ticket/10723 (jQuery 1.7)
|
|
||||||
that._sending -= 1;
|
|
||||||
that._onAlways(jqXHR, textStatus, options);
|
|
||||||
if (options.limitConcurrentUploads &&
|
|
||||||
options.limitConcurrentUploads > that._sending) {
|
|
||||||
// Start the next queued upload,
|
|
||||||
// that has not been aborted:
|
|
||||||
var nextSlot = that._slots.shift();
|
|
||||||
while (nextSlot) {
|
|
||||||
if (!nextSlot.isRejected()) {
|
|
||||||
nextSlot.resolve();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
nextSlot = that._slots.shift();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return jqXHR;
|
|
||||||
};
|
|
||||||
this._beforeSend(e, options);
|
|
||||||
if (this.options.sequentialUploads ||
|
|
||||||
(this.options.limitConcurrentUploads &&
|
|
||||||
this.options.limitConcurrentUploads <= this._sending)) {
|
|
||||||
if (this.options.limitConcurrentUploads > 1) {
|
|
||||||
slot = $.Deferred();
|
|
||||||
this._slots.push(slot);
|
|
||||||
pipe = slot.pipe(send);
|
|
||||||
} else {
|
|
||||||
pipe = (this._sequence = this._sequence.pipe(send, send));
|
|
||||||
}
|
|
||||||
// Return the piped Promise object, enhanced with an abort method,
|
|
||||||
// which is delegated to the jqXHR object of the current upload,
|
|
||||||
// and jqXHR callbacks mapped to the equivalent Promise methods:
|
|
||||||
pipe.abort = function () {
|
|
||||||
var args = [undefined, 'abort', 'abort'];
|
|
||||||
if (!jqXHR) {
|
|
||||||
if (slot) {
|
|
||||||
slot.rejectWith(args);
|
|
||||||
}
|
|
||||||
return send(false, args);
|
|
||||||
}
|
|
||||||
return jqXHR.abort();
|
|
||||||
};
|
|
||||||
return this._enhancePromise(pipe);
|
|
||||||
}
|
|
||||||
return send();
|
|
||||||
},
|
|
||||||
|
|
||||||
_onAdd: function (e, data) {
|
|
||||||
var that = this,
|
|
||||||
result = true,
|
|
||||||
options = $.extend({}, this.options, data),
|
|
||||||
limit = options.limitMultiFileUploads,
|
|
||||||
fileSet,
|
|
||||||
i;
|
|
||||||
if (!(options.singleFileUploads || limit) ||
|
|
||||||
!this._isXHRUpload(options)) {
|
|
||||||
fileSet = [data.files];
|
|
||||||
} else if (!options.singleFileUploads && limit) {
|
|
||||||
fileSet = [];
|
|
||||||
for (i = 0; i < data.files.length; i += limit) {
|
|
||||||
fileSet.push(data.files.slice(i, i + limit));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
data.originalFiles = data.files;
|
|
||||||
$.each(fileSet || data.files, function (index, element) {
|
|
||||||
var files = fileSet ? element : [element],
|
|
||||||
newData = $.extend({}, data, {files: files});
|
|
||||||
newData.submit = function () {
|
|
||||||
return (that._trigger('submit', e, newData) !== false) &&
|
|
||||||
that._onSend(e, newData);
|
|
||||||
};
|
|
||||||
return (result = that._trigger('add', e, newData));
|
|
||||||
});
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
|
|
||||||
// File Normalization for Gecko 1.9.1 (Firefox 3.5) support:
|
|
||||||
_normalizeFile: function (index, file) {
|
|
||||||
if (file.name === undefined && file.size === undefined) {
|
|
||||||
file.name = file.fileName;
|
|
||||||
file.size = file.fileSize;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_replaceFileInput: function (input) {
|
|
||||||
var inputClone = input.clone(true);
|
|
||||||
$('<form></form>').append(inputClone)[0].reset();
|
|
||||||
// Detaching allows to insert the fileInput on another form
|
|
||||||
// without loosing the file input value:
|
|
||||||
input.after(inputClone).detach();
|
|
||||||
// Avoid memory leaks with the detached file input:
|
|
||||||
$.cleanData(input.unbind('remove'));
|
|
||||||
// Replace the original file input element in the fileInput
|
|
||||||
// collection with the clone, which has been copied including
|
|
||||||
// event handlers:
|
|
||||||
this.options.fileInput = this.options.fileInput.map(function (i, el) {
|
|
||||||
if (el === input[0]) {
|
|
||||||
return inputClone[0];
|
|
||||||
}
|
|
||||||
return el;
|
|
||||||
});
|
|
||||||
// If the widget has been initialized on the file input itself,
|
|
||||||
// override this.element with the file input clone:
|
|
||||||
if (input[0] === this.element[0]) {
|
|
||||||
this.element = inputClone;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_onChange: function (e) {
|
|
||||||
var that = e.data.fileupload,
|
|
||||||
data = {
|
|
||||||
files: $.each($.makeArray(e.target.files), that._normalizeFile),
|
|
||||||
fileInput: $(e.target),
|
|
||||||
form: $(e.target.form)
|
|
||||||
};
|
|
||||||
if (!data.files.length) {
|
|
||||||
// If the files property is not available, the browser does not
|
|
||||||
// support the File API and we add a pseudo File object with
|
|
||||||
// the input value as name with path information removed:
|
|
||||||
data.files = [{name: e.target.value.replace(/^.*\\/, '')}];
|
|
||||||
}
|
|
||||||
if (that.options.replaceFileInput) {
|
|
||||||
that._replaceFileInput(data.fileInput);
|
|
||||||
}
|
|
||||||
if (that._trigger('change', e, data) === false ||
|
|
||||||
that._onAdd(e, data) === false) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_onPaste: function (e) {
|
|
||||||
var that = e.data.fileupload,
|
|
||||||
cbd = e.originalEvent.clipboardData,
|
|
||||||
items = (cbd && cbd.items) || [],
|
|
||||||
data = {files: []};
|
|
||||||
$.each(items, function (index, item) {
|
|
||||||
var file = item.getAsFile && item.getAsFile();
|
|
||||||
if (file) {
|
|
||||||
data.files.push(file);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (that._trigger('paste', e, data) === false ||
|
|
||||||
that._onAdd(e, data) === false) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_onDrop: function (e) {
|
|
||||||
var that = e.data.fileupload,
|
|
||||||
dataTransfer = e.dataTransfer = e.originalEvent.dataTransfer,
|
|
||||||
data = {
|
|
||||||
files: $.each(
|
|
||||||
$.makeArray(dataTransfer && dataTransfer.files),
|
|
||||||
that._normalizeFile
|
|
||||||
)
|
|
||||||
};
|
|
||||||
if (that._trigger('drop', e, data) === false ||
|
|
||||||
that._onAdd(e, data) === false) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
e.preventDefault();
|
|
||||||
},
|
|
||||||
|
|
||||||
_onDragOver: function (e) {
|
|
||||||
var that = e.data.fileupload,
|
|
||||||
dataTransfer = e.dataTransfer = e.originalEvent.dataTransfer;
|
|
||||||
if (that._trigger('dragover', e) === false) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (dataTransfer) {
|
|
||||||
dataTransfer.dropEffect = dataTransfer.effectAllowed = 'copy';
|
|
||||||
}
|
|
||||||
e.preventDefault();
|
|
||||||
},
|
|
||||||
|
|
||||||
_initEventHandlers: function () {
|
|
||||||
var ns = this.options.namespace || this.widgetName;
|
|
||||||
this.options.dropZone
|
|
||||||
.bind('dragover.' + ns, {fileupload: this}, this._onDragOver)
|
|
||||||
.bind('drop.' + ns, {fileupload: this}, this._onDrop)
|
|
||||||
.bind('paste.' + ns, {fileupload: this}, this._onPaste);
|
|
||||||
this.options.fileInput
|
|
||||||
.bind('change.' + ns, {fileupload: this}, this._onChange);
|
|
||||||
},
|
|
||||||
|
|
||||||
_destroyEventHandlers: function () {
|
|
||||||
var ns = this.options.namespace || this.widgetName;
|
|
||||||
this.options.dropZone
|
|
||||||
.unbind('dragover.' + ns, this._onDragOver)
|
|
||||||
.unbind('drop.' + ns, this._onDrop)
|
|
||||||
.unbind('paste.' + ns, this._onPaste);
|
|
||||||
this.options.fileInput
|
|
||||||
.unbind('change.' + ns, this._onChange);
|
|
||||||
},
|
|
||||||
|
|
||||||
_beforeSetOption: function (key, value) {
|
|
||||||
this._destroyEventHandlers();
|
|
||||||
},
|
|
||||||
|
|
||||||
_afterSetOption: function (key, value) {
|
|
||||||
var options = this.options;
|
|
||||||
if (!options.fileInput) {
|
|
||||||
options.fileInput = $();
|
|
||||||
}
|
|
||||||
if (!options.dropZone) {
|
|
||||||
options.dropZone = $();
|
|
||||||
}
|
|
||||||
this._initEventHandlers();
|
|
||||||
},
|
|
||||||
|
|
||||||
_setOption: function (key, value) {
|
|
||||||
var refresh = $.inArray(key, this._refreshOptionsList) !== -1;
|
|
||||||
if (refresh) {
|
|
||||||
this._beforeSetOption(key, value);
|
|
||||||
}
|
|
||||||
$.Widget.prototype._setOption.call(this, key, value);
|
|
||||||
if (refresh) {
|
|
||||||
this._afterSetOption(key, value);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_create: function () {
|
|
||||||
var options = this.options;
|
|
||||||
if (options.fileInput === undefined) {
|
|
||||||
options.fileInput = this.element.is('input:file') ?
|
|
||||||
this.element : this.element.find('input:file');
|
|
||||||
} else if (!options.fileInput) {
|
|
||||||
options.fileInput = $();
|
|
||||||
}
|
|
||||||
if (!options.dropZone) {
|
|
||||||
options.dropZone = $();
|
|
||||||
}
|
|
||||||
this._slots = [];
|
|
||||||
this._sequence = this._getXHRPromise(true);
|
|
||||||
this._sending = this._active = this._loaded = this._total = 0;
|
|
||||||
this._initEventHandlers();
|
|
||||||
},
|
|
||||||
|
|
||||||
destroy: function () {
|
|
||||||
this._destroyEventHandlers();
|
|
||||||
$.Widget.prototype.destroy.call(this);
|
|
||||||
},
|
|
||||||
|
|
||||||
enable: function () {
|
|
||||||
$.Widget.prototype.enable.call(this);
|
|
||||||
this._initEventHandlers();
|
|
||||||
},
|
|
||||||
|
|
||||||
disable: function () {
|
|
||||||
this._destroyEventHandlers();
|
|
||||||
$.Widget.prototype.disable.call(this);
|
|
||||||
},
|
|
||||||
|
|
||||||
// This method is exposed to the widget API and allows adding files
|
|
||||||
// using the fileupload API. The data parameter accepts an object which
|
|
||||||
// must have a files property and can contain additional options:
|
|
||||||
// .fileupload('add', {files: filesList});
|
|
||||||
add: function (data) {
|
|
||||||
if (!data || this.options.disabled) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
data.files = $.each($.makeArray(data.files), this._normalizeFile);
|
|
||||||
this._onAdd(null, data);
|
|
||||||
},
|
|
||||||
|
|
||||||
// This method is exposed to the widget API and allows sending files
|
|
||||||
// using the fileupload API. The data parameter accepts an object which
|
|
||||||
// must have a files property and can contain additional options:
|
|
||||||
// .fileupload('send', {files: filesList});
|
|
||||||
// The method returns a Promise object for the file upload call.
|
|
||||||
send: function (data) {
|
|
||||||
if (data && !this.options.disabled) {
|
|
||||||
data.files = $.each($.makeArray(data.files), this._normalizeFile);
|
|
||||||
if (data.files.length) {
|
|
||||||
return this._onSend(null, data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return this._getXHRPromise(false, data && data.context);
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
}(jQuery));
|
|
10
vendor/built_in_modules/gallery/app/assets/javascripts/jquery.masonry.min.js
vendored
Normal file
10
vendor/built_in_modules/gallery/app/assets/javascripts/jquery.masonry.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
147
vendor/built_in_modules/gallery/app/assets/javascripts/jquery.mu.image.resize.js
vendored
Normal file
147
vendor/built_in_modules/gallery/app/assets/javascripts/jquery.mu.image.resize.js
vendored
Normal file
|
@ -0,0 +1,147 @@
|
||||||
|
(function( $ ) {
|
||||||
|
$.fn.muImageResize = function( params ) {
|
||||||
|
var _defaultSettings = {
|
||||||
|
width:300,
|
||||||
|
height:300,
|
||||||
|
wrap_fix:true // Let image display like in-line.
|
||||||
|
};
|
||||||
|
var _set = $.extend(_defaultSettings, params);
|
||||||
|
// var isIE7 = $.browser.msie && (7 == ~~ $.browser.version);
|
||||||
|
|
||||||
|
//var anyDynamicSource = $(this).attr("src");
|
||||||
|
//$(this).attr("src",anyDynamicSource+ "?" + new Date().getTime());
|
||||||
|
|
||||||
|
// Just bind load event once per element.
|
||||||
|
return this.one('load', function() {
|
||||||
|
// Remove all attributes and CSS rules.
|
||||||
|
this.removeAttribute( "width" );
|
||||||
|
this.removeAttribute( "height" );
|
||||||
|
this.style.width = this.style.height = "";
|
||||||
|
|
||||||
|
var ow, oh;
|
||||||
|
|
||||||
|
//[workaround] - msie need get width early
|
||||||
|
if (/MSIE/g.test($ua))
|
||||||
|
{
|
||||||
|
// Get original size for calcutation.
|
||||||
|
ow = this.width;
|
||||||
|
oh = this.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_set.wrap_fix) {
|
||||||
|
$(this).wrap(function(){
|
||||||
|
return '<div style="width:'+_set.width+'px; height:'+_set.height+'px; display:inline-block;" />';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!/MSIE/g.test($ua))
|
||||||
|
{
|
||||||
|
// Get original size for calcutation.
|
||||||
|
ow = this.width;
|
||||||
|
oh = this.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if cannot get width or height.
|
||||||
|
if (0==ow || 0==oh){
|
||||||
|
$(this).width(_set.width);
|
||||||
|
$(this).height(_set.height);
|
||||||
|
}else{
|
||||||
|
|
||||||
|
// Merge position settings
|
||||||
|
var sh_margin_type='';
|
||||||
|
|
||||||
|
// if original image's width > height.
|
||||||
|
if (ow > oh) {
|
||||||
|
p = oh / _set.height;
|
||||||
|
oh = _set.height;
|
||||||
|
ow = ow / p;
|
||||||
|
|
||||||
|
// original image width smaller than settings.
|
||||||
|
if (ow < _set.width){
|
||||||
|
// need to resize again,
|
||||||
|
// because new image size range must can cover settings' range, than we can crop it correctly.
|
||||||
|
p = ow / _set.width;
|
||||||
|
ow = _set.width;
|
||||||
|
oh = oh / p;
|
||||||
|
|
||||||
|
// the crop range would be in the center of new image size.
|
||||||
|
sh = (oh-_set.height)/2;
|
||||||
|
t=sh+'px';
|
||||||
|
r=_set.width+'px';
|
||||||
|
b=(_set.height+sh)+'px';
|
||||||
|
l='0px';
|
||||||
|
|
||||||
|
// need to be adjust top position latter.
|
||||||
|
sh_margin_type = 'margin-top';
|
||||||
|
|
||||||
|
// original image width bigger than settings.
|
||||||
|
}else{
|
||||||
|
// new image range can cover settings' range.
|
||||||
|
sh = (ow-_set.width)/2;
|
||||||
|
t='0px';
|
||||||
|
r=(_set.width+sh)+'px';
|
||||||
|
b=_set.height+'px';
|
||||||
|
l=sh+'px';
|
||||||
|
// need to be adjust left position latter.
|
||||||
|
sh_margin_type = 'margin-left';
|
||||||
|
}
|
||||||
|
// ref above, change width to height then do same things.
|
||||||
|
}else{
|
||||||
|
p = ow / _set.width;
|
||||||
|
ow = _set.width;
|
||||||
|
oh = oh / p;
|
||||||
|
|
||||||
|
if (oh < _set.height) {
|
||||||
|
p = oh / _set.height;
|
||||||
|
oh = _set.height;
|
||||||
|
ow = ow / p;
|
||||||
|
|
||||||
|
sh = (ow-_set.width)/2;
|
||||||
|
t='0px';
|
||||||
|
r=(_set.width+sh)+'px';
|
||||||
|
b=_set.height+'px';
|
||||||
|
l=sh+'px';
|
||||||
|
sh_margin_type = 'margin-left';
|
||||||
|
}else{
|
||||||
|
sh = (oh-_set.height)/2;
|
||||||
|
t=sh+'px';
|
||||||
|
r=_set.width+'px';
|
||||||
|
b=(_set.height+sh)+'px';
|
||||||
|
l='0px';
|
||||||
|
sh_margin_type = 'margin-top';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Resize img.
|
||||||
|
$(this).width(ow);
|
||||||
|
$(this).height(oh);
|
||||||
|
|
||||||
|
// Crop img by set clip style.
|
||||||
|
$(this).css('clip','rect('+t+' '+r+' '+b+' '+l+')');
|
||||||
|
|
||||||
|
var osh = 0;
|
||||||
|
if('auto' != $(this).css(sh_margin_type)){
|
||||||
|
osh = parseInt($(this).css(sh_margin_type));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (0 < sh) {sh*=-1;}
|
||||||
|
sh += osh;
|
||||||
|
|
||||||
|
$(this).css(sh_margin_type, sh+'px');
|
||||||
|
// $(this).css('position','absolute');
|
||||||
|
}
|
||||||
|
$(this).fadeIn('slow');
|
||||||
|
})
|
||||||
|
.one( "error", function() {
|
||||||
|
//$(this).hide();
|
||||||
|
})
|
||||||
|
.each(function() {
|
||||||
|
$(this).hide();
|
||||||
|
// Trigger load event (for Gecko and MSIE)
|
||||||
|
if ( this.complete || /MSIE/g.test($ua) ) {
|
||||||
|
$( this ).trigger( "load" ).trigger( "error" );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
})( jQuery );
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,586 @@
|
||||||
|
//Created by Harry Bomrah on Sep 21 2011
|
||||||
|
$rss = jQuery.noConflict();
|
||||||
|
var rcom={
|
||||||
|
//Pass dom and will return binded dom with starting year till current
|
||||||
|
insertDatePanel : function(dom,year){
|
||||||
|
if(!year)year=1901;
|
||||||
|
if(dom=="")return false;
|
||||||
|
domid=dom.attr("id");
|
||||||
|
var dt = new Date();
|
||||||
|
current_year=dt.getFullYear();
|
||||||
|
var dthtml="Year: <select name='"+domid+"_year'>";
|
||||||
|
for(i=current_year;i>=year;i--){
|
||||||
|
dthtml+="<option value='"+i+"'>"+i+"</option>";
|
||||||
|
}
|
||||||
|
dthtml+="</select> Date: <select name='"+domid+"_date'>";
|
||||||
|
for(i=1;i<=31;i++){
|
||||||
|
if(i<10)
|
||||||
|
dthtml+="<option value='0"+i+"'>"+i+"</option>";
|
||||||
|
else
|
||||||
|
dthtml+="<option value='"+i+"'>"+i+"</option>";
|
||||||
|
}
|
||||||
|
dthtml+="</select> Month: <select name='"+domid+"_month'>";
|
||||||
|
var months= Array("","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
|
||||||
|
for(i=1;i<12;i++){
|
||||||
|
if(i<10)
|
||||||
|
dthtml+="<option value='0"+i+"'>"+months[i]+"</option>";
|
||||||
|
else
|
||||||
|
dthtml+="<option value='"+i+"'>"+months[i]+"</option>";
|
||||||
|
}
|
||||||
|
dthtml+="</select>";
|
||||||
|
dom.html(dthtml);
|
||||||
|
},
|
||||||
|
|
||||||
|
//loading overlay around a dom...
|
||||||
|
loadingWrapper : function(dom, display){
|
||||||
|
if(display){
|
||||||
|
dom.prepend("<div id='loading_wrapper' class='loading'></div>");
|
||||||
|
$rss("#loading_wrapper").height(dom.height());
|
||||||
|
$rss("#loading_wrapper").width(dom.width());
|
||||||
|
}else{
|
||||||
|
domId=dom.attr("id");
|
||||||
|
$rss("#"+domId+" #loading_wrapper").remove();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//validating a dom....
|
||||||
|
validate : function(dom, validation, errormsg){
|
||||||
|
var domValue = dom.val();
|
||||||
|
var error = false;
|
||||||
|
var regex="";
|
||||||
|
var msg = "";
|
||||||
|
switch(validation){
|
||||||
|
case "required":
|
||||||
|
if(domValue=="")error=true;
|
||||||
|
msg="Cannot be empty.";
|
||||||
|
break;
|
||||||
|
case "email":
|
||||||
|
regex=/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
|
||||||
|
msg="Invalid Email Address.";
|
||||||
|
break;
|
||||||
|
case "number":
|
||||||
|
regex=/^\d*[0-9](|.\d*[0-9]|,\d*[0-9])?$/;
|
||||||
|
msg = "Only numbers are accepted.";
|
||||||
|
break;
|
||||||
|
case "alphanumeric":
|
||||||
|
regex=/^\s*[a-zA-Z0-9,\s]+\s*$/;
|
||||||
|
msg="Only numbers, alphabets and spaces are allowed.";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
domId=dom.attr("name");
|
||||||
|
if(errormsg=="")errormsg=msg;
|
||||||
|
if(regex!="")if(!regex.test(domValue))error=true;
|
||||||
|
if(error){$rss("#"+domId+"_error").remove();dom.after("<span id='"+domId+"_error' class='error'>"+errormsg+"</span>");return false;} else{ $rss("#"+domId+"_error").remove();return true;}
|
||||||
|
},
|
||||||
|
|
||||||
|
bindToSpinner : function(dom,data,callbackFn){
|
||||||
|
var domId = dom.attr("id");
|
||||||
|
var dhtml="";
|
||||||
|
var spinnerValue=Array();
|
||||||
|
var spinnerDisplay=Array();
|
||||||
|
$rss.each(data,function(i,it){
|
||||||
|
$rss.each(data[i],function(key,it){
|
||||||
|
spinnerValue.push(it);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
dhtml="<select name='"+domId+"'>";
|
||||||
|
for(i=0,y=1,z=0;i<spinnerValue.length/2;i++,y+=2,z+=2){
|
||||||
|
dhtml+="<option value='"+spinnerValue[z]+"'>"+spinnerValue[y]+"</option>";
|
||||||
|
}
|
||||||
|
dhtml+="</select>";
|
||||||
|
dom.html(dhtml);
|
||||||
|
if(typeof callbackFn=="function")
|
||||||
|
callbackFn.call(this, dhtml);
|
||||||
|
},
|
||||||
|
|
||||||
|
//binds the recieved json to a table
|
||||||
|
bindToTable : function(dom,data,headers,actions,css_class,callbackFn){
|
||||||
|
if(!css_class)css_class="";
|
||||||
|
var dhtml="<table width='100%' cellpadding='5' cellspacing='5' class='"+css_class+"' ><thead><tr>";
|
||||||
|
var domId = dom.attr("id");
|
||||||
|
if(actions){
|
||||||
|
var btnTitles=Array();
|
||||||
|
var btnFunctions=Array();
|
||||||
|
$rss.each(actions,function(title,func){
|
||||||
|
btnTitles.push(title);
|
||||||
|
btnFunctions.push(func);
|
||||||
|
});
|
||||||
|
rcom.translate(btnTitles,function(convertedData){
|
||||||
|
btnTitles=convertedData.slice();
|
||||||
|
|
||||||
|
rcom.translate(headers,function(convertedData){
|
||||||
|
headers=convertedData;
|
||||||
|
if(!data)return;
|
||||||
|
$rss.each(headers,function(i,head){
|
||||||
|
dhtml+="<th>"+head+"</th>";
|
||||||
|
});
|
||||||
|
dhtml+="</thead></tr>";
|
||||||
|
if(data.length==0)dhtml+="<tr><td colspan='"+headers.length+"' align='center'>No Data</td></tr>";
|
||||||
|
$rss.each(data,function(i,item){
|
||||||
|
var cl="";
|
||||||
|
if(i%2!=0)cl="even";
|
||||||
|
dhtml+="<tr id='"+domId+"_"+item.id+"' class='"+cl+"'>";
|
||||||
|
$rss.each(item,function(i,it){
|
||||||
|
if(i!="id"){
|
||||||
|
if(it==null)it="Not Set";
|
||||||
|
dhtml+="<td align='center'>"+it+"</td>";
|
||||||
|
}
|
||||||
|
})
|
||||||
|
dhtml+="<td align='center'>";
|
||||||
|
for(x=0;x<btnTitles.length;x++){
|
||||||
|
dhtml+="<button onclick='"+btnFunctions[x]+"("+item.id+")'>"+btnTitles[x]+"</button>";
|
||||||
|
}
|
||||||
|
dhtml+="</td>";
|
||||||
|
dhtml+="</tr>";
|
||||||
|
});
|
||||||
|
dhtml+="</table>";
|
||||||
|
dom.html(dhtml);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
rcom.translate(headers,function(convertedData){
|
||||||
|
headers=convertedData;
|
||||||
|
if(!data)return;
|
||||||
|
if(headers.length>0){
|
||||||
|
$rss.each(headers,function(i,head){
|
||||||
|
dhtml+="<th>"+head+"</th>";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
dhtml+="</thead></tr>";
|
||||||
|
if(data.length==0)dhtml+="<tr><td colspan='"+headers.length+"' align='center'>No Data</td></tr>";
|
||||||
|
|
||||||
|
$rss.each(data,function(i,item){
|
||||||
|
var cl="";
|
||||||
|
if(i%2!=0)cl="even";
|
||||||
|
dhtml+="<tr id='"+domId+"_"+item.id+"' class='"+cl+"'>";
|
||||||
|
$rss.each(item,function(i,it){
|
||||||
|
if(i!="id"){
|
||||||
|
if(it==null)it="Not Set";
|
||||||
|
dhtml+="<td align='center'>"+it+"</td>";
|
||||||
|
}
|
||||||
|
})
|
||||||
|
dhtml+="</tr>";
|
||||||
|
});
|
||||||
|
dhtml+="</table>";
|
||||||
|
dom.html(dhtml);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if(typeof callbackFn=="function")
|
||||||
|
callbackFn.call(this, dhtml);
|
||||||
|
},
|
||||||
|
//convert to date string which can be directly inserted in database or according to any format.
|
||||||
|
convertToInsertableDate : function(y,m,d,format){
|
||||||
|
var dt="";
|
||||||
|
if(m<10)m="0"+m;
|
||||||
|
if(d<10)d="0"+d;
|
||||||
|
switch(format){
|
||||||
|
case "yyyy-mm-dd":
|
||||||
|
dt= y+"-"+m+"-"+d;
|
||||||
|
break;
|
||||||
|
case "dd-mm-yyyy":
|
||||||
|
dt= d+"-"+m+"-"+y;
|
||||||
|
break;
|
||||||
|
case "mm-dd-yyyy":
|
||||||
|
dt= m+"-"+d+"-"+y;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
dt= y+"-"+m+"-"+d;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return dt;
|
||||||
|
},
|
||||||
|
//a fucntion to show specific divs and hide all other
|
||||||
|
showDoms : function(doms){
|
||||||
|
$rss("body").find("div").each(function(){$rss(this).hide();});
|
||||||
|
$rss.each(doms,function(i,dom){
|
||||||
|
dom.show();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//a function to translate the word or array..
|
||||||
|
translate : function(data,callbackFn){
|
||||||
|
var cdata="";
|
||||||
|
var status =true;
|
||||||
|
if(!data){
|
||||||
|
if(typeof callbackFn=="function")
|
||||||
|
callbackFn.call(this,cdata);
|
||||||
|
status=false;
|
||||||
|
}
|
||||||
|
if(data==""){
|
||||||
|
if(typeof callbackFn=="function")
|
||||||
|
callbackFn.call(this,cdata);
|
||||||
|
status=false;
|
||||||
|
}
|
||||||
|
if(status){
|
||||||
|
$rss.getJSON("../../classes/translate.php", {fn:"translateThis",tData:data},function(convertedData){
|
||||||
|
if(typeof callbackFn=="function")
|
||||||
|
callbackFn.call(this, convertedData);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// a function to bind JSON to list
|
||||||
|
bindToList : function(dom,data,callbackFn){
|
||||||
|
var domId = dom.attr("id");
|
||||||
|
var dhtml="";
|
||||||
|
var listValue=Array();
|
||||||
|
var listDisplay=Array();
|
||||||
|
$rss.each(data,function(i,it){
|
||||||
|
$rss.each(data[i],function(key,it){
|
||||||
|
listValue.push(it);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
dhtml="<ul id='"+domId+"_list'>";
|
||||||
|
for(i=0,y=1,z=0;i<listValue.length/2;i++,y+=2,z+=2){
|
||||||
|
dhtml+="<li id='li_"+listValue[z]+"'>"+listValue[y]+"</li>";
|
||||||
|
}
|
||||||
|
dhtml+="</ul>";
|
||||||
|
dom.html(dhtml);
|
||||||
|
if(typeof callbackFn=="function")
|
||||||
|
callbackFn.call(this,dhtml);
|
||||||
|
},
|
||||||
|
makeDraggable : function(handler,dom){
|
||||||
|
handler.css("position","absolute");
|
||||||
|
dom.css("position","absolute");
|
||||||
|
var puranix=0;
|
||||||
|
var nayeex=0;
|
||||||
|
var puraniy=0;
|
||||||
|
var nayeey=0;
|
||||||
|
var offset="";
|
||||||
|
var zIndex=dom.css("z-index");
|
||||||
|
handler.mousedown(function(e){
|
||||||
|
puranix=e.clientX;
|
||||||
|
puraniy=e.clientY;
|
||||||
|
offset=dom.offset();
|
||||||
|
$rss(this).mousemove(function(e){
|
||||||
|
nayeex=e.clientX-puranix;
|
||||||
|
nayeex+=offset.left;
|
||||||
|
nayeey=e.clientY-puraniy;
|
||||||
|
nayeey+=offset.top;
|
||||||
|
dom.css({"left":nayeex+"px","top":nayeey+"px","z-index":"9999"});
|
||||||
|
})
|
||||||
|
}).mouseup(function(){
|
||||||
|
$rss(this).unbind("mousemove");
|
||||||
|
dom.css("z-index",zIndex);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//automatically scrolls to the bottom of the div
|
||||||
|
scrollToBottom : function(dom){
|
||||||
|
var domId = dom.attr("id");
|
||||||
|
// var domScrollHeight = document.getElementById(domId).scrollHeight;
|
||||||
|
var obj = document.getElementById(domId);
|
||||||
|
|
||||||
|
if((obj.scrollTop+100) >= (obj.scrollHeight - obj.offsetHeight))
|
||||||
|
dom.scrollTop(obj.scrollHeight);
|
||||||
|
},
|
||||||
|
|
||||||
|
/*ajax loading of images... needs following settings
|
||||||
|
dom:in which images ve to be loaded
|
||||||
|
url:the server url for making ajax calls
|
||||||
|
limit:how many images to load
|
||||||
|
divClass:the class of div surrounding each image
|
||||||
|
nameClass:class for span showing name
|
||||||
|
fn:function to be called in on the server
|
||||||
|
imageSrc:the image source of all the images.
|
||||||
|
bindTo:to bind images to a onclick function or else will be binded to normal a tag.
|
||||||
|
urlKey:to specify the key of the value.. if bindTo is used, this will be neglected..
|
||||||
|
returns json;
|
||||||
|
*/
|
||||||
|
loadImages : function(settings,callbackFn){
|
||||||
|
|
||||||
|
var dom = settings.dom;
|
||||||
|
var domid= dom.attr("id");
|
||||||
|
var temp_array=Array();
|
||||||
|
var starting = $rss("#"+domid+" img:last").attr("id");
|
||||||
|
if(typeof starting != 'undefined'){
|
||||||
|
starting = starting.substr(4,starting.length-1);
|
||||||
|
}else{starting = 0};
|
||||||
|
var temp_var="";
|
||||||
|
var json = "";
|
||||||
|
var dhtml="";
|
||||||
|
var extraparam="";
|
||||||
|
if(typeof settings.extraParam != "undefined"){
|
||||||
|
extraparam = settings.extraParam;
|
||||||
|
}
|
||||||
|
$rss.getJSON(settings.url,{fn:settings.fn,id:settings.whereId,limit:settings.limit,start:starting,extra:extraparam},function(images){
|
||||||
|
json = eval(images);
|
||||||
|
$rss.each(images,function(i,pic){
|
||||||
|
var temp_array=Array();
|
||||||
|
var a_var=Array();
|
||||||
|
var name_var="";
|
||||||
|
var title="";
|
||||||
|
$rss.each(pic,function(i,value){
|
||||||
|
temp_array.push(value);
|
||||||
|
})
|
||||||
|
if(temp_array.length>=4){
|
||||||
|
name_var="<span class='"+settings.nameClass+"'>"+temp_array[3]+"</span></div>"
|
||||||
|
}
|
||||||
|
if(temp_array[2]==null)
|
||||||
|
title = "";
|
||||||
|
else
|
||||||
|
title = temp_array[2];
|
||||||
|
if(typeof settings.bindTo!="undefined"){
|
||||||
|
a_var[1]="onclick='"+settings.bindTo+"("+temp_array[0]+");return false;'";
|
||||||
|
a_var[0]="";
|
||||||
|
}else{a_var[0]='?'+settings.urlKey+'='+temp_array[0];a_var[1]="";}
|
||||||
|
dhtml="<div class='"+settings.divClass+"' id='img_holder_"+temp_array[0]+"' ><a href='"+a_var[0]+"' "+a_var[1]+" title='"+title+"'><img id='pic_"+temp_array[0]+"' style='display:none' src='"+settings.imageSrc+temp_array[1]+"' /></a>"+name_var;
|
||||||
|
dom.delay(100).append(dhtml);
|
||||||
|
$rss("#pic_"+pic.id).delay(100).fadeIn(200);
|
||||||
|
|
||||||
|
})
|
||||||
|
if(typeof callbackFn=="function")
|
||||||
|
callbackFn.call(this,json);
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
//function to get url variables...
|
||||||
|
getUrlVars : function(){
|
||||||
|
var vars = [], hash;
|
||||||
|
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
||||||
|
for(var i = 0; i < hashes.length; i++){
|
||||||
|
hash = hashes[i].split('=');
|
||||||
|
vars.push(hash[0]);
|
||||||
|
vars[hash[0]] = hash[1];
|
||||||
|
}
|
||||||
|
if(vars[0] == window.location.href){
|
||||||
|
vars =[];
|
||||||
|
}
|
||||||
|
return vars;
|
||||||
|
},
|
||||||
|
/*function to open a modalwindow on a page.. self reliant no images, no css needed.
|
||||||
|
settings
|
||||||
|
|
||||||
|
width:in percentage or pixcel
|
||||||
|
height:in percentage or pixcel
|
||||||
|
closeBtn:true or false
|
||||||
|
envClose:closing through background click, true or flase
|
||||||
|
loadDiv:load html from a div
|
||||||
|
loadPage:load a page
|
||||||
|
loadHtml: load html
|
||||||
|
|
||||||
|
*/
|
||||||
|
modalWindow : function(settings,callbackFn){
|
||||||
|
|
||||||
|
var envClose = settings.envClose;
|
||||||
|
var dhtml="";
|
||||||
|
if(typeof envClose == "undefined")
|
||||||
|
envClose = true;
|
||||||
|
var closeBtn = settings.closeBtn;
|
||||||
|
if(typeof closeBtn == "undefined")
|
||||||
|
closeBtn = true;
|
||||||
|
|
||||||
|
var rgmaskHeight = $rss(window).height();
|
||||||
|
var rgmaskWidth = $rss(window).width();
|
||||||
|
var tempheight = settings.height;
|
||||||
|
var tempwidth = settings.width;
|
||||||
|
|
||||||
|
var maxheight = (rgmaskHeight*85)/100;
|
||||||
|
var maxwidth = (rgmaskWidth*85)/100;
|
||||||
|
|
||||||
|
if(typeof tempheight!="undefined"){
|
||||||
|
tempheight = tempheight.toString();
|
||||||
|
if(tempheight.charAt(tempheight.length-1)=='%')
|
||||||
|
tempheight=(rgmaskHeight*parseInt(tempheight.substr(0,tempheight.length)))/100;
|
||||||
|
if(tempheight>maxheight)
|
||||||
|
tempheight=maxheight;
|
||||||
|
}else{tempheight="auto";}
|
||||||
|
if(typeof tempwidth!="undefined"){
|
||||||
|
tempwidth = tempwidth.toString();
|
||||||
|
if(tempwidth.charAt(tempwidth.length-1)=='%')
|
||||||
|
tempwidth=(rgmaskWidth*parseInt(tempwidth.substr(0,tempwidth.length)))/100;
|
||||||
|
if(tempwidth>maxwidth)
|
||||||
|
tempwidth=maxwidth;
|
||||||
|
}else{tempwidth="auto";}
|
||||||
|
$rss("body").append('<div class="rgmask" id="rgsheath" style="height:'+rgmaskHeight+'px"></div>');
|
||||||
|
$rss("#rgsheath").css({background: "#000", width: "100%", position: "fixed", top: 0, left: 0,opacity:0.5,'z-index':199});
|
||||||
|
$rss("body").append('<div id="rgWindow"></div>');
|
||||||
|
$rss("#rgWindow").css({"position": "fixed", "z-index": "999", "background": "#fff", "border": "solid 1px #ccc", "padding": "10px", "border-radius": "5px", "-webkit-border-radius": "5px", "-moz-border-radius": "5px", "-ms-border-radius": "5px", "box-shadow": "0 0 20px rgba(0,0,0,0.7)","-webkit-box-shadow": "0 0 20px rgba(0,0,0,0.7)","-moz-box-shadow": "0 0 20px rgba(0,0,0,0.7)","-ms-box-shadow": "0 0 20px rgba(0,0,0,0.7)"});
|
||||||
|
var rgWTop = (rgmaskHeight-20)/2;
|
||||||
|
var rgWLeft = (rgmaskWidth-20)/2;
|
||||||
|
$rss("#rgWindow").css({top:rgWTop+"px", left:rgWLeft+"px"});
|
||||||
|
if(typeof settings.loadDiv!="undefined"){
|
||||||
|
dhtml = $rss(settings.loadDiv).html();
|
||||||
|
$rss("#rgWindow").html(dhtml).hide();
|
||||||
|
prepareWindow();
|
||||||
|
}
|
||||||
|
if(typeof settings.loadHtml!="undefined"){
|
||||||
|
dhtml = settings.loadHtml;
|
||||||
|
$rss("#rgWindow").html(dhtml).hide();
|
||||||
|
prepareWindow();
|
||||||
|
}
|
||||||
|
if(typeof settings.loadPage!="undefined"){
|
||||||
|
$rss("#rgWindow").load(settings.loadPage,function(){$rss(this).hide();dhtml=$rss(this).html();prepareWindow();});
|
||||||
|
}
|
||||||
|
function prepareWindow(){
|
||||||
|
if(tempheight!="auto")
|
||||||
|
rgWTop = (rgmaskHeight-tempheight)/2;
|
||||||
|
else{
|
||||||
|
tempheight=$rss("#rgWindow").height()+30;
|
||||||
|
if(tempheight>maxheight)
|
||||||
|
tempheight=maxheight;
|
||||||
|
rgWTop=(rgmaskHeight-tempheight)/2;
|
||||||
|
}
|
||||||
|
if(tempwidth!="auto")
|
||||||
|
rgWLeft = (rgmaskWidth-tempwidth)/2;
|
||||||
|
else{
|
||||||
|
tempwidth=$rss("#rgWindow").width();
|
||||||
|
if(tempwidth>maxwidth)
|
||||||
|
tempwidth=maxwidth;
|
||||||
|
rgWLeft=(rgmaskWidth-tempwidth)/2;
|
||||||
|
}
|
||||||
|
tempwidth=parseInt(tempwidth)+25;
|
||||||
|
$rss("#rgWindow").empty().show();
|
||||||
|
var closebtn = "";
|
||||||
|
if(closeBtn)
|
||||||
|
closebtn='<a href="" style="display:block; width:20px; height:20px; line-height:19px; text-align:center; position:absolute; right:-10px; top: -10px; font-family:Tahoma; font-weight:bold; border:solid 1px #000; border-radius: 10px;text-shadow:0px 1px 0 #DDD; background-color:#CCC; font-size:10px; text-decoration:none; color:#666; padding-left:1px; box-shadow: 0 0 5px #000000;" id="close_modal">X</a>';
|
||||||
|
$rss("#rgWindow").animate({"width":tempwidth+"px","height":tempheight+"px",top:rgWTop+"px", left:rgWLeft+"px"},500,function(){$rss("#rgWindow").html(closebtn+"<div id='rgContent' style='padding:5px; overflow:auto; overflow-x:none; height:"+tempheight+"px;'>"+dhtml+"</div>");
|
||||||
|
$rss("#close_modal").mouseover(function(){$rss(this).css("color","#999");}).mouseout(function(){$rss(this).css("color","#666");})
|
||||||
|
$rss("#close_modal").click(function(){rcom.modalWindowClose(); return false;})
|
||||||
|
if(envClose)
|
||||||
|
$rss("#rgsheath").click(function(){
|
||||||
|
rcom.modalWindowClose();
|
||||||
|
})
|
||||||
|
$rss(document).one("keydown",function(e){
|
||||||
|
if (e.keyCode == 27){
|
||||||
|
rcom.modalWindowClose();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if(typeof callbackFn=="function")
|
||||||
|
callbackFn.call(this,$rss("#rgWindow"));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
modalWindowUpdate : function(settings,callbackFn){
|
||||||
|
var rgmaskHeight = $rss(window).height();
|
||||||
|
var rgmaskWidth = $rss(window).width();
|
||||||
|
var tempheight = settings.height;
|
||||||
|
var tempwidth = settings.width;
|
||||||
|
var dhtml = "";
|
||||||
|
var maxheight = (rgmaskHeight*85)/100;
|
||||||
|
var maxwidth = (rgmaskWidth*85)/100;
|
||||||
|
if(typeof tempheight!="undefined"){
|
||||||
|
tempheight = tempheight.toString();
|
||||||
|
if(tempheight.charAt(tempheight.length-1)=='%')
|
||||||
|
tempheight=(rgmaskHeight*parseInt(tempheight.substr(0,tempheight.length)))/100;
|
||||||
|
if(tempheight>maxheight)
|
||||||
|
tempheight=maxheight;
|
||||||
|
}else{tempheight="auto";}
|
||||||
|
if(typeof tempwidth!="undefined"){
|
||||||
|
tempwidth = tempwidth.toString();
|
||||||
|
if(tempwidth.charAt(tempwidth.length-1)=='%')
|
||||||
|
tempwidth=(rgmaskWidth*parseInt(tempwidth.substr(0,tempwidth.length)))/100;
|
||||||
|
if(tempwidth>maxwidth)
|
||||||
|
tempwidth=maxwidth;
|
||||||
|
}else{tempwidth="auto";};
|
||||||
|
$rss("body").append("<div id='rgwindow_temp_div'></div>");
|
||||||
|
|
||||||
|
if(typeof settings.loadDiv!="undefined"){
|
||||||
|
dhtml = $rss("#"+settings.loadDiv).html();
|
||||||
|
$rss("#rgwindow_temp_div").html(dhtml).hide();
|
||||||
|
prepareWindow();
|
||||||
|
}
|
||||||
|
if(typeof settings.loadHtml!="undefined"){
|
||||||
|
dhtml = settings.loadHtml;
|
||||||
|
$rss("#rgwindow_temp_div").html(dhtml).hide();
|
||||||
|
prepareWindow();
|
||||||
|
}
|
||||||
|
if(typeof settings.loadPage!="undefined"){
|
||||||
|
$rss("#rgwindow_temp_div").load(settings.loadPage,function(){$rss(this).hide();dhtml=$rss(this).html();prepareWindow();});
|
||||||
|
}
|
||||||
|
function prepareWindow(){
|
||||||
|
if(tempheight!="auto")
|
||||||
|
rgWTop = (rgmaskHeight-tempheight)/2;
|
||||||
|
else{
|
||||||
|
tempheight=$rss("#rgwindow_temp_div").height()+30;
|
||||||
|
if(tempheight>maxheight)
|
||||||
|
tempheight=maxheight;
|
||||||
|
rgWTop=(rgmaskHeight-tempheight)/2;
|
||||||
|
}
|
||||||
|
if(tempwidth!="auto")
|
||||||
|
rgWLeft = (rgmaskWidth-tempwidth)/2;
|
||||||
|
else{
|
||||||
|
tempwidth=$rss("#rgwindow_temp_div").width();
|
||||||
|
if(tempwidth>maxwidth)
|
||||||
|
tempwidth=maxwidth;
|
||||||
|
rgWLeft=(rgmaskWidth-tempwidth)/2;
|
||||||
|
}
|
||||||
|
tempwidth=parseInt(tempwidth)+25;
|
||||||
|
$rss("#rgContent").empty();
|
||||||
|
$rss("#rgWindow").animate({"width":tempwidth+"px","height":tempheight+"px",top:rgWTop+"px", left:rgWLeft+"px"},500,function(){$rss("#rgContent").css("height",tempheight+"px").html(dhtml)});
|
||||||
|
$rss("#rgwindow_temp_div").remove();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
modalWindowClose : function(callbackFn){
|
||||||
|
if($rss("#rgWindow").length>0){
|
||||||
|
$rss("#rgWindow").empty();
|
||||||
|
var rgmaskHeight = $rss(window).height();
|
||||||
|
var rgmaskWidth = $rss(window).width();
|
||||||
|
var x = (rgmaskHeight-20)/2;
|
||||||
|
var y = (rgmaskWidth-20)/2
|
||||||
|
$rss("#rgWindow").animate({top:x+"px", left:y+"px","width":"50px","height":"50px"},300,function(){$rss(this).fadeOut(100).remove();$rss("#rgsheath").fadeOut(500).remove();})
|
||||||
|
}
|
||||||
|
if(typeof callbackFn=="function")
|
||||||
|
callbackFn.call(this,"harry");
|
||||||
|
},
|
||||||
|
bindDomToHead : function(dom){
|
||||||
|
var gc = dom.css("background");
|
||||||
|
var t = dom.offset();
|
||||||
|
var gw = dom.width();
|
||||||
|
$rss(window).scroll(function(){
|
||||||
|
var wt = $rss(window).scrollTop();
|
||||||
|
if ( wt > t.top ) {
|
||||||
|
var cssObj = {
|
||||||
|
'position':'fixed',
|
||||||
|
'top':0,
|
||||||
|
'width':gw,
|
||||||
|
'background':gc,
|
||||||
|
'box-shadow':'0 1px 0 rgba(0,0,0,0.2)',
|
||||||
|
'z-index':99
|
||||||
|
}
|
||||||
|
dom.css(cssObj);
|
||||||
|
} else {
|
||||||
|
dom.attr('style',"");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
progressBar : function(dom,settings){
|
||||||
|
var domid = dom.prop("id");
|
||||||
|
if($rss("#rss_progressbar_div_"+domid).length==0){
|
||||||
|
if(typeof settings.top == "undefined")
|
||||||
|
settings.value = 1;
|
||||||
|
if(typeof settings.top == "undefined")
|
||||||
|
settings.top = (dom.height()-12)/2;
|
||||||
|
dom.append("<div id='rss_progressbar_div_"+domid+"' style='display:none;padding: 2px;background: #333;background: -webkit-linear-gradient(#111, #333);background: -moz-linear-gradient(#111, #333);background: -ms-linear-gradient(#111, #333);position: absolute;top: "+settings.top+"px;left: 50%;margin-left: -45%;width: 84%;box-shadow: inset 0 0 2px #000;border-radius: 4px;'><div id='rss_progressbar_"+domid+"' style='height: 8px; background: #36c;background: -webkit-linear-gradient(#7A98E7, #36c);background: -moz-linear-gradient(#7A98E7, #36c);background: -ms-linear-gradient(#7A98E7, #36c);border-radius: 2px; width: "+settings.value+"%;'></div></div>");
|
||||||
|
$rss("#rss_progressbar_div_"+domid).fadeIn(500);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
progressBarValue : function(dom,value){
|
||||||
|
var domid = dom.prop("id");
|
||||||
|
if($rss("#rss_progressbar_div_"+domid).length==1){
|
||||||
|
$rss("#rss_progressbar_"+domid).animate({"width":value+"%"},100);
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
progressBarClose : function(dom){
|
||||||
|
var domid = dom.prop("id");
|
||||||
|
$rss("#rss_progressbar_div_"+domid).fadeOut(500,function(){$(this).remove();});
|
||||||
|
},
|
||||||
|
getInternetExplorerVersion: function(){
|
||||||
|
var rv = -1; // Return value assumes failure.
|
||||||
|
if (navigator.appName == 'Microsoft Internet Explorer')
|
||||||
|
{
|
||||||
|
var ua = navigator.userAgent;
|
||||||
|
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
|
||||||
|
if (re.exec(ua) != null)
|
||||||
|
rv = parseFloat( RegExp.$1 );
|
||||||
|
}
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$ = jQuery.noConflict();
|
|
@ -0,0 +1,84 @@
|
||||||
|
/* Filter */
|
||||||
|
#filter.open {
|
||||||
|
border-bottom: none;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
#filter .filter-nav {
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
#filter.open .filter-nav {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
#filter .filter-nav a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
#filter .filter-nav .accordion-group {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
#filter .filter-nav .accordion-group.active {
|
||||||
|
background-color: #08c;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
#filter .filter-nav .accordion-group.active a {
|
||||||
|
color: #FFF;
|
||||||
|
}
|
||||||
|
#filter .filter-nav .accordion-group.active:after {
|
||||||
|
display: block;
|
||||||
|
height: 0px;
|
||||||
|
width: 0px;
|
||||||
|
position: absolute;
|
||||||
|
bottom: -12px;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -5px;
|
||||||
|
content: "";
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 0 6px 6px 6px;
|
||||||
|
border-color: transparent transparent #e5e5e5 transparent;
|
||||||
|
z-index: 5
|
||||||
|
}
|
||||||
|
#filter .filter-group {
|
||||||
|
clear: both;
|
||||||
|
border: none;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
-webkit-border-radius: 4px;
|
||||||
|
-moz-border-radius: 4px;
|
||||||
|
-o-border-radius: 4px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
#filter .filter-group .accordion-body {
|
||||||
|
background-color: #e5e5e5;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
#filter .filter-group .accordion-body .filter-clear {
|
||||||
|
padding: 4px;
|
||||||
|
border-top: 1px solid #D5D5D5;
|
||||||
|
text-align: right;
|
||||||
|
-webkit-box-shadow: inset 0px 1px 0px #ECECEC;
|
||||||
|
-moz-box-shadow: inset 0px 1px 0px #ECECEC;
|
||||||
|
-o-box-shadow: inset 0px 1px 0px #ECECEC;
|
||||||
|
box-shadow: inset 0px 1px 0px #ECECEC;
|
||||||
|
}
|
||||||
|
#filter .filter-group .accordion-body .filter-clear a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
#filter .filter-group .collapse.in {
|
||||||
|
}
|
||||||
|
#filter .filter-group .accordion-inner {
|
||||||
|
padding: 8px 8px 5px;
|
||||||
|
/*margin-top: 10px;*/
|
||||||
|
}
|
||||||
|
#filter .filter-group .accordion-inner > .btn {
|
||||||
|
margin-bottom: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Responsive */
|
||||||
|
@media (max-width: 480px) {
|
||||||
|
/* Filter */
|
||||||
|
#filter .filter-nav {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
#filter .accordion-inner.pagination-right {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}
|
904
vendor/built_in_modules/gallery/app/assets/stylesheets/gallery.css
vendored
Executable file → Normal file
904
vendor/built_in_modules/gallery/app/assets/stylesheets/gallery.css
vendored
Executable file → Normal file
|
@ -1,557 +1,379 @@
|
||||||
.rg, .rgp {
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
-webkit-transition: all 0.3s ease;
|
|
||||||
-moz-transition: all 0.3s ease;
|
|
||||||
}
|
|
||||||
.rg input, .rgp input, .rg textarea, .rgp textarea {
|
|
||||||
resize: none;
|
|
||||||
margin: 0;
|
|
||||||
display: block;
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.rgp textarea { overflow: auto; }
|
|
||||||
.rg a, .rgp a {
|
|
||||||
text-decoration: none;
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
.rg a:hover { }
|
|
||||||
|
|
||||||
/*.rg img { display: block; border: none;}*/
|
|
||||||
|
|
||||||
.rgmask { background: #000; width: 100%; position: fixed; top: 0; left: 0; }
|
|
||||||
|
|
||||||
.rgui {
|
|
||||||
display: inline-block;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.rghead, .rgbody { overflow: hidden; }
|
|
||||||
.rghead {
|
|
||||||
border-bottom: solid 1px #ccc;
|
|
||||||
padding: 10px 0;
|
|
||||||
background: #fff;
|
|
||||||
}
|
|
||||||
.rgtitle {
|
|
||||||
color: #333;
|
|
||||||
text-shadow: 0 1px 0 #ddd;
|
|
||||||
font-size: 2em;
|
|
||||||
padding: 0 8px;
|
|
||||||
}
|
|
||||||
.rgbody {
|
|
||||||
|
|
||||||
}
|
|
||||||
.rgfn { overflow: hidden; padding: 4px 10px; }
|
|
||||||
.rgalbum, .rgphoto { float: left; margin: 0 10px 24px 0; }
|
|
||||||
.rgalbum {
|
|
||||||
padding: 16px;
|
|
||||||
margin: 0 8px 8px 0;
|
|
||||||
border: solid 1px #ccc;
|
|
||||||
width: 300px;
|
|
||||||
height: 120px;
|
|
||||||
border-radius: 4px;
|
|
||||||
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
-webkit-transition: all 0.3s ease;
|
|
||||||
-moz-transition: all 0.3s ease;
|
|
||||||
}
|
|
||||||
.rgalbum > a {
|
|
||||||
display: block;
|
|
||||||
float: left;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
.rgalbum:hover {
|
|
||||||
box-shadow: 0 0 6px rgba(0,0,0,0.2);
|
|
||||||
}
|
|
||||||
.rgalbum img {
|
|
||||||
transition: all, 0.5s ease;
|
|
||||||
-webkit-transition: all, 0.5s ease;
|
|
||||||
-moz-transition: all 0.5s ease;
|
|
||||||
-ms-transition: all, 0.5s ease;
|
|
||||||
}
|
|
||||||
.rgphoto { }
|
|
||||||
.rgphoto a {
|
|
||||||
display: block;
|
|
||||||
padding: 4px;
|
|
||||||
border: solid 1px #ddd;
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 4px;
|
|
||||||
transition: all, 0.3s ease;
|
|
||||||
-webkit-transition: all, 0.3s ease;
|
|
||||||
-moz-transition: all, 0.3s ease;
|
|
||||||
}
|
|
||||||
.rgphoto a:hover {
|
|
||||||
border-color: #999;
|
|
||||||
box-shadow: 0 3px 6px rgba(0,0,0,0.2);
|
|
||||||
}
|
|
||||||
.rgphoto img, .rgphoto_edit img {
|
|
||||||
/*display: block;*/
|
|
||||||
border-radius: 3px;
|
|
||||||
transition: all, 0.3s ease;
|
|
||||||
-webkit-transition: all, 0.3s ease;
|
|
||||||
-moz-transition: all, 0.3s ease;
|
|
||||||
}
|
|
||||||
.rgalbum .albumname {
|
|
||||||
font-size: 18px;
|
|
||||||
padding: 6px 0;
|
|
||||||
display: block;
|
|
||||||
transition: background 0.3s ease;
|
|
||||||
-webkit-transition: background 0.3s ease;
|
|
||||||
-moz-transition: background 0.3s ease;
|
|
||||||
-ms-transition: background 0.3s ease;
|
|
||||||
}
|
|
||||||
.rgalbum a:hover img {
|
|
||||||
opacity: 0.85;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rgp .rgtitle { margin: 0 0 10px 0; }
|
|
||||||
|
|
||||||
/* Photo Edit */
|
|
||||||
.albumname_edit label, .albumname_edit .rginput, .rgphoto_edit > a, .rgphoto_edit .rginput { float: left; }
|
|
||||||
.rgphoto_edit, .albumname_edit {
|
|
||||||
clear: both;
|
|
||||||
overflow: hidden;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
.albumname_edit label {
|
|
||||||
width: 150px;
|
|
||||||
margin: 0 10px 0 0;
|
|
||||||
text-align: right;
|
|
||||||
padding: 0;
|
|
||||||
line-height: 24px;
|
|
||||||
}
|
|
||||||
.albumname_edit .rginput { }
|
|
||||||
.rgphoto_edit img { margin: 0 10px 10px 0; }
|
|
||||||
.rgphoto_edit .rginput { margin-right: 10px; }
|
|
||||||
.rgphoto_edit .edit_fn { float: left; margin-bottom: 10px; }
|
|
||||||
.rgphoto_edit .edit_fn .bt-dels { }
|
|
||||||
|
|
||||||
/* Delete List */
|
|
||||||
.rglist { overflow: hidden; padding: 10px 0; }
|
|
||||||
.list { table-layout:fixed; width: 100%; margin: 0 0 12px 0; }
|
|
||||||
.list thead th { padding: 8px 4px; font-size: 30px; font-weight: bold; }
|
|
||||||
.list th img { width: 60px; height: 45px; }
|
|
||||||
.list .photoname { padding-left: 6px; }
|
|
||||||
.list .photofn { padding-right: 4px; }
|
|
||||||
.list .photofn a { float: right; margin-left: 4px; display: block; }
|
|
||||||
.list th { padding: 4px 0 4px 4px; }
|
|
||||||
.list tbody th, .list tbody td { border-bottom: solid 1px #ccc; }
|
|
||||||
.list .odd th, .list .odd td { background: #f6f6f6; }
|
|
||||||
.list .c1 { width: 64px; }
|
|
||||||
.list .c3 { width: 40px; }
|
|
||||||
|
|
||||||
/* Ruling Slide */
|
|
||||||
.rslide {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
background: #222;
|
|
||||||
clear: both;
|
|
||||||
/*z-index: 99;*/
|
|
||||||
min-height: 250px;
|
|
||||||
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
-webkit-transition: all 0.3s ease;
|
|
||||||
-moz-transition: all 0.3s ease;
|
|
||||||
}
|
|
||||||
.rslide.fullscreen { position: fixed; z-index: 99; }
|
|
||||||
.rslideinside {
|
|
||||||
/*
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
.comp {
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
-webkit-transition: all 0.3s ease;
|
|
||||||
-moz-transition: all 0.3s ease;
|
|
||||||
}
|
|
||||||
.comp img{ display: block; width: auto; height: auto; margin: 0 auto; cursor: pointer; min-height: 250px; }
|
|
||||||
.comp .full{ width: auto; height: auto; max-width: 100%; max-height: 100%; }
|
|
||||||
.rslidenav {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
margin-top: -35px;
|
|
||||||
}
|
|
||||||
.rslidenav a {
|
|
||||||
position: absolute;
|
|
||||||
display: block;
|
|
||||||
width: 30px;
|
|
||||||
height: 40px;
|
|
||||||
overflow: hidden;
|
|
||||||
text-indent: -999px;
|
|
||||||
background: #000 0 center url(../../../assets/gallery/slidenav.png) no-repeat;
|
|
||||||
background: rgba(0,0,0,0.9) 0 0 url(../../../assets/gallery/slidenav.png) no-repeat;
|
|
||||||
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
-webkit-transition: all 0.3s ease;
|
|
||||||
-moz-transition: all 0.3s ease;
|
|
||||||
-ms-transition: all 0.3s ease;
|
|
||||||
}
|
|
||||||
.rslidenav a:hover {
|
|
||||||
background-color: #fff;
|
|
||||||
background-color: rgba(255,255,255,0.9);
|
|
||||||
}
|
|
||||||
.rslidenav .navP { left: 0; border-radius: 0 4px 4px 0; background-position: 0 -40px; }
|
|
||||||
.rslidenav .navN { right: 0; border-radius: 4px 0 0 4px; background-position: -30px 0; }
|
|
||||||
.rslidenav a.navP:hover { background-position: -30px -40px; }
|
|
||||||
.rslidenav a.navN:hover { background-position: 0 0; }
|
|
||||||
.slidectrl {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 30px;
|
|
||||||
background: #000 left top url(../../../assets/gallery/slidetitlebg.png) repeat-x;
|
|
||||||
background: rgba(0,0,0,0.9) left top url(../../../assets/gallery/slidetitlebg.png) repeat-x;
|
|
||||||
/*z-index: 999;*/
|
|
||||||
}
|
|
||||||
.slidectrl a {
|
|
||||||
display: block;
|
|
||||||
float: right;
|
|
||||||
text-indent: -9999px;
|
|
||||||
overflow: hidden;
|
|
||||||
width: 30px;
|
|
||||||
height: 30px;
|
|
||||||
background: transparent 0 0 url(../../../assets/gallery/slideui.gif) no-repeat;
|
|
||||||
border-left: solid 1px #222;
|
|
||||||
}
|
|
||||||
.slidectrl a.togglelist { background-position: 0 -30px; }
|
|
||||||
.slidectrl a.togglescreen { background-position: 0 -90px; }
|
|
||||||
.slidectrl a.toinline { background-position: -30px 0; }
|
|
||||||
.slidectrl a.sharebt { background-position: -30px -30px; }
|
|
||||||
.slidectrl a.browserfullscreen { display:none;}
|
|
||||||
.slidectrl a.slidestop { background-position: 0 -60px; }
|
|
||||||
.fullscreen .slidectrl a.togglescreen { background-position: -30px -90px; }
|
|
||||||
.browserFullScreen .slidectrl a.browserfullscreen { background-position: -30px 0; }
|
|
||||||
.browserFullScreen .togglescreen { display: none; }
|
|
||||||
.slideinfo {
|
|
||||||
height: 30px;
|
|
||||||
line-height: 30px;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 13px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.slideinfo .info { padding: 0 0 0 6px; text-transform: uppercase; }
|
|
||||||
.slideinfo span.info { color: #ccc; text-transform: none; }
|
|
||||||
|
|
||||||
.slidelist {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 30px;
|
|
||||||
z-index: 99;
|
|
||||||
width: 100%;
|
|
||||||
height: 0;
|
|
||||||
overflow: auto;
|
|
||||||
overflow-x: hidden;
|
|
||||||
background: transparent 0 0 url(../../../assets/gallery/slidelistbg.png);
|
|
||||||
}
|
|
||||||
.slidelist ul {
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 10px 0 10px 10px;
|
|
||||||
list-style: none;
|
|
||||||
}
|
|
||||||
.slidelist li {
|
|
||||||
display: inline-block;
|
|
||||||
margin: 0 10px 10px 0;
|
|
||||||
}
|
|
||||||
.slidelist a {
|
|
||||||
border: solid 2px #fff;
|
|
||||||
display: block;
|
|
||||||
width: 150px;
|
|
||||||
height: 120px;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
box-shadow: 0 0 6px rgba(0,0,0,0.7);
|
|
||||||
-webkit-box-shadow: 0 0 6px rgba(0,0,0,0.7);
|
|
||||||
-moz-box-shadow: 0 0 6px rgba(0,0,0,0.7);
|
|
||||||
-ms-box-shadow: 0 0 6px rgba(0,0,0,0.7);
|
|
||||||
}
|
|
||||||
.slidelist a.playall {
|
|
||||||
border: none;
|
|
||||||
width: 80px;
|
|
||||||
height: 32px;
|
|
||||||
margin: 31px 0 0 22px;
|
|
||||||
background: transparent 0 0 url(../../../assets/gallery/playall.png) no-repeat;
|
|
||||||
|
|
||||||
box-shadow: none;
|
|
||||||
-webkit-box-shadow: none;
|
|
||||||
-moz-box-shadow: none;
|
|
||||||
-ms-box-shadow: none;
|
|
||||||
}
|
|
||||||
.slidelist a.playall:hover { background-position: 0 -32px; }
|
|
||||||
#li_play_all { width: 124px; height: 94px; }
|
|
||||||
.slidelist img {
|
|
||||||
margin: 0;
|
|
||||||
background: #fff;
|
|
||||||
display: block;
|
|
||||||
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
-webkit-transition: all 0.2s ease;
|
|
||||||
-moz-transition: all 0.2s ease;
|
|
||||||
-ms-transition: all 0.2s ease;
|
|
||||||
}
|
|
||||||
.slidelist a:hover img {
|
|
||||||
padding: 4px;
|
|
||||||
margin: -4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dm {
|
|
||||||
background: #fff;
|
|
||||||
border: solid 1px #a4a4a4;
|
|
||||||
border-right-color: #666;
|
|
||||||
position: absolute;
|
|
||||||
overflow: hidden;
|
|
||||||
padding: 2px 0;
|
|
||||||
display: none;
|
|
||||||
|
|
||||||
border-radius: 4px;
|
|
||||||
-webkit-border-radius: 4px;
|
|
||||||
-moz-border-radius: 4px;
|
|
||||||
-ms-border-radius: 4px;
|
|
||||||
}
|
|
||||||
.dm ul { margin: 0; padding: 0; list-style: none !important; }
|
|
||||||
.dm li {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
border-bottom: solid 1px #ccc;
|
|
||||||
list-style: none !important;
|
|
||||||
}
|
|
||||||
.dm li a {
|
|
||||||
display: block;
|
|
||||||
padding: 6px 10px;
|
|
||||||
font-size: 13px;
|
|
||||||
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
-webkit-transition: all 0.3s ease;
|
|
||||||
-moz-transition: all 0.3s ease;
|
|
||||||
-ms-transition: all 0.3s ease;
|
|
||||||
}
|
|
||||||
.dm li a:hover { background: #eee; }
|
|
||||||
|
|
||||||
/* Ruling Gallery UI */
|
|
||||||
.rgbt {
|
|
||||||
padding: 0 0 0 32px;
|
|
||||||
vertical-align: top;
|
|
||||||
|
|
||||||
text-shadow: 0 1px 0 #fff;
|
|
||||||
-webkit-text-shadow: 0 1px 0 #fff;
|
|
||||||
-moz-text-shadow: 0 1px 0 #fff;
|
|
||||||
-ms-text-shadow: 0 1px 0 #fff;
|
|
||||||
}
|
|
||||||
.rgbt span {
|
|
||||||
padding: 0 12px 0 8px;
|
|
||||||
display: inline-block;
|
|
||||||
line-height: 30px;
|
|
||||||
height: 32px;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rgbtsg {
|
|
||||||
padding: 6px;
|
|
||||||
}
|
|
||||||
.rgphoto_edit .rgbtsg.active { display: inline-block; }
|
|
||||||
.bt-finish { display: block; float: right; clear: both; }
|
|
||||||
.bt-addnew {
|
|
||||||
margin: 0 auto;
|
|
||||||
width: 98px;
|
|
||||||
height: 100px;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.bt-next{
|
|
||||||
background-position: 0 -258px;
|
|
||||||
display: block;
|
|
||||||
float: right;
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
.bt-next:hover { background-position: 0 -448px; }
|
|
||||||
.bt-next:active { background-position: 0 -638px; }
|
|
||||||
.bt-close {
|
|
||||||
position: absolute;
|
|
||||||
right: 6px;
|
|
||||||
top: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.inputui {
|
|
||||||
margin: 0 0 8px 0;
|
|
||||||
}
|
|
||||||
.inputui span {
|
|
||||||
padding: 0 4px 0 0;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.rginput { max-width: 400px; }
|
|
||||||
.rginput input, .rginput textarea { color: #999; }
|
|
||||||
.rginput.focus input, .rginput.focus textarea { color: #333; }
|
|
||||||
|
|
||||||
.rgih26 { width: 208px; }
|
|
||||||
.rgih26 span { }
|
|
||||||
.rgih26 input { width: 356px; }
|
|
||||||
.rgih26.focus { }
|
|
||||||
.rgih26.focus span { }
|
|
||||||
.rgih68 { width: 396px; }
|
|
||||||
.rgih68 span { padding: 3px 4px 3px 0; }
|
|
||||||
.rgih68 textarea { width: 392px; height: 62px; }
|
|
||||||
.rgih68.focus { }
|
|
||||||
.rgih68.focus span { }
|
|
||||||
.rgih98 { width: 396px; }
|
|
||||||
.rgih98 span { }
|
|
||||||
.rgih98 textarea { width: 356px; height: 110px; }
|
|
||||||
.rgih98.focus { }
|
|
||||||
.rgih98.focus span { }
|
|
||||||
|
|
||||||
.w380 { width: 386px; }
|
|
||||||
|
|
||||||
#imgholder { overflow: hidden; }
|
|
||||||
|
|
||||||
/* upload panel */
|
|
||||||
#upload_panel_holder {
|
|
||||||
display: none;
|
|
||||||
margin: 16px 0 0 0;
|
|
||||||
clear: both;
|
|
||||||
float: right;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
#upload_panel {
|
|
||||||
background-color: #ddd;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* tag panel */
|
|
||||||
#tag_panel {
|
|
||||||
position: fixed;
|
|
||||||
right: -200px;
|
|
||||||
top: 31px;
|
|
||||||
width: 200px;
|
|
||||||
min-height: 100px;
|
|
||||||
border-left: solid 1px #ccc;
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
#tag_panel .scrollbar {
|
|
||||||
right: 0px;
|
|
||||||
top: 0px;
|
|
||||||
width: 9px;
|
|
||||||
}
|
|
||||||
#tag_panel .viewport {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag_list {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
.tag_list li {
|
|
||||||
padding: 4px 6px;
|
|
||||||
border-top: solid 1px #f6f6f6;
|
|
||||||
}
|
|
||||||
.tag_list li:first-child {
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
.tag_list li:hover {
|
|
||||||
background-color: #08c;
|
|
||||||
}
|
|
||||||
.tag_list li:hover label {
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.tag_list input[type=checkbox], .tag_list label {
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: middle;
|
|
||||||
text-transform: capitalize;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
.tag_list label {
|
|
||||||
padding: 0 6px;
|
|
||||||
}
|
|
||||||
.tag_search {
|
|
||||||
position: absolute;
|
|
||||||
left: -1px;
|
|
||||||
bottom: -30px;
|
|
||||||
width: 200px;
|
|
||||||
height: 32px;
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
border-left: solid 1px #ccc;
|
|
||||||
border-top: solid 1px #ddd;
|
|
||||||
}
|
|
||||||
.tag_search input[type=text] {
|
|
||||||
box-shadow: none;
|
|
||||||
width: 92px;
|
|
||||||
height: 25px;
|
|
||||||
line-height: 25px;
|
|
||||||
padding: 3px 6px 3px 24px;
|
|
||||||
border: 0;
|
|
||||||
border-top: solid 1px #fff;
|
|
||||||
}
|
|
||||||
.tag_search input[type=text]:focus {
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
.tag_search .icon-search {
|
|
||||||
position: absolute;
|
|
||||||
left: 6px;
|
|
||||||
top: 50%;
|
|
||||||
margin-top: -7px;
|
|
||||||
}
|
|
||||||
#tag_panel .tag_save {
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
height: 31px;
|
|
||||||
border-left: solid 1px #ccc;
|
|
||||||
background-color: #fff;
|
|
||||||
padding: 2px 4px 0 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* orbit style implementation */
|
|
||||||
#orbit_gallery {
|
#orbit_gallery {
|
||||||
margin-bottom: 30px;
|
margin: 0;
|
||||||
|
padding: 0 0 10px;
|
||||||
|
list-style: none;
|
||||||
}
|
}
|
||||||
#orbit_gallery .nav-tabs, #orbit_gallery .tab-pane {
|
#orbit_gallery .rgalbum {
|
||||||
margin-left: 8px;
|
margin: 5px;
|
||||||
margin-right: 8px;
|
padding: 10px;
|
||||||
|
width: 200px;
|
||||||
|
background: #FFFFFF;
|
||||||
|
-webkit-transition-property: left, right, top;
|
||||||
|
-moz-transition-property: left, right, top;
|
||||||
|
-ms-transition-property: left, right, top;
|
||||||
|
-o-transition-property: left, right, top;
|
||||||
|
transition-property: left, right, top;
|
||||||
}
|
}
|
||||||
.tab_content .tab-pane{
|
#orbit_gallery .rgalbum:hover {
|
||||||
display: none;
|
box-shadow: 0px 0px 5px rgba(0,0,0,.2);
|
||||||
}
|
}
|
||||||
.tab_content .active{
|
#orbit_gallery .rgalbum a {
|
||||||
|
position: relative;
|
||||||
display: block;
|
display: block;
|
||||||
|
overflow: hidden;
|
||||||
|
margin: 0 0 10px;
|
||||||
|
width: 200px;
|
||||||
|
-webkit-transition: all .2s linear;
|
||||||
|
-moz-transition: all .2s linear;
|
||||||
|
-o-transition: all .2s linear;
|
||||||
|
transition: all .2s linear;
|
||||||
}
|
}
|
||||||
#orbit_gallery .btn { margin: 0; }
|
#orbit_gallery .rgalbum a img {
|
||||||
#orbit_gallery .btn i { margin-right: 4px; }
|
max-width: none;
|
||||||
#orbit_gallery .rgfn .btn {
|
|
||||||
margin-left: 8px;
|
|
||||||
}
|
}
|
||||||
#orbit_gallery .form-actions { background-color: whiteSmoke; }
|
#orbit_gallery .rgalbum:hover a img {
|
||||||
|
-webkit-filter: blur(2px);
|
||||||
.o_gallery .tagnames {
|
}
|
||||||
|
#orbit_gallery .rgalbum a span {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
display: block;
|
display: block;
|
||||||
margin-top: 6px;
|
margin: 0;
|
||||||
|
background-color: #000000;
|
||||||
|
opacity: .0;
|
||||||
|
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
||||||
|
filter: alpha(opacity=0);
|
||||||
|
-webkit-transition: all .2s linear;
|
||||||
|
-moz-transition: all .2s linear;
|
||||||
|
-o-transition: all .2s linear;
|
||||||
|
transition: all .2s linear;
|
||||||
}
|
}
|
||||||
.o_gallery .label-tags {
|
#orbit_gallery .rgalbum:hover a span {
|
||||||
|
opacity: .4;
|
||||||
|
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";
|
||||||
|
filter: alpha(opacity=40);
|
||||||
|
}
|
||||||
|
#orbit_gallery .rgalbum a .albumname {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
margin: 0;
|
||||||
|
padding: 10px;
|
||||||
|
color: #F2F2F2;
|
||||||
|
text-shadow: 0px -1px 0 rgba(0,0,0,0.4);
|
||||||
|
letter-spacing: -0.5px;
|
||||||
|
font-size: 30px;
|
||||||
|
font-family: 'Playfair Display SC', sans-serif;
|
||||||
|
line-height: 28px;
|
||||||
|
opacity: .0;
|
||||||
|
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
||||||
|
filter: alpha(opacity=0);
|
||||||
|
-webkit-transition: all .2s linear;
|
||||||
|
-moz-transition: all .2s linear;
|
||||||
|
-o-transition: all .2s linear;
|
||||||
|
transition: all .2s linear;
|
||||||
|
}
|
||||||
|
#orbit_gallery .rgalbum:hover a .albumname {
|
||||||
|
opacity: 1;
|
||||||
|
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
|
||||||
|
filter: alpha(opacity=100);
|
||||||
|
-webkit-transition: all .2s linear;
|
||||||
|
-moz-transition: all .2s linear;
|
||||||
|
-o-transition: all .2s linear;
|
||||||
|
transition: all .2s linear;
|
||||||
|
}
|
||||||
|
#orbit_gallery .rgalbum .gallery_info {
|
||||||
|
margin: 0;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
#orbit_gallery .rgalbum .gallery_info li {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin: 0 6px 6px 0;
|
float: left;
|
||||||
|
color: #777777;
|
||||||
|
font-size: 11px;
|
||||||
|
line-height: 20px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
#orbit_gallery .rgalbum .gallery_info li:hover {
|
||||||
|
color: #0088CC;
|
||||||
|
}
|
||||||
|
#orbit_gallery .rgalbum .gallery_info li .icons-tag {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
#orbit_gallery .rgalbum .gallery_info li.albumcateg {
|
||||||
|
float: right;
|
||||||
|
overflow: hidden;
|
||||||
|
max-width: 125px;
|
||||||
|
text-align: right;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
#orbit_gallery .rgalbum .gallery_info li.view {
|
||||||
|
overflow: hidden;
|
||||||
|
max-width: 50px;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
#orbit_gallery .rgalbum .albumtag {
|
||||||
|
display: none;
|
||||||
|
overflow: hidden;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.o_gallery .rgbody, .o_album .rgbody {
|
|
||||||
padding: 10px 8px;
|
/* Gallery Body */
|
||||||
|
.rgbody .gallery-info {
|
||||||
|
padding: 0 5px;
|
||||||
|
}
|
||||||
|
.rgbody .gallery-info h3 {
|
||||||
|
margin: 5px 0 0;
|
||||||
|
color: #333;
|
||||||
|
text-shadow: 0 1px 0 #ffffff;
|
||||||
|
font-family: 'Playfair Display SC', sans-serif;
|
||||||
|
}
|
||||||
|
.rgbody .gallery-info .muted {
|
||||||
|
font-family: 'Raleway', sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
#categories .add-album .control-label {
|
#imgholder {
|
||||||
text-align: left;
|
margin: 0;
|
||||||
width: 100px;
|
padding: 0 0 10px;
|
||||||
padding-left: 12px;
|
list-style: none;
|
||||||
padding-right: 12px;
|
|
||||||
}
|
}
|
||||||
.o_album_edit form {
|
#imgholder .rgalbum {
|
||||||
margin-left: 8px;
|
float: left;
|
||||||
|
margin: 5px;
|
||||||
|
padding: 5px;
|
||||||
|
width: 200px;
|
||||||
|
background: #FFFFFF;
|
||||||
|
-webkit-box-shadow: 0px 0px 5px rgba(0, 0, 0, .1);
|
||||||
|
-moz-box-shadow: 0px 0px 5px rgba(0, 0, 0, .1);
|
||||||
|
box-shadow: 0px 0px 5px rgba(0, 0, 0, .1);
|
||||||
|
-webkit-transition-property: left, right, top;
|
||||||
|
-moz-transition-property: left, right, top;
|
||||||
|
-ms-transition-property: left, right, top;
|
||||||
|
-o-transition-property: left, right, top;
|
||||||
|
transition-property: left, right, top;
|
||||||
|
-o-box-shadow: 0px 0px 5px rgba(0, 0, 0, .1);
|
||||||
|
}
|
||||||
|
#imgholder .rgalbum a {
|
||||||
|
display: block;
|
||||||
|
overflow: hidden;
|
||||||
|
margin: 0;
|
||||||
|
width: 200px;
|
||||||
|
-webkit-transition: all .2s linear;
|
||||||
|
-moz-transition: all .2s linear;
|
||||||
|
-o-transition: all .2s linear;
|
||||||
|
transition: all .2s linear;
|
||||||
|
}
|
||||||
|
#imgholder .rgalbum a img {
|
||||||
|
max-width: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* File Upload */
|
||||||
|
#upload-panel {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
#upload-panel iframe {
|
||||||
|
width: 100%;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
#fileupload {
|
||||||
|
position: relative;
|
||||||
|
display: none;
|
||||||
|
clear: both;
|
||||||
|
overflow: hidden;
|
||||||
|
margin: 40px 0 15px;
|
||||||
|
height: 254px;
|
||||||
|
border: 1px solid #d4d4d4;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: #FDFDFD;
|
||||||
|
/*-webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, .15) inset;
|
||||||
|
box-shadow: 0px 0px 10px rgba(0, 0, 0, .15) inset;*/
|
||||||
|
}
|
||||||
|
#fileupload table {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
#fileupload .fileupload-buttonbar .navbar {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
#fileupload .fileupload-buttonbar .navbar button {
|
||||||
|
border: none;
|
||||||
|
border-right: 1px solid #d4d4d4;
|
||||||
|
background-color: transparent;
|
||||||
|
padding: 10px 15px 10px;
|
||||||
|
color: #777777;
|
||||||
|
text-decoration: none;
|
||||||
|
text-shadow: 0 1px 0 #ffffff;
|
||||||
|
}
|
||||||
|
#fileupload .fileupload-buttonbar .navbar button:hover {
|
||||||
|
color: #333333;
|
||||||
|
text-decoration: none;
|
||||||
|
background-color: #EDEDED;
|
||||||
|
}
|
||||||
|
#fileupload .fileupload-buttonbar .navbar .fileinput-button {
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
#fileupload .fileupload-buttonbar .navbar .fileinput-button input {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
margin: 0;
|
||||||
|
font-size: 23px;
|
||||||
|
opacity: 0;
|
||||||
|
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
||||||
|
filter: alpha(opacity=0);
|
||||||
|
cursor: pointer;
|
||||||
|
-webkit-transform: translate(-300px, 0) scale(4);
|
||||||
|
-moz-transform: translate(-300px, 0) scale(4);
|
||||||
|
-ms-transform: translate(-300px, 0) scale(4);
|
||||||
|
-o-transform: translate(-300px, 0) scale(4);
|
||||||
|
transform: translate(-300px, 0) scale(4);
|
||||||
|
direction: ltr;
|
||||||
|
}
|
||||||
|
#fileupload .fileupload-buttonbar .navbar-inner {
|
||||||
|
border-width: 0 0 1px;
|
||||||
|
border-radius: 4px 4px 0 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fileupload .fileupload-progress .progress {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
left: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
height: 5px;
|
||||||
|
border-radius: 0;
|
||||||
|
background-color: transparent;
|
||||||
|
background-image: none;
|
||||||
|
}
|
||||||
|
#fileupload .fileupload-progress .progress-success.progress-striped .bar {
|
||||||
|
background-color: #0088CC;
|
||||||
|
}
|
||||||
|
#fileupload .fileupload-progress .progress-extended {
|
||||||
|
position: absolute;
|
||||||
|
top: 1px;
|
||||||
|
right: 0;
|
||||||
|
padding-right: 15px;
|
||||||
|
color: #0088CC;
|
||||||
|
text-align: right;
|
||||||
|
text-shadow: 0 1px 0 #ffffff;
|
||||||
|
letter-spacing: -0.1em;
|
||||||
|
font-size: 12px;
|
||||||
|
font-family: 'Varela Round', sans-serif;
|
||||||
|
line-height: 40px;
|
||||||
|
}
|
||||||
|
#fileupload .fileupload-buttonbar {
|
||||||
|
position: relative;
|
||||||
|
z-index: 3;
|
||||||
|
}
|
||||||
|
#fileupload #dropzone {
|
||||||
|
margin: 15px 10px 10px;
|
||||||
|
padding: 30px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 2em;
|
||||||
|
font-family: 'Raleway';
|
||||||
|
line-height: 1.2em;
|
||||||
|
color: #e4e4e4;
|
||||||
|
}
|
||||||
|
#fileupload #dropzone div[data-icons] {
|
||||||
|
font-size: 4em;
|
||||||
|
height: 70px;
|
||||||
|
padding-top: 30px;
|
||||||
|
text-shadow: 0px -1px 0px #ececec;
|
||||||
|
color: #f5f5f5;
|
||||||
|
}
|
||||||
|
#fileupload #dropzone.drop {
|
||||||
|
position: absolute;
|
||||||
|
top: 37px;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
border: 2px dashed #0088CC;
|
||||||
|
border-radius: 10px;
|
||||||
|
color: #0088CC;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
z-index: 0;
|
||||||
|
}
|
||||||
|
#fileupload #dropzone.fade {
|
||||||
|
opacity: .3;
|
||||||
|
}
|
||||||
|
#fileupload #dropzone.in {
|
||||||
|
opacity: .7;
|
||||||
|
z-index: 2;
|
||||||
|
border-color: #faa732;
|
||||||
|
color: #faa732;
|
||||||
|
}
|
||||||
|
#fileupload #dropzone.drop div[data-icons] {
|
||||||
|
text-shadow: 0px -1px 0px #0c5f80;
|
||||||
|
color: #0088CC;
|
||||||
|
}
|
||||||
|
#fileupload #dropzone.in div[data-icons] {
|
||||||
|
text-shadow: 0px -1px 0px #a28a10;
|
||||||
|
color: #faa732;
|
||||||
|
}
|
||||||
|
#fileupload #file-list {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
height: 209px;
|
||||||
|
margin: 2px 0;
|
||||||
|
}
|
||||||
|
#fileupload #file-list .pane {
|
||||||
|
margin-right: 2px;
|
||||||
|
}
|
||||||
|
#fileupload #file-list .files {
|
||||||
|
margin: 0;
|
||||||
|
padding: 10px 14px 10px 10px;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
#fileupload #file-list .files > li {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
#fileupload #file-list .files > li:nth-child(even) {
|
||||||
|
background-color: #e9e9e9;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
#fileupload #file-list .files ul {
|
||||||
|
position: relative;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
#fileupload #file-list .files ul li {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
#fileupload #file-list .files ul li.action-bnt {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
#fileupload #file-list .preview {
|
||||||
|
width: 80px;
|
||||||
|
min-height: 1px;
|
||||||
|
margin-right: 10px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
#fileupload #file-list .name {
|
||||||
|
width: 150px;
|
||||||
|
max-width: 250px;
|
||||||
|
margin-left: 15px;
|
||||||
|
}
|
||||||
|
#fileupload #file-list .progress {
|
||||||
|
position: absolute;
|
||||||
|
left: -5px;
|
||||||
|
right: -5px;
|
||||||
|
bottom: -5px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
height: 5px;
|
||||||
|
box-shadow: none;
|
||||||
|
background-color: transparent;
|
||||||
|
background-image: none;
|
||||||
|
}
|
||||||
|
#fileupload #file-list .size {
|
||||||
|
width: 80px;
|
||||||
|
}
|
||||||
|
#fileupload #file-list .action-bnt {
|
||||||
|
text-align: right;
|
||||||
}
|
}
|
|
@ -0,0 +1,557 @@
|
||||||
|
.rg, .rgp {
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
-webkit-transition: all 0.3s ease;
|
||||||
|
-moz-transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
.rg input, .rgp input, .rg textarea, .rgp textarea {
|
||||||
|
resize: none;
|
||||||
|
margin: 0;
|
||||||
|
display: block;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
.rgp textarea { overflow: auto; }
|
||||||
|
.rg a, .rgp a {
|
||||||
|
text-decoration: none;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
.rg a:hover { }
|
||||||
|
|
||||||
|
/*.rg img { display: block; border: none;}*/
|
||||||
|
|
||||||
|
.rgmask { background: #000; width: 100%; position: fixed; top: 0; left: 0; }
|
||||||
|
|
||||||
|
.rgui {
|
||||||
|
display: inline-block;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.rghead, .rgbody { overflow: hidden; }
|
||||||
|
.rghead {
|
||||||
|
border-bottom: solid 1px #ccc;
|
||||||
|
padding: 10px 0;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
.rgtitle {
|
||||||
|
color: #333;
|
||||||
|
text-shadow: 0 1px 0 #ddd;
|
||||||
|
font-size: 2em;
|
||||||
|
padding: 0 8px;
|
||||||
|
}
|
||||||
|
.rgbody {
|
||||||
|
|
||||||
|
}
|
||||||
|
.rgfn { overflow: hidden; padding: 4px 10px; }
|
||||||
|
.rgalbum, .rgphoto { float: left; margin: 0 10px 24px 0; }
|
||||||
|
.rgalbum {
|
||||||
|
padding: 16px;
|
||||||
|
margin: 0 8px 8px 0;
|
||||||
|
border: solid 1px #ccc;
|
||||||
|
width: 300px;
|
||||||
|
height: 120px;
|
||||||
|
border-radius: 4px;
|
||||||
|
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
-webkit-transition: all 0.3s ease;
|
||||||
|
-moz-transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
.rgalbum > a {
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
.rgalbum:hover {
|
||||||
|
box-shadow: 0 0 6px rgba(0,0,0,0.2);
|
||||||
|
}
|
||||||
|
.rgalbum img {
|
||||||
|
transition: all, 0.5s ease;
|
||||||
|
-webkit-transition: all, 0.5s ease;
|
||||||
|
-moz-transition: all 0.5s ease;
|
||||||
|
-ms-transition: all, 0.5s ease;
|
||||||
|
}
|
||||||
|
.rgphoto { }
|
||||||
|
.rgphoto a {
|
||||||
|
display: block;
|
||||||
|
padding: 4px;
|
||||||
|
border: solid 1px #ddd;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 4px;
|
||||||
|
transition: all, 0.3s ease;
|
||||||
|
-webkit-transition: all, 0.3s ease;
|
||||||
|
-moz-transition: all, 0.3s ease;
|
||||||
|
}
|
||||||
|
.rgphoto a:hover {
|
||||||
|
border-color: #999;
|
||||||
|
box-shadow: 0 3px 6px rgba(0,0,0,0.2);
|
||||||
|
}
|
||||||
|
.rgphoto img, .rgphoto_edit img {
|
||||||
|
/*display: block;*/
|
||||||
|
border-radius: 3px;
|
||||||
|
transition: all, 0.3s ease;
|
||||||
|
-webkit-transition: all, 0.3s ease;
|
||||||
|
-moz-transition: all, 0.3s ease;
|
||||||
|
}
|
||||||
|
.rgalbum .albumname {
|
||||||
|
font-size: 18px;
|
||||||
|
padding: 6px 0;
|
||||||
|
display: block;
|
||||||
|
transition: background 0.3s ease;
|
||||||
|
-webkit-transition: background 0.3s ease;
|
||||||
|
-moz-transition: background 0.3s ease;
|
||||||
|
-ms-transition: background 0.3s ease;
|
||||||
|
}
|
||||||
|
.rgalbum a:hover img {
|
||||||
|
opacity: 0.85;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rgp .rgtitle { margin: 0 0 10px 0; }
|
||||||
|
|
||||||
|
/* Photo Edit */
|
||||||
|
.albumname_edit label, .albumname_edit .rginput, .rgphoto_edit > a, .rgphoto_edit .rginput { float: left; }
|
||||||
|
.rgphoto_edit, .albumname_edit {
|
||||||
|
clear: both;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.albumname_edit label {
|
||||||
|
width: 150px;
|
||||||
|
margin: 0 10px 0 0;
|
||||||
|
text-align: right;
|
||||||
|
padding: 0;
|
||||||
|
line-height: 24px;
|
||||||
|
}
|
||||||
|
.albumname_edit .rginput { }
|
||||||
|
.rgphoto_edit img { margin: 0 10px 10px 0; }
|
||||||
|
.rgphoto_edit .rginput { margin-right: 10px; }
|
||||||
|
.rgphoto_edit .edit_fn { float: left; margin-bottom: 10px; }
|
||||||
|
.rgphoto_edit .edit_fn .bt-dels { }
|
||||||
|
|
||||||
|
/* Delete List */
|
||||||
|
.rglist { overflow: hidden; padding: 10px 0; }
|
||||||
|
.list { table-layout:fixed; width: 100%; margin: 0 0 12px 0; }
|
||||||
|
.list thead th { padding: 8px 4px; font-size: 30px; font-weight: bold; }
|
||||||
|
.list th img { width: 60px; height: 45px; }
|
||||||
|
.list .photoname { padding-left: 6px; }
|
||||||
|
.list .photofn { padding-right: 4px; }
|
||||||
|
.list .photofn a { float: right; margin-left: 4px; display: block; }
|
||||||
|
.list th { padding: 4px 0 4px 4px; }
|
||||||
|
.list tbody th, .list tbody td { border-bottom: solid 1px #ccc; }
|
||||||
|
.list .odd th, .list .odd td { background: #f6f6f6; }
|
||||||
|
.list .c1 { width: 64px; }
|
||||||
|
.list .c3 { width: 40px; }
|
||||||
|
|
||||||
|
/* Ruling Slide */
|
||||||
|
.rslide {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #222;
|
||||||
|
clear: both;
|
||||||
|
/*z-index: 99;*/
|
||||||
|
min-height: 250px;
|
||||||
|
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
-webkit-transition: all 0.3s ease;
|
||||||
|
-moz-transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
.rslide.fullscreen { position: fixed; z-index: 99; }
|
||||||
|
.rslideinside {
|
||||||
|
/*
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
.comp {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
-webkit-transition: all 0.3s ease;
|
||||||
|
-moz-transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
.comp img{ display: block; width: auto; height: auto; margin: 0 auto; cursor: pointer; min-height: 250px; }
|
||||||
|
.comp .full{ width: auto; height: auto; max-width: 100%; max-height: 100%; }
|
||||||
|
.rslidenav {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
margin-top: -35px;
|
||||||
|
}
|
||||||
|
.rslidenav a {
|
||||||
|
position: absolute;
|
||||||
|
display: block;
|
||||||
|
width: 30px;
|
||||||
|
height: 40px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-indent: -999px;
|
||||||
|
background: #000 0 center url(../../../assets/gallery/slidenav.png) no-repeat;
|
||||||
|
background: rgba(0,0,0,0.9) 0 0 url(../../../assets/gallery/slidenav.png) no-repeat;
|
||||||
|
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
-webkit-transition: all 0.3s ease;
|
||||||
|
-moz-transition: all 0.3s ease;
|
||||||
|
-ms-transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
.rslidenav a:hover {
|
||||||
|
background-color: #fff;
|
||||||
|
background-color: rgba(255,255,255,0.9);
|
||||||
|
}
|
||||||
|
.rslidenav .navP { left: 0; border-radius: 0 4px 4px 0; background-position: 0 -40px; }
|
||||||
|
.rslidenav .navN { right: 0; border-radius: 4px 0 0 4px; background-position: -30px 0; }
|
||||||
|
.rslidenav a.navP:hover { background-position: -30px -40px; }
|
||||||
|
.rslidenav a.navN:hover { background-position: 0 0; }
|
||||||
|
.slidectrl {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 30px;
|
||||||
|
background: #000 left top url(../../../assets/gallery/slidetitlebg.png) repeat-x;
|
||||||
|
background: rgba(0,0,0,0.9) left top url(../../../assets/gallery/slidetitlebg.png) repeat-x;
|
||||||
|
/*z-index: 999;*/
|
||||||
|
}
|
||||||
|
.slidectrl a {
|
||||||
|
display: block;
|
||||||
|
float: right;
|
||||||
|
text-indent: -9999px;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
background: transparent 0 0 url(../../../assets/gallery/slideui.gif) no-repeat;
|
||||||
|
border-left: solid 1px #222;
|
||||||
|
}
|
||||||
|
.slidectrl a.togglelist { background-position: 0 -30px; }
|
||||||
|
.slidectrl a.togglescreen { background-position: 0 -90px; }
|
||||||
|
.slidectrl a.toinline { background-position: -30px 0; }
|
||||||
|
.slidectrl a.sharebt { background-position: -30px -30px; }
|
||||||
|
.slidectrl a.browserfullscreen { display:none;}
|
||||||
|
.slidectrl a.slidestop { background-position: 0 -60px; }
|
||||||
|
.fullscreen .slidectrl a.togglescreen { background-position: -30px -90px; }
|
||||||
|
.browserFullScreen .slidectrl a.browserfullscreen { background-position: -30px 0; }
|
||||||
|
.browserFullScreen .togglescreen { display: none; }
|
||||||
|
.slideinfo {
|
||||||
|
height: 30px;
|
||||||
|
line-height: 30px;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 13px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.slideinfo .info { padding: 0 0 0 6px; text-transform: uppercase; }
|
||||||
|
.slideinfo span.info { color: #ccc; text-transform: none; }
|
||||||
|
|
||||||
|
.slidelist {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 30px;
|
||||||
|
z-index: 99;
|
||||||
|
width: 100%;
|
||||||
|
height: 0;
|
||||||
|
overflow: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
background: transparent 0 0 url(../../../assets/gallery/slidelistbg.png);
|
||||||
|
}
|
||||||
|
.slidelist ul {
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 10px 0 10px 10px;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
.slidelist li {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0 10px 10px 0;
|
||||||
|
}
|
||||||
|
.slidelist a {
|
||||||
|
border: solid 2px #fff;
|
||||||
|
display: block;
|
||||||
|
width: 150px;
|
||||||
|
height: 120px;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
box-shadow: 0 0 6px rgba(0,0,0,0.7);
|
||||||
|
-webkit-box-shadow: 0 0 6px rgba(0,0,0,0.7);
|
||||||
|
-moz-box-shadow: 0 0 6px rgba(0,0,0,0.7);
|
||||||
|
-ms-box-shadow: 0 0 6px rgba(0,0,0,0.7);
|
||||||
|
}
|
||||||
|
.slidelist a.playall {
|
||||||
|
border: none;
|
||||||
|
width: 80px;
|
||||||
|
height: 32px;
|
||||||
|
margin: 31px 0 0 22px;
|
||||||
|
background: transparent 0 0 url(../../../assets/gallery/playall.png) no-repeat;
|
||||||
|
|
||||||
|
box-shadow: none;
|
||||||
|
-webkit-box-shadow: none;
|
||||||
|
-moz-box-shadow: none;
|
||||||
|
-ms-box-shadow: none;
|
||||||
|
}
|
||||||
|
.slidelist a.playall:hover { background-position: 0 -32px; }
|
||||||
|
#li_play_all { width: 124px; height: 94px; }
|
||||||
|
.slidelist img {
|
||||||
|
margin: 0;
|
||||||
|
background: #fff;
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
-webkit-transition: all 0.2s ease;
|
||||||
|
-moz-transition: all 0.2s ease;
|
||||||
|
-ms-transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
.slidelist a:hover img {
|
||||||
|
padding: 4px;
|
||||||
|
margin: -4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dm {
|
||||||
|
background: #fff;
|
||||||
|
border: solid 1px #a4a4a4;
|
||||||
|
border-right-color: #666;
|
||||||
|
position: absolute;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 2px 0;
|
||||||
|
display: none;
|
||||||
|
|
||||||
|
border-radius: 4px;
|
||||||
|
-webkit-border-radius: 4px;
|
||||||
|
-moz-border-radius: 4px;
|
||||||
|
-ms-border-radius: 4px;
|
||||||
|
}
|
||||||
|
.dm ul { margin: 0; padding: 0; list-style: none !important; }
|
||||||
|
.dm li {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
border-bottom: solid 1px #ccc;
|
||||||
|
list-style: none !important;
|
||||||
|
}
|
||||||
|
.dm li a {
|
||||||
|
display: block;
|
||||||
|
padding: 6px 10px;
|
||||||
|
font-size: 13px;
|
||||||
|
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
-webkit-transition: all 0.3s ease;
|
||||||
|
-moz-transition: all 0.3s ease;
|
||||||
|
-ms-transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
.dm li a:hover { background: #eee; }
|
||||||
|
|
||||||
|
/* Ruling Gallery UI */
|
||||||
|
.rgbt {
|
||||||
|
padding: 0 0 0 32px;
|
||||||
|
vertical-align: top;
|
||||||
|
|
||||||
|
text-shadow: 0 1px 0 #fff;
|
||||||
|
-webkit-text-shadow: 0 1px 0 #fff;
|
||||||
|
-moz-text-shadow: 0 1px 0 #fff;
|
||||||
|
-ms-text-shadow: 0 1px 0 #fff;
|
||||||
|
}
|
||||||
|
.rgbt span {
|
||||||
|
padding: 0 12px 0 8px;
|
||||||
|
display: inline-block;
|
||||||
|
line-height: 30px;
|
||||||
|
height: 32px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rgbtsg {
|
||||||
|
padding: 6px;
|
||||||
|
}
|
||||||
|
.rgphoto_edit .rgbtsg.active { display: inline-block; }
|
||||||
|
.bt-finish { display: block; float: right; clear: both; }
|
||||||
|
.bt-addnew {
|
||||||
|
margin: 0 auto;
|
||||||
|
width: 98px;
|
||||||
|
height: 100px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.bt-next{
|
||||||
|
background-position: 0 -258px;
|
||||||
|
display: block;
|
||||||
|
float: right;
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
.bt-next:hover { background-position: 0 -448px; }
|
||||||
|
.bt-next:active { background-position: 0 -638px; }
|
||||||
|
.bt-close {
|
||||||
|
position: absolute;
|
||||||
|
right: 6px;
|
||||||
|
top: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.inputui {
|
||||||
|
margin: 0 0 8px 0;
|
||||||
|
}
|
||||||
|
.inputui span {
|
||||||
|
padding: 0 4px 0 0;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.rginput { max-width: 400px; }
|
||||||
|
.rginput input, .rginput textarea { color: #999; }
|
||||||
|
.rginput.focus input, .rginput.focus textarea { color: #333; }
|
||||||
|
|
||||||
|
.rgih26 { width: 208px; }
|
||||||
|
.rgih26 span { }
|
||||||
|
.rgih26 input { width: 356px; }
|
||||||
|
.rgih26.focus { }
|
||||||
|
.rgih26.focus span { }
|
||||||
|
.rgih68 { width: 396px; }
|
||||||
|
.rgih68 span { padding: 3px 4px 3px 0; }
|
||||||
|
.rgih68 textarea { width: 392px; height: 62px; }
|
||||||
|
.rgih68.focus { }
|
||||||
|
.rgih68.focus span { }
|
||||||
|
.rgih98 { width: 396px; }
|
||||||
|
.rgih98 span { }
|
||||||
|
.rgih98 textarea { width: 356px; height: 110px; }
|
||||||
|
.rgih98.focus { }
|
||||||
|
.rgih98.focus span { }
|
||||||
|
|
||||||
|
.w380 { width: 386px; }
|
||||||
|
|
||||||
|
#imgholder { overflow: hidden; }
|
||||||
|
|
||||||
|
/* upload panel */
|
||||||
|
#upload_panel_holder {
|
||||||
|
display: none;
|
||||||
|
margin: 16px 0 0 0;
|
||||||
|
clear: both;
|
||||||
|
float: right;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
#upload_panel {
|
||||||
|
background-color: #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* tag panel */
|
||||||
|
#tag_panel {
|
||||||
|
position: fixed;
|
||||||
|
right: -200px;
|
||||||
|
top: 31px;
|
||||||
|
width: 200px;
|
||||||
|
min-height: 100px;
|
||||||
|
border-left: solid 1px #ccc;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
#tag_panel .scrollbar {
|
||||||
|
right: 0px;
|
||||||
|
top: 0px;
|
||||||
|
width: 9px;
|
||||||
|
}
|
||||||
|
#tag_panel .viewport {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag_list {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.tag_list li {
|
||||||
|
padding: 4px 6px;
|
||||||
|
border-top: solid 1px #f6f6f6;
|
||||||
|
}
|
||||||
|
.tag_list li:first-child {
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
.tag_list li:hover {
|
||||||
|
background-color: #08c;
|
||||||
|
}
|
||||||
|
.tag_list li:hover label {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.tag_list input[type=checkbox], .tag_list label {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
text-transform: capitalize;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.tag_list label {
|
||||||
|
padding: 0 6px;
|
||||||
|
}
|
||||||
|
.tag_search {
|
||||||
|
position: absolute;
|
||||||
|
left: -1px;
|
||||||
|
bottom: -30px;
|
||||||
|
width: 200px;
|
||||||
|
height: 32px;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
border-left: solid 1px #ccc;
|
||||||
|
border-top: solid 1px #ddd;
|
||||||
|
}
|
||||||
|
.tag_search input[type=text] {
|
||||||
|
box-shadow: none;
|
||||||
|
width: 92px;
|
||||||
|
height: 25px;
|
||||||
|
line-height: 25px;
|
||||||
|
padding: 3px 6px 3px 24px;
|
||||||
|
border: 0;
|
||||||
|
border-top: solid 1px #fff;
|
||||||
|
}
|
||||||
|
.tag_search input[type=text]:focus {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
.tag_search .icon-search {
|
||||||
|
position: absolute;
|
||||||
|
left: 6px;
|
||||||
|
top: 50%;
|
||||||
|
margin-top: -7px;
|
||||||
|
}
|
||||||
|
#tag_panel .tag_save {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
height: 31px;
|
||||||
|
border-left: solid 1px #ccc;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 2px 4px 0 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* orbit style implementation */
|
||||||
|
#orbit_gallery {
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
#orbit_gallery .nav-tabs, #orbit_gallery .tab-pane {
|
||||||
|
margin-left: 8px;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
.tab_content .tab-pane{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.tab_content .active{
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
#orbit_gallery .btn { margin: 0; }
|
||||||
|
#orbit_gallery .btn i { margin-right: 4px; }
|
||||||
|
#orbit_gallery .rgfn .btn {
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
|
#orbit_gallery .form-actions { background-color: whiteSmoke; }
|
||||||
|
|
||||||
|
.o_gallery .tagnames {
|
||||||
|
display: block;
|
||||||
|
margin-top: 6px;
|
||||||
|
}
|
||||||
|
.o_gallery .label-tags {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0 6px 6px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.o_gallery .rgbody, .o_album .rgbody {
|
||||||
|
padding: 10px 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#categories .add-album .control-label {
|
||||||
|
text-align: left;
|
||||||
|
width: 100px;
|
||||||
|
padding-left: 12px;
|
||||||
|
padding-right: 12px;
|
||||||
|
}
|
||||||
|
.o_album_edit form {
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
|
@ -14,9 +14,8 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||||
else
|
else
|
||||||
@authenticated = false
|
@authenticated = false
|
||||||
end
|
end
|
||||||
@categorylist = GalleryCategory.all
|
@categories = get_categories_for_index
|
||||||
@cid = params['cat']
|
@albums = GalleryAlbum.all
|
||||||
@tags = get_tags
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
@ -26,76 +25,26 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||||
@authenticated = false
|
@authenticated = false
|
||||||
end
|
end
|
||||||
@album = GalleryAlbum.find(params[:id])
|
@album = GalleryAlbum.find(params[:id])
|
||||||
@tags = get_tags
|
@images = @album.gallery_images
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
if is_manager? || is_admin?
|
@categories = get_categories_for_index
|
||||||
@categorylist = GalleryCategory.all
|
|
||||||
elsif is_sub_manager?
|
|
||||||
@categorylist = GalleryCategory.authed_for_user(current_user,"new_album")
|
|
||||||
end
|
|
||||||
@album = GalleryAlbum.new
|
@album = GalleryAlbum.new
|
||||||
render :layout => false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
album = GalleryAlbum.new(params[:gallery_album])
|
album = GalleryAlbum.new(params[:gallery_album])
|
||||||
album.save!
|
album.save!
|
||||||
respond_to do |h|
|
redirect_to panel_gallery_back_end_albums_path
|
||||||
h.js
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def get_albums
|
|
||||||
@categoryids = params["cid"]
|
|
||||||
@tags = params["tid"]
|
|
||||||
@albums = Array.new
|
|
||||||
if @categoryids == "all"
|
|
||||||
if @tags
|
|
||||||
if @tags.kind_of?(Array)
|
|
||||||
@tags.each do |tag|
|
|
||||||
@albums << GalleryAlbum.where(tagged_ids: tag)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
@albums << GalleryAlbum.where(tagged_ids: @tags)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
@albums << GalleryAlbum.all
|
|
||||||
end
|
|
||||||
else
|
|
||||||
@categoryids.each do |id|
|
|
||||||
category = GalleryCategory.find(id)
|
|
||||||
if @tags
|
|
||||||
if @tags.kind_of?(Array)
|
|
||||||
@tags.each do |tag|
|
|
||||||
@albums << category.gallery_albums.where(tagged_ids: tag)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
@albums << category.gallery_albums.where(tagged_ids: @tags)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
@albums << category.gallery_albums.all
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@output = Array.new
|
|
||||||
@albums.each do |album|
|
|
||||||
@albs = Array.new
|
|
||||||
album.each do |values|
|
|
||||||
tags = Tag.find(values.tagged_ids).map{|t| t.name}
|
|
||||||
category = GalleryCategory.find(values.gallery_category_id).name
|
|
||||||
@albs << {"_id"=>values.id,"show_path"=>panel_gallery_back_end_album_path(values),"cover"=>values.cover,"cover_path"=>values.cover_path,"description"=>values.description,"category_name"=>category,"gallery_category_id" => values.gallery_category_id,"name"=>values.name,"tag_ids"=>values.tag_ids,"tag_names"=>tags}
|
|
||||||
end
|
|
||||||
@output << @albs
|
|
||||||
end
|
|
||||||
render :json=>@output.to_json
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
album = GalleryAlbum.find(params[:id])
|
album = GalleryAlbum.find(params[:id])
|
||||||
album.delete
|
album.destroy
|
||||||
render :json =>{"success"=>true}.to_json
|
redirect_to panel_gallery_back_end_albums_path
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
@ -183,10 +132,7 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def upload_panel
|
|
||||||
@album = GalleryAlbum.find(params[:album_id])
|
|
||||||
render :layout => false
|
|
||||||
end
|
|
||||||
|
|
||||||
def upload_image
|
def upload_image
|
||||||
@album = GalleryAlbum.find(params[:album_id])
|
@album = GalleryAlbum.find(params[:album_id])
|
||||||
|
@ -196,10 +142,19 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
|
||||||
@image = @album.gallery_images.new
|
@image = @album.gallery_images.new
|
||||||
@image.file = file
|
@image.file = file
|
||||||
@image.save!
|
@image.save!
|
||||||
a << {"thumbnail_url"=>@image.file.thumb.url}
|
a << {"thumbnail_url"=>@image.file.thumb.url,"url"=>panel_gallery_back_end_album_image_path(@image)}
|
||||||
end
|
end
|
||||||
render :json=>a.to_json
|
render :json=>{"files"=>a}.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def new_images
|
||||||
|
@lastimage = GalleryImage.find(params[:last_image_id])
|
||||||
|
@album = GalleryAlbum.find(params[:album_id])
|
||||||
|
@newimages = @album.gallery_images.where(:created_at.gt => @lastimage.created_at)
|
||||||
|
render :layout=>false
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
def images_tags
|
def images_tags
|
||||||
album = GalleryAlbum.find(params[:album_id])
|
album = GalleryAlbum.find(params[:album_id])
|
||||||
tags = Array.new
|
tags = Array.new
|
||||||
|
|
|
@ -10,7 +10,6 @@ class GalleryAlbum
|
||||||
field :cover_path #can refact
|
field :cover_path #can refact
|
||||||
field :tag_names
|
field :tag_names
|
||||||
|
|
||||||
belongs_to :gallery_category
|
|
||||||
# has_and_belongs_to_many :tags, :class_name => "GalleryTag"
|
# has_and_belongs_to_many :tags, :class_name => "GalleryTag"
|
||||||
has_many :gallery_images, :autosave => true, :dependent => :destroy
|
has_many :gallery_images, :autosave => true, :dependent => :destroy
|
||||||
accepts_nested_attributes_for :gallery_images, :allow_destroy => true
|
accepts_nested_attributes_for :gallery_images, :allow_destroy => true
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
<%= stylesheet_link_tag "gallery" %>
|
<%= stylesheet_link_tag "gallery_old" %>
|
||||||
|
|
||||||
<div id="orbit_gallery" class="rg">
|
<div id="orbit_gallery" class="rg">
|
||||||
<div class="rgbody">
|
<div class="rgbody">
|
||||||
|
@ -48,17 +48,7 @@
|
||||||
@locales << locale
|
@locales << locale
|
||||||
end
|
end
|
||||||
%>
|
%>
|
||||||
<div class="viewport">
|
|
||||||
<div class="overview">
|
|
||||||
<ul class="tag_list" id="gallery_tag_list">
|
|
||||||
<%# if @authenticated %>
|
|
||||||
<% @tags.each do |tag| %>
|
|
||||||
<li data-content="<%= tag.id %>"><input id="tag_<%= tag.id %>" type="checkbox"><label for="tag_<%= tag.id %>"><%= tag.name %></label><span style="display:none;"><%= tag[@locales[1]] %> <%= tag[@locales[0]] %></span></li>
|
|
||||||
<% end %>
|
|
||||||
<%# end %>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<%# if @authenticated %>
|
<%# if @authenticated %>
|
||||||
<div class="tag_search"><div class="icon-search"></div><input type="text" value="<%= t('gallery.search_tags') %>" onblur="if(this.value=='')this.value='<%= t('gallery.search_tags') %>';" onfocus="if(this.value=='<%= t("gallery.search_tags") %>')this.value='';" id="tag_search_box"> <div class="tag_save"><a class="btn bt-save"><i class="icon-ok"></i><%= I18n.t("gallery.save") %></a></div></div>
|
<div class="tag_search"><div class="icon-search"></div><input type="text" value="<%= t('gallery.search_tags') %>" onblur="if(this.value=='')this.value='<%= t('gallery.search_tags') %>';" onfocus="if(this.value=='<%= t("gallery.search_tags") %>')this.value='';" id="tag_search_box"> <div class="tag_save"><a class="btn bt-save"><i class="icon-ok"></i><%= I18n.t("gallery.save") %></a></div></div>
|
||||||
<%# end %>
|
<%# end %>
|
||||||
|
@ -67,46 +57,23 @@
|
||||||
|
|
||||||
<%end%>
|
<%end%>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
var $tag_panel = $('#tag_panel');
|
|
||||||
orbit_bar_height = $('#orbit-bar').outerHeight();
|
|
||||||
action_panel_height = $('.form-actions').outerHeight();
|
|
||||||
window_height = $(window).height();
|
|
||||||
|
|
||||||
|
|
||||||
$tag_panel.height( window_height - orbit_bar_height - 90 );
|
|
||||||
$tag_panel.tinyscrollbar();
|
|
||||||
|
|
||||||
$(window).resize(function(){
|
|
||||||
$tag_panel.tinyscrollbar_update('relative');
|
|
||||||
$tag_panel.height( $(window).height() - orbit_bar_height - 90 );
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
|
||||||
<!-- tag end -->
|
<!-- tag end -->
|
||||||
<div class="form-actions form-fixed pagination-right rghead">
|
<div class="form-actions form-fixed pagination-right rghead">
|
||||||
<div class="rgfn">
|
<div class="rgfn">
|
||||||
<%= link_to (content_tag(:i,I18n.t("gallery.back_to_photos"),:class=>"icon-arrow-left icon-black")),"",:class=>"bt-back btn pull-left btn-primary",:title=>I18n.t("gallery.back_to_photos")%>
|
<%= link_to (content_tag(:i,I18n.t("gallery.back_to_photos"),:class=>"icon-arrow-left icon-black")),"",:class=>"bt-back btn pull-left btn-primary",:title=>I18n.t("gallery.back_to_photos")%>
|
||||||
|
|
||||||
<% if is_admin? %>
|
|
||||||
<!-- #TODO or類別屬於他 -->
|
|
||||||
<%= link_to (content_tag(:i,I18n.t(:edit),:class=>"icon-pencil icon-white")),edit_panel_gallery_back_end_album_path(@album),:class=>"bt-edit btn btn-primary pull-right",:title=>I18n.t(:edit)%>
|
|
||||||
<%= link_to (content_tag(:i,I18n.t("gallery.photo_tag"),:class=>"icon-pencil icon-white")),'#tags',:class=>"bt-tag btn btn-primary pull-right",:title=>I18n.t("gallery.photo_tag")%>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% content_for :page_specific_javascript do %>
|
<% content_for :page_specific_javascript do %>
|
||||||
|
<%= javascript_include_tag "rss" %>
|
||||||
<%= javascript_include_tag "galleryAPI" %>
|
<%= javascript_include_tag "galleryAPI" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
galleryAPI.prototype.locale = "<%= I18n.locale %>";
|
galleryAPI.prototype.locale = "<%= I18n.locale %>";
|
||||||
var gallery = new galleryAPI();
|
var gallery = new galleryAPI();
|
||||||
gallery.initialize();
|
|
||||||
gallery.loadArea = "theater";
|
gallery.loadArea = "theater";
|
||||||
gallery.loadTheater("<%= params[:id] %>");
|
gallery.loadTheater("<%= params[:id] %>");
|
||||||
</script>
|
</script>
|
||||||
|
|
24
vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/_album.html.erb
vendored
Normal file
24
vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/_album.html.erb
vendored
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<li class="rgalbum">
|
||||||
|
<a href="<%= panel_gallery_back_end_album_path(album) %>">
|
||||||
|
<% if album.cover == "default" %>
|
||||||
|
<%= image_tag "gallery/default.jpg" %>
|
||||||
|
<% else %>
|
||||||
|
<img src="<%= album.cover_path %>">
|
||||||
|
<% end %>
|
||||||
|
<span></span>
|
||||||
|
<p class="albumname"><%= album.name %></p>
|
||||||
|
</a>
|
||||||
|
<ul class="gallery_info clearfix">
|
||||||
|
<li class="view"><i class="icons-eye"></i> 321</li>
|
||||||
|
<li><i class="icons-tag"></i></li>
|
||||||
|
<li class="albumcateg"><%= @categories.find(album.category_id).title %></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="albumtag">
|
||||||
|
<li class="label">Fake Tag</li>
|
||||||
|
<li class="label">Fake Tag</li>
|
||||||
|
<li class="label">Fake Tag</li>
|
||||||
|
<li class="label">Fake Tag</li>
|
||||||
|
<li class="label">Fake Tag</li>
|
||||||
|
<li class="label">Fake Tag</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
5
vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/_image.html.erb
vendored
Normal file
5
vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/_image.html.erb
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<li class="rgalbum" data-image-id="<%= image.id.to_s %>">
|
||||||
|
<a href="<%= panel_gallery_back_end_album_image_path(image) %>">
|
||||||
|
<img src="<%= image.file.thumb %>">
|
||||||
|
</a>
|
||||||
|
</li>
|
|
@ -1,79 +1,73 @@
|
||||||
<%= stylesheet_link_tag "gallery" %>
|
<%= stylesheet_link_tag "gallery" %>
|
||||||
|
<%#= stylesheet_link_tag "filter" %>
|
||||||
|
|
||||||
<div id="filter" class="subnav">
|
<!-- Top Nav -->
|
||||||
<ul class="nav nav-pills filter">
|
<div id="filter" class="topnav clearfix">
|
||||||
<li class="accordion-group">
|
<!--<ul class="breadcrumb text-info pull-left">
|
||||||
<div class="accordion-heading">
|
<li><a href="/orbit_4.0.1/admin/dashboards/dashboards.shtml">Dashboard</a> <span class="divider">/</span></li>
|
||||||
<a href="#collapse-categories" data-toggle="collapse" data-parent=".filters" class="accordion-toggle"><%= t("gallery.category") %> <b class="web-symbol"></b></a>
|
<li class="active">Gallery</li>
|
||||||
</div>
|
</ul> -->
|
||||||
</li>
|
|
||||||
<li class="accordion-group">
|
<div class="searchClear pull-right">
|
||||||
<div class="accordion-heading">
|
<form>
|
||||||
<a href="#collapse-tags" data-toggle="collapse" data-parent=".filters" class="accordion-toggle"><%= t("gallery.tag") %> <b class="web-symbol"></b></a>
|
<input id="filter-input" class="search-query input-medium" type="text" placeholder="Search" value="">
|
||||||
</div>
|
</form>
|
||||||
</li>
|
</div>
|
||||||
</ul>
|
<ul class="nav nav-pills filter-nav pull-right">
|
||||||
<div class="filters">
|
<li class="accordion-group">
|
||||||
<div class="accordion-body collapse" id="collapse-categories">
|
<div class="accordion-heading">
|
||||||
<div class="accordion-inner filter_btns cats" data-toggle="buttons-checkbox">
|
<a href="#collapse-category" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Categories</a>
|
||||||
<% @categorylist.each do |category| %>
|
</div>
|
||||||
<a href="cat=<%= category.id %>" class="btn" onclick="return false;"><%= category.name %></a>
|
</li>
|
||||||
|
<li class="accordion-group">
|
||||||
|
<div class="accordion-heading">
|
||||||
|
<a href="#collapse-tags" data-toggle="collapse" data-parent="#filter" class="accordion-toggle">Tags</a>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="filter-group accordion-group">
|
||||||
|
<div class="accordion-body collapse" id="collapse-category">
|
||||||
|
<div class="accordion-inner pagination-right" data-toggle="buttons-checkbox">
|
||||||
|
<% @categories.each do |c| %>
|
||||||
|
<a href="#" class="btn btn-small"><%= c.title %></a>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="filter-clear">
|
||||||
|
<a href="#" class="btn btn-link btn-small"><i class="icons-cycle"></i>Clear</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="accordion-body collapse" id="collapse-tags">
|
||||||
|
<div class="accordion-inner pagination-right" data-toggle="buttons-checkbox">
|
||||||
|
<a href="#" class="btn btn-small">Tags1</a>
|
||||||
|
<a href="#" class="btn btn-small">Tags2</a>
|
||||||
|
<a href="#" class="btn btn-small">Tags3</a>
|
||||||
|
<a href="#" class="btn btn-small">Tags4</a>
|
||||||
|
</div>
|
||||||
|
<div class="filter-clear">
|
||||||
|
<a href="#" class="btn btn-link btn-small"><i class="icons-cycle"></i>Clear</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Bottom Nav -->
|
||||||
|
<div class="bottomnav clearfix">
|
||||||
|
<div class="action pull-right">
|
||||||
|
<a href="<%= new_panel_gallery_back_end_album_path %>" class="btn btn-primary"><i class="icons-plus"></i> Add New</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul id="orbit_gallery" class="gallery" data-gallery-id="gallery">
|
||||||
|
<% @albums.each do |album| %>
|
||||||
|
<%= render :partial => "album", :object => album %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</ul>
|
||||||
<div class="filter-clear">
|
|
||||||
<a href="" class="btn" onclick="return false;" for="cats"><i class="icons-cycle"></i>清除</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="accordion-body collapse" id="collapse-tags">
|
|
||||||
<div class="accordion-inner filter_btns tags" data-toggle="buttons-checkbox">
|
|
||||||
<% @tags.each do |tag| %>
|
|
||||||
<a href="tag=<%= tag.id %>" class="btn" onclick="return false;"><%= tag.name %></a>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<div class="filter-clear">
|
|
||||||
<a href="" class="btn" onclick="return false;" for="tags"><i class="icons-cycle" ></i>清除</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="orbit_gallery" class="rg">
|
|
||||||
<div class="rgbody">
|
|
||||||
<div id="imgholder">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% if is_sub_manager? %>
|
|
||||||
<div class="form-actions form-fixed pagination-right rghead">
|
|
||||||
<div class="rgfn">
|
|
||||||
|
|
||||||
<a class="btn btn-primary pull-right" title="<%= I18n.t("gallery.add_album") %>" href="<%= new_panel_gallery_back_end_album_path %>" onclick="return false;"><i class="icon-plus icon-white"></i><%= I18n.t("gallery.add_album") %></a>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<%end %>
|
|
||||||
</div>
|
|
||||||
<% content_for :page_specific_javascript do %>
|
<% content_for :page_specific_javascript do %>
|
||||||
<%= javascript_include_tag "galleryAPI" %>
|
<%= javascript_include_tag "jquery.masonry.min.js" %>
|
||||||
|
<%= javascript_include_tag "jquery.mu.image.resize.js" %>
|
||||||
|
<%= javascript_include_tag "gallery" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
galleryAPI.prototype.locale = "<%= I18n.locale %>";
|
|
||||||
var gallery = new galleryAPI();
|
|
||||||
gallery.initialize();
|
|
||||||
if(typeof gallery.urlVars['cat']!= "undefined"){
|
|
||||||
gallery.loadArea = "albums";
|
|
||||||
gallery.loadAlbums(gallery.urlVars['cat']);
|
|
||||||
}else if(typeof gallery.urlVars['tag']!= "undefined"){
|
|
||||||
gallery.loadArea = "albums";
|
|
||||||
gallery.loadAlbums(gallery.urlVars['tag']);
|
|
||||||
}else{
|
|
||||||
gallery.loadArea = "albums";
|
|
||||||
g.loadAlbums("all");
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,51 +1,108 @@
|
||||||
<div class="modal-window" id="categories">
|
<%= form_for @album, :url => {:action => "create"}, :class=>"form-horizontal main-forms" do |f| %>
|
||||||
<div class="modal-header">
|
<fieldset>
|
||||||
<h3><%= t("gallery.add_album") %></h3>
|
<!-- Input Area -->
|
||||||
</div>
|
<div class="input-area">
|
||||||
<%= form_for @album, :url => {:action => "create"}, :remote => true do |f| %>
|
|
||||||
<div class="modal-body add-album">
|
|
||||||
<div> <%= f.select(:gallery_category_id, GalleryCategory.all.collect {|p| [ p.name, p.id ] },{:prompt => t("gallery.select_category")},:class => "validate input-xlarge") %> </div>
|
|
||||||
<ul class="nav nav-tabs">
|
|
||||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
|
||||||
<li class=<%= ( i == 0 ) ? "active" : "" %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
||||||
<div class="tab_content form-horizontal">
|
|
||||||
<%= f.fields_for :name_translations do |name| %>
|
|
||||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
|
||||||
<% if i == 0 %>
|
|
||||||
<div class="<%= locale %> fade tab-pane in active">
|
|
||||||
<% else %>
|
|
||||||
<div class="<%= locale %> fade tab-pane" >
|
|
||||||
<% end %>
|
|
||||||
<p class="control-group">
|
|
||||||
<%= label_tag(locale, t("gallery.album_name")) %>
|
|
||||||
<%= name.text_field locale, :class => (locale == "zh_tw") ? "validate" : "" + "input-xlarge" %>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
<%= f.fields_for :description_translations do |desc| %>
|
|
||||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
|
||||||
<% if i == 0 %>
|
|
||||||
<div class="<%= locale %> fade tab-pane in active">
|
|
||||||
<% else %>
|
|
||||||
<div class="<%= locale %> fade tab-pane" >
|
|
||||||
<% end %>
|
|
||||||
<p class="control-group">
|
|
||||||
<%= label_tag(locale, t("gallery.album_desc")) %>
|
|
||||||
<%= desc.text_field locale, :class => "input-xlarge" %>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<a href="#" class="btn" data-dismiss="modal" id="album_name_close_btn" onclick="return false;"><%= t(:close) %></a>
|
|
||||||
<!-- <a href="#" class="btn btn-primary" id="album_name_save_btn" onclick="return false;"><%#= t("gallery.save_changes") %></a> -->
|
|
||||||
<%= f.submit t("gallery.save"), :class=> "btn btn-primary bt-form-save" %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<!-- Module Tabs -->
|
||||||
|
<div class="nav-name"><strong>Module</strong></div>
|
||||||
|
<ul class="nav nav-pills module-nav">
|
||||||
|
<li class="active">
|
||||||
|
<a href="#basic" data-toggle="tab">Basic</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="#tag" data-toggle="tab">Tags</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<!-- Module -->
|
||||||
|
<div class="tab-content module-area">
|
||||||
|
|
||||||
|
<!-- Basic Module -->
|
||||||
|
<div class="tab-pane fade in active" id="basic">
|
||||||
|
|
||||||
|
<!-- Category -->
|
||||||
|
<div class="control-group">
|
||||||
|
<label class="control-label muted">Category</label>
|
||||||
|
<div class="controls">
|
||||||
|
<%= f.select(:category_id, @categories.collect {|p| [ p.title, p.id ] },{:prompt => t("gallery.select_category")}) %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- Tag Module -->
|
||||||
|
<div class="tab-pane fade" id="tag">
|
||||||
|
|
||||||
|
<!-- Tag -->
|
||||||
|
<div class="control-group">
|
||||||
|
<label class="control-label muted">Tag</label>
|
||||||
|
<div class="controls" data-toggle="buttons-checkbox">
|
||||||
|
<label class="checkbox inline btn">
|
||||||
|
<input type="checkbox" value="1"> Tag1
|
||||||
|
</label>
|
||||||
|
<label class="checkbox inline btn">
|
||||||
|
<input type="checkbox" value="2"> Tag2
|
||||||
|
</label>
|
||||||
|
<label class="checkbox inline btn">
|
||||||
|
<input type="checkbox" value="3"> Tag3
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="nav-name"><strong>Language</strong></div>
|
||||||
|
<ul class="nav nav-pills language-nav">
|
||||||
|
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||||
|
<% if i == 0 %>
|
||||||
|
<li class="active">
|
||||||
|
<a href=".en" data-toggle="tab">English</a>
|
||||||
|
</li>
|
||||||
|
<% else %>
|
||||||
|
<li>
|
||||||
|
<a href=".tw_zh" data-toggle="tab">Chinese</a>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
<div class="tab-content language-area">
|
||||||
|
<!-- Language Tabs -->
|
||||||
|
|
||||||
|
|
||||||
|
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||||
|
<% if i == 0 %>
|
||||||
|
<div class="tab-pane fade in active en">
|
||||||
|
<% else %>
|
||||||
|
<div class="tab-pane fade tw_zh">
|
||||||
|
<% end %>
|
||||||
|
<div class="control-group input-title">
|
||||||
|
<%= f.fields_for :name_translations do |name| %>
|
||||||
|
<%= label_tag(locale, t("gallery.album_name"),:class=>"control-label muted") %>
|
||||||
|
<div class="controls">
|
||||||
|
<%= name.text_field locale, :class => "input-block-level", :placeholder=>"Title" %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="control-group input-content">
|
||||||
|
<%= f.fields_for :description_translations do |desc| %>
|
||||||
|
<%= label_tag(locale, t("gallery.album_desc"), :class=>"control-label muted") %>
|
||||||
|
<div class="controls">
|
||||||
|
<div class="textarea">
|
||||||
|
<%= desc.text_area locale, :class => "ckeditor input-block-level" %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- Form Actions -->
|
||||||
|
<div class="form-actions">
|
||||||
|
<%= f.submit t("gallery.save"), :class=> "btn btn-primary bt-form-save" %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</fieldset>
|
||||||
|
<% end %>
|
||||||
|
|
3
vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/new_images.html.erb
vendored
Normal file
3
vendor/built_in_modules/gallery/app/views/panel/gallery/back_end/albums/new_images.html.erb
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<% @newimages.each do |image| %>
|
||||||
|
<%= render :partial=>"image", :object=>image %>
|
||||||
|
<% end %>
|
|
@ -1,98 +1,175 @@
|
||||||
|
|
||||||
<%= stylesheet_link_tag "gallery" %>
|
<%= stylesheet_link_tag "gallery" %>
|
||||||
|
|
||||||
<div id="orbit_gallery" class="rg">
|
<!-- <div class="topnav clearfix">
|
||||||
<div class="rgbody">
|
<ul class="breadcrumb text-info pull-left">
|
||||||
<div id="imgholder">
|
<li><a href="/orbit_4.0.1/admin/dashboards/dashboards.shtml">Dashboard</a> <span class="divider">/</span></li>
|
||||||
|
<li><a href="<%= panel_gallery_back_end_albums_path %>">Gallery</a> <span class="divider">/</span></li>
|
||||||
</div>
|
<li class="active"><%= @album.name %></li>
|
||||||
|
</ul>
|
||||||
|
</div> -->
|
||||||
|
<!-- Bottom Nav -->
|
||||||
|
<div class="bottomnav clearfix">
|
||||||
|
<div class="action pull-left">
|
||||||
|
<a href="<%= panel_gallery_back_end_albums_path %>" class="btn"><i class="icons-back"></i> Back</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="action pull-right">
|
||||||
<% if is_sub_manager? #TODO 或 這類別是他自己的 %>
|
<a href="#" class="btn btn-success"><i class="icon-edit"></i> Edit</a>
|
||||||
|
<%= link_to (content_tag(:i,"",:class=>"icon-trash")), panel_gallery_back_end_album_path(@album), :class=>"btn btn-danger", :confirm => "Are you sure?", :method=>:delete %>
|
||||||
<!-- tag part -->
|
<a href="#" class="add-imgs btn btn-primary"><i class="icons-plus"></i> Add Image</a>
|
||||||
<div id="tag_panel" class="my_scroll">
|
</div>
|
||||||
<div class="scrollbar">
|
<form action="<%= panel_gallery_back_end_upload_image_path %>", id='fileupload'>
|
||||||
<div class="track">
|
<!-- Redirect browsers with JavaScript disabled to the origin page -->
|
||||||
<div class="thumb">
|
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
|
||||||
<div class="end"></div>
|
<div class="fileupload-buttonbar">
|
||||||
|
<div class="navbar">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<ul class="nav">
|
||||||
|
<li>
|
||||||
|
<div class="fileinput-button">
|
||||||
|
<i class="icon-plus icon-white"></i>
|
||||||
|
<span>Add files...</span>
|
||||||
|
<input type="file" name="files[]" multiple>
|
||||||
|
</div>
|
||||||
|
<input type="hidden" value="<%= @album.id.to_s %>" name="album_id" id="fileupload_aid" />
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button type="submit" class="start">
|
||||||
|
<i class="icon-upload icon-white"></i>
|
||||||
|
<span>Start upload</span>
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button type="reset" class="cancel">
|
||||||
|
<i class="icon-ban-circle icon-white"></i>
|
||||||
|
<span>Cancel upload</span>
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
<!-- <li>
|
||||||
|
<button type="button" class="delete">
|
||||||
|
<i class="icons-trash icon-white"></i>
|
||||||
|
<span>Delete</span>
|
||||||
|
</button>
|
||||||
|
</li> -->
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- The global progress information -->
|
||||||
|
<div class="fileupload-progress">
|
||||||
|
<!-- The global progress bar -->
|
||||||
|
<div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
|
||||||
|
<div class="bar" style="width:0%;"></div>
|
||||||
|
</div>
|
||||||
|
<!-- The extended global progress information -->
|
||||||
|
<div class="progress-extended"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<%
|
<!-- Drop Zone -->
|
||||||
@locales = Array.new
|
<div id="dropzone" class="drop">
|
||||||
@site_valid_locales.each do |locale|
|
<div data-icons=""></div>
|
||||||
@locales << locale
|
Drop files here
|
||||||
end
|
</div>
|
||||||
%>
|
<!-- The loading indicator is shown during file processing -->
|
||||||
<div class="viewport">
|
<div class="fileupload-loading"></div>
|
||||||
<div class="overview">
|
<!-- The table listing the files available for upload/download -->
|
||||||
<ul class="tag_list" id="gallery_tag_list">
|
<div id="file-list" class="nano">
|
||||||
<% @tags.each do |tag| %>
|
<div class="content">
|
||||||
<li data-content="<%= tag.id %>"><input id="tag_<%= tag.id %>" type="checkbox"><label for="tag_<%= tag.id %>"><%= tag.name %></label><span style="display:none;"><%= tag[@locales[1]] %> <%= tag[@locales[0]] %></span></li>
|
<ul role="presentation" class="files clearfix">
|
||||||
<% end %>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tag_search"><div class="icon-search"></div><input type="text" value="<%= t('gallery.search_tags') %>" onblur="if(this.value=='')this.value='<%= t('gallery.search_tags') %>';" onfocus="if(this.value=='<%= t("gallery.search_tags") %>')this.value='';" id="tag_search_box"> <div class="tag_save"><a class="btn bt-save"><i class="icon-ok"></i><%= I18n.t("gallery.save") %></a></div></div>
|
</form>
|
||||||
<%end%>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
var $tag_panel = $('#tag_panel');
|
|
||||||
orbit_bar_height = $('#orbit-bar').outerHeight();
|
|
||||||
action_panel_height = $('.form-actions').outerHeight();
|
|
||||||
window_height = $(window).height();
|
|
||||||
|
|
||||||
|
|
||||||
$tag_panel.height( window_height - orbit_bar_height - 90 );
|
|
||||||
$tag_panel.tinyscrollbar();
|
|
||||||
|
|
||||||
$(window).resize(function(){
|
|
||||||
$tag_panel.tinyscrollbar_update('relative');
|
|
||||||
$tag_panel.height( $(window).height() - orbit_bar_height - 90 );
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
|
||||||
<!-- tag end -->
|
|
||||||
<div class="form-actions form-fixed pagination-right rghead">
|
|
||||||
<div class="rgfn">
|
|
||||||
<%= link_to (content_tag(:i,I18n.t("gallery.back_to_albums"),:class=>"icon-arrow-left icon-white")),panel_gallery_back_end_albums_path,:title=> I18n.t("gallery.back_to_albums") ,:class=>"bt-back btn btn-primary pull-left" %>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<%= link_to( (content_tag(:i,I18n.t("gallery.album_tag"),:class=>"icon-tag icon-white")),'',:title=> I18n.t("gallery.album_tag") ,:class=>"bt-tag btn btn-primary pull-right")if is_admin? %>
|
|
||||||
<!-- #TODO 或是類別屬於他 -->
|
|
||||||
|
|
||||||
<%= link_to (content_tag(:i,I18n.t("gallery.add_images"),:class=>"icon-plus icon-white")),'images',:title=> I18n.t("gallery.add_images") ,:class=>"bt-add btn btn-primary pull-right",:onclick=>"return false;" if is_admin?%>
|
|
||||||
<!-- #TODO 或是類別屬於他 -->
|
|
||||||
|
|
||||||
<%= link_to (content_tag(:i,I18n.t("gallery.del_album"),:class=>"icon-trash icon-white")),'delete',:title=> I18n.t("gallery.del_album") ,:class=>"bt-del btn btn-primary pull-right",:onclick=>"return false;" if is_admin?%>
|
|
||||||
<!-- #TODO 或是類別屬於他 -->
|
|
||||||
|
|
||||||
<%= link_to (content_tag(:i,I18n.t(:edit),:class=>"icon-plus icon-white")),edit_panel_gallery_back_end_album_path(@album),:title=> I18n.t(:edit) ,:class=>"bt-edit btn btn-primary pull-right" if is_admin?%>
|
|
||||||
<!-- #TODO 或是類別屬於他 -->
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="rgbody">
|
||||||
|
<div class="gallery-info">
|
||||||
|
<h3><%= @album.name %></h3>
|
||||||
|
<p class="muted"><%= @album.description %></p>
|
||||||
|
</div>
|
||||||
|
<ul id="imgholder" class="gallery clearfix" data-gallery-id="album">
|
||||||
|
<% @images.each do |image| %>
|
||||||
|
<%= render :partial=>"image", :object=>image %>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% content_for :page_specific_javascript do %>
|
<% content_for :page_specific_javascript do %>
|
||||||
<%= javascript_include_tag "galleryAPI" %>
|
<%= javascript_include_tag "jquery.masonry.min.js" %>
|
||||||
<% end %>
|
<%= javascript_include_tag "jquery.mu.image.resize.js" %>
|
||||||
|
<%= javascript_include_tag "gallery" %>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<%= javascript_include_tag "file-upload/vendor/jquery.ui.widget.js" %>
|
||||||
galleryAPI.prototype.locale = "<%= I18n.locale %>";
|
<%= javascript_include_tag "file-upload/tmpl.min.js" %>
|
||||||
var gallery = new galleryAPI();
|
<%= javascript_include_tag "file-upload/load-image.min.js" %>
|
||||||
gallery.initialize();
|
<%= javascript_include_tag "file-upload/canvas-to-blob.min.js" %>
|
||||||
gallery.loadArea = "images";
|
<%= javascript_include_tag "file-upload/jquery.iframe-transport.js" %>
|
||||||
gallery.loadImages("<%= params[:id] %>");
|
<%= javascript_include_tag "file-upload/jquery.fileupload.js" %>
|
||||||
|
<%= javascript_include_tag "file-upload/jquery.fileupload-fp.js" %>
|
||||||
|
<%= javascript_include_tag "file-upload/jquery.fileupload-ui.js" %>
|
||||||
|
<%= javascript_include_tag "file-upload/main.js" %>
|
||||||
|
<%= javascript_include_tag "file-upload/drop-zone.js" %>
|
||||||
|
<% end %>
|
||||||
|
<!-- The template to display files available for upload -->
|
||||||
|
<script id="template-upload" type="text/x-tmpl">
|
||||||
|
{% for (var i=0, file; file=o.files[i]; i++) { %}
|
||||||
|
<li class="template-upload fade">
|
||||||
|
<ul class="clearfix">
|
||||||
|
<li class="action-bnt">
|
||||||
|
{% if (o.files.valid && !i) { %}
|
||||||
|
<div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
|
||||||
|
<div class="bar" style="width:0%;"></div>
|
||||||
|
</div>
|
||||||
|
{% if (!o.options.autoUpload) { %}
|
||||||
|
<button class="btn btn-primary start">
|
||||||
|
<i class="icon-upload icon-white"></i>
|
||||||
|
</button>
|
||||||
|
{% } %}
|
||||||
|
{% } %}
|
||||||
|
{% if (!i) { %}
|
||||||
|
<button class="btn btn-warning cancel">
|
||||||
|
<i class="icon-ban-circle icon-white"></i>
|
||||||
|
</button>
|
||||||
|
{% } %}
|
||||||
|
</li>
|
||||||
|
<li class="preview pull-left"><span class="fade"></span></li>
|
||||||
|
<li class="name-size">
|
||||||
|
<p>{%=file.name%}</p>
|
||||||
|
{% if (file.error) { %}
|
||||||
|
<p class="error"><span class="label label-important">Error</span> {%=file.error%}</p>
|
||||||
|
{% } else if (o.files.valid && !i) { %}
|
||||||
|
<p class="label label-info">{%=o.formatFileSize(file.size)%}</p>
|
||||||
|
{% } %}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
{% } %}
|
||||||
|
</script>
|
||||||
|
<!-- The template to display files available for download -->
|
||||||
|
<script id="template-download" type="text/x-tmpl">
|
||||||
|
{% for (var i=0, file; file=o.files[i]; i++) { %}
|
||||||
|
<li class="template-download fade">
|
||||||
|
<ul class="clearfix">
|
||||||
|
{% if (file.error) { %}
|
||||||
|
<li class="name-size">
|
||||||
|
<p>{%=file.name%}</p>
|
||||||
|
<p class="error"><span class="label label-important">Error</span> {%=file.error%}</p>
|
||||||
|
</li>
|
||||||
|
{% } else { %}
|
||||||
|
<li class="preview">
|
||||||
|
{% if (file.thumbnail_url) { %}
|
||||||
|
<a href="{%=file.url%}" title="{%=file.name%}" data-gallery="gallery" download="{%=file.name%}"><img src="{%=file.thumbnail_url%}"></a>
|
||||||
|
{% } %}
|
||||||
|
</li>
|
||||||
|
<li class="name-size">
|
||||||
|
<p><a href="{%=file.url%}" title="{%=file.name%}" data-gallery="{%=file.thumbnail_url&&'gallery'%}" download="{%=file.name%}">{%=file.name%}</a></p>
|
||||||
|
<p ><span class="label label-success">Success</span> File uploaded successfully!</p>
|
||||||
|
<p class="label label-info">{%=o.formatFileSize(file.size)%}</p>
|
||||||
|
</li>
|
||||||
|
{% } %}
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
{% } %}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<body>
|
<body>
|
||||||
<div id='scroller_for_panel'>
|
<div id='scroller_for_panel'>
|
||||||
<div id="fileupload">
|
<div id="fileupload">
|
||||||
<%= form_for @album, :url => panel_gallery_back_end_upload_image_path(@album), :html => {:class => 'clear'} do |f| %>
|
<%= form_for @album, :url => panel_gallery_back_end_upload_image_path, :html => {:class => 'clear'} do |f| %>
|
||||||
<div class="fileupload-buttonbar">
|
<div class="fileupload-buttonbar">
|
||||||
<label class="fileinput-button">
|
<label class="fileinput-button">
|
||||||
<span>Add files...</span>
|
<span>Add files...</span>
|
||||||
|
|
|
@ -7,6 +7,7 @@ Rails.application.routes.draw do
|
||||||
match "upload_image" => "albums#upload_image"
|
match "upload_image" => "albums#upload_image"
|
||||||
match "save_tags" => "tags#save_tags"
|
match "save_tags" => "tags#save_tags"
|
||||||
match "albums/save_tags" => "tags#save_tags"
|
match "albums/save_tags" => "tags#save_tags"
|
||||||
|
match "new_images" => "albums#new_images"
|
||||||
|
|
||||||
resources :albums do
|
resources :albums do
|
||||||
match "set_cover" => "albums#set_cover"
|
match "set_cover" => "albums#set_cover"
|
||||||
|
@ -15,6 +16,7 @@ Rails.application.routes.draw do
|
||||||
match "images_tags" => "albums#images_tags"
|
match "images_tags" => "albums#images_tags"
|
||||||
match "get_imgs_json" => "albums#get_imgs_json"
|
match "get_imgs_json" => "albums#get_imgs_json"
|
||||||
|
|
||||||
|
|
||||||
collection do
|
collection do
|
||||||
get "get_album_json"
|
get "get_album_json"
|
||||||
end
|
end
|
||||||
|
|
Reference in New Issue