summaryrefslogtreecommitdiffstats
path: root/public/media/js/script.js
diff options
context:
space:
mode:
authorBjörn Geiger2011-09-07 12:31:50 +0200
committerBjörn Geiger2011-09-07 12:31:50 +0200
commitcf192ca9b5190b5aade9d6ad195127984780f7de (patch)
tree87016c365c64225007892b34019ef76a1390aaa0 /public/media/js/script.js
parentkleine Korrektur von eben (diff)
downloadpoolctrl-cf192ca9b5190b5aade9d6ad195127984780f7de.tar.gz
poolctrl-cf192ca9b5190b5aade9d6ad195127984780f7de.tar.xz
poolctrl-cf192ca9b5190b5aade9d6ad195127984780f7de.zip
verschiedene Änderungen im AddForm
Diffstat (limited to 'public/media/js/script.js')
-rw-r--r--public/media/js/script.js146
1 files changed, 97 insertions, 49 deletions
diff --git a/public/media/js/script.js b/public/media/js/script.js
index c55b996..aac221d 100644
--- a/public/media/js/script.js
+++ b/public/media/js/script.js
@@ -1,67 +1,115 @@
-$(document).ready(function() {
- if($('.listelement .element').find('.dispnone').length >= 1){
- $('.listelement .element').find('.dispnone').parent().find('.title')
- .css('cursor','pointer')
- .prepend("<span class='toggler'><img src='/media/img/right.png'></span> ")
- .data('toggle','0');
-
- $('.listelement .title').click(function(){
- $(this).siblings('.dispnone').toggle();
- if($(this).data('toggle') == '0'){
- $(this).data('toggle','1');
- $(this).find('.toggler img').attr('src','/media/img/down.png')
- }
- else{
- $(this).data('toggle','0');
- $(this).find('.toggler img').attr('src','/media/img/right.png')
- }
- });
- }
- $('.helpericon').click(function(){
- $('.infobox').slideToggle('fast');
- if($(this).data('info') == '1'){
- $(this).data('info','0').attr('src','/media/img/bulb_off.png');
- } else{
- $(this).data('info','1').attr('src','/media/img/bulb_on.png');
- }
- });
- path = window.location.pathname.split('/');
- if (path[2] == 'person' && (path[3] == 'owndetails' || path[3] == 'edit' || path[3] == 'request') && path[4] != 'personID') {
- mypath = '/' + path[1] + '/' + path[2] + '/owndetails';
- } else if(path[2] == 'group' && (path[3] == 'show' || path[3] == 'edit') && path[4] != 'groupID') {
- mypath = '/' + path[1] + '/' + path[2] + '/show';
- } else {
- mypath = '/' + path[1] + '/' + path[2];
- }
- $('.portletNavigationTree a').each(function() {
- if ($(this).attr('href') == mypath) {
- /* console.log($(this).parent()); */
- $(this).addClass('navTreeCurrentNode');
- $(this).addClass('navTreeCurrentItem');
- }
- });
-});
+$(document)
+ .ready(
+ function() {
+ if ($('.listelement .element').find('.dispnone').length >= 1) {
+ $('.listelement .element')
+ .find('.dispnone')
+ .parent()
+ .find('.title')
+ .css('cursor', 'pointer')
+ .prepend(
+ "<span class='toggler'><img src='/media/img/right.png'></span> ")
+ .data('toggle', '0');
+
+ $('.listelement .title').click(
+ function() {
+ $(this).siblings('.dispnone').toggle();
+ if ($(this).data('toggle') == '0') {
+ $(this).data('toggle', '1');
+ $(this).find('.toggler img').attr(
+ 'src', '/media/img/down.png')
+ } else {
+ $(this).data('toggle', '0');
+ $(this).find('.toggler img').attr(
+ 'src', '/media/img/right.png')
+ }
+ });
+ }
+ $('.helpericon').click(
+ function() {
+ $('.infobox').slideToggle('fast');
+ if ($(this).data('info') == '1') {
+ $(this).data('info', '0').attr('src',
+ '/media/img/bulb_off.png');
+ } else {
+ $(this).data('info', '1').attr('src',
+ '/media/img/bulb_on.png');
+ }
+ });
+ path = window.location.pathname.split('/');
+ if (path[2] == 'person'
+ && (path[3] == 'owndetails' || path[3] == 'edit' || path[3] == 'request')
+ && path[4] != 'personID') {
+ mypath = '/' + path[1] + '/' + path[2] + '/owndetails';
+ } else if (path[2] == 'group'
+ && (path[3] == 'show' || path[3] == 'edit')
+ && path[4] != 'groupID') {
+ mypath = '/' + path[1] + '/' + path[2] + '/show';
+ } else {
+ mypath = '/' + path[1] + '/' + path[2];
+ }
+ $('.portletNavigationTree a').each(function() {
+ if ($(this).attr('href') == mypath) {
+ /* console.log($(this).parent()); */
+ $(this).addClass('navTreeCurrentNode');
+ $(this).addClass('navTreeCurrentItem');
+ }
+ });
+ });
function checkAllCheckBoxes(exceptions) {
- $('input:checkbox').attr('checked','checked');
+ $('input:checkbox').attr('checked', 'checked');
return;
}
function uncheckAllCheckBoxes(exceptions) {
- $('input:checkbox').attr('checked','');
+ $('input:checkbox').attr('checked', '');
return;
}
function setVisible(name) {
hidden = document.getElementById(name);
- if(hidden) {
- hidden.style.display="inline";
+ if (hidden) {
+ hidden.style.display = "";
}
}
function setInvisible(name) {
visible = document.getElementById(name);
- if(visible) {
- visible.style.display="none";
+ if (visible) {
+ visible.style.display = "none";
+ }
+}
+
+function eventcategoryfieldChanged(name) {
+ field = document.getElementById(name);
+ value = field.value;
+ options = field.options;
+ for (i = 0; i < options.length; i++) {
+ option = options[i];
+ if (option.value == field.value) {
+ break;
+ }
+ }
+ label = option.label;
+ endLabel = document.getElementById('end-label');
+ endElement = document.getElementById('end-element');
+ startLabel = document.getElementById('start-label');
+ repeat = document.getElementById('repeat');
+ if (label == 'Boot' || label == 'Shutdown') {
+ endLabel.style.display = "none";
+ endElement.style.display = "none";
+ startLabel.firstChild.firstChild.nodeValue = startLabel.firstChild.firstChild.nodeValue.replace(/Start/g, "Date");
+ repeat.checked = false;
+ } else if (label == 'Lecture') {
+ endLabel.style.display = "";
+ endElement.style.display = "";
+ startLabel.firstChild.firstChild.nodeValue = startLabel.firstChild.firstChild.nodeValue.replace(/Date/g, "Start");
+ repeat.checked = true;
+ } else {
+ endLabel.style.display = "";
+ endElement.style.display = "";
+ startLabel.firstChild.firstChild.nodeValue = startLabel.firstChild.firstChild.nodeValue.replace(/Date/g, "Start");
+ repeat.checked = false;
}
} \ No newline at end of file