Henry Lyne ([info]henrylyne) wrote in [info]changelog,
@ 2008-08-21 21:20:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
[livejournal] r14147: Remove focus() lines, were throwing erro...
Committer: henrylyne
Remove focus() lines, were throwing errors in IE.
Handle editing of Polls differently, just replace the HTML inside the Poll DIV.
Check for Object before calling Event.stop, was throwing an error in Safari.
Remove stray /select tag.
Change LJ editor buttons to be 16x16px.

U   branches/fckeditor263/htdocs/js/rte.js
U   branches/fckeditor263/htdocs/stc/fck/editor/plugins/livejournal/fckplugin.js
U   branches/fckeditor263/htdocs/stc/fck/editor/plugins/livejournal/ljcut.gif
U   branches/fckeditor263/htdocs/stc/fck/editor/plugins/livejournal/ljpoll.gif
U   branches/fckeditor263/htdocs/stc/fck/editor/plugins/livejournal/ljuser.gif
U   branches/fckeditor263/htdocs/stc/fck/editor/plugins/livejournal/ljvideo.gif
U   branches/fckeditor263/htdocs/tools/fck_poll.bml
Modified: branches/fckeditor263/htdocs/js/rte.js
===================================================================
--- branches/fckeditor263/htdocs/js/rte.js	2008-08-21 16:35:56 UTC (rev 14146)
+++ branches/fckeditor263/htdocs/js/rte.js	2008-08-21 21:20:23 UTC (rev 14147)
@@ -107,7 +107,6 @@
     }
 
     $("switched_rte_on").value = '1';
-    if (focus()) { editor_frame.focus() };
 
     return false; // do not follow link
 }
@@ -132,7 +131,6 @@
         html = html.replace(/ /g, ' ');
     }
 
-    if (focus()) { editor_frame.focus() };
     $(textArea).value = html;
     oEditor.Focus();
 

Modified: branches/fckeditor263/htdocs/stc/fck/editor/plugins/livejournal/fckplugin.js
===================================================================
--- branches/fckeditor263/htdocs/stc/fck/editor/plugins/livejournal/fckplugin.js	2008-08-21 16:35:56 UTC (rev 14146)
+++ branches/fckeditor263/htdocs/stc/fck/editor/plugins/livejournal/fckplugin.js	2008-08-21 21:20:23 UTC (rev 14147)
@@ -277,7 +277,15 @@
         // Make the tag like the editor would
         var html = "<div id=\"poll"+index+"\">"+poll+"</div>";
 
-        FCK.InsertHtml(html);
+        // IE and Safari handle Selections differently and InsertHtml
+        // will not overwrite the enclosing DIVs in those browsers,
+        // so just replace the selected polls innerHTML
+        if (FCK.Selection.Element) {
+            FCK.Selection.Element.innerHTML = poll;
+        } else {
+            FCK.InsertHtml(html);
+        }
+
     }
 
     return;
@@ -306,7 +314,7 @@
         var href = "href='javascript:Poll.callRichTextEditor()'";
         var notice = parent.LJ_IPPU.showNote("Polls must be edited inside the Poll Wizard<br /><a "+href+">Go to poll wizard</a>", ele);
         notice.centerOnWidget(ele);
-        parent.Event.stop(evt);
+        if (parent.Event.stop) parent.Event.stop(evt);
     }
 }
 

Modified: branches/fckeditor263/htdocs/stc/fck/editor/plugins/livejournal/ljcut.gif
===================================================================
(Binary files differ)

Modified: branches/fckeditor263/htdocs/stc/fck/editor/plugins/livejournal/ljpoll.gif
===================================================================
(Binary files differ)

Modified: branches/fckeditor263/htdocs/stc/fck/editor/plugins/livejournal/ljuser.gif
===================================================================
(Binary files differ)

Modified: branches/fckeditor263/htdocs/stc/fck/editor/plugins/livejournal/ljvideo.gif
===================================================================
(Binary files differ)

Modified: branches/fckeditor263/htdocs/tools/fck_poll.bml
===================================================================
--- branches/fckeditor263/htdocs/tools/fck_poll.bml	2008-08-21 16:35:56 UTC (rev 14146)
+++ branches/fckeditor263/htdocs/tools/fck_poll.bml	2008-08-21 21:20:23 UTC (rev 14147)
@@ -58,7 +58,10 @@
             pollID = eSelected.id.replace(/poll(\d+)/, "$1");
             index = pollID;
             if (FCK.EditorWindow.top.LJPoll[pollID]) populateWizard(pollID);
+            // Save the element selected
+            FCK.Selection.Element = eSelected;
         } else {
+            if (FCK.Selection.Element) delete FCK.Selection.Element;
             pollID = FCK.EditorWindow.top.LJPoll.length;
         }
         index = pollID || FCK.EditorWindow.top.LJPoll.length;
@@ -340,7 +343,6 @@
     <input name="whoview" value="all" type="radio" id="whoview_all" checked="checked"> <label for="whoview_all">Everyone</label><br />
     <input name="whoview" value="friends" type="radio" id="whoview_friends"> <label for="whoview_friends">Friends</label><br />
     <input name="whoview" value="none" type="radio" id="whoview_none"> <label for="whoview_none">Only You</label>
-    </select>
     </p>
 </div>
 <div id="divQuestions" style="DISPLAY: none">



Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…