From 6b23c3e1796b818ce893ed919f2e2bdd000c83fb Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 27 Sep 2018 14:56:47 +0200 Subject: implement conversation tools (settings/conversation), remove additional features from the settings menu and get rid of skill levels --- view/js/main.js | 29 +++++++++++++++++++++++++++++ view/tpl/conv_frame.tpl | 15 +++++++++++++-- view/tpl/conv_item.tpl | 6 +++++- view/tpl/jot.tpl | 8 ++++---- view/tpl/settings_features.tpl | 21 --------------------- view/tpl/settings_module.tpl | 21 +++++++++++---------- view/tpl/settings_module_ajax.tpl | 11 +++++++++++ 7 files changed, 73 insertions(+), 38 deletions(-) create mode 100644 view/tpl/settings_module_ajax.tpl (limited to 'view') diff --git a/view/js/main.js b/view/js/main.js index 17f94dd16..48277f5cc 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -41,6 +41,8 @@ $.ajaxSetup({cache: false}); $(document).ready(function() { $(document).on('click focus', '.comment-edit-form', handle_comment_form); + $(document).on('click', '.conversation-settings-link', getConversationSettings); + $(document).on('click', '#settings_module_ajax_submit', postConversationSettings); jQuery.timeago.settings.strings = { prefixAgo : aStr['t01'], @@ -122,6 +124,33 @@ $(document).ready(function() { }); +function getConversationSettings() { + $.get('settings/conversation/?f=&aj=1',function(data) { + $('#conversation_settings_body').html(data); + }); + + + +} + +function postConversationSettings() { + $.post( + 'settings/conversation', + $('#settings_module_ajax_form').serialize() + "&auto_update=" + next_page + ); + + if(next_page === 1) { + page_load = true; + } + + $('#conversation_settings').modal('hide'); + + if(timer) clearTimeout(timer); + timer = setTimeout(updateInit,100); + + return false; +} + function datasrc2src(selector) { $(selector).each(function(i, el) { $(el).attr("src", $(el).data("src")); diff --git a/view/tpl/conv_frame.tpl b/view/tpl/conv_frame.tpl index 8aa865076..c6b3b0d9b 100755 --- a/view/tpl/conv_frame.tpl +++ b/view/tpl/conv_frame.tpl @@ -4,5 +4,16 @@
- - + diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl index 05c3d7ae0..5720a2a5f 100755 --- a/view/tpl/conv_item.tpl +++ b/view/tpl/conv_item.tpl @@ -183,6 +183,10 @@ {{$item.dreport}} {{/if}} + {{if $item.settings}} + + {{$item.settings}} + {{/if}} @@ -210,7 +214,7 @@