[wp-hackers] r2748 broken edit-form-advanced.php javascript part.

Gea-Suan Lin gslin at ccca.nctu.edu.tw
Sat Aug 6 23:40:35 GMT 2005


(my WordPress version is 1.6-ALPHA-do-not-use)

After checkout the latest version, I found I can't use alexking's advanced
edit mode. After check the diff, I found the problem is in r2748.

See: http://trac.wordpress.org/changeset/2748#file0

If you put the following line before id="content", the javascript will fail:
edCanvas = document.getElementById('content');

In my Firefox 1.0.6, javascript console says:

Error: myField has no properties
Smurce File: http://gslin.org/wp-admin/quicktags.js
Line: 292

So I quickly fix it: (but I don't know if this fix will break tinymce)

--- edit-form-advanced.php      Sat Aug  6 16:35:00 2005
+++ /home/gslinn/edit-form-advanced.php Sat Aug  6 16:36:02 2005
@@ -139,6 +139,11 @@
 <legend><?php _e('Post') ?></legend>
 <?php if ( !get_option('rich_editing') ) : ?>
 <?php the_quicktags(); ?>
+<script type="text/javascript">
+<!--
+edCanvas = document.getElementById('content');
+//-->
+</script>
 <?php endif; ?>
 <?php
  $rows = get_settings('default_post_edit_rows');
@@ -147,11 +152,6 @@
  }
 ?>
 <div><textarea title="true" rows="<?php echo $rows; ?>" cols="40" name="content" tabindex="2" id="content"><?php echo $post->post_content ?></textarea></div>
-<script type="text/javascript">
-<!--
-edCanvas = document.getElementById('content');
-//-->
-</script>
 </fieldset>

 <?php echo $form_pingback ?>
@@ -216,4 +216,4 @@

 </div>

-</form>
+</form>

-- 
* Gea-Suan Lin  (public key: http://ccreader.nctu.edu.tw/~gslin/key.txt)
* If you cannot convince them, confuse them.           -- Harry S Truman


More information about the wp-hackers mailing list