aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-11 19:14:32 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-11 19:14:32 +0000
commitd3334ef71b8e71e0db6c463436555f406941d5c9 (patch)
treecd4109bcc0d7abf2528cf5940e6c132c3e98b01a /mod
parent982d56d370ba021e17a6e8548cdeb26345a89380 (diff)
downloadelgg-d3334ef71b8e71e0db6c463436555f406941d5c9.tar.gz
elgg-d3334ef71b8e71e0db6c463436555f406941d5c9.tar.bz2
Implemented sticky forms.
git-svn-id: http://code.elgg.org/elgg/trunk@5368 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
-rw-r--r--mod/tinymce/views/default/input/longtext.php44
1 files changed, 24 insertions, 20 deletions
diff --git a/mod/tinymce/views/default/input/longtext.php b/mod/tinymce/views/default/input/longtext.php
index 2907e1322..1ab7df1ff 100644
--- a/mod/tinymce/views/default/input/longtext.php
+++ b/mod/tinymce/views/default/input/longtext.php
@@ -3,33 +3,37 @@
/**
* Elgg long text input with the tinymce text editor intacts
* Displays a long text input field
- *
+ *
* @package ElggTinyMCE
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Curverider Ltd
* @copyright Curverider Ltd 2008-2010
* @link http://elgg.org/
- *
+ *
* @uses $vars['value'] The current value, if any
* @uses $vars['js'] Any Javascript to enter into the input tag
* @uses $vars['internalname'] The name of the input field
- *
+ *
*/
global $tinymce_js_loaded;
-
+
+ if (!isset($vars['value']) || $vars['value'] === FALSE) {
+ $vars['value'] = elgg_get_sticky_value($vars['internalname']);
+ }
+
$input = rand(0,9999);
-
+
if (!isset($tinymce_js_loaded)) $tinymce_js_loaded = false;
if (!$tinymce_js_loaded) {
-
+
?>
<!-- include tinymce -->
<script language="javascript" type="text/javascript" src="<?php echo $vars['url']; ?>mod/tinymce/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<!-- intialise tinymce, you can find other configurations here http://wiki.moxiecode.com/examples/tinymce/installation_example_01.php -->
<script language="javascript" type="text/javascript">
- tinyMCE.init({
+tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "safari,spellchecker,autosave,fullscreen,preview,paste",
@@ -44,28 +48,28 @@
theme_advanced_path : true,
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|style],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
setup : function(ed) {
- // Add a custom button
- //ed.addButton('more', {
- // title : 'more',
- // image : '<?php echo $vars['url']; ?>mod/tinymce/graphics/more.gif',
- // onclick : function() {
- // ed.selection.setContent('{{more}}');
- // }
- //});
-
- //show the number of words
+ // Add a custom button
+ //ed.addButton('more', {
+ // title : 'more',
+ // image : '<?php echo $vars['url']; ?>mod/tinymce/graphics/more.gif',
+ // onclick : function() {
+ // ed.selection.setContent('{{more}}');
+ // }
+ //});
+
+ //show the number of words
ed.onLoadContent.add(function(ed, o) {
var strip = (tinyMCE.activeEditor.getContent()).replace(/(&lt;([^&gt;]+)&gt;)/ig,"");
var text = " Word count:" + strip.split(' ').length;
tinymce.DOM.setHTML(tinymce.DOM.get(tinyMCE.activeEditor.id + '_path_row'), text);
});
-
+
ed.onKeyUp.add(function(ed, e) {
var strip = (tinyMCE.activeEditor.getContent()).replace(/(&lt;([^&gt;]+)&gt;)/ig,"");
var text = " Word count:" + strip.split(' ').length;
tinymce.DOM.setHTML(tinymce.DOM.get(tinyMCE.activeEditor.id + '_path_row'), text);
});
- }
+ }
});
function toggleEditor(id) {
if (!tinyMCE.get(id))
@@ -82,7 +86,7 @@ else
?>
<!-- show the textarea -->
-<textarea class="input_textarea" name="<?php echo $vars['internalname']; ?>" <?php echo $vars['js']; ?>><?php echo htmlentities($vars['value'], null, 'UTF-8'); ?></textarea>
+<textarea class="input_textarea" name="<?php echo $vars['internalname']; ?>" <?php echo $vars['js']; ?>><?php echo htmlentities($vars['value'], null, 'UTF-8'); ?></textarea>
<div class="toggle_editor_container"><a class="toggle_editor" href="javascript:toggleEditor('<?php echo $vars['internalname']; ?>');"><?php echo elgg_echo('tinymce:remove'); ?></a></div>
<script type="text/javascript">