[wp-hackers] thickbox in wp-admin

Frank Bueltge frank at bueltge.de
Mon Aug 30 20:09:19 UTC 2010


I use the thickbox function/scripts in own pages on wp-admin. i give the
size of the window with this script:
Example:
<script type="text/javascript">
<!--
 var viewportwidth;
var viewportheight;
 if (typeof window.innerWidth != 'undefined') {
viewportwidth = window.innerWidth-80,
 viewportheight = window.innerHeight-100
} else if (typeof document.documentElement != 'undefined'
 && typeof document.documentElement.clientWidth !=
'undefined' && document.documentElement.clientWidth != 0)
 {
viewportwidth = document.documentElement.clientWidth,
viewportheight = document.documentElement.clientHeight
 } else { // older versions of IE
viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
 viewportheight = document.getElementsByTagName('body')[0].clientHeight
}
 //document.write('<p class="textright">Your viewport width is
'+viewportwidth+'x'+viewportheight+'</p>');
 document.write('<a onclick="return false;" href="<?php echo WP_PLUGIN_URL .
'/' . FB_ADM_BASEDIR; ?>/inc/index.php?username=<?php echo DB_USER;
?>&?KeepThis=true&amp;TB_iframe=true&amp;height='+viewportheight+'&width='+viewportwidth+'"
class="thickbox button"><?php _e( 'Start ', FB_TEXTDOMAIN ); ?></a>');
 //-->
</script>

this works fine on own pages in backend of WP, dont worls on exists pages in
the wp-admin, like wp-admin/plugins.php

It is not possible to set the wight  and height on the URL in the link - any
ideas or what is my error?

Many thanks for your help for this small request on my plugins.
Best wishes


More information about the wp-hackers mailing list