X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Ftheme%2Ffrio%2Ftemplates%2Fjot-header.tpl;h=d52f4b98dec41eac862d5ce3ebff8c0c937166f0;hb=0787f093d6925848566cac3caa4131f1415870e4;hp=145667be9b412ef0a53fa43de827e7e3d9e518da;hpb=59c12db020e9e14fcf8b96cffa5c76ac181e3571;p=friendica.git
diff --git a/view/theme/frio/templates/jot-header.tpl b/view/theme/frio/templates/jot-header.tpl
index 145667be9b..d52f4b98de 100644
--- a/view/theme/frio/templates/jot-header.tpl
+++ b/view/theme/frio/templates/jot-header.tpl
@@ -2,134 +2,37 @@
@@ -140,7 +43,7 @@
$(document).ready(function() {
- /* enable tinymce on focus and click */
+ /* enable editor on focus and click */
$("#profile-jot-text").focus(enableOnUser);
$("#profile-jot-text").click(enableOnUser);
@@ -177,33 +80,6 @@
Dialog.doFileBrowser("main");
jotActive();
});
-
- /**
- var uploader = new window.AjaxUpload(
- 'wall-image-upload',
- { action: 'wall_upload/{{$nickname}}',
- name: 'userfile',
- onSubmit: function(file,ext) { $('#profile-rotator').show(); },
- onComplete: function(file,response) {
- addeditortext(response);
- $('#profile-rotator').hide();
- }
- }
- );
- var file_uploader = new window.AjaxUpload(
- 'wall-file-upload',
- { action: 'wall_attach/{{$nickname}}',
- name: 'userfile',
- onSubmit: function(file,ext) { $('#profile-rotator').show(); },
- onComplete: function(file,response) {
- addeditortext(response);
- $('#profile-rotator').hide();
- }
- }
- );
-
- }
- **/
});
function deleteCheckedItems() {
@@ -377,18 +253,14 @@
}
function addeditortext(data) {
- if(plaintext == 'none') {
- // get the textfield
- var textfield = document.getElementById("profile-jot-text");
- // check if the textfield does have the default-value
- jotTextOpenUI(textfield);
- // save already existent content
- var currentText = $("#profile-jot-text").val();
- //insert the data as new value
- textfield.value = currentText + data;
- }
- else
- tinyMCE.execCommand('mceInsertRawHTML',false,data);
+ // get the textfield
+ var textfield = document.getElementById("profile-jot-text");
+ // check if the textfield does have the default-value
+ jotTextOpenUI(textfield);
+ // save already existent content
+ var currentText = $("#profile-jot-text").val();
+ //insert the data as new value
+ textfield.value = currentText + data;
}
{{$geotag}}
@@ -397,42 +269,25 @@
var modal = $('#jot-modal').modal();
jotcache = $("#jot-sections");
+ // Auto focus on the first enabled field in the modal
+ modal.on('shown.bs.modal', function (e) {
+ $('#jot-modal-content').find('select:not([disabled]), input:not([type=hidden]):not([disabled]), textarea:not([disabled])').first().focus();
+ })
+
modal
.find('#jot-modal-content')
.append(jotcache)
.modal.show;
}
- // the following functions show/hide the specific jot content
- // in dependence of the selected nav
- function aclActive() {
- $(".modal-body #profile-jot-wrapper, .modal-body #jot-preview-content, .modal-body #jot-fbrowser-wrapper").hide();
- $(".modal-body #profile-jot-acl-wrapper").show();
- }
-
-
- function previewActive() {
- $(".modal-body #profile-jot-wrapper, .modal-body #profile-jot-acl-wrapper,.modal-body #jot-fbrowser-wrapper").hide();
- preview_post();
- }
-
+ // Activate the jot text section in the jot modal
function jotActive() {
- $(".modal-body #profile-jot-acl-wrapper, .modal-body #jot-preview-content, .modal-body #jot-fbrowser-wrapper").hide();
- $(".modal-body #profile-jot-wrapper").show();
-
- //make sure jot text does have really the active class (we do this because there are some
- // other events which trigger jot text
- toggleJotNav($("#jot-modal .jot-nav #jot-text-lnk"));
- }
-
- function fbrowserActive() {
- $(".modal-body #profile-jot-wrapper, .modal-body #jot-preview-content, .modal-body #profile-jot-acl-wrapper").hide();
-
- $(".modal-body #jot-fbrowser-wrapper").show();
-
- $(function() {Dialog.showJot();});
+ // Make sure jot text does have really the active class (we do this because there are some
+ // other events which trigger jot text (we need to do this for the desktop and mobile
+ // jot nav
+ var elem = $("#jot-modal .jot-nav #jot-text-lnk");
+ var elemMobile = $("#jot-modal .jot-nav #jot-text-lnk-mobile")
+ toggleJotNav(elem[0]);
+ toggleJotNav(elemMobile[0]);
}
-
-
-