1// èªè¨¼è¡¨ç¤ºéåæå¦ç 2jQuery(function() { 3 4 // èªè¨¼ãããã¯ãããã 5 if (jQuery('.sitemiraiz_async_auth').length == 0) { return; } 6 7 // ãã¬ãã¥ã¼ä¸ã¯å¦çããªãï¼ä¸¡ã¨ãªã¢è¡¨ç¤ºï¼ 8 if (jQuery('.smzpreview-is-preview-mode').length > 0) { 9 UpdateAuthArea("mode00", null); 10 UpdateAuthArea("mode01", "{ãµã³ãã«}"); 11 return; 12 } 13 14 // ã¨ãªã¢ã䏿¦æ¶ã 15 jQuery('.sitemiraiz_async_auth_not_login').hide(); 16 jQuery('.sitemiraiz_async_auth_login').hide(); 17 18 // åå表示ã¨ãªã¢ããããï¼ããå ´åã¯æ¯åAPIå¼ã³åºãï¼ 19 var nameArea = jQuery('.sitemiraiz_async_auth_name'); 20 21 // èªè¨¼ç¶æ Cookieç¢ºèª 22 if (!jQuery.cookie) { 23 console.error("Requires jquery.cookie.js"); 24 return; 25 } 26 27 // èªè¨¼ç¶æ Cookie確èª(è¦ãç®ã®å¶å¾¡ã ãã«å©ç¨ããã®ã§ãã»ãã¥ãªãã£ã«ã¯å½±é¿ãªã) 28 var authDisplay = jQuery.cookie('sitemiraiz_async_auth_display'); 29 30 // èªè¨¼ç¶æ ãåå¾ã§ããå ´åããã¤ãåå表示ã¨ãªã¢ãç¡ãå ´å㯠31 if (authDisplay && (authDisplay == "mode00" || (authDisplay == "mode01" && nameArea.length == 0))){ 32 // ç»é¢åæ 33 UpdateAuthArea(authDisplay, null); 34 } else { 35 // root åå¾ 36 var rootUrl = jQuery('.sitemiraiz_async_auth').data("async-root-url"); 37 38 // APIå®è¡ 39 jQuery.ajax({ 40 url: rootUrl + "/authdisplayapi", 41 dataType: "json", 42 cache: false, 43 success: function (data, response) { 44 // ãã¬ãã¥ã¼ä¸ 45 if (data.preview){ 46 UpdateAuthArea("mode00", null); 47 UpdateAuthArea("mode01", "{ãµã³ãã«}"); 48 return; 49 } 50 // é常表示 51 if (data.authDisplay){ 52 // å¤åå¾ 53 var authDisplay = data.authDisplay; 54 var nameValue = data.nameValue; 55 56 // èªè¨¼ç¶æ ããã£ãã·ã¥ããããä¿å 57 jQuery.cookie('sitemiraiz_async_auth_display', authDisplay, { path:"/" }); 58 59 // ç»é¢åæ 60 UpdateAuthArea(authDisplay, nameValue); 61 } 62 } 63 }); 64 } 65 66 // ç»é¢åæ 67 function UpdateAuthArea(authDisplay, nameValue) 68 { 69 // ç»é¢ æªãã°ã¤ã³å¦ç 70 if (authDisplay == "mode00"){ 71 jQuery('.sitemiraiz_async_auth_not_login').show(); 72 } 73 74 // ç»é¢ ãã°ã¤ã³æ¸å¦ç 75 if (authDisplay == "mode01"){ 76 var nameArea = jQuery('.sitemiraiz_async_auth_name'); 77 if (nameArea && nameValue) { nameArea.text(nameValue); } 78 79 jQuery('.sitemiraiz_async_auth_login').show(); 80 } 81 } 82}); 83
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.