aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-11-28 11:54:36 +0100
committerMario Vavti <mario@mariovavti.com>2016-11-28 11:54:36 +0100
commitd8774cda8ed0bec9dbbe8638fd7af5307d569805 (patch)
treed7562bd125d621f5d3e362f172134512edffcfdf /view/tpl
parent1ce4eda0b92e13615991ec22d3b789c640991431 (diff)
downloadvolse-hubzilla-d8774cda8ed0bec9dbbe8638fd7af5307d569805.tar.gz
volse-hubzilla-d8774cda8ed0bec9dbbe8638fd7af5307d569805.tar.bz2
volse-hubzilla-d8774cda8ed0bec9dbbe8638fd7af5307d569805.zip
minor cleanup and remove more double encoding
Diffstat (limited to 'view/tpl')
-rw-r--r--view/tpl/wiki.tpl8
-rw-r--r--view/tpl/wiki_page_list.tpl19
2 files changed, 10 insertions, 17 deletions
diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl
index 6025ded27..bdce4f4be 100644
--- a/view/tpl/wiki.tpl
+++ b/view/tpl/wiki.tpl
@@ -379,14 +379,6 @@
'json');
};
- function wiki_show_new_page_form() {
- $('div[id^=\'edit-wiki-form-wrapper\']').hide();
- $('#edit-wiki-form-wrapper').hide();
- $('#new-wiki-form-wrapper').hide();
- $('#new-page-form-wrapper').toggle();
- return false;
- }
-
function wiki_show_edit_wiki_form(wiki_title, wiki_resource_id) {
window.wiki_resource_id = wiki_resource_id;
window.wiki_title = wiki_title;
diff --git a/view/tpl/wiki_page_list.tpl b/view/tpl/wiki_page_list.tpl
index bd6d2d759..ef2b41490 100644
--- a/view/tpl/wiki_page_list.tpl
+++ b/view/tpl/wiki_page_list.tpl
@@ -29,17 +29,12 @@
<script>
$('#new-page-submit').click(function (ev) {
- if (window.wiki_resource_id === '') {
- window.console.log('You must have a wiki open in order to create pages.');
- ev.preventDefault();
- return false;
- }
$.post("wiki/{{$channel}}/create/page", {name: $('#id_pageName').val(), resource_id: window.wiki_resource_id},
- function (data) {
- if (data.success) {
- window.location = data.url;
+ function(data) {
+ if(data.success) {
+ window.location = data.url;
} else {
- window.console.log('Error creating page.');
+ window.console.log('Error creating page.');
}
}, 'json');
ev.preventDefault();
@@ -71,4 +66,10 @@
}, 'json');
return false;
}
+
+ function wiki_show_new_page_form() {
+ $('#new-page-form-wrapper').toggle();
+ $('#id_pageName').focus();
+ return false;
+ }
</script>