Merge branch 'master' of dev.sourcefabric.org:airtime
|
@ -30,6 +30,21 @@ var i18n_months = [
|
|||
$.i18n._("December")
|
||||
];
|
||||
|
||||
var i18n_months_short = [
|
||||
$.i18n._("Jan"),
|
||||
$.i18n._("Feb"),
|
||||
$.i18n._("Mar"),
|
||||
$.i18n._("Apr"),
|
||||
$.i18n._("May"),
|
||||
$.i18n._("Jun"),
|
||||
$.i18n._("Jul"),
|
||||
$.i18n._("Aug"),
|
||||
$.i18n._("Sep"),
|
||||
$.i18n._("Oct"),
|
||||
$.i18n._("Nov"),
|
||||
$.i18n._("Dec")
|
||||
];
|
||||
|
||||
var i18n_days_short = [
|
||||
$.i18n._("Su"),
|
||||
$.i18n._("Mo"),
|
||||
|
|
|
@ -172,7 +172,7 @@ function updatePlaybar(){
|
|||
|
||||
$('#time-elapsed').text(convertToHHMMSS(approximateServerTime - songStartRoughly));
|
||||
$('#time-remaining').text(convertToHHMMSS(songEndRoughly - approximateServerTime));
|
||||
$('#song-length').text(convertToHHMMSSmm(currentSong.songLengthMs));
|
||||
$('#song-length').text(convertToHHMMSS(currentSong.songLengthMs));
|
||||
}
|
||||
/* Column 1 update */
|
||||
$('#playlist').text($.i18n._("Current Show:"));
|
||||
|
@ -488,13 +488,13 @@ $(document).ready(function() {
|
|||
setCurrentUserPseudoPassword();
|
||||
}
|
||||
|
||||
$('#current-user').live('click', function() {
|
||||
$('body').on('click','#current-user', function() {
|
||||
$.ajax({
|
||||
url: baseUrl+'user/edit-user/format/json'
|
||||
});
|
||||
});
|
||||
|
||||
$('#cu_save_user').live('click', function() {
|
||||
$('body').on('click', '#cu_save_user', function() {
|
||||
$.cookie("airtime_locale", $('#cu_locale').val(), {path: '/'});
|
||||
});
|
||||
|
||||
|
|
|
@ -73,10 +73,7 @@ function convertToHHMMSS(timeInMS){
|
|||
minutes = "0" + minutes;
|
||||
if (seconds.length == 1)
|
||||
seconds = "0" + seconds;
|
||||
if (hours == "00")
|
||||
return minutes + ":" + seconds;
|
||||
else
|
||||
return hours + ":" + minutes + ":" + seconds;
|
||||
return hours + ":" + minutes + ":" + seconds;
|
||||
}
|
||||
|
||||
function convertToHHMMSSmm(timeInMS){
|
||||
|
|
|
@ -1102,16 +1102,16 @@ function closeDialogLibrary(event, ui) {
|
|||
|
||||
function checkImportStatus() {
|
||||
$.getJSON(baseUrl+'Preference/is-import-in-progress', function(data){
|
||||
var div = $('#import_status');
|
||||
var $div = $('#import_status');
|
||||
var table = $('#library_display').dataTable();
|
||||
if (data == true){
|
||||
div.show();
|
||||
$div.show();
|
||||
}
|
||||
else{
|
||||
if ($(div).is(':visible')) {
|
||||
if ($div.is(':visible')) {
|
||||
table.fnStandingRedraw();
|
||||
}
|
||||
div.hide();
|
||||
$div.hide();
|
||||
}
|
||||
setTimeout(checkImportStatus, 5000);
|
||||
});
|
||||
|
|
|
@ -0,0 +1,167 @@
|
|||
var AIRTIME = (function(AIRTIME) {
|
||||
var mod;
|
||||
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 =
|
||||
"<li " +
|
||||
"data-name='<%= name %>' " +
|
||||
"data-type='<%= type %>' " +
|
||||
"data-filemd='<%= filemd %>'" +
|
||||
"data-label='<%= label %>'" +
|
||||
"class='<%= (filemd) ? 'field_filemd' : 'field_other' %>'" +
|
||||
">" +
|
||||
"<span><%= label %></span>" +
|
||||
"<span><%= type %></span>" +
|
||||
"</li>";
|
||||
|
||||
var templateOptional =
|
||||
"<li " +
|
||||
"data-name='<%= name %>' " +
|
||||
"data-type='<%= type %>' " +
|
||||
"data-filemd='<%= filemd %>'" +
|
||||
"data-label='<%= label %>'" +
|
||||
"class='<%= (filemd) ? 'field_filemd' : 'field_other' %>'" +
|
||||
">" +
|
||||
"<span><%= label %></span>" +
|
||||
"<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) {
|
||||
//can only use small letters to avoid DB query problems.
|
||||
charSet = charSet || 'abcdefghijklmnopqrstuvwxyz';
|
||||
var randomString = '';
|
||||
for (var i = 0; i < len; i++) {
|
||||
var randomPoz = Math.floor(Math.random() * charSet.length);
|
||||
randomString += charSet.substring(randomPoz,randomPoz+1);
|
||||
}
|
||||
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"),
|
||||
type: $li.data("type"),
|
||||
label: $li.data("label"),
|
||||
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,
|
||||
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"),
|
||||
url = baseUrl+"Playouthistorytemplate/set-template-default/format/json";
|
||||
|
||||
$btn.remove();
|
||||
$.post(url, {id: template_id});
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
return AIRTIME;
|
||||
|
||||
}(AIRTIME || {}));
|
||||
|
||||
$(document).ready(AIRTIME.itemTemplate.onReady);
|
|
@ -1,32 +1,3 @@
|
|||
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"
|
||||
}else{
|
||||
filename = filename+".csv"
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
|
||||
function setFlashFileName( nButton, oConfig, oFlash ) {
|
||||
var filename = getFileName(oConfig.sExtends)
|
||||
oFlash.setFileName( filename );
|
||||
if(oConfig.sExtends == "pdf"){
|
||||
this.fnSetText( oFlash,
|
||||
"title:"+ this.fnGetTitle(oConfig) +"\n"+
|
||||
"message:"+ oConfig.sPdfMessage +"\n"+
|
||||
"colWidth:"+ this.fnCalcColRatios(oConfig) +"\n"+
|
||||
"orientation:"+ oConfig.sPdfOrientation +"\n"+
|
||||
"size:"+ oConfig.sPdfSize +"\n"+
|
||||
"--/TableToolsOpts--\n" +
|
||||
this.fnGetTableData(oConfig));
|
||||
}else{
|
||||
this.fnSetText( oFlash,
|
||||
this.fnGetTableData(oConfig));
|
||||
}
|
||||
}
|
||||
|
||||
var AIRTIME = (function(AIRTIME) {
|
||||
var mod;
|
||||
|
||||
|
@ -35,167 +6,822 @@ var AIRTIME = (function(AIRTIME) {
|
|||
}
|
||||
mod = AIRTIME.history;
|
||||
|
||||
mod.historyTable = function() {
|
||||
var $historyContentDiv;
|
||||
|
||||
var oTableTools = {
|
||||
"sSwfPath": baseUrl+"js/datatables/plugin/TableTools-2.1.5/swf/copy_csv_xls_pdf.swf",
|
||||
"aButtons": [
|
||||
{
|
||||
"sExtends": "copy",
|
||||
"fnComplete": function(nButton, oConfig, oFlash, text) {
|
||||
var lines = text.split('\n').length,
|
||||
len = this.s.dt.nTFoot === null ? lines-1 : lines-2,
|
||||
plural = (len==1) ? "" : "s";
|
||||
alert(sprintf($.i18n._('Copied %s row%s to the clipboard'), len, plural));
|
||||
},
|
||||
//set because only the checkbox row is not sortable.
|
||||
"mColumns": "sortable"
|
||||
},
|
||||
{
|
||||
"sExtends": "csv",
|
||||
"fnClick": setFlashFileName,
|
||||
//set because only the checkbox row is not sortable.
|
||||
"mColumns": "sortable"
|
||||
},
|
||||
{
|
||||
"sExtends": "pdf",
|
||||
"fnClick": setFlashFileName,
|
||||
"sPdfOrientation": "landscape",
|
||||
//set because only the checkbox row is not sortable.
|
||||
"mColumns": "sortable"
|
||||
},
|
||||
{
|
||||
"sExtends": "print",
|
||||
"sInfo" : sprintf($.i18n._("%sPrint view%sPlease use your browser's print function to print this table. Press escape when finished."), "<h6>", "</h6><p>"),
|
||||
//set because only the checkbox row is not sortable.
|
||||
"mColumns": "sortable"
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
var lengthMenu = [[10, 25, 50, 100, 500, -1], [10, 25, 50, 100, 500, $.i18n._("All")]];
|
||||
|
||||
var sDom = 'l<"dt-process-rel"r><"H"T><"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 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,
|
||||
$input;
|
||||
|
||||
$.each($inputs, function(index, input) {
|
||||
$input = $(input);
|
||||
$input.prop('checked', true);
|
||||
$tr = $input.parents("tr");
|
||||
addSelectedLogItem($tr);
|
||||
});
|
||||
}
|
||||
|
||||
function deselectCurrentPage(e) {
|
||||
var $ctx = $(e.currentTarget).parents("div.dataTables_wrapper"),
|
||||
$inputs = $ctx.find(".his_checkbox").find("input"),
|
||||
$tr,
|
||||
$input;
|
||||
|
||||
$.each($inputs, function(index, input) {
|
||||
$input = $(input);
|
||||
$input.prop('checked', false);
|
||||
$tr = $input.parents("tr");
|
||||
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";
|
||||
}
|
||||
else {
|
||||
filename = filename+".csv";
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
|
||||
function setFlashFileName( nButton, oConfig, oFlash ) {
|
||||
var filename = getFileName(oConfig.sExtends);
|
||||
oFlash.setFileName( filename );
|
||||
|
||||
if (oConfig.sExtends == "pdf") {
|
||||
this.fnSetText( oFlash,
|
||||
"title:"+ this.fnGetTitle(oConfig) +"\n"+
|
||||
"message:"+ oConfig.sPdfMessage +"\n"+
|
||||
"colWidth:"+ this.fnCalcColRatios(oConfig) +"\n"+
|
||||
"orientation:"+ oConfig.sPdfOrientation +"\n"+
|
||||
"size:"+ oConfig.sPdfSize +"\n"+
|
||||
"--/TableToolsOpts--\n" +
|
||||
this.fnGetTableData(oConfig));
|
||||
}
|
||||
else {
|
||||
this.fnSetText(oFlash, this.fnGetTableData(oConfig));
|
||||
}
|
||||
}
|
||||
|
||||
/* 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} );
|
||||
}
|
||||
if (fnServerData.hasOwnProperty("end")) {
|
||||
aoData.push( { name: "end", value: fnServerData.end} );
|
||||
}
|
||||
if (fnServerData.hasOwnProperty("instance")) {
|
||||
aoData.push( { name: "instance_id", value: fnServerData.instance} );
|
||||
}
|
||||
|
||||
aoData.push( { name: "format", value: "json"} );
|
||||
|
||||
$.ajax( {
|
||||
"dataType": 'json',
|
||||
"type": "GET",
|
||||
"url": sSource,
|
||||
"data": aoData,
|
||||
"success": fnCallback
|
||||
} );
|
||||
}
|
||||
|
||||
function createShowAccordSection(config) {
|
||||
var template,
|
||||
$el;
|
||||
|
||||
template =
|
||||
"<h3>" +
|
||||
"<a href='#'>" +
|
||||
"<span class='show-title'><%= name %></span>" +
|
||||
"<span class='push-right'>" +
|
||||
"<span class='show-date'><%= date %></span>" +
|
||||
"<span class='show-time'><%= startTime %></span>" +
|
||||
"-" +
|
||||
"<span class='show-time'><%= endTime %></span>" +
|
||||
"</span>" +
|
||||
"</a>" +
|
||||
"</h3>" +
|
||||
"<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",
|
||||
'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,
|
||||
$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,
|
||||
date: tmp[0],
|
||||
startTime: tmp[1],
|
||||
endTime: show.ends.split(" ").pop()
|
||||
});
|
||||
|
||||
$showList.append($accordSection);
|
||||
}
|
||||
|
||||
$showList.accordion({
|
||||
animated: false,
|
||||
create: function( event, ui ) {
|
||||
var $div = $showList.find(".ui-accordion-content-active");
|
||||
createShowTable($div);
|
||||
},
|
||||
change: function( event, ui ) {
|
||||
var $div = $(ui.newContent);
|
||||
$(ui.oldContent).empty();
|
||||
createShowTable($div);
|
||||
selectedLogItems = {};
|
||||
}
|
||||
//changestart: function( event, ui ) {}
|
||||
});
|
||||
}
|
||||
|
||||
function createToolbarButtons ($el) {
|
||||
var $menu = $("<div class='btn-toolbar' />");
|
||||
|
||||
$menu.append("<div class='btn-group'>" +
|
||||
"<button class='btn btn-small dropdown-toggle' data-toggle='dropdown'>" +
|
||||
$.i18n._("Select")+" <span class='caret'></span>" +
|
||||
"</button>" +
|
||||
"<ul class='dropdown-menu'>" +
|
||||
"<li class='his-select-page'><a href='#'>"+$.i18n._("Select this page")+"</a></li>" +
|
||||
"<li class='his-dselect-page'><a href='#'>"+$.i18n._("Deselect this page")+"</a></li>" +
|
||||
"<li class='his-dselect-all'><a href='#'>"+$.i18n._("Deselect all")+"</a></li>" +
|
||||
"</ul>" +
|
||||
"</div>");
|
||||
|
||||
$menu.append("<div class='btn-group'>" +
|
||||
"<button class='btn btn-small' id='his_create'>" +
|
||||
"<i class='icon-white icon-plus'></i>" +
|
||||
$.i18n._("Create Entry") +
|
||||
"</button>" +
|
||||
"</div>");
|
||||
|
||||
$menu.append("<div class='btn-group'>" +
|
||||
"<button class='btn btn-small' id='his_trash'>" +
|
||||
"<i class='icon-white icon-trash'></i>" +
|
||||
"</button>" +
|
||||
"</div>");
|
||||
|
||||
$el.append($menu);
|
||||
}
|
||||
|
||||
function aggregateHistoryTable() {
|
||||
var oTable,
|
||||
historyContentDiv = $("#history_content"),
|
||||
historyTableDiv = historyContentDiv.find("#history_table"),
|
||||
tableHeight = historyContentDiv.height() - 200,
|
||||
fnServerData;
|
||||
|
||||
fnServerData = function ( sSource, aoData, fnCallback ) {
|
||||
|
||||
if (fnServerData.hasOwnProperty("start")) {
|
||||
aoData.push( { name: "start", value: fnServerData.start} );
|
||||
}
|
||||
if (fnServerData.hasOwnProperty("end")) {
|
||||
aoData.push( { name: "end", value: fnServerData.end} );
|
||||
}
|
||||
|
||||
aoData.push( { name: "format", value: "json"} );
|
||||
|
||||
$.ajax( {
|
||||
"dataType": 'json',
|
||||
"type": "GET",
|
||||
"url": sSource,
|
||||
"data": aoData,
|
||||
"success": fnCallback
|
||||
} );
|
||||
$historyTableDiv = $historyContentDiv.find("#history_table_aggregate"),
|
||||
columns,
|
||||
fnRowCallback;
|
||||
|
||||
fnRowCallback = function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
|
||||
var editUrl = baseUrl+"playouthistory/edit-file-item/id/"+aData.file_id,
|
||||
$nRow = $(nRow);
|
||||
|
||||
$nRow.data('url-edit', editUrl);
|
||||
};
|
||||
|
||||
oTable = historyTableDiv.dataTable( {
|
||||
columns = JSON.parse(localStorage.getItem('datatables-historyfile-aoColumns'));
|
||||
|
||||
oTable = $historyTableDiv.dataTable( {
|
||||
|
||||
"aoColumns": [
|
||||
{"sTitle": $.i18n._("Title"), "mDataProp": "title", "sClass": "his_title"}, /* Title */
|
||||
{"sTitle": $.i18n._("Creator"), "mDataProp": "artist", "sClass": "his_artist"}, /* Creator */
|
||||
{"sTitle": $.i18n._("Played"), "mDataProp": "played", "sClass": "his_artist"}, /* times played */
|
||||
{"sTitle": $.i18n._("Length"), "mDataProp": "length", "sClass": "his_length library_length"}, /* Length */
|
||||
{"sTitle": $.i18n._("Composer"), "mDataProp": "composer", "sClass": "his_composer"}, /* Composer */
|
||||
{"sTitle": $.i18n._("Copyright"), "mDataProp": "copyright", "sClass": "his_copyright"} /* Copyright */
|
||||
],
|
||||
"aoColumns": columns,
|
||||
|
||||
"bProcessing": true,
|
||||
"bServerSide": true,
|
||||
"sAjaxSource": baseUrl+"Playouthistory/playout-history-feed",
|
||||
"sAjaxSource": baseUrl+"playouthistory/file-history-feed",
|
||||
"sAjaxDataProp": "history",
|
||||
|
||||
"fnServerData": fnServerData,
|
||||
|
||||
"fnRowCallback": fnRowCallback,
|
||||
"oLanguage": datatables_dict,
|
||||
|
||||
"aLengthMenu": [[50, 100, 500, -1], [50, 100, 500, $.i18n._("All")]],
|
||||
"iDisplayLength": 50,
|
||||
|
||||
"aLengthMenu": lengthMenu,
|
||||
"iDisplayLength": 25,
|
||||
"sPaginationType": "full_numbers",
|
||||
"bJQueryUI": true,
|
||||
"bAutoWidth": true,
|
||||
|
||||
"sDom": 'lf<"dt-process-rel"r><"H"T><"dataTables_scrolling"t><"F"ip>',
|
||||
|
||||
"oTableTools": {
|
||||
"sSwfPath": baseUrl+"js/datatables/plugin/TableTools/swf/copy_cvs_xls_pdf.swf",
|
||||
"aButtons": [
|
||||
{
|
||||
"sExtends": "copy",
|
||||
"fnComplete": function(nButton, oConfig, oFlash, text) {
|
||||
var lines = text.split('\n').length,
|
||||
len = this.s.dt.nTFoot === null ? lines-1 : lines-2,
|
||||
plural = (len==1) ? "" : "s";
|
||||
alert(sprintf($.i18n._('Copied %s row%s to the clipboard'), len, plural));
|
||||
}
|
||||
},
|
||||
{
|
||||
"sExtends": "csv",
|
||||
"fnClick": setFlashFileName
|
||||
},
|
||||
{
|
||||
"sExtends": "pdf",
|
||||
"fnClick": setFlashFileName
|
||||
},
|
||||
{
|
||||
"sExtends": "print",
|
||||
"sInfo" : sprintf($.i18n._("%sPrint view%sPlease use your browser's print function to print this table. Press escape when finished."), "<h6>", "</h6><p>")
|
||||
}
|
||||
]
|
||||
"sDom": sDom,
|
||||
"oTableTools": oTableTools
|
||||
});
|
||||
oTable.fnSetFilteringDelay(350);
|
||||
|
||||
return oTable;
|
||||
}
|
||||
|
||||
function itemHistoryTable(id) {
|
||||
var oTable,
|
||||
$historyTableDiv = $historyContentDiv.find("#"+id),
|
||||
$toolbar,
|
||||
columns,
|
||||
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"];
|
||||
}
|
||||
}
|
||||
|
||||
fnRowCallback = function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
|
||||
var editUrl = baseUrl+"playouthistory/edit-list-item/id/"+aData.history_id,
|
||||
deleteUrl = baseUrl+"playouthistory/delete-list-item/id/"+aData.history_id,
|
||||
emptyCheckBox = String.fromCharCode(parseInt(2610, 16)),
|
||||
checkedCheckBox = String.fromCharCode(parseInt(2612, 16)),
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
||||
oTable = $historyTableDiv.dataTable( {
|
||||
|
||||
"aoColumns": columns,
|
||||
"bProcessing": true,
|
||||
"bServerSide": true,
|
||||
"sAjaxSource": baseUrl+"playouthistory/item-history-feed",
|
||||
"sAjaxDataProp": "history",
|
||||
"fnServerData": fnServerData,
|
||||
"fnRowCallback": fnRowCallback,
|
||||
"oLanguage": datatables_dict,
|
||||
"aLengthMenu": lengthMenu,
|
||||
"iDisplayLength": 25,
|
||||
"sPaginationType": "full_numbers",
|
||||
"bJQueryUI": true,
|
||||
"bAutoWidth": true,
|
||||
"sDom": sDom,
|
||||
"oTableTools": oTableTools
|
||||
});
|
||||
oTable.fnSetFilteringDelay(350);
|
||||
|
||||
historyContentDiv.find(".dataTables_scrolling").css("max-height", tableHeight);
|
||||
|
||||
$toolbar = $historyTableDiv.parents(".dataTables_wrapper").find(".fg-toolbar:first");
|
||||
createToolbarButtons($toolbar);
|
||||
|
||||
return oTable;
|
||||
}
|
||||
|
||||
function showSummaryList() {
|
||||
var url = baseUrl+"playouthistory/show-history-feed",
|
||||
oRange = AIRTIME.utilities.fnGetScheduleRange(dateStartId, timeStartId, dateEndId, timeEndId),
|
||||
data = {
|
||||
format: "json",
|
||||
start: oRange.start,
|
||||
end: oRange.end
|
||||
};
|
||||
|
||||
$.post(url, data, function(json) {
|
||||
drawShowList(json);
|
||||
});
|
||||
}
|
||||
|
||||
mod.onReady = function() {
|
||||
|
||||
var oBaseDatePickerSettings,
|
||||
oBaseTimePickerSettings,
|
||||
$hisDialogEl,
|
||||
|
||||
tabsInit = [
|
||||
{
|
||||
initialized: false,
|
||||
initialize: function() {
|
||||
oTableItem = itemHistoryTable("history_table_list");
|
||||
},
|
||||
navigate: function() {
|
||||
delete fnServerData.instance;
|
||||
oTableItem.fnDraw();
|
||||
},
|
||||
always: function() {
|
||||
inShowsTab = false;
|
||||
emptySelectedLogItems();
|
||||
}
|
||||
},
|
||||
{
|
||||
initialized: false,
|
||||
initialize: function() {
|
||||
oTableAgg = aggregateHistoryTable();
|
||||
},
|
||||
navigate: function() {
|
||||
delete fnServerData.instance;
|
||||
oTableAgg.fnDraw();
|
||||
},
|
||||
always: function() {
|
||||
inShowsTab = false;
|
||||
emptySelectedLogItems();
|
||||
}
|
||||
},
|
||||
{
|
||||
initialized: false,
|
||||
initialize: function() {
|
||||
|
||||
},
|
||||
navigate: function() {
|
||||
|
||||
},
|
||||
always: function() {
|
||||
inShowsTab = true;
|
||||
showSummaryList();
|
||||
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);
|
||||
});
|
||||
}
|
||||
|
||||
function processDialogHtml($el) {
|
||||
|
||||
if (inShowsTab) {
|
||||
$el.find("#his_choose_instance").remove();
|
||||
}
|
||||
|
||||
return $el
|
||||
}
|
||||
|
||||
function makeHistoryDialog(html) {
|
||||
$hisDialogEl = $(html);
|
||||
$hisDialogEl = processDialogHtml($hisDialogEl);
|
||||
|
||||
$hisDialogEl.dialog({
|
||||
title: $.i18n._("Edit History Record"),
|
||||
modal: false,
|
||||
open: function( event, ui ) {
|
||||
initializeDialog();
|
||||
},
|
||||
close: function() {
|
||||
removeHistoryDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* Icon hover states for search.
|
||||
*/
|
||||
$historyContentDiv.on("mouseenter", ".his-timerange .ui-button", function(ev) {
|
||||
$(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) {
|
||||
$(this).datepicker( "setDate", sDate );
|
||||
}
|
||||
};
|
||||
|
||||
oBaseTimePickerSettings = {
|
||||
showPeriodLabels: false,
|
||||
showCloseButton: true,
|
||||
closeButtonText: $.i18n._("Done"),
|
||||
showLeadingZero: false,
|
||||
defaultTime: '0:00',
|
||||
hourText: $.i18n._("Hour"),
|
||||
minuteText: $.i18n._("Minute")
|
||||
};
|
||||
|
||||
$historyContentDiv.find(dateStartId).datepicker(oBaseDatePickerSettings);
|
||||
$historyContentDiv.find(timeStartId).timepicker(oBaseTimePickerSettings);
|
||||
$historyContentDiv.find(dateEndId).datepicker(oBaseDatePickerSettings);
|
||||
$historyContentDiv.find(timeEndId).timepicker(oBaseTimePickerSettings);
|
||||
|
||||
$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");
|
||||
});
|
||||
|
||||
$('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);
|
||||
}
|
||||
else {
|
||||
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,
|
||||
createUrl = baseUrl+"Playouthistory/create-list-item/format/json",
|
||||
updateUrl = baseUrl+"Playouthistory/update-list-item/format/json",
|
||||
url,
|
||||
$select = $hisDialogEl.find("#his_instance_select"),
|
||||
instance;
|
||||
|
||||
url = (id === "") ? createUrl : updateUrl;
|
||||
|
||||
if (fnServerData.instance !== undefined) {
|
||||
data.push({
|
||||
name: "instance_id",
|
||||
value: fnServerData.instance
|
||||
});
|
||||
}
|
||||
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);
|
||||
$hisDialogEl.html($newForm.html());
|
||||
initializeDialog();
|
||||
}
|
||||
else {
|
||||
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);
|
||||
}
|
||||
else {
|
||||
removeSelectedLogItem($tr);
|
||||
}
|
||||
});
|
||||
|
||||
$('body').on("click", "#his_instance_retrieve", function(e) {
|
||||
var startPicker = $hisDialogEl.find('#his_item_starts_datetimepicker').data('datetimepicker'),
|
||||
endPicker = $hisDialogEl.find('#his_item_ends_datetimepicker').data('datetimepicker'),
|
||||
url = baseUrl+"playouthistory/show-history-feed",
|
||||
startDate = startPicker.getLocalDate(),
|
||||
endDate = endPicker.getLocalDate(),
|
||||
getEpochSeconds = AIRTIME.utilities.fnGetSecondsEpoch,
|
||||
data;
|
||||
|
||||
data = {
|
||||
start: getEpochSeconds(startDate),
|
||||
end: getEpochSeconds(endDate),
|
||||
format: "json"
|
||||
};
|
||||
|
||||
$.get(url, data, function(json) {
|
||||
var i,
|
||||
$select = $('<select/>', {
|
||||
id: 'his_instance_select'
|
||||
}),
|
||||
$option,
|
||||
show;
|
||||
|
||||
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);
|
||||
});
|
||||
});
|
||||
|
||||
$historyContentDiv.find("#his_submit").click(function(ev){
|
||||
var fn,
|
||||
oRange;
|
||||
|
||||
oRange = AIRTIME.utilities.fnGetScheduleRange(dateStartId, timeStartId, dateEndId, timeEndId);
|
||||
|
||||
fn = fnServerData;
|
||||
fn.start = oRange.start;
|
||||
fn.end = oRange.end;
|
||||
|
||||
if (inShowsTab) {
|
||||
showSummaryList();
|
||||
}
|
||||
else {
|
||||
redrawTables();
|
||||
}
|
||||
});
|
||||
|
||||
$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;
|
||||
}
|
||||
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,
|
||||
$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(function(){
|
||||
|
||||
var viewport = AIRTIME.utilities.findViewportDimensions(),
|
||||
history_content = $("#history_content"),
|
||||
widgetHeight = viewport.height - 185,
|
||||
screenWidth = Math.floor(viewport.width - 110),
|
||||
oBaseDatePickerSettings,
|
||||
oBaseTimePickerSettings,
|
||||
oTable,
|
||||
dateStartId = "#his_date_start",
|
||||
timeStartId = "#his_time_start",
|
||||
dateEndId = "#his_date_end",
|
||||
timeEndId = "#his_time_end";
|
||||
|
||||
/*
|
||||
* Icon hover states for search.
|
||||
*/
|
||||
history_content.on("mouseenter", ".his-timerange .ui-button", function(ev) {
|
||||
$(this).addClass("ui-state-hover");
|
||||
});
|
||||
history_content.on("mouseleave", ".his-timerange .ui-button", function(ev) {
|
||||
$(this).removeClass("ui-state-hover");
|
||||
});
|
||||
|
||||
history_content
|
||||
.height(widgetHeight)
|
||||
.width(screenWidth);
|
||||
|
||||
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) {
|
||||
$(this).datepicker( "setDate", sDate );
|
||||
}
|
||||
};
|
||||
|
||||
oBaseTimePickerSettings = {
|
||||
showPeriodLabels: false,
|
||||
showCloseButton: true,
|
||||
closeButtonText: $.i18n._("Done"),
|
||||
showLeadingZero: false,
|
||||
defaultTime: '0:00',
|
||||
hourText: $.i18n._("Hour"),
|
||||
minuteText: $.i18n._("Minute")
|
||||
};
|
||||
|
||||
oTable = AIRTIME.history.historyTable();
|
||||
|
||||
history_content.find(dateStartId).datepicker(oBaseDatePickerSettings);
|
||||
history_content.find(timeStartId).timepicker(oBaseTimePickerSettings);
|
||||
history_content.find(dateEndId).datepicker(oBaseDatePickerSettings);
|
||||
history_content.find(timeEndId).timepicker(oBaseTimePickerSettings);
|
||||
|
||||
|
||||
history_content.find("#his_submit").click(function(ev){
|
||||
var fn,
|
||||
oRange;
|
||||
|
||||
oRange = AIRTIME.utilities.fnGetScheduleRange(dateStartId, timeStartId, dateEndId, timeEndId);
|
||||
|
||||
fn = oTable.fnSettings().fnServerData;
|
||||
fn.start = oRange.start;
|
||||
fn.end = oRange.end;
|
||||
|
||||
oTable.fnDraw();
|
||||
});
|
||||
|
||||
});
|
||||
$(document).ready(AIRTIME.history.onReady);
|
102
airtime_mvc/public/js/airtime/playouthistory/template.js
Normal file
|
@ -0,0 +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 =
|
||||
"<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 =
|
||||
"<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>" +
|
||||
"</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);
|
|
@ -13,11 +13,11 @@ function showErrorSections() {
|
|||
}
|
||||
function rebuildStreamURL(ele){
|
||||
var div = ele.closest("div")
|
||||
host = div.find("input:[id$=-host]").val()
|
||||
port = div.find("input:[id$=-port]").val()
|
||||
mount = div.find("input:[id$=-mount]").val()
|
||||
host = div.find("input[id$=-host]").val()
|
||||
port = div.find("input[id$=-port]").val()
|
||||
mount = div.find("input[id$=-mount]").val()
|
||||
streamurl = ""
|
||||
if(div.find("select:[id$=-output]").val()=="icecast"){
|
||||
if(div.find("select[id$=-output]").val()=="icecast"){
|
||||
streamurl = "http://"+host
|
||||
if($.trim(port) != ""){
|
||||
streamurl += ":"+port
|
||||
|
@ -180,15 +180,15 @@ function setupEventListeners() {
|
|||
rebuildStreamURL($(this));
|
||||
})
|
||||
|
||||
$("input:[id$=-host], input:[id$=-port], input:[id$=-mount]").keyup(function(){
|
||||
$("input[id$=-host], input[id$=-port], input[id$=-mount]").keyup(function(){
|
||||
rebuildStreamURL($(this));
|
||||
});
|
||||
|
||||
$("input:[id$=-port]").keypress(function(e){
|
||||
$("input[id$=-port]").keypress(function(e){
|
||||
validate($(this),e);
|
||||
});
|
||||
|
||||
$("select:[id$=-output]").change(function(){
|
||||
$("select[id$=-output]").change(function(){
|
||||
rebuildStreamURL($(this));
|
||||
});
|
||||
|
||||
|
|
|
@ -227,6 +227,35 @@ function setAddShowEvents() {
|
|||
}
|
||||
});
|
||||
|
||||
// in case user is creating a new show, there will be
|
||||
// no show_id so we have to store the default timezone
|
||||
// to be able to do the conversion when the timezone
|
||||
// setting changes
|
||||
var currentTimezone = form.find("#add_show_timezone").val();
|
||||
|
||||
form.find("#add_show_timezone").change(function(){
|
||||
var startDateField = form.find("#add_show_start_date"),
|
||||
startTimeField = form.find("#add_show_start_time"),
|
||||
endDateField = form.find("#add_show_end_date_no_repeat"),
|
||||
endTimeField = form.find("#add_show_end_time"),
|
||||
newTimezone = form.find("#add_show_timezone").val();
|
||||
|
||||
$.post(baseUrl+"Schedule/localize-start-end-time",
|
||||
{format: "json",
|
||||
startDate: startDateField.val(),
|
||||
startTime: startTimeField.val(),
|
||||
endDate: endDateField.val(),
|
||||
endTime: endTimeField.val(),
|
||||
newTimezone: newTimezone,
|
||||
oldTimezone: currentTimezone}, function(json){
|
||||
|
||||
startDateField.val(json.start.date);
|
||||
startTimeField.val(json.start.time);
|
||||
endDateField.val(json.end.date);
|
||||
endTimeField.val(json.end.time);
|
||||
});
|
||||
});
|
||||
|
||||
form.find("#add_show_repeat_type").change(function(){
|
||||
toggleRepeatDays();
|
||||
toggleMonthlyRepeatType();
|
||||
|
@ -481,6 +510,13 @@ function setAddShowEvents() {
|
|||
|
||||
event.preventDefault();
|
||||
|
||||
//when editing a show, the record option is disabled
|
||||
//we have to enable it to get the correct value when
|
||||
//we call serializeArray()
|
||||
if (form.find("#add_show_record").attr("disabled", true)) {
|
||||
form.find("#add_show_record").attr("disabled", false);
|
||||
}
|
||||
|
||||
var data = $("form").serializeArray();
|
||||
|
||||
var hosts = $('#add_show_hosts-element input').map(function() {
|
||||
|
@ -504,7 +540,7 @@ function setAddShowEvents() {
|
|||
});
|
||||
|
||||
var action = baseUrl+"Schedule/"+String(addShowButton.attr("data-action"));
|
||||
|
||||
|
||||
$.post(action, {format: "json", data: data, hosts: hosts, days: days}, function(json){
|
||||
//addShowButton.removeClass("disabled");
|
||||
$('#schedule-add-show').unblock();
|
||||
|
|
|
@ -444,28 +444,28 @@ function getCurrentShow(){
|
|||
* is switching from week view to day view (and vice versa)
|
||||
* the icon may already be there from previous view
|
||||
*/
|
||||
$el.siblings().remove("span[class=small-icon now-playing]");
|
||||
$el.siblings().remove("span.now-playing");
|
||||
if (!$el.siblings().hasClass("small-icon now-playing")) {
|
||||
if ($el.siblings().hasClass("small-icon recording")) {
|
||||
|
||||
/* Without removing recording icon, the now playing
|
||||
* icon will overwrite it.
|
||||
*/
|
||||
$el.siblings().remove("span[class=small-icon recording]");
|
||||
$el.siblings().remove("span.recording");
|
||||
$el.before('<span class="small-icon now-playing"></span><span class="small-icon recording"></span>');
|
||||
} else if ($el.siblings().hasClass("small-icon rebroadcast")) {
|
||||
|
||||
/* Without removing rebroadcast icon, the now playing
|
||||
* icon will overwrite it.
|
||||
*/
|
||||
$el.siblings().remove("span[class=small-icon rebroadcast]");
|
||||
$el.siblings().remove("span.rebroadcast");
|
||||
$el.before('<span class="small-icon now-playing"></span><span class="small-icon rebroadcast"></span>');
|
||||
} else {
|
||||
$el.before('<span class="small-icon now-playing"></span>');
|
||||
}
|
||||
}
|
||||
} else if (view_name === 'month') {
|
||||
if (!$("span[class*=fc-event-title]").siblings().hasClass("small-icon now-playing")) {
|
||||
if (!$("span[class*=fc-event-title]").siblings().hasClass("now-playing")) {
|
||||
$("span[class*=fc-event-title]").after('<span class="small-icon now-playing"></span>');
|
||||
}
|
||||
}
|
||||
|
@ -475,7 +475,7 @@ function getCurrentShow(){
|
|||
id = $(this).parents("div.fc-event").data("event").id;
|
||||
|
||||
if (id != json.si_id) {
|
||||
$(this).remove("span[small-icon now-playing]");
|
||||
$(this).remove("span.now-playing");
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -178,7 +178,12 @@ var AIRTIME = (function(AIRTIME){
|
|||
};
|
||||
|
||||
mod.checkToolBarIcons = function() {
|
||||
AIRTIME.library.checkAddButton();
|
||||
|
||||
//library may not be on the page.
|
||||
if (AIRTIME.library !== undefined) {
|
||||
AIRTIME.library.checkAddButton();
|
||||
}
|
||||
|
||||
mod.checkSelectButton();
|
||||
mod.checkTrimButton();
|
||||
mod.checkDeleteButton();
|
||||
|
|
|
@ -186,7 +186,11 @@ AIRTIME = (function(AIRTIME) {
|
|||
AIRTIME.showbuilder.fnServerData.start = oRange.start;
|
||||
AIRTIME.showbuilder.fnServerData.end = oRange.end;
|
||||
|
||||
AIRTIME.library.libraryInit();
|
||||
//the user might not have the library on the page (guest user)
|
||||
if (AIRTIME.library !== undefined) {
|
||||
AIRTIME.library.libraryInit();
|
||||
}
|
||||
|
||||
AIRTIME.showbuilder.builderDataTable();
|
||||
setWidgetSize();
|
||||
|
||||
|
@ -308,7 +312,7 @@ AIRTIME = (function(AIRTIME) {
|
|||
if (fn.hasOwnProperty("ops")) {
|
||||
data["myShows"] = fn.ops.myShows;
|
||||
data["showFilter"] = fn.ops.showFilter;
|
||||
data["showFilter"] = fn.ops.showInstanceFilter;
|
||||
data["showInstanceFilter"] = fn.ops.showInstanceFilter;
|
||||
}
|
||||
|
||||
$.ajax( {
|
||||
|
|
|
@ -35,6 +35,22 @@ var AIRTIME = (function(AIRTIME){
|
|||
};
|
||||
};
|
||||
|
||||
mod.fnGetSecondsEpoch = function(oDate) {
|
||||
var iTime,
|
||||
iServerOffset,
|
||||
iClientOffset;
|
||||
|
||||
iTime = oDate.getTime(); //value is in millisec.
|
||||
iTime = Math.round(iTime / 1000);
|
||||
iServerOffset = serverTimezoneOffset;
|
||||
iClientOffset = oDate.getTimezoneOffset() * -60;//function returns minutes
|
||||
|
||||
//adjust for the fact the the Date object is in client time.
|
||||
iTime = iTime + iClientOffset + iServerOffset;
|
||||
|
||||
return iTime;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the schedule range start in unix timestamp form (in seconds).
|
||||
* defaults to NOW if nothing is selected.
|
||||
|
@ -69,15 +85,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
//0 based month in js.
|
||||
oDate = new Date(date[0], date[1]-1, date[2], time[0], time[1]);
|
||||
|
||||
iTime = oDate.getTime(); //value is in millisec.
|
||||
iTime = Math.round(iTime / 1000);
|
||||
iServerOffset = serverTimezoneOffset;
|
||||
iClientOffset = oDate.getTimezoneOffset() * -60;//function returns minutes
|
||||
|
||||
//adjust for the fact the the Date object is in client time.
|
||||
iTime = iTime + iClientOffset + iServerOffset;
|
||||
|
||||
return iTime;
|
||||
return mod.fnGetSecondsEpoch(oDate);
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -14,10 +14,12 @@
|
|||
|
||||
;(function($) {
|
||||
|
||||
/*
|
||||
if (/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery) || /^1.1/.test($.fn.jquery)) {
|
||||
alert('blockUI requires jQuery v1.2.3 or later! You are using v' + $.fn.jquery);
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
$.fn._fadeIn = $.fn.fadeIn;
|
||||
|
||||
|
|
1306
airtime_mvc/public/js/bootstrap-datetime/bootstrap-datetimepicker.js
vendored
Normal file
|
@ -32,7 +32,7 @@ package {
|
|||
|
||||
// import flashvars
|
||||
var flashvars:Object = LoaderInfo( this.root.loaderInfo ).parameters;
|
||||
domId = flashvars.id;
|
||||
domId = flashvars.id.split("\\").join("\\\\");
|
||||
|
||||
// invisible button covers entire stage
|
||||
button = new Sprite();
|
||||
|
@ -45,16 +45,16 @@ package {
|
|||
|
||||
button.addEventListener(MouseEvent.CLICK, clickHandler);
|
||||
button.addEventListener(MouseEvent.MOUSE_OVER, function(event:Event):void {
|
||||
ExternalInterface.call( 'ZeroClipboard.dispatch', domId, 'mouseOver', null );
|
||||
ExternalInterface.call( 'ZeroClipboard_TableTools.dispatch', domId, 'mouseOver', null );
|
||||
} );
|
||||
button.addEventListener(MouseEvent.MOUSE_OUT, function(event:Event):void {
|
||||
ExternalInterface.call( 'ZeroClipboard.dispatch', domId, 'mouseOut', null );
|
||||
ExternalInterface.call( 'ZeroClipboard_TableTools.dispatch', domId, 'mouseOut', null );
|
||||
} );
|
||||
button.addEventListener(MouseEvent.MOUSE_DOWN, function(event:Event):void {
|
||||
ExternalInterface.call( 'ZeroClipboard.dispatch', domId, 'mouseDown', null );
|
||||
ExternalInterface.call( 'ZeroClipboard_TableTools.dispatch', domId, 'mouseDown', null );
|
||||
} );
|
||||
button.addEventListener(MouseEvent.MOUSE_UP, function(event:Event):void {
|
||||
ExternalInterface.call( 'ZeroClipboard.dispatch', domId, 'mouseUp', null );
|
||||
ExternalInterface.call( 'ZeroClipboard_TableTools.dispatch', domId, 'mouseUp', null );
|
||||
} );
|
||||
|
||||
// External functions - readd whenever the stage is made active for IE
|
||||
|
@ -62,10 +62,10 @@ package {
|
|||
stage.addEventListener(Event.ACTIVATE, addCallbacks);
|
||||
|
||||
// signal to the browser that we are ready
|
||||
ExternalInterface.call( 'ZeroClipboard.dispatch', domId, 'load', null );
|
||||
ExternalInterface.call( 'ZeroClipboard_TableTools.dispatch', domId, 'load', null );
|
||||
}
|
||||
|
||||
public function addCallbacks ():void {
|
||||
public function addCallbacks (evt:Event = null):void {
|
||||
ExternalInterface.addCallback("setHandCursor", setHandCursor);
|
||||
ExternalInterface.addCallback("clearText", clearText);
|
||||
ExternalInterface.addCallback("setText", setText);
|
||||
|
@ -133,13 +133,13 @@ package {
|
|||
} else {
|
||||
/* Copy the text to the clipboard. Note charset and BOM have no effect here */
|
||||
System.setClipboard( clipText );
|
||||
ExternalInterface.call( 'ZeroClipboard.dispatch', domId, 'complete', clipText );
|
||||
ExternalInterface.call( 'ZeroClipboard_TableTools.dispatch', domId, 'complete', clipText );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function saveComplete(event:Event):void {
|
||||
ExternalInterface.call( 'ZeroClipboard.dispatch', domId, 'complete', clipText );
|
||||
ExternalInterface.call( 'ZeroClipboard_TableTools.dispatch', domId, 'complete', clipText );
|
||||
}
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ package {
|
|||
|
||||
// import flashvars
|
||||
var flashvars:Object = LoaderInfo( this.root.loaderInfo ).parameters;
|
||||
domId = flashvars.id;
|
||||
domId = flashvars.id.split("\\").join("\\\\");
|
||||
|
||||
// invisible button covers entire stage
|
||||
button = new Sprite();
|
||||
|
@ -61,16 +61,16 @@ package {
|
|||
clickHandler(event);
|
||||
} );
|
||||
button.addEventListener(MouseEvent.MOUSE_OVER, function(event:Event):void {
|
||||
ExternalInterface.call( 'ZeroClipboard.dispatch', domId, 'mouseOver', null );
|
||||
ExternalInterface.call( 'ZeroClipboard_TableTools.dispatch', domId, 'mouseOver', null );
|
||||
} );
|
||||
button.addEventListener(MouseEvent.MOUSE_OUT, function(event:Event):void {
|
||||
ExternalInterface.call( 'ZeroClipboard.dispatch', domId, 'mouseOut', null );
|
||||
ExternalInterface.call( 'ZeroClipboard_TableTools.dispatch', domId, 'mouseOut', null );
|
||||
} );
|
||||
button.addEventListener(MouseEvent.MOUSE_DOWN, function(event:Event):void {
|
||||
ExternalInterface.call( 'ZeroClipboard.dispatch', domId, 'mouseDown', null );
|
||||
ExternalInterface.call( 'ZeroClipboard_TableTools.dispatch', domId, 'mouseDown', null );
|
||||
} );
|
||||
button.addEventListener(MouseEvent.MOUSE_UP, function(event:Event):void {
|
||||
ExternalInterface.call( 'ZeroClipboard.dispatch', domId, 'mouseUp', null );
|
||||
ExternalInterface.call( 'ZeroClipboard_TableTools.dispatch', domId, 'mouseUp', null );
|
||||
} );
|
||||
|
||||
// External functions - readd whenever the stage is made active for IE
|
||||
|
@ -78,10 +78,10 @@ package {
|
|||
stage.addEventListener(Event.ACTIVATE, addCallbacks);
|
||||
|
||||
// signal to the browser that we are ready
|
||||
ExternalInterface.call( 'ZeroClipboard.dispatch', domId, 'load', null );
|
||||
ExternalInterface.call( 'ZeroClipboard_TableTools.dispatch', domId, 'load', null );
|
||||
}
|
||||
|
||||
public function addCallbacks ():void {
|
||||
public function addCallbacks (evt:Event = null):void {
|
||||
ExternalInterface.addCallback("setHandCursor", setHandCursor);
|
||||
ExternalInterface.addCallback("clearText", clearText);
|
||||
ExternalInterface.addCallback("setText", setText);
|
||||
|
@ -150,13 +150,13 @@ package {
|
|||
} else {
|
||||
/* Copy the text to the clipboard. Note charset and BOM have no effect here */
|
||||
System.setClipboard( clipText );
|
||||
ExternalInterface.call( 'ZeroClipboard.dispatch', domId, 'complete', clipText );
|
||||
ExternalInterface.call( 'ZeroClipboard_TableTools.dispatch', domId, 'complete', clipText );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function saveComplete(event:Event):void {
|
||||
ExternalInterface.call( 'ZeroClipboard.dispatch', domId, 'complete', clipText );
|
||||
ExternalInterface.call( 'ZeroClipboard_TableTools.dispatch', domId, 'complete', clipText );
|
||||
}
|
||||
|
||||
|
321
airtime_mvc/public/js/datatables/plugin/TableTools-2.1.5/css/TableTools.css
Executable file
|
@ -0,0 +1,321 @@
|
|||
/*
|
||||
* File: TableTools.css
|
||||
* Description: Styles for TableTools 2
|
||||
* Author: Allan Jardine (www.sprymedia.co.uk)
|
||||
* Language: Javascript
|
||||
* License: GPL v2 / 3 point BSD
|
||||
* Project: DataTables
|
||||
*
|
||||
* Copyright 2009-2012 Allan Jardine, all rights reserved.
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* CSS name space:
|
||||
* DTTT DataTables TableTools
|
||||
*
|
||||
* Style sheet provides:
|
||||
* CONTAINER TableTools container element and styles applying to all components
|
||||
* BUTTON_STYLES Action specific button styles
|
||||
* SELECTING Row selection styles
|
||||
* COLLECTIONS Drop down list (collection) styles
|
||||
* PRINTING Print display styles
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* CONTAINER
|
||||
* TableTools container element and styles applying to all components
|
||||
*/
|
||||
div.DTTT_container {
|
||||
position: relative;
|
||||
float: right;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
button.DTTT_button,
|
||||
div.DTTT_button,
|
||||
a.DTTT_button {
|
||||
position: relative;
|
||||
float: left;
|
||||
margin-right: 3px;
|
||||
padding: 5px 8px;
|
||||
border: 1px solid #999;
|
||||
cursor: pointer;
|
||||
*cursor: hand;
|
||||
font-size: 0.88em;
|
||||
color: black !important;
|
||||
|
||||
-webkit-border-radius: 2px;
|
||||
-moz-border-radius: 2px;
|
||||
-ms-border-radius: 2px;
|
||||
-o-border-radius: 2px;
|
||||
border-radius: 2px;
|
||||
|
||||
-webkit-box-shadow: 1px 1px 3px #ccc;
|
||||
-moz-box-shadow: 1px 1px 3px #ccc;
|
||||
-ms-box-shadow: 1px 1px 3px #ccc;
|
||||
-o-box-shadow: 1px 1px 3px #ccc;
|
||||
box-shadow: 1px 1px 3px #ccc;
|
||||
|
||||
/* Generated by http://www.colorzilla.com/gradient-editor/ */
|
||||
background: #ffffff; /* Old browsers */
|
||||
background: -webkit-linear-gradient(top, #ffffff 0%,#f3f3f3 89%,#f9f9f9 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -moz-linear-gradient(top, #ffffff 0%,#f3f3f3 89%,#f9f9f9 100%); /* FF3.6+ */
|
||||
background: -ms-linear-gradient(top, #ffffff 0%,#f3f3f3 89%,#f9f9f9 100%); /* IE10+ */
|
||||
background: -o-linear-gradient(top, #ffffff 0%,#f3f3f3 89%,#f9f9f9 100%); /* Opera 11.10+ */
|
||||
background: linear-gradient(top, #ffffff 0%,#f3f3f3 89%,#f9f9f9 100%); /* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f9f9f9',GradientType=0 ); /* IE6-9 */
|
||||
}
|
||||
|
||||
|
||||
/* Buttons are cunning border-box sizing - we can't just use that for A and DIV due to IE6/7 */
|
||||
button.DTTT_button {
|
||||
height: 30px;
|
||||
padding: 3px 8px;
|
||||
}
|
||||
|
||||
.DTTT_button embed {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
button.DTTT_button:hover,
|
||||
div.DTTT_button:hover,
|
||||
a.DTTT_button:hover {
|
||||
border: 1px solid #666;
|
||||
text-decoration: none !important;
|
||||
|
||||
-webkit-box-shadow: 1px 1px 3px #999;
|
||||
-moz-box-shadow: 1px 1px 3px #999;
|
||||
-ms-box-shadow: 1px 1px 3px #999;
|
||||
-o-box-shadow: 1px 1px 3px #999;
|
||||
box-shadow: 1px 1px 3px #999;
|
||||
|
||||
background: #f3f3f3; /* Old browsers */
|
||||
background: -webkit-linear-gradient(top, #f3f3f3 0%,#e2e2e2 89%,#f4f4f4 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -moz-linear-gradient(top, #f3f3f3 0%,#e2e2e2 89%,#f4f4f4 100%); /* FF3.6+ */
|
||||
background: -ms-linear-gradient(top, #f3f3f3 0%,#e2e2e2 89%,#f4f4f4 100%); /* IE10+ */
|
||||
background: -o-linear-gradient(top, #f3f3f3 0%,#e2e2e2 89%,#f4f4f4 100%); /* Opera 11.10+ */
|
||||
background: linear-gradient(top, #f3f3f3 0%,#e2e2e2 89%,#f4f4f4 100%); /* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f3f3f3', endColorstr='#f4f4f4',GradientType=0 ); /* IE6-9 */
|
||||
}
|
||||
|
||||
button.DTTT_disabled,
|
||||
div.DTTT_disabled,
|
||||
a.DTTT_disabled {
|
||||
color: #999;
|
||||
border: 1px solid #d0d0d0;
|
||||
|
||||
background: #ffffff; /* Old browsers */
|
||||
background: -webkit-linear-gradient(top, #ffffff 0%,#f9f9f9 89%,#fafafa 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -moz-linear-gradient(top, #ffffff 0%,#f9f9f9 89%,#fafafa 100%); /* FF3.6+ */
|
||||
background: -ms-linear-gradient(top, #ffffff 0%,#f9f9f9 89%,#fafafa 100%); /* IE10+ */
|
||||
background: -o-linear-gradient(top, #ffffff 0%,#f9f9f9 89%,#fafafa 100%); /* Opera 11.10+ */
|
||||
background: linear-gradient(top, #ffffff 0%,#f9f9f9 89%,#fafafa 100%); /* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#fafafa',GradientType=0 ); /* IE6-9 */
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* BUTTON_STYLES
|
||||
* Action specific button styles
|
||||
* If you want images - comment this back in
|
||||
|
||||
a.DTTT_button_csv,
|
||||
a.DTTT_button_xls,
|
||||
a.DTTT_button_copy,
|
||||
a.DTTT_button_pdf,
|
||||
a.DTTT_button_print {
|
||||
padding-right: 0px;
|
||||
}
|
||||
|
||||
a.DTTT_button_csv span,
|
||||
a.DTTT_button_xls span,
|
||||
a.DTTT_button_copy span,
|
||||
a.DTTT_button_pdf span,
|
||||
a.DTTT_button_print span {
|
||||
display: inline-block;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
padding-right: 30px;
|
||||
}
|
||||
|
||||
|
||||
a.DTTT_button_csv span { background: url(../images/csv.png) no-repeat bottom right; }
|
||||
a.DTTT_button_csv:hover span { background: url(../images/csv_hover.png) no-repeat center right; }
|
||||
|
||||
a.DTTT_button_xls span { background: url(../images/xls.png) no-repeat center right; }
|
||||
a.DTTT_button_xls:hover span { background: #f0f0f0 url(../images/xls_hover.png) no-repeat center right; }
|
||||
|
||||
a.DTTT_button_copy span { background: url(../images/copy.png) no-repeat center right; }
|
||||
a.DTTT_button_copy:hover span { background: #f0f0f0 url(../images/copy_hover.png) no-repeat center right; }
|
||||
|
||||
a.DTTT_button_pdf span { background: url(../images/pdf.png) no-repeat center right; }
|
||||
a.DTTT_button_pdf:hover span { background: #f0f0f0 url(../images/pdf_hover.png) no-repeat center right; }
|
||||
|
||||
a.DTTT_button_print span { background: url(../images/print.png) no-repeat center right; }
|
||||
a.DTTT_button_print:hover span { background: #f0f0f0 url(../images/print_hover.png) no-repeat center right; }
|
||||
|
||||
*/
|
||||
|
||||
button.DTTT_button_collection span {
|
||||
padding-right: 17px;
|
||||
background: url(../images/collection.png) no-repeat center right;
|
||||
}
|
||||
|
||||
button.DTTT_button_collection:hover span {
|
||||
padding-right: 17px;
|
||||
background: #f0f0f0 url(../images/collection_hover.png) no-repeat center right;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* SELECTING
|
||||
* Row selection styles
|
||||
*/
|
||||
table.DTTT_selectable tbody tr {
|
||||
cursor: pointer;
|
||||
*cursor: hand;
|
||||
}
|
||||
|
||||
table.dataTable tr.DTTT_selected.odd {
|
||||
background-color: #9FAFD1;
|
||||
}
|
||||
|
||||
table.dataTable tr.DTTT_selected.odd td.sorting_1 {
|
||||
background-color: #9FAFD1;
|
||||
}
|
||||
|
||||
table.dataTable tr.DTTT_selected.odd td.sorting_2 {
|
||||
background-color: #9FAFD1;
|
||||
}
|
||||
|
||||
table.dataTable tr.DTTT_selected.odd td.sorting_3 {
|
||||
background-color: #9FAFD1;
|
||||
}
|
||||
|
||||
|
||||
table.dataTable tr.DTTT_selected.even {
|
||||
background-color: #B0BED9;
|
||||
}
|
||||
|
||||
table.dataTable tr.DTTT_selected.even td.sorting_1 {
|
||||
background-color: #B0BED9;
|
||||
}
|
||||
|
||||
table.dataTable tr.DTTT_selected.even td.sorting_2 {
|
||||
background-color: #B0BED9;
|
||||
}
|
||||
|
||||
table.dataTable tr.DTTT_selected.even td.sorting_3 {
|
||||
background-color: #B0BED9;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* COLLECTIONS
|
||||
* Drop down list (collection) styles
|
||||
*/
|
||||
|
||||
div.DTTT_collection {
|
||||
width: 150px;
|
||||
padding: 8px 8px 4px 8px;
|
||||
border: 1px solid #ccc;
|
||||
border: 1px solid rgba( 0, 0, 0, 0.4 );
|
||||
background-color: #f3f3f3;
|
||||
background-color: rgba( 255, 255, 255, 0.3 );
|
||||
overflow: hidden;
|
||||
z-index: 2002;
|
||||
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-ms-border-radius: 5px;
|
||||
-o-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
|
||||
-webkit-box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.3);
|
||||
-moz-box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.3);
|
||||
-ms-box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.3);
|
||||
-o-box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.3);
|
||||
box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
div.DTTT_collection_background {
|
||||
background: transparent url(../images/background.png) repeat top left;
|
||||
z-index: 2001;
|
||||
}
|
||||
|
||||
div.DTTT_collection button.DTTT_button,
|
||||
div.DTTT_collection div.DTTT_button,
|
||||
div.DTTT_collection a.DTTT_button {
|
||||
position: relative;
|
||||
left: 0;
|
||||
right: 0;
|
||||
|
||||
display: block;
|
||||
float: none;
|
||||
margin-bottom: 4px;
|
||||
|
||||
-webkit-box-shadow: 1px 1px 3px #999;
|
||||
-moz-box-shadow: 1px 1px 3px #999;
|
||||
-ms-box-shadow: 1px 1px 3px #999;
|
||||
-o-box-shadow: 1px 1px 3px #999;
|
||||
box-shadow: 1px 1px 3px #999;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* PRINTING
|
||||
* Print display styles
|
||||
*/
|
||||
|
||||
.DTTT_print_info {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 400px;
|
||||
height: 150px;
|
||||
margin-left: -200px;
|
||||
margin-top: -75px;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
padding: 10px 30px;
|
||||
|
||||
background: #ffffff; /* Old browsers */
|
||||
background: -webkit-linear-gradient(top, #ffffff 0%,#f3f3f3 89%,#f9f9f9 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -moz-linear-gradient(top, #ffffff 0%,#f3f3f3 89%,#f9f9f9 100%); /* FF3.6+ */
|
||||
background: -ms-linear-gradient(top, #ffffff 0%,#f3f3f3 89%,#f9f9f9 100%); /* IE10+ */
|
||||
background: -o-linear-gradient(top, #ffffff 0%,#f3f3f3 89%,#f9f9f9 100%); /* Opera 11.10+ */
|
||||
background: linear-gradient(top, #ffffff 0%,#f3f3f3 89%,#f9f9f9 100%); /* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f9f9f9',GradientType=0 ); /* IE6-9 */
|
||||
|
||||
opacity: 0.95;
|
||||
|
||||
border: 1px solid black;
|
||||
border: 1px solid rgba(0, 0, 0, 0.5);
|
||||
|
||||
-webkit-border-radius: 6px;
|
||||
-moz-border-radius: 6px;
|
||||
-ms-border-radius: 6px;
|
||||
-o-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
|
||||
-webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5);
|
||||
-moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5);
|
||||
-ms-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5);
|
||||
-o-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5);
|
||||
box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.DTTT_print_info h6 {
|
||||
font-weight: normal;
|
||||
font-size: 28px;
|
||||
line-height: 28px;
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
.DTTT_print_info p {
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
|
@ -41,19 +41,19 @@ div.DTTT_container {
|
|||
float: left;
|
||||
}
|
||||
|
||||
button.DTTT_button {
|
||||
.DTTT_button {
|
||||
position: relative;
|
||||
float: left;
|
||||
height: 24px;
|
||||
margin-right: 3px;
|
||||
padding: 3px 10px;
|
||||
border: 1px solid #d0d0d0;
|
||||
background-color: #fff;
|
||||
color: #333 !important;
|
||||
cursor: pointer;
|
||||
*cursor: hand;
|
||||
}
|
||||
|
||||
button.DTTT_button::-moz-focus-inner {
|
||||
.DTTT_button::-moz-focus-inner {
|
||||
border: none !important;
|
||||
padding: 0;
|
||||
}
|
||||
|
@ -69,36 +69,36 @@ table.DTTT_selectable tbody tr {
|
|||
*cursor: hand;
|
||||
}
|
||||
|
||||
tr.DTTT_selected.odd {
|
||||
table.dataTable tr.DTTT_selected.odd {
|
||||
background-color: #9FAFD1;
|
||||
}
|
||||
|
||||
tr.DTTT_selected.odd td.sorting_1 {
|
||||
table.dataTable tr.DTTT_selected.odd td.sorting_1 {
|
||||
background-color: #9FAFD1;
|
||||
}
|
||||
|
||||
tr.DTTT_selected.odd td.sorting_2 {
|
||||
table.dataTable tr.DTTT_selected.odd td.sorting_2 {
|
||||
background-color: #9FAFD1;
|
||||
}
|
||||
|
||||
tr.DTTT_selected.odd td.sorting_3 {
|
||||
table.dataTable tr.DTTT_selected.odd td.sorting_3 {
|
||||
background-color: #9FAFD1;
|
||||
}
|
||||
|
||||
|
||||
tr.DTTT_selected.even {
|
||||
table.dataTable tr.DTTT_selected.even {
|
||||
background-color: #B0BED9;
|
||||
}
|
||||
|
||||
tr.DTTT_selected.even td.sorting_1 {
|
||||
table.dataTable tr.DTTT_selected.even td.sorting_1 {
|
||||
background-color: #B0BED9;
|
||||
}
|
||||
|
||||
tr.DTTT_selected.even td.sorting_2 {
|
||||
table.dataTable tr.DTTT_selected.even td.sorting_2 {
|
||||
background-color: #B0BED9;
|
||||
}
|
||||
|
||||
tr.DTTT_selected.even td.sorting_3 {
|
||||
table.dataTable tr.DTTT_selected.even td.sorting_3 {
|
||||
background-color: #B0BED9;
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,9 @@ div.DTTT_collection_background {
|
|||
z-index: 2001;
|
||||
}
|
||||
|
||||
div.DTTT_collection button.DTTT_button {
|
||||
div.DTTT_collection button.DTTT_button,
|
||||
div.DTTT_collection div.DTTT_button,
|
||||
div.DTTT_collection a.DTTT_button {
|
||||
float: none;
|
||||
width: 100%;
|
||||
margin-bottom: -0.1em;
|
||||
|
@ -137,7 +139,7 @@ div.DTTT_collection button.DTTT_button {
|
|||
*/
|
||||
|
||||
.DTTT_print_info {
|
||||
position: absolute;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 400px;
|
Before Width: | Height: | Size: 944 B After Width: | Height: | Size: 944 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2 KiB |
77
airtime_mvc/public/js/datatables/plugin/TableTools-2.1.5/js/TableTools.min.js
vendored
Normal file
|
@ -0,0 +1,77 @@
|
|||
// Simple Set Clipboard System
|
||||
// Author: Joseph Huckaby
|
||||
var ZeroClipboard_TableTools={version:"1.0.4-TableTools2",clients:{},moviePath:"",nextId:1,$:function(a){"string"==typeof a&&(a=document.getElementById(a));a.addClass||(a.hide=function(){this.style.display="none"},a.show=function(){this.style.display=""},a.addClass=function(a){this.removeClass(a);this.className+=" "+a},a.removeClass=function(a){this.className=this.className.replace(RegExp("\\s*"+a+"\\s*")," ").replace(/^\s+/,"").replace(/\s+$/,"")},a.hasClass=function(a){return!!this.className.match(RegExp("\\s*"+
|
||||
a+"\\s*"))});return a},setMoviePath:function(a){this.moviePath=a},dispatch:function(a,b,c){(a=this.clients[a])&&a.receiveEvent(b,c)},register:function(a,b){this.clients[a]=b},getDOMObjectPosition:function(a){var b={left:0,top:0,width:a.width?a.width:a.offsetWidth,height:a.height?a.height:a.offsetHeight};""!=a.style.width&&(b.width=a.style.width.replace("px",""));""!=a.style.height&&(b.height=a.style.height.replace("px",""));for(;a;)b.left+=a.offsetLeft,b.top+=a.offsetTop,a=a.offsetParent;return b},
|
||||
Client:function(a){this.handlers={};this.id=ZeroClipboard_TableTools.nextId++;this.movieId="ZeroClipboard_TableToolsMovie_"+this.id;ZeroClipboard_TableTools.register(this.id,this);a&&this.glue(a)}};
|
||||
ZeroClipboard_TableTools.Client.prototype={id:0,ready:!1,movie:null,clipText:"",fileName:"",action:"copy",handCursorEnabled:!0,cssEffects:!0,handlers:null,sized:!1,glue:function(a,b){this.domElement=ZeroClipboard_TableTools.$(a);var c=99;this.domElement.style.zIndex&&(c=parseInt(this.domElement.style.zIndex)+1);var d=ZeroClipboard_TableTools.getDOMObjectPosition(this.domElement);this.div=document.createElement("div");var e=this.div.style;e.position="absolute";e.left="0px";e.top="0px";e.width=d.width+
|
||||
"px";e.height=d.height+"px";e.zIndex=c;"undefined"!=typeof b&&""!=b&&(this.div.title=b);0!=d.width&&0!=d.height&&(this.sized=!0);this.domElement&&(this.domElement.appendChild(this.div),this.div.innerHTML=this.getHTML(d.width,d.height))},positionElement:function(){var a=ZeroClipboard_TableTools.getDOMObjectPosition(this.domElement),b=this.div.style;b.position="absolute";b.width=a.width+"px";b.height=a.height+"px";0!=a.width&&0!=a.height&&(this.sized=!0,b=this.div.childNodes[0],b.width=a.width,b.height=
|
||||
a.height)},getHTML:function(a,b){var c="",d="id="+this.id+"&width="+a+"&height="+b;if(navigator.userAgent.match(/MSIE/))var e=location.href.match(/^https/i)?"https://":"http://",c=c+('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+e+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="'+a+'" height="'+b+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+
|
||||
ZeroClipboard_TableTools.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+d+'"/><param name="wmode" value="transparent"/></object>');else c+='<embed id="'+this.movieId+'" src="'+ZeroClipboard_TableTools.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+a+'" height="'+b+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+
|
||||
d+'" wmode="transparent" />';return c},hide:function(){this.div&&(this.div.style.left="-2000px")},show:function(){this.reposition()},destroy:function(){if(this.domElement&&this.div){this.hide();this.div.innerHTML="";var a=document.getElementsByTagName("body")[0];try{a.removeChild(this.div)}catch(b){}this.div=this.domElement=null}},reposition:function(a){a&&((this.domElement=ZeroClipboard_TableTools.$(a))||this.hide());if(this.domElement&&this.div){var a=ZeroClipboard_TableTools.getDOMObjectPosition(this.domElement),
|
||||
b=this.div.style;b.left=""+a.left+"px";b.top=""+a.top+"px"}},clearText:function(){this.clipText="";this.ready&&this.movie.clearText()},appendText:function(a){this.clipText+=a;this.ready&&this.movie.appendText(a)},setText:function(a){this.clipText=a;this.ready&&this.movie.setText(a)},setCharSet:function(a){this.charSet=a;this.ready&&this.movie.setCharSet(a)},setBomInc:function(a){this.incBom=a;this.ready&&this.movie.setBomInc(a)},setFileName:function(a){this.fileName=a;this.ready&&this.movie.setFileName(a)},
|
||||
setAction:function(a){this.action=a;this.ready&&this.movie.setAction(a)},addEventListener:function(a,b){a=a.toString().toLowerCase().replace(/^on/,"");this.handlers[a]||(this.handlers[a]=[]);this.handlers[a].push(b)},setHandCursor:function(a){this.handCursorEnabled=a;this.ready&&this.movie.setHandCursor(a)},setCSSEffects:function(a){this.cssEffects=!!a},receiveEvent:function(a,b){a=a.toString().toLowerCase().replace(/^on/,"");switch(a){case "load":this.movie=document.getElementById(this.movieId);
|
||||
if(!this.movie){var c=this;setTimeout(function(){c.receiveEvent("load",null)},1);return}if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){c=this;setTimeout(function(){c.receiveEvent("load",null)},100);this.ready=!0;return}this.ready=!0;this.movie.clearText();this.movie.appendText(this.clipText);this.movie.setFileName(this.fileName);this.movie.setAction(this.action);this.movie.setCharSet(this.charSet);this.movie.setBomInc(this.incBom);this.movie.setHandCursor(this.handCursorEnabled);
|
||||
break;case "mouseover":this.domElement&&this.cssEffects&&this.recoverActive&&this.domElement.addClass("active");break;case "mouseout":this.domElement&&this.cssEffects&&(this.recoverActive=!1,this.domElement.hasClass("active")&&(this.domElement.removeClass("active"),this.recoverActive=!0));break;case "mousedown":this.domElement&&this.cssEffects&&this.domElement.addClass("active");break;case "mouseup":this.domElement&&this.cssEffects&&(this.domElement.removeClass("active"),this.recoverActive=!1)}if(this.handlers[a])for(var d=
|
||||
0,e=this.handlers[a].length;d<e;d++){var f=this.handlers[a][d];if("function"==typeof f)f(this,b);else if("object"==typeof f&&2==f.length)f[0][f[1]](this,b);else if("string"==typeof f)window[f](this,b)}}};
|
||||
|
||||
|
||||
/*
|
||||
* File: TableTools.min.js
|
||||
* Version: 2.1.5
|
||||
* Author: Allan Jardine (www.sprymedia.co.uk)
|
||||
*
|
||||
* Copyright 2009-2012 Allan Jardine, all rights reserved.
|
||||
*
|
||||
* This source file is free software, under either the GPL v2 license or a
|
||||
* BSD (3 point) 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. See the license files for details.
|
||||
*/
|
||||
var TableTools;
|
||||
(function(e,n,g){TableTools=function(a,b){!this instanceof TableTools&&alert("Warning: TableTools must be initialised with the keyword 'new'");this.s={that:this,dt:a.fnSettings(),print:{saveStart:-1,saveLength:-1,saveScroll:-1,funcEnd:function(){}},buttonCounter:0,select:{type:"",selected:[],preRowSelect:null,postSelected:null,postDeselected:null,all:!1,selectedClass:""},custom:{},swfPath:"",buttonSet:[],master:!1,tags:{}};this.dom={container:null,table:null,print:{hidden:[],message:null},collection:{collection:null,
|
||||
background:null}};this.classes=e.extend(!0,{},TableTools.classes);this.s.dt.bJUI&&e.extend(!0,this.classes,TableTools.classes_themeroller);this.fnSettings=function(){return this.s};"undefined"==typeof b&&(b={});this._fnConstruct(b);return this};TableTools.prototype={fnGetSelected:function(a){var b=[],c=this.s.dt.aoData,d=this.s.dt.aiDisplay,f;if(a){a=0;for(f=d.length;a<f;a++)c[d[a]]._DTTT_selected&&b.push(c[d[a]].nTr)}else{a=0;for(f=c.length;a<f;a++)c[a]._DTTT_selected&&b.push(c[a].nTr)}return b},
|
||||
fnGetSelectedData:function(){var a=[],b=this.s.dt.aoData,c,d;c=0;for(d=b.length;c<d;c++)b[c]._DTTT_selected&&a.push(this.s.dt.oInstance.fnGetData(c));return a},fnIsSelected:function(a){a=this.s.dt.oInstance.fnGetPosition(a);return!0===this.s.dt.aoData[a]._DTTT_selected?!0:!1},fnSelectAll:function(a){var b=this._fnGetMasterSettings();this._fnRowSelect(!0===a?b.dt.aiDisplay:b.dt.aoData)},fnSelectNone:function(a){this._fnGetMasterSettings();this._fnRowDeselect(this.fnGetSelected(a))},fnSelect:function(a){"single"==
|
||||
this.s.select.type?(this.fnSelectNone(),this._fnRowSelect(a)):"multi"==this.s.select.type&&this._fnRowSelect(a)},fnDeselect:function(a){this._fnRowDeselect(a)},fnGetTitle:function(a){var b="";"undefined"!=typeof a.sTitle&&""!==a.sTitle?b=a.sTitle:(a=g.getElementsByTagName("title"),0<a.length&&(b=a[0].innerHTML));return 4>"\u00a1".toString().length?b.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g,""):b.replace(/[^a-zA-Z0-9_\.,\-_ !\(\)]/g,"")},fnCalcColRatios:function(a){var b=this.s.dt.aoColumns,
|
||||
a=this._fnColumnTargets(a.mColumns),c=[],d=0,f=0,e,g;e=0;for(g=a.length;e<g;e++)a[e]&&(d=b[e].nTh.offsetWidth,f+=d,c.push(d));e=0;for(g=c.length;e<g;e++)c[e]/=f;return c.join("\t")},fnGetTableData:function(a){if(this.s.dt)return this._fnGetDataTablesData(a)},fnSetText:function(a,b){this._fnFlashSetText(a,b)},fnResizeButtons:function(){for(var a in ZeroClipboard_TableTools.clients)if(a){var b=ZeroClipboard_TableTools.clients[a];"undefined"!=typeof b.domElement&&b.domElement.parentNode&&b.positionElement()}},
|
||||
fnResizeRequired:function(){for(var a in ZeroClipboard_TableTools.clients)if(a){var b=ZeroClipboard_TableTools.clients[a];if("undefined"!=typeof b.domElement&&b.domElement.parentNode==this.dom.container&&!1===b.sized)return!0}return!1},fnPrint:function(a,b){void 0===b&&(b={});void 0===a||a?this._fnPrintStart(b):this._fnPrintEnd()},fnInfo:function(a,b){var c=g.createElement("div");c.className=this.classes.print.info;c.innerHTML=a;g.body.appendChild(c);setTimeout(function(){e(c).fadeOut("normal",function(){g.body.removeChild(c)})},
|
||||
b)},_fnConstruct:function(a){var b=this;this._fnCustomiseSettings(a);this.dom.container=g.createElement(this.s.tags.container);this.dom.container.className=this.classes.container;"none"!=this.s.select.type&&this._fnRowSelectConfig();this._fnButtonDefinations(this.s.buttonSet,this.dom.container);this.s.dt.aoDestroyCallback.push({sName:"TableTools",fn:function(){e(b.s.dt.nTBody).off("click.DTTT_Select","tr");e(b.dom.container).empty()}})},_fnCustomiseSettings:function(a){"undefined"==typeof this.s.dt._TableToolsInit&&
|
||||
(this.s.master=!0,this.s.dt._TableToolsInit=!0);this.dom.table=this.s.dt.nTable;this.s.custom=e.extend({},TableTools.DEFAULTS,a);this.s.swfPath=this.s.custom.sSwfPath;"undefined"!=typeof ZeroClipboard_TableTools&&(ZeroClipboard_TableTools.moviePath=this.s.swfPath);this.s.select.type=this.s.custom.sRowSelect;this.s.select.preRowSelect=this.s.custom.fnPreRowSelect;this.s.select.postSelected=this.s.custom.fnRowSelected;this.s.select.postDeselected=this.s.custom.fnRowDeselected;this.s.custom.sSelectedClass&&
|
||||
(this.classes.select.row=this.s.custom.sSelectedClass);this.s.tags=this.s.custom.oTags;this.s.buttonSet=this.s.custom.aButtons},_fnButtonDefinations:function(a,b){for(var c,d=0,f=a.length;d<f;d++){if("string"==typeof a[d]){if("undefined"==typeof TableTools.BUTTONS[a[d]]){alert("TableTools: Warning - unknown button type: "+a[d]);continue}c=e.extend({},TableTools.BUTTONS[a[d]],!0)}else{if("undefined"==typeof TableTools.BUTTONS[a[d].sExtends]){alert("TableTools: Warning - unknown button type: "+a[d].sExtends);
|
||||
continue}c=e.extend({},TableTools.BUTTONS[a[d].sExtends],!0);c=e.extend(c,a[d],!0)}b.appendChild(this._fnCreateButton(c,e(b).hasClass(this.classes.collection.container)))}},_fnCreateButton:function(a,b){var c=this._fnButtonBase(a,b);a.sAction.match(/flash/)?this._fnFlashConfig(c,a):"text"==a.sAction?this._fnTextConfig(c,a):"div"==a.sAction?this._fnTextConfig(c,a):"collection"==a.sAction&&(this._fnTextConfig(c,a),this._fnCollectionConfig(c,a));return c},_fnButtonBase:function(a,b){var c,d,f;b?(c="default"!==
|
||||
a.sTag?a.sTag:this.s.tags.collection.button,d="default"!==a.sLinerTag?a.sLiner:this.s.tags.collection.liner,f=this.classes.collection.buttons.normal):(c="default"!==a.sTag?a.sTag:this.s.tags.button,d="default"!==a.sLinerTag?a.sLiner:this.s.tags.liner,f=this.classes.buttons.normal);c=g.createElement(c);d=g.createElement(d);var e=this._fnGetMasterSettings();c.className=f+" "+a.sButtonClass;c.setAttribute("id","ToolTables_"+this.s.dt.sInstance+"_"+e.buttonCounter);c.appendChild(d);d.innerHTML=a.sButtonText;
|
||||
e.buttonCounter++;return c},_fnGetMasterSettings:function(){if(this.s.master)return this.s;for(var a=TableTools._aInstances,b=0,c=a.length;b<c;b++)if(this.dom.table==a[b].s.dt.nTable)return a[b].s},_fnCollectionConfig:function(a,b){var c=g.createElement(this.s.tags.collection.container);c.style.display="none";c.className=this.classes.collection.container;b._collection=c;g.body.appendChild(c);this._fnButtonDefinations(b.aButtons,c)},_fnCollectionShow:function(a,b){var c=this,d=e(a).offset(),f=b._collection,
|
||||
j=d.left,d=d.top+e(a).outerHeight(),m=e(n).height(),h=e(g).height(),k=e(n).width(),o=e(g).width();f.style.position="absolute";f.style.left=j+"px";f.style.top=d+"px";f.style.display="block";e(f).css("opacity",0);var l=g.createElement("div");l.style.position="absolute";l.style.left="0px";l.style.top="0px";l.style.height=(m>h?m:h)+"px";l.style.width=(k>o?k:o)+"px";l.className=this.classes.collection.background;e(l).css("opacity",0);g.body.appendChild(l);g.body.appendChild(f);m=e(f).outerWidth();k=e(f).outerHeight();
|
||||
j+m>o&&(f.style.left=o-m+"px");d+k>h&&(f.style.top=d-k-e(a).outerHeight()+"px");this.dom.collection.collection=f;this.dom.collection.background=l;setTimeout(function(){e(f).animate({opacity:1},500);e(l).animate({opacity:0.25},500)},10);this.fnResizeButtons();e(l).click(function(){c._fnCollectionHide.call(c,null,null)})},_fnCollectionHide:function(a,b){!(null!==b&&"collection"==b.sExtends)&&null!==this.dom.collection.collection&&(e(this.dom.collection.collection).animate({opacity:0},500,function(){this.style.display=
|
||||
"none"}),e(this.dom.collection.background).animate({opacity:0},500,function(){this.parentNode.removeChild(this)}),this.dom.collection.collection=null,this.dom.collection.background=null)},_fnRowSelectConfig:function(){if(this.s.master){var a=this,b=this.s.dt;e(b.nTable).addClass(this.classes.select.table);e(b.nTBody).on("click.DTTT_Select","tr",function(c){this.parentNode==b.nTBody&&null!==b.oInstance.fnGetData(this)&&(a.fnIsSelected(this)?a._fnRowDeselect(this,c):"single"==a.s.select.type?(a.fnSelectNone(),
|
||||
a._fnRowSelect(this,c)):"multi"==a.s.select.type&&a._fnRowSelect(this,c))});b.oApi._fnCallbackReg(b,"aoRowCreatedCallback",function(c,d,f){b.aoData[f]._DTTT_selected&&e(c).addClass(a.classes.select.row)},"TableTools-SelectAll")}},_fnRowSelect:function(a,b){var c=this._fnSelectData(a),d=[],f,j;f=0;for(j=c.length;f<j;f++)c[f].nTr&&d.push(c[f].nTr);if(null===this.s.select.preRowSelect||this.s.select.preRowSelect.call(this,b,d,!0)){f=0;for(j=c.length;f<j;f++)c[f]._DTTT_selected=!0,c[f].nTr&&e(c[f].nTr).addClass(this.classes.select.row);
|
||||
null!==this.s.select.postSelected&&this.s.select.postSelected.call(this,d);TableTools._fnEventDispatch(this,"select",d,!0)}},_fnRowDeselect:function(a,b){var c=this._fnSelectData(a),d=[],f,j;f=0;for(j=c.length;f<j;f++)c[f].nTr&&d.push(c[f].nTr);if(null===this.s.select.preRowSelect||this.s.select.preRowSelect.call(this,b,d,!1)){f=0;for(j=c.length;f<j;f++)c[f]._DTTT_selected=!1,c[f].nTr&&e(c[f].nTr).removeClass(this.classes.select.row);null!==this.s.select.postDeselected&&this.s.select.postDeselected.call(this,
|
||||
d);TableTools._fnEventDispatch(this,"select",d,!1)}},_fnSelectData:function(a){var b=[],c,d,f;if(a.nodeName)c=this.s.dt.oInstance.fnGetPosition(a),b.push(this.s.dt.aoData[c]);else if("undefined"!==typeof a.length){d=0;for(f=a.length;d<f;d++)a[d].nodeName?(c=this.s.dt.oInstance.fnGetPosition(a[d]),b.push(this.s.dt.aoData[c])):"number"===typeof a[d]?b.push(this.s.dt.aoData[a[d]]):b.push(a[d])}else b.push(a);return b},_fnTextConfig:function(a,b){var c=this;null!==b.fnInit&&b.fnInit.call(this,a,b);""!==
|
||||
b.sToolTip&&(a.title=b.sToolTip);e(a).hover(function(){b.fnMouseover!==null&&b.fnMouseover.call(this,a,b,null)},function(){b.fnMouseout!==null&&b.fnMouseout.call(this,a,b,null)});null!==b.fnSelect&&TableTools._fnEventListen(this,"select",function(d){b.fnSelect.call(c,a,b,d)});e(a).click(function(d){b.fnClick!==null&&b.fnClick.call(c,a,b,null,d);b.fnComplete!==null&&b.fnComplete.call(c,a,b,null,null);c._fnCollectionHide(a,b)})},_fnFlashConfig:function(a,b){var c=this,d=new ZeroClipboard_TableTools.Client;
|
||||
null!==b.fnInit&&b.fnInit.call(this,a,b);d.setHandCursor(!0);"flash_save"==b.sAction?(d.setAction("save"),d.setCharSet("utf16le"==b.sCharSet?"UTF16LE":"UTF8"),d.setBomInc(b.bBomInc),d.setFileName(b.sFileName.replace("*",this.fnGetTitle(b)))):"flash_pdf"==b.sAction?(d.setAction("pdf"),d.setFileName(b.sFileName.replace("*",this.fnGetTitle(b)))):d.setAction("copy");d.addEventListener("mouseOver",function(){b.fnMouseover!==null&&b.fnMouseover.call(c,a,b,d)});d.addEventListener("mouseOut",function(){b.fnMouseout!==
|
||||
null&&b.fnMouseout.call(c,a,b,d)});d.addEventListener("mouseDown",function(){b.fnClick!==null&&b.fnClick.call(c,a,b,d)});d.addEventListener("complete",function(f,e){b.fnComplete!==null&&b.fnComplete.call(c,a,b,d,e);c._fnCollectionHide(a,b)});this._fnFlashGlue(d,a,b.sToolTip)},_fnFlashGlue:function(a,b,c){var d=this,f=b.getAttribute("id");g.getElementById(f)?a.glue(b,c):setTimeout(function(){d._fnFlashGlue(a,b,c)},100)},_fnFlashSetText:function(a,b){var c=this._fnChunkData(b,8192);a.clearText();for(var d=
|
||||
0,f=c.length;d<f;d++)a.appendText(c[d])},_fnColumnTargets:function(a){var b=[],c=this.s.dt;if("object"==typeof a){i=0;for(iLen=c.aoColumns.length;i<iLen;i++)b.push(!1);i=0;for(iLen=a.length;i<iLen;i++)b[a[i]]=!0}else if("visible"==a){i=0;for(iLen=c.aoColumns.length;i<iLen;i++)b.push(c.aoColumns[i].bVisible?!0:!1)}else if("hidden"==a){i=0;for(iLen=c.aoColumns.length;i<iLen;i++)b.push(c.aoColumns[i].bVisible?!1:!0)}else if("sortable"==a){i=0;for(iLen=c.aoColumns.length;i<iLen;i++)b.push(c.aoColumns[i].bSortable?
|
||||
!0:!1)}else{i=0;for(iLen=c.aoColumns.length;i<iLen;i++)b.push(!0)}return b},_fnNewline:function(a){return"auto"==a.sNewLine?navigator.userAgent.match(/Windows/)?"\r\n":"\n":a.sNewLine},_fnGetDataTablesData:function(a){var b,c,d,f,j,g=[],h="",k=this.s.dt,o,l=RegExp(a.sFieldBoundary,"g"),n=this._fnColumnTargets(a.mColumns);d="undefined"!=typeof a.bSelectedOnly?a.bSelectedOnly:!1;if(a.bHeader){j=[];b=0;for(c=k.aoColumns.length;b<c;b++)n[b]&&(h=k.aoColumns[b].sTitle.replace(/\n/g," ").replace(/<.*?>/g,
|
||||
"").replace(/^\s+|\s+$/g,""),h=this._fnHtmlDecode(h),j.push(this._fnBoundData(h,a.sFieldBoundary,l)));g.push(j.join(a.sFieldSeperator))}var p=k.aiDisplay;f=this.fnGetSelected();if("none"!==this.s.select.type&&d&&0!==f.length){p=[];b=0;for(c=f.length;b<c;b++)p.push(k.oInstance.fnGetPosition(f[b]))}d=0;for(f=p.length;d<f;d++){o=k.aoData[p[d]].nTr;j=[];b=0;for(c=k.aoColumns.length;b<c;b++)n[b]&&(h=k.oApi._fnGetCellData(k,p[d],b,"display"),a.fnCellRender?h=a.fnCellRender(h,b,o,p[d])+"":"string"==typeof h?
|
||||
(h=h.replace(/\n/g," "),h=h.replace(/<img.*?\s+alt\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s>]+)).*?>/gi,"$1$2$3"),h=h.replace(/<.*?>/g,"")):h+="",h=h.replace(/^\s+/,"").replace(/\s+$/,""),h=this._fnHtmlDecode(h),j.push(this._fnBoundData(h,a.sFieldBoundary,l)));g.push(j.join(a.sFieldSeperator));a.bOpenRows&&(b=e.grep(k.aoOpenRows,function(a){return a.nParent===o}),1===b.length&&(h=this._fnBoundData(e("td",b[0].nTr).html(),a.sFieldBoundary,l),g.push(h)))}if(a.bFooter&&null!==k.nTFoot){j=[];b=0;for(c=k.aoColumns.length;b<
|
||||
c;b++)n[b]&&null!==k.aoColumns[b].nTf&&(h=k.aoColumns[b].nTf.innerHTML.replace(/\n/g," ").replace(/<.*?>/g,""),h=this._fnHtmlDecode(h),j.push(this._fnBoundData(h,a.sFieldBoundary,l)));g.push(j.join(a.sFieldSeperator))}return _sLastData=g.join(this._fnNewline(a))},_fnBoundData:function(a,b,c){return""===b?a:b+a.replace(c,b+b)+b},_fnChunkData:function(a,b){for(var c=[],d=a.length,f=0;f<d;f+=b)f+b<d?c.push(a.substring(f,f+b)):c.push(a.substring(f,d));return c},_fnHtmlDecode:function(a){if(-1===a.indexOf("&"))return a;
|
||||
var b=g.createElement("div");return a.replace(/&([^\s]*);/g,function(a,d){if("#"===a.substr(1,1))return String.fromCharCode(Number(d.substr(1)));b.innerHTML=a;return b.childNodes[0].nodeValue})},_fnPrintStart:function(a){var b=this,c=this.s.dt;this._fnPrintHideNodes(c.nTable);this.s.print.saveStart=c._iDisplayStart;this.s.print.saveLength=c._iDisplayLength;a.bShowAll&&(c._iDisplayStart=0,c._iDisplayLength=-1,c.oApi._fnCalculateEnd(c),c.oApi._fnDraw(c));if(""!==c.oScroll.sX||""!==c.oScroll.sY)this._fnPrintScrollStart(c),
|
||||
e(this.s.dt.nTable).bind("draw.DTTT_Print",function(){b._fnPrintScrollStart(c)});var d=c.aanFeatures,f;for(f in d)if("i"!=f&&"t"!=f&&1==f.length)for(var j=0,m=d[f].length;j<m;j++)this.dom.print.hidden.push({node:d[f][j],display:"block"}),d[f][j].style.display="none";e(g.body).addClass(this.classes.print.body);""!==a.sInfo&&this.fnInfo(a.sInfo,3E3);a.sMessage&&(this.dom.print.message=g.createElement("div"),this.dom.print.message.className=this.classes.print.message,this.dom.print.message.innerHTML=
|
||||
a.sMessage,g.body.insertBefore(this.dom.print.message,g.body.childNodes[0]));this.s.print.saveScroll=e(n).scrollTop();n.scrollTo(0,0);e(g).bind("keydown.DTTT",function(a){if(a.keyCode==27){a.preventDefault();b._fnPrintEnd.call(b,a)}})},_fnPrintEnd:function(){var a=this.s.dt,b=this.s.print,c=this.dom.print;this._fnPrintShowNodes();if(""!==a.oScroll.sX||""!==a.oScroll.sY)e(this.s.dt.nTable).unbind("draw.DTTT_Print"),this._fnPrintScrollEnd();n.scrollTo(0,b.saveScroll);null!==c.message&&(g.body.removeChild(c.message),
|
||||
c.message=null);e(g.body).removeClass("DTTT_Print");a._iDisplayStart=b.saveStart;a._iDisplayLength=b.saveLength;a.oApi._fnCalculateEnd(a);a.oApi._fnDraw(a);e(g).unbind("keydown.DTTT")},_fnPrintScrollStart:function(){var a=this.s.dt;a.nScrollHead.getElementsByTagName("div")[0].getElementsByTagName("table");var b=a.nTable.parentNode,c=a.nTable.getElementsByTagName("thead");0<c.length&&a.nTable.removeChild(c[0]);null!==a.nTFoot&&(c=a.nTable.getElementsByTagName("tfoot"),0<c.length&&a.nTable.removeChild(c[0]));
|
||||
c=a.nTHead.cloneNode(!0);a.nTable.insertBefore(c,a.nTable.childNodes[0]);null!==a.nTFoot&&(c=a.nTFoot.cloneNode(!0),a.nTable.insertBefore(c,a.nTable.childNodes[1]));""!==a.oScroll.sX&&(a.nTable.style.width=e(a.nTable).outerWidth()+"px",b.style.width=e(a.nTable).outerWidth()+"px",b.style.overflow="visible");""!==a.oScroll.sY&&(b.style.height=e(a.nTable).outerHeight()+"px",b.style.overflow="visible")},_fnPrintScrollEnd:function(){var a=this.s.dt,b=a.nTable.parentNode;""!==a.oScroll.sX&&(b.style.width=
|
||||
a.oApi._fnStringToCss(a.oScroll.sX),b.style.overflow="auto");""!==a.oScroll.sY&&(b.style.height=a.oApi._fnStringToCss(a.oScroll.sY),b.style.overflow="auto")},_fnPrintShowNodes:function(){for(var a=this.dom.print.hidden,b=0,c=a.length;b<c;b++)a[b].node.style.display=a[b].display;a.splice(0,a.length)},_fnPrintHideNodes:function(a){for(var b=this.dom.print.hidden,c=a.parentNode,d=c.childNodes,f=0,g=d.length;f<g;f++)if(d[f]!=a&&1==d[f].nodeType){var m=e(d[f]).css("display");"none"!=m&&(b.push({node:d[f],
|
||||
display:m}),d[f].style.display="none")}"BODY"!=c.nodeName&&this._fnPrintHideNodes(c)}};TableTools._aInstances=[];TableTools._aListeners=[];TableTools.fnGetMasters=function(){for(var a=[],b=0,c=TableTools._aInstances.length;b<c;b++)TableTools._aInstances[b].s.master&&a.push(TableTools._aInstances[b]);return a};TableTools.fnGetInstance=function(a){"object"!=typeof a&&(a=g.getElementById(a));for(var b=0,c=TableTools._aInstances.length;b<c;b++)if(TableTools._aInstances[b].s.master&&TableTools._aInstances[b].dom.table==
|
||||
a)return TableTools._aInstances[b];return null};TableTools._fnEventListen=function(a,b,c){TableTools._aListeners.push({that:a,type:b,fn:c})};TableTools._fnEventDispatch=function(a,b,c,d){for(var f=TableTools._aListeners,e=0,g=f.length;e<g;e++)a.dom.table==f[e].that.dom.table&&f[e].type==b&&f[e].fn(c,d)};TableTools.buttonBase={sAction:"text",sTag:"default",sLinerTag:"default",sButtonClass:"DTTT_button_text",sButtonText:"Button text",sTitle:"",sToolTip:"",sCharSet:"utf8",bBomInc:!1,sFileName:"*.csv",
|
||||
sFieldBoundary:"",sFieldSeperator:"\t",sNewLine:"auto",mColumns:"all",bHeader:!0,bFooter:!0,bOpenRows:!1,bSelectedOnly:!1,fnMouseover:null,fnMouseout:null,fnClick:null,fnSelect:null,fnComplete:null,fnInit:null,fnCellRender:null};TableTools.BUTTONS={csv:e.extend({},TableTools.buttonBase,{sAction:"flash_save",sButtonClass:"DTTT_button_csv",sButtonText:"CSV",sFieldBoundary:'"',sFieldSeperator:",",fnClick:function(a,b,c){this.fnSetText(c,this.fnGetTableData(b))}}),xls:e.extend({},TableTools.buttonBase,
|
||||
{sAction:"flash_save",sCharSet:"utf16le",bBomInc:!0,sButtonClass:"DTTT_button_xls",sButtonText:"Excel",fnClick:function(a,b,c){this.fnSetText(c,this.fnGetTableData(b))}}),copy:e.extend({},TableTools.buttonBase,{sAction:"flash_copy",sButtonClass:"DTTT_button_copy",sButtonText:"Copy",fnClick:function(a,b,c){this.fnSetText(c,this.fnGetTableData(b))},fnComplete:function(a,b,c,d){a=d.split("\n").length;a=null===this.s.dt.nTFoot?a-1:a-2;this.fnInfo("<h6>Table copied</h6><p>Copied "+a+" row"+(1==a?"":"s")+
|
||||
" to the clipboard.</p>",1500)}}),pdf:e.extend({},TableTools.buttonBase,{sAction:"flash_pdf",sNewLine:"\n",sFileName:"*.pdf",sButtonClass:"DTTT_button_pdf",sButtonText:"PDF",sPdfOrientation:"portrait",sPdfSize:"A4",sPdfMessage:"",fnClick:function(a,b,c){this.fnSetText(c,"title:"+this.fnGetTitle(b)+"\nmessage:"+b.sPdfMessage+"\ncolWidth:"+this.fnCalcColRatios(b)+"\norientation:"+b.sPdfOrientation+"\nsize:"+b.sPdfSize+"\n--/TableToolsOpts--\n"+this.fnGetTableData(b))}}),print:e.extend({},TableTools.buttonBase,
|
||||
{sInfo:"<h6>Print view</h6><p>Please use your browser's print function to print this table. Press escape when finished.",sMessage:null,bShowAll:!0,sToolTip:"View print view",sButtonClass:"DTTT_button_print",sButtonText:"Print",fnClick:function(a,b){this.fnPrint(!0,b)}}),text:e.extend({},TableTools.buttonBase),select:e.extend({},TableTools.buttonBase,{sButtonText:"Select button",fnSelect:function(a){0!==this.fnGetSelected().length?e(a).removeClass(this.classes.buttons.disabled):e(a).addClass(this.classes.buttons.disabled)},
|
||||
fnInit:function(a){e(a).addClass(this.classes.buttons.disabled)}}),select_single:e.extend({},TableTools.buttonBase,{sButtonText:"Select button",fnSelect:function(a){1==this.fnGetSelected().length?e(a).removeClass(this.classes.buttons.disabled):e(a).addClass(this.classes.buttons.disabled)},fnInit:function(a){e(a).addClass(this.classes.buttons.disabled)}}),select_all:e.extend({},TableTools.buttonBase,{sButtonText:"Select all",fnClick:function(){this.fnSelectAll()},fnSelect:function(a){this.fnGetSelected().length==
|
||||
this.s.dt.fnRecordsDisplay()?e(a).addClass(this.classes.buttons.disabled):e(a).removeClass(this.classes.buttons.disabled)}}),select_none:e.extend({},TableTools.buttonBase,{sButtonText:"Deselect all",fnClick:function(){this.fnSelectNone()},fnSelect:function(a){0!==this.fnGetSelected().length?e(a).removeClass(this.classes.buttons.disabled):e(a).addClass(this.classes.buttons.disabled)},fnInit:function(a){e(a).addClass(this.classes.buttons.disabled)}}),ajax:e.extend({},TableTools.buttonBase,{sAjaxUrl:"/xhr.php",
|
||||
sButtonText:"Ajax button",fnClick:function(a,b){var c=this.fnGetTableData(b);e.ajax({url:b.sAjaxUrl,data:[{name:"tableData",value:c}],success:b.fnAjaxComplete,dataType:"json",type:"POST",cache:!1,error:function(){alert("Error detected when sending table data to server")}})},fnAjaxComplete:function(){alert("Ajax complete")}}),div:e.extend({},TableTools.buttonBase,{sAction:"div",sTag:"div",sButtonClass:"DTTT_nonbutton",sButtonText:"Text button"}),collection:e.extend({},TableTools.buttonBase,{sAction:"collection",
|
||||
sButtonClass:"DTTT_button_collection",sButtonText:"Collection",fnClick:function(a,b){this._fnCollectionShow(a,b)}})};TableTools.classes={container:"DTTT_container",buttons:{normal:"DTTT_button",disabled:"DTTT_disabled"},collection:{container:"DTTT_collection",background:"DTTT_collection_background",buttons:{normal:"DTTT_button",disabled:"DTTT_disabled"}},select:{table:"DTTT_selectable",row:"DTTT_selected"},print:{body:"DTTT_Print",info:"DTTT_print_info",message:"DTTT_PrintMessage"}};TableTools.classes_themeroller=
|
||||
{container:"DTTT_container ui-buttonset ui-buttonset-multi",buttons:{normal:"DTTT_button ui-button ui-state-default"},collection:{container:"DTTT_collection ui-buttonset ui-buttonset-multi"}};TableTools.DEFAULTS={sSwfPath:"media/swf/copy_csv_xls_pdf.swf",sRowSelect:"none",sSelectedClass:null,fnPreRowSelect:null,fnRowSelected:null,fnRowDeselected:null,aButtons:["copy","csv","xls","pdf","print"],oTags:{container:"div",button:"a",liner:"span",collection:{container:"div",button:"a",liner:"span"}}};TableTools.prototype.CLASS=
|
||||
"TableTools";TableTools.VERSION="2.1.5";TableTools.prototype.VERSION=TableTools.VERSION;"function"==typeof e.fn.dataTable&&"function"==typeof e.fn.dataTableExt.fnVersionCheck&&e.fn.dataTableExt.fnVersionCheck("1.9.0")?e.fn.dataTableExt.aoFeatures.push({fnInit:function(a){a=new TableTools(a.oInstance,"undefined"!=typeof a.oInit.oTableTools?a.oInit.oTableTools:{});TableTools._aInstances.push(a);return a.dom.container},cFeature:"T",sFeature:"TableTools"}):alert("Warning: TableTools 2 requires DataTables 1.9.0 or newer - www.datatables.net/download");
|
||||
e.fn.DataTable.TableTools=TableTools})(jQuery,window,document);
|
|
@ -1,7 +1,7 @@
|
|||
// Simple Set Clipboard System
|
||||
// Author: Joseph Huckaby
|
||||
|
||||
var ZeroClipboard = {
|
||||
var ZeroClipboard_TableTools = {
|
||||
|
||||
version: "1.0.4-TableTools2",
|
||||
clients: {}, // registered upload clients on page, indexed by id
|
||||
|
@ -73,18 +73,18 @@ var ZeroClipboard = {
|
|||
this.handlers = {};
|
||||
|
||||
// unique ID
|
||||
this.id = ZeroClipboard.nextId++;
|
||||
this.movieId = 'ZeroClipboardMovie_' + this.id;
|
||||
this.id = ZeroClipboard_TableTools.nextId++;
|
||||
this.movieId = 'ZeroClipboard_TableToolsMovie_' + this.id;
|
||||
|
||||
// register client with singleton to receive flash events
|
||||
ZeroClipboard.register(this.id, this);
|
||||
ZeroClipboard_TableTools.register(this.id, this);
|
||||
|
||||
// create movie
|
||||
if (elem) this.glue(elem);
|
||||
}
|
||||
};
|
||||
|
||||
ZeroClipboard.Client.prototype = {
|
||||
ZeroClipboard_TableTools.Client.prototype = {
|
||||
|
||||
id: 0, // unique ID for us
|
||||
ready: false, // whether movie is ready to receive events or not
|
||||
|
@ -100,7 +100,7 @@ ZeroClipboard.Client.prototype = {
|
|||
glue: function(elem, title) {
|
||||
// glue to DOM element
|
||||
// elem can be ID or actual DOM element object
|
||||
this.domElement = ZeroClipboard.$(elem);
|
||||
this.domElement = ZeroClipboard_TableTools.$(elem);
|
||||
|
||||
// float just above object, or zIndex 99 if dom element isn't set
|
||||
var zIndex = 99;
|
||||
|
@ -109,19 +109,18 @@ ZeroClipboard.Client.prototype = {
|
|||
}
|
||||
|
||||
// find X/Y position of domElement
|
||||
var box = ZeroClipboard.getDOMObjectPosition(this.domElement);
|
||||
var box = ZeroClipboard_TableTools.getDOMObjectPosition(this.domElement);
|
||||
|
||||
// create floating DIV above element
|
||||
this.div = document.createElement('div');
|
||||
var style = this.div.style;
|
||||
style.position = 'absolute';
|
||||
style.left = (this.domElement.offsetLeft)+'px';
|
||||
//style.left = (this.domElement.offsetLeft+2)+'px';
|
||||
style.top = this.domElement.offsetTop+'px';
|
||||
style.left = '0px';
|
||||
style.top = '0px';
|
||||
style.width = (box.width) + 'px';
|
||||
//style.width = (box.width-4) + 'px';
|
||||
style.height = box.height + 'px';
|
||||
style.zIndex = zIndex;
|
||||
|
||||
if ( typeof title != "undefined" && title != "" ) {
|
||||
this.div.title = title;
|
||||
}
|
||||
|
@ -130,18 +129,19 @@ ZeroClipboard.Client.prototype = {
|
|||
}
|
||||
|
||||
// style.backgroundColor = '#f00'; // debug
|
||||
this.domElement.parentNode.appendChild(this.div);
|
||||
|
||||
this.div.innerHTML = this.getHTML( box.width, box.height );
|
||||
if ( this.domElement ) {
|
||||
this.domElement.appendChild(this.div);
|
||||
this.div.innerHTML = this.getHTML( box.width, box.height );
|
||||
}
|
||||
},
|
||||
|
||||
positionElement: function() {
|
||||
var box = ZeroClipboard.getDOMObjectPosition(this.domElement);
|
||||
var box = ZeroClipboard_TableTools.getDOMObjectPosition(this.domElement);
|
||||
var style = this.div.style;
|
||||
|
||||
style.position = 'absolute';
|
||||
style.left = (this.domElement.offsetLeft)+'px';
|
||||
style.top = this.domElement.offsetTop+'px';
|
||||
//style.left = (this.domElement.offsetLeft)+'px';
|
||||
//style.top = this.domElement.offsetTop+'px';
|
||||
style.width = box.width + 'px';
|
||||
style.height = box.height + 'px';
|
||||
|
||||
|
@ -166,11 +166,11 @@ ZeroClipboard.Client.prototype = {
|
|||
if (navigator.userAgent.match(/MSIE/)) {
|
||||
// IE gets an OBJECT tag
|
||||
var protocol = location.href.match(/^https/i) ? 'https://' : 'http://';
|
||||
html += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+protocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="'+width+'" height="'+height+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><param name="wmode" value="transparent"/></object>';
|
||||
html += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+protocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="'+width+'" height="'+height+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard_TableTools.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><param name="wmode" value="transparent"/></object>';
|
||||
}
|
||||
else {
|
||||
// all other browsers get an EMBED tag
|
||||
html += '<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'" wmode="transparent" />';
|
||||
html += '<embed id="'+this.movieId+'" src="'+ZeroClipboard_TableTools.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'" wmode="transparent" />';
|
||||
}
|
||||
return html;
|
||||
},
|
||||
|
@ -205,12 +205,12 @@ ZeroClipboard.Client.prototype = {
|
|||
// reposition our floating div, optionally to new container
|
||||
// warning: container CANNOT change size, only position
|
||||
if (elem) {
|
||||
this.domElement = ZeroClipboard.$(elem);
|
||||
this.domElement = ZeroClipboard_TableTools.$(elem);
|
||||
if (!this.domElement) this.hide();
|
||||
}
|
||||
|
||||
if (this.domElement && this.div) {
|
||||
var box = ZeroClipboard.getDOMObjectPosition(this.domElement);
|
||||
var box = ZeroClipboard_TableTools.getDOMObjectPosition(this.domElement);
|
||||
var style = this.div.style;
|
||||
style.left = '' + box.left + 'px';
|
||||
style.top = '' + box.top + 'px';
|
|
@ -1,264 +0,0 @@
|
|||
/*
|
||||
* File: TableTools.css
|
||||
* Description: Styles for TableTools 2
|
||||
* Author: Allan Jardine (www.sprymedia.co.uk)
|
||||
* Language: Javascript
|
||||
* License: LGPL / 3 point BSD
|
||||
* Project: DataTables
|
||||
*
|
||||
* Copyright 2010 Allan Jardine, all rights reserved.
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* CSS name space:
|
||||
* DTTT DataTables TableTools
|
||||
*
|
||||
* Colour dictionary:
|
||||
* Button border #d0d0d0
|
||||
* Button border hover #999999
|
||||
* Hover background #f0f0f0
|
||||
* Action blue #4b66d9
|
||||
*
|
||||
* Style sheet provides:
|
||||
* CONTAINER TableTools container element and styles applying to all components
|
||||
* BUTTON_STYLES Action specific button styles
|
||||
* SELECTING Row selection styles
|
||||
* COLLECTIONS Drop down list (collection) styles
|
||||
* PRINTING Print display styles
|
||||
* MISC Minor misc styles
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* CONTAINER
|
||||
* TableTools container element and styles applying to all components
|
||||
*/
|
||||
div.DTTT_container {
|
||||
position: relative;
|
||||
float: right;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
button.DTTT_button {
|
||||
position: relative;
|
||||
float: left;
|
||||
height: 30px;
|
||||
margin-right: 3px;
|
||||
padding: 3px 5px;
|
||||
border: 1px solid #d0d0d0;
|
||||
background-color: #fff;
|
||||
cursor: pointer;
|
||||
*cursor: hand;
|
||||
}
|
||||
|
||||
button.DTTT_button::-moz-focus-inner {
|
||||
border: none !important;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* BUTTON_STYLES
|
||||
* Action specific button styles
|
||||
*/
|
||||
|
||||
button.DTTT_button_csv {
|
||||
padding-right: 30px;
|
||||
background: #6E6E6E url(../images/csv.png) no-repeat center right !important;
|
||||
}
|
||||
|
||||
button.DTTT_button_csv_hover {
|
||||
padding-right: 30px;
|
||||
background: #868686 url(../images/csv_hover.png) no-repeat center right !important;
|
||||
}
|
||||
|
||||
|
||||
button.DTTT_button_xls {
|
||||
padding-right: 30px;
|
||||
background: #6E6E6E url(../images/xls.png) no-repeat center right !important;
|
||||
}
|
||||
|
||||
button.DTTT_button_xls_hover {
|
||||
padding-right: 30px;
|
||||
border: 1px solid #999;
|
||||
background: #868686 url(../images/xls_hover.png) no-repeat center right !important;
|
||||
}
|
||||
|
||||
|
||||
button.DTTT_button_copy {
|
||||
padding-right: 30px;
|
||||
background: #6E6E6E url(../images/copy.png) no-repeat center right !important;
|
||||
}
|
||||
|
||||
button.DTTT_button_copy_hover {
|
||||
padding-right: 30px;
|
||||
border: 1px solid #999;
|
||||
background: #868686 url(../images/copy_hover.png) no-repeat center right !important;
|
||||
}
|
||||
|
||||
|
||||
button.DTTT_button_pdf {
|
||||
padding-right: 30px;
|
||||
background: #6E6E6E url(../images/pdf.png) no-repeat center right !important;
|
||||
}
|
||||
|
||||
button.DTTT_button_pdf_hover {
|
||||
padding-right: 30px;
|
||||
border: 1px solid #999;
|
||||
background: #868686 url(../images/pdf_hover.png) no-repeat center right !important;
|
||||
}
|
||||
|
||||
|
||||
button.DTTT_button_print {
|
||||
padding-right: 30px;
|
||||
background: #6E6E6E url(../images/print.png) no-repeat center right !important;
|
||||
}
|
||||
|
||||
button.DTTT_button_print_hover {
|
||||
padding-right: 30px;
|
||||
border: 1px solid #999;
|
||||
background: #868686 url(../images/print_hover.png) no-repeat center right !important;
|
||||
}
|
||||
|
||||
|
||||
button.DTTT_button_text {
|
||||
}
|
||||
|
||||
button.DTTT_button_text_hover {
|
||||
border: 1px solid #999;
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
|
||||
button.DTTT_button_collection {
|
||||
padding-right: 17px;
|
||||
background: url(../images/collection.png) no-repeat center right;
|
||||
}
|
||||
|
||||
button.DTTT_button_collection_hover {
|
||||
padding-right: 17px;
|
||||
border: 1px solid #999;
|
||||
background: #f0f0f0 url(../images/collection_hover.png) no-repeat center right;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* SELECTING
|
||||
* Row selection styles
|
||||
*/
|
||||
table.DTTT_selectable tbody tr {
|
||||
cursor: pointer;
|
||||
*cursor: hand;
|
||||
}
|
||||
|
||||
tr.DTTT_selected.odd {
|
||||
background-color: #9FAFD1;
|
||||
}
|
||||
|
||||
tr.DTTT_selected.odd td.sorting_1 {
|
||||
background-color: #9FAFD1;
|
||||
}
|
||||
|
||||
tr.DTTT_selected.odd td.sorting_2 {
|
||||
background-color: #9FAFD1;
|
||||
}
|
||||
|
||||
tr.DTTT_selected.odd td.sorting_3 {
|
||||
background-color: #9FAFD1;
|
||||
}
|
||||
|
||||
|
||||
tr.DTTT_selected.even {
|
||||
background-color: #B0BED9;
|
||||
}
|
||||
|
||||
tr.DTTT_selected.even td.sorting_1 {
|
||||
background-color: #B0BED9;
|
||||
}
|
||||
|
||||
tr.DTTT_selected.even td.sorting_2 {
|
||||
background-color: #B0BED9;
|
||||
}
|
||||
|
||||
tr.DTTT_selected.even td.sorting_3 {
|
||||
background-color: #B0BED9;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* COLLECTIONS
|
||||
* Drop down list (collection) styles
|
||||
*/
|
||||
|
||||
div.DTTT_collection {
|
||||
width: 150px;
|
||||
padding: 3px;
|
||||
border: 1px solid #ccc;
|
||||
background-color: #f3f3f3;
|
||||
overflow: hidden;
|
||||
z-index: 2002;
|
||||
}
|
||||
|
||||
div.DTTT_collection_background {
|
||||
background: transparent url(../images/background.png) repeat top left;
|
||||
z-index: 2001;
|
||||
}
|
||||
|
||||
div.DTTT_collection button.DTTT_button {
|
||||
float: none;
|
||||
width: 100%;
|
||||
margin-bottom: 2px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* PRINTING
|
||||
* Print display styles
|
||||
*/
|
||||
|
||||
.DTTT_print_info {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 400px;
|
||||
height: 150px;
|
||||
margin-left: -200px;
|
||||
margin-top: -75px;
|
||||
text-align: center;
|
||||
background-color: #3f3f3f;
|
||||
color: white;
|
||||
padding: 10px 30px;
|
||||
|
||||
opacity: 0.9;
|
||||
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
|
||||
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.5);
|
||||
-moz-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.5);
|
||||
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.DTTT_print_info h6 {
|
||||
font-weight: normal;
|
||||
font-size: 28px;
|
||||
line-height: 28px;
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
.DTTT_print_info p {
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* MISC
|
||||
* Minor misc styles
|
||||
*/
|
||||
|
||||
.DTTT_disabled {
|
||||
color: #999;
|
||||
}
|
|
@ -1,81 +0,0 @@
|
|||
// Simple Set Clipboard System
|
||||
// Author: Joseph Huckaby
|
||||
var ZeroClipboard={version:"1.0.4-TableTools2",clients:{},moviePath:"",nextId:1,$:function(a){"string"==typeof a&&(a=document.getElementById(a));if(!a.addClass)a.hide=function(){this.style.display="none"},a.show=function(){this.style.display=""},a.addClass=function(a){this.removeClass(a);this.className+=" "+a},a.removeClass=function(a){this.className=this.className.replace(RegExp("\\s*"+a+"\\s*")," ").replace(/^\s+/,"").replace(/\s+$/,"")},a.hasClass=function(a){return!!this.className.match(RegExp("\\s*"+
|
||||
a+"\\s*"))};return a},setMoviePath:function(a){this.moviePath=a},dispatch:function(a,b,c){(a=this.clients[a])&&a.receiveEvent(b,c)},register:function(a,b){this.clients[a]=b},getDOMObjectPosition:function(a){var b={left:0,top:0,width:a.width?a.width:a.offsetWidth,height:a.height?a.height:a.offsetHeight};if(""!=a.style.width)b.width=a.style.width.replace("px","");if(""!=a.style.height)b.height=a.style.height.replace("px","");for(;a;)b.left+=a.offsetLeft,b.top+=a.offsetTop,a=a.offsetParent;return b},
|
||||
Client:function(a){this.handlers={};this.id=ZeroClipboard.nextId++;this.movieId="ZeroClipboardMovie_"+this.id;ZeroClipboard.register(this.id,this);a&&this.glue(a)}};
|
||||
ZeroClipboard.Client.prototype={id:0,ready:!1,movie:null,clipText:"",fileName:"",action:"copy",handCursorEnabled:!0,cssEffects:!0,handlers:null,sized:!1,glue:function(a,b){this.domElement=ZeroClipboard.$(a);var c=99;this.domElement.style.zIndex&&(c=parseInt(this.domElement.style.zIndex)+1);var d=ZeroClipboard.getDOMObjectPosition(this.domElement);this.div=document.createElement("div");var e=this.div.style;e.position="absolute";e.left=this.domElement.offsetLeft+"px";e.top=this.domElement.offsetTop+
|
||||
"px";e.width=d.width+"px";e.height=d.height+"px";e.zIndex=c;if("undefined"!=typeof b&&""!=b)this.div.title=b;if(0!=d.width&&0!=d.height)this.sized=!0;this.domElement.parentNode.appendChild(this.div);this.div.innerHTML=this.getHTML(d.width,d.height)},positionElement:function(){var a=ZeroClipboard.getDOMObjectPosition(this.domElement),b=this.div.style;b.position="absolute";b.left=this.domElement.offsetLeft+"px";b.top=this.domElement.offsetTop+"px";b.width=a.width+"px";b.height=a.height+"px";if(0!=a.width&&
|
||||
0!=a.height)this.sized=!0,b=this.div.childNodes[0],b.width=a.width,b.height=a.height},getHTML:function(a,b){var c="",d="id="+this.id+"&width="+a+"&height="+b;if(navigator.userAgent.match(/MSIE/))var e=location.href.match(/^https/i)?"https://":"http://",c=c+('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+e+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="'+a+'" height="'+b+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+
|
||||
ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+d+'"/><param name="wmode" value="transparent"/></object>');else c+='<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+a+'" height="'+b+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+
|
||||
d+'" wmode="transparent" />';return c},hide:function(){if(this.div)this.div.style.left="-2000px"},show:function(){this.reposition()},destroy:function(){if(this.domElement&&this.div){this.hide();this.div.innerHTML="";var a=document.getElementsByTagName("body")[0];try{a.removeChild(this.div)}catch(b){}this.div=this.domElement=null}},reposition:function(a){if(a)(this.domElement=ZeroClipboard.$(a))||this.hide();if(this.domElement&&this.div){var a=ZeroClipboard.getDOMObjectPosition(this.domElement),b=
|
||||
this.div.style;b.left=""+a.left+"px";b.top=""+a.top+"px"}},clearText:function(){this.clipText="";this.ready&&this.movie.clearText()},appendText:function(a){this.clipText+=a;this.ready&&this.movie.appendText(a)},setText:function(a){this.clipText=a;this.ready&&this.movie.setText(a)},setCharSet:function(a){this.charSet=a;this.ready&&this.movie.setCharSet(a)},setBomInc:function(a){this.incBom=a;this.ready&&this.movie.setBomInc(a)},setFileName:function(a){this.fileName=a;this.ready&&this.movie.setFileName(a)},
|
||||
setAction:function(a){this.action=a;this.ready&&this.movie.setAction(a)},addEventListener:function(a,b){a=a.toString().toLowerCase().replace(/^on/,"");this.handlers[a]||(this.handlers[a]=[]);this.handlers[a].push(b)},setHandCursor:function(a){this.handCursorEnabled=a;this.ready&&this.movie.setHandCursor(a)},setCSSEffects:function(a){this.cssEffects=!!a},receiveEvent:function(a,b){a=a.toString().toLowerCase().replace(/^on/,"");switch(a){case "load":this.movie=document.getElementById(this.movieId);
|
||||
if(!this.movie){var c=this;setTimeout(function(){c.receiveEvent("load",null)},1);return}if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){c=this;setTimeout(function(){c.receiveEvent("load",null)},100);this.ready=!0;return}this.ready=!0;this.movie.clearText();this.movie.appendText(this.clipText);this.movie.setFileName(this.fileName);this.movie.setAction(this.action);this.movie.setCharSet(this.charSet);this.movie.setBomInc(this.incBom);this.movie.setHandCursor(this.handCursorEnabled);
|
||||
break;case "mouseover":this.domElement&&this.cssEffects&&this.recoverActive&&this.domElement.addClass("active");break;case "mouseout":if(this.domElement&&this.cssEffects&&(this.recoverActive=!1,this.domElement.hasClass("active")))this.domElement.removeClass("active"),this.recoverActive=!0;break;case "mousedown":this.domElement&&this.cssEffects&&this.domElement.addClass("active");break;case "mouseup":if(this.domElement&&this.cssEffects)this.domElement.removeClass("active"),this.recoverActive=!1}if(this.handlers[a])for(var d=
|
||||
0,e=this.handlers[a].length;d<e;d++){var f=this.handlers[a][d];if("function"==typeof f)f(this,b);else if("object"==typeof f&&2==f.length)f[0][f[1]](this,b);else if("string"==typeof f)window[f](this,b)}}};
|
||||
|
||||
|
||||
/*
|
||||
* File: TableTools.min.js
|
||||
* Version: 2.0.2
|
||||
* Author: Allan Jardine (www.sprymedia.co.uk)
|
||||
*
|
||||
* Copyright 2009-2011 Allan Jardine, all rights reserved.
|
||||
*
|
||||
* This source file is free software, under either the GPL v2 license or a
|
||||
* BSD (3 point) 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. See the license files for details.
|
||||
*/
|
||||
var TableTools;
|
||||
(function(e,n,h){TableTools=function(a,b){(!this.CLASS||"TableTools"!=this.CLASS)&&alert("Warning: TableTools must be initialised with the keyword 'new'");this.s={that:this,dt:null,print:{saveStart:-1,saveLength:-1,saveScroll:-1,funcEnd:function(){}},buttonCounter:0,select:{type:"",selected:[],preRowSelect:null,postSelected:null,postDeselected:null,all:!1,selectedClass:""},custom:{},swfPath:"",buttonSet:[],master:!1};this.dom={container:null,table:null,print:{hidden:[],message:null},collection:{collection:null,
|
||||
background:null}};this.fnSettings=function(){return this.s};"undefined"==typeof b&&(b={});this.s.dt=a.fnSettings();this._fnConstruct(b);return this};TableTools.prototype={fnGetSelected:function(){return this._fnGetMasterSettings().select.selected},fnGetSelectedData:function(){for(var a=this._fnGetMasterSettings().select.selected,b=[],c=0,d=a.length;c<d;c++)b.push(this.s.dt.oInstance.fnGetData(a[c]));return b},fnIsSelected:function(a){for(var b=this.fnGetSelected(),c=0,d=b.length;c<d;c++)if(a==b[c])return!0;
|
||||
return!1},fnSelectAll:function(){this._fnGetMasterSettings().that._fnRowSelectAll()},fnSelectNone:function(){this._fnGetMasterSettings().that._fnRowDeselectAll()},fnSelect:function(a){this.fnIsSelected(a)||("single"==this.s.select.type?this._fnRowSelectSingle(a):"multi"==this.s.select.type&&this._fnRowSelectMulti(a))},fnDeselect:function(a){this.fnIsSelected(a)&&("single"==this.s.select.type?this._fnRowSelectSingle(a):"multi"==this.s.select.type&&this._fnRowSelectMulti(a))},fnGetTitle:function(a){var b=
|
||||
"";if("undefined"!=typeof a.sTitle&&""!==a.sTitle)b=a.sTitle;else if(a=h.getElementsByTagName("title"),0<a.length)b=a[0].innerHTML;return 4>"\u00a1".toString().length?b.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g,""):b.replace(/[^a-zA-Z0-9_\.,\-_ !\(\)]/g,"")},fnCalcColRatios:function(a){var b=this.s.dt.aoColumns,a=this._fnColumnTargets(a.mColumns),c=[],d=0,e=0,f,g;for(f=0,g=a.length;f<g;f++)if(a[f])d=b[f].nTh.offsetWidth,e+=d,c.push(d);for(f=0,g=c.length;f<g;f++)c[f]/=e;return c.join("\t")},
|
||||
fnGetTableData:function(a){if(this.s.dt)return this._fnGetDataTablesData(a)},fnSetText:function(a,b){this._fnFlashSetText(a,b)},fnResizeButtons:function(){for(var a in ZeroClipboard.clients)if(a){var b=ZeroClipboard.clients[a];"undefined"!=typeof b.domElement&&b.domElement.parentNode==this.dom.container&&b.positionElement()}},fnResizeRequired:function(){for(var a in ZeroClipboard.clients)if(a){var b=ZeroClipboard.clients[a];if("undefined"!=typeof b.domElement&&b.domElement.parentNode==this.dom.container&&
|
||||
!1===b.sized)return!0}return!1},_fnConstruct:function(a){var b=this;this._fnCustomiseSettings(a);this.dom.container=h.createElement("div");this.dom.container.className=!this.s.dt.bJUI?"DTTT_container":"DTTT_container ui-buttonset ui-buttonset-multi";"none"!=this.s.select.type&&this._fnRowSelectConfig();this._fnButtonDefinations(this.s.buttonSet,this.dom.container);this.s.dt.aoDestroyCallback.push({sName:"TableTools",fn:function(){b.dom.container.innerHTML=""}})},_fnCustomiseSettings:function(a){if("undefined"==
|
||||
typeof this.s.dt._TableToolsInit)this.s.master=!0,this.s.dt._TableToolsInit=!0;this.dom.table=this.s.dt.nTable;this.s.custom=e.extend({},TableTools.DEFAULTS,a);this.s.swfPath=this.s.custom.sSwfPath;if("undefined"!=typeof ZeroClipboard)ZeroClipboard.moviePath=this.s.swfPath;this.s.select.type=this.s.custom.sRowSelect;this.s.select.preRowSelect=this.s.custom.fnPreRowSelect;this.s.select.postSelected=this.s.custom.fnRowSelected;this.s.select.postDeselected=this.s.custom.fnRowDeselected;this.s.select.selectedClass=
|
||||
this.s.custom.sSelectedClass;this.s.buttonSet=this.s.custom.aButtons},_fnButtonDefinations:function(a,b){for(var c,d=0,j=a.length;d<j;d++){if("string"==typeof a[d]){if("undefined"==typeof TableTools.BUTTONS[a[d]]){alert("TableTools: Warning - unknown button type: "+a[d]);continue}c=e.extend({},TableTools.BUTTONS[a[d]],!0)}else{if("undefined"==typeof TableTools.BUTTONS[a[d].sExtends]){alert("TableTools: Warning - unknown button type: "+a[d].sExtends);continue}c=e.extend({},TableTools.BUTTONS[a[d].sExtends],
|
||||
!0);c=e.extend(c,a[d],!0)}this.s.dt.bJUI&&(c.sButtonClass+=" ui-button ui-state-default",c.sButtonClassHover+=" ui-state-hover");b.appendChild(this._fnCreateButton(c))}},_fnCreateButton:function(a){var b="div"==a.sAction?this._fnDivBase(a):this._fnButtonBase(a);"print"==a.sAction?this._fnPrintConfig(b,a):a.sAction.match(/flash/)?this._fnFlashConfig(b,a):"text"==a.sAction?this._fnTextConfig(b,a):"div"==a.sAction?this._fnTextConfig(b,a):"collection"==a.sAction&&(this._fnTextConfig(b,a),this._fnCollectionConfig(b,
|
||||
a));return b},_fnButtonBase:function(a){var b=h.createElement("button"),c=h.createElement("span"),d=this._fnGetMasterSettings();b.className="DTTT_button "+a.sButtonClass;b.setAttribute("id","ToolTables_"+this.s.dt.sInstance+"_"+d.buttonCounter);b.appendChild(c);c.innerHTML=a.sButtonText;d.buttonCounter++;return b},_fnDivBase:function(a){var b=h.createElement("div"),c=this._fnGetMasterSettings();b.className=a.sButtonClass;b.setAttribute("id","ToolTables_"+this.s.dt.sInstance+"_"+c.buttonCounter);b.innerHTML=
|
||||
a.sButtonText;null!==a.nContent&&b.appendChild(a.nContent);c.buttonCounter++;return b},_fnGetMasterSettings:function(){if(this.s.master)return this.s;for(var a=TableTools._aInstances,b=0,c=a.length;b<c;b++)if(this.dom.table==a[b].s.dt.nTable)return a[b].s},_fnCollectionConfig:function(a,b){var c=h.createElement("div");c.style.display="none";c.className=!this.s.dt.bJUI?"DTTT_collection":"DTTT_collection ui-buttonset ui-buttonset-multi";b._collection=c;this._fnButtonDefinations(b.aButtons,c)},_fnCollectionShow:function(a,
|
||||
b){var c=this,d=e(a).offset(),j=b._collection,f=d.left,d=d.top+e(a).outerHeight(),g=e(n).height(),l=e(h).height(),m=e(n).width(),o=e(h).width();j.style.position="absolute";j.style.left=f+"px";j.style.top=d+"px";j.style.display="block";e(j).css("opacity",0);var k=h.createElement("div");k.style.position="absolute";k.style.left="0px";k.style.top="0px";k.style.height=(g>l?g:l)+"px";k.style.width=(m>o?m:o)+"px";k.className="DTTT_collection_background";e(k).css("opacity",0);h.body.appendChild(k);h.body.appendChild(j);
|
||||
g=e(j).outerWidth();m=e(j).outerHeight();if(f+g>o)j.style.left=o-g+"px";if(d+m>l)j.style.top=d-m-e(a).outerHeight()+"px";this.dom.collection.collection=j;this.dom.collection.background=k;setTimeout(function(){e(j).animate({opacity:1},500);e(k).animate({opacity:0.25},500)},10);e(k).click(function(){c._fnCollectionHide.call(c,null,null)})},_fnCollectionHide:function(a,b){if(!(null!==b&&"collection"==b.sExtends)&&null!==this.dom.collection.collection)e(this.dom.collection.collection).animate({opacity:0},
|
||||
500,function(){this.style.display="none"}),e(this.dom.collection.background).animate({opacity:0},500,function(){this.parentNode.removeChild(this)}),this.dom.collection.collection=null,this.dom.collection.background=null},_fnRowSelectConfig:function(){if(this.s.master){var a=this;e(a.s.dt.nTable).addClass("DTTT_selectable");e("tr",a.s.dt.nTBody).live("click",function(b){if(this.parentNode==a.s.dt.nTBody){var c=a.s.dt.oInstance.fnGetNodes();-1===e.inArray(this,c)||null!==a.s.select.preRowSelect&&!a.s.select.preRowSelect.call(a,
|
||||
b)||("single"==a.s.select.type?a._fnRowSelectSingle.call(a,this):a._fnRowSelectMulti.call(a,this))}});a.s.dt.aoDrawCallback.push({fn:function(){a.s.select.all&&a.s.dt.oFeatures.bServerSide&&a.fnSelectAll()},sName:"TableTools_select"})}},_fnRowSelectSingle:function(a){this.s.master&&!e("td",a).hasClass(this.s.dt.oClasses.sRowEmpty)&&(e(a).hasClass(this.s.select.selectedClass)?this._fnRowDeselect(a):(0!==this.s.select.selected.length&&this._fnRowDeselectAll(),this.s.select.selected.push(a),e(a).addClass(this.s.select.selectedClass),
|
||||
null!==this.s.select.postSelected&&this.s.select.postSelected.call(this,a)),TableTools._fnEventDispatch(this,"select",a))},_fnRowSelectMulti:function(a){this.s.master&&!e("td",a).hasClass(this.s.dt.oClasses.sRowEmpty)&&(e(a).hasClass(this.s.select.selectedClass)?this._fnRowDeselect(a):(this.s.select.selected.push(a),e(a).addClass(this.s.select.selectedClass),null!==this.s.select.postSelected&&this.s.select.postSelected.call(this,a)),TableTools._fnEventDispatch(this,"select",a))},_fnRowSelectAll:function(){if(this.s.master){for(var a,
|
||||
b=0,c=this.s.dt.aiDisplayMaster.length;b<c;b++)a=this.s.dt.aoData[this.s.dt.aiDisplayMaster[b]].nTr,e(a).hasClass(this.s.select.selectedClass)||(this.s.select.selected.push(a),e(a).addClass(this.s.select.selectedClass));null!==this.s.select.postSelected&&this.s.select.postSelected.call(this,null);this.s.select.all=!0;TableTools._fnEventDispatch(this,"select",null)}},_fnRowDeselectAll:function(){if(this.s.master){for(var a=this.s.select.selected.length-1;0<=a;a--)this._fnRowDeselect(a,!1);null!==this.s.select.postDeselected&&
|
||||
this.s.select.postDeselected.call(this,null);this.s.select.all=!1;TableTools._fnEventDispatch(this,"select",null)}},_fnRowDeselect:function(a,b){"undefined"!=typeof a.nodeName&&(a=e.inArray(a,this.s.select.selected));var c=this.s.select.selected[a];e(c).removeClass(this.s.select.selectedClass);this.s.select.selected.splice(a,1);("undefined"==typeof b||b)&&null!==this.s.select.postDeselected&&this.s.select.postDeselected.call(this,c);this.s.select.all=!1},_fnTextConfig:function(a,b){var c=this;null!==
|
||||
b.fnInit&&b.fnInit.call(this,a,b);if(""!==b.sToolTip)a.title=b.sToolTip;e(a).hover(function(){e(a).addClass(b.sButtonClassHover);null!==b.fnMouseover&&b.fnMouseover.call(this,a,b,null)},function(){e(a).removeClass(b.sButtonClassHover);null!==b.fnMouseout&&b.fnMouseout.call(this,a,b,null)});null!==b.fnSelect&&TableTools._fnEventListen(this,"select",function(d){b.fnSelect.call(c,a,b,d)});e(a).click(function(d){d.preventDefault();null!==b.fnClick&&b.fnClick.call(c,a,b,null);null!==b.fnComplete&&b.fnComplete.call(c,
|
||||
a,b,null,null);c._fnCollectionHide(a,b)})},_fnFlashConfig:function(a,b){var c=this,d=new ZeroClipboard.Client;null!==b.fnInit&&b.fnInit.call(this,a,b);d.setHandCursor(!0);"flash_save"==b.sAction?(d.setAction("save"),d.setCharSet("utf16le"==b.sCharSet?"UTF16LE":"UTF8"),d.setBomInc(b.bBomInc),d.setFileName(b.sFileName.replace("*",this.fnGetTitle(b)))):"flash_pdf"==b.sAction?(d.setAction("pdf"),d.setFileName(b.sFileName.replace("*",this.fnGetTitle(b)))):d.setAction("copy");d.addEventListener("mouseOver",
|
||||
function(){e(a).addClass(b.sButtonClassHover);null!==b.fnMouseover&&b.fnMouseover.call(c,a,b,d)});d.addEventListener("mouseOut",function(){e(a).removeClass(b.sButtonClassHover);null!==b.fnMouseout&&b.fnMouseout.call(c,a,b,d)});d.addEventListener("mouseDown",function(){null!==b.fnClick&&b.fnClick.call(c,a,b,d)});d.addEventListener("complete",function(e,f){null!==b.fnComplete&&b.fnComplete.call(c,a,b,d,f);c._fnCollectionHide(a,b)});this._fnFlashGlue(d,a,b.sToolTip)},_fnFlashGlue:function(a,b,c){var d=
|
||||
this,e=b.getAttribute("id");if(h.getElementById(e)){if(a.glue(b,c),a.domElement.parentNode!=a.div.parentNode&&"undefined"==typeof d.__bZCWarning)d.s.dt.oApi._fnLog(this.s.dt,0,"It looks like you are using the version of ZeroClipboard which came with TableTools 1. Please update to use the version that came with TableTools 2."),d.__bZCWarning=!0}else setTimeout(function(){d._fnFlashGlue(a,b,c)},100)},_fnFlashSetText:function(a,b){var c=this._fnChunkData(b,8192);a.clearText();for(var d=0,e=c.length;d<
|
||||
e;d++)a.appendText(c[d])},_fnColumnTargets:function(a){var b=[],c=this.s.dt;if("object"==typeof a){for(i=0,iLen=c.aoColumns.length;i<iLen;i++)b.push(!1);for(i=0,iLen=a.length;i<iLen;i++)b[a[i]]=!0}else if("visible"==a)for(i=0,iLen=c.aoColumns.length;i<iLen;i++)b.push(c.aoColumns[i].bVisible?!0:!1);else if("hidden"==a)for(i=0,iLen=c.aoColumns.length;i<iLen;i++)b.push(c.aoColumns[i].bVisible?!1:!0);else if("sortable"==a)for(i=0,iLen=c.aoColumns.length;i<iLen;i++)b.push(c.aoColumns[i].bSortable?!0:!1);
|
||||
else for(i=0,iLen=c.aoColumns.length;i<iLen;i++)b.push(!0);return b},_fnNewline:function(a){return"auto"==a.sNewLine?navigator.userAgent.match(/Windows/)?"\r\n":"\n":a.sNewLine},_fnGetDataTablesData:function(a){var b,c,d,j,f="",g="",h=this.s.dt,m=RegExp(a.sFieldBoundary,"g"),o=this._fnColumnTargets(a.mColumns),k=this._fnNewline(a),n="undefined"!=typeof a.bSelectedOnly?a.bSelectedOnly:!1;if(a.bHeader){for(b=0,c=h.aoColumns.length;b<c;b++)o[b]&&(g=h.aoColumns[b].sTitle.replace(/\n/g," ").replace(/<.*?>/g,
|
||||
"").replace(/^\s+|\s+$/g,""),g=this._fnHtmlDecode(g),f+=this._fnBoundData(g,a.sFieldBoundary,m)+a.sFieldSeperator);f=f.slice(0,-1*a.sFieldSeperator.length);f+=k}for(d=0,j=h.aiDisplay.length;d<j;d++)if("none"==this.s.select.type||n&&e(h.aoData[h.aiDisplay[d]].nTr).hasClass(this.s.select.selectedClass)||n&&0==this.s.select.selected.length){for(b=0,c=h.aoColumns.length;b<c;b++)o[b]&&(g=h.oApi._fnGetCellData(h,h.aiDisplay[d],b,"display"),a.fnCellRender?g=a.fnCellRender(g,b)+"":"string"==typeof g?(g=g.replace(/\n/g,
|
||||
" "),g=g.replace(/<img.*?\s+alt\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s>]+)).*?>/gi,"$1$2$3"),g=g.replace(/<.*?>/g,"")):g+="",g=g.replace(/^\s+/,"").replace(/\s+$/,""),g=this._fnHtmlDecode(g),f+=this._fnBoundData(g,a.sFieldBoundary,m)+a.sFieldSeperator);f=f.slice(0,-1*a.sFieldSeperator.length);f+=k}f.slice(0,-1);if(a.bFooter){for(b=0,c=h.aoColumns.length;b<c;b++)o[b]&&null!==h.aoColumns[b].nTf&&(g=h.aoColumns[b].nTf.innerHTML.replace(/\n/g," ").replace(/<.*?>/g,""),g=this._fnHtmlDecode(g),f+=this._fnBoundData(g,
|
||||
a.sFieldBoundary,m)+a.sFieldSeperator);f=f.slice(0,-1*a.sFieldSeperator.length)}return _sLastData=f},_fnBoundData:function(a,b,c){return""===b?a:b+a.replace(c,b+b)+b},_fnChunkData:function(a,b){for(var c=[],d=a.length,e=0;e<d;e+=b)e+b<d?c.push(a.substring(e,e+b)):c.push(a.substring(e,d));return c},_fnHtmlDecode:function(a){if(-1==a.indexOf("&"))return a;var a=this._fnChunkData(a,2048),b=h.createElement("div"),c,d,e,f="";for(c=0,d=a.length;c<d;c++)e=a[c].lastIndexOf("&"),-1!=e&&8<=a[c].length&&e>a[c].length-
|
||||
8&&(a[c].substr(e),a[c]=a[c].substr(0,e)),b.innerHTML=a[c],f+=b.childNodes[0].nodeValue;return f},_fnPrintConfig:function(a,b){var c=this;null!==b.fnInit&&b.fnInit.call(this,a,b);if(""!==b.sToolTip)a.title=b.sToolTip;e(a).hover(function(){e(a).addClass(b.sButtonClassHover)},function(){e(a).removeClass(b.sButtonClassHover)});null!==b.fnSelect&&TableTools._fnEventListen(this,"select",function(d){b.fnSelect.call(c,a,b,d)});e(a).click(function(d){d.preventDefault();c._fnPrintStart.call(c,d,b);null!==
|
||||
b.fnClick&&b.fnClick.call(c,a,b,null);null!==b.fnComplete&&b.fnComplete.call(c,a,b,null,null);c._fnCollectionHide(a,b)})},_fnPrintStart:function(a,b){var c=this,d=this.s.dt;this._fnPrintHideNodes(d.nTable);this.s.print.saveStart=d._iDisplayStart;this.s.print.saveLength=d._iDisplayLength;if(b.bShowAll)d._iDisplayStart=0,d._iDisplayLength=-1,d.oApi._fnCalculateEnd(d),d.oApi._fnDraw(d);(""!==d.oScroll.sX||""!==d.oScroll.sY)&&this._fnPrintScrollStart(d);var d=d.aanFeatures,j;for(j in d)if("i"!=j&&"t"!=
|
||||
j&&1==j.length)for(var f=0,g=d[j].length;f<g;f++)this.dom.print.hidden.push({node:d[j][f],display:"block"}),d[j][f].style.display="none";e(h.body).addClass("DTTT_Print");if(""!==b.sInfo){var l=h.createElement("div");l.className="DTTT_print_info";l.innerHTML=b.sInfo;h.body.appendChild(l);setTimeout(function(){e(l).fadeOut("normal",function(){h.body.removeChild(l)})},2E3)}if(""!==b.sMessage)this.dom.print.message=h.createElement("div"),this.dom.print.message.className="DTTT_PrintMessage",this.dom.print.message.innerHTML=
|
||||
b.sMessage,h.body.insertBefore(this.dom.print.message,h.body.childNodes[0]);this.s.print.saveScroll=e(n).scrollTop();n.scrollTo(0,0);this.s.print.funcEnd=function(a){c._fnPrintEnd.call(c,a)};e(h).bind("keydown",null,this.s.print.funcEnd)},_fnPrintEnd:function(a){if(27==a.keyCode){a.preventDefault();var a=this.s.dt,b=this.s.print,c=this.dom.print;this._fnPrintShowNodes();(""!==a.oScroll.sX||""!==a.oScroll.sY)&&this._fnPrintScrollEnd();n.scrollTo(0,b.saveScroll);if(null!==c.message)h.body.removeChild(c.message),
|
||||
c.message=null;e(h.body).removeClass("DTTT_Print");a._iDisplayStart=b.saveStart;a._iDisplayLength=b.saveLength;a.oApi._fnCalculateEnd(a);a.oApi._fnDraw(a);e(h).unbind("keydown",this.s.print.funcEnd);this.s.print.funcEnd=null}},_fnPrintScrollStart:function(){var a=this.s.dt;a.nScrollHead.getElementsByTagName("div")[0].getElementsByTagName("table");var b=a.nTable.parentNode,c=a.nTable.getElementsByTagName("thead");0<c.length&&a.nTable.removeChild(c[0]);null!==a.nTFoot&&(c=a.nTable.getElementsByTagName("tfoot"),
|
||||
0<c.length&&a.nTable.removeChild(c[0]));c=a.nTHead.cloneNode(!0);a.nTable.insertBefore(c,a.nTable.childNodes[0]);null!==a.nTFoot&&(c=a.nTFoot.cloneNode(!0),a.nTable.insertBefore(c,a.nTable.childNodes[1]));if(""!==a.oScroll.sX)a.nTable.style.width=e(a.nTable).outerWidth()+"px",b.style.width=e(a.nTable).outerWidth()+"px",b.style.overflow="visible";if(""!==a.oScroll.sY)b.style.height=e(a.nTable).outerHeight()+"px",b.style.overflow="visible"},_fnPrintScrollEnd:function(){var a=this.s.dt,b=a.nTable.parentNode;
|
||||
if(""!==a.oScroll.sX)b.style.width=a.oApi._fnStringToCss(a.oScroll.sX),b.style.overflow="auto";if(""!==a.oScroll.sY)b.style.height=a.oApi._fnStringToCss(a.oScroll.sY),b.style.overflow="auto"},_fnPrintShowNodes:function(){for(var a=this.dom.print.hidden,b=0,c=a.length;b<c;b++)a[b].node.style.display=a[b].display;a.splice(0,a.length)},_fnPrintHideNodes:function(a){for(var b=this.dom.print.hidden,c=a.parentNode,d=c.childNodes,j=0,f=d.length;j<f;j++)if(d[j]!=a&&1==d[j].nodeType){var g=e(d[j]).css("display");
|
||||
if("none"!=g)b.push({node:d[j],display:g}),d[j].style.display="none"}"BODY"!=c.nodeName&&this._fnPrintHideNodes(c)}};TableTools._aInstances=[];TableTools._aListeners=[];TableTools.fnGetMasters=function(){for(var a=[],b=0,c=TableTools._aInstances.length;b<c;b++)TableTools._aInstances[b].s.master&&a.push(TableTools._aInstances[b]);return a};TableTools.fnGetInstance=function(a){"object"!=typeof a&&(a=h.getElementById(a));for(var b=0,c=TableTools._aInstances.length;b<c;b++)if(TableTools._aInstances[b].s.master&&
|
||||
TableTools._aInstances[b].dom.table==a)return TableTools._aInstances[b];return null};TableTools._fnEventListen=function(a,b,c){TableTools._aListeners.push({that:a,type:b,fn:c})};TableTools._fnEventDispatch=function(a,b,c){for(var d=TableTools._aListeners,e=0,f=d.length;e<f;e++)a.dom.table==d[e].that.dom.table&&d[e].type==b&&d[e].fn(c)};TableTools.BUTTONS={csv:{sAction:"flash_save",sCharSet:"utf8",bBomInc:!1,sFileName:"*.csv",sFieldBoundary:'"',sFieldSeperator:",",sNewLine:"auto",sTitle:"",sToolTip:"",
|
||||
sButtonClass:"DTTT_button_csv",sButtonClassHover:"DTTT_button_csv_hover",sButtonText:"CSV",mColumns:"all",bHeader:!0,bFooter:!0,bSelectedOnly:!1,fnMouseover:null,fnMouseout:null,fnClick:function(a,b,c){this.fnSetText(c,this.fnGetTableData(b))},fnSelect:null,fnComplete:null,fnInit:null,fnCellRender:null},xls:{sAction:"flash_save",sCharSet:"utf16le",bBomInc:!0,sFileName:"*.csv",sFieldBoundary:"",sFieldSeperator:"\t",sNewLine:"auto",sTitle:"",sToolTip:"",sButtonClass:"DTTT_button_xls",sButtonClassHover:"DTTT_button_xls_hover",
|
||||
sButtonText:"Excel",mColumns:"all",bHeader:!0,bFooter:!0,bSelectedOnly:!1,fnMouseover:null,fnMouseout:null,fnClick:function(a,b,c){this.fnSetText(c,this.fnGetTableData(b))},fnSelect:null,fnComplete:null,fnInit:null,fnCellRender:null},copy:{sAction:"flash_copy",sFieldBoundary:"",sFieldSeperator:"\t",sNewLine:"auto",sToolTip:"",sButtonClass:"DTTT_button_copy",sButtonClassHover:"DTTT_button_copy_hover",sButtonText:"Copy",mColumns:"all",bHeader:!0,bFooter:!0,bSelectedOnly:!1,fnMouseover:null,fnMouseout:null,
|
||||
fnClick:function(a,b,c){this.fnSetText(c,this.fnGetTableData(b))},fnSelect:null,fnComplete:function(a,b,c,d){a=d.split("\n").length;a=null===this.s.dt.nTFoot?a-1:a-2;alert("Copied "+a+" row"+(1==a?"":"s")+" to the clipboard")},fnInit:null,fnCellRender:null},pdf:{sAction:"flash_pdf",sFieldBoundary:"",sFieldSeperator:"\t",sNewLine:"\n",sFileName:"*.pdf",sToolTip:"",sTitle:"",sButtonClass:"DTTT_button_pdf",sButtonClassHover:"DTTT_button_pdf_hover",sButtonText:"PDF",mColumns:"all",bHeader:!0,bFooter:!1,
|
||||
bSelectedOnly:!1,fnMouseover:null,fnMouseout:null,sPdfOrientation:"portrait",sPdfSize:"A4",sPdfMessage:"",fnClick:function(a,b,c){this.fnSetText(c,"title:"+this.fnGetTitle(b)+"\nmessage:"+b.sPdfMessage+"\ncolWidth:"+this.fnCalcColRatios(b)+"\norientation:"+b.sPdfOrientation+"\nsize:"+b.sPdfSize+"\n--/TableToolsOpts--\n"+this.fnGetTableData(b))},fnSelect:null,fnComplete:null,fnInit:null,fnCellRender:null},print:{sAction:"print",sInfo:"<h6>Print view</h6><p>Please use your browser's print function to print this table. Press escape when finished.",
|
||||
sMessage:"",bShowAll:!0,sToolTip:"View print view",sButtonClass:"DTTT_button_print",sButtonClassHover:"DTTT_button_print_hover",sButtonText:"Print",fnMouseover:null,fnMouseout:null,fnClick:null,fnSelect:null,fnComplete:null,fnInit:null,fnCellRender:null},text:{sAction:"text",sToolTip:"",sButtonClass:"DTTT_button_text",sButtonClassHover:"DTTT_button_text_hover",sButtonText:"Text button",mColumns:"all",bHeader:!0,bFooter:!0,bSelectedOnly:!1,fnMouseover:null,fnMouseout:null,fnClick:null,fnSelect:null,
|
||||
fnComplete:null,fnInit:null,fnCellRender:null},select:{sAction:"text",sToolTip:"",sButtonClass:"DTTT_button_text",sButtonClassHover:"DTTT_button_text_hover",sButtonText:"Select button",mColumns:"all",bHeader:!0,bFooter:!0,fnMouseover:null,fnMouseout:null,fnClick:null,fnSelect:function(a){0!==this.fnGetSelected().length?e(a).removeClass("DTTT_disabled"):e(a).addClass("DTTT_disabled")},fnComplete:null,fnInit:function(a){e(a).addClass("DTTT_disabled")},fnCellRender:null},select_single:{sAction:"text",
|
||||
sToolTip:"",sButtonClass:"DTTT_button_text",sButtonClassHover:"DTTT_button_text_hover",sButtonText:"Select button",mColumns:"all",bHeader:!0,bFooter:!0,fnMouseover:null,fnMouseout:null,fnClick:null,fnSelect:function(a){1==this.fnGetSelected().length?e(a).removeClass("DTTT_disabled"):e(a).addClass("DTTT_disabled")},fnComplete:null,fnInit:function(a){e(a).addClass("DTTT_disabled")},fnCellRender:null},select_all:{sAction:"text",sToolTip:"",sButtonClass:"DTTT_button_text",sButtonClassHover:"DTTT_button_text_hover",
|
||||
sButtonText:"Select all",mColumns:"all",bHeader:!0,bFooter:!0,fnMouseover:null,fnMouseout:null,fnClick:function(){this.fnSelectAll()},fnSelect:function(a){this.fnGetSelected().length==this.s.dt.fnRecordsDisplay()?e(a).addClass("DTTT_disabled"):e(a).removeClass("DTTT_disabled")},fnComplete:null,fnInit:null,fnCellRender:null},select_none:{sAction:"text",sToolTip:"",sButtonClass:"DTTT_button_text",sButtonClassHover:"DTTT_button_text_hover",sButtonText:"Deselect all",mColumns:"all",bHeader:!0,bFooter:!0,
|
||||
fnMouseover:null,fnMouseout:null,fnClick:function(){this.fnSelectNone()},fnSelect:function(a){0!==this.fnGetSelected().length?e(a).removeClass("DTTT_disabled"):e(a).addClass("DTTT_disabled")},fnComplete:null,fnInit:function(a){e(a).addClass("DTTT_disabled")},fnCellRender:null},ajax:{sAction:"text",sFieldBoundary:"",sFieldSeperator:"\t",sNewLine:"\n",sAjaxUrl:"/xhr.php",sToolTip:"",sButtonClass:"DTTT_button_text",sButtonClassHover:"DTTT_button_text_hover",sButtonText:"Ajax button",mColumns:"all",bHeader:!0,
|
||||
bFooter:!0,bSelectedOnly:!1,fnMouseover:null,fnMouseout:null,fnClick:function(a,b){var c=this.fnGetTableData(b);e.ajax({url:b.sAjaxUrl,data:[{name:"tableData",value:c}],success:b.fnAjaxComplete,dataType:"json",type:"POST",cache:!1,error:function(){alert("Error detected when sending table data to server")}})},fnSelect:null,fnComplete:null,fnInit:null,fnAjaxComplete:function(){alert("Ajax complete")},fnCellRender:null},div:{sAction:"div",sToolTip:"",sButtonClass:"DTTT_nonbutton",sButtonClassHover:"",
|
||||
sButtonText:"Text button",fnMouseover:null,fnMouseout:null,fnClick:null,fnSelect:null,fnComplete:null,fnInit:null,nContent:null,fnCellRender:null},collection:{sAction:"collection",sToolTip:"",sButtonClass:"DTTT_button_collection",sButtonClassHover:"DTTT_button_collection_hover",sButtonText:"Collection",fnMouseover:null,fnMouseout:null,fnClick:function(a,b){this._fnCollectionShow(a,b)},fnSelect:null,fnComplete:null,fnInit:null,fnCellRender:null}};TableTools.DEFAULTS={sSwfPath:"media/swf/copy_cvs_xls_pdf.swf",
|
||||
sRowSelect:"none",sSelectedClass:"DTTT_selected",fnPreRowSelect:null,fnRowSelected:null,fnRowDeselected:null,aButtons:["copy","csv","xls","pdf","print"]};TableTools.prototype.CLASS="TableTools";TableTools.VERSION="2.0.2";TableTools.prototype.VERSION=TableTools.VERSION;"function"==typeof e.fn.dataTable&&"function"==typeof e.fn.dataTableExt.fnVersionCheck&&e.fn.dataTableExt.fnVersionCheck("1.8.2")?e.fn.dataTableExt.aoFeatures.push({fnInit:function(a){a=new TableTools(a.oInstance,"undefined"!=typeof a.oInit.oTableTools?
|
||||
a.oInit.oTableTools:{});TableTools._aInstances.push(a);return a.dom.container},cFeature:"T",sFeature:"TableTools"}):alert("Warning: TableTools 2 requires DataTables 1.8.2 or newer - www.datatables.net/download")})(jQuery,window,document);
|
|
@ -1,367 +0,0 @@
|
|||
// Simple Set Clipboard System
|
||||
// Author: Joseph Huckaby
|
||||
|
||||
var ZeroClipboard = {
|
||||
|
||||
version: "1.0.4-TableTools2",
|
||||
clients: {}, // registered upload clients on page, indexed by id
|
||||
moviePath: '', // URL to movie
|
||||
nextId: 1, // ID of next movie
|
||||
|
||||
$: function(thingy) {
|
||||
// simple DOM lookup utility function
|
||||
if (typeof(thingy) == 'string') thingy = document.getElementById(thingy);
|
||||
if (!thingy.addClass) {
|
||||
// extend element with a few useful methods
|
||||
thingy.hide = function() { this.style.display = 'none'; };
|
||||
thingy.show = function() { this.style.display = ''; };
|
||||
thingy.addClass = function(name) { this.removeClass(name); this.className += ' ' + name; };
|
||||
thingy.removeClass = function(name) {
|
||||
this.className = this.className.replace( new RegExp("\\s*" + name + "\\s*"), " ").replace(/^\s+/, '').replace(/\s+$/, '');
|
||||
};
|
||||
thingy.hasClass = function(name) {
|
||||
return !!this.className.match( new RegExp("\\s*" + name + "\\s*") );
|
||||
}
|
||||
}
|
||||
return thingy;
|
||||
},
|
||||
|
||||
setMoviePath: function(path) {
|
||||
// set path to ZeroClipboard.swf
|
||||
this.moviePath = path;
|
||||
},
|
||||
|
||||
dispatch: function(id, eventName, args) {
|
||||
// receive event from flash movie, send to client
|
||||
var client = this.clients[id];
|
||||
if (client) {
|
||||
client.receiveEvent(eventName, args);
|
||||
}
|
||||
},
|
||||
|
||||
register: function(id, client) {
|
||||
// register new client to receive events
|
||||
this.clients[id] = client;
|
||||
},
|
||||
|
||||
getDOMObjectPosition: function(obj) {
|
||||
// get absolute coordinates for dom element
|
||||
var info = {
|
||||
left: 0,
|
||||
top: 0,
|
||||
width: obj.width ? obj.width : obj.offsetWidth,
|
||||
height: obj.height ? obj.height : obj.offsetHeight
|
||||
};
|
||||
|
||||
if ( obj.style.width != "" )
|
||||
info.width = obj.style.width.replace("px","");
|
||||
|
||||
if ( obj.style.height != "" )
|
||||
info.height = obj.style.height.replace("px","");
|
||||
|
||||
while (obj) {
|
||||
info.left += obj.offsetLeft;
|
||||
info.top += obj.offsetTop;
|
||||
obj = obj.offsetParent;
|
||||
}
|
||||
|
||||
return info;
|
||||
},
|
||||
|
||||
Client: function(elem) {
|
||||
// constructor for new simple upload client
|
||||
this.handlers = {};
|
||||
|
||||
// unique ID
|
||||
this.id = ZeroClipboard.nextId++;
|
||||
this.movieId = 'ZeroClipboardMovie_' + this.id;
|
||||
|
||||
// register client with singleton to receive flash events
|
||||
ZeroClipboard.register(this.id, this);
|
||||
|
||||
// create movie
|
||||
if (elem) this.glue(elem);
|
||||
}
|
||||
};
|
||||
|
||||
ZeroClipboard.Client.prototype = {
|
||||
|
||||
id: 0, // unique ID for us
|
||||
ready: false, // whether movie is ready to receive events or not
|
||||
movie: null, // reference to movie object
|
||||
clipText: '', // text to copy to clipboard
|
||||
fileName: '', // default file save name
|
||||
action: 'copy', // action to perform
|
||||
handCursorEnabled: true, // whether to show hand cursor, or default pointer cursor
|
||||
cssEffects: true, // enable CSS mouse effects on dom container
|
||||
handlers: null, // user event handlers
|
||||
sized: false,
|
||||
|
||||
glue: function(elem, title) {
|
||||
// glue to DOM element
|
||||
// elem can be ID or actual DOM element object
|
||||
this.domElement = ZeroClipboard.$(elem);
|
||||
|
||||
// float just above object, or zIndex 99 if dom element isn't set
|
||||
var zIndex = 99;
|
||||
if (this.domElement.style.zIndex) {
|
||||
zIndex = parseInt(this.domElement.style.zIndex) + 1;
|
||||
}
|
||||
|
||||
// find X/Y position of domElement
|
||||
var box = ZeroClipboard.getDOMObjectPosition(this.domElement);
|
||||
|
||||
// create floating DIV above element
|
||||
this.div = document.createElement('div');
|
||||
var style = this.div.style;
|
||||
style.position = 'absolute';
|
||||
style.left = (this.domElement.offsetLeft)+'px';
|
||||
//style.left = (this.domElement.offsetLeft+2)+'px';
|
||||
style.top = this.domElement.offsetTop+'px';
|
||||
style.width = (box.width) + 'px';
|
||||
//style.width = (box.width-4) + 'px';
|
||||
style.height = box.height + 'px';
|
||||
style.zIndex = zIndex;
|
||||
if ( typeof title != "undefined" && title != "" ) {
|
||||
this.div.title = title;
|
||||
}
|
||||
if ( box.width != 0 && box.height != 0 ) {
|
||||
this.sized = true;
|
||||
}
|
||||
|
||||
// style.backgroundColor = '#f00'; // debug
|
||||
this.domElement.parentNode.appendChild(this.div);
|
||||
|
||||
this.div.innerHTML = this.getHTML( box.width, box.height );
|
||||
},
|
||||
|
||||
positionElement: function() {
|
||||
var box = ZeroClipboard.getDOMObjectPosition(this.domElement);
|
||||
var style = this.div.style;
|
||||
|
||||
style.position = 'absolute';
|
||||
style.left = (this.domElement.offsetLeft)+'px';
|
||||
style.top = this.domElement.offsetTop+'px';
|
||||
style.width = box.width + 'px';
|
||||
style.height = box.height + 'px';
|
||||
|
||||
if ( box.width != 0 && box.height != 0 ) {
|
||||
this.sized = true;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
var flash = this.div.childNodes[0];
|
||||
flash.width = box.width;
|
||||
flash.height = box.height;
|
||||
},
|
||||
|
||||
getHTML: function(width, height) {
|
||||
// return HTML for movie
|
||||
var html = '';
|
||||
var flashvars = 'id=' + this.id +
|
||||
'&width=' + width +
|
||||
'&height=' + height;
|
||||
|
||||
if (navigator.userAgent.match(/MSIE/)) {
|
||||
// IE gets an OBJECT tag
|
||||
var protocol = location.href.match(/^https/i) ? 'https://' : 'http://';
|
||||
html += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+protocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="'+width+'" height="'+height+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><param name="wmode" value="transparent"/></object>';
|
||||
}
|
||||
else {
|
||||
// all other browsers get an EMBED tag
|
||||
html += '<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'" wmode="transparent" />';
|
||||
}
|
||||
return html;
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
// temporarily hide floater offscreen
|
||||
if (this.div) {
|
||||
this.div.style.left = '-2000px';
|
||||
}
|
||||
},
|
||||
|
||||
show: function() {
|
||||
// show ourselves after a call to hide()
|
||||
this.reposition();
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
// destroy control and floater
|
||||
if (this.domElement && this.div) {
|
||||
this.hide();
|
||||
this.div.innerHTML = '';
|
||||
|
||||
var body = document.getElementsByTagName('body')[0];
|
||||
try { body.removeChild( this.div ); } catch(e) {;}
|
||||
|
||||
this.domElement = null;
|
||||
this.div = null;
|
||||
}
|
||||
},
|
||||
|
||||
reposition: function(elem) {
|
||||
// reposition our floating div, optionally to new container
|
||||
// warning: container CANNOT change size, only position
|
||||
if (elem) {
|
||||
this.domElement = ZeroClipboard.$(elem);
|
||||
if (!this.domElement) this.hide();
|
||||
}
|
||||
|
||||
if (this.domElement && this.div) {
|
||||
var box = ZeroClipboard.getDOMObjectPosition(this.domElement);
|
||||
var style = this.div.style;
|
||||
style.left = '' + box.left + 'px';
|
||||
style.top = '' + box.top + 'px';
|
||||
}
|
||||
},
|
||||
|
||||
clearText: function() {
|
||||
// clear the text to be copy / saved
|
||||
this.clipText = '';
|
||||
if (this.ready) this.movie.clearText();
|
||||
},
|
||||
|
||||
appendText: function(newText) {
|
||||
// append text to that which is to be copied / saved
|
||||
this.clipText += newText;
|
||||
if (this.ready) { this.movie.appendText(newText) ;}
|
||||
},
|
||||
|
||||
setText: function(newText) {
|
||||
// set text to be copied to be copied / saved
|
||||
this.clipText = newText;
|
||||
if (this.ready) { this.movie.setText(newText) ;}
|
||||
},
|
||||
|
||||
setCharSet: function(charSet) {
|
||||
// set the character set (UTF16LE or UTF8)
|
||||
this.charSet = charSet;
|
||||
if (this.ready) { this.movie.setCharSet(charSet) ;}
|
||||
},
|
||||
|
||||
setBomInc: function(bomInc) {
|
||||
// set if the BOM should be included or not
|
||||
this.incBom = bomInc;
|
||||
if (this.ready) { this.movie.setBomInc(bomInc) ;}
|
||||
},
|
||||
|
||||
setFileName: function(newText) {
|
||||
// set the file name
|
||||
this.fileName = newText;
|
||||
if (this.ready) this.movie.setFileName(newText);
|
||||
},
|
||||
|
||||
setAction: function(newText) {
|
||||
// set action (save or copy)
|
||||
this.action = newText;
|
||||
if (this.ready) this.movie.setAction(newText);
|
||||
},
|
||||
|
||||
addEventListener: function(eventName, func) {
|
||||
// add user event listener for event
|
||||
// event types: load, queueStart, fileStart, fileComplete, queueComplete, progress, error, cancel
|
||||
eventName = eventName.toString().toLowerCase().replace(/^on/, '');
|
||||
if (!this.handlers[eventName]) this.handlers[eventName] = [];
|
||||
this.handlers[eventName].push(func);
|
||||
},
|
||||
|
||||
setHandCursor: function(enabled) {
|
||||
// enable hand cursor (true), or default arrow cursor (false)
|
||||
this.handCursorEnabled = enabled;
|
||||
if (this.ready) this.movie.setHandCursor(enabled);
|
||||
},
|
||||
|
||||
setCSSEffects: function(enabled) {
|
||||
// enable or disable CSS effects on DOM container
|
||||
this.cssEffects = !!enabled;
|
||||
},
|
||||
|
||||
receiveEvent: function(eventName, args) {
|
||||
// receive event from flash
|
||||
eventName = eventName.toString().toLowerCase().replace(/^on/, '');
|
||||
|
||||
// special behavior for certain events
|
||||
switch (eventName) {
|
||||
case 'load':
|
||||
// movie claims it is ready, but in IE this isn't always the case...
|
||||
// bug fix: Cannot extend EMBED DOM elements in Firefox, must use traditional function
|
||||
this.movie = document.getElementById(this.movieId);
|
||||
if (!this.movie) {
|
||||
var self = this;
|
||||
setTimeout( function() { self.receiveEvent('load', null); }, 1 );
|
||||
return;
|
||||
}
|
||||
|
||||
// firefox on pc needs a "kick" in order to set these in certain cases
|
||||
if (!this.ready && navigator.userAgent.match(/Firefox/) && navigator.userAgent.match(/Windows/)) {
|
||||
var self = this;
|
||||
setTimeout( function() { self.receiveEvent('load', null); }, 100 );
|
||||
this.ready = true;
|
||||
return;
|
||||
}
|
||||
|
||||
this.ready = true;
|
||||
this.movie.clearText();
|
||||
this.movie.appendText( this.clipText );
|
||||
this.movie.setFileName( this.fileName );
|
||||
this.movie.setAction( this.action );
|
||||
this.movie.setCharSet( this.charSet );
|
||||
this.movie.setBomInc( this.incBom );
|
||||
this.movie.setHandCursor( this.handCursorEnabled );
|
||||
break;
|
||||
|
||||
case 'mouseover':
|
||||
if (this.domElement && this.cssEffects) {
|
||||
//this.domElement.addClass('hover');
|
||||
if (this.recoverActive) this.domElement.addClass('active');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'mouseout':
|
||||
if (this.domElement && this.cssEffects) {
|
||||
this.recoverActive = false;
|
||||
if (this.domElement.hasClass('active')) {
|
||||
this.domElement.removeClass('active');
|
||||
this.recoverActive = true;
|
||||
}
|
||||
//this.domElement.removeClass('hover');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'mousedown':
|
||||
if (this.domElement && this.cssEffects) {
|
||||
this.domElement.addClass('active');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'mouseup':
|
||||
if (this.domElement && this.cssEffects) {
|
||||
this.domElement.removeClass('active');
|
||||
this.recoverActive = false;
|
||||
}
|
||||
break;
|
||||
} // switch eventName
|
||||
|
||||
if (this.handlers[eventName]) {
|
||||
for (var idx = 0, len = this.handlers[eventName].length; idx < len; idx++) {
|
||||
var func = this.handlers[eventName][idx];
|
||||
|
||||
if (typeof(func) == 'function') {
|
||||
// actual function reference
|
||||
func(this, args);
|
||||
}
|
||||
else if ((typeof(func) == 'object') && (func.length == 2)) {
|
||||
// PHP style object + method, i.e. [myObject, 'myMethod']
|
||||
func[0][ func[1] ](this, args);
|
||||
}
|
||||
else if (typeof(func) == 'string') {
|
||||
// name of function
|
||||
window[func](this, args);
|
||||
}
|
||||
} // foreach event handler defined
|
||||
} // user defined handler for event
|
||||
}
|
||||
|
||||
};
|
9789
airtime_mvc/public/js/libs/jquery-1.10.2.js
vendored
Normal file
2
airtime_mvc/public/js/libs/jquery-1.8.3.min.js
vendored
Normal file
521
airtime_mvc/public/js/libs/jquery-migrate-1.2.1.js
Normal file
|
@ -0,0 +1,521 @@
|
|||
/*!
|
||||
* jQuery Migrate - v1.2.1 - 2013-05-08
|
||||
* https://github.com/jquery/jquery-migrate
|
||||
* Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; Licensed MIT
|
||||
*/
|
||||
(function( jQuery, window, undefined ) {
|
||||
// See http://bugs.jquery.com/ticket/13335
|
||||
// "use strict";
|
||||
|
||||
|
||||
var warnedAbout = {};
|
||||
|
||||
// List of warnings already given; public read only
|
||||
jQuery.migrateWarnings = [];
|
||||
|
||||
// Set to true to prevent console output; migrateWarnings still maintained
|
||||
// jQuery.migrateMute = false;
|
||||
|
||||
// Show a message on the console so devs know we're active
|
||||
if ( !jQuery.migrateMute && window.console && window.console.log ) {
|
||||
window.console.log("JQMIGRATE: Logging is active");
|
||||
}
|
||||
|
||||
// Set to false to disable traces that appear with warnings
|
||||
if ( jQuery.migrateTrace === undefined ) {
|
||||
jQuery.migrateTrace = true;
|
||||
}
|
||||
|
||||
// Forget any warnings we've already given; public
|
||||
jQuery.migrateReset = function() {
|
||||
warnedAbout = {};
|
||||
jQuery.migrateWarnings.length = 0;
|
||||
};
|
||||
|
||||
function migrateWarn( msg) {
|
||||
var console = window.console;
|
||||
if ( !warnedAbout[ msg ] ) {
|
||||
warnedAbout[ msg ] = true;
|
||||
jQuery.migrateWarnings.push( msg );
|
||||
if ( console && console.warn && !jQuery.migrateMute ) {
|
||||
console.warn( "JQMIGRATE: " + msg );
|
||||
if ( jQuery.migrateTrace && console.trace ) {
|
||||
console.trace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function migrateWarnProp( obj, prop, value, msg ) {
|
||||
if ( Object.defineProperty ) {
|
||||
// On ES5 browsers (non-oldIE), warn if the code tries to get prop;
|
||||
// allow property to be overwritten in case some other plugin wants it
|
||||
try {
|
||||
Object.defineProperty( obj, prop, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
migrateWarn( msg );
|
||||
return value;
|
||||
},
|
||||
set: function( newValue ) {
|
||||
migrateWarn( msg );
|
||||
value = newValue;
|
||||
}
|
||||
});
|
||||
return;
|
||||
} catch( err ) {
|
||||
// IE8 is a dope about Object.defineProperty, can't warn there
|
||||
}
|
||||
}
|
||||
|
||||
// Non-ES5 (or broken) browser; just set the property
|
||||
jQuery._definePropertyBroken = true;
|
||||
obj[ prop ] = value;
|
||||
}
|
||||
|
||||
if ( document.compatMode === "BackCompat" ) {
|
||||
// jQuery has never supported or tested Quirks Mode
|
||||
migrateWarn( "jQuery is not compatible with Quirks Mode" );
|
||||
}
|
||||
|
||||
|
||||
var attrFn = jQuery( "<input/>", { size: 1 } ).attr("size") && jQuery.attrFn,
|
||||
oldAttr = jQuery.attr,
|
||||
valueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get ||
|
||||
function() { return null; },
|
||||
valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set ||
|
||||
function() { return undefined; },
|
||||
rnoType = /^(?:input|button)$/i,
|
||||
rnoAttrNodeType = /^[238]$/,
|
||||
rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
|
||||
ruseDefault = /^(?:checked|selected)$/i;
|
||||
|
||||
// jQuery.attrFn
|
||||
migrateWarnProp( jQuery, "attrFn", attrFn || {}, "jQuery.attrFn is deprecated" );
|
||||
|
||||
jQuery.attr = function( elem, name, value, pass ) {
|
||||
var lowerName = name.toLowerCase(),
|
||||
nType = elem && elem.nodeType;
|
||||
|
||||
if ( pass ) {
|
||||
// Since pass is used internally, we only warn for new jQuery
|
||||
// versions where there isn't a pass arg in the formal params
|
||||
if ( oldAttr.length < 4 ) {
|
||||
migrateWarn("jQuery.fn.attr( props, pass ) is deprecated");
|
||||
}
|
||||
if ( elem && !rnoAttrNodeType.test( nType ) &&
|
||||
(attrFn ? name in attrFn : jQuery.isFunction(jQuery.fn[name])) ) {
|
||||
return jQuery( elem )[ name ]( value );
|
||||
}
|
||||
}
|
||||
|
||||
// Warn if user tries to set `type`, since it breaks on IE 6/7/8; by checking
|
||||
// for disconnected elements we don't warn on $( "<button>", { type: "button" } ).
|
||||
if ( name === "type" && value !== undefined && rnoType.test( elem.nodeName ) && elem.parentNode ) {
|
||||
migrateWarn("Can't change the 'type' of an input or button in IE 6/7/8");
|
||||
}
|
||||
|
||||
// Restore boolHook for boolean property/attribute synchronization
|
||||
if ( !jQuery.attrHooks[ lowerName ] && rboolean.test( lowerName ) ) {
|
||||
jQuery.attrHooks[ lowerName ] = {
|
||||
get: function( elem, name ) {
|
||||
// Align boolean attributes with corresponding properties
|
||||
// Fall back to attribute presence where some booleans are not supported
|
||||
var attrNode,
|
||||
property = jQuery.prop( elem, name );
|
||||
return property === true || typeof property !== "boolean" &&
|
||||
( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
|
||||
|
||||
name.toLowerCase() :
|
||||
undefined;
|
||||
},
|
||||
set: function( elem, value, name ) {
|
||||
var propName;
|
||||
if ( value === false ) {
|
||||
// Remove boolean attributes when set to false
|
||||
jQuery.removeAttr( elem, name );
|
||||
} else {
|
||||
// value is true since we know at this point it's type boolean and not false
|
||||
// Set boolean attributes to the same name and set the DOM property
|
||||
propName = jQuery.propFix[ name ] || name;
|
||||
if ( propName in elem ) {
|
||||
// Only set the IDL specifically if it already exists on the element
|
||||
elem[ propName ] = true;
|
||||
}
|
||||
|
||||
elem.setAttribute( name, name.toLowerCase() );
|
||||
}
|
||||
return name;
|
||||
}
|
||||
};
|
||||
|
||||
// Warn only for attributes that can remain distinct from their properties post-1.9
|
||||
if ( ruseDefault.test( lowerName ) ) {
|
||||
migrateWarn( "jQuery.fn.attr('" + lowerName + "') may use property instead of attribute" );
|
||||
}
|
||||
}
|
||||
|
||||
return oldAttr.call( jQuery, elem, name, value );
|
||||
};
|
||||
|
||||
// attrHooks: value
|
||||
jQuery.attrHooks.value = {
|
||||
get: function( elem, name ) {
|
||||
var nodeName = ( elem.nodeName || "" ).toLowerCase();
|
||||
if ( nodeName === "button" ) {
|
||||
return valueAttrGet.apply( this, arguments );
|
||||
}
|
||||
if ( nodeName !== "input" && nodeName !== "option" ) {
|
||||
migrateWarn("jQuery.fn.attr('value') no longer gets properties");
|
||||
}
|
||||
return name in elem ?
|
||||
elem.value :
|
||||
null;
|
||||
},
|
||||
set: function( elem, value ) {
|
||||
var nodeName = ( elem.nodeName || "" ).toLowerCase();
|
||||
if ( nodeName === "button" ) {
|
||||
return valueAttrSet.apply( this, arguments );
|
||||
}
|
||||
if ( nodeName !== "input" && nodeName !== "option" ) {
|
||||
migrateWarn("jQuery.fn.attr('value', val) no longer sets properties");
|
||||
}
|
||||
// Does not return so that setAttribute is also used
|
||||
elem.value = value;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var matched, browser,
|
||||
oldInit = jQuery.fn.init,
|
||||
oldParseJSON = jQuery.parseJSON,
|
||||
// Note: XSS check is done below after string is trimmed
|
||||
rquickExpr = /^([^<]*)(<[\w\W]+>)([^>]*)$/;
|
||||
|
||||
// $(html) "looks like html" rule change
|
||||
jQuery.fn.init = function( selector, context, rootjQuery ) {
|
||||
var match;
|
||||
|
||||
if ( selector && typeof selector === "string" && !jQuery.isPlainObject( context ) &&
|
||||
(match = rquickExpr.exec( jQuery.trim( selector ) )) && match[ 0 ] ) {
|
||||
// This is an HTML string according to the "old" rules; is it still?
|
||||
if ( selector.charAt( 0 ) !== "<" ) {
|
||||
migrateWarn("$(html) HTML strings must start with '<' character");
|
||||
}
|
||||
if ( match[ 3 ] ) {
|
||||
migrateWarn("$(html) HTML text after last tag is ignored");
|
||||
}
|
||||
// Consistently reject any HTML-like string starting with a hash (#9521)
|
||||
// Note that this may break jQuery 1.6.x code that otherwise would work.
|
||||
if ( match[ 0 ].charAt( 0 ) === "#" ) {
|
||||
migrateWarn("HTML string cannot start with a '#' character");
|
||||
jQuery.error("JQMIGRATE: Invalid selector string (XSS)");
|
||||
}
|
||||
// Now process using loose rules; let pre-1.8 play too
|
||||
if ( context && context.context ) {
|
||||
// jQuery object as context; parseHTML expects a DOM object
|
||||
context = context.context;
|
||||
}
|
||||
if ( jQuery.parseHTML ) {
|
||||
return oldInit.call( this, jQuery.parseHTML( match[ 2 ], context, true ),
|
||||
context, rootjQuery );
|
||||
}
|
||||
}
|
||||
return oldInit.apply( this, arguments );
|
||||
};
|
||||
jQuery.fn.init.prototype = jQuery.fn;
|
||||
|
||||
// Let $.parseJSON(falsy_value) return null
|
||||
jQuery.parseJSON = function( json ) {
|
||||
if ( !json && json !== null ) {
|
||||
migrateWarn("jQuery.parseJSON requires a valid JSON string");
|
||||
return null;
|
||||
}
|
||||
return oldParseJSON.apply( this, arguments );
|
||||
};
|
||||
|
||||
jQuery.uaMatch = function( ua ) {
|
||||
ua = ua.toLowerCase();
|
||||
|
||||
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(msie) ([\w.]+)/.exec( ua ) ||
|
||||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
|
||||
[];
|
||||
|
||||
return {
|
||||
browser: match[ 1 ] || "",
|
||||
version: match[ 2 ] || "0"
|
||||
};
|
||||
};
|
||||
|
||||
// Don't clobber any existing jQuery.browser in case it's different
|
||||
if ( !jQuery.browser ) {
|
||||
matched = jQuery.uaMatch( navigator.userAgent );
|
||||
browser = {};
|
||||
|
||||
if ( matched.browser ) {
|
||||
browser[ matched.browser ] = true;
|
||||
browser.version = matched.version;
|
||||
}
|
||||
|
||||
// Chrome is Webkit, but Webkit is also Safari.
|
||||
if ( browser.chrome ) {
|
||||
browser.webkit = true;
|
||||
} else if ( browser.webkit ) {
|
||||
browser.safari = true;
|
||||
}
|
||||
|
||||
jQuery.browser = browser;
|
||||
}
|
||||
|
||||
// Warn if the code tries to get jQuery.browser
|
||||
migrateWarnProp( jQuery, "browser", jQuery.browser, "jQuery.browser is deprecated" );
|
||||
|
||||
jQuery.sub = function() {
|
||||
function jQuerySub( selector, context ) {
|
||||
return new jQuerySub.fn.init( selector, context );
|
||||
}
|
||||
jQuery.extend( true, jQuerySub, this );
|
||||
jQuerySub.superclass = this;
|
||||
jQuerySub.fn = jQuerySub.prototype = this();
|
||||
jQuerySub.fn.constructor = jQuerySub;
|
||||
jQuerySub.sub = this.sub;
|
||||
jQuerySub.fn.init = function init( selector, context ) {
|
||||
if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
|
||||
context = jQuerySub( context );
|
||||
}
|
||||
|
||||
return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
|
||||
};
|
||||
jQuerySub.fn.init.prototype = jQuerySub.fn;
|
||||
var rootjQuerySub = jQuerySub(document);
|
||||
migrateWarn( "jQuery.sub() is deprecated" );
|
||||
return jQuerySub;
|
||||
};
|
||||
|
||||
|
||||
// Ensure that $.ajax gets the new parseJSON defined in core.js
|
||||
jQuery.ajaxSetup({
|
||||
converters: {
|
||||
"text json": jQuery.parseJSON
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var oldFnData = jQuery.fn.data;
|
||||
|
||||
jQuery.fn.data = function( name ) {
|
||||
var ret, evt,
|
||||
elem = this[0];
|
||||
|
||||
// Handles 1.7 which has this behavior and 1.8 which doesn't
|
||||
if ( elem && name === "events" && arguments.length === 1 ) {
|
||||
ret = jQuery.data( elem, name );
|
||||
evt = jQuery._data( elem, name );
|
||||
if ( ( ret === undefined || ret === evt ) && evt !== undefined ) {
|
||||
migrateWarn("Use of jQuery.fn.data('events') is deprecated");
|
||||
return evt;
|
||||
}
|
||||
}
|
||||
return oldFnData.apply( this, arguments );
|
||||
};
|
||||
|
||||
|
||||
var rscriptType = /\/(java|ecma)script/i,
|
||||
oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack;
|
||||
|
||||
jQuery.fn.andSelf = function() {
|
||||
migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()");
|
||||
return oldSelf.apply( this, arguments );
|
||||
};
|
||||
|
||||
// Since jQuery.clean is used internally on older versions, we only shim if it's missing
|
||||
if ( !jQuery.clean ) {
|
||||
jQuery.clean = function( elems, context, fragment, scripts ) {
|
||||
// Set context per 1.8 logic
|
||||
context = context || document;
|
||||
context = !context.nodeType && context[0] || context;
|
||||
context = context.ownerDocument || context;
|
||||
|
||||
migrateWarn("jQuery.clean() is deprecated");
|
||||
|
||||
var i, elem, handleScript, jsTags,
|
||||
ret = [];
|
||||
|
||||
jQuery.merge( ret, jQuery.buildFragment( elems, context ).childNodes );
|
||||
|
||||
// Complex logic lifted directly from jQuery 1.8
|
||||
if ( fragment ) {
|
||||
// Special handling of each script element
|
||||
handleScript = function( elem ) {
|
||||
// Check if we consider it executable
|
||||
if ( !elem.type || rscriptType.test( elem.type ) ) {
|
||||
// Detach the script and store it in the scripts array (if provided) or the fragment
|
||||
// Return truthy to indicate that it has been handled
|
||||
return scripts ?
|
||||
scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) :
|
||||
fragment.appendChild( elem );
|
||||
}
|
||||
};
|
||||
|
||||
for ( i = 0; (elem = ret[i]) != null; i++ ) {
|
||||
// Check if we're done after handling an executable script
|
||||
if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) {
|
||||
// Append to fragment and handle embedded scripts
|
||||
fragment.appendChild( elem );
|
||||
if ( typeof elem.getElementsByTagName !== "undefined" ) {
|
||||
// handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration
|
||||
jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript );
|
||||
|
||||
// Splice the scripts into ret after their former ancestor and advance our index beyond them
|
||||
ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
|
||||
i += jsTags.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
}
|
||||
|
||||
var eventAdd = jQuery.event.add,
|
||||
eventRemove = jQuery.event.remove,
|
||||
eventTrigger = jQuery.event.trigger,
|
||||
oldToggle = jQuery.fn.toggle,
|
||||
oldLive = jQuery.fn.live,
|
||||
oldDie = jQuery.fn.die,
|
||||
ajaxEvents = "ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",
|
||||
rajaxEvent = new RegExp( "\\b(?:" + ajaxEvents + ")\\b" ),
|
||||
rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,
|
||||
hoverHack = function( events ) {
|
||||
if ( typeof( events ) !== "string" || jQuery.event.special.hover ) {
|
||||
return events;
|
||||
}
|
||||
if ( rhoverHack.test( events ) ) {
|
||||
migrateWarn("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'");
|
||||
}
|
||||
return events && events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
|
||||
};
|
||||
|
||||
// Event props removed in 1.9, put them back if needed; no practical way to warn them
|
||||
if ( jQuery.event.props && jQuery.event.props[ 0 ] !== "attrChange" ) {
|
||||
jQuery.event.props.unshift( "attrChange", "attrName", "relatedNode", "srcElement" );
|
||||
}
|
||||
|
||||
// Undocumented jQuery.event.handle was "deprecated" in jQuery 1.7
|
||||
if ( jQuery.event.dispatch ) {
|
||||
migrateWarnProp( jQuery.event, "handle", jQuery.event.dispatch, "jQuery.event.handle is undocumented and deprecated" );
|
||||
}
|
||||
|
||||
// Support for 'hover' pseudo-event and ajax event warnings
|
||||
jQuery.event.add = function( elem, types, handler, data, selector ){
|
||||
if ( elem !== document && rajaxEvent.test( types ) ) {
|
||||
migrateWarn( "AJAX events should be attached to document: " + types );
|
||||
}
|
||||
eventAdd.call( this, elem, hoverHack( types || "" ), handler, data, selector );
|
||||
};
|
||||
jQuery.event.remove = function( elem, types, handler, selector, mappedTypes ){
|
||||
eventRemove.call( this, elem, hoverHack( types ) || "", handler, selector, mappedTypes );
|
||||
};
|
||||
|
||||
jQuery.fn.error = function() {
|
||||
var args = Array.prototype.slice.call( arguments, 0);
|
||||
migrateWarn("jQuery.fn.error() is deprecated");
|
||||
args.splice( 0, 0, "error" );
|
||||
if ( arguments.length ) {
|
||||
return this.bind.apply( this, args );
|
||||
}
|
||||
// error event should not bubble to window, although it does pre-1.7
|
||||
this.triggerHandler.apply( this, args );
|
||||
return this;
|
||||
};
|
||||
|
||||
jQuery.fn.toggle = function( fn, fn2 ) {
|
||||
|
||||
// Don't mess with animation or css toggles
|
||||
if ( !jQuery.isFunction( fn ) || !jQuery.isFunction( fn2 ) ) {
|
||||
return oldToggle.apply( this, arguments );
|
||||
}
|
||||
migrateWarn("jQuery.fn.toggle(handler, handler...) is deprecated");
|
||||
|
||||
// Save reference to arguments for access in closure
|
||||
var args = arguments,
|
||||
guid = fn.guid || jQuery.guid++,
|
||||
i = 0,
|
||||
toggler = function( event ) {
|
||||
// Figure out which function to execute
|
||||
var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
|
||||
jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
|
||||
|
||||
// Make sure that clicks stop
|
||||
event.preventDefault();
|
||||
|
||||
// and execute the function
|
||||
return args[ lastToggle ].apply( this, arguments ) || false;
|
||||
};
|
||||
|
||||
// link all the functions, so any of them can unbind this click handler
|
||||
toggler.guid = guid;
|
||||
while ( i < args.length ) {
|
||||
args[ i++ ].guid = guid;
|
||||
}
|
||||
|
||||
return this.click( toggler );
|
||||
};
|
||||
|
||||
jQuery.fn.live = function( types, data, fn ) {
|
||||
migrateWarn("jQuery.fn.live() is deprecated");
|
||||
if ( oldLive ) {
|
||||
return oldLive.apply( this, arguments );
|
||||
}
|
||||
jQuery( this.context ).on( types, this.selector, data, fn );
|
||||
return this;
|
||||
};
|
||||
|
||||
jQuery.fn.die = function( types, fn ) {
|
||||
migrateWarn("jQuery.fn.die() is deprecated");
|
||||
if ( oldDie ) {
|
||||
return oldDie.apply( this, arguments );
|
||||
}
|
||||
jQuery( this.context ).off( types, this.selector || "**", fn );
|
||||
return this;
|
||||
};
|
||||
|
||||
// Turn global events into document-triggered events
|
||||
jQuery.event.trigger = function( event, data, elem, onlyHandlers ){
|
||||
if ( !elem && !rajaxEvent.test( event ) ) {
|
||||
migrateWarn( "Global events are undocumented and deprecated" );
|
||||
}
|
||||
return eventTrigger.call( this, event, data, elem || document, onlyHandlers );
|
||||
};
|
||||
jQuery.each( ajaxEvents.split("|"),
|
||||
function( _, name ) {
|
||||
jQuery.event.special[ name ] = {
|
||||
setup: function() {
|
||||
var elem = this;
|
||||
|
||||
// The document needs no shimming; must be !== for oldIE
|
||||
if ( elem !== document ) {
|
||||
jQuery.event.add( document, name + "." + jQuery.guid, function() {
|
||||
jQuery.event.trigger( name, null, elem, true );
|
||||
});
|
||||
jQuery._data( this, name, jQuery.guid++ );
|
||||
}
|
||||
return false;
|
||||
},
|
||||
teardown: function() {
|
||||
if ( this !== document ) {
|
||||
jQuery.event.remove( document, name + "." + jQuery._data( this, name ) );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
})( jQuery, window );
|
5
airtime_mvc/public/js/libs/jquery-ui-1.8.24.min.js
vendored
Normal file
6
airtime_mvc/public/js/libs/underscore-min.js
vendored
Normal file
2128
airtime_mvc/public/js/timepicker/jquery-ui-timepicker-addon.js
vendored
Normal file
|
@ -3,6 +3,8 @@
|
|||
A container object (ex a div) must be passed in, the playlist will be built on this element.
|
||||
*/
|
||||
|
||||
var waveformPlaylistAudio = waveformPlaylistAudio || new (window.AudioContext || window.webkitAudioContext);
|
||||
|
||||
var Config = function(params) {
|
||||
|
||||
var that = this,
|
||||
|
@ -10,7 +12,7 @@ var Config = function(params) {
|
|||
|
||||
defaultParams = {
|
||||
|
||||
ac: new (window.AudioContext || window.webkitAudioContext),
|
||||
ac: waveformPlaylistAudio,
|
||||
|
||||
resolution: 4096, //resolution - samples per pixel to draw.
|
||||
timeFormat: 'hh:mm:ss.uuu',
|
||||
|
|