Hi devs !
I thought about adding some changes in Events and Activity Stream.
First of all, I want to remove all the listeners from Activity Stream
and make this class listen to AllEvent, making it capable of cathcing
all events that occur in the wiki (and this way, when adding a new
event, you wouldn't need any modifications to this class in order to
catch it).
Secondly, I would like to modify onEvent function in the class so that
it uses the simpleClassName of the event occurred in order to log the
event (the eventType would be this simpleClassName...for example
DocumentSavedEvent, AnnotationAddedEvent and so on).
And thirdly i thought about adding one field in AbstractFilterableEvent
called /identifier/ and make all events extend directly this class. And
that /identifier/ would be used in a different way by the events
themselves. But it would be used to retrieve infos about that events.
And so, when logging an event, we could use classname + identifier.
For example
AnnotationAddedEvent + "This is my annotation" .
CommentAddedEvent + "This is my comment" or the number of the comment.
WDYT ?
Stefan
On Fri, Nov 12, 2010 at 4:29 PM, Ecaterina Moraru (Valica)
<valicac(a)gmail.com> wrote:
> On Thu, Nov 4, 2010 at 18:34, jvelociter
> <platform-notifications(a)xwiki.org>wrote:
>
>> Author: jvelociter
>> Date: 2010-11-04 17:34:35 +0100 (Thu, 04 Nov 2010)
>> New Revision: 32479
>>
>> Added:
>>
>> platform/web/trunk/standard/src/main/webapp/resources/uicomponents/widgets/list/
>>
>> platform/web/trunk/standard/src/main/webapp/resources/uicomponents/widgets/list/xlist.js
>> Modified:
>>
>> platform/web/trunk/standard/src/main/webapp/resources/js/xwiki/suggest/ajaxSuggest.css
>>
>> platform/web/trunk/standard/src/main/webapp/resources/js/xwiki/suggest/ajaxSuggest.js
>>
>> platform/web/trunk/standard/src/main/webapp/resources/js/xwiki/widgets/jumpToPage.js
>> Â platform/web/trunk/standard/src/main/webapp/resources/js/xwiki/xwiki.js
>>
>> platform/web/trunk/standard/src/main/webapp/resources/uicomponents/viewers/tags.js
>> Â platform/web/trunk/standard/src/main/webapp/templates/javascript.vm
>> Â platform/web/trunk/standard/src/main/webapp/templates/tagedit.vm
>>
>> platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/XWikiGroupSheet.xml
>>
>> platform/xwiki-applications/trunk/officeimporter/src/main/resources/XWiki/OfficeImporter.xml
>> Log:
>> XWIKI-5648 New visual design for the AJAX suggest module
>> XWIKI-5649 CSS classes to support automatic users and groups suggestions on
>> field input
>> XWIKI-3655 Clean the JS code of the ajax suggest - Continued work
>> XWIKI-5105 When several suggest are used on the same page, suggests results
>> interfer from one field to another - Fixed
>>
>> + some formatting on xwiki.js
>>
>>
>>
>> Modified:
>> platform/web/trunk/standard/src/main/webapp/resources/js/xwiki/suggest/ajaxSuggest.css
>> ===================================================================
>> ---
>> platform/web/trunk/standard/src/main/webapp/resources/js/xwiki/suggest/ajaxSuggest.css
>> Â Â Â 2010-11-04 15:22:54 UTC (rev 32478)
>> +++
>> platform/web/trunk/standard/src/main/webapp/resources/js/xwiki/suggest/ajaxSuggest.css
>> Â Â Â 2010-11-04 16:34:35 UTC (rev 32479)
>> @@ -1,167 +1,60 @@
>> -body
>> -{
>> - Â Â Â position: relative;
>> -}
>> +#template('colorThemeInit.vm')
>>
>> -div.ajaxsuggest
>> -{
>> - Â Â Â position: absolute;
>> - Â Â Â background-image: url(suggest_img/as_pointer.gif);
>> - Â Â Â background-position: top;
>> - Â Â Â background-repeat: no-repeat;
>> - Â Â Â padding: 10px 0 0 0;
>> -z-index: 100013;
>> +.xhover {
>> + Â Â Â background:red;
>> Â }
>>
>> -div.ajaxsuggest div.as_header,
>> -div.ajaxsuggest div.as_footer
>> -{
>> - Â Â Â position: relative;
>> - Â Â Â height: 6px;
>> - Â Â Â padding: 0 6px;
>> - Â Â Â background-image: url(suggest_img/ul_corner_tr.gif);
>> - Â Â Â background-position: top right;
>> - Â Â Â background-repeat: no-repeat;
>> - Â Â Â overflow: hidden;
>> +input[type="text"].suggest {
>> + Â border-width: 1px;
>> Â }
>> -div.ajaxsuggest div.as_footer
>> -{
>> - Â Â Â background-image: url(suggest_img/ul_corner_br.gif);
>> -}
>>
>> -div.ajaxsuggest div.as_header div.as_corner,
>> -div.ajaxsuggest div.as_footer div.as_corner
>> -{
>> - Â Â Â position: absolute;
>> - Â Â Â top: 0;
>> - Â Â Â left: 0;
>> - Â Â Â height: 6px;
>> - Â Â Â width: 6px;
>> - Â Â Â background-image: url(suggest_img/ul_corner_tl.gif);
>> - Â Â Â background-position: top left;
>> - Â Â Â background-repeat: no-repeat;
>> -}
>> -div.ajaxsuggest div.as_footer div.as_corner
>> -{
>> - Â Â Â background-image: url(suggest_img/ul_corner_bl.gif);
>> -}
>> -div.ajaxsuggest div.as_header div.as_bar,
>> -div.ajaxsuggest div.as_footer div.as_bar
>> -{
>> - Â Â Â height: 6px;
>> - Â Â Â overflow: hidden;
>> - Â Â Â background-color: #333;
>> -}
>> -
>> -
>> -div.ajaxsuggest ul
>> -{
>> - Â Â Â list-style: none;
>> - Â Â Â margin: 0 0 -4px 0;
>> - Â Â Â padding: 0;
>> - Â Â Â overflow: hidden;
>> - Â Â Â background-color: #333;
>> -}
>> -
>> -div.ajaxsuggest ul li
>> -{
>> - Â Â Â color: #ccc;
>> - Â Â Â padding: 0;
>> - Â Â Â margin: 0 4px 4px;
>> - Â Â Â text-align: left;
>> -}
>> -
>> -div.ajaxsuggest ul li a
>> -{
>> - Â Â Â color: #ccc;
>> - Â Â Â display: block;
>> - Â Â Â text-decoration: none;
>> - Â Â Â background-color: transparent;
>> +body {
>> Â Â Â Â position: relative;
>> - Â Â Â padding: 0;
>> - Â Â Â width: 100%;
>> Â }
>> -div.ajaxsuggest ul li a:hover
>> -{
>> - Â Â Â background-color: #444;
>> -}
>> -div.ajaxsuggest ul li.as_highlight a:hover
>> -{
>> - Â Â Â background-color: #1B5CCD;
>> -}
>>
>> -div.ajaxsuggest ul li a span
>> -{
>> - Â Â Â display: block;
>> - Â Â Â padding: 3px 6px;
>> - Â Â Â font-weight: bold;
>> +div.suggestItems {
>> + Â position:absolute;
>> + Â border: 1px solid $theme.borderColor;
>> + Â border-top: none;
>> + Â background: white; /* theme color ? */
>> + Â z-index: 100013;
>> + Â text-align:left;
>> Â }
>>
>> -div.ajaxsuggest ul li a span small
>> -{
>> - Â Â Â font-weight: normal;
>> - Â Â Â color: #fff;
>> +div.suggestItems ul {
>> + Â margin: 0px;
>> Â }
>>
>> -div.ajaxsuggest ul li.as_highlight a span small
>> -{
>> - Â Â Â color: #ccc;
>> +ul.suggestList {
>> + Â margin:0px !important;
>> + Â text-transform:none;
>> + Â color:$theme.textColor;
>> + Â font-weight:normal;
>> Â }
>>
>> -div.ajaxsuggest ul li.as_highlight a
>> -{
>> - Â Â Â color: #fff;
>> - Â Â Â background-color: #1B5CCD;
>> - Â Â Â background-image: url(suggest_img/hl_corner_br.gif);
>> - Â Â Â background-position: bottom right;
>> - Â Â Â background-repeat: no-repeat;
>> +ul.suggestList .xhighlight {
>> + Â Â background-color: $theme.highlightColor;
>> Â }
>>
>> -div.ajaxsuggest ul li.as_highlight a span
>> -{
>> - Â Â Â background-image: url(suggest_img/hl_corner_bl.gif);
>> - Â Â Â background-position: bottom left;
>> - Â Â Â background-repeat: no-repeat;
>> +div.suggestItemName {
>> + Â Â text-indent: 0;
>> Â }
>>
>> -div.ajaxsuggest ul li a .tl,
>> -div.ajaxsuggest ul li a .tr
>> -{
>> - Â Â Â background-repeat: no-repeat;
>> - Â Â Â width: 6px;
>> - Â Â Â height: 6px;
>> - Â Â Â position: absolute;
>> - Â Â Â top: 0;
>> - Â Â Â padding: 0;
>> - Â Â Â margin: 0;
>> +div.suggestItemInfo {
>> + Â Â color: #556677;
>> + Â Â font-size: 0.8em;
>> + Â Â padding-left: 20px;
>> + Â Â text-indent: 0;
>> Â }
>> -div.ajaxsuggest ul li a .tr
>> -{
>> - Â Â Â right: 0;
>> -}
>>
>> -div.ajaxsuggest ul li.as_highlight a .tl
>> -{
>> - Â Â Â left: 0;
>> - Â Â Â background-image: url(suggest_img/hl_corner_tl.gif);
>> - Â Â Â background-position: bottom left;
>> +div.suggestItemName,
>> +div.suggestItemInfo {
>> + Â Â text-decoration: inherit;
>> Â }
>>
>> -div.ajaxsuggest ul li.as_highlight a .tr
>> -{
>> - Â Â Â right: 0;
>> - Â Â Â background-image: url(suggest_img/hl_corner_tr.gif);
>> - Â Â Â background-position: bottom right;
>> +.highlight {
>> + Â background-color: $theme.highlightColor;
>> + Â font-weight:bold;
>> + Â text-decoration: inherit;
>> Â }
>>
>> -div.ajaxsuggest ul em
>> -{
>> - Â Â Â font-style: normal;
>> - Â Â Â color: #6EADE7;
>> -}
>> -
>> -div.ajaxsuggest ul li.as_warning
>> -{
>> - Â Â Â font-weight: bold;
>> - Â Â Â text-align: center;
>> -}
>>
>> Modified:
>> platform/web/trunk/standard/src/main/webapp/resources/js/xwiki/suggest/ajaxSuggest.js
>> ===================================================================
>> ---
>> platform/web/trunk/standard/src/main/webapp/resources/js/xwiki/suggest/ajaxSuggest.js
>> Â Â Â 2010-11-04 15:22:54 UTC (rev 32478)
>> +++
>> platform/web/trunk/standard/src/main/webapp/resources/js/xwiki/suggest/ajaxSuggest.js
>> Â Â Â 2010-11-04 16:34:35 UTC (rev 32479)
>> @@ -2,6 +2,12 @@
>>
>> Â var widgets = XWiki.widgets = XWiki.widgets || {};
>>
>> + if (typeof widgets.XList == 'undefined') {
>> + Â if (typeof console != "undefined" && typeof console.warn == "function")
>> {
>> + Â Â console.warn("[Suggest widget] Required class missing:
>> XWiki.widgets.XList");
>> + Â }
>> + } else {
>> +
>> Â /**
>> Â * Suggest class.
>> Â * Provide value suggestions to users when starting to type in a text
>> input.
>> @@ -18,7 +24,7 @@
>> Â Â className : "ajaxsuggest",
>> Â Â timeout : 2500,
>> Â Â delay : 500,
>> - Â Â offsety : -5,
>> + Â Â offsety : 0,
>> Â Â // Display a "no results" message, or simply hide the suggest box when
>> no suggestions are available
>> Â Â shownoresults : true,
>> Â Â // The message to display as the "no results" message
>> @@ -26,6 +32,7 @@
>> Â Â maxheight : 250,
>> Â Â cache : false,
>> Â Â seps : "",
>> + Â Â icon : null,
>> Â Â // The name of the JSON variable or XML element holding the results.
>> Â Â // "results" for the old suggest, "searchResults" for the REST search.
>> Â Â resultsParameter : "results",
>> @@ -59,8 +66,8 @@
>> Â Â Â return false;
>> Â Â }
>>
>> - Â Â // parameters object
>> - Â Â Object.extend(this.options, param || { });
>> + Â Â // Clone default options from the prototype so that they are not
>> shared and extend options with passed parameters
>> + Â Â this.options = Object.extend(Object.clone(this.options), param || {
>> });
>>
>> Â Â // Reset the container if the configured parameter is not valid
>> Â Â if (!$(this.options.parentContainer)) {
>> @@ -127,7 +134,7 @@
>> Â Â * value inside the target field, Escape closes the suggest dropdown, Up
>> and Down move the current selection.
>> Â Â */
>> Â onKeyPress: function(event) {
>> - Â Â if(!$(this.idAs)) {
>> + Â Â if(!$(this.suggest)) {
>> Â Â Â // Let the key events pass through if the UI is not displayed
>> Â Â Â return;
>> Â Â }
>> @@ -136,7 +143,7 @@
>> Â Â switch(key) {
>> Â Â Â case Event.KEY_RETURN:
>> Â Â Â Â if(this.aSuggestions.length == 1) {
>> - Â Â Â Â Â this.setHighlight(1);
>> + Â Â Â Â Â this.highlightFirst();
>> Â Â Â Â }
>> Â Â Â Â this.setHighlightedValue();
>> Â Â Â Â Event.stop(event);
>> @@ -234,7 +241,7 @@
>> Â Â Â requestHeaders: headers,
>> Â Â Â onSuccess: this.setSuggestions.bindAsEventListener(this),
>> Â Â Â onFailure: function (response) {
>> - Â Â Â Â alert("AJAX error: " + response.statusText);
>> + Â Â Â Â new XWiki.widgets.Notification("Failed to retrieve suggestions :
>> ')" + response.statusText, "error", {timeout: 5});
>> Â Â Â }
>> Â Â });
>> Â },
>> @@ -281,8 +288,6 @@
>> Â Â Â }
>>
>> Â Â }
>> -
>> - Â Â this.idAs = "as_"+this.fld.id;
>> Â Â this.createList(this.aSuggestions);
>> Â },
>>
>> @@ -298,8 +303,8 @@
>> Â Â // get rid of old list
>> Â Â // and clear the list removal timeout
>> Â Â //
>> - Â Â if ($(this.idAs)) {
>> - Â Â Â $(this.idAs).remove();
>> + Â Â if (this.suggest && this.suggest.parentNode) {
>> + Â Â Â this.suggest.remove();
>> Â Â }
>> Â Â this.killTimeout();
>>
>> @@ -309,69 +314,46 @@
>>
>> Â Â // create holding div
>> Â Â //
>> - Â Â var div = new Element("div", {
>> - Â Â Â id: this.idAs,
>> - Â Â Â className: this.options.className
>> + Â Â var div = new Element("div", { 'class': "suggestItems "+
>> this.options.className });
>> +
>> + Â Â // create and populate list
>> + Â Â var list = new XWiki.widgets.XList([], {
>> + Â Â Â icon: this.options.icon,
>> + Â Â Â classes: 'suggestList',
>> + Â Â Â eventListeners: {
>> + Â Â Â Â Â 'click' : function () { pointer.setHighlightedValue(); return
>> false; },
>> + Â Â Â Â Â 'mouseover' : function () { pointer.setHighlight(
>> this.getElement() ); }
>> + Â Â Â }
>> Â Â });
>>
>> - Â Â var hcorner = new Element("div", {className: "as_corner"});
>> - Â Â var hbar = new Element("div", {className: "as_bar"});
>> - Â Â var header = new Element("div", {className: "as_header"});
>> - Â Â header.appendChild(hcorner);
>> - Â Â header.appendChild(hbar);
>> - Â Â div.appendChild(header);
>> -
>> - Â Â // create and populate ul
>> - Â Â var ul = new Element("ul", {id: "as_ul"});
>> -
>> Â Â // loop throught arr of suggestions
>> - Â Â // creating an LI element for each suggestion
>> + Â Â // creating an XlistItem for each suggestion
>> Â Â //
>> Â Â for (var i=0;i<arr.length;i++)
>> Â Â {
>> Â Â Â // format output with the input enclosed in a EM element
>> Â Â Â // (as HTML, not DOM)
>> Â Â Â //
>> - Â Â Â var val = arr[i].value;
>> - Â Â Â var st = val.toLowerCase().indexOf( this.sInput.toLowerCase() );
>> - Â Â Â var output = val.substring(0,st) + "<em>" + val.substring(st,
>> st+this.sInput.length) + "</em>" + val.substring(st+this.sInput.length);
>> -
>> + Â Â Â var val = arr[i].value, st = val.toLowerCase().indexOf(
>> this.sInput.toLowerCase() );
>> + Â Â Â var output = val.substring(0,st) + "<span class='highlight'>" +
>> val.substring(st, st+this.sInput.length) + "</span>" +
>> val.substring(st+this.sInput.length);
>> Â Â Â var span = new Element("span").update(output);
>>
>> - Â Â Â var a = new Element("a", {href: "#"});
>> + Â Â Â var item = new XWiki.widgets.XListItem( span , {
>> + Â Â Â Â containerClasses: 'suggestItem',
>> + Â Â Â Â value: arr[i].value,
>> + Â Â Â Â noHighlight: true // we do the highlighting ourselves
>> + Â Â Â });
>>
>> - Â Â Â var tl = new Element("span", {className:"tl"}).update(" ");
>> - Â Â Â var tr = new Element("span", {className:"tr"}).update(" ");
>> - Â Â Â a.appendChild(tl);
>> - Â Â Â a.appendChild(tr);
>> -
>> - Â Â Â a.appendChild(span);
>> -
>> - Â Â Â a.name = i+1;
>> - Â Â Â a.onclick = function () { pointer.setHighlightedValue(); return
>> false; }
>> - Â Â Â a.onmouseover = function () { pointer.setHighlight(this.name); }
>> -
>> -    var li  = new Element("li").update(a);
>> -
>> - Â Â Â ul.appendChild( li );
>> + Â Â Â list.addItem(item);
>> Â Â }
>>
>> Â Â // no results
>> Â Â if (arr.length == 0)
>> Â Â {
>> - Â Â Â var li = new Element("li",
>> {className:"as_warning"}).update(this.options.noresults);
>> -
>> - Â Â Â ul.appendChild( li );
>> + Â Â Â list.addItem( new XWiki.widgets.XListItem(this.options.noresults,
>> {'classes' : 'noSuggestion'}))
>> Â Â }
>> - Â Â div.appendChild( ul );
>> + Â Â div.appendChild( list.getElement() );
>>
>> - Â Â var fcorner = new Element("div", {className: "as_corner"});
>> - Â Â var fbar = new Element("div", {className: "as_bar"});
>> - Â Â var footer = new Element("div", {className: "as_footer"});
>> - Â Â footer.appendChild(fcorner);
>> - Â Â footer.appendChild(fbar);
>> - Â Â div.appendChild(footer);
>> -
>> Â Â // get position of target textfield
>> Â Â // position holding div below it
>> Â Â // set width of holding div to width of field
>> @@ -388,7 +370,8 @@
>> Â Â div.onmouseout = function(){ pointer.resetTimeout() }
>>
>> Â Â // add DIV to document
>> - Â Â $(this.options.parentContainer).appendChild(div);
>> + Â Â $(this.options.parentContainer).insert(div);
>> + Â Â this.suggest = div;
>>
>> Â Â // currently no item is highlighted
>> Â Â this.iHighlighted = 0;
>> @@ -405,23 +388,30 @@
>> Â Â */
>> Â changeHighlight: function(key)
>> Â {
>> - Â Â var list = $("as_ul");
>> + Â Â var list = this.suggest.down('ul');
>> Â Â if (!list)
>> Â Â Â return false;
>>
>> Â Â var n;
>>
>> - Â Â if (key == 40)
>> - Â Â Â n = this.iHighlighted + 1;
>> - Â Â else if (key == 38)
>> - Â Â Â n = this.iHighlighted - 1;
>> + Â Â if (this.iHighlighted) {
>> + Â Â Â if (key == 40)
>> + Â Â Â Â elem = this.iHighlighted.next();
>> + Â Â Â else if (key == 38)
>> + Â Â Â Â elem = this.iHighlighted.previous();
>> + Â Â }
>> + Â Â else {
>> + Â Â Â if (key == 40)
>> + Â Â Â Â elem = list.down('li');
>> + Â Â Â else if (key == 38)
>> + Â Â Â Â if (list.select('li') > 0) {
>> + Â Â Â Â Â elem = list.select('li')[list.select('li').length];
>> + Â Â Â Â }
>> + Â Â }
>>
>> - Â Â if (n > list.childNodes.length)
>> - Â Â Â n = list.childNodes.length;
>> - Â Â if (n < 1)
>> - Â Â Â n = 1;
>> -
>> - Â Â this.setHighlight(n);
>> + Â Â if (typeof elem != 'undefined') {
>> + Â Â Â this.setHighlight(elem);
>> + Â Â }
>> Â },
>>
>> Â /**
>> @@ -429,18 +419,14 @@
>> Â Â *
>> Â Â * @param {Object} n
>> Â Â */
>> - Â setHighlight: function(n)
>> + Â setHighlight: function(highlightedItem)
>> Â {
>> - Â Â var list = $("as_ul");
>> - Â Â if (!list)
>> - Â Â Â return false;
>> -
>> - Â Â if (this.iHighlighted > 0)
>> + Â Â if (this.iHighlighted)
>> Â Â Â this.clearHighlight();
>>
>> - Â Â this.iHighlighted = Number(n);
>> + Â Â highlightedItem.addClassName("xhighlight");
>>
>> - Â Â list.childNodes[this.iHighlighted-1].className = "as_highlight";
>> + Â Â this.iHighlighted = highlightedItem;
>>
>> Â Â this.killTimeout();
>> Â },
>> @@ -450,14 +436,19 @@
>> Â Â */
>> Â clearHighlight: function()
>> Â {
>> - Â Â var list = $("as_ul");
>> - Â Â if (!list)
>> - Â Â Â return false;
>> + Â Â if (this.iHighlighted) {
>> + Â Â Â this.iHighlighted.removeClassName("xhighlight");
>> + Â Â Â delete this.iHighlighted;
>> + Â Â }
>> + Â },
>>
>> - Â Â if (this.iHighlighted > 0)
>> - Â Â {
>> - Â Â Â list.childNodes[this.iHighlighted-1].className = "";
>> - Â Â Â this.iHighlighted = 0;
>> + Â highlightFirst: function()
>> + Â {
>> + Â Â if (this.suggest && this.suggest.down('ul')) {
>> + Â Â Â var first = this.suggest.down('ul').down('li');
>> + Â Â Â if (first) {
>> + Â Â Â Â this.setHighlight(first);
>> + Â Â Â }
>> Â Â }
>> Â },
>>
>> @@ -466,7 +457,7 @@
>> Â Â if (this.iHighlighted)
>> Â Â {
>> Â Â Â if(this.sInput == "" && this.fld.value == "")
>> - Â Â Â Â this.sInput = this.fld.value = this.aSuggestions[
>> this.iHighlighted-1 ].value;
>> + Â Â Â Â this.sInput = this.fld.value =
>> this.iHighlighted.down(".value").innerHTML;
>> Â Â Â else {
>> Â Â Â Â if(this.seps) {
>> Â Â Â Â Â Â var lastIndx = -1;
>> @@ -474,15 +465,15 @@
>> Â Â Â Â Â Â Â if(this.fld.value.lastIndexOf(this.seps.charAt(i)) > lastIndx)
>> Â Â Â Â Â Â Â Â lastIndx = this.fld.value.lastIndexOf(this.seps.charAt(i));
>> Â Â Â Â Â Â if(lastIndx == -1)
>> - Â Â Â Â Â Â Â this.sInput = this.fld.value = this.aSuggestions[
>> this.iHighlighted-1 ].value;
>> + Â Â Â Â Â Â Â this.sInput = this.fld.value =
>> this.iHighlighted.down(".value").innerHTML;
>> Â Â Â Â Â Â else
>> Â Â Â Â Â Â {
>> - Â Â Â Â Â Â Â this.fld.value = this.fld.value.substring(0, lastIndx+1) +
>> this.aSuggestions[ this.iHighlighted-1 ].value;
>> + Â Â Â Â Â Â Â this.fld.value = this.fld.value.substring(0, lastIndx+1) +
>> this.iHighlighted.down(".value").innerHTML;
>> Â Â Â Â Â Â Â Â this.sInput = this.fld.value.substring(lastIndx+1);
>> Â Â Â Â Â Â }
>> Â Â Â Â }
>> Â Â Â Â else
>> - Â Â Â Â Â this.sInput = this.fld.value = this.aSuggestions[
>> this.iHighlighted-1 ].value;
>> + Â Â Â Â Â this.sInput = this.fld.value =
>> this.iHighlighted.down(".value").innerHTML;
>> Â Â Â }
>>
>> Â Â Â Event.fire(this.fld, "xwiki:suggest:selected");
>> @@ -537,12 +528,13 @@
>> Â Â */
>> Â clearSuggestions: function() {
>> Â Â this.killTimeout();
>> - Â Â var ele = $(this.idAs);
>> + Â Â var ele = $(this.suggest);
>> Â Â var pointer = this;
>> Â Â if (ele) {
>> Â Â Â var fade = new Effect.Fade(ele, {duration: "0.25", afterFinish :
>> function() {
>> - Â Â Â Â if($(pointer.idAs)) {
>> - Â Â Â Â Â $(pointer.idAs).remove();
>> + Â Â Â Â if($(pointer.suggest)) {
>> + Â Â Â Â Â $(pointer.suggest).remove();
>> + Â Â Â Â Â delete pointer.suggest;
>> Â Â Â Â }
>> Â Â Â }});
>> Â Â }
>> @@ -550,6 +542,8 @@
>>
>> Â });
>>
>> + }
>> +
>> Â return XWiki;
>>
>> Â })(XWiki || {});
>>
>> Modified:
>> platform/web/trunk/standard/src/main/webapp/resources/js/xwiki/widgets/jumpToPage.js
>> ===================================================================
>> ---
>> platform/web/trunk/standard/src/main/webapp/resources/js/xwiki/widgets/jumpToPage.js
>> Â Â Â Â 2010-11-04 15:22:54 UTC (rev 32478)
>> +++
>> platform/web/trunk/standard/src/main/webapp/resources/js/xwiki/widgets/jumpToPage.js
>> Â Â Â Â 2010-11-04 16:34:35 UTC (rev 32479)
>> @@ -57,6 +57,7 @@
>> Â Â Â Â // Prefixed with & since the current (as of 1.7) Suggest code does
>> not automatically append it.
>> Â Â Â Â varname: "q",
>> Â Â Â Â noresults: "Document not found",
>> + Â Â Â Â icon: "${xwiki.getSkinFile('icons/silk/page_white_text.gif')}",
>> Â Â Â Â json: true,
>> Â Â Â Â resultsParameter : "searchResults",
>> Â Â Â Â resultId : "id",
>>
>> Modified:
>> platform/web/trunk/standard/src/main/webapp/resources/js/xwiki/xwiki.js
>> ===================================================================
>> --- platform/web/trunk/standard/src/main/webapp/resources/js/xwiki/xwiki.js
>> Â Â 2010-11-04 15:22:54 UTC (rev 32478)
>> +++ platform/web/trunk/standard/src/main/webapp/resources/js/xwiki/xwiki.js
>> Â Â 2010-11-04 16:34:35 UTC (rev 32479)
>> @@ -537,55 +537,55 @@
>> Â },
>>
>> Â cookies: {
>> - Â Â Â /**
>> - Â Â Â Â * Create a cookie, with or without expiration date.
>> - Â Â Â Â *
>> - Â Â Â Â * @param name Name of the cookie.
>> - Â Â Â Â * @param value Value of the cookie.
>> - Â Â Â Â * @param days Days to keep the cookie (can be null).
>> - Â Â Â Â * @return
>> - Â Â Â Â */
>> - Â Â Â create: function(name,value,days) {
>> - Â Â Â Â Â if (days) {
>> - Â Â Â Â Â Â Â var date = new Date();
>> - Â Â Â Â Â Â Â date.setTime(date.getTime()+(days*24*60*60*1000));
>> - Â Â Â Â Â Â Â var expires = "; expires="+date.toGMTString();
>> - Â Â Â Â Â }
>> - Â Â Â Â Â else var expires = "";
>> - Â Â Â Â Â document.cookie = name+"="+value+expires+"; path=/";
>> - Â Â Â },
>> + Â Â /**
>> + Â Â * Create a cookie, with or without expiration date.
>> + Â Â *
>> + Â Â * @param name Name of the cookie.
>> + Â Â * @param value Value of the cookie.
>> + Â Â * @param days Days to keep the cookie (can be null).
>> + Â Â * @return
>> + Â Â */
>> + Â Â create: function(name,value,days) {
>> + Â Â Â Â if (days) {
>> + Â Â Â Â Â Â var date = new Date();
>> + Â Â Â Â Â Â date.setTime(date.getTime()+(days*24*60*60*1000));
>> + Â Â Â Â Â Â var expires = "; expires="+date.toGMTString();
>> + Â Â Â Â }
>> + Â Â Â Â else var expires = "";
>> + Â Â Â Â document.cookie = name+"="+value+expires+"; path=/";
>> + Â Â },
>>
>> - Â Â Â /**
>> - Â Â Â Â * Read a cookie.
>> - Â Â Â Â *
>> - Â Â Â Â * @param name Name of the cookie.
>> - Â Â Â Â * @return Value for the given cookie.
>> - Â Â Â Â */
>> - Â Â Â read:function(name) {
>> - Â Â Â Â Â var nameEQ = name + "=";
>> - Â Â Â Â Â var ca = document.cookie.split(';');
>> - Â Â Â Â Â for(var i=0;i < ca.length;i++) {
>> - Â Â Â Â Â Â Â var c = ca[i];
>> - Â Â Â Â Â Â Â while (c.charAt(0)==' ') {
>> - Â Â Â Â Â Â Â Â Â c = c.substring(1,c.length);
>> - Â Â Â Â Â Â Â }
>> - Â Â Â Â Â Â Â if (c.indexOf(nameEQ) == 0) {
>> - Â Â Â Â Â Â Â Â Â return c.substring(nameEQ.length,c.length);
>> - Â Â Â Â Â Â Â }
>> - Â Â Â Â Â }
>> - Â Â Â Â Â return null;
>> - Â Â Â },
>> + Â Â /**
>> + Â Â * Read a cookie.
>> + Â Â *
>> + Â Â * @param name Name of the cookie.
>> + Â Â * @return Value for the given cookie.
>> + Â Â */
>> + Â Â read:function(name) {
>> + Â Â Â Â var nameEQ = name + "=";
>> + Â Â Â Â var ca = document.cookie.split(';');
>> + Â Â Â Â for(var i=0;i < ca.length;i++) {
>> + Â Â Â Â Â Â var c = ca[i];
>> + Â Â Â Â Â Â while (c.charAt(0)==' ') {
>> + Â Â Â Â Â Â Â Â c = c.substring(1,c.length);
>> + Â Â Â Â Â Â }
>> + Â Â Â Â Â Â if (c.indexOf(nameEQ) == 0) {
>> + Â Â Â Â Â Â Â Â return c.substring(nameEQ.length,c.length);
>> + Â Â Â Â Â Â }
>> + Â Â Â Â }
>> + Â Â Â Â return null;
>> + Â Â },
>>
>> - Â Â Â /**
>> - Â Â Â Â * Erase a cookie.
>> - Â Â Â Â *
>> - Â Â Â Â * @param name Name of the cookie to erase.
>> - Â Â Â Â * @return
>> - Â Â Â Â */
>> - Â Â Â erase:function(name) {
>> - Â Â Â Â Â XWiki.cookies.create(name,"",-1);
>> - Â Â Â }
>> -
>> + Â Â /**
>> + Â Â * Erase a cookie.
>> + Â Â *
>> + Â Â * @param name Name of the cookie to erase.
>> + Â Â * @return
>> + Â Â */
>> + Â Â erase:function(name) {
>> + Â Â Â Â XWiki.cookies.create(name,"",-1);
>> + Â Â }
>> +
>> Â },
>>
>> Â /**
>> @@ -1337,27 +1337,57 @@
>> Â /**
>> Â * Small JS improvement, which suggests document names (doc.fullName) when
>> typing in an input.
>> Â *
>> - * To activate this behavior on an input elements, add the
>> "suggestDocuments" classname to it.
>> + * To activate this behavior on an input elements, add one of the
>> following classname to it :
>> + * <ul>
>> + * <li><tt>suggestDocuments</tt> to suggest from any available
>> document</li>
>> + * <li><tt>suggestUsers</tt> to suggest from documents that contains user
>> objects</li>
>> + * <li><tt>suggestGroups</tt> to suggest from documents that contains
>> group objects</li>
>> + * </ul>
>> Â */
>> Â document.observe('xwiki:dom:loaded', function() {
>> - Â if (typeof(XWiki.widgets.Suggest) != "undefined") {
>> - Â Â $$("input.suggestDocuments").each(function(item) {
>> - Â Â Â // Create the Suggest.
>> - Â Â Â new XWiki.widgets.Suggest(item, {
>> - Â Â Â Â // This document also provides the suggestions.
>> - Â Â Â Â script:
>> XWiki.Document.getRestSearchURL("scope=name&number=10&media=json&"),
>> - Â Â Â Â varname: "q",
>> - Â Â Â Â noresults: "Document not found",
>> - Â Â Â Â json: true,
>> - Â Â Â Â resultsParameter : "searchResults",
>> - Â Â Â Â resultId : "id",
>> - Â Â Â Â resultValue : "pageFullName",
>> - Â Â Â Â resultInfo : "pageFullName",
>> - Â Â Â Â timeout : 30000,
>> - Â Â Â Â parentContainer : item.up()
>> - Â Â Â });
>> - Â Â });
>> - Â }
>> + Â Â var suggestionsMapping = {
>> + Â Â Â Â "documents" : {
>> + Â Â Â Â Â Â script:
>> XWiki.Document.getRestSearchURL("scope=name&number=10&media=json&"),
>> + Â Â Â Â Â Â varname: "q",
>> + Â Â Â Â Â Â icon: "$xwiki.getSkinFile('icons/silk/page_white_text.gif')",
>> + Â Â Â Â Â Â noresults: "Document not found",
>> + Â Â Â Â Â Â json: true,
>> + Â Â Â Â Â Â resultsParameter : "searchResults",
>> + Â Â Â Â Â Â resultId : "id",
>> + Â Â Â Â Â Â resultValue : "pageFullName",
>> + Â Â Â Â Â Â resultInfo : "pageFullName"
>> + Â Â Â Â },
>> + Â Â Â Â "users" : {
>> + Â Â Â Â Â Â script: XWiki.currentDocument.getURL('get',
>> 'xpage=uorgsuggest&classname=XWiki.XWikiUsers&wiki=local&uorg=user&'),
>> + Â Â Â Â Â Â varname: "input",
>> + Â Â Â Â Â Â icon: "$xwiki.getSkinFile('icons/silk/user.gif')",
>> + Â Â Â Â Â Â noresults: "User not found",
>> + Â Â Â Â },
>> + Â Â Â Â "groups" : {
>> + Â Â Â Â Â Â script: XWiki.currentDocument.getURL('get',
>> 'xpage=uorgsuggest&classname=XWiki.XWikiGroups&wiki=local&uorg=group&'),
>> + Â Â Â Â Â Â varname: "input",
>> + Â Â Â Â Â Â icon: "$xwiki.getSkinFile('icons/silk/group.gif')",
>> + Â Â Â Â Â Â noresults: "Group not found",
>> + Â Â Â Â }
>> + Â Â };
>> + Â Â if (typeof(XWiki.widgets.Suggest) != "undefined") {
>> + Â Â Â var keys = Object.keys(suggestionsMapping);
>> + Â Â Â for (var i=0;i<keys.length;i++) {
>> + Â Â Â Â var selector = 'input.suggest' + keys[i].capitalize();
>> + Â Â Â Â $$(selector).each(function(item) {
>> + Â Â Â Â Â if (!item.hasClassName('initialized')) {
>> + Â Â Â Â Â Â var options = {
>> + Â Â Â Â Â Â Â timeout : 30000,
>> + Â Â Â Â Â Â Â parentContainer : item.up()
>> + Â Â Â Â Â Â };
>> + Â Â Â Â Â Â Object.extend(options, suggestionsMapping[keys[i]]);
>> + Â Â Â Â Â Â // Create the Suggest.
>> + Â Â Â Â Â Â var suggest = new XWiki.widgets.Suggest(item, options);
>> + Â Â Â Â Â Â item.addClassName('initialized');
>> + Â Â Â Â Â }
>> + Â Â Â Â });
>> + Â Â Â }
>> + Â Â }
>> Â });
>>
>> Â /**
>>
>> Modified:
>> platform/web/trunk/standard/src/main/webapp/resources/uicomponents/viewers/tags.js
>> ===================================================================
>> ---
>> platform/web/trunk/standard/src/main/webapp/resources/uicomponents/viewers/tags.js
>> Â 2010-11-04 15:22:54 UTC (rev 32478)
>> +++
>> platform/web/trunk/standard/src/main/webapp/resources/uicomponents/viewers/tags.js
>> Â 2010-11-04 16:34:35 UTC (rev 32479)
>> @@ -157,7 +157,8 @@
>> Â Â Â script: "${xwiki.getURL('Main.WebHome', 'view',
>> 'xpage=suggest&classname=XWiki.TagClass&fieldname=tags&firCol=-&secCol=-')}&",
>> Â Â Â varname: 'input',
>> Â Â Â seps:
>> "${xwiki.getDocument('XWiki.TagClass').xWikiClass.tags.getProperty('separators').value}",
>> - Â Â Â shownoresults : false
>> + Â Â Â shownoresults : false,
>> + Â Â Â icon: "${xwiki.getSkinFile('icons/silk/tag_yellow.gif')}"
>> Â Â });
>> Â }
>> Â });
>>
>> Added:
>> platform/web/trunk/standard/src/main/webapp/resources/uicomponents/widgets/list/xlist.js
>> ===================================================================
>> ---
>> platform/web/trunk/standard/src/main/webapp/resources/uicomponents/widgets/list/xlist.js
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â (rev 0)
>> +++
>> platform/web/trunk/standard/src/main/webapp/resources/uicomponents/widgets/list/xlist.js
>> Â Â 2010-11-04 16:34:35 UTC (rev 32479)
>> @@ -0,0 +1,126 @@
>> +/**
>> + * Usage :
>> + *
>> + * var xlist = new XWiki.widgets.XList(
>> + *    [ // array of initial list elements  (or just content it works too
>> + * Â Â Â Â new XWiki.widgets.XListItem( "A first element" ),
>> + * Â Â Â Â new XWiki.widgets.XListItem( "A second element", {'value' :
>> '10'} ),
>> + * Â Â Â Â "A third item passed as string content",
>> + * Â Â Â Â new Element("blink").update('An hip-hop item passed as DOM
>> element')
>> + * Â Â Â ],
>> + * Â Â Â { // options
>> + * Â Â Â Â numbered: false,
>> + * Â Â Â Â icon: "$xwiki.getSkinFile('icons/silk/sport_basketball.gif')",
>> + * Â Â Â Â classes : "myListExtraClass",
>> + * Â Â Â Â itemClasses : "myListItemExtraClasses",
>> + * Â Â Â Â eventListeners : {
>> + * Â Â Â Â Â // Event listeners defined for each of this list items.
>> + * Â Â Â Â Â // listeners call backs are bound to the list item object
>> (XWiki.widgets.XListItem) from which they emerge
>> + * Â Â Â Â Â 'click' : function() { console.log('clicked !', this); },
>> + * Â Â Â Â Â 'mouseover' : function() { console.log('mouse over !', this);
>> }
>> + * Â Â Â Â }
>> + * Â Â Â });
>> + *
>> + * $('insertionNode').insert( xlist.getElement() );
>> + *
>> + * xlist.addItem(
>> + * Â new XWiki.widgets.XListItem('A fifth element added later', {
>> + * Â Â icon : "$xwiki.getSkinFile('icons/silk/bomb.gif')", // this
>> overrides the one defined for the whole list
>> + * Â Â eventListeners: {
>> + * Â Â Â // Event listeners defined just for this specific list item
>> + * Â Â Â 'mouseout' : function() { console.log('just this list item is
>> bound to this event', this); }
>> + * Â Â }
>> + * Â })
>> + * );
>> + *
>> + */
>> +
>> +var XWiki = function(XWiki){
>> +
>> + Â Â var widgets = XWiki.widgets = XWiki.widgets || {};
>> +
>> + Â Â widgets.XList = Class.create({
>> + Â Â Â Â initialize: function(items, options) {
>> + Â Â Â Â Â this.items = items || [];
>> + Â Â Â Â Â this.options = options || {}
>> + Â Â Â Â Â this.listElement = new Element(this.options.ordered ? "ol" :
>> "ul", {
>> + Â Â Â Â Â Â 'class' : 'xlist' + (this.options.classes ? (' ' +
>> this.options.classes) : ''),
>> + Â Â Â Â Â });
>> + Â Â Â Â Â if (this.items && this.items.length > 0) {
>> + Â Â Â Â Â Â for (var i=0;i<this.items.length;i++) {
>> + Â Â Â Â Â Â Â this.addItem(this.items[i]);
>> + Â Â Â Â Â Â }
>> + Â Â Â Â Â }
>> + Â Â Â Â },
>> + Â Â Â Â addItem: function(item){ /* future: position (top, N) */
>> + Â Â Â Â Â if (!item || !(item instanceof XWiki.widgets.XListItem)) {
>> + Â Â Â Â Â Â item = new XWiki.widgets.XListItem(item);
>> + Â Â Â Â Â }
>> + Â Â Â Â Â var listItemElement = item.getElement();
>> + Â Â Â Â Â if (this.options.itemClasses &&
>> !this.options.itemClasses.blank()) {
>> + Â Â Â Â Â Â listItemElement.addClassName(this.options.itemClasses);
>> + Â Â Â Â Â }
>> + Â Â Â Â Â this.listElement.insert(listItemElement);
>> + Â Â Â Â Â if (typeof this.options.eventListeners == 'object') {
>> + Â Â Â Â Â Â item.bindEventListeners(this.options.eventListeners);
>> + Â Â Â Â Â }
>> + Â Â Â Â Â if (this.options.icon && !this.options.icon.blank()) {
>> + Â Â Â Â Â Â item.setIcon(this.options.icon,
>> this.options.overrideItemIcon);
>> + Â Â Â Â Â }
>> + Â Â Â Â Â item.list = this; // associate list item to this XList
>> + Â Â Â Â },
>> + Â Â Â Â getElement: function() {
>> + Â Â Â Â Â return this.listElement;
>> + Â Â Â Â }
>> + Â Â });
>> +
>> + Â Â widgets.XListItem = Class.create({
>> + Â Â Â Â initialize: function(content, options) {
>> + Â Â Â Â Â this.options = options || {};
>> + Â Â Â Â Â var classes = 'xitem' + (this.options.noHighlight ? '' : '
>> xhighlight');
>> + Â Â Â Â Â classes += this.options.classes ? this.options.classes: '';
>> + Â Â Â Â Â this.containerElement = new Element("div", {'class':
>> 'xitemcontainer'}).insert(content || '');
>> + Â Â Â Â Â this.containerElement.addClassName(this.options.containerClasses
>> || '');
>> + Â Â Â Â Â this.containerElement.setStyle({textIndent: '0px'});
>> + Â Â Â Â Â if (this.options.value) {
>> + Â Â Â Â Â Â this.containerElement.insert(new Element('div',
>> {'class':'hidden value'}).insert(this.options.value));
>> + Â Â Â Â Â }
>> + Â Â Â Â Â this.listItemElement = new Element("li", {'class' :
>> classes}).update( this.containerElement );
>> + Â Â Â Â Â if (this.options.icon && !this.options.icon.blank()) {
>> + Â Â Â Â Â Â this.setIcon(this.options.icon);
>> + Â Â Â Â Â Â this.hasIcon = true;
>> + Â Â Â Â Â }
>> + Â Â Â Â Â if (typeof this.options.eventListeners == 'object') {
>> + Â Â Â Â Â Â this.bindEventListeners(this.options.eventListeners);
>> + Â Â Â Â Â }
>> + Â Â Â Â },
>> + Â Â Â Â getElement: function() {
>> + Â Â Â Â Â return this.listItemElement;
>> + Â Â Â Â },
>> + Â Â Â Â setIcon: function(icon, override) {
>> + Â Â Â Â Â if (!this.hasIcon || override) {
>> + Â Â Â Â Â Â this.iconImage = new Image();
>> + Â Â Â Â Â Â this.iconImage.onload = function(){
>> + Â Â Â Â Â Â Â Â this.listItemElement.setStyle({
>> + Â Â Â Â Â Â Â Â Â backgroundImage: "url(" + this.iconImage.src + ")",
>> + Â Â Â Â Â Â Â Â Â backgroundRepeat: 'no-repeat',
>> + Â Â Â Â Â Â Â Â });
>> + Â Â Â Â Â Â Â Â this.listItemElement.down(".xitemcontainer").setStyle({
>> + Â Â Â Â Â Â Â Â Â textIndent:(this.iconImage.width + 5) + 'px',
>> + Â Â Â Â Â Â Â Â Â height: this.iconImage.height + 'px'
>> + Â Â Â Â Â Â Â Â });
>>
>
> We need to make some standard classes for those types of icons: page, tags,
> groups, etc and use those classes instead (search, suggest, activity, trees,
> etc)
> Not so nice that the image is put in style, is gonna break the wcag. Also,
> for this type of images (like the one in action menu) we have a
> background-position: 0 3px.
We already have a class option for xitem, that we could use for
suggestGroups, suggestUsers, etc. classes, but still this "icon" is
valid in my opinion, not all developers will want to define classes
for everything (for example your icon name could be retrieved
dynamically, etc.)
Does the WCAG validate dynamic DOM changes like suggest ?
Jerome.
>
> Thanks,
> Caty
>
>
>
>> + Â Â Â Â Â Â }.bind(this)
>> + Â Â Â Â Â Â this.iconImage.src = icon;
>> + Â Â Â Â Â }
>> + Â Â Â Â },
>> + Â Â Â Â bindEventListeners: function(eventListeners) {
>> + Â Â Â Â Â var events = Object.keys(eventListeners);
>> + Â Â Â Â Â for (var i=0;i<events.length;i++) {
>> + Â Â Â Â Â Â this.listItemElement.observe(events[i],
>> eventListeners[events[i]].bind(this));
>> + Â Â Â Â Â }
>> + Â Â Â Â },
>> + Â Â });
>> +
>> + Â Â return XWiki;
>> +
>> +}(XWiki || {});
>> \ No newline at end of file
>>
>> Modified:
>> platform/web/trunk/standard/src/main/webapp/templates/javascript.vm
>> ===================================================================
>> --- platform/web/trunk/standard/src/main/webapp/templates/javascript.vm
>> 2010-11-04 15:22:54 UTC (rev 32478)
>> +++ platform/web/trunk/standard/src/main/webapp/templates/javascript.vm
>> 2010-11-04 16:34:35 UTC (rev 32479)
>> @@ -1,7 +1,7 @@
>> Â ##
>> Â ## CSS files related to JS libraries.
>> Â ##
>> -<link href="$xwiki.getSkinFile("js/xwiki/suggest/ajaxSuggest.css")"
>> rel="stylesheet" type="text/css" />
>> +<link href="$xwiki.getSkinFile("js/xwiki/suggest/ajaxSuggest.css", true)"
>> rel="stylesheet" type="text/css" />
>> Â <link href="$xwiki.getSkinFile("js/xwiki/lightbox/lightbox.css", true)"
>> rel="stylesheet" type="text/css" />
>> Â <!--[if IE]>
>> Â <link href="$xwiki.getSkinFile("js/xwiki/lightbox/lightboxIE.css", true)"
>> rel="stylesheet" type="text/css" />
>> @@ -19,9 +19,10 @@
>> Â $xwiki.jsfx.use('uicomponents/widgets/confirmedAjaxRequest.js', true)
>> Â $xwiki.jsfx.use('uicomponents/widgets/notification.js', true)
>> Â $xwiki.ssfx.use('uicomponents/widgets/notification.css', true)
>> +$xwiki.jsfx.use('uicomponents/widgets/list/xlist.js')
>> +$xwiki.jsfx.use('js/xwiki/suggest/ajaxSuggest.js')
>> Â <script type="text/javascript"
>> src="$xwiki.getSkinFile("js/prototype/prototype.js")"></script>
>> Â <script type="text/javascript"
>> src="$xwiki.getSkinFile("js/xwiki/xwiki.js", true)"></script>
>> -<script type="text/javascript"
>> src="$xwiki.getSkinFile("js/xwiki/suggest/ajaxSuggest.js")"></script>
>> Â <script type="text/javascript">
>> Â // <![CDATA[
>> Â XWiki.webapppath = "${xwiki.webAppPath}";
>>
>> Modified: platform/web/trunk/standard/src/main/webapp/templates/tagedit.vm
>> ===================================================================
>> --- platform/web/trunk/standard/src/main/webapp/templates/tagedit.vm
>> Â 2010-11-04 15:22:54 UTC (rev 32478)
>> +++ platform/web/trunk/standard/src/main/webapp/templates/tagedit.vm
>> Â 2010-11-04 16:34:35 UTC (rev 32479)
>> @@ -93,7 +93,7 @@
>> Â Â #set($seps =
>> $xwiki.getDocument("XWiki.TagClass").xWikiClass.tags.getProperty('separators').value)
>> Â Â <dl>
>> Â Â <dt><label for="tags">$msg.get("core.tagedit.title")</label></dt>
>> - Â Â <dd><input type="text" id="tags" name="tags" onfocus="new
>> XWiki.widgets.Suggest(this, {script:'$script', varname: 'input',
>> seps:'$seps', offsety: 13} );" value="$!tdoc.tags"/></dd>
>> + Â Â <dd><input type="text" id="tags" name="tags" onfocus="new
>> XWiki.widgets.Suggest(this, {script:'$script', varname: 'input',
>> seps:'$seps', offsety: 13,
>> icon:'${xwiki.getSkinFile('icons/silk/tag_yellow.gif')}'"} );"
>> value="$!tdoc.tags"/></dd>
>> Â Â </dl>
>> Â #end
>> Â #end
>>
>> Modified:
>> platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/XWikiGroupSheet.xml
>> ===================================================================
>> ---
>> platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/XWikiGroupSheet.xml
>> Â Â Â 2010-11-04 15:22:54 UTC (rev 32478)
>> +++
>> platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/XWikiGroupSheet.xml
>> Â Â Â 2010-11-04 16:34:35 UTC (rev 32479)
>> @@ -11,15 +11,15 @@
>> Â <customClass></customClass>
>> Â <contentAuthor>XWiki.Admin</contentAuthor>
>> Â <creationDate>1242173909000</creationDate>
>> -<date>1242173909000</date>
>> -<contentUpdateDate>1242173909000</contentUpdateDate>
>> +<date>1288812724000</date>
>> +<contentUpdateDate>1288812724000</contentUpdateDate>
>> Â <version>1.1</version>
>> Â <title></title>
>> Â <template></template>
>> Â <defaultTemplate></defaultTemplate>
>> Â <validationScript></validationScript>
>> Â <comment></comment>
>> -<minorEdit>false</minorEdit>
>> +<minorEdit>true</minorEdit>
>> Â <syntaxId>xwiki/2.0</syntaxId>
>> Â <hidden>false</hidden>
>> Â <object>
>> @@ -159,10 +159,12 @@
>>
>> Â Â Â Â Â Â if (uorg == "user") {
>> Â Â Â Â Â Â Â suggesturl += "&uorg=user&";
>> + Â Â Â Â Â Â Â icon = "$xwiki.getSkinFile('icons/silk/user.gif')";
>> Â Â Â Â Â Â } else {
>> Â Â Â Â Â Â Â suggesturl += "&uorg=group&";
>> + Â Â Â Â Â Â Â icon = "$xwiki.getSkinFile('icons/silk/group.gif')";
>> Â Â Â Â Â Â }
>> - Â Â Â Â Â Â return new XWiki.widgets.Suggest(input, { script: suggesturl,
>> varname:'input' });
>> + Â Â Â Â Â Â return new XWiki.widgets.Suggest(input, { script: suggesturl,
>> varname:'input', icon:icon });
>> Â Â Â Â Â },
>> Â Â Â Â Â addNewMember: function(uorg, input) {
>> Â Â Â Â Â Â if (input) {
>>
>> Modified:
>> platform/xwiki-applications/trunk/officeimporter/src/main/resources/XWiki/OfficeImporter.xml
>> ===================================================================
>> ---
>> platform/xwiki-applications/trunk/officeimporter/src/main/resources/XWiki/OfficeImporter.xml
>> Â Â Â Â 2010-11-04 15:22:54 UTC (rev 32478)
>> +++
>> platform/xwiki-applications/trunk/officeimporter/src/main/resources/XWiki/OfficeImporter.xml
>> Â Â Â Â 2010-11-04 16:34:35 UTC (rev 32479)
>> @@ -338,7 +338,8 @@
>> Â Â if (typeof(XWiki.widgets.Suggest) != "undefined") {
>> Â Â Â new XWiki.widgets.Suggest(field, {
>> Â Â Â Â script: "$suggestDoc.URL?xpage=plain&type=" + type +
>> "&number=" + number + "&",
>> - Â Â Â });
>> + Â Â Â Â icon: "$xwiki.getSkinFile('icons/silk/folder.gif')"
>> + Â Â Â });
>> Â Â }
>> Â }
>>
>> XWiki.officeImporter.addAutoSuggest(document.getElementById("targetSpaceInputId"),
>> "spaces", 5);
>>
>> _______________________________________________
>> notifications mailing list
>> notifications(a)xwiki.org
>> http://lists.xwiki.org/mailman/listinfo/notifications
>>
> _______________________________________________
> devs mailing list
> devs(a)xwiki.org
> http://lists.xwiki.org/mailman/listinfo/devs
>
Hi,
On Nov 12, 2010, at 2:19 AM, sdumitriu (SVN) wrote:
> Author: sdumitriu
> Date: 2010-11-12 02:19:09 +0100 (Fri, 12 Nov 2010)
> New Revision: 32741
>
> Modified:
> platform/web/trunk/standard/src/main/webapp/templates/menuview.vm
> Log:
> XE-750: Ability to send a link to a page by email
> Enabled the Share menu entry in non-Colibri skins
>
> Modified: platform/web/trunk/standard/src/main/webapp/templates/menuview.vm
> ===================================================================
> --- platform/web/trunk/standard/src/main/webapp/templates/menuview.vm 2010-11-12 01:14:31 UTC (rev 32740)
> +++ platform/web/trunk/standard/src/main/webapp/templates/menuview.vm 2010-11-12 01:19:09 UTC (rev 32741)
> @@ -136,6 +136,10 @@
> #if($canImport)
> #submenuitem($xwiki.getURL('XWiki.OfficeImporter', 'view') $msg.get('core.menu.create.pageFromOffice') 'tmActionImport')
> #end
> + #if (!$isGuest)
> + #submenuitem($doc.getURL('view', 'viewer=share') $msg.get('core.menu.share') 'tmActionShare', '')
> + $xwiki.jsx.use('XWiki.SharePage')
> + #end
Again the share this page should be an extension of the platform and thus the menu entry should be there only if the share application (or whatever app it's included with) is available.
WDYT?
Thanks
-Vincent
> #xwikitopmenuentryend()
> #if($canDelete && $keyboardShortcutsEnabled)
> <script type="text/javascript">
Hi,
I've worked on a livetable generator and livetable macro which allows to
generate the livetable configuration directly from the XWiki class.
http://code.xwiki.org/xwiki/bin/view/Macros/LiveTableMacro20Macro
It would be great if some devs could look at it, as it could be a good
candidate for inclusion in the platform as it would ease creating
livetables.
The current problematic parts are:
1/ A hack was made for translations as changes to the livetable macros
were necessary to allow to use the Pretty Names automatically instead of
translations
2/ It would be great to not even have to give the fields to use in the
LiveTable and use the information from the class where a checkbox could
be added for each field saying "include in default livetable"
This would be a good step towards full CRUD in XWiki. Now that we have
Templates, we could add a place in the Wiki where all documents can be
browser per class (using this livetable). We would just need a slightly
simpler Class Editor which hide the more difficult configurations from
classes.
The more important work is to support Class Sheets that don't need the
include macro to be used for documents that have an object of this
class, and a modification of the inline mode which could disappear.
Ludovic
--
Ludovic Dubost
Blog: http://blog.ludovic.org/
XWiki: http://www.xwiki.com
Skype: ldubost GTalk: ldubost
On Nov 11, 2010, at 8:25 PM, sdumitriu (SVN) wrote:
> Author: sdumitriu
> Date: 2010-11-11 20:25:14 +0100 (Thu, 11 Nov 2010)
> New Revision: 32725
>
> Added:
> platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/ExternalServletURLFactory.java
> Log:
> XWIKI-5681: New URLFactory that always generates external URLs
> Done.
>
> Added: platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/ExternalServletURLFactory.java
> ===================================================================
> --- platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/ExternalServletURLFactory.java (rev 0)
> +++ platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/ExternalServletURLFactory.java 2010-11-11 19:25:14 UTC (rev 32725)
> @@ -0,0 +1,55 @@
> +/*
> + * See the NOTICE file distributed with this work for additional
> + * information regarding copyright ownership.
> + *
> + * This is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU Lesser General Public License as
> + * published by the Free Software Foundation; either version 2.1 of
> + * the License, or (at your option) any later version.
> + *
> + * This software is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with this software; if not, write to the Free
> + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
> + * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
> + *
> + */
> +package com.xpn.xwiki.web;
> +
> +import java.net.URL;
> +
> +import com.xpn.xwiki.XWikiContext;
> +
> +/**
> + * URL Factory which always prints the absolute (external) form of URLs.
> + *
> + * @version $Id$
Missing @since tags.
Thanks
-Vincent
[snip]
Hi XWiki Devs,
I've been performing some XWiki demos recently and it came to my attention
that when adding a comment to a page and then going back to the homepage, my
comments didn't show up in the recent activity section of the dashboard.
This is due to the fact that adding a comment is considered a minor event.
This behavior is still taking place in the most recent versions of XWiki
Enterprise (I tested a XE 2.7 snapshot this morning). I believe that
comments should be treated as major events, the same way that adding an
object or an annotation to a page is.
Therefore I propose making adding a comment a major event instead of a minor
one.
Here's my +1 for this.
Thanks,
Guillaume
Apology for cross posting.
Can someone point me to where in the XWiki code I could implement an
extended XWiki link syntax? E.g. if I'd like to handle something like
this:
Berlin is a city in [[locatedIn::Germany>>Germany]]
where I'm adding the double-colon syntax before the usual link info.
--
Mark Wallace
Principal Engineer, Semantic Applications
Modus Operandi, Melbourne, FL, USA