diff options
author | Mario Vavti <mario@mariovavti.com> | 2016-11-28 11:29:10 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2016-11-28 11:29:10 +0100 |
commit | 1ce4eda0b92e13615991ec22d3b789c640991431 (patch) | |
tree | 46e6634f403d9e2d9870b2aaee8287c41d4bc8e3 /view/tpl/wiki.tpl | |
parent | 68fd1c28b0bf21864753106e4345f0908b4f2e49 (diff) | |
download | volse-hubzilla-1ce4eda0b92e13615991ec22d3b789c640991431.tar.gz volse-hubzilla-1ce4eda0b92e13615991ec22d3b789c640991431.tar.bz2 volse-hubzilla-1ce4eda0b92e13615991ec22d3b789c640991431.zip |
wiki: move delete page functionality to the widget
Diffstat (limited to 'view/tpl/wiki.tpl')
-rw-r--r-- | view/tpl/wiki.tpl | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index 6d9f78800..6025ded27 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -11,9 +11,6 @@ <a id="rename-page" class="nav-link" href="#"><i class="fa fa-edit"></i> Rename Page</a> </li> <li class="nav-item"> - <a id="delete-page" class="nav-link" href="#"><i class="fa fa-trash-o"></i> Delete Page</a> - </li> - <li class="nav-item"> <a id="embed-image" class="nav-link" href="#"><i class="fa fa-picture-o"></i> Embed Image</a> </li> </ul> @@ -239,33 +236,6 @@ ev.preventDefault(); }); - $('#delete-page').click(function (ev) { - if (window.wiki_resource_id === '' || window.wiki_page_name === '' || window.wiki_page_name === 'Home') { - window.console.log('You must have a wiki page open in order to delete pages.'); - ev.preventDefault(); - return false; - } - if(!confirm('Are you sure you want to delete the page: ' + window.wiki_page_name)) { - ev.preventDefault(); - return; - } - $.post("wiki/{{$channel}}/delete/page", {name: window.wiki_page_name, resource_id: window.wiki_resource_id}, - function (data) { - if (data.success) { - window.console.log('Page deleted successfully.'); - var url = window.location.href; - if (url.substr(-1) == '/') url = url.substr(0, url.length - 2); - url = url.split('/'); - url.pop(); - window.location = url.join('/'); - } else { - alert('Error deleting page.'); // TODO: Replace alerts with auto-timeout popups - window.console.log('Error deleting page.'); - } - }, 'json'); - ev.preventDefault(); - }); - function wiki_revert_page(commitHash) { if (window.wiki_resource_id === '' || window.wiki_page_name === '') { window.console.log('You must have a wiki page open in order to revert pages.'); |