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 2014/02/14 18:24:35 UTC

svn commit: r1568367 [7/13] - in /jspwiki/trunk: ./ jspwiki-war/ jspwiki-war/src/main/config/wro/ jspwiki-war/src/main/java/org/apache/wiki/ jspwiki-war/src/main/scripts/dynamic-styles/ jspwiki-war/src/main/scripts/lib/ jspwiki-war/src/main/scripts/moo...

Added: jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Category.js
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Category.js?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Category.js (added)
+++ jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Category.js Fri Feb 14 17:24:32 2014
@@ -0,0 +1,55 @@
+/*
+Class: Categories
+    Turn wikipage links into AJAXed popups.
+
+Depends:
+    Wiki
+
+DOM structure before:
+    (start code)
+    span.category
+        a.wikipage Category-Page
+    (end)
+
+DOM structure after:
+    (start code)
+    div|span.category
+        span
+            a.wikipage.category-link[href=".."] Category-Page
+            div.popup (.hidden|.loading|.active)
+                div.title
+                    a.wikipage[href=".."]Category-Page
+                ul
+                    li
+                        a
+                br
+                a.morelink ..and x more
+                br
+    (end)
+*/
+
+Wiki.Category = function(element, pagename, xhrURL){
+
+    var popup;
+    'span.cage'.slick().wraps(element).grab(popup = 'div.popup.hide'.slick());
+
+    element.set({
+        'class': 'category-link',
+        title: 'category.title'.localize( pagename ),
+        events: { click: function(event){
+            
+            event.stop();
+            popup.swapClass('hide', 'loading').onHover( /*popup.getParent()*/ );
+            element.set('title','').removeEvents();
+
+            new Request.HTML({
+                url: xhrURL,
+                data: { page:pagename },
+                update: popup,
+                onSuccess: function(){ popup.swapClass('loading', 'active').fade(0.9); }
+            }).send();
+            
+        } }
+    });
+
+}

Added: jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Dynamic-styles.js
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Dynamic-styles.js?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Dynamic-styles.js (added)
+++ jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Dynamic-styles.js Fri Feb 14 17:24:32 2014
@@ -0,0 +1,482 @@
+/* Dynamic Styles
+
+    Uses global var 'Wiki', and a number of Classes.
+
+*/
+
+!function( wiki ){
+
+var hints, TheSlimbox, T = TableX;
+
+
+/*
+Style: %%graphBar .. /%
+*/
+wiki.add('div[class^=graphBars]', GraphBar )
+    
+
+//FIXME -- OBSOLETE ?? top level TAB of the page
+    .add('.page > .tabmenu a:not([href])', Tab )
+
+/*
+Style: %%tabbedSection .. /% , %%tabs .. /%, %%pills .. /%
+*/
+    .add('.tabbedSection,.tabs', Tab )
+    .add('.pills', Tab, { nav:'ul.nav.nav-pills' } )
+
+/*
+Style: Accordion
+
+>   %%accordion .. /%
+>   %%leftAccordion .. /%
+>   %%rightAccordion .. /%
+>   %%tabbedAccordion .. /%
+
+*/
+    .add('[class^=accordion]', Accordion)
+    .add('[class^=leftAccordion]', Accordion, { type:'pills', position:'pull-left' })
+    .add('[class^=rightAccordion]', Accordion, { type:'pills', position:'pull-right' })
+    .add('.tabbedAccordion', Accordion, { type:'tabs' })
+    .add('.pillsAccordion', Accordion, { type:'pills' })
+
+
+/*
+Style: %%category .. /%
+*/
+    .add( '.category a.wikipage', function(element) {
+
+        new Wiki.Category(element, Wiki.toPageName(element.href), Wiki.XHRCategories);
+
+    })
+
+/*
+BOOTSTRAP Style: %%alert .. /%
+*/
+    .add('.alert', function(element){
+
+        element.addClass('alert-warning alert-dismissable').grab(
+            'button.close[type="button"][html="×"]'.slick()
+                .addEvent('click',function(){ element.dispose(); }),
+            'top'
+        );
+
+    })
+
+/*
+BOOTSTRAP Style %%quote .. /%
+*/
+    .add('.quote', function(element){
+        
+        'blockquote'.slick().wraps( 'p'.slick().wraps(element));
+
+    })
+
+
+/*
+Plugin: Viewer
+>     %%viewer [link to youtube, vimeo, some-wiki-page, http://some-external-site ..] /%
+>     [description | url to youtube... | class='viewer']
+*/
+    .add('a.viewer, div.viewer a', function( a ){
+
+        Viewer.preload(a.href, { width:800, height:600 }, function( element ){
+
+            var next = a.getNext();
+            if( next && next.match('img.outlink') ) next.dispose();
+
+            element.addClass('viewport').replaces(a);
+
+        });
+
+    });
+
+
+/*
+Plugin: Viewer.Slimbox
+    Injects slimbox button, after each link inside the %%slimbox container. 
+    The slimbox button opens a modal overlay box with a rich media viewer.
+    When the %%slimbox container contains multiple links, 'next' and 'previous' buttons
+    are added to navigate between all media.
+
+Example:
+>    %%slimbox [any supported link] /%
+>    [link-description | link-url | class='slimbox']
+
+DOM structure:
+
+JSPWiki support attachment links (with paperclip), inline images and external links.
+Notice how inline images are converted to attachement links.
+(start code)
+    div.slimbox
+        a.attachment[href="url.(png|bmp|tiff|jpg|jpeg|gif)"] Image link
+        a.infolink[href="url]
+            img[src=attachment_small.png]   (small jspwiki paperclip)
+
+        img.inline[src="url2"]
+
+        a.external[href="url3"] External link
+        img.outlink[src=out.png]
+(end)
+becomes
+(start code)
+    div.slimbox
+        a.attachment[href="url1"] Image link
+        a.slimboxbtn[href="url1"][title=Image link] »
+        a.infolink[href="url]
+            img[src=attachment_small.png]   (small paperclip)
+
+        a.attachment[href="url2"] url2
+        a.slimboxbtn[href="url2"][title=url2] »
+
+        a.external[href="url3"] External link
+        a.slimboxbtn[href="url3"][title=External link]
+        img.outlink[src=out.png]
+(end)
+
+Example of the short notation with the .slimbox class
+>    a.slimbox[href="url"] Link
+becomes
+>    a.slimbox[href="url"] Link
+
+*/
+
+//helper function
+function filterJSPWikiLinks(element){
+
+    return element.match('a') ? 
+        [element] : 
+        element.getElements( element.match('.slimbox-attachments') ?
+            'a[href].attachment' : 
+            //    img:not([src$=/attachment_small.png]):not(.outlink)  
+            //    a[href].attachment, 
+            //    a[href].external,a[href].wikipage
+            'img:not([src$=/attachment_small.png]):not(.outlink),a[href].attachment,a[href].external,a[href].wikipage'
+        );
+}
+
+wiki.once('body', function( elements ){
+
+        //create singleton TheSlimbox
+        TheSlimbox = new Viewer.Slimbox();
+        /*TheSlimbox = new Viewer.Slimbox({ 
+            hints: {
+                //use defaults as much as possible
+                //btn: 'Click to view {0}', 
+                //caption: ' Direct link to {0}',    
+                btn: 'slimbox.btn'.localize(),
+                caption: 'slimbox.caption'.localize()
+            }
+        });*/
+    })
+
+    // [ link-description | link-url | class='slimbox-link' ]
+    // replaces the link by a slimbox-link
+    .add('a.slimbox-link', function( element ){
+
+        TheSlimbox.watch([element]);
+
+    })
+
+    .add('.slimbox-attachments,*[class~=slimbox],*[class~=lightbox]', function( element ){
+
+        var arr = filterJSPWikiLinks(element);
+                        
+        TheSlimbox.watch(arr, 'button.slimbox-btn');
+
+        //jspwiki -- replace inline images by attachment links
+        $$(arr).filter('img[src]').each(function( element ){
+            'a.attachment'.slick({
+                href:element.src, 
+                html:element.title||element.alt
+            }).replaces( element );        
+        });
+
+        /*FFS: replacing img[src], should also add the info paperclip 
+              .grab( [
+                    'a.infolink',{href:element.src},[
+                        'img[alt="(info)"]',{src:".../attachment_small.png"}
+                        ]
+                    ].slick()
+                )
+        */
+                    
+    })
+
+/*
+Plugin: Viewer.Carousel (embed auto-rotating media viewer into a wiki page)
+> %%carousel [link-1] [link-2] .. [link-n]/%  =>  carousel viewer next,previous
+> %%carousel-auto [link-1] [link-2] .. [link-n]/%  =>  with auto-rotation
+*/
+    .add( '.carousel', function( element ){
+
+        new Viewer.Carousel( filterJSPWikiLinks( element ), {
+            container: element,
+        });
+
+
+    });
+
+  
+/*
+Plugin: Collapsible.Box, Collapsible.List
+    Create collabsible boxes and (un)ordered lists.
+    The collapse status (open/close) is persisted in a cookie.
+    
+Depends on:
+    Wiki, Cookie, Cookie.Flag, Collapsible, Collapsible.Box, Collapsible.List
+
+>    %%collapse
+>    %%collapsebox
+>    %%collapsebox-closed
+*/
+
+//helper function
+function collapseFn(element, cookie){
+
+        var TCollapsible = Collapsible,
+            clazz = element.className,
+            list = "collapse",
+            box = list+"box";
+
+        cookie = new Cookie.Flags( 
+            'JSPWikiCollapse' + (cookie || wiki.PageName), 
+            { path:wiki.BasePath, duration:20 }
+        );
+
+        if( clazz == list ){
+
+            new TCollapsible.List(element,{ cookie:cookie });
+
+        } else if( clazz.indexOf(box)==0 ){
+        
+            new TCollapsible.Box(element,{ 
+                cookie:cookie, 
+                collapsed:clazz.indexOf(box+'-closed')==0 
+            });
+
+        }
+
+}
+
+wiki
+    .add('.page div[class^=collapse]',collapseFn )
+    .add('.sidebar div[class^=collapse]',collapseFn, 'Sidebar')
+
+/*
+Style: Comment Box
+
+Wiki Markup:
+(start code)
+    %%commentbox .. /%
+    %%commentbox-Caption .... /% 
+    %%commentbox
+        !Caption
+        ..
+    /%
+(end)
+*/
+    .add('div[class^=commentbox]', CommentBox, { prefix:'commentbox' } )
+
+        
+/*
+Style: Columns
+>    %%columns(-width) .. /%
+*/
+    .add( 'div[class*=columns]', Columns, { prefix:'columns' } )
+
+/*
+Dynamic Style: Code-Prettifier
+    JSPWiki wrapper around http://google-code-prettify.googlecode.com/svn/trunk/README.html
+
+    TODO: add option to overrule the choice of language:
+    >    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
+    >    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
+    >    "xhtml", "xml", "xsl"
+
+Example:
+>    %%prettify {{{
+>        some code snippet here ...
+>    }}} /%
+
+*/
+    .add('div.prettify pre, div.prettify code', function(element){
+
+        element.addClass('prettyprint');
+
+        //brute-force line-number injection
+        'pre.prettylines'.slick({
+            html: element.innerHTML.trim().split('\n').map(function(line,i){ return i+1 }).join('\n')
+        }).inject(element,'before');
+
+    })
+    
+    .once('.prettyprint', prettyPrint)  //after element.prettyPrint decoration, prettify them
+
+
+/*
+Style: Reflection for images
+>    %%reflection-30-50    //size of reflection images is 30% height by 50% wide
+*/
+    .add('div[class*=reflection]', function(element){
+
+        var args = "reflection".sliceArgs( element );
+        
+        if(args) element.getElements('img').reflect({
+            height:args[0]/100,
+            width:args[1]/100
+        });
+
+    })
+    
+/*
+Dynamic Style: %%sortable, %%table-filter, %%zebra
+
+>    %%zebra ... /%              => default odd row colors (light grey)
+>    %%zebra-table ... /%     => default odd row colors (light grey)
+>    %%zebra-eee ... /%      => odd rows get backgroundcolor #eee
+>    %%zebra-pink ... /%      => odd rows get backgroundcolor red
+>    %%zebra-eee-red ... /%     => odd rows: #eee, even rows: red
+*/
+    .add('.sortable table', T.Sort, {hints: 
+        Object.map({
+            sort: "sort.click",
+            atoz: "sort.ascending",
+            ztoa: "sort.descending"
+        },String.localize)
+    })
+
+    .add('.table-filter table', T.Filter, {
+        hint:"filter.hint".localize()
+    })
+    /*
+    .add('.table-filter table', function(element){
+        new T_TableX.Filter(element,{ /--list:['one$','James'],--/ hint:hints.filter});
+      })
+    */
+
+    .add('.zebra,div[class*=zebra]', function(element){
+    
+        var args = 'zebra'.sliceArgs(element);
+        element.getElements('table').each(function(table){
+            new T.Zebra(table, { colors:args });
+        });
+        
+    })
+
+/*
+TODO
+Combined table styling
+%%table-striped-bordered-hover-condensed-filter-sort-<color>
+%%sortable .. /%
+%%table-filter .. /%
+%%zebra-table .. /%
+FFS %%table-scrollable  (keep head fixed, max height for the table)
+
+    .add('div[class^=table-]',function(element){
+
+        var args = 'table'.sliceArgs(element), arg,
+            tables = element.getElements('table'),
+            hints =  Object.map({
+                sort: "sort.click",
+                atoz: "sort.ascending",
+                ztoa: "sort.descending",
+                filter: "filter.hint"
+            },String.localize);
+        
+        while(args[0]){
+
+            arg = shift(args);
+            
+            if( arg.test('striped|bordered|hover|condensed'){
+                tables.addClass('table-'+arg);
+            } 
+            else if( arg == 'filter' ){
+                tables.each( function(t){ new T.Filter(t, {hint:hints.filter}); });
+            }
+            else if( arg == 'sort' ){
+                tables.each( function(t){ new T.Sort(t, {hints:hints}); });
+            }
+
+        }
+    
+    })
+
+*/
+
+
+/*
+Add BOOTSTRAP Styles
+    Scrollable pre area's
+*/
+    .add('div.scrollable > pre', function(element){ 
+
+        element.addClass('pre-scrollable');  //bootstrap class
+
+    })
+
+
+    .add('*[class^=list]', function(element){ 
+    
+        var args = "list".sliceArgs(element),
+            lists = element.getElements("ul|ol");
+
+        args.each( function( arg ){
+            if( arg.test('unstyled|hover|group|nostyle') ){ 
+                lists.addClass( 'list-'+arg );
+            } 
+            if( arg.test('group') ){ 
+                lists.each( function(item){ 
+                    item.getElements('li').addClass('list-group-item'); 
+                });
+            }
+        });
+
+    })
+
+/*
+    Labels
+    Support %%label, %%label-default, %%label-primary, %%label-info, %%label-success; %%label-warning, %%label-danger
+*/
+    .add('*[class^=label]',function(element){
+
+        element.addClass( 'label'.fetchContext(element) );
+
+    })
+
+
+/*
+Plugin: Tips
+    Add mouse-hover Tips to your pages. Depends on Mootools Tips plugin.
+
+Wiki-markup:
+    > %%tip ... /%
+    > %%tip-Caption ... /%
+
+DOM Structure:
+(start code)
+    //before
+    div.tip-TipCaption ...tip-body... 
+
+    //after
+    a.tooltip-anchor  Tip Caption
+        div.tip-TipCaption ...tip-body...
+
+(end)
+*/
+    .once('*[class^=tip]', function(tips){
+
+        var caption, more = 'tip.default.title'.localize();
+
+        tips = tips.map( function(tip){
+
+            caption = (tip.className.split('-')[1]||more).deCamelize();
+            return 'a.tip-link'.slick({ text: caption }).wraps(tip);
+
+        });
+        
+        Tips( tips ); //activate tips behavior
+
+    });
+
+
+}( Wiki );

Added: jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Findpages.js
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Findpages.js?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Findpages.js (added)
+++ jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Findpages.js Fri Feb 14 17:24:32 2014
@@ -0,0 +1,98 @@
+/*
+Class: Wiki.SearchBox
+    ...
+    Adds/Removes 'li.findpages' elements to the dropdown menu.
+    These elements are the results of the wiki rpc call, based on the query.
+
+
+Example:
+>    wiki.add('query', Wiki.SearchBox, {
+>        rpc: function(value, callback){ wiki.jsonrpc('search.findPages', [value,20], callback },
+>        toUrl: wiki.toUrl
+>    });
+*/
+Wiki.Findpages = new Class({
+
+    Binds:['search','action'],
+    Implements: Events,
+
+    initialize: function(element, options){
+
+        this.rpc = options.rpc;
+        this.toUrl = options.toUrl;
+        this.query = element.getParent('form').query.observe( this.search );
+        this.element = element; //ul.dropdown menu
+
+    },
+
+    getValue: function(){
+        return this.query.value.stripScripts();
+    },
+
+    empty: function(){
+        this.element.getElements('li.findpages').destroy();
+    },
+
+    search: function(){
+
+        var value = this.getValue();
+
+        if( (value == null) || (value.trim()=="") ){
+
+            this.empty();
+
+        } else {
+
+            this.rpc( 'name:'+value, this.action );
+            //for testing ...
+            //this.action({"id":10000,"result":{"javaClass":"java.util.ArrayList","list":[{"map":{"page":"BrushedTemplateCollapse","score":99},"javaClass":"java.util.HashMap"},{"map":{"page":"BrushedTemplate","score":95},"javaClass":"java.util.HashMap"},{"map":{"page":"CollapsibleList","score":61},"javaClass":"java.util.HashMap"},{"map":{"page":"BrushedTemplateInGerman","score":55},"javaClass":"java.util.HashMap"},{"map":{"page":"BrushedTemplateDiscussion","score":50},"javaClass":"java.util.HashMap"},{"map":{"page":"BrushedTemplateScreenshots","score":50},"javaClass":"java.util.HashMap"},{"map":{"page":"BrushedTemplateTypography","score":50},"javaClass":"java.util.HashMap"},{"map":{"page":"BrushedConditionalPlugin","score":48},"javaClass":"java.util.HashMap"},{"map":{"page":"BrushedTemplateDiscussion2006","score":45},"javaClass":"java.util.HashMap"},{"map":{"page":"BrushedTemplateMetadataEditor","score":44},"javaClass":"java.util.HashMap"},{"map":{"page":"BrushedTablePlugin","score"
 :43},"javaClass":"java.util.HashMap"},{"map":{"page":"BrushedTemplateColumns","score":43},"javaClass":"java.util.HashMap"},{"map":{"page":"BrushedTemplateCategories","score":43},"javaClass":"java.util.HashMap"},{"map":{"page":"BrushedTemplateToolbar","score":43},"javaClass":"java.util.HashMap"},{"map":{"page":"BrushedTemplateTOC","score":43},"javaClass":"java.util.HashMap"},{"map":{"page":"BrushedTemplateAccordion","score":43},"javaClass":"java.util.HashMap"},{"map":{"page":"BrushedTemplateTip","score":43},"javaClass":"java.util.HashMap"},{"map":{"page":"BrushedTemplateSlimbox","score":43},"javaClass":"java.util.HashMap"},{"map":{"page":"BrushedTemplateRoundedCorners","score":40},"javaClass":"java.util.HashMap"},{"map":{"page":"BrushedEditPageHelp","score":37},"javaClass":"java.util.HashMap"}]}});
+
+        }
+
+    },
+
+    action: function( result ){
+
+        var self = this,
+            value = self.getValue(),
+            elements = [], content, btn = 'span.btn.btn-xs.btn-danger';
+
+        //helper function
+        function addLI( page, score, isEdit, isClone ){
+
+            content = [];
+            if( isClone ){
+                content.push(btn, {text: "Clone this page and Create".localize() });
+            } else if( isEdit ){
+                content.push(btn, {text: "Create".localize() });
+            }
+            content.push( 'span', {text:page});
+            if( score ) content.push('span.badge.pull-right', {text:score});
+
+            elements.push( "li.findpages", [
+                ( isEdit ? "a.createpage" : "a" ), { href: self.toUrl(page, isEdit, isClone) }, 
+                content     
+            ]);
+
+        }
+
+        if( result.list ){
+
+            item = result.list[0];
+            if( !item || item.map.page!=value ){
+                addLI(value, 0, true);  //create new page
+                addLI(value, 0, true, true);  //clone current page into a new page
+            }
+
+            while(result.list[0]){
+                item = result.list.shift().map; 
+                addLI(item.page, item.score);                
+            }
+
+			self.empty();
+			if(elements[0]) elements.slick().inject( self.element.getFirst('.divider'), 'before' );
+            //self.fireEvent('complete');
+
+        }
+    }
+});
\ No newline at end of file

Added: jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Group.js
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Group.js?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Group.js (added)
+++ jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Group.js Fri Feb 14 17:24:32 2014
@@ -0,0 +1,121 @@
+//TODO: refactor me
+
+/*
+Javascript routines to support JSPWiki Group management
+    GroupContent.jsp
+        div#viewgroup
+        form#deleteGroup
+    GroupTab.jsp
+        form#groupForm
+    NewGroupContent.jsp
+*/
+Wiki.add('#groupForm',function(form){
+});
+
+var WikiGroup =
+{
+    MembersID   : "membersfield",
+    //GroupTltID  : "grouptemplate",
+    GroupID     : "groupfield",
+    NewGroupID  : "newgroup",
+    GroupInfoID : "groupinfo",
+    CancelBtnID : "cancelButton",
+    SaveBtnID   : "saveButton",
+    CreateBtnID : "createButton",
+    DeleteBtnID : "deleteButton",
+    groups      : { "(new)": { members:"", groupInfo:"" } },
+    cursor      : null,
+    isEditOn    : false,
+    isCreateOn  : false,
+
+    putGroup: function(group, members, groupInfo, isSelected){
+        this.groups[group] = { members: members, groupInfo: groupInfo };
+
+        var g = $("grouptemplate");
+            gg = g.clone().removeProperty('id').setHTML(group).inject(g.getParent()).show();
+
+        if(isSelected || !this.cursor) this.onMouseOverGroup(gg);
+    } ,
+
+    onMouseOverGroup: function(node){
+        if(this.isEditOn) return;
+        this.setCursor(node);
+
+        var g = this.groups[ (node.id == this.GroupID) ? "(new)": node.innerHTML ];
+        $(this.MembersID).value = g.members;
+        $(this.GroupInfoID).innerHTML = g.groupInfo;
+    } ,
+
+    setCursor: function(node){
+        if(this.cursor) $(this.cursor).removeClass('cursor');
+        this.cursor = $(node).addClass('cursor');
+    } ,
+
+    //create new group: focus on input field
+    onClickNew: function(){
+        if(this.isEditOn) return;
+
+        this.isCreateOn = true;
+        $(this.MembersID).value = "";
+        this.toggle();
+    } ,
+
+    //toggle edit status of Group Editor
+    toggle: function(){
+        this.isEditOn = !this.isEditOn; //toggle
+
+        $(this.MembersID  ).disabled =
+        $(this.SaveBtnID  ).disabled =
+        $(this.CreateBtnID).disabled =
+        $(this.CancelBtnID).disabled = !this.isEditOn;
+        var del = $(this.DeleteBtnID);
+        if(del) del.disabled = this.isCreateOn || !this.isEditOn;
+
+        if(this.isCreateOn) { $(this.CreateBtnID).toggle(); $(this.SaveBtnID).toggle() };
+
+        var newGrp  = $(this.NewGroupID),
+            members = $(this.MembersID);
+
+        if(this.isEditOn){
+            members.getParent().addClass("cursor");
+
+            newGrp.disabled = !this.isCreateOn;
+            if(this.isCreateOn) { newGrp.focus(); } else { members.focus(); }
+        } else {
+            members.getParent().removeClass("cursor");
+
+            if(this.isCreateOn){
+                this.isCreateOn = false;
+                newGrp.value = newGrp.defaultValue;
+                members.value = "";
+            }
+            newGrp.blur();
+            members.blur();
+            newGrp.disabled = false;
+        }
+    } ,
+
+    // submit form to create new group
+    onSubmitNew: function(form, actionURL){
+        var newGrp = $(this.NewGroupID);
+        if(newGrp.value == newGrp.defaultValue){
+            alert("group.validName".localize());
+            newGrp.focus();
+        } else this.onSubmit(form, actionURL);
+    } ,
+
+    // submit form: fill out actual group and members info
+    onSubmit: function(form, actionURL){
+        if(! this.cursor) return false;
+        var g = (this.cursor.id == this.GroupID) ? $(this.NewGroupID).value: this.cursor.innerHTML;
+
+        /* form.action = actionURL; -- doesn't work in IE */
+        form.setAttribute("action", actionURL) ;
+        form.group.value = g;
+        form.members.value = $(this.MembersID).value;
+        form.action.value = "save";
+
+        Wiki.submitOnce(form);
+        form.submit();
+    }
+}
\ No newline at end of file

Added: jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Prefs.js
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Prefs.js?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Prefs.js (added)
+++ jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Prefs.js Fri Feb 14 17:24:32 2014
@@ -0,0 +1,40 @@
+/*
+Javascript routines to support JSPWiki UserPreferences
+    PreferencesContent.jsp
+    PreferencesTab.jsp
+
+    *  prefSkin:'SkinName',
+    *  prefTimeZone:'TimeZone',
+    *  prefTimeFormat:'DateFormat',
+    *  prefOrientation:'Orientation',
+    *  editor:'editor',
+    *  prefLanguage:'Language',
+    *  prefSectionEditing:'SectionEditing' =>checkbox 'on', T/F ???fixme
+*/
+Wiki.once('.context-prefs form', function(forms){
+
+
+    window.onbeforeunload = function(){
+
+        //a checkbox get('value') returns 'on' when checked; getDefaultValue() should also return 'on'
+        if( forms[1].getElements('[data-pref]').some(function(el){
+            //console.log(el.get('data-pref'),el.checked,el.get('name'), el.get('value') , el.getDefaultValue());
+            return (el.get('value') != el.getDefaultValue());
+        }) ) return 'prefs.areyousure'.localize();
+        
+        //return 'always popup dialog for testing';
+
+    };
+
+    forms[1].addEvent('submit', function(){
+    
+        this.getElements('[data-pref]').each( function(el){
+            Wiki.set( el.get('data-pref'), el.get('value') ); 
+        });
+        //alert("stop");
+
+    });
+
+    forms[2].addEvent('submit', function(){ Wiki.erase(); });
+
+});

Added: jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Recents.js
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Recents.js?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Recents.js (added)
+++ jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Recents.js Fri Feb 14 17:24:32 2014
@@ -0,0 +1,100 @@
+/*
+Class: Wiki.RecentSearches
+ * FIXME: remember 10 most recent search topics (cookie based)
+ * Extended with quick links for view, edit and clone (ref. idea of Ron Howard - Nov 05)
+ * Refactored for mootools, April 07
+
+Uses:
+    #recentClear
+    #recentSearches
+Depends:
+    wiki
+
+DOM-structure:
+(start code)
+    <div id="recentSearches">
+      <fmt:message key="sbox.recentsearches"/>
+      <a href="#"><fmt:message key="sbox.clearrecent"/></a>
+      <ul>
+          <li><a href...>...</a></li>
+      </ul>
+    </div>
+(end code)
+
+Examples:
+>    wiki.add('.searchbox-recents', function(element){
+>       new Wiki.Recents(element, {
+>           items: wiki.prefs.get('RecentSearch'),
+>           onChange: function(recents){ wiki.set('RecentSearch',recents); }
+>       });
+>   });
+
+*/
+Wiki.Recents = new Class({
+
+    Implements: [Events, Options],
+
+    initialize:function(dropdown,options){
+
+        var self = this, 
+            items, i=0, len, 
+            list=[], li='li.recents';
+
+		self.setOptions( options );
+        //self.options.items = ['foo','bar']; //test
+
+        self.items = items = self.options.items || list;
+        self.form = dropdown.getParent('form').addEvent('submit', self.submit.bind(self) );
+
+        //build li.recents dropdown items
+        if( items[0] ){
+
+            while(items[i]){
+                list.push(li, ['a', { html:items[i++].stripScripts() }] );
+            }
+            //list.push(li+'.clear',['a',{html:'[Clear Recent Searches]' }]);
+            list.push(li+'.clear',['a', [ 'span.btn.btn-xs.btn-default',{text:'Clear Recent Searches' }]]);
+            dropdown.adopt( list.slick() );
+        }
+        dropdown.addEvent('click:relay('+li+')', function(ev){ ev.stop(); self.action(this); });
+
+    },
+
+    action: function( element ){
+
+        var self = this, form = self.form;
+
+        if( element.match('.clear') ){
+
+            //element.getSiblings('li.recents').destroy();
+            //element.destroy();
+            element.getElements('!> > li.recents').destroy(); //!> == direct parent
+            self.items = [];
+            self.fireEvent('change'/*,null*/);
+
+        } else {
+
+            form.query.value = element.get('text');
+            form.submit();
+
+        }
+
+    },
+
+    submit:function(){
+
+        var self = this,
+            items = self.items,
+            value = self.form.query.value.stripScripts(); //xss
+
+        if( items.indexOf( value ) < 0 ){
+
+            //insert new item at the start of the list, and cap list on max 10 items
+            if( items.unshift(value) > 9){ items = items.slice(0,9); }
+            self.fireEvent('change', [self.items = items] );
+
+        }
+
+    }
+
+});
\ No newline at end of file

Added: jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Search.js
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Search.js?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Search.js (added)
+++ jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Search.js Fri Feb 14 17:24:32 2014
@@ -0,0 +1,118 @@
+/*
+Class: Wiki.Search
+    ...
+
+Depends:
+    Graphbar
+
+DOM Structure:
+    (start code)
+    (end)
+
+Example:
+    (start code)
+    new wiki.Search( form, {
+        url: wiki.XHRSearch,
+        onComplete: function(){ this.wiki.set('PrevQuery', form.query); }
+    });
+    (end)
+
+*/
+Wiki.Search = new Class({
+
+    Binds: ['action','setQuery','setStart'],
+    Implements: [Events, Options],
+
+    initialize:function(form,options){
+
+        var self = this, s;
+
+        self.setOptions(options);
+        self.form = form;
+        form.getElements('input[name=scope]').addEvent('click', self.setQuery);
+        form.details.addEvent('click', self.action);
+
+        self.result = form.getNext().addEvent('click:relay(.pagination a)', self.setStart);
+
+        self.query = form.query.observe( function(){
+            form.start.value='0';   // reset the start page before re-running new ajax searches
+            self.action();
+        });
+
+        // hash may contain a query pagination parameter: (-1=all,0,1,2...)
+        if( location.hash ){
+            s = decodeURIComponent(location.hash.slice(1)).match(/(.*):(-?\d+)$/);
+            if(s && s[2] /*s.length==3*/ ){
+                //console.log(s);
+                query.value = s[1];
+                form.start.value = s[2];
+                self.setQuery();
+            }
+        }
+    },
+
+    scopeRE : /^(?:author:|name:|contents:|attachment:)/,
+    setQuery: function( ){
+
+        this.query.value =
+            this.form.getElement("input[name=scope]:checked").value +
+            this.query.get('value').replace(this.scopeRE, '');
+
+        this.action();
+
+    },
+
+    setScope: function( query ){
+
+        var scope = query.match( this.scopeRE ) ||"";
+        scope = this.form.getElement("input[name=scope][value="+scope+"]");
+        if( scope ){ scope.checked=true; }
+
+    },
+
+    setStart: function(event){    
+        event.stop();
+        //this.form.start.value = event.target.get('data-start');
+        this.action();
+    },    
+
+    action: function(){
+
+        var self = this,
+            form = self.form,
+            query = self.query.value,
+            result = self.result;
+
+        if( !query || (query.trim()=='') ){
+            return result.empty();
+        }
+
+        self.setScope( query );
+
+        new Request.HTML({
+            url: self.options.xhrURL,
+            data: form,
+            //method: 'post',  //is default
+            update: result,
+            onComplete: function(){
+                spin.hide();
+                new GraphBar( result.getElement('.graphBars' ));
+                self.fireEvent('onComplete');
+            }
+        }).send();
+
+        location.hash = '#'+ query+':'+form.start.value;  // push the query into the url history
+
+    }
+
+});
+
+/*
+FIXME : hack the old runfullsearch() 
+    <a title="Show items from 21 to 40" 
+        onclick="$('start').value=20; SearchBox.runfullsearch();">2</a>
+    
+Better:
+    <a title="Show items from 21 to 40" data-start="20" >2</a>
+*/
+var SearchBox = { runfullsearch : function(){} }

Added: 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=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Wiki.js (added)
+++ jspwiki/trunk/jspwiki-war/src/main/scripts/wiki/Wiki.js Fri Feb 14 17:24:32 2014
@@ -0,0 +1,457 @@
+/*!
+    JSPWiki - a JSP-based WikiWiki clone.
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); fyou may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "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.
+*/
+
+
+/*jshint forin:false, noarg:true, noempty:true, undef:true, unused:true, plusplus:false, immed:false, browser:true, mootools:true */
+/*global HighlightQuery, HighlightAccesskey, Behavior, FileUpload, TabbedSection */
+/*exported  Wiki */
+
+
+/*
+Script: wiki.js
+    Javascript routines to support JSPWiki, a JSP-based WikiWiki clone.
+
+License:
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Since:
+    v.2.9.0
+
+Dependencies:
+    Based on http://mootools.net/ v1.4.5
+    * mootools-core.js : v1.4.5 excluding the Compatibility module
+    * mootools-more.js : v1.4.0.1 including...
+        Class.Binds, Element.Shortcuts, Fx.Accordion, Drag, Drag.Move, Hash.Cookie, Tips
+
+
+Core Wiki Routines:
+    *    [Wiki] object (page parms, UserPrefs and setting focus)
+    *    [WikiSlimbox]
+    *    [SearchBox]: remember 10 most recent search topics
+
+Depends on :
+
+    mooxtend.js
+    behavior.js
+    color.js
+    localize.js
+
+    cookie.flag.js
+    collapsible.js
+
+    file-upload.js
+    graph-bar.js
+    Highlight.Query.js
+    Highlight.Accesskey.js
+    observer.js
+    placeholder.js
+    reflect.js
+    viewer.js
+    viewer.slimbox.js
+    viewer.carousel.js
+    tablextend.js  => TableStuff  (sortable, filters, zebra-stripes,  ?select&calculate)
+    tabs.js => TabbedSection => Tabs
+
+
+    wiki.js
+    wiki.category.js
+    wiki.d-styles
+    wiki.navigate.js
+    wiki.recent-search.js
+    wiki.search-box.js
+    wiki.search.js
+
+    wiki.prefs.js
+    wiki.admin.js
+
+    wiki.edit
+        dialog.js
+        snip-editor.js
+        textarea.js
+        undoable.js
+*/
+
+//"use strict";
+
+/*
+Class: Wiki
+    Javascript support functions for jspwiki.  (singleton)
+
+*/
+var Wiki = {
+
+    initialize: function(){
+
+        var behavior = new Behavior(),
+            wiki = this,
+            prefs = new Hash.Cookie('JSPWikiUserPrefs', {path:wiki.BasePath, duration:20});
+
+        wiki.add = behavior.add.bind(behavior);
+        wiki.once = behavior.once.bind(behavior);
+        wiki.update = behavior.update.bind(behavior);
+
+
+        //wiki.get = function(name){ return wiki.prefs.get(name); };
+        wiki.get = prefs.get.bind(prefs);
+        //wiki.set = function(name,value){ return wiki.prefs.set(name,value); };
+        wiki.set = prefs.set.bind(prefs);
+        wiki.erase = prefs.erase.bind(prefs);
+
+        //FIXME : link dom elements with behaviors
+        //wiki.add('input[placeholder]', function(element){ element.placeholderX(); })
+
+            //.add('input[autofocus],textarea[autofocus]', function(element){ element.focus(); })
+            //wiki.add('input:autofocus,textarea:autofocus', function(element){
+            //    console.log('autofocus', element);
+            //    element.focus();
+            //})
+
+        if( !('autofocus' in document.createElement('input') ) ){
+            wiki.add('input[autofocus=autofocus], textarea[autofocus=autofocus]', function(element){
+                console.log('autofocus', element);
+                //CHECKME
+                //    plain.jsp            'wikiText' OK 
+                //    login.jsp            'j_username' OK
+                //    prefs/profile        'loginname' 
+                //    prefs/prefs        'assertedName' OK
+                //    find                 'query2'  OK
+                return this.isVisible() && element.focus();
+            });
+        }
+
+
+        wiki.add( '*[accesskey]', Accesskey )
+
+            .add('*[data-toggle]', function(element){
+                element.onToggle( element.get('data-toggle') /*, 'active'*/ );
+            })
+
+            .add('*[data-hover-parent]', function(element){
+                element.onHover( element.get('data-hover-parent') /*, 'active'*/ );
+            })
+
+            .add('.searchbox .dropdown-menu', function(element){
+
+                var recentsCookie = 'RecentSearch';
+                
+                //activate Recent Searches functionality
+                new wiki.Recents( element, {
+                    items: wiki.get(recentsCookie),
+                    onChange: function( items ){
+                        items ? wiki.set(recentsCookie, items) : wiki.erase(recentsCookie);
+                    }
+                });
+
+                //activate Quick Navigation functionality
+                new wiki.Findpages(element,{
+                    rpc: function(value, callback){
+                        wiki.jsonrpc('search.findPages', [value,16], callback); 
+                    },
+                    toUrl: wiki.toUrl.bind(wiki)
+                });
+
+            })
+
+            .add('#searchform2', function( form ){
+
+                wiki.search = new wiki.Search( form, {
+                    xhrURL: wiki.XHRSearch,
+                    onComplete: function(){ 
+                        //console.log(form.query.get('value')); 
+                        wiki.set('PrevQuery', form.query.get('value')); 
+                    }
+                });
+
+            })
+
+            //.add('#uploadForm input[type=file]', Form.Upload, { 
+            .add('#files', Form.File, { 
+                max:1,  //CHECK: jspwiki v.2.10.x seems to only support 1 upload-file at a time ?? 
+                rpc: function(progressid, callback){
+                    wiki.jsonrpc('progressTracker.getProgress', [progressid], callback); 
+                },
+            });
+
+        window.addEvent('domready', wiki.domready.bind(wiki) );
+
+    },
+
+    /*
+    Function: domready
+        After the DOM is fully loaded,
+        - initialize the main wiki properties (meta data, prefs cookie, ...)
+        - once all behavior's are defined, call the update() to initiate them all
+          (activation of all dynamic styles)
+        - final actions:
+            - HighLight words in case the referrer page was a search query
+            - when the 'referrer' url (previous page) contains a "section=" parameter,
+              scroll the wiki page to the right section
+            - invoke periodical url hash parser
+
+    */
+    domready: function(){
+
+        var wiki = this;
+
+        wiki.getMeta();
+
+        wiki.url = null;  //??check why this is needed
+
+        if ( wiki.Context!='preview' && wiki.EditPermission && (wiki.get('SectionEditing:checked')) ){
+
+            wiki.addEditLinks( wiki.EditUrl );
+
+        }
+
+        wiki.scrollToSection( (document.referrer.match( /\&section=(\d+)$/ )||[-1])[0] );
+
+        // Highlight previous search-query (in cookie) or referrer page's search query
+        HighlightQuery( $('pagecontent'), wiki.get('PrevQuery') );
+        wiki.erase('PrevQuery');
+
+        // initialize all the element behaviors
+        wiki.update();
+
+        //todo -- check bootstrap router concept
+        //wiki.parseHash.periodical(500);
+
+    },
+
+    /*
+    Function: getMeta
+        Read all the "meta" dom elements, prefixed with "wiki",
+        and add them as properties to the wiki object.
+        EG  <meta name="wikiContext">  becomes  wiki.Context
+ 
+        * wikiContext : jspwiki requestcontext variable (view, edit, info, ...)
+        * wikiBaseUrl
+        * wikiPageUrl: page url template with dummy pagename "%23%24%25"
+        * wikiEditUrl : edit page url
+        * wikiJsonUrl : JSON-RPC url
+        * wikiPageName : pagename without blanks
+        * wikiUserName
+        * wikiTemplateUrl : path of the jsp template
+        * wikiApplicationName
+        * wikiEditPermission
+
+    */
+    getMeta: function(){
+
+        var url,
+            wiki = this,
+            host = location.host;
+
+        $$('meta[name^=wiki]').each( function(el){
+            wiki[el.get('name').slice(4)] = el.get('content')||'';
+        });
+        
+        // BasePath: if JSPWiki is installed in the root, then we have to make sure that
+        // the cookie-cutter works properly here.
+        url = wiki.BaseUrl;
+        url = url ? url.slice( url.indexOf(host) + host.length, -1 ) : '';
+        wiki.BasePath = ( url /*===''*/ ) ? url : '/';
+        //console.log("basepath: " + wiki.BasePath);
+
+    },
+
+    /*
+    Function: getSections
+        Returns a list of all section headers, excluding the header of the Table Of Contents.
+
+    */
+    getSections: function(){
+
+        return $$('.page-content *[id^=section]:not(#section-TOC)');
+
+    },
+
+    /*
+    Function: scrollToSection
+        Scrolls the page to the section previously being edited - if any
+        Section counting starts at 1??
+    */
+    scrollToSection:function( index ){
+
+        //console.log("SCROLL to section", index, ", Number of sections:",this.getSections().length );
+
+        var element = this.getSections()[index], pos;
+
+        if( element ){
+
+            pos = element.getPosition();
+            window.scrollTo(pos.x, pos.y);
+
+        }
+
+    },
+
+    /*
+    Property: toUrl
+        Turn a wiki pagename into a full wiki-url
+    */
+    toUrl: function(pagename, isEdit, isClone){
+
+        var url = isClone ? this.CloneUrl : isEdit ? this.EditUrl : this.PageUrl;
+
+        return url.replace(/%23%24%25/, this.cleanPageName(pagename) );
+
+    },
+
+    /*
+    Property: toPageName
+        Parse a wiki-url and return the corresponding wiki pagename
+    */
+    toPageName: function(url){
+
+        var s = this.PageUrl.escapeRegExp().replace(/%23%24%25/, '(.+)');
+        return ( url.match( RegExp(s) ) || [,false] )[1];
+
+    },
+
+    /*
+    Property: cleanPageName
+        Remove all not-allowed chars from a *candidate* pagename.
+        Trim repeated whitespace, allow letters, digits and punctuation chars: ()&+,-=._$
+        Ref. org.apache.wiki.parser.MarkupParser.cleanPageName()
+    */
+    cleanPageName: function(p){
+
+        //return p.clean().replace(/[^0-9A-Za-z\u00C0-\u1FFF\u2800-\uFFFD()&+,-=._$ ]/g, '');
+        //\w is short for [A-Z_a-z0-9_]
+        return p.clean().replace(/[^\w\u00C0-\u1FFF\u2800-\uFFFD()&+,=.$ ]/g, '');
+
+    },
+
+    /*
+    Function: parseHash
+        Periodic validation of #hash to ensure hidden screen sections are displayed.
+        (eg tabs, accordions, ...)
+
+    FIXME:
+        Add handling of BACK button for tabs ??
+        Use concept of ROUTER from backbone ??
+    */
+    parseHash: function(){
+
+        var h = location.hash;
+
+        if(this.url && this.url == location.href ){ return; }
+        this.url = location.href;
+
+        if( !h /*|| h===''*/ ){ return; }
+        h = $( h.slice(1) );
+
+
+        while( typeOf( h ) == 'element' ){
+
+            if( h.hasClass('hidetab') ){
+
+                TabbedSection.click.apply($('menu-' + h.id));
+
+            } else if( h.hasClass('tab') ){
+
+                /* accordion -- need to find accordion toggle object */
+                h.fireEvent('onShow');
+
+/*            } else if( !h.isVisible() ){
+                //alert('not visible'+el.id);
+                //fixme need to find the correct toggler
+                el.show(); //eg collapsedBoxes: fixme
+*/
+            }
+            h = h.getParent();
+        }
+
+        location = location.href; /* now jump to the #hash */
+    },
+
+
+  /*
+    Function: addEditLinks
+        Inject Section Edit links.
+        Todo: should better move server side
+    */
+    addEditLinks: function( url ){
+
+        var description = 'quick.edit'.localize();
+
+        url = url + (url.contains('?') ? '&' : '?') + 'section=';
+
+        this.getSections().each( function(element, index){
+
+            element.grab('a.edit-section'.slick({ html:description, href:url+index }));
+
+        });
+
+    },
+
+
+    /*
+    Function: jsonrpc
+        Generic json-rpc routines to talk to the backend jspwiki-engine.
+
+    Note:
+        Uses the JsonUrl which is read from the meta element "WikiJsonUrl"
+        {{{ <meta name="wikiJsonUrl" content='/JSPWiki-pipo/JSON-RPC' /> }}}
+
+    Supported rpc calls:
+        - {{search.findPages}} gets the list of pagenames with partial match
+        - {{progressTracker.getProgress}} get a progress indicator of attachment upload
+        - {{search.getSuggestions}} gets the list of pagenames with partial match
+
+    Example:
+        (start code)
+        Wiki.jsonrpc('search.findPages', ['Janne',20], function(result){
+            //do something with the resulting json object
+        });
+        (end)
+        
+    */
+    jsonid : 1e4, //seed
+    jsonrpc: function(method, params, callback){
+
+        if(this.JsonUrl){
+
+            new Request.JSON({
+                url: this.JsonUrl,
+                data: JSON.encode({ 
+                    //jsonrpc:'2.0', //CHECK
+                    id: this.jsonid++, 
+                    method: method, 
+                    params: params 
+                }),
+                method: 'post',
+                onSuccess: function(r){ 
+                    if(r.error) console.log(r.error);
+                    callback(r.result); 
+                },
+                onError: function(e){
+                    console.log(e); 
+                    callback(null);
+                }
+            }).send();
+
+        }
+    }
+
+};
+
+Wiki.initialize();
\ No newline at end of file

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Accordion.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Accordion.less?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Accordion.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Accordion.less Fri Feb 14 17:24:32 2014
@@ -0,0 +1,67 @@
+/*
+Style: Accordion, TabbedAccordion, LeftAccordion, RightAccordion, AccordionPills
+
+DOM structure:
+(start code)
+    ...
+    //accordion
+    div.panel-group.accordion : panel headings are toggles
+        div.panel.panel-default
+            div.panel-heading.actie  
+            div  => fx.accordion collapsible content
+                div.panel-body
+        div.panel.panel-default
+            div.panel-heading  => toggle
+            div  => fx.accordion collapsible content
+                div.panel-body
+            
+    //tabbedAccordion : tab toggles, panels without border
+    ul.nav.nav-tabs
+        li
+            a
+    div.panel-group.tabbedAccordion
+        div.active  => fx.accordion collapsible content
+            div.panel-body
+        div  => fx.accordion collapsible content
+            div.panel-body
+    
+    //leftAccordion : pill-toggles, panels with border
+    ul.nav.nav-pills.pull-left
+        li
+            a
+    div.panel-group.leftAccordion
+        div  => fx.accordion collapsible content
+            div.panel.panel-default.panel-body 
+        div  => fx.accordion collapsible content
+            div.panel.panel-default.panel-body  
+    
+    //rightAccordion : pill-toggles, panels with border
+    ul.nav.nav-pills.pull-right
+        li
+            a
+    div.panel-group.leftAccordion
+        div  => fx.accordion collapsible content
+            div.panel.panel-default.panel-body  
+        div  => fx.accordion collapsible content
+            div.panel.panel-default.panel-body  
+    
+(end)
+*/
+//inherit accordion layouts from bootstrap/panels.less, and bootstrap/navs.less
+
+//accordion toggles do not have embedded link elements, so no automatic pointer cursor
+[class^=accordion] .panel-heading { cursor:pointer; }
+
+//CHECKME: overwrite panel-group margin-bottom
+[class^=accordion] { margin-bottom:  @line-height-computed; }
+
+[class^=rightAccordion], [class^=leftAccordion] {
+
+    .panel { margin:0 .25em; } //put some space between accordion pills and the panel 
+
+    .clearfix;  //small panels with many pills may clash with subsequent elements
+
+}
+
+[class^=pillsAccordion] .panel { margin:.25em 0;  }
+

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Calendar.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Calendar.less?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Calendar.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Calendar.less Fri Feb 14 17:24:32 2014
@@ -0,0 +1,28 @@
+//
+// Section: Taglibs
+// - Stylesheet definitions for some of the JSP-tags shipped with JSPWiki.
+//
+
+/*
+Style: CalendarTag
+
+DOM structure:
+
+*/
+.calendar {
+    border:1px solid black;
+}
+.calendar td {
+    text-align:center;
+}
+.calendar .othermonth {
+    color:#707070;
+}
+.calendar .link {
+    background:@gray-light;
+}
+//.calendar tr.month ...
+//.calendar tr.weekdays ...
+.calendar .weekdays {
+    color:red;
+}
\ No newline at end of file

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Category.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Category.less?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Category.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Category.less Fri Feb 14 17:24:32 2014
@@ -0,0 +1,104 @@
+/*
+Style: Category
+
+Wiki markup:
+    %%category [JSPWikiStyles] /%
+
+DOM structure before:
+    (start code)
+    span.category
+        a.wikipage Category-Page
+    (end)
+
+DOM structure after:
+    (start code)
+    div|span.category
+        span
+            a.wikipage.categorylink[href=".."] Category-Page
+            div.popup (.hidden|.loading|.active)
+                div.title
+                    a.wikipage[href=".."]Category-Page
+                ul
+                    li
+                        a.hover
+                br
+                a.morelink ..and x more
+                br
+    (end)
+*/
+.category-link {
+    border-bottom:2px solid @wiki-category-link-color;
+    &:hover { text-decoration:none; }
+} 
+
+/*
+Style: cage
+   Used to capture absolute positioned popups, popovers, tootips, tips ... and 
+   automatically positions them relative to the visible part of the .cage
+DOM Structure:
+(start code)
+    span.cage
+      button xx
+       div.popup ...
+(end)
+*/
+.cage { position:relative; }
+
+
+/*
+Style: Popup
+    Reusable popup dialog box, with a list of hoverable links
+    IEx fallback using the half-transparent background image tip.png => fixme
+*/
+.popup {
+    position:absolute;
+    z-index:10;
+    background:@black;
+    background:@tooltip-bg;
+    border-radius:@border-radius-base;
+    .box-shadow( 2px 2px 4px @tooltip-bg );
+    _width:240px;
+
+    color:@white;
+    padding:.5em;    
+}
+
+
+.category .popup { 
+
+    margin-top:3px;  //slightly move popup down with 3px under the category-link
+    padding:0;
+
+    br { display:none; }
+
+    a {
+        display: block;
+        padding: 0.1em .75em;
+        color: @white;
+        text-decoration: none;
+        text-shadow: 1px 1px 0 @tooltip-bg;
+
+        &:hover {
+            background:@black;
+            background:fade(@tooltip-bg,25%);
+            border-radius:@border-radius-base;
+            _background-color:@black;
+        }
+    }
+
+    .categoryTitle { .hide; }
+    
+    .categoryText > ul {
+        margin:0;
+        padding:0;
+        list-style:none;
+        _background:url("@{imagePath}/tip.png") bottom right;
+    }
+    li {
+        margin:0;padding:0;
+    }
+
+}
+//.category .active { .... }
+
+

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Collapsible.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Collapsible.less?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Collapsible.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Collapsible.less Fri Feb 14 17:24:32 2014
@@ -0,0 +1,140 @@
+/*
+Style: Collapsible
+    Generic support for Collapsible.List, Collapsible.Box
+
+DOM structure:
+(start code)
+    li
+        b.bullet
+        .. content ..
+    li
+        b.bullet(.clpse)(.xpand)
+        ul
+            li .. content ..
+            li .. content ..
+(end)
+*/
+.bullet {
+    display:inline-block;
+    outline:0;
+    float:left;
+    width:2em;
+
+    // normal bullet, without child lists
+    font-family:@font-family-monospace;
+    line-height:1.4; //heuristic, for vertical
+    &:after { content:"\2022"; }
+    text-align:center;
+    color:@link-color;
+    
+/*  TEXT BULLETS - obsolete
+    &.xpand:after { content:"-"; }
+    &.clpse:after { content:"+"; }
+*/
+    // triangular bullets 
+    &.xpand, &.clpse {
+        cursor:pointer;
+        width:0;
+        height:0;
+        border:.4em solid transparent; 
+        border-radius: @border-radius-base; //smooth edges
+    }
+    &.xpand {
+        border-top-color:@link-color;
+        border-bottom:none;
+        margin:.5em .6em .5em .6em;
+        &:hover { border-top-color:@link-hover-color; }
+    }
+    &.clpse {
+        border-left-color:@link-color;
+        border-right:none;
+        margin:.3em .9em .3em .7em;
+        &:hover { border-left-color:@link-hover-color; }
+    }
+
+}
+
+
+// CHECKME: Make sure to print collapsed items as if they were not collapsed 
+@media print {
+    div.clpse {
+        display:block;
+        height:auto !important;
+        //width:auto !important;
+    }
+}
+
+.xpand, .clpse { overflow:hidden; }
+
+/*
+TODO: Experimental - css3 animation iso mootools tween.
+div.xpand { .transition(all .5s ease); height:auto; }
+div.clpse { .transition(all .5s ease); height:0; }
+*/ 
+
+
+/*
+Style: Collapsible.List
+>   %%collapse
+
+DOM structure:
+(start code)
+div.collapse
+    ul
+        li 
+            b.bullet
+            .. li-text ..
+        li
+            b.bullet(.xpand)(.clpse)
+            .. li-text ..
+            ul.xpand|clpse
+                li ..collapsible content ..
+                li ..collapsible content ..
+(end)
+*/
+.collapse {
+
+    > ul, > ol { margin-left:-2em; }  // first ul/ol, shift left to create space for the bullets
+    ul, ol { list-style:none;  }
+    
+    //li:not(.xpand), li:not(.clpse) { list-style:auto; .bullet {display:none;} }
+    li { white-space:nowrap; overflow:hidden; }  //assume li-items fit on one line
+
+}
+
+
+/*
+Style: Collapsible-Box
+>   %%collapsebox
+>   %%collapsebox-closed
+
+DOM structure:
+(start code)
+    //before
+    div.collapsebox
+        b.bullet.xpand|clpse'[click='...']
+        h1-4  title
+        .. collapsible content ..
+
+    //after
+    div.panel.panel-default
+        div.panel-heading
+            b.bullet.xpand|clpse[onclick="..."]
+            h4.panel-title title
+        div.panel-body.xpand|clpse
+            .. collapsible content ..
+(end)
+*/
+//re-use bootstrap/panels.less
+div[class^=collapsebox] {
+
+    > .panel-heading { padding-left:0; } //remove some left space next to the bullet
+
+    //coloured collapseboxes get white bullets    
+    &:not(.panel-default) .bullet {
+        &.xpand, &.xpand:hover { border-top-color:@white; }
+        &.clpse, &.clpse:hover { border-left-color:@white; }
+    }
+}
+
+

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Columns.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Columns.less?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Columns.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Columns.less Fri Feb 14 17:24:32 2014
@@ -0,0 +1,23 @@
+/*
+Style: Columns
+
+Wiki-markup:
+>    %%columns ... /%
+
+DOM structure:
+
+*/
+.columns {
+    .clearfix;
+    //  *width:100%; //ie6,ie7 hack
+    
+    .col {
+        float:left;
+        padding:0 0.5em 0.5em 0;
+    }
+}
+
+//ie6 and lower hack 
+//  * html .columns {  width:100%; }
+//ie7 hack 
+//  *:first-child+html .columns { width:100%; }

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/CommentBox.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/CommentBox.less?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/CommentBox.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/CommentBox.less Fri Feb 14 17:24:32 2014
@@ -0,0 +1,30 @@
+/*
+Style: Commentbox
+    Left floating comment box, with or without caption.
+
+DOM structure:
+    (start code)
+    
+    // Based on bootstrap/panel.less 
+    div.panel.panel-default(.panel-primary.panel-success.panel-info.panel-warning.panel-danger)
+      div.panel-header
+        h2.panel-title
+      div.panel-body
+      div.panel-footer
+    (end)
+*/
+
+.commentbox {
+
+    float:right;
+    //clear:right; //float subsequent boxes next to each-other
+    width:32%;
+    margin:0 0 .5em .5em;    
+    .small; 
+     
+}
+//need to avoid clash with floating 'handing' element, eg commentboxes, etc.
+pre, h2, h3, h4 { clear:right; }
+
+//fixme
+.collapsebox  { clear:right; }
\ No newline at end of file

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/GraphBar.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/GraphBar.less?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/GraphBar.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/GraphBar.less Fri Feb 14 17:24:32 2014
@@ -0,0 +1,73 @@
+/*
+GraphBar
+
+DOM Structure
+(start code)
+    // horizontal bar
+    span.graphBar[style="border-left-width: 85px;"]x
+    span.gBar 150
+
+    // vertical bar
+    div[style="height: 77px; position: relative;"]
+       span.graphBar[style="border-color: rgb(255, 0, 0);
+                    border-bottom-width: 20px;
+                    position: absolute;
+                    width: 20px;
+                    bottom: 0px;]
+       span[style="position: relative; top: 40px;] 20
+
+    // progress bar
+    span.graphBar[style="border-color:red; border-left-width: 20px;"]x
+    span.graphBar[style="border-color:blue; border-left-width: 300px; margin-left: -1ex;"]x
+    span.gBar 100
+(end)
+
+BOOTSTRAP
+(start code)
+    // original DOM-structure
+    div.graphBar-(options)
+        span.gbBar 100 
+
+    //becomes, based on BOOTSTRAP
+    //horizontal bar
+    span.gb-group(.striped.active)[width:125px] 
+      span.gb-bar[style="background:blue;width:40%"]
+    span.gBar 100
+    
+    //vertical bar
+    span.gb-group(.striped.active)(.vertical)[heigh:125px] 
+      span.gb-bar[style="background:blue;height:100%;width:100%"]
+    span.gBar 100
+
+    //progress bar
+    span.gb-group[width:125px] 
+      span.gb-bar[style="background:blue;width:40%"]
+      span.gb-bar[style="background:red;width:60%"]
+    span.gbBar 100
+(end)
+*/
+
+//inherit bootstrap td valign style to avoid text baseline misalignment
+td > .gBar { vertical-align: top; }
+
+.gb-group {
+    .progress;
+    display: inline-block;
+    margin: 0 .5em 0 0;
+    width: 320px; //default size 
+    &.vertical { 
+        width: @line-height-computed;        
+        .gb-bar { width:100%; } 
+    }  
+} 
+.gb-bar { .progress-bar; }
+.striped > .gb-bar { .progress-striped .progress-bar; }
+.active > .gb-bar { .progress.active .progress-bar; }    
+
+ 
+//Repeated styles from bootstrap/progress-bars.less
+//.gb-bar has equal priority, so the order in css matters to overwrite the background-color!
+.progress-bar-success { .progress-bar-variant(@progress-bar-success-bg); }
+.progress-bar-info    { .progress-bar-variant(@progress-bar-info-bg); }
+.progress-bar-warning { .progress-bar-variant(@progress-bar-warning-bg); }
+.progress-bar-danger  { .progress-bar-variant(@progress-bar-danger-bg); }

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/ImagePlugin.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/ImagePlugin.less?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/ImagePlugin.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/ImagePlugin.less Fri Feb 14 17:24:32 2014
@@ -0,0 +1,23 @@
+/*
+Style: ImagePlugin
+
+DOM Structure:
+    (start code)
+    <table border="0" class="imageplugin" align="left|right|center">
+        <tr><td><img src="img.jpg" height="200px" width="200px" /></td></tr>
+    </table>
+    (end)
+*/
+.imageplugin {
+    margin:.5em 0;
+}
+.imageplugin img {
+    border:0;
+}
+.imageplugin caption {
+    font-size:90%;
+}
+.imageplugin * {
+    padding:0;
+    margin:0;
+}
\ No newline at end of file

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/IndexPlugin.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/IndexPlugin.less?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/IndexPlugin.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/IndexPlugin.less Fri Feb 14 17:24:32 2014
@@ -0,0 +1,37 @@
+/*
+Style: IndexPlugin
+
+DOM structure:
+    (start code)
+    div.index
+        div.header
+            a[href="#A"] A 
+            - 
+            a[href="#B"] B 
+            -
+        span.section
+            a[name="A"] A
+        div.body
+            a (, a)
+            
+    (end)
+    
+*/
+.index {
+
+    .header {
+        .btn; .btn-primary;  //also overwrite many .header styles
+        height:auto;    //overwrite .header style
+        font-size:110%;
+        margin-bottom:1em;
+        a { color:inherit; }        
+    }
+ 
+    > .section { display:block; }
+    
+    .section a {
+        .btn; .btn-default;        
+        margin:1em 0 .25em 0; 
+        float:none;
+    }
+}
\ No newline at end of file

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/RecentChangesPlugin.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/RecentChangesPlugin.less?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/RecentChangesPlugin.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/RecentChangesPlugin.less Fri Feb 14 17:24:32 2014
@@ -0,0 +1,25 @@
+/*
+Style: RecentChangesPlugin
+
+DOM structure:
+
+*/
+.recentchanges {
+
+    table-layout:fixed;  // this renders faster
+    .table-hover;
+
+    td {
+        vertical-align:top;
+        //border-bottom:1px solid @light-grey;
+    }
+    td.date {
+        vertical-align:bottom;
+        background-color:@pre-bg;
+    	border-radius: @border-radius-base;        
+        border:none;
+    }
+    tr.odd td {
+        background-color:transparent;
+    }
+}

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/TOCPlugin.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/TOCPlugin.less?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/TOCPlugin.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/TOCPlugin.less Fri Feb 14 17:24:32 2014
@@ -0,0 +1,47 @@
+/*
+Style: TableOfContentsPlugin
+
+    When a TOC plugin is invoked multiple times, only the first one renders the
+    collapsible table of contents box.
+    All subsequent invocations of the TOC plugin render a link to the toc. (a.toc)
+    This link has little use; so we just hide it.
+
+    Typical use-case: have a LeftMenu with a call of the TOC plugin.
+    When the main wiki-page already contains a TOC, the plugin only generates
+    a toc link (a.toc)
+
+DOM structure:
+    (begin)
+    div.toc
+        div.collapsebox
+            b.bullet xpand|clpse
+            h4#section-TOC Table Of Contents
+            div.xpand|clpse
+                ul
+                    li.toclevel-1
+                    li.toclevel-2
+                    li.toclevel-3
+    (end)
+*/
+.toc { 
+    width:60%; 
+    
+    ul { 
+        .list-unstyled;
+        li:hover { background:@dropdown-link-hover-bg; }
+        margin-bottom:0;
+    }
+    .toclevel-1 { padding-left:1.2em }
+    .toclevel-2 { padding-left:2.4em; }
+    .toclevel-3 { padding-left:4.6em; }    
+}
+.sidebar .toc { 
+    width:100%; 
+    .toclevel-1 { padding-left:.25em; }
+    .toclevel-2 { padding-left:.5em; }
+    .toclevel-3 { padding-left:.75em; }    
+}
+
+//Multiple occurrences of the TOC plugin are rendered as links (a.toc)
+a.toc { .hide; }
+

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/TableX.Filter.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/TableX.Filter.less?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/TableX.Filter.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/TableX.Filter.less Fri Feb 14 17:24:32 2014
@@ -0,0 +1,27 @@
+/*
+Dynamic Style: Table Filters
+
+Wiki markup:
+    %%table-filter  ..table.. /%
+
+DOM structure:
+    div.table-filter
+        div.filter-input
+            input[type=search][placeholder=..]
+            a.btn  //predefined filter shortcuts
+        table
+            tr
+                th
+            tr.visible
+                td.highlight  //type.less
+                td
+*/
+.filter-input {
+
+    background:url("@{imagePath}/icon-filter.gif") no-repeat 8px @line-height-computed*1.5;
+
+    padding:@line-height-computed 32px 0 32px;
+    
+    input { width:25%; display:inline; }
+    
+}

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/TableX.Sort.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/TableX.Sort.less?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/TableX.Sort.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/TableX.Sort.less Fri Feb 14 17:24:32 2014
@@ -0,0 +1,47 @@
+/*
+Dynamic Style: Sortable Tables
+
+Wiki markup:
+    %%sortable  ..table.. /%
+
+DOM structure:
+    div.sortable
+        table
+            tr
+                th.sort | th.up | th.down
+            tr
+                td
+                td
+*/
+.sortable {
+
+    th {
+        position:relative;
+        cursor:pointer;
+        padding-right:13px !important; //make room for the up/down arrows
+ 
+        &:hover { background-color: @wiki-hover; }
+        
+        //arrow to indicate the sort-direction
+        &:after {
+            .caret();
+            content:""; //needed to display the caret ico of :after or :before pseudo
+            visibility:hidden;
+        } 
+        &:hover:after { visibility:visible; } 
+
+        &.up:after,
+        &.down:after,
+        &.down:hover:after {
+            visibility:visible;
+            opacity:0.4;  //lighter color for the sorted column
+        }
+        &.up:after  {
+            border-top: 0;
+            border-bottom: @caret-width-base solid; //flip arrow direction
+        }
+
+    }
+
+}
+ 
\ No newline at end of file

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Tabs.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Tabs.less?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Tabs.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Tabs.less Fri Feb 14 17:24:32 2014
@@ -0,0 +1,29 @@
+/*
+Style: TabbedSections, Tabs, Pills
+
+DOM structure:  ( based on Bootstrap conventions, without [data-toggle=tab] )
+(start code)
+    ul.nav.nav-tabs(.nav-pills)
+        li
+            a FirstTab
+        li
+            a SecondTab
+        li
+            a ThirdTab
+
+    div.tab-content
+        div.tab-pane.active[id="FirstTab"] ... 
+        div.tab-pane[id="SecondTab"] ...
+        div.tab-pane[id="ThirdTab"] ...
+(end)
+*/
+
+//inherit from bootstrap/navs.less
+.tab-content { 
+
+    margin-bottom:@line-height-computed; //tabs could use some more bottom margin
+    
+    .tab-pane { .panel-body; } //inherit padding of a panel body
+    
+}  
+ 
\ No newline at end of file

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Attach.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Attach.less?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Attach.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Attach.less Fri Feb 14 17:24:32 2014
@@ -0,0 +1,84 @@
+/*
+Style: Attachments
+
+DOM Structure:
+    (start code)
+    ul.fileupload
+        li
+            input[type="file"][disabled=""][name="file0"][id=""]
+        li
+            a Delete
+            span file-name-1
+            input.done[type="file"][name="file1"][id=""]
+        li
+            a Delete
+            span file-name-2
+            input.done[type="file"][name="file2"][id=""] 
+    (end)
+*/
+
+#uploadform ul.list-group {
+
+    margin-bottom:0; 
+    vertical-align:top;    
+ 
+    //hide the input[type=file] elements, they will be invoke to Form.Upload.js
+    li input[type=file] { 
+        position:absolute; 
+        top:0;
+        right:0;
+        width:100%;height:100%;
+        cursor:pointer;
+        opacity:0; 
+    }
+ 
+    li.droppable {     
+        color: @list-group-active-color;
+        background-color: @list-group-active-bg;
+        border-color: @list-group-active-border;
+        text-align:center;
+        
+        * { color: inherit; }
+
+        &.disabled { .btn.disabled; }
+        
+        &.active { 
+            .progress-striped .progress-bar; 
+            .progress.active .progress-bar; 
+        }
+    }
+    a.delete { position:relative; z-index:2; } //should be on top of the input block
+    b { .label; .label-info; margin-left:1em; }
+    
+}
+
+
+.attachtype {
+    line-height: 1.6;
+    font-size: 11px;
+    padding-left: 20px;
+
+    background-repeat:no-repeat;
+    background-position:0 0;
+    background-image:url("@{imagePath}/attach-strip.png");
+
+}
+
+#attach-gif  { background-position:0 -112px; }
+#attach-png  { background-position:0 -112px; }
+#attach-bmp  { background-position:0 -112px; }
+#attach-jpg  { background-position:0 -112px; }
+#attach-jpeg { background-position:0 -112px; }
+#attach-text { background-position:0 -16px;  }
+#attach-txt  { background-position:0 -16px;  }
+#attach-zip  { background-position:0 -128px; }
+#attach-jar  { background-position:0 -128px; }
+#attach-tar  { background-position:0 -128px; }
+#attach-pdf  { background-position:0 -80px;  }
+#attach-doc  { background-position:0 -32px;  }
+#attach-xls  { background-position:0 -48px;  }
+#attach-ppt  { background-position:0 -64px;  }
+#attach-swf  { background-position:0 -96px;  }
+#attach-mov  { background-position:0 -160px; }
+#attach-mp3  { background-position:0 -144px; }
+#attach-wav  { background-position:0 -144px; }

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Content.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Content.less?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Content.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Content.less Fri Feb 14 17:24:32 2014
@@ -0,0 +1,83 @@
+/*
+Section: Main Content
+    Uses a minimal grid-system to display/hide the sidebar left from the main page container.
+    The sidebar slides in/out at the left, via a css transition, by adding/removing 
+    .active to the main content container. (adding .active, makes the sidebar visible)
+    The div.page element comes first in the DOM tree, before the div.sidebar.
+
+    TODO: [stack sidebar ico small devices]
+
+DOM Structure:
+(start code)
+    div.content[.active]
+        div.page
+        	div.page-content
+        	div.page-footer
+        div.sidebar
+(end)
+*/
+
+.content {
+    position:relative;
+    padding:0;
+    overflow:hidden;
+    clear:both;
+    .clearfix();
+}
+.page, .sidebar {
+    box-sizing: border-box;  // width% now includes border & padding
+   .transition(all 300ms);
+}
+.page {
+    float:right;
+    width:100%;
+}
+.sidebar {
+    float:left;
+    margin-left:-22%;
+    width:22%;
+    overflow-x:hidden;
+}
+ 
+.content.active {
+    .page { width:78%; }
+    .sidebar { margin-left:0; }
+}
+
+.sidebar { background:@wiki-sidebar-bg; } 
+.content { background: @wiki-page-bg; }
+
+.page-content, .sidebar {
+	padding:@padding-base-horizontal;
+	.clearfix;
+	& > h2 { margin-top:0;padding-top:0; } 
+} 
+
+/*
+Section: page-footer
+
+DOM Structure:
+(start code)
+	This page (revision-999) was last changed on
+    a[href="/Diff.jsp?page=Main&amp;r1=634&amp;r2=633"] 17-May-2013 19:36
+    by
+    a.wikipage page-author
+    a.feed[title='RSS feed for page Main'] &nbsp;
+    a.caretup[href="#top"][title="Go to top"] &laquo;
+(end)
+*/
+.page-footer {
+	display:block;
+	padding:.5em 0 0 0;
+    background:@wiki-page-bg;
+    text-align:right;
+}
+
+//reverse direction caret
+.caret-up {
+	.caret;
+    border-top: 0;
+    border-bottom: @caret-width-base solid;
+    content: "";
+}
+ 

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Diff.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Diff.less?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Diff.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Diff.less Fri Feb 14 17:24:32 2014
@@ -0,0 +1,75 @@
+/*
+Style: DiffContent.jsp
+    CSS classes for the DIFF Providers "Traditional" and "External"
+
+DOM Structure:
+Traditional Diff provider
+    (start code)
+    div.collapsebox 
+    h4
+    div.diffbody
+        table.diff
+            tr
+                td.diff
+            tr
+                td.diffadd
+            tr
+                td.diffrem
+(end)
+*/
+
+.diffbody {
+    margin:  (@line-height-computed/2);
+    table { width: 100%; }
+}
+
+/* .diffnote equals .information */
+.diffadd, .diffrem { font-family:@font-family-monospace; }
+.diffadd { background:@wiki-diff-add; }
+.diffrem { background:@wiki-diff-delete; text-decoration:line-through; }
+
+//td.diff    {  } //todo: diff information lines take page background
+
+
+/*
+Contextual Diff Provider
+(start code)
+    div.diffbody
+        div.diffnote
+        div.wikitext
+            ..
+            <br/>
+            a[name=change-1]
+                font[color=xxx]
+                    a.diff-insertion
+                strike
+                    font[color=xxx]
+                        a.diff-deletion    
+            a.diff-nextprev[href=change-2]>>
+            ..
+            a.diff-nextprev[href=change-1]>>
+            a[name=change-2]
+            a.diff-nextprev[href=change-3]>>
+            
+(end)
+*/ 
+.diffnote { margin:  (@line-height-computed/2) 0; }
+
+.diff-wikitext {
+    font-family:@font-family-monospace;
+    overflow:auto;
+    background-color: @pre-bg;
+    white-space:pre;
+
+    a[name^=change] { text-decoration:none; }
+    span { color:@text-color; }
+}
+
+.diff-insertion { background:@wiki-diff-add; }
+.diff-deletion { background:@wiki-diff-delete; }
+.diff-nextprev {
+    .btn;
+    .btn-default;
+    .btn-xs;  //xtra small
+    background:transparent;
+}

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Edit.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Edit.less?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Edit.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Edit.less Fri Feb 14 17:24:32 2014
@@ -0,0 +1,210 @@
+/* +++ 425 Edit/EditContent and CommentContent +++ */
+/*body.edit {
+}
+body.comment {
+}
+#edithelp {
+}*/
+
+input[name=changenote] {
+    display:inline-block; 
+    width:50%;
+}
+
+/* +++ 430 Edit/EditContent +++ */
+.textarea-resizer {
+    background:#eee url("@{imagePath}/resize-horizontal.gif") top center;
+    cursor:s-resize; /* css3 row-resize */
+    font-size:1px;
+    height:6px;
+    line-height:6px;
+    overflow:hidden;
+}
+
+#toolbuttons, #toolextra, #searchbar {
+    margin-left:1em;
+    clear:both;
+}
+#tools span {
+    float:left;
+    display:block;
+    padding:0.25em 0;
+    margin-right:1em;
+}
+#toolbuttons span {
+    border:1px solid #ddd /*#BORDER#*/;
+}
+
+.tool {
+    float:left;
+    margin:2px;
+    display:block;
+    background:transparent;
+    text-decoration: none;
+}
+.tool:hover {
+    background-color:#ddd !important;
+}
+#tools a.tool {
+    border:none;
+    background-repeat:no-repeat;
+    background-image:url("@{imagePath}/editor-strip.gif");
+    background-color:transparent;
+    height:16px;
+    width:16px;
+    text-indent:20px;
+    overflow:hidden;
+}
+
+#tbREDO        { background-position:0 0; width:auto !important;}
+#tbUNDO        { background-position:0 -16px; width:auto !important;}
+
+/*#tbOUTLINE    { background-position:0 0; width:auto !important;}
+#tbOUTLINE    {
+    width:auto !important;
+    background-image:url("images/book_open.png") !important;
+}
+*/
+/*
+label[for="edittoc"] {
+    background-repeat:no-repeat;
+    background-position:center left;
+    xxbackground-image:url("images/editor-strip.gif");
+    background-image:url("images/book_open.png") !important;
+    background-color:transparent;
+    padding:2px 0 2px 20px;
+}
+*/
+#tbH1         { background-position:0 -192px; }
+#tbH2         { background-position:0 -208px; }
+#tbH3         { background-position:0 -224px; }
+#tbB          { background-position:0 -176px; }
+#tbI          { background-position:0 -256px; }
+#tbLink       { background-position:0 -48px; }
+#tbMONO       { background-position:0 -160px; }
+/*
+#tbColor      { background-image:url("images/paintbrush.png");  }
+#tbBackground { background-image:url("images/paintcan.png");  }
+*/
+#tbPRE       { background-position:0 -64px; }
+#tbCODE       { background-position:0 -80px; }
+#tbHR         { background-position:0 -240px; }
+#tbBR         { background-position:0 -112px; }
+#tbDL         { background-position:0 -272px; }
+#tbSUP        { background-position:0 -336px; }
+#tbSUB        { background-position:0 -320px; }
+#tbSTRIKE     { background-position:0 -304px; }
+#tbUL         { background-position:0 -256px; }
+#tbOL         { background-position:0 -272px; }
+#tbLEFT       { background-position:0 -288px; }
+#tbCENTER     { background-position:0 -304px; }
+#tbRIGHT      { background-position:0 -320px; }
+#tbJUST       { background-position:0 -336px; }
+#tbQUOTE      { background-position:0 -272px; }
+#tbIMG        { background-position:0 -96px; }
+#tbTABLE      { background-position:0 -144px; }
+#tbTOC        { background-position:0 -32px; }
+#tbTAB        { background-position:0 -128px; }
+#tbSIGN        { background-position:0 -288px; }
+
+#tbDOREPLACE { background-image:url("@{imagePath}/doreplace.png") !important;  }
+
+.editor {
+    font:110% Monaco, "Courier New", Courier, monospace;
+    padding:4px;
+    width:99%;
+}
+#toctoc {
+    position:relative;
+    margin:0.5em 0;
+}
+#toctoc label {
+    display:block;
+    margin:0;
+    padding:0.5em;
+}
+#toctoc ul {
+    border:3px solid #eee;
+    width:auto;
+    overflow:auto;
+    height:150px;
+    list-style:none;
+    margin:0;
+    padding:0;
+}
+#toctoc a {
+    display:block;
+    padding:0 0.5em;
+    overflow:hidden;
+    white-space:nowrap;
+}
+
+/* ie6 hack ensure moremenu remains properly aligned */
+* html #editorarea {
+    padding:4px 0;
+}
+/*ie7 hack */
+*:first-child+html #editorarea {
+    padding:4px 0;
+}
+#commentcontent, #editcontent {
+    width:100%;
+}
+
+#searchbar {
+    display:block !important;
+}
+#searchbar span {
+    white-space:nowrap;
+}
+/*#searchbarhelp {
+}*/
+#findSuggestionMenu {
+    position:absolute;
+    color:white;
+    background-color:#000;
+    background-color:rgba(0,0,0,0.7);
+    -moz-border-radius:10px;
+    -webkit-border-radius:5px;
+    border-radius:10px;
+    -webkit-box-shadow:0 0 5px rgba(0, 0, 0, 0.5);
+    box-shadow:0 0 5px rgba(0, 0, 0, 0.5);
+    z-index:10;
+    font-size:85%;
+    overflow:hidden;
+}
+/* ie6 hack */
+* html #findSuggestionMenu {
+    background:url("@{imagePath}/tip.png") top left;
+}
+/* ie7 hack */
+*:first-child+html #findSuggestionMenu {
+    background:url("@{imagePath}/tip.png") top left;
+}
+
+#findSuggestionMenu ul {
+    list-style:none;
+    margin:0;
+    padding:0;
+}
+#findSuggestionMenu li {
+    padding:0.25em 0.5em;
+    cursor:pointer;
+}
+#findSuggestionMenu .hover {
+    background-color:#000;
+    background-color:rgba(0,0,0,0.5);
+    -moz-border-radius:5px;
+    -webkit-border-radius:5px;
+    border-radius:5px;
+}
+/* ie6 hack */
+* html #findSuggestionMenu .hover {
+    background-color:black;
+}
+/* ie7 hack */
+*:first-child+html #findSuggestionMenu .hover {
+    background-color:black;
+}
+
+

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Nav.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Nav.less?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Nav.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Nav.less Fri Feb 14 17:24:32 2014
@@ -0,0 +1,48 @@
+/*
+Section: Page Navigation
+	Uses bootstrap styling with navigation pills, and a dropdown-menu.
+
+DOM Structure:
+(start code)
+div.row
+	ul.nav.nav-pills.pull-left
+		li
+			a.logo
+
+	ul.nav.nav-pills.pull-right
+		li.menu 
+			a Menu
+    	li
+    		a Attach
+    	li
+    		a Info
+    	li[.disabled]
+    		a Edit
+    	li
+    		More 
+    		span.caret
+    		ul.dropdown-menu.pull-right
+    			...
+
+(end)
+*/
+.nav .logo {
+    font-family: @font-family-logo;
+    font-weight: 200;
+	letter-spacing: 1px;
+	font-size: 20px;
+	padding-top: 5px;padding-bottom:5px;
+    text-shadow: 1px 1px 3px @white;
+	.transition(all 2s ease);
+	
+	&:hover {
+		background:transparent; //overrule .nav-pills default
+		//font-weight:500;
+        text-shadow: 1px 1px 3px @tooltip-bg;
+
+	}
+}
+
+//More-menu - add padding to unstyled lists, for proper menu look&feel 
+.more-menu ul.list-unstyled { padding: 3px 20px;}	
+

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Preview.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Preview.less?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Preview.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Preview.less Fri Feb 14 17:24:32 2014
@@ -0,0 +1,8 @@
+// also used by the SneakPreview section in plain.jsp
+.preview-content {
+
+    //background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAF0lEQVQIHWNgwAESK2/5YJUanBJApwIAjZ8OAdbRWgIAAAAASUVORK5CYII=) repeat;
+	#gradient .striped(@color: rgba(87,179,215,.05); @angle: 135deg);
+	background-size:10px 10px;
+		
+}

Added: jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Search.less
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Search.less?rev=1568367&view=auto
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Search.less (added)
+++ jspwiki/trunk/jspwiki-war/src/main/styles/haddock/Template.Search.less Fri Feb 14 17:24:32 2014
@@ -0,0 +1,56 @@
+/*
+Style: FindContent.jsp, AJAXSearch.jsp
+
+DOM Structure:
+(start code)
+....
+	div.graphBars
+		div.zebra-table
+			table.wikitable
+				tr
+					th align=left Page
+					th align=left Score
+
+				tr
+		        	td
+		        		a.wikipage[href="..."] result1
+        			td
+        				span.gBar nn
+
+				tr
+					td[colspan=2]
+						div.fragment
+							... span.searchmatch ".."  ...
+
+				tr
+					td.nosearchresult[colspan=2] ...
+
+(end)
+*/
+
+form#searchform2 + div {
+
+	table { .table-condensed; }
+
+	.fragment {
+	    //inherit from bootstrap/code.less
+    	font-family: @font-family-monospace;
+    	font-size:80%;
+	    color: @pre-color;
+    	//white-space:pre;
+    	word-break: break-all;
+	    word-wrap: break-word;
+    	border-radius: @border-radius-base;
+    	
+  		overflow: scroll;
+	}
+	
+	.searchmatch {
+		color: @code-color;
+		background-color:@code-bg;
+	}
+	//.fragment_ellipsis { font-weight:bold; }  CHECKME ? not used anymore
+
+	.nosearchresult { .warning; display:table-cell; }
+
+ }