First add a button :
I assume that you want to add into add content / edit content form. create a module and add this code
function YOUR_MODULE_NAME_form_alter(&$form, $form_state, $form_id) {
if(strpos($form_id,"_node_form")>0) //katalog göster gizle butonudur, iframe açıp kapatır, getemfix.js dosyasını kullanır
{
$jslink = "return (katalogshowhide());"; // ta ta ta return is the trick here, we return false
$form['katalog-goster-butonu'] = array(
'#type' => 'submit',
'#value' => t('Katalog Göster'),
'#attributes' => array('onclick' => $jslink), //we call function here
'#executes_submit_callback' => FALSE
);
}
}
paste this is YOUR_MODULE_NAME.js file
function katalogshowhide()
{
if ( jQuery("#fileselect").is(':visible')!=true )
{
if(jQuery('#fileselect').length > 0) jQuery('#fileselect').remove();
jQuery('#fileselect').show();
}
else
{
jQuery("#fileselect").hide();
}
return false;
}
that's all