/** * Users can change the contents of a Web page when the contentEditable property is set * to TRUE. This method submits the changes for the object specified by id. * * @param url Url of the object to be changed. * @param id Id of the object to be changed. * @param key Key of the property to be changed. */ function contenteditableChangeClick(url, id, key) { var elName = key + "_" + id; var elValue = escape(window.eval(elName).innerHTML); var fmName = id + "Form"; document.write('
'); var fm = document.forms[fmName]; fm.submit(); } /** * Users can change the contents of a Web page when the contentEditable property is set * to TRUE. */ function contentEditableBlur( el, id, objAttrName) { var text = el.innerHTML; var fm = document.forms['form0_'+id]; var formats = new Array(); formats['caption'] = new Array(); formats['caption']['tag'] = 'p'; formats['caption']['subtag'] = 'br'; formats['indented_block'] = new Array(); formats['indented_block']['tag'] = 'blockquote'; formats['indented_block']['subtag'] = 'br'; formats['plain_html'] = new Array(); formats['plain_html']['tag'] = ''; formats['plain_html']['subtag'] = ''; formats['unordered_list'] = new Array(); formats['unordered_list']['tag'] = 'ul'; formats['unordered_list']['subtag'] = 'li'; formats['emphasis'] = new Array(); formats['emphasis']['tag'] = 'p'; formats['emphasis']['subtag'] = 'br'; formats['ordered_list'] = new Array(); formats['ordered_list']['tag'] = 'ol'; formats['ordered_list']['subtag'] = 'li'; formats['body'] = new Array(); formats['body']['tag'] = 'p'; formats['body']['subtag'] = 'br'; formats['headline_1'] = new Array(); formats['headline_1']['tag'] = 'p'; formats['headline_1']['subtag'] = 'br'; formats['headline_2'] = new Array(); formats['headline_2']['tag'] = 'p'; formats['headline_2']['subtag'] = 'br'; formats['headline_3'] = new Array(); formats['headline_3']['tag'] = 'p'; formats['headline_3']['subtag'] = 'br'; formats['headline_4'] = new Array(); formats['headline_4']['tag'] = 'p'; formats['headline_4']['subtag'] = 'br'; var formatElement = fm.elements['format']; var format = '?'; if ( formatElement.value) format = formatElement.value; else format = formatElement.options[ formatElement.selectedIndex].value; var tag = formats[ format]['tag'].toUpperCase(); var subtag = formats[ format]['subtag'].toUpperCase(); // Remove tags. if ( tag.length > 0) { var startTag = '<' + tag; var endTag = '' + tag; if ( text.indexOf( startTag) == 0) text = text.substring( text.indexOf( '>' ,text.indexOf(startTag))+1); text = text.replace(startTag+'>', ''); if ( text.lastIndexOf( endTag) > 0 && text.lastIndexOf('>',text.lastIndexOf(endTag)) == text.length-1) text = text.substring( 0, text.lastIndexOf( endTag)); text = text.replace(endTag+'>', ''); } // Remove sub-tags. if ( subtag.length > 0) { var newText = ''; var startTag = '<' + subtag + '>'; var endTag = '' + subtag + '>'; while ( text.indexOf( startTag) >= 0) text = text.replace( startTag, ''); while ( text.indexOf( endTag) >= 0) text = text.replace( endTag, ''); } // Remove para-entities. var paraEnt = '¶\n'; while ( text.indexOf( paraEnt) >= 0) text = text.replace( paraEnt, ''); // Trim. while ( text.length > 0 && text.charAt(0) <= ' ') text = text.substring(1); while ( text.length > 0 && text.charAt( text.length-1) <= ' ') text = text.substring(0, text.length-1); // Set text. var objAttrElement = fm.elements[ objAttrName]; objAttrElement.value = text; } // ############################################################################ // ### // ### Drag & Drop (http://aktuell.de.selfhtml.org/tippstricks/dhtml/draganddrop/index.htm) // ### // ############################################################################ //Das Objekt, das gerade bewegt wird. var dragobjekt = null; // Position, an der das Objekt angeklickt wurde. var dragx = 0; var dragy = 0; // Mausposition var posx = 0; var posy = 0; /** * Initialisierung der Überwachung der Events */ function draginit() { document.ondragstart = Function("return false;"); document.onmousemove = drag; document.onmouseup = dragstop; } /** * Wird aufgerufen, wenn ein Objekt bewegt werden soll. */ function dragstart(element) { dragobjekt = element; dragx = posx - dragobjekt.offsetLeft; dragy = posy - dragobjekt.offsetTop; } /** * Wird aufgerufen, wenn ein Objekt nicht mehr bewegt werden soll. */ function dragstop() { dragobjekt=null; } /** * Wird aufgerufen, wenn die Maus bewegt wird und bewegt bei Bedarf das Objekt. */ function drag(ereignis) { posx = document.all ? window.event.clientX : ereignis.pageX; posy = document.all ? window.event.clientY : ereignis.pageY; if(dragobjekt != null) { dragobjekt.style.left = (posx - dragx) + "px"; dragobjekt.style.top = (posy - dragy) + "px"; } } // ############################################################################ // ### // ### Direct-Edit 2.0 // ### // ############################################################################ /** * Direct-Edit: Form Submit */ function directEditFormSubmit( fm) { directEditCloseAll(); return self.btnClicked != 'Abbrechen'; } /** * Direct-Edit: Expand It */ var directEditAutoClose = false; function directEditExpandIt( div_id, poser_id, autoClose) { directEditAutoClose = autoClose; var coords = {x: 0, y: 0}; var el = document.images[ poser_id]; coords.x += el.width; coords.y += el.height; while (el) { coords.x += el.offsetLeft; coords.y += el.offsetTop; el = el.offsetParent; } var el = document.getElementById( div_id); el.style.left = coords['x'] + "px"; el.style.top = coords['y'] + "px"; el.style.position = "absolute"; el.style.display = "block"; el.style.visibility = "visible"; } /** * Direct-Edit: Close All */ function directEditCloseAll() { directEditCloseAllByClassName( "DirectEditActionList"); directEditCloseAllByClassName( "DirectEditManageForm"); } /** * Direct-Edit: Start/Stop Close */ var directEditActive; function directEditStartClose() { if ( directEditAutoClose) directEditActive = window.setTimeout( "directEditCloseAll()", 1000); } function directEditStopClose() { if ( directEditActive) window.clearTimeout( directEditActive); } /** * Direct-Edit: Close All By Class-Name */ function directEditCloseAllByClassName( name) { directEditStopClose(); // IE4 var browser = navigator.appName; if (browser=="Microsoft Internet Explorer") { tempColl = document.all.tags( "div"); for (i=0; i