WordPress.org

Plugin Directory

photopress

Opened 12 years ago

Last modified 12 years ago

#375 new defect

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

Reported by: ivanv Owned by: isaacwedin
Priority: high Severity: major
Plugin: photopress 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 (1)

comment:1 @ivanv12 years ago

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

Note: See TracTickets for help on using tickets.