mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-17 12:36:11 +00:00
1 line
26 KiB
Plaintext
1 line
26 KiB
Plaintext
{"version":3,"sources":["webpack:///./node_modules/rellax/rellax.js","webpack:///./app/javascript/packs/public.js"],"names":["__WEBPACK_AMD_DEFINE_ARRAY__","undefined","__WEBPACK_AMD_DEFINE_RESULT__","__WEBPACK_AMD_DEFINE_FACTORY__","Rellax","el","options","self","Object","create","prototype","posY","screenY","posX","screenX","blocks","pause","loop","window","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","msRequestAnimationFrame","oRequestAnimationFrame","callback","setTimeout","transformProp","testEl","document","createElement","style","transform","vendors","vendor","speed","center","wrapper","round","vertical","horizontal","keys","forEach","key","elements","querySelectorAll","length","Error","elems","nodeType","querySelector","init","i","cssText","innerHeight","innerWidth","setPosition","block","createBlock","push","cacheBlocks","addEventListener","animate","dataPercentage","getAttribute","dataSpeed","dataZindex","wrapperPosY","scrollTop","pageYOffset","documentElement","body","pageXOffset","scrollLeft","blockTop","getBoundingClientRect","top","blockHeight","clientHeight","offsetHeight","scrollHeight","blockLeft","left","blockWidth","clientWidth","offsetWidth","scrollWidth","percentageY","percentageX","bases","updatePosition","indexOf","index","trimmedStyle","slice","delimiter","replace","baseX","x","baseY","y","height","width","zindex","oldY","oldX","parentNode","result","valueX","valueY","Math","update","positions","positionY","positionX","translate","destroy","removeEventListener","refresh","apply","exports","module","_mastodon_common__WEBPACK_IMPORTED_MODULE_3__","e","data","parent","type","_mastodon_ready__WEBPACK_IMPORTED_MODULE_2__","postMessage","id","getElementsByTagName","_mastodon_load_polyfills__WEBPACK_IMPORTED_MODULE_1__","then","__webpack_require__","IntlMessageFormat","default","timeAgoString","delegate","emojify","messages","getLocale","ReactDOM","createHistory","createBrowserHistory","locale","lang","dateTimeFormat","Intl","DateTimeFormat","year","month","day","hour","minute","call","content","innerHTML","datetime","Date","formattedDate","format","title","textContent","now","formatMessage","_ref","values","defaultMessage","formatDate","date","getFullYear","reactComponents","bind","_ref2","MediaContainer","render","babel_runtime_helpers_jsx__WEBPACK_IMPORTED_MODULE_0___default","components","appendChild","catch","error","console","history","detailedStatuses","location","state","scrolledToDetailedStatus","scrollIntoView","pathname","assign","_ref3","target","button","href","_ref4","contentEl","display","marginBottom","preventDefault","nodeName","open","_ref5","nameCounter","name","value","_ref6","noteCounter","_ref7","avatar","file","files","url","URL","createObjectURL","dataset","originalSrc","src","_ref9","header","_ref11","lock","checked"],"mappings":"wFAcIA,UAAAC,KAAAC,EAAA,mBAAAC,EAUI,WACN,IAAIC,EAAS,SAASC,EAAIC,GACxB,aAEA,IAAIC,EAAOC,OAAOC,OAAOL,EAAOM,WAE5BC,EAAO,EACPC,EAAU,EACVC,EAAO,EACPC,EAAU,EACVC,KACAC,GAAQ,EAIRC,EAAOC,OAAOC,uBAChBD,OAAOE,6BACPF,OAAOG,0BACPH,OAAOI,yBACPJ,OAAOK,wBACP,SAASC,GAAWC,WAAWD,EAAU,IAAO,KAG9CE,EAAgBR,OAAOQ,eAAkB,WACzC,IAAIC,EAASC,SAASC,cAAc,OACpC,GAA+B,OAA3BF,EAAOG,MAAMC,UAAoB,CACnC,IAAIC,GAAW,SAAU,MAAO,MAChC,IAAK,IAAIC,KAAUD,EACjB,QAAsD/B,IAAlD0B,EAAOG,MAAOE,EAAQC,GAAU,aAClC,OAAOD,EAAQC,GAAU,YAI/B,MAAO,YAVkC,GAc7C1B,EAAKD,SACH4B,OAAQ,EACRC,QAAQ,EACRC,QAAS,KACTC,OAAO,EACPC,UAAU,EACVC,YAAY,EACZf,SAAU,cAIRlB,GACFE,OAAOgC,KAAKlC,GAASmC,QAAQ,SAASC,GACpCnC,EAAKD,QAAQoC,GAAOpC,EAAQoC,KAK3BrC,IACHA,EAAK,WAIP,IAAIsC,EAAyB,iBAAPtC,EAAkBuB,SAASgB,iBAAiBvC,IAAOA,GAGzE,KAAIsC,EAASE,OAAS,GAMpB,MAAM,IAAIC,MAAM,q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,GAAQD,EAAOM,QAAQC,YAE9DP,EAAOQ,IAAML,IAGf1E,EAAS5G,SAAU,kBAAmB,SAAU,SAAA4L,GAAgB,IAAb1B,EAAa0B,EAAb1B,OAC3C2B,EAAS7L,SAASqB,cAAc,wBAC/B+J,GAAQlB,EAAOmB,WAFwC,GAGxDC,EAAMF,EAAOG,IAAIC,gBAAgBJ,GAAQS,EAAOJ,QAAQC,YAE9DG,EAAOF,IAAML,IAGf1E,EAAS5G,SAAU,kBAAmB,SAAU,SAAA8L,GAAgB,IAAb5B,EAAa4B,EAAb5B,OAC3C6B,EAAO/L,SAASqB,cAAc,yBAEhC6I,EAAO8B,QACTD,EAAK7L,MAAMqK,QAAU,SAErBwB,EAAK7L,MAAMqK,QAAU,WAKAjB,MAAM,SAAAC,GAC/BC,QAAQD,MAAMA","file":"public.js","sourcesContent":["\n// ------------------------------------------\n// Rellax.js\n// Buttery smooth parallax library\n// Copyright (c) 2016 Moe Amaya (@moeamaya)\n// MIT license\n//\n// Thanks to Paraxify.js and Jaime Cabllero\n// for parallax concepts\n// ------------------------------------------\n\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define([], factory);\n } else if (typeof module === 'object' && module.exports) {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory();\n } else {\n // Browser globals (root is window)\n root.Rellax = factory();\n }\n}(this, function () {\n var Rellax = function(el, options){\n \"use strict\";\n\n var self = Object.create(Rellax.prototype);\n\n var posY = 0;\n var screenY = 0;\n var posX = 0;\n var screenX = 0;\n var blocks = [];\n var pause = true;\n\n // check what requestAnimationFrame to use, and if\n // it's not supported, use the onscroll event\n var loop = window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n window.oRequestAnimationFrame ||\n function(callback){ setTimeout(callback, 1000 / 60); };\n\n // check which transform property to use\n var transformProp = window.transformProp || (function(){\n var testEl = document.createElement('div');\n if (testEl.style.transform === null) {\n var vendors = ['Webkit', 'Moz', 'ms'];\n for (var vendor in vendors) {\n if (testEl.style[ vendors[vendor] + 'Transform' ] !== undefined) {\n return vendors[vendor] + 'Transform';\n }\n }\n }\n return 'transform';\n })();\n\n // Default Settings\n self.options = {\n speed: -2,\n center: false,\n wrapper: null,\n round: true,\n vertical: true,\n horizontal: false,\n callback: function() {},\n };\n\n // User defined options (might have more in the future)\n if (options){\n Object.keys(options).forEach(function(key){\n self.options[key] = options[key];\n });\n }\n\n // By default, rellax class\n if (!el) {\n el = '.rellax';\n }\n\n // check if el is a className or a node\n var elements = typeof el === 'string' ? document.querySelectorAll(el) : [el];\n\n // Now query selector\n if (elements.length > 0) {\n self.elems = elements;\n }\n\n // The elements don't exist\n else {\n throw new Error(\"The elements you're trying to select don't exist.\");\n }\n\n // Has a wrapper and it exists\n if (self.options.wrapper) {\n if (!self.options.wrapper.nodeType) {\n var wrapper = document.querySelector(self.options.wrapper);\n\n if (wrapper) {\n self.options.wrapper = wrapper;\n } else {\n throw new Error(\"The wrapper you're trying to use don't exist.\");\n }\n }\n }\n\n\n // Get and cache initial position of all elements\n var cacheBlocks = function() {\n for (var i = 0; i < self.elems.length; i++){\n var block = createBlock(self.elems[i]);\n blocks.push(block);\n }\n };\n\n\n // Let's kick this script off\n // Build array for cached element values\n var init = function() {\n for (var i = 0; i < blocks.length; i++){\n self.elems[i].style.cssText = blocks[i].style;\n }\n\n blocks = [];\n\n screenY = window.innerHeight;\n screenX = window.innerWidth;\n setPosition();\n\n cacheBlocks();\n\n // If paused, unpause and set listener for window resizing events\n if (pause) {\n window.addEventListener('resize', init);\n pause = false;\n }\n animate();\n };\n\n // We want to cache the parallax blocks'\n // values: base, top, height, speed\n // el: is dom object, return: el cache values\n var createBlock = function(el) {\n var dataPercentage = el.getAttribute( 'data-rellax-percentage' );\n var dataSpeed = el.getAttribute( 'data-rellax-speed' );\n var dataZindex = el.getAttribute( 'data-rellax-zindex' ) || 0;\n\n // initializing at scrollY = 0 (top of browser), scrollX = 0 (left of browser)\n // ensures elements are positioned based on HTML layout.\n //\n // If the element has the percentage attribute, the posY and posX needs to be\n // the current scroll position's value, so that the elements are still positioned based on HTML layout\n var wrapperPosY = self.options.wrapper ? self.options.wrapper.scrollTop : (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop);\n var posY = self.options.vertical ? ( dataPercentage || self.options.center ? wrapperPosY : 0 ) : 0;\n var posX = self.options.horizontal ? ( dataPercentage || self.options.center ? (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft) : 0 ) : 0;\n\n var blockTop = posY + el.getBoundingClientRect().top;\n var blockHeight = el.clientHeight || el.offsetHeight || el.scrollHeight;\n\n var blockLeft = posX + el.getBoundingClientRect().left;\n var blockWidth = el.clientWidth || el.offsetWidth || el.scrollWidth;\n\n // apparently parallax equation everyone uses\n var percentageY = dataPercentage ? dataPercentage : (posY - blockTop + screenY) / (blockHeight + screenY);\n var percentageX = dataPercentage ? dataPercentage : (posX - blockLeft + screenX) / (blockWidth + screenX);\n if(self.options.center){ percentageX = 0.5; percentageY = 0.5; }\n\n // Optional individual block speed as data attr, otherwise global speed\n var speed = dataSpeed ? dataSpeed : self.options.speed;\n\n var bases = updatePosition(percentageX, percentageY, speed);\n\n // ~~Store non-translate3d transforms~~\n // Store inline styles and extract transforms\n var style = el.style.cssText;\n var transform = '';\n\n // Check if there's an inline styled transform\n if (style.indexOf('transform') >= 0) {\n // Get the index of the transform\n var index = style.indexOf('transform');\n\n // Trim the style to the transform point and get the following semi-colon index\n var trimmedStyle = style.slice(index);\n var delimiter = trimmedStyle.indexOf(';');\n\n // Remove \"transform\" string and save the attribute\n if (delimiter) {\n transform = \" \" + trimmedStyle.slice(11, delimiter).replace(/\\s/g,'');\n } else {\n transform = \" \" + trimmedStyle.slice(11).replace(/\\s/g,'');\n }\n }\n\n return {\n baseX: bases.x,\n baseY: bases.y,\n top: blockTop,\n left: blockLeft,\n height: blockHeight,\n width: blockWidth,\n speed: speed,\n style: style,\n transform: transform,\n zindex: dataZindex\n };\n };\n\n // set scroll position (posY, posX)\n // side effect method is not ideal, but okay for now\n // returns true if the scroll changed, false if nothing happened\n var setPosition = function() {\n var oldY = posY;\n var oldX = posX;\n\n posY = self.options.wrapper ? self.options.wrapper.scrollTop : (document.documentElement || document.body.parentNode || document.body).scrollTop || window.pageYOffset;\n posX = self.options.wrapper ? self.options.wrapper.scrollLeft : (document.documentElement || document.body.parentNode || document.body).scrollLeft || window.pageXOffset;\n\n\n if (oldY != posY && self.options.vertical) {\n // scroll changed, return true\n return true;\n }\n\n if (oldX != posX && self.options.horizontal) {\n // scroll changed, return true\n return true;\n }\n\n // scroll did not change\n return false;\n };\n\n // Ahh a pure function, gets new transform value\n // based on scrollPosition and speed\n // Allow for decimal pixel values\n var updatePosition = function(percentageX, percentageY, speed) {\n var result = {};\n var valueX = (speed * (100 * (1 - percentageX)));\n var valueY = (speed * (100 * (1 - percentageY)));\n\n result.x = self.options.round ? Math.round(valueX) : Math.round(valueX * 100) / 100;\n result.y = self.options.round ? Math.round(valueY) : Math.round(valueY * 100) / 100;\n\n return result;\n };\n\n // Loop\n var update = function() {\n if (setPosition() && pause === false) {\n animate();\n }\n\n // loop again\n loop(update);\n };\n\n // Transform3d on parallax element\n var animate = function() {\n var positions;\n for (var i = 0; i < self.elems.length; i++){\n var percentageY = ((posY - blocks[i].top + screenY) / (blocks[i].height + screenY));\n var percentageX = ((posX - blocks[i].left + screenX) / (blocks[i].width + screenX));\n\n // Subtracting initialize value, so element stays in same spot as HTML\n positions = updatePosition(percentageX, percentageY, blocks[i].speed);// - blocks[i].baseX;\n var positionY = positions.y - blocks[i].baseY;\n var positionX = positions.x - blocks[i].baseX;\n\n var zindex = blocks[i].zindex;\n\n // Move that element\n // (Set the new translation and append initial inline transforms.)\n var translate = 'translate3d(' + (self.options.horizontal ? positionX : '0') + 'px,' + (self.options.vertical ? positionY : '0') + 'px,' + zindex + 'px) ' + blocks[i].transform;\n self.elems[i].style[transformProp] = translate;\n }\n self.options.callback(positions);\n };\n\n self.destroy = function() {\n for (var i = 0; i < self.elems.length; i++){\n self.elems[i].style.cssText = blocks[i].style;\n }\n\n // Remove resize event listener if not pause, and pause\n if (!pause) {\n window.removeEventListener('resize', init);\n pause = true;\n }\n };\n\n // Init\n init();\n\n // Start the loop\n update();\n\n // Allow to recalculate the initial values whenever we want\n self.refresh = init;\n\n return self;\n };\n return Rellax;\n}));\n","import loadPolyfills from '../mastodon/load_polyfills';\nimport ready from '../mastodon/ready';\nimport { start } from '../mastodon/common';\n\nstart();\n\nwindow.addEventListener('message', e => {\n const data = e.data || {};\n\n if (!window.parent || data.type !== 'setHeight') {\n return;\n }\n\n ready(() => {\n window.parent.postMessage({\n type: 'setHeight',\n id: data.id,\n height: document.getElementsByTagName('html')[0].scrollHeight,\n }, '*');\n });\n});\n\nfunction main() {\n const { length } = require('stringz');\n const IntlMessageFormat = require('intl-messageformat').default;\n const { timeAgoString } = require('../mastodon/components/relative_timestamp');\n const { delegate } = require('rails-ujs');\n const emojify = require('../mastodon/features/emoji/emoji').default;\n const { getLocale } = require('../mastodon/locales');\n const { messages } = getLocale();\n const React = require('react');\n const ReactDOM = require('react-dom');\n const Rellax = require('rellax');\n const createHistory = require('history').createBrowserHistory;\n\n ready(() => {\n const locale = document.documentElement.lang;\n\n const dateTimeFormat = new Intl.DateTimeFormat(locale, {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n });\n\n [].forEach.call(document.querySelectorAll('.emojify'), (content) => {\n content.innerHTML = emojify(content.innerHTML);\n });\n\n [].forEach.call(document.querySelectorAll('time.formatted'), (content) => {\n const datetime = new Date(content.getAttribute('datetime'));\n const formattedDate = dateTimeFormat.format(datetime);\n\n content.title = formattedDate;\n content.textContent = formattedDate;\n });\n\n [].forEach.call(document.querySelectorAll('time.time-ago'), (content) => {\n const datetime = new Date(content.getAttribute('datetime'));\n const now = new Date();\n\n content.title = dateTimeFormat.format(datetime);\n content.textContent = timeAgoString({\n formatMessage: ({ id, defaultMessage }, values) => (new IntlMessageFormat(messages[id] || defaultMessage, locale)).format(values),\n formatDate: (date, options) => (new Intl.DateTimeFormat(locale, options)).format(date),\n }, datetime, now, datetime.getFullYear());\n });\n\n const reactComponents = document.querySelectorAll('[data-component]');\n if (reactComponents.length > 0) {\n import(/* webpackChunkName: \"containers/media_container\" */ '../mastodon/containers/media_container')\n .then(({ default: MediaContainer }) => {\n const content = document.createElement('div');\n\n ReactDOM.render(<MediaContainer locale={locale} components={reactComponents} />, content);\n document.body.appendChild(content);\n })\n .catch(error => console.error(error));\n }\n\n const parallaxComponents = document.querySelectorAll('.parallax');\n if (parallaxComponents.length > 0 ) {\n new Rellax('.parallax', { speed: -1 });\n }\n\n const history = createHistory();\n const detailedStatuses = document.querySelectorAll('.public-layout .detailed-status');\n const location = history.location;\n if (detailedStatuses.length === 1 && (!location.state || !location.state.scrolledToDetailedStatus)) {\n detailedStatuses[0].scrollIntoView();\n history.replace(location.pathname, { ...location.state, scrolledToDetailedStatus: true });\n }\n });\n\n delegate(document, '.webapp-btn', 'click', ({ target, button }) => {\n if (button !== 0) {\n return true;\n }\n window.location.href = target.href;\n return false;\n });\n\n delegate(document, '.status__content__spoiler-link', 'click', ({ target }) => {\n const contentEl = target.parentNode.parentNode.querySelector('.e-content');\n\n if (contentEl.style.display === 'block') {\n contentEl.style.display = 'none';\n target.parentNode.style.marginBottom = 0;\n } else {\n contentEl.style.display = 'block';\n target.parentNode.style.marginBottom = null;\n }\n\n return false;\n });\n\n delegate(document, '.modal-button', 'click', e => {\n e.preventDefault();\n\n let href;\n\n if (e.target.nodeName !== 'A') {\n href = e.target.parentNode.href;\n } else {\n href = e.target.href;\n }\n\n window.open(href, 'mastodon-intent', 'width=445,height=600,resizable=no,menubar=no,status=no,scrollbars=yes');\n });\n\n delegate(document, '#account_display_name', 'input', ({ target }) => {\n const nameCounter = document.querySelector('.name-counter');\n const name = document.querySelector('.card .display-name strong');\n\n if (nameCounter) {\n nameCounter.textContent = 30 - length(target.value);\n }\n\n if (name) {\n name.innerHTML = emojify(target.value);\n }\n });\n\n delegate(document, '#account_note', 'input', ({ target }) => {\n const noteCounter = document.querySelector('.note-counter');\n\n if (noteCounter) {\n noteCounter.textContent = 160 - length(target.value);\n }\n });\n\n delegate(document, '#account_avatar', 'change', ({ target }) => {\n const avatar = document.querySelector('.card .avatar img');\n const [file] = target.files || [];\n const url = file ? URL.createObjectURL(file) : avatar.dataset.originalSrc;\n\n avatar.src = url;\n });\n\n delegate(document, '#account_header', 'change', ({ target }) => {\n const header = document.querySelector('.card .card__img img');\n const [file] = target.files || [];\n const url = file ? URL.createObjectURL(file) : header.dataset.originalSrc;\n\n header.src = url;\n });\n\n delegate(document, '#account_locked', 'change', ({ target }) => {\n const lock = document.querySelector('.card .display-name i');\n\n if (target.checked) {\n lock.style.display = 'inline';\n } else {\n lock.style.display = 'none';\n }\n });\n}\n\nloadPolyfills().then(main).catch(error => {\n console.error(error);\n});\n"],"sourceRoot":""} |