1/******************* 2 * 3 * Skin Mode 4 * 5 ******************/ 6(function ($) { 7 8 'use strict'; 9 10 g1.skinSwitcher = function () { 11 if ( typeof g1SwitchSkin === 'undefined' ) { 12 return; 13 } 14 15 $('.g1-drop-the-skin').each( function() { 16 var $this = $(this); 17 18 var $skinItemId = $('meta[name="g1:skin-item-id"]'); 19 var skinItemId = $skinItemId.length > 0 ? $skinItemId.attr('content') : 'g1_skin'; 20 21 if ( localStorage.getItem(skinItemId) ) { 22 if ( $this.is( '.g1-drop-the-skin-light' ) ) { 23 $this.removeClass('g1-drop-nojs g1-drop-the-skin-light').addClass( 'g1-drop-the-skin-dark' ); 24 } else { 25 // Switch to the light mode. 26 $this.removeClass('g1-drop-nojs g1-drop-the-skin-dark').addClass( 'g1-drop-the-skin-light' ); 27 } 28 } else { 29 $this.removeClass('g1-drop-nojs'); 30 } 31 }); 32 33 34 $('body').on( 'click', '.g1-drop-the-skin', function() { 35 var $this = $(this); 36 37 $this.addClass('g1-drop-the-skin-anim'); 38 39 if ( $this.is( '.g1-drop-the-skin-light' ) ) { 40 // Switch to the dark skin. 41 $this.removeClass('g1-drop-the-skin-light').addClass( 'g1-drop-the-skin-dark' ); 42 g1SwitchSkin('dark'); 43 44 } else { 45 // Switch to the light skin. 46 $this.removeClass('g1-drop-the-skin-dark').addClass( 'g1-drop-the-skin-light' ); 47 g1SwitchSkin('light'); 48 } 49 }); 50 }; 51 52 $(document).ready(function () { 53 g1.skinSwitcher(); 54 }); 55 56})(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.