Index: src/webdocs/scripts/jspwiki-common.js =================================================================== RCS file: /p/cvs/JSPWiki/src/webdocs/scripts/jspwiki-common.js,v retrieving revision 1.57 diff -u -r1.57 jspwiki-common.js --- src/webdocs/scripts/jspwiki-common.js 4 Dec 2007 20:20:46 -0000 1.57 +++ src/webdocs/scripts/jspwiki-common.js 16 Dec 2007 16:16:20 -0000 @@ -256,7 +256,7 @@ if($('prefTimeZone')) this.prefs.set('TimeZone', $('prefTimeZone').getValue()); if($('prefTimeFormat')) this.prefs.set('DateFormat', $('prefTimeFormat').getValue()); if($('prefOrientation')) this.prefs.set('orientation', $('prefOrientation').getValue()); - //if($('editor')) this.prefs.set('Editor', $('editor').getValue()); /* bug 117 */ + if($('editor')) this.prefs.set('Editor', $('editor').getValue()); /* bug 117 */ this.prefs.set('FontSize',this.PrefFontSize); }, Index: src/com/ecyrd/jspwiki/ui/EditorManager.java =================================================================== RCS file: /p/cvs/JSPWiki/src/com/ecyrd/jspwiki/ui/EditorManager.java,v retrieving revision 1.11 diff -u -r1.11 EditorManager.java --- src/com/ecyrd/jspwiki/ui/EditorManager.java 1 Dec 2007 20:06:52 -0000 1.11 +++ src/com/ecyrd/jspwiki/ui/EditorManager.java 16 Dec 2007 16:16:18 -0000 @@ -20,6 +20,7 @@ package com.ecyrd.jspwiki.ui; import java.net.URL; +import java.text.ParseException; import java.util.*; import javax.servlet.jsp.PageContext; @@ -30,6 +31,7 @@ import org.jdom.JDOMException; import org.jdom.input.SAXBuilder; import org.jdom.xpath.XPath; +import org.json.JSONObject; import com.ecyrd.jspwiki.NoSuchVariableException; import com.ecyrd.jspwiki.WikiContext; @@ -38,6 +40,7 @@ import com.ecyrd.jspwiki.modules.ModuleManager; import com.ecyrd.jspwiki.modules.WikiModuleInfo; import com.ecyrd.jspwiki.plugin.PluginManager; +import com.ecyrd.jspwiki.util.HttpUtil; /** * Defines an editor manager. An editor can be added by adding a @@ -215,8 +218,28 @@ } // Second condition: - // User has set an editor in preferences - // TODO... + // User has set an editor in preferences-cookie + String prefVal = TextUtil.urlDecodeUTF8( HttpUtil.retrieveCookieValue( context.getHttpRequest(), "JSPWikiUserPrefs" ) ); // TODO constance + if( prefVal != null ) + { + try + { + JSONObject jo = new JSONObject( prefVal ); + editor = jo.getString("Editor"); // TODO constance + if (editor != null && editor.trim().length() != 0) + { + // Editor existst + if (m_editors.containsKey(editor) == true) + { + return editor; + } + } + } + catch( Exception e ) + { + // do nothing -> use the default editor + } + } // Third condition: // use the default editor in jspwiki.properties Index: src/webdocs/UserPreferences.jsp =================================================================== RCS file: /p/cvs/JSPWiki/src/webdocs/UserPreferences.jsp,v retrieving revision 1.41 diff -u -r1.41 UserPreferences.jsp --- src/webdocs/UserPreferences.jsp 12 Aug 2007 19:39:43 -0000 1.41 +++ src/webdocs/UserPreferences.jsp 16 Dec 2007 16:16:18 -0000 @@ -14,6 +14,13 @@ <%@ page errorPage="/Error.jsp" %> <%@ taglib uri="/WEB-INF/jspwiki.tld" prefix="wiki" %> + <% + response.setDateHeader ("Expires", 0); + response.setHeader ("Pragma", "no-cache"); + if (request.getProtocol().equals ("HTTP/1.1")) { + response.setHeader ("Cache-Control", "no-cache"); + } +%> <%! Logger log = Logger.getLogger("JSPWiki"); %>