aboutsummaryrefslogtreecommitdiffstats
path: root/template-common
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2006-07-26 21:29:21 +0000
committerrub <rub@piwigo.org>2006-07-26 21:29:21 +0000
commit7ca31726ed18b70c04eb606e081df20aa63e9c06 (patch)
tree0ad492992765b2e4443423bca1c6722731f9b12d /template-common
parente7f8b142697c6066cb4da31da94b13dec562eb2e (diff)
Resolved Issue ID 0000474 (Step 2):
o Add .htaccess files => * admin - .htaccess = deny from all * doc - no .htaccess * galleries - .htaccess = Options -Indexes * include - .htaccess = deny from all => move 2 .js in template-common * install - .htaccess = deny from all * language - .htaccess = deny from all * template - .htaccess = Options -Indexes * template-common - .htaccess = Options -Indexes * template-extension - .htaccess = Options -Indexes * tools - no .htaccess git-svn-id: http://piwigo.org/svn/trunk@1505 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'template-common')
-rw-r--r--template-common/.htaccess2
-rw-r--r--template-common/pngfix.js37
-rw-r--r--template-common/scripts.js79
3 files changed, 118 insertions, 0 deletions
diff --git a/template-common/.htaccess b/template-common/.htaccess
new file mode 100644
index 000000000..eee07900b
--- /dev/null
+++ b/template-common/.htaccess
@@ -0,0 +1,2 @@
+Options -Indexes
+
diff --git a/template-common/pngfix.js b/template-common/pngfix.js
new file mode 100644
index 000000000..549761a1d
--- /dev/null
+++ b/template-common/pngfix.js
@@ -0,0 +1,37 @@
+
+// Correctly handle PNG transparency in Win IE 5.5 or higher.
+// http://homepage.ntlworld.com/bobosola. Updated 02-March-2004
+// 15-Jully-2006 : chrisaga use \" instead of ' in imgTitle
+// : to fix ' display in tooltips
+// : keep the alt attribute
+
+function correctPNG()
+ {
+ for(var i=0; i<document.images.length; i++)
+ {
+ var img = document.images[i]
+ if (img.className == "button" || img.className == "icon")
+ {
+ var imgName = img.src.toUpperCase()
+ if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
+ {
+ var imgID = (img.id) ? "id='" + img.id + "' " : ""
+ var imgClass = (img.className) ? "class='" + img.className + "' " : ""
+ //var imgTitle = (img.title) ? "title=\"" + img.title + "\" " : "alt=\"" + img.alt + "\" "
+ var imgTitle = (img.title) ? "title=\"" + img.title + "\" " : "";
+ imgTitle = imgTitle + (img.alt) ? "title=\"" + img.alt + "\" " : "";
+ var imgStyle = "display:inline-block;" + img.style.cssText
+ if (img.align == "left") imgStyle = "float:left;" + imgStyle
+ if (img.align == "right") imgStyle = "float:right;" + imgStyle
+ if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
+ var strNewHTML = "<span " + imgID + imgClass + imgTitle
+ + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+ + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+ + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
+ img.outerHTML = strNewHTML
+ i = i-1
+ }
+ }
+ }
+ }
+window.attachEvent("onload", correctPNG);
diff --git a/template-common/scripts.js b/template-common/scripts.js
new file mode 100644
index 000000000..a96775ce4
--- /dev/null
+++ b/template-common/scripts.js
@@ -0,0 +1,79 @@
+function SelectAll( formulaire )
+{
+len = formulaire.elements.length;
+var i=0;
+for( i = 0; i < len; i++)
+{
+ if ( formulaire.elements[i].type=='checkbox'
+ && formulaire.elements[i].name != 'copie')
+ {
+ formulaire.elements[i].checked = true;
+ }
+}
+}
+
+function DeselectAll( formulaire )
+{
+len = formulaire.elements.length;
+var i=0;
+for( i = 0; i < len; i++)
+{
+ if ( formulaire.elements[i].type=='checkbox'
+ && formulaire.elements[i].name != 'copie')
+ {
+ formulaire.elements[i].checked = false;
+ }
+}
+}
+
+function Inverser( formulaire )
+{
+len = formulaire.elements.length;
+var i=0;
+for( i=0; i<len; i++)
+{
+ if ( formulaire.elements[i].type=='checkbox'
+ && formulaire.elements[i].name != 'copie')
+ {
+ formulaire.elements[i].checked = !formulaire.elements[i].checked;
+ }
+}
+}
+
+function verifieAndOpen()
+{
+ var ok=1;
+ if (!img.complete)
+ {
+ // sometime the image loading is not complete
+ // especially with KHTML and Opera
+ setTimeout("verifieAndOpen()",200)
+ }
+ else
+ {
+ /* give more space for scrollbars (10 for FF, 40 for IE) */
+ width=img.width +40;
+ height=img.height +40;
+ window.open(owURL,owName,owFeatures + ',width=' + width + ',height=' + height);
+ }
+}
+
+function phpWGOpenWindow(theURL,winName,features)
+{
+ img = new Image()
+ img.src = theURL;
+ owURL=theURL;
+ owName=winName;
+ owFeatures=features;
+ verifieAndOpen();
+}
+
+function popuphelp(url)
+{
+ window.open(
+ url,
+ 'dc_popup',
+ 'alwaysRaised=yes,dependent=yes,toolbar=no,height=420,width=500,menubar=no,resizable=yes,scrollbars=yes,status=no'
+ );
+}
+