Ticket #375 (new defect)

Opened 2 years ago

Last modified 2 years ago

Photopress: Insert button doesn't work on IE/WP2 (v0.9.2) - bug in ppInsertAtCursor

Reported by: ivanv Assigned to: isaacwedin
Priority: high Component: photopress
Severity: major Keywords: internet explorer
Cc:

Description

Hi,

I was trying your plugin, and it seems to have a bug in the insertcode/ppInsertAtCursor functions.

In ppInsertAtCursor:

sel = document.selection.createRange()

That line, I believe creates a range from the *popup* window, not from the post window. So I made some changes:

In insertcode change:

openerhandle = window.opener.document.post.content

to:

openerhandle = window.opener.document;

In ppInsertAtCursor, change these lines:

64 - if (document.selection) { 66 - sel = document.selection.createRange();

69 - else if (myField.selectionStart myField.selectionStart == "0") { 70* - insert new code before current line 70 74* - insert new code before current line 74

to:

64 - if (myField.selection) { 66 - sel = myField.selection.createRange();

69 - else if (myField.post.content.selectionStart myField.post.content.selectionStart == "0") { 70 - myField = myField.post.content; 74 (at this point, it becomes line 75) - myField = myField.post.content;

I don't know if those changes have any problems, but it now works for me.

Regards, Ivan V.

Change History

02/22/06 15:48:49 changed by ivanv

what the hell... the formatting got screwed, but I hope you do understand what I tried to accomplish.