;(function($) { var itm, win, cats, node, func, path, form, hover, cover, modal, media, multi, titles, extras, editor, inputs, poster, autoNo, header, legacy, rawDesc, checker, content, grouped, itmType, flashNo, scaleNo, autoYes, autoDef, manager, htmlAud, htmlVid, editRaw, category, scaleYes, scaleDef, flashYes, flashDef, htmlTiny, tinyHtml, tinyDesc, hiddenNo, hiddenYes, isChecked, selection, thumbnail, textareas, htmlFrame, buttonAdd, legacyTiny, mediaHolder, thumbHolder, buttonRemove, posterHolder, tinyChecked = 0, keyNumbers = /[^0-9\.|#|-]/g, matches = /none|black-magnify|black-play|black-document|white-magnify|white-play|white-document|blur-magnify|blur-play|blur-document/g, datas = [ "href", "data-jbgroup", "data-jbhref", "data-jbtitle", "data-jbdescription", "data-jbwidth", "data-jbheight", "data-jbthumbnail", "data-jbthumbtooltip", "data-jbhover", "data-jbscaleup", "data-jbautoplay", "data-jbflashhaspriority", "data-jbposter", "data-jbaudiotitle", "data-jbhiddenitem", "data-jbhtml" ], container = '
' + '
' + '
' + 'x' + '
' + '

' + jackboxTranslate["jb_1"] + '


' + '
' + '

' + jackboxTranslate["jb_2"] + '


' + '

' + jackboxTranslate["jb_3"] + ' ?' + '
' + '

' + '

' + '

' + jackboxTranslate["jb_5"] + ' ' + '?' + '' + jackboxTranslate["jb_47"] + '' + '' + jackboxTranslate["jb_7"] + '?' + '' + '' + '' + '' + '

' + '

' + jackboxTranslate["jb_9"] + '


' + '

' + jackboxTranslate["jb_10"] + ' ?' + '
' + '

' + '

' + jackboxTranslate["jb_47"] + '' + jackboxTranslate["jb_12"] + ' ?' + '
' + '

' + '
' + '

' + jackboxTranslate["jb_14"] + ' ?' + '
' + '

' + '

' + jackboxTranslate["jb_16"] + ' ?' + '
' + '

' + '
' + '

' + jackboxTranslate["jb_18"] + ' ?' + '
' + ' ' + jackboxTranslate["jb_yes"] + ' ' + jackboxTranslate["jb_no"] + ' ' + jackboxTranslate["jb_default"] + '' + '

' + '

' + jackboxTranslate["jb_20"] + ' ?
' + '' + '

' + '

' + jackboxTranslate["jb_32"] + ' ' + ' ?' + '
' + '
' + '

' + '

' + jackboxTranslate["jb_34"] + ' ?' + '
' + '

' + '
' + '

' + jackboxTranslate["jb_36"] + ' ?' + '
' + ' ' + jackboxTranslate["jb_yes"] + ' ' + jackboxTranslate["jb_no"] + ' ' + jackboxTranslate["jb_default"] + '' + '

' + '

' + jackboxTranslate["jb_38"] + ' ?' + '
' + ' ' + jackboxTranslate["jb_yes"] + ' ' + jackboxTranslate["jb_no"] + ' ' + jackboxTranslate["jb_default"] + '

' + '
' + '

' + jackboxTranslate["jb_40"] + ' ' + '?' + '
' + '
' + '

' + '

' + jackboxTranslate["jb_42"] + ' ?' + '
' + '

' + '

' + jackboxTranslate["jb_44"] + ' ?' + '
' + ' ' + jackboxTranslate["jb_yes"] + ' ' + jackboxTranslate["jb_no"] + '' + '

' + '

' + '
' + '
' + '
' + '
' + '
'; function startIt(ed, url) { editor = ed; path = url + "/"; legacyTiny = 'getInstanceById' in tinyMCE; var checkOne, checkTwo, called, objOne = {title: "Add/Edit JackBox", image: path + "../img/jackbox.png", onclick: openModal}, objTwo = {title: "Remove JackBox", image: path + "../img/jackbox_remove.png", onclick: removeJackbox}; if(!legacyTiny) { objOne.onPostRender = function() { buttonAdd = this; checkOne = true; if(checkTwo && !called) { called = true; ready(); } } objTwo.onPostRender = function() { buttonRemove = this; checkTwo = true; if(checkOne && !called) { called = true; ready(); } } } editor.addButton("jackbox", objOne); editor.addButton("jackbox_remove", objTwo); if(legacyTiny) ready(true); } function ready(legacy) { checkTiny(); if(!legacy) { editor.on('NodeChange', checkNode); } else { editor.onNodeChange.add(checkNode); } } function checkTiny() { var isVC = $("#vc_properties-panel"), iframe; if(isVC.length && isVC.is(":visible")) { iframe = $("wpb_tinymce_content_ifr"); } else { iframe = $("#content_ifr"); } if(!iframe.length) { tinyChecked++; if(tinyChecked < 25) setTimeout(checkTiny, 50); return; } iframe.one("load.jackbox", tinyLoaded); } function tinyLoaded() { var iframe = $(this); iframe = iframe.contents(); if(!iframe.length) return; iframe = iframe.find("head"); if(!iframe.length) return; $("