1jQuery.noConflict(); 2artDialog.tips = function (content) { 3 return artDialog({ 4 id: 'Tips', 5 fixed: true, 6 lock: false, 7 button:[] 8 }) 9 .content('<div style="padding: 0 1em;">'+content+'</div>'); 10}; 11jQuery.extend(jQuery.browser, { 12 isIE6: !-[1, ] && !window.XMLHttpRequest 13}); 14var checksubmit = 0; 15jQuery.extend({loadScript:function(url, callback){ 16 var script = document.createElement("script") 17 script.type = "text/javascript"; 18 if (script.readyState){ //IE 19 script.onreadystatechange = function(){ 20 if (script.readyState == "loaded" || script.readyState == "complete"){ 21 script.onreadystatechange = null; 22 callback && callback(); 23 } 24 }; 25 } else { //Others: Firefox, Safari, Chrome, and Opera 26 script.onload = function(){ 27 callback && callback(); 28 }; 29 } 30 script.src = url; 31 document.body.appendChild(script); 32} 33}); 34var AUI = { 35 common:function(){ 36 if(jQuery.browser.isIE6){ 37 // jQuery.loadScript('https://getfirebug.com/firebug-lite.js'); 38 } 39 }, 40 getCookieByKey : function(objName) { 41 var arrStr = document.cookie.split("; "); 42 for (var i = 0; i < arrStr.length; i++) { 43 var temp = arrStr[i].split("="); 44 if (temp[0] == objName) { 45 return unescape(temp[1]); 46 } 47 } 48 }, 49 setLogin : function(){ 50 if(!jQuery('.topBar').size()) return false; 51 var uid = AUI.getCookieByKey('uid'), 52 nick = AUI.getCookieByKey('username'); 53 nick = decodeURIComponent(nick); 54 if(uid){ 55 jQuery('.topBar .topLogin').hide(); 56 jQuery('.topBar .LoginInfo').show(0,function(){ 57 jQuery(this).append('æ¨å¥½ï¼'+nick+' <a href="javascript:;" class="logout" title="éåºç»å½">éåºç»å½</a>'); 58 }); 59 }else{ 60 jQuery('.topBar .topLogin').show(); 61 jQuery('.topBar .LoginInfo').hide();
62 jQuery(".topBar form").get(0).reset(); 63 jQuery('.topBar .LoginInfo').html(''); 64 var username = jQuery('.topLogin .username'); 65 password = jQuery('.topLogin .password'); 66 AUI.placeHolder.create(username); 67 AUI.placeHolder.create(password); 68 } 69 70 }, 71 login:function(){ 72 //AUI.setLogin(); 73 jQuery('.topBar .logout').live('click',function(e){ 74 e.preventDefault(); 75 jQuery.get('http://www.aoji.cn/user/logout',function(){ 76 AUI.setLogin(); 77 if(jQuery('#memb_center').size()) 78 window.location = 'http://www.aoji.cn/user/login'; 79 },'jsonp'); 80 jQuery.get('http://www.aoji.cn/user/synlogout',function(){},'jsonp'); 81 }); 82 jQuery(".topBar form").on('submit',function(e){ 83 e.preventDefault(); 84 var username = jQuery(".topBar .username").val(), 85 password = jQuery('.topBar .password').val(), 86 usernamePhr = jQuery(".topB
86ar .username").attr('placeholder'); 87 passwordPhr = jQuery(".topBar .password").attr('placeholder'); 88 if(!username.length || !password.length || username === usernamePhr || password === passwordPhr){ 89 window.location = "http://www.aoji.cn/user/login" ; 90 }else{ 91 jQuery("#loading").html("<img src='http://www.aoji.cn/static/images/loading.gif' /> ç»å½ä¸..."); 92 jQuery.get('http://www.aoji.cn/user/toplogin',{"username":username,"password":password},function(result){ 93 if(result.state == 0){ 94 jQuery("#loading").html(""); 95 AUI.setLogin(); 96 }else if(result.state == 20){ 97 window.location = 'http://www.aoji.cn/user/cpay/'; 98 }else if(result.state == 10){ 99 window.location = 'http://service.globeedu.com/checklogin.asp?flag=tgdfdsfgsrtwecvbc&username='+username+'&pw='+password; 100 }else 101 { 102 window.location = 'http://www.aoji.cn/user/login?err='+result.state; 103 } 104 },'jsonp'); 105 106 jQuery.get('http://www.aoji.cn/user/syntoplogin',{"username":username,"password":password},function(result){},'jsonp'); 107 } 108 }); 109 }, 110 checkLogin:function(){ 111 jQuery.ajax({ 112 url: 'http://www.aoji.cn/user/toplogin', 113 dataType: 'jsonp', 114 jsonp: 'callback', 115 success: function (result) { 116 if(result.state == 0){ 117 AUI.setLogin(); 118 }else{ 119 window.location = 'http://www.aoji.cn/user/login?err='+result.state; 120 } 121 } 122 }); 123 }, 124 setLoginData : function(result){ 125 if(!jQuery('.topBar').size()) return false; 126 var uid = result.uid, 127 nick = result.username; 128 if(uid){ 129 jQuery('.topBar .topLogin').hide(); 130 jQuery('.topBar .LoginInfo').show(0,function(){ 131 jQuery(this).append('æ¨å¥½ï¼'+nick+' <a href="javascript:;" class="logout" title="éåºç»å½">éåºç»å½</a>'); 132 }); 133 }else{ 134 jQuery('.topBar .topLogin').show(); 135 jQuery('.topBar .LoginInfo').hide();
136 jQuery(".topBar form").get(0).reset(); 137 jQuery('.topBar .LoginInfo').html(''); 138 var username = jQuery('.topLogin .username'); 139 password = jQuery('.topLogin .password'); 140 AUI.placeHolder.create(username); 141 AUI.placeHolder.create(password); 142 } 143 144 }, 145 placeHolder : { 146 _support:(function(){ 147 return 'placeholder' in document.createElement('input'); 148 })(), 149 className: 'phr', 150 init:function(){ 151 if(!this._support){ 152 var inputs = jQuery('input'); 153 this.create(inputs); 154 } 155 }, 156 create:function(inputs){ 157 var self = this; 158 if(!inputs.length) {return;} 159 inputs.each(function(i){ 160 if(!self._support && jQuery(this).attr('placeholder')){ 161 if(jQuery(this).val() === ''){ 162 self._setValue(jQuery(this)); 163 } 164 165 jQuery(this).focus(function(e){ 166 if(jQuery(this).val() === jQuery(this).attr('placeholder')){ 167 jQuery(this).val(''); 168 jQuery(this).removeClass(self.className); 169 } 170 }); 171 jQuery(this).blur(function(e){ 172 if(jQuery(this).val() === ''){ 173 self._setValue(jQuery(this)); 174 } 175 }); 176 } 177 }); 178 }, 179 _setValue:function(input){ 180 input.val(input.attr('placeholder')); 181 input.addClass(this.className); 182 } 183 }, 184 placeholder : function(){ 185 var target = jQuery('[data-placeholder]'); 186 jQuery('span.placeholder').remove(); 187 var isRelative = function(parents){ 188 var flag = false; 189 parents.each(function(){ 190 if(jQuery(this).css('position') == 'relative'){ 191 flag = true; 192 return false; 193 } 194 }); 195 return flag; 196 } 197 target.each(function(){ 198 var _current = jQuery(this), 199 _text = _current.attr('data-placeholder'),leftVal,topVal, 200 _placeholder = jQuery('<span class="placeholder">'+_text+'</span>'); 201 _current.parent().append(_placeholder); 202 if(isRelative(_current.parents())){ 203 leftVal = _current.position().left ; 204 topVal = _current.position().top 205 }else{ 206 leftVal = _current.offset().left ; 207 topVal = _current.offset().top ; 208 } 209 _placeholder.css({'paddingLeft':_current.css('paddingLeft'),'paddingRight':_current.css('paddingRight'),'left':leftVal,'top':topVal,'width':_current.outerWidth(),'height':_current.outerHeight(),'lineHeight':_current.outerHeight()+"px"}); 210 if(_current.val().length) _placeholder.hide(); 211 _placeholder.click(function(e){ 212 _current.focus(); 213 }); 214 _current.bind('blur',function(){ 215 _current.val().length ? _placeholder.hide() : _placeholder.show(); 216 }); 217 _current.bind('focus',function(){ 218 _placeholder.hide(); 219 }); 220 if(!_current.is(":visible")){ 221 _placeholder.hide(); 222 } 223 }); 224 jQuery(window).on('resize',function(){ 225 AUI.placeholder(); 226 }); 227 }, 228 relatedLinks : function(objid, relatedlink){ 229 relatedlink = jQuery.parseJSON(relatedlink); 230 if(!jQuery(objid) || jQuery(objid)[0].innerHTML.match(/<script[^\>]*?>/i)) { 231 return; 232 } 233 var alink = new Array(); 234 var msg = jQuery(objid)[0].innerHTML; 235 i = 0; 236 msg = msg.replace(/(<a.*?<\/a\>)/ig, function($1) { 237 alink[i] = $1; 238 i++; 239 return '#alink '+(i - 1)+'#'; 240 }); 241 var relatedid = new Array(); 242 msg = msg.replace(/(^|>)([^<]+)(?=<|$)/ig, function($1, $2, $3) { 243 for(var j = 0; j < relatedlink.length; j++) { 244 if(relatedlink[j] && !relatedid[j]) { 245 var ra = '<a href="'+relatedlink[j].url+'" target="_blank">'+relatedlink[j].word+'</a>'; 246 var $rtmp = $3; 247 $3 = $3.replace(relatedlink[j].word, ra); 248 if($3 != $rtmp) { 249 relatedid[j] = 1; 250 } 251 } 252 } 253 return $2 + $3; 254 }); 255 256 for(var k in alink) { 257 msg = msg.replace('#alink '+k+'#', alink[k]); 258 } 259 jQuery(objid)[0].innerHTML = msg; 260 }, 261 form : function(){ 262 var box = jQuery('[data-aui="form"]'), 263 btn = box.find(box.attr('data-aui-btn')), 264 cont = box.find(box.find('[data-aui-match]')); 265 cont.each(function(i){ 266 var _self = jQuery(this), 267 match = new RegExp(_self.attr('data-aui-match')); 268 if(_self.attr('data-aui-match').length > 0){ 269 _self.bind('blur',function(){ 270 matchValue(_self,match); 271 }); 272 } 273 }); 274 var matchValue = function(obj,match){ 275 var value = obj.val(), 276 result = match.test(value), 277 objWrap = obj.attr('type') == "hidden" ? obj.parent().parent() : obj.parent(); 278 if(result){ 279 objWrap.removeClass("err"); 280 }else{ 281 objWrap.addClass("err"); 282 objWrap.find('.errIcon').size() ? "" : (obj.attr('type') == "hidden" ? objWrap.append('<span class="errIcon">æ ¼å¼é误ï¼</span>') : obj.after('<span class="errIcon">æ ¼å¼é误ï¼</span>')); 283 return false; 284 } 285 } 286 box.find('form').submit(function(e){ 287 e.preventDefault(); 288 var _self = jQuery(this), 289 url = _self.attr('action'); 290 cont.blur(); 291 if(box.find('.err').size() == 0){ 292 if(checksubmit ==0){ 293 jQuery.ajax({ 294 url:url, 295 dataType:"jsonp", 296 data:_self.serialize(), 297 success:function(data){ 298 alert(data.msg); 299 if(data.state == 0){ 300 btn.parents().find('form').get(0).reset(); 301 checksubmit = 1; 302 }else if(data.state == 1){ 303 jQuery(document).scrollTop(jQuery('[name="'+data.target+'"]').offset().top + 5); 304 jQuery('[name="'+data.target+'"]').val('').blur(); 305 } 306 } 307 }); 308 }else{ 309 alert("æ¨å·²ç»æäº¤è¿æ°æ®ï¼è¯·ä¸è¦éå¤æäº¤ã"); 310 } 311 }else{ 312 jQuery(document).scrollTop(jQuery('.err').eq(0).offset().top + 5); 313 } 314 }); 315 }, 316 tab : function(){ 317 var box = jQuery('[data-aui="tab"]'); 318 box.each(function(){ 319 var _box = jQuery(this), 320 hover = _box.attr('data-aui-anim') == "hover" ? true : false, 321 btn = _box.find(_box.attr('data-aui-btn')), 322 cont = _box.find(_box.attr('data-aui-cont')); 323 btn.mouseenter(function(e){ 324 e.preventDefault(); 325 var _self = jQuery(this), 326 _index = _self.index(); 327 btn.removeClass('on'); 328 _self.addClass('on'); 329 cont.hide(); 330 if(hover){ 331 cont.eq(_index).show(); 332 _self.mouseleave(function(){ 333 cont.eq(_index).hide(); 334 btn.eq(_index).removeClass('on'); 335 }); 336 }else{ 337 cont.eq(_index).show(); 338 } 339 }); 340 }); 341 }, 342 search : function(){ 343 var box = jQuery('[data-aui="search"]'); 344 box.each(function(){ 345 var _box = jQuery(this), 346 btn = _box.find(_box.attr('data-aui-btn')), 347 cont = _box.find(_box.attr('data-aui-cont')); 348 btn.hover(function(e){ 349 e.preventDefault(); 350 var _self = jQuery(this), 351 _index = _self.index(); 352 change(_index); 353 }); 354 var change = function(index){ 355 btn.removeClass('on'); 356 btn.eq(index).addClass('on'); 357 cont.val(btn.eq(index).attr('data-type')); 358 } 359 //change(0); 360 }); 361 }, 362 /*reserve: function(){ 363 var box = jQuery('[data-aui="reserve"]'); 364 box.each(function(){ 365 var _box = jQuery(this), 366 btn = _box.find(_box.attr('data-aui-form-btn')); 367 btn.click(function(e){ 368 e.preventDefault(); 369 var formDialog = art.Dialog({title:'线路é¢å®',content:'loading...'}); 370 jQuery.get('/api/getCountryCityData/id',function(){ 371 372 }); 373 }); 374 }); 375 },*/ 376 slider:function(){ 377 var box = jQuery('[data-aui="slider"]'); 378 box.each(function(){ 379 var _box = jQuery(this), 380 btn = _box.find(_box.attr('data-aui-btn')), 381 cont = _box.find(_box.attr('data-aui-cont')), 382 num = _box.attr('data-aui-num'), 383 itemSize = cont.size(), 384 page = 0, 385 auto = _box.find(_box.attr('data-aui-auto')); 386 var doSlider = function(e){ 387 e.preventDefault(); 388 var _btn = jQuery(this), 389 countBox = cont.parent(); 390 if(_btn.hasClass('prev')){ 391 _btn.unbind('click'); 392 if(page == 0) { page = parseInt(itemSize/num)-1}else{page -- } 393 slideWdith = countBox.parent().width() * page; 394 jQuery(countBox).animate({"marginLeft":'-'+slideWdith+"px"},2000,function(){_btn.bind("click",doSlider);}); 395 }else{ 396 _btn.unbind('click'); 397 if(page == (parseInt(itemSize/num))-1){page = 0; }else{page++;}; 398 slideWdith = countBox.parent().width() * page; 399 jQuery(countBox).animate({"marginLeft":"-"+slideWdith+"px"},2000,function(){_btn.bind("click",doSlider);}); 400 } 401 } 402 403 if(itemSize > num){ 404 btn.bind('click',doSlider); 405 } 406 }); 407 408 }, 409 slider_item:function(){ 410 var box = jQuery('[data-aui="slider-item"]'); 411 box.each(function(){ 412 var _box = jQuery(this), 413 btnBox = _box.find(_box.attr('data-aui-btn')), 414 cont = _box.find(_box.attr('data-aui-cont')); 415 !btnBox.children().size() && cont.each(function(){ 416 btnBox.append('<a href="javascript:;">â</a>'); 417 }); 418 var btn = btnBox.children(); 419 btn.click(function(e){ 420 e.preventDefault(); 421 var _btn = jQuery(this); 422 var _index = _btn.index(); 423 slide(_index); 424 }); 425 var slide = function(index){ 426 btn.removeClass('on'); 427 btn.eq(index).addClass('on'); 428 cont.parent().animate({"marginLeft":"-"+index*cont.width()},500,function(){ 429 }); 430 } 431 slide(0); 432 }); 433 }, 434 slider_area:function(){ 435 var box = jQuery('[data-aui="slider-area"]'); 436 box.each(function(){ 437 var _box = jQuery(this), 438 btn = _box.find(_box.attr('data-aui-btn')), 439 cont = _box.find(_box.attr('data-aui-cont')), 440 itemSize = cont.size(), 441 num = 1, 442 page = 0; 443 var doSlider = function(e){ 444 e.preventDefault(); 445 var _btn = jQuery(this), 446 countBox = cont.parent(); 447 if(_btn.hasClass('prev')){ 448 _btn.unbind('click'); 449 if(page == 0) { page = parseInt(itemSize/num)-1}else{page -- } 450 slideWdith = countBox.parent().width() * page; 451 jQuery(countBox).animate({"marginLeft":'-'+slideWdith+"px"},2000,function(){_btn.bind("click",doSlider);}); 452 }else{ 453 _btn.unbind('click'); 454 if(page == (parseInt(itemSize/num))-1){page = 0; }else{page++;}; 455 slideWdith = countBox.parent().width() * page; 456 jQuery(countBox).animate({"marginLeft":"-"+slideWdith+"px"},2000,function(){_btn.bind("click",doSlider);}); 457 } 458 } 459 460 if(itemSize > num){ 461 btn.bind('click',doSlider); 462 } 463 }); 464 }, 465 focus :function(){ 466 var box = jQuery('[data-aui="focus"]'); 467 box.each(function(){ 468 var _box = jQuery(this), 469 btn = _box.find(_box.attr('data-aui-btn')), 470 cont = _box.find(_box.attr('data-aui-cont')), 471 auto = _box.find(_box.attr('data-aui-auto')), 472 current = 0, autoAnim; 473 cont.each(function(i){ 474 btn.append('<a href="javascript:;">'+(i+1)+'</a>'); 475 }); 476 btn = btn.find('a'); 477 btn.live('click',function(e){ 478 e.preventDefault(); 479 var _self = jQuery(this), 480 _index = _self.index(); 481 current = _index; 482 clearInterval(autoAnim); 483 slide(_index,true); 484 }); 485 var slide = function(index,retimer){ 486 btn.removeClass('on'); 487 btn.eq(index).addClass('on'); 488 cont.parent().animate({"marginTop":"-"+parseInt(index*cont.height())},500); 489 if(retimer){ 490 autoAnim = setInterval(anim,6000); 491 } 492 } 493 slide(0); 494 function anim(){ 495 if(current == (btn.size()-1)){ 496 current =0; 497 }else{ 498 current++; 499 } 500 slide(current); 501 } 502 autoAnim = setInterval(anim,6000); 503 }); 504 }, 505 select : function(obj){ 506 var box = obj ? obj : jQuery('[data-aui="select"]'); 507 508 box.each(function(){ 509 var _box = jQuery(this), 510 btn = _box.find(_box.attr('data-aui-btn')), 511 cont = _box.find(_box.attr('data-aui-cont')); 512 !obj && _box.find('span,em').click(function(){ 513 var __btn = jQuery(this); 514 if(this.tagName.toUpperCase() === 'EM') {//fix click "em" ul width bug 515 __btn = jQuery(this).next('span'); 516 } 517 box.find(_box.attr('data-aui-cont')).not(cont).hide();box.css('position',''); 518 //cont.is(':visible') ? _box.removeClass('showSelect') : _box.addClass('showSelect'); 519 if(cont.is(':visible')){ 520 cont.hide(); 521 }else{ 522 var bottom = jQuery(document).height() - __btn.offset().top - __btn.outerHeight() - 4; 523 cont.show(); 524 _box.css('position','relative'); 525 if(cont.height() > 300 ) { 526 cont.css({'height':bottom>300?300:bottom+'px','width':__btn.outerWidth(),'overflow':'scroll','overflow-x':'hidden'}); 527 }else{ 528 cont.css({'width':__btn.outerWidth()}); 529 } 530 } 531 }); 532 !obj && btn.live('click',function(e){ 533 e.preventDefault(); 534 var _name = jQuery(this).find('a').text(), 535 _id = jQuery(this).find('a').attr('data-value'); 536 _box.find('input').val(_id); 537 _box.find('input').blur(); 538 _box.find('span').text(_name); 539 _box.css('position',''); 540 cont.hide(); 541 if(
541_box.attr('data-load')!=undefined){ 542 var art= artDialog.tips('loading...'); 543 jQuery.getJSON(_box.attr('data-load')+_id,function(result){ 544 art.close(); 545 box.css('position',''); 546 insertData(result,jQuery(_box.attr('data-for'))); 547 }); 548 } 549 }); 550 }); 551 var insertData = function(data,targetEle){ 552 var target = box.find(targetEle); 553 target.html(''); 554 jQuery.each(data,function(i){ 555 if(i == '0'){ 556 targetEle.parent().find('input').val(data[i].id); 557 targetEle.parent().find('span').text(data[i].value); 558 } 559 targetEle.append('<li><a href="javascript:;" data-value="'+data[i].id+'" title="'+data[i].value+'">'+data[i].value+'</a></li>'); 560 }); 561 AUI.select(targetEle.parent()); 562 } 563 jQuery(document).bind('click',function( e){ 564 var target = e.target || e.srcElement; 565 if(!jQuery(target).parents().hasClass('select')){ 566 box.find(box.attr('data-aui-cont')).hide(); 567 box.css('position',''); 568 } 569 }); 570 } 571} 572jQuery(document).ready(function(){ 573 AUI.common(); 574 AUI.tab(); 575 AUI.search(); 576 AUI.focus(); 577 //AUI.login(); 578 AUI.placeholder(); 579 //AUI.checkLogin(); 580}); 581document.writeln("<script type=\"text/javascript\" src=\"http://www.aoji.cn/static/js/sso_login.js\"></script>"); 582//document.writeln("<script type=\"text/javascript\" src=\"/static/js/siteStats.js?v=1\"></script>"); 583document.writeln("<script type=\"text/javascript\" src=\"/static/js/baidutongji.js?v=9\"></script>"); 584document.writeln("<script type=\"text/javascript\" src=\"http://www.aoji.cn/static/js/jdfwkey.js\"></script>");
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.