Run pre-commit on legacy code
This commit is contained in:
parent
fea11ac752
commit
83b7e4162e
323 changed files with 6126 additions and 6462 deletions
|
@ -47,4 +47,4 @@ var AIRTIME = (function(AIRTIME) {
|
|||
|
||||
return AIRTIME;
|
||||
|
||||
}(AIRTIME || {}));
|
||||
}(AIRTIME || {}));
|
||||
|
|
|
@ -8,7 +8,7 @@ function isAudioSupported(mime){
|
|||
|
||||
var bMime = null;
|
||||
if (mime.indexOf("ogg") != -1 || mime.indexOf("vorbis") != -1) {
|
||||
bMime = 'audio/ogg; codecs="vorbis"';
|
||||
bMime = 'audio/ogg; codecs="vorbis"';
|
||||
} else {
|
||||
bMime = mime;
|
||||
}
|
||||
|
@ -17,8 +17,8 @@ function isAudioSupported(mime){
|
|||
//file is an mp3 and flash is installed (jPlayer will fall back to flash to play mp3s).
|
||||
//Note that checking the navigator.mimeTypes value does not work for IE7, but the alternative
|
||||
//is adding a javascript library to do the work for you, which seems like overkill....
|
||||
return (!!audio.canPlayType && audio.canPlayType(bMime) != "") ||
|
||||
return (!!audio.canPlayType && audio.canPlayType(bMime) != "") ||
|
||||
(mime.indexOf("mp3") != -1 && navigator.mimeTypes ["application/x-shockwave-flash"] != undefined) ||
|
||||
(mime.indexOf("mp4") != -1 && navigator.mimeTypes ["application/x-shockwave-flash"] != undefined) ||
|
||||
(mime.indexOf("mpeg") != -1 && navigator.mimeTypes ["application/x-shockwave-flash"] != undefined);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,12 +109,12 @@ function getDatatablesStrings(overrideDict) {
|
|||
}
|
||||
|
||||
function adjustDateToServerDate(date, serverTimezoneOffset){
|
||||
//date object stores time in the browser's localtime. We need to artificially shift
|
||||
//it to
|
||||
//date object stores time in the browser's localtime. We need to artificially shift
|
||||
//it to
|
||||
var timezoneOffset = date.getTimezoneOffset()*60*1000;
|
||||
|
||||
|
||||
date.setTime(date.getTime() + timezoneOffset + serverTimezoneOffset*1000);
|
||||
|
||||
|
||||
/* date object has been shifted to artificial UTC time. Now let's
|
||||
* shift it to the server's timezone */
|
||||
return date;
|
||||
|
@ -130,13 +130,13 @@ var _preview_window = null;
|
|||
*/
|
||||
function openAudioPreview(p_event) {
|
||||
p_event.stopPropagation();
|
||||
|
||||
|
||||
var audioFileID = $(this).attr('audioFile');
|
||||
var objId = $('.obj_id:first').attr('value');
|
||||
var objType = $('.obj_type:first').attr('value');
|
||||
var playIndex = $(this).parent().parent().attr('id');
|
||||
playIndex = playIndex.substring(4); //remove the spl_
|
||||
|
||||
|
||||
if (objType == "playlist") {
|
||||
open_playlist_preview(objId, playIndex);
|
||||
} else if (objType == "block") {
|
||||
|
@ -161,8 +161,8 @@ function open_audio_preview(type, id) {
|
|||
function open_playlist_preview(p_playlistID, p_playlistIndex) {
|
||||
if (p_playlistIndex == undefined) //Use a resonable default.
|
||||
p_playlistIndex = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
if (_preview_window != null && !_preview_window.closed)
|
||||
_preview_window.playAllPlaylist(p_playlistID, p_playlistIndex);
|
||||
else
|
||||
|
@ -173,7 +173,7 @@ function open_playlist_preview(p_playlistID, p_playlistIndex) {
|
|||
function open_block_preview(p_blockId, p_blockIndex) {
|
||||
if (p_blockIndex == undefined) //Use a resonable default.
|
||||
p_blockIndex = 0;
|
||||
|
||||
|
||||
if (_preview_window != null && !_preview_window.closed)
|
||||
_preview_window.playBlock(p_blockId, p_blockIndex);
|
||||
else
|
||||
|
@ -190,7 +190,7 @@ function open_block_preview(p_blockId, p_blockIndex) {
|
|||
function open_show_preview(p_showID, p_showIndex) {
|
||||
if (_preview_window != null && !_preview_window.closed)
|
||||
_preview_window.playAllShow(p_showID, p_showIndex);
|
||||
else
|
||||
else
|
||||
openPreviewWindow(baseUrl+'audiopreview/show-preview/showID/'+p_showID+'/showIndex/'+p_showIndex, previewWidth, previewHeight);
|
||||
_preview_window.focus();
|
||||
}
|
||||
|
@ -268,7 +268,7 @@ function pad(number, length) {
|
|||
|
||||
function removeSuccessMsg() {
|
||||
var $status = $('.success');
|
||||
|
||||
|
||||
$status.fadeOut("slow", function(){$status.empty()});
|
||||
}
|
||||
|
||||
|
|
|
@ -86,4 +86,3 @@ var AIRTIME = (function(AIRTIME) {
|
|||
return AIRTIME;
|
||||
|
||||
}(AIRTIME || {}));
|
||||
|
||||
|
|
|
@ -15,27 +15,27 @@ function popup(mylink){
|
|||
* a javascript date object representing this date. */
|
||||
function getDateFromString(time){
|
||||
var date = time.split("-");
|
||||
|
||||
|
||||
if (date.length != 3){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
var year = parseInt(date[0], 10);
|
||||
var month = parseInt(date[1], 10) -1;
|
||||
var day = parseInt(date[2], 10);
|
||||
|
||||
|
||||
if (isNaN(year) || isNaN(month) || isNaN(day)){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
return new Date(year, month, day);
|
||||
|
||||
|
||||
}
|
||||
|
||||
function convertSecondsToDaysHoursMinutesSeconds(seconds){
|
||||
if (seconds < 0)
|
||||
seconds = 0;
|
||||
|
||||
|
||||
seconds = parseInt(seconds, 10);
|
||||
|
||||
var days = parseInt(seconds / 86400);
|
||||
|
@ -47,26 +47,26 @@ function convertSecondsToDaysHoursMinutesSeconds(seconds){
|
|||
var minutes = parseInt(seconds / 60);
|
||||
seconds -= minutes*60;
|
||||
|
||||
return {days:days, hours:hours, minutes:minutes, seconds:seconds};
|
||||
return {days:days, hours:hours, minutes:minutes, seconds:seconds};
|
||||
}
|
||||
|
||||
/* Takes an input parameter of milliseconds and converts these into
|
||||
* the format HH:MM:SS */
|
||||
function convertToHHMMSS(timeInMS){
|
||||
var time = parseInt(timeInMS);
|
||||
|
||||
|
||||
var hours = parseInt(time / 3600000);
|
||||
time -= 3600000*hours;
|
||||
|
||||
|
||||
var minutes = parseInt(time / 60000);
|
||||
time -= 60000*minutes;
|
||||
|
||||
|
||||
var seconds = parseInt(time / 1000);
|
||||
|
||||
|
||||
hours = hours.toString();
|
||||
minutes = minutes.toString();
|
||||
seconds = seconds.toString();
|
||||
|
||||
|
||||
if (hours.length == 1)
|
||||
hours = "0" + hours;
|
||||
if (minutes.length == 1)
|
||||
|
@ -78,37 +78,37 @@ function convertToHHMMSS(timeInMS){
|
|||
|
||||
function convertToHHMMSSmm(timeInMS){
|
||||
var time = parseInt(timeInMS);
|
||||
|
||||
|
||||
var hours = parseInt(time / 3600000);
|
||||
time -= 3600000*hours;
|
||||
|
||||
|
||||
var minutes = parseInt(time / 60000);
|
||||
time -= 60000*minutes;
|
||||
|
||||
|
||||
var seconds = parseInt(time / 1000);
|
||||
time -= 1000*seconds;
|
||||
|
||||
|
||||
var ms = parseInt(time);
|
||||
|
||||
|
||||
hours = hours.toString();
|
||||
minutes = minutes.toString();
|
||||
seconds = seconds.toString();
|
||||
ms = ms.toString();
|
||||
|
||||
|
||||
if (hours.length == 1)
|
||||
hours = "0" + hours;
|
||||
if (minutes.length == 1)
|
||||
minutes = "0" + minutes;
|
||||
if (seconds.length == 1)
|
||||
seconds = "0" + seconds;
|
||||
|
||||
|
||||
if (ms.length == 3)
|
||||
ms = ms.substring(0, 2);
|
||||
else if (ms.length == 2)
|
||||
ms = "0" + ms.substring(0,1);
|
||||
else if (ms.length == 1)
|
||||
ms = "00";
|
||||
|
||||
|
||||
if (hours == "00")
|
||||
return minutes + ":" + seconds + "." + ms;
|
||||
else
|
||||
|
@ -117,25 +117,25 @@ function convertToHHMMSSmm(timeInMS){
|
|||
|
||||
function convertDateToHHMM(epochTime){
|
||||
var d = new Date(epochTime);
|
||||
|
||||
|
||||
var hours = d.getUTCHours().toString();
|
||||
var minutes = d.getUTCMinutes().toString();
|
||||
|
||||
|
||||
if (hours.length == 1)
|
||||
hours = "0" + hours;
|
||||
if (minutes.length == 1)
|
||||
minutes = "0" + minutes;
|
||||
|
||||
|
||||
return hours + ":" + minutes;
|
||||
}
|
||||
|
||||
function convertDateToHHMMSS(epochTime){
|
||||
var d = new Date(epochTime);
|
||||
|
||||
|
||||
var hours = d.getUTCHours().toString();
|
||||
var minutes = d.getUTCMinutes().toString();
|
||||
var seconds = d.getUTCSeconds().toString();
|
||||
|
||||
|
||||
if (hours.length == 1)
|
||||
hours = "0" + hours;
|
||||
if (minutes.length == 1)
|
||||
|
@ -153,7 +153,7 @@ function convertDateToPosixTime(s){
|
|||
|
||||
var date = datetime[0].split("-");
|
||||
var time = datetime[1].split(":");
|
||||
|
||||
|
||||
var year = date[0];
|
||||
var month = date[1];
|
||||
var day = date[2];
|
||||
|
@ -230,4 +230,3 @@ function isInView(el) {
|
|||
rect.right <= (window.innerWidth || document.documentElement.clientWidth) /*or $(window).width() */
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ function getContent() {
|
|||
}
|
||||
msg += '</ul>';
|
||||
}
|
||||
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
|
|
@ -127,9 +127,9 @@ var AIRTIME = (function(AIRTIME) {
|
|||
var $toolbar = $(".lib-content .fg-toolbar:first");
|
||||
|
||||
mod.createToolbarButtons();
|
||||
|
||||
|
||||
$toolbar.append($menu);
|
||||
|
||||
|
||||
|
||||
// add to playlist button
|
||||
$toolbar
|
||||
|
|
|
@ -388,4 +388,4 @@ var AIRTIME = (function(AIRTIME) {
|
|||
|
||||
return AIRTIME;
|
||||
|
||||
}(AIRTIME || {}));
|
||||
}(AIRTIME || {}));
|
||||
|
|
|
@ -62,12 +62,12 @@ var AIRTIME = (function (AIRTIME) {
|
|||
$scope.createSmartblock = function () {
|
||||
// send smarblock creation instruction to API
|
||||
$.post(
|
||||
endpoint + "smartblock",
|
||||
endpoint + "smartblock",
|
||||
{
|
||||
csrf_token: $("#csrf").val(),
|
||||
csrf_token: $("#csrf").val(),
|
||||
id: $scope.podcast.id,
|
||||
title: $scope.podcast.title
|
||||
},
|
||||
},
|
||||
function() {
|
||||
// show success message
|
||||
var successMsg = $('.active-tab .pc-sb-success')
|
||||
|
@ -77,9 +77,9 @@ var AIRTIME = (function (AIRTIME) {
|
|||
}, 5000);
|
||||
|
||||
// save podcast but do not display notification beside save button below
|
||||
$http.put(endpoint + $scope.podcast.id,
|
||||
$http.put(endpoint + $scope.podcast.id,
|
||||
{
|
||||
csrf_token: $scope.csrf,
|
||||
csrf_token: $scope.csrf,
|
||||
podcast: $scope.podcast
|
||||
})
|
||||
.success(function () {
|
||||
|
@ -596,12 +596,12 @@ var AIRTIME = (function (AIRTIME) {
|
|||
* Delete one or more podcast episodes.
|
||||
*
|
||||
* @param {id:string, type:string}[] data Array of data objects to be deleted
|
||||
* @param podcastId:string
|
||||
* @param podcastId:string
|
||||
*/
|
||||
mod.deleteSelectedEpisodes = function (data, podcastId) {
|
||||
$.each(data, function () {
|
||||
AIRTIME.library.fnDeleteItems(data, podcastId);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -825,7 +825,7 @@ var AIRTIME = (function (AIRTIME) {
|
|||
if (typeof PodcastEpisodeTable === 'undefined') {
|
||||
_initPodcastEpisodeTable();
|
||||
}
|
||||
|
||||
|
||||
var podcastEpisodeTableObj = new PodcastEpisodeTable(
|
||||
domNode, // DOM node to create the table inside.
|
||||
true, // Enable item selection
|
||||
|
|
|
@ -4,7 +4,7 @@ $(document).ready(function() {
|
|||
timeStartId = "#his_time_start",
|
||||
dateEndId = "#his_date_end",
|
||||
timeEndId = "#his_time_end";
|
||||
|
||||
|
||||
// set width dynamically
|
||||
var width = $("#listenerstat_content").width();
|
||||
width = width * .91;
|
||||
|
@ -12,7 +12,7 @@ $(document).ready(function() {
|
|||
$("#listenerstat_content").find("#legend").width(width);
|
||||
|
||||
getDataAndPlot();
|
||||
|
||||
|
||||
listenerstat_content.find("#his_submit").click(function(){
|
||||
var oRange = AIRTIME.utilities.fnGetScheduleRange(dateStartId, timeStartId, dateEndId, timeEndId);
|
||||
var start = oRange.start;
|
||||
|
@ -61,7 +61,7 @@ function plot(datasets){
|
|||
firstTimestamp = new Date(8640000000000000);
|
||||
// smallest
|
||||
lastTimestamp = new Date(0);
|
||||
|
||||
|
||||
data = [];
|
||||
if (doAll != null)
|
||||
{
|
||||
|
@ -74,13 +74,13 @@ function plot(datasets){
|
|||
}
|
||||
data.push(val);
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#legend .legendCB').each(
|
||||
function(){
|
||||
if (this.checked)
|
||||
{
|
||||
{
|
||||
data.push(datasets[this.id]);
|
||||
if (firstTimestamp.getTime() > datasets[this.id].data[0][0].getTime()) {
|
||||
firstTimestamp = datasets[this.id].data[0][0];
|
||||
|
@ -96,10 +96,10 @@ function plot(datasets){
|
|||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
numOfTicks = 10;
|
||||
tickSize = (lastTimestamp.getTime() - firstTimestamp.getTime())/1000/numOfTicks;
|
||||
|
||||
|
||||
plot = $.plot($("#flot_placeholder"), data, {
|
||||
yaxis: { min: 0, tickDecimals: 0, color: '#d6d6d6', tickColor: '#d6d6d6' },
|
||||
xaxis: { mode: "time", timeformat:"%y/%m/%0d %H:%M", tickSize: [tickSize, "second"],
|
||||
|
@ -130,7 +130,7 @@ function plot(datasets){
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function showTooltip(x, y, contents) {
|
||||
$('<div id="tooltip">' + contents + '</div>').css( {
|
||||
position: 'absolute',
|
||||
|
@ -149,10 +149,10 @@ function plot(datasets){
|
|||
if (item) {
|
||||
if (previousPoint != item.dataIndex) {
|
||||
previousPoint = item.dataIndex;
|
||||
|
||||
|
||||
$("#tooltip").remove();
|
||||
var y = item.datapoint[1].toFixed(2);
|
||||
|
||||
|
||||
showTooltip(item.pageX, item.pageY,
|
||||
sprintf($.i18n._("Listener Count on %s: %s"), item.series.label, Math.floor(y)));
|
||||
}
|
||||
|
@ -165,8 +165,8 @@ function plot(datasets){
|
|||
|
||||
$('#legend').find("input").click(function(){setTimeout(plotByChoice,100);});
|
||||
}
|
||||
|
||||
plotByChoice(true);
|
||||
|
||||
plotByChoice(true);
|
||||
oBaseDatePickerSettings = {
|
||||
dateFormat: 'yy-mm-dd',
|
||||
//i18n_months, i18n_days_short are in common.js
|
||||
|
@ -176,7 +176,7 @@ function plot(datasets){
|
|||
$(this).datepicker( "setDate", sDate );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
oBaseTimePickerSettings = {
|
||||
showPeriodLabels: false,
|
||||
showCloseButton: true,
|
||||
|
@ -186,7 +186,7 @@ function plot(datasets){
|
|||
hourText: $.i18n._("Hour"),
|
||||
minuteText: $.i18n._("Minute")
|
||||
};
|
||||
|
||||
|
||||
listenerstat_content.find(dateStartId).datepicker(oBaseDatePickerSettings);
|
||||
listenerstat_content.find(timeStartId).timepicker(oBaseTimePickerSettings);
|
||||
listenerstat_content.find(dateEndId).datepicker(oBaseDatePickerSettings);
|
||||
|
|
|
@ -124,4 +124,4 @@ function showListenerDataTable() {
|
|||
} );
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
$(document).ready(function(){
|
||||
|
||||
|
||||
function doNotShowPopup(){
|
||||
$.get(baseUrl+"Usersettings/donotshowregistrationpopup", {format:"json"});
|
||||
}
|
||||
|
||||
var dialog = $("#register_popup");
|
||||
|
||||
|
||||
dialog.dialog({
|
||||
autoOpen: false,
|
||||
width: 500,
|
||||
|
@ -30,7 +30,7 @@ $(document).ready(function(){
|
|||
{
|
||||
id: "remind_never",
|
||||
text: $.i18n._("Remind me never"),
|
||||
"class": "btn",
|
||||
"class": "btn",
|
||||
click: function() {
|
||||
var url =baseUrl+'Usersettings/remindme-never';
|
||||
$.ajax({
|
||||
|
@ -50,23 +50,23 @@ $(document).ready(function(){
|
|||
}
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
var button = $("#help_airtime");
|
||||
|
||||
|
||||
if($("#link_to_terms_and_condition").length > 0 ){
|
||||
button.removeAttr('disabled').removeClass('ui-state-disabled');
|
||||
}else{
|
||||
button.attr('disabled', 'disabled' ).addClass('ui-state-disabled');
|
||||
}
|
||||
dialog.dialog('open');
|
||||
|
||||
|
||||
|
||||
$('.collapsible-header').live('click',function() {
|
||||
$(this).next().toggle('fast');
|
||||
$(this).toggleClass("close");
|
||||
return false;
|
||||
}).next().hide();
|
||||
|
||||
|
||||
$("#SupportFeedback").live('click', function(){
|
||||
var pub = $("#Publicise");
|
||||
var privacy = $("#Privacy");
|
||||
|
@ -95,7 +95,7 @@ $(document).ready(function(){
|
|||
if( promote.is(":checked")){
|
||||
$("#public-info").show();
|
||||
}
|
||||
|
||||
|
||||
$("#Privacy").live('click', function(){
|
||||
var support = $("#SupportFeedback");
|
||||
var button = $("#help_airtime");
|
||||
|
@ -105,32 +105,32 @@ $(document).ready(function(){
|
|||
button.attr('disabled', 'disabled' ).addClass('ui-state-disabled');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if($("#SupportFeedback").is(':checked') && ($("#Privacy").length == 0 || $("#Privacy").is(':checked'))){
|
||||
button.removeAttr('disabled').removeClass('ui-state-disabled');
|
||||
}else{
|
||||
button.attr('disabled', 'disabled' ).addClass('ui-state-disabled');
|
||||
}
|
||||
|
||||
|
||||
$('.toggle legend').live('click',function() {
|
||||
$('.toggle').toggleClass('closed');
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
$("#Logo").live('change', function(ev){
|
||||
var content, res, logoEl;
|
||||
|
||||
|
||||
content = $(this).val();
|
||||
res = content.match(/(jpg|jpeg|png|gif)$/gi);
|
||||
logoEl = $("#Logo-element");
|
||||
|
||||
|
||||
//not an accepted image extension.
|
||||
if (!res) {
|
||||
var ul, li;
|
||||
|
||||
var ul, li;
|
||||
|
||||
ul = logoEl.find('.errors');
|
||||
li = $("<li/>").append($.i18n._("Image must be one of jpg, jpeg, png, or gif"));
|
||||
|
||||
|
||||
//errors ul has already been created.
|
||||
if (ul.length > 0) {
|
||||
ul.empty()
|
||||
|
@ -142,7 +142,7 @@ $(document).ready(function(){
|
|||
.find(".errors")
|
||||
.append(li);
|
||||
}
|
||||
|
||||
|
||||
$(this).val("");
|
||||
}
|
||||
else {
|
||||
|
@ -150,7 +150,7 @@ $(document).ready(function(){
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function resizeImg(ele, targetWidth, targetHeight){
|
||||
var img = $(ele);
|
||||
|
||||
|
|
|
@ -91,4 +91,3 @@ $(document).ready(function() {
|
|||
clearTimeout(typingTimer);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -3,18 +3,17 @@ function getRandomIdPlayer(max) {
|
|||
}
|
||||
|
||||
function playerhtml5_insert(settings)
|
||||
{
|
||||
atp='';
|
||||
if(settings.autoplay==true) atp='autoplay';
|
||||
{
|
||||
atp='';
|
||||
if(settings.autoplay==true) atp='autoplay';
|
||||
if(settings.forceHTTPS==true&&settings.url.indexOf('https')==-1) settings.url=settings.url.replace(/http/g, 'https');
|
||||
if(settings.replacePort!=''&&settings.replacePort!=false&&settings.replacePort!='false')
|
||||
if(settings.replacePort!=''&&settings.replacePort!=false&&settings.replacePort!='false')
|
||||
{
|
||||
if(settings.replacePortTo!='') settings.replacePortTo=':'+settings.replacePortTo;
|
||||
if(settings.replacePortTo!='') settings.replacePortTo=':'+settings.replacePortTo;
|
||||
settings.url=settings.url.replace(':'+settings.replacePort, settings.replacePortTo);
|
||||
}
|
||||
if(settings.codec=='mp3') settings.codec='mpeg';
|
||||
document.getElementById('html5player_skin').innerHTML += '<div id="div_'+settings.elementId+'" style="" ><audio loop controls id="'+settings.elementId+'" src="'+settings.url+'" '+atp+' type="audio/'+settings.codec+'" >'
|
||||
+'Ihr Browser unterstützt das Element <code>audio</code> nicht.'
|
||||
+'<\/audio><\/div>';
|
||||
+'<\/audio><\/div>';
|
||||
}
|
||||
|
||||
|
|
|
@ -3,16 +3,16 @@ var AIRTIME = (function(AIRTIME) {
|
|||
var $templateDiv;
|
||||
var $templateList;
|
||||
var $fileMDList;
|
||||
|
||||
|
||||
if (AIRTIME.itemTemplate === undefined) {
|
||||
AIRTIME.itemTemplate = {};
|
||||
}
|
||||
mod = AIRTIME.itemTemplate;
|
||||
|
||||
|
||||
//config: name, type, filemd, required
|
||||
function createTemplateLi(config) {
|
||||
|
||||
var templateRequired =
|
||||
|
||||
var templateRequired =
|
||||
"<li " +
|
||||
"data-name='<%= name %>' " +
|
||||
"data-type='<%= type %>' " +
|
||||
|
@ -23,8 +23,8 @@ var AIRTIME = (function(AIRTIME) {
|
|||
"<span><%= label %></span>" +
|
||||
"<span><%= type %></span>" +
|
||||
"</li>";
|
||||
|
||||
var templateOptional =
|
||||
|
||||
var templateOptional =
|
||||
"<li " +
|
||||
"data-name='<%= name %>' " +
|
||||
"data-type='<%= type %>' " +
|
||||
|
@ -36,15 +36,15 @@ var AIRTIME = (function(AIRTIME) {
|
|||
"<span><%= type %></span>" +
|
||||
"<span class='template_item_remove'><i class='icon icon-trash'></i></span>" +
|
||||
"</li>";
|
||||
|
||||
|
||||
var template = (config.required) === true ? templateRequired : templateOptional;
|
||||
|
||||
|
||||
template = _.template(template);
|
||||
var $li = $(template(config));
|
||||
|
||||
|
||||
return $li;
|
||||
}
|
||||
|
||||
|
||||
//taken from
|
||||
//http://stackoverflow.com/questions/1349404/generate-a-string-of-5-random-characters-in-javascript
|
||||
function randomString(len, charSet) {
|
||||
|
@ -57,111 +57,111 @@ var AIRTIME = (function(AIRTIME) {
|
|||
}
|
||||
return randomString;
|
||||
}
|
||||
|
||||
|
||||
function addField(config) {
|
||||
|
||||
|
||||
$templateList.append(createTemplateLi(config));
|
||||
}
|
||||
|
||||
|
||||
function getFieldData($el) {
|
||||
|
||||
|
||||
return {
|
||||
name: $el.data("name"),
|
||||
type: $el.data("type"),
|
||||
label: $el.data("label"),
|
||||
isFileMd: $el.data("filemd")
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
mod.onReady = function() {
|
||||
|
||||
|
||||
$templateDiv = $("#configure_item_template");
|
||||
$templateList = $(".template_item_list");
|
||||
$fileMDList = $(".template_file_md");
|
||||
|
||||
|
||||
$fileMDList.on("click", "i.icon-plus", function(){
|
||||
|
||||
|
||||
var $li = $(this).parents("li");
|
||||
var config = {
|
||||
name: $li.data("name"),
|
||||
name: $li.data("name"),
|
||||
type: $li.data("type"),
|
||||
label: $li.data("label"),
|
||||
filemd: true,
|
||||
filemd: true,
|
||||
required: false
|
||||
};
|
||||
|
||||
|
||||
addField(config);
|
||||
$li.remove();
|
||||
});
|
||||
|
||||
|
||||
$templateList.sortable();
|
||||
|
||||
|
||||
$templateDiv.on("click", ".template_item_remove", function() {
|
||||
$(this).parents("li").remove();
|
||||
});
|
||||
|
||||
|
||||
$templateDiv.on("click", ".template_item_add button", function() {
|
||||
var $div = $(this).parents("div.template_item_add"),
|
||||
$input = $div.find("input"),
|
||||
label = $input.val(),
|
||||
name;
|
||||
|
||||
|
||||
$input.val("");
|
||||
//create a string name that will work for all languages.
|
||||
name = randomString(10);
|
||||
|
||||
|
||||
var config = {
|
||||
name: name,
|
||||
label: label,
|
||||
type: $div.find("select").val(),
|
||||
filemd: false,
|
||||
type: $div.find("select").val(),
|
||||
filemd: false,
|
||||
required: false
|
||||
};
|
||||
|
||||
|
||||
addField(config);
|
||||
});
|
||||
|
||||
|
||||
function updateTemplate(template_id, isDefault) {
|
||||
var url = baseUrl+"Playouthistorytemplate/update-template/format/json";
|
||||
var data = {};
|
||||
var $lis, $li;
|
||||
var i, len;
|
||||
var templateName;
|
||||
|
||||
|
||||
templateName = $("#template_name").val();
|
||||
$lis = $templateList.children();
|
||||
|
||||
|
||||
for (i = 0, len = $lis.length; i < len; i++) {
|
||||
$li = $($lis[i]);
|
||||
|
||||
|
||||
data[i] = getFieldData($li);
|
||||
}
|
||||
|
||||
|
||||
$.post(url, {'id': template_id, 'name': templateName, 'fields': data, 'setDefault': isDefault}, function(json) {
|
||||
var x;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$templateDiv.on("click", "#template_item_save", function(){
|
||||
var template_id = $(this).data("template");
|
||||
|
||||
|
||||
updateTemplate(template_id, false);
|
||||
});
|
||||
|
||||
|
||||
$templateDiv.on("click", "#template_set_default", function() {
|
||||
var $btn = $(this),
|
||||
template_id = $btn.data("template"),
|
||||
template_id = $btn.data("template"),
|
||||
url = baseUrl+"Playouthistorytemplate/set-template-default/format/json";
|
||||
|
||||
|
||||
$btn.remove();
|
||||
$.post(url, {id: template_id});
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
return AIRTIME;
|
||||
|
||||
|
||||
}(AIRTIME || {}));
|
||||
|
||||
$(document).ready(AIRTIME.itemTemplate.onReady);
|
||||
$(document).ready(AIRTIME.itemTemplate.onReady);
|
||||
|
|
|
@ -1,90 +1,90 @@
|
|||
var AIRTIME = (function(AIRTIME) {
|
||||
var mod;
|
||||
|
||||
|
||||
if (AIRTIME.history === undefined) {
|
||||
AIRTIME.history = {};
|
||||
}
|
||||
mod = AIRTIME.history;
|
||||
|
||||
|
||||
var $historyContentDiv;
|
||||
|
||||
|
||||
var lengthMenu = [[10, 25, 50, 100, 500, -1], [10, 25, 50, 100, 500, $.i18n._("All")]];
|
||||
|
||||
|
||||
var sDom = 'l<"dt-process-rel"r><"H"><"dataTables_scrolling"t><"F"ip>';
|
||||
|
||||
|
||||
var selectedLogItems = {};
|
||||
|
||||
|
||||
var dateStartId = "#his_date_start",
|
||||
timeStartId = "#his_time_start",
|
||||
dateEndId = "#his_date_end",
|
||||
timeEndId = "#his_time_end",
|
||||
|
||||
|
||||
oTableAgg,
|
||||
oTableItem,
|
||||
oTableShow,
|
||||
inShowsTab = false;
|
||||
|
||||
|
||||
function validateTimeRange() {
|
||||
var oRange,
|
||||
inputs = $('.his-timerange > input'),
|
||||
start, end;
|
||||
|
||||
|
||||
oRange = AIRTIME.utilities.fnGetScheduleRange(dateStartId, timeStartId, dateEndId, timeEndId);
|
||||
|
||||
|
||||
start = oRange.start;
|
||||
end = oRange.end;
|
||||
|
||||
|
||||
if (end >= start) {
|
||||
inputs.removeClass('error');
|
||||
}
|
||||
else {
|
||||
inputs.addClass('error');
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
start: start,
|
||||
end: end,
|
||||
isValid: end >= start
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
function getSelectedLogItems() {
|
||||
var items = Object.keys(selectedLogItems);
|
||||
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
|
||||
function addSelectedLogItem($el) {
|
||||
var id;
|
||||
|
||||
|
||||
$el.addClass("his-selected");
|
||||
id = $el.data("his-id");
|
||||
selectedLogItems[id] = "";
|
||||
}
|
||||
|
||||
|
||||
function removeSelectedLogItem($el) {
|
||||
var id;
|
||||
|
||||
|
||||
$el.removeClass("his-selected");
|
||||
id = $el.data("his-id");
|
||||
delete selectedLogItems[id];
|
||||
}
|
||||
|
||||
|
||||
function emptySelectedLogItems() {
|
||||
var $inputs = $historyContentDiv.find(".his_checkbox").find("input");
|
||||
|
||||
|
||||
$inputs.prop('checked', false);
|
||||
$inputs.parents("tr").removeClass("his-selected");
|
||||
|
||||
|
||||
selectedLogItems = {};
|
||||
}
|
||||
|
||||
|
||||
function selectCurrentPage(e) {
|
||||
var $ctx = $(e.currentTarget).parents("div.dataTables_wrapper"),
|
||||
$inputs = $ctx.find(".his_checkbox").find("input"),
|
||||
$tr,
|
||||
$tr,
|
||||
$input;
|
||||
|
||||
|
||||
$.each($inputs, function(index, input) {
|
||||
$input = $(input);
|
||||
$input.prop('checked', true);
|
||||
|
@ -92,13 +92,13 @@ var AIRTIME = (function(AIRTIME) {
|
|||
addSelectedLogItem($tr);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function deselectCurrentPage(e) {
|
||||
var $ctx = $(e.currentTarget).parents("div.dataTables_wrapper"),
|
||||
$inputs = $ctx.find(".his_checkbox").find("input"),
|
||||
$tr,
|
||||
$tr,
|
||||
$input;
|
||||
|
||||
|
||||
$.each($inputs, function(index, input) {
|
||||
$input = $(input);
|
||||
$input.prop('checked', false);
|
||||
|
@ -106,11 +106,11 @@ var AIRTIME = (function(AIRTIME) {
|
|||
removeSelectedLogItem($tr);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getFileName(ext){
|
||||
var filename = $("#his_date_start").val()+"_"+$("#his_time_start").val()+"m--"+$("#his_date_end").val()+"_"+$("#his_time_end").val()+"m";
|
||||
filename = filename.replace(/:/g,"h");
|
||||
|
||||
|
||||
if (ext == "pdf"){
|
||||
filename = filename+".pdf";
|
||||
}
|
||||
|
@ -119,10 +119,10 @@ var AIRTIME = (function(AIRTIME) {
|
|||
}
|
||||
return filename;
|
||||
}
|
||||
|
||||
|
||||
/* This callback can be used for all history tables */
|
||||
function fnServerData( sSource, aoData, fnCallback ) {
|
||||
|
||||
|
||||
if (fnServerData.hasOwnProperty("start")) {
|
||||
aoData.push( { name: "start", value: fnServerData.start} );
|
||||
}
|
||||
|
@ -132,9 +132,9 @@ var AIRTIME = (function(AIRTIME) {
|
|||
if (fnServerData.hasOwnProperty("instance")) {
|
||||
aoData.push( { name: "instance_id", value: fnServerData.instance} );
|
||||
}
|
||||
|
||||
|
||||
aoData.push( { name: "format", value: "json"} );
|
||||
|
||||
|
||||
$.ajax( {
|
||||
"dataType": 'json',
|
||||
"type": "GET",
|
||||
|
@ -143,12 +143,12 @@ var AIRTIME = (function(AIRTIME) {
|
|||
"success": fnCallback
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
function createShowAccordSection(config) {
|
||||
var template,
|
||||
$el;
|
||||
|
||||
template =
|
||||
|
||||
template =
|
||||
"<h3>" +
|
||||
"<a href='#'>" +
|
||||
"<span class='show-title'><%= name %></span>" +
|
||||
|
@ -163,47 +163,47 @@ var AIRTIME = (function(AIRTIME) {
|
|||
"<div " +
|
||||
"data-instance='<%= instance %>' " +
|
||||
"></div>";
|
||||
|
||||
|
||||
template = _.template(template);
|
||||
$el = $(template(config));
|
||||
|
||||
|
||||
return $el;
|
||||
}
|
||||
|
||||
|
||||
//$el is the div in the accordian we should create the table on.
|
||||
function createShowTable($el) {
|
||||
|
||||
|
||||
var instance = $el.data("instance");
|
||||
var $table = $("<table/>", {
|
||||
'cellpadding': "0",
|
||||
'cellspacing': "0",
|
||||
'cellpadding': "0",
|
||||
'cellspacing': "0",
|
||||
'class': "datatable",
|
||||
'id': "history_table_show"
|
||||
});
|
||||
|
||||
|
||||
//assign the retrieval function the show instance id.
|
||||
fnServerData.instance = instance;
|
||||
$el.append($table);
|
||||
$el.css("height", "auto");
|
||||
oTableShow = itemHistoryTable("history_table_show");
|
||||
}
|
||||
|
||||
|
||||
function drawShowList(oShows) {
|
||||
var $showList = $historyContentDiv.find("#history_show_summary"),
|
||||
i,
|
||||
len,
|
||||
i,
|
||||
len,
|
||||
$accordSection,
|
||||
show,
|
||||
tmp;
|
||||
|
||||
|
||||
$showList
|
||||
.accordion( "destroy" )
|
||||
.empty();
|
||||
|
||||
|
||||
for (i = 0, len = oShows.length; i < len; i++) {
|
||||
show = oShows[i];
|
||||
tmp = show.starts.split(" ");
|
||||
|
||||
|
||||
$accordSection = createShowAccordSection({
|
||||
instance: show.instance_id,
|
||||
name: show.name,
|
||||
|
@ -211,10 +211,10 @@ var AIRTIME = (function(AIRTIME) {
|
|||
startTime: tmp[1],
|
||||
endTime: show.ends.split(" ").pop()
|
||||
});
|
||||
|
||||
|
||||
$showList.append($accordSection);
|
||||
}
|
||||
|
||||
|
||||
$showList.accordion({
|
||||
animated: false,
|
||||
create: function( event, ui ) {
|
||||
|
@ -232,7 +232,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
//changestart: function( event, ui ) {}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function createToolbarButtons ($el) {
|
||||
var $menu = $("<div class='btn-toolbar' />");
|
||||
|
||||
|
@ -269,10 +269,10 @@ var AIRTIME = (function(AIRTIME) {
|
|||
"<i class='icon-white icon-trash'></i>" +
|
||||
"</button>" +
|
||||
"</div>");
|
||||
|
||||
|
||||
$el.append($menu);
|
||||
}
|
||||
|
||||
|
||||
function aggregateHistoryTable() {
|
||||
var oTable,
|
||||
$historyTableDiv = $historyContentDiv.find("#history_table_aggregate"),
|
||||
|
@ -282,16 +282,16 @@ var AIRTIME = (function(AIRTIME) {
|
|||
fnRowCallback = function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
|
||||
var editUrl = baseUrl+"playouthistory/edit-file-item/id/"+aData.file_id,
|
||||
$nRow = $(nRow);
|
||||
|
||||
|
||||
$nRow.data('url-edit', editUrl);
|
||||
};
|
||||
|
||||
|
||||
columns = JSON.parse(localStorage.getItem('datatables-historyfile-aoColumns'));
|
||||
|
||||
|
||||
oTable = $historyTableDiv.dataTable( {
|
||||
|
||||
|
||||
"aoColumns": columns,
|
||||
|
||||
|
||||
"bProcessing": true,
|
||||
"bServerSide": true,
|
||||
"sAjaxSource": baseUrl+"playouthistory/file-history-feed",
|
||||
|
@ -310,13 +310,13 @@ var AIRTIME = (function(AIRTIME) {
|
|||
"sPaginationType": "full_numbers",
|
||||
"bJQueryUI": true,
|
||||
"bAutoWidth": true,
|
||||
"sDom": sDom,
|
||||
"sDom": sDom,
|
||||
});
|
||||
oTable.fnSetFilteringDelay(350);
|
||||
|
||||
|
||||
return oTable;
|
||||
}
|
||||
|
||||
|
||||
function itemHistoryTable(id) {
|
||||
var oTable,
|
||||
$historyTableDiv = $historyContentDiv.find("#"+id),
|
||||
|
@ -325,11 +325,11 @@ var AIRTIME = (function(AIRTIME) {
|
|||
fnRowCallback,
|
||||
booleans = {},
|
||||
i, c;
|
||||
|
||||
|
||||
columns = JSON.parse(localStorage.getItem('datatables-historyitem-aoColumns'));
|
||||
|
||||
|
||||
for (i in columns) {
|
||||
|
||||
|
||||
c = columns[i];
|
||||
if (c["sDataType"] === "boolean") {
|
||||
booleans[c["mDataProp"]] = c["sTitle"];
|
||||
|
@ -341,22 +341,22 @@ var AIRTIME = (function(AIRTIME) {
|
|||
deleteUrl = baseUrl+"playouthistory/delete-list-item/id/"+aData.history_id,
|
||||
emptyCheckBox = String.fromCharCode(parseInt(2610, 16)),
|
||||
checkedCheckBox = String.fromCharCode(parseInt(2612, 16)),
|
||||
b,
|
||||
b,
|
||||
text,
|
||||
$nRow = $(nRow);
|
||||
|
||||
|
||||
// add checkbox
|
||||
$nRow.find('td.his_checkbox').html("<input type='checkbox' name='cb_"+aData.history_id+"'>");
|
||||
|
||||
|
||||
$nRow.data('his-id', aData.history_id);
|
||||
$nRow.data('url-edit', editUrl);
|
||||
$nRow.data('url-delete', deleteUrl);
|
||||
|
||||
|
||||
for (b in booleans) {
|
||||
|
||||
|
||||
text = aData[b] ? checkedCheckBox : emptyCheckBox;
|
||||
text = text + " " + booleans[b];
|
||||
|
||||
|
||||
$nRow.find(".his_"+b).html(text);
|
||||
}
|
||||
};
|
||||
|
@ -382,16 +382,16 @@ var AIRTIME = (function(AIRTIME) {
|
|||
"sPaginationType": "full_numbers",
|
||||
"bJQueryUI": true,
|
||||
"bAutoWidth": true,
|
||||
"sDom": sDom,
|
||||
"sDom": sDom,
|
||||
});
|
||||
oTable.fnSetFilteringDelay(350);
|
||||
|
||||
|
||||
$toolbar = $historyTableDiv.parents(".dataTables_wrapper").find(".fg-toolbar:first");
|
||||
createToolbarButtons($toolbar);
|
||||
|
||||
|
||||
return oTable;
|
||||
}
|
||||
|
||||
|
||||
function showSummaryList(start, end) {
|
||||
var url = baseUrl+"playouthistory/show-history-feed",
|
||||
data = {
|
||||
|
@ -399,18 +399,18 @@ var AIRTIME = (function(AIRTIME) {
|
|||
start: start,
|
||||
end: end
|
||||
};
|
||||
|
||||
|
||||
$.post(url, data, function(json) {
|
||||
drawShowList(json);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
mod.onReady = function() {
|
||||
|
||||
|
||||
var oBaseDatePickerSettings,
|
||||
oBaseTimePickerSettings,
|
||||
$hisDialogEl,
|
||||
|
||||
|
||||
tabsInit = [
|
||||
{
|
||||
initialized: false,
|
||||
|
@ -443,105 +443,105 @@ var AIRTIME = (function(AIRTIME) {
|
|||
{
|
||||
initialized: false,
|
||||
initialize: function() {
|
||||
|
||||
|
||||
},
|
||||
navigate: function() {
|
||||
|
||||
|
||||
},
|
||||
always: function() {
|
||||
inShowsTab = true;
|
||||
|
||||
|
||||
var info = getStartEnd();
|
||||
showSummaryList(info.start, info.end);
|
||||
emptySelectedLogItems();
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
//set the locale names for the bootstrap calendar.
|
||||
$.fn.datetimepicker.dates = {
|
||||
daysMin: i18n_days_short,
|
||||
months: i18n_months,
|
||||
monthsShort: i18n_months_short
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
$historyContentDiv = $("#history_content");
|
||||
|
||||
|
||||
function redrawTables() {
|
||||
oTableAgg && oTableAgg.fnDraw();
|
||||
oTableItem && oTableItem.fnDraw();
|
||||
oTableShow && oTableShow.fnDraw();
|
||||
}
|
||||
|
||||
|
||||
function removeHistoryDialog() {
|
||||
$hisDialogEl.dialog("destroy");
|
||||
$hisDialogEl.remove();
|
||||
}
|
||||
|
||||
|
||||
function initializeDialog() {
|
||||
var $startPicker = $hisDialogEl.find('#his_item_starts_datetimepicker'),
|
||||
$endPicker = $hisDialogEl.find('#his_item_ends_datetimepicker');
|
||||
|
||||
|
||||
$startPicker.datetimepicker();
|
||||
|
||||
$endPicker.datetimepicker({
|
||||
showTimeFirst: true
|
||||
});
|
||||
|
||||
|
||||
$startPicker.on('changeDate', function(e) {
|
||||
$endPicker.data('datetimepicker').setLocalDate(e.localDate);
|
||||
$endPicker.data('datetimepicker').setLocalDate(e.localDate);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function processDialogHtml($el) {
|
||||
|
||||
|
||||
if (inShowsTab) {
|
||||
$el.find("#his_choose_instance").remove();
|
||||
}
|
||||
|
||||
|
||||
return $el
|
||||
}
|
||||
|
||||
|
||||
function makeHistoryDialog(html) {
|
||||
$hisDialogEl = $(html);
|
||||
$hisDialogEl = processDialogHtml($hisDialogEl);
|
||||
|
||||
$hisDialogEl.dialog({
|
||||
|
||||
$hisDialogEl.dialog({
|
||||
title: $.i18n._("Edit History Record"),
|
||||
modal: false,
|
||||
open: function( event, ui ) {
|
||||
initializeDialog();
|
||||
initializeDialog();
|
||||
},
|
||||
close: function() {
|
||||
removeHistoryDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
hisSubmit(); // Fixes display bug
|
||||
|
||||
|
||||
/*
|
||||
* Icon hover states for search.
|
||||
*/
|
||||
$historyContentDiv.on("mouseenter", ".his-timerange .ui-button", function(ev) {
|
||||
$(this).addClass("ui-state-hover");
|
||||
$(this).addClass("ui-state-hover");
|
||||
});
|
||||
$historyContentDiv.on("mouseleave", ".his-timerange .ui-button", function(ev) {
|
||||
$(this).removeClass("ui-state-hover");
|
||||
});
|
||||
|
||||
|
||||
oBaseDatePickerSettings = {
|
||||
dateFormat: 'yy-mm-dd',
|
||||
//i18n_months, i18n_days_short are in common.js
|
||||
monthNames: i18n_months,
|
||||
dayNamesMin: i18n_days_short,
|
||||
onSelect: function(sDate, oDatePicker) {
|
||||
onSelect: function(sDate, oDatePicker) {
|
||||
$(this).datepicker( "setDate", sDate );
|
||||
},
|
||||
onClose: validateTimeRange
|
||||
};
|
||||
|
||||
|
||||
oBaseTimePickerSettings = {
|
||||
showPeriodLabels: false,
|
||||
showCloseButton: true,
|
||||
|
@ -556,28 +556,28 @@ var AIRTIME = (function(AIRTIME) {
|
|||
$historyContentDiv.find(dateStartId)
|
||||
.datepicker(oBaseDatePickerSettings)
|
||||
.blur(validateTimeRange);
|
||||
|
||||
|
||||
$historyContentDiv.find(timeStartId)
|
||||
.timepicker(oBaseTimePickerSettings)
|
||||
.blur(validateTimeRange);
|
||||
|
||||
|
||||
$historyContentDiv.find(dateEndId)
|
||||
.datepicker(oBaseDatePickerSettings)
|
||||
.blur(validateTimeRange);
|
||||
|
||||
|
||||
$historyContentDiv.find(timeEndId)
|
||||
.timepicker(oBaseTimePickerSettings)
|
||||
.blur(validateTimeRange);
|
||||
|
||||
|
||||
$historyContentDiv.on("click", "#his_create", function(e) {
|
||||
var url = baseUrl+"playouthistory/edit-list-item/format/json" ;
|
||||
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
|
||||
$.get(url, function(json) {
|
||||
|
||||
|
||||
makeHistoryDialog(json.dialog);
|
||||
|
||||
|
||||
}, "json");
|
||||
});
|
||||
|
||||
|
@ -639,14 +639,14 @@ var AIRTIME = (function(AIRTIME) {
|
|||
// Removing extra fields
|
||||
delete element.checkbox;
|
||||
delete element.history_id;
|
||||
delete element.instance_id;
|
||||
delete element.instance_id;
|
||||
dd.content[2].table.body.push(Object.values(element));
|
||||
});
|
||||
// Make PDF and start download
|
||||
pdfMake.createPdf(dd).download();
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
$historyContentDiv.on("click", "#csv_export", async function(){
|
||||
// Get date/time from pickers
|
||||
var startDay = document.querySelector('#his_date_start').value;
|
||||
|
@ -687,22 +687,22 @@ var AIRTIME = (function(AIRTIME) {
|
|||
var csvX = new CSVExport(hisData); // Actual export function
|
||||
return false // Was part of the demo. Please leave as is.
|
||||
});
|
||||
|
||||
|
||||
$('body').on("click", ".his_file_cancel, .his_item_cancel", function(e) {
|
||||
removeHistoryDialog();
|
||||
});
|
||||
|
||||
|
||||
$('body').on("click", ".his_file_save", function(e) {
|
||||
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
|
||||
var $form = $(this).parents("form");
|
||||
var data = $form.serializeArray();
|
||||
|
||||
|
||||
var url = baseUrl+"Playouthistory/update-file-item/format/json";
|
||||
|
||||
|
||||
$.post(url, data, function(json) {
|
||||
|
||||
|
||||
//TODO put errors on form.
|
||||
if (json.error !== undefined) {
|
||||
//makeHistoryDialog(json.dialog);
|
||||
|
@ -711,15 +711,15 @@ var AIRTIME = (function(AIRTIME) {
|
|||
removeHistoryDialog();
|
||||
redrawTables();
|
||||
}
|
||||
|
||||
|
||||
}, "json");
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('body').on("click", ".his_item_save", function(e) {
|
||||
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
|
||||
var $form = $(this).parents("form"),
|
||||
data = $form.serializeArray(),
|
||||
id = data[0].value,
|
||||
|
@ -728,9 +728,9 @@ var AIRTIME = (function(AIRTIME) {
|
|||
url,
|
||||
$select = $hisDialogEl.find("#his_instance_select"),
|
||||
instance;
|
||||
|
||||
|
||||
url = (id === "") ? createUrl : updateUrl;
|
||||
|
||||
|
||||
if (fnServerData.instance !== undefined) {
|
||||
data.push({
|
||||
name: "instance_id",
|
||||
|
@ -739,17 +739,17 @@ var AIRTIME = (function(AIRTIME) {
|
|||
}
|
||||
else if ($select.length > 0) {
|
||||
instance = $select.val();
|
||||
|
||||
|
||||
if (instance > 0) {
|
||||
data.push({
|
||||
name: "instance_id",
|
||||
value: instance
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$.post(url, data, function(json) {
|
||||
|
||||
|
||||
if (json.form !== undefined) {
|
||||
var $newForm = $(json.form);
|
||||
$newForm = processDialogHtml($newForm);
|
||||
|
@ -760,16 +760,16 @@ var AIRTIME = (function(AIRTIME) {
|
|||
removeHistoryDialog();
|
||||
redrawTables();
|
||||
}
|
||||
|
||||
|
||||
}, "json");
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$historyContentDiv.on("click", ".his_checkbox input", function(e) {
|
||||
var checked = e.currentTarget.checked,
|
||||
$tr = $(e.currentTarget).parents("tr");
|
||||
|
||||
|
||||
if (checked) {
|
||||
addSelectedLogItem($tr);
|
||||
}
|
||||
|
@ -777,7 +777,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
removeSelectedLogItem($tr);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('body').on("click", "#his_instance_retrieve", function(e) {
|
||||
var startPicker = $hisDialogEl.find('#his_item_starts'),
|
||||
endPicker = $hisDialogEl.find('#his_item_ends'),
|
||||
|
@ -785,13 +785,13 @@ var AIRTIME = (function(AIRTIME) {
|
|||
startDate = startPicker.val(),
|
||||
endDate = endPicker.val(),
|
||||
data;
|
||||
|
||||
|
||||
data = {
|
||||
start: startDate,
|
||||
end: endDate,
|
||||
format: "json"
|
||||
};
|
||||
|
||||
|
||||
$.get(url, data, function(json) {
|
||||
var i,
|
||||
$select = $('<select/>', {
|
||||
|
@ -800,43 +800,43 @@ var AIRTIME = (function(AIRTIME) {
|
|||
$option,
|
||||
show;
|
||||
|
||||
if (json.length > 0) {
|
||||
|
||||
if (json.length > 0) {
|
||||
|
||||
for (i = 0; i < json.length; i++) {
|
||||
show = json[i];
|
||||
|
||||
|
||||
$option = $('<option/>')
|
||||
.text(show.name)
|
||||
.attr('value', show.instance_id);
|
||||
|
||||
|
||||
$select.append($option);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$option = $('<option/>')
|
||||
.text($.i18n._("No Show"))
|
||||
.attr('value', 0);
|
||||
|
||||
|
||||
$select.append($option);
|
||||
|
||||
|
||||
$hisDialogEl.find("#his_instance_select").replaceWith($select);
|
||||
});
|
||||
});
|
||||
|
||||
function getStartEnd() {
|
||||
|
||||
|
||||
function getStartEnd() {
|
||||
|
||||
return AIRTIME.utilities.fnGetScheduleRange(dateStartId, timeStartId, dateEndId, timeEndId);
|
||||
}
|
||||
|
||||
|
||||
function hisSubmit(){
|
||||
var fn, info;
|
||||
|
||||
|
||||
info = getStartEnd();
|
||||
|
||||
|
||||
fn = fnServerData;
|
||||
fn.start = info.start;
|
||||
fn.end = info.end;
|
||||
|
||||
|
||||
if (inShowsTab) {
|
||||
showSummaryList(info.start, info.end);
|
||||
}
|
||||
|
@ -848,27 +848,27 @@ var AIRTIME = (function(AIRTIME) {
|
|||
$historyContentDiv.find("#his_submit").click(function(ev){
|
||||
hisSubmit();
|
||||
});
|
||||
|
||||
|
||||
$historyContentDiv.on("click", ".his-select-page", selectCurrentPage);
|
||||
$historyContentDiv.on("click", ".his-dselect-page", deselectCurrentPage);
|
||||
$historyContentDiv.on("click", ".his-dselect-all", emptySelectedLogItems);
|
||||
|
||||
|
||||
$historyContentDiv.on("click", "#his_trash", function(ev){
|
||||
var items = getSelectedLogItems(),
|
||||
url = baseUrl+"playouthistory/delete-list-items";
|
||||
|
||||
|
||||
$.post(url, {ids: items, format: "json"}, function() {
|
||||
selectedLogItems = {};
|
||||
redrawTables();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$historyContentDiv.find("#his-tabs").tabs({
|
||||
show: function( event, ui ) {
|
||||
var href = $(ui.tab).attr("href");
|
||||
var index = href.split('-').pop();
|
||||
var tab = tabsInit[index-1];
|
||||
|
||||
|
||||
if (!tab.initialized) {
|
||||
tab.initialize();
|
||||
tab.initialized = true;
|
||||
|
@ -876,73 +876,73 @@ var AIRTIME = (function(AIRTIME) {
|
|||
else {
|
||||
tab.navigate();
|
||||
}
|
||||
|
||||
|
||||
tab.always();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// begin context menu initialization.
|
||||
$.contextMenu({
|
||||
selector: '#history_content td:not(.his_checkbox)',
|
||||
trigger: "left",
|
||||
ignoreRightClick: true,
|
||||
|
||||
|
||||
build: function($el, e) {
|
||||
var items = {},
|
||||
callback,
|
||||
var items = {},
|
||||
callback,
|
||||
$tr,
|
||||
editUrl,
|
||||
deleteUrl;
|
||||
|
||||
|
||||
$tr = $el.parents("tr");
|
||||
editUrl = $tr.data("url-edit");
|
||||
deleteUrl = $tr.data("url-delete");
|
||||
|
||||
|
||||
if (editUrl !== undefined) {
|
||||
|
||||
|
||||
callback = function() {
|
||||
$.post(editUrl, {format: "json"}, function(json) {
|
||||
|
||||
|
||||
makeHistoryDialog(json.dialog);
|
||||
|
||||
|
||||
}, "json");
|
||||
};
|
||||
|
||||
|
||||
items["edit"] = {
|
||||
"name": $.i18n._("Edit"),
|
||||
"icon": "edit",
|
||||
"callback": callback
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
if (deleteUrl !== undefined) {
|
||||
|
||||
|
||||
callback = function() {
|
||||
var c = confirm("Delete this entry?");
|
||||
|
||||
|
||||
if (c) {
|
||||
$.post(deleteUrl, {format: "json"}, function(json) {
|
||||
redrawTables();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
items["del"] = {
|
||||
"name": $.i18n._("Delete"),
|
||||
"icon": "delete",
|
||||
"callback": callback
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
items: items
|
||||
};
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
return AIRTIME;
|
||||
|
||||
|
||||
}(AIRTIME || {}));
|
||||
|
||||
$(document).ready(AIRTIME.history.onReady);
|
||||
$(document).ready(AIRTIME.history.onReady);
|
||||
|
|
|
@ -1,102 +1,102 @@
|
|||
var AIRTIME = (function(AIRTIME) {
|
||||
var mod;
|
||||
var $historyTemplate;
|
||||
|
||||
|
||||
if (AIRTIME.template === undefined) {
|
||||
AIRTIME.template = {};
|
||||
}
|
||||
mod = AIRTIME.template;
|
||||
|
||||
|
||||
function createItemLi(id, name, configured) {
|
||||
|
||||
|
||||
var editUrl = baseUrl+"Playouthistorytemplate/configure-template/id/"+id;
|
||||
var defaultUrl = baseUrl+"Playouthistorytemplate/set-template-default/format/json/id/"+id;
|
||||
var removeUrl = baseUrl+"Playouthistorytemplate/delete-template/format/json/id/"+id;
|
||||
|
||||
var itemConfigured =
|
||||
|
||||
var itemConfigured =
|
||||
"<li class='template_configured' data-template='<%= id %>' data-name='<%= name %>'>" +
|
||||
"<a href='<%= editUrl %>' class='template_name'><%= name %></a>" +
|
||||
"<i class='icon icon-ok'></i>" +
|
||||
"</li>";
|
||||
|
||||
var item =
|
||||
|
||||
var item =
|
||||
"<li data-template='<%= id %>' data-name='<%= name %>'>" +
|
||||
"<a href='<%= editUrl %>' class='template_name'><%= name %></a>" +
|
||||
"<a href='<%= removeUrl %>' class='template_remove'><i class='icon icon-trash'></i></a>" +
|
||||
"<a href='<%= defaultUrl %>' class='template_default'>" + $.i18n._('Set Default') + "</a>" +
|
||||
"<a href='<%= defaultUrl %>' class='template_default'>" + $.i18n._('Set Default') + "</a>" +
|
||||
"</li>";
|
||||
|
||||
|
||||
var template = (configured) === true ? itemConfigured : item;
|
||||
|
||||
|
||||
var template = _.template(template);
|
||||
|
||||
|
||||
var $li = $(template({id: id, name: name, editUrl: editUrl, defaultUrl: defaultUrl, removeUrl: removeUrl}));
|
||||
|
||||
|
||||
return $li;
|
||||
}
|
||||
|
||||
|
||||
mod.onReady = function() {
|
||||
|
||||
|
||||
$historyTemplate = $("#history_template");
|
||||
|
||||
|
||||
$historyTemplate.on("click", ".template_remove", function(ev) {
|
||||
|
||||
|
||||
ev.preventDefault();
|
||||
|
||||
|
||||
var $a = $(this);
|
||||
var url = $a.attr("href");
|
||||
$a.parents("li").remove();
|
||||
|
||||
|
||||
$.post(url, function(){
|
||||
var x;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$historyTemplate.on("click", ".template_default", function(ev) {
|
||||
|
||||
|
||||
ev.preventDefault();
|
||||
|
||||
|
||||
var $a = $(this);
|
||||
var url = $a.attr("href");
|
||||
var $oldLi, $newLi;
|
||||
|
||||
|
||||
$oldLi = $a.parents("ul").find("li.template_configured");
|
||||
$newLi = $a.parents("li");
|
||||
|
||||
|
||||
$oldLi.replaceWith(createItemLi($oldLi.data('template'), $oldLi.data('name'), false));
|
||||
$newLi.replaceWith(createItemLi($newLi.data('template'), $newLi.data('name'), true));
|
||||
|
||||
|
||||
$.post(url, function(){
|
||||
var x;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function createTemplate(type) {
|
||||
|
||||
|
||||
var createUrl = baseUrl+"Playouthistorytemplate/create-template";
|
||||
|
||||
|
||||
$.post(createUrl, {format: "json", type: type}, function(json) {
|
||||
|
||||
|
||||
if (json.error !== undefined) {
|
||||
alert(json.error);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
window.location.href = json.url;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$historyTemplate.on("click", "#new_item_template", function() {
|
||||
createTemplate("item");
|
||||
});
|
||||
|
||||
|
||||
$historyTemplate.on("click", "#new_file_template", function() {
|
||||
createTemplate("file");
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
return AIRTIME;
|
||||
|
||||
|
||||
}(AIRTIME || {}));
|
||||
|
||||
$(document).ready(AIRTIME.template.onReady);
|
||||
$(document).ready(AIRTIME.template.onReady);
|
||||
|
|
|
@ -42,7 +42,7 @@ function setWatchedDirEvents() {
|
|||
|
||||
$('#storageFolder-ok').click(function(){
|
||||
var url, chosen;
|
||||
|
||||
|
||||
if(confirm(sprintf($.i18n._("Are you sure you want to change the storage folder?\nThis will remove the files from your %s library!"), PRODUCT_NAME))){
|
||||
url = baseUrl+"Preference/change-stor-directory";
|
||||
chosen = $('#storageFolder').val();
|
||||
|
@ -57,7 +57,7 @@ function setWatchedDirEvents() {
|
|||
});
|
||||
}
|
||||
else {
|
||||
$('#storageFolder').val("");
|
||||
$('#storageFolder').val("");
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -77,7 +77,7 @@ function setWatchedDirEvents() {
|
|||
setWatchedDirEvents();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('.selected-item').find('.ui-icon-refresh').click(function(){
|
||||
var folder = $(this).prev().text();
|
||||
$.get(baseUrl+"Preference/rescan-watch-directory", {format: "json", dir: folder});
|
||||
|
@ -125,5 +125,5 @@ $(document).ready(function() {
|
|||
show: 'mouseover',
|
||||
hide: 'mouseout'
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
|
|
@ -15,7 +15,7 @@ function setConfigureMailServerListener() {
|
|||
configMailServer.click(function(event){
|
||||
setMailServerInputReadonly();
|
||||
});
|
||||
|
||||
|
||||
var msRequiresAuth = $("#msRequiresAuth");
|
||||
msRequiresAuth.click(function(event){
|
||||
setMsAuthenticationFieldsReadonly($(this));
|
||||
|
@ -57,7 +57,7 @@ function setMailServerInputReadonly() {
|
|||
var mailServer = $("#mailServer");
|
||||
var port = $("#port");
|
||||
var requiresAuthCB = $("#msRequiresAuth");
|
||||
|
||||
|
||||
if (configMailServer.is(':checked')) {
|
||||
mailServer.removeAttr("readonly");
|
||||
port.removeAttr("readonly");
|
||||
|
@ -67,7 +67,7 @@ function setMailServerInputReadonly() {
|
|||
port.attr("readonly", "readonly");
|
||||
requiresAuthCB.parent().hide();
|
||||
}
|
||||
|
||||
|
||||
setMsAuthenticationFieldsReadonly(requiresAuthCB);
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ function setMsAuthenticationFieldsReadonly(ele) {
|
|||
var email = $("#email");
|
||||
var password = $("#ms_password");
|
||||
var configureMailServer = $("#configureMailServer");
|
||||
|
||||
|
||||
if (ele.is(':checked') && configureMailServer.is(':checked')) {
|
||||
email.removeAttr("readonly");
|
||||
password.removeAttr("readonly");
|
||||
|
@ -144,7 +144,7 @@ $(document).ready(function() {
|
|||
$('#pref_save').live('click', function() {
|
||||
var data = $('#pref_form').serialize();
|
||||
var url = baseUrl+'Preference/index';
|
||||
|
||||
|
||||
$.post(url, {format: "json", data: data}, function(json){
|
||||
$('#content').empty().append(json.html);
|
||||
setTimeout(removeSuccessMsg, 5000);
|
||||
|
@ -186,7 +186,7 @@ $(document).ready(function() {
|
|||
}
|
||||
|
||||
showErrorSections();
|
||||
|
||||
|
||||
setMailServerInputReadonly();
|
||||
setPodcastAutoSmartblockReadonly();
|
||||
setSystemFromEmailReadonly();
|
||||
|
|
|
@ -52,7 +52,7 @@ function hideForShoutcast(ele){
|
|||
div.find("select[id$=data-type]").find("option[value='mp3']").attr('selected','selected');
|
||||
div.find("select[id$=data-type]").find("option[value='ogg']").attr("disabled","disabled");
|
||||
div.find("select[id$=data-type]").find("option[value='opus']").attr("disabled","disabled");
|
||||
|
||||
|
||||
restrictOggBitrate(ele, false)
|
||||
}
|
||||
|
||||
|
@ -116,13 +116,13 @@ function setLiveSourceConnectionOverrideListener(){
|
|||
$(this).parent().find("div[id$='_dj_connection_url_actions']").show();
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
|
||||
// set action for "OK" and "X"
|
||||
var live_dj_actions = $("#live_dj_connection_url_actions");
|
||||
var live_dj_input = live_dj_actions.parent().find("dd[id$='_source_host-element']").children();
|
||||
var master_dj_actions = $("#master_dj_connection_url_actions");
|
||||
var master_dj_input = master_dj_actions.parent().find("dd[id$='_source_host-element']").children();
|
||||
|
||||
|
||||
live_dj_actions.find("#ok").click(function(event){
|
||||
event.preventDefault();
|
||||
var url = live_dj_input.val();
|
||||
|
@ -132,7 +132,7 @@ function setLiveSourceConnectionOverrideListener(){
|
|||
$.get(baseUrl+"Preference/set-source-connection-url", {format: "json", type: "livedj", url:encodeURIComponent(url), override: 1});
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
|
||||
live_dj_actions.find("#reset").click(function(event){
|
||||
event.preventDefault();
|
||||
var port = $("#show_source_port").val();
|
||||
|
@ -147,7 +147,7 @@ function setLiveSourceConnectionOverrideListener(){
|
|||
$.get(baseUrl+"Preference/set-source-connection-url", {format: "json", type: "livedj", url:encodeURIComponent(url), override: 0});
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
|
||||
master_dj_actions.find("#ok").click(function(event){
|
||||
var url = master_dj_input.val();
|
||||
master_dj_input.val(url);
|
||||
|
@ -156,7 +156,7 @@ function setLiveSourceConnectionOverrideListener(){
|
|||
$.get(baseUrl+"Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url), override: 1});
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
|
||||
master_dj_actions.find("#reset").click(function(event){
|
||||
var port = $("#master_source_port").val();
|
||||
var mount = $("#master_source_mount").val();
|
||||
|
@ -178,25 +178,25 @@ function setupEventListeners() {
|
|||
$("dd[id=outputStreamURL-element]").each(function(){
|
||||
rebuildStreamURL($(this));
|
||||
})
|
||||
|
||||
|
||||
$("input[id$=-host], input[id$=-port], input[id$=-mount]").keyup(function(){
|
||||
rebuildStreamURL($(this));
|
||||
});
|
||||
|
||||
|
||||
$("input[id$=-port]").keypress(function(e){
|
||||
validate($(this),e);
|
||||
});
|
||||
|
||||
|
||||
$("select[id$=-output]").change(function(){
|
||||
rebuildStreamURL($(this));
|
||||
});
|
||||
|
||||
|
||||
if(!$("#output_sound_device").is(':checked')){
|
||||
$("select[id=output_sound_device_type]").attr('disabled', 'disabled');
|
||||
}else{
|
||||
$("select[id=output_sound_device_type]").removeAttr('disabled');
|
||||
}
|
||||
|
||||
|
||||
$("#output_sound_device").change(function(){
|
||||
if($(this).is(':checked')){
|
||||
$("select[id=output_sound_device_type]").removeAttr('disabled');
|
||||
|
@ -204,7 +204,7 @@ function setupEventListeners() {
|
|||
$("select[id=output_sound_device_type]").attr('disabled', 'disabled');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$("select[id$=data-type]").change(function(){
|
||||
if($(this).val() == 'ogg'){
|
||||
restrictOggBitrate($(this), true);
|
||||
|
@ -218,7 +218,7 @@ function setupEventListeners() {
|
|||
restrictOggBitrate($(this), true);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$("select[id$=data-output]").change(function(){
|
||||
if($(this).val() == 'shoutcast'){
|
||||
hideForShoutcast($(this));
|
||||
|
@ -226,31 +226,31 @@ function setupEventListeners() {
|
|||
showForIcecast($(this));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$("select[id$=data-output]").each(function(){
|
||||
if($(this).val() == 'shoutcast'){
|
||||
hideForShoutcast($(this));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('.toggle legend').click(function() {
|
||||
$(this).parent().toggleClass('closed');
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
$('.collapsible-header').click(function() {
|
||||
$(this).next().toggle('fast');
|
||||
$(this).toggleClass("closed");
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
setLiveSourceConnectionOverrideListener();
|
||||
|
||||
|
||||
showErrorSections();
|
||||
checkLiquidsoapStatus();
|
||||
|
||||
|
||||
var userManualAnchorOpen = "<a target='_blank' href='" + USER_MANUAL_URL + "'>";
|
||||
|
||||
|
||||
// qtip for help text
|
||||
$(".override_help_icon").qtip({
|
||||
content: {
|
||||
|
@ -274,7 +274,7 @@ function setupEventListeners() {
|
|||
at: "right center"
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
$(".icecast_metadata_help_icon").qtip({
|
||||
content: {
|
||||
text: $.i18n._("Check this option to enable metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option.")
|
||||
|
@ -295,7 +295,7 @@ function setupEventListeners() {
|
|||
at: "right center"
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
$("#auto_transition_help").qtip({
|
||||
content: {
|
||||
text: $.i18n._("Check this box to automatically switch off Master/Show source upon source disconnection.")
|
||||
|
@ -316,7 +316,7 @@ function setupEventListeners() {
|
|||
at: "right center"
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
$("#auto_switch_help").qtip({
|
||||
content: {
|
||||
text: $.i18n._("Check this box to automatically switch on Master/Show source upon source connection.")
|
||||
|
@ -337,7 +337,7 @@ function setupEventListeners() {
|
|||
at: "right center"
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
$(".stream_username_help_icon").qtip({
|
||||
content: {
|
||||
text: $.i18n._("If your Icecast server expects a username of 'source', this field can be left blank.")
|
||||
|
@ -358,7 +358,7 @@ function setupEventListeners() {
|
|||
at: "right center"
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
$(".admin_username_help_icon").qtip({
|
||||
content: {
|
||||
text: $.i18n._("This is the admin username and password for Icecast/SHOUTcast to get listener statistics.")
|
||||
|
@ -379,7 +379,7 @@ function setupEventListeners() {
|
|||
at: "right center"
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
$(".master_username_help_icon").qtip({
|
||||
content: {
|
||||
text: $.i18n._("If your live streaming client does not ask for a username, this field should be 'source'.")
|
||||
|
@ -400,14 +400,14 @@ function setupEventListeners() {
|
|||
at: "right center"
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
$(".stream_type_help_icon").qtip({
|
||||
content: {
|
||||
text: sprintf(
|
||||
$.i18n._("Some stream types require extra configuration. Details about enabling %sAAC+ Support%s or %sOpus Support%s are provided."),
|
||||
"<a target='_blank' href='https://wiki.sourcefabric.org/x/NgPQ'>",
|
||||
$.i18n._("Some stream types require extra configuration. Details about enabling %sAAC+ Support%s or %sOpus Support%s are provided."),
|
||||
"<a target='_blank' href='https://wiki.sourcefabric.org/x/NgPQ'>",
|
||||
"</a>",
|
||||
"<a target='_blank' href='https://wiki.sourcefabric.org/x/KgPQ'>",
|
||||
"<a target='_blank' href='https://wiki.sourcefabric.org/x/KgPQ'>",
|
||||
"</a>")
|
||||
},
|
||||
hide: {
|
||||
|
@ -460,7 +460,7 @@ function setPseudoAdminPassword(s1, s2, s3, s4) {
|
|||
function getAdminPasswordStatus() {
|
||||
$.ajax({ url: baseUrl+'Preference/get-admin-password-status/format/json', dataType:"json", success:function(data){
|
||||
setPseudoAdminPassword(data.s1, data.s2, data.s3, data.s4);
|
||||
}});
|
||||
}});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
@ -481,7 +481,7 @@ $(document).ready(function() {
|
|||
$('#content').empty().append(json.html);
|
||||
if (json.valid) {
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
setupEventListeners();
|
||||
setSliderForReplayGain();
|
||||
getAdminPasswordStatus();
|
||||
|
@ -496,4 +496,3 @@ $(document).ready(function() {
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ function openAddShowForm(nowOrFuture) {
|
|||
$('#schedule-record-rebroadcast').hide();
|
||||
$('#schedule-show-who').hide();
|
||||
$('#schedule-show-style').hide();
|
||||
|
||||
|
||||
}
|
||||
$("#schedule-show-what").show(0, function(){
|
||||
$add_show_name = $("#add_show_name");
|
||||
|
@ -101,18 +101,18 @@ function calculateShowColor() {
|
|||
//$el is DOM element #add-show-form
|
||||
//form is the new form contents to append to $el
|
||||
function redrawAddShowForm($el, form) {
|
||||
|
||||
|
||||
//need to clean up the color picker.
|
||||
$el.find("#schedule-show-style input").each(function(i, el){
|
||||
var $input = $(this),
|
||||
var $input = $(this),
|
||||
colId = $input.data("colorpickerId");
|
||||
|
||||
|
||||
$("#"+colId).remove();
|
||||
$input.removeData();
|
||||
});
|
||||
|
||||
|
||||
$el.empty().append(form);
|
||||
|
||||
|
||||
setAddShowEvents($el);
|
||||
}
|
||||
|
||||
|
@ -121,7 +121,7 @@ function closeAddShowForm(event) {
|
|||
event.preventDefault();
|
||||
|
||||
var $el = $("#add-show-form");
|
||||
|
||||
|
||||
$el.hide();
|
||||
windowResize();
|
||||
|
||||
|
@ -146,7 +146,7 @@ function startDpSelect(dateText, inst) {
|
|||
|
||||
function endDpSelect(dateText, inst) {
|
||||
var time, date;
|
||||
|
||||
|
||||
time = dateText.split("-");
|
||||
date = new Date(time[0], time[1] - 1, time[2]);
|
||||
|
||||
|
@ -187,7 +187,7 @@ function findHosts(request, callback) {
|
|||
noResult[0]['value'] = $("#add_show_hosts_autocomplete").val();
|
||||
noResult[0]['label'] = $.i18n._("No result found");
|
||||
noResult[0]['index'] = null;
|
||||
|
||||
|
||||
$.post(url,
|
||||
{format: "json", term: search},
|
||||
|
||||
|
@ -202,12 +202,12 @@ function findHosts(request, callback) {
|
|||
}
|
||||
|
||||
function beginEditShow(data){
|
||||
|
||||
|
||||
if (data.show_error == true){
|
||||
alertShowErrorAndReload();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
redrawAddShowForm($("#add-show-form"), data.newForm);
|
||||
toggleAddShowButton();
|
||||
openAddShowForm(false);
|
||||
|
@ -234,11 +234,11 @@ function hashCode(str) { // java String#hashCode
|
|||
hash = str.charCodeAt(i) + ((hash << 5) - hash);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
|
||||
function intToRGB(i){
|
||||
return (padZeroes(((i>>16)&0xFF).toString(16), 2) +
|
||||
padZeroes(((i>>8)&0xFF).toString(16), 2)+
|
||||
return (padZeroes(((i>>16)&0xFF).toString(16), 2) +
|
||||
padZeroes(((i>>8)&0xFF).toString(16), 2)+
|
||||
padZeroes((i&0xFF).toString(16), 2)
|
||||
);
|
||||
}
|
||||
|
@ -302,11 +302,11 @@ function setAddShowEvents(form) {
|
|||
if(!form.find("#add_show_rebroadcast").attr('checked')) {
|
||||
form.find("#schedule-record-rebroadcast > fieldset:not(:first-child)").hide();
|
||||
}
|
||||
|
||||
|
||||
// If we're adding a new show or the show has no logo, hide the "Current Logo" element tree
|
||||
$("[id^=add_show_logo_current]").toggle(($("#add_show_logo_current").attr("src") !== "")
|
||||
&& ($(".button-bar.bottom").find(".ui-button-text").text() === "Update show"));
|
||||
|
||||
|
||||
var submitButton = $(".button-bar.bottom").find(".add-show-submit");
|
||||
$("[id^=add_show_instance_description]").toggle(submitButton.attr("data-action") === "edit-repeating-show-instance");
|
||||
|
||||
|
@ -319,7 +319,7 @@ function setAddShowEvents(form) {
|
|||
form.find("#add_show_repeats").click(function(){
|
||||
$(this).blur();
|
||||
form.find("#schedule-show-when > fieldset:last").toggle();
|
||||
|
||||
|
||||
var checkBoxSelected = false;
|
||||
var days = form.find("#add_show_day_check-element input").each( function() {
|
||||
var currentCheckBox = $(this).attr("checked");
|
||||
|
@ -327,14 +327,14 @@ function setAddShowEvents(form) {
|
|||
checkBoxSelected = true;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
if (!checkBoxSelected){
|
||||
var d = getDateFromString(form.find("#add_show_start_date").attr("value"));
|
||||
if ( d != null)
|
||||
form.find("#add_show_day_check-"+d.getDay()).attr('checked', true);
|
||||
}
|
||||
|
||||
|
||||
//must switch rebroadcast displays
|
||||
if(form.find("#add_show_rebroadcast").attr('checked')) {
|
||||
|
||||
|
@ -356,13 +356,13 @@ function setAddShowEvents(form) {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//only display the warning message if a show is being edited
|
||||
if ($(".button-bar.bottom").find(".ui-button-text").text() === "Update show") {
|
||||
if ($(this).attr("checked") && $("#show-link-warning").length === 0) {
|
||||
$(this).parent().after("<ul id='show-link-warning' class='errors'><li>"+$.i18n._("Warning: All other repetitions of this show will have their contents replaced to match the show you selected 'Edit Show' with.")+"</li></ul>");
|
||||
}
|
||||
|
||||
|
||||
if (!$(this).attr("checked") && $("#show-link-warning").length !== 0) {
|
||||
$("#show-link-warning").remove();
|
||||
}
|
||||
|
@ -484,7 +484,7 @@ function setAddShowEvents(form) {
|
|||
at: "right center"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
form.find(".show_autoplaylist_help_icon").qtip({
|
||||
content: {
|
||||
text: $.i18n._("Autoloading playlists' contents are added to shows one hour before the show airs. <a target='_blank' href='http://libretime.org/docs/playlists'>More information</a>")
|
||||
|
@ -679,7 +679,7 @@ function setAddShowEvents(form) {
|
|||
select: autoSelect,
|
||||
delay: 200
|
||||
});
|
||||
|
||||
|
||||
form.find("#add_show_hosts_autocomplete").keypress(function(e){
|
||||
if( e.which == 13 ){
|
||||
return false;
|
||||
|
@ -698,13 +698,13 @@ function setAddShowEvents(form) {
|
|||
$(this).ColorPickerSetColor(this.value);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// when an image is uploaded, we want to show it to the user
|
||||
form.find("#add_show_logo").change(function(event) {
|
||||
if (this.files && this.files[0]) {
|
||||
$("#add_show_logo_preview").show();
|
||||
var reader = new FileReader(); // browser compatibility?
|
||||
|
||||
|
||||
reader.onload = function (e) {
|
||||
$("#add_show_logo_preview")
|
||||
.attr('src', e.target.result);
|
||||
|
@ -723,14 +723,14 @@ function setAddShowEvents(form) {
|
|||
$("#add_show_logo_preview").hide();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
form.find("#add_show_logo_current_remove").click(function() {
|
||||
if (confirm($.i18n._('Are you sure you want to delete the current logo?'))) {
|
||||
var showId = $("#add_show_id").attr("value");
|
||||
|
||||
|
||||
if (showId && $("#add_show_logo_current").attr("src") !== "") {
|
||||
var action = '/rest/show-image?csrf_token=' + $('#csrf').val() + '&id=' + showId;
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: action,
|
||||
data: '',
|
||||
|
@ -743,15 +743,15 @@ function setAddShowEvents(form) {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
form.find("#add-show-close").click(closeAddShowForm);
|
||||
|
||||
form.find(".add-show-submit").click(function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
|
||||
var addShowButton = $(this);
|
||||
|
||||
$('#schedule-add-show').block({
|
||||
|
||||
$('#schedule-add-show').block({
|
||||
message: null,
|
||||
applyPlatformOpacityRules: false
|
||||
});
|
||||
|
@ -762,10 +762,10 @@ function setAddShowEvents(form) {
|
|||
if (form.find("#add_show_record").attr("disabled", true)) {
|
||||
form.find("#add_show_record").attr("disabled", false);
|
||||
}
|
||||
|
||||
|
||||
var startDateDisabled = false,
|
||||
startTimeDisabled = false;
|
||||
|
||||
|
||||
// Similarly, we need to re-enable start date and time if they're disabled
|
||||
if (form.find("#add_show_start_date").prop("disabled") === true) {
|
||||
form.find("#add_show_start_date").attr("disabled", false);
|
||||
|
@ -780,7 +780,7 @@ function setAddShowEvents(form) {
|
|||
// We need to notify the application if date and time were disabled
|
||||
data.push({name: 'start_date_disabled', value: startDateDisabled});
|
||||
data.push({name: 'start_time_disabled', value: startTimeDisabled});
|
||||
|
||||
|
||||
var hosts = $('#add_show_hosts-element input').map(function() {
|
||||
if($(this).attr("checked")) {
|
||||
return $(this).val();
|
||||
|
@ -796,7 +796,7 @@ function setAddShowEvents(form) {
|
|||
var start_date = $("#add_show_start_date").val(),
|
||||
end_date = $("#add_show_end_date").val(),
|
||||
action = baseUrl+"Schedule/"+String(addShowButton.attr("data-action"));
|
||||
|
||||
|
||||
var image;
|
||||
if ($('#add_show_logo')[0] && $('#add_show_logo')[0].files
|
||||
&& $('#add_show_logo')[0].files[0]) {
|
||||
|
@ -805,12 +805,12 @@ function setAddShowEvents(form) {
|
|||
}
|
||||
|
||||
$.ajax({
|
||||
url: action,
|
||||
url: action,
|
||||
data: {format: "json", data: data, hosts: hosts, days: days},
|
||||
success: function(json) {
|
||||
if (json.showId && image) { // Successfully added the show, and it contains an image to upload
|
||||
var imageAction = '/rest/show-image?csrf_token=' + $('#csrf').val() + '&id=' + json.showId;
|
||||
|
||||
|
||||
// perform a second xhttprequest in order to send the show image
|
||||
$.ajax({
|
||||
url: imageAction,
|
||||
|
@ -823,20 +823,20 @@ function setAddShowEvents(form) {
|
|||
}
|
||||
|
||||
$('#schedule-add-show').unblock();
|
||||
|
||||
|
||||
var $addShowForm = $("#add-show-form");
|
||||
|
||||
|
||||
if (json.form) {
|
||||
|
||||
|
||||
redrawAddShowForm($addShowForm, json.form);
|
||||
|
||||
|
||||
$("#add_show_end_date").val(end_date);
|
||||
$("#add_show_start_date").val(start_date);
|
||||
showErrorSections();
|
||||
} else if (json.edit) {
|
||||
$("#schedule_calendar").removeAttr("style")
|
||||
.fullCalendar('render');
|
||||
|
||||
|
||||
$addShowForm.hide();
|
||||
toggleAddShowButton();
|
||||
$.get(baseUrl+"Schedule/get-form", {format:"json"}, function(json){
|
||||
|
@ -858,23 +858,23 @@ function setAddShowEvents(form) {
|
|||
|
||||
var regDate = new RegExp(/^[0-9]{4}-[0-1][0-9]-[0-3][0-9]$/);
|
||||
var regTime = new RegExp(/^[0-2][0-9]:[0-5][0-9]$/);
|
||||
|
||||
|
||||
// when start date/time changes, set end date/time to start date/time+1 hr
|
||||
$('#add_show_start_date, #add_show_start_time').bind('input', 'change', function(){
|
||||
var startDateString = $('#add_show_start_date').val();
|
||||
var startTimeString = $('#add_show_start_time').val();
|
||||
|
||||
|
||||
if(regDate.test(startDateString) && regTime.test(startTimeString)){
|
||||
var startDate = startDateString.split('-');
|
||||
var startTime = startTimeString.split(':');
|
||||
var startDateTime = new Date(startDate[0], parseInt(startDate[1], 10)-1, startDate[2], startTime[0], startTime[1], 0, 0);
|
||||
|
||||
|
||||
var endDateString = $('#add_show_end_date_no_repeat').val();
|
||||
var endTimeString = $('#add_show_end_time').val()
|
||||
var endDate = endDateString.split('-');
|
||||
var endTime = endTimeString.split(':');
|
||||
var endDateTime = new Date(endDate[0], parseInt(endDate[1], 10)-1, endDate[2], endTime[0], endTime[1], 0, 0);
|
||||
|
||||
|
||||
if(startDateTime.getTime() >= endDateTime.getTime()){
|
||||
var duration = $('#add_show_duration').val();
|
||||
// parse duration
|
||||
|
@ -888,13 +888,13 @@ function setAddShowEvents(form) {
|
|||
}
|
||||
endDateTime = new Date(startDateTime.getTime() + time);
|
||||
}
|
||||
|
||||
|
||||
var endDateFormat = endDateTime.getFullYear() + '-' + pad(endDateTime.getMonth()+1,2) + '-' + pad(endDateTime.getDate(),2);
|
||||
var endTimeFormat = pad(endDateTime.getHours(),2) + ':' + pad(endDateTime.getMinutes(),2);
|
||||
|
||||
|
||||
$('#add_show_end_date_no_repeat').val(endDateFormat);
|
||||
$('#add_show_end_time').val(endTimeFormat);
|
||||
|
||||
|
||||
// calculate duration
|
||||
var startDateTimeString = startDateString + " " + startTimeString;
|
||||
var endDateTimeString = $('#add_show_end_date_no_repeat').val() + " " + $('#add_show_end_time').val();
|
||||
|
@ -907,7 +907,7 @@ function setAddShowEvents(form) {
|
|||
$('#add_show_end_date_no_repeat, #add_show_end_time').bind('input', 'change', function(){
|
||||
var endDateString = $('#add_show_end_date_no_repeat').val();
|
||||
var endTimeString = $('#add_show_end_time').val()
|
||||
|
||||
|
||||
if(regDate.test(endDateString) && regTime.test(endTimeString)){
|
||||
var startDateString = $('#add_show_start_date').val();
|
||||
var startTimeString = $('#add_show_start_time').val();
|
||||
|
@ -918,7 +918,7 @@ function setAddShowEvents(form) {
|
|||
var endDate = endDateString.split('-');
|
||||
var endTime = endTimeString.split(':');
|
||||
var endDateTime = new Date(endDate[0], parseInt(endDate[1], 10)-1, endDate[2], endTime[0], endTime[1], 0, 0);
|
||||
|
||||
|
||||
if(startDateTime.getTime() > endDateTime.getTime()){
|
||||
$('#add_show_end_date_no_repeat').css('background-color', '#F49C9C');
|
||||
$('#add_show_end_time').css('background-color', '#F49C9C');
|
||||
|
@ -926,7 +926,7 @@ function setAddShowEvents(form) {
|
|||
$('#add_show_end_date_no_repeat').css('background-color', '');
|
||||
$('#add_show_end_time').css('background-color', '');
|
||||
}
|
||||
|
||||
|
||||
// calculate duration
|
||||
var startDateTimeString = startDateString + " " + startTimeString;
|
||||
var endDateTimeString = endDateString + " " + endTimeString;
|
||||
|
@ -940,7 +940,7 @@ function setAddShowEvents(form) {
|
|||
}else{
|
||||
$('#custom_auth_div').hide()
|
||||
}
|
||||
|
||||
|
||||
$('#cb_custom_auth').change(function(){
|
||||
if($(this).attr('checked')){
|
||||
$('#custom_auth_div').show()
|
||||
|
@ -951,17 +951,17 @@ function setAddShowEvents(form) {
|
|||
|
||||
function calculateDuration(startDateTime, endDateTime, timezone){
|
||||
var loadingIcon = $('#icon-loader-small');
|
||||
|
||||
|
||||
loadingIcon.show();
|
||||
$.post(
|
||||
baseUrl+"Schedule/calculate-duration",
|
||||
{startTime: startDateTime, endTime: endDateTime, timezone: timezone},
|
||||
baseUrl+"Schedule/calculate-duration",
|
||||
{startTime: startDateTime, endTime: endDateTime, timezone: timezone},
|
||||
function(data) {
|
||||
$('#add_show_duration').val(JSON.parse(data));
|
||||
loadingIcon.hide();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Since Zend's setAttrib won't apply through the wrapper, set accept=image/* here
|
||||
$("#add_show_logo").prop("accept", "image/*");
|
||||
|
||||
|
|
|
@ -369,7 +369,7 @@ function eventDrop(event, dayDelta, minuteDelta, allDay, revertFunc, jsEvent, ui
|
|||
}
|
||||
|
||||
//Workaround for cases where FullCalendar handles events over DST
|
||||
//time changes in a different way than Airtime does.
|
||||
//time changes in a different way than Airtime does.
|
||||
//(Airtime preserves show duration, FullCalendar doesn't.)
|
||||
scheduleRefetchEvents(json);
|
||||
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
var AIRTIME = (function(AIRTIME){
|
||||
var mod;
|
||||
|
||||
|
||||
if (AIRTIME.schedule === undefined) {
|
||||
AIRTIME.schedule = {};
|
||||
}
|
||||
mod = AIRTIME.schedule;
|
||||
|
||||
|
||||
return AIRTIME;
|
||||
|
||||
|
||||
}(AIRTIME || {}));
|
||||
|
||||
var serverTimezoneOffset = 0;
|
||||
|
||||
function closeDialogCalendar(event, ui) {
|
||||
|
||||
|
||||
$el = $(this);
|
||||
$el.dialog('destroy');
|
||||
$el.remove();
|
||||
|
||||
|
||||
//need to refetch the events to update scheduled status.
|
||||
$("#schedule_calendar").fullCalendar( 'refetchEvents' );
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ function confirmCancelRecordedShow(show_instance_id){
|
|||
function findViewportDimensions() {
|
||||
var viewportwidth,
|
||||
viewportheight;
|
||||
|
||||
|
||||
// the more standards compliant browsers (mozilla/netscape/opera/IE7) use
|
||||
// window.innerWidth and window.innerHeight
|
||||
if (typeof window.innerWidth != 'undefined') {
|
||||
|
@ -70,7 +70,7 @@ function findViewportDimensions() {
|
|||
viewportwidth = document.getElementsByTagName('body')[0].clientWidth;
|
||||
viewportheight = document.getElementsByTagName('body')[0].clientHeight;
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
width: viewportwidth,
|
||||
height: viewportheight-45
|
||||
|
@ -189,10 +189,10 @@ function buildScheduleDialog (json, instance_id) {
|
|||
fnServer.ops.showFilter = 0;
|
||||
fnServer.ops.showInstanceFilter = instance_id;
|
||||
fnServer.ops.myShows = 0;
|
||||
|
||||
|
||||
AIRTIME.library.libraryInit();
|
||||
AIRTIME.showbuilder.builderDataTable();
|
||||
|
||||
|
||||
dialog.dialog('open');
|
||||
highlightMediaTypeSelector(dialog);
|
||||
buildTimerange(dialog);
|
||||
|
@ -203,15 +203,15 @@ function buildContentDialog (json){
|
|||
viewport = findViewportDimensions(),
|
||||
height = viewport.height * 2/3,
|
||||
width = viewport.width * 4/5;
|
||||
|
||||
|
||||
if (json.show_error == true){
|
||||
alertShowErrorAndReload();
|
||||
}
|
||||
|
||||
|
||||
dialog.find("#show_progressbar").progressbar({
|
||||
value: json.percentFilled
|
||||
});
|
||||
|
||||
|
||||
dialog.dialog({
|
||||
autoOpen: false,
|
||||
title: $.i18n._("Contents of Show") +" '" + json.showTitle + "'",
|
||||
|
@ -258,7 +258,7 @@ function createFullCalendar(data){
|
|||
left: 'prev, next, today',
|
||||
center: 'title',
|
||||
right: 'agendaDay, agendaWeek, month'
|
||||
},
|
||||
},
|
||||
defaultView: getTimeScalePreference(data),
|
||||
slotMinutes: getTimeIntervalPreference(data),
|
||||
firstDay: data.calendarInit.weekStartDay,
|
||||
|
@ -314,7 +314,7 @@ function createFullCalendar(data){
|
|||
lazyFetching: true,
|
||||
serverTimestamp: parseInt(data.calendarInit.timestamp, 10),
|
||||
serverTimezoneOffset: parseInt(data.calendarInit.timezoneOffset, 10),
|
||||
|
||||
|
||||
events: getFullCalendarEvents,
|
||||
|
||||
//callbacks (in full-calendar-functions.js)
|
||||
|
@ -342,31 +342,31 @@ $(document).ready(function() {
|
|||
trigger: "left",
|
||||
ignoreRightClick: true,
|
||||
className: 'calendar-context-menu',
|
||||
|
||||
|
||||
build: function($el, e) {
|
||||
var data,
|
||||
items,
|
||||
var data,
|
||||
items,
|
||||
callback;
|
||||
|
||||
|
||||
data = $el.data("event");
|
||||
|
||||
|
||||
function processMenuItems(oItems) {
|
||||
|
||||
|
||||
//define a schedule callback.
|
||||
if (oItems.schedule !== undefined) {
|
||||
|
||||
|
||||
callback = function() {
|
||||
$.post(oItems.schedule.url, {format: "json", id: data.id}, function(json){
|
||||
buildScheduleDialog(json, data.id);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
oItems.schedule.callback = callback;
|
||||
}
|
||||
|
||||
|
||||
//define a clear callback.
|
||||
if (oItems.clear !== undefined) {
|
||||
|
||||
|
||||
callback = function() {
|
||||
if (confirm($.i18n._("Remove all content?"))) {
|
||||
$.post(oItems.clear.url, {format: "json", id: data.id}, function(json){
|
||||
|
@ -376,13 +376,13 @@ $(document).ready(function() {
|
|||
};
|
||||
oItems.clear.callback = callback;
|
||||
}
|
||||
|
||||
|
||||
//define an edit callback.
|
||||
if (oItems.edit !== undefined) {
|
||||
if(oItems.edit.items !== undefined){
|
||||
var edit = oItems.edit.items;
|
||||
|
||||
|
||||
|
||||
|
||||
//edit a single instance
|
||||
callback = function() {
|
||||
$.get(edit.instance.url, {format: "json", showId: data.showId, instanceId: data.id, type: "instance"}, function(json){
|
||||
|
@ -390,7 +390,7 @@ $(document).ready(function() {
|
|||
});
|
||||
};
|
||||
edit.instance.callback = callback;
|
||||
|
||||
|
||||
//edit this instance and all
|
||||
callback = function() {
|
||||
$.get(edit.all.url, {format: "json", showId: data.showId, instanceId: data.id, type: "all"}, function(json){
|
||||
|
@ -410,7 +410,7 @@ $(document).ready(function() {
|
|||
|
||||
//define a content callback.
|
||||
if (oItems.content !== undefined) {
|
||||
|
||||
|
||||
callback = function() {
|
||||
$.get(oItems.content.url, {format: "json", id: data.id}, function(json){
|
||||
buildContentDialog(json);
|
||||
|
@ -418,16 +418,16 @@ $(document).ready(function() {
|
|||
};
|
||||
oItems.content.callback = callback;
|
||||
}
|
||||
|
||||
|
||||
//define a cancel recorded show callback.
|
||||
if (oItems.cancel_recorded !== undefined) {
|
||||
|
||||
|
||||
callback = function() {
|
||||
confirmCancelRecordedShow(data.id);
|
||||
};
|
||||
oItems.cancel_recorded.callback = callback;
|
||||
}
|
||||
|
||||
|
||||
//define a view recorded callback.
|
||||
if (oItems.view_recorded !== undefined) {
|
||||
callback = function() {
|
||||
|
@ -438,23 +438,23 @@ $(document).ready(function() {
|
|||
};
|
||||
oItems.view_recorded.callback = callback;
|
||||
}
|
||||
|
||||
|
||||
//define a cancel callback.
|
||||
if (oItems.cancel !== undefined) {
|
||||
|
||||
|
||||
callback = function() {
|
||||
confirmCancelShow(data.id);
|
||||
};
|
||||
oItems.cancel.callback = callback;
|
||||
}
|
||||
|
||||
|
||||
//define a delete callback.
|
||||
if (oItems.del !== undefined) {
|
||||
|
||||
|
||||
//repeating show multiple delete options
|
||||
if (oItems.del.items !== undefined) {
|
||||
var del = oItems.del.items;
|
||||
|
||||
|
||||
//delete a single instance
|
||||
callback = function() {
|
||||
$.post(del.single.url, {format: "json", id: data.id}, function(json){
|
||||
|
@ -462,15 +462,15 @@ $(document).ready(function() {
|
|||
});
|
||||
};
|
||||
del.single.callback = callback;
|
||||
|
||||
|
||||
//delete this instance and all following instances.
|
||||
callback = function() {
|
||||
$.post(del.following.url, {format: "json", id: data.id}, function(json){
|
||||
scheduleRefetchEvents(json);
|
||||
});
|
||||
};
|
||||
del.following.callback = callback;
|
||||
|
||||
del.following.callback = callback;
|
||||
|
||||
}
|
||||
//single show
|
||||
else {
|
||||
|
@ -479,10 +479,10 @@ $(document).ready(function() {
|
|||
scheduleRefetchEvents(json);
|
||||
});
|
||||
};
|
||||
oItems.del.callback = callback;
|
||||
oItems.del.callback = callback;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
items = oItems;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
AIRTIME = (function(AIRTIME) {
|
||||
|
||||
|
||||
var viewport,
|
||||
$lib,
|
||||
$libWrapper,
|
||||
|
@ -16,23 +16,23 @@ AIRTIME = (function(AIRTIME) {
|
|||
dateEndId = "#sb_date_end",
|
||||
timeEndId = "#sb_time_end",
|
||||
mod;
|
||||
|
||||
|
||||
if (AIRTIME.builderMain === undefined) {
|
||||
AIRTIME.builderMain = {};
|
||||
}
|
||||
mod = AIRTIME.builderMain;
|
||||
|
||||
|
||||
oBaseDatePickerSettings = {
|
||||
dateFormat: 'yy-mm-dd',
|
||||
//i18n_months, i18n_days_short are in common.js
|
||||
monthNames: i18n_months,
|
||||
dayNamesMin: i18n_days_short,
|
||||
onClick: function(sDate, oDatePicker) {
|
||||
onClick: function(sDate, oDatePicker) {
|
||||
$(this).datepicker( "setDate", sDate );
|
||||
},
|
||||
onClose: validateTimeRange
|
||||
};
|
||||
|
||||
|
||||
oBaseTimePickerSettings = {
|
||||
showPeriodLabels: false,
|
||||
showCloseButton: true,
|
||||
|
@ -43,7 +43,7 @@ AIRTIME = (function(AIRTIME) {
|
|||
minuteText: $.i18n._("Minute"),
|
||||
onClose: validateTimeRange
|
||||
};
|
||||
|
||||
|
||||
function setWidgetSize() {
|
||||
viewport = AIRTIME.utilities.findViewportDimensions();
|
||||
widgetHeight = viewport.height - 180;
|
||||
|
@ -52,27 +52,27 @@ AIRTIME = (function(AIRTIME) {
|
|||
var libTableHeight = widgetHeight - 175,
|
||||
builderTableHeight = widgetHeight - 95,
|
||||
oTable;
|
||||
|
||||
|
||||
if ($fs.is(':visible')) {
|
||||
builderTableHeight = builderTableHeight - 40;
|
||||
}
|
||||
|
||||
|
||||
//set the heights of the main widgets.
|
||||
$builder//.height(widgetHeight)
|
||||
.find(".dataTables_scrolling")
|
||||
//.css("max-height", builderTableHeight)
|
||||
.end();
|
||||
//.width(screenWidth);
|
||||
|
||||
|
||||
$lib//.height(widgetHeight)
|
||||
.find(".dataTables_scrolling")
|
||||
//.css("max-height", libTableHeight)
|
||||
.end();
|
||||
|
||||
|
||||
if ($lib.filter(':visible').length > 0) {
|
||||
|
||||
|
||||
//$lib.width(Math.floor(screenWidth * 0.47));
|
||||
|
||||
|
||||
$builder//.width(Math.floor(screenWidth * 0.47))
|
||||
.find("#sb_edit")
|
||||
.remove()
|
||||
|
@ -80,18 +80,18 @@ AIRTIME = (function(AIRTIME) {
|
|||
.find("#sb_date_start")
|
||||
.css("margin-left", 0)
|
||||
.end();
|
||||
|
||||
|
||||
oTable = $('#show_builder_table').dataTable();
|
||||
//oTable.fnDraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function showSearchSubmit() {
|
||||
var fn,
|
||||
op,
|
||||
oTable = $('#show_builder_table').dataTable(),
|
||||
check;
|
||||
|
||||
|
||||
check = validateTimeRange();
|
||||
|
||||
if (check.isValid) {
|
||||
|
@ -204,15 +204,15 @@ AIRTIME = (function(AIRTIME) {
|
|||
$builder.find(timeStartId)
|
||||
.timepicker(oBaseTimePickerSettings)
|
||||
.blur(validateTimeRange);
|
||||
|
||||
|
||||
$builder.find(dateEndId)
|
||||
.datepicker(oBaseDatePickerSettings)
|
||||
.blur(validateTimeRange);
|
||||
|
||||
|
||||
$builder.find(timeEndId)
|
||||
.timepicker(oBaseTimePickerSettings)
|
||||
.blur(validateTimeRange);
|
||||
|
||||
|
||||
|
||||
oRange = AIRTIME.utilities.fnGetScheduleRange(dateStartId, timeStartId,
|
||||
dateEndId, timeEndId);
|
||||
|
@ -223,7 +223,7 @@ AIRTIME = (function(AIRTIME) {
|
|||
if (AIRTIME.library !== undefined) {
|
||||
AIRTIME.library.libraryInit();
|
||||
}
|
||||
|
||||
|
||||
AIRTIME.showbuilder.builderDataTable();
|
||||
setWidgetSize();
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
function generatePartitions(partitions){
|
||||
|
||||
var rowTemplate =
|
||||
var rowTemplate =
|
||||
'<tr class="partition-info">'+
|
||||
'<td><span class="strong">'+$.i18n._("Disk")+' #%s</span>'+
|
||||
'<ul id="watched-dir-list-%s">'+
|
||||
|
@ -25,7 +25,7 @@ function generatePartitions(partitions){
|
|||
|
||||
var spaceUsedGb = sprintf("%01.1f", spaceUsed/Math.pow(2, 30));
|
||||
var totalSpaceGb = sprintf("%01.1f", totalSpace/Math.pow(2, 30));
|
||||
|
||||
|
||||
var row = sprintf(rowTemplate, i+1, i, spaceUsedGb, totalSpaceGb, percUsed, percUsed);
|
||||
var tr = $(row);
|
||||
lastElement.after(tr);
|
||||
|
@ -38,7 +38,7 @@ function generatePartitions(partitions){
|
|||
}
|
||||
lastElement = tr;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function success(data, textStatus, jqXHR){
|
||||
|
@ -49,14 +49,14 @@ function success(data, textStatus, jqXHR){
|
|||
if (s) {
|
||||
var children = $("#"+s.name).children();
|
||||
$(children[0]).text(s.name);
|
||||
|
||||
|
||||
var status_class = "not-available-icon";
|
||||
if (s.status == 0){
|
||||
status_class = "checked-icon";
|
||||
} else if (s.status == 1) {
|
||||
status_class = "warning-icon";
|
||||
}
|
||||
|
||||
|
||||
$($(children[1]).children()[0]).attr("class", status_class);
|
||||
$(children[2]).text(sprintf('%(days)sd %(hours)sh %(minutes)sm %(seconds)ss', convertSecondsToDaysHoursMinutesSeconds(s.uptime_seconds)));
|
||||
$(children[3]).text(s.cpu_perc);
|
||||
|
@ -71,7 +71,7 @@ function success(data, textStatus, jqXHR){
|
|||
|
||||
function updateStatus(getDiskInfo){
|
||||
$.getJSON( baseUrl+"api/status/format/json/diskinfo/"+getDiskInfo, null, success);
|
||||
|
||||
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
function populateForm(entries){
|
||||
//$('#user_details').show();
|
||||
|
||||
|
||||
$('.errors').remove();
|
||||
$('.success').remove();
|
||||
|
||||
|
||||
if (entries.type === 'S')
|
||||
{
|
||||
{
|
||||
$("#user_details").hide();
|
||||
$("#user_details_superadmin_message").show();
|
||||
$('#type').attr('disabled', '1');
|
||||
} else {
|
||||
$("#user_details").show();
|
||||
$("#user_details_superadmin_message").hide();
|
||||
$('#type').removeAttr('disabled');
|
||||
$('#type').removeAttr('disabled');
|
||||
}
|
||||
|
||||
|
||||
$('#user_id').val(entries.id);
|
||||
$('#login').val(entries.login);
|
||||
$('#first_name').val(entries.first_name);
|
||||
|
@ -24,7 +24,7 @@ function populateForm(entries){
|
|||
$('#cell_phone').val(entries.cell_phone);
|
||||
$('#skype').val(entries.skype_contact);
|
||||
$('#jabber').val(entries.jabber_contact);
|
||||
|
||||
|
||||
if (entries.id.length != 0){
|
||||
$('#login').attr('readonly', 'readonly');
|
||||
$('#password').val("xxxxxx");
|
||||
|
@ -80,7 +80,7 @@ function rowCallback( nRow, aData, iDisplayIndex ){
|
|||
$('td:eq(3)', nRow).html( $.i18n._('Super Admin') );
|
||||
$('td:eq(4)', nRow).html(""); //Disable deleting the super admin
|
||||
}
|
||||
|
||||
|
||||
return nRow;
|
||||
}
|
||||
|
||||
|
@ -92,10 +92,10 @@ function populateUserTable() {
|
|||
"sAjaxSource": baseUrl+"User/get-user-data-table-info/format/json",
|
||||
"fnServerData": function ( sSource, aoData, fnCallback ) {
|
||||
$.ajax( {
|
||||
"dataType": 'json',
|
||||
"type": "POST",
|
||||
"url": sSource,
|
||||
"data": aoData,
|
||||
"dataType": 'json',
|
||||
"type": "POST",
|
||||
"url": sSource,
|
||||
"data": aoData,
|
||||
"success": fnCallback
|
||||
} );
|
||||
},
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
var AIRTIME = (function(AIRTIME){
|
||||
var mod;
|
||||
|
||||
|
||||
if (AIRTIME.utilities === undefined) {
|
||||
AIRTIME.utilities = {};
|
||||
}
|
||||
mod = AIRTIME.utilities;
|
||||
|
||||
|
||||
mod.findViewportDimensions = function() {
|
||||
var viewportwidth,
|
||||
viewportheight;
|
||||
|
||||
|
||||
// the more standards compliant browsers (mozilla/netscape/opera/IE7) use
|
||||
// window.innerWidth and window.innerHeight
|
||||
if (typeof window.innerWidth != 'undefined') {
|
||||
|
@ -28,49 +28,49 @@ var AIRTIME = (function(AIRTIME){
|
|||
viewportwidth = document.getElementsByTagName('body')[0].clientWidth;
|
||||
viewportheight = document.getElementsByTagName('body')[0].clientHeight;
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
width: viewportwidth,
|
||||
height: viewportheight
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Returns an object containing a unix timestamp in seconds for the start/end range
|
||||
*
|
||||
*
|
||||
* @return Object {"start", "end", "range"}
|
||||
*/
|
||||
mod.fnGetScheduleRange = function(dateStartId, timeStartId, dateEndId, timeEndId) {
|
||||
var start,
|
||||
end,
|
||||
time;
|
||||
|
||||
|
||||
start = $(dateStartId).val();
|
||||
start = start === "" ? null : start;
|
||||
|
||||
|
||||
time = $(timeStartId).val();
|
||||
time = time === "" ? "00:00" : time;
|
||||
|
||||
|
||||
if (start) {
|
||||
start = start + " " + time;
|
||||
}
|
||||
|
||||
|
||||
end = $(dateEndId).val();
|
||||
end = end === "" ? null : end;
|
||||
|
||||
|
||||
time = $(timeEndId).val();
|
||||
time = time === "" ? "00:00" : time;
|
||||
|
||||
|
||||
if (end) {
|
||||
end = end + " " + time;
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
start: start,
|
||||
end: end
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
return AIRTIME;
|
||||
|
||||
|
||||
}(AIRTIME || {}));
|
||||
|
|
|
@ -537,5 +537,3 @@ var AIRTIME = (function(AIRTIME) {
|
|||
return AIRTIME;
|
||||
|
||||
}(AIRTIME || {}));
|
||||
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ $.growlUI = function(title, message, timeout, onClose) {
|
|||
$.blockUI({
|
||||
message: $m, fadeIn: 700, fadeOut: 1000, centerY: false,
|
||||
timeout: timeout, showOverlay: false,
|
||||
onUnblock: onClose,
|
||||
onUnblock: onClose,
|
||||
css: $.blockUI.defaults.growlCSS
|
||||
});
|
||||
};
|
||||
|
@ -76,9 +76,9 @@ $.blockUI.defaults = {
|
|||
|
||||
title: null, // title string; only used when theme == true
|
||||
draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded)
|
||||
|
||||
|
||||
theme: false, // set to true to use with jQuery UI themes
|
||||
|
||||
|
||||
// styles for the message when blocking; if you wish to disable
|
||||
// these and use an external stylesheet then do this in your code:
|
||||
// $.blockUI.defaults.css = {};
|
||||
|
@ -94,7 +94,7 @@ $.blockUI.defaults = {
|
|||
backgroundColor:'#fff',
|
||||
cursor: 'wait'
|
||||
},
|
||||
|
||||
|
||||
// minimal style set used when themes are used
|
||||
themedCSS: {
|
||||
width: '30%',
|
||||
|
@ -125,7 +125,7 @@ $.blockUI.defaults = {
|
|||
'-moz-border-radius': '10px',
|
||||
'border-radius': '10px'
|
||||
},
|
||||
|
||||
|
||||
// IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
|
||||
// (hat tip to Jorge H. N. de Vasconcelos)
|
||||
iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',
|
||||
|
@ -169,7 +169,7 @@ $.blockUI.defaults = {
|
|||
|
||||
// suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
|
||||
applyPlatformOpacityRules: true,
|
||||
|
||||
|
||||
// callback method invoked when fadeIn has completed and blocking message is visible
|
||||
onBlock: null,
|
||||
|
||||
|
@ -227,11 +227,11 @@ function install(el, opts) {
|
|||
// layer2 is the overlay layer which has opacity and a wait cursor (by default)
|
||||
// layer3 is the message content that is displayed while blocking
|
||||
|
||||
var lyr1 = ($.browser.msie || opts.forceIframe)
|
||||
var lyr1 = ($.browser.msie || opts.forceIframe)
|
||||
? $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>')
|
||||
: $('<div class="blockUI" style="display:none"></div>');
|
||||
|
||||
var lyr2 = opts.theme
|
||||
|
||||
var lyr2 = opts.theme
|
||||
? $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>')
|
||||
: $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
|
||||
|
||||
|
@ -250,7 +250,7 @@ function install(el, opts) {
|
|||
}
|
||||
else if (full) {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ function install(el, opts) {
|
|||
lyr3.css(themedCSS);
|
||||
lyr3.addClass('ui-widget-content');
|
||||
}
|
||||
else
|
||||
else
|
||||
lyr3.css(css);
|
||||
}
|
||||
|
||||
|
@ -280,7 +280,7 @@ function install(el, opts) {
|
|||
$.each(layers, function() {
|
||||
this.appendTo($par);
|
||||
});
|
||||
|
||||
|
||||
if (opts.theme && opts.draggable && $.fn.draggable) {
|
||||
lyr3.draggable({
|
||||
handle: '.ui-dialog-titlebar',
|
||||
|
@ -443,7 +443,7 @@ function bind(b, el, opts) {
|
|||
$el.data('blockUI.isBlocked', b);
|
||||
|
||||
// don't bind events when overlay is not in use or if bindEvents is false
|
||||
if (!opts.bindEvents || (b && !opts.showOverlay))
|
||||
if (!opts.bindEvents || (b && !opts.showOverlay))
|
||||
return;
|
||||
|
||||
// bind anchors and inputs for mouse and key events
|
||||
|
|
|
@ -44,9 +44,9 @@
|
|||
constructor: DateTimePicker,
|
||||
|
||||
init: function(element, options) {
|
||||
|
||||
|
||||
dates = $.fn.datetimepicker.dates;
|
||||
|
||||
|
||||
var icon;
|
||||
if (!(options.pickTime || options.pickDate))
|
||||
throw new Error('Must choose at least one picker');
|
||||
|
@ -271,16 +271,16 @@
|
|||
offset.top = offset.top + this.height;
|
||||
|
||||
var $window = $(window);
|
||||
|
||||
|
||||
if ( this.options.width != undefined ) {
|
||||
this.widget.width( this.options.width );
|
||||
}
|
||||
|
||||
|
||||
if ( this.options.orientation == 'left' ) {
|
||||
this.widget.addClass( 'left-oriented' );
|
||||
offset.left = offset.left - this.widget.width() + 20;
|
||||
}
|
||||
|
||||
|
||||
if (this._isInFixed()) {
|
||||
position = 'fixed';
|
||||
offset.top -= $window.scrollTop();
|
||||
|
@ -1303,4 +1303,4 @@
|
|||
}
|
||||
|
||||
|
||||
})(window.jQuery)
|
||||
})(window.jQuery)
|
||||
|
|
2
legacy/public/js/bootstrap/bootstrap.min.js
vendored
2
legacy/public/js/bootstrap/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* Color picker
|
||||
* Author: Stefan Petre www.eyecon.ro
|
||||
*
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses
|
||||
*
|
||||
*
|
||||
*/
|
||||
(function ($) {
|
||||
var ColorPicker = function () {
|
||||
|
@ -112,7 +112,7 @@
|
|||
y: ev.pageY,
|
||||
field: field,
|
||||
val: parseInt(field.val(), 10),
|
||||
preview: $(this).parent().parent().data('colorpicker').livePreview
|
||||
preview: $(this).parent().parent().data('colorpicker').livePreview
|
||||
};
|
||||
$(document).bind('mouseup', current, upIncrement);
|
||||
$(document).bind('mousemove', current, moveIncrement);
|
||||
|
@ -262,7 +262,7 @@
|
|||
s: Math.min(100, Math.max(0, hsb.s)),
|
||||
b: Math.min(100, Math.max(0, hsb.b))
|
||||
};
|
||||
},
|
||||
},
|
||||
fixRGB = function (rgb) {
|
||||
return {
|
||||
r: Math.min(255, Math.max(0, rgb.r)),
|
||||
|
@ -281,7 +281,7 @@
|
|||
hex = o.join('');
|
||||
}
|
||||
return hex;
|
||||
},
|
||||
},
|
||||
HexToRGB = function (hex) {
|
||||
var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
|
||||
return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
|
||||
|
@ -300,7 +300,7 @@
|
|||
var delta = max - min;
|
||||
hsb.b = max;
|
||||
if (max != 0) {
|
||||
|
||||
|
||||
}
|
||||
hsb.s = max != 0 ? 255 * delta / max : 0;
|
||||
if (hsb.s != 0) {
|
||||
|
|
|
@ -11,7 +11,7 @@ denise@denise-DX4860:~/airtime/legacy/public/js/contextmenu$ diff -u jquery.cont
|
|||
+ /* (Airtime) added this to allow user to exit out of menu.
|
||||
+ * if ignoreThisClick remains false, every right click
|
||||
+ * thereafter continues to show the menu
|
||||
+ */
|
||||
+ */
|
||||
+ if (ignoreRightClick) {
|
||||
+ if (e.button == 2) {
|
||||
+ ignoreThisClick = true;
|
||||
|
@ -20,4 +20,3 @@ denise@denise-DX4860:~/airtime/legacy/public/js/contextmenu$ diff -u jquery.cont
|
|||
},
|
||||
// key handled :hover
|
||||
keyStop: function(e, opt) {
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*/
|
||||
|
||||
(function($, undefined){
|
||||
|
||||
|
||||
// TODO: -
|
||||
// ARIA stuff: menuitem, menuitemcheckbox und menuitemradio
|
||||
// create <menu> structure if $.support[htmlCommand || htmlMenuitem] and !opt.disableNative
|
||||
|
@ -97,21 +97,21 @@ var // currently active contextMenu trigger
|
|||
}
|
||||
offset = {top: y, left: x};
|
||||
}
|
||||
|
||||
|
||||
// correct offset if viewport demands it
|
||||
var bottom = $win.scrollTop() + $win.height(),
|
||||
right = $win.scrollLeft() + $win.width(),
|
||||
height = opt.$menu.height(),
|
||||
width = opt.$menu.width();
|
||||
|
||||
|
||||
if (offset.top + height > bottom) {
|
||||
offset.top -= height;
|
||||
}
|
||||
|
||||
|
||||
if (offset.left + width > right) {
|
||||
offset.left -= width;
|
||||
}
|
||||
|
||||
|
||||
opt.$menu.css(offset);
|
||||
},
|
||||
// position the sub-menu
|
||||
|
@ -169,7 +169,7 @@ var // currently active contextMenu trigger
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return zin;
|
||||
},
|
||||
// event handlers
|
||||
|
@ -179,26 +179,26 @@ var // currently active contextMenu trigger
|
|||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
},
|
||||
|
||||
|
||||
// contextmenu show dispatcher
|
||||
contextmenu: function(e) {
|
||||
var $this = $(this);
|
||||
// disable actual context-menu
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
|
||||
|
||||
// ignore right click trigger
|
||||
if (ignoreThisClick) {
|
||||
ignoreThisClick = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!$this.hasClass('context-menu-disabled')) {
|
||||
// theoretically need to fire a show event at <menu>
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#context-menus
|
||||
// var evt = jQuery.Event("show", { data: data, pageX: e.pageX, pageY: e.pageY, relatedTarget: this });
|
||||
// e.data.$menu.trigger(evt);
|
||||
|
||||
|
||||
$currentTrigger = $this;
|
||||
if (e.data.build) {
|
||||
// dynamically build menu on invocation
|
||||
|
@ -219,12 +219,12 @@ var // currently active contextMenu trigger
|
|||
mousedown: function(e) {
|
||||
// register mouse down
|
||||
var $this = $(this);
|
||||
|
||||
|
||||
// hide any previous menus
|
||||
if ($currentTrigger && $currentTrigger.length && !$currentTrigger.is($this)) {
|
||||
$currentTrigger.data('contextMenu').$menu.trigger('contextmenu:hide');
|
||||
}
|
||||
|
||||
|
||||
// activate on right click
|
||||
if (e.button == 2) {
|
||||
$currentTrigger = $this.data('contextMenuActive', true);
|
||||
|
@ -240,7 +240,7 @@ var // currently active contextMenu trigger
|
|||
$currentTrigger = $this;
|
||||
$this.trigger(jQuery.Event("contextmenu", { data: e.data, pageX: e.pageX, pageY: e.pageY }));
|
||||
}
|
||||
|
||||
|
||||
$this.removeData('contextMenuActive');
|
||||
},
|
||||
// contextMenu hover trigger
|
||||
|
@ -248,17 +248,17 @@ var // currently active contextMenu trigger
|
|||
var $this = $(this),
|
||||
$related = $(e.relatedTarget),
|
||||
$document = $(document);
|
||||
|
||||
|
||||
// abort if we're coming from a menu
|
||||
if ($related.is('.context-menu-list') || $related.closest('.context-menu-list').length) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// abort if a menu is shown
|
||||
if ($currentTrigger && $currentTrigger.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
hoveract.pageX = e.pageX;
|
||||
hoveract.pageY = e.pageY;
|
||||
hoveract.data = e.data;
|
||||
|
@ -282,11 +282,11 @@ var // currently active contextMenu trigger
|
|||
if ($related.is('.context-menu-list') || $related.closest('.context-menu-list').length) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
clearTimeout(hoveract.timer);
|
||||
} catch(e) {}
|
||||
|
||||
|
||||
hoveract.timer = null;
|
||||
},
|
||||
|
||||
|
@ -296,12 +296,12 @@ var // currently active contextMenu trigger
|
|||
ignoreThisClick = true;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// click on layer to hide contextMenu
|
||||
layerClick: function(e) {
|
||||
var $this = $(this),
|
||||
root = $this.data('contextMenuRoot');
|
||||
|
||||
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
$this.remove();
|
||||
|
@ -309,7 +309,7 @@ var // currently active contextMenu trigger
|
|||
/* (Airtime) added this to allow user to exit out of menu.
|
||||
* if ignoreThisClick remains false, every right click
|
||||
* thereafter continues to show the menu
|
||||
*/
|
||||
*/
|
||||
if (handle.ignoreRightClick) {
|
||||
if (e.button == 2) {
|
||||
ignoreThisClick = true;
|
||||
|
@ -321,7 +321,7 @@ var // currently active contextMenu trigger
|
|||
if (!opt.isInput) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
|
||||
e.stopPropagation();
|
||||
},
|
||||
key: function(e) {
|
||||
|
@ -349,7 +349,7 @@ var // currently active contextMenu trigger
|
|||
opt.$menu.trigger('prevcommand');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
case 9: // tab
|
||||
case 40: // down
|
||||
handle.keyStop(e, opt);
|
||||
|
@ -369,13 +369,13 @@ var // currently active contextMenu trigger
|
|||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 37: // left
|
||||
handle.keyStop(e, opt);
|
||||
if (opt.isInput || !opt.$selected || !opt.$selected.length) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (!opt.$selected.parent().hasClass('context-menu-root')) {
|
||||
var $parent = opt.$selected.parent().parent();
|
||||
opt.$selected.trigger('contextmenu:blur');
|
||||
|
@ -383,13 +383,13 @@ var // currently active contextMenu trigger
|
|||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 39: // right
|
||||
handle.keyStop(e, opt);
|
||||
if (opt.isInput || !opt.$selected || !opt.$selected.length) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
var itemdata = opt.$selected.data('contextMenu') || {};
|
||||
if (itemdata.$menu && opt.$selected.hasClass('context-menu-submenu')) {
|
||||
opt.$selected = null;
|
||||
|
@ -398,7 +398,7 @@ var // currently active contextMenu trigger
|
|||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 35: // end
|
||||
case 36: // home
|
||||
if (opt.$selected && opt.$selected.find('input, textarea, select').length) {
|
||||
|
@ -411,7 +411,7 @@ var // currently active contextMenu trigger
|
|||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 13: // enter
|
||||
handle.keyStop(e, opt);
|
||||
if (opt.isInput) {
|
||||
|
@ -423,19 +423,19 @@ var // currently active contextMenu trigger
|
|||
}
|
||||
opt.$selected && opt.$selected.trigger('mouseup');
|
||||
return;
|
||||
|
||||
|
||||
case 32: // space
|
||||
case 33: // page up
|
||||
case 34: // page down
|
||||
// prevent browser from scrolling down while menu is visible
|
||||
handle.keyStop(e, opt);
|
||||
return;
|
||||
|
||||
|
||||
case 27: // esc
|
||||
handle.keyStop(e, opt);
|
||||
opt.$menu.trigger('contextmenu:hide');
|
||||
return;
|
||||
|
||||
|
||||
default: // 0-9, a-z
|
||||
var k = (String.fromCharCode(e.keyCode)).toUpperCase();
|
||||
if (opt.accesskeys[k]) {
|
||||
|
@ -448,7 +448,7 @@ var // currently active contextMenu trigger
|
|||
}
|
||||
break;
|
||||
}
|
||||
// pass event to selected item,
|
||||
// pass event to selected item,
|
||||
// stop propagation to avoid endless recursion
|
||||
e.stopPropagation();
|
||||
opt.$selected && opt.$selected.trigger(e);
|
||||
|
@ -465,11 +465,11 @@ var // currently active contextMenu trigger
|
|||
opt = opt.$selected.parent().data('contextMenu') || {};
|
||||
opt.$selected = $s;
|
||||
}
|
||||
|
||||
|
||||
var $children = opt.$menu.children(),
|
||||
$prev = !opt.$selected || !opt.$selected.prev().length ? $children.last() : opt.$selected.prev(),
|
||||
$round = $prev;
|
||||
|
||||
|
||||
// skip disabled
|
||||
while ($prev.hasClass('disabled') || $prev.hasClass('not-selectable')) {
|
||||
if ($prev.prev().length) {
|
||||
|
@ -482,15 +482,15 @@ var // currently active contextMenu trigger
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// leave current
|
||||
if (opt.$selected) {
|
||||
handle.itemMouseleave.call(opt.$selected.get(0), e);
|
||||
}
|
||||
|
||||
|
||||
// activate next
|
||||
handle.itemMouseenter.call($prev.get(0), e);
|
||||
|
||||
|
||||
// focus input
|
||||
var $input = $prev.find('input, textarea, select');
|
||||
if ($input.length) {
|
||||
|
@ -525,22 +525,22 @@ var // currently active contextMenu trigger
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// leave current
|
||||
if (opt.$selected) {
|
||||
handle.itemMouseleave.call(opt.$selected.get(0), e);
|
||||
}
|
||||
|
||||
|
||||
// activate next
|
||||
handle.itemMouseenter.call($next.get(0), e);
|
||||
|
||||
|
||||
// focus input
|
||||
var $input = $next.find('input, textarea, select');
|
||||
if ($input.length) {
|
||||
$input.focus();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// flag that we're inside an input so the key handler can act accordingly
|
||||
focusInput: function(e) {
|
||||
var $this = $(this).closest('.context-menu-item'),
|
||||
|
@ -560,7 +560,7 @@ var // currently active contextMenu trigger
|
|||
|
||||
root.isInput = opt.isInput = false;
|
||||
},
|
||||
|
||||
|
||||
// :hover on menu
|
||||
menuMouseenter: function(e) {
|
||||
var root = $(this).data().contextMenuRoot;
|
||||
|
@ -573,15 +573,15 @@ var // currently active contextMenu trigger
|
|||
root.hovering = false;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
// :hover done manually so key handling is possible
|
||||
itemMouseenter: function(e) {
|
||||
var $this = $(this),
|
||||
data = $this.data(),
|
||||
opt = data.contextMenu,
|
||||
root = data.contextMenuRoot;
|
||||
|
||||
|
||||
root.hovering = true;
|
||||
|
||||
// abort if we're re-entering
|
||||
|
@ -598,7 +598,7 @@ var // currently active contextMenu trigger
|
|||
opt.$selected = null;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$this.trigger('contextmenu:focus');
|
||||
},
|
||||
// :hover done manually so key handling is possible
|
||||
|
@ -615,7 +615,7 @@ var // currently active contextMenu trigger
|
|||
root.$selected = opt.$selected = opt.$node;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$this.trigger('contextmenu:blur');
|
||||
},
|
||||
// contextMenu item click
|
||||
|
@ -640,7 +640,7 @@ var // currently active contextMenu trigger
|
|||
callback = root.callbacks[key];
|
||||
} else if ($.isFunction(root.callback)) {
|
||||
// default callback
|
||||
callback = root.callback;
|
||||
callback = root.callback;
|
||||
} else {
|
||||
// no callback, no action
|
||||
return;
|
||||
|
@ -657,7 +657,7 @@ var // currently active contextMenu trigger
|
|||
inputClick: function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
},
|
||||
|
||||
|
||||
// hide <menu>
|
||||
hideMenu: function(e) {
|
||||
var root = $(this).data('contextMenuRoot');
|
||||
|
@ -673,10 +673,10 @@ var // currently active contextMenu trigger
|
|||
|
||||
$this.addClass('hover')
|
||||
.siblings('.hover').trigger('contextmenu:blur');
|
||||
|
||||
|
||||
// remember selected
|
||||
opt.$selected = root.$selected = $this;
|
||||
|
||||
|
||||
// position sub-menu - do after show so dumb $.ui.position can keep up
|
||||
if (opt.$node) {
|
||||
root.positionSubmenu.call(opt.$node, opt.$menu);
|
||||
|
@ -689,7 +689,7 @@ var // currently active contextMenu trigger
|
|||
data = $this.data(),
|
||||
opt = data.contextMenu,
|
||||
root = data.contextMenuRoot;
|
||||
|
||||
|
||||
$this.removeClass('hover');
|
||||
opt.$selected = null;
|
||||
}
|
||||
|
@ -709,13 +709,13 @@ var // currently active contextMenu trigger
|
|||
$currentTrigger = null;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// backreference for callbacks
|
||||
opt.$trigger = $this;
|
||||
|
||||
// create or update context menu
|
||||
op.update.call($this, opt);
|
||||
|
||||
|
||||
// position menu
|
||||
opt.position.call($this, opt, x, y);
|
||||
|
||||
|
@ -723,13 +723,13 @@ var // currently active contextMenu trigger
|
|||
if (opt.zIndex) {
|
||||
css.zIndex = zindex($this) + opt.zIndex;
|
||||
}
|
||||
|
||||
|
||||
// add layer
|
||||
op.layer.call(opt.$menu, opt, css.zIndex);
|
||||
|
||||
|
||||
// adjust sub-menu zIndexes
|
||||
opt.$menu.find('ul').css('zIndex', css.zIndex + 1);
|
||||
|
||||
|
||||
// position and show context menu
|
||||
opt.$menu.css( css )[opt.animation.show](opt.animation.duration);
|
||||
// make options available
|
||||
|
@ -756,12 +756,12 @@ var // currently active contextMenu trigger
|
|||
if (!opt) {
|
||||
opt = $this.data('contextMenu') || {};
|
||||
}
|
||||
|
||||
|
||||
// hide event
|
||||
if (opt.events && opt.events.hide.call($this, opt) === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (opt.$layer) {
|
||||
try {
|
||||
opt.$layer.remove();
|
||||
|
@ -770,7 +770,7 @@ var // currently active contextMenu trigger
|
|||
opt.$layer = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// remove handle
|
||||
$currentTrigger = null;
|
||||
// remove selected
|
||||
|
@ -781,7 +781,7 @@ var // currently active contextMenu trigger
|
|||
$(document).off('.contextMenuAutoHide').off('keydown.contextMenu');
|
||||
// hide menu
|
||||
opt.$menu && opt.$menu[opt.animation.hide](opt.animation.duration);
|
||||
|
||||
|
||||
// tear down dynamically built menu
|
||||
if (opt.build) {
|
||||
opt.$menu.remove();
|
||||
|
@ -813,28 +813,28 @@ var // currently active contextMenu trigger
|
|||
'contextMenu': opt,
|
||||
'contextMenuRoot': root
|
||||
});
|
||||
|
||||
|
||||
$.each(['callbacks', 'commands', 'inputs'], function(i,k){
|
||||
opt[k] = {};
|
||||
if (!root[k]) {
|
||||
root[k] = {};
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
root.accesskeys || (root.accesskeys = {});
|
||||
|
||||
|
||||
// create contextMenu items
|
||||
$.each(opt.items, function(key, item){
|
||||
var $t = $('<li class="context-menu-item ' + (item.className || "") +'"></li>'),
|
||||
$label = null,
|
||||
$input = null;
|
||||
|
||||
|
||||
item.$node = $t.data({
|
||||
'contextMenu': opt,
|
||||
'contextMenuRoot': root,
|
||||
'contextMenuKey': key
|
||||
});
|
||||
|
||||
|
||||
// register accesskey
|
||||
// NOTE: the accesskey attribute should be applicable to any element, but Safari5 and Chrome13 still can't do that
|
||||
if (item.accesskey) {
|
||||
|
@ -847,7 +847,7 @@ var // currently active contextMenu trigger
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (typeof item == "string") {
|
||||
$t.addClass('context-menu-separator not-selectable');
|
||||
} else if (item.type && types[item.type]) {
|
||||
|
@ -876,13 +876,13 @@ var // currently active contextMenu trigger
|
|||
} else if (item.items) {
|
||||
item.type = 'sub';
|
||||
}
|
||||
|
||||
|
||||
switch (item.type) {
|
||||
case 'text':
|
||||
$input = $('<input type="text" value="1" name="context-menu-input-'+ key +'" value="">')
|
||||
.val(item.value || "").appendTo($label);
|
||||
break;
|
||||
|
||||
|
||||
case 'textarea':
|
||||
$input = $('<textarea name="context-menu-input-'+ key +'"></textarea>')
|
||||
.val(item.value || "").appendTo($label);
|
||||
|
@ -901,7 +901,7 @@ var // currently active contextMenu trigger
|
|||
$input = $('<input type="radio" value="1" name="context-menu-input-'+ item.radio +'" value="">')
|
||||
.val(item.value || "").prop("checked", !!item.selected).prependTo($label);
|
||||
break;
|
||||
|
||||
|
||||
case 'select':
|
||||
$input = $('<select name="context-menu-input-'+ key +'">').appendTo($label);
|
||||
if (item.options) {
|
||||
|
@ -911,7 +911,7 @@ var // currently active contextMenu trigger
|
|||
$input.val(item.selected);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 'sub':
|
||||
$('<span></span>').html(item._name || item.name).appendTo($t);
|
||||
item.appendTo = item.$node;
|
||||
|
@ -919,11 +919,11 @@ var // currently active contextMenu trigger
|
|||
$t.data('contextMenu', item).addClass('context-menu-submenu');
|
||||
item.callback = null;
|
||||
break;
|
||||
|
||||
|
||||
case 'html':
|
||||
$(item.html).appendTo($t);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
$.each([opt, root], function(i,k){
|
||||
k.commands[key] = item;
|
||||
|
@ -931,35 +931,35 @@ var // currently active contextMenu trigger
|
|||
k.callbacks[key] = item.callback;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('<span></span>').html(item._name || item.name || "").appendTo($t);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// disable key listener in <input>
|
||||
if (item.type && item.type != 'sub' && item.type != 'html') {
|
||||
$input
|
||||
.on('focus', handle.focusInput)
|
||||
.on('blur', handle.blurInput);
|
||||
|
||||
|
||||
if (item.events) {
|
||||
$input.on(item.events);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// add icons
|
||||
if (item.icon) {
|
||||
$t.addClass("icon icon-" + item.icon);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// cache contained elements
|
||||
item.$input = $input;
|
||||
item.$label = $label;
|
||||
|
||||
// attach item to menu
|
||||
$t.appendTo(opt.$menu);
|
||||
|
||||
|
||||
// Disable text selection
|
||||
if (!opt.hasTypes) {
|
||||
if($.browser.msie) {
|
||||
|
@ -997,29 +997,29 @@ var // currently active contextMenu trigger
|
|||
|
||||
// dis- / enable item
|
||||
$item[disabled ? 'addClass' : 'removeClass']('disabled');
|
||||
|
||||
|
||||
if (item.type) {
|
||||
// dis- / enable input elements
|
||||
$item.find('input, select, textarea').prop('disabled', disabled);
|
||||
|
||||
|
||||
// update input states
|
||||
switch (item.type) {
|
||||
case 'text':
|
||||
case 'textarea':
|
||||
item.$input.val(item.value || "");
|
||||
break;
|
||||
|
||||
|
||||
case 'checkbox':
|
||||
case 'radio':
|
||||
item.$input.val(item.value || "").prop('checked', !!item.selected);
|
||||
break;
|
||||
|
||||
|
||||
case 'select':
|
||||
item.$input.val(item.selected || "");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (item.$menu) {
|
||||
// update sub-menu
|
||||
op.update.call($this, item, root);
|
||||
|
@ -1041,14 +1041,14 @@ var // currently active contextMenu trigger
|
|||
function splitAccesskey(val) {
|
||||
var t = val.split(/\s+/),
|
||||
keys = [];
|
||||
|
||||
|
||||
for (var i=0, k; k = t[i]; i++) {
|
||||
k = k[0].toUpperCase(); // first character only
|
||||
// theoretically non-accessible characters should be ignored, but different systems, different keyboard layouts, ... screw it.
|
||||
// a map to look up already used access keys would be nice
|
||||
keys.push(k);
|
||||
}
|
||||
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
|
@ -1066,7 +1066,7 @@ $.fn.contextMenu = function(operation) {
|
|||
} else if (!operation) {
|
||||
this.addClass('context-menu-disabled');
|
||||
}
|
||||
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
|
@ -1076,17 +1076,17 @@ $.contextMenu = function(operation, options) {
|
|||
options = operation;
|
||||
operation = 'create';
|
||||
}
|
||||
|
||||
|
||||
if (typeof options == 'string') {
|
||||
options = {selector: options};
|
||||
} else if (options === undefined) {
|
||||
options = {};
|
||||
}
|
||||
|
||||
|
||||
// merge with default options
|
||||
var o = $.extend(true, {}, defaults, options || {}),
|
||||
$body = $body = $(document);
|
||||
|
||||
|
||||
switch (operation) {
|
||||
case 'create':
|
||||
// no selector no joy
|
||||
|
@ -1104,7 +1104,7 @@ $.contextMenu = function(operation, options) {
|
|||
o.ns = '.contextMenu' + counter;
|
||||
namespaces[o.selector] = o.ns;
|
||||
menus[o.ns] = o;
|
||||
|
||||
|
||||
if (!initialized) {
|
||||
// make sure item click is registered first
|
||||
$body
|
||||
|
@ -1128,18 +1128,18 @@ $.contextMenu = function(operation, options) {
|
|||
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
|
||||
// engage native contextmenu event
|
||||
$body
|
||||
.on('contextmenu' + o.ns, o.selector, o, handle.contextmenu);
|
||||
|
||||
|
||||
switch (o.trigger) {
|
||||
case 'hover':
|
||||
$body
|
||||
.on('mouseenter' + o.ns, o.selector, o, handle.mouseenter)
|
||||
.on('mouseleave' + o.ns, o.selector, o, handle.mouseleave);
|
||||
.on('mouseleave' + o.ns, o.selector, o, handle.mouseleave);
|
||||
break;
|
||||
|
||||
|
||||
case 'left':
|
||||
$body.on('click' + o.ns, o.selector, o, handle.click);
|
||||
break;
|
||||
|
@ -1152,7 +1152,7 @@ $.contextMenu = function(operation, options) {
|
|||
break;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
if (o.trigger != 'hover' && o.ignoreRightClick) {
|
||||
$body.on('mousedown' + o.ns, o.selector, handle.ignoreRightClick);
|
||||
}
|
||||
|
@ -1162,35 +1162,35 @@ $.contextMenu = function(operation, options) {
|
|||
op.create(o);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 'destroy':
|
||||
if (!o.selector) {
|
||||
$body.off('.contextMenu .contextMenuAutoHide');
|
||||
$.each(namespaces, function(key, value) {
|
||||
$body.off(value);
|
||||
});
|
||||
|
||||
|
||||
namespaces = {};
|
||||
menus = {};
|
||||
counter = 0;
|
||||
initialized = false;
|
||||
|
||||
|
||||
$('.context-menu-list').remove();
|
||||
} else if (namespaces[o.selector]) {
|
||||
try {
|
||||
if (menus[namespaces[o.selector]].$menu) {
|
||||
menus[namespaces[o.selector]].$menu.remove();
|
||||
}
|
||||
|
||||
|
||||
delete menus[namespaces[o.selector]];
|
||||
} catch(e) {
|
||||
menus[namespaces[o.selector]] = null;
|
||||
}
|
||||
|
||||
|
||||
$body.off(namespaces[o.selector]);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 'html5':
|
||||
// if <command> or <menuitem> are not handled by the browser,
|
||||
// or options was a bool true,
|
||||
|
@ -1206,11 +1206,11 @@ $.contextMenu = function(operation, options) {
|
|||
}).css('display', 'none');
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
throw new Error('Unknown operation "' + operation + '"');
|
||||
}
|
||||
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
|
@ -1219,7 +1219,7 @@ $.contextMenu.setInputValues = function(opt, data) {
|
|||
if (data === undefined) {
|
||||
data = {};
|
||||
}
|
||||
|
||||
|
||||
$.each(opt.inputs, function(key, item) {
|
||||
switch (item.type) {
|
||||
case 'text':
|
||||
|
@ -1230,11 +1230,11 @@ $.contextMenu.setInputValues = function(opt, data) {
|
|||
case 'checkbox':
|
||||
item.selected = data[key] ? true : false;
|
||||
break;
|
||||
|
||||
|
||||
case 'radio':
|
||||
item.selected = (data[item.radio] || "") == item.value ? true : false;
|
||||
break;
|
||||
|
||||
|
||||
case 'select':
|
||||
item.selected = data[key] || "";
|
||||
break;
|
||||
|
@ -1247,7 +1247,7 @@ $.contextMenu.getInputValues = function(opt, data) {
|
|||
if (data === undefined) {
|
||||
data = {};
|
||||
}
|
||||
|
||||
|
||||
$.each(opt.inputs, function(key, item) {
|
||||
switch (item.type) {
|
||||
case 'text':
|
||||
|
@ -1259,7 +1259,7 @@ $.contextMenu.getInputValues = function(opt, data) {
|
|||
case 'checkbox':
|
||||
data[key] = item.$input.prop('checked');
|
||||
break;
|
||||
|
||||
|
||||
case 'radio':
|
||||
if (item.$input.prop('checked')) {
|
||||
data[item.radio] = item.value;
|
||||
|
@ -1267,7 +1267,7 @@ $.contextMenu.getInputValues = function(opt, data) {
|
|||
break;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return data;
|
||||
};
|
||||
|
||||
|
@ -1281,14 +1281,14 @@ function menuChildren(items, $children, counter) {
|
|||
if (!counter) {
|
||||
counter = 0;
|
||||
}
|
||||
|
||||
|
||||
$children.each(function() {
|
||||
var $node = $(this),
|
||||
node = this,
|
||||
nodeName = this.nodeName.toLowerCase(),
|
||||
label,
|
||||
item;
|
||||
|
||||
|
||||
// extract <label><input>
|
||||
if (nodeName == 'label' && $node.find('input, textarea, select').length) {
|
||||
label = $node.text();
|
||||
|
@ -1296,14 +1296,14 @@ function menuChildren(items, $children, counter) {
|
|||
node = $node.get(0);
|
||||
nodeName = node.nodeName.toLowerCase();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* <menu> accepts flow-content as children. that means <embed>, <canvas> and such are valid menu items.
|
||||
* Not being the sadistic kind, $.contextMenu only accepts:
|
||||
* <command>, <menuitem>, <hr>, <span>, <p> <input [text, radio, checkbox]>, <textarea>, <select> and of course <menu>.
|
||||
* Everything else will be imported as an html node, which is not interfaced with contextMenu.
|
||||
*/
|
||||
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#concept-command
|
||||
switch (nodeName) {
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#the-menu-element
|
||||
|
@ -1311,7 +1311,7 @@ function menuChildren(items, $children, counter) {
|
|||
item = {name: $node.attr('label'), items: {}};
|
||||
menuChildren(item.items, $node.children(), counter);
|
||||
break;
|
||||
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#using-the-a-element-to-define-a-command
|
||||
case 'a':
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#using-the-button-element-to-define-a-command
|
||||
|
@ -1322,7 +1322,7 @@ function menuChildren(items, $children, counter) {
|
|||
callback: (function(){ return function(){ $node.click(); }; })()
|
||||
};
|
||||
break;
|
||||
|
||||
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#using-the-command-element-to-define-a-command
|
||||
|
||||
case 'menuitem':
|
||||
|
@ -1337,7 +1337,7 @@ function menuChildren(items, $children, counter) {
|
|||
callback: (function(){ return function(){ $node.click(); }; })()
|
||||
};
|
||||
break;
|
||||
|
||||
|
||||
case 'checkbox':
|
||||
item = {
|
||||
type: 'checkbox',
|
||||
|
@ -1346,7 +1346,7 @@ function menuChildren(items, $children, counter) {
|
|||
selected: !!$node.attr('checked')
|
||||
};
|
||||
break;
|
||||
|
||||
|
||||
case 'radio':
|
||||
item = {
|
||||
type: 'radio',
|
||||
|
@ -1357,16 +1357,16 @@ function menuChildren(items, $children, counter) {
|
|||
selected: !!$node.attr('checked')
|
||||
};
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
item = undefined;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 'hr':
|
||||
item = '-------';
|
||||
break;
|
||||
|
||||
|
||||
case 'input':
|
||||
switch ($node.attr('type')) {
|
||||
case 'text':
|
||||
|
@ -1377,7 +1377,7 @@ function menuChildren(items, $children, counter) {
|
|||
value: $node.val()
|
||||
};
|
||||
break;
|
||||
|
||||
|
||||
case 'checkbox':
|
||||
item = {
|
||||
type: 'checkbox',
|
||||
|
@ -1386,7 +1386,7 @@ function menuChildren(items, $children, counter) {
|
|||
selected: !!$node.attr('checked')
|
||||
};
|
||||
break;
|
||||
|
||||
|
||||
case 'radio':
|
||||
item = {
|
||||
type: 'radio',
|
||||
|
@ -1397,13 +1397,13 @@ function menuChildren(items, $children, counter) {
|
|||
selected: !!$node.attr('checked')
|
||||
};
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
item = undefined;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 'select':
|
||||
item = {
|
||||
type: 'select',
|
||||
|
@ -1416,7 +1416,7 @@ function menuChildren(items, $children, counter) {
|
|||
item.options[this.value] = $(this).text();
|
||||
});
|
||||
break;
|
||||
|
||||
|
||||
case 'textarea':
|
||||
item = {
|
||||
type: 'textarea',
|
||||
|
@ -1425,15 +1425,15 @@ function menuChildren(items, $children, counter) {
|
|||
value: $node.val()
|
||||
};
|
||||
break;
|
||||
|
||||
|
||||
case 'label':
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
item = {type: 'html', html: $node.clone(true)};
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (item) {
|
||||
counter++;
|
||||
items['key' + counter] = item;
|
||||
|
@ -1445,9 +1445,9 @@ function menuChildren(items, $children, counter) {
|
|||
$.contextMenu.fromMenu = function(element) {
|
||||
var $this = $(element),
|
||||
items = {};
|
||||
|
||||
|
||||
menuChildren(items, $this.children());
|
||||
|
||||
|
||||
return items;
|
||||
};
|
||||
|
||||
|
|
|
@ -160,4 +160,4 @@
|
|||
}
|
||||
|
||||
return init(function () {});
|
||||
}));
|
||||
}));
|
||||
|
|
|
@ -15,4 +15,4 @@
|
|||
"sNext": "Επόμενη",
|
||||
"sLast": "Τελευταία"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,4 +20,4 @@
|
|||
"sSortAscending": ": activate to sort column ascending",
|
||||
"sSortDescending": ": activate to sort column descending"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,4 +20,4 @@
|
|||
"sSortAscending": ": activate to sort column ascending",
|
||||
"sSortDescending": ": activate to sort column descending"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,4 +22,4 @@
|
|||
"sSortAscending": ": Activar para ordernar la columna de manera ascendente",
|
||||
"sSortDescending": ": Activar para ordernar la columna de manera descendente"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,4 +19,4 @@
|
|||
"sSortAscending": ": activer pour trier la colonne par ordre croissant",
|
||||
"sSortDescending": ": activer pour trier la colonne par ordre décroissant"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,4 +16,4 @@
|
|||
"sNext": "Következő",
|
||||
"sLast": "Utolsó"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,4 +20,4 @@
|
|||
"sSortAscending": ": attiva per ordinare la colonna in ordine crescente",
|
||||
"sSortDescending": ": attiva per ordinare la colonna in ordine decrescente"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,4 +20,4 @@
|
|||
"sSortAscending": ": 오름차순으로 정렬",
|
||||
"sSortDescending": ": 내림차순으로 정렬"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,4 +15,4 @@
|
|||
"sNext": "Następna",
|
||||
"sLast": "Ostatnia"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,4 +14,4 @@
|
|||
"sNext": "Следующая",
|
||||
"sLast": "Последняя"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,4 +16,4 @@
|
|||
"sNext": "Napred",
|
||||
"sLast": "Zadnja"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,4 +14,4 @@
|
|||
"sNext": "下页",
|
||||
"sLast": "末页"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,16 +3,16 @@
|
|||
* Version: 1.9.4
|
||||
* Author: Allan Jardine (www.sprymedia.co.uk)
|
||||
* Info: www.datatables.net
|
||||
*
|
||||
*
|
||||
* Copyright 2008-2012 Allan Jardine, all rights reserved.
|
||||
*
|
||||
* This source file is free software, under either the GPL v2 license or a
|
||||
* BSD style license, available at:
|
||||
* http://datatables.net/license_gpl2
|
||||
* http://datatables.net/license_bsd
|
||||
*
|
||||
* This source file is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
*
|
||||
* This source file is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
|
||||
*/
|
||||
(function(X,l,n){var L=function(h){var j=function(e){function o(a,b){var c=j.defaults.columns,d=a.aoColumns.length,c=h.extend({},j.models.oColumn,c,{sSortingClass:a.oClasses.sSortable,sSortingClassJUI:a.oClasses.sSortJUI,nTh:b?b:l.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.oDefaults:d});a.aoColumns.push(c);if(a.aoPreSearchCols[d]===n||null===a.aoPreSearchCols[d])a.aoPreSearchCols[d]=h.extend({},j.models.oSearch);else if(c=a.aoPreSearchCols[d],
|
||||
|
|
|
@ -44,7 +44,7 @@ denise@denise-DX4860:~/airtime/legacy/public/js/datatables/plugin$ diff -u dataT
|
|||
+ if (oTable.fnSettings().oFeatures.bServerSide && iFilterLength != 0) {
|
||||
+ //If filter length is set in the server-side processing mode
|
||||
+ //Check has the user entered at least iFilterLength new characters
|
||||
+
|
||||
+
|
||||
+ var currentFilter = oTable.fnSettings().aoPreSearchCols[index].sSearch;
|
||||
+ var iLastFilterLength = $(this).data("dt-iLastFilterLength");
|
||||
+ if (typeof iLastFilterLength == "undefined")
|
||||
|
@ -70,7 +70,7 @@ denise@denise-DX4860:~/airtime/legacy/public/js/datatables/plugin$ diff -u dataT
|
|||
- fnOnFiltered();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -168,7 +172,8 @@
|
||||
input.blur(function () {
|
||||
if (this.value == "") {
|
||||
|
@ -83,9 +83,9 @@ denise@denise-DX4860:~/airtime/legacy/public/js/datatables/plugin$ diff -u dataT
|
|||
}
|
||||
@@ -176,13 +181,25 @@
|
||||
function fnCreateRangeInput(oTable) {
|
||||
|
||||
|
||||
//var currentFilter = oTable.fnSettings().aoPreSearchCols[i].sSearch;
|
||||
+
|
||||
+
|
||||
+ var label = "";
|
||||
+ if (th.attr('id') == "bit_rate") {
|
||||
+ label = $.i18n._("kbps");
|
||||
|
@ -96,7 +96,7 @@ denise@denise-DX4860:~/airtime/legacy/public/js/datatables/plugin$ diff -u dataT
|
|||
+ } else if (th.attr('id') == "sample_rate") {
|
||||
+ label = $.i18n._("kHz");
|
||||
+ }
|
||||
+
|
||||
+
|
||||
th.html(_fnRangeLabelPart(0));
|
||||
var sFromId = oTable.attr("id") + '_range_from_' + i;
|
||||
- var from = $('<input type="text" class="number_range_filter" id="' + sFromId + '" rel="' + i + '"/>');
|
||||
|
@ -110,8 +110,8 @@ denise@denise-DX4860:~/airtime/legacy/public/js/datatables/plugin$ diff -u dataT
|
|||
th.append(_fnRangeLabelPart(2));
|
||||
th.wrapInner('<span class="filterColumn filter_number_range" />');
|
||||
@@ -228,14 +245,16 @@
|
||||
|
||||
|
||||
|
||||
|
||||
$('#' + sFromId + ',#' + sToId, th).keyup(function () {
|
||||
-
|
||||
- var iMin = document.getElementById(sFromId).value * 1;
|
||||
|
@ -127,13 +127,13 @@ denise@denise-DX4860:~/airtime/legacy/public/js/datatables/plugin$ diff -u dataT
|
|||
+ var iMax = document.getElementById(sToId).value * 1;
|
||||
+ if (iMin != 0 && iMax != 0 && iMin > iMax)
|
||||
+ return;
|
||||
+
|
||||
+
|
||||
+ oTable.fnDraw();
|
||||
+ fnOnFiltered();
|
||||
+ }
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -566,7 +585,7 @@
|
||||
sRangeSeparator: "~",
|
||||
iFilteringDelay: 500,
|
||||
|
@ -141,12 +141,12 @@ denise@denise-DX4860:~/airtime/legacy/public/js/datatables/plugin$ diff -u dataT
|
|||
- sRangeFormat: "From {from} to {to}"
|
||||
+ sRangeFormat: $.i18n._("From {from} to {to}")
|
||||
};
|
||||
|
||||
|
||||
properties = $.extend(defaults, options);
|
||||
@@ -730,4 +749,4 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-})(jQuery);
|
||||
\ No newline at end of file
|
||||
+})(jQuery);
|
||||
+})(jQuery);
|
||||
|
|
|
@ -14,20 +14,19 @@ The new _fnDomBaseButton looks like this:
|
|||
nButton = document.createElement('button'),
|
||||
nSpan = document.createElement('span'),
|
||||
sEvent = this.s.activate=="mouseover" ? "mouseover" : "click";
|
||||
|
||||
|
||||
//nButton.className = !this.s.dt.bJUI ? "ColVis_Button TableTools_Button" :
|
||||
//"ColVis_Button TableTools_Button ui-button ui-state-default";
|
||||
nButton.className = "btn-toolbar btn btn-small dropdown-toggle ColVis_MasterButton";
|
||||
|
||||
|
||||
nButton.appendChild( nSpan );
|
||||
$(nButton).append("<span class='caret'></span>");
|
||||
nSpan.innerHTML = text;
|
||||
|
||||
|
||||
$(nButton).bind( 'click', function (e) {
|
||||
that._fnCollectionShow();
|
||||
e.preventDefault();
|
||||
} );
|
||||
|
||||
|
||||
return nButton;
|
||||
},
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
* License: GPL v2 or BSD 3 point style
|
||||
* Project: Just a little bit of fun :-)
|
||||
* Contact: www.sprymedia.co.uk/contact
|
||||
*
|
||||
*
|
||||
* Copyright 2010-2011 Allan Jardine, all rights reserved.
|
||||
*
|
||||
* This source file is free software, under either the GPL v2 license or a
|
||||
|
@ -21,7 +21,7 @@
|
|||
|
||||
(function($) {
|
||||
|
||||
/**
|
||||
/**
|
||||
* ColVis provides column visiblity control for DataTables
|
||||
* @class ColVis
|
||||
* @constructor
|
||||
|
@ -34,17 +34,17 @@ ColVis = function( oDTSettings, oInit )
|
|||
{
|
||||
alert( "Warning: ColVis must be initialised with the keyword 'new'" );
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oInit == 'undefined' )
|
||||
{
|
||||
oInit = {};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Public class variables
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
/**
|
||||
* @namespace Settings object which contains customisable information for ColVis instance
|
||||
*/
|
||||
|
@ -56,7 +56,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default null
|
||||
*/
|
||||
"dt": null,
|
||||
|
||||
|
||||
/**
|
||||
* Customisation object
|
||||
* @property oInit
|
||||
|
@ -64,7 +64,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default passed in
|
||||
*/
|
||||
"oInit": oInit,
|
||||
|
||||
|
||||
/**
|
||||
* Callback function to tell the user when the state has changed
|
||||
* @property fnStateChange
|
||||
|
@ -72,7 +72,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default null
|
||||
*/
|
||||
"fnStateChange": null,
|
||||
|
||||
|
||||
/**
|
||||
* Mode of activation. Can be 'click' or 'mouseover'
|
||||
* @property activate
|
||||
|
@ -80,7 +80,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default click
|
||||
*/
|
||||
"activate": "click",
|
||||
|
||||
|
||||
/**
|
||||
* Position of the collection menu when shown - align "left" or "right"
|
||||
* @property sAlign
|
||||
|
@ -88,7 +88,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default right
|
||||
*/
|
||||
"sAlign": "left",
|
||||
|
||||
|
||||
/**
|
||||
* Text used for the button
|
||||
* @property buttonText
|
||||
|
@ -96,7 +96,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default Show / hide columns
|
||||
*/
|
||||
"buttonText": "Show / hide columns",
|
||||
|
||||
|
||||
/**
|
||||
* Flag to say if the collection is hidden
|
||||
* @property hidden
|
||||
|
@ -104,7 +104,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default true
|
||||
*/
|
||||
"hidden": true,
|
||||
|
||||
|
||||
/**
|
||||
* List of columns (integers) which should be excluded from the list
|
||||
* @property aiExclude
|
||||
|
@ -112,7 +112,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default []
|
||||
*/
|
||||
"aiExclude": [],
|
||||
|
||||
|
||||
/**
|
||||
* Store the original viisbility settings so they could be restored
|
||||
* @property abOriginal
|
||||
|
@ -120,7 +120,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default []
|
||||
*/
|
||||
"abOriginal": [],
|
||||
|
||||
|
||||
/**
|
||||
* Show Show-All button
|
||||
* @property bShowAll
|
||||
|
@ -128,7 +128,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default []
|
||||
*/
|
||||
"bShowAll": false,
|
||||
|
||||
|
||||
/**
|
||||
* Show All button text
|
||||
* @property sShowAll
|
||||
|
@ -136,7 +136,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default Restore original
|
||||
*/
|
||||
"sShowAll": "Show All",
|
||||
|
||||
|
||||
/**
|
||||
* Show restore button
|
||||
* @property bRestore
|
||||
|
@ -144,7 +144,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default []
|
||||
*/
|
||||
"bRestore": false,
|
||||
|
||||
|
||||
/**
|
||||
* Restore button text
|
||||
* @property sRestore
|
||||
|
@ -152,7 +152,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default Restore original
|
||||
*/
|
||||
"sRestore": "Restore original",
|
||||
|
||||
|
||||
/**
|
||||
* Overlay animation duration in mS
|
||||
* @property iOverlayFade
|
||||
|
@ -160,7 +160,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default 500
|
||||
*/
|
||||
"iOverlayFade": 500,
|
||||
|
||||
|
||||
/**
|
||||
* Label callback for column names. Takes three parameters: 1. the column index, 2. the column
|
||||
* title detected by DataTables and 3. the TH node for the column
|
||||
|
@ -169,7 +169,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default null
|
||||
*/
|
||||
"fnLabel": null,
|
||||
|
||||
|
||||
/**
|
||||
* Indicate if ColVis should automatically calculate the size of buttons or not. The default
|
||||
* is for it to do so. Set to "css" to disable the automatic sizing
|
||||
|
@ -178,7 +178,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default auto
|
||||
*/
|
||||
"sSize": "auto",
|
||||
|
||||
|
||||
/**
|
||||
* Indicate if the column list should be positioned by Javascript, visually below the button
|
||||
* or allow CSS to do the positioning
|
||||
|
@ -188,8 +188,8 @@ ColVis = function( oDTSettings, oInit )
|
|||
*/
|
||||
"bCssPosition": false
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @namespace Common and useful DOM elements for the class instance
|
||||
*/
|
||||
|
@ -201,7 +201,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default null
|
||||
*/
|
||||
"wrapper": null,
|
||||
|
||||
|
||||
/**
|
||||
* Activation button
|
||||
* @property button
|
||||
|
@ -209,7 +209,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default null
|
||||
*/
|
||||
"button": null,
|
||||
|
||||
|
||||
/**
|
||||
* Collection list node
|
||||
* @property collection
|
||||
|
@ -217,7 +217,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default null
|
||||
*/
|
||||
"collection": null,
|
||||
|
||||
|
||||
/**
|
||||
* Background node used for shading the display and event capturing
|
||||
* @property background
|
||||
|
@ -225,7 +225,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default null
|
||||
*/
|
||||
"background": null,
|
||||
|
||||
|
||||
/**
|
||||
* Element to position over the activation button to catch mouse events when using mouseover
|
||||
* @property catcher
|
||||
|
@ -233,7 +233,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default null
|
||||
*/
|
||||
"catcher": null,
|
||||
|
||||
|
||||
/**
|
||||
* List of button elements
|
||||
* @property buttons
|
||||
|
@ -241,7 +241,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default []
|
||||
*/
|
||||
"buttons": [],
|
||||
|
||||
|
||||
/**
|
||||
* Restore button
|
||||
* @property restore
|
||||
|
@ -250,10 +250,10 @@ ColVis = function( oDTSettings, oInit )
|
|||
*/
|
||||
"restore": null
|
||||
};
|
||||
|
||||
|
||||
/* Store global reference */
|
||||
ColVis.aInstances.push( this );
|
||||
|
||||
|
||||
/* Constructor logic */
|
||||
this.s.dt = oDTSettings;
|
||||
this._fnConstruct();
|
||||
|
@ -266,7 +266,7 @@ ColVis.prototype = {
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Public methods
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
/**
|
||||
* Rebuild the list of buttons for this instance (i.e. if there is a column header update)
|
||||
* @method fnRebuild
|
||||
|
@ -283,56 +283,56 @@ ColVis.prototype = {
|
|||
}
|
||||
}
|
||||
this.dom.buttons.splice( 0, this.dom.buttons.length );
|
||||
|
||||
|
||||
if ( this.dom.restore )
|
||||
{
|
||||
this.dom.restore.parentNode( this.dom.restore );
|
||||
}
|
||||
|
||||
|
||||
/* Re-add them (this is not the optimal way of doing this, it is fast and effective) */
|
||||
this._fnAddButtons();
|
||||
|
||||
|
||||
/* Update the checkboxes */
|
||||
this._fnDrawCallback();
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Private methods (they are of course public in JS, but recommended as private)
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
/**
|
||||
* Constructor logic
|
||||
* @method _fnConstruct
|
||||
* @returns void
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnConstruct": function ()
|
||||
{
|
||||
this._fnApplyCustomisation();
|
||||
|
||||
|
||||
var that = this;
|
||||
var i, iLen;
|
||||
this.dom.wrapper = document.createElement('div');
|
||||
this.dom.wrapper.className = "ColVis TableTools";
|
||||
|
||||
|
||||
this.dom.button = this._fnDomBaseButton( this.s.buttonText );
|
||||
this.dom.button.className += " ColVis_MasterButton";
|
||||
this.dom.wrapper.appendChild( this.dom.button );
|
||||
|
||||
|
||||
this.dom.catcher = this._fnDomCatcher();
|
||||
this.dom.collection = this._fnDomCollection();
|
||||
this.dom.background = this._fnDomBackground();
|
||||
|
||||
|
||||
this._fnAddButtons();
|
||||
|
||||
|
||||
/* Store the original visbility information */
|
||||
for ( i=0, iLen=this.s.dt.aoColumns.length ; i<iLen ; i++ )
|
||||
{
|
||||
this.s.abOriginal.push( this.s.dt.aoColumns[i].bVisible );
|
||||
}
|
||||
|
||||
|
||||
/* Update on each draw */
|
||||
this.s.dt.aoDrawCallback.push( {
|
||||
"fn": function () {
|
||||
|
@ -351,77 +351,77 @@ ColVis.prototype = {
|
|||
|
||||
var mStore = that.s.abOriginal.splice( oReorder.iFrom, 1 )[0];
|
||||
that.s.abOriginal.splice( oReorder.iTo, 0, mStore );
|
||||
|
||||
|
||||
that.fnRebuild();
|
||||
} );
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Apply any customisation to the settings from the DataTables initialisation
|
||||
* @method _fnApplyCustomisation
|
||||
* @returns void
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnApplyCustomisation": function ()
|
||||
{
|
||||
var oConfig = this.s.oInit;
|
||||
|
||||
|
||||
if ( typeof oConfig.activate != 'undefined' )
|
||||
{
|
||||
this.s.activate = oConfig.activate;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.buttonText != 'undefined' )
|
||||
{
|
||||
this.s.buttonText = oConfig.buttonText;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.aiExclude != 'undefined' )
|
||||
{
|
||||
this.s.aiExclude = oConfig.aiExclude;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.bRestore != 'undefined' )
|
||||
{
|
||||
this.s.bRestore = oConfig.bRestore;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.sRestore != 'undefined' )
|
||||
{
|
||||
this.s.sRestore = oConfig.sRestore;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.bShowAll != 'undefined' )
|
||||
{
|
||||
this.s.bShowAll = oConfig.bShowAll;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.sShowAll != 'undefined' )
|
||||
{
|
||||
this.s.sShowAll = oConfig.sShowAll;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.sAlign != 'undefined' )
|
||||
{
|
||||
this.s.sAlign = oConfig.sAlign;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.fnStateChange != 'undefined' )
|
||||
{
|
||||
this.s.fnStateChange = oConfig.fnStateChange;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.iOverlayFade != 'undefined' )
|
||||
{
|
||||
this.s.iOverlayFade = oConfig.iOverlayFade;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.fnLabel != 'undefined' )
|
||||
{
|
||||
this.s.fnLabel = oConfig.fnLabel;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.sSize != 'undefined' )
|
||||
{
|
||||
this.s.sSize = oConfig.sSize;
|
||||
|
@ -432,19 +432,19 @@ ColVis.prototype = {
|
|||
this.s.bCssPosition = oConfig.bCssPosition;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* On each table draw, check the visibility checkboxes as needed. This allows any process to
|
||||
* update the table's column visibility and ColVis will still be accurate.
|
||||
* @method _fnDrawCallback
|
||||
* @returns void
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnDrawCallback": function ()
|
||||
{
|
||||
var aoColumns = this.s.dt.aoColumns;
|
||||
|
||||
|
||||
for ( var i=0, iLen=aoColumns.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( this.dom.buttons[i] !== null )
|
||||
|
@ -460,20 +460,20 @@ ColVis.prototype = {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Loop through the columns in the table and as a new button for each one.
|
||||
* @method _fnAddButtons
|
||||
* @returns void
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnAddButtons": function ()
|
||||
{
|
||||
var
|
||||
nButton,
|
||||
sExclude = ","+this.s.aiExclude.join(',')+",";
|
||||
|
||||
|
||||
for ( var i=0, iLen=this.s.dt.aoColumns.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( sExclude.indexOf( ","+i+"," ) == -1 )
|
||||
|
@ -487,7 +487,7 @@ ColVis.prototype = {
|
|||
this.dom.buttons.push( null );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( this.s.bRestore )
|
||||
{
|
||||
nButton = this._fnDomRestoreButton();
|
||||
|
@ -495,7 +495,7 @@ ColVis.prototype = {
|
|||
this.dom.buttons.push( nButton );
|
||||
this.dom.collection.appendChild( nButton );
|
||||
}
|
||||
|
||||
|
||||
if ( this.s.bShowAll )
|
||||
{
|
||||
nButton = this._fnDomShowAllButton();
|
||||
|
@ -504,13 +504,13 @@ ColVis.prototype = {
|
|||
this.dom.collection.appendChild( nButton );
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create a button which allows a "restore" action
|
||||
* @method _fnDomRestoreButton
|
||||
* @returns {Node} Created button
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnDomRestoreButton": function ()
|
||||
{
|
||||
|
@ -518,12 +518,12 @@ ColVis.prototype = {
|
|||
that = this,
|
||||
nButton = document.createElement('button'),
|
||||
nSpan = document.createElement('span');
|
||||
|
||||
|
||||
nButton.className = !this.s.dt.bJUI ? "ColVis_Button TableTools_Button" :
|
||||
"ColVis_Button TableTools_Button ui-button ui-state-default";
|
||||
nButton.appendChild( nSpan );
|
||||
$(nSpan).html( '<span class="ColVis_title">'+this.s.sRestore+'</span>' );
|
||||
|
||||
|
||||
$(nButton).click( function (e) {
|
||||
for ( var i=0, iLen=that.s.abOriginal.length ; i<iLen ; i++ )
|
||||
{
|
||||
|
@ -533,16 +533,16 @@ ColVis.prototype = {
|
|||
that.s.dt.oInstance.fnAdjustColumnSizing( false );
|
||||
that.s.dt.oInstance.fnDraw( false );
|
||||
} );
|
||||
|
||||
|
||||
return nButton;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create a button which allows a "show all" action
|
||||
* @method _fnDomShowAllButton
|
||||
* @returns {Node} Created button
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnDomShowAllButton": function ()
|
||||
{
|
||||
|
@ -550,12 +550,12 @@ ColVis.prototype = {
|
|||
that = this,
|
||||
nButton = document.createElement('button'),
|
||||
nSpan = document.createElement('span');
|
||||
|
||||
|
||||
nButton.className = !this.s.dt.bJUI ? "ColVis_Button TableTools_Button" :
|
||||
"ColVis_Button TableTools_Button ui-button ui-state-default";
|
||||
nButton.appendChild( nSpan );
|
||||
$(nSpan).html( '<span class="ColVis_title">'+this.s.sShowAll+'</span>' );
|
||||
|
||||
|
||||
$(nButton).click( function (e) {
|
||||
for ( var i=0, iLen=that.s.abOriginal.length ; i<iLen ; i++ )
|
||||
{
|
||||
|
@ -568,17 +568,17 @@ ColVis.prototype = {
|
|||
that.s.dt.oInstance.fnAdjustColumnSizing( false );
|
||||
that.s.dt.oInstance.fnDraw( false );
|
||||
} );
|
||||
|
||||
|
||||
return nButton;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create the DOM for a show / hide button
|
||||
* @method _fnDomColumnButton
|
||||
* @param {int} i Column in question
|
||||
* @returns {Node} Created button
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnDomColumnButton": function ( i )
|
||||
{
|
||||
|
@ -588,23 +588,23 @@ ColVis.prototype = {
|
|||
nButton = document.createElement('button'),
|
||||
nSpan = document.createElement('span'),
|
||||
dt = this.s.dt;
|
||||
|
||||
|
||||
nButton.className = !dt.bJUI ? "ColVis_Button TableTools_Button" :
|
||||
"ColVis_Button TableTools_Button ui-button ui-state-default";
|
||||
|
||||
|
||||
nButton.appendChild( nSpan );
|
||||
var sTitle = this.s.fnLabel===null ? oColumn.sTitle : this.s.fnLabel( i, oColumn.sTitle, oColumn.nTh );
|
||||
$(nSpan).html(
|
||||
'<span class="ColVis_radio"><input type="checkbox"/></span>'+
|
||||
'<span class="ColVis_title">'+sTitle+'</span>' );
|
||||
|
||||
|
||||
$(nButton).click( function (e) {
|
||||
var showHide = !$('input', this).is(":checked");
|
||||
if ( e.target.nodeName.toLowerCase() == "input" )
|
||||
{
|
||||
showHide = $('input', this).is(":checked");
|
||||
}
|
||||
|
||||
|
||||
/* Need to consider the case where the initialiser created more than one table - change the
|
||||
* API index that DataTables is using
|
||||
*/
|
||||
|
@ -625,22 +625,22 @@ ColVis.prototype = {
|
|||
}
|
||||
|
||||
$.fn.dataTableExt.iApiIndex = oldIndex; /* Restore */
|
||||
|
||||
|
||||
if ( that.s.fnStateChange !== null )
|
||||
{
|
||||
that.s.fnStateChange.call( that, i, showHide );
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
return nButton;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get the position in the DataTables instance array of the table for this instance of ColVis
|
||||
* @method _fnDataTablesApiIndex
|
||||
* @returns {int} Index
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnDataTablesApiIndex": function ()
|
||||
{
|
||||
|
@ -653,14 +653,14 @@ ColVis.prototype = {
|
|||
}
|
||||
return 0;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create the DOM needed for the button and apply some base properties. All buttons start here
|
||||
* @method _fnDomBaseButton
|
||||
* @param {String} text Button text
|
||||
* @returns {Node} DIV element for the button
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnDomBaseButton": function ( text )
|
||||
{
|
||||
|
@ -670,28 +670,28 @@ ColVis.prototype = {
|
|||
nCaret = document.createElement('span'),
|
||||
nSpan = document.createElement('span'),
|
||||
sEvent = this.s.activate=="mouseover" ? "mouseover" : "click";
|
||||
|
||||
|
||||
nButton.className = "btn-toolbar btn btn-small dropdown-toggle";
|
||||
nCaret.className = "caret";
|
||||
|
||||
|
||||
nButton.appendChild( nSpan );
|
||||
nButton.appendChild( nCaret );
|
||||
nSpan.innerHTML = text;
|
||||
|
||||
|
||||
$(nButton).bind( sEvent, function (e) {
|
||||
that._fnCollectionShow();
|
||||
e.preventDefault();
|
||||
} );
|
||||
|
||||
|
||||
return nButton;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create the element used to contain list the columns (it is shown and hidden as needed)
|
||||
* @method _fnDomCollection
|
||||
* @returns {Node} div container for the collection
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnDomCollection": function ()
|
||||
{
|
||||
|
@ -700,60 +700,60 @@ ColVis.prototype = {
|
|||
nHidden.style.display = "none";
|
||||
nHidden.className = !this.s.dt.bJUI ? "ColVis_collection TableTools_collection" :
|
||||
"ColVis_collection TableTools_collection ui-buttonset ui-buttonset-multi";
|
||||
|
||||
|
||||
if ( !this.s.bCssPosition )
|
||||
{
|
||||
nHidden.style.position = "absolute";
|
||||
}
|
||||
$(nHidden).css('opacity', 0);
|
||||
|
||||
|
||||
return nHidden;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* An element to be placed on top of the activate button to catch events
|
||||
* @method _fnDomCatcher
|
||||
* @returns {Node} div container for the collection
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnDomCatcher": function ()
|
||||
{
|
||||
var
|
||||
var
|
||||
that = this,
|
||||
nCatcher = document.createElement('div');
|
||||
nCatcher.className = "ColVis_catcher TableTools_catcher";
|
||||
|
||||
|
||||
$(nCatcher).click( function () {
|
||||
that._fnCollectionHide.call( that, null, null );
|
||||
} );
|
||||
|
||||
|
||||
return nCatcher;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create the element used to shade the background, and capture hide events (it is shown and
|
||||
* Create the element used to shade the background, and capture hide events (it is shown and
|
||||
* hidden as needed)
|
||||
* @method _fnDomBackground
|
||||
* @returns {Node} div container for the background
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnDomBackground": function ()
|
||||
{
|
||||
var that = this;
|
||||
|
||||
|
||||
var nBackground = document.createElement('div');
|
||||
nBackground.style.position = "absolute";
|
||||
nBackground.style.left = "0px";
|
||||
nBackground.style.top = "0px";
|
||||
nBackground.className = "ColVis_collectionBackground TableTools_collectionBackground";
|
||||
$(nBackground).css('opacity', 0);
|
||||
|
||||
|
||||
$(nBackground).click( function () {
|
||||
that._fnCollectionHide.call( that, null, null );
|
||||
} );
|
||||
|
||||
|
||||
/* When considering a mouse over action for the activation, we also consider a mouse out
|
||||
* which is the same as a mouse over the background - without all the messing around of
|
||||
* bubbling events. Use the catcher element to avoid messing around with bubbling
|
||||
|
@ -765,16 +765,16 @@ ColVis.prototype = {
|
|||
that._fnCollectionHide.call( that, null, null );
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
return nBackground;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Show the show / hide list and the background
|
||||
* @method _fnCollectionShow
|
||||
* @returns void
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnCollectionShow": function ()
|
||||
{
|
||||
|
@ -784,7 +784,7 @@ ColVis.prototype = {
|
|||
var nBackground = this.dom.background;
|
||||
var iDivX = parseInt(oPos.left, 10);
|
||||
var iDivY = parseInt(oPos.top + $(this.dom.button).outerHeight(), 10);
|
||||
|
||||
|
||||
if ( !this.s.bCssPosition )
|
||||
{
|
||||
nHidden.style.top = iDivY+"px";
|
||||
|
@ -792,23 +792,23 @@ ColVis.prototype = {
|
|||
}
|
||||
nHidden.style.display = "block";
|
||||
$(nHidden).css('opacity',0);
|
||||
|
||||
|
||||
var iWinHeight = $(window).height(), iDocHeight = $(document).height(),
|
||||
iWinWidth = $(window).width(), iDocWidth = $(document).width();
|
||||
|
||||
|
||||
nBackground.style.height = ((iWinHeight>iDocHeight)? iWinHeight : iDocHeight) +"px";
|
||||
nBackground.style.width = ((iWinWidth<iDocWidth)? iWinWidth : iDocWidth) +"px";
|
||||
|
||||
|
||||
var oStyle = this.dom.catcher.style;
|
||||
oStyle.height = $(this.dom.button).outerHeight()+"px";
|
||||
oStyle.width = $(this.dom.button).outerWidth()+"px";
|
||||
oStyle.top = oPos.top+"px";
|
||||
oStyle.left = iDivX+"px";
|
||||
|
||||
|
||||
document.body.appendChild( nBackground );
|
||||
document.body.appendChild( nHidden );
|
||||
document.body.appendChild( this.dom.catcher );
|
||||
|
||||
|
||||
/* Resize the buttons */
|
||||
if ( this.s.sSize == "auto" )
|
||||
{
|
||||
|
@ -832,7 +832,7 @@ ColVis.prototype = {
|
|||
}
|
||||
this.dom.collection.style.width = iMax+"px";
|
||||
}
|
||||
|
||||
|
||||
/* Visual corrections to try and keep the collection visible */
|
||||
if ( !this.s.bCssPosition )
|
||||
{
|
||||
|
@ -841,13 +841,13 @@ ColVis.prototype = {
|
|||
|
||||
var iDivWidth = $(nHidden).outerWidth();
|
||||
var iDivHeight = $(nHidden).outerHeight();
|
||||
|
||||
|
||||
if ( iDivX + iDivWidth > iDocWidth )
|
||||
{
|
||||
nHidden.style.left = (iDocWidth-iDivWidth)+"px";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* This results in a very small delay for the end user but it allows the animation to be
|
||||
* much smoother. If you don't want the animation, then the setTimeout can be removed
|
||||
*/
|
||||
|
@ -863,37 +863,37 @@ ColVis.prototype = {
|
|||
}
|
||||
});
|
||||
}, 10 );
|
||||
|
||||
|
||||
this.s.hidden = false;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Hide the show / hide list and the background
|
||||
* @method _fnCollectionHide
|
||||
* @returns void
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnCollectionHide": function ( )
|
||||
{
|
||||
var that = this;
|
||||
|
||||
|
||||
if ( !this.s.hidden && this.dom.collection !== null )
|
||||
{
|
||||
this.s.hidden = true;
|
||||
|
||||
|
||||
$(this.dom.collection).animate({"opacity": 0}, that.s.iOverlayFade, function (e) {
|
||||
this.style.display = "none";
|
||||
} );
|
||||
|
||||
|
||||
$(this.dom.background).animate({"opacity": 0}, that.s.iOverlayFade, function (e) {
|
||||
document.body.removeChild( that.dom.background );
|
||||
document.body.removeChild( that.dom.catcher );
|
||||
} );
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Alter the colspan on any fnOpen rows
|
||||
*/
|
||||
|
@ -901,7 +901,7 @@ ColVis.prototype = {
|
|||
{
|
||||
var aoOpen = this.s.dt.aoOpenRows;
|
||||
var iVisible = this.s.dt.oApi._fnVisbleColumns( this.s.dt );
|
||||
|
||||
|
||||
for ( var i=0, iLen=aoOpen.length ; i<iLen ; i++ ) {
|
||||
aoOpen[i].nTr.getElementsByTagName('td')[0].colSpan = iVisible;
|
||||
}
|
||||
|
@ -930,7 +930,7 @@ ColVis.fnRebuild = function ( oTable )
|
|||
{
|
||||
nTable = oTable.fnSettings().nTable;
|
||||
}
|
||||
|
||||
|
||||
for ( var i=0, iLen=ColVis.aInstances.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( typeof oTable == 'undefined' || nTable == ColVis.aInstances[i].s.dt.nTable )
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
* License: GPL v2 or BSD 3 point style
|
||||
* Project: Just a little bit of fun :-)
|
||||
* Contact: www.sprymedia.co.uk/contact
|
||||
*
|
||||
*
|
||||
* Copyright 2010-2011 Allan Jardine, all rights reserved.
|
||||
*
|
||||
* This source file is free software, under either the GPL v2 license or a
|
||||
|
@ -21,7 +21,7 @@
|
|||
|
||||
(function($) {
|
||||
|
||||
/**
|
||||
/**
|
||||
* ColVis provides column visiblity control for DataTables
|
||||
* @class ColVis
|
||||
* @constructor
|
||||
|
@ -34,17 +34,17 @@ ColVis = function( oDTSettings, oInit )
|
|||
{
|
||||
alert( "Warning: ColVis must be initialised with the keyword 'new'" );
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oInit == 'undefined' )
|
||||
{
|
||||
oInit = {};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Public class variables
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
/**
|
||||
* @namespace Settings object which contains customisable information for ColVis instance
|
||||
*/
|
||||
|
@ -56,7 +56,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default null
|
||||
*/
|
||||
"dt": null,
|
||||
|
||||
|
||||
/**
|
||||
* Customisation object
|
||||
* @property oInit
|
||||
|
@ -64,7 +64,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default passed in
|
||||
*/
|
||||
"oInit": oInit,
|
||||
|
||||
|
||||
/**
|
||||
* Callback function to tell the user when the state has changed
|
||||
* @property fnStateChange
|
||||
|
@ -72,7 +72,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default null
|
||||
*/
|
||||
"fnStateChange": null,
|
||||
|
||||
|
||||
/**
|
||||
* Mode of activation. Can be 'click' or 'mouseover'
|
||||
* @property activate
|
||||
|
@ -80,7 +80,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default click
|
||||
*/
|
||||
"activate": "click",
|
||||
|
||||
|
||||
/**
|
||||
* Position of the collection menu when shown - align "left" or "right"
|
||||
* @property sAlign
|
||||
|
@ -88,7 +88,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default right
|
||||
*/
|
||||
"sAlign": "left",
|
||||
|
||||
|
||||
/**
|
||||
* Text used for the button
|
||||
* @property buttonText
|
||||
|
@ -96,7 +96,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default Show / hide columns
|
||||
*/
|
||||
"buttonText": "Show / hide columns",
|
||||
|
||||
|
||||
/**
|
||||
* Flag to say if the collection is hidden
|
||||
* @property hidden
|
||||
|
@ -104,7 +104,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default true
|
||||
*/
|
||||
"hidden": true,
|
||||
|
||||
|
||||
/**
|
||||
* List of columns (integers) which should be excluded from the list
|
||||
* @property aiExclude
|
||||
|
@ -112,7 +112,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default []
|
||||
*/
|
||||
"aiExclude": [],
|
||||
|
||||
|
||||
/**
|
||||
* Store the original viisbility settings so they could be restored
|
||||
* @property abOriginal
|
||||
|
@ -120,7 +120,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default []
|
||||
*/
|
||||
"abOriginal": [],
|
||||
|
||||
|
||||
/**
|
||||
* Show Show-All button
|
||||
* @property bShowAll
|
||||
|
@ -128,7 +128,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default []
|
||||
*/
|
||||
"bShowAll": false,
|
||||
|
||||
|
||||
/**
|
||||
* Show All button text
|
||||
* @property sShowAll
|
||||
|
@ -136,7 +136,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default Restore original
|
||||
*/
|
||||
"sShowAll": "Show All",
|
||||
|
||||
|
||||
/**
|
||||
* Show restore button
|
||||
* @property bRestore
|
||||
|
@ -144,7 +144,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default []
|
||||
*/
|
||||
"bRestore": false,
|
||||
|
||||
|
||||
/**
|
||||
* Restore button text
|
||||
* @property sRestore
|
||||
|
@ -152,7 +152,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default Restore original
|
||||
*/
|
||||
"sRestore": "Restore original",
|
||||
|
||||
|
||||
/**
|
||||
* Overlay animation duration in mS
|
||||
* @property iOverlayFade
|
||||
|
@ -160,7 +160,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default 500
|
||||
*/
|
||||
"iOverlayFade": 500,
|
||||
|
||||
|
||||
/**
|
||||
* Label callback for column names. Takes three parameters: 1. the column index, 2. the column
|
||||
* title detected by DataTables and 3. the TH node for the column
|
||||
|
@ -169,7 +169,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default null
|
||||
*/
|
||||
"fnLabel": null,
|
||||
|
||||
|
||||
/**
|
||||
* Indicate if ColVis should automatically calculate the size of buttons or not. The default
|
||||
* is for it to do so. Set to "css" to disable the automatic sizing
|
||||
|
@ -178,7 +178,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default auto
|
||||
*/
|
||||
"sSize": "auto",
|
||||
|
||||
|
||||
/**
|
||||
* Indicate if the column list should be positioned by Javascript, visually below the button
|
||||
* or allow CSS to do the positioning
|
||||
|
@ -188,8 +188,8 @@ ColVis = function( oDTSettings, oInit )
|
|||
*/
|
||||
"bCssPosition": false
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @namespace Common and useful DOM elements for the class instance
|
||||
*/
|
||||
|
@ -201,7 +201,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default null
|
||||
*/
|
||||
"wrapper": null,
|
||||
|
||||
|
||||
/**
|
||||
* Activation button
|
||||
* @property button
|
||||
|
@ -209,7 +209,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default null
|
||||
*/
|
||||
"button": null,
|
||||
|
||||
|
||||
/**
|
||||
* Collection list node
|
||||
* @property collection
|
||||
|
@ -217,7 +217,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default null
|
||||
*/
|
||||
"collection": null,
|
||||
|
||||
|
||||
/**
|
||||
* Background node used for shading the display and event capturing
|
||||
* @property background
|
||||
|
@ -225,7 +225,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default null
|
||||
*/
|
||||
"background": null,
|
||||
|
||||
|
||||
/**
|
||||
* Element to position over the activation button to catch mouse events when using mouseover
|
||||
* @property catcher
|
||||
|
@ -233,7 +233,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default null
|
||||
*/
|
||||
"catcher": null,
|
||||
|
||||
|
||||
/**
|
||||
* List of button elements
|
||||
* @property buttons
|
||||
|
@ -241,7 +241,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @default []
|
||||
*/
|
||||
"buttons": [],
|
||||
|
||||
|
||||
/**
|
||||
* Restore button
|
||||
* @property restore
|
||||
|
@ -250,10 +250,10 @@ ColVis = function( oDTSettings, oInit )
|
|||
*/
|
||||
"restore": null
|
||||
};
|
||||
|
||||
|
||||
/* Store global reference */
|
||||
ColVis.aInstances.push( this );
|
||||
|
||||
|
||||
/* Constructor logic */
|
||||
this.s.dt = oDTSettings;
|
||||
this._fnConstruct();
|
||||
|
@ -266,7 +266,7 @@ ColVis.prototype = {
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Public methods
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
/**
|
||||
* Rebuild the list of buttons for this instance (i.e. if there is a column header update)
|
||||
* @method fnRebuild
|
||||
|
@ -283,55 +283,55 @@ ColVis.prototype = {
|
|||
}
|
||||
}
|
||||
this.dom.buttons.splice( 0, this.dom.buttons.length );
|
||||
|
||||
|
||||
if ( this.dom.restore )
|
||||
{
|
||||
this.dom.restore.parentNode( this.dom.restore );
|
||||
}
|
||||
|
||||
|
||||
/* Re-add them (this is not the optimal way of doing this, it is fast and effective) */
|
||||
this._fnAddButtons();
|
||||
|
||||
|
||||
/* Update the checkboxes */
|
||||
this._fnDrawCallback();
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Private methods (they are of course public in JS, but recommended as private)
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
/**
|
||||
* Constructor logic
|
||||
* @method _fnConstruct
|
||||
* @returns void
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnConstruct": function ()
|
||||
{
|
||||
this._fnApplyCustomisation();
|
||||
|
||||
|
||||
var that = this;
|
||||
this.dom.wrapper = document.createElement('div');
|
||||
this.dom.wrapper.className = "ColVis TableTools";
|
||||
|
||||
|
||||
this.dom.button = this._fnDomBaseButton( this.s.buttonText );
|
||||
this.dom.button.className += " ColVis_MasterButton";
|
||||
this.dom.wrapper.appendChild( this.dom.button );
|
||||
|
||||
|
||||
this.dom.catcher = this._fnDomCatcher();
|
||||
this.dom.collection = this._fnDomCollection();
|
||||
this.dom.background = this._fnDomBackground();
|
||||
|
||||
|
||||
this._fnAddButtons();
|
||||
|
||||
|
||||
/* Store the original visbility information */
|
||||
for ( var i=0, iLen=this.s.dt.aoColumns.length ; i<iLen ; i++ )
|
||||
{
|
||||
this.s.abOriginal.push( this.s.dt.aoColumns[i].bVisible );
|
||||
}
|
||||
|
||||
|
||||
/* Update on each draw */
|
||||
this.s.dt.aoDrawCallback.push( {
|
||||
"fn": function () {
|
||||
|
@ -340,73 +340,73 @@ ColVis.prototype = {
|
|||
"sName": "ColVis"
|
||||
} );
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Apply any customisation to the settings from the DataTables initialisation
|
||||
* @method _fnApplyCustomisation
|
||||
* @returns void
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnApplyCustomisation": function ()
|
||||
{
|
||||
var oConfig = this.s.oInit;
|
||||
|
||||
|
||||
if ( typeof oConfig.activate != 'undefined' )
|
||||
{
|
||||
this.s.activate = oConfig.activate;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.buttonText != 'undefined' )
|
||||
{
|
||||
this.s.buttonText = oConfig.buttonText;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.aiExclude != 'undefined' )
|
||||
{
|
||||
this.s.aiExclude = oConfig.aiExclude;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.bRestore != 'undefined' )
|
||||
{
|
||||
this.s.bRestore = oConfig.bRestore;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.sRestore != 'undefined' )
|
||||
{
|
||||
this.s.sRestore = oConfig.sRestore;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.bShowAll != 'undefined' )
|
||||
{
|
||||
this.s.bShowAll = oConfig.bShowAll;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.sShowAll != 'undefined' )
|
||||
{
|
||||
this.s.sShowAll = oConfig.sShowAll;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.sAlign != 'undefined' )
|
||||
{
|
||||
this.s.sAlign = oConfig.sAlign;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.fnStateChange != 'undefined' )
|
||||
{
|
||||
this.s.fnStateChange = oConfig.fnStateChange;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.iOverlayFade != 'undefined' )
|
||||
{
|
||||
this.s.iOverlayFade = oConfig.iOverlayFade;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.fnLabel != 'undefined' )
|
||||
{
|
||||
this.s.fnLabel = oConfig.fnLabel;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oConfig.sSize != 'undefined' )
|
||||
{
|
||||
this.s.sSize = oConfig.sSize;
|
||||
|
@ -417,19 +417,19 @@ ColVis.prototype = {
|
|||
this.s.bCssPosition = oConfig.bCssPosition;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* On each table draw, check the visiblity checkboxes as needed. This allows any process to
|
||||
* update the table's column visiblity and ColVis will still be accurate.
|
||||
* @method _fnDrawCallback
|
||||
* @returns void
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnDrawCallback": function ()
|
||||
{
|
||||
var aoColumns = this.s.dt.aoColumns;
|
||||
|
||||
|
||||
for ( var i=0, iLen=aoColumns.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( this.dom.buttons[i] !== null )
|
||||
|
@ -445,20 +445,20 @@ ColVis.prototype = {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Loop through the columns in the table and as a new button for each one.
|
||||
* @method _fnAddButtons
|
||||
* @returns void
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnAddButtons": function ()
|
||||
{
|
||||
var
|
||||
nButton,
|
||||
sExclude = ","+this.s.aiExclude.join(',')+",";
|
||||
|
||||
|
||||
for ( var i=0, iLen=this.s.dt.aoColumns.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( sExclude.indexOf( ","+i+"," ) == -1 )
|
||||
|
@ -472,7 +472,7 @@ ColVis.prototype = {
|
|||
this.dom.buttons.push( null );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( this.s.bRestore )
|
||||
{
|
||||
nButton = this._fnDomRestoreButton();
|
||||
|
@ -480,7 +480,7 @@ ColVis.prototype = {
|
|||
this.dom.buttons.push( nButton );
|
||||
this.dom.collection.appendChild( nButton );
|
||||
}
|
||||
|
||||
|
||||
if ( this.s.bShowAll )
|
||||
{
|
||||
nButton = this._fnDomShowAllButton();
|
||||
|
@ -489,13 +489,13 @@ ColVis.prototype = {
|
|||
this.dom.collection.appendChild( nButton );
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create a button which allows a "restore" action
|
||||
* @method _fnDomRestoreButton
|
||||
* @returns {Node} Created button
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnDomRestoreButton": function ()
|
||||
{
|
||||
|
@ -503,12 +503,12 @@ ColVis.prototype = {
|
|||
that = this,
|
||||
nButton = document.createElement('button'),
|
||||
nSpan = document.createElement('span');
|
||||
|
||||
|
||||
nButton.className = !this.s.dt.bJUI ? "ColVis_Button TableTools_Button" :
|
||||
"ColVis_Button TableTools_Button ui-button ui-state-default";
|
||||
nButton.appendChild( nSpan );
|
||||
$(nSpan).html( '<span class="ColVis_title">'+this.s.sRestore+'</span>' );
|
||||
|
||||
|
||||
$(nButton).click( function (e) {
|
||||
for ( var i=0, iLen=that.s.abOriginal.length ; i<iLen ; i++ )
|
||||
{
|
||||
|
@ -517,16 +517,16 @@ ColVis.prototype = {
|
|||
that._fnAdjustOpenRows();
|
||||
that.s.dt.oInstance.fnDraw( false );
|
||||
} );
|
||||
|
||||
|
||||
return nButton;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create a button which allows a "show all" action
|
||||
* @method _fnDomShowAllButton
|
||||
* @returns {Node} Created button
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnDomShowAllButton": function ()
|
||||
{
|
||||
|
@ -534,12 +534,12 @@ ColVis.prototype = {
|
|||
that = this,
|
||||
nButton = document.createElement('button'),
|
||||
nSpan = document.createElement('span');
|
||||
|
||||
|
||||
nButton.className = !this.s.dt.bJUI ? "ColVis_Button TableTools_Button" :
|
||||
"ColVis_Button TableTools_Button ui-button ui-state-default";
|
||||
nButton.appendChild( nSpan );
|
||||
$(nSpan).html( '<span class="ColVis_title">'+this.s.sShowAll+'</span>' );
|
||||
|
||||
|
||||
$(nButton).click( function (e) {
|
||||
for ( var i=0, iLen=that.s.abOriginal.length ; i<iLen ; i++ )
|
||||
{
|
||||
|
@ -551,17 +551,17 @@ ColVis.prototype = {
|
|||
that._fnAdjustOpenRows();
|
||||
that.s.dt.oInstance.fnDraw( false );
|
||||
} );
|
||||
|
||||
|
||||
return nButton;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create the DOM for a show / hide button
|
||||
* @method _fnDomColumnButton
|
||||
* @param {int} i Column in question
|
||||
* @returns {Node} Created button
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnDomColumnButton": function ( i )
|
||||
{
|
||||
|
@ -571,7 +571,7 @@ ColVis.prototype = {
|
|||
nButton = document.createElement('button'),
|
||||
nSpan = document.createElement('span'),
|
||||
dt = this.s.dt;
|
||||
|
||||
|
||||
nButton.className = !dt.bJUI ? "ColVis_Button TableTools_Button" :
|
||||
"ColVis_Button TableTools_Button ui-button ui-state-default";
|
||||
nButton.appendChild( nSpan );
|
||||
|
@ -579,14 +579,14 @@ ColVis.prototype = {
|
|||
$(nSpan).html(
|
||||
'<span class="ColVis_radio"><input type="checkbox"/></span>'+
|
||||
'<span class="ColVis_title">'+sTitle+'</span>' );
|
||||
|
||||
|
||||
$(nButton).click( function (e) {
|
||||
var showHide = !$('input', this).is(":checked");
|
||||
if ( e.target.nodeName.toLowerCase() == "input" )
|
||||
{
|
||||
showHide = $('input', this).is(":checked");
|
||||
}
|
||||
|
||||
|
||||
/* Need to consider the case where the initialiser created more than one table - change the
|
||||
* API index that DataTables is using
|
||||
*/
|
||||
|
@ -606,22 +606,22 @@ ColVis.prototype = {
|
|||
}
|
||||
|
||||
$.fn.dataTableExt.iApiIndex = oldIndex; /* Restore */
|
||||
|
||||
|
||||
if ( that.s.fnStateChange !== null )
|
||||
{
|
||||
that.s.fnStateChange.call( that, i, showHide );
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
return nButton;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get the position in the DataTables instance array of the table for this instance of ColVis
|
||||
* @method _fnDataTablesApiIndex
|
||||
* @returns {int} Index
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnDataTablesApiIndex": function ()
|
||||
{
|
||||
|
@ -634,14 +634,14 @@ ColVis.prototype = {
|
|||
}
|
||||
return 0;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create the DOM needed for the button and apply some base properties. All buttons start here
|
||||
* @method _fnDomBaseButton
|
||||
* @param {String} text Button text
|
||||
* @returns {Node} DIV element for the button
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnDomBaseButton": function ( text )
|
||||
{
|
||||
|
@ -650,26 +650,26 @@ ColVis.prototype = {
|
|||
nButton = document.createElement('button'),
|
||||
nSpan = document.createElement('span'),
|
||||
sEvent = this.s.activate=="mouseover" ? "mouseover" : "click";
|
||||
|
||||
|
||||
nButton.className = !this.s.dt.bJUI ? "ColVis_Button TableTools_Button" :
|
||||
"ColVis_Button TableTools_Button ui-button ui-state-default";
|
||||
nButton.appendChild( nSpan );
|
||||
nSpan.innerHTML = text;
|
||||
|
||||
|
||||
$(nButton).bind( sEvent, function (e) {
|
||||
that._fnCollectionShow();
|
||||
e.preventDefault();
|
||||
} );
|
||||
|
||||
|
||||
return nButton;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create the element used to contain list the columns (it is shown and hidden as needed)
|
||||
* @method _fnDomCollection
|
||||
* @returns {Node} div container for the collection
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnDomCollection": function ()
|
||||
{
|
||||
|
@ -678,60 +678,60 @@ ColVis.prototype = {
|
|||
nHidden.style.display = "none";
|
||||
nHidden.className = !this.s.dt.bJUI ? "ColVis_collection TableTools_collection" :
|
||||
"ColVis_collection TableTools_collection ui-buttonset ui-buttonset-multi";
|
||||
|
||||
|
||||
if ( !this.s.bCssPosition )
|
||||
{
|
||||
nHidden.style.position = "absolute";
|
||||
}
|
||||
$(nHidden).css('opacity', 0);
|
||||
|
||||
|
||||
return nHidden;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* An element to be placed on top of the activate button to catch events
|
||||
* @method _fnDomCatcher
|
||||
* @returns {Node} div container for the collection
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnDomCatcher": function ()
|
||||
{
|
||||
var
|
||||
var
|
||||
that = this,
|
||||
nCatcher = document.createElement('div');
|
||||
nCatcher.className = "ColVis_catcher TableTools_catcher";
|
||||
|
||||
|
||||
$(nCatcher).click( function () {
|
||||
that._fnCollectionHide.call( that, null, null );
|
||||
} );
|
||||
|
||||
|
||||
return nCatcher;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create the element used to shade the background, and capture hide events (it is shown and
|
||||
* Create the element used to shade the background, and capture hide events (it is shown and
|
||||
* hidden as needed)
|
||||
* @method _fnDomBackground
|
||||
* @returns {Node} div container for the background
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnDomBackground": function ()
|
||||
{
|
||||
var that = this;
|
||||
|
||||
|
||||
var nBackground = document.createElement('div');
|
||||
nBackground.style.position = "absolute";
|
||||
nBackground.style.left = "0px";
|
||||
nBackground.style.top = "0px";
|
||||
nBackground.className = "ColVis_collectionBackground TableTools_collectionBackground";
|
||||
$(nBackground).css('opacity', 0);
|
||||
|
||||
|
||||
$(nBackground).click( function () {
|
||||
that._fnCollectionHide.call( that, null, null );
|
||||
} );
|
||||
|
||||
|
||||
/* When considering a mouse over action for the activation, we also consider a mouse out
|
||||
* which is the same as a mouse over the background - without all the messing around of
|
||||
* bubbling events. Use the catcher element to avoid messing around with bubbling
|
||||
|
@ -743,16 +743,16 @@ ColVis.prototype = {
|
|||
that._fnCollectionHide.call( that, null, null );
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
return nBackground;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Show the show / hide list and the background
|
||||
* @method _fnCollectionShow
|
||||
* @returns void
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnCollectionShow": function ()
|
||||
{
|
||||
|
@ -762,7 +762,7 @@ ColVis.prototype = {
|
|||
var nBackground = this.dom.background;
|
||||
var iDivX = parseInt(oPos.left, 10);
|
||||
var iDivY = parseInt(oPos.top + $(this.dom.button).outerHeight(), 10);
|
||||
|
||||
|
||||
if ( !this.s.bCssPosition )
|
||||
{
|
||||
nHidden.style.top = iDivY+"px";
|
||||
|
@ -770,23 +770,23 @@ ColVis.prototype = {
|
|||
}
|
||||
nHidden.style.display = "block";
|
||||
$(nHidden).css('opacity',0);
|
||||
|
||||
|
||||
var iWinHeight = $(window).height(), iDocHeight = $(document).height(),
|
||||
iWinWidth = $(window).width(), iDocWidth = $(document).width();
|
||||
|
||||
|
||||
nBackground.style.height = ((iWinHeight>iDocHeight)? iWinHeight : iDocHeight) +"px";
|
||||
nBackground.style.width = ((iWinWidth<iDocWidth)? iWinWidth : iDocWidth) +"px";
|
||||
|
||||
|
||||
var oStyle = this.dom.catcher.style;
|
||||
oStyle.height = $(this.dom.button).outerHeight()+"px";
|
||||
oStyle.width = $(this.dom.button).outerWidth()+"px";
|
||||
oStyle.top = oPos.top+"px";
|
||||
oStyle.left = iDivX+"px";
|
||||
|
||||
|
||||
document.body.appendChild( nBackground );
|
||||
document.body.appendChild( nHidden );
|
||||
document.body.appendChild( this.dom.catcher );
|
||||
|
||||
|
||||
/* Resize the buttons */
|
||||
if ( this.s.sSize == "auto" )
|
||||
{
|
||||
|
@ -810,7 +810,7 @@ ColVis.prototype = {
|
|||
}
|
||||
this.dom.collection.style.width = iMax+"px";
|
||||
}
|
||||
|
||||
|
||||
/* Visual corrections to try and keep the collection visible */
|
||||
if ( !this.s.bCssPosition )
|
||||
{
|
||||
|
@ -819,13 +819,13 @@ ColVis.prototype = {
|
|||
|
||||
var iDivWidth = $(nHidden).outerWidth();
|
||||
var iDivHeight = $(nHidden).outerHeight();
|
||||
|
||||
|
||||
if ( iDivX + iDivWidth > iDocWidth )
|
||||
{
|
||||
nHidden.style.left = (iDocWidth-iDivWidth)+"px";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* This results in a very small delay for the end user but it allows the animation to be
|
||||
* much smoother. If you don't want the animation, then the setTimeout can be removed
|
||||
*/
|
||||
|
@ -841,37 +841,37 @@ ColVis.prototype = {
|
|||
}
|
||||
});
|
||||
}, 10 );
|
||||
|
||||
|
||||
this.s.hidden = false;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Hide the show / hide list and the background
|
||||
* @method _fnCollectionHide
|
||||
* @returns void
|
||||
* @private
|
||||
* @private
|
||||
*/
|
||||
"_fnCollectionHide": function ( )
|
||||
{
|
||||
var that = this;
|
||||
|
||||
|
||||
if ( !this.s.hidden && this.dom.collection !== null )
|
||||
{
|
||||
this.s.hidden = true;
|
||||
|
||||
|
||||
$(this.dom.collection).animate({"opacity": 0}, that.s.iOverlayFade, function (e) {
|
||||
this.style.display = "none";
|
||||
} );
|
||||
|
||||
|
||||
$(this.dom.background).animate({"opacity": 0}, that.s.iOverlayFade, function (e) {
|
||||
document.body.removeChild( that.dom.background );
|
||||
document.body.removeChild( that.dom.catcher );
|
||||
} );
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Alter the colspan on any fnOpen rows
|
||||
*/
|
||||
|
@ -879,7 +879,7 @@ ColVis.prototype = {
|
|||
{
|
||||
var aoOpen = this.s.dt.aoOpenRows;
|
||||
var iVisible = this.s.dt.oApi._fnVisbleColumns( this.s.dt );
|
||||
|
||||
|
||||
for ( var i=0, iLen=aoOpen.length ; i<iLen ; i++ ) {
|
||||
aoOpen[i].nTr.getElementsByTagName('td')[0].colSpan = iVisible;
|
||||
}
|
||||
|
@ -908,7 +908,7 @@ ColVis.fnRebuild = function ( oTable )
|
|||
{
|
||||
nTable = oTable.fnSettings().nTable;
|
||||
}
|
||||
|
||||
|
||||
for ( var i=0, iLen=ColVis.aInstances.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( typeof oTable == 'undefined' || nTable == ColVis.aInstances[i].s.dt.nTable )
|
||||
|
|
|
@ -22,11 +22,11 @@ var FixedColumns;
|
|||
(function($, window, document) {
|
||||
|
||||
|
||||
/**
|
||||
* When making use of DataTables' x-axis scrolling feature, you may wish to
|
||||
* fix the left most column in place. This plug-in for DataTables provides
|
||||
* exactly this option (note for non-scrolling tables, please use the
|
||||
* FixedHeader plug-in, which can fix headers, footers and columns). Key
|
||||
/**
|
||||
* When making use of DataTables' x-axis scrolling feature, you may wish to
|
||||
* fix the left most column in place. This plug-in for DataTables provides
|
||||
* exactly this option (note for non-scrolling tables, please use the
|
||||
* FixedHeader plug-in, which can fix headers, footers and columns). Key
|
||||
* features include:
|
||||
* <ul class="limit_length">
|
||||
* <li>Freezes the left or right most columns to the side of the table</li>
|
||||
|
@ -39,10 +39,10 @@ var FixedColumns;
|
|||
* @constructor
|
||||
* @param {object} oDT DataTables instance
|
||||
* @param {object} [oInit={}] Configuration object for FixedColumns. Options are defined by {@link FixedColumns.defaults}
|
||||
*
|
||||
*
|
||||
* @requires jQuery 1.3+
|
||||
* @requires DataTables 1.8.0.dev+
|
||||
*
|
||||
*
|
||||
* @example
|
||||
* var oTable = $('#example').dataTable( {
|
||||
* "sScrollX": "100%"
|
||||
|
@ -56,40 +56,40 @@ FixedColumns = function ( oDT, oInit ) {
|
|||
alert( "FixedColumns warning: FixedColumns must be initialised with the 'new' keyword." );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oInit == 'undefined' )
|
||||
{
|
||||
oInit = {};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Settings object which contains customisable information for FixedColumns instance
|
||||
* @namespace
|
||||
* @extends FixedColumns.defaults
|
||||
*/
|
||||
this.s = {
|
||||
/**
|
||||
/**
|
||||
* DataTables settings objects
|
||||
* @type object
|
||||
* @default Obtained from DataTables instance
|
||||
*/
|
||||
"dt": oDT.fnSettings(),
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Number of columns in the DataTable - stored for quick access
|
||||
* @type int
|
||||
* @default Obtained from DataTables instance
|
||||
*/
|
||||
"iTableColumns": oDT.fnSettings().aoColumns.length,
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Original widths of the columns as rendered by DataTables
|
||||
* @type array.<int>
|
||||
* @default []
|
||||
*/
|
||||
"aiWidths": [],
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Flag to indicate if we are dealing with IE6/7 as these browsers need a little hack
|
||||
* in the odd place
|
||||
* @type boolean
|
||||
|
@ -98,12 +98,12 @@ FixedColumns = function ( oDT, oInit ) {
|
|||
*/
|
||||
"bOldIE": ($.browser.msie && ($.browser.version == "6.0" || $.browser.version == "7.0"))
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* DOM elements used by the class instance
|
||||
* @namespace
|
||||
*
|
||||
*
|
||||
*/
|
||||
this.dom = {
|
||||
/**
|
||||
|
@ -112,21 +112,21 @@ FixedColumns = function ( oDT, oInit ) {
|
|||
* @default null
|
||||
*/
|
||||
"scroller": null,
|
||||
|
||||
|
||||
/**
|
||||
* DataTables header table
|
||||
* @type node
|
||||
* @default null
|
||||
*/
|
||||
"header": null,
|
||||
|
||||
|
||||
/**
|
||||
* DataTables body table
|
||||
* @type node
|
||||
* @default null
|
||||
*/
|
||||
"body": null,
|
||||
|
||||
|
||||
/**
|
||||
* DataTables footer table
|
||||
* @type node
|
||||
|
@ -177,7 +177,7 @@ FixedColumns = function ( oDT, oInit ) {
|
|||
"foot": null
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Cloned table nodes
|
||||
* @namespace
|
||||
|
@ -194,14 +194,14 @@ FixedColumns = function ( oDT, oInit ) {
|
|||
* @default null
|
||||
*/
|
||||
"header": null,
|
||||
|
||||
|
||||
/**
|
||||
* Cloned body table
|
||||
* @type node
|
||||
* @default null
|
||||
*/
|
||||
"body": null,
|
||||
|
||||
|
||||
/**
|
||||
* Cloned footer table
|
||||
* @type node
|
||||
|
@ -209,7 +209,7 @@ FixedColumns = function ( oDT, oInit ) {
|
|||
*/
|
||||
"footer": null
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Right column cloned table nodes
|
||||
* @namespace
|
||||
|
@ -221,14 +221,14 @@ FixedColumns = function ( oDT, oInit ) {
|
|||
* @default null
|
||||
*/
|
||||
"header": null,
|
||||
|
||||
|
||||
/**
|
||||
* Cloned body table
|
||||
* @type node
|
||||
* @default null
|
||||
*/
|
||||
"body": null,
|
||||
|
||||
|
||||
/**
|
||||
* Cloned footer table
|
||||
* @type node
|
||||
|
@ -241,7 +241,7 @@ FixedColumns = function ( oDT, oInit ) {
|
|||
|
||||
/* Attach the instance to the DataTables instance so it can be accessed easily */
|
||||
this.s.dt.oFixedColumns = this;
|
||||
|
||||
|
||||
/* Let's do it */
|
||||
this._fnConstruct( oInit );
|
||||
};
|
||||
|
@ -252,7 +252,7 @@ FixedColumns.prototype = {
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Public methods
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
/**
|
||||
* Update the fixed columns - including headers and footers. Note that FixedColumns will
|
||||
* automatically update the display whenever the host DataTable redraws.
|
||||
|
@ -262,7 +262,7 @@ FixedColumns.prototype = {
|
|||
* "sScrollX": "100%"
|
||||
* } );
|
||||
* var oFC = new FixedColumns( oTable );
|
||||
*
|
||||
*
|
||||
* // at some later point when the table has been manipulated....
|
||||
* oFC.fnUpdate();
|
||||
*/
|
||||
|
@ -270,8 +270,8 @@ FixedColumns.prototype = {
|
|||
{
|
||||
this._fnDraw( true );
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Recalculate the resizes of the 3x3 grid that FixedColumns uses for display of the table.
|
||||
* This is useful if you update the width of the table container. Note that FixedColumns will
|
||||
|
@ -282,7 +282,7 @@ FixedColumns.prototype = {
|
|||
* "sScrollX": "100%"
|
||||
* } );
|
||||
* var oFC = new FixedColumns( oTable );
|
||||
*
|
||||
*
|
||||
* // Resize the table container and then have FixedColumns adjust its layout....
|
||||
* $('#content').width( 1200 );
|
||||
* oFC.fnRedrawLayout();
|
||||
|
@ -291,8 +291,8 @@ FixedColumns.prototype = {
|
|||
{
|
||||
this.__fnGridLayout();
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Mark a row such that it's height should be recalculated when using 'semiauto' row
|
||||
* height matching. This function will have no effect when 'none' or 'auto' row height
|
||||
|
@ -304,7 +304,7 @@ FixedColumns.prototype = {
|
|||
* "sScrollX": "100%"
|
||||
* } );
|
||||
* var oFC = new FixedColumns( oTable );
|
||||
*
|
||||
*
|
||||
* // manipulate the table - mark the row as needing an update then update the table
|
||||
* // this allows the redraw performed by DataTables fnUpdate to recalculate the row
|
||||
* // height
|
||||
|
@ -316,8 +316,8 @@ FixedColumns.prototype = {
|
|||
nTr._DTTC_iHeight = null;
|
||||
nTr.style.height = 'auto';
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Set the height of a given row - provides cross browser compatibility
|
||||
* @param {Node} nTarget TR element that should have it's height recalculated
|
||||
|
@ -328,7 +328,7 @@ FixedColumns.prototype = {
|
|||
* "sScrollX": "100%"
|
||||
* } );
|
||||
* var oFC = new FixedColumns( oTable );
|
||||
*
|
||||
*
|
||||
* // You may want to do this after manipulating a row in the fixed column
|
||||
* oFC.fnSetRowHeight( $('#example tbody tr:eq(0)')[0], 50 );
|
||||
*/
|
||||
|
@ -347,13 +347,13 @@ FixedColumns.prototype = {
|
|||
$(nTarget).children().height( iHeight-iBoxHack );
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Private methods (they are of course public in JS, but recommended as private)
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
|
||||
/**
|
||||
* Initialisation for FixedColumns
|
||||
* @param {Object} oInit User settings for initialisation
|
||||
|
@ -364,7 +364,7 @@ FixedColumns.prototype = {
|
|||
{
|
||||
var i, iLen, iWidth,
|
||||
that = this;
|
||||
|
||||
|
||||
/* Sanity checking */
|
||||
if ( typeof this.s.dt.oInstance.fnVersionCheck != 'function' ||
|
||||
this.s.dt.oInstance.fnVersionCheck( '1.8.0' ) !== true )
|
||||
|
@ -373,7 +373,7 @@ FixedColumns.prototype = {
|
|||
"Please upgrade your DataTables installation" );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ( this.s.dt.oScroll.sX === "" )
|
||||
{
|
||||
this.s.dt.oInstance.oApi._fnLog( this.s.dt, 1, "FixedColumns is not needed (no "+
|
||||
|
@ -381,7 +381,7 @@ FixedColumns.prototype = {
|
|||
"column fixing when scrolling is not enabled" );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* Apply the settings from the user / defaults */
|
||||
this.s = $.extend( true, this.s, FixedColumns.defaults, oInit );
|
||||
|
||||
|
@ -409,15 +409,15 @@ FixedColumns.prototype = {
|
|||
if ( this.s.iLeftWidth === null )
|
||||
{
|
||||
this.s.iLeftWidth = this.s.sLeftWidth == 'fixed' ?
|
||||
iLeftWidth : (iLeftWidth/iScrollWidth) * 100;
|
||||
iLeftWidth : (iLeftWidth/iScrollWidth) * 100;
|
||||
}
|
||||
|
||||
|
||||
if ( this.s.iRightWidth === null )
|
||||
{
|
||||
this.s.iRightWidth = this.s.sRightWidth == 'fixed' ?
|
||||
iRightWidth : (iRightWidth/iScrollWidth) * 100;
|
||||
}
|
||||
|
||||
|
||||
/* Set up the DOM that we want for the fixed column layout grid */
|
||||
this._fnGridSetup();
|
||||
|
||||
|
@ -443,7 +443,7 @@ FixedColumns.prototype = {
|
|||
$(window).resize( function () {
|
||||
that._fnGridLayout.call( that );
|
||||
} );
|
||||
|
||||
|
||||
var bFirstDraw = true;
|
||||
this.s.dt.aoDrawCallback = [ {
|
||||
"fn": function () {
|
||||
|
@ -453,7 +453,7 @@ FixedColumns.prototype = {
|
|||
},
|
||||
"sName": "FixedColumns"
|
||||
} ].concat( this.s.dt.aoDrawCallback );
|
||||
|
||||
|
||||
/* Get things right to start with - note that due to adjusting the columns, there must be
|
||||
* another redraw of the main table. It doesn't need to be a full redraw however.
|
||||
*/
|
||||
|
@ -461,8 +461,8 @@ FixedColumns.prototype = {
|
|||
this._fnGridHeight();
|
||||
this.s.dt.oInstance.fnDraw(false);
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Set up the DOM for the fixed column. The way the layout works is to create a 1x3 grid
|
||||
* for the left column, the DataTable (for which we just reuse the scrolling element DataTable
|
||||
|
@ -479,8 +479,8 @@ FixedColumns.prototype = {
|
|||
this.dom.body = this.s.dt.nTable;
|
||||
this.dom.header = this.s.dt.nTHead.parentNode;
|
||||
this.dom.header.parentNode.parentNode.style.position = "relative";
|
||||
|
||||
var nSWrapper =
|
||||
|
||||
var nSWrapper =
|
||||
$('<div class="DTFC_ScrollWrapper" style="position:relative; clear:both;">'+
|
||||
'<div class="DTFC_LeftWrapper" style="position:absolute; top:0; left:0;">'+
|
||||
'<div class="DTFC_LeftHeadWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div>'+
|
||||
|
@ -507,7 +507,7 @@ FixedColumns.prototype = {
|
|||
this.dom.grid.right.head = nRight.childNodes[0];
|
||||
this.dom.grid.right.body = nRight.childNodes[1];
|
||||
}
|
||||
|
||||
|
||||
if ( this.s.dt.nTFoot )
|
||||
{
|
||||
this.dom.footer = this.s.dt.nTFoot.parentNode;
|
||||
|
@ -527,8 +527,8 @@ FixedColumns.prototype = {
|
|||
this.dom.grid.dt.style.left = this.s.iLeftWidth+"px";
|
||||
this.dom.grid.dt.style.width = ($(this.dom.grid.dt).width()-this.s.iLeftWidth-this.s.iRightWidth)+"px";
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Style and position the grid used for the FixedColumns layout based on the instance settings.
|
||||
* Specifically sLeftWidth ('fixed' or 'absolute'), iLeftWidth (px if fixed, % if absolute) and
|
||||
|
@ -572,10 +572,10 @@ FixedColumns.prototype = {
|
|||
oGrid.right.wrapper.style.left = (iTotal-iRight)+"px";
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Recalculate and set the height of the grid components used for positioning of the
|
||||
* Recalculate and set the height of the grid components used for positioning of the
|
||||
* FixedColumn display grid.
|
||||
* @returns {void}
|
||||
* @private
|
||||
|
@ -588,15 +588,15 @@ FixedColumns.prototype = {
|
|||
oGrid.wrapper.style.height = iHeight+"px";
|
||||
oGrid.left.body.style.height = $(this.dom.scroller).height()+"px";
|
||||
oGrid.left.wrapper.style.height = iHeight+"px";
|
||||
|
||||
|
||||
if ( this.s.iRightColumns > 0 )
|
||||
{
|
||||
oGrid.right.wrapper.style.height = iHeight+"px";
|
||||
oGrid.right.body.style.height = $(this.dom.scroller).height()+"px";
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Clone and position the fixed columns
|
||||
* @returns {void}
|
||||
|
@ -615,13 +615,13 @@ FixedColumns.prototype = {
|
|||
}
|
||||
|
||||
/* Event triggering */
|
||||
$(this).trigger( 'draw', {
|
||||
$(this).trigger( 'draw', {
|
||||
"leftClone": this.dom.clone.left,
|
||||
"rightClone": this.dom.clone.right
|
||||
} );
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Clone the right columns
|
||||
* @returns {void}
|
||||
|
@ -634,7 +634,7 @@ FixedColumns.prototype = {
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var that = this,
|
||||
i, jq,
|
||||
aiColumns = [];
|
||||
|
@ -646,8 +646,8 @@ FixedColumns.prototype = {
|
|||
|
||||
this._fnClone( this.dom.clone.right, this.dom.grid.right, aiColumns, bAll );
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Clone the left columns
|
||||
* @returns {void}
|
||||
|
@ -660,11 +660,11 @@ FixedColumns.prototype = {
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var that = this,
|
||||
i, jq,
|
||||
aiColumns = [];
|
||||
|
||||
|
||||
for ( i=0 ; i<this.s.iLeftColumns ; i++ )
|
||||
{
|
||||
aiColumns.push( i );
|
||||
|
@ -672,8 +672,8 @@ FixedColumns.prototype = {
|
|||
|
||||
this._fnClone( this.dom.clone.left, this.dom.grid.left, aiColumns, bAll );
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Make a copy of the layout object for a header or footer element from DataTables. Note that
|
||||
* this method will clone the nodes in the layout object.
|
||||
|
@ -720,19 +720,19 @@ FixedColumns.prototype = {
|
|||
} );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
aReturn.push( aRow );
|
||||
}
|
||||
|
||||
return aReturn;
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Clone the DataTable nodes and place them in the DOM (sized correctly)
|
||||
* @returns {void}
|
||||
* @param {Object} oClone Object containing the header, footer and body cloned DOM elements
|
||||
* @param {Object} oGrid Grid object containing the display grid elements for the cloned
|
||||
* @param {Object} oGrid Grid object containing the display grid elements for the cloned
|
||||
* column (left or right)
|
||||
* @param {Array} aiColumns Column indexes which should be operated on from the DataTable
|
||||
* @param {Boolean} bAll Indicate if the header and footer should be updated as well (true)
|
||||
|
@ -743,7 +743,7 @@ FixedColumns.prototype = {
|
|||
var that = this,
|
||||
i, iLen, jq, nTarget, iColumn, nClone, iIndex;
|
||||
|
||||
/*
|
||||
/*
|
||||
* Header
|
||||
*/
|
||||
if ( bAll )
|
||||
|
@ -756,7 +756,7 @@ FixedColumns.prototype = {
|
|||
oClone.header.className += " DTFC_Cloned";
|
||||
oClone.header.style.width = "100%";
|
||||
oGrid.head.appendChild( oClone.header );
|
||||
|
||||
|
||||
/* Copy the DataTables layout cache for the header for our floating column */
|
||||
var aoCloneLayout = this._fnCopyLayout( this.s.dt.aoHeader, aiColumns );
|
||||
var jqCloneThead = $('>thead', oClone.header);
|
||||
|
@ -779,15 +779,15 @@ FixedColumns.prototype = {
|
|||
{
|
||||
$('>thead th:eq('+iIndex+')', oClone.header)[0].className =
|
||||
this.s.dt.aoColumns[ aiColumns[iIndex] ].nTh.className;
|
||||
|
||||
|
||||
$('>thead th:eq('+iIndex+') span.DataTables_sort_icon', oClone.header).each( function (i) {
|
||||
this.className = $('span.DataTables_sort_icon', that.s.dt.aoColumns[ aiColumns[iIndex] ].nTh)[i].className;
|
||||
} );
|
||||
}
|
||||
}
|
||||
this._fnEqualiseHeights( 'thead', this.dom.header, oClone.header );
|
||||
|
||||
/*
|
||||
|
||||
/*
|
||||
* Body
|
||||
*/
|
||||
if ( this.s.sHeightMatch == 'auto' )
|
||||
|
@ -795,13 +795,13 @@ FixedColumns.prototype = {
|
|||
/* Remove any heights which have been applied already and let the browser figure it out */
|
||||
$('>tbody>tr', that.dom.body).css('height', 'auto');
|
||||
}
|
||||
|
||||
|
||||
if ( oClone.body !== null )
|
||||
{
|
||||
oClone.body.parentNode.removeChild( oClone.body );
|
||||
oClone.body = null;
|
||||
}
|
||||
|
||||
|
||||
oClone.body = $(this.dom.body).clone(true)[0];
|
||||
oClone.body.className += " DTFC_Cloned";
|
||||
oClone.body.style.paddingBottom = this.s.dt.oScroll.iBarWidth+"px";
|
||||
|
@ -810,10 +810,10 @@ FixedColumns.prototype = {
|
|||
{
|
||||
oClone.body.removeAttribute('id');
|
||||
}
|
||||
|
||||
|
||||
$('>thead>tr', oClone.body).empty();
|
||||
$('>tfoot', oClone.body).empty();
|
||||
|
||||
|
||||
var nBody = $('tbody', oClone.body)[0];
|
||||
$(nBody).empty();
|
||||
if ( this.s.dt.aiDisplay.length > 0 )
|
||||
|
@ -844,12 +844,12 @@ FixedColumns.prototype = {
|
|||
nBody.appendChild( nClone );
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
oClone.body.style.width = "100%";
|
||||
oGrid.body.appendChild( oClone.body );
|
||||
|
||||
this._fnEqualiseHeights( 'tbody', that.dom.body, oClone.body );
|
||||
|
||||
|
||||
/*
|
||||
* Footer
|
||||
*/
|
||||
|
@ -870,7 +870,7 @@ FixedColumns.prototype = {
|
|||
var aoCloneLayout = this._fnCopyLayout( this.s.dt.aoFooter, aiColumns );
|
||||
var jqCloneTfoot = $('>tfoot', oClone.footer);
|
||||
jqCloneTfoot.empty();
|
||||
|
||||
|
||||
for ( i=0, iLen=aoCloneLayout.length ; i<iLen ; i++ )
|
||||
{
|
||||
jqCloneTfoot[0].appendChild( aoCloneLayout[i].nTr );
|
||||
|
@ -906,8 +906,8 @@ FixedColumns.prototype = {
|
|||
}
|
||||
} );
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* From a given table node (THEAD etc), get a list of TR direct child elements
|
||||
* @param {Node} nIn Table element to search for TR elements (THEAD, TBODY or TFOOT element)
|
||||
|
@ -927,7 +927,7 @@ FixedColumns.prototype = {
|
|||
return aOut;
|
||||
},
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Equalise the heights of the rows in a given table node in a cross browser way
|
||||
* @returns {void}
|
||||
|
@ -942,7 +942,7 @@ FixedColumns.prototype = {
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var that = this,
|
||||
i, iLen, iHeight, iHeight2, iHeightOriginal, iHeightClone,
|
||||
rootOriginal = original.getElementsByTagName(nodeName)[0],
|
||||
|
@ -951,10 +951,10 @@ FixedColumns.prototype = {
|
|||
iBoxHack = jqBoxHack.outerHeight() - jqBoxHack.height(),
|
||||
anOriginal = this._fnGetTrNodes( rootOriginal ),
|
||||
anClone = this._fnGetTrNodes( rootClone );
|
||||
|
||||
|
||||
for ( i=0, iLen=anClone.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( this.s.sHeightMatch == 'semiauto' && typeof anOriginal[i]._DTTC_iHeight != 'undefined' &&
|
||||
if ( this.s.sHeightMatch == 'semiauto' && typeof anOriginal[i]._DTTC_iHeight != 'undefined' &&
|
||||
anOriginal[i]._DTTC_iHeight !== null )
|
||||
{
|
||||
/* Oddly enough, IE / Chrome seem not to copy the style height - Mozilla and Opera keep it */
|
||||
|
@ -964,21 +964,21 @@ FixedColumns.prototype = {
|
|||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
iHeightOriginal = anOriginal[i].offsetHeight;
|
||||
iHeightClone = anClone[i].offsetHeight;
|
||||
iHeight = iHeightClone > iHeightOriginal ? iHeightClone : iHeightOriginal;
|
||||
|
||||
|
||||
if ( this.s.sHeightMatch == 'semiauto' )
|
||||
{
|
||||
anOriginal[i]._DTTC_iHeight = iHeight;
|
||||
}
|
||||
|
||||
|
||||
/* Can we use some kind of object detection here?! This is very nasty - damn browsers */
|
||||
if ( $.browser.msie )
|
||||
{
|
||||
$(anClone[i]).children().height( iHeight-iBoxHack );
|
||||
$(anOriginal[i]).children().height( iHeight-iBoxHack );
|
||||
$(anOriginal[i]).children().height( iHeight-iBoxHack );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1002,7 +1002,7 @@ FixedColumns.prototype = {
|
|||
* @static
|
||||
*/
|
||||
FixedColumns.defaults = {
|
||||
/**
|
||||
/**
|
||||
* Number of left hand columns to fix in position
|
||||
* @type int
|
||||
* @default 1
|
||||
|
@ -1016,8 +1016,8 @@ FixedColumns.defaults = {
|
|||
* } );
|
||||
*/
|
||||
"iLeftColumns": 1,
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Number of right hand columns to fix in position
|
||||
* @type int
|
||||
* @default 0
|
||||
|
@ -1031,8 +1031,8 @@ FixedColumns.defaults = {
|
|||
* } );
|
||||
*/
|
||||
"iRightColumns": 0,
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Draw callback function which is called when FixedColumns has redrawn the fixed assets
|
||||
* @type function(object, object):void
|
||||
* @default null
|
||||
|
@ -1048,8 +1048,8 @@ FixedColumns.defaults = {
|
|||
* } );
|
||||
*/
|
||||
"fnDrawCallback": null,
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Type of left column size calculation. Can take the values of "fixed", whereby the iLeftWidth
|
||||
* value will be treated as a pixel value, or "relative" for which case iLeftWidth will be
|
||||
* treated as a percentage value.
|
||||
|
@ -1066,8 +1066,8 @@ FixedColumns.defaults = {
|
|||
* } );
|
||||
*/
|
||||
"sLeftWidth": "fixed",
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Width to set for the width of the left fixed column(s) - note that the behaviour of this
|
||||
* property is directly effected by the sLeftWidth property. If not defined then this property
|
||||
* is calculated automatically from what has been assigned by DataTables.
|
||||
|
@ -1083,10 +1083,10 @@ FixedColumns.defaults = {
|
|||
* } );
|
||||
*/
|
||||
"iLeftWidth": null,
|
||||
|
||||
/**
|
||||
* Type of right column size calculation. Can take the values of "fixed", whereby the
|
||||
* iRightWidth value will be treated as a pixel value, or "relative" for which case
|
||||
|
||||
/**
|
||||
* Type of right column size calculation. Can take the values of "fixed", whereby the
|
||||
* iRightWidth value will be treated as a pixel value, or "relative" for which case
|
||||
* iRightWidth will be treated as a percentage value.
|
||||
* @type string
|
||||
* @default fixed
|
||||
|
@ -1101,7 +1101,7 @@ FixedColumns.defaults = {
|
|||
* } );
|
||||
*/
|
||||
"sRightWidth": "fixed",
|
||||
|
||||
|
||||
/**
|
||||
* Width to set for the width of the right fixed column(s) - note that the behaviour of this
|
||||
* property is directly effected by the sRightWidth property. If not defined then this property
|
||||
|
@ -1118,8 +1118,8 @@ FixedColumns.defaults = {
|
|||
* } );
|
||||
*/
|
||||
"iRightWidth": null,
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Height matching algorthim to use. This can be "none" which will result in no height
|
||||
* matching being applied by FixedColumns (height matching could be forced by CSS in this
|
||||
* case), "semiauto" whereby the height calculation will be performed once, and the result
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* License: GPL v2 or BSD 3 point style
|
||||
* Project: Just a little bit of fun - enjoy :-)
|
||||
* Contact: www.sprymedia.co.uk/contact
|
||||
*
|
||||
*
|
||||
* Copyright 2009-2010 Allan Jardine, all rights reserved.
|
||||
*
|
||||
* This source file is free software, under either the GPL v2 license or a
|
||||
|
@ -41,7 +41,7 @@ var FixedHeader = function ( mTable, oInit ) {
|
|||
alert( "FixedHeader warning: FixedHeader must be initialised with the 'new' keyword." );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var that = this;
|
||||
var oSettings = {
|
||||
"aoCache": [],
|
||||
|
@ -69,7 +69,7 @@ var FixedHeader = function ( mTable, oInit ) {
|
|||
"bUseAbsPos": false,
|
||||
"bFooter": false
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Function: fnGetSettings
|
||||
* Purpose: Get the settings for this object
|
||||
|
@ -79,7 +79,7 @@ var FixedHeader = function ( mTable, oInit ) {
|
|||
this.fnGetSettings = function () {
|
||||
return oSettings;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Function: fnUpdate
|
||||
* Purpose: Update the positioning and copies of the fixed elements
|
||||
|
@ -90,7 +90,7 @@ var FixedHeader = function ( mTable, oInit ) {
|
|||
this._fnUpdateClones();
|
||||
this._fnUpdatePositions();
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Function: fnPosition
|
||||
* Purpose: Update the positioning of the fixed elements
|
||||
|
@ -100,10 +100,10 @@ var FixedHeader = function ( mTable, oInit ) {
|
|||
this.fnPosition = function () {
|
||||
this._fnUpdatePositions();
|
||||
};
|
||||
|
||||
|
||||
/* Let's do it */
|
||||
this.fnInit( mTable, oInit );
|
||||
|
||||
|
||||
/* Store the instance on the DataTables object for easy access */
|
||||
if ( typeof mTable.fnSettings == 'function' )
|
||||
{
|
||||
|
@ -121,7 +121,7 @@ FixedHeader.prototype = {
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Initialisation
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Function: fnInit
|
||||
* Purpose: The "constructor"
|
||||
|
@ -132,10 +132,10 @@ FixedHeader.prototype = {
|
|||
{
|
||||
var s = this.fnGetSettings();
|
||||
var that = this;
|
||||
|
||||
|
||||
/* Record the user definable settings */
|
||||
this.fnInitSettings( s, oInit );
|
||||
|
||||
|
||||
/* DataTables specific stuff */
|
||||
if ( typeof oTable.fnSettings == 'function' )
|
||||
{
|
||||
|
@ -146,15 +146,15 @@ FixedHeader.prototype = {
|
|||
"Please upgrade your DataTables installation" );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var oDtSettings = oTable.fnSettings();
|
||||
|
||||
|
||||
if ( oDtSettings.oScroll.sX != "" || oDtSettings.oScroll.sY != "" )
|
||||
{
|
||||
alert( "FixedHeader 2 is not supported with DataTables' scrolling mode at this time" );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
s.nTable = oDtSettings.nTable;
|
||||
oDtSettings.aoDrawCallback.push( {
|
||||
"fn": function () {
|
||||
|
@ -169,12 +169,12 @@ FixedHeader.prototype = {
|
|||
{
|
||||
s.nTable = oTable;
|
||||
}
|
||||
|
||||
|
||||
s.bFooter = ($('>tfoot', s.nTable).length > 0) ? true : false;
|
||||
|
||||
|
||||
/* "Detect" browsers that don't support absolute positioing - or have bugs */
|
||||
s.bUseAbsPos = (jQuery.browser.msie && (jQuery.browser.version=="6.0"||jQuery.browser.version=="7.0"));
|
||||
|
||||
|
||||
/* Add the 'sides' that are fixed */
|
||||
if ( s.oSides.top )
|
||||
{
|
||||
|
@ -192,29 +192,29 @@ FixedHeader.prototype = {
|
|||
{
|
||||
s.aoCache.push( that._fnCloneTable( "fixedRight", "FixedHeader_Right", that._fnCloneTRight ) );
|
||||
}
|
||||
|
||||
|
||||
/* Event listeners for window movement */
|
||||
FixedHeader.afnScroll.push( function () {
|
||||
that._fnUpdatePositions.call(that);
|
||||
} );
|
||||
|
||||
|
||||
jQuery(window).resize( function () {
|
||||
FixedHeader.fnMeasure();
|
||||
that._fnUpdateClones.call(that);
|
||||
that._fnUpdatePositions.call(that);
|
||||
} );
|
||||
|
||||
|
||||
/* Get things right to start with */
|
||||
FixedHeader.fnMeasure();
|
||||
that._fnUpdateClones();
|
||||
that._fnUpdatePositions();
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Support functions
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Function: fnInitSettings
|
||||
* Purpose: Take the user's settings and copy them to our local store
|
||||
|
@ -238,7 +238,7 @@ FixedHeader.prototype = {
|
|||
if ( typeof oInit.right != 'undefined' ) {
|
||||
s.oSides.right = oInit.right;
|
||||
}
|
||||
|
||||
|
||||
if ( typeof oInit.zTop != 'undefined' ) {
|
||||
s.oZIndexes.top = oInit.zTop;
|
||||
}
|
||||
|
@ -252,15 +252,15 @@ FixedHeader.prototype = {
|
|||
s.oZIndexes.right = oInit.zRight;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Detect browsers which have poor position:fixed support so we can use absolute positions.
|
||||
* This is much slower since the position must be updated for each scroll, but widens
|
||||
* compatibility
|
||||
*/
|
||||
s.bUseAbsPos = (jQuery.browser.msie &&
|
||||
s.bUseAbsPos = (jQuery.browser.msie &&
|
||||
(jQuery.browser.version=="6.0"||jQuery.browser.version=="7.0"));
|
||||
},
|
||||
|
||||
|
||||
/*
|
||||
* Function: _fnCloneTable
|
||||
* Purpose: Clone the table node and do basic initialisation
|
||||
|
@ -271,7 +271,7 @@ FixedHeader.prototype = {
|
|||
{
|
||||
var s = this.fnGetSettings();
|
||||
var nCTable;
|
||||
|
||||
|
||||
/* We know that the table _MUST_ has a DIV wrapped around it, because this is simply how
|
||||
* DataTables works. Therefore, we can set this to be relatively position (if it is not
|
||||
* alreadu absolute, and use this as the base point for the cloned header
|
||||
|
@ -280,17 +280,17 @@ FixedHeader.prototype = {
|
|||
{
|
||||
s.nTable.parentNode.style.position = "relative";
|
||||
}
|
||||
|
||||
|
||||
/* Just a shallow clone will do - we only want the table node */
|
||||
nCTable = s.nTable.cloneNode( false );
|
||||
nCTable.removeAttribute( 'id' );
|
||||
|
||||
|
||||
var nDiv = document.createElement( 'div' );
|
||||
nDiv.style.position = "absolute";
|
||||
nDiv.style.top = "0px";
|
||||
nDiv.style.left = "0px";
|
||||
nDiv.className += " FixedHeader_Cloned "+sType+" "+sClass;
|
||||
|
||||
|
||||
/* Set the zIndexes */
|
||||
if ( sType == "fixedHeader" )
|
||||
{
|
||||
|
@ -311,11 +311,11 @@ FixedHeader.prototype = {
|
|||
|
||||
/* remove margins since we are going to poistion it absolutely */
|
||||
nCTable.style.margin = "0";
|
||||
|
||||
|
||||
/* Insert the newly cloned table into the DOM, on top of the "real" header */
|
||||
nDiv.appendChild( nCTable );
|
||||
document.body.appendChild( nDiv );
|
||||
|
||||
|
||||
return {
|
||||
"nNode": nCTable,
|
||||
"nWrapper": nDiv,
|
||||
|
@ -326,7 +326,7 @@ FixedHeader.prototype = {
|
|||
"fnClone": fnClone
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
/*
|
||||
* Function: _fnUpdatePositions
|
||||
* Purpose: Get the current positioning of the table in the DOM
|
||||
|
@ -342,7 +342,7 @@ FixedHeader.prototype = {
|
|||
oOffset = jqTable.offset(),
|
||||
iParentScrollTop = this._fnSumScroll( s.nTable.parentNode, 'scrollTop' ),
|
||||
iParentScrollLeft = this._fnSumScroll( s.nTable.parentNode, 'scrollLeft' );
|
||||
|
||||
|
||||
m.iTableWidth = jqTable.outerWidth();
|
||||
m.iTableHeight = jqTable.outerHeight();
|
||||
m.iTableLeft = oOffset.left + s.nTable.parentNode.scrollLeft;
|
||||
|
@ -351,7 +351,7 @@ FixedHeader.prototype = {
|
|||
m.iTableRight = FixedHeader.oDoc.iWidth - m.iTableLeft - m.iTableWidth;
|
||||
m.iTableBottom = FixedHeader.oDoc.iHeight - m.iTableTop - m.iTableHeight;
|
||||
},
|
||||
|
||||
|
||||
/*
|
||||
* Function: _fnSumScroll
|
||||
* Purpose: Sum node parameters all the way to the top
|
||||
|
@ -372,7 +372,7 @@ FixedHeader.prototype = {
|
|||
}
|
||||
return i;
|
||||
},
|
||||
|
||||
|
||||
/*
|
||||
* Function: _fnUpdatePositions
|
||||
* Purpose: Loop over the fixed elements for this table and update their positions
|
||||
|
@ -383,7 +383,7 @@ FixedHeader.prototype = {
|
|||
{
|
||||
var s = this.fnGetSettings();
|
||||
this._fnMeasure();
|
||||
|
||||
|
||||
for ( var i=0, iLen=s.aoCache.length ; i<iLen ; i++ )
|
||||
{
|
||||
if ( s.aoCache[i].sType == "fixedHeader" )
|
||||
|
@ -404,7 +404,7 @@ FixedHeader.prototype = {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/*
|
||||
* Function: _fnUpdateClones
|
||||
* Purpose: Loop over the fixed elements for this table and call their cloning functions
|
||||
|
@ -419,12 +419,12 @@ FixedHeader.prototype = {
|
|||
s.aoCache[i].fnClone.call( this, s.aoCache[i] );
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Scrolling functions
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Function: _fnScrollHorizontalLeft
|
||||
* Purpose: Update the positioning of the scrolling elements
|
||||
|
@ -440,13 +440,13 @@ FixedHeader.prototype = {
|
|||
oDoc = FixedHeader.oDoc,
|
||||
nTable = oCache.nWrapper,
|
||||
iFixedWidth = jQuery(nTable).outerWidth();
|
||||
|
||||
|
||||
if ( oWin.iScrollRight < oMes.iTableRight )
|
||||
{
|
||||
/* Fully right aligned */
|
||||
this._fnUpdateCache( oCache, 'sPosition', 'absolute', 'position', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sTop', oMes.iTableTop+"px", 'top', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sLeft', (oMes.iTableLeft+oMes.iTableWidth-iFixedWidth)+"px", 'left', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sLeft', (oMes.iTableLeft+oMes.iTableWidth-iFixedWidth)+"px", 'left', nTable.style );
|
||||
}
|
||||
else if ( oMes.iTableLeft < oDoc.iWidth-oWin.iScrollRight-iFixedWidth )
|
||||
{
|
||||
|
@ -462,17 +462,17 @@ FixedHeader.prototype = {
|
|||
this._fnUpdateCache( oCache, 'sPosition', 'fixed', 'position', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sTop', (oMes.iTableTop-oWin.iScrollTop)+"px", 'top', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sLeft', (oWin.iWidth-iFixedWidth)+"px", 'left', nTable.style );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Fully left aligned */
|
||||
this._fnUpdateCache( oCache, 'sPosition', 'absolute', 'position', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sTop', oMes.iTableTop+"px", 'top', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sLeft', oMes.iTableLeft+"px", 'left', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sLeft', oMes.iTableLeft+"px", 'left', nTable.style );
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/*
|
||||
* Function: _fnScrollHorizontalLeft
|
||||
* Purpose: Update the positioning of the scrolling elements
|
||||
|
@ -488,13 +488,13 @@ FixedHeader.prototype = {
|
|||
oDoc = FixedHeader.oDoc,
|
||||
nTable = oCache.nWrapper,
|
||||
iCellWidth = jQuery(nTable).outerWidth();
|
||||
|
||||
|
||||
if ( oWin.iScrollLeft < oMes.iTableLeft )
|
||||
{
|
||||
/* Fully left align */
|
||||
this._fnUpdateCache( oCache, 'sPosition', 'absolute', 'position', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sTop', oMes.iTableTop+"px", 'top', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sLeft', oMes.iTableLeft+"px", 'left', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sLeft', oMes.iTableLeft+"px", 'left', nTable.style );
|
||||
}
|
||||
else if ( oWin.iScrollLeft < oMes.iTableLeft+oMes.iTableWidth-iCellWidth )
|
||||
{
|
||||
|
@ -510,17 +510,17 @@ FixedHeader.prototype = {
|
|||
this._fnUpdateCache( oCache, 'sPosition', 'fixed', 'position', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sTop', (oMes.iTableTop-oWin.iScrollTop)+"px", 'top', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sLeft', "0px", 'left', nTable.style );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Fully right align */
|
||||
this._fnUpdateCache( oCache, 'sPosition', 'absolute', 'position', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sTop', oMes.iTableTop+"px", 'top', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sLeft', (oMes.iTableLeft+oMes.iTableWidth-iCellWidth)+"px", 'left', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sLeft', (oMes.iTableLeft+oMes.iTableWidth-iCellWidth)+"px", 'left', nTable.style );
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/*
|
||||
* Function: _fnScrollFixedFooter
|
||||
* Purpose: Update the positioning of the scrolling elements
|
||||
|
@ -537,13 +537,13 @@ FixedHeader.prototype = {
|
|||
nTable = oCache.nWrapper,
|
||||
iTheadHeight = jQuery("thead", s.nTable).outerHeight(),
|
||||
iCellHeight = jQuery(nTable).outerHeight();
|
||||
|
||||
|
||||
if ( oWin.iScrollBottom < oMes.iTableBottom )
|
||||
{
|
||||
/* Below */
|
||||
this._fnUpdateCache( oCache, 'sPosition', 'absolute', 'position', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sTop', (oMes.iTableTop+oMes.iTableHeight-iCellHeight)+"px", 'top', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sLeft', oMes.iTableLeft+"px", 'left', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sLeft', oMes.iTableLeft+"px", 'left', nTable.style );
|
||||
}
|
||||
else if ( oWin.iScrollBottom < oMes.iTableBottom+oMes.iTableHeight-iCellHeight-iTheadHeight )
|
||||
{
|
||||
|
@ -558,7 +558,7 @@ FixedHeader.prototype = {
|
|||
{
|
||||
this._fnUpdateCache( oCache, 'sPosition', 'fixed', 'position', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sTop', (oWin.iHeight-iCellHeight)+"px", 'top', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sLeft', (oMes.iTableLeft-oWin.iScrollLeft)+"px", 'left', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sLeft', (oMes.iTableLeft-oWin.iScrollLeft)+"px", 'left', nTable.style );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -566,10 +566,10 @@ FixedHeader.prototype = {
|
|||
/* Above */
|
||||
this._fnUpdateCache( oCache, 'sPosition', 'absolute', 'position', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sTop', (oMes.iTableTop+iCellHeight)+"px", 'top', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sLeft', oMes.iTableLeft+"px", 'left', nTable.style );
|
||||
this._fnUpdateCache( oCache, 'sLeft', oMes.iTableLeft+"px", 'left', nTable.style );
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/*
|
||||
* Function: _fnScrollFixedHeader
|
||||
* Purpose: Update the positioning of the scrolling elements
|
||||
|
@ -585,7 +585,7 @@ FixedHeader.prototype = {
|
|||
oDoc = FixedHeader.oDoc,
|
||||
nTable = oCache.nWrapper,
|
||||
iTbodyHeight = s.nTable.getElementsByTagName('tbody')[0].offsetHeight;
|
||||
|
||||
|
||||
if ( oMes.iTableTop > oWin.iScrollTop )
|
||||
{
|
||||
/* Above the table */
|
||||
|
@ -617,7 +617,7 @@ FixedHeader.prototype = {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/*
|
||||
* Function: _fnUpdateCache
|
||||
* Purpose: Check the cache and update cache and value if needed
|
||||
|
@ -636,13 +636,13 @@ FixedHeader.prototype = {
|
|||
oCache[sCache] = sSet;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Cloning functions
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Function: _fnCloneThead
|
||||
* Purpose: Clone the thead element
|
||||
|
@ -653,31 +653,31 @@ FixedHeader.prototype = {
|
|||
{
|
||||
var s = this.fnGetSettings();
|
||||
var nTable = oCache.nNode;
|
||||
|
||||
|
||||
/* Set the wrapper width to match that of the cloned table */
|
||||
oCache.nWrapper.style.width = jQuery(s.nTable).outerWidth()+"px";
|
||||
|
||||
|
||||
/* Remove any children the cloned table has */
|
||||
while ( nTable.childNodes.length > 0 )
|
||||
{
|
||||
jQuery('thead th', nTable).unbind( 'click' );
|
||||
nTable.removeChild( nTable.childNodes[0] );
|
||||
}
|
||||
|
||||
|
||||
/* Clone the DataTables header */
|
||||
var nThead = jQuery('thead', s.nTable).clone(true)[0];
|
||||
nTable.appendChild( nThead );
|
||||
|
||||
|
||||
/* Copy the widths across - apparently a clone isn't good enough for this */
|
||||
jQuery("thead>tr th", s.nTable).each( function (i) {
|
||||
jQuery("thead>tr th:eq("+i+")", nTable).width( jQuery(this).width() );
|
||||
} );
|
||||
|
||||
|
||||
jQuery("thead>tr td", s.nTable).each( function (i) {
|
||||
jQuery("thead>tr td:eq("+i+")", nTable).width( jQuery(this).width() );
|
||||
} );
|
||||
},
|
||||
|
||||
|
||||
/*
|
||||
* Function: _fnCloneTfoot
|
||||
* Purpose: Clone the tfoot element
|
||||
|
@ -688,30 +688,30 @@ FixedHeader.prototype = {
|
|||
{
|
||||
var s = this.fnGetSettings();
|
||||
var nTable = oCache.nNode;
|
||||
|
||||
|
||||
/* Set the wrapper width to match that of the cloned table */
|
||||
oCache.nWrapper.style.width = jQuery(s.nTable).outerWidth()+"px";
|
||||
|
||||
|
||||
/* Remove any children the cloned table has */
|
||||
while ( nTable.childNodes.length > 0 )
|
||||
{
|
||||
nTable.removeChild( nTable.childNodes[0] );
|
||||
}
|
||||
|
||||
|
||||
/* Clone the DataTables footer */
|
||||
var nTfoot = jQuery('tfoot', s.nTable).clone(true)[0];
|
||||
nTable.appendChild( nTfoot );
|
||||
|
||||
|
||||
/* Copy the widths across - apparently a clone isn't good enough for this */
|
||||
jQuery("tfoot:eq(0)>tr th", s.nTable).each( function (i) {
|
||||
jQuery("tfoot:eq(0)>tr th:eq("+i+")", nTable).width( jQuery(this).width() );
|
||||
} );
|
||||
|
||||
|
||||
jQuery("tfoot:eq(0)>tr td", s.nTable).each( function (i) {
|
||||
jQuery("tfoot:eq(0)>tr th:eq("+i+")", nTable)[0].style.width( jQuery(this).width() );
|
||||
} );
|
||||
},
|
||||
|
||||
|
||||
/*
|
||||
* Function: _fnCloneTLeft
|
||||
* Purpose: Clone the left column
|
||||
|
@ -725,13 +725,13 @@ FixedHeader.prototype = {
|
|||
var nBody = $('tbody', s.nTable)[0];
|
||||
var iCols = $('tbody tr:eq(0) td', s.nTable).length;
|
||||
var bRubbishOldIE = ($.browser.msie && ($.browser.version == "6.0" || $.browser.version == "7.0"));
|
||||
|
||||
|
||||
/* Remove any children the cloned table has */
|
||||
while ( nTable.childNodes.length > 0 )
|
||||
{
|
||||
nTable.removeChild( nTable.childNodes[0] );
|
||||
}
|
||||
|
||||
|
||||
/* Is this the most efficient way to do this - it looks horrible... */
|
||||
nTable.appendChild( jQuery("thead", s.nTable).clone(true)[0] );
|
||||
nTable.appendChild( jQuery("tbody", s.nTable).clone(true)[0] );
|
||||
|
@ -739,22 +739,22 @@ FixedHeader.prototype = {
|
|||
{
|
||||
nTable.appendChild( jQuery("tfoot", s.nTable).clone(true)[0] );
|
||||
}
|
||||
|
||||
|
||||
jQuery('thead tr th:gt(0)', nTable).remove();
|
||||
jQuery('tfoot tr th:gt(0)', nTable).remove();
|
||||
|
||||
|
||||
/* Remove unneeded cells */
|
||||
$('tbody tr', nTable).each( function (k) {
|
||||
$('td:gt(0)', this).remove();
|
||||
} );
|
||||
|
||||
|
||||
this.fnEqualiseHeights( 'tbody', nBody.parentNode, nTable );
|
||||
|
||||
|
||||
var iWidth = jQuery('thead tr th:eq(0)', s.nTable).outerWidth();
|
||||
nTable.style.width = iWidth+"px";
|
||||
oCache.nWrapper.style.width = iWidth+"px";
|
||||
},
|
||||
|
||||
|
||||
/*
|
||||
* Function: _fnCloneTRight
|
||||
* Purpose: Clone the right most colun
|
||||
|
@ -768,13 +768,13 @@ FixedHeader.prototype = {
|
|||
var nTable = oCache.nNode;
|
||||
var iCols = jQuery('tbody tr:eq(0) td', s.nTable).length;
|
||||
var bRubbishOldIE = ($.browser.msie && ($.browser.version == "6.0" || $.browser.version == "7.0"));
|
||||
|
||||
|
||||
/* Remove any children the cloned table has */
|
||||
while ( nTable.childNodes.length > 0 )
|
||||
{
|
||||
nTable.removeChild( nTable.childNodes[0] );
|
||||
}
|
||||
|
||||
|
||||
/* Is this the most efficient way to do this - it looks horrible... */
|
||||
nTable.appendChild( jQuery("thead", s.nTable).clone(true)[0] );
|
||||
nTable.appendChild( jQuery("tbody", s.nTable).clone(true)[0] );
|
||||
|
@ -784,20 +784,20 @@ FixedHeader.prototype = {
|
|||
}
|
||||
jQuery('thead tr th:not(:nth-child('+iCols+'n))', nTable).remove();
|
||||
jQuery('tfoot tr th:not(:nth-child('+iCols+'n))', nTable).remove();
|
||||
|
||||
|
||||
/* Remove unneeded cells */
|
||||
$('tbody tr', nTable).each( function (k) {
|
||||
$('td:lt('+(iCols-1)+')', this).remove();
|
||||
} );
|
||||
|
||||
|
||||
this.fnEqualiseHeights( 'tbody', nBody.parentNode, nTable );
|
||||
|
||||
|
||||
var iWidth = jQuery('thead tr th:eq('+(iCols-1)+')', s.nTable).outerWidth();
|
||||
nTable.style.width = iWidth+"px";
|
||||
oCache.nWrapper.style.width = iWidth+"px";
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Equalise the heights of the rows in a given table node in a cross browser way. Note that this
|
||||
* is more or less lifted as is from FixedColumns
|
||||
|
@ -814,7 +814,7 @@ FixedHeader.prototype = {
|
|||
jqBoxHack = $(parent+' tr:eq(0)', original).children(':eq(0)'),
|
||||
iBoxHack = jqBoxHack.outerHeight() - jqBoxHack.height(),
|
||||
bRubbishOldIE = ($.browser.msie && ($.browser.version == "6.0" || $.browser.version == "7.0"));
|
||||
|
||||
|
||||
/* Remove cells which are not needed and copy the height from the original table */
|
||||
$(parent+' tr', clone).each( function (k) {
|
||||
/* Can we use some kind of object detection here?! This is very nasty - damn browsers */
|
||||
|
@ -826,16 +826,16 @@ FixedHeader.prototype = {
|
|||
{
|
||||
$(this).children().height( $(parent+' tr:eq('+k+')', original).outerHeight() - iBoxHack );
|
||||
}
|
||||
|
||||
|
||||
if ( !bRubbishOldIE )
|
||||
{
|
||||
$(parent+' tr:eq('+k+')', original).height( $(parent+' tr:eq('+k+')', original).outerHeight() );
|
||||
$(parent+' tr:eq('+k+')', original).height( $(parent+' tr:eq('+k+')', original).outerHeight() );
|
||||
}
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Static properties and methods
|
||||
* We use these for speed! This information is common to all instances of FixedHeader, so no
|
||||
|
@ -886,10 +886,10 @@ FixedHeader.fnMeasure = function ()
|
|||
jqDoc = jQuery(document),
|
||||
oWin = FixedHeader.oWin,
|
||||
oDoc = FixedHeader.oDoc;
|
||||
|
||||
|
||||
oDoc.iHeight = jqDoc.height();
|
||||
oDoc.iWidth = jqDoc.width();
|
||||
|
||||
|
||||
oWin.iHeight = jqWin.height();
|
||||
oWin.iWidth = jqWin.width();
|
||||
oWin.iScrollTop = jqWin.scrollTop();
|
||||
|
@ -898,7 +898,7 @@ FixedHeader.fnMeasure = function ()
|
|||
oWin.iScrollBottom = oDoc.iHeight - oWin.iScrollTop - oWin.iHeight;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Global processing
|
||||
*/
|
||||
|
|
|
@ -739,7 +739,7 @@ ColReorder.prototype = {
|
|||
this.s.dt.oInstance.oApi._fnSaveState( this.s.dt );
|
||||
|
||||
this._fnSetColumnIndexes();
|
||||
|
||||
|
||||
if ( this.s.reorderCallback !== null )
|
||||
{
|
||||
this.s.reorderCallback.call( this );
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
/*
|
||||
* File: jquery.dataTables.columnFilter.js
|
||||
* Version: 1.4.8.
|
||||
* Author: Jovan Popovic
|
||||
*
|
||||
* Author: Jovan Popovic
|
||||
*
|
||||
* Copyright 2011-2012 Jovan Popovic, all rights reserved.
|
||||
*
|
||||
* This source file is free software, under either the GPL v2 license or a
|
||||
* BSD style license, as supplied with this software.
|
||||
*
|
||||
* This source file is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*
|
||||
* This source file is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* Parameters:"
|
||||
* @sPlaceHolder String Place where inline filtering function should be placed ("tfoot", "thead:before", "thead:after"). Default is "tfoot"
|
||||
* @sRangeSeparator String Separator that will be used when range values are sent to the server-side. Default value is "~".
|
||||
|
@ -65,7 +65,7 @@
|
|||
// use all rows
|
||||
else aiRows = oSettings.aiDisplayMaster; // all row numbers
|
||||
|
||||
// set up data array
|
||||
// set up data array
|
||||
var asResultData = new Array();
|
||||
|
||||
for (var i = 0, c = aiRows.length; i < c; i++) {
|
||||
|
@ -139,7 +139,7 @@
|
|||
if (oTable.fnSettings().oFeatures.bServerSide && iFilterLength != 0) {
|
||||
//If filter length is set in the server-side processing mode
|
||||
//Check has the user entered at least iFilterLength new characters
|
||||
|
||||
|
||||
var currentFilter = oTable.fnSettings().aoPreSearchCols[index].sSearch;
|
||||
var iLastFilterLength = $(this).data("dt-iLastFilterLength");
|
||||
if (typeof iLastFilterLength == "undefined")
|
||||
|
@ -181,7 +181,7 @@
|
|||
function fnCreateRangeInput(oTable) {
|
||||
|
||||
//var currentFilter = oTable.fnSettings().aoPreSearchCols[i].sSearch;
|
||||
|
||||
|
||||
var label = "";
|
||||
if (th.attr('id') == "bit_rate") {
|
||||
label = $.i18n._("kbps");
|
||||
|
@ -192,7 +192,7 @@
|
|||
} else if (th.attr('id') == "sample_rate") {
|
||||
label = $.i18n._("kHz");
|
||||
}
|
||||
|
||||
|
||||
th.html(_fnRangeLabelPart(0));
|
||||
var sFromId = oTable.attr("id") + '_range_from_' + i;
|
||||
var from = $('<input type="text" class="number_range_filter" id="' + sFromId + '" rel="' + i + '" placeholder="' + label + '"/>');
|
||||
|
@ -251,7 +251,7 @@
|
|||
var iMax = document.getElementById(sToId).value * 1;
|
||||
if (iMin != 0 && iMax != 0 && iMin > iMax)
|
||||
return;
|
||||
|
||||
|
||||
oTable.fnDraw();
|
||||
fnOnFiltered();
|
||||
}
|
||||
|
@ -377,8 +377,8 @@
|
|||
function fnCreateSelect(oTable, aData, bRegex) {
|
||||
var oSettings = oTable.fnSettings();
|
||||
if (aData == null && oSettings.sAjaxSource != "" && !oSettings.oFeatures.bServerSide) {
|
||||
// Add a function to the draw callback, which will check for the Ajax data having
|
||||
// been loaded. Use a closure for the individual column elements that are used to
|
||||
// Add a function to the draw callback, which will check for the Ajax data having
|
||||
// been loaded. Use a closure for the individual column elements that are used to
|
||||
// built the column filter, since 'i' and 'th' (etc) are locally "global".
|
||||
oSettings.aoDrawCallback.push({
|
||||
"fn": (function (iColumn, nTh, sLabel) {
|
||||
|
@ -557,7 +557,7 @@
|
|||
});
|
||||
oTable.fnFilter('', index, true, false);
|
||||
return false;
|
||||
});
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
|
@ -589,7 +589,7 @@
|
|||
};
|
||||
|
||||
properties = $.extend(defaults, options);
|
||||
|
||||
|
||||
return this.each(function () {
|
||||
|
||||
if (!oTable.fnSettings().oFeatures.bFilter)
|
||||
|
@ -636,7 +636,7 @@
|
|||
|
||||
oHost = oTable.fnSettings().nTHead;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//$(sFilterRow + " th", oHost).each(function (index) {//bug with ColVis
|
||||
|
@ -700,7 +700,7 @@
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
for (j = 0; j < aiCustomSearch_Indexes.length; j++) {
|
||||
//var index = aiCustomSearch_Indexes[j];
|
||||
var fnSearch_ = function () {
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
/*
|
||||
* File: jquery.dataTables.columnFilter.js
|
||||
* Version: 1.4.8.
|
||||
* Author: Jovan Popovic
|
||||
*
|
||||
* Author: Jovan Popovic
|
||||
*
|
||||
* Copyright 2011-2012 Jovan Popovic, all rights reserved.
|
||||
*
|
||||
* This source file is free software, under either the GPL v2 license or a
|
||||
* BSD style license, as supplied with this software.
|
||||
*
|
||||
* This source file is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*
|
||||
* This source file is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* Parameters:"
|
||||
* @sPlaceHolder String Place where inline filtering function should be placed ("tfoot", "thead:before", "thead:after"). Default is "tfoot"
|
||||
* @sRangeSeparator String Separator that will be used when range values are sent to the server-side. Default value is "~".
|
||||
|
@ -65,7 +65,7 @@
|
|||
// use all rows
|
||||
else aiRows = oSettings.aiDisplayMaster; // all row numbers
|
||||
|
||||
// set up data array
|
||||
// set up data array
|
||||
var asResultData = new Array();
|
||||
|
||||
for (var i = 0, c = aiRows.length; i < c; i++) {
|
||||
|
@ -358,8 +358,8 @@
|
|||
function fnCreateSelect(oTable, aData, bRegex) {
|
||||
var oSettings = oTable.fnSettings();
|
||||
if (aData == null && oSettings.sAjaxSource != "" && !oSettings.oFeatures.bServerSide) {
|
||||
// Add a function to the draw callback, which will check for the Ajax data having
|
||||
// been loaded. Use a closure for the individual column elements that are used to
|
||||
// Add a function to the draw callback, which will check for the Ajax data having
|
||||
// been loaded. Use a closure for the individual column elements that are used to
|
||||
// built the column filter, since 'i' and 'th' (etc) are locally "global".
|
||||
oSettings.aoDrawCallback.push({
|
||||
"fn": (function (iColumn, nTh, sLabel) {
|
||||
|
@ -538,7 +538,7 @@
|
|||
});
|
||||
oTable.fnFilter('', index, true, false);
|
||||
return false;
|
||||
});
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
|
@ -570,7 +570,7 @@
|
|||
};
|
||||
|
||||
properties = $.extend(defaults, options);
|
||||
|
||||
|
||||
return this.each(function () {
|
||||
|
||||
if (!oTable.fnSettings().oFeatures.bFilter)
|
||||
|
@ -617,7 +617,7 @@
|
|||
|
||||
oHost = oTable.fnSettings().nTHead;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//$(sFilterRow + " th", oHost).each(function (index) {//bug with ColVis
|
||||
|
@ -681,7 +681,7 @@
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
for (j = 0; j < aiCustomSearch_Indexes.length; j++) {
|
||||
//var index = aiCustomSearch_Indexes[j];
|
||||
var fnSearch_ = function () {
|
||||
|
@ -730,4 +730,4 @@
|
|||
|
||||
|
||||
|
||||
})(jQuery);
|
||||
})(jQuery);
|
||||
|
|
|
@ -14,24 +14,24 @@ jQuery.fn.dataTableExt.oApi.fnSetFilteringDelay = function ( oSettings, iDelay )
|
|||
this.each( function ( i ) {
|
||||
$.fn.dataTableExt.iApiIndex = i;
|
||||
var
|
||||
$this = this,
|
||||
oTimerId = null,
|
||||
$this = this,
|
||||
oTimerId = null,
|
||||
sPreviousSearch = null,
|
||||
anControl = $( 'input', _that.fnSettings().aanFeatures.f );
|
||||
|
||||
|
||||
anControl.unbind( 'keyup' ).bind( 'keyup', function() {
|
||||
var $$this = $this;
|
||||
|
||||
if (sPreviousSearch === null || sPreviousSearch != anControl.val()) {
|
||||
window.clearTimeout(oTimerId);
|
||||
sPreviousSearch = anControl.val();
|
||||
sPreviousSearch = anControl.val();
|
||||
oTimerId = window.setTimeout(function() {
|
||||
$.fn.dataTableExt.iApiIndex = i;
|
||||
_that.fnFilter( anControl.val() );
|
||||
}, iDelay);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return this;
|
||||
} );
|
||||
return this;
|
||||
|
|
|
@ -12,7 +12,7 @@ $.fn.dataTableExt.oApi.fnStandingRedraw = function(oSettings) {
|
|||
oSettings._iDisplayStart = before;
|
||||
oSettings.oApi._fnCalculateEnd(oSettings);
|
||||
}
|
||||
|
||||
|
||||
//draw the 'current' page
|
||||
oSettings.oApi._fnDraw(oSettings);
|
||||
};
|
||||
|
@ -22,13 +22,13 @@ $.fn.dataTableExt.oApi.fnAddDataAndDisplay = function ( oSettings, aData )
|
|||
/* Add the data */
|
||||
var iAdded = this.oApi._fnAddData( oSettings, aData );
|
||||
var nAdded = oSettings.aoData[ iAdded ].nTr;
|
||||
|
||||
|
||||
/* Need to re-filter and re-sort the table to get positioning correct, not perfect
|
||||
* as this will actually redraw the table on screen, but the update should be so fast (and
|
||||
* possibly not alter what is already on display) that the user will not notice
|
||||
*/
|
||||
this.oApi._fnReDraw( oSettings );
|
||||
|
||||
|
||||
/* Find it's position in the table */
|
||||
var iPos = -1;
|
||||
for( var i=0, iLen=oSettings.aiDisplay.length ; i<iLen ; i++ )
|
||||
|
@ -39,17 +39,17 @@ $.fn.dataTableExt.oApi.fnAddDataAndDisplay = function ( oSettings, aData )
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Get starting point, taking account of paging */
|
||||
if( iPos >= 0 )
|
||||
{
|
||||
oSettings._iDisplayStart = ( Math.floor(i / oSettings._iDisplayLength) ) * oSettings._iDisplayLength;
|
||||
this.oApi._fnCalculateEnd( oSettings );
|
||||
}
|
||||
|
||||
|
||||
this.oApi._fnDraw( oSettings );
|
||||
return {
|
||||
"nTr": nAdded,
|
||||
"iPos": iAdded
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ website:
|
|||
Take a look at the examples linked from above, they should give a good
|
||||
impression of what Flot can do and the source code of the examples is
|
||||
probably the fastest way to learn how to use Flot.
|
||||
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
|
|
@ -61,7 +61,7 @@ The plugin also adds four public methods:
|
|||
lineWidth: 1
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function init(plot) {
|
||||
// position of crosshair in pixels
|
||||
var crosshair = { x: -1, y: -1, locked: false };
|
||||
|
@ -74,12 +74,12 @@ The plugin also adds four public methods:
|
|||
crosshair.x = Math.max(0, Math.min(o.left, plot.width()));
|
||||
crosshair.y = Math.max(0, Math.min(o.top, plot.height()));
|
||||
}
|
||||
|
||||
|
||||
plot.triggerRedrawOverlay();
|
||||
};
|
||||
|
||||
|
||||
plot.clearCrosshair = plot.setCrosshair; // passes null for pos
|
||||
|
||||
|
||||
plot.lockCrosshair = function lockCrosshair(pos) {
|
||||
if (pos)
|
||||
plot.setCrosshair(pos);
|
||||
|
@ -103,18 +103,18 @@ The plugin also adds four public methods:
|
|||
function onMouseMove(e) {
|
||||
if (crosshair.locked)
|
||||
return;
|
||||
|
||||
|
||||
if (plot.getSelection && plot.getSelection()) {
|
||||
crosshair.x = -1; // hide the crosshair while selecting
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var offset = plot.offset();
|
||||
crosshair.x = Math.max(0, Math.min(e.pageX - offset.left, plot.width()));
|
||||
crosshair.y = Math.max(0, Math.min(e.pageY - offset.top, plot.height()));
|
||||
plot.triggerRedrawOverlay();
|
||||
}
|
||||
|
||||
|
||||
plot.hooks.bindEvents.push(function (plot, eventHolder) {
|
||||
if (!plot.getOptions().crosshair.mode)
|
||||
return;
|
||||
|
@ -129,7 +129,7 @@ The plugin also adds four public methods:
|
|||
return;
|
||||
|
||||
var plotOffset = plot.getPlotOffset();
|
||||
|
||||
|
||||
ctx.save();
|
||||
ctx.translate(plotOffset.left, plotOffset.top);
|
||||
|
||||
|
@ -157,7 +157,7 @@ The plugin also adds four public methods:
|
|||
eventHolder.unbind("mousemove", onMouseMove);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -11,10 +11,10 @@ plots, you can just fix the size of their placeholders.
|
|||
*/
|
||||
|
||||
|
||||
/* Inline dependency:
|
||||
/* Inline dependency:
|
||||
* jQuery resize event - v1.1 - 3/14/2010
|
||||
* http://benalman.com/projects/jquery-resize-plugin/
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2010 "Cowboy" Ben Alman
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* http://benalman.com/about/license/
|
||||
|
@ -38,7 +38,7 @@ plots, you can just fix the size of their placeholders.
|
|||
plot.setupGrid();
|
||||
plot.draw();
|
||||
}
|
||||
|
||||
|
||||
function bindEvents(plot, eventHolder) {
|
||||
plot.getPlaceholder().resize(onResize);
|
||||
}
|
||||
|
@ -46,11 +46,11 @@ plots, you can just fix the size of their placeholders.
|
|||
function shutdown(plot, eventHolder) {
|
||||
plot.getPlaceholder().unbind("resize", onResize);
|
||||
}
|
||||
|
||||
|
||||
plot.hooks.bindEvents.push(bindEvents);
|
||||
plot.hooks.shutdown.push(shutdown);
|
||||
}
|
||||
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
|
|
|
@ -14,7 +14,7 @@ denise@denise-DX4860:~/airtime/legacy/public/js/fullcalendar$ diff -u fullcalend
|
|||
+ var date = adjustDateToServerDate(new Date(), options["serverTimezoneOffset"]);
|
||||
var events = [];
|
||||
var _dragElement;
|
||||
|
||||
|
||||
@@ -2273,7 +2273,7 @@
|
||||
function updateCells(firstTime) {
|
||||
var dowDirty = firstTime || rowCnt == 1; // could the cells' day-of-weeks need updating?
|
||||
|
@ -48,4 +48,3 @@ denise@denise-DX4860:~/airtime/legacy/public/js/fullcalendar$ diff -u fullcalend
|
|||
adjustDateToServerDate() function is defined in "js/airtime/common/common.js"
|
||||
|
||||
Please make this change before updating!!!
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -19,9 +19,9 @@
|
|||
* i18n property list
|
||||
*/
|
||||
$.i18n = {
|
||||
|
||||
|
||||
dict: null,
|
||||
|
||||
|
||||
/**
|
||||
* setDictionary()
|
||||
*
|
||||
|
@ -32,11 +32,11 @@
|
|||
setDictionary: function(i18n_dict) {
|
||||
this.dict = i18n_dict;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* _()
|
||||
*
|
||||
* Looks the given string up in the dictionary and returns the translation if
|
||||
* Looks the given string up in the dictionary and returns the translation if
|
||||
* one exists. If a translation is not found, returns the original word.
|
||||
*
|
||||
* @param string str : The string to translate.
|
||||
|
@ -49,7 +49,7 @@
|
|||
if (this.dict && this.dict[str]) {
|
||||
result = this.dict[str];
|
||||
}
|
||||
|
||||
|
||||
// Substitute any params.
|
||||
return this.printf(result, params);
|
||||
},
|
||||
|
@ -69,7 +69,7 @@
|
|||
|
||||
var result = '';
|
||||
var search = /%(\d+)\$s/g;
|
||||
|
||||
|
||||
// Replace %n1$ where n is a number.
|
||||
var matches = search.exec(str);
|
||||
while (matches) {
|
||||
|
@ -87,12 +87,12 @@
|
|||
if (parts[i].length > 0 && parts[i].lastIndexOf('%') == (parts[i].length - 1)) {
|
||||
parts[i] += 's' + parts.splice(i + 1, 1)[0];
|
||||
}
|
||||
|
||||
|
||||
// Append the part and the substitution to the result.
|
||||
result += parts[i] + args[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return result + parts[parts.length - 1];
|
||||
}
|
||||
|
||||
|
@ -104,14 +104,14 @@
|
|||
* Allows you to translate a jQuery selector.
|
||||
*
|
||||
* eg $('h1')._t('some text')
|
||||
*
|
||||
*
|
||||
* @param string str : The string to translate .
|
||||
* @param property_list params : Params for using printf() on the string.
|
||||
*
|
||||
*
|
||||
* @return element : Chained and translated element(s).
|
||||
*/
|
||||
$.fn._t = function(str, params) {
|
||||
return $(this).text($.i18n._(str, params));
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
})(jQuery);
|
||||
|
|
|
@ -31,4 +31,4 @@ this._init()},add:function(a,c){b(this.cssSelector.playlist+" ul").append(this._
|
|||
a:a;0<=a&&a<this.playlist.length&&(this.removing=!0,b(this.cssSelector.playlist+" li:nth-child("+(a+1)+")").slideUp(this.options.playlistOptions.removeTime,function(){b(this).remove();if(c.shuffled){var d=c.playlist[a];b.each(c.original,function(a){if(c.original[a]===d)return c.original.splice(a,1),!1})}else c.original.splice(a,1);c.playlist.splice(a,1);c.original.length?a===c.current?(c.current=a<c.original.length?c.current:c.original.length-1,c.select(c.current)):a<c.current&&c.current--:(b(c.cssSelector.jPlayer).jPlayer("clearMedia"),
|
||||
c.current=0,c.shuffled=!1,c._updateControls());c.removing=!1}));return!0},select:function(a){a=0>a?this.original.length+a:a;0<=a&&a<this.playlist.length?(this.current=a,this._highlight(a),b(this.cssSelector.jPlayer).jPlayer("setMedia",this.playlist[this.current])):this.current=0},play:function(a){a=0>a?this.original.length+a:a;0<=a&&a<this.playlist.length?this.playlist.length&&(this.select(a),b(this.cssSelector.jPlayer).jPlayer("play")):a===f&&b(this.cssSelector.jPlayer).jPlayer("play")},pause:function(){b(this.cssSelector.jPlayer).jPlayer("pause")},
|
||||
next:function(){var a=this.current+1<this.playlist.length?this.current+1:0;this.loop?0===a&&this.shuffled&&this.options.playlistOptions.shuffleOnLoop&&1<this.playlist.length?this.shuffle(!0,!0):this.play(a):0<a&&this.play(a)},previous:function(){var a=0<=this.current-1?this.current-1:this.playlist.length-1;(this.loop&&this.options.playlistOptions.loopOnPrevious||a<this.playlist.length-1)&&this.play(a)},shuffle:function(a,c){var d=this;a===f&&(a=!this.shuffled);(a||a!==this.shuffled)&&b(this.cssSelector.playlist+
|
||||
" ul").slideUp(this.options.playlistOptions.shuffleTime,function(){(d.shuffled=a)?d.playlist.sort(function(){return.5-Math.random()}):d._originalPlaylist();d._refresh(!0);c||!b(d.cssSelector.jPlayer).data("jPlayer").status.paused?d.play(0):d.select(0);b(this).slideDown(d.options.playlistOptions.shuffleTime)})},blur:function(a){b(this.cssSelector.jPlayer).jPlayer("option","autoBlur")&&b(a).blur()}}})(jQuery);
|
||||
" ul").slideUp(this.options.playlistOptions.shuffleTime,function(){(d.shuffled=a)?d.playlist.sort(function(){return.5-Math.random()}):d._originalPlaylist();d._refresh(!0);c||!b(d.cssSelector.jPlayer).data("jPlayer").status.paused?d.play(0):d.select(0);b(this).slideDown(d.options.playlistOptions.shuffleTime)})},blur:function(a){b(this.cssSelector.jPlayer).jPlayer("option","autoBlur")&&b(a).blur()}}})(jQuery);
|
||||
|
|
|
@ -23,12 +23,12 @@
|
|||
idPrefix: "jplayer_inspector_",
|
||||
visible: false
|
||||
};
|
||||
|
||||
|
||||
var methods = {
|
||||
init: function(options) {
|
||||
var self = this;
|
||||
var $this = $(this);
|
||||
|
||||
|
||||
var config = $.extend({}, $.jPlayerInspector.defaults, options);
|
||||
$(this).data("jPlayerInspector", config);
|
||||
|
||||
|
@ -42,30 +42,30 @@
|
|||
config.eventResetId = config.idPrefix + "event_reset_" + $.jPlayerInspector.i;
|
||||
config.updateId = config.idPrefix + "update_" + $.jPlayerInspector.i;
|
||||
config.eventWindowId = config.idPrefix + "event_window_" + $.jPlayerInspector.i;
|
||||
|
||||
|
||||
config.eventId = {};
|
||||
config.eventJq = {};
|
||||
config.eventTimeout = {};
|
||||
config.eventOccurrence = {};
|
||||
|
||||
|
||||
$.each($.jPlayer.event, function(eventName,eventType) {
|
||||
config.eventId[eventType] = config.idPrefix + "event_" + eventName + "_" + $.jPlayerInspector.i;
|
||||
config.eventOccurrence[eventType] = 0;
|
||||
});
|
||||
|
||||
var structure =
|
||||
'<p><a href="#" id="' + config.toggleId + '">' + (config.visible ? "Hide" : "Show") + '</a> jPlayer Inspector</p>'
|
||||
|
||||
var structure =
|
||||
'<p><a href="#" id="' + config.toggleId + '">' + (config.visible ? "Hide" : "Show") + '</a> jPlayer Inspector</p>'
|
||||
+ '<div id="' + config.windowId + '">'
|
||||
+ '<div id="' + config.statusId + '"></div>'
|
||||
+ '<div id="' + config.eventWindowId + '" style="padding:5px 5px 0 5px;background-color:#eee;border:1px dotted #000;">'
|
||||
+ '<p style="margin:0 0 10px 0;"><strong>jPlayer events that have occurred over the past 1 second:</strong>'
|
||||
+ '<br />(Backgrounds: <span style="padding:0 5px;background-color:#eee;border:1px dotted #000;">Never occurred</span> <span style="padding:0 5px;background-color:#fff;border:1px dotted #000;">Occurred before</span> <span style="padding:0 5px;background-color:#9f9;border:1px dotted #000;">Occurred</span> <span style="padding:0 5px;background-color:#ff9;border:1px dotted #000;">Multiple occurrences</span> <a href="#" id="' + config.eventResetId + '">reset</a>)</p>';
|
||||
|
||||
|
||||
// MJP: Would use the next 3 lines for ease, but the events are just slapped on the page.
|
||||
// $.each($.jPlayer.event, function(eventName,eventType) {
|
||||
// structure += '<div id="' + config.eventId[eventType] + '" style="float:left;">' + eventName + '</div>';
|
||||
// });
|
||||
|
||||
|
||||
var eventStyle = "float:left;margin:0 5px 5px 0;padding:0 5px;border:1px dotted #000;";
|
||||
// MJP: Doing it longhand so order and layout easier to control.
|
||||
structure +=
|
||||
|
@ -120,7 +120,7 @@
|
|||
+ '<div id="' + config.configId + '"></div>'
|
||||
+ '</div>';
|
||||
$(this).html(structure);
|
||||
|
||||
|
||||
config.windowJq = $("#" + config.windowId);
|
||||
config.statusJq = $("#" + config.statusId);
|
||||
config.configJq = $("#" + config.configId);
|
||||
|
@ -131,7 +131,7 @@
|
|||
$.each($.jPlayer.event, function(eventName,eventType) {
|
||||
config.eventJq[eventType] = $("#" + config.eventId[eventType]);
|
||||
config.eventJq[eventType].text(eventName + " (" + config.eventOccurrence[eventType] + ")"); // Sets the text to the event name and (0);
|
||||
|
||||
|
||||
config.jPlayer.bind(eventType + ".jPlayerInspector", function(e) {
|
||||
config.eventOccurrence[e.type]++;
|
||||
if(config.eventOccurrence[e.type] > 1) {
|
||||
|
@ -195,7 +195,7 @@
|
|||
} else {
|
||||
// config.updateJq.click();
|
||||
}
|
||||
|
||||
|
||||
$.jPlayerInspector.i++;
|
||||
|
||||
return this;
|
||||
|
@ -205,12 +205,12 @@
|
|||
$(this).empty();
|
||||
},
|
||||
updateConfig: function() { // This displays information about jPlayer's configuration in inspector
|
||||
|
||||
|
||||
var jPlayerInfo = "<p>This jPlayer instance is running in your browser where:<br />"
|
||||
|
||||
for(i = 0; i < $(this).data("jPlayerInspector").jPlayer.data("jPlayer").solutions.length; i++) {
|
||||
var solution = $(this).data("jPlayerInspector").jPlayer.data("jPlayer").solutions[i];
|
||||
jPlayerInfo += " jPlayer's <strong>" + solution + "</strong> solution is";
|
||||
jPlayerInfo += " jPlayer's <strong>" + solution + "</strong> solution is";
|
||||
if($(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].used) {
|
||||
jPlayerInfo += " being <strong>used</strong> and will support:<strong>";
|
||||
for(format in $(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].support) {
|
||||
|
@ -247,7 +247,7 @@
|
|||
} else {
|
||||
jPlayerInfo += "</p>";
|
||||
}
|
||||
|
||||
|
||||
jPlayerInfo += "<p><code>status.src = '" + $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.src + "'</code></p>";
|
||||
|
||||
jPlayerInfo += "<p><code>status.media = {<br />";
|
||||
|
@ -282,9 +282,9 @@
|
|||
+ " supplied: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "supplied") + "',<br />"
|
||||
|
||||
+ " preload: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "preload") + "',<br />"
|
||||
|
||||
|
||||
+ " volume: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "volume") + ",<br />"
|
||||
|
||||
|
||||
+ " muted: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "muted") + ",<br />"
|
||||
|
||||
+ " backgroundColor: '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "backgroundColor") + "',<br />"
|
||||
|
@ -295,7 +295,7 @@
|
|||
|
||||
var cssSelector = $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelector");
|
||||
for(prop in cssSelector) {
|
||||
|
||||
|
||||
// jPlayerInfo += "<br /> " + prop + ": '" + cssSelector[prop] + "'," // This works too of course, but want to use option method for deep keys.
|
||||
jPlayerInfo += "<br /> " + prop + ": '" + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "cssSelector." + prop) + "',"
|
||||
}
|
||||
|
@ -305,7 +305,7 @@
|
|||
jPlayerInfo += "<br /> },<br />"
|
||||
|
||||
+ " errorAlerts: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "errorAlerts") + ",<br />"
|
||||
|
||||
|
||||
+ " warningAlerts: " + $(this).data("jPlayerInspector").jPlayer.jPlayer("option", "warningAlerts") + "<br />"
|
||||
|
||||
+ "});</code></p>";
|
||||
|
@ -333,6 +333,6 @@
|
|||
return methods.init.apply( this, arguments );
|
||||
} else {
|
||||
$.error( 'Method ' + method + ' does not exist on jQuery.jPlayerInspector' );
|
||||
}
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
||||
|
|
|
@ -117,4 +117,4 @@ this.internal.flash.jq.css({width:"1px",height:"1px"})},_error:function(a){this.
|
|||
b.jPlayer.error={FLASH:"e_flash",FLASH_DISABLED:"e_flash_disabled",NO_SOLUTION:"e_no_solution",NO_SUPPORT:"e_no_support",URL:"e_url",URL_NOT_SET:"e_url_not_set",VERSION:"e_version"};b.jPlayer.errorMsg={FLASH:"jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ",FLASH_DISABLED:"jPlayer's Flash fallback has been disabled by the browser due to the CSS rules you have used. Details: ",NO_SOLUTION:"No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.",
|
||||
NO_SUPPORT:"It is not possible to play any media format provided in setMedia() on this browser using your current options.",URL:"Media URL could not be loaded.",URL_NOT_SET:"Attempt to issue media playback commands, while no media url is set.",VERSION:"jPlayer "+b.jPlayer.prototype.version.script+" needs Jplayer.swf version "+b.jPlayer.prototype.version.needFlash+" but found "};b.jPlayer.errorHint={FLASH:"Check your swfPath option and that Jplayer.swf is there.",FLASH_DISABLED:"Check that you have not display:none; the jPlayer entity or any ancestor.",
|
||||
NO_SOLUTION:"Review the jPlayer options: support and supplied.",NO_SUPPORT:"Video or audio formats defined in the supplied option are missing.",URL:"Check media URL is valid.",URL_NOT_SET:"Use setMedia() to set the media URL.",VERSION:"Update jPlayer files."};b.jPlayer.warning={CSS_SELECTOR_COUNT:"e_css_selector_count",CSS_SELECTOR_METHOD:"e_css_selector_method",CSS_SELECTOR_STRING:"e_css_selector_string",OPTION_KEY:"e_option_key"};b.jPlayer.warningMsg={CSS_SELECTOR_COUNT:"The number of css selectors found did not equal one: ",
|
||||
CSS_SELECTOR_METHOD:"The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",CSS_SELECTOR_STRING:"The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",OPTION_KEY:"The option requested in jPlayer('option') is undefined."};b.jPlayer.warningHint={CSS_SELECTOR_COUNT:"Check your css selector and the ancestor.",CSS_SELECTOR_METHOD:"Check your method name.",CSS_SELECTOR_STRING:"Check your css selector is a string.",OPTION_KEY:"Check your option name."}});
|
||||
CSS_SELECTOR_METHOD:"The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",CSS_SELECTOR_STRING:"The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",OPTION_KEY:"The option requested in jPlayer('option') is undefined."};b.jPlayer.warningHint={CSS_SELECTOR_COUNT:"Check your css selector and the ancestor.",CSS_SELECTOR_METHOD:"Check your method name.",CSS_SELECTOR_STRING:"Check your css selector is a string.",OPTION_KEY:"Check your option name."}});
|
||||
|
|
|
@ -204,7 +204,7 @@
|
|||
|
||||
// Figure out how jPlayer will play it.
|
||||
// This may not work properly when both audio and video is supplied. ie., A media player. But it should return truethy and jPlayer can figure it out.
|
||||
|
||||
|
||||
var solution = srcObj.options.solution.toLowerCase().split(","), // Create the solution array, with prority based on the order of the solution string.
|
||||
supplied = srcObj.options.supplied.toLowerCase().split(","); // Create the supplied formats array, with prority based on the order of the supplied formats string.
|
||||
|
||||
|
@ -580,4 +580,4 @@
|
|||
}
|
||||
});
|
||||
|
||||
}(Popcorn));
|
||||
}(Popcorn));
|
||||
|
|
|
@ -2,25 +2,25 @@
|
|||
|
||||
/* Used to hide non-ui fields **/
|
||||
span.audioFileID {
|
||||
display:none;
|
||||
display:none;
|
||||
}
|
||||
span.audioFileTitle {
|
||||
display:none;
|
||||
display:none;
|
||||
}
|
||||
span.audioFileArtist {
|
||||
display:none;
|
||||
display:none;
|
||||
}
|
||||
span.playlistID {
|
||||
display:none;
|
||||
display:none;
|
||||
}
|
||||
span.playlistIndex {
|
||||
display:none;
|
||||
display:none;
|
||||
}
|
||||
span.showID {
|
||||
display:none;
|
||||
display:none;
|
||||
}
|
||||
span.showIndex {
|
||||
display:none;
|
||||
display:none;
|
||||
}
|
||||
|
||||
/* End of non-ui fields **/
|
||||
|
@ -184,7 +184,7 @@ div.jp-volume-max span{
|
|||
/*
|
||||
div.jp-audio div.jp-type-single a.jp-mute,
|
||||
div.jp-audio div.jp-type-single a.jp-unmute {
|
||||
margin-left: 210px;
|
||||
margin-left: 210px;
|
||||
}
|
||||
*/
|
||||
|
||||
|
|
|
@ -91,28 +91,28 @@ div.jp-video div.jp-interface {
|
|||
|
||||
/* Used to hide non-ui fields **/
|
||||
span.audioFileID {
|
||||
display:none;
|
||||
display:none;
|
||||
}
|
||||
span.audioFileTitle {
|
||||
display:none;
|
||||
display:none;
|
||||
}
|
||||
span.audioFileArtist {
|
||||
display:none;
|
||||
display:none;
|
||||
}
|
||||
span.playlistID {
|
||||
display:none;
|
||||
display:none;
|
||||
}
|
||||
span.playlistIndex {
|
||||
display:none;
|
||||
display:none;
|
||||
}
|
||||
|
||||
/* Not sure if this should be here. Daniel Franklin added this but not
|
||||
* sure if it is actually needed. Commenting out for now...
|
||||
span.showID {
|
||||
display:none;
|
||||
display:none;
|
||||
}
|
||||
span.showIndex {
|
||||
display:none;
|
||||
display:none;
|
||||
}
|
||||
* */
|
||||
/* @group CONTROLS */
|
||||
|
@ -266,7 +266,7 @@ a.jp-volume-max {
|
|||
|
||||
div.jp-audio div.jp-type-single a.jp-mute,
|
||||
div.jp-audio div.jp-type-single a.jp-unmute {
|
||||
margin-left: 210px;
|
||||
margin-left: 210px;
|
||||
}
|
||||
|
||||
div.jp-audio div.jp-type-playlist a.jp-mute,
|
||||
|
@ -275,7 +275,7 @@ div.jp-audio div.jp-type-playlist a.jp-unmute {
|
|||
}
|
||||
|
||||
div.jp-audio a.jp-volume-max {
|
||||
margin-left: 56px;
|
||||
margin-left: 56px;
|
||||
}
|
||||
|
||||
div.jp-video a.jp-mute,
|
||||
|
|
|
@ -504,4 +504,3 @@ div.jp-now-playing {
|
|||
div.jp-now-playing span {
|
||||
color: #898989;
|
||||
}
|
||||
|
||||
|
|
|
@ -103,4 +103,4 @@ if (!Object.keys) {
|
|||
return result;
|
||||
};
|
||||
}());
|
||||
}
|
||||
}
|
||||
|
|
2
legacy/public/js/libs/dropzone.min.js
vendored
2
legacy/public/js/libs/dropzone.min.js
vendored
File diff suppressed because one or more lines are too long
2
legacy/public/js/libs/handlebars.min.js
vendored
2
legacy/public/js/libs/handlebars.min.js
vendored
File diff suppressed because one or more lines are too long
2
legacy/public/js/libs/jquery-1.8.3.min.js
vendored
2
legacy/public/js/libs/jquery-1.8.3.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -353,4 +353,4 @@ a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var
|
|||
*
|
||||
* Depends:
|
||||
* jquery.effects.core.js
|
||||
*/(function(a,b){a.effects.transfer=function(b){return this.queue(function(){var c=a(this),d=a(b.options.to),e=d.offset(),f={top:e.top,left:e.left,height:d.innerHeight(),width:d.innerWidth()},g=c.offset(),h=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);
|
||||
*/(function(a,b){a.effects.transfer=function(b){return this.queue(function(){var c=a(this),d=a(b.options.to),e=d.offset(),f={top:e.top,left:e.left,height:d.innerHeight(),width:d.innerWidth()},g=c.offset(),h=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);
|
||||
|
|
File diff suppressed because one or more lines are too long
2
legacy/public/js/libs/pdfmake.min.js
vendored
2
legacy/public/js/libs/pdfmake.min.js
vendored
File diff suppressed because one or more lines are too long
2
legacy/public/js/libs/timezone.min.js
vendored
2
legacy/public/js/libs/timezone.min.js
vendored
|
@ -1 +1 @@
|
|||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.dayjs_plugin_timezone=e()}(this,function(){"use strict";var m={year:0,month:1,day:2,hour:3,minute:4,second:5},o={};return function(t,e,a){function f(t,i,e){return void 0===e&&(e={}),t=new Date(t),function(t){void 0===t&&(t={});var e=t.timeZoneName||"short",n=i+"|"+e,t=o[n];return t||(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:i,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:e}),o[n]=t),t}(e).formatToParts(t)}function r(t,e){for(var n=f(t,e),i=[],o=0;o<n.length;o+=1){var r=n[o],u=r.type,r=r.value,u=m[u];0<=u&&(i[u]=parseInt(r,10))}return e=24===(e=i[3])?0:e,e=i[0]+"-"+i[1]+"-"+i[2]+" "+e+":"+i[4]+":"+i[5]+":000",t=+t,(a.utc(e).valueOf()-(t-=t%1e3))/6e4}var u,s=a().utcOffset(),e=e.prototype;e.tz=function(t,e){void 0===t&&(t=u);var n=this.utcOffset(),i=this.toDate().toLocaleString("en-US",{timeZone:t}),o=Math.round((this.toDate()-new Date(i))/1e3/60),o=a(i).$set("millisecond",this.$ms).utcOffset(s-o,!0);return e&&(e=o.utcOffset(),o=o.add(n-e,"minute")),o.$x.$timezone=t,o},e.offsetName=function(t){var e=this.$x.$timezone||a.tz.guess(),t=f(this.valueOf(),e,{timeZoneName:t}).find(function(t){return"timezonename"===t.type.toLowerCase()});return t&&t.value};var i=e.startOf;e.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return i.call(this,t,e);var n=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"));return i.call(n,t,e).tz(this.$x.$timezone,!0)},a.tz=function(t,e,n){var i=n&&e,n=n||e||u,e=r(+a(),n);if("string"!=typeof t)return a(t).tz(n);i=function(t,e,n){var i=t-60*e*1e3,o=r(i,n);if(e===o)return[i,e];n=r(i-=60*(o-e)*1e3,n);return o===n?[i,o]:[t-60*Math.min(o,n)*1e3,Math.max(o,n)]}(a.utc(t,i).valueOf(),e,n),e=i[0],i=i[1],i=a(e).utcOffset(i);return i.$x.$timezone=n,i},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(t){u=t}}});
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.dayjs_plugin_timezone=e()}(this,function(){"use strict";var m={year:0,month:1,day:2,hour:3,minute:4,second:5},o={};return function(t,e,a){function f(t,i,e){return void 0===e&&(e={}),t=new Date(t),function(t){void 0===t&&(t={});var e=t.timeZoneName||"short",n=i+"|"+e,t=o[n];return t||(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:i,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:e}),o[n]=t),t}(e).formatToParts(t)}function r(t,e){for(var n=f(t,e),i=[],o=0;o<n.length;o+=1){var r=n[o],u=r.type,r=r.value,u=m[u];0<=u&&(i[u]=parseInt(r,10))}return e=24===(e=i[3])?0:e,e=i[0]+"-"+i[1]+"-"+i[2]+" "+e+":"+i[4]+":"+i[5]+":000",t=+t,(a.utc(e).valueOf()-(t-=t%1e3))/6e4}var u,s=a().utcOffset(),e=e.prototype;e.tz=function(t,e){void 0===t&&(t=u);var n=this.utcOffset(),i=this.toDate().toLocaleString("en-US",{timeZone:t}),o=Math.round((this.toDate()-new Date(i))/1e3/60),o=a(i).$set("millisecond",this.$ms).utcOffset(s-o,!0);return e&&(e=o.utcOffset(),o=o.add(n-e,"minute")),o.$x.$timezone=t,o},e.offsetName=function(t){var e=this.$x.$timezone||a.tz.guess(),t=f(this.valueOf(),e,{timeZoneName:t}).find(function(t){return"timezonename"===t.type.toLowerCase()});return t&&t.value};var i=e.startOf;e.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return i.call(this,t,e);var n=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"));return i.call(n,t,e).tz(this.$x.$timezone,!0)},a.tz=function(t,e,n){var i=n&&e,n=n||e||u,e=r(+a(),n);if("string"!=typeof t)return a(t).tz(n);i=function(t,e,n){var i=t-60*e*1e3,o=r(i,n);if(e===o)return[i,e];n=r(i-=60*(o-e)*1e3,n);return o===n?[i,o]:[t-60*Math.min(o,n)*1e3,Math.max(o,n)]}(a.utc(t,i).valueOf(),e,n),e=i[0],i=i[1],i=a(e).utcOffset(i);return i.$x.$timezone=n,i},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(t){u=t}}});
|
||||
|
|
2
legacy/public/js/libs/utc.min.js
vendored
2
legacy/public/js/libs/utc.min.js
vendored
|
@ -1 +1 @@
|
|||
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):t.dayjs_plugin_utc=i()}(this,function(){"use strict";return function(t,i,f){var s=i.prototype;f.utc=function(t){return new i({date:t,utc:!0,args:arguments})},s.utc=function(t){var i=f(this.toDate(),{locale:this.$L,utc:!0});return t?i.add(this.utcOffset(),"minute"):i},s.local=function(){return f(this.toDate(),{locale:this.$L,utc:!1})};var e=s.parse;s.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),e.call(this,t)};var n=s.init;s.init=function(){var t;this.$u?(t=this.$d,this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()):n.call(this)};var u=s.utcOffset;s.utcOffset=function(t,i){var s=this.$utils().u;if(s(t))return this.$u?0:s(this.$offset)?u.call(this):this.$offset;var e=Math.abs(t)<=16?60*t:t,s=this;return i?(s.$offset=e,s.$u=0===t):0!==t?(t=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset(),(s=this.local().add(e+t,"minute")).$offset=e,s.$x.$localOffset=t):s=this.utc(),s};var o=s.format;s.format=function(t){t=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return o.call(this,t)},s.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||(new Date).getTimezoneOffset());return this.$d.valueOf()-6e4*t},s.isUTC=function(){return!!this.$u},s.toISOString=function(){return this.toDate().toISOString()},s.toString=function(){return this.toDate().toUTCString()};var r=s.toDate;s.toDate=function(t){return"s"===t&&this.$offset?f(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():r.call(this)};var a=s.diff;s.diff=function(t,i,s){if(t&&this.$u===t.$u)return a.call(this,t,i,s);var e=this.local(),t=f(t).local();return a.call(e,t,i,s)}}});
|
||||
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):t.dayjs_plugin_utc=i()}(this,function(){"use strict";return function(t,i,f){var s=i.prototype;f.utc=function(t){return new i({date:t,utc:!0,args:arguments})},s.utc=function(t){var i=f(this.toDate(),{locale:this.$L,utc:!0});return t?i.add(this.utcOffset(),"minute"):i},s.local=function(){return f(this.toDate(),{locale:this.$L,utc:!1})};var e=s.parse;s.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),e.call(this,t)};var n=s.init;s.init=function(){var t;this.$u?(t=this.$d,this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()):n.call(this)};var u=s.utcOffset;s.utcOffset=function(t,i){var s=this.$utils().u;if(s(t))return this.$u?0:s(this.$offset)?u.call(this):this.$offset;var e=Math.abs(t)<=16?60*t:t,s=this;return i?(s.$offset=e,s.$u=0===t):0!==t?(t=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset(),(s=this.local().add(e+t,"minute")).$offset=e,s.$x.$localOffset=t):s=this.utc(),s};var o=s.format;s.format=function(t){t=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return o.call(this,t)},s.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||(new Date).getTimezoneOffset());return this.$d.valueOf()-6e4*t},s.isUTC=function(){return!!this.$u},s.toISOString=function(){return this.toDate().toISOString()},s.toString=function(){return this.toDate().toUTCString()};var r=s.toDate;s.toDate=function(t){return"s"===t&&this.$offset?f(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():r.call(this)};var a=s.diff;s.diff=function(t,i,s){if(t&&this.$u===t.$u)return a.call(this,t,i,s);var e=this.local(),t=f(t).local();return a.call(e,t,i,s)}}});
|
||||
|
|
2
legacy/public/js/libs/vfs_fonts.min.js
vendored
2
legacy/public/js/libs/vfs_fonts.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -24,4 +24,4 @@ plupload.addI18n({
|
|||
'Start upload': 'Start upload',
|
||||
'%d files queued': '%d files queued',
|
||||
"Error: Invalid file extension: " : $.i18n._("Error: Invalid file extension: ")
|
||||
});
|
||||
});
|
||||
|
|
|
@ -24,4 +24,4 @@ plupload.addI18n({
|
|||
'Start upload': 'Start upload',
|
||||
'%d files queued': '%d files queued',
|
||||
"Error: Invalid file extension: " : $.i18n._("Error: Invalid file extension: ")
|
||||
});
|
||||
});
|
||||
|
|
|
@ -22,4 +22,4 @@ plupload.addI18n({
|
|||
'Add Files': 'Dodaj datoteke',
|
||||
'Start Upload': 'Pokreni upload.',
|
||||
'%d files queued': '%d datoteka na čekanju.'
|
||||
});
|
||||
});
|
||||
|
|
|
@ -24,4 +24,4 @@ plupload.addI18n({
|
|||
'Start upload': $.i18n._('Start upload'),
|
||||
'%d files queued': $.i18n._('%d files queued'),
|
||||
"Error: Invalid file extension: " : $.i18n._("Error: Invalid file extension: ")
|
||||
});
|
||||
});
|
||||
|
|
|
@ -24,4 +24,4 @@ plupload.addI18n({
|
|||
'Start upload': '업로드 시작',
|
||||
'%d files queued': '%d개의 파일이 큐 되었습니다',
|
||||
"Error: Invalid file extension: " : $.i18n._("Error: Invalid file extension: ")
|
||||
});
|
||||
});
|
||||
|
|
|
@ -24,4 +24,4 @@ plupload.addI18n({
|
|||
'Start upload': $.i18n._('Start upload'),
|
||||
'%d files queued': $.i18n._('%d files queued'),
|
||||
"Error: Invalid file extension: " : $.i18n._("Error: Invalid file extension: ")
|
||||
});
|
||||
});
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -19,12 +19,12 @@
|
|||
(function($, window, undefined) {
|
||||
|
||||
"use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
|
||||
|
||||
|
||||
// Munge the primitives - Paul Irish tip
|
||||
var TRUE = true,
|
||||
FALSE = false,
|
||||
NULL = null,
|
||||
|
||||
|
||||
// Shortcut vars
|
||||
QTIP, PLUGINS, MOUSE,
|
||||
usedIDs = {},
|
||||
|
@ -40,12 +40,12 @@
|
|||
replaceSuffix = '_replacedByqTip',
|
||||
oldtitle = 'oldtitle',
|
||||
trackingBound;
|
||||
|
||||
|
||||
/* Thanks to Paul Irish for this one: http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ */
|
||||
function log() {
|
||||
log.history = log.history || [];
|
||||
log.history.push(arguments);
|
||||
|
||||
|
||||
// Make sure console is present
|
||||
if('object' === typeof console) {
|
||||
|
||||
|
@ -143,7 +143,7 @@ function sanitizeOptions(opts)
|
|||
$.each(PLUGINS, function() {
|
||||
if(this.sanitize) { this.sanitize(opts); }
|
||||
});
|
||||
|
||||
|
||||
return opts;
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ function QTip(target, options, id, attr)
|
|||
*/
|
||||
function convertNotation(notation)
|
||||
{
|
||||
var i = 0, obj, option = options,
|
||||
var i = 0, obj, option = options,
|
||||
|
||||
// Split notation into array
|
||||
levels = notation.split('.');
|
||||
|
@ -201,7 +201,7 @@ function QTip(target, options, id, attr)
|
|||
|
||||
tooltip.toggleClass(widget, on).toggleClass(defaultClass, options.style['default'] && !on);
|
||||
elements.content.toggleClass(widget+'-content', on);
|
||||
|
||||
|
||||
if(elements.titlebar){
|
||||
elements.titlebar.toggleClass(widget+'-header', on);
|
||||
}
|
||||
|
@ -291,7 +291,7 @@ function QTip(target, options, id, attr)
|
|||
if(options.content.title.button) { createButton(); }
|
||||
|
||||
// Redraw the tooltip dimensions if it's rendered
|
||||
else if(self.rendered){ self.redraw(); }
|
||||
else if(self.rendered){ self.redraw(); }
|
||||
}
|
||||
|
||||
function updateButton(button)
|
||||
|
@ -381,7 +381,7 @@ function QTip(target, options, id, attr)
|
|||
if(reposition !== FALSE) {
|
||||
self.reposition(cache.event);
|
||||
}
|
||||
|
||||
|
||||
next();
|
||||
}
|
||||
}
|
||||
|
@ -407,7 +407,7 @@ function QTip(target, options, id, attr)
|
|||
|
||||
// Restart timer
|
||||
self.timers.img[elem.src] = setTimeout(timer, 700);
|
||||
}());
|
||||
}());
|
||||
|
||||
// Also apply regular load/error event handlers
|
||||
$(elem).bind('error'+namespace+' load'+namespace, function(){ imageLoad(this); });
|
||||
|
@ -562,7 +562,7 @@ function QTip(target, options, id, attr)
|
|||
if('number' === typeof options.hide.inactive) {
|
||||
// Bind inactive method to target as a custom event
|
||||
targets.show.bind('qtip-'+id+'-inactive', inactiveMethod);
|
||||
|
||||
|
||||
// Define events which reset the 'inactive' event handler
|
||||
$.each(QTIP.inactiveEvents, function(index, type){
|
||||
targets.hide.add(elements.tooltip).bind(type+namespace+'-inactive', inactiveMethod);
|
||||
|
@ -718,7 +718,7 @@ function QTip(target, options, id, attr)
|
|||
},
|
||||
|
||||
// Style checks
|
||||
'^style.classes$': function(obj, o, v) {
|
||||
'^style.classes$': function(obj, o, v) {
|
||||
tooltip.attr('class', uitooltip + ' qtip ui-helper-reset ' + v);
|
||||
},
|
||||
'^style.widget|content.title': setWidget,
|
||||
|
@ -788,7 +788,7 @@ function QTip(target, options, id, attr)
|
|||
isDrawing = 1; isPositioning = 1;
|
||||
|
||||
// Create title...
|
||||
if(title) {
|
||||
if(title) {
|
||||
createTitle();
|
||||
|
||||
// Update title only if its not a callback (called in toggle if so)
|
||||
|
@ -1002,7 +1002,7 @@ function QTip(target, options, id, attr)
|
|||
if((callback.solo = !!opts.solo)) { $(selector, opts.solo).not(tooltip).qtip('hide', callback); }
|
||||
}
|
||||
else {
|
||||
// Clear show timer if we're hiding
|
||||
// Clear show timer if we're hiding
|
||||
clearTimeout(self.timers.show);
|
||||
|
||||
// Remove cached origin on hide
|
||||
|
@ -1013,7 +1013,7 @@ function QTip(target, options, id, attr)
|
|||
$(document).unbind('mousemove.qtip');
|
||||
trackingBound = FALSE;
|
||||
}
|
||||
|
||||
|
||||
// Blur the tooltip
|
||||
self.blur(event);
|
||||
}
|
||||
|
@ -1108,7 +1108,7 @@ function QTip(target, options, id, attr)
|
|||
this.style.zIndex = this.style.zIndex - 1;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Fire blur event for focused tooltip
|
||||
qtips.filter('.' + focusClass).qtip('blur', cachedEvent);
|
||||
}
|
||||
|
@ -1142,10 +1142,10 @@ function QTip(target, options, id, attr)
|
|||
|
||||
// Set positioning flag
|
||||
isPositioning = 1;
|
||||
|
||||
|
||||
var target = options.position.target,
|
||||
posOptions = options.position,
|
||||
my = posOptions.my,
|
||||
my = posOptions.my,
|
||||
at = posOptions.at,
|
||||
adjust = posOptions.adjust,
|
||||
method = adjust.method.split(' '),
|
||||
|
@ -1165,7 +1165,7 @@ function QTip(target, options, id, attr)
|
|||
horizontal: method[0],
|
||||
vertical: (method[1] = method[1] || method[0]),
|
||||
enabled: viewport.jquery && target[0] !== window && target[0] !== docBody && adjust.method !== 'none',
|
||||
|
||||
|
||||
// Reposition methods
|
||||
left: function(posLeft) {
|
||||
var isShift = readjust.horizontal === 'shift',
|
||||
|
@ -1205,7 +1205,7 @@ function QTip(target, options, id, attr)
|
|||
position.left -= isCenter ? -offset : offset;
|
||||
}
|
||||
if(position.left !== posLeft && isCenter) { position.left -= adjust.x; }
|
||||
|
||||
|
||||
// Make sure we haven't made things worse with the adjustment and return the adjusted difference
|
||||
if(position.left < viewportScroll && -position.left > overflowRight) { position.left = posLeft; }
|
||||
}
|
||||
|
@ -1223,7 +1223,7 @@ function QTip(target, options, id, attr)
|
|||
overflowBottom = posTop + elemHeight - viewport.height - viewportScroll + tipAdjust,
|
||||
offset = myHeight - (my.precedance === 'y' || my.x === my.y ? atHeight : 0) - (at.y === 'center' ? targetHeight / 2 : 0),
|
||||
isCenter = my.y === 'center';
|
||||
|
||||
|
||||
// Optional 'shift' style repositioning
|
||||
if(isShift) {
|
||||
tipAdjust = tip && tip.corner && tip.corner.precedance === 'x' ? tipHeight : 0;
|
||||
|
@ -1401,7 +1401,7 @@ function QTip(target, options, id, attr)
|
|||
if(effect === FALSE || isNaN(position.left) || isNaN(position.top) || target === 'mouse' || !$.isFunction(posOptions.effect)) {
|
||||
tooltip.css(position);
|
||||
}
|
||||
|
||||
|
||||
// Use custom function if provided
|
||||
else if($.isFunction(posOptions.effect)) {
|
||||
posOptions.effect.call(tooltip, self, $.extend({}, position));
|
||||
|
@ -1472,7 +1472,7 @@ function QTip(target, options, id, attr)
|
|||
if('boolean' !== typeof state) {
|
||||
state = !(tooltip.hasClass(disabled) || cache.disabled);
|
||||
}
|
||||
|
||||
|
||||
if(self.rendered) {
|
||||
tooltip.toggleClass(disabled, state);
|
||||
$.attr(tooltip[0], 'aria-disabled', state);
|
||||
|
@ -1483,7 +1483,7 @@ function QTip(target, options, id, attr)
|
|||
|
||||
return self;
|
||||
},
|
||||
|
||||
|
||||
enable: function() { return self.disable(FALSE); },
|
||||
|
||||
destroy: function()
|
||||
|
@ -1495,7 +1495,7 @@ function QTip(target, options, id, attr)
|
|||
// Destroy tooltip and any associated plugins if rendered
|
||||
if(self.rendered) {
|
||||
tooltip.remove();
|
||||
|
||||
|
||||
$.each(self.plugins, function() {
|
||||
if(this.destroy) { this.destroy(); }
|
||||
});
|
||||
|
@ -1558,14 +1558,14 @@ function init(id, opts)
|
|||
catch(e) { log('Unable to parse HTML5 attribute data: ' + html5); }
|
||||
|
||||
// Merge in and sanitize metadata
|
||||
config = $.extend(TRUE, {}, QTIP.defaults, opts,
|
||||
config = $.extend(TRUE, {}, QTIP.defaults, opts,
|
||||
typeof html5 === 'object' ? sanitizeOptions(html5) : NULL,
|
||||
sanitizeOptions(metadata5 || metadata));
|
||||
|
||||
// Re-grab our positioning options now we've merged our metadata and set id to passed value
|
||||
posOptions = config.position;
|
||||
config.id = id;
|
||||
|
||||
|
||||
// Setup missing content if none is detected
|
||||
if('boolean' === typeof config.content.text) {
|
||||
attr = elem.attr(config.content.attr);
|
||||
|
@ -1768,7 +1768,7 @@ PLUGINS = QTIP.plugins = {
|
|||
var f = corner.charAt(0); this.precedance = (f === 't' || f === 'b' ? 'y' : 'x');
|
||||
|
||||
this.string = function() { return this.precedance === 'y' ? this.y+this.x : this.x+this.y; };
|
||||
this.abbrev = function() {
|
||||
this.abbrev = function() {
|
||||
var x = this.x.substr(0,1), y = this.y.substr(0,1);
|
||||
return x === y ? x : (x === 'c' || (x !== 'c' && y !== 'c')) ? y + x : x + y;
|
||||
};
|
||||
|
@ -1805,7 +1805,7 @@ PLUGINS = QTIP.plugins = {
|
|||
overflow = parent.css('overflow');
|
||||
if(overflow === 'scroll' || overflow === 'auto') { deep++; }
|
||||
}
|
||||
|
||||
|
||||
if(parent[0] === docBody) { break; }
|
||||
}
|
||||
while(parent = parent.offsetParent());
|
||||
|
@ -1816,7 +1816,7 @@ PLUGINS = QTIP.plugins = {
|
|||
|
||||
return pos;
|
||||
},
|
||||
|
||||
|
||||
/*
|
||||
* iOS 3.2 - 4.0 scroll fix detection used in offset() function.
|
||||
*/
|
||||
|
@ -1824,7 +1824,7 @@ PLUGINS = QTIP.plugins = {
|
|||
('' + (/CPU.*OS ([0-9_]{1,3})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0,''])[1])
|
||||
.replace('undefined', '3_2').replace('_','.')
|
||||
) || FALSE,
|
||||
|
||||
|
||||
/*
|
||||
* jQuery-specific $.fn overrides
|
||||
*/
|
||||
|
@ -1854,7 +1854,7 @@ PLUGINS = QTIP.plugins = {
|
|||
|
||||
return $.fn['attr'+replaceSuffix].apply(this, arguments);
|
||||
},
|
||||
|
||||
|
||||
/* Allow clone to correctly retrieve cached title attributes */
|
||||
clone: function(keepData) {
|
||||
var titles = $([]), title = 'title',
|
||||
|
@ -1873,7 +1873,7 @@ PLUGINS = QTIP.plugins = {
|
|||
return elems;
|
||||
},
|
||||
|
||||
/*
|
||||
/*
|
||||
* Taken directly from jQuery 1.8.2 widget source code
|
||||
* Trigger 'remove' event on all elements on removal
|
||||
*/
|
||||
|
@ -1896,7 +1896,7 @@ PLUGINS = QTIP.plugins = {
|
|||
// Apply the fn overrides above
|
||||
$.each(PLUGINS.fn, function(name, func) {
|
||||
if(!func || $.fn[name+replaceSuffix]) { return TRUE; }
|
||||
|
||||
|
||||
var old = $.fn[name+replaceSuffix] = $.fn[name];
|
||||
$.fn[name] = function() {
|
||||
return func.apply(this, arguments) || old.apply(this, arguments);
|
||||
|
@ -2027,7 +2027,7 @@ function Ajax(api)
|
|||
|
||||
// Make sure default event hasn't been prevented
|
||||
else if(event && event.isDefaultPrevented()) { return self; }
|
||||
|
||||
|
||||
// Check if user delcared a content selector like in .load()
|
||||
if(hasSelector > -1) {
|
||||
selector = url.substr(hasSelector);
|
||||
|
@ -2051,7 +2051,7 @@ function Ajax(api)
|
|||
// inject the contents of the document in, removing the scripts
|
||||
// to avoid any 'Permission Denied' errors in IE
|
||||
.append(content.replace(rscript, ""))
|
||||
|
||||
|
||||
// Locate the specified elements
|
||||
.find(selector);
|
||||
}
|
||||
|
@ -2078,7 +2078,7 @@ function Ajax(api)
|
|||
PLUGINS.ajax = function(api)
|
||||
{
|
||||
var self = api.plugins.ajax;
|
||||
|
||||
|
||||
return 'object' === typeof self ? self : (api.plugins.ajax = new Ajax(api));
|
||||
};
|
||||
|
||||
|
@ -2250,7 +2250,7 @@ PLUGINS.imagemap = function(area, corner, flip)
|
|||
|
||||
// Tip coordinates calculator
|
||||
function calculateTip(corner, width, height)
|
||||
{
|
||||
{
|
||||
var width2 = Math.ceil(width / 2), height2 = Math.ceil(height / 2),
|
||||
|
||||
// Define tip coordinates in terms of height and width values
|
||||
|
@ -2379,7 +2379,7 @@ function Tip(qTip, command)
|
|||
pos.left -= adjust.left;
|
||||
shift.left = FALSE;
|
||||
}
|
||||
|
||||
|
||||
css[ offset.right !== undefined ? 'right' : 'left' ] = shift.x;
|
||||
}
|
||||
}
|
||||
|
@ -2421,7 +2421,7 @@ function Tip(qTip, command)
|
|||
/* border width calculator */
|
||||
function borderWidth(corner, side, backup) {
|
||||
side = !side ? corner[corner.precedance] : side;
|
||||
|
||||
|
||||
var isFluid = tooltip.hasClass(fluidClass),
|
||||
isTitleTop = elems.titlebar && corner.y === 'top',
|
||||
elem = isTitleTop ? elems.titlebar : elems.content,
|
||||
|
@ -2459,7 +2459,7 @@ function Tip(qTip, command)
|
|||
bigHyp, ratio, result,
|
||||
|
||||
smallHyp = Math.sqrt( pow(base, 2) + pow(height, 2) ),
|
||||
|
||||
|
||||
hyp = [
|
||||
(border / base) * smallHyp, (border / height) * smallHyp
|
||||
];
|
||||
|
@ -2487,7 +2487,7 @@ function Tip(qTip, command)
|
|||
// Bind update events
|
||||
tooltip.unbind(namespace).bind('tooltipmove'+namespace, reposition);
|
||||
}
|
||||
|
||||
|
||||
return enabled;
|
||||
},
|
||||
|
||||
|
@ -2666,15 +2666,15 @@ function Tip(qTip, command)
|
|||
if(hasCanvas) {
|
||||
// Set the canvas size using calculated size
|
||||
inner.attr(newSize);
|
||||
|
||||
|
||||
// Grab canvas context and clear/save it
|
||||
context = inner[0].getContext('2d');
|
||||
context.restore(); context.save();
|
||||
context.clearRect(0,0,3000,3000);
|
||||
|
||||
|
||||
// Translate origin
|
||||
context.translate(translate[0], translate[1]);
|
||||
|
||||
|
||||
// Draw the tip
|
||||
context.beginPath();
|
||||
context.moveTo(coords[0][0], coords[0][1]);
|
||||
|
@ -2769,9 +2769,9 @@ function Tip(qTip, command)
|
|||
else {
|
||||
b = borderWidth(corner, side, TRUE);
|
||||
br = borderRadius(corner);
|
||||
|
||||
|
||||
position[ side ] = i ?
|
||||
border ? borderWidth(corner, side) : 0 :
|
||||
border ? borderWidth(corner, side) : 0 :
|
||||
userOffset + (br > b ? br : 0);
|
||||
}
|
||||
});
|
||||
|
@ -2783,7 +2783,7 @@ function Tip(qTip, command)
|
|||
tip.css({ top: '', bottom: '', left: '', right: '', margin: '' }).css(position);
|
||||
return position;
|
||||
},
|
||||
|
||||
|
||||
destroy: function()
|
||||
{
|
||||
// Remov tip and bound events
|
||||
|
@ -2798,7 +2798,7 @@ function Tip(qTip, command)
|
|||
PLUGINS.tip = function(api)
|
||||
{
|
||||
var self = api.plugins.tip;
|
||||
|
||||
|
||||
return 'object' === typeof self ? self : (api.plugins.tip = new Tip(api));
|
||||
};
|
||||
|
||||
|
@ -2895,7 +2895,7 @@ function Modal(api)
|
|||
'^show.modal.(on|blur)$': function() {
|
||||
// Initialise
|
||||
self.init();
|
||||
|
||||
|
||||
// Show the modal if not visible already and tooltip is visible
|
||||
elems.overlay.toggle( tooltip.is(':visible') );
|
||||
}
|
||||
|
@ -2915,7 +2915,7 @@ function Modal(api)
|
|||
|
||||
// Set z-index
|
||||
.css('z-index', PLUGINS.modal.zindex + $(selector+'['+attr+']').length)
|
||||
|
||||
|
||||
// Remove previous bound events in globalNamespace
|
||||
.unbind(globalNamespace).unbind(namespace)
|
||||
|
||||
|
@ -3053,8 +3053,8 @@ function Modal(api)
|
|||
container = target.closest('.qtip'),
|
||||
|
||||
// Determine if input container target is above this
|
||||
targetOnTop = container.length < 1 ? FALSE :
|
||||
(parseInt(container[0].style.zIndex, 10) > parseInt(tooltip[0].style.zIndex, 10));
|
||||
targetOnTop = container.length < 1 ? FALSE :
|
||||
(parseInt(container[0].style.zIndex, 10) > parseInt(tooltip[0].style.zIndex, 10));
|
||||
|
||||
// If we're showing a modal, but focus has landed on an input below
|
||||
// this modal, divert focus to the first visible input in this modal
|
||||
|
@ -3142,7 +3142,7 @@ PLUGINS.modal.initialize = 'render';
|
|||
|
||||
// Setup sanitiztion rules
|
||||
PLUGINS.modal.sanitize = function(opts) {
|
||||
if(opts.show) {
|
||||
if(opts.show) {
|
||||
if(typeof opts.show.modal !== 'object') { opts.show.modal = { on: !!opts.show.modal }; }
|
||||
else if(typeof opts.show.modal.on === 'undefined') { opts.show.modal.on = TRUE; }
|
||||
}
|
||||
|
@ -3163,7 +3163,7 @@ $.extend(TRUE, QTIP.defaults, {
|
|||
}
|
||||
});
|
||||
|
||||
/*
|
||||
/*
|
||||
* BGIFrame adaption (http://plugins.jquery.com/project/bgiframe)
|
||||
* Special thanks to Brandon Aaron
|
||||
*/
|
||||
|
@ -3227,7 +3227,7 @@ PLUGINS.bgiframe = function(api)
|
|||
{
|
||||
var browser = $.browser,
|
||||
self = api.plugins.bgiframe;
|
||||
|
||||
|
||||
// Proceed only if the browser is IE6 and offending elements are present
|
||||
if($('select, object').length < 1 || !(browser.msie && (''+browser.version).charAt(0) === '6')) {
|
||||
return FALSE;
|
||||
|
|
2
legacy/public/js/qtip/jquery.qtip.min.js
vendored
2
legacy/public/js/qtip/jquery.qtip.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -26,9 +26,9 @@ denise@denise-DX4860:~/airtime/legacy/public/js/serverbrowse$ diff -u serverbrow
|
|||
@@ -123,7 +123,7 @@
|
||||
function() { $(this).removeClass('ui-state-hover'); }
|
||||
);
|
||||
|
||||
|
||||
- var enterLabel = $('<span></span>').text('Look in: ').appendTo(enterButton.clone(false).appendTo(enterPathDiv));
|
||||
+ var enterLabel = $('<span></span>').text($.i18n._('Look in')+': ').appendTo(enterButton.clone(false).appendTo(enterPathDiv));
|
||||
|
||||
|
||||
var enterText = $('<input type="text">').keypress(function(e) {
|
||||
if (e.keyCode == '13') {
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
if (settings) $.extend(config, settings);
|
||||
// Required configuration elements
|
||||
// We need to set some configuration elements without user
|
||||
// For example there should be 2 buttons on the bottom,
|
||||
// For example there should be 2 buttons on the bottom,
|
||||
// And dialog should be opened after button is pressed, not when it created
|
||||
// Also we need to know about dialog resizing
|
||||
$.extend(config, {
|
||||
|
@ -83,7 +83,7 @@
|
|||
recalculateSize(event, ui);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
function systemImageUrl()
|
||||
{
|
||||
if (config.systemImageUrl.length == 0) {
|
||||
|
@ -92,7 +92,7 @@
|
|||
return config.systemImageUrl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var privateConfig = {
|
||||
// This stack array will store history navigation data
|
||||
// When user open new directory, old directory will be added to this list
|
||||
|
@ -105,19 +105,19 @@
|
|||
// Exception: if 'config.multiselect' is false, only one element will be stored in this array.
|
||||
selectedItems: [],
|
||||
}
|
||||
|
||||
|
||||
// Main dialog div
|
||||
// It will be converted into jQuery-ui dialog box using my configuration parameters
|
||||
// It contains 3 divs
|
||||
var browserDlg = $('<div title="' + config.title + '"></div>').css({'overflow': 'hidden'}).appendTo(document.body);
|
||||
browserDlg.dialog(config);
|
||||
|
||||
|
||||
// First div on the top
|
||||
// It contains textbox field and buttons
|
||||
// User can enter any paths he want to open in this textbox and press enter
|
||||
// There is 3 buttons on the panel:
|
||||
var enterPathDiv = $('<div></div>').addClass('ui-widget-content').appendTo(browserDlg).css({'height': '30px', 'width': '100%', 'padding-top': '7px'});
|
||||
|
||||
|
||||
var enterButton = $('<div></div>').css({'float': 'left', 'vertical-align': 'middle', 'margin-left': '6px'}).addClass('ui-corner-all').hover(
|
||||
function() { $(this).addClass('ui-state-hover'); },
|
||||
function() { $(this).removeClass('ui-state-hover'); }
|
||||
|
@ -131,9 +131,9 @@
|
|||
loadPath(enterText.val());
|
||||
}
|
||||
}).appendTo(enterButton.clone(false).appendTo(enterPathDiv));
|
||||
|
||||
|
||||
// Back button.
|
||||
|
||||
// Back button.
|
||||
// When user click on it, 2 last elements of the history pop from the list, and reload second of them.
|
||||
var enterBack = $('<div></div>').addClass('ui-corner-all ui-icon ui-icon-circle-arrow-w').click(function(){
|
||||
privateConfig.browserHistory.pop(); // Remove current element. It is not required now.
|
||||
|
@ -152,7 +152,7 @@
|
|||
loadPath(backPath + config.separatorPath + '..');
|
||||
}
|
||||
}).appendTo(enterButton.clone(true).appendTo(enterPathDiv));
|
||||
|
||||
|
||||
// Second div is on the left
|
||||
// It contains images and texts for pre-defined paths
|
||||
// User just click on them and it will open pre-defined path
|
||||
|
@ -172,24 +172,24 @@
|
|||
$('<span></span>').text(path.text).appendTo(knownDiv);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Third div is everywhere :)
|
||||
// It show files and folders in the current path
|
||||
// User can click on path to select or deselect it
|
||||
// Doubleclick on path will open it
|
||||
// Also doubleclick on file will select this file and close dialog
|
||||
var browserPathDiv = $('<div></div>').addClass('ui-widget-content').css({'float': 'right', 'overflow': 'auto'}).appendTo(browserDlg);
|
||||
|
||||
|
||||
// Now everything is done
|
||||
// When user will be ready - he just click on the area you select for this plugin and dialog will appear
|
||||
$(this).click(function() {
|
||||
privateConfig.browserHistory = [];
|
||||
var startpath = removeBackPath(config.onLoad());
|
||||
|
||||
|
||||
startpath = startpath.split(config.separatorPath);
|
||||
startpath.pop();
|
||||
startpath = startpath.join(config.separatorPath);
|
||||
|
||||
|
||||
if(!checkBasePath(startpath)){
|
||||
startpath = config.basePath;
|
||||
}
|
||||
|
@ -208,7 +208,7 @@
|
|||
if(confPath.length > curPath.length)
|
||||
return false;
|
||||
var result = true;
|
||||
$.each(confPath, function(index, partConfPath) {
|
||||
$.each(confPath, function(index, partConfPath) {
|
||||
if(partConfPath != curPath[index]){
|
||||
result = false;
|
||||
}
|
||||
|
@ -223,7 +223,7 @@
|
|||
var confPath = config.basePath.split(config.separatorPath);
|
||||
var curPath = path.split(config.separatorPath);
|
||||
var newcurPath = [];
|
||||
$.each(curPath, function(index, partCurPath) {
|
||||
$.each(curPath, function(index, partCurPath) {
|
||||
if(partCurPath == ".."){
|
||||
newcurPath.pop();
|
||||
}else{
|
||||
|
@ -233,7 +233,7 @@
|
|||
return newcurPath.join(config.separatorPath);
|
||||
}
|
||||
|
||||
// This function will be called when user click 'Open'
|
||||
// This function will be called when user click 'Open'
|
||||
// It check if any path is selected, and call config.onSelect function with path list
|
||||
function doneOk(){
|
||||
var newCurPath = [];
|
||||
|
@ -243,7 +243,7 @@
|
|||
if(newCurPath.length == 0) {
|
||||
newCurPath.push(privateConfig.browserHistory.pop());
|
||||
}
|
||||
|
||||
|
||||
if(config.multiselect)
|
||||
config.onSelect(newCurPath);
|
||||
else {
|
||||
|
@ -256,7 +256,7 @@
|
|||
}
|
||||
browserDlg.dialog("close");
|
||||
}
|
||||
|
||||
|
||||
// Function recalculate and set new width and height for left and right div elements
|
||||
// height have '-2' because of the borders
|
||||
// width have '-4' because of a border an 2 pixels space between divs
|
||||
|
@ -331,22 +331,22 @@
|
|||
// If path is not under 'config.basePath', alert will be shown and nothing will be opened
|
||||
function loadPath(path) {
|
||||
privateConfig.selectedItems = [];
|
||||
|
||||
|
||||
// First we need to remove all '..' parts of the path
|
||||
path = removeBackPath(path);
|
||||
|
||||
|
||||
// Then we need to check, if path based on 'config.basePath'
|
||||
if(!checkBasePath(path)) {
|
||||
alert('Path should be based from ' + config.basePath);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Then we can put this path into history
|
||||
privateConfig.browserHistory.push(path);
|
||||
|
||||
|
||||
// Show it to user
|
||||
enterText.val(path);
|
||||
|
||||
|
||||
// And load
|
||||
$.ajax({
|
||||
url: config.handlerUrl,
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
if (settings) $.extend(config, settings);
|
||||
// Required configuration elements
|
||||
// We need to set some configuration elements without user
|
||||
// For example there should be 2 buttons on the bottom,
|
||||
// For example there should be 2 buttons on the bottom,
|
||||
// And dialog should be opened after button is pressed, not when it created
|
||||
// Also we need to know about dialog resizing
|
||||
$.extend(config, {
|
||||
|
@ -83,7 +83,7 @@
|
|||
recalculateSize(event, ui);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
function systemImageUrl()
|
||||
{
|
||||
if (config.systemImageUrl.length == 0) {
|
||||
|
@ -92,7 +92,7 @@
|
|||
return config.systemImageUrl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var privateConfig = {
|
||||
// This stack array will store history navigation data
|
||||
// When user open new directory, old directory will be added to this list
|
||||
|
@ -105,19 +105,19 @@
|
|||
// Exception: if 'config.multiselect' is false, only one element will be stored in this array.
|
||||
selectedItems: [],
|
||||
}
|
||||
|
||||
|
||||
// Main dialog div
|
||||
// It will be converted into jQuery-ui dialog box using my configuration parameters
|
||||
// It contains 3 divs
|
||||
var browserDlg = $('<div title="' + config.title + '"></div>').css({'overflow': 'hidden'}).appendTo(document.body);
|
||||
browserDlg.dialog(config);
|
||||
|
||||
|
||||
// First div on the top
|
||||
// It contains textbox field and buttons
|
||||
// User can enter any paths he want to open in this textbox and press enter
|
||||
// There is 3 buttons on the panel:
|
||||
var enterPathDiv = $('<div></div>').addClass('ui-widget-content').appendTo(browserDlg).css({'height': '30px', 'width': '100%', 'padding-top': '7px'});
|
||||
|
||||
|
||||
var enterButton = $('<div></div>').css({'float': 'left', 'vertical-align': 'middle', 'margin-left': '6px'}).addClass('ui-corner-all').hover(
|
||||
function() { $(this).addClass('ui-state-hover'); },
|
||||
function() { $(this).removeClass('ui-state-hover'); }
|
||||
|
@ -131,9 +131,9 @@
|
|||
loadPath(enterText.val());
|
||||
}
|
||||
}).appendTo(enterButton.clone(false).appendTo(enterPathDiv));
|
||||
|
||||
|
||||
// Back button.
|
||||
|
||||
// Back button.
|
||||
// When user click on it, 2 last elements of the history pop from the list, and reload second of them.
|
||||
var enterBack = $('<div></div>').addClass('ui-corner-all ui-icon ui-icon-circle-arrow-w').click(function(){
|
||||
privateConfig.browserHistory.pop(); // Remove current element. It is not required now.
|
||||
|
@ -152,7 +152,7 @@
|
|||
loadPath(backPath + config.separatorPath + '..');
|
||||
}
|
||||
}).appendTo(enterButton.clone(true).appendTo(enterPathDiv));
|
||||
|
||||
|
||||
// Second div is on the left
|
||||
// It contains images and texts for pre-defined paths
|
||||
// User just click on them and it will open pre-defined path
|
||||
|
@ -172,24 +172,24 @@
|
|||
$('<span></span>').text(path.text).appendTo(knownDiv);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Third div is everywhere :)
|
||||
// It show files and folders in the current path
|
||||
// User can click on path to select or deselect it
|
||||
// Doubleclick on path will open it
|
||||
// Also doubleclick on file will select this file and close dialog
|
||||
var browserPathDiv = $('<div></div>').addClass('ui-widget-content').css({'float': 'right', 'overflow': 'auto'}).appendTo(browserDlg);
|
||||
|
||||
|
||||
// Now everything is done
|
||||
// When user will be ready - he just click on the area you select for this plugin and dialog will appear
|
||||
$(this).click(function() {
|
||||
privateConfig.browserHistory = [];
|
||||
var startpath = removeBackPath(config.onLoad());
|
||||
|
||||
|
||||
startpath = startpath.split(config.separatorPath);
|
||||
startpath.pop();
|
||||
startpath = startpath.join(config.separatorPath);
|
||||
|
||||
|
||||
if(!checkBasePath(startpath)){
|
||||
startpath = config.basePath;
|
||||
}
|
||||
|
@ -208,7 +208,7 @@
|
|||
if(confPath.length > curPath.length)
|
||||
return false;
|
||||
var result = true;
|
||||
$.each(confPath, function(index, partConfPath) {
|
||||
$.each(confPath, function(index, partConfPath) {
|
||||
if(partConfPath != curPath[index]){
|
||||
result = false;
|
||||
}
|
||||
|
@ -223,7 +223,7 @@
|
|||
var confPath = config.basePath.split(config.separatorPath);
|
||||
var curPath = path.split(config.separatorPath);
|
||||
var newcurPath = [];
|
||||
$.each(curPath, function(index, partCurPath) {
|
||||
$.each(curPath, function(index, partCurPath) {
|
||||
if(partCurPath == ".."){
|
||||
newcurPath.pop();
|
||||
}else{
|
||||
|
@ -233,7 +233,7 @@
|
|||
return newcurPath.join(config.separatorPath);
|
||||
}
|
||||
|
||||
// This function will be called when user click 'Open'
|
||||
// This function will be called when user click 'Open'
|
||||
// It check if any path is selected, and call config.onSelect function with path list
|
||||
function doneOk(){
|
||||
var newCurPath = [];
|
||||
|
@ -243,7 +243,7 @@
|
|||
if(newCurPath.length == 0) {
|
||||
newCurPath.push(privateConfig.browserHistory.pop());
|
||||
}
|
||||
|
||||
|
||||
if(config.multiselect)
|
||||
config.onSelect(newCurPath);
|
||||
else {
|
||||
|
@ -256,7 +256,7 @@
|
|||
}
|
||||
browserDlg.dialog("close");
|
||||
}
|
||||
|
||||
|
||||
// Function recalculate and set new width and height for left and right div elements
|
||||
// height have '-2' because of the borders
|
||||
// width have '-4' because of a border an 2 pixels space between divs
|
||||
|
@ -331,22 +331,22 @@
|
|||
// If path is not under 'config.basePath', alert will be shown and nothing will be opened
|
||||
function loadPath(path) {
|
||||
privateConfig.selectedItems = [];
|
||||
|
||||
|
||||
// First we need to remove all '..' parts of the path
|
||||
path = removeBackPath(path);
|
||||
|
||||
|
||||
// Then we need to check, if path based on 'config.basePath'
|
||||
if(!checkBasePath(path)) {
|
||||
alert('Path should be based from ' + config.basePath);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Then we can put this path into history
|
||||
privateConfig.browserHistory.push(path);
|
||||
|
||||
|
||||
// Show it to user
|
||||
enterText.val(path);
|
||||
|
||||
|
||||
// And load
|
||||
$.ajax({
|
||||
url: config.handlerUrl,
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
}
|
||||
});
|
||||
|
||||
/*
|
||||
/*
|
||||
* Timepicker manager.
|
||||
* Use the singleton instance of this class, $.datetimepicker, to interact with the time picker.
|
||||
* Settings for (groups of) time pickers are maintained in an instance object,
|
||||
|
@ -150,7 +150,7 @@
|
|||
support: {},
|
||||
control: null,
|
||||
|
||||
/*
|
||||
/*
|
||||
* Override the default settings for all instances of the time picker.
|
||||
* @param settings object - the new settings to use as defaults (anonymous object)
|
||||
* @return the manager object
|
||||
|
@ -223,8 +223,8 @@
|
|||
|
||||
// detect which units are supported
|
||||
tp_inst.support = detectSupport(
|
||||
tp_inst._defaults.timeFormat +
|
||||
(tp_inst._defaults.pickerTimeFormat? tp_inst._defaults.pickerTimeFormat:'') +
|
||||
tp_inst._defaults.timeFormat +
|
||||
(tp_inst._defaults.pickerTimeFormat? tp_inst._defaults.pickerTimeFormat:'') +
|
||||
(tp_inst._defaults.altTimeFormat? tp_inst._defaults.altTimeFormat:''));
|
||||
|
||||
// controlType is string - key to our this._controls
|
||||
|
@ -235,7 +235,7 @@
|
|||
tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType];
|
||||
}
|
||||
// controlType is an object and must implement create, options, value methods
|
||||
else{
|
||||
else{
|
||||
tp_inst.control = tp_inst._defaults.controlType;
|
||||
}
|
||||
|
||||
|
@ -255,17 +255,17 @@
|
|||
tp_inst._defaults.timezoneList = timezoneList;
|
||||
|
||||
// set the default units
|
||||
tp_inst.timezone = tp_inst._defaults.timezone !== null? $.datetimepicker.timezoneOffsetNumber(tp_inst._defaults.timezone) :
|
||||
tp_inst.timezone = tp_inst._defaults.timezone !== null? $.datetimepicker.timezoneOffsetNumber(tp_inst._defaults.timezone) :
|
||||
((new Date()).getTimezoneOffset()*-1);
|
||||
tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin? tp_inst._defaults.hourMin :
|
||||
tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin? tp_inst._defaults.hourMin :
|
||||
tp_inst._defaults.hour > tp_inst._defaults.hourMax? tp_inst._defaults.hourMax : tp_inst._defaults.hour;
|
||||
tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin? tp_inst._defaults.minuteMin :
|
||||
tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin? tp_inst._defaults.minuteMin :
|
||||
tp_inst._defaults.minute > tp_inst._defaults.minuteMax? tp_inst._defaults.minuteMax : tp_inst._defaults.minute;
|
||||
tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin? tp_inst._defaults.secondMin :
|
||||
tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin? tp_inst._defaults.secondMin :
|
||||
tp_inst._defaults.second > tp_inst._defaults.secondMax? tp_inst._defaults.secondMax : tp_inst._defaults.second;
|
||||
tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin? tp_inst._defaults.millisecMin :
|
||||
tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin? tp_inst._defaults.millisecMin :
|
||||
tp_inst._defaults.millisec > tp_inst._defaults.millisecMax? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec;
|
||||
tp_inst.microsec = tp_inst._defaults.microsec < tp_inst._defaults.microsecMin? tp_inst._defaults.microsecMin :
|
||||
tp_inst.microsec = tp_inst._defaults.microsec < tp_inst._defaults.microsecMin? tp_inst._defaults.microsecMin :
|
||||
tp_inst._defaults.microsec > tp_inst._defaults.microsecMax? tp_inst._defaults.microsecMax : tp_inst._defaults.microsec;
|
||||
tp_inst.ampm = '';
|
||||
tp_inst.$input = $input;
|
||||
|
@ -369,7 +369,7 @@
|
|||
// Prevent displaying twice
|
||||
if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) {
|
||||
var noDisplay = ' style="display:none;"',
|
||||
html = '<div class="ui-timepicker-div'+ (o.isRTL? ' ui-timepicker-rtl' : '') +'"><dl>' + '<dt class="ui_tpicker_time_label"' + ((o.showTime) ? '' : noDisplay) + '>' + o.timeText + '</dt>' +
|
||||
html = '<div class="ui-timepicker-div'+ (o.isRTL? ' ui-timepicker-rtl' : '') +'"><dl>' + '<dt class="ui_tpicker_time_label"' + ((o.showTime) ? '' : noDisplay) + '>' + o.timeText + '</dt>' +
|
||||
'<dd class="ui_tpicker_time"' + ((o.showTime) ? '' : noDisplay) + '></dd>';
|
||||
|
||||
// Create the markup
|
||||
|
@ -384,7 +384,7 @@
|
|||
max[litem] = parseInt((o[litem+'Max'] - ((o[litem+'Max'] - o[litem+'Min']) % o['step'+uitem])), 10);
|
||||
gridSize[litem] = 0;
|
||||
|
||||
html += '<dt class="ui_tpicker_'+ litem +'_label"' + (show ? '' : noDisplay) + '>' + o[litem +'Text'] + '</dt>' +
|
||||
html += '<dt class="ui_tpicker_'+ litem +'_label"' + (show ? '' : noDisplay) + '>' + o[litem +'Text'] + '</dt>' +
|
||||
'<dd class="ui_tpicker_'+ litem +'"><div class="ui_tpicker_'+ litem +'_slider"' + (show ? '' : noDisplay) + '></div>';
|
||||
|
||||
if (show && o[litem+'Grid'] > 0) {
|
||||
|
@ -393,7 +393,7 @@
|
|||
if(litem == 'hour'){
|
||||
for (var h = o[litem+'Min']; h <= max[litem]; h += parseInt(o[litem+'Grid'], 10)) {
|
||||
gridSize[litem]++;
|
||||
var tmph = $.datepicker.formatTime(this.support.ampm? 'hht':'HH', {hour:h}, o);
|
||||
var tmph = $.datepicker.formatTime(this.support.ampm? 'hht':'HH', {hour:h}, o);
|
||||
html += '<td data-for="'+litem+'">' + tmph + '</td>';
|
||||
}
|
||||
}
|
||||
|
@ -408,7 +408,7 @@
|
|||
}
|
||||
html += '</dd>';
|
||||
}
|
||||
|
||||
|
||||
// Timezone
|
||||
var showTz = o.showTimezone !== null? o.showTimezone : this.support.timezone;
|
||||
html += '<dt class="ui_tpicker_timezone_label"' + (showTz ? '' : noDisplay) + '>' + o.timezoneText + '</dt>';
|
||||
|
@ -423,7 +423,7 @@
|
|||
$tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all">' + '<div class="ui-datepicker-title">' + o.timeOnlyTitle + '</div>' + '</div>');
|
||||
$dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide();
|
||||
}
|
||||
|
||||
|
||||
// add sliders, adjust grids, add events
|
||||
for(i=0,l=tp_inst.units.length; i<l; i++){
|
||||
litem = tp_inst.units[i];
|
||||
|
@ -458,7 +458,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
tp_inst.control.value(tp_inst, tp_inst[f+'_slider'], litem, n);
|
||||
|
||||
tp_inst._onTimeChange();
|
||||
|
@ -497,7 +497,7 @@
|
|||
tp_inst._onSelectHandler();
|
||||
});
|
||||
// End timezone options
|
||||
|
||||
|
||||
// inject timepicker into datepicker
|
||||
var $buttonPanel = $dp.find('.ui-datepicker-buttonpane');
|
||||
if ($buttonPanel.length) {
|
||||
|
@ -519,7 +519,7 @@
|
|||
var sliderAccessArgs = this._defaults.sliderAccessArgs,
|
||||
rtl = this._defaults.isRTL;
|
||||
sliderAccessArgs.isRTL = rtl;
|
||||
|
||||
|
||||
setTimeout(function() { // fix for inline mode
|
||||
if ($tp.find('.ui-slider-access').length === 0) {
|
||||
$tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs);
|
||||
|
@ -756,8 +756,8 @@
|
|||
|
||||
// If the update was done in the input field, the input field should not be updated.
|
||||
// If the update was done using the sliders, update the input field.
|
||||
var hasChanged = (hour != this.hour || minute != this.minute || second != this.second || millisec != this.millisec || microsec != this.microsec
|
||||
|| (this.ampm.length > 0 && (hour < 12) != ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1))
|
||||
var hasChanged = (hour != this.hour || minute != this.minute || second != this.second || millisec != this.millisec || microsec != this.microsec
|
||||
|| (this.ampm.length > 0 && (hour < 12) != ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1))
|
||||
|| (this.timezone !== null && timezone != this.timezone));
|
||||
|
||||
if (hasChanged) {
|
||||
|
@ -832,7 +832,7 @@
|
|||
timeAvailable = dt !== null && this.timeDefined;
|
||||
this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg);
|
||||
var formattedDateTime = this.formattedDate;
|
||||
|
||||
|
||||
// if a slider was changed but datepicker doesn't have a value yet, set it
|
||||
if(dp_inst.lastVal===""){
|
||||
dp_inst.currentYear=dp_inst.selectedYear;
|
||||
|
@ -842,7 +842,7 @@
|
|||
|
||||
/*
|
||||
* remove following lines to force every changes in date picker to change the input value
|
||||
* Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker.
|
||||
* Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker.
|
||||
* If the user manually empty the value in the input field, the date picker will never change selected value.
|
||||
*/
|
||||
//if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) {
|
||||
|
@ -867,7 +867,7 @@
|
|||
var altFormattedDateTime = '',
|
||||
altSeparator = this._defaults.altSeparator ? this._defaults.altSeparator : this._defaults.separator,
|
||||
altTimeSuffix = this._defaults.altTimeSuffix ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;
|
||||
|
||||
|
||||
if(!this._defaults.timeOnly){
|
||||
if (this._defaults.altFormat){
|
||||
altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg);
|
||||
|
@ -934,7 +934,7 @@
|
|||
stop: function(event, ui) {
|
||||
tp_inst._onSelectHandler();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
options: function(tp_inst, obj, unit, opts, val){
|
||||
if(tp_inst._defaults.isRTL){
|
||||
|
@ -947,7 +947,7 @@
|
|||
}
|
||||
return obj.slider(opts);
|
||||
}
|
||||
var min = opts.min,
|
||||
var min = opts.min,
|
||||
max = opts.max;
|
||||
opts.min = opts.max = null;
|
||||
if(min !== undefined){
|
||||
|
@ -982,7 +982,7 @@
|
|||
var sel = '<select class="ui-timepicker-select" data-unit="'+ unit +'" data-min="'+ min +'" data-max="'+ max +'" data-step="'+ step +'">',
|
||||
format = tp_inst._defaults.pickerTimeFormat || tp_inst._defaults.timeFormat;
|
||||
|
||||
for(var i=min; i<=max; i+=step){
|
||||
for(var i=min; i<=max; i+=step){
|
||||
sel += '<option value="'+ i +'"'+ (i==val? ' selected':'') +'>';
|
||||
if(unit == 'hour'){
|
||||
sel += $.datepicker.formatTime($.trim(format.replace(/[^ht ]/ig,'')), {hour:i}, tp_inst._defaults);
|
||||
|
@ -1009,7 +1009,7 @@
|
|||
if(val === undefined){
|
||||
return $t.data(opts);
|
||||
}
|
||||
o[opts] = val;
|
||||
o[opts] = val;
|
||||
}
|
||||
else{ o = opts; }
|
||||
return tp_inst.control.create(tp_inst, obj, $t.data('unit'), $t.val(), o.min || $t.data('min'), o.max || $t.data('max'), o.step || $t.data('step'));
|
||||
|
@ -1087,7 +1087,7 @@
|
|||
/*
|
||||
* Public utility to parse time
|
||||
*/
|
||||
$.datepicker.parseTime = function(timeFormat, timeString, options) {
|
||||
$.datepicker.parseTime = function(timeFormat, timeString, options) {
|
||||
var o = extendRemove(extendRemove({}, $.datetimepicker._defaults), options || {}),
|
||||
iso8601 = (timeFormat.replace(/\'.*?\'/g,'').indexOf('Z') !== -1);
|
||||
|
||||
|
@ -1237,11 +1237,11 @@
|
|||
}
|
||||
catch(err2){
|
||||
$.datetimepicker.log("Unable to parse \ntimeString: "+ s +"\ntimeFormat: "+ f);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}; // end looseParse
|
||||
|
||||
|
||||
if(typeof o.parse === "function"){
|
||||
return o.parse(timeFormat, timeString, o);
|
||||
}
|
||||
|
@ -1302,9 +1302,9 @@
|
|||
return $.datetimepicker.timezoneOffsetString(time.timezone === null? options.timezone : time.timezone, false);
|
||||
case 'Z':
|
||||
return $.datetimepicker.timezoneOffsetString(time.timezone === null? options.timezone : time.timezone, true);
|
||||
case 'T':
|
||||
case 'T':
|
||||
return ampmName.charAt(0).toUpperCase();
|
||||
case 'TT':
|
||||
case 'TT':
|
||||
return ampmName.toUpperCase();
|
||||
case 't':
|
||||
return ampmName.charAt(0).toLowerCase();
|
||||
|
@ -1377,7 +1377,7 @@
|
|||
if (tp_inst) {
|
||||
if ($.datepicker._get(inst, 'constrainInput')) {
|
||||
var ampm = tp_inst.support.ampm,
|
||||
tz = tp_inst._defaults.showTimezone !== null? tp_inst._defaults.showTimezone : tp_inst.support.timezone,
|
||||
tz = tp_inst._defaults.showTimezone !== null? tp_inst._defaults.showTimezone : tp_inst.support.timezone,
|
||||
dateChars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')),
|
||||
datetimeChars = tp_inst._defaults.timeFormat.toString()
|
||||
.replace(/[hms]/g, '')
|
||||
|
@ -1386,11 +1386,11 @@
|
|||
.replace(/tT/g, ampm ? 'AaPpMm' : '')
|
||||
.replace(/T/g, ampm ? 'AP' : '')
|
||||
.replace(/tt/g, ampm ? 'apm' : '')
|
||||
.replace(/t/g, ampm ? 'ap' : '') +
|
||||
" " + tp_inst._defaults.separator +
|
||||
tp_inst._defaults.timeSuffix +
|
||||
(tz ? tp_inst._defaults.timezoneList.join('') : '') +
|
||||
(tp_inst._defaults.amNames.join('')) + (tp_inst._defaults.pmNames.join('')) +
|
||||
.replace(/t/g, ampm ? 'ap' : '') +
|
||||
" " + tp_inst._defaults.separator +
|
||||
tp_inst._defaults.timeSuffix +
|
||||
(tz ? tp_inst._defaults.timezoneList.join('') : '') +
|
||||
(tp_inst._defaults.amNames.join('')) + (tp_inst._defaults.pmNames.join('')) +
|
||||
dateChars,
|
||||
chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);
|
||||
return event.ctrlKey || (chr < ' ' || !dateChars || datetimeChars.indexOf(chr) > -1);
|
||||
|
@ -1413,11 +1413,11 @@
|
|||
var altFormat = tp_inst._defaults.altFormat || tp_inst._defaults.dateFormat,
|
||||
date = this._getDate(inst),
|
||||
formatCfg = $.datepicker._getFormatConfig(inst),
|
||||
altFormattedDateTime = '',
|
||||
altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator,
|
||||
altFormattedDateTime = '',
|
||||
altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator,
|
||||
altTimeSuffix = tp_inst._defaults.altTimeSuffix ? tp_inst._defaults.altTimeSuffix : tp_inst._defaults.timeSuffix,
|
||||
altTimeFormat = tp_inst._defaults.altTimeFormat !== null ? tp_inst._defaults.altTimeFormat : tp_inst._defaults.timeFormat;
|
||||
|
||||
|
||||
altFormattedDateTime += $.datepicker.formatTime(altTimeFormat, tp_inst, tp_inst._defaults) + altTimeSuffix;
|
||||
if(!tp_inst._defaults.timeOnly && !tp_inst._defaults.altFieldTimeOnly && date !== null){
|
||||
if(tp_inst._defaults.altFormat){
|
||||
|
@ -1518,7 +1518,7 @@
|
|||
tp_inst.millisec = date ? date.getMilliseconds() : defaults.millisec;
|
||||
tp_inst.microsec = date ? date.getMicroseconds() : defaults.microsec;
|
||||
|
||||
//check if within min/max times..
|
||||
//check if within min/max times..
|
||||
tp_inst._limitMinMaxDateTime(inst, true);
|
||||
|
||||
tp_inst._onTimeChange();
|
||||
|
@ -1584,9 +1584,9 @@
|
|||
} else {
|
||||
tp_date = date;
|
||||
}
|
||||
|
||||
// This is important if you are using the timezone option, javascript's Date
|
||||
// object will only return the timezone offset for the current locale, so we
|
||||
|
||||
// This is important if you are using the timezone option, javascript's Date
|
||||
// object will only return the timezone offset for the current locale, so we
|
||||
// adjust it accordingly. If not using timezone option this won't matter..
|
||||
// If a timezone is different in tp, keep the timezone as is
|
||||
if(tp_inst){
|
||||
|
@ -1626,8 +1626,8 @@
|
|||
date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
|
||||
date.setMicroseconds(tp_inst.microsec);
|
||||
|
||||
// This is important if you are using the timezone option, javascript's Date
|
||||
// object will only return the timezone offset for the current locale, so we
|
||||
// This is important if you are using the timezone option, javascript's Date
|
||||
// object will only return the timezone offset for the current locale, so we
|
||||
// adjust it accordingly. If not using timezone option this won't matter..
|
||||
if(tp_inst.timezone != null){
|
||||
// look out for DST if tz wasn't specified
|
||||
|
@ -1760,7 +1760,7 @@
|
|||
}
|
||||
return this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* jQuery isEmptyObject does not check hasOwnProperty - if someone has added to the object prototype,
|
||||
* it will return false for all objects
|
||||
|
@ -1795,7 +1795,7 @@
|
|||
var detectSupport = function(timeFormat){
|
||||
var tf = timeFormat.replace(/\'.*?\'/g,'').toLowerCase(), // removes literals
|
||||
isIn = function(f, t){ // does the format contain the token?
|
||||
return f.indexOf(t) !== -1? true:false;
|
||||
return f.indexOf(t) !== -1? true:false;
|
||||
};
|
||||
return {
|
||||
hour: isIn(tf,'h'),
|
||||
|
@ -1832,7 +1832,7 @@
|
|||
*/
|
||||
var splitDateTime = function(dateFormat, dateTimeString, dateSettings, timeSettings) {
|
||||
try {
|
||||
// The idea is to get the number separator occurrences in datetime and the time format requested (since time has
|
||||
// The idea is to get the number separator occurrences in datetime and the time format requested (since time has
|
||||
// fewer unknowns, mostly numbers and am/pm). We will use the time pattern to split.
|
||||
var separator = timeSettings && timeSettings.separator ? timeSettings.separator : $.datetimepicker._defaults.separator,
|
||||
format = timeSettings && timeSettings.timeFormat ? timeSettings.timeFormat : $.datetimepicker._defaults.timeFormat,
|
||||
|
@ -1931,7 +1931,7 @@
|
|||
hours = (off - minutes) / 60,
|
||||
iso = iso8601? ':':'',
|
||||
tz = (off >= 0 ? '+' : '-') + ('0' + (hours * 101).toString()).slice(-2) + iso + ('0' + (minutes * 101).toString()).slice(-2);
|
||||
|
||||
|
||||
if(tz == '+00:00'){
|
||||
return 'Z';
|
||||
}
|
||||
|
@ -2083,7 +2083,7 @@
|
|||
var date = changed[method].call(changed, 'getDate');
|
||||
if(date !== null && options.minInterval > 0){
|
||||
if(option == 'minDate'){
|
||||
date.setMilliseconds(date.getMilliseconds() + options.minInterval);
|
||||
date.setMilliseconds(date.getMilliseconds() + options.minInterval);
|
||||
}
|
||||
if(option == 'maxDate'){
|
||||
date.setMilliseconds(date.getMilliseconds() - options.minInterval);
|
||||
|
@ -2113,7 +2113,7 @@
|
|||
if(!Date.prototype.getMicroseconds){
|
||||
Date.prototype.microseconds = 0;
|
||||
Date.prototype.getMicroseconds = function(){ return this.microseconds; };
|
||||
Date.prototype.setMicroseconds = function(m){
|
||||
Date.prototype.setMicroseconds = function(m){
|
||||
this.setMilliseconds(this.getMilliseconds() + Math.floor(m/1000));
|
||||
this.microseconds = m%1000;
|
||||
return this;
|
||||
|
|
|
@ -115,7 +115,7 @@
|
|||
showHours: true, // display the hours section of the dialog
|
||||
showMinutes: true, // display the minute section of the dialog
|
||||
optionalMinutes: false, // optionally parse inputs of whole hours with minutes omitted
|
||||
|
||||
|
||||
// buttons
|
||||
showCloseButton: false, // shows an OK button to confirm the edit
|
||||
showNowButton: false, // Shows the 'now' button
|
||||
|
@ -229,7 +229,7 @@
|
|||
case 13:
|
||||
$.timepicker._updateSelectedValue(inst);
|
||||
$.timepicker._hideTimepicker();
|
||||
|
||||
|
||||
return false; // don't submit the form
|
||||
break; // select the value on enter
|
||||
case 27: $.timepicker._hideTimepicker();
|
||||
|
@ -507,7 +507,7 @@
|
|||
showDeselectButton = this._get(inst, 'showDeselectButton'),
|
||||
deselectButtonText = this._get(inst, 'deselectButtonText'),
|
||||
showButtonPanel = showCloseButton || showNowButton || showDeselectButton;
|
||||
|
||||
|
||||
|
||||
|
||||
// prepare all hours and minutes, makes it easier to distribute by rows
|
||||
|
@ -525,7 +525,7 @@
|
|||
pmItems++;
|
||||
}
|
||||
}
|
||||
hourCounter = 0;
|
||||
hourCounter = 0;
|
||||
|
||||
amRows = Math.floor(amItems / hours.length * rows);
|
||||
pmRows = Math.floor(pmItems / hours.length * rows);
|
||||
|
@ -584,7 +584,7 @@
|
|||
html += this._generateHTMLMinutes(inst);
|
||||
html += '</td>';
|
||||
}
|
||||
|
||||
|
||||
html += '</tr>';
|
||||
|
||||
|
||||
|
@ -682,7 +682,7 @@
|
|||
minuteLabel +
|
||||
'</div>' +
|
||||
'<table class="ui-timepicker">';
|
||||
|
||||
|
||||
minuteCounter = 0;
|
||||
for (row = 1; row <= rows; row++) {
|
||||
html += '<tr>';
|
||||
|
@ -792,7 +792,7 @@
|
|||
var $target = $(target),
|
||||
target_id = $target.attr('id'),
|
||||
inst = $.data(target, PROP_NAME);
|
||||
|
||||
|
||||
if (!$target.hasClass(this.markerClassName)) {
|
||||
return;
|
||||
}
|
||||
|
@ -1102,7 +1102,7 @@
|
|||
retVal.hours = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return retVal;
|
||||
},
|
||||
|
||||
|
@ -1151,7 +1151,7 @@
|
|||
// added for onMinuteShow callback
|
||||
var onMinuteShow = this._get(inst, 'onMinuteShow');
|
||||
if (onMinuteShow) {
|
||||
// this will trigger a callback on selected hour to make sure selected minute is allowed.
|
||||
// this will trigger a callback on selected hour to make sure selected minute is allowed.
|
||||
this._updateMinuteDisplay(inst);
|
||||
}
|
||||
|
||||
|
@ -1205,7 +1205,7 @@
|
|||
this._updateAlternate(inst, newTime);
|
||||
return newTime;
|
||||
},
|
||||
|
||||
|
||||
/* this function process selected time and return it parsed according to instance options */
|
||||
_getParsedTime: function(inst) {
|
||||
|
||||
|
@ -1228,7 +1228,7 @@
|
|||
displayHours = selectedHours ? selectedHours : 0,
|
||||
parsedTime = '';
|
||||
|
||||
if (showPeriod) {
|
||||
if (showPeriod) {
|
||||
if (inst.hours == 0) {
|
||||
displayHours = 12;
|
||||
}
|
||||
|
@ -1261,10 +1261,10 @@
|
|||
if (showHours) {
|
||||
if (period.length > 0) { parsedTime += this._get(inst, 'periodSeparator') + period; }
|
||||
}
|
||||
|
||||
|
||||
return parsedTime;
|
||||
},
|
||||
|
||||
|
||||
/* Update any alternate field to synchronise with the main field. */
|
||||
_updateAlternate: function(inst, newTime) {
|
||||
var altField = this._get(inst, 'altField');
|
||||
|
|
|
@ -6,9 +6,9 @@ denise@denise-DX4860:~/airtime/legacy/public/js/tipsy$ diff -u jquery.tipsy_orig
|
|||
--- jquery.tipsy_orig.js 2012-12-13 12:03:48.780751104 -0500
|
||||
+++ jquery.tipsy.js 2012-12-13 12:08:15.564761493 -0500
|
||||
@@ -173,12 +173,10 @@
|
||||
|
||||
|
||||
if (!options.live) this.each(function() { get(this); });
|
||||
|
||||
|
||||
- if (options.trigger != 'manual') {
|
||||
- var binder = options.live ? 'live' : 'bind',
|
||||
- eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
|
||||
|
@ -19,5 +19,5 @@ denise@denise-DX4860:~/airtime/legacy/public/js/tipsy$ diff -u jquery.tipsy_orig
|
|||
+ eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
|
||||
+ eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
|
||||
+ this[binder](eventIn, enter)[binder](eventOut, leave);
|
||||
|
||||
|
||||
return this;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue