aboutsummaryrefslogtreecommitdiff
path: root/web/scripts3.js
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2013-01-03 17:24:54 +0700
committerGravatar Ugnich Anton2013-01-03 17:24:54 +0700
commit881bc336c1cef93d08cd1f14e37f3a3feeb07e58 (patch)
treefcd3ea5ff881a1f59e4d42fd57dee7003b5bcdc1 /web/scripts3.js
parent84e5ac3a172e15f11b04203cf9e93c9d5c8174ed (diff)
many bugfixes
message number js autoselection privacy fix
Diffstat (limited to 'web/scripts3.js')
-rw-r--r--web/scripts3.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/web/scripts3.js b/web/scripts3.js
index ca1fafa1..8be4d551 100644
--- a/web/scripts3.js
+++ b/web/scripts3.js
@@ -96,6 +96,25 @@ function openSocialWindow(url) {
if(window.focus) w.focus();
}
+/******************************************************************************/
+
+jQuery.fn.selectText = function(){
+ var doc = document;
+ var element = this[0];
+ console.log(this, element);
+ if (doc.body.createTextRange) {
+ var range = document.body.createTextRange();
+ range.moveToElementText(element);
+ range.select();
+ } else if (window.getSelection) {
+ var selection = window.getSelection();
+ var range = document.createRange();
+ range.selectNodeContents(element);
+ selection.removeAllRanges();
+ selection.addRange(range);
+ }
+};
+
/*
* jQuery.fn.autoResize 1.14
*/