diff options
author | Mario Vavti <mario@mariovavti.com> | 2016-06-16 10:26:47 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2016-06-16 10:26:47 +0200 |
commit | 28a7458e48d45bfa1e0a3df9ba0a5f7c13b3809b (patch) | |
tree | 7b13533527f03baee8d9cc4b339b535462ae7ada /view | |
parent | 05ed20d336c505520fde94e44789d817d136c6f4 (diff) | |
parent | d457f11717da40f44d98eeba5b88e6f1e5636247 (diff) | |
download | volse-hubzilla-28a7458e48d45bfa1e0a3df9ba0a5f7c13b3809b.tar.gz volse-hubzilla-28a7458e48d45bfa1e0a3df9ba0a5f7c13b3809b.tar.bz2 volse-hubzilla-28a7458e48d45bfa1e0a3df9ba0a5f7c13b3809b.zip |
Merge branch 'dev' into sabre32
Diffstat (limited to 'view')
-rw-r--r-- | view/php/theme_init.php | 1 | ||||
-rw-r--r-- | view/tpl/wiki.tpl | 41 |
2 files changed, 41 insertions, 1 deletions
diff --git a/view/php/theme_init.php b/view/php/theme_init.php index 648b144b3..e9ba2aa05 100644 --- a/view/php/theme_init.php +++ b/view/php/theme_init.php @@ -10,6 +10,7 @@ head_add_css('view/css/conversation.css'); head_add_css('view/css/widgets.css'); head_add_css('view/css/colorbox.css'); head_add_css('library/justifiedGallery/justifiedGallery.min.css'); +head_add_css('library/Text_Highlighter/sample.css'); head_add_js('jquery.js'); //head_add_js('jquery-migrate-1.1.1.js'); diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index 1312f8518..dc78aad9f 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -25,7 +25,7 @@ <button id="inline-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen(false); adjustInlineTopBarHeight();"><i class="fa fa-compress"></i></button> </div> - <h2>{{$wikiheader}}</h2> + <h2><span id="wiki-header-name">{{$wikiheaderName}}</span>: <span id="wiki-header-page">{{$wikiheaderPage}}</span></h2> <div class="clear"></div> </div> <div id="new-wiki-form-wrapper" class="section-content-tools-wrapper" style="display:none;"> @@ -57,6 +57,17 @@ <hr> </div> + <div id="rename-page-form-wrapper" class="section-content-tools-wrapper" style="display:none;"> + <form id="rename-page-form" action="wiki/rename/page" method="post" > + <div class="clear"></div> + {{include file="field_input.tpl" field=$pageRename}} + <div class="btn-group pull-right"> + <button id="rename-page-submit" class="btn btn-warning" type="submit" name="submit" >Rename Page</button> + </div> + </form> <div class="clear"></div> + <hr> + </div> + <div id="wiki-content-container" class="section-content-wrapper" {{if $hideEditor}}style="display: none;"{{/if}}> <ul class="nav nav-tabs" id="wiki-nav-tabs"> <li><a data-toggle="tab" href="#edit-pane">Edit</a></li> @@ -67,6 +78,7 @@ <a data-toggle="dropdown" class="dropdown-toggle" href="#">Page <b class="caret"></b></a> <ul class="dropdown-menu"> <li><a id="save-page" data-toggle="tab" href="#">Save</a></li> + <li><a id="rename-page" data-toggle="tab" href="#">Rename</a></li> <li><a id="delete-page" data-toggle="tab" href="#">Delete</a></li> </ul> </li> @@ -115,7 +127,34 @@ if (window.wiki_page_name === 'Home') { $('#delete-page').hide(); + $('#rename-page').hide(); } + + $('#rename-page').click(function (ev) { + $('#rename-page-form-wrapper').show(); + }); + + $( "#rename-page-form" ).submit(function( event ) { + $.post("wiki/{{$channel}}/rename/page", + { + oldName: window.wiki_page_name, + newName: $('#id_pageRename').val(), + resource_id: window.wiki_resource_id + }, + function (data) { + if (data.success) { + $('#rename-page-form-wrapper').hide(); + window.console.log('data: ' + JSON.stringify(data)); + window.wiki_page_name = data.name.urlName; + $('#wiki-header-page').html(data.name.htmlName); + wiki_refresh_page_list(); + } else { + window.console.log('Error renaming page.'); + } + }, 'json'); + event.preventDefault(); + }); + $(document).ready(function () { wiki_refresh_page_list(); // Show Edit tab first. Otherwise the Ace editor does not load. |