PluginProbe
Customize Admin / 1.0
Customize Admin v1.0
trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.5.1 1.6 1.6.6 1.7 1.7.4 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.1 1.8.2 1.8.4 1.9.0 1.9.1 1.9.2 1.9.3 1.9.4 All 29 releases
customize-admin / customize-admin.js

customize-admin.js in Customize Admin 1.0, at customize-admin.js

36 lines 974 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 // Trigger upload dialog
2 jQuery(document).ready(function() {
3 var header_clicked = false;
4 jQuery('#upload_image_button').click(function() {
5 formfield = jQuery('#upload_image').attr('name');
6 tb_show('', 'media-upload.php?type=image&TB_iframe=true');
7 header_clicked = true;
8 return false;
9 });
10
11 // Store original function
12 window.original_send_to_editor = window.send_to_editor;
13 window.original_tb_remove = window.tb_remove;
14
15 // Override removing function (resets our boolean)
16 window.tb_remove = function() {
17 header_clicked = false;
18 window.original_tb_remove();
19 }
20
21 /**
22 * Override send_to_editor function from original script
23 * Writes URL into the textbox.
24 *
25 * Note: If header is not clicked, we use the original function.
26 */
27 window.send_to_editor = function(html) {
28 if (header_clicked) {
29 imgurl = jQuery('img',html).attr('src');
30 jQuery('#upload_image').val(imgurl);
31 tb_remove();
32 } else {
33 window.original_send_to_editor(html);
34 }
35 }
36 });