Author: sshyrkov
Date: Thu Nov 29 08:09:30 2007
New Revision: 19309

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D19309&repname=
=3Djahia
Log:
Refactored 'work in progress' overlay. Prototype.js removed from engines. I=
ntroduced a small script for registring onload events.
Known issues: 1) 'work in progress' does not work in Jahia Administration =

2) need to test it with IE7

Added:
    trunk/core/src/webapp/jsp/jahia/javascript/fastinit.js
Modified:
    trunk/core/src/webapp/jsp/jahia/administration/include/header.inc
    trunk/core/src/webapp/jsp/jahia/administration/patch_list.jsp
    trunk/core/src/webapp/jsp/jahia/administration/site_delete.jsp
    trunk/core/src/webapp/jsp/jahia/administration/site_multiple_delete.jsp
    trunk/core/src/webapp/jsp/jahia/configuration_wizard/header.inc
    trunk/core/src/webapp/jsp/jahia/css/colorsAndStyles.css
    trunk/core/src/webapp/jsp/jahia/engines/engine.jsp
    trunk/core/src/webapp/jsp/jahia/engines/shared/embedded_filemanager.jsp
    trunk/core/src/webapp/jsp/jahia/htmleditors/fckeditor/fckeditor_htmledi=
tor.jsp
    trunk/core/src/webapp/jsp/jahia/javascript/engines.js
    trunk/core/src/webapp/jsp/jahia/javascript/workinprogress.js
    trunk/core/src/webapp/views/engines/engines_default_layout.jsp
    trunk/core/src/webapp/views/engines/versioning/common-javascript.inc
    trunk/core/src/webapp/views/engines/versioning/container/common-javascr=
ipt.inc
    trunk/core/src/webapp/views/engines/versioning/pages/common-javascript.=
inc
    trunk/core/src/webapp/views/engines/versioning/revisionsdetail/revision=
sdetail.jsp

Modified: trunk/core/src/webapp/jsp/jahia/administration/include/header.inc
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/jsp/jahia/administration/include/header.inc&rev=3D19309&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/jsp/jahia/administration/include/header.inc (orig=
inal)
+++ trunk/core/src/webapp/jsp/jahia/administration/include/header.inc Thu N=
ov 29 08:09:30 2007
@@ -123,15 +123,12 @@
     <ajax:zimbraInclude/>
     <% } %>
 =

-    <script type=3D"text/javascript" src=3D"<%=3Drequest.getContextPath()%=
>/jsp/jahia/javascript/prototype/prototype-150-compressed.js"></script>
+    <script type=3D"text/javascript" src=3D"<%=3Drequest.getContextPath()%=
>/jsp/jahia/javascript/fastinit.js"></script>
     <script type=3D"text/javascript" src=3D"<%=3Drequest.getContextPath()%=
>/jsp/jahia/javascript/workinprogress.js"></script>
     <script type=3D"text/javascript">
-        jahia.config =3D {
-            contextPath: '<%=3Drequest.getContextPath()%>'
-        };
         function showWorkInProgress() {
-               if (workInProgressOverlay) {
-                   workInProgressOverlay.start();
+               if (jahia.workInProgress) {
+                   jahia.workInProgress.start();
                }
         }
     </script>

Modified: trunk/core/src/webapp/jsp/jahia/administration/patch_list.jsp
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/jsp/jahia/administration/patch_list.jsp&rev=3D19309&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/jsp/jahia/administration/patch_list.jsp (original)
+++ trunk/core/src/webapp/jsp/jahia/administration/patch_list.jsp Thu Nov 2=
9 08:09:30 2007
@@ -17,7 +17,6 @@
 --%><[EMAIL PROTECTED] file=3D"include/header.inc" %>
 <%@ taglib prefix=3D"c" uri=3D"/WEB-INF/etc/taglibs/jstl/c.tld" %>
 <%@ taglib prefix=3D"fmt" uri=3D"/WEB-INF/etc/taglibs/jstl/fmt.tld"%>
-<script src=3D"<jahia:serverHttpPath />/jsp/jahia/javascript/prototype/pro=
totype-150-compressed.js"></script>
 <script type=3D"text/javascript">
 =

     freqCall =3D 1;

Modified: trunk/core/src/webapp/jsp/jahia/administration/site_delete.jsp
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/jsp/jahia/administration/site_delete.jsp&rev=3D19309&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/jsp/jahia/administration/site_delete.jsp (origina=
l)
+++ trunk/core/src/webapp/jsp/jahia/administration/site_delete.jsp Thu Nov =
29 08:09:30 2007
@@ -30,13 +30,8 @@
         usrProviders =3D new Vector();
     }
 %>
-<script type=3D"text/javascript" src=3D"<%=3DcontextPath%>/jsp/jahia/javas=
cript/prototype/prototype-150-compressed.js"></script>
+<script type=3D"text/javascript" src=3D"<%=3DcontextPath%>/jsp/jahia/javas=
cript/fastinit.js"></script>
 <script type=3D"text/javascript" src=3D"<%=3DcontextPath%>/jsp/jahia/javas=
cript/workinprogress.js"></script>
-<script type=3D"text/javascript">
-jahia.config =3D {
-    contextPath: '<%=3DcontextPath%>'
-};
-</script>
 =

 <div id=3D"topTitle">
        <div id=3D"topTitleLogo">
@@ -137,7 +132,7 @@
       </div>
       <div class=3D"button">
         <a href=3D"#" =

-            onclick=3D"javascript:{if (workInProgressOverlay) { workInProg=
ressOverlay.launch() } else { openWorkInProgressWindow('<%=3Drequest.getCon=
textPath()%>') } document.mainForm.submit(); return false; }">
+            onclick=3D"javascript:{if (jahia.workInProgress) { jahia.workI=
nProgress.start() } else { openWorkInProgressWindow('<%=3Drequest.getContex=
tPath()%>') } document.mainForm.submit(); return false; }">
           <jahia:adminResourceBundle resourceName=3D"org.jahia.admin.delet=
e.label"/>
         </a>
       </div>

Modified: trunk/core/src/webapp/jsp/jahia/administration/site_multiple_dele=
te.jsp
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/jsp/jahia/administration/site_multiple_delete.jsp&rev=3D19309&repname=3Dja=
hia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/jsp/jahia/administration/site_multiple_delete.jsp=
 (original)
+++ trunk/core/src/webapp/jsp/jahia/administration/site_multiple_delete.jsp=
 Thu Nov 29 08:09:30 2007
@@ -29,13 +29,8 @@
         usrProviders =3D new Vector();
     }
 %>
-<script type=3D"text/javascript" src=3D"<%=3DcontextPath%>/jsp/jahia/javas=
cript/prototype/prototype-150-compressed.js"></script>
+<script type=3D"text/javascript" src=3D"<%=3DcontextPath%>/jsp/jahia/javas=
cript/fastinit.js"></script>
 <script type=3D"text/javascript" src=3D"<%=3DcontextPath%>/jsp/jahia/javas=
cript/workinprogress.js"></script>
-<script type=3D"text/javascript">
-jahia.config =3D {
-    contextPath: '<%=3DcontextPath%>'
-};
-</script>
 =

 <div id=3D"topTitle">
     <div id=3D"topTitleLogo">
@@ -158,7 +153,7 @@
 =

     <div class=3D"button">
         <a href=3D"#"
-           onclick=3D"javascript:{if (workInProgressOverlay) { workInProgr=
essOverlay.launch() } else { openWorkInProgressWindow('<%=3Drequest.getCont=
extPath()%>') } document.mainForm.submit(); return false; }">
+           onclick=3D"javascript:{if (jahia.workInProgress) { jahia.workIn=
Progress.start(); } else { openWorkInProgressWindow('<%=3Drequest.getContex=
tPath()%>') } document.mainForm.submit(); return false; }">
             <jahia:adminResourceBundle resourceName=3D"org.jahia.admin.del=
ete.label"/>
         </a>
     </div>

Modified: trunk/core/src/webapp/jsp/jahia/configuration_wizard/header.inc
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/jsp/jahia/configuration_wizard/header.inc&rev=3D19309&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/jsp/jahia/configuration_wizard/header.inc (origin=
al)
+++ trunk/core/src/webapp/jsp/jahia/configuration_wizard/header.inc Thu Nov=
 29 08:09:30 2007
@@ -54,12 +54,9 @@
     <link rel=3D"stylesheet" href=3D"<%=3Durl%>/configuration_wizard/css/s=
tyles.css" type=3D"text/css"/>
     <link rel=3D"stylesheet" href=3D"<%=3Durl%>/css/colorsAndStyles.css" t=
ype=3D"text/css"/>
     <script type=3D"text/javascript" src=3D"<%=3Durl%>/javascript/jahia.js=
" ></script>
-       <script type=3D"text/javascript" 
src=3D"<%=3Drequest.getContextPath()%>/j=
sp/jahia/javascript/prototype/prototype-150-compressed.js"></script>
+       <script type=3D"text/javascript" 
src=3D"<%=3Drequest.getContextPath()%>/j=
sp/jahia/javascript/fastinit.js"></script>
        <script type=3D"text/javascript" 
src=3D"<%=3Drequest.getContextPath()%>/j=
sp/jahia/javascript/workinprogress.js"></script>
     <script type=3D"text/javascript">
-           jahia.config =3D {
-               contextPath: '<%=3Drequest.getContextPath()%>'
-           };
         function focus() {
             document.body.style.cursor =3D "default";
         <% if (!focus.equals("-none-")){ %>
@@ -102,8 +99,8 @@
         <% } %>
 =

         function setWaitingCursor() {
-            if (workInProgressOverlay) {
-                workInProgressOverlay.launch();
+            if (jahia.workInProgress) {
+                jahia.workInProgress.start();
             } else {
                    document.body.style.cursor =3D "wait";
                    openWorkInProgressWindow('<%=3Drequest.getContextPath()%>');

Modified: trunk/core/src/webapp/jsp/jahia/css/colorsAndStyles.css
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/jsp/jahia/css/colorsAndStyles.css&rev=3D19309&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/jsp/jahia/css/colorsAndStyles.css (original)
+++ trunk/core/src/webapp/jsp/jahia/css/colorsAndStyles.css Thu Nov 29 08:0=
9:30 2007
@@ -705,21 +705,24 @@
 =

 .simpleTextEditorButton {font-size:smaller;padding:2px 2px;border: 1px bla=
ck solid;}
 #workInProgressOverlay {
-    display:none;
-    position: absolute; top: 0; left: 0;
-    width: 100%; height: 100%;
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
     z-index: 5019;
-    background-color:white;
+    background-color: white;
     -moz-opacity: 0.7;
-    opacity:.70;
-    filter: alpha(opacity=3D70);
-}
-#workInProgressOverlay[id]{
-    position:fixed;
-}
-#workInProgressOverlay img {
-  position: absolute;
-  top: 50%; left: 50%;
-  width: 66px; height: 66px;
-  margin-left: -33px; margin-top: -33px;
+    opacity: .70;
+    filter: alpha(opacity =3D 70);
 }
+#workInProgressOverlayImg {
+    background: url('../engines/images/waiting_large.gif') 50% 50% no-repe=
at;
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    width: 66px;
+    height: 66px;
+    margin-left: -33px;
+    margin-top: -33px;
+}
\ No newline at end of file

Modified: trunk/core/src/webapp/jsp/jahia/engines/engine.jsp
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/jsp/jahia/engines/engine.jsp&rev=3D19309&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/jsp/jahia/engines/engine.jsp (original)
+++ trunk/core/src/webapp/jsp/jahia/engines/engine.jsp Thu Nov 29 08:09:30 =
2007
@@ -182,7 +182,7 @@
 <% } %>
 =

 <script type=3D"text/javascript" src=3D"<%=3DURL%>../javascript/serverdate=
time.js"></script>
-<script type=3D"text/javascript" src=3D"<%=3DURL%>../javascript/prototype/=
prototype-150-compressed.js"></script>
+<script type=3D"text/javascript" src=3D"<%=3DURL%>../javascript/fastinit.j=
s"></script>
 <script type=3D"text/javascript" src=3D"<%=3DURL%>../javascript/engines.js=
"></script>
 <script type=3D"text/javascript" src=3D"<%=3DURL%>../javascript/workinprog=
ress.js"></script>
 <script type=3D"text/javascript">

Modified: trunk/core/src/webapp/jsp/jahia/engines/shared/embedded_filemanag=
er.jsp
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/jsp/jahia/engines/shared/embedded_filemanager.jsp&rev=3D19309&repname=3Dja=
hia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/jsp/jahia/engines/shared/embedded_filemanager.jsp=
 (original)
+++ trunk/core/src/webapp/jsp/jahia/engines/shared/embedded_filemanager.jsp=
 Thu Nov 29 08:09:30 2007
@@ -531,7 +531,7 @@
                                 "border=3D'0' src=3D'<jahia:serverHttpPath=
/>/jsp/jahia/engines/images/filemanager/selectFile_disabled.gif' width=3D'2=
4'height=3D'24'/>";
         }
         element =3D document.getElementById("unselectFile");
-        if ($F('selectedFileName') && $F('selectedFileName').length > 0) {
+        if (document.getElementById('selectedFileName') && document.getEle=
mentById('selectedFileName').value.length > 0) {
             element.innerHTML =3D "<a href=3D\"javascript:go('selectFileEm=
pty', true);\"><img " +
                                 "onmouseover=3D'this.src =3D \"<jahia:serv=
erHttpPath/>/jsp/jahia/engines/images/filemanager/unselectFile_hover.gif\"'=
" +
                                 "onmouseout=3D'this.src =3D \"<jahia:serve=
rHttpPath/>/jsp/jahia/engines/images/filemanager/unselectFile.gif\"'" +
@@ -550,14 +550,14 @@
 }
 =

        function checkSelectFileLink() {
-       if ($F('selectedFileName') && $F('selectedFileName').length > 0) {
-           $('selectFileLink').show();
+       if (document.getElementById('selectedFileName') && document.getElem=
entById('selectedFileName').value.length > 0) {
+           document.getElementById('selectFileLink').style.display =3D '';
        } else {
-           $('selectFileLink').hide();
+           document.getElementById('selectFileLink').style.display =3D 'no=
ne';
        }
        updateMenuBar();
        }
-    Event.observe(window, 'load', checkSelectFileLink);
+    FastInit.addOnLoad(checkSelectFileLink);
     //-->
 </script>
 =


Modified: trunk/core/src/webapp/jsp/jahia/htmleditors/fckeditor/fckeditor_h=
tmleditor.jsp
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/jsp/jahia/htmleditors/fckeditor/fckeditor_htmleditor.jsp&rev=3D19309&repna=
me=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/jsp/jahia/htmleditors/fckeditor/fckeditor_htmledi=
tor.jsp (original)
+++ trunk/core/src/webapp/jsp/jahia/htmleditors/fckeditor/fckeditor_htmledi=
tor.jsp Thu Nov 29 08:09:30 2007
@@ -143,8 +143,8 @@
 <script type=3D"text/javascript">
   function FCKeditor_OnComplete(editorInstance) {
       window.status =3D editorInstance.Description;
-      if (workInProgressOverlay) {
-        workInProgressOverlay.stop();
+      if (jahia.workInProgress) {
+        jahia.workInProgress.stop();
       }
   }
 </script>

Modified: trunk/core/src/webapp/jsp/jahia/javascript/engines.js
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/jsp/jahia/javascript/engines.js&rev=3D19309&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/jsp/jahia/javascript/engines.js (original)
+++ trunk/core/src/webapp/jsp/jahia/javascript/engines.js Thu Nov 29 08:09:=
30 2007
@@ -106,8 +106,8 @@
 }
 =

 function setWaitingCursor(showWaitingImage) {
-    if (workInProgressOverlay) {
-        workInProgressOverlay.launch();
+    if (jahia.workInProgress) {
+        jahia.workInProgress.start();
     } else {
         if (document.body.style.cursor =3D=3D "wait") return;
         document.body.style.cursor =3D "wait";
@@ -243,7 +243,4 @@
         window.opener.location.reload(true);
     }
 }
-
-Event.observe(window, 'load', handleOnLoad);
-// break protype memory leaks for all browsers (not only ie)
-Event.observe(window, 'unload', Event.unloadCache);
\ No newline at end of file
+FastInit.addOnLoad(handleOnLoad);
\ No newline at end of file

Added: trunk/core/src/webapp/jsp/jahia/javascript/fastinit.js
URL: https://svndev.jahia.net/websvn/filedetails.php?path=3D/trunk/core/src=
/webapp/jsp/jahia/javascript/fastinit.js&rev=3D19309&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/jsp/jahia/javascript/fastinit.js (added)
+++ trunk/core/src/webapp/jsp/jahia/javascript/fastinit.js Thu Nov 29 08:09=
:30 2007
@@ -0,0 +1,84 @@
+/*
+*
+* Copyright (c) 2007 Andrew Tetlaw
+* =

+* Permission is hereby granted, free of charge, to any person
+* obtaining a copy of this software and associated documentation
+* files (the "Software"), to deal in the Software without
+* restriction, including without limitation the rights to use, copy,
+* modify, merge, publish, distribute, sublicense, and/or sell copies
+* of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+* =

+* The above copyright notice and this permission notice shall be
+* included in all copies or substantial portions of the Software.
+* =

+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+* * =

+*
+*
+* FastInit
+* http://tetlaw.id.au/view/javascript/fastinit
+* Andrew Tetlaw
+* Version 1.4.1 (2007-03-15)
+* Based on:
+* http://dean.edwards.name/weblog/2006/03/faster
+* http://dean.edwards.name/weblog/2006/06/again/
+* Help from:
+* http://www.cherny.com/webdev/26/domloaded-object-literal-updated
+* =

+*/
+var FastInit =3D {
+       onload : function() {
+               if (FastInit.done) { return; }
+               FastInit.done =3D true;
+               for(var x =3D 0, al =3D FastInit.f.length; x < al; x++) {
+                       FastInit.f[x]();
+               }
+       },
+       addOnLoad : function() {
+               var a =3D arguments;
+               for(var x =3D 0, al =3D a.length; x < al; x++) {
+                       if(typeof a[x] =3D=3D=3D 'function') {
+                               if (FastInit.done ) {
+                                       a[x]();
+                               } else {
+                                       FastInit.f.push(a[x]);
+                               }
+                       }
+               }
+       },
+       listen : function() {
+               if (/WebKit|khtml/i.test(navigator.userAgent)) {
+                       FastInit.timer =3D setInterval(function() {
+                               if 
(/loaded|complete/.test(document.readyState)) {
+                                       clearInterval(FastInit.timer);
+                                       delete FastInit.timer;
+                                       FastInit.onload();
+                               }}, 10);
+               } else if (document.addEventListener) {
+                       document.addEventListener('DOMContentLoaded', 
FastInit.onload, false);
+               } else if(!FastInit.iew32) {
+                       if(window.addEventListener) {
+                               window.addEventListener('load', 
FastInit.onload, false);
+                       } else if (window.attachEvent) {
+                               return window.attachEvent('onload', 
FastInit.onload);
+                       }
+               }
+       },
+       f:[],done:false,timer:null,iew32:false
+};
+/[EMAIL PROTECTED] @*/
+/[EMAIL PROTECTED] (@_win32)
+FastInit.iew32 =3D true;
+document.write('<script id=3D"__ie_onload" defer src=3D"' + ((location.pro=
tocol =3D=3D 'https:') ? '//0' : 'javascript:void(0)') + '"><\/script>');
+document.getElementById('__ie_onload').onreadystatechange =3D function(){i=
f (this.readyState =3D=3D 'complete') { FastInit.onload(); }};
+/[EMAIL PROTECTED] @*/
+FastInit.listen();

Modified: trunk/core/src/webapp/jsp/jahia/javascript/workinprogress.js
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/jsp/jahia/javascript/workinprogress.js&rev=3D19309&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/jsp/jahia/javascript/workinprogress.js (original)
+++ trunk/core/src/webapp/jsp/jahia/javascript/workinprogress.js Thu Nov 29=
 08:09:30 2007
@@ -2,89 +2,45 @@
     var jahia =3D new Object();
     jahia.config =3D new Object();
 }
-
-var workInProgressOverlay;
-Event.observe(window, 'load', function () {
-    workInProgressOverlay =3D new WorkInProgressLoader();
-    if (typeof saveContent !=3D 'undefined' && (typeof saveContent =3D=3D =
'function')) {
-      var oldSaveContent =3D saveContent;
-      saveContent =3D function () {
-        workInProgressOverlay.launch();
-        oldSaveContent();
-      };
-    }
-    if (jahia.config.startWorkInProgressOnLoad) {
-        workInProgressOverlay.launch();
-    }
-});
-Event.observe(window, 'unload', Event.unloadCache);
-/*
- Greys out the dialog window displaying 'Loading...' icon.
- Requires: Prototype 1.5.0+
- @author Sergiy Shyrkov
- IE fix was taken from the 'lightbox gone wild' implementation found at ht=
tp://particletree.com/features/lightbox-gone-wild/
-*/ =

-var WorkInProgressLoader =3D Class.create();
-
-WorkInProgressLoader.prototype =3D {
-    initialize: function () {
-        this.isIE =3D navigator.appVersion.match(/\bMSIE\b/);
-        this.webContext =3D jahia.config.contextPath;
-       this._createMarkup();
-    },
-    launch: function() {
-        if (this.isIE){
-            this._prepareIE('100%', 'hidden');
-               window.scrollTo(0, 0);
-               
$A(document.getElementsByTagName('select')).map(Element.extend).i=
nvoke('hide');
-               var imgLoading =3D document.createElement('img');
-               imgLoading.src =3D this.webContext + 
'/jsp/jahia/engines/images/w=
aiting_large.gif';
-               imgLoading.alt =3D 'Loading...';
-               imgLoading.title =3D 'Loading...';
-               $('workInProgressOverlay').appendChild(imgLoading);
-            imgLoading =3D null;
-        }
-        $('workInProgressOverlay').style.display =3D 'block';
-    },
-    start: function() {
-        this.launch();
-    },
-    stop: function() {
-        if ($('workInProgressOverlay').style.display =3D=3D 'block') {
-            $('workInProgressOverlay').style.display =3D 'none';
+jahia.workInProgress =3D {
+    init: function () {
+           var bod =3D document.getElementsByTagName('body')[0];
+           var overlay =3D document.createElement('div');
+           overlay.id =3D 'workInProgressOverlay';
+           overlay.style.display =3D 'none';
+           var loadingDiv =3D document.createElement('div');
+           loadingDiv.id =3D 'workInProgressOverlayImg';
+           overlay.appendChild(loadingDiv);
+           bod.appendChild(overlay);
+           =

+           if (typeof saveContent !=3D 'undefined' && (typeof saveContent 
=3D=3D=
 'function')) {
+             oldSaveContent =3D saveContent;
+             saveContent =3D function () {
+               jahia.workInProgress.start();
+               oldSaveContent();
+             };
+           }
+           if (jahia.config.startWorkInProgressOnLoad) {
+               jahia.workInProgress.start();
+           }
+           loadingDiv =3D null;
+           overlay =3D null;
+           bod =3D null;
+       },
+       start: function () {
+           this._toggleSelectElements(false);
+           document.getElementById('workInProgressOverlay').style.display =3D 
'';
+       },
+       stop: function () {
+           this._toggleSelectElements(true);
+           document.getElementById('workInProgressOverlay').style.display =3D 
'n=
one';
+       },
+    _toggleSelectElements: function(isVisible) {
+        var selects =3D document.getElementsByTagName('select');
+        for (var i =3D 0; i < selects.length; i++) {
+            selects[i].style.visibility =3D isVisible ? 'visible' : 'hidde=
n';
         }
-    },
-
-    _createMarkup: function() {
-       var bod =3D document.getElementsByTagName('body')[0];
-        var overlay =3D document.createElement('div');
-        overlay.id =3D 'workInProgressOverlay';
-        if (!this.isIE){
-            var imgLoading =3D document.createElement('img');
-            imgLoading.src =3D this.webContext + '/jsp/jahia/engines/image=
s/waiting_large.gif';
-            imgLoading.alt =3D 'Loading...';
-            imgLoading.title =3D 'Loading...';
-            overlay.appendChild(imgLoading);
-            imgLoading =3D null;
-        }
-        bod.appendChild(overlay);
-
-        // avoid mem leak
-        bod =3D null;
-        overlay =3D null;
-    },
-     =

-    _prepareIE: function(height, overflow) {
-        var bod =3D document.getElementsByTagName('body')[0];
-        bod.style.height =3D height;
-        bod.style.overflow =3D overflow;
-  =

-        var htm =3D document.getElementsByTagName('html')[0];
-        htm.style.height =3D height;
-        htm.style.overflow =3D overflow;
-
-        // avoid mem leak
-        bod =3D null;
-        htm =3D null;
+        selects =3D null;
     }
-}
\ No newline at end of file
+}
+FastInit.addOnLoad(jahia.workInProgress.init);
\ No newline at end of file

Modified: trunk/core/src/webapp/views/engines/engines_default_layout.jsp
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/views/engines/engines_default_layout.jsp&rev=3D19309&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/views/engines/engines_default_layout.jsp (origina=
l)
+++ trunk/core/src/webapp/views/engines/engines_default_layout.jsp Thu Nov =
29 08:09:30 2007
@@ -104,19 +104,14 @@
 }
 //-->
 </script>
-<script type=3D"text/javascript" src=3D"<%=3DURL%>../javascript/prototype/=
prototype-150-compressed.js"></script>
+<script type=3D"text/javascript" src=3D"<%=3DURL%>../javascript/fastinit.j=
s"></script>
 <script type=3D"text/javascript" src=3D"<%=3Drequest.getContextPath()%>/js=
p/jahia/javascript/workinprogress.js"></script>
 <script type=3D"text/javascript">
-jahia.config =3D {
-    contextPath: '<%=3Drequest.getContextPath()%>'
-};
-</script>
-<script type=3D"text/javascript">
 <!--
 var submittedCount =3D 0;
 =

 function teleportCaptainFlam(what) {
-    workInProgressOverlay.launch();
+    if (jahia.workInProgress) jahia.workInProgress.start();
     if (submittedCount =3D=3D 0) {
         submittedCount++;
         document.mainForm.submit();
@@ -191,7 +186,7 @@
 }
 =

 function sendForm(method, params) {
-    workInProgressOverlay.launch();
+    if (jahia.workInProgress) jahia.workInProgress.start();
     document.mainForm.method.value =3D method;
     document.mainForm.screen.value =3D "<%=3DtheScreen%>";
     document.mainForm.engineview.value =3D "<%=3DengineView%>";

Modified: trunk/core/src/webapp/views/engines/versioning/common-javascript.=
inc
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/views/engines/versioning/common-javascript.inc&rev=3D19309&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/views/engines/versioning/common-javascript.inc (o=
riginal)
+++ trunk/core/src/webapp/views/engines/versioning/common-javascript.inc Th=
u Nov 29 08:09:30 2007
@@ -40,7 +40,7 @@
 }    =

 =

 function sendForm(method, params) {
-    workInProgressOverlay.launch();
+    if (jahia.workInProgress) jahia.workInProgress.start();
     document.mainForm.method.value =3D method;
     document.mainForm.action =3D "<%=3DactionURL%>";
     document.mainForm.screen.value =3D "<%=3DtheScreen%>";

Modified: trunk/core/src/webapp/views/engines/versioning/container/common-j=
avascript.inc
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/views/engines/versioning/container/common-javascript.inc&rev=3D19309&repna=
me=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/views/engines/versioning/container/common-javascr=
ipt.inc (original)
+++ trunk/core/src/webapp/views/engines/versioning/container/common-javascr=
ipt.inc Thu Nov 29 08:09:30 2007
@@ -41,7 +41,7 @@
 }    =

 =

 function sendForm(method, params) {
-    workInProgressOverlay.launch();
+    if (jahia.workInProgress) jahia.workInProgress.start();
     document.mainForm.method.value =3D method;
     document.mainForm.action =3D "<%=3DactionURL%>";
     document.mainForm.screen.value =3D "<%=3DtheScreen%>";

Modified: trunk/core/src/webapp/views/engines/versioning/pages/common-javas=
cript.inc
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/views/engines/versioning/pages/common-javascript.inc&rev=3D19309&repname=
=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/views/engines/versioning/pages/common-javascript.=
inc (original)
+++ trunk/core/src/webapp/views/engines/versioning/pages/common-javascript.=
inc Thu Nov 29 08:09:30 2007
@@ -41,7 +41,7 @@
 }   =

 =

 function sendForm(method, params) {
-    workInProgressOverlay.launch();
+    if (jahia.workInProgress) jahia.workInProgress.start();
     document.mainForm.method.value =3D method;
     document.mainForm.action =3D "<%=3DactionURL%>";
     document.mainForm.screen.value =3D "<%=3DtheScreen%>";

Modified: trunk/core/src/webapp/views/engines/versioning/revisionsdetail/re=
visionsdetail.jsp
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/views/engines/versioning/revisionsdetail/revisionsdetail.jsp&rev=3D19309&r=
epname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/views/engines/versioning/revisionsdetail/revision=
sdetail.jsp (original)
+++ trunk/core/src/webapp/views/engines/versioning/revisionsdetail/revision=
sdetail.jsp Thu Nov 29 08:09:30 2007
@@ -95,7 +95,7 @@
 =

 function sendForm(method,params)
 {
-    workInProgressOverlay.launch();
+    if (jahia.workInProgress) jahia.workInProgress.start();
     document.mainForm.method.value =3D "POST";
     document.mainForm.action =3D "<%=3DactionURL%>&engineview=3D<%=3Dengin=
eView%>&method=3D" + method;
     if ( params.charAt(0) =3D=3D "&" ){

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to