click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r729253 - in /incubator/click/trunk/click/examples/src/net/sf/click/examples/control: RichTextArea.htm RichTextArea.java
Date Wed, 24 Dec 2008 06:42:08 GMT
Author: sabob
Date: Tue Dec 23 22:42:08 2008
New Revision: 729253

URL: http://svn.apache.org/viewvc?rev=729253&view=rev
Log:
Merge JS include with Java source file

Removed:
    incubator/click/trunk/click/examples/src/net/sf/click/examples/control/RichTextArea.htm
Modified:
    incubator/click/trunk/click/examples/src/net/sf/click/examples/control/RichTextArea.java

Modified: incubator/click/trunk/click/examples/src/net/sf/click/examples/control/RichTextArea.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/net/sf/click/examples/control/RichTextArea.java?rev=729253&r1=729252&r2=729253&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/net/sf/click/examples/control/RichTextArea.java
(original)
+++ incubator/click/trunk/click/examples/src/net/sf/click/examples/control/RichTextArea.java
Tue Dec 23 22:42:08 2008
@@ -19,7 +19,6 @@
 package net.sf.click.examples.control;
 
 import java.text.MessageFormat;
-import java.util.HashMap;
 import java.util.Map;
 
 import net.sf.click.control.TextArea;
@@ -120,11 +119,12 @@
         String[] args = { getContext().getRequest().getContextPath() };
         buffer.append(MessageFormat.format(HTML_IMPORTS, args));
 
-        Map model = new HashMap();
-        model.put("id", getId());
-        model.put("config", getConfig());
-        renderTemplate(buffer, model);
-
+        args = new String[] { getId(), getConfig() };
+        String javascript = "<script type=\"text/javascript\">(function() '{' " +
+            "var myConfig = '{' {1} '}'; var myEditor = new YAHOO.widget.SimpleEditor(''{0}'',
myConfig);" +
+            "if(myConfig.titlebar) '{' myEditor._defaultToolbar.titlebar=myConfig.titlebar;
'}'" +
+            "myEditor.render(); '}')();</script>\n";
+        buffer.append(MessageFormat.format(javascript, args));
         return buffer.toString();
     }
 



Mime
View raw message