Author: nico
Date: 2009-09-14 23:59:51 +0200 (Mon, 14 Sep 2009)
New Revision: 38623

Modified:
   
CMSContainer/trunk/CMSContainer/cmsc/richtext/src/webapp/WEB-INF/templates/layout/cmsc/richtext/lightbox.jsp
   
CMSContainer/trunk/CMSContainer/cmsc/richtext/src/webapp/lightbox/js/lightbox.js
Log:
CMSC-1521  Add lightbox to the core of the CMSc
Small IE fix

Modified: 
CMSContainer/trunk/CMSContainer/cmsc/richtext/src/webapp/WEB-INF/templates/layout/cmsc/richtext/lightbox.jsp
===================================================================
--- 
CMSContainer/trunk/CMSContainer/cmsc/richtext/src/webapp/WEB-INF/templates/layout/cmsc/richtext/lightbox.jsp
        2009-09-14 21:01:37 UTC (rev 38622)
+++ 
CMSContainer/trunk/CMSContainer/cmsc/richtext/src/webapp/WEB-INF/templates/layout/cmsc/richtext/lightbox.jsp
        2009-09-14 21:59:51 UTC (rev 38623)
@@ -1,12 +1,9 @@
-<link rel="stylesheet" href="<cmsc:staticurl 
page='/lightbox/css/lightbox.css'/>" type="text/css" media="screen" />    
+<link rel="stylesheet" href="<cmsc:staticurl 
page='/lightbox/css/lightbox.css'/>" type="text/css" media="screen" />
 <c:set var="closeImage"><fmt:message key="lightbox.closeImage"/></c:set>
 <script src="<cmsc:staticurl page='/lightbox/js/lightbox.js'/>" 
type="text/javascript"></script>
 <script type="text/javascript">
-var slideShowText3 = "<fmt:message key='lightbox.slideShow.multiple3'/>";
-document.observe('dom:loaded', function () { 
-       window.LightboxOptions.fileLoadingImage = "<cmsc:staticurl 
page='/lightbox/images/loading.gif'/>";              
-       window.LightboxOptions.fileBottomNavCloseImage = "<cmsc:staticurl 
page='${closeImage}'/>";
-       window.LightboxOptions.labelImage = "<fmt:message 
key='lightbox.slideShow.multiple1'/>";
-       window.LightboxOptions.labelOf = "<fmt:message 
key='lightbox.slideShow.multiple2'/>";
-});
-</script>
\ No newline at end of file
+  LightboxOptions.fileLoadingImage = "<cmsc:staticurl 
page='/lightbox/images/loading.gif'/>";
+  LightboxOptions.fileBottomNavCloseImage = "<cmsc:staticurl 
page='${closeImage}'/>";
+  LightboxOptions.labelImage = "<fmt:message 
key='lightbox.slideShow.multiple1'/>";
+  LightboxOptions.labelOf = "<fmt:message 
key='lightbox.slideShow.multiple2'/>";
+</script>

Modified: 
CMSContainer/trunk/CMSContainer/cmsc/richtext/src/webapp/lightbox/js/lightbox.js
===================================================================
--- 
CMSContainer/trunk/CMSContainer/cmsc/richtext/src/webapp/lightbox/js/lightbox.js
    2009-09-14 21:01:37 UTC (rev 38622)
+++ 
CMSContainer/trunk/CMSContainer/cmsc/richtext/src/webapp/lightbox/js/lightbox.js
    2009-09-14 21:59:51 UTC (rev 38623)
@@ -445,28 +445,26 @@
     //  getPageSize()
     //
     getPageSize: function() {
-               
-            var xScroll, yScroll;
-               
-               if (window.innerHeight && window.scrollMaxY) {  
-                       xScroll = window.innerWidth + window.scrollMaxX;
+               var xScroll, yScroll;
+
+               if (window.innerHeight && window.scrollMaxY) {
+                       xScroll = document.body.scrollWidth;
                        yScroll = window.innerHeight + window.scrollMaxY;
-               } else if (document.body.scrollHeight > 
document.body.offsetHeight){ // all but Explorer Mac
+               } else if (document.body.scrollHeight > 
document.body.offsetHeight) { // all but Explorer Mac
                        xScroll = document.body.scrollWidth;
                        yScroll = document.body.scrollHeight;
-               } else { // Explorer Mac...would also work in Explorer 6 
Strict, Mozilla and Safari
+               } else if (document.documentElement
+                               && document.documentElement.scrollHeight > 
document.documentElement.offsetHeight) { // Explorer 6 strict mode
+                       xScroll = document.documentElement.scrollWidth;
+                       yScroll = document.documentElement.scrollHeight;
+               } else { // Explorer Mac...would also work in Mozilla and Safari
                        xScroll = document.body.offsetWidth;
                        yScroll = document.body.offsetHeight;
                }
-               
+
                var windowWidth, windowHeight;
-               
-               if (self.innerHeight) { // all except Explorer
-                       if(document.documentElement.clientWidth){
-                               windowWidth = 
document.documentElement.clientWidth; 
-                       } else {
-                               windowWidth = self.innerWidth;
-                       }
+               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;
@@ -474,24 +472,25 @@
                } else if (document.body) { // other Explorers
                        windowWidth = document.body.clientWidth;
                        windowHeight = document.body.clientHeight;
-               }       
-               
+               }
+
                // for small pages with total height less then height of the 
viewport
-               if(yScroll < windowHeight){
+               if (yScroll < windowHeight) {
                        pageHeight = windowHeight;
-               } else { 
+               } else {
                        pageHeight = yScroll;
                }
-       
+
                // for small pages with total width less then width of the 
viewport
-               if(xScroll < windowWidth){      
-                       pageWidth = xScroll;            
-               } else {
+               if (xScroll < windowWidth) {
                        pageWidth = windowWidth;
+               } else {
+                       pageWidth = xScroll;
                }
 
-               return [pageWidth,pageHeight];
+               arrayPageSize = new Array(pageWidth, pageHeight, windowWidth, 
windowHeight)
+               return arrayPageSize;
        }
-}
+       }
 
 document.observe('dom:loaded', function () { new Lightbox(); });
\ No newline at end of file

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to