PageSourceSearch

https://robust-themes.com/themes/js/theme-editor.js?v=52.1

js robust-themes.com collected 2026-09-24 12:36:07 UTC 6,874 bytes, 271 lines download raw bytes

1(function($) {
2
3    $('.accout_template .theme_only').each(function (){
4        $(this).attr('class','theme_only')
5    })
6
7
8    $('.te_show_buttons_block').click(function(){
9    
10        sidebar_block_show('buttons') 
11     });
12
13     $('.sidebar_buttons .sbw_back,.sidebar_buttons .apply_btn').click(function(){
14        sidebar_block_hide('buttons') 
15     }); 
16
17     
18     $('.nblock-hamburger').click(function(){
19        toggle_r2()
20     });
21     
22
23
24
25     $('.te_show_demos_btn').click(function(){   
26        account_page_show('demos')
27
28        add_inner_pages_to_demos_page()
29           
30        setTimeout(function (){
31            let dname = DEMO_NAME.replace('Landing-','').replace('landing-','')
32            dname = dname.charAt(0).toUpperCase() + dname.slice(1);
33            console.log(dname)
34            let offset = $('.demoLOGO[data-logo="'+dname+'"]').closest('.demo_wrap')[0].offsetTop - 200
35            $('.page_wrap').scrollTop(offset)
36
37            if (window.innerWidth < 786){
38                toggle_r2()
39            }
40
41        },500)
42
43     });
44
45     $('.te_show_blogs_btn, .mi_blog').click(function(){
46        sidebar_item_set_active($(this))
47        account_page_show('browse_pages')
48        on_show_browse_pages('blog')
49        $('.browse_pages_page').addClass('hide-page-filters')
50     });
51     $('.te_show_store_btn, .mi_store').click(function(){
52        sidebar_item_set_active($(this))
53        account_page_show('browse_pages')
54        on_show_browse_pages('store')
55        $('.browse_pages_page').addClass('hide-page-filters')
56     });
57     $('.te_show_library_btn, .mi_library').click(function(){
58        sidebar_item_set_active($(this))
59        account_page_show('browse_pages')
60        on_show_browse_pages('library')
61        $('.browse_pages_page').addClass('hide-page-filters')
62     });
63
64     $('.te_show_blogs_btn, .mi_browse_pages').click(function(){
65        sidebar_item_set_active($(this))
66        account_page_show('browse_pages')
67        on_show_browse_pages('show all')
68        $('.browse_pages_page').removeClass('hide-page-filters')
69     });
70
71     console.log('theme-editor.js')
72
73
74
75
76     $('.te_open_popus').click(function(){
77        open_exit_popup()
78    });   
79
80
81     
82
83
84})(jQuery);
85
86is_BAP = false
87
88console.log('theme-editor')
89function set_url(){
90    var url = '/themes/' + DEMO_NAME
91    var parms = '';
92    if (DEMO.colors != ''){
93        parms += '&colors=' + DEMO.colors
94    }
95    if (DEMO.sections != ''){
96        parms += '&sections=' + DEMO.sections
97    }
98    if (DEMO.fonts != ''){
99        parms += '&fonts=' + DEMO.fonts
100    }
101    if (DEMO.buttons != ''){
102        parms += '&buttons=' + DEMO.buttons.replace('btn_','')
103    }
104    if (parms != ''){
105        parms = "?" + parms.substring(1)
106    }
107    
108    history.pushState('', '', url + parms)
109}
110
111DOC_READY_EVENT_TRIGGERED = false
112$(document).ready(function (){
113    on_load_get_url_parms()
114    colors_onload()
115
116    DOC_READY_EVENT_TRIGGERED = true
117
118
119 
120})
121
122
123function on_load_get_url_parms(){
124    DEMO = {colors:'',sections:'',fonts:'',buttons:''}
125    let urlParams = new URLSearchParams(window.location.search);
126
127    let sections =  urlParams.get('sections')
128    if (sections != null){
129        DEMO.sections = sections
130    }
131    let colors =  urlParams.get('colors')
132    if (colors != null){
133        DEMO.colors = colors
134    }
135    let fonts =  urlParams.get('fonts')
136    if (fonts != null){
137        DEMO.fonts = fonts.replace(/ /g,'+')
138    }
139}
140
141// for console use only  
142function sectionNames_to_sectionCodes(){
143    
144    var code = 100;
145    var codes2names = {}
146    var names2code = {}
147    for (key of Object.keys(DEMOS)){
148        let names = DEMOS[key]
149        for (aname of names){
150            codes2names[code] = aname
151            names2code[aname] = code
152            code++
153        }
154    }
155    let codes2names_json = JSON.stringify(codes2names)
156    let names2code_json = JSON.stringify(names2code)
157    console.log(names2code_json)
158}
159
160
161
162
163
164
165
166
167
168
169function close_account_page_before_showing_sections(){
170    $('.account_page').each(function (){
171        if ($(this).css('display') == 'block'){
172            $('.account_page').hide()
173            $('.page').css('transform','scale(0.2)')
174            $('.page').show()
175            return false;
176        }
177    }) 
178}
179
180
181function extract_pallete(){    //  for copy paste to console only
182    SIX_COLORS = '--accent-1,--accent-2,--accent-3,--light-1,--light-2,--light-3,--dark-1,--dark-2,--dark-3'
183    vals = []
184    for (item of SIX_COLORS.split(',')){
185        let val = getComputedStyle(document.documentElement).getPropertyValue(item);
186        vals.push(val) 
187    }
188    vals_st =  vals.join("','")
189    vals_st = "['" + vals_st + "']"
190    console.log(DEMO_NAME + "\t" + vals_st)
191}
192
193
194window.addEventListener('popstate', (event) => {
195    window.location.href = window.location.href
196})
197
198
199
200window.addEventListener("pageshow", function() {
201   if (!DOC_READY_EVENT_TRIGGERED){
202    close_account_pages()
203   }
204}, false);
205
206function close_account_pages(){
207    if ($('body').hasClass('move_mode')){
208        return;
209    }
210
211    $('.menu-links').show()
212    $('.page').show()
213    $('.account_page').hide()
214    $('.page').css('transform', 'unset')
215}
216
217NO_VIDEO = false
218if (window.innerWidth > 786){
219    if (NO_VIDEO){
220        setTimeout(function () {
221            open_exit_popup()
222        }, 10000)
223    }
224
225}
226
227$('.tip_popup_wrap i').click(function (){
228    $('.tip_popup_wrap').css('transform','scale(0)')
229    setTimeout(function (){
230        $('.tip_popup_overlay').css('opacity','0');
231        setTimeout(function (){
232            $('.tip_popup_overlay').css('display', 'none');
233        },200)
234    },100)
235})
236
237
238
239function typewrite_pages1(){
240
241    NOTIFIC_height = 24
242    setTimeout(function (){
243    $('.r3_notific').css('transition','height 0.3s ease-in')
244       // $('.r3_notific').css('height','30px')
245        setTimeout(function (){
246             $('.r3_notific').css('transition','height 0.0s ease-in')
247            },500)
248    },300)
249    
250  
251    var notific_elm = $('.notific_text')[0];
252    var typewriter = new Typewriter(notific_elm, {
253        delay: 20
254    });
255
256    typewriter
257    .pauseFor(1000)
258    .typeString('The active demo style <span>'+ DEMO_NAME +'</span> will be automatically applied to provide a consistent look and feel to all pages. <b>Click a thumbnail</b> below <b>to preview the page with the currently selected style</b>, heroes, and buttons.')
259    .callFunction(show_no_need_msg)
260    .start();
261}
262
263function show_no_need_msg(){
264   $('.no_need').show(200)
265}
266
267
268$('.page').on('click','.content-wrapper section:not(.n_header) a',function(e){
269        e.preventDefault()
270})
271

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.