PageSourceSearch

https://research.nint.com/assets/a401e651/dist/js/demo.js?v=2

js nint.com collected 2026-10-07 15:09:48 UTC 19,415 bytes, 368 lines download raw bytes

1/**
2 * AdminLTE Demo Menu
3 * ------------------
4 * You should not use this file in production.
5 * This file is for demo purposes only.
6 */
7$(function () {
8    'use strict'
9
10    /**
11     * Get access to plugins
12     */
13
14    $('[data-toggle="control-sidebar"]').controlSidebar()
15    $('[data-toggle="push-menu"]').pushMenu()
16    var $pushMenu = $('[data-toggle="push-menu"]').data('lte.pushmenu')
17    var $controlSidebar = $('[data-toggle="control-sidebar"]').data('lte.controlsidebar')
18    var $layout = $('body').data('lte.layout')
19    $(window).on('load', function () {
20        // Reinitialize variables on load
21        $pushMenu = $('[data-toggle="push-menu"]').data('lte.pushmenu')
22        $controlSidebar = $('[data-toggle="control-sidebar"]').data('lte.controlsidebar')
23        $layout = $('body').data('lte.layout')
24    })
25
26    /**
27     * List of all the available skins
28     *
29     * @type Array
30     */
31    var mySkins = [
32        'skin-blue-light',
33        'skin-black-light',
34        'skin-red-light',
35        'skin-yellow-light',
36        'skin-purple-light',
37        'skin-green-light',
38        'skin-blue',
39        'skin-black',
40        'skin-red',
41        'skin-yellow',
42        'skin-purple',
43        'skin-green'
44    ]
45    var myLanguage = [
46        'en',
47        'zh_CN',
48        'zh_TW',
49        'ja_JP'
50    ]
51
52    /**
53     * Get a prestored setting
54     *
55     * @param String name Name of of the setting
56     * @returns String The value of the setting | null
57     */
58    function get(name) {
59        if (typeof (Storage) !== 'undefined') {
60            return localStorage.getItem(name)
61        } else {
62            window.alert('Please use a modern browser to properly view this template!')
63        }
64    }
65
66    /**
67     * Store a new settings in the browser
68     *
69     * @param String name Name of the setting
70     * @param String val Value of the setting
71     * @returns void
72     */
73    function store(name, val) {
74        if (typeof (Storage) !== 'undefined') {
75            localStorage.setItem(name, val)
76        } else {
77            window.alert('Please use a modern browser to properly view this template!')
78        }
79    }
80
81    /**
82     * Toggles layout classes
83     *
84     * @param String cls the layout class to toggle
85     * @returns void
86     */
87    function changeLayout(cls) {
88        $('body').toggleClass(cls)
89        $layout.fixSidebar()
90        if ($('body').hasClass('fixed') && cls == 'fixed') {
91            $pushMenu.expandOnHover()
92            $layout.activate()
93        }
94        $controlSidebar.fix()
95    }
96
97    /**
98     * Replaces the old skin with the new skin
99     * @param String cls the new skin class
100     * @returns Boolean false to prevent link's default action
101     */
102    function changeSkin(cls) {
103        $.each(mySkins, function (i) {
104            $('body').removeClass(mySkins[i])
105        })
106
107        $('body').addClass(cls)
108        store('skin', cls)
109        return false
110    }
111    // Replaces the old language with the new language.
112    function changeLanguage(cls) {
113        // $('html').prop('lang', cls)
114        store('language', cls)
115        // Utils.initI18n();
116        return false
117    }
118
119    /**
120     * Retrieve default settings and apply them to the template
121     *
122     * @returns void
123     */
124    function setup() {
125        var tmp = get('skin')
126        var language = get('language')
127        if (tmp && $.inArray(tmp, mySkins))
128            changeSkin(tmp)
129        if (language && $.inArray(language, myLanguage))
130            changeLanguage(language)
131        $('input[name=language]').each(function (i) {
132            if ($(this).data('language') == language) {
133                $(this).prop('checked', true);
134                return
135            }
136        })
137
138        // Add the change skin listener
139        $('[data-skin]').on('click', function (e) {
140            if ($(this).hasClass('knob'))
141                return
142            e.preventDefault()
143            changeSkin($(this).data('skin'))
144        })
145
146        // Add the change language listener
147        $('[data-language]').on('click', function (e) {
148            changeLanguage($(this).data('language'))
149            window.location.reload()
150        })
151
152        // Add the layout manager
153        $('[data-layout]').on('click', function () {
154            changeLayout($(this).data('layout'))
155        })
156
157        $('[data-controlsidebar]').on('click', function () {
158            changeLayout($(this).data('controlsidebar'))
159            var slide = !$controlSidebar.options.slide
160
161            $controlSidebar.options.slide = slide
162            if (!slide)
163                $('.control-sidebar').removeClass('control-sidebar-open')
164        })
165
166        $('[data-sidebarskin="toggle"]').on('click', function () {
167            var $sidebar = $('.control-sidebar')
168            if ($sidebar.hasClass('control-sidebar-dark')) {
169                $sidebar.removeClass('control-sidebar-dark')
170                $sidebar.addClass('control-sidebar-light')
171            } else {
172                $sidebar.removeClass('control-sidebar-light')
173                $sidebar.addClass('control-sidebar-dark')
174            }
175        })
176
177        $('[data-enable="expandOnHover"]').on('click', function () {
178            $(this).attr('disabled', true)
179            $pushMenu.expandOnHover()
180            if (!$('body').hasClass('sidebar-collapse'))
181                $('[data-layout="sidebar-collapse"]').click()
182        })
183
184        //  Reset options
185        if ($('body').hasClass('fixed')) {
186            $('[data-layout="fixed"]').attr('checked', 'checked')
187        }
188        if ($('body').hasClass('layout-boxed')) {
189            $('[data-layout="layout-boxed"]').attr('checked', 'checked')
190        }
191        if ($('body').hasClass('sidebar-collapse')) {
192            $('[data-layout="sidebar-collapse"]').attr('checked', 'checked')
193        }
194
195    }
196
197    // Create the new tab
198    var $tabPane = $('<div />', {
199        'id': 'control-sidebar-theme-demo-options-tab',
200        'class': 'tab-pane active'
201    })
202
203    // Create the tab button
204    var $tabButton = $('<li />', { 'class': 'active' })
205        .html('<a href=\'#control-sidebar-theme-demo-options-tab\' data-toggle=\'tab\'>'
206            + '<i class="fa fa-wrench"></i>'
207            + '</a>')
208
209    // Add the tab button to the right sidebar tabs
210    $('[href="#control-sidebar-home-tab"]')
211        .parent()
212        .before($tabButton)
213
214    // Create the menu
215    var $demoSettings = $('<div />')
216
217    // Layout options
218    $demoSettings.append(
219        '<h4 class="control-sidebar-heading">'
220        // + '布局设定'
221        // + '</h4>'
222        // // Control Sidebar Skin Toggle
223        // + '<div class="form-group">'
224        // + '<label class="control-sidebar-subheading" style="display: flex;">'
225        // + '<input type="checkbox"data-sidebarskin="toggle"class="pull-right"/> '
226        // + '<span></span>'
227        // + '切换右侧侧边栏背景'
228        // + '</label>'
229        // + '<p>将右侧操作栏背景亮色或深色切换</p>'
230        // + '</div>'
231    )
232
233    var $languageList = $('<ul />', { 'class': 'list-unstyled clearfix', 'style': 'display: flex;justify-content: flex-start;align-items: center;flex-wrap: wrap;' });
234    var $languageZhCN = $('<li />', { style: 'float:left; width: 50%; padding: 5px;' }).append('<label style="width: 100%;display: flex;">'
235        + '<input type="radio" class="pull-right" data-language="zh-CN" name="language" value="zh-CN" checked> <span></span>中文简体</label>'
236    )
237    $languageList.append($languageZhCN)
238
239    var $languageZhTW = $('<li />', { style: 'float:left; width: 50%; padding: 5px;' }).append('<label style="width: 100%;display: flex;">'
240        + '<input type="radio" class="pull-right" data-language="zh-TW" name="language" value="zh-TW"> <span></span>中文繁体</label>'
241    )
242    // $languageList.append($languageZhTW)
243
244    var $languageEn = $('<li />', { style: 'float:left; width: 50%; padding: 5px;' }).append('<label style="width: 100%;display: flex;">'
245        + '<input type="radio" class="pull-right" data-language="en" name="language" value="en"> <span></span>English</label>'
246    )
247    $languageList.append($languageEn)
248
249    var $languageJaJP = $('<li />', { style: 'float:left; width: 50%; padding: 5px;' }).append('<label style="width: 100%;display: flex;">'
250        + '<input type="radio" class="pull-right" data-language="ja-JP" name="language" value="ja-JP"> <span></span>日本語</label>'
251    )
252    // $languageList.append($languageJaJP)
253
254    $demoSettings.append('<h4 class="control-sidebar-heading">语言设定</h4>')
255    $demoSettings.append($languageList)
256
257    var $skinsList = $('<ul />', { 'class': 'list-unstyled clearfix' })
258
259    // Dark sidebar skins
260    var $skinBlack =
261        $('<li />', { style: 'float:left;
261 width: 33.33333%; padding: 5px;' })
262            .append('<a href="javascript:void(0)" data-skin="skin-black" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
263                + '<div style="box-shadow: 0 0 2px rgba(0,0,0,0.1)" class="clearfix"><span style="display:block; width: 20%; float: left; height: 7px; background: #252733"></span><span style="display:block; width: 80%; float: left; height: 7px; background: #252733"></span></div>'
264                + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #fff"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f1f4f6"></span></div>'
265                + '</a>'
266                + '<p class="text-center no-margin">Black</p>')
267    $skinsList.append($skinBlack)
268    var $skinBlue =
269        $('<li />', { style: 'float:left; width: 33.33333%; padding: 5px;' })
270            .append('<a href="javascript:void(0)" data-skin="skin-blue" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
271                + '<div><span style="display:block; width: 20%; float: left; height: 7px; background: #367fa9"></span><span class="bg-light-blue" style="display:block; width: 80%; float: left; height: 7px;"></span></div>'
272                + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #222d32"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
273                + '</a>'
274                + '<p class="text-center no-margin">Blue</p>')
275    $skinsList.append($skinBlue)
276    var $skinPurple =
277        $('<li />', { style: 'float:left; width: 33.33333%; padding: 5px;' })
278            .append('<a href="javascript:void(0)" data-skin="skin-purple" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
279                + '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-purple-active"></span><span class="bg-purple" style="display:block; width: 80%; float: left; height: 7px;"></span></div>'
280                + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #222d32"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
281                + '</a>'
282                + '<p class="text-center no-margin">Purple</p>')
283    $skinsList.append($skinPurple)
284    var $skinGreen =
285        $('<li />', { style: 'float:left; width: 33.33333%; padding: 5px;' })
286            .append('<a href="javascript:void(0)" data-skin="skin-green" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
287                + '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-green-active"></span><span class="bg-green" style="display:block; width: 80%; float: left; height: 7px;"></span></div>'
288                + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #222d32"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
289                + '</a>'
290                + '<p class="text-center no-margin">Green</p>')
291    $skinsList.append($skinGreen)
292    var $skinRed =
293        $('<li />', { style: 'float:left; width: 33.33333%; padding: 5px;' })
294            .append('<a href="javascript:void(0)" data-skin="skin-red" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
295                + '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-red-active"></span><span class="bg-red" style="display:block; width: 80%; float: left; height: 7px;"></span></div>'
296                + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #222d32"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
297                + '</a>'
298                + '<p class="text-center no-margin">Red</p>')
299    $skinsList.append($skinRed)
300    var $skinYellow =
301        $('<li />', { style: 'float:left;
301 width: 33.33333%; padding: 5px;' })
302            .append('<a href="javascript:void(0)" data-skin="skin-yellow" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
303                + '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-yellow-active"></span><span class="bg-yellow" style="display:block; width: 80%; float: left; height: 7px;"></span></div>'
304                + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #222d32"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
305                + '</a>'
306                + '<p class="text-center no-margin">Yellow</p>')
307    $skinsList.append($skinYellow)
308
309    // Light sidebar skins
310    var $skinBlueLight =
311        $('<li />', { style: 'float:left; width: 33.33333%; padding: 5px;' })
312            .append('<a href="javascript:void(0)" data-skin="skin-blue-light" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
313                + '<div><span style="display:block; width: 20%; float: left; height: 7px; background: #367fa9"></span><span class="bg-light-blue" style="display:block; width: 80%; float: left; height: 7px;"></span></div>'
314                + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #f9fafc"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
315                + '</a>'
316                + '<p class="text-center no-margin" style="font-size: 12px">Blue Light</p>')
317    $skinsList.append($skinBlueLight)
318    var $skinBlackLight =
319        $('<li />', { style: 'float:left; width: 33.33333%; padding: 5px;' })
320            .append('<a href="javascript:void(0)" data-skin="skin-black-light" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
321                + '<div style="box-shadow: 0 0 2px rgba(0,0,0,0.1)" class="clearfix"><span style="display:block; width: 20%; float: left; height: 7px; background: #fefefe"></span><span style="display:block; width: 80%; float: left; height: 7px; background: #fefefe"></span></div>'
322                + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #f9fafc"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
323                + '</a>'
324                + '<p class="text-center no-margin" style="font-size: 12px">Black Light</p>')
325    $skinsList.append($skinBlackLight)
326    var $skinPurpleLight =
327        $('<li />', { style: 'float:left; width: 33.33333%; padding: 5px;' })
328            .append('<a href="javascript:void(0)" data-skin="skin-purple-light" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
329                + '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-purple-active"></span><span class="bg-purple" style="display:block; width: 80%; float: left; height: 7px;"></span></div>'
330                + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #f9fafc"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
331                + '</a>'
332                + '<p class="text-center no-margin" style="font-size: 12px">Purple Light</p>')
333    $skinsList.append($skinPurpleLight)
334    var $skinGreenLight =
335        $('<li />', { style: 'float:left; width: 33.33333%; padding: 5px;' })
336            .append('<a href="javascript:void(0)" data-skin="skin-green-light" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
337                + '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-green-active"></span><span class="bg-green" style="display:block; width: 80%; float: left; height: 7px;"></span></div>'
338                + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #f9fafc"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
339                + '</a>'
340                + '<p class="text-center no-margin" style="font-size: 12px">Green Light</p>')
341    $skinsList.append($skinGreenLight)
342    var $skinRedLight =
343        $('<li />', { style: 'float:left;
343 width: 33.33333%; padding: 5px;' })
344            .append('<a href="javascript:void(0)" data-skin="skin-red-light" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
345                + '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-red-active"></span><span class="bg-red" style="display:block; width: 80%; float: left; height: 7px;"></span></div>'
346                + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #f9fafc"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
347                + '</a>'
348                + '<p class="text-center no-margin" style="font-size: 12px">Red Light</p>')
349    $skinsList.append($skinRedLight)
350    var $skinYellowLight =
351        $('<li />', { style: 'float:left; width: 33.33333%; padding: 5px;' })
352            .append('<a href="javascript:void(0)" data-skin="skin-yellow-light" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
353                + '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-yellow-active"></span><span class="bg-yellow" style="display:block; width: 80%; float: left; height: 7px;"></span></div>'
354                + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #f9fafc"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
355                + '</a>'
356                + '<p class="text-center no-margin" style="font-size: 12px">Yellow Light</p>')
357    $skinsList.append($skinYellowLight)
358
359    // $demoSettings.append('<h4 class="control-sidebar-heading">主题</h4>')
360    // $demoSettings.append($skinsList)
361
362    $tabPane.append($demoSettings)
363    $('#control-sidebar-home-tab').after($tabPane)
364
365    setup()
366
367    $('[data-toggle="tooltip"]').tooltip()
368})

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.