PageSourceSearch

https://stagebuddy.com/wp-content/plugins/layouts/extra/theme_inte…/resources/js/layouts-loader.js?ver=1.3.5

js stagebuddy.com collected 2026-10-02 04:20:37 UTC 2,790 bytes, 82 lines download raw bytes

1var DDLayout = DDLayout || {};
2
3DDLayout.ThemeIntegrations = DDLayout.ThemeIntegrations || {};
4
5DDLayout.ThemeIntegrations.LayoutsLoader = function($){
6    var self = this, $button = $('.js-ddl-layouts-loader-button'), $messages = $('.js-upload-layouts-message'), loader = new WPV_Toolset.Utils.Loader;
7
8    self.init = function(){
9        self.handle_click();
10    };
11
12    self.handle_click = function(){
13        $button.on('click', function(event){
14            event.preventDefault();
15            self.do_ajax(event);
16        });
17    };
18
19    self.do_ajax = function(event){
20        var params = {
21            'ddl_load_default_layouts':DDLayout_Theme.ThemeIntegrationsSettings.ddl_load_default_layouts,
22            'action':'ddl_load_default_layouts'
23        }, load;
24
25        if( pagenow != 'toolset_page_toolset-settings' ){
26            load = loader.loadShow( $(event.target), true);
27            load.css({
28                "top": "14px",
29                "position": "absolute",
30                "right": "16px"
31            });
32        } else {
33            $( document ).trigger( 'js-toolset-event-update-setting-section-triggered' );
34        }
35
36        WPV_Toolset.Utils.do_ajax_post(params,{
37
38            success:function(response){
39                self.messages(event, 'info', DDLayout_Theme.ThemeIntegrationsSettings.layouts_loaded);
40            },
41            error:function(response){
42                self.messages(event, 'error', response.error)
43            },
44            fail:function(errorThrown){
45                self.messages(event, 'error', errorThrown)
46            },
47            always:function(args){
48                loader.loadHide();
49            }
50        });
51    };
52
53    self.messages = function( event, type, message ){
54        if( typeof $(event.target).data('settings') === 'undefined' ){
55
56            if( type === 'info' ){
57                window.location.href = DDLayout_Theme.ThemeIntegrationsSettings.redirect_to + "&layouts_loaded=true";
58            } else {
59                window.location.href = DDLayout_Theme.ThemeIntegrationsSettings.redirect_to + "&layouts_loaded=false";
60            }
61            return;
62
63        } else if( $(event.target).data('settings') === 'yes' ){
64
65            $( document ).trigger( 'js-toolset-event-update-setting-section-completed' );
66            
67            if( type === 'info' ) {
68                var parent = $(event.target).parent();
69                $(event.target).remove();
70                parent.append('<button href="#" class="button button-secondary" disabled="disabled">' + DDLayout_Theme.ThemeIntegrationsSettings.create_layouts + '</button>');
71            }
72        }
73    };
74
75    self.init();
76};
77
78(function ($) {
79    $(function () {
80        DDLayout.ThemeIntegrations.LayoutsLoader.call({}, $);
81    });
82}(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.