diff options
Diffstat (limited to 'view/tpl/jot-header.tpl')
-rwxr-xr-x[-rw-r--r--] | view/tpl/jot-header.tpl | 157 |
1 files changed, 88 insertions, 69 deletions
diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index f777e997f..abf446ba9 100644..100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -1,21 +1,20 @@ - <script language="javascript" type="text/javascript"> var editor=false; var textlen = 0; -var plaintext = '$editselect'; +var plaintext = '{{$editselect}}'; function initEditor(cb){ if (editor==false){ - $("#profile-jot-text-loading").show(); + $("#profile-jot-text-loading").spin('small').show(); if(plaintext == 'none') { - $("#profile-jot-text-loading").hide(); + $("#profile-jot-text-loading").spin(false).hide(); $("#profile-jot-text").css({ 'height': 200, 'color': '#000' }); $("#profile-jot-text").contact_autocomplete(baseurl+"/acl"); editor = true; - $("a#jot-perms-icon").fancybox({ - 'transitionIn' : 'elastic', - 'transitionOut' : 'elastic' + $("a#jot-perms-icon").colorbox({ + 'inline' : true, + 'transition' : 'elastic' }); $(".jothidden").show(); if (typeof cb!="undefined") cb(); @@ -24,7 +23,7 @@ function initEditor(cb){ tinyMCE.init({ theme : "advanced", mode : "specific_textareas", - editor_selector: $editselect, + editor_selector: {{$editselect}}, auto_focus: "profile-jot-text", plugins : "bbcode,paste,autoresize, inlinepopups", theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code", @@ -42,7 +41,7 @@ function initEditor(cb){ force_br_newlines : true, forced_root_block : '', convert_urls: false, - content_css: "$baseurl/view/custom_tinymce.css", + content_css: "{{$baseurl}}/view/custom_tinymce.css", theme_advanced_path : false, file_browser_callback : "fcFileBrowser", setup : function(ed) { @@ -74,29 +73,11 @@ function initEditor(cb){ $('#profile-jot-desc').html(' '); } - //Character count - - if(textlen <= 140) { - $('#character-counter').removeClass('red'); - $('#character-counter').removeClass('orange'); - $('#character-counter').addClass('grey'); - } - if((textlen > 140) && (textlen <= 420)) { - $('#character-counter').removeClass('grey'); - $('#character-counter').removeClass('red'); - $('#character-counter').addClass('orange'); - } - if(textlen > 420) { - $('#character-counter').removeClass('grey'); - $('#character-counter').removeClass('orange'); - $('#character-counter').addClass('red'); - } - $('#character-counter').text(textlen); }); ed.onInit.add(function(ed) { ed.pasteAsPlainText = true; - $("#profile-jot-text-loading").hide(); + $("#profile-jot-text-loading").spin(false).hide(); $(".jothidden").show(); if (typeof cb!="undefined") cb(); }); @@ -105,11 +86,7 @@ function initEditor(cb){ }); editor = true; - // setup acl popup - $("a#jot-perms-icon").fancybox({ - 'transitionIn' : 'elastic', - 'transitionOut' : 'elastic' - }); + } else { if (typeof cb!="undefined") cb(); } @@ -122,35 +99,41 @@ function enableOnUser(){ } </script> -<script type="text/javascript" src="$baseurl/js/ajaxupload.js" ></script> +<script type="text/javascript" src="{{$baseurl}}/view/js/ajaxupload.js" ></script> <script> - var ispublic = '$ispublic'; + var ispublic = '{{$ispublic}}'; $(document).ready(function() { /* enable tinymce on focus and click */ $("#profile-jot-text").focus(enableOnUser); $("#profile-jot-text").click(enableOnUser); + var upload_title = $('#wall-image-upload').attr('title'); + var attach_title = $('#wall-file-upload').attr('title'); var uploader = new window.AjaxUpload( 'wall-image-upload', - { action: 'wall_upload/$nickname', + { action: '{{$baseurl}}/wall_upload/{{$nickname}}', name: 'userfile', - onSubmit: function(file,ext) { $('#profile-rotator').show(); }, + title: upload_title, + onSubmit: function(file,ext) { $('#profile-rotator').spin('tiny'); }, onComplete: function(file,response) { addeditortext(response); - $('#profile-rotator').hide(); + $('#jot-media').val($('#jot-media').val() + response); + $('#profile-rotator').spin(false); } } ); var file_uploader = new window.AjaxUpload( 'wall-file-upload', - { action: 'wall_attach/$nickname', + { action: '{{$baseurl}}/wall_attach/{{$nickname}}', name: 'userfile', - onSubmit: function(file,ext) { $('#profile-rotator').show(); }, + title: attach_title, + onSubmit: function(file,ext) { $('#profile-rotator').spin('tiny'); }, onComplete: function(file,response) { addeditortext(response); - $('#profile-rotator').hide(); + $('#jot-media').val($('#jot-media').val() + response); + $('#profile-rotator').spin(false); } } ); @@ -177,48 +160,61 @@ function enableOnUser(){ } function jotGetLink() { - reply = prompt("$linkurl"); + reply = prompt("{{$linkurl}}"); if(reply && reply.length) { reply = bin2hex(reply); - $('#profile-rotator').show(); - $.get('parse_url?binurl=' + reply, function(data) { + $('#profile-rotator').spin('tiny'); + $.get('{{$baseurl}}/parse_url?binurl=' + reply, function(data) { addeditortext(data); - $('#profile-rotator').hide(); + $('#profile-rotator').spin(false); }); } } function jotVideoURL() { - reply = prompt("$vidurl"); + reply = prompt("{{$vidurl}}"); if(reply && reply.length) { addeditortext('[video]' + reply + '[/video]'); } } function jotAudioURL() { - reply = prompt("$audurl"); + reply = prompt("{{$audurl}}"); if(reply && reply.length) { addeditortext('[audio]' + reply + '[/audio]'); } } - function jotGetLocation() { - reply = prompt("$whereareu", $('#jot-location').val()); + reply = prompt("{{$whereareu}}", $('#jot-location').val()); if(reply && reply.length) { $('#jot-location').val(reply); } } + function jotGetExpiry() { + //reply = prompt("{{$expirewhen}}", $('#jot-expire').val()); + $('#expiryModal').modal(); + $('#expiry-modal-OKButton').on('click', function() { + reply=$('#expiration-date').val(); + if(reply && reply.length) { + $('#jot-expire').val(reply); + $('#expiryModal').modal('hide'); + } +}) + + + } + function jotShare(id) { if ($('#jot-popup').length != 0) $('#jot-popup').show(); - $('#like-rotator-' + id).show(); - $.get('share/' + id, function(data) { + $('#like-rotator-' + id).spin('tiny'); + $.get('{{$baseurl}}/share/' + id, function(data) { if (!editor) $("#profile-jot-text").val(""); initEditor(function(){ addeditortext(data); - $('#like-rotator-' + id).hide(); + $('#like-rotator-' + id).spin(false); $(window).scrollTop(0); }); @@ -237,19 +233,19 @@ function enableOnUser(){ event.preventDefault(); if(reply && reply.length) { reply = bin2hex(reply); - $('#profile-rotator').show(); - $.get('parse_url?binurl=' + reply, function(data) { + $('#profile-rotator').spin('tiny'); + $.get('{{$baseurl}}/parse_url?binurl=' + reply, function(data) { if (!editor) $("#profile-jot-text").val(""); initEditor(function(){ addeditortext(data); - $('#profile-rotator').hide(); + $('#profile-rotator').spin(false); }); }); } } function itemTag(id) { - reply = prompt("$term"); + reply = prompt("{{$term}}"); if(reply && reply.length) { reply = reply.replace('#',''); if(reply.length) { @@ -257,7 +253,7 @@ function enableOnUser(){ commentBusy = true; $('body').css('cursor', 'wait'); - $.get('tagger/' + id + '?term=' + reply); + $.get('{{$baseurl}}/tagger/' + id + '?term=' + reply); if(timer) clearTimeout(timer); timer = setTimeout(NavUpdate,3000); liking = 1; @@ -270,7 +266,7 @@ function enableOnUser(){ var bordercolor = $("input").css("border-color"); $.get('filer/', function(data){ - $.fancybox(data); + $.colorbox({html:data}); $("#id_term").keypress(function(){ $(this).css("border-color",bordercolor); }) @@ -284,11 +280,11 @@ function enableOnUser(){ if(reply && reply.length) { commentBusy = true; $('body').css('cursor', 'wait'); - $.get('filer/' + id + '?term=' + reply, NavUpdate); + $.get('{{$baseurl}}/filer/' + id + '?term=' + reply, NavUpdate); // if(timer) clearTimeout(timer); // timer = setTimeout(NavUpdate,3000); liking = 1; - $.fancybox.close(); + $.colorbox.close(); } else { $("#id_term").css("border-color","#FF0000"); } @@ -298,21 +294,44 @@ function enableOnUser(){ } + function itemBookmark(id) { + $.get('{{$baseurl}}/bookmarks?f=&item=' + id); + if(timer) clearTimeout(timer); + timer = setTimeout(NavUpdate,1000); + } + + function itemAddToCal(id) { + $.get('{{$baseurl}}/events/add/' + id); + if(timer) clearTimeout(timer); + timer = setTimeout(NavUpdate,1000); + } + + function jotClearLocation() { $('#jot-coord').val(''); $('#profile-nolocation-wrapper').hide(); } - function addeditortext(data) { - if(plaintext == 'none') { - var currentText = $("#profile-jot-text").val(); - $("#profile-jot-text").val(currentText + data); - } - else - tinyMCE.execCommand('mceInsertRawHTML',false,data); - } - $geotag + {{$geotag}} + +</script> + +<script> +$( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-delete-link,.block-delete-link", function(e) { + var link = $(this).attr("href"); // "get" the intended link in a var + + if (typeof(eval($.fn.modal)) === 'function'){ + e.preventDefault(); + bootbox.confirm("<h4>{{$confirmdelete}}</h4>",function(result) { + if (result) { + document.location.href = link;} + });} + else { + return confirm("{{$confirmdelete}}"); + } + }); </script> + |