ÿØÿà JFIF    ÿÛ „  ( %"1!%)+...383,7(-.+  -+++--++++---+-+-----+---------------+---+-++7-----ÿÀ  ß â" ÿÄ     ÿÄ H    !1AQaq"‘¡2B±ÁÑð#R“Ò Tbr‚²á3csƒ’ÂñDS¢³$CÿÄ   ÿÄ %  !1AQa"23‘ÿÚ   ? ôÿ ¨pŸªáÿ —åYõõ\?àÒü©ŠÄï¨pŸªáÿ —åYõõ\?àÓü©ŠÄá 0Ÿªáÿ Ÿå[úƒ ú®ði~TÁbqÐ8OÕpÿ ƒOò¤Oè`–RÂáœá™êi€ßÉ< FtŸI“öÌ8úDf´°å}“¾œ6  öFá°y¥jñÇh†ˆ¢ã/ÃÐ:ªcÈ "Y¡ðÑl>ÿ ”ÏËte:qž\oäŠe÷󲍷˜HT4&ÿ ÓÐü6ö®¿øþßèô Ÿ•7Ñi’•j|“ñì>b…þS?*Óôÿ ÓÐü*h¥£ír¶ü UãS炟[AÐaè[ûª•õ&õj?†Éö+EzP—WeÒírJFt ‘BŒ†Ï‡%#tE Øz ¥OÛ«!1›üä±Í™%ºÍãö]°î(–:@<‹ŒÊö×òÆt¦ãº+‡¦%ÌÁ²h´OƒJŒtMÜ>ÀÜÊw3Y´•牋4ǍýʏTì>œú=Íwhyë,¾Ôò×õ¿ßÊa»«þˆѪQ|%6ž™A õ%:øj<>É—ÿ Å_ˆCbõ¥š±ý¯Ýƒï…¶|RëócÍf溪“t.СøTÿ *Ä¿-{†çàczůŽ_–^XþŒ±miB[X±d 1,é”zEù»& î9gœf™9Ð'.;—™i}!ôšåîqêÛ٤ёý£½ÆA–àôe"A$˝Úsäÿ ÷Û #°xŸëí(l »ý3—¥5m! rt`†0~'j2(]S¦¦kv,ÚÇ l¦øJA£Šƒ J3E8ÙiŽ:cÉžúeZ°€¯\®kÖ(79«Ž:¯X”¾³Š&¡* ….‰Ž(ÜíŸ2¥ª‡×Hi²TF¤ò[¨íÈRëÉ䢍mgÑ.Ÿ<öäS0í„ǹÁU´f#Vß;Õ–…P@3ío<ä-±»Ž.L|kªÀê›fÂ6@»eu‚|ÓaÞÆŸ…¨ááå>åŠ?cKü6ùTÍÆ”†sĤÚ;H2RÚ†õ\Ö·Ÿn'¾ ñ#ºI¤Å´%çÁ­‚â7›‹qT3Iï¨ÖÚ5I7Ë!ÅOóŸ¶øÝñØôת¦$Tcö‘[«Ö³šÒ';Aþ ¸èíg A2Z"i¸vdÄ÷.iõ®§)¿]¤À†–‡É&ä{V¶iŽ”.Ó×Õÿ û?h¬Mt–íª[ÿ Ñÿ ÌV(í}=ibÔ¡›¥¢±b Lô¥‡piη_Z<‡z§èŒ)iÖwiÇ 2hÙ3·=’d÷8éŽ1¦¸c¤µ€7›7Ø ð\á)} ¹fËí›pAÃL%âc2 í§æQz¿;T8sæ°qø)QFMð‰XŒÂ±N¢aF¨…8¯!U  Z©RÊ ÖPVÄÀÍin™Ì-GˆªÅËŠ›•zË}º±ŽÍFò¹}Uw×#ä5B¤{î}Ð<ÙD é©¤&‡ïDbàÁôMÁ." ¤‡ú*õ'VŽ|¼´Úgllº¼klz[Æüï÷Aób‡Eÿ dÑ»Xx9ÃÜ£ÁT/`¼¸vI±Ýµ·Ë‚“G³þ*Ÿû´r|*}<¨îºœ @¦mÄ’M¹”.œ«Y–|6ÏU¤jç¥ÕÞqO ˜kDÆÁ¨5ÿ š;ÐЦ¦€GÙk \ –Þ=â¼=SͧµªS°ÚÍpÜãQűÀõ¬?ÃÁ1Ñ•õZà?hóœ€ L¦l{Y*K˜Ù›zc˜–ˆâ ø+¾ ­-Ök¥%ùEÜA'}ˆ><ÊIè“bpÍ/qÞâvoX€w,\úªò6Z[XdÒæ­@Ö—€$òJí#é>'°Ú ôª˜<)4ryÙ£|óAÅn5žêŸyÒäMÝ2{"}‰–¤l÷ûWX\l¾Á¸góÉOÔ /óñB¤f¸çñ[.P˜ZsÊË*ßT܈§QN¢’¡¨§V¼(Üù*eÕ“”5T¨‹Âê¥FŒã½Dü[8'Ò¥a…Ú¶k7a *•›¼'Ò·\8¨ª\@\õ¢¦íq+DÙrmÎ…_ªæ»ŠÓœ¡¯’Ré9MÅ×D™lælffc+ŒÑ,ý™ÿ ¯þǤ=Å’Á7µ÷ÚÛ/“Ü€ñýã¼àí¾ÕÑ+ƒ,uµMâÀÄbm:ÒÎPæ{˜Gz[ƒ¯«® KHà`ߨŠéí¯P8Aq.C‰ à€kòpj´kN¶qô€…Õ,ÜNŠª-­{Zö’æû44‰sŽè‰îVíRœÕm" 6?³D9¡ÇTíÅꋇ`4«¸ÝÁô ï’ýorqКÇZ«x4Žâéþuïf¹µö[P ,Q£éaX±`PÉÍZ ¸äYúg üAx ’6Lê‚xÝÓ*äQ  Ï’¨hÍ =²,6ï#rÃ<¯–£»ƒ‹,–ê•€ aÛsñ'%Æ"®ÛüìBᝠHÚ3ß°©$“XnœÖ’î2ËTeûìxîß ¦å¿çÉ ðK§þ{‘t‚Ϋ¬jéîZ[ ”š7L¥4VÚCE×]m¤Øy”ä4-dz£œ§¸x.*ãÊÊ b÷•h:©‡¦s`BTÁRû¾g⻩‹jø sF¢àJøFl‘È•Xᓁà~*j¯ +(ÚÕ6-£¯÷GŠØy‚<Ç’.F‹Hœw(+)ÜÜâÈzÄäT§FߘãÏ;DmVœ3Àu@mÚüXÝü•3B¨òÌÁÛ<·ÃÜ z,Ì@õÅ·d2]ü8s÷IôÞ¯^Ç9¢u„~ëAŸï4«M? K]­ÅàPl@s_ p:°¬ZR”´›JC[CS.h‹ƒïËœ«Æ]–÷ó‚wR×k7X‰k›‘´ù¦=¡«‰¨¨Â')—71ó’c‡Ðúµ `é.{§p¹ój\Ž{1h{o±Ý=áUÊïGÖŒõ–-BÄm+AZX¶¡ ïHðæ¥JmÙ;…䡟ˆ¦ ° äšiÉg«$üMk5¤L“’çÊvïâï ,=f“"íἊ5ô¬x6{ɏžID0e¸vçmi'︧ºð9$ò¹÷*£’9ÿ ²TÔ…×>JV¥}Œ}$p[bÔ®*[jzS*8 ”·T›Í–ñUîƒwo$áè=LT™ç—~ô·¤ÈÚ$榍q‰„+´kFm)ž‹©i–ËqÞŠ‰à¶ü( ‚•§ •°ò·‡#5ª•µÊ﯅¡X¨šÁ*F#TXJÊ ušJVÍ&=iÄs1‚3•'fý§5Ñ<=[íÞ­ PÚ;ѱÌ_~Ä££8rÞ ²w;’hDT°>ÈG¬8Á²ÚzŽ®ò®qZcqJêäÞ-ö[ܘbň±çb“ж31²n×iƒðÕ;1¶þÉ ªX‰,ßqÏ$>•î íZ¥Z 1{ç൵+ƒÕµ¥°T$§K]á»Ûï*·¤tMI’ÂZbŽÕiÒ˜}bÓ0£ª5›¨ [5Ž^ÝœWøÂÝh° ¢OWun£¤5 a2Z.G2³YL]jåtì”ä ÁÓ‘%"©<Ôúʰsº UZvä‡ÄiÆÒM .÷V·™ø#kèýiíÌ–ª)µT[)BˆõÑ xB¾B€ÖT¨.¥~ð@VĶr#¸ü*åZNDŽH;âi ],©£öØpù(šºãö¼T.uCê•4@ÿ GÕÛ)Cx›®0ø#:ÏðFÒbR\(€€Ä®fã4Þ‰Fä¯HXƒÅ,†öEÑÔÜ]Öv²?tLÃvBY£ú6Êu5ÅAQ³1‘’¬x–HŒÐ‡ ^ ¸KwJôÖŽ5×CÚ¨vÜ«/B0$×k°=ðbÇ(Ï)w±A†Á† 11Í=èQšµ626ŒÜ/`G«µ<}—-Ö7KEHÈÉðóȤmݱû±·ø«Snmá=“䫚mݱŸ¡¶~ó·“äUóJæúòB|E LêŽy´jDÔ$G¢þÐñ7óR8ýÒ…Ç› WVe#·Ÿ p·Fx~•ݤF÷0Èÿ K¯æS<6’¡WШ; ´ÿ ¥Êø\Òuî†åÝ–VNœkÒ7oòX¨Á­Ø÷FÎÑä±g÷ÿ M~Çî=p,X´ ÝÌÚÅ‹’ÃjÖ.ØöÏñ qïQ¤ÓZE†° =6·]܈ s¸>v•Ž^Ý\wq9r‰Î\¸¡kURÒ$­*‹Nq?Þª*!sŠÆ:TU_u±T+øX¡ ®¹¡,ÄâÃBTsÜ$Ø›4m椴zÜK]’’›Pƒ @€#â˜`é¹=I‡fiV•Ôî“nRm+µFPOhÍ0B£ €+¬5c v•:P'ÒyÎ ‰V~‚Ó†ÖuókDoh$å\*ö%Ю=£«…aȼ½÷Û.-½VŒŠ¼'lyî±1¬3ó#ÞE¿ÔS¤gV£m›=§\û"—WU¤ÚǼÿ ÂnÁGŒÃ ‚õN D³õNÚíŒÕ;HôyÄÈ©P¹Ä{:?R‘Ô¨âF÷ø£bÅó® JS|‚R÷ivýáâ€Æé¡è³´IئÑT!§˜•ت‚¬â@q€wnïCWÄ@JU€ê¯m6]Ï:£âx'+ÒðXvÓ¦Úm=–´7œ $ì“B£~p%ÕŸUþ« N@¼üï~w˜ñø5®—'Ôe»¤5ã//€ž~‰Tþ›Å7•#¤× Íö pÄ$ùeåì*«ÓŠEØWEÈsßg ¦ûvžSsLpºÊW–âµEWöˬH; ™!CYõZ ÃÄf æ#1W. \uWâ\,\Çf j’<qTbên›Î[vxx£ë 'ö¨1›˜ÀM¼Pÿ H)ƒêêŒA7s,|F“ 꺸k³9Ìö*ç®;Ö!Ö$Eiž•¹ÒÚ†ýóéÝû¾ÕS®ó$’NÝäŸz¤5r¦ãÄÃD÷Üø!°ø‡Ô&@m™Ì^Ãä­d q5Lnÿ N;.6½·N|#ä"1Nƒx“ã<3('&ñßt  ~ªu”1Tb㫨9ê–›–bìd$ߣ=#ÕãÒmU¯eí$EFù5ýYô櫨æì™Ç—±ssM]·á¿0ÕåJRÓªîiƒ+O58ÖñªŠÒx" \µâá¨i’¤i —Ö ” M+M¤ë9‚‰A¦°Qõ¾ßøK~¼Ã‘g…Ö´~÷Ï[3GUœÒ½#…kàÔ®Ò”‰³·dWV‰IP‰Ú8u¹”E ÖqLj¾êÕCBš{A^Âß;–¨`¯¬ìö ˼ ×tìø.tƐm*n¨y4o&Àx¥n¦×î‡aupáÛj8¿m›è¶ã!o½;ß0y^ý×^EÑ¿ÒjzŒ­)vÚÑnÄL …^ªô× ‡—‚3k Îý­hï]içå–îÏ*÷ñþ»Ô CÒjøjÍznˆ´ ¹#b'Fô‹ ‰v¥'’à'T´ƒHýÍ%M‰ ƒ&ÆÇŒï1 ‘ –Þ ‰i¬s žR-Ÿ kЬá¬7:þ 0ŒÅÒÕ/aÙ¬ÃÝ#Úøœ ©aiVc‰. ¹¦ãµ” ›Yg¦›ÆÎýº°f³7ƒhá·¸­}&D9¡ÂsÉÙÞèŠõØàC™¨ñbFC|´Ü(ŸƒÚÒ-%»'a Ì¿)ËÇn¿úÿ ÞŽX…4ÊÅH^ôΑí@ù¹Eh¶“L8Çjù ¼ÎåVªóR©Ï5uà V4lZß®=€xÖŸ–ÑÈ ÷”¨°¾__yM1tÉ?uÆþIkÄgæ@þ[¢†°XÃJ£j·:nkÅ¢u ‘}âGzö­/IµèЬ¼48q¦F°ŽR¼=ûì{´¯RýicS ÕÛ íNtÍÙï£,w4rêì®»~x(©Uñ§#Ñ&œÕ¤>ÎåÍÓ9’Ö{9eV­[Öjâ²ãu]˜å2›qÑšÕJç0€sÄ|Êëè0튔bÁ>“{×_F`Ø©ºê:µä,v¤ðfc1±"«ÔÍän1#=· Âøv~H½ÐßA¾¿Ü€Óš]Õ; I¾÷ç‚Qi†î¹9ywÔKG˜áñ zQY—§ÃÕZ07§X‚ Áh;ÁM)iÌCH-¯T‘ë|A0{Ò½LÚ–TâÖkÜ’dÀ“rmm»”جPF³ÖcbE§T€ÒxKºû’Ó®7±²(\4ŽÃ¸Uu@j™yĵ;³µ!Á¢b.W¤=mõ´êµK k ¸K^ÜÛ#p*Ü14qkZç5ïë †°5Ï%ÍÛ<Õ¤×Ô¥ê†C Õ´¼ú$ƒÖ“”]Ù¬qÞÚ[4©ý!ûÏ—Áb쳐XµA¬â~`›Çr¸8ìùÝ䫦<>ä÷«?xs´ÇÑ /á;¹øüÊÈÙà{"@Žïzâ¬[âß‚ U_<ÇŸ½4èN˜ú61®qŠu ¦þF£»äJ_ˆÙÎ~ ÞAã–݄ϗrŠD;xTž‘ô`É«…suãO`?³à™ô Lý#Íc5öoæØ‚y´´÷«ZR§<&JÇ+éâô´€i!Àˆ0æAoàðLèÖ-2ŸõW.’t^–(KÁmHµV@xÜÇy®Ñø­â^:Ú3w· 7½¹°ñ¸â¹®:',«Mœ—n­Á+Ãbš LÈ‘ÄnRÓÅœ%¦²‰¨ùQ:¤f‚ "PÕtô¸…cæl…&˜Ú˜Ôkv‹ž+vŠ,=¢v­6—Xy*¥t£«<™:“aîϲ=¦6rO]XI¿Œ÷¤zÚ­›¶ 6÷”w\d ü~v®ˆÌk«^m<ÿ ¢‰Õ\)ùºŽ;… lîÙÅEŠ®cѾ@vnMÏ,¼“ñ•ŽBxðÃzãÇç%3ˆ"}Ù•Åî> BÉú;Ò]V+P˜F_´ßé> Øše|ï‡ÄOmFæÇ ãqÞ$/xÐx­z`ï9"œÜij‚!7.\Td…9M‡•iŽ‹¾‘50ÞŽn¥ß4ÉôO ¹*í^QêËÜÇÌ8=ާs‰'ÂëÙ«á%Pú[O †ÅP¯Vsް.‰,kc¶ ¬A9n˜XÎ-ÞšN["¹QÕ‰ƒMýÁߺXJæÍaLj¾×Ãmã¾ãÚ uñÒþåQô¦¥ /ÄUx:‚ÍÜ’ Đ©ØÝ3V¨‰ÕnÐ6ó*óúK­«…c ¯U òhsý­jóÔj#,ímŒRµ«lbïUTŒÑ8†Ä0œÏr`ð¡¬É Ї ë"À² ™ 6¥ f¶ ¢ÚoܱԷ-<Àî)†a¶ž'Ú»¨TXqØæ¶÷YÄHy˜9ÈIW­YÀuMFë ºÏ’AqÌ4·/Ú †ô'i$øä­=Ä Ý|öK×40è|È6p‘0§)o¥ctî§H+CA-“ xØ|ÐXАç l8íºð3Ø:³¤¬KX¯UÿÙ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * This object handles ajax requests for pages. It also * handles the reloading of the main menu and scripts. */ var AJAX = { /** * @var bool active Whether we are busy */ active: false, /** * @var object source The object whose event initialized the request */ source: null, /** * @var object xhr A reference to the ajax request that is currently running */ xhr: null, /** * @var object lockedTargets, list of locked targets */ lockedTargets: {}, /** * @var function Callback to execute after a successful request * Used by PMA_commonFunctions from common.js */ _callback: function () {}, /** * @var bool _debug Makes noise in your Firebug console */ _debug: false, /** * @var object $msgbox A reference to a jQuery object that links to a message * box that is generated by PMA_ajaxShowMessage() */ $msgbox: null, /** * Given the filename of a script, returns a hash to be * used to refer to all the events registered for the file * * @param key string key The filename for which to get the event name * * @return int */ hash: function (key) { /* http://burtleburtle.net/bob/hash/doobs.html#one */ key += ""; var len = key.length, hash = 0, i = 0; for (; i < len; ++i) { hash += key.charCodeAt(i); hash += (hash << 10); hash ^= (hash >> 6); } hash += (hash << 3); hash ^= (hash >> 11); hash += (hash << 15); return Math.abs(hash); }, /** * Registers an onload event for a file * * @param file string file The filename for which to register the event * @param func function func The function to execute when the page is ready * * @return self For chaining */ registerOnload: function (file, func) { var eventName = 'onload_' + AJAX.hash(file); $(document).bind(eventName, func); if (this._debug) { console.log( // no need to translate "Registered event " + eventName + " for file " + file ); } return this; }, /** * Registers a teardown event for a file. This is useful to execute functions * that unbind events for page elements that are about to be removed. * * @param string file The filename for which to register the event * @param function func The function to execute when * the page is about to be torn down * * @return self For chaining */ registerTeardown: function (file, func) { var eventName = 'teardown_' + AJAX.hash(file); $(document).bind(eventName, func); if (this._debug) { console.log( // no need to translate "Registered event " + eventName + " for file " + file ); } return this; }, /** * Called when a page has finished loading, once for every * file that registered to the onload event of that file. * * @param string file The filename for which to fire the event * * @return void */ fireOnload: function (file) { var eventName = 'onload_' + AJAX.hash(file); $(document).trigger(eventName); if (this._debug) { console.log( // no need to translate "Fired event " + eventName + " for file " + file ); } }, /** * Called just before a page is torn down, once for every * file that registered to the teardown event of that file. * * @param string file The filename for which to fire the event * * @return void */ fireTeardown: function (file) { var eventName = 'teardown_' + AJAX.hash(file); $(document).triggerHandler(eventName); if (this._debug) { console.log( // no need to translate "Fired event " + eventName + " for file " + file ); } }, /** * function to handle lock page mechanism * * @param event the event object * * @return void */ lockPageHandler: function(event) { //Don't lock on enter. if (0 === event.charCode) { return; } var lockId = $(this).data('lock-id'); if (typeof lockId === 'undefined') { return; } /* * @todo Fix Code mirror does not give correct full value (query) * in textarea, it returns only the change in content. */ var newHash = null; if (event.data.value == 1) { newHash = AJAX.hash($(this).val()); } else { newHash = AJAX.hash($(this).is(":checked")); } var oldHash = $(this).data('val-hash'); // Set lock if old value != new value // otherwise release lock if (oldHash !== newHash) { AJAX.lockedTargets[lockId] = true; } else { delete AJAX.lockedTargets[lockId]; } // Show lock icon if locked targets is not empty. // otherwise remove lock icon if (!jQuery.isEmptyObject(AJAX.lockedTargets)) { $('#lock_page_icon').html(PMA_getImage('s_lock.png',PMA_messages.strLockToolTip).toString()); } else { $('#lock_page_icon').html(''); } }, /** * resets the lock * * @return void */ resetLock: function() { AJAX.lockedTargets = {}; $('#lock_page_icon').html(''); }, handleMenu: { replace: function (content) { $('#floating_menubar').html(content) // Remove duplicate wrapper // TODO: don't send it in the response .children().first().remove(); $('#topmenu').menuResizer(PMA_mainMenuResizerCallback); } }, /** * Event handler for clicks on links and form submissions * * @param object e Event data * * @return void */ requestHandler: function (event) { // In some cases we don't want to handle the request here and either // leave the browser deal with it natively (e.g: file download) // or leave an existing ajax event handler present elsewhere deal with it var href = $(this).attr('href'); if (typeof event != 'undefined' && (event.shiftKey || event.ctrlKey)) { return true; } else if ($(this).attr('target')) { return true; } else if ($(this).hasClass('ajax') || $(this).hasClass('disableAjax')) { //reset the lockedTargets object, as specified AJAX operation has finished AJAX.resetLock(); return true; } else if (href && href.match(/^#/)) { return true; } else if (href && href.match(/^mailto/)) { return true; } else if ($(this).hasClass('ui-datepicker-next') || $(this).hasClass('ui-datepicker-prev') ) { return true; } if (typeof event != 'undefined') { event.preventDefault(); event.stopImmediatePropagation(); } //triggers a confirm dialog if: //the user has performed some operations on loaded page //the user clicks on some link, (won't trigger for buttons) //the click event is not triggered by script if (typeof event !== 'undefined' && event.type === 'click' && event.isTrigger !== true && !jQuery.isEmptyObject(AJAX.lockedTargets) && confirm(PMA_messages.strConfirmNavigation) === false ) { return false; } AJAX.resetLock(); var isLink = !! href || false; var previousLinkAborted = false; if (AJAX.active === true) { // Cancel the old request if abortable, when the user requests // something else. Otherwise silently bail out, as there is already // a request well in progress. if (AJAX.xhr) { //In case of a link request, attempt aborting AJAX.xhr.abort(); if(AJAX.xhr.status === 0 && AJAX.xhr.statusText === 'abort') { //If aborted AJAX.$msgbox = PMA_ajaxShowMessage(PMA_messages.strAbortedRequest); AJAX.active = false; AJAX.xhr = null; previousLinkAborted = true; } else { //If can't abort return false; } } else { //In case submitting a form, don't attempt aborting return false; } } AJAX.source = $(this); $('html, body').animate({scrollTop: 0}, 'fast'); var url = isLink ? href : $(this).attr('action'); var params = 'ajax_request=true&ajax_page_request=true'; if (! isLink) { params += '&' + $(this).serialize(); } if (! (history && history.pushState)) { // Add a list of menu hashes that we have in the cache to the request params += PMA_MicroHistory.menus.getRequestParam(); } if (AJAX._debug) { console.log("Loading: " + url); // no need to translate } if (isLink) { AJAX.active = true; AJAX.$msgbox = PMA_ajaxShowMessage(); //Save reference for the new link request AJAX.xhr = $.get(url, params, AJAX.responseHandler); if (history && history.pushState) { var state = { url : href }; if (previousLinkAborted) { //hack: there is already an aborted entry on stack //so just modify the aborted one history.replaceState(state, null, href); } else { history.pushState(state, null, href); } } } else { /** * Manually fire the onsubmit event for the form, if any. * The event was saved in the jQuery data object by an onload * handler defined below. Workaround for bug #3583316 */ var onsubmit = $(this).data('onsubmit'); // Submit the request if there is no onsubmit handler // or if it returns a value that evaluates to true if (typeof onsubmit !== 'function' || onsubmit.apply(this, [event])) { AJAX.active = true; AJAX.$msgbox = PMA_ajaxShowMessage(); $.post(url, params, AJAX.responseHandler); } } }, /** * Called after the request that was initiated by this.requestHandler() * has completed successfully or with a caught error. For completely * failed requests or requests with uncaught errors, see the .ajaxError * handler at the bottom of this file. * * To refer to self use 'AJAX', instead of 'this' as this function * is called in the jQuery context. * * @param object e Event data * * @return void */ responseHandler: function (data) { if (typeof data === 'undefined' || data === null) { return; } if (typeof data.success != 'undefined' && data.success) { $('html, body').animate({scrollTop: 0}, 'fast'); PMA_ajaxRemoveMessage(AJAX.$msgbox); if (data._redirect) { PMA_ajaxShowMessage(data._redirect, false); AJAX.active = false; AJAX.xhr = null; return; } AJAX.scriptHandler.reset(function () { if (data._reloadNavigation) { PMA_reloadNavigation(); } if (data._title) { $('title').replaceWith(data._title); } if (data._menu) { if (history && history.pushState) { var state = { url : data._selflink, menu : data._menu }; history.replaceState(state, null); AJAX.handleMenu.replace(data._menu); } else { PMA_MicroHistory.menus.replace(data._menu); PMA_MicroHistory.menus.add(data._menuHash, data._menu); } } else if (data._menuHash) { if (! (history && history.pushState)) { PMA_MicroHistory.menus.replace(PMA_MicroHistory.menus.get(data._menuHash)); } } if (data._disableNaviSettings) { PMA_disableNaviSettings(); } else { PMA_ensureNaviSettings(data._selflink); } // Remove all containers that may have // been added outside of #page_content $('body').children() .not('#pma_navigation') .not('#floating_menubar') .not('#page_nav_icons') .not('#page_content') .not('#selflink') .not('#pma_header') .not('#pma_footer') .not('#pma_demo') .not('#pma_console_container') .not('#prefs_autoload') .remove(); // Replace #page_content with new content if (data.message && data.message.length > 0) { $('#page_content').replaceWith( "
" + data.message + "
" ); PMA_highlightSQL($('#page_content')); checkNumberOfFields(); } if (data._selflink) { var source = data._selflink.split('?')[0]; //Check for faulty links $selflink_replace = { "import.php": "tbl_sql.php", "tbl_chart.php": "sql.php", "tbl_gis_visualization.php": "sql.php" }; if ($selflink_replace[source]) { var replacement = $selflink_replace[source]; data._selflink = data._selflink.replace(source, replacement); } $('#selflink').find('> a').attr('href', data._selflink); } if (data._params) { PMA_commonParams.setAll(data._params); } if (data._scripts) { AJAX.scriptHandler.load(data._scripts); } if (data._selflink && data._scripts && data._menuHash && data._params) { if (! (history && history.pushState)) { PMA_MicroHistory.add( data._selflink, data._scripts, data._menuHash, data._params, AJAX.source.attr('rel') ); } } if (data._displayMessage) { $('#page_content').prepend(data._displayMessage); PMA_highlightSQL($('#page_content')); } $('#pma_errors').remove(); var msg = ''; if(data._errSubmitMsg){ msg = data._errSubmitMsg; } if (data._errors) { $('
', {id : 'pma_errors', class : 'clearfloat'}) .insertAfter('#selflink') .append(data._errors); // bind for php error reporting forms (bottom) $("#pma_ignore_errors_bottom").bind("click", function(e) { e.preventDefault(); PMA_ignorePhpErrors(); }); $("#pma_ignore_all_errors_bottom").bind("click", function(e) { e.preventDefault(); PMA_ignorePhpErrors(false); }); // In case of 'sendErrorReport'='always' // submit the hidden error reporting form. if (data._sendErrorAlways == '1' && data._stopErrorReportLoop != '1' ) { $("#pma_report_errors_form").submit(); PMA_ajaxShowMessage(PMA_messages.phpErrorsBeingSubmitted, false); $('html, body').animate({scrollTop:$(document).height()}, 'slow'); } else if (data._promptPhpErrors) { // otherwise just prompt user if it is set so. msg = msg + PMA_messages.phpErrorsFound; // scroll to bottom where all the errors are displayed. $('html, body').animate({scrollTop:$(document).height()}, 'slow'); } } PMA_ajaxShowMessage(msg, false); // bind for php error reporting forms (popup) $("#pma_ignore_errors_popup").bind("click", function() { PMA_ignorePhpErrors(); }); $("#pma_ignore_all_errors_popup").bind("click", function() { PMA_ignorePhpErrors(false); }); if (typeof AJAX._callback === 'function') { AJAX._callback.call(); } AJAX._callback = function () {}; }); } else { PMA_ajaxShowMessage(data.error, false); AJAX.active = false; AJAX.xhr = null; PMA_handleRedirectAndReload(data); if (data.fieldWithError) { $(':input.error').removeClass("error"); $('#'+data.fieldWithError).addClass("error"); } } }, /** * This object is in charge of downloading scripts, * keeping track of what's downloaded and firing * the onload event for them when the page is ready. */ scriptHandler: { /** * @var array _scripts The list of files already downloaded */ _scripts: [], /** * @var string _scriptsVersion version of phpMyAdmin from which the * scripts have been loaded */ _scriptsVersion: null, /** * @var array _scriptsToBeLoaded The list of files that * need to be downloaded */ _scriptsToBeLoaded: [], /** * @var array _scriptsToBeFired The list of files for which * to fire the onload event */ _scriptsToBeFired: [], /** * Records that a file has been downloaded * * @param string file The filename * @param string fire Whether this file will be registering * onload/teardown events * * @return self For chaining */ add: function (file, fire) { this._scripts.push(file); if (fire) { // Record whether to fire any events for the file // This is necessary to correctly tear down the initial page this._scriptsToBeFired.push(file); } return this; }, /** * Download a list of js files in one request * * @param array files An array of filenames and flags * * @return void */ load: function (files, callback) { var self = this; // Clear loaded scripts if they are from another version of phpMyAdmin. // Depends on common params being set before loading scripts in responseHandler if (self._scriptsVersion === null) { self._scriptsVersion = PMA_commonParams.get('PMA_VERSION'); } else if (self._scriptsVersion != PMA_commonParams.get('PMA_VERSION')) { self._scripts = []; self._scriptsVersion = PMA_commonParams.get('PMA_VERSION'); } self._scriptsToBeLoaded = []; self._scriptsToBeFired = []; for (var i in files) { self._scriptsToBeLoaded.push(files[i].name); if (files[i].fire) { self._scriptsToBeFired.push(files[i].name); } } // Generate a request string var request = []; var needRequest = false; for (var index in self._scriptsToBeLoaded) { var script = self._scriptsToBeLoaded[index]; // Only for scripts that we don't already have if ($.inArray(script, self._scripts) == -1) { needRequest = true; this.add(script); request.push("scripts%5B%5D=" + script); } } request.push("call_done=1"); request.push("v=" + encodeURIComponent(PMA_commonParams.get('PMA_VERSION'))); // Download the composite js file, if necessary if (needRequest) { this.appendScript("js/get_scripts.js.php?" + request.join("&")); } else { self.done(callback); } }, /** * Called whenever all files are loaded * * @return void */ done: function (callback) { if($.isFunction(callback)) { callback(); } if (typeof ErrorReport !== 'undefined') { ErrorReport.wrap_global_functions(); } for (var i in this._scriptsToBeFired) { AJAX.fireOnload(this._scriptsToBeFired[i]); } AJAX.active = false; }, /** * Appends a script element to the head to load the scripts * * @return void */ appendScript: function (url) { var head = document.head || document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = url; script.async = false; head.appendChild(script); }, /** * Fires all the teardown event handlers for the current page * and rebinds all forms and links to the request handler * * @param function callback The callback to call after resetting * * @return void */ reset: function (callback) { for (var i in this._scriptsToBeFired) { AJAX.fireTeardown(this._scriptsToBeFired[i]); } this._scriptsToBeFired = []; /** * Re-attach a generic event handler to clicks * on pages and submissions of forms */ $(document).off('click', 'a').on('click', 'a', AJAX.requestHandler); $(document).off('submit', 'form').on('submit', 'form', AJAX.requestHandler); if (! (history && history.pushState)) { PMA_MicroHistory.update(); } callback(); } } }; /** * Here we register a function that will remove the onsubmit event from all * forms that will be handled by the generic page loader. We then save this * event handler in the "jQuery data", so that we can fire it up later in * AJAX.requestHandler(). * * See bug #3583316 */ AJAX.registerOnload('functions.js', function () { // Registering the onload event for functions.js // ensures that it will be fired for all pages $('form').not('.ajax').not('.disableAjax').each(function () { if ($(this).attr('onsubmit')) { $(this).data('onsubmit', this.onsubmit).attr('onsubmit', ''); } }); var $page_content = $('#page_content'); /** * Workaround for passing submit button name,value on ajax form submit * by appending hidden element with submit button name and value. */ $page_content.on('click', 'form input[type=submit]', function() { var buttonName = $(this).attr('name'); if (typeof buttonName === 'undefined') { return; } $(this).closest('form').append($('', { 'type' : 'hidden', 'name' : buttonName, 'value': $(this).val() })); }); /** * Attach event listener to events when user modify visible * Input,Textarea and select fields to make changes in forms */ $page_content.on( 'keyup change', 'form.lock-page textarea, ' + 'form.lock-page input[type="text"], ' + 'form.lock-page input[type="number"], ' + 'form.lock-page select', {value:1}, AJAX.lockPageHandler ); $page_content.on( 'change', 'form.lock-page input[type="checkbox"], ' + 'form.lock-page input[type="radio"]', {value:2}, AJAX.lockPageHandler ); /** * Reset lock when lock-page form reset event is fired * Note: reset does not bubble in all browser so attach to * form directly. */ $('form.lock-page').on('reset', function(event){ AJAX.resetLock(); }); }); /** * Page load event handler */ $(function () { var menuContent = $('
') .append($('#serverinfo').clone()) .append($('#topmenucontainer').clone()) .html(); if (history && history.pushState) { //set initial state reload var initState = ('state' in window.history && window.history.state !== null); var initURL = $('#selflink').find('> a').attr('href') || location.href; var state = { url : initURL, menu : menuContent }; history.replaceState(state, null); $(window).on('popstate', function(event) { var initPop = (! initState && location.href == initURL); initState = true; //check if popstate fired on first page itself if (initPop) { return; } var state = event.originalEvent.state; if (state && state.menu) { AJAX.$msgbox = PMA_ajaxShowMessage(); var params = 'ajax_request=true&ajax_page_request=true'; var url = state.url || location.href; $.get(url, params, AJAX.responseHandler); //TODO: Check if sometimes menu is not retrieved from server, // Not sure but it seems menu was missing only for printview which // been removed lately, so if it's right some dead menu checks/fallbacks // may need to be removed from this file and Header.php //AJAX.handleMenu.replace(event.originalEvent.state.menu); } }); } else { // Fallback to microhistory mechanism AJAX.scriptHandler .load([{'name' : 'microhistory.js', 'fire' : 1}], function () { // The cache primer is set by the footer class if (PMA_MicroHistory.primer.url) { PMA_MicroHistory.menus.add( PMA_MicroHistory.primer.menuHash, menuContent ); } $(function () { // Queue up this event twice to make sure that we get a copy // of the page after all other onload events have been fired if (PMA_MicroHistory.primer.url) { PMA_MicroHistory.add( PMA_MicroHistory.primer.url, PMA_MicroHistory.primer.scripts, PMA_MicroHistory.primer.menuHash ); } }); }); } }); /** * Attach a generic event handler to clicks * on pages and submissions of forms */ $(document).on('click', 'a', AJAX.requestHandler); $(document).on('submit', 'form', AJAX.requestHandler); /** * Gracefully handle fatal server errors * (e.g: 500 - Internal server error) */ $(document).ajaxError(function (event, request, settings) { if (request.status !== 0) { // Don't handle aborted requests var errorCode = PMA_sprintf(PMA_messages.strErrorCode, request.status); var errorText = PMA_sprintf(PMA_messages.strErrorText, request.statusText); PMA_ajaxShowMessage( '
' + PMA_messages.strErrorProcessingRequest + '
' + escapeHtml(errorCode) + '
' + '
' + escapeHtml(errorText) + '
' + '
', false ); AJAX.active = false; } });