PluginProbe
Adminimize / 1.7.12
Adminimize v1.7.12
1.11.14 1.11.13 1.11.1 1.11.10 1.11.11 1.11.12 1.11.2 1.11.3 1.11.4 1.11.5 1.11.6 1.11.7 1.11.8 1.11.9 1.3 1.4.7 1.6 1.7.12 1.7.13 1.7.14 1.7.15 1.7.16 1.7.17 1.7.18 1.7.19 All 53 releases
adminimize / js / tb_window.js

tb_window.js in Adminimize 1.7.12, at js/tb_window.js

54 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 // send html to the post editor
2 function send_to_editor(h) {
3 if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) {
4 ed.focus();
5 if (tinymce.isIE)
6 ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark);
7
8 if ( h.indexOf('[caption') != -1 )
9 h = ed.plugins.wpeditimage._do_shcode(h);
10
11 ed.execCommand('mceInsertContent', false, h);
12 } else
13 edInsertContent(edCanvas, h);
14
15 tb_remove();
16 }
17
18 /**
19 * new tb_window of media-uplader
20 */
21 jQuery(function($) {
22 tb_position = function() {
23 var tbWindow = $('#TB_window');
24 var width = $(window).width();
25 var H = $(window).height();
26 var W = ( 1720 < width ) ? 1720 : width;
27
28 if ( tbWindow.size() ) {
29 tbWindow.width( W - 50 ).height( H - 45 );
30 $('#TB_iframeContent').width( W - 50 ).height( H - 75 );
31 tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
32 if ( typeof document.body.style.maxWidth != 'undefined' )
33 tbWindow.css({'top':'20px','margin-top':'0'});
34 $('#TB_title').css({'background-color':'#fff','color':'#cfcfcf'});
35 };
36
37 return $('a.thickbox').each( function() {
38 var href = $(this).attr('href');
39 if ( ! href ) return;
40 href = href.replace(/&width=[0-9]+/g, '');
41 href = href.replace(/&height=[0-9]+/g, '');
42 $(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) );
43 });
44 };
45
46 jQuery('a.thickbox').click(function(){
47 if ( typeof tinyMCE != 'undefined' && tinyMCE.activeEditor ) {
48 tinyMCE.get('content').focus();
49 tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark('simple');
50 }
51 });
52
53 $(window).resize( function() { tb_position() } );
54 });