From 7e487fcf7005d1e1465ef6acb332cc1009676413 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 17 Jan 2014 16:58:45 +0100 Subject: renamed conflicting JavaScript functions FS#2915 --- lib/scripts/edit.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/scripts/edit.js') diff --git a/lib/scripts/edit.js b/lib/scripts/edit.js index b1dbff683..56c185db7 100644 --- a/lib/scripts/edit.js +++ b/lib/scripts/edit.js @@ -148,7 +148,7 @@ function addBtnActionSignature($btn, props, edid) { function currentHeadlineLevel(textboxId){ var field = jQuery('#' + textboxId)[0], s = false, - opts = [field.value.substr(0,getSelection(field).start)]; + opts = [field.value.substr(0,DWgetSelection(field).start)]; if (field.form.prefix) { // we need to look in prefix context opts.push(field.form.prefix.value); @@ -217,10 +217,10 @@ jQuery(function () { } // set focus and place cursor at the start - var sel = getSelection($edit_text[0]); + var sel = DWgetSelection($edit_text[0]); sel.start = 0; sel.end = 0; - setSelection(sel); + DWsetSelection(sel); $edit_text.focus(); } -- cgit v1.2.3 From 8af71b8cc80c9e5a62803443c04acd24ba725e42 Mon Sep 17 00:00:00 2001 From: Szymon Olewniczak Date: Fri, 7 Feb 2014 17:59:24 +0100 Subject: add preventDefault to toolbar buttons --- lib/scripts/edit.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/scripts/edit.js') diff --git a/lib/scripts/edit.js b/lib/scripts/edit.js index 56c185db7..2400103e1 100644 --- a/lib/scripts/edit.js +++ b/lib/scripts/edit.js @@ -134,7 +134,10 @@ function pickerInsert(text,edid){ */ function addBtnActionSignature($btn, props, edid) { if(typeof SIG != 'undefined' && SIG != ''){ - $btn.bind('click', bind(insertAtCarret,edid,SIG)); + $btn.bind('click', function (e) { + insertAtCarret(edid,SIG); + e.preventDefault(); + }); return edid; } return ''; @@ -148,7 +151,7 @@ function addBtnActionSignature($btn, props, edid) { function currentHeadlineLevel(textboxId){ var field = jQuery('#' + textboxId)[0], s = false, - opts = [field.value.substr(0,DWgetSelection(field).start)]; + opts = [field.value.substr(0,getSelection(field).start)]; if (field.form.prefix) { // we need to look in prefix context opts.push(field.form.prefix.value); @@ -217,10 +220,10 @@ jQuery(function () { } // set focus and place cursor at the start - var sel = DWgetSelection($edit_text[0]); + var sel = getSelection($edit_text[0]); sel.start = 0; sel.end = 0; - DWsetSelection(sel); + setSelection(sel); $edit_text.focus(); } -- cgit v1.2.3 From 79fb388be6474bbcc2c2306bf229aca6d97bcd2a Mon Sep 17 00:00:00 2001 From: Szymon Olewniczak Date: Fri, 7 Feb 2014 18:06:23 +0100 Subject: megre changes --- lib/scripts/edit.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/scripts/edit.js') diff --git a/lib/scripts/edit.js b/lib/scripts/edit.js index 2400103e1..76e6d124b 100644 --- a/lib/scripts/edit.js +++ b/lib/scripts/edit.js @@ -151,7 +151,7 @@ function addBtnActionSignature($btn, props, edid) { function currentHeadlineLevel(textboxId){ var field = jQuery('#' + textboxId)[0], s = false, - opts = [field.value.substr(0,getSelection(field).start)]; + opts = [field.value.substr(0,DWgetSelection(field).start)]; if (field.form.prefix) { // we need to look in prefix context opts.push(field.form.prefix.value); @@ -220,10 +220,10 @@ jQuery(function () { } // set focus and place cursor at the start - var sel = getSelection($edit_text[0]); + var sel = DWgetSelection($edit_text[0]); sel.start = 0; sel.end = 0; - setSelection(sel); + DWsetSelection(sel); $edit_text.focus(); } -- cgit v1.2.3 From 133181ec79ac75661d1f79d5f4f256fed821f72d Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 14 Feb 2014 10:34:55 +0100 Subject: fixed whitespace errors introduced in #535 --- lib/scripts/edit.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/scripts/edit.js') diff --git a/lib/scripts/edit.js b/lib/scripts/edit.js index 76e6d124b..c07b8f975 100644 --- a/lib/scripts/edit.js +++ b/lib/scripts/edit.js @@ -135,9 +135,9 @@ function pickerInsert(text,edid){ function addBtnActionSignature($btn, props, edid) { if(typeof SIG != 'undefined' && SIG != ''){ $btn.bind('click', function (e) { - insertAtCarret(edid,SIG); - e.preventDefault(); - }); + insertAtCarret(edid,SIG); + e.preventDefault(); + }); return edid; } return ''; -- cgit v1.2.3