Removed hidden size element, fix for folder previews
[bizou.git] / plugins / _disabled / balanced / scripts.js
index 51eb4c6..65ef586 100644 (file)
@@ -1,12 +1,27 @@
-function applyOptimalImagesSize()\r
+/*Copyright (C) 2013  Baptiste Clement\r
+\r
+This program is free software: you can redistribute it and/or modify\r
+it under the terms of the GNU General Public License as published by\r
+the Free Software Foundation, either version 3 of the License, or\r
+(at your option) any later version.\r
+\r
+This program is distributed in the hope that it will be useful,\r
+but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+GNU General Public License for more details.\r
+\r
+You should have received a copy of the GNU General Public License\r
+along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
+*/\r
+\r
+function applyOptimalImagesSize(bestHeight)\r
 {\r
-       var divimages = document.getElementsByClassName("image");\r
+       var divimages = document.getElementsByClassName("image imagepreview");\r
        var images = new Array();\r
        for(var i = 0 ; i < divimages.length ; ++i)\r
        {\r
                images.push(divimages[i].children[0].children[0]);\r
        }\r
-       var bestHeight = parseInt(document.getElementById("thumbsize").textContent);\r
        var newHList = getOptimalHeights(images, bestHeight);\r
        for( var i = 0 ; i < images.length ; ++i)\r
        {\r
@@ -96,9 +111,6 @@ function getAllImageSizesForHeight(images, height)
        return sizes;\r
 }\r
 \r
-\r
-\r
-\r
 //Renvoi un tableau de tableau, correspondant au découpage du tableau d'entrée découpé par tranche de MAX\r
 function splitTab(tab, max)\r
 {\r