1$.extend(eorzeadb, { 2 popup_contents: {}, 3 popup_content_last_key: null, 4 pushup: function(data) { 5 var data_key = data.subdomain + '/' + data.path + '/' + data.key; 6 eorzeadb.popup_contents[data_key] = data.html; 7 }, 8 pushup_instance: function(data) { 9 var data_key = data.subdomain + data.path_query; 10 eorzeadb.popup_contents[data_key] = data.html; 11 } 12}); 13 14var feast_reward_div = $('#reward_season').length; 15Lodestone.add_init_for_el_plugin(function(el) { 16 var m_tool_show = 0 17 var $tooltip = $('#eorzeadb_tooltip'); 18 if ( !$tooltip.length ) { 19 $tooltip = $(document.createElement('div')); 20 $tooltip.attr('id', 'eorzeadb_tooltip'); 21 $tooltip.hide(); 22 $('body').append($tooltip); 23 $tooltip.css({ 24 position: 'absolute', 25 top: 0, 26 left: 0 27 }); 28 $tooltip.on({ 29 "mouseenter": function() { 30 $tooltip.stop().css({opacity: 1}).show(); 31 m_tool_show = 1; 32 $(this).find('.js__tooltip').js__tooltip(); 33 }, 34 "mouseleave": function() { 35 $tooltip.fadeOut(500); 36 m_tool_show = 0; 37 } 38 }).on( 39 "click", function(){ 40 if ( m_tool_show ) { 41 $tooltip.stop().fadeOut(500); 42 m_tool_show = 0; 43 } 44 else { 45 m_tool_show = 1; 46 } 47 } 48 ); 49 $(document).on('click.eorzeadbTooltipOutside touchend.eorzeadbTooltipOutside', function(e){ 50 if ( !Modernizr.touchevents || !f_pass ) { 51 return; 52 } 53 if ( $(e.target).closest('.db_popup, #eorzeadb_tooltip').length ) { 54 return; 55 } 56 $tooltip.stop().fadeOut(500); 57 m_tool_show = 0; 58 }); 59 } 60 61 var $db_popups = el.find('.db_popup'); 62 $(".db_popup").parent("a").each(function(){ 63 $(this).on("click", function(e){e.preventDefault();}) 64 }); 65 var is_tablet_device = function() { 66 var ua = navigator.userAgent; 67 return Modernizr.touchevents && f_pass && ( 68 ua.indexOf('iPad') !== -1 || 69 (ua.indexOf('Macintosh') !== -1 && 'ontouchend' in document) || 70 (ua.indexOf('Android') !== -1 && ua.indexOf('Mobile') === -1) 71 ); 72 }; 73 var is_touch_db_text_link = function($db_popup) { 74 return is_tablet_device() && $db_popup.is('a'); 75 }; 76 var get_url_info = function($db_popup) { 77 if ( $db_popup.data('ldst-jsonp-url') ) { 78 // ldst-urlã§æå®ã®å ´åã¯ãã®ã¾ã¾èªã¿è¾¼ã 79 return { 80 'url': $db_popup.data('ldst-jsonp-url'), 81 'data_key': subdomain + $db_popup.data('ldst-jsonp-url'), 82 'hq_type': 2 // no action 83 }; 84 } 85 else { 86 var url; 87 var ldst_href; 88 if ( $db_popup.data('ldst-href') ) { 89 ldst_href = $db_popup.data('ldst-href'); 90 } 91 else { 92 ldst_href = $db_popup.attr('href'); 93 } 94 var matchs = ldst_href.match(/playguide\/db\/(.*?)\/?(#.+)?(\?.+)?$/); 95 if ( eorzeadb.dynamic_tooltip ) { 96 // dynamic 97 url = sprintf('%splayguide/db/%s/jsonp/', base_uri, matchs[1]); 98 } 99 else { 100 // static 101 url = sprintf('%spc/tooltip/%s/%s/%s.js', static_uri, eorzeadb.version, subdomain, matchs[1]); 102 } 103 return { 104 'url': url, 105 'data_key': subdomain + '/' + matchs[1], 106 'hq_type': /hq=1/.test(ldst_href) ? 1 : 0 107 }; 108 } 109 }; 110 var get_popup_content = function($db_popup, cb) { 111 var url_info = get_url_info($db_popup); 112 eorzeadb.popup_content_last_key = url_info.data_key; 113 if ( eorzeadb.popup_contents.hasOwnProperty(url_info.data_key) ) { 114 if ( cb ) { cb(eorzeadb.popup_contents[url_info.data_key], url_info) } 115 return; 116 } 117 eorzeadb.popup_contents[url_info.data_key] = ''; 118 119 $.ajax({ 120 cache: true, 121 type: 'get', 122 url: url_info.url, 123 dataType: 'script', 124 success: function() { 125 if ( cb && eorzeadb.popup_content_last_key === url_info.data_key ) { 126 cb(eorzeadb.popup_contents[url_info.data_key], url_info) 127 } 128 } 129 }); 130 }; 131 132 133 var toppos = function(myitemwin){ 134 var win_h = ($tooltip.find('.popup_w412_body_gold').height()+26) + "px"; 135 var w = $tooltip; 136 var d = myitemwin; 137 var off = d.offset(); 138 var is_item_icon = d.hasClass('sys_special_icon') ? true : false; 139 var is_tooltip_pos__bottom_space = d.hasClass('tooltip_pos__bottom_space') ? true : false; 140 141 var window_width =$(window).innerWidth();//windowã®å¹ 142 var window_center =Math.round(window_width / 2);//winsowã®å·¦ç«¯ããçãä¸ã¾ã§ã®è·é¢ 143 var tooltip_w = 412;//ãã¼ã«ãããã®å¹ 144 var left_pos; 145 var is_flexible; 146 var is_flexible_bottom; 147 148 if(window_width < 960){ 149 window_width = 960; 150 } 151 152 if( window_center > off.left){ 153 left_pos = ( d.width() + off.left + 10 ) + 'px'; 154 }else if(d.hasClass('tooltip_pos__right_space')){ 155 if((window_width-off.left - d.width() - 10) >
155 tooltip_w){ 156 left_pos = ( d.width() + off.left + 10 ) + 'px'; 157 }else{ 158 left_pos = ( off.left - 10 - tooltip_w - 20 ) + 'px'; 159 } 160 }else{ 161 if(d.hasClass('right_space_small')){ 162 left_pos = ( off.left - 10 - tooltip_w ) + 'px'; 163 }else{ 164 left_pos = ( off.left - 10 - tooltip_w - 20 ) + 'px'; 165 } 166 if(left_pos < 0 ){ 167 left_pos = ( d.width() + off.left + 10 ) + 'px'; 168 } 169 } 170 if(d.hasClass('tooltip_pos__flexible')){ 171 is_flexible = true; 172 if((window_width - off.left - d.width() - 10) > tooltip_w){ 173 left_pos = ( d.width() + off.left + 10 ) + 'px'; 174 }else if((off.left + 10) > tooltip_w){ 175 left_pos = ( off.left - tooltip_w - 10 ) + 'px'; 176 }else{ 177 left_pos = off.left; 178 is_flexible_bottom = true; 179 } 180 } 181 182 if(is_item_icon){ 183 left_pos = off.left; 184 window_width = $(window).innerWidth(); 185 if((left_pos+tooltip_w) > window_width){ 186 left_pos = left_pos - ((left_pos + tooltip_w) - window_width); 187 } 188 var b = ( (Math.round(off.top) + d.height())+ "px"); 189 w.css({top:b , left : left_pos+'px'}); 190 }else if(is_tooltip_pos__bottom_space){ 191 left_pos = off.left; 192 window_width = $(window).innerWidth(); 193 if((left_pos+tooltip_w) > window_width){ 194 left_pos = left_pos - ((left_pos + tooltip_w) - window_width); 195 } 196 var b = ( (Math.round(off.top) + 24)+ "px"); 197 w.css({top:b , left : left_pos+'px'}); 198 }else{ 199 if(is_flexible_bottom){ 200 var b = ( (Math.round(off.top) + d.height() + 10)+ "px"); 201 w.css({top:b , left : left_pos+'px'}); 202 }else if(Math.round(off.top) - $(window).scrollTop() + parseInt(win_h) > $(window).height()){ 203 if($(window).height() < parseInt(win_h)){ 204 var b = (($(window).scrollTop()) + "px"); 205 w.css({top:b , left : left_pos}); 206 }else{ 207 var b =(Math.round(off.top) - ((Math.round(off.top) - $(window).scrollTop() + parseInt(win_h) - $(window).height()))) +"px"; 208 w.css({top:b , left : left_pos}); 209 } 210 }else if(Math.round(off.top) > $(window).scrollTop() && $(window).height() > parseInt(win_h)){ 211 var b = ( Math.round(off.top) + "px"); 212 w.css({top:b , left : left_pos}); 213 }else if(Math.round(off.top) < $(window).scrollTop() || $(window).height() < parseInt(win_h) ){ 214 var b = (($(window).scrollTop() - Math.round(off.top)) + "px"); 215 w.css({top:b , left : left_pos}); 216 } 217 } 218 } 219 220 var hover_timer; 221 $db_popups.on({ 222 "mouseenter": function() { 223 if( !(Modernizr.touchevents && f_pass) ){ 224 var $this = $(this); 225 get_popup_content($this, function(this_popup_content, url_info) { 226 if ( !this_popup_content ) { 227 return; 228 } 229 var offset = $this.offset(); 230 var width = $this.width(); 231 if ( $this.children('img').length ) { 232 width = $this.children('img').width(); 233 } 234 235 if (hover_timer) { 236 clearTimeout(hover_timer); 237 hover_timer = null; 238 } 239 hover_timer = setTimeout(function() { 240 $tooltip 241 .stop() 242 .css({ 243 opacity: 1 244 }) 245 .html(this_popup_content) 246 .show(0,function(){toppos($this); m_tool_show = 1;}); 247 $('.tooltip_view .table_black .column1 td .no_th tr:nth-child(odd) td').css({backgroundColor:'#2E2E2E'}); 248 $('.tooltip_view .table_black .column1 td .no_th tr:nth-child(even) td').css({backgroundColor:'#333'}); 249 $('.tooltip_view .table_black .column1 tr:nth-child(even) td').css({backgroundColor:'#2e2e2e'}); 250 $('.tooltip_view .table_black .column1 tr:nth-child(odd) td').css({backgroundColor:'#333333'}); 251 $('.tooltip_view .table_black .column1 .inr_table tr:nth-child(even) td').css({backgroundColor:'#2e2e2e'}); 252 $('.tooltip_view .table_black .column1 .inr_table tr:nth-child(odd) td').css({backgroundColor:'#333333'}) 253 if ( url_info.hq_type == 1 ) { 254 $tooltip.find('.sys_nq_element').hide(); 255 $tooltip.find('.sys_hq_element').show(); 256 } 257 ; 258 }, 300); 259 }); 260 } 261 }, 262 "mouseleave": function() { 263 if (hover_timer) { 264 clearTimeout(hover_timer); 265 hover_timer = null; 266 } 267 $tooltip.fadeOut(500); 268 m_tool_show = 0; 269 } 270 }).on( 271 "click", function(e){ 272 if( Modernizr.touchevents && f_pass ){ 273 var $this = $(this); 274 if ( is_touch_db_text_link($this) ) { 275 return; 276 } 277 get_popup_content($this, function(this_popup_content, url_info) { 278 if ( !this_popup_content ) { 279 return; 280 } 281 var offset = $this.offset(); 282 var width = $this.width(); 283 if ( $this.children('img').length ) { 284 width = $this.children('img').width(); 285 } 286 if(m_tool_show){ 287 $tooltip.stop().fadeOut(500); m_tool_show = 0; 288 }else{ 289 $tooltip.stop().css({opacity: 1}
289).html(this_popup_content).show(0,function(){toppos($this); m_tool_show = 1;}); 290 if ( url_info.hq_type == 1 ) { 291 $tooltip.find('.sys_nq_element').hide(); 292 $tooltip.find('.sys_hq_element').show(); 293 } 294 } 295 }); 296 } 297 }).css("cursor","pointer"); 298});
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.