PageSourceSearch

https://www.shingle.com/scripts/ContentBuilder/contentbuilder-shared-helpers.bundle.min.js

js shingle.com collected 2026-10-08 03:29:10 UTC 14,002 bytes, 2 lines download raw bytes

1var cbhelpers={};function checkEdit(s,i){$.get("/api/v1/admin/contentbuilder/pageeditinfo?pageName="+encodeURIComponent(s)).then(function(e){var t,n=!1,a=new Date;e&&e.DoesExist&&(a=new Date(e.LastModified),(t=cbhelpers.editChecks[s])&&a>t.Date&&(n=!0),i(n,e))}).fail(function(e){console.log(e),i(!1,null)})}function CapitalizeWords(e){return e.replace(/(^|\s)([a-z])/g,function(e,t,n){return t+n.toUpperCase()})}cbhelpers.constants={},cbhelpers.constants.DISCARDBUTTON_PUBLISHED_TEXT="Revert to Published",cbhelpers.constants.DISCARDBUTTON_NOTPUBLISHED_TEXT_PAGE="Delete Page",cbhelpers.constants.DISCARDBUTTON_NOTPUBLISHED_TEXT_SECTION="Delete Content",cbhelpers.editChecks=[],cbhelpers.showingAlert=!1,cbhelpers.updateEditsAfterSave=function(a){checkEdit(a,function(e,t){var n=new Date;t&&t.DoesExist&&(n=new Date(t.LastModified)),cbhelpers.editChecks[a]={Date:n,LastCheckDate:new Date},console.log("pageName",a,cbhelpers.editChecks[a])})},cbhelpers.checkEdits=function(n){0==cbhelpers.showingAlert&&checkEdit(n,function(e,t){e&&(cbhelpers.showingAlert=!0,$.everywhere.alert({body:"<h3>Page Edits Made</h3><p> It appears this page has been saved elsewhere and this content is out of date. Please note that saving changes will override any exisiting changes. Updated By: "+t.LastModifiedBy+"</p>",modalIcon:"exclamation",type:"warning",afterCloseMethod:function(){cbhelpers.showingAlert=!1}})),cbhelpers.editChecks[n]?cbhelpers.editChecks[n].LastCheckDate=new Date:(e=new Date,t&&t.DoesExist&&(e=new Date(t.LastModified)),cbhelpers.editChecks[n]={Date:e,LastCheckDate:new Date})})},cbhelpers.openSaveOptionsModal=function(e,t,n,a,s){var i=e?new Date(e):null;return $("#everywhere-modal").initModal({keepFooter:!1,header:"Save Changes",body:'<div class="cb-save-modal"><div class="row"><div class="col-12"><p class="help-block">Your saved changes will not be visible to the web unless you publish the page.</p></div><div class="col-md-6 col-12"><button class="btn btn-info btn-block" id="publishButton"><i class="bi bi-cloud-upload-fill"></i> Publish to Site</button></div><div class="col-md-6 col-12"><button class="btn btn-info btn-block" id="PublishOnLink"><i class="bi bi-calendar-check"></i> Publish On...</button></div>'+(e?'<div class="col-12"><div class="alert alert-outline"><span>This page is scheduled to publish on:<br />'+DateHelpers.LocalString(i)+'</span><span class="text-end"><button class="btn btn-default" id="CancelPublishOnLink"><i class="bi bi-x-lg"></i> Cancel</button></span></div></div>':"")+'<div class="col-12 cb-save-or">or</div><div class="col-12"><button class="btn btn-success btn-block" id="SaveInModalButton" title="Ctrl+S"><i class="bi bi-save"></i> Save & Continue Editing</button></div></div></div>',size:"small",classes:"SaveOptionsModal",type:"success",onLoad:function(){cbhelpers.initSaveModalDomEvents(t,n,a,s)}})},cbhelpers.cancelPublishOnDateOnClick=function(e,t,a,n,s){e&&e.preventDefault(),$.get("/api/v1/admin/contentbuilder/cancelPublishOn?name="+t,function(e){e.IsSuccess?(n&&n(),$("#ScheduledPublish").addClass("hidden")):$("#everywhere-modal").alert({body:'<h3>Error</h3><p>There was an error canceling the "Publish On" for this '+a+". Please try again.</p>",type:"danger",modalIcon:"exclamation"})}).fail(function(e,t,n){$("#everywhere-modal").alert({body:'<h3>Error</h3><p>There was an error canceling the "Publish On" for this '+a+". Please try again.</p>",type:"danger",modalIcon:"exclamation"})}).always(function(){s&&s()})},cbhelpers.initSaveModalDomEvents=function(t,n,a,s){$("#CancelButton").click(function(){$(".SaveOptionsModal").modal("hide")}),$("#publishButton").click(function(e){t&&t(e,this),$(".SaveOptionsModal").modal("hide")}),$("#PublishOnLink").on("click",function(e){a&&a(e,this),$(".SaveOptionsModal").modal("hide")}),$("#SaveInModalButton").click(function(e){n&&n(e,this),$(".SaveOptionsModal").modal("hide")}),$("#CancelPublishOnLink").on("click",function(e){s&&s(e,this),$(".SaveOptionsModal").modal("hide")})},cbhelpers.prepareContentBuilderForSave=function(e,t,n,a,s,i,o,l){cbhelpers.cleanContentBuilder(e,t,n,a,s,i,o);function c(){l&&l(),n&&n.startGalleries(),a&&a.initializeElements(),s&&s.initializeElements(),i&&i.initializeElements(),o&&o.initializeElements()}
1var r=$(e).data("saveimages");!r||(t=r.settings)&&(t.onComplete=c,$(e).data("saveimages",r)),$(e).saveimages({handler:"/saveimage.ashx",onComplete:c}),$(e).data("saveimages").save()},cbhelpers.cleanContentBuilder=function(e,t,n,a,s,i,o){t&&t.removeResizerElements(),t&&t.removeReverts(),t&&t.clearHovers(),cbhelpers.removeExtentionDomModifications(e),n&&n.removeGalleriesForSave(),a&&a.removeElements(),s&&s.removeElements(),i&&i.removeElements(),o&&o.removeElements()},cbhelpers.removeExtentionDomModifications=function(e){$("[contenteditable] g").contents().unwrap(),$("grammarly-btn").remove(),$("grammarly-extension").remove(),$("[data-gramm_id]").removeAttr("data-gramm_id"),$("[data-gramm]").removeAttr("data-gramm"),$("[spellcheck]").removeAttr("spellcheck"),$("[data-gramm_editor]").removeAttr("data-gramm_editor"),$(e+" input[style]").css({backgroundImage:"",backgroundAttachment:"",backgroundPosition:"",backgroundRepeat:""})},cbhelpers.resolveSave=function(n,e,a,s,t,i,o,l,c){function r(){t.PublishOn=t.PublishOn?DateHelpers.LocalString(t.PublishOn):null,$(s).removeClass("save-success save-error"),$.post(i,t,function(){cbhelpers.displayPageSaveMessage(l,!1,1e3,s),e&&e(t)}).fail(function(e){e&&e.responseText&&0<=e.responseText.toLowerCase().indexOf("failed to save content")&&($.everywhere.alert({body:e.responseText.substr(1,e.responseText.length-2),type:"danger",modalIcon:"exclamation"}),console.error(e.responseText)),cbhelpers.displayPageSaveMessage(c,!0,5e3,s)}).always(function(){a&&a(n)})}checkEdit(o,function(e,t){e?$.everywhere.confirm({modalIcon:"exclamation",type:"warning",keepHeader:!1,mustClickButtonsToLeave:!0,header:"",body:"<h3>Page Edits</h3><p>This page has a newer version on the server (Last modified by: "+t.LastModifiedBy+"). Are you sure you want to save and overwrite the existing version?</p>",confirmMethod:function(){r()},cancelMethod:function(){cbhelpers.displayPageSaveMessage("Cancelled",!0,5e3,s),a&&a(n)}}):r()})},cbhelpers.getSaveUrl=function(e){return"publish"===e?"/api/v1/admin/contentbuilder/PublishContent":"/api/v1/admin/contentbuilder/SaveContent"},cbhelpers.displayPageSaveMessage=function(e,t,n,a){$(a).html(e);t=t?"save-error":"save-success";$(a).addClass(t),$(a).fadeIn(),$(a).delay(n),$(a).fadeOut()},cbhelpers.confirmChangesOnRedirect=function(e,t,n){!0===t?$("#everywhere-modal").confirm({keepHeader:!1,body:"<h3>Unsaved Changes</h3><p>"+n+'<br /><strong class="text-danger">WILL CAUSE DATA LOSS</strong></div><p>Do you wish to continue?</p>',type:"warning",modalIcon:"exclamation",confirmMethod:function(){e&&e()}}):e&&e()},cbhelpers.getPageInfoFormat=function(){for(var e=(e=window.location.pathname).replace(".aspx",""),t=["/products/search","/part/","/
1p/","/catsearch/","/supplier/"],n=!1,a=0;a<t.length;a++)if(e.startsWith(t[a])){n=!0;break}return e=(e=(e=!0===n?"/products/search":e).startsWith("/itemdetail")?"/itemdetail":e).startsWith("/")?e.substring(1):e},cbhelpers.doShortcuts=function(e,t){(e.ctrlKey||e.metaKey)&&"s"===String.fromCharCode(e.which).toLowerCase()&&(e.preventDefault(),t&&t())},cbhelpers.deletePage=function(t,e,n,a,s){$.post("/api/v1/admin/contentbuilder/DeletePublishedUnpublishedPage?pageName="+t,{},function(e){a&&a(t)}).fail(function(){cbhelpers.displayPageSaveMessage(e,!0,5e3,n)}).always(function(){s&&s(t)})},cbhelpers.deleteUnpublishedPage=function(e,t,n,a,s,i){$.get("/api/v1/admin/contentbuilder/DeleteUnpublished?pagename="+e,function(){a&&a()}).fail(function(){cbhelpers.displayPageSaveMessage(t,!0,5e3,n),s&&s()}).always(function(){i&&i()})},cbhelpers.publishOnDateOnClick=function(e,t,n){var a;e&&e.preventDefault();var s=t?new Date(t):null;$("#everywhere-modal").confirm({header:"Schedule Your Publish",body:'<div class="date p-3 bg-light"><div id="PublishDate"><div id="TimeZone">'+DateHelpers.PrintTimezone()+"</div></div></div>",classes:"publish-on-modal",type:"success",onLoad:function(){var e;a=$("#PublishDate").datetimepicker({inline:!0,sideBySide:!0,minDate:new Date}),s?a.data("DateTimePicker").date(s):(e=DateHelpers.ClearTime(DateHelpers.AddDays(new Date,1)),a.data("DateTimePicker").date(e))},confirmButtonClass:"btn-success publish-button",confirmText:"Schedule Publish",confirmDismissModal:!1,confirmMethod:function(){var e=a.data("DateTimePicker").date().toDate();e&&DateHelpers.IsAfter(e,new Date)?($("#PublishDate").closest(".everywhere-modal").modal("hide"),console.log("date: ",e),n&&n(e)):$("#everywhere-modal").alert({body:"<h3>Please select a valid date and time</h3><p>The date/time must be scheduled for after this moment.</p>",type:"warning",modalIcon:"exclamation"})}})},cbhelpers.openDeletePageModal=function(e,t,n){$("#everywhere-modal").confirm({keepHeader:!1,body:"<h3>Deleting this "+e+" is IRREVERSIBLE!</h2><p>"+t+'</p><div class="checkbox text-center"><label><input type="checkbox" id="userUnderstandsWillDeletePageCheckbox" /> I understand that this will permanently delete this '+e+".</label></div>",type:"danger",modalIcon:"exclamation",confirmText:"Delete "+CapitalizeWords(e),confirmIcon:"bi-trash",confirmDismissModal:!1,classes:"DeletePageModal",onLoad:function(){$("#userUnderstandsWillDeletePageCheckbox").change(function(){var e=$
1("#userUnderstandsWillDeletePageCheckbox").closest(".checkbox");null!==e&&e.length&&(this.checked?e.removeClass("user-does-not-understand-checkbox-error"):e.addClass("user-does-not-understand-checkbox-error"))})},confirmMethod:function(){!0===document.getElementById("userUnderstandsWillDeletePageCheckbox").checked?($(".DeletePageModal").closest(".modal").modal("hide"),n&&n()):cbhelpers.handleUserUnderstandsDeleteCheckboxNotClicked()}})},cbhelpers.handleUserUnderstandsDeleteCheckboxNotClicked=function(){var e=$("#userUnderstandsWillDeletePageCheckbox").closest(".checkbox");null!==e&&e.length&&e.addClass("user-does-not-understand-checkbox-error")},cbhelpers.openRevertToPublishedModal=function(e,t){$("#everywhere-modal").confirm({keepHeader:!1,body:"<h3>Reverting Changes is Irreversible.</h3><p>Are you sure you want to discard changes? Reverting to published will delete the most recent changes, and revert to the last published version of this "+e+".</p>",type:"danger",modalIcon:"exclamation",confirmMethod:t})},cbhelpers.confirmChangesUnsaved=function(e,t,n){!0===e?$("#everywhere-modal").confirm({keepHeader:!1,body:"<h3>Unsaved Changes</h3><p>"+t+'<br /><strong class="text-danger">WILL CAUSE DATA LOSS</strong>.</p><p>Do you wish to continue?</>',type:"warning",modalIcon:"exclamation",confirmMethod:function(){n&&n()}}):n&&n()},cbhelpers.openSaveChangesOrContinueModal=function(e,t,n,a){var s;!0===n?(s="save-changes-continue-discard-modal modal-type-warning everywhere-alert",$("#everywhere-modal").initModal({keepFooter:!1,keepHeader:!1,body:'<h3 class="save-changes-continue-discard-modal-title">You Have Unsaved Changes</h3><p class="save-changes-continue-discard-modal-text">You must save or discard your changes before switching to another editor view.<br />Do you want to save your changes?</p><div class="save-changes-continue-discard-modal-top text-center"><button type="button" class="btn btn-success" id="save-changes-continue-discard-modal-save-btn"> Save Changes & Continue</button> <button type="button" class="btn btn-default" id="save-changes-continue-discard-modal-cancel-btn">Cancel</button></div> <div class="save-changes-continue-discard-modal-bottom text-center"><a href="#" class="btn-link" id="save-changes-continue-discard-modal-discard-btn">Discard Changes & Continue</a></div>',size:"medium",type:"warning",modalIcon:"exclamation",classes:s,onLoad:function(){$("#save-changes-continue-discard-modal-save-btn").click(function(){e&&e(),$("."+s).modal("hide")}),$("#save-changes-continue-discard-modal-cancel-btn").click(function(){$("."+s).modal("hide")}),$("#save-changes-continue-discard-modal-discard-btn").click(function(){$("."+s).modal("hide"),t&&t()})}})):a&&a()},cbhelpers.initContentBuilder=function(e,t,n,a,s,i,o,l,c,r,d,h,u){u=e.contentbuilder({onDrop:function(e,t){n&&n.handleNewDrops(),a&&a.handleNewDrops(),s&&s.handleNewDrops(),i&&i.handleNewDrops(),o.updateReverts()},onSortEnd:function(e,t){},snippetPage:h,snippetCategories:d,snippetPathReplace:["assets/","/scripts/InnovaStudio/ContentBox/assets/"],snippetFile:"/admin2/content/snippetlist?isSearch"+c,modulePath:"/scripts/InnovaStudio/ContentBox/assets/modules/",snippetOpen:!0,imageselect:"/content/imagebrowser",fileselect:"/content/filebrowser?modalTitle=Browse Links",iconselect:"/content/iconbrowser",toolbar:"left",onRender:function(){r&&$(t+" *:not(.ui-draggable):not(.cb-snippet):not(.row-tool):not(.row-tool *):not(li):not(a):not(button):not(span):not(.element-name)").each(function(){0===$(this).find("div.element-name").length&&$(this).prepend('<div class="element-name">'+$(this).prop("tagName")+"</div>")}),$("#selSnips").change(function(){setTimeout(function(){var t=[];$("#divSnippetList >
1 div").each(function(){var e=$(this).data("cat")+"-"+$(this).data("snip");-1===t.indexOf(e)?t.push(e):$(this).remove()})},1)})},addSnippetCategories:[],onFinishInit:u});return $("body").off("click","#btnDelRowOk",null),$("body").on("click.rowDeleteListener","#btnDelRowOk",function(){setTimeout(function(){o.updateReverts()},550)}),u},cbhelpers.fixOldPages=function(e){if(null===e||0===e.length||""===e.html().trim())return"";var t=e.contents().filter(function(){return 3===this.nodeType&&0!==$.trim(this.textContent).length}),n=e.find(".cb-snip, .cb-snippet");return 0<t.length||0===n.length?e.html('<div contenteditable="true"><div>'+e.html()+"</div></div>"):e.children().filter(function(){return 0===$(this).closest(".cb-snip, .cb-snippet").length}).attr("contenteditable",!0),e.html()||""};
2//# sourceMappingURL=contentbuilder-shared-helpers.bundle.min.js.map

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.