File "js-852c3185.js.transient"

Full Path: /var/www/html/wordpress/wp-content/cache/wpo-minify/tmp/js-852c3185.js.transient
File size: 11.64 KB
MIME-type: application/json
Charset: utf-8

 
Open Back
{"request":{"hurl":"https:\/\/bsd-devlabs.one\/wp-content\/plugins\/gutentools\/assets\/vendors\/news-ticker-controls-acme\/js\/acmeticker.min.js","inline":"","enable_minification":false,"type":"js","handle":"jquery-ticker","version":"null"},"log":{"url":"\/wp-content\/plugins\/gutentools\/assets\/vendors\/news-ticker-controls-acme\/js\/acmeticker.min.js","success":true},"code":"(function ($) {\n\t'use strict';\n\t$.fn.AcmeTicker = function (options) {\n\t\t\/*Merge options and default options*\/\n\t\tlet opts = $.extend({}, $.fn.AcmeTicker.defaults, options);\n\n\t\t\/*Functions Scope*\/\n\t\tlet thisTicker = $(this), intervalID, timeoutID, isPause = false;\n\n\t\t\/*Always wrap, used in many place*\/\n\t\tthisTicker.wrap(\"<div class='gutentools-ticker-wrap'><\/div>\");\n\n\t\t\/*Wrap is always relative*\/\n\t\tthisTicker.parent().css({\n\t\t\tposition: 'relative'\n\t\t})\n\t\t\/*Hide expect first*\/\n\t\tthisTicker.children(\"li\").not(\":first\").hide();\n\n\t\t\/*Lets init*\/\n\t\tinit();\n\t\tfunction init() {\n\t\t\tswitch (opts.type) {\n\t\t\t\tcase 'vertical':\n\t\t\t\tcase 'horizontal':\n\t\t\t\t\tvertiZontal()\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'marquee':\n\t\t\t\t\tmarQuee()\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'typewriter':\n\t\t\t\t\ttypeWriter()\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t\/*Vertical - horizontal\n\t\t* **Do not change code lines*\/\n\t\tfunction vertiZontal(prevNext = false) {\n\t\t\tlet speed = opts.speed,\n\t\t\t\tautoplay = opts.autoplay,\n\t\t\t\tdirection = opts.direction;\n\n\t\t\tif (prevNext) {\n\t\t\t\tspeed = 0;\n\t\t\t\tautoplay = 0;\n\t\t\t\tclearInterval(intervalID);\n\t\t\t\tintervalID = false;\n\t\t\t}\n\n\t\t\tfunction play() {\n\t\t\t\tif (isPause) {\n\t\t\t\t\tclearInterval(intervalID);\n\t\t\t\t\tintervalID = false;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tlet dChild,\n\t\t\t\t\teqType,\n\t\t\t\t\tmType,\n\t\t\t\t\tmVal;\n\n\t\t\t\tdChild = thisTicker.find('li:first');\n\t\t\t\tif (direction === 'up' || direction === 'right') {\n\t\t\t\t\teqType = '-=';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\teqType = '+=';\n\t\t\t\t}\n\t\t\t\tif (opts.type === 'horizontal') {\n\t\t\t\t\tmType = 'left';\n\t\t\t\t\tmVal = dChild.outerWidth(true);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmType = 'margin-top';\n\t\t\t\t\tmVal = dChild.outerHeight(true);\n\t\t\t\t}\n\t\t\t\tif (prevNext === 'prev') {\n\t\t\t\t\tthisTicker.find('li:last').detach().prependTo(thisTicker);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdChild.detach().appendTo(thisTicker);\n\t\t\t\t}\n\n\t\t\t\tthisTicker.find('li').css({\n\t\t\t\t\topacity: '0',\n\t\t\t\t\tdisplay: 'none'\n\t\t\t\t});\n\t\t\t\tthisTicker.find('li:first').css({\n\t\t\t\t\topacity: '1',\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\t[mType]: eqType + mVal + 'px',\n\t\t\t\t});\n\t\t\t\tthisTicker.find('li:first').animate(\n\t\t\t\t\t{ [mType]: '0px' },\n\t\t\t\t\tspeed,\n\t\t\t\t\tfunction () {\n\t\t\t\t\t\tclearInterval(intervalID);\n\t\t\t\t\t\tintervalID = false;\n\t\t\t\t\t\tvertiZontal();\n\t\t\t\t\t});\n\t\t\t}\n\t\t\tif (intervalID) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tintervalID = setInterval(play, autoplay);\n\t\t}\n\n\t\t\/*Type-Writer\n\t\t* **Do not change code lines*\/\n\t\tfunction typeWriter(prevNext = false) {\n\t\t\tif (isPause) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (prevNext) {\n\t\t\t\tclearInterval(intervalID);\n\t\t\t\tintervalID = false;\n\n\t\t\t\tclearTimeout(timeoutID);\n\t\t\t\ttimeoutID = false;\n\n\t\t\t\tif (prevNext === 'prev') {\n\t\t\t\t\tthisTicker.find('li:last').detach().prependTo(thisTicker);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthisTicker.find('li:first').detach().appendTo(thisTicker);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet speed = opts.speed,\n\t\t\t\tautoplay = opts.autoplay,\n\t\t\t\ttypeEl = thisTicker.find('li:first'),\n\t\t\t\twrapEl = typeEl.children(),\n\t\t\t\tcount = 0;\n\n\t\t\tif (typeEl.attr('data-text')) {\n\t\t\t\twrapEl.text(typeEl.attr('data-text'))\n\t\t\t}\n\n\t\t\tlet allText = typeEl.text();\n\n\t\t\tthisTicker.find('li').css({\n\t\t\t\topacity: '0',\n\t\t\t\tdisplay: 'none'\n\t\t\t});\n\n\t\t\tfunction tNext() {\n\t\t\t\tthisTicker.find('li:first').detach().appendTo(thisTicker);\n\n\t\t\t\tclearTimeout(timeoutID);\n\t\t\t\ttimeoutID = false;\n\n\t\t\t\ttypeWriter();\n\t\t\t}\n\n\t\t\tfunction type() {\n\t\t\t\tcount++;\n\t\t\t\tlet typeText = allText.substring(0, count);\n\t\t\t\tif (!typeEl.attr('data-text')) {\n\t\t\t\t\ttypeEl.attr('data-text', allText);\n\t\t\t\t}\n\n\t\t\t\tif (count <= allText.length) {\n\t\t\t\t\twrapEl.text(typeText);\n\t\t\t\t\ttypeEl.css({\n\t\t\t\t\t\topacity: '1',\n\t\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tclearInterval(intervalID);\n\t\t\t\t\tintervalID = false;\n\t\t\t\t\ttimeoutID = setTimeout(tNext, autoplay);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!intervalID) {\n\t\t\t\tintervalID = setInterval(type, speed);\n\t\t\t}\n\t\t}\n\n\t\t\/*marQuee\n\t\t\n\t\t\/*marQuee - Improved with content duplication for seamless loop*\/\n\t\tfunction marQuee() {\n\t\t    \/*Marquee Special*\/\n\t\t    let speed = opts.speed,\n\t\t        direction = opts.direction,\n\t\t        wrapWidth,\n\t\t        dir = 'left',\n\t\t        listWidth = 0,\n\t\t        mPause = false;\n\n\t\t    mInit();\n\t\t    function mInit() {\n\t\t        \/\/ Duplicate content for seamless looping\n\t\t        thisTicker.parent().addClass('continuous-scroll');\n\t\t        let originalItems = thisTicker.find('li').clone();\n\t\t        thisTicker.append(originalItems);\n\t\t        \n\t\t        thisTicker.css({\n\t\t            position: 'absolute',\n\t\t            whiteSpace: 'nowrap'\n\t\t        });\n\t\t        thisTicker.find('li').css({\n\t\t            display: 'inline-block',\n\t\t            marginRight: '10px',\n\t\t        });\n\t\t        \n\t\t        let tickerList = thisTicker.find(\"li\");\n\t\t        wrapWidth = thisTicker.parent().outerWidth(true);\n\n\t\t        if (direction === 'right') {\n\t\t            dir = 'right'\n\t\t        }\n\n\t\t        \/*Calculating ticker width*\/\n\t\t        \/\/ thisTicker.width(10000);\n\t\t        \/\/ tickerList.each(function() {\n\t\t        \/\/     listWidth += $(this).outerWidth(true) + 5;\n\t\t        \/\/ });\n\t\t        \/*FIX: Calculate actual width dynamically*\/\n\t\t        \/\/ First, set to auto to get natural width\n\t\t        thisTicker.css('width', 'auto');\n\t\t        \n\t\t        \/\/ Calculate total width of all list items\n\t\t        tickerList.each(function () {\n\t\t            listWidth += $(this).outerWidth(true);\n\t\t        });\n\t\t        \n\t\t        \/\/ Add some extra padding for smooth looping\n\t\t        let extraPadding = wrapWidth; \/\/ Add container width as padding\n\t\t        let totalWidth = listWidth + extraPadding;\n\t\t        thisTicker.width(listWidth);\n\n\t\t        \/\/ Start position - show first set of items\n\t\t        if (direction === 'right') {\n\t\t            thisTicker.css('right', '0px');\n\t\t        } else {\n\t\t            thisTicker.css('left', '0px');\n\t\t        }\n\t\t        \n\t\t        marQueeContinuous();\n\t\t    }\n\n\t\t    function marQueeContinuous() {\n\t\t        if (mPause) return;\n\t\t        \n\t\t        let animationDistance = listWidth \/ 2; \/\/ Since we duplicated, we only need to move half the distance\n\t\t        let animationTime = animationDistance \/ speed;\n\t\t        \n\t\t        thisTicker.animate(\n\t\t            { [dir]: '-=' + animationDistance + 'px' },\n\t\t            animationTime,\n\t\t            \"linear\",\n\t\t            function() {\n\t\t                \/\/ Reset position and restart immediately\n\t\t                if (direction === 'right') {\n\t\t                    thisTicker.css('right', '0px');\n\t\t                } else {\n\t\t                    thisTicker.css('left', '0px');\n\t\t                }\n\t\t                marQueeContinuous();\n\t\t            }\n\t\t        );\n\t\t    }\n\n\t\t    function mRestart(){\n\t\t        if (mPause) return;\n\t\t        thisTicker.stop();\n\t\t        \/\/ Reset position\n\t\t        if (direction === 'right') {\n\t\t            thisTicker.css('right', '0px');\n\t\t        } else {\n\t\t            thisTicker.css('left', '0px');\n\t\t        }\n\t\t        marQueeContinuous();\n\t\t    }\n\n\t\t    function mToggle() {\n\t\t        mPause = !mPause;\n\t\t        $(document).trigger('acmeTickerToggle', thisTicker, mPause)\n\t\t        if (mPause) {\n\t\t            thisTicker.stop();\n\t\t        }\n\t\t        else {\n\t\t            marQueeContinuous();\n\t\t        }\n\t\t    }\n\n\t\t    opts.controls.toggle && opts.controls.toggle.on('click', function (e) {\n\t\t        mToggle();\n\t\t    });\n\t\t    if (opts.pauseOnHover) {\n\t\t        thisTicker.on('mouseenter', function () {\n\t\t            thisTicker.stop();\n\t\t        }).on('mouseleave', function () {\n\t\t            if (!mPause) {\n\t\t                marQueeContinuous();\n\t\t            }\n\t\t        });\n\t\t    }\n\t\t    if (opts.pauseOnFocus) {\n\t\t        thisTicker.on('focusin', function () {\n\t\t            thisTicker.stop();\n\t\t        }).on('focusout', function () {\n\t\t            if (!mPause) {\n\t\t                marQueeContinuous();\n\t\t            }\n\t\t        });\n\t\t    }\n\t\t}\n\n\t\t\/*Actions\/Controls*\/\n\t\tif (opts.type !== 'marquee') {\n\t\t\topts.controls.prev && opts.controls.prev.on('click', function (e) {\n\t\t\t\te.preventDefault();\n\t\t\t\tswitch (opts.type) {\n\t\t\t\t\tcase 'typewriter':\n\t\t\t\t\t\ttypeWriter('prev')\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tvertiZontal('prev')\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t});\n\t\t\topts.controls.next && opts.controls.next.on('click', function (e) {\n\t\t\t\te.preventDefault();\n\t\t\t\tswitch (opts.type) {\n\t\t\t\t\tcase 'typewriter':\n\t\t\t\t\t\ttypeWriter('next')\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tvertiZontal('next')\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t});\n\t\t\tfunction restart() {\n\t\t\t\tif (!isPause) {\n\t\t\t\t\tinit();\n\t\t\t\t}\n\t\t\t}\n\t\t\topts.controls.toggle && opts.controls.toggle.on('click', function (e) {\n\t\t\t\te.preventDefault();\n\t\t\t\tisPause = !isPause;\n\t\t\t\t$(document).trigger('acmeTickerToggle', thisTicker, isPause)\n\t\t\t\trestart();\n\t\t\t});\n\t\t\tif (opts.pauseOnHover) {\n\t\t\t\tthisTicker.on('mouseenter', function () {\n\t\t\t\t\tisPause = true;\n\t\t\t\t\trestart();\n\t\t\t\t}).on('mouseleave', function () {\n\t\t\t\t\tisPause = false;\n\t\t\t\t\trestart();\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (opts.pauseOnFocus) {\n\t\t\t\tthisTicker.on('focusin', function () {\n\t\t\t\t\tisPause = true;\n\t\t\t\t\trestart();\n\t\t\t\t}).on('focusout', function () {\n\t\t\t\t\tisPause = false;\n\t\t\t\t\trestart();\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n\n\t\/\/ plugin defaults - added as a property on our plugin function\n\t$.fn.AcmeTicker.defaults = {\n\t\t\/*Note: Marquee only take speed not autoplay*\/\n\t\ttype: 'horizontal',\/*vertical\/horizontal\/marquee\/typewriter*\/\n\t\tautoplay: 2000,\/*true\/false\/number*\/ \/*For vertical\/horizontal 4000*\/\/*For typewriter 2000*\/\n\t\tspeed: 50,\/*true\/false\/number*\/ \/*For vertical\/horizontal 600*\/\/*For marquee 0.05*\/\/*For typewriter 50*\/\n\t\tdirection: 'up',\/*up\/down\/left\/right*\/\/*For vertical up\/down*\/\/*For horizontal\/marquee right\/left*\/\/*For typewriter direction doesnot work*\/\n\t\tpauseOnFocus: true,\n\t\tpauseOnHover: true,\n\t\tcontrols: {\n\t\t\tprev: '',\/*Can be used for vertical\/horizontal\/typewriter*\/\/*not work for marquee*\/\n\t\t\tnext: '',\/*Can be used for vertical\/horizontal\/typewriter*\/\/*not work for marquee*\/\n\t\t\ttoggle: ''\/*Can be used for vertical\/horizontal\/marquee\/typewriter*\/\n\t\t}\n\t};\n})(jQuery);\n","status":true}