jQuery(document).ready(function($){ "use strict"; $(function() { $( "#accordion" ).accordion({heightStyle: "content"}); }); /* var temp = window.send_to_editor; // Restore the main ID when the add media button is pressed jQuery('em.upload_image').on('click', function() { alert("Ok"); parent.tb_show('', 'media-upload.php?type=image&TB_iframe=true'); var field = $(this).prev().attr('id'); window.send_to_editor = function(html){ var img = $('img', html).attr('src'); $('#'+field).val(img); window.send_to_editor = temp; parent.tb_remove(); //$('#album_image_preview').html(''); } });*/ $('.btn_insert').click(function(){ var params = ''; var scname = $(this).attr('data-name'); var sc = ''; var attr = ''; var val = ''; $(this).parent().find('input[type="text"], select, textarea').each(function(){ if( $(this).attr('name') != 'content' ){ if($(this).val() !== ''){ attr = $(this).attr('data-param'); val = $(this).val(); params += attr + '="' + val + '" '; } } }); var textarea = $(this).parent().find('textarea[name="content"]'); if(wsc(scname)){ name = '"' + scname + '"'; }else{ name = scname; } if(textarea.val() !== undefined){ sc = '[jr_' + name + ' ' + params + ']'+$(textarea).val() + '[/jr_'+name+']'; }else{ sc = '[jr_' + name + ' ' + params + ']'; } if(sc !== '') {parent.send_to_editor(sc);} }); }); var sc_closeiframe = function($){ "use strict"; $('.sc_share_iframe').remove(); }; function wsc(s){ "use strict"; if(s === null){ return ''; } return s.indexOf(' ') >= 0; }