summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorSebastian Wagner2011-09-09 17:59:59 +0200
committerSebastian Wagner2011-09-09 17:59:59 +0200
commit626906f700ef09e443f813e80b0024ad5acb8bbb (patch)
treea47a6815e73805f7374cdb6c68740159751674a3 /application
parentaddEvent button, new event attr: selected (diff)
downloadpoolctrl-626906f700ef09e443f813e80b0024ad5acb8bbb.tar.gz
poolctrl-626906f700ef09e443f813e80b0024ad5acb8bbb.tar.xz
poolctrl-626906f700ef09e443f813e80b0024ad5acb8bbb.zip
clean up
Diffstat (limited to 'application')
-rw-r--r--application/views/scripts/event/index.phtml82
1 files changed, 38 insertions, 44 deletions
diff --git a/application/views/scripts/event/index.phtml b/application/views/scripts/event/index.phtml
index 63323a5..a0517bc 100644
--- a/application/views/scripts/event/index.phtml
+++ b/application/views/scripts/event/index.phtml
@@ -9,9 +9,11 @@
<script type="text/javascript">
$(document).ready(function() {iniCalendar();});
-var lastview;
+
var eventColor = {ev:null, color:null};
+
+// change border color of an event
function eventSelected(event) {
if (eventColor.ev != null){
event.selected = false;
@@ -24,6 +26,7 @@ var eventColor = {ev:null, color:null};
$('#calendar').fullCalendar("rerenderEvents");
}
+// TO DO: Eventhandler löschen
function pressKey(event) {
if(event.selected) {
$(document).keydown(function (e) {
@@ -38,7 +41,8 @@ var eventColor = {ev:null, color:null};
});
}
}
-
+
+// change view to addEvent
function addEvent() {
self.location="/event/add/";
}
@@ -51,25 +55,29 @@ var eventColor = {ev:null, color:null};
$("#calendar").hide();
}
+// fetch all poolevents of the selected #poolselectbox value
function fetchPoolEvents(element) {
var poolID = $("#poolselectbox option:selected").val();
$('#calendar').fullCalendar("removeEvents");
$('#calendar').fullCalendar("addEventSource", "/event/eventlist/poolID/" + poolID);
}
-
+
+// initialize fullCalendar
function iniCalendar() {
var calendar = $('#calendar').fullCalendar({
+
+ // fullCalendar header
header: {
default: 'week',
left: 'title',
center: 'prev,next today',
right: 'agendaWeek,agendaDay'
},
+
+ // set some default options
editable: true,
allDaySlot: false,
-// disableDragging: false,
-// droppable: true,
selectable: true,
selectHelper: true,
defaultView: 'agendaWeek',
@@ -89,22 +97,26 @@ var eventColor = {ev:null, color:null};
eventMouseout: function( event, jsEvent, view ) {
},
+ /*
+ * TO DO: implement dblclick-function
+ *
dblclick: function( event, jsEvent, view ) {
alert('test');
},
+ */
eventClick: function( event, jsEvent, view ) {
- //event.hide();
-
- //event.dblclick(alert('test'););
- //$('#calendar').dblclick(function() { self.location = "/event/edit/eventID/" + event.id;});
-
- eventSelected(event);
+ /*
+ * TO DO: export eventEdit in dblClick function
+ *
+ *event.dblclick(alert('test'););
+ *$('#calendar').dblclick(function() { self.location = "/event/edit/eventID/" + event.id;});
+ */
+
+ eventSelected(event);
- pressKey(event);
-
- return false;
+ //pressKey(event);
},
@@ -193,49 +205,31 @@ var eventColor = {ev:null, color:null};
// Change Button-Style
$("#lecture").click(function(){
- if($("#lecture").hasClass("fc-state-active")) {
- $("#lecture").removeClass("fc-state-active");
- } else {$("#lecture").addClass("fc-state-active");}
+ if($(this).hasClass("fc-state-active")) {
+ $(this).removeClass("fc-state-active");
+ } else {$(this).addClass("fc-state-active");}
});
$("#maintenance").click(function(){
- if($("#maintenance").hasClass("fc-state-active")) {
- $("#maintenance").removeClass("fc-state-active");
- } else {$("#maintenance").addClass("fc-state-active");}
+ if($(this).hasClass("fc-state-active")) {
+ $(this).removeClass("fc-state-active");
+ } else {$(this).addClass("fc-state-active");}
});
$("#boot").click(function(){
- if($("#boot").hasClass("fc-state-active")) {
- $("#boot").removeClass("fc-state-active");
- } else {$("#boot").addClass("fc-state-active");}
+ if($(this).hasClass("fc-state-active")) {
+ $(this).removeClass("fc-state-active");
+ } else {$(this).addClass("fc-state-active");}
});
$("#shutdown").click(function(){
- if($("#shutdown").hasClass("fc-state-active")) {
- $("#shutdown").removeClass("fc-state-active");
- } else {$("#shutdown").addClass("fc-state-active");}
+ if($(this).hasClass("fc-state-active")) {
+ $(this).removeClass("fc-state-active");
+ } else {$(this).addClass("fc-state-active");}
});
$("#addEvent").click(function(){
addEvent();});
- $.post()
$.get("/event/getpoollist/", function(getpoollistresult){$("#poolselectbox").append(getpoollistresult);});
-
- /*
- $('.fc-header-center').click(function() {
- $('#calendar').fullCalendar('removeEvents', function(calEvent) { return calEvent.category == 'Lecture'} );
-
- $('.fc-header-center').click(function() {
- $('#calendar').fullCalendar('removeEvents', function(calEvent) { return calEvent.category == 'Maintenance'} );
- })
-
- $('.fc-header-center').click(function() {
- $('#calendar').fullCalendar('removeEvents', function(calEvent) { return calEvent.category == 'Boot'} );
- })
-
- $('.fc-header-center').click(function() {
- $('#calendar').fullCalendar('removeEvents', function(calEvent) { return calEvent.category == 'Shutdown'} );
- })
- */
}
</script>