Author: brushed
Date: Wed Sep  3 12:20:59 2008
New Revision: 691738

URL: http://svn.apache.org/viewvc?rev=691738&view=rev
Log:
v2.7.0-alpha-37       
        * [JSPWIKI-369] SneakPreview was broken when no SectionEdit was turned 
off.
        * [JSPWIKI-370] Remove 'vertical-align' css rule to prevent printing 
errors,
        * Few small fixes on the Accordion style.

Modified:
    incubator/jspwiki/trunk/ChangeLog
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/Release.java
    incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-commonstyles.js
    incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-edit.js
    incubator/jspwiki/trunk/src/webdocs/templates/default/InfoContent.jsp
    incubator/jspwiki/trunk/src/webdocs/templates/default/editors/FCK.jsp
    incubator/jspwiki/trunk/src/webdocs/templates/default/editors/plain.jsp
    incubator/jspwiki/trunk/src/webdocs/templates/default/jspwiki.css

Modified: incubator/jspwiki/trunk/ChangeLog
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=691738&r1=691737&r2=691738&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Wed Sep  3 12:20:59 2008
@@ -1,3 +1,15 @@
+2008-09-03 Dirk Frederickx <[EMAIL PROTECTED]>
+
+        * 2.7.0-alpha-37
+        
+        * [JSPWIKI-369] SneakPreview was broken when no SectionEdit was turned 
off.
+
+        * [JSPWIKI-370] Remove 'vertical-align' css rule to prevent printing 
errors,
+        as reported by Terry Steichen.
+        
+        * Few small fixes on the Accordion style.
+
+ 
 2008-09-02  Juan Pablo Santos <[EMAIL PROTECTED]>
 
         * Updated spanish translation (CoreResources_es + default_es 
properties)

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/Release.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/Release.java?rev=691738&r1=691737&r2=691738&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/Release.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/Release.java Wed Sep  3 
12:20:59 2008
@@ -77,7 +77,7 @@
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "36";
+    public static final String     BUILD         = "37";
     
     /**
      *  This is the generic version string you should use

Modified: incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-commonstyles.js
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-commonstyles.js?rev=691738&r1=691737&r2=691738&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-commonstyles.js 
(original)
+++ incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-commonstyles.js Wed Sep 
 3 12:20:59 2008
@@ -133,13 +133,13 @@
                        
                        var toggles=[], contents=[], menu=false;
                        if(tt.hasClass('tabbedAccordion')){
-                               menu = new 
Element('div',{'class':'menu'}).injectBefore(tt);
+                               menu = new Element('div',{'class':'menu 
top'}).injectBefore(tt);
                        }
                        else if(tt.hasClass('leftAccordion')){
-                               menu = new Element('div',{'class':'sidemenu 
left'}).injectBefore(tt);
+                               menu = new Element('div',{'class':'menu 
left'}).injectBefore(tt);
                        }
                        else if(tt.hasClass('rightAccordion')){
-                               menu = new Element('div',{'class':'sidemenu 
right'}).injectBefore(tt);
+                               menu = new Element('div',{'class':'menu 
right'}).injectBefore(tt);
                        }
                        
                        tt.getChildren().each(function(tab) {
@@ -178,7 +178,7 @@
                                } 
                        });
                });
-               bullet=toggle=null;
+               bullet=toggle=null; //avoid memory leaks
        }
 }
 Wiki.addPageRender(WikiAccordion);

Modified: incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-edit.js
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-edit.js?rev=691738&r1=691737&r2=691738&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-edit.js (original)
+++ incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-edit.js Wed Sep  3 
12:20:59 2008
@@ -171,16 +171,14 @@
                        if(ta.value != ta.defaultValue) return 
"edit.areyousure".localize();
                }).bind(this);
 
-               //alert($('scroll').getValue());
-
                this.wikisnippets = WikiSnippets.getSnippets();
                this.wikismartpairs = WikiSnippets.getSmartPairs();
 
                this.mainarea = this.textarea = $('editorarea'); 
                if(!this.textarea || !this.textarea.visible) return;
 
-               /* modifies this.textarea */
-               this.onPageLoadSectionToc( );
+               /* may insert a new this.textarea */
+               this.onPageLoadSectionEdit( );
 
                //this.ta = new TextArea( this.textarea );
                this.ta = TextArea.initialize( this.textarea ); //FIXME
@@ -192,8 +190,9 @@
                this.onPageLoadPreview();
 
                this.textarea
-                       .addEvent('click',this.getSuggestions.bind(this))
-                       .addEvent('keyup',this.getSuggestions.bind(this))
+                       .addEvent('click', this.getSuggestions.bind(this))
+                       .addEvent('keyup', this.getSuggestions.bind(this))
+                       .addEvent('change', this.onChangeTextarea.bind(this))
                        .focus();
        },
 
@@ -447,7 +446,7 @@
                        } /* endif */
                });
        },
-       
+
        onPageLoadPreview : function(){
                if( $$('#sneakpreview','#autopreview').length != 2) return;
                $('autopreview')
@@ -487,7 +486,7 @@
                }).request();
        },
 
-       onPageLoadSectionToc : function( ){
+       onPageLoadSectionEdit : function( ){
 
                /* section editing is only valid for edit context, not valid in 
the comment context */
                if( (Wiki.Context!='edit') 
@@ -504,31 +503,30 @@
                
                var tt = new Element('div',{'id':'toctoc'}).adopt(
                        new 
Element('label').setHTML('sectionediting.label'.localize()),
-                       this.selector = new Element('ul')
+                       this.sections = new Element('ul')
                ).injectTop($('favorites'))
 
-               /* initialise the section selectors */
-               this.onSelectorLoad();
+               /* initialise the section sections */
+               this.onSectionLoad();
     
                var cursor = location.search.match(/[&?]section=(\d+)/);
                cursor = (cursor && cursor[1]) ? 1+cursor[1].toInt() : 0;
                if((cursor>0) && this.textarea.sop) cursor++;
 
                /* initialise the selected section */
-               this.onChangeSelector(cursor);
+               this.onChangeSection(cursor);
 
-               this.textarea.addEvent('change', 
this.onChangeTextarea.bind(this));             
        },      
        
        /* 
-        * UPDATE/RFEFRESH the section selector dropdown
+        * UPDATE/RFEFRESH the section dropdown
         * This function is called at startup, and everytime the section 
textarea changes
-        * Postcondition: the sectiontoc dropdown contains following entries
+        * Postcondition: the section-edit dropdown contains following entries
         *   0. ( all )
         *   1. start-of-page (if applicable)
-        *   2. text==<<header 1...n>> , <<selector.offset stores start-offset 
in main textarea>>
+        *   2. text==<<header 1...n>> , <<sections.offset stores start-offset 
in main textarea>>
         */  
-        onSelectorLoad : function(){
+        onSectionLoad : function(){
                var mainarea = this.mainarea.value,
                        ta = this.textarea,
                        DELIM = "\u00a4";
@@ -540,9 +538,9 @@
 
                var tt = mainarea.replace( /^([!]{1,3})/mg, DELIM+"$1"+DELIM 
).split(DELIM);
                
-               this.newSelector();
+               this.newSection();
                ta.sop = (tt.length>1) && (tt[0] != ''); //start of page 
section has no !!!header 
-               if(ta.sop) this.addSelector("edit.startOfPage".localize(), 0, 
0);
+               if(ta.sop) this.addSection("edit.startOfPage".localize(), 0, 0);
                
                var pos = tt.shift().length,
                        ttlen = tt.map(function(i){ return i.length });
@@ -552,29 +550,29 @@
                                indent = (hlen==2) ? 1 : (hlen==1) ? 2 : 0,
                                title = tt[i+1].match(/.*?$/m)[0]; //title is 
first line only
 
-                       this.addSelector(title, pos, indent);
+                       this.addSection(title, pos, indent);
                        pos += hlen + ttlen[i+1];
                };
        },
 
-       setSelector: function( cursor ){
-               var els = this.selector.getChildren();
+       setSection: function( cursor ){
+               var els = this.sections.getChildren();
                
                if(cursor <0 || cursor >= els.length) cursor = 0;
                els.removeClass('cursor');
                els[cursor].addClass('cursor');
        },
 
-       newSelector: function(){
-               this.selector.empty();
-               this.selector.offsets = [];
-               this.addSelector("edit.allsections".localize(),-1,0);
+       newSection: function(){
+               this.sections.empty();
+               this.sections.offsets = [];
+               this.addSection("edit.allsections".localize(),-1,0);
        },
 
-       addSelector: function(text,offset,indent){
+       addSection: function(text,offset,indent){
                text = text.replace(/~([^~])/g, '$1'); /*remove wiki-markup 
escape chars ~ */
-               this.selector.offsets.push(offset);
-               this.selector.adopt( 
+               this.sections.offsets.push(offset);
+               this.sections.adopt( 
                        new Element('li').adopt(
                                new Element('a',{
                                        'class':'action',
@@ -583,22 +581,22 @@
                                        },
                                        'title':text,
                                        'events':{
-                                               
'click':this.onChangeSelector.pass([this.selector.offsets.length-1],this) 
+                                               
'click':this.onChangeSection.pass([this.sections.offsets.length-1],this) 
                                        }
                                }).setHTML(text.trunc(30))
                        ) 
                );      
        },
 
-       /* the USER clicks a new item from the section selector dropdown
+       /* the USER clicks a new item from the section dropdown
         * copy a part of the main textarea to the section textarea
         */
-       onChangeSelector: function(cursor){
-               var se = this.selector.offsets, 
+       onChangeSection: function(cursor){
+               var se = this.sections.offsets, 
                        ta = this.textarea, 
                        ma = this.mainarea.value;
 
-               this.setSelector(cursor);
+               this.setSection(cursor);
                ta.cursor = cursor;
                ta.begin = (cursor==0) ? 0 : se[cursor];
                ta.end = ((cursor==0) || (cursor+1 >= se.length)) ? ma.length : 
se[cursor+1]; 
@@ -614,18 +612,20 @@
         *  (ii) user clicks a toolbar-button
         *  
         * 1) copy section textarea at the right offset of the main textarea
-        * 2) refresh the sectiontoc menu
+        * 2) refresh the section-edit menu
         */
        onChangeTextarea : function(){
                var     ta = this.textarea,     ma = this.mainarea;
 
-               var     s = ta.value;
-               if( s.lastIndexOf("\n") + 1 != s.length ) ta.value += '\n';
-                
-               s = ma.value;
-               ma.value = s.substring(0, ta.begin) + ta.value + 
s.substring(ta.end);
-               ta.end = ta.begin + ta.value.length;
-               this.onSelectorLoad();  //refresh selectortoc menu
+               if( this.sections ){
+                       var     s = ta.value;
+                       if( s.lastIndexOf("\n") + 1 != s.length ) ta.value += 
'\n';
+
+                       s = ma.value;
+                       ma.value = s.substring(0, ta.begin) + ta.value + 
s.substring(ta.end);
+                       ta.end = ta.begin + ta.value.length;
+                       this.onSectionLoad();  //refresh section-edit menu
+               }               
                ta.fireEvent('preview');
         }
 } 

Modified: incubator/jspwiki/trunk/src/webdocs/templates/default/InfoContent.jsp
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/templates/default/InfoContent.jsp?rev=691738&r1=691737&r2=691738&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/templates/default/InfoContent.jsp 
(original)
+++ incubator/jspwiki/trunk/src/webdocs/templates/default/InfoContent.jsp Wed 
Sep  3 12:20:59 2008
@@ -28,15 +28,15 @@
   {
     creationAuthor = firstPage.getAuthor();
 
-        if( creationAuthor != null && creationAuthor.length() > 0 )
-        {
-            creationAuthor = TextUtil.replaceEntities(creationAuthor);
-         }
-        else
-        {
-            creationAuthor = c.getBundle( 
InternationalizationManager.CORE_BUNDLE ).getString( "common.unknownauthor" );
-        }
-   }
+    if( creationAuthor != null && creationAuthor.length() > 0 )
+    {
+      creationAuthor = TextUtil.replaceEntities(creationAuthor);
+    }
+    else
+    {
+      creationAuthor = c.getBundle( InternationalizationManager.CORE_BUNDLE 
).getString( "common.unknownauthor" );
+    }
+  }
 
   int itemcount = 0;  //number of page versions
   try

Modified: incubator/jspwiki/trunk/src/webdocs/templates/default/editors/FCK.jsp
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/templates/default/editors/FCK.jsp?rev=691738&r1=691737&r2=691738&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/templates/default/editors/FCK.jsp 
(original)
+++ incubator/jspwiki/trunk/src/webdocs/templates/default/editors/FCK.jsp Wed 
Sep  3 12:20:59 2008
@@ -119,12 +119,10 @@
   <div class="error"><fmt:message key="editor.fck.noscript" /></div>
 </noscript>
 
-   <wiki:CheckRequestContext context="edit|comment">
-    <p>
-    <label for="changenote"><fmt:message 
key='editor.plain.changenote'/></label>
-    <input type="text" id="changenote" name="changenote" size="80" 
maxlength="80" value="<c:out value='${changenote}'/>"/>
-    </p>
-   </wiki:CheckRequestContext>
+   <p>
+     <label for="changenote"><fmt:message 
key='editor.plain.changenote'/></label>
+     <input type="text" id="changenote" name="changenote" size="80" 
maxlength="80" value="<c:out value='${changenote}'/>"/>
+   </p>
    <wiki:CheckRequestContext context="comment">
     <fieldset>
        <legend><fmt:message key="editor.commentsignature"/></legend>
@@ -143,9 +141,9 @@
   </wiki:CheckRequestContext>
 
   <p>
-        <input name='ok' type='submit' value='<fmt:message 
key="editor.plain.save.submit"/>' />
-        <input name='preview' type='submit' value='<fmt:message 
key="editor.plain.preview.submit"/>' />
-        <input name='cancel' type='submit' value='<fmt:message 
key="editor.plain.cancel.submit"/>' />
+    <input name='ok' type='submit' value='<fmt:message 
key="editor.plain.save.submit"/>' />
+    <input name='preview' type='submit' value='<fmt:message 
key="editor.plain.preview.submit"/>' />
+    <input name='cancel' type='submit' value='<fmt:message 
key="editor.plain.cancel.submit"/>' />
   </p>
 </div>
 </form>

Modified: 
incubator/jspwiki/trunk/src/webdocs/templates/default/editors/plain.jsp
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/templates/default/editors/plain.jsp?rev=691738&r1=691737&r2=691738&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/templates/default/editors/plain.jsp 
(original)
+++ incubator/jspwiki/trunk/src/webdocs/templates/default/editors/plain.jsp Wed 
Sep  3 12:20:59 2008
@@ -102,12 +102,10 @@
     </tr>
     </wiki:Permission>
 --%>  
-<wiki:CheckRequestContext context="edit|comment">
     <tr>
     <td><label for="changenote"><fmt:message 
key='editor.plain.changenote'/></label></td>
     <td><input type="text" name="changenote" id="changenote" size="80" 
maxlength="80" value="<c:out value='${changenote}'/>"/></td>
     </tr>
-</wiki:CheckRequestContext>
   </table>
   
   <div id="tools">

Modified: incubator/jspwiki/trunk/src/webdocs/templates/default/jspwiki.css
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/templates/default/jspwiki.css?rev=691738&r1=691737&r2=691738&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/templates/default/jspwiki.css (original)
+++ incubator/jspwiki/trunk/src/webdocs/templates/default/jspwiki.css Wed Sep  
3 12:20:59 2008
@@ -127,7 +127,7 @@
        padding:0;
        border:0;
        outline:none;
-       vertical-align:baseline;
+       /* vertical-align:baseline; seems to give printing errors in FF */
 }
 /* remember to define focus styles! */
 :focus {
@@ -1474,33 +1474,59 @@
        line-height:1.4;
        padding:0.25em 1em 0.25em 0;
 }
-.accordion .toggle:hover, .togglemenu .toggle:hover, .sidemenu .toggle:hover {
+.accordion .toggle:hover, .menu .toggle:hover {
        background:#eee;
 }
 .accordion .tab {
        padding:0 1em;
 }
-.togglemenu {
+.menu {
     clear:both; /* check out */
        color:gray;
        font-weight:bold; 
-       padding:0.25em 0.5em;
 }
-.togglemenu .toggle {
+.menu.top {
+       margin-left:0.5em; /* small left indent of first toggle */
+}
+.menu.left {
        float:left;
+       margin-top:0.5em; /* small top indent of first toggle */
+}
+.menu.right {
+       float:right;
+       margin-top:0.5em; /* small top indent of first toggle */
+}
+.menu .toggle {
        background:#f9f9f9;
        border:1px solid #ddd;
        cursor:pointer;
-       display:inline;
-       margin:0 0 -1px -1px;
        padding:0.25em 0.5em;
 }
-.togglemenu .toggle.active {
+.menu.top .toggle { 
+       float:left;
+       margin:0 0 -1px -1px; /* adjacent toggle will stick: let 1px border 
overlap.*/
+       display:inline;
+}
+.menu.left .toggle {
+       margin:0 -1px -1px 0; /* adjacent toggle will stick: let 1px border 
overlap.*/
+}
+.menu.right .toggle {
+       margin:0 0 -1px -1px; /* adjacent toggle will stick: let 1px border 
overlap.*/
+}
+.menu .toggle.active {
        background:transparent;
-       border-bottom:1px solid white;
        cursor:default;
        color:black;
 } 
+.menu.top .toggle.active {
+       border-bottom:1px solid white;
+}
+.menu.left .toggle.active {
+       border-right:1px solid white;
+}
+.menu.right .toggle.active {
+       border-left:1px solid white;
+} 
 .tabbedAccordion {
        padding:0.5em;
 }
@@ -1509,38 +1535,8 @@
 }
 .leftAccordion .tab, .rightAccordion .tab {
        border:1px solid #ddd !important;
-       margin:0 0 -2px 0; /* nice trick :: -2px to reveal top and bottom 
borders the tabs */
-       padding:0.25em 0.5em;
-}
-.sidemenu {
-       clear:both;
-       color:gray;
-       font-weight:bold; 
-       margin-top:0.5em;
-}
-.sidemenu.left {
-       float:left;
-}
-.sidemenu.right {
-       float:right;
-}
-.sidemenu .toggle {
-       background:#f9f9f9;
-       border:1px solid #ddd;
-       cursor:pointer;
-       margin:0 0 -1px 0;
+       margin:0 0 -2px 0; /* trick :: -2px to reveal top and bottom borders 
the tabs */
        padding:0.25em 0.5em;
-}
-.sidemenu.left .toggle {
-       border-right:none;
-}
-.sidemenu.right .toggle {
-       border-left:none;
-}
-.sidemenu .toggle.active {
-       background:transparent;
-       cursor:default;
-       color:black;
 } 
 
 /* ie only hack no needed ?


Reply via email to