From 2e3501f5fc39193b1bc558fb2ecb74ceee033a64 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Mon, 19 Jan 2009 22:47:43 -0800 Subject: [PATCH] Adding fix for stupid IE 6 HTTPS warning message. --- static/html/blank.html | 0 static/js/Editor.js | 9 ++++----- 2 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 static/html/blank.html diff --git a/static/html/blank.html b/static/html/blank.html new file mode 100644 index 0000000..e69de29 diff --git a/static/js/Editor.js b/static/js/Editor.js index 7a9d231..f463600 100644 --- a/static/js/Editor.js +++ b/static/js/Editor.js @@ -142,7 +142,7 @@ Editor.prototype.create_iframe = function ( position_after, click_position ) { this.iframe = createDOM( "iframe", { // iframe src attribute is necessary in IE 6 on an HTTPS site to prevent annoying warnings - "src": "about:blank", + "src": MSIE6 && "/static/html/blank.html" || "about:blank", "frameBorder": "0", "scrolling": "no", "id": iframe_id, @@ -278,15 +278,14 @@ Editor.prototype.position_cursor = function ( click_position ) { // if requested, move the text cursor to a specific location if ( click_position ) { var FRAME_BORDER_WIDTH = 2; + click_position.x -= this.iframe.offsetLeft + FRAME_BORDER_WIDTH; + click_position.y -= this.iframe.offsetTop + FRAME_BORDER_WIDTH; if ( this.iframe.contentWindow && this.iframe.contentWindow.getSelection ) { // browsers such as Firefox // TODO } else if ( this.document.selection ) { // browsers such as IE var range = this.document.selection.createRange(); - range.moveToPoint( - click_position.x - this.iframe.offsetLeft - FRAME_BORDER_WIDTH, - click_position.y - this.iframe.offsetTop - FRAME_BORDER_WIDTH - ); + range.moveToPoint( click_position.x, click_position.y ); range.select(); }