WJF Routine Optimizer</n > <style> body { font-family: sans-serif; font-size: 14px; padding: 1rem; } h1,h2 { color: #047857; margin-bottom: .5rem; } .hidden { display: none; } #moveFilter { width: 100%; padding: .5rem; margin-bottom: .5rem; box-sizing: border-box; } #movesList, #connectionsList { max-height: 350px; overflow-y: auto; border:1px solid #ccc; margin-bottom: 1rem; } .move-header, .move-row { display: grid; grid-template-columns: 2.5rem 2.5rem 3rem 4rem 1fr 6rem 6rem; gap: .5rem; align-items: center; padding: .25rem .5rem; } .move-header { font-weight: bold; background: #f3f4f6; } .move-row:nth-child(odd) { background: #fafafa; } .move-header > *, .move-row > * { white-space: normal; overflow: visible; text-overflow: clip; } table { border-collapse: collapse; margin-top: 1rem; width: 100%; } th, td { border: 1px solid #ccc; padding: .5rem; text-align: center; white-space: nowrap; } .highlight { background-color: #fff3b0 !important; } button { margin: .5rem .25rem; padding: .5rem 1rem; } #previewArea { margin-top: 1rem; font-size: 1.1rem; font-weight: bold; color: #b45309; } label { font-size: .85rem; display: inline-flex; align-items: center; gap: .25rem; } #potentialScore { margin-bottom: 1rem; font-weight: bold; } </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.3.2/papaparse.min.js"></script> </head> <body> <h1>WJF Routine Optimizer</h1> <!-- STEP 1 --> <div id="step1"> <h2>Step 1: Add All Moves You Can Do</h2> <input type="text" id="moveFilter" placeholder="Filter moves by name, class, qty..." /> <div id="potentialScore">Potential max score: 0</div> <div id="movesList"> <div class="move-header"> <div></div> <div></div> <div>Objs</div> <div>Class</div> <div>Move Name</div> <div>Catches</div> <div>Score</div> </div> <!-- rows injected here --> </div> <button id="toStep2" disabled>Next: Configure Connections →</button> </div> <!-- STEP 2 --> <div id="step2" class="hidden"> <h2>Step 2: Which Connections Can You Do?</h2> <div id="connectionsList">Loading…</div> <button id="toStep3" disabled>Compute Best Routine →</button> </div> <!-- STEP 3 --> <div id="step3" class="hidden"> <h2>Step 3: Recommended Routine</h2> <label><input type="checkbox" id="lastSuccess" checked /> Last move succeeded? (uncheck = double penalty)</label> <div id="animationControls" class="hidden"> <button id="playBtn">▶ Play Routine</button> <button id="stopBtn" disabled>■ Stop</button> </div> <div id="previewArea"></div> <table id="resultTable"> <thead> <tr><th>#</th><th>Move</th><th>Base</th><th>Bonus</th><th>Step Score</th><th>Cumulative</th></tr> </thead> <tbody></tbody> </table> </div> <script> const MOVES_CSV_URL = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vR-M5GmE5sAKxIRfAXAALCR-A0IQHwgckP7tX7qR0IsfhqfMGjmwsDMVpCGOWzfZ0zLG2QRLdcHjFzE/pub?gid=1978749368&single=true&output=csv'; const CONNECTIONS_CSV_URL = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vR-M5GmE5sAKxIRfAXAALCR-A0IQHwgckP7tX7qR0IsfhqfMGjmwsDMVpCGOWzfZ0zLG2QRLdcHjFzE/pub?gid=1981027047&single=true&output=csv'; let allMoves = [], allConns = {}, rowSettings = []; let selectedMoves = [], selectedConns = {}, bestSeq = []; let animInt, currentStep = 0; function popcount(x){ let c=0; while(x){c+=x&1; x>>>=1;} return c; } // Load Moves Papa.parse(MOVES_CSV_URL, { download:true, header:true, skipEmptyLines:true, complete: r => { allMoves = r.data.map(row => ({ name: row['Move'].trim(), className: row['Class'].trim(), qty: +row['Quantity']||0, minC: +row['Min. catches']||0, maxC: +row['Maximum catches']||0, scoreMin: +row['Score ranking (Min)']||0, scoreMax: +row['Score ranking (Max)']||0, siteswap: (row['SiteSwap']||'').trim(), spin: (row['Spin']||'').trim() })); rowSettings = allMoves.map(m=>({selected:false, mode: m.minC===m.maxC ? 'min' : null, locked:false})); renderMoves(); } }); // Load Connections Papa.parse(CONNECTIONS_CSV_URL, { download:true, header:true, skipEmptyLines:true, complete: r => { const cols = r.meta.fields.filter(f=>'Move'!==f); r.data.forEach(row => { const from = row['Move'].trim(); allConns[from] = {}; cols.forEach(c => allConns[from][c.trim()] = +row[c]||0); }); } }); // Render Moves function renderMoves(){ const ml = document.getElementById('movesList'); // clear old rows ml.querySelectorAll('.move-row').forEach(n=>n.remove()); allMoves.forEach((m,i) => { const div = document.createElement('div'); div.className='move-row'; // select const chk = document.createElement('input'); chk.type='checkbox'; chk.id='chk'+i; chk.onchange = () => { rowSettings[i].selected = chk.checked; updateSelection(); }; div.append(chk); // lock const lock = document.createElement('input'); lock.type='checkbox'; lock.id='lock'+i; lock.title='Lock this move'; lock.onchange = () => { rowSettings[i].locked = lock.checked; }; div.append(lock); // qty div.append(Object.assign(document.createElement('span'),{textContent:m.qty})); // class div.append(Object.assign(document.createElement('span'),{textContent:m.className})); // name div.append(Object.assign(document.createElement('span'),{textContent:m.name})); // catches + mode const catchSpan = document.createElement('span'); if(m.minC!==m.maxC){ const r1=document.createElement('input'); r1.type='radio'; r1.name='catch'+i; r1.value='min'; r1.onchange=()=>{rowSettings[i].mode='min'; updateSelection();}; const r2=document.createElement('input'); r2.type='radio'; r2.name='catch'+i; r2.value='max'; r2.onchange=()=>{rowSettings[i].mode='max'; updateSelection();}; catchSpan.append(`Min(${m.minC})`,r1,`Max(${m.maxC})`,r2); } else { catchSpan.textContent=m.minC; rowSettings[i].mode='min'; } div.append(catchSpan); // score cell const sc = document.createElement('span'); sc.id='score'+i; sc.textContent='–'; div.append(sc); ml.append(div); }); document.getElementById('moveFilter').oninput = filterMoves; } function filterMoves(){ const q = this.value.toLowerCase(); document.querySelectorAll('.move-row').forEach((row,i)=>{ const m=allMoves[i]; const text = (m.name + m.className + m.qty).toLowerCase(); row.style.display = text.includes(q)? '' : 'none'; }); } function updateSelection(){ // build selectedMoves selectedMoves = []; let total=0; allMoves.forEach((m,i)=>{ if(rowSettings[i].selected){ const mode = rowSettings[i].mode||'min'; const sc = mode==='max'?m.scoreMax:m.scoreMin; total += sc; selectedMoves.push(Object.assign({chosenScore:sc},m)); } document.getElementById('score'+i).textContent = rowSettings[i].selected ? ((rowSettings[i].mode==='max'?m.scoreMax:m.scoreMin).toFixed(2)) : '–'; }); // show potential max of top 20 if(selectedMoves.length>20){ const sorted = selectedMoves.map(m=>m.chosenScore).sort((a,b)=>b-a); total = sorted.slice(0,20).reduce((a,b)=>a+b,0); } document.getElementById('potentialScore').textContent = `Potential max score: ${total.toFixed(2)}`; // enable Next const cnt=selectedMoves.length; document.getElementById('toStep2').disabled = cnt<3; } document.getElementById('toStep2').onclick = ()=>{ document.getElementById('step1').classList.add('hidden'); renderConnections(); document.getElementById('step2').classList.remove('hidden'); }; // Render Connections function renderConnections(){ const cl=document.getElementById('connectionsList'); cl.innerHTML=''; selectedConns={}; selectedMoves.forEach(m1=>{ selectedConns[m1.name]={}; selectedMoves.forEach(m2=>{ if(m1.name===m2.name) return; const cb=document.createElement('input'); cb.type='checkbox'; cb.onchange=()=>selectedConns[m1.name][m2.name]=cb.checked; const lbl=document.createElement('label'); lbl.append(cb,` ${m1.name} → ${m2.name} (\${allConns[m1.name]?.[m2.name]?.toFixed(2)||'0.00'})`); cl.append(lbl); }); }); document.getElementById('toStep3').disabled=false; } document.getElementById('toStep3').onclick = ()=>{ document.getElementById('step2').classList.add('hidden'); computeBest(); document.getElementById('step3').classList.remove('hidden'); document.getElementById('animationControls').classList.remove('hidden'); document.getElementById('lastSuccess').onchange=renderTable; setupAnimation(); }; // DP + Class Limits + Last Move function computeBest(){ let moves = [...selectedMoves]; // enforce pick-top-20 by chosenScore if(moves.length>20) moves.sort((a,b)=>b.chosenScore-a.chosenScore), moves=moves.slice(0,20); const n=moves.length; const names=moves.map(m=>m.name); const base=moves.reduce((o,m)=>((o[m.name]=m.chosenScore),o),{}); // class-masks let sync6=0,syncGt6=0,async3=0,c97531=0,sp360=0,sp180=0; moves.forEach((m,i)=>{ if(m.qty===5&&/SiteSync/i.test(m.siteswap)){ const num=+m.siteswap.match(/\d+/)[0]; num<=6?sync6|=1<<i:syncGt6|=1<<i; } if(m.qty===5&&/AsyncSite/i.test(m.siteswap)&&+m.siteswap.match(/\d+/)[0]===3) async3|=1<<i; if(m.name==='97531') c97531|=1<<i; if(m.spin==='3 up 360') sp360|=1<<i; if(m.spin==='3 up 180') sp180|=1<<i; }); const size=1<<n; const dp=Array(size).fill(0).map(()=>Array(n).fill(0).map(()=>({score:-Infinity,prev:-1}))); for(let i=0;i<n;i++) dp[1<<i][i]={score:base[names[i]],prev:-1}; for(let mask=1;mask<size;mask++) for(let last=0;last<n;last++){ const st=dp[mask][last]; if(st.score===-Infinity) continue; for(let nxt=0;nxt<n;nxt++) if(!(mask&(1<<nxt))){ const nm=names[nxt], nmM=mask|(1<<nxt); if(popcount(nmM&sync6)>1||popcount(nmM&syncGt6)>1||popcount(nmM&async3)>2||popcount(nmM&c97531)>2||popcount(nmM&sp360)>2||popcount(nmM&sp180)>2) continue; const bonus=selectedConns[names[last]]?.[nm]?allConns[names[last]][nm]:0; const cand=st.score+base[nm]+bonus; if(cand>dp[nmM][nxt].score) dp[nmM][nxt]={score:cand,prev:last}; } } let best={score:-Infinity,mask:0,last:-1}; for(let mask=0;mask<size;mask++) if(popcount(mask)>=3)for(let last=0;last<n;last++){ const st=dp[mask][last]; if(st.score>best.score) best={score:st.score,mask,last}; } const seq=[]; let{mask,last}=best; while(last>=0){ seq.push(last); const p=dp[mask][last].prev; mask^=1<<last; last=p; } seq.reverse(); bestSeq = seq.map((idx,i)=>{ const name=names[idx], bs=base[name], pr=i>0?names[seq[i-1]]:null, bn=pr&&selectedConns[pr]?.[name]?allConns[pr][name]:0; return {name,base:bs,bonus:bn}; }); renderTable(); } function renderTable(){ clearAnim(); const tb=document.querySelector('#resultTable tbody'); tb.innerHTML=''; let cum=0; const ok=document.getElementById('lastSuccess').checked; bestSeq.forEach((st,i)=>{ const last=i===bestSeq.length-1, raw=st.base+st.bonus, step=last?raw*2*(ok?1:-1):raw; cum+=step; const tr=document.createElement('tr'); [i+1,st.name,st.base.toFixed(2),st.bonus.toFixed(2),step.toFixed(2),cum.toFixed(2)].forEach(txt=>{ const td=document.createElement('td'); td.textContent=txt; tr.append(td); }); tb.append(tr); }); } function setupAnimation(){ const play=document.getElementById('playBtn'),stop=document.getElementById('stopBtn'); play.onclick=()=>{ play.disabled=true; stop.disabled=false; currentStep=0; highlight(0); animInt=setInterval(()=>{ currentStep++; if(currentStep>=bestSeq.length){ clearAnim(); return;} highlight(currentStep); },1000); }; stop.onclick=clearAnim; } function highlight(i){ const rows=[...document.querySelectorAll('#resultTable tbody tr')]; rows.forEach(r=>r.classList.remove('highlight')); if(rows[i]){ rows[i].classList.add('highlight'); document.getElementById('previewArea').textContent=`▶ ${bestSeq[i].name}`; }} function clearAnim(){ clearInterval(animInt); document.getElementById('playBtn').disabled=false; document.getElementById('stopBtn').disabled=true; document.getElementById('previewArea').textContent=''; document.querySelectorAll('#resultTable tbody tr').forEach(r=>r.classList.remove('highlight')); } </script> </body> </html> </div> </article> </div><!-- #content --> </div><!-- #primary --> </div><!-- #content-wrap --> </main><!-- #main --> <footer id="footer" class="site-footer" itemscope="itemscope" itemtype="https://schema.org/WPFooter" role="contentinfo"> <div id="footer-inner" class="clr"> <div id="footer-widgets" class="oceanwp-row clr"> <div class="footer-widgets-inner container"> <div class="footer-box span_1_of_3 col col-1"> <div id="ocean_custom_links-3" class="footer-widget widget-oceanwp-custom-links custom-links-widget clr"><ul class="oceanwp-custom-links"><li><a href="https://www.thewjf.com/subscribe/" target="_self" >Subscribe</a></li><li><a href="https://www.thewjf.com/team" target="_self" >Team</a></li><li><a href="https://www.thewjf.com/about" target="_self" >About</a></li><li><a href="https://www.thewjf.com/contact" target="_self" >Contact</a></li></ul></div> </div><!-- .footer-one-box --> <div class="footer-box span_1_of_3 col col-2"> <div id="ocean_social-3" class="footer-widget widget-oceanwp-social social-widget clr"><h4 class="widget-title">Follow Us</h4> <ul class="oceanwp-social-icons no-transition style-simple"> <li class="oceanwp-facebook"><a href="https://www.facebook.com/theWJF/" aria-label="Facebook" target="_blank" rel="noopener noreferrer"><i class=" fab fa-facebook" aria-hidden="true" role="img"></i></a><span class="screen-reader-text">Opens in a new tab</span></li><li class="oceanwp-instagram"><a href="https://www.instagram.com/thewjf/" aria-label="Instagram" target="_blank" rel="noopener noreferrer"><i class=" fab fa-instagram" aria-hidden="true" role="img"></i></a><span class="screen-reader-text">Opens in a new tab</span></li><li class="oceanwp-youtube"><a href="https://www.youtube.com/user/worldjuggling" aria-label="Youtube" target="_blank" rel="noopener noreferrer"><i class=" fab fa-youtube" aria-hidden="true" role="img"></i></a><span class="screen-reader-text">Opens in a new tab</span></li> </ul> </div> </div><!-- .footer-one-box --> <div class="footer-box span_1_of_3 col col-3 "> </div><!-- .footer-one-box --> </div><!-- .container --> </div><!-- #footer-widgets --> <div id="footer-bottom" class="clr no-footer-nav"> <div id="footer-bottom-inner" class="container clr"> <div id="copyright" class="clr" role="contentinfo"> Copyright [2021] - World Juggling Federation </div><!-- #copyright --> </div><!-- #footer-bottom-inner --> </div><!-- #footer-bottom --> </div><!-- #footer-inner --> </footer><!-- #footer --> </div><!-- #wrap --> </div><!-- #outer-wrap --> <a aria-label="Scroll to the top of the page" href="#" id="scroll-top" class="scroll-top-right"><i class=" fa fa-angle-up" aria-hidden="true" role="img"></i></a> <script type="speculationrules"> {"prefetch":[{"source":"document","where":{"and":[{"href_matches":"\/*"},{"not":{"href_matches":["\/wp-*.php","\/wp-admin\/*","\/wp-content\/uploads\/*","\/wp-content\/*","\/wp-content\/plugins\/*","\/wp-content\/themes\/oceanwp\/*","\/*\\?(.+)"]}},{"not":{"selector_matches":"a[rel~=\"nofollow\"]"}},{"not":{"selector_matches":".no-prefetch, .no-prefetch a"}}]},"eagerness":"conservative"}]} </script> <div class="gtranslate_wrapper" id="gt-wrapper-29847721"></div> <script> ( function ( body ) { 'use strict'; body.className = body.className.replace( /\btribe-no-js\b/, 'tribe-js' ); } )( document.body ); </script> <div id="pum-1738" role="dialog" aria-modal="false" aria-labelledby="pum_popup_title_1738" class="pum pum-overlay pum-theme-1735 pum-theme-hello-box popmake-overlay auto_open click_open" data-popmake="{"id":1738,"slug":"wjf-subscribe","theme_id":1735,"cookies":[{"event":"pum_sub_form_success","settings":{"name":"pum-1738","key":"","session":false,"path":"1","time":"1 month"}},{"event":"pum_sub_form_already_subscribed","settings":{"name":"pum-1738","key":"","session":false,"path":true,"time":"1 month"}},{"event":"on_popup_close","settings":{"name":"pum-1738","key":"","session":null,"path":true,"time":"1 week"}}],"triggers":[{"type":"auto_open","settings":{"cookie_name":["pum-1738"],"delay":"500"}},{"type":"click_open","settings":{"extra_selectors":"","cookie_name":null}}],"mobile_disabled":null,"tablet_disabled":null,"meta":{"display":{"stackable":false,"overlay_disabled":false,"scrollable_content":false,"disable_reposition":false,"size":"medium","responsive_min_width":"0%","responsive_min_width_unit":false,"responsive_max_width":"100%","responsive_max_width_unit":false,"custom_width":"640px","custom_width_unit":false,"custom_height":"380px","custom_height_unit":false,"custom_height_auto":false,"location":"center top","position_from_trigger":false,"position_top":"100","position_left":"0","position_bottom":"0","position_right":"0","position_fixed":false,"animation_type":"fade","animation_speed":"350","animation_origin":"center top","overlay_zindex":false,"zindex":"1999999999"},"close":{"text":"","button_delay":"0","overlay_click":false,"esc_press":false,"f4_press":false},"click_open":[]}}"> <div id="popmake-1738" class="pum-container popmake theme-1735 pum-responsive pum-responsive-medium responsive size-medium"> <div id="pum_popup_title_1738" class="pum-title popmake-title"> Subscribe to the WJF Newsletter </div> <div class="pum-content popmake-content" tabindex="0"> <p><iframe loading="lazy" src="about:blank" width="500" height="570" data-rocket-lazyload="fitvidscompatible" data-lazy-src="https://cdn.forms-content-1.sg-form.com/4815e067-c395-11ee-a10c-e64c672e8b7d"><span data-mce-type="bookmark" style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" class="mce_SELRES_start"></span></iframe><noscript><iframe src="https://cdn.forms-content-1.sg-form.com/4815e067-c395-11ee-a10c-e64c672e8b7d" width="500" height="570"><span data-mce-type="bookmark" style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" class="mce_SELRES_start"></span></iframe></noscript></p> </div> <button type="button" class="pum-close popmake-close" aria-label="Close"> × </button> </div> </div> <script> /* <![CDATA[ */var tribe_l10n_datatables = {"aria":{"sort_ascending":": activate to sort column ascending","sort_descending":": activate to sort column descending"},"length_menu":"Show _MENU_ entries","empty_table":"No data available in table","info":"Showing _START_ to _END_ of _TOTAL_ entries","info_empty":"Showing 0 to 0 of 0 entries","info_filtered":"(filtered from _MAX_ total entries)","zero_records":"No matching records found","search":"Search:","all_selected_text":"All items on this page were selected. ","select_all_link":"Select all pages","clear_selection":"Clear Selection.","pagination":{"all":"All","next":"Next","previous":"Previous"},"select":{"rows":{"0":"","_":": Selected %d rows","1":": Selected 1 row"}},"datepicker":{"dayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"dayNamesShort":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dayNamesMin":["S","M","T","W","T","F","S"],"monthNames":["January","February","March","April","May","June","July","August","September","October","November","December"],"monthNamesShort":["January","February","March","April","May","June","July","August","September","October","November","December"],"monthNamesMin":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"nextText":"Next","prevText":"Prev","currentText":"Today","closeText":"Done","today":"Today","clear":"Clear"}};/* ]]> */ </script><script src="https://www.thewjf.com/wp-content/plugins/responsive-accordion-and-collapse/js/accordion-custom.js?ver=ec28b37d7a7e3fc19ab5270d678dbf8d" id="call_ac-custom-js-front-js"></script> <script src="https://www.thewjf.com/wp-content/plugins/responsive-accordion-and-collapse/js/accordion.js?ver=ec28b37d7a7e3fc19ab5270d678dbf8d" id="call_ac-js-front-js"></script> <script id="theme-my-login-js-extra"> var themeMyLogin = {"action":"","errors":[]}; </script> <script src="https://www.thewjf.com/wp-content/plugins/theme-my-login/assets/scripts/theme-my-login.min.js?ver=7.1.10" id="theme-my-login-js"></script> <script src="https://www.thewjf.com/wp-content/plugins/beaver-builder-lite-version/js/jquery.imagesloaded.min.js?ver=2.8.6.2" id="imagesloaded-js"></script> <script id="oceanwp-main-js-extra"> var oceanwpLocalize = {"nonce":"9df29b6216","isRTL":"","menuSearchStyle":"drop_down","mobileMenuSearchStyle":"disabled","sidrSource":null,"sidrDisplace":"1","sidrSide":"left","sidrDropdownTarget":"link","verticalHeaderTarget":"link","customScrollOffset":"0","customSelects":".woocommerce-ordering .orderby, #dropdown_product_cat, .widget_categories select, .widget_archive select, .single-product .variations_form .variations select","ajax_url":"https:\/\/www.thewjf.com\/wp-admin\/admin-ajax.php","oe_mc_wpnonce":"5b30133f2b"}; </script> <script src="https://www.thewjf.com/wp-content/themes/oceanwp/assets/js/theme.min.js?ver=4.0.6" id="oceanwp-main-js"></script> <script src="https://www.thewjf.com/wp-content/themes/oceanwp/assets/js/drop-down-mobile-menu.min.js?ver=4.0.6" id="oceanwp-drop-down-mobile-menu-js"></script> <script src="https://www.thewjf.com/wp-content/themes/oceanwp/assets/js/drop-down-search.min.js?ver=4.0.6" id="oceanwp-drop-down-search-js"></script> <script src="https://www.thewjf.com/wp-content/themes/oceanwp/assets/js/vendors/magnific-popup.min.js?ver=4.0.6" id="ow-magnific-popup-js"></script> <script src="https://www.thewjf.com/wp-content/themes/oceanwp/assets/js/ow-lightbox.min.js?ver=4.0.6" id="oceanwp-lightbox-js"></script> <script src="https://www.thewjf.com/wp-content/themes/oceanwp/assets/js/vendors/flickity.pkgd.min.js?ver=4.0.6" id="ow-flickity-js"></script> <script src="https://www.thewjf.com/wp-content/themes/oceanwp/assets/js/ow-slider.min.js?ver=4.0.6" id="oceanwp-slider-js"></script> <script src="https://www.thewjf.com/wp-content/themes/oceanwp/assets/js/scroll-effect.min.js?ver=4.0.6" id="oceanwp-scroll-effect-js"></script> <script src="https://www.thewjf.com/wp-content/themes/oceanwp/assets/js/scroll-top.min.js?ver=4.0.6" id="oceanwp-scroll-top-js"></script> <script src="https://www.thewjf.com/wp-content/themes/oceanwp/assets/js/select.min.js?ver=4.0.6" id="oceanwp-select-js"></script> <script id="flickr-widget-script-js-extra"> var flickrWidgetParams = {"widgets":[]}; </script> <script src="https://www.thewjf.com/wp-content/plugins/ocean-extra/includes/widgets/js/flickr.min.js?ver=ec28b37d7a7e3fc19ab5270d678dbf8d" id="flickr-widget-script-js"></script> <script src="https://www.thewjf.com/wp-content/plugins/page-links-to/dist/new-tab.js?ver=3.3.7" id="page-links-to-js"></script> <script src="https://www.thewjf.com/wp-includes/js/jquery/ui/core.min.js?ver=1.13.3" id="jquery-ui-core-js"></script> <script id="popup-maker-site-js-extra"> var pum_vars = {"version":"1.20.4","pm_dir_url":"https:\/\/www.thewjf.com\/wp-content\/plugins\/popup-maker\/","ajaxurl":"https:\/\/www.thewjf.com\/wp-admin\/admin-ajax.php","restapi":"https:\/\/www.thewjf.com\/wp-json\/pum\/v1","rest_nonce":null,"default_theme":"1732","debug_mode":"","disable_tracking":"","home_url":"\/","message_position":"top","core_sub_forms_enabled":"1","popups":[],"cookie_domain":"","analytics_route":"analytics","analytics_api":"https:\/\/www.thewjf.com\/wp-json\/pum\/v1"}; var pum_sub_vars = {"ajaxurl":"https:\/\/www.thewjf.com\/wp-admin\/admin-ajax.php","message_position":"top"}; var pum_popups = {"pum-1738":{"triggers":[{"type":"auto_open","settings":{"cookie_name":["pum-1738"],"delay":"500"}}],"cookies":[{"event":"pum_sub_form_success","settings":{"name":"pum-1738","key":"","session":false,"path":"1","time":"1 month"}},{"event":"pum_sub_form_already_subscribed","settings":{"name":"pum-1738","key":"","session":false,"path":true,"time":"1 month"}},{"event":"on_popup_close","settings":{"name":"pum-1738","key":"","session":null,"path":true,"time":"1 week"}}],"disable_on_mobile":false,"disable_on_tablet":false,"atc_promotion":null,"explain":null,"type_section":null,"theme_id":"1735","size":"medium","responsive_min_width":"0%","responsive_max_width":"100%","custom_width":"640px","custom_height_auto":false,"custom_height":"380px","scrollable_content":false,"animation_type":"fade","animation_speed":"350","animation_origin":"center top","open_sound":"none","custom_sound":"","location":"center top","position_top":"100","position_bottom":"0","position_left":"0","position_right":"0","position_from_trigger":false,"position_fixed":false,"overlay_disabled":false,"stackable":false,"disable_reposition":false,"zindex":"1999999999","close_button_delay":"0","fi_promotion":null,"close_on_form_submission":false,"close_on_form_submission_delay":"0","close_on_overlay_click":false,"close_on_esc_press":false,"close_on_f4_press":false,"disable_form_reopen":false,"disable_accessibility":false,"theme_slug":"hello-box","id":1738,"slug":"wjf-subscribe"}}; </script> <script src="//www.thewjf.com/wp-content/uploads/pum/pum-site-scripts.js?defer&generated=1738853656&ver=1.20.4" id="popup-maker-site-js"></script> <script id="gt_widget_script_68174178-js-before"> window.gtranslateSettings = /* document.write */ window.gtranslateSettings || {};window.gtranslateSettings['68174178'] = {"default_language":"en","languages":["ar","zh-CN","nl","en","fr","de","it","pt","ru","es"],"url_structure":"none","flag_style":"2d","flag_size":24,"wrapper_selector":"li.menu-item-gtranslate.gt-menu-19697","alt_flags":[],"horizontal_position":"inline","flags_location":"\/wp-content\/plugins\/gtranslate\/flags\/"}; </script><script src="https://www.thewjf.com/wp-content/plugins/gtranslate/js/popup.js?ver=ec28b37d7a7e3fc19ab5270d678dbf8d" data-no-optimize="1" data-no-minify="1" data-gt-orig-url="/routine-optimizer/" data-gt-orig-domain="www.thewjf.com" data-gt-widget-id="68174178" defer></script><script id="gt_widget_script_72343361-js-before"> window.gtranslateSettings = /* document.write */ window.gtranslateSettings || {};window.gtranslateSettings['72343361'] = {"default_language":"en","languages":["ar","zh-CN","nl","en","fr","de","it","pt","ru","es"],"url_structure":"none","flag_style":"2d","flag_size":24,"wrapper_selector":"li.menu-item-gtranslate.gt-menu-81623","alt_flags":[],"horizontal_position":"inline","flags_location":"\/wp-content\/plugins\/gtranslate\/flags\/"}; </script><script src="https://www.thewjf.com/wp-content/plugins/gtranslate/js/popup.js?ver=ec28b37d7a7e3fc19ab5270d678dbf8d" data-no-optimize="1" data-no-minify="1" data-gt-orig-url="/routine-optimizer/" data-gt-orig-domain="www.thewjf.com" data-gt-widget-id="72343361" defer></script><script id="gt_widget_script_29847721-js-before"> window.gtranslateSettings = /* document.write */ window.gtranslateSettings || {};window.gtranslateSettings['29847721'] = {"default_language":"en","languages":["ar","zh-CN","nl","en","fr","de","it","pt","ru","es"],"url_structure":"none","flag_style":"2d","flag_size":24,"wrapper_selector":"#gt-wrapper-29847721","alt_flags":[],"horizontal_position":"left","vertical_position":"top","flags_location":"\/wp-content\/plugins\/gtranslate\/flags\/"}; </script><script src="https://www.thewjf.com/wp-content/plugins/gtranslate/js/popup.js?ver=ec28b37d7a7e3fc19ab5270d678dbf8d" data-no-optimize="1" data-no-minify="1" data-gt-orig-url="/routine-optimizer/" data-gt-orig-domain="www.thewjf.com" data-gt-widget-id="29847721" defer></script><script>window.lazyLoadOptions = { elements_selector: "iframe[data-lazy-src]", data_src: "lazy-src", data_srcset: "lazy-srcset", data_sizes: "lazy-sizes", class_loading: "lazyloading", class_loaded: "lazyloaded", threshold: 300, callback_loaded: function(element) { if ( element.tagName === "IFRAME" && element.dataset.rocketLazyload == "fitvidscompatible" ) { if (element.classList.contains("lazyloaded") ) { if (typeof window.jQuery != "undefined") { if (jQuery.fn.fitVids) { jQuery(element).parent().fitVids(); } } } } }}; window.addEventListener('LazyLoad::Initialized', function (e) { var lazyLoadInstance = e.detail.instance; if (window.MutationObserver) { var observer = new MutationObserver(function(mutations) { var image_count = 0; var iframe_count = 0; var rocketlazy_count = 0; mutations.forEach(function(mutation) { for (var i = 0; i < mutation.addedNodes.length; i++) { if (typeof mutation.addedNodes[i].getElementsByTagName !== 'function') { continue; } if (typeof mutation.addedNodes[i].getElementsByClassName !== 'function') { continue; } images = mutation.addedNodes[i].getElementsByTagName('img'); is_image = mutation.addedNodes[i].tagName == "IMG"; iframes = mutation.addedNodes[i].getElementsByTagName('iframe'); is_iframe = mutation.addedNodes[i].tagName == "IFRAME"; rocket_lazy = mutation.addedNodes[i].getElementsByClassName('rocket-lazyload'); image_count += images.length; iframe_count += iframes.length; rocketlazy_count += rocket_lazy.length; if(is_image){ image_count += 1; } if(is_iframe){ iframe_count += 1; } } } ); if(image_count > 0 || iframe_count > 0 || rocketlazy_count > 0){ lazyLoadInstance.update(); } } ); var b = document.getElementsByTagName("body")[0]; var config = { childList: true, subtree: true }; observer.observe(b, config); } }, false);</script><script data-no-minify="1" async src="https://www.thewjf.com/wp-content/plugins/rocket-lazy-load/assets/js/16.1/lazyload.min.js"></script><script>function lazyLoadThumb(e,alt){var t='<img src="https://i.ytimg.com/vi/ID/hqdefault.jpg" alt="" width="480" height="360">',a='<button class="play" aria-label="play Youtube video"></button>';t=t.replace('alt=""','alt="'+alt+'"');return t.replace("ID",e)+a}function lazyLoadYoutubeIframe(){var e=document.createElement("iframe"),t="ID?autoplay=1";t+=0===this.parentNode.dataset.query.length?'':'&'+this.parentNode.dataset.query;e.setAttribute("src",t.replace("ID",this.parentNode.dataset.src)),e.setAttribute("frameborder","0"),e.setAttribute("allowfullscreen","1"),e.setAttribute("allow", "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"),this.parentNode.parentNode.replaceChild(e,this.parentNode)}document.addEventListener("DOMContentLoaded",function(){var e,t,p,a=document.getElementsByClassName("rll-youtube-player");for(t=0;t<a.length;t++)e=document.createElement("div"),e.setAttribute("data-id",a[t].dataset.id),e.setAttribute("data-query", a[t].dataset.query),e.setAttribute("data-src", a[t].dataset.src),e.innerHTML=lazyLoadThumb(a[t].dataset.id,a[t].dataset.alt),a[t].appendChild(e),p=e.querySelector('.play'),p.onclick=lazyLoadYoutubeIframe});</script></body> </html>