aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/LocalFilesEditor/show_default.tpl
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--plugins/LocalFilesEditor/show_default.tpl47
1 files changed, 37 insertions, 10 deletions
diff --git a/plugins/LocalFilesEditor/show_default.tpl b/plugins/LocalFilesEditor/show_default.tpl
index bccfc9712..ffdca4d68 100644
--- a/plugins/LocalFilesEditor/show_default.tpl
+++ b/plugins/LocalFilesEditor/show_default.tpl
@@ -1,13 +1,40 @@
-{if isset($editarea)}
-<script type="text/javascript" src="{$editarea.URL}"></script>
+{* $Id$ *}
+{html_head}<link rel="stylesheet" type="text/css" href="{$LOCALEDIT_PATH}locfiledit.css">{/html_head}
+{known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"}
+{known_script id="editarea" src=$LOCALEDIT_PATH|@cat:"editarea/edit_area_full.js"}
<script type="text/javascript">
-editAreaLoader.init({ldelim}
- id: "text"
- {foreach from=$editarea.OPTIONS key=option item=value}
- , {$option}: {$value|editarea_quote}
- {/foreach}
-{rdelim});
+var editarea = "{$LOAD_EDITAREA}";
+
+function loadEditarea() {ldelim}
+ editAreaLoader.init({ldelim}
+ id: "text"
+ {foreach from=$EDITAREA_OPTIONS key=option item=value}
+ , {$option}: {$value|editarea_quote}
+ {/foreach}
+ });
+ jQuery("#showedit").hide();
+ jQuery("#hideedit").show();
+}
+
+function unloadEditarea() {ldelim}
+ editAreaLoader.delete_instance("text");
+ jQuery("#hideedit").hide();
+ jQuery("#showedit").show();
+}
</script>
-{/if}
-<textarea rows="30" id="text" cols="90">{$DEFAULT_CONTENT}</textarea> \ No newline at end of file
+<div id="LocalFilesEditor">
+
+<textarea id="text" rows="30" cols="90">{$DEFAULT_CONTENT}</textarea>
+
+<div id="editarea_buttons">
+<a href="javascript:loadEditarea();" id="showedit">[{'locfiledit_enable_editarea'|@translate}]</a>
+<a href="javascript:unloadEditarea();" id="hideedit">[{'locfiledit_disable_editarea'|@translate}]</a>
+</div>
+
+</div>
+
+<script type="text/javascript">
+jQuery("#editarea_buttons").show();
+if (editarea == "on") loadEditarea();
+</script>