[Picfinity-commit] SF.net SVN: picfinity: [60] trunk/.themes/db/db.js
Status: Beta
Brought to you by:
espadav8
From: <esp...@us...> - 2007-08-26 11:16:56
|
Revision: 60 http://picfinity.svn.sourceforge.net/picfinity/?rev=60&view=rev Author: espadav8 Date: 2007-08-26 04:16:59 -0700 (Sun, 26 Aug 2007) Log Message: ----------- Use setAttribute for the buttons type, fixes a bug in Opera Remove a few unneeded vars When closing an image, only try and remove the comments if they exist Don't give focus to the first input on the form since it's a hidden input Modified Paths: -------------- trunk/.themes/db/db.js Modified: trunk/.themes/db/db.js =================================================================== --- trunk/.themes/db/db.js 2007-08-25 15:31:09 UTC (rev 59) +++ trunk/.themes/db/db.js 2007-08-26 11:16:59 UTC (rev 60) @@ -415,6 +415,7 @@ expandedImage.src = imageThumbPath; return expandedImageDiv; + } function createCommentForm(imageID) @@ -506,7 +507,7 @@ { var tmpButton = document.createElement("button"); tmpButton.appendChild(document.createTextNode(buttonText)); - tmpButton.type = buttonType; + tmpButton.setAttribute("type", buttonType); return tmpButton; } @@ -684,12 +685,8 @@ function showImage(imageID) { - var siblingNodes = getChildNodesByTagName(getLayoutNode(imageID).parentNode, "image"); - var expandedImage = createExpandedImage(getLayoutNode(imageID)); - // var imageComments = createComments(siblingNodes[i]); - if (document.getElementById("expandedimage")) { document.getElementById("expandedimage").parentNode.replaceChild(expandedImage, document.getElementById("expandedimage")); @@ -701,7 +698,9 @@ // remove the old comments if (document.getElementById("comments")) + { document.getElementById("comments").parentNode.removeChild(document.getElementById("comments")); + } getCommentsXML(imageID); @@ -717,13 +716,21 @@ function closeImage() { - document.getElementById("expandedimage").parentNode.removeChild(document.getElementById("expandedimage")); - document.getElementById("comments").parentNode.removeChild(document.getElementById("comments")); + if (document.getElementById("expandedimage")) + { + document.getElementById("expandedimage").parentNode.removeChild(document.getElementById("expandedimage")); + } + if (document.getElementById("comments")) + { + document.getElementById("comments").parentNode.removeChild(document.getElementById("comments")); + } var lastSelectedImage = getElementsByClassName("selected", "div", document); if (lastSelectedImage) + { lastSelectedImage[0].className = "thumbnail"; + } } function getCommentsXML(imageID) @@ -731,7 +738,7 @@ if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); - xmlHttp.onprogress = commentsProgress; + // xmlHttp.onprogress = commentsProgress; xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4) { @@ -842,7 +849,6 @@ else { commentForm.style.display = ""; - commentForm.getElementsByTagName("input")[0].focus(); } } @@ -940,4 +946,4 @@ ((path) ? ';path=' + path : '') + ((domain) ? ';domain=' + domain : '') + ';expires=Thu, 01-Jan-1970 00:00:01 GMT'; -} \ No newline at end of file +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |