aboutsummaryrefslogtreecommitdiffstats
path: root/view/theme/testbubble/jot-header.tpl
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-11-09 18:29:30 -0800
committerFriendika <info@friendika.com>2011-11-09 18:29:30 -0800
commite35f3f1ada264c03fe0c54e5ed0672c5a66ca001 (patch)
tree80b98f2c6b348b837167539b35a05fc016e01655 /view/theme/testbubble/jot-header.tpl
parenta2018e2d145d0e8189abf3f6e2e75d571b35f029 (diff)
parent2b1e01185144ecc0ff5de457efcad5734dd932c8 (diff)
downloadvolse-hubzilla-e35f3f1ada264c03fe0c54e5ed0672c5a66ca001.tar.gz
volse-hubzilla-e35f3f1ada264c03fe0c54e5ed0672c5a66ca001.tar.bz2
volse-hubzilla-e35f3f1ada264c03fe0c54e5ed0672c5a66ca001.zip
Merge branch 'master' into contacts
Diffstat (limited to 'view/theme/testbubble/jot-header.tpl')
-rw-r--r--view/theme/testbubble/jot-header.tpl54
1 files changed, 34 insertions, 20 deletions
diff --git a/view/theme/testbubble/jot-header.tpl b/view/theme/testbubble/jot-header.tpl
index 0093bf82a..5ada1fdf8 100644
--- a/view/theme/testbubble/jot-header.tpl
+++ b/view/theme/testbubble/jot-header.tpl
@@ -32,16 +32,37 @@ function initEditor(cb) {
content_css: "$baseurl/view/custom_tinymce.css",
theme_advanced_path : false,
setup : function(ed) {
- //Character count
- ed.onKeyUp.add(function(ed, e) {
- var txt = tinyMCE.activeEditor.getContent();
- textlen = txt.length;
- if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
- $('#profile-jot-desc').html(ispublic);
- }
- else {
- $('#profile-jot-desc').html('&nbsp;');
- }
+ cPopup = null;
+ ed.onKeyDown.add(function(ed,e) {
+ if(cPopup !== null)
+ cPopup.onkey(e);
+ });
+
+
+
+ ed.onKeyUp.add(function(ed, e) {
+ var txt = tinyMCE.activeEditor.getContent();
+ match = txt.match(/@([^ \n]+)$/);
+ if(match!==null) {
+ if(cPopup === null) {
+ cPopup = new ACPopup(this,baseurl+"/acl");
+ }
+ if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
+ if(! cPopup.ready) cPopup = null;
+ }
+ else {
+ if(cPopup !== null) { cPopup.close(); cPopup = null; }
+ }
+
+ textlen = txt.length;
+ if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
+ $('#profile-jot-desc').html(ispublic);
+ }
+ else {
+ $('#profile-jot-desc').html('&nbsp;');
+ }
+
+ //Character count
if(textlen <= 140) {
$('#character-counter').removeClass('red');
@@ -67,7 +88,6 @@ function initEditor(cb) {
$("#profile-upload-wrapper").show();
$("#profile-attach-wrapper").show();
$("#profile-link-wrapper").show();
- $("#profile-youtube-wrapper").show();
$("#profile-video-wrapper").show();
$("#profile-audio-wrapper").show();
$("#profile-location-wrapper").show();
@@ -163,20 +183,13 @@ function initEditor(cb) {
if(reply && reply.length) {
reply = bin2hex(reply);
$('#profile-rotator').show();
- $.get('parse_url?url=' + reply, function(data) {
+ $.get('parse_url?binurl=' + reply, function(data) {
tinyMCE.execCommand('mceInsertRawHTML',false,data);
$('#profile-rotator').hide();
});
}
}
- function jotGetVideo() {
- reply = prompt("$utubeurl");
- if(reply && reply.length) {
- tinyMCE.execCommand('mceInsertRawHTML',false,'[youtube]' + reply + '[/youtube]');
- }
- }
-
function jotVideoURL() {
reply = prompt("$vidurl");
if(reply && reply.length) {
@@ -229,8 +242,9 @@ function initEditor(cb) {
event.target.textContent = reply;
event.preventDefault();
if(reply && reply.length) {
+ reply = bin2hex(reply);
$('#profile-rotator').show();
- $.get('parse_url?url=' + reply, function(data) {
+ $.get('parse_url?binurl=' + reply, function(data) {
if (!editor) $("#profile-jot-text").val("");
initEditor(function(){
tinyMCE.execCommand('mceInsertRawHTML',false,data);