aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
Diffstat (limited to 'view')
-rw-r--r--view/js/main.js21
-rwxr-xr-xview/tpl/jot-header.tpl30
2 files changed, 41 insertions, 10 deletions
diff --git a/view/js/main.js b/view/js/main.js
index 8bd4357cc..ca7d50b90 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -247,6 +247,7 @@ var pageHasMoreContent = true;
var updateCountsOnly = false;
var divmore_height = 400;
var last_filestorage_id = null;
+var mediaPlaying = false;
$(function() {
$.ajaxSetup({cache: false});
@@ -359,7 +360,7 @@ function NavUpdate() {
if(liking)
$('.like-rotator').spin(false);
- if(! stopped) {
+ if((! stopped) && (! mediaPlaying)) {
var pingCmd = 'ping' + ((localUser != 0) ? '?f=&uid=' + localUser : '');
$.get(pingCmd,function(data) {
@@ -595,6 +596,24 @@ function updateConvItems(mode,data) {
$('body').css('cursor', 'auto');
}
+ $('video').off('playing');
+ $('video').off('pause');
+ $('audio').off('playing');
+ $('audio').off('pause');
+
+ $('video').on('playing', function() {
+ mediaPlaying = true;
+ });
+ $('video').on('pause', function() {
+ mediaPlaying = false;
+ });
+ $('audio').on('playing', function() {
+ mediaPlaying = true;
+ });
+ $('audio').on('pause', function() {
+ mediaPlaying = false;
+ });
+
/* autocomplete @nicknames */
$(".comment-edit-form textarea").editor_autocomplete(baseurl+"/acl?f=&n=1");
diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl
index b405e4ac8..84fccc105 100755
--- a/view/tpl/jot-header.tpl
+++ b/view/tpl/jot-header.tpl
@@ -190,15 +190,27 @@ function enableOnUser(){
}
function jotGetLink() {
- reply = prompt("{{$linkurl}}");
- if(reply && reply.length) {
- reply = bin2hex(reply);
- $('#profile-rotator').spin('tiny');
- $.get('{{$baseurl}}/linkinfo?f=&binurl=' + reply, function(data) {
- addeditortext(data);
- $('#profile-rotator').spin(false);
- });
- }
+ textarea = document.getElementById('profile-jot-text');
+ if (textarea.selectionStart || textarea.selectionStart == "0") {
+ var start = textarea.selectionStart;
+ var end = textarea.selectionEnd;
+ if (end > start) {
+ reply = prompt("{{$linkurl}}");
+ if(reply && reply.length) {
+ textarea.value = textarea.value.substring(0, start) + "[url=" + reply + "]" + textarea.value.substring(start, end) + "[/url]" + textarea.value.substring(end, textarea.value.length);
+ }
+ } else {
+ reply = prompt("{{$linkurl}}");
+ if(reply && reply.length) {
+ reply = bin2hex(reply);
+ $('#profile-rotator').spin('tiny');
+ $.get('{{$baseurl}}/linkinfo?f=&binurl=' + reply, function(data) {
+ addeditortext(data);
+ $('#profile-rotator').spin(false);
+ });
+ }
+ }
+ }
}
function jotVideoURL() {