1$(function () { 2 3 // ==================== 4 // åæè¨å® 5 // ==================== 6 7 $('.smarthash ul').masonry({ 8 percentPosition: true 9 }); 10 11 // ä¸è¦§ã«ã¦ã¼ã¶ã¼åã表示 12 var sh_usr = false, 13 14 // ä¸è¦§ã«ã³ã¡ã³ãã表示 15 sh_cmt = false, 16 17 // ä¸è¦§ã«ã¿ã°ã表示 18 sh_tag = false, 19 20 // ä¸è¦§ã«æç¨¿æ¥æã表示 21 sh_dat = false, 22 23 // ä¸è¦§ã®æç¨¿ãã¿ã¤ã«ç¶ã«æ·ãè©°ãã 24 sh_til = true, 25 26 // 詳細ãã¢ã¼ãã«ã§è¡¨ç¤ºï¼falseã®å ´åç´æ¥SNSã¸ãªã³ã¯ããã¾ãï¼ 27 sh_mdl = true, 28 29 // 表示件æ°ã®å¤æ´(åæå¤ã¯30件表示) 30 turn_count = "8"; 31 32 // æ¬çªæã¯ä¸ã®ãâââââãããã¡ã¤ã³åãâââââãé¨åããå¥ç´ãã£ã¬ã¯ããªåã«ç½®ãæãã¦ãå©ç¨ãã ãã 33 var json_url = 'https://sh.smartcontest.jp/hashtag/sugakiya/?c=json'; 34 var item_url = 'https://sh.smartcontest.jp/hashtag/sugakiya/'; 35 var key_num = 0; 36 37 // ==================== 38 // JSON 飿º 39 // ==================== 40 41 function getJson(jurl) { 42 $.ajax({ 43 scriptCharset: 'UTF-8', 44 url: jurl, 45 dataType: 'jsonp', 46 data: { turn: turn_count}, 47 jsonpCallback: 'get_json', 48 type: "GET", 49 success: function (data) { 50 var insert = '', 51 cnt = 1, 52 owl; 53 54 // ãã£ã¨è¦ããã¿ã³é表示å¤å® 55 if ($.isEmptyObject(data) == true) { 56 $('.smarthash_more_btn').fadeOut(); 57 } 58 59 for (var key in data) { 60 if (data[key].url == "") { 61 data[key].url = "javascript:void(0);"; 62 } 63 if (data[key].thum_url.match(/.mp4/)) { 64 data[key].thum_url = "img/video.png"; 65 } 66 67 insert += '<li>'; 68 69 // ãªã¹ãã®HTML 70 if (sh_mdl == true) { 71 if (data[key].carousel_media_url.match(/,/)) { 72 /* åç»å¯¾å¿ç追å ç®æãããã */ 73 if (data[key].image_url.match(/.mp4/) && iPhone == true) { 74 insert += '<a href="#' + data[key].post_id + '" class="colorbox multiple"><video webkit-playsinline playsinline muted loop poster="' + data[key].thum_url+ '"><source src="' + data[key].image_url + '"></video></a>'; 75 } else if (data[key].image_url.match(/.mp4/) && iPhone == false) { 76 insert += '<a href="#' + data[key].post_id + '" class="colorbox multiple"><video webkit-playsinline playsinline muted loop poster="' + data[key].thum_url+ '"><source src="' + data[key].image_url + '"></video></a>'; 77 } else { 78 insert += '<a href="#' + data[key].post_id + '" class="colorbox multiple"><img src="' + data[key].thum_url + '" class="instagram-image"></a>'; 79 } 80 /* åç»å¯¾å¿ç追å ç®æããã¾ã§ */ 81 } else { 82 /* åç»å¯¾å¿ç追å ç®æãããã */ 83 if (data[key].image_url.match(/.mp4/) && iPhone == true) { 84 insert += '<a href="#' + data[key].post_id + '" class="colorbox"><video webkit-playsinline playsinline muted loop poster="' + data[key].thum_url+ '"><source src="' + data[key].image_url + '"></video></a>'; 85 } else if (data[key].image_url.match(/.mp4/) && iPhone == false) { 86 insert += '<a href="#' + data[key].post_id + '" class="colorbox"><video webkit-playsinline playsinline muted loop poster="' + data[key].thum_url+ '"><source src="' + data[key].image_url + '"></video></a>'; 87 } else { 88 insert += '<a href="#' + data[key].post_id + '" class="colorbox"><img src="' + data[key].thum_url + '" class="instagram-image"></a>'; 89 } 90 /* åç»å¯¾å¿ç追å ç®æããã¾ã§ */ 91 } 92 } else { 93 if (data[key].carousel_media_url.match(/,/)) { 94 /* åç»å¯¾å¿ç追å ç®æãããã */ 95 if (data[key].image_url.match(/.mp4/) && iPhone == true) { 96 insert += '<a href="' + data[key].url + '" target="_blank" class="multiple"><video webkit-playsinline playsinline muted loop poster="' + data[key].thum_url+ '"><source src="' + data[key].image_url + '"></video></a>'; 97 } else if (data[key].image_url.match(/.mp4/) && iPhone == false) { 98 insert += '<a href="' + data[key].url + '" target="_blank" class="multiple"><video webkit-playsinline playsinline muted loop poster="' + data[key].thum_url+ '"><source src="' + data[key].image_url + '"></video></a>'; 99 } else { 100 insert += '<a href="' + data[key].url + '" target="_blank" class="multiple"><img src="' + data[key].thum_url + '" class="instagram-image"></a>'; 101 } 102 /* åç»å¯¾å¿ç追å ç®æããã¾ã§ */ 103 104 } else { 105 /* åç»å¯¾å¿ç追å ç®æãããã */ 106 if (data[key].image_url.match(/.mp4/) && iPhone == true) { 107 insert += '<a href="' + data[key].url + '" target="_blank"><video webkit-playsinline playsinline muted loop poster="' + data[key].thum_url+ '"><source src="' + data[key].image_url + '"></video></a>'; 108 } else if (data[key].image_url.match(/.mp4/) && iPhone == false) { 109 insert += '<a href="' + data[key].url + '" target="_blank"><video webkit-playsinline playsinline muted loop poster="' + data[key].thum_url+ '"><source src="' + data[key].image_url + '"></video></a>'; 110 } else { 111 insert += '<a href="' + data[key].url + '" target="_blank"><img src="' + data[key].thum_url + '" class="instagram-image"></a>'; 112 } 113 /* åç»å¯¾å¿ç追å ç®æããã¾ã§ */ 114 } 115 } 116 if (sh_tag == true) { 117 insert += '<span class="hash_tag">' + data[key].hash_tag + '</span>'; 118 } 119 if (sh_dat == true) { 120 insert += '<span class="created_at">' + data[key].created_at + '</span>'; 121 } 122 123 insert += '</li>'; 124 key_num++; 125 126 }; 127 128 // HTMLæ¸ãåºãå 129 $('.smarthash ul').append(insert); 130 if (sh_til == true) { 131 $('.smarthash ul').imagesLoaded(function () { 132 $('.smarthash ul').masonry('reloadItems').masonry('layout'); 133 }); 134 } 135 136 if (sh_mdl == true) { 137 var insert_zoom = ''; 138 for (var key in data) { 139 insert_zoom += '<div id="' + data[key].post_id + '">'; 140 141 // ã¢ã¼ãã«ã®HTML 142 if (data[key].carousel_media_url.match(/,/)) { 143 // è¤æ°ææç¨¿ã®å ´å 144 insert_zoom += '<div class="data carousel_wrapper"><dl>
144<dt class="imgBox">'; 145 var cmu = data[key].carousel_media_url; 146 insert_zoom += '<div class="carousel' + cnt + '">'; 147 for (i = 0; i < cmu.split(',').length; i++) { 148 if (cmu.split(',')[i].match(/.mp4|.m3u8/) && iPhone == true) { 149 insert_zoom += '<div class="carousel_item"><p><video webkit-playsinline playsinline controls poster="' + data[key].thum_url+ '"><source src="' + cmu.split(',')[i] + '"></video></p></div>'; 150 } else if (cmu.split(',')[i].match(/.mp4|.m3u8/) && iPhone == false) { 151 insert_zoom += '<div class="carousel_item"><p><video webkit-playsinline playsinline controls poster="' + data[key].thum_url+ '"><source src="' + cmu.split(',')[i] + '"></video></p></div>'; 152 } else { 153 insert_zoom += '<div class="carousel_item"><p><img src="' + cmu.split(',')[i] + '" class="instagram-image"></p></div>'; 154 } 155 } 156 insert_zoom += '</div>'; 157 } else { 158 // åä½æç¨¿ã®å ´å 159 insert_zoom += '<div class="data"><dl><dt class="imgBox">'; 160 if (data[key].image_url.match(/.mp4|.m3u8/) && iPhone == true) { 161 insert_zoom += '<video webkit-playsinline playsinline controls poster="' + data[key].thum_url+ '"><source src="' + data[key].image_url + '"></video>'; 162 } else if (data[key].image_url.match(/.mp4|.m3u8/) && iPhone == false) { 163 insert_zoom += '<video webkit-playsinline playsinline controls poster="' + data[key].thum_url+ '"><source src="' + data[key].image_url + '"></video>'; 164 } else { 165 insert_zoom += '<img src="' + data[key].image_url + '" alt="">'; 166 } 167 } 168 insert_zoom += '</dt><dd><div class="data_head">'; 169 insert_zoom += '<span class="dateBox"><a href="' + data[key].url + '" target="_blank">' + data[key].username + '</a>'; 170 insert_zoom += '<span>' + data[key].created_at + '</span></span>'; 171 if (data[key].url != "javascript:void(0);") { 172 insert_zoom += '<span class="appOoen"><a href="' + data[key].url + '" target="_blank">SNSã§éã</a></span>'; 173 } 174 insert_zoom += '</div><div class="commentBox">' + data[key].description + '</div>'; 175 if (data[key].item) { 176 insert_zoom += '<div class="item_name">' + data[key].item + '</div>'; 177 } 178 if (data[key].item_img) { 179 insert_zoom += '<div class="item_img"><img src="' + item_url + data[key].item_img + '" alt=""></div>'; 180 } 181 if (data[key].item_url) { 182 insert_zoom += '<div class="item_url"><a href="' + data[key].item_url + '" target="_blank">詳細ãè¦ã</a></div>'; 183 } 184 insert_zoom += '</dd></dl></div>'; 185 186 insert_zoom += '</div>'; 187 }; 188 189 // 190 $('.smarthash_zoom').append(insert_zoom); 191 192 // colorbox 193 if (mobile == true) { 194 $('a.colorbox').colorbox({ 195 inline: true, 196 closeButton: true, 197 width: '85%', 198 initialWidth: '70%', 199 maxHeight: '70%', 200 fixed: true, 201 onComplete: function () { 202 //è¤æ°æç¨¿æã«ã«ã«ã¼ã»ã«å¦ç 203 $('.carousel' + cnt).owlCarousel({ 204 items: 1, 205 navigation: true, 206 navigationText: ["", ""], 207 autoHeight: false, 208 singleItem: true, 209 afterAction: function () { 210 $.colorbox.resize({height:'70%'}); 211 } 212 }); 213 owl = $('.carousel' + cnt).data('owlCarousel'); 214 cnt++; 215 }, 216 onOpen: function () { 217 var ycoord = $(window).scrollTop(); 218 $('#colorbox').data('ycoord',ycoord); 219 ycoord = ycoord * -1; 220 $('body').css('position','fixed').css('width','100%').css('height','100%').css('top',ycoord + 'px'); 221 }, 222 onClosed: function () { 223 $('body').css('position','').css('width','auto').css('height','auto').css('top','auto'); 224 $(window).scrollTop($('#colorbox').data('ycoord')); 225 // ã¢ã¼ãã«ã¯ãã¼ãºæã«åç»åæ¢ 226 var mID = $(this).attr('href'); 227 var colorbox_video = document.getElementById(mID); 228 $(colorbox_video)[0].pause(); 229 // 230 }, 231 onLoad: function () { 232 } 233 }); 234 }else { 235 $('a.colorbox').colorbox({ 236 inline: true, 237 closeButton: true, 238 maxWidth: '1090px', 239 maxHeight: '80%', 240 onComplete: function () { 241 //è¤æ°æç¨¿æã«ã«ã«ã¼ã»ã«å¦ç 242 $('.carousel' + cnt).owlCarousel({ 243 items: 1, 244 navigation: true, 245 navigationText: ["", ""], 246 autoHeight: false, 247 singleItem: true, 248 afterAction: function () { 249 $.colorbox.resize({height:'auto'}); 250 } 251 }); 252 owl = $('.carousel' + cnt).data('owlCarousel'); 253 cnt++; 254 }, 255 onClosed: function () { 256 // ã¢ã¼ãã«ã¯ãã¼ãºæã«åç»åæ¢ 257 var mID = $(this).attr('href'); 258 var colorbox_video = document.getElementById(mID); 259 $(colorbox_video)[0].pause(); 260 // 261 } 262 }); 263 } 264 265 //è¤æ°æç¨¿æã«ã«ã«ã¼ã»ã«å¦ççµäº 266 $(document).bind('cbox_close', function () { 267 owl.destroyControls(); 268 }); 269 } 270 271 // PC m3u8 ã«ã©ã¼ããã¯ã¹å¯¾å¿ 272 $('.colorbox').each(function (i) { 273 ããã var mID = $(this).attr('href'); 274 ããã $(mID).find("video").attr('id', mID); 275 ããã var murl = $(mID).find('source').attr('src'); 276 ãã if (murl !== undefined) { 277 ããã if (murl.match(/.m3u8/)) { 278 ããã if (Hls.isSupported()) { 279 ããã var video = document.getElementById(mID); 280 ããã var hls = new Hls(); 281 ããã hls.loadSource(murl); 282 ããã hls.attachMedia(video); 283 ããã hls.on(Hls.Events.MANIFEST_PARSED, function() {}); 284 ããã } 285 ããã } 286 ããã } 287 ããã}); 288 // 289 290 //ã¨ã©ã¼ç»åãã§ã㯠291 $('.smarthash_zoom img, .smarthash img').error(function () { 292 $(this).attr({ 293 src: "img/noimg.png" 294 }); 295 }); 296 297 }, 298 error: function (data) { 299 console.log('error'); 300 } 301 }); 302 }; 303 getJson(json_url); 304 305 /* more */ 306 $('.smarthash_more_btn').click(function () { 307 getJson(json_url + '&sk=' + key_num); 308 }); 309 310 /* img trimming */ 311 $(window).on('load', function(){ 312 trimming('.smarthash img'); 313 }) 314 function trimming ($photoBox) { 315 jQuery($photoBox).each(function(){ 316 var i = jQuery(this); 317 var i_w =$(i).width(); 318 var i_h =$(i).height(); 319 if (i_w >
319 i_h) { 320 $(i).css({ 321 "width": "auto", 322 "height":"100%" 323 }); 324 }else{ 325 $(i).css({ 326 "width": "100%", 327 "height":"auto" 328 }); 329 } 330 }); 331 } 332 333});
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.