1$(document).ready( function() { 2 var ViewPort = { 3 width: 'device-width', 4 initialScale: '1.0', 5 minimumScale: '0.25', 6 maximumScale: '1.6', 7 8 //ãã¡ãã®è¨å®ã¯ãèªç±ã« 9 modes : { 10 sp: { 11 width:'device-width', 12 initialScale: '1.0', 13 minimumScale: '0.25', 14 maximumScale: '1.6' 15 }, 16 pc: { 17 width: '1100', 18 initialScale: '0.30', 19 minimumScale: '0.25', 20 maximumScale: '1.0' 21 } 22 }, 23 currentMode : 'sp', 24 25 //ãã¼ã¸èªè¾¼ã¿æã«å®è¡ Cookieããè¨å®ãèªã¿åºã 26 init: function () { 27 if ($.cookie('viewport-mode')) { 28 var modeName = $.cookie("viewport-mode"); 29 this.changeMode(modeName); 30 } 31 }, 32 33 //ã¹ããåãã¨PCåããåãæ¿ã 34 changeMode: function(modeName){ 35 var mode = this.modes[modeName]; 36 $.cookie('viewport-mode', modeName); //Cookieã«å¤ãè¨å® 37 this.width = mode.width; 38 this.initialScale = mode.initialScale; 39 this.minimumScale = mode.minimumScale; 40 this.maximumScale = mode.maximumScale; 41 this.currentMode = modeName; 42 this.applyMetaTag(); 43 }, 44 45 //ç¾å¨ã®è¨å®ã§metaã¿ã°ãå·®ãæ¿ãã 46 applyMetaTag: function (){ 47var content = 'width=' + this.width + ', initial-scale=' + this.initialScale + ', minimum-scale=' + this.minimumScale + ', maximum-scale=' + this.maximumScale; 48 $('meta[name=viewport]').attr('content', content); 49 }, 50 }; 51 52 ViewPort.init(); 53 54 $('#pc-site-change-button').on('click', '', function(){ 55 56 $.removeCookie('viewport-mode'); 57 $.cookie('viewport-mode',null); 58 $.cookie('viewport-mode', '', { expires: -1 }); 59 ViewPort.changeMode('pc'); 60 }); 61 62 $('#sp-site-change-button').on('click', '', function(){ 63 $.removeCookie('viewport-mode'); 64 $.cookie('viewport-mode',null); 65 $.cookie('viewport-mode', '', { expires: -1 }); 66 ViewPort.changeMode('sp'); 67 location.reload(); 68 return false; 69 }); 70 71});
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.