PageSourceSearch

https://www.bopp.go.th/edms/dist/js/demo.js

js bopp.go.th collected 2026-10-01 12:26:25 UTC 18,608 bytes, 354 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',
33        'skin-black',
34        'skin-red',
35        'skin-yellow',
36        'skin-purple',
37        'skin-green',
38        'skin-blue-light',
39        'skin-black-light',
40        'skin-red-light',
41        'skin-yellow-light',
42        'skin-purple-light',
43        'skin-green-light'
44    ]
45
46    /**
47     * Get a prestored setting
48     *
49     * @param String name Name of of the setting
50     * @returns String The value of the setting | null
51     */
52    function get(name) {
53        if (typeof (Storage) !== 'undefined') {
54            return localStorage.getItem(name)
55        } else {
56            window.alert('Please use a modern browser to properly view this template!')
57        }
58    }
59
60    /**
61     * Store a new settings in the browser
62     *
63     * @param String name Name of the setting
64     * @param String val Value of the setting
65     * @returns void
66     */
67    function store(name, val) {
68        if (typeof (Storage) !== 'undefined') {
69            localStorage.setItem(name, val)
70        } else {
71            window.alert('Please use a modern browser to properly view this template!')
72        }
73    }
74
75    /**
76     * Toggles layout classes
77     *
78     * @param String cls the layout class to toggle
79     * @returns void
80     */
81    function changeLayout(cls) {
82        $('body').toggleClass(cls)
83        $layout.fixSidebar()
84        if ($('body').hasClass('fixed') && cls == 'fixed') {
85            $pushMenu.expandOnHover()
86            $layout.activate()
87        }
88        $controlSidebar.fix()
89    }
90
91    /**
92     * Replaces the old skin with the new skin
93     * @param String cls the new skin class
94     * @returns Boolean false to prevent link's default action
95     */
96    function changeSkin(cls) {
97        $.each(mySkins, function (i) {
98            $('body').removeClass(mySkins[i])
99        })
100
101        $('body').addClass(cls)
102        store('skin', cls)
103        return false
104    }
105
106    /**
107     * Retrieve default settings and apply them to the template
108     *
109     * @returns void
110     */
111    function setup() {
112        var tmp = get('skin')
113        if (tmp && $.inArray(tmp, mySkins))
114            changeSkin(tmp)
115
116        // Add the change skin listener
117        $('[data-skin]').on('click', function (e) {
118            if ($(this).hasClass('knob'))
119                return
120            e.preventDefault()
121            changeSkin($(this).data('skin'))
122        })
123
124        // Add the layout manager
125        $('[data-layout]').on('click', function () {
126            changeLayout($(this).data('layout'))
127        })
128
129        $('[data-controlsidebar]').on('click', function () {
130            changeLayout($(this).data('controlsidebar'))
131            var slide = !$controlSidebar.options.slide
132
133            $controlSidebar.options.slide = slide
134            if (!slide)
135                $('.control-sidebar').removeClass('control-sidebar-open')
136        })
137
138        $('[data-sidebarskin="toggle"]').on('click', function () {
139            var $sidebar = $('.control-sidebar')
140            if ($sidebar.hasClass('control-sidebar-dark')) {
141                $sidebar.removeClass('control-sidebar-dark')
142                $sidebar.addClass('control-sidebar-light')
143            } else {
144                $sidebar.removeClass('control-sidebar-light')
145                $sidebar.addClass('control-sidebar-dark')
146            }
147        })
148
149        $('[data-enable="expandOnHover"]').on('click', function () {
150            $(this).attr('disabled', true)
151            $pushMenu.expandOnHover()
152            if (!$('body').hasClass('sidebar-collapse'))
153                $('[data-layout="sidebar-collapse"]').click()
154        })
155
156        //  Reset options
157        if ($('body').hasClass('fixed')) {
158            $('[data-layout="fixed"]').attr('checked', 'checked')
159        }
160        if ($('body').hasClass('layout-boxed')) {
161            $('[data-layout="layout-boxed"]').attr('checked', 'checked')
162        }
163        if ($('body').hasClass('sidebar-collapse')) {
164            $('[data-layout="sidebar-collapse"]').attr('checked', 'checked')
165        }
166
167    }
168
169    // Create the new tab
170    var $tabPane = $('<div />', {
171        'id': 'control-sidebar-theme-demo-options-tab',
172        'class': 'tab-pane active'
173    })
174
175    // Create the tab button
176    var $tabButton = $('<li />', {'class': 'active'})
177        .html('<a href=\'#control-sidebar-theme-demo-options-tab\' data-toggle=\'tab\'>'
178            + '<i class="fa fa-wrench"></i>'
179            + '</a>')
180
181    // Add the tab button to the right sidebar tabs
182    $('[href="#control-sidebar-home-tab"]')
183        .parent()
184        .before($tabButton)
185
186    // Create the menu
187    var $demoSettings = $('<div />')
188
189    // Layout options
190    $demoSettings.append(
191        '<h4 class="control-sidebar-heading">'
192        + 'Layout Options'
193        + '</h4>'
194        // Fixed layout
195        + '<div class="form-group">'
196        + '<label class="control-sidebar-subheading">'
197        + '<input type="checkbox"data-layout="fixed"class="pull-right"/> '
198        + 'Fixed layout'
199        + '</label>'
200        + '<p>Activate the fixed layout. You can\'t use fixed and boxed layouts together</p>'
201        + '</div>'
202        // Boxed layout
203        + '<div class="form-group">'
204        + '<label class="control-sidebar-subheading">'
205        + '<input type="checkbox"data-layout="layout-boxed" class="pull-right"/> '
206        + 'Boxed Layout'
207        + '</label>'
208        + '<p>Activate the boxed layout</p>'
209        + '</div>'
210        // Sidebar Toggle
211        + '<div class="form-group">'
212        + '<label class="control-sidebar-subheading">'
213        + '<input type="checkbox"data-layout="sidebar-collapse"class="pull-right"/> '
214        + 'Toggle Sidebar'
215        + '</label>'
216        + '<p>
216Toggle the left sidebar\'s state (open or collapse)</p>'
217        + '</div>'
218        // Sidebar mini expand on hover toggle
219        + '<div class="form-group">'
220        + '<label class="control-sidebar-subheading">'
221        + '<input type="checkbox"data-enable="expandOnHover"class="pull-right"/> '
222        + 'Sidebar Expand on Hover'
223        + '</label>'
224        + '<p>Let the sidebar mini expand on hover</p>'
225        + '</div>'
226        // Control Sidebar Toggle
227        + '<div class="form-group">'
228        + '<label class="control-sidebar-subheading">'
229        + '<input type="checkbox"data-controlsidebar="control-sidebar-open"class="pull-right"/> '
230        + 'Toggle Right Sidebar Slide'
231        + '</label>'
232        + '<p>Toggle between slide over content and push content effects</p>'
233        + '</div>'
234        // Control Sidebar Skin Toggle
235        + '<div class="form-group">'
236        + '<label class="control-sidebar-subheading">'
237        + '<input type="checkbox"data-sidebarskin="toggle"class="pull-right"/> '
238        + 'Toggle Right Sidebar Skin'
239        + '</label>'
240        + '<p>Toggle between dark and light skins for the right sidebar</p>'
241        + '</div>'
242    )
243    var $skinsList = $('<ul />', {'class': 'list-unstyled clearfix'})
244
245    // Dark sidebar skins
246    var $skinBlue =
247        $('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
248            .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">'
249                + '<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>'
250                + '<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>'
251                + '</a>'
252                + '<p class="text-center no-margin">Blue</p>')
253    $skinsList.append($skinBlue)
254    var $skinBlack =
255        $('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
256            .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">'
257                + '<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>'
258                + '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #222"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
259                + '</a>'
260                + '<p class="text-center no-margin">Black</p>')
261    $skinsList.append($skinBlack)
262    var $skinPurple =
263        $('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
264            .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">'
265                + '<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>'
266                + '<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>'
267                + '</a>'
268                + '<p class="text-center no-margin">Purple</p>')
269    $skinsList.append($skinPurple)
270    var $skinGreen =
271        $('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
272            .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">'
273                + '<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>'
274                + '<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>'
275                + '</a>'
276                + '<p class="text-center no-margin">Green</p>')
277    $skinsList.append($skinGreen)
278    var $skinRed =
279        $('<li />', {style: 'float:left;
279 width: 33.33333%; padding: 5px;'})
280            .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">'
281                + '<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>'
282                + '<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>'
283                + '</a>'
284                + '<p class="text-center no-margin">Red</p>')
285    $skinsList.append($skinRed)
286    var $skinYellow =
287        $('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
288            .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">'
289                + '<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>'
290                + '<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>'
291                + '</a>'
292                + '<p class="text-center no-margin">Yellow</p>')
293    $skinsList.append($skinYellow)
294
295    // Light sidebar skins
296    var $skinBlueLight =
297        $('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
298            .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">'
299                + '<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>'
300                + '<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>'
301                + '</a>'
302                + '<p class="text-center no-margin" style="font-size: 12px">Blue Light</p>')
303    $skinsList.append($skinBlueLight)
304    var $skinBlackLight =
305        $('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
306            .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">'
307                + '<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>'
308                + '<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>'
309                + '</a>'
310                + '<p class="text-center no-margin" style="font-size: 12px">Black Light</p>')
311    $skinsList.append($skinBlackLight)
312    var $skinPurpleLight =
313        $('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
314            .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">'
315                + '<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>'
316                + '<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>'
317                + '</a>'
318                + '<p class="text-center no-margin" style="font-size: 12px">Purple Light</p>')
319    $skinsList.append($skinPurpleLight)
320    var $skinGreenLight =
321        $('<li />', {style: 'float:left;
321 width: 33.33333%; padding: 5px;'})
322            .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">'
323                + '<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>'
324                + '<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>'
325                + '</a>'
326                + '<p class="text-center no-margin" style="font-size: 12px">Green Light</p>')
327    $skinsList.append($skinGreenLight)
328    var $skinRedLight =
329        $('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
330            .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">'
331                + '<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>'
332                + '<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>'
333                + '</a>'
334                + '<p class="text-center no-margin" style="font-size: 12px">Red Light</p>')
335    $skinsList.append($skinRedLight)
336    var $skinYellowLight =
337        $('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
338            .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">'
339                + '<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>'
340                + '<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>'
341                + '</a>'
342                + '<p class="text-center no-margin" style="font-size: 12px">Yellow Light</p>')
343    $skinsList.append($skinYellowLight)
344
345    $demoSettings.append('<h4 class="control-sidebar-heading">Skins</h4>')
346    $demoSettings.append($skinsList)
347
348    $tabPane.append($demoSettings)
349    $('#control-sidebar-home-tab').after($tabPane)
350
351    setup()
352
353    $('[data-toggle="tooltip"]').tooltip()
354})

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.