1(function($){ 2 function cleanPath(cur) { 3 cur = cur.replace(/&stage=[a-zA-Z]+/g, ''); 4 cur = cur.replace(/\?stage=[a-zA-Z]+/g, ''); 5 cur = cur.replace(/&startEditing=true/g, ''); 6 return cur; 7 } 8 9 $().ready(function () { 10 11 var editorTimeout = null; 12 13 $('#EditControlsDetector').hover(function () { 14 $('#FrontendEditingControls').show(); 15 clearTimeout(editorTimeout); 16 }, function () { 17 editorTimeout = setTimeout(function () { $('#FrontendEditingControls').hide(); }, 5000); 18 }); 19 20 var isLive = $('#FrontendEditingControls').attr('data-islive') == 'true'; 21 if (!isLive) { 22 $('#FrontendEditingControls').show(); 23 } 24 25 $('#FE_ViewPublished').click(function () { 26 var newUrl = location.protocol + '//' + location.hostname + location.pathname; 27 var cur = cleanPath(location.search); 28 var sep = cur.indexOf('?') > 0 ? '&' : '?'; 29 cur = cur + sep + 'stage=Live'; 30 31 cur += location.hash; 32 33 location.href = newUrl + cur; 34 }) 35 36 $('#FE_EditDraft').click(function () { 37 38 var newUrl = location.protocol + '//' + location.hostname + location.pathname; 39 var cur = cleanPath(location.search); 40 var sep = cur.indexOf('?') > 0 ? '&' : '?'; 41 cur = cur + sep + 'stage=Stage&startEditing=true'; 42 43 cur += location.hash; 44 45 location.href = newUrl + cur; 46 }) 47 }); 48})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.