Merge branch 'master' of dev.sourcefabric.org:airtime
This commit is contained in:
commit
0152ad7f44
27 changed files with 474 additions and 190 deletions
8
public/js/airtime/common/common.js
Normal file
8
public/js/airtime/common/common.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
$(document).ready(function() {
|
||||
|
||||
$("#Panel").stickyPanel({
|
||||
topPadding: 1,
|
||||
afterDetachCSSClass: "floated-panel",
|
||||
savePanelSpace: true
|
||||
});
|
||||
});
|
|
@ -60,7 +60,15 @@ function findHosts(request, callback) {
|
|||
function setAddShowEvents() {
|
||||
var start, end;
|
||||
|
||||
$("#schedule-add-show-tabs").tabs();
|
||||
$(".tabs").tabs();
|
||||
|
||||
if(!$("#add_show_repeats").attr('checked')) {
|
||||
$("#schedule-show-when > fieldset:last").hide();
|
||||
}
|
||||
|
||||
$("#add_show_repeats").click(function(){
|
||||
$("#schedule-show-when > fieldset:last").toggle();
|
||||
});
|
||||
|
||||
start = $("#add_show_start_date");
|
||||
end = $("#add_show_end_date");
|
||||
|
@ -69,13 +77,20 @@ function setAddShowEvents() {
|
|||
createDateInput(end, endDpSelect);
|
||||
|
||||
$("#add_show_start_time").timepicker();
|
||||
$("#add_show_duration").timepicker({
|
||||
amPmText: ['', '']
|
||||
});
|
||||
|
||||
$("#add_show_hosts_autocomplete").autocomplete({
|
||||
source: findHosts,
|
||||
select: autoSelect
|
||||
select: autoSelect,
|
||||
delay: 200
|
||||
});
|
||||
|
||||
$("#schedule-show-style input").ColorPicker({
|
||||
onChange: function (hsb, hex, rgb, el) {
|
||||
$(el).val(hex);
|
||||
},
|
||||
onSubmit: function(hsb, hex, rgb, el) {
|
||||
$(el).val(hex);
|
||||
$(el).ColorPickerHide();
|
||||
|
@ -99,8 +114,8 @@ $(document).ready(function() {
|
|||
$("#fullcalendar_show_display").fullCalendar({
|
||||
header: {
|
||||
left: 'prev, next, today',
|
||||
center: '',
|
||||
right: ''
|
||||
center: 'title',
|
||||
right: 'agendaDay, agendaWeek, month'
|
||||
},
|
||||
defaultView: 'agendaDay',
|
||||
editable: false,
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
setSelector(col, cal.get(0));
|
||||
setHue(col, cal.get(0));
|
||||
setNewColor(col, cal.get(0));
|
||||
cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
|
||||
cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el]);
|
||||
},
|
||||
blur = function (ev) {
|
||||
var cal = $(this).parent().parent();
|
||||
|
@ -454,6 +454,7 @@
|
|||
} else if (col.r != undefined && col.g != undefined && col.b != undefined) {
|
||||
col = RGBToHSB(col);
|
||||
} else if (col.h != undefined && col.s != undefined && col.b != undefined) {
|
||||
|
||||
col = fixHSB(col);
|
||||
} else {
|
||||
return this;
|
||||
|
@ -481,4 +482,4 @@
|
|||
ColorPickerShow: ColorPicker.showPicker,
|
||||
ColorPickerSetColor: ColorPicker.setColor
|
||||
});
|
||||
})(jQuery)
|
||||
})(jQuery)
|
||||
|
|
95
public/js/libs/jquery.stickyPanel.js
Normal file
95
public/js/libs/jquery.stickyPanel.js
Normal file
|
@ -0,0 +1,95 @@
|
|||
/*
|
||||
* jQuery.stickyPanel
|
||||
* ----------------------
|
||||
* version: 1.0.0
|
||||
* date: 1/17/11
|
||||
*
|
||||
* Copyright (c) 2011 Donny Velazquez
|
||||
* http://donnyvblog.blogspot.com/
|
||||
* http://code.google.com/p/stickyPanel
|
||||
*
|
||||
* Licensed under the Apache License 2.0
|
||||
*
|
||||
*/
|
||||
(function ($) {
|
||||
|
||||
$.fn.stickyPanel = function (options) {
|
||||
|
||||
var options = $.extend({}, $.fn.stickyPanel.defaults, options);
|
||||
|
||||
return this.each(function () {
|
||||
$(window).bind("scroll.stickyPanel", { selected: $(this), options: options }, Scroll);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
function Scroll(event) {
|
||||
var node = event.data.selected;
|
||||
var o = event.data.options;
|
||||
|
||||
// when top of window reaches the top of the panel detach
|
||||
if ($(document).scrollTop() >= node.offset().top) {
|
||||
|
||||
// topPadding
|
||||
var top = 0;
|
||||
if (o.topPadding != "undefined") {
|
||||
top = top + o.topPadding;
|
||||
}
|
||||
|
||||
// save panels top
|
||||
node.data("PanelsTop", node.offset().top - top);
|
||||
|
||||
// afterDetachCSSClass
|
||||
if (o.afterDetachCSSClass != "") {
|
||||
node.addClass(o.afterDetachCSSClass);
|
||||
}
|
||||
|
||||
// savePanelSpace
|
||||
if (o.savePanelSpace == true) {
|
||||
var width = node.outerWidth(true);
|
||||
var height = node.outerHeight(true);
|
||||
var float = node.css("float");
|
||||
var randomNum = Math.ceil(Math.random() * 9999); /* Pick random number between 1 and 9999 */
|
||||
node.data("PanelSpaceID", "stickyPanelSpace" + randomNum);
|
||||
node.before("<div id='" + node.data("PanelSpaceID") + "' style='width:" + width + "px;height:" + height + "px;float:" + float + ";'></div>");
|
||||
}
|
||||
|
||||
// detach panel
|
||||
node.css({
|
||||
"top": top,
|
||||
"position": "fixed"
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
if ($(document).scrollTop() <= node.data("PanelsTop")) {
|
||||
|
||||
if (o.savePanelSpace == true) {
|
||||
$("#" + node.data("PanelSpaceID")).remove();
|
||||
}
|
||||
|
||||
// attach panel
|
||||
node.css({
|
||||
"top": "auto",
|
||||
"position": "static"
|
||||
});
|
||||
|
||||
if (o.afterDetachCSSClass != "") {
|
||||
node.removeClass(o.afterDetachCSSClass);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$.fn.stickyPanel.defaults = {
|
||||
topPadding: 0,
|
||||
// Use this to set the top margin of the detached panel.
|
||||
|
||||
afterDetachCSSClass: "",
|
||||
// This class is applied when the panel detaches.
|
||||
|
||||
savePanelSpace: false
|
||||
// When set to true the space where the panel was is kept open.
|
||||
};
|
||||
|
||||
})(jQuery);
|
Loading…
Add table
Add a link
Reference in a new issue