You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by br...@apache.org on 2015/09/05 21:51:17 UTC

svn commit: r1701420 - in /jspwiki/trunk: ./ jspwiki-war/src/main/java/org/apache/wiki/ jspwiki-war/src/main/java/org/apache/wiki/attachment/ jspwiki-war/src/main/scripts/moo-extend/ jspwiki-war/src/main/scripts/wiki-edit/ jspwiki-war/src/main/scripts/...

Author: brushed
Date: Sat Sep  5 19:51:16 2015
New Revision: 1701420

URL: http://svn.apache.org/r1701420
Log:
2.10.2-svn-36  Improved Attachment upload in the HADDOCK template
        * [JSPWIKI-903] Fixed a page redirect issue when deleting an 
         attachment from the Attachment info page.

Modified:
    jspwiki/trunk/ChangeLog
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/attachment/AttachmentServlet.java
    jspwiki/trunk/jspwiki-war/src/main/scripts/moo-extend/Form.File.js
    jspwiki/trunk/jspwiki-war/src/main/scripts/moo-extend/Form.MultipleFile.js
    jspwiki/trunk/jspwiki-war/src/main/scripts/wiki-edit/Snipe.Snips.js
    jspwiki/trunk/jspwiki-war/src/main/scripts/wiki-edit/Snipe.js
    jspwiki/trunk/jspwiki-war/src/main/scripts/wiki-edit/Wiki.Snips.js
    jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Wiki.Behaviors.js
    jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Wiki.js
    jspwiki/trunk/jspwiki-war/src/main/webapp/templates/default/AJAXSearch.jsp
    jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/AttachmentTab.jsp
    jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/FindContent.jsp
    jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/Header.jsp
    jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/InfoContent.jsp
    jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/Nav.jsp
    jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/Sidebar.jsp

Modified: jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/jspwiki/trunk/ChangeLog?rev=1701420&r1=1701419&r2=1701420&view=diff
==============================================================================
--- jspwiki/trunk/ChangeLog (original)
+++ jspwiki/trunk/ChangeLog Sat Sep  5 19:51:16 2015
@@ -1,3 +1,19 @@
+2015-09-05  Dirk Frederickx (brushed AT apache DOT org)
+
+       * 2.10.2-svn-36  Improved Attachment upload in the HADDOCK template
+
+       * Fixed the AttachementServlet so you can now select multiple files
+         before pressing the upload button.  You can also use 
+		 drap & drop if your browser supports it.
+ 
+        * [JSPWIKI-903] Fixed a page redirect issue when deleting an 
+         attachment from the Attachment info page.  
+
+       * Fixed the zebra-stripes of the FIND AJAXSearch.jsp
+       
+       * Few small improvements on the plain editor suggestion dialogs.
+       
+
 2015-08-28  Dirk Frederickx (brushed AT apache DOT org)
 
        * 2.10.2-svn-35 

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java?rev=1701420&r1=1701419&r2=1701420&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java Sat Sep  5 19:51:16 2015
@@ -72,7 +72,7 @@ public final class Release {
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "35";
+    public static final String     BUILD         = "36";
 
     /**
      *  This is the generic version string you should use when printing out the version.  It is of 

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/attachment/AttachmentServlet.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/attachment/AttachmentServlet.java?rev=1701420&r1=1701419&r2=1701420&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/attachment/AttachmentServlet.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/attachment/AttachmentServlet.java Sat Sep  5 19:51:16 2015
@@ -14,7 +14,7 @@
     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     KIND, either express or implied.  See the License for the
     specific language governing permissions and limitations
-    under the License.     
+    under the License.
  */
 package org.apache.wiki.attachment;
 
@@ -494,7 +494,8 @@ public class AttachmentServlet extends H
 
             String   wikipage   = null;
             String   changeNote = null;
-            FileItem actualFile = null;
+            //FileItem actualFile = null;
+            List<FileItem> fileItems = new java.util.ArrayList<FileItem>();
 
             for( FileItem item : items )
             {
@@ -527,33 +528,32 @@ public class AttachmentServlet extends H
                 }
                 else
                 {
-                    actualFile = item;
+                    fileItems.add( item );
                 }
             }
 
-            if( actualFile == null )
+            if( fileItems.size() == 0 )
+            {
                 throw new RedirectException( "Broken file upload", errorPage );
 
-            //
-            // FIXME: Unfortunately, with Apache fileupload we will get the form fields in
-            //        order.  This means that we have to gather all the metadata from the
-            //        request prior to actually touching the uploaded file itself.  This
-            //        is because the changenote appears after the file upload box, and we
-            //        would not have this information when uploading.  This also means
-            //        that with current structure we can only support a single file upload
-            //        at a time.
-            //
-            String filename = actualFile.getName();
-            long   fileSize = actualFile.getSize();
-            InputStream in  = actualFile.getInputStream();
+            } else {
 
-            try
-            {
-                executeUpload( context, in, filename, nextPage, wikipage, changeNote, fileSize );
-            }
-            finally
-            {
-                IOUtils.closeQuietly( in );
+                for( FileItem actualFile : fileItems ){
+
+                    String filename = actualFile.getName();
+                    long   fileSize = actualFile.getSize();
+                    InputStream in  = actualFile.getInputStream();
+
+                    try
+                    {
+                        executeUpload( context, in, filename, nextPage, wikipage, changeNote, fileSize );
+                    }
+                    finally
+                    {
+                        IOUtils.closeQuietly( in );
+                    }
+
+                }
             }
 
         }

Modified: jspwiki/trunk/jspwiki-war/src/main/scripts/moo-extend/Form.File.js
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/scripts/moo-extend/Form.File.js?rev=1701420&r1=1701419&r2=1701420&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/scripts/moo-extend/Form.File.js (original)
+++ jspwiki/trunk/jspwiki-war/src/main/scripts/moo-extend/Form.File.js Sat Sep  5 19:51:16 2015
@@ -121,8 +121,8 @@ Form.File = new Class({
 
             submit = function(event){
                 if (event) event.preventDefault();
-                 inputFiles.getFiles().each(function(file){
-                    uploadReq.append(name, file);
+                 inputFiles.getFiles().each(function(file,i){
+                    uploadReq.append(name+"-"+i, file);
                 });
                 uploadReq.send();
             };
@@ -181,12 +181,22 @@ Form.File = new Class({
                 //this event can only be received on the first input[type=file]
                 var input = this,
                     item = input.getParent(options.item),
-                    newItem = item.clone(true, true);
+                    newItem = item.clone(true, true),
+                    fileNames = "";
+
+                for( var i=0; i< input.files.length; i++){
+                    var file = input.files[i];
+                    fileNames += file.name.replace(/.*[\\\/]/, "")
+                              + " <span class='badge'>" + ( file.size / 1024 ).toFixed(1) + " kB</span><br />";
+                  }
 
                 input.set("id",String.uniqueID());
-                item.getElement("label").set("text", input.value.replace(/.*[\\\/]/, "") );
+                input.set("name",String.uniqueID());
+                input.set ("title","");
+                item.getElement("label").set("html", fileNames );
                 item.getElement(".delete").removeClass("hidden");
                 item.removeClass("droppable");
+
                 list.grab(newItem,"top");
                 self.update(+1);
             },

Modified: jspwiki/trunk/jspwiki-war/src/main/scripts/moo-extend/Form.MultipleFile.js
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/scripts/moo-extend/Form.MultipleFile.js?rev=1701420&r1=1701419&r2=1701420&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/scripts/moo-extend/Form.MultipleFile.js (original)
+++ jspwiki/trunk/jspwiki-war/src/main/scripts/moo-extend/Form.MultipleFile.js Sat Sep  5 19:51:16 2015
@@ -126,7 +126,7 @@ Form.MultipleFile = new Class({
 
         var newItem = this.list.getFirst().clone(true,true);
         newItem.getElement('input').destroy();
-        newItem.getElement('label').set('html', file.name + "<b>"+file.size/1024+" Kb</b>" );
+        newItem.getElement('label').set('html', file.name + "<b>"+(file.size/1024).toFixed(1)+" kB</b>" );
         newItem.getElement('.delete').removeClass('hidden').store('file',file);
         newItem.removeClass('droppable');
         this.list.grab(newItem);

Modified: jspwiki/trunk/jspwiki-war/src/main/scripts/wiki-edit/Snipe.Snips.js
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/scripts/wiki-edit/Snipe.Snips.js?rev=1701420&r1=1701419&r2=1701420&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/scripts/wiki-edit/Snipe.Snips.js (original)
+++ jspwiki/trunk/jspwiki-war/src/main/scripts/wiki-edit/Snipe.Snips.js Sat Sep  5 19:51:16 2015
@@ -17,13 +17,15 @@
 */
 /*
 Snippet:
-    init - initialize snippets; detect shortcut-keys, and suggest dialogs
-    get - retrieve and validate the snippet. Return false when not found.
+    init - initialize snippets; detect shortcut-keys, and suggestion dialogs
+
+    get - retrieve and validate a snippet. Returns false when not found.
+
     inScope - check whether a snippet is inScope at the current cursor position
     toggle - ...
 
-
-    suggest - match suggestion dialog => fireEvent(action,cmd)
+    match - retrieve snippet based on cmd entered at cursor position
+    matchSuggest - retrieve suggestion dialog based on cmd entered at cursor position
     shortcut -  match key => fireEvent(action,cmd)
 
 Example
@@ -107,7 +109,7 @@ Snipe.Snips = new Class({
         var cmd, fromStart = this.workarea.getFromStart();
 
         for( cmd in this.snips ){
-            if( fromStart.test( cmd+"$" ) ) return cmd;
+            if( fromStart.test( cmd + "$" ) ) return cmd;
         }
 
         return false;
@@ -131,6 +133,11 @@ Snipe.Snips = new Class({
             caret = workarea.getSelectionRange(),
             fromStart = workarea.getFromStart();
 
+        //"selectInline", "selectBlock", "selectStartOfLine";
+
+        var SOL = workarea.isCaretAtStartOfLine();
+        var EOL = workarea.isCaretAtEndOfLine();
+
         for( cmd in snips ){
 
             snip = snips[cmd];
@@ -147,7 +154,7 @@ Snipe.Snips = new Class({
                         console.log("SUGGEST Prefix ", cmd, suggest.pfx, pfx.getLast() );
                         pfx = pfx.getLast(); //match last (x)
                         result = workarea.slice( caret.start - pfx.length )
-                                        .match( suggest.match );
+                                         .match( suggest.match );
 
                         console.log("SUGGEST Match ", suggest.match, result );
 
@@ -180,17 +187,11 @@ Snipe.Snips = new Class({
         Retrieve and validate the snippet.
         Returns false when the snippet is not found or not in scope.
 
-
     Arguments:
         snips - snippet collection object for lookup of the cmd
         cmd - snippet key. If not present, retrieve the cmd from
             the textarea just to the left of the caret. (i.e. tab-completion)
 
-    Returns:
-        Return a snippet object or false.
-        - false
-        - snippet object
-
     Example:
         (start code)
         sn.get( "bold" );

Modified: jspwiki/trunk/jspwiki-war/src/main/scripts/wiki-edit/Snipe.js
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/scripts/wiki-edit/Snipe.js?rev=1701420&r1=1701419&r2=1701420&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/scripts/wiki-edit/Snipe.js (original)
+++ jspwiki/trunk/jspwiki-war/src/main/scripts/wiki-edit/Snipe.js Sat Sep  5 19:51:16 2015
@@ -88,7 +88,7 @@ var Snipe = new Class({
 
     Implements: [Options, Events, Undoable],
 
-    Binds: ["sync","shortcut","keystroke","suggest","select","action"],
+    Binds: ["sync","shortcut","keystroke","suggest","action"],
 
     options: {
         tab: "    ", //default tab = 4 spaces
@@ -141,6 +141,7 @@ var Snipe = new Class({
                     var s = textarea.getSelectionRange();
                     self.fireEvent("beforeChange");
                     s.thin ? work.value = v : textarea.setSelection(v);
+                    //self.fireEvent("change");
                 }
             }
         }];
@@ -149,7 +150,7 @@ var Snipe = new Class({
 
         //Snipe.Commands takes care of capturing commands.
         //Commands are entered via tab-completion, button clicks, or a dialog.
-        //Snipe.Commands also ensures that at most one dialog is open at the same time.
+        //Snipe.Commands ensures that at most one dialog is open at the same time.
         self.commands = new Snipe.Commands( container, {
             //onOpen: function( /*command*/ ){ work.focus(); },
             onClose: function( /*command*/ ){ work.focus(); },
@@ -172,9 +173,8 @@ var Snipe = new Class({
             //blur: self.reset.bind(self), //(and hide any open dialogs; and update the preview area...)
             keyup: self.suggest.debounce(), //(250, true)
             click: self.suggest.debounce(),
-            //select: self.select.debounce(),
             change: function( parm ){
-                //console.log("bubble change event from textarea");
+                //console.log("change :", parm);
                 self.fireEvent("change",parm);
             }
 
@@ -204,7 +204,7 @@ var Snipe = new Class({
         Retrieve some of the public properties or options of the snip-editor.
 
     Arguments:
-        item - textarea|snippets|tabcompletion|directsnips|smartpairs|autosuggest
+        item - mainarea|textarea|snippets|directsnips|autosuggest|tabcompletion|smartpairs
     */
     get: function(item){
 
@@ -627,53 +627,19 @@ var Snipe = new Class({
 
             if ( suggest = this.snippets.matchSuggest() ){
 
-                console.log( "Snipe.suggest ",suggest );
+                //console.log( "Snipe.suggest ",suggest );
                 this.setContext( null/*snip*/, suggest );
                 return this.commands.action( suggest.cmd , suggest.pfx );
 
             }
             //close suggest dialog if one is still open
-            //is this ok??
-
+            //CHECKME: this.commands.close();
             this.reset();
         }
 
-        self.fireEvent("change"); //Potential change of the textarea, to be debounced by receiver -- CHECKME
-
-    },
-
-
-    /*
-    Method: select
-        Selection snippets are dialog-boxes appearing when you select some text.
-        When clicking items in the SELECTION dialogs, content is inserted
-        in the textarea.
-
-        Selection commands (lowest priority vs. other snippets)
-        - selectInline: "bold|italic|mono|link",
-        - selectBlock:  "code|prettify"
-        - selectStartOfLine: "!!!h1|!!h2|!h3|bold|italic|mono|link|plugin"
-
-    */
-    select: function(e){
-
-        var self = this,
-            txta = self.textarea,
-            selection = txta.getSelectionRange(),
-            cmd = "selectInline";
-
-        if( !txta.getSelectionRange().thin ){
-
-            if( txta.isCaretAtStartOfLine() ){
-
-                cmd = txta.isCaretAtEndOfLine() ? "selectBlock" : "selectStartOfLine";
-
-            }
-
-            console.log("SELECT COMMAND", cmd );
-            //return this.commands.action( cmd );
-
-        }
+        self.fireEvent("change");
+        //CHECKME: Potential change of the textarea, to be debounced by receiver -- CHECKME
+        //FIXME: FIRE-EVENT to be done when a snippet is inserted
 
     },
 
@@ -714,14 +680,12 @@ var Snipe = new Class({
         if( snip = self.snippets.get(cmd) ){
 
             if( snip.event ){
-                console.log("Snipe:action() fire-event: ",snip.event);
+                //console.log("Snipe:action() fire-event: ",snip.event);
                 return self.fireEvent(snip.event, arguments);
             }
 
             this.fireEvent("beforeChange");
 
-            //$(txta).focus();  CHECKME
-
             if( snip.suggest ){
 
                 return self.suggestAction( cmd, args );
@@ -753,41 +717,25 @@ var Snipe = new Class({
 
                 if( !caret.thin ){
                     p = snip.parms.shift();
-                        s = s.replace( p, txta.getSelection() );
-                    }
+                    s = s.replace( p, txta.getSelection() );
+                }
 
             }
 
             txta.setSelection( s );
 
-            //next action
-            if( false && snip.parms[1] ){
-
-                //this snippet has one or more parameters left
-                //store the active snip and process the next {parameter}
-                //checkme !!
-
-                if( !self.hasContext() ){ self.setContext( snip ); }
-
-                caret = txta.getSelectionRange(); //update new caret
-
-                self.nextAction( txta, caret );
+            //when no selection, move caret after the inserted snippet,
+            //otherwise leave the selection unchanged
 
+            if( caret.thin ){
 
-            } else {
-
-                //when no selection, move caret after the inserted snippet,
-                //otherwise leave the selection unchanged
-                if( caret.thin ){
-
+                    console.log("move after", s.length, caret.start + s.length);
                     txta.setSelectionRange( caret.start + s.length );
 
-                }
-
-                self.reset();
-
             }
 
+            self.reset(); //CHECKME
+
         }
 
     },
@@ -805,14 +753,13 @@ var Snipe = new Class({
     Arguments:
         txta - Textarea object
         snip - Snippet object
-        caret - Caret object {start, end, thin}
+        caret - Object {start, end, thin}
 
     Returns:
-        - (string) replacement string for the selection.
-            By default, returns snip.text
+        - (string) replacement string for the selection. By default, returns snip.text
         - the snip.parms will be set to [] is toggle was executed successfully
-        Eventually the selection will be extended if the
-        prefix and suffix were just outside the selection.
+
+        The selection will be extended if the prefix and suffix were just outside the selection.
     */
     toggleSnip: function(txta, snip, caret){
 
@@ -821,9 +768,13 @@ var Snipe = new Class({
             arr = s.trim().split( snip.parms[0] ),
             fst = arr[0],
             lst = arr[1],
-            re = new RegExp( "^\\s*" + fst.trim().escapeRegExp() + "\\s*(.*)\\s*" + lst.trim().escapeRegExp() + "\\s*$" );
+            re = new RegExp( "^\\s*"
+                           + fst.trim().escapeRegExp()
+                           + "\\s*(.*)\\s*"
+                           + lst.trim().escapeRegExp()
+                           + "\\s*$" );
 
-        if( (fst+lst)!="" ){
+        if( (fst + lst) != "" ){
 
             s = txta.getSelection();
             snip.parms = [];
@@ -834,17 +785,19 @@ var Snipe = new Class({
                 s = s.replace( re, "$1" );
 
             // if pfx/sfx are matched just outside the selection: extend selection
-            } else if( txta.getFromStart().test(fst.escapeRegExp()+"$") && txta.getTillEnd().test("^"+lst.escapeRegExp()) ){
+            } else if( txta.getFromStart().test(fst.escapeRegExp() + "$")
+                    && txta.getTillEnd().test("^" + lst.escapeRegExp() ) ){
 
-                txta.setSelectionRange(caret.start-fst.length, caret.end+lst.length);
+                txta.setSelectionRange( caret.start - fst.length, caret.end + lst.length);
 
             // otherwise, insert snippet and set caret between pfx and sfx
             } else {
 
-                txta.setSelection( fst+lst ).setSelectionRange( caret.start + fst.length );
+                txta.setSelection( fst + lst ).setSelectionRange( caret.start + fst.length );
             }
         }
         return s;
+
     },
 
     /*

Modified: jspwiki/trunk/jspwiki-war/src/main/scripts/wiki-edit/Wiki.Snips.js
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/scripts/wiki-edit/Wiki.Snips.js?rev=1701420&r1=1701419&r2=1701420&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/scripts/wiki-edit/Wiki.Snips.js (original)
+++ jspwiki/trunk/jspwiki-war/src/main/scripts/wiki-edit/Wiki.Snips.js Sat Sep  5 19:51:16 2015
@@ -21,16 +21,14 @@ DirectSnippet definitions for JSPWiki, a
 These snippets are directly expanded on keypress.
 */
 Wiki.DirectSnips = {
-
     '"' : '"',
     '(' : ')',
     '[' : ']',
     '{' : '}',
-    '%%' : ' /%',
     "'" : {
-        snippet:"'",
-        scope:{
-            "[{":"}]"  //plugin parameters
+        snippet: "'",
+        scope: {
+            "[{" : "}]"  //plugin parameters
           }
     }
 };
@@ -40,7 +38,6 @@ Function: snippets
 
         Definitions for the JSPWiki editor commands.
 
-
         A command consists of triggers, attributes, snippets, events and dialogs.
 
         Following commands are predefined by the snipe editor:
@@ -208,7 +205,7 @@ Wiki.Snips = {
             snippet: "\\\\\n"
         },
         hr: "\n----\n",
-        lorem: "This is is just some sample. Don’t even bother reading it; you will just waste your time. Why do you keep reading? Do I have to use Lorem Ipsum to stop you? OK, here goes: Lorem ipsum dolor sit amet, consectetur adipi sicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Still reading? Gosh, you’re impossible. I’ll stop here to spare you.",
+        lorem: "This is just some sample. Don’t even bother reading it; you will just waste your time. Why do you keep reading? Do I have to use Lorem Ipsum to stop you? OK, here goes: Lorem ipsum dolor sit amet, consectetur adipi sicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Still reading? Gosh, you’re impossible. I’ll stop here to spare you.",
         Lorem: { synonym: "lorem" },
 
 
@@ -508,17 +505,16 @@ Wiki.Snips = {
                 caption: "Wiki Link",
                 onOpen: function( dialog ){
 
-
                     var //dialog = this,
                         key = dialog.getValue();
 
-                    if( !key || (key.trim()=='') ){ key = Wiki.PageName + '/'; }
+                    //if empty link, than fetch list of attachments of this page
+                    if( !key || (key.trim()=='') ){ key = Wiki.PageName + "/"; }
 
-                    //console.log('json lookup for '+key);
                     Wiki.jsonrpc("/search/suggestions", [key, 30], function( result ){
 
-                        console.log("jsonrpc result", result );
-                        if( result[1] /*length>1*/ ){
+                        //console.log("jsonrpc result", result );
+                        if( result[0] /* length > 0 */ ){
 
                             dialog.setBody( result );
 
@@ -647,12 +643,66 @@ Wiki.Snips = {
 
         },
 
-        //FIXME
+        selectBlock: {
+            suggest: function(workarea, caret, fromStart){
+
+                var cmd;
+
+                if(!caret.thin
+                && workarea.isCaretAtStartOfLine()
+                && workarea.isCaretAtEndOfLine() ){
+
+                     console.log("got block selection" );
+                     return { pfx:"xx", match:workarea.getSelection() }
+                }
+            },
+
+            selectBlock: [Dialog.Selection, {
+                cssClass: ".dialog-horizontal",
+                body:{
+                    "\\{\\{\\{\n{code block}\n}}}": "<span style='font-family:monospace;'>code</span>",
+                    "%%prettify\n\\{\\{\\{\n{pretiffied code block}\n}}}/%": "<span class='pun' style='font-family:monospace;'>prettify</span>"
+                }
+            }]
+        },
+
+        selectStartOfLine: {
+            suggest: function(workarea, caret, fromStart){
+
+                var cmd;
+
+                if(!caret.thin
+                && workarea.isCaretAtStartOfLine()
+                && !workarea.isCaretAtEndOfLine() ){
+
+                     console.log("got start of line selection", caret);
+                     return { pfx:"xx", match:workarea.getSelection() }
+                }
+            },
+
+            selectStartOfLine: [Dialog.Selection, {
+                cssClass: ".dialog-horizontal",
+                body:{
+                    "!!!{header}": "H1",
+                    "!!{header}": "H2",
+                    "!{header}": "H3",
+                    "__{bold}__": "<b>bold</b>",
+                    "''{italic}''": "<i>italic</i>",
+                    "\\{\\{{monospaced text}}} ": "<tt>mono</tt>",
+                    "[description|{link}|options]": "<span class='icon-link'/>",
+                    "[{Image src='${image.jpg}'}]": "<span class='icon-picture'/>"
+                }
+            }]
+        },
         //Commands triggered by the selection of substrings:
         //    lowest priority vs. other snippets
         selectInline: {
-            suggest: function(workarea,caret,fromStart){
+            suggest: function(workarea, caret, fromStart){
+
+                var cmd;
+
                 if(!caret.thin){
+
                      console.log("got selection", caret);
                      return { pfx:"xx", match:workarea.getSelection() }
                 }
@@ -668,9 +718,8 @@ Wiki.Snips = {
                     "[{Image src='${image.jpg}'}]":"<span class='icon-picture'/>"
                 }
             }]
-        },
-        selectBlock:  "code|prettify",
-        selectStartOfLine: "!!!h1|!!h2|!h3|bold|italic|mono|link|plugin"
+        }
+
 
 }
 

Modified: jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Wiki.Behaviors.js
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Wiki.Behaviors.js?rev=1701420&r1=1701419&r2=1701420&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Wiki.Behaviors.js (original)
+++ jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Wiki.Behaviors.js Sat Sep  5 19:51:16 2015
@@ -92,7 +92,24 @@ wiki.add("*[class^=progress]", function(
 
 */
 
-})
+    })
+
+/*
+Behavior: pie
+
+Credit: Lea Verou,  Static Pie
+
+%%pie 20% /%
+%%pie-red-blue 20% /%
+%%pie-red-blue-r50 20% /%
+
+*/
+    .add(".pie", function(pie){
+
+	    pie.style.animationDelay = '-' + parseFloat(pie.textContent) + 's';
+	    pie.setAttribute('data-percent', parseFloat(pie.textContent)+"%");
+
+    })
 
 /*
 Behavior:%%graphBar .. /%
@@ -373,7 +390,7 @@ Behavior:Columns
 
 >    %%columns(-width) .. /%
 */
-    .add( "div[class|=columns]", Columns, { prefix: "columns" } )
+    .add( "div[class~=columns]", Columns, { prefix: "columns" } )
 
 /*
 Dynamic Style: Code-Prettifier
@@ -404,7 +421,7 @@ Example:
         }).inject(element, "before");
 
     })
-    .add("[class|=prettify-nonum] pre, [class|=prettify-nonum] code", function(element){
+    .add("[class~=prettify-nonum] pre, [class~=prettify-nonum] code", function(element){
 
         element.addClass("prettyprint");
 
@@ -453,6 +470,7 @@ Behavior: Table behaviors
         var args = "zebra".sliceArgs(element);
 
         element.getElements("table").each(function(table){
+            //console.log("zebra", args, table);
             new T.Zebra(table, { colors: args });
         });
 

Modified: jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Wiki.js
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Wiki.js?rev=1701420&r1=1701419&r2=1701420&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Wiki.js (original)
+++ jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Wiki.js Sat Sep  5 19:51:16 2015
@@ -154,8 +154,7 @@ var Wiki = {
             //activate attachment upload routines
             .add( "#files", Form.File, {
 
-                //TODO: jspwiki v.2.10.x seems now to only support 1 upload-file at a time
-                max: 1,
+                max: 8,
                 rpc: function(progressid, callback){
                     wiki.jsonrpc("/progressTracker", [progressid], callback);
                 }

Modified: jspwiki/trunk/jspwiki-war/src/main/webapp/templates/default/AJAXSearch.jsp
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/webapp/templates/default/AJAXSearch.jsp?rev=1701420&r1=1701419&r2=1701420&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/webapp/templates/default/AJAXSearch.jsp (original)
+++ jspwiki/trunk/jspwiki-war/src/main/webapp/templates/default/AJAXSearch.jsp Sat Sep  5 19:51:16 2015
@@ -123,7 +123,7 @@
 
     <div class="graphBars">
     <div class="zebra-table">
-    <table class="wikitable" >
+    <table class="wikitable  table-striped" >
 
       <tr>
          <th align="left"><fmt:message key="find.results.page"/></th>

Modified: jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/AttachmentTab.jsp
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/AttachmentTab.jsp?rev=1701420&r1=1701419&r2=1701420&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/AttachmentTab.jsp (original)
+++ jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/AttachmentTab.jsp Sat Sep  5 19:51:16 2015
@@ -56,7 +56,7 @@
       <ul class="list-group form-col-50">
         <li class="list-group-item droppable">
           <label>Select files <span class='canDragAndDrop'>or drop them here!</span></label>
-          <input type="file" name="files" id="files" size="60"/>
+          <input type="file" name="files" id="files" size="60" multiple="multiple"/>
           <a class="hidden delete btn btn-danger btn-xs pull-right">Delete</a>
         </li>
       </ul>

Modified: jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/FindContent.jsp
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/FindContent.jsp?rev=1701420&r1=1701419&r2=1701420&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/FindContent.jsp (original)
+++ jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/FindContent.jsp Sat Sep  5 19:51:16 2015
@@ -51,26 +51,26 @@
 
     <div class="btn-group" data-toggle="buttons">
       <label class="btn btn-default btn-xs" >
-        <input type="checkbox" name="details" id="details" <c:if test='${param.details == "on"}'>checked='checked'</c:if> />
+        <input type="checkbox" name="details" id="details" ${param.details == "on" ? "checked='checked'" : ""} />
         <fmt:message key="find.details" />
     </label>
     </div>
 
     <div class="btn-group" data-toggle="buttons">
       <label class="btn btn-default btn-xs">
-        <input type="radio" name="scope" <c:if test='${empty param.scope}'>checked='checked'</c:if> value=""><fmt:message key='find.scope.all' />
+        <input type="radio" name="scope" ${empty param.scope ? "checked='checked'" : ""} value=""><fmt:message key='find.scope.all' />
       </label>
-      <label class="btn btn-default btn-xs" >
-        <input type="radio" name="scope" id="x" <c:if test='${param.scope eq "author:"}'>checked='checked'</c:if> value="author:"><fmt:message key='find.scope.authors' />
+      <label class="btn btn-default btn-xs">
+        <input type="radio" name="scope" ${param.scope eq "author:" ? "checked='checked'" : ""} value="author:"><fmt:message key='find.scope.authors' />
       </label>
       <label class="btn btn-default btn-xs">
-        <input type="radio" name="scope" <c:if test='${param.scope eq "name:"}'>checked='checked'</c:if> value="name:"><fmt:message key='find.scope.pagename' />
+        <input type="radio" name="scope" ${param.scope eq "name:" ? "checked='checked'" : ""} value="name:"><fmt:message key='find.scope.pagename' />
       </label>
       <label class="btn btn-default btn-xs">
-        <input type="radio" name="scope" <c:if test='${param.scope eq "contents:"}'>checked='checked'</c:if> value="contents:" ><fmt:message key='find.scope.content' />
+        <input type="radio" name="scope" ${param.scope eq "contents:" ? "checked='checked'" : ""} value="contents:" ><fmt:message key='find.scope.content' />
       </label>
       <label class="btn btn-default btn-xs">
-        <input type="radio" name="scope" <c:if test='${param.scope eq "attachment:"}'>checked='checked'</c:if> value="attachment:" ><fmt:message key='find.scope.attach' />
+        <input type="radio" name="scope" ${param.scope eq "attachment:" ? "checked='checked'" : ""} value="attachment:" ><fmt:message key='find.scope.attach' />
       </label>
     </div>
 

Modified: jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/Header.jsp
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/Header.jsp?rev=1701420&r1=1701419&r2=1701420&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/Header.jsp (original)
+++ jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/Header.jsp Sat Sep  5 19:51:16 2015
@@ -18,14 +18,15 @@
 --%>
 
 <%@ taglib uri="http://jspwiki.apache.org/tags" prefix="wiki" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
 <%@ page import="org.apache.wiki.*" %>
 <fmt:setLocale value="${prefs.Language}" />
 <fmt:setBundle basename="templates.default"/>
 <%
   WikiContext c = WikiContext.findContext(pageContext);
-  String frontpage = c.getEngine().getFrontPage();
 %>
+<c:set var="frontpage" value="<%= c.getEngine().getFrontPage() %>" />
 
 <wiki:Plugin plugin="IfPlugin" args="page='TitleBox' contains='\\\\S' " >[{InsertPage page=TitleBox class='titlebox alert' }]</wiki:Plugin>
 
@@ -35,8 +36,8 @@
 
     <div class="cage pull-left">
     <a class="logo pull-left"
-        href="<wiki:Link page='<%=frontpage%>' format='url' />"
-       title="<fmt:message key='actions.home.title' ><fmt:param><%=frontpage%></fmt:param></fmt:message> ">apache<b>jsp&#x03C9;iki</b></a>
+        href="<wiki:Link page='${frontpage}' format='url' />"
+       title="<fmt:message key='actions.home.title' ><fmt:param>${frontpage}</fmt:param></fmt:message> ">apache<b>jsp&#x03C9;iki</b></a>
 
         <wiki:PageExists page="HomeMenu">
         <ul class="dropdown-menu" data-hover-parent=".cage"  style="color:black;">

Modified: jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/InfoContent.jsp
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/InfoContent.jsp?rev=1701420&r1=1701419&r2=1701420&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/InfoContent.jsp (original)
+++ jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/InfoContent.jsp Sat Sep  5 19:51:16 2015
@@ -86,7 +86,9 @@ As we currently do not want to touch the
 defaul template,  let's fix this here
 --%>
 <c:choose>
-<c:when test="${param.tab == 'attach'}"><wiki:Include page="AttachmentTab.jsp"/></c:when>
+<c:when test="${param.tab == 'attach'}">
+  <wiki:Include page="AttachmentTab.jsp"/>
+</c:when>
 <c:otherwise>
 
 <div class="page-content">
@@ -305,7 +307,7 @@ defaul template,  let's fix this here
 </wiki:Permission>
 
 
-<form action="<wiki:Link format='url' context='<%=WikiContext.DELETE%>' />"
+<form action="<wiki:Link format='url' context='<%=WikiContext.DELETE%>' ><wiki:Param name='tab' value='attach' /></wiki:Link>"
            class="form-group"
               id="deleteForm"
           method="post" accept-charset="<wiki:ContentEncoding />" >

Modified: jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/Nav.jsp
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/Nav.jsp?rev=1701420&r1=1701419&r2=1701420&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/Nav.jsp (original)
+++ jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/Nav.jsp Sat Sep  5 19:51:16 2015
@@ -28,9 +28,8 @@
 <fmt:setBundle basename="templates.default"/>
 <%
   WikiContext c = WikiContext.findContext( pageContext );
-  pageContext.setAttribute( "attachments", c.getEngine().getAttachmentManager().listAttachments( c.getPage() ).size() );
-  String frontpage = c.getEngine().getFrontPage();
 %>
+<c:set var="attachments" value="<%= c.getEngine().getAttachmentManager().listAttachments( c.getPage() ).size() %>" />
 
 <%-- navigation bar --%>
 <div class="row sticky">
@@ -59,7 +58,7 @@
   --%>
 
   <%-- attachment --%>
-  <wiki:CheckRequestContext context='view|info|diff|rename|edit'>
+  <wiki:CheckRequestContext context='view|info|upload|rename|diff|rename|edit'>
   <wiki:PageExists>
   <li id="attach"
    class="<wiki:Permission permission='!upload'>disabled</wiki:Permission>">
@@ -76,34 +75,33 @@
   </wiki:CheckRequestContext>
 
   <%-- info --%>
-  <wiki:CheckRequestContext context='view|upload|rename|edit'>
+  <wiki:CheckRequestContext context='view|info|upload|rename|edit'>
   <wiki:PageExists>
   <li id="info">
     <wiki:Link context="info" accessKey="i">
       <fmt:message key='info.tab'/><wiki:PageExists><span class="caret"></span></wiki:PageExists>
     </wiki:Link>
-  <ul class="dropdown-menu pull-right" data-hover-parent="li">
+    <ul class="dropdown-menu pull-right" data-hover-parent="li">
       <li class="dropdown-header">This is version <span class="badge"><wiki:PageVersion /></span></li>
       <li class="dropdown-header">Last Changed on:</span></li>
-    <wiki:CheckVersion mode="latest">
-      <li><wiki:DiffLink version="latest" newVersion="previous"><wiki:PageDate format='${prefs["DateFormat"]}'/></wiki:DiffLink></li>
-    </wiki:CheckVersion>
-    <wiki:CheckVersion mode="notlatest">
-      <li><wiki:DiffLink version="current" newVersion="latest"><wiki:PageDate format='${prefs["DateFormat"]}'/></wiki:DiffLink></li>
-    </wiki:CheckVersion>
-    <li class="dropdown-header">By:</span></li>
-    <li>
-      <%-- wiki:Author sometimes returns a link(ok) or a plain text, we always need a link! --%>
-      <c:set var="author"><wiki:Author/></c:set>
-      <c:choose>
-        <c:when test="${ fn:contains(author,'href=')}">${author}</c:when>
-        <c:otherwise><a href="#">${author}</a></c:otherwise>
-      </c:choose>
-    </li>
-    <li class="divider"></li>
-    <li><wiki:RSSImageLink mode="wiki" /></li>
-
-  </ul>
+      <wiki:CheckVersion mode="latest">
+        <li><wiki:DiffLink version="latest" newVersion="previous"><wiki:PageDate format='${prefs["DateFormat"]}'/></wiki:DiffLink></li>
+      </wiki:CheckVersion>
+      <wiki:CheckVersion mode="notlatest">
+        <li><wiki:DiffLink version="current" newVersion="latest"><wiki:PageDate format='${prefs["DateFormat"]}'/></wiki:DiffLink></li>
+      </wiki:CheckVersion>
+      <li class="dropdown-header">By:</span></li>
+      <li>
+        <%-- wiki:Author sometimes returns a link(ok) or a plain text, we always need a link! --%>
+        <c:set var="author"><wiki:Author/></c:set>
+        <c:choose>
+          <c:when test="${ fn:contains(author,'href=')}">${author}</c:when>
+          <c:otherwise><a href="#">${author}</a></c:otherwise>
+        </c:choose>
+      </li>
+      <li class="divider"></li>
+      <li><wiki:RSSImageLink mode="wiki" /></li>
+    </ul>
   </li>
   </wiki:PageExists>
   </wiki:CheckRequestContext>

Modified: jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/Sidebar.jsp
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/Sidebar.jsp?rev=1701420&r1=1701419&r2=1701420&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/Sidebar.jsp (original)
+++ jspwiki/trunk/jspwiki-war/src/main/webapp/templates/haddock/Sidebar.jsp Sat Sep  5 19:51:16 2015
@@ -25,7 +25,7 @@
 <%@ page import="org.apache.wiki.*" %>
 
 <div class="sidebar">
-  <button class="close" type="button">&times;</button>
+  <%--<button class="close" type="button">&times;</button>--%>
 
   <wiki:Permission permission="view">