jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brus...@apache.org
Subject svn commit: r645111 - in /incubator/jspwiki/trunk/src/webdocs: scripts/jspwiki-common.js scripts/jspwiki-edit.js templates/default/commonheader.jsp
Date Sat, 05 Apr 2008 15:03:59 GMT
Author: brushed
Date: Sat Apr  5 08:03:58 2008
New Revision: 645111

URL: http://svn.apache.org/viewvc?rev=645111&view=rev
Log:
[JSPWIKI-209] Remove hard-coded reference to Edit.jsp, to accommodate with different URL provide
scheme's.

Modified:
    incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-common.js
    incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-edit.js
    incubator/jspwiki/trunk/src/webdocs/templates/default/commonheader.jsp

Modified: incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-common.js
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-common.js?rev=645111&r1=645110&r2=645111&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-common.js (original)
+++ incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-common.js Sat Apr  5 08:03:58 2008
@@ -216,7 +216,7 @@
 
 	onPageLoad: function(){
 
-		var meta = ['wikiPageName','wikiJsonUrl','wikiPageUrl','wikiBaseUrl','wikiUserName','wikiTemplateUrl']
+		var meta = ['wikiPageName','wikiJsonUrl','wikiPageUrl','wikiEditUrl','wikiBaseUrl','wikiUserName','wikiTemplateUrl']
 		$$('meta').each(function(el){
 			var n = el.getProperty('name');
 			if( meta.contains(n) ) this[n.substr(4)] = el.getProperty('content');
@@ -833,11 +833,14 @@
 	onPageLoad: function(){
 		if( $("previewcontent") || !Wiki.PermissionEdit ) return;	
 
+		var url = Wiki.EditUrl;
+		url = url + (url.contains('?') ? '&' : '?') + 'section=';
+
 		$$('#pagecontent *[id^=section]').each(function(el,i){
 			new Element('span',{
 				'class':'editsection'
 			}).adopt( new Element('a', {
-				'href' : 'Edit.jsp?page=' + Wiki.PageName + '&section=' + i,
+				'href' : url+i,
 				'title' : 'quick.edit.title'.localize(el.getText())
 				}).setHTML('quick.edit'.localize()) 
 			).inject(el);

Modified: incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-edit.js
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-edit.js?rev=645111&r1=645110&r2=645111&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-edit.js (original)
+++ incubator/jspwiki/trunk/src/webdocs/scripts/jspwiki-edit.js Sat Apr  5 08:03:58 2008
@@ -487,6 +487,7 @@
 		this.addSelector("( all )",-1);
 	},
 	addSelector: function(text,offset,indent){
+		text = text.replace(/~([^~])/g, '$1'); /*remove wiki-markup escape char ~ */
 		this.selector.offsets.push(offset);
 		this.selector.adopt( 
 			new Element('li').adopt(

Modified: incubator/jspwiki/trunk/src/webdocs/templates/default/commonheader.jsp
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/templates/default/commonheader.jsp?rev=645111&r1=645110&r2=645111&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/templates/default/commonheader.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/templates/default/commonheader.jsp Sat Apr  5 08:03:58
2008
@@ -47,6 +47,7 @@
 
 <meta name="wikiBaseUrl" content='<wiki:BaseURL />' />
 <meta name="wikiPageUrl" content='<wiki:Link format="url" absolute="true" page="#$%"/>'
/>
+<meta name="wikiEditUrl" content='<wiki:EditLink format="url" />' />
 <meta name="wikiJsonUrl" content='<%=  WikiContext.findContext(pageContext).getURL(
WikiContext.NONE, "JSON-RPC" ) %>' /><%--unusual pagename--%>
 <meta name="wikiPageName" content='<wiki:Variable var="pagename" />' /><%--pagename
without blanks--%>
 <meta name="wikiUserName" content='<wiki:UserName />' />



Mime
View raw message