X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Ftheme%2Ffrost-mobile%2Fjs%2Ftheme.js;h=09b5e4d3831fe9bcd4463588ec552032072e4531;hb=d60f96f0e17d751d614af28e029546d1ff003ee6;hp=fc42d9208572f09c5b03fed182d8fa65f57a0a28;hpb=daa8e4f9013d3ad329d3deadf8c823bae57bc171;p=friendica.git diff --git a/view/theme/frost-mobile/js/theme.js b/view/theme/frost-mobile/js/theme.js index fc42d92085..09b5e4d383 100644 --- a/view/theme/frost-mobile/js/theme.js +++ b/view/theme/frost-mobile/js/theme.js @@ -1,6 +1,6 @@ $(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); @@ -28,7 +28,7 @@ $(document).ready(function() { if (typeof window.AjaxUpload != "undefined") { var uploader = new window.AjaxUpload( window.imageUploadButton, - { action: 'wall_upload/'+window.nickname+'?nomce=1', + { action: 'wall_upload/' + window.nickname, name: 'userfile', onSubmit: function(file,ext) { $('#profile-rotator').show(); }, onComplete: function(file,response) { @@ -41,7 +41,7 @@ $(document).ready(function() { if ($('#wall-file-upload').length) { var file_uploader = new window.AjaxUpload( 'wall-file-upload', - { action: 'wall_attach/'+window.nickname+'?nomce=1', + { action: 'wall_attach/' + window.nickname, name: 'userfile', onSubmit: function(file,ext) { $('#profile-rotator').show(); }, onComplete: function(file,response) { @@ -218,46 +218,35 @@ function initCrop() { function showEvent(eventid) { } - - /* - * TinyMCE/Editor + * Editor */ - -var editor=false; +var editor = false; var textlen = 0; -var plaintext = 'none';//window.editSelect; -//var ispublic = window.isPublic; - -function initEditor(cb) { - if (editor==false) { - if (plaintext == 'none') { - $("#profile-jot-text").css({ 'height': 200, 'color': '#000' }); - $("#profile-jot-text").editor_autocomplete(baseurl+"/acl"); - editor = true; - - $("a#jot-perms-icon, a#settings-default-perms-menu").click(function () { - var parent = $("#profile-jot-acl-wrapper").parent(); - if (parent.css('display') == 'none') { - parent.show(); - } else { - parent.hide(); - } - return false; - }); - $(".jothidden").show(); - if (typeof cb!="undefined") { - cb(); +function initEditor(callback){ + if (editor == false) { + $("#profile-jot-text").css({ 'height': 200, 'color': '#000' }); + $("#profile-jot-text").editor_autocomplete(baseurl+"/acl"); + $("a#jot-perms-icon, a#settings-default-perms-menu").click(function () { + var parent = $("#profile-jot-acl-wrapper").parent(); + if (parent.css('display') == 'none') { + parent.show(); + } else { + parent.hide(); } - return; - } - } else { - if (typeof cb!="undefined") cb(); + return false; + }); + $(".jothidden").show(); + + editor = true; + } + if (typeof callback != "undefined") { + callback(); } } -function enableOnUser() { +function enableOnUser(){ if (editor) { return; } @@ -270,10 +259,8 @@ function enableOnUser() { */ function addeditortext(textElem, data) { - if (window.editSelect == 'none') { - var currentText = $(textElem).val(); - $(textElem).val(currentText + data); - } + var currentText = $(textElem).val(); + $(textElem).val(currentText + data); } function jotVideoURL() { @@ -376,8 +363,7 @@ function itemFiler(id) { * Comments */ function commentOpen(obj,id) { - if(obj.value == window.commentEmptyText) { - obj.value = ""; + if (obj.value == "") { $("#comment-edit-text-" + id).addClass("comment-edit-text-full"); $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty"); $("#mod-cmnt-wrap-" + id).show(); @@ -385,8 +371,7 @@ function commentOpen(obj,id) { } } function commentClose(obj,id) { - if(obj.value == "") { - obj.value = window.commentEmptyText; + if (obj.value == "") { $("#comment-edit-text-" + id).removeClass("comment-edit-text-full"); $("#comment-edit-text-" + id).addClass("comment-edit-text-empty"); $("#mod-cmnt-wrap-" + id).hide(); @@ -397,8 +382,7 @@ function commentClose(obj,id) { function commentInsert(obj,id) { var tmpStr = $("#comment-edit-text-" + id).val(); - if(tmpStr == window.commentEmptyText) { - tmpStr = ""; + if (tmpStr == "") { $("#comment-edit-text-" + id).addClass("comment-edit-text-full"); $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty"); openMenu("comment-edit-submit-wrapper-" + id); @@ -413,8 +397,7 @@ function commentInsert(obj,id) { function qCommentInsert(obj,id) { var tmpStr = $("#comment-edit-text-" + id).val(); - if(tmpStr == window.commentEmptyText) { - tmpStr = ""; + if (tmpStr == "") { $("#comment-edit-text-" + id).addClass("comment-edit-text-full"); $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty"); openMenu("comment-edit-submit-wrapper-" + id); @@ -428,33 +411,25 @@ function qCommentInsert(obj,id) { $(obj).val(""); } -function insertFormatting(comment,BBcode,id) { - +function insertFormatting(BBcode, id) { var tmpStr = $("#comment-edit-text-" + id).val(); - if(tmpStr == comment) { - tmpStr = ""; + if (tmpStr == "") { $("#comment-edit-text-" + id).addClass("comment-edit-text-full"); $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty"); openMenu("comment-edit-submit-wrapper-" + id); - $("#comment-edit-text-" + id).val(tmpStr); } textarea = document.getElementById("comment-edit-text-" +id); if (document.selection) { textarea.focus(); selected = document.selection.createRange(); - if (BBcode == "url"){ - selected.text = "["+BBcode+"=http://]" + selected.text + "[/"+BBcode+"]"; - } else selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]"; } else if (textarea.selectionStart || textarea.selectionStart == "0") { var start = textarea.selectionStart; var end = textarea.selectionEnd; - if (BBcode == "url"){ - textarea.value = textarea.value.substring(0, start) + "["+BBcode+"=http://]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length); - } else textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length); } + return true; }