//Javascript for SmilieInsert and Form Check function validatecomment(){ if (document.commentform.cmttext.value==''){ alert(ponygallery_enter_comment); } else if(pg_use_code==1) { if (document.commentform.pg_code.value==''){ alert(ponygallery_enter_code); } else { document.commentform.action = 'index.php'; document.commentform.submit(); } } else { document.commentform.action = 'index.php'; document.commentform.submit(); } } function pg_smilie(thesmile) { document.commentform.cmttext.value += thesmile+' '; document.commentform.cmttext.focus(); } function validatesend2friend(){ if ((document.send2friend.send2friendname.value=='') || (document.send2friend.send2friendemail.value=='')){ alert(ponygallery_enter_name_email); } else { document.send2friend.action = 'index.php'; document.send2friend.submit(); } } function checkMe() { var form = document.adminForm; form.imgtitle.style.backgroundColor = ''; form.catid.style.backgroundColor = ''; var doublefiles = false; // do field validation if (form.imgtitle.value == ''|| form.imgtitle.value == null) { alert(ponygallery_pic_must_have_title); form.imgtitle.style.backgroundColor = pg_ffwrong; form.imgtitle.focus(); return false; } else if (form.catid.value == "0") { alert(ponygallery_select_category); form.catid.style.backgroundColor = pg_ffwrong; form.catid.focus(); return false; //Prüft ob überhaupt Dateien angeben wurden. } else { var zaehl = 0; var arenofiles = true; var fullfields = new Array(); var screenshotfieldname = new Array(); var screenshotfieldvalue = new Array(); for(i=0;i1) { var feld1 = new Number(); var feld2 = new Number(); for(i=0;ii;j--) { if(screenshotfieldvalue[fullfields[i]].indexOf(screenshotfieldvalue[fullfields[j]])==0) { doublefiles = true; document.getElementsByName(screenshotfieldname[fullfields[i]])[0].style.backgroundColor = pg_ffwrong; document.getElementsByName(screenshotfieldname[fullfields[j]])[0].style.backgroundColor = pg_ffwrong; feld1 = i+1; feld2 = j+1 alert(ponygallery_filename_double1+' ' +feld1+' '+ponygallery_filename_double2+' '+feld2+'.'); } } } } if(doublefiles) { document.getElementsByName(screenshotfieldname[0])[0].focus(); return false; } else { form.submit(); return true; } } function checkMe2() { var form = document.adminForm; form.imgtitle.style.backgroundColor = ''; form.catid.style.backgroundColor = ''; // do field validation if (form.imgtitle.value == '' || form.imgtitle.value == null) { alert(ponygallery_pic_must_have_title); form.imgtitle.style.backgroundColor = pg_ffwrong; form.imgtitle.focus(); return false; } else if (form.catid.value == '0') { alert(ponygallery_select_category); form.catid.style.backgroundColor = pg_ffwrong; form.catid.focus(); return false; } else { form.submit(); return true; } } function openjswindow(imgsource, imgtitle, imgwidth, imgheight) { var imgwidth = parseInt(imgwidth); var imgheight = parseInt(imgheight); var scrbar = (resizeJsImage>0) ? 0 : 1; pgwindow = window.open('', 'PonyGallery', 'toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,scrollbars='+scrbar+',width='+imgwidth+',height='+imgheight+''); with(pgwindow.document) { write("" + imgtitle + "<\/title>\n"); write("<meta http-equiv='imagetoolbar' content='no' />\n"); write("<script language='javascript' type='text/javascript'>\n"); write("<!--\n"); write("var disableclick = "+pg_disableclick+";\n"); write("if (disableclick>0) {document.oncontextmenu = function(){return false;} }\n"); write("function resize() {\n"); write(" if("+resizeJsImage+">0) {\n"); write(" var windowWidth, windowHeight, padleft, padtop;\n" ); write(" if (self.innerHeight) { // all except Explorer\n" ); write(" windowWidth = self.innerWidth;\n" ); write(" windowHeight = self.innerHeight;\n" ); write(" padleft = 6;\n" ); write(" padtop = 55;\n" ); write(" } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode\n" ); write(" windowWidth = document.documentElement.clientWidth;\n" ); write(" windowHeight = document.documentElement.clientHeight;\n" ); write(" padleft = 10;\n" ); write(" padtop = 35;\n" ); write(" } else if (document.body) { // other Explorers\n" ); write(" windowWidth = document.body.clientWidth;\n" ); write(" windowHeight = document.body.clientHeight;\n" ); write(" padleft = 10;\n" ); write(" padtop = 35;\n" ); write(" }\n" ); write(" var imgwidth = "+imgwidth+"+padleft;\n"); write(" var imgheight = "+imgheight+"+padtop;\n"); write(" if(imgwidth>windowWidth) {\n"); write(" imgheight = (imgheight * windowWidth)/imgwidth;\n"); write(" imgwidth = windowWidth;\n"); write(" }\n"); write(" if(imgheight>windowHeight) {\n"); write(" imgwidth = (imgwidth * windowHeight)/imgheight;\n"); write(" imgheight = windowHeight;\n"); write(" }\n"); write(" self.resizeTo(imgwidth, imgheight);\n"); write(" self.document.getElementById('js_window_image').width = imgwidth-padleft;\n"); write(" self.document.getElementById('js_window_image').style.width = imgwidth-padleft;\n"); write(" self.document.getElementById('js_window_image').height = imgheight-padtop;\n"); write(" self.document.getElementById('js_window_image').style.height = imgheight-padtop;\n"); write(" self.document.body.style.overflow='hidden'\n"); write(" } else {\n"); write(" self.document.body.style.overflow=''\n"); write(" }\n"); write(" self.focus();\n"); write("}\n"); write("function clicker() { \n"); write("if (disableclick>0) {self.close(); } \n"); write("}\n"); write("\/\/-->\n"); write("<\/script>\n"); write("<\/head>\n"); write("<body topmargin='0' marginheight='0' leftmargin='0' marginwidth='0' onload='resize()' onclick='clicker()' onblur='self.focus()'>\n"); write("<img src='" + imgsource + "' border='0' hspace='0' vspace='0' onclick='self.close()' alt='"+imgtitle+"'\ id=\"js_window_image\" class=\"pngfile\" />\n"); write("<\/body><\/html>"); close(); } pgwindow.moveTo(0,0); } // This Script was written by Benjamin Meier, b2m@gmx.de // The DHTML-function for creating a overlaying div-layer uses parts of the Dynamic Image Mambot, written by Manuel Hirsch // and Lightbox => core code quirksmode.org function opendhtml(imgsource, imgtitle, imgtext, imgwidth, imgheight) { imgwidth = parseInt(imgwidth); imgheight = parseInt(imgheight); var windowWidth, windowHeight; if (self.innerHeight) { // all except Explorer windowWidth = self.innerWidth; windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { // other Explorers windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } var yScroll, xScroll; if (self.pageYOffset) { yScroll = self.pageYOffset; xScroll = self.pageXOffset; } else if (document.documentElement && document.documentElement.scrollTop){ // Explorer 6 Strict yScroll = document.documentElement.scrollTop; xScroll = document.documentElement.scrollLeft; } else if (document.body) {// all other Explorers yScroll = document.body.scrollTop; xScroll = document.body.scrollLeft; } if(resizeJsImage==1) { if((imgwidth+3*pg_padding)>windowWidth) { imgheight = (imgheight * (windowWidth-2*pg_padding))/imgwidth; imgwidth = windowWidth-2*pg_padding; } if((imgheight+2*pg_padding+80)>windowHeight) { imgwidth = (imgwidth * (windowHeight-2*pg_padding-80))/imgheight; imgheight = windowHeight-2*pg_padding-80; } } var postop =(windowHeight/2)-(imgheight/2)+yScroll+document.body.style.padding-10; var posleft =(windowWidth/2)-(imgwidth/2)+xScroll+document.body.style.padding; if(postop >= 30) { postop = postop-30; } var bodyObj = document.getElementsByTagName('BODY')[0]; if(!document.getElementById("pg_photocontainer")) { divObjContainer = document.createElement("div"); divObjContainer.setAttribute("id", "pg_photocontainer"); bodyObj.appendChild(divObjContainer); } else { divObjContainer = document.getElementById("pg_photocontainer"); } var closeimg = new Image(); closeimg.src = "components/com_ponygallery/images/close.png"; var dhtmltext, dhtmltext2=""; divObjContainer.style.display = "block"; dhtmltext = "<div class=\"pg_photocontainer\" style=\"top:"+postop+"px; left:"+posleft+"px; position: absolute; display:block;z-index:99999;\" onclick=\"pg_photocontainershut()\">"; dhtmltext += "<div class=\"photoborder\" style=\"background-color: "+pg_openjs_background+"; padding: "+pg_padding+"px; border: solid 1px "+pg_dhtml_border+";\">"; dhtmltext += "<img onclick=\"pg_photocontainershut()\" style=\"cursor:pointer;border: solid 1px #000;width:"+imgwidth+"px;height:"+imgheight+"px;\" src=\""+imgsource+"\" alt=\""+imgtitle+"\" width=\""+imgwidth+"px\" height=\""+imgheight+"px\" class=\"pngfile\" \/>"; dhtmltext += "<img onclick=\"pg_photocontainershut()\" style=\"cursor:pointer;position:absolute;bottom:"+pg_padding+"px;right:"+pg_padding+"px;width:"+closeimg.width+"px;height:"+closeimg.height+"px;\" src=\""+closeimg.src+"\" alt=\"close\" id=\"dhtml_close\" class=\"pngfile\" />"; dhtmltext += "<br /><div id=\"pony_dhtml_imgtext\" style=\"margin-top:"+pg_padding+"px;text-align: justify; width:"+imgwidth+"px;\"> <br /> </div>"; dhtmltext += "<\/div></div>"; divObjContainer.innerHTML = dhtmltext; document.getElementById("pony_dhtml_imgtext").style.width2 = document.getElementById("pony_dhtml_imgtext").style.width-document.getElementById("dhtml_close").style.width; if (pg_show_title_in_dhtml==1) { dhtmltext2 += "<strong>"+imgtitle+"</strong><br />"; } if (pg_show_description_in_dhtml==1) { dhtmltext2 += imgtext; } if (dhtmltext2!="") { document.getElementById("pony_dhtml_imgtext").innerHTML = dhtmltext2; } if (pg_disableclick==1) { divObjContainer.oncontextmenu = function(){return false;} } } function pg_photocontainershut() { document.getElementById("pg_photocontainer").style.display = "none"; } function pony_cursor_change(e) { if(pg_comment_active!=1) { if(navigator.appName == "Microsoft Internet Explorer") { taste = window.event.keyCode; } else { taste = e.which; } switch (taste) { case 37: if(document.getElementsByName("pg_back_link")[0]) { window.location = document.getElementsByName("pg_back_link")[0].value; } break; case 39: if(document.getElementsByName("pg_forward_link")[0]) { window.location = document.getElementsByName("pg_forward_link")[0].value; } break; default: break; } } }