diff --git a/CHANGELOG.md b/CHANGELOG.md index a6232b332..4db746208 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,23 @@ +## 4chan XT changelog + +4chan XT uses a different user script namespace, so to migrate you need to export settings from 4chan X, and import them +in XT. + +### XT v2.0.0 + +#### 2023-04-30 + +This is the first XT release, which means this is after the migration from coffeescript to typescript, but there are +some other changes as well. These changes aren't in the upstream PR. + +- Optimized image filters: filters are in a Map with the hash as key, instead of iterating over all image filters +- I removed font awesome to make the script smaller, and used unicode icons instead. This might break some user scripts + build in 4chan X that rely on them, and I only tested on windows. +- For even smaller user script size, there is a minified version available +- https://github.com/ccd0/4chan-x/pull/3352, fix for https://github.com/ccd0/4chan-x/issues/3349 was ported + +## Original 4chan X changelog + **Note**: Installing the script from one of the links below will disable automatic updates. If you want automatic updates, install the script from the links on the [main page](https://www.4chan-x.net/). -Sometimes the changelog has notes (not comprehensive) acknowledging people's work. This does not mean the changes are their fault, only that their code was used. All changes to the script are chosen by and the fault of the maintainer (ccd0). diff --git a/Makefile b/Makefile deleted file mode 100644 index 01f95ce95..000000000 --- a/Makefile +++ /dev/null @@ -1,336 +0,0 @@ -ifdef ComSpec - BIN := $(subst /,\,node_modules/.bin/) - RMDIR := -rmdir /s /q - RM := -del - CAT = type $(subst /,\,$1) > $(subst /,\,$2) 2>NUL - MKDIR = -mkdir $(subst /,\,$@) - QUOTE = $(patsubst %,"%",$1) -else - BIN := node_modules/.bin/ - RMDIR := rm -rf - RM := rm -rf - CAT = cat $1 > $2 - MKDIR = mkdir -p $@ - QUOTE = $(patsubst %,'%',$1) -endif -CP = $(call CAT,$<,$@) - -npgoals := clean cleanrel cleanweb cleanfull withtests archives $(foreach i,1 2 3 4,bump$(i)) tag tagcommit beta stable web update updatehard -ifneq "$(filter $(npgoals),$(MAKECMDGOALS))" "" -.NOTPARALLEL : -endif - -coffee := $(BIN)coffee -c --no-header -template := node tools/template.js -template_deps := package.json tools/template.js - -# read name meta_name meta_distBranch -$(eval $(shell node tools/pkgvars.js)) - -# must be read in when needed to prevent out-of-date version -version = $(shell node -p "JSON.parse(require('fs').readFileSync('version.json')).version") - -source_directories := \ - globals config css platform classes site \ - Archive Filtering General Images Linkification \ - Menu Miscellaneous Monitoring Posting Quotelinks \ - main - -# remove extension when sorting so X.coffee comes before X.Y.coffee -sort_directory = \ - $(subst !c,.coffee,$(subst !j,.js,$(sort $(subst .coffee,!c,$(subst .js,!j, \ - $(wildcard src/$1/*.coffee src/$1/*.js)))))) - -sources := $(foreach d,$(source_directories),$(call sort_directory,$(d))) - -uses_tests_enabled := \ - src/classes/Post.coffee \ - src/General/Test.coffee \ - src/Linkification/Linkify.coffee \ - src/main/Main.coffee - -imports_src/globals/globals.js := \ - version.json -imports_src/css/CSS.js := \ - node_modules/font-awesome/fonts/fontawesome-webfont.woff -imports_src/Monitoring/Favicon.coffee := \ - src/meta/icon128.png - -imports = \ - $(filter-out %.coffee %.js,$(wildcard $(dir $1)*.*)) \ - $(wildcard $(basename $1)/*.*) \ - $(if $(filter $(uses_tests_enabled),$1),.tests_enabled) \ - $(imports_$1) - -dests_platform = $(addprefix tmp/,$(subst /,-,$(patsubst src/%,%.js,$(subst platform,platform_$2,$1)))) - -dests_of = $(sort $(call dests_platform,$1,crx) $(call dests_platform,$1,userscript)) - -dests := $(foreach s,$(sources),$(call dests_of,$(s))) - -updates := $(subst tmp/,.events/,$(dests)) - -pieces = \ - tmp/LICENSE \ - tmp/meta-newline.js \ - tmp/meta-fbegin.js \ - tmp/meta-newline.js \ - tmp/declaration.js \ - tmp/meta-newline.js \ - $(foreach s,$(sources),$(call dests_platform,$(s),$1)) \ - tmp/meta-fend.js - -crx_contents := script.js eventPage.js icon16.png icon48.png icon128.png manifest.json - -release := \ - $(foreach f, \ - $(foreach c,. -beta.,$(name)$(c)crx updates$(c)xml updates$(c)json $(name)$(c)user.js $(name)$(c)meta.js) \ - $(name)-noupdate.crx \ - $(name)-noupdate.user.js \ - $(name).zip \ - ,builds/$(f)) - -script := $(foreach f,$(filter-out %.crx %.zip,$(release)),test$(f)) $(foreach t,crx crx-beta crx-noupdate,$(foreach f,$(crx_contents),testbuilds/$(t)/$(f))) - -crx := $(foreach f,$(filter %.crx %.zip,$(release)),test$(f)) - -default : script jshint install - -all : default release - -.events .events2 tmp testbuilds builds : - $(MKDIR) - -.tests_enabled : - echo false> .tests_enabled - -.events/declare : $(wildcard src/*/*.coffee) tools/declare.js | .events tmp - node tools/declare.js - echo -> $@ - -tmp/declaration.js : .events/declare - $(if $(wildcard $@),,node tools/declare.js && echo -> $<) - -define check_source -$$(subst tmp/,.events/,$(call dests_of,$1)) : $1 $$(call imports,$1) | .events - echo -> $$(call QUOTE,$$@) -endef - -$(foreach s,$(sources),$(eval $(call check_source,$(subst $$,$$$$,$(s))))) - -.events/compile : $(updates) $(template_deps) tools/chain.js - node tools/chain.js $(call QUOTE, \ - $(subst .events/,tmp/, \ - $(if $(filter-out $(updates),$?), \ - $(updates), \ - $(filter $(updates),$?) \ - ) \ - ) \ - ) - echo -> $@ - -$(dests) : .events/compile - $(if $(wildcard $@),, \ - node tools/chain.js $(call QUOTE, $(filter-out $(wildcard $(dests)),$(dests))) \ - && echo -> $< \ - ) - -tmp/eventPage.js : src/meta/eventPage.coffee | tmp - $(coffee) -o tmp src/meta/eventPage.coffee - -tmp/LICENSE : LICENSE tools/newlinefix.js | tmp - node tools/newlinefix.js $< $@ - -tmp/meta-%.js : src/meta/%.js tools/newlinefix.js | tmp - node tools/newlinefix.js $< $@ - -define rules_channel - -testbuilds/crx$1 : - $$(MKDIR) - -testbuilds/crx$1/script.js : $$(call pieces,crx) | testbuilds/crx$1 .events/compile - @echo Concatenating: $$@ - @$$(call CAT,$$(call QUOTE,$$(call pieces,crx)),$$@) - -testbuilds/crx$1/eventPage.js : tmp/eventPage.js | testbuilds/crx$1 - $$(CP) - -testbuilds/crx$1/icon%.png : src/meta/icon%.png | testbuilds/crx$1 - $$(CP) - -testbuilds/crx$1/manifest.json : src/meta/manifest.json version.json $(template_deps) | testbuilds/crx$1 - $(template) $$< $$@ type=crx channel=$1 - -testbuilds/updates$1.xml : src/meta/updates.xml version.json $(template_deps) | testbuilds/crx$1 - $(template) $$< $$@ type=crx channel=$1 - -testbuilds/updates$1.json : src/meta/updates.json version.json $(template_deps) | testbuilds/crx$1 - $(template) $$< $$@ type=crx channel=$1 - -testbuilds/$(name)$1.crx.zip : \ - $(foreach f,$(crx_contents),testbuilds/crx$1/$(f)) \ - package.json version.json tools/zip-crx.js - node tools/zip-crx.js $1 - -testbuilds/$(name)$1.crx : $(foreach f,$(crx_contents),testbuilds/crx$1/$(f)) version.json tools/sign.sh | tmp - tools/sign.sh $1 - -testbuilds/$(name)$1.meta.js : src/meta/metadata.js src/meta/icon48.png version.json src/Archive/archives.json $(template_deps) | testbuilds - $(template) $$< $$@ type=userscript channel=$1 - -testbuilds/$(name)$1.user.js : testbuilds/$(name)$1.meta.js tmp/meta-newline.js $$(call pieces,userscript) | .events/compile - @echo Concatenating: $$@ - @$$(call CAT,testbuilds/$(name)$1.meta.js tmp/meta-newline.js $$(call QUOTE,$$(call pieces,userscript)),$$@) - -endef - -$(eval $(call rules_channel,)) -$(eval $(call rules_channel,-beta)) -$(eval $(call rules_channel,-noupdate)) - -testbuilds/$(name).zip : testbuilds/$(name)-noupdate.crx.zip - $(CP) - -builds/% : testbuilds/% | builds - $(CP) - -test.html : README.md template.jst tools/markdown.js - node tools/markdown.js - -index.html : test.html - $(CP) - -tmp/.jshintrc : src/meta/jshint.json tmp/declaration.js src/globals/globals.js $(template_deps) | tmp - $(template) $< $@ - -.events/jshint : $(dests) tmp/.jshintrc - $(BIN)jshint $(call QUOTE, \ - $(if $(filter-out $(dests),$?), \ - $(dests), \ - $(filter $(dests),$?) \ - ) \ - ) - echo -> $@ - -install.json : - echo {}> $@ - -.events/install : $(script) install.json tools/install.js | .events - node tools/install.js - echo -> $@ - -.events/CHANGELOG : version.json | .events - node tools/updcl.js - echo -> $@ - -dist : - git worktree add $@ $(meta_distBranch) - -$(wildcard dist/* dist/*/*) : dist - @ - -distready : dist $(wildcard dist/* dist/*/*) - cd dist && git checkout $(meta_distBranch) - cd dist && git pull - -.events2/push-git : .git/refs/heads .git/refs/tags $(wildcard .git/refs/heads/* .git/refs/tags/*) | .events2 distready - git push origin --tags -f - git push origin --all - echo -> $@ - -.events2/push-web : .git/refs/heads/$(meta_distBranch) | .events2 distready - git push web --tags -f - git push web $(meta_distBranch) - echo -> $@ - -.events2/push-store : .git/refs/tags/stable | .events2 distready - node tools/webstore.js - echo -> $@ - -.SECONDARY : - -.PHONY: default all distready script crx release jshint install push $(npgoals) - -script : $(script) - -crx : $(crx) - -release : $(release) - -jshint : .events/jshint - -install : .events/install - -push : .events2/push-git .events2/push-web .events2/push-store - -clean : - $(RMDIR) tmp tmp-crx testbuilds .events - $(RM) .tests_enabled - -cleanrel : clean - $(RMDIR) builds - -cleanweb : - $(RM) test.html - -cleanfull : clean cleanweb - $(RMDIR) .events2 dist node_modules - git worktree prune - -withtests : - echo true> .tests_enabled - -$(MAKE) - echo false> .tests_enabled - -archives : - git fetch -n archives - git merge --no-commit -s ours archives/gh-pages - git show archives/gh-pages:archives.json > src/Archive/archives.json - -git commit -am 'Update archive list.' - -$(foreach i,1 2 3 4,bump$(i)) : - $(MAKE) archives - node tools/bump.js $(subst bump,,$@) - $(MAKE) .events/CHANGELOG - $(MAKE) all - -tag : - git add builds - $(MAKE) cleanrel - $(MAKE) all - git diff --quiet -- builds - $(MAKE) tagcommit - -tagcommit : - git commit -am "Release $(meta_name) v$(version)." - git tag -a $(version) -m "$(meta_name) v$(version)." - -beta : distready - git tag -af beta -m "$(meta_name) v$(version)." - cd dist && git merge --no-commit -s ours beta - cd dist && git checkout beta "builds/*-beta.*" img .gitignore .gitattributes - cd dist && git commit -am "Move $(meta_name) v$(version) to beta channel." - -stable : distready - git push . HEAD:bstable - git tag -af stable -m "$(meta_name) v$(version)." - cd dist && git merge --no-commit -s ours stable - cd dist && git checkout stable "builds/$(name).*" builds/updates.xml builds/updates.json - cd dist && git commit -am "Move $(meta_name) v$(version) to stable channel." - -web : index.html distready - -git commit -am "Build web page." - cd dist && git merge --no-commit -s ours master - cd dist && git checkout master README.md index.html web.css img .gitignore .gitattributes - cd dist && git commit -am "Update web page." - -update : - $(RM) package-lock.json - npm install --save-dev $(shell node tools/unpinned.js) - npm install - -updatehard : - $(RM) package-lock.json - npm install --save-dev $(shell node tools/unpinned.js latest) - npm install diff --git a/README.md b/README.md index dfbaf5806..9a4cd4c7c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # 4chan XT -**This repo is work in progress!** Use the build from the [repo this is forked from](https://github.com/ccd0/4chan-x) in the meantime. +I would prefer that this is merged into [the repo this is forked from](https://github.com/ccd0/4chan-x), but in the mean +time, you can try this fork as well. PR to upstream: https://github.com/ccd0/4chan-x/pull/3341. @@ -20,8 +21,7 @@ The 4chan XT project is a migration of 4chan X from coffeescript to TypeScript/J - [x] crx directory that can be loaded as an unpacked extension is created - [x] beta - [x] noupdate -- [ ] run and debug -- [ ] port updates made to 4chan-X made since this was forked +- [x] port updates made to 4chan-X made since this was forked ## Other notes @@ -61,6 +61,7 @@ The 4chan XT project is a migration of 4chan X from coffeescript to TypeScript/J - [x] 7295b21b73eb13ec53fdc61767ada341c2e13144 Avoid breaking sauce settings of people with links to original Google Images and Google Lens, provided they didn't already update to v1.14.22.3. - [x] 71873cd7b22a565c2a41fa24f63f7504152683eb Recognize JPEG files with .jfif extensions as images for purposes of Image Hover etc.; also recognize .avif and .jxl files as images. - [x] ea2462ecc47327c6f0c31348d95fd2b1b6447cb3 Release 4chan X v1.14.22.4. +- [x] e31438f9a9907078508912fd4c4d44bf21ac773c Fix youtube /live embeds diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx deleted file mode 100644 index 1439282ab..000000000 Binary files a/builds/4chan-X-beta.crx and /dev/null differ diff --git a/builds/4chan-X-beta.meta.js b/builds/4chan-X-beta.meta.js deleted file mode 100644 index 15afd1f83..000000000 --- a/builds/4chan-X-beta.meta.js +++ /dev/null @@ -1,113 +0,0 @@ -// ==UserScript== -// @name 4chan X beta -// @version 1.14.22.4 -// @minGMVer 1.14 -// @minFFVer 26 -// @namespace 4chan-X -// @description 4chan X is a script that adds various features to anonymous imageboards. -// @license MIT; https://github.com/ccd0/4chan-x/blob/master/LICENSE -// @include http://boards.4chan.org/* -// @include https://boards.4chan.org/* -// @include http://sys.4chan.org/* -// @include https://sys.4chan.org/* -// @include http://www.4chan.org/* -// @include https://www.4chan.org/* -// @include http://boards.4channel.org/* -// @include https://boards.4channel.org/* -// @include http://sys.4channel.org/* -// @include https://sys.4channel.org/* -// @include http://www.4channel.org/* -// @include https://www.4channel.org/* -// @include http://i.4cdn.org/* -// @include https://i.4cdn.org/* -// @include http://is.4chan.org/* -// @include https://is.4chan.org/* -// @include http://is2.4chan.org/* -// @include https://is2.4chan.org/* -// @include http://is.4channel.org/* -// @include https://is.4channel.org/* -// @include http://is2.4channel.org/* -// @include https://is2.4channel.org/* -// @include https://erischan.org/* -// @include https://www.erischan.org/* -// @include https://fufufu.moe/* -// @include https://gnfos.com/* -// @include https://himasugi.blog/* -// @include https://www.himasugi.blog/* -// @include https://kakashinenpo.com/* -// @include https://www.kakashinenpo.com/* -// @include https://kissu.moe/* -// @include https://www.kissu.moe/* -// @include https://lainchan.org/* -// @include https://www.lainchan.org/* -// @include https://merorin.com/* -// @include https://ota-ch.com/* -// @include https://www.ota-ch.com/* -// @include https://ponyville.us/* -// @include https://www.ponyville.us/* -// @include https://smuglo.li/* -// @include https://notso.smuglo.li/* -// @include https://smugloli.net/* -// @include https://smug.nepu.moe/* -// @include https://sportschan.org/* -// @include https://www.sportschan.org/* -// @include https://sushigirl.us/* -// @include https://www.sushigirl.us/* -// @include https://tvch.moe/* -// @exclude http://www.4chan.org/advertise -// @exclude https://www.4chan.org/advertise -// @exclude http://www.4chan.org/advertise?* -// @exclude https://www.4chan.org/advertise?* -// @exclude http://www.4chan.org/donate -// @exclude https://www.4chan.org/donate -// @exclude http://www.4chan.org/donate?* -// @exclude https://www.4chan.org/donate?* -// @exclude http://www.4channel.org/advertise -// @exclude https://www.4channel.org/advertise -// @exclude http://www.4channel.org/advertise?* -// @exclude https://www.4channel.org/advertise?* -// @exclude http://www.4channel.org/donate -// @exclude https://www.4channel.org/donate -// @exclude http://www.4channel.org/donate?* -// @exclude https://www.4channel.org/donate?* -// @connect 4chan.org -// @connect 4channel.org -// @connect 4cdn.org -// @connect 4chenz.github.io -// @connect archive.4plebs.org -// @connect warosu.org -// @connect desuarchive.org -// @connect boards.fireden.net -// @connect arch.b4k.co -// @connect archived.moe -// @connect thebarchive.com -// @connect archiveofsins.com -// @connect www.tokyochronos.net -// @connect archive.palanq.win -// @connect eientei.xyz -// @connect api.clyp.it -// @connect api.dailymotion.com -// @connect api.github.com -// @connect soundcloud.com -// @connect api.streamable.com -// @connect vimeo.com -// @connect www.youtube.com -// @connect * -// @grant GM_getValue -// @grant GM_setValue -// @grant GM_deleteValue -// @grant GM_listValues -// @grant GM_addValueChangeListener -// @grant GM_openInTab -// @grant GM_xmlhttpRequest -// @grant GM.getValue -// @grant GM.setValue -// @grant GM.deleteValue -// @grant GM.listValues -// @grant GM.openInTab -// @grant GM.xmlHttpRequest -// @run-at document-start -// @updateURL https://www.4chan-x.net/builds/4chan-X-beta.meta.js -// @downloadURL https://www.4chan-x.net/builds/4chan-X-beta.user.js -// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAF5JREFUeNrtkTESABAQxPD/R6tsE2dUGYUtFJvLDKf93KevHJAjpBorAQWSBIKqFASC4G0pCAkm4GfaEvgYXl0T6HBaE97f0vmnfYHbZOMLZCx9ISdKWwjOWZSC8GYm4SUGwfYgqI4AAAAASUVORK5CYII= -// ==/UserScript== diff --git a/builds/4chan-X-beta.user.js b/builds/4chan-X-beta.user.js deleted file mode 100644 index 37d9c5c40..000000000 --- a/builds/4chan-X-beta.user.js +++ /dev/null @@ -1,27999 +0,0 @@ -// ==UserScript== -// @name 4chan X beta -// @version 1.14.22.4 -// @minGMVer 1.14 -// @minFFVer 26 -// @namespace 4chan-X -// @description 4chan X is a script that adds various features to anonymous imageboards. -// @license MIT; https://github.com/ccd0/4chan-x/blob/master/LICENSE -// @include http://boards.4chan.org/* -// @include https://boards.4chan.org/* -// @include http://sys.4chan.org/* -// @include https://sys.4chan.org/* -// @include http://www.4chan.org/* -// @include https://www.4chan.org/* -// @include http://boards.4channel.org/* -// @include https://boards.4channel.org/* -// @include http://sys.4channel.org/* -// @include https://sys.4channel.org/* -// @include http://www.4channel.org/* -// @include https://www.4channel.org/* -// @include http://i.4cdn.org/* -// @include https://i.4cdn.org/* -// @include http://is.4chan.org/* -// @include https://is.4chan.org/* -// @include http://is2.4chan.org/* -// @include https://is2.4chan.org/* -// @include http://is.4channel.org/* -// @include https://is.4channel.org/* -// @include http://is2.4channel.org/* -// @include https://is2.4channel.org/* -// @include https://erischan.org/* -// @include https://www.erischan.org/* -// @include https://fufufu.moe/* -// @include https://gnfos.com/* -// @include https://himasugi.blog/* -// @include https://www.himasugi.blog/* -// @include https://kakashinenpo.com/* -// @include https://www.kakashinenpo.com/* -// @include https://kissu.moe/* -// @include https://www.kissu.moe/* -// @include https://lainchan.org/* -// @include https://www.lainchan.org/* -// @include https://merorin.com/* -// @include https://ota-ch.com/* -// @include https://www.ota-ch.com/* -// @include https://ponyville.us/* -// @include https://www.ponyville.us/* -// @include https://smuglo.li/* -// @include https://notso.smuglo.li/* -// @include https://smugloli.net/* -// @include https://smug.nepu.moe/* -// @include https://sportschan.org/* -// @include https://www.sportschan.org/* -// @include https://sushigirl.us/* -// @include https://www.sushigirl.us/* -// @include https://tvch.moe/* -// @exclude http://www.4chan.org/advertise -// @exclude https://www.4chan.org/advertise -// @exclude http://www.4chan.org/advertise?* -// @exclude https://www.4chan.org/advertise?* -// @exclude http://www.4chan.org/donate -// @exclude https://www.4chan.org/donate -// @exclude http://www.4chan.org/donate?* -// @exclude https://www.4chan.org/donate?* -// @exclude http://www.4channel.org/advertise -// @exclude https://www.4channel.org/advertise -// @exclude http://www.4channel.org/advertise?* -// @exclude https://www.4channel.org/advertise?* -// @exclude http://www.4channel.org/donate -// @exclude https://www.4channel.org/donate -// @exclude http://www.4channel.org/donate?* -// @exclude https://www.4channel.org/donate?* -// @connect 4chan.org -// @connect 4channel.org -// @connect 4cdn.org -// @connect 4chenz.github.io -// @connect archive.4plebs.org -// @connect warosu.org -// @connect desuarchive.org -// @connect boards.fireden.net -// @connect arch.b4k.co -// @connect archived.moe -// @connect thebarchive.com -// @connect archiveofsins.com -// @connect www.tokyochronos.net -// @connect archive.palanq.win -// @connect eientei.xyz -// @connect api.clyp.it -// @connect api.dailymotion.com -// @connect api.github.com -// @connect soundcloud.com -// @connect api.streamable.com -// @connect vimeo.com -// @connect www.youtube.com -// @connect * -// @grant GM_getValue -// @grant GM_setValue -// @grant GM_deleteValue -// @grant GM_listValues -// @grant GM_addValueChangeListener -// @grant GM_openInTab -// @grant GM_xmlhttpRequest -// @grant GM.getValue -// @grant GM.setValue -// @grant GM.deleteValue -// @grant GM.listValues -// @grant GM.openInTab -// @grant GM.xmlHttpRequest -// @run-at document-start -// @updateURL https://www.4chan-x.net/builds/4chan-X-beta.meta.js -// @downloadURL https://www.4chan-x.net/builds/4chan-X-beta.user.js -// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAF5JREFUeNrtkTESABAQxPD/R6tsE2dUGYUtFJvLDKf93KevHJAjpBorAQWSBIKqFASC4G0pCAkm4GfaEvgYXl0T6HBaE97f0vmnfYHbZOMLZCx9ISdKWwjOWZSC8GYm4SUGwfYgqI4AAAAASUVORK5CYII= -// ==/UserScript== - -/* -* 4chan X -* -* Licensed under the MIT license. -* https://github.com/ccd0/4chan-x/blob/master/LICENSE -* -* Appchan X Copyright © 2013-2016 Zixaphir -* http://zixaphir.github.io/appchan-x/ -* 4chan x Copyright © 2009-2011 James Campos -* https://github.com/aeosynth/4chan-x -* 4chan x Copyright © 2012-2014 Nicolas Stepien -* https://4chan-x.just-believe.in/ -* 4chan x Copyright © 2013-2014 Jordan Bates -* http://seaweedchan.github.io/4chan-x/ -* 4chan x Copyright © 2012-2013 ihavenoface -* http://ihavenoface.github.io/4chan-x/ -* 4chan SS Copyright © 2011-2013 Ahodesuka -* https://github.com/ahodesuka/4chan-Style-Script/ -* -* Permission is hereby granted, free of charge, to any person -* obtaining a copy of this software and associated documentation -* files (the "Software"), to deal in the Software without -* restriction, including without limitation the rights to use, -* copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following -* conditions: -* -* The above copyright notice and this permission notice shall be -* included in all copies or substantial portions of the Software. -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -* OTHER DEALINGS IN THE SOFTWARE. -* -* Contributors: -* aeosynth -* mayhemydg -* noface -* !K.WeEabo0o -* blaise -* that4chanwolf -* desuwa -* seaweed -* e000 -* ahodesuka -* Shou -* ferongr -* xat -* Ongpot -* thisisanon -* Anonymous -* Seiba -* herpaderpderp -* WakiMiko -* btmcsweeney -* AppleBloom -* detharonil -* -* All the people who've taken the time to write bug reports. -* -* Thank you. -*/ - -/* -* Contains data from external sources: -* -* src/Monitoring/ThreadUpdater/beep.wav from http://freesound.org/people/pierrecartoons1979/sounds/90112/ -* cc-by-nc-3.0 -* -* Font Awesome by Dave Gandy (http://fontawesome.io) -* license: http://fontawesome.io/license/ -* -* Icons used to identify various websites are property of the respective websites. -*/ - -(function() { - -'use strict'; - -var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, BoardConfig, CSS, Callbacks, Captcha, CatalogLinks, CatalogThread, CatalogThreadNative, Config, Connection, CopyTextLink, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Flash, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, IDPostCount, ImageCommon, ImageExpand, ImageHost, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, ModContact, Nav, NormalizeURL, Notice, PSA, PSAHiding, PassLink, PassMessage, Polyfill, Post, PostHiding, PostJumper, PostRedirect, PostSuccessful, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, ReplyPruning, Report, ReportLink, RevealSpoilers, SW, Sauce, Settings, ShimSet, SimpleDict, Site, Test, Thread, ThreadHiding, ThreadLinks, ThreadStats, ThreadUpdater, ThreadWatcher, Time, Tinyboard, UI, Unread, UnreadIndex, Volume; - -var Conf, E, c, d, doc, docSet, g; - -Conf = Object.create(null); -c = console; -d = document; -doc = d.documentElement; - -// Workaround for userscript managers that run script before document.documentElement is set -docSet = function() { - return (doc = d.documentElement); -}; - -g = { - VERSION: '1.14.22.4', - NAMESPACE: '4chan X.', - sites: Object.create(null), - boards: Object.create(null) -}; - -E = (function() { - var fn, r, regex, str; - str = { - '&': '&', - "'": ''', - '"': '"', - '<': '<', - '>': '>' - }; - r = String.prototype.replace; - regex = /[&"'<>]/g; - fn = function(x) { - return str[x]; - }; - return function(text) { - return r.call(text, regex, fn); - }; -})(); - -E.cat = function(templates) { - var html, i, len; - html = ''; - for (i = 0, len = templates.length; i < len; i++) { - html += templates[i].innerHTML; - } - return html; -}; - -Config = (function() { - var Config; - - Config = { - main: { - 'Miscellaneous': { - 'Redirect to HTTPS': [true, 'Redirect to the HTTPS version of 4chan.'], - 'JSON Index': [true, 'Replace the original board index with one supporting searching, sorting, infinite scrolling, and a catalog mode.'], - 'Use 4chan X Catalog': [true, 'Link to 4chan X\'s catalog instead of the native 4chan one.', 1], - 'Index Refresh Notifications': [false, 'Show a notice at the top of the page when the index is refreshed.', 1], - 'Follow Cursor': [true, 'Image Hover and Quote Preview move with the mouse cursor.'], - 'Open Threads in New Tab': [false, 'Make links to threads in the index / 4chan X catalog open in a new tab.'], - 'External Catalog': [false, 'Link to external catalog instead of the internal one.'], - 'Catalog Links': [false, 'Add toggle link in header menu to turn Navigation links into links to each board\'s catalog.'], - 'Announcement Hiding': [true, 'Add button to hide 4chan announcements.'], - 'Desktop Notifications': [true, 'Enables desktop notifications across various 4chan X features.'], - '404 Redirect': [true, 'Redirect dead threads and images to the archives.'], - 'Archive Report': [true, 'Enable reporting posts to supported archives.'], - 'Exempt Archives from Encryption': [true, 'Permit loading content from, and warningless redirects to, HTTP-only archives from HTTPS pages.'], - 'Keybinds': [true, 'Bind actions to keyboard shortcuts.'], - 'Time Formatting': [true, 'Localize and format timestamps.'], - 'Relative Post Dates': [true, 'Display dates like "3 minutes ago". Tooltip shows the timestamp.'], - 'Relative Date Title': [true, 'Show Relative Post Date only when hovering over dates.', 1], - 'Comment Expansion': [true, 'Expand comments that are too long to display on the index. Not applicable with JSON Index.'], - 'File Info Formatting': [true, 'Reformat the file information.'], - 'Thread Expansion': [true, 'Add buttons to expand threads.'], - 'Index Navigation': [false, 'Add buttons to navigate between threads.'], - 'Reply Navigation': [false, 'Add buttons to navigate to top / bottom of thread.'], - 'Unique ID and Capcode Navigation': [false, 'Add buttons to navigate to posts having the same unique ID or capcode.'], - 'Custom Board Titles': [true, 'Allow editing of the board title and subtitle by ctrl/\u2318+clicking them.'], - 'Persistent Custom Board Titles': [false, 'Force custom board titles to be persistent, even if the board titles are updated.', 1], - 'Show Updated Notifications': [true, 'Show notifications when 4chan X is successfully updated.'], - 'Color User IDs': [true, 'Assign unique colors to user IDs on boards that use them'], - 'Count Posts by ID': [true, 'Display number of posts in the thread when hovering over an ID.'], - 'Remove Spoilers': [false, 'Remove all spoilers in text.'], - 'Reveal Spoilers': [false, 'Indicate spoilers if Remove Spoilers is enabled, or make the text appear hovered if Remove Spoiler is disabled.'], - 'Normalize URL': [true, 'Rewrite the URL of the current page, removing slugs and excess slashes, and changing /res/ to /thread/.'], - 'Work around CORB Bug': [true, 'Leave this checked until your garbage browser is fixed.'], - 'Disable Autoplaying Sounds': [false, 'Prevent sounds on the page from autoplaying.'], - 'Disable Native Extension': [true, '4chan X is NOT designed to work with the native extension.'], - 'Enable Native Flash Embedding': [true, 'Activate the native extension\'s Flash embedding if the native extension is disabled.'] - }, - 'Linkification': { - 'Linkify': [true, 'Convert text into links where applicable.'], - 'Link Title': [true, 'Replace the link of a supported site with its actual title.', 1], - 'Cover Preview': [true, 'Show preview of supported links on hover.', 1], - 'Embedding': [true, 'Embed supported services. Note: Some services don\'t work on HTTPS.', 1], - 'Auto-embed': [false, 'Auto-embed Linkify Embeds.', 2], - 'Floating Embeds': [false, 'Embed content in a frame that remains in place when the page is scrolled.', 2] - }, - 'Filtering': { - 'Anonymize': [false, 'Make everyone Anonymous.'], - 'Filter': [true, 'Self-moderation placebo.'], - 'Filtered Backlinks': [false, 'When enabled, shows backlinks to filtered posts with a line-through decoration. Otherwise, hides the backlinks.', 1], - 'Filter in Native Catalog': [true, 'Apply 4chan X filters in native catalog.', 1], - 'MD5 Quick Filter Notifications': [true, 'Show notification when quick filtering MD5s using the button or keybind.', 1], - 'Recursive Hiding': [true, 'Hide replies of hidden posts, recursively.'], - 'Thread Hiding Buttons': [true, 'Add buttons to hide entire threads.'], - 'Reply Hiding Buttons': [true, 'Add buttons to hide single replies.'], - 'Stubs': [true, 'Show stubs of hidden threads / replies.'] - }, - 'Images and Videos': { - 'Image Expansion': [true, 'Expand images / videos.'], - 'Image Hover': [true, 'Show full image / video on mouseover.'], - 'Image Hover in Catalog': [true, 'Show full image / video on mouseover in 4chan X catalog.'], - 'Gallery': [true, 'Adds a simple and cute image gallery. Has more options in the gallery menu.'], - 'Fullscreen Gallery': [false, 'Open gallery in fullscreen mode.', 1], - 'PDF in Gallery': [false, 'Show PDF files in gallery.', 1], - 'Sauce': [true, 'Add sauce links to images.'], - 'WEBM Metadata': [true, 'Add link to fetch title metadata from webm videos.'], - 'Reveal Spoiler Thumbnails': [false, 'Replace spoiler thumbnails with the original image.'], - 'Replace GIF': [false, 'Replace gif thumbnails with the actual image.'], - 'Replace JPG': [false, 'Replace jpg thumbnails with the actual image.'], - 'Replace PNG': [false, 'Replace png thumbnails with the actual image.'], - 'Replace WEBM': [false, 'Replace webm, mp4, and ogv thumbnails with the actual video. Probably will degrade browser performance ;)'], - 'Image Prefetching': [true, 'Add a shortcut icon to the header to turn on image preloading.'], - 'Fappe Tyme': [true, 'Hide posts without images when header menu item is checked. *hint* *hint*'], - 'Werk Tyme': [true, 'Hide all post images when header menu item is checked.'], - 'Autoplay': [true, 'Videos begin playing immediately when opened.'], - 'Restart when Opened': [false, 'Restart GIFs and WebMs when you hover over or expand them.'], - 'Show Controls': [true, 'Show controls on videos expanded inline.'], - 'Click Passthrough': [false, 'Clicks on videos trigger your browser\'s default behavior. Videos can be contracted with button / dragging to the left.', 1], - 'Allow Sound': [true, 'Open videos with the sound unmuted.'], - 'Mouse Wheel Volume': [true, 'Adjust volume of videos with the mouse wheel over the thumbnail/filename/gallery.'], - 'Loop in New Tab': [true, 'Loop videos opened in their own tabs.'], - 'Volume in New Tab': [true, 'Apply 4chan X mute and volume settings to videos opened in their own tabs.'] - }, - 'Menu': { - 'Menu': [true, 'Add a drop-down menu to posts.'], - 'Report Link': [true, 'Add a report link to the menu.', 1], - 'Copy Text Link': [true, 'Add a link to copy the post\'s text.', 1], - 'Thread Hiding Link': [true, 'Add a link to hide entire threads.', 1], - 'Reply Hiding Link': [true, 'Add a link to hide single replies.', 1], - 'Delete Link': [true, 'Add post and image deletion links to the menu.', 1], - 'Archive Link': [true, 'Add an archive link to the menu.', 1], - 'Edit Link': [true, 'Add a link to edit the image in Tegaki, /i/\'s painting program. Requires Quick Reply.', 1], - 'Download Link': [false, 'Add a download with original filename link to the menu.', 1] - }, - 'Monitoring': { - 'Thread Updater': [true, 'Fetch and insert new replies. Has more options in the header menu and the "Advanced" tab.'], - 'Unread Count': [true, 'Show the unread posts count in the tab title.'], - 'Quoted Title': [false, 'Change the page title to reflect you\'ve been quoted.', 1], - 'Hide Unread Count at (0)': [false, 'Hide the unread posts count in the tab title when it reaches 0.', 1], - 'Unread Favicon': [true, 'Show a different favicon when there are unread posts.'], - 'Unread Line': [true, 'Show a line to distinguish read posts from unread ones.'], - 'Remember Last Read Post': [true, 'Remember how far you\'ve read after you close the thread.'], - 'Scroll to Last Read Post': [true, 'Scroll back to the last read post when reopening a thread.', 1], - 'Unread Line in Index': [false, 'Show a line between read and unread posts in threads in the index.', 1], - 'Remove Thread Excerpt': [false, 'Replace the excerpt of the thread in the tab title with the board title.'], - 'Thread Stats': [true, 'Display reply and image count.'], - 'IP Count in Stats': [true, 'Display the unique IP count in the thread stats.', 1], - 'Page Count in Stats': [true, 'Display the page count in the thread stats.', 1], - 'Updater and Stats in Header': [true, 'Places the thread updater and thread stats in the header instead of floating them.'], - 'Thread Watcher': [true, 'Bookmark threads. Has more options in the thread watcher menu.'], - 'Fixed Thread Watcher': [true, 'Makes the thread watcher scroll with the page.', 1], - 'Persistent Thread Watcher': [false, 'The thread watcher will be visible when the page is loaded.', 1], - 'Mark New IPs': [false, 'Label each post from a new IP with the thread\'s current IP count.'], - 'Reply Pruning': [true, 'Add option in header menu to hide old replies in long threads. Activated by default in stickies.'], - 'Prune All Threads': [false, 'Activate Reply Pruning by default in all threads.', 1] - }, - 'Posting and Captchas': { - 'Quick Reply': [true, 'All-in-one form to reply, create threads, automate dumping and more.'], - 'Persistent QR': [false, 'The Quick reply won\'t disappear after posting.', 1], - 'Auto Hide QR': [true, 'Automatically hide the quick reply when posting.', 2], - 'Open Post in New Tab': [true, 'Open new threads in a new tab, and open replies in a new tab if you\'re not already in the thread.', 1], - 'Remember QR Size': [false, 'Remember the size of the Quick reply.', 1], - 'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.', 1], - 'Randomize Filename': [false, 'Set the filename to a random timestamp within the past year. Disabled on /f/.', 1], - 'Show New Thread Option in Threads': [true, 'Show the option to post a new / different thread from inside a thread.', 1], - 'Show Upload Progress': [true, 'Track progress of file uploads as percentage in submit button.', 1], - 'Cooldown': [true, 'Indicate the remaining time before posting again.', 1], - 'Posting Success Notifications': [true, 'Show notifications on successful post creation or file uploading.', 1], - 'Auto-load captcha': [false, 'Automatically load the captcha in the QR even if your post is empty.', 1], - 'Post on Captcha Completion': [false, 'Submit the post immediately when the captcha is completed.', 1], - 'Force Noscript Captcha': [false, 'Use the non-Javascript fallback captcha even if Javascript is enabled.'], - 'Pass Link': [false, 'Add a 4chan Pass login link to the bottom of the page.'] - }, - 'Quote Links': { - 'Quote Backlinks': [true, 'Add quote backlinks.'], - 'OP Backlinks': [true, 'Add backlinks to the OP.', 1], - 'Bottom Backlinks': [false, 'Place backlinks at the bottom of posts.', 1], - 'Quote Inlining': [true, 'Inline quoted post on click.'], - 'Inline Cross-thread Quotes Only': [false, 'Don\'t inline quote links when the posts are visible in the thread.', 1], - 'Quote Hash Navigation': [false, 'Include an extra link after quotes for autoscrolling to quoted posts.', 1], - 'Forward Hiding': [true, 'Hide original posts of inlined backlinks.', 1], - 'Quote Previewing': [true, 'Show quoted post on hover.'], - 'Quote Highlighting': [true, 'Highlight the previewed post.', 1], - 'Resurrect Quotes': [true, 'Link dead quotes to the archives, and support inlining/previewing of archive links like quote links.'], - 'Remember Your Posts': [true, 'Remember your posting history.'], - 'Mark Quotes of You': [true, 'Add \'(You)\' to quotes linking to your posts.', 1], - 'Highlight Posts Quoting You': [true, 'Highlights any posts that contain a quote to your post.', 1], - 'Highlight Own Posts': [true, 'Highlights own posts.', 1], - 'Mark OP Quotes': [true, 'Add \'(OP)\' to OP quotes.'], - 'Mark Cross-thread Quotes': [true, 'Add \'(Cross-thread)\' to cross-threads quotes.'], - 'Quote Threading': [true, 'Add option in header menu to thread conversations.'] - } - }, - imageExpansion: { - 'Fit width': [true, ''], - 'Fit height': [false, ''], - 'Scroll into view': [true, 'Scroll down when expanding images to bring the full image into view.'], - 'Expand spoilers': [true, 'Expand all images along with spoilers.'], - 'Expand videos': [true, 'Expand all images also expands videos.'], - 'Expand from here': [false, 'Expand all images only from current position to thread end.'], - 'Expand thread only': [false, 'In index, expand all images only within the current thread.'], - 'Advance on contract': [false, 'Advance to next post when contracting an expanded image.'] - }, - gallery: { - 'Hide Thumbnails': [false], - 'Fit Width': [true], - 'Fit Height': [true], - 'Stretch to Fit': [false], - 'Scroll to Post': [true], - 'Slide Delay': [6.0] - }, - 'Default Volume': 1.0, - threadWatcher: { - 'Current Board': [false, 'Only show watched threads from the current board.'], - 'Auto Update Thread Watcher': [true, 'Periodically check status of watched threads.'], - 'Auto Watch': [true, 'Automatically watch threads you start.'], - 'Auto Watch Reply': [true, 'Automatically watch threads you reply to.'], - 'Auto Prune': [false, 'Automatically remove dead threads.'], - 'Show Page': [true, 'Show what page watched threads are on.'], - 'Show Unread Count': [true, 'Show number of unread posts in watched threads.'], - 'Show Site Prefix': [true, 'When multiple sites are shown in the thread watcher, add a prefix to board names to distinguish them.'], - 'Require OP Quote Link': [false, 'For purposes of thread watcher highlighting, only consider posts with a quote link to the OP as replies to the OP.'] - }, - filter: { - general: '', - postID: "# Highlight dubs on [s4s]:\n#/(\\d)\\1$/;highlight;top:no;boards:s4s", - name: "# Filter any namefags:\n#/^(?!Anonymous$)/", - uniqueID: "# Filter a specific ID:\n#/Txhvk1Tl/", - tripcode: "# Filter any tripfag\n#/^!/", - capcode: "# Set a custom class for mods:\n#/Mod$/;highlight:mod;op:yes\n# Set a custom class for admins:\n#/Admin$/;highlight:admin;op:yes", - pass: "# Filter anyone using since4pass:\n#/./", - email: '', - subject: "# Filter Generals on /v/:\n#/general/i;boards:v;op:only", - comment: "# Filter Stallman copypasta on /g/:\n#/what you\'re refer+ing to as linux/i;boards:g\n# Filter posts with 20 or more quote links:\n#/(?:>>\\d(?:(?!>>\\d)[^])*){20}/\n# Filter posts like T H I S / H / I / S:\n#/^>?\\s?\\w\\s?(\\w)\\s?(\\w)\\s?(\\w).*$[\\s>]+\\1[\\s>]+\\2[\\s>]+\\3/im", - flag: '', - filename: '', - dimensions: "# Highlight potential wallpapers:\n#/1920x1080/;op:yes;highlight;top:no;boards:w,wg", - filesize: '', - MD5: '' - }, - sauces: "# Known filename formats:\nhttps://www.pixiv.net/member_illust.php?mode=medium&illust_id=%$1;regexp:/^(\\d+)_p\\d+/\njavascript:void(open(\"https://www.deviantart.com/\"+%$1.replace(/_/g,\"-\")+\"/art/\"+parseInt(%$2,36)));regexp:/^\\w+_by_(\\w+)[_-]d([\\da-z]{6})\\b/\nhttps://imgur.com/%$1;regexp:/^(?![a-zA-Z][a-z]{6})(?![A-Z]{7})(?!\\d{7})([\\da-zA-Z]{7})(?: \\(\\d+\\))?\\.\\w+$/\nhttps://flickr.com/photo.gne?id=%$1;regexp:/^(\\d+)_[\\da-f]{10}(?:_\\w)*\\b/\nhttps://www.facebook.com/photo.php?fbid=%$1;regexp:/^\\d+_(\\d+)_\\d+_[no]\\b/\n\n# Reverse image search:\nhttps://www.google.com/searchbyimage?sbisrc=4chanx&image_url=%IMG&safe=off\nhttps://yandex.com/images/search?rpt=imageview&url=%IMG\n#//tineye.com/search?url=%IMG\n#//www.bing.com/images/search?q=imgurl:%IMG&view=detailv2&iss=sbi#enterInsights\n#https://lens.google.com/uploadbyurl?url=%IMG;text:lens\n\n# Specialized reverse image search:\n//iqdb.org/?url=%IMG\nhttps://trace.moe/?auto&url=%IMG;text:wait\n#//3d.iqdb.org/?url=%IMG\n#//saucenao.com/search.php?url=%IMG\n\n# \"View Same\" in archives:\nhttp://eye.swfchan.com/search/?q=%name;types:swf\n#https://desuarchive.org/_/search/image/%sMD5/\n#https://archive.4plebs.org/_/search/image/%sMD5/\n#https://boards.fireden.net/_/search/image/%sMD5/\n#https://foolz.fireden.net/_/search/image/%sMD5/\n\n# Other tools:\n#http://exif.regex.info/exif.cgi?imgurl=%URL\n#//imgops.com/start?url=%URL;types:gif,jpg,png\n#//www.gif-explode.com/%URL;types:gif", - FappeT: { - werk: false - }, - 'Custom CSS': true, - Index: { - 'Index Mode': 'paged', - 'Previous Index Mode': 'paged', - 'Index Size': 'small', - 'Show Replies': [true, 'Show replies in the index, and also in the catalog if "Catalog hover expand" is checked.'], - 'Catalog Hover Expand': [false, 'Expand the comment and show more details when you hover over a thread in the catalog.'], - 'Catalog Hover Toggle': [true, 'Turn "Catalog hover expand" on and off by clicking in the catalog.'], - 'Pin Watched Threads': [false, 'Move watched threads to the start of the index.'], - 'Anchor Hidden Threads': [true, 'Move hidden threads to the end of the index.'], - 'Refreshed Navigation': [false, 'Refresh index when navigating through pages.'] - }, - Header: { - 'Fixed Header': true, - 'Header auto-hide': false, - 'Header auto-hide on scroll': false, - 'Bottom Header': false, - 'Centered links': false, - 'Header catalog links': false, - 'Bottom Board List': true, - 'Shortcut Icons': true, - 'Custom Board Navigation': true - }, - archives: { - archiveLists: 'https://4chenz.github.io/archives.json/archives.json', - lastarchivecheck: 0, - archiveAutoUpdate: true - }, - externalCatalogURLs: "//catalog.neet.tv/%board/;boards:4chan.org:3,a,adv,an,asp,biz,c,cgl,ck,cm,co,diy,f,fa,fit,g,gd,his,i,int,jp,k,lgbt,lit,m,mlp,mu,n,news,o,out,p,po,pol,s4s,sci,sp,tg,toy,trv,tv,v,vg,vip,vp,vr,w,wg,wsg,wsr,x", - boardnav: "[ toggle-all ]\n[current-index-text:\"Index\"\ncurrent-catalog-text:\"Catalog\"\ncurrent-expired-text:\"Expired\"\ncurrent-archive-text:\"Archive\"]\n[external-text:\"FAQ\",\"https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions\"]", - QR: { - 'QR.personas': "#options:\"sage\";boards:jp;always", - sjisPreview: false - }, - jsWhitelist: 'http://s.4cdn.org\nhttps://s.4cdn.org\nhttp://www.google.com\nhttps://www.google.com\nhttps://www.gstatic.com\nhttp://cdn.mathjax.org\nhttps://cdn.mathjax.org\nhttps://cdnjs.cloudflare.com\nhttps://hcaptcha.com\nhttps://*.hcaptcha.com\n\'self\'\n\'unsafe-inline\'\n\'unsafe-eval\'', - captchaLanguage: '', - time: '%m/%d/%y(%a)%H:%M:%S', - timeLocale: '', - backlink: '>>%id', - pastedname: 'file', - fileInfo: '%l %d (%p%s, %r%g)', - favicon: 'ferongr', - usercss: "/* Board title rice */\ndiv.boardTitle {\n font-weight: 400 !important;\n}\n:root.yotsuba div.boardTitle {\n font-family: sans-serif !important;\n text-shadow: 1px 1px 1px rgba(100,0,0,0.6);\n}\n:root.yotsuba-b div.boardTitle {\n font-family: sans-serif !important;\n text-shadow: 1px 1px 1px rgba(105,10,15,0.6);\n}\n:root.photon div.boardTitle {\n font-family: sans-serif !important;\n text-shadow: 1px 1px 1px rgba(0,74,153,0.6);\n}\n:root.tomorrow div.boardTitle {\n font-family: sans-serif !important;\n text-shadow: 1px 1px 1px rgba(167,170,168,0.6);\n}\n", - hotkeys: { - 'Toggle board list': ['Ctrl+b', 'Toggle the full board list.'], - 'Toggle header': ['Shift+h', 'Toggle the auto-hide option of the header.'], - 'Open empty QR': ['q', 'Open QR without post number inserted.'], - 'Open QR': ['Shift+q', 'Open QR with post number inserted.'], - 'Open settings': ['Alt+o', 'Open Settings.'], - 'Close': ['Esc', 'Close dialogs or notifications.'], - 'Spoiler tags': ['Ctrl+s', 'Insert spoiler tags.'], - 'Code tags': ['Alt+c', 'Insert code tags.'], - 'Eqn tags': ['Alt+e', 'Insert eqn tags.'], - 'Math tags': ['Alt+m', 'Insert math tags.'], - 'SJIS tags': ['Alt+a', 'Insert SJIS tags.'], - 'Toggle sage': ['Alt+s', 'Toggle sage in options field.'], - 'Toggle Cooldown': ['Alt+Comma', 'Toggle custom cooldown timer.'], - 'Post from URL': ['Alt+l', 'Post from URL.'], - 'Add new post': ['Alt+n', 'Add new post to the QR dump list.'], - 'Submit QR': ['Ctrl+Enter', 'Submit post.'], - 'Watch': ['w', 'Watch thread.'], - 'Update': ['r', 'Update the thread / refresh the index.'], - 'Update thread watcher': ['Shift+r', 'Manually refresh thread watcher.'], - 'Toggle thread watcher': ['t', 'Toggle visibility of thread watcher.'], - 'Toggle threading': ['Shift+t', 'Toggle threading.'], - 'Mark thread read': ['Ctrl+0', 'Mark thread read from index (requires "Unread Line in Index").'], - 'Expand image': ['Shift+e', 'Expand selected image.'], - 'Expand images': ['e', 'Expand all images.'], - 'Open Gallery': ['g', 'Opens the gallery.'], - 'Next Gallery Image': ['Right', 'Go to the next image in gallery mode.'], - 'Previous Gallery Image': ['Left', 'Go to the previous image in gallery mode.'], - 'Advance Gallery': ['Enter', 'Go to next image or, if Autoplay is off, play video.'], - 'Pause': ['p', 'Pause/play videos in the gallery.'], - 'Slideshow': ['Ctrl+Right', 'Toggle the gallery slideshow mode.'], - 'Rotate image clockwise': ['Shift+Right', 'Rotate image clockwise in gallery.'], - 'Rotate image anticlockwise': ['Shift+Left', 'Rotate image anticlockwise in gallery.'], - 'Download Gallery Image': ['Shift+j', 'Download current image in gallery.'], - 'fappeTyme': ['f', 'Toggle Fappe Tyme.'], - 'werkTyme': ['Shift+w', 'Toggle Werk Tyme.'], - 'Front page': ['1', 'Jump to front page.'], - 'Open front page': ['Shift+1', 'Open front page in a new tab.'], - 'Next page': ['Ctrl+Right', 'Jump to the next page.'], - 'Previous page': ['Ctrl+Left', 'Jump to the previous page.'], - 'Paged mode': ['Alt+1', 'Open the index in paged mode.'], - 'Infinite scrolling mode': ['Alt+2', 'Open the index in infinite scrolling mode.'], - 'All pages mode': ['Alt+3', 'Open the index in all threads mode.'], - 'Open catalog': ['Shift+c', 'Open the catalog of the current board.'], - 'Search form': ['Ctrl+Alt+s', 'Focus the search field on the board index.'], - 'Cycle sort type': ['Alt+x', 'Cycle through index sort types.'], - 'Next thread': ['Ctrl+Down', 'See next thread.'], - 'Previous thread': ['Ctrl+Up', 'See previous thread.'], - 'Expand thread': ['Ctrl+e', 'Expand thread.'], - 'Open thread': ['o', 'Open thread in current tab.'], - 'Open thread tab': ['Shift+o', 'Open thread in new tab.'], - 'Next reply': ['j', 'Select next reply.'], - 'Previous reply': ['k', 'Select previous reply.'], - 'Deselect reply': ['Shift+d', 'Deselect reply.'], - 'Hide': ['x', 'Hide thread.'], - 'Quick Filter MD5': ['5', 'Add the MD5 of the selected image to the filter list.'], - 'Previous Post Quoting You': ['Alt+Up', 'Scroll to the previous post that quotes you.'], - 'Next Post Quoting You': ['Alt+Down', 'Scroll to the next post that quotes you.'] - }, - updater: { - checkbox: { - 'Beep': [false, 'Beep on new post to completely read thread.'], - 'Beep Quoting You': [false, 'Beep on new post quoting you.'], - 'Auto Scroll': [false, 'Scroll updated posts into view. Only enabled at bottom of page.'], - 'Bottom Scroll': [false, 'Always scroll to the bottom, not the first new post. Useful for event threads.'], - 'Scroll BG': [false, 'Auto-scroll background tabs.'], - 'Auto Update': [true, 'Automatically fetch new posts.'], - 'Optional Increase': [false, 'Increase the intervals between updates on threads without new posts.'] - }, - 'Interval': 5 - }, - customCooldown: 0, - customCooldownEnabled: true, - 'Thread Quotes': false, - 'Max Replies': 1000, - 'Autohiding Scrollbar': false, - position: { - 'embedding.position': 'top: 50px; right: 0px;', - 'thread-stats.position': 'bottom: 0px; right: 0px;', - 'updater.position': 'bottom: 0px; left: 0px;', - 'thread-watcher.position': 'top: 50px; left: 0px;', - 'qr.position': 'top: 50px; right: 0px;' - }, - fourchanImageHost: 'i.4cdn.org', - hiddenPSAList: [{}], - knownBanners: '0.jpg,1.jpg,2.jpg,4.jpg,6.jpg,7.jpg,8.jpg,9.jpg,10.jpg,11.jpg,12.jpg,13.jpg,14.jpg,16.jpg,17.jpg,18.jpg,19.jpg,20.jpg,21.jpg,22.jpg,24.jpg,25.jpg,26.jpg,28.jpg,29.jpg,33.jpg,38.jpg,39.jpg,43.jpg,44.jpg,45.jpg,46.jpg,47.jpg,52.jpg,54.jpg,57.jpg,59.jpg,60.jpg,61.jpg,64.jpg,66.jpg,67.jpg,69.jpg,71.jpg,72.jpg,76.jpg,77.jpg,81.jpg,82.jpg,83.jpg,84.jpg,88.jpg,90.jpg,91.jpg,96.jpg,98.jpg,99.jpg,100.jpg,104.jpg,106.jpg,116.jpg,119.jpg,137.jpg,140.jpg,148.jpg,149.jpg,150.jpg,154.jpg,156.jpg,157.jpg,158.jpg,159.jpg,161.jpg,162.jpg,164.jpg,165.jpg,166.jpg,167.jpg,168.jpg,169.jpg,170.jpg,171.jpg,172.jpg,173.jpg,174.jpg,175.jpg,176.jpg,178.jpg,179.jpg,180.jpg,181.jpg,182.jpg,183.jpg,186.jpg,189.jpg,190.jpg,192.jpg,193.jpg,194.jpg,197.jpg,198.jpg,200.jpg,201.jpg,202.jpg,203.jpg,205.jpg,206.jpg,207.jpg,208.jpg,210.jpg,213.jpg,214.jpg,215.jpg,216.jpg,218.jpg,219.jpg,220.jpg,221.jpg,222.jpg,223.jpg,224.jpg,227.jpg,0.png,1.png,2.png,3.png,5.png,6.png,9.png,10.png,11.png,12.png,14.png,16.png,19.png,20.png,21.png,22.png,23.png,24.png,26.png,27.png,28.png,29.png,30.png,31.png,32.png,33.png,34.png,37.png,39.png,40.png,41.png,42.png,43.png,44.png,45.png,48.png,49.png,50.png,51.png,52.png,53.png,57.png,58.png,59.png,64.png,66.png,67.png,68.png,69.png,70.png,71.png,72.png,76.png,78.png,79.png,81.png,82.png,85.png,86.png,87.png,89.png,95.png,98.png,100.png,101.png,102.png,105.png,106.png,107.png,109.png,110.png,111.png,112.png,113.png,114.png,115.png,116.png,118.png,119.png,120.png,121.png,122.png,123.png,126.png,128.png,130.png,134.png,136.png,138.png,139.png,140.png,142.png,145.png,146.png,149.png,150.png,151.png,152.png,153.png,154.png,155.png,156.png,157.png,158.png,159.png,160.png,163.png,164.png,165.png,166.png,167.png,168.png,169.png,170.png,171.png,172.png,173.png,174.png,178.png,179.png,180.png,181.png,182.png,184.png,186.png,188.png,190.png,192.png,193.png,194.png,195.png,196.png,197.png,198.png,200.png,202.png,203.png,205.png,206.png,207.png,209.png,212.png,213.png,214.png,216.png,217.png,218.png,219.png,220.png,221.png,222.png,223.png,224.png,225.png,226.png,229.png,231.png,232.png,233.png,234.png,235.png,237.png,238.png,239.png,240.png,241.png,242.png,244.png,245.png,246.png,247.png,248.png,249.png,250.png,253.png,254.png,255.png,256.png,257.png,258.png,259.png,260.png,262.png,268.png,0.gif,1.gif,2.gif,3.gif,4.gif,5.gif,6.gif,7.gif,8.gif,9.gif,10.gif,12.gif,13.gif,14.gif,15.gif,16.gif,18.gif,19.gif,20.gif,21.gif,22.gif,23.gif,24.gif,28.gif,29.gif,30.gif,33.gif,34.gif,35.gif,36.gif,37.gif,39.gif,40.gif,42.gif,44.gif,45.gif,46.gif,48.gif,50.gif,52.gif,54.gif,55.gif,57.gif,58.gif,59.gif,60.gif,61.gif,63.gif,64.gif,66.gif,67.gif,68.gif,69.gif,70.gif,72.gif,73.gif,75.gif,76.gif,77.gif,78.gif,80.gif,81.gif,82.gif,83.gif,86.gif,87.gif,88.gif,92.gif,93.gif,94.gif,95.gif,96.gif,97.gif,98.gif,99.gif,100.gif,101.gif,102.gif,103.gif,104.gif,105.gif,106.gif,108.gif,109.gif,110.gif,111.gif,112.gif,113.gif,115.gif,116.gif,117.gif,118.gif,119.gif,120.gif,122.gif,123.gif,124.gif,127.gif,129.gif,130.gif,131.gif,134.gif,135.gif,136.gif,138.gif,139.gif,141.gif,144.gif,146.gif,148.gif,149.gif,153.gif,154.gif,155.gif,157.gif,158.gif,159.gif,160.gif,161.gif,162.gif,164.gif,166.gif,167.gif,168.gif,169.gif,170.gif,171.gif,172.gif,173.gif,174.gif,175.gif,176.gif,177.gif,178.gif,181.gif,182.gif,183.gif,185.gif,186.gif,187.gif,188.gif,189.gif,190.gif,191.gif,192.gif,193.gif,195.gif,196.gif,197.gif,200.gif,201.gif,202.gif,203.gif,204.gif,205.gif,206.gif,207.gif,208.gif,209.gif,210.gif,211.gif,212.gif,213.gif,214.gif,215.gif,216.gif,217.gif,219.gif,220.gif,221.gif,222.gif,224.gif,225.gif,226.gif,227.gif,228.gif,230.gif,232.gif,233.gif,234.gif,235.gif,238.gif,240.gif,241.gif,243.gif,244.gif,245.gif,246.gif,247.gif,249.gif,250.gif,251.gif,253.gif', - passMessageClosed: false, - 'Prerequest Captcha': false, - 'PSAseen': [[]] - }; - - return Config; - -}).call(this); - -CSS = { - -boards: -"/*!\n\ - * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome\n\ - * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)\n\ - */\n\ -@font-face {\n\ - font-family: FontAwesome;\n\ - src: url('data:application/font-woff;base64,d09GRgABAAAAAX7oAA0AAAAChqwABAAHAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABMAAAABwAAAAca75HuUdERUYAAAFMAAAAHwAAACAC8AAET1MvMgAAAWwAAAA+AAAAYIgyekBjbWFwAAABrAAAAWkAAALyCr86f2dhc3AAAAMYAAAACAAAAAj//wADZ2x5ZgAAAyAAAV95AAJMvI/3rk1oZWFkAAFinAAAADMAAAA2EInlLWhoZWEAAWLQAAAAHwAAACQPAwq1aG10eAABYvAAAAL0AAAK8EV5GIVsb2NhAAFl5AAABxYAAAsQAvWiXG1heHAAAWz8AAAAHwAAACADLAIcbmFtZQABbRwAAAJEAAAEhuOXi6xwb3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UhKghAzGGIGQ8xgiBkMMYMhZjDEDIaYwRAzGGIGQ8xgiBkMCV9GWRBlQZQFIR4wyoKoCKIiiIogRHpDpDdEekOkN0R6Q6Q3KoIwBCG6G6K7IboborshuhuiuyG6G6K7IboborshuhuiuyG6G6YgTEGI6IYpCFMQLHqrxAguBMGic0sQIrohohtVQVQFIaIbIrohohsiuiGiGyK6IaIbIrohohsiuiGiGyK6IaIbIrohohsiujEpCIkEhkQCQyKBwaK3SlUV27Q0MaZrxpkivSnSmzoelCYMXZsyWJViQgrmM8VLpuhviv6m6G+K/qbob4r+puhviv6m6G+K/qbob4r+puhviv6m6G+K/qbob4r+Zim5lqVVeoWrxnVd0nVZ13qpq/RSV5m6rup6QteD+VbpekrX07qe0fVsUk9p3inNO6V5pzTvlOad0rxTmndK805p3inNO6V5pzTvlOad0rxTmlcHzdK05p3WvNOad1rzTmveac07rXmnNe+05p3WvNOad1rzTmveac2rY2tJx9bSjOad0bwzmldH2JKOsKUZzTujeWc074zmndG8M5p3RvPOaN5ZzTureWc176zmndW8s5p3VvPOilMmNemsJp3VpLOadFaTzmrS2dn/AboJB4wAAAA=') format('woff');\n\ - font-weight: 400;\n\ - font-style: normal;\n\ -}\n\ -.fa-glass:before {content: \"\\f000\";}\n\ -.fa-music:before {content: \"\\f001\";}\n\ -.fa-search:before {content: \"\\f002\";}\n\ -.fa-envelope-o:before {content: \"\\f003\";}\n\ -.fa-heart:before {content: \"\\f004\";}\n\ -.fa-star:before {content: \"\\f005\";}\n\ -.fa-star-o:before {content: \"\\f006\";}\n\ -.fa-user:before {content: \"\\f007\";}\n\ -.fa-film:before {content: \"\\f008\";}\n\ -.fa-th-large:before {content: \"\\f009\";}\n\ -.fa-th:before {content: \"\\f00a\";}\n\ -.fa-th-list:before {content: \"\\f00b\";}\n\ -.fa-check:before {content: \"\\f00c\";}\n\ -.fa-remove:before, .fa-close:before, .fa-times:before {content: \"\\f00d\";}\n\ -.fa-search-plus:before {content: \"\\f00e\";}\n\ -.fa-search-minus:before {content: \"\\f010\";}\n\ -.fa-power-off:before {content: \"\\f011\";}\n\ -.fa-signal:before {content: \"\\f012\";}\n\ -.fa-gear:before, .fa-cog:before {content: \"\\f013\";}\n\ -.fa-trash-o:before {content: \"\\f014\";}\n\ -.fa-home:before {content: \"\\f015\";}\n\ -.fa-file-o:before {content: \"\\f016\";}\n\ -.fa-clock-o:before {content: \"\\f017\";}\n\ -.fa-road:before {content: \"\\f018\";}\n\ -.fa-download:before {content: \"\\f019\";}\n\ -.fa-arrow-circle-o-down:before {content: \"\\f01a\";}\n\ -.fa-arrow-circle-o-up:before {content: \"\\f01b\";}\n\ -.fa-inbox:before {content: \"\\f01c\";}\n\ -.fa-play-circle-o:before {content: \"\\f01d\";}\n\ -.fa-rotate-right:before, .fa-repeat:before {content: \"\\f01e\";}\n\ -.fa-refresh:before {content: \"\\f021\";}\n\ -.fa-list-alt:before {content: \"\\f022\";}\n\ -.fa-lock:before {content: \"\\f023\";}\n\ -.fa-flag:before {content: \"\\f024\";}\n\ -.fa-headphones:before {content: \"\\f025\";}\n\ -.fa-volume-off:before {content: \"\\f026\";}\n\ -.fa-volume-down:before {content: \"\\f027\";}\n\ -.fa-volume-up:before {content: \"\\f028\";}\n\ -.fa-qrcode:before {content: \"\\f029\";}\n\ -.fa-barcode:before {content: \"\\f02a\";}\n\ -.fa-tag:before {content: \"\\f02b\";}\n\ -.fa-tags:before {content: \"\\f02c\";}\n\ -.fa-book:before {content: \"\\f02d\";}\n\ -.fa-bookmark:before {content: \"\\f02e\";}\n\ -.fa-print:before {content: \"\\f02f\";}\n\ -.fa-camera:before {content: \"\\f030\";}\n\ -.fa-font:before {content: \"\\f031\";}\n\ -.fa-bold:before {content: \"\\f032\";}\n\ -.fa-italic:before {content: \"\\f033\";}\n\ -.fa-text-height:before {content: \"\\f034\";}\n\ -.fa-text-width:before {content: \"\\f035\";}\n\ -.fa-align-left:before {content: \"\\f036\";}\n\ -.fa-align-center:before {content: \"\\f037\";}\n\ -.fa-align-right:before {content: \"\\f038\";}\n\ -.fa-align-justify:before {content: \"\\f039\";}\n\ -.fa-list:before {content: \"\\f03a\";}\n\ -.fa-dedent:before, .fa-outdent:before {content: \"\\f03b\";}\n\ -.fa-indent:before {content: \"\\f03c\";}\n\ -.fa-video-camera:before {content: \"\\f03d\";}\n\ -.fa-photo:before, .fa-image:before, .fa-picture-o:before {content: \"\\f03e\";}\n\ -.fa-pencil:before {content: \"\\f040\";}\n\ -.fa-map-marker:before {content: \"\\f041\";}\n\ -.fa-adjust:before {content: \"\\f042\";}\n\ -.fa-tint:before {content: \"\\f043\";}\n\ -.fa-edit:before, .fa-pencil-square-o:before {content: \"\\f044\";}\n\ -.fa-share-square-o:before {content: \"\\f045\";}\n\ -.fa-check-square-o:before {content: \"\\f046\";}\n\ -.fa-arrows:before {content: \"\\f047\";}\n\ -.fa-step-backward:before {content: \"\\f048\";}\n\ -.fa-fast-backward:before {content: \"\\f049\";}\n\ -.fa-backward:before {content: \"\\f04a\";}\n\ -.fa-play:before {content: \"\\f04b\";}\n\ -.fa-pause:before {content: \"\\f04c\";}\n\ -.fa-stop:before {content: \"\\f04d\";}\n\ -.fa-forward:before {content: \"\\f04e\";}\n\ -.fa-fast-forward:before {content: \"\\f050\";}\n\ -.fa-step-forward:before {content: \"\\f051\";}\n\ -.fa-eject:before {content: \"\\f052\";}\n\ -.fa-chevron-left:before {content: \"\\f053\";}\n\ -.fa-chevron-right:before {content: \"\\f054\";}\n\ -.fa-plus-circle:before {content: \"\\f055\";}\n\ -.fa-minus-circle:before {content: \"\\f056\";}\n\ -.fa-times-circle:before {content: \"\\f057\";}\n\ -.fa-check-circle:before {content: \"\\f058\";}\n\ -.fa-question-circle:before {content: \"\\f059\";}\n\ -.fa-info-circle:before {content: \"\\f05a\";}\n\ -.fa-crosshairs:before {content: \"\\f05b\";}\n\ -.fa-times-circle-o:before {content: \"\\f05c\";}\n\ -.fa-check-circle-o:before {content: \"\\f05d\";}\n\ -.fa-ban:before {content: \"\\f05e\";}\n\ -.fa-arrow-left:before {content: \"\\f060\";}\n\ -.fa-arrow-right:before {content: \"\\f061\";}\n\ -.fa-arrow-up:before {content: \"\\f062\";}\n\ -.fa-arrow-down:before {content: \"\\f063\";}\n\ -.fa-mail-forward:before, .fa-share:before {content: \"\\f064\";}\n\ -.fa-expand:before {content: \"\\f065\";}\n\ -.fa-compress:before {content: \"\\f066\";}\n\ -.fa-plus:before {content: \"\\f067\";}\n\ -.fa-minus:before {content: \"\\f068\";}\n\ -.fa-asterisk:before {content: \"\\f069\";}\n\ -.fa-exclamation-circle:before {content: \"\\f06a\";}\n\ -.fa-gift:before {content: \"\\f06b\";}\n\ -.fa-leaf:before {content: \"\\f06c\";}\n\ -.fa-fire:before {content: \"\\f06d\";}\n\ -.fa-eye:before {content: \"\\f06e\";}\n\ -.fa-eye-slash:before {content: \"\\f070\";}\n\ -.fa-warning:before, .fa-exclamation-triangle:before {content: \"\\f071\";}\n\ -.fa-plane:before {content: \"\\f072\";}\n\ -.fa-calendar:before {content: \"\\f073\";}\n\ -.fa-random:before {content: \"\\f074\";}\n\ -.fa-comment:before {content: \"\\f075\";}\n\ -.fa-magnet:before {content: \"\\f076\";}\n\ -.fa-chevron-up:before {content: \"\\f077\";}\n\ -.fa-chevron-down:before {content: \"\\f078\";}\n\ -.fa-retweet:before {content: \"\\f079\";}\n\ -.fa-shopping-cart:before {content: \"\\f07a\";}\n\ -.fa-folder:before {content: \"\\f07b\";}\n\ -.fa-folder-open:before {content: \"\\f07c\";}\n\ -.fa-arrows-v:before {content: \"\\f07d\";}\n\ -.fa-arrows-h:before {content: \"\\f07e\";}\n\ -.fa-bar-chart-o:before, .fa-bar-chart:before {content: \"\\f080\";}\n\ -.fa-twitter-square:before {content: \"\\f081\";}\n\ -.fa-facebook-square:before {content: \"\\f082\";}\n\ -.fa-camera-retro:before {content: \"\\f083\";}\n\ -.fa-key:before {content: \"\\f084\";}\n\ -.fa-gears:before, .fa-cogs:before {content: \"\\f085\";}\n\ -.fa-comments:before {content: \"\\f086\";}\n\ -.fa-thumbs-o-up:before {content: \"\\f087\";}\n\ -.fa-thumbs-o-down:before {content: \"\\f088\";}\n\ -.fa-star-half:before {content: \"\\f089\";}\n\ -.fa-heart-o:before {content: \"\\f08a\";}\n\ -.fa-sign-out:before {content: \"\\f08b\";}\n\ -.fa-linkedin-square:before {content: \"\\f08c\";}\n\ -.fa-thumb-tack:before {content: \"\\f08d\";}\n\ -.fa-external-link:before {content: \"\\f08e\";}\n\ -.fa-sign-in:before {content: \"\\f090\";}\n\ -.fa-trophy:before {content: \"\\f091\";}\n\ -.fa-github-square:before {content: \"\\f092\";}\n\ -.fa-upload:before {content: \"\\f093\";}\n\ -.fa-lemon-o:before {content: \"\\f094\";}\n\ -.fa-phone:before {content: \"\\f095\";}\n\ -.fa-square-o:before {content: \"\\f096\";}\n\ -.fa-bookmark-o:before {content: \"\\f097\";}\n\ -.fa-phone-square:before {content: \"\\f098\";}\n\ -.fa-twitter:before {content: \"\\f099\";}\n\ -.fa-facebook-f:before, .fa-facebook:before {content: \"\\f09a\";}\n\ -.fa-github:before {content: \"\\f09b\";}\n\ -.fa-unlock:before {content: \"\\f09c\";}\n\ -.fa-credit-card:before {content: \"\\f09d\";}\n\ -.fa-feed:before, .fa-rss:before {content: \"\\f09e\";}\n\ -.fa-hdd-o:before {content: \"\\f0a0\";}\n\ -.fa-bullhorn:before {content: \"\\f0a1\";}\n\ -.fa-bell:before {content: \"\\f0f3\";}\n\ -.fa-certificate:before {content: \"\\f0a3\";}\n\ -.fa-hand-o-right:before {content: \"\\f0a4\";}\n\ -.fa-hand-o-left:before {content: \"\\f0a5\";}\n\ -.fa-hand-o-up:before {content: \"\\f0a6\";}\n\ -.fa-hand-o-down:before {content: \"\\f0a7\";}\n\ -.fa-arrow-circle-left:before {content: \"\\f0a8\";}\n\ -.fa-arrow-circle-right:before {content: \"\\f0a9\";}\n\ -.fa-arrow-circle-up:before {content: \"\\f0aa\";}\n\ -.fa-arrow-circle-down:before {content: \"\\f0ab\";}\n\ -.fa-globe:before {content: \"\\f0ac\";}\n\ -.fa-wrench:before {content: \"\\f0ad\";}\n\ -.fa-tasks:before {content: \"\\f0ae\";}\n\ -.fa-filter:before {content: \"\\f0b0\";}\n\ -.fa-briefcase:before {content: \"\\f0b1\";}\n\ -.fa-arrows-alt:before {content: \"\\f0b2\";}\n\ -.fa-group:before, .fa-users:before {content: \"\\f0c0\";}\n\ -.fa-chain:before, .fa-link:before {content: \"\\f0c1\";}\n\ -.fa-cloud:before {content: \"\\f0c2\";}\n\ -.fa-flask:before {content: \"\\f0c3\";}\n\ -.fa-cut:before, .fa-scissors:before {content: \"\\f0c4\";}\n\ -.fa-copy:before, .fa-files-o:before {content: \"\\f0c5\";}\n\ -.fa-paperclip:before {content: \"\\f0c6\";}\n\ -.fa-save:before, .fa-floppy-o:before {content: \"\\f0c7\";}\n\ -.fa-square:before {content: \"\\f0c8\";}\n\ -.fa-navicon:before, .fa-reorder:before, .fa-bars:before {content: \"\\f0c9\";}\n\ -.fa-list-ul:before {content: \"\\f0ca\";}\n\ -.fa-list-ol:before {content: \"\\f0cb\";}\n\ -.fa-strikethrough:before {content: \"\\f0cc\";}\n\ -.fa-underline:before {content: \"\\f0cd\";}\n\ -.fa-table:before {content: \"\\f0ce\";}\n\ -.fa-magic:before {content: \"\\f0d0\";}\n\ -.fa-truck:before {content: \"\\f0d1\";}\n\ -.fa-pinterest:before {content: \"\\f0d2\";}\n\ -.fa-pinterest-square:before {content: \"\\f0d3\";}\n\ -.fa-google-plus-square:before {content: \"\\f0d4\";}\n\ -.fa-google-plus:before {content: \"\\f0d5\";}\n\ -.fa-money:before {content: \"\\f0d6\";}\n\ -.fa-caret-down:before {content: \"\\f0d7\";}\n\ -.fa-caret-up:before {content: \"\\f0d8\";}\n\ -.fa-caret-left:before {content: \"\\f0d9\";}\n\ -.fa-caret-right:before {content: \"\\f0da\";}\n\ -.fa-columns:before {content: \"\\f0db\";}\n\ -.fa-unsorted:before, .fa-sort:before {content: \"\\f0dc\";}\n\ -.fa-sort-down:before, .fa-sort-desc:before {content: \"\\f0dd\";}\n\ -.fa-sort-up:before, .fa-sort-asc:before {content: \"\\f0de\";}\n\ -.fa-envelope:before {content: \"\\f0e0\";}\n\ -.fa-linkedin:before {content: \"\\f0e1\";}\n\ -.fa-rotate-left:before, .fa-undo:before {content: \"\\f0e2\";}\n\ -.fa-legal:before, .fa-gavel:before {content: \"\\f0e3\";}\n\ -.fa-dashboard:before, .fa-tachometer:before {content: \"\\f0e4\";}\n\ -.fa-comment-o:before {content: \"\\f0e5\";}\n\ -.fa-comments-o:before {content: \"\\f0e6\";}\n\ -.fa-flash:before, .fa-bolt:before {content: \"\\f0e7\";}\n\ -.fa-sitemap:before {content: \"\\f0e8\";}\n\ -.fa-umbrella:before {content: \"\\f0e9\";}\n\ -.fa-paste:before, .fa-clipboard:before {content: \"\\f0ea\";}\n\ -.fa-lightbulb-o:before {content: \"\\f0eb\";}\n\ -.fa-exchange:before {content: \"\\f0ec\";}\n\ -.fa-cloud-download:before {content: \"\\f0ed\";}\n\ -.fa-cloud-upload:before {content: \"\\f0ee\";}\n\ -.fa-user-md:before {content: \"\\f0f0\";}\n\ -.fa-stethoscope:before {content: \"\\f0f1\";}\n\ -.fa-suitcase:before {content: \"\\f0f2\";}\n\ -.fa-bell-o:before {content: \"\\f0a2\";}\n\ -.fa-coffee:before {content: \"\\f0f4\";}\n\ -.fa-cutlery:before {content: \"\\f0f5\";}\n\ -.fa-file-text-o:before {content: \"\\f0f6\";}\n\ -.fa-building-o:before {content: \"\\f0f7\";}\n\ -.fa-hospital-o:before {content: \"\\f0f8\";}\n\ -.fa-ambulance:before {content: \"\\f0f9\";}\n\ -.fa-medkit:before {content: \"\\f0fa\";}\n\ -.fa-fighter-jet:before {content: \"\\f0fb\";}\n\ -.fa-beer:before {content: \"\\f0fc\";}\n\ -.fa-h-square:before {content: \"\\f0fd\";}\n\ -.fa-plus-square:before {content: \"\\f0fe\";}\n\ -.fa-angle-double-left:before {content: \"\\f100\";}\n\ -.fa-angle-double-right:before {content: \"\\f101\";}\n\ -.fa-angle-double-up:before {content: \"\\f102\";}\n\ -.fa-angle-double-down:before {content: \"\\f103\";}\n\ -.fa-angle-left:before {content: \"\\f104\";}\n\ -.fa-angle-right:before {content: \"\\f105\";}\n\ -.fa-angle-up:before {content: \"\\f106\";}\n\ -.fa-angle-down:before {content: \"\\f107\";}\n\ -.fa-desktop:before {content: \"\\f108\";}\n\ -.fa-laptop:before {content: \"\\f109\";}\n\ -.fa-tablet:before {content: \"\\f10a\";}\n\ -.fa-mobile-phone:before, .fa-mobile:before {content: \"\\f10b\";}\n\ -.fa-circle-o:before {content: \"\\f10c\";}\n\ -.fa-quote-left:before {content: \"\\f10d\";}\n\ -.fa-quote-right:before {content: \"\\f10e\";}\n\ -.fa-spinner:before {content: \"\\f110\";}\n\ -.fa-circle:before {content: \"\\f111\";}\n\ -.fa-mail-reply:before, .fa-reply:before {content: \"\\f112\";}\n\ -.fa-github-alt:before {content: \"\\f113\";}\n\ -.fa-folder-o:before {content: \"\\f114\";}\n\ -.fa-folder-open-o:before {content: \"\\f115\";}\n\ -.fa-smile-o:before {content: \"\\f118\";}\n\ -.fa-frown-o:before {content: \"\\f119\";}\n\ -.fa-meh-o:before {content: \"\\f11a\";}\n\ -.fa-gamepad:before {content: \"\\f11b\";}\n\ -.fa-keyboard-o:before {content: \"\\f11c\";}\n\ -.fa-flag-o:before {content: \"\\f11d\";}\n\ -.fa-flag-checkered:before {content: \"\\f11e\";}\n\ -.fa-terminal:before {content: \"\\f120\";}\n\ -.fa-code:before {content: \"\\f121\";}\n\ -.fa-mail-reply-all:before, .fa-reply-all:before {content: \"\\f122\";}\n\ -.fa-star-half-empty:before, .fa-star-half-full:before, .fa-star-half-o:before {content: \"\\f123\";}\n\ -.fa-location-arrow:before {content: \"\\f124\";}\n\ -.fa-crop:before {content: \"\\f125\";}\n\ -.fa-code-fork:before {content: \"\\f126\";}\n\ -.fa-unlink:before, .fa-chain-broken:before {content: \"\\f127\";}\n\ -.fa-question:before {content: \"\\f128\";}\n\ -.fa-info:before {content: \"\\f129\";}\n\ -.fa-exclamation:before {content: \"\\f12a\";}\n\ -.fa-superscript:before {content: \"\\f12b\";}\n\ -.fa-subscript:before {content: \"\\f12c\";}\n\ -.fa-eraser:before {content: \"\\f12d\";}\n\ -.fa-puzzle-piece:before {content: \"\\f12e\";}\n\ -.fa-microphone:before {content: \"\\f130\";}\n\ -.fa-microphone-slash:before {content: \"\\f131\";}\n\ -.fa-shield:before {content: \"\\f132\";}\n\ -.fa-calendar-o:before {content: \"\\f133\";}\n\ -.fa-fire-extinguisher:before {content: \"\\f134\";}\n\ -.fa-rocket:before {content: \"\\f135\";}\n\ -.fa-maxcdn:before {content: \"\\f136\";}\n\ -.fa-chevron-circle-left:before {content: \"\\f137\";}\n\ -.fa-chevron-circle-right:before {content: \"\\f138\";}\n\ -.fa-chevron-circle-up:before {content: \"\\f139\";}\n\ -.fa-chevron-circle-down:before {content: \"\\f13a\";}\n\ -.fa-html5:before {content: \"\\f13b\";}\n\ -.fa-css3:before {content: \"\\f13c\";}\n\ -.fa-anchor:before {content: \"\\f13d\";}\n\ -.fa-unlock-alt:before {content: \"\\f13e\";}\n\ -.fa-bullseye:before {content: \"\\f140\";}\n\ -.fa-ellipsis-h:before {content: \"\\f141\";}\n\ -.fa-ellipsis-v:before {content: \"\\f142\";}\n\ -.fa-rss-square:before {content: \"\\f143\";}\n\ -.fa-play-circle:before {content: \"\\f144\";}\n\ -.fa-ticket:before {content: \"\\f145\";}\n\ -.fa-minus-square:before {content: \"\\f146\";}\n\ -.fa-minus-square-o:before {content: \"\\f147\";}\n\ -.fa-level-up:before {content: \"\\f148\";}\n\ -.fa-level-down:before {content: \"\\f149\";}\n\ -.fa-check-square:before {content: \"\\f14a\";}\n\ -.fa-pencil-square:before {content: \"\\f14b\";}\n\ -.fa-external-link-square:before {content: \"\\f14c\";}\n\ -.fa-share-square:before {content: \"\\f14d\";}\n\ -.fa-compass:before {content: \"\\f14e\";}\n\ -.fa-toggle-down:before, .fa-caret-square-o-down:before {content: \"\\f150\";}\n\ -.fa-toggle-up:before, .fa-caret-square-o-up:before {content: \"\\f151\";}\n\ -.fa-toggle-right:before, .fa-caret-square-o-right:before {content: \"\\f152\";}\n\ -.fa-euro:before, .fa-eur:before {content: \"\\f153\";}\n\ -.fa-gbp:before {content: \"\\f154\";}\n\ -.fa-dollar:before, .fa-usd:before {content: \"\\f155\";}\n\ -.fa-rupee:before, .fa-inr:before {content: \"\\f156\";}\n\ -.fa-cny:before, .fa-rmb:before, .fa-yen:before, .fa-jpy:before {content: \"\\f157\";}\n\ -.fa-ruble:before, .fa-rouble:before, .fa-rub:before {content: \"\\f158\";}\n\ -.fa-won:before, .fa-krw:before {content: \"\\f159\";}\n\ -.fa-bitcoin:before, .fa-btc:before {content: \"\\f15a\";}\n\ -.fa-file:before {content: \"\\f15b\";}\n\ -.fa-file-text:before {content: \"\\f15c\";}\n\ -.fa-sort-alpha-asc:before {content: \"\\f15d\";}\n\ -.fa-sort-alpha-desc:before {content: \"\\f15e\";}\n\ -.fa-sort-amount-asc:before {content: \"\\f160\";}\n\ -.fa-sort-amount-desc:before {content: \"\\f161\";}\n\ -.fa-sort-numeric-asc:before {content: \"\\f162\";}\n\ -.fa-sort-numeric-desc:before {content: \"\\f163\";}\n\ -.fa-thumbs-up:before {content: \"\\f164\";}\n\ -.fa-thumbs-down:before {content: \"\\f165\";}\n\ -.fa-youtube-square:before {content: \"\\f166\";}\n\ -.fa-youtube:before {content: \"\\f167\";}\n\ -.fa-xing:before {content: \"\\f168\";}\n\ -.fa-xing-square:before {content: \"\\f169\";}\n\ -.fa-youtube-play:before {content: \"\\f16a\";}\n\ -.fa-dropbox:before {content: \"\\f16b\";}\n\ -.fa-stack-overflow:before {content: \"\\f16c\";}\n\ -.fa-instagram:before {content: \"\\f16d\";}\n\ -.fa-flickr:before {content: \"\\f16e\";}\n\ -.fa-adn:before {content: \"\\f170\";}\n\ -.fa-bitbucket:before {content: \"\\f171\";}\n\ -.fa-bitbucket-square:before {content: \"\\f172\";}\n\ -.fa-tumblr:before {content: \"\\f173\";}\n\ -.fa-tumblr-square:before {content: \"\\f174\";}\n\ -.fa-long-arrow-down:before {content: \"\\f175\";}\n\ -.fa-long-arrow-up:before {content: \"\\f176\";}\n\ -.fa-long-arrow-left:before {content: \"\\f177\";}\n\ -.fa-long-arrow-right:before {content: \"\\f178\";}\n\ -.fa-apple:before {content: \"\\f179\";}\n\ -.fa-windows:before {content: \"\\f17a\";}\n\ -.fa-android:before {content: \"\\f17b\";}\n\ -.fa-linux:before {content: \"\\f17c\";}\n\ -.fa-dribbble:before {content: \"\\f17d\";}\n\ -.fa-skype:before {content: \"\\f17e\";}\n\ -.fa-foursquare:before {content: \"\\f180\";}\n\ -.fa-trello:before {content: \"\\f181\";}\n\ -.fa-female:before {content: \"\\f182\";}\n\ -.fa-male:before {content: \"\\f183\";}\n\ -.fa-gittip:before, .fa-gratipay:before {content: \"\\f184\";}\n\ -.fa-sun-o:before {content: \"\\f185\";}\n\ -.fa-moon-o:before {content: \"\\f186\";}\n\ -.fa-archive:before {content: \"\\f187\";}\n\ -.fa-bug:before {content: \"\\f188\";}\n\ -.fa-vk:before {content: \"\\f189\";}\n\ -.fa-weibo:before {content: \"\\f18a\";}\n\ -.fa-renren:before {content: \"\\f18b\";}\n\ -.fa-pagelines:before {content: \"\\f18c\";}\n\ -.fa-stack-exchange:before {content: \"\\f18d\";}\n\ -.fa-arrow-circle-o-right:before {content: \"\\f18e\";}\n\ -.fa-arrow-circle-o-left:before {content: \"\\f190\";}\n\ -.fa-toggle-left:before, .fa-caret-square-o-left:before {content: \"\\f191\";}\n\ -.fa-dot-circle-o:before {content: \"\\f192\";}\n\ -.fa-wheelchair:before {content: \"\\f193\";}\n\ -.fa-vimeo-square:before {content: \"\\f194\";}\n\ -.fa-turkish-lira:before, .fa-try:before {content: \"\\f195\";}\n\ -.fa-plus-square-o:before {content: \"\\f196\";}\n\ -.fa-space-shuttle:before {content: \"\\f197\";}\n\ -.fa-slack:before {content: \"\\f198\";}\n\ -.fa-envelope-square:before {content: \"\\f199\";}\n\ -.fa-wordpress:before {content: \"\\f19a\";}\n\ -.fa-openid:before {content: \"\\f19b\";}\n\ -.fa-institution:before, .fa-bank:before, .fa-university:before {content: \"\\f19c\";}\n\ -.fa-mortar-board:before, .fa-graduation-cap:before {content: \"\\f19d\";}\n\ -.fa-yahoo:before {content: \"\\f19e\";}\n\ -.fa-google:before {content: \"\\f1a0\";}\n\ -.fa-reddit:before {content: \"\\f1a1\";}\n\ -.fa-reddit-square:before {content: \"\\f1a2\";}\n\ -.fa-stumbleupon-circle:before {content: \"\\f1a3\";}\n\ -.fa-stumbleupon:before {content: \"\\f1a4\";}\n\ -.fa-delicious:before {content: \"\\f1a5\";}\n\ -.fa-digg:before {content: \"\\f1a6\";}\n\ -.fa-pied-piper-pp:before {content: \"\\f1a7\";}\n\ -.fa-pied-piper-alt:before {content: \"\\f1a8\";}\n\ -.fa-drupal:before {content: \"\\f1a9\";}\n\ -.fa-joomla:before {content: \"\\f1aa\";}\n\ -.fa-language:before {content: \"\\f1ab\";}\n\ -.fa-fax:before {content: \"\\f1ac\";}\n\ -.fa-building:before {content: \"\\f1ad\";}\n\ -.fa-child:before {content: \"\\f1ae\";}\n\ -.fa-paw:before {content: \"\\f1b0\";}\n\ -.fa-spoon:before {content: \"\\f1b1\";}\n\ -.fa-cube:before {content: \"\\f1b2\";}\n\ -.fa-cubes:before {content: \"\\f1b3\";}\n\ -.fa-behance:before {content: \"\\f1b4\";}\n\ -.fa-behance-square:before {content: \"\\f1b5\";}\n\ -.fa-steam:before {content: \"\\f1b6\";}\n\ -.fa-steam-square:before {content: \"\\f1b7\";}\n\ -.fa-recycle:before {content: \"\\f1b8\";}\n\ -.fa-automobile:before, .fa-car:before {content: \"\\f1b9\";}\n\ -.fa-cab:before, .fa-taxi:before {content: \"\\f1ba\";}\n\ -.fa-tree:before {content: \"\\f1bb\";}\n\ -.fa-spotify:before {content: \"\\f1bc\";}\n\ -.fa-deviantart:before {content: \"\\f1bd\";}\n\ -.fa-soundcloud:before {content: \"\\f1be\";}\n\ -.fa-database:before {content: \"\\f1c0\";}\n\ -.fa-file-pdf-o:before {content: \"\\f1c1\";}\n\ -.fa-file-word-o:before {content: \"\\f1c2\";}\n\ -.fa-file-excel-o:before {content: \"\\f1c3\";}\n\ -.fa-file-powerpoint-o:before {content: \"\\f1c4\";}\n\ -.fa-file-photo-o:before, .fa-file-picture-o:before, .fa-file-image-o:before {content: \"\\f1c5\";}\n\ -.fa-file-zip-o:before, .fa-file-archive-o:before {content: \"\\f1c6\";}\n\ -.fa-file-sound-o:before, .fa-file-audio-o:before {content: \"\\f1c7\";}\n\ -.fa-file-movie-o:before, .fa-file-video-o:before {content: \"\\f1c8\";}\n\ -.fa-file-code-o:before {content: \"\\f1c9\";}\n\ -.fa-vine:before {content: \"\\f1ca\";}\n\ -.fa-codepen:before {content: \"\\f1cb\";}\n\ -.fa-jsfiddle:before {content: \"\\f1cc\";}\n\ -.fa-life-bouy:before, .fa-life-buoy:before, .fa-life-saver:before, .fa-support:before, .fa-life-ring:before {content: \"\\f1cd\";}\n\ -.fa-circle-o-notch:before {content: \"\\f1ce\";}\n\ -.fa-ra:before, .fa-resistance:before, .fa-rebel:before {content: \"\\f1d0\";}\n\ -.fa-ge:before, .fa-empire:before {content: \"\\f1d1\";}\n\ -.fa-git-square:before {content: \"\\f1d2\";}\n\ -.fa-git:before {content: \"\\f1d3\";}\n\ -.fa-y-combinator-square:before, .fa-yc-square:before, .fa-hacker-news:before {content: \"\\f1d4\";}\n\ -.fa-tencent-weibo:before {content: \"\\f1d5\";}\n\ -.fa-qq:before {content: \"\\f1d6\";}\n\ -.fa-wechat:before, .fa-weixin:before {content: \"\\f1d7\";}\n\ -.fa-send:before, .fa-paper-plane:before {content: \"\\f1d8\";}\n\ -.fa-send-o:before, .fa-paper-plane-o:before {content: \"\\f1d9\";}\n\ -.fa-history:before {content: \"\\f1da\";}\n\ -.fa-circle-thin:before {content: \"\\f1db\";}\n\ -.fa-header:before {content: \"\\f1dc\";}\n\ -.fa-paragraph:before {content: \"\\f1dd\";}\n\ -.fa-sliders:before {content: \"\\f1de\";}\n\ -.fa-share-alt:before {content: \"\\f1e0\";}\n\ -.fa-share-alt-square:before {content: \"\\f1e1\";}\n\ -.fa-bomb:before {content: \"\\f1e2\";}\n\ -.fa-soccer-ball-o:before, .fa-futbol-o:before {content: \"\\f1e3\";}\n\ -.fa-tty:before {content: \"\\f1e4\";}\n\ -.fa-binoculars:before {content: \"\\f1e5\";}\n\ -.fa-plug:before {content: \"\\f1e6\";}\n\ -.fa-slideshare:before {content: \"\\f1e7\";}\n\ -.fa-twitch:before {content: \"\\f1e8\";}\n\ -.fa-yelp:before {content: \"\\f1e9\";}\n\ -.fa-newspaper-o:before {content: \"\\f1ea\";}\n\ -.fa-wifi:before {content: \"\\f1eb\";}\n\ -.fa-calculator:before {content: \"\\f1ec\";}\n\ -.fa-paypal:before {content: \"\\f1ed\";}\n\ -.fa-google-wallet:before {content: \"\\f1ee\";}\n\ -.fa-cc-visa:before {content: \"\\f1f0\";}\n\ -.fa-cc-mastercard:before {content: \"\\f1f1\";}\n\ -.fa-cc-discover:before {content: \"\\f1f2\";}\n\ -.fa-cc-amex:before {content: \"\\f1f3\";}\n\ -.fa-cc-paypal:before {content: \"\\f1f4\";}\n\ -.fa-cc-stripe:before {content: \"\\f1f5\";}\n\ -.fa-bell-slash:before {content: \"\\f1f6\";}\n\ -.fa-bell-slash-o:before {content: \"\\f1f7\";}\n\ -.fa-trash:before {content: \"\\f1f8\";}\n\ -.fa-copyright:before {content: \"\\f1f9\";}\n\ -.fa-at:before {content: \"\\f1fa\";}\n\ -.fa-eyedropper:before {content: \"\\f1fb\";}\n\ -.fa-paint-brush:before {content: \"\\f1fc\";}\n\ -.fa-birthday-cake:before {content: \"\\f1fd\";}\n\ -.fa-area-chart:before {content: \"\\f1fe\";}\n\ -.fa-pie-chart:before {content: \"\\f200\";}\n\ -.fa-line-chart:before {content: \"\\f201\";}\n\ -.fa-lastfm:before {content: \"\\f202\";}\n\ -.fa-lastfm-square:before {content: \"\\f203\";}\n\ -.fa-toggle-off:before {content: \"\\f204\";}\n\ -.fa-toggle-on:before {content: \"\\f205\";}\n\ -.fa-bicycle:before {content: \"\\f206\";}\n\ -.fa-bus:before {content: \"\\f207\";}\n\ -.fa-ioxhost:before {content: \"\\f208\";}\n\ -.fa-angellist:before {content: \"\\f209\";}\n\ -.fa-cc:before {content: \"\\f20a\";}\n\ -.fa-shekel:before, .fa-sheqel:before, .fa-ils:before {content: \"\\f20b\";}\n\ -.fa-meanpath:before {content: \"\\f20c\";}\n\ -.fa-buysellads:before {content: \"\\f20d\";}\n\ -.fa-connectdevelop:before {content: \"\\f20e\";}\n\ -.fa-dashcube:before {content: \"\\f210\";}\n\ -.fa-forumbee:before {content: \"\\f211\";}\n\ -.fa-leanpub:before {content: \"\\f212\";}\n\ -.fa-sellsy:before {content: \"\\f213\";}\n\ -.fa-shirtsinbulk:before {content: \"\\f214\";}\n\ -.fa-simplybuilt:before {content: \"\\f215\";}\n\ -.fa-skyatlas:before {content: \"\\f216\";}\n\ -.fa-cart-plus:before {content: \"\\f217\";}\n\ -.fa-cart-arrow-down:before {content: \"\\f218\";}\n\ -.fa-diamond:before {content: \"\\f219\";}\n\ -.fa-ship:before {content: \"\\f21a\";}\n\ -.fa-user-secret:before {content: \"\\f21b\";}\n\ -.fa-motorcycle:before {content: \"\\f21c\";}\n\ -.fa-street-view:before {content: \"\\f21d\";}\n\ -.fa-heartbeat:before {content: \"\\f21e\";}\n\ -.fa-venus:before {content: \"\\f221\";}\n\ -.fa-mars:before {content: \"\\f222\";}\n\ -.fa-mercury:before {content: \"\\f223\";}\n\ -.fa-intersex:before, .fa-transgender:before {content: \"\\f224\";}\n\ -.fa-transgender-alt:before {content: \"\\f225\";}\n\ -.fa-venus-double:before {content: \"\\f226\";}\n\ -.fa-mars-double:before {content: \"\\f227\";}\n\ -.fa-venus-mars:before {content: \"\\f228\";}\n\ -.fa-mars-stroke:before {content: \"\\f229\";}\n\ -.fa-mars-stroke-v:before {content: \"\\f22a\";}\n\ -.fa-mars-stroke-h:before {content: \"\\f22b\";}\n\ -.fa-neuter:before {content: \"\\f22c\";}\n\ -.fa-genderless:before {content: \"\\f22d\";}\n\ -.fa-facebook-official:before {content: \"\\f230\";}\n\ -.fa-pinterest-p:before {content: \"\\f231\";}\n\ -.fa-whatsapp:before {content: \"\\f232\";}\n\ -.fa-server:before {content: \"\\f233\";}\n\ -.fa-user-plus:before {content: \"\\f234\";}\n\ -.fa-user-times:before {content: \"\\f235\";}\n\ -.fa-hotel:before, .fa-bed:before {content: \"\\f236\";}\n\ -.fa-viacoin:before {content: \"\\f237\";}\n\ -.fa-train:before {content: \"\\f238\";}\n\ -.fa-subway:before {content: \"\\f239\";}\n\ -.fa-medium:before {content: \"\\f23a\";}\n\ -.fa-yc:before, .fa-y-combinator:before {content: \"\\f23b\";}\n\ -.fa-optin-monster:before {content: \"\\f23c\";}\n\ -.fa-opencart:before {content: \"\\f23d\";}\n\ -.fa-expeditedssl:before {content: \"\\f23e\";}\n\ -.fa-battery-4:before, .fa-battery:before, .fa-battery-full:before {content: \"\\f240\";}\n\ -.fa-battery-3:before, .fa-battery-three-quarters:before {content: \"\\f241\";}\n\ -.fa-battery-2:before, .fa-battery-half:before {content: \"\\f242\";}\n\ -.fa-battery-1:before, .fa-battery-quarter:before {content: \"\\f243\";}\n\ -.fa-battery-0:before, .fa-battery-empty:before {content: \"\\f244\";}\n\ -.fa-mouse-pointer:before {content: \"\\f245\";}\n\ -.fa-i-cursor:before {content: \"\\f246\";}\n\ -.fa-object-group:before {content: \"\\f247\";}\n\ -.fa-object-ungroup:before {content: \"\\f248\";}\n\ -.fa-sticky-note:before {content: \"\\f249\";}\n\ -.fa-sticky-note-o:before {content: \"\\f24a\";}\n\ -.fa-cc-jcb:before {content: \"\\f24b\";}\n\ -.fa-cc-diners-club:before {content: \"\\f24c\";}\n\ -.fa-clone:before {content: \"\\f24d\";}\n\ -.fa-balance-scale:before {content: \"\\f24e\";}\n\ -.fa-hourglass-o:before {content: \"\\f250\";}\n\ -.fa-hourglass-1:before, .fa-hourglass-start:before {content: \"\\f251\";}\n\ -.fa-hourglass-2:before, .fa-hourglass-half:before {content: \"\\f252\";}\n\ -.fa-hourglass-3:before, .fa-hourglass-end:before {content: \"\\f253\";}\n\ -.fa-hourglass:before {content: \"\\f254\";}\n\ -.fa-hand-grab-o:before, .fa-hand-rock-o:before {content: \"\\f255\";}\n\ -.fa-hand-stop-o:before, .fa-hand-paper-o:before {content: \"\\f256\";}\n\ -.fa-hand-scissors-o:before {content: \"\\f257\";}\n\ -.fa-hand-lizard-o:before {content: \"\\f258\";}\n\ -.fa-hand-spock-o:before {content: \"\\f259\";}\n\ -.fa-hand-pointer-o:before {content: \"\\f25a\";}\n\ -.fa-hand-peace-o:before {content: \"\\f25b\";}\n\ -.fa-trademark:before {content: \"\\f25c\";}\n\ -.fa-registered:before {content: \"\\f25d\";}\n\ -.fa-creative-commons:before {content: \"\\f25e\";}\n\ -.fa-gg:before {content: \"\\f260\";}\n\ -.fa-gg-circle:before {content: \"\\f261\";}\n\ -.fa-tripadvisor:before {content: \"\\f262\";}\n\ -.fa-odnoklassniki:before {content: \"\\f263\";}\n\ -.fa-odnoklassniki-square:before {content: \"\\f264\";}\n\ -.fa-get-pocket:before {content: \"\\f265\";}\n\ -.fa-wikipedia-w:before {content: \"\\f266\";}\n\ -.fa-safari:before {content: \"\\f267\";}\n\ -.fa-chrome:before {content: \"\\f268\";}\n\ -.fa-firefox:before {content: \"\\f269\";}\n\ -.fa-opera:before {content: \"\\f26a\";}\n\ -.fa-internet-explorer:before {content: \"\\f26b\";}\n\ -.fa-tv:before, .fa-television:before {content: \"\\f26c\";}\n\ -.fa-contao:before {content: \"\\f26d\";}\n\ -.fa-500px:before {content: \"\\f26e\";}\n\ -.fa-amazon:before {content: \"\\f270\";}\n\ -.fa-calendar-plus-o:before {content: \"\\f271\";}\n\ -.fa-calendar-minus-o:before {content: \"\\f272\";}\n\ -.fa-calendar-times-o:before {content: \"\\f273\";}\n\ -.fa-calendar-check-o:before {content: \"\\f274\";}\n\ -.fa-industry:before {content: \"\\f275\";}\n\ -.fa-map-pin:before {content: \"\\f276\";}\n\ -.fa-map-signs:before {content: \"\\f277\";}\n\ -.fa-map-o:before {content: \"\\f278\";}\n\ -.fa-map:before {content: \"\\f279\";}\n\ -.fa-commenting:before {content: \"\\f27a\";}\n\ -.fa-commenting-o:before {content: \"\\f27b\";}\n\ -.fa-houzz:before {content: \"\\f27c\";}\n\ -.fa-vimeo:before {content: \"\\f27d\";}\n\ -.fa-black-tie:before {content: \"\\f27e\";}\n\ -.fa-fonticons:before {content: \"\\f280\";}\n\ -.fa-reddit-alien:before {content: \"\\f281\";}\n\ -.fa-edge:before {content: \"\\f282\";}\n\ -.fa-credit-card-alt:before {content: \"\\f283\";}\n\ -.fa-codiepie:before {content: \"\\f284\";}\n\ -.fa-modx:before {content: \"\\f285\";}\n\ -.fa-fort-awesome:before {content: \"\\f286\";}\n\ -.fa-usb:before {content: \"\\f287\";}\n\ -.fa-product-hunt:before {content: \"\\f288\";}\n\ -.fa-mixcloud:before {content: \"\\f289\";}\n\ -.fa-scribd:before {content: \"\\f28a\";}\n\ -.fa-pause-circle:before {content: \"\\f28b\";}\n\ -.fa-pause-circle-o:before {content: \"\\f28c\";}\n\ -.fa-stop-circle:before {content: \"\\f28d\";}\n\ -.fa-stop-circle-o:before {content: \"\\f28e\";}\n\ -.fa-shopping-bag:before {content: \"\\f290\";}\n\ -.fa-shopping-basket:before {content: \"\\f291\";}\n\ -.fa-hashtag:before {content: \"\\f292\";}\n\ -.fa-bluetooth:before {content: \"\\f293\";}\n\ -.fa-bluetooth-b:before {content: \"\\f294\";}\n\ -.fa-percent:before {content: \"\\f295\";}\n\ -.fa-gitlab:before {content: \"\\f296\";}\n\ -.fa-wpbeginner:before {content: \"\\f297\";}\n\ -.fa-wpforms:before {content: \"\\f298\";}\n\ -.fa-envira:before {content: \"\\f299\";}\n\ -.fa-universal-access:before {content: \"\\f29a\";}\n\ -.fa-wheelchair-alt:before {content: \"\\f29b\";}\n\ -.fa-question-circle-o:before {content: \"\\f29c\";}\n\ -.fa-blind:before {content: \"\\f29d\";}\n\ -.fa-audio-description:before {content: \"\\f29e\";}\n\ -.fa-volume-control-phone:before {content: \"\\f2a0\";}\n\ -.fa-braille:before {content: \"\\f2a1\";}\n\ -.fa-assistive-listening-systems:before {content: \"\\f2a2\";}\n\ -.fa-asl-interpreting:before, .fa-american-sign-language-interpreting:before {content: \"\\f2a3\";}\n\ -.fa-deafness:before, .fa-hard-of-hearing:before, .fa-deaf:before {content: \"\\f2a4\";}\n\ -.fa-glide:before {content: \"\\f2a5\";}\n\ -.fa-glide-g:before {content: \"\\f2a6\";}\n\ -.fa-signing:before, .fa-sign-language:before {content: \"\\f2a7\";}\n\ -.fa-low-vision:before {content: \"\\f2a8\";}\n\ -.fa-viadeo:before {content: \"\\f2a9\";}\n\ -.fa-viadeo-square:before {content: \"\\f2aa\";}\n\ -.fa-snapchat:before {content: \"\\f2ab\";}\n\ -.fa-snapchat-ghost:before {content: \"\\f2ac\";}\n\ -.fa-snapchat-square:before {content: \"\\f2ad\";}\n\ -.fa-pied-piper:before {content: \"\\f2ae\";}\n\ -.fa-first-order:before {content: \"\\f2b0\";}\n\ -.fa-yoast:before {content: \"\\f2b1\";}\n\ -.fa-themeisle:before {content: \"\\f2b2\";}\n\ -.fa-google-plus-circle:before, .fa-google-plus-official:before {content: \"\\f2b3\";}\n\ -.fa-fa:before, .fa-font-awesome:before {content: \"\\f2b4\";}\n\ -.fa-handshake-o:before {content: \"\\f2b5\";}\n\ -.fa-envelope-open:before {content: \"\\f2b6\";}\n\ -.fa-envelope-open-o:before {content: \"\\f2b7\";}\n\ -.fa-linode:before {content: \"\\f2b8\";}\n\ -.fa-address-book:before {content: \"\\f2b9\";}\n\ -.fa-address-book-o:before {content: \"\\f2ba\";}\n\ -.fa-vcard:before, .fa-address-card:before {content: \"\\f2bb\";}\n\ -.fa-vcard-o:before, .fa-address-card-o:before {content: \"\\f2bc\";}\n\ -.fa-user-circle:before {content: \"\\f2bd\";}\n\ -.fa-user-circle-o:before {content: \"\\f2be\";}\n\ -.fa-user-o:before {content: \"\\f2c0\";}\n\ -.fa-id-badge:before {content: \"\\f2c1\";}\n\ -.fa-drivers-license:before, .fa-id-card:before {content: \"\\f2c2\";}\n\ -.fa-drivers-license-o:before, .fa-id-card-o:before {content: \"\\f2c3\";}\n\ -.fa-quora:before {content: \"\\f2c4\";}\n\ -.fa-free-code-camp:before {content: \"\\f2c5\";}\n\ -.fa-telegram:before {content: \"\\f2c6\";}\n\ -.fa-thermometer-4:before, .fa-thermometer:before, .fa-thermometer-full:before {content: \"\\f2c7\";}\n\ -.fa-thermometer-3:before, .fa-thermometer-three-quarters:before {content: \"\\f2c8\";}\n\ -.fa-thermometer-2:before, .fa-thermometer-half:before {content: \"\\f2c9\";}\n\ -.fa-thermometer-1:before, .fa-thermometer-quarter:before {content: \"\\f2ca\";}\n\ -.fa-thermometer-0:before, .fa-thermometer-empty:before {content: \"\\f2cb\";}\n\ -.fa-shower:before {content: \"\\f2cc\";}\n\ -.fa-bathtub:before, .fa-s15:before, .fa-bath:before {content: \"\\f2cd\";}\n\ -.fa-podcast:before {content: \"\\f2ce\";}\n\ -.fa-window-maximize:before {content: \"\\f2d0\";}\n\ -.fa-window-minimize:before {content: \"\\f2d1\";}\n\ -.fa-window-restore:before {content: \"\\f2d2\";}\n\ -.fa-times-rectangle:before, .fa-window-close:before {content: \"\\f2d3\";}\n\ -.fa-times-rectangle-o:before, .fa-window-close-o:before {content: \"\\f2d4\";}\n\ -.fa-bandcamp:before {content: \"\\f2d5\";}\n\ -.fa-grav:before {content: \"\\f2d6\";}\n\ -.fa-etsy:before {content: \"\\f2d7\";}\n\ -.fa-imdb:before {content: \"\\f2d8\";}\n\ -.fa-ravelry:before {content: \"\\f2d9\";}\n\ -.fa-eercast:before {content: \"\\f2da\";}\n\ -.fa-microchip:before {content: \"\\f2db\";}\n\ -.fa-snowflake-o:before {content: \"\\f2dc\";}\n\ -.fa-superpowers:before {content: \"\\f2dd\";}\n\ -.fa-wpexplorer:before {content: \"\\f2de\";}\n\ -.fa-meetup:before {content: \"\\f2e0\";}\n\ -.fa::before {\n\ - font-family: FontAwesome;\n\ - font-weight: 400;\n\ - font-style: normal;\n\ - -webkit-font-smoothing: antialiased;\n\ - text-decoration: inherit;\n\ - speak: none;\n\ - display: inline-block;\n\ - font-size: 13px;\n\ - visibility: visible;\n\ -}\n\ -:root:not(.shortcut-icons) #shortcuts .fa::before {\n\ - display: none;\n\ -}\n\ -:root.shortcut-icons #shortcuts .fa::before {\n\ - font-size: 15px !important;\n\ - margin-top: -3px !important;\n\ - position: relative;\n\ - top: 1px;\n\ -}\n\ -:root.shortcut-icons #shortcuts .fa, .menu-button .fa {\n\ - font-size: 0;\n\ - visibility: hidden;\n\ -}\n\ -:root.shortcut-icons .shortcut.brackets-wrap::after,\n\ -:root.shortcut-icons .shortcut.brackets-wrap::before {\n\ - display: none;\n\ -}\n\ -:root.shortcut-icons #shortcuts a .fa,\n\ -.menu-button .fa,\n\ -.hide-reply-button .fa,\n\ -.hide-thread-button .fa {\n\ - display: inline;\n\ -}\n\ -.fa-spin::before {\n\ - -webkit-animation:spin 2s infinite linear;\n\ - -moz-animation:spin 2s infinite linear;\n\ - -o-animation:spin 2s infinite linear;\n\ - animation:spin 2s infinite linear;\n\ -}\n\ -@-moz-keyframes spin {\n\ - 0% {-moz-transform:rotate(0deg);}\n\ - 100% {-moz-transform:rotate(359deg);}\n\ -}\n\ -@-webkit-keyframes spin {\n\ - 0% {-webkit-transform:rotate(0deg);}\n\ - 100% {-webkit-transform:rotate(359deg);}\n\ -}\n\ -@keyframes spin {\n\ - 0% {transform:rotate(0deg);}\n\ - 100% {transform:rotate(359deg);}\n\ -}\n\ -/* General */\n\ -.dialog {\n\ - border: 1px solid;\n\ - display: block;\n\ - background-color: inherit;\n\ -}\n\ -.dialog:not(#qr):not(#thread-watcher):not(#header-bar) {\n\ - box-shadow: 0 1px 2px rgba(0, 0, 0, .15);\n\ -}\n\ -#qr,\n\ -#thread-watcher {\n\ - box-shadow: -1px 2px 2px rgba(0, 0, 0, 0.25);\n\ -}\n\ -.captcha-img,\n\ -.field {\n\ - background-color: #FFF;\n\ - border: 1px solid #CCC;\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ - color: #333;\n\ - font: 13px sans-serif;\n\ - outline: none;\n\ - transition: color .25s, border-color .25s;\n\ -}\n\ -.field::-moz-placeholder {\n\ - color: #AAA;\n\ - font-size: 13px;\n\ - opacity: 1;\n\ -}\n\ -.captch-img:hover,\n\ -.field:hover {\n\ - border-color: #999;\n\ -}\n\ -.field:hover, .field:focus, .field.focus {\n\ - color: #000;\n\ -}\n\ -.field[disabled] {\n\ - background-color: #F2F2F2;\n\ - color: #888;\n\ -}\n\ -.field::-webkit-search-decoration {\n\ - display: none;\n\ -}\n\ -.move {\n\ - cursor: move;\n\ - overflow: hidden;\n\ -}\n\ -label {\n\ - cursor: pointer;\n\ -}\n\ -a[href=\"javascript:;\"] {\n\ - text-decoration: none;\n\ -}\n\ -.warning {\n\ - color: red;\n\ -}\n\ -:root.sw-yotsuba #boardNavDesktop, :root.sw-yotsuba #boardNavMobile {\n\ - display: none !important;\n\ -}\n\ -:root.hide-bottom-board-list $site$boardListBottom {\n\ - display: none;\n\ -}\n\ -body.hasDropDownNav{\n\ - margin-top: 5px;\n\ -}\n\ -:root:not(.keyboard-focus) a {\n\ - outline: none;\n\ -}\n\ -.painted {\n\ - border-radius: 3px;\n\ - padding: 0px 2px;\n\ -}\n\ -[hidden] {\n\ - display: none !important;\n\ -}\n\ -/* 4chan style fixes */\n\ -/* overrides 4chan CSS on div.opContainer, div.op */\n\ -:root.sw-yotsuba .opContainer, :root.sw-yotsuba .op {\n\ - display: block;\n\ - overflow: visible;\n\ -}\n\ -:root.sw-yotsuba .reply > .file > .fileText {\n\ - margin: 0 20px;\n\ -}\n\ -:root.sw-yotsuba #arc-list span.quote {\n\ - color: #789922;\n\ -}\n\ -:root.sw-yotsuba .fileText a {\n\ - unicode-bidi: -moz-isolate;\n\ - unicode-bidi: -webkit-isolate;\n\ -}\n\ -:root.sw-yotsuba #g-recaptcha {\n\ - min-height: 78px;\n\ - height: auto;\n\ -}\n\ -:root.sw-yotsuba:not(.js-enabled) #postForm {\n\ - display: table;\n\ -}\n\ -:root.sw-yotsuba #captchaContainerAlt td:nth-child(2) {\n\ - display: table-cell !important;\n\ -}\n\ -:root.sw-yotsuba canvas#tegaki-canvas {\n\ - background: none;\n\ -}\n\ -/* Disable obnoxious captcha fade-in. */\n\ -:root.sw-yotsuba > body > div:last-of-type {\n\ - transition: none !important;\n\ -}\n\ -/* Fix captcha scrolling to top of page. */\n\ -:root.sw-yotsuba > body > div[style*=\" top: -10000px;\"] {\n\ - visibility: hidden !important;\n\ -}\n\ -/* Make long filenames wrap properly: https://github.com/ccd0/4chan-x/issues/1082 */\n\ -:root.sw-yotsuba .post > .file {\n\ - /* currently nonstandard but may be added: https://lists.w3.org/Archives/Public/www-style/2016Mar/0352.html, https://bugzilla.mozilla.org/show_bug.cgi?id=1296042 */\n\ - word-break: break-word;\n\ -}\n\ -:root.sw-yotsuba:not(.ua-webkit):not(.ua-blink) .fileText {\n\ - word-wrap: break-word;\n\ - max-width: calc(100vw - 90px);\n\ -}\n\ -:root.sw-yotsuba > body.is_catalog .thread > a > img {\n\ - display: inline-block;\n\ -}\n\ -/* Links to NSFW boards */\n\ -:root.sw-yotsuba .nwsb {\n\ - display: inline;\n\ -}\n\ -:root.sw-yotsuba .fileText {\n\ - max-width: auto;\n\ - white-space: normal;\n\ -}\n\ -/* Ads */\n\ -:root.sw-yotsuba .ad-cnt > *, :root.sw-yotsuba .adg-rects > *, :root.sw-yotsuba .bsa-cnt {\n\ - height: auto !important;\n\ -}\n\ -:root.sw-yotsuba:not(.ads-loaded) hr.abovePostForm,\n\ -:root.sw-yotsuba:not(.ads-loaded) .adg-rects > hr,\n\ -:root.sw-yotsuba #adg-ol + hr,\n\ -:root.sw-yotsuba .danbo-slot:empty {\n\ - display: none;\n\ -}\n\ -:root.sw-yotsuba .adg-rects {\n\ - margin: 0;\n\ - font-size: 0;\n\ -}\n\ -:root.sw-yotsuba div.center[style] {\n\ - display: none !important;\n\ -}\n\ -/* Tinyboard / vichan conflicts */\n\ -#menu > .hide-thread-link {\n\ - width: auto;\n\ - height: auto;\n\ - overflow: visible;\n\ - background-image: none;\n\ -}\n\ -#menu label.entry {\n\ - display: block;\n\ -}\n\ -#fourchanx-settings label {\n\ - display: inline;\n\ -}\n\ -.intro a[href=\"javascript:;\"],\n\ -#menu a {\n\ - margin: 0;\n\ -}\n\ -.gal-buttons.gal-buttons a {\n\ - font-size: inherit;\n\ -}\n\ -:root.sw-tinyboard.fixed.top-header:not(.autohide) .boardlist,\n\ -:root.sw-tinyboard.fixed.top-header:not(.autohide) .bar.top {\n\ - position: static;\n\ -}\n\ -:root.sw-tinyboard.fixed.top-header:not(.autohide) div.pages.top {\n\ - top: auto;\n\ - bottom: 0;\n\ -}\n\ -:root.sw-tinyboard.fixed.top-header.autohide .boardlist,\n\ -:root.sw-tinyboard.fixed.top-header.autohide .bar.top {\n\ - z-index: 3;\n\ -}\n\ -/* Tinyboard site style conflicts */\n\ -:root[data-host=\"fufufu.moe\"].fixed.top-header:not(.autohide) div.pages.top {\n\ - top: 26px;\n\ - bottom: auto;\n\ -}\n\ -:root[data-host=\"merorin.com\"].fixed.top-header:not(.autohide) span.settings {\n\ - top: 26px;\n\ -}\n\ -:root[data-host=\"fufufu.moe\"]:not(.fixed) #header-bar {\n\ - margin-top: 38px;\n\ -}\n\ -:root[data-host=\"lainchan.org\"]:not(.fixed) #header-bar {\n\ - margin-top: 17px;\n\ -}\n\ -:root[data-host=\"smuglo.li\"]:not(.fixed) #header-bar {\n\ - margin-top: 8px;\n\ -}\n\ -/* Anti-autoplay */\n\ -audio.controls-added {\n\ - display: block;\n\ - margin: auto;\n\ - white-space: normal;\n\ -}\n\ -:root.anti-autoplay div.embed {\n\ - position: static;\n\ - width: auto;\n\ - height: auto;\n\ - text-align: center;\n\ -}\n\ -:root.anti-autoplay .autoplay-removed {\n\ - visibility: visible !important;\n\ - min-width: 640px;\n\ - min-height: 360px;\n\ -}\n\ -/* fixed, z-index */\n\ -#overlay,\n\ -#qp, #ihover,\n\ -#navlinks, .fixed #header-bar,\n\ -:root.float #updater,\n\ -:root.float #thread-stats,\n\ -#qr {\n\ - position: fixed;\n\ -}\n\ -#overlay {\n\ - z-index: 999;\n\ -}\n\ -#qp, #ihover {\n\ - z-index: 60;\n\ -}\n\ -#menu, .gal-buttons {\n\ - z-index: 50;\n\ -}\n\ -#updater, #thread-stats {\n\ - z-index: 40;\n\ -}\n\ -:root.fixed #header-bar, #notifications {\n\ - z-index: 35;\n\ -}\n\ -#a-gallery {\n\ - z-index: 30;\n\ -}\n\ -#navlinks {\n\ - z-index: 25;\n\ -}\n\ -#qr {\n\ - z-index: 20;\n\ -}\n\ -#embedding {\n\ - z-index: 11;\n\ -}\n\ -:root.fixed-watcher #thread-watcher {\n\ - z-index: 10;\n\ -}\n\ -:root.fixed:not(.gallery-open) #header-bar:not(:hover) {\n\ - z-index: 8;\n\ -}\n\ -#thread-watcher {\n\ - z-index: 5;\n\ -}\n\ -/* Header */\n\ -.fixed.top-header body {\n\ - padding-top: 2em;\n\ -}\n\ -.fixed.bottom-header body {\n\ - padding-bottom: 2em;\n\ -}\n\ -.fixed #header-bar {\n\ - right: 0;\n\ - left: 0;\n\ - padding: 3px 4px 4px;\n\ - font-size: 12px;\n\ -}\n\ -.fixed.top-header #header-bar {\n\ - top: 0;\n\ -}\n\ -.fixed.bottom-header #header-bar {\n\ - bottom: 0;\n\ -}\n\ -#header-bar {\n\ - border-width: 0;\n\ - transition: all .1s .05s ease-in-out;\n\ -}\n\ -:root.fixed #header-bar {\n\ - box-shadow: -5px 1px 10px rgba(0, 0, 0, 0.20);\n\ -}\n\ -:root.centered-links #shortcuts {\n\ - width: 300px;\n\ - text-align: right;\n\ -}\n\ -:root.centered-links #header-bar {\n\ - text-align: center;\n\ -}\n\ -#custom-board-list {\n\ - font-size: 13px;\n\ - vertical-align: middle;\n\ -}\n\ -#full-board-list {\n\ - vertical-align: middle;\n\ -}\n\ -:root.centered-links #custom-board-list {\n\ - position: relative;\n\ - left: 150px;\n\ -}\n\ -.fixed.top-header #header-bar {\n\ - border-bottom-width: 1px;\n\ -}\n\ -.fixed.bottom-header #header-bar {\n\ - box-shadow: 0 -1px 2px rgba(0, 0, 0, .15);\n\ - border-top-width: 1px;\n\ -}\n\ -.fixed.bottom-header #header-bar .menu-button i {\n\ - border-top: none;\n\ - border-bottom: 6px solid;\n\ -}\n\ -.fixed #header-bar.autohide:not(:hover) {\n\ - box-shadow: none;\n\ - transition: all .8s .6s cubic-bezier(.55, .055, .675, .19);\n\ -}\n\ -.fixed.top-header #header-bar.autohide:not(:hover) {\n\ - margin-bottom: -1em;\n\ - -webkit-transform: translateY(-100%);\n\ - transform: translateY(-100%);\n\ -}\n\ -.fixed.bottom-header #header-bar.autohide:not(:hover) {\n\ - -webkit-transform: translateY(100%);\n\ - transform: translateY(100%);\n\ -}\n\ -#scroll-marker {\n\ - left: 0;\n\ - right: 0;\n\ - height: 10px;\n\ - position: absolute;\n\ -}\n\ -#header-bar:not(.autohide) #scroll-marker {\n\ - pointer-events: none;\n\ -}\n\ -#header-bar #scroll-marker {\n\ - display: none;\n\ -}\n\ -.fixed #header-bar #scroll-marker {\n\ - display: block;\n\ -}\n\ -.fixed.top-header #header-bar #scroll-marker {\n\ - top: 100%;\n\ -}\n\ -.fixed.bottom-header #header-bar #scroll-marker {\n\ - bottom: 100%;\n\ -}\n\ -#board-list a, #shortcuts a:not(.entry) {\n\ - text-decoration: none;\n\ - padding: 1px;\n\ -}\n\ -#shortcuts:empty {\n\ - display: none;\n\ -}\n\ -.brackets-wrap::before {\n\ - content: \"\\00a0[\";\n\ -}\n\ -.brackets-wrap::after {\n\ - content: \"]\\00a0\";\n\ -}\n\ -.dead-thread,\n\ -.disabled:not(.replies-quoting-you) {\n\ - opacity: .45;\n\ -}\n\ -#shortcuts {\n\ - float: right;\n\ -}\n\ -:root.autohiding-scrollbar #shortcuts {\n\ - margin-right: 12px;\n\ -}\n\ -.shortcut {\n\ - margin-left: 3px;\n\ - vertical-align: middle;\n\ -}\n\ -:root.shortcut-icons .native-settings {\n\ - font-size: 0;\n\ - color: transparent;\n\ - display: inline-block;\n\ - vertical-align: top;\n\ - height: 12px;\n\ - width: 14px;\n\ - background: url('//s.4cdn.org/image/favicon.ico') 0px -1px no-repeat;\n\ -}\n\ -#navbotright,\n\ -#navtopright {\n\ - display: none;\n\ -}\n\ -#toggleMsgBtn {\n\ - display: none !important;\n\ -}\n\ -.current,\n\ -:root.sw-yotsuba div#boardNavDesktopFoot a.current {\n\ - font-weight: bold;\n\ -}\n\ -@media (min-width: 1300px) {\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #header-bar {\n\ - white-space: nowrap;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: center;\n\ - align-items: center;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #board-list {\n\ - -webkit-flex: auto;\n\ - flex: auto;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list {\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) .hide-board-list-container {\n\ - -webkit-flex: none;\n\ - flex: none;\n\ - margin-right: 5px;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList {\n\ - -webkit-flex: auto;\n\ - flex: auto;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - width: 0px; /* XXX Fixes Edge not shrinking the board list below default size when needed */\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > a,\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span:not(.space):not(.spacer) {\n\ - -webkit-flex: none;\n\ - flex: none;\n\ - padding: .17em;\n\ - margin: -.17em -.32em;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span {\n\ - pointer-events: none;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span.space {\n\ - -webkit-flex: 0 .63 .63em;\n\ - flex: 0 .63 .63em;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span.spacer {\n\ - -webkit-flex: 0 .38 .38em;\n\ - flex: 0 .38 .38em;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #shortcuts {\n\ - float: initial;\n\ - -webkit-flex: none;\n\ - flex: none;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: center;\n\ - align-items: center;\n\ - }\n\ -}\n\ -/* 4chan X link brackets */\n\ -.brackets-wrap::before {\n\ - content: \"[\";\n\ -}\n\ -.brackets-wrap::after {\n\ - content: \"]\";\n\ -}\n\ -/* Notifications */\n\ -#notifications {\n\ - position: fixed;\n\ - top: 0;\n\ - height: 0;\n\ - text-align: center;\n\ - right: 0;\n\ - left: 0;\n\ - visibility: visible;\n\ -}\n\ -#notifications:empty {\n\ - display: none;\n\ -}\n\ -:root.fixed.top-header:not(.gallery-open) #header-bar #notifications,\n\ -:root.fixed.top-header #header-bar.autohide #notifications {\n\ - position: absolute;\n\ - top: 100%;\n\ -}\n\ -.notification {\n\ - color: #FFF;\n\ - font-weight: 700;\n\ - text-shadow: 0 1px 2px rgba(0, 0, 0, .5);\n\ - box-shadow: 0 1px 2px rgba(0, 0, 0, .15);\n\ - border-radius: 2px;\n\ - margin: 1px auto;\n\ - width: 550px;\n\ - max-width: 100%;\n\ - position: relative;\n\ - transition: all .25s ease-in-out;\n\ -}\n\ -.notification.error {\n\ - background-color: hsla(0, 100%, 38%, .9);\n\ -}\n\ -.notification.warning {\n\ - background-color: hsla(36, 100%, 38%, .9);\n\ -}\n\ -.notification.info {\n\ - background-color: hsla(200, 100%, 38%, .9);\n\ -}\n\ -.notification.success {\n\ - background-color: hsla(104, 100%, 38%, .9);\n\ -}\n\ -.notification a {\n\ - color: white;\n\ -}\n\ -.notification > .close {\n\ - padding: 7px;\n\ - top: 0px;\n\ - right: 5px;\n\ - position: absolute;\n\ -}\n\ -.notification > .fa-times::before {\n\ - font-size: 11px !important;\n\ -}\n\ -.message {\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ - padding: 6px 20px;\n\ - max-height: 200px;\n\ - width: 100%;\n\ - overflow: auto;\n\ - white-space: pre-line;\n\ -}\n\ -.message a {\n\ - text-decoration: underline;\n\ -}\n\ -:root.tainted .report-error {\n\ - display: none;\n\ -}\n\ -/* Settings */\n\ -:root.fourchan-x body {\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ -}\n\ -#overlay {\n\ - background-color: rgba(0, 0, 0, .5);\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - top: 0;\n\ - left: 0;\n\ - height: 100%;\n\ - width: 100%;\n\ -}\n\ -#fourchanx-settings {\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ - box-shadow: 0 0 15px rgba(0, 0, 0, .15);\n\ - height: 600px;\n\ - max-height: 100%;\n\ - width: 900px;\n\ - max-width: 100%;\n\ - margin: auto;\n\ - padding: 5px;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-flex-direction: column;\n\ - flex-direction: column;\n\ -}\n\ -#fourchanx-settings > nav {\n\ - padding: 2px 2px 8px;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ -}\n\ -#fourchanx-settings > nav a {\n\ - text-decoration: underline;\n\ -}\n\ -#fourchanx-settings > nav a.close {\n\ - text-decoration: none;\n\ - padding: 0 2px;\n\ - margin: 0;\n\ -}\n\ -.section-container {\n\ - -webkit-flex: 1;\n\ - flex: 1;\n\ - position: relative;\n\ - overflow: auto;\n\ - padding-right: 5px;\n\ - overscroll-behavior: contain;\n\ -}\n\ -.sections-list {\n\ - -webkit-flex: 1;\n\ - flex: 1;\n\ -}\n\ -.export, .import, .reset {\n\ - cursor: pointer;\n\ - text-decoration: none !important;\n\ -}\n\ -.tab-selected {\n\ - font-weight: 700;\n\ -}\n\ -.section-sauce ul,\n\ -.section-advanced ul {\n\ - list-style: none;\n\ - margin: 0;\n\ -}\n\ -.section-sauce ul {\n\ - padding: 8px;\n\ -}\n\ -.section-advanced ul {\n\ - padding: 0px;\n\ -}\n\ -.section-sauce li,\n\ -.section-advanced li {\n\ - padding-left: 4px;\n\ -}\n\ -.section-main ul {\n\ - margin: 0;\n\ - padding: 0 0 0 16px;\n\ -}\n\ -.section-main li {\n\ - white-space: pre-line;\n\ - list-style: disc;\n\ -}\n\ -.section-main li:not(:first-of-type) {\n\ - margin-top: 4px;\n\ -}\n\ -.section-main label {\n\ - text-decoration: underline;\n\ -}\n\ -div[data-checked=\"false\"] > .suboption-list {\n\ - display: none;\n\ -}\n\ -.suboption-list {\n\ - position: relative;\n\ -}\n\ -.suboption-list::before {\n\ - content: \"\";\n\ - display: inline-block;\n\ - position: absolute;\n\ - left: .7em;\n\ - width: 0;\n\ - height: 100%;\n\ - border-left: 1px solid;\n\ -}\n\ -.suboption-list > div {\n\ - position: relative;\n\ - padding-left: 1.4em;\n\ -}\n\ -.suboption-list > div::before {\n\ - content: \"\";\n\ - display: inline-block;\n\ - position: absolute;\n\ - left: .7em;\n\ - width: .7em;\n\ - height: .6em;\n\ - border-left: 1px solid;\n\ - border-bottom: 1px solid;\n\ -}\n\ -#fourchanx-settings .section-main p {\n\ - margin: .5em 0 0;\n\ -}\n\ -.section-filter ul {\n\ - padding: 0;\n\ -}\n\ -.section-filter li {\n\ - margin: 10px 40px;\n\ - list-style: disc;\n\ -}\n\ -.section-filter textarea {\n\ - height: 500px;\n\ -}\n\ -.section-main a, .section-filter a, .section-advanced a {\n\ - text-decoration: underline;\n\ -}\n\ -#sauce-doc-expand:not(:checked) ~ #sauce-doc {\n\ - max-height: 130px;\n\ - overflow: auto;\n\ -}\n\ -#sauce-doc > label {\n\ - float: right;\n\ - margin: 0 5px;\n\ -}\n\ -/* XXX for OneeChan */\n\ -#sauce-doc-expand + .riceCheck {\n\ - display: none;\n\ -}\n\ -.section-sauce textarea {\n\ - height: 430px;\n\ -}\n\ -.section-advanced .field[name=\"boardnav\"] {\n\ - width: 100%;\n\ -}\n\ -.section-advanced textarea {\n\ - height: 150px;\n\ -}\n\ -.section-advanced textarea[name=\"archiveLists\"],\n\ -.section-advanced textarea[name=\"externalCatalogURLs\"],\n\ -.section-advanced textarea[name=\"knownBanners\"] {\n\ - height: 75px;\n\ -}\n\ -.section-advanced .archive-cell {\n\ - min-width: 160px;\n\ - text-align: center;\n\ -}\n\ -.section-advanced #archive-board-select {\n\ - position: absolute;\n\ -}\n\ -.section-advanced .note {\n\ - font-size: 0.8em;\n\ - font-style: italic;\n\ - margin-left: 10px;\n\ -}\n\ -.section-advanced .note code {\n\ - font-style: normal;\n\ - font-size: 11px;\n\ -}\n\ -.favicon-preview > img {\n\ - vertical-align: middle;\n\ -}\n\ -.favicon-preview > img:nth-of-type(3n+1) {\n\ - margin-left: 4px;\n\ -}\n\ -.section-keybinds .field {\n\ - font-family: monospace;\n\ -}\n\ -#fourchanx-settings fieldset {\n\ - border: 1px solid;\n\ - border-radius: 3px;\n\ - padding: 0.35em 0.625em 0.75em;\n\ - margin: 0px 2px;\n\ -}\n\ -#fourchanx-settings legend {\n\ - font-weight: 700;\n\ - color: inherit;\n\ -}\n\ -#fourchanx-settings textarea {\n\ - font-family: monospace;\n\ - width: 100%;\n\ - resize: vertical;\n\ -}\n\ -#fourchanx-settings code {\n\ - color: #000;\n\ - background-color: #FFF;\n\ - padding: 0 2px;\n\ -}\n\ -#fourchanx-settings th {\n\ - text-align: center;\n\ - font-weight: bold;\n\ -}\n\ -#fourchanx-settings p {\n\ - margin: 1em 0px;\n\ -}\n\ -#fourchanx-settings table {\n\ - margin: auto;\n\ -}\n\ -/* Index */\n\ -:root.index-loading .navLinks:not(.json-index),\n\ -:root.index-loading .board:not(.json-index),\n\ -:root.index-loading .pagelist:not(.json-index),\n\ -:root.infinite-mode .pagelist,\n\ -:root.all-pages-mode .pagelist,\n\ -:root.catalog-mode .pagelist,\n\ -:root:not(.catalog-mode) .indexlink,\n\ -:root.catalog-mode .cataloglink,\n\ -:root:not(.catalog-mode) #hidden-label,\n\ -:root:not(.catalog-mode) #index-size {\n\ - display: none;\n\ -}\n\ -#index-search {\n\ - padding-right: 1.5em;\n\ - width: 100px;\n\ - transition: color .25s, border-color .25s, width .25s;\n\ -}\n\ -#index-search:focus,\n\ -#index-search[data-searching] {\n\ - width: 200px;\n\ -}\n\ -#index-search-clear {\n\ - color: gray;\n\ - display: inline-block;\n\ - position: relative;\n\ - left: -1em;\n\ - width: 0;\n\ -}\n\ -/* ``::-webkit-*'' selectors break selector lists on Firefox. */\n\ -#index-search::-webkit-search-cancel-button {\n\ - display: none;\n\ -}\n\ -#index-search:not([data-searching]) + #index-search-clear {\n\ - display: none;\n\ -}\n\ -#index-options {\n\ - float: right;\n\ -}\n\ -#lastlong-options {\n\ - display: inline-block;\n\ - vertical-align: middle;\n\ - height: 28px;\n\ - margin: -14px 0;\n\ -}\n\ -#lastlong-options > input {\n\ - padding: 0;\n\ - border: 0 !important;\n\ - text-align: center;\n\ - background: transparent;\n\ - display: block;\n\ - font-size: 12px;\n\ - height: 12px;\n\ - width: 30px;\n\ - margin: 1px 0;\n\ -}\n\ -.summary {\n\ - text-decoration: none;\n\ -}\n\ -/* Catalog */\n\ -:root.catalog-mode .board {\n\ - text-align: center;\n\ -}\n\ -.catalog-thread {\n\ - display: inline-block;\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ - border: 1px solid transparent;\n\ - word-wrap: break-word;\n\ - vertical-align: top;\n\ - position: relative;\n\ -}\n\ -/* overrides 4chan CSS on div.thread */\n\ -.catalog-thread.catalog-thread {\n\ - margin: 2px;\n\ -}\n\ -.catalog-small > .catalog-thread {\n\ - width: 165px;\n\ - height: 320px;\n\ -}\n\ -.catalog-large > .catalog-thread {\n\ - width: 270px;\n\ - height: 410px;\n\ -}\n\ -:root.catalog-hover-expand .catalog-thread:hover {\n\ - z-index: 1;\n\ -}\n\ -.catalog-container {\n\ - position: absolute;\n\ - top: -4px;\n\ - left: 0;\n\ - right: 0;\n\ - bottom: 0;\n\ -}\n\ -.catalog-container:not(:hover),\n\ -:root:not(.catalog-hover-expand) .catalog-container {\n\ - overflow: hidden;\n\ -}\n\ -.catalog-post {\n\ - position: absolute;\n\ - top: 4px;\n\ - left: 0;\n\ - right: 0;\n\ - border: 1px solid transparent;\n\ - padding-top: 20px;\n\ -}\n\ -/* overrides inline CSS from Index.cb.hoverAdjust */\n\ -:root:not(.catalog-hover-expand) .catalog-post {\n\ - left: 0 !important;\n\ - right: 0 !important;\n\ -}\n\ -/* overrides 4chan CSS on div.post */\n\ -.catalog-post.catalog-post {\n\ - margin: -21px -1px -1px;\n\ - overflow: visible;\n\ -}\n\ -.catalog-thread.noFile > * > .catalog-post {\n\ - margin-top: -7px;\n\ - padding-top: 6px;\n\ -}\n\ -:root.catalog-hover-expand .catalog-container:hover > .catalog-post {\n\ - margin-left: -61px;\n\ - margin-right: -61px;\n\ -}\n\ -:root.catalog-hover-expand .catalog-container:hover > * > :not(.catalog-replies) {\n\ - padding-left: 2px;\n\ - padding-right: 2px;\n\ -}\n\ -.catalog-link {\n\ - display: block;\n\ - position: relative;\n\ -}\n\ -.catalog-thumb {\n\ - border-radius: 2px;\n\ - box-shadow: 0 0 5px rgba(0, 0, 0, .25);\n\ - vertical-align: top;\n\ -}\n\ -.catalog-thumb.spoiler-file {\n\ - width: 100px;\n\ - height: 100px;\n\ -}\n\ -.catalog-thumb.deleted-file {\n\ - width: 127px;\n\ - height: 13px;\n\ - padding: 20px 11px;\n\ -}\n\ -.catalog-thumb.no-file {\n\ - width: 77px;\n\ - height: 13px;\n\ - padding: 20px 36px;\n\ -}\n\ -.catalog-icons > img,\n\ -.catalog-stats > .menu-button {\n\ - width: 1em;\n\ - height: 1em;\n\ - margin: 0;\n\ - vertical-align: text-top;\n\ - padding-left: 2px;\n\ -}\n\ -.catalog-stats > .menu-button {\n\ - font-weight: normal;\n\ -}\n\ -.catalog-stats > .menu-button > i::before {\n\ - line-height: 11px;\n\ -}\n\ -.catalog-stats {\n\ - font-size: 10px;\n\ - font-weight: 700;\n\ - padding-top: 2px;\n\ -}\n\ -.catalog-stats > [title] {\n\ - cursor: help;\n\ -}\n\ -.catalog-post > .postMessage {\n\ - margin: 0;\n\ - padding-bottom: .3em;\n\ -}\n\ -.catalog-container:not(:hover) > * > .file,\n\ -.catalog-container:not(:hover) > * > .postInfo > :not(.subject),\n\ -.catalog-container:not(:hover) > * > .catalog-replies,\n\ -.catalog-container:not(:hover) .extra-linebreak,\n\ -.catalog-container:not(:hover) .abbr,\n\ -:root:not(.catalog-hover-expand) .catalog-container > * > .file,\n\ -:root:not(.catalog-hover-expand) .catalog-container > * > .postInfo > :not(.subject),\n\ -:root:not(.catalog-hover-expand) .catalog-container > * > .catalog-replies,\n\ -:root:not(.catalog-hover-expand) .catalog-container .extra-linebreak,\n\ -:root:not(.catalog-hover-expand) .catalog-container .abbr,\n\ -.catalog-thread > .catalog-container > :not(.catalog-post),\n\ -.catalog-post > .file > :not(.fileText),\n\ -.catalog-post > * > .fileText > :not(:first-child),\n\ -.catalog-post > .postInfo > :not(.subject):not(.nameBlock):not(.dateTime),\n\ -.catalog-post > .postInfo > .nameBlock > .contact-links,\n\ -.catalog-post > * > * > .posteruid,\n\ -.catalog-post > * > * > .postJumper,\n\ -:root.bottom-backlinks .catalog-post > .container,\n\ -.post:not(.catalog-post) > .catalog-link,\n\ -.post:not(.catalog-post) > .catalog-stats,\n\ -.post:not(.catalog-post) > .catalog-replies {\n\ - display: none;\n\ -}\n\ -.catalog-post > .file {\n\ - position: absolute;\n\ - left: 0;\n\ - right: 0;\n\ - top: 0;\n\ - min-height: 20px;\n\ - background-color: inherit;\n\ -}\n\ -.catalog-post > * > .fileText {\n\ - position: relative;\n\ - padding: 2px;\n\ - background-color: inherit;\n\ -}\n\ -.catalog-small .catalog-post > * .fileText {\n\ - font-size: 10px;\n\ -}\n\ -.catalog-post > * > .fileText:not(:hover) {\n\ - white-space: nowrap;\n\ - overflow: hidden;\n\ - text-overflow: ellipsis;\n\ -}\n\ -.catalog-post > * > .fileText:hover {\n\ - z-index: 1;\n\ -}\n\ -/* overrides 4chan CSS on div.post div.postInfo */\n\ -.catalog-post > .postInfo.postInfo {\n\ - width: auto;\n\ -}\n\ -.catalog-post > * > .subject {\n\ - display: block;\n\ -}\n\ -.catalog-post > * > .dateTime {\n\ - display: inline-block;\n\ - font-style: italic;\n\ -}\n\ -:root.catalog-hover-expand .catalog-container:hover > * > * > .nameBlock,\n\ -:root.catalog-hover-expand .catalog-container:hover > * > * > .dateTime,\n\ -:root.catalog-hover-expand .catalog-container:hover > * > .postMessage:not(:empty) {\n\ - padding-top: .3em;\n\ -}\n\ -.catalog-post .extra-linebreak {\n\ - content: ''; /* makes this work in Blink/WebKit */\n\ - display: block;\n\ - margin-top: .3em;\n\ -}\n\ -.catalog-reply {\n\ - text-align: left;\n\ - white-space: nowrap;\n\ - border-top: 1px solid transparent;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-flex-direction: row;\n\ - flex-direction: row;\n\ - -webkit-align-items: stretch;\n\ - align-items: stretch;\n\ -}\n\ -.catalog-reply > * {\n\ - padding: 3px;\n\ - overflow: hidden;\n\ - -webkit-flex: none;\n\ - flex: none;\n\ -}\n\ -.catalog-reply > span {\n\ - font-style: italic;\n\ - font-weight: bold;\n\ -}\n\ -.catalog-reply-excerpt {\n\ - -webkit-flex: 1 1 auto;\n\ - flex: 1 1 auto;\n\ -}\n\ -.catalog-post .prettyprinted {\n\ - max-width: 100%;\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ -}\n\ -.catalog-post .MathJax_Display {\n\ - text-align: center !important;\n\ -}\n\ -.catalog-container:not(:hover) .exif,\n\ -:root:not(.catalog-hover-expand) .catalog-container .exif {\n\ - display: none !important;\n\ -}\n\ -.catalog-post > * > .exif {\n\ - border-collapse: collapse;\n\ -}\n\ -:root.catalog-hover-expand .catalog-container:hover .exif[style*=\"display: block;\"] {\n\ - display: inline-block !important;\n\ -}\n\ -.catalog-post > * > .exif,\n\ -.catalog-post > * > .exif > tbody {\n\ - background-color: inherit;\n\ -}\n\ -.catalog-post > * > .exif,\n\ -.catalog-post > * > .exif td {\n\ - min-width: 0;\n\ -}\n\ -.catalog-post > * > .exif td {\n\ - padding-top: 1px;\n\ -}\n\ -:root.hats-enabled .catalog-thread::after {\n\ - content: '';\n\ - pointer-events: none;\n\ - position: absolute;\n\ - background-size: contain;\n\ -}\n\ -:root.hats-enabled .catalog-small > .catalog-thread::after {\n\ - left: -8px;\n\ - top: -59px;\n\ - width: 96px;\n\ - height: 96px;\n\ -}\n\ -:root.hats-enabled:not(.werkTyme) .catalog-small > .catalog-thread:not(.noFile)::after {\n\ - left: calc(67px - .3px * var(--tn-w));\n\ -}\n\ -:root.hats-enabled .catalog-large > .catalog-thread::after {\n\ - left: -15px;\n\ - top: -98px;\n\ - width: 160px;\n\ - height: 160px;\n\ -}\n\ -:root.hats-enabled:not(.werkTyme) .catalog-large > .catalog-thread:not(.noFile)::after {\n\ - left: calc(110px - .5px * var(--tn-w));\n\ -}\n\ -/* Copy Text Link's textarea element */\n\ -textarea.copy-text-element {\n\ - height: 0;\n\ - width: 0;\n\ - position: absolute;\n\ - top: -10000px;\n\ -}\n\ -/* Announcement Hiding */\n\ -:root.hide-announcement $site$psa {\n\ - display: none;\n\ -}\n\ -.hide-announcement-button {\n\ - opacity: 0.4;\n\ - float: left;\n\ -}\n\ -/* Unread */\n\ -.unread-line {\n\ - margin: 0;\n\ - border-color: rgb(255,0,0);\n\ -}\n\ -.unread-line + br {\n\ - display: none;\n\ -}\n\ -.unread-mark-read {\n\ - float: right;\n\ - clear: both;\n\ - width: 100%;\n\ - text-align: right;\n\ -}\n\ -:not(.unread-thread) > .unread-mark-read {\n\ - display: none;\n\ -}\n\ -/* Thread Updater */\n\ -#updater {\n\ - background: none;\n\ - border: none;\n\ - box-shadow: none;\n\ -}\n\ -#updater > .move {\n\ - position: absolute;\n\ - top: -5px;\n\ - bottom: -5px;\n\ - left: -5px;\n\ - right: -5px;\n\ - z-index: -1;\n\ -}\n\ -#updater > div:last-child {\n\ - text-align: center;\n\ -}\n\ -#updater input[type=\"number\"] {\n\ - width: 4em;\n\ -}\n\ -:root.float #updater {\n\ - padding: 0px 3px;\n\ -}\n\ -:root:not(.float).shortcut-icons #updater {\n\ - display: inline-block;\n\ - min-width: 12pt;\n\ - text-align: right;\n\ -}\n\ -.new {\n\ - color: limegreen;\n\ -}\n\ -#update-status:not(.empty) + #update-timer:not(.empty):not(.loading) {\n\ - margin-left: 5px;\n\ -}\n\ -#update-timer {\n\ - cursor: pointer;\n\ -}\n\ -/* Thread Watcher */\n\ -#thread-watcher {\n\ - position: absolute;\n\ -}\n\ -#thread-watcher {\n\ - padding-bottom: 3px;\n\ - padding-left: 3px;\n\ - white-space: nowrap;\n\ - min-width: 146px;\n\ -}\n\ -#watched-threads {\n\ - overflow-x: hidden;\n\ - overflow-y: auto;\n\ -}\n\ -#thread-watcher .refresh {\n\ - padding: 0px 3px;\n\ -}\n\ -:root.fixed-watcher #thread-watcher {\n\ - position: fixed;\n\ -}\n\ -:root.fixed-watcher #watched-threads {\n\ - /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */\n\ - max-height: 85vh;\n\ - max-height: calc(100vh - 75px);\n\ -}\n\ -:root:not(.fixed-watcher) #watched-threads:not(:hover) {\n\ - max-height: 210px;\n\ - overflow-y: hidden;\n\ -}\n\ -#thread-watcher > .move {\n\ - padding-top: 3px;\n\ -}\n\ -#watched-threads > div {\n\ - padding-left: 3px;\n\ - padding-right: 3px;\n\ -}\n\ -#watched-threads .watcher-link {\n\ - max-width: 250px;\n\ - display: -webkit-inline-flex;\n\ - display: inline-flex;\n\ - -webkit-flex-direction: row;\n\ - flex-direction: row;\n\ -}\n\ -#watched-threads .watcher-page,\n\ -#watched-threads .watcher-unread {\n\ - -webkit-flex: 0 0 auto;\n\ - flex: 0 0 auto;\n\ - margin-right: 2px;\n\ -}\n\ -#watched-threads .watcher-title {\n\ - overflow: hidden;\n\ - text-overflow: ellipsis;\n\ - -webkit-flex: 0 1 auto;\n\ - flex: 0 1 auto;\n\ -}\n\ -#watched-threads .watcher-title:not(:first-child) {\n\ - margin-left: 2px;\n\ -}\n\ -.replies-quoting-you > a, #watcher-link.replies-quoting-you, .last-page > a > .watcher-page {\n\ - color: #F00;\n\ -}\n\ -#thread-watcher a {\n\ - text-decoration: none;\n\ -}\n\ -#thread-watcher .move > .close {\n\ - position: absolute;\n\ - right: 0px;\n\ - top: 0px;\n\ - padding: 0px 4px;\n\ -}\n\ -.watch-thread-link {\n\ - padding-top: 18px;\n\ - width: 18px;\n\ - height: 0px;\n\ - display: inline-block;\n\ - background-repeat: no-repeat;\n\ - opacity: 0.2;\n\ - position: relative;\n\ - top: 1px;\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -.watch-thread-link.watched {\n\ - opacity: 1;\n\ -}\n\ -/* Thread Stats */\n\ -#thread-stats {\n\ - background: none;\n\ - border: none;\n\ - box-shadow: none;\n\ -}\n\ -:root.float #thread-stats > .move > :not(#page-count) {\n\ - pointer-events: none;\n\ -}\n\ -:root.float #thread-stats {\n\ - padding: 0px 3px;\n\ -}\n\ -#page-count {\n\ - cursor: pointer;\n\ -}\n\ -/* Quote */\n\ -.hashlink::before {\n\ - content: ' ';\n\ - visibility: hidden;\n\ -}\n\ -.inline + .hashlink {\n\ - display: none !important;\n\ -}\n\ -:root.resurrect-quotes .deadlink {\n\ - text-decoration: none !important;\n\ -}\n\ -.catalog-post .qmark-ct {\n\ - display: none;\n\ -}\n\ -.backlink.deadlink:not(.forwardlink),\n\ -.quotelink.deadlink:not(.forwardlink) {\n\ - text-decoration: underline !important;\n\ -}\n\ -:root:not(.catalog-mode) .inlined {\n\ - opacity: .5;\n\ -}\n\ -#qp input, .forwarded {\n\ - display: none;\n\ -}\n\ -.quotelink.forwardlink,\n\ -.backlink.forwardlink {\n\ - text-decoration: none;\n\ - border-bottom: 1px dashed;\n\ -}\n\ -.filtered {\n\ - text-decoration: underline line-through;\n\ -}\n\ -:root.hide-backlinks .backlink.filtered,\n\ -:root.hide-backlinks .backlink.filtered + .hashlink.filtered {\n\ - display: none;\n\ -}\n\ -.postNum + .container::before {\n\ - content: \" \";\n\ -}\n\ -:root.bottom-backlinks .container {\n\ - display: block;\n\ - clear: both;\n\ - margin: 0 4px;\n\ -}\n\ -:root.bottom-backlinks .backlink {\n\ - font-size: 90%;\n\ -}\n\ -.inline {\n\ - border: 1px solid;\n\ - display: table;\n\ - margin: 2px 0;\n\ -}\n\ -.container ~ .inline {\n\ - margin-left: 20px;\n\ -}\n\ -:root.catalog-mode .inline {\n\ - display: none;\n\ -}\n\ -.inline .post {\n\ - border: 0 !important;\n\ - background-color: transparent !important;\n\ - display: table !important;\n\ - margin: 0 !important;\n\ - padding: 1px 2px !important;\n\ -}\n\ -#qp > .opContainer::after {\n\ - content: '';\n\ - clear: both;\n\ - display: table;\n\ -}\n\ -#qp .post {\n\ - border: none;\n\ - margin: 0;\n\ - padding: 2px 2px 5px;\n\ -}\n\ -#qp img {\n\ - max-height: 80vh;\n\ - max-width: 50vw;\n\ -}\n\ -/* Quote Threading */\n\ -.threadContainer {\n\ - margin-left: 20px;\n\ - border-left: 1px solid rgba(128,128,128,.3);\n\ -}\n\ -.threadOP {\n\ - clear: both;\n\ -}\n\ -/* File */\n\ -.fileText-original,\n\ -.fnswitch:hover > .fntrunc,\n\ -.fnswitch:not(:hover) > .fnfull,\n\ -.expanded-image > .post > .file > .fileThumb > video[data-md5],\n\ -.expanded-image > .post > .file > .fileThumb > img[data-md5] {\n\ - display: none;\n\ -}\n\ -.full-image[data-file-i-d] {\n\ - display: none;\n\ - cursor: pointer;\n\ -}\n\ -.expanded-image > .post > .file > .fileThumb > .full-image {\n\ - display: inline;\n\ -}\n\ -.expanded-image {\n\ - clear: left;\n\ -}\n\ -.expanding {\n\ - opacity: .5;\n\ -}\n\ -:root.fit-height .full-image {\n\ - max-height: 100vh;\n\ -}\n\ -:root.fit-height.fixed .full-image {\n\ - /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */\n\ - max-height: 93vh;\n\ - max-height: calc(100vh - 35px);\n\ -}\n\ -:root.fit-width .full-image {\n\ - max-width: 100%;\n\ -}\n\ -:root.ua-gecko.fit-width .full-image {\n\ - width: 100%;\n\ -}\n\ -.fileThumb > .warning {\n\ - clear: both;\n\ -}\n\ -#ihover {\n\ - pointer-events: none;\n\ - /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */\n\ - max-height: 95vh;\n\ - max-height: calc(100vh - 25px);\n\ - max-width: 100vw;\n\ -}\n\ -/* WEBM Metadata */\n\ -.webm-title > a::before {\n\ - content: \"title\";\n\ - text-decoration: underline;\n\ -}\n\ -.webm-title.loading > a::after {\n\ - content: \"...\";\n\ -}\n\ -.webm-title.error > a:hover::before,\n\ -.webm-title.error > a:focus::before {\n\ - content: \"error\";\n\ - text-decoration: none;\n\ -}\n\ -.webm-title > span {\n\ - cursor: text;\n\ -}\n\ -.webm-title.not-found > span::before {\n\ - content: \"not found\";\n\ -}\n\ -.webm-title:not(:hover):not(:focus) > span,\n\ -.webm-title:hover > span + a,\n\ -.webm-title:focus > span + a {\n\ - display: none;\n\ -}\n\ -/* Volume control */\n\ -input[name=\"Default Volume\"] {\n\ - width: 4em;\n\ - height: 1ex;\n\ - vertical-align: middle;\n\ - margin: 0px;\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.fappeTyme $site$replyOriginal.noFile,\n\ -:root.fappeTyme $site$replyOriginal.noFile + br {\n\ - display: none;\n\ -}\n\ -:root.werkTyme $site$thumbLink,\n\ -:root.werkTyme $site$file$thumb,\n\ -:root.werkTyme .catalog-thumb:not(.deleted-file):not(.no-file),\n\ -:root:not(.werkTyme) .werkTyme-filename {\n\ - display: none;\n\ -}\n\ -.werkTyme-filename {\n\ - font-weight: bold;\n\ - font-size: 110%;\n\ -}\n\ -:root.werkTyme .catalog-link {\n\ - box-shadow: 0 0 5px rgba(0, 0, 0, .25);\n\ - padding: 8px;\n\ - text-align: center;\n\ -}\n\ -:root.werkTyme .catalog-thumb {\n\ - box-shadow: none;\n\ - padding: 0;\n\ - vertical-align: middle;\n\ -}\n\ -.indicator {\n\ - background: rgba(255,0,0,0.8);\n\ - font-weight: bold;\n\ - display: inline-block;\n\ - min-width: 9px;\n\ - padding: 0px 2px;\n\ - margin: 0 1px;\n\ - text-align: center;\n\ - color: white;\n\ - border-radius: 2px;\n\ - cursor: pointer;\n\ -}\n\ -:root:not(.fappeTyme) #shortcut-fappe,\n\ -:root:not(.werkTyme) #shortcut-werk {\n\ - display: none;\n\ -}\n\ -/* Index/Reply Navigation */\n\ -#navlinks {\n\ - font-size: 16px;\n\ - top: 25px;\n\ - right: 10px;\n\ -}\n\ -:root.catalog-mode #navlinks {\n\ - display: none;\n\ -}\n\ -/* Highlighting */\n\ -.qphl {\n\ - outline: 2px solid rgba(216, 94, 49, .8);\n\ -}\n\ -:root.highlight-you .quotesYou$site$highlightable$op,\n\ -:root.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(221, 0, 0, .8);\n\ -}\n\ -:root.highlight-own .yourPost$site$highlightable$op,\n\ -:root.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(221, 0, 0, .8);\n\ -}\n\ -.filter-highlight$site$highlightable$op,\n\ -.filter-highlight$site$highlightable$reply {\n\ - box-shadow: inset 5px 0 rgba(221, 0, 0, .5);\n\ -}\n\ -:root.highlight-own .yourPost > $site$sideArrows,\n\ -:root.highlight-you .quotesYou > $site$sideArrows,\n\ -.filter-highlight > $site$sideArrows {\n\ - color: rgba(221, 0, 0, .8);\n\ -}\n\ -:root.highlight-own .yourPost$site$highlightable$op::after,\n\ -:root.highlight-you .quotesYou$site$highlightable$op::after,\n\ -.filter-highlight$site$highlightable$op::after {\n\ - content: \"\";\n\ - display: block;\n\ - clear: both;\n\ -}\n\ -:root:not(.werkTyme) .catalog-thread.filter-highlight .catalog-thumb,\n\ -:root.werkTyme .catalog-thread.filter-highlight:not(:hover),\n\ -:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.filter-highlight,\n\ -:root.werkTyme.catalog-hover-expand .catalog-thread.filter-highlight > .catalog-container:hover > .catalog-post,\n\ -:root.catalog $site$catalog$thread.filter-highlight$site$highlightable$catalog {\n\ - box-shadow: 0 0 3px 3px rgba(255, 0, 0, .5);\n\ -}\n\ -:root:not(.werkTyme) .catalog-thread.watched .catalog-thumb,\n\ -:root:root.werkTyme .catalog-thread.watched:not(:hover),\n\ -:root:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched,\n\ -:root.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post {\n\ - border: 2px solid rgba(255, 0, 0, .75);\n\ -}\n\ -/* Spoiler text */\n\ -:root.reveal-spoilers $site$spoiler,\n\ -:root.reveal-spoilers $site$spoiler > a {\n\ - color: white !important;\n\ -}\n\ -:root.reveal-spoilers .removed-spoiler::before {\n\ - content: \"[spoiler]\";\n\ -}\n\ -:root.reveal-spoilers .removed-spoiler::after {\n\ - content: \"[/spoiler]\";\n\ -}\n\ -/* Thread & Reply Hiding */\n\ -.hide-thread-button,\n\ -.hide-reply-button {\n\ - float: left;\n\ - margin-right: 4px;\n\ - padding: 2px;\n\ -}\n\ -$site$infoRoot a.hide-reply-button {\n\ - margin-right: 6px;\n\ - padding: 0;\n\ -}\n\ -.replacedSideArrows {\n\ - float: left;\n\ -}\n\ -.hide-thread-button:not(:hover),\n\ -.hide-reply-button:not(:hover) {\n\ - opacity: 0.4;\n\ -}\n\ -.threadContainer .hide-reply-button {\n\ - margin-left: 2px !important;\n\ - position: relative;\n\ - left: 1px;\n\ -}\n\ -.hide-thread-button {\n\ - margin-top: -1px;\n\ - width: 11px;\n\ -}\n\ -.stub ~ :not(.threadDivider) {\n\ - display: none !important;\n\ -}\n\ -.stub input {\n\ - display: inline-block;\n\ -}\n\ -$site$thread[hidden] + hr {\n\ - display: none;\n\ -}\n\ -:root.reply-hide $site$sideArrows {\n\ - display: none;\n\ -}\n\ -:root.sw-yotsuba.thread-hide .party-hat {\n\ - left: 19px;\n\ -}\n\ -/* Anonymize */\n\ -:root.anonymize $site$info$name,\n\ -:root.sw-yotsuba.anonymize .post-author:not([class*=capcode]) {\n\ - font-size: 0;\n\ -}\n\ -:root.anonymize $site$info$tripcode,\n\ -:root.sw-yotsuba.anonymize .n-pu {\n\ - display: none;\n\ -}\n\ -:root.anonymize $site$info$name::before,\n\ -:root.sw-yotsuba.anonymize .post-author:not([class*=capcode])::before {\n\ - content: \"Anonymous\";\n\ - font-size: 10pt;\n\ -}\n\ -:root.sw-yotsuba.anonymize .flashListing .name::before,\n\ -:root.sw-yotsuba.anonymize .post-last > .post-author:not([class*=capcode])::before {\n\ - font-size: 9pt;\n\ -}\n\ -/* QR */\n\ -:root.hide-original-post-form #togglePostFormLink,\n\ -#qr.autohide:not(.focus):not(:hover):not(:active) > form,\n\ -:root.thread-view #qr:not(.show-new-thread-option) select[data-name=\"thread\"],\n\ -#file-n-submit:not(.has-file) #qr-filerm {\n\ - display: none;\n\ -}\n\ -:root.hide-original-post-form #postForm {\n\ - display: none !important;\n\ -}\n\ -#qr select,\n\ -#qr-filename-container > a,\n\ -.remove,\n\ -.captcha-img {\n\ - cursor: pointer;\n\ -}\n\ -#qr {\n\ - position: fixed;\n\ - padding: 1px;\n\ - border: 1px solid transparent;\n\ - min-width: 300px;\n\ - border-radius: 3px 3px 0 0;\n\ -}\n\ -#qr > form {\n\ - /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */\n\ - max-height: 85vh;\n\ - max-height: calc(100vh - 75px);\n\ - overflow-y: auto;\n\ - overflow-x: hidden;\n\ -}\n\ -#qrtab {\n\ - border-radius: 3px 3px 0 0;\n\ -}\n\ -#qrtab {\n\ - margin-bottom: 1px;\n\ -}\n\ -#qr .close {\n\ - float: right;\n\ - padding: 0 3px;\n\ -}\n\ -.qr-link-container {\n\ - text-align: center;\n\ - margin: 16px 0;\n\ -}\n\ -.qr-link-container-bottom {\n\ - width: 200px;\n\ - position: absolute;\n\ - left: -100px;\n\ - margin-left: 50%;\n\ - text-align: center;\n\ -}\n\ -.qr-link {\n\ - border-radius: 3px;\n\ - padding: 6px 10px 5px;\n\ - font-weight: bold;\n\ - vertical-align: middle;\n\ - border-style: solid;\n\ - border-width: 1px;\n\ - font-size: 10pt;\n\ -}\n\ -.qr-link-container + #togglePostFormLink {\n\ - font-size: 10pt;\n\ - font-weight: normal;\n\ - margin: -8px 0 3.5px;\n\ -}\n\ -.persona {\n\ - width: 100%;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-flex-direction: row;\n\ - flex-direction: row;\n\ -}\n\ -.persona .field {\n\ - -webkit-flex: 1;\n\ - flex: 1;\n\ - width: 0;\n\ -}\n\ -#qr.forced-anon input[data-name=\"name\"]:not(.force-show),\n\ -#qr.forced-anon input[data-name=\"sub\"]:not(.force-show),\n\ -#qr.reply-to-thread input[data-name=\"sub\"]:not(.force-show),\n\ -body:not(.board_f) #qr select[name=\"filetag\"],\n\ -#qr.reply-to-thread select[name=\"filetag\"],\n\ -#qr:not(.has-sjis) #sjis-toggle,\n\ -#qr:not(.has-math) #tex-preview-button,\n\ -#qr.tex-preview .textarea > :not(#tex-preview),\n\ -#qr:not(.tex-preview) #tex-preview {\n\ - display: none;\n\ -}\n\ -.persona button {\n\ - -webkit-flex: 0 0 23px;\n\ - flex: 0 0 23px;\n\ - -webkit-align-self: stretch;\n\ - align-self: stretch;\n\ - border: 1px solid #BBB;\n\ - padding: 0;\n\ - background: linear-gradient(to bottom, #F8F8F8, #DCDCDC) no-repeat;\n\ - color: #000;\n\ -}\n\ -#qr.sjis-preview #sjis-toggle, #qr.tex-preview #tex-preview-button {\n\ - background: #DCDCDC;\n\ -}\n\ -#sjis-toggle, #qr.sjis-preview textarea.field {\n\ - font-family: \"IPAMonaPGothic\",\"Mona\",\"MS PGothic\",monospace;\n\ - font-size: 16px;\n\ - line-height: 17px;\n\ -}\n\ -#tex-preview-button {\n\ - font-size: 10px;\n\ -}\n\ -#tex-preview {\n\ - white-space: pre-line;\n\ -}\n\ -#qr textarea.field {\n\ - height: 14.8em;\n\ - min-height: 9em;\n\ -}\n\ -#qr.has-captcha textarea.field {\n\ - height: 9em;\n\ -}\n\ -input.field.tripped:not(:hover):not(:focus) {\n\ - color: transparent !important;\n\ - text-shadow: none !important;\n\ -}\n\ -#qr textarea {\n\ - min-width: 300px;\n\ - resize: both;\n\ -}\n\ -.field {\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ - margin: 0px;\n\ - padding: 2px 4px 3px;\n\ -}\n\ -#qr label input[type=\"checkbox\"] {\n\ - position: relative;\n\ - top: 2px;\n\ -}\n\ -/* Recaptcha v2 */\n\ -#qr .captcha-root {\n\ - position: relative;\n\ -}\n\ -#qr .captcha-container > div {\n\ - margin: auto;\n\ - width: 304px;\n\ -}\n\ -/* XXX scrollable with scroll bar hidden; prevents scroll on space press */\n\ -:root.ua-blink #qr .captcha-container > div,\n\ -:root.ua-edge #qr .captcha-container > div {\n\ - overflow: hidden;\n\ -}\n\ -:root.ua-blink #qr .captcha-container > div > div:first-of-type,\n\ -:root.ua-edge #qr .captcha-container > div > div:first-of-type {\n\ - overflow-y: scroll;\n\ - overflow-x: hidden;\n\ - padding-right: 30px;\n\ - height: 99%;\n\ - width: 100%;\n\ -}\n\ -#qr .captcha-counter {\n\ - display: block;\n\ - width: 100%;\n\ - text-align: center;\n\ - pointer-events: none;\n\ -}\n\ -#qr.captcha-open .captcha-counter {\n\ - position: absolute;\n\ - bottom: 3px;\n\ -}\n\ -#qr .captcha-counter > a {\n\ - pointer-events: auto;\n\ - display: inline-block; /* XXX https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8851747/ */\n\ -}\n\ -#qr:not(.captcha-open) .captcha-counter > a {\n\ - display: block;\n\ - width: 100%;\n\ -}\n\ -#qr.captcha-v2 #qr-captcha-iframe {\n\ - width: 302px;\n\ - height: 423px;\n\ - border: 0;\n\ - display: block;\n\ - margin: auto;\n\ -}\n\ -.goog-bubble-content {\n\ - max-width: 100vw;\n\ - max-height: 100vh;\n\ - overflow: auto;\n\ -}\n\ -.goog-bubble-content iframe {\n\ - position: static !important;\n\ -}\n\ -/* File Input, Submit Button, Oekaki */\n\ -#file-n-submit, #qr .oekaki {\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: stretch;\n\ - align-items: stretch;\n\ - height: 25px;\n\ - margin-top: 1px;\n\ -}\n\ -#file-n-submit > input, #qr-draw-button {\n\ - background: linear-gradient(to bottom, #F8F8F8, #DCDCDC) no-repeat;\n\ - border: 1px solid #BBB;\n\ - border-radius: 2px;\n\ - height: 100%;\n\ -}\n\ -#qr-file-button, #qr-draw-button {\n\ - width: 15%;\n\ -}\n\ -#file-n-submit input[type=\"submit\"] {\n\ - width: 25%;\n\ -}\n\ -#qr-filename-container {\n\ - -webkit-flex: 1 1 auto;\n\ - flex: 1 1 auto;\n\ - width: 0;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: center;\n\ - align-items: center;\n\ - position: relative;\n\ - padding: 1px;\n\ -}\n\ -input#qr-filename {\n\ - border: none !important;\n\ - background: none !important;\n\ - outline: none;\n\ -}\n\ -#qr-filename,\n\ -.has-file #qr-no-file {\n\ - display: none;\n\ -}\n\ -#qr-no-file,\n\ -.has-file #qr-filename {\n\ - -webkit-flex: 1 1 auto;\n\ - flex: 1 1 auto;\n\ - width: 0px; /* XXX Fixes filename not shrinking to allow space for buttons in Edge */\n\ - display: inline-block;\n\ - padding: 0;\n\ - padding-left: 3px;\n\ - overflow: hidden;\n\ - text-overflow: ellipsis;\n\ - white-space: nowrap;\n\ -}\n\ -#qr-no-file {\n\ - color: #AAA;\n\ -}\n\ -#qr .oekaki.has-file {\n\ - display: none;\n\ -}\n\ -#qr .oekaki > label {\n\ - -webkit-flex: 1 1 auto;\n\ - flex: 1 1 auto;\n\ - width: 0;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: center;\n\ - align-items: center;\n\ - height: 100%;\n\ -}\n\ -#qr .oekaki > label > span {\n\ - margin: 0 3px;\n\ -}\n\ -#qr .oekaki > label > input {\n\ - -webkit-flex: 1 1 auto;\n\ - flex: 1 1 auto;\n\ - width: 0;\n\ - height: 100%;\n\ -}\n\ -#qr .oekaki-bg {\n\ - position: relative;\n\ - display: inline-block;\n\ - height: 100%;\n\ - width: 10%;\n\ - margin-left: 3px;\n\ -}\n\ -#qr .oekaki-bg > * {\n\ - position: absolute;\n\ - top: 0;\n\ - left: 0;\n\ - margin: 0;\n\ -}\n\ -#qr .oekaki-bg > :not([name=\"oekaki-bgcolor\"]) {\n\ - z-index: 1;\n\ -}\n\ -#qr [name=\"oekaki-bgcolor\"] {\n\ - height: 100%;\n\ - width: 100%;\n\ - border: none;\n\ - padding: 0;\n\ -}\n\ -#qr [name=\"oekaki-bg\"]:not(:checked) ~ [name=\"oekaki-bgcolor\"] {\n\ - visibility: hidden;\n\ -}\n\ -#qr input[type=\"file\"] {\n\ - visibility: hidden;\n\ - position: absolute;\n\ -}\n\ -/* Spoiler Checkbox, QR Icons */\n\ -#qr-filename-container > label, #qr-filename-container > a {\n\ - -webkit-flex: none;\n\ - flex: none;\n\ - margin: 0;\n\ - margin-right: 3px;\n\ -}\n\ -#qr:not(.has-spoiler) #qr-spoiler-label,\n\ -#file-n-submit:not(.has-file) #qr-spoiler-label,\n\ -.has-file #paste-area,\n\ -.has-file #url-button,\n\ -#file-n-submit:not(.custom-cooldown) #custom-cooldown-button {\n\ - display: none;\n\ -}\n\ -#qr-filename-container > label {\n\ - position: relative;\n\ -}\n\ -#qr-filename-container input[type=\"checkbox\"] {\n\ - margin: 0;\n\ -}\n\ -.checkbox-letter {\n\ - font-size: 13px;\n\ - font-weight: bold;\n\ -}\n\ -#qr-filename-container label:not(:hover) > input[type=\"checkbox\"]:not(:focus):not(:checked),\n\ -#qr-filename-container label:not(:hover) > input[type=\"checkbox\"]:not(:focus):not(:checked) ~ :not(.checkbox-letter),\n\ -#qr-filename-container label:hover > .checkbox-letter,\n\ -input[type=\"checkbox\"]:focus ~ .checkbox-letter,\n\ -input[type=\"checkbox\"]:checked ~ .checkbox-letter {\n\ - /* not displayed but still focusable */\n\ - position: absolute;\n\ - opacity: 0;\n\ - pointer-events: none;\n\ -}\n\ -.checkbox-letter, #paste-area, #url-button, #custom-cooldown-button, #dump-button {\n\ - opacity: 0.6;\n\ -}\n\ -#paste-area {\n\ - font-size: 0;\n\ -}\n\ -#paste-area:focus {\n\ - opacity: 1;\n\ -}\n\ -#custom-cooldown-button.disabled {\n\ - opacity: 0.27;\n\ -}\n\ -/* Thread and Flash Tag Select */\n\ -#qr select {\n\ - background: white;\n\ - border: 1px solid #CCC;\n\ -}\n\ -#qr select[data-name=\"thread\"] {\n\ - float: right;\n\ -}\n\ -#qr > form > select {\n\ - margin-top: 1px;\n\ -}\n\ -/* Dumping UI */\n\ -.dump #dump-list-container {\n\ - display: block;\n\ -}\n\ -#dump-list-container {\n\ - display: none;\n\ - position: relative;\n\ - overflow-y: hidden;\n\ - margin-top: 1px;\n\ -}\n\ -#dump-list {\n\ - overflow-x: auto;\n\ - overflow-y: auto;\n\ - white-space: nowrap;\n\ - width: 248px;\n\ - max-height: 248px;\n\ - min-height: 90px;\n\ - max-width: 100%;\n\ - min-width: 100%;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-flex-wrap: wrap;\n\ - flex-wrap: wrap;\n\ -}\n\ -#dump-list:hover {\n\ - overflow-x: auto;\n\ -}\n\ -.qr-preview {\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ - counter-increment: thumbnails;\n\ - cursor: move;\n\ - display: inline-block;\n\ - height: 90px;\n\ - width: 90px;\n\ - padding: 2px;\n\ - opacity: .5;\n\ - overflow: hidden;\n\ - position: relative;\n\ - text-shadow: 0 0 2px #000;\n\ - -webkit-transition: opacity .25s ease-in-out, -webkit-transform .25s ease-in-out;\n\ - transition: opacity .25s ease-in-out, transform .25s ease-in-out, -webkit-transform .25s ease-in-out;\n\ - vertical-align: top;\n\ - background-size: cover;\n\ - -webkit-flex: none;\n\ - flex: none;\n\ -}\n\ -.qr-preview:hover,\n\ -.qr-preview:focus {\n\ - opacity: .9;\n\ -}\n\ -.qr-preview::before {\n\ - content: counter(thumbnails);\n\ - color: #fff;\n\ - position: absolute;\n\ - top: 3px;\n\ - right: 3px;\n\ - text-shadow: 0 0 3px #000, 0 0 8px #000;\n\ -}\n\ -.qr-preview#selected {\n\ - opacity: 1;\n\ -}\n\ -.qr-preview.drag {\n\ - box-shadow: 0 0 10px rgba(0,0,0,.5);\n\ - -webkit-transform: scale(.8);\n\ - transform: scale(.8);\n\ -}\n\ -.qr-preview.over {\n\ - border-color: #fff;\n\ - -webkit-transform: scale(1.1);\n\ - transform: scale(1.1);\n\ - opacity: 0.9;\n\ - z-index: 10;\n\ -}\n\ -.qr-preview > span {\n\ - color: #fff;\n\ -}\n\ -.remove {\n\ - background: none;\n\ - color: #e00;\n\ - padding: 1px;\n\ -}\n\ -a:only-of-type > .remove {\n\ - display: none;\n\ -}\n\ -.remove:hover::after {\n\ - content: \" Remove\";\n\ -}\n\ -.qr-preview:not(.has-file) label,\n\ -#qr:not(.has-spoiler) .qr-preview-spoiler {\n\ - display: none;\n\ -}\n\ -.qr-preview > label {\n\ - background: rgba(0,0,0,.5);\n\ - color: #fff;\n\ - right: 0;\n\ - bottom: 0;\n\ - left: 0;\n\ - position: absolute;\n\ - text-align: center;\n\ -}\n\ -.qr-preview > label > input {\n\ - margin: 0;\n\ -}\n\ -#add-post {\n\ - cursor: pointer;\n\ - font-size: 2em;\n\ - position: absolute;\n\ - bottom: 20px;\n\ - right: 10px;\n\ - -webkit-transform: translateY(-50%);\n\ - transform: translateY(-50%);\n\ -}\n\ -.textarea {\n\ - position: relative;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ -}\n\ -#char-count {\n\ - color: #000;\n\ - background: hsla(0, 0%, 100%, .5);\n\ - font-size: 8pt;\n\ - position: absolute;\n\ - bottom: 1px;\n\ - right: 1px;\n\ - pointer-events: none;\n\ -}\n\ -#char-count.warning {\n\ - color: red;\n\ -}\n\ -/* Menu */\n\ -.menu-button:not(.fa-bars) {\n\ - display: inline-block;\n\ - position: relative;\n\ - cursor: pointer;\n\ -}\n\ -#header-bar .menu-button i {\n\ - border-top: 6px solid;\n\ - border-right: 4px solid transparent;\n\ - border-left: 4px solid transparent;\n\ - display: inline-block;\n\ - margin: 2px;\n\ - vertical-align: middle;\n\ -}\n\ -.postInfo > .menu-button,\n\ -#thread-watcher .menu-button {\n\ - width: 18px;\n\ - height: 15px;\n\ - text-align: center;\n\ -}\n\ -#menu {\n\ - position: fixed;\n\ - outline: none;\n\ - font-weight: normal;\n\ -}\n\ -#menu, .submenu {\n\ - border-radius: 3px;\n\ - padding-top: 1px;\n\ - padding-bottom: 3px;\n\ -}\n\ -.entry {\n\ - cursor: pointer;\n\ - display: block;\n\ - outline: none;\n\ - padding: 2px 10px;\n\ - position: relative;\n\ - text-decoration: none;\n\ - white-space: nowrap;\n\ - min-width: 70px;\n\ - text-align: left;\n\ - text-shadow: none;\n\ - font-size: 10pt;\n\ -}\n\ -.left>.entry.has-submenu {\n\ - padding-right: 17px !important;\n\ -}\n\ -.entry input[type=\"checkbox\"],\n\ -.entry input[type=\"radio\"] {\n\ - margin: 0px;\n\ - position: relative;\n\ - top: 2px;\n\ -}\n\ -.entry input[type=\"number\"] {\n\ - width: 4.5em;\n\ -}\n\ -.entry.has-shortcut-text {\n\ - display: flex;\n\ - justify-content: space-between;\n\ - align-items: center;\n\ -}\n\ -.entry .shortcut-text {\n\ - opacity: 0.5;\n\ - font-size: 70%;\n\ - margin-left: 5px;\n\ -}\n\ -.has-submenu::after {\n\ - content: \"\";\n\ - border-left: .5em solid;\n\ - border-top: .3em solid transparent;\n\ - border-bottom: .3em solid transparent;\n\ - display: inline-block;\n\ - margin: .3em;\n\ - position: absolute;\n\ - right: 3px;\n\ -}\n\ -.left .has-submenu::after {\n\ - border-left: 0;\n\ - border-right: .5em solid;\n\ -}\n\ -.submenu {\n\ - display: none;\n\ - position: absolute;\n\ - left: 100%;\n\ - top: -1px;\n\ - margin-left: 0px;\n\ - margin-top: -2px;\n\ -}\n\ -.focused > .submenu {\n\ - display: block;\n\ -}\n\ -.imp-exp-result {\n\ - position: absolute;\n\ - text-align: center;\n\ - margin: auto;\n\ - right: 0px;\n\ - left: 0px;\n\ - width: 200px;\n\ -}\n\ -/* Custom Board Titles */\n\ -.boardTitle, .boardSubtitle {\n\ - white-space: pre-line;\n\ -}\n\ -.boardTitle[contenteditable=\"true\"],\n\ -.boardSubtitle[contenteditable=\"true\"] {\n\ - cursor: text !important;\n\ -}\n\ -/* Embedding */\n\ -.embedder:not(.embedded) > span {\n\ - display: none;\n\ -}\n\ -#embedding {\n\ - padding: 1px 4px 1px 4px;\n\ - position: fixed;\n\ -}\n\ -#embedding.empty {\n\ - display: none;\n\ -}\n\ -#embedding > div:first-child {\n\ - display: -webkit-flex;\n\ - display: flex;\n\ -}\n\ -#embedding .move {\n\ - -webkit-flex: 1;\n\ - flex: 1;\n\ -}\n\ -#embedding .jump {\n\ - margin: -1px 4px;\n\ - text-decoration: none;\n\ -}\n\ -/* Gallery */\n\ -#a-gallery {\n\ - position: fixed;\n\ - top: 0;\n\ - bottom: 0;\n\ - left: 0;\n\ - right: 0;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-flex-direction: row;\n\ - flex-direction: row;\n\ - background: rgba(0,0,0,0.7);\n\ -}\n\ -.gal-viewport {\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: stretch;\n\ - align-items: stretch;\n\ - -webkit-flex-direction: row;\n\ - flex-direction: row;\n\ - -webkit-flex: 1 1 auto;\n\ - flex: 1 1 auto;\n\ - overflow: hidden;\n\ -}\n\ -.gal-thumbnails {\n\ - -webkit-flex: 0 0 150px;\n\ - flex: 0 0 150px;\n\ - overflow-y: auto;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-flex-direction: column;\n\ - flex-direction: column;\n\ - -webkit-align-items: stretch;\n\ - align-items: stretch;\n\ - text-align: center;\n\ - background: rgba(0,0,0,.5);\n\ - border-left: 1px solid #222;\n\ -}\n\ -.gal-hide-thumbnails .gal-thumbnails {\n\ - display: none;\n\ -}\n\ -.gal-thumb img,\n\ -.gal-thumb video {\n\ - max-width: 125px;\n\ - max-height: 125px;\n\ - height: auto;\n\ - width: auto;\n\ -}\n\ -.gal-thumb {\n\ - -webkit-flex: 0 0 auto;\n\ - flex: 0 0 auto;\n\ - padding: 3px;\n\ - line-height: 0;\n\ - transition: background .2s linear;\n\ -}\n\ -.gal-highlight {\n\ - background: rgba(0, 190, 255,.8);\n\ -}\n\ -.gal-prev {\n\ - border-right: 1px solid #222;\n\ -}\n\ -.gal-next {\n\ - border-left: 1px solid #222;\n\ -}\n\ -.gal-prev,\n\ -.gal-next {\n\ - -webkit-flex: 0 0 20px;\n\ - flex: 0 0 20px;\n\ - position: relative;\n\ - cursor: pointer;\n\ - opacity: 0.7;\n\ - background-color: rgba(0, 0, 0, 0.3);\n\ -}\n\ -.gal-prev:hover,\n\ -.gal-next:hover {\n\ - opacity: 1;\n\ -}\n\ -.gal-prev::after,\n\ -.gal-next::after {\n\ - position: absolute;\n\ - top: 48.6%;\n\ - -webkit-transform: translateY(-50%);\n\ - transform: translateY(-50%);\n\ - display: inline-block;\n\ - border-top: 11px solid transparent;\n\ - border-bottom: 11px solid transparent;\n\ - content: \"\";\n\ -}\n\ -.gal-prev::after {\n\ - border-right: 12px solid #fff;\n\ - right: 5px;\n\ -}\n\ -.gal-next::after {\n\ - border-left: 12px solid #fff;\n\ - right: 3px;\n\ -}\n\ -.gal-image {\n\ - -webkit-flex: 1 0 auto;\n\ - flex: 1 0 auto;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: flex-start;\n\ - align-items: flex-start;\n\ - -webkit-justify-content: space-around;\n\ - justify-content: space-around;\n\ - overflow: hidden;\n\ - /* Flex > Non-Flex child max-width and overflow fix (Firefox only?) */\n\ - width: 1%;\n\ -}\n\ -:root:not(.gal-fit-height):not(.gal-pdf) .gal-image {\n\ - overflow-y: scroll !important;\n\ -}\n\ -:root:not(.gal-fit-width):not(.gal-pdf) .gal-image {\n\ - overflow-x: scroll !important;\n\ -}\n\ -.gal-image a {\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: flex-start;\n\ - align-items: flex-start;\n\ - margin: auto;\n\ - line-height: 0;\n\ - max-width: 100%;\n\ -}\n\ -:root.gal-pdf .gal-image a {\n\ - width: 100%;\n\ - height: 100%;\n\ -}\n\ -.gal-image img,\n\ -.gal-image video {\n\ - -webkit-flex: none;\n\ - flex: none;\n\ -}\n\ -.gal-fit-width .gal-image img,\n\ -.gal-fit-width .gal-image video {\n\ - max-width: 100%;\n\ -}\n\ -.gal-fit-height .gal-image img,\n\ -.gal-fit-height .gal-image video {\n\ - /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */\n\ - max-height: 95vh;\n\ - max-height: calc(100vh - 25px);\n\ -}\n\ -.gal-image iframe {\n\ - width: 100%;\n\ - height: 100%;\n\ -}\n\ -.gal-buttons {\n\ - font-size: 2em;\n\ - margin-right: 3px;\n\ - padding-left: 7px;\n\ - padding-right: 7px;\n\ - top: 5px;\n\ -}\n\ -:root.gal-pdf .gal-buttons {\n\ - top: 40px;\n\ - background: rgba(0,0,0,0.6) !important;\n\ - border-radius: 3px;\n\ -}\n\ -.gal-buttons a {\n\ - color: #ffffff;\n\ - text-shadow: 0px 0px 1px #000000;\n\ -}\n\ -.gal-buttons i {\n\ - display: inline-block;\n\ - margin: 2px;\n\ - position: relative;\n\ -}\n\ -.gal-start i {\n\ - border-left: 10px solid;\n\ - border-top: 6px solid transparent;\n\ - border-bottom: 6px solid transparent;\n\ - bottom: 1px;\n\ -}\n\ -.gal-stop i {\n\ - border: 5px solid;\n\ - bottom: 2px;\n\ -}\n\ -.gal-buttons.gal-playing > .gal-start,\n\ -.gal-buttons:not(.gal-playing) > .gal-stop {\n\ - display: none;\n\ -}\n\ -.gal-buttons .menu-button i {\n\ - border-top: 10px solid;\n\ - border-right: 6px solid transparent;\n\ - border-left: 6px solid transparent;\n\ - bottom: 2px;\n\ - vertical-align: baseline;\n\ -}\n\ -.gal-labels {\n\ - position: fixed;\n\ - bottom: 6px;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-flex-direction: column;\n\ - flex-direction: column;\n\ - -webkit-align-items: flex-end;\n\ - align-items: flex-end;\n\ -}\n\ -:root:not(.show-sauce) .gal-sauce {\n\ - display: none;\n\ -}\n\ -.gal-name,\n\ -.gal-count,\n\ -.gal-sauce {\n\ - background: rgba(0,0,0,0.6) !important;\n\ - border-radius: 3px;\n\ - padding: 1px 5px 2px 5px;\n\ - margin-top: 3px;\n\ - color: #ffffff !important;\n\ - text-decoration: none !important;\n\ -}\n\ -.gal-sauce a {\n\ - color: #ffffff !important;\n\ -}\n\ -.gal-name:hover,\n\ -.gal-buttons a:hover,\n\ -.gal-sauce a:hover {\n\ - color: rgb(95, 95, 101) !important;\n\ -}\n\ -:root.gal-pdf .gal-buttons a:hover {\n\ - color: rgb(204, 204, 204) !important;\n\ -}\n\ -.gal-buttons,\n\ -.gal-labels {\n\ - position: fixed;\n\ - right: 195px;\n\ -}\n\ -.gal-hide-thumbnails .gal-buttons,\n\ -.gal-hide-thumbnails .gal-labels {\n\ - right: 44px;\n\ -}\n\ -:root:not(.gal-fit-width):not(.gal-pdf) .gal-labels {\n\ - bottom: 23px !important;\n\ -}\n\ -:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-buttons,\n\ -:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-labels {\n\ - right: 178px !important;\n\ -}\n\ -:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-buttons,\n\ -:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-labels {\n\ - right: 28px !important;\n\ -}\n\ -:root.gallery-open.fixed #header-bar:not(.autohide),\n\ -:root.gallery-open.fixed #header-bar:not(.autohide) #shortcuts .fa::before {\n\ - visibility: hidden;\n\ -}\n\ -/* Mod Contact Links */\n\ -.contact-links {\n\ - margin-left: 2px;\n\ -}\n\ -.move-note > a {\n\ - text-decoration: underline;\n\ -}\n\ -.invisible {\n\ - font-size: 0;\n\ -}\n\ -/* PostJumper */\n\ -.postJumper > .prev,\n\ -.postJumper > .next {\n\ - font-size: 120%;\n\ -}\n\ -/* PSA */\n\ -.fcx-announcement {\n\ - text-align: center;\n\ -}\n\ -.fcx-announcement a {\n\ - text-decoration: underline;\n\ -}\n\ -/* General */\n\ -:root.yotsuba .dialog {\n\ - background-color: #F0E0D6;\n\ - border-color: #D9BFB7;\n\ -}\n\ -:root.yotsuba .field:focus,\n\ -:root.yotsuba .field.focus {\n\ - border-color: #EA8;\n\ -}\n\ -/* 4chan style fixes */\n\ -:root.yotsuba.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(221, 0, 0, .8) !important;\n\ -}\n\ -:root.yotsuba.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(221, 0, 0, .8) !important;\n\ -}\n\ -/* Header */\n\ -:root.yotsuba #header-bar.dialog {\n\ - background-color: rgba(240,224,214,0.98);\n\ -}\n\ -:root.yotsuba:not(.fixed) #header-bar, :root.yotsuba #notifications {\n\ - font-size: 9pt;\n\ -}\n\ -:root.yotsuba #header-bar, :root.yotsuba #notifications {\n\ - color: #B86;\n\ -}\n\ -:root.yotsuba #board-list a, :root.yotsuba #shortcuts a {\n\ - color: #800000;\n\ -}\n\ -/* Settings */\n\ -:root.yotsuba #fourchanx-settings fieldset, :root.yotsuba .section-main div::before {\n\ - border-color: #D9BFB7;\n\ -}\n\ -:root.yotsuba .suboption-list > div:last-of-type {\n\ - background-color: #F0E0D6;\n\ -}\n\ -/* Catalog */\n\ -:root.yotsuba.catalog-hover-expand .catalog-container:hover > .post {\n\ - background-color: #F0E0D6;\n\ -}\n\ -:root.yotsuba.werkTyme .catalog-thread:not(:hover),\n\ -:root.yotsuba.werkTyme:not(.catalog-hover-expand) .catalog-thread,\n\ -:root.yotsuba.catalog-hover-expand .catalog-container:hover > .post,\n\ -:root.yotsuba.catalog-hover-expand .catalog-container:hover .catalog-reply {\n\ - border-color: #D9BFB7;\n\ -}\n\ -/* Quote */\n\ -:root.yotsuba .backlink.deadlink {\n\ - color: #00E !important;\n\ -}\n\ -:root.yotsuba .inline {\n\ - border-color: #D9BFB7;\n\ - background-color: rgba(255, 255, 255, .14);\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.yotsuba .indicator {\n\ - color: #F0E0D6;\n\ -}\n\ -/* QR */\n\ -.yotsuba #dump-list::-webkit-scrollbar-thumb {\n\ - background-color: #F0E0D6;\n\ - border-color: #D9BFB7;\n\ -}\n\ -:root.yotsuba .qr-preview {\n\ - background-color: rgba(0, 0, 0, .15);\n\ -}\n\ -:root.yotsuba .qr-link {\n\ - border-color: rgb(225, 209, 199) rgb(225, 209, 199) rgb(210, 194, 184);\n\ - background: linear-gradient(#FFEFE5, #F0E0D6) repeat scroll 0% 0% transparent;\n\ -}\n\ -:root.yotsuba .qr-link:hover {\n\ - background: #F0E0D6;\n\ -}\n\ -/* Menu */\n\ -:root.yotsuba #menu {\n\ - color: #800000;\n\ -}\n\ -:root.yotsuba .entry {\n\ - font-size: 10pt;\n\ -}\n\ -:root.yotsuba .focused.entry {\n\ - background: rgba(255, 255, 255, .33);\n\ -}\n\ -/* Unread */\n\ -:root.yotsuba .unread-mark-read {\n\ - background-color: rgba(240,224,214,0.5);\n\ -}\n\ -/* Thread Watcher */\n\ -:root.yotsuba .replies-quoting-you > a, :root.yotsuba #watcher-link.replies-quoting-you, :root.yotsuba .last-page > a > .watcher-page {\n\ - color: #F00;\n\ -}\n\ -/* Watcher Favicon */\n\ -:root.yotsuba .watch-thread-link\n\ -{\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -/* General */\n\ -:root.yotsuba-b .dialog {\n\ - background-color: #D6DAF0;\n\ - border-color: #B7C5D9;\n\ -}\n\ -:root.yotsuba-b .field:focus,\n\ -:root.yotsuba-b .field.focus {\n\ - border-color: #98E;\n\ -}\n\ -/* 4chan style fixes */\n\ -:root.yotsuba-b.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(221, 0, 0, .8) !important;\n\ -}\n\ -:root.yotsuba-b.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(221, 0, 0, .8) !important;\n\ -}\n\ -/* Header */\n\ -:root.yotsuba-b #header-bar.dialog {\n\ - background-color: rgba(214,218,240,0.98);\n\ -}\n\ -:root.yotsuba-b:not(.fixed) #header-bar, :root.yotsuba-b #notifications {\n\ - font-size: 9pt;\n\ -}\n\ -:root.yotsuba-b #header-bar, :root.yotsuba-b #notifications {\n\ - color: #89A;\n\ -}\n\ -:root.yotsuba-b #board-list a, :root.yotsuba-b #shortcuts a {\n\ - color: #34345C;\n\ -}\n\ -/* Settings */\n\ -:root.yotsuba-b #fourchanx-settings fieldset, :root.yotsuba-b .section-main div::before {\n\ - border-color: #B7C5D9;\n\ -}\n\ -:root.yotsuba-b .suboption-list > div:last-of-type {\n\ - background-color: #D6DAF0;\n\ -}\n\ -/* Catalog */\n\ -:root.yotsuba-b.catalog-hover-expand .catalog-container:hover > .post {\n\ - background-color: #D6DAF0;\n\ -}\n\ -:root.yotsuba-b.werkTyme .catalog-thread:not(:hover),\n\ -:root.yotsuba-b.werkTyme:not(.catalog-hover-expand) .catalog-thread,\n\ -:root.yotsuba-b.catalog-hover-expand .catalog-container:hover > .post,\n\ -:root.yotsuba-b.catalog-hover-expand .catalog-container:hover .catalog-reply {\n\ - border-color: #B7C5D9;\n\ -}\n\ -/* Quote */\n\ -:root.yotsuba-b .backlink.deadlink {\n\ - color: #34345C !important;\n\ -}\n\ -:root.yotsuba-b .inline {\n\ - border-color: #B7C5D9;\n\ - background-color: rgba(255, 255, 255, .14);\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.yotsuba-b .indicator {\n\ - color: #D6DAF0;\n\ -}\n\ -/* QR */\n\ -.yotsuba-b #dump-list::-webkit-scrollbar-thumb {\n\ - background-color: #D6DAF0;\n\ - border-color: #B7C5D9;\n\ -}\n\ -:root.yotsuba-b .qr-preview {\n\ - background-color: rgba(0, 0, 0, .15);\n\ -}\n\ -:root.yotsuba-b .qr-link {\n\ - border-color: rgb(199, 203, 225) rgb(199, 203, 225) rgb(184, 188, 210);\n\ - background: linear-gradient(#E5E9FF, #D6DAF0) repeat scroll 0% 0% transparent;\n\ -}\n\ -:root.yotsuba-b .qr-link:hover {\n\ - background: #D9DDF3;\n\ -}\n\ -/* Menu */\n\ -:root.yotsuba-b #menu {\n\ - color: #000;\n\ -}\n\ -:root.yotsuba-b .entry {\n\ - font-size: 10pt;\n\ -}\n\ -:root.yotsuba-b .focused.entry {\n\ - background: rgba(255, 255, 255, .33);\n\ -}\n\ -/* Unread */\n\ -:root.yotsuba-b .unread-mark-read {\n\ - background-color: rgba(214,218,240,0.5);\n\ -}\n\ -/* Thread Watcher */\n\ -:root.yotsuba-b .replies-quoting-you > a, :root.yotsuba-b #watcher-link.replies-quoting-you {\n\ - color: #F00;\n\ -}\n\ -/* Watcher Favicon */\n\ -:root.yotsuba-b .watch-thread-link\n\ -{\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -/* General */\n\ -:root.futaba .dialog {\n\ - background-color: #F0E0D6;\n\ - border-color: #D9BFB7;\n\ -}\n\ -:root.futaba .field:focus,\n\ -:root.futaba .field.focus {\n\ - border-color: #EA8;\n\ -}\n\ -/* Header */\n\ -:root.futaba #header-bar.dialog {\n\ - background-color: rgba(240,224,214,0.98);\n\ -}\n\ -:root.futaba:not(.fixed) #header-bar, :root.futaba #notifications {\n\ - font-size: 11pt;\n\ -}\n\ -:root.futaba #header-bar, :root.futaba #notifications {\n\ - color: #B86;\n\ -}\n\ -:root.futaba #header-bar a, :root.futaba #notifications a {\n\ - color: #800000;\n\ -}\n\ -/* Settings */\n\ -:root.futaba #fourchanx-settings fieldset, :root.futaba .section-main div::before {\n\ - border-color: #D9BFB7;\n\ -}\n\ -:root.futaba .suboption-list > div:last-of-type {\n\ - background-color: #F0E0D6;\n\ -}\n\ -/* Catalog */\n\ -:root.futaba.catalog-hover-expand .catalog-container:hover > .post {\n\ - background-color: #F0E0D6;\n\ -}\n\ -:root.futaba.werkTyme .catalog-thread:not(:hover),\n\ -:root.futaba.werkTyme:not(.catalog-hover-expand) .catalog-thread,\n\ -:root.futaba.catalog-hover-expand .catalog-container:hover > .post,\n\ -:root.futaba.catalog-hover-expand .catalog-container:hover .catalog-reply {\n\ - border-color: #D9BFB7;\n\ -}\n\ -/* Quote */\n\ -:root.futaba .backlink.deadlink {\n\ - color: #00E !important;\n\ -}\n\ -:root.futaba .inline {\n\ - border-color: #D9BFB7;\n\ - background-color: rgba(255, 255, 255, .14);\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.futaba .indicator {\n\ - color: #F0E0D6;\n\ -}\n\ -/* Anonymize */\n\ -:root.futaba.anonymize $site$info$name::before {\n\ - font-size: 12pt;\n\ -}\n\ -/* QR */\n\ -.futaba #dump-list::-webkit-scrollbar-thumb {\n\ - background-color: #F0E0D6;\n\ - border-color: #D9BFB7;\n\ -}\n\ -:root.futaba .qr-preview {\n\ - background-color: rgba(0, 0, 0, .15);\n\ -}\n\ -:root.futaba .qr-link {\n\ - border-color: rgb(225, 209, 199) rgb(225, 209, 199) rgb(210, 194, 184);\n\ - background: linear-gradient(#FFEFE5, #F0E0D6) repeat scroll 0% 0% transparent;\n\ -}\n\ -:root.futaba .qr-link:hover {\n\ - background: #F0E0D6;\n\ -}\n\ -/* Menu */\n\ -:root.futaba #menu {\n\ - color: #800000;\n\ -}\n\ -:root.futaba .entry {\n\ - font-size: 12pt;\n\ -}\n\ -:root.futaba .focused.entry {\n\ - background: rgba(255, 255, 255, .33);\n\ -}\n\ -/* Unread */\n\ -:root.futaba .unread-mark-read {\n\ - background-color: rgba(240,224,214,0.5);\n\ -}\n\ -/* Thread Watcher */\n\ -:root.futaba .replies-quoting-you > a, :root.futaba #watcher-link.replies-quoting-you, :root.futaba .last-page > a > .watcher-page {\n\ - color: #F00;\n\ -}\n\ -/* Watcher Favicon */\n\ -:root.futaba .watch-thread-link\n\ -{\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -/* General */\n\ -:root.burichan .dialog {\n\ - background-color: #D6DAF0;\n\ - border-color: #B7C5D9;\n\ -}\n\ -:root.burichan .field:focus,\n\ -:root.burichan .field.focus {\n\ - border-color: #98E;\n\ -}\n\ -/* Header */\n\ -:root.burichan #header-bar.dialog {\n\ - background-color: rgba(214,218,240,0.98);\n\ -}\n\ -:root.burichan:not(.fixed) #header-bar, :root.burichan #header-bar #notifications {\n\ - font-size: 11pt;\n\ -}\n\ -:root.burichan #header-bar, :root.burichan #header-bar #notifications {\n\ - color: #89A;\n\ -}\n\ -:root.burichan #header-bar a, :root.burichan #header-bar #notifications a {\n\ - color: #34345C;\n\ -}\n\ -/* Settings */\n\ -:root.burichan #fourchanx-settings fieldset, :root.burichan .section-main div::before {\n\ - border-color: #B7C5D9;\n\ -}\n\ -:root.burichan .suboption-list > div:last-of-type {\n\ - background-color: #D6DAF0;\n\ -}\n\ -/* Catalog */\n\ -:root.burichan.catalog-hover-expand .catalog-container:hover > .post {\n\ - background-color: #D6DAF0;\n\ -}\n\ -:root.burichan.werkTyme .catalog-thread:not(:hover),\n\ -:root.burichan.werkTyme:not(.catalog-hover-expand) .catalog-thread,\n\ -:root.burichan.catalog-hover-expand .catalog-container:hover > .post,\n\ -:root.burichan.catalog-hover-expand .catalog-container:hover .catalog-reply {\n\ - border-color: #B7C5D9;\n\ -}\n\ -/* Quote */\n\ -:root.burichan .backlink.deadlink {\n\ - color: #34345C !important;\n\ -}\n\ -:root.burichan .inline {\n\ - border-color: #B7C5D9;\n\ - background-color: rgba(255, 255, 255, .14);\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.burichan .indicator {\n\ - color: #D6DAF0;\n\ -}\n\ -/* Anonymize */\n\ -:root.burichan.anonymize $site$info$name::before {\n\ - font-size: 12pt;\n\ -}\n\ -/* QR */\n\ -.burichan #dump-list::-webkit-scrollbar-thumb {\n\ - background-color: #D6DAF0;\n\ - border-color: #B7C5D9;\n\ -}\n\ -:root.burichan .qr-preview {\n\ - background-color: rgba(0, 0, 0, .15);\n\ -}\n\ -:root.burichan .qr-link {\n\ - border-color: rgb(199, 203, 225) rgb(199, 203, 225) rgb(184, 188, 210);\n\ - background: linear-gradient(#E5E9FF, #D6DAF0) repeat scroll 0% 0% transparent;\n\ -}\n\ -:root.burichan .qr-link:hover {\n\ - background: #D9DDF3;\n\ -}\n\ -/* Menu */\n\ -:root.burichan #menu {\n\ - color: #000000;\n\ -}\n\ -:root.burichan .entry {\n\ - font-size: 12pt;\n\ -}\n\ -:root.burichan .focused.entry {\n\ - background: rgba(255, 255, 255, .33);\n\ -}\n\ -/* Unread */\n\ -:root.burichan .unread-mark-read {\n\ - background-color: rgba(214,218,240,0.5);\n\ -}\n\ -/* Thread Watcher */\n\ -:root.burichan .replies-quoting-you > a, :root.burichan #watcher-link.replies-quoting-you, :root.burichan .last-page > a > .watcher-page {\n\ - color: #F00;\n\ -}\n\ -/* Watcher Favicon */\n\ -:root.burichan .watch-thread-link\n\ -{\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -/* General */\n\ -:root.tomorrow .dialog {\n\ - background-color: #282A2E;\n\ - border-color: #111;\n\ -}\n\ -/* 4chan style fixes */\n\ -:root.tomorrow #arc-list span.quote {\n\ - color: #B5BD68;\n\ -}\n\ -:root.tomorrow.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(145, 182, 214, .8) !important;\n\ -}\n\ -:root.tomorrow.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(145, 182, 214, .8) !important;\n\ -}\n\ -/* Header */\n\ -:root.tomorrow #header-bar.dialog {\n\ - background-color: rgba(40,42,46,0.9);\n\ -}\n\ -:root.tomorrow:not(.fixed) #header-bar, :root.tomorrow #notifications {\n\ - font-size: 9pt;\n\ -}\n\ -:root.tomorrow #header-bar, :root.tomorrow #notifications {\n\ - color: #C5C8C6;\n\ -}\n\ -:root.tomorrow #header-bar a, :root.tomorrow #notifications a {\n\ - color: #81A2BE;\n\ -}\n\ -:root.tomorrow.shortcut-icons .native-settings {\n\ - background-image: url('//s.4cdn.org/image/favicon-ws.ico');\n\ -}\n\ -/* Settings */\n\ -:root.tomorrow #fourchanx-settings fieldset, :root.tomorrow .section-main div::before {\n\ - border-color: #111;\n\ -}\n\ -:root.tomorrow .suboption-list > div:last-of-type {\n\ - background-color: #282A2E;\n\ -}\n\ -/* Catalog */\n\ -:root.tomorrow.catalog-hover-expand .catalog-container:hover > .post {\n\ - background-color: #282A2E;\n\ -}\n\ -:root.tomorrow.werkTyme .catalog-thread:not(:hover),\n\ -:root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread,\n\ -:root.tomorrow.catalog-hover-expand .catalog-container:hover > .post,\n\ -:root.tomorrow.catalog-hover-expand .catalog-container:hover .catalog-reply {\n\ - border-color: #111;\n\ -}\n\ -/* Quote */\n\ -:root.tomorrow .backlink.deadlink {\n\ - color: #81A2BE !important;\n\ -}\n\ -:root.tomorrow .inline {\n\ - border-color: #111;\n\ - background-color: rgba(0, 0, 0, .14);\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.tomorrow .indicator {\n\ - color: #282A2E;\n\ -}\n\ -/* Highlighting */\n\ -:root.tomorrow .qphl {\n\ - outline: 2px solid rgba(145, 182, 214, .8);\n\ -}\n\ -:root.tomorrow.highlight-you .quotesYou$site$highlightable$op,\n\ -:root.tomorrow.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(145, 182, 214, .8);\n\ -}\n\ -:root.tomorrow.highlight-own .yourPost$site$highlightable$op,\n\ -:root.tomorrow.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(145, 182, 214, .8);\n\ -}\n\ -:root.tomorrow .filter-highlight$site$highlightable$op,\n\ -:root.tomorrow .filter-highlight$site$highlightable$reply {\n\ - box-shadow: inset 5px 0 rgba(145, 182, 214, .5);\n\ -}\n\ -:root.tomorrow.highlight-own .yourPost > $site$sideArrows,\n\ -:root.tomorrow.highlight-you .quotesYou > $site$sideArrows,\n\ -:root.tomorrow .filter-highlight > $site$sideArrows {\n\ - color: rgb(155, 185, 210);\n\ -}\n\ -:root.tomorrow .catalog-thread.filter-highlight .catalog-thumb,\n\ -:root.tomorrow.werkTyme .catalog-thread.filter-highlight:not(:hover),\n\ -:root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread.filter-highlight,\n\ -:root.tomorrow.werkTyme.catalog-hover-expand .catalog-thread.filter-highlight > .catalog-container:hover > .catalog-post {\n\ - box-shadow: 0 0 3px 3px rgba(64, 192, 255, .7);\n\ -}\n\ -:root.tomorrow .catalog-thread.watched .catalog-thumb,\n\ -:root.tomorrow.werkTyme .catalog-thread.watched:not(:hover),\n\ -:root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched,\n\ -:root.tomorrow.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post {\n\ - border: 2px solid rgb(64, 192, 255);\n\ -}\n\ -/* QR */\n\ -.tomorrow #dump-list::-webkit-scrollbar-thumb {\n\ - background-color: #282A2E;\n\ - border-color: #111;\n\ -}\n\ -:root.tomorrow .qr-preview {\n\ - background-color: rgba(255, 255, 255, .15);\n\ -}\n\ -:root.tomorrow #qr .field {\n\ - background-color: rgb(26, 27, 29);\n\ - color: rgb(197,200,198);\n\ - border-color: rgb(40, 41, 42);\n\ -}\n\ -:root.tomorrow #qr .field:focus,\n\ -:root.tomorrow #qr .field.focus {\n\ - border-color: rgb(129, 162, 190) !important;\n\ - background-color: rgb(30,32,36);\n\ -}\n\ -:root.tomorrow .persona button {\n\ - background: linear-gradient(to bottom, #2E3035, #222427) no-repeat;\n\ - color: rgb(197,200,198);\n\ - border-color: rgb(40, 41, 42);\n\ - outline: none;\n\ -}\n\ -:root.tomorrow .persona button::-moz-focus-inner {\n\ - border: none;\n\ -}\n\ -:root.tomorrow .persona button:focus {\n\ - border-color: rgb(129, 162, 190);\n\ -}\n\ -:root.tomorrow #qr.sjis-preview #sjis-toggle,\n\ -:root.tomorrow #qr.tex-preview #tex-preview-button {\n\ - background: rgb(26, 27, 29);\n\ -}\n\ -:root.tomorrow #qr select,\n\ -:root.tomorrow #file-n-submit > input,\n\ -:root.tomorrow #qr-draw-button {\n\ - border-color: rgb(40, 41, 42);\n\ -}\n\ -:root.tomorrow #qr-filename {\n\ - color: rgb(197,200,198);\n\ -}\n\ -:root.tomorrow .qr-link {\n\ - border-color: rgb(25, 27, 31) rgb(25, 27, 31) rgb(10, 12, 16);\n\ - background: linear-gradient(#37393D, #282A2E) repeat scroll 0% 0% transparent;\n\ -}\n\ -:root.tomorrow .qr-link:hover {\n\ - background: #282A2E;\n\ -}\n\ -/* Menu */\n\ -:root.tomorrow #menu {\n\ - color: #C5C8C6;\n\ -}\n\ -:root.tomorrow .entry {\n\ - font-size: 10pt;\n\ -}\n\ -:root.tomorrow .focused.entry {\n\ - background: rgba(0, 0, 0, .33);\n\ -}\n\ -/* Unread */\n\ -:root.tomorrow .unread-line {\n\ - border-color: rgb(197, 200, 198);\n\ -}\n\ -:root.tomorrow .unread-mark-read {\n\ - background-color: rgba(40,42,46,0.5);\n\ -}\n\ -/* Thread Watcher */\n\ -:root.tomorrow .replies-quoting-you > a, :root.tomorrow #watcher-link.replies-quoting-you, :root.tomorrow .last-page > a > .watcher-page {\n\ - color: #F00 !important;\n\ -}\n\ -/* Watcher Favicon */\n\ -:root.tomorrow .watch-thread-link\n\ -{\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -/* General */\n\ -:root.photon .dialog {\n\ - background-color: #DDD;\n\ - border-color: #CCC;\n\ -}\n\ -:root.photon .field:focus,\n\ -:root.photon .field.focus {\n\ - border-color: #EA8;\n\ -}\n\ -/* 4chan style fixes */\n\ -:root.photon #arc-list tr:nth-of-type(odd) span.quote {\n\ - color: #C0E17A;\n\ -}\n\ -:root.photon.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(221, 0, 0, .8) !important;\n\ -}\n\ -:root.photon.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(221, 0, 0, .8) !important;\n\ -}\n\ -/* Header */\n\ -:root.photon #header-bar.dialog {\n\ - background-color: rgba(221,221,221,0.98);\n\ -}\n\ -:root.photon:not(.fixed) #header-bar, :root.photon #notifications {\n\ - font-size: 9pt;\n\ -}\n\ -:root.photon #header-bar, :root.photon #notifications {\n\ - color: #333;\n\ -}\n\ -:root.photon #header-bar a, :root.photon #notifications a {\n\ - color: #FF6600;\n\ -}\n\ -/* Settings */\n\ -:root.photon #fourchanx-settings fieldset, :root.photon .section-main div::before {\n\ - border-color: #CCC;\n\ -}\n\ -:root.photon .suboption-list > div:last-of-type {\n\ - background-color: #DDD;\n\ -}\n\ -/* Catalog */\n\ -:root.photon.catalog-hover-expand .catalog-container:hover > .post {\n\ - background-color: #DDD;\n\ -}\n\ -:root.photon.werkTyme .catalog-thread:not(:hover),\n\ -:root.photon.werkTyme:not(.catalog-hover-expand) .catalog-thread,\n\ -:root.photon.catalog-hover-expand .catalog-container:hover > .post,\n\ -:root.photon.catalog-hover-expand .catalog-container:hover .catalog-reply {\n\ - border-color: #CCC;\n\ -}\n\ -/* Quote */\n\ -:root.photon .backlink.deadlink {\n\ - color: #F60 !important;\n\ -}\n\ -:root.photon .inline {\n\ - border-color: #CCC;\n\ - background-color: rgba(255, 255, 255, .14);\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.photon .indicator {\n\ - color: #DDD;\n\ -}\n\ -/* QR */\n\ -.photon #dump-list::-webkit-scrollbar-thumb {\n\ - background-color: #DDD;\n\ - border-color: #CCC;\n\ -}\n\ -:root.photon .qr-preview {\n\ - background-color: rgba(0, 0, 0, .15);\n\ -}\n\ -:root.photon .qr-link {\n\ - border-color: rgb(206, 206, 206) rgb(206, 206, 206) rgb(191, 191, 191);\n\ - background: linear-gradient(#ECECEC, #DDD) repeat scroll 0% 0% transparent;\n\ -}\n\ -:root.photon .qr-link:hover {\n\ - background: #DDDDDD;\n\ -}\n\ -/* Menu */\n\ -:root.photon #menu {\n\ - color: #333;\n\ -}\n\ -:root.photon .entry {\n\ - font-size: 10pt;\n\ -}\n\ -:root.photon .focused.entry {\n\ - background: rgba(255, 255, 255, .33);\n\ -}\n\ -/* Unread */\n\ -:root.photon .unread-mark-read {\n\ - background-color: rgba(221,221,221,0.5);\n\ -}\n\ -/* Thread Watcher */\n\ -:root.photon .replies-quoting-you > a, :root.photon #watcher-link.replies-quoting-you, :root.photon .last-page > a > .watcher-page {\n\ - color: #00F !important;\n\ -}\n\ -/* Watcher Favicon */\n\ -:root.photon .watch-thread-link\n\ -{\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -/* General */\n\ -:root.spooky .dialog {\n\ - background-color: #171526;\n\ - border-color: #707070;\n\ -}\n\ -:root.spooky .field:focus,\n\ -:root.spooky .field.focus {\n\ - border-color: #98E;\n\ -}\n\ -/* 4chan style fixes */\n\ -:root.spooky #arc-list span.quote {\n\ - color: #634C2C;\n\ -}\n\ -:root.spooky.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(145, 182, 214, .8) !important;\n\ -}\n\ -:root.spooky.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(145, 182, 214, .8) !important;\n\ -}\n\ -/* Header */\n\ -:root.spooky #header-bar.dialog {\n\ - background-color: rgba(23,21,38,0.98);\n\ -}\n\ -:root.spooky:not(.fixed) #header-bar, :root.spooky #notifications {\n\ - font-size: 9pt;\n\ -}\n\ -:root.spooky #header-bar, :root.spooky #notifications {\n\ - color: #C49756;\n\ -}\n\ -:root.spooky #board-list a, :root.spooky #shortcuts a {\n\ - color: #FE9600;\n\ -}\n\ -:root.spooky.shortcut-icons .native-settings {\n\ - background-image: url('//s.4cdn.org/image/favicon-ws.ico');\n\ -}\n\ -/* Settings */\n\ -:root.spooky #fourchanx-settings fieldset, :root.spooky .section-main div::before {\n\ - border-color: #707070;\n\ -}\n\ -:root.spooky .suboption-list > div:last-of-type {\n\ - background-color: #171526;\n\ -}\n\ -/* Catalog */\n\ -:root.spooky.catalog-hover-expand .catalog-container:hover > .post {\n\ - background-color: #171526;\n\ -}\n\ -:root.spooky.werkTyme .catalog-thread:not(:hover),\n\ -:root.spooky.werkTyme:not(.catalog-hover-expand) .catalog-thread,\n\ -:root.spooky.catalog-hover-expand .catalog-container:hover > .post,\n\ -:root.spooky.catalog-hover-expand .catalog-container:hover .catalog-reply {\n\ - border-color: #707070;\n\ -}\n\ -/* Quote */\n\ -:root.spooky .backlink.deadlink {\n\ - color: #FE9600 !important;\n\ -}\n\ -:root.spooky .inline {\n\ - border-color: #707070;\n\ - background-color: rgba(255, 255, 255, .14);\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.spooky .indicator {\n\ - color: #171526;\n\ -}\n\ -/* Highlighting */\n\ -:root.spooky .qphl {\n\ - outline: 2px solid rgba(145, 182, 214, .8);\n\ -}\n\ -:root.spooky.highlight-you .quotesYou$site$highlightable$op,\n\ -:root.spooky.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(145, 182, 214, .8);\n\ -}\n\ -:root.spooky.highlight-own .yourPost$site$highlightable$op,\n\ -:root.spooky.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(145, 182, 214, .8);\n\ -}\n\ -:root.spooky .filter-highlight$site$highlightable$op,\n\ -:root.spooky .filter-highlight$site$highlightable$reply {\n\ - box-shadow: inset 5px 0 rgba(145, 182, 214, .5);\n\ -}\n\ -:root.spooky.highlight-own .yourPost > $site$sideArrows,\n\ -:root.spooky.highlight-you .quotesYou > $site$sideArrows,\n\ -:root.spooky .filter-highlight > $site$sideArrows {\n\ - color: rgb(155, 185, 210);\n\ -}\n\ -/* QR */\n\ -.spooky #dump-list::-webkit-scrollbar-thumb {\n\ - background-color: #171526;\n\ - border-color: #707070;\n\ -}\n\ -:root.spooky .qr-preview {\n\ - background-color: rgba(0, 0, 0, .15);\n\ -}\n\ -:root.spooky #qr .field {\n\ - background-color: rgb(26, 27, 29);\n\ - color: rgb(197,200,198);\n\ - border-color: rgb(40, 41, 42);\n\ -}\n\ -:root.spooky #qr .field:focus,\n\ -:root.spooky #qr .field.focus {\n\ - border-color: rgb(254, 150, 0) !important;\n\ - background-color: rgb(30,32,36);\n\ -}\n\ -:root.spooky .persona button {\n\ - background: linear-gradient(to bottom, #2E3035, #222427) no-repeat;\n\ - color: rgb(197,200,198);\n\ - border-color: rgb(40, 41, 42);\n\ - outline: none;\n\ -}\n\ -:root.spooky .persona button::-moz-focus-inner {\n\ - border: none;\n\ -}\n\ -:root.spooky .persona button:focus {\n\ - border-color: rgb(254, 150, 0);\n\ -}\n\ -:root.spooky #qr.sjis-preview #sjis-toggle,\n\ -:root.spooky #qr.tex-preview #tex-preview-button {\n\ - background: rgb(26, 27, 29);\n\ -}\n\ -:root.spooky #qr select,\n\ -:root.spooky #file-n-submit > input,\n\ -:root.spooky #qr-draw-button {\n\ - border-color: rgb(40, 41, 42);\n\ -}\n\ -:root.spooky #qr-filename {\n\ - color: rgb(197,200,198);\n\ -}\n\ -:root.spooky .qr-link {\n\ - border-color: rgb(8, 6, 23) rgb(8, 6, 23) rgb(0, 0, 8);\n\ - background: linear-gradient(#262435, #171526) repeat scroll 0% 0% transparent;\n\ -}\n\ -:root.spooky .qr-link:hover {\n\ - background: #1A1829;\n\ -}\n\ -/* Menu */\n\ -:root.spooky #menu {\n\ - color: #FE9600;\n\ -}\n\ -:root.spooky .entry {\n\ - font-size: 10pt;\n\ -}\n\ -:root.spooky .focused.entry {\n\ - background: rgba(255, 255, 255, .33);\n\ -}\n\ -/* Unread */\n\ -:root.spooky .unread-line {\n\ - border-color: rgb(197, 200, 198);\n\ - visibility: visible;\n\ - opacity: 1;\n\ -}\n\ -:root.spooky .unread-mark-read {\n\ - background-color: rgba(23,21,38,0.5);\n\ -}\n\ -/* Thread Watcher */\n\ -:root.spooky .replies-quoting-you > a, :root.spooky #watcher-link.replies-quoting-you, :root.spooky .last-page > a > .watcher-page {\n\ - color: #F00 !important;\n\ -}\n\ -/* Watcher Favicon */\n\ -:root.spooky .watch-thread-link\n\ -{\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -/* Link Title Favicons */\n\ -.linkify.audio::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAitJREFUOE9jYCAWKJWwavr0KyXWb/FIbDtUFFyzJx6nVofE2Xo5nXsj0rqPNSR0nVkR2Hjmgmfd+U9Otdf+m5Vf/6+SfeU/R9ChVVgNYDRtlfJuuPA/rPfe/4QpD/6nznj0P27Kw/9unff/69Xf+69c/+C/SO7N/0z+OAxgMmmRCe++/r9i3ev/KWvf/vdY8PK/bt/9/wrNV3/IN5y/IVt1YqNg4pGTTP4HsbuA2bhZ2qvpyn+xjIObxAp3VwqlrgngLFyryVy5nhPmZJHANS2cwYexG8BmVC/pWn3hP4NZlzWuQDJI3dIiFnUUuwEsQAOcq87jNcC7fHeLUtJxHF4AGmBWeAavAWH1+1rUUk7giAWjOknllON4DXAs2NEiG4/DBQxAF/CFHfrPYI4jDFSLuJVjNrUJhB/B7gIGo1pJRt99GAZYJK7wLJ1z7Xzl4vu/7aqv/GRBj0bjqAX2qb0nJ7mXH17C4HcUxQA+hymWtSue/C5a9up/9Ozn/7Vr7v1nRY7GqMb91T3b3v6vWvPmf/S0p/9ZQk+DDLCBRSOz06Jqk+o7/21nvfqvsebDf7kZL/5zBaxphkezd+OFn7HzXvz3Wvjmv9a8N//5Ek//ZTBpVYUrMG2X5wjcdl68+uI/wa5Lr3hSNjczGFeywOVZ/bbcVGp//F9izfv/Ql03f3P4LC/HSEQquYwMFnUCDJ7dzBhyjGZNQpye89M5gpfnMvtNUyE2h4PUAQBovvT7lyNljwAAAABJRU5ErkJggg==') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.bitchute::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhB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at!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.clyp::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAwUExURTSY22ey5E2l4KbS75rM7Y3F64C/6f///8zl9nS45r/f9PL5/UGe3bPY8Vqr4v///wNjrzUAAAABYktHRA8YugDZAAAAB3RJTUUH4AINEi85AIH95AAAAE9JREFUCNdjYMAGGBWgDGYHCM2a3hkAZmi0dzSBaKaO9o5moCqmLiCjYzNQyw4QowIodQzI6E0AKcpo72gE6+Jyb1kAMehUA9RktgdYbQYAjGIVNGGXBJkAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.dailymotion::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURQBk3ff6/trp+kKO5wZt3xx54q7P9Ozz/IS17zOG5WKh653E8sbc9/GbbcoAAABZSURBVAjXY2BAASyhDhAGc9oECMOjyAAiESEEYrBYpLWBGcwHxcvBjDDxHelghpF0yDQwY3kVgweEUeEQDWbMEepqAjO8FMsLIeYsU8o+BrbCdWboTAe4AwALXxWGjW41FwAAAABJRU5ErkJggg==') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.gfycat::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAjVBMVEWn3gCo3gSr3w2t4BSu4Bav4Ri35C+45DK45DO55DXA50rA50vB50zC6E/D6FTF6VjG6VvL62vN7G/P7XbQ7XfW74vY8JDa8ZTe8qDe8qLf86Pi9Kzj9K7k9LHp9sDp98Lq98Ps+Mr0++L5/O75/fD6/fH6/fL6/fP7/fT7/fb8/ff8/vj8/vn+/v7///91X4cfAAAAcklEQVR42o3M2xKBUACF4aVQckrIuRJK6H//x2sme4/MuPDfre9i6c/Cc3U5Dj87BuAxsXvGu6JvIIXEHRWwNHCHQNrCzkAFkbSBg4EM8i+Yw7PXBa3zRfuxVyf/Bis7nKwGKAcWxgC8prI5Sc315OlnDfzpDar2S9/oAAAAAElFTkSuQmCC') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.gist::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABblBMVEXc3NykpKTW1tbb29ugoKCdnZ0AAAACAgIEDRcKCgoMDAwODg4QIzYRDAoTExMUDwwVAg0WICsaEw8aGhoiCBklGxUmERwwKCQ7LSU7Ozs8LSZFLyNINi1JNyxJNy1KSklMOi5VR1FXV1daQTRkZGRseYZwU0F4eHh7dnR8bWV/YE6IdGiKcGCKkJaNgYeNjY2RdGOScWCUcWCZmZmhoaGkpKSoqKirfmaurq6xsbG1tbW6urq+vr7AbmzBb23CwsLGxsbHx8fHyMjJycnJysrMzMzOiYbPi4fQ0NDRoYbT09PU1NTW1tbY2NjZqIzZ2dnb29vd3d3f39/i4uLktZrk5OTl5eXm5ubn5+fo6Ojq6urs7OzttKLu7u7wuqbw8PDx8fHz8/P4+Pj5+fn7uZj8vpz9ya79ybD/tZf/upr/wZ//w6H/xKH/xaL/xrH/yqj/y7T/zqv/z7D/07D/17n/2Lv/2Lz/3L//38n/4Mk3Q/ZuAAAABnRSTlMSFcbGzc5MNKFvAAAA1klEQVQoz2NgYPZHAswMDEwRSclwkBTBxOARn4gE4j0YXBOiJNUDg7y8Ar1UlOITXBkcY73Z2Li42dg42dn4wmIdGeyjQ7nZoEA4PNqewSZKlw0O9KJsGKwjBdl4ZeWkJGQUhNjEIq0ZrMI5+D0ri7Jz8itCRAXCrRgsQ3mUy+xicrPSbfO0REItGSyCVaVL3ONSU9LcCtQUgy0YzIJ85M1LizMzCsv9xF2CzBhMAwN99TV1DI0MtDWcAgNNGUycA5CAswkDi5kDwrMOZiwMjKzGSICVEQDhZj0UQV7PewAAAABJRU5ErkJggg==') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.image::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAs5JREFUOE+lk/tvi1EYx98/xT8gW4REIpGFMEQWl2FiM9ZMZhm2xRAyOsmujFFmdFRHu0tWm87UypxStr69zPauN5e5rHVp3IYhbOvHy+wHEQlxkm+ek+d8nm9OznkeSfrfldmgJC7QyUlTymsJTfuTZ25z4HdWYwyLreYhtpgekGPw0+kKvo1Eo+IXRSIiEhkWZuc9tqnsJD9EqTUopCxjSGTpB0iueczSo1HyW8cpsExQ1DbxI2pt45j9cXpexul4FEd79RnZphAa/SD7WvuFtO6UItbU9LC+YQxNI2w0wwYT5LRAdhOU3oBTIXC9gXP3oUSGgz2vST3gYHejR0jptT1C332f8yrUEYHrz8CgxDnpm6DKCUfc0KnmXa/AEVPPwnDcD0cvetA2uYRk67Ive/lpjO7YBO1PPuF8Df3vwf4cbNE4tqdw7YVq8HYyHx6FvhE1hkMEg8HDUqvFkjT4aIjMqkqyqkswDSrcfBfH+Q561YLAZ/B+BLda6FXlU/cPv0AoEPhuoP1h4Av7Wbh9E/Py15NWWUjeSR3nZDfeN+N0DY9hG/7K1eGP3P0S5/EYRFUF/IOTBrUXHPm9fT6mr1xEwupkZqxbzLyiDJYUZ5NSnkdqdSHpxyrYdFpPgdmAsdfJwPMI/Yr65bf7tZLGGBQ7DNdJWFtIYvoOZmbuZE7OXpIKKli86zAr9p9gTVktWTVnKTI2U95uRWe3U2IJUDbVB5p6hVm5x5m9Vc/cnedZUNzC8lILaQesZBy6hEZ3maKzgvJWFzVWD9XtXvVGQbSWASFtMATVRlJIKbOTWtlJXaeXepuPM1f6MNp9GLt8mLvvYLmp0OhQ2Fwvk6m7xaqDTvY0eYWUVtcnllXfYlGpnfklVuraHHg8HjxuN+6fktUHlWWZPaZeUo/ILK0UKttBcbNbSB9GP0yLxWJJUxoZGUn80zD9C/vXQ/4NHY10h3M1zmQAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.installgentoo::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABcVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB3dIYAAAAAAAAAAAAbGh4BBAcCBgoBBgoCBwsCCQ/QzucCCA7MyuXZ1eUBBQmTh8fo5/i9svIAAADh3vQAAAACCA0CCQ8CCQ4DDBQbGCUDChDr6vgAAAAAAAAREBIDCxK6tdfe2fTv7/cDCxIDDBQEDRUHDhgMJjXk4PZdXWdLUFoUNEYOKDgSMUMRLUBneI4eTGj08/QmW3onW3rTzvfOx/giU3IiVHMkWHdEaYJobHv3+PokWHpua6TNy9xZgZ+1quz8/foQKj0XPFInWn0nW38tZ4o6fqg8gq48grA9hrU/i7pAhrNAiLdBjLtEjr1FksNIjr5Il8pImMtKWnNqhL97odKFqti5q/q5rPq60+nCt/vLw/vPx/jV0vHY0/rc1/rg2/vh3fzn4fzu6/vx8vf19Pv19Pz49/v5+Pv8/Pv8/fr9/vv+/frziVtUAAAAT3RSTlMABQYHCAoNDhARGRobL0ZOV1xdXV5fYGBmZnB0eX2MjZSaoaGio6mqqqustLq7zubo6Ojo6evt7u/x8fLy9/f4+Pj5+vr6+vr6+/39/v7+XKgUSwAAAMhJREFUKM9jYGDg4OZmZgABKINT1dBAhBHIYFMxMBIDisjbhoZbCTExsCu5hoeY8DEwcOkEx8fY6MqpucTGB0izglVEplcU5/gmRYWBVQDNMK+s0hN3SvMyBpsBNJxXw0NfwTEjVQZqHQMHj5RfWW5mliSEC7TPzK6yJD/bXZQRzGdXcisqLy309okA2Q4Eis4peQWmstqBCdGW/CABraC45ERBBs3A6Fh/AbAKTwsHa34QZW8NVsGuLqwswQSjQICTmYMFQaEDAAF8JHLfKGswAAAAAElFTkSuQmCC') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.liveleak::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAlNJREFUGBkFwU2LVmUYAODrPu8Z5x1xSpRBXQyFoLsBE+wfiO5atJOgnf9DUPwFgtGinUgEaQsRhHYuMtpEiEWuG5iNjuOcj+c8z911xXcXL/68c3Dw1fzhg0QgEQAAEYGUKXFie9vxlSs/xk/rdavjGEkmkWSih65z4osv9GfOiK6LzEyZ2uGh4dUrmzs72ddlUUhkoiMr4PT167589Mh6c1N0nSRlqrX67dat+PDyZXRT19m5edPnt28rGFHxMcJ6d9fprS1/37tneP3aemPD1uamUydPOru3p5DdGOH0tWsu3LhhxIQJM2qEpRT/Pn3q/du3AhARSmvGTH0lplKMrVkiYpVpQaJlighzhDkzhmEA0fcWoqAfyaFW4zTlgCABxlrNmY4ylUzLsiREprFWc0T2M+ZSjKWY0AEaltZUjJixZJIpuk5pTWlNP2BYFvOyKJkCAKU1tTXHrZlqVWolUxdhxsfVSj9FmJfFMM9GdICGGa01HyMstYpMIFPJVNDPmYZSTOPoOEKHzNRlKpmWWh1j6TpLa2SKTKVWU6Z+Qolwdm/P9QcPZKa2LH69e9eIMs+WCL/cv2/98CGZPrt61am+V9APq1X89eyZ/968obVYaiXT4dGREgG+vnPHeHgYMsH2+fP+efEihtVKv7SWw/6+9/v7KYLMhIywTJPamvOXLomukyRsrNf+ePzYkpl9dJ3SWgSCSCQCfz5/7pMLF2yfO6eLiAQcHRz4/cmT+HR7O+Ob3d0fNt69+7a2BiICQCJbA0EgE5lpvbXl1OXL3/8Pfax4+6SjSukAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.pastebin::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAB1FBMVEUAAAAAAAAAAABWYWwAAABbY3BbYm5dZnFdZXJeZnMEBAQHCAhYYGpdZnFdZnBgaHIlJyomKCooKi09QkdESU5eZGtdYmhdYmleY2lrcXdqb3Rqb3Rqb3SSmJ+SlJeWmJutr7GtrrCWm6ChpKhbW1tmZmZvb290dHR3d3d4eHh5eXl6enp8fHx+gIJ/f3+CgoKDg4OEhISFhYWHh4eKioqKjI2Li4uMjIyOjo6Pj4+QkJCRkZGSkpKUlJSVl5mWlpaYmZqZm52ampqbm5ucnJydnZ2enp6fn5+hoaGioqKkpKSkpaalpaWmp6mmp6qnqauoqKioqquoqq2qqqqrrK2srKysra6srrCsrrGurq6vr6+wsLCxsbGysrKztLa0tLS1t7m2tra3t7e4uLi5ubm6urq7u7u8vLy9vb2+vr7AwMDAwsTBwcHExcfFxcXFxsnGxsbHx8fIyMjJycnMzMzNzc3Ozs7O0NLPz8/Q0NDR0dHR09XT09PV1dXV1dbV1tfV19rW1tbX19fX19jY2tzZ2dnZ2tva2tra3N3a3N7c3Nze3t7f39/f4OHg4ODi4uLl5+jm5ubs7Ozs7e3u7u7v7+/v8PDw8PDx8fHy8vLz8/P29vYSoLMZAAAAJHRSTlMABAUGCwsNHCAiLzMzMzZEYGJwgIuOnJycnqmqq9bc3+/w8fkZ0N/uAAAA/klEQVQoU2NgYGDl5YMDdgYGBmZZ3964CYFtIR3e9Q7K/AwMHI55KfaFmcHWMy3K3MwlGRg4wz0zdYpcorRbNbL0LaWAAp3ts2umV8wo6MupTauQBgqUG03VL7W3sfZSb1erAgm02M+yzYrVCXUy6zapAQlUx/dEdyX3J3ZHVUYVywAF8o2rDNN1Go2jzGLMokAC2QbuSc42mXmaOXop9iAtCXrJ5qXWjT59Abl2ESJAAX/tSIMMiyrrqQ3T6uS5gQK6kSqpqkUermGTexQFmYACflqR+hlWZSamzQpCLEDPsSmVVDT1TJw0JUhOAMRnYOARFRMTE5cQF+ZiBPIAII5B3EVG0b4AAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.peertube::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABIFBMVEUhHyAAAABzPBnxaA3CWBEnJSYbGRptbW16enpzc3PTayWhb04hHyAhHyAhHyAhHyAhHyAhHyAhHyAhHyAhHyAhHyAhHyAhHyAhHyAhHyApIh+0UhMfHiBWMhvsZg7zaQ0hHyAhHyAXHCHzaQ3xaA3xaA3xaA3xaA0hHyAhHyDxaA3xaA3xaA3xaA3xaA3xaA0oJickIiMdGxwUEhPxaA3xaA3xaA1sbGxwcHB3d3eFhYXxaA3xaA3xaA1zc3Nzc3Nzc3Nzc3Nzc3PxaA3xaA3xaA1zc3Nzc3NtdHjxaA3xaA1yc3STcFnvaA/yaAxzc3N4c2/FbDFzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3MhHyDxaA1zc3MAAAAfljyVAAAAXHRSTlMAAAAAAAAAAAAAAAAZkjMBHOLXYArj8p0u2VsJ1XaGL/OhKyXc1WEN2gwk2/SjKgEYiS4B/tYFGosqAdleAxzj12ML9Z8s850rJWbYeYMs1F8Koiri1V0MGZY0AYbIBFIAAAABYktHRAH/Ai3eAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4wYXFBUVX81QWQAAAKxJREFUGNNVz9UWgkAQANDBtdbu7lZsxe7ubpH//wxBPKDzNvdMAmi0Oj0QQgAYjCazBX7BStvsDqHoAzTtdLklf+Dx+vwICRAIhsKRaCyOvpAwJ6Up8pXOZHOIAFm+UCzJEQuvMhWrIFBUa/WGkodmq40Ad7q9/kDFwnA05lpYYCbT2ZykFvxQDhhmuVpvcvxaHra7vfp72KflcMSYEOB0vlyx+By+3R9PMSfe+P0enM1454kAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTktMDYtMjRUMDM6MjE6MjEtMDc6MDDse6MAAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE5LTA2LTI0VDAzOjIxOjIxLTA3OjAwnSYbvAAAAABJRU5ErkJggg==') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.soundcloud::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABsklEQVQ4y5WTy2pUQRCGv2rbzDjJeAlIBmOyipGIIJqFEBDElwh4yULGeRFXPoEIBl/AvQ/gC2RnxCAoxijiwks852S6+3dxzslcHJCpTXVX11/Xv0097gLPgVNMJxnQNfX4zsqleWbnpoMf/oa9d988MM9MC/rp+E0a+A0dsVobMNMCOO8B6McRoABJI+A6gJmN3D2A8jgEBCEkSEMBrcrsDAzDWWn3AjgKFaDMmgRqniGFgsaDp1jrLOngDf1XT1D+A1dFc4MKAkkiCVKjjVu7g9+4Rzx4i1u6hjXbuMWr0O5QPNvCu7IaCZwEKQukLGDrm5x8uI0tr6MkiGlkiv7yLfzN+6S5i6QsIMABkEfcxhbWWYMkVAOjxvYAjc3HNHrbKI9VBQBFwF25XQKSBjqIf1YBuAurEMrczgDygD6/x2LCpFLXLUyQ+PoldphhBhYfIX09XU1+Flaukz7uYqs3SHs7cG4BmTsmkBUF9mmXEwa28BNLPaQPLepuNcbGSWQquQC2/Kdcox1FUGkcB0ykck1nA2+wTzMs8stGnP4rbWGw74EuS/GFQWfK7/wF6P4F7fzIAYkdmdEAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.streamable::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABXFBMVEUPkPoNj/qExv0PkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoNj/oPkPoNj/oNj/qExv0PkPpruvwPkPornfoVk/opnPpnufwPkPqExv0Nj/oPkPoNj/oPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoOj/opnPsVk/oMjvoOkPoTkfo6pPsblfo3ovva7v7////v9/5Sr/whmPry+f5htvze8P7W7P5itvyl1v0imPu84P3o9P50v/zN6P73+/8lmvs8pfs+pfsKjvr9/v9EqfsNj/oom/v8/v9nufxAp/tJq/sQkPrb7v6t2f0IjPoclvr6/f9luPwUkvrp9f7h8f5ruvy/4f4kmftpuvwxoPum1v32+/8jmfpMrPvu9/7z+f9UsPs7pPv8/f/4/P9oufwalfpDqPsMj/ounvtVsPsnm/qzfQQ9AAAALXRSTlMAAAAggMzw0IYkBPb4iAamsgZ+jPwogpDO1vTYlPoulL4KivyUCiqO1PL01i67tUAWAAAAAWJLR0Q4oAel1gAAAAd0SU1FB+MGFxMuDXVcMbIAAADdSURBVBjTY2AAAmYWVjY2dg5OBgZGJiCXi4VbFwx4ePlAAlz8unAgIAgUENJFAsJMDMw8unp6+gaGRsYmpoa6IqIMYrp6ZuYWllbW5hY2toZ64gwSurp29g6OTs4urm7uHrqSDGy6nhZeet5WPr5+/gGBelJAgSCLYL+Q0LBw3YjIKKAAu250TGxcvE1CYlJySqquNAOHrl9aukVGZla2RU6uoZ4MA6esrl9evnWBYWFRMdBaOQYGXmSHyQNdyieA4CsogjzHpyQL4SqrqIJ9y8Cgpq6hqaWtogPyPgDmvSxRxBWM9AAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxOS0wNi0yNFQwMjo0NjoxMy0wNzowMCKUvXUAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTktMDYtMjRUMDI6NDY6MTMtMDc6MDBTyQXJAAAAAElFTkSuQmCC') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.twitchtv::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAYUExURf///2RBpWRBpWRBpWRBpWRBpWRBpf///+zQyUYAAAAGdFJOUwFdZX0lTzs4r5oAAAABYktHRAcWYYjrAAAAB3RJTUUH4AINEi42iSXRNAAAAD1JREFUCNdjYEiDAAZGGIMtjQEEUBlMCWoEGci6mGEMsxQgIy0BiB3AjLS0FAYQIw0kwABipoI1AhkBQBIAFCIXxiHgq80AAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.twitter::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAEsUExURf///1Cf21Gg3FGi31Gh3VKj4FGh3lKj4VKk4lKl41Ol5FOn51Sp6VSo6FOn5lCf21Gg3FGh3VGi31Gi31Gh3lGg3FGg3FGg3FGg3FGh3lGg3FGi31Kk4lKj4FGh3lGi31Kk4lGh3lGg3FGh3lOm5FOm5VGi31Kj4VSo6FGi31Gh3VGg3FKj4FOn51Gi31So6FWr7VOl5FGi31On51Sq6lKk4lOo51Sp6VOm5FSq61Ws7VOn51Oo51Sq61Ol5FOm5FSq61Wr7VOo51On51Sr7FWs7VSp6lGg3FGh3VOm5FWr7VSp6lKj4VOm5FSo6FSr7FWs7VWs7VWr7VSq6lOo51Om5FOo51So6FOm5VOl5FSq61Ws7VSr7FSp6lSp6VWs7lWr7VKk4lSq6v///6E3MNsAAABVdFJOUwAAAAAAAAAAAAAAAAAAAB0Ii+3xnBVTJhfsMKb+qTEp9GwBF/7lLAbo0m4pLkUTdvk2Ev3+EZnOBo/3Z8ffCRzH/D0OqPxiLnvx3UI8m9n1++GwXQZNS29BAAAAAWJLR0QAiAUdSAAAAAd0SU1FB+ACDRIwBwy67tEAAADKSURBVBjTY2BAB4xogIGRH8IQEBQSFhEVE2eQkJQC8ZmkQ8PCI2Rk5RjkIxUUlRgZlVWioqNjYlXVGNQ14iI1tbR14qLj4+MTdJkZ9PQNosJCE0OjgPz4KEMWBiPjhPiEmKQokIJ4E1MmBmazhHg4MGdlYmCzsLSC8ROsmRkZmFht4Eps7ViADmOzd4DyHZ2YmYACTOzOLmATXd04mIBOd/eQ9owFCXh5c7KB/MLi4+vnHxAYFBzCwcYEEmBi5uLm4eHl42RmAnsSAMZBLgZiFUQ5AAAAAElFTkSuQmCC') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.video::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAxgDGAP8nNqN7AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gMZBjQQLEEqGwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAA5SURBVDjLY2AYaMDIwMDwn1JD/lPCZhpwL+B1wf///ykzgBhDiAoDfIYQZQAjIyP5BuDTPJqQqAQAvW0ZAMk8+EEAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.vidlii::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAACvlBMVEUCWv8HXf8AWv8AAAD///8AVP+bqP8AWv8AVO4AOqUAGkgAyf8APa0AL4QABAsASdEAVv8AUv8AUv8AVP8AWP8BWv8JXv8RYv8QYv8DW/8DXP8xdv9RiP9Af/8IXf8AKP8KXv8JXf8NYf8aaf8ATP0UZP0AVf8AT/8AT/8AVv8ATedvnPVAf/8AT/sYZvl0o/8PYf8udf8aa/8FXf8AVf8AOrRBe/Nvn/8AUv0aaPkXZ/8ATv8AKYQZYuwIXf8ca/wTZP8ASP8AED0HUNwZaf8xdPwDWv8AAAAAQMRcjvQAU/8AMZssb/Jmmf8AU/8AJXsRW+dSif8AUv8AAAAASdQtdP8ATv8AQ/8AQv8APbtKgfQud/8XZ/8TZP8FXP8AKIIcZO4wdP8AF08KU95tnv4gafhZi/Rnl/ZzofcocP8AAAAAQ8Q4efRwnvVmlvVcjvgrcfsAQsQAOK0APrwAQcUEStMLXPgDWv8AHE8APLEARdIAQ80ASeEAVf8AOJkAAAAAAAAAAAAABBMAJJIAY/9rmP+vxv90n/+buPv29/7C1P+zx/n///2Crv/7+fjs8f++z/f///3l6fX9/f/L2fj9/P5ilv9Nh/3h6f6vyf/D0vT///2lwP/Z5Pf3+P9OiP9klvr9/Puzyf+QsPX//fnW4v/k6vfv8/86ev94pfj///uRtf/y8vby9f9Fgv9EgPzt7/jj7f8mcf+eufj///x1pP/Z4fT///52pf9Uivv09fnV4v8ncf64yvj7+/6vxPX///yyyf9ynvr6+vvG1/8ocv3O2/fz9v53ofX8+/nb5v+YuPz//vy0yv8vdP3e5/fn7v/p7PX09//b5P7///6eu/9Df/zq7vjc5//I1vT//v3+/v////9+q/9Tivnn6fPy8/rW4fzI1/2qwv6YtPT8+fX39/jz9PqJrveTsvqfpuxrAAAAhXRSTlMAAAAAAAAAAAAAAAAAAAAABSlERA45nrSzP3TZ7e12Ao2LusMcrJYhFwaR/uhCwP/x5tZzBWHy+n3OvA8u17jmpwgPrOz5jAF2+3FA7PdYG8fuPQaX5jAGAV/39MCmdy/e/RGz/vj5/f/rAXj4//z13n52i5qmmFQ1lqOQaTgIBAYKEAYAKGjtAgAAAKNJREFUGBkFwT0uRGEYBtD3ZJ77uT8iGrXCAixCr7OCyRA2oCKqiUYkOgoJwhqUbMAKLEChVYhk4pxswvcWfFGVEbYtuJutqir9Ibc0uh0+V+mf5gY69yN2PzKJiTjCg8qa3uLRAJpKM9AMoL1VOi9zJ4CQ9z0jwHX+RAwAURUxAMSB/L7u35wCGlKaHrDkPGVmwhlc6FN6l1iHKxupn+djAPgHrEwa+qrzy0oAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.vimeo::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAYFBMVEUAAAAIdZUKh6sLlLkLmr4LmsAMp88NrdYVW3MZj7Acstkrt9s1e5E7vN5EfI9JvdtKwuBijp5kpbl30eiDt8aG1uqRr7qTyNehxM+k4PCy3enB3OTg6Ovv9PXw+fz////L9U5WAAAAAXRSTlMAQObYZgAAAIFJREFUeNplz90OwiAMBWAQpAoyxclkP3je/y0H2AQXz0WT8100rRD6kNI9/cRroemQL3hXhoujZYj4OHoAmBvYGcBISwbWBvfXCrytnIDUQMkbsBpagMA7zhtQdyTFQAmIG7IkYniiZuh3XGsPqoOZkMOJOpAcLqUzNFGGu/57fwc1hgtp0mVSyQAAAABJRU5ErkJggg==') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.vine::before {\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divvBfgK727nYsyPiCrw03j6+fv6AaAMCgyAI1lElJBQSFh6hBxDJqOiY2Lh4SEKiIQlITmFqWrqRJkhGJrOA7Bzm5uUXsBBSVMySUpSVs6KyqrqmFmKuY30D0NjU3NLa1t6h9jvZ1Q30WGi19fb1KzAwyKFhYGSUY+MTkwpMTXNmFpibX+Di0rICWFldW9/A5tb2zu7ePtTrg0MeHePklPYzuDRw7uDF5RWvbwC32O0d7x8en55f4DHF6xv5/vHp6f/k6/vH+evuf1LAObptvSvrAAAAAElFTkSuQmCC') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.vocaroo::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAw9JREFUOE9jYMABuMwYmCyTJKUCGlSnFSy02TTzeOyCiQcDViX26qVz2TAyYtWmEMwuoZ3M7V40LcB79pHkc0svpvzY8jD//87nxf+3Pyn8v/ZO8v+VNyP/2mZJumI1QCWSI8232Hjumitlfw5+qPp/9l8TCt76JP//xkdx/wsXWCzjtWFkwTCkbWFe9plPk/+ga4Txz/xt/D/hkN//gMXif21a+NbyWjIwoRiy6GDT5rP/mlFsPfyp5n/NpOj/22+0gMUXXIz/H7hC/L/bFKFbPDZMrHAD5H35OPt2J9zacDv/f3V7xv9FhwrBGubsT/1//Pjx/1GJ/mD+/nfl/1v3Ovy3KRJNQbHdOlXCvOO03/+pm1P/v3v37n90hhtYw9HPtf8Xb2v937cmHswHeWPRxYj/LvkK3igGKARwicTO07118H3V/5kbi/4vPZMJtK3s/6YH2f+Pfq1B8VbjWrdnMu5s4nAD9CNFhKwz5DTUvLl419zKvAcLtG1P84BRl/b/5M/6/6f/NPzf/qzo84yj0Uus0xUU4Zor54bm9+4OfZG02OCuoAMTb9ZkC9ull1Nvrr2Z+XvRpaRfc65H/68F+jl9svEhzyLFWoccWVc+eyTHq/twydjlKRln7jX9bNMkMJnbhoFRL1xCqmKx6/yi2fYXa/c5/e846PV/5fW0/7OPx/yfcjzop34ulxdGGvDuU8mMXaX507lBuiN6ueadmQeT/p/93vf/1O+G//sP5fw/eL3o/5JLif8zVxs+Tlir9S26UyeFQQvJGBE7FvaFZ9LfN+1y+WjbItSb3GmXvXd15v8zroH/HxgE/D+aGPx/18vi/z07PeZNPRKxe/Kh0Ae8toxscCO4zBkYXArk9C1SxJUYjBkYPPIVtbbuTftz3cz//2O9wP/75iSAXdO72/dt2HL5F6YlfBW4MiJYXMiBiW3t7azHBx+V/t89N+H/8a+1//e9K/9attDp5LQjYX8SuvVL8RoAkmxa65299Erq1FnHo0qrl7t4BddriIs4MrM3rfWcFd+pGwVSAwBZ0bKP8yrZPAAAAABJRU5ErkJggg==') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.youtube::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAMCAYAAABr5z2BAAABIklEQVQoz53LvUrDUBjG8bOoOammSf1IoBSvoCB4JeIqOHgBLt6AIMRBBQelWurQ2kERnMRBsBUcIp5FJSBI5oQsJVkkUHh8W0o5nhaFHvjBgef/Mq+Q46RJBMkI/vE+aOus956tnEswIZe1LV0QyJ5sE2GzgZfVMtRNIdiDpccEssdlB1mW4bvTwdvWJtRdErM7U+8S/FJykCRJX5qm+KpVce8UMNLRLbulz4iSjTAMh6Iowsd5BeNadp3nUF0VlxAEwZBotXC0Usa4ll3meZdA1iguwvf9vpvDA2wvmKgYGtSud8suDB4TyGr2PF49D/vra9jRZ1BVdknMzgwuCGSnZEObwu6sBnVTCHZiaC7BhFx2PKdxUidiAH/4lLo9Mv0DELVs9qsOHXwAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -/* XXX Moved to end of stylesheet to avoid breaking whole stylesheet in Maxthon. */\n\ -@supports (text-decoration-style: dashed) or (-moz-text-decoration-style: dashed) {\n\ - .quotelink.forwardlink,\n\ - .backlink.forwardlink {\n\ - text-decoration: underline;\n\ - -moz-text-decoration-style: dashed;\n\ - text-decoration-style: dashed;\n\ - border-bottom: none;\n\ - }\n\ -}\n", - -report: -"#g-recaptcha,\n\ -:root:not(.js-enabled) #captchaContainerAlt {\n\ - height: auto;\n\ -}\n\ -#captchaContainerAlt td:nth-child(2) {\n\ - display: table-cell !important;\n\ -}\n\ -/* Archive reports */\n\ -#archive-report {\n\ - padding: 3px;\n\ -}\n\ -#archive-report-enabled {\n\ - vertical-align: middle;\n\ -}\n\ -#archive-report > label {\n\ - display: block;\n\ -}\n\ -#archive-report-reason {\n\ - display: block;\n\ - width: 98%;\n\ -}\n\ -.archive-report-success {\n\ - color: green;\n\ -}\n\ -.archive-report-error {\n\ - color: red;\n\ -}", - -www: -"#captcha-cnt {\n\ - height: auto;\n\ -}\n\ -:root:not(.js-enabled) #form {\n\ - display: block;\n\ -}\n\ -#bd > div[style], #bd > div[style] > * {\n\ - height: auto !important;\n\ - margin: 0 !important;\n\ - font-size: 0;\n\ -}\n", - -sub: function(css) { - var variables = { - site: g.SITE.selectors - }; - return css.replace(/\$[\w\$]+/g, function(name) { - var words = name.slice(1).split('$'); - var sel = variables; - for (var i = 0; i < words.length; i++) { - if (typeof sel !== 'object') return ':not(*)'; - sel = $.getOwn(sel, words[i]); - } - if (typeof sel !== 'string') return ':not(*)'; - return sel; - }); -} - -}; - -$ = (function() { - var $, - slice = [].slice, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - $ = function(selector, root) { - if (root == null) { - root = d.body; - } - return root.querySelector(selector); - }; - - $.DAY = 24 * ($.HOUR = 60 * ($.MINUTE = 60 * ($.SECOND = 1000))); - - $.id = function(id) { - return d.getElementById(id); - }; - - $.ready = function(fc) { - var cb; - if (d.readyState !== 'loading') { - $.queueTask(fc); - return; - } - cb = function() { - $.off(d, 'DOMContentLoaded', cb); - return fc(); - }; - return $.on(d, 'DOMContentLoaded', cb); - }; - - $.formData = function(form) { - var fd, key, val; - if (form instanceof HTMLFormElement) { - return new FormData(form); - } - fd = new FormData(); - for (key in form) { - val = form[key]; - if (val) { - if (typeof val === 'object' && 'newName' in val) { - fd.append(key, val, val.newName); - } else { - fd.append(key, val); - } - } - } - return fd; - }; - - $.extend = function(object, properties) { - var key, val; - for (key in properties) { - val = properties[key]; - object[key] = val; - } - }; - - $.dict = function() { - return Object.create(null); - }; - - $.dict.clone = function(obj) { - var arr, i, j, key, map, ref, val; - if (typeof obj !== 'object' || obj === null) { - return obj; - } else if (obj instanceof Array) { - arr = []; - for (i = j = 0, ref = obj.length; j < ref; i = j += 1) { - arr.push($.dict.clone(obj[i])); - } - return arr; - } else { - map = Object.create(null); - for (key in obj) { - val = obj[key]; - map[key] = $.dict.clone(val); - } - return map; - } - }; - - $.dict.json = function(str) { - return $.dict.clone(JSON.parse(str)); - }; - - $.hasOwn = function(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); - }; - - $.getOwn = function(obj, key) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - return obj[key]; - } else { - return void 0; - } - }; - - $.ajax = (function() { - var pageXHR; - if (window.wrappedJSObject && !XMLHttpRequest.wrappedJSObject) { - pageXHR = XPCNativeWrapper(window.wrappedJSObject.XMLHttpRequest); - } else { - pageXHR = XMLHttpRequest; - } - return function(url, options) { - var err, form, headers, key, onloadend, onprogress, r, ref, responseType, timeout, type, value, withCredentials; - if (options == null) { - options = {}; - } - if (options.responseType == null) { - options.responseType = 'json'; - } - options.type || (options.type = options.form && 'post' || 'get'); - url = url.replace(/^((?:https?:)?\/\/(?:\w+\.)?(?:4chan|4channel|4cdn)\.org)\/adv\//, '$1//adv/'); - onloadend = options.onloadend, timeout = options.timeout, responseType = options.responseType, withCredentials = options.withCredentials, type = options.type, onprogress = options.onprogress, form = options.form, headers = options.headers; - r = new pageXHR(); - try { - r.open(type, url, true); - ref = headers || {}; - for (key in ref) { - value = ref[key]; - r.setRequestHeader(key, value); - } - $.extend(r, { - onloadend: onloadend, - timeout: timeout, - responseType: responseType, - withCredentials: withCredentials - }); - $.extend(r.upload, { - onprogress: onprogress - }); - $.on(r, 'error', function() { - if (!r.status) { - return c.warn("4chan X failed to load: " + url); - } - }); - r.send(form); - } catch (error) { - err = error; - if (err.result !== 0x805e0006) { - throw err; - } - r.onloadend = onloadend; - $.queueTask($.event, 'error', null, r); - $.queueTask($.event, 'loadend', null, r); - } - return r; - }; - })(); - - $.lastModified = $.dict(); - - $.whenModified = function(url, bucket, cb, options) { - var ajax, headers, params, r, ref, t, timeout, url0; - if (options == null) { - options = {}; - } - timeout = options.timeout, ajax = options.ajax; - params = []; - if ($.engine === 'blink') { - params.push("s=" + bucket); - } - if (url.split('/')[2] === 'a.4cdn.org') { - params.push("t=" + (Date.now())); - } - url0 = url; - if (params.length) { - url += '?' + params.join('&'); - } - headers = $.dict(); - if ((t = (ref = $.lastModified[bucket]) != null ? ref[url0] : void 0) != null) { - headers['If-Modified-Since'] = t; - } - r = (ajax || $.ajax)(url, { - onloadend: function() { - var base; - ((base = $.lastModified)[bucket] || (base[bucket] = $.dict()))[url0] = this.getResponseHeader('Last-Modified'); - return cb.call(this); - }, - timeout: timeout, - headers: headers - }); - return r; - }; - - (function() { - var reqs; - reqs = $.dict(); - $.cache = function(url, cb, options) { - var ajax, onloadend, req; - if (options == null) { - options = {}; - } - ajax = options.ajax; - if ((req = reqs[url])) { - if (req.callbacks) { - req.callbacks.push(cb); - } else { - $.queueTask(function() { - return cb.call(req, { - isCached: true - }); - }); - } - return req; - } - onloadend = function() { - var fn1, j, len, ref; - if (!this.status) { - delete reqs[url]; - } - ref = this.callbacks; - fn1 = (function(_this) { - return function(cb) { - return $.queueTask(function() { - return cb.call(_this, { - isCached: false - }); - }); - }; - })(this); - for (j = 0, len = ref.length; j < len; j++) { - cb = ref[j]; - fn1(cb); - } - return delete this.callbacks; - }; - req = (ajax || $.ajax)(url, { - onloadend: onloadend - }); - req.callbacks = [cb]; - return reqs[url] = req; - }; - return $.cleanCache = function(testf) { - var url; - for (url in reqs) { - if (testf(url)) { - delete reqs[url]; - } - } - }; - })(); - - $.cb = { - checked: function() { - if ($.hasOwn(Conf, this.name)) { - $.set(this.name, this.checked); - return Conf[this.name] = this.checked; - } - }, - value: function() { - if ($.hasOwn(Conf, this.name)) { - $.set(this.name, this.value.trim()); - return Conf[this.name] = this.value; - } - } - }; - - $.asap = function(test, cb) { - if (test()) { - return cb(); - } else { - return setTimeout($.asap, 25, test, cb); - } - }; - - $.onExists = function(root, selector, cb) { - var el, observer; - if (el = $(selector, root)) { - return cb(el); - } - observer = new MutationObserver(function() { - if (el = $(selector, root)) { - observer.disconnect(); - return cb(el); - } - }); - return observer.observe(root, { - childList: true, - subtree: true - }); - }; - - $.addStyle = function(css, id, test) { - var style; - if (test == null) { - test = 'head'; - } - style = $.el('style', { - textContent: css - }); - if (id != null) { - style.id = id; - } - $.onExists(doc, test, function() { - return $.add(d.head, style); - }); - return style; - }; - - $.addCSP = function(policy) { - var head, meta; - meta = $.el('meta', { - httpEquiv: 'Content-Security-Policy', - content: policy - }); - if (d.head) { - $.add(d.head, meta); - return $.rm(meta); - } else { - head = $.add(doc || d, $.el('head')); - $.add(head, meta); - return $.rm(head); - } - }; - - $.x = function(path, root) { - root || (root = d.body); - return d.evaluate(path, root, null, 8, null).singleNodeValue; - }; - - $.X = function(path, root) { - root || (root = d.body); - return d.evaluate(path, root, null, 7, null); - }; - - $.addClass = function() { - var className, classNames, el, j, len; - el = arguments[0], classNames = 2 <= arguments.length ? slice.call(arguments, 1) : []; - for (j = 0, len = classNames.length; j < len; j++) { - className = classNames[j]; - el.classList.add(className); - } - }; - - $.rmClass = function() { - var className, classNames, el, j, len; - el = arguments[0], classNames = 2 <= arguments.length ? slice.call(arguments, 1) : []; - for (j = 0, len = classNames.length; j < len; j++) { - className = classNames[j]; - el.classList.remove(className); - } - }; - - $.toggleClass = function(el, className) { - return el.classList.toggle(className); - }; - - $.hasClass = function(el, className) { - return indexOf.call(el.classList, className) >= 0; - }; - - $.rm = function(el) { - return el != null ? el.remove() : void 0; - }; - - $.rmAll = function(root) { - return root.textContent = null; - }; - - $.tn = function(s) { - return d.createTextNode(s); - }; - - $.frag = function() { - return d.createDocumentFragment(); - }; - - $.nodes = function(nodes) { - var frag, j, len, node; - if (!(nodes instanceof Array)) { - return nodes; - } - frag = $.frag(); - for (j = 0, len = nodes.length; j < len; j++) { - node = nodes[j]; - frag.appendChild(node); - } - return frag; - }; - - $.add = function(parent, el) { - return parent.appendChild($.nodes(el)); - }; - - $.prepend = function(parent, el) { - return parent.insertBefore($.nodes(el), parent.firstChild); - }; - - $.after = function(root, el) { - return root.parentNode.insertBefore($.nodes(el), root.nextSibling); - }; - - $.before = function(root, el) { - return root.parentNode.insertBefore($.nodes(el), root); - }; - - $.replace = function(root, el) { - return root.parentNode.replaceChild($.nodes(el), root); - }; - - $.el = function(tag, properties, properties2) { - var el; - el = d.createElement(tag); - if (properties) { - $.extend(el, properties); - } - if (properties2) { - $.extend(el, properties2); - } - return el; - }; - - $.on = function(el, events, handler) { - var event, j, len, ref; - ref = events.split(' '); - for (j = 0, len = ref.length; j < len; j++) { - event = ref[j]; - el.addEventListener(event, handler, false); - } - }; - - $.off = function(el, events, handler) { - var event, j, len, ref; - ref = events.split(' '); - for (j = 0, len = ref.length; j < len; j++) { - event = ref[j]; - el.removeEventListener(event, handler, false); - } - }; - - $.one = function(el, events, handler) { - var cb; - cb = function(e) { - $.off(el, events, cb); - return handler.call(this, e); - }; - return $.on(el, events, cb); - }; - - $.event = function(event, detail, root) { - if (root == null) { - root = d; - } - if ((detail != null) && typeof cloneInto === 'function') { - detail = cloneInto(detail, d.defaultView); - } - return root.dispatchEvent(new CustomEvent(event, { - bubbles: true, - cancelable: true, - detail: detail - })); - }; - - (function() { - var clone, err, ref, unsafeConstructors; - if (!(/PaleMoon\//.test(navigator.userAgent) && +(typeof GM_info !== "undefined" && GM_info !== null ? (ref = GM_info.version) != null ? ref.split('.')[0] : void 0 : void 0) >= 2 && typeof cloneInto === 'undefined')) { - return; - } - try { - return new CustomEvent('x', { - detail: {} - }); - } catch (error) { - err = error; - unsafeConstructors = { - Object: unsafeWindow.Object, - Array: unsafeWindow.Array - }; - clone = function(obj) { - var constructor, key, obj2, val; - if ((obj != null) && typeof obj === 'object' && (constructor = unsafeConstructors[obj.constructor.name])) { - obj2 = new constructor(); - for (key in obj) { - val = obj[key]; - obj2[key] = clone(val); - } - return obj2; - } else { - return obj; - } - }; - return $.event = function(event, detail, root) { - if (root == null) { - root = d; - } - return root.dispatchEvent(new CustomEvent(event, { - bubbles: true, - cancelable: true, - detail: clone(detail) - })); - }; - } - })(); - - $.modifiedClick = function(e) { - return e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0; - }; - - $.open = (typeof GM !== "undefined" && GM !== null ? GM.openInTab : void 0) != null ? GM.openInTab : typeof GM_openInTab !== "undefined" && GM_openInTab !== null ? GM_openInTab : function(url) { - return window.open(url, '_blank'); - }; - - $.debounce = function(wait, fn) { - var args, exec, lastCall, that, timeout; - lastCall = 0; - timeout = null; - that = null; - args = null; - exec = function() { - lastCall = Date.now(); - return fn.apply(that, args); - }; - return function() { - args = arguments; - that = this; - if (lastCall < Date.now() - wait) { - return exec(); - } - clearTimeout(timeout); - return timeout = setTimeout(exec, wait); - }; - }; - - $.queueTask = (function() { - var execTask, taskChannel, taskQueue; - taskQueue = []; - execTask = function() { - var args, func, task; - task = taskQueue.shift(); - func = task[0]; - args = Array.prototype.slice.call(task, 1); - return func.apply(func, args); - }; - if (window.MessageChannel) { - taskChannel = new MessageChannel(); - taskChannel.port1.onmessage = execTask; - return function() { - taskQueue.push(arguments); - return taskChannel.port2.postMessage(null); - }; - } else { - return function() { - taskQueue.push(arguments); - return setTimeout(execTask, 0); - }; - } - })(); - - $.global = function(fn, data) { - var script; - if (doc) { - script = $.el('script', { - textContent: "(" + fn + ").call(document.currentScript.dataset);" - }); - if (data) { - $.extend(script.dataset, data); - } - $.add(d.head || doc, script); - $.rm(script); - return script.dataset; - } else { - try { - fn.call(data); - } catch (error) {} - return data; - } - }; - - $.bytesToString = function(size) { - var unit; - unit = 0; - while (size >= 1024) { - size /= 1024; - unit++; - } - size = unit > 1 ? Math.round(size * 100) / 100 : Math.round(size); - return size + " " + ['B', 'KB', 'MB', 'GB'][unit]; - }; - - $.minmax = function(value, min, max) { - return (value < min ? min : value > max ? max : value); - }; - - $.hasAudio = function(video) { - return video.mozHasAudio || !!video.webkitAudioDecodedByteCount; - }; - - $.luma = function(rgb) { - return rgb[0] * 0.299 + rgb[1] * 0.587 + rgb[2] * 0.114; - }; - - $.unescape = function(text) { - if (text == null) { - return text; - } - return text.replace(/<[^>]*>/g, '').replace(/&(amp|#039|quot|lt|gt|#44);/g, function(c) { - return { - '&': '&', - ''': "'", - '"': '"', - '<': '<', - '>': '>', - ',': ',' - }[c]; - }); - }; - - $.isImage = function(url) { - return /\.(jpe?g|jfif|png|gif|bmp|webp|avif|jxl)$/i.test(url); - }; - - $.isVideo = function(url) { - return /\.(webm|mp4|ogv)$/i.test(url); - }; - - $.engine = (function() { - if (/Edge\//.test(navigator.userAgent)) { - return 'edge'; - } - if (/Chrome\//.test(navigator.userAgent)) { - return 'blink'; - } - if (/WebKit\//.test(navigator.userAgent)) { - return 'webkit'; - } - if (/Gecko\/|Goanna/.test(navigator.userAgent)) { - return 'gecko'; - } - })(); - - $.platform = 'userscript'; - - $.hasStorage = (function() { - try { - if (localStorage.getItem(g.NAMESPACE + 'hasStorage') === 'true') { - return true; - } - localStorage.setItem(g.NAMESPACE + 'hasStorage', 'true'); - return localStorage.getItem(g.NAMESPACE + 'hasStorage') === 'true'; - } catch (error) { - return false; - } - })(); - - $.item = function(key, val) { - var item; - item = $.dict(); - item[key] = val; - return item; - }; - - $.oneItemSugar = function(fn) { - return function(key, val, cb) { - if (typeof key === 'string') { - return fn($.item(key, val), cb); - } else { - return fn(key, val); - } - }; - }; - - $.syncing = $.dict(); - - $.securityCheck = function(data) { - if (location.protocol !== 'https:') { - return delete data['Redirect to HTTPS']; - } - }; - - if (((typeof GM !== "undefined" && GM !== null ? GM.deleteValue : void 0) != null) && window.BroadcastChannel && (typeof GM_addValueChangeListener === "undefined" || GM_addValueChangeListener === null)) { - $.syncChannel = new BroadcastChannel(g.NAMESPACE + 'sync'); - $.on($.syncChannel, 'message', function(e) { - var cb, key, ref, results, val; - ref = e.data; - results = []; - for (key in ref) { - val = ref[key]; - if ((cb = $.syncing[key])) { - results.push(cb($.dict.json(JSON.stringify(val)), key)); - } - } - return results; - }); - $.sync = function(key, cb) { - return $.syncing[key] = cb; - }; - $.forceSync = function() {}; - $["delete"] = function(keys, cb) { - var key; - if (!(keys instanceof Array)) { - keys = [keys]; - } - return Promise.all((function() { - var j, len, results; - results = []; - for (j = 0, len = keys.length; j < len; j++) { - key = keys[j]; - results.push(GM.deleteValue(g.NAMESPACE + key)); - } - return results; - })()).then(function() { - var items, j, key, len; - items = $.dict(); - for (j = 0, len = keys.length; j < len; j++) { - key = keys[j]; - items[key] = void 0; - } - $.syncChannel.postMessage(items); - return typeof cb === "function" ? cb() : void 0; - }); - }; - $.get = $.oneItemSugar(function(items, cb) { - var key, keys; - keys = Object.keys(items); - return Promise.all((function() { - var j, len, results; - results = []; - for (j = 0, len = keys.length; j < len; j++) { - key = keys[j]; - results.push(GM.getValue(g.NAMESPACE + key)); - } - return results; - })()).then(function(values) { - var i, j, len, val; - for (i = j = 0, len = values.length; j < len; i = ++j) { - val = values[i]; - if (val) { - items[keys[i]] = $.dict.json(val); - } - } - return cb(items); - }); - }); - $.set = $.oneItemSugar(function(items, cb) { - var key, val; - $.securityCheck(items); - return Promise.all((function() { - var results; - results = []; - for (key in items) { - val = items[key]; - results.push(GM.setValue(g.NAMESPACE + key, JSON.stringify(val))); - } - return results; - })()).then(function() { - $.syncChannel.postMessage(items); - return typeof cb === "function" ? cb() : void 0; - }); - }); - $.clear = function(cb) { - return GM.listValues().then(function(keys) { - return $["delete"](keys.map(function(key) { - return key.replace(g.NAMESPACE, ''); - }), cb); - })["catch"](function() { - return $["delete"](Object.keys(Conf).concat(['previousversion', 'QR Size', 'QR.persona']), cb); - }); - }; - } else { - if (typeof GM_deleteValue === "undefined" || GM_deleteValue === null) { - $.perProtocolSettings = true; - } - if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) { - $.getValue = GM_getValue; - $.listValues = function() { - return GM_listValues(); - }; - } else if ($.hasStorage) { - $.getValue = function(key) { - return localStorage.getItem(key); - }; - $.listValues = function() { - var key, results; - results = []; - for (key in localStorage) { - if (key.slice(0, g.NAMESPACE.length) === g.NAMESPACE) { - results.push(key); - } - } - return results; - }; - } else { - $.getValue = function() {}; - $.listValues = function() { - return []; - }; - } - if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) { - $.setValue = GM_setValue; - $.deleteValue = GM_deleteValue; - } else if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) { - $.oldValue = $.dict(); - $.setValue = function(key, val) { - GM_setValue(key, val); - if (key in $.syncing) { - $.oldValue[key] = val; - if ($.hasStorage) { - return localStorage.setItem(key, val); - } - } - }; - $.deleteValue = function(key) { - GM_deleteValue(key); - if (key in $.syncing) { - delete $.oldValue[key]; - if ($.hasStorage) { - return localStorage.removeItem(key); - } - } - }; - if (!$.hasStorage) { - $.cantSync = true; - } - } else if ($.hasStorage) { - $.oldValue = $.dict(); - $.setValue = function(key, val) { - if (key in $.syncing) { - $.oldValue[key] = val; - } - return localStorage.setItem(key, val); - }; - $.deleteValue = function(key) { - if (key in $.syncing) { - delete $.oldValue[key]; - } - return localStorage.removeItem(key); - }; - } else { - $.setValue = function() {}; - $.deleteValue = function() {}; - $.cantSync = $.cantSet = true; - } - if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) { - $.sync = function(key, cb) { - return $.syncing[key] = GM_addValueChangeListener(g.NAMESPACE + key, function(key2, oldValue, newValue, remote) { - if (remote) { - if (newValue !== void 0) { - newValue = $.dict.json(newValue); - } - return cb(newValue, key); - } - }); - }; - $.forceSync = function() {}; - } else if ((typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) || $.hasStorage) { - $.sync = function(key, cb) { - key = g.NAMESPACE + key; - $.syncing[key] = cb; - return $.oldValue[key] = $.getValue(key); - }; - (function() { - var onChange; - onChange = function(arg) { - var cb, key, newValue; - key = arg.key, newValue = arg.newValue; - if (!(cb = $.syncing[key])) { - return; - } - if (newValue != null) { - if (newValue === $.oldValue[key]) { - return; - } - $.oldValue[key] = newValue; - return cb($.dict.json(newValue), key.slice(g.NAMESPACE.length)); - } else { - if ($.oldValue[key] == null) { - return; - } - delete $.oldValue[key]; - return cb(void 0, key.slice(g.NAMESPACE.length)); - } - }; - $.on(window, 'storage', onChange); - return $.forceSync = function(key) { - key = g.NAMESPACE + key; - return onChange({ - key: key, - newValue: $.getValue(key) - }); - }; - })(); - } else { - $.sync = function() {}; - $.forceSync = function() {}; - } - $["delete"] = function(keys) { - var j, key, len; - if (!(keys instanceof Array)) { - keys = [keys]; - } - for (j = 0, len = keys.length; j < len; j++) { - key = keys[j]; - $.deleteValue(g.NAMESPACE + key); - } - }; - $.get = $.oneItemSugar(function(items, cb) { - return $.queueTask($.getSync, items, cb); - }); - $.getSync = function(items, cb) { - var err, key, val2; - for (key in items) { - if ((val2 = $.getValue(g.NAMESPACE + key))) { - try { - items[key] = $.dict.json(val2); - } catch (error) { - err = error; - if (!/^(?:undefined)*$/.test(val2)) { - throw err; - } - } - } - } - return cb(items); - }; - $.set = $.oneItemSugar(function(items, cb) { - $.securityCheck(items); - return $.queueTask(function() { - var key, value; - for (key in items) { - value = items[key]; - $.setValue(g.NAMESPACE + key, JSON.stringify(value)); - } - return typeof cb === "function" ? cb() : void 0; - }); - }); - $.clear = function(cb) { - $["delete"](Object.keys(Conf)); - $["delete"](['previousversion', 'QR Size', 'QR.persona']); - try { - $["delete"]($.listValues().map(function(key) { - return key.replace(g.NAMESPACE, ''); - })); - } catch (error) {} - return typeof cb === "function" ? cb() : void 0; - }; - } - - return $; - -}).call(this); - -$$ = (function() { - var $$, - slice = [].slice; - - $$ = function(selector, root) { - if (root == null) { - root = d.body; - } - return slice.call(root.querySelectorAll(selector)); - }; - - return $$; - -}).call(this); - -CrossOrigin = (function() { - var CrossOrigin, Request; - - CrossOrigin = { - binary: function(url, cb, headers) { - var fallback, gmOptions; - if (headers == null) { - headers = $.dict(); - } - url = url.replace(/^((?:https?:)?\/\/(?:\w+\.)?(?:4chan|4channel|4cdn)\.org)\/adv\//, '$1//adv/'); - fallback = function() { - return $.ajax(url, { - headers: headers, - responseType: 'arraybuffer', - onloadend: function() { - if (this.status && this.response) { - return cb(new Uint8Array(this.response), this.getAllResponseHeaders()); - } else { - return cb(null); - } - } - }); - }; - if (!(((typeof GM !== "undefined" && GM !== null ? GM.xmlHttpRequest : void 0) != null) || (typeof GM_xmlhttpRequest !== "undefined" && GM_xmlhttpRequest !== null))) { - fallback(); - return; - } - gmOptions = { - method: "GET", - url: url, - headers: headers, - responseType: 'arraybuffer', - overrideMimeType: 'text/plain; charset=x-user-defined', - onload: function(xhr) { - var data, i, r; - if (xhr.response instanceof ArrayBuffer) { - data = new Uint8Array(xhr.response); - } else { - r = xhr.responseText; - data = new Uint8Array(r.length); - i = 0; - while (i < r.length) { - data[i] = r.charCodeAt(i); - i++; - } - } - return cb(data, xhr.responseHeaders); - }, - onerror: function() { - return cb(null); - }, - onabort: function() { - return cb(null); - } - }; - try { - return ((typeof GM !== "undefined" && GM !== null ? GM.xmlHttpRequest : void 0) || GM_xmlhttpRequest)(gmOptions); - } catch (error) { - return fallback(); - } - }, - file: function(url, cb) { - return CrossOrigin.binary(url, function(data, headers) { - var blob, contentDisposition, contentType, match, mime, name, ref, ref1, ref2, ref3, ref4; - if (data == null) { - return cb(null); - } - name = (ref = url.match(/([^\/?#]+)\/*(?:$|[?#])/)) != null ? ref[1] : void 0; - contentType = (ref1 = headers.match(/Content-Type:\s*(.*)/i)) != null ? ref1[1] : void 0; - contentDisposition = (ref2 = headers.match(/Content-Disposition:\s*(.*)/i)) != null ? ref2[1] : void 0; - mime = (contentType != null ? contentType.match(/[^;]*/)[0] : void 0) || 'application/octet-stream'; - match = (contentDisposition != null ? (ref3 = contentDisposition.match(/\bfilename\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref3[1] : void 0 : void 0) || (contentType != null ? (ref4 = contentType.match(/\bname\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref4[1] : void 0 : void 0); - if (match) { - name = match.replace(/\\"/g, '"'); - } - if (/^text\/plain;\s*charset=x-user-defined$/i.test(mime)) { - mime = $.getOwn(QR.typeFromExtension, name.match(/[^.]*$/)[0].toLowerCase()) || 'application/octet-stream'; - } - blob = new Blob([data], { - type: mime - }); - blob.name = name; - return cb(blob); - }); - }, - Request: Request = (function() { - function Request() {} - - Request.prototype.status = 0; - - Request.prototype.statusText = ''; - - Request.prototype.response = null; - - Request.prototype.responseHeaderString = null; - - Request.prototype.getResponseHeader = function(headerName) { - var header, i, j, key, len, ref, ref1, ref2, val; - if ((this.responseHeaders == null) && (this.responseHeaderString != null)) { - this.responseHeaders = $.dict(); - ref = this.responseHeaderString.split('\r\n'); - for (j = 0, len = ref.length; j < len; j++) { - header = ref[j]; - if ((i = header.indexOf(':')) >= 0) { - key = header.slice(0, i).trim().toLowerCase(); - val = header.slice(i + 1).trim(); - this.responseHeaders[key] = val; - } - } - } - return (ref1 = (ref2 = this.responseHeaders) != null ? ref2[headerName.toLowerCase()] : void 0) != null ? ref1 : null; - }; - - Request.prototype.abort = function() {}; - - Request.prototype.onloadend = function() {}; - - return Request; - - })(), - ajax: function(url, options) { - var gmOptions, gmReq, headers, onloadend, req, responseType, timeout; - if (options == null) { - options = {}; - } - onloadend = options.onloadend, timeout = options.timeout, responseType = options.responseType, headers = options.headers; - if (responseType == null) { - responseType = 'json'; - } - if (!(((typeof GM !== "undefined" && GM !== null ? GM.xmlHttpRequest : void 0) != null) || (typeof GM_xmlhttpRequest !== "undefined" && GM_xmlhttpRequest !== null))) { - return $.ajax(url, options); - } - req = new CrossOrigin.Request(); - req.onloadend = onloadend; - gmOptions = { - method: 'GET', - url: url, - headers: headers, - timeout: timeout, - onload: function(xhr) { - var response; - try { - response = (function() { - switch (responseType) { - case 'json': - if (xhr.responseText) { - return JSON.parse(xhr.responseText); - } else { - return null; - } - break; - default: - return xhr.responseText; - } - })(); - $.extend(req, { - response: response, - status: xhr.status, - statusText: xhr.statusText, - responseHeaderString: xhr.responseHeaders - }); - } catch (error) {} - return req.onloadend(); - }, - onerror: function() { - return req.onloadend(); - }, - onabort: function() { - return req.onloadend(); - }, - ontimeout: function() { - return req.onloadend(); - } - }; - try { - gmReq = ((typeof GM !== "undefined" && GM !== null ? GM.xmlHttpRequest : void 0) || GM_xmlhttpRequest)(gmOptions); - } catch (error) { - return $.ajax(url, options); - } - if (gmReq && typeof gmReq.abort === 'function') { - req.abort = function() { - try { - return gmReq.abort(); - } catch (error) {} - }; - } - return req; - }, - cache: function(url, cb) { - return $.cache(url, cb, { - ajax: CrossOrigin.ajax - }); - }, - permission: function(cb) { - return cb(); - } - }; - - return CrossOrigin; - -}).call(this); - -Board = (function() { - var Board; - - Board = (function() { - Board.prototype.toString = function() { - return this.ID; - }; - - function Board(ID) { - var ref; - this.ID = ID; - this.boardID = this.ID; - this.siteID = g.SITE.ID; - this.threads = new SimpleDict(); - this.posts = new SimpleDict(); - this.config = ((ref = BoardConfig.boards) != null ? ref[this.ID] : void 0) || {}; - g.boards[this] = this; - } - - Board.prototype.cooldowns = function() { - var c, c2, i, key, len, ref; - c2 = (this.config || {}).cooldowns || {}; - c = { - thread: c2.threads || 0, - reply: c2.replies || 0, - image: c2.images || 0, - thread_global: 300 - }; - if (d.cookie.indexOf('pass_enabled=1') >= 0) { - ref = ['reply', 'image']; - for (i = 0, len = ref.length; i < len; i++) { - key = ref[i]; - c[key] = Math.ceil(c[key] / 2); - } - } - return c; - }; - - return Board; - - })(); - - return Board; - -}).call(this); - -Callbacks = (function() { - var Callbacks; - - Callbacks = (function() { - Callbacks.Post = new Callbacks('Post'); - - Callbacks.Thread = new Callbacks('Thread'); - - Callbacks.CatalogThread = new Callbacks('Catalog Thread'); - - Callbacks.CatalogThreadNative = new Callbacks('Catalog Thread'); - - function Callbacks(type) { - this.type = type; - this.keys = []; - } - - Callbacks.prototype.push = function(arg) { - var cb, name; - name = arg.name, cb = arg.cb; - if (!this[name]) { - this.keys.push(name); - } - return this[name] = cb; - }; - - Callbacks.prototype.execute = function(node, keys, force) { - var err, errors, i, len, name, ref, ref1, ref2; - if (keys == null) { - keys = this.keys; - } - if (force == null) { - force = false; - } - if (node.callbacksExecuted && !force) { - return; - } - node.callbacksExecuted = true; - for (i = 0, len = keys.length; i < len; i++) { - name = keys[i]; - try { - if ((ref = this[name]) != null) { - ref.call(node); - } - } catch (error) { - err = error; - if (!errors) { - errors = []; - } - errors.push({ - message: ['"', name, '" crashed on node ', this.type, ' No.', node.ID, ' (', node.board, ').'].join(''), - error: err, - html: (ref1 = node.nodes) != null ? (ref2 = ref1.root) != null ? ref2.outerHTML : void 0 : void 0 - }); - } - } - if (errors) { - return Main.handleErrors(errors); - } - }; - - return Callbacks; - - })(); - - return Callbacks; - -}).call(this); - -CatalogThread = (function() { - var CatalogThread; - - CatalogThread = (function() { - CatalogThread.prototype.toString = function() { - return this.ID; - }; - - function CatalogThread(root, thread) { - var post; - this.thread = thread; - this.ID = this.thread.ID; - this.board = this.thread.board; - post = this.thread.OP.nodes.post; - this.nodes = { - root: root, - thumb: $('.catalog-thumb', post), - icons: $('.catalog-icons', post), - postCount: $('.post-count', post), - fileCount: $('.file-count', post), - pageCount: $('.page-count', post), - replies: null - }; - this.thread.catalogView = this; - } - - return CatalogThread; - - })(); - - return CatalogThread; - -}).call(this); - -CatalogThreadNative = (function() { - var CatalogThreadNative; - - CatalogThreadNative = (function() { - CatalogThreadNative.prototype.toString = function() { - return this.ID; - }; - - function CatalogThreadNative(root) { - this.nodes = { - root: root, - thumb: $(g.SITE.selectors.catalog.thumb, root) - }; - this.siteID = g.SITE.ID; - this.boardID = this.nodes.thumb.parentNode.pathname.split(/\/+/)[1]; - this.board = g.boards[this.boardID] || new Board(this.boardID); - this.ID = this.threadID = +(root.dataset.id || root.id).match(/\d*$/)[0]; - this.thread = this.board.threads.get(this.ID) || new Thread(this.ID, this.board); - } - - return CatalogThreadNative; - - })(); - - return CatalogThreadNative; - -}).call(this); - -Connection = (function() { - var Connection, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; - - Connection = (function() { - function Connection(target, origin, cb) { - this.target = target; - this.origin = origin; - this.cb = cb != null ? cb : {}; - this.onMessage = bind(this.onMessage, this); - this.send = bind(this.send, this); - $.on(window, 'message', this.onMessage); - } - - Connection.prototype.targetWindow = function() { - if (this.target instanceof window.HTMLIFrameElement) { - return this.target.contentWindow; - } else { - return this.target; - } - }; - - Connection.prototype.send = function(data) { - return this.targetWindow().postMessage("" + g.NAMESPACE + (JSON.stringify(data)), this.origin); - }; - - Connection.prototype.onMessage = function(e) { - var data, type, value; - if (!(e.source === this.targetWindow() && e.origin === this.origin && typeof e.data === 'string' && e.data.slice(0, g.NAMESPACE.length) === g.NAMESPACE)) { - return; - } - data = JSON.parse(e.data.slice(g.NAMESPACE.length)); - for (type in data) { - value = data[type]; - if ($.hasOwn(this.cb, type)) { - this.cb[type](value); - } - } - }; - - return Connection; - - })(); - - return Connection; - -}).call(this); - -DataBoard = (function() { - var DataBoard, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; - - DataBoard = (function() { - DataBoard.keys = ['hiddenThreads', 'hiddenPosts', 'lastReadPosts', 'yourPosts', 'watchedThreads', 'watcherLastModified', 'customTitles']; - - function DataBoard(key1, sync, dontClean) { - var init; - this.key = key1; - this.onSync = bind(this.onSync, this); - this.initData(Conf[this.key]); - $.sync(this.key, this.onSync); - if (!dontClean) { - this.clean(); - } - if (!sync) { - return; - } - init = (function(_this) { - return function() { - $.off(d, '4chanXInitFinished', init); - return _this.sync = sync; - }; - })(this); - $.on(d, '4chanXInitFinished', init); - } - - DataBoard.prototype.initData = function(data1) { - var base, boards, lastChecked, name, ref; - this.data = data1; - if (this.data.boards) { - ref = this.data, boards = ref.boards, lastChecked = ref.lastChecked; - this.data['4chan.org'] = { - boards: boards, - lastChecked: lastChecked - }; - delete this.data.boards; - delete this.data.lastChecked; - } - return (base = this.data)[name = g.SITE.ID] || (base[name] = { - boards: $.dict() - }); - }; - - DataBoard.prototype.changes = []; - - DataBoard.prototype.save = function(change, cb) { - change(); - this.changes.push(change); - return $.get(this.key, { - boards: $.dict() - }, (function(_this) { - return function(items) { - var i, len, needSync, ref; - if (!_this.changes.length) { - return; - } - needSync = (items[_this.key].version || 0) > (_this.data.version || 0); - if (needSync) { - _this.initData(items[_this.key]); - ref = _this.changes; - for (i = 0, len = ref.length; i < len; i++) { - change = ref[i]; - change(); - } - } - _this.changes = []; - _this.data.version = (_this.data.version || 0) + 1; - return $.set(_this.key, _this.data, function() { - if (needSync) { - if (typeof _this.sync === "function") { - _this.sync(); - } - } - return typeof cb === "function" ? cb() : void 0; - }); - }; - })(this)); - }; - - DataBoard.prototype.forceSync = function(cb) { - return $.get(this.key, { - boards: $.dict() - }, (function(_this) { - return function(items) { - var change, i, len, ref; - if ((items[_this.key].version || 0) > (_this.data.version || 0)) { - _this.initData(items[_this.key]); - ref = _this.changes; - for (i = 0, len = ref.length; i < len; i++) { - change = ref[i]; - change(); - } - if (typeof _this.sync === "function") { - _this.sync(); - } - } - return typeof cb === "function" ? cb() : void 0; - }; - })(this)); - }; - - DataBoard.prototype["delete"] = function(arg, cb) { - var boardID, postID, siteID, threadID; - siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID; - siteID || (siteID = g.SITE.ID); - if (!this.data[siteID]) { - return; - } - return this.save((function(_this) { - return function() { - var ref; - if (postID) { - if (!((ref = _this.data[siteID].boards[boardID]) != null ? ref[threadID] : void 0)) { - return; - } - delete _this.data[siteID].boards[boardID][threadID][postID]; - return _this.deleteIfEmpty({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }); - } else if (threadID) { - if (!_this.data[siteID].boards[boardID]) { - return; - } - delete _this.data[siteID].boards[boardID][threadID]; - return _this.deleteIfEmpty({ - siteID: siteID, - boardID: boardID - }); - } else { - return delete _this.data[siteID].boards[boardID]; - } - }; - })(this), cb); - }; - - DataBoard.prototype.deleteIfEmpty = function(arg) { - var boardID, siteID, threadID; - siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID; - if (!this.data[siteID]) { - return; - } - if (threadID) { - if (!Object.keys(this.data[siteID].boards[boardID][threadID]).length) { - delete this.data[siteID].boards[boardID][threadID]; - return this.deleteIfEmpty({ - siteID: siteID, - boardID: boardID - }); - } - } else if (!Object.keys(this.data[siteID].boards[boardID]).length) { - return delete this.data[siteID].boards[boardID]; - } - }; - - DataBoard.prototype.set = function(data, cb) { - return this.save((function(_this) { - return function() { - return _this.setUnsafe(data); - }; - })(this), cb); - }; - - DataBoard.prototype.setUnsafe = function(arg) { - var base, base1, base2, base3, boardID, postID, siteID, threadID, val; - siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, val = arg.val; - siteID || (siteID = g.SITE.ID); - (base = this.data)[siteID] || (base[siteID] = { - boards: $.dict() - }); - if (postID !== void 0) { - return ((base1 = ((base2 = this.data[siteID].boards)[boardID] || (base2[boardID] = $.dict())))[threadID] || (base1[threadID] = $.dict()))[postID] = val; - } else if (threadID !== void 0) { - return ((base3 = this.data[siteID].boards)[boardID] || (base3[boardID] = $.dict()))[threadID] = val; - } else { - return this.data[siteID].boards[boardID] = val; - } - }; - - DataBoard.prototype.extend = function(arg, cb) { - var boardID, postID, siteID, threadID, val; - siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, val = arg.val; - return this.save((function(_this) { - return function() { - var key, oldVal, subVal; - oldVal = _this.get({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - postID: postID, - defaultValue: $.dict() - }); - for (key in val) { - subVal = val[key]; - if (typeof subVal === 'undefined') { - delete oldVal[key]; - } else { - oldVal[key] = subVal; - } - } - return _this.setUnsafe({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - postID: postID, - val: oldVal - }); - }; - })(this), cb); - }; - - DataBoard.prototype.setLastChecked = function(key) { - if (key == null) { - key = 'lastChecked'; - } - return this.save((function(_this) { - return function() { - return _this.data[key] = Date.now(); - }; - })(this)); - }; - - DataBoard.prototype.get = function(arg) { - var ID, board, boardID, defaultValue, i, len, postID, ref, siteID, thread, threadID, val; - siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, defaultValue = arg.defaultValue; - siteID || (siteID = g.SITE.ID); - if (board = (ref = this.data[siteID]) != null ? ref.boards[boardID] : void 0) { - if (threadID == null) { - if (postID != null) { - for (thread = i = 0, len = board.length; i < len; thread = ++i) { - ID = board[thread]; - if (postID in thread) { - val = thread[postID]; - break; - } - } - } else { - val = board; - } - } else if (thread = board[threadID]) { - val = postID != null ? thread[postID] : thread; - } - } - return val || defaultValue; - }; - - DataBoard.prototype.clean = function() { - var boardID, now, ref, ref1, siteID, val; - siteID = g.SITE.ID; - ref = this.data[siteID].boards; - for (boardID in ref) { - val = ref[boardID]; - this.deleteIfEmpty({ - siteID: siteID, - boardID: boardID - }); - } - now = Date.now(); - if (!((now - 2 * $.HOUR < (ref1 = this.data[siteID].lastChecked || 0) && ref1 <= now))) { - this.data[siteID].lastChecked = now; - for (boardID in this.data[siteID].boards) { - this.ajaxClean(boardID); - } - } - }; - - DataBoard.prototype.ajaxClean = function(boardID) { - var base, siteID, that, threadsList; - that = this; - siteID = g.SITE.ID; - threadsList = typeof (base = g.SITE.urls).threadsListJSON === "function" ? base.threadsListJSON({ - siteID: siteID, - boardID: boardID - }) : void 0; - if (!threadsList) { - return; - } - return $.cache(threadsList, function() { - var archiveList, base1, response1; - if (this.status !== 200) { - return; - } - archiveList = typeof (base1 = g.SITE.urls).archiveListJSON === "function" ? base1.archiveListJSON({ - siteID: siteID, - boardID: boardID - }) : void 0; - if (!archiveList) { - return that.ajaxCleanParse(boardID, this.response); - } - response1 = this.response; - return $.cache(archiveList, function() { - if (!(this.status === 200 || (!g.SITE.archivedBoardsKnown && this.status === 404))) { - return; - } - return that.ajaxCleanParse(boardID, response1, this.response); - }); - }); - }; - - DataBoard.prototype.ajaxCleanParse = function(boardID, response1, response2) { - var ID, board, i, j, k, len, len1, len2, page, ref, siteID, thread, threads; - siteID = g.SITE.ID; - if (!(board = this.data[siteID].boards[boardID])) { - return; - } - threads = $.dict(); - if (response1) { - for (i = 0, len = response1.length; i < len; i++) { - page = response1[i]; - ref = page.threads; - for (j = 0, len1 = ref.length; j < len1; j++) { - thread = ref[j]; - ID = thread.no; - if (ID in board) { - threads[ID] = board[ID]; - } - } - } - } - if (response2) { - for (k = 0, len2 = response2.length; k < len2; k++) { - ID = response2[k]; - if (ID in board) { - threads[ID] = board[ID]; - } - } - } - this.data[siteID].boards[boardID] = threads; - this.deleteIfEmpty({ - siteID: siteID, - boardID: boardID - }); - return $.set(this.key, this.data); - }; - - DataBoard.prototype.onSync = function(data) { - if (!((data.version || 0) > (this.data.version || 0))) { - return; - } - this.initData(data); - return typeof this.sync === "function" ? this.sync() : void 0; - }; - - return DataBoard; - - })(); - - return DataBoard; - -}).call(this); - -Fetcher = (function() { - var Fetcher, - slice = [].slice; - - Fetcher = (function() { - function Fetcher(boardID1, threadID, postID1, root, quoter) { - var board, post, ref, that, thread; - this.boardID = boardID1; - this.threadID = threadID; - this.postID = postID1; - this.root = root; - this.quoter = quoter; - if (post = g.posts.get(this.boardID + "." + this.postID)) { - this.insert(post); - return; - } - if ((post = (ref = Index.replyData) != null ? ref[this.boardID + "." + this.postID] : void 0) && (thread = g.threads.get(this.boardID + "." + this.threadID))) { - board = g.boards[this.boardID]; - post = new Post(g.SITE.Build.postFromObject(post, this.boardID), thread, board, { - isFetchedQuote: true - }); - Main.callbackNodes('Post', [post]); - this.insert(post); - return; - } - this.root.textContent = "Loading post No." + this.postID + "..."; - if (this.threadID) { - that = this; - $.cache(g.SITE.urls.threadJSON({ - boardID: this.boardID, - threadID: this.threadID - }), function(arg) { - var isCached; - isCached = arg.isCached; - return that.fetchedPost(this, isCached); - }); - } else { - this.archivedPost(); - } - } - - Fetcher.prototype.insert = function(post) { - var boardID, clone, cssVersion, k, len, nodes, postID, quote, ref, ref1, ref2; - if (!this.root.parentNode) { - return; - } - this.quoter || (this.quoter = post); - clone = post.addClone(this.quoter.context, $.hasClass(this.root, 'dialog')); - Main.callbackNodes('Post', [clone]); - nodes = clone.nodes; - $.rmAll(nodes.root); - $.add(nodes.root, nodes.post); - ref = clone.nodes.quotelinks.concat(slice.call(clone.nodes.backlinks)); - for (k = 0, len = ref.length; k < len; k++) { - quote = ref[k]; - ref1 = Get.postDataFromLink(quote), boardID = ref1.boardID, postID = ref1.postID; - if (postID === this.quoter.ID && boardID === this.quoter.board.ID) { - $.addClass(quote, 'forwardlink'); - } - } - if (clone.nodes.flag && !(Fetcher.flagCSS || (Fetcher.flagCSS = $('link[href^="//s.4cdn.org/css/flags."]')))) { - cssVersion = ((ref2 = $('link[href^="//s.4cdn.org/css/"]')) != null ? ref2.href.match(/\d+(?=\.css$)|$/)[0] : void 0) || Date.now(); - Fetcher.flagCSS = $.el('link', { - rel: 'stylesheet', - href: "//s.4cdn.org/css/flags." + cssVersion + ".css" - }); - $.add(d.head, Fetcher.flagCSS); - } - $.rmAll(this.root); - $.add(this.root, nodes.root); - return $.event('PostsInserted', null, this.root); - }; - - Fetcher.prototype.fetchedPost = function(req, isCached) { - var api, board, k, len, post, posts, status, that, thread; - if (post = g.posts.get(this.boardID + "." + this.postID)) { - this.insert(post); - return; - } - status = req.status; - if (status !== 200) { - if (status && this.archivedPost()) { - return; - } - $.addClass(this.root, 'warning'); - this.root.textContent = status === 404 ? "Thread No." + this.threadID + " 404'd." : !status ? 'Connection Error' : "Error " + req.statusText + " (" + req.status + ")."; - return; - } - posts = req.response.posts; - g.SITE.Build.spoilerRange[this.boardID] = posts[0].custom_spoiler; - for (k = 0, len = posts.length; k < len; k++) { - post = posts[k]; - if (post.no === this.postID) { - break; - } - } - if (post.no !== this.postID) { - if (isCached) { - api = g.SITE.urls.threadJSON({ - boardID: this.boardID, - threadID: this.threadID - }); - $.cleanCache(function(url) { - return url === api; - }); - that = this; - $.cache(api, function() { - return that.fetchedPost(this, false); - }); - return; - } - if (this.archivedPost()) { - return; - } - $.addClass(this.root, 'warning'); - this.root.textContent = "Post No." + this.postID + " was not found."; - return; - } - board = g.boards[this.boardID] || new Board(this.boardID); - thread = g.threads.get(this.boardID + "." + this.threadID) || new Thread(this.threadID, board); - post = new Post(g.SITE.Build.postFromObject(post, this.boardID), thread, board, { - isFetchedQuote: true - }); - Main.callbackNodes('Post', [post]); - return this.insert(post); - }; - - Fetcher.prototype.archivedPost = function() { - var archive, encryptionOK, that, url; - if (!Conf['Resurrect Quotes']) { - return false; - } - if (!(url = Redirect.to('post', { - boardID: this.boardID, - postID: this.postID - }))) { - return false; - } - archive = Redirect.data.post[this.boardID]; - encryptionOK = /^https:\/\//.test(url) || location.protocol === 'http:'; - if (encryptionOK || Conf['Exempt Archives from Encryption']) { - that = this; - CrossOrigin.cache(url, function() { - var key, media, ref, ref1; - if (!encryptionOK && ((ref = this.response) != null ? ref.media : void 0)) { - media = this.response.media; - for (key in media) { - if (/_link$/.test(key)) { - if (!((ref1 = $.getOwn(media, key)) != null ? ref1.match(/^http:\/\//) : void 0)) { - delete media[key]; - } - } - } - } - return that.parseArchivedPost(this.response, url, archive); - }); - return true; - } - return false; - }; - - Fetcher.prototype.parseArchivedPost = function(data, url, archive) { - var board, comment, greentext, i, j, media_link, o, post, ref, tag, text, text2, thread, thumb_link; - if (post = g.posts.get(this.boardID + "." + this.postID)) { - this.insert(post); - return; - } - if (data == null) { - $.addClass(this.root, 'warning'); - this.root.textContent = "Error fetching Post No." + this.postID + " from " + archive.name + "."; - return; - } - if (data.error) { - $.addClass(this.root, 'warning'); - this.root.textContent = data.error; - return; - } - comment = (data.comment || '').split(/(\n|\[\/?(?:b|spoiler|code|moot|banned|fortune(?: color="#\w+")?|i|red|green|blue)\])/); - comment = (function() { - var k, len, results; - results = []; - for (i = k = 0, len = comment.length; k < len; i = ++k) { - text = comment[i]; - if (i % 2 === 1) { - tag = this.archiveTags[text.replace(/\ .*\]/, ']')]; - if (typeof tag === 'function') { - results.push(tag(text)); - } else { - results.push(tag); - } - } else { - greentext = text[0] === '>'; - text = text.replace(/(\[\/?[a-z]+):lit(\])/g, '$1$2'); - text = (function() { - var l, len1, ref, results1; - ref = text.split(/(>>(?:>\/[a-z\d]+\/)?\d+)/g); - results1 = []; - for (j = l = 0, len1 = ref.length; l < len1; j = ++l) { - text2 = ref[j]; - results1.push({innerHTML: ((j % 2) ? "" + E(text2) + "" : E(text2))}); - } - return results1; - })(); - text = {innerHTML: ((greentext) ? "" + E.cat(text) + "" : E.cat(text))}; - results.push(text); - } - } - return results; - }).call(this); - comment = {innerHTML: E.cat(comment)}; - this.threadID = +data.thread_num; - o = { - ID: this.postID, - threadID: this.threadID, - boardID: this.boardID, - isReply: this.postID !== this.threadID - }; - o.info = { - subject: data.title, - email: data.email, - name: data.name || '', - tripcode: data.trip, - capcode: (function() { - switch (data.capcode) { - case 'M': - return 'Mod'; - case 'A': - return 'Admin'; - case 'D': - return 'Developer'; - case 'V': - return 'Verified'; - case 'F': - return 'Founder'; - case 'G': - return 'Manager'; - } - })(), - uniqueID: data.poster_hash, - flagCode: data.poster_country, - flagCodeTroll: data.troll_country_code, - flag: data.poster_country_name || data.troll_country_name, - dateUTC: data.timestamp, - dateText: data.fourchan_date, - commentHTML: comment - }; - if (o.info.capcode) { - delete o.info.uniqueID; - } - if (data.media && !!+data.media.banned) { - o.fileDeleted = true; - } else if ((ref = data.media) != null ? ref.media_filename : void 0) { - thumb_link = data.media.thumb_link; - if ((thumb_link != null ? thumb_link[0] : void 0) === '/') { - thumb_link = url.split('/', 3).join('/') + thumb_link; - } - if (!Redirect.securityCheck(thumb_link)) { - thumb_link = ''; - } - media_link = Redirect.to('file', { - boardID: this.boardID, - filename: data.media.media_orig - }); - if (!Redirect.securityCheck(media_link)) { - media_link = ''; - } - o.file = { - name: data.media.media_filename, - url: media_link || (this.boardID === 'f' ? location.protocol + "//" + (ImageHost.flashHost()) + "/" + this.boardID + "/" + (encodeURIComponent(E(data.media.media_filename))) : location.protocol + "//" + (ImageHost.host()) + "/" + this.boardID + "/" + data.media.media_orig), - height: data.media.media_h, - width: data.media.media_w, - MD5: data.media.media_hash, - size: $.bytesToString(data.media.media_size), - thumbURL: thumb_link || (location.protocol + "//" + (ImageHost.thumbHost()) + "/" + this.boardID + "/" + data.media.preview_orig), - theight: data.media.preview_h, - twidth: data.media.preview_w, - isSpoiler: data.media.spoiler === '1' - }; - if (!/\.pdf$/.test(o.file.url)) { - o.file.dimensions = o.file.width + "x" + o.file.height; - } - if (this.boardID === 'f' && data.media.exif) { - o.file.tag = JSON.parse(data.media.exif).Tag; - } - } - o.extra = $.dict(); - board = g.boards[this.boardID] || new Board(this.boardID); - thread = g.threads.get(this.boardID + "." + this.threadID) || new Thread(this.threadID, board); - post = new Post(g.SITE.Build.post(o), thread, board, { - isFetchedQuote: true - }); - post.kill(); - if (post.file) { - post.file.thumbURL = o.file.thumbURL; - } - Main.callbackNodes('Post', [post]); - return this.insert(post); - }; - - Fetcher.prototype.archiveTags = { - '\n': {innerHTML: "
"}, - '[b]': {innerHTML: ""}, - '[/b]': {innerHTML: ""}, - '[spoiler]': {innerHTML: ""}, - '[/spoiler]': {innerHTML: ""}, - '[code]': {innerHTML: "
"},
-      '[/code]': {innerHTML: "
"}, - '[moot]': {innerHTML: "
"}, - '[/moot]': {innerHTML: "
"}, - '[banned]': {innerHTML: ""}, - '[/banned]': {innerHTML: ""}, - '[fortune]': function(text) { - return {innerHTML: ""}; - }, - '[/fortune]': {innerHTML: ""}, - '[i]': {innerHTML: ""}, - '[/i]': {innerHTML: ""}, - '[red]': {innerHTML: ""}, - '[/red]': {innerHTML: ""}, - '[green]': {innerHTML: ""}, - '[/green]': {innerHTML: ""}, - '[blue]': {innerHTML: ""}, - '[/blue]': {innerHTML: ""} - }; - - return Fetcher; - - })(); - - return Fetcher; - -}).call(this); - -Notice = (function() { - var Notice, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; - - Notice = (function() { - function Notice(type, content, timeout, onclose) { - this.timeout = timeout; - this.onclose = onclose; - this.close = bind(this.close, this); - this.add = bind(this.add, this); - this.el = $.el('div', {innerHTML: "
"}); - this.el.style.opacity = 0; - this.setType(type); - $.on(this.el.firstElementChild, 'click', this.close); - if (typeof content === 'string') { - content = $.tn(content); - } - $.add(this.el.lastElementChild, content); - $.ready(this.add); - } - - Notice.prototype.setType = function(type) { - return this.el.className = "notification " + type; - }; - - Notice.prototype.add = function() { - if (this.closed) { - return; - } - if (d.hidden) { - $.on(d, 'visibilitychange', this.add); - return; - } - $.off(d, 'visibilitychange', this.add); - $.add(Header.noticesRoot, this.el); - this.el.clientHeight; - this.el.style.opacity = 1; - if (this.timeout) { - return setTimeout(this.close, this.timeout * $.SECOND); - } - }; - - Notice.prototype.close = function() { - this.closed = true; - $.off(d, 'visibilitychange', this.add); - $.rm(this.el); - return typeof this.onclose === "function" ? this.onclose() : void 0; - }; - - return Notice; - - })(); - - return Notice; - -}).call(this); - -Post = (function() { - var Post, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Post = (function() { - Post.prototype.toString = function() { - return this.ID; - }; - - function Post(root, thread, board, flags) { - var clone, j, k, key, len, len1, ref, ref1, ref10, ref11, ref12, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, selector; - this.thread = thread; - this.board = board; - if (flags == null) { - flags = {}; - } - $.extend(this, flags); - this.ID = +root.id.match(/\d*$/)[0]; - this.postID = this.ID; - this.threadID = this.thread.ID; - this.boardID = this.board.ID; - this.siteID = g.SITE.ID; - this.fullID = this.board + "." + this.ID; - this.context = this; - this.isReply = this.ID !== this.threadID; - root.dataset.fullID = this.fullID; - this.nodes = this.parseNodes(root); - if (!this.isReply) { - this.thread.OP = this; - ref = ['isSticky', 'isClosed', 'isArchived']; - for (j = 0, len = ref.length; j < len; j++) { - key = ref[j]; - if ((selector = g.SITE.selectors.icons[key])) { - this.thread[key] = !!$(selector, this.nodes.info); - } - } - if (this.thread.isArchived) { - this.thread.isClosed = true; - this.thread.kill(); - } - } - this.info = { - subject: ((ref1 = this.nodes.subject) != null ? ref1.textContent : void 0) || void 0, - name: (ref2 = this.nodes.name) != null ? ref2.textContent : void 0, - email: this.nodes.email ? decodeURIComponent(this.nodes.email.href.replace(/^mailto:/, '')) : void 0, - tripcode: (ref3 = this.nodes.tripcode) != null ? ref3.textContent : void 0, - uniqueID: (ref4 = this.nodes.uniqueID) != null ? ref4.textContent : void 0, - capcode: (ref5 = this.nodes.capcode) != null ? ref5.textContent.replace('## ', '') : void 0, - pass: (ref6 = this.nodes.pass) != null ? ref6.title.match(/\d*$/)[0] : void 0, - flagCode: (ref7 = this.nodes.flag) != null ? (ref8 = ref7.className.match(/flag-(\w+)/)) != null ? ref8[1].toUpperCase() : void 0 : void 0, - flagCodeTroll: (ref9 = this.nodes.flag) != null ? (ref10 = ref9.className.match(/bfl-(\w+)/)) != null ? ref10[1].toUpperCase() : void 0 : void 0, - flag: (ref11 = this.nodes.flag) != null ? ref11.title : void 0, - date: this.nodes.date ? g.SITE.parseDate(this.nodes.date) : void 0 - }; - if (Conf['Anonymize']) { - this.info.nameBlock = 'Anonymous'; - } else { - this.info.nameBlock = ((this.info.name || '') + " " + (this.info.tripcode || '')).trim(); - } - if (this.info.capcode) { - this.info.nameBlock += " ## " + this.info.capcode; - } - if (this.info.uniqueID) { - this.info.nameBlock += " (ID: " + this.info.uniqueID + ")"; - } - this.parseComment(); - this.parseQuotes(); - this.parseFiles(); - this.isDead = false; - this.isHidden = false; - this.clones = []; - if (g.posts.get(this.fullID)) { - this.isRebuilt = true; - this.clones = g.posts.get(this.fullID).clones; - ref12 = this.clones; - for (k = 0, len1 = ref12.length; k < len1; k++) { - clone = ref12[k]; - clone.origin = this; - } - } - if (!this.isFetchedQuote && this.ID > this.thread.lastPost) { - this.thread.lastPost = this.ID; - } - this.board.posts.push(this.ID, this); - this.thread.posts.push(this.ID, this); - g.posts.push(this.fullID, this); - } - - Post.prototype.parseNodes = function(root) { - var base, info, key, nodes, post, ref, s, selector; - s = g.SITE.selectors; - post = $(s.post, root) || root; - info = $(s.infoRoot, post); - nodes = { - root: root, - bottom: this.isReply || !g.SITE.isOPContainerThread ? root : $(s.opBottom, root), - post: post, - info: info, - comment: $(s.comment, post), - quotelinks: [], - archivelinks: [], - embedlinks: [] - }; - ref = s.info; - for (key in ref) { - selector = ref[key]; - nodes[key] = $(selector, info); - } - if (typeof (base = g.SITE).parseNodes === "function") { - base.parseNodes(this, nodes); - } - nodes.uniqueIDRoot || (nodes.uniqueIDRoot = nodes.uniqueID); - if ($.engine === 'edge') { - Object.defineProperty(nodes, 'backlinks', { - configurable: true, - enumerable: true, - get: function() { - return post.getElementsByClassName('backlink'); - } - }); - } else { - nodes.backlinks = post.getElementsByClassName('backlink'); - } - return nodes; - }; - - Post.prototype.parseComment = function() { - var base, bq; - this.nodes.comment.normalize(); - this.nodes.commentClean = bq = this.nodes.comment.cloneNode(true); - if (typeof (base = g.SITE).cleanComment === "function") { - base.cleanComment(bq); - } - return this.info.comment = this.nodesToText(bq); - }; - - Post.prototype.commentDisplay = function() { - var base, bq; - bq = this.nodes.commentClean.cloneNode(true); - if (!(Conf['Remove Spoilers'] || Conf['Reveal Spoilers'])) { - this.cleanSpoilers(bq); - } - if (typeof (base = g.SITE).cleanCommentDisplay === "function") { - base.cleanCommentDisplay(bq); - } - return this.nodesToText(bq).trim().replace(/\s+$/gm, ''); - }; - - Post.prototype.commentOrig = function() { - var base, bq; - bq = this.nodes.commentClean.cloneNode(true); - if (typeof (base = g.SITE).insertTags === "function") { - base.insertTags(bq); - } - return this.nodesToText(bq); - }; - - Post.prototype.nodesToText = function(bq) { - var i, node, nodes, text; - text = ""; - nodes = $.X('.//br|.//text()', bq); - i = 0; - while (node = nodes.snapshotItem(i++)) { - text += node.data || '\n'; - } - return text; - }; - - Post.prototype.cleanSpoilers = function(bq) { - var j, len, node, spoilers; - spoilers = $$(g.SITE.selectors.spoiler, bq); - for (j = 0, len = spoilers.length; j < len; j++) { - node = spoilers[j]; - $.replace(node, $.tn('[spoiler]')); - } - }; - - Post.prototype.parseQuotes = function() { - var j, len, quotelink, ref; - this.quotes = []; - ref = $$(g.SITE.selectors.quotelink, this.nodes.comment); - for (j = 0, len = ref.length; j < len; j++) { - quotelink = ref[j]; - this.parseQuote(quotelink); - } - }; - - Post.prototype.parseQuote = function(quotelink) { - var fullID, match; - match = quotelink.href.match(g.SITE.regexp.quotelink); - if (!(match || (this.isClone && quotelink.dataset.postID))) { - return; - } - this.nodes.quotelinks.push(quotelink); - if (this.isClone) { - return; - } - fullID = match[1] + "." + match[3]; - if (indexOf.call(this.quotes, fullID) < 0) { - return this.quotes.push(fullID); - } - }; - - Post.prototype.parseFiles = function() { - var docIndex, file, fileRoot, fileRoots, index, j, len; - this.files = []; - fileRoots = this.fileRoots(); - index = 0; - for (docIndex = j = 0, len = fileRoots.length; j < len; docIndex = ++j) { - fileRoot = fileRoots[docIndex]; - if ((file = this.parseFile(fileRoot))) { - file.index = index++; - file.docIndex = docIndex; - this.files.push(file); - } - } - if (this.files.length) { - return this.file = this.files[0]; - } - }; - - Post.prototype.fileRoots = function() { - var roots; - if (g.SITE.selectors.multifile) { - roots = $$(g.SITE.selectors.multifile, this.nodes.root); - if (roots.length) { - return roots; - } - } - return [this.nodes.root]; - }; - - Post.prototype.parseFile = function(fileRoot) { - var file, key, ref, ref1, selector, size, unit; - file = {}; - ref = g.SITE.selectors.file; - for (key in ref) { - selector = ref[key]; - file[key] = $(selector, fileRoot); - } - file.thumbLink = (ref1 = file.thumb) != null ? ref1.parentNode : void 0; - if (!(file.text && file.link)) { - return; - } - if (!g.SITE.parseFile(this, file)) { - return; - } - $.extend(file, { - url: file.link.href, - isImage: $.isImage(file.link.href), - isVideo: $.isVideo(file.link.href) - }); - size = +file.size.match(/[\d.]+/)[0]; - unit = ['B', 'KB', 'MB', 'GB'].indexOf(file.size.match(/\w+$/)[0]); - while (unit-- > 0) { - size *= 1024; - } - file.sizeInBytes = size; - return file; - }; - - Post.deadMark = $.el('span', { - textContent: '\u00A0(Dead)', - className: 'qmark-dead' - }); - - Post.prototype.kill = function(file, index) { - var clone, j, k, len, len1, quotelink, ref, ref1, strong; - if (index == null) { - index = 0; - } - if (file) { - if (this.isDead || this.files[index].isDead) { - return; - } - this.files[index].isDead = true; - $.addClass(this.nodes.root, 'deleted-file'); - } else { - if (this.isDead) { - return; - } - this.isDead = true; - $.rmClass(this.nodes.root, 'deleted-file'); - $.addClass(this.nodes.root, 'deleted-post'); - } - if (!(strong = $('strong.warning', this.nodes.info))) { - strong = $.el('strong', { - className: 'warning' - }); - $.after($('input', this.nodes.info), strong); - } - strong.textContent = file ? '[File deleted]' : '[Deleted]'; - if (this.isClone) { - return; - } - ref = this.clones; - for (j = 0, len = ref.length; j < len; j++) { - clone = ref[j]; - clone.kill(file, index); - } - if (file) { - return; - } - ref1 = Get.allQuotelinksLinkingTo(this); - for (k = 0, len1 = ref1.length; k < len1; k++) { - quotelink = ref1[k]; - if (!(!$.hasClass(quotelink, 'deadlink'))) { - continue; - } - $.add(quotelink, Post.deadMark.cloneNode(true)); - $.addClass(quotelink, 'deadlink'); - } - }; - - Post.prototype.resurrect = function() { - var clone, j, k, len, len1, quotelink, ref, ref1, strong; - this.isDead = false; - $.rmClass(this.nodes.root, 'deleted-post'); - strong = $('strong.warning', this.nodes.info); - if (this.files.some(function(file) { - return file.isDead; - })) { - $.addClass(this.nodes.root, 'deleted-file'); - strong.textContent = '[File deleted]'; - } else { - $.rm(strong); - } - if (this.isClone) { - return; - } - ref = this.clones; - for (j = 0, len = ref.length; j < len; j++) { - clone = ref[j]; - clone.resurrect(); - } - ref1 = Get.allQuotelinksLinkingTo(this); - for (k = 0, len1 = ref1.length; k < len1; k++) { - quotelink = ref1[k]; - if (!($.hasClass(quotelink, 'deadlink'))) { - continue; - } - $.rm($('.qmark-dead', quotelink)); - $.rmClass(quotelink, 'deadlink'); - } - }; - - Post.prototype.collect = function() { - g.posts.rm(this.fullID); - this.thread.posts.rm(this); - return this.board.posts.rm(this); - }; - - Post.prototype.addClone = function(context, contractThumb) { - Callbacks.Post.execute(this); - return new Post.Clone(this, context, contractThumb); - }; - - Post.prototype.rmClone = function(index) { - var clone, j, len, ref; - this.clones.splice(index, 1); - ref = this.clones.slice(index); - for (j = 0, len = ref.length; j < len; j++) { - clone = ref[j]; - clone.nodes.root.dataset.clone = index++; - } - }; - - Post.prototype.setCatalogOP = function(isCatalogOP) { - this.nodes.root.classList.toggle('catalog-container', isCatalogOP); - this.nodes.root.classList.toggle('opContainer', !isCatalogOP); - this.nodes.post.classList.toggle('catalog-post', isCatalogOP); - this.nodes.post.classList.toggle('op', !isCatalogOP); - return this.nodes.post.style.left = this.nodes.post.style.right = null; - }; - - return Post; - - })(); - - return Post; - -}).call(this); - -(function() { - var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty, - slice = [].slice; - - Post.Clone = (function(superClass) { - extend(_Class, superClass); - - _Class.prototype.isClone = true; - - function _Class() { - var that; - that = Object.create(Post.Clone.prototype); - that.construct.apply(that, arguments); - return that; - } - - _Class.prototype.construct = function(origin, context, contractThumb) { - var base, file, fileRoot, fileRoots, i, inline, inlined, j, k, key, l, len, len1, len2, len3, len4, m, node, nodes, originFile, ref, ref1, ref2, ref3, ref4, ref5, ref6, root, selector, val; - this.origin = origin; - this.context = context; - ref = ['ID', 'postID', 'threadID', 'boardID', 'siteID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply']; - for (i = 0, len = ref.length; i < len; i++) { - key = ref[i]; - this[key] = this.origin[key]; - } - nodes = this.origin.nodes; - root = contractThumb ? this.cloneWithoutVideo(nodes.root) : nodes.root.cloneNode(true); - (base = Post.Clone).suffix || (base.suffix = 0); - ref1 = [root].concat(slice.call($$('[id]', root))); - for (j = 0, len1 = ref1.length; j < len1; j++) { - node = ref1[j]; - node.id += "_" + Post.Clone.suffix; - } - Post.Clone.suffix++; - ref2 = $$('.inline', root); - for (k = 0, len2 = ref2.length; k < len2; k++) { - inline = ref2[k]; - $.rm(inline); - } - ref3 = $$('.inlined', root); - for (l = 0, len3 = ref3.length; l < len3; l++) { - inlined = ref3[l]; - $.rmClass(inlined, 'inlined'); - } - this.nodes = this.parseNodes(root); - root.hidden = false; - $.rmClass(root, 'forwarded'); - $.rmClass(this.nodes.post, 'highlight'); - if (!this.isReply) { - this.setCatalogOP(false); - $.rm($('.catalog-link', this.nodes.post)); - $.rm($('.catalog-stats', this.nodes.post)); - $.rm($('.catalog-replies', this.nodes.post)); - } - this.parseQuotes(); - this.quotes = slice.call(this.origin.quotes); - this.files = []; - if (this.origin.files.length) { - fileRoots = this.fileRoots(); - } - ref4 = this.origin.files; - for (m = 0, len4 = ref4.length; m < len4; m++) { - originFile = ref4[m]; - file = {}; - for (key in originFile) { - val = originFile[key]; - file[key] = val; - } - fileRoot = fileRoots[file.docIndex]; - ref5 = g.SITE.selectors.file; - for (key in ref5) { - selector = ref5[key]; - file[key] = $(selector, fileRoot); - } - file.thumbLink = (ref6 = file.thumb) != null ? ref6.parentNode : void 0; - if (file.thumbLink) { - file.fullImage = $('.full-image', file.thumbLink); - } - file.videoControls = $('.video-controls', file.text); - if (file.videoThumb) { - file.thumb.muted = true; - } - this.files.push(file); - } - if (this.files.length) { - this.file = this.files[0]; - if (this.file.thumb && contractThumb) { - ImageExpand.contract(this); - } - } - if (this.origin.isDead) { - this.isDead = true; - } - return root.dataset.clone = this.origin.clones.push(this) - 1; - }; - - _Class.prototype.cloneWithoutVideo = function(node) { - var child, clone, i, len, ref; - if (node.tagName === 'VIDEO' && !node.dataset.md5) { - return []; - } else if (node.nodeType === Node.ELEMENT_NODE && $('video', node)) { - clone = node.cloneNode(false); - ref = node.childNodes; - for (i = 0, len = ref.length; i < len; i++) { - child = ref[i]; - $.add(clone, this.cloneWithoutVideo(child)); - } - return clone; - } else { - return node.cloneNode(true); - } - }; - - return _Class; - - })(Post); - -}).call(this); - -RandomAccessList = (function() { - var RandomAccessList; - - RandomAccessList = (function() { - function RandomAccessList(items) { - var i, item, len; - this.length = 0; - if (items) { - for (i = 0, len = items.length; i < len; i++) { - item = items[i]; - this.push(item); - } - } - } - - RandomAccessList.prototype.push = function(data) { - var ID, item, last; - ID = data.ID; - ID || (ID = data.id); - if (this[ID]) { - return; - } - last = this.last; - this[ID] = item = { - prev: last, - next: null, - data: data, - ID: ID - }; - item.prev = last; - this.last = last ? last.next = item : this.first = item; - return this.length++; - }; - - RandomAccessList.prototype.before = function(root, item) { - var prev; - if (item.next === root || item === root) { - return; - } - this.rmi(item); - prev = root.prev; - root.prev = item; - item.next = root; - item.prev = prev; - if (prev) { - return prev.next = item; - } else { - return this.first = item; - } - }; - - RandomAccessList.prototype.after = function(root, item) { - var next; - if (item.prev === root || item === root) { - return; - } - this.rmi(item); - next = root.next; - root.next = item; - item.prev = root; - item.next = next; - if (next) { - return next.prev = item; - } else { - return this.last = item; - } - }; - - RandomAccessList.prototype.prepend = function(item) { - var first; - first = this.first; - if (item === first || !this[item.ID]) { - return; - } - this.rmi(item); - item.next = first; - if (first) { - first.prev = item; - } else { - this.last = item; - } - this.first = item; - return delete item.prev; - }; - - RandomAccessList.prototype.shift = function() { - return this.rm(this.first.ID); - }; - - RandomAccessList.prototype.order = function() { - var item, order; - order = [item = this.first]; - while (item = item.next) { - order.push(item); - } - return order; - }; - - RandomAccessList.prototype.rm = function(ID) { - var item; - item = this[ID]; - if (!item) { - return; - } - delete this[ID]; - this.length--; - this.rmi(item); - delete item.next; - return delete item.prev; - }; - - RandomAccessList.prototype.rmi = function(item) { - var next, prev; - prev = item.prev, next = item.next; - if (prev) { - prev.next = next; - } else { - this.first = next; - } - if (next) { - return next.prev = prev; - } else { - return this.last = prev; - } - }; - - return RandomAccessList; - - })(); - - return RandomAccessList; - -}).call(this); - -ShimSet = (function() { - var ShimSet; - - ShimSet = (function() { - function ShimSet() { - this.elements = $.dict(); - this.size = 0; - } - - ShimSet.prototype.has = function(value) { - return value in this.elements; - }; - - ShimSet.prototype.add = function(value) { - if (this.elements[value]) { - return; - } - this.elements[value] = true; - return this.size++; - }; - - ShimSet.prototype["delete"] = function(value) { - if (!this.elements[value]) { - return; - } - delete this.elements[value]; - return this.size--; - }; - - return ShimSet; - - })(); - - if (!('Set' in window)) { - window.Set = ShimSet; - } - - return ShimSet; - -}).call(this); - -SimpleDict = (function() { - var SimpleDict, - slice = [].slice; - - SimpleDict = (function() { - function SimpleDict() { - this.keys = []; - } - - SimpleDict.prototype.push = function(key, data) { - key = "" + key; - if (!this[key]) { - this.keys.push(key); - } - return this[key] = data; - }; - - SimpleDict.prototype.rm = function(key) { - var i; - key = "" + key; - if ((i = this.keys.indexOf(key)) !== -1) { - this.keys.splice(i, 1); - return delete this[key]; - } - }; - - SimpleDict.prototype.forEach = function(fn) { - var j, key, len, ref; - ref = slice.call(this.keys); - for (j = 0, len = ref.length; j < len; j++) { - key = ref[j]; - fn(this[key]); - } - }; - - SimpleDict.prototype.get = function(key) { - if (key === 'keys') { - return void 0; - } else { - return $.getOwn(this, key); - } - }; - - return SimpleDict; - - })(); - - return SimpleDict; - -}).call(this); - -Thread = (function() { - var Thread; - - Thread = (function() { - Thread.prototype.toString = function() { - return this.ID; - }; - - function Thread(ID, board) { - this.board = board; - this.ID = +ID; - this.threadID = this.ID; - this.boardID = this.board.ID; - this.siteID = g.SITE.ID; - this.fullID = this.board + "." + this.ID; - this.posts = new SimpleDict(); - this.isDead = false; - this.isHidden = false; - this.isSticky = false; - this.isClosed = false; - this.isArchived = false; - this.postLimit = false; - this.fileLimit = false; - this.lastPost = 0; - this.ipCount = void 0; - this.json = null; - this.OP = null; - this.catalogView = null; - this.nodes = { - root: null - }; - this.board.threads.push(this.ID, this); - g.threads.push(this.fullID, this); - } - - Thread.prototype.setPage = function(pageNum) { - var icon, info, ref, reply; - ref = this.OP.nodes, info = ref.info, reply = ref.reply; - if (!(icon = $('.page-num', info))) { - icon = $.el('span', { - className: 'page-num' - }); - $.replace(reply.parentNode.previousSibling, [$.tn(' '), icon, $.tn(' ')]); - } - icon.title = "This thread is on page " + pageNum + " in the original index."; - icon.textContent = "[" + pageNum + "]"; - if (this.catalogView) { - return this.catalogView.nodes.pageCount.textContent = pageNum; - } - }; - - Thread.prototype.setCount = function(type, count, reachedLimit) { - var el; - if (!this.catalogView) { - return; - } - el = this.catalogView.nodes[type + "Count"]; - el.textContent = count; - return (reachedLimit ? $.addClass : $.rmClass)(el, 'warning'); - }; - - Thread.prototype.setStatus = function(type, status) { - var name; - name = "is" + type; - if (this[name] === status) { - return; - } - this[name] = status; - if (!this.OP) { - return; - } - this.setIcon('Sticky', this.isSticky); - this.setIcon('Closed', this.isClosed && !this.isArchived); - return this.setIcon('Archived', this.isArchived); - }; - - Thread.prototype.setIcon = function(type, status) { - var icon, root, typeLC; - typeLC = type.toLowerCase(); - icon = $("." + typeLC + "Icon", this.OP.nodes.info); - if (!!icon === status) { - return; - } - if (!status) { - $.rm(icon.previousSibling); - $.rm(icon); - if (this.catalogView) { - $.rm($("." + typeLC + "Icon", this.catalogView.nodes.icons)); - } - return; - } - icon = $.el('img', { - src: "" + g.SITE.Build.staticPath + typeLC + g.SITE.Build.gifIcon, - alt: type, - title: type, - className: typeLC + "Icon retina" - }); - if (g.BOARD.ID === 'f') { - icon.style.cssText = 'height: 18px; width: 18px;'; - } - root = type !== 'Sticky' && this.isSticky ? $('.stickyIcon', this.OP.nodes.info) : $('.page-num', this.OP.nodes.info) || this.OP.nodes.quote; - $.after(root, [$.tn(' '), icon]); - if (!this.catalogView) { - return; - } - return (type === 'Sticky' && this.isClosed ? $.prepend : $.add)(this.catalogView.nodes.icons, icon.cloneNode()); - }; - - Thread.prototype.kill = function() { - return this.isDead = true; - }; - - Thread.prototype.collect = function() { - var n; - n = 0; - this.posts.forEach(function(post) { - if (post.clones.length) { - return n++; - } else { - return post.collect(); - } - }); - if (!n) { - g.threads.rm(this.fullID); - return this.board.threads.rm(this); - } - }; - - return Thread; - - })(); - - return Thread; - -}).call(this); - -SW = {}; - -(function() { - var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - SW.tinyboard = { - isOPContainerThread: true, - mayLackJSON: true, - threadModTimeIgnoresSage: true, - disabledFeatures: ['Resurrect Quotes', 'Quick Reply Personas', 'Quick Reply', 'Cooldown', 'Report Link', 'Delete Link', 'Edit Link', 'Quote Inlining', 'Quote Previewing', 'Quote Backlinks', 'File Info Formatting', 'Image Expansion', 'Image Expansion (Menu)', 'Comment Expansion', 'Thread Expansion', 'Favicon', 'Quote Threading', 'Thread Updater', 'Banner', 'Flash Features', 'Reply Pruning'], - detect: function() { - var j, len, m, properties, ref, root, script; - ref = $$('script:not([src])', d.head); - for (j = 0, len = ref.length; j < len; j++) { - script = ref[j]; - if ((m = script.textContent.match(/\bvar configRoot=(".*?")/))) { - properties = $.dict(); - try { - root = JSON.parse(m[1]); - if (root[0] === '/') { - properties.root = location.origin + root; - } else if (/^https?:/.test(root)) { - properties.root = root; - } - } catch (error) {} - return properties; - } - } - return false; - }, - awaitBoard: function(cb) { - var reactUI, s; - if ((reactUI = $.id('react-ui'))) { - s = this.selectors = Object.create(this.selectors); - s.boardFor = { - index: '.page-container' - }; - s.thread = 'div[id^="thread_"]'; - return Main.mounted(cb); - } else { - return cb(); - } - }, - urls: { - thread: function(arg, isArchived) { - var boardID, ref, siteID, threadID; - siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID; - return "" + (((ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0) || ("http://" + siteID + "/")) + boardID + "/" + (isArchived ? 'archive/' : '') + "res/" + threadID + ".html"; - }, - post: function(arg) { - var postID; - postID = arg.postID; - return "#" + postID; - }, - index: function(arg) { - var boardID, ref, siteID; - siteID = arg.siteID, boardID = arg.boardID; - return "" + (((ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0) || ("http://" + siteID + "/")) + boardID + "/"; - }, - catalog: function(arg) { - var boardID, ref, siteID; - siteID = arg.siteID, boardID = arg.boardID; - return "" + (((ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0) || ("http://" + siteID + "/")) + boardID + "/catalog.html"; - }, - threadJSON: function(arg, isArchived) { - var boardID, ref, root, siteID, threadID; - siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID; - root = (ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0; - if (root) { - return "" + root + boardID + "/" + (isArchived ? 'archive/' : '') + "res/" + threadID + ".json"; - } else { - return ''; - } - }, - archivedThreadJSON: function(thread) { - return SW.tinyboard.urls.threadJSON(thread, true); - }, - threadsListJSON: function(arg) { - var boardID, ref, root, siteID; - siteID = arg.siteID, boardID = arg.boardID; - root = (ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0; - if (root) { - return "" + root + boardID + "/threads.json"; - } else { - return ''; - } - }, - archiveListJSON: function(arg) { - var boardID, ref, root, siteID; - siteID = arg.siteID, boardID = arg.boardID; - root = (ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0; - if (root) { - return "" + root + boardID + "/archive/archive.json"; - } else { - return ''; - } - }, - catalogJSON: function(arg) { - var boardID, ref, root, siteID; - siteID = arg.siteID, boardID = arg.boardID; - root = (ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0; - if (root) { - return "" + root + boardID + "/catalog.json"; - } else { - return ''; - } - }, - file: function(arg, filename) { - var boardID, ref, siteID; - siteID = arg.siteID, boardID = arg.boardID; - return "" + (((ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0) || ("http://" + siteID + "/")) + boardID + "/" + filename; - }, - thumb: function(board, filename) { - return SW.tinyboard.urls.file(board, filename); - } - }, - selectors: { - board: 'form[name="postcontrols"]', - thread: 'input[name="board"] ~ div[id^="thread_"]', - threadDivider: 'div[id^="thread_"] > hr:last-child', - summary: '.omitted', - postContainer: 'div[id^="reply_"]:not(.hidden)', - opBottom: '.op', - replyOriginal: 'div[id^="reply_"]:not(.hidden)', - infoRoot: '.intro', - info: { - subject: '.subject', - name: '.name', - email: '.email', - tripcode: '.trip', - uniqueID: '.poster_id', - capcode: '.capcode', - flag: '.flag', - date: 'time', - nameBlock: 'label', - quote: 'a[href*="#q"]', - reply: 'a[href*="/res/"]:not([href*="#"])' - }, - icons: { - isSticky: '.fa-thumb-tack', - isClosed: '.fa-lock' - }, - file: { - text: '.fileinfo', - link: '.fileinfo > a', - thumb: 'a > .post-image' - }, - thumbLink: '.file > a', - multifile: '.files > .file', - highlightable: { - op: ' > .op', - reply: '.reply', - catalog: ' > .thread' - }, - comment: '.body', - spoiler: '.spoiler', - quotelink: 'a[onclick*="highlightReply("]', - catalog: { - board: '#Grid', - thread: '.mix', - thumb: '.thread-image' - }, - boardList: '.boardlist', - boardListBottom: '.boardlist.bottom', - styleSheet: '#stylesheet', - psa: '.blotter', - nav: { - prev: '.pages > form > [value=Previous]', - next: '.pages > form > [value=Next]' - } - }, - classes: { - highlight: 'highlighted' - }, - xpath: { - thread: 'div[starts-with(@id,"thread_")]', - postContainer: 'div[starts-with(@id,"reply_") or starts-with(@id,"thread_")]', - replyContainer: 'div[starts-with(@id,"reply_")]' - }, - regexp: { - quotelink: /\/([^\/]+)\/res\/(\d+)(?:\.\w+)?#(\d+)$/, - quotelinkHTML: /]*\bhref="[^"]*\/([^\/]+)\/res\/(\d+)(?:\.\w+)?#(\d+)"/g - }, - Build: { - parseJSON: function(data, board) { - var extra_file, file, i, j, len, o, ref; - o = SW.yotsuba.Build.parseJSON(data, board); - if (data.ext === 'deleted') { - delete o.file; - $.extend(o, { - files: [], - fileDeleted: true, - filesDeleted: [0] - }); - } - if (data.extra_files) { - ref = data.extra_files; - for (i = j = 0, len = ref.length; j < len; i = ++j) { - extra_file = ref[i]; - if (extra_file.ext === 'deleted') { - o.filesDeleted.push(i); - } else { - file = SW.yotsuba.Build.parseJSONFile(data, board); - o.files.push(file); - } - } - if (o.files.length) { - o.file = o.files[0]; - } - } - return o; - }, - parseComment: function(html) { - html = html.replace(//gi, '\n').replace(/<[^>]*>/g, ''); - return $.unescape(html); - } - }, - bgColoredEl: function() { - return $.el('div', { - className: 'post reply' - }); - }, - isFileURL: function(url) { - return /\/src\/[^\/]+/.test(url.pathname); - }, - preParsingFixes: function(board) { - var broken; - if ((broken = $('a > input[name="board"]', board))) { - return $.before(broken.parentNode, broken); - } - }, - parseNodes: function(post, nodes) { - var m, nextSibling, node, text, uniqueID; - if (nodes.uniqueID) { - return; - } - text = ''; - node = nodes.nameBlock.nextSibling; - while (node && node.nodeType === 3) { - text += node.textContent; - node = node.nextSibling; - } - if ((m = text.match(/(\s*ID:\s*)(\S+)/))) { - nodes.info.normalize(); - nextSibling = nodes.nameBlock.nextSibling; - nextSibling = nextSibling.splitText(m[1].length); - nextSibling.splitText(m[2].length); - nodes.uniqueID = uniqueID = $.el('span', { - className: 'poster_id' - }); - $.replace(nextSibling, uniqueID); - return $.add(uniqueID, nextSibling); - } - }, - parseDate: function(node) { - var date, ref; - date = Date.parse((ref = node.getAttribute('datetime')) != null ? ref.trim() : void 0); - if (!isNaN(date)) { - return new Date(date); - } - date = Date.parse(node.textContent.trim() + ' UTC'); - if (!isNaN(date)) { - return new Date(date); - } - return void 0; - }, - parseFile: function(post, file) { - var info, infoNode, link, nameNode, ref, ref1, text, thumb; - text = file.text, link = file.link, thumb = file.thumb; - if ($.x("ancestor::" + this.xpath.postContainer + "[1]", text) !== post.nodes.root) { - return false; - } - if (!(infoNode = indexOf.call((ref = link.nextSibling) != null ? ref.textContent : void 0, '(') >= 0 ? link.nextSibling : link.nextElementSibling)) { - return false; - } - if (!(info = infoNode.textContent.match(/\((.*,\s*)?([\d.]+ ?[KMG]?B).*\)/))) { - return false; - } - nameNode = $('.postfilename', text); - $.extend(file, { - name: nameNode ? nameNode.title || nameNode.textContent : link.pathname.match(/[^\/]*$/)[0], - size: info[2], - dimensions: (ref1 = info[0].match(/\d+x\d+/)) != null ? ref1[0] : void 0 - }); - if (thumb) { - $.extend(file, { - thumbURL: /\/static\//.test(thumb.src) && $.isImage(link.href) ? link.href : thumb.src, - isSpoiler: /^Spoiler/i.test(info[1] || '') || link.textContent === 'Spoiler Image' - }); - } - return true; - }, - isThumbExpanded: function(file) { - return $.hasClass(file.thumb.parentNode, 'expanded') || file.thumb.parentNode.dataset.expanded === 'true'; - }, - isLinkified: function(link) { - return /\bnofollow\b/.test(link.rel); - }, - catalogPin: function(threadRoot) { - return threadRoot.dataset.sticky = 'true'; - } - }; - -}).call(this); - -(function() { - var slice = [].slice; - - SW.yotsuba = { - isOPContainerThread: false, - hasIPCount: true, - archivedBoardsKnown: true, - urls: { - thread: function(arg) { - var boardID, threadID; - boardID = arg.boardID, threadID = arg.threadID; - return location.protocol + "//" + (BoardConfig.domain(boardID)) + "/" + boardID + "/thread/" + threadID; - }, - post: function(arg) { - var postID; - postID = arg.postID; - return "#p" + postID; - }, - index: function(arg) { - var boardID; - boardID = arg.boardID; - return location.protocol + "//" + (BoardConfig.domain(boardID)) + "/" + boardID + "/"; - }, - catalog: function(arg) { - var boardID; - boardID = arg.boardID; - if (boardID === 'f') { - return void 0; - } else { - return location.protocol + "//" + (BoardConfig.domain(boardID)) + "/" + boardID + "/catalog"; - } - }, - archive: function(arg) { - var boardID; - boardID = arg.boardID; - if (BoardConfig.isArchived(boardID)) { - return location.protocol + "//" + (BoardConfig.domain(boardID)) + "/" + boardID + "/archive"; - } else { - return void 0; - } - }, - threadJSON: function(arg) { - var boardID, threadID; - boardID = arg.boardID, threadID = arg.threadID; - return location.protocol + "//a.4cdn.org/" + boardID + "/thread/" + threadID + ".json"; - }, - threadsListJSON: function(arg) { - var boardID; - boardID = arg.boardID; - return location.protocol + "//a.4cdn.org/" + boardID + "/threads.json"; - }, - archiveListJSON: function(arg) { - var boardID; - boardID = arg.boardID; - if (BoardConfig.isArchived(boardID)) { - return location.protocol + "//a.4cdn.org/" + boardID + "/archive.json"; - } else { - return ''; - } - }, - catalogJSON: function(arg) { - var boardID; - boardID = arg.boardID; - return location.protocol + "//a.4cdn.org/" + boardID + "/catalog.json"; - }, - file: function(arg, filename) { - var boardID, hostname; - boardID = arg.boardID; - hostname = boardID === 'f' ? ImageHost.flashHost() : ImageHost.host(); - return location.protocol + "//" + hostname + "/" + boardID + "/" + filename; - }, - thumb: function(arg, filename) { - var boardID; - boardID = arg.boardID; - return location.protocol + "//" + (ImageHost.thumbHost()) + "/" + boardID + "/" + filename; - } - }, - isPrunedByAge: function(arg) { - var boardID; - boardID = arg.boardID; - return boardID === 'f'; - }, - areMD5sDeferred: function(arg) { - var boardID; - boardID = arg.boardID; - return boardID === 'f'; - }, - isOnePage: function(arg) { - var boardID; - boardID = arg.boardID; - return boardID === 'f'; - }, - noAudio: function(arg) { - var boardID; - boardID = arg.boardID; - return BoardConfig.noAudio(boardID); - }, - selectors: { - board: '.board', - thread: '.thread', - threadDivider: '.board > hr', - summary: '.summary', - postContainer: '.postContainer', - replyOriginal: '.replyContainer:not([data-clone])', - sideArrows: 'div.sideArrows', - post: '.post', - infoRoot: '.postInfo', - info: { - subject: '.subject', - name: '.name', - email: '.useremail', - tripcode: '.postertrip', - uniqueIDRoot: '.posteruid', - uniqueID: '.posteruid > .hand', - capcode: '.capcode.hand', - pass: '.n-pu', - flag: '.flag, .bfl', - date: '.dateTime', - nameBlock: '.nameBlock', - quote: '.postNum > a:nth-of-type(2)', - reply: '.replylink' - }, - icons: { - isSticky: '.stickyIcon', - isClosed: '.closedIcon', - isArchived: '.archivedIcon' - }, - file: { - text: '.file > :first-child', - link: '.fileText > a', - thumb: 'a.fileThumb > [data-md5]' - }, - thumbLink: 'a.fileThumb', - highlightable: { - op: '.opContainer', - reply: ' > .reply', - catalog: '' - }, - comment: '.postMessage', - spoiler: 's', - quotelink: ':not(pre) > .quotelink', - catalog: { - board: '#threads', - thread: '.thread', - thumb: '.thumb' - }, - boardList: '#boardNavDesktop > .boardList', - boardListBottom: '#boardNavDesktopFoot > .boardList', - styleSheet: 'link[title=switch]', - psa: '#globalMessage', - psaTop: '#globalToggle', - searchBox: '#search-box', - nav: { - prev: '.prev > form > [type=submit]', - next: '.next > form > [type=submit]' - } - }, - classes: { - highlight: 'highlight' - }, - xpath: { - thread: 'div[contains(concat(" ",@class," ")," thread ")]', - postContainer: 'div[contains(@class,"postContainer")]', - replyContainer: 'div[contains(@class,"replyContainer")]' - }, - regexp: { - quotelink: /^https?:\/\/boards\.4chan(?:nel)?\.org\/+([^\/]+)\/+thread\/+(\d+)(?:[\/?][^#]*)?(?:#p(\d+))?$/, - quotelinkHTML: /]*\bhref="(?:(?:\/\/boards\.4chan(?:nel)?\.org)?\/([^\/]+)\/thread\/)?(\d+)?(?:#p(\d+))?"/g, - pass: /^https?:\/\/www\.4chan(?:nel)?\.org\/+pass(?:$|[?#])/, - captcha: /^https?:\/\/sys\.4chan(?:nel)?\.org\/+captcha(?:$|[?#])/ - }, - bgColoredEl: function() { - return $.el('div', { - className: 'reply' - }); - }, - isThisPageLegit: function() { - var ref, ref1; - return ((ref = location.hostname) === 'boards.4chan.org' || ref === 'boards.4channel.org') && d.doctype && !$('link[href*="favicon-status.ico"]', d.head) && ((ref1 = d.title) !== '4chan - Temporarily Offline' && ref1 !== '4chan - Error' && ref1 !== '504 Gateway Time-out' && ref1 !== 'MathJax Equation Source'); - }, - is404: function() { - var ref; - return ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') || (g.VIEW === 'thread' && $('.board') && !$('.opContainer')); - }, - isIncomplete: function() { - var ref; - return ((ref = g.VIEW) === 'index' || ref === 'thread') && !$('.board + *'); - }, - isBoardlessPage: function(url) { - var ref; - return (ref = url.hostname) === 'www.4chan.org' || ref === 'www.4channel.org'; - }, - isAuxiliaryPage: function(url) { - var ref; - return (ref = url.hostname) !== 'boards.4chan.org' && ref !== 'boards.4channel.org'; - }, - isFileURL: function(url) { - return ImageHost.test(url.hostname); - }, - initAuxiliary: function() { - var match, pathname; - switch (location.hostname) { - case 'www.4chan.org': - case 'www.4channel.org': - if (SW.yotsuba.regexp.pass.test(location.href)) { - PassMessage.init(); - } else { - $.onExists(doc, 'body', function() { - return $.addStyle(CSS.www); - }); - Captcha.replace.init(); - } - break; - case 'sys.4chan.org': - case 'sys.4channel.org': - pathname = location.pathname.split(/\/+/); - if (pathname[2] === 'imgboard.php') { - if (/\bmode=report\b/.test(location.search)) { - Report.init(); - } else if ((match = location.search.match(/\bres=(\d+)/))) { - $.ready(function() { - var ref; - if (Conf['404 Redirect'] && ((ref = $.id('errmsg')) != null ? ref.textContent : void 0) === 'Error: Specified thread does not exist.') { - return Redirect.navigate('thread', { - boardID: g.BOARD.ID, - postID: +match[1] - }); - } - }); - } - } else if (pathname[2] === 'post') { - PostSuccessful.init(); - } - } - }, - scriptData: function() { - var j, len, ref, script; - ref = $$('script:not([src])', d.head); - for (j = 0, len = ref.length; j < len; j++) { - script = ref[j]; - if (/\bcooldowns *=/.test(script.textContent)) { - return script.textContent; - } - } - return ''; - }, - parseThreadMetadata: function(thread) { - var file, m, scriptData; - scriptData = this.scriptData(); - thread.postLimit = /\bbumplimit *= *1\b/.test(scriptData); - thread.fileLimit = /\bimagelimit *= *1\b/.test(scriptData); - thread.ipCount = (m = scriptData.match(/\bunique_ips *= *(\d+)\b/)) ? +m[1] : void 0; - if (g.BOARD.ID === 'f' && thread.OP.file) { - file = thread.OP.file; - return $.ajax(this.urls.threadJSON({ - boardID: 'f', - threadID: thread.ID - }), { - timeout: $.MINUTE, - onloadend: function() { - if (this.response) { - return file.text.dataset.md5 = file.MD5 = this.response.posts[0].md5; - } - } - }); - } - }, - parseNodes: function(post, nodes) { - var icon, j, len, ref, results, type; - if (post.boardID === 'f') { - ref = ['Sticky', 'Closed']; - results = []; - for (j = 0, len = ref.length; j < len; j++) { - type = ref[j]; - if ((icon = $("img[alt=" + type + "]", nodes.info))) { - results.push($.addClass(icon, (type.toLowerCase()) + "Icon", 'retina')); - } - } - return results; - } - }, - parseDate: function(node) { - return new Date(node.dataset.utc * 1000); - }, - parseFile: function(post, file) { - var info, link, m, ref, ref1, ref2, text, thumb; - text = file.text, link = file.link, thumb = file.thumb; - if (!(info = (ref = link.nextSibling) != null ? ref.textContent.match(/\(([\d.]+ [KMG]?B).*\)/) : void 0)) { - return false; - } - $.extend(file, { - name: text.title || link.title || link.textContent, - size: info[1], - dimensions: (ref1 = info[0].match(/\d+x\d+/)) != null ? ref1[0] : void 0, - tag: (ref2 = info[0].match(/,[^,]*, ([a-z]+)\)/i)) != null ? ref2[1] : void 0, - MD5: text.dataset.md5 - }); - if (thumb) { - $.extend(file, { - thumbURL: thumb.src, - MD5: thumb.dataset.md5, - isSpoiler: $.hasClass(thumb.parentNode, 'imgspoiler') - }); - if (file.isSpoiler) { - file.thumbURL = (m = link.href.match(/\d+(?=\.\w+$)/)) ? location.protocol + "//" + (ImageHost.thumbHost()) + "/" + post.board + "/" + m[0] + "s.jpg" : void 0; - } - } - return true; - }, - cleanComment: function(bq) { - var abbr, br, i, j, k, len, node, ref; - if ((abbr = $('.abbr', bq))) { - ref = $$('.abbr + br, .exif', bq); - for (j = 0, len = ref.length; j < len; j++) { - node = ref[j]; - $.rm(node); - } - for (i = k = 0; k < 2; i = ++k) { - if ((br = abbr.previousSibling) && br.nodeName === 'BR') { - $.rm(br); - } - } - return $.rm(abbr); - } - }, - cleanCommentDisplay: function(bq) { - var b; - if ((b = $('b', bq)) && /^Rolled /.test(b.textContent)) { - $.rm(b); - } - return $.rm($('.fortune', bq)); - }, - insertTags: function(bq) { - var j, k, len, len1, node, ref, ref1; - ref = $$('s, .removed-spoiler', bq); - for (j = 0, len = ref.length; j < len; j++) { - node = ref[j]; - $.replace(node, [$.tn('[spoiler]')].concat(slice.call(node.childNodes), [$.tn('[/spoiler]')])); - } - ref1 = $$('.prettyprint', bq); - for (k = 0, len1 = ref1.length; k < len1; k++) { - node = ref1[k]; - $.replace(node, [$.tn('[code]')].concat(slice.call(node.childNodes), [$.tn('[/code]')])); - } - }, - hasCORS: function(url) { - return url.split('/').slice(0, 3).join('/') === location.protocol + '//a.4cdn.org'; - }, - sfwBoards: function(sfw) { - return BoardConfig.sfwBoards(sfw); - }, - uidColor: function(uid) { - var i, msg; - msg = 0; - i = 0; - while (i < 8) { - msg = (msg << 5) - msg + uid.charCodeAt(i++); - } - return (msg >> 8) & 0xFFFFFF; - }, - isLinkified: function(link) { - return ImageHost.test(link.hostname); - }, - testNativeExtension: function() { - return $.global(function() { - if (window.Parser.postMenuIcon) { - return this.enabled = 'true'; - } - }); - }, - transformBoardList: function() { - var a, chr, i, items, j, len, node, nodes, ref, spacer, span; - nodes = []; - spacer = function() { - return $.el('span', { - className: 'spacer' - }); - }; - items = $.X('.//a|.//text()[not(ancestor::a)]', $(SW.yotsuba.selectors.boardList)); - i = 0; - while (node = items.snapshotItem(i++)) { - switch (node.nodeName) { - case '#text': - ref = node.nodeValue; - for (j = 0, len = ref.length; j < len; j++) { - chr = ref[j]; - span = $.el('span', { - textContent: chr - }); - if (chr === ' ') { - span.className = 'space'; - } - if (chr === ']') { - nodes.push(spacer()); - } - nodes.push(span); - if (chr === '[') { - nodes.push(spacer()); - } - } - break; - case 'A': - a = node.cloneNode(true); - nodes.push(a); - } - } - return nodes; - } - }; - -}).call(this); - -(function() { - var Build, - slice = [].slice; - - Build = { - staticPath: '//s.4cdn.org/image/', - gifIcon: window.devicePixelRatio >= 2 ? '@2x.gif' : '.gif', - spoilerRange: $.dict(), - shortFilename: function(filename) { - var ext; - ext = filename.match(/\.?[^\.]*$/)[0]; - if (filename.length - ext.length > 30) { - return (filename.match(/(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[^]){0,25}/)[0]) + "(...)" + ext; - } else { - return filename; - } - }, - spoilerThumb: function(boardID) { - var spoilerRange; - if (spoilerRange = Build.spoilerRange[boardID]) { - return Build.staticPath + "spoiler-" + boardID + (Math.floor(1 + spoilerRange * Math.random())) + ".png"; - } else { - return Build.staticPath + "spoiler.png"; - } - }, - sameThread: function(boardID, threadID) { - return g.VIEW === 'thread' && g.BOARD.ID === boardID && g.THREADID === +threadID; - }, - threadURL: function(boardID, threadID) { - if (boardID !== g.BOARD.ID) { - return "//" + (BoardConfig.domain(boardID)) + "/" + boardID + "/thread/" + threadID; - } else if (g.VIEW !== 'thread' || +threadID !== g.THREADID) { - return "/" + boardID + "/thread/" + threadID; - } else { - return ''; - } - }, - postURL: function(boardID, threadID, postID) { - return (Build.threadURL(boardID, threadID)) + "#p" + postID; - }, - parseJSON: function(data, arg) { - var boardID, key, o, siteID; - siteID = arg.siteID, boardID = arg.boardID; - o = { - ID: data.no, - postID: data.no, - threadID: data.resto || data.no, - boardID: boardID, - siteID: siteID, - isReply: !!data.resto, - isSticky: !!data.sticky, - isClosed: !!data.closed, - isArchived: !!data.archived, - fileDeleted: !!data.filedeleted, - filesDeleted: data.filedeleted ? [0] : [] - }; - o.info = { - subject: $.unescape(data.sub), - email: $.unescape(data.email), - name: $.unescape(data.name) || '', - tripcode: data.trip, - pass: data.since4pass != null ? "" + data.since4pass : void 0, - uniqueID: data.id, - flagCode: data.country, - flagCodeTroll: data.board_flag, - flag: $.unescape(data.country_name || data.flag_name), - dateUTC: data.time, - dateText: data.now, - commentHTML: { - innerHTML: data.com || '' - } - }; - if (data.capcode) { - o.info.capcode = data.capcode.replace(/_highlight$/, '').replace(/_/g, ' ').replace(/\b\w/g, function(c) { - return c.toUpperCase(); - }); - o.capcodeHighlight = /_highlight$/.test(data.capcode); - delete o.info.uniqueID; - } - o.files = []; - if (data.ext) { - o.file = SW.yotsuba.Build.parseJSONFile(data, { - siteID: siteID, - boardID: boardID - }); - o.files.push(o.file); - } - o.extra = $.dict(); - for (key in data) { - if (key[0] === 'x') { - o.extra[key] = data[key]; - } - } - return o; - }, - parseJSONFile: function(data, arg) { - var boardID, filename, o, site, siteID; - siteID = arg.siteID, boardID = arg.boardID; - site = g.sites[siteID]; - filename = site.software === 'yotsuba' && boardID === 'f' ? "" + (encodeURIComponent(data.filename)) + data.ext : "" + data.tim + data.ext; - o = { - name: ($.unescape(data.filename)) + data.ext, - url: site.urls.file({ - siteID: siteID, - boardID: boardID - }, filename), - height: data.h, - width: data.w, - MD5: data.md5, - size: $.bytesToString(data.fsize), - thumbURL: site.urls.thumb({ - siteID: siteID, - boardID: boardID - }, data.tim + "s.jpg"), - theight: data.tn_h, - twidth: data.tn_w, - isSpoiler: !!data.spoiler, - tag: data.tag, - hasDownscale: !!data.m_img - }; - if ((data.h != null) && !/\.pdf$/.test(o.url)) { - o.dimensions = o.width + "x" + o.height; - } - return o; - }, - parseComment: function(html) { - html = html.replace(//gi, '\n').replace(/\n\n]*>/g, ''); - return $.unescape(html); - }, - parseCommentDisplay: function(html) { - var html2; - if (!(Conf['Remove Spoilers'] || Conf['Reveal Spoilers'])) { - while ((html2 = html.replace(/(?:(?!<\/?s>).)*<\/s>/g, '[spoiler]')) !== html) { - html = html2; - } - } - html = html.replace(/^Rolled [^<]*<\/b>/i, '').replace(/ " + ((!o.isReply || boardID === "f" || subject) ? "" + E(subject || "") + " " : "") + "" + ((email) ? "" : "") + "" + E(name) + "" + ((tripcode) ? " " + E(tripcode) + "" : "") + ((pass) ? " " : "") + ((capcode) ? " ## " + E(capcode) + "" : "") + ((email) ? "" : "") + ((boardID === "f" && !o.isReply || capcodeDescription) ? "" : " ") + ((capcodeDescription) ? " \""" : "") + ((uniqueID && !capcode) ? " (ID: " + E(uniqueID) + ")" : "") + ((flagCode) ? " " : "") + ((flagCodeTroll) ? " " : "") + " " + E(dateText) + " No." + E(ID) + "" + ((o.isSticky) ? " \"Sticky\"" : "") + ((o.isClosed && !o.isArchived) ? " \"Closed\"" : "") + ((o.isArchived) ? " \"Archived\"" : "") + ((!o.isReply && g.VIEW === "index") ? "   [Reply]" : "") + ""}; - - /* File Info */ - if (file) { - protocol = /^https?:(?=\/\/i\.4cdn\.org\/)/; - fileURL = file.url.replace(protocol, ''); - shortFilename = Build.shortFilename(file.name); - fileThumb = file.isSpoiler ? Build.spoilerThumb(boardID) : file.thumbURL.replace(protocol, ''); - } - fileBlock = {innerHTML: ((file) ? "
" + ((boardID === "f") ? "
File: " + E(file.name) + "-(" + E(file.size) + ", " + E(file.dimensions) + ((file.tag) ? ", " + E(file.tag) : "") + ")
" : "
File: " + ((file.isSpoiler) ? "Spoiler Image" : E(shortFilename)) + " (" + E(file.size) + ", " + E(file.dimensions || "PDF") + ")
\""") + "
" : ((o.fileDeleted) ? "
\"File
" : ""))}; - - /* Whole Post */ - postClass = o.isReply ? 'reply' : 'op'; - wholePost = {innerHTML: ((o.isReply) ? "
>>
" : "") + "
" + ((o.isReply) ? (postInfo).innerHTML + (fileBlock).innerHTML : (fileBlock).innerHTML + (postInfo).innerHTML) + "
" + (commentHTML).innerHTML + "
"}; - container = $.el('div', { - className: "postContainer " + postClass + "Container", - id: "pc" + ID - }); - $.extend(container, wholePost); - ref1 = $$('.quotelink', container); - for (i = 0, len = ref1.length; i < len; i++) { - quote = ref1[i]; - href = quote.getAttribute('href'); - if (href[0] === '#') { - if (!Build.sameThread(boardID, threadID)) { - quote.href = Build.threadURL(boardID, threadID) + href; - } - } else { - if ((match = quote.href.match(SW.yotsuba.regexp.quotelink)) && (Build.sameThread(match[1], match[2]))) { - quote.href = href.match(/(#[^#]*)?$/)[0] || '#'; - } - } - } - return container; - }, - summaryText: function(status, posts, files) { - var text; - text = ''; - if (status) { - text += status + " "; - } - text += posts + " post" + (posts > 1 ? 's' : ''); - if (+files) { - text += " and " + files + " image repl" + (files > 1 ? 'ies' : 'y'); - } - return text += " " + (status === '-' ? 'shown' : 'omitted') + "."; - }, - summary: function(boardID, threadID, posts, files) { - return $.el('a', { - className: 'summary', - textContent: Build.summaryText('', posts, files), - href: "/" + boardID + "/thread/" + threadID - }); - }, - thread: function(thread, data, withReplies) { - var files, posts, ref, root, summary; - if ((root = thread.nodes.root)) { - $.rmAll(root); - } else { - thread.nodes.root = root = $.el('div', { - className: 'thread', - id: "t" + data.no - }); - } - if (Build.hat) { - $.add(root, Build.hat.cloneNode(false)); - } - $.add(root, thread.OP.nodes.root); - if (data.omitted_posts || !withReplies && data.replies) { - ref = withReplies ? [ - data.omitted_posts, data.images - data.last_replies.filter(function(data) { - return !!data.ext; - }).length - ] : [data.replies, data.images], posts = ref[0], files = ref[1]; - summary = Build.summary(thread.board.ID, data.no, posts, files); - $.add(root, summary); - } - return root; - }, - catalogThread: function(thread, data, pageCount) { - var br, container, cssText, fileCount, gifIcon, i, imgClass, len, postCount, ratio, ref, root, spoilerRange, src, staticPath, tn_h, tn_w; - staticPath = Build.staticPath, gifIcon = Build.gifIcon; - tn_w = data.tn_w, tn_h = data.tn_h; - if (data.spoiler && !Conf['Reveal Spoiler Thumbnails']) { - src = staticPath + "spoiler"; - if (spoilerRange = Build.spoilerRange[thread.board]) { - src += ("-" + thread.board) + Math.floor(1 + spoilerRange * Math.random()); - } - src += '.png'; - imgClass = 'spoiler-file'; - cssText = "--tn-w: 100; --tn-h: 100;"; - } else if (data.filedeleted) { - src = staticPath + "filedeleted-res" + gifIcon; - imgClass = 'deleted-file'; - } else if (thread.OP.file) { - src = thread.OP.file.thumbURL; - ratio = 250 / Math.max(tn_w, tn_h); - cssText = "--tn-w: " + (tn_w * ratio) + "; --tn-h: " + (tn_h * ratio) + ";"; - } else { - src = staticPath + "nofile.png"; - imgClass = 'no-file'; - } - postCount = data.replies + 1; - fileCount = data.images + !!data.ext; - container = $.el('div', {innerHTML: "
" + E(postCount) + " / " + E(fileCount) + " / " + E(pageCount) + "" + ((thread.isSticky) ? "" : "") + ((thread.isClosed) ? "" : "") + "
"}); - $.before(thread.OP.nodes.info, slice.call(container.childNodes)); - ref = $$('br', thread.OP.nodes.comment); - for (i = 0, len = ref.length; i < len; i++) { - br = ref[i]; - if (br.previousSibling && br.previousSibling.nodeName === 'BR') { - $.addClass(br, 'extra-linebreak'); - } - } - root = $.el('div', { - className: 'thread catalog-thread', - id: "t" + thread - }); - if (thread.OP.highlights) { - $.addClass.apply($, [root].concat(slice.call(thread.OP.highlights))); - } - if (!thread.OP.file) { - $.addClass(root, 'noFile'); - } - root.style.cssText = cssText || ''; - return root; - }, - catalogReply: function(thread, data) { - var excerpt, link; - excerpt = ''; - if (data.com) { - excerpt = Build.parseCommentDisplay(data.com).replace(/>>\d+/g, '').trim().replace(/\n+/g, ' // '); - } - if (data.ext) { - excerpt || (excerpt = "" + ($.unescape(data.filename)) + data.ext); - } - if (data.com) { - excerpt || (excerpt = $.unescape(data.com.replace(//gi, ' // '))); - } - excerpt || (excerpt = '\xA0'); - if (excerpt.length > 73) { - excerpt = excerpt.slice(0, 70) + "..."; - } - link = Build.postURL(thread.board.ID, thread.ID, data.no); - return $.el('div', { - className: 'catalog-reply' - }, {innerHTML: ": " + E(excerpt) + "..."}); - } - }; - - SW.yotsuba.Build = Build; - -}).call(this); - -Site = (function() { - var Site; - - Site = { - defaultProperties: { - '4chan.org': { - software: 'yotsuba' - }, - '4channel.org': { - canonical: '4chan.org' - }, - '4cdn.org': { - canonical: '4chan.org' - }, - 'notso.smuglo.li': { - canonical: 'smuglo.li' - }, - 'smugloli.net': { - canonical: 'smuglo.li' - }, - 'smug.nepu.moe': { - canonical: 'smuglo.li' - } - }, - init: function(cb) { - var hostname; - $.extend(Conf['siteProperties'], Site.defaultProperties); - hostname = Site.resolve(); - if (hostname && $.hasOwn(SW, Conf['siteProperties'][hostname].software)) { - this.set(hostname); - cb(); - } - return $.onExists(doc, 'body', (function(_this) { - return function() { - var base, base1, changed, changes, key, properties, software; - for (software in SW) { - if (!((changes = typeof (base = SW[software]).detect === "function" ? base.detect() : void 0))) { - continue; - } - changes.software = software; - hostname = location.hostname.replace(/^www\./, ''); - properties = ((base1 = Conf['siteProperties'])[hostname] || (base1[hostname] = $.dict())); - changed = 0; - for (key in changes) { - if (!(properties[key] !== changes[key])) { - continue; - } - properties[key] = changes[key]; - changed++; - } - if (changed) { - $.set('siteProperties', Conf['siteProperties']); - } - if (!g.SITE) { - _this.set(hostname); - cb(); - } - return; - } - }; - })(this)); - }, - resolve: function(url) { - var canonical, hostname; - if (url == null) { - url = location; - } - hostname = url.hostname; - while (hostname && !$.hasOwn(Conf['siteProperties'], hostname)) { - hostname = hostname.replace(/^[^.]*\.?/, ''); - } - if (hostname) { - if ((canonical = Conf['siteProperties'][hostname].canonical)) { - hostname = canonical; - } - } - return hostname; - }, - parseURL: function(url) { - var siteID; - siteID = Site.resolve(url); - return Main.parseURL(g.sites[siteID], url); - }, - set: function(hostname) { - var ID, properties, ref, site, software; - ref = Conf['siteProperties']; - for (ID in ref) { - properties = ref[ID]; - if (properties.canonical) { - continue; - } - software = properties.software; - if (!(software && $.hasOwn(SW, software))) { - continue; - } - g.sites[ID] = site = Object.create(SW[software]); - $.extend(site, { - ID: ID, - siteID: ID, - properties: properties, - software: software - }); - } - return g.SITE = g.sites[hostname]; - } - }; - - return Site; - -}).call(this); - -Redirect = (function() { - var Redirect, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Redirect = { - archives: [ - { "uid": 3, "name": "4plebs", "domain": "archive.4plebs.org", "http": true, "https": true, "software": "foolfuuka", "boards": [ "adv", "f", "hr", "mlpol", "mo", "o", "pol", "s4s", "sp", "tg", "trv", "tv", "x" ], "files": [ "adv", "f", "hr", "mlpol", "mo", "o", "pol", "s4s", "sp", "tg", "trv", "tv", "x" ], "reports": true }, - { "uid": 10, "name": "warosu", "domain": "warosu.org", "http": false, "https": true, "software": "fuuka", "boards": [ "3", "biz", "cgl", "ck", "diy", "fa", "ic", "jp", "lit", "sci", "vr", "vt" ], "files": [ "3", "biz", "cgl", "ck", "diy", "fa", "ic", "jp", "lit", "sci", "vr", "vt" ], "search": [ "biz", "cgl", "ck", "diy", "fa", "ic", "jp", "lit", "sci", "vr", "vt" ] }, - { "uid": 23, "name": "Desuarchive", "domain": "desuarchive.org", "http": true, "https": true, "software": "foolfuuka", "boards": [ "a", "aco", "an", "c", "cgl", "co", "d", "fit", "g", "his", "int", "k", "m", "mlp", "mu", "q", "qa", "r9k", "tg", "trash", "vr", "wsg" ], "files": [ "a", "aco", "an", "c", "cgl", "co", "d", "fit", "g", "his", "int", "k", "m", "mlp", "mu", "q", "qa", "r9k", "tg", "trash", "vr" ], "reports": true }, - { "uid": 24, "name": "fireden.net", "domain": "boards.fireden.net", "http": false, "https": true, "software": "foolfuuka", "boards": [ "cm", "co", "ic", "sci", "vip", "y" ], "files": [ "cm", "co", "ic", "sci", "vip", "y" ], "search": [ "cm", "co", "ic", "sci", "y" ] }, - { "uid": 25, "name": "arch.b4k.co", "domain": "arch.b4k.co", "http": true, "https": true, "software": "foolfuuka", "boards": [ "g", "mlp", "qb", "v", "vg", "vm", "vmg", "vp", "vrpg", "vst" ], "files": [ "qb", "v", "vg", "vm", "vmg", "vp", "vrpg", "vst" ], "search": [ "qb", "v", "vg", "vm", "vmg", "vp", "vrpg", "vst" ] }, - { "uid": 29, "name": "Archived.Moe", "domain": "archived.moe", "http": true, "https": true, "software": "foolfuuka", "boards": [ "3", "a", "aco", "adv", "an", "asp", "b", "bant", "biz", "c", "can", "cgl", "ck", "cm", "co", "cock", "con", "d", "diy", "e", "f", "fa", "fap", "fit", "fitlit", "g", "gd", "gif", "h", "hc", "his", "hm", "hr", "i", "ic", "int", "jp", "k", "lgbt", "lit", "m", "mlp", "mlpol", "mo", "mtv", "mu", "n", "news", "o", "out", "outsoc", "p", "po", "pol", "pw", "q", "qa", "qb", "qst", "r", "r9k", "s", "s4s", "sci", "soc", "sp", "spa", "t", "tg", "toy", "trash", "trv", "tv", "u", "v", "vg", "vint", "vip", "vm", "vmg", "vp", "vr", "vrpg", "vst", "vt", "w", "wg", "wsg", "wsr", "x", "xs", "y" ], "files": [ "can", "cock", "con", "fap", "fitlit", "gd", "mlpol", "mo", "mtv", "outsoc", "po", "q", "qb", "qst", "spa", "vint", "vip" ], "search": [ "aco", "adv", "an", "asp", "b", "bant", "biz", "c", "can", "cgl", "ck", "cm", "cock", "con", "d", "diy", "e", "f", "fap", "fitlit", "gd", "gif", "h", "hc", "his", "hm", "hr", "i", "ic", "lgbt", "lit", "mlpol", "mo", "mtv", "n", "news", "o", "out", "outsoc", "p", "po", "pw", "q", "qa", "qst", "r", "s", "soc", "spa", "trv", "u", "vint", "vip", "vrpg", "w", "wg", "wsg", "wsr", "x", "y" ], "reports": true }, - { "uid": 30, "name": "TheBArchive.com", "domain": "thebarchive.com", "http": true, "https": true, "software": "foolfuuka", "boards": [ "b", "bant" ], "files": [ "b", "bant" ], "reports": true }, - { "uid": 31, "name": "Archive Of Sins", "domain": "archiveofsins.com", "http": true, "https": true, "software": "foolfuuka", "boards": [ "h", "hc", "hm", "i", "lgbt", "r", "s", "soc", "t", "u" ], "files": [ "h", "hc", "hm", "i", "lgbt", "r", "s", "soc", "t", "u" ], "reports": true }, - { "uid": 34, "name": "TokyoChronos", "domain": "www.tokyochronos.net", "http": false, "https": true, "software": "foolfuuka", "boards": [ "c", "g", "jp", "mu", "vp", "vrpg", "vt" ], "files": [], "reports": true }, - { "uid": 36, "name": "palanq.win", "domain": "archive.palanq.win", "http": false, "https": true, "software": "foolfuuka", "boards": [ "bant", "c", "con", "e", "i", "n", "news", "out", "p", "pw", "qst", "toy", "vip", "vp", "vt", "w", "wg", "wsr" ], "files": [ "bant", "c", "e", "i", "n", "news", "out", "p", "pw", "qst", "toy", "vip", "vp", "vt", "w", "wg", "wsr" ], "reports": true }, - { "uid": 37, "name": "Eientei", "domain": "eientei.xyz", "http": false, "https": true, "software": "Eientei", "boards": [ "3", "i", "sci", "xs" ], "files": [ "3", "i", "sci", "xs" ], "reports": true } - ], - init: function() { - var now, ref; - this.selectArchives(); - if (Conf['archiveAutoUpdate']) { - now = Date.now(); - if (!((now - 2 * $.DAY < (ref = Conf['lastarchivecheck']) && ref <= now))) { - return this.update(); - } - } - }, - selectArchives: function() { - var archive, archives, boardID, boards, data, files, id, j, k, key, l, len, len1, len2, name, o, record, ref, ref1, ref2, software, type, uid; - o = { - thread: $.dict(), - post: $.dict(), - file: $.dict() - }; - archives = $.dict(); - ref = Conf['archives']; - for (j = 0, len = ref.length; j < len; j++) { - data = ref[j]; - ref1 = ['boards', 'files']; - for (k = 0, len1 = ref1.length; k < len1; k++) { - key = ref1[k]; - if (!(data[key] instanceof Array)) { - data[key] = []; - } - } - uid = data.uid, name = data.name, boards = data.boards, files = data.files, software = data.software; - if (software !== 'fuuka' && software !== 'foolfuuka') { - continue; - } - archives[JSON.stringify(uid != null ? uid : name)] = data; - for (l = 0, len2 = boards.length; l < len2; l++) { - boardID = boards[l]; - if (!(boardID in o.thread)) { - o.thread[boardID] = data; - } - if (!(boardID in o.post || software !== 'foolfuuka')) { - o.post[boardID] = data; - } - if (!(boardID in o.file || indexOf.call(files, boardID) < 0)) { - o.file[boardID] = data; - } - } - } - ref2 = Conf['selectedArchives']; - for (boardID in ref2) { - record = ref2[boardID]; - for (type in record) { - id = record[type]; - if (!((archive = archives[JSON.stringify(id)]) && $.hasOwn(o, type))) { - continue; - } - boards = type === 'file' ? archive.files : archive.boards; - if (indexOf.call(boards, boardID) >= 0) { - o[type][boardID] = archive; - } - } - } - return Redirect.data = o; - }, - update: function(cb) { - var err, fail, i, j, k, len, len1, load, nloaded, ref, ref1, response, responses, url, urls; - urls = []; - responses = []; - nloaded = 0; - ref = Conf['archiveLists'].split('\n'); - for (j = 0, len = ref.length; j < len; j++) { - url = ref[j]; - if (!(url[0] !== '#')) { - continue; - } - url = url.trim(); - if (url) { - urls.push(url); - } - } - fail = function(url, action, msg) { - return new Notice('warning', "Error " + action + " archive data from\n" + url + "\n" + msg, 20); - }; - load = function(i) { - return function() { - var response; - if (this.status !== 200) { - return fail(urls[i], 'fetching', (this.status ? "Error " + this.statusText + " (" + this.status + ")" : 'Connection Error')); - } - response = this.response; - if (!(response instanceof Array)) { - response = [response]; - } - responses[i] = response; - nloaded++; - if (nloaded === urls.length) { - return Redirect.parse(responses, cb); - } - }; - }; - if (urls.length) { - for (i = k = 0, len1 = urls.length; k < len1; i = ++k) { - url = urls[i]; - if ((ref1 = url[0]) === '[' || ref1 === '{') { - try { - response = JSON.parse(url); - } catch (error) { - err = error; - fail(url, 'parsing', err.message); - continue; - } - load(i).call({ - status: 200, - response: response - }); - } else { - CrossOrigin.ajax(url, { - onloadend: load(i) - }); - } - } - } else { - Redirect.parse([], cb); - } - }, - parse: function(responses, cb) { - var archiveUIDs, archives, data, items, j, k, len, len1, ref, response, uid; - archives = []; - archiveUIDs = $.dict(); - for (j = 0, len = responses.length; j < len; j++) { - response = responses[j]; - for (k = 0, len1 = response.length; k < len1; k++) { - data = response[k]; - uid = JSON.stringify((ref = data.uid) != null ? ref : data.name); - if (uid in archiveUIDs) { - $.extend(archiveUIDs[uid], data); - } else { - archiveUIDs[uid] = $.dict.clone(data); - archives.push(data); - } - } - } - items = { - archives: archives, - lastarchivecheck: Date.now() - }; - $.set(items); - $.extend(Conf, items); - Redirect.selectArchives(); - return typeof cb === "function" ? cb() : void 0; - }, - to: function(dest, data) { - var archive; - archive = (dest === 'search' || dest === 'board' ? Redirect.data.thread : Redirect.data[dest])[data.boardID]; - if (!archive) { - return ''; - } - return Redirect[dest](archive, data); - }, - protocol: function(archive) { - var protocol; - protocol = location.protocol; - if (!$.getOwn(archive, protocol.slice(0, -1))) { - protocol = protocol === 'https:' ? 'http:' : 'https:'; - } - return protocol + "//"; - }, - thread: function(archive, arg) { - var boardID, path, postID, threadID; - boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID; - path = threadID ? boardID + "/thread/" + threadID : boardID + "/post/" + postID; - if (archive.software === 'foolfuuka') { - path += '/'; - } - if (threadID && postID) { - path += archive.software === 'foolfuuka' ? "#" + postID : "#p" + postID; - } - return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path; - }, - post: function(archive, arg) { - var boardID, postID, protocol, url; - boardID = arg.boardID, postID = arg.postID; - protocol = Redirect.protocol(archive); - url = "" + protocol + archive.domain + "/_/api/chan/post/?board=" + boardID + "&num=" + postID; - if (!Redirect.securityCheck(url)) { - return ''; - } - return url; - }, - file: function(archive, arg) { - var boardID, filename; - boardID = arg.boardID, filename = arg.filename; - if (!filename) { - return ''; - } - if (boardID === 'f') { - filename = encodeURIComponent($.unescape(decodeURIComponent(filename))); - } else { - if (/[sm]\.jpg$/.test(filename)) { - return ''; - } - } - return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/full_image/" + filename; - }, - board: function(archive, arg) { - var boardID; - boardID = arg.boardID; - return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/"; - }, - search: function(archive, arg) { - var boardID, path, type, value; - boardID = arg.boardID, type = arg.type, value = arg.value; - type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type; - if (type === 'capcode') { - value = $.getOwn({ - 'Developer': 'dev', - 'Verified': 'ver' - }, value) || value.toLowerCase(); - } else if (type === 'image') { - value = value.replace(/[+\/=]/g, function(c) { - return { - '+': '-', - '/': '_', - '=': '' - }[c]; - }); - } - value = encodeURIComponent(value); - path = archive.software === 'foolfuuka' ? boardID + "/search/" + type + "/" + value + "/" : type === 'image' ? boardID + "/image/" + value : boardID + "/?task=search2&search_" + type + "=" + value; - return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path; - }, - report: function(boardID) { - var archive, boards, domain, https, j, len, name, ref, reports, software, urls; - urls = []; - ref = Conf['archives']; - for (j = 0, len = ref.length; j < len; j++) { - archive = ref[j]; - software = archive.software, https = archive.https, reports = archive.reports, boards = archive.boards, name = archive.name, domain = archive.domain; - if (software === 'foolfuuka' && https && reports && boards instanceof Array && indexOf.call(boards, boardID) >= 0) { - urls.push([name, "https://" + domain + "/_/api/chan/offsite_report/"]); - } - } - return urls; - }, - securityCheck: function(url) { - return /^https:\/\//.test(url) || location.protocol === 'http:' || Conf['Exempt Archives from Encryption']; - }, - navigate: function(dest, data, alternative) { - var url; - if (!Redirect.data) { - Redirect.init(); - } - url = Redirect.to(dest, data); - if (url && (Redirect.securityCheck(url) || confirm("Redirect to " + url + "?\n\nYour connection will not be encrypted."))) { - return location.replace(url); - } else if (alternative) { - return location.replace(alternative); - } - } - }; - - return Redirect; - -}).call(this); - -Anonymize = (function() { - var Anonymize; - - Anonymize = { - init: function() { - if (!Conf['Anonymize']) { - return; - } - return $.addClass(doc, 'anonymize'); - } - }; - - return Anonymize; - -}).call(this); - -Filter = (function() { - var Filter, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - slice = [].slice; - - Filter = { - filters: $.dict(), - init: function() { - var base, base1, boards, err, excludes, file, filter, hide, hl, i, isstring, j, key, len, len1, line, mask, noti, op, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, regexp, stub, top, type, types; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'catalog') && Conf['Filter'])) { - return; - } - if (g.VIEW === 'catalog' && !Conf['Filter in Native Catalog']) { - return; - } - if (!Conf['Filtered Backlinks']) { - $.addClass(doc, 'hide-backlinks'); - } - for (key in Config.filter) { - ref1 = Conf[key].split('\n'); - for (i = 0, len = ref1.length; i < len; i++) { - line = ref1[i]; - if (line[0] === '#') { - continue; - } - if (!(regexp = line.match(/\/(.*)\/(\w*)/))) { - continue; - } - filter = line.replace(regexp[0], ''); - boards = this.parseBoards((ref2 = filter.match(/(?:^|;)\s*boards:([^;]+)/)) != null ? ref2[1] : void 0); - excludes = this.parseBoards((ref3 = filter.match(/(?:^|;)\s*exclude:([^;]+)/)) != null ? ref3[1] : void 0); - if ((isstring = (key === 'uniqueID' || key === 'MD5'))) { - regexp = regexp[1]; - } else { - try { - regexp = RegExp(regexp[1], regexp[2]); - } catch (error) { - err = error; - new Notice('warning', [$.tn("Invalid " + key + " filter:"), $.el('br'), $.tn(line), $.el('br'), $.tn(err.message)], 60); - continue; - } - } - op = ((ref4 = filter.match(/(?:^|;)\s*op:(no|only)/)) != null ? ref4[1] : void 0) || ''; - mask = $.getOwn({ - 'no': 1, - 'only': 2 - }, op) || 0; - file = ((ref5 = filter.match(/(?:^|;)\s*file:(no|only)/)) != null ? ref5[1] : void 0) || ''; - mask = mask | ($.getOwn({ - 'no': 4, - 'only': 8 - }, file) || 0); - stub = (function() { - var ref6; - switch ((ref6 = filter.match(/(?:^|;)\s*stub:(yes|no)/)) != null ? ref6[1] : void 0) { - case 'yes': - return true; - case 'no': - return false; - default: - return Conf['Stubs']; - } - })(); - noti = /(?:^|;)\s*notify/.test(filter); - if ((hl = /(?:^|;)\s*highlight/.test(filter))) { - hl = ((ref6 = filter.match(/(?:^|;)\s*highlight:([\w-]+)/)) != null ? ref6[1] : void 0) || 'filter-highlight'; - top = ((ref7 = filter.match(/(?:^|;)\s*top:(yes|no)/)) != null ? ref7[1] : void 0) || 'yes'; - top = top === 'yes'; - } - if (key === 'general') { - if ((types = filter.match(/(?:^|;)\s*type:([^;]*)/))) { - types = types[1].split(','); - } else { - types = ['subject', 'name', 'filename', 'comment']; - } - } - hide = !(hl || noti); - filter = { - isstring: isstring, - regexp: regexp, - boards: boards, - excludes: excludes, - mask: mask, - hide: hide, - stub: stub, - hl: hl, - top: top, - noti: noti - }; - if (key === 'general') { - for (j = 0, len1 = types.length; j < len1; j++) { - type = types[j]; - ((base = this.filters)[type] || (base[type] = [])).push(filter); - } - } else { - ((base1 = this.filters)[key] || (base1[key] = [])).push(filter); - } - } - } - if (!Object.keys(this.filters).length) { - return; - } - if (g.VIEW === 'catalog') { - return Filter.catalog(); - } else { - return Callbacks.Post.push({ - name: 'Filter', - cb: this.node - }); - } - }, - parseBoards: function(boardsRaw) { - var boardID, boardID2, boards, i, j, len, len1, ref, ref1, ref2, ref3, site, siteFilter, siteID; - if (!boardsRaw) { - return false; - } - if ((boards = Filter.parseBoardsMemo[boardsRaw])) { - return boards; - } - boards = $.dict(); - siteFilter = ''; - ref = boardsRaw.split(','); - for (i = 0, len = ref.length; i < len; i++) { - boardID = ref[i]; - if (indexOf.call(boardID, ':') >= 0) { - ref1 = boardID.split(':').slice(-2), siteFilter = ref1[0], boardID = ref1[1]; - } - ref2 = g.sites; - for (siteID in ref2) { - site = ref2[siteID]; - if (siteID.slice(0, siteFilter.length) === siteFilter) { - if (boardID === 'nsfw' || boardID === 'sfw') { - ref3 = (typeof site.sfwBoards === "function" ? site.sfwBoards(boardID === 'sfw') : void 0) || []; - for (j = 0, len1 = ref3.length; j < len1; j++) { - boardID2 = ref3[j]; - boards[siteID + "/" + boardID2] = true; - } - } else { - boards[siteID + "/" + (encodeURIComponent(boardID))] = true; - } - } - } - } - Filter.parseBoardsMemo[boardsRaw] = boards; - return boards; - }, - parseBoardsMemo: $.dict(), - test: function(post, hideable) { - var board, filter, hide, hl, i, j, key, len, len1, mask, noti, ref, ref1, ref2, site, stub, top, value; - if (hideable == null) { - hideable = true; - } - if (post.filterResults) { - return post.filterResults; - } - hide = false; - stub = true; - hl = void 0; - top = false; - noti = false; - if (QuoteYou.isYou(post)) { - hideable = false; - } - mask = (post.isReply ? 2 : 1); - mask = mask | (post.file ? 4 : 8); - board = post.siteID + "/" + post.boardID; - site = post.siteID + "/*"; - for (key in Filter.filters) { - ref = Filter.values(key, post); - for (i = 0, len = ref.length; i < len; i++) { - value = ref[i]; - ref1 = Filter.filters[key]; - for (j = 0, len1 = ref1.length; j < len1; j++) { - filter = ref1[j]; - if ((filter.boards && !(filter.boards[board] || filter.boards[site])) || (filter.excludes && (filter.excludes[board] || filter.excludes[site])) || (filter.mask & mask) || (filter.isstring ? filter.regexp !== value : !filter.regexp.test(value))) { - continue; - } - if (filter.hide) { - if (hideable) { - hide = true; - stub && (stub = filter.stub); - } - } else { - if (!(hl && (ref2 = filter.hl, indexOf.call(hl, ref2) >= 0))) { - (hl || (hl = [])).push(filter.hl); - } - top || (top = filter.top); - if (filter.noti) { - noti = true; - } - } - } - } - } - if (hide) { - return { - hide: hide, - stub: stub - }; - } else { - return { - hl: hl, - top: top, - noti: noti - }; - } - }, - node: function() { - var hide, hl, noti, ref, stub, top; - if (this.isClone) { - return; - } - ref = Filter.test(this, !this.isFetchedQuote && (this.isReply || g.VIEW === 'index')), hide = ref.hide, stub = ref.stub, hl = ref.hl, top = ref.top, noti = ref.noti; - if (hide) { - if (this.isReply) { - PostHiding.hide(this, stub); - } else { - ThreadHiding.hide(this.thread, stub); - } - } else { - if (hl) { - this.highlights = hl; - $.addClass.apply($, [this.nodes.root].concat(slice.call(hl))); - } - } - if (noti && Unread.posts && (this.ID > Unread.lastReadPost) && !QuoteYou.isYou(this)) { - return Unread.openNotification(this, ' triggered a notification filter'); - } - }, - catalog: function() { - var base, url; - if (!(url = typeof (base = g.SITE.urls).catalogJSON === "function" ? base.catalogJSON(g.BOARD) : void 0)) { - return; - } - Filter.catalogData = $.dict(); - $.ajax(url, { - onloadend: Filter.catalogParse - }); - return Callbacks.CatalogThreadNative.push({ - name: 'Filter', - cb: this.catalogNode - }); - }, - catalogParse: function() { - var i, item, j, len, len1, page, ref, ref1, ref2; - if ((ref = this.status) !== 200 && ref !== 404) { - new Notice('warning', "Failed to fetch catalog JSON data. " + (this.status ? "Error " + this.statusText + " (" + this.status + ")" : 'Connection Error'), 1); - return; - } - ref1 = this.response; - for (i = 0, len = ref1.length; i < len; i++) { - page = ref1[i]; - ref2 = page.threads; - for (j = 0, len1 = ref2.length; j < len1; j++) { - item = ref2[j]; - Filter.catalogData[item.no] = item; - } - } - g.BOARD.threads.forEach(function(thread) { - if (thread.catalogViewNative) { - return Filter.catalogNode.call(thread.catalogViewNative); - } - }); - }, - catalogNode: function() { - var base, hide, hl, ref, ref1, top; - if (!(this.boardID === g.BOARD.ID && Filter.catalogData[this.ID])) { - return; - } - if ((ref = QuoteYou.db) != null ? ref.get({ - siteID: g.SITE.ID, - boardID: this.boardID, - threadID: this.ID, - postID: this.ID - }) : void 0) { - return; - } - ref1 = Filter.test(g.SITE.Build.parseJSON(Filter.catalogData[this.ID], this)), hide = ref1.hide, hl = ref1.hl, top = ref1.top; - if (hide) { - return this.nodes.root.hidden = true; - } else { - if (hl) { - this.highlights = hl; - $.addClass.apply($, [this.nodes.root].concat(slice.call(hl))); - } - if (top) { - $.prepend(this.nodes.root.parentNode, this.nodes.root); - return typeof (base = g.SITE).catalogPin === "function" ? base.catalogPin(this.nodes.root) : void 0; - } - } - }, - isHidden: function(post) { - return !!Filter.test(post).hide; - }, - valueF: { - postID: function(post) { - return ["" + post.ID]; - }, - name: function(post) { - return [post.info.name]; - }, - uniqueID: function(post) { - return [post.info.uniqueID || '']; - }, - tripcode: function(post) { - return [post.info.tripcode]; - }, - capcode: function(post) { - return [post.info.capcode]; - }, - pass: function(post) { - return [post.info.pass]; - }, - email: function(post) { - return [post.info.email]; - }, - subject: function(post) { - return [post.info.subject || (post.isReply ? void 0 : '')]; - }, - comment: function(post) { - var base, ref, ref1; - return [((base = post.info).comment != null ? base.comment : base.comment = (ref = g.sites[post.siteID]) != null ? (ref1 = ref.Build) != null ? typeof ref1.parseComment === "function" ? ref1.parseComment(post.info.commentHTML.innerHTML) : void 0 : void 0 : void 0)]; - }, - flag: function(post) { - return [post.info.flag]; - }, - filename: function(post) { - return post.files.map(function(f) { - return f.name; - }); - }, - dimensions: function(post) { - return post.files.map(function(f) { - return f.dimensions; - }); - }, - filesize: function(post) { - return post.files.map(function(f) { - return f.size; - }); - }, - MD5: function(post) { - return post.files.map(function(f) { - return f.MD5; - }); - } - }, - values: function(key, post) { - if ($.hasOwn(Filter.valueF, key)) { - return Filter.valueF[key](post).filter(function(v) { - return v != null; - }); - } else { - return [ - key.split('+').map(function(k) { - var f; - if ((f = $.getOwn(Filter.valueF, k))) { - return f(post).map(function(v) { - return v || ''; - }).join('\n'); - } else { - return ''; - } - }).join('\n') - ]; - } - }, - addFilter: function(type, re, cb) { - if (!$.hasOwn(Config.filter, type)) { - return; - } - return $.get(type, Conf[type], function(item) { - var save; - save = item[type]; - save = save ? save + "\n" + re : re; - return $.set(type, save, cb); - }); - }, - removeFilters: function(type, res, cb) { - return $.get(type, Conf[type], function(item) { - var save; - save = item[type]; - res = res.map(Filter.escape).join('|'); - save = save.replace(RegExp("(?:$\n|^)(?:" + res + ")$", 'mg'), ''); - return $.set(type, save, cb); - }); - }, - showFilters: function(type) { - var section, select; - Settings.open('Filter'); - section = $('.section-container'); - select = $('select[name=filter]', section); - select.value = type; - Settings.selectFilter.call(select); - return $.onExists(section, 'textarea', function(ta) { - var tl; - tl = ta.textLength; - ta.setSelectionRange(tl, tl); - return ta.focus(); - }); - }, - quickFilterMD5: function() { - var files, filter, links, msg, notice, origin, post; - post = Get.postFromNode(this); - files = post.files.filter(function(f) { - return f.MD5; - }); - if (!files.length) { - return; - } - filter = files.map(function(f) { - return "/" + f.MD5 + "/"; - }).join('\n'); - Filter.addFilter('MD5', filter); - origin = post.origin || post; - if (origin.isReply) { - PostHiding.hide(origin); - } else if (g.VIEW === 'index') { - ThreadHiding.hide(origin.thread); - } - if (!Conf['MD5 Quick Filter Notifications']) { - if (post.nodes.post.getBoundingClientRect().height) { - new Notice('info', 'MD5 filtered.', 2); - } - return; - } - notice = Filter.quickFilterMD5.notice; - if (notice) { - notice.filters.push(filter); - notice.posts.push(origin); - return $('span', notice.el).textContent = notice.filters.length + " MD5s filtered."; - } else { - msg = $.el('div', {innerHTML: "MD5 filtered. [show] [undo]"}); - notice = Filter.quickFilterMD5.notice = new Notice('info', msg, void 0, function() { - return delete Filter.quickFilterMD5.notice; - }); - notice.filters = [filter]; - notice.posts = [origin]; - links = $$('a', msg); - $.on(links[0], 'click', Filter.quickFilterCB.show.bind(notice)); - return $.on(links[1], 'click', Filter.quickFilterCB.undo.bind(notice)); - } - }, - quickFilterCB: { - show: function() { - Filter.showFilters('MD5'); - return this.close(); - }, - undo: function() { - var i, len, post, ref; - Filter.removeFilters('MD5', this.filters); - ref = this.posts; - for (i = 0, len = ref.length; i < len; i++) { - post = ref[i]; - if (post.isReply) { - PostHiding.show(post); - } else if (g.VIEW === 'index') { - ThreadHiding.show(post.thread); - } - } - return this.close(); - } - }, - escape: function(value) { - return value.replace(/\/|\\|\^|\$|\n|\.|\(|\)|\{|\}|\[|\]|\?|\*|\+|\|/g, function(c) { - if (c === '\n') { - return '\\n'; - } else if (c === '\\') { - return '\\\\'; - } else { - return "\\" + c; - } - }); - }, - menu: { - init: function() { - var div, entry, i, len, ref, ref1, type; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Filter'])) { - return; - } - div = $.el('div', { - textContent: 'Filter' - }); - entry = { - el: div, - order: 50, - open: function(post) { - Filter.menu.post = post; - return true; - }, - subEntries: [] - }; - ref1 = [['Name', 'name'], ['Unique ID', 'uniqueID'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Pass Date', 'pass'], ['Email', 'email'], ['Subject', 'subject'], ['Comment', 'comment'], ['Flag', 'flag'], ['Filename', 'filename'], ['Image dimensions', 'dimensions'], ['Filesize', 'filesize'], ['Image MD5', 'MD5']]; - for (i = 0, len = ref1.length; i < len; i++) { - type = ref1[i]; - entry.subEntries.push(Filter.menu.createSubEntry(type[0], type[1])); - } - return Menu.menu.addEntry(entry); - }, - createSubEntry: function(text, type) { - var el; - el = $.el('a', { - href: 'javascript:;', - textContent: text - }); - el.dataset.type = type; - $.on(el, 'click', Filter.menu.makeFilter); - return { - el: el, - open: function(post) { - return Filter.values(type, post).length; - } - }; - }, - makeFilter: function() { - var res, type, values; - type = this.dataset.type; - values = Filter.values(type, Filter.menu.post); - res = values.map(function(value) { - var re; - re = type === 'uniqueID' || type === 'MD5' ? value : Filter.escape(value); - if (type === 'uniqueID' || type === 'MD5') { - return "/" + re + "/"; - } else { - return "/^" + re + "$/"; - } - }).join('\n'); - return Filter.addFilter(type, res, function() { - return Filter.showFilters(type); - }); - } - } - }; - - return Filter; - -}).call(this); - -PostHiding = (function() { - var PostHiding; - - PostHiding = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link'])) { - return; - } - if (Conf['Reply Hiding Buttons']) { - $.addClass(doc, "reply-hide"); - } - this.db = new DataBoard('hiddenPosts'); - return Callbacks.Post.push({ - name: 'Reply Hiding', - cb: this.node - }); - }, - isHidden: function(boardID, threadID, postID) { - return !!(PostHiding.db && PostHiding.db.get({ - boardID: boardID, - threadID: threadID, - postID: postID - })); - }, - node: function() { - var button, data, sa, sideArrows; - if (!this.isReply || this.isClone || this.isFetchedQuote) { - return; - } - if (data = PostHiding.db.get({ - boardID: this.board.ID, - threadID: this.thread.ID, - postID: this.ID - })) { - if (data.thisPost) { - PostHiding.hide(this, data.makeStub, data.hideRecursively); - } else { - Recursive.apply(PostHiding.hide, this, data.makeStub, true); - Recursive.add(PostHiding.hide, this, data.makeStub, true); - } - } - if (!Conf['Reply Hiding Buttons']) { - return; - } - button = PostHiding.makeButton(this, 'hide'); - if ((sa = g.SITE.selectors.sideArrows)) { - sideArrows = $(sa, this.nodes.root); - $.replace(sideArrows.firstChild, button); - return sideArrows.className = 'replacedSideArrows'; - } else { - return $.prepend(this.nodes.info, button); - } - }, - menu: { - init: function() { - var apply, div, hideStubLink, makeStub, ref, replies, thisPost; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Menu'] || !Conf['Reply Hiding Link']) { - return; - } - div = $.el('div', { - className: 'hide-reply-link', - textContent: 'Hide' - }); - apply = $.el('a', { - textContent: 'Apply', - href: 'javascript:;' - }); - $.on(apply, 'click', PostHiding.menu.hide); - thisPost = UI.checkbox('thisPost', 'This post', true); - replies = UI.checkbox('replies', 'Hide replies', Conf['Recursive Hiding']); - makeStub = UI.checkbox('makeStub', 'Make stub', Conf['Stubs']); - Menu.menu.addEntry({ - el: div, - order: 20, - open: function(post) { - if (!post.isReply || post.isClone || post.isHidden) { - return false; - } - PostHiding.menu.post = post; - return true; - }, - subEntries: [ - { - el: apply - }, { - el: thisPost - }, { - el: replies - }, { - el: makeStub - } - ] - }); - div = $.el('div', { - className: 'show-reply-link', - textContent: 'Show' - }); - apply = $.el('a', { - textContent: 'Apply', - href: 'javascript:;' - }); - $.on(apply, 'click', PostHiding.menu.show); - thisPost = UI.checkbox('thisPost', 'This post', false); - replies = UI.checkbox('replies', 'Show replies', false); - hideStubLink = $.el('a', { - textContent: 'Hide stub', - href: 'javascript:;' - }); - $.on(hideStubLink, 'click', PostHiding.menu.hideStub); - Menu.menu.addEntry({ - el: div, - order: 20, - open: function(post) { - var data; - if (!post.isReply || post.isClone || !post.isHidden) { - return false; - } - if (!(data = PostHiding.db.get({ - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID - }))) { - return false; - } - PostHiding.menu.post = post; - thisPost.firstChild.checked = post.isHidden; - replies.firstChild.checked = (data != null ? data.hideRecursively : void 0) != null ? data.hideRecursively : Conf['Recursive Hiding']; - return true; - }, - subEntries: [ - { - el: apply - }, { - el: thisPost - }, { - el: replies - } - ] - }); - return Menu.menu.addEntry({ - el: hideStubLink, - order: 15, - open: function(post) { - var data; - if (!post.isReply || post.isClone || !post.isHidden) { - return false; - } - if (!(data = PostHiding.db.get({ - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID - }))) { - return false; - } - return PostHiding.menu.post = post; - } - }); - }, - hide: function() { - var makeStub, parent, post, replies, thisPost; - parent = this.parentNode; - thisPost = $('input[name=thisPost]', parent).checked; - replies = $('input[name=replies]', parent).checked; - makeStub = $('input[name=makeStub]', parent).checked; - post = PostHiding.menu.post; - if (thisPost) { - PostHiding.hide(post, makeStub, replies); - } else if (replies) { - Recursive.apply(PostHiding.hide, post, makeStub, true); - Recursive.add(PostHiding.hide, post, makeStub, true); - } else { - return; - } - PostHiding.saveHiddenState(post, true, thisPost, makeStub, replies); - return $.event('CloseMenu'); - }, - show: function() { - var data, parent, post, replies, thisPost; - parent = this.parentNode; - thisPost = $('input[name=thisPost]', parent).checked; - replies = $('input[name=replies]', parent).checked; - post = PostHiding.menu.post; - if (thisPost) { - PostHiding.show(post, replies); - } else if (replies) { - Recursive.apply(PostHiding.show, post, true); - Recursive.rm(PostHiding.hide, post, true); - } else { - return; - } - if (data = PostHiding.db.get({ - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID - })) { - PostHiding.saveHiddenState(post, !(thisPost && replies), !thisPost, data.makeStub, !replies); - } - return $.event('CloseMenu'); - }, - hideStub: function() { - var data, post; - post = PostHiding.menu.post; - if (data = PostHiding.db.get({ - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID - })) { - PostHiding.show(post, data.hideRecursively); - PostHiding.hide(post, false, data.hideRecursively); - PostHiding.saveHiddenState(post, true, true, false, data.hideRecursively); - } - $.event('CloseMenu'); - } - }, - makeButton: function(post, type) { - var a, span; - span = $.el('span', { - className: "fa fa-" + (type === 'hide' ? 'minus' : 'plus') + "-square-o", - textContent: "" - }); - a = $.el('a', { - className: type + "-reply-button", - href: 'javascript:;' - }); - $.add(a, span); - $.on(a, 'click', PostHiding.toggle); - return a; - }, - saveHiddenState: function(post, isHiding, thisPost, makeStub, hideRecursively) { - var data; - data = { - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID - }; - if (isHiding) { - data.val = { - thisPost: thisPost !== false, - makeStub: makeStub, - hideRecursively: hideRecursively - }; - return PostHiding.db.set(data); - } else { - return PostHiding.db["delete"](data); - } - }, - toggle: function() { - var post; - post = Get.postFromNode(this); - PostHiding[(post.isHidden ? 'show' : 'hide')](post); - return PostHiding.saveHiddenState(post, post.isHidden); - }, - hide: function(post, makeStub, hideRecursively) { - var a, i, len, quotelink, ref; - if (makeStub == null) { - makeStub = Conf['Stubs']; - } - if (hideRecursively == null) { - hideRecursively = Conf['Recursive Hiding']; - } - if (post.isHidden) { - return; - } - post.isHidden = true; - if (hideRecursively) { - Recursive.apply(PostHiding.hide, post, makeStub, true); - Recursive.add(PostHiding.hide, post, makeStub, true); - } - ref = Get.allQuotelinksLinkingTo(post); - for (i = 0, len = ref.length; i < len; i++) { - quotelink = ref[i]; - $.addClass(quotelink, 'filtered'); - } - if (!makeStub) { - post.nodes.root.hidden = true; - return; - } - a = PostHiding.makeButton(post, 'show'); - $.add(a, $.tn(" " + post.info.nameBlock)); - post.nodes.stub = $.el('div', { - className: 'stub' - }); - $.add(post.nodes.stub, a); - if (Conf['Menu']) { - $.add(post.nodes.stub, Menu.makeButton(post)); - } - return $.prepend(post.nodes.root, post.nodes.stub); - }, - show: function(post, showRecursively) { - var i, len, quotelink, ref; - if (showRecursively == null) { - showRecursively = Conf['Recursive Hiding']; - } - if (post.nodes.stub) { - $.rm(post.nodes.stub); - delete post.nodes.stub; - } else { - post.nodes.root.hidden = false; - } - post.isHidden = false; - if (showRecursively) { - Recursive.apply(PostHiding.show, post, true); - Recursive.rm(PostHiding.hide, post); - } - ref = Get.allQuotelinksLinkingTo(post); - for (i = 0, len = ref.length; i < len; i++) { - quotelink = ref[i]; - $.rmClass(quotelink, 'filtered'); - } - } - }; - - return PostHiding; - -}).call(this); - -Recursive = (function() { - var Recursive, - slice = [].slice, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Recursive = { - recursives: $.dict(), - init: function() { - var ref; - if ((ref = g.VIEW) !== 'index' && ref !== 'thread') { - return; - } - return Callbacks.Post.push({ - name: 'Recursive', - cb: this.node - }); - }, - node: function() { - var i, j, k, len, len1, obj, quote, recursive, ref, ref1; - if (this.isClone || this.isFetchedQuote) { - return; - } - ref = this.quotes; - for (j = 0, len = ref.length; j < len; j++) { - quote = ref[j]; - if (obj = Recursive.recursives[quote]) { - ref1 = obj.recursives; - for (i = k = 0, len1 = ref1.length; k < len1; i = ++k) { - recursive = ref1[i]; - recursive.apply(null, [this].concat(slice.call(obj.args[i]))); - } - } - } - }, - add: function() { - var args, base, name, obj, post, recursive; - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : []; - obj = (base = Recursive.recursives)[name = post.fullID] || (base[name] = { - recursives: [], - args: [] - }); - obj.recursives.push(recursive); - return obj.args.push(args); - }, - rm: function(recursive, post) { - var i, j, len, obj, rec, ref; - if (!(obj = Recursive.recursives[post.fullID])) { - return; - } - ref = obj.recursives; - for (i = j = 0, len = ref.length; j < len; i = ++j) { - rec = ref[i]; - if (!(rec === recursive)) { - continue; - } - obj.recursives.splice(i, 1); - obj.args.splice(i, 1); - } - }, - apply: function() { - var args, fullID, post, recursive; - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : []; - fullID = post.fullID; - return g.posts.forEach(function(post) { - if (indexOf.call(post.quotes, fullID) >= 0) { - return recursive.apply(null, [post].concat(slice.call(args))); - } - }); - } - }; - - return Recursive; - -}).call(this); - -ThreadHiding = (function() { - var ThreadHiding; - - ThreadHiding = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Index']) { - return; - } - this.db = new DataBoard('hiddenThreads'); - if (g.VIEW === 'catalog') { - return this.catalogWatch(); - } - this.catalogSet(g.BOARD); - $.on(d, 'IndexRefreshInternal', this.onIndexRefresh); - if (Conf['Thread Hiding Buttons']) { - $.addClass(doc, 'thread-hide'); - } - return Callbacks.Post.push({ - name: 'Thread Hiding', - cb: this.node - }); - }, - catalogSet: function(board) { - var hiddenThreads, threadID; - if (!($.hasStorage && g.SITE.software === 'yotsuba')) { - return; - } - hiddenThreads = ThreadHiding.db.get({ - boardID: board.ID, - defaultValue: $.dict() - }); - for (threadID in hiddenThreads) { - hiddenThreads[threadID] = true; - } - return localStorage.setItem("4chan-hide-t-" + board, JSON.stringify(hiddenThreads)); - }, - catalogWatch: function() { - if (!($.hasStorage && g.SITE.software === 'yotsuba')) { - return; - } - this.hiddenThreads = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {}; - return Main.ready(function() { - return new MutationObserver(ThreadHiding.catalogSave).observe($.id('threads'), { - attributes: true, - subtree: true, - attributeFilter: ['style'] - }); - }); - }, - catalogSave: function() { - var hiddenThreads2, threadID; - hiddenThreads2 = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {}; - for (threadID in hiddenThreads2) { - if (!$.hasOwn(ThreadHiding.hiddenThreads, threadID)) { - ThreadHiding.db.set({ - boardID: g.BOARD.ID, - threadID: threadID, - val: { - makeStub: Conf['Stubs'] - } - }); - } - } - for (threadID in ThreadHiding.hiddenThreads) { - if (!$.hasOwn(hiddenThreads2, threadID)) { - ThreadHiding.db["delete"]({ - boardID: g.BOARD.ID, - threadID: threadID - }); - } - } - return ThreadHiding.hiddenThreads = hiddenThreads2; - }, - isHidden: function(boardID, threadID) { - return !!(ThreadHiding.db && ThreadHiding.db.get({ - boardID: boardID, - threadID: threadID - })); - }, - node: function() { - var data; - if (this.isReply || this.isClone || this.isFetchedQuote) { - return; - } - if (Conf['Thread Hiding Buttons']) { - $.prepend(this.nodes.root, ThreadHiding.makeButton(this.thread, 'hide')); - } - if (data = ThreadHiding.db.get({ - boardID: this.board.ID, - threadID: this.ID - })) { - return ThreadHiding.hide(this.thread, data.makeStub); - } - }, - onIndexRefresh: function() { - return g.BOARD.threads.forEach(function(thread) { - var root; - root = thread.nodes.root; - if (thread.isHidden && thread.stub && !root.contains(thread.stub)) { - return ThreadHiding.makeStub(thread, root); - } - }); - }, - menu: { - init: function() { - var apply, div, hideStubLink, makeStub; - if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) { - return; - } - div = $.el('div', { - className: 'hide-thread-link', - textContent: 'Hide' - }); - apply = $.el('a', { - textContent: 'Apply', - href: 'javascript:;' - }); - $.on(apply, 'click', ThreadHiding.menu.hide); - makeStub = UI.checkbox('Stubs', 'Make stub'); - Menu.menu.addEntry({ - el: div, - order: 20, - open: function(arg) { - var isReply, thread; - thread = arg.thread, isReply = arg.isReply; - if (isReply || thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') { - return false; - } - ThreadHiding.menu.thread = thread; - return true; - }, - subEntries: [ - { - el: apply - }, { - el: makeStub - } - ] - }); - div = $.el('a', { - className: 'show-thread-link', - textContent: 'Show', - href: 'javascript:;' - }); - $.on(div, 'click', ThreadHiding.menu.show); - Menu.menu.addEntry({ - el: div, - order: 20, - open: function(arg) { - var isReply, thread; - thread = arg.thread, isReply = arg.isReply; - if (isReply || !thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') { - return false; - } - ThreadHiding.menu.thread = thread; - return true; - } - }); - hideStubLink = $.el('a', { - textContent: 'Hide stub', - href: 'javascript:;' - }); - $.on(hideStubLink, 'click', ThreadHiding.menu.hideStub); - return Menu.menu.addEntry({ - el: hideStubLink, - order: 15, - open: function(arg) { - var isReply, thread; - thread = arg.thread, isReply = arg.isReply; - if (isReply || !thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') { - return false; - } - return ThreadHiding.menu.thread = thread; - } - }); - }, - hide: function() { - var makeStub, thread; - makeStub = $('input', this.parentNode).checked; - thread = ThreadHiding.menu.thread; - ThreadHiding.hide(thread, makeStub); - ThreadHiding.saveHiddenState(thread, makeStub); - return $.event('CloseMenu'); - }, - show: function() { - var thread; - thread = ThreadHiding.menu.thread; - ThreadHiding.show(thread); - ThreadHiding.saveHiddenState(thread); - return $.event('CloseMenu'); - }, - hideStub: function() { - var thread; - thread = ThreadHiding.menu.thread; - ThreadHiding.show(thread); - ThreadHiding.hide(thread, false); - ThreadHiding.saveHiddenState(thread, false); - $.event('CloseMenu'); - } - }, - makeButton: function(thread, type) { - var a; - a = $.el('a', { - className: type + "-thread-button", - href: 'javascript:;' - }); - $.extend(a, {innerHTML: ""}); - a.dataset.fullID = thread.fullID; - $.on(a, 'click', ThreadHiding.toggle); - return a; - }, - makeStub: function(thread, root) { - var a, numReplies, summary, threadDivider; - numReplies = $$(g.SITE.selectors.replyOriginal, root).length; - if (summary = $(g.SITE.selectors.summary, root)) { - numReplies += +summary.textContent.match(/\d+/); - } - a = ThreadHiding.makeButton(thread, 'show'); - $.add(a, $.tn(" " + thread.OP.info.nameBlock + " (" + (numReplies === 1 ? '1 reply' : numReplies + " replies") + ")")); - thread.stub = $.el('div', { - className: 'stub' - }); - if (Conf['Menu']) { - $.add(thread.stub, [a, Menu.makeButton(thread.OP)]); - } else { - $.add(thread.stub, a); - } - $.prepend(root, thread.stub); - if ((threadDivider = $(g.SITE.selectors.threadDivider, root))) { - return $.addClass(threadDivider, 'threadDivider'); - } - }, - saveHiddenState: function(thread, makeStub) { - if (thread.isHidden) { - ThreadHiding.db.set({ - boardID: thread.board.ID, - threadID: thread.ID, - val: { - makeStub: makeStub - } - }); - } else { - ThreadHiding.db["delete"]({ - boardID: thread.board.ID, - threadID: thread.ID - }); - } - return ThreadHiding.catalogSet(thread.board); - }, - toggle: function(thread) { - if (!(thread instanceof Thread)) { - thread = g.threads.get(this.dataset.fullID); - } - if (thread.isHidden) { - ThreadHiding.show(thread); - } else { - ThreadHiding.hide(thread); - } - return ThreadHiding.saveHiddenState(thread); - }, - hide: function(thread, makeStub) { - var threadRoot; - if (makeStub == null) { - makeStub = Conf['Stubs']; - } - if (thread.isHidden) { - return; - } - threadRoot = thread.nodes.root; - thread.isHidden = true; - Index.updateHideLabel(); - if (thread.catalogView && !Index.showHiddenThreads) { - $.rm(thread.catalogView.nodes.root); - $.event('PostsRemoved', null, Index.root); - } - if (!makeStub) { - return threadRoot.hidden = true; - } - return ThreadHiding.makeStub(thread, threadRoot); - }, - show: function(thread) { - var threadRoot; - if (thread.stub) { - $.rm(thread.stub); - delete thread.stub; - } - threadRoot = thread.nodes.root; - threadRoot.hidden = thread.isHidden = false; - Index.updateHideLabel(); - if (thread.catalogView && Index.showHiddenThreads) { - $.rm(thread.catalogView.nodes.root); - return $.event('PostsRemoved', null, Index.root); - } - } - }; - - return ThreadHiding; - -}).call(this); - -BoardConfig = (function() { - var BoardConfig; - - BoardConfig = { - cbs: [], - init: function() { - var boards, now, ref; - if (g.SITE.software !== 'yotsuba') { - return; - } - now = Date.now(); - if (!((now - 2 * $.HOUR < (ref = Conf['boardConfig'].lastChecked || 0) && ref <= now))) { - return $.ajax(location.protocol + "//a.4cdn.org/boards.json", { - onloadend: this.load - }); - } else { - boards = Conf['boardConfig'].boards; - return this.set(boards); - } - }, - load: function() { - var board, boards, err, i, len, ref; - if (this.status === 200 && this.response && this.response.boards) { - boards = $.dict(); - ref = this.response.boards; - for (i = 0, len = ref.length; i < len; i++) { - board = ref[i]; - boards[board.board] = board; - } - $.set('boardConfig', { - boards: boards, - lastChecked: Date.now() - }); - } else { - boards = Conf['boardConfig'].boards; - err = (function() { - switch (this.status) { - case 0: - return 'Connection Error'; - case 200: - return 'Invalid Data'; - default: - return "Error " + this.statusText + " (" + this.status + ")"; - } - }).call(this); - new Notice('warning', "Failed to load board configuration. " + err, 20); - } - return BoardConfig.set(boards); - }, - set: function(boards1) { - var ID, board, cb, i, len, ref, ref1; - this.boards = boards1; - ref = g.boards; - for (ID in ref) { - board = ref[ID]; - board.config = this.boards[ID] || {}; - } - ref1 = this.cbs; - for (i = 0, len = ref1.length; i < len; i++) { - cb = ref1[i]; - $.queueTask(cb); - } - }, - ready: function(cb) { - if (this.boards) { - return cb(); - } else { - return this.cbs.push(cb); - } - }, - sfwBoards: function(sfw) { - var board, data, ref, results; - ref = this.boards || Conf['boardConfig'].boards; - results = []; - for (board in ref) { - data = ref[board]; - if (!!data.ws_board === sfw) { - results.push(board); - } - } - return results; - }, - isSFW: function(board) { - var ref; - return !!((ref = (this.boards || Conf['boardConfig'].boards)[board]) != null ? ref.ws_board : void 0); - }, - domain: function(board) { - return "boards." + (BoardConfig.isSFW(board) ? '4channel' : '4chan') + ".org"; - }, - isArchived: function(board) { - var data; - data = (this.boards || Conf['boardConfig'].boards)[board]; - return !data || data.is_archived; - }, - noAudio: function(boardID) { - var boards; - if (g.SITE.software !== 'yotsuba') { - return false; - } - boards = this.boards || Conf['boardConfig'].boards; - return boards && boards[boardID] && !boards[boardID].webm_audio; - }, - title: function(boardID) { - var ref, ref1; - return ((ref = this.boards || Conf['boardConfig'].boards) != null ? (ref1 = ref[boardID]) != null ? ref1.title : void 0 : void 0) || ''; - } - }; - - return BoardConfig; - -}).call(this); - -Get = (function() { - var Get, - slice = [].slice, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Get = { - url: function() { - var IDs, args, f, site, type; - type = arguments[0], IDs = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : []; - if ((site = g.sites[IDs.siteID]) && (f = $.getOwn(site.urls, type))) { - return f.apply(null, [IDs].concat(slice.call(args))); - } else { - return void 0; - } - }, - threadExcerpt: function(thread) { - var OP, excerpt, ref, ref1; - OP = thread.OP; - excerpt = ("/" + (decodeURIComponent(thread.board.ID)) + "/ - ") + (((ref = OP.info.subject) != null ? ref.trim() : void 0) || OP.commentDisplay().replace(/\n+/g, ' // ') || ((ref1 = OP.file) != null ? ref1.name : void 0) || ("No." + OP)); - if (excerpt.length > 73) { - return excerpt.slice(0, 70) + "..."; - } - return excerpt; - }, - threadFromRoot: function(root) { - var board; - if (root == null) { - return null; - } - board = root.dataset.board; - return g.threads.get((board ? encodeURIComponent(board) : g.BOARD.ID) + "." + (root.id.match(/\d*$/)[0])); - }, - threadFromNode: function(node) { - return Get.threadFromRoot($.x("ancestor-or-self::" + g.SITE.xpath.thread, node)); - }, - postFromRoot: function(root) { - var index, post; - if (root == null) { - return null; - } - post = g.posts.get(root.dataset.fullID); - index = root.dataset.clone; - if (index) { - return post.clones[+index]; - } else { - return post; - } - }, - postFromNode: function(root) { - return Get.postFromRoot($.x("ancestor-or-self::" + g.SITE.xpath.postContainer + "[1]", root)); - }, - postDataFromLink: function(link) { - var boardID, match, postID, ref, ref1, threadID; - if (link.dataset.postID) { - ref = link.dataset, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID; - threadID || (threadID = 0); - } else { - match = link.href.match(g.SITE.regexp.quotelink); - ref1 = match.slice(1), boardID = ref1[0], threadID = ref1[1], postID = ref1[2]; - postID || (postID = threadID); - } - return { - boardID: boardID, - threadID: +threadID, - postID: +postID - }; - }, - allQuotelinksLinkingTo: function(post) { - var fullID, handleQuotes, i, len, posts, qPost, quote, quotelinks, ref; - quotelinks = []; - posts = g.posts; - fullID = post.fullID; - handleQuotes = function(qPost, type) { - var clone, i, len, ref; - quotelinks.push.apply(quotelinks, qPost.nodes[type]); - ref = qPost.clones; - for (i = 0, len = ref.length; i < len; i++) { - clone = ref[i]; - quotelinks.push.apply(quotelinks, clone.nodes[type]); - } - }; - posts.forEach(function(qPost) { - if (indexOf.call(qPost.quotes, fullID) >= 0) { - return handleQuotes(qPost, 'quotelinks'); - } - }); - if (Conf['Quote Backlinks']) { - ref = post.quotes; - for (i = 0, len = ref.length; i < len; i++) { - quote = ref[i]; - if (qPost = posts.get(quote)) { - handleQuotes(qPost, 'backlinks'); - } - } - } - return quotelinks.filter(function(quotelink) { - var boardID, postID, ref1; - ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID; - return boardID === post.board.ID && postID === post.ID; - }); - } - }; - - return Get; - -}).call(this); - -Header = (function() { - var Header, - slice = [].slice; - - Header = { - init: function() { - var barFixedToggler, barPositionToggler, box, cs, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, menuButton, scrollHeaderToggler, shortcutToggler; - $.onExists(doc, 'body', (function(_this) { - return function() { - if (!Main.isThisPageLegit()) { - return; - } - $.add(_this.bar, [_this.noticesRoot, _this.toggle]); - $.prepend(d.body, _this.bar); - $.add(d.body, Header.hover); - return _this.setBarPosition(Conf['Bottom Header']); - }; - })(this)); - this.menu = new UI.Menu('header'); - menuButton = $.el('span', { - className: 'menu-button' - }); - $.extend(menuButton, {innerHTML: ""}); - box = UI.checkbox; - barFixedToggler = box('Fixed Header', 'Fixed Header'); - headerToggler = box('Header auto-hide', 'Auto-hide header'); - scrollHeaderToggler = box('Header auto-hide on scroll', 'Auto-hide header on scroll'); - barPositionToggler = box('Bottom Header', 'Bottom header'); - linkJustifyToggler = box('Centered links', 'Centered links'); - customNavToggler = box('Custom Board Navigation', 'Custom board navigation'); - footerToggler = box('Bottom Board List', 'Hide bottom board list'); - shortcutToggler = box('Shortcut Icons', 'Shortcut Icons'); - editCustomNav = $.el('a', { - textContent: 'Edit custom board navigation', - href: 'javascript:;' - }); - this.barFixedToggler = barFixedToggler.firstElementChild; - this.scrollHeaderToggler = scrollHeaderToggler.firstElementChild; - this.barPositionToggler = barPositionToggler.firstElementChild; - this.linkJustifyToggler = linkJustifyToggler.firstElementChild; - this.headerToggler = headerToggler.firstElementChild; - this.footerToggler = footerToggler.firstElementChild; - this.shortcutToggler = shortcutToggler.firstElementChild; - this.customNavToggler = customNavToggler.firstElementChild; - $.on(menuButton, 'click', this.menuToggle); - $.on(this.headerToggler, 'change', this.toggleBarVisibility); - $.on(this.barFixedToggler, 'change', this.toggleBarFixed); - $.on(this.barPositionToggler, 'change', this.toggleBarPosition); - $.on(this.scrollHeaderToggler, 'change', this.toggleHideBarOnScroll); - $.on(this.linkJustifyToggler, 'change', this.toggleLinkJustify); - $.on(this.footerToggler, 'change', this.toggleFooterVisibility); - $.on(this.shortcutToggler, 'change', this.toggleShortcutIcons); - $.on(this.customNavToggler, 'change', this.toggleCustomNav); - $.on(editCustomNav, 'click', this.editCustomNav); - this.setBarFixed(Conf['Fixed Header']); - this.setHideBarOnScroll(Conf['Header auto-hide on scroll']); - this.setBarVisibility(Conf['Header auto-hide']); - this.setLinkJustify(Conf['Centered links']); - this.setShortcutIcons(Conf['Shortcut Icons']); - this.setFooterVisibility(Conf['Bottom Board List']); - $.sync('Fixed Header', this.setBarFixed); - $.sync('Header auto-hide on scroll', this.setHideBarOnScroll); - $.sync('Bottom Header', this.setBarPosition); - $.sync('Shortcut Icons', this.setShortcutIcons); - $.sync('Header auto-hide', this.setBarVisibility); - $.sync('Centered links', this.setLinkJustify); - $.sync('Bottom Board List', this.setFooterVisibility); - this.addShortcut('menu', menuButton, 900); - this.menu.addEntry({ - el: $.el('span', { - textContent: 'Header' - }), - order: 107, - subEntries: [ - { - el: barFixedToggler - }, { - el: headerToggler - }, { - el: scrollHeaderToggler - }, { - el: barPositionToggler - }, { - el: linkJustifyToggler - }, { - el: footerToggler - }, { - el: shortcutToggler - }, { - el: customNavToggler - }, { - el: editCustomNav - } - ] - }); - $.on(window, 'load popstate', Header.hashScroll); - $.on(d, 'CreateNotification', this.createNotification); - this.setBoardList(); - $.onExists(doc, g.SITE.selectors.boardList + " + *", Header.generateFullBoardList); - Main.ready(function() { - var a, absbot, footer, i, len, ref; - if (g.SITE.software === 'yotsuba' && !(footer = $.id('boardNavDesktopFoot'))) { - if (!(absbot = $.id('absbot'))) { - return; - } - footer = $.id('boardNavDesktop').cloneNode(true); - footer.id = 'boardNavDesktopFoot'; - $('#navtopright', footer).id = 'navbotright'; - $('#settingsWindowLink', footer).id = 'settingsWindowLinkBot'; - $.before(absbot, footer); - $.global(function() { - return window.cloneTopNav = function() {}; - }); - } - if ((Header.bottomBoardList = $(g.SITE.selectors.boardListBottom))) { - ref = $$('a', Header.bottomBoardList); - for (i = 0, len = ref.length; i < len; i++) { - a = ref[i]; - if (a.hostname === location.hostname && a.pathname.split('/')[1] === g.BOARD.ID) { - a.className = 'current'; - } - } - return CatalogLinks.setLinks(Header.bottomBoardList); - } - }); - if (g.SITE.software === 'yotsuba' && (g.VIEW === 'catalog' || !Conf['Disable Native Extension'])) { - cs = $.el('a', { - href: 'javascript:;' - }); - if (g.VIEW === 'catalog') { - cs.title = cs.textContent = 'Catalog Settings'; - cs.className = 'fa fa-book'; - } else { - cs.title = cs.textContent = '4chan Settings'; - cs.className = 'native-settings'; - } - $.on(cs, 'click', function() { - return $.id('settingsWindowLink').click(); - }); - this.addShortcut('native', cs, 810); - } - return this.enableDesktopNotifications(); - }, - bar: $.el('div', { - id: 'header-bar' - }), - noticesRoot: $.el('div', { - id: 'notifications' - }), - shortcuts: $.el('span', { - id: 'shortcuts' - }), - hover: $.el('div', { - id: 'hoverUI' - }), - toggle: $.el('div', { - id: 'scroll-marker' - }), - setBoardList: function() { - var boardList, btn; - Header.boardList = boardList = $.el('span', { - id: 'board-list' - }); - $.extend(boardList, {innerHTML: ""}); - btn = $('.hide-board-list-button', boardList); - $.on(btn, 'click', Header.toggleBoardList); - $.prepend(Header.bar, [Header.boardList, Header.shortcuts]); - Header.setCustomNav(Conf['Custom Board Navigation']); - Header.generateBoardList(Conf['boardnav']); - $.sync('Custom Board Navigation', Header.setCustomNav); - return $.sync('boardnav', Header.generateBoardList); - }, - generateFullBoardList: function() { - var a, fullBoardList, i, len, nodes, ref; - if (g.SITE.transformBoardList) { - nodes = g.SITE.transformBoardList(); - } else { - nodes = slice.call($(g.SITE.selectors.boardList).cloneNode(true).childNodes); - } - fullBoardList = $('.boardList', Header.boardList); - $.add(fullBoardList, nodes); - ref = $$('a', fullBoardList); - for (i = 0, len = ref.length; i < len; i++) { - a = ref[i]; - if (a.hostname === location.hostname && a.pathname.split('/')[1] === g.BOARD.ID) { - a.className = 'current'; - } - } - return CatalogLinks.setLinks(fullBoardList); - }, - generateBoardList: function(boardnav) { - var list, nodes, re, t; - list = $('#custom-board-list', Header.boardList); - $.rmAll(list); - if (!boardnav) { - return; - } - boardnav = boardnav.replace(/(\r\n|\n|\r)/g, ' '); - re = /[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|nt|(mode|sort|text):"[^"]+"(,"[^"]+")?))*|[^\w@]+/g; - nodes = (function() { - var i, len, ref, results; - ref = boardnav.match(re); - results = []; - for (i = 0, len = ref.length; i < len; i++) { - t = ref[i]; - results.push(Header.mapCustomNavigation(t)); - } - return results; - })(); - $.add(list, nodes); - return CatalogLinks.setLinks(list); - }, - mapCustomNavigation: function(t) { - var a, boardID, href, indexOptions, m, ref, ref1, text, url, urlIC; - if (/^[^\w@]/.test(t)) { - return $.tn(t); - } - text = url = null; - t = t.replace(/-text:"([^"]+)"(?:,"([^"]+)")?/g, function(m0, m1, m2) { - text = m1; - url = m2; - return ''; - }); - indexOptions = []; - t = t.replace(/-(?:mode|sort):"([^"]+)"/g, function(m0, m1) { - indexOptions.push(m1.toLowerCase().replace(/\ /g, '-')); - return ''; - }); - indexOptions = indexOptions.join('/'); - if (/^toggle-all/.test(t)) { - a = $.el('a', { - className: 'show-board-list-button', - textContent: text || '+', - href: 'javascript:;' - }); - $.on(a, 'click', Header.toggleBoardList); - return a; - } - if (/^external/.test(t)) { - a = $.el('a', { - href: url || 'javascript:;', - textContent: text || '+', - className: 'external' - }); - if (/-nt/.test(t)) { - a.target = '_blank'; - a.rel = 'noopener'; - } - return a; - } - boardID = t.split('-')[0]; - if (boardID === 'current') { - if ((ref = location.hostname) === 'boards.4chan.org' || ref === 'boards.4channel.org') { - boardID = g.BOARD.ID; - } else { - a = $.el('a', { - href: "/" + g.BOARD.ID + "/", - textContent: text || decodeURIComponent(g.BOARD.ID), - className: 'current' - }); - if (/-nt/.test(t)) { - a.target = '_blank'; - a.rel = 'noopener'; - } - if (/-index/.test(t)) { - a.dataset.only = 'index'; - } else if (/-catalog/.test(t)) { - a.dataset.only = 'catalog'; - a.href += 'catalog.html'; - } else if (/-(archive|expired)/.test(t)) { - a = a.firstChild; - } - return a; - } - } - a = (function() { - var ref1, urlV; - if (boardID === '@') { - return $.el('a', { - href: 'https://twitter.com/4chan', - title: '4chan Twitter', - textContent: '@' - }); - } - a = $.el('a', { - href: "//" + (BoardConfig.domain(boardID)) + "/" + boardID + "/", - textContent: boardID, - title: BoardConfig.title(boardID) - }); - if (((ref1 = g.VIEW) === 'catalog' || ref1 === 'archive') && (urlV = Get.url(g.VIEW, { - siteID: '4chan.org', - boardID: boardID - }))) { - a.href = urlV; - } - if (a.hostname === location.hostname && boardID === g.BOARD.ID) { - a.className = 'current'; - } - return a; - })(); - a.textContent = /-title/.test(t) || /-replace/.test(t) && a.hostname === location.hostname && boardID === g.BOARD.ID ? a.title || a.textContent : /-full/.test(t) ? ("/" + boardID + "/") + (a.title ? " - " + a.title : '') : text || boardID; - if (m = t.match(/-(index|catalog)/)) { - urlIC = CatalogLinks[m[1]]({ - siteID: '4chan.org', - boardID: boardID - }); - if (urlIC) { - a.dataset.only = m[1]; - a.href = urlIC; - if (m[1] === 'catalog') { - $.addClass(a, 'catalog'); - } - } else { - return a.firstChild; - } - } - if (Conf['JSON Index'] && indexOptions) { - a.dataset.indexOptions = indexOptions; - if (((ref1 = a.hostname) === 'boards.4chan.org' || ref1 === 'boards.4channel.org') && a.pathname.split('/')[2] === '') { - a.href += (a.hash ? '/' : '#') + indexOptions; - } - } - if (/-archive/.test(t)) { - if (href = Redirect.to('board', { - boardID: boardID - })) { - a.href = href; - } else { - return a.firstChild; - } - } - if (/-expired/.test(t)) { - if (BoardConfig.isArchived(boardID)) { - a.href = "//" + (BoardConfig.domain(boardID)) + "/" + boardID + "/archive"; - } else { - return a.firstChild; - } - } - if (/-nt/.test(t)) { - a.target = '_blank'; - a.rel = 'noopener'; - } - if (boardID === '@') { - $.addClass(a, 'navSmall'); - } - return a; - }, - toggleBoardList: function() { - var bar, custom, full, showBoardList; - bar = Header.bar; - custom = $('#custom-board-list', bar); - full = $('#full-board-list', bar); - showBoardList = !full.hidden; - custom.hidden = !showBoardList; - return full.hidden = showBoardList; - }, - setLinkJustify: function(centered) { - Header.linkJustifyToggler.checked = centered; - if (centered) { - return $.addClass(doc, 'centered-links'); - } else { - return $.rmClass(doc, 'centered-links'); - } - }, - toggleLinkJustify: function() { - var centered; - $.event('CloseMenu'); - centered = this.nodeName === 'INPUT' ? this.checked : void 0; - Header.setLinkJustify(centered); - return $.set('Centered links', centered); - }, - setBarFixed: function(fixed) { - Header.barFixedToggler.checked = fixed; - if (fixed) { - $.addClass(doc, 'fixed'); - return $.addClass(Header.bar, 'dialog'); - } else { - $.rmClass(doc, 'fixed'); - return $.rmClass(Header.bar, 'dialog'); - } - }, - toggleBarFixed: function() { - $.event('CloseMenu'); - Header.setBarFixed(this.checked); - Conf['Fixed Header'] = this.checked; - return $.set('Fixed Header', this.checked); - }, - setShortcutIcons: function(show) { - Header.shortcutToggler.checked = show; - if (show) { - return $.addClass(doc, 'shortcut-icons'); - } else { - return $.rmClass(doc, 'shortcut-icons'); - } - }, - toggleShortcutIcons: function() { - $.event('CloseMenu'); - Header.setShortcutIcons(this.checked); - Conf['Shortcut Icons'] = this.checked; - return $.set('Shortcut Icons', this.checked); - }, - setBarVisibility: function(hide) { - Header.headerToggler.checked = hide; - $.event('CloseMenu'); - (hide ? $.addClass : $.rmClass)(Header.bar, 'autohide'); - return (hide ? $.addClass : $.rmClass)(doc, 'autohide'); - }, - toggleBarVisibility: function() { - var hide, message; - hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide'); - Conf['Header auto-hide'] = hide; - $.set('Header auto-hide', hide); - Header.setBarVisibility(hide); - message = "The header bar will " + (hide ? 'automatically hide itself.' : 'remain visible.'); - return new Notice('info', message, 2); - }, - setHideBarOnScroll: function(hide) { - Header.scrollHeaderToggler.checked = hide; - if (hide) { - $.on(window, 'scroll', Header.hideBarOnScroll); - return; - } - $.off(window, 'scroll', Header.hideBarOnScroll); - $.rmClass(Header.bar, 'scroll'); - return Header.bar.classList.toggle('autohide', Conf['Header auto-hide']); - }, - toggleHideBarOnScroll: function() { - var hide; - hide = this.checked; - $.cb.checked.call(this); - return Header.setHideBarOnScroll(hide); - }, - hideBarOnScroll: function() { - var offsetY; - offsetY = window.pageYOffset; - if (offsetY > (Header.previousOffset || 0)) { - $.addClass(Header.bar, 'autohide', 'scroll'); - } else { - $.rmClass(Header.bar, 'autohide', 'scroll'); - } - return Header.previousOffset = offsetY; - }, - setBarPosition: function(bottom) { - var args, ref; - if ((ref = Header.barPositionToggler) != null) { - ref.checked = bottom; - } - $.event('CloseMenu'); - args = bottom ? ['bottom-header', 'top-header', 'after'] : ['top-header', 'bottom-header', 'add']; - $.addClass(doc, args[0]); - $.rmClass(doc, args[1]); - return $[args[2]](Header.bar, Header.noticesRoot); - }, - toggleBarPosition: function() { - $.cb.checked.call(this); - return Header.setBarPosition(this.checked); - }, - setFooterVisibility: function(hide) { - Header.footerToggler.checked = hide; - return doc.classList.toggle('hide-bottom-board-list', hide); - }, - toggleFooterVisibility: function() { - var hide, message; - $.event('CloseMenu'); - hide = this.nodeName === 'INPUT' ? this.checked : $.hasClass(doc, 'hide-bottom-board-list'); - Header.setFooterVisibility(hide); - $.set('Bottom Board List', hide); - message = hide ? 'The bottom navigation will now be hidden.' : 'The bottom navigation will remain visible.'; - return new Notice('info', message, 2); - }, - setCustomNav: function(show) { - var btn, cust, full, ref; - Header.customNavToggler.checked = show; - cust = $('#custom-board-list', Header.bar); - full = $('#full-board-list', Header.bar); - btn = $('.hide-board-list-container', full); - return ref = show ? [false, true, false] : [true, false, true], cust.hidden = ref[0], full.hidden = ref[1], btn.hidden = ref[2], ref; - }, - toggleCustomNav: function() { - $.cb.checked.call(this); - return Header.setCustomNav(this.checked); - }, - editCustomNav: function() { - var settings; - Settings.open('Advanced'); - settings = $.id('fourchanx-settings'); - return $('[name=boardnav]', settings).focus(); - }, - hashScroll: function(e) { - var el, hash; - if (e) { - if (e.state) { - return; - } - if (!history.state) { - history.replaceState({}, ''); - } - } - if ((hash = location.hash.slice(1))) { - ReplyPruning.showIfHidden(hash); - if ((el = $.id(hash))) { - return $.queueTask(function() { - return Header.scrollTo(el); - }); - } - } - }, - scrollTo: function(root, down, needed) { - var height, x; - if (!root.offsetParent) { - return; - } - if (down) { - x = Header.getBottomOf(root); - if (Conf['Fixed Header'] && Conf['Header auto-hide on scroll'] && Conf['Bottom header']) { - height = Header.bar.getBoundingClientRect().height; - if (x <= 0) { - if (!Header.isHidden()) { - x += height; - } - } else { - if (Header.isHidden()) { - x -= height; - } - } - } - if (!(needed && x >= 0)) { - return window.scrollBy(0, -x); - } - } else { - x = Header.getTopOf(root); - if (Conf['Fixed Header'] && Conf['Header auto-hide on scroll'] && !Conf['Bottom header']) { - height = Header.bar.getBoundingClientRect().height; - if (x >= 0) { - if (!Header.isHidden()) { - x += height; - } - } else { - if (Header.isHidden()) { - x -= height; - } - } - } - if (!(needed && x >= 0)) { - return window.scrollBy(0, x); - } - } - }, - scrollToIfNeeded: function(root, down) { - return Header.scrollTo(root, down, true); - }, - getTopOf: function(root) { - var headRect, top; - top = root.getBoundingClientRect().top; - if (Conf['Fixed Header'] && !Conf['Bottom Header']) { - headRect = Header.toggle.getBoundingClientRect(); - top -= headRect.top + headRect.height; - } - return top; - }, - getBottomOf: function(root) { - var bottom, clientHeight, headRect; - clientHeight = doc.clientHeight; - bottom = clientHeight - root.getBoundingClientRect().bottom; - if (Conf['Fixed Header'] && Conf['Bottom Header']) { - headRect = Header.toggle.getBoundingClientRect(); - bottom -= clientHeight - headRect.bottom + headRect.height; - } - return bottom; - }, - isNodeVisible: function(node) { - var height; - if (d.hidden || !doc.contains(node)) { - return false; - } - height = node.getBoundingClientRect().height; - return Header.getTopOf(node) + height >= 0 && Header.getBottomOf(node) + height >= 0; - }, - isHidden: function() { - var top; - top = Header.bar.getBoundingClientRect().top; - if (Conf['Bottom header']) { - return top === doc.clientHeight; - } else { - return top < 0; - } - }, - addShortcut: function(id, el, index) { - var i, item, len, ref, shortcut; - shortcut = $.el('span', { - id: "shortcut-" + id, - className: 'shortcut brackets-wrap' - }); - $.add(shortcut, el); - shortcut.dataset.index = index; - ref = $$('[data-index]', Header.shortcuts); - for (i = 0, len = ref.length; i < len; i++) { - item = ref[i]; - if (!(+item.dataset.index > +index)) { - continue; - } - $.before(item, shortcut); - return; - } - return $.add(Header.shortcuts, shortcut); - }, - rmShortcut: function(el) { - return $.rm(el.parentElement); - }, - menuToggle: function(e) { - return Header.menu.toggle(e, this, g); - }, - createNotification: function(e) { - var content, lifetime, notice, ref, type; - ref = e.detail, type = ref.type, content = ref.content, lifetime = ref.lifetime; - return notice = new Notice(type, content, lifetime); - }, - areNotificationsEnabled: false, - enableDesktopNotifications: function() { - var authorize, disable, el, notice, ref; - if (!(window.Notification && Conf['Desktop Notifications'])) { - return; - } - switch (Notification.permission) { - case 'granted': - Header.areNotificationsEnabled = true; - return; - case 'denied': - return; - } - el = $.el('span', {innerHTML: "4chan X needs your permission to show desktop notifications. [FAQ]
or "}); - ref = $$('button', el), authorize = ref[0], disable = ref[1]; - $.on(authorize, 'click', function() { - return Notification.requestPermission(function(status) { - Header.areNotificationsEnabled = status === 'granted'; - if (status === 'default') { - return; - } - return notice.close(); - }); - }); - $.on(disable, 'click', function() { - $.set('Desktop Notifications', false); - return notice.close(); - }); - return notice = new Notice('info', el); - } - }; - - return Header; - -}).call(this); - -Index = (function() { - var Index, - slice = [].slice, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Index = { - showHiddenThreads: false, - changed: {}, - enabledOn: function(arg) { - var boardID, siteID; - siteID = arg.siteID, boardID = arg.boardID; - return Conf['JSON Index'] && g.sites[siteID].software === 'yotsuba' && boardID !== 'f'; - }, - init: function() { - var arr, entries, i, input, inputs, k, l, label, len1, len2, name, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, select, sortEntry, tRaw, watchSettings; - if (g.VIEW !== 'index') { - return; - } - $.one(d, '4chanXInitFinished', this.cb.initFinished); - $.on(d, 'PostsInserted', this.cb.postsInserted); - if (!this.enabledOn(g.BOARD)) { - return; - } - this.enabled = true; - Callbacks.Post.push({ - name: 'Index Page Numbers', - cb: this.node - }); - Callbacks.CatalogThread.push({ - name: 'Catalog Features', - cb: this.catalogNode - }); - this.search = ((ref = history.state) != null ? ref.searched : void 0) || ''; - if ((ref1 = history.state) != null ? ref1.mode : void 0) { - Conf['Index Mode'] = (ref2 = history.state) != null ? ref2.mode : void 0; - } - this.currentSort = (ref3 = history.state) != null ? ref3.sort : void 0; - this.currentSort || (this.currentSort = typeof Conf['Index Sort'] === 'object' ? Conf['Index Sort'][g.BOARD.ID] || 'bump' : Conf['Index Sort']); - this.currentPage = this.getCurrentPage(); - this.processHash(); - $.addClass(doc, 'index-loading', (Conf['Index Mode'].replace(/\ /g, '-')) + "-mode"); - $.on(window, 'popstate', this.cb.popstate); - $.on(d, 'scroll', this.scroll); - $.on(d, 'SortIndex', this.cb.resort); - this.button = $.el('a', { - className: 'fa fa-refresh', - title: 'Refresh', - href: 'javascript:;', - textContent: 'Refresh Index' - }); - $.on(this.button, 'click', function() { - return Index.update(); - }); - Header.addShortcut('index-refresh', this.button, 590); - entries = []; - this.inputs = inputs = $.dict(); - ref4 = Config.Index; - for (name in ref4) { - arr = ref4[name]; - if (!(arr instanceof Array)) { - continue; - } - label = UI.checkbox(name, "" + name[0] + (name.slice(1).toLowerCase())); - label.title = arr[1]; - entries.push({ - el: label - }); - input = label.firstChild; - $.on(input, 'change', $.cb.checked); - inputs[name] = input; - } - $.on(inputs['Show Replies'], 'change', this.cb.replies); - $.on(inputs['Catalog Hover Expand'], 'change', this.cb.hover); - $.on(inputs['Pin Watched Threads'], 'change', this.cb.resort); - $.on(inputs['Anchor Hidden Threads'], 'change', this.cb.resort); - watchSettings = function(e) { - if ((input = $.getOwn(inputs, e.target.name))) { - input.checked = e.target.checked; - return $.event('change', null, input); - } - }; - $.on(d, 'OpenSettings', function() { - return $.on($.id('fourchanx-settings'), 'change', watchSettings); - }); - sortEntry = UI.checkbox('Per-Board Sort Type', 'Per-board sort type', typeof Conf['Index Sort'] === 'object'); - sortEntry.title = 'Set the sorting order of each board independently.'; - $.on(sortEntry.firstChild, 'change', this.cb.perBoardSort); - entries.splice(3, 0, { - el: sortEntry - }); - Header.menu.addEntry({ - el: $.el('span', { - textContent: 'Index Navigation' - }), - order: 100, - subEntries: entries - }); - this.navLinks = $.el('div', { - className: 'navLinks json-index' - }); - $.extend(this.navLinks, {innerHTML: "Index Catalog Archive Bottom ×"}); - $('.cataloglink a', this.navLinks).href = CatalogLinks.catalog(); - if (!BoardConfig.isArchived(g.BOARD.ID)) { - $('.archlistlink', this.navLinks).hidden = true; - } - $.on($('#index-last-refresh a', this.navLinks), 'click', this.cb.refreshFront); - this.searchInput = $('#index-search', this.navLinks); - this.setupSearch(); - $.on(this.searchInput, 'input', this.onSearchInput); - $.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch); - this.hideLabel = $('#hidden-label', this.navLinks); - $.on($('#hidden-toggle a', this.navLinks), 'click', this.cb.toggleHiddenThreads); - this.selectRev = $('#index-rev', this.navLinks); - this.selectMode = $('#index-mode', this.navLinks); - this.selectSort = $('#index-sort', this.navLinks); - this.selectSize = $('#index-size', this.navLinks); - $.on(this.selectRev, 'change', this.cb.sort); - $.on(this.selectMode, 'change', this.cb.mode); - $.on(this.selectSort, 'change', this.cb.sort); - $.on(this.selectSize, 'change', $.cb.value); - $.on(this.selectSize, 'change', this.cb.size); - ref5 = [this.selectMode, this.selectSize]; - for (k = 0, len1 = ref5.length; k < len1; k++) { - select = ref5[k]; - select.value = Conf[select.name]; - } - this.selectRev.checked = /-rev$/.test(Index.currentSort); - this.selectSort.value = Index.currentSort.replace(/-rev$/, ''); - this.lastLongOptions = $('#lastlong-options', this.navLinks); - this.lastLongInputs = $$('input', this.lastLongOptions); - this.lastLongThresholds = [0, 0]; - this.lastLongOptions.hidden = this.selectSort.value !== 'lastlong'; - ref6 = this.lastLongInputs; - for (i = l = 0, len2 = ref6.length; l < len2; i = ++l) { - input = ref6[i]; - $.on(input, 'change', this.cb.lastLongThresholds); - tRaw = Conf["Last Long Reply Thresholds " + i]; - input.value = this.lastLongThresholds[i] = typeof tRaw === 'object' ? (ref7 = tRaw[g.BOARD.ID]) != null ? ref7 : 100 : tRaw; - } - this.root = $.el('div', { - className: 'board json-index' - }); - $.on(this.root, 'click', this.cb.hoverToggle); - this.cb.size(); - this.cb.hover(); - this.pagelist = $.el('div', { - className: 'pagelist json-index' - }); - $.extend(this.pagelist, {innerHTML: "
"}); - $('.cataloglink a', this.pagelist).href = CatalogLinks.catalog(); - $.on(this.pagelist, 'click', this.cb.pageNav); - this.update(true); - $.onExists(doc, 'title + *', function() { - return d.title = d.title.replace(/\ -\ Page\ \d+/, ''); - }); - $.onExists(doc, '.board > .thread > .postContainer, .board + *', function() { - var board, el, len3, m, ref8, timeEl, topNavPos; - g.SITE.Build.hat = $('.board > .thread > img:first-child'); - if (g.SITE.Build.hat) { - g.BOARD.threads.forEach(function(thread) { - if (thread.nodes.root) { - return $.prepend(thread.nodes.root, g.SITE.Build.hat.cloneNode(false)); - } - }); - $.addClass(doc, 'hats-enabled'); - $.addStyle(".catalog-thread::after {background-image: url(" + g.SITE.Build.hat.src + ");}"); - } - board = $('.board'); - $.replace(board, Index.root); - if (Index.loaded) { - $.event('PostsInserted', null, Index.root); - } - try { - d.implementation.createDocument(null, null, null).appendChild(board); - } catch (error) {} - ref8 = $$('.navLinks'); - for (m = 0, len3 = ref8.length; m < len3; m++) { - el = ref8[m]; - $.rm(el); - } - $.rm($.id('ctrl-top')); - topNavPos = $.id('delform').previousElementSibling; - $.before(topNavPos, $.el('hr')); - $.before(topNavPos, Index.navLinks); - timeEl = $('#index-last-refresh time', Index.navLinks); - if (timeEl.dataset.utc) { - return RelativeDates.update(timeEl); - } - }); - return Main.ready(function() { - var pagelist; - if ((pagelist = $('.pagelist'))) { - $.replace(pagelist, Index.pagelist); - } - return $.rmClass(doc, 'index-loading'); - }); - }, - scroll: function() { - var pageNum, threadIDs; - if (Index.req || !Index.liveThreadData || Conf['Index Mode'] !== 'infinite' || (window.scrollY <= doc.scrollHeight - (300 + window.innerHeight))) { - return; - } - if (Index.pageNum == null) { - Index.pageNum = Index.currentPage; - } - pageNum = ++Index.pageNum; - if (pageNum > Index.pagesNum) { - return Index.endNotice(); - } - threadIDs = Index.threadsOnPage(pageNum); - return Index.buildStructure(threadIDs); - }, - endNotice: (function() { - var notify, reset; - notify = false; - reset = function() { - return notify = false; - }; - return function() { - if (notify) { - return; - } - notify = true; - new Notice('info', "Last page reached.", 2); - return setTimeout(reset, 3 * $.SECOND); - }; - })(), - menu: { - init: function() { - if (!(g.VIEW === 'index' && Conf['Menu'] && Conf['Thread Hiding Link'] && Index.enabledOn(g.BOARD))) { - return; - } - return Menu.menu.addEntry({ - el: $.el('a', { - href: 'javascript:;', - className: 'has-shortcut-text' - }, {innerHTML: "Shift+click"}), - order: 20, - open: function(arg) { - var thread; - thread = arg.thread; - if (Conf['Index Mode'] !== 'catalog') { - return false; - } - this.el.firstElementChild.textContent = thread.isHidden ? 'Unhide' : 'Hide'; - if (this.cb) { - $.off(this.el, 'click', this.cb); - } - this.cb = function() { - $.event('CloseMenu'); - return Index.toggleHide(thread); - }; - $.on(this.el, 'click', this.cb); - return true; - } - }); - } - }, - node: function() { - if (this.isReply || this.isClone || !(Index.threadPosition[this.ID] != null)) { - return; - } - return this.thread.setPage(Math.floor(Index.threadPosition[this.ID] / Index.threadsNumPerPage) + 1); - }, - catalogNode: function() { - return $.on(this.nodes.root, 'mousedown click', (function(_this) { - return function(e) { - if (!(e.button === 0 && e.shiftKey)) { - return; - } - if (e.type === 'click') { - Index.toggleHide(_this.thread); - } - return e.preventDefault(); - }; - })(this)); - }, - toggleHide: function(thread) { - if (Index.showHiddenThreads) { - ThreadHiding.show(thread); - if (!ThreadHiding.db.get({ - boardID: thread.board.ID, - threadID: thread.ID - })) { - return; - } - } else { - ThreadHiding.hide(thread); - } - return ThreadHiding.saveHiddenState(thread); - }, - cycleSortType: function() { - var i, k, len1, type, types; - types = slice.call(Index.selectSort.options).filter(function(option) { - return !option.disabled; - }); - for (i = k = 0, len1 = types.length; k < len1; i = ++k) { - type = types[i]; - if (type.selected) { - break; - } - } - types[(i + 1) % types.length].selected = true; - return $.event('change', null, Index.selectSort); - }, - cb: { - initFinished: function() { - Index.initFinishedFired = true; - return $.queueTask(function() { - return Index.cb.postsInserted(); - }); - }, - postsInserted: function() { - var n; - if (!Index.initFinishedFired) { - return; - } - n = 0; - g.posts.forEach(function(post) { - if (!post.isFetchedQuote && !post.indexRefreshSeen && doc.contains(post.nodes.root)) { - post.indexRefreshSeen = true; - return n++; - } - }); - if (n) { - return $.event('IndexRefresh'); - } - }, - toggleHiddenThreads: function() { - $('#hidden-toggle a', Index.navLinks).textContent = (Index.showHiddenThreads = !Index.showHiddenThreads) ? 'Hide' : 'Show'; - Index.sort(); - return Index.buildIndex(); - }, - mode: function() { - Index.pushState({ - mode: this.value - }); - return Index.pageLoad(false); - }, - sort: function() { - var value; - value = Index.selectRev.checked ? Index.selectSort.value + "-rev" : Index.selectSort.value; - Index.pushState({ - sort: value - }); - return Index.pageLoad(false); - }, - resort: function(e) { - var ref; - Index.changed.order = true; - if (!(e != null ? (ref = e.detail) != null ? ref.deferred : void 0 : void 0)) { - return Index.pageLoad(false); - } - }, - perBoardSort: function() { - var i, k; - Conf['Index Sort'] = this.checked ? $.dict() : ''; - Index.saveSort(); - for (i = k = 0; k < 2; i = ++k) { - Conf["Last Long Reply Thresholds " + i] = this.checked ? $.dict() : ''; - Index.saveLastLongThresholds(i); - } - }, - lastLongThresholds: function() { - var i, value; - i = slice.call(this.parentNode.children).indexOf(this); - value = +this.value; - if (!Number.isFinite(value)) { - this.value = Index.lastLongThresholds[i]; - return; - } - Index.lastLongThresholds[i] = value; - Index.saveLastLongThresholds(i); - Index.changed.order = true; - return Index.pageLoad(false); - }, - size: function(e) { - if (Conf['Index Mode'] !== 'catalog') { - $.rmClass(Index.root, 'catalog-small'); - $.rmClass(Index.root, 'catalog-large'); - } else if (Conf['Index Size'] === 'small') { - $.addClass(Index.root, 'catalog-small'); - $.rmClass(Index.root, 'catalog-large'); - } else { - $.addClass(Index.root, 'catalog-large'); - $.rmClass(Index.root, 'catalog-small'); - } - if (e) { - return Index.buildIndex(); - } - }, - replies: function() { - return Index.buildIndex(); - }, - hover: function() { - return doc.classList.toggle('catalog-hover-expand', Conf['Catalog Hover Expand']); - }, - hoverToggle: function(e) { - var input, thread; - if (Conf['Catalog Hover Toggle'] && $.hasClass(doc, 'catalog-mode') && !$.modifiedClick(e) && !$.x('ancestor-or-self::a', e.target)) { - input = Index.inputs['Catalog Hover Expand']; - input.checked = !input.checked; - $.event('change', null, input); - if ((thread = Get.threadFromNode(e.target))) { - Index.cb.catalogReplies.call(thread); - return Index.cb.hoverAdjust.call(thread.OP.nodes); - } - } - }, - popstate: function(e) { - var mode, nCommands, page, ref, searched, sort; - if (e != null ? e.state : void 0) { - ref = e.state, searched = ref.searched, mode = ref.mode, sort = ref.sort; - page = Index.getCurrentPage(); - Index.setState({ - search: searched, - mode: mode, - sort: sort, - page: page - }); - return Index.pageLoad(false); - } else { - nCommands = Index.processHash(); - if (Conf['Refreshed Navigation'] && nCommands) { - return Index.update(); - } else { - return Index.pageLoad(); - } - } - }, - pageNav: function(e) { - var a; - if ($.modifiedClick(e)) { - return; - } - switch (e.target.nodeName) { - case 'BUTTON': - e.target.blur(); - a = e.target.parentNode; - break; - case 'A': - a = e.target; - break; - default: - return; - } - if (a.textContent === 'Catalog') { - return; - } - e.preventDefault(); - return Index.userPageNav(+a.pathname.split(/\/+/)[2] || 1); - }, - refreshFront: function() { - Index.pushState({ - page: 1 - }); - return Index.update(); - }, - catalogReplies: function() { - if (Conf['Show Replies'] && $.hasClass(doc, 'catalog-hover-expand') && !this.catalogView.nodes.replies) { - return Index.buildCatalogReplies(this); - } - }, - hoverAdjust: function() { - var rect, style, x; - if (!$.hasClass(doc, 'catalog-hover-expand')) { - return; - } - rect = this.post.getBoundingClientRect(); - if ((x = $.minmax(0, -rect.left, doc.clientWidth - rect.right))) { - style = this.post.style; - style.left = x + "px"; - style.right = (-x) + "px"; - return $.one(this.root, 'mouseleave', function() { - return style.left = style.right = null; - }); - } - } - }, - scrollToIndex: function() { - return Header.scrollToIfNeeded((Index.navLinks.getBoundingClientRect().height ? Index.navLinks : Index.root)); - }, - getCurrentPage: function() { - return +window.location.pathname.split(/\/+/)[2] || 1; - }, - userPageNav: function(page) { - Index.pushState({ - page: page - }); - if (Conf['Refreshed Navigation']) { - return Index.update(); - } else { - return Index.pageLoad(); - } - }, - hashCommands: { - mode: { - 'paged': 'paged', - 'infinite-scrolling': 'infinite', - 'infinite': 'infinite', - 'all-threads': 'all pages', - 'all-pages': 'all pages', - 'catalog': 'catalog' - }, - sort: { - 'bump-order': 'bump', - 'last-reply': 'lastreply', - 'last-long-reply': 'lastlong', - 'creation-date': 'birth', - 'reply-count': 'replycount', - 'file-count': 'filecount', - 'posts-per-minute': 'activity' - } - }, - processHash: function() { - var command, commands, hash, k, leftover, len1, mode, ref, sort, state; - hash = ((ref = location.href.match(/#.*/)) != null ? ref[0] : void 0) || ''; - state = { - replace: true - }; - commands = hash.slice(1).split('/'); - leftover = []; - for (k = 0, len1 = commands.length; k < len1; k++) { - command = commands[k]; - if ((mode = $.getOwn(Index.hashCommands.mode, command))) { - state.mode = mode; - } else if (command === 'index') { - state.mode = Conf['Previous Index Mode']; - state.page = 1; - } else if ((sort = $.getOwn(Index.hashCommands.sort, command.replace(/-rev$/, '')))) { - state.sort = sort; - if (/-rev$/.test(command)) { - state.sort += '-rev'; - } - } else if (/^s=/.test(command)) { - state.search = decodeURIComponent(command.slice(2)).replace(/\+/g, ' ').trim(); - } else { - leftover.push(command); - } - } - hash = leftover.join('/'); - if (hash) { - state.hash = "#" + hash; - } - Index.pushState(state); - return commands.length - leftover.length; - }, - pushState: function(state) { - var hash, pageBeforeSearch, pathname, ref, replace, search; - search = state.search, hash = state.hash, replace = state.replace; - pageBeforeSearch = (ref = history.state) != null ? ref.oldpage : void 0; - if ((search != null) && search !== Index.search) { - state.page = search ? 1 : pageBeforeSearch || 1; - if (!search) { - pageBeforeSearch = void 0; - } else if (!Index.search) { - pageBeforeSearch = Index.currentPage; - } - } - Index.setState(state); - pathname = Index.currentPage === 1 ? "/" + g.BOARD + "/" : "/" + g.BOARD + "/" + Index.currentPage; - hash || (hash = ''); - return history[replace ? 'replaceState' : 'pushState']({ - mode: Conf['Index Mode'], - sort: Index.currentSort, - searched: Index.search, - oldpage: pageBeforeSearch - }, '', location.protocol + "//" + location.host + pathname + hash); - }, - setState: function(arg) { - var hash, mode, page, ref, search, sort; - search = arg.search, mode = arg.mode, sort = arg.sort, page = arg.page, hash = arg.hash; - if ((search != null) && search !== Index.search) { - Index.changed.search = true; - Index.search = search; - } - if ((mode != null) && mode !== Conf['Index Mode']) { - Index.changed.mode = true; - Conf['Index Mode'] = mode; - $.set('Index Mode', mode); - if (!(mode === 'catalog' || Conf['Previous Index Mode'] === mode)) { - Conf['Previous Index Mode'] = mode; - $.set('Previous Index Mode', mode); - } - } - if ((sort != null) && sort !== Index.currentSort) { - Index.changed.sort = true; - Index.currentSort = sort; - Index.saveSort(); - } - if ((ref = Conf['Index Mode']) === 'all pages' || ref === 'catalog') { - page = 1; - } - if ((page != null) && page !== Index.currentPage) { - Index.changed.page = true; - Index.currentPage = page; - } - if (hash != null) { - return Index.changed.hash = true; - } - }, - savePerBoard: function(key, value) { - if (typeof Conf[key] === 'object') { - Conf[key][g.BOARD.ID] = value; - } else { - Conf[key] = value; - } - return $.set(key, Conf[key]); - }, - saveSort: function() { - return Index.savePerBoard('Index Sort', Index.currentSort); - }, - saveLastLongThresholds: function(i) { - return Index.savePerBoard("Last Long Reply Thresholds " + i, Index.lastLongThresholds[i]); - }, - pageLoad: function(scroll) { - var hash, mode, order, page, ref, search, sort, threads; - if (scroll == null) { - scroll = true; - } - if (!Index.liveThreadData) { - return; - } - ref = Index.changed, threads = ref.threads, order = ref.order, search = ref.search, mode = ref.mode, sort = ref.sort, page = ref.page, hash = ref.hash; - threads || (threads = search); - order || (order = sort); - if (threads || order) { - Index.sort(); - } - if (threads) { - Index.buildPagelist(); - } - if (search) { - Index.setupSearch(); - } - if (mode) { - Index.setupMode(); - } - if (sort) { - Index.setupSort(); - } - if (threads || mode || page || order) { - Index.buildIndex(); - } - if (threads || page) { - Index.setPage(); - } - if (scroll && !hash) { - Index.scrollToIndex(); - } - if (hash) { - Header.hashScroll(); - } - return Index.changed = {}; - }, - setupMode: function() { - var k, len1, mode, ref; - ref = ['paged', 'infinite', 'all pages', 'catalog']; - for (k = 0, len1 = ref.length; k < len1; k++) { - mode = ref[k]; - $[mode === Conf['Index Mode'] ? 'addClass' : 'rmClass'](doc, (mode.replace(/\ /g, '-')) + "-mode"); - } - Index.selectMode.value = Conf['Index Mode']; - Index.cb.size(); - Index.showHiddenThreads = false; - return $('#hidden-toggle a', Index.navLinks).textContent = 'Show'; - }, - setupSort: function() { - Index.selectRev.checked = /-rev$/.test(Index.currentSort); - Index.selectSort.value = Index.currentSort.replace(/-rev$/, ''); - return Index.lastLongOptions.hidden = Index.selectSort.value !== 'lastlong'; - }, - getPagesNum: function() { - if (Index.search) { - return Math.ceil(Index.sortedThreadIDs.length / Index.threadsNumPerPage); - } else { - return Index.pagesNum; - } - }, - getMaxPageNum: function() { - return Math.max(1, Index.getPagesNum()); - }, - buildPagelist: function() { - var a, i, k, maxPageNum, nodes, pagesRoot, ref; - pagesRoot = $('.pages', Index.pagelist); - maxPageNum = Index.getMaxPageNum(); - if (pagesRoot.childElementCount !== maxPageNum) { - nodes = []; - for (i = k = 1, ref = maxPageNum; k <= ref; i = k += 1) { - a = $.el('a', { - textContent: i, - href: i === 1 ? './' : i - }); - nodes.push($.tn('['), a, $.tn('] ')); - } - $.rmAll(pagesRoot); - return $.add(pagesRoot, nodes); - } - }, - setPage: function() { - var a, href, maxPageNum, next, pageNum, pagesRoot, prev, strong; - pageNum = Index.currentPage; - maxPageNum = Index.getMaxPageNum(); - pagesRoot = $('.pages', Index.pagelist); - prev = pagesRoot.previousSibling.firstChild; - next = pagesRoot.nextSibling.firstChild; - href = Math.max(pageNum - 1, 1); - prev.href = href === 1 ? './' : href; - prev.firstChild.disabled = href === pageNum; - href = Math.min(pageNum + 1, maxPageNum); - next.href = href === 1 ? './' : href; - next.firstChild.disabled = href === pageNum; - if (strong = $('strong', pagesRoot)) { - if (+strong.textContent === pageNum) { - return; - } - $.replace(strong, strong.firstChild); - } else { - strong = $.el('strong'); - } - if ((a = pagesRoot.children[pageNum - 1])) { - $.before(a, strong); - return $.add(strong, a); - } - }, - updateHideLabel: function() { - var hiddenCount, k, len1, ref, threadID; - if (!Index.hideLabel) { - return; - } - hiddenCount = 0; - ref = Index.liveThreadIDs; - for (k = 0, len1 = ref.length; k < len1; k++) { - threadID = ref[k]; - if (Index.isHidden(threadID)) { - hiddenCount++; - } - } - if (!hiddenCount) { - Index.hideLabel.hidden = true; - if (Index.showHiddenThreads) { - Index.cb.toggleHiddenThreads(); - } - return; - } - Index.hideLabel.hidden = false; - return $('#hidden-count', Index.navLinks).textContent = hiddenCount === 1 ? '1 hidden thread' : hiddenCount + " hidden threads"; - }, - update: function(firstTime) { - var oldReq; - if ((oldReq = Index.req)) { - delete Index.req; - oldReq.abort(); - } - if (Conf['Index Refresh Notifications']) { - Index.notice || (Index.notice = new Notice('info', 'Refreshing index...')); - Index.nTimeout || (Index.nTimeout = setTimeout(function() { - var ref; - return (ref = Index.notice) != null ? ref.el.lastElementChild.textContent += ' (disable JSON Index if this takes too long)' : void 0; - }, 3 * $.SECOND)); - } else { - Index.nTimeout || (Index.nTimeout = setTimeout(function() { - return Index.notice || (Index.notice = new Notice('info', 'Refreshing index... (disable JSON Index if this takes too long)')); - }, 3 * $.SECOND)); - } - if (!firstTime && d.readyState !== 'loading' && !$('.board + *')) { - location.reload(); - return; - } - Index.req = $.whenModified(g.SITE.urls.catalogJSON({ - boardID: g.BOARD.ID - }), 'Index', Index.load); - return $.addClass(Index.button, 'fa-spin'); - }, - load: function() { - var err, nTimeout, notice, ref, timeEl; - if (this !== Index.req) { - return; - } - $.rmClass(Index.button, 'fa-spin'); - notice = Index.notice, nTimeout = Index.nTimeout; - if (nTimeout) { - clearTimeout(nTimeout); - } - delete Index.nTimeout; - delete Index.req; - delete Index.notice; - if ((ref = this.status) !== 200 && ref !== 304) { - err = "Index refresh failed. " + (this.status ? "Error " + this.statusText + " (" + this.status + ")" : 'Connection Error'); - if (notice) { - notice.setType('warning'); - notice.el.lastElementChild.textContent = err; - setTimeout(notice.close, $.SECOND); - } else { - new Notice('warning', err, 1); - } - return; - } - try { - if (this.status === 200) { - Index.parse(this.response); - } else if (this.status === 304) { - Index.pageLoad(); - } - } catch (error) { - err = error; - c.error("Index failure: " + err.message, err.stack); - if (notice) { - notice.setType('error'); - notice.el.lastElementChild.textContent = 'Index refresh failed.'; - setTimeout(notice.close, $.SECOND); - } else { - new Notice('error', 'Index refresh failed.', 1); - } - return; - } - if (notice) { - if (Conf['Index Refresh Notifications']) { - notice.setType('success'); - notice.el.lastElementChild.textContent = 'Index refreshed!'; - setTimeout(notice.close, $.SECOND); - } else { - notice.close(); - } - } - timeEl = $('#index-last-refresh time', Index.navLinks); - timeEl.dataset.utc = Date.parse(this.getResponseHeader('Last-Modified')); - return RelativeDates.update(timeEl); - }, - parse: function(pages) { - $.cleanCache(function(url) { - return /^https?:\/\/a\.4cdn\.org\//.test(url); - }); - Index.parseThreadList(pages); - Index.changed.threads = true; - return Index.pageLoad(); - }, - parseThreadList: function(pages) { - var ID, data, i, k, l, len1, len2, obj, ref, ref1, ref2, reply, results; - Index.pagesNum = pages.length; - Index.threadsNumPerPage = ((ref = pages[0]) != null ? ref.threads.length : void 0) || 1; - Index.liveThreadData = pages.reduce((function(arr, next) { - return arr.concat(next.threads); - }), []); - Index.liveThreadIDs = Index.liveThreadData.map(function(data) { - return data.no; - }); - Index.liveThreadDict = $.dict(); - Index.threadPosition = $.dict(); - Index.parsedThreads = $.dict(); - Index.replyData = $.dict(); - ref1 = Index.liveThreadData; - for (i = k = 0, len1 = ref1.length; k < len1; i = ++k) { - data = ref1[i]; - Index.liveThreadDict[data.no] = data; - Index.threadPosition[data.no] = i; - Index.parsedThreads[data.no] = obj = g.SITE.Build.parseJSON(data, g.BOARD); - obj.filterResults = results = Filter.test(obj); - obj.isOnTop = results.top; - obj.isHidden = results.hide || ThreadHiding.isHidden(obj.boardID, obj.threadID); - if (data.last_replies) { - ref2 = data.last_replies; - for (l = 0, len2 = ref2.length; l < len2; l++) { - reply = ref2[l]; - Index.replyData[g.BOARD + "." + reply.no] = reply; - } - } - } - if (Index.liveThreadData[0]) { - g.SITE.Build.spoilerRange[g.BOARD.ID] = Index.liveThreadData[0].custom_spoiler; - } - g.BOARD.threads.forEach(function(thread) { - var ref3; - if (ref3 = thread.ID, indexOf.call(Index.liveThreadIDs, ref3) < 0) { - return thread.collect(); - } - }); - $.event('IndexUpdate', { - threads: (function() { - var len3, m, ref3, results1; - ref3 = Index.liveThreadIDs; - results1 = []; - for (m = 0, len3 = ref3.length; m < len3; m++) { - ID = ref3[m]; - results1.push(g.BOARD + "." + ID); - } - return results1; - })() - }); - }, - isHidden: function(threadID) { - var thread; - if ((thread = g.BOARD.threads.get(threadID)) && thread.OP && !thread.OP.isFetchedQuote) { - return thread.isHidden; - } else { - return Index.parsedThreads[threadID].isHidden; - } - }, - isHiddenReply: function(threadID, replyData) { - return PostHiding.isHidden(g.BOARD.ID, threadID, replyData.no) || Filter.isHidden(g.SITE.Build.parseJSON(replyData, g.BOARD)); - }, - buildThreads: function(threadIDs, isCatalog, withReplies) { - var ID, OP, err, errors, isStale, k, lastPost, len1, newPosts, newThreads, obj, opRoot, t, thread, threadData, threads; - threads = []; - newThreads = []; - newPosts = []; - for (k = 0, len1 = threadIDs.length; k < len1; k++) { - ID = threadIDs[k]; - try { - threadData = Index.liveThreadDict[ID]; - if ((thread = g.BOARD.threads.get(ID))) { - isStale = (thread.json !== threadData) && (JSON.stringify(thread.json) !== JSON.stringify(threadData)); - if (isStale) { - thread.setCount('post', threadData.replies + 1, threadData.bumplimit); - thread.setCount('file', threadData.images + !!threadData.ext, threadData.imagelimit); - thread.setStatus('Sticky', !!threadData.sticky); - thread.setStatus('Closed', !!threadData.closed); - } - if (thread.catalogView) { - $.rm(thread.catalogView.nodes.replies); - thread.catalogView.nodes.replies = null; - } - } else { - thread = new Thread(ID, g.BOARD); - newThreads.push(thread); - } - lastPost = threadData.last_replies && threadData.last_replies.length ? threadData.last_replies[threadData.last_replies.length - 1].no : ID; - if (lastPost > thread.lastPost) { - thread.lastPost = lastPost; - } - thread.json = threadData; - threads.push(thread); - if ((OP = thread.OP) && !OP.isFetchedQuote) { - OP.setCatalogOP(isCatalog); - thread.setPage(Math.floor(Index.threadPosition[ID] / Index.threadsNumPerPage) + 1); - } else { - obj = Index.parsedThreads[ID]; - opRoot = g.SITE.Build.post(obj); - OP = new Post(opRoot, thread, g.BOARD); - OP.filterResults = obj.filterResults; - newPosts.push(OP); - } - if (!(isCatalog && thread.nodes.root)) { - g.SITE.Build.thread(thread, threadData, withReplies); - } - } catch (error) { - err = error; - if (!errors) { - errors = []; - } - errors.push({ - message: "Parsing of Thread No." + thread + " failed. Thread will be skipped.", - error: err, - html: opRoot != null ? opRoot.outerHTML : void 0 - }); - } - } - if (errors) { - Main.handleErrors(errors); - } - if (withReplies) { - newPosts = newPosts.concat(Index.buildReplies(threads)); - } - Main.callbackNodes('Thread', newThreads); - Main.callbackNodes('Post', newPosts); - Index.updateHideLabel(); - $.event('IndexRefreshInternal', { - threadIDs: (function() { - var l, len2, results1; - results1 = []; - for (l = 0, len2 = threads.length; l < len2; l++) { - t = threads[l]; - results1.push(t.fullID); - } - return results1; - })(), - isCatalog: isCatalog - }); - return threads; - }, - buildReplies: function(threads) { - var data, err, errors, k, l, lastReplies, len1, len2, node, nodes, post, posts, thread; - posts = []; - for (k = 0, len1 = threads.length; k < len1; k++) { - thread = threads[k]; - if (!(lastReplies = Index.liveThreadDict[thread.ID].last_replies)) { - continue; - } - nodes = []; - for (l = 0, len2 = lastReplies.length; l < len2; l++) { - data = lastReplies[l]; - if ((post = thread.posts.get(data.no)) && !post.isFetchedQuote) { - nodes.push(post.nodes.root); - continue; - } - nodes.push(node = g.SITE.Build.postFromObject(data, thread.board.ID)); - try { - posts.push(new Post(node, thread, thread.board)); - } catch (error) { - err = error; - if (!errors) { - errors = []; - } - errors.push({ - message: "Parsing of Post No." + data.no + " failed. Post will be skipped.", - error: err, - html: node != null ? node.outerHTML : void 0 - }); - } - } - $.add(thread.nodes.root, nodes); - } - if (errors) { - Main.handleErrors(errors); - } - return posts; - }, - buildCatalogViews: function(threads) { - var ID, catalogThreads, k, len1, page, root, thread; - catalogThreads = []; - for (k = 0, len1 = threads.length; k < len1; k++) { - thread = threads[k]; - if (!(!thread.catalogView)) { - continue; - } - ID = thread.ID; - page = Math.floor(Index.threadPosition[ID] / Index.threadsNumPerPage) + 1; - root = g.SITE.Build.catalogThread(thread, Index.liveThreadDict[ID], page); - catalogThreads.push(new CatalogThread(root, thread)); - } - Main.callbackNodes('CatalogThread', catalogThreads); - }, - sizeCatalogViews: function(threads) { - var height, k, len1, ratio, ref, size, thread, thumb, width; - size = Conf['Index Size'] === 'small' ? 150 : 250; - for (k = 0, len1 = threads.length; k < len1; k++) { - thread = threads[k]; - thumb = thread.catalogView.nodes.thumb; - ref = thumb.dataset, width = ref.width, height = ref.height; - if (!width) { - continue; - } - ratio = size / Math.max(width, height); - thumb.style.width = width * ratio + 'px'; - thumb.style.height = height * ratio + 'px'; - } - }, - buildCatalogReplies: function(thread) { - var data, k, lastReplies, len1, nodes, replies, reply; - nodes = thread.catalogView.nodes; - if (!(lastReplies = Index.liveThreadDict[thread.ID].last_replies)) { - return; - } - replies = []; - for (k = 0, len1 = lastReplies.length; k < len1; k++) { - data = lastReplies[k]; - if (Index.isHiddenReply(thread.ID, data)) { - continue; - } - reply = g.SITE.Build.catalogReply(thread, data); - RelativeDates.update($('time', reply)); - $.on($('.catalog-reply-preview', reply), 'mouseover', QuotePreview.mouseover); - replies.push(reply); - } - nodes.replies = $.el('div', { - className: 'catalog-replies' - }); - $.add(nodes.replies, replies); - $.add(thread.OP.nodes.post, nodes.replies); - }, - sort: function() { - var lastlong, lastlongD, liveThreadData, liveThreadIDs, repliesAvailable, sortType, thread, threadIDs, tmp_time; - liveThreadIDs = Index.liveThreadIDs, liveThreadData = Index.liveThreadData; - if (!liveThreadData) { - return; - } - tmp_time = new Date().getTime() / 1000; - sortType = Index.currentSort.replace(/-rev$/, ''); - Index.sortedThreadIDs = (function() { - var k, len1; - switch (sortType) { - case 'lastreply': - case 'lastlong': - repliesAvailable = liveThreadData.some(function(thread) { - var ref; - return (ref = thread.last_replies) != null ? ref.length : void 0; - }); - lastlong = function(thread) { - var i, k, len, r, ref, ref1; - if (!repliesAvailable) { - return thread.last_modified; - } - ref = thread.last_replies || []; - for (i = k = ref.length - 1; k >= 0; i = k += -1) { - r = ref[i]; - if (Index.isHiddenReply(thread.no, r)) { - continue; - } - if (sortType === 'lastreply') { - return r; - } - len = r.com ? g.SITE.Build.parseComment(r.com).replace(/[^a-z]/ig, '').length : 0; - if (len >= Index.lastLongThresholds[+(!!r.ext)]) { - return r; - } - } - if (thread.omitted_posts && ((ref1 = thread.last_replies) != null ? ref1.length : void 0)) { - return thread.last_replies[0]; - } else { - return thread; - } - }; - lastlongD = $.dict(); - for (k = 0, len1 = liveThreadData.length; k < len1; k++) { - thread = liveThreadData[k]; - lastlongD[thread.no] = lastlong(thread).no; - } - return slice.call(liveThreadData).sort(function(a, b) { - return lastlongD[b.no] - lastlongD[a.no]; - }).map(function(post) { - return post.no; - }); - case 'bump': - return liveThreadIDs; - case 'birth': - return slice.call(liveThreadIDs).sort(function(a, b) { - return b - a; - }); - case 'replycount': - return slice.call(liveThreadData).sort(function(a, b) { - return b.replies - a.replies; - }).map(function(post) { - return post.no; - }); - case 'filecount': - return slice.call(liveThreadData).sort(function(a, b) { - return b.images - a.images; - }).map(function(post) { - return post.no; - }); - case 'activity': - return slice.call(liveThreadData).sort(function(a, b) { - return (tmp_time - a.time) / (a.replies + 1) - (tmp_time - b.time) / (b.replies + 1); - }).map(function(post) { - return post.no; - }); - default: - return liveThreadIDs; - } - })(); - if (/-rev$/.test(Index.currentSort)) { - Index.sortedThreadIDs = slice.call(Index.sortedThreadIDs).reverse(); - } - if (Index.search && (threadIDs = Index.querySearch(Index.search))) { - Index.sortedThreadIDs = threadIDs; - } - Index.sortOnTop(function(obj) { - return obj.isSticky; - }); - Index.sortOnTop(function(obj) { - return obj.isOnTop || Conf['Pin Watched Threads'] && ThreadWatcher.isWatchedRaw(obj.boardID, obj.threadID); - }); - if (Conf['Anchor Hidden Threads']) { - return Index.sortOnTop(function(obj) { - return !Index.isHidden(obj.threadID); - }); - } - }, - sortOnTop: function(match) { - var ID, bottomThreads, k, len1, ref, topThreads; - topThreads = []; - bottomThreads = []; - ref = Index.sortedThreadIDs; - for (k = 0, len1 = ref.length; k < len1; k++) { - ID = ref[k]; - (match(Index.parsedThreads[ID]) ? topThreads : bottomThreads).push(ID); - } - return Index.sortedThreadIDs = topThreads.concat(bottomThreads); - }, - buildIndex: function() { - var threadIDs; - if (!Index.liveThreadData) { - return; - } - switch (Conf['Index Mode']) { - case 'all pages': - threadIDs = Index.sortedThreadIDs; - break; - case 'catalog': - threadIDs = Index.sortedThreadIDs.filter(function(ID) { - return !Index.isHidden(ID) !== Index.showHiddenThreads; - }); - break; - default: - threadIDs = Index.threadsOnPage(Index.currentPage); - } - delete Index.pageNum; - $.rmAll(Index.root); - $.rmAll(Header.hover); - if (Index.loaded && Index.root.parentNode) { - $.event('PostsRemoved', null, Index.root); - } - if (Conf['Index Mode'] === 'catalog') { - Index.buildCatalog(threadIDs); - } else { - Index.buildStructure(threadIDs); - } - }, - threadsOnPage: function(pageNum) { - var nodesPerPage, offset; - nodesPerPage = Index.threadsNumPerPage; - offset = nodesPerPage * (pageNum - 1); - return Index.sortedThreadIDs.slice(offset, offset + nodesPerPage); - }, - buildStructure: function(threadIDs) { - var k, len1, nodes, thread, threads; - threads = Index.buildThreads(threadIDs, false, Conf['Show Replies']); - nodes = []; - for (k = 0, len1 = threads.length; k < len1; k++) { - thread = threads[k]; - nodes.push(thread.nodes.root, $.el('hr')); - } - $.add(Index.root, nodes); - if (Index.root.parentNode) { - $.event('PostsInserted', null, Index.root); - } - Index.loaded = true; - }, - buildCatalog: function(threadIDs) { - var fn, i, n, node0; - i = 0; - n = threadIDs.length; - node0 = null; - fn = function() { - var j; - if (node0 && !node0.parentNode) { - return; - } - j = i > 0 && Index.root.parentNode ? n : i + 30; - node0 = Index.buildCatalogPart(threadIDs.slice(i, j))[0]; - i = j; - if (i < n) { - return $.queueTask(fn); - } else { - if (Index.root.parentNode) { - $.event('PostsInserted', null, Index.root); - } - return Index.loaded = true; - } - }; - fn(); - }, - buildCatalogPart: function(threadIDs) { - var k, len1, nodes, thread, threads; - threads = Index.buildThreads(threadIDs, true); - Index.buildCatalogViews(threads); - Index.sizeCatalogViews(threads); - nodes = []; - for (k = 0, len1 = threads.length; k < len1; k++) { - thread = threads[k]; - thread.OP.setCatalogOP(true); - $.add(thread.catalogView.nodes.root, thread.OP.nodes.root); - nodes.push(thread.catalogView.nodes.root); - $.on(thread.catalogView.nodes.root, 'mouseenter', Index.cb.catalogReplies.bind(thread)); - $.on(thread.OP.nodes.root, 'mouseenter', Index.cb.hoverAdjust.bind(thread.OP.nodes)); - } - $.add(Index.root, nodes); - return nodes; - }, - clearSearch: function() { - Index.searchInput.value = ''; - Index.onSearchInput(); - return Index.searchInput.focus(); - }, - setupSearch: function() { - Index.searchInput.value = Index.search; - if (Index.search) { - return Index.searchInput.dataset.searching = 1; - } else { - return Index.searchInput.removeAttribute('data-searching'); - } - }, - onSearchInput: function() { - var search; - search = Index.searchInput.value.trim(); - if (search === Index.search) { - return; - } - Index.pushState({ - search: search, - replace: !!search === !!Index.search - }); - return Index.pageLoad(false); - }, - querySearch: function(query) { - var keywords, match, regexp; - if ((match = query.match(/^([\w+]+):\/(.*)\/(\w*)$/))) { - try { - regexp = RegExp(match[2], match[3]); - } catch (error) { - return []; - } - return Index.sortedThreadIDs.filter(function(ID) { - return regexp.test(Filter.values(match[1], Index.parsedThreads[ID]).join('\n')); - }); - } - if (!(keywords = query.toLowerCase().match(/\S+/g))) { - return; - } - return Index.sortedThreadIDs.filter(function(ID) { - return Index.searchMatch(Index.parsedThreads[ID], keywords); - }); - }, - searchMatch: function(obj, keywords) { - var file, info, k, key, keyword, l, len1, len2, ref, text; - info = obj.info, file = obj.file; - if (info.comment == null) { - info.comment = g.SITE.Build.parseComment(info.commentHTML.innerHTML); - } - text = []; - ref = ['comment', 'subject', 'name', 'tripcode']; - for (k = 0, len1 = ref.length; k < len1; k++) { - key = ref[k]; - if (key in info) { - text.push(info[key]); - } - } - if (file) { - text.push(file.name); - } - text = text.join(' ').toLowerCase(); - for (l = 0, len2 = keywords.length; l < len2; l++) { - keyword = keywords[l]; - if (-1 === text.indexOf(keyword)) { - return false; - } - } - return true; - } - }; - - return Index; - -}).call(this); - -Polyfill = (function() { - var Polyfill; - - Polyfill = { - init: function() { - var base; - this.toBlob(); - $.global(this.toBlob); - (base = Element.prototype).matches || (base.matches = Element.prototype.mozMatchesSelector || Element.prototype.webkitMatchesSelector); - }, - toBlob: function() { - if (HTMLCanvasElement.prototype.toBlob) { - return; - } - HTMLCanvasElement.prototype.toBlob = function(cb, type, encoderOptions) { - var data, i, j, l, ref, ui8a, url; - url = this.toDataURL(type, encoderOptions); - data = atob(url.slice(url.indexOf(',') + 1)); - l = data.length; - ui8a = new Uint8Array(l); - for (i = j = 0, ref = l; j < ref; i = j += 1) { - ui8a[i] = data.charCodeAt(i); - } - return cb(new Blob([ui8a], { - type: type || 'image/png' - })); - }; - } - }; - - return Polyfill; - -}).call(this); - -Settings = (function() { - var Settings, - slice = [].slice, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Settings = { - init: function() { - var add, link; - link = $.el('a', { - className: 'settings-link fa fa-wrench', - textContent: 'Settings', - title: '4chan X Settings', - href: 'javascript:;' - }); - $.on(link, 'click', Settings.open); - Header.addShortcut('settings', link, 820); - add = this.addSection; - add('Main', this.main); - add('Filter', this.filter); - add('Sauce', this.sauce); - add('Advanced', this.advanced); - add('Keybinds', this.keybinds); - $.on(d, 'AddSettingsSection', Settings.addSection); - $.on(d, 'OpenSettings', function(e) { - return Settings.open(e.detail); - }); - if (g.SITE.software === 'yotsuba' && Conf['Disable Native Extension']) { - if ($.hasStorage) { - return $.global(function() { - var settings; - try { - settings = JSON.parse(localStorage.getItem('4chan-settings')) || {}; - if (settings.disableAll) { - return; - } - settings.disableAll = true; - return localStorage.setItem('4chan-settings', JSON.stringify(settings)); - } catch (error) { - return Object.defineProperty(window, 'Config', { - value: { - disableAll: true - } - }); - } - }); - } else { - return $.global(function() { - return Object.defineProperty(window, 'Config', { - value: { - disableAll: true - } - }); - }); - } - } - }, - open: function(openSection) { - var dialog, j, len, link, links, ref, section, sectionToOpen; - if (Settings.dialog) { - return; - } - $.event('CloseMenu'); - Settings.dialog = dialog = $.el('div', { - id: 'overlay' - }, {innerHTML: ""}); - $.on($('.export', dialog), 'click', Settings["export"]); - $.on($('.import', dialog), 'click', Settings["import"]); - $.on($('.reset', dialog), 'click', Settings.reset); - $.on($('input', dialog), 'change', Settings.onImport); - links = []; - ref = Settings.sections; - for (j = 0, len = ref.length; j < len; j++) { - section = ref[j]; - link = $.el('a', { - className: "tab-" + section.hyphenatedTitle, - textContent: section.title, - href: 'javascript:;' - }); - $.on(link, 'click', Settings.openSection.bind(section)); - links.push(link, $.tn(' | ')); - if (section.title === openSection) { - sectionToOpen = link; - } - } - links.pop(); - $.add($('.sections-list', dialog), links); - if (openSection !== 'none') { - (sectionToOpen ? sectionToOpen : links[0]).click(); - } - $.on($('.close', dialog), 'click', Settings.close); - $.on(window, 'beforeunload', Settings.close); - $.on(dialog, 'click', Settings.close); - $.on(dialog.firstElementChild, 'click', function(e) { - return e.stopPropagation(); - }); - $.add(d.body, dialog); - return $.event('OpenSettings', null, dialog); - }, - close: function() { - var ref; - if (!Settings.dialog) { - return; - } - if ((ref = d.activeElement) != null) { - ref.blur(); - } - $.rm(Settings.dialog); - return delete Settings.dialog; - }, - sections: [], - addSection: function(title, open) { - var hyphenatedTitle, ref; - if (typeof title !== 'string') { - ref = title.detail, title = ref.title, open = ref.open; - } - hyphenatedTitle = title.toLowerCase().replace(/\s+/g, '-'); - return Settings.sections.push({ - title: title, - hyphenatedTitle: hyphenatedTitle, - open: open - }); - }, - openSection: function() { - var section, selected; - if (selected = $('.tab-selected', Settings.dialog)) { - $.rmClass(selected, 'tab-selected'); - } - $.addClass($(".tab-" + this.hyphenatedTitle, Settings.dialog), 'tab-selected'); - section = $('section', Settings.dialog); - $.rmAll(section); - section.className = "section-" + this.hyphenatedTitle; - this.open(section, g); - section.scrollTop = 0; - return $.event('OpenSettings', null, section); - }, - warnings: { - localStorage: function(cb) { - var why; - if ($.cantSync) { - why = $.cantSet ? 'save your settings' : 'synchronize settings between tabs'; - return cb($.el('li', { - textContent: "4chan X needs local storage to " + why + ".\nEnable it on boards." + (location.hostname.split('.')[1]) + ".org in your browser's privacy settings (may be listed as part of \"local data\" or \"cookies\")." - })); - } - }, - ads: function(cb) { - return $.onExists(doc, '.adg-rects > .desktop', function(ad) { - return $.onExists(ad, 'iframe', function() { - var url; - url = Redirect.to('thread', { - boardID: 'qa', - threadID: 362590 - }); - return cb($.el('li', {innerHTML: "To protect yourself from malicious ads, you should block ads on 4chan."})); - }); - }); - } - }, - main: function(section) { - var addCheckboxes, addWarning, button, div, fs, inputs, items, key, keyFS, obj, ref, ref1, warning, warnings; - warnings = $.el('fieldset', { - hidden: true - }, {innerHTML: "Warnings
    "}); - addWarning = function(item) { - $.add($('ul', warnings), item); - return warnings.hidden = false; - }; - ref = Settings.warnings; - for (key in ref) { - warning = ref[key]; - warning(addWarning); - } - $.add(section, warnings); - items = $.dict(); - inputs = $.dict(); - addCheckboxes = function(root, obj) { - var arr, container, containers, description, div, input, level, results; - containers = [root]; - results = []; - for (key in obj) { - arr = obj[key]; - if (!(arr instanceof Array)) { - continue; - } - description = arr[1]; - div = $.el('div', {innerHTML: ": " + E(description) + ""}); - div.dataset.name = key; - input = $('input', div); - $.on(input, 'change', $.cb.checked); - $.on(input, 'change', function() { - return this.parentNode.parentNode.dataset.checked = this.checked; - }); - items[key] = Conf[key]; - inputs[key] = input; - level = arr[2] || 0; - if (containers.length <= level) { - container = $.el('div', { - className: 'suboption-list' - }); - $.add(containers[containers.length - 1].lastElementChild, container); - containers[level] = container; - } else if (containers.length > level + 1) { - containers.splice(level + 1, containers.length - (level + 1)); - } - results.push($.add(containers[level], div)); - } - return results; - }; - ref1 = Config.main; - for (keyFS in ref1) { - obj = ref1[keyFS]; - fs = $.el('fieldset', {innerHTML: "" + E(keyFS) + ""}); - addCheckboxes(fs, obj); - if (keyFS === 'Posting and Captchas') { - $.add(fs, $.el('p', {innerHTML: "For more info on captcha options and issues, see the captcha FAQ."})); - } - $.add(section, fs); - } - addCheckboxes($('div[data-name="JSON Index"] > .suboption-list', section), Config.Index); - if ($.engine !== 'gecko') { - $('div[data-name="Remember QR Size"]', section).hidden = true; - } - if ($.perProtocolSettings || location.protocol !== 'https:') { - $('div[data-name="Redirect to HTTPS"]', section).hidden = true; - } - if ($.platform !== 'crx') { - $('div[data-name="Work around CORB Bug"]', section).hidden = true; - } - $.get(items, function(items) { - var val; - for (key in items) { - val = items[key]; - inputs[key].checked = val; - inputs[key].parentNode.parentNode.dataset.checked = val; - } - }); - div = $.el('div', {innerHTML: ": Clear manually-hidden threads and posts on all boards. Reload the page to apply."}); - button = $('button', div); - $.get({ - hiddenThreads: $.dict(), - hiddenPosts: $.dict() - }, function(arg) { - var ID, board, hiddenNum, hiddenPosts, hiddenThreads, ref2, ref3, ref4, ref5, site, thread; - hiddenThreads = arg.hiddenThreads, hiddenPosts = arg.hiddenPosts; - hiddenNum = 0; - for (ID in hiddenThreads) { - site = hiddenThreads[ID]; - if (ID !== 'boards') { - ref2 = site.boards; - for (ID in ref2) { - board = ref2[ID]; - hiddenNum += Object.keys(board).length; - } - } - } - ref3 = hiddenThreads.boards; - for (ID in ref3) { - board = ref3[ID]; - hiddenNum += Object.keys(board).length; - } - for (ID in hiddenPosts) { - site = hiddenPosts[ID]; - if (ID !== 'boards') { - ref4 = site.boards; - for (ID in ref4) { - board = ref4[ID]; - for (ID in board) { - thread = board[ID]; - hiddenNum += Object.keys(thread).length; - } - } - } - } - ref5 = hiddenPosts.boards; - for (ID in ref5) { - board = ref5[ID]; - for (ID in board) { - thread = board[ID]; - hiddenNum += Object.keys(thread).length; - } - } - return button.textContent = "Hidden: " + hiddenNum; - }); - $.on(button, 'click', function() { - this.textContent = 'Hidden: 0'; - return $.get('hiddenThreads', $.dict(), function(arg) { - var boardID, hiddenThreads, ref2; - hiddenThreads = arg.hiddenThreads; - if ($.hasStorage && g.SITE.software === 'yotsuba') { - for (boardID in (ref2 = hiddenThreads['4chan.org']) != null ? ref2.boards : void 0) { - localStorage.removeItem("4chan-hide-t-" + boardID); - } - for (boardID in hiddenThreads.boards) { - localStorage.removeItem("4chan-hide-t-" + boardID); - } - } - return $["delete"](['hiddenThreads', 'hiddenPosts']); - }); - }); - return $.after($('input[name="Stubs"]', section).parentNode.parentNode, div); - }, - "export": function() { - var Conf2; - Conf2 = $.dict(); - $.extend(Conf2, Conf); - return $.get(Conf2, function(Conf2) { - delete Conf2['boardConfig']; - return Settings.downloadExport({ - version: g.VERSION, - date: Date.now(), - Conf: Conf2 - }); - }); - }, - downloadExport: function(data) { - var a, blob, p, url; - blob = new Blob([JSON.stringify(data, null, 2)], { - type: 'application/json' - }); - url = URL.createObjectURL(blob); - a = $.el('a', { - download: "4chan X v" + g.VERSION + "-" + data.date + ".json", - href: url - }); - p = $('.imp-exp-result', Settings.dialog); - $.rmAll(p); - $.add(p, a); - return a.click(); - }, - "import": function() { - return $('input[type=file]', this.parentNode).click(); - }, - onImport: function() { - var file, output, reader; - if (!(file = this.files[0])) { - return; - } - this.value = null; - output = $('.imp-exp-result'); - if (!confirm('Your current settings will be entirely overwritten, are you sure?')) { - output.textContent = 'Import aborted.'; - return; - } - reader = new FileReader(); - reader.onload = function(e) { - var err; - try { - return Settings.loadSettings($.dict.json(e.target.result), function(err) { - if (err) { - return output.textContent = 'Import failed due to an error.'; - } else if (confirm('Import successful. Reload now?')) { - return window.location.reload(); - } - }); - } catch (error) { - err = error; - output.textContent = 'Import failed due to an error.'; - return c.error(err.stack); - } - }; - return reader.readAsText(file); - }, - convertFrom: { - loadletter: function(data) { - var base, boardID, convertSettings, key, ref, ref1, threadData, threadID, threads, val; - convertSettings = function(data, map) { - var newKey, prevKey; - for (prevKey in map) { - newKey = map[prevKey]; - if (newKey) { - data.Conf[newKey] = data.Conf[prevKey]; - } - delete data.Conf[prevKey]; - } - return data; - }; - data = convertSettings(data, { - 'Disable 4chan\'s extension': 'Disable Native Extension', - 'Comment Auto-Expansion': '', - 'Remove Slug': '', - 'Always HTTPS': 'Redirect to HTTPS', - 'Check for Updates': '', - 'Recursive Filtering': 'Recursive Hiding', - 'Reply Hiding': 'Reply Hiding Buttons', - 'Thread Hiding': 'Thread Hiding Buttons', - 'Show Stubs': 'Stubs', - 'Image Auto-Gif': 'Replace GIF', - 'Expand All WebM': 'Expand videos', - 'Reveal Spoilers': 'Reveal Spoiler Thumbnails', - 'Expand From Current': 'Expand from here', - 'Current Page': 'Page Count in Stats', - 'Current Page Position': '', - 'Alternative captcha': 'Use Recaptcha v1', - 'Alt index captcha': 'Use Recaptcha v1 on Index', - 'Auto Submit': 'Post on Captcha Completion', - 'Open Reply in New Tab': 'Open Post in New Tab', - 'Remember QR size': 'Remember QR Size', - 'Remember Subject': '', - 'Quote Inline': 'Quote Inlining', - 'Quote Preview': 'Quote Previewing', - 'Indicate OP quote': 'Mark OP Quotes', - 'Indicate You quote': 'Mark Quotes of You', - 'Indicate Cross-thread Quotes': 'Mark Cross-thread Quotes', - 'uniqueid': 'uniqueID', - 'mod': 'capcode', - 'email': '', - 'country': 'flag', - 'md5': 'MD5', - 'openEmptyQR': 'Open empty QR', - 'openQR': 'Open QR', - 'openOptions': 'Open settings', - 'close': 'Close', - 'spoiler': 'Spoiler tags', - 'sageru': 'Toggle sage', - 'code': 'Code tags', - 'sjis': 'SJIS tags', - 'submit': 'Submit QR', - 'watch': 'Watch', - 'update': 'Update', - 'unreadCountTo0': '', - 'expandAllImages': 'Expand images', - 'expandImage': 'Expand image', - 'zero': 'Front page', - 'nextPage': 'Next page', - 'previousPage': 'Previous page', - 'nextThread': 'Next thread', - 'previousThread': 'Previous thread', - 'expandThread': 'Expand thread', - 'openThreadTab': 'Open thread', - 'openThread': 'Open thread tab', - 'nextReply': 'Next reply', - 'previousReply': 'Previous reply', - 'hide': 'Hide', - 'Scrolling': 'Auto Scroll', - 'Verbose': '' - }); - if ('Always CDN' in data.Conf) { - data.Conf['fourchanImageHost'] = data.Conf['Always CDN'] ? 'i.4cdn.org' : ''; - delete data.Conf['Always CDN']; - } - data.Conf.sauces = data.Conf.sauces.replace(/\$\d/g, function(c) { - switch (c) { - case '$1': - return '%TURL'; - case '$2': - return '%URL'; - case '$3': - return '%MD5'; - case '$4': - return '%board'; - default: - return c; - } - }); - ref = Config.hotkeys; - for (key in ref) { - val = ref[key]; - if (key in data.Conf) { - data.Conf[key] = data.Conf[key].replace(/ctrl|alt|meta/g, function(s) { - return "" + (s[0].toUpperCase()) + s.slice(1); - }).replace(/(^|.+\+)[A-Z]$/g, function(s) { - return "Shift+" + s.slice(0, -1) + (s.slice(-1).toLowerCase()); - }); - } - } - if (data.WatchedThreads) { - data.Conf['watchedThreads'] = $.dict.clone({ - '4chan.org': { - boards: {} - } - }); - ref1 = data.WatchedThreads; - for (boardID in ref1) { - threads = ref1[boardID]; - for (threadID in threads) { - threadData = threads[threadID]; - ((base = data.Conf['watchedThreads']['4chan.org'].boards)[boardID] || (base[boardID] = $.dict()))[threadID] = { - excerpt: threadData.textContent - }; - } - } - } - return data; - } - }, - upgrade: function(data, version) { - var addCSS, addSauces, boardID, boards, changes, compareString, corrupted, db, hostname, j, k, key, l, lastChecked, len, len1, len2, len3, line, list, m, name, record, ref, ref1, ref10, ref11, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, rice, set, setD, siteProperties, software, type, uids, val, val2, value; - changes = $.dict(); - set = function(key, value) { - return data[key] = changes[key] = value; - }; - setD = function(key, value) { - if (data[key] == null) { - return set(key, value); - } - }; - addSauces = function(sauces) { - if (data['sauces'] != null) { - sauces = sauces.filter(function(s) { - return data['sauces'].indexOf(s.match(/[^#;\s]+|$/)[0]) < 0; - }); - if (sauces.length) { - return set('sauces', data['sauces'] + '\n\n' + sauces.join('\n')); - } - } - }; - addCSS = function(css) { - if (data['usercss'] == null) { - set('usercss', Config['usercss']); - } - if (data['usercss'].indexOf(css) < 0) { - return set('usercss', css + '\n\n' + data['usercss']); - } - }; - if ((corrupted = version[0] === '"')) { - try { - version = JSON.parse(version); - } catch (error) {} - } - compareString = version.replace(/\d+/g, function(x) { - return ('0000' + x).slice(-5); - }); - if (compareString < '00001.00013.00014.00008') { - for (key in data) { - val = data[key]; - if (!(typeof val === 'string' && typeof Conf[key] !== 'string' && (key !== 'Index Sort' && key !== 'Last Long Reply Thresholds 0' && key !== 'Last Long Reply Thresholds 1'))) { - continue; - } - corrupted = true; - break; - } - } - if (corrupted) { - for (key in data) { - val = data[key]; - if (typeof val === 'string') { - try { - val2 = JSON.parse(val); - set(key, val2); - } catch (error) {} - } - } - } - if (compareString < '00001.00011.00008.00000') { - if (data['Fixed Thread Watcher'] == null) { - set('Fixed Thread Watcher', (ref = data['Toggleable Thread Watcher']) != null ? ref : true); - } - if (data['Exempt Archives from Encryption'] == null) { - set('Exempt Archives from Encryption', (ref1 = data['Except Archives from Encryption']) != null ? ref1 : false); - } - } - if (compareString < '00001.00011.00010.00001') { - if (data['selectedArchives'] != null) { - uids = { - "Moe": 0, - "4plebs Archive": 3, - "Nyafuu Archive": 4, - "Love is Over": 5, - "Rebecca Black Tech": 8, - "warosu": 10, - "fgts": 15, - "not4plebs": 22, - "DesuStorage": 23, - "fireden.net": 24, - "disabled": null - }; - ref2 = data['selectedArchives']; - for (boardID in ref2) { - record = ref2[boardID]; - for (type in record) { - name = record[type]; - if ($.hasOwn(uids, name)) { - record[type] = uids[name]; - } - } - } - set('selectedArchives', data['selectedArchives']); - } - } - if (compareString < '00001.00011.00016.00000') { - if ((rice = Config['usercss'].match(/\/\* Board title rice \*\/(?:\n.+)*/)[0])) { - if ((data['usercss'] != null) && data['usercss'].indexOf(rice) < 0) { - set('usercss', rice + '\n\n' + data['usercss']); - } - } - } - if (compareString < '00001.00011.00017.00000') { - ref3 = ['Persistent QR', 'Color User IDs', 'Fappe Tyme', 'Werk Tyme', 'Highlight Posts Quoting You', 'Highlight Own Posts']; - for (j = 0, len = ref3.length; j < len; j++) { - key = ref3[j]; - if (data[key] == null) { - set(key, key === 'Persistent QR'); - } - } - } - if (compareString < '00001.00011.00017.00006') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^(#?\s*)http:\/\/iqdb\.org\//mg, '$1//iqdb.org/')); - } - } - if (compareString < '00001.00011.00019.00003' && !Settings.dialog) { - $.queueTask(function() { - return Settings.warnings.ads(function(item) { - return new Notice('warning', slice.call(item.childNodes)); - }); - }); - } - if (compareString < '00001.00011.00020.00003') { - ref4 = { - 'Inline Cross-thread Quotes Only': false, - 'Pass Link': true - }; - for (key in ref4) { - value = ref4[key]; - if (data[key] == null) { - set(key, value); - } - } - } - if (compareString < '00001.00011.00021.00003') { - if (data['Remember Your Posts'] == null) { - set('Remember Your Posts', (ref5 = data['Mark Quotes of You']) != null ? ref5 : true); - } - } - if (compareString < '00001.00011.00022.00000') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^(#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(?:IMG|URL))%3Fs\.jpg/mg, '$1')); - set('sauces', data['sauces'].replace(/^#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(?:IMG|T?URL)(?=$|;)/mg, '$&&safe=off')); - } - } - if (compareString < '00001.00011.00022.00002') { - if ((data['Use Recaptcha v1 in Reports'] == null) && data['Use Recaptcha v1'] && !data['Use Recaptcha v2 in Reports']) { - set('Use Recaptcha v1 in Reports', true); - } - } - if (compareString < '00001.00011.00024.00000') { - if ((data['JSON Navigation'] != null) && (data['JSON Index'] == null)) { - set('JSON Index', data['JSON Navigation']); - } - } - if (compareString < '00001.00011.00026.00000') { - if ((data['Oekaki Links'] != null) && (data['Edit Link'] == null)) { - set('Edit Link', data['Oekaki Links']); - } - if (data['Inline Cross-thread Quotes Only'] == null) { - set('Inline Cross-thread Quotes Only', true); - } - } - if (compareString < '00001.00011.00030.00000') { - if (data['Quote Threading'] && (data['Thread Quotes'] == null)) { - set('Thread Quotes', true); - } - } - if (compareString < '00001.00011.00032.00000') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^(#?\s*)http:\/\/3d\.iqdb\.org\//mg, '$1//3d.iqdb.org/')); - } - addSauces(['#https://desustorage.org/_/search/image/%sMD5/', '#https://boards.fireden.net/_/search/image/%sMD5/', '#https://foolz.fireden.net/_/search/image/%sMD5/', '#//www.gif-explode.com/%URL;types:gif']); - } - if (compareString < '00001.00011.00035.00000') { - addSauces(['https://whatanime.ga/?auto&url=%IMG;text:wait']); - } - if (compareString < '00001.00012.00000.00000') { - if (data['Exempt Archives from Encryption'] == null) { - set('Exempt Archives from Encryption', false); - } - if (data['Show New Thread Option in Threads'] == null) { - set('Show New Thread Option in Threads', false); - } - if (data['Show Name and Subject']) { - addCSS('#qr .persona .field {display: block !important;}'); - } - if (data['QR Shortcut'] === false) { - addCSS('#shortcut-qr {display: none;}'); - } - if (data['Bottom QR Link'] === false) { - addCSS('.qr-link-container-bottom {display: none;}'); - } - } - if (compareString < '00001.00012.00000.00006') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^(#?\s*)https:\/\/(?:desustorage|cuckchan)\.org\//mg, '$1https://desuarchive.org/')); - } - } - if (compareString < '00001.00012.00001.00000') { - if ((data['Persistent Thread Watcher'] == null) && (data['Toggleable Thread Watcher'] != null)) { - set('Persistent Thread Watcher', !data['Toggleable Thread Watcher']); - } - } - if (compareString < '00001.00012.00003.00000') { - ref6 = ['Image Hover in Catalog', 'Auto Watch', 'Auto Watch Reply']; - for (k = 0, len1 = ref6.length; k < len1; k++) { - key = ref6[k]; - setD(key, false); - } - } - if (compareString < '00001.00013.00001.00002') { - addSauces(['#//www.bing.com/images/search?q=imgurl:%IMG&view=detailv2&iss=sbi#enterInsights']); - } - if (compareString < '00001.00013.00005.00000') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^(#?\s*)http:\/\/regex\.info\/exif\.cgi/mg, '$1http://exif.regex.info/exif.cgi')); - } - addSauces(Config['sauces'].match(/# Known filename formats:(?:\n.+)*|$/)[0].split('\n')); - } - if (compareString < '00001.00013.00007.00002') { - setD('Require OP Quote Link', true); - } - if (compareString < '00001.00013.00008.00000') { - setD('Download Link', true); - } - if (compareString < '00001.00013.00009.00003') { - if (data['jsWhitelist'] != null) { - list = data['jsWhitelist'].split('\n'); - if (indexOf.call(list, 'https://cdnjs.cloudflare.com') < 0 && indexOf.call(list, 'https://cdn.mathjax.org') >= 0) { - set('jsWhitelist', data['jsWhitelist'] + '\n\nhttps://cdnjs.cloudflare.com'); - } - } - } - if (compareString < '00001.00014.00000.00006') { - if (data['siteSoftware'] != null) { - set('siteSoftware', data['siteSoftware'] + '\n4cdn.org yotsuba'); - } - } - if (compareString < '00001.00014.00003.00002') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^(#?\s*)https:\/\/whatanime\.ga\//mg, '$1https://trace.moe/')); - } - } - if (compareString < '00001.00014.00004.00004') { - if ((data['siteSoftware'] != null) && !/^4channel\.org yotsuba$/m.test(data['siteSoftware'])) { - set('siteSoftware', data['siteSoftware'] + '\n4channel.org yotsuba'); - } - } - if (compareString < '00001.00014.00005.00000') { - ref7 = DataBoard.keys; - for (l = 0, len2 = ref7.length; l < len2; l++) { - db = ref7[l]; - if ((ref8 = data[db]) != null ? ref8.boards : void 0) { - ref9 = data[db], boards = ref9.boards, lastChecked = ref9.lastChecked; - data[db]['4chan.org'] = { - boards: boards, - lastChecked: lastChecked - }; - delete data[db].boards; - delete data[db].lastChecked; - set(db, data[db]); - } - } - if ((data['siteSoftware'] != null) && (data['siteProperties'] == null)) { - siteProperties = $.dict(); - ref10 = data['siteSoftware'].split('\n'); - for (m = 0, len3 = ref10.length; m < len3; m++) { - line = ref10[m]; - ref11 = line.split(' '), hostname = ref11[0], software = ref11[1]; - siteProperties[hostname] = { - software: software - }; - } - set('siteProperties', siteProperties); - } - } - if (compareString < '00001.00014.00006.00006') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/\/\/%\$1\.deviantart\.com\/gallery\/#\/d%\$2;regexp:\/\^\\w\+_by_\(\\w\+\)-d\(\[\\da-z\]\+\)\//g, '//www.deviantart.com/gallery/#/d%$1%$2;regexp:/^\\w+_by_\\w+[_-]d([\\da-z]{6})\\b|^d([\\da-z]{6})-[\\da-z]{8}-/')); - } - } - if (compareString < '00001.00014.00008.00000') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/https:\/\/www\.yandex\.com\/images\/search/g, 'https://yandex.com/images/search')); - } - } - if (compareString < '00001.00014.00009.00000') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^(#?\s*)(?:http:)?\/\/(www\.pixiv\.net|www\.deviantart\.com|imgur\.com|flickr\.com)\//mg, '$1https://$2/')); - set('sauces', data['sauces'].replace(/https:\/\/yandex\.com\/images\/search\?rpt=imageview&img_url=%IMG/g, 'https://yandex.com/images/search?rpt=imageview&url=%IMG')); - } - } - if (compareString < '00001.00014.00009.00001') { - if ((data['Use Faster Image Host'] != null) && (data['fourchanImageHost'] == null)) { - set('fourchanImageHost', (data['Use Faster Image Host'] ? 'i.4cdn.org' : '')); - } - } - if (compareString < '00001.00014.00010.00001') { - if (data['Filter in Native Catalog'] == null) { - set('Filter in Native Catalog', false); - } - } - if (compareString < '00001.00014.00012.00008') { - if (data['boardnav'] == null) { - set('boardnav', "[ toggle-all ]\na-replace\nc-replace\ng-replace\nk-replace\nv-replace\nvg-replace\nvr-replace\nck-replace\nco-replace\nfit-replace\njp-replace\nmu-replace\nsp-replace\ntv-replace\nvp-replace\n[external-text:\"FAQ\",\"https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions\"]"); - } - } - if (compareString < '00001.00014.00016.00001') { - if (data['archiveLists'] != null) { - set('archiveLists', data['archiveLists'].replace('https://mayhemydg.github.io/archives.json/archives.json', 'https://nstepien.github.io/archives.json/archives.json')); - } - } - if (compareString < '00001.00014.00016.00007') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/https:\/\/www\.deviantart\.com\/gallery\/#\/d%\$1%\$2;regexp:\/\^\\w\+_by_\\w\+\[_-\]d\(\[\\da-z\]\{6\}\)\\b\|\^d\(\[\\da-z\]\{6\}\)-\[\\da-z\]\{8\}-\//g, 'javascript:void(open("https://www.deviantart.com/"+%$1.replace(/_/g,"-")+"/art/"+parseInt(%$2,36)));regexp:/^\\w+_by_(\\w+)[_-]d([\\da-z]{6})\\b/').replace(/\/\/imgops\.com\/%URL/g, '//imgops.com/start?url=%URL')); - } - } - if (compareString < '00001.00014.00017.00002') { - if (data['jsWhitelist'] != null) { - set('jsWhitelist', data['jsWhitelist'] + '\n\nhttps://hcaptcha.com\nhttps://*.hcaptcha.com'); - } - } - if (compareString < '00001.00014.00020.00004') { - if (data['archiveLists'] != null) { - set('archiveLists', data['archiveLists'].replace('https://nstepien.github.io/archives.json/archives.json', 'https://4chenz.github.io/archives.json/archives.json')); - } - } - if (compareString < '00001.00014.00022.00003') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(IMG|T?URL)&safe=off(?=$|;)/mg, 'https://www.google.com/searchbyimage?sbisrc=4chanx&image_url=%$1&safe=off')); - if (compareString === '00001.00014.00022.00002' && !/\bsbisrc=/.test(data['sauces'])) { - set('sauces', data['sauces'].replace(/^#?\s*https:\/\/lens\.google\.com\/uploadbyurl\?url=%(IMG|T?URL)(?=$|;)/m, 'https://www.google.com/searchbyimage?sbisrc=4chanx&image_url=%$1&safe=off')); - } - } - addSauces(['#https://lens.google.com/uploadbyurl?url=%IMG;text:lens']); - } - return changes; - }, - loadSettings: function(data, cb) { - if (data.version.split('.')[0] === '2') { - data = Settings.convertFrom.loadletter(data); - } else if (data.version !== g.VERSION) { - Settings.upgrade(data.Conf, data.version); - } - return $.clear(function(err) { - if (err) { - return cb(err); - } - return $.set(data.Conf, cb); - }); - }, - reset: function() { - if (confirm('Your current settings will be entirely wiped, are you sure?')) { - return $.clear(function(err) { - if (err) { - return $('.imp-exp-result').textContent = 'Import failed due to an error.'; - } else if (confirm('Reset successful. Reload now?')) { - return window.location.reload(); - } - }); - } - }, - filter: function(section) { - var select; - $.extend(section, {innerHTML: "
    "}); - select = $('select', section); - $.on(select, 'change', Settings.selectFilter); - return Settings.selectFilter.call(select); - }, - selectFilter: function() { - var div, filterTypes, name, ta; - div = this.nextElementSibling; - if ((name = this.value) !== 'guide') { - if (!$.hasOwn(Config.filter, name)) { - return; - } - $.rmAll(div); - ta = $.el('textarea', { - name: name, - className: 'field', - spellcheck: false - }); - $.on(ta, 'change', $.cb.value); - $.get(name, Conf[name], function(item) { - ta.value = item[name]; - return $.add(div, ta); - }); - return; - } - filterTypes = Object.keys(Config.filter).filter(function(x) { - return x !== 'general'; - }).map(function(x, i) { - return {innerHTML: ((i) ? "," : "") + "" + E(x)}; - }); - $.extend(div, {innerHTML: "
    Filter is disabled.

    Use regular expressions, one per line.
    Lines starting with a # will be ignored.
    For example, /weeaboo/i will filter posts containing the string `weeaboo`, case-insensitive.
    MD5 and Unique ID filtering use exact string matching, not regular expressions.

      You can use these settings with each regular expression, separate them with semicolons:
    • Per boards, separate them with commas. It is global if not specified. Use sfw and nsfw to reference all worksafe or not-worksafe boards.
      For example: boards:a,jp;.
      To specify boards on a particular site, put the beginning of the domain and a slash character before the list.
      Any initial www. should not be included, and all 4chan domains are considered 4chan.org.
      For example: boards:4:a,jp,sama:a,z;.
      An asterisk can be used to specify all boards on a site.
      For example: boards:4:*;.
    • Select boards to be excluded from the filter. The syntax is the same as for the boards: option above.
      For example: exclude:vg,v;.
    • Filter OPs only along with their threads (`only`) or replies only (`no`).
      For example: op:only; or op:no;.
    • Filter only posts with files (`only`) or only posts without files (`no`).
      For example: file:only; or file:no;.
    • Overrule the `Show Stubs` setting if specified: create a stub (`yes`) or not (`no`).
      For example: stub:yes; or stub:no;.
    • Highlight instead of hiding. You can specify a class name to use with a userstyle.
      For example: highlight; or highlight:wallpaper;.
    • Highlighted OPs will have their threads put on top of the board index by default.
      For example: top:yes; or top:no;.
    • Show a desktop notification instead of hiding.
      For example: notify;.
    • Filters in the \"General\" section apply to multiple fields, by default subject,name,filename,comment.
      The fields can be specified with the type option, separated by commas.
      For example: type:" + E.cat(filterTypes) + ";.
      Types can also be combined with a + sign; this indicates the filter applies to the given fields joined by newlines.
      For example: type:filename+filesize+dimensions;.
    "}); - return $('.warning', div).hidden = Conf['Filter']; - }, - sauce: function(section) { - var ta; - $.extend(section, {innerHTML: "
    Sauce is disabled.
    These parameters will be replaced by their corresponding values in the URL and displayed text:
    • %IMG: Full image URL for GIF, JPG, and PNG; thumbnail URL for other types.
    • %URL: Full image URL.
    • %TURL: Thumbnail URL.
    • %name: Original file name.
    • %board: Current board.
    • %MD5: MD5 hash in base64.
    • %sMD5: MD5 hash in base64 using - and _.
    • %hMD5: MD5 hash in hexadecimal.
    • %$0: Matched regular expression within the filename.
    • %$1, %$2, %$3, ... : Subexpressions within the matched regular expression.
    • %%, %semi: Literal % and ;.
    Lines starting with a # will be ignored.
    You can specify a display text by appending ;text:[text] to the URL.
    You can specify the applicable boards/sites by appending ;boards:[board1],[board2]. See the Filter guide for details.
    You can specify the applicable file types by appending ;types:[extension1],[extension2].
    You can specify a regular expression the filename must match by appending ;regexp:[regular expression].
    "}); - $('.warning', section).hidden = Conf['Sauce']; - ta = $('textarea', section); - $.get('sauces', Conf['sauces'], function(item) { - ta.value = item['sauces']; - return ta.hidden = false; - }); - return $.on(ta, 'change', $.cb.value); - }, - advanced: function(section) { - var applyCSS, boardSelect, customCSS, event, input, inputs, interval, items, itemsArchive, j, k, l, len, len1, len2, len3, listImageHost, m, name, ref, ref1, ref2, ref3, ref4, table, textContent, updateArchives, warning; - $.extend(section, {innerHTML: "
    Archives
    404 Redirect is disabled.
    Thread redirectionPost fetchingFile redirection

    Archive Lists: Each line below should be an archive list in this format or a URL to load an archive list from.
    Archive properties can be overriden by another item with the same uid (or if absent, its name).
    Last updated:
    External Catalog
    External Catalog is disabled. This will be used only as a fallback.
    URLs of external catalog sites, where %board is to be replaced by the board name.
    Each URL should be followed by ;boards: and optionally ;exclude: and a list of supported/excluded boards in the format explained in the Filter guide.
    Override 4chan Image Host
    Change 4chan image links to this domain. Leave blank for no change.
    Captcha Language
    Choose from list of language codes. Leave blank to autoselect.
    Custom Board Navigation
    New lines will be converted into spaces.

    In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
    Board link: g
    Archive link: g-archive
    Internal archive link: g-expired
    Title link: g-title
    Board link (Replace with title when on that board): g-replace
    Full text link: g-full
    Custom text link: g-text:"Install Gentoo"
    Index-only link: g-index
    Catalog-only link: g-catalog
    Index mode: g-mode:"infinite scrolling"
    Index sort: g-sort:"creation date rev"
    External link: external-text:"Google","http://www.google.com"
    Open in new tab: g-nt
    Combinations are possible: g-index-text:"Technology Index"
    Full board list toggle: toggle-all

    [ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:"Piracy"]
    will give you
    [ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
    if you are on /g/.
    Time Formatting is disabled.
    :
    Day: %a, %A, %d, %e
    Month: %m, %b, %B
    Year: %y, %Y
    Hour: %k, %H, %l, %I, %p, %P
    Minute: %M
    Second: %S
    Literal %: %%
    Quote Backlinks formatting is disabled.
    :
    Default pasted content filename
    .png
    File Info Formatting is disabled.
    :
    Link: %l (truncated), %L (untruncated), %T (4chan filename)
    Filename: %n (truncated), %N (untruncated), %t (4chan filename)
    Download button: %d
    Quick filter MD5: %f
    Spoiler indicator: %p
    Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
    Resolution: %r (Displays 'PDF' for PDF files)
    Tag: %g
    Literal %: %%
    Quick Reply Personas

    One item per line.
    Items will be added in the relevant input's auto-completion list.
    Password items will always be used, since there is no password input.
    Lines starting with a # will be ignored.

      You can use these settings with each item, separate them with semicolons:
    • Possible items are: name, options (or equivalently email), subject and password.
    • Wrap values of items with quotes, like this: options:"sage".
    • Force values as defaults with the always keyword, for example: options:"sage";always.
    • Select specific boards for an item, separated with commas, for example: options:"sage";boards:jp;always.
    Unread Favicon is disabled.
    Thread Updater is disabled.
    Interval: seconds
    Custom Cooldown Time
    Seconds:
    For more information about customizing 4chan X's CSS, see the styling guide.
    Javascript Whitelist
    Sources from which Javascript is allowed to be loaded by Content Security Policy.
    Lines starting with a # will be ignored.
    Known Banners
    List of known banners, used for click-to-change feature.
    "}); - ref = $$('.warning', section); - for (j = 0, len = ref.length; j < len; j++) { - warning = ref[j]; - warning.hidden = Conf[warning.dataset.feature]; - } - inputs = $.dict(); - ref1 = $$('[name]', section); - for (k = 0, len1 = ref1.length; k < len1; k++) { - input = ref1[k]; - inputs[input.name] = input; - } - $.on(inputs['archiveLists'], 'change', function() { - $.set('lastarchivecheck', 0); - Conf['lastarchivecheck'] = 0; - return $.id('lastarchivecheck').textContent = 'never'; - }); - items = $.dict(); - for (name in inputs) { - input = inputs[name]; - if (!(name !== 'Interval' && name !== 'Custom CSS')) { - continue; - } - items[name] = Conf[name]; - event = (input.nodeName === 'SELECT' || ((ref2 = input.type) === 'checkbox' || ref2 === 'radio') || (input.nodeName === 'TEXTAREA' && !(name in Settings))) ? 'change' : 'input'; - $.on(input, event, $.cb[input.type === 'checkbox' ? 'checked' : 'value']); - if (name in Settings) { - $.on(input, event, Settings[name]); - } - } - $.get(items, function(items) { - var key, val; - for (key in items) { - val = items[key]; - input = inputs[key]; - input[input.type === 'checkbox' ? 'checked' : 'value'] = val; - input.hidden = false; - if (key in Settings) { - Settings[key].call(input); - } - } - }); - listImageHost = $.id('list-fourchanImageHost'); - ref3 = ImageHost.suggestions; - for (l = 0, len2 = ref3.length; l < len2; l++) { - textContent = ref3[l]; - $.add(listImageHost, $.el('option', { - textContent: textContent - })); - } - interval = inputs['Interval']; - customCSS = inputs['Custom CSS']; - applyCSS = $('#apply-css', section); - interval.value = Conf['Interval']; - customCSS.checked = Conf['Custom CSS']; - inputs['usercss'].disabled = !Conf['Custom CSS']; - applyCSS.disabled = !Conf['Custom CSS']; - $.on(interval, 'change', ThreadUpdater.cb.interval); - $.on(customCSS, 'change', Settings.togglecss); - $.on(applyCSS, 'click', function() { - return CustomCSS.update(); - }); - itemsArchive = $.dict(); - ref4 = ['archives', 'selectedArchives', 'lastarchivecheck']; - for (m = 0, len3 = ref4.length; m < len3; m++) { - name = ref4[m]; - itemsArchive[name] = Conf[name]; - } - $.get(itemsArchive, function(itemsArchive) { - $.extend(Conf, itemsArchive); - Redirect.selectArchives(); - return Settings.addArchiveTable(section); - }); - boardSelect = $('#archive-board-select', section); - table = $('#archive-table', section); - updateArchives = $('#update-archives', section); - $.on(boardSelect, 'change', function() { - $('tbody > :not([hidden])', table).hidden = true; - return $("tbody > ." + this.value, table).hidden = false; - }); - return $.on(updateArchives, 'click', function() { - return Redirect.update(function() { - return Settings.addArchiveTable(section); - }); - }); - }, - addArchiveTable: function(section) { - var archBoards, archive, boardID, boardOptions, boardSelect, boards, data, files, id, item, j, k, l, len, len1, len2, len3, m, name, o, ref, ref1, ref2, ref3, ref4, row, rows, select, software, table, tbody, type, uid; - $('#lastarchivecheck', section).textContent = Conf['lastarchivecheck'] === 0 ? 'never' : new Date(Conf['lastarchivecheck']).toLocaleString(); - boardSelect = $('#archive-board-select', section); - table = $('#archive-table', section); - tbody = $('tbody', section); - $.rmAll(boardSelect); - $.rmAll(tbody); - archBoards = $.dict(); - ref = Conf['archives']; - for (j = 0, len = ref.length; j < len; j++) { - ref1 = ref[j], uid = ref1.uid, name = ref1.name, boards = ref1.boards, files = ref1.files, software = ref1.software; - if (software !== 'fuuka' && software !== 'foolfuuka') { - continue; - } - for (k = 0, len1 = boards.length; k < len1; k++) { - boardID = boards[k]; - o = archBoards[boardID] || (archBoards[boardID] = { - thread: [], - post: [], - file: [] - }); - archive = [uid != null ? uid : name, name]; - o.thread.push(archive); - if (software === 'foolfuuka') { - o.post.push(archive); - } - if (indexOf.call(files, boardID) >= 0) { - o.file.push(archive); - } - } - } - rows = []; - boardOptions = []; - ref2 = Object.keys(archBoards).sort(); - for (l = 0, len2 = ref2.length; l < len2; l++) { - boardID = ref2[l]; - row = $.el('tr', { - className: "board-" + boardID - }); - row.hidden = boardID !== g.BOARD.ID; - boardOptions.push($.el('option', { - textContent: "/" + boardID + "/", - value: "board-" + boardID, - selected: boardID === g.BOARD.ID - })); - o = archBoards[boardID]; - ref3 = ['thread', 'post', 'file']; - for (m = 0, len3 = ref3.length; m < len3; m++) { - item = ref3[m]; - $.add(row, Settings.addArchiveCell(boardID, o, item)); - } - rows.push(row); - } - if (rows.length === 0) { - boardSelect.hidden = table.hidden = true; - return; - } - boardSelect.hidden = table.hidden = false; - if (!(g.BOARD.ID in archBoards)) { - rows[0].hidden = false; - } - $.add(boardSelect, boardOptions); - $.add(tbody, rows); - ref4 = Conf['selectedArchives']; - for (boardID in ref4) { - data = ref4[boardID]; - for (type in data) { - id = data[type]; - if ((select = $("select[data-boardid='" + boardID + "'][data-type='" + type + "']", tbody))) { - select.value = JSON.stringify(id); - if (!select.value) { - select.value = select.firstChild.value; - } - } - } - } - }, - addArchiveCell: function(boardID, data, type) { - var archive, i, length, options, select, td; - length = data[type].length; - td = $.el('td', { - className: 'archive-cell' - }); - if (!length) { - td.textContent = '--'; - return td; - } - options = []; - i = 0; - while (i < length) { - archive = data[type][i++]; - options.push($.el('option', { - value: JSON.stringify(archive[0]), - textContent: archive[1] - })); - } - $.extend(td, {innerHTML: ""}); - select = td.firstElementChild; - if (!(select.disabled = length === 1)) { - select.setAttribute('data-boardid', boardID); - select.setAttribute('data-type', type); - $.on(select, 'change', Settings.saveSelectedArchive); - } - $.add(select, options); - return td; - }, - saveSelectedArchive: function() { - return $.get('selectedArchives', Conf['selectedArchives'], (function(_this) { - return function(arg) { - var name1, selectedArchives; - selectedArchives = arg.selectedArchives; - (selectedArchives[name1 = _this.dataset.boardid] || (selectedArchives[name1] = $.dict()))[_this.dataset.type] = JSON.parse(_this.value); - $.set('selectedArchives', selectedArchives); - Conf['selectedArchives'] = selectedArchives; - return Redirect.selectArchives(); - }; - })(this)); - }, - boardnav: function() { - return Header.generateBoardList(this.value); - }, - time: function() { - return this.nextElementSibling.textContent = Time.format(this.value, new Date()); - }, - timeLocale: function() { - return Settings.time.call($('[name=time]', Settings.dialog)); - }, - backlink: function() { - return this.nextElementSibling.textContent = this.value.replace(/%(?:id|%)/g, function(x) { - return { - '%id': '123456789', - '%%': '%' - }[x]; - }); - }, - fileInfo: function() { - var data; - data = { - isReply: true, - file: { - url: "//" + (ImageHost.host()) + "/g/1334437723720.jpg", - name: 'd9bb2efc98dd0df141a94399ff5880b7.jpg', - size: '276 KB', - sizeInBytes: 276 * 1024, - dimensions: '1280x720', - isImage: true, - isVideo: false, - isSpoiler: true, - tag: 'Loop' - } - }; - return FileInfo.format(this.value, data, this.nextElementSibling); - }, - favicon: function() { - var f, i, icon, img, j, len, ref; - Favicon["switch"](); - if (g.VIEW === 'thread' && Conf['Unread Favicon']) { - Unread.update(); - } - img = this.nextElementSibling.children; - f = Favicon; - ref = [f.SFW, f.unreadSFW, f.unreadSFWY, f.NSFW, f.unreadNSFW, f.unreadNSFWY, f.dead, f.unreadDead, f.unreadDeadY]; - for (i = j = 0, len = ref.length; j < len; i = ++j) { - icon = ref[i]; - if (!img[i]) { - $.add(this.nextElementSibling, $.el('img')); - } - img[i].src = icon; - } - }, - togglecss: function() { - if ($('textarea[name=usercss]', $.x('ancestor::fieldset[1]', this)).disabled = $.id('apply-css').disabled = !this.checked) { - CustomCSS.rmStyle(); - } else { - CustomCSS.addStyle(); - } - return $.cb.checked.call(this); - }, - keybinds: function(section) { - var arr, input, inputs, items, key, ref, tbody, tr; - $.extend(section, {innerHTML: "
    Keybinds are disabled.
    Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
    Press Backspace to disable a keybind.
    ActionsKeybinds
    "}); - $('.warning', section).hidden = Conf['Keybinds']; - tbody = $('tbody', section); - items = $.dict(); - inputs = $.dict(); - ref = Config.hotkeys; - for (key in ref) { - arr = ref[key]; - tr = $.el('tr', {innerHTML: "" + E(arr[1]) + ""}); - input = $('input', tr); - input.name = key; - input.spellcheck = false; - items[key] = Conf[key]; - inputs[key] = input; - $.on(input, 'keydown', Settings.keybind); - $.add(tbody, tr); - } - return $.get(items, function(items) { - var val; - for (key in items) { - val = items[key]; - inputs[key].value = val; - } - }); - }, - keybind: function(e) { - var key; - if (e.keyCode === 9) { - return; - } - e.preventDefault(); - e.stopPropagation(); - if ((key = Keybinds.keyCode(e)) == null) { - return; - } - this.value = key; - return $.cb.value.call(this); - } - }; - - return Settings; - -}).call(this); - -Test = (function() { - return Test; - -}).call(this); - -UI = (function() { - var Menu, UI, checkbox, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - slice = [].slice; - - dialog = function(id, properties) { - var child, el, i, len, move, ref; - el = $.el('div', { - className: 'dialog', - id: id - }); - $.extend(el, properties); - el.style.cssText = Conf[id + ".position"]; - move = $('.move', el); - $.on(move, 'touchstart mousedown', dragstart); - ref = move.children; - for (i = 0, len = ref.length; i < len; i++) { - child = ref[i]; - if (!child.tagName) { - continue; - } - $.on(child, 'touchstart mousedown', function(e) { - return e.stopPropagation(); - }); - } - return el; - }; - - Menu = (function() { - var currentMenu, lastToggledButton; - - currentMenu = null; - - lastToggledButton = null; - - function Menu(type) { - this.type = type; - this.addEntry = bind(this.addEntry, this); - this.onFocus = bind(this.onFocus, this); - this.keybinds = bind(this.keybinds, this); - this.close = bind(this.close, this); - this.setPosition = bind(this.setPosition, this); - $.on(d, 'AddMenuEntry', (function(_this) { - return function(arg) { - var detail; - detail = arg.detail; - if (detail.type !== _this.type) { - return; - } - delete detail.open; - return _this.addEntry(detail); - }; - })(this)); - this.entries = []; - } - - Menu.prototype.makeMenu = function() { - var menu; - menu = $.el('div', { - className: 'dialog', - id: 'menu', - tabIndex: 0 - }); - menu.dataset.type = this.type; - $.on(menu, 'click', function(e) { - return e.stopPropagation(); - }); - $.on(menu, 'keydown', this.keybinds); - return menu; - }; - - Menu.prototype.toggle = function(e, button, data) { - var previousButton; - e.preventDefault(); - e.stopPropagation(); - if (currentMenu) { - previousButton = lastToggledButton; - currentMenu.close(); - if (previousButton === button) { - return; - } - } - if (!this.entries.length) { - return; - } - return this.open(button, data); - }; - - Menu.prototype.open = function(button, data) { - var entry, i, len, menu, ref; - menu = this.menu = this.makeMenu(); - currentMenu = this; - lastToggledButton = button; - this.entries.sort(function(first, second) { - return first.order - second.order; - }); - ref = this.entries; - for (i = 0, len = ref.length; i < len; i++) { - entry = ref[i]; - this.insertEntry(entry, menu, data); - } - $.addClass(lastToggledButton, 'active'); - $.on(d, 'click CloseMenu', this.close); - $.on(d, 'scroll', this.setPosition); - $.on(window, 'resize', this.setPosition); - $.after(button, menu); - this.setPosition(); - entry = $('.entry', menu); - this.focus(entry); - return menu.focus(); - }; - - Menu.prototype.setPosition = function() { - var bLeft, bRect, bTop, bottom, cHeight, cWidth, left, mRect, ref, ref1, right, top; - mRect = this.menu.getBoundingClientRect(); - bRect = lastToggledButton.getBoundingClientRect(); - bTop = window.scrollY + bRect.top; - bLeft = window.scrollX + bRect.left; - cHeight = doc.clientHeight; - cWidth = doc.clientWidth; - ref = bRect.top + bRect.height + mRect.height < cHeight ? [bRect.bottom + "px", ''] : ['', (cHeight - bRect.top) + "px"], top = ref[0], bottom = ref[1]; - ref1 = bRect.left + mRect.width < cWidth ? [bRect.left + "px", ''] : ['', (cWidth - bRect.right) + "px"], left = ref1[0], right = ref1[1]; - $.extend(this.menu.style, { - top: top, - right: right, - bottom: bottom, - left: left - }); - return this.menu.classList.toggle('left', right); - }; - - Menu.prototype.insertEntry = function(entry, parent, data) { - var err, i, len, ref, subEntry, submenu; - if (typeof entry.open === 'function') { - try { - if (!entry.open(data)) { - return; - } - } catch (error) { - err = error; - Main.handleErrors({ - message: "Error in building the " + this.type + " menu.", - error: err - }); - return; - } - } - $.add(parent, entry.el); - if (!entry.subEntries) { - return; - } - if (submenu = $('.submenu', entry.el)) { - $.rm(submenu); - } - submenu = $.el('div', { - className: 'dialog submenu' - }); - ref = entry.subEntries; - for (i = 0, len = ref.length; i < len; i++) { - subEntry = ref[i]; - this.insertEntry(subEntry, submenu, data); - } - $.add(entry.el, submenu); - }; - - Menu.prototype.close = function() { - $.rm(this.menu); - delete this.menu; - $.rmClass(lastToggledButton, 'active'); - currentMenu = null; - lastToggledButton = null; - $.off(d, 'click scroll CloseMenu', this.close); - $.off(d, 'scroll', this.setPosition); - return $.off(window, 'resize', this.setPosition); - }; - - Menu.prototype.findNextEntry = function(entry, direction) { - var entries; - entries = slice.call(entry.parentNode.children); - entries.sort(function(first, second) { - return first.style.order - second.style.order; - }); - return entries[entries.indexOf(entry) + direction]; - }; - - Menu.prototype.keybinds = function(e) { - var entry, next, nextPrev, subEntry, submenu; - entry = $('.focused', this.menu); - while (subEntry = $('.focused', entry)) { - entry = subEntry; - } - switch (e.keyCode) { - case 27: - lastToggledButton.focus(); - this.close(); - break; - case 13: - case 32: - entry.click(); - break; - case 38: - if (next = this.findNextEntry(entry, -1)) { - this.focus(next); - } - break; - case 40: - if (next = this.findNextEntry(entry, +1)) { - this.focus(next); - } - break; - case 39: - if ((submenu = $('.submenu', entry)) && (next = submenu.firstElementChild)) { - while (nextPrev = this.findNextEntry(next, -1)) { - next = nextPrev; - } - this.focus(next); - } - break; - case 37: - if (next = $.x('parent::*[contains(@class,"submenu")]/parent::*', entry)) { - this.focus(next); - } - break; - default: - return; - } - e.preventDefault(); - return e.stopPropagation(); - }; - - Menu.prototype.onFocus = function(e) { - e.stopPropagation(); - return this.focus(e.target); - }; - - Menu.prototype.focus = function(entry) { - var bottom, cHeight, cWidth, eRect, focused, i, left, len, ref, ref1, ref2, right, sRect, style, submenu, top; - while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) { - $.rmClass(focused, 'focused'); - } - ref = $$('.focused', entry); - for (i = 0, len = ref.length; i < len; i++) { - focused = ref[i]; - $.rmClass(focused, 'focused'); - } - $.addClass(entry, 'focused'); - if (!(submenu = $('.submenu', entry))) { - return; - } - sRect = submenu.getBoundingClientRect(); - eRect = entry.getBoundingClientRect(); - cHeight = doc.clientHeight; - cWidth = doc.clientWidth; - ref1 = eRect.top + sRect.height < cHeight ? ['0px', 'auto'] : ['auto', '0px'], top = ref1[0], bottom = ref1[1]; - ref2 = eRect.right + sRect.width < cWidth - 150 ? ['100%', 'auto'] : ['auto', '100%'], left = ref2[0], right = ref2[1]; - style = submenu.style; - style.top = top; - style.bottom = bottom; - style.left = left; - return style.right = right; - }; - - Menu.prototype.addEntry = function(entry) { - this.parseEntry(entry); - return this.entries.push(entry); - }; - - Menu.prototype.parseEntry = function(entry) { - var el, i, len, subEntries, subEntry; - el = entry.el, subEntries = entry.subEntries; - $.addClass(el, 'entry'); - $.on(el, 'focus mouseover', this.onFocus); - el.style.order = entry.order || 100; - if (!subEntries) { - return; - } - $.addClass(el, 'has-submenu'); - for (i = 0, len = subEntries.length; i < len; i++) { - subEntry = subEntries[i]; - this.parseEntry(subEntry); - } - }; - - return Menu; - - })(); - - dragstart = function(e) { - var el, isTouching, o, rect, ref, screenHeight, screenWidth; - if (e.type === 'mousedown' && e.button !== 0) { - return; - } - e.preventDefault(); - if (isTouching = e.type === 'touchstart') { - e = e.changedTouches[e.changedTouches.length - 1]; - } - el = $.x('ancestor::div[contains(@class,"dialog")][1]', this); - rect = el.getBoundingClientRect(); - screenHeight = doc.clientHeight; - screenWidth = doc.clientWidth; - o = { - id: el.id, - style: el.style, - dx: e.clientX - rect.left, - dy: e.clientY - rect.top, - height: screenHeight - rect.height, - width: screenWidth - rect.width, - screenHeight: screenHeight, - screenWidth: screenWidth, - isTouching: isTouching - }; - ref = Conf['Header auto-hide'] || !Conf['Fixed Header'] ? [0, 0] : Conf['Bottom Header'] ? [0, Header.bar.getBoundingClientRect().height] : [Header.bar.getBoundingClientRect().height, 0], o.topBorder = ref[0], o.bottomBorder = ref[1]; - if (isTouching) { - o.identifier = e.identifier; - o.move = touchmove.bind(o); - o.up = touchend.bind(o); - $.on(d, 'touchmove', o.move); - return $.on(d, 'touchend touchcancel', o.up); - } else { - o.move = drag.bind(o); - o.up = dragend.bind(o); - $.on(d, 'mousemove', o.move); - return $.on(d, 'mouseup', o.up); - } - }; - - touchmove = function(e) { - var i, len, ref, touch; - ref = e.changedTouches; - for (i = 0, len = ref.length; i < len; i++) { - touch = ref[i]; - if (touch.identifier === this.identifier) { - drag.call(this, touch); - return; - } - } - }; - - drag = function(e) { - var bottom, clientX, clientY, left, right, style, top; - clientX = e.clientX, clientY = e.clientY; - left = clientX - this.dx; - left = left < 10 ? 0 : this.width - left < 10 ? '' : left / this.screenWidth * 100 + '%'; - top = clientY - this.dy; - top = top < (10 + this.topBorder) ? this.topBorder + 'px' : this.height - top < (10 + this.bottomBorder) ? '' : top / this.screenHeight * 100 + '%'; - right = left === '' ? 0 : ''; - bottom = top === '' ? this.bottomBorder + 'px' : ''; - style = this.style; - style.left = left; - style.right = right; - style.top = top; - return style.bottom = bottom; - }; - - touchend = function(e) { - var i, len, ref, touch; - ref = e.changedTouches; - for (i = 0, len = ref.length; i < len; i++) { - touch = ref[i]; - if (touch.identifier === this.identifier) { - dragend.call(this); - return; - } - } - }; - - dragend = function() { - if (this.isTouching) { - $.off(d, 'touchmove', this.move); - $.off(d, 'touchend touchcancel', this.up); - } else { - $.off(d, 'mousemove', this.move); - $.off(d, 'mouseup', this.up); - } - return $.set(this.id + ".position", this.style.cssText); - }; - - hoverstart = function(arg) { - var cb, el, endEvents, height, latestEvent, noRemove, o, rect, ref, root, width; - root = arg.root, el = arg.el, latestEvent = arg.latestEvent, endEvents = arg.endEvents, height = arg.height, width = arg.width, cb = arg.cb, noRemove = arg.noRemove; - rect = root.getBoundingClientRect(); - o = { - root: root, - el: el, - style: el.style, - isImage: (ref = el.nodeName) === 'IMG' || ref === 'VIDEO', - cb: cb, - endEvents: endEvents, - latestEvent: latestEvent, - clientHeight: doc.clientHeight, - clientWidth: doc.clientWidth, - height: height, - width: width, - noRemove: noRemove, - clientX: (rect.left + rect.right) / 2, - clientY: (rect.top + rect.bottom) / 2 - }; - o.hover = hover.bind(o); - o.hoverend = hoverend.bind(o); - o.hover(o.latestEvent); - new MutationObserver(function() { - if (el.parentNode) { - return o.hover(o.latestEvent); - } - }).observe(el, { - childList: true - }); - $.on(root, endEvents, o.hoverend); - if ($.x('ancestor::div[contains(@class,"inline")][1]', root)) { - $.on(d, 'keydown', o.hoverend); - } - $.on(root, 'mousemove', o.hover); - o.workaround = function(e) { - if (!root.contains(e.target)) { - return o.hoverend(e); - } - }; - return $.on(doc, 'mousemove', o.workaround); - }; - - hoverstart.padding = 25; - - hover = function(e) { - var clientX, clientY, height, left, marginX, ref, ref1, right, style, threshold, top, width; - this.latestEvent = e; - height = (this.height || this.el.offsetHeight) + hoverstart.padding; - width = this.width || this.el.offsetWidth; - ref = Conf['Follow Cursor'] ? e : this, clientX = ref.clientX, clientY = ref.clientY; - top = this.isImage ? Math.max(0, clientY * (this.clientHeight - height) / this.clientHeight) : Math.max(0, Math.min(this.clientHeight - height, clientY - 120)); - threshold = this.clientWidth / 2; - if (!this.isImage) { - threshold = Math.max(threshold, this.clientWidth - 400); - } - marginX = (clientX <= threshold ? clientX : this.clientWidth - clientX) + 45; - if (this.isImage) { - marginX = Math.min(marginX, this.clientWidth - width); - } - marginX += 'px'; - ref1 = clientX <= threshold ? [marginX, ''] : ['', marginX], left = ref1[0], right = ref1[1]; - style = this.style; - style.top = top + 'px'; - style.left = left; - return style.right = right; - }; - - hoverend = function(e) { - if (e.type === 'keydown' && e.keyCode !== 13 || e.target.nodeName === "TEXTAREA") { - return; - } - if (!this.noRemove) { - $.rm(this.el); - } - $.off(this.root, this.endEvents, this.hoverend); - $.off(d, 'keydown', this.hoverend); - $.off(this.root, 'mousemove', this.hover); - $.off(doc, 'mousemove', this.workaround); - if (this.cb) { - return this.cb.call(this); - } - }; - - checkbox = function(name, text, checked) { - var input, label; - if (checked == null) { - checked = Conf[name]; - } - label = $.el('label'); - input = $.el('input', { - type: 'checkbox', - name: name, - checked: checked - }); - $.add(label, [input, $.tn(" " + text)]); - return label; - }; - - UI = { - dialog: dialog, - Menu: Menu, - hover: hoverstart, - checkbox: checkbox - }; - - return UI; - -}).call(this); - -FappeTyme = (function() { - var FappeTyme; - - FappeTyme = { - init: function() { - var el, i, indicator, lc, len, ref, ref1, type; - if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive'))) { - return; - } - this.nodes = {}; - this.enabled = { - fappe: false, - werk: Conf['werk'] - }; - ref1 = ["Fappe", "Werk"]; - for (i = 0, len = ref1.length; i < len; i++) { - type = ref1[i]; - if (!Conf[type + " Tyme"]) { - continue; - } - lc = type.toLowerCase(); - el = UI.checkbox(lc, type + " Tyme", false); - el.title = type + " Tyme"; - this.nodes[lc] = el.firstElementChild; - if (Conf[lc]) { - this.set(lc, true); - } - $.on(this.nodes[lc], 'change', this.toggle.bind(this, lc)); - Header.menu.addEntry({ - el: el, - order: 97 - }); - indicator = $.el('span', { - className: 'indicator', - textContent: type[0], - title: type + " Tyme active" - }); - $.on(indicator, 'click', function() { - var check; - check = $.getOwn(FappeTyme.nodes, this.parentNode.id.replace('shortcut-', '')); - check.checked = !check.checked; - return $.event('change', null, check); - }); - Header.addShortcut(lc, indicator, 410); - } - if (Conf['Werk Tyme']) { - $.sync('werk', this.set.bind(this, 'werk')); - } - Callbacks.Post.push({ - name: 'Fappe Tyme', - cb: this.node - }); - return Callbacks.CatalogThread.push({ - name: 'Werk Tyme', - cb: this.catalogNode - }); - }, - node: function() { - return this.nodes.root.classList.toggle('noFile', !this.files.length); - }, - catalogNode: function() { - var file, filename; - file = this.thread.OP.files[0]; - if (!file) { - return; - } - filename = $.el('div', { - textContent: file.name, - className: 'werkTyme-filename' - }); - return $.add(this.nodes.thumb.parentNode, filename); - }, - set: function(type, enabled) { - this.enabled[type] = this.nodes[type].checked = enabled; - return $[(enabled ? 'add' : 'rm') + "Class"](doc, type + "Tyme"); - }, - toggle: function(type) { - this.set(type, !this.enabled[type]); - if (type === 'werk') { - return $.cb.checked.call(this.nodes[type]); - } - } - }; - - return FappeTyme; - -}).call(this); - -Gallery = (function() { - var Gallery; - - Gallery = { - init: function() { - var el, ref; - if (!(this.enabled = Conf['Gallery'] && ((ref = g.VIEW) === 'index' || ref === 'thread'))) { - return; - } - this.delay = Conf['Slide Delay']; - el = $.el('a', { - href: 'javascript:;', - title: 'Gallery', - className: 'fa fa-picture-o', - textContent: 'Gallery' - }); - $.on(el, 'click', this.cb.toggle); - Header.addShortcut('gallery', el, 530); - return Callbacks.Post.push({ - name: 'Gallery', - cb: this.node - }); - }, - node: function() { - var file, i, len, ref, results; - ref = this.files; - results = []; - for (i = 0, len = ref.length; i < len; i++) { - file = ref[i]; - if (!file.thumb) { - continue; - } - if (Gallery.nodes) { - Gallery.generateThumb(this, file); - Gallery.nodes.total.textContent = Gallery.images.length; - } - if (!(Conf['Image Expansion'] || (g.SITE.software === 'tinyboard' && Main.jsEnabled))) { - results.push($.on(file.thumbLink, 'click', Gallery.cb.image)); - } else { - results.push(void 0); - } - } - return results; - }, - build: function(image) { - var candidate, cb, dialog, entry, file, i, j, k, key, len, len1, len2, menuButton, nodes, post, postThumb, ref, ref1, ref2, ref3, thumb, value; - cb = Gallery.cb; - if (Conf['Fullscreen Gallery']) { - $.one(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', function() { - return $.on(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', cb.close); - }); - if (typeof doc.mozRequestFullScreen === "function") { - doc.mozRequestFullScreen(); - } - if (typeof doc.webkitRequestFullScreen === "function") { - doc.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT); - } - } - Gallery.images = []; - nodes = Gallery.nodes = {}; - Gallery.fileIDs = $.dict(); - Gallery.slideshow = false; - nodes.el = dialog = $.el('div', { - id: 'a-gallery' - }); - $.extend(dialog, {innerHTML: "
    ×
    /
    "}); - ref = { - buttons: '.gal-buttons', - frame: '.gal-image', - name: '.gal-name', - count: '.count', - total: '.total', - sauce: '.gal-sauce', - thumbs: '.gal-thumbnails', - next: '.gal-image a', - current: '.gal-image img' - }; - for (key in ref) { - value = ref[key]; - nodes[key] = $(value, dialog); - } - menuButton = $('.menu-button', dialog); - nodes.menu = new UI.Menu('gallery'); - $.on(nodes.frame, 'click', cb.blank); - if (Conf['Mouse Wheel Volume']) { - $.on(nodes.frame, 'wheel', Volume.wheel); - } - $.on(nodes.next, 'click', cb.click); - $.on(nodes.name, 'click', ImageCommon.download); - $.on($('.gal-prev', dialog), 'click', cb.prev); - $.on($('.gal-next', dialog), 'click', cb.next); - $.on($('.gal-start', dialog), 'click', cb.start); - $.on($('.gal-stop', dialog), 'click', cb.stop); - $.on($('.gal-close', dialog), 'click', cb.close); - $.on(menuButton, 'click', function(e) { - return nodes.menu.toggle(e, this, g); - }); - ref1 = Gallery.menu.createSubEntries(); - for (i = 0, len = ref1.length; i < len; i++) { - entry = ref1[i]; - entry.order = 0; - nodes.menu.addEntry(entry); - } - $.on(d, 'keydown', cb.keybinds); - if (Conf['Keybinds']) { - $.off(d, 'keydown', Keybinds.keydown); - } - $.on(window, 'resize', Gallery.cb.setHeight); - ref2 = $$(g.SITE.selectors.file.thumb); - for (j = 0, len1 = ref2.length; j < len1; j++) { - postThumb = ref2[j]; - if (!(post = Get.postFromNode(postThumb))) { - continue; - } - ref3 = post.files; - for (k = 0, len2 = ref3.length; k < len2; k++) { - file = ref3[k]; - if (!file.thumb) { - continue; - } - Gallery.generateThumb(post, file); - if (!image && Gallery.fileIDs[post.fullID + "." + file.index]) { - candidate = file.thumbLink; - if (Header.getTopOf(candidate) + candidate.getBoundingClientRect().height >= 0) { - image = candidate; - } - } - } - } - $.addClass(doc, 'gallery-open'); - $.add(d.body, dialog); - nodes.thumbs.scrollTop = 0; - nodes.current.parentElement.scrollTop = 0; - if (image) { - thumb = $("[href='" + image.href + "']", nodes.thumbs); - } - thumb || (thumb = Gallery.images[Gallery.images.length - 1]); - if (thumb) { - Gallery.open(thumb); - } - doc.style.overflow = 'hidden'; - return nodes.total.textContent = Gallery.images.length; - }, - generateThumb: function(post, file) { - var thumb, thumbImg; - if (post.isClone || post.isHidden) { - return; - } - if (!(file && file.thumb && (file.isImage || file.isVideo || Conf['PDF in Gallery']))) { - return; - } - if (Gallery.fileIDs[post.fullID + "." + file.index]) { - return; - } - Gallery.fileIDs[post.fullID + "." + file.index] = true; - thumb = $.el('a', { - className: 'gal-thumb', - href: file.url, - target: '_blank', - title: file.name - }); - thumb.dataset.id = Gallery.images.length; - thumb.dataset.post = post.fullID; - thumb.dataset.file = file.index; - thumbImg = file.thumb.cloneNode(false); - thumbImg.style.cssText = ''; - $.add(thumb, thumbImg); - $.on(thumb, 'click', Gallery.cb.open); - Gallery.images.push(thumb); - return $.add(Gallery.nodes.thumbs, thumb); - }, - load: function(thumb, errorCB) { - var elType, ext, file; - ext = thumb.href.match(/\w*$/); - elType = $.getOwn({ - 'webm': 'video', - 'mp4': 'video', - 'ogv': 'video', - 'pdf': 'iframe' - }, ext) || 'img'; - file = $.el(elType); - $.extend(file.dataset, thumb.dataset); - $.on(file, 'error', errorCB); - file.src = thumb.href; - return file; - }, - open: function(thumb) { - var el, file, i, len, link, newID, node, nodes, oldID, post, ref, ref1, sauces; - nodes = Gallery.nodes; - oldID = +nodes.current.dataset.id; - newID = +thumb.dataset.id; - if (el = Gallery.images[oldID]) { - $.rmClass(el, 'gal-highlight'); - } - $.addClass(thumb, 'gal-highlight'); - nodes.thumbs.scrollTop = thumb.offsetTop + thumb.offsetHeight / 2 - nodes.thumbs.clientHeight / 2; - if (((ref = Gallery.cache) != null ? ref.dataset.id : void 0) === '' + newID) { - file = Gallery.cache; - $.off(file, 'error', Gallery.cacheError); - $.on(file, 'error', Gallery.error); - } else { - file = Gallery.load(thumb, Gallery.error); - } - $.off(nodes.current, 'error', Gallery.error); - ImageCommon.pause(nodes.current); - $.replace(nodes.current, file); - nodes.current = file; - if (file.nodeName === 'VIDEO') { - file.loop = true; - Volume.setup(file); - if (Conf['Autoplay']) { - file.play(); - } - if (Conf['Show Controls']) { - ImageCommon.addControls(file); - } - } - doc.classList.toggle('gal-pdf', file.nodeName === 'IFRAME'); - Gallery.cb.setHeight(); - nodes.count.textContent = +thumb.dataset.id + 1; - nodes.name.download = nodes.name.textContent = thumb.title; - nodes.name.href = thumb.href; - nodes.frame.scrollTop = 0; - nodes.next.focus(); - $.rmAll(nodes.sauce); - if (Conf['Sauce'] && Sauce.links && (post = g.posts.get(file.dataset.post))) { - sauces = []; - ref1 = Sauce.links; - for (i = 0, len = ref1.length; i < len; i++) { - link = ref1[i]; - if ((node = Sauce.createSauceLink(link, post, post.files[+file.dataset.file]))) { - sauces.push($.tn(' '), node); - } - } - $.add(nodes.sauce, sauces); - } - if (Gallery.slideshow && (newID > oldID || (oldID === Gallery.images.length - 1 && newID === 0))) { - Gallery.setupTimer(); - } else { - Gallery.cb.stop(); - } - if (Conf['Scroll to Post'] && (post = g.posts.get(file.dataset.post))) { - Header.scrollTo(post.nodes.root); - } - if (isNaN(oldID) || newID === (oldID + 1) % Gallery.images.length) { - return Gallery.cache = Gallery.load(Gallery.images[(newID + 1) % Gallery.images.length], Gallery.cacheError); - } - }, - error: function() { - var file, post, ref; - if (((ref = this.error) != null ? ref.code : void 0) === MediaError.MEDIA_ERR_DECODE) { - return new Notice('error', 'Corrupt or unplayable video', 30); - } - if (ImageCommon.isFromArchive(this)) { - return; - } - post = g.posts.get(this.dataset.post); - file = post.files[+this.dataset.file]; - return ImageCommon.error(this, post, file, null, (function(_this) { - return function(url) { - if (!url) { - return; - } - Gallery.images[+_this.dataset.id].href = url; - if (Gallery.nodes.current === _this) { - return _this.src = url; - } - }; - })(this)); - }, - cacheError: function() { - return delete Gallery.cache; - }, - cleanupTimer: function() { - var current; - clearTimeout(Gallery.timeoutID); - current = Gallery.nodes.current; - $.off(current, 'canplaythrough load', Gallery.startTimer); - return $.off(current, 'ended', Gallery.cb.next); - }, - startTimer: function() { - return Gallery.timeoutID = setTimeout(Gallery.checkTimer, Gallery.delay * $.SECOND); - }, - setupTimer: function() { - var current, isVideo; - Gallery.cleanupTimer(); - current = Gallery.nodes.current; - isVideo = current.nodeName === 'VIDEO'; - if (isVideo) { - current.play(); - } - if ((isVideo ? current.readyState >= 4 : current.complete) || current.nodeName === 'IFRAME') { - return Gallery.startTimer(); - } else { - return $.on(current, (isVideo ? 'canplaythrough' : 'load'), Gallery.startTimer); - } - }, - checkTimer: function() { - var current; - current = Gallery.nodes.current; - if (current.nodeName === 'VIDEO' && !current.paused) { - $.on(current, 'ended', Gallery.cb.next); - return current.loop = false; - } else { - return Gallery.cb.next(); - } - }, - cb: { - keybinds: function(e) { - var cb, key; - if (!(key = Keybinds.keyCode(e))) { - return; - } - cb = (function() { - switch (key) { - case Conf['Close']: - case Conf['Open Gallery']: - return Gallery.cb.close; - case Conf['Next Gallery Image']: - return Gallery.cb.next; - case Conf['Advance Gallery']: - return Gallery.cb.advance; - case Conf['Previous Gallery Image']: - return Gallery.cb.prev; - case Conf['Pause']: - return Gallery.cb.pause; - case Conf['Slideshow']: - return Gallery.cb.toggleSlideshow; - case Conf['Rotate image anticlockwise']: - return Gallery.cb.rotateLeft; - case Conf['Rotate image clockwise']: - return Gallery.cb.rotateRight; - case Conf['Download Gallery Image']: - return Gallery.cb.download; - } - })(); - if (!cb) { - return; - } - e.stopPropagation(); - e.preventDefault(); - return cb(); - }, - open: function(e) { - if (e) { - e.preventDefault(); - } - if (this) { - return Gallery.open(this); - } - }, - image: function(e) { - e.preventDefault(); - e.stopPropagation(); - return Gallery.build(this); - }, - prev: function() { - return Gallery.cb.open.call(Gallery.images[+Gallery.nodes.current.dataset.id - 1] || Gallery.images[Gallery.images.length - 1]); - }, - next: function() { - return Gallery.cb.open.call(Gallery.images[+Gallery.nodes.current.dataset.id + 1] || Gallery.images[0]); - }, - click: function(e) { - if (ImageCommon.onControls(e)) { - return; - } - e.preventDefault(); - return Gallery.cb.advance(); - }, - advance: function() { - if (!Conf['Autoplay'] && Gallery.nodes.current.paused) { - return Gallery.nodes.current.play(); - } else { - return Gallery.cb.next(); - } - }, - toggle: function() { - return (Gallery.nodes ? Gallery.cb.close : Gallery.build)(); - }, - blank: function(e) { - if (e.target === this) { - return Gallery.cb.close(); - } - }, - toggleSlideshow: function() { - return Gallery.cb[Gallery.slideshow ? 'stop' : 'start'](); - }, - download: function() { - var name; - name = $('.gal-name'); - return name.click(); - }, - pause: function() { - var current; - Gallery.cb.stop(); - current = Gallery.nodes.current; - if (current.nodeName === 'VIDEO') { - return current[current.paused ? 'play' : 'pause'](); - } - }, - start: function() { - $.addClass(Gallery.nodes.buttons, 'gal-playing'); - Gallery.slideshow = true; - return Gallery.setupTimer(); - }, - stop: function() { - var current; - if (!Gallery.slideshow) { - return; - } - Gallery.cleanupTimer(); - current = Gallery.nodes.current; - if (current.nodeName === 'VIDEO') { - current.loop = true; - } - $.rmClass(Gallery.nodes.buttons, 'gal-playing'); - return Gallery.slideshow = false; - }, - rotateLeft: function() { - return Gallery.cb.rotate(270); - }, - rotateRight: function() { - return Gallery.cb.rotate(90); - }, - rotate: $.debounce(100, function(delta) { - var current; - current = Gallery.nodes.current; - if (current.nodeName === 'IFRAME') { - return; - } - current.dataRotate = ((current.dataRotate || 0) + delta) % 360; - current.style.transform = "rotate(" + current.dataRotate + "deg)"; - return Gallery.cb.setHeight(); - }), - close: function() { - $.off(Gallery.nodes.current, 'error', Gallery.error); - ImageCommon.pause(Gallery.nodes.current); - $.rm(Gallery.nodes.el); - $.rmClass(doc, 'gallery-open'); - if (Conf['Fullscreen Gallery']) { - $.off(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', Gallery.cb.close); - if (typeof d.mozCancelFullScreen === "function") { - d.mozCancelFullScreen(); - } - if (typeof d.webkitExitFullscreen === "function") { - d.webkitExitFullscreen(); - } - } - delete Gallery.nodes; - delete Gallery.fileIDs; - doc.style.overflow = ''; - $.off(d, 'keydown', Gallery.cb.keybinds); - if (Conf['Keybinds']) { - $.on(d, 'keydown', Keybinds.keydown); - } - $.off(window, 'resize', Gallery.cb.setHeight); - return clearTimeout(Gallery.timeoutID); - }, - setFitness: function() { - return (this.checked ? $.addClass : $.rmClass)(doc, "gal-" + (this.name.toLowerCase().replace(/\s+/g, '-'))); - }, - setHeight: $.debounce(100, function() { - var containerHeight, containerWidth, current, dim, frame, height, margin, minHeight, ref, ref1, ref2, ref3, style, width; - ref = Gallery.nodes, current = ref.current, frame = ref.frame; - style = current.style; - if (Conf['Stretch to Fit'] && (dim = (ref1 = g.posts.get(current.dataset.post)) != null ? ref1.files[+current.dataset.file].dimensions : void 0)) { - ref2 = dim.split('x'), width = ref2[0], height = ref2[1]; - containerWidth = frame.clientWidth; - containerHeight = doc.clientHeight - 25; - if ((current.dataRotate || 0) % 180 === 90) { - ref3 = [containerHeight, containerWidth], containerWidth = ref3[0], containerHeight = ref3[1]; - } - minHeight = Math.min(containerHeight, height / width * containerWidth); - style.minHeight = minHeight + 'px'; - style.minWidth = (width / height * minHeight) + 'px'; - } else { - style.minHeight = style.minWidth = ''; - } - if ((current.dataRotate || 0) % 180 === 90) { - style.maxWidth = Conf['Fit Height'] ? (doc.clientHeight - 25) + "px" : 'none'; - style.maxHeight = Conf['Fit Width'] ? frame.clientWidth + "px" : 'none'; - margin = (current.clientWidth - current.clientHeight) / 2; - return style.margin = margin + "px " + (-margin) + "px"; - } else { - return style.maxWidth = style.maxHeight = style.margin = ''; - } - }), - setDelay: function() { - return Gallery.delay = +this.value; - } - }, - menu: { - init: function() { - var el; - if (!Gallery.enabled) { - return; - } - el = $.el('span', { - textContent: 'Gallery', - className: 'gallery-link' - }); - return Header.menu.addEntry({ - el: el, - order: 105, - subEntries: Gallery.menu.createSubEntries() - }); - }, - createSubEntry: function(name) { - var input, label; - label = UI.checkbox(name, name); - input = label.firstElementChild; - if (name === 'Hide Thumbnails' || name === 'Fit Width' || name === 'Fit Height') { - $.on(input, 'change', Gallery.cb.setFitness); - } - $.event('change', null, input); - $.on(input, 'change', $.cb.checked); - if (name === 'Hide Thumbnails' || name === 'Fit Width' || name === 'Fit Height' || name === 'Stretch to Fit') { - $.on(input, 'change', Gallery.cb.setHeight); - } - return { - el: label - }; - }, - createSubEntries: function() { - var delayInput, delayLabel, item, subEntries; - subEntries = (function() { - var i, len, ref, results; - ref = ['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Stretch to Fit', 'Scroll to Post']; - results = []; - for (i = 0, len = ref.length; i < len; i++) { - item = ref[i]; - results.push(Gallery.menu.createSubEntry(item)); - } - return results; - })(); - delayLabel = $.el('label', {innerHTML: "Slide Delay: "}); - delayInput = delayLabel.firstElementChild; - delayInput.value = Gallery.delay; - $.on(delayInput, 'change', Gallery.cb.setDelay); - $.on(delayInput, 'change', $.cb.value); - subEntries.push({ - el: delayLabel - }); - return subEntries; - } - } - }; - - return Gallery; - -}).call(this); - -ImageCommon = (function() { - var ImageCommon, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - ImageCommon = { - pause: function(video) { - if (video.nodeName !== 'VIDEO') { - return; - } - video.pause(); - $.off(video, 'volumechange', Volume.change); - return video.muted = true; - }, - rewind: function(el) { - if (el.nodeName === 'VIDEO') { - if (el.readyState >= el.HAVE_METADATA) { - return el.currentTime = 0; - } - } else if (/\.gif$/.test(el.src)) { - return $.queueTask(function() { - return el.src = el.src; - }); - } - }, - pushCache: function(el) { - ImageCommon.cache = el; - return $.on(el, 'error', ImageCommon.cacheError); - }, - popCache: function() { - var el; - el = ImageCommon.cache; - $.off(el, 'error', ImageCommon.cacheError); - delete ImageCommon.cache; - return el; - }, - cacheError: function() { - if (ImageCommon.cache === this) { - return delete ImageCommon.cache; - } - }, - decodeError: function(file, fileObj) { - var message, ref; - if (((ref = file.error) != null ? ref.code : void 0) !== MediaError.MEDIA_ERR_DECODE) { - return false; - } - if (!(message = $('.warning', fileObj.thumb.parentNode))) { - message = $.el('div', { - className: 'warning' - }); - $.after(fileObj.thumb, message); - } - message.textContent = 'Error: Corrupt or unplayable video'; - return true; - }, - isFromArchive: function(file) { - return g.SITE.software === 'yotsuba' && !ImageHost.test(file.src.split('/')[2]); - }, - error: function(file, post, fileObj, delay, cb) { - var base, parseJSON, redirect, src, threadJSON, timeoutID, url; - src = fileObj.url.split('/'); - url = null; - if (g.SITE.software === 'yotsuba' && Conf['404 Redirect']) { - url = Redirect.to('file', { - boardID: post.board.ID, - filename: src[src.length - 1] - }); - } - if (!(url && Redirect.securityCheck(url))) { - url = null; - } - if ((post.isDead || fileObj.isDead) && !ImageCommon.isFromArchive(file)) { - return cb(url); - } - if (delay != null) { - timeoutID = setTimeout((function() { - return cb(url); - }), delay); - } - if (post.isDead || fileObj.isDead) { - return; - } - redirect = function() { - if (!ImageCommon.isFromArchive(file)) { - if (delay != null) { - clearTimeout(timeoutID); - } - return cb(url); - } - }; - threadJSON = typeof (base = g.SITE.urls).threadJSON === "function" ? base.threadJSON(post) : void 0; - if (!threadJSON) { - return; - } - parseJSON = function(isArchiveURL) { - var archivedThreadJSON, base1, i, len, postObj, ref, ref1; - if (this.status === 404) { - if (!isArchiveURL && (archivedThreadJSON = typeof (base1 = g.SITE.urls).archivedThreadJSON === "function" ? base1.archivedThreadJSON(post) : void 0)) { - $.ajax(archivedThreadJSON, { - onloadend: function() { - return parseJSON.call(this, true); - } - }); - } else { - post.kill(!post.isClone, fileObj.index); - } - } - if (this.status !== 200) { - return redirect(); - } - ref = this.response.posts; - for (i = 0, len = ref.length; i < len; i++) { - postObj = ref[i]; - if (postObj.no === post.ID) { - break; - } - } - if (postObj.no !== post.ID) { - post.kill(); - return redirect(); - } else if (ref1 = fileObj.docIndex, indexOf.call(g.SITE.Build.parseJSON(postObj, post.board).filesDeleted, ref1) >= 0) { - post.kill(true); - return redirect(); - } else { - return url = fileObj.url; - } - }; - return $.ajax(threadJSON, { - onloadend: function() { - return parseJSON.call(this); - } - }); - }, - addControls: function(video) { - var handler; - handler = function() { - var t; - $.off(video, 'mouseover', handler); - t = new Date().getTime(); - return $.asap((function() { - return $.engine !== 'gecko' || (video.readyState >= 3 && video.currentTime <= Math.max(0.1, video.duration - 0.5)) || new Date().getTime() >= t + 1000; - }), function() { - return video.controls = true; - }); - }; - return $.on(video, 'mouseover', handler); - }, - onControls: function(e) { - return (Conf['Show Controls'] && Conf['Click Passthrough'] && e.target.nodeName === 'VIDEO') || (e.target.controls && e.target.getBoundingClientRect().bottom - e.clientY < 35); - }, - download: function(e) { - var download, href, ref; - if (this.protocol === 'blob:') { - return true; - } - e.preventDefault(); - ref = this, href = ref.href, download = ref.download; - return CrossOrigin.file(href, function(blob) { - var a; - if (blob) { - a = $.el('a', { - href: URL.createObjectURL(blob), - download: download, - hidden: true - }); - $.add(d.body, a); - a.click(); - return $.rm(a); - } else { - return new Notice('warning', "Could not download " + href, 20); - } - }); - } - }; - - return ImageCommon; - -}).call(this); - -ImageExpand = (function() { - var ImageExpand, - slice = [].slice; - - ImageExpand = { - init: function() { - var ref; - if (!(this.enabled = Conf['Image Expansion'] && ((ref = g.VIEW) === 'index' || ref === 'thread'))) { - return; - } - this.EAI = $.el('a', { - className: 'expand-all-shortcut fa fa-expand', - textContent: 'EAI', - title: 'Expand All Images', - href: 'javascript:;' - }); - $.on(this.EAI, 'click', this.cb.toggleAll); - Header.addShortcut('expand-all', this.EAI, 520); - $.on(d, 'scroll visibilitychange', this.cb.playVideos); - this.videoControls = $.el('span', { - className: 'video-controls' - }); - $.extend(this.videoControls, {innerHTML: " contract"}); - return Callbacks.Post.push({ - name: 'Image Expansion', - cb: this.node - }); - }, - node: function() { - var ref; - if (!(this.file && (this.file.isImage || this.file.isVideo))) { - return; - } - $.on(this.file.thumbLink, 'click', ImageExpand.cb.toggle); - if (this.isClone) { - if (this.file.isExpanding) { - ImageExpand.contract(this); - return ImageExpand.expand(this); - } else if (this.file.isExpanded && this.file.isVideo) { - Volume.setup(this.file.fullImage); - ImageExpand.setupVideoCB(this); - return ImageExpand.setupVideo(this, !((ref = this.origin.file.fullImage) != null ? ref.paused : void 0) || this.origin.file.wasPlaying, this.file.fullImage.controls); - } - } else if (ImageExpand.on && !this.isHidden && !this.isFetchedQuote && (Conf['Expand spoilers'] || !this.file.isSpoiler) && (Conf['Expand videos'] || !this.file.isVideo)) { - return ImageExpand.expand(this); - } - }, - cb: { - toggle: function(e) { - var file, post, ref; - if ($.modifiedClick(e)) { - return; - } - post = Get.postFromNode(this); - file = post.file; - if (file.isExpanded && ImageCommon.onControls(e)) { - return; - } - e.preventDefault(); - if (!Conf['Autoplay'] && ((ref = file.fullImage) != null ? ref.paused : void 0)) { - return file.fullImage.play(); - } else { - return ImageExpand.toggle(post); - } - }, - toggleAll: function() { - var func, threadRoot, toggle; - $.event('CloseMenu'); - threadRoot = Nav.getThread(); - toggle = function(post) { - var file; - file = post.file; - if (!(file && (file.isImage || file.isVideo) && doc.contains(post.nodes.root))) { - return; - } - if (ImageExpand.on && (!Conf['Expand spoilers'] && file.isSpoiler || !Conf['Expand videos'] && file.isVideo || Conf['Expand from here'] && Header.getTopOf(file.thumb) < 0 || Conf['Expand thread only'] && g.VIEW === 'index' && !(threadRoot != null ? threadRoot.contains(file.thumb) : void 0))) { - return; - } - return $.queueTask(func, post); - }; - if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) { - ImageExpand.EAI.className = 'contract-all-shortcut fa fa-compress'; - ImageExpand.EAI.title = 'Contract All Images'; - func = ImageExpand.expand; - } else { - ImageExpand.EAI.className = 'expand-all-shortcut fa fa-expand'; - ImageExpand.EAI.title = 'Expand All Images'; - func = ImageExpand.contract; - } - return g.posts.forEach(function(post) { - var i, len, ref; - ref = [post].concat(slice.call(post.clones)); - for (i = 0, len = ref.length; i < len; i++) { - post = ref[i]; - toggle(post); - } - }); - }, - playVideos: function() { - return g.posts.forEach(function(post) { - var file, i, len, ref, video, visible; - ref = [post].concat(slice.call(post.clones)); - for (i = 0, len = ref.length; i < len; i++) { - post = ref[i]; - file = post.file; - if (!(file && file.isVideo && file.isExpanded)) { - continue; - } - video = file.fullImage; - visible = ($.hasAudio(video) && !video.muted) || Header.isNodeVisible(video); - if (visible && file.wasPlaying) { - delete file.wasPlaying; - video.play(); - } else if (!visible && !video.paused) { - file.wasPlaying = true; - video.pause(); - } - } - }); - }, - setFitness: function() { - return $[this.checked ? 'addClass' : 'rmClass'](doc, this.name.toLowerCase().replace(/\s+/g, '-')); - } - }, - toggle: function(post) { - var next; - if (!(post.file.isExpanding || post.file.isExpanded)) { - post.file.scrollIntoView = Conf['Scroll into view']; - ImageExpand.expand(post); - return; - } - ImageExpand.contract(post); - if (Conf['Advance on contract']) { - next = post.nodes.root; - while (next = $.x("following::div[contains(@class,'postContainer')][1]", next)) { - if (!($('.stub', next) || next.offsetHeight === 0)) { - break; - } - } - if (next) { - return Header.scrollTo(next); - } - } - }, - contract: function(post) { - var bottom, cb, el, eventName, file, i, len, oldHeight, ref, ref1, scrollY, top, x; - file = post.file; - if (el = file.fullImage) { - top = Header.getTopOf(el); - bottom = top + el.getBoundingClientRect().height; - oldHeight = d.body.clientHeight; - scrollY = window.scrollY; - } - $.rmClass(post.nodes.root, 'expanded-image'); - $.rmClass(file.thumb, 'expanding'); - $.rm(file.videoControls); - file.thumbLink.href = file.url; - file.thumbLink.target = '_blank'; - ref = ['isExpanding', 'isExpanded', 'videoControls', 'wasPlaying', 'scrollIntoView']; - for (i = 0, len = ref.length; i < len; i++) { - x = ref[i]; - delete file[x]; - } - if (!el) { - return; - } - if (doc.contains(el)) { - if (bottom <= 0) { - window.scrollBy(0, scrollY - window.scrollY + d.body.clientHeight - oldHeight); - } else { - Header.scrollToIfNeeded(post.nodes.root); - } - if (window.scrollX > 0) { - window.scrollBy(-window.scrollX, 0); - } - } - $.off(el, 'error', ImageExpand.error); - ImageCommon.pushCache(el); - if (file.isVideo) { - ImageCommon.pause(el); - ref1 = ImageExpand.videoCB; - for (eventName in ref1) { - cb = ref1[eventName]; - $.off(el, eventName, cb); - } - } - if (Conf['Restart when Opened']) { - ImageCommon.rewind(file.thumb); - } - delete file.fullImage; - return $.queueTask(function() { - if (file.isExpanding || file.isExpanded) { - return; - } - $.rmClass(el, 'full-image'); - if (el.id) { - return; - } - return $.rm(el); - }); - }, - expand: function(post, src) { - var el, file, isVideo, ref, thumb, thumbLink; - file = post.file; - thumb = file.thumb, thumbLink = file.thumbLink, isVideo = file.isVideo; - if (post.isHidden || file.isExpanding || file.isExpanded) { - return; - } - $.addClass(thumb, 'expanding'); - file.isExpanding = true; - if (file.fullImage) { - el = file.fullImage; - } else if (((ref = ImageCommon.cache) != null ? ref.dataset.fileID : void 0) === (post.fullID + "." + file.index)) { - el = file.fullImage = ImageCommon.popCache(); - $.on(el, 'error', ImageExpand.error); - if (Conf['Restart when Opened'] && el.id !== 'ihover') { - ImageCommon.rewind(el); - } - el.removeAttribute('id'); - } else { - el = file.fullImage = $.el((isVideo ? 'video' : 'img')); - el.dataset.fileID = post.fullID + "." + file.index; - $.on(el, 'error', ImageExpand.error); - el.src = src || file.url; - } - el.className = 'full-image'; - $.after(thumb, el); - if (isVideo) { - if (!file.videoControls) { - file.videoControls = ImageExpand.videoControls.cloneNode(true); - $.add(file.text, file.videoControls); - } - thumbLink.removeAttribute('href'); - thumbLink.removeAttribute('target'); - el.loop = true; - Volume.setup(el); - ImageExpand.setupVideoCB(post); - } - if (!isVideo) { - return $.asap((function() { - return el.naturalHeight; - }), function() { - return ImageExpand.completeExpand(post); - }); - } else if (el.readyState >= el.HAVE_METADATA) { - return ImageExpand.completeExpand(post); - } else { - return $.on(el, 'loadedmetadata', function() { - return ImageExpand.completeExpand(post); - }); - } - }, - completeExpand: function(post) { - var bottom, file, imageBottom, oldHeight, scrollY; - file = post.file; - if (!file.isExpanding) { - return; - } - bottom = Header.getTopOf(file.thumb) + file.thumb.getBoundingClientRect().height; - oldHeight = d.body.clientHeight; - scrollY = window.scrollY; - $.addClass(post.nodes.root, 'expanded-image'); - $.rmClass(file.thumb, 'expanding'); - file.isExpanded = true; - delete file.isExpanding; - if (doc.contains(post.nodes.root) && bottom <= 0) { - window.scrollBy(0, scrollY - window.scrollY + d.body.clientHeight - oldHeight); - } - if (file.scrollIntoView) { - delete file.scrollIntoView; - imageBottom = Math.min(doc.clientHeight - file.fullImage.getBoundingClientRect().bottom - 25, Header.getBottomOf(file.fullImage)); - if (imageBottom < 0) { - window.scrollBy(0, Math.min(-imageBottom, Header.getTopOf(file.fullImage))); - } - } - if (file.isVideo) { - return ImageExpand.setupVideo(post, Conf['Autoplay'], Conf['Show Controls']); - } - }, - setupVideo: function(post, playing, controls) { - var fullImage; - fullImage = post.file.fullImage; - if (!playing) { - fullImage.controls = controls; - return; - } - fullImage.controls = false; - $.asap((function() { - return doc.contains(fullImage); - }), function() { - if (!d.hidden && Header.isNodeVisible(fullImage)) { - return fullImage.play(); - } else { - return post.file.wasPlaying = true; - } - }); - if (controls) { - return ImageCommon.addControls(fullImage); - } - }, - videoCB: (function() { - var mousedown; - mousedown = false; - return { - mouseover: function() { - return mousedown = false; - }, - mousedown: function(e) { - if (e.button === 0) { - return mousedown = true; - } - }, - mouseup: function(e) { - if (e.button === 0) { - return mousedown = false; - } - }, - mouseout: function(e) { - if (((e.buttons & 1) || mousedown) && e.clientX <= this.getBoundingClientRect().left) { - return ImageExpand.toggle(Get.postFromNode(this)); - } - } - }; - })(), - setupVideoCB: function(post) { - var cb, eventName, ref; - ref = ImageExpand.videoCB; - for (eventName in ref) { - cb = ref[eventName]; - $.on(post.file.fullImage, eventName, cb); - } - if (post.file.videoControls) { - return $.on(post.file.videoControls.firstElementChild, 'click', function() { - return ImageExpand.toggle(post); - }); - } - }, - error: function() { - var post; - post = Get.postFromNode(this); - $.rm(this); - delete post.file.fullImage; - if (!(post.file.isExpanding || post.file.isExpanded)) { - return; - } - if (ImageCommon.decodeError(this, post.file)) { - return ImageExpand.contract(post); - } - if (ImageCommon.isFromArchive(this)) { - return ImageExpand.contract(post); - } - return ImageCommon.error(this, post, post.file, 10 * $.SECOND, function(URL) { - if (post.file.isExpanding || post.file.isExpanded) { - ImageExpand.contract(post); - if (URL) { - return ImageExpand.expand(post, URL); - } - } - }); - }, - menu: { - init: function() { - var conf, createSubEntry, el, name, ref, subEntries; - if (!ImageExpand.enabled) { - return; - } - el = $.el('span', { - textContent: 'Image Expansion', - className: 'image-expansion-link' - }); - createSubEntry = ImageExpand.menu.createSubEntry; - subEntries = []; - ref = Config.imageExpansion; - for (name in ref) { - conf = ref[name]; - subEntries.push(createSubEntry(name, conf[1])); - } - return Header.menu.addEntry({ - el: el, - order: 105, - subEntries: subEntries - }); - }, - createSubEntry: function(name, desc) { - var input, label; - label = UI.checkbox(name, name); - label.title = desc; - input = label.firstElementChild; - if (name === 'Fit width' || name === 'Fit height') { - $.on(input, 'change', ImageExpand.cb.setFitness); - } - $.event('change', null, input); - $.on(input, 'change', $.cb.checked); - return { - el: label - }; - } - } - }; - - return ImageExpand; - -}).call(this); - -ImageHost = (function() { - var ImageHost; - - ImageHost = { - init: function() { - var ref; - if (!((this.useFaster = /\S/.test(Conf['fourchanImageHost'])) && g.SITE.software === 'yotsuba' && ((ref = g.VIEW) === 'index' || ref === 'thread'))) { - return; - } - return Callbacks.Post.push({ - name: 'Image Host Rewriting', - cb: this.node - }); - }, - suggestions: ['i.4cdn.org', 'is2.4chan.org'], - host: function() { - return Conf['fourchanImageHost'].trim() || 'i.4cdn.org'; - }, - flashHost: function() { - return 'i.4cdn.org'; - }, - thumbHost: function() { - return 'i.4cdn.org'; - }, - test: function(hostname) { - return hostname === 'i.4cdn.org' || ImageHost.regex.test(hostname); - }, - regex: /^is\d*\.4chan(?:nel)?\.org$/, - node: function() { - var host; - if (this.isClone) { - return; - } - host = ImageHost.host(); - if (this.file && ImageHost.test(this.file.url.split('/')[2]) && !/\.swf$/.test(this.file.url)) { - this.file.link.hostname = host; - if (this.file.thumbLink) { - this.file.thumbLink.hostname = host; - } - this.file.url = this.file.link.href; - } - return ImageHost.fixLinks($$('a', this.nodes.comment)); - }, - fixLinks: function(links) { - var host, i, len, link; - for (i = 0, len = links.length; i < len; i++) { - link = links[i]; - if (!(ImageHost.test(link.hostname) && !/\.swf$/.test(link.pathname))) { - continue; - } - host = ImageHost.host(); - if (link.hostname !== host) { - link.hostname = host; - } - } - } - }; - - return ImageHost; - -}).call(this); - -ImageHover = (function() { - var ImageHover; - - ImageHover = { - init: function() { - var ref; - if ((ref = g.VIEW) !== 'index' && ref !== 'thread') { - return; - } - if (Conf['Image Hover']) { - Callbacks.Post.push({ - name: 'Image Hover', - cb: this.node - }); - } - if (Conf['Image Hover in Catalog']) { - return Callbacks.CatalogThread.push({ - name: 'Image Hover', - cb: this.catalogNode - }); - } - }, - node: function() { - var file, i, len, ref, results; - ref = this.files; - results = []; - for (i = 0, len = ref.length; i < len; i++) { - file = ref[i]; - if ((file.isImage || file.isVideo) && file.thumb) { - results.push($.on(file.thumb, 'mouseover', ImageHover.mouseover(this, file))); - } - } - return results; - }, - catalogNode: function() { - var file; - file = this.thread.OP.files[0]; - if (!(file && (file.isImage || file.isVideo))) { - return; - } - return $.on(this.nodes.thumb, 'mouseover', ImageHover.mouseover(this.thread.OP, file)); - }, - mouseover: function(post, file) { - return function(e) { - var base, el, error, height, isVideo, maxHeight, maxWidth, ref, ref1, scale, width, x; - if (!doc.contains(this)) { - return; - } - isVideo = file.isVideo; - if (file.isExpanding || file.isExpanded || (typeof (base = g.SITE).isThumbExpanded === "function" ? base.isThumbExpanded(file) : void 0)) { - return; - } - error = ImageHover.error(post, file); - if (((ref = ImageCommon.cache) != null ? ref.dataset.fileID : void 0) === (post.fullID + "." + file.index)) { - el = ImageCommon.popCache(); - $.on(el, 'error', error); - } else { - el = $.el((isVideo ? 'video' : 'img')); - el.dataset.fileID = post.fullID + "." + file.index; - $.on(el, 'error', error); - el.src = file.url; - } - if (Conf['Restart when Opened']) { - ImageCommon.rewind(el); - ImageCommon.rewind(this); - } - el.id = 'ihover'; - $.add(Header.hover, el); - if (isVideo) { - el.loop = true; - el.controls = false; - Volume.setup(el); - if (Conf['Autoplay']) { - el.play(); - if (this.nodeName === 'VIDEO') { - this.currentTime = el.currentTime; - } - } - } - if (file.dimensions) { - ref1 = (function() { - var i, len, ref1, results; - ref1 = file.dimensions.split('x'); - results = []; - for (i = 0, len = ref1.length; i < len; i++) { - x = ref1[i]; - results.push(+x); - } - return results; - })(), width = ref1[0], height = ref1[1]; - maxWidth = doc.clientWidth; - maxHeight = doc.clientHeight - UI.hover.padding; - scale = Math.min(1, maxWidth / width, maxHeight / height); - width *= scale; - height *= scale; - el.style.maxWidth = width + "px"; - el.style.maxHeight = height + "px"; - } - return UI.hover({ - root: this, - el: el, - latestEvent: e, - endEvents: 'mouseout click', - height: height, - width: width, - noRemove: true, - cb: function() { - $.off(el, 'error', error); - ImageCommon.pushCache(el); - ImageCommon.pause(el); - $.rm(el); - return el.removeAttribute('style'); - } - }); - }; - }, - error: function(post, file) { - return function() { - if (ImageCommon.decodeError(this, file)) { - return; - } - return ImageCommon.error(this, post, file, 3 * $.SECOND, (function(_this) { - return function(URL) { - if (URL) { - return _this.src = URL + (_this.src === URL ? '?' + Date.now() : ''); - } else { - return $.rm(_this); - } - }; - })(this)); - }; - } - }; - - return ImageHover; - -}).call(this); - -ImageLoader = (function() { - var ImageLoader, - slice = [].slice; - - ImageLoader = { - init: function() { - var el, ref, ref1, replace; - if ((ref = g.VIEW) !== 'index' && ref !== 'thread' && ref !== 'archive') { - return; - } - replace = Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM']; - if (!(Conf['Image Prefetching'] || replace)) { - return; - } - Callbacks.Post.push({ - name: 'Image Replace', - cb: this.node - }); - $.on(d, 'PostsInserted', function() { - if (ImageLoader.prefetchEnabled || replace) { - return g.posts.forEach(ImageLoader.prefetchAll); - } - }); - if (Conf['Replace WEBM']) { - $.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', this.playVideos); - } - if (!(Conf['Image Prefetching'] && ((ref1 = g.VIEW) === 'index' || ref1 === 'thread'))) { - return; - } - el = $.el('a', { - href: 'javascript:;', - title: 'Prefetch Images', - className: 'fa fa-bolt disabled', - textContent: 'Prefetch' - }); - $.on(el, 'click', this.toggle); - return Header.addShortcut('prefetch', el, 525); - }, - node: function() { - var file, i, len, ref; - if (this.isClone) { - return; - } - ref = this.files; - for (i = 0, len = ref.length; i < len; i++) { - file = ref[i]; - if (Conf['Replace WEBM'] && file.isVideo) { - ImageLoader.replaceVideo(this, file); - } - ImageLoader.prefetch(this, file); - } - }, - replaceVideo: function(post, file) { - var attr, i, len, ref, thumb, video; - thumb = file.thumb; - video = $.el('video', { - preload: 'none', - loop: true, - muted: true, - poster: thumb.src || thumb.dataset.src, - textContent: thumb.alt, - className: thumb.className - }); - video.setAttribute('muted', 'muted'); - video.dataset.md5 = thumb.dataset.md5; - ref = ['height', 'width', 'maxHeight', 'maxWidth']; - for (i = 0, len = ref.length; i < len; i++) { - attr = ref[i]; - video.style[attr] = thumb.style[attr]; - } - video.src = file.url; - $.replace(thumb, video); - file.thumb = video; - return file.videoThumb = true; - }, - prefetch: function(post, file) { - var clone, el, i, isImage, isVideo, len, ref, ref1, replace, thumb, type, url; - isImage = file.isImage, isVideo = file.isVideo, thumb = file.thumb, url = file.url; - if (file.isPrefetched || !(isImage || isVideo) || post.isHidden || post.thread.isHidden) { - return; - } - if (isVideo) { - type = 'WEBM'; - } else { - type = (ref = url.match(/\.([^.]+)$/)) != null ? ref[1].toUpperCase() : void 0; - if (type === 'JPEG') { - type = 'JPG'; - } - } - replace = Conf["Replace " + type] && !/spoiler/.test(thumb.src || thumb.dataset.src); - if (!(replace || ImageLoader.prefetchEnabled)) { - return; - } - if ($.hasClass(doc, 'catalog-mode')) { - return; - } - if (![post].concat(slice.call(post.clones)).some(function(clone) { - return doc.contains(clone.nodes.root); - })) { - return; - } - file.isPrefetched = true; - if (file.videoThumb) { - ref1 = post.clones; - for (i = 0, len = ref1.length; i < len; i++) { - clone = ref1[i]; - clone.file.thumb.preload = 'auto'; - } - thumb.preload = 'auto'; - if ($.engine === 'gecko') { - $.on(thumb, 'loadeddata', function() { - return this.removeAttribute('poster'); - }); - } - return; - } - el = $.el(isImage ? 'img' : 'video'); - if (isVideo) { - el.preload = 'auto'; - } - if (replace && isImage) { - $.on(el, 'load', function() { - var j, len1, ref2; - ref2 = post.clones; - for (j = 0, len1 = ref2.length; j < len1; j++) { - clone = ref2[j]; - clone.file.thumb.src = url; - } - return thumb.src = url; - }); - } - return el.src = url; - }, - prefetchAll: function(post) { - var file, i, len, ref; - ref = post.files; - for (i = 0, len = ref.length; i < len; i++) { - file = ref[i]; - ImageLoader.prefetch(post, file); - } - }, - toggle: function() { - ImageLoader.prefetchEnabled = !ImageLoader.prefetchEnabled; - this.classList.toggle('disabled', !ImageLoader.prefetchEnabled); - if (ImageLoader.prefetchEnabled) { - g.posts.forEach(ImageLoader.prefetchAll); - } - }, - playVideos: function() { - var qpClone, ref; - qpClone = (ref = $.id('qp')) != null ? ref.firstElementChild : void 0; - return g.posts.forEach(function(post) { - var file, i, j, len, len1, ref1, ref2, thumb; - ref1 = [post].concat(slice.call(post.clones)); - for (i = 0, len = ref1.length; i < len; i++) { - post = ref1[i]; - ref2 = post.files; - for (j = 0, len1 = ref2.length; j < len1; j++) { - file = ref2[j]; - if (!file.videoThumb) { - continue; - } - thumb = file.thumb; - if (Header.isNodeVisible(thumb) || post.nodes.root === qpClone) { - thumb.play(); - } else { - thumb.pause(); - } - } - } - }); - } - }; - - return ImageLoader; - -}).call(this); - -Metadata = (function() { - var Metadata; - - Metadata = { - init: function() { - var ref; - if (!(Conf['WEBM Metadata'] && ((ref = g.VIEW) === 'index' || ref === 'thread'))) { - return; - } - return Callbacks.Post.push({ - name: 'WEBM Metadata', - cb: this.node - }); - }, - node: function() { - var el, file, i, j, len1, ref; - ref = this.files; - for (i = j = 0, len1 = ref.length; j < len1; i = ++j) { - file = ref[i]; - if (!(/webm$/i.test(file.url))) { - continue; - } - if (this.isClone) { - el = $('.webm-title', file.text); - } else { - el = $.el('span', { - className: 'webm-title' - }); - el.dataset.index = i; - $.extend(el, {innerHTML: ""}); - $.add(file.text, [$.tn(' '), el]); - } - if (el.children.length === 1) { - $.one(el.lastElementChild, 'mouseover focus', Metadata.load); - } - } - }, - load: function() { - var index; - $.rmClass(this.parentNode, 'error'); - $.addClass(this.parentNode, 'loading'); - index = this.parentNode.dataset.index; - return CrossOrigin.binary(Get.postFromNode(this).files[+index].url, (function(_this) { - return function(data) { - var output, title; - $.rmClass(_this.parentNode, 'loading'); - if (data != null) { - title = Metadata.parse(data); - output = $.el('span', { - textContent: title || '' - }); - if (title == null) { - $.addClass(_this.parentNode, 'not-found'); - } - $.before(_this, output); - _this.parentNode.tabIndex = 0; - if (d.activeElement === _this) { - _this.parentNode.focus(); - } - return _this.tabIndex = -1; - } else { - $.addClass(_this.parentNode, 'error'); - return $.one(_this, 'click', Metadata.load); - } - }; - })(this), { - Range: 'bytes=0-9999' - }); - }, - parse: function(data) { - var element, i, readInt, size, title; - readInt = function() { - var len, n; - n = data[i++]; - len = 0; - while (n < (0x80 >> len)) { - len++; - } - n ^= 0x80 >> len; - while (len-- && i < data.length) { - n = (n << 8) ^ data[i++]; - } - return n; - }; - i = 0; - while (i < data.length) { - element = readInt(); - size = readInt(); - if (element === 0x3BA9) { - title = ''; - while (size-- && i < data.length) { - title += String.fromCharCode(data[i++]); - } - return decodeURIComponent(escape(title)); - } else if (element !== 0x8538067 && element !== 0x549A966) { - i += size; - } - } - return null; - } - }; - - return Metadata; - -}).call(this); - -RevealSpoilers = (function() { - var RevealSpoilers; - - RevealSpoilers = { - init: function() { - var ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive') && Conf['Reveal Spoiler Thumbnails'])) { - return; - } - return Callbacks.Post.push({ - name: 'Reveal Spoiler Thumbnails', - cb: this.node - }); - }, - node: function() { - var file, i, len, ref, thumb; - if (this.isClone) { - return; - } - ref = this.files; - for (i = 0, len = ref.length; i < len; i++) { - file = ref[i]; - if (!(file.thumb && file.isSpoiler)) { - continue; - } - thumb = file.thumb; - thumb.removeAttribute('style'); - thumb.style.maxHeight = thumb.style.maxWidth = this.isReply ? '125px' : '250px'; - if (thumb.src) { - thumb.src = file.thumbURL; - } else { - thumb.dataset.src = file.thumbURL; - } - } - } - }; - - return RevealSpoilers; - -}).call(this); - -Sauce = (function() { - var Sauce, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Sauce = { - init: function() { - var j, len, link, linkData, links, ref, ref1; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Sauce'])) { - return; - } - $.addClass(doc, 'show-sauce'); - links = []; - ref1 = Conf['sauces'].split('\n'); - for (j = 0, len = ref1.length; j < len; j++) { - link = ref1[j]; - if (link[0] !== '#' && (linkData = this.parseLink(link))) { - links.push(linkData); - } - } - if (!links.length) { - return; - } - this.links = links; - this.link = $.el('a', { - target: '_blank', - className: 'sauce' - }); - return Callbacks.Post.push({ - name: 'Sauce', - cb: this.node - }); - }, - parseLink: function(link) { - var err, i, j, len, m, part, parts, ref, ref1, regexp; - if (!(link = link.trim())) { - return null; - } - parts = $.dict(); - ref = link.split(/;(?=(?:text|boards|types|regexp|sandbox):?)/); - for (i = j = 0, len = ref.length; j < len; i = ++j) { - part = ref[i]; - if (i === 0) { - parts['url'] = part; - } else { - m = part.match(/^(\w*):?(.*)$/); - parts[m[1]] = m[2]; - } - } - parts['text'] || (parts['text'] = ((ref1 = parts['url'].match(/(\w+)\.\w+\//)) != null ? ref1[1] : void 0) || '?'); - if ('boards' in parts) { - parts['boards'] = Filter.parseBoards(parts['boards']); - } - if ('regexp' in parts) { - try { - if ((regexp = parts['regexp'].match(/^\/(.*)\/(\w*)$/))) { - parts['regexp'] = RegExp(regexp[1], regexp[2]); - } else { - parts['regexp'] = RegExp(parts['regexp']); - } - } catch (error) { - err = error; - new Notice('warning', [$.tn("Invalid regexp for Sauce link:"), $.el('br'), $.tn(link), $.el('br'), $.tn(err.message)], 60); - return null; - } - } - return parts; - }, - createSauceLink: function(link, post, file) { - var a, base, ext, j, key, len, matches, missing, parts, ref; - ext = file.url.match(/[^.]*$/)[0]; - parts = $.dict(); - $.extend(parts, link); - if (!(!parts['boards'] || parts['boards'][post.siteID + "/" + post.boardID] || parts['boards'][post.siteID + "/*"])) { - return null; - } - if (!(!parts['types'] || indexOf.call(parts['types'].split(','), ext) >= 0)) { - return null; - } - if (!(!parts['regexp'] || (matches = file.name.match(parts['regexp'])))) { - return null; - } - missing = []; - ref = ['url', 'text']; - for (j = 0, len = ref.length; j < len; j++) { - key = ref[j]; - parts[key] = parts[key].replace(/%(T?URL|IMG|[sh]?MD5|board|name|%|semi|\$\d+)/g, function(orig, parameter) { - var type; - if (parameter[0] === '$') { - if (!matches) { - return orig; - } - type = matches[parameter.slice(1)] || ''; - } else { - type = Sauce.formatters[parameter](post, file, ext); - if (type == null) { - missing.push(parameter); - return ''; - } - } - if (key === 'url' && (parameter !== '%' && parameter !== 'semi')) { - if (/^javascript:/i.test(parts['url'])) { - type = JSON.stringify(type); - } - type = encodeURIComponent(type); - } - return type; - }); - } - if ((typeof (base = g.SITE).areMD5sDeferred === "function" ? base.areMD5sDeferred(post.board) : void 0) && missing.length && !missing.filter(function(x) { - return !/^.?MD5$/.test(x); - }).length) { - a = Sauce.link.cloneNode(false); - a.dataset.skip = '1'; - return a; - } - if (missing.length) { - return null; - } - a = Sauce.link.cloneNode(false); - a.href = parts['url']; - a.textContent = parts['text']; - if (/^javascript:/i.test(parts['url'])) { - a.removeAttribute('target'); - } - return a; - }, - node: function() { - var file, j, len, ref; - if (this.isClone) { - return; - } - ref = this.files; - for (j = 0, len = ref.length; j < len; j++) { - file = ref[j]; - Sauce.file(this, file); - } - }, - file: function(post, file) { - var j, len, link, node, nodes, observer, ref, skipped; - nodes = []; - skipped = []; - ref = Sauce.links; - for (j = 0, len = ref.length; j < len; j++) { - link = ref[j]; - if ((node = Sauce.createSauceLink(link, post, file))) { - nodes.push($.tn(' '), node); - if (node.dataset.skip) { - skipped.push([link, node]); - } - } - } - $.add(file.text, nodes); - if (skipped.length) { - observer = new MutationObserver(function() { - var k, len1, node2, ref1; - if (file.text.dataset.md5) { - for (k = 0, len1 = skipped.length; k < len1; k++) { - ref1 = skipped[k], link = ref1[0], node = ref1[1]; - if ((node2 = Sauce.createSauceLink(link, post, file))) { - $.replace(node, node2); - } - } - return observer.disconnect(); - } - }); - return observer.observe(file.text, { - attributes: true - }); - } - }, - formatters: { - TURL: function(post, file) { - return file.thumbURL; - }, - URL: function(post, file) { - return file.url; - }, - IMG: function(post, file, ext) { - if (ext === 'gif' || ext === 'jpg' || ext === 'jpeg' || ext === 'png') { - return file.url; - } else { - return file.thumbURL; - } - }, - MD5: function(post, file) { - return file.MD5; - }, - sMD5: function(post, file) { - var ref; - return (ref = file.MD5) != null ? ref.replace(/[+\/=]/g, function(c) { - return { - '+': '-', - '/': '_', - '=': '' - }[c]; - }) : void 0; - }, - hMD5: function(post, file) { - var c; - if (file.MD5) { - return ((function() { - var j, len, ref, results; - ref = atob(file.MD5); - results = []; - for (j = 0, len = ref.length; j < len; j++) { - c = ref[j]; - results.push(("0" + (c.charCodeAt(0).toString(16))).slice(-2)); - } - return results; - })()).join(''); - } - }, - board: function(post) { - return post.board.ID; - }, - name: function(post, file) { - return file.name; - }, - '%': function() { - return '%'; - }, - semi: function() { - return ';'; - } - } - }; - - return Sauce; - -}).call(this); - -Volume = (function() { - var Volume; - - Volume = { - init: function() { - var base, ref, unmuteEntry, volumeEntry; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Image Expansion'] || Conf['Image Hover'] || Conf['Image Hover in Catalog'] || Conf['Gallery']))) { - return; - } - $.sync('Allow Sound', function(x) { - var ref1; - Conf['Allow Sound'] = x; - return (ref1 = Volume.inputs) != null ? ref1.unmute.checked = x : void 0; - }); - $.sync('Default Volume', function(x) { - var ref1; - Conf['Default Volume'] = x; - return (ref1 = Volume.inputs) != null ? ref1.volume.value = x : void 0; - }); - if (Conf['Mouse Wheel Volume']) { - Callbacks.Post.push({ - name: 'Mouse Wheel Volume', - cb: this.node - }); - } - if (typeof (base = g.SITE).noAudio === "function" ? base.noAudio(g.BOARD) : void 0) { - return; - } - if (Conf['Mouse Wheel Volume']) { - Callbacks.CatalogThread.push({ - name: 'Mouse Wheel Volume', - cb: this.catalogNode - }); - } - unmuteEntry = UI.checkbox('Allow Sound', 'Allow Sound'); - unmuteEntry.title = Config.main['Images and Videos']['Allow Sound'][1]; - volumeEntry = $.el('label', { - title: 'Default volume for videos.' - }); - $.extend(volumeEntry, {innerHTML: " Volume"}); - this.inputs = { - unmute: unmuteEntry.firstElementChild, - volume: volumeEntry.firstElementChild - }; - $.on(this.inputs.unmute, 'change', $.cb.checked); - $.on(this.inputs.volume, 'change', $.cb.value); - Header.menu.addEntry({ - el: unmuteEntry, - order: 200 - }); - return Header.menu.addEntry({ - el: volumeEntry, - order: 201 - }); - }, - setup: function(video) { - video.muted = !Conf['Allow Sound']; - video.volume = Conf['Default Volume']; - return $.on(video, 'volumechange', Volume.change); - }, - change: function() { - var items, key, muted, ref, val, volume; - ref = this, muted = ref.muted, volume = ref.volume; - items = { - 'Allow Sound': !muted, - 'Default Volume': volume - }; - for (key in items) { - val = items[key]; - if (Conf[key] === val) { - delete items[key]; - } - } - $.set(items); - $.extend(Conf, items); - if (Volume.inputs) { - Volume.inputs.unmute.checked = !muted; - return Volume.inputs.volume.value = volume; - } - }, - node: function() { - var base, file, i, len, ref; - if (typeof (base = g.SITE).noAudio === "function" ? base.noAudio(this.board) : void 0) { - return; - } - ref = this.files; - for (i = 0, len = ref.length; i < len; i++) { - file = ref[i]; - if (!file.isVideo) { - continue; - } - if (file.thumb) { - $.on(file.thumb, 'wheel', Volume.wheel.bind(Header.hover)); - } - $.on($('.file-info', file.text) || file.link, 'wheel', Volume.wheel.bind(file.thumbLink)); - } - }, - catalogNode: function() { - var file; - file = this.thread.OP.files[0]; - if (!(file != null ? file.isVideo : void 0)) { - return; - } - return $.on(this.nodes.thumb, 'wheel', Volume.wheel.bind(Header.hover)); - }, - wheel: function(e) { - var el, volume; - if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) { - return; - } - if (!(el = $('video:not([data-md5])', this))) { - return; - } - if (el.muted || !$.hasAudio(el)) { - return; - } - volume = el.volume + 0.1; - if (e.deltaY < 0) { - volume *= 1.1; - } - if (e.deltaY > 0) { - volume /= 1.1; - } - el.volume = $.minmax(volume - 0.1, 0, 1); - return e.preventDefault(); - } - }; - - return Volume; - -}).call(this); - -Embedding = (function() { - var Embedding, - slice = [].slice; - - Embedding = { - init: function() { - var j, len, ref, ref1, type; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive') && Conf['Linkify'] && (Conf['Embedding'] || Conf['Link Title'] || Conf['Cover Preview']))) { - return; - } - this.types = $.dict(); - ref1 = this.ordered_types; - for (j = 0, len = ref1.length; j < len; j++) { - type = ref1[j]; - this.types[type.key] = type; - } - if (Conf['Embedding'] && g.VIEW !== 'archive') { - this.dialog = UI.dialog('embedding', {innerHTML: "
    "}); - this.media = $('#media-embed', this.dialog); - $.one(d, '4chanXInitFinished', this.ready); - $.on(d, 'IndexRefreshInternal', function() { - return g.posts.forEach(function(post) { - var embed, k, l, len1, len2, ref2, ref3; - ref2 = [post].concat(slice.call(post.clones)); - for (k = 0, len1 = ref2.length; k < len1; k++) { - post = ref2[k]; - ref3 = post.nodes.embedlinks; - for (l = 0, len2 = ref3.length; l < len2; l++) { - embed = ref3[l]; - Embedding.cb.catalogRemove.call(embed); - } - } - }); - }); - } - if (Conf['Link Title']) { - return $.on(d, '4chanXInitFinished PostsInserted', function() { - var key, ref2, ref3, service; - ref2 = Embedding.types; - for (key in ref2) { - service = ref2[key]; - if ((ref3 = service.title) != null ? ref3.batchSize : void 0) { - Embedding.flushTitles(service.title); - } - } - }); - } - }, - events: function(post) { - var data, el, i, items; - if (g.VIEW === 'archive') { - return; - } - if (Conf['Embedding']) { - i = 0; - items = post.nodes.embedlinks = $$('.embedder', post.nodes.comment); - while (el = items[i++]) { - $.on(el, 'click', Embedding.cb.click); - if ($.hasClass(el, 'embedded')) { - Embedding.cb.toggle.call(el); - } - } - } - if (Conf['Cover Preview']) { - i = 0; - items = $$('.linkify', post.nodes.comment); - while (el = items[i++]) { - if ((data = Embedding.services(el))) { - Embedding.preview(data); - } - } - } - }, - process: function(link, post) { - var data; - if (!(Conf['Embedding'] || Conf['Link Title'] || Conf['Cover Preview'])) { - return; - } - if ($.x('ancestor::pre', link)) { - return; - } - if (data = Embedding.services(link)) { - data.post = post; - if (Conf['Embedding'] && g.VIEW !== 'archive') { - Embedding.embed(data); - } - if (Conf['Link Title']) { - Embedding.title(data); - } - if (Conf['Cover Preview'] && g.VIEW !== 'archive') { - return Embedding.preview(data); - } - } - }, - services: function(link) { - var href, j, len, match, ref, type; - href = link.href; - ref = Embedding.ordered_types; - for (j = 0, len = ref.length; j < len; j++) { - type = ref[j]; - if ((match = type.regExp.exec(href))) { - return { - key: type.key, - uid: match[1], - options: match[2], - link: link - }; - } - } - }, - embed: function(data) { - var embed, href, key, link, name, options, post, ref, uid, value; - key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post; - href = link.href; - $.addClass(link, key.toLowerCase()); - embed = $.el('a', { - className: 'embedder', - href: 'javascript:;' - }, {innerHTML: "(unembed)"}); - ref = { - key: key, - uid: uid, - options: options, - href: href - }; - for (name in ref) { - value = ref[name]; - embed.dataset[name] = value; - } - $.on(embed, 'click', Embedding.cb.click); - $.after(link, [$.tn(' '), embed]); - post.nodes.embedlinks.push(embed); - if (Conf['Auto-embed'] && !Conf['Floating Embeds'] && !post.isFetchedQuote) { - if ($.hasClass(doc, 'catalog-mode')) { - return $.addClass(embed, 'embed-removed'); - } else { - return Embedding.cb.toggle.call(embed); - } - } - }, - ready: function() { - if (!Main.isThisPageLegit()) { - return; - } - $.addClass(Embedding.dialog, 'empty'); - $.on($('.close', Embedding.dialog), 'click', Embedding.closeFloat); - $.on($('.move', Embedding.dialog), 'mousedown', Embedding.dragEmbed); - $.on($('.jump', Embedding.dialog), 'click', function() { - if (doc.contains(Embedding.lastEmbed)) { - return Header.scrollTo(Embedding.lastEmbed); - } - }); - return $.add(d.body, Embedding.dialog); - }, - closeFloat: function() { - delete Embedding.lastEmbed; - $.addClass(Embedding.dialog, 'empty'); - return $.replace(Embedding.media.firstChild, $.el('div')); - }, - dragEmbed: function() { - var style; - style = Embedding.media.style; - if (Embedding.dragEmbed.mouseup) { - $.off(d, 'mouseup', Embedding.dragEmbed); - Embedding.dragEmbed.mouseup = false; - style.pointerEvents = ''; - return; - } - $.on(d, 'mouseup', Embedding.dragEmbed); - Embedding.dragEmbed.mouseup = true; - return style.pointerEvents = 'none'; - }, - title: function(data) { - var key, link, options, post, service, uid; - key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post; - if (!(service = Embedding.types[key].title)) { - return; - } - $.addClass(link, key.toLowerCase()); - if (service.batchSize) { - (service.queue || (service.queue = [])).push(data); - if (service.queue.length >= service.batchSize) { - return Embedding.flushTitles(service); - } - } else { - return CrossOrigin.cache(service.api(uid), (function() { - return Embedding.cb.title(this, data); - })); - } - }, - flushTitles: function(service) { - var cb, data, queue; - queue = service.queue; - if (!(queue != null ? queue.length : void 0)) { - return; - } - service.queue = []; - cb = function() { - var data, j, len; - for (j = 0, len = queue.length; j < len; j++) { - data = queue[j]; - Embedding.cb.title(this, data); - } - }; - return CrossOrigin.cache(service.api((function() { - var j, len, results; - results = []; - for (j = 0, len = queue.length; j < len; j++) { - data = queue[j]; - results.push(data.uid); - } - return results; - })()), cb); - }, - preview: function(data) { - var key, link, service, uid; - key = data.key, uid = data.uid, link = data.link; - if (!(service = Embedding.types[key].preview)) { - return; - } - return $.on(link, 'mouseover', function(e) { - var el, height, src; - src = service.url(uid); - height = service.height; - el = $.el('img', { - src: src, - id: 'ihover' - }); - $.add(Header.hover, el); - return UI.hover({ - root: link, - el: el, - latestEvent: e, - endEvents: 'mouseout click', - height: height - }); - }); - }, - cb: { - click: function(e) { - var div; - e.preventDefault(); - if (!$.hasClass(this, 'embedded') && (Conf['Floating Embeds'] || $.hasClass(doc, 'catalog-mode'))) { - if (!(div = Embedding.media.firstChild)) { - return; - } - $.replace(div, Embedding.cb.embed(this)); - Embedding.lastEmbed = Get.postFromNode(this).nodes.root; - return $.rmClass(Embedding.dialog, 'empty'); - } else { - return Embedding.cb.toggle.call(this); - } - }, - toggle: function() { - if ($.hasClass(this, "embedded")) { - $.rm(this.nextElementSibling); - } else { - $.after(this, Embedding.cb.embed(this)); - } - return $.toggleClass(this, 'embedded'); - }, - embed: function(a) { - var container, el, type; - container = $.el('div', { - className: 'media-embed' - }); - $.add(container, el = (type = Embedding.types[a.dataset.key]).el(a)); - el.style.cssText = type.style != null ? type.style : 'border: none; width: 640px; height: 360px;'; - return container; - }, - catalogRemove: function() { - var isCatalog; - isCatalog = $.hasClass(doc, 'catalog-mode'); - if ((isCatalog && $.hasClass(this, 'embedded')) || (!isCatalog && $.hasClass(this, 'embed-removed'))) { - Embedding.cb.toggle.call(this); - return $.toggleClass(this, 'embed-removed'); - } - }, - title: function(req, data) { - var base1, j, k, key, len, len1, link, link2, options, post, post2, ref, ref1, service, status, text, uid; - key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post; - service = Embedding.types[key].title; - status = req.status; - if ((status === 200 || status === 304) && service.status) { - status = service.status(req.response)[0]; - } - if (!status) { - return; - } - text = "[" + key + "] " + ((function() { - switch (status) { - case 200: - case 304: - text = service.text(req.response, uid); - if (typeof text === 'string') { - return text; - } else { - return text = link.textContent; - } - break; - case 404: - return "Not Found"; - case 403: - case 401: - return "Forbidden or Private"; - default: - return status + "'d"; - } - })()); - link.dataset.original = link.textContent; - link.textContent = text; - ref = post.clones; - for (j = 0, len = ref.length; j < len; j++) { - post2 = ref[j]; - ref1 = $$('a.linkify', post2.nodes.comment); - for (k = 0, len1 = ref1.length; k < len1; k++) { - link2 = ref1[k]; - if (!(link2.href === link.href)) { - continue; - } - if ((base1 = link2.dataset).original == null) { - base1.original = link2.textContent; - } - link2.textContent = text; - } - } - } - }, - ordered_types: [ - { - key: 'audio', - regExp: /^[^?#]+\.(?:mp3|m4a|oga|wav|flac)(?:[?#]|$)/i, - style: '', - el: function(a) { - return $.el('audio', { - controls: true, - preload: 'auto', - src: a.dataset.href - }); - } - }, { - key: 'image', - regExp: /^[^?#]+\.(?:gif|png|jpg|jpeg|bmp|webp)(?::\w+)?(?:[?#]|$)/i, - style: '', - el: function(a) { - return $.el('div', {innerHTML: ""}); - } - }, { - key: 'video', - regExp: /^[^?#]+\.(?:og[gv]|webm|mp4)(?:[?#]|$)/i, - style: 'max-width: 80vw; max-height: 80vh;', - el: function(a) { - var el; - el = $.el('video', { - hidden: true, - controls: true, - preload: 'auto', - src: a.dataset.href, - loop: ImageHost.test(a.dataset.href.split('/')[2]) - }); - $.on(el, 'loadedmetadata', function() { - if (el.videoHeight === 0 && el.parentNode) { - return $.replace(el, Embedding.types.audio.el(a)); - } else { - return el.hidden = false; - } - }); - return el; - } - }, { - key: 'PeerTube', - regExp: /^(\w+:\/\/[^\/]+\/videos\/watch\/\w{8}-\w{4}-\w{4}-\w{4}-\w{12})(.*)/, - el: function(a) { - var el, options, start; - options = (start = a.dataset.options.match(/[?&](start=\w+)/)) ? "?" + start[1] : ''; - el = $.el('iframe', { - src: a.dataset.uid.replace('/videos/watch/', '/videos/embed/') + options - }); - el.setAttribute("allowfullscreen", "true"); - return el; - } - }, { - key: 'BitChute', - regExp: /^\w+:\/\/(?:www\.)?bitchute\.com\/video\/([\w\-]+)/, - el: function(a) { - var el; - el = $.el('iframe', { - src: "https://www.bitchute.com/embed/" + a.dataset.uid + "/" - }); - el.setAttribute("allowfullscreen", "true"); - return el; - } - }, { - key: 'Clyp', - regExp: /^\w+:\/\/(?:www\.)?clyp\.it\/(\w{8})/, - style: 'border: 0; width: 640px; height: 160px;', - el: function(a) { - return $.el('iframe', { - src: "https://clyp.it/" + a.dataset.uid + "/widget" - }); - }, - title: { - api: function(uid) { - return "https://api.clyp.it/oembed?url=https://clyp.it/" + uid; - }, - text: function(_) { - return _.title; - } - } - }, { - key: 'Dailymotion', - regExp: /^\w+:\/\/(?:(?:www\.)?dailymotion\.com\/(?:embed\/)?video|dai\.ly)\/([A-Za-z0-9]+)[^?]*(.*)/, - el: function(a) { - var el, options, start; - options = (start = a.dataset.options.match(/[?&](start=\d+)/)) ? "?" + start[1] : ''; - el = $.el('iframe', { - src: "//www.dailymotion.com/embed/video/" + a.dataset.uid + options - }); - el.setAttribute("allowfullscreen", "true"); - return el; - }, - title: { - api: function(uid) { - return "https://api.dailymotion.com/video/" + uid; - }, - text: function(_) { - return _.title; - } - }, - preview: { - url: function(uid) { - return "https://www.dailymotion.com/thumbnail/video/" + uid; - }, - height: 240 - } - }, { - key: 'Gfycat', - regExp: /^\w+:\/\/(?:www\.)?gfycat\.com\/(?:iframe\/)?(\w+)/, - el: function(a) { - var el; - el = $.el('iframe', { - src: "//gfycat.com/ifr/" + a.dataset.uid - }); - el.setAttribute("allowfullscreen", "true"); - return el; - } - }, { - key: 'Gist', - regExp: /^\w+:\/\/gist\.github\.com\/[\w\-]+\/(\w+)/, - style: '', - el: (function() { - var counter; - counter = 0; - return function(a) { - var el; - el = $.el('pre', { - hidden: true, - id: "gist-embed-" + (counter++) - }); - CrossOrigin.cache("https://api.github.com/gists/" + a.dataset.uid, function() { - el.textContent = Object.values(this.response.files)[0].content; - el.className = 'prettyprint'; - $.global(function() { - return typeof window.prettyPrint === "function" ? window.prettyPrint((function() {}), document.getElementById(document.currentScript.dataset.id).parentNode) : void 0; - }, { - id: el.id - }); - return el.hidden = false; - }); - return el; - }; - })(), - title: { - api: function(uid) { - return "https://api.github.com/gists/" + uid; - }, - text: function(arg) { - var file, files; - files = arg.files; - for (file in files) { - if (files.hasOwnProperty(file)) { - return file; - } - } - } - } - }, { - key: 'InstallGentoo', - regExp: /^\w+:\/\/paste\.installgentoo\.com\/view\/(?:raw\/|download\/|embed\/)?(\w+)/, - el: function(a) { - return $.el('iframe', { - src: "https://paste.installgentoo.com/view/embed/" + a.dataset.uid - }); - } - }, { - key: 'LiveLeak', - regExp: /^\w+:\/\/(?:\w+\.)?liveleak\.com\/.*\?.*[tif]=(\w+)/, - el: function(a) { - var el; - el = $.el('iframe', { - src: "https://www.liveleak.com/e/" + a.dataset.uid - }); - el.setAttribute("allowfullscreen", "true"); - return el; - } - }, { - key: 'Loopvid', - regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/#?((?:pf|kd|lv|gd|gh|db|dx|nn|cp|wu|ig|ky|mf|m2|pc|1c|pi|ni|wl|ko|mm|ic|gc)\/[\w\-\/]+(?:,[\w\-\/]+)*|fc\/\w+\/\d+|https?:\/\/.+)/, - style: 'max-width: 80vw; max-height: 80vh;', - el: function(a) { - var _, base, el, host, j, k, l, len, len1, len2, name, names, ref, ref1, type, types, url, urls; - el = $.el('video', { - controls: true, - preload: 'auto', - loop: true - }); - if (/^http/.test(a.dataset.uid)) { - $.add(el, $.el('source', { - src: a.dataset.uid - })); - return el; - } - ref = a.dataset.uid.match(/(\w+)\/(.*)/), _ = ref[0], host = ref[1], names = ref[2]; - types = (function() { - switch (host) { - case 'gd': - case 'wu': - case 'fc': - return ['']; - case 'gc': - return ['giant', 'fat', 'zippy']; - default: - return ['.webm', '.mp4']; - } - })(); - ref1 = names.split(','); - for (j = 0, len = ref1.length; j < len; j++) { - name = ref1[j]; - for (k = 0, len1 = types.length; k < len1; k++) { - type = types[k]; - base = "" + name + type; - urls = (function() { - switch (host) { - case 'pf': - return ["https://kastden.org/_loopvid_media/pf/" + base, "https://web.archive.org/web/2/http://a.pomf.se/" + base]; - case 'kd': - return ["https://kastden.org/loopvid/" + base]; - case 'lv': - return ["https://lv.kastden.org/" + base]; - case 'gd': - return ["https://docs.google.com/uc?export=download&id=" + base]; - case 'gh': - return ["https://googledrive.com/host/" + base]; - case 'db': - return ["https://dl.dropboxusercontent.com/u/" + base]; - case 'dx': - return ["https://dl.dropboxusercontent.com/" + base]; - case 'nn': - return ["https://kastden.org/_loopvid_media/nn/" + base]; - case 'cp': - return ["https://copy.com/" + base]; - case 'wu': - return ["http://webmup.com/" + base + "/vid.webm"]; - case 'ig': - return ["https://i.imgur.com/" + base]; - case 'ky': - return ["https://kastden.org/_loopvid_media/ky/" + base]; - case 'mf': - return ["https://kastden.org/_loopvid_media/mf/" + base, "https://web.archive.org/web/2/https://d.maxfile.ro/" + base]; - case 'm2': - return ["https://kastden.org/_loopvid_media/m2/" + base]; - case 'pc': - return ["https://kastden.org/_loopvid_media/pc/" + base, "https://web.archive.org/web/2/http://a.pomf.cat/" + base]; - case '1c': - return ["http://b.1339.cf/" + base]; - case 'pi': - return ["https://kastden.org/_loopvid_media/pi/" + base, "https://web.archive.org/web/2/https://u.pomf.is/" + base]; - case 'ni': - return ["https://kastden.org/_loopvid_media/ni/" + base, "https://web.archive.org/web/2/https://u.nya.is/" + base]; - case 'wl': - return ["http://webm.land/media/" + base]; - case 'ko': - return ["https://kordy.kastden.org/loopvid/" + base]; - case 'mm': - return ["https://kastden.org/_loopvid_media/mm/" + base, "https://web.archive.org/web/2/https://my.mixtape.moe/" + base]; - case 'ic': - return ["https://media.8ch.net/file_store/" + base]; - case 'fc': - return ["//" + (ImageHost.host()) + "/" + base + ".webm"]; - case 'gc': - return ["https://" + type + ".gfycat.com/" + name + ".webm"]; - } - })(); - for (l = 0, len2 = urls.length; l < len2; l++) { - url = urls[l]; - $.add(el, $.el('source', { - src: url - })); - } - } - } - return el; - } - }, { - key: 'Openings.moe', - regExp: /^\w+:\/\/openings.moe\/\?video=([^.&=]+)/, - style: 'width: 1280px; height: 720px; max-width: 80vw; max-height: 80vh;', - el: function(a) { - var el; - el = $.el('iframe', { - src: "https://openings.moe/?video=" + a.dataset.uid - }); - el.setAttribute("allowfullscreen", "true"); - return el; - } - }, { - key: 'Pastebin', - regExp: /^\w+:\/\/(?:\w+\.)?pastebin\.com\/(?!u\/)(?:[\w.]+(?:\/|\?i\=))?(\w+)/, - el: function(a) { - var div; - return div = $.el('iframe', { - src: "//pastebin.com/embed_iframe.php?i=" + a.dataset.uid - }); - } - }, { - key: 'SoundCloud', - regExp: /^\w+:\/\/(?:www\.)?(?:soundcloud\.com\/|snd\.sc\/)([\w\-\/]+)/, - style: 'border: 0; width: 500px; height: 400px;', - el: function(a) { - return $.el('iframe', { - src: "https://w.soundcloud.com/player/?visual=true&show_comments=false&url=https%3A%2F%2Fsoundcloud.com%2F" + (encodeURIComponent(a.dataset.uid)) - }); - }, - title: { - api: function(uid) { - return location.protocol + "//soundcloud.com/oembed?format=json&url=https%3A%2F%2Fsoundcloud.com%2F" + (encodeURIComponent(uid)); - }, - text: function(_) { - return _.title; - } - } - }, { - key: 'StrawPoll', - regExp: /^\w+:\/\/(?:www\.)?strawpoll\.me\/(?:embed_\d+\/)?(\d+(?:\/r)?)/, - style: 'border: 0; width: 600px; height: 406px;', - el: function(a) { - return $.el('iframe', { - src: "https://www.strawpoll.me/embed_1/" + a.dataset.uid - }); - } - }, { - key: 'Streamable', - regExp: /^\w+:\/\/(?:www\.)?streamable\.com\/(\w+)/, - el: function(a) { - var el; - el = $.el('iframe', { - src: "https://streamable.com/o/" + a.dataset.uid - }); - el.setAttribute("allowfullscreen", "true"); - return el; - }, - title: { - api: function(uid) { - return "https://api.streamable.com/oembed?url=https://streamable.com/" + uid; - }, - text: function(_) { - return _.title; - } - } - }, { - key: 'TwitchTV', - regExp: /^\w+:\/\/(?:www\.|secure\.|clips\.|m\.)?twitch\.tv\/(\w[^#\&\?]*)/, - el: function(a) { - var el, m, time, url; - m = a.dataset.href.match(/^\w+:\/\/(?:(clips\.)|\w+\.)?twitch\.tv\/(?:\w+\/)?(clip\/)?(\w[^#\&\?]*)/); - if (m[1] || m[2]) { - url = "//clips.twitch.tv/embed?clip=" + m[3] + "&parent=" + location.hostname; - } else { - m = a.dataset.uid.match(/(\w+)(?:\/(?:v\/)?(\d+))?/); - url = "//player.twitch.tv/?" + (m[2] ? "video=v" + m[2] : "channel=" + m[1]) + "&autoplay=false&parent=" + location.hostname; - if ((time = a.dataset.href.match(/\bt=(\w+)/))) { - url += "&time=" + time[1]; - } - } - el = $.el('iframe', { - src: url - }); - el.setAttribute("allowfullscreen", "true"); - return el; - } - }, { - key: 'Twitter', - regExp: /^\w+:\/\/(?:www\.|mobile\.)?twitter\.com\/(\w+\/status\/\d+)/, - style: 'border: none; width: 550px; height: 250px; overflow: hidden; resize: both;', - el: function(a) { - var cont, el, onMessage; - el = $.el('iframe'); - $.on(el, 'load', function() { - return this.contentWindow.postMessage({ - element: 't', - query: 'height' - }, 'https://twitframe.com'); - }); - onMessage = function(e) { - if (e.source === el.contentWindow && e.origin === 'https://twitframe.com') { - $.off(window, 'message', onMessage); - return (cont || el).style.height = (+$.minmax(e.data.height, 250, 0.8 * doc.clientHeight)) + "px"; - } - }; - $.on(window, 'message', onMessage); - el.src = "https://twitframe.com/show?url=https://twitter.com/" + a.dataset.uid; - if ($.engine === 'gecko') { - el.style.cssText = 'border: none; width: 100%; height: 100%;'; - cont = $.el('div'); - $.add(cont, el); - return cont; - } else { - return el; - } - } - }, { - key: 'VidLii', - regExp: /^\w+:\/\/(?:www\.)?vidlii\.com\/watch\?v=(\w{11})/, - style: 'border: none; width: 640px; height: 392px;', - el: function(a) { - var el; - el = $.el('iframe', { - src: "https://www.vidlii.com/embed?v=" + a.dataset.uid + "&a=0" - }); - el.setAttribute("allowfullscreen", "true"); - return el; - } - }, { - key: 'Vimeo', - regExp: /^\w+:\/\/(?:www\.)?vimeo\.com\/(\d+)/, - el: function(a) { - var el; - el = $.el('iframe', { - src: "//player.vimeo.com/video/" + a.dataset.uid + "?wmode=opaque" - }); - el.setAttribute("allowfullscreen", "true"); - return el; - }, - title: { - api: function(uid) { - return "https://vimeo.com/api/oembed.json?url=https://vimeo.com/" + uid; - }, - text: function(_) { - return _.title; - } - } - }, { - key: 'Vine', - regExp: /^\w+:\/\/(?:www\.)?vine\.co\/v\/(\w+)/, - style: 'border: none; width: 500px; height: 500px;', - el: function(a) { - return $.el('iframe', { - src: "https://vine.co/v/" + a.dataset.uid + "/card" - }); - } - }, { - key: 'Vocaroo', - regExp: /^\w+:\/\/(?:(?:www\.|old\.)?vocaroo\.com|voca\.ro)\/((?:i\/)?\w+)/, - style: '', - el: function(a) { - var el; - el = $.el('iframe'); - el.width = 300; - el.height = 60; - el.setAttribute('frameborder', 0); - el.src = "https://vocaroo.com/embed/" + (a.dataset.uid.replace(/^i\//, '')) + "?autoplay=0"; - return el; - } - }, { - key: 'YouTube', - regExp: /^\w+:\/\/(?:youtu.be\/|[\w.]*youtube[\w.]*\/.*(?:v=|\bembed\/|\bv\/))([\w\-]{11})(.*)/, - el: function(a) { - var el, start; - start = a.dataset.options.match(/\b(?:star)?t\=(\w+)/); - if (start) { - start = start[1]; - } - if (start && !/^\d+$/.test(start)) { - start += ' 0h0m0s'; - start = 3600 * start.match(/(\d+)h/)[1] + 60 * start.match(/(\d+)m/)[1] + 1 * start.match(/(\d+)s/)[1]; - } - el = $.el('iframe', { - src: "//www.youtube.com/embed/" + a.dataset.uid + "?rel=0&wmode=opaque" + (start ? '&start=' + start : '') - }); - el.setAttribute("allowfullscreen", "true"); - return el; - }, - title: { - api: function(uid) { - return "https://www.youtube.com/oembed?url=https%3A//www.youtube.com/watch%3Fv%3D" + uid + "&format=json"; - }, - text: function(_) { - return _.title; - }, - status: function(_) { - var m; - if (_.error) { - m = _.error.match(/^(\d*)\s*(.*)/); - return [+m[1], m[2]]; - } else { - return [200, 'OK']; - } - } - }, - preview: { - url: function(uid) { - return "https://img.youtube.com/vi/" + uid + "/0.jpg"; - }, - height: 360 - } - } - ] - }; - - return Embedding; - -}).call(this); - -Linkify = (function() { - var Linkify; - - Linkify = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread' && ref !== 'archive') || !Conf['Linkify']) { - return; - } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - Callbacks.Post.push({ - name: 'Linkify', - cb: this.node - }); - return Embedding.init(); - }, - node: function() { - var base, j, k, len, len1, link, links, ref; - if (this.isClone) { - return Embedding.events(this); - } - if (!Linkify.regString.test(this.info.comment)) { - return; - } - ref = $$('a', this.nodes.comment); - for (j = 0, len = ref.length; j < len; j++) { - link = ref[j]; - if (!(typeof (base = g.SITE).isLinkified === "function" ? base.isLinkified(link) : void 0)) { - continue; - } - $.addClass(link, 'linkify'); - if (ImageHost.useFaster) { - ImageHost.fixLinks([link]); - } - Embedding.process(link, this); - } - links = Linkify.process(this.nodes.comment); - if (ImageHost.useFaster) { - ImageHost.fixLinks(links); - } - for (k = 0, len1 = links.length; k < len1; k++) { - link = links[k]; - Embedding.process(link, this); - } - }, - process: function(node) { - var data, end, endNode, i, index, length, links, part1, part2, ref, ref1, result, saved, snapshot, space, test, word; - test = /[^\s"]+/g; - space = /[\s"]/; - snapshot = $.X('.//br|.//text()', node); - i = 0; - links = []; - while (node = snapshot.snapshotItem(i++)) { - data = node.data; - if (!data || node.parentElement.nodeName === "A") { - continue; - } - while (result = test.exec(data)) { - index = result.index; - endNode = node; - word = result[0]; - if ((length = index + word.length) === data.length) { - test.lastIndex = 0; - while ((saved = snapshot.snapshotItem(i++))) { - if (saved.nodeName === 'BR' || (saved.parentElement.nodeName === 'P' && !saved.previousSibling)) { - if ((part1 = word.match(/(https?:\/\/)?([a-z\d-]+\.)*[a-z\d-]+$/i)) && (part2 = (ref = snapshot.snapshotItem(i)) != null ? (ref1 = ref.data) != null ? ref1.match(/^(\.[a-z\d-]+)*\//i) : void 0 : void 0) && (part1[0] + part2[0]).search(Linkify.regString) === 0) { - continue; - } else { - break; - } - } - if (saved.parentElement.nodeName === "A" && !Linkify.regString.test(word)) { - break; - } - endNode = saved; - data = saved.data; - if (end = space.exec(data)) { - word += data.slice(0, end.index); - test.lastIndex = length = end.index; - i--; - break; - } else { - length = data.length; - word += data; - } - } - } - if (Linkify.regString.test(word)) { - links.push(Linkify.makeRange(node, endNode, index, length)); - } - if (!(test.lastIndex && node === endNode)) { - break; - } - } - } - i = links.length; - while (i--) { - links[i] = Linkify.makeLink(links[i]); - } - return links; - }, - regString: /((https?|mailto|git|magnet|ftp|irc):([a-z\d%\/?])|([-a-z\d]+[.])+(aero|asia|biz|cat|com|coop|dance|info|int|jobs|mobi|moe|museum|name|net|org|post|pro|tel|travel|xxx|xyz|edu|gov|mil|[a-z]{2})([:\/]|(?![^\s"]))|[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}|[-\w\d.@]+@[a-z\d.-]+\.[a-z\d])/i, - makeRange: function(startNode, endNode, startOffset, endOffset) { - var range; - range = document.createRange(); - range.setStart(startNode, startOffset); - range.setEnd(endNode, endOffset); - return range; - }, - makeLink: function(range) { - var a, encodedDomain, i, t, text; - text = range.toString(); - i = text.search(Linkify.regString); - if (i > 0) { - text = text.slice(i); - while (range.startOffset + i >= range.startContainer.data.length) { - i--; - } - if (i) { - range.setStart(range.startContainer, range.startOffset + i); - } - } - i = 0; - while (/[)\]}>.,]/.test(t = text.charAt(text.length - (1 + i)))) { - if (!(/[.,]/.test(t) || (text.match(/[()\[\]{}<>]/g)).length % 2)) { - break; - } - i++; - } - if (i) { - text = text.slice(0, -i); - while (range.endOffset - i < 0) { - i--; - } - if (i) { - range.setEnd(range.endContainer, range.endOffset - i); - } - } - if (!/((mailto|magnet):|.+:\/\/)/.test(text)) { - text = (/@/.test(text) ? 'mailto:' : 'http://') + text; - } - if (encodedDomain = text.match(/^(https?:\/\/[^\/]*%[0-9a-f]{2})(.*)$/i)) { - text = encodedDomain[1].replace(/%([0-9a-f]{2})/ig, function(x, y) { - if (y === '25') { - return x; - } else { - return String.fromCharCode(parseInt(y, 16)); - } - }) + encodedDomain[2]; - } - a = $.el('a', { - className: 'linkify', - rel: 'noreferrer noopener', - target: '_blank', - href: text - }); - $.add(a, range.extractContents()); - range.insertNode(a); - return a; - } - }; - - return Linkify; - -}).call(this); - -ArchiveLink = (function() { - var ArchiveLink; - - ArchiveLink = { - init: function() { - var div, entry, i, len, ref, ref1, type; - if (!(g.SITE.software === 'yotsuba' && ((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Archive Link'])) { - return; - } - div = $.el('div', { - textContent: 'Archive' - }); - entry = { - el: div, - order: 60, - open: function(arg) { - var ID, board, thread; - ID = arg.ID, thread = arg.thread, board = arg.board; - return !!Redirect.to('thread', { - postID: ID, - threadID: thread.ID, - boardID: board.ID - }); - }, - subEntries: [] - }; - ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Flag', 'country'], ['Filename', 'filename'], ['Image MD5', 'MD5']]; - for (i = 0, len = ref1.length; i < len; i++) { - type = ref1[i]; - entry.subEntries.push(this.createSubEntry(type[0], type[1])); - } - return Menu.menu.addEntry(entry); - }, - createSubEntry: function(text, type) { - var el, open; - el = $.el('a', { - textContent: text, - target: '_blank' - }); - open = type === 'post' ? function(arg) { - var ID, board, thread; - ID = arg.ID, thread = arg.thread, board = arg.board; - el.href = Redirect.to('thread', { - postID: ID, - threadID: thread.ID, - boardID: board.ID - }); - return true; - } : function(post) { - var ref, typeParam, value; - typeParam = type === 'country' && post.info.flagCodeTroll ? 'troll_country' : type; - value = type === 'country' ? post.info.flagCode || ((ref = post.info.flagCodeTroll) != null ? ref.toLowerCase() : void 0) : Filter.values(type, post)[0]; - if (!value) { - return false; - } - el.href = Redirect.to('search', { - boardID: post.board.ID, - type: typeParam, - value: value, - isSearch: true - }); - return true; - }; - return { - el: el, - open: open - }; - } - }; - - return ArchiveLink; - -}).call(this); - -CopyTextLink = (function() { - var CopyTextLink; - - CopyTextLink = { - init: function() { - var a, ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Copy Text Link'])) { - return; - } - a = $.el('a', { - className: 'copy-text-link', - href: 'javascript:;', - textContent: 'Copy Text' - }); - $.on(a, 'click', CopyTextLink.copy); - return Menu.menu.addEntry({ - el: a, - order: 12, - open: function(post) { - CopyTextLink.text = (post.origin || post).commentOrig(); - return true; - } - }); - }, - copy: function() { - var el; - el = $.el('textarea', { - className: 'copy-text-element', - value: CopyTextLink.text - }); - $.add(d.body, el); - el.select(); - try { - d.execCommand('copy'); - } catch (error) {} - return $.rm(el); - } - }; - - return CopyTextLink; - -}).call(this); - -DeleteLink = (function() { - var DeleteLink; - - DeleteLink = { - auto: [$.dict(), $.dict()], - init: function() { - var div, fileEl, fileEntry, postEl, postEntry, ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Delete Link'])) { - return; - } - div = $.el('div', { - className: 'delete-link', - textContent: 'Delete' - }); - postEl = $.el('a', { - className: 'delete-post', - href: 'javascript:;' - }); - fileEl = $.el('a', { - className: 'delete-file', - href: 'javascript:;' - }); - this.nodes = { - menu: div.firstChild, - links: [postEl, fileEl] - }; - postEntry = { - el: postEl, - open: function() { - postEl.textContent = DeleteLink.linkText(false); - $.on(postEl, 'click', DeleteLink.toggle); - return true; - } - }; - fileEntry = { - el: fileEl, - open: function(arg) { - var file; - file = arg.file; - if (!file || file.isDead) { - return false; - } - fileEl.textContent = DeleteLink.linkText(true); - $.on(fileEl, 'click', DeleteLink.toggle); - return true; - } - }; - return Menu.menu.addEntry({ - el: div, - order: 40, - open: function(post) { - if (post.isDead) { - return false; - } - DeleteLink.post = post; - DeleteLink.nodes.menu.textContent = DeleteLink.menuText(); - DeleteLink.cooldown.start(post); - return true; - }, - subEntries: [postEntry, fileEntry] - }); - }, - menuText: function() { - var seconds; - if (seconds = DeleteLink.cooldown.seconds[DeleteLink.post.fullID]) { - return "Delete (" + seconds + ")"; - } else { - return 'Delete'; - } - }, - linkText: function(fileOnly) { - var text; - text = fileOnly ? 'File' : 'Post'; - if (DeleteLink.auto[+fileOnly][DeleteLink.post.fullID]) { - text = "Deleting " + (text.toLowerCase()) + "..."; - } - return text; - }, - toggle: function() { - var auto, fileOnly, post; - post = DeleteLink.post; - fileOnly = $.hasClass(this, 'delete-file'); - auto = DeleteLink.auto[+fileOnly]; - if (auto[post.fullID]) { - delete auto[post.fullID]; - } else { - auto[post.fullID] = true; - } - this.textContent = DeleteLink.linkText(fileOnly); - if (!DeleteLink.cooldown.seconds[post.fullID]) { - return DeleteLink["delete"](post, fileOnly); - } - }, - "delete": function(post, fileOnly) { - var form, link; - link = DeleteLink.nodes.links[+fileOnly]; - delete DeleteLink.auto[+fileOnly][post.fullID]; - if (post.fullID === DeleteLink.post.fullID) { - $.off(link, 'click', DeleteLink.toggle); - } - form = { - mode: 'usrdel', - onlyimgdel: fileOnly, - pwd: QR.persona.getPassword() - }; - form[+post.ID] = 'delete'; - return $.ajax($.id('delform').action.replace("/" + g.BOARD + "/", "/" + post.board + "/"), { - responseType: 'document', - withCredentials: true, - onloadend: function() { - return DeleteLink.load(link, post, fileOnly, this.response); - }, - form: $.formData(form) - }); - }, - load: function(link, post, fileOnly, resDoc) { - var el, msg; - if (!resDoc) { - new Notice('warning', 'Connection error, please retry.', 20); - if (post.fullID === DeleteLink.post.fullID) { - $.on(link, 'click', DeleteLink.toggle); - } - return; - } - link.textContent = DeleteLink.linkText(fileOnly); - if (resDoc.title === '4chan - Banned') { - el = $.el('span', {innerHTML: "You can't delete posts because you are banned."}); - return new Notice('warning', el, 20); - } else if (msg = resDoc.getElementById('errmsg')) { - new Notice('warning', msg.textContent, 20); - if (post.fullID === DeleteLink.post.fullID) { - $.on(link, 'click', DeleteLink.toggle); - } - if (QR.cooldown.data && Conf['Cooldown'] && /\bwait\b/i.test(msg.textContent)) { - DeleteLink.cooldown.start(post, 5); - DeleteLink.auto[+fileOnly][post.fullID] = true; - return DeleteLink.nodes.links[+fileOnly].textContent = DeleteLink.linkText(fileOnly); - } - } else { - if (!fileOnly) { - QR.cooldown["delete"](post); - } - if (resDoc.title === 'Updating index...') { - (post.origin || post).kill(fileOnly); - } - if (post.fullID === DeleteLink.post.fullID) { - return link.textContent = 'Deleted'; - } - } - }, - cooldown: { - seconds: $.dict(), - start: function(post, seconds) { - if (DeleteLink.cooldown.seconds[post.fullID] != null) { - return; - } - if (seconds == null) { - seconds = QR.cooldown.secondsDeletion(post); - } - if (seconds > 0) { - DeleteLink.cooldown.seconds[post.fullID] = seconds; - return DeleteLink.cooldown.count(post); - } - }, - count: function(post) { - var fileOnly, i, len, ref; - if (post.fullID === DeleteLink.post.fullID) { - DeleteLink.nodes.menu.textContent = DeleteLink.menuText(); - } - if (DeleteLink.cooldown.seconds[post.fullID] > 0 && Conf['Cooldown']) { - DeleteLink.cooldown.seconds[post.fullID]--; - setTimeout(DeleteLink.cooldown.count, 1000, post); - } else { - delete DeleteLink.cooldown.seconds[post.fullID]; - ref = [false, true]; - for (i = 0, len = ref.length; i < len; i++) { - fileOnly = ref[i]; - if (DeleteLink.auto[+fileOnly][post.fullID]) { - DeleteLink["delete"](post, fileOnly); - } - } - } - } - } - }; - - return DeleteLink; - -}).call(this); - -DownloadLink = (function() { - var DownloadLink; - - DownloadLink = { - init: function() { - var a, ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Download Link'])) { - return; - } - a = $.el('a', { - className: 'download-link', - textContent: 'Download file' - }); - $.on(a, 'click', ImageCommon.download); - return Menu.menu.addEntry({ - el: a, - order: 100, - open: function(arg) { - var file; - file = arg.file; - if (!file) { - return false; - } - a.href = file.url; - a.download = file.name; - return true; - } - }); - } - }; - - return DownloadLink; - -}).call(this); - -Menu = (function() { - var Menu; - - Menu = { - init: function() { - var ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'])) { - return; - } - this.button = $.el('a', { - className: 'menu-button', - href: 'javascript:;' - }); - $.extend(this.button, {innerHTML: ""}); - this.menu = new UI.Menu('post'); - Callbacks.Post.push({ - name: 'Menu', - cb: this.node - }); - return Callbacks.CatalogThread.push({ - name: 'Menu', - cb: this.catalogNode - }); - }, - node: function() { - var button; - if (this.isClone) { - button = $('.menu-button', this.nodes.info); - $.rmClass(button, 'active'); - $.rm($('.dialog', this.nodes.info)); - Menu.makeButton(this, button); - return; - } - return $.add(this.nodes.info, Menu.makeButton(this)); - }, - catalogNode: function() { - return $.after(this.nodes.icons, Menu.makeButton(this.thread.OP)); - }, - makeButton: function(post, button) { - button || (button = Menu.button.cloneNode(true)); - $.on(button, 'click', function(e) { - return Menu.menu.toggle(e, this, post); - }); - return button; - } - }; - - return Menu; - -}).call(this); - -ReportLink = (function() { - var ReportLink; - - ReportLink = { - init: function() { - var a, ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Report Link'])) { - return; - } - a = $.el('a', { - className: 'report-link', - href: 'javascript:;', - textContent: 'Report' - }); - $.on(a, 'click', ReportLink.report); - return Menu.menu.addEntry({ - el: a, - order: 10, - open: function(post) { - ReportLink.url = "//sys." + (location.hostname.split('.')[1]) + ".org/" + post.board + "/imgboard.php?mode=report&no=" + post; - if (d.cookie.indexOf('pass_enabled=1') >= 0) { - ReportLink.dims = 'width=350,height=275'; - } else { - ReportLink.dims = 'width=400,height=550'; - } - return true; - } - }); - }, - report: function() { - var dims, id, set, url; - url = ReportLink.url, dims = ReportLink.dims; - id = Date.now(); - set = "toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1," + dims; - return window.open(url, id, set); - } - }; - - return ReportLink; - -}).call(this); - -AntiAutoplay = (function() { - var AntiAutoplay; - - AntiAutoplay = { - init: function() { - var audio, i, len, ref; - if (!Conf['Disable Autoplaying Sounds']) { - return; - } - $.addClass(doc, 'anti-autoplay'); - ref = $$('audio[autoplay]', doc); - for (i = 0, len = ref.length; i < len; i++) { - audio = ref[i]; - this.stop(audio); - } - window.addEventListener('loadstart', ((function(_this) { - return function(e) { - return _this.stop(e.target); - }; - })(this)), true); - Callbacks.Post.push({ - name: 'Disable Autoplaying Sounds', - cb: this.node - }); - return $.ready((function(_this) { - return function() { - return _this.process(d.body); - }; - })(this)); - }, - stop: function(audio) { - if (!audio.autoplay) { - return; - } - audio.pause(); - audio.autoplay = false; - if (audio.controls) { - return; - } - audio.controls = true; - return $.addClass(audio, 'controls-added'); - }, - node: function() { - return AntiAutoplay.process(this.nodes.comment); - }, - process: function(root) { - var i, iframe, j, len, len1, object, ref, ref1; - ref = $$('iframe[src*="youtube"][src*="autoplay=1"]', root); - for (i = 0, len = ref.length; i < len; i++) { - iframe = ref[i]; - AntiAutoplay.processVideo(iframe, 'src'); - } - ref1 = $$('object[data*="youtube"][data*="autoplay=1"]', root); - for (j = 0, len1 = ref1.length; j < len1; j++) { - object = ref1[j]; - AntiAutoplay.processVideo(object, 'data'); - } - }, - processVideo: function(el, attr) { - el[attr] = el[attr].replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', ''); - if (window.getComputedStyle(el).display === 'none') { - el.style.display = 'block'; - } - return $.addClass(el, 'autoplay-removed'); - } - }; - - return AntiAutoplay; - -}).call(this); - -Banner = (function() { - var Banner, - slice = [].slice; - - Banner = { - init: function() { - if (Conf['Custom Board Titles']) { - this.db = new DataBoard('customTitles', null, true); - } - $.asap((function() { - return d.body; - }), function() { - return $.asap((function() { - return $('hr'); - }), Banner.ready); - }); - if (g.BOARD.ID !== 'f') { - return Main.ready(function() { - return $.queueTask(Banner.load); - }); - } - }, - ready: function() { - var banner, children; - banner = $(".boardBanner"); - children = banner.children; - if (g.VIEW === 'thread' && Conf['Remove Thread Excerpt']) { - Banner.setTitle(children[1].textContent); - } - children[0].title = "Click to change"; - $.on(children[0], 'click', Banner.cb.toggle); - if (Conf['Custom Board Titles']) { - Banner.custom(children[1]); - if (children[2]) { - return Banner.custom(children[2]); - } - } - }, - load: function() { - var bannerCnt, img; - bannerCnt = $.id('bannerCnt'); - if (!bannerCnt.firstChild) { - img = $.el('img', { - alt: '4chan', - src: '//s.4cdn.org/image/title/' + bannerCnt.dataset.src - }); - return $.add(bannerCnt, img); - } - }, - setTitle: function(title) { - if (Unread.title != null) { - Unread.title = title; - return Unread.update(); - } else { - return d.title = title; - } - }, - cb: { - toggle: function() { - var banner, i, ref; - if (!((ref = Banner.choices) != null ? ref.length : void 0)) { - Banner.choices = Conf['knownBanners'].split(',').slice(); - } - i = Math.floor(Banner.choices.length * Math.random()); - banner = Banner.choices.splice(i, 1); - return $('img', this.parentNode).src = "//s.4cdn.org/image/title/" + banner; - }, - click: function(e) { - var base, br, j, len, name, ref; - if (!(e.ctrlKey || e.metaKey)) { - return; - } - if ((base = Banner.original)[name = this.className] == null) { - base[name] = this.cloneNode(true); - } - this.contentEditable = true; - ref = $$('br', this); - for (j = 0, len = ref.length; j < len; j++) { - br = ref[j]; - $.replace(br, $.tn('\n')); - } - return this.focus(); - }, - keydown: function(e) { - e.stopPropagation(); - if (!e.shiftKey && e.keyCode === 13) { - return this.blur(); - } - }, - blur: function() { - var br, j, len, ref; - ref = $$('br', this); - for (j = 0, len = ref.length; j < len; j++) { - br = ref[j]; - $.replace(br, $.tn('\n')); - } - if (this.textContent = this.textContent.replace(/\n*$/, '')) { - this.contentEditable = false; - return Banner.db.set({ - boardID: g.BOARD.ID, - threadID: this.className, - val: { - title: this.textContent, - orig: Banner.original[this.className].textContent - } - }); - } else { - $.rmAll(this); - $.add(this, slice.call(Banner.original[this.className].cloneNode(true).childNodes)); - return Banner.db["delete"]({ - boardID: g.BOARD.ID, - threadID: this.className - }); - } - } - }, - original: $.dict(), - custom: function(child) { - var className, data, event, j, len, ref; - className = child.className; - child.title = "Ctrl/\u2318+click to edit board " + (className.slice(5).toLowerCase()); - child.spellcheck = false; - ref = ['click', 'keydown', 'blur']; - for (j = 0, len = ref.length; j < len; j++) { - event = ref[j]; - $.on(child, event, Banner.cb[event]); - } - if (data = Banner.db.get({ - boardID: g.BOARD.ID, - threadID: className - })) { - if (Conf['Persistent Custom Board Titles'] || data.orig === child.textContent) { - Banner.original[className] = child.cloneNode(true); - return child.textContent = data.title; - } else { - return Banner.db["delete"]({ - boardID: g.BOARD.ID, - threadID: className - }); - } - } - } - }; - - return Banner; - -}).call(this); - -CatalogLinks = (function() { - var CatalogLinks; - - CatalogLinks = { - init: function() { - var el, input, selector; - if (g.SITE.software === 'yotsuba' && (Conf['External Catalog'] || Conf['JSON Index']) && !(Conf['JSON Index'] && g.VIEW === 'index')) { - selector = (function() { - switch (g.VIEW) { - case 'thread': - case 'archive': - return '.navLinks.desktop > a'; - case 'catalog': - return '.navLinks > :first-child > a'; - case 'index': - return '#ctrl-top > a, .cataloglink > a'; - } - })(); - $.ready(function() { - var base, catalogLink, catalogURL, i, len, link, link2, ref; - ref = $$(selector); - for (i = 0, len = ref.length; i < len; i++) { - link = ref[i]; - switch (link.pathname.replace(/\/+/g, '/')) { - case "/" + g.BOARD + "/": - if (Conf['JSON Index']) { - link.textContent = 'Index'; - } - link.href = CatalogLinks.index(); - break; - case "/" + g.BOARD + "/catalog": - link.href = CatalogLinks.catalog(); - } - if (g.VIEW === 'catalog' && (catalogURL = CatalogLinks.catalog()) !== (typeof (base = g.SITE.urls).catalog === "function" ? base.catalog(g.BOARD) : void 0)) { - catalogLink = link.parentNode.cloneNode(true); - link2 = catalogLink.firstElementChild; - link2.href = catalogURL; - link2.textContent = link2.hostname === location.hostname ? '4chan X Catalog' : 'External Catalog'; - $.after(link.parentNode, [$.tn(' '), catalogLink]); - } - } - }); - } - if (g.SITE.software === 'yotsuba' && Conf['JSON Index'] && Conf['Use 4chan X Catalog']) { - Callbacks.Post.push({ - name: 'Catalog Link Rewrite', - cb: this.node - }); - } - if ((this.enabled = Conf['Catalog Links'])) { - CatalogLinks.el = el = UI.checkbox('Header catalog links', 'Catalog Links'); - el.id = 'toggleCatalog'; - input = $('input', el); - $.on(input, 'change', this.toggle); - $.sync('Header catalog links', CatalogLinks.set); - return Header.menu.addEntry({ - el: el, - order: 95 - }); - } - }, - node: function() { - var a, i, len, m, ref; - ref = $$('a', this.nodes.comment); - for (i = 0, len = ref.length; i < len; i++) { - a = ref[i]; - if (m = a.href.match(/^https?:\/\/(boards\.4chan(?:nel)?\.org\/[^\/]+)\/catalog(#s=.*)?/)) { - a.href = "//" + m[1] + "/" + (m[2] || '#catalog'); - } - } - }, - toggle: function() { - $.event('CloseMenu'); - $.set('Header catalog links', this.checked); - return CatalogLinks.set(this.checked); - }, - set: function(useCatalog) { - Conf['Header catalog links'] = useCatalog; - CatalogLinks.setLinks(Header.boardList); - CatalogLinks.setLinks(Header.bottomBoardList); - CatalogLinks.el.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + "."; - return $('input', CatalogLinks.el).checked = useCatalog; - }, - setLinks: function(list) { - var VIEW, a, board, boardID, i, len, ref, ref1, ref2, ref3, siteID, tail, url; - if (!(((ref = CatalogLinks.enabled) != null ? ref : Conf['Catalog Links']) && list)) { - return; - } - tail = /(?:index)?(?:\.\w+)?$/; - ref1 = $$('a:not([data-only])', list); - for (i = 0, len = ref1.length; i < len; i++) { - a = ref1[i]; - ref2 = a.dataset, siteID = ref2.siteID, boardID = ref2.boardID; - if (!(siteID && boardID)) { - ref3 = Site.parseURL(a), siteID = ref3.siteID, boardID = ref3.boardID, VIEW = ref3.VIEW; - if (!(siteID && boardID && (VIEW === 'index' || VIEW === 'catalog') && (a.dataset.indexOptions || a.href.replace(tail, '') === (Get.url(VIEW, { - siteID: siteID, - boardID: boardID - }) || '').replace(tail, '')))) { - continue; - } - $.extend(a.dataset, { - siteID: siteID, - boardID: boardID - }); - } - board = { - siteID: siteID, - boardID: boardID - }; - url = Conf['Header catalog links'] ? CatalogLinks.catalog(board) : Get.url('index', board); - if (url) { - a.href = url; - if (a.dataset.indexOptions && url.split('#')[0] === Get.url('index', board)) { - a.href += (a.hash ? '/' : '#') + a.dataset.indexOptions; - } - } - } - }, - externalParse: function() { - var board, boards, excludes, i, len, line, ref, ref1, ref2, url; - CatalogLinks.externalList = $.dict(); - ref = Conf['externalCatalogURLs'].split('\n'); - for (i = 0, len = ref.length; i < len; i++) { - line = ref[i]; - if (line[0] === '#') { - continue; - } - url = line.split(';')[0]; - boards = Filter.parseBoards(((ref1 = line.match(/;boards:([^;]+)/)) != null ? ref1[1] : void 0) || '*'); - excludes = Filter.parseBoards((ref2 = line.match(/;exclude:([^;]+)/)) != null ? ref2[1] : void 0) || $.dict(); - for (board in boards) { - if (!(excludes[board] || excludes[board.split('/')[0] + '/*'])) { - CatalogLinks.externalList[board] = url; - } - } - } - }, - external: function(arg) { - var boardID, external, siteID; - siteID = arg.siteID, boardID = arg.boardID; - if (!CatalogLinks.externalList) { - CatalogLinks.externalParse(); - } - external = CatalogLinks.externalList[siteID + "/" + boardID] || CatalogLinks.externalList[siteID + "/*"]; - if (external) { - return external.replace(/%board/g, boardID); - } else { - return void 0; - } - }, - jsonIndex: function(board, hash) { - if (g.SITE.ID === board.siteID && g.BOARD.ID === board.boardID && g.VIEW === 'index') { - return hash; - } else { - return Get.url('index', board) + hash; - } - }, - catalog: function(board) { - var external, nativeCatalog; - if (board == null) { - board = g.BOARD; - } - if (Conf['External Catalog'] && (external = CatalogLinks.external(board))) { - return external; - } else if (Index.enabledOn(board) && Conf['Use 4chan X Catalog']) { - return CatalogLinks.jsonIndex(board, '#catalog'); - } else if ((nativeCatalog = Get.url('catalog', board))) { - return nativeCatalog; - } else { - return CatalogLinks.external(board); - } - }, - index: function(board) { - if (board == null) { - board = g.BOARD; - } - if (Index.enabledOn(board)) { - return CatalogLinks.jsonIndex(board, '#index'); - } else { - return Get.url('index', board); - } - } - }; - - return CatalogLinks; - -}).call(this); - -CustomCSS = (function() { - var CustomCSS; - - CustomCSS = { - init: function() { - if (!Conf['Custom CSS']) { - return; - } - return this.addStyle(); - }, - addStyle: function() { - return this.style = $.addStyle(CSS.sub(Conf['usercss']), 'custom-css', '#fourchanx-css'); - }, - rmStyle: function() { - if (this.style) { - $.rm(this.style); - return delete this.style; - } - }, - update: function() { - if (!this.style) { - return this.addStyle(); - } - return this.style.textContent = CSS.sub(Conf['usercss']); - } - }; - - return CustomCSS; - -}).call(this); - -ExpandComment = (function() { - var ExpandComment; - - ExpandComment = { - init: function() { - if (g.VIEW !== 'index' || !Conf['Comment Expansion'] || Conf['JSON Index']) { - return; - } - return Callbacks.Post.push({ - name: 'Comment Expansion', - cb: this.node - }); - }, - node: function() { - var a; - if (a = $('.abbr > a:not([onclick])', this.nodes.comment)) { - return $.on(a, 'click', ExpandComment.cb); - } - }, - callbacks: [], - cb: function(e) { - e.preventDefault(); - return ExpandComment.expand(Get.postFromNode(this)); - }, - expand: function(post) { - var a; - if (post.nodes.longComment && !post.nodes.longComment.parentNode) { - $.replace(post.nodes.shortComment, post.nodes.longComment); - post.nodes.comment = post.nodes.longComment; - return; - } - if (!(a = $('.abbr > a', post.nodes.comment))) { - return; - } - a.textContent = "Post No." + post + " Loading..."; - return $.cache(g.SITE.urls.threadJSON({ - boardID: post.boardID, - threadID: post.threadID - }), function() { - return ExpandComment.parse(this, a, post); - }); - }, - contract: function(post) { - var a; - if (!post.nodes.shortComment) { - return; - } - a = $('.abbr > a', post.nodes.shortComment); - a.textContent = 'here'; - $.replace(post.nodes.longComment, post.nodes.shortComment); - return post.nodes.comment = post.nodes.shortComment; - }, - parse: function(req, a, post) { - var callback, clone, comment, href, i, j, k, len, len1, len2, postObj, posts, quote, ref, ref1, spoilerRange, status; - status = req.status; - if (status !== 200 && status !== 304) { - a.textContent = status ? "Error " + req.statusText + " (" + status + ")" : 'Connection Error'; - return; - } - posts = req.response.posts; - if (spoilerRange = posts[0].custom_spoiler) { - g.SITE.Build.spoilerRange[g.BOARD] = spoilerRange; - } - for (i = 0, len = posts.length; i < len; i++) { - postObj = posts[i]; - if (postObj.no === post.ID) { - break; - } - } - if (postObj.no !== post.ID) { - a.textContent = "Post No." + post + " not found."; - return; - } - comment = post.nodes.comment; - clone = comment.cloneNode(false); - clone.innerHTML = postObj.com; - ref = $$('.quotelink', clone); - for (j = 0, len1 = ref.length; j < len1; j++) { - quote = ref[j]; - href = quote.getAttribute('href'); - if (href[0] === '/') { - continue; - } - if (href[0] === '#') { - quote.href = "" + (a.pathname.split(/\/+/).splice(0, 4).join('/')) + href; - } else { - quote.href = (a.pathname.split(/\/+/).splice(0, 3).join('/')) + "/" + href; - } - } - post.nodes.shortComment = comment; - $.replace(comment, clone); - post.nodes.comment = post.nodes.longComment = clone; - post.parseComment(); - post.parseQuotes(); - ref1 = ExpandComment.callbacks; - for (k = 0, len2 = ref1.length; k < len2; k++) { - callback = ref1[k]; - callback.call(post); - } - } - }; - - return ExpandComment; - -}).call(this); - -ExpandThread = (function() { - var ExpandThread, - slice = [].slice; - - ExpandThread = { - statuses: $.dict(), - init: function() { - if (!(g.VIEW === 'index' && Conf['Thread Expansion'])) { - return; - } - if (Conf['JSON Index']) { - return $.on(d, 'IndexRefreshInternal', this.onIndexRefresh); - } else { - return Callbacks.Thread.push({ - name: 'Expand Thread', - cb: function() { - return ExpandThread.setButton(this); - } - }); - } - }, - setButton: function(thread) { - var a, ref; - if (!(thread.nodes.root && (a = $('.summary', thread.nodes.root)))) { - return; - } - a.textContent = (ref = g.SITE.Build).summaryText.apply(ref, ['+'].concat(slice.call(a.textContent.match(/\d+/g)))); - a.style.cursor = 'pointer'; - return $.on(a, 'click', ExpandThread.cbToggle); - }, - disconnect: function(refresh) { - var oldReq, ref, status, threadID; - if (g.VIEW === 'thread' || !Conf['Thread Expansion']) { - return; - } - ref = ExpandThread.statuses; - for (threadID in ref) { - status = ref[threadID]; - if ((oldReq = status.req)) { - delete status.req; - oldReq.abort(); - } - delete ExpandThread.statuses[threadID]; - } - if (!refresh) { - return $.off(d, 'IndexRefreshInternal', this.onIndexRefresh); - } - }, - onIndexRefresh: function() { - ExpandThread.disconnect(true); - return g.BOARD.threads.forEach(function(thread) { - return ExpandThread.setButton(thread); - }); - }, - cbToggle: function(e) { - if ($.modifiedClick(e)) { - return; - } - e.preventDefault(); - return ExpandThread.toggle(Get.threadFromNode(this)); - }, - cbToggleBottom: function(e) { - var bottom, thread; - if ($.modifiedClick(e)) { - return; - } - e.preventDefault(); - thread = Get.threadFromNode(this); - $.rm(this); - bottom = thread.nodes.root.getBoundingClientRect().bottom; - ExpandThread.toggle(thread); - return window.scrollBy(0, thread.nodes.root.getBoundingClientRect().bottom - bottom); - }, - toggle: function(thread) { - var a; - if (!(thread.nodes.root && (a = $('.summary', thread.nodes.root)))) { - return; - } - if (thread.ID in ExpandThread.statuses) { - return ExpandThread.contract(thread, a, thread.nodes.root); - } else { - return ExpandThread.expand(thread, a); - } - }, - expand: function(thread, a) { - var ref, status; - ExpandThread.statuses[thread] = status = {}; - a.textContent = (ref = g.SITE.Build).summaryText.apply(ref, ['...'].concat(slice.call(a.textContent.match(/\d+/g)))); - status.req = $.cache(g.SITE.urls.threadJSON({ - boardID: thread.board.ID, - threadID: thread.ID - }), function() { - if (this !== status.req) { - return; - } - delete status.req; - return ExpandThread.parse(this, thread, a); - }); - return status.numReplies = $$(g.SITE.selectors.replyOriginal, thread.nodes.root).length; - }, - contract: function(thread, a, threadRoot) { - var filesCount, i, inlined, len, oldReq, postsCount, ref, replies, reply, status; - status = ExpandThread.statuses[thread]; - delete ExpandThread.statuses[thread]; - if ((oldReq = status.req)) { - delete status.req; - oldReq.abort(); - if (a) { - a.textContent = (ref = g.SITE.Build).summaryText.apply(ref, ['+'].concat(slice.call(a.textContent.match(/\d+/g)))); - } - return; - } - replies = $$('.thread > .replyContainer', threadRoot); - if (status.numReplies) { - replies = replies.slice(0, -status.numReplies); - } - postsCount = 0; - filesCount = 0; - for (i = 0, len = replies.length; i < len; i++) { - reply = replies[i]; - if (Conf['Quote Inlining']) { - while (inlined = $('.inlined', reply)) { - inlined.click(); - } - } - postsCount++; - if ('file' in Get.postFromRoot(reply)) { - filesCount++; - } - $.rm(reply); - } - if (Index.enabled) { - $.event('PostsRemoved', null, a.parentNode); - } - a.textContent = g.SITE.Build.summaryText('+', postsCount, filesCount); - return $.rm($('.summary-bottom', threadRoot)); - }, - parse: function(req, thread, a) { - var a2, filesCount, i, len, post, postData, posts, postsCount, postsRoot, ref, ref1, root; - if ((ref = req.status) !== 200 && ref !== 304) { - a.textContent = req.status ? "Error " + req.statusText + " (" + req.status + ")" : 'Connection Error'; - return; - } - g.SITE.Build.spoilerRange[thread.board] = req.response.posts[0].custom_spoiler; - posts = []; - postsRoot = []; - filesCount = 0; - ref1 = req.response.posts; - for (i = 0, len = ref1.length; i < len; i++) { - postData = ref1[i]; - if (postData.no === thread.ID) { - continue; - } - if ((post = thread.posts.get(postData.no)) && !post.isFetchedQuote) { - if ('file' in post) { - filesCount++; - } - root = post.nodes.root; - postsRoot.push(root); - continue; - } - root = g.SITE.Build.postFromObject(postData, thread.board.ID); - post = new Post(root, thread, thread.board); - if ('file' in post) { - filesCount++; - } - posts.push(post); - postsRoot.push(root); - } - Main.callbackNodes('Post', posts); - $.after(a, postsRoot); - $.event('PostsInserted', null, a.parentNode); - postsCount = postsRoot.length; - a.textContent = g.SITE.Build.summaryText('-', postsCount, filesCount); - if (root) { - a2 = a.cloneNode(true); - a2.classList.add('summary-bottom'); - $.on(a2, 'click', ExpandThread.cbToggleBottom); - return $.after(root, a2); - } - } - }; - - return ExpandThread; - -}).call(this); - -FileInfo = (function() { - var FileInfo; - - FileInfo = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread' && ref !== 'archive') || !Conf['File Info Formatting']) { - return; - } - return Callbacks.Post.push({ - name: 'File Info Formatting', - cb: this.node - }); - }, - node: function() { - var a, i, info, j, len, len1, oldInfo, ref, ref1; - if (!this.file) { - return; - } - if (this.isClone) { - ref = $$('.file-info .download-button', this.file.text); - for (i = 0, len = ref.length; i < len; i++) { - a = ref[i]; - $.on(a, 'click', ImageCommon.download); - } - ref1 = $$('.file-info .quick-filter-md5', this.file.text); - for (j = 0, len1 = ref1.length; j < len1; j++) { - a = ref1[j]; - $.on(a, 'click', Filter.quickFilterMD5); - } - return; - } - oldInfo = $.el('span', { - className: 'fileText-original' - }); - $.prepend(this.file.link.parentNode, oldInfo); - $.add(oldInfo, [this.file.link.previousSibling, this.file.link, this.file.link.nextSibling]); - info = $.el('span', { - className: 'file-info' - }); - FileInfo.format(Conf['fileInfo'], this, info); - return $.prepend(this.file.text, info); - }, - format: function(formatString, post, outputNode) { - var a, i, j, len, len1, output, ref, ref1; - output = []; - formatString.replace(/%(.)|[^%]+/g, function(s, c) { - output.push($.hasOwn(FileInfo.formatters, c) ? FileInfo.formatters[c].call(post) : {innerHTML: E(s)}); - return ''; - }); - $.extend(outputNode, {innerHTML: E.cat(output)}); - ref = $$('.download-button', outputNode); - for (i = 0, len = ref.length; i < len; i++) { - a = ref[i]; - $.on(a, 'click', ImageCommon.download); - } - ref1 = $$('.quick-filter-md5', outputNode); - for (j = 0, len1 = ref1.length; j < len1; j++) { - a = ref1[j]; - $.on(a, 'click', Filter.quickFilterMD5); - } - }, - formatters: { - t: function() { - return {innerHTML: E(this.file.url.match(/[^/]*$/)[0])}; - }, - T: function() { - return {innerHTML: "" + (FileInfo.formatters.t.call(this)).innerHTML + ""}; - }, - l: function() { - return {innerHTML: "" + (FileInfo.formatters.n.call(this)).innerHTML + ""}; - }, - L: function() { - return {innerHTML: "" + (FileInfo.formatters.N.call(this)).innerHTML + ""}; - }, - n: function() { - var fullname, shortname; - fullname = this.file.name; - shortname = SW.yotsuba.Build.shortFilename(this.file.name, this.isReply); - if (fullname === shortname) { - return {innerHTML: E(fullname)}; - } else { - return {innerHTML: "" + E(shortname) + "" + E(fullname) + ""}; - } - }, - N: function() { - return {innerHTML: E(this.file.name)}; - }, - d: function() { - return {innerHTML: ""}; - }, - f: function() { - return {innerHTML: ""}; - }, - p: function() { - return {innerHTML: ((this.file.isSpoiler) ? "Spoiler, " : "")}; - }, - s: function() { - return {innerHTML: E(this.file.size)}; - }, - B: function() { - return {innerHTML: E(Math.round(this.file.sizeInBytes)) + " Bytes"}; - }, - K: function() { - return {innerHTML: E(Math.round(this.file.sizeInBytes/1024)) + " KB"}; - }, - M: function() { - return {innerHTML: E(Math.round(this.file.sizeInBytes/1048576*100)/100) + " MB"}; - }, - r: function() { - return {innerHTML: E(this.file.dimensions || "PDF")}; - }, - g: function() { - return {innerHTML: ((this.file.tag) ? ", " + E(this.file.tag) : "")}; - }, - '%': function() { - return {innerHTML: "%"}; - } - } - }; - - return FileInfo; - -}).call(this); - -Flash = (function() { - var Flash; - - Flash = { - init: function() { - if (g.BOARD.ID === 'f' && Conf['Enable Native Flash Embedding']) { - return $.ready(Flash.initReady); - } - }, - initReady: function() { - if ($.hasStorage) { - return $.global(function() { - if (JSON.parse(localStorage['4chan-settings'] || '{}').disableAll) { - return window.SWFEmbed.init(); - } - }); - } else { - if (g.VIEW === 'thread') { - $.global(function() { - return window.Main.tid = location.pathname.split(/\/+/)[3]; - }); - } - return $.global(function() { - return window.SWFEmbed.init(); - }); - } - } - }; - - return Flash; - -}).call(this); - -Fourchan = (function() { - var Fourchan; - - Fourchan = { - init: function() { - var ref; - if (!(g.SITE.software === 'yotsuba' && ((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive'))) { - return; - } - BoardConfig.ready(this.initBoard); - return Main.ready(this.initReady); - }, - initBoard: function() { - if (g.BOARD.config.code_tags) { - $.on(window, 'prettyprint:cb', function(e) { - var post, pre; - if (!(post = g.posts.get(e.detail.ID))) { - return; - } - if (!(pre = $$('.prettyprint', post.nodes.comment)[+e.detail.i])) { - return; - } - if (!$.hasClass(pre, 'prettyprinted')) { - pre.innerHTML = e.detail.html; - return $.addClass(pre, 'prettyprinted'); - } - }); - $.global(function() { - return window.addEventListener('prettyprint', function(e) { - return window.dispatchEvent(new CustomEvent('prettyprint:cb', { - detail: { - ID: e.detail.ID, - i: e.detail.i, - html: window.prettyPrintOne(e.detail.html) - } - })); - }, false); - }); - Callbacks.Post.push({ - name: 'Parse [code] tags', - cb: Fourchan.code - }); - g.posts.forEach(function(post) { - if (post.callbacksExecuted) { - return Callbacks.Post.execute(post, ['Parse [code] tags'], true); - } - }); - ExpandComment.callbacks.push(Fourchan.code); - } - if (g.BOARD.config.math_tags) { - $.global(function() { - return window.addEventListener('mathjax', function(e) { - if (window.MathJax) { - return window.MathJax.Hub.Queue(['Typeset', window.MathJax.Hub, e.target]); - } else { - if (!document.querySelector('script[src^="//cdn.mathjax.org/"]')) { - window.loadMathJax(); - window.loadMathJax = function() {}; - } - if (!e.target.classList.contains('postMessage')) { - return document.querySelector('script[src^="//cdn.mathjax.org/"]').addEventListener('load', function() { - return window.MathJax.Hub.Queue(['Typeset', window.MathJax.Hub, e.target]); - }, false); - } - } - }, false); - }); - Callbacks.Post.push({ - name: 'Parse [math] tags', - cb: Fourchan.math - }); - g.posts.forEach(function(post) { - if (post.callbacksExecuted) { - return Callbacks.Post.execute(post, ['Parse [math] tags'], true); - } - }); - return ExpandComment.callbacks.push(Fourchan.math); - } - }, - initReady: function() { - return $.global(function() { - var j, len, node, ref; - window.clickable_ids = false; - ref = document.querySelectorAll('.posteruid, .capcode'); - for (j = 0, len = ref.length; j < len; j++) { - node = ref[j]; - node.removeEventListener('click', window.idClick, false); - } - }); - }, - code: function() { - if (this.isClone) { - return; - } - return $.ready((function(_this) { - return function() { - var i, j, len, pre, ref; - ref = $$('.prettyprint', _this.nodes.comment); - for (i = j = 0, len = ref.length; j < len; i = ++j) { - pre = ref[i]; - if (!$.hasClass(pre, 'prettyprinted')) { - $.event('prettyprint', { - ID: _this.fullID, - i: i, - html: pre.innerHTML - }, window); - } - } - }; - })(this)); - }, - math: function() { - var cb, j, len, wbr, wbrs; - if (!/\[(math|eqn)\]/.test(this.nodes.comment.textContent)) { - return; - } - if ((wbrs = $$('wbr', this.nodes.comment)).length) { - for (j = 0, len = wbrs.length; j < len; j++) { - wbr = wbrs[j]; - $.rm(wbr); - } - this.nodes.comment.normalize(); - } - cb = (function(_this) { - return function() { - if (!doc.contains(_this.nodes.comment)) { - return; - } - $.off(d, 'PostsInserted', cb); - return $.event('mathjax', null, _this.nodes.comment); - }; - })(this); - $.on(d, 'PostsInserted', cb); - return cb(); - } - }; - - return Fourchan; - -}).call(this); - -IDColor = (function() { - var IDColor; - - IDColor = { - init: function() { - var ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Color User IDs'])) { - return; - } - this.ids = $.dict(); - this.ids['Heaven'] = [0, 0, 0, '#fff']; - return Callbacks.Post.push({ - name: 'Color User IDs', - cb: this.node - }); - }, - node: function() { - var rgb, span, style, uid; - if (this.isClone || !((uid = this.info.uniqueID) && (span = this.nodes.uniqueID))) { - return; - } - rgb = IDColor.ids[uid] || IDColor.compute(uid); - style = span.style; - style.color = rgb[3]; - style.backgroundColor = "rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + ")"; - return $.addClass(span, 'painted'); - }, - compute: function(uid) { - var hash, rgb; - hash = g.SITE.uidColor ? g.SITE.uidColor(uid) : parseInt(uid, 16); - rgb = [(hash >> 16) & 0xFF, (hash >> 8) & 0xFF, hash & 0xFF]; - rgb.push($.luma(rgb) > 125 ? '#000' : '#fff'); - return this.ids[uid] = rgb; - } - }; - - return IDColor; - -}).call(this); - -IDHighlight = (function() { - var IDHighlight; - - IDHighlight = { - init: function() { - var ref; - if ((ref = g.VIEW) !== 'index' && ref !== 'thread') { - return; - } - return Callbacks.Post.push({ - name: 'Highlight by User ID', - cb: this.node - }); - }, - uniqueID: null, - node: function() { - if (this.nodes.uniqueIDRoot) { - $.on(this.nodes.uniqueIDRoot, 'click', IDHighlight.click(this)); - } - if (this.nodes.capcode) { - $.on(this.nodes.capcode, 'click', IDHighlight.click(this)); - } - if (!this.isClone) { - return IDHighlight.set(this); - } - }, - set: function(post) { - var match; - match = (post.info.uniqueID || post.info.capcode) === IDHighlight.uniqueID; - return $[match ? 'addClass' : 'rmClass'](post.nodes.post, 'highlight'); - }, - click: function(post) { - return function() { - var uniqueID; - uniqueID = post.info.uniqueID || post.info.capcode; - IDHighlight.uniqueID = IDHighlight.uniqueID === uniqueID ? null : uniqueID; - return g.posts.forEach(IDHighlight.set); - }; - } - }; - - return IDHighlight; - -}).call(this); - -IDPostCount = (function() { - var IDPostCount; - - IDPostCount = { - init: function() { - if (!(g.VIEW === 'thread' && Conf['Count Posts by ID'])) { - return; - } - Callbacks.Thread.push({ - name: 'Count Posts by ID', - cb: function() { - return IDPostCount.thread = this; - } - }); - return Callbacks.Post.push({ - name: 'Count Posts by ID', - cb: this.node - }); - }, - node: function() { - if (this.nodes.uniqueID && this.thread === IDPostCount.thread) { - return $.on(this.nodes.uniqueID, 'mouseover', IDPostCount.count); - } - }, - count: function() { - var n, uniqueID; - uniqueID = Get.postFromNode(this).info.uniqueID; - n = 0; - IDPostCount.thread.posts.forEach(function(post) { - if (post.info.uniqueID === uniqueID) { - return n++; - } - }); - return this.title = n + " post" + (n === 1 ? '' : 's') + " by this ID"; - } - }; - - return IDPostCount; - -}).call(this); - -Keybinds = (function() { - var Keybinds; - - Keybinds = { - init: function() { - var hotkey, init; - if (!Conf['Keybinds']) { - return; - } - for (hotkey in Config.hotkeys) { - $.sync(hotkey, Keybinds.sync); - } - init = function() { - var i, len, node, ref; - $.off(d, '4chanXInitFinished', init); - $.on(d, 'keydown', Keybinds.keydown); - ref = $$('[accesskey]'); - for (i = 0, len = ref.length; i < len; i++) { - node = ref[i]; - node.removeAttribute('accesskey'); - } - }; - return $.on(d, '4chanXInitFinished', init); - }, - sync: function(key, hotkey) { - return Conf[hotkey] = key; - }, - keydown: function(e) { - var base, base1, catalog, i, key, len, notification, notifications, post, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, searchInput, target, thread, threadRoot; - if (!(key = Keybinds.keyCode(e))) { - return; - } - target = e.target; - if ((ref = target.nodeName) === 'INPUT' || ref === 'TEXTAREA') { - if (!(/(Esc|Alt|Ctrl|Meta|Shift\+\w{2,})/.test(key) && !/^Alt\+(\d|Up|Down|Left|Right)$/.test(key))) { - return; - } - } - if ((ref1 = g.VIEW) === 'index' || ref1 === 'thread') { - threadRoot = Nav.getThread(); - thread = Get.threadFromRoot(threadRoot); - } - switch (key) { - case Conf['Toggle board list']: - if (!Conf['Custom Board Navigation']) { - return; - } - Header.toggleBoardList(); - break; - case Conf['Toggle header']: - Header.toggleBarVisibility(); - break; - case Conf['Open empty QR']: - if (!QR.postingIsEnabled) { - return; - } - Keybinds.qr(); - break; - case Conf['Open QR']: - if (!(QR.postingIsEnabled && threadRoot)) { - return; - } - Keybinds.qr(threadRoot); - break; - case Conf['Open settings']: - Settings.open(); - break; - case Conf['Close']: - if (Settings.dialog) { - Settings.close(); - } else if ((notifications = $$('.notification')).length) { - for (i = 0, len = notifications.length; i < len; i++) { - notification = notifications[i]; - $('.close', notification).click(); - } - } else if (QR.nodes && !(QR.nodes.el.hidden || window.getComputedStyle(QR.nodes.form).display === 'none')) { - if (Conf['Persistent QR']) { - QR.hide(); - } else { - QR.close(); - } - } else if (Embedding.lastEmbed) { - Embedding.closeFloat(); - } else { - return; - } - break; - case Conf['Spoiler tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('spoiler', target); - break; - case Conf['Code tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('code', target); - break; - case Conf['Eqn tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('eqn', target); - break; - case Conf['Math tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('math', target); - break; - case Conf['SJIS tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('sjis', target); - break; - case Conf['Toggle sage']: - if (!(QR.nodes && !QR.nodes.el.hidden)) { - return; - } - Keybinds.sage(); - break; - case Conf['Toggle Cooldown']: - if (!(QR.nodes && !QR.nodes.el.hidden && $.hasClass(QR.nodes.fileSubmit, 'custom-cooldown'))) { - return; - } - QR.toggleCustomCooldown(); - break; - case Conf['Post from URL']: - if (!QR.postingIsEnabled) { - return; - } - QR.handleUrl(''); - break; - case Conf['Add new post']: - if (!QR.postingIsEnabled) { - return; - } - QR.addPost(); - break; - case Conf['Submit QR']: - if (!(QR.nodes && !QR.nodes.el.hidden)) { - return; - } - if (!QR.status()) { - QR.submit(); - } - break; - case Conf['Update']: - switch (g.VIEW) { - case 'thread': - if (!ThreadUpdater.enabled) { - return; - } - ThreadUpdater.update(); - break; - case 'index': - if (!Index.enabled) { - return; - } - Index.update(); - break; - default: - return; - } - break; - case Conf['Watch']: - if (!(ThreadWatcher.enabled && thread)) { - return; - } - ThreadWatcher.toggle(thread); - break; - case Conf['Update thread watcher']: - if (!ThreadWatcher.enabled) { - return; - } - ThreadWatcher.buttonFetchAll(); - break; - case Conf['Toggle thread watcher']: - if (!ThreadWatcher.enabled) { - return; - } - ThreadWatcher.toggleWatcher(); - break; - case Conf['Toggle threading']: - if (!QuoteThreading.ready) { - return; - } - QuoteThreading.toggleThreading(); - break; - case Conf['Mark thread read']: - if (!(g.VIEW === 'index' && thread && UnreadIndex.enabled)) { - return; - } - UnreadIndex.markRead.call(threadRoot); - break; - case Conf['Expand image']: - if (!(ImageExpand.enabled && threadRoot)) { - return; - } - post = Get.postFromNode(Keybinds.post(threadRoot)); - if (post.file) { - ImageExpand.toggle(post); - } - break; - case Conf['Expand images']: - if (!ImageExpand.enabled) { - return; - } - ImageExpand.cb.toggleAll(); - break; - case Conf['Open Gallery']: - if (!Gallery.enabled) { - return; - } - Gallery.cb.toggle(); - break; - case Conf['fappeTyme']: - if (!((ref2 = FappeTyme.nodes) != null ? ref2.fappe : void 0)) { - return; - } - FappeTyme.toggle('fappe'); - break; - case Conf['werkTyme']: - if (!((ref3 = FappeTyme.nodes) != null ? ref3.werk : void 0)) { - return; - } - FappeTyme.toggle('werk'); - break; - case Conf['Front page']: - if (Index.enabled) { - Index.userPageNav(1); - } else { - location.href = "/" + g.BOARD + "/"; - } - break; - case Conf['Open front page']: - $.open(location.origin + "/" + g.BOARD + "/"); - break; - case Conf['Next page']: - if (!(g.VIEW === 'index' && !(typeof (base = g.SITE).isOnePage === "function" ? base.isOnePage(g.BOARD) : void 0))) { - return; - } - if (Index.enabled) { - if ((ref4 = Conf['Index Mode']) !== 'paged' && ref4 !== 'infinite') { - return; - } - $('.next button', Index.pagelist).click(); - } else { - if ((ref5 = $(g.SITE.selectors.nav.next)) != null) { - ref5.click(); - } - } - break; - case Conf['Previous page']: - if (!(g.VIEW === 'index' && !(typeof (base1 = g.SITE).isOnePage === "function" ? base1.isOnePage(g.BOARD) : void 0))) { - return; - } - if (Index.enabled) { - if ((ref6 = Conf['Index Mode']) !== 'paged' && ref6 !== 'infinite') { - return; - } - $('.prev button', Index.pagelist).click(); - } else { - if ((ref7 = $(g.SITE.selectors.nav.prev)) != null) { - ref7.click(); - } - } - break; - case Conf['Search form']: - if (g.VIEW !== 'index') { - return; - } - searchInput = Index.enabled ? Index.searchInput : g.SITE.selectors.searchBox ? $(g.SITE.selectors.searchBox) : void 0; - if (!searchInput) { - return; - } - Header.scrollToIfNeeded(searchInput); - searchInput.focus(); - break; - case Conf['Paged mode']: - if (!Index.enabledOn(g.BOARD)) { - return; - } - location.href = g.VIEW === 'index' ? '#paged' : "/" + g.BOARD + "/#paged"; - break; - case Conf['Infinite scrolling mode']: - if (!Index.enabledOn(g.BOARD)) { - return; - } - location.href = g.VIEW === 'index' ? '#infinite' : "/" + g.BOARD + "/#infinite"; - break; - case Conf['All pages mode']: - if (!Index.enabledOn(g.BOARD)) { - return; - } - location.href = g.VIEW === 'index' ? '#all-pages' : "/" + g.BOARD + "/#all-pages"; - break; - case Conf['Open catalog']: - if (!(catalog = CatalogLinks.catalog())) { - return; - } - location.href = catalog; - break; - case Conf['Cycle sort type']: - if (!Index.enabled) { - return; - } - Index.cycleSortType(); - break; - case Conf['Next thread']: - if (!(g.VIEW === 'index' && threadRoot)) { - return; - } - Nav.scroll(+1); - break; - case Conf['Previous thread']: - if (!(g.VIEW === 'index' && threadRoot)) { - return; - } - Nav.scroll(-1); - break; - case Conf['Expand thread']: - if (!(g.VIEW === 'index' && threadRoot)) { - return; - } - ExpandThread.toggle(thread); - Header.scrollTo(threadRoot); - break; - case Conf['Open thread']: - if (!(g.VIEW === 'index' && threadRoot)) { - return; - } - Keybinds.open(thread); - break; - case Conf['Open thread tab']: - if (!(g.VIEW === 'index' && threadRoot)) { - return; - } - Keybinds.open(thread, true); - break; - case Conf['Next reply']: - if (!threadRoot) { - return; - } - Keybinds.hl(+1, threadRoot); - break; - case Conf['Previous reply']: - if (!threadRoot) { - return; - } - Keybinds.hl(-1, threadRoot); - break; - case Conf['Deselect reply']: - if (!threadRoot) { - return; - } - Keybinds.hl(0, threadRoot); - break; - case Conf['Hide']: - if (!(thread && ThreadHiding.db)) { - return; - } - Header.scrollTo(threadRoot); - ThreadHiding.toggle(thread); - break; - case Conf['Quick Filter MD5']: - if (!threadRoot) { - return; - } - post = Keybinds.post(threadRoot); - Keybinds.hl(+1, threadRoot); - Filter.quickFilterMD5.call(post, e); - break; - case Conf['Previous Post Quoting You']: - if (!(threadRoot && QuoteYou.db)) { - return; - } - QuoteYou.cb.seek('preceding'); - break; - case Conf['Next Post Quoting You']: - if (!(threadRoot && QuoteYou.db)) { - return; - } - QuoteYou.cb.seek('following'); - break; - default: - return; - } - e.preventDefault(); - return e.stopPropagation(); - }, - keyCode: function(e) { - var kc, key; - key = (function() { - switch (kc = e.keyCode) { - case 8: - return ''; - case 13: - return 'Enter'; - case 27: - return 'Esc'; - case 32: - return 'Space'; - case 37: - return 'Left'; - case 38: - return 'Up'; - case 39: - return 'Right'; - case 40: - return 'Down'; - case 188: - return 'Comma'; - case 190: - return 'Period'; - case 191: - return 'Slash'; - case 59: - case 186: - return 'Semicolon'; - default: - if ((48 <= kc && kc <= 57) || (65 <= kc && kc <= 90)) { - return String.fromCharCode(kc).toLowerCase(); - } else if ((96 <= kc && kc <= 105)) { - return String.fromCharCode(kc - 48).toLowerCase(); - } else { - return null; - } - } - })(); - if (key) { - if (e.altKey) { - key = 'Alt+' + key; - } - if (e.ctrlKey) { - key = 'Ctrl+' + key; - } - if (e.metaKey) { - key = 'Meta+' + key; - } - if (e.shiftKey) { - key = 'Shift+' + key; - } - } - return key; - }, - post: function(thread) { - var s; - s = g.SITE.selectors; - return $("" + s.postContainer + s.highlightable.reply + "." + g.SITE.classes.highlight, thread) || $("" + (g.SITE.isOPContainerThread ? s.thread : s.postContainer) + s.highlightable.op, thread); - }, - qr: function(thread) { - QR.open(); - if (thread != null) { - QR.quote.call(Keybinds.post(thread)); - } - return QR.nodes.com.focus(); - }, - tags: function(tag, ta) { - var range, selEnd, selStart, value; - BoardConfig.ready(function() { - var config, supported; - config = g.BOARD.config; - supported = (function() { - switch (tag) { - case 'spoiler': - return !!config.spoilers; - case 'code': - return !!config.code_tags; - case 'math': - case 'eqn': - return !!config.math_tags; - case 'sjis': - return !!config.sjis_tags; - } - })(); - if (!supported) { - return new Notice('warning', "[" + tag + "] tags are not supported on /" + g.BOARD + "/.", 20); - } - }); - value = ta.value; - selStart = ta.selectionStart; - selEnd = ta.selectionEnd; - ta.value = value.slice(0, selStart) + ("[" + tag + "]") + value.slice(selStart, selEnd) + ("[/" + tag + "]") + value.slice(selEnd); - range = ("[" + tag + "]").length + selEnd; - ta.setSelectionRange(range, range); - return $.event('input', null, ta); - }, - sage: function() { - var isSage; - isSage = /sage/i.test(QR.nodes.email.value); - return QR.nodes.email.value = isSage ? "" : "sage"; - }, - open: function(thread, tab) { - var url; - if (g.VIEW !== 'index') { - return; - } - url = Get.url('thread', thread); - if (tab) { - return $.open(url); - } else { - return location.href = url; - } - }, - hl: function(delta, thread) { - var axis, height, highlight, i, len, next, postEl, replies, reply, replySelector, root; - replySelector = "" + g.SITE.selectors.postContainer + g.SITE.selectors.highlightable.reply; - highlight = g.SITE.classes.highlight; - postEl = $(replySelector + "." + highlight, thread); - if (!delta) { - if (postEl) { - $.rmClass(postEl, highlight); - } - return; - } - if (postEl) { - height = postEl.getBoundingClientRect().height; - if (Header.getTopOf(postEl) >= -height && Header.getBottomOf(postEl) >= -height) { - root = Get.postFromNode(postEl).nodes.root; - axis = delta === +1 ? 'following' : 'preceding'; - if (!(next = $.x(axis + "-sibling::" + g.SITE.xpath.replyContainer + "[not(@hidden) and not(child::div[@class='stub'])][1]", root))) { - return; - } - if (!next.matches(replySelector)) { - next = $(replySelector, next); - } - Header.scrollToIfNeeded(next, delta === +1); - $.addClass(next, highlight); - $.rmClass(postEl, highlight); - return; - } - $.rmClass(postEl, highlight); - } - replies = $$(replySelector, thread); - if (delta === -1) { - replies.reverse(); - } - for (i = 0, len = replies.length; i < len; i++) { - reply = replies[i]; - if (delta === +1 && Header.getTopOf(reply) > 0 || delta === -1 && Header.getBottomOf(reply) > 0) { - $.addClass(reply, highlight); - return; - } - } - } - }; - - return Keybinds; - -}).call(this); - -ModContact = (function() { - var ModContact; - - ModContact = { - init: function() { - var ref; - if (!(g.SITE.software === 'yotsuba' && ((ref = g.VIEW) === 'index' || ref === 'thread'))) { - return; - } - return Callbacks.Post.push({ - name: 'Mod Contact Links', - cb: this.node - }); - }, - node: function() { - var links, moveNote, moved; - if (this.isClone || !$.hasOwn(ModContact.specific, this.info.capcode)) { - return; - } - links = $.el('span', { - className: 'contact-links brackets-wrap' - }); - $.extend(links, ModContact.template(this.info.capcode)); - $.after(this.nodes.capcode, links); - if ((moved = this.info.comment.match(/This thread was moved to >>>\/(\w+)\//)) && $.hasOwn(ModContact.moveNote, moved[1])) { - moveNote = $.el('div', { - className: 'move-note' - }); - $.extend(moveNote, ModContact.moveNote[moved[1]]); - return $.add(this.nodes.post, moveNote); - } - }, - template: function(capcode) { - return {innerHTML: "feedback" + (ModContact.specific[capcode]()).innerHTML}; - }, - specific: { - Mod: function() { - return {innerHTML: " IRC"}; - }, - Manager: function() { - return ModContact.specific.Mod(); - }, - Developer: function() { - return {innerHTML: " github"}; - }, - Admin: function() { - return {innerHTML: " twitter"}; - } - }, - moveNote: { - qa: {innerHTML: "Moving a thread to /qa/ does not imply mods will read it. If you wish to contact mods, use feedback (https://www.4chan.org/feedback) or IRC (https://www.4chan-x.net/4chan-irc.html)."} - } - }; - - return ModContact; - -}).call(this); - -Nav = (function() { - var Nav; - - Nav = { - init: function() { - var append, next, prev, span; - switch (g.VIEW) { - case 'index': - if (!Conf['Index Navigation']) { - return; - } - break; - case 'thread': - if (!Conf['Reply Navigation']) { - return; - } - break; - default: - return; - } - span = $.el('span', { - id: 'navlinks' - }); - prev = $.el('a', { - textContent: '▲', - href: 'javascript:;' - }); - next = $.el('a', { - textContent: '▼', - href: 'javascript:;' - }); - $.on(prev, 'click', this.prev); - $.on(next, 'click', this.next); - $.add(span, [prev, $.tn(' '), next]); - append = function() { - $.off(d, '4chanXInitFinished', append); - return $.add(d.body, span); - }; - return $.on(d, '4chanXInitFinished', append); - }, - prev: function() { - if (g.VIEW === 'thread') { - return window.scrollTo(0, 0); - } else { - return Nav.scroll(-1); - } - }, - next: function() { - if (g.VIEW === 'thread') { - return window.scrollTo(0, d.body.scrollHeight); - } else { - return Nav.scroll(+1); - } - }, - getThread: function() { - var i, len, ref, thread, threadRoot; - if (g.VIEW === 'thread') { - return g.threads.get(g.BOARD + "." + g.THREADID).nodes.root; - } - if ($.hasClass(doc, 'catalog-mode')) { - return; - } - ref = $$(g.SITE.selectors.thread); - for (i = 0, len = ref.length; i < len; i++) { - threadRoot = ref[i]; - thread = Get.threadFromRoot(threadRoot); - if (thread.isHidden && !thread.stub) { - continue; - } - if (Header.getTopOf(threadRoot) >= -threadRoot.getBoundingClientRect().height) { - return threadRoot; - } - } - }, - scroll: function(delta) { - var axis, extra, next, ref, thread, top; - if ((ref = d.activeElement) != null) { - ref.blur(); - } - thread = Nav.getThread(); - if (!thread) { - return; - } - axis = delta === +1 ? 'following' : 'preceding'; - if (next = $.x(axis + "-sibling::" + g.SITE.xpath.thread + "[not(@hidden)][1]", thread)) { - top = Header.getTopOf(thread); - if (delta === +1 && top < 5 || delta === -1 && top > -5) { - thread = next; - } - } - extra = Header.getTopOf(thread) + doc.clientHeight - d.body.getBoundingClientRect().bottom; - if (extra > 0) { - d.body.style.marginBottom = extra + "px"; - } - Header.scrollTo(thread); - if (extra > 0 && !Nav.haveExtra) { - Nav.haveExtra = true; - return $.on(d, 'scroll', Nav.removeExtra); - } - }, - removeExtra: function() { - var extra; - extra = doc.clientHeight - d.body.getBoundingClientRect().bottom; - if (extra > 0) { - return d.body.style.marginBottom = extra + "px"; - } else { - d.body.style.marginBottom = ''; - delete Nav.haveExtra; - return $.off(d, 'scroll', Nav.removeExtra); - } - } - }; - - return Nav; - -}).call(this); - -NormalizeURL = (function() { - var NormalizeURL; - - NormalizeURL = { - init: function() { - var pathname; - if (!Conf['Normalize URL']) { - return; - } - pathname = location.pathname.split(/\/+/); - if (g.SITE.software === 'yotsuba') { - switch (g.VIEW) { - case 'thread': - pathname[2] = 'thread'; - pathname = pathname.slice(0, 4); - break; - case 'index': - pathname = pathname.slice(0, 3); - } - } - pathname = pathname.join('/'); - if (location.pathname !== pathname) { - return history.replaceState(history.state, '', location.protocol + "//" + location.host + pathname + location.hash); - } - } - }; - - return NormalizeURL; - -}).call(this); - -PSA = (function() { - var PSA, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - PSA = { - init: function() { - var announcement, el; - if (g.SITE.software === 'yotsuba' && g.BOARD.ID === 'qa') { - announcement = { - innerHTML: "Stay in touch with your /qa/ friends!" - }; - el = $.el('div', { - className: 'fcx-announcement' - }, announcement); - $.onExists(doc, '.boardBanner', function(banner) { - return $.after(banner, el); - }); - } - if ('samachan.org' in Conf['siteProperties'] && indexOf.call(Conf['PSAseen'], 'samachan') < 0) { - el = $.el('span', { - innerHTML: "Looking for a new home?
    Some former Samachan users are regrouping on SushiChan.

    (a message from 4chan X)" - }); - return Main.ready(function() { - new Notice('info', el); - Conf['PSAseen'].push('samachan'); - return $.set('PSAseen', Conf['PSAseen']); - }); - } - } - }; - - return PSA; - -}).call(this); - -PSAHiding = (function() { - var PSAHiding, - slice = [].slice; - - PSAHiding = { - init: function() { - if (!(Conf['Announcement Hiding'] && g.SITE.selectors.psa)) { - return; - } - $.addClass(doc, 'hide-announcement'); - $.onExists(doc, g.SITE.selectors.psa, this.setup); - return $.ready(function() { - if (!$(g.SITE.selectors.psa)) { - return $.rmClass(doc, 'hide-announcement'); - } - }); - }, - setup: function(psa) { - var btn, entry, hr, ref, ref1, ref2; - PSAHiding.psa = psa; - PSAHiding.text = (ref = psa.dataset.utc) != null ? ref : psa.innerHTML; - if (g.SITE.selectors.psaTop && (hr = (ref1 = $(g.SITE.selectors.psaTop)) != null ? ref1.previousElementSibling : void 0) && hr.nodeName === 'HR') { - PSAHiding.hr = hr; - } - PSAHiding.content = $.el('div'); - entry = { - el: $.el('a', { - textContent: 'Show announcement', - className: 'show-announcement', - href: 'javascript:;' - }), - order: 50, - open: function() { - return psa.hidden; - } - }; - Header.menu.addEntry(entry); - $.on(entry.el, 'click', PSAHiding.toggle); - PSAHiding.btn = btn = $.el('a', { - title: 'Mark announcement as read and hide.', - className: 'hide-announcement-button fa fa-minus-square', - href: 'javascript:;' - }); - $.on(btn, 'click', PSAHiding.toggle); - if (((ref2 = psa.firstChild) != null ? ref2.tagName : void 0) === 'HR') { - $.after(psa.firstChild, btn); - } else { - $.prepend(psa, btn); - } - PSAHiding.sync(Conf['hiddenPSAList']); - $.rmClass(doc, 'hide-announcement'); - return $.sync('hiddenPSAList', PSAHiding.sync); - }, - toggle: function() { - var hide, set; - hide = $.hasClass(this, 'hide-announcement-button'); - set = function(hiddenPSAList) { - if (hide) { - return hiddenPSAList[g.SITE.ID] = PSAHiding.text; - } else { - return delete hiddenPSAList[g.SITE.ID]; - } - }; - set(Conf['hiddenPSAList']); - PSAHiding.sync(Conf['hiddenPSAList']); - return $.get('hiddenPSAList', Conf['hiddenPSAList'], function(arg) { - var hiddenPSAList; - hiddenPSAList = arg.hiddenPSAList; - set(hiddenPSAList); - return $.set('hiddenPSAList', hiddenPSAList); - }); - }, - sync: function(hiddenPSAList) { - var content, psa, ref; - psa = PSAHiding.psa, content = PSAHiding.content; - psa.hidden = hiddenPSAList[g.SITE.ID] === PSAHiding.text; - if (psa.hidden) { - $.add(content, slice.call(psa.childNodes)); - } else { - $.add(psa, slice.call(content.childNodes)); - } - return (ref = PSAHiding.hr) != null ? ref.hidden = psa.hidden : void 0; - } - }; - - return PSAHiding; - -}).call(this); - -PassMessage = (function() { - var PassMessage; - - PassMessage = { - init: function() { - var close, msg; - if (Conf['passMessageClosed']) { - return; - } - msg = $.el('div', { - className: 'box-outer top-box' - }, {innerHTML: "

    Trouble buying a 4chan Pass? (a message from 4chan X) ×

    Check the 4chan X wiki for alternative solutions.
    "}); - msg.style.cssText = 'padding-bottom: 0;'; - close = $('a', msg); - $.on(close, 'click', function() { - $.rm(msg); - return $.set('passMessageClosed', true); - }); - return $.ready(function() { - var hd; - if ((hd = $.id('hd'))) { - return $.after(hd, msg); - } else { - return $.prepend(d.body, msg); - } - }); - } - }; - - return PassMessage; - -}).call(this); - -PostJumper = (function() { - var PostJumper; - - PostJumper = { - init: function() { - var ref; - if (!(Conf['Unique ID and Capcode Navigation'] && ((ref = g.VIEW) === 'index' || ref === 'thread'))) { - return; - } - this.buttons = this.makeButtons(); - return Callbacks.Post.push({ - name: 'Post Jumper', - cb: this.node - }); - }, - node: function() { - var buttons, i, len, ref; - if (this.isClone) { - ref = $$('.postJumper', this.nodes.info); - for (i = 0, len = ref.length; i < len; i++) { - buttons = ref[i]; - PostJumper.addListeners(buttons); - } - return; - } - if (this.nodes.uniqueIDRoot) { - PostJumper.addButtons(this, 'uniqueID'); - } - if (this.nodes.capcode) { - return PostJumper.addButtons(this, 'capcode'); - } - }, - addButtons: function(post, type) { - var buttons, value; - value = post.info[type]; - buttons = PostJumper.buttons.cloneNode(true); - $.extend(buttons.dataset, { - type: type, - value: value - }); - $.after(post.nodes[type + (type === 'capcode' ? '' : 'Root')], buttons); - return PostJumper.addListeners(buttons); - }, - addListeners: function(buttons) { - $.on(buttons.firstChild, 'click', PostJumper.buttonClick); - return $.on(buttons.lastChild, 'click', PostJumper.buttonClick); - }, - buttonClick: function() { - var dir, toJumper; - dir = $.hasClass(this, 'prev') ? -1 : 1; - if ((toJumper = PostJumper.find(this.parentNode, dir))) { - return PostJumper.scroll(this.parentNode, toJumper); - } - }, - find: function(jumper, dir) { - var axis, jumper2, ref, type, value, xpath; - ref = jumper.dataset, type = ref.type, value = ref.value; - xpath = "span[contains(@class,\"postJumper\") and @data-value=\"" + value + "\" and @data-type=\"" + type + "\"]"; - axis = dir < 0 ? 'preceding' : 'following'; - jumper2 = jumper; - while ((jumper2 = $.x(axis + "::" + xpath, jumper2))) { - if (jumper2.getBoundingClientRect().height) { - return jumper2; - } - } - if ((jumper2 = $.x("(//" + xpath + ")[" + (dir < 0 ? 'last()' : '1') + "]"))) { - if (jumper2.getBoundingClientRect().height) { - return jumper2; - } - } - while ((jumper2 = $.x(axis + "::" + xpath, jumper2)) && jumper2 !== jumper) { - if (jumper2.getBoundingClientRect().height) { - return jumper2; - } - } - return null; - }, - makeButtons: function() { - var charNext, charPrev, classNext, classPrev, span; - charPrev = '\u23EB'; - charNext = '\u23EC'; - classPrev = 'prev'; - classNext = 'next'; - span = $.el('span', { - className: 'postJumper' - }); - $.extend(span, {innerHTML: "" + E(charPrev) + "" + E(charNext) + ""}); - return span; - }, - scroll: function(fromJumper, toJumper) { - var destPos, prevPos; - prevPos = fromJumper.getBoundingClientRect().top; - destPos = toJumper.getBoundingClientRect().top; - return window.scrollBy(0, destPos - prevPos); - } - }; - - return PostJumper; - -}).call(this); - -RelativeDates = (function() { - var RelativeDates, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - RelativeDates = { - INTERVAL: $.MINUTE / 2, - init: function() { - var ref; - if (((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || Index.enabled) { - this.flush(); - $.on(d, 'visibilitychange PostsInserted', this.flush); - } - if (Conf['Relative Post Dates']) { - return Callbacks.Post.push({ - name: 'Relative Post Dates', - cb: this.node - }); - } - }, - node: function() { - var dateEl; - if (!this.info.date) { - return; - } - dateEl = this.nodes.date; - if (Conf['Relative Date Title']) { - $.on(dateEl, 'mouseover', (function(_this) { - return function() { - return RelativeDates.hover(_this); - }; - })(this)); - return; - } - if (this.isClone) { - return; - } - dateEl.title = dateEl.textContent; - return RelativeDates.update(this); - }, - relative: function(diff, now, date, abbrev) { - var days, months, number, rounded, unit, years; - unit = (number = diff / $.DAY) >= 1 ? (years = now.getFullYear() - date.getFullYear(), months = now.getMonth() - date.getMonth(), days = now.getDate() - date.getDate(), years > 1 ? (number = years - (months < 0 || months === 0 && days < 0), 'year') : years === 1 && (months > 0 || months === 0 && days >= 0) ? (number = years, 'year') : (months = months + 12 * years) > 1 ? (number = months - (days < 0), 'month') : months === 1 && days >= 0 ? (number = months, 'month') : 'day') : (number = diff / $.HOUR) >= 1 ? 'hour' : (number = diff / $.MINUTE) >= 1 ? 'minute' : (number = Math.max(0, diff) / $.SECOND, 'second'); - rounded = Math.round(number); - if (abbrev) { - unit = unit === 'month' ? 'mo' : unit[0]; - } else { - if (rounded !== 1) { - unit += 's'; - } - } - if (abbrev) { - return "" + rounded + unit; - } else { - return rounded + " " + unit + " ago"; - } - }, - stale: [], - flush: function() { - var data, i, len, now, ref; - if (d.hidden) { - return; - } - now = new Date(); - ref = RelativeDates.stale; - for (i = 0, len = ref.length; i < len; i++) { - data = ref[i]; - RelativeDates.update(data, now); - } - RelativeDates.stale = []; - clearTimeout(RelativeDates.timeout); - return RelativeDates.timeout = setTimeout(RelativeDates.flush, RelativeDates.INTERVAL); - }, - hover: function(post) { - var date, diff, now; - date = post.info.date; - now = new Date(); - diff = now - date; - return post.nodes.date.title = RelativeDates.relative(diff, now, date); - }, - update: function(data, now) { - var abbrev, date, diff, i, isPost, len, ref, relative, singlePost; - isPost = data instanceof Post; - if (isPost) { - date = data.info.date; - abbrev = false; - } else { - date = new Date(+data.dataset.utc); - abbrev = !!data.dataset.abbrev; - } - now || (now = new Date()); - diff = now - date; - relative = RelativeDates.relative(diff, now, date, abbrev); - if (isPost) { - ref = [data].concat(data.clones); - for (i = 0, len = ref.length; i < len; i++) { - singlePost = ref[i]; - singlePost.nodes.date.firstChild.textContent = relative; - } - } else { - data.firstChild.textContent = relative; - } - return RelativeDates.setOwnTimeout(diff, data); - }, - setOwnTimeout: function(diff, data) { - var delay; - delay = diff < $.MINUTE ? $.SECOND - (diff + $.SECOND / 2) % $.SECOND : diff < $.HOUR ? $.MINUTE - (diff + $.MINUTE / 2) % $.MINUTE : diff < $.DAY ? $.HOUR - (diff + $.HOUR / 2) % $.HOUR : $.DAY - (diff + $.DAY / 2) % $.DAY; - return setTimeout(RelativeDates.markStale, delay, data); - }, - markStale: function(data) { - if (indexOf.call(RelativeDates.stale, data) >= 0) { - return; - } - if (data instanceof Post && !g.posts.get(data.fullID)) { - return; - } - if (data instanceof Element && !doc.contains(data)) { - return; - } - return RelativeDates.stale.push(data); - } - }; - - return RelativeDates; - -}).call(this); - -RemoveSpoilers = (function() { - var RemoveSpoilers, - slice = [].slice; - - RemoveSpoilers = { - init: function() { - if (Conf['Reveal Spoilers']) { - $.addClass(doc, 'reveal-spoilers'); - } - if (!Conf['Remove Spoilers']) { - return; - } - Callbacks.Post.push({ - name: 'Reveal Spoilers', - cb: this.node - }); - if (g.VIEW === 'archive') { - return $.ready(function() { - return RemoveSpoilers.unspoiler($.id('arc-list')); - }); - } - }, - node: function() { - return RemoveSpoilers.unspoiler(this.nodes.comment); - }, - unspoiler: function(el) { - var i, len, span, spoiler, spoilers; - spoilers = $$(g.SITE.selectors.spoiler, el); - for (i = 0, len = spoilers.length; i < len; i++) { - spoiler = spoilers[i]; - span = $.el('span', { - className: 'removed-spoiler' - }); - $.replace(spoiler, span); - $.add(span, slice.call(spoiler.childNodes)); - } - } - }; - - return RemoveSpoilers; - -}).call(this); - -Report = (function() { - var Report; - - Report = { - init: function() { - var match; - if (!(match = location.search.match(/\bno=(\d+)/))) { - return; - } - Captcha.replace.init(); - this.postID = +match[1]; - return $.ready(this.ready); - }, - ready: function() { - $.addStyle(CSS.report); - if (Conf['Archive Report']) { - Report.archive(); - } - new MutationObserver(function() { - Report.fit('iframe[src^="https://www.google.com/recaptcha/api2/frame"]'); - return Report.fit('body'); - }).observe(d.body, { - childList: true, - attributes: true, - subtree: true - }); - return Report.fit('body'); - }, - fit: function(selector) { - var dy, el; - if (!((el = $(selector, doc)) && getComputedStyle(el).visibility !== 'hidden')) { - return; - } - dy = el.getBoundingClientRect().bottom - doc.clientHeight + 8; - if (dy > 0) { - return window.resizeBy(0, dy); - } - }, - archive: function() { - var enabled, fieldset, form, match, message, reason, submit, types, urls; - if (!(urls = Redirect.report(g.BOARD.ID)).length) { - return; - } - form = $('form'); - types = $.id('reportTypes'); - message = $('h3'); - fieldset = $.el('fieldset', { - id: 'archive-report', - hidden: true - }, {innerHTML: ""}); - enabled = $('#archive-report-enabled', fieldset); - reason = $('#archive-report-reason', fieldset); - submit = $('#archive-report-submit', fieldset); - $.on(enabled, 'change', function() { - return reason.disabled = !this.checked; - }); - if (form && types) { - fieldset.hidden = !$('[value="31"]', types).checked; - $.on(types, 'change', function(e) { - fieldset.hidden = e.target.value !== '31'; - return Report.fit('body'); - }); - $.after(types, fieldset); - Report.fit('body'); - $.one(form, 'submit', function(e) { - if (!fieldset.hidden && enabled.checked) { - e.preventDefault(); - return Report.archiveSubmit(urls, reason.value, (function(_this) { - return function(results) { - _this.action = '#archiveresults=' + encodeURIComponent(JSON.stringify(results)); - return _this.submit(); - }; - })(this)); - } - }); - } else if (message) { - fieldset.hidden = /Report submitted!/.test(message.textContent); - $.on(enabled, 'change', function() { - return submit.hidden = !this.checked; - }); - $.after(message, fieldset); - $.on(submit, 'click', function() { - return Report.archiveSubmit(urls, reason.value, Report.archiveResults); - }); - } - if ((match = location.hash.match(/^#archiveresults=(.*)$/))) { - try { - return Report.archiveResults(JSON.parse(decodeURIComponent(match[1]))); - } catch (error) {} - } - }, - archiveSubmit: function(urls, reason, cb) { - var fn, form, i, len, name, ref, results, url; - form = $.formData({ - board: g.BOARD.ID, - num: Report.postID, - reason: reason - }); - results = []; - fn = function(name, url) { - return $.ajax(url, { - onloadend: function() { - results.push([ - name, this.response || { - error: '' - } - ]); - if (results.length === urls.length) { - return cb(results); - } - }, - form: form - }); - }; - for (i = 0, len = urls.length; i < len; i++) { - ref = urls[i], name = ref[0], url = ref[1]; - fn(name, url); - } - }, - archiveResults: function(results) { - var fieldset, i, len, line, name, ref, response; - fieldset = $.id('archive-report'); - for (i = 0, len = results.length; i < len; i++) { - ref = results[i], name = ref[0], response = ref[1]; - line = $.el('h3', { - className: 'archive-report-response' - }); - if ('success' in response) { - $.addClass(line, 'archive-report-success'); - line.textContent = name + ": " + response.success; - } else { - $.addClass(line, 'archive-report-error'); - line.textContent = name + ": " + (response.error || 'Error reporting post.'); - } - if (fieldset) { - $.before(fieldset, line); - } else { - $.add(d.body, line); - } - } - } - }; - - return Report; - -}).call(this); - -ThreadLinks = (function() { - var ThreadLinks; - - ThreadLinks = { - init: function() { - if (!(g.VIEW === 'index' && Conf['Open Threads in New Tab'])) { - return; - } - Callbacks.Post.push({ - name: 'Thread Links', - cb: this.node - }); - return Callbacks.CatalogThread.push({ - name: 'Thread Links', - cb: this.catalogNode - }); - }, - node: function() { - if (this.isReply || this.isClone) { - return; - } - return ThreadLinks.process(this.nodes.reply); - }, - catalogNode: function() { - return ThreadLinks.process(this.nodes.thumb.parentNode); - }, - process: function(link) { - return link.target = '_blank'; - } - }; - - return ThreadLinks; - -}).call(this); - -Time = (function() { - var Time; - - Time = { - init: function() { - var ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive') && Conf['Time Formatting'])) { - return; - } - return Callbacks.Post.push({ - name: 'Time Formatting', - cb: this.node - }); - }, - node: function() { - var textContent; - if (!this.info.date || this.isClone) { - return; - } - textContent = this.nodes.date.textContent; - return this.nodes.date.textContent = textContent.match(/^\s*/)[0] + Time.format(Conf['time'], this.info.date) + textContent.match(/\s*$/)[0]; - }, - format: function(formatString, date) { - return formatString.replace(/%(.)/g, function(s, c) { - if ($.hasOwn(Time.formatters, c)) { - return Time.formatters[c].call(date); - } else { - return s; - } - }); - }, - day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], - month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - localeFormat: function(date, options, defaultValue) { - if (Conf['timeLocale']) { - try { - return Intl.DateTimeFormat(Conf['timeLocale'], options).format(date); - } catch (error) {} - } - return defaultValue; - }, - localeFormatPart: function(date, options, part, defaultValue) { - var parts; - if (Conf['timeLocale']) { - try { - parts = Intl.DateTimeFormat(Conf['timeLocale'], options).formatToParts(date); - return parts.map(function(x) { - if (x.type === part) { - return x.value; - } else { - return ''; - } - }).join(''); - } catch (error) {} - } - return defaultValue; - }, - zeroPad: function(n) { - if (n < 10) { - return "0" + n; - } else { - return n; - } - }, - formatters: { - a: function() { - return Time.localeFormat(this, { - weekday: 'short' - }, Time.day[this.getDay()].slice(0, 3)); - }, - A: function() { - return Time.localeFormat(this, { - weekday: 'long' - }, Time.day[this.getDay()]); - }, - b: function() { - return Time.localeFormat(this, { - month: 'short' - }, Time.month[this.getMonth()].slice(0, 3)); - }, - B: function() { - return Time.localeFormat(this, { - month: 'long' - }, Time.month[this.getMonth()]); - }, - d: function() { - return Time.zeroPad(this.getDate()); - }, - e: function() { - return this.getDate(); - }, - H: function() { - return Time.zeroPad(this.getHours()); - }, - I: function() { - return Time.zeroPad(this.getHours() % 12 || 12); - }, - k: function() { - return this.getHours(); - }, - l: function() { - return this.getHours() % 12 || 12; - }, - m: function() { - return Time.zeroPad(this.getMonth() + 1); - }, - M: function() { - return Time.zeroPad(this.getMinutes()); - }, - p: function() { - return Time.localeFormatPart(this, { - hour: 'numeric', - hour12: true - }, 'dayperiod', (this.getHours() < 12 ? 'AM' : 'PM')); - }, - P: function() { - return Time.formatters.p.call(this).toLowerCase(); - }, - S: function() { - return Time.zeroPad(this.getSeconds()); - }, - y: function() { - return this.getFullYear().toString().slice(2); - }, - Y: function() { - return this.getFullYear(); - }, - '%': function() { - return '%'; - } - } - }; - - return Time; - -}).call(this); - -Tinyboard = (function() { - var Tinyboard; - - Tinyboard = { - init: function() { - if (g.SITE.software !== 'tinyboard') { - return; - } - if (g.VIEW === 'thread') { - return Main.ready(function() { - return $.global(function() { - var base, boardID, form, originalNoko, ref, ref1, ref2, threadID; - ref = document.currentScript.dataset, boardID = ref.boardID, threadID = ref.threadID; - threadID = +threadID; - form = document.querySelector('form[name="post"]'); - window.$(document).ajaxComplete(function(event, request, settings) { - var detail, noko, postID, redirect, ref1, ref2; - if (settings.url !== form.action) { - return; - } - if (!(postID = +((ref1 = request.responseJSON) != null ? ref1.id : void 0))) { - return; - } - detail = { - boardID: boardID, - threadID: threadID, - postID: postID - }; - try { - ref2 = request.responseJSON, redirect = ref2.redirect, noko = ref2.noko; - if (redirect && (typeof originalNoko !== "undefined" && originalNoko !== null) && !originalNoko && !noko) { - detail.redirect = redirect; - } - } catch (error) {} - event = new CustomEvent('QRPostSuccessful', { - bubbles: true, - detail: detail - }); - return document.dispatchEvent(event); - }); - originalNoko = (ref1 = window.tb_settings) != null ? (ref2 = ref1.ajax) != null ? ref2.always_noko_replies : void 0 : void 0; - return ((base = (window.tb_settings || (window.tb_settings = {}))).ajax || (base.ajax = {})).always_noko_replies = true; - }, { - boardID: g.BOARD.ID, - threadID: g.THREADID - }); - }); - } - } - }; - - return Tinyboard; - -}).call(this); - -Favicon = (function() { - var Favicon; - - Favicon = { - init: function() { - return $.asap((function() { - return d.head && (Favicon.el = $('link[rel="shortcut icon"]', d.head)); - }), Favicon.initAsap); - }, - set: function(status) { - Favicon.status = status; - if (Favicon.el) { - Favicon.el.href = Favicon[status]; - return $.add(d.head, Favicon.el); - } - }, - initAsap: function() { - var href; - Favicon.el.type = 'image/x-icon'; - href = Favicon.el.href; - Favicon.isSFW = /ws\.ico$/.test(href); - Favicon["default"] = href; - Favicon["switch"](); - if (Favicon.status) { - return Favicon.set(Favicon.status); - } - }, - "switch": function() { - var f, i, items, t; - items = { - ferongr: ['iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///9zBQC/AADpDAP/gID/q6voCwJJTwpOAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPUCtJM7svankLrq/I+TY5e6Ueh1jyBMX7AFJi9vwfyVO4CbbO6jNYpp9GyVP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Rw/NQAAAABJRU5ErkJggg==', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAAAAAAAAAAA1/H///8AISUALzQAeokACAkAQEcAorYAMTcE9WFNAAAAA3RSTlMAPse+s4iwAAAAMklEQVQI12NggAFmY2MDECaNAQZCilAzVJyg5oS4GqAxUtygjIp2KGOKJ5SxepcB3BUAcdYRqxAtgFoAAAAASUVORK5CYII=', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAABV/wErM5hwAAAAAXRSTlMAQObYZgAAABJJREFUCB1jZGBgrMNAQEEc4gCSfAX5bRw/NQAAAABJRU5ErkJggg==', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAAAAAAAAABV/wH///8NKAASOAAwkQADCgAZTABAwQATOwC5e3VGAAAAA3RSTlMAPse+s4iwAAAAMklEQVQI12NggAFmY2MDECaNAQZCilAzVJyg5oS4GqAxUtygjIp2KGOKJ5SxepcB3BUAcdYRqxAtgFoAAAAASUVORK5CYII='] - }; - items = $.getOwn(items, Conf['favicon']); - f = Favicon; - t = 'data:image/png;base64,'; - i = 0; - while (items[i]) { - items[i] = t + items[i++]; - } - f.unreadDead = items[0], f.unreadDeadY = items[1], f.unreadSFW = items[2], f.unreadSFWY = items[3], f.unreadNSFW = items[4], f.unreadNSFWY = items[5]; - return f.update(); - }, - update: function() { - if (this.isSFW) { - this.unread = this.unreadSFW; - return this.unreadY = this.unreadSFWY; - } else { - this.unread = this.unreadNSFW; - return this.unreadY = this.unreadNSFWY; - } - }, - SFW: '//s.4cdn.org/image/favicon-ws.ico', - NSFW: '//s.4cdn.org/image/favicon.ico', - dead: 'data:image/gif;base64,R0lGODlhEAAQAKECAAAAAP8AAP///////yH5BAEKAAIALAAAAAAQABAAAAIvlI+pq+D9DAgUoFkPDlbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw==', - logo: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACAAgMAAAC+UIlYAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAGlJREFUWMPtlkEKADEIA/tJP9lXLttQto2yHxgDHozTi0ToGK2WKZZ+HAQQMZc+xBwI4EZ+wAC2IfPuSIDOZJrSZQEAX9eVJhhwIuUYAnQe8rhAEMAZlTI2MID9f5Clyh0JeE1V1ZEAvB4qDfwuJTSGRAAAAABJRU5ErkJggg==' - }; - - return Favicon; - -}).call(this); - -MarkNewIPs = (function() { - var MarkNewIPs; - - MarkNewIPs = { - init: function() { - if (!(g.SITE.software === 'yotsuba' && g.VIEW === 'thread' && Conf['Mark New IPs'])) { - return; - } - return Callbacks.Thread.push({ - name: 'Mark New IPs', - cb: this.node - }); - }, - node: function() { - MarkNewIPs.ipCount = this.ipCount; - MarkNewIPs.postCount = this.posts.keys.length; - return $.on(d, 'ThreadUpdate', MarkNewIPs.onUpdate); - }, - onUpdate: function(e) { - var deletedPosts, fullID, i, ipCount, j, k, len, len1, newPosts, postCount, ref; - ref = e.detail, ipCount = ref.ipCount, postCount = ref.postCount, newPosts = ref.newPosts, deletedPosts = ref.deletedPosts; - if (ipCount == null) { - return; - } - switch (ipCount - MarkNewIPs.ipCount) { - case postCount - MarkNewIPs.postCount + deletedPosts.length: - i = MarkNewIPs.ipCount; - for (j = 0, len = newPosts.length; j < len; j++) { - fullID = newPosts[j]; - MarkNewIPs.markNew(g.posts.get(fullID), ++i); - } - break; - case -deletedPosts.length: - for (k = 0, len1 = newPosts.length; k < len1; k++) { - fullID = newPosts[k]; - MarkNewIPs.markOld(g.posts.get(fullID)); - } - } - MarkNewIPs.ipCount = ipCount; - return MarkNewIPs.postCount = postCount; - }, - markNew: function(post, ipCount) { - var counter, suffix; - suffix = (Math.floor(ipCount / 10)) % 10 === 1 ? 'th' : ['st', 'nd', 'rd'][ipCount % 10 - 1] || 'th'; - counter = $.el('span', { - className: 'ip-counter', - textContent: "(" + ipCount + ")" - }); - post.nodes.nameBlock.title = "This is the " + ipCount + suffix + " IP in the thread."; - $.add(post.nodes.nameBlock, [$.tn(' '), counter]); - return $.addClass(post.nodes.root, 'new-ip'); - }, - markOld: function(post) { - post.nodes.nameBlock.title = 'Not the first post from this IP.'; - return $.addClass(post.nodes.root, 'old-ip'); - } - }; - - return MarkNewIPs; - -}).call(this); - -ReplyPruning = (function() { - var ReplyPruning; - - ReplyPruning = { - init: function() { - var el, label; - if (!(g.VIEW === 'thread' && Conf['Reply Pruning'])) { - return; - } - this.container = $.frag(); - this.summary = $.el('span', { - hidden: true, - className: 'summary' - }); - this.summary.style.cursor = 'pointer'; - $.on(this.summary, 'click', (function(_this) { - return function() { - _this.inputs.enabled.checked = !_this.inputs.enabled.checked; - return $.event('change', null, _this.inputs.enabled); - }; - })(this)); - label = UI.checkbox('Prune Replies', 'Show Last', Conf['Prune All Threads']); - el = $.el('span', { - title: 'Maximum number of replies to show.' - }, {innerHTML: " "}); - $.prepend(el, label); - this.inputs = { - enabled: label.firstElementChild, - replies: el.lastElementChild - }; - this.setEnabled.call(this.inputs.enabled); - $.on(this.inputs.enabled, 'change', this.setEnabled); - $.on(this.inputs.replies, 'change', $.cb.value); - Header.menu.addEntry({ - el: el, - order: 190 - }); - return Callbacks.Thread.push({ - name: 'Reply Pruning', - cb: this.node - }); - }, - position: 0, - hidden: 0, - hiddenFiles: 0, - total: 0, - totalFiles: 0, - setEnabled: function() { - var other; - other = QuoteThreading.input; - if (this.checked && (other != null ? other.checked : void 0)) { - other.checked = false; - $.event('change', null, other); - } - return ReplyPruning.active = this.checked; - }, - showIfHidden: function(id) { - if (ReplyPruning.container && $("#" + id, ReplyPruning.container)) { - ReplyPruning.inputs.enabled.checked = false; - return $.event('change', null, ReplyPruning.inputs.enabled); - } - }, - node: function() { - var ref; - ReplyPruning.thread = this; - if (this.isSticky) { - ReplyPruning.active = ReplyPruning.inputs.enabled.checked = true; - if (QuoteThreading.input) { - Conf['Thread Quotes'] = QuoteThreading.input.checked = false; - } - } - this.posts.forEach(function(post) { - if (post.isReply) { - ReplyPruning.total++; - if (post.file) { - return ReplyPruning.totalFiles++; - } - } - }); - if (ReplyPruning.active && /^#p\d+$/.test(location.hash) && (1 <= (ref = this.posts.keys.indexOf(location.hash.slice(2))) && ref < 1 + Math.max(ReplyPruning.total - +Conf["Max Replies"], 0))) { - ReplyPruning.active = ReplyPruning.inputs.enabled.checked = false; - } - $.after(this.OP.nodes.root, ReplyPruning.summary); - $.on(ReplyPruning.inputs.enabled, 'change', ReplyPruning.update); - $.on(ReplyPruning.inputs.replies, 'change', ReplyPruning.update); - $.on(d, 'ThreadUpdate', ReplyPruning.updateCount); - $.on(d, 'ThreadUpdate', ReplyPruning.update); - return ReplyPruning.update(); - }, - updateCount: function(e) { - var fullID, i, len, ref; - if (e.detail[404]) { - return; - } - ref = e.detail.newPosts; - for (i = 0, len = ref.length; i < len; i++) { - fullID = ref[i]; - ReplyPruning.total++; - if (g.posts.get(fullID).file) { - ReplyPruning.totalFiles++; - } - } - }, - update: function() { - var boardTop, frag, hidden1, hidden2, node, oldPos, post, posts; - hidden1 = ReplyPruning.hidden; - hidden2 = ReplyPruning.active ? Math.max(ReplyPruning.total - +Conf["Max Replies"], 0) : 0; - oldPos = d.body.clientHeight - window.scrollY; - posts = ReplyPruning.thread.posts; - if (ReplyPruning.hidden < hidden2) { - while (ReplyPruning.hidden < hidden2 && ReplyPruning.position < posts.keys.length) { - post = posts.get(posts.keys[ReplyPruning.position++]); - if (post.isReply && !post.isFetchedQuote) { - while ((node = ReplyPruning.summary.nextSibling) && node !== post.nodes.root) { - $.add(ReplyPruning.container, node); - } - $.add(ReplyPruning.container, post.nodes.root); - ReplyPruning.hidden++; - if (post.file) { - ReplyPruning.hiddenFiles++; - } - } - } - } else if (ReplyPruning.hidden > hidden2) { - frag = $.frag(); - while (ReplyPruning.hidden > hidden2 && ReplyPruning.position > 0) { - post = posts.get(posts.keys[--ReplyPruning.position]); - if (post.isReply && !post.isFetchedQuote) { - while ((node = ReplyPruning.container.lastChild) && node !== post.nodes.root) { - $.prepend(frag, node); - } - $.prepend(frag, post.nodes.root); - ReplyPruning.hidden--; - if (post.file) { - ReplyPruning.hiddenFiles--; - } - } - } - $.after(ReplyPruning.summary, frag); - $.event('PostsInserted', null, ReplyPruning.summary.parentNode); - } - ReplyPruning.summary.textContent = ReplyPruning.active ? g.SITE.Build.summaryText('+', ReplyPruning.hidden, ReplyPruning.hiddenFiles) : g.SITE.Build.summaryText('-', ReplyPruning.total, ReplyPruning.totalFiles); - ReplyPruning.summary.hidden = ReplyPruning.total <= +Conf["Max Replies"]; - if (hidden1 !== hidden2 && (boardTop = Header.getTopOf($('.board'))) < 0) { - return window.scrollBy(0, Math.max(d.body.clientHeight - oldPos, window.scrollY + boardTop) - window.scrollY); - } - } - }; - - return ReplyPruning; - -}).call(this); - -ThreadStats = (function() { - var ThreadStats; - - ThreadStats = { - postCount: 0, - fileCount: 0, - postIndex: 0, - init: function() { - var base, sc, statsHTML, statsTitle; - if (g.VIEW !== 'thread' || !Conf['Thread Stats']) { - return; - } - if (Conf['Page Count in Stats']) { - this[(typeof (base = g.SITE).isPrunedByAge === "function" ? base.isPrunedByAge(g.BOARD) : void 0) ? 'showPurgePos' : 'showPage'] = true; - } - statsHTML = {innerHTML: "? / ?" + ((Conf["IP Count in Stats"] && g.SITE.hasIPCount) ? " / ?" : "") + ((Conf["Page Count in Stats"]) ? " / ?" : "")}; - statsTitle = 'Posts / Files'; - if (Conf['IP Count in Stats'] && g.SITE.hasIPCount) { - statsTitle += ' / IPs'; - } - if (Conf['Page Count in Stats']) { - statsTitle += (this.showPurgePos ? ' / Purge Position' : ' / Page'); - } - if (Conf['Updater and Stats in Header']) { - this.dialog = sc = $.el('span', { - id: 'thread-stats', - title: statsTitle - }); - $.extend(sc, statsHTML); - Header.addShortcut('stats', sc, 200); - } else { - this.dialog = sc = UI.dialog('thread-stats', {innerHTML: "
    " + (statsHTML).innerHTML + "
    "}); - $.addClass(doc, 'float'); - $.ready(function() { - return $.add(d.body, sc); - }); - } - this.postCountEl = $('#post-count', sc); - this.fileCountEl = $('#file-count', sc); - this.ipCountEl = $('#ip-count', sc); - this.pageCountEl = $('#page-count', sc); - if (this.pageCountEl) { - $.on(this.pageCountEl, 'click', ThreadStats.fetchPage); - } - return Callbacks.Thread.push({ - name: 'Thread Stats', - cb: this.node - }); - }, - node: function() { - ThreadStats.thread = this; - ThreadStats.count(); - ThreadStats.update(); - ThreadStats.fetchPage(); - $.on(d, 'PostsInserted', function() { - return $.queueTask(ThreadStats.onPostsInserted); - }); - return $.on(d, 'ThreadUpdate', ThreadStats.onUpdate); - }, - count: function() { - var i, j, n, post, posts, ref, ref1; - posts = ThreadStats.thread.posts; - n = posts.keys.length; - for (i = j = ref = ThreadStats.postIndex, ref1 = n; j < ref1; i = j += 1) { - post = posts.get(posts.keys[i]); - if (!post.isFetchedQuote) { - ThreadStats.postCount++; - ThreadStats.fileCount += post.files.length; - } - } - return ThreadStats.postIndex = n; - }, - onUpdate: function(e) { - var fileCount, postCount, ref; - if (e.detail[404]) { - return; - } - ref = e.detail, postCount = ref.postCount, fileCount = ref.fileCount; - $.extend(ThreadStats, { - postCount: postCount, - fileCount: fileCount - }); - ThreadStats.postIndex = ThreadStats.thread.posts.keys.length; - ThreadStats.update(); - if (ThreadStats.showPage && ThreadStats.pageCountEl.textContent !== '1') { - return ThreadStats.fetchPage(); - } - }, - onPostsInserted: function() { - if (!(ThreadStats.thread.posts.keys.length > ThreadStats.postIndex)) { - return; - } - ThreadStats.count(); - ThreadStats.update(); - if (ThreadStats.showPage && ThreadStats.pageCountEl.textContent !== '1') { - return ThreadStats.fetchPage(); - } - }, - update: function() { - var fileCountEl, ipCountEl, postCountEl, ref, thread; - thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl, ipCountEl = ThreadStats.ipCountEl; - postCountEl.textContent = ThreadStats.postCount; - fileCountEl.textContent = ThreadStats.fileCount; - if (ipCountEl != null) { - ipCountEl.textContent = (ref = thread.ipCount) != null ? ref : '?'; - } - postCountEl.classList.toggle('warning', thread.postLimit && !thread.isSticky); - return fileCountEl.classList.toggle('warning', thread.fileLimit && !thread.isSticky); - }, - fetchPage: function() { - if (!ThreadStats.pageCountEl) { - return; - } - clearTimeout(ThreadStats.timeout); - if (ThreadStats.thread.isDead) { - ThreadStats.pageCountEl.textContent = 'Dead'; - $.addClass(ThreadStats.pageCountEl, 'warning'); - return; - } - ThreadStats.timeout = setTimeout(ThreadStats.fetchPage, 2 * $.MINUTE); - return $.whenModified(g.SITE.urls.threadsListJSON(ThreadStats.thread), 'ThreadStats', ThreadStats.onThreadsLoad); - }, - onThreadsLoad: function() { - var i, j, k, l, len, len1, len2, len3, len4, m, nThreads, o, page, pageNum, purgePos, ref, ref1, ref2, ref3, ref4, thread; - if (this.status === 200) { - if (ThreadStats.showPurgePos) { - purgePos = 1; - ref = this.response; - for (j = 0, len = ref.length; j < len; j++) { - page = ref[j]; - ref1 = page.threads; - for (k = 0, len1 = ref1.length; k < len1; k++) { - thread = ref1[k]; - if (thread.no < ThreadStats.thread.ID) { - purgePos++; - } - } - } - ThreadStats.pageCountEl.textContent = purgePos; - return ThreadStats.pageCountEl.classList.toggle('warning', purgePos === 1); - } else { - i = nThreads = 0; - ref2 = this.response; - for (l = 0, len2 = ref2.length; l < len2; l++) { - page = ref2[l]; - nThreads += page.threads.length; - } - ref3 = this.response; - for (pageNum = m = 0, len3 = ref3.length; m < len3; pageNum = ++m) { - page = ref3[pageNum]; - ref4 = page.threads; - for (o = 0, len4 = ref4.length; o < len4; o++) { - thread = ref4[o]; - if (thread.no === ThreadStats.thread.ID) { - ThreadStats.pageCountEl.textContent = pageNum + 1; - ThreadStats.pageCountEl.classList.toggle('warning', i >= nThreads - this.response[0].threads.length); - ThreadStats.lastPageUpdate = new Date(thread.last_modified * $.SECOND); - ThreadStats.retry(); - return; - } - i++; - } - } - } - } else if (this.status === 304) { - return ThreadStats.retry(); - } - }, - retry: function() { - if (!(ThreadStats.showPage && ThreadStats.pageCountEl.textContent !== '1' && !g.SITE.threadModTimeIgnoresSage && ThreadStats.thread.posts.get(ThreadStats.thread.lastPost).info.date > ThreadStats.lastPageUpdate)) { - return; - } - clearTimeout(ThreadStats.timeout); - return ThreadStats.timeout = setTimeout(ThreadStats.fetchPage, 5 * $.SECOND); - } - }; - - return ThreadStats; - -}).call(this); - -ThreadUpdater = (function() { - var ThreadUpdater, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - ThreadUpdater = { - init: function() { - var conf, el, input, name, ref, sc, subEntries, updateLink; - if (g.VIEW !== 'thread' || !Conf['Thread Updater']) { - return; - } - this.enabled = true; - this.audio = $.el('audio'); - if ($.engine !== 'gecko') { - this.audio.src = this.beep; - } - if (Conf['Updater and Stats in Header']) { - this.dialog = sc = $.el('span', { - id: 'updater' - }); - $.extend(sc, {innerHTML: ""}); - Header.addShortcut('updater', sc, 100); - } else { - this.dialog = sc = UI.dialog('updater', {innerHTML: "
    "}); - $.addClass(doc, 'float'); - $.ready(function() { - return $.add(d.body, sc); - }); - } - this.checkPostCount = 0; - this.timer = $('#update-timer', sc); - this.status = $('#update-status', sc); - $.on(this.timer, 'click', this.update); - $.on(this.status, 'click', this.update); - updateLink = $.el('span', { - className: 'brackets-wrap updatelink' - }); - $.extend(updateLink, {innerHTML: "Update"}); - Main.ready(function() { - var navLinksBot; - if ((navLinksBot = $('.navLinksBot'))) { - return $.add(navLinksBot, [$.tn(' '), updateLink]); - } - }); - $.on(updateLink.firstElementChild, 'click', this.update); - subEntries = []; - ref = Config.updater.checkbox; - for (name in ref) { - conf = ref[name]; - el = UI.checkbox(name, name); - el.title = conf[1]; - input = el.firstElementChild; - $.on(input, 'change', $.cb.checked); - if (input.name === 'Scroll BG') { - $.on(input, 'change', this.cb.scrollBG); - this.cb.scrollBG(); - } else if (input.name === 'Auto Update') { - $.on(input, 'change', this.setInterval); - } - subEntries.push({ - el: el - }); - } - this.settings = $.el('span', {innerHTML: "Interval"}); - $.on(this.settings, 'click', this.intervalShortcut); - subEntries.push({ - el: this.settings - }); - Header.menu.addEntry(this.entry = { - el: $.el('span', { - textContent: 'Updater' - }), - order: 110, - subEntries: subEntries - }); - return Callbacks.Thread.push({ - name: 'Thread Updater', - cb: this.node - }); - }, - node: function() { - ThreadUpdater.thread = this; - ThreadUpdater.root = this.nodes.root; - ThreadUpdater.outdateCount = 0; - ThreadUpdater.postIDs = []; - ThreadUpdater.fileIDs = []; - this.posts.forEach(function(post) { - ThreadUpdater.postIDs.push(post.ID); - if (post.file) { - return ThreadUpdater.fileIDs.push(post.ID); - } - }); - ThreadUpdater.cb.interval.call($.el('input', { - value: Conf['Interval'] - })); - $.on(d, 'QRPostSuccessful', ThreadUpdater.cb.checkpost); - $.on(d, 'visibilitychange', ThreadUpdater.cb.visibility); - return ThreadUpdater.setInterval(); - }, - - /* - http://freesound.org/people/pierrecartoons1979/sounds/90112/ - cc-by-nc-3.0 - */ - beep: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA', - playBeep: function() { - var audio; - audio = ThreadUpdater.audio; - audio.src || (audio.src = ThreadUpdater.beep); - if (audio.paused) { - return audio.play(); - } else { - return $.one(audio, 'ended', ThreadUpdater.playBeep); - } - }, - cb: { - checkpost: function(e) { - if (e.detail.threadID !== ThreadUpdater.thread.ID) { - return; - } - ThreadUpdater.postID = e.detail.postID; - ThreadUpdater.checkPostCount = 0; - ThreadUpdater.outdateCount = 0; - return ThreadUpdater.setInterval(); - }, - visibility: function() { - if (d.hidden) { - return; - } - ThreadUpdater.outdateCount = 0; - if (ThreadUpdater.seconds > ThreadUpdater.interval) { - return ThreadUpdater.setInterval(); - } - }, - scrollBG: function() { - return ThreadUpdater.scrollBG = Conf['Scroll BG'] ? function() { - return true; - } : function() { - return !d.hidden; - }; - }, - interval: function(e) { - var val; - val = parseInt(this.value, 10); - if (val < 1) { - val = 1; - } - ThreadUpdater.interval = this.value = val; - if (e) { - return $.cb.value.call(this); - } - }, - load: function() { - if (this !== ThreadUpdater.req) { - return; - } - switch (this.status) { - case 200: - ThreadUpdater.parse(this); - if (ThreadUpdater.thread.isArchived) { - return ThreadUpdater.kill(); - } else { - return ThreadUpdater.setInterval(); - } - break; - case 404: - return $.ajax(g.SITE.urls.catalogJSON({ - boardID: ThreadUpdater.thread.board.ID - }), { - onloadend: function() { - var confirmed, i, k, len, len1, page, ref, ref1, thread; - if (this.status === 200) { - confirmed = true; - ref = this.response; - for (i = 0, len = ref.length; i < len; i++) { - page = ref[i]; - ref1 = page.threads; - for (k = 0, len1 = ref1.length; k < len1; k++) { - thread = ref1[k]; - if (thread.no === ThreadUpdater.thread.ID) { - confirmed = false; - break; - } - } - } - } else { - confirmed = false; - } - if (confirmed) { - return ThreadUpdater.kill(); - } else { - return ThreadUpdater.error(this); - } - } - }); - default: - return ThreadUpdater.error(this); - } - } - }, - kill: function() { - ThreadUpdater.thread.kill(); - ThreadUpdater.setInterval(); - return $.event('ThreadUpdate', { - 404: true, - threadID: ThreadUpdater.thread.fullID - }); - }, - error: function(req) { - if (req.status === 304) { - ThreadUpdater.set('status', ''); - } - ThreadUpdater.setInterval(); - if (!req.status) { - return ThreadUpdater.set('status', 'Connection Error', 'warning'); - } else if (req.status !== 304) { - return ThreadUpdater.set('status', req.statusText + " (" + req.status + ")", 'warning'); - } - }, - setInterval: function() { - var cur, interval, j, limit; - clearTimeout(ThreadUpdater.timeoutID); - if (ThreadUpdater.thread.isDead) { - ThreadUpdater.set('status', (ThreadUpdater.thread.isArchived ? 'Archived' : '404'), 'warning'); - ThreadUpdater.set('timer', ''); - return; - } - if (ThreadUpdater.postID && ThreadUpdater.checkPostCount < 5) { - ThreadUpdater.set('timer', '...', 'loading'); - ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * $.SECOND); - return; - } - if (!Conf['Auto Update']) { - ThreadUpdater.set('timer', 'Update'); - return; - } - interval = ThreadUpdater.interval; - if (Conf['Optional Increase']) { - limit = d.hidden ? 10 : 5; - j = Math.min(ThreadUpdater.outdateCount, limit); - cur = (Math.floor(interval * 0.1) || 1) * j * j; - ThreadUpdater.seconds = $.minmax(cur, interval, 300); - } else { - ThreadUpdater.seconds = interval; - } - return ThreadUpdater.timeout(); - }, - intervalShortcut: function() { - var settings; - Settings.open('Advanced'); - settings = $.id('fourchanx-settings'); - return $('input[name=Interval]', settings).focus(); - }, - set: function(name, text, klass) { - var el, node; - el = ThreadUpdater[name]; - if (node = el.firstChild) { - node.data = text; - } else { - el.textContent = text; - } - return el.className = klass != null ? klass : (text === '' ? 'empty' : ''); - }, - timeout: function() { - if (ThreadUpdater.seconds) { - ThreadUpdater.set('timer', ThreadUpdater.seconds); - ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); - } else { - ThreadUpdater.outdateCount++; - ThreadUpdater.update(); - } - return ThreadUpdater.seconds--; - }, - update: function() { - var oldReq; - clearTimeout(ThreadUpdater.timeoutID); - ThreadUpdater.set('timer', '...', 'loading'); - if ((oldReq = ThreadUpdater.req)) { - delete ThreadUpdater.req; - oldReq.abort(); - } - return ThreadUpdater.req = $.whenModified(g.SITE.urls.threadJSON({ - boardID: ThreadUpdater.thread.board.ID, - threadID: ThreadUpdater.thread.ID - }), 'ThreadUpdater', ThreadUpdater.cb.load, { - timeout: $.MINUTE - }); - }, - updateThreadStatus: function(type, status) { - var change, hasChanged; - if (!(hasChanged = ThreadUpdater.thread["is" + type] !== status)) { - return; - } - ThreadUpdater.thread.setStatus(type, status); - if (type === 'Closed' && ThreadUpdater.thread.isArchived) { - return; - } - change = type === 'Sticky' ? status ? 'now a sticky' : 'not a sticky anymore' : status ? 'now closed' : 'not closed anymore'; - return new Notice('info', "The thread is " + change + ".", 30); - }, - parse: function(req) { - var ID, OP, board, deletedFiles, deletedPosts, files, firstPost, i, index, ipCountEl, k, l, lastPost, len, len1, len2, len3, m, newPosts, node, post, postObject, postObjects, posts, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, scroll, thread, unreadCount, unreadQYCount; - postObjects = req.response.posts; - OP = postObjects[0]; - thread = ThreadUpdater.thread; - board = thread.board; - ref = ThreadUpdater.postIDs, lastPost = ref[ref.length - 1]; - if (postObjects[postObjects.length - 1].no < lastPost && new Date(req.getResponseHeader('Last-Modified')) - thread.posts.get(lastPost).info.date < 30 * $.SECOND) { - return; - } - g.SITE.Build.spoilerRange[board] = OP.custom_spoiler; - thread.setStatus('Archived', !!OP.archived); - ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky); - ThreadUpdater.updateThreadStatus('Closed', !!OP.closed); - thread.postLimit = !!OP.bumplimit; - thread.fileLimit = !!OP.imagelimit; - if (OP.unique_ips != null) { - thread.ipCount = OP.unique_ips; - } - posts = []; - index = []; - files = []; - newPosts = []; - for (i = 0, len = postObjects.length; i < len; i++) { - postObject = postObjects[i]; - ID = postObject.no; - index.push(ID); - if (postObject.fsize) { - files.push(ID); - } - if (ID <= lastPost) { - continue; - } - if ((post = thread.posts.get(ID)) && !post.isFetchedQuote) { - post.resurrect(); - continue; - } - newPosts.push(board + "." + ID); - node = g.SITE.Build.postFromObject(postObject, board.ID); - posts.push(new Post(node, thread, board)); - if (ThreadUpdater.postID === ID) { - delete ThreadUpdater.postID; - } - } - deletedPosts = []; - ref1 = ThreadUpdater.postIDs; - for (k = 0, len1 = ref1.length; k < len1; k++) { - ID = ref1[k]; - if (!(indexOf.call(index, ID) < 0)) { - continue; - } - thread.posts.get(ID).kill(); - deletedPosts.push(board + "." + ID); - } - ThreadUpdater.postIDs = index; - deletedFiles = []; - ref2 = ThreadUpdater.fileIDs; - for (l = 0, len2 = ref2.length; l < len2; l++) { - ID = ref2[l]; - if (!(!(indexOf.call(files, ID) >= 0 || (ref3 = board + "." + ID, indexOf.call(deletedPosts, ref3) >= 0)))) { - continue; - } - thread.posts.get(ID).kill(true); - deletedFiles.push(board + "." + ID); - } - ThreadUpdater.fileIDs = files; - if (!posts.length) { - ThreadUpdater.set('status', ''); - } else { - ThreadUpdater.set('status', "+" + posts.length, 'new'); - ThreadUpdater.outdateCount = 0; - unreadCount = (ref4 = Unread.posts) != null ? ref4.size : void 0; - unreadQYCount = (ref5 = Unread.postsQuotingYou) != null ? ref5.size : void 0; - Main.callbackNodes('Post', posts); - if (d.hidden || !d.hasFocus()) { - if (Conf['Beep Quoting You'] && ((ref6 = Unread.postsQuotingYou) != null ? ref6.size : void 0) > unreadQYCount) { - ThreadUpdater.playBeep(); - if (Conf['Beep']) { - ThreadUpdater.playBeep(); - } - } else if (Conf['Beep'] && ((ref7 = Unread.posts) != null ? ref7.size : void 0) > 0 && unreadCount === 0) { - ThreadUpdater.playBeep(); - } - } - scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25; - firstPost = null; - for (m = 0, len3 = posts.length; m < len3; m++) { - post = posts[m]; - if (!QuoteThreading.insert(post)) { - firstPost || (firstPost = post.nodes.root); - $.add(ThreadUpdater.root, post.nodes.root); - } - } - $.event('PostsInserted', null, ThreadUpdater.root); - if (scroll) { - if (Conf['Bottom Scroll']) { - window.scrollTo(0, d.body.clientHeight); - } else { - if (firstPost) { - Header.scrollTo(firstPost); - } - } - } - } - if ((OP.unique_ips != null) && (ipCountEl = $.id('unique-ips'))) { - ipCountEl.textContent = OP.unique_ips; - ipCountEl.previousSibling.textContent = ipCountEl.previousSibling.textContent.replace(/\b(?:is|are)\b/, OP.unique_ips === 1 ? 'is' : 'are'); - ipCountEl.nextSibling.textContent = ipCountEl.nextSibling.textContent.replace(/\bposters?\b/, OP.unique_ips === 1 ? 'poster' : 'posters'); - } - return $.event('ThreadUpdate', { - 404: false, - threadID: thread.fullID, - newPosts: newPosts, - deletedPosts: deletedPosts, - deletedFiles: deletedFiles, - postCount: OP.replies + 1, - fileCount: OP.images + !!OP.fsize, - ipCount: OP.unique_ips - }); - } - }; - - return ThreadUpdater; - -}).call(this); - -ThreadWatcher = (function() { - var ThreadWatcher, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - slice = [].slice; - - ThreadWatcher = { - init: function() { - var ref, sc; - if (!(this.enabled = Conf['Thread Watcher'])) { - return; - } - this.shortcut = sc = $.el('a', { - id: 'watcher-link', - textContent: 'Watcher', - title: 'Thread Watcher', - href: 'javascript:;', - className: 'fa fa-eye' - }); - this.db = new DataBoard('watchedThreads', this.refresh, true); - this.dbLM = new DataBoard('watcherLastModified', null, true); - this.dialog = UI.dialog('thread-watcher', {innerHTML: "
    Thread Watcher ×
    "}); - this.status = $('#watcher-status', this.dialog); - this.list = this.dialog.lastElementChild; - this.refreshButton = $('.refresh', this.dialog); - this.closeButton = $('.move > .close', this.dialog); - this.unreaddb = Unread.db || UnreadIndex.db || new DataBoard('lastReadPosts'); - this.unreadEnabled = Conf['Remember Last Read Post']; - $.on(d, 'QRPostSuccessful', this.cb.post); - $.on(sc, 'click', this.toggleWatcher); - $.on(this.refreshButton, 'click', this.buttonFetchAll); - $.on(this.closeButton, 'click', this.toggleWatcher); - this.menu.addHeaderMenuEntry(); - $.onExists(doc, 'body', this.addDialog); - switch (g.VIEW) { - case 'index': - $.on(d, 'IndexUpdate', this.cb.onIndexUpdate); - break; - case 'thread': - $.on(d, 'ThreadUpdate', this.cb.onThreadRefresh); - } - if (Conf['Fixed Thread Watcher']) { - $.addClass(doc, 'fixed-watcher'); - } - if (!Conf['Persistent Thread Watcher']) { - $.addClass(ThreadWatcher.shortcut, 'disabled'); - this.dialog.hidden = true; - } - Header.addShortcut('watcher', sc, 510); - ThreadWatcher.initLastModified(); - ThreadWatcher.fetchAuto(); - $.on(window, 'visibilitychange focus', function() { - return $.queueTask(ThreadWatcher.fetchAuto); - }); - if (Conf['Menu'] && Index.enabled) { - Menu.menu.addEntry({ - el: $.el('a', { - href: 'javascript:;', - className: 'has-shortcut-text' - }, {innerHTML: "Alt+click"}), - order: 6, - open: function(arg) { - var thread; - thread = arg.thread; - if (Conf['Index Mode'] !== 'catalog') { - return false; - } - this.el.firstElementChild.textContent = ThreadWatcher.isWatched(thread) ? 'Unwatch' : 'Watch'; - if (this.cb) { - $.off(this.el, 'click', this.cb); - } - this.cb = function() { - $.event('CloseMenu'); - return ThreadWatcher.toggle(thread); - }; - $.on(this.el, 'click', this.cb); - return true; - } - }); - } - if ((ref = g.VIEW) !== 'index' && ref !== 'thread') { - return; - } - Callbacks.Post.push({ - name: 'Thread Watcher', - cb: this.node - }); - return Callbacks.CatalogThread.push({ - name: 'Thread Watcher', - cb: this.catalogNode - }); - }, - isWatched: function(thread) { - var ref; - return !!((ref = ThreadWatcher.db) != null ? ref.get({ - boardID: thread.board.ID, - threadID: thread.ID - }) : void 0); - }, - isWatchedRaw: function(boardID, threadID) { - var ref; - return !!((ref = ThreadWatcher.db) != null ? ref.get({ - boardID: boardID, - threadID: threadID - }) : void 0); - }, - setToggler: function(toggler, isWatched) { - toggler.classList.toggle('watched', isWatched); - return toggler.title = (isWatched ? 'Unwatch' : 'Watch') + " Thread"; - }, - node: function() { - var boardID, data, siteID, threadID, toggler; - if (this.isReply) { - return; - } - if (this.isClone) { - toggler = $('.watch-thread-link', this.nodes.info); - } else { - toggler = $.el('a', { - href: 'javascript:;', - className: 'watch-thread-link' - }); - $.before($('input', this.nodes.info), toggler); - } - siteID = g.SITE.ID; - boardID = this.board.ID; - threadID = this.thread.ID; - data = ThreadWatcher.db.get({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }); - ThreadWatcher.setToggler(toggler, !!data); - $.on(toggler, 'click', ThreadWatcher.cb.toggle); - if (data && (data.excerpt == null)) { - return $.queueTask((function(_this) { - return function() { - return ThreadWatcher.update(siteID, boardID, threadID, { - excerpt: Get.threadExcerpt(_this.thread) - }); - }; - })(this)); - } - }, - catalogNode: function() { - if (ThreadWatcher.isWatched(this.thread)) { - $.addClass(this.nodes.root, 'watched'); - } - return $.on(this.nodes.root, 'mousedown click', (function(_this) { - return function(e) { - if (!(e.button === 0 && e.altKey)) { - return; - } - if (e.type === 'click') { - ThreadWatcher.toggle(_this.thread); - } - return e.preventDefault(); - }; - })(this)); - }, - addDialog: function() { - if (!Main.isThisPageLegit()) { - return; - } - ThreadWatcher.build(); - return $.prepend(d.body, ThreadWatcher.dialog); - }, - toggleWatcher: function() { - $.toggleClass(ThreadWatcher.shortcut, 'disabled'); - return ThreadWatcher.dialog.hidden = !ThreadWatcher.dialog.hidden; - }, - cb: { - openAll: function() { - var a, j, len1, ref; - if ($.hasClass(this, 'disabled')) { - return; - } - ref = $$('a.watcher-link', ThreadWatcher.list); - for (j = 0, len1 = ref.length; j < len1; j++) { - a = ref[j]; - $.open(a.href); - } - return $.event('CloseMenu'); - }, - openUnread: function() { - var a, j, len1, ref; - if ($.hasClass(this, 'disabled')) { - return; - } - ref = $$('.replies-unread > a.watcher-link', ThreadWatcher.list); - for (j = 0, len1 = ref.length; j < len1; j++) { - a = ref[j]; - $.open(a.href); - } - return $.event('CloseMenu'); - }, - openDeads: function() { - var a, j, len1, ref; - if ($.hasClass(this, 'disabled')) { - return; - } - ref = $$('.dead-thread > a.watcher-link', ThreadWatcher.list); - for (j = 0, len1 = ref.length; j < len1; j++) { - a = ref[j]; - $.open(a.href); - } - return $.event('CloseMenu'); - }, - pruneDeads: function() { - var boardID, data, j, len1, ref, ref1, siteID, threadID; - if ($.hasClass(this, 'disabled')) { - return; - } - ref = ThreadWatcher.getAll(); - for (j = 0, len1 = ref.length; j < len1; j++) { - ref1 = ref[j], siteID = ref1.siteID, boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data; - if (data.isDead) { - ThreadWatcher.db["delete"]({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }); - } - } - ThreadWatcher.refresh(); - return $.event('CloseMenu'); - }, - dismiss: function() { - var boardID, data, j, len1, ref, ref1, siteID, threadID; - ref = ThreadWatcher.getAll(); - for (j = 0, len1 = ref.length; j < len1; j++) { - ref1 = ref[j], siteID = ref1.siteID, boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data; - if (data.quotingYou) { - ThreadWatcher.update(siteID, boardID, threadID, { - dismiss: data.quotingYou || 0 - }); - } - } - return $.event('CloseMenu'); - }, - toggle: function() { - var thread; - thread = Get.postFromNode(this).thread; - return ThreadWatcher.toggle(thread); - }, - rm: function() { - var boardID, ref, siteID, threadID; - siteID = this.parentNode.dataset.siteID; - ref = this.parentNode.dataset.fullID.split('.'), boardID = ref[0], threadID = ref[1]; - return ThreadWatcher.rm(siteID, boardID, +threadID); - }, - post: function(e) { - var boardID, cb, postID, ref, threadID; - ref = e.detail, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID; - cb = PostRedirect.delay(); - if (postID === threadID) { - if (Conf['Auto Watch']) { - return ThreadWatcher.addRaw(boardID, threadID, {}, cb); - } - } else if (Conf['Auto Watch Reply']) { - return ThreadWatcher.add(g.threads.get(boardID + '.' + threadID) || new Thread(threadID, g.boards[boardID] || new Board(boardID)), cb); - } - }, - onIndexUpdate: function(e) { - var boardID, data, db, nKilled, ref, ref1, siteID, threadID; - db = ThreadWatcher.db; - siteID = g.SITE.ID; - boardID = g.BOARD.ID; - nKilled = 0; - ref = db.data[siteID].boards[boardID]; - for (threadID in ref) { - data = ref[threadID]; - if (!(!(data != null ? data.isDead : void 0) && (ref1 = boardID + "." + threadID, indexOf.call(e.detail.threads, ref1) < 0))) { - continue; - } - if (!e.detail.threads.some(function(fullID) { - return +fullID.split('.')[1] > threadID; - })) { - continue; - } - if (Conf['Auto Prune'] || !(data && typeof data === 'object')) { - db["delete"]({ - boardID: boardID, - threadID: threadID - }); - nKilled++; - } else { - ThreadWatcher.fetchStatus({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - data: data - }); - } - } - if (nKilled) { - return ThreadWatcher.refresh(); - } - }, - onThreadRefresh: function(e) { - var thread; - thread = g.threads.get(e.detail.threadID); - if (!(e.detail[404] && ThreadWatcher.isWatched(thread))) { - return; - } - return ThreadWatcher.add(thread); - } - }, - requests: [], - fetched: 0, - fetch: function(url, arg, args, cb) { - var ajax, force, onloadend, ref, req, siteID; - siteID = arg.siteID, force = arg.force; - if (ThreadWatcher.requests.length === 0) { - ThreadWatcher.status.textContent = '...'; - $.addClass(ThreadWatcher.refreshButton, 'fa-spin'); - } - onloadend = function() { - if (this.finished) { - return; - } - this.finished = true; - ThreadWatcher.fetched++; - if (ThreadWatcher.fetched === ThreadWatcher.requests.length) { - ThreadWatcher.clearRequests(); - } else { - ThreadWatcher.status.textContent = (Math.round(ThreadWatcher.fetched / ThreadWatcher.requests.length * 100)) + "%"; - } - return cb.apply(this, args); - }; - ajax = siteID === g.SITE.ID ? $.ajax : CrossOrigin.ajax; - if (force) { - if ((ref = $.lastModified.ThreadWatcher) != null) { - delete ref[url]; - } - } - req = $.whenModified(url, 'ThreadWatcher', onloadend, { - timeout: $.MINUTE, - ajax: ajax - }); - return ThreadWatcher.requests.push(req); - }, - clearRequests: function() { - ThreadWatcher.requests = []; - ThreadWatcher.fetched = 0; - ThreadWatcher.status.textContent = ''; - return $.rmClass(ThreadWatcher.refreshButton, 'fa-spin'); - }, - abort: function() { - var j, len1, ref, req; - delete ThreadWatcher.syncing; - ref = ThreadWatcher.requests; - for (j = 0, len1 = ref.length; j < len1; j++) { - req = ref[j]; - if (!(!req.finished)) { - continue; - } - req.finished = true; - req.abort(); - } - return ThreadWatcher.clearRequests(); - }, - initLastModified: function() { - var base, boardID, boards, data, date, lm, ref, ref1, siteID, url; - lm = ((base = $.lastModified)['ThreadWatcher'] || (base['ThreadWatcher'] = $.dict())); - ref = ThreadWatcher.dbLM.data; - for (siteID in ref) { - boards = ref[siteID]; - ref1 = boards.boards; - for (boardID in ref1) { - data = ref1[boardID]; - if (ThreadWatcher.db.get({ - siteID: siteID, - boardID: boardID - })) { - for (url in data) { - date = data[url]; - lm[url] = date; - } - } else { - ThreadWatcher.dbLM["delete"]({ - siteID: siteID, - boardID: boardID - }); - } - } - } - }, - fetchAuto: function() { - var db, interval, now, ref; - clearTimeout(ThreadWatcher.timeout); - if (!Conf['Auto Update Thread Watcher']) { - return; - } - db = ThreadWatcher.db; - interval = Conf['Show Page'] || (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) ? 5 * $.MINUTE : 2 * $.HOUR; - now = Date.now(); - if (!((now - interval < (ref = db.data.lastChecked || 0) && ref <= now) || d.hidden || !d.hasFocus())) { - ThreadWatcher.fetchAllStatus(interval); - } - return ThreadWatcher.timeout = setTimeout(ThreadWatcher.fetchAuto, interval); - }, - buttonFetchAll: function() { - if (ThreadWatcher.syncing || ThreadWatcher.requests.length) { - return ThreadWatcher.abort(); - } else { - return ThreadWatcher.fetchAllStatus(); - } - }, - fetchAllStatus: function(interval) { - var dbi, dbs, j, len1, n, results; - if (interval == null) { - interval = 0; - } - ThreadWatcher.status.textContent = '...'; - $.addClass(ThreadWatcher.refreshButton, 'fa-spin'); - ThreadWatcher.syncing = true; - dbs = [ThreadWatcher.db, ThreadWatcher.unreaddb, QuoteYou.db].filter(function(x) { - return x; - }); - n = 0; - results = []; - for (j = 0, len1 = dbs.length; j < len1; j++) { - dbi = dbs[j]; - results.push(dbi.forceSync(function() { - var board, boards, db, deep, k, len2, now, ref, ref1; - if ((++n) === dbs.length) { - if (!ThreadWatcher.syncing) { - return; - } - delete ThreadWatcher.syncing; - if (!((0 <= (ref = Date.now() - (ThreadWatcher.db.data.lastChecked || 0)) && ref < interval))) { - db = ThreadWatcher.db; - now = Date.now(); - deep = !((now - 2 * $.HOUR < (ref1 = db.data.lastChecked2 || 0) && ref1 <= now)); - boards = ThreadWatcher.getAll(true); - for (k = 0, len2 = boards.length; k < len2; k++) { - board = boards[k]; - ThreadWatcher.fetchBoard(board, deep); - } - db.setLastChecked(); - if (deep) { - db.setLastChecked('lastChecked2'); - } - } - if (ThreadWatcher.fetched === ThreadWatcher.requests.length) { - return ThreadWatcher.clearRequests(); - } - } - })); - } - return results; - }, - fetchBoard: function(board, deep) { - var base, boardID, data, force, j, len1, ref, site, siteID, thread, url, urlF; - if (!board.some(function(thread) { - return !thread.data.isDead; - })) { - return; - } - force = false; - for (j = 0, len1 = board.length; j < len1; j++) { - thread = board[j]; - data = thread.data; - if (!data.isDead && data.last !== -1) { - if (Conf['Show Page'] && (data.page == null)) { - force = true; - } - if (data.modified == null) { - force = thread.force = true; - } - } - } - ref = board[0], siteID = ref.siteID, boardID = ref.boardID; - site = g.sites[siteID]; - if (!site) { - return; - } - urlF = deep && site.threadModTimeIgnoresSage ? 'catalogJSON' : 'threadsListJSON'; - url = typeof (base = site.urls)[urlF] === "function" ? base[urlF]({ - siteID: siteID, - boardID: boardID - }) : void 0; - if (!url) { - return; - } - return ThreadWatcher.fetch(url, { - siteID: siteID, - force: force - }, [board, url], ThreadWatcher.parseBoard); - }, - parseBoard: function(board, url) { - var base, boardID, data, i, index, item, j, k, l, lastPage, len1, len2, len3, len4, lmDate, m, modified, nThreads, oldest, page, pageLength, ref, ref1, ref2, ref3, ref4, replies, siteID, thread, threadID, threads; - if (this.status !== 200) { - return; - } - ref = board[0], siteID = ref.siteID, boardID = ref.boardID; - lmDate = this.getResponseHeader('Last-Modified'); - ThreadWatcher.dbLM.extend({ - siteID: siteID, - boardID: boardID, - val: $.item(url, lmDate) - }); - threads = $.dict(); - pageLength = 0; - nThreads = 0; - oldest = null; - try { - pageLength = ((ref1 = this.response[0]) != null ? ref1.threads.length : void 0) || 0; - ref2 = this.response; - for (i = j = 0, len1 = ref2.length; j < len1; i = ++j) { - page = ref2[i]; - ref3 = page.threads; - for (k = 0, len2 = ref3.length; k < len2; k++) { - item = ref3[k]; - threads[item.no] = { - page: i + 1, - index: nThreads, - modified: item.last_modified, - replies: item.replies - }; - nThreads++; - if ((oldest == null) || item.no < oldest) { - oldest = item.no; - } - } - } - } catch (error) { - for (l = 0, len3 = board.length; l < len3; l++) { - thread = board[l]; - ThreadWatcher.fetchStatus(thread); - } - } - for (m = 0, len4 = board.length; m < len4; m++) { - thread = board[m]; - threadID = thread.threadID, data = thread.data; - if (threads[threadID]) { - ref4 = threads[threadID], page = ref4.page, index = ref4.index, modified = ref4.modified, replies = ref4.replies; - if (Conf['Show Page']) { - lastPage = (typeof (base = g.sites[siteID]).isPrunedByAge === "function" ? base.isPrunedByAge({ - siteID: siteID, - boardID: boardID - }) : void 0) ? threadID === oldest : index >= nThreads - pageLength; - ThreadWatcher.update(siteID, boardID, threadID, { - page: page, - lastPage: lastPage - }); - } - if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) { - if (modified !== data.modified || ((replies != null) && replies !== data.replies)) { - (thread.newData || (thread.newData = {})).modified = modified; - ThreadWatcher.fetchStatus(thread); - } - } - } else { - ThreadWatcher.fetchStatus(thread); - } - } - }, - fetchStatus: function(thread) { - var base, boardID, data, force, ref, siteID, threadID, url; - siteID = thread.siteID, boardID = thread.boardID, threadID = thread.threadID, data = thread.data, force = thread.force; - url = (ref = g.sites[siteID]) != null ? typeof (base = ref.urls).threadJSON === "function" ? base.threadJSON({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }) : void 0 : void 0; - if (!url) { - return; - } - if (data.isDead && !force) { - return; - } - if (data.last === -1) { - return; - } - return ThreadWatcher.fetch(url, { - siteID: siteID, - force: force - }, [thread], ThreadWatcher.parseStatus); - }, - parseStatus: function(thread, isArchiveURL) { - var archiveURL, base, boardID, data, force, isArchived, isDead, j, last, lastReadPost, len1, match, newData, postObj, quotesYou, quotingYou, ref, ref1, ref2, ref3, regexp, replies, site, siteID, threadID, unread, youOP; - siteID = thread.siteID, boardID = thread.boardID, threadID = thread.threadID, data = thread.data, newData = thread.newData, force = thread.force; - site = g.sites[siteID]; - if (this.status === 200 && this.response) { - last = this.response.posts[this.response.posts.length - 1].no; - replies = this.response.posts.length - 1; - isDead = isArchived = !!(this.response.posts[0].archived || isArchiveURL); - if (isDead && Conf['Auto Prune']) { - ThreadWatcher.rm(siteID, boardID, threadID); - return; - } - if (last === data.last && isDead === data.isDead && isArchived === data.isArchived) { - return; - } - lastReadPost = ThreadWatcher.unreaddb.get({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - defaultValue: 0 - }); - unread = data.unread || 0; - quotingYou = data.quotingYou || 0; - youOP = !!((ref = QuoteYou.db) != null ? ref.get({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - postID: threadID - }) : void 0); - ref1 = this.response.posts; - for (j = 0, len1 = ref1.length; j < len1; j++) { - postObj = ref1[j]; - if (!(postObj.no > (data.last || 0) && postObj.no > lastReadPost)) { - continue; - } - if ((ref2 = QuoteYou.db) != null ? ref2.get({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - postID: postObj.no - }) : void 0) { - continue; - } - quotesYou = false; - if (!Conf['Require OP Quote Link'] && youOP) { - quotesYou = true; - } else if (QuoteYou.db && postObj.com) { - regexp = site.regexp.quotelinkHTML; - regexp.lastIndex = 0; - while ((match = regexp.exec(postObj.com))) { - if (QuoteYou.db.get({ - siteID: siteID, - boardID: match[1] ? encodeURIComponent(match[1]) : boardID, - threadID: match[2] || threadID, - postID: match[3] || match[2] || threadID - })) { - quotesYou = true; - break; - } - } - } - if (!unread || (!quotingYou && quotesYou)) { - if (Filter.isHidden(site.Build.parseJSON(postObj, { - siteID: siteID, - boardID: boardID - }))) { - continue; - } - } - unread++; - if (quotesYou) { - quotingYou = postObj.no; - } - } - newData || (newData = {}); - $.extend(newData, { - last: last, - replies: replies, - isDead: isDead, - isArchived: isArchived, - unread: unread, - quotingYou: quotingYou - }); - return ThreadWatcher.update(siteID, boardID, threadID, newData); - } else if (this.status === 404) { - archiveURL = (ref3 = g.sites[siteID]) != null ? typeof (base = ref3.urls).archivedThreadJSON === "function" ? base.archivedThreadJSON({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }) : void 0 : void 0; - if (!isArchiveURL && archiveURL) { - return ThreadWatcher.fetch(archiveURL, { - siteID: siteID, - force: force - }, [thread, true], ThreadWatcher.parseStatus); - } else if (site.mayLackJSON && (data.last == null)) { - return ThreadWatcher.update(siteID, boardID, threadID, { - last: -1 - }); - } else { - return ThreadWatcher.update(siteID, boardID, threadID, { - isDead: true - }); - } - } - }, - getAll: function(groupByBoard) { - var all, boardID, boards, cont, data, ref, ref1, siteID, threadID, threads; - all = []; - ref = ThreadWatcher.db.data; - for (siteID in ref) { - boards = ref[siteID]; - ref1 = boards.boards; - for (boardID in ref1) { - threads = ref1[boardID]; - if (Conf['Current Board'] && (siteID !== g.SITE.ID || boardID !== g.BOARD.ID)) { - continue; - } - if (groupByBoard) { - all.push((cont = [])); - } - for (threadID in threads) { - data = threads[threadID]; - if (data && typeof data === 'object') { - (groupByBoard ? cont : all).push({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - data: data - }); - } - } - } - } - return all; - }, - makeLine: function(siteID, boardID, threadID, data) { - var count, div, excerpt, fullID, isArchived, link, page, ref, title, x; - x = $.el('a', { - className: 'fa fa-times', - href: 'javascript:;' - }); - $.on(x, 'click', ThreadWatcher.cb.rm); - excerpt = data.excerpt, isArchived = data.isArchived; - excerpt || (excerpt = "/" + boardID + "/ - No." + threadID); - if (Conf['Show Site Prefix']) { - excerpt = ThreadWatcher.prefixes[siteID] + excerpt; - } - link = $.el('a', { - href: ((ref = g.sites[siteID]) != null ? ref.urls.thread({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }, isArchived) : void 0) || '', - title: excerpt, - className: 'watcher-link' - }); - if (Conf['Show Page'] && (data.page != null)) { - page = $.el('span', { - textContent: "[" + data.page + "]", - className: 'watcher-page' - }); - $.add(link, page); - } - if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count'] && (data.unread != null)) { - count = $.el('span', { - textContent: "(" + data.unread + ")", - className: 'watcher-unread' - }); - $.add(link, count); - } - title = $.el('span', { - textContent: excerpt, - className: 'watcher-title' - }); - $.add(link, title); - div = $.el('div'); - fullID = boardID + "." + threadID; - div.dataset.fullID = fullID; - div.dataset.siteID = siteID; - if (g.VIEW === 'thread' && fullID === (g.BOARD + "." + g.THREADID)) { - $.addClass(div, 'current'); - } - if (data.isDead) { - $.addClass(div, 'dead-thread'); - } - if (Conf['Show Page']) { - if (data.lastPage) { - $.addClass(div, 'last-page'); - } - if (data.page != null) { - div.dataset.page = data.page; - } - } - if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) { - if (data.unread === 0) { - $.addClass(div, 'replies-read'); - } - if (data.unread) { - $.addClass(div, 'replies-unread'); - } - if ((data.quotingYou || 0) > (data.dismiss || 0)) { - $.addClass(div, 'replies-quoting-you'); - } - } - $.add(div, [x, $.tn(' '), link]); - return div; - }, - setPrefixes: function(threads) { - var conflicts, conflicts2, j, k, len, len1, len2, prefix, prefixes, siteID, siteID2; - prefixes = $.dict(); - for (j = 0, len1 = threads.length; j < len1; j++) { - siteID = threads[j].siteID; - if (siteID in prefixes) { - continue; - } - len = 0; - prefix = ''; - conflicts = Object.keys(prefixes); - while (conflicts.length > 0) { - len++; - prefix = siteID.slice(0, len); - conflicts2 = []; - for (k = 0, len2 = conflicts.length; k < len2; k++) { - siteID2 = conflicts[k]; - if (siteID2.slice(0, len) === prefix) { - conflicts2.push(siteID2); - } else if (prefixes[siteID2].length < len) { - prefixes[siteID2] = siteID2.slice(0, len); - } - } - conflicts = conflicts2; - } - prefixes[siteID] = prefix; - } - return ThreadWatcher.prefixes = prefixes; - }, - build: function() { - var boardID, data, j, len1, list, nodes, ref, siteID, thread, threadID, threads; - nodes = []; - threads = ThreadWatcher.getAll(); - ThreadWatcher.setPrefixes(threads); - for (j = 0, len1 = threads.length; j < len1; j++) { - ref = threads[j], siteID = ref.siteID, boardID = ref.boardID, threadID = ref.threadID, data = ref.data; - if ((data.excerpt == null) && siteID === g.SITE.ID && (thread = g.threads.get(boardID + "." + threadID)) && thread.OP) { - ThreadWatcher.db.extend({ - boardID: boardID, - threadID: threadID, - val: { - excerpt: Get.threadExcerpt(thread) - } - }); - } - nodes.push(ThreadWatcher.makeLine(siteID, boardID, threadID, data)); - } - list = ThreadWatcher.list; - $.rmAll(list); - $.add(list, nodes); - return ThreadWatcher.refreshIcon(); - }, - refresh: function() { - ThreadWatcher.build(); - g.threads.forEach(function(thread) { - var isWatched, j, len1, post, ref, toggler; - isWatched = ThreadWatcher.isWatched(thread); - if (thread.OP) { - ref = [thread.OP].concat(slice.call(thread.OP.clones)); - for (j = 0, len1 = ref.length; j < len1; j++) { - post = ref[j]; - if ((toggler = $('.watch-thread-link', post.nodes.info))) { - ThreadWatcher.setToggler(toggler, isWatched); - } - } - } - if (thread.catalogView) { - return thread.catalogView.nodes.root.classList.toggle('watched', isWatched); - } - }); - if (Conf['Pin Watched Threads']) { - return $.event('SortIndex', { - deferred: Conf['Index Mode'] !== 'catalog' - }); - } - }, - refreshIcon: function() { - var className, j, len1, ref; - ref = ['replies-unread', 'replies-quoting-you']; - for (j = 0, len1 = ref.length; j < len1; j++) { - className = ref[j]; - ThreadWatcher.shortcut.classList.toggle(className, !!$("." + className, ThreadWatcher.dialog)); - } - }, - update: function(siteID, boardID, threadID, newData) { - var data, j, key, len1, line, n, newLine, ref, ref1, val; - if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }) : void 0)) { - return; - } - if (newData.isDead && Conf['Auto Prune']) { - ThreadWatcher.rm(siteID, boardID, threadID); - return; - } - if (newData.isDead || newData.last === -1) { - ref1 = ['isArchived', 'page', 'lastPage', 'unread', 'quotingyou']; - for (j = 0, len1 = ref1.length; j < len1; j++) { - key = ref1[j]; - if (!(key in newData)) { - newData[key] = void 0; - } - } - } - if ((newData.last != null) && newData.last < data.last) { - newData.modified = void 0; - } - n = 0; - for (key in newData) { - val = newData[key]; - if (data[key] !== val) { - n++; - } - } - if (!n) { - return; - } - ThreadWatcher.db.extend({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - val: newData - }); - if ((line = $("#watched-threads > [data-site-i-d='" + siteID + "'][data-full-i-d='" + boardID + "." + threadID + "']", ThreadWatcher.dialog))) { - newLine = ThreadWatcher.makeLine(siteID, boardID, threadID, data); - $.replace(line, newLine); - return ThreadWatcher.refreshIcon(); - } else { - return ThreadWatcher.refresh(); - } - }, - set404: function(boardID, threadID, cb) { - var data, ref; - if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({ - boardID: boardID, - threadID: threadID - }) : void 0)) { - return cb(); - } - if (Conf['Auto Prune']) { - ThreadWatcher.db["delete"]({ - boardID: boardID, - threadID: threadID - }); - return cb(); - } - if (data.isDead && !((data.isArchived != null) || (data.page != null) || (data.lastPage != null) || (data.unread != null) || (data.quotingYou != null))) { - return cb(); - } - return ThreadWatcher.db.extend({ - boardID: boardID, - threadID: threadID, - val: { - isDead: true, - isArchived: void 0, - page: void 0, - lastPage: void 0, - unread: void 0, - quotingYou: void 0 - } - }, cb); - }, - toggle: function(thread) { - var boardID, siteID, threadID; - siteID = g.SITE.ID; - boardID = thread.board.ID; - threadID = thread.ID; - if (ThreadWatcher.db.get({ - boardID: boardID, - threadID: threadID - })) { - return ThreadWatcher.rm(siteID, boardID, threadID); - } else { - return ThreadWatcher.add(thread); - } - }, - add: function(thread, cb) { - var boardID, data, siteID, threadID; - data = {}; - siteID = g.SITE.ID; - boardID = thread.board.ID; - threadID = thread.ID; - if (thread.isDead) { - if (Conf['Auto Prune'] && ThreadWatcher.db.get({ - boardID: boardID, - threadID: threadID - })) { - ThreadWatcher.rm(siteID, boardID, threadID, cb); - return; - } - data.isDead = true; - } - if (thread.OP) { - data.excerpt = Get.threadExcerpt(thread); - } - return ThreadWatcher.addRaw(boardID, threadID, data, cb); - }, - addRaw: function(boardID, threadID, data, cb) { - var oldData, thread; - oldData = ThreadWatcher.db.get({ - boardID: boardID, - threadID: threadID, - defaultValue: $.dict() - }); - delete oldData.last; - delete oldData.modified; - $.extend(oldData, data); - ThreadWatcher.db.set({ - boardID: boardID, - threadID: threadID, - val: oldData - }, cb); - ThreadWatcher.refresh(); - thread = { - siteID: g.SITE.ID, - boardID: boardID, - threadID: threadID, - data: data, - force: true - }; - if (Conf['Show Page'] && !data.isDead) { - return ThreadWatcher.fetchBoard([thread]); - } else if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) { - return ThreadWatcher.fetchStatus(thread); - } - }, - rm: function(siteID, boardID, threadID, cb) { - ThreadWatcher.db["delete"]({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }, cb); - return ThreadWatcher.refresh(); - }, - menu: { - init: function() { - var menu; - if (!Conf['Thread Watcher']) { - return; - } - menu = this.menu = new UI.Menu('thread watcher'); - $.on($('.menu-button', ThreadWatcher.dialog), 'click', function(e) { - return menu.toggle(e, this, ThreadWatcher); - }); - return this.addMenuEntries(); - }, - addHeaderMenuEntry: function() { - var entryEl; - if (g.VIEW !== 'thread') { - return; - } - entryEl = $.el('a', { - href: 'javascript:;' - }); - Header.menu.addEntry({ - el: entryEl, - order: 60, - open: function() { - var addClass, ref, rmClass, text; - ref = !!ThreadWatcher.db.get({ - boardID: g.BOARD.ID, - threadID: g.THREADID - }) ? ['unwatch-thread', 'watch-thread', 'Unwatch thread'] : ['watch-thread', 'unwatch-thread', 'Watch thread'], addClass = ref[0], rmClass = ref[1], text = ref[2]; - $.addClass(entryEl, addClass); - $.rmClass(entryEl, rmClass); - entryEl.textContent = text; - return true; - } - }); - return $.on(entryEl, 'click', function() { - return ThreadWatcher.toggle(g.threads.get(g.BOARD + "." + g.THREADID)); - }); - }, - addMenuEntries: function() { - var cb, conf, entries, entry, j, len1, name, open, ref, ref1, text, title; - entries = []; - entries.push({ - text: 'Open all threads', - cb: ThreadWatcher.cb.openAll, - open: function() { - this.el.classList.toggle('disabled', !ThreadWatcher.list.firstElementChild); - return true; - } - }); - entries.push({ - text: 'Open unread threads', - cb: ThreadWatcher.cb.openUnread, - open: function() { - this.el.classList.toggle('disabled', !$('.replies-unread', ThreadWatcher.list)); - return true; - } - }); - entries.push({ - text: 'Open dead threads', - cb: ThreadWatcher.cb.openDeads, - open: function() { - this.el.classList.toggle('disabled', !$('.dead-thread', ThreadWatcher.list)); - return true; - } - }); - entries.push({ - text: 'Prune dead threads', - cb: ThreadWatcher.cb.pruneDeads, - open: function() { - this.el.classList.toggle('disabled', !$('.dead-thread', ThreadWatcher.list)); - return true; - } - }); - entries.push({ - text: 'Dismiss posts quoting you', - title: 'Unhighlight the thread watcher icon and threads until there are new replies quoting you.', - cb: ThreadWatcher.cb.dismiss, - open: function() { - this.el.classList.toggle('disabled', !$.hasClass(ThreadWatcher.shortcut, 'replies-quoting-you')); - return true; - } - }); - for (j = 0, len1 = entries.length; j < len1; j++) { - ref = entries[j], text = ref.text, title = ref.title, cb = ref.cb, open = ref.open; - entry = { - el: $.el('a', { - textContent: text, - href: 'javascript:;' - }) - }; - if (title) { - entry.el.title = title; - } - $.on(entry.el, 'click', cb); - entry.open = open.bind(entry); - this.menu.addEntry(entry); - } - ref1 = Config.threadWatcher; - for (name in ref1) { - conf = ref1[name]; - this.addCheckbox(name, conf[1]); - } - }, - addCheckbox: function(name, desc) { - var entry, input; - entry = { - type: 'thread watcher', - el: UI.checkbox(name, name.replace(' Thread Watcher', '')) - }; - entry.el.title = desc; - input = entry.el.firstElementChild; - if (name === 'Show Unread Count' && !ThreadWatcher.unreadEnabled) { - input.disabled = true; - $.addClass(entry.el, 'disabled'); - entry.el.title += '\n[Remember Last Read Post is disabled.]'; - } - $.on(input, 'change', $.cb.checked); - if (name === 'Current Board' || name === 'Show Page' || name === 'Show Unread Count' || name === 'Show Site Prefix') { - $.on(input, 'change', ThreadWatcher.refresh); - } - if (name === 'Show Page' || name === 'Show Unread Count' || name === 'Auto Update Thread Watcher') { - $.on(input, 'change', ThreadWatcher.fetchAuto); - } - return this.menu.addEntry(entry); - } - } - }; - - return ThreadWatcher; - -}).call(this); - -Unread = (function() { - var Unread; - - Unread = { - init: function() { - if (!(g.VIEW === 'thread' && (Conf['Unread Count'] || Conf['Unread Favicon'] || Conf['Unread Line'] || Conf['Remember Last Read Post'] || Conf['Desktop Notifications'] || Conf['Quote Threading']))) { - return; - } - if (Conf['Remember Last Read Post']) { - $.sync('Remember Last Read Post', function(enabled) { - return Conf['Remember Last Read Post'] = enabled; - }); - this.db = new DataBoard('lastReadPosts', this.sync); - } - this.hr = $.el('hr', { - id: 'unread-line', - className: 'unread-line' - }); - this.posts = new Set(); - this.postsQuotingYou = new Set(); - this.order = new RandomAccessList(); - this.position = null; - Callbacks.Thread.push({ - name: 'Unread', - cb: this.node - }); - return Callbacks.Post.push({ - name: 'Unread', - cb: this.addPost - }); - }, - node: function() { - var ID, j, len, ref, ref1, resetLink; - Unread.thread = this; - Unread.title = d.title; - Unread.lastReadPost = ((ref = Unread.db) != null ? ref.get({ - boardID: this.board.ID, - threadID: this.ID - }) : void 0) || 0; - Unread.readCount = 0; - ref1 = this.posts.keys; - for (j = 0, len = ref1.length; j < len; j++) { - ID = ref1[j]; - if (+ID <= Unread.lastReadPost) { - Unread.readCount++; - } - } - $.one(d, '4chanXInitFinished', Unread.ready); - $.on(d, 'PostsInserted', Unread.onUpdate); - $.on(d, 'ThreadUpdate', function(e) { - if (e.detail[404]) { - return Unread.update(); - } - }); - resetLink = $.el('a', { - href: 'javascript:;', - className: 'unread-reset', - textContent: 'Mark all unread' - }); - $.on(resetLink, 'click', Unread.reset); - return Header.menu.addEntry({ - el: resetLink, - order: 70 - }); - }, - ready: function() { - if (Conf['Remember Last Read Post'] && Conf['Scroll to Last Read Post']) { - Unread.scroll(); - } - Unread.setLine(true); - Unread.read(); - Unread.update(); - $.on(d, 'scroll visibilitychange', Unread.read); - if (Conf['Unread Line']) { - return $.on(d, 'visibilitychange', Unread.setLine); - } - }, - positionPrev: function() { - if (Unread.position) { - return Unread.position.prev; - } else { - return Unread.order.last; - } - }, - scroll: function() { - var bottom, hash, position; - if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) { - return; - } - position = Unread.positionPrev(); - while (position) { - bottom = position.data.nodes.bottom; - if (!bottom.getBoundingClientRect().height) { - position = position.prev; - } else { - Header.scrollToIfNeeded(bottom, true); - break; - } - } - }, - reset: function() { - if (Unread.lastReadPost == null) { - return; - } - Unread.posts = new Set(); - Unread.postsQuotingYou = new Set(); - Unread.order = new RandomAccessList(); - Unread.position = null; - Unread.lastReadPost = 0; - Unread.readCount = 0; - Unread.thread.posts.forEach(function(post) { - return Unread.addPost.call(post); - }); - $.forceSync('Remember Last Read Post'); - if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) { - Unread.db.set({ - boardID: Unread.thread.board.ID, - threadID: Unread.thread.ID, - val: 0 - }); - } - Unread.updatePosition(); - Unread.setLine(); - return Unread.update(); - }, - sync: function() { - var ID, i, j, lastReadPost, postIDs, ref, ref1; - if (Unread.lastReadPost == null) { - return; - } - lastReadPost = Unread.db.get({ - boardID: Unread.thread.board.ID, - threadID: Unread.thread.ID, - defaultValue: 0 - }); - if (!(Unread.lastReadPost < lastReadPost)) { - return; - } - Unread.lastReadPost = lastReadPost; - postIDs = Unread.thread.posts.keys; - for (i = j = ref = Unread.readCount, ref1 = postIDs.length; j < ref1; i = j += 1) { - ID = +postIDs[i]; - if (!Unread.thread.posts.get(ID).isFetchedQuote) { - if (ID > Unread.lastReadPost) { - break; - } - Unread.posts["delete"](ID); - Unread.postsQuotingYou["delete"](ID); - } - Unread.readCount++; - } - Unread.updatePosition(); - Unread.setLine(); - return Unread.update(); - }, - addPost: function() { - if (this.isFetchedQuote || this.isClone) { - return; - } - Unread.order.push(this); - if (this.ID <= Unread.lastReadPost || this.isHidden || QuoteYou.isYou(this)) { - return; - } - Unread.posts.add((Unread.posts.last = this.ID)); - Unread.addPostQuotingYou(this); - return Unread.position != null ? Unread.position : Unread.position = Unread.order[this.ID]; - }, - addPostQuotingYou: function(post) { - var j, len, quotelink, ref, ref1; - ref = post.nodes.quotelinks; - for (j = 0, len = ref.length; j < len; j++) { - quotelink = ref[j]; - if (!((ref1 = QuoteYou.db) != null ? ref1.get(Get.postDataFromLink(quotelink)) : void 0)) { - continue; - } - Unread.postsQuotingYou.add((Unread.postsQuotingYou.last = post.ID)); - Unread.openNotification(post); - return; - } - }, - openNotification: function(post, predicate) { - var notif; - if (predicate == null) { - predicate = ' replied to you'; - } - if (!Header.areNotificationsEnabled) { - return; - } - notif = new Notification("" + post.info.nameBlock + predicate, { - body: post.commentDisplay(), - icon: Favicon.logo - }); - notif.onclick = function() { - Header.scrollToIfNeeded(post.nodes.bottom, true); - return window.focus(); - }; - return notif.onshow = function() { - return setTimeout(function() { - return notif.close(); - }, 7 * $.SECOND); - }; - }, - onUpdate: function() { - return $.queueTask(function() { - Unread.setLine(); - Unread.read(); - return Unread.update(); - }); - }, - readSinglePost: function(post) { - var ID; - ID = post.ID; - if (!Unread.posts.has(ID)) { - return; - } - Unread.posts["delete"](ID); - Unread.postsQuotingYou["delete"](ID); - Unread.updatePosition(); - Unread.saveLastReadPost(); - return Unread.update(); - }, - read: $.debounce(100, function(e) { - var ID, bottom, count, data, ref; - if (!Unread.posts.size && Unread.readCount !== Unread.thread.posts.keys.length) { - Unread.saveLastReadPost(); - } - if (d.hidden || !Unread.posts.size) { - return; - } - count = 0; - while (Unread.position) { - ref = Unread.position, ID = ref.ID, data = ref.data; - bottom = data.nodes.bottom; - if (!(!bottom.getBoundingClientRect().height || Header.getBottomOf(bottom) > -1)) { - break; - } - count++; - Unread.posts["delete"](ID); - Unread.postsQuotingYou["delete"](ID); - Unread.position = Unread.position.next; - } - if (!count) { - return; - } - Unread.updatePosition(); - Unread.saveLastReadPost(); - if (e) { - return Unread.update(); - } - }), - updatePosition: function() { - while (Unread.position && !Unread.posts.has(Unread.position.ID)) { - Unread.position = Unread.position.next; - } - }, - saveLastReadPost: $.debounce(2 * $.SECOND, function() { - var ID, i, j, postIDs, ref, ref1; - $.forceSync('Remember Last Read Post'); - if (!(Conf['Remember Last Read Post'] && Unread.db)) { - return; - } - postIDs = Unread.thread.posts.keys; - for (i = j = ref = Unread.readCount, ref1 = postIDs.length; j < ref1; i = j += 1) { - ID = +postIDs[i]; - if (!Unread.thread.posts.get(ID).isFetchedQuote) { - if (Unread.posts.has(ID)) { - break; - } - Unread.lastReadPost = ID; - } - Unread.readCount++; - } - if (Unread.thread.isDead && !Unread.thread.isArchived) { - return; - } - return Unread.db.set({ - boardID: Unread.thread.board.ID, - threadID: Unread.thread.ID, - val: Unread.lastReadPost - }); - }), - setLine: function(force) { - var node, oldPosition, ref; - if (!Conf['Unread Line']) { - return; - } - if (Unread.hr.hidden || d.hidden || (force === true)) { - oldPosition = Unread.linePosition; - if ((Unread.linePosition = Unread.positionPrev())) { - if (Unread.linePosition !== oldPosition) { - node = Unread.linePosition.data.nodes.bottom; - if (((ref = node.nextSibling) != null ? ref.tagName : void 0) === 'BR') { - node = node.nextSibling; - } - $.after(node, Unread.hr); - } - } else { - $.rm(Unread.hr); - } - } - return Unread.hr.hidden = Unread.linePosition === Unread.order.last; - }, - update: function() { - var count, countQuotingYou, isDead, titleCount, titleDead, titleQuotingYou; - count = Unread.posts.size; - countQuotingYou = Unread.postsQuotingYou.size; - if (Conf['Unread Count']) { - titleQuotingYou = Conf['Quoted Title'] && countQuotingYou ? '(!) ' : ''; - titleCount = count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : ''; - titleDead = Unread.thread.isDead ? Unread.title.replace('-', (Unread.thread.isArchived ? '- Archived -' : '- 404 -')) : Unread.title; - d.title = "" + titleQuotingYou + titleCount + titleDead; - } - Unread.saveThreadWatcherCount(); - if (Conf['Unread Favicon'] && g.SITE.software === 'yotsuba') { - isDead = Unread.thread.isDead; - return Favicon.set((countQuotingYou ? (isDead ? 'unreadDeadY' : 'unreadY') : count ? (isDead ? 'unreadDead' : 'unread') : (isDead ? 'dead' : 'default'))); - } - }, - saveThreadWatcherCount: $.debounce(2 * $.SECOND, function() { - var i, j, posts, quotingYou, ref; - $.forceSync('Remember Last Read Post'); - if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) { - quotingYou = !Conf['Require OP Quote Link'] && QuoteYou.isYou(Unread.thread.OP) ? Unread.posts : Unread.postsQuotingYou; - if (!quotingYou.size) { - quotingYou.last = 0; - } else if (!quotingYou.has(quotingYou.last)) { - quotingYou.last = 0; - posts = Unread.thread.posts.keys; - for (i = j = ref = posts.length - 1; j >= 0; i = j += -1) { - if (quotingYou.has(+posts[i])) { - quotingYou.last = posts[i]; - break; - } - } - } - return ThreadWatcher.update(g.SITE.ID, Unread.thread.board.ID, Unread.thread.ID, { - last: Unread.thread.lastPost, - isDead: Unread.thread.isDead, - isArchived: Unread.thread.isArchived, - unread: Unread.posts.size, - quotingYou: quotingYou.last || 0 - }); - } - }) - }; - - return Unread; - -}).call(this); - -UnreadIndex = (function() { - var UnreadIndex; - - UnreadIndex = { - lastReadPost: $.dict(), - hr: $.dict(), - markReadLink: $.dict(), - init: function() { - if (!(g.VIEW === 'index' && Conf['Remember Last Read Post'] && Conf['Unread Line in Index'])) { - return; - } - this.enabled = true; - this.db = new DataBoard('lastReadPosts', this.sync); - Callbacks.Thread.push({ - name: 'Unread Line in Index', - cb: this.node - }); - $.on(d, 'IndexRefreshInternal', this.onIndexRefresh); - return $.on(d, 'PostsInserted PostsRemoved', this.onPostsInserted); - }, - node: function() { - UnreadIndex.lastReadPost[this.fullID] = UnreadIndex.db.get({ - boardID: this.board.ID, - threadID: this.ID - }) || 0; - if (!Index.enabled) { - return UnreadIndex.update(this); - } - }, - onIndexRefresh: function(e) { - var i, len, ref, results, thread, threadID; - if (e.detail.isCatalog) { - return; - } - ref = e.detail.threadIDs; - results = []; - for (i = 0, len = ref.length; i < len; i++) { - threadID = ref[i]; - thread = g.threads.get(threadID); - results.push(UnreadIndex.update(thread)); - } - return results; - }, - onPostsInserted: function(e) { - var ref, ref1, thread, wasVisible; - if (e.target === Index.root) { - return; - } - thread = Get.threadFromNode(e.target); - if (!thread || thread.nodes.root !== e.target) { - return; - } - wasVisible = !!((ref = UnreadIndex.hr[thread.fullID]) != null ? ref.parentNode : void 0); - UnreadIndex.update(thread); - if (Conf['Scroll to Last Read Post'] && e.type === 'PostsInserted' && !wasVisible && !!((ref1 = UnreadIndex.hr[thread.fullID]) != null ? ref1.parentNode : void 0)) { - return Header.scrollToIfNeeded(UnreadIndex.hr[thread.fullID], true); - } - }, - sync: function() { - return g.threads.forEach(function(thread) { - var lastReadPost, ref; - lastReadPost = UnreadIndex.db.get({ - boardID: thread.board.ID, - threadID: thread.ID - }) || 0; - if (lastReadPost !== UnreadIndex.lastReadPost[thread.fullID]) { - UnreadIndex.lastReadPost[thread.fullID] = lastReadPost; - if ((ref = thread.nodes.root) != null ? ref.parentNode : void 0) { - return UnreadIndex.update(thread); - } - } - }); - }, - update: function(thread) { - var divider, firstUnread, hasUnread, hr, lastReadPost, link, repliesRead, repliesShown; - lastReadPost = UnreadIndex.lastReadPost[thread.fullID]; - repliesShown = 0; - repliesRead = 0; - firstUnread = null; - thread.posts.forEach(function(post) { - if (post.isReply && thread.nodes.root.contains(post.nodes.root)) { - repliesShown++; - if (post.ID <= lastReadPost) { - return repliesRead++; - } else if ((!firstUnread || post.ID < firstUnread.ID) && !post.isHidden && !QuoteYou.isYou(post)) { - return firstUnread = post; - } - } - }); - hr = UnreadIndex.hr[thread.fullID]; - if (firstUnread && (repliesRead || (lastReadPost === thread.OP.ID && (!$(g.SITE.selectors.summary, thread.nodes.root) || thread.ID in ExpandThread.statuses)))) { - if (!hr) { - hr = UnreadIndex.hr[thread.fullID] = $.el('hr', { - className: 'unread-line' - }); - } - $.before(firstUnread.nodes.root, hr); - } else { - $.rm(hr); - } - hasUnread = repliesShown ? firstUnread || !repliesRead : Index.enabled ? thread.lastPost > lastReadPost : thread.OP.ID > lastReadPost; - thread.nodes.root.classList.toggle('unread-thread', hasUnread); - link = UnreadIndex.markReadLink[thread.fullID]; - if (!link) { - link = UnreadIndex.markReadLink[thread.fullID] = $.el('a', { - className: 'unread-mark-read brackets-wrap', - href: 'javascript:;', - textContent: 'Mark Read' - }); - $.on(link, 'click', UnreadIndex.markRead); - } - if ((divider = $(g.SITE.selectors.threadDivider, thread.nodes.root))) { - return $.before(divider, link); - } else { - return $.add(thread.nodes.root, link); - } - }, - markRead: function() { - var thread; - thread = Get.threadFromNode(this); - UnreadIndex.lastReadPost[thread.fullID] = thread.lastPost; - UnreadIndex.db.set({ - boardID: thread.board.ID, - threadID: thread.ID, - val: thread.lastPost - }); - $.rm(UnreadIndex.hr[thread.fullID]); - thread.nodes.root.classList.remove('unread-thread'); - return ThreadWatcher.update(g.SITE.ID, thread.board.ID, thread.ID, { - last: thread.lastPost, - unread: 0, - quotingYou: 0 - }); - } - }; - - return UnreadIndex; - -}).call(this); - -Captcha = {}; - -(function() { - Captcha.cache = { - init: function() { - $.on(d, 'SaveCaptcha', (function(_this) { - return function(e) { - return _this.saveAPI(e.detail); - }; - })(this)); - return $.on(d, 'NoCaptcha', (function(_this) { - return function(e) { - return _this.noCaptcha(e.detail); - }; - })(this)); - }, - captchas: [], - getCount: function() { - return this.captchas.length; - }, - neededRaw: function() { - return !(this.haveCookie() || this.captchas.length || QR.req || this.submitCB) && (QR.posts.length > 1 || Conf['Auto-load captcha'] || !QR.posts[0].isOnlyQuotes() || QR.posts[0].file); - }, - needed: function() { - return this.neededRaw() && $.event('LoadCaptcha'); - }, - prerequest: function() { - if (!Conf['Prerequest Captcha']) { - return; - } - return $.queueTask((function(_this) { - return function() { - var isReply; - if (!_this.prerequested && _this.neededRaw() && !$.event('LoadCaptcha') && !QR.captcha.occupied() && QR.cooldown.seconds <= 60 && QR.selected === QR.posts[QR.posts.length - 1] && !QR.selected.isOnlyQuotes()) { - isReply = QR.selected.thread !== 'new'; - if (!$.event('RequestCaptcha', { - isReply: isReply - })) { - _this.prerequested = true; - _this.submitCB = function(captcha) { - if (captcha) { - return _this.save(captcha); - } - }; - return _this.updateCount(); - } - } - }; - })(this)); - }, - haveCookie: function() { - return /\b_ct=/.test(d.cookie) && QR.posts[0].thread !== 'new'; - }, - getOne: function() { - var captcha; - delete this.prerequested; - this.clear(); - if ((captcha = this.captchas.shift())) { - this.count(); - return captcha; - } else { - return null; - } - }, - request: function(isReply) { - if (!this.submitCB) { - if ($.event('RequestCaptcha', { - isReply: isReply - })) { - return; - } - } - return (function(_this) { - return function(cb) { - _this.submitCB = cb; - return _this.updateCount(); - }; - })(this); - }, - abort: function() { - if (this.submitCB) { - delete this.submitCB; - $.event('AbortCaptcha'); - return this.updateCount(); - } - }, - saveAPI: function(captcha) { - var cb; - if ((cb = this.submitCB)) { - delete this.submitCB; - cb(captcha); - return this.updateCount(); - } else { - return this.save(captcha); - } - }, - noCaptcha: function(detail) { - var cb; - if ((cb = this.submitCB)) { - if (!this.haveCookie() || (detail != null ? detail.error : void 0)) { - QR.error((detail != null ? detail.error : void 0) || 'Failed to retrieve captcha.'); - QR.captcha.setup(d.activeElement === QR.nodes.status); - } - delete this.submitCB; - cb(); - return this.updateCount(); - } - }, - save: function(captcha) { - var cb; - if ((cb = this.submitCB)) { - this.abort(); - cb(captcha); - return; - } - this.captchas.push(captcha); - this.captchas.sort(function(a, b) { - return a.timeout - b.timeout; - }); - return this.count(); - }, - clear: function() { - var captcha, i, j, len, now, ref; - if (this.captchas.length) { - now = Date.now(); - ref = this.captchas; - for (i = j = 0, len = ref.length; j < len; i = ++j) { - captcha = ref[i]; - if (captcha.timeout > now) { - break; - } - } - if (i) { - this.captchas = this.captchas.slice(i); - return this.count(); - } - } - }, - count: function() { - clearTimeout(this.timer); - if (this.captchas.length) { - this.timer = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now()); - } - return this.updateCount(); - }, - updateCount: function() { - return $.event('CaptchaCount', this.captchas.length); - } - }; - -}).call(this); - -(function() { - Captcha.replace = { - init: function() { - var ref; - if (!(g.SITE.software === 'yotsuba' && d.cookie.indexOf('pass_enabled=1') < 0)) { - return; - } - if (Conf['Force Noscript Captcha'] && Main.jsEnabled) { - $.ready(Captcha.replace.noscript); - return; - } - if (Conf['captchaLanguage'].trim()) { - if ((ref = location.hostname) === 'boards.4chan.org' || ref === 'boards.4channel.org') { - return $.onExists(doc, '#captchaFormPart', function(node) { - return $.onExists(node, 'iframe[src^="https://www.google.com/recaptcha/"]', Captcha.replace.iframe); - }); - } else { - return $.onExists(doc, 'iframe[src^="https://www.google.com/recaptcha/"]', Captcha.replace.iframe); - } - } - }, - noscript: function() { - var insert, noscript, original, span, toggle; - if (!((original = $('#g-recaptcha')) && (noscript = $('noscript', original.parentNode)))) { - return; - } - span = $.el('span', { - id: 'captcha-forced-noscript' - }); - $.replace(noscript, span); - $.rm(original); - insert = function() { - span.innerHTML = noscript.textContent; - return Captcha.replace.iframe($('iframe[src^="https://www.google.com/recaptcha/"]', span)); - }; - if ((toggle = $('#togglePostFormLink a, #form-link'))) { - return $.on(toggle, 'click', insert); - } else { - return insert(); - } - }, - iframe: function(iframe) { - var lang, src; - if ((lang = Conf['captchaLanguage'].trim())) { - src = /[?&]hl=/.test(iframe.src) ? iframe.src.replace(/([?&]hl=)[^&]*/, '$1' + encodeURIComponent(lang)) : iframe.src + ("&hl=" + (encodeURIComponent(lang))); - if (iframe.src !== src) { - iframe.src = src; - } - } - } - }; - -}).call(this); - -(function() { - Captcha.t = { - init: function() { - var root; - if (d.cookie.indexOf('pass_enabled=1') >= 0) { - return; - } - if (!(this.isEnabled = !!$('#t-root') || !$.id('postForm'))) { - return; - } - root = $.el('div', { - className: 'captcha-root' - }); - this.nodes = { - root: root - }; - $.addClass(QR.nodes.el, 'has-captcha', 'captcha-t'); - return $.after(QR.nodes.com.parentNode, root); - }, - moreNeeded: function() {}, - getThread: function() { - var boardID, threadID; - boardID = g.BOARD.ID; - if (QR.posts[0].thread === 'new') { - threadID = '0'; - } else { - threadID = '' + QR.posts[0].thread; - } - return { - boardID: boardID, - threadID: threadID - }; - }, - setup: function(focus) { - if (!this.isEnabled) { - return; - } - if (!this.nodes.container) { - this.nodes.container = $.el('div', { - className: 'captcha-container' - }); - $.prepend(this.nodes.root, this.nodes.container); - Captcha.t.currentThread = Captcha.t.getThread(); - $.global(function() { - var el; - el = document.querySelector('#qr .captcha-container'); - window.TCaptcha.init(el, this.boardID, +this.threadID); - return window.TCaptcha.setErrorCb(function(err) { - return window.dispatchEvent(new CustomEvent('CreateNotification', { - detail: { - type: 'warning', - content: '' + err - } - })); - }); - }, Captcha.t.currentThread); - } - if (focus) { - return $('#t-resp').focus(); - } - }, - destroy: function() { - if (!(this.isEnabled && this.nodes.container)) { - return; - } - $.global(function() { - return window.TCaptcha.destroy(); - }); - $.rm(this.nodes.container); - return delete this.nodes.container; - }, - updateThread: function() { - var boardID, newThread, ref, threadID; - if (!this.isEnabled) { - return; - } - ref = Captcha.t.currentThread || {}, boardID = ref.boardID, threadID = ref.threadID; - newThread = Captcha.t.getThread(); - if (!(newThread.boardID === boardID && newThread.threadID === threadID)) { - Captcha.t.destroy(); - return Captcha.t.setup(); - } - }, - getOne: function() { - var el, i, key, len, ref, response; - response = {}; - if (this.nodes.container) { - ref = ['t-response', 't-challenge']; - for (i = 0, len = ref.length; i < len; i++) { - key = ref[i]; - response[key] = $("[name='" + key + "']", this.nodes.container).value; - } - } - if (!response['t-response'] && !((el = $('#t-msg')) && /Verification not required/i.test(el.textContent))) { - response = null; - } - return response; - }, - setUsed: function() { - if (!this.isEnabled) { - return; - } - if (this.nodes.container) { - return $.global(function() { - return window.TCaptcha.clearChallenge(); - }); - } - }, - occupied: function() { - return !!this.nodes.container; - } - }; - -}).call(this); - -(function() { - var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Captcha.v2 = { - lifetime: 2 * $.MINUTE, - init: function() { - var counter, root; - if (d.cookie.indexOf('pass_enabled=1') >= 0) { - return; - } - if (!(this.isEnabled = !!$('#g-recaptcha, #captcha-forced-noscript') || !$.id('postForm'))) { - return; - } - if ((this.noscript = Conf['Force Noscript Captcha'] || !Main.jsEnabled)) { - $.addClass(QR.nodes.el, 'noscript-captcha'); - } - Captcha.cache.init(); - $.on(d, 'CaptchaCount', this.count.bind(this)); - root = $.el('div', { - className: 'captcha-root' - }); - $.extend(root, {innerHTML: "
    "}); - counter = $('.captcha-counter > a', root); - this.nodes = { - root: root, - counter: counter - }; - this.count(); - $.addClass(QR.nodes.el, 'has-captcha', 'captcha-v2'); - $.after(QR.nodes.com.parentNode, root); - $.on(counter, 'click', this.toggle.bind(this)); - $.on(counter, 'keydown', (function(_this) { - return function(e) { - if (Keybinds.keyCode(e) !== 'Space') { - return; - } - _this.toggle(); - e.preventDefault(); - return e.stopPropagation(); - }; - })(this)); - return $.on(window, 'captcha:success', (function(_this) { - return function() { - return $.queueTask(function() { - return _this.save(false); - }); - }; - })(this)); - }, - timeouts: {}, - prevNeeded: 0, - noscriptURL: function() { - var lang, url; - url = 'https://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc'; - if ((lang = Conf['captchaLanguage'].trim())) { - url += "&hl=" + (encodeURIComponent(lang)); - } - return url; - }, - moreNeeded: function() { - return $.queueTask((function(_this) { - return function() { - var needed; - needed = Captcha.cache.needed(); - if (needed && !_this.prevNeeded) { - _this.setup(QR.cooldown.auto && d.activeElement === QR.nodes.status); - } - return _this.prevNeeded = needed; - }; - })(this)); - }, - toggle: function() { - if (this.nodes.container && !this.timeouts.destroy) { - return this.destroy(); - } else { - return this.setup(true, true); - } - }, - setup: function(focus, force) { - if (!(this.isEnabled && (Captcha.cache.needed() || force))) { - return; - } - if (focus) { - $.addClass(QR.nodes.el, 'focus'); - this.nodes.counter.focus(); - } - if (this.timeouts.destroy) { - clearTimeout(this.timeouts.destroy); - delete this.timeouts.destroy; - return this.reload(); - } - if (this.nodes.container) { - $.queueTask((function(_this) { - return function() { - var iframe; - if (_this.nodes.container && d.activeElement === _this.nodes.counter && (iframe = $('iframe[src^="https://www.google.com/recaptcha/"]', _this.nodes.container))) { - iframe.focus(); - return QR.focus(); - } - }; - })(this)); - return; - } - this.nodes.container = $.el('div', { - className: 'captcha-container' - }); - $.prepend(this.nodes.root, this.nodes.container); - new MutationObserver(this.afterSetup.bind(this)).observe(this.nodes.container, { - childList: true, - subtree: true - }); - if (this.noscript) { - return this.setupNoscript(); - } else { - return this.setupJS(); - } - }, - setupNoscript: function() { - var div, iframe, textarea; - iframe = $.el('iframe', { - id: 'qr-captcha-iframe', - scrolling: 'no', - src: this.noscriptURL() - }); - div = $.el('div'); - textarea = $.el('textarea'); - $.add(div, textarea); - return $.add(this.nodes.container, [iframe, div]); - }, - setupJS: function() { - return $.global(function() { - var cbNative, render, script; - render = function() { - var classList, container; - classList = document.documentElement.classList; - container = document.querySelector('#qr .captcha-container'); - return container.dataset.widgetID = window.grecaptcha.render(container, { - sitekey: '6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc', - theme: classList.contains('tomorrow') || classList.contains('spooky') || classList.contains('dark-captcha') ? 'dark' : 'light', - callback: function(response) { - return window.dispatchEvent(new CustomEvent('captcha:success', { - detail: response - })); - } - }); - }; - if (window.grecaptcha) { - return render(); - } else { - cbNative = window.onRecaptchaLoaded; - window.onRecaptchaLoaded = function() { - render(); - return cbNative(); - }; - if (!document.head.querySelector('script[src^="https://www.google.com/recaptcha/api.js"]')) { - script = document.createElement('script'); - script.src = 'https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoaded&render=explicit'; - return document.head.appendChild(script); - } - } - }); - }, - afterSetup: function(mutations) { - var i, iframe, j, len, len1, mutation, node, ref, textarea; - for (i = 0, len = mutations.length; i < len; i++) { - mutation = mutations[i]; - ref = mutation.addedNodes; - for (j = 0, len1 = ref.length; j < len1; j++) { - node = ref[j]; - if ((iframe = $.x('./descendant-or-self::iframe[starts-with(@src, "https://www.google.com/recaptcha/")]', node))) { - this.setupIFrame(iframe); - } - if ((textarea = $.x('./descendant-or-self::textarea', node))) { - this.setupTextArea(textarea); - } - } - } - }, - setupIFrame: function(iframe) { - var ref, ref1; - if (!doc.contains(iframe)) { - return; - } - Captcha.replace.iframe(iframe); - $.addClass(QR.nodes.el, 'captcha-open'); - this.fixQRPosition(); - $.on(iframe, 'load', this.fixQRPosition); - if (d.activeElement === this.nodes.counter) { - iframe.focus(); - } - if (((ref = $.engine) === 'blink' || ref === 'edge') && (ref1 = iframe.parentNode, indexOf.call($$('#qr .captcha-container > div > div:first-of-type'), ref1) >= 0)) { - return $.on(iframe.parentNode, 'scroll', function() { - return this.scrollTop = 0; - }); - } - }, - fixQRPosition: function() { - if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) { - QR.nodes.el.style.top = ''; - return QR.nodes.el.style.bottom = '0px'; - } - }, - setupTextArea: function(textarea) { - return $.one(textarea, 'input', (function(_this) { - return function() { - return _this.save(true); - }; - })(this)); - }, - destroy: function() { - if (!this.isEnabled) { - return; - } - delete this.timeouts.destroy; - $.rmClass(QR.nodes.el, 'captcha-open'); - if (this.nodes.container) { - $.global(function() { - var container; - container = document.querySelector('#qr .captcha-container'); - return window.grecaptcha.reset(container.dataset.widgetID); - }); - $.rm(this.nodes.container); - return delete this.nodes.container; - } - }, - getOne: function(isReply) { - return Captcha.cache.getOne(isReply); - }, - save: function(pasted, token) { - var base, focus, ref; - Captcha.cache.save({ - response: token || $('textarea', this.nodes.container).value, - timeout: Date.now() + this.lifetime - }); - focus = ((ref = d.activeElement) != null ? ref.nodeName : void 0) === 'IFRAME' && /https?:\/\/www\.google\.com\/recaptcha\//.test(d.activeElement.src); - if (Captcha.cache.needed()) { - if (focus) { - if (QR.cooldown.auto || Conf['Post on Captcha Completion']) { - this.nodes.counter.focus(); - } else { - QR.nodes.status.focus(); - } - } - this.reload(); - } else { - if (pasted) { - this.destroy(); - } else { - if ((base = this.timeouts).destroy == null) { - base.destroy = setTimeout(this.destroy.bind(this), 3 * $.SECOND); - } - } - if (focus) { - QR.nodes.status.focus(); - } - } - if (Conf['Post on Captcha Completion'] && !QR.cooldown.auto) { - return QR.submit(); - } - }, - count: function() { - var count, loading; - count = Captcha.cache.getCount(); - loading = Captcha.cache.submitCB ? '...' : ''; - this.nodes.counter.textContent = "Captchas: " + count + loading; - return this.moreNeeded(); - }, - reload: function() { - if ($('iframe[src^="https://www.google.com/recaptcha/api/fallback?"]', this.nodes.container)) { - this.destroy(); - return this.setup(false, true); - } else { - return $.global(function() { - var container; - container = document.querySelector('#qr .captcha-container'); - return window.grecaptcha.reset(container.dataset.widgetID); - }); - } - }, - occupied: function() { - return !!this.nodes.container && !this.timeouts.destroy; - } - }; - -}).call(this); - -PassLink = (function() { - var PassLink; - - PassLink = { - init: function() { - if (!(g.SITE.software === 'yotsuba' && Conf['Pass Link'])) { - return; - } - return Main.ready(this.ready); - }, - ready: function() { - var passLink, styleSelector; - if (!(styleSelector = $.id('styleSelector'))) { - return; - } - passLink = $.el('span', { - className: 'brackets-wrap pass-link-container' - }); - $.extend(passLink, {innerHTML: "4chan Pass"}); - $.on(passLink.firstElementChild, 'click', function() { - return window.open("//sys." + (location.hostname.split('.')[1]) + ".org/auth", Date.now(), 'width=500,height=280,toolbar=0'); - }); - return $.before(styleSelector.previousSibling, [passLink, $.tn('\u00A0\u00A0')]); - } - }; - - return PassLink; - -}).call(this); - -PostRedirect = (function() { - var PostRedirect; - - PostRedirect = { - init: function() { - return $.on(d, 'QRPostSuccessful', (function(_this) { - return function(e) { - if (!e.detail.redirect) { - return; - } - _this.event = e; - _this.delays = 0; - return $.queueTask(function() { - if (e === _this.event && _this.delays === 0) { - return location.href = e.detail.redirect; - } - }); - }; - })(this)); - }, - delays: 0, - delay: function() { - var e; - if (!this.event) { - return null; - } - e = this.event; - this.delays++; - return (function(_this) { - return function() { - if (e !== _this.event) { - return; - } - _this.delays--; - if (_this.delays === 0) { - return location.href = e.detail.redirect; - } - }; - })(this); - } - }; - - return PostRedirect; - -}).call(this); - -PostSuccessful = (function() { - var PostSuccessful; - - PostSuccessful = { - init: function() { - if (!Conf['Remember Your Posts']) { - return; - } - return $.ready(this.ready); - }, - ready: function() { - var _, db, postID, ref, threadID; - if (d.title !== 'Post successful!') { - return; - } - ref = $('h1').nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref[0], threadID = ref[1], postID = ref[2]; - postID = +postID; - threadID = +threadID || postID; - db = new DataBoard('yourPosts'); - return db.set({ - boardID: g.BOARD.ID, - threadID: threadID, - postID: postID, - val: true - }); - } - }; - - return PostSuccessful; - -}).call(this); - -QR = (function() { - var QR, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - slice = [].slice; - - QR = { - mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/vnd.adobe.flash.movie', 'application/x-shockwave-flash', 'video/webm'], - validExtension: /\.(jpe?g|png|gif|pdf|swf|webm)$/i, - typeFromExtension: { - 'jpg': 'image/jpeg', - 'jpeg': 'image/jpeg', - 'png': 'image/png', - 'gif': 'image/gif', - 'pdf': 'application/pdf', - 'swf': 'application/vnd.adobe.flash.movie', - 'webm': 'video/webm' - }, - extensionFromType: { - 'image/jpeg': 'jpg', - 'image/png': 'png', - 'image/gif': 'gif', - 'application/pdf': 'pdf', - 'application/vnd.adobe.flash.movie': 'swf', - 'application/x-shockwave-flash': 'swf', - 'video/webm': 'webm' - }, - init: function() { - var sc; - if (!Conf['Quick Reply']) { - return; - } - this.posts = []; - $.on(d, '4chanXInitFinished', function() { - return BoardConfig.ready(QR.initReady); - }); - Callbacks.Post.push({ - name: 'Quick Reply', - cb: this.node - }); - this.shortcut = sc = $.el('a', { - className: 'fa fa-comment-o disabled', - textContent: 'QR', - title: 'Quick Reply', - href: 'javascript:;' - }); - $.on(sc, 'click', function() { - if (!QR.postingIsEnabled) { - return; - } - if (Conf['Persistent QR'] || !QR.nodes || QR.nodes.el.hidden) { - QR.open(); - return QR.nodes.com.focus(); - } else { - return QR.close(); - } - }); - return Header.addShortcut('qr', sc, 540); - }, - initReady: function() { - var captchaVersion, config, link, linkBot, navLinksBot, origToggle, prop; - captchaVersion = $('#g-recaptcha, #captcha-forced-noscript') ? 'v2' : 't'; - QR.captcha = Captcha[captchaVersion]; - QR.postingIsEnabled = true; - config = g.BOARD.config; - prop = function(key, def) { - var ref; - return +((ref = config[key]) != null ? ref : def); - }; - QR.min_width = prop('min_image_width', 1); - QR.min_height = prop('min_image_height', 1); - QR.max_width = QR.max_height = 10000; - QR.max_size = prop('max_filesize', 4194304); - QR.max_size_video = prop('max_webm_filesize', QR.max_size); - QR.max_comment = prop('max_comment_chars', 2000); - QR.max_width_video = QR.max_height_video = 2048; - QR.max_duration_video = prop('max_webm_duration', 120); - QR.forcedAnon = !!config.forced_anon; - QR.spoiler = !!config.spoilers; - if ((origToggle = $.id('togglePostFormLink'))) { - link = $.el('h1', { - className: "qr-link-container" - }); - $.extend(link, {innerHTML: "" + ((g.VIEW === "thread") ? "Reply to Thread" : "Start a Thread") + ""}); - QR.link = link.firstElementChild; - $.on(link.firstChild, 'click', function() { - QR.open(); - return QR.nodes.com.focus(); - }); - $.before(origToggle, link); - origToggle.firstElementChild.textContent = 'Original Form'; - } - if (g.VIEW === 'thread') { - linkBot = $.el('div', { - className: "brackets-wrap qr-link-container-bottom" - }); - $.extend(linkBot, {innerHTML: "Reply to Thread"}); - $.on(linkBot.firstElementChild, 'click', function() { - QR.open(); - return QR.nodes.com.focus(); - }); - if ((navLinksBot = $('.navLinksBot'))) { - $.prepend(navLinksBot, linkBot); - } - } - $.on(d, 'QRGetFile', QR.getFile); - $.on(d, 'QRDrawFile', QR.drawFile); - $.on(d, 'QRSetFile', QR.setFile); - $.on(d, 'paste', QR.paste); - $.on(d, 'dragover', QR.dragOver); - $.on(d, 'drop', QR.dropFile); - $.on(d, 'dragstart dragend', QR.drag); - $.on(d, 'IndexRefreshInternal', QR.generatePostableThreadsList); - $.on(d, 'ThreadUpdate', QR.statusCheck); - if (!Conf['Persistent QR']) { - return; - } - QR.open(); - if (Conf['Auto Hide QR']) { - return QR.hide(); - } - }, - statusCheck: function() { - var thread; - if (!QR.nodes) { - return; - } - thread = QR.posts[0].thread; - if (thread !== 'new' && g.threads.get(g.BOARD + "." + thread).isDead) { - return QR.abort(); - } else { - return QR.status(); - } - }, - node: function() { - $.on(this.nodes.quote, 'click', QR.quote); - if (this.isFetchedQuote) { - return QR.generatePostableThreadsList(); - } - }, - open: function() { - var err; - if (QR.nodes) { - if (QR.nodes.el.hidden) { - QR.captcha.setup(); - } - QR.nodes.el.hidden = false; - QR.unhide(); - } else { - try { - QR.dialog(); - } catch (error) { - err = error; - delete QR.nodes; - Main.handleErrors({ - message: 'Quick Reply dialog creation crashed.', - error: err - }); - return; - } - } - return $.rmClass(QR.shortcut, 'disabled'); - }, - close: function() { - var j, len, post, ref; - if (QR.req) { - QR.abort(); - return; - } - QR.nodes.el.hidden = true; - QR.cleanNotifications(); - QR.blur(); - $.rmClass(QR.nodes.el, 'dump'); - $.addClass(QR.shortcut, 'disabled'); - new QR.post(true); - ref = QR.posts.splice(0, QR.posts.length - 1); - for (j = 0, len = ref.length; j < len; j++) { - post = ref[j]; - post["delete"](); - } - QR.cooldown.auto = false; - QR.status(); - return QR.captcha.destroy(); - }, - focus: function() { - return $.queueTask(function() { - if (!QR.inBubble()) { - QR.hasFocus = d.activeElement && QR.nodes.el.contains(d.activeElement); - return QR.nodes.el.classList.toggle('focus', QR.hasFocus); - } - }); - }, - inBubble: function() { - var bubbles, ref; - bubbles = $$('iframe[src^="https://www.google.com/recaptcha/api2/frame"]'); - return (ref = d.activeElement, indexOf.call(bubbles, ref) >= 0) || bubbles.some(function(el) { - return getComputedStyle(el).visibility !== 'hidden' && el.getBoundingClientRect().bottom > 0; - }); - }, - hide: function() { - QR.blur(); - $.addClass(QR.nodes.el, 'autohide'); - return QR.nodes.autohide.checked = true; - }, - unhide: function() { - $.rmClass(QR.nodes.el, 'autohide'); - return QR.nodes.autohide.checked = false; - }, - toggleHide: function() { - if (this.checked) { - return QR.hide(); - } else { - return QR.unhide(); - } - }, - blur: function() { - if (QR.nodes.el.contains(d.activeElement)) { - return d.activeElement.blur(); - } - }, - toggleSJIS: function(e) { - e.preventDefault(); - Conf['sjisPreview'] = !Conf['sjisPreview']; - $.set('sjisPreview', Conf['sjisPreview']); - return QR.nodes.el.classList.toggle('sjis-preview', Conf['sjisPreview']); - }, - texPreviewShow: function() { - if ($.hasClass(QR.nodes.el, 'tex-preview')) { - return QR.texPreviewHide(); - } - $.addClass(QR.nodes.el, 'tex-preview'); - QR.nodes.texPreview.textContent = QR.nodes.com.value; - return $.event('mathjax', null, QR.nodes.texPreview); - }, - texPreviewHide: function() { - return $.rmClass(QR.nodes.el, 'tex-preview'); - }, - addPost: function() { - var wasOpen; - wasOpen = QR.nodes && !QR.nodes.el.hidden; - QR.open(); - if (wasOpen) { - $.addClass(QR.nodes.el, 'dump'); - new QR.post(true); - } - return QR.nodes.com.focus(); - }, - setCustomCooldown: function(enabled) { - Conf['customCooldownEnabled'] = enabled; - QR.cooldown.customCooldown = enabled; - return QR.nodes.customCooldown.classList.toggle('disabled', !enabled); - }, - toggleCustomCooldown: function() { - var enabled; - enabled = $.hasClass(QR.nodes.customCooldown, 'disabled'); - QR.setCustomCooldown(enabled); - return $.set('customCooldownEnabled', enabled); - }, - error: function(err, focusOverride) { - var el, notice, notif; - QR.open(); - if (typeof err === 'string') { - el = $.tn(err); - } else { - el = err; - el.removeAttribute('style'); - } - notice = new Notice('warning', el); - QR.notifications.push(notice); - if (!Header.areNotificationsEnabled) { - if (d.hidden && !QR.cooldown.auto) { - return alert(el.textContent); - } - } else if (d.hidden || !(focusOverride || d.hasFocus())) { - notif = new Notification(el.textContent, { - body: el.textContent, - icon: Favicon.logo - }); - notif.onclick = function() { - return window.focus(); - }; - if ($.engine !== 'gecko') { - notif.onclose = function() { - return notice.close(); - }; - return notif.onshow = function() { - return setTimeout(function() { - notif.onclose = null; - return notif.close(); - }, 7 * $.SECOND); - }; - } - } - }, - connectionError: function() { - return $.el('span', {innerHTML: "Connection error while posting. [More info]"}); - }, - notifications: [], - cleanNotifications: function() { - var j, len, notification, ref; - ref = QR.notifications; - for (j = 0, len = ref.length; j < len; j++) { - notification = ref[j]; - notification.close(); - } - return QR.notifications = []; - }, - status: function() { - var disabled, status, thread, value; - if (!QR.nodes) { - return; - } - thread = QR.posts[0].thread; - if (thread !== 'new' && g.threads.get(g.BOARD + "." + thread).isDead) { - value = 'Dead'; - disabled = true; - QR.cooldown.auto = false; - } - value = QR.req ? QR.req.progress : QR.cooldown.seconds || value; - status = QR.nodes.status; - status.value = !value ? 'Submit' : QR.cooldown.auto ? "Auto " + value : value; - return status.disabled = disabled || false; - }, - openPost: function() { - var index; - QR.open(); - if (QR.selected.isLocked) { - index = QR.posts.indexOf(QR.selected); - (QR.posts[index + 1] || new QR.post()).select(); - $.addClass(QR.nodes.el, 'dump'); - return QR.cooldown.auto = true; - } - }, - quote: function(e) { - var ancestor, base, caretPos, com, frag, i, insideCode, j, k, l, len, len1, len2, len3, n, node, o, post, postRange, range, ref, ref1, ref2, ref3, ref4, ref5, ref6, root, sel, text, thread, wasOnlyQuotes; - if (e != null) { - e.preventDefault(); - } - if (!QR.postingIsEnabled) { - return; - } - sel = d.getSelection(); - post = Get.postFromNode(this); - root = post.nodes.root; - postRange = new Range(); - postRange.selectNode(root); - text = post.board.ID === g.BOARD.ID ? ">>" + post + "\n" : ">>>/" + post.board + "/" + post + "\n"; - for (i = j = 0, ref = sel.rangeCount; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) { - try { - range = sel.getRangeAt(i); - if (range.compareBoundaryPoints(Range.START_TO_START, postRange) < 0) { - range.setStartBefore(root); - } - if (range.compareBoundaryPoints(Range.END_TO_END, postRange) > 0) { - range.setEndAfter(root); - } - if (!range.toString().trim()) { - continue; - } - frag = range.cloneContents(); - ancestor = range.commonAncestorContainer; - if ($.x('ancestor-or-self::*[self::s or contains(@class,"removed-spoiler")]', ancestor)) { - $.prepend(frag, $.tn('[spoiler]')); - $.add(frag, $.tn('[/spoiler]')); - } - if (insideCode = $.x('ancestor-or-self::pre[contains(@class,"prettyprint")]', ancestor)) { - $.prepend(frag, $.tn('[code]')); - $.add(frag, $.tn('[/code]')); - } - ref1 = $$((insideCode ? 'br' : '.prettyprint br'), frag); - for (k = 0, len = ref1.length; k < len; k++) { - node = ref1[k]; - $.replace(node, $.tn('\n')); - } - ref2 = $$('br', frag); - for (l = 0, len1 = ref2.length; l < len1; l++) { - node = ref2[l]; - if (node !== frag.lastChild) { - $.replace(node, $.tn('\n>')); - } - } - if (typeof (base = g.SITE).insertTags === "function") { - base.insertTags(frag); - } - ref3 = $$('.linkify[data-original]', frag); - for (n = 0, len2 = ref3.length; n < len2; n++) { - node = ref3[n]; - $.replace(node, $.tn(node.dataset.original)); - } - ref4 = $$('.embedder', frag); - for (o = 0, len3 = ref4.length; o < len3; o++) { - node = ref4[o]; - if (((ref5 = node.previousSibling) != null ? ref5.nodeValue : void 0) === ' ') { - $.rm(node.previousSibling); - } - $.rm(node); - } - text += ">" + (frag.textContent.trim()) + "\n"; - } catch (error) {} - } - QR.openPost(); - ref6 = QR.nodes, com = ref6.com, thread = ref6.thread; - if (!com.value) { - thread.value = Get.threadFromNode(this); - } - wasOnlyQuotes = QR.selected.isOnlyQuotes(); - caretPos = com.selectionStart; - com.value = com.value.slice(0, caretPos) + text + com.value.slice(com.selectionEnd); - range = caretPos + text.length; - com.setSelectionRange(range, range); - com.focus(); - if (wasOnlyQuotes) { - QR.selected.quotedText = com.value; - } - QR.selected.save(com); - return QR.selected.save(thread); - }, - characterCount: function() { - var count, counter; - counter = QR.nodes.charCount; - count = QR.nodes.com.value.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, '_').length; - counter.textContent = count; - counter.hidden = count < QR.max_comment / 2; - return (count > QR.max_comment ? $.addClass : $.rmClass)(counter, 'warning'); - }, - getFile: function() { - var ref; - return $.event('QRFile', (ref = QR.selected) != null ? ref.file : void 0); - }, - drawFile: function(e) { - var el, file, isVideo, ref; - file = (ref = QR.selected) != null ? ref.file : void 0; - if (!(file && /^(image|video)\//.test(file.type))) { - return; - } - isVideo = /^video\//.test(file); - el = $.el((isVideo ? 'video' : 'img')); - $.on(el, 'error', function() { - return QR.openError(); - }); - $.on(el, (isVideo ? 'loadeddata' : 'load'), function() { - e.target.getContext('2d').drawImage(el, 0, 0); - URL.revokeObjectURL(el.src); - return $.event('QRImageDrawn', null, e.target); - }); - return el.src = URL.createObjectURL(file); - }, - openError: function() { - var div; - div = $.el('div'); - $.extend(div, {innerHTML: "Could not open file. [More info]"}); - return QR.error(div); - }, - setFile: function(e) { - var file, name, ref, source; - ref = e.detail, file = ref.file, name = ref.name, source = ref.source; - if (name != null) { - file.name = name; - } - if (source != null) { - file.source = source; - } - QR.open(); - return QR.handleFiles([file]); - }, - drag: function(e) { - var toggle; - toggle = e.type === 'dragstart' ? $.off : $.on; - toggle(d, 'dragover', QR.dragOver); - return toggle(d, 'drop', QR.dropFile); - }, - dragOver: function(e) { - e.preventDefault(); - return e.dataTransfer.dropEffect = 'copy'; - }, - dropFile: function(e) { - if (!e.dataTransfer.files.length) { - return; - } - e.preventDefault(); - QR.open(); - return QR.handleFiles(e.dataTransfer.files); - }, - paste: function(e) { - var blob, file, file2, item, j, len, ref, score, score2, type; - if (!e.clipboardData.items) { - return; - } - file = null; - score = -1; - ref = e.clipboardData.items; - for (j = 0, len = ref.length; j < len; j++) { - item = ref[j]; - if (!(item.kind === 'file' && (file2 = item.getAsFile()))) { - continue; - } - score2 = 2 * (file2.size <= QR.max_size) + (file2.type === 'image/png'); - if (score2 > score) { - file = file2; - score = score2; - } - } - if (file) { - type = file.type; - blob = new Blob([file], { - type: type - }); - blob.name = Conf['pastedname'] + "." + ($.getOwn(QR.extensionFromType, type) || 'jpg'); - QR.open(); - QR.handleFiles([blob]); - $.addClass(QR.nodes.el, 'dump'); - } - }, - pasteFF: function() { - var arr, blob, bstr, i, images, img, j, k, len, m, pasteArea, ref, src; - pasteArea = QR.nodes.pasteArea; - if (!pasteArea.childNodes.length) { - return; - } - images = $$('img', pasteArea); - $.rmAll(pasteArea); - for (j = 0, len = images.length; j < len; j++) { - img = images[j]; - src = img.src; - if (m = src.match(/data:(image\/(\w+));base64,(.+)/)) { - bstr = atob(m[3]); - arr = new Uint8Array(bstr.length); - for (i = k = 0, ref = bstr.length; 0 <= ref ? k < ref : k > ref; i = 0 <= ref ? ++k : --k) { - arr[i] = bstr.charCodeAt(i); - } - blob = new Blob([arr], { - type: m[1] - }); - blob.name = Conf['pastedname'] + "." + m[2]; - QR.handleFiles([blob]); - } else if (/^https?:\/\//.test(src)) { - QR.handleUrl(src); - } - } - }, - handleUrl: function(urlDefault) { - QR.open(); - QR.selected.preventAutoPost(); - return CrossOrigin.permission(function() { - var url; - url = prompt('Enter a URL:', urlDefault); - if (url === null) { - return; - } - QR.nodes.fileButton.focus(); - return CrossOrigin.file(url, function(blob) { - if (blob && !/^text\//.test(blob.type)) { - return QR.handleFiles([blob]); - } else { - return QR.error("Can't load file."); - } - }); - }); - }, - handleFiles: function(files) { - var file, j, len; - if (this !== QR) { - files = slice.call(this.files); - this.value = null; - } - if (!files.length) { - return; - } - QR.cleanNotifications(); - for (j = 0, len = files.length; j < len; j++) { - file = files[j]; - QR.handleFile(file, files.length); - } - if (files.length !== 1) { - $.addClass(QR.nodes.el, 'dump'); - } - if (d.activeElement === QR.nodes.fileButton && $.hasClass(QR.nodes.fileSubmit, 'has-file')) { - return QR.nodes.filename.focus(); - } - }, - handleFile: function(file, nfiles) { - var isText, post; - isText = /^text\//.test(file.type); - if (nfiles === 1) { - post = QR.selected; - } else { - post = QR.posts[QR.posts.length - 1]; - if ((isText ? post.com || post.pasting : post.file)) { - post = new QR.post(); - } - } - return post[isText ? 'pasteText' : 'setFile'](file); - }, - openFileInput: function() { - if (QR.nodes.fileButton.disabled) { - return; - } - QR.nodes.fileInput.click(); - return QR.nodes.fileButton.focus(); - }, - generatePostableThreadsList: function() { - var j, len, list, options, ref, thread, val; - if (!QR.nodes) { - return; - } - list = QR.nodes.thread; - options = [list.firstElementChild]; - ref = g.BOARD.threads.keys; - for (j = 0, len = ref.length; j < len; j++) { - thread = ref[j]; - options.push($.el('option', { - value: thread, - textContent: "Thread " + thread - })); - } - val = list.value; - $.rmAll(list); - $.add(list, options); - list.value = val; - if (list.value === val) { - return; - } - list.value = g.VIEW === 'thread' ? g.THREADID : 'new'; - return (g.VIEW === 'thread' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread'); - }, - dialog: function() { - var classList, config, dialog, event, i, items, name, node, nodes, save, setNode; - QR.nodes = nodes = { - el: dialog = UI.dialog('qr', {innerHTML: "
    ×
    No selected file
    "}) - }; - setNode = function(name, query) { - return nodes[name] = $(query, dialog); - }; - setNode('move', '.move'); - setNode('autohide', '#autohide'); - setNode('close', '.close'); - setNode('thread', 'select'); - setNode('form', 'form'); - setNode('sjisToggle', '#sjis-toggle'); - setNode('texButton', '#tex-preview-button'); - setNode('name', '[data-name=name]'); - setNode('email', '[data-name=email]'); - setNode('sub', '[data-name=sub]'); - setNode('com', '[data-name=com]'); - setNode('charCount', '#char-count'); - setNode('texPreview', '#tex-preview'); - setNode('dumpList', '#dump-list'); - setNode('addPost', '#add-post'); - setNode('oekaki', '.oekaki'); - setNode('drawButton', '#qr-draw-button'); - setNode('fileSubmit', '#file-n-submit'); - setNode('fileButton', '#qr-file-button'); - setNode('noFile', '#qr-no-file'); - setNode('filename', '#qr-filename'); - setNode('spoiler', '#qr-file-spoiler'); - setNode('oekakiButton', '#qr-oekaki-button'); - setNode('fileRM', '#qr-filerm'); - setNode('urlButton', '#url-button'); - setNode('pasteArea', '#paste-area'); - setNode('customCooldown', '#custom-cooldown-button'); - setNode('dumpButton', '#dump-button'); - setNode('status', '[type=submit]'); - setNode('flashTag', '[name=filetag]'); - setNode('fileInput', '[type=file]'); - config = g.BOARD.config; - classList = QR.nodes.el.classList; - classList.toggle('forced-anon', QR.forcedAnon); - classList.toggle('has-spoiler', QR.spoiler); - classList.toggle('has-sjis', !!config.sjis_tags); - classList.toggle('has-math', !!config.math_tags); - classList.toggle('sjis-preview', !!config.sjis_tags && Conf['sjisPreview']); - classList.toggle('show-new-thread-option', Conf['Show New Thread Option in Threads']); - if (parseInt(Conf['customCooldown'], 10) > 0) { - $.addClass(QR.nodes.fileSubmit, 'custom-cooldown'); - $.get('customCooldownEnabled', Conf['customCooldownEnabled'], function(arg) { - var customCooldownEnabled; - customCooldownEnabled = arg.customCooldownEnabled; - QR.setCustomCooldown(customCooldownEnabled); - return $.sync('customCooldownEnabled', QR.setCustomCooldown); - }); - } - QR.flagsInput(); - $.on(nodes.autohide, 'change', QR.toggleHide); - $.on(nodes.close, 'click', QR.close); - $.on(nodes.status, 'click', QR.submit); - $.on(nodes.form, 'submit', QR.submit); - $.on(nodes.sjisToggle, 'click', QR.toggleSJIS); - $.on(nodes.texButton, 'mousedown', QR.texPreviewShow); - $.on(nodes.texButton, 'mouseup', QR.texPreviewHide); - $.on(nodes.addPost, 'click', function() { - return new QR.post(true); - }); - $.on(nodes.drawButton, 'click', QR.oekaki.draw); - $.on(nodes.fileButton, 'click', QR.openFileInput); - $.on(nodes.noFile, 'click', QR.openFileInput); - $.on(nodes.filename, 'focus', function() { - return $.addClass(this.parentNode, 'focus'); - }); - $.on(nodes.filename, 'blur', function() { - return $.rmClass(this.parentNode, 'focus'); - }); - $.on(nodes.spoiler, 'change', function() { - return QR.selected.nodes.spoiler.click(); - }); - $.on(nodes.oekakiButton, 'click', QR.oekaki.button); - $.on(nodes.fileRM, 'click', function() { - return QR.selected.rmFile(); - }); - $.on(nodes.urlButton, 'click', function() { - return QR.handleUrl(''); - }); - $.on(nodes.customCooldown, 'click', QR.toggleCustomCooldown); - $.on(nodes.dumpButton, 'click', function() { - return nodes.el.classList.toggle('dump'); - }); - $.on(nodes.fileInput, 'change', QR.handleFiles); - window.addEventListener('focus', QR.focus, true); - window.addEventListener('blur', QR.focus, true); - $.on(d, 'click', QR.focus); - if ($.engine === 'gecko' && !window.DataTransferItemList) { - nodes.pasteArea.hidden = false; - } - new MutationObserver(QR.pasteFF).observe(nodes.pasteArea, { - childList: true - }); - items = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'flag']; - i = 0; - save = function() { - return QR.selected.save(this); - }; - while (name = items[i++]) { - if (!(node = nodes[name])) { - continue; - } - event = node.nodeName === 'SELECT' ? 'change' : 'input'; - $.on(nodes[name], event, save); - } - if ($.engine === 'gecko' && Conf['Remember QR Size']) { - $.get('QR Size', '', function(item) { - return nodes.com.style.cssText = item['QR Size']; - }); - $.on(nodes.com, 'mouseup', function(e) { - if (e.button !== 0) { - return; - } - return $.set('QR Size', this.style.cssText); - }); - } - QR.generatePostableThreadsList(); - QR.persona.load(); - new QR.post(true); - QR.status(); - QR.cooldown.setup(); - QR.captcha.init(); - $.add(d.body, dialog); - QR.captcha.setup(); - QR.oekaki.setup(); - return $.event('QRDialogCreation', null, dialog); - }, - flags: function() { - var addFlag, ref, select, textContent, value; - select = $.el('select', { - name: 'flag', - className: 'flagSelector' - }); - addFlag = function(value, textContent) { - return $.add(select, $.el('option', { - value: value, - textContent: textContent - })); - }; - addFlag('0', (g.BOARD.config.country_flags ? 'Geographic Location' : 'None')); - ref = g.BOARD.config.board_flags; - for (value in ref) { - textContent = ref[value]; - addFlag(value, textContent); - } - return select; - }, - flagsInput: function() { - var flag, nodes; - nodes = QR.nodes; - if (!nodes) { - return; - } - if (nodes.flag) { - $.rm(nodes.flag); - delete nodes.flag; - } - if (g.BOARD.config.board_flags) { - flag = QR.flags(); - flag.dataset.name = 'flag'; - flag.dataset["default"] = '0'; - nodes.flag = flag; - return $.add(nodes.form, flag); - } - }, - submit: function(e) { - var captcha, cb, err, filetag, force, formData, options, post, ref, thread, threadID; - if (e != null) { - e.preventDefault(); - } - force = e != null ? e.shiftKey : void 0; - if (QR.req) { - QR.abort(); - return; - } - $.forceSync('cooldowns'); - if (QR.cooldown.seconds) { - if (force) { - QR.cooldown.clear(); - } else { - QR.cooldown.auto = !QR.cooldown.auto; - QR.status(); - return; - } - } - post = QR.posts[0]; - delete post.quotedText; - post.forceSave(); - threadID = post.thread; - thread = g.BOARD.threads.get(threadID); - if (g.BOARD.ID === 'f' && threadID === 'new') { - filetag = QR.nodes.flashTag.value; - } - if (threadID === 'new') { - threadID = null; - if (!!g.BOARD.config.require_subject && !post.sub) { - err = 'New threads require a subject.'; - } else if (!(!!g.BOARD.config.text_only || post.file)) { - err = 'No file selected.'; - } - } else if (g.BOARD.threads.get(threadID).isClosed) { - err = 'You can\'t reply to this thread anymore.'; - } else if (!(post.com || post.file)) { - err = 'No comment or file.'; - } else if (post.file && thread.fileLimit) { - err = 'Max limit of image replies has been reached.'; - } - if (g.BOARD.ID === 'r9k' && !((ref = post.com) != null ? ref.match(/[a-z-]/i) : void 0)) { - err || (err = 'Original comment required.'); - } - if (QR.captcha.isEnabled && !(QR.captcha === Captcha.v2 && /\b_ct=/.test(d.cookie) && threadID) && !(err && !force)) { - captcha = QR.captcha.getOne(!!threadID); - if (QR.captcha === Captcha.v2) { - captcha || (captcha = Captcha.cache.request(!!threadID)); - } - if (!captcha) { - err = 'No valid captcha.'; - QR.captcha.setup(!QR.cooldown.auto || d.activeElement === QR.nodes.status); - } - } - QR.cleanNotifications(); - if (err && !force) { - QR.cooldown.auto = false; - QR.status(); - QR.error(err); - return; - } - QR.cooldown.auto = QR.posts.length > 1; - post.lock(); - formData = { - MAX_FILE_SIZE: QR.max_size, - mode: 'regist', - pwd: QR.persona.getPassword(), - resto: threadID, - name: !QR.forcedAnon ? post.name : void 0, - email: post.email, - sub: !(QR.forcedAnon || threadID) ? post.sub : void 0, - com: post.com, - upfile: post.file, - filetag: filetag, - spoiler: post.spoiler, - flag: post.flag - }; - options = { - responseType: 'document', - withCredentials: true, - onloadend: QR.response, - form: $.formData(formData) - }; - if (Conf['Show Upload Progress']) { - options.onprogress = function(e) { - var ref1; - if (this !== ((ref1 = QR.req) != null ? ref1.upload : void 0)) { - return; - } - if (e.loaded < e.total) { - QR.req.progress = (Math.round(e.loaded / e.total * 100)) + "%"; - } else { - QR.req.isUploadFinished = true; - QR.req.progress = '...'; - } - return QR.status(); - }; - } - cb = function(response) { - var key, val; - if (response != null) { - QR.currentCaptcha = response; - if (QR.captcha === Captcha.v2) { - if (response.challenge != null) { - options.form.append('recaptcha_challenge_field', response.challenge); - options.form.append('recaptcha_response_field', response.response); - } else { - options.form.append('g-recaptcha-response', response.response); - } - } else { - for (key in response) { - val = response[key]; - options.form.append(key, val); - } - } - } - QR.req = $.ajax("https://sys." + (location.hostname.split('.')[1]) + ".org/" + g.BOARD + "/post", options); - return QR.req.progress = '...'; - }; - if (typeof captcha === 'function') { - QR.req = { - progress: '...', - abort: function() { - if (QR.captcha === Captcha.v2) { - Captcha.cache.abort(); - } - return cb = null; - } - }; - captcha(function(response) { - if (QR.captcha === Captcha.v2 && Captcha.cache.haveCookie()) { - if (typeof cb === "function") { - cb(); - } - if (response) { - return Captcha.cache.save(response); - } - } else if (response) { - return typeof cb === "function" ? cb(response) : void 0; - } else { - delete QR.req; - post.unlock(); - QR.cooldown.auto = !!Captcha.cache.getCount(); - return QR.status(); - } - }); - } else { - cb(captcha); - } - return QR.status(); - }, - response: function() { - var URL, _, base, connErr, err, h1, isReply, j, lastPostToThread, len, m, mi, open, post, postID, postsCount, ref, ref1, ref2, ref3, seconds, threadID; - if (this !== QR.req) { - return; - } - delete QR.req; - post = QR.posts[0]; - post.unlock(); - if ((err = (ref = this.response) != null ? ref.getElementById('errmsg') : void 0)) { - if ((ref1 = $('a', err)) != null) { - ref1.target = '_blank'; - } - } else if ((connErr = !this.response || this.response.title !== 'Post successful!')) { - err = QR.connectionError(); - if (QR.captcha === Captcha.v2 && QR.currentCaptcha) { - Captcha.cache.save(QR.currentCaptcha); - } - } else if (this.status !== 200) { - err = "Error " + this.statusText + " (" + this.status + ")"; - } - if (!connErr) { - if (typeof (base = QR.captcha).setUsed === "function") { - base.setUsed(); - } - } - delete QR.currentCaptcha; - if (err) { - QR.errorCount = (QR.errorCount || 0) + 1; - if (/captcha|verification/i.test(err.textContent) || connErr) { - if (/mistyped/i.test(err.textContent)) { - err = 'You mistyped the CAPTCHA, or the CAPTCHA malfunctioned.'; - } else if (/expired/i.test(err.textContent)) { - err = 'This CAPTCHA is no longer valid because it has expired.'; - } - if (QR.errorCount >= 5) { - QR.cooldown.auto = false; - } else { - QR.cooldown.auto = QR.captcha.isEnabled || connErr; - QR.cooldown.addDelay(post, 2); - } - } else if (err.textContent && (m = err.textContent.match(/\d+\s+(?:minute|second)/gi)) && !/duplicate|hour/i.test(err.textContent)) { - QR.cooldown.auto = !/have\s+been\s+muted/i.test(err.textContent); - seconds = 0; - for (j = 0, len = m.length; j < len; j++) { - mi = m[j]; - seconds += (/minute/i.test(mi) ? 60 : 1) * (+mi.match(/\d+/)[0]); - } - if (/muted/i.test(err.textContent)) { - QR.cooldown.addMute(seconds); - } else { - QR.cooldown.addDelay(post, seconds); - } - } else { - QR.cooldown.auto = false; - } - QR.captcha.setup(QR.cooldown.auto && ((ref2 = d.activeElement) === QR.nodes.status || ref2 === d.body)); - QR.status(); - QR.error(err); - return; - } - delete QR.errorCount; - h1 = $('h1', this.response); - ref3 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref3[0], threadID = ref3[1], postID = ref3[2]; - postID = +postID; - threadID = +threadID || postID; - isReply = threadID !== postID; - $.event('QRPostSuccessful', { - boardID: g.BOARD.ID, - threadID: threadID, - postID: postID - }); - $.event('QRPostSuccessful_', { - boardID: g.BOARD.ID, - threadID: threadID, - postID: postID - }); - postsCount = QR.posts.length - 1; - QR.cooldown.auto = postsCount && isReply; - lastPostToThread = !((function() { - var k, len1, p, ref4; - ref4 = QR.posts.slice(1); - for (k = 0, len1 = ref4.length; k < len1; k++) { - p = ref4[k]; - if (p.thread === post.thread) { - return true; - } - } - })()); - if (postsCount) { - post.rm(); - QR.captcha.setup(d.activeElement === QR.nodes.status); - } else if (Conf['Persistent QR']) { - post.rm(); - if (Conf['Auto Hide QR']) { - QR.hide(); - } else { - QR.blur(); - } - } else { - QR.close(); - } - QR.cleanNotifications(); - if (Conf['Posting Success Notifications']) { - QR.notifications.push(new Notice('success', h1.textContent, 5)); - } - QR.cooldown.add(threadID, postID); - URL = threadID === postID ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID : threadID !== g.THREADID && lastPostToThread && Conf['Open Post in New Tab'] ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID + "#p" + postID : void 0; - if (URL) { - open = Conf['Open Post in New Tab'] || postsCount ? function() { - return $.open(URL); - } : function() { - return location.href = URL; - }; - if (threadID === postID) { - QR.waitForThread(URL, open); - } else { - open(); - } - } - return QR.status(); - }, - waitForThread: function(url, cb) { - var attempts, check; - attempts = 0; - check = function() { - return $.ajax(url, { - onloadend: function() { - attempts++; - if (attempts >= 6 || this.status === 200) { - return cb(); - } else { - return setTimeout(check, attempts * $.SECOND); - } - }, - responseType: 'text', - type: 'HEAD' - }); - }; - return check(); - }, - abort: function() { - var oldReq; - if ((oldReq = QR.req) && !QR.req.isUploadFinished) { - delete QR.req; - oldReq.abort(); - if (QR.captcha === Captcha.v2 && QR.currentCaptcha) { - Captcha.cache.save(QR.currentCaptcha); - } - delete QR.currentCaptcha; - QR.posts[0].unlock(); - QR.cooldown.auto = false; - QR.notifications.push(new Notice('info', 'QR upload aborted.', 5)); - } - return QR.status(); - } - }; - - return QR; - -}).call(this); - -(function() { - QR.cooldown = { - seconds: 0, - delays: { - deletion: 60 - }, - init: function() { - if (!Conf['Quick Reply']) { - return; - } - this.data = Conf['cooldowns']; - this.changes = $.dict(); - return $.sync('cooldowns', this.sync); - }, - setup: function() { - var delay, ref, type; - $.extend(QR.cooldown.delays, g.BOARD.cooldowns()); - QR.cooldown.maxDelay = 0; - ref = QR.cooldown.delays; - for (type in ref) { - delay = ref[type]; - if (type !== 'thread' && type !== 'thread_global') { - QR.cooldown.maxDelay = Math.max(QR.cooldown.maxDelay, delay); - } - } - QR.cooldown.isSetup = true; - return QR.cooldown.start(); - }, - start: function() { - var data; - data = QR.cooldown.data; - if (!(Conf['Cooldown'] && QR.cooldown.isSetup && !QR.cooldown.isCounting && Object.keys(data[g.BOARD.ID] || {}).length + Object.keys(data.global || {}).length > 0)) { - return; - } - QR.cooldown.isCounting = true; - return QR.cooldown.count(); - }, - sync: function(data) { - QR.cooldown.data = data || $.dict(); - return QR.cooldown.start(); - }, - add: function(threadID, postID) { - var boardID, start; - if (!Conf['Cooldown']) { - return; - } - start = Date.now(); - boardID = g.BOARD.ID; - QR.cooldown.set(boardID, start, { - threadID: threadID, - postID: postID - }); - if (threadID === postID) { - QR.cooldown.set('global', start, { - boardID: boardID, - threadID: threadID, - postID: postID - }); - } - QR.cooldown.save(); - return QR.cooldown.start(); - }, - addDelay: function(post, delay) { - var cooldown; - if (!Conf['Cooldown']) { - return; - } - cooldown = QR.cooldown.categorize(post); - cooldown.delay = delay; - QR.cooldown.set(g.BOARD.ID, Date.now(), cooldown); - QR.cooldown.save(); - return QR.cooldown.start(); - }, - addMute: function(delay) { - if (!Conf['Cooldown']) { - return; - } - QR.cooldown.set(g.BOARD.ID, Date.now(), { - type: 'mute', - delay: delay - }); - QR.cooldown.save(); - return QR.cooldown.start(); - }, - "delete": function(post) { - var base, cooldown, cooldowns, id, name; - if (!QR.cooldown.data) { - return; - } - cooldowns = ((base = QR.cooldown.data)[name = post.board.ID] || (base[name] = $.dict())); - for (id in cooldowns) { - cooldown = cooldowns[id]; - if ((cooldown.delay == null) && cooldown.threadID === post.thread.ID && cooldown.postID === post.ID) { - QR.cooldown.set(post.board.ID, id, null); - } - } - return QR.cooldown.save(); - }, - secondsDeletion: function(post) { - var cooldown, cooldowns, seconds, start; - if (!(QR.cooldown.data && Conf['Cooldown'])) { - return 0; - } - cooldowns = QR.cooldown.data[post.board.ID] || $.dict(); - for (start in cooldowns) { - cooldown = cooldowns[start]; - if ((cooldown.delay == null) && cooldown.threadID === post.thread.ID && cooldown.postID === post.ID) { - seconds = QR.cooldown.delays.deletion - Math.floor((Date.now() - start) / $.SECOND); - return Math.max(seconds, 0); - } - } - return 0; - }, - categorize: function(post) { - if (post.thread === 'new') { - return { - type: 'thread' - }; - } else { - return { - type: !!post.file ? 'image' : 'reply', - threadID: +post.thread - }; - } - }, - mergeChange: function(data, scope, id, value) { - if (value) { - return (data[scope] || (data[scope] = $.dict()))[id] = value; - } else if (scope in data) { - delete data[scope][id]; - if (Object.keys(data[scope]).length === 0) { - return delete data[scope]; - } - } - }, - set: function(scope, id, value) { - var base; - QR.cooldown.mergeChange(QR.cooldown.data, scope, id, value); - return ((base = QR.cooldown.changes)[scope] || (base[scope] = $.dict()))[id] = value; - }, - save: function() { - var changes; - changes = QR.cooldown.changes; - if (!Object.keys(changes).length) { - return; - } - return $.get('cooldowns', $.dict(), function(arg) { - var cooldowns, id, ref, scope, value; - cooldowns = arg.cooldowns; - for (scope in QR.cooldown.changes) { - ref = QR.cooldown.changes[scope]; - for (id in ref) { - value = ref[id]; - QR.cooldown.mergeChange(cooldowns, scope, id, value); - } - QR.cooldown.data = cooldowns; - } - return $.set('cooldowns', cooldowns, function() { - return QR.cooldown.changes = $.dict(); - }); - }); - }, - clear: function() { - QR.cooldown.data = $.dict(); - QR.cooldown.changes = $.dict(); - QR.cooldown.auto = false; - QR.cooldown.update(); - return $.queueTask($["delete"], 'cooldowns'); - }, - update: function() { - var base, cooldown, cooldowns, elapsed, i, len, maxDelay, nCooldowns, now, ref, ref1, save, scope, seconds, start, suffix, threadID, type, update; - if (!QR.cooldown.isCounting) { - return; - } - save = false; - nCooldowns = 0; - now = Date.now(); - ref = QR.cooldown.categorize(QR.posts[0]), type = ref.type, threadID = ref.threadID; - seconds = 0; - if (Conf['Cooldown']) { - ref1 = [g.BOARD.ID, 'global']; - for (i = 0, len = ref1.length; i < len; i++) { - scope = ref1[i]; - cooldowns = ((base = QR.cooldown.data)[scope] || (base[scope] = $.dict())); - for (start in cooldowns) { - cooldown = cooldowns[start]; - start = +start; - elapsed = Math.floor((now - start) / $.SECOND); - if (elapsed < 0) { - QR.cooldown.set(scope, start, null); - save = true; - continue; - } - if (cooldown.delay != null) { - if (cooldown.delay <= elapsed) { - QR.cooldown.set(scope, start, null); - save = true; - } else if ((cooldown.type === type && cooldown.threadID === threadID) || cooldown.type === 'mute') { - seconds = Math.max(seconds, cooldown.delay - elapsed); - } - continue; - } - maxDelay = cooldown.threadID !== cooldown.postID ? QR.cooldown.maxDelay : QR.cooldown.delays[scope === 'global' ? 'thread_global' : 'thread']; - if (QR.cooldown.customCooldown) { - maxDelay = Math.max(maxDelay, parseInt(Conf['customCooldown'], 10)); - } - if (maxDelay <= elapsed) { - QR.cooldown.set(scope, start, null); - save = true; - continue; - } - if ((type === 'thread') === (cooldown.threadID === cooldown.postID) && cooldown.boardID !== g.BOARD.ID) { - suffix = scope === 'global' ? '_global' : ''; - seconds = Math.max(seconds, QR.cooldown.delays[type + suffix] - elapsed); - if (QR.cooldown.customCooldown) { - seconds = Math.max(seconds, parseInt(Conf['customCooldown'], 10) - elapsed); - } - } - } - nCooldowns += Object.keys(cooldowns).length; - } - } - if (save) { - QR.cooldown.save; - } - if (nCooldowns) { - clearTimeout(QR.cooldown.timeout); - QR.cooldown.timeout = setTimeout(QR.cooldown.count, $.SECOND); - } else { - delete QR.cooldown.isCounting; - } - update = seconds !== QR.cooldown.seconds; - QR.cooldown.seconds = seconds; - if (update) { - return QR.status(); - } - }, - count: function() { - QR.cooldown.update(); - if (QR.cooldown.seconds === 0 && QR.cooldown.auto && !QR.req) { - return QR.submit(); - } - } - }; - -}).call(this); - -(function() { - QR.oekaki = { - menu: { - init: function() { - var a, ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Edit Link'] && Conf['Quick Reply'])) { - return; - } - a = $.el('a', { - className: 'edit-link', - href: 'javascript:;', - textContent: 'Edit image' - }); - $.on(a, 'click', this.editFile); - return Menu.menu.addEntry({ - el: a, - order: 90, - open: function(post) { - var file; - QR.oekaki.menu.post = post; - file = post.file; - return QR.postingIsEnabled && !!file && (file.isImage || file.isVideo); - } - }); - }, - editFile: function() { - var currentTime, isVideo, post, ref; - post = QR.oekaki.menu.post; - QR.quote.call(post.nodes.post); - isVideo = post.file.isVideo; - currentTime = ((ref = post.file.fullImage) != null ? ref.currentTime : void 0) || 0; - return CrossOrigin.file(post.file.url, function(blob) { - var video; - if (!blob) { - return QR.error("Can't load file."); - } else if (isVideo) { - video = $.el('video'); - $.on(video, 'loadedmetadata', function() { - $.on(video, 'seeked', function() { - var canvas; - canvas = $.el('canvas', { - width: video.videoWidth, - height: video.videoHeight - }); - canvas.getContext('2d').drawImage(video, 0, 0); - return canvas.toBlob(function(snapshot) { - snapshot.name = post.file.name.replace(/\.\w+$/, '') + '.png'; - QR.handleFiles([snapshot]); - return QR.oekaki.edit(); - }); - }); - return video.currentTime = currentTime; - }); - $.on(video, 'error', function() { - return QR.openError(); - }); - return video.src = URL.createObjectURL(blob); - } else { - blob.name = post.file.name; - QR.handleFiles([blob]); - return QR.oekaki.edit(); - } - }); - } - }, - setup: function() { - return $.global(function() { - var FCX; - FCX = window.FCX; - FCX.oekakiCB = function() { - return window.Tegaki.flatten().toBlob(function(file) { - var source; - source = "oekaki-" + (Date.now()); - FCX.oekakiLatest = source; - return document.dispatchEvent(new CustomEvent('QRSetFile', { - bubbles: true, - detail: { - file: file, - name: FCX.oekakiName, - source: source - } - })); - }); - }; - if (window.Tegaki) { - return document.querySelector('#qr .oekaki').hidden = false; - } - }); - }, - load: function(cb) { - var n, onload, script, style; - if ($('script[src^="//s.4cdn.org/js/tegaki"]', d.head)) { - return cb(); - } else { - style = $.el('link', { - rel: 'stylesheet', - href: "//s.4cdn.org/css/tegaki." + (Date.now()) + ".css" - }); - script = $.el('script', { - src: "//s.4cdn.org/js/tegaki.min." + (Date.now()) + ".js" - }); - n = 0; - onload = function() { - if (++n === 2) { - return cb(); - } - }; - $.on(style, 'load', onload); - $.on(script, 'load', onload); - return $.add(d.head, [style, script]); - } - }, - draw: function() { - return $.global(function() { - var FCX, Tegaki; - Tegaki = window.Tegaki, FCX = window.FCX; - if (Tegaki.bg) { - Tegaki.destroy(); - } - FCX.oekakiName = 'tegaki.png'; - return Tegaki.open({ - onDone: FCX.oekakiCB, - onCancel: function() { - return Tegaki.bgColor = '#ffffff'; - }, - width: +document.querySelector('#qr [name=oekaki-width]').value, - height: +document.querySelector('#qr [name=oekaki-height]').value, - bgColor: document.querySelector('#qr [name=oekaki-bg]').checked ? document.querySelector('#qr [name=oekaki-bgcolor]').value : 'transparent' - }); - }); - }, - button: function() { - if (QR.selected.file) { - return QR.oekaki.edit(); - } else { - return QR.oekaki.toggle(); - } - }, - edit: function() { - return QR.oekaki.load(function() { - return $.global(function() { - var FCX, Tegaki, cb, error, name, source; - Tegaki = window.Tegaki, FCX = window.FCX; - name = document.getElementById('qr-filename').value.replace(/\.\w+$/, '') + '.png'; - source = document.getElementById('file-n-submit').dataset.source; - error = function(content) { - return document.dispatchEvent(new CustomEvent('CreateNotification', { - bubbles: true, - detail: { - type: 'warning', - content: content, - lifetime: 20 - } - })); - }; - cb = function(e) { - var canvas, selected; - if (e) { - this.removeEventListener('QRMetadata', cb, false); - } - selected = document.getElementById('selected'); - if (!(selected != null ? selected.dataset.type : void 0)) { - return error('No file to edit.'); - } - if (!/^(image|video)\//.test(selected.dataset.type)) { - return error('Not an image.'); - } - if (!selected.dataset.height) { - return error('Metadata not available.'); - } - if (selected.dataset.height === 'loading') { - selected.addEventListener('QRMetadata', cb, false); - return; - } - if (Tegaki.bg) { - Tegaki.destroy(); - } - FCX.oekakiName = name; - Tegaki.open({ - onDone: FCX.oekakiCB, - onCancel: function() { - return Tegaki.bgColor = '#ffffff'; - }, - width: +selected.dataset.width, - height: +selected.dataset.height, - bgColor: 'transparent' - }); - canvas = document.createElement('canvas'); - canvas.width = canvas.naturalWidth = +selected.dataset.width; - canvas.height = canvas.naturalHeight = +selected.dataset.height; - canvas.hidden = true; - document.body.appendChild(canvas); - canvas.addEventListener('QRImageDrawn', function() { - this.remove(); - return Tegaki.onOpenImageLoaded.call(this); - }, false); - return canvas.dispatchEvent(new CustomEvent('QRDrawFile', { - bubbles: true - })); - }; - if (Tegaki.bg && Tegaki.onDoneCb === FCX.oekakiCB && source === FCX.oekakiLatest) { - FCX.oekakiName = name; - return Tegaki.resume(); - } else { - return cb(); - } - }); - }); - }, - toggle: function() { - return QR.oekaki.load(function() { - return QR.nodes.oekaki.hidden = !QR.nodes.oekaki.hidden; - }); - } - }; - -}).call(this); - -(function() { - var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - QR.persona = { - always: {}, - types: { - name: [], - email: [], - sub: [] - }, - init: function() { - var i, item, len, ref; - if (!(Conf['Quick Reply'] || (Conf['Menu'] && Conf['Delete Link']))) { - return; - } - ref = Conf['QR.personas'].split('\n'); - for (i = 0, len = ref.length; i < len; i++) { - item = ref[i]; - QR.persona.parseItem(item.trim()); - } - }, - parseItem: function(item) { - var boards, match, ref, ref1, ref2, type, val; - if (item[0] === '#') { - return; - } - if (!(match = item.match(/(name|options|email|subject|password):"(.*)"/i))) { - return; - } - ref = match, match = ref[0], type = ref[1], val = ref[2]; - item = item.replace(match, ''); - boards = ((ref1 = item.match(/boards:([^;]+)/i)) != null ? ref1[1].toLowerCase() : void 0) || 'global'; - if (boards !== 'global' && (ref2 = g.BOARD.ID, indexOf.call(boards.split(','), ref2) < 0)) { - return; - } - if (type === 'password') { - QR.persona.pwd = val; - return; - } - if (type === 'options') { - type = 'email'; - } - if (type === 'subject') { - type = 'sub'; - } - if (/always/i.test(item)) { - QR.persona.always[type] = val; - } - if (indexOf.call(QR.persona.types[type], val) < 0) { - return QR.persona.types[type].push(val); - } - }, - load: function() { - var arr, i, len, list, ref, type, val; - ref = QR.persona.types; - for (type in ref) { - arr = ref[type]; - list = $("#list-" + type, QR.nodes.el); - for (i = 0, len = arr.length; i < len; i++) { - val = arr[i]; - if (val) { - $.add(list, $.el('option', { - textContent: val - })); - } - } - } - }, - getPassword: function() { - var m; - if (QR.persona.pwd != null) { - return QR.persona.pwd; - } else if ((m = d.cookie.match(/4chan_pass=([^;]+)/))) { - return decodeURIComponent(m[1]); - } else { - return ''; - } - }, - get: function(cb) { - return $.get('QR.persona', {}, function(arg) { - var persona; - persona = arg['QR.persona']; - return cb(persona); - }); - }, - set: function(post) { - return $.get('QR.persona', {}, function(arg) { - var persona; - persona = arg['QR.persona']; - persona = { - name: post.name, - flag: post.flag - }; - return $.set('QR.persona', persona); - }); - } - }; - -}).call(this); - -(function() { - var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - slice = [].slice; - - QR.post = (function() { - function _Class(select) { - this.select = bind(this.select, this); - var el, event, i, j, label, len, len1, prev, ref, ref1; - el = $.el('a', { - className: 'qr-preview', - draggable: true, - href: 'javascript:;' - }); - $.extend(el, {innerHTML: ""}); - this.nodes = { - el: el, - rm: el.firstChild, - spoiler: $('.qr-preview-spoiler input', el), - span: el.lastChild - }; - $.on(el, 'click', this.select); - $.on(this.nodes.rm, 'click', (function(_this) { - return function(e) { - e.stopPropagation(); - return _this.rm(); - }; - })(this)); - $.on(this.nodes.spoiler, 'change', (function(_this) { - return function(e) { - _this.spoiler = e.target.checked; - if (_this === QR.selected) { - QR.nodes.spoiler.checked = _this.spoiler; - } - return _this.preventAutoPost(); - }; - })(this)); - ref = $$('label', el); - for (i = 0, len = ref.length; i < len; i++) { - label = ref[i]; - $.on(label, 'click', function(e) { - return e.stopPropagation(); - }); - } - $.add(QR.nodes.dumpList, el); - ref1 = ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop']; - for (j = 0, len1 = ref1.length; j < len1; j++) { - event = ref1[j]; - $.on(el, event.toLowerCase(), this[event]); - } - this.thread = g.VIEW === 'thread' ? g.THREADID : 'new'; - prev = QR.posts[QR.posts.length - 1]; - QR.posts.push(this); - this.nodes.spoiler.checked = this.spoiler = prev && Conf['Remember Spoiler'] ? prev.spoiler : false; - QR.persona.get((function(_this) { - return function(persona) { - _this.name = 'name' in QR.persona.always ? QR.persona.always.name : prev ? prev.name : persona.name; - _this.email = 'email' in QR.persona.always ? QR.persona.always.email : ''; - _this.sub = 'sub' in QR.persona.always ? QR.persona.always.sub : ''; - if (QR.nodes.flag) { - _this.flag = prev ? prev.flag : persona.flag && persona.flag in g.BOARD.config.board_flags ? persona.flag : void 0; - } - if (QR.selected === _this) { - return _this.load(); - } - }; - })(this)); - if (select) { - this.select(); - } - this.unlock(); - QR.captcha.moreNeeded(); - } - - _Class.prototype.rm = function() { - var base, index; - this["delete"](); - index = QR.posts.indexOf(this); - if (QR.posts.length === 1) { - new QR.post(true); - $.rmClass(QR.nodes.el, 'dump'); - } else if (this === QR.selected) { - (QR.posts[index - 1] || QR.posts[index + 1]).select(); - } - QR.posts.splice(index, 1); - QR.status(); - return typeof (base = QR.captcha).updateThread === "function" ? base.updateThread() : void 0; - }; - - _Class.prototype["delete"] = function() { - $.rm(this.nodes.el); - URL.revokeObjectURL(this.URL); - return this.dismissErrors(); - }; - - _Class.prototype.lock = function(lock) { - var i, len, name, node, ref; - if (lock == null) { - lock = true; - } - this.isLocked = lock; - if (this !== QR.selected) { - return; - } - ref = ['thread', 'name', 'email', 'sub', 'com', 'fileButton', 'filename', 'spoiler', 'flag']; - for (i = 0, len = ref.length; i < len; i++) { - name = ref[i]; - if (node = QR.nodes[name]) { - node.disabled = lock; - } - } - this.nodes.rm.style.visibility = lock ? 'hidden' : ''; - this.nodes.spoiler.disabled = lock; - return this.nodes.el.draggable = !lock; - }; - - _Class.prototype.unlock = function() { - return this.lock(false); - }; - - _Class.prototype.select = function() { - var rectEl, rectList; - if (QR.selected) { - QR.selected.nodes.el.removeAttribute('id'); - QR.selected.forceSave(); - } - QR.selected = this; - this.lock(this.isLocked); - this.nodes.el.id = 'selected'; - rectEl = this.nodes.el.getBoundingClientRect(); - rectList = this.nodes.el.parentNode.getBoundingClientRect(); - this.nodes.el.parentNode.scrollLeft += rectEl.left + rectEl.width / 2 - rectList.left - rectList.width / 2; - return this.load(); - }; - - _Class.prototype.load = function() { - var i, len, name, node, ref; - ref = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'flag']; - for (i = 0, len = ref.length; i < len; i++) { - name = ref[i]; - if (!(node = QR.nodes[name])) { - continue; - } - node.value = this[name] || node.dataset["default"] || ''; - } - (this.thread !== 'new' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread'); - this.showFileData(); - return QR.characterCount(); - }; - - _Class.prototype.save = function(input, forced) { - var base, name, prev; - if (input.type === 'checkbox') { - this.spoiler = input.checked; - return; - } - name = input.dataset.name; - if (name !== 'thread' && name !== 'name' && name !== 'email' && name !== 'sub' && name !== 'com' && name !== 'filename' && name !== 'flag') { - return; - } - prev = this[name] || input.dataset["default"] || null; - this[name] = input.value || input.dataset["default"] || null; - switch (name) { - case 'thread': - (this.thread !== 'new' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread'); - QR.status(); - if (typeof (base = QR.captcha).updateThread === "function") { - base.updateThread(); - } - break; - case 'com': - this.updateComment(); - break; - case 'filename': - if (!this.file) { - return; - } - this.saveFilename(); - this.updateFilename(); - break; - case 'name': - case 'flag': - if (this[name] !== prev) { - QR.persona.set(this); - } - } - if (!forced) { - return this.preventAutoPost(); - } - }; - - _Class.prototype.forceSave = function() { - var i, len, name, node, ref; - if (this !== QR.selected) { - return; - } - ref = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'spoiler', 'flag']; - for (i = 0, len = ref.length; i < len; i++) { - name = ref[i]; - if (!(node = QR.nodes[name])) { - continue; - } - this.save(node, true); - } - }; - - _Class.prototype.preventAutoPost = function() { - if (QR.cooldown.auto && this === QR.posts[0]) { - QR.cooldown.update(); - if (QR.cooldown.seconds <= 5) { - return QR.cooldown.auto = false; - } - } - }; - - _Class.prototype.setComment = function(com) { - this.com = com || null; - if (this === QR.selected) { - QR.nodes.com.value = this.com; - } - return this.updateComment(); - }; - - _Class.prototype.updateComment = function() { - if (this === QR.selected) { - QR.characterCount(); - } - this.nodes.span.textContent = this.com; - QR.captcha.moreNeeded(); - if (QR.captcha === Captcha.v2) { - return Captcha.cache.prerequest(); - } - }; - - _Class.prototype.isOnlyQuotes = function() { - return (this.com || '').trim() === (this.quotedText || '').trim(); - }; - - _Class.rmErrored = function(e) { - var error, errors, i, j, len, post, ref; - e.stopPropagation(); - ref = QR.posts; - for (i = ref.length - 1; i >= 0; i += -1) { - post = ref[i]; - if (errors = post.errors) { - for (j = 0, len = errors.length; j < len; j++) { - error = errors[j]; - if (!(doc.contains(error))) { - continue; - } - post.rm(); - break; - } - } - } - }; - - _Class.prototype.error = function(className, message, link) { - var div, ref, rm, rmAll; - div = $.el('div', { - className: className - }); - $.extend(div, {innerHTML: E(message) + ((link) ? " [More info]" : "") + "
    [delete post] [delete all]"}); - (this.errors || (this.errors = [])).push(div); - ref = $$('a', div), rm = ref[0], rmAll = ref[1]; - $.on(div, 'click', (function(_this) { - return function() { - if (indexOf.call(QR.posts, _this) >= 0) { - return _this.select(); - } - }; - })(this)); - $.on(rm, 'click', (function(_this) { - return function(e) { - e.stopPropagation(); - if (indexOf.call(QR.posts, _this) >= 0) { - return _this.rm(); - } - }; - })(this)); - $.on(rmAll, 'click', QR.post.rmErrored); - return QR.error(div, true); - }; - - _Class.prototype.fileError = function(message, link) { - return this.error('file-error', this.filename + ": " + message, link); - }; - - _Class.prototype.dismissErrors = function(test) { - var error, i, len, ref; - if (test == null) { - test = function() { - return true; - }; - } - if (this.errors) { - ref = this.errors; - for (i = 0, len = ref.length; i < len; i++) { - error = ref[i]; - if (doc.contains(error) && test(error)) { - error.parentNode.previousElementSibling.click(); - } - } - } - }; - - _Class.prototype.setFile = function(file1) { - var ext, ref; - this.file = file1; - if (Conf['Randomize Filename'] && g.BOARD.ID !== 'f') { - this.filename = "" + (Date.now() * 1000 - Math.floor(Math.random() * 365 * $.DAY * 1000)); - if (ext = this.file.name.match(QR.validExtension)) { - this.filename += ext[0]; - } - } else { - this.filename = this.file.name; - } - this.filesize = $.bytesToString(this.file.size); - this.checkSize(); - $.addClass(this.nodes.el, 'has-file'); - QR.captcha.moreNeeded(); - URL.revokeObjectURL(this.URL); - this.saveFilename(); - if (this === QR.selected) { - this.showFileData(); - } else { - this.updateFilename(); - } - this.rmMetadata(); - this.nodes.el.dataset.type = this.file.type; - this.nodes.el.style.backgroundImage = ''; - if (ref = this.file.type, indexOf.call(QR.mimeTypes, ref) < 0) { - this.fileError('Unsupported file type.'); - } else if (/^(image|video)\//.test(this.file.type)) { - this.readFile(); - } - return this.preventAutoPost(); - }; - - _Class.prototype.checkSize = function() { - var max; - max = QR.max_size; - if (/^video\//.test(this.file.type)) { - max = Math.min(max, QR.max_size_video); - } - if (this.file.size > max) { - return this.fileError("File too large (file: " + this.filesize + ", max: " + ($.bytesToString(max)) + ")."); - } - }; - - _Class.prototype.readFile = function() { - var el, event, isVideo, onerror, onload; - isVideo = /^video\//.test(this.file.type); - el = $.el(isVideo ? 'video' : 'img'); - if (isVideo && !el.canPlayType(this.file.type)) { - return; - } - event = isVideo ? 'loadeddata' : 'load'; - onload = (function(_this) { - return function() { - $.off(el, event, onload); - $.off(el, 'error', onerror); - _this.checkDimensions(el); - _this.setThumbnail(el); - return $.event('QRMetadata', null, _this.nodes.el); - }; - })(this); - onerror = (function(_this) { - return function() { - $.off(el, event, onload); - $.off(el, 'error', onerror); - _this.fileError("Corrupt " + (isVideo ? 'video' : 'image') + " or error reading metadata.", 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions#error-reading-metadata'); - URL.revokeObjectURL(el.src); - _this.nodes.el.removeAttribute('data-height'); - return $.event('QRMetadata', null, _this.nodes.el); - }; - })(this); - this.nodes.el.dataset.height = 'loading'; - $.on(el, event, onload); - $.on(el, 'error', onerror); - return el.src = URL.createObjectURL(this.file); - }; - - _Class.prototype.checkDimensions = function(el) { - var duration, height, max_height, max_width, videoHeight, videoWidth, width; - if (el.tagName === 'IMG') { - height = el.height, width = el.width; - this.nodes.el.dataset.height = height; - this.nodes.el.dataset.width = width; - if (height > QR.max_height || width > QR.max_width) { - this.fileError("Image too large (image: " + height + "x" + width + "px, max: " + QR.max_height + "x" + QR.max_width + "px)"); - } - if (height < QR.min_height || width < QR.min_width) { - return this.fileError("Image too small (image: " + height + "x" + width + "px, min: " + QR.min_height + "x" + QR.min_width + "px)"); - } - } else { - videoHeight = el.videoHeight, videoWidth = el.videoWidth, duration = el.duration; - this.nodes.el.dataset.height = videoHeight; - this.nodes.el.dataset.width = videoWidth; - this.nodes.el.dataset.duration = duration; - max_height = Math.min(QR.max_height, QR.max_height_video); - max_width = Math.min(QR.max_width, QR.max_width_video); - if (videoHeight > max_height || videoWidth > max_width) { - this.fileError("Video too large (video: " + videoHeight + "x" + videoWidth + "px, max: " + max_height + "x" + max_width + "px)"); - } - if (videoHeight < QR.min_height || videoWidth < QR.min_width) { - this.fileError("Video too small (video: " + videoHeight + "x" + videoWidth + "px, min: " + QR.min_height + "x" + QR.min_width + "px)"); - } - if (!isFinite(duration)) { - this.fileError('Video lacks duration metadata (try remuxing)'); - } else if (duration > QR.max_duration_video) { - this.fileError("Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)"); - } - if (BoardConfig.noAudio(g.BOARD.ID) && $.hasAudio(el)) { - return this.fileError('Audio not allowed'); - } - } - }; - - _Class.prototype.setThumbnail = function(el) { - var cv, height, isVideo, s, width; - isVideo = el.tagName === 'VIDEO'; - s = 90 * 2 * window.devicePixelRatio; - if (this.file.type === 'image/gif') { - s *= 3; - } - if (isVideo) { - height = el.videoHeight; - width = el.videoWidth; - } else { - height = el.height, width = el.width; - if (height < s || width < s) { - this.URL = el.src; - this.nodes.el.style.backgroundImage = "url(" + this.URL + ")"; - return; - } - } - if (height <= width) { - width = s / height * width; - height = s; - } else { - height = s / width * height; - width = s; - } - cv = $.el('canvas'); - cv.height = height; - cv.width = width; - cv.getContext('2d').drawImage(el, 0, 0, width, height); - URL.revokeObjectURL(el.src); - return cv.toBlob((function(_this) { - return function(blob) { - _this.URL = URL.createObjectURL(blob); - return _this.nodes.el.style.backgroundImage = "url(" + _this.URL + ")"; - }; - })(this)); - }; - - _Class.prototype.rmFile = function() { - if (this.isLocked) { - return; - } - delete this.file; - delete this.filename; - delete this.filesize; - this.nodes.el.removeAttribute('title'); - QR.nodes.filename.removeAttribute('title'); - this.rmMetadata(); - this.nodes.el.style.backgroundImage = ''; - $.rmClass(this.nodes.el, 'has-file'); - this.showFileData(); - URL.revokeObjectURL(this.URL); - this.dismissErrors(function(error) { - return $.hasClass(error, 'file-error'); - }); - return this.preventAutoPost(); - }; - - _Class.prototype.rmMetadata = function() { - var attr, i, len, ref; - ref = ['type', 'height', 'width', 'duration']; - for (i = 0, len = ref.length; i < len; i++) { - attr = ref[i]; - this.nodes.el.removeAttribute("data-" + attr); - } - }; - - _Class.prototype.saveFilename = function() { - this.file.newName = (this.filename || '').replace(/[\/\\]/g, '-'); - if (!QR.validExtension.test(this.filename)) { - return this.file.newName += "." + ($.getOwn(QR.extensionFromType, this.file.type) || 'jpg'); - } - }; - - _Class.prototype.updateFilename = function() { - var long; - long = this.filename + " (" + this.filesize + ")"; - this.nodes.el.title = long; - if (this !== QR.selected) { - return; - } - return QR.nodes.filename.title = long; - }; - - _Class.prototype.showFileData = function() { - var ref; - if (this.file) { - this.updateFilename(); - QR.nodes.filename.value = this.filename; - $.addClass(QR.nodes.oekaki, 'has-file'); - $.addClass(QR.nodes.fileSubmit, 'has-file'); - } else { - $.rmClass(QR.nodes.oekaki, 'has-file'); - $.rmClass(QR.nodes.fileSubmit, 'has-file'); - } - if (((ref = this.file) != null ? ref.source : void 0) != null) { - QR.nodes.fileSubmit.dataset.source = this.file.source; - } else { - QR.nodes.fileSubmit.removeAttribute('data-source'); - } - return QR.nodes.spoiler.checked = this.spoiler; - }; - - _Class.prototype.pasteText = function(file) { - var reader; - this.pasting = true; - this.preventAutoPost(); - reader = new FileReader(); - reader.onload = (function(_this) { - return function(e) { - var result; - result = e.target.result; - _this.setComment((_this.com ? _this.com + "\n" + result : result)); - return delete _this.pasting; - }; - })(this); - return reader.readAsText(file); - }; - - _Class.prototype.dragStart = function(e) { - var left, ref, top; - ref = this.getBoundingClientRect(), left = ref.left, top = ref.top; - e.dataTransfer.setDragImage(this, e.clientX - left, e.clientY - top); - return $.addClass(this, 'drag'); - }; - - _Class.prototype.dragEnd = function() { - return $.rmClass(this, 'drag'); - }; - - _Class.prototype.dragEnter = function() { - return $.addClass(this, 'over'); - }; - - _Class.prototype.dragLeave = function() { - return $.rmClass(this, 'over'); - }; - - _Class.prototype.dragOver = function(e) { - e.preventDefault(); - return e.dataTransfer.dropEffect = 'move'; - }; - - _Class.prototype.drop = function() { - var base, el, index, newIndex, oldIndex, post; - $.rmClass(this, 'over'); - if (!this.draggable) { - return; - } - el = $('.drag', this.parentNode); - index = function(el) { - return slice.call(el.parentNode.children).indexOf(el); - }; - oldIndex = index(el); - newIndex = index(this); - if (QR.posts[oldIndex].isLocked || QR.posts[newIndex].isLocked) { - return; - } - (oldIndex < newIndex ? $.after : $.before)(this, el); - post = QR.posts.splice(oldIndex, 1)[0]; - QR.posts.splice(newIndex, 0, post); - QR.status(); - return typeof (base = QR.captcha).updateThread === "function" ? base.updateThread() : void 0; - }; - - return _Class; - - })(); - -}).call(this); - -QuoteBacklink = (function() { - var QuoteBacklink; - - QuoteBacklink = { - containers: $.dict(), - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Backlinks']) { - return; - } - if ((this.bottomBacklinks = Conf['Bottom Backlinks'])) { - $.addClass(doc, 'bottom-backlinks'); - } - Callbacks.Post.push({ - name: 'Quote Backlinking Part 1', - cb: this.firstNode - }); - return Callbacks.Post.push({ - name: 'Quote Backlinking Part 2', - cb: this.secondNode - }); - }, - firstNode: function() { - var a, clone, container, containers, hash, i, j, k, len, len1, len2, link, markYours, nodes, post, quote, ref, ref1; - if (this.isClone || !this.quotes.length || this.isRebuilt) { - return; - } - markYours = Conf['Mark Quotes of You'] && QuoteYou.isYou(this); - a = $.el('a', { - href: g.SITE.Build.postURL(this.board.ID, this.thread.ID, this.ID), - className: this.isHidden ? 'filtered backlink' : 'backlink', - textContent: Conf['backlink'].replace(/%(?:id|%)/g, (function(_this) { - return function(x) { - return { - '%id': _this.ID, - '%%': '%' - }[x]; - }; - })(this)) - }); - if (markYours) { - $.add(a, QuoteYou.mark.cloneNode(true)); - } - ref = this.quotes; - for (i = 0, len = ref.length; i < len; i++) { - quote = ref[i]; - containers = [QuoteBacklink.getContainer(quote)]; - if ((post = g.posts.get(quote)) && post.nodes.backlinkContainer) { - ref1 = post.clones; - for (j = 0, len1 = ref1.length; j < len1; j++) { - clone = ref1[j]; - containers.push(clone.nodes.backlinkContainer); - } - } - for (k = 0, len2 = containers.length; k < len2; k++) { - container = containers[k]; - link = a.cloneNode(true); - nodes = container.firstChild ? [$.tn(' '), link] : [link]; - if (Conf['Quote Previewing']) { - $.on(link, 'mouseover', QuotePreview.mouseover); - } - if (Conf['Quote Inlining']) { - $.on(link, 'click', QuoteInline.toggle); - if (Conf['Quote Hash Navigation']) { - hash = QuoteInline.qiQuote(link, $.hasClass(link, 'filtered')); - nodes.push(hash); - } - } - $.add(container, nodes); - } - } - }, - secondNode: function() { - var container; - if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) { - this.nodes.backlinkContainer = $('.container', this.nodes.post); - return; - } - if (!(this.isReply || Conf['OP Backlinks'])) { - return; - } - container = QuoteBacklink.getContainer(this.fullID); - this.nodes.backlinkContainer = container; - if (QuoteBacklink.bottomBacklinks) { - return $.add(this.nodes.post, container); - } else { - return $.add(this.nodes.info, container); - } - }, - getContainer: function(id) { - var base; - return (base = this.containers)[id] || (base[id] = $.el('span', { - className: 'container' - })); - } - }; - - return QuoteBacklink; - -}).call(this); - -QuoteCT = (function() { - var QuoteCT; - - QuoteCT = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark Cross-thread Quotes']) { - return; - } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - this.mark = $.el('span', { - textContent: '\u00A0(Cross-thread)', - className: 'qmark-ct' - }); - return Callbacks.Post.push({ - name: 'Mark Cross-thread Quotes', - cb: this.node - }); - }, - node: function() { - var board, boardID, i, len, quotelink, ref, ref1, ref2, thread, threadID; - if (this.isClone && this.thread === this.context.thread) { - return; - } - ref = this.context, board = ref.board, thread = ref.thread; - ref1 = this.nodes.quotelinks; - for (i = 0, len = ref1.length; i < len; i++) { - quotelink = ref1[i]; - ref2 = Get.postDataFromLink(quotelink), boardID = ref2.boardID, threadID = ref2.threadID; - if (!threadID) { - continue; - } - if (this.isClone) { - $.rm($('.qmark-ct', quotelink)); - } - if (boardID === board.ID && threadID !== thread.ID) { - $.add(quotelink, QuoteCT.mark.cloneNode(true)); - } - } - } - }; - - return QuoteCT; - -}).call(this); - -QuoteInline = (function() { - var QuoteInline, - slice = [].slice; - - QuoteInline = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Inlining']) { - return; - } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - return Callbacks.Post.push({ - name: 'Quote Inlining', - cb: this.node - }); - }, - node: function() { - var i, isClone, len, link, process, ref; - process = QuoteInline.process; - isClone = this.isClone; - ref = this.nodes.quotelinks.concat(slice.call(this.nodes.backlinks), this.nodes.archivelinks); - for (i = 0, len = ref.length; i < len; i++) { - link = ref[i]; - process(link, isClone); - } - }, - process: function(link, clone) { - if (Conf['Quote Hash Navigation']) { - if (!clone) { - $.after(link, QuoteInline.qiQuote(link, $.hasClass(link, 'filtered'))); - } - } - return $.on(link, 'click', QuoteInline.toggle); - }, - qiQuote: function(link, hidden) { - var name; - name = "hashlink"; - if (hidden) { - name += " filtered"; - } - return $.el('a', { - className: name, - textContent: '#', - href: link.href - }); - }, - toggle: function(e) { - var boardID, context, postID, quoter, ref, ref1, threadID; - if ($.modifiedClick(e)) { - return; - } - ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID; - if (Conf['Inline Cross-thread Quotes Only'] && g.VIEW === 'thread' && ((ref1 = g.posts.get(boardID + "." + postID)) != null ? ref1.nodes.root.offsetParent : void 0)) { - return; - } - if ($.hasClass(doc, 'catalog-mode')) { - return; - } - e.preventDefault(); - quoter = Get.postFromNode(this); - context = quoter.context; - if ($.hasClass(this, 'inlined')) { - QuoteInline.rm(this, boardID, threadID, postID, context); - } else { - if ($.x("ancestor::div[@data-full-i-d='" + boardID + "." + postID + "']", this)) { - return; - } - QuoteInline.add(this, boardID, threadID, postID, context, quoter); - } - return this.classList.toggle('inlined'); - }, - findRoot: function(quotelink, isBacklink) { - if (isBacklink) { - return $.x('ancestor::*[parent::*[contains(@class,"post")]][1]', quotelink); - } else { - return $.x('ancestor-or-self::*[parent::blockquote][1]', quotelink); - } - }, - add: function(quotelink, boardID, threadID, postID, context, quoter) { - var inline, isBacklink, post, qroot, root; - isBacklink = $.hasClass(quotelink, 'backlink'); - inline = $.el('div', { - className: 'inline' - }); - inline.dataset.fullID = boardID + "." + postID; - root = QuoteInline.findRoot(quotelink, isBacklink); - $.after(root, inline); - qroot = $.x('ancestor::*[contains(@class,"postContainer")][1]', root); - $.addClass(qroot, 'hasInline'); - new Fetcher(boardID, threadID, postID, inline, quoter); - if (!((post = g.posts.get(boardID + "." + postID)) && context.thread === post.thread)) { - return; - } - if (isBacklink && Conf['Forward Hiding']) { - $.addClass(post.nodes.root, 'forwarded'); - post.forwarded++ || (post.forwarded = 1); - } - if (!Unread.posts) { - return; - } - return Unread.readSinglePost(post); - }, - rm: function(quotelink, boardID, threadID, postID, context) { - var el, inlined, isBacklink, parentNode, post, qroot, ref, root; - isBacklink = $.hasClass(quotelink, 'backlink'); - root = QuoteInline.findRoot(quotelink, isBacklink); - root = $.x("following-sibling::div[@data-full-i-d='" + boardID + "." + postID + "'][1]", root); - qroot = $.x('ancestor::*[contains(@class,"postContainer")][1]', root); - parentNode = root.parentNode; - $.rm(root); - $.event('PostsRemoved', null, parentNode); - if (!$('.inline', qroot)) { - $.rmClass(qroot, 'hasInline'); - } - if (!(el = root.firstElementChild)) { - return; - } - post = g.posts.get(boardID + "." + postID); - post.rmClone(el.dataset.clone); - if (Conf['Forward Hiding'] && isBacklink && context.thread === g.threads.get(boardID + "." + threadID) && !--post.forwarded) { - delete post.forwarded; - $.rmClass(post.nodes.root, 'forwarded'); - } - while (inlined = $('.inlined', el)) { - ref = Get.postDataFromLink(inlined), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID; - QuoteInline.rm(inlined, boardID, threadID, postID, context); - $.rmClass(inlined, 'inlined'); - } - } - }; - - return QuoteInline; - -}).call(this); - -QuoteOP = (function() { - var QuoteOP, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - QuoteOP = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark OP Quotes']) { - return; - } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - this.mark = $.el('span', { - textContent: '\u00A0(OP)', - className: 'qmark-op' - }); - return Callbacks.Post.push({ - name: 'Mark OP Quotes', - cb: this.node - }); - }, - node: function() { - var boardID, fullID, i, postID, quotelink, quotelinks, quotes, ref, ref1; - if (this.isClone && this.thread === this.context.thread) { - return; - } - if (!(quotes = this.quotes).length) { - return; - } - quotelinks = this.nodes.quotelinks; - if (this.isClone && (ref = this.thread.fullID, indexOf.call(quotes, ref) >= 0)) { - i = 0; - while (quotelink = quotelinks[i++]) { - $.rm($('.qmark-op', quotelink)); - } - } - fullID = this.context.thread.fullID; - if (indexOf.call(quotes, fullID) < 0) { - return; - } - i = 0; - while (quotelink = quotelinks[i++]) { - ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID; - if ((boardID + "." + postID) === fullID) { - $.add(quotelink, QuoteOP.mark.cloneNode(true)); - } - } - } - }; - - return QuoteOP; - -}).call(this); - -QuotePreview = (function() { - var QuotePreview, - slice = [].slice; - - QuotePreview = { - init: function() { - var ref; - if (!Conf['Quote Previewing']) { - return; - } - if (g.VIEW === 'archive') { - $.on(d, 'mouseover', function(e) { - if (e.target.nodeName === 'A' && $.hasClass(e.target, 'quotelink')) { - return QuotePreview.mouseover.call(e.target, e); - } - }); - } - if ((ref = g.VIEW) !== 'index' && ref !== 'thread') { - return; - } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - return Callbacks.Post.push({ - name: 'Quote Previewing', - cb: this.node - }); - }, - node: function() { - var i, len, link, ref; - ref = this.nodes.quotelinks.concat(slice.call(this.nodes.backlinks), this.nodes.archivelinks); - for (i = 0, len = ref.length; i < len; i++) { - link = ref[i]; - $.on(link, 'mouseover', QuotePreview.mouseover); - } - }, - mouseover: function(e) { - var boardID, i, len, origin, post, postID, posts, qp, ref, threadID; - if (($.hasClass(this, 'inlined') && !$.hasClass(doc, 'catalog-mode')) || !d.contains(this)) { - return; - } - ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID; - qp = $.el('div', { - id: 'qp', - className: 'dialog' - }); - $.add(Header.hover, qp); - new Fetcher(boardID, threadID, postID, qp, Get.postFromNode(this)); - UI.hover({ - root: this, - el: qp, - latestEvent: e, - endEvents: 'mouseout click', - cb: QuotePreview.mouseout - }); - if (Conf['Quote Highlighting'] && (origin = g.posts.get(boardID + "." + postID))) { - posts = [origin].concat(origin.clones); - posts.pop(); - for (i = 0, len = posts.length; i < len; i++) { - post = posts[i]; - $.addClass(post.nodes.post, 'qphl'); - } - } - }, - mouseout: function() { - var clone, i, len, post, ref, root; - if (!(root = this.el.firstElementChild)) { - return; - } - $.event('PostsRemoved', null, Header.hover); - clone = Get.postFromRoot(root); - post = clone.origin; - post.rmClone(root.dataset.clone); - if (!Conf['Quote Highlighting']) { - return; - } - ref = [post].concat(post.clones); - for (i = 0, len = ref.length; i < len; i++) { - post = ref[i]; - $.rmClass(post.nodes.post, 'qphl'); - } - } - }; - - return QuotePreview; - -}).call(this); - -QuoteStrikeThrough = (function() { - var QuoteStrikeThrough; - - QuoteStrikeThrough = { - init: function() { - var ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Reply Hiding Buttons'] || (Conf['Menu'] && Conf['Reply Hiding Link']) || Conf['Filter']))) { - return; - } - return Callbacks.Post.push({ - name: 'Strike-through Quotes', - cb: this.node - }); - }, - node: function() { - var boardID, i, len, postID, quotelink, ref, ref1, ref2; - if (this.isClone) { - return; - } - ref = this.nodes.quotelinks; - for (i = 0, len = ref.length; i < len; i++) { - quotelink = ref[i]; - ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID; - if ((ref2 = g.posts.get(boardID + "." + postID)) != null ? ref2.isHidden : void 0) { - $.addClass(quotelink, 'filtered'); - } - } - } - }; - - return QuoteStrikeThrough; - -}).call(this); - -QuoteThreading = -/* - <3 aeosynth - */ - -(function() { - var QuoteThreading; - - QuoteThreading = { - init: function() { - if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) { - return; - } - this.controls = $.el('label', {innerHTML: " Threading"}); - this.threadNewLink = $.el('span', { - className: 'brackets-wrap threadnewlink', - hidden: true - }); - $.extend(this.threadNewLink, {innerHTML: "Thread New Posts"}); - this.input = $('input', this.controls); - this.input.checked = Conf['Thread Quotes']; - $.on(this.input, 'change', this.setEnabled); - $.on(this.input, 'change', this.rethread); - $.on(this.threadNewLink.firstElementChild, 'click', this.rethread); - $.on(d, '4chanXInitFinished', (function(_this) { - return function() { - return _this.ready = true; - }; - })(this)); - Header.menu.addEntry(this.entry = { - el: this.controls, - order: 99 - }); - Callbacks.Thread.push({ - name: 'Quote Threading', - cb: this.setThread - }); - return Callbacks.Post.push({ - name: 'Quote Threading', - cb: this.node - }); - }, - parent: $.dict(), - children: $.dict(), - inserted: $.dict(), - toggleThreading: function() { - return this.setThreadingState(!Conf['Thread Quotes']); - }, - setThreadingState: function(enabled) { - this.input.checked = enabled; - this.setEnabled.call(this.input); - return this.rethread.call(this.input); - }, - setEnabled: function() { - var other, ref; - if (this.checked) { - $.set('Prune All Threads', false); - other = (ref = ReplyPruning.inputs) != null ? ref.enabled : void 0; - if (other != null ? other.checked : void 0) { - other.checked = false; - $.event('change', null, other); - } - } - return $.cb.checked.call(this); - }, - setThread: function() { - QuoteThreading.thread = this; - return $.asap((function() { - return !Conf['Thread Updater'] || $('.navLinksBot > .updatelink'); - }), function() { - var navLinksBot; - if ((navLinksBot = $('.navLinksBot'))) { - return $.add(navLinksBot, [$.tn(' '), QuoteThreading.threadNewLink]); - } - }); - }, - node: function() { - var ancestor, j, lastParent, len, parent, parents, quote, ref; - if (this.isFetchedQuote || this.isClone || !this.isReply) { - return; - } - parents = new Set(); - lastParent = null; - ref = this.quotes; - for (j = 0, len = ref.length; j < len; j++) { - quote = ref[j]; - if (parent = g.posts.get(quote)) { - if (!parent.isFetchedQuote && parent.isReply && parent.ID < this.ID) { - parents.add(parent.ID); - if (!lastParent || parent.ID > lastParent.ID) { - lastParent = parent; - } - } - } - } - if (!lastParent) { - return; - } - ancestor = lastParent; - while (ancestor = QuoteThreading.parent[ancestor.fullID]) { - parents["delete"](ancestor.ID); - } - if (parents.size === 1) { - return QuoteThreading.parent[this.fullID] = lastParent; - } - }, - descendants: function(post) { - var child, children, j, len, posts; - posts = [post]; - if (children = QuoteThreading.children[post.fullID]) { - for (j = 0, len = children.length; j < len; j++) { - child = children[j]; - posts = posts.concat(QuoteThreading.descendants(child)); - } - } - return posts; - }, - insert: function(post) { - var base, child, children, descendants, i, j, k, l, len, name, next, nodes, order, parent, prev, prev2, threadContainer, x; - if (!(Conf['Thread Quotes'] && (parent = QuoteThreading.parent[post.fullID]) && !QuoteThreading.inserted[post.fullID])) { - return false; - } - descendants = QuoteThreading.descendants(post); - if (!Unread.posts.has(parent.ID)) { - if ((function() { - var j, len, x; - for (j = 0, len = descendants.length; j < len; j++) { - x = descendants[j]; - if (Unread.posts.has(x.ID)) { - return true; - } - } - })()) { - QuoteThreading.threadNewLink.hidden = false; - return false; - } - } - order = Unread.order; - children = ((base = QuoteThreading.children)[name = parent.fullID] || (base[name] = [])); - threadContainer = parent.nodes.threadContainer || $.el('div', { - className: 'threadContainer' - }); - nodes = [post.nodes.root]; - if (post.nodes.threadContainer) { - nodes.push(post.nodes.threadContainer); - } - i = children.length; - for (j = children.length - 1; j >= 0; j += -1) { - child = children[j]; - if (child.ID >= post.ID) { - i--; - } - } - if (i !== children.length) { - next = children[i]; - for (k = 0, len = descendants.length; k < len; k++) { - x = descendants[k]; - order.before(order[next.ID], order[x.ID]); - } - children.splice(i, 0, post); - $.before(next.nodes.root, nodes); - } else { - prev = parent; - while ((prev2 = QuoteThreading.children[prev.fullID]) && prev2.length) { - prev = prev2[prev2.length - 1]; - } - for (l = descendants.length - 1; l >= 0; l += -1) { - x = descendants[l]; - order.after(order[prev.ID], order[x.ID]); - } - children.push(post); - $.add(threadContainer, nodes); - } - QuoteThreading.inserted[post.fullID] = true; - if (!parent.nodes.threadContainer) { - parent.nodes.threadContainer = threadContainer; - $.addClass(parent.nodes.root, 'threadOP'); - $.after(parent.nodes.root, threadContainer); - } - return true; - }, - rethread: function() { - var nodes, posts, thread; - if (!QuoteThreading.ready) { - return; - } - thread = QuoteThreading.thread; - posts = thread.posts; - QuoteThreading.threadNewLink.hidden = true; - if (Conf['Thread Quotes']) { - posts.forEach(QuoteThreading.insert); - } else { - nodes = []; - Unread.order = new RandomAccessList(); - QuoteThreading.inserted = $.dict(); - posts.forEach(function(post) { - if (post.isFetchedQuote) { - return; - } - Unread.order.push(post); - if (post.isReply) { - nodes.push(post.nodes.root); - } - if (QuoteThreading.children[post.fullID]) { - delete QuoteThreading.children[post.fullID]; - $.rmClass(post.nodes.root, 'threadOP'); - $.rm(post.nodes.threadContainer); - return delete post.nodes.threadContainer; - } - }); - $.add(thread.nodes.root, nodes); - } - Unread.position = Unread.order.first; - Unread.updatePosition(); - Unread.setLine(true); - Unread.read(); - return Unread.update(); - } - }; - - return QuoteThreading; - -}).call(this); - -QuoteYou = (function() { - var QuoteYou; - - QuoteYou = { - init: function() { - var ref; - if (!Conf['Remember Your Posts']) { - return; - } - this.db = new DataBoard('yourPosts'); - $.sync('Remember Your Posts', function(enabled) { - return Conf['Remember Your Posts'] = enabled; - }); - $.on(d, 'QRPostSuccessful', function(e) { - var cb; - cb = PostRedirect.delay(); - return $.get('Remember Your Posts', Conf['Remember Your Posts'], function(items) { - var boardID, postID, ref, threadID; - if (!items['Remember Your Posts']) { - return; - } - ref = e.detail, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID; - return QuoteYou.db.set({ - boardID: boardID, - threadID: threadID, - postID: postID, - val: true - }, cb); - }); - }); - if ((ref = g.VIEW) !== 'index' && ref !== 'thread' && ref !== 'archive') { - return; - } - if (Conf['Highlight Own Posts']) { - $.addClass(doc, 'highlight-own'); - } - if (Conf['Highlight Posts Quoting You']) { - $.addClass(doc, 'highlight-you'); - } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - this.mark = $.el('span', { - textContent: '\u00A0(You)', - className: 'qmark-you' - }); - Callbacks.Post.push({ - name: 'Mark Quotes of You', - cb: this.node - }); - return QuoteYou.menu.init(); - }, - isYou: function(post) { - var ref; - return !!((ref = QuoteYou.db) != null ? ref.get({ - boardID: post.boardID, - threadID: post.threadID, - postID: post.ID - }) : void 0); - }, - node: function() { - var i, len, quotelink, ref; - if (this.isClone) { - return; - } - if (QuoteYou.isYou(this)) { - $.addClass(this.nodes.root, 'yourPost'); - } - if (!this.quotes.length) { - return; - } - ref = this.nodes.quotelinks; - for (i = 0, len = ref.length; i < len; i++) { - quotelink = ref[i]; - if (!(QuoteYou.db.get(Get.postDataFromLink(quotelink)))) { - continue; - } - if (Conf['Mark Quotes of You']) { - $.add(quotelink, QuoteYou.mark.cloneNode(true)); - } - $.addClass(quotelink, 'you'); - $.addClass(this.nodes.root, 'quotesYou'); - } - }, - menu: { - init: function() { - var input, label, ref; - label = $.el('label', { - className: 'toggle-you' - }, {innerHTML: " You"}); - input = $('input', label); - $.on(input, 'change', QuoteYou.menu.toggle); - return (ref = Menu.menu) != null ? ref.addEntry({ - el: label, - order: 80, - open: function(post) { - QuoteYou.menu.post = post.origin || post; - input.checked = QuoteYou.isYou(post); - return true; - } - }) : void 0; - }, - toggle: function() { - var clone, data, i, j, len, len1, post, quotelink, quoter, ref, ref1; - post = QuoteYou.menu.post; - data = { - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID, - val: true - }; - if (this.checked) { - QuoteYou.db.set(data); - } else { - QuoteYou.db["delete"](data); - } - ref = [post].concat(post.clones); - for (i = 0, len = ref.length; i < len; i++) { - clone = ref[i]; - clone.nodes.root.classList.toggle('yourPost', this.checked); - } - ref1 = Get.allQuotelinksLinkingTo(post); - for (j = 0, len1 = ref1.length; j < len1; j++) { - quotelink = ref1[j]; - if (this.checked) { - if (Conf['Mark Quotes of You']) { - $.add(quotelink, QuoteYou.mark.cloneNode(true)); - } - } else { - $.rm($('.qmark-you', quotelink)); - } - quotelink.classList.toggle('you', this.checked); - if ($.hasClass(quotelink, 'quotelink')) { - quoter = Get.postFromNode(quotelink).nodes.root; - quoter.classList.toggle('quotesYou', !!$('.quotelink.you', quoter)); - } - } - } - }, - cb: { - seek: function(type) { - var highlight, highlighted, post, posts, result, str; - highlight = g.SITE.classes.highlight; - if ((highlighted = $("." + highlight))) { - $.rmClass(highlighted, highlight); - } - if (!(QuoteYou.lastRead && doc.contains(QuoteYou.lastRead) && $.hasClass(QuoteYou.lastRead, 'quotesYou'))) { - if (!(post = QuoteYou.lastRead = $('.quotesYou'))) { - new Notice('warning', 'No posts are currently quoting you, loser.', 20); - return; - } - if (QuoteYou.cb.scroll(post)) { - return; - } - } else { - post = QuoteYou.lastRead; - } - str = type + "::div[contains(@class,'quotesYou')]"; - while ((post = (result = $.X(str, post)).snapshotItem(type === 'preceding' ? result.snapshotLength - 1 : 0))) { - if (QuoteYou.cb.scroll(post)) { - return; - } - } - posts = $$('.quotesYou'); - return QuoteYou.cb.scroll(posts[type === 'following' ? 0 : posts.length - 1]); - }, - scroll: function(root) { - var node, post, sel; - post = Get.postFromRoot(root); - if (!post.nodes.post.getBoundingClientRect().height) { - return false; - } else { - QuoteYou.lastRead = root; - location.href = Get.url('post', post); - Header.scrollTo(post.nodes.post); - if (post.isReply) { - sel = "" + g.SITE.selectors.postContainer + g.SITE.selectors.highlightable.reply; - node = post.nodes.root; - if (!node.matches(sel)) { - node = $(sel, node); - } - $.addClass(node, g.SITE.classes.highlight); - } - return true; - } - } - } - }; - - return QuoteYou; - -}).call(this); - -Quotify = (function() { - var Quotify, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - slice = [].slice; - - Quotify = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Resurrect Quotes']) { - return; - } - $.addClass(doc, 'resurrect-quotes'); - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - return Callbacks.Post.push({ - name: 'Resurrect Quotes', - cb: this.node - }); - }, - node: function() { - var deadlink, i, j, len, len1, link, ref, ref1; - if (this.isClone) { - this.nodes.archivelinks = $$('a.linkify.quotelink', this.nodes.comment); - return; - } - ref = $$('a.linkify', this.nodes.comment); - for (i = 0, len = ref.length; i < len; i++) { - link = ref[i]; - Quotify.parseArchivelink.call(this, link); - } - ref1 = $$('.deadlink', this.nodes.comment); - for (j = 0, len1 = ref1.length; j < len1; j++) { - deadlink = ref1[j]; - Quotify.parseDeadlink.call(this, deadlink); - } - }, - parseArchivelink: function(link) { - var boardID, m, postID, ref, threadID; - if (!(m = link.pathname.match(/^\/([^\/]+)\/thread\/S?(\d+)\/?$/))) { - return; - } - if ((ref = link.hostname) === 'boards.4chan.org' || ref === 'boards.4channel.org') { - return; - } - boardID = m[1]; - threadID = m[2]; - postID = link.hash.match(/^#[pq]?(\d+)$|$/)[1] || threadID; - if (Redirect.to('post', { - boardID: boardID, - postID: postID - })) { - $.addClass(link, 'quotelink'); - $.extend(link.dataset, { - boardID: boardID, - threadID: threadID, - postID: postID - }); - return this.nodes.archivelinks.push(link); - } - }, - parseDeadlink: function(deadlink) { - var a, boardID, fetchable, m, post, postID, quote, quoteID, redirect, ref; - if ($.hasClass(deadlink.parentNode, 'prettyprint')) { - Quotify.fixDeadlink(deadlink); - return; - } - quote = deadlink.textContent; - if (!(postID = (ref = quote.match(/\d+$/)) != null ? ref[0] : void 0)) { - return; - } - if (postID[0] === '0') { - Quotify.fixDeadlink(deadlink); - return; - } - boardID = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : this.board.ID; - quoteID = boardID + "." + postID; - if (post = g.posts.get(quoteID)) { - if (!post.isDead) { - a = $.el('a', { - href: g.SITE.Build.postURL(boardID, post.thread.ID, postID), - className: 'quotelink', - textContent: quote - }); - } else { - a = $.el('a', { - href: g.SITE.Build.postURL(boardID, post.thread.ID, postID), - className: 'quotelink deadlink', - textContent: quote - }); - $.add(a, Post.deadMark.cloneNode(true)); - $.extend(a.dataset, { - boardID: boardID, - threadID: post.thread.ID, - postID: postID - }); - } - } else { - redirect = Redirect.to('thread', { - boardID: boardID, - threadID: 0, - postID: postID - }); - fetchable = Redirect.to('post', { - boardID: boardID, - postID: postID - }); - if (redirect || fetchable) { - a = $.el('a', { - href: redirect || 'javascript:;', - className: 'deadlink', - textContent: quote - }); - $.add(a, Post.deadMark.cloneNode(true)); - if (fetchable) { - $.addClass(a, 'quotelink'); - $.extend(a.dataset, { - boardID: boardID, - postID: postID - }); - } - } - } - if (indexOf.call(this.quotes, quoteID) < 0) { - this.quotes.push(quoteID); - } - if (!a) { - $.add(deadlink, Post.deadMark.cloneNode(true)); - return; - } - $.replace(deadlink, a); - if ($.hasClass(a, 'quotelink')) { - return this.nodes.quotelinks.push(a); - } - }, - fixDeadlink: function(deadlink) { - var el, green; - if (!(el = deadlink.previousSibling) || el.nodeName === 'BR') { - green = $.el('span', { - className: 'quote' - }); - $.before(deadlink, green); - $.add(green, deadlink); - } - return $.replace(deadlink, slice.call(deadlink.childNodes)); - } - }; - - return Quotify; - -}).call(this); - -Main = (function() { - var Main, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Main = { - init: function() { - var db, flatten, i, items, j, k, key, len, mountedCB, ref, ref1, ref2, w; - try { - w = window; - if ($.platform === 'crx') { - w = w.wrappedJSObject || w; - } - if ('4chan X antidup' in w) { - return; - } - w['4chan X antidup'] = true; - } catch (error1) {} - try { - if (window.frameElement && ((ref = window.frameElement.src) === '' || ref === 'about:blank')) { - return; - } - } catch (error1) {} - if (doc && $.hasClass(doc, 'fourchan-x')) { - return; - } - $.asap(docSet, function() { - $.addClass(doc, 'fourchan-x', 'seaweedchan'); - if ($.engine) { - return $.addClass(doc, "ua-" + $.engine); - } - }); - $.on(d, '4chanXInitFinished', function() { - if (Main.expectInitFinished) { - return delete Main.expectInitFinished; - } else { - new Notice('error', 'Error: Multiple copies of 4chan X are enabled.'); - return $.addClass(doc, 'tainted'); - } - }); - mountedCB = function() { - var cb, j, len, ref1, results; - d.removeEventListener('mounted', mountedCB, true); - Main.isMounted = true; - ref1 = Main.mountedCBs; - results = []; - for (j = 0, len = ref1.length; j < len; j++) { - cb = ref1[j]; - try { - results.push(cb()); - } catch (error1) {} - } - return results; - }; - d.addEventListener('mounted', mountedCB, true); - flatten = function(parent, obj) { - var key, val; - if (obj instanceof Array) { - Conf[parent] = $.dict.clone(obj[0]); - } else if (typeof obj === 'object') { - for (key in obj) { - val = obj[key]; - flatten(key, val); - } - } else { - Conf[parent] = obj; - } - }; - if ((ref1 = location.hostname) === 'boards.4chan.org' || ref1 === 'boards.4channel.org') { - $.global(function() { - var fromCharCode0; - fromCharCode0 = String.fromCharCode; - return String.fromCharCode = function() { - if (document.body) { - String.fromCharCode = fromCharCode0; - } else if (document.currentScript && !document.currentScript.src) { - throw Error(); - } - return fromCharCode0.apply(this, arguments); - }; - }); - $.asap(docSet, function() { - return $.onExists(doc, 'iframe[srcdoc]', $.rm); - }); - } - flatten(null, Config); - ref2 = DataBoard.keys; - for (j = 0, len = ref2.length; j < len; j++) { - db = ref2[j]; - Conf[db] = $.dict(); - } - Conf['customTitles'] = $.dict.clone({ - '4chan.org': { - boards: { - 'qa': { - 'boardTitle': { - orig: '/qa/ - Question & Answer', - title: '/qa/ - 2D/Random' - } - } - } - } - }); - Conf['boardConfig'] = { - boards: $.dict() - }; - Conf['archives'] = Redirect.archives; - Conf['selectedArchives'] = $.dict(); - Conf['cooldowns'] = $.dict(); - Conf['Index Sort'] = $.dict(); - for (i = k = 0; k < 2; i = ++k) { - Conf["Last Long Reply Thresholds " + i] = $.dict(); - } - Conf['siteProperties'] = $.dict(); - Conf['Except Archives from Encryption'] = false; - Conf['JSON Navigation'] = true; - Conf['Oekaki Links'] = true; - Conf['Show Name and Subject'] = false; - Conf['QR Shortcut'] = true; - Conf['Bottom QR Link'] = true; - Conf['Toggleable Thread Watcher'] = true; - Conf['siteSoftware'] = ''; - Conf['Use Faster Image Host'] = 'true'; - Conf['Captcha Fixes'] = true; - Conf['captchaServiceDomain'] = ''; - Conf['captchaServiceKey'] = $.dict(); - if (/\.4chan(?:nel)?\.org$/.test(location.hostname) && !SW.yotsuba.regexp.pass.test(location.href) && !SW.yotsuba.regexp.captcha.test(location.href) && !$$('script:not([src])', d).filter(function(s) { - return /this\[/.test(s.textContent); - }).length) { - ($.getSync || $.get)({ - 'jsWhitelist': Conf['jsWhitelist'] - }, function(arg) { - var jsWhitelist; - jsWhitelist = arg.jsWhitelist; - return $.addCSP("script-src " + (jsWhitelist.replace(/^#.*$/mg, '').replace(/[\s;]+/g, ' ').trim())); - }); - } - items = $.dict(); - for (key in Conf) { - items[key] = void 0; - } - items['previousversion'] = void 0; - return ($.getSync || $.get)(items, function(items) { - var ref3; - if (!$.perProtocolSettings && /\.4chan(?:nel)?\.org$/.test(location.hostname) && ((ref3 = items['Redirect to HTTPS']) != null ? ref3 : Conf['Redirect to HTTPS']) && location.protocol !== 'https:') { - location.replace('https://' + location.host + location.pathname + location.search + location.hash); - return; - } - return $.asap(docSet, function() { - var ref4, val; - if ($.cantSet) { - - } else if (items.previousversion == null) { - Main.isFirstRun = true; - Main.ready(function() { - $.set('previousversion', g.VERSION); - return Settings.open(); - }); - } else if (items.previousversion !== g.VERSION) { - Main.upgrade(items); - } - for (key in Conf) { - val = Conf[key]; - Conf[key] = (ref4 = items[key]) != null ? ref4 : val; - } - return Site.init(Main.initFeatures); - }); - }); - }, - upgrade: function(items) { - var changes, previousversion; - previousversion = items.previousversion; - changes = Settings.upgrade(items, previousversion); - items.previousversion = changes.previousversion = g.VERSION; - return $.set(changes, function() { - var el, ref; - if ((ref = items['Show Updated Notifications']) != null ? ref : true) { - el = $.el('span', {innerHTML: "4chan X has been updated to version " + E(g.VERSION) + "."}); - return new Notice('info', el, 15); - } - }); - }, - parseURL: function(site, url) { - var pathname, r, ref; - if (site == null) { - site = g.SITE; - } - if (url == null) { - url = location; - } - r = {}; - if (!site) { - return r; - } - r.siteID = site.ID; - if (typeof site.isBoardlessPage === "function" ? site.isBoardlessPage(url) : void 0) { - return r; - } - pathname = url.pathname.split(/\/+/); - r.boardID = pathname[1]; - if (site.isFileURL(url)) { - r.VIEW = 'file'; - } else if (typeof site.isAuxiliaryPage === "function" ? site.isAuxiliaryPage(url) : void 0) { - - } else if ((ref = pathname[2]) === 'thread' || ref === 'res') { - r.VIEW = 'thread'; - r.threadID = r.THREADID = +pathname[3].replace(/\.\w+$/, ''); - } else if (pathname[2] === 'archive' && pathname[3] === 'res') { - r.VIEW = 'thread'; - r.threadID = r.THREADID = +pathname[4].replace(/\.\w+$/, ''); - r.threadArchived = true; - } else if (/^(?:catalog|archive)(?:\.\w+)?$/.test(pathname[2])) { - r.VIEW = pathname[2].replace(/\.\w+$/, ''); - } else if (/^(?:index|\d*)(?:\.\w+)?$/.test(pathname[2])) { - r.VIEW = 'index'; - } - return r; - }, - initFeatures: function() { - var base, err, feature, j, len, name, ref, ref1; - $.global(function() { - document.documentElement.classList.add('js-enabled'); - return window.FCX = {}; - }); - Main.jsEnabled = $.hasClass(doc, 'js-enabled'); - if (typeof $.ajaxPageInit === "function") { - $.ajaxPageInit(); - } - $.extend(g, Main.parseURL()); - if (g.boardID) { - g.BOARD = new Board(g.boardID); - } - if (!g.VIEW) { - if (typeof (base = g.SITE).initAuxiliary === "function") { - base.initAuxiliary(); - } - return; - } - if (g.VIEW === 'file') { - $.asap((function() { - return d.readyState !== 'loading'; - }), function() { - var base1, pathname, video; - if (g.SITE.software === 'yotsuba' && Conf['404 Redirect'] && (typeof (base1 = g.SITE).is404 === "function" ? base1.is404() : void 0)) { - pathname = location.pathname.split(/\/+/); - return Redirect.navigate('file', { - boardID: g.BOARD.ID, - filename: pathname[pathname.length - 1] - }); - } else if (video = $('video')) { - if (Conf['Volume in New Tab']) { - Volume.setup(video); - } - if (Conf['Loop in New Tab']) { - video.loop = true; - video.controls = false; - video.play(); - return ImageCommon.addControls(video); - } - } - }); - return; - } - g.threads = new SimpleDict(); - g.posts = new SimpleDict(); - $.onExists(doc, 'body', Main.initStyle); - ref = Main.features; - for (j = 0, len = ref.length; j < len; j++) { - ref1 = ref[j], name = ref1[0], feature = ref1[1]; - if (g.SITE.disabledFeatures && indexOf.call(g.SITE.disabledFeatures, name) >= 0) { - continue; - } - try { - feature.init(); - } catch (error1) { - err = error1; - Main.handleErrors({ - message: "\"" + name + "\" initialization crashed.", - error: err - }); - } - } - return $.ready(Main.initReady); - }, - initStyle: function() { - var keyboard, ref; - if (!Main.isThisPageLegit()) { - return; - } - if ((ref = $('link[href*=mobile]', d.head)) != null) { - ref.disabled = true; - } - doc.dataset.host = location.host; - $.addClass(doc, "sw-" + g.SITE.software); - $.addClass(doc, g.VIEW === 'thread' ? 'thread-view' : g.VIEW); - $.onExists(doc, '.ad-cnt, .adg-rects > .desktop', function(ad) { - return $.onExists(ad, 'img, iframe', function() { - return $.addClass(doc, 'ads-loaded'); - }); - }); - if (Conf['Autohiding Scrollbar']) { - $.addClass(doc, 'autohiding-scrollbar'); - } - $.ready(function() { - if (d.body.clientHeight > doc.clientHeight && (window.innerWidth === doc.clientWidth) !== Conf['Autohiding Scrollbar']) { - Conf['Autohiding Scrollbar'] = !Conf['Autohiding Scrollbar']; - $.set('Autohiding Scrollbar', Conf['Autohiding Scrollbar']); - return $.toggleClass(doc, 'autohiding-scrollbar'); - } - }); - $.addStyle(CSS.sub(CSS.boards), 'fourchanx-css'); - Main.bgColorStyle = $.el('style', { - id: 'fourchanx-bgcolor-css' - }); - keyboard = false; - $.on(d, 'mousedown', function() { - return keyboard = false; - }); - $.on(d, 'keydown', function(e) { - if (e.keyCode === 9) { - return keyboard = true; - } - }); - window.addEventListener('focus', (function() { - return doc.classList.toggle('keyboard-focus', keyboard); - }), true); - return Main.setClass(); - }, - setClass: function() { - var j, knownStyles, len, mainStyleSheet, ref, ref1, setStyle, style, styleSheet, styleSheets; - knownStyles = ['yotsuba', 'yotsuba-b', 'futaba', 'burichan', 'photon', 'tomorrow', 'spooky']; - if (g.SITE.software === 'yotsuba' && g.VIEW === 'catalog') { - if ((mainStyleSheet = $.id('base-css'))) { - style = (ref = mainStyleSheet.href.match(/catalog_(\w+)/)) != null ? ref[1].replace('_new', '').replace(/_+/g, '-') : void 0; - if (indexOf.call(knownStyles, style) >= 0) { - $.addClass(doc, style); - return; - } - } - } - style = mainStyleSheet = styleSheets = null; - setStyle = function() { - var bgColor, css, div, j, len, rgb, s, styleSheet; - if (g.SITE.software === 'yotsuba') { - $.rmClass(doc, style); - style = null; - for (j = 0, len = styleSheets.length; j < len; j++) { - styleSheet = styleSheets[j]; - if (styleSheet.href === (mainStyleSheet != null ? mainStyleSheet.href : void 0)) { - style = styleSheet.title.toLowerCase().replace('new', '').trim().replace(/\s+/g, '-'); - if (style === '_special') { - style = styleSheet.href.match(/[a-z]*(?=[^\/]*$)/)[0]; - } - if (indexOf.call(knownStyles, style) < 0) { - style = null; - } - break; - } - } - if (style) { - $.addClass(doc, style); - $.rm(Main.bgColorStyle); - return; - } - } - div = g.SITE.bgColoredEl(); - div.style.position = 'absolute'; - div.style.visibility = 'hidden'; - $.add(d.body, div); - bgColor = window.getComputedStyle(div).backgroundColor; - $.rm(div); - rgb = bgColor.match(/[\d.]+/g); - if (!/^rgb\(/.test(bgColor)) { - s = window.getComputedStyle(d.body); - bgColor = s.backgroundColor + " " + s.backgroundImage + " " + s.backgroundRepeat + " " + s.backgroundPosition; - } - css = ".dialog, .suboption-list > div:last-of-type, :root.catalog-hover-expand .catalog-container:hover > .post {\n background: " + bgColor + ";\n}\n.unread-mark-read {\n background-color: rgba(" + (rgb.slice(0, 3).join(', ')) + ", " + (0.5 * (rgb[3] || 1)) + ");\n}"; - if ($.luma(rgb) < 100) { - css += ".watch-thread-link {\n background-image: url(\"data:image/svg+xml,\");\n}"; - } - Main.bgColorStyle.textContent = css; - return $.after($.id('fourchanx-css'), Main.bgColorStyle); - }; - $.onExists(d.head, g.SITE.selectors.styleSheet, function(el) { - mainStyleSheet = el; - if (g.SITE.software === 'yotsuba') { - styleSheets = $$('link[rel="alternate stylesheet"]', d.head); - } - new MutationObserver(setStyle).observe(mainStyleSheet, { - attributes: true, - attributeFilter: ['href'] - }); - $.on(mainStyleSheet, 'load', setStyle); - return setStyle(); - }); - if (!mainStyleSheet) { - ref1 = $$('link[rel="stylesheet"]', d.head); - for (j = 0, len = ref1.length; j < len; j++) { - styleSheet = ref1[j]; - $.on(styleSheet, 'load', setStyle); - } - return setStyle(); - } - }, - initReady: function() { - var base, base1, msg; - if (typeof (base = g.SITE).is404 === "function" ? base.is404() : void 0) { - if (g.VIEW === 'thread') { - ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() { - if (Conf['404 Redirect']) { - return Redirect.navigate('thread', { - boardID: g.BOARD.ID, - threadID: g.THREADID, - postID: +location.hash.match(/\d+/) - }, "/" + g.BOARD + "/"); - } - }); - } - return; - } - if (typeof (base1 = g.SITE).isIncomplete === "function" ? base1.isIncomplete() : void 0) { - msg = $.el('div', {innerHTML: "The page didn't load completely.
    Some features may not work unless you reload."}); - $.on($('a', msg), 'click', function() { - return location.reload(); - }); - new Notice('warning', msg); - } - if (g.VIEW === 'catalog') { - return Main.initCatalog(); - } else if (!Index.enabled) { - if (g.SITE.awaitBoard) { - return g.SITE.awaitBoard(Main.initThread); - } else { - return Main.initThread(); - } - } else { - Main.expectInitFinished = true; - return $.event('4chanXInitFinished'); - } - }, - initThread: function() { - var base, base1, board, errors, posts, ref, s, threads; - s = g.SITE.selectors; - if ((board = $(((ref = s.boardFor) != null ? ref[g.VIEW] : void 0) || s.board))) { - threads = []; - posts = []; - errors = []; - try { - if (typeof (base = g.SITE).preParsingFixes === "function") { - base.preParsingFixes(board); - } - } catch (error1) {} - Main.addThreadsObserver = new MutationObserver(Main.addThreads); - Main.addPostsObserver = new MutationObserver(Main.addPosts); - Main.addThreadsObserver.observe(board, { - childList: true - }); - Main.parseThreads($$(s.thread, board), threads, posts, errors); - if (errors.length) { - Main.handleErrors(errors); - } - if (g.VIEW === 'thread') { - if (g.threadArchived) { - threads[0].isArchived = true; - threads[0].kill(); - } - if (typeof (base1 = g.SITE).parseThreadMetadata === "function") { - base1.parseThreadMetadata(threads[0]); - } - } - Main.callbackNodes('Thread', threads); - return Main.callbackNodesDB('Post', posts, function() { - var j, len, post; - for (j = 0, len = posts.length; j < len; j++) { - post = posts[j]; - QuoteThreading.insert(post); - } - Main.expectInitFinished = true; - return $.event('4chanXInitFinished'); - }); - } else { - Main.expectInitFinished = true; - return $.event('4chanXInitFinished'); - } - }, - parseThreads: function(threadRoots, threads, posts, errors) { - var boardID, boardObj, j, len, postRoots, ref, thread, threadID, threadRoot; - for (j = 0, len = threadRoots.length; j < len; j++) { - threadRoot = threadRoots[j]; - boardObj = (boardID = threadRoot.dataset.board) ? (boardID = encodeURIComponent(boardID), g.boards[boardID] || new Board(boardID)) : g.BOARD; - threadID = +threadRoot.id.match(/\d*$/)[0]; - if (!threadID || ((ref = boardObj.threads.get(threadID)) != null ? ref.nodes.root : void 0)) { - return; - } - thread = new Thread(threadID, boardObj); - thread.nodes.root = threadRoot; - threads.push(thread); - postRoots = $$(g.SITE.selectors.postContainer, threadRoot); - if (g.SITE.isOPContainerThread) { - postRoots.unshift(threadRoot); - } - Main.parsePosts(postRoots, thread, posts, errors); - Main.addPostsObserver.observe(threadRoot, { - childList: true - }); - } - }, - parsePosts: function(postRoots, thread, posts, errors) { - var err, j, len, postRoot; - for (j = 0, len = postRoots.length; j < len; j++) { - postRoot = postRoots[j]; - if (!(postRoot.dataset.fullID && g.posts.get(postRoot.dataset.fullID)) && $(g.SITE.selectors.comment, postRoot)) { - try { - posts.push(new Post(postRoot, thread, thread.board)); - } catch (error1) { - err = error1; - errors.push({ - message: "Parsing of Post No." + (postRoot.id.match(/\d+/)) + " failed. Post will be skipped.", - error: err, - html: postRoot.outerHTML - }); - } - } - } - }, - addThreads: function(records) { - var errors, j, k, len, len1, node, posts, record, ref, threadRoots, threads; - threadRoots = []; - for (j = 0, len = records.length; j < len; j++) { - record = records[j]; - ref = record.addedNodes; - for (k = 0, len1 = ref.length; k < len1; k++) { - node = ref[k]; - if (node.nodeType === Node.ELEMENT_NODE && node.matches(g.SITE.selectors.thread)) { - threadRoots.push(node); - } - } - } - if (!threadRoots.length) { - return; - } - threads = []; - posts = []; - errors = []; - Main.parseThreads(threadRoots, threads, posts, errors); - if (errors.length) { - Main.handleErrors(errors); - } - Main.callbackNodes('Thread', threads); - return Main.callbackNodesDB('Post', posts, function() { - return $.event('PostsInserted', null, records[0].target); - }); - }, - addPosts: function(records) { - var anyRemoved, el, errors, j, k, l, len, len1, len2, n, node, postRoots, posts, record, ref, ref1, ref2, thread, threads, threadsRM; - threads = []; - threadsRM = []; - posts = []; - errors = []; - for (j = 0, len = records.length; j < len; j++) { - record = records[j]; - thread = Get.threadFromRoot(record.target); - postRoots = []; - ref = record.addedNodes; - for (k = 0, len1 = ref.length; k < len1; k++) { - node = ref[k]; - if (node.nodeType === Node.ELEMENT_NODE) { - if (node.matches(g.SITE.selectors.postContainer) || (node = $(g.SITE.selectors.postContainer, node))) { - postRoots.push(node); - } - } - } - n = posts.length; - Main.parsePosts(postRoots, thread, posts, errors); - if (posts.length > n && indexOf.call(threads, thread) < 0) { - threads.push(thread); - } - anyRemoved = false; - ref1 = record.removedNodes; - for (l = 0, len2 = ref1.length; l < len2; l++) { - el = ref1[l]; - if (((ref2 = Get.postFromRoot(el)) != null ? ref2.nodes.root : void 0) === el && !doc.contains(el)) { - anyRemoved = true; - break; - } - } - if (anyRemoved && indexOf.call(threadsRM, thread) < 0) { - threadsRM.push(thread); - } - } - if (errors.length) { - Main.handleErrors(errors); - } - return Main.callbackNodesDB('Post', posts, function() { - var len3, len4, m, o; - for (m = 0, len3 = threads.length; m < len3; m++) { - thread = threads[m]; - $.event('PostsInserted', null, thread.nodes.root); - } - for (o = 0, len4 = threadsRM.length; o < len4; o++) { - thread = threadsRM[o]; - $.event('PostsRemoved', null, thread.nodes.root); - } - }); - }, - initCatalog: function() { - var board, errors, s, threads; - s = g.SITE.selectors.catalog; - if (s && (board = $(s.board))) { - threads = []; - errors = []; - Main.addCatalogThreadsObserver = new MutationObserver(Main.addCatalogThreads); - Main.addCatalogThreadsObserver.observe(board, { - childList: true - }); - Main.parseCatalogThreads($$(s.thread, board), threads, errors); - if (errors.length) { - Main.handleErrors(errors); - } - Main.callbackNodes('CatalogThreadNative', threads); - } - Main.expectInitFinished = true; - return $.event('4chanXInitFinished'); - }, - parseCatalogThreads: function(threadRoots, threads, errors) { - var err, j, len, ref, thread, threadRoot; - for (j = 0, len = threadRoots.length; j < len; j++) { - threadRoot = threadRoots[j]; - try { - thread = new CatalogThreadNative(threadRoot); - if (((ref = thread.thread.catalogViewNative) != null ? ref.nodes.root : void 0) !== threadRoot) { - thread.thread.catalogViewNative = thread; - threads.push(thread); - } - } catch (error1) { - err = error1; - errors.push({ - message: "Parsing of Catalog Thread No." + ((threadRoot.dataset.id || threadRoot.id).match(/\d+/)) + " failed. Thread will be skipped.", - error: err, - html: threadRoot.outerHTML - }); - } - } - }, - addCatalogThreads: function(records) { - var errors, j, k, len, len1, node, record, ref, threadRoots, threads; - threadRoots = []; - for (j = 0, len = records.length; j < len; j++) { - record = records[j]; - ref = record.addedNodes; - for (k = 0, len1 = ref.length; k < len1; k++) { - node = ref[k]; - if (node.nodeType === Node.ELEMENT_NODE && node.matches(g.SITE.selectors.catalog.thread)) { - threadRoots.push(node); - } - } - } - if (!threadRoots.length) { - return; - } - threads = []; - errors = []; - Main.parseCatalogThreads(threadRoots, threads, errors); - if (errors.length) { - Main.handleErrors(errors); - } - return Main.callbackNodes('CatalogThreadNative', threads); - }, - callbackNodes: function(klass, nodes) { - var cb, i, node; - i = 0; - cb = Callbacks[klass]; - while (node = nodes[i++]) { - cb.execute(node); - } - }, - callbackNodesDB: function(klass, nodes, cb) { - var cbs, fn, i, softTask; - i = 0; - cbs = Callbacks[klass]; - fn = function() { - var node; - if (!(node = nodes[i])) { - return false; - } - cbs.execute(node); - return ++i % 25; - }; - softTask = function() { - while (fn()) { - continue; - } - if (!nodes[i]) { - if (cb) { - cb(); - } - return; - } - return setTimeout(softTask, 0); - }; - return softTask(); - }, - handleErrors: function(errors) { - var div, enabled, error, j, len, logs, msg; - if (d.body && $.hasClass(d.body, 'fourchan_x') && !$.hasClass(doc, 'tainted')) { - new Notice('error', 'Error: Multiple copies of 4chan X are enabled.'); - $.addClass(doc, 'tainted'); - } - if (g.SITE.testNativeExtension && !$.hasClass(doc, 'tainted')) { - enabled = g.SITE.testNativeExtension().enabled; - if (enabled) { - $.addClass(doc, 'tainted'); - if (Conf['Disable Native Extension'] && !Main.isFirstRun) { - msg = $.el('div', {innerHTML: "Failed to disable the native extension. You may need to block it."}); - new Notice('error', msg); - } - } - } - if (!(errors instanceof Array)) { - error = errors; - } else if (errors.length === 1) { - error = errors[0]; - } - if (error) { - new Notice('error', Main.parseError(error, Main.reportLink([error])), 15); - return; - } - div = $.el('div', {innerHTML: E(errors.length) + " errors occurred." + (Main.reportLink(errors)).innerHTML + " [show]"}); - $.on(div.lastElementChild, 'click', function() { - var ref; - return ref = this.textContent === 'show' ? ['hide', false] : ['show', true], this.textContent = ref[0], logs.hidden = ref[1], ref; - }); - logs = $.el('div', { - hidden: true - }); - for (j = 0, len = errors.length; j < len; j++) { - error = errors[j]; - $.add(logs, Main.parseError(error)); - } - return new Notice('error', [div, logs], 30); - }, - parseError: function(data, reportLink) { - var context, error, lines, message, ref, ref1; - c.error(data.message, data.error.stack); - message = $.el('div', {innerHTML: E(data.message) + ((reportLink) ? (reportLink).innerHTML : "")}); - error = $.el('div', { - textContent: (data.error.name || 'Error') + ": " + (data.error.message || 'see console for details') - }); - lines = ((ref = data.error.stack) != null ? (ref1 = ref.match(/\d+(?=:\d+\)?$)/mg)) != null ? ref1.join().replace(/^/, ' at ') : void 0 : void 0) || ''; - context = $.el('div', { - textContent: "(4chan X ccd0 v" + g.VERSION + " " + $.platform + " on " + $.engine + lines + ")" - }); - return [message, error, context]; - }, - reportLink: function(errors) { - var addDetails, data, details, info, title, url; - data = errors[0]; - title = data.message; - if (errors.length > 1) { - title += " (+" + (errors.length - 1) + " other errors)"; - } - details = ''; - addDetails = function(text) { - if (!(encodeURIComponent(title + details + text + '\n').length > 8143)) { - return details += text + '\n'; - } - }; - addDetails("[Please describe the steps needed to reproduce this error.]\n\nScript: 4chan X ccd0 v" + g.VERSION + " " + $.platform + "\nURL: " + location.href + "\nUser agent: " + navigator.userAgent); - if ($.platform === 'userscript' && (info = typeof GM !== "undefined" && GM !== null ? GM.info : (typeof GM_info !== "undefined" && GM_info !== null ? GM_info : void 0))) { - addDetails("Userscript manager: " + info.scriptHandler + " " + info.version); - } - addDetails('\n' + data.error); - if (data.error.stack) { - addDetails(data.error.stack.replace(data.error.toString(), '').trim()); - } - if (data.html) { - addDetails('\n`' + data.html + '`'); - } - details = details.replace(/file:\/{3}.+\//g, ''); - url = 'https://github.com/ccd0/4chan-x/issues'.replace('%title', encodeURIComponent(title)).replace('%details', encodeURIComponent(details)); - return {innerHTML: " [report]"}; - }, - isThisPageLegit: function() { - if (!('thisPageIsLegit' in Main)) { - Main.thisPageIsLegit = g.SITE.isThisPageLegit ? g.SITE.isThisPageLegit() : !/^[45]\d\d\b/.test(document.title) && !/\.(?:json|rss)$/.test(location.pathname); - } - return Main.thisPageIsLegit; - }, - ready: function(cb) { - return $.ready(function() { - if (Main.isThisPageLegit()) { - return cb(); - } - }); - }, - mounted: function(cb) { - if (Main.isMounted) { - return cb(); - } else { - return Main.mountedCBs.push(cb); - } - }, - mountedCBs: [], - features: [['Polyfill', Polyfill], ['Board Configuration', BoardConfig], ['Normalize URL', NormalizeURL], ['Delay Redirect on Post', PostRedirect], ['Captcha Configuration', Captcha.replace], ['Image Host Rewriting', ImageHost], ['Redirect', Redirect], ['Header', Header], ['Catalog Links', CatalogLinks], ['Settings', Settings], ['Index Generator', Index], ['Disable Autoplay', AntiAutoplay], ['Announcement Hiding', PSAHiding], ['Fourchan thingies', Fourchan], ['Tinyboard Glue', Tinyboard], ['Color User IDs', IDColor], ['Highlight by User ID', IDHighlight], ['Count Posts by ID', IDPostCount], ['Custom CSS', CustomCSS], ['Thread Links', ThreadLinks], ['Linkify', Linkify], ['Reveal Spoilers', RemoveSpoilers], ['Resurrect Quotes', Quotify], ['Filter', Filter], ['Thread Hiding Buttons', ThreadHiding], ['Reply Hiding Buttons', PostHiding], ['Recursive', Recursive], ['Strike-through Quotes', QuoteStrikeThrough], ['Quick Reply Personas', QR.persona], ['Quick Reply', QR], ['Cooldown', QR.cooldown], ['Post Jumper', PostJumper], ['Pass Link', PassLink], ['Menu', Menu], ['Index Generator (Menu)', Index.menu], ['Report Link', ReportLink], ['Copy Text Link', CopyTextLink], ['Thread Hiding (Menu)', ThreadHiding.menu], ['Reply Hiding (Menu)', PostHiding.menu], ['Delete Link', DeleteLink], ['Filter (Menu)', Filter.menu], ['Edit Link', QR.oekaki.menu], ['Download Link', DownloadLink], ['Archive Link', ArchiveLink], ['Quote Inlining', QuoteInline], ['Quote Previewing', QuotePreview], ['Quote Backlinks', QuoteBacklink], ['Mark Quotes of You', QuoteYou], ['Mark OP Quotes', QuoteOP], ['Mark Cross-thread Quotes', QuoteCT], ['Anonymize', Anonymize], ['Time Formatting', Time], ['Relative Post Dates', RelativeDates], ['File Info Formatting', FileInfo], ['Fappe Tyme', FappeTyme], ['Gallery', Gallery], ['Gallery (menu)', Gallery.menu], ['Sauce', Sauce], ['Image Expansion', ImageExpand], ['Image Expansion (Menu)', ImageExpand.menu], ['Reveal Spoiler Thumbnails', RevealSpoilers], ['Image Loading', ImageLoader], ['Image Hover', ImageHover], ['Volume Control', Volume], ['WEBM Metadata', Metadata], ['Comment Expansion', ExpandComment], ['Thread Expansion', ExpandThread], ['Favicon', Favicon], ['Unread', Unread], ['Unread Line in Index', UnreadIndex], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Watcher', ThreadWatcher], ['Thread Watcher (Menu)', ThreadWatcher.menu], ['Mark New IPs', MarkNewIPs], ['Index Navigation', Nav], ['Keybinds', Keybinds], ['Banner', Banner], ['Announcements', PSA], ['Flash Features', Flash], ['Reply Pruning', ReplyPruning], ['Mod Contact Links', ModContact]] - }; - - return Main; - -}).call(this); - -Main.init(); - -})(); diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx deleted file mode 100644 index d10688ad6..000000000 Binary files a/builds/4chan-X-noupdate.crx and /dev/null differ diff --git a/builds/4chan-X-noupdate.user.js b/builds/4chan-X-noupdate.user.js deleted file mode 100644 index 829078892..000000000 --- a/builds/4chan-X-noupdate.user.js +++ /dev/null @@ -1,27999 +0,0 @@ -// ==UserScript== -// @name 4chan X -// @version 1.14.22.4 -// @minGMVer 1.14 -// @minFFVer 26 -// @namespace 4chan-X -// @description 4chan X is a script that adds various features to anonymous imageboards. -// @license MIT; https://github.com/ccd0/4chan-x/blob/master/LICENSE -// @include http://boards.4chan.org/* -// @include https://boards.4chan.org/* -// @include http://sys.4chan.org/* -// @include https://sys.4chan.org/* -// @include http://www.4chan.org/* -// @include https://www.4chan.org/* -// @include http://boards.4channel.org/* -// @include https://boards.4channel.org/* -// @include http://sys.4channel.org/* -// @include https://sys.4channel.org/* -// @include http://www.4channel.org/* -// @include https://www.4channel.org/* -// @include http://i.4cdn.org/* -// @include https://i.4cdn.org/* -// @include http://is.4chan.org/* -// @include https://is.4chan.org/* -// @include http://is2.4chan.org/* -// @include https://is2.4chan.org/* -// @include http://is.4channel.org/* -// @include https://is.4channel.org/* -// @include http://is2.4channel.org/* -// @include https://is2.4channel.org/* -// @include https://erischan.org/* -// @include https://www.erischan.org/* -// @include https://fufufu.moe/* -// @include https://gnfos.com/* -// @include https://himasugi.blog/* -// @include https://www.himasugi.blog/* -// @include https://kakashinenpo.com/* -// @include https://www.kakashinenpo.com/* -// @include https://kissu.moe/* -// @include https://www.kissu.moe/* -// @include https://lainchan.org/* -// @include https://www.lainchan.org/* -// @include https://merorin.com/* -// @include https://ota-ch.com/* -// @include https://www.ota-ch.com/* -// @include https://ponyville.us/* -// @include https://www.ponyville.us/* -// @include https://smuglo.li/* -// @include https://notso.smuglo.li/* -// @include https://smugloli.net/* -// @include https://smug.nepu.moe/* -// @include https://sportschan.org/* -// @include https://www.sportschan.org/* -// @include https://sushigirl.us/* -// @include https://www.sushigirl.us/* -// @include https://tvch.moe/* -// @exclude http://www.4chan.org/advertise -// @exclude https://www.4chan.org/advertise -// @exclude http://www.4chan.org/advertise?* -// @exclude https://www.4chan.org/advertise?* -// @exclude http://www.4chan.org/donate -// @exclude https://www.4chan.org/donate -// @exclude http://www.4chan.org/donate?* -// @exclude https://www.4chan.org/donate?* -// @exclude http://www.4channel.org/advertise -// @exclude https://www.4channel.org/advertise -// @exclude http://www.4channel.org/advertise?* -// @exclude https://www.4channel.org/advertise?* -// @exclude http://www.4channel.org/donate -// @exclude https://www.4channel.org/donate -// @exclude http://www.4channel.org/donate?* -// @exclude https://www.4channel.org/donate?* -// @connect 4chan.org -// @connect 4channel.org -// @connect 4cdn.org -// @connect 4chenz.github.io -// @connect archive.4plebs.org -// @connect warosu.org -// @connect desuarchive.org -// @connect boards.fireden.net -// @connect arch.b4k.co -// @connect archived.moe -// @connect thebarchive.com -// @connect archiveofsins.com -// @connect www.tokyochronos.net -// @connect archive.palanq.win -// @connect eientei.xyz -// @connect api.clyp.it -// @connect api.dailymotion.com -// @connect api.github.com -// @connect soundcloud.com -// @connect api.streamable.com -// @connect vimeo.com -// @connect www.youtube.com -// @connect * -// @grant GM_getValue -// @grant GM_setValue -// @grant GM_deleteValue -// @grant GM_listValues -// @grant GM_addValueChangeListener -// @grant GM_openInTab -// @grant GM_xmlhttpRequest -// @grant GM.getValue -// @grant GM.setValue -// @grant GM.deleteValue -// @grant GM.listValues -// @grant GM.openInTab -// @grant GM.xmlHttpRequest -// @run-at document-start -// @updateURL https://noupdate.invalid/ -// @downloadURL https://noupdate.invalid/ -// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAF5JREFUeNrtkTESABAQxPD/R6tsE2dUGYUtFJvLDKf93KevHJAjpBorAQWSBIKqFASC4G0pCAkm4GfaEvgYXl0T6HBaE97f0vmnfYHbZOMLZCx9ISdKWwjOWZSC8GYm4SUGwfYgqI4AAAAASUVORK5CYII= -// ==/UserScript== - -/* -* 4chan X -* -* Licensed under the MIT license. -* https://github.com/ccd0/4chan-x/blob/master/LICENSE -* -* Appchan X Copyright © 2013-2016 Zixaphir -* http://zixaphir.github.io/appchan-x/ -* 4chan x Copyright © 2009-2011 James Campos -* https://github.com/aeosynth/4chan-x -* 4chan x Copyright © 2012-2014 Nicolas Stepien -* https://4chan-x.just-believe.in/ -* 4chan x Copyright © 2013-2014 Jordan Bates -* http://seaweedchan.github.io/4chan-x/ -* 4chan x Copyright © 2012-2013 ihavenoface -* http://ihavenoface.github.io/4chan-x/ -* 4chan SS Copyright © 2011-2013 Ahodesuka -* https://github.com/ahodesuka/4chan-Style-Script/ -* -* Permission is hereby granted, free of charge, to any person -* obtaining a copy of this software and associated documentation -* files (the "Software"), to deal in the Software without -* restriction, including without limitation the rights to use, -* copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following -* conditions: -* -* The above copyright notice and this permission notice shall be -* included in all copies or substantial portions of the Software. -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -* OTHER DEALINGS IN THE SOFTWARE. -* -* Contributors: -* aeosynth -* mayhemydg -* noface -* !K.WeEabo0o -* blaise -* that4chanwolf -* desuwa -* seaweed -* e000 -* ahodesuka -* Shou -* ferongr -* xat -* Ongpot -* thisisanon -* Anonymous -* Seiba -* herpaderpderp -* WakiMiko -* btmcsweeney -* AppleBloom -* detharonil -* -* All the people who've taken the time to write bug reports. -* -* Thank you. -*/ - -/* -* Contains data from external sources: -* -* src/Monitoring/ThreadUpdater/beep.wav from http://freesound.org/people/pierrecartoons1979/sounds/90112/ -* cc-by-nc-3.0 -* -* Font Awesome by Dave Gandy (http://fontawesome.io) -* license: http://fontawesome.io/license/ -* -* Icons used to identify various websites are property of the respective websites. -*/ - -(function() { - -'use strict'; - -var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, BoardConfig, CSS, Callbacks, Captcha, CatalogLinks, CatalogThread, CatalogThreadNative, Config, Connection, CopyTextLink, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Flash, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, IDPostCount, ImageCommon, ImageExpand, ImageHost, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, ModContact, Nav, NormalizeURL, Notice, PSA, PSAHiding, PassLink, PassMessage, Polyfill, Post, PostHiding, PostJumper, PostRedirect, PostSuccessful, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, ReplyPruning, Report, ReportLink, RevealSpoilers, SW, Sauce, Settings, ShimSet, SimpleDict, Site, Test, Thread, ThreadHiding, ThreadLinks, ThreadStats, ThreadUpdater, ThreadWatcher, Time, Tinyboard, UI, Unread, UnreadIndex, Volume; - -var Conf, E, c, d, doc, docSet, g; - -Conf = Object.create(null); -c = console; -d = document; -doc = d.documentElement; - -// Workaround for userscript managers that run script before document.documentElement is set -docSet = function() { - return (doc = d.documentElement); -}; - -g = { - VERSION: '1.14.22.4', - NAMESPACE: '4chan X.', - sites: Object.create(null), - boards: Object.create(null) -}; - -E = (function() { - var fn, r, regex, str; - str = { - '&': '&', - "'": ''', - '"': '"', - '<': '<', - '>': '>' - }; - r = String.prototype.replace; - regex = /[&"'<>]/g; - fn = function(x) { - return str[x]; - }; - return function(text) { - return r.call(text, regex, fn); - }; -})(); - -E.cat = function(templates) { - var html, i, len; - html = ''; - for (i = 0, len = templates.length; i < len; i++) { - html += templates[i].innerHTML; - } - return html; -}; - -Config = (function() { - var Config; - - Config = { - main: { - 'Miscellaneous': { - 'Redirect to HTTPS': [true, 'Redirect to the HTTPS version of 4chan.'], - 'JSON Index': [true, 'Replace the original board index with one supporting searching, sorting, infinite scrolling, and a catalog mode.'], - 'Use 4chan X Catalog': [true, 'Link to 4chan X\'s catalog instead of the native 4chan one.', 1], - 'Index Refresh Notifications': [false, 'Show a notice at the top of the page when the index is refreshed.', 1], - 'Follow Cursor': [true, 'Image Hover and Quote Preview move with the mouse cursor.'], - 'Open Threads in New Tab': [false, 'Make links to threads in the index / 4chan X catalog open in a new tab.'], - 'External Catalog': [false, 'Link to external catalog instead of the internal one.'], - 'Catalog Links': [false, 'Add toggle link in header menu to turn Navigation links into links to each board\'s catalog.'], - 'Announcement Hiding': [true, 'Add button to hide 4chan announcements.'], - 'Desktop Notifications': [true, 'Enables desktop notifications across various 4chan X features.'], - '404 Redirect': [true, 'Redirect dead threads and images to the archives.'], - 'Archive Report': [true, 'Enable reporting posts to supported archives.'], - 'Exempt Archives from Encryption': [true, 'Permit loading content from, and warningless redirects to, HTTP-only archives from HTTPS pages.'], - 'Keybinds': [true, 'Bind actions to keyboard shortcuts.'], - 'Time Formatting': [true, 'Localize and format timestamps.'], - 'Relative Post Dates': [true, 'Display dates like "3 minutes ago". Tooltip shows the timestamp.'], - 'Relative Date Title': [true, 'Show Relative Post Date only when hovering over dates.', 1], - 'Comment Expansion': [true, 'Expand comments that are too long to display on the index. Not applicable with JSON Index.'], - 'File Info Formatting': [true, 'Reformat the file information.'], - 'Thread Expansion': [true, 'Add buttons to expand threads.'], - 'Index Navigation': [false, 'Add buttons to navigate between threads.'], - 'Reply Navigation': [false, 'Add buttons to navigate to top / bottom of thread.'], - 'Unique ID and Capcode Navigation': [false, 'Add buttons to navigate to posts having the same unique ID or capcode.'], - 'Custom Board Titles': [true, 'Allow editing of the board title and subtitle by ctrl/\u2318+clicking them.'], - 'Persistent Custom Board Titles': [false, 'Force custom board titles to be persistent, even if the board titles are updated.', 1], - 'Show Updated Notifications': [true, 'Show notifications when 4chan X is successfully updated.'], - 'Color User IDs': [true, 'Assign unique colors to user IDs on boards that use them'], - 'Count Posts by ID': [true, 'Display number of posts in the thread when hovering over an ID.'], - 'Remove Spoilers': [false, 'Remove all spoilers in text.'], - 'Reveal Spoilers': [false, 'Indicate spoilers if Remove Spoilers is enabled, or make the text appear hovered if Remove Spoiler is disabled.'], - 'Normalize URL': [true, 'Rewrite the URL of the current page, removing slugs and excess slashes, and changing /res/ to /thread/.'], - 'Work around CORB Bug': [true, 'Leave this checked until your garbage browser is fixed.'], - 'Disable Autoplaying Sounds': [false, 'Prevent sounds on the page from autoplaying.'], - 'Disable Native Extension': [true, '4chan X is NOT designed to work with the native extension.'], - 'Enable Native Flash Embedding': [true, 'Activate the native extension\'s Flash embedding if the native extension is disabled.'] - }, - 'Linkification': { - 'Linkify': [true, 'Convert text into links where applicable.'], - 'Link Title': [true, 'Replace the link of a supported site with its actual title.', 1], - 'Cover Preview': [true, 'Show preview of supported links on hover.', 1], - 'Embedding': [true, 'Embed supported services. Note: Some services don\'t work on HTTPS.', 1], - 'Auto-embed': [false, 'Auto-embed Linkify Embeds.', 2], - 'Floating Embeds': [false, 'Embed content in a frame that remains in place when the page is scrolled.', 2] - }, - 'Filtering': { - 'Anonymize': [false, 'Make everyone Anonymous.'], - 'Filter': [true, 'Self-moderation placebo.'], - 'Filtered Backlinks': [false, 'When enabled, shows backlinks to filtered posts with a line-through decoration. Otherwise, hides the backlinks.', 1], - 'Filter in Native Catalog': [true, 'Apply 4chan X filters in native catalog.', 1], - 'MD5 Quick Filter Notifications': [true, 'Show notification when quick filtering MD5s using the button or keybind.', 1], - 'Recursive Hiding': [true, 'Hide replies of hidden posts, recursively.'], - 'Thread Hiding Buttons': [true, 'Add buttons to hide entire threads.'], - 'Reply Hiding Buttons': [true, 'Add buttons to hide single replies.'], - 'Stubs': [true, 'Show stubs of hidden threads / replies.'] - }, - 'Images and Videos': { - 'Image Expansion': [true, 'Expand images / videos.'], - 'Image Hover': [true, 'Show full image / video on mouseover.'], - 'Image Hover in Catalog': [true, 'Show full image / video on mouseover in 4chan X catalog.'], - 'Gallery': [true, 'Adds a simple and cute image gallery. Has more options in the gallery menu.'], - 'Fullscreen Gallery': [false, 'Open gallery in fullscreen mode.', 1], - 'PDF in Gallery': [false, 'Show PDF files in gallery.', 1], - 'Sauce': [true, 'Add sauce links to images.'], - 'WEBM Metadata': [true, 'Add link to fetch title metadata from webm videos.'], - 'Reveal Spoiler Thumbnails': [false, 'Replace spoiler thumbnails with the original image.'], - 'Replace GIF': [false, 'Replace gif thumbnails with the actual image.'], - 'Replace JPG': [false, 'Replace jpg thumbnails with the actual image.'], - 'Replace PNG': [false, 'Replace png thumbnails with the actual image.'], - 'Replace WEBM': [false, 'Replace webm, mp4, and ogv thumbnails with the actual video. Probably will degrade browser performance ;)'], - 'Image Prefetching': [true, 'Add a shortcut icon to the header to turn on image preloading.'], - 'Fappe Tyme': [true, 'Hide posts without images when header menu item is checked. *hint* *hint*'], - 'Werk Tyme': [true, 'Hide all post images when header menu item is checked.'], - 'Autoplay': [true, 'Videos begin playing immediately when opened.'], - 'Restart when Opened': [false, 'Restart GIFs and WebMs when you hover over or expand them.'], - 'Show Controls': [true, 'Show controls on videos expanded inline.'], - 'Click Passthrough': [false, 'Clicks on videos trigger your browser\'s default behavior. Videos can be contracted with button / dragging to the left.', 1], - 'Allow Sound': [true, 'Open videos with the sound unmuted.'], - 'Mouse Wheel Volume': [true, 'Adjust volume of videos with the mouse wheel over the thumbnail/filename/gallery.'], - 'Loop in New Tab': [true, 'Loop videos opened in their own tabs.'], - 'Volume in New Tab': [true, 'Apply 4chan X mute and volume settings to videos opened in their own tabs.'] - }, - 'Menu': { - 'Menu': [true, 'Add a drop-down menu to posts.'], - 'Report Link': [true, 'Add a report link to the menu.', 1], - 'Copy Text Link': [true, 'Add a link to copy the post\'s text.', 1], - 'Thread Hiding Link': [true, 'Add a link to hide entire threads.', 1], - 'Reply Hiding Link': [true, 'Add a link to hide single replies.', 1], - 'Delete Link': [true, 'Add post and image deletion links to the menu.', 1], - 'Archive Link': [true, 'Add an archive link to the menu.', 1], - 'Edit Link': [true, 'Add a link to edit the image in Tegaki, /i/\'s painting program. Requires Quick Reply.', 1], - 'Download Link': [false, 'Add a download with original filename link to the menu.', 1] - }, - 'Monitoring': { - 'Thread Updater': [true, 'Fetch and insert new replies. Has more options in the header menu and the "Advanced" tab.'], - 'Unread Count': [true, 'Show the unread posts count in the tab title.'], - 'Quoted Title': [false, 'Change the page title to reflect you\'ve been quoted.', 1], - 'Hide Unread Count at (0)': [false, 'Hide the unread posts count in the tab title when it reaches 0.', 1], - 'Unread Favicon': [true, 'Show a different favicon when there are unread posts.'], - 'Unread Line': [true, 'Show a line to distinguish read posts from unread ones.'], - 'Remember Last Read Post': [true, 'Remember how far you\'ve read after you close the thread.'], - 'Scroll to Last Read Post': [true, 'Scroll back to the last read post when reopening a thread.', 1], - 'Unread Line in Index': [false, 'Show a line between read and unread posts in threads in the index.', 1], - 'Remove Thread Excerpt': [false, 'Replace the excerpt of the thread in the tab title with the board title.'], - 'Thread Stats': [true, 'Display reply and image count.'], - 'IP Count in Stats': [true, 'Display the unique IP count in the thread stats.', 1], - 'Page Count in Stats': [true, 'Display the page count in the thread stats.', 1], - 'Updater and Stats in Header': [true, 'Places the thread updater and thread stats in the header instead of floating them.'], - 'Thread Watcher': [true, 'Bookmark threads. Has more options in the thread watcher menu.'], - 'Fixed Thread Watcher': [true, 'Makes the thread watcher scroll with the page.', 1], - 'Persistent Thread Watcher': [false, 'The thread watcher will be visible when the page is loaded.', 1], - 'Mark New IPs': [false, 'Label each post from a new IP with the thread\'s current IP count.'], - 'Reply Pruning': [true, 'Add option in header menu to hide old replies in long threads. Activated by default in stickies.'], - 'Prune All Threads': [false, 'Activate Reply Pruning by default in all threads.', 1] - }, - 'Posting and Captchas': { - 'Quick Reply': [true, 'All-in-one form to reply, create threads, automate dumping and more.'], - 'Persistent QR': [false, 'The Quick reply won\'t disappear after posting.', 1], - 'Auto Hide QR': [true, 'Automatically hide the quick reply when posting.', 2], - 'Open Post in New Tab': [true, 'Open new threads in a new tab, and open replies in a new tab if you\'re not already in the thread.', 1], - 'Remember QR Size': [false, 'Remember the size of the Quick reply.', 1], - 'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.', 1], - 'Randomize Filename': [false, 'Set the filename to a random timestamp within the past year. Disabled on /f/.', 1], - 'Show New Thread Option in Threads': [true, 'Show the option to post a new / different thread from inside a thread.', 1], - 'Show Upload Progress': [true, 'Track progress of file uploads as percentage in submit button.', 1], - 'Cooldown': [true, 'Indicate the remaining time before posting again.', 1], - 'Posting Success Notifications': [true, 'Show notifications on successful post creation or file uploading.', 1], - 'Auto-load captcha': [false, 'Automatically load the captcha in the QR even if your post is empty.', 1], - 'Post on Captcha Completion': [false, 'Submit the post immediately when the captcha is completed.', 1], - 'Force Noscript Captcha': [false, 'Use the non-Javascript fallback captcha even if Javascript is enabled.'], - 'Pass Link': [false, 'Add a 4chan Pass login link to the bottom of the page.'] - }, - 'Quote Links': { - 'Quote Backlinks': [true, 'Add quote backlinks.'], - 'OP Backlinks': [true, 'Add backlinks to the OP.', 1], - 'Bottom Backlinks': [false, 'Place backlinks at the bottom of posts.', 1], - 'Quote Inlining': [true, 'Inline quoted post on click.'], - 'Inline Cross-thread Quotes Only': [false, 'Don\'t inline quote links when the posts are visible in the thread.', 1], - 'Quote Hash Navigation': [false, 'Include an extra link after quotes for autoscrolling to quoted posts.', 1], - 'Forward Hiding': [true, 'Hide original posts of inlined backlinks.', 1], - 'Quote Previewing': [true, 'Show quoted post on hover.'], - 'Quote Highlighting': [true, 'Highlight the previewed post.', 1], - 'Resurrect Quotes': [true, 'Link dead quotes to the archives, and support inlining/previewing of archive links like quote links.'], - 'Remember Your Posts': [true, 'Remember your posting history.'], - 'Mark Quotes of You': [true, 'Add \'(You)\' to quotes linking to your posts.', 1], - 'Highlight Posts Quoting You': [true, 'Highlights any posts that contain a quote to your post.', 1], - 'Highlight Own Posts': [true, 'Highlights own posts.', 1], - 'Mark OP Quotes': [true, 'Add \'(OP)\' to OP quotes.'], - 'Mark Cross-thread Quotes': [true, 'Add \'(Cross-thread)\' to cross-threads quotes.'], - 'Quote Threading': [true, 'Add option in header menu to thread conversations.'] - } - }, - imageExpansion: { - 'Fit width': [true, ''], - 'Fit height': [false, ''], - 'Scroll into view': [true, 'Scroll down when expanding images to bring the full image into view.'], - 'Expand spoilers': [true, 'Expand all images along with spoilers.'], - 'Expand videos': [true, 'Expand all images also expands videos.'], - 'Expand from here': [false, 'Expand all images only from current position to thread end.'], - 'Expand thread only': [false, 'In index, expand all images only within the current thread.'], - 'Advance on contract': [false, 'Advance to next post when contracting an expanded image.'] - }, - gallery: { - 'Hide Thumbnails': [false], - 'Fit Width': [true], - 'Fit Height': [true], - 'Stretch to Fit': [false], - 'Scroll to Post': [true], - 'Slide Delay': [6.0] - }, - 'Default Volume': 1.0, - threadWatcher: { - 'Current Board': [false, 'Only show watched threads from the current board.'], - 'Auto Update Thread Watcher': [true, 'Periodically check status of watched threads.'], - 'Auto Watch': [true, 'Automatically watch threads you start.'], - 'Auto Watch Reply': [true, 'Automatically watch threads you reply to.'], - 'Auto Prune': [false, 'Automatically remove dead threads.'], - 'Show Page': [true, 'Show what page watched threads are on.'], - 'Show Unread Count': [true, 'Show number of unread posts in watched threads.'], - 'Show Site Prefix': [true, 'When multiple sites are shown in the thread watcher, add a prefix to board names to distinguish them.'], - 'Require OP Quote Link': [false, 'For purposes of thread watcher highlighting, only consider posts with a quote link to the OP as replies to the OP.'] - }, - filter: { - general: '', - postID: "# Highlight dubs on [s4s]:\n#/(\\d)\\1$/;highlight;top:no;boards:s4s", - name: "# Filter any namefags:\n#/^(?!Anonymous$)/", - uniqueID: "# Filter a specific ID:\n#/Txhvk1Tl/", - tripcode: "# Filter any tripfag\n#/^!/", - capcode: "# Set a custom class for mods:\n#/Mod$/;highlight:mod;op:yes\n# Set a custom class for admins:\n#/Admin$/;highlight:admin;op:yes", - pass: "# Filter anyone using since4pass:\n#/./", - email: '', - subject: "# Filter Generals on /v/:\n#/general/i;boards:v;op:only", - comment: "# Filter Stallman copypasta on /g/:\n#/what you\'re refer+ing to as linux/i;boards:g\n# Filter posts with 20 or more quote links:\n#/(?:>>\\d(?:(?!>>\\d)[^])*){20}/\n# Filter posts like T H I S / H / I / S:\n#/^>?\\s?\\w\\s?(\\w)\\s?(\\w)\\s?(\\w).*$[\\s>]+\\1[\\s>]+\\2[\\s>]+\\3/im", - flag: '', - filename: '', - dimensions: "# Highlight potential wallpapers:\n#/1920x1080/;op:yes;highlight;top:no;boards:w,wg", - filesize: '', - MD5: '' - }, - sauces: "# Known filename formats:\nhttps://www.pixiv.net/member_illust.php?mode=medium&illust_id=%$1;regexp:/^(\\d+)_p\\d+/\njavascript:void(open(\"https://www.deviantart.com/\"+%$1.replace(/_/g,\"-\")+\"/art/\"+parseInt(%$2,36)));regexp:/^\\w+_by_(\\w+)[_-]d([\\da-z]{6})\\b/\nhttps://imgur.com/%$1;regexp:/^(?![a-zA-Z][a-z]{6})(?![A-Z]{7})(?!\\d{7})([\\da-zA-Z]{7})(?: \\(\\d+\\))?\\.\\w+$/\nhttps://flickr.com/photo.gne?id=%$1;regexp:/^(\\d+)_[\\da-f]{10}(?:_\\w)*\\b/\nhttps://www.facebook.com/photo.php?fbid=%$1;regexp:/^\\d+_(\\d+)_\\d+_[no]\\b/\n\n# Reverse image search:\nhttps://www.google.com/searchbyimage?sbisrc=4chanx&image_url=%IMG&safe=off\nhttps://yandex.com/images/search?rpt=imageview&url=%IMG\n#//tineye.com/search?url=%IMG\n#//www.bing.com/images/search?q=imgurl:%IMG&view=detailv2&iss=sbi#enterInsights\n#https://lens.google.com/uploadbyurl?url=%IMG;text:lens\n\n# Specialized reverse image search:\n//iqdb.org/?url=%IMG\nhttps://trace.moe/?auto&url=%IMG;text:wait\n#//3d.iqdb.org/?url=%IMG\n#//saucenao.com/search.php?url=%IMG\n\n# \"View Same\" in archives:\nhttp://eye.swfchan.com/search/?q=%name;types:swf\n#https://desuarchive.org/_/search/image/%sMD5/\n#https://archive.4plebs.org/_/search/image/%sMD5/\n#https://boards.fireden.net/_/search/image/%sMD5/\n#https://foolz.fireden.net/_/search/image/%sMD5/\n\n# Other tools:\n#http://exif.regex.info/exif.cgi?imgurl=%URL\n#//imgops.com/start?url=%URL;types:gif,jpg,png\n#//www.gif-explode.com/%URL;types:gif", - FappeT: { - werk: false - }, - 'Custom CSS': true, - Index: { - 'Index Mode': 'paged', - 'Previous Index Mode': 'paged', - 'Index Size': 'small', - 'Show Replies': [true, 'Show replies in the index, and also in the catalog if "Catalog hover expand" is checked.'], - 'Catalog Hover Expand': [false, 'Expand the comment and show more details when you hover over a thread in the catalog.'], - 'Catalog Hover Toggle': [true, 'Turn "Catalog hover expand" on and off by clicking in the catalog.'], - 'Pin Watched Threads': [false, 'Move watched threads to the start of the index.'], - 'Anchor Hidden Threads': [true, 'Move hidden threads to the end of the index.'], - 'Refreshed Navigation': [false, 'Refresh index when navigating through pages.'] - }, - Header: { - 'Fixed Header': true, - 'Header auto-hide': false, - 'Header auto-hide on scroll': false, - 'Bottom Header': false, - 'Centered links': false, - 'Header catalog links': false, - 'Bottom Board List': true, - 'Shortcut Icons': true, - 'Custom Board Navigation': true - }, - archives: { - archiveLists: 'https://4chenz.github.io/archives.json/archives.json', - lastarchivecheck: 0, - archiveAutoUpdate: true - }, - externalCatalogURLs: "//catalog.neet.tv/%board/;boards:4chan.org:3,a,adv,an,asp,biz,c,cgl,ck,cm,co,diy,f,fa,fit,g,gd,his,i,int,jp,k,lgbt,lit,m,mlp,mu,n,news,o,out,p,po,pol,s4s,sci,sp,tg,toy,trv,tv,v,vg,vip,vp,vr,w,wg,wsg,wsr,x", - boardnav: "[ toggle-all ]\n[current-index-text:\"Index\"\ncurrent-catalog-text:\"Catalog\"\ncurrent-expired-text:\"Expired\"\ncurrent-archive-text:\"Archive\"]\n[external-text:\"FAQ\",\"https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions\"]", - QR: { - 'QR.personas': "#options:\"sage\";boards:jp;always", - sjisPreview: false - }, - jsWhitelist: 'http://s.4cdn.org\nhttps://s.4cdn.org\nhttp://www.google.com\nhttps://www.google.com\nhttps://www.gstatic.com\nhttp://cdn.mathjax.org\nhttps://cdn.mathjax.org\nhttps://cdnjs.cloudflare.com\nhttps://hcaptcha.com\nhttps://*.hcaptcha.com\n\'self\'\n\'unsafe-inline\'\n\'unsafe-eval\'', - captchaLanguage: '', - time: '%m/%d/%y(%a)%H:%M:%S', - timeLocale: '', - backlink: '>>%id', - pastedname: 'file', - fileInfo: '%l %d (%p%s, %r%g)', - favicon: 'ferongr', - usercss: "/* Board title rice */\ndiv.boardTitle {\n font-weight: 400 !important;\n}\n:root.yotsuba div.boardTitle {\n font-family: sans-serif !important;\n text-shadow: 1px 1px 1px rgba(100,0,0,0.6);\n}\n:root.yotsuba-b div.boardTitle {\n font-family: sans-serif !important;\n text-shadow: 1px 1px 1px rgba(105,10,15,0.6);\n}\n:root.photon div.boardTitle {\n font-family: sans-serif !important;\n text-shadow: 1px 1px 1px rgba(0,74,153,0.6);\n}\n:root.tomorrow div.boardTitle {\n font-family: sans-serif !important;\n text-shadow: 1px 1px 1px rgba(167,170,168,0.6);\n}\n", - hotkeys: { - 'Toggle board list': ['Ctrl+b', 'Toggle the full board list.'], - 'Toggle header': ['Shift+h', 'Toggle the auto-hide option of the header.'], - 'Open empty QR': ['q', 'Open QR without post number inserted.'], - 'Open QR': ['Shift+q', 'Open QR with post number inserted.'], - 'Open settings': ['Alt+o', 'Open Settings.'], - 'Close': ['Esc', 'Close dialogs or notifications.'], - 'Spoiler tags': ['Ctrl+s', 'Insert spoiler tags.'], - 'Code tags': ['Alt+c', 'Insert code tags.'], - 'Eqn tags': ['Alt+e', 'Insert eqn tags.'], - 'Math tags': ['Alt+m', 'Insert math tags.'], - 'SJIS tags': ['Alt+a', 'Insert SJIS tags.'], - 'Toggle sage': ['Alt+s', 'Toggle sage in options field.'], - 'Toggle Cooldown': ['Alt+Comma', 'Toggle custom cooldown timer.'], - 'Post from URL': ['Alt+l', 'Post from URL.'], - 'Add new post': ['Alt+n', 'Add new post to the QR dump list.'], - 'Submit QR': ['Ctrl+Enter', 'Submit post.'], - 'Watch': ['w', 'Watch thread.'], - 'Update': ['r', 'Update the thread / refresh the index.'], - 'Update thread watcher': ['Shift+r', 'Manually refresh thread watcher.'], - 'Toggle thread watcher': ['t', 'Toggle visibility of thread watcher.'], - 'Toggle threading': ['Shift+t', 'Toggle threading.'], - 'Mark thread read': ['Ctrl+0', 'Mark thread read from index (requires "Unread Line in Index").'], - 'Expand image': ['Shift+e', 'Expand selected image.'], - 'Expand images': ['e', 'Expand all images.'], - 'Open Gallery': ['g', 'Opens the gallery.'], - 'Next Gallery Image': ['Right', 'Go to the next image in gallery mode.'], - 'Previous Gallery Image': ['Left', 'Go to the previous image in gallery mode.'], - 'Advance Gallery': ['Enter', 'Go to next image or, if Autoplay is off, play video.'], - 'Pause': ['p', 'Pause/play videos in the gallery.'], - 'Slideshow': ['Ctrl+Right', 'Toggle the gallery slideshow mode.'], - 'Rotate image clockwise': ['Shift+Right', 'Rotate image clockwise in gallery.'], - 'Rotate image anticlockwise': ['Shift+Left', 'Rotate image anticlockwise in gallery.'], - 'Download Gallery Image': ['Shift+j', 'Download current image in gallery.'], - 'fappeTyme': ['f', 'Toggle Fappe Tyme.'], - 'werkTyme': ['Shift+w', 'Toggle Werk Tyme.'], - 'Front page': ['1', 'Jump to front page.'], - 'Open front page': ['Shift+1', 'Open front page in a new tab.'], - 'Next page': ['Ctrl+Right', 'Jump to the next page.'], - 'Previous page': ['Ctrl+Left', 'Jump to the previous page.'], - 'Paged mode': ['Alt+1', 'Open the index in paged mode.'], - 'Infinite scrolling mode': ['Alt+2', 'Open the index in infinite scrolling mode.'], - 'All pages mode': ['Alt+3', 'Open the index in all threads mode.'], - 'Open catalog': ['Shift+c', 'Open the catalog of the current board.'], - 'Search form': ['Ctrl+Alt+s', 'Focus the search field on the board index.'], - 'Cycle sort type': ['Alt+x', 'Cycle through index sort types.'], - 'Next thread': ['Ctrl+Down', 'See next thread.'], - 'Previous thread': ['Ctrl+Up', 'See previous thread.'], - 'Expand thread': ['Ctrl+e', 'Expand thread.'], - 'Open thread': ['o', 'Open thread in current tab.'], - 'Open thread tab': ['Shift+o', 'Open thread in new tab.'], - 'Next reply': ['j', 'Select next reply.'], - 'Previous reply': ['k', 'Select previous reply.'], - 'Deselect reply': ['Shift+d', 'Deselect reply.'], - 'Hide': ['x', 'Hide thread.'], - 'Quick Filter MD5': ['5', 'Add the MD5 of the selected image to the filter list.'], - 'Previous Post Quoting You': ['Alt+Up', 'Scroll to the previous post that quotes you.'], - 'Next Post Quoting You': ['Alt+Down', 'Scroll to the next post that quotes you.'] - }, - updater: { - checkbox: { - 'Beep': [false, 'Beep on new post to completely read thread.'], - 'Beep Quoting You': [false, 'Beep on new post quoting you.'], - 'Auto Scroll': [false, 'Scroll updated posts into view. Only enabled at bottom of page.'], - 'Bottom Scroll': [false, 'Always scroll to the bottom, not the first new post. Useful for event threads.'], - 'Scroll BG': [false, 'Auto-scroll background tabs.'], - 'Auto Update': [true, 'Automatically fetch new posts.'], - 'Optional Increase': [false, 'Increase the intervals between updates on threads without new posts.'] - }, - 'Interval': 5 - }, - customCooldown: 0, - customCooldownEnabled: true, - 'Thread Quotes': false, - 'Max Replies': 1000, - 'Autohiding Scrollbar': false, - position: { - 'embedding.position': 'top: 50px; right: 0px;', - 'thread-stats.position': 'bottom: 0px; right: 0px;', - 'updater.position': 'bottom: 0px; left: 0px;', - 'thread-watcher.position': 'top: 50px; left: 0px;', - 'qr.position': 'top: 50px; right: 0px;' - }, - fourchanImageHost: 'i.4cdn.org', - hiddenPSAList: [{}], - knownBanners: '0.jpg,1.jpg,2.jpg,4.jpg,6.jpg,7.jpg,8.jpg,9.jpg,10.jpg,11.jpg,12.jpg,13.jpg,14.jpg,16.jpg,17.jpg,18.jpg,19.jpg,20.jpg,21.jpg,22.jpg,24.jpg,25.jpg,26.jpg,28.jpg,29.jpg,33.jpg,38.jpg,39.jpg,43.jpg,44.jpg,45.jpg,46.jpg,47.jpg,52.jpg,54.jpg,57.jpg,59.jpg,60.jpg,61.jpg,64.jpg,66.jpg,67.jpg,69.jpg,71.jpg,72.jpg,76.jpg,77.jpg,81.jpg,82.jpg,83.jpg,84.jpg,88.jpg,90.jpg,91.jpg,96.jpg,98.jpg,99.jpg,100.jpg,104.jpg,106.jpg,116.jpg,119.jpg,137.jpg,140.jpg,148.jpg,149.jpg,150.jpg,154.jpg,156.jpg,157.jpg,158.jpg,159.jpg,161.jpg,162.jpg,164.jpg,165.jpg,166.jpg,167.jpg,168.jpg,169.jpg,170.jpg,171.jpg,172.jpg,173.jpg,174.jpg,175.jpg,176.jpg,178.jpg,179.jpg,180.jpg,181.jpg,182.jpg,183.jpg,186.jpg,189.jpg,190.jpg,192.jpg,193.jpg,194.jpg,197.jpg,198.jpg,200.jpg,201.jpg,202.jpg,203.jpg,205.jpg,206.jpg,207.jpg,208.jpg,210.jpg,213.jpg,214.jpg,215.jpg,216.jpg,218.jpg,219.jpg,220.jpg,221.jpg,222.jpg,223.jpg,224.jpg,227.jpg,0.png,1.png,2.png,3.png,5.png,6.png,9.png,10.png,11.png,12.png,14.png,16.png,19.png,20.png,21.png,22.png,23.png,24.png,26.png,27.png,28.png,29.png,30.png,31.png,32.png,33.png,34.png,37.png,39.png,40.png,41.png,42.png,43.png,44.png,45.png,48.png,49.png,50.png,51.png,52.png,53.png,57.png,58.png,59.png,64.png,66.png,67.png,68.png,69.png,70.png,71.png,72.png,76.png,78.png,79.png,81.png,82.png,85.png,86.png,87.png,89.png,95.png,98.png,100.png,101.png,102.png,105.png,106.png,107.png,109.png,110.png,111.png,112.png,113.png,114.png,115.png,116.png,118.png,119.png,120.png,121.png,122.png,123.png,126.png,128.png,130.png,134.png,136.png,138.png,139.png,140.png,142.png,145.png,146.png,149.png,150.png,151.png,152.png,153.png,154.png,155.png,156.png,157.png,158.png,159.png,160.png,163.png,164.png,165.png,166.png,167.png,168.png,169.png,170.png,171.png,172.png,173.png,174.png,178.png,179.png,180.png,181.png,182.png,184.png,186.png,188.png,190.png,192.png,193.png,194.png,195.png,196.png,197.png,198.png,200.png,202.png,203.png,205.png,206.png,207.png,209.png,212.png,213.png,214.png,216.png,217.png,218.png,219.png,220.png,221.png,222.png,223.png,224.png,225.png,226.png,229.png,231.png,232.png,233.png,234.png,235.png,237.png,238.png,239.png,240.png,241.png,242.png,244.png,245.png,246.png,247.png,248.png,249.png,250.png,253.png,254.png,255.png,256.png,257.png,258.png,259.png,260.png,262.png,268.png,0.gif,1.gif,2.gif,3.gif,4.gif,5.gif,6.gif,7.gif,8.gif,9.gif,10.gif,12.gif,13.gif,14.gif,15.gif,16.gif,18.gif,19.gif,20.gif,21.gif,22.gif,23.gif,24.gif,28.gif,29.gif,30.gif,33.gif,34.gif,35.gif,36.gif,37.gif,39.gif,40.gif,42.gif,44.gif,45.gif,46.gif,48.gif,50.gif,52.gif,54.gif,55.gif,57.gif,58.gif,59.gif,60.gif,61.gif,63.gif,64.gif,66.gif,67.gif,68.gif,69.gif,70.gif,72.gif,73.gif,75.gif,76.gif,77.gif,78.gif,80.gif,81.gif,82.gif,83.gif,86.gif,87.gif,88.gif,92.gif,93.gif,94.gif,95.gif,96.gif,97.gif,98.gif,99.gif,100.gif,101.gif,102.gif,103.gif,104.gif,105.gif,106.gif,108.gif,109.gif,110.gif,111.gif,112.gif,113.gif,115.gif,116.gif,117.gif,118.gif,119.gif,120.gif,122.gif,123.gif,124.gif,127.gif,129.gif,130.gif,131.gif,134.gif,135.gif,136.gif,138.gif,139.gif,141.gif,144.gif,146.gif,148.gif,149.gif,153.gif,154.gif,155.gif,157.gif,158.gif,159.gif,160.gif,161.gif,162.gif,164.gif,166.gif,167.gif,168.gif,169.gif,170.gif,171.gif,172.gif,173.gif,174.gif,175.gif,176.gif,177.gif,178.gif,181.gif,182.gif,183.gif,185.gif,186.gif,187.gif,188.gif,189.gif,190.gif,191.gif,192.gif,193.gif,195.gif,196.gif,197.gif,200.gif,201.gif,202.gif,203.gif,204.gif,205.gif,206.gif,207.gif,208.gif,209.gif,210.gif,211.gif,212.gif,213.gif,214.gif,215.gif,216.gif,217.gif,219.gif,220.gif,221.gif,222.gif,224.gif,225.gif,226.gif,227.gif,228.gif,230.gif,232.gif,233.gif,234.gif,235.gif,238.gif,240.gif,241.gif,243.gif,244.gif,245.gif,246.gif,247.gif,249.gif,250.gif,251.gif,253.gif', - passMessageClosed: false, - 'Prerequest Captcha': false, - 'PSAseen': [[]] - }; - - return Config; - -}).call(this); - -CSS = { - -boards: -"/*!\n\ - * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome\n\ - * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)\n\ - */\n\ -@font-face {\n\ - font-family: FontAwesome;\n\ - src: url('data:application/font-woff;base64,d09GRgABAAAAAX7oAA0AAAAChqwABAAHAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABMAAAABwAAAAca75HuUdERUYAAAFMAAAAHwAAACAC8AAET1MvMgAAAWwAAAA+AAAAYIgyekBjbWFwAAABrAAAAWkAAALyCr86f2dhc3AAAAMYAAAACAAAAAj//wADZ2x5ZgAAAyAAAV95AAJMvI/3rk1oZWFkAAFinAAAADMAAAA2EInlLWhoZWEAAWLQAAAAHwAAACQPAwq1aG10eAABYvAAAAL0AAAK8EV5GIVsb2NhAAFl5AAABxYAAAsQAvWiXG1heHAAAWz8AAAAHwAAACADLAIcbmFtZQABbRwAAAJEAAAEhuOXi6xwb3N0AAFvYAAAD4UAABp1r4+boQAAAAEAAAAAzD2izwAAAADLTzwwAAAAANQxaLl4nGNgZGBg4ANiCQYQYGJgZGBkOgQkWc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0R6Q6Q3KoIwBCG6G6K7IboborshuhuiuyG6G6K7IboborshuhuiuyG6G6YgTEGI6IYpCFMQLHqrxAguBMGic0sQIrohohtVQVQFIaIbIrohohsiuiGiGyK6IaIbIrohohsiuiGiGyK6IaIbIrohohsiujEpCIkEhkQCQyKBwaK3SlUV27Q0MaZrxpkivSnSmzoelCYMXZsyWJViQgrmM8VLpuhviv6m6G+K/qbob4r+puhviv6m6G+K/qbob4r+puhviv6m6G+K/qbob4r+Zim5lqVVeoWrxnVd0nVZ13qpq/RSV5m6rup6QteD+VbpekrX07qe0fVsUk9p3inNO6V5pzTvlOad0rxTmndK805p3inNO6V5pzTvlOad0rxTmlcHzdK05p3WvNOad1rzTmveac07rXmnNe+05p3WvNOad1rzTmveac2rY2tJx9bSjOad0bwzmldH2JKOsKUZzTujeWc074zmndG8M5p3RvPOaN5ZzTureWc176zmndW8s5p3VvPOilMmNemsJp3VpLOadFaTzmrS2dn/AboJB4wAAAA=') format('woff');\n\ - font-weight: 400;\n\ - font-style: normal;\n\ -}\n\ -.fa-glass:before {content: \"\\f000\";}\n\ -.fa-music:before {content: \"\\f001\";}\n\ -.fa-search:before {content: \"\\f002\";}\n\ -.fa-envelope-o:before {content: \"\\f003\";}\n\ -.fa-heart:before {content: \"\\f004\";}\n\ -.fa-star:before {content: \"\\f005\";}\n\ -.fa-star-o:before {content: \"\\f006\";}\n\ -.fa-user:before {content: \"\\f007\";}\n\ -.fa-film:before {content: \"\\f008\";}\n\ -.fa-th-large:before {content: \"\\f009\";}\n\ -.fa-th:before {content: \"\\f00a\";}\n\ -.fa-th-list:before {content: \"\\f00b\";}\n\ -.fa-check:before {content: \"\\f00c\";}\n\ -.fa-remove:before, .fa-close:before, .fa-times:before {content: \"\\f00d\";}\n\ -.fa-search-plus:before {content: \"\\f00e\";}\n\ -.fa-search-minus:before {content: \"\\f010\";}\n\ -.fa-power-off:before {content: \"\\f011\";}\n\ -.fa-signal:before {content: \"\\f012\";}\n\ -.fa-gear:before, .fa-cog:before {content: \"\\f013\";}\n\ -.fa-trash-o:before {content: \"\\f014\";}\n\ -.fa-home:before {content: \"\\f015\";}\n\ -.fa-file-o:before {content: \"\\f016\";}\n\ -.fa-clock-o:before {content: \"\\f017\";}\n\ -.fa-road:before {content: \"\\f018\";}\n\ -.fa-download:before {content: \"\\f019\";}\n\ -.fa-arrow-circle-o-down:before {content: \"\\f01a\";}\n\ -.fa-arrow-circle-o-up:before {content: \"\\f01b\";}\n\ -.fa-inbox:before {content: \"\\f01c\";}\n\ -.fa-play-circle-o:before {content: \"\\f01d\";}\n\ -.fa-rotate-right:before, .fa-repeat:before {content: \"\\f01e\";}\n\ -.fa-refresh:before {content: \"\\f021\";}\n\ -.fa-list-alt:before {content: \"\\f022\";}\n\ -.fa-lock:before {content: \"\\f023\";}\n\ -.fa-flag:before {content: \"\\f024\";}\n\ -.fa-headphones:before {content: \"\\f025\";}\n\ -.fa-volume-off:before {content: \"\\f026\";}\n\ -.fa-volume-down:before {content: \"\\f027\";}\n\ -.fa-volume-up:before {content: \"\\f028\";}\n\ -.fa-qrcode:before {content: \"\\f029\";}\n\ -.fa-barcode:before {content: \"\\f02a\";}\n\ -.fa-tag:before {content: \"\\f02b\";}\n\ -.fa-tags:before {content: \"\\f02c\";}\n\ -.fa-book:before {content: \"\\f02d\";}\n\ -.fa-bookmark:before {content: \"\\f02e\";}\n\ -.fa-print:before {content: \"\\f02f\";}\n\ -.fa-camera:before {content: \"\\f030\";}\n\ -.fa-font:before {content: \"\\f031\";}\n\ -.fa-bold:before {content: \"\\f032\";}\n\ -.fa-italic:before {content: \"\\f033\";}\n\ -.fa-text-height:before {content: \"\\f034\";}\n\ -.fa-text-width:before {content: \"\\f035\";}\n\ -.fa-align-left:before {content: \"\\f036\";}\n\ -.fa-align-center:before {content: \"\\f037\";}\n\ -.fa-align-right:before {content: \"\\f038\";}\n\ -.fa-align-justify:before {content: \"\\f039\";}\n\ -.fa-list:before {content: \"\\f03a\";}\n\ -.fa-dedent:before, .fa-outdent:before {content: \"\\f03b\";}\n\ -.fa-indent:before {content: \"\\f03c\";}\n\ -.fa-video-camera:before {content: \"\\f03d\";}\n\ -.fa-photo:before, .fa-image:before, .fa-picture-o:before {content: \"\\f03e\";}\n\ -.fa-pencil:before {content: \"\\f040\";}\n\ -.fa-map-marker:before {content: \"\\f041\";}\n\ -.fa-adjust:before {content: \"\\f042\";}\n\ -.fa-tint:before {content: \"\\f043\";}\n\ -.fa-edit:before, .fa-pencil-square-o:before {content: \"\\f044\";}\n\ -.fa-share-square-o:before {content: \"\\f045\";}\n\ -.fa-check-square-o:before {content: \"\\f046\";}\n\ -.fa-arrows:before {content: \"\\f047\";}\n\ -.fa-step-backward:before {content: \"\\f048\";}\n\ -.fa-fast-backward:before {content: \"\\f049\";}\n\ -.fa-backward:before {content: \"\\f04a\";}\n\ -.fa-play:before {content: \"\\f04b\";}\n\ -.fa-pause:before {content: \"\\f04c\";}\n\ -.fa-stop:before {content: \"\\f04d\";}\n\ -.fa-forward:before {content: \"\\f04e\";}\n\ -.fa-fast-forward:before {content: \"\\f050\";}\n\ -.fa-step-forward:before {content: \"\\f051\";}\n\ -.fa-eject:before {content: \"\\f052\";}\n\ -.fa-chevron-left:before {content: \"\\f053\";}\n\ -.fa-chevron-right:before {content: \"\\f054\";}\n\ -.fa-plus-circle:before {content: \"\\f055\";}\n\ -.fa-minus-circle:before {content: \"\\f056\";}\n\ -.fa-times-circle:before {content: \"\\f057\";}\n\ -.fa-check-circle:before {content: \"\\f058\";}\n\ -.fa-question-circle:before {content: \"\\f059\";}\n\ -.fa-info-circle:before {content: \"\\f05a\";}\n\ -.fa-crosshairs:before {content: \"\\f05b\";}\n\ -.fa-times-circle-o:before {content: \"\\f05c\";}\n\ -.fa-check-circle-o:before {content: \"\\f05d\";}\n\ -.fa-ban:before {content: \"\\f05e\";}\n\ -.fa-arrow-left:before {content: \"\\f060\";}\n\ -.fa-arrow-right:before {content: \"\\f061\";}\n\ -.fa-arrow-up:before {content: \"\\f062\";}\n\ -.fa-arrow-down:before {content: \"\\f063\";}\n\ -.fa-mail-forward:before, .fa-share:before {content: \"\\f064\";}\n\ -.fa-expand:before {content: \"\\f065\";}\n\ -.fa-compress:before {content: \"\\f066\";}\n\ -.fa-plus:before {content: \"\\f067\";}\n\ -.fa-minus:before {content: \"\\f068\";}\n\ -.fa-asterisk:before {content: \"\\f069\";}\n\ -.fa-exclamation-circle:before {content: \"\\f06a\";}\n\ -.fa-gift:before {content: \"\\f06b\";}\n\ -.fa-leaf:before {content: \"\\f06c\";}\n\ -.fa-fire:before {content: \"\\f06d\";}\n\ -.fa-eye:before {content: \"\\f06e\";}\n\ -.fa-eye-slash:before {content: \"\\f070\";}\n\ -.fa-warning:before, .fa-exclamation-triangle:before {content: \"\\f071\";}\n\ -.fa-plane:before {content: \"\\f072\";}\n\ -.fa-calendar:before {content: \"\\f073\";}\n\ -.fa-random:before {content: \"\\f074\";}\n\ -.fa-comment:before {content: \"\\f075\";}\n\ -.fa-magnet:before {content: \"\\f076\";}\n\ -.fa-chevron-up:before {content: \"\\f077\";}\n\ -.fa-chevron-down:before {content: \"\\f078\";}\n\ -.fa-retweet:before {content: \"\\f079\";}\n\ -.fa-shopping-cart:before {content: \"\\f07a\";}\n\ -.fa-folder:before {content: \"\\f07b\";}\n\ -.fa-folder-open:before {content: \"\\f07c\";}\n\ -.fa-arrows-v:before {content: \"\\f07d\";}\n\ -.fa-arrows-h:before {content: \"\\f07e\";}\n\ -.fa-bar-chart-o:before, .fa-bar-chart:before {content: \"\\f080\";}\n\ -.fa-twitter-square:before {content: \"\\f081\";}\n\ -.fa-facebook-square:before {content: \"\\f082\";}\n\ -.fa-camera-retro:before {content: \"\\f083\";}\n\ -.fa-key:before {content: \"\\f084\";}\n\ -.fa-gears:before, .fa-cogs:before {content: \"\\f085\";}\n\ -.fa-comments:before {content: \"\\f086\";}\n\ -.fa-thumbs-o-up:before {content: \"\\f087\";}\n\ -.fa-thumbs-o-down:before {content: \"\\f088\";}\n\ -.fa-star-half:before {content: \"\\f089\";}\n\ -.fa-heart-o:before {content: \"\\f08a\";}\n\ -.fa-sign-out:before {content: \"\\f08b\";}\n\ -.fa-linkedin-square:before {content: \"\\f08c\";}\n\ -.fa-thumb-tack:before {content: \"\\f08d\";}\n\ -.fa-external-link:before {content: \"\\f08e\";}\n\ -.fa-sign-in:before {content: \"\\f090\";}\n\ -.fa-trophy:before {content: \"\\f091\";}\n\ -.fa-github-square:before {content: \"\\f092\";}\n\ -.fa-upload:before {content: \"\\f093\";}\n\ -.fa-lemon-o:before {content: \"\\f094\";}\n\ -.fa-phone:before {content: \"\\f095\";}\n\ -.fa-square-o:before {content: \"\\f096\";}\n\ -.fa-bookmark-o:before {content: \"\\f097\";}\n\ -.fa-phone-square:before {content: \"\\f098\";}\n\ -.fa-twitter:before {content: \"\\f099\";}\n\ -.fa-facebook-f:before, .fa-facebook:before {content: \"\\f09a\";}\n\ -.fa-github:before {content: \"\\f09b\";}\n\ -.fa-unlock:before {content: \"\\f09c\";}\n\ -.fa-credit-card:before {content: \"\\f09d\";}\n\ -.fa-feed:before, .fa-rss:before {content: \"\\f09e\";}\n\ -.fa-hdd-o:before {content: \"\\f0a0\";}\n\ -.fa-bullhorn:before {content: \"\\f0a1\";}\n\ -.fa-bell:before {content: \"\\f0f3\";}\n\ -.fa-certificate:before {content: \"\\f0a3\";}\n\ -.fa-hand-o-right:before {content: \"\\f0a4\";}\n\ -.fa-hand-o-left:before {content: \"\\f0a5\";}\n\ -.fa-hand-o-up:before {content: \"\\f0a6\";}\n\ -.fa-hand-o-down:before {content: \"\\f0a7\";}\n\ -.fa-arrow-circle-left:before {content: \"\\f0a8\";}\n\ -.fa-arrow-circle-right:before {content: \"\\f0a9\";}\n\ -.fa-arrow-circle-up:before {content: \"\\f0aa\";}\n\ -.fa-arrow-circle-down:before {content: \"\\f0ab\";}\n\ -.fa-globe:before {content: \"\\f0ac\";}\n\ -.fa-wrench:before {content: \"\\f0ad\";}\n\ -.fa-tasks:before {content: \"\\f0ae\";}\n\ -.fa-filter:before {content: \"\\f0b0\";}\n\ -.fa-briefcase:before {content: \"\\f0b1\";}\n\ -.fa-arrows-alt:before {content: \"\\f0b2\";}\n\ -.fa-group:before, .fa-users:before {content: \"\\f0c0\";}\n\ -.fa-chain:before, .fa-link:before {content: \"\\f0c1\";}\n\ -.fa-cloud:before {content: \"\\f0c2\";}\n\ -.fa-flask:before {content: \"\\f0c3\";}\n\ -.fa-cut:before, .fa-scissors:before {content: \"\\f0c4\";}\n\ -.fa-copy:before, .fa-files-o:before {content: \"\\f0c5\";}\n\ -.fa-paperclip:before {content: \"\\f0c6\";}\n\ -.fa-save:before, .fa-floppy-o:before {content: \"\\f0c7\";}\n\ -.fa-square:before {content: \"\\f0c8\";}\n\ -.fa-navicon:before, .fa-reorder:before, .fa-bars:before {content: \"\\f0c9\";}\n\ -.fa-list-ul:before {content: \"\\f0ca\";}\n\ -.fa-list-ol:before {content: \"\\f0cb\";}\n\ -.fa-strikethrough:before {content: \"\\f0cc\";}\n\ -.fa-underline:before {content: \"\\f0cd\";}\n\ -.fa-table:before {content: \"\\f0ce\";}\n\ -.fa-magic:before {content: \"\\f0d0\";}\n\ -.fa-truck:before {content: \"\\f0d1\";}\n\ -.fa-pinterest:before {content: \"\\f0d2\";}\n\ -.fa-pinterest-square:before {content: \"\\f0d3\";}\n\ -.fa-google-plus-square:before {content: \"\\f0d4\";}\n\ -.fa-google-plus:before {content: \"\\f0d5\";}\n\ -.fa-money:before {content: \"\\f0d6\";}\n\ -.fa-caret-down:before {content: \"\\f0d7\";}\n\ -.fa-caret-up:before {content: \"\\f0d8\";}\n\ -.fa-caret-left:before {content: \"\\f0d9\";}\n\ -.fa-caret-right:before {content: \"\\f0da\";}\n\ -.fa-columns:before {content: \"\\f0db\";}\n\ -.fa-unsorted:before, .fa-sort:before {content: \"\\f0dc\";}\n\ -.fa-sort-down:before, .fa-sort-desc:before {content: \"\\f0dd\";}\n\ -.fa-sort-up:before, .fa-sort-asc:before {content: \"\\f0de\";}\n\ -.fa-envelope:before {content: \"\\f0e0\";}\n\ -.fa-linkedin:before {content: \"\\f0e1\";}\n\ -.fa-rotate-left:before, .fa-undo:before {content: \"\\f0e2\";}\n\ -.fa-legal:before, .fa-gavel:before {content: \"\\f0e3\";}\n\ -.fa-dashboard:before, .fa-tachometer:before {content: \"\\f0e4\";}\n\ -.fa-comment-o:before {content: \"\\f0e5\";}\n\ -.fa-comments-o:before {content: \"\\f0e6\";}\n\ -.fa-flash:before, .fa-bolt:before {content: \"\\f0e7\";}\n\ -.fa-sitemap:before {content: \"\\f0e8\";}\n\ -.fa-umbrella:before {content: \"\\f0e9\";}\n\ -.fa-paste:before, .fa-clipboard:before {content: \"\\f0ea\";}\n\ -.fa-lightbulb-o:before {content: \"\\f0eb\";}\n\ -.fa-exchange:before {content: \"\\f0ec\";}\n\ -.fa-cloud-download:before {content: \"\\f0ed\";}\n\ -.fa-cloud-upload:before {content: \"\\f0ee\";}\n\ -.fa-user-md:before {content: \"\\f0f0\";}\n\ -.fa-stethoscope:before {content: \"\\f0f1\";}\n\ -.fa-suitcase:before {content: \"\\f0f2\";}\n\ -.fa-bell-o:before {content: \"\\f0a2\";}\n\ -.fa-coffee:before {content: \"\\f0f4\";}\n\ -.fa-cutlery:before {content: \"\\f0f5\";}\n\ -.fa-file-text-o:before {content: \"\\f0f6\";}\n\ -.fa-building-o:before {content: \"\\f0f7\";}\n\ -.fa-hospital-o:before {content: \"\\f0f8\";}\n\ -.fa-ambulance:before {content: \"\\f0f9\";}\n\ -.fa-medkit:before {content: \"\\f0fa\";}\n\ -.fa-fighter-jet:before {content: \"\\f0fb\";}\n\ -.fa-beer:before {content: \"\\f0fc\";}\n\ -.fa-h-square:before {content: \"\\f0fd\";}\n\ -.fa-plus-square:before {content: \"\\f0fe\";}\n\ -.fa-angle-double-left:before {content: \"\\f100\";}\n\ -.fa-angle-double-right:before {content: \"\\f101\";}\n\ -.fa-angle-double-up:before {content: \"\\f102\";}\n\ -.fa-angle-double-down:before {content: \"\\f103\";}\n\ -.fa-angle-left:before {content: \"\\f104\";}\n\ -.fa-angle-right:before {content: \"\\f105\";}\n\ -.fa-angle-up:before {content: \"\\f106\";}\n\ -.fa-angle-down:before {content: \"\\f107\";}\n\ -.fa-desktop:before {content: \"\\f108\";}\n\ -.fa-laptop:before {content: \"\\f109\";}\n\ -.fa-tablet:before {content: \"\\f10a\";}\n\ -.fa-mobile-phone:before, .fa-mobile:before {content: \"\\f10b\";}\n\ -.fa-circle-o:before {content: \"\\f10c\";}\n\ -.fa-quote-left:before {content: \"\\f10d\";}\n\ -.fa-quote-right:before {content: \"\\f10e\";}\n\ -.fa-spinner:before {content: \"\\f110\";}\n\ -.fa-circle:before {content: \"\\f111\";}\n\ -.fa-mail-reply:before, .fa-reply:before {content: \"\\f112\";}\n\ -.fa-github-alt:before {content: \"\\f113\";}\n\ -.fa-folder-o:before {content: \"\\f114\";}\n\ -.fa-folder-open-o:before {content: \"\\f115\";}\n\ -.fa-smile-o:before {content: \"\\f118\";}\n\ -.fa-frown-o:before {content: \"\\f119\";}\n\ -.fa-meh-o:before {content: \"\\f11a\";}\n\ -.fa-gamepad:before {content: \"\\f11b\";}\n\ -.fa-keyboard-o:before {content: \"\\f11c\";}\n\ -.fa-flag-o:before {content: \"\\f11d\";}\n\ -.fa-flag-checkered:before {content: \"\\f11e\";}\n\ -.fa-terminal:before {content: \"\\f120\";}\n\ -.fa-code:before {content: \"\\f121\";}\n\ -.fa-mail-reply-all:before, .fa-reply-all:before {content: \"\\f122\";}\n\ -.fa-star-half-empty:before, .fa-star-half-full:before, .fa-star-half-o:before {content: \"\\f123\";}\n\ -.fa-location-arrow:before {content: \"\\f124\";}\n\ -.fa-crop:before {content: \"\\f125\";}\n\ -.fa-code-fork:before {content: \"\\f126\";}\n\ -.fa-unlink:before, .fa-chain-broken:before {content: \"\\f127\";}\n\ -.fa-question:before {content: \"\\f128\";}\n\ -.fa-info:before {content: \"\\f129\";}\n\ -.fa-exclamation:before {content: \"\\f12a\";}\n\ -.fa-superscript:before {content: \"\\f12b\";}\n\ -.fa-subscript:before {content: \"\\f12c\";}\n\ -.fa-eraser:before {content: \"\\f12d\";}\n\ -.fa-puzzle-piece:before {content: \"\\f12e\";}\n\ -.fa-microphone:before {content: \"\\f130\";}\n\ -.fa-microphone-slash:before {content: \"\\f131\";}\n\ -.fa-shield:before {content: \"\\f132\";}\n\ -.fa-calendar-o:before {content: \"\\f133\";}\n\ -.fa-fire-extinguisher:before {content: \"\\f134\";}\n\ -.fa-rocket:before {content: \"\\f135\";}\n\ -.fa-maxcdn:before {content: \"\\f136\";}\n\ -.fa-chevron-circle-left:before {content: \"\\f137\";}\n\ -.fa-chevron-circle-right:before {content: \"\\f138\";}\n\ -.fa-chevron-circle-up:before {content: \"\\f139\";}\n\ -.fa-chevron-circle-down:before {content: \"\\f13a\";}\n\ -.fa-html5:before {content: \"\\f13b\";}\n\ -.fa-css3:before {content: \"\\f13c\";}\n\ -.fa-anchor:before {content: \"\\f13d\";}\n\ -.fa-unlock-alt:before {content: \"\\f13e\";}\n\ -.fa-bullseye:before {content: \"\\f140\";}\n\ -.fa-ellipsis-h:before {content: \"\\f141\";}\n\ -.fa-ellipsis-v:before {content: \"\\f142\";}\n\ -.fa-rss-square:before {content: \"\\f143\";}\n\ -.fa-play-circle:before {content: \"\\f144\";}\n\ -.fa-ticket:before {content: \"\\f145\";}\n\ -.fa-minus-square:before {content: \"\\f146\";}\n\ -.fa-minus-square-o:before {content: \"\\f147\";}\n\ -.fa-level-up:before {content: \"\\f148\";}\n\ -.fa-level-down:before {content: \"\\f149\";}\n\ -.fa-check-square:before {content: \"\\f14a\";}\n\ -.fa-pencil-square:before {content: \"\\f14b\";}\n\ -.fa-external-link-square:before {content: \"\\f14c\";}\n\ -.fa-share-square:before {content: \"\\f14d\";}\n\ -.fa-compass:before {content: \"\\f14e\";}\n\ -.fa-toggle-down:before, .fa-caret-square-o-down:before {content: \"\\f150\";}\n\ -.fa-toggle-up:before, .fa-caret-square-o-up:before {content: \"\\f151\";}\n\ -.fa-toggle-right:before, .fa-caret-square-o-right:before {content: \"\\f152\";}\n\ -.fa-euro:before, .fa-eur:before {content: \"\\f153\";}\n\ -.fa-gbp:before {content: \"\\f154\";}\n\ -.fa-dollar:before, .fa-usd:before {content: \"\\f155\";}\n\ -.fa-rupee:before, .fa-inr:before {content: \"\\f156\";}\n\ -.fa-cny:before, .fa-rmb:before, .fa-yen:before, .fa-jpy:before {content: \"\\f157\";}\n\ -.fa-ruble:before, .fa-rouble:before, .fa-rub:before {content: \"\\f158\";}\n\ -.fa-won:before, .fa-krw:before {content: \"\\f159\";}\n\ -.fa-bitcoin:before, .fa-btc:before {content: \"\\f15a\";}\n\ -.fa-file:before {content: \"\\f15b\";}\n\ -.fa-file-text:before {content: \"\\f15c\";}\n\ -.fa-sort-alpha-asc:before {content: \"\\f15d\";}\n\ -.fa-sort-alpha-desc:before {content: \"\\f15e\";}\n\ -.fa-sort-amount-asc:before {content: \"\\f160\";}\n\ -.fa-sort-amount-desc:before {content: \"\\f161\";}\n\ -.fa-sort-numeric-asc:before {content: \"\\f162\";}\n\ -.fa-sort-numeric-desc:before {content: \"\\f163\";}\n\ -.fa-thumbs-up:before {content: \"\\f164\";}\n\ -.fa-thumbs-down:before {content: \"\\f165\";}\n\ -.fa-youtube-square:before {content: \"\\f166\";}\n\ -.fa-youtube:before {content: \"\\f167\";}\n\ -.fa-xing:before {content: \"\\f168\";}\n\ -.fa-xing-square:before {content: \"\\f169\";}\n\ -.fa-youtube-play:before {content: \"\\f16a\";}\n\ -.fa-dropbox:before {content: \"\\f16b\";}\n\ -.fa-stack-overflow:before {content: \"\\f16c\";}\n\ -.fa-instagram:before {content: \"\\f16d\";}\n\ -.fa-flickr:before {content: \"\\f16e\";}\n\ -.fa-adn:before {content: \"\\f170\";}\n\ -.fa-bitbucket:before {content: \"\\f171\";}\n\ -.fa-bitbucket-square:before {content: \"\\f172\";}\n\ -.fa-tumblr:before {content: \"\\f173\";}\n\ -.fa-tumblr-square:before {content: \"\\f174\";}\n\ -.fa-long-arrow-down:before {content: \"\\f175\";}\n\ -.fa-long-arrow-up:before {content: \"\\f176\";}\n\ -.fa-long-arrow-left:before {content: \"\\f177\";}\n\ -.fa-long-arrow-right:before {content: \"\\f178\";}\n\ -.fa-apple:before {content: \"\\f179\";}\n\ -.fa-windows:before {content: \"\\f17a\";}\n\ -.fa-android:before {content: \"\\f17b\";}\n\ -.fa-linux:before {content: \"\\f17c\";}\n\ -.fa-dribbble:before {content: \"\\f17d\";}\n\ -.fa-skype:before {content: \"\\f17e\";}\n\ -.fa-foursquare:before {content: \"\\f180\";}\n\ -.fa-trello:before {content: \"\\f181\";}\n\ -.fa-female:before {content: \"\\f182\";}\n\ -.fa-male:before {content: \"\\f183\";}\n\ -.fa-gittip:before, .fa-gratipay:before {content: \"\\f184\";}\n\ -.fa-sun-o:before {content: \"\\f185\";}\n\ -.fa-moon-o:before {content: \"\\f186\";}\n\ -.fa-archive:before {content: \"\\f187\";}\n\ -.fa-bug:before {content: \"\\f188\";}\n\ -.fa-vk:before {content: \"\\f189\";}\n\ -.fa-weibo:before {content: \"\\f18a\";}\n\ -.fa-renren:before {content: \"\\f18b\";}\n\ -.fa-pagelines:before {content: \"\\f18c\";}\n\ -.fa-stack-exchange:before {content: \"\\f18d\";}\n\ -.fa-arrow-circle-o-right:before {content: \"\\f18e\";}\n\ -.fa-arrow-circle-o-left:before {content: \"\\f190\";}\n\ -.fa-toggle-left:before, .fa-caret-square-o-left:before {content: \"\\f191\";}\n\ -.fa-dot-circle-o:before {content: \"\\f192\";}\n\ -.fa-wheelchair:before {content: \"\\f193\";}\n\ -.fa-vimeo-square:before {content: \"\\f194\";}\n\ -.fa-turkish-lira:before, .fa-try:before {content: \"\\f195\";}\n\ -.fa-plus-square-o:before {content: \"\\f196\";}\n\ -.fa-space-shuttle:before {content: \"\\f197\";}\n\ -.fa-slack:before {content: \"\\f198\";}\n\ -.fa-envelope-square:before {content: \"\\f199\";}\n\ -.fa-wordpress:before {content: \"\\f19a\";}\n\ -.fa-openid:before {content: \"\\f19b\";}\n\ -.fa-institution:before, .fa-bank:before, .fa-university:before {content: \"\\f19c\";}\n\ -.fa-mortar-board:before, .fa-graduation-cap:before {content: \"\\f19d\";}\n\ -.fa-yahoo:before {content: \"\\f19e\";}\n\ -.fa-google:before {content: \"\\f1a0\";}\n\ -.fa-reddit:before {content: \"\\f1a1\";}\n\ -.fa-reddit-square:before {content: \"\\f1a2\";}\n\ -.fa-stumbleupon-circle:before {content: \"\\f1a3\";}\n\ -.fa-stumbleupon:before {content: \"\\f1a4\";}\n\ -.fa-delicious:before {content: \"\\f1a5\";}\n\ -.fa-digg:before {content: \"\\f1a6\";}\n\ -.fa-pied-piper-pp:before {content: \"\\f1a7\";}\n\ -.fa-pied-piper-alt:before {content: \"\\f1a8\";}\n\ -.fa-drupal:before {content: \"\\f1a9\";}\n\ -.fa-joomla:before {content: \"\\f1aa\";}\n\ -.fa-language:before {content: \"\\f1ab\";}\n\ -.fa-fax:before {content: \"\\f1ac\";}\n\ -.fa-building:before {content: \"\\f1ad\";}\n\ -.fa-child:before {content: \"\\f1ae\";}\n\ -.fa-paw:before {content: \"\\f1b0\";}\n\ -.fa-spoon:before {content: \"\\f1b1\";}\n\ -.fa-cube:before {content: \"\\f1b2\";}\n\ -.fa-cubes:before {content: \"\\f1b3\";}\n\ -.fa-behance:before {content: \"\\f1b4\";}\n\ -.fa-behance-square:before {content: \"\\f1b5\";}\n\ -.fa-steam:before {content: \"\\f1b6\";}\n\ -.fa-steam-square:before {content: \"\\f1b7\";}\n\ -.fa-recycle:before {content: \"\\f1b8\";}\n\ -.fa-automobile:before, .fa-car:before {content: \"\\f1b9\";}\n\ -.fa-cab:before, .fa-taxi:before {content: \"\\f1ba\";}\n\ -.fa-tree:before {content: \"\\f1bb\";}\n\ -.fa-spotify:before {content: \"\\f1bc\";}\n\ -.fa-deviantart:before {content: \"\\f1bd\";}\n\ -.fa-soundcloud:before {content: \"\\f1be\";}\n\ -.fa-database:before {content: \"\\f1c0\";}\n\ -.fa-file-pdf-o:before {content: \"\\f1c1\";}\n\ -.fa-file-word-o:before {content: \"\\f1c2\";}\n\ -.fa-file-excel-o:before {content: \"\\f1c3\";}\n\ -.fa-file-powerpoint-o:before {content: \"\\f1c4\";}\n\ -.fa-file-photo-o:before, .fa-file-picture-o:before, .fa-file-image-o:before {content: \"\\f1c5\";}\n\ -.fa-file-zip-o:before, .fa-file-archive-o:before {content: \"\\f1c6\";}\n\ -.fa-file-sound-o:before, .fa-file-audio-o:before {content: \"\\f1c7\";}\n\ -.fa-file-movie-o:before, .fa-file-video-o:before {content: \"\\f1c8\";}\n\ -.fa-file-code-o:before {content: \"\\f1c9\";}\n\ -.fa-vine:before {content: \"\\f1ca\";}\n\ -.fa-codepen:before {content: \"\\f1cb\";}\n\ -.fa-jsfiddle:before {content: \"\\f1cc\";}\n\ -.fa-life-bouy:before, .fa-life-buoy:before, .fa-life-saver:before, .fa-support:before, .fa-life-ring:before {content: \"\\f1cd\";}\n\ -.fa-circle-o-notch:before {content: \"\\f1ce\";}\n\ -.fa-ra:before, .fa-resistance:before, .fa-rebel:before {content: \"\\f1d0\";}\n\ -.fa-ge:before, .fa-empire:before {content: \"\\f1d1\";}\n\ -.fa-git-square:before {content: \"\\f1d2\";}\n\ -.fa-git:before {content: \"\\f1d3\";}\n\ -.fa-y-combinator-square:before, .fa-yc-square:before, .fa-hacker-news:before {content: \"\\f1d4\";}\n\ -.fa-tencent-weibo:before {content: \"\\f1d5\";}\n\ -.fa-qq:before {content: \"\\f1d6\";}\n\ -.fa-wechat:before, .fa-weixin:before {content: \"\\f1d7\";}\n\ -.fa-send:before, .fa-paper-plane:before {content: \"\\f1d8\";}\n\ -.fa-send-o:before, .fa-paper-plane-o:before {content: \"\\f1d9\";}\n\ -.fa-history:before {content: \"\\f1da\";}\n\ -.fa-circle-thin:before {content: \"\\f1db\";}\n\ -.fa-header:before {content: \"\\f1dc\";}\n\ -.fa-paragraph:before {content: \"\\f1dd\";}\n\ -.fa-sliders:before {content: \"\\f1de\";}\n\ -.fa-share-alt:before {content: \"\\f1e0\";}\n\ -.fa-share-alt-square:before {content: \"\\f1e1\";}\n\ -.fa-bomb:before {content: \"\\f1e2\";}\n\ -.fa-soccer-ball-o:before, .fa-futbol-o:before {content: \"\\f1e3\";}\n\ -.fa-tty:before {content: \"\\f1e4\";}\n\ -.fa-binoculars:before {content: \"\\f1e5\";}\n\ -.fa-plug:before {content: \"\\f1e6\";}\n\ -.fa-slideshare:before {content: \"\\f1e7\";}\n\ -.fa-twitch:before {content: \"\\f1e8\";}\n\ -.fa-yelp:before {content: \"\\f1e9\";}\n\ -.fa-newspaper-o:before {content: \"\\f1ea\";}\n\ -.fa-wifi:before {content: \"\\f1eb\";}\n\ -.fa-calculator:before {content: \"\\f1ec\";}\n\ -.fa-paypal:before {content: \"\\f1ed\";}\n\ -.fa-google-wallet:before {content: \"\\f1ee\";}\n\ -.fa-cc-visa:before {content: \"\\f1f0\";}\n\ -.fa-cc-mastercard:before {content: \"\\f1f1\";}\n\ -.fa-cc-discover:before {content: \"\\f1f2\";}\n\ -.fa-cc-amex:before {content: \"\\f1f3\";}\n\ -.fa-cc-paypal:before {content: \"\\f1f4\";}\n\ -.fa-cc-stripe:before {content: \"\\f1f5\";}\n\ -.fa-bell-slash:before {content: \"\\f1f6\";}\n\ -.fa-bell-slash-o:before {content: \"\\f1f7\";}\n\ -.fa-trash:before {content: \"\\f1f8\";}\n\ -.fa-copyright:before {content: \"\\f1f9\";}\n\ -.fa-at:before {content: \"\\f1fa\";}\n\ -.fa-eyedropper:before {content: \"\\f1fb\";}\n\ -.fa-paint-brush:before {content: \"\\f1fc\";}\n\ -.fa-birthday-cake:before {content: \"\\f1fd\";}\n\ -.fa-area-chart:before {content: \"\\f1fe\";}\n\ -.fa-pie-chart:before {content: \"\\f200\";}\n\ -.fa-line-chart:before {content: \"\\f201\";}\n\ -.fa-lastfm:before {content: \"\\f202\";}\n\ -.fa-lastfm-square:before {content: \"\\f203\";}\n\ -.fa-toggle-off:before {content: \"\\f204\";}\n\ -.fa-toggle-on:before {content: \"\\f205\";}\n\ -.fa-bicycle:before {content: \"\\f206\";}\n\ -.fa-bus:before {content: \"\\f207\";}\n\ -.fa-ioxhost:before {content: \"\\f208\";}\n\ -.fa-angellist:before {content: \"\\f209\";}\n\ -.fa-cc:before {content: \"\\f20a\";}\n\ -.fa-shekel:before, .fa-sheqel:before, .fa-ils:before {content: \"\\f20b\";}\n\ -.fa-meanpath:before {content: \"\\f20c\";}\n\ -.fa-buysellads:before {content: \"\\f20d\";}\n\ -.fa-connectdevelop:before {content: \"\\f20e\";}\n\ -.fa-dashcube:before {content: \"\\f210\";}\n\ -.fa-forumbee:before {content: \"\\f211\";}\n\ -.fa-leanpub:before {content: \"\\f212\";}\n\ -.fa-sellsy:before {content: \"\\f213\";}\n\ -.fa-shirtsinbulk:before {content: \"\\f214\";}\n\ -.fa-simplybuilt:before {content: \"\\f215\";}\n\ -.fa-skyatlas:before {content: \"\\f216\";}\n\ -.fa-cart-plus:before {content: \"\\f217\";}\n\ -.fa-cart-arrow-down:before {content: \"\\f218\";}\n\ -.fa-diamond:before {content: \"\\f219\";}\n\ -.fa-ship:before {content: \"\\f21a\";}\n\ -.fa-user-secret:before {content: \"\\f21b\";}\n\ -.fa-motorcycle:before {content: \"\\f21c\";}\n\ -.fa-street-view:before {content: \"\\f21d\";}\n\ -.fa-heartbeat:before {content: \"\\f21e\";}\n\ -.fa-venus:before {content: \"\\f221\";}\n\ -.fa-mars:before {content: \"\\f222\";}\n\ -.fa-mercury:before {content: \"\\f223\";}\n\ -.fa-intersex:before, .fa-transgender:before {content: \"\\f224\";}\n\ -.fa-transgender-alt:before {content: \"\\f225\";}\n\ -.fa-venus-double:before {content: \"\\f226\";}\n\ -.fa-mars-double:before {content: \"\\f227\";}\n\ -.fa-venus-mars:before {content: \"\\f228\";}\n\ -.fa-mars-stroke:before {content: \"\\f229\";}\n\ -.fa-mars-stroke-v:before {content: \"\\f22a\";}\n\ -.fa-mars-stroke-h:before {content: \"\\f22b\";}\n\ -.fa-neuter:before {content: \"\\f22c\";}\n\ -.fa-genderless:before {content: \"\\f22d\";}\n\ -.fa-facebook-official:before {content: \"\\f230\";}\n\ -.fa-pinterest-p:before {content: \"\\f231\";}\n\ -.fa-whatsapp:before {content: \"\\f232\";}\n\ -.fa-server:before {content: \"\\f233\";}\n\ -.fa-user-plus:before {content: \"\\f234\";}\n\ -.fa-user-times:before {content: \"\\f235\";}\n\ -.fa-hotel:before, .fa-bed:before {content: \"\\f236\";}\n\ -.fa-viacoin:before {content: \"\\f237\";}\n\ -.fa-train:before {content: \"\\f238\";}\n\ -.fa-subway:before {content: \"\\f239\";}\n\ -.fa-medium:before {content: \"\\f23a\";}\n\ -.fa-yc:before, .fa-y-combinator:before {content: \"\\f23b\";}\n\ -.fa-optin-monster:before {content: \"\\f23c\";}\n\ -.fa-opencart:before {content: \"\\f23d\";}\n\ -.fa-expeditedssl:before {content: \"\\f23e\";}\n\ -.fa-battery-4:before, .fa-battery:before, .fa-battery-full:before {content: \"\\f240\";}\n\ -.fa-battery-3:before, .fa-battery-three-quarters:before {content: \"\\f241\";}\n\ -.fa-battery-2:before, .fa-battery-half:before {content: \"\\f242\";}\n\ -.fa-battery-1:before, .fa-battery-quarter:before {content: \"\\f243\";}\n\ -.fa-battery-0:before, .fa-battery-empty:before {content: \"\\f244\";}\n\ -.fa-mouse-pointer:before {content: \"\\f245\";}\n\ -.fa-i-cursor:before {content: \"\\f246\";}\n\ -.fa-object-group:before {content: \"\\f247\";}\n\ -.fa-object-ungroup:before {content: \"\\f248\";}\n\ -.fa-sticky-note:before {content: \"\\f249\";}\n\ -.fa-sticky-note-o:before {content: \"\\f24a\";}\n\ -.fa-cc-jcb:before {content: \"\\f24b\";}\n\ -.fa-cc-diners-club:before {content: \"\\f24c\";}\n\ -.fa-clone:before {content: \"\\f24d\";}\n\ -.fa-balance-scale:before {content: \"\\f24e\";}\n\ -.fa-hourglass-o:before {content: \"\\f250\";}\n\ -.fa-hourglass-1:before, .fa-hourglass-start:before {content: \"\\f251\";}\n\ -.fa-hourglass-2:before, .fa-hourglass-half:before {content: \"\\f252\";}\n\ -.fa-hourglass-3:before, .fa-hourglass-end:before {content: \"\\f253\";}\n\ -.fa-hourglass:before {content: \"\\f254\";}\n\ -.fa-hand-grab-o:before, .fa-hand-rock-o:before {content: \"\\f255\";}\n\ -.fa-hand-stop-o:before, .fa-hand-paper-o:before {content: \"\\f256\";}\n\ -.fa-hand-scissors-o:before {content: \"\\f257\";}\n\ -.fa-hand-lizard-o:before {content: \"\\f258\";}\n\ -.fa-hand-spock-o:before {content: \"\\f259\";}\n\ -.fa-hand-pointer-o:before {content: \"\\f25a\";}\n\ -.fa-hand-peace-o:before {content: \"\\f25b\";}\n\ -.fa-trademark:before {content: \"\\f25c\";}\n\ -.fa-registered:before {content: \"\\f25d\";}\n\ -.fa-creative-commons:before {content: \"\\f25e\";}\n\ -.fa-gg:before {content: \"\\f260\";}\n\ -.fa-gg-circle:before {content: \"\\f261\";}\n\ -.fa-tripadvisor:before {content: \"\\f262\";}\n\ -.fa-odnoklassniki:before {content: \"\\f263\";}\n\ -.fa-odnoklassniki-square:before {content: \"\\f264\";}\n\ -.fa-get-pocket:before {content: \"\\f265\";}\n\ -.fa-wikipedia-w:before {content: \"\\f266\";}\n\ -.fa-safari:before {content: \"\\f267\";}\n\ -.fa-chrome:before {content: \"\\f268\";}\n\ -.fa-firefox:before {content: \"\\f269\";}\n\ -.fa-opera:before {content: \"\\f26a\";}\n\ -.fa-internet-explorer:before {content: \"\\f26b\";}\n\ -.fa-tv:before, .fa-television:before {content: \"\\f26c\";}\n\ -.fa-contao:before {content: \"\\f26d\";}\n\ -.fa-500px:before {content: \"\\f26e\";}\n\ -.fa-amazon:before {content: \"\\f270\";}\n\ -.fa-calendar-plus-o:before {content: \"\\f271\";}\n\ -.fa-calendar-minus-o:before {content: \"\\f272\";}\n\ -.fa-calendar-times-o:before {content: \"\\f273\";}\n\ -.fa-calendar-check-o:before {content: \"\\f274\";}\n\ -.fa-industry:before {content: \"\\f275\";}\n\ -.fa-map-pin:before {content: \"\\f276\";}\n\ -.fa-map-signs:before {content: \"\\f277\";}\n\ -.fa-map-o:before {content: \"\\f278\";}\n\ -.fa-map:before {content: \"\\f279\";}\n\ -.fa-commenting:before {content: \"\\f27a\";}\n\ -.fa-commenting-o:before {content: \"\\f27b\";}\n\ -.fa-houzz:before {content: \"\\f27c\";}\n\ -.fa-vimeo:before {content: \"\\f27d\";}\n\ -.fa-black-tie:before {content: \"\\f27e\";}\n\ -.fa-fonticons:before {content: \"\\f280\";}\n\ -.fa-reddit-alien:before {content: \"\\f281\";}\n\ -.fa-edge:before {content: \"\\f282\";}\n\ -.fa-credit-card-alt:before {content: \"\\f283\";}\n\ -.fa-codiepie:before {content: \"\\f284\";}\n\ -.fa-modx:before {content: \"\\f285\";}\n\ -.fa-fort-awesome:before {content: \"\\f286\";}\n\ -.fa-usb:before {content: \"\\f287\";}\n\ -.fa-product-hunt:before {content: \"\\f288\";}\n\ -.fa-mixcloud:before {content: \"\\f289\";}\n\ -.fa-scribd:before {content: \"\\f28a\";}\n\ -.fa-pause-circle:before {content: \"\\f28b\";}\n\ -.fa-pause-circle-o:before {content: \"\\f28c\";}\n\ -.fa-stop-circle:before {content: \"\\f28d\";}\n\ -.fa-stop-circle-o:before {content: \"\\f28e\";}\n\ -.fa-shopping-bag:before {content: \"\\f290\";}\n\ -.fa-shopping-basket:before {content: \"\\f291\";}\n\ -.fa-hashtag:before {content: \"\\f292\";}\n\ -.fa-bluetooth:before {content: \"\\f293\";}\n\ -.fa-bluetooth-b:before {content: \"\\f294\";}\n\ -.fa-percent:before {content: \"\\f295\";}\n\ -.fa-gitlab:before {content: \"\\f296\";}\n\ -.fa-wpbeginner:before {content: \"\\f297\";}\n\ -.fa-wpforms:before {content: \"\\f298\";}\n\ -.fa-envira:before {content: \"\\f299\";}\n\ -.fa-universal-access:before {content: \"\\f29a\";}\n\ -.fa-wheelchair-alt:before {content: \"\\f29b\";}\n\ -.fa-question-circle-o:before {content: \"\\f29c\";}\n\ -.fa-blind:before {content: \"\\f29d\";}\n\ -.fa-audio-description:before {content: \"\\f29e\";}\n\ -.fa-volume-control-phone:before {content: \"\\f2a0\";}\n\ -.fa-braille:before {content: \"\\f2a1\";}\n\ -.fa-assistive-listening-systems:before {content: \"\\f2a2\";}\n\ -.fa-asl-interpreting:before, .fa-american-sign-language-interpreting:before {content: \"\\f2a3\";}\n\ -.fa-deafness:before, .fa-hard-of-hearing:before, .fa-deaf:before {content: \"\\f2a4\";}\n\ -.fa-glide:before {content: \"\\f2a5\";}\n\ -.fa-glide-g:before {content: \"\\f2a6\";}\n\ -.fa-signing:before, .fa-sign-language:before {content: \"\\f2a7\";}\n\ -.fa-low-vision:before {content: \"\\f2a8\";}\n\ -.fa-viadeo:before {content: \"\\f2a9\";}\n\ -.fa-viadeo-square:before {content: \"\\f2aa\";}\n\ -.fa-snapchat:before {content: \"\\f2ab\";}\n\ -.fa-snapchat-ghost:before {content: \"\\f2ac\";}\n\ -.fa-snapchat-square:before {content: \"\\f2ad\";}\n\ -.fa-pied-piper:before {content: \"\\f2ae\";}\n\ -.fa-first-order:before {content: \"\\f2b0\";}\n\ -.fa-yoast:before {content: \"\\f2b1\";}\n\ -.fa-themeisle:before {content: \"\\f2b2\";}\n\ -.fa-google-plus-circle:before, .fa-google-plus-official:before {content: \"\\f2b3\";}\n\ -.fa-fa:before, .fa-font-awesome:before {content: \"\\f2b4\";}\n\ -.fa-handshake-o:before {content: \"\\f2b5\";}\n\ -.fa-envelope-open:before {content: \"\\f2b6\";}\n\ -.fa-envelope-open-o:before {content: \"\\f2b7\";}\n\ -.fa-linode:before {content: \"\\f2b8\";}\n\ -.fa-address-book:before {content: \"\\f2b9\";}\n\ -.fa-address-book-o:before {content: \"\\f2ba\";}\n\ -.fa-vcard:before, .fa-address-card:before {content: \"\\f2bb\";}\n\ -.fa-vcard-o:before, .fa-address-card-o:before {content: \"\\f2bc\";}\n\ -.fa-user-circle:before {content: \"\\f2bd\";}\n\ -.fa-user-circle-o:before {content: \"\\f2be\";}\n\ -.fa-user-o:before {content: \"\\f2c0\";}\n\ -.fa-id-badge:before {content: \"\\f2c1\";}\n\ -.fa-drivers-license:before, .fa-id-card:before {content: \"\\f2c2\";}\n\ -.fa-drivers-license-o:before, .fa-id-card-o:before {content: \"\\f2c3\";}\n\ -.fa-quora:before {content: \"\\f2c4\";}\n\ -.fa-free-code-camp:before {content: \"\\f2c5\";}\n\ -.fa-telegram:before {content: \"\\f2c6\";}\n\ -.fa-thermometer-4:before, .fa-thermometer:before, .fa-thermometer-full:before {content: \"\\f2c7\";}\n\ -.fa-thermometer-3:before, .fa-thermometer-three-quarters:before {content: \"\\f2c8\";}\n\ -.fa-thermometer-2:before, .fa-thermometer-half:before {content: \"\\f2c9\";}\n\ -.fa-thermometer-1:before, .fa-thermometer-quarter:before {content: \"\\f2ca\";}\n\ -.fa-thermometer-0:before, .fa-thermometer-empty:before {content: \"\\f2cb\";}\n\ -.fa-shower:before {content: \"\\f2cc\";}\n\ -.fa-bathtub:before, .fa-s15:before, .fa-bath:before {content: \"\\f2cd\";}\n\ -.fa-podcast:before {content: \"\\f2ce\";}\n\ -.fa-window-maximize:before {content: \"\\f2d0\";}\n\ -.fa-window-minimize:before {content: \"\\f2d1\";}\n\ -.fa-window-restore:before {content: \"\\f2d2\";}\n\ -.fa-times-rectangle:before, .fa-window-close:before {content: \"\\f2d3\";}\n\ -.fa-times-rectangle-o:before, .fa-window-close-o:before {content: \"\\f2d4\";}\n\ -.fa-bandcamp:before {content: \"\\f2d5\";}\n\ -.fa-grav:before {content: \"\\f2d6\";}\n\ -.fa-etsy:before {content: \"\\f2d7\";}\n\ -.fa-imdb:before {content: \"\\f2d8\";}\n\ -.fa-ravelry:before {content: \"\\f2d9\";}\n\ -.fa-eercast:before {content: \"\\f2da\";}\n\ -.fa-microchip:before {content: \"\\f2db\";}\n\ -.fa-snowflake-o:before {content: \"\\f2dc\";}\n\ -.fa-superpowers:before {content: \"\\f2dd\";}\n\ -.fa-wpexplorer:before {content: \"\\f2de\";}\n\ -.fa-meetup:before {content: \"\\f2e0\";}\n\ -.fa::before {\n\ - font-family: FontAwesome;\n\ - font-weight: 400;\n\ - font-style: normal;\n\ - -webkit-font-smoothing: antialiased;\n\ - text-decoration: inherit;\n\ - speak: none;\n\ - display: inline-block;\n\ - font-size: 13px;\n\ - visibility: visible;\n\ -}\n\ -:root:not(.shortcut-icons) #shortcuts .fa::before {\n\ - display: none;\n\ -}\n\ -:root.shortcut-icons #shortcuts .fa::before {\n\ - font-size: 15px !important;\n\ - margin-top: -3px !important;\n\ - position: relative;\n\ - top: 1px;\n\ -}\n\ -:root.shortcut-icons #shortcuts .fa, .menu-button .fa {\n\ - font-size: 0;\n\ - visibility: hidden;\n\ -}\n\ -:root.shortcut-icons .shortcut.brackets-wrap::after,\n\ -:root.shortcut-icons .shortcut.brackets-wrap::before {\n\ - display: none;\n\ -}\n\ -:root.shortcut-icons #shortcuts a .fa,\n\ -.menu-button .fa,\n\ -.hide-reply-button .fa,\n\ -.hide-thread-button .fa {\n\ - display: inline;\n\ -}\n\ -.fa-spin::before {\n\ - -webkit-animation:spin 2s infinite linear;\n\ - -moz-animation:spin 2s infinite linear;\n\ - -o-animation:spin 2s infinite linear;\n\ - animation:spin 2s infinite linear;\n\ -}\n\ -@-moz-keyframes spin {\n\ - 0% {-moz-transform:rotate(0deg);}\n\ - 100% {-moz-transform:rotate(359deg);}\n\ -}\n\ -@-webkit-keyframes spin {\n\ - 0% {-webkit-transform:rotate(0deg);}\n\ - 100% {-webkit-transform:rotate(359deg);}\n\ -}\n\ -@keyframes spin {\n\ - 0% {transform:rotate(0deg);}\n\ - 100% {transform:rotate(359deg);}\n\ -}\n\ -/* General */\n\ -.dialog {\n\ - border: 1px solid;\n\ - display: block;\n\ - background-color: inherit;\n\ -}\n\ -.dialog:not(#qr):not(#thread-watcher):not(#header-bar) {\n\ - box-shadow: 0 1px 2px rgba(0, 0, 0, .15);\n\ -}\n\ -#qr,\n\ -#thread-watcher {\n\ - box-shadow: -1px 2px 2px rgba(0, 0, 0, 0.25);\n\ -}\n\ -.captcha-img,\n\ -.field {\n\ - background-color: #FFF;\n\ - border: 1px solid #CCC;\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ - color: #333;\n\ - font: 13px sans-serif;\n\ - outline: none;\n\ - transition: color .25s, border-color .25s;\n\ -}\n\ -.field::-moz-placeholder {\n\ - color: #AAA;\n\ - font-size: 13px;\n\ - opacity: 1;\n\ -}\n\ -.captch-img:hover,\n\ -.field:hover {\n\ - border-color: #999;\n\ -}\n\ -.field:hover, .field:focus, .field.focus {\n\ - color: #000;\n\ -}\n\ -.field[disabled] {\n\ - background-color: #F2F2F2;\n\ - color: #888;\n\ -}\n\ -.field::-webkit-search-decoration {\n\ - display: none;\n\ -}\n\ -.move {\n\ - cursor: move;\n\ - overflow: hidden;\n\ -}\n\ -label {\n\ - cursor: pointer;\n\ -}\n\ -a[href=\"javascript:;\"] {\n\ - text-decoration: none;\n\ -}\n\ -.warning {\n\ - color: red;\n\ -}\n\ -:root.sw-yotsuba #boardNavDesktop, :root.sw-yotsuba #boardNavMobile {\n\ - display: none !important;\n\ -}\n\ -:root.hide-bottom-board-list $site$boardListBottom {\n\ - display: none;\n\ -}\n\ -body.hasDropDownNav{\n\ - margin-top: 5px;\n\ -}\n\ -:root:not(.keyboard-focus) a {\n\ - outline: none;\n\ -}\n\ -.painted {\n\ - border-radius: 3px;\n\ - padding: 0px 2px;\n\ -}\n\ -[hidden] {\n\ - display: none !important;\n\ -}\n\ -/* 4chan style fixes */\n\ -/* overrides 4chan CSS on div.opContainer, div.op */\n\ -:root.sw-yotsuba .opContainer, :root.sw-yotsuba .op {\n\ - display: block;\n\ - overflow: visible;\n\ -}\n\ -:root.sw-yotsuba .reply > .file > .fileText {\n\ - margin: 0 20px;\n\ -}\n\ -:root.sw-yotsuba #arc-list span.quote {\n\ - color: #789922;\n\ -}\n\ -:root.sw-yotsuba .fileText a {\n\ - unicode-bidi: -moz-isolate;\n\ - unicode-bidi: -webkit-isolate;\n\ -}\n\ -:root.sw-yotsuba #g-recaptcha {\n\ - min-height: 78px;\n\ - height: auto;\n\ -}\n\ -:root.sw-yotsuba:not(.js-enabled) #postForm {\n\ - display: table;\n\ -}\n\ -:root.sw-yotsuba #captchaContainerAlt td:nth-child(2) {\n\ - display: table-cell !important;\n\ -}\n\ -:root.sw-yotsuba canvas#tegaki-canvas {\n\ - background: none;\n\ -}\n\ -/* Disable obnoxious captcha fade-in. */\n\ -:root.sw-yotsuba > body > div:last-of-type {\n\ - transition: none !important;\n\ -}\n\ -/* Fix captcha scrolling to top of page. */\n\ -:root.sw-yotsuba > body > div[style*=\" top: -10000px;\"] {\n\ - visibility: hidden !important;\n\ -}\n\ -/* Make long filenames wrap properly: https://github.com/ccd0/4chan-x/issues/1082 */\n\ -:root.sw-yotsuba .post > .file {\n\ - /* currently nonstandard but may be added: https://lists.w3.org/Archives/Public/www-style/2016Mar/0352.html, https://bugzilla.mozilla.org/show_bug.cgi?id=1296042 */\n\ - word-break: break-word;\n\ -}\n\ -:root.sw-yotsuba:not(.ua-webkit):not(.ua-blink) .fileText {\n\ - word-wrap: break-word;\n\ - max-width: calc(100vw - 90px);\n\ -}\n\ -:root.sw-yotsuba > body.is_catalog .thread > a > img {\n\ - display: inline-block;\n\ -}\n\ -/* Links to NSFW boards */\n\ -:root.sw-yotsuba .nwsb {\n\ - display: inline;\n\ -}\n\ -:root.sw-yotsuba .fileText {\n\ - max-width: auto;\n\ - white-space: normal;\n\ -}\n\ -/* Ads */\n\ -:root.sw-yotsuba .ad-cnt > *, :root.sw-yotsuba .adg-rects > *, :root.sw-yotsuba .bsa-cnt {\n\ - height: auto !important;\n\ -}\n\ -:root.sw-yotsuba:not(.ads-loaded) hr.abovePostForm,\n\ -:root.sw-yotsuba:not(.ads-loaded) .adg-rects > hr,\n\ -:root.sw-yotsuba #adg-ol + hr,\n\ -:root.sw-yotsuba .danbo-slot:empty {\n\ - display: none;\n\ -}\n\ -:root.sw-yotsuba .adg-rects {\n\ - margin: 0;\n\ - font-size: 0;\n\ -}\n\ -:root.sw-yotsuba div.center[style] {\n\ - display: none !important;\n\ -}\n\ -/* Tinyboard / vichan conflicts */\n\ -#menu > .hide-thread-link {\n\ - width: auto;\n\ - height: auto;\n\ - overflow: visible;\n\ - background-image: none;\n\ -}\n\ -#menu label.entry {\n\ - display: block;\n\ -}\n\ -#fourchanx-settings label {\n\ - display: inline;\n\ -}\n\ -.intro a[href=\"javascript:;\"],\n\ -#menu a {\n\ - margin: 0;\n\ -}\n\ -.gal-buttons.gal-buttons a {\n\ - font-size: inherit;\n\ -}\n\ -:root.sw-tinyboard.fixed.top-header:not(.autohide) .boardlist,\n\ -:root.sw-tinyboard.fixed.top-header:not(.autohide) .bar.top {\n\ - position: static;\n\ -}\n\ -:root.sw-tinyboard.fixed.top-header:not(.autohide) div.pages.top {\n\ - top: auto;\n\ - bottom: 0;\n\ -}\n\ -:root.sw-tinyboard.fixed.top-header.autohide .boardlist,\n\ -:root.sw-tinyboard.fixed.top-header.autohide .bar.top {\n\ - z-index: 3;\n\ -}\n\ -/* Tinyboard site style conflicts */\n\ -:root[data-host=\"fufufu.moe\"].fixed.top-header:not(.autohide) div.pages.top {\n\ - top: 26px;\n\ - bottom: auto;\n\ -}\n\ -:root[data-host=\"merorin.com\"].fixed.top-header:not(.autohide) span.settings {\n\ - top: 26px;\n\ -}\n\ -:root[data-host=\"fufufu.moe\"]:not(.fixed) #header-bar {\n\ - margin-top: 38px;\n\ -}\n\ -:root[data-host=\"lainchan.org\"]:not(.fixed) #header-bar {\n\ - margin-top: 17px;\n\ -}\n\ -:root[data-host=\"smuglo.li\"]:not(.fixed) #header-bar {\n\ - margin-top: 8px;\n\ -}\n\ -/* Anti-autoplay */\n\ -audio.controls-added {\n\ - display: block;\n\ - margin: auto;\n\ - white-space: normal;\n\ -}\n\ -:root.anti-autoplay div.embed {\n\ - position: static;\n\ - width: auto;\n\ - height: auto;\n\ - text-align: center;\n\ -}\n\ -:root.anti-autoplay .autoplay-removed {\n\ - visibility: visible !important;\n\ - min-width: 640px;\n\ - min-height: 360px;\n\ -}\n\ -/* fixed, z-index */\n\ -#overlay,\n\ -#qp, #ihover,\n\ -#navlinks, .fixed #header-bar,\n\ -:root.float #updater,\n\ -:root.float #thread-stats,\n\ -#qr {\n\ - position: fixed;\n\ -}\n\ -#overlay {\n\ - z-index: 999;\n\ -}\n\ -#qp, #ihover {\n\ - z-index: 60;\n\ -}\n\ -#menu, .gal-buttons {\n\ - z-index: 50;\n\ -}\n\ -#updater, #thread-stats {\n\ - z-index: 40;\n\ -}\n\ -:root.fixed #header-bar, #notifications {\n\ - z-index: 35;\n\ -}\n\ -#a-gallery {\n\ - z-index: 30;\n\ -}\n\ -#navlinks {\n\ - z-index: 25;\n\ -}\n\ -#qr {\n\ - z-index: 20;\n\ -}\n\ -#embedding {\n\ - z-index: 11;\n\ -}\n\ -:root.fixed-watcher #thread-watcher {\n\ - z-index: 10;\n\ -}\n\ -:root.fixed:not(.gallery-open) #header-bar:not(:hover) {\n\ - z-index: 8;\n\ -}\n\ -#thread-watcher {\n\ - z-index: 5;\n\ -}\n\ -/* Header */\n\ -.fixed.top-header body {\n\ - padding-top: 2em;\n\ -}\n\ -.fixed.bottom-header body {\n\ - padding-bottom: 2em;\n\ -}\n\ -.fixed #header-bar {\n\ - right: 0;\n\ - left: 0;\n\ - padding: 3px 4px 4px;\n\ - font-size: 12px;\n\ -}\n\ -.fixed.top-header #header-bar {\n\ - top: 0;\n\ -}\n\ -.fixed.bottom-header #header-bar {\n\ - bottom: 0;\n\ -}\n\ -#header-bar {\n\ - border-width: 0;\n\ - transition: all .1s .05s ease-in-out;\n\ -}\n\ -:root.fixed #header-bar {\n\ - box-shadow: -5px 1px 10px rgba(0, 0, 0, 0.20);\n\ -}\n\ -:root.centered-links #shortcuts {\n\ - width: 300px;\n\ - text-align: right;\n\ -}\n\ -:root.centered-links #header-bar {\n\ - text-align: center;\n\ -}\n\ -#custom-board-list {\n\ - font-size: 13px;\n\ - vertical-align: middle;\n\ -}\n\ -#full-board-list {\n\ - vertical-align: middle;\n\ -}\n\ -:root.centered-links #custom-board-list {\n\ - position: relative;\n\ - left: 150px;\n\ -}\n\ -.fixed.top-header #header-bar {\n\ - border-bottom-width: 1px;\n\ -}\n\ -.fixed.bottom-header #header-bar {\n\ - box-shadow: 0 -1px 2px rgba(0, 0, 0, .15);\n\ - border-top-width: 1px;\n\ -}\n\ -.fixed.bottom-header #header-bar .menu-button i {\n\ - border-top: none;\n\ - border-bottom: 6px solid;\n\ -}\n\ -.fixed #header-bar.autohide:not(:hover) {\n\ - box-shadow: none;\n\ - transition: all .8s .6s cubic-bezier(.55, .055, .675, .19);\n\ -}\n\ -.fixed.top-header #header-bar.autohide:not(:hover) {\n\ - margin-bottom: -1em;\n\ - -webkit-transform: translateY(-100%);\n\ - transform: translateY(-100%);\n\ -}\n\ -.fixed.bottom-header #header-bar.autohide:not(:hover) {\n\ - -webkit-transform: translateY(100%);\n\ - transform: translateY(100%);\n\ -}\n\ -#scroll-marker {\n\ - left: 0;\n\ - right: 0;\n\ - height: 10px;\n\ - position: absolute;\n\ -}\n\ -#header-bar:not(.autohide) #scroll-marker {\n\ - pointer-events: none;\n\ -}\n\ -#header-bar #scroll-marker {\n\ - display: none;\n\ -}\n\ -.fixed #header-bar #scroll-marker {\n\ - display: block;\n\ -}\n\ -.fixed.top-header #header-bar #scroll-marker {\n\ - top: 100%;\n\ -}\n\ -.fixed.bottom-header #header-bar #scroll-marker {\n\ - bottom: 100%;\n\ -}\n\ -#board-list a, #shortcuts a:not(.entry) {\n\ - text-decoration: none;\n\ - padding: 1px;\n\ -}\n\ -#shortcuts:empty {\n\ - display: none;\n\ -}\n\ -.brackets-wrap::before {\n\ - content: \"\\00a0[\";\n\ -}\n\ -.brackets-wrap::after {\n\ - content: \"]\\00a0\";\n\ -}\n\ -.dead-thread,\n\ -.disabled:not(.replies-quoting-you) {\n\ - opacity: .45;\n\ -}\n\ -#shortcuts {\n\ - float: right;\n\ -}\n\ -:root.autohiding-scrollbar #shortcuts {\n\ - margin-right: 12px;\n\ -}\n\ -.shortcut {\n\ - margin-left: 3px;\n\ - vertical-align: middle;\n\ -}\n\ -:root.shortcut-icons .native-settings {\n\ - font-size: 0;\n\ - color: transparent;\n\ - display: inline-block;\n\ - vertical-align: top;\n\ - height: 12px;\n\ - width: 14px;\n\ - background: url('//s.4cdn.org/image/favicon.ico') 0px -1px no-repeat;\n\ -}\n\ -#navbotright,\n\ -#navtopright {\n\ - display: none;\n\ -}\n\ -#toggleMsgBtn {\n\ - display: none !important;\n\ -}\n\ -.current,\n\ -:root.sw-yotsuba div#boardNavDesktopFoot a.current {\n\ - font-weight: bold;\n\ -}\n\ -@media (min-width: 1300px) {\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #header-bar {\n\ - white-space: nowrap;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: center;\n\ - align-items: center;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #board-list {\n\ - -webkit-flex: auto;\n\ - flex: auto;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list {\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) .hide-board-list-container {\n\ - -webkit-flex: none;\n\ - flex: none;\n\ - margin-right: 5px;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList {\n\ - -webkit-flex: auto;\n\ - flex: auto;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - width: 0px; /* XXX Fixes Edge not shrinking the board list below default size when needed */\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > a,\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span:not(.space):not(.spacer) {\n\ - -webkit-flex: none;\n\ - flex: none;\n\ - padding: .17em;\n\ - margin: -.17em -.32em;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span {\n\ - pointer-events: none;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span.space {\n\ - -webkit-flex: 0 .63 .63em;\n\ - flex: 0 .63 .63em;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span.spacer {\n\ - -webkit-flex: 0 .38 .38em;\n\ - flex: 0 .38 .38em;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #shortcuts {\n\ - float: initial;\n\ - -webkit-flex: none;\n\ - flex: none;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: center;\n\ - align-items: center;\n\ - }\n\ -}\n\ -/* 4chan X link brackets */\n\ -.brackets-wrap::before {\n\ - content: \"[\";\n\ -}\n\ -.brackets-wrap::after {\n\ - content: \"]\";\n\ -}\n\ -/* Notifications */\n\ -#notifications {\n\ - position: fixed;\n\ - top: 0;\n\ - height: 0;\n\ - text-align: center;\n\ - right: 0;\n\ - left: 0;\n\ - visibility: visible;\n\ -}\n\ -#notifications:empty {\n\ - display: none;\n\ -}\n\ -:root.fixed.top-header:not(.gallery-open) #header-bar #notifications,\n\ -:root.fixed.top-header #header-bar.autohide #notifications {\n\ - position: absolute;\n\ - top: 100%;\n\ -}\n\ -.notification {\n\ - color: #FFF;\n\ - font-weight: 700;\n\ - text-shadow: 0 1px 2px rgba(0, 0, 0, .5);\n\ - box-shadow: 0 1px 2px rgba(0, 0, 0, .15);\n\ - border-radius: 2px;\n\ - margin: 1px auto;\n\ - width: 550px;\n\ - max-width: 100%;\n\ - position: relative;\n\ - transition: all .25s ease-in-out;\n\ -}\n\ -.notification.error {\n\ - background-color: hsla(0, 100%, 38%, .9);\n\ -}\n\ -.notification.warning {\n\ - background-color: hsla(36, 100%, 38%, .9);\n\ -}\n\ -.notification.info {\n\ - background-color: hsla(200, 100%, 38%, .9);\n\ -}\n\ -.notification.success {\n\ - background-color: hsla(104, 100%, 38%, .9);\n\ -}\n\ -.notification a {\n\ - color: white;\n\ -}\n\ -.notification > .close {\n\ - padding: 7px;\n\ - top: 0px;\n\ - right: 5px;\n\ - position: absolute;\n\ -}\n\ -.notification > .fa-times::before {\n\ - font-size: 11px !important;\n\ -}\n\ -.message {\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ - padding: 6px 20px;\n\ - max-height: 200px;\n\ - width: 100%;\n\ - overflow: auto;\n\ - white-space: pre-line;\n\ -}\n\ -.message a {\n\ - text-decoration: underline;\n\ -}\n\ -:root.tainted .report-error {\n\ - display: none;\n\ -}\n\ -/* Settings */\n\ -:root.fourchan-x body {\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ -}\n\ -#overlay {\n\ - background-color: rgba(0, 0, 0, .5);\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - top: 0;\n\ - left: 0;\n\ - height: 100%;\n\ - width: 100%;\n\ -}\n\ -#fourchanx-settings {\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ - box-shadow: 0 0 15px rgba(0, 0, 0, .15);\n\ - height: 600px;\n\ - max-height: 100%;\n\ - width: 900px;\n\ - max-width: 100%;\n\ - margin: auto;\n\ - padding: 5px;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-flex-direction: column;\n\ - flex-direction: column;\n\ -}\n\ -#fourchanx-settings > nav {\n\ - padding: 2px 2px 8px;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ -}\n\ -#fourchanx-settings > nav a {\n\ - text-decoration: underline;\n\ -}\n\ -#fourchanx-settings > nav a.close {\n\ - text-decoration: none;\n\ - padding: 0 2px;\n\ - margin: 0;\n\ -}\n\ -.section-container {\n\ - -webkit-flex: 1;\n\ - flex: 1;\n\ - position: relative;\n\ - overflow: auto;\n\ - padding-right: 5px;\n\ - overscroll-behavior: contain;\n\ -}\n\ -.sections-list {\n\ - -webkit-flex: 1;\n\ - flex: 1;\n\ -}\n\ -.export, .import, .reset {\n\ - cursor: pointer;\n\ - text-decoration: none !important;\n\ -}\n\ -.tab-selected {\n\ - font-weight: 700;\n\ -}\n\ -.section-sauce ul,\n\ -.section-advanced ul {\n\ - list-style: none;\n\ - margin: 0;\n\ -}\n\ -.section-sauce ul {\n\ - padding: 8px;\n\ -}\n\ -.section-advanced ul {\n\ - padding: 0px;\n\ -}\n\ -.section-sauce li,\n\ -.section-advanced li {\n\ - padding-left: 4px;\n\ -}\n\ -.section-main ul {\n\ - margin: 0;\n\ - padding: 0 0 0 16px;\n\ -}\n\ -.section-main li {\n\ - white-space: pre-line;\n\ - list-style: disc;\n\ -}\n\ -.section-main li:not(:first-of-type) {\n\ - margin-top: 4px;\n\ -}\n\ -.section-main label {\n\ - text-decoration: underline;\n\ -}\n\ -div[data-checked=\"false\"] > .suboption-list {\n\ - display: none;\n\ -}\n\ -.suboption-list {\n\ - position: relative;\n\ -}\n\ -.suboption-list::before {\n\ - content: \"\";\n\ - display: inline-block;\n\ - position: absolute;\n\ - left: .7em;\n\ - width: 0;\n\ - height: 100%;\n\ - border-left: 1px solid;\n\ -}\n\ -.suboption-list > div {\n\ - position: relative;\n\ - padding-left: 1.4em;\n\ -}\n\ -.suboption-list > div::before {\n\ - content: \"\";\n\ - display: inline-block;\n\ - position: absolute;\n\ - left: .7em;\n\ - width: .7em;\n\ - height: .6em;\n\ - border-left: 1px solid;\n\ - border-bottom: 1px solid;\n\ -}\n\ -#fourchanx-settings .section-main p {\n\ - margin: .5em 0 0;\n\ -}\n\ -.section-filter ul {\n\ - padding: 0;\n\ -}\n\ -.section-filter li {\n\ - margin: 10px 40px;\n\ - list-style: disc;\n\ -}\n\ -.section-filter textarea {\n\ - height: 500px;\n\ -}\n\ -.section-main a, .section-filter a, .section-advanced a {\n\ - text-decoration: underline;\n\ -}\n\ -#sauce-doc-expand:not(:checked) ~ #sauce-doc {\n\ - max-height: 130px;\n\ - overflow: auto;\n\ -}\n\ -#sauce-doc > label {\n\ - float: right;\n\ - margin: 0 5px;\n\ -}\n\ -/* XXX for OneeChan */\n\ -#sauce-doc-expand + .riceCheck {\n\ - display: none;\n\ -}\n\ -.section-sauce textarea {\n\ - height: 430px;\n\ -}\n\ -.section-advanced .field[name=\"boardnav\"] {\n\ - width: 100%;\n\ -}\n\ -.section-advanced textarea {\n\ - height: 150px;\n\ -}\n\ -.section-advanced textarea[name=\"archiveLists\"],\n\ -.section-advanced textarea[name=\"externalCatalogURLs\"],\n\ -.section-advanced textarea[name=\"knownBanners\"] {\n\ - height: 75px;\n\ -}\n\ -.section-advanced .archive-cell {\n\ - min-width: 160px;\n\ - text-align: center;\n\ -}\n\ -.section-advanced #archive-board-select {\n\ - position: absolute;\n\ -}\n\ -.section-advanced .note {\n\ - font-size: 0.8em;\n\ - font-style: italic;\n\ - margin-left: 10px;\n\ -}\n\ -.section-advanced .note code {\n\ - font-style: normal;\n\ - font-size: 11px;\n\ -}\n\ -.favicon-preview > img {\n\ - vertical-align: middle;\n\ -}\n\ -.favicon-preview > img:nth-of-type(3n+1) {\n\ - margin-left: 4px;\n\ -}\n\ -.section-keybinds .field {\n\ - font-family: monospace;\n\ -}\n\ -#fourchanx-settings fieldset {\n\ - border: 1px solid;\n\ - border-radius: 3px;\n\ - padding: 0.35em 0.625em 0.75em;\n\ - margin: 0px 2px;\n\ -}\n\ -#fourchanx-settings legend {\n\ - font-weight: 700;\n\ - color: inherit;\n\ -}\n\ -#fourchanx-settings textarea {\n\ - font-family: monospace;\n\ - width: 100%;\n\ - resize: vertical;\n\ -}\n\ -#fourchanx-settings code {\n\ - color: #000;\n\ - background-color: #FFF;\n\ - padding: 0 2px;\n\ -}\n\ -#fourchanx-settings th {\n\ - text-align: center;\n\ - font-weight: bold;\n\ -}\n\ -#fourchanx-settings p {\n\ - margin: 1em 0px;\n\ -}\n\ -#fourchanx-settings table {\n\ - margin: auto;\n\ -}\n\ -/* Index */\n\ -:root.index-loading .navLinks:not(.json-index),\n\ -:root.index-loading .board:not(.json-index),\n\ -:root.index-loading .pagelist:not(.json-index),\n\ -:root.infinite-mode .pagelist,\n\ -:root.all-pages-mode .pagelist,\n\ -:root.catalog-mode .pagelist,\n\ -:root:not(.catalog-mode) .indexlink,\n\ -:root.catalog-mode .cataloglink,\n\ -:root:not(.catalog-mode) #hidden-label,\n\ -:root:not(.catalog-mode) #index-size {\n\ - display: none;\n\ -}\n\ -#index-search {\n\ - padding-right: 1.5em;\n\ - width: 100px;\n\ - transition: color .25s, border-color .25s, width .25s;\n\ -}\n\ -#index-search:focus,\n\ -#index-search[data-searching] {\n\ - width: 200px;\n\ -}\n\ -#index-search-clear {\n\ - color: gray;\n\ - display: inline-block;\n\ - position: relative;\n\ - left: -1em;\n\ - width: 0;\n\ -}\n\ -/* ``::-webkit-*'' selectors break selector lists on Firefox. */\n\ -#index-search::-webkit-search-cancel-button {\n\ - display: none;\n\ -}\n\ -#index-search:not([data-searching]) + #index-search-clear {\n\ - display: none;\n\ -}\n\ -#index-options {\n\ - float: right;\n\ -}\n\ -#lastlong-options {\n\ - display: inline-block;\n\ - vertical-align: middle;\n\ - height: 28px;\n\ - margin: -14px 0;\n\ -}\n\ -#lastlong-options > input {\n\ - padding: 0;\n\ - border: 0 !important;\n\ - text-align: center;\n\ - background: transparent;\n\ - display: block;\n\ - font-size: 12px;\n\ - height: 12px;\n\ - width: 30px;\n\ - margin: 1px 0;\n\ -}\n\ -.summary {\n\ - text-decoration: none;\n\ -}\n\ -/* Catalog */\n\ -:root.catalog-mode .board {\n\ - text-align: center;\n\ -}\n\ -.catalog-thread {\n\ - display: inline-block;\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ - border: 1px solid transparent;\n\ - word-wrap: break-word;\n\ - vertical-align: top;\n\ - position: relative;\n\ -}\n\ -/* overrides 4chan CSS on div.thread */\n\ -.catalog-thread.catalog-thread {\n\ - margin: 2px;\n\ -}\n\ -.catalog-small > .catalog-thread {\n\ - width: 165px;\n\ - height: 320px;\n\ -}\n\ -.catalog-large > .catalog-thread {\n\ - width: 270px;\n\ - height: 410px;\n\ -}\n\ -:root.catalog-hover-expand .catalog-thread:hover {\n\ - z-index: 1;\n\ -}\n\ -.catalog-container {\n\ - position: absolute;\n\ - top: -4px;\n\ - left: 0;\n\ - right: 0;\n\ - bottom: 0;\n\ -}\n\ -.catalog-container:not(:hover),\n\ -:root:not(.catalog-hover-expand) .catalog-container {\n\ - overflow: hidden;\n\ -}\n\ -.catalog-post {\n\ - position: absolute;\n\ - top: 4px;\n\ - left: 0;\n\ - right: 0;\n\ - border: 1px solid transparent;\n\ - padding-top: 20px;\n\ -}\n\ -/* overrides inline CSS from Index.cb.hoverAdjust */\n\ -:root:not(.catalog-hover-expand) .catalog-post {\n\ - left: 0 !important;\n\ - right: 0 !important;\n\ -}\n\ -/* overrides 4chan CSS on div.post */\n\ -.catalog-post.catalog-post {\n\ - margin: -21px -1px -1px;\n\ - overflow: visible;\n\ -}\n\ -.catalog-thread.noFile > * > .catalog-post {\n\ - margin-top: -7px;\n\ - padding-top: 6px;\n\ -}\n\ -:root.catalog-hover-expand .catalog-container:hover > .catalog-post {\n\ - margin-left: -61px;\n\ - margin-right: -61px;\n\ -}\n\ -:root.catalog-hover-expand .catalog-container:hover > * > :not(.catalog-replies) {\n\ - padding-left: 2px;\n\ - padding-right: 2px;\n\ -}\n\ -.catalog-link {\n\ - display: block;\n\ - position: relative;\n\ -}\n\ -.catalog-thumb {\n\ - border-radius: 2px;\n\ - box-shadow: 0 0 5px rgba(0, 0, 0, .25);\n\ - vertical-align: top;\n\ -}\n\ -.catalog-thumb.spoiler-file {\n\ - width: 100px;\n\ - height: 100px;\n\ -}\n\ -.catalog-thumb.deleted-file {\n\ - width: 127px;\n\ - height: 13px;\n\ - padding: 20px 11px;\n\ -}\n\ -.catalog-thumb.no-file {\n\ - width: 77px;\n\ - height: 13px;\n\ - padding: 20px 36px;\n\ -}\n\ -.catalog-icons > img,\n\ -.catalog-stats > .menu-button {\n\ - width: 1em;\n\ - height: 1em;\n\ - margin: 0;\n\ - vertical-align: text-top;\n\ - padding-left: 2px;\n\ -}\n\ -.catalog-stats > .menu-button {\n\ - font-weight: normal;\n\ -}\n\ -.catalog-stats > .menu-button > i::before {\n\ - line-height: 11px;\n\ -}\n\ -.catalog-stats {\n\ - font-size: 10px;\n\ - font-weight: 700;\n\ - padding-top: 2px;\n\ -}\n\ -.catalog-stats > [title] {\n\ - cursor: help;\n\ -}\n\ -.catalog-post > .postMessage {\n\ - margin: 0;\n\ - padding-bottom: .3em;\n\ -}\n\ -.catalog-container:not(:hover) > * > .file,\n\ -.catalog-container:not(:hover) > * > .postInfo > :not(.subject),\n\ -.catalog-container:not(:hover) > * > .catalog-replies,\n\ -.catalog-container:not(:hover) .extra-linebreak,\n\ -.catalog-container:not(:hover) .abbr,\n\ -:root:not(.catalog-hover-expand) .catalog-container > * > .file,\n\ -:root:not(.catalog-hover-expand) .catalog-container > * > .postInfo > :not(.subject),\n\ -:root:not(.catalog-hover-expand) .catalog-container > * > .catalog-replies,\n\ -:root:not(.catalog-hover-expand) .catalog-container .extra-linebreak,\n\ -:root:not(.catalog-hover-expand) .catalog-container .abbr,\n\ -.catalog-thread > .catalog-container > :not(.catalog-post),\n\ -.catalog-post > .file > :not(.fileText),\n\ -.catalog-post > * > .fileText > :not(:first-child),\n\ -.catalog-post > .postInfo > :not(.subject):not(.nameBlock):not(.dateTime),\n\ -.catalog-post > .postInfo > .nameBlock > .contact-links,\n\ -.catalog-post > * > * > .posteruid,\n\ -.catalog-post > * > * > .postJumper,\n\ -:root.bottom-backlinks .catalog-post > .container,\n\ -.post:not(.catalog-post) > .catalog-link,\n\ -.post:not(.catalog-post) > .catalog-stats,\n\ -.post:not(.catalog-post) > .catalog-replies {\n\ - display: none;\n\ -}\n\ -.catalog-post > .file {\n\ - position: absolute;\n\ - left: 0;\n\ - right: 0;\n\ - top: 0;\n\ - min-height: 20px;\n\ - background-color: inherit;\n\ -}\n\ -.catalog-post > * > .fileText {\n\ - position: relative;\n\ - padding: 2px;\n\ - background-color: inherit;\n\ -}\n\ -.catalog-small .catalog-post > * .fileText {\n\ - font-size: 10px;\n\ -}\n\ -.catalog-post > * > .fileText:not(:hover) {\n\ - white-space: nowrap;\n\ - overflow: hidden;\n\ - text-overflow: ellipsis;\n\ -}\n\ -.catalog-post > * > .fileText:hover {\n\ - z-index: 1;\n\ -}\n\ -/* overrides 4chan CSS on div.post div.postInfo */\n\ -.catalog-post > .postInfo.postInfo {\n\ - width: auto;\n\ -}\n\ -.catalog-post > * > .subject {\n\ - display: block;\n\ -}\n\ -.catalog-post > * > .dateTime {\n\ - display: inline-block;\n\ - font-style: italic;\n\ -}\n\ -:root.catalog-hover-expand .catalog-container:hover > * > * > .nameBlock,\n\ -:root.catalog-hover-expand .catalog-container:hover > * > * > .dateTime,\n\ -:root.catalog-hover-expand .catalog-container:hover > * > .postMessage:not(:empty) {\n\ - padding-top: .3em;\n\ -}\n\ -.catalog-post .extra-linebreak {\n\ - content: ''; /* makes this work in Blink/WebKit */\n\ - display: block;\n\ - margin-top: .3em;\n\ -}\n\ -.catalog-reply {\n\ - text-align: left;\n\ - white-space: nowrap;\n\ - border-top: 1px solid transparent;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-flex-direction: row;\n\ - flex-direction: row;\n\ - -webkit-align-items: stretch;\n\ - align-items: stretch;\n\ -}\n\ -.catalog-reply > * {\n\ - padding: 3px;\n\ - overflow: hidden;\n\ - -webkit-flex: none;\n\ - flex: none;\n\ -}\n\ -.catalog-reply > span {\n\ - font-style: italic;\n\ - font-weight: bold;\n\ -}\n\ -.catalog-reply-excerpt {\n\ - -webkit-flex: 1 1 auto;\n\ - flex: 1 1 auto;\n\ -}\n\ -.catalog-post .prettyprinted {\n\ - max-width: 100%;\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ -}\n\ -.catalog-post .MathJax_Display {\n\ - text-align: center !important;\n\ -}\n\ -.catalog-container:not(:hover) .exif,\n\ -:root:not(.catalog-hover-expand) .catalog-container .exif {\n\ - display: none !important;\n\ -}\n\ -.catalog-post > * > .exif {\n\ - border-collapse: collapse;\n\ -}\n\ -:root.catalog-hover-expand .catalog-container:hover .exif[style*=\"display: block;\"] {\n\ - display: inline-block !important;\n\ -}\n\ -.catalog-post > * > .exif,\n\ -.catalog-post > * > .exif > tbody {\n\ - background-color: inherit;\n\ -}\n\ -.catalog-post > * > .exif,\n\ -.catalog-post > * > .exif td {\n\ - min-width: 0;\n\ -}\n\ -.catalog-post > * > .exif td {\n\ - padding-top: 1px;\n\ -}\n\ -:root.hats-enabled .catalog-thread::after {\n\ - content: '';\n\ - pointer-events: none;\n\ - position: absolute;\n\ - background-size: contain;\n\ -}\n\ -:root.hats-enabled .catalog-small > .catalog-thread::after {\n\ - left: -8px;\n\ - top: -59px;\n\ - width: 96px;\n\ - height: 96px;\n\ -}\n\ -:root.hats-enabled:not(.werkTyme) .catalog-small > .catalog-thread:not(.noFile)::after {\n\ - left: calc(67px - .3px * var(--tn-w));\n\ -}\n\ -:root.hats-enabled .catalog-large > .catalog-thread::after {\n\ - left: -15px;\n\ - top: -98px;\n\ - width: 160px;\n\ - height: 160px;\n\ -}\n\ -:root.hats-enabled:not(.werkTyme) .catalog-large > .catalog-thread:not(.noFile)::after {\n\ - left: calc(110px - .5px * var(--tn-w));\n\ -}\n\ -/* Copy Text Link's textarea element */\n\ -textarea.copy-text-element {\n\ - height: 0;\n\ - width: 0;\n\ - position: absolute;\n\ - top: -10000px;\n\ -}\n\ -/* Announcement Hiding */\n\ -:root.hide-announcement $site$psa {\n\ - display: none;\n\ -}\n\ -.hide-announcement-button {\n\ - opacity: 0.4;\n\ - float: left;\n\ -}\n\ -/* Unread */\n\ -.unread-line {\n\ - margin: 0;\n\ - border-color: rgb(255,0,0);\n\ -}\n\ -.unread-line + br {\n\ - display: none;\n\ -}\n\ -.unread-mark-read {\n\ - float: right;\n\ - clear: both;\n\ - width: 100%;\n\ - text-align: right;\n\ -}\n\ -:not(.unread-thread) > .unread-mark-read {\n\ - display: none;\n\ -}\n\ -/* Thread Updater */\n\ -#updater {\n\ - background: none;\n\ - border: none;\n\ - box-shadow: none;\n\ -}\n\ -#updater > .move {\n\ - position: absolute;\n\ - top: -5px;\n\ - bottom: -5px;\n\ - left: -5px;\n\ - right: -5px;\n\ - z-index: -1;\n\ -}\n\ -#updater > div:last-child {\n\ - text-align: center;\n\ -}\n\ -#updater input[type=\"number\"] {\n\ - width: 4em;\n\ -}\n\ -:root.float #updater {\n\ - padding: 0px 3px;\n\ -}\n\ -:root:not(.float).shortcut-icons #updater {\n\ - display: inline-block;\n\ - min-width: 12pt;\n\ - text-align: right;\n\ -}\n\ -.new {\n\ - color: limegreen;\n\ -}\n\ -#update-status:not(.empty) + #update-timer:not(.empty):not(.loading) {\n\ - margin-left: 5px;\n\ -}\n\ -#update-timer {\n\ - cursor: pointer;\n\ -}\n\ -/* Thread Watcher */\n\ -#thread-watcher {\n\ - position: absolute;\n\ -}\n\ -#thread-watcher {\n\ - padding-bottom: 3px;\n\ - padding-left: 3px;\n\ - white-space: nowrap;\n\ - min-width: 146px;\n\ -}\n\ -#watched-threads {\n\ - overflow-x: hidden;\n\ - overflow-y: auto;\n\ -}\n\ -#thread-watcher .refresh {\n\ - padding: 0px 3px;\n\ -}\n\ -:root.fixed-watcher #thread-watcher {\n\ - position: fixed;\n\ -}\n\ -:root.fixed-watcher #watched-threads {\n\ - /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */\n\ - max-height: 85vh;\n\ - max-height: calc(100vh - 75px);\n\ -}\n\ -:root:not(.fixed-watcher) #watched-threads:not(:hover) {\n\ - max-height: 210px;\n\ - overflow-y: hidden;\n\ -}\n\ -#thread-watcher > .move {\n\ - padding-top: 3px;\n\ -}\n\ -#watched-threads > div {\n\ - padding-left: 3px;\n\ - padding-right: 3px;\n\ -}\n\ -#watched-threads .watcher-link {\n\ - max-width: 250px;\n\ - display: -webkit-inline-flex;\n\ - display: inline-flex;\n\ - -webkit-flex-direction: row;\n\ - flex-direction: row;\n\ -}\n\ -#watched-threads .watcher-page,\n\ -#watched-threads .watcher-unread {\n\ - -webkit-flex: 0 0 auto;\n\ - flex: 0 0 auto;\n\ - margin-right: 2px;\n\ -}\n\ -#watched-threads .watcher-title {\n\ - overflow: hidden;\n\ - text-overflow: ellipsis;\n\ - -webkit-flex: 0 1 auto;\n\ - flex: 0 1 auto;\n\ -}\n\ -#watched-threads .watcher-title:not(:first-child) {\n\ - margin-left: 2px;\n\ -}\n\ -.replies-quoting-you > a, #watcher-link.replies-quoting-you, .last-page > a > .watcher-page {\n\ - color: #F00;\n\ -}\n\ -#thread-watcher a {\n\ - text-decoration: none;\n\ -}\n\ -#thread-watcher .move > .close {\n\ - position: absolute;\n\ - right: 0px;\n\ - top: 0px;\n\ - padding: 0px 4px;\n\ -}\n\ -.watch-thread-link {\n\ - padding-top: 18px;\n\ - width: 18px;\n\ - height: 0px;\n\ - display: inline-block;\n\ - background-repeat: no-repeat;\n\ - opacity: 0.2;\n\ - position: relative;\n\ - top: 1px;\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -.watch-thread-link.watched {\n\ - opacity: 1;\n\ -}\n\ -/* Thread Stats */\n\ -#thread-stats {\n\ - background: none;\n\ - border: none;\n\ - box-shadow: none;\n\ -}\n\ -:root.float #thread-stats > .move > :not(#page-count) {\n\ - pointer-events: none;\n\ -}\n\ -:root.float #thread-stats {\n\ - padding: 0px 3px;\n\ -}\n\ -#page-count {\n\ - cursor: pointer;\n\ -}\n\ -/* Quote */\n\ -.hashlink::before {\n\ - content: ' ';\n\ - visibility: hidden;\n\ -}\n\ -.inline + .hashlink {\n\ - display: none !important;\n\ -}\n\ -:root.resurrect-quotes .deadlink {\n\ - text-decoration: none !important;\n\ -}\n\ -.catalog-post .qmark-ct {\n\ - display: none;\n\ -}\n\ -.backlink.deadlink:not(.forwardlink),\n\ -.quotelink.deadlink:not(.forwardlink) {\n\ - text-decoration: underline !important;\n\ -}\n\ -:root:not(.catalog-mode) .inlined {\n\ - opacity: .5;\n\ -}\n\ -#qp input, .forwarded {\n\ - display: none;\n\ -}\n\ -.quotelink.forwardlink,\n\ -.backlink.forwardlink {\n\ - text-decoration: none;\n\ - border-bottom: 1px dashed;\n\ -}\n\ -.filtered {\n\ - text-decoration: underline line-through;\n\ -}\n\ -:root.hide-backlinks .backlink.filtered,\n\ -:root.hide-backlinks .backlink.filtered + .hashlink.filtered {\n\ - display: none;\n\ -}\n\ -.postNum + .container::before {\n\ - content: \" \";\n\ -}\n\ -:root.bottom-backlinks .container {\n\ - display: block;\n\ - clear: both;\n\ - margin: 0 4px;\n\ -}\n\ -:root.bottom-backlinks .backlink {\n\ - font-size: 90%;\n\ -}\n\ -.inline {\n\ - border: 1px solid;\n\ - display: table;\n\ - margin: 2px 0;\n\ -}\n\ -.container ~ .inline {\n\ - margin-left: 20px;\n\ -}\n\ -:root.catalog-mode .inline {\n\ - display: none;\n\ -}\n\ -.inline .post {\n\ - border: 0 !important;\n\ - background-color: transparent !important;\n\ - display: table !important;\n\ - margin: 0 !important;\n\ - padding: 1px 2px !important;\n\ -}\n\ -#qp > .opContainer::after {\n\ - content: '';\n\ - clear: both;\n\ - display: table;\n\ -}\n\ -#qp .post {\n\ - border: none;\n\ - margin: 0;\n\ - padding: 2px 2px 5px;\n\ -}\n\ -#qp img {\n\ - max-height: 80vh;\n\ - max-width: 50vw;\n\ -}\n\ -/* Quote Threading */\n\ -.threadContainer {\n\ - margin-left: 20px;\n\ - border-left: 1px solid rgba(128,128,128,.3);\n\ -}\n\ -.threadOP {\n\ - clear: both;\n\ -}\n\ -/* File */\n\ -.fileText-original,\n\ -.fnswitch:hover > .fntrunc,\n\ -.fnswitch:not(:hover) > .fnfull,\n\ -.expanded-image > .post > .file > .fileThumb > video[data-md5],\n\ -.expanded-image > .post > .file > .fileThumb > img[data-md5] {\n\ - display: none;\n\ -}\n\ -.full-image[data-file-i-d] {\n\ - display: none;\n\ - cursor: pointer;\n\ -}\n\ -.expanded-image > .post > .file > .fileThumb > .full-image {\n\ - display: inline;\n\ -}\n\ -.expanded-image {\n\ - clear: left;\n\ -}\n\ -.expanding {\n\ - opacity: .5;\n\ -}\n\ -:root.fit-height .full-image {\n\ - max-height: 100vh;\n\ -}\n\ -:root.fit-height.fixed .full-image {\n\ - /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */\n\ - max-height: 93vh;\n\ - max-height: calc(100vh - 35px);\n\ -}\n\ -:root.fit-width .full-image {\n\ - max-width: 100%;\n\ -}\n\ -:root.ua-gecko.fit-width .full-image {\n\ - width: 100%;\n\ -}\n\ -.fileThumb > .warning {\n\ - clear: both;\n\ -}\n\ -#ihover {\n\ - pointer-events: none;\n\ - /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */\n\ - max-height: 95vh;\n\ - max-height: calc(100vh - 25px);\n\ - max-width: 100vw;\n\ -}\n\ -/* WEBM Metadata */\n\ -.webm-title > a::before {\n\ - content: \"title\";\n\ - text-decoration: underline;\n\ -}\n\ -.webm-title.loading > a::after {\n\ - content: \"...\";\n\ -}\n\ -.webm-title.error > a:hover::before,\n\ -.webm-title.error > a:focus::before {\n\ - content: \"error\";\n\ - text-decoration: none;\n\ -}\n\ -.webm-title > span {\n\ - cursor: text;\n\ -}\n\ -.webm-title.not-found > span::before {\n\ - content: \"not found\";\n\ -}\n\ -.webm-title:not(:hover):not(:focus) > span,\n\ -.webm-title:hover > span + a,\n\ -.webm-title:focus > span + a {\n\ - display: none;\n\ -}\n\ -/* Volume control */\n\ -input[name=\"Default Volume\"] {\n\ - width: 4em;\n\ - height: 1ex;\n\ - vertical-align: middle;\n\ - margin: 0px;\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.fappeTyme $site$replyOriginal.noFile,\n\ -:root.fappeTyme $site$replyOriginal.noFile + br {\n\ - display: none;\n\ -}\n\ -:root.werkTyme $site$thumbLink,\n\ -:root.werkTyme $site$file$thumb,\n\ -:root.werkTyme .catalog-thumb:not(.deleted-file):not(.no-file),\n\ -:root:not(.werkTyme) .werkTyme-filename {\n\ - display: none;\n\ -}\n\ -.werkTyme-filename {\n\ - font-weight: bold;\n\ - font-size: 110%;\n\ -}\n\ -:root.werkTyme .catalog-link {\n\ - box-shadow: 0 0 5px rgba(0, 0, 0, .25);\n\ - padding: 8px;\n\ - text-align: center;\n\ -}\n\ -:root.werkTyme .catalog-thumb {\n\ - box-shadow: none;\n\ - padding: 0;\n\ - vertical-align: middle;\n\ -}\n\ -.indicator {\n\ - background: rgba(255,0,0,0.8);\n\ - font-weight: bold;\n\ - display: inline-block;\n\ - min-width: 9px;\n\ - padding: 0px 2px;\n\ - margin: 0 1px;\n\ - text-align: center;\n\ - color: white;\n\ - border-radius: 2px;\n\ - cursor: pointer;\n\ -}\n\ -:root:not(.fappeTyme) #shortcut-fappe,\n\ -:root:not(.werkTyme) #shortcut-werk {\n\ - display: none;\n\ -}\n\ -/* Index/Reply Navigation */\n\ -#navlinks {\n\ - font-size: 16px;\n\ - top: 25px;\n\ - right: 10px;\n\ -}\n\ -:root.catalog-mode #navlinks {\n\ - display: none;\n\ -}\n\ -/* Highlighting */\n\ -.qphl {\n\ - outline: 2px solid rgba(216, 94, 49, .8);\n\ -}\n\ -:root.highlight-you .quotesYou$site$highlightable$op,\n\ -:root.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(221, 0, 0, .8);\n\ -}\n\ -:root.highlight-own .yourPost$site$highlightable$op,\n\ -:root.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(221, 0, 0, .8);\n\ -}\n\ -.filter-highlight$site$highlightable$op,\n\ -.filter-highlight$site$highlightable$reply {\n\ - box-shadow: inset 5px 0 rgba(221, 0, 0, .5);\n\ -}\n\ -:root.highlight-own .yourPost > $site$sideArrows,\n\ -:root.highlight-you .quotesYou > $site$sideArrows,\n\ -.filter-highlight > $site$sideArrows {\n\ - color: rgba(221, 0, 0, .8);\n\ -}\n\ -:root.highlight-own .yourPost$site$highlightable$op::after,\n\ -:root.highlight-you .quotesYou$site$highlightable$op::after,\n\ -.filter-highlight$site$highlightable$op::after {\n\ - content: \"\";\n\ - display: block;\n\ - clear: both;\n\ -}\n\ -:root:not(.werkTyme) .catalog-thread.filter-highlight .catalog-thumb,\n\ -:root.werkTyme .catalog-thread.filter-highlight:not(:hover),\n\ -:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.filter-highlight,\n\ -:root.werkTyme.catalog-hover-expand .catalog-thread.filter-highlight > .catalog-container:hover > .catalog-post,\n\ -:root.catalog $site$catalog$thread.filter-highlight$site$highlightable$catalog {\n\ - box-shadow: 0 0 3px 3px rgba(255, 0, 0, .5);\n\ -}\n\ -:root:not(.werkTyme) .catalog-thread.watched .catalog-thumb,\n\ -:root:root.werkTyme .catalog-thread.watched:not(:hover),\n\ -:root:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched,\n\ -:root.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post {\n\ - border: 2px solid rgba(255, 0, 0, .75);\n\ -}\n\ -/* Spoiler text */\n\ -:root.reveal-spoilers $site$spoiler,\n\ -:root.reveal-spoilers $site$spoiler > a {\n\ - color: white !important;\n\ -}\n\ -:root.reveal-spoilers .removed-spoiler::before {\n\ - content: \"[spoiler]\";\n\ -}\n\ -:root.reveal-spoilers .removed-spoiler::after {\n\ - content: \"[/spoiler]\";\n\ -}\n\ -/* Thread & Reply Hiding */\n\ -.hide-thread-button,\n\ -.hide-reply-button {\n\ - float: left;\n\ - margin-right: 4px;\n\ - padding: 2px;\n\ -}\n\ -$site$infoRoot a.hide-reply-button {\n\ - margin-right: 6px;\n\ - padding: 0;\n\ -}\n\ -.replacedSideArrows {\n\ - float: left;\n\ -}\n\ -.hide-thread-button:not(:hover),\n\ -.hide-reply-button:not(:hover) {\n\ - opacity: 0.4;\n\ -}\n\ -.threadContainer .hide-reply-button {\n\ - margin-left: 2px !important;\n\ - position: relative;\n\ - left: 1px;\n\ -}\n\ -.hide-thread-button {\n\ - margin-top: -1px;\n\ - width: 11px;\n\ -}\n\ -.stub ~ :not(.threadDivider) {\n\ - display: none !important;\n\ -}\n\ -.stub input {\n\ - display: inline-block;\n\ -}\n\ -$site$thread[hidden] + hr {\n\ - display: none;\n\ -}\n\ -:root.reply-hide $site$sideArrows {\n\ - display: none;\n\ -}\n\ -:root.sw-yotsuba.thread-hide .party-hat {\n\ - left: 19px;\n\ -}\n\ -/* Anonymize */\n\ -:root.anonymize $site$info$name,\n\ -:root.sw-yotsuba.anonymize .post-author:not([class*=capcode]) {\n\ - font-size: 0;\n\ -}\n\ -:root.anonymize $site$info$tripcode,\n\ -:root.sw-yotsuba.anonymize .n-pu {\n\ - display: none;\n\ -}\n\ -:root.anonymize $site$info$name::before,\n\ -:root.sw-yotsuba.anonymize .post-author:not([class*=capcode])::before {\n\ - content: \"Anonymous\";\n\ - font-size: 10pt;\n\ -}\n\ -:root.sw-yotsuba.anonymize .flashListing .name::before,\n\ -:root.sw-yotsuba.anonymize .post-last > .post-author:not([class*=capcode])::before {\n\ - font-size: 9pt;\n\ -}\n\ -/* QR */\n\ -:root.hide-original-post-form #togglePostFormLink,\n\ -#qr.autohide:not(.focus):not(:hover):not(:active) > form,\n\ -:root.thread-view #qr:not(.show-new-thread-option) select[data-name=\"thread\"],\n\ -#file-n-submit:not(.has-file) #qr-filerm {\n\ - display: none;\n\ -}\n\ -:root.hide-original-post-form #postForm {\n\ - display: none !important;\n\ -}\n\ -#qr select,\n\ -#qr-filename-container > a,\n\ -.remove,\n\ -.captcha-img {\n\ - cursor: pointer;\n\ -}\n\ -#qr {\n\ - position: fixed;\n\ - padding: 1px;\n\ - border: 1px solid transparent;\n\ - min-width: 300px;\n\ - border-radius: 3px 3px 0 0;\n\ -}\n\ -#qr > form {\n\ - /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */\n\ - max-height: 85vh;\n\ - max-height: calc(100vh - 75px);\n\ - overflow-y: auto;\n\ - overflow-x: hidden;\n\ -}\n\ -#qrtab {\n\ - border-radius: 3px 3px 0 0;\n\ -}\n\ -#qrtab {\n\ - margin-bottom: 1px;\n\ -}\n\ -#qr .close {\n\ - float: right;\n\ - padding: 0 3px;\n\ -}\n\ -.qr-link-container {\n\ - text-align: center;\n\ - margin: 16px 0;\n\ -}\n\ -.qr-link-container-bottom {\n\ - width: 200px;\n\ - position: absolute;\n\ - left: -100px;\n\ - margin-left: 50%;\n\ - text-align: center;\n\ -}\n\ -.qr-link {\n\ - border-radius: 3px;\n\ - padding: 6px 10px 5px;\n\ - font-weight: bold;\n\ - vertical-align: middle;\n\ - border-style: solid;\n\ - border-width: 1px;\n\ - font-size: 10pt;\n\ -}\n\ -.qr-link-container + #togglePostFormLink {\n\ - font-size: 10pt;\n\ - font-weight: normal;\n\ - margin: -8px 0 3.5px;\n\ -}\n\ -.persona {\n\ - width: 100%;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-flex-direction: row;\n\ - flex-direction: row;\n\ -}\n\ -.persona .field {\n\ - -webkit-flex: 1;\n\ - flex: 1;\n\ - width: 0;\n\ -}\n\ -#qr.forced-anon input[data-name=\"name\"]:not(.force-show),\n\ -#qr.forced-anon input[data-name=\"sub\"]:not(.force-show),\n\ -#qr.reply-to-thread input[data-name=\"sub\"]:not(.force-show),\n\ -body:not(.board_f) #qr select[name=\"filetag\"],\n\ -#qr.reply-to-thread select[name=\"filetag\"],\n\ -#qr:not(.has-sjis) #sjis-toggle,\n\ -#qr:not(.has-math) #tex-preview-button,\n\ -#qr.tex-preview .textarea > :not(#tex-preview),\n\ -#qr:not(.tex-preview) #tex-preview {\n\ - display: none;\n\ -}\n\ -.persona button {\n\ - -webkit-flex: 0 0 23px;\n\ - flex: 0 0 23px;\n\ - -webkit-align-self: stretch;\n\ - align-self: stretch;\n\ - border: 1px solid #BBB;\n\ - padding: 0;\n\ - background: linear-gradient(to bottom, #F8F8F8, #DCDCDC) no-repeat;\n\ - color: #000;\n\ -}\n\ -#qr.sjis-preview #sjis-toggle, #qr.tex-preview #tex-preview-button {\n\ - background: #DCDCDC;\n\ -}\n\ -#sjis-toggle, #qr.sjis-preview textarea.field {\n\ - font-family: \"IPAMonaPGothic\",\"Mona\",\"MS PGothic\",monospace;\n\ - font-size: 16px;\n\ - line-height: 17px;\n\ -}\n\ -#tex-preview-button {\n\ - font-size: 10px;\n\ -}\n\ -#tex-preview {\n\ - white-space: pre-line;\n\ -}\n\ -#qr textarea.field {\n\ - height: 14.8em;\n\ - min-height: 9em;\n\ -}\n\ -#qr.has-captcha textarea.field {\n\ - height: 9em;\n\ -}\n\ -input.field.tripped:not(:hover):not(:focus) {\n\ - color: transparent !important;\n\ - text-shadow: none !important;\n\ -}\n\ -#qr textarea {\n\ - min-width: 300px;\n\ - resize: both;\n\ -}\n\ -.field {\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ - margin: 0px;\n\ - padding: 2px 4px 3px;\n\ -}\n\ -#qr label input[type=\"checkbox\"] {\n\ - position: relative;\n\ - top: 2px;\n\ -}\n\ -/* Recaptcha v2 */\n\ -#qr .captcha-root {\n\ - position: relative;\n\ -}\n\ -#qr .captcha-container > div {\n\ - margin: auto;\n\ - width: 304px;\n\ -}\n\ -/* XXX scrollable with scroll bar hidden; prevents scroll on space press */\n\ -:root.ua-blink #qr .captcha-container > div,\n\ -:root.ua-edge #qr .captcha-container > div {\n\ - overflow: hidden;\n\ -}\n\ -:root.ua-blink #qr .captcha-container > div > div:first-of-type,\n\ -:root.ua-edge #qr .captcha-container > div > div:first-of-type {\n\ - overflow-y: scroll;\n\ - overflow-x: hidden;\n\ - padding-right: 30px;\n\ - height: 99%;\n\ - width: 100%;\n\ -}\n\ -#qr .captcha-counter {\n\ - display: block;\n\ - width: 100%;\n\ - text-align: center;\n\ - pointer-events: none;\n\ -}\n\ -#qr.captcha-open .captcha-counter {\n\ - position: absolute;\n\ - bottom: 3px;\n\ -}\n\ -#qr .captcha-counter > a {\n\ - pointer-events: auto;\n\ - display: inline-block; /* XXX https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8851747/ */\n\ -}\n\ -#qr:not(.captcha-open) .captcha-counter > a {\n\ - display: block;\n\ - width: 100%;\n\ -}\n\ -#qr.captcha-v2 #qr-captcha-iframe {\n\ - width: 302px;\n\ - height: 423px;\n\ - border: 0;\n\ - display: block;\n\ - margin: auto;\n\ -}\n\ -.goog-bubble-content {\n\ - max-width: 100vw;\n\ - max-height: 100vh;\n\ - overflow: auto;\n\ -}\n\ -.goog-bubble-content iframe {\n\ - position: static !important;\n\ -}\n\ -/* File Input, Submit Button, Oekaki */\n\ -#file-n-submit, #qr .oekaki {\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: stretch;\n\ - align-items: stretch;\n\ - height: 25px;\n\ - margin-top: 1px;\n\ -}\n\ -#file-n-submit > input, #qr-draw-button {\n\ - background: linear-gradient(to bottom, #F8F8F8, #DCDCDC) no-repeat;\n\ - border: 1px solid #BBB;\n\ - border-radius: 2px;\n\ - height: 100%;\n\ -}\n\ -#qr-file-button, #qr-draw-button {\n\ - width: 15%;\n\ -}\n\ -#file-n-submit input[type=\"submit\"] {\n\ - width: 25%;\n\ -}\n\ -#qr-filename-container {\n\ - -webkit-flex: 1 1 auto;\n\ - flex: 1 1 auto;\n\ - width: 0;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: center;\n\ - align-items: center;\n\ - position: relative;\n\ - padding: 1px;\n\ -}\n\ -input#qr-filename {\n\ - border: none !important;\n\ - background: none !important;\n\ - outline: none;\n\ -}\n\ -#qr-filename,\n\ -.has-file #qr-no-file {\n\ - display: none;\n\ -}\n\ -#qr-no-file,\n\ -.has-file #qr-filename {\n\ - -webkit-flex: 1 1 auto;\n\ - flex: 1 1 auto;\n\ - width: 0px; /* XXX Fixes filename not shrinking to allow space for buttons in Edge */\n\ - display: inline-block;\n\ - padding: 0;\n\ - padding-left: 3px;\n\ - overflow: hidden;\n\ - text-overflow: ellipsis;\n\ - white-space: nowrap;\n\ -}\n\ -#qr-no-file {\n\ - color: #AAA;\n\ -}\n\ -#qr .oekaki.has-file {\n\ - display: none;\n\ -}\n\ -#qr .oekaki > label {\n\ - -webkit-flex: 1 1 auto;\n\ - flex: 1 1 auto;\n\ - width: 0;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: center;\n\ - align-items: center;\n\ - height: 100%;\n\ -}\n\ -#qr .oekaki > label > span {\n\ - margin: 0 3px;\n\ -}\n\ -#qr .oekaki > label > input {\n\ - -webkit-flex: 1 1 auto;\n\ - flex: 1 1 auto;\n\ - width: 0;\n\ - height: 100%;\n\ -}\n\ -#qr .oekaki-bg {\n\ - position: relative;\n\ - display: inline-block;\n\ - height: 100%;\n\ - width: 10%;\n\ - margin-left: 3px;\n\ -}\n\ -#qr .oekaki-bg > * {\n\ - position: absolute;\n\ - top: 0;\n\ - left: 0;\n\ - margin: 0;\n\ -}\n\ -#qr .oekaki-bg > :not([name=\"oekaki-bgcolor\"]) {\n\ - z-index: 1;\n\ -}\n\ -#qr [name=\"oekaki-bgcolor\"] {\n\ - height: 100%;\n\ - width: 100%;\n\ - border: none;\n\ - padding: 0;\n\ -}\n\ -#qr [name=\"oekaki-bg\"]:not(:checked) ~ [name=\"oekaki-bgcolor\"] {\n\ - visibility: hidden;\n\ -}\n\ -#qr input[type=\"file\"] {\n\ - visibility: hidden;\n\ - position: absolute;\n\ -}\n\ -/* Spoiler Checkbox, QR Icons */\n\ -#qr-filename-container > label, #qr-filename-container > a {\n\ - -webkit-flex: none;\n\ - flex: none;\n\ - margin: 0;\n\ - margin-right: 3px;\n\ -}\n\ -#qr:not(.has-spoiler) #qr-spoiler-label,\n\ -#file-n-submit:not(.has-file) #qr-spoiler-label,\n\ -.has-file #paste-area,\n\ -.has-file #url-button,\n\ -#file-n-submit:not(.custom-cooldown) #custom-cooldown-button {\n\ - display: none;\n\ -}\n\ -#qr-filename-container > label {\n\ - position: relative;\n\ -}\n\ -#qr-filename-container input[type=\"checkbox\"] {\n\ - margin: 0;\n\ -}\n\ -.checkbox-letter {\n\ - font-size: 13px;\n\ - font-weight: bold;\n\ -}\n\ -#qr-filename-container label:not(:hover) > input[type=\"checkbox\"]:not(:focus):not(:checked),\n\ -#qr-filename-container label:not(:hover) > input[type=\"checkbox\"]:not(:focus):not(:checked) ~ :not(.checkbox-letter),\n\ -#qr-filename-container label:hover > .checkbox-letter,\n\ -input[type=\"checkbox\"]:focus ~ .checkbox-letter,\n\ -input[type=\"checkbox\"]:checked ~ .checkbox-letter {\n\ - /* not displayed but still focusable */\n\ - position: absolute;\n\ - opacity: 0;\n\ - pointer-events: none;\n\ -}\n\ -.checkbox-letter, #paste-area, #url-button, #custom-cooldown-button, #dump-button {\n\ - opacity: 0.6;\n\ -}\n\ -#paste-area {\n\ - font-size: 0;\n\ -}\n\ -#paste-area:focus {\n\ - opacity: 1;\n\ -}\n\ -#custom-cooldown-button.disabled {\n\ - opacity: 0.27;\n\ -}\n\ -/* Thread and Flash Tag Select */\n\ -#qr select {\n\ - background: white;\n\ - border: 1px solid #CCC;\n\ -}\n\ -#qr select[data-name=\"thread\"] {\n\ - float: right;\n\ -}\n\ -#qr > form > select {\n\ - margin-top: 1px;\n\ -}\n\ -/* Dumping UI */\n\ -.dump #dump-list-container {\n\ - display: block;\n\ -}\n\ -#dump-list-container {\n\ - display: none;\n\ - position: relative;\n\ - overflow-y: hidden;\n\ - margin-top: 1px;\n\ -}\n\ -#dump-list {\n\ - overflow-x: auto;\n\ - overflow-y: auto;\n\ - white-space: nowrap;\n\ - width: 248px;\n\ - max-height: 248px;\n\ - min-height: 90px;\n\ - max-width: 100%;\n\ - min-width: 100%;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-flex-wrap: wrap;\n\ - flex-wrap: wrap;\n\ -}\n\ -#dump-list:hover {\n\ - overflow-x: auto;\n\ -}\n\ -.qr-preview {\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ - counter-increment: thumbnails;\n\ - cursor: move;\n\ - display: inline-block;\n\ - height: 90px;\n\ - width: 90px;\n\ - padding: 2px;\n\ - opacity: .5;\n\ - overflow: hidden;\n\ - position: relative;\n\ - text-shadow: 0 0 2px #000;\n\ - -webkit-transition: opacity .25s ease-in-out, -webkit-transform .25s ease-in-out;\n\ - transition: opacity .25s ease-in-out, transform .25s ease-in-out, -webkit-transform .25s ease-in-out;\n\ - vertical-align: top;\n\ - background-size: cover;\n\ - -webkit-flex: none;\n\ - flex: none;\n\ -}\n\ -.qr-preview:hover,\n\ -.qr-preview:focus {\n\ - opacity: .9;\n\ -}\n\ -.qr-preview::before {\n\ - content: counter(thumbnails);\n\ - color: #fff;\n\ - position: absolute;\n\ - top: 3px;\n\ - right: 3px;\n\ - text-shadow: 0 0 3px #000, 0 0 8px #000;\n\ -}\n\ -.qr-preview#selected {\n\ - opacity: 1;\n\ -}\n\ -.qr-preview.drag {\n\ - box-shadow: 0 0 10px rgba(0,0,0,.5);\n\ - -webkit-transform: scale(.8);\n\ - transform: scale(.8);\n\ -}\n\ -.qr-preview.over {\n\ - border-color: #fff;\n\ - -webkit-transform: scale(1.1);\n\ - transform: scale(1.1);\n\ - opacity: 0.9;\n\ - z-index: 10;\n\ -}\n\ -.qr-preview > span {\n\ - color: #fff;\n\ -}\n\ -.remove {\n\ - background: none;\n\ - color: #e00;\n\ - padding: 1px;\n\ -}\n\ -a:only-of-type > .remove {\n\ - display: none;\n\ -}\n\ -.remove:hover::after {\n\ - content: \" Remove\";\n\ -}\n\ -.qr-preview:not(.has-file) label,\n\ -#qr:not(.has-spoiler) .qr-preview-spoiler {\n\ - display: none;\n\ -}\n\ -.qr-preview > label {\n\ - background: rgba(0,0,0,.5);\n\ - color: #fff;\n\ - right: 0;\n\ - bottom: 0;\n\ - left: 0;\n\ - position: absolute;\n\ - text-align: center;\n\ -}\n\ -.qr-preview > label > input {\n\ - margin: 0;\n\ -}\n\ -#add-post {\n\ - cursor: pointer;\n\ - font-size: 2em;\n\ - position: absolute;\n\ - bottom: 20px;\n\ - right: 10px;\n\ - -webkit-transform: translateY(-50%);\n\ - transform: translateY(-50%);\n\ -}\n\ -.textarea {\n\ - position: relative;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ -}\n\ -#char-count {\n\ - color: #000;\n\ - background: hsla(0, 0%, 100%, .5);\n\ - font-size: 8pt;\n\ - position: absolute;\n\ - bottom: 1px;\n\ - right: 1px;\n\ - pointer-events: none;\n\ -}\n\ -#char-count.warning {\n\ - color: red;\n\ -}\n\ -/* Menu */\n\ -.menu-button:not(.fa-bars) {\n\ - display: inline-block;\n\ - position: relative;\n\ - cursor: pointer;\n\ -}\n\ -#header-bar .menu-button i {\n\ - border-top: 6px solid;\n\ - border-right: 4px solid transparent;\n\ - border-left: 4px solid transparent;\n\ - display: inline-block;\n\ - margin: 2px;\n\ - vertical-align: middle;\n\ -}\n\ -.postInfo > .menu-button,\n\ -#thread-watcher .menu-button {\n\ - width: 18px;\n\ - height: 15px;\n\ - text-align: center;\n\ -}\n\ -#menu {\n\ - position: fixed;\n\ - outline: none;\n\ - font-weight: normal;\n\ -}\n\ -#menu, .submenu {\n\ - border-radius: 3px;\n\ - padding-top: 1px;\n\ - padding-bottom: 3px;\n\ -}\n\ -.entry {\n\ - cursor: pointer;\n\ - display: block;\n\ - outline: none;\n\ - padding: 2px 10px;\n\ - position: relative;\n\ - text-decoration: none;\n\ - white-space: nowrap;\n\ - min-width: 70px;\n\ - text-align: left;\n\ - text-shadow: none;\n\ - font-size: 10pt;\n\ -}\n\ -.left>.entry.has-submenu {\n\ - padding-right: 17px !important;\n\ -}\n\ -.entry input[type=\"checkbox\"],\n\ -.entry input[type=\"radio\"] {\n\ - margin: 0px;\n\ - position: relative;\n\ - top: 2px;\n\ -}\n\ -.entry input[type=\"number\"] {\n\ - width: 4.5em;\n\ -}\n\ -.entry.has-shortcut-text {\n\ - display: flex;\n\ - justify-content: space-between;\n\ - align-items: center;\n\ -}\n\ -.entry .shortcut-text {\n\ - opacity: 0.5;\n\ - font-size: 70%;\n\ - margin-left: 5px;\n\ -}\n\ -.has-submenu::after {\n\ - content: \"\";\n\ - border-left: .5em solid;\n\ - border-top: .3em solid transparent;\n\ - border-bottom: .3em solid transparent;\n\ - display: inline-block;\n\ - margin: .3em;\n\ - position: absolute;\n\ - right: 3px;\n\ -}\n\ -.left .has-submenu::after {\n\ - border-left: 0;\n\ - border-right: .5em solid;\n\ -}\n\ -.submenu {\n\ - display: none;\n\ - position: absolute;\n\ - left: 100%;\n\ - top: -1px;\n\ - margin-left: 0px;\n\ - margin-top: -2px;\n\ -}\n\ -.focused > .submenu {\n\ - display: block;\n\ -}\n\ -.imp-exp-result {\n\ - position: absolute;\n\ - text-align: center;\n\ - margin: auto;\n\ - right: 0px;\n\ - left: 0px;\n\ - width: 200px;\n\ -}\n\ -/* Custom Board Titles */\n\ -.boardTitle, .boardSubtitle {\n\ - white-space: pre-line;\n\ -}\n\ -.boardTitle[contenteditable=\"true\"],\n\ -.boardSubtitle[contenteditable=\"true\"] {\n\ - cursor: text !important;\n\ -}\n\ -/* Embedding */\n\ -.embedder:not(.embedded) > span {\n\ - display: none;\n\ -}\n\ -#embedding {\n\ - padding: 1px 4px 1px 4px;\n\ - position: fixed;\n\ -}\n\ -#embedding.empty {\n\ - display: none;\n\ -}\n\ -#embedding > div:first-child {\n\ - display: -webkit-flex;\n\ - display: flex;\n\ -}\n\ -#embedding .move {\n\ - -webkit-flex: 1;\n\ - flex: 1;\n\ -}\n\ -#embedding .jump {\n\ - margin: -1px 4px;\n\ - text-decoration: none;\n\ -}\n\ -/* Gallery */\n\ -#a-gallery {\n\ - position: fixed;\n\ - top: 0;\n\ - bottom: 0;\n\ - left: 0;\n\ - right: 0;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-flex-direction: row;\n\ - flex-direction: row;\n\ - background: rgba(0,0,0,0.7);\n\ -}\n\ -.gal-viewport {\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: stretch;\n\ - align-items: stretch;\n\ - -webkit-flex-direction: row;\n\ - flex-direction: row;\n\ - -webkit-flex: 1 1 auto;\n\ - flex: 1 1 auto;\n\ - overflow: hidden;\n\ -}\n\ -.gal-thumbnails {\n\ - -webkit-flex: 0 0 150px;\n\ - flex: 0 0 150px;\n\ - overflow-y: auto;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-flex-direction: column;\n\ - flex-direction: column;\n\ - -webkit-align-items: stretch;\n\ - align-items: stretch;\n\ - text-align: center;\n\ - background: rgba(0,0,0,.5);\n\ - border-left: 1px solid #222;\n\ -}\n\ -.gal-hide-thumbnails .gal-thumbnails {\n\ - display: none;\n\ -}\n\ -.gal-thumb img,\n\ -.gal-thumb video {\n\ - max-width: 125px;\n\ - max-height: 125px;\n\ - height: auto;\n\ - width: auto;\n\ -}\n\ -.gal-thumb {\n\ - -webkit-flex: 0 0 auto;\n\ - flex: 0 0 auto;\n\ - padding: 3px;\n\ - line-height: 0;\n\ - transition: background .2s linear;\n\ -}\n\ -.gal-highlight {\n\ - background: rgba(0, 190, 255,.8);\n\ -}\n\ -.gal-prev {\n\ - border-right: 1px solid #222;\n\ -}\n\ -.gal-next {\n\ - border-left: 1px solid #222;\n\ -}\n\ -.gal-prev,\n\ -.gal-next {\n\ - -webkit-flex: 0 0 20px;\n\ - flex: 0 0 20px;\n\ - position: relative;\n\ - cursor: pointer;\n\ - opacity: 0.7;\n\ - background-color: rgba(0, 0, 0, 0.3);\n\ -}\n\ -.gal-prev:hover,\n\ -.gal-next:hover {\n\ - opacity: 1;\n\ -}\n\ -.gal-prev::after,\n\ -.gal-next::after {\n\ - position: absolute;\n\ - top: 48.6%;\n\ - -webkit-transform: translateY(-50%);\n\ - transform: translateY(-50%);\n\ - display: inline-block;\n\ - border-top: 11px solid transparent;\n\ - border-bottom: 11px solid transparent;\n\ - content: \"\";\n\ -}\n\ -.gal-prev::after {\n\ - border-right: 12px solid #fff;\n\ - right: 5px;\n\ -}\n\ -.gal-next::after {\n\ - border-left: 12px solid #fff;\n\ - right: 3px;\n\ -}\n\ -.gal-image {\n\ - -webkit-flex: 1 0 auto;\n\ - flex: 1 0 auto;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: flex-start;\n\ - align-items: flex-start;\n\ - -webkit-justify-content: space-around;\n\ - justify-content: space-around;\n\ - overflow: hidden;\n\ - /* Flex > Non-Flex child max-width and overflow fix (Firefox only?) */\n\ - width: 1%;\n\ -}\n\ -:root:not(.gal-fit-height):not(.gal-pdf) .gal-image {\n\ - overflow-y: scroll !important;\n\ -}\n\ -:root:not(.gal-fit-width):not(.gal-pdf) .gal-image {\n\ - overflow-x: scroll !important;\n\ -}\n\ -.gal-image a {\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: flex-start;\n\ - align-items: flex-start;\n\ - margin: auto;\n\ - line-height: 0;\n\ - max-width: 100%;\n\ -}\n\ -:root.gal-pdf .gal-image a {\n\ - width: 100%;\n\ - height: 100%;\n\ -}\n\ -.gal-image img,\n\ -.gal-image video {\n\ - -webkit-flex: none;\n\ - flex: none;\n\ -}\n\ -.gal-fit-width .gal-image img,\n\ -.gal-fit-width .gal-image video {\n\ - max-width: 100%;\n\ -}\n\ -.gal-fit-height .gal-image img,\n\ -.gal-fit-height .gal-image video {\n\ - /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */\n\ - max-height: 95vh;\n\ - max-height: calc(100vh - 25px);\n\ -}\n\ -.gal-image iframe {\n\ - width: 100%;\n\ - height: 100%;\n\ -}\n\ -.gal-buttons {\n\ - font-size: 2em;\n\ - margin-right: 3px;\n\ - padding-left: 7px;\n\ - padding-right: 7px;\n\ - top: 5px;\n\ -}\n\ -:root.gal-pdf .gal-buttons {\n\ - top: 40px;\n\ - background: rgba(0,0,0,0.6) !important;\n\ - border-radius: 3px;\n\ -}\n\ -.gal-buttons a {\n\ - color: #ffffff;\n\ - text-shadow: 0px 0px 1px #000000;\n\ -}\n\ -.gal-buttons i {\n\ - display: inline-block;\n\ - margin: 2px;\n\ - position: relative;\n\ -}\n\ -.gal-start i {\n\ - border-left: 10px solid;\n\ - border-top: 6px solid transparent;\n\ - border-bottom: 6px solid transparent;\n\ - bottom: 1px;\n\ -}\n\ -.gal-stop i {\n\ - border: 5px solid;\n\ - bottom: 2px;\n\ -}\n\ -.gal-buttons.gal-playing > .gal-start,\n\ -.gal-buttons:not(.gal-playing) > .gal-stop {\n\ - display: none;\n\ -}\n\ -.gal-buttons .menu-button i {\n\ - border-top: 10px solid;\n\ - border-right: 6px solid transparent;\n\ - border-left: 6px solid transparent;\n\ - bottom: 2px;\n\ - vertical-align: baseline;\n\ -}\n\ -.gal-labels {\n\ - position: fixed;\n\ - bottom: 6px;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-flex-direction: column;\n\ - flex-direction: column;\n\ - -webkit-align-items: flex-end;\n\ - align-items: flex-end;\n\ -}\n\ -:root:not(.show-sauce) .gal-sauce {\n\ - display: none;\n\ -}\n\ -.gal-name,\n\ -.gal-count,\n\ -.gal-sauce {\n\ - background: rgba(0,0,0,0.6) !important;\n\ - border-radius: 3px;\n\ - padding: 1px 5px 2px 5px;\n\ - margin-top: 3px;\n\ - color: #ffffff !important;\n\ - text-decoration: none !important;\n\ -}\n\ -.gal-sauce a {\n\ - color: #ffffff !important;\n\ -}\n\ -.gal-name:hover,\n\ -.gal-buttons a:hover,\n\ -.gal-sauce a:hover {\n\ - color: rgb(95, 95, 101) !important;\n\ -}\n\ -:root.gal-pdf .gal-buttons a:hover {\n\ - color: rgb(204, 204, 204) !important;\n\ -}\n\ -.gal-buttons,\n\ -.gal-labels {\n\ - position: fixed;\n\ - right: 195px;\n\ -}\n\ -.gal-hide-thumbnails .gal-buttons,\n\ -.gal-hide-thumbnails .gal-labels {\n\ - right: 44px;\n\ -}\n\ -:root:not(.gal-fit-width):not(.gal-pdf) .gal-labels {\n\ - bottom: 23px !important;\n\ -}\n\ -:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-buttons,\n\ -:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-labels {\n\ - right: 178px !important;\n\ -}\n\ -:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-buttons,\n\ -:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-labels {\n\ - right: 28px !important;\n\ -}\n\ -:root.gallery-open.fixed #header-bar:not(.autohide),\n\ -:root.gallery-open.fixed #header-bar:not(.autohide) #shortcuts .fa::before {\n\ - visibility: hidden;\n\ -}\n\ -/* Mod Contact Links */\n\ -.contact-links {\n\ - margin-left: 2px;\n\ -}\n\ -.move-note > a {\n\ - text-decoration: underline;\n\ -}\n\ -.invisible {\n\ - font-size: 0;\n\ -}\n\ -/* PostJumper */\n\ -.postJumper > .prev,\n\ -.postJumper > .next {\n\ - font-size: 120%;\n\ -}\n\ -/* PSA */\n\ -.fcx-announcement {\n\ - text-align: center;\n\ -}\n\ -.fcx-announcement a {\n\ - text-decoration: underline;\n\ -}\n\ -/* General */\n\ -:root.yotsuba .dialog {\n\ - background-color: #F0E0D6;\n\ - border-color: #D9BFB7;\n\ -}\n\ -:root.yotsuba .field:focus,\n\ -:root.yotsuba .field.focus {\n\ - border-color: #EA8;\n\ -}\n\ -/* 4chan style fixes */\n\ -:root.yotsuba.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(221, 0, 0, .8) !important;\n\ -}\n\ -:root.yotsuba.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(221, 0, 0, .8) !important;\n\ -}\n\ -/* Header */\n\ -:root.yotsuba #header-bar.dialog {\n\ - background-color: rgba(240,224,214,0.98);\n\ -}\n\ -:root.yotsuba:not(.fixed) #header-bar, :root.yotsuba #notifications {\n\ - font-size: 9pt;\n\ -}\n\ -:root.yotsuba #header-bar, :root.yotsuba #notifications {\n\ - color: #B86;\n\ -}\n\ -:root.yotsuba #board-list a, :root.yotsuba #shortcuts a {\n\ - color: #800000;\n\ -}\n\ -/* Settings */\n\ -:root.yotsuba #fourchanx-settings fieldset, :root.yotsuba .section-main div::before {\n\ - border-color: #D9BFB7;\n\ -}\n\ -:root.yotsuba .suboption-list > div:last-of-type {\n\ - background-color: #F0E0D6;\n\ -}\n\ -/* Catalog */\n\ -:root.yotsuba.catalog-hover-expand .catalog-container:hover > .post {\n\ - background-color: #F0E0D6;\n\ -}\n\ -:root.yotsuba.werkTyme .catalog-thread:not(:hover),\n\ -:root.yotsuba.werkTyme:not(.catalog-hover-expand) .catalog-thread,\n\ -:root.yotsuba.catalog-hover-expand .catalog-container:hover > .post,\n\ -:root.yotsuba.catalog-hover-expand .catalog-container:hover .catalog-reply {\n\ - border-color: #D9BFB7;\n\ -}\n\ -/* Quote */\n\ -:root.yotsuba .backlink.deadlink {\n\ - color: #00E !important;\n\ -}\n\ -:root.yotsuba .inline {\n\ - border-color: #D9BFB7;\n\ - background-color: rgba(255, 255, 255, .14);\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.yotsuba .indicator {\n\ - color: #F0E0D6;\n\ -}\n\ -/* QR */\n\ -.yotsuba #dump-list::-webkit-scrollbar-thumb {\n\ - background-color: #F0E0D6;\n\ - border-color: #D9BFB7;\n\ -}\n\ -:root.yotsuba .qr-preview {\n\ - background-color: rgba(0, 0, 0, .15);\n\ -}\n\ -:root.yotsuba .qr-link {\n\ - border-color: rgb(225, 209, 199) rgb(225, 209, 199) rgb(210, 194, 184);\n\ - background: linear-gradient(#FFEFE5, #F0E0D6) repeat scroll 0% 0% transparent;\n\ -}\n\ -:root.yotsuba .qr-link:hover {\n\ - background: #F0E0D6;\n\ -}\n\ -/* Menu */\n\ -:root.yotsuba #menu {\n\ - color: #800000;\n\ -}\n\ -:root.yotsuba .entry {\n\ - font-size: 10pt;\n\ -}\n\ -:root.yotsuba .focused.entry {\n\ - background: rgba(255, 255, 255, .33);\n\ -}\n\ -/* Unread */\n\ -:root.yotsuba .unread-mark-read {\n\ - background-color: rgba(240,224,214,0.5);\n\ -}\n\ -/* Thread Watcher */\n\ -:root.yotsuba .replies-quoting-you > a, :root.yotsuba #watcher-link.replies-quoting-you, :root.yotsuba .last-page > a > .watcher-page {\n\ - color: #F00;\n\ -}\n\ -/* Watcher Favicon */\n\ -:root.yotsuba .watch-thread-link\n\ -{\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -/* General */\n\ -:root.yotsuba-b .dialog {\n\ - background-color: #D6DAF0;\n\ - border-color: #B7C5D9;\n\ -}\n\ -:root.yotsuba-b .field:focus,\n\ -:root.yotsuba-b .field.focus {\n\ - border-color: #98E;\n\ -}\n\ -/* 4chan style fixes */\n\ -:root.yotsuba-b.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(221, 0, 0, .8) !important;\n\ -}\n\ -:root.yotsuba-b.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(221, 0, 0, .8) !important;\n\ -}\n\ -/* Header */\n\ -:root.yotsuba-b #header-bar.dialog {\n\ - background-color: rgba(214,218,240,0.98);\n\ -}\n\ -:root.yotsuba-b:not(.fixed) #header-bar, :root.yotsuba-b #notifications {\n\ - font-size: 9pt;\n\ -}\n\ -:root.yotsuba-b #header-bar, :root.yotsuba-b #notifications {\n\ - color: #89A;\n\ -}\n\ -:root.yotsuba-b #board-list a, :root.yotsuba-b #shortcuts a {\n\ - color: #34345C;\n\ -}\n\ -/* Settings */\n\ -:root.yotsuba-b #fourchanx-settings fieldset, :root.yotsuba-b .section-main div::before {\n\ - border-color: #B7C5D9;\n\ -}\n\ -:root.yotsuba-b .suboption-list > div:last-of-type {\n\ - background-color: #D6DAF0;\n\ -}\n\ -/* Catalog */\n\ -:root.yotsuba-b.catalog-hover-expand .catalog-container:hover > .post {\n\ - background-color: #D6DAF0;\n\ -}\n\ -:root.yotsuba-b.werkTyme .catalog-thread:not(:hover),\n\ -:root.yotsuba-b.werkTyme:not(.catalog-hover-expand) .catalog-thread,\n\ -:root.yotsuba-b.catalog-hover-expand .catalog-container:hover > .post,\n\ -:root.yotsuba-b.catalog-hover-expand .catalog-container:hover .catalog-reply {\n\ - border-color: #B7C5D9;\n\ -}\n\ -/* Quote */\n\ -:root.yotsuba-b .backlink.deadlink {\n\ - color: #34345C !important;\n\ -}\n\ -:root.yotsuba-b .inline {\n\ - border-color: #B7C5D9;\n\ - background-color: rgba(255, 255, 255, .14);\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.yotsuba-b .indicator {\n\ - color: #D6DAF0;\n\ -}\n\ -/* QR */\n\ -.yotsuba-b #dump-list::-webkit-scrollbar-thumb {\n\ - background-color: #D6DAF0;\n\ - border-color: #B7C5D9;\n\ -}\n\ -:root.yotsuba-b .qr-preview {\n\ - background-color: rgba(0, 0, 0, .15);\n\ -}\n\ -:root.yotsuba-b .qr-link {\n\ - border-color: rgb(199, 203, 225) rgb(199, 203, 225) rgb(184, 188, 210);\n\ - background: linear-gradient(#E5E9FF, #D6DAF0) repeat scroll 0% 0% transparent;\n\ -}\n\ -:root.yotsuba-b .qr-link:hover {\n\ - background: #D9DDF3;\n\ -}\n\ -/* Menu */\n\ -:root.yotsuba-b #menu {\n\ - color: #000;\n\ -}\n\ -:root.yotsuba-b .entry {\n\ - font-size: 10pt;\n\ -}\n\ -:root.yotsuba-b .focused.entry {\n\ - background: rgba(255, 255, 255, .33);\n\ -}\n\ -/* Unread */\n\ -:root.yotsuba-b .unread-mark-read {\n\ - background-color: rgba(214,218,240,0.5);\n\ -}\n\ -/* Thread Watcher */\n\ -:root.yotsuba-b .replies-quoting-you > a, :root.yotsuba-b #watcher-link.replies-quoting-you {\n\ - color: #F00;\n\ -}\n\ -/* Watcher Favicon */\n\ -:root.yotsuba-b .watch-thread-link\n\ -{\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -/* General */\n\ -:root.futaba .dialog {\n\ - background-color: #F0E0D6;\n\ - border-color: #D9BFB7;\n\ -}\n\ -:root.futaba .field:focus,\n\ -:root.futaba .field.focus {\n\ - border-color: #EA8;\n\ -}\n\ -/* Header */\n\ -:root.futaba #header-bar.dialog {\n\ - background-color: rgba(240,224,214,0.98);\n\ -}\n\ -:root.futaba:not(.fixed) #header-bar, :root.futaba #notifications {\n\ - font-size: 11pt;\n\ -}\n\ -:root.futaba #header-bar, :root.futaba #notifications {\n\ - color: #B86;\n\ -}\n\ -:root.futaba #header-bar a, :root.futaba #notifications a {\n\ - color: #800000;\n\ -}\n\ -/* Settings */\n\ -:root.futaba #fourchanx-settings fieldset, :root.futaba .section-main div::before {\n\ - border-color: #D9BFB7;\n\ -}\n\ -:root.futaba .suboption-list > div:last-of-type {\n\ - background-color: #F0E0D6;\n\ -}\n\ -/* Catalog */\n\ -:root.futaba.catalog-hover-expand .catalog-container:hover > .post {\n\ - background-color: #F0E0D6;\n\ -}\n\ -:root.futaba.werkTyme .catalog-thread:not(:hover),\n\ -:root.futaba.werkTyme:not(.catalog-hover-expand) .catalog-thread,\n\ -:root.futaba.catalog-hover-expand .catalog-container:hover > .post,\n\ -:root.futaba.catalog-hover-expand .catalog-container:hover .catalog-reply {\n\ - border-color: #D9BFB7;\n\ -}\n\ -/* Quote */\n\ -:root.futaba .backlink.deadlink {\n\ - color: #00E !important;\n\ -}\n\ -:root.futaba .inline {\n\ - border-color: #D9BFB7;\n\ - background-color: rgba(255, 255, 255, .14);\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.futaba .indicator {\n\ - color: #F0E0D6;\n\ -}\n\ -/* Anonymize */\n\ -:root.futaba.anonymize $site$info$name::before {\n\ - font-size: 12pt;\n\ -}\n\ -/* QR */\n\ -.futaba #dump-list::-webkit-scrollbar-thumb {\n\ - background-color: #F0E0D6;\n\ - border-color: #D9BFB7;\n\ -}\n\ -:root.futaba .qr-preview {\n\ - background-color: rgba(0, 0, 0, .15);\n\ -}\n\ -:root.futaba .qr-link {\n\ - border-color: rgb(225, 209, 199) rgb(225, 209, 199) rgb(210, 194, 184);\n\ - background: linear-gradient(#FFEFE5, #F0E0D6) repeat scroll 0% 0% transparent;\n\ -}\n\ -:root.futaba .qr-link:hover {\n\ - background: #F0E0D6;\n\ -}\n\ -/* Menu */\n\ -:root.futaba #menu {\n\ - color: #800000;\n\ -}\n\ -:root.futaba .entry {\n\ - font-size: 12pt;\n\ -}\n\ -:root.futaba .focused.entry {\n\ - background: rgba(255, 255, 255, .33);\n\ -}\n\ -/* Unread */\n\ -:root.futaba .unread-mark-read {\n\ - background-color: rgba(240,224,214,0.5);\n\ -}\n\ -/* Thread Watcher */\n\ -:root.futaba .replies-quoting-you > a, :root.futaba #watcher-link.replies-quoting-you, :root.futaba .last-page > a > .watcher-page {\n\ - color: #F00;\n\ -}\n\ -/* Watcher Favicon */\n\ -:root.futaba .watch-thread-link\n\ -{\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -/* General */\n\ -:root.burichan .dialog {\n\ - background-color: #D6DAF0;\n\ - border-color: #B7C5D9;\n\ -}\n\ -:root.burichan .field:focus,\n\ -:root.burichan .field.focus {\n\ - border-color: #98E;\n\ -}\n\ -/* Header */\n\ -:root.burichan #header-bar.dialog {\n\ - background-color: rgba(214,218,240,0.98);\n\ -}\n\ -:root.burichan:not(.fixed) #header-bar, :root.burichan #header-bar #notifications {\n\ - font-size: 11pt;\n\ -}\n\ -:root.burichan #header-bar, :root.burichan #header-bar #notifications {\n\ - color: #89A;\n\ -}\n\ -:root.burichan #header-bar a, :root.burichan #header-bar #notifications a {\n\ - color: #34345C;\n\ -}\n\ -/* Settings */\n\ -:root.burichan #fourchanx-settings fieldset, :root.burichan .section-main div::before {\n\ - border-color: #B7C5D9;\n\ -}\n\ -:root.burichan .suboption-list > div:last-of-type {\n\ - background-color: #D6DAF0;\n\ -}\n\ -/* Catalog */\n\ -:root.burichan.catalog-hover-expand .catalog-container:hover > .post {\n\ - background-color: #D6DAF0;\n\ -}\n\ -:root.burichan.werkTyme .catalog-thread:not(:hover),\n\ -:root.burichan.werkTyme:not(.catalog-hover-expand) .catalog-thread,\n\ -:root.burichan.catalog-hover-expand .catalog-container:hover > .post,\n\ -:root.burichan.catalog-hover-expand .catalog-container:hover .catalog-reply {\n\ - border-color: #B7C5D9;\n\ -}\n\ -/* Quote */\n\ -:root.burichan .backlink.deadlink {\n\ - color: #34345C !important;\n\ -}\n\ -:root.burichan .inline {\n\ - border-color: #B7C5D9;\n\ - background-color: rgba(255, 255, 255, .14);\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.burichan .indicator {\n\ - color: #D6DAF0;\n\ -}\n\ -/* Anonymize */\n\ -:root.burichan.anonymize $site$info$name::before {\n\ - font-size: 12pt;\n\ -}\n\ -/* QR */\n\ -.burichan #dump-list::-webkit-scrollbar-thumb {\n\ - background-color: #D6DAF0;\n\ - border-color: #B7C5D9;\n\ -}\n\ -:root.burichan .qr-preview {\n\ - background-color: rgba(0, 0, 0, .15);\n\ -}\n\ -:root.burichan .qr-link {\n\ - border-color: rgb(199, 203, 225) rgb(199, 203, 225) rgb(184, 188, 210);\n\ - background: linear-gradient(#E5E9FF, #D6DAF0) repeat scroll 0% 0% transparent;\n\ -}\n\ -:root.burichan .qr-link:hover {\n\ - background: #D9DDF3;\n\ -}\n\ -/* Menu */\n\ -:root.burichan #menu {\n\ - color: #000000;\n\ -}\n\ -:root.burichan .entry {\n\ - font-size: 12pt;\n\ -}\n\ -:root.burichan .focused.entry {\n\ - background: rgba(255, 255, 255, .33);\n\ -}\n\ -/* Unread */\n\ -:root.burichan .unread-mark-read {\n\ - background-color: rgba(214,218,240,0.5);\n\ -}\n\ -/* Thread Watcher */\n\ -:root.burichan .replies-quoting-you > a, :root.burichan #watcher-link.replies-quoting-you, :root.burichan .last-page > a > .watcher-page {\n\ - color: #F00;\n\ -}\n\ -/* Watcher Favicon */\n\ -:root.burichan .watch-thread-link\n\ -{\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -/* General */\n\ -:root.tomorrow .dialog {\n\ - background-color: #282A2E;\n\ - border-color: #111;\n\ -}\n\ -/* 4chan style fixes */\n\ -:root.tomorrow #arc-list span.quote {\n\ - color: #B5BD68;\n\ -}\n\ -:root.tomorrow.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(145, 182, 214, .8) !important;\n\ -}\n\ -:root.tomorrow.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(145, 182, 214, .8) !important;\n\ -}\n\ -/* Header */\n\ -:root.tomorrow #header-bar.dialog {\n\ - background-color: rgba(40,42,46,0.9);\n\ -}\n\ -:root.tomorrow:not(.fixed) #header-bar, :root.tomorrow #notifications {\n\ - font-size: 9pt;\n\ -}\n\ -:root.tomorrow #header-bar, :root.tomorrow #notifications {\n\ - color: #C5C8C6;\n\ -}\n\ -:root.tomorrow #header-bar a, :root.tomorrow #notifications a {\n\ - color: #81A2BE;\n\ -}\n\ -:root.tomorrow.shortcut-icons .native-settings {\n\ - background-image: url('//s.4cdn.org/image/favicon-ws.ico');\n\ -}\n\ -/* Settings */\n\ -:root.tomorrow #fourchanx-settings fieldset, :root.tomorrow .section-main div::before {\n\ - border-color: #111;\n\ -}\n\ -:root.tomorrow .suboption-list > div:last-of-type {\n\ - background-color: #282A2E;\n\ -}\n\ -/* Catalog */\n\ -:root.tomorrow.catalog-hover-expand .catalog-container:hover > .post {\n\ - background-color: #282A2E;\n\ -}\n\ -:root.tomorrow.werkTyme .catalog-thread:not(:hover),\n\ -:root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread,\n\ -:root.tomorrow.catalog-hover-expand .catalog-container:hover > .post,\n\ -:root.tomorrow.catalog-hover-expand .catalog-container:hover .catalog-reply {\n\ - border-color: #111;\n\ -}\n\ -/* Quote */\n\ -:root.tomorrow .backlink.deadlink {\n\ - color: #81A2BE !important;\n\ -}\n\ -:root.tomorrow .inline {\n\ - border-color: #111;\n\ - background-color: rgba(0, 0, 0, .14);\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.tomorrow .indicator {\n\ - color: #282A2E;\n\ -}\n\ -/* Highlighting */\n\ -:root.tomorrow .qphl {\n\ - outline: 2px solid rgba(145, 182, 214, .8);\n\ -}\n\ -:root.tomorrow.highlight-you .quotesYou$site$highlightable$op,\n\ -:root.tomorrow.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(145, 182, 214, .8);\n\ -}\n\ -:root.tomorrow.highlight-own .yourPost$site$highlightable$op,\n\ -:root.tomorrow.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(145, 182, 214, .8);\n\ -}\n\ -:root.tomorrow .filter-highlight$site$highlightable$op,\n\ -:root.tomorrow .filter-highlight$site$highlightable$reply {\n\ - box-shadow: inset 5px 0 rgba(145, 182, 214, .5);\n\ -}\n\ -:root.tomorrow.highlight-own .yourPost > $site$sideArrows,\n\ -:root.tomorrow.highlight-you .quotesYou > $site$sideArrows,\n\ -:root.tomorrow .filter-highlight > $site$sideArrows {\n\ - color: rgb(155, 185, 210);\n\ -}\n\ -:root.tomorrow .catalog-thread.filter-highlight .catalog-thumb,\n\ -:root.tomorrow.werkTyme .catalog-thread.filter-highlight:not(:hover),\n\ -:root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread.filter-highlight,\n\ -:root.tomorrow.werkTyme.catalog-hover-expand .catalog-thread.filter-highlight > .catalog-container:hover > .catalog-post {\n\ - box-shadow: 0 0 3px 3px rgba(64, 192, 255, .7);\n\ -}\n\ -:root.tomorrow .catalog-thread.watched .catalog-thumb,\n\ -:root.tomorrow.werkTyme .catalog-thread.watched:not(:hover),\n\ -:root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched,\n\ -:root.tomorrow.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post {\n\ - border: 2px solid rgb(64, 192, 255);\n\ -}\n\ -/* QR */\n\ -.tomorrow #dump-list::-webkit-scrollbar-thumb {\n\ - background-color: #282A2E;\n\ - border-color: #111;\n\ -}\n\ -:root.tomorrow .qr-preview {\n\ - background-color: rgba(255, 255, 255, .15);\n\ -}\n\ -:root.tomorrow #qr .field {\n\ - background-color: rgb(26, 27, 29);\n\ - color: rgb(197,200,198);\n\ - border-color: rgb(40, 41, 42);\n\ -}\n\ -:root.tomorrow #qr .field:focus,\n\ -:root.tomorrow #qr .field.focus {\n\ - border-color: rgb(129, 162, 190) !important;\n\ - background-color: rgb(30,32,36);\n\ -}\n\ -:root.tomorrow .persona button {\n\ - background: linear-gradient(to bottom, #2E3035, #222427) no-repeat;\n\ - color: rgb(197,200,198);\n\ - border-color: rgb(40, 41, 42);\n\ - outline: none;\n\ -}\n\ -:root.tomorrow .persona button::-moz-focus-inner {\n\ - border: none;\n\ -}\n\ -:root.tomorrow .persona button:focus {\n\ - border-color: rgb(129, 162, 190);\n\ -}\n\ -:root.tomorrow #qr.sjis-preview #sjis-toggle,\n\ -:root.tomorrow #qr.tex-preview #tex-preview-button {\n\ - background: rgb(26, 27, 29);\n\ -}\n\ -:root.tomorrow #qr select,\n\ -:root.tomorrow #file-n-submit > input,\n\ -:root.tomorrow #qr-draw-button {\n\ - border-color: rgb(40, 41, 42);\n\ -}\n\ -:root.tomorrow #qr-filename {\n\ - color: rgb(197,200,198);\n\ -}\n\ -:root.tomorrow .qr-link {\n\ - border-color: rgb(25, 27, 31) rgb(25, 27, 31) rgb(10, 12, 16);\n\ - background: linear-gradient(#37393D, #282A2E) repeat scroll 0% 0% transparent;\n\ -}\n\ -:root.tomorrow .qr-link:hover {\n\ - background: #282A2E;\n\ -}\n\ -/* Menu */\n\ -:root.tomorrow #menu {\n\ - color: #C5C8C6;\n\ -}\n\ -:root.tomorrow .entry {\n\ - font-size: 10pt;\n\ -}\n\ -:root.tomorrow .focused.entry {\n\ - background: rgba(0, 0, 0, .33);\n\ -}\n\ -/* Unread */\n\ -:root.tomorrow .unread-line {\n\ - border-color: rgb(197, 200, 198);\n\ -}\n\ -:root.tomorrow .unread-mark-read {\n\ - background-color: rgba(40,42,46,0.5);\n\ -}\n\ -/* Thread Watcher */\n\ -:root.tomorrow .replies-quoting-you > a, :root.tomorrow #watcher-link.replies-quoting-you, :root.tomorrow .last-page > a > .watcher-page {\n\ - color: #F00 !important;\n\ -}\n\ -/* Watcher Favicon */\n\ -:root.tomorrow .watch-thread-link\n\ -{\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -/* General */\n\ -:root.photon .dialog {\n\ - background-color: #DDD;\n\ - border-color: #CCC;\n\ -}\n\ -:root.photon .field:focus,\n\ -:root.photon .field.focus {\n\ - border-color: #EA8;\n\ -}\n\ -/* 4chan style fixes */\n\ -:root.photon #arc-list tr:nth-of-type(odd) span.quote {\n\ - color: #C0E17A;\n\ -}\n\ -:root.photon.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(221, 0, 0, .8) !important;\n\ -}\n\ -:root.photon.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(221, 0, 0, .8) !important;\n\ -}\n\ -/* Header */\n\ -:root.photon #header-bar.dialog {\n\ - background-color: rgba(221,221,221,0.98);\n\ -}\n\ -:root.photon:not(.fixed) #header-bar, :root.photon #notifications {\n\ - font-size: 9pt;\n\ -}\n\ -:root.photon #header-bar, :root.photon #notifications {\n\ - color: #333;\n\ -}\n\ -:root.photon #header-bar a, :root.photon #notifications a {\n\ - color: #FF6600;\n\ -}\n\ -/* Settings */\n\ -:root.photon #fourchanx-settings fieldset, :root.photon .section-main div::before {\n\ - border-color: #CCC;\n\ -}\n\ -:root.photon .suboption-list > div:last-of-type {\n\ - background-color: #DDD;\n\ -}\n\ -/* Catalog */\n\ -:root.photon.catalog-hover-expand .catalog-container:hover > .post {\n\ - background-color: #DDD;\n\ -}\n\ -:root.photon.werkTyme .catalog-thread:not(:hover),\n\ -:root.photon.werkTyme:not(.catalog-hover-expand) .catalog-thread,\n\ -:root.photon.catalog-hover-expand .catalog-container:hover > .post,\n\ -:root.photon.catalog-hover-expand .catalog-container:hover .catalog-reply {\n\ - border-color: #CCC;\n\ -}\n\ -/* Quote */\n\ -:root.photon .backlink.deadlink {\n\ - color: #F60 !important;\n\ -}\n\ -:root.photon .inline {\n\ - border-color: #CCC;\n\ - background-color: rgba(255, 255, 255, .14);\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.photon .indicator {\n\ - color: #DDD;\n\ -}\n\ -/* QR */\n\ -.photon #dump-list::-webkit-scrollbar-thumb {\n\ - background-color: #DDD;\n\ - border-color: #CCC;\n\ -}\n\ -:root.photon .qr-preview {\n\ - background-color: rgba(0, 0, 0, .15);\n\ -}\n\ -:root.photon .qr-link {\n\ - border-color: rgb(206, 206, 206) rgb(206, 206, 206) rgb(191, 191, 191);\n\ - background: linear-gradient(#ECECEC, #DDD) repeat scroll 0% 0% transparent;\n\ -}\n\ -:root.photon .qr-link:hover {\n\ - background: #DDDDDD;\n\ -}\n\ -/* Menu */\n\ -:root.photon #menu {\n\ - color: #333;\n\ -}\n\ -:root.photon .entry {\n\ - font-size: 10pt;\n\ -}\n\ -:root.photon .focused.entry {\n\ - background: rgba(255, 255, 255, .33);\n\ -}\n\ -/* Unread */\n\ -:root.photon .unread-mark-read {\n\ - background-color: rgba(221,221,221,0.5);\n\ -}\n\ -/* Thread Watcher */\n\ -:root.photon .replies-quoting-you > a, :root.photon #watcher-link.replies-quoting-you, :root.photon .last-page > a > .watcher-page {\n\ - color: #00F !important;\n\ -}\n\ -/* Watcher Favicon */\n\ -:root.photon .watch-thread-link\n\ -{\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -/* General */\n\ -:root.spooky .dialog {\n\ - background-color: #171526;\n\ - border-color: #707070;\n\ -}\n\ -:root.spooky .field:focus,\n\ -:root.spooky .field.focus {\n\ - border-color: #98E;\n\ -}\n\ -/* 4chan style fixes */\n\ -:root.spooky #arc-list span.quote {\n\ - color: #634C2C;\n\ -}\n\ -:root.spooky.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(145, 182, 214, .8) !important;\n\ -}\n\ -:root.spooky.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(145, 182, 214, .8) !important;\n\ -}\n\ -/* Header */\n\ -:root.spooky #header-bar.dialog {\n\ - background-color: rgba(23,21,38,0.98);\n\ -}\n\ -:root.spooky:not(.fixed) #header-bar, :root.spooky #notifications {\n\ - font-size: 9pt;\n\ -}\n\ -:root.spooky #header-bar, :root.spooky #notifications {\n\ - color: #C49756;\n\ -}\n\ -:root.spooky #board-list a, :root.spooky #shortcuts a {\n\ - color: #FE9600;\n\ -}\n\ -:root.spooky.shortcut-icons .native-settings {\n\ - background-image: url('//s.4cdn.org/image/favicon-ws.ico');\n\ -}\n\ -/* Settings */\n\ -:root.spooky #fourchanx-settings fieldset, :root.spooky .section-main div::before {\n\ - border-color: #707070;\n\ -}\n\ -:root.spooky .suboption-list > div:last-of-type {\n\ - background-color: #171526;\n\ -}\n\ -/* Catalog */\n\ -:root.spooky.catalog-hover-expand .catalog-container:hover > .post {\n\ - background-color: #171526;\n\ -}\n\ -:root.spooky.werkTyme .catalog-thread:not(:hover),\n\ -:root.spooky.werkTyme:not(.catalog-hover-expand) .catalog-thread,\n\ -:root.spooky.catalog-hover-expand .catalog-container:hover > .post,\n\ -:root.spooky.catalog-hover-expand .catalog-container:hover .catalog-reply {\n\ - border-color: #707070;\n\ -}\n\ -/* Quote */\n\ -:root.spooky .backlink.deadlink {\n\ - color: #FE9600 !important;\n\ -}\n\ -:root.spooky .inline {\n\ - border-color: #707070;\n\ - background-color: rgba(255, 255, 255, .14);\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.spooky .indicator {\n\ - color: #171526;\n\ -}\n\ -/* Highlighting */\n\ -:root.spooky .qphl {\n\ - outline: 2px solid rgba(145, 182, 214, .8);\n\ -}\n\ -:root.spooky.highlight-you .quotesYou$site$highlightable$op,\n\ -:root.spooky.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(145, 182, 214, .8);\n\ -}\n\ -:root.spooky.highlight-own .yourPost$site$highlightable$op,\n\ -:root.spooky.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(145, 182, 214, .8);\n\ -}\n\ -:root.spooky .filter-highlight$site$highlightable$op,\n\ -:root.spooky .filter-highlight$site$highlightable$reply {\n\ - box-shadow: inset 5px 0 rgba(145, 182, 214, .5);\n\ -}\n\ -:root.spooky.highlight-own .yourPost > $site$sideArrows,\n\ -:root.spooky.highlight-you .quotesYou > $site$sideArrows,\n\ -:root.spooky .filter-highlight > $site$sideArrows {\n\ - color: rgb(155, 185, 210);\n\ -}\n\ -/* QR */\n\ -.spooky #dump-list::-webkit-scrollbar-thumb {\n\ - background-color: #171526;\n\ - border-color: #707070;\n\ -}\n\ -:root.spooky .qr-preview {\n\ - background-color: rgba(0, 0, 0, .15);\n\ -}\n\ -:root.spooky #qr .field {\n\ - background-color: rgb(26, 27, 29);\n\ - color: rgb(197,200,198);\n\ - border-color: rgb(40, 41, 42);\n\ -}\n\ -:root.spooky #qr .field:focus,\n\ -:root.spooky #qr .field.focus {\n\ - border-color: rgb(254, 150, 0) !important;\n\ - background-color: rgb(30,32,36);\n\ -}\n\ -:root.spooky .persona button {\n\ - background: linear-gradient(to bottom, #2E3035, #222427) no-repeat;\n\ - color: rgb(197,200,198);\n\ - border-color: rgb(40, 41, 42);\n\ - outline: none;\n\ -}\n\ -:root.spooky .persona button::-moz-focus-inner {\n\ - border: none;\n\ -}\n\ -:root.spooky .persona button:focus {\n\ - border-color: rgb(254, 150, 0);\n\ -}\n\ -:root.spooky #qr.sjis-preview #sjis-toggle,\n\ -:root.spooky #qr.tex-preview #tex-preview-button {\n\ - background: rgb(26, 27, 29);\n\ -}\n\ -:root.spooky #qr select,\n\ -:root.spooky #file-n-submit > input,\n\ -:root.spooky #qr-draw-button {\n\ - border-color: rgb(40, 41, 42);\n\ -}\n\ -:root.spooky #qr-filename {\n\ - color: rgb(197,200,198);\n\ -}\n\ -:root.spooky .qr-link {\n\ - border-color: rgb(8, 6, 23) rgb(8, 6, 23) rgb(0, 0, 8);\n\ - background: linear-gradient(#262435, #171526) repeat scroll 0% 0% transparent;\n\ -}\n\ -:root.spooky .qr-link:hover {\n\ - background: #1A1829;\n\ -}\n\ -/* Menu */\n\ -:root.spooky #menu {\n\ - color: #FE9600;\n\ -}\n\ -:root.spooky .entry {\n\ - font-size: 10pt;\n\ -}\n\ -:root.spooky .focused.entry {\n\ - background: rgba(255, 255, 255, .33);\n\ -}\n\ -/* Unread */\n\ -:root.spooky .unread-line {\n\ - border-color: rgb(197, 200, 198);\n\ - visibility: visible;\n\ - opacity: 1;\n\ -}\n\ -:root.spooky .unread-mark-read {\n\ - background-color: rgba(23,21,38,0.5);\n\ -}\n\ -/* Thread Watcher */\n\ -:root.spooky .replies-quoting-you > a, :root.spooky #watcher-link.replies-quoting-you, :root.spooky .last-page > a > .watcher-page {\n\ - color: #F00 !important;\n\ -}\n\ -/* Watcher Favicon */\n\ -:root.spooky .watch-thread-link\n\ -{\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -/* Link Title Favicons */\n\ -.linkify.audio::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAitJREFUOE9jYCAWKJWwavr0KyXWb/FIbDtUFFyzJx6nVofE2Xo5nXsj0rqPNSR0nVkR2Hjmgmfd+U9Otdf+m5Vf/6+SfeU/R9ChVVgNYDRtlfJuuPA/rPfe/4QpD/6nznj0P27Kw/9unff/69Xf+69c/+C/SO7N/0z+OAxgMmmRCe++/r9i3ev/KWvf/vdY8PK/bt/9/wrNV3/IN5y/IVt1YqNg4pGTTP4HsbuA2bhZ2qvpyn+xjIObxAp3VwqlrgngLFyryVy5nhPmZJHANS2cwYexG8BmVC/pWn3hP4NZlzWuQDJI3dIiFnUUuwEsQAOcq87jNcC7fHeLUtJxHF4AGmBWeAavAWH1+1rUUk7giAWjOknllON4DXAs2NEiG4/DBQxAF/CFHfrPYI4jDFSLuJVjNrUJhB/B7gIGo1pJRt99GAZYJK7wLJ1z7Xzl4vu/7aqv/GRBj0bjqAX2qb0nJ7mXH17C4HcUxQA+hymWtSue/C5a9up/9Ozn/7Vr7v1nRY7GqMb91T3b3v6vWvPmf/S0p/9ZQk+DDLCBRSOz06Jqk+o7/21nvfqvsebDf7kZL/5zBaxphkezd+OFn7HzXvz3Wvjmv9a8N//5Ek//ZTBpVYUrMG2X5wjcdl68+uI/wa5Lr3hSNjczGFeywOVZ/bbcVGp//F9izfv/Ql03f3P4LC/HSEQquYwMFnUCDJ7dzBhyjGZNQpye89M5gpfnMvtNUyE2h4PUAQBovvT7lyNljwAAAABJRU5ErkJggg==') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.bitchute::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAadQTFRFAAAAwzw8xDs7cY6O0iws0ysrtF9f0Sws1CwsyzU1zTIy1igoyzQ01icnY7i4t0hI0S4u0ysr1Soq1ikp1ikp1Soq0ysr0S4uu0VFzjEx1Csr1ygo2Ccn2Ccn1ygo1CoqzjExzjAw1Skp2Ccn2Ccn1ikp0TAwxzY21Soq1SoqyzQ00iws1ygo1ygo0yws1Soq1Skp1igo1igo1igo1igo1igo1igo1Coq1Soq0C0t1ygo1ygo0S4unV5e1Csr1ygo1ygo1CsruUdHxzg41Skp1ygo1CsryTU10C4u1igo1ycn1ygo0i0txjo60S0t1ikp1ygo1ikp1Cws1Coq1Coq0yws0S0tyzQ00iws1Soq0ysr0i0txDs72Ccn2CUl2CYm2CQk3EFB2S8v2zw82jY24FZW3D0931FR3EBA3UND8LS04FVV7qys4V9f4WBg+erq766u9t7e7qqq2Ckp54KC9+Pj6pSU+Ojo5XNz9NHR6YqK8bu765ub5G5u9M3N6ImJ88vL5XV165eX3UVF6pWV3UhI2Soq2jU12Coq2jQ02Cgo2Sws////FaxLuAAAAF10Uk5TAAAAAAAAAAAAAAAAAAAAASJnoLy9oWolAhBz1vr72XgTGKf8/a4cCpuiDVvz9mS6xOvy9vzg6aGsPOToRAFv9fh2Awm07XgIMd765UEDOsfemVhhY00nBommbCkEI8horgAAAL5JREFUKBUFwbFKA0EUQNF7387sMq4EmzRpLSSdIBYKFv6Af2prnSYkRT4gWFgkCBJQ0EIFdcZzBCeqqh4qdk7VW2ChPusw02sAYKU7z7wEAAA2piQKFbrWSHazc1J0XWs5pdxPDykcVX+7Y9UxUsSo+s7PibqPFBRV/C5qi4i/UkrJrc7L47Bt4ZWnUaMCAE9GSrtKBQD2fR+bnAEAeOn7dUTOwApe35bDsPz0zsniQlV98IN0tJ3f6P0XAMA/kxou7OXCdnoAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.clyp::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAwUExURTSY22ey5E2l4KbS75rM7Y3F64C/6f///8zl9nS45r/f9PL5/UGe3bPY8Vqr4v///wNjrzUAAAABYktHRA8YugDZAAAAB3RJTUUH4AINEi85AIH95AAAAE9JREFUCNdjYMAGGBWgDGYHCM2a3hkAZmi0dzSBaKaO9o5moCqmLiCjYzNQyw4QowIodQzI6E0AKcpo72gE6+Jyb1kAMehUA9RktgdYbQYAjGIVNGGXBJkAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.dailymotion::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURQBk3ff6/trp+kKO5wZt3xx54q7P9Ozz/IS17zOG5WKh653E8sbc9/GbbcoAAABZSURBVAjXY2BAASyhDhAGc9oECMOjyAAiESEEYrBYpLWBGcwHxcvBjDDxHelghpF0yDQwY3kVgweEUeEQDWbMEepqAjO8FMsLIeYsU8o+BrbCdWboTAe4AwALXxWGjW41FwAAAABJRU5ErkJggg==') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.gfycat::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAjVBMVEWn3gCo3gSr3w2t4BSu4Bav4Ri35C+45DK45DO55DXA50rA50vB50zC6E/D6FTF6VjG6VvL62vN7G/P7XbQ7XfW74vY8JDa8ZTe8qDe8qLf86Pi9Kzj9K7k9LHp9sDp98Lq98Ps+Mr0++L5/O75/fD6/fH6/fL6/fP7/fT7/fb8/ff8/vj8/vn+/v7///91X4cfAAAAcklEQVR42o3M2xKBUACF4aVQckrIuRJK6H//x2sme4/MuPDfre9i6c/Cc3U5Dj87BuAxsXvGu6JvIIXEHRWwNHCHQNrCzkAFkbSBg4EM8i+Yw7PXBa3zRfuxVyf/Bis7nKwGKAcWxgC8prI5Sc315OlnDfzpDar2S9/oAAAAAElFTkSuQmCC') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.gist::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABblBMVEXc3NykpKTW1tbb29ugoKCdnZ0AAAACAgIEDRcKCgoMDAwODg4QIzYRDAoTExMUDwwVAg0WICsaEw8aGhoiCBklGxUmERwwKCQ7LSU7Ozs8LSZFLyNINi1JNyxJNy1KSklMOi5VR1FXV1daQTRkZGRseYZwU0F4eHh7dnR8bWV/YE6IdGiKcGCKkJaNgYeNjY2RdGOScWCUcWCZmZmhoaGkpKSoqKirfmaurq6xsbG1tbW6urq+vr7AbmzBb23CwsLGxsbHx8fHyMjJycnJysrMzMzOiYbPi4fQ0NDRoYbT09PU1NTW1tbY2NjZqIzZ2dnb29vd3d3f39/i4uLktZrk5OTl5eXm5ubn5+fo6Ojq6urs7OzttKLu7u7wuqbw8PDx8fHz8/P4+Pj5+fn7uZj8vpz9ya79ybD/tZf/upr/wZ//w6H/xKH/xaL/xrH/yqj/y7T/zqv/z7D/07D/17n/2Lv/2Lz/3L//38n/4Mk3Q/ZuAAAABnRSTlMSFcbGzc5MNKFvAAAA1klEQVQoz2NgYPZHAswMDEwRSclwkBTBxOARn4gE4j0YXBOiJNUDg7y8Ar1UlOITXBkcY73Z2Li42dg42dn4wmIdGeyjQ7nZoEA4PNqewSZKlw0O9KJsGKwjBdl4ZeWkJGQUhNjEIq0ZrMI5+D0ri7Jz8itCRAXCrRgsQ3mUy+xicrPSbfO0REItGSyCVaVL3ONSU9LcCtQUgy0YzIJ85M1LizMzCsv9xF2CzBhMAwN99TV1DI0MtDWcAgNNGUycA5CAswkDi5kDwrMOZiwMjKzGSICVEQDhZj0UQV7PewAAAABJRU5ErkJggg==') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.image::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAs5JREFUOE+lk/tvi1EYx98/xT8gW4REIpGFMEQWl2FiM9ZMZhm2xRAyOsmujFFmdFRHu0tWm87UypxStr69zPauN5e5rHVp3IYhbOvHy+wHEQlxkm+ek+d8nm9OznkeSfrfldmgJC7QyUlTymsJTfuTZ25z4HdWYwyLreYhtpgekGPw0+kKvo1Eo+IXRSIiEhkWZuc9tqnsJD9EqTUopCxjSGTpB0iueczSo1HyW8cpsExQ1DbxI2pt45j9cXpexul4FEd79RnZphAa/SD7WvuFtO6UItbU9LC+YQxNI2w0wwYT5LRAdhOU3oBTIXC9gXP3oUSGgz2vST3gYHejR0jptT1C332f8yrUEYHrz8CgxDnpm6DKCUfc0KnmXa/AEVPPwnDcD0cvetA2uYRk67Ive/lpjO7YBO1PPuF8Df3vwf4cbNE4tqdw7YVq8HYyHx6FvhE1hkMEg8HDUqvFkjT4aIjMqkqyqkswDSrcfBfH+Q561YLAZ/B+BLda6FXlU/cPv0AoEPhuoP1h4Av7Wbh9E/Py15NWWUjeSR3nZDfeN+N0DY9hG/7K1eGP3P0S5/EYRFUF/IOTBrUXHPm9fT6mr1xEwupkZqxbzLyiDJYUZ5NSnkdqdSHpxyrYdFpPgdmAsdfJwPMI/Yr65bf7tZLGGBQ7DNdJWFtIYvoOZmbuZE7OXpIKKli86zAr9p9gTVktWTVnKTI2U95uRWe3U2IJUDbVB5p6hVm5x5m9Vc/cnedZUNzC8lILaQesZBy6hEZ3maKzgvJWFzVWD9XtXvVGQbSWASFtMATVRlJIKbOTWtlJXaeXepuPM1f6MNp9GLt8mLvvYLmp0OhQ2Fwvk6m7xaqDTvY0eYWUVtcnllXfYlGpnfklVuraHHg8HjxuN+6fktUHlWWZPaZeUo/ILK0UKttBcbNbSB9GP0yLxWJJUxoZGUn80zD9C/vXQ/4NHY10h3M1zmQAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.installgentoo::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABcVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB3dIYAAAAAAAAAAAAbGh4BBAcCBgoBBgoCBwsCCQ/QzucCCA7MyuXZ1eUBBQmTh8fo5/i9svIAAADh3vQAAAACCA0CCQ8CCQ4DDBQbGCUDChDr6vgAAAAAAAAREBIDCxK6tdfe2fTv7/cDCxIDDBQEDRUHDhgMJjXk4PZdXWdLUFoUNEYOKDgSMUMRLUBneI4eTGj08/QmW3onW3rTzvfOx/giU3IiVHMkWHdEaYJobHv3+PokWHpua6TNy9xZgZ+1quz8/foQKj0XPFInWn0nW38tZ4o6fqg8gq48grA9hrU/i7pAhrNAiLdBjLtEjr1FksNIjr5Il8pImMtKWnNqhL97odKFqti5q/q5rPq60+nCt/vLw/vPx/jV0vHY0/rc1/rg2/vh3fzn4fzu6/vx8vf19Pv19Pz49/v5+Pv8/Pv8/fr9/vv+/frziVtUAAAAT3RSTlMABQYHCAoNDhARGRobL0ZOV1xdXV5fYGBmZnB0eX2MjZSaoaGio6mqqqustLq7zubo6Ojo6evt7u/x8fLy9/f4+Pj5+vr6+vr6+/39/v7+XKgUSwAAAMhJREFUKM9jYGDg4OZmZgABKINT1dBAhBHIYFMxMBIDisjbhoZbCTExsCu5hoeY8DEwcOkEx8fY6MqpucTGB0izglVEplcU5/gmRYWBVQDNMK+s0hN3SvMyBpsBNJxXw0NfwTEjVQZqHQMHj5RfWW5mliSEC7TPzK6yJD/bXZQRzGdXcisqLy309okA2Q4Eis4peQWmstqBCdGW/CABraC45ERBBs3A6Fh/AbAKTwsHa34QZW8NVsGuLqwswQSjQICTmYMFQaEDAAF8JHLfKGswAAAAAElFTkSuQmCC') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.liveleak::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAlNJREFUGBkFwU2LVmUYAODrPu8Z5x1xSpRBXQyFoLsBE+wfiO5atJOgnf9DUPwFgtGinUgEaQsRhHYuMtpEiEWuG5iNjuOcj+c8z911xXcXL/68c3Dw1fzhg0QgEQAAEYGUKXFie9vxlSs/xk/rdavjGEkmkWSih65z4osv9GfOiK6LzEyZ2uGh4dUrmzs72ddlUUhkoiMr4PT167589Mh6c1N0nSRlqrX67dat+PDyZXRT19m5edPnt28rGFHxMcJ6d9fprS1/37tneP3aemPD1uamUydPOru3p5DdGOH0tWsu3LhhxIQJM2qEpRT/Pn3q/du3AhARSmvGTH0lplKMrVkiYpVpQaJlighzhDkzhmEA0fcWoqAfyaFW4zTlgCABxlrNmY4ylUzLsiREprFWc0T2M+ZSjKWY0AEaltZUjJixZJIpuk5pTWlNP2BYFvOyKJkCAKU1tTXHrZlqVWolUxdhxsfVSj9FmJfFMM9GdICGGa01HyMstYpMIFPJVNDPmYZSTOPoOEKHzNRlKpmWWh1j6TpLa2SKTKVWU6Z+Qolwdm/P9QcPZKa2LH69e9eIMs+WCL/cv2/98CGZPrt61am+V9APq1X89eyZ/968obVYaiXT4dGREgG+vnPHeHgYMsH2+fP+efEihtVKv7SWw/6+9/v7KYLMhIywTJPamvOXLomukyRsrNf+ePzYkpl9dJ3SWgSCSCQCfz5/7pMLF2yfO6eLiAQcHRz4/cmT+HR7O+Ob3d0fNt69+7a2BiICQCJbA0EgE5lpvbXl1OXL3/8Pfax4+6SjSukAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.pastebin::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAB1FBMVEUAAAAAAAAAAABWYWwAAABbY3BbYm5dZnFdZXJeZnMEBAQHCAhYYGpdZnFdZnBgaHIlJyomKCooKi09QkdESU5eZGtdYmhdYmleY2lrcXdqb3Rqb3Rqb3SSmJ+SlJeWmJutr7GtrrCWm6ChpKhbW1tmZmZvb290dHR3d3d4eHh5eXl6enp8fHx+gIJ/f3+CgoKDg4OEhISFhYWHh4eKioqKjI2Li4uMjIyOjo6Pj4+QkJCRkZGSkpKUlJSVl5mWlpaYmZqZm52ampqbm5ucnJydnZ2enp6fn5+hoaGioqKkpKSkpaalpaWmp6mmp6qnqauoqKioqquoqq2qqqqrrK2srKysra6srrCsrrGurq6vr6+wsLCxsbGysrKztLa0tLS1t7m2tra3t7e4uLi5ubm6urq7u7u8vLy9vb2+vr7AwMDAwsTBwcHExcfFxcXFxsnGxsbHx8fIyMjJycnMzMzNzc3Ozs7O0NLPz8/Q0NDR0dHR09XT09PV1dXV1dbV1tfV19rW1tbX19fX19jY2tzZ2dnZ2tva2tra3N3a3N7c3Nze3t7f39/f4OHg4ODi4uLl5+jm5ubs7Ozs7e3u7u7v7+/v8PDw8PDx8fHy8vLz8/P29vYSoLMZAAAAJHRSTlMABAUGCwsNHCAiLzMzMzZEYGJwgIuOnJycnqmqq9bc3+/w8fkZ0N/uAAAA/klEQVQoU2NgYGDl5YMDdgYGBmZZ3964CYFtIR3e9Q7K/AwMHI55KfaFmcHWMy3K3MwlGRg4wz0zdYpcorRbNbL0LaWAAp3ts2umV8wo6MupTauQBgqUG03VL7W3sfZSb1erAgm02M+yzYrVCXUy6zapAQlUx/dEdyX3J3ZHVUYVywAF8o2rDNN1Go2jzGLMokAC2QbuSc42mXmaOXop9iAtCXrJ5qXWjT59Abl2ESJAAX/tSIMMiyrrqQ3T6uS5gQK6kSqpqkUermGTexQFmYACflqR+hlWZSamzQpCLEDPsSmVVDT1TJw0JUhOAMRnYOARFRMTE5cQF+ZiBPIAII5B3EVG0b4AAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.peertube::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABIFBMVEUhHyAAAABzPBnxaA3CWBEnJSYbGRptbW16enpzc3PTayWhb04hHyAhHyAhHyAhHyAhHyAhHyAhHyAhHyAhHyAhHyAhHyAhHyAhHyAhHyApIh+0UhMfHiBWMhvsZg7zaQ0hHyAhHyAXHCHzaQ3xaA3xaA3xaA3xaA0hHyAhHyDxaA3xaA3xaA3xaA3xaA3xaA0oJickIiMdGxwUEhPxaA3xaA3xaA1sbGxwcHB3d3eFhYXxaA3xaA3xaA1zc3Nzc3Nzc3Nzc3Nzc3PxaA3xaA3xaA1zc3Nzc3NtdHjxaA3xaA1yc3STcFnvaA/yaAxzc3N4c2/FbDFzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3MhHyDxaA1zc3MAAAAfljyVAAAAXHRSTlMAAAAAAAAAAAAAAAAZkjMBHOLXYArj8p0u2VsJ1XaGL/OhKyXc1WEN2gwk2/SjKgEYiS4B/tYFGosqAdleAxzj12ML9Z8s850rJWbYeYMs1F8Koiri1V0MGZY0AYbIBFIAAAABYktHRAH/Ai3eAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4wYXFBUVX81QWQAAAKxJREFUGNNVz9UWgkAQANDBtdbu7lZsxe7ubpH//wxBPKDzNvdMAmi0Oj0QQgAYjCazBX7BStvsDqHoAzTtdLklf+Dx+vwICRAIhsKRaCyOvpAwJ6Up8pXOZHOIAFm+UCzJEQuvMhWrIFBUa/WGkodmq40Ad7q9/kDFwnA05lpYYCbT2ZykFvxQDhhmuVpvcvxaHra7vfp72KflcMSYEOB0vlyx+By+3R9PMSfe+P0enM1454kAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTktMDYtMjRUMDM6MjE6MjEtMDc6MDDse6MAAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE5LTA2LTI0VDAzOjIxOjIxLTA3OjAwnSYbvAAAAABJRU5ErkJggg==') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.soundcloud::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABsklEQVQ4y5WTy2pUQRCGv2rbzDjJeAlIBmOyipGIIJqFEBDElwh4yULGeRFXPoEIBl/AvQ/gC2RnxCAoxijiwks852S6+3dxzslcHJCpTXVX11/Xv0097gLPgVNMJxnQNfX4zsqleWbnpoMf/oa9d988MM9MC/rp+E0a+A0dsVobMNMCOO8B6McRoABJI+A6gJmN3D2A8jgEBCEkSEMBrcrsDAzDWWn3AjgKFaDMmgRqniGFgsaDp1jrLOngDf1XT1D+A1dFc4MKAkkiCVKjjVu7g9+4Rzx4i1u6hjXbuMWr0O5QPNvCu7IaCZwEKQukLGDrm5x8uI0tr6MkiGlkiv7yLfzN+6S5i6QsIMABkEfcxhbWWYMkVAOjxvYAjc3HNHrbKI9VBQBFwF25XQKSBjqIf1YBuAurEMrczgDygD6/x2LCpFLXLUyQ+PoldphhBhYfIX09XU1+Flaukz7uYqs3SHs7cG4BmTsmkBUF9mmXEwa28BNLPaQPLepuNcbGSWQquQC2/Kdcox1FUGkcB0ykck1nA2+wTzMs8stGnP4rbWGw74EuS/GFQWfK7/wF6P4F7fzIAYkdmdEAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.streamable::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABXFBMVEUPkPoNj/qExv0PkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoNj/oPkPoNj/oNj/qExv0PkPpruvwPkPornfoVk/opnPpnufwPkPqExv0Nj/oPkPoNj/oPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoOj/opnPsVk/oMjvoOkPoTkfo6pPsblfo3ovva7v7////v9/5Sr/whmPry+f5htvze8P7W7P5itvyl1v0imPu84P3o9P50v/zN6P73+/8lmvs8pfs+pfsKjvr9/v9EqfsNj/oom/v8/v9nufxAp/tJq/sQkPrb7v6t2f0IjPoclvr6/f9luPwUkvrp9f7h8f5ruvy/4f4kmftpuvwxoPum1v32+/8jmfpMrPvu9/7z+f9UsPs7pPv8/f/4/P9oufwalfpDqPsMj/ounvtVsPsnm/qzfQQ9AAAALXRSTlMAAAAggMzw0IYkBPb4iAamsgZ+jPwogpDO1vTYlPoulL4KivyUCiqO1PL01i67tUAWAAAAAWJLR0Q4oAel1gAAAAd0SU1FB+MGFxMuDXVcMbIAAADdSURBVBjTY2AAAmYWVjY2dg5OBgZGJiCXi4VbFwx4ePlAAlz8unAgIAgUENJFAsJMDMw8unp6+gaGRsYmpoa6IqIMYrp6ZuYWllbW5hY2toZ64gwSurp29g6OTs4urm7uHrqSDGy6nhZeet5WPr5+/gGBelJAgSCLYL+Q0LBw3YjIKKAAu250TGxcvE1CYlJySqquNAOHrl9aukVGZla2RU6uoZ4MA6esrl9evnWBYWFRMdBaOQYGXmSHyQNdyieA4CsogjzHpyQL4SqrqIJ9y8Cgpq6hqaWtogPyPgDmvSxRxBWM9AAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxOS0wNi0yNFQwMjo0NjoxMy0wNzowMCKUvXUAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTktMDYtMjRUMDI6NDY6MTMtMDc6MDBTyQXJAAAAAElFTkSuQmCC') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.twitchtv::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAYUExURf///2RBpWRBpWRBpWRBpWRBpWRBpf///+zQyUYAAAAGdFJOUwFdZX0lTzs4r5oAAAABYktHRAcWYYjrAAAAB3RJTUUH4AINEi42iSXRNAAAAD1JREFUCNdjYEiDAAZGGIMtjQEEUBlMCWoEGci6mGEMsxQgIy0BiB3AjLS0FAYQIw0kwABipoI1AhkBQBIAFCIXxiHgq80AAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.twitter::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAEsUExURf///1Cf21Gg3FGi31Gh3VKj4FGh3lKj4VKk4lKl41Ol5FOn51Sp6VSo6FOn5lCf21Gg3FGh3VGi31Gi31Gh3lGg3FGg3FGg3FGg3FGh3lGg3FGi31Kk4lKj4FGh3lGi31Kk4lGh3lGg3FGh3lOm5FOm5VGi31Kj4VSo6FGi31Gh3VGg3FKj4FOn51Gi31So6FWr7VOl5FGi31On51Sq6lKk4lOo51Sp6VOm5FSq61Ws7VOn51Oo51Sq61Ol5FOm5FSq61Wr7VOo51On51Sr7FWs7VSp6lGg3FGh3VOm5FWr7VSp6lKj4VOm5FSo6FSr7FWs7VWs7VWr7VSq6lOo51Om5FOo51So6FOm5VOl5FSq61Ws7VSr7FSp6lSp6VWs7lWr7VKk4lSq6v///6E3MNsAAABVdFJOUwAAAAAAAAAAAAAAAAAAAB0Ii+3xnBVTJhfsMKb+qTEp9GwBF/7lLAbo0m4pLkUTdvk2Ev3+EZnOBo/3Z8ffCRzH/D0OqPxiLnvx3UI8m9n1++GwXQZNS29BAAAAAWJLR0QAiAUdSAAAAAd0SU1FB+ACDRIwBwy67tEAAADKSURBVBjTY2BAB4xogIGRH8IQEBQSFhEVE2eQkJQC8ZmkQ8PCI2Rk5RjkIxUUlRgZlVWioqNjYlXVGNQ14iI1tbR14qLj4+MTdJkZ9PQNosJCE0OjgPz4KEMWBiPjhPiEmKQokIJ4E1MmBmazhHg4MGdlYmCzsLSC8ROsmRkZmFht4Eps7ViADmOzd4DyHZ2YmYACTOzOLmATXd04mIBOd/eQ9owFCXh5c7KB/MLi4+vnHxAYFBzCwcYEEmBi5uLm4eHl42RmAnsSAMZBLgZiFUQ5AAAAAElFTkSuQmCC') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.video::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAxgDGAP8nNqN7AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gMZBjQQLEEqGwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAA5SURBVDjLY2AYaMDIwMDwn1JD/lPCZhpwL+B1wf///ykzgBhDiAoDfIYQZQAjIyP5BuDTPJqQqAQAvW0ZAMk8+EEAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.vidlii::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAACvlBMVEUCWv8HXf8AWv8AAAD///8AVP+bqP8AWv8AVO4AOqUAGkgAyf8APa0AL4QABAsASdEAVv8AUv8AUv8AVP8AWP8BWv8JXv8RYv8QYv8DW/8DXP8xdv9RiP9Af/8IXf8AKP8KXv8JXf8NYf8aaf8ATP0UZP0AVf8AT/8AT/8AVv8ATedvnPVAf/8AT/sYZvl0o/8PYf8udf8aa/8FXf8AVf8AOrRBe/Nvn/8AUv0aaPkXZ/8ATv8AKYQZYuwIXf8ca/wTZP8ASP8AED0HUNwZaf8xdPwDWv8AAAAAQMRcjvQAU/8AMZssb/Jmmf8AU/8AJXsRW+dSif8AUv8AAAAASdQtdP8ATv8AQ/8AQv8APbtKgfQud/8XZ/8TZP8FXP8AKIIcZO4wdP8AF08KU95tnv4gafhZi/Rnl/ZzofcocP8AAAAAQ8Q4efRwnvVmlvVcjvgrcfsAQsQAOK0APrwAQcUEStMLXPgDWv8AHE8APLEARdIAQ80ASeEAVf8AOJkAAAAAAAAAAAAABBMAJJIAY/9rmP+vxv90n/+buPv29/7C1P+zx/n///2Crv/7+fjs8f++z/f///3l6fX9/f/L2fj9/P5ilv9Nh/3h6f6vyf/D0vT///2lwP/Z5Pf3+P9OiP9klvr9/Puzyf+QsPX//fnW4v/k6vfv8/86ev94pfj///uRtf/y8vby9f9Fgv9EgPzt7/jj7f8mcf+eufj///x1pP/Z4fT///52pf9Uivv09fnV4v8ncf64yvj7+/6vxPX///yyyf9ynvr6+vvG1/8ocv3O2/fz9v53ofX8+/nb5v+YuPz//vy0yv8vdP3e5/fn7v/p7PX09//b5P7///6eu/9Df/zq7vjc5//I1vT//v3+/v////9+q/9Tivnn6fPy8/rW4fzI1/2qwv6YtPT8+fX39/jz9PqJrveTsvqfpuxrAAAAhXRSTlMAAAAAAAAAAAAAAAAAAAAABSlERA45nrSzP3TZ7e12Ao2LusMcrJYhFwaR/uhCwP/x5tZzBWHy+n3OvA8u17jmpwgPrOz5jAF2+3FA7PdYG8fuPQaX5jAGAV/39MCmdy/e/RGz/vj5/f/rAXj4//z13n52i5qmmFQ1lqOQaTgIBAYKEAYAKGjtAgAAAKNJREFUGBkFwT0uRGEYBtD3ZJ77uT8iGrXCAixCr7OCyRA2oCKqiUYkOgoJwhqUbMAKLEChVYhk4pxswvcWfFGVEbYtuJutqir9Ibc0uh0+V+mf5gY69yN2PzKJiTjCg8qa3uLRAJpKM9AMoL1VOi9zJ4CQ9z0jwHX+RAwAURUxAMSB/L7u35wCGlKaHrDkPGVmwhlc6FN6l1iHKxupn+djAPgHrEwa+qrzy0oAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.vimeo::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAYFBMVEUAAAAIdZUKh6sLlLkLmr4LmsAMp88NrdYVW3MZj7Acstkrt9s1e5E7vN5EfI9JvdtKwuBijp5kpbl30eiDt8aG1uqRr7qTyNehxM+k4PCy3enB3OTg6Ovv9PXw+fz////L9U5WAAAAAXRSTlMAQObYZgAAAIFJREFUeNplz90OwiAMBWAQpAoyxclkP3je/y0H2AQXz0WT8100rRD6kNI9/cRroemQL3hXhoujZYj4OHoAmBvYGcBISwbWBvfXCrytnIDUQMkbsBpagMA7zhtQdyTFQAmIG7IkYniiZuh3XGsPqoOZkMOJOpAcLqUzNFGGu/57fwc1hgtp0mVSyQAAAABJRU5ErkJggg==') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.vine::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAIGNIUk0AAH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UXsBBSVMySUpSVs6KyqrqmFmKuY30D0NjU3NLa1t6h9jvZ1Q30WGi19fb1KzAwyKFhYGSUY+MTkwpMTXNmFpibX+Di0rICWFldW9/A5tb2zu7ePtTrg0MeHePklPYzuDRw7uDF5RWvbwC32O0d7x8en55f4DHF6xv5/vHp6f/k6/vH+evuf1LAObptvSvrAAAAAElFTkSuQmCC') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.vocaroo::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAw9JREFUOE9jYMABuMwYmCyTJKUCGlSnFSy02TTzeOyCiQcDViX26qVz2TAyYtWmEMwuoZ3M7V40LcB79pHkc0svpvzY8jD//87nxf+3Pyn8v/ZO8v+VNyP/2mZJumI1QCWSI8232Hjumitlfw5+qPp/9l8TCt76JP//xkdx/wsXWCzjtWFkwTCkbWFe9plPk/+ga4Txz/xt/D/hkN//gMXif21a+NbyWjIwoRiy6GDT5rP/mlFsPfyp5n/NpOj/22+0gMUXXIz/H7hC/L/bFKFbPDZMrHAD5H35OPt2J9zacDv/f3V7xv9FhwrBGubsT/1//Pjx/1GJ/mD+/nfl/1v3Ovy3KRJNQbHdOlXCvOO03/+pm1P/v3v37n90hhtYw9HPtf8Xb2v937cmHswHeWPRxYj/LvkK3igGKARwicTO07118H3V/5kbi/4vPZMJtK3s/6YH2f+Pfq1B8VbjWrdnMu5s4nAD9CNFhKwz5DTUvLl419zKvAcLtG1P84BRl/b/5M/6/6f/NPzf/qzo84yj0Uus0xUU4Zor54bm9+4OfZG02OCuoAMTb9ZkC9ull1Nvrr2Z+XvRpaRfc65H/68F+jl9svEhzyLFWoccWVc+eyTHq/twydjlKRln7jX9bNMkMJnbhoFRL1xCqmKx6/yi2fYXa/c5/e846PV/5fW0/7OPx/yfcjzop34ulxdGGvDuU8mMXaX507lBuiN6ueadmQeT/p/93vf/1O+G//sP5fw/eL3o/5JLif8zVxs+Tlir9S26UyeFQQvJGBE7FvaFZ9LfN+1y+WjbItSb3GmXvXd15v8zroH/HxgE/D+aGPx/18vi/z07PeZNPRKxe/Kh0Ae8toxscCO4zBkYXArk9C1SxJUYjBkYPPIVtbbuTftz3cz//2O9wP/75iSAXdO72/dt2HL5F6YlfBW4MiJYXMiBiW3t7azHBx+V/t89N+H/8a+1//e9K/9attDp5LQjYX8SuvVL8RoAkmxa65299Erq1FnHo0qrl7t4BddriIs4MrM3rfWcFd+pGwVSAwBZ0bKP8yrZPAAAAABJRU5ErkJggg==') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.youtube::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAMCAYAAABr5z2BAAABIklEQVQoz53LvUrDUBjG8bOoOammSf1IoBSvoCB4JeIqOHgBLt6AIMRBBQelWurQ2kERnMRBsBUcIp5FJSBI5oQsJVkkUHh8W0o5nhaFHvjBgef/Mq+Q46RJBMkI/vE+aOus956tnEswIZe1LV0QyJ5sE2GzgZfVMtRNIdiDpccEssdlB1mW4bvTwdvWJtRdErM7U+8S/FJykCRJX5qm+KpVce8UMNLRLbulz4iSjTAMh6Iowsd5BeNadp3nUF0VlxAEwZBotXC0Usa4ll3meZdA1iguwvf9vpvDA2wvmKgYGtSud8suDB4TyGr2PF49D/vra9jRZ1BVdknMzgwuCGSnZEObwu6sBnVTCHZiaC7BhFx2PKdxUidiAH/4lLo9Mv0DELVs9qsOHXwAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -/* XXX Moved to end of stylesheet to avoid breaking whole stylesheet in Maxthon. */\n\ -@supports (text-decoration-style: dashed) or (-moz-text-decoration-style: dashed) {\n\ - .quotelink.forwardlink,\n\ - .backlink.forwardlink {\n\ - text-decoration: underline;\n\ - -moz-text-decoration-style: dashed;\n\ - text-decoration-style: dashed;\n\ - border-bottom: none;\n\ - }\n\ -}\n", - -report: -"#g-recaptcha,\n\ -:root:not(.js-enabled) #captchaContainerAlt {\n\ - height: auto;\n\ -}\n\ -#captchaContainerAlt td:nth-child(2) {\n\ - display: table-cell !important;\n\ -}\n\ -/* Archive reports */\n\ -#archive-report {\n\ - padding: 3px;\n\ -}\n\ -#archive-report-enabled {\n\ - vertical-align: middle;\n\ -}\n\ -#archive-report > label {\n\ - display: block;\n\ -}\n\ -#archive-report-reason {\n\ - display: block;\n\ - width: 98%;\n\ -}\n\ -.archive-report-success {\n\ - color: green;\n\ -}\n\ -.archive-report-error {\n\ - color: red;\n\ -}", - -www: -"#captcha-cnt {\n\ - height: auto;\n\ -}\n\ -:root:not(.js-enabled) #form {\n\ - display: block;\n\ -}\n\ -#bd > div[style], #bd > div[style] > * {\n\ - height: auto !important;\n\ - margin: 0 !important;\n\ - font-size: 0;\n\ -}\n", - -sub: function(css) { - var variables = { - site: g.SITE.selectors - }; - return css.replace(/\$[\w\$]+/g, function(name) { - var words = name.slice(1).split('$'); - var sel = variables; - for (var i = 0; i < words.length; i++) { - if (typeof sel !== 'object') return ':not(*)'; - sel = $.getOwn(sel, words[i]); - } - if (typeof sel !== 'string') return ':not(*)'; - return sel; - }); -} - -}; - -$ = (function() { - var $, - slice = [].slice, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - $ = function(selector, root) { - if (root == null) { - root = d.body; - } - return root.querySelector(selector); - }; - - $.DAY = 24 * ($.HOUR = 60 * ($.MINUTE = 60 * ($.SECOND = 1000))); - - $.id = function(id) { - return d.getElementById(id); - }; - - $.ready = function(fc) { - var cb; - if (d.readyState !== 'loading') { - $.queueTask(fc); - return; - } - cb = function() { - $.off(d, 'DOMContentLoaded', cb); - return fc(); - }; - return $.on(d, 'DOMContentLoaded', cb); - }; - - $.formData = function(form) { - var fd, key, val; - if (form instanceof HTMLFormElement) { - return new FormData(form); - } - fd = new FormData(); - for (key in form) { - val = form[key]; - if (val) { - if (typeof val === 'object' && 'newName' in val) { - fd.append(key, val, val.newName); - } else { - fd.append(key, val); - } - } - } - return fd; - }; - - $.extend = function(object, properties) { - var key, val; - for (key in properties) { - val = properties[key]; - object[key] = val; - } - }; - - $.dict = function() { - return Object.create(null); - }; - - $.dict.clone = function(obj) { - var arr, i, j, key, map, ref, val; - if (typeof obj !== 'object' || obj === null) { - return obj; - } else if (obj instanceof Array) { - arr = []; - for (i = j = 0, ref = obj.length; j < ref; i = j += 1) { - arr.push($.dict.clone(obj[i])); - } - return arr; - } else { - map = Object.create(null); - for (key in obj) { - val = obj[key]; - map[key] = $.dict.clone(val); - } - return map; - } - }; - - $.dict.json = function(str) { - return $.dict.clone(JSON.parse(str)); - }; - - $.hasOwn = function(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); - }; - - $.getOwn = function(obj, key) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - return obj[key]; - } else { - return void 0; - } - }; - - $.ajax = (function() { - var pageXHR; - if (window.wrappedJSObject && !XMLHttpRequest.wrappedJSObject) { - pageXHR = XPCNativeWrapper(window.wrappedJSObject.XMLHttpRequest); - } else { - pageXHR = XMLHttpRequest; - } - return function(url, options) { - var err, form, headers, key, onloadend, onprogress, r, ref, responseType, timeout, type, value, withCredentials; - if (options == null) { - options = {}; - } - if (options.responseType == null) { - options.responseType = 'json'; - } - options.type || (options.type = options.form && 'post' || 'get'); - url = url.replace(/^((?:https?:)?\/\/(?:\w+\.)?(?:4chan|4channel|4cdn)\.org)\/adv\//, '$1//adv/'); - onloadend = options.onloadend, timeout = options.timeout, responseType = options.responseType, withCredentials = options.withCredentials, type = options.type, onprogress = options.onprogress, form = options.form, headers = options.headers; - r = new pageXHR(); - try { - r.open(type, url, true); - ref = headers || {}; - for (key in ref) { - value = ref[key]; - r.setRequestHeader(key, value); - } - $.extend(r, { - onloadend: onloadend, - timeout: timeout, - responseType: responseType, - withCredentials: withCredentials - }); - $.extend(r.upload, { - onprogress: onprogress - }); - $.on(r, 'error', function() { - if (!r.status) { - return c.warn("4chan X failed to load: " + url); - } - }); - r.send(form); - } catch (error) { - err = error; - if (err.result !== 0x805e0006) { - throw err; - } - r.onloadend = onloadend; - $.queueTask($.event, 'error', null, r); - $.queueTask($.event, 'loadend', null, r); - } - return r; - }; - })(); - - $.lastModified = $.dict(); - - $.whenModified = function(url, bucket, cb, options) { - var ajax, headers, params, r, ref, t, timeout, url0; - if (options == null) { - options = {}; - } - timeout = options.timeout, ajax = options.ajax; - params = []; - if ($.engine === 'blink') { - params.push("s=" + bucket); - } - if (url.split('/')[2] === 'a.4cdn.org') { - params.push("t=" + (Date.now())); - } - url0 = url; - if (params.length) { - url += '?' + params.join('&'); - } - headers = $.dict(); - if ((t = (ref = $.lastModified[bucket]) != null ? ref[url0] : void 0) != null) { - headers['If-Modified-Since'] = t; - } - r = (ajax || $.ajax)(url, { - onloadend: function() { - var base; - ((base = $.lastModified)[bucket] || (base[bucket] = $.dict()))[url0] = this.getResponseHeader('Last-Modified'); - return cb.call(this); - }, - timeout: timeout, - headers: headers - }); - return r; - }; - - (function() { - var reqs; - reqs = $.dict(); - $.cache = function(url, cb, options) { - var ajax, onloadend, req; - if (options == null) { - options = {}; - } - ajax = options.ajax; - if ((req = reqs[url])) { - if (req.callbacks) { - req.callbacks.push(cb); - } else { - $.queueTask(function() { - return cb.call(req, { - isCached: true - }); - }); - } - return req; - } - onloadend = function() { - var fn1, j, len, ref; - if (!this.status) { - delete reqs[url]; - } - ref = this.callbacks; - fn1 = (function(_this) { - return function(cb) { - return $.queueTask(function() { - return cb.call(_this, { - isCached: false - }); - }); - }; - })(this); - for (j = 0, len = ref.length; j < len; j++) { - cb = ref[j]; - fn1(cb); - } - return delete this.callbacks; - }; - req = (ajax || $.ajax)(url, { - onloadend: onloadend - }); - req.callbacks = [cb]; - return reqs[url] = req; - }; - return $.cleanCache = function(testf) { - var url; - for (url in reqs) { - if (testf(url)) { - delete reqs[url]; - } - } - }; - })(); - - $.cb = { - checked: function() { - if ($.hasOwn(Conf, this.name)) { - $.set(this.name, this.checked); - return Conf[this.name] = this.checked; - } - }, - value: function() { - if ($.hasOwn(Conf, this.name)) { - $.set(this.name, this.value.trim()); - return Conf[this.name] = this.value; - } - } - }; - - $.asap = function(test, cb) { - if (test()) { - return cb(); - } else { - return setTimeout($.asap, 25, test, cb); - } - }; - - $.onExists = function(root, selector, cb) { - var el, observer; - if (el = $(selector, root)) { - return cb(el); - } - observer = new MutationObserver(function() { - if (el = $(selector, root)) { - observer.disconnect(); - return cb(el); - } - }); - return observer.observe(root, { - childList: true, - subtree: true - }); - }; - - $.addStyle = function(css, id, test) { - var style; - if (test == null) { - test = 'head'; - } - style = $.el('style', { - textContent: css - }); - if (id != null) { - style.id = id; - } - $.onExists(doc, test, function() { - return $.add(d.head, style); - }); - return style; - }; - - $.addCSP = function(policy) { - var head, meta; - meta = $.el('meta', { - httpEquiv: 'Content-Security-Policy', - content: policy - }); - if (d.head) { - $.add(d.head, meta); - return $.rm(meta); - } else { - head = $.add(doc || d, $.el('head')); - $.add(head, meta); - return $.rm(head); - } - }; - - $.x = function(path, root) { - root || (root = d.body); - return d.evaluate(path, root, null, 8, null).singleNodeValue; - }; - - $.X = function(path, root) { - root || (root = d.body); - return d.evaluate(path, root, null, 7, null); - }; - - $.addClass = function() { - var className, classNames, el, j, len; - el = arguments[0], classNames = 2 <= arguments.length ? slice.call(arguments, 1) : []; - for (j = 0, len = classNames.length; j < len; j++) { - className = classNames[j]; - el.classList.add(className); - } - }; - - $.rmClass = function() { - var className, classNames, el, j, len; - el = arguments[0], classNames = 2 <= arguments.length ? slice.call(arguments, 1) : []; - for (j = 0, len = classNames.length; j < len; j++) { - className = classNames[j]; - el.classList.remove(className); - } - }; - - $.toggleClass = function(el, className) { - return el.classList.toggle(className); - }; - - $.hasClass = function(el, className) { - return indexOf.call(el.classList, className) >= 0; - }; - - $.rm = function(el) { - return el != null ? el.remove() : void 0; - }; - - $.rmAll = function(root) { - return root.textContent = null; - }; - - $.tn = function(s) { - return d.createTextNode(s); - }; - - $.frag = function() { - return d.createDocumentFragment(); - }; - - $.nodes = function(nodes) { - var frag, j, len, node; - if (!(nodes instanceof Array)) { - return nodes; - } - frag = $.frag(); - for (j = 0, len = nodes.length; j < len; j++) { - node = nodes[j]; - frag.appendChild(node); - } - return frag; - }; - - $.add = function(parent, el) { - return parent.appendChild($.nodes(el)); - }; - - $.prepend = function(parent, el) { - return parent.insertBefore($.nodes(el), parent.firstChild); - }; - - $.after = function(root, el) { - return root.parentNode.insertBefore($.nodes(el), root.nextSibling); - }; - - $.before = function(root, el) { - return root.parentNode.insertBefore($.nodes(el), root); - }; - - $.replace = function(root, el) { - return root.parentNode.replaceChild($.nodes(el), root); - }; - - $.el = function(tag, properties, properties2) { - var el; - el = d.createElement(tag); - if (properties) { - $.extend(el, properties); - } - if (properties2) { - $.extend(el, properties2); - } - return el; - }; - - $.on = function(el, events, handler) { - var event, j, len, ref; - ref = events.split(' '); - for (j = 0, len = ref.length; j < len; j++) { - event = ref[j]; - el.addEventListener(event, handler, false); - } - }; - - $.off = function(el, events, handler) { - var event, j, len, ref; - ref = events.split(' '); - for (j = 0, len = ref.length; j < len; j++) { - event = ref[j]; - el.removeEventListener(event, handler, false); - } - }; - - $.one = function(el, events, handler) { - var cb; - cb = function(e) { - $.off(el, events, cb); - return handler.call(this, e); - }; - return $.on(el, events, cb); - }; - - $.event = function(event, detail, root) { - if (root == null) { - root = d; - } - if ((detail != null) && typeof cloneInto === 'function') { - detail = cloneInto(detail, d.defaultView); - } - return root.dispatchEvent(new CustomEvent(event, { - bubbles: true, - cancelable: true, - detail: detail - })); - }; - - (function() { - var clone, err, ref, unsafeConstructors; - if (!(/PaleMoon\//.test(navigator.userAgent) && +(typeof GM_info !== "undefined" && GM_info !== null ? (ref = GM_info.version) != null ? ref.split('.')[0] : void 0 : void 0) >= 2 && typeof cloneInto === 'undefined')) { - return; - } - try { - return new CustomEvent('x', { - detail: {} - }); - } catch (error) { - err = error; - unsafeConstructors = { - Object: unsafeWindow.Object, - Array: unsafeWindow.Array - }; - clone = function(obj) { - var constructor, key, obj2, val; - if ((obj != null) && typeof obj === 'object' && (constructor = unsafeConstructors[obj.constructor.name])) { - obj2 = new constructor(); - for (key in obj) { - val = obj[key]; - obj2[key] = clone(val); - } - return obj2; - } else { - return obj; - } - }; - return $.event = function(event, detail, root) { - if (root == null) { - root = d; - } - return root.dispatchEvent(new CustomEvent(event, { - bubbles: true, - cancelable: true, - detail: clone(detail) - })); - }; - } - })(); - - $.modifiedClick = function(e) { - return e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0; - }; - - $.open = (typeof GM !== "undefined" && GM !== null ? GM.openInTab : void 0) != null ? GM.openInTab : typeof GM_openInTab !== "undefined" && GM_openInTab !== null ? GM_openInTab : function(url) { - return window.open(url, '_blank'); - }; - - $.debounce = function(wait, fn) { - var args, exec, lastCall, that, timeout; - lastCall = 0; - timeout = null; - that = null; - args = null; - exec = function() { - lastCall = Date.now(); - return fn.apply(that, args); - }; - return function() { - args = arguments; - that = this; - if (lastCall < Date.now() - wait) { - return exec(); - } - clearTimeout(timeout); - return timeout = setTimeout(exec, wait); - }; - }; - - $.queueTask = (function() { - var execTask, taskChannel, taskQueue; - taskQueue = []; - execTask = function() { - var args, func, task; - task = taskQueue.shift(); - func = task[0]; - args = Array.prototype.slice.call(task, 1); - return func.apply(func, args); - }; - if (window.MessageChannel) { - taskChannel = new MessageChannel(); - taskChannel.port1.onmessage = execTask; - return function() { - taskQueue.push(arguments); - return taskChannel.port2.postMessage(null); - }; - } else { - return function() { - taskQueue.push(arguments); - return setTimeout(execTask, 0); - }; - } - })(); - - $.global = function(fn, data) { - var script; - if (doc) { - script = $.el('script', { - textContent: "(" + fn + ").call(document.currentScript.dataset);" - }); - if (data) { - $.extend(script.dataset, data); - } - $.add(d.head || doc, script); - $.rm(script); - return script.dataset; - } else { - try { - fn.call(data); - } catch (error) {} - return data; - } - }; - - $.bytesToString = function(size) { - var unit; - unit = 0; - while (size >= 1024) { - size /= 1024; - unit++; - } - size = unit > 1 ? Math.round(size * 100) / 100 : Math.round(size); - return size + " " + ['B', 'KB', 'MB', 'GB'][unit]; - }; - - $.minmax = function(value, min, max) { - return (value < min ? min : value > max ? max : value); - }; - - $.hasAudio = function(video) { - return video.mozHasAudio || !!video.webkitAudioDecodedByteCount; - }; - - $.luma = function(rgb) { - return rgb[0] * 0.299 + rgb[1] * 0.587 + rgb[2] * 0.114; - }; - - $.unescape = function(text) { - if (text == null) { - return text; - } - return text.replace(/<[^>]*>/g, '').replace(/&(amp|#039|quot|lt|gt|#44);/g, function(c) { - return { - '&': '&', - ''': "'", - '"': '"', - '<': '<', - '>': '>', - ',': ',' - }[c]; - }); - }; - - $.isImage = function(url) { - return /\.(jpe?g|jfif|png|gif|bmp|webp|avif|jxl)$/i.test(url); - }; - - $.isVideo = function(url) { - return /\.(webm|mp4|ogv)$/i.test(url); - }; - - $.engine = (function() { - if (/Edge\//.test(navigator.userAgent)) { - return 'edge'; - } - if (/Chrome\//.test(navigator.userAgent)) { - return 'blink'; - } - if (/WebKit\//.test(navigator.userAgent)) { - return 'webkit'; - } - if (/Gecko\/|Goanna/.test(navigator.userAgent)) { - return 'gecko'; - } - })(); - - $.platform = 'userscript'; - - $.hasStorage = (function() { - try { - if (localStorage.getItem(g.NAMESPACE + 'hasStorage') === 'true') { - return true; - } - localStorage.setItem(g.NAMESPACE + 'hasStorage', 'true'); - return localStorage.getItem(g.NAMESPACE + 'hasStorage') === 'true'; - } catch (error) { - return false; - } - })(); - - $.item = function(key, val) { - var item; - item = $.dict(); - item[key] = val; - return item; - }; - - $.oneItemSugar = function(fn) { - return function(key, val, cb) { - if (typeof key === 'string') { - return fn($.item(key, val), cb); - } else { - return fn(key, val); - } - }; - }; - - $.syncing = $.dict(); - - $.securityCheck = function(data) { - if (location.protocol !== 'https:') { - return delete data['Redirect to HTTPS']; - } - }; - - if (((typeof GM !== "undefined" && GM !== null ? GM.deleteValue : void 0) != null) && window.BroadcastChannel && (typeof GM_addValueChangeListener === "undefined" || GM_addValueChangeListener === null)) { - $.syncChannel = new BroadcastChannel(g.NAMESPACE + 'sync'); - $.on($.syncChannel, 'message', function(e) { - var cb, key, ref, results, val; - ref = e.data; - results = []; - for (key in ref) { - val = ref[key]; - if ((cb = $.syncing[key])) { - results.push(cb($.dict.json(JSON.stringify(val)), key)); - } - } - return results; - }); - $.sync = function(key, cb) { - return $.syncing[key] = cb; - }; - $.forceSync = function() {}; - $["delete"] = function(keys, cb) { - var key; - if (!(keys instanceof Array)) { - keys = [keys]; - } - return Promise.all((function() { - var j, len, results; - results = []; - for (j = 0, len = keys.length; j < len; j++) { - key = keys[j]; - results.push(GM.deleteValue(g.NAMESPACE + key)); - } - return results; - })()).then(function() { - var items, j, key, len; - items = $.dict(); - for (j = 0, len = keys.length; j < len; j++) { - key = keys[j]; - items[key] = void 0; - } - $.syncChannel.postMessage(items); - return typeof cb === "function" ? cb() : void 0; - }); - }; - $.get = $.oneItemSugar(function(items, cb) { - var key, keys; - keys = Object.keys(items); - return Promise.all((function() { - var j, len, results; - results = []; - for (j = 0, len = keys.length; j < len; j++) { - key = keys[j]; - results.push(GM.getValue(g.NAMESPACE + key)); - } - return results; - })()).then(function(values) { - var i, j, len, val; - for (i = j = 0, len = values.length; j < len; i = ++j) { - val = values[i]; - if (val) { - items[keys[i]] = $.dict.json(val); - } - } - return cb(items); - }); - }); - $.set = $.oneItemSugar(function(items, cb) { - var key, val; - $.securityCheck(items); - return Promise.all((function() { - var results; - results = []; - for (key in items) { - val = items[key]; - results.push(GM.setValue(g.NAMESPACE + key, JSON.stringify(val))); - } - return results; - })()).then(function() { - $.syncChannel.postMessage(items); - return typeof cb === "function" ? cb() : void 0; - }); - }); - $.clear = function(cb) { - return GM.listValues().then(function(keys) { - return $["delete"](keys.map(function(key) { - return key.replace(g.NAMESPACE, ''); - }), cb); - })["catch"](function() { - return $["delete"](Object.keys(Conf).concat(['previousversion', 'QR Size', 'QR.persona']), cb); - }); - }; - } else { - if (typeof GM_deleteValue === "undefined" || GM_deleteValue === null) { - $.perProtocolSettings = true; - } - if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) { - $.getValue = GM_getValue; - $.listValues = function() { - return GM_listValues(); - }; - } else if ($.hasStorage) { - $.getValue = function(key) { - return localStorage.getItem(key); - }; - $.listValues = function() { - var key, results; - results = []; - for (key in localStorage) { - if (key.slice(0, g.NAMESPACE.length) === g.NAMESPACE) { - results.push(key); - } - } - return results; - }; - } else { - $.getValue = function() {}; - $.listValues = function() { - return []; - }; - } - if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) { - $.setValue = GM_setValue; - $.deleteValue = GM_deleteValue; - } else if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) { - $.oldValue = $.dict(); - $.setValue = function(key, val) { - GM_setValue(key, val); - if (key in $.syncing) { - $.oldValue[key] = val; - if ($.hasStorage) { - return localStorage.setItem(key, val); - } - } - }; - $.deleteValue = function(key) { - GM_deleteValue(key); - if (key in $.syncing) { - delete $.oldValue[key]; - if ($.hasStorage) { - return localStorage.removeItem(key); - } - } - }; - if (!$.hasStorage) { - $.cantSync = true; - } - } else if ($.hasStorage) { - $.oldValue = $.dict(); - $.setValue = function(key, val) { - if (key in $.syncing) { - $.oldValue[key] = val; - } - return localStorage.setItem(key, val); - }; - $.deleteValue = function(key) { - if (key in $.syncing) { - delete $.oldValue[key]; - } - return localStorage.removeItem(key); - }; - } else { - $.setValue = function() {}; - $.deleteValue = function() {}; - $.cantSync = $.cantSet = true; - } - if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) { - $.sync = function(key, cb) { - return $.syncing[key] = GM_addValueChangeListener(g.NAMESPACE + key, function(key2, oldValue, newValue, remote) { - if (remote) { - if (newValue !== void 0) { - newValue = $.dict.json(newValue); - } - return cb(newValue, key); - } - }); - }; - $.forceSync = function() {}; - } else if ((typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) || $.hasStorage) { - $.sync = function(key, cb) { - key = g.NAMESPACE + key; - $.syncing[key] = cb; - return $.oldValue[key] = $.getValue(key); - }; - (function() { - var onChange; - onChange = function(arg) { - var cb, key, newValue; - key = arg.key, newValue = arg.newValue; - if (!(cb = $.syncing[key])) { - return; - } - if (newValue != null) { - if (newValue === $.oldValue[key]) { - return; - } - $.oldValue[key] = newValue; - return cb($.dict.json(newValue), key.slice(g.NAMESPACE.length)); - } else { - if ($.oldValue[key] == null) { - return; - } - delete $.oldValue[key]; - return cb(void 0, key.slice(g.NAMESPACE.length)); - } - }; - $.on(window, 'storage', onChange); - return $.forceSync = function(key) { - key = g.NAMESPACE + key; - return onChange({ - key: key, - newValue: $.getValue(key) - }); - }; - })(); - } else { - $.sync = function() {}; - $.forceSync = function() {}; - } - $["delete"] = function(keys) { - var j, key, len; - if (!(keys instanceof Array)) { - keys = [keys]; - } - for (j = 0, len = keys.length; j < len; j++) { - key = keys[j]; - $.deleteValue(g.NAMESPACE + key); - } - }; - $.get = $.oneItemSugar(function(items, cb) { - return $.queueTask($.getSync, items, cb); - }); - $.getSync = function(items, cb) { - var err, key, val2; - for (key in items) { - if ((val2 = $.getValue(g.NAMESPACE + key))) { - try { - items[key] = $.dict.json(val2); - } catch (error) { - err = error; - if (!/^(?:undefined)*$/.test(val2)) { - throw err; - } - } - } - } - return cb(items); - }; - $.set = $.oneItemSugar(function(items, cb) { - $.securityCheck(items); - return $.queueTask(function() { - var key, value; - for (key in items) { - value = items[key]; - $.setValue(g.NAMESPACE + key, JSON.stringify(value)); - } - return typeof cb === "function" ? cb() : void 0; - }); - }); - $.clear = function(cb) { - $["delete"](Object.keys(Conf)); - $["delete"](['previousversion', 'QR Size', 'QR.persona']); - try { - $["delete"]($.listValues().map(function(key) { - return key.replace(g.NAMESPACE, ''); - })); - } catch (error) {} - return typeof cb === "function" ? cb() : void 0; - }; - } - - return $; - -}).call(this); - -$$ = (function() { - var $$, - slice = [].slice; - - $$ = function(selector, root) { - if (root == null) { - root = d.body; - } - return slice.call(root.querySelectorAll(selector)); - }; - - return $$; - -}).call(this); - -CrossOrigin = (function() { - var CrossOrigin, Request; - - CrossOrigin = { - binary: function(url, cb, headers) { - var fallback, gmOptions; - if (headers == null) { - headers = $.dict(); - } - url = url.replace(/^((?:https?:)?\/\/(?:\w+\.)?(?:4chan|4channel|4cdn)\.org)\/adv\//, '$1//adv/'); - fallback = function() { - return $.ajax(url, { - headers: headers, - responseType: 'arraybuffer', - onloadend: function() { - if (this.status && this.response) { - return cb(new Uint8Array(this.response), this.getAllResponseHeaders()); - } else { - return cb(null); - } - } - }); - }; - if (!(((typeof GM !== "undefined" && GM !== null ? GM.xmlHttpRequest : void 0) != null) || (typeof GM_xmlhttpRequest !== "undefined" && GM_xmlhttpRequest !== null))) { - fallback(); - return; - } - gmOptions = { - method: "GET", - url: url, - headers: headers, - responseType: 'arraybuffer', - overrideMimeType: 'text/plain; charset=x-user-defined', - onload: function(xhr) { - var data, i, r; - if (xhr.response instanceof ArrayBuffer) { - data = new Uint8Array(xhr.response); - } else { - r = xhr.responseText; - data = new Uint8Array(r.length); - i = 0; - while (i < r.length) { - data[i] = r.charCodeAt(i); - i++; - } - } - return cb(data, xhr.responseHeaders); - }, - onerror: function() { - return cb(null); - }, - onabort: function() { - return cb(null); - } - }; - try { - return ((typeof GM !== "undefined" && GM !== null ? GM.xmlHttpRequest : void 0) || GM_xmlhttpRequest)(gmOptions); - } catch (error) { - return fallback(); - } - }, - file: function(url, cb) { - return CrossOrigin.binary(url, function(data, headers) { - var blob, contentDisposition, contentType, match, mime, name, ref, ref1, ref2, ref3, ref4; - if (data == null) { - return cb(null); - } - name = (ref = url.match(/([^\/?#]+)\/*(?:$|[?#])/)) != null ? ref[1] : void 0; - contentType = (ref1 = headers.match(/Content-Type:\s*(.*)/i)) != null ? ref1[1] : void 0; - contentDisposition = (ref2 = headers.match(/Content-Disposition:\s*(.*)/i)) != null ? ref2[1] : void 0; - mime = (contentType != null ? contentType.match(/[^;]*/)[0] : void 0) || 'application/octet-stream'; - match = (contentDisposition != null ? (ref3 = contentDisposition.match(/\bfilename\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref3[1] : void 0 : void 0) || (contentType != null ? (ref4 = contentType.match(/\bname\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref4[1] : void 0 : void 0); - if (match) { - name = match.replace(/\\"/g, '"'); - } - if (/^text\/plain;\s*charset=x-user-defined$/i.test(mime)) { - mime = $.getOwn(QR.typeFromExtension, name.match(/[^.]*$/)[0].toLowerCase()) || 'application/octet-stream'; - } - blob = new Blob([data], { - type: mime - }); - blob.name = name; - return cb(blob); - }); - }, - Request: Request = (function() { - function Request() {} - - Request.prototype.status = 0; - - Request.prototype.statusText = ''; - - Request.prototype.response = null; - - Request.prototype.responseHeaderString = null; - - Request.prototype.getResponseHeader = function(headerName) { - var header, i, j, key, len, ref, ref1, ref2, val; - if ((this.responseHeaders == null) && (this.responseHeaderString != null)) { - this.responseHeaders = $.dict(); - ref = this.responseHeaderString.split('\r\n'); - for (j = 0, len = ref.length; j < len; j++) { - header = ref[j]; - if ((i = header.indexOf(':')) >= 0) { - key = header.slice(0, i).trim().toLowerCase(); - val = header.slice(i + 1).trim(); - this.responseHeaders[key] = val; - } - } - } - return (ref1 = (ref2 = this.responseHeaders) != null ? ref2[headerName.toLowerCase()] : void 0) != null ? ref1 : null; - }; - - Request.prototype.abort = function() {}; - - Request.prototype.onloadend = function() {}; - - return Request; - - })(), - ajax: function(url, options) { - var gmOptions, gmReq, headers, onloadend, req, responseType, timeout; - if (options == null) { - options = {}; - } - onloadend = options.onloadend, timeout = options.timeout, responseType = options.responseType, headers = options.headers; - if (responseType == null) { - responseType = 'json'; - } - if (!(((typeof GM !== "undefined" && GM !== null ? GM.xmlHttpRequest : void 0) != null) || (typeof GM_xmlhttpRequest !== "undefined" && GM_xmlhttpRequest !== null))) { - return $.ajax(url, options); - } - req = new CrossOrigin.Request(); - req.onloadend = onloadend; - gmOptions = { - method: 'GET', - url: url, - headers: headers, - timeout: timeout, - onload: function(xhr) { - var response; - try { - response = (function() { - switch (responseType) { - case 'json': - if (xhr.responseText) { - return JSON.parse(xhr.responseText); - } else { - return null; - } - break; - default: - return xhr.responseText; - } - })(); - $.extend(req, { - response: response, - status: xhr.status, - statusText: xhr.statusText, - responseHeaderString: xhr.responseHeaders - }); - } catch (error) {} - return req.onloadend(); - }, - onerror: function() { - return req.onloadend(); - }, - onabort: function() { - return req.onloadend(); - }, - ontimeout: function() { - return req.onloadend(); - } - }; - try { - gmReq = ((typeof GM !== "undefined" && GM !== null ? GM.xmlHttpRequest : void 0) || GM_xmlhttpRequest)(gmOptions); - } catch (error) { - return $.ajax(url, options); - } - if (gmReq && typeof gmReq.abort === 'function') { - req.abort = function() { - try { - return gmReq.abort(); - } catch (error) {} - }; - } - return req; - }, - cache: function(url, cb) { - return $.cache(url, cb, { - ajax: CrossOrigin.ajax - }); - }, - permission: function(cb) { - return cb(); - } - }; - - return CrossOrigin; - -}).call(this); - -Board = (function() { - var Board; - - Board = (function() { - Board.prototype.toString = function() { - return this.ID; - }; - - function Board(ID) { - var ref; - this.ID = ID; - this.boardID = this.ID; - this.siteID = g.SITE.ID; - this.threads = new SimpleDict(); - this.posts = new SimpleDict(); - this.config = ((ref = BoardConfig.boards) != null ? ref[this.ID] : void 0) || {}; - g.boards[this] = this; - } - - Board.prototype.cooldowns = function() { - var c, c2, i, key, len, ref; - c2 = (this.config || {}).cooldowns || {}; - c = { - thread: c2.threads || 0, - reply: c2.replies || 0, - image: c2.images || 0, - thread_global: 300 - }; - if (d.cookie.indexOf('pass_enabled=1') >= 0) { - ref = ['reply', 'image']; - for (i = 0, len = ref.length; i < len; i++) { - key = ref[i]; - c[key] = Math.ceil(c[key] / 2); - } - } - return c; - }; - - return Board; - - })(); - - return Board; - -}).call(this); - -Callbacks = (function() { - var Callbacks; - - Callbacks = (function() { - Callbacks.Post = new Callbacks('Post'); - - Callbacks.Thread = new Callbacks('Thread'); - - Callbacks.CatalogThread = new Callbacks('Catalog Thread'); - - Callbacks.CatalogThreadNative = new Callbacks('Catalog Thread'); - - function Callbacks(type) { - this.type = type; - this.keys = []; - } - - Callbacks.prototype.push = function(arg) { - var cb, name; - name = arg.name, cb = arg.cb; - if (!this[name]) { - this.keys.push(name); - } - return this[name] = cb; - }; - - Callbacks.prototype.execute = function(node, keys, force) { - var err, errors, i, len, name, ref, ref1, ref2; - if (keys == null) { - keys = this.keys; - } - if (force == null) { - force = false; - } - if (node.callbacksExecuted && !force) { - return; - } - node.callbacksExecuted = true; - for (i = 0, len = keys.length; i < len; i++) { - name = keys[i]; - try { - if ((ref = this[name]) != null) { - ref.call(node); - } - } catch (error) { - err = error; - if (!errors) { - errors = []; - } - errors.push({ - message: ['"', name, '" crashed on node ', this.type, ' No.', node.ID, ' (', node.board, ').'].join(''), - error: err, - html: (ref1 = node.nodes) != null ? (ref2 = ref1.root) != null ? ref2.outerHTML : void 0 : void 0 - }); - } - } - if (errors) { - return Main.handleErrors(errors); - } - }; - - return Callbacks; - - })(); - - return Callbacks; - -}).call(this); - -CatalogThread = (function() { - var CatalogThread; - - CatalogThread = (function() { - CatalogThread.prototype.toString = function() { - return this.ID; - }; - - function CatalogThread(root, thread) { - var post; - this.thread = thread; - this.ID = this.thread.ID; - this.board = this.thread.board; - post = this.thread.OP.nodes.post; - this.nodes = { - root: root, - thumb: $('.catalog-thumb', post), - icons: $('.catalog-icons', post), - postCount: $('.post-count', post), - fileCount: $('.file-count', post), - pageCount: $('.page-count', post), - replies: null - }; - this.thread.catalogView = this; - } - - return CatalogThread; - - })(); - - return CatalogThread; - -}).call(this); - -CatalogThreadNative = (function() { - var CatalogThreadNative; - - CatalogThreadNative = (function() { - CatalogThreadNative.prototype.toString = function() { - return this.ID; - }; - - function CatalogThreadNative(root) { - this.nodes = { - root: root, - thumb: $(g.SITE.selectors.catalog.thumb, root) - }; - this.siteID = g.SITE.ID; - this.boardID = this.nodes.thumb.parentNode.pathname.split(/\/+/)[1]; - this.board = g.boards[this.boardID] || new Board(this.boardID); - this.ID = this.threadID = +(root.dataset.id || root.id).match(/\d*$/)[0]; - this.thread = this.board.threads.get(this.ID) || new Thread(this.ID, this.board); - } - - return CatalogThreadNative; - - })(); - - return CatalogThreadNative; - -}).call(this); - -Connection = (function() { - var Connection, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; - - Connection = (function() { - function Connection(target, origin, cb) { - this.target = target; - this.origin = origin; - this.cb = cb != null ? cb : {}; - this.onMessage = bind(this.onMessage, this); - this.send = bind(this.send, this); - $.on(window, 'message', this.onMessage); - } - - Connection.prototype.targetWindow = function() { - if (this.target instanceof window.HTMLIFrameElement) { - return this.target.contentWindow; - } else { - return this.target; - } - }; - - Connection.prototype.send = function(data) { - return this.targetWindow().postMessage("" + g.NAMESPACE + (JSON.stringify(data)), this.origin); - }; - - Connection.prototype.onMessage = function(e) { - var data, type, value; - if (!(e.source === this.targetWindow() && e.origin === this.origin && typeof e.data === 'string' && e.data.slice(0, g.NAMESPACE.length) === g.NAMESPACE)) { - return; - } - data = JSON.parse(e.data.slice(g.NAMESPACE.length)); - for (type in data) { - value = data[type]; - if ($.hasOwn(this.cb, type)) { - this.cb[type](value); - } - } - }; - - return Connection; - - })(); - - return Connection; - -}).call(this); - -DataBoard = (function() { - var DataBoard, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; - - DataBoard = (function() { - DataBoard.keys = ['hiddenThreads', 'hiddenPosts', 'lastReadPosts', 'yourPosts', 'watchedThreads', 'watcherLastModified', 'customTitles']; - - function DataBoard(key1, sync, dontClean) { - var init; - this.key = key1; - this.onSync = bind(this.onSync, this); - this.initData(Conf[this.key]); - $.sync(this.key, this.onSync); - if (!dontClean) { - this.clean(); - } - if (!sync) { - return; - } - init = (function(_this) { - return function() { - $.off(d, '4chanXInitFinished', init); - return _this.sync = sync; - }; - })(this); - $.on(d, '4chanXInitFinished', init); - } - - DataBoard.prototype.initData = function(data1) { - var base, boards, lastChecked, name, ref; - this.data = data1; - if (this.data.boards) { - ref = this.data, boards = ref.boards, lastChecked = ref.lastChecked; - this.data['4chan.org'] = { - boards: boards, - lastChecked: lastChecked - }; - delete this.data.boards; - delete this.data.lastChecked; - } - return (base = this.data)[name = g.SITE.ID] || (base[name] = { - boards: $.dict() - }); - }; - - DataBoard.prototype.changes = []; - - DataBoard.prototype.save = function(change, cb) { - change(); - this.changes.push(change); - return $.get(this.key, { - boards: $.dict() - }, (function(_this) { - return function(items) { - var i, len, needSync, ref; - if (!_this.changes.length) { - return; - } - needSync = (items[_this.key].version || 0) > (_this.data.version || 0); - if (needSync) { - _this.initData(items[_this.key]); - ref = _this.changes; - for (i = 0, len = ref.length; i < len; i++) { - change = ref[i]; - change(); - } - } - _this.changes = []; - _this.data.version = (_this.data.version || 0) + 1; - return $.set(_this.key, _this.data, function() { - if (needSync) { - if (typeof _this.sync === "function") { - _this.sync(); - } - } - return typeof cb === "function" ? cb() : void 0; - }); - }; - })(this)); - }; - - DataBoard.prototype.forceSync = function(cb) { - return $.get(this.key, { - boards: $.dict() - }, (function(_this) { - return function(items) { - var change, i, len, ref; - if ((items[_this.key].version || 0) > (_this.data.version || 0)) { - _this.initData(items[_this.key]); - ref = _this.changes; - for (i = 0, len = ref.length; i < len; i++) { - change = ref[i]; - change(); - } - if (typeof _this.sync === "function") { - _this.sync(); - } - } - return typeof cb === "function" ? cb() : void 0; - }; - })(this)); - }; - - DataBoard.prototype["delete"] = function(arg, cb) { - var boardID, postID, siteID, threadID; - siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID; - siteID || (siteID = g.SITE.ID); - if (!this.data[siteID]) { - return; - } - return this.save((function(_this) { - return function() { - var ref; - if (postID) { - if (!((ref = _this.data[siteID].boards[boardID]) != null ? ref[threadID] : void 0)) { - return; - } - delete _this.data[siteID].boards[boardID][threadID][postID]; - return _this.deleteIfEmpty({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }); - } else if (threadID) { - if (!_this.data[siteID].boards[boardID]) { - return; - } - delete _this.data[siteID].boards[boardID][threadID]; - return _this.deleteIfEmpty({ - siteID: siteID, - boardID: boardID - }); - } else { - return delete _this.data[siteID].boards[boardID]; - } - }; - })(this), cb); - }; - - DataBoard.prototype.deleteIfEmpty = function(arg) { - var boardID, siteID, threadID; - siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID; - if (!this.data[siteID]) { - return; - } - if (threadID) { - if (!Object.keys(this.data[siteID].boards[boardID][threadID]).length) { - delete this.data[siteID].boards[boardID][threadID]; - return this.deleteIfEmpty({ - siteID: siteID, - boardID: boardID - }); - } - } else if (!Object.keys(this.data[siteID].boards[boardID]).length) { - return delete this.data[siteID].boards[boardID]; - } - }; - - DataBoard.prototype.set = function(data, cb) { - return this.save((function(_this) { - return function() { - return _this.setUnsafe(data); - }; - })(this), cb); - }; - - DataBoard.prototype.setUnsafe = function(arg) { - var base, base1, base2, base3, boardID, postID, siteID, threadID, val; - siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, val = arg.val; - siteID || (siteID = g.SITE.ID); - (base = this.data)[siteID] || (base[siteID] = { - boards: $.dict() - }); - if (postID !== void 0) { - return ((base1 = ((base2 = this.data[siteID].boards)[boardID] || (base2[boardID] = $.dict())))[threadID] || (base1[threadID] = $.dict()))[postID] = val; - } else if (threadID !== void 0) { - return ((base3 = this.data[siteID].boards)[boardID] || (base3[boardID] = $.dict()))[threadID] = val; - } else { - return this.data[siteID].boards[boardID] = val; - } - }; - - DataBoard.prototype.extend = function(arg, cb) { - var boardID, postID, siteID, threadID, val; - siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, val = arg.val; - return this.save((function(_this) { - return function() { - var key, oldVal, subVal; - oldVal = _this.get({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - postID: postID, - defaultValue: $.dict() - }); - for (key in val) { - subVal = val[key]; - if (typeof subVal === 'undefined') { - delete oldVal[key]; - } else { - oldVal[key] = subVal; - } - } - return _this.setUnsafe({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - postID: postID, - val: oldVal - }); - }; - })(this), cb); - }; - - DataBoard.prototype.setLastChecked = function(key) { - if (key == null) { - key = 'lastChecked'; - } - return this.save((function(_this) { - return function() { - return _this.data[key] = Date.now(); - }; - })(this)); - }; - - DataBoard.prototype.get = function(arg) { - var ID, board, boardID, defaultValue, i, len, postID, ref, siteID, thread, threadID, val; - siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, defaultValue = arg.defaultValue; - siteID || (siteID = g.SITE.ID); - if (board = (ref = this.data[siteID]) != null ? ref.boards[boardID] : void 0) { - if (threadID == null) { - if (postID != null) { - for (thread = i = 0, len = board.length; i < len; thread = ++i) { - ID = board[thread]; - if (postID in thread) { - val = thread[postID]; - break; - } - } - } else { - val = board; - } - } else if (thread = board[threadID]) { - val = postID != null ? thread[postID] : thread; - } - } - return val || defaultValue; - }; - - DataBoard.prototype.clean = function() { - var boardID, now, ref, ref1, siteID, val; - siteID = g.SITE.ID; - ref = this.data[siteID].boards; - for (boardID in ref) { - val = ref[boardID]; - this.deleteIfEmpty({ - siteID: siteID, - boardID: boardID - }); - } - now = Date.now(); - if (!((now - 2 * $.HOUR < (ref1 = this.data[siteID].lastChecked || 0) && ref1 <= now))) { - this.data[siteID].lastChecked = now; - for (boardID in this.data[siteID].boards) { - this.ajaxClean(boardID); - } - } - }; - - DataBoard.prototype.ajaxClean = function(boardID) { - var base, siteID, that, threadsList; - that = this; - siteID = g.SITE.ID; - threadsList = typeof (base = g.SITE.urls).threadsListJSON === "function" ? base.threadsListJSON({ - siteID: siteID, - boardID: boardID - }) : void 0; - if (!threadsList) { - return; - } - return $.cache(threadsList, function() { - var archiveList, base1, response1; - if (this.status !== 200) { - return; - } - archiveList = typeof (base1 = g.SITE.urls).archiveListJSON === "function" ? base1.archiveListJSON({ - siteID: siteID, - boardID: boardID - }) : void 0; - if (!archiveList) { - return that.ajaxCleanParse(boardID, this.response); - } - response1 = this.response; - return $.cache(archiveList, function() { - if (!(this.status === 200 || (!g.SITE.archivedBoardsKnown && this.status === 404))) { - return; - } - return that.ajaxCleanParse(boardID, response1, this.response); - }); - }); - }; - - DataBoard.prototype.ajaxCleanParse = function(boardID, response1, response2) { - var ID, board, i, j, k, len, len1, len2, page, ref, siteID, thread, threads; - siteID = g.SITE.ID; - if (!(board = this.data[siteID].boards[boardID])) { - return; - } - threads = $.dict(); - if (response1) { - for (i = 0, len = response1.length; i < len; i++) { - page = response1[i]; - ref = page.threads; - for (j = 0, len1 = ref.length; j < len1; j++) { - thread = ref[j]; - ID = thread.no; - if (ID in board) { - threads[ID] = board[ID]; - } - } - } - } - if (response2) { - for (k = 0, len2 = response2.length; k < len2; k++) { - ID = response2[k]; - if (ID in board) { - threads[ID] = board[ID]; - } - } - } - this.data[siteID].boards[boardID] = threads; - this.deleteIfEmpty({ - siteID: siteID, - boardID: boardID - }); - return $.set(this.key, this.data); - }; - - DataBoard.prototype.onSync = function(data) { - if (!((data.version || 0) > (this.data.version || 0))) { - return; - } - this.initData(data); - return typeof this.sync === "function" ? this.sync() : void 0; - }; - - return DataBoard; - - })(); - - return DataBoard; - -}).call(this); - -Fetcher = (function() { - var Fetcher, - slice = [].slice; - - Fetcher = (function() { - function Fetcher(boardID1, threadID, postID1, root, quoter) { - var board, post, ref, that, thread; - this.boardID = boardID1; - this.threadID = threadID; - this.postID = postID1; - this.root = root; - this.quoter = quoter; - if (post = g.posts.get(this.boardID + "." + this.postID)) { - this.insert(post); - return; - } - if ((post = (ref = Index.replyData) != null ? ref[this.boardID + "." + this.postID] : void 0) && (thread = g.threads.get(this.boardID + "." + this.threadID))) { - board = g.boards[this.boardID]; - post = new Post(g.SITE.Build.postFromObject(post, this.boardID), thread, board, { - isFetchedQuote: true - }); - Main.callbackNodes('Post', [post]); - this.insert(post); - return; - } - this.root.textContent = "Loading post No." + this.postID + "..."; - if (this.threadID) { - that = this; - $.cache(g.SITE.urls.threadJSON({ - boardID: this.boardID, - threadID: this.threadID - }), function(arg) { - var isCached; - isCached = arg.isCached; - return that.fetchedPost(this, isCached); - }); - } else { - this.archivedPost(); - } - } - - Fetcher.prototype.insert = function(post) { - var boardID, clone, cssVersion, k, len, nodes, postID, quote, ref, ref1, ref2; - if (!this.root.parentNode) { - return; - } - this.quoter || (this.quoter = post); - clone = post.addClone(this.quoter.context, $.hasClass(this.root, 'dialog')); - Main.callbackNodes('Post', [clone]); - nodes = clone.nodes; - $.rmAll(nodes.root); - $.add(nodes.root, nodes.post); - ref = clone.nodes.quotelinks.concat(slice.call(clone.nodes.backlinks)); - for (k = 0, len = ref.length; k < len; k++) { - quote = ref[k]; - ref1 = Get.postDataFromLink(quote), boardID = ref1.boardID, postID = ref1.postID; - if (postID === this.quoter.ID && boardID === this.quoter.board.ID) { - $.addClass(quote, 'forwardlink'); - } - } - if (clone.nodes.flag && !(Fetcher.flagCSS || (Fetcher.flagCSS = $('link[href^="//s.4cdn.org/css/flags."]')))) { - cssVersion = ((ref2 = $('link[href^="//s.4cdn.org/css/"]')) != null ? ref2.href.match(/\d+(?=\.css$)|$/)[0] : void 0) || Date.now(); - Fetcher.flagCSS = $.el('link', { - rel: 'stylesheet', - href: "//s.4cdn.org/css/flags." + cssVersion + ".css" - }); - $.add(d.head, Fetcher.flagCSS); - } - $.rmAll(this.root); - $.add(this.root, nodes.root); - return $.event('PostsInserted', null, this.root); - }; - - Fetcher.prototype.fetchedPost = function(req, isCached) { - var api, board, k, len, post, posts, status, that, thread; - if (post = g.posts.get(this.boardID + "." + this.postID)) { - this.insert(post); - return; - } - status = req.status; - if (status !== 200) { - if (status && this.archivedPost()) { - return; - } - $.addClass(this.root, 'warning'); - this.root.textContent = status === 404 ? "Thread No." + this.threadID + " 404'd." : !status ? 'Connection Error' : "Error " + req.statusText + " (" + req.status + ")."; - return; - } - posts = req.response.posts; - g.SITE.Build.spoilerRange[this.boardID] = posts[0].custom_spoiler; - for (k = 0, len = posts.length; k < len; k++) { - post = posts[k]; - if (post.no === this.postID) { - break; - } - } - if (post.no !== this.postID) { - if (isCached) { - api = g.SITE.urls.threadJSON({ - boardID: this.boardID, - threadID: this.threadID - }); - $.cleanCache(function(url) { - return url === api; - }); - that = this; - $.cache(api, function() { - return that.fetchedPost(this, false); - }); - return; - } - if (this.archivedPost()) { - return; - } - $.addClass(this.root, 'warning'); - this.root.textContent = "Post No." + this.postID + " was not found."; - return; - } - board = g.boards[this.boardID] || new Board(this.boardID); - thread = g.threads.get(this.boardID + "." + this.threadID) || new Thread(this.threadID, board); - post = new Post(g.SITE.Build.postFromObject(post, this.boardID), thread, board, { - isFetchedQuote: true - }); - Main.callbackNodes('Post', [post]); - return this.insert(post); - }; - - Fetcher.prototype.archivedPost = function() { - var archive, encryptionOK, that, url; - if (!Conf['Resurrect Quotes']) { - return false; - } - if (!(url = Redirect.to('post', { - boardID: this.boardID, - postID: this.postID - }))) { - return false; - } - archive = Redirect.data.post[this.boardID]; - encryptionOK = /^https:\/\//.test(url) || location.protocol === 'http:'; - if (encryptionOK || Conf['Exempt Archives from Encryption']) { - that = this; - CrossOrigin.cache(url, function() { - var key, media, ref, ref1; - if (!encryptionOK && ((ref = this.response) != null ? ref.media : void 0)) { - media = this.response.media; - for (key in media) { - if (/_link$/.test(key)) { - if (!((ref1 = $.getOwn(media, key)) != null ? ref1.match(/^http:\/\//) : void 0)) { - delete media[key]; - } - } - } - } - return that.parseArchivedPost(this.response, url, archive); - }); - return true; - } - return false; - }; - - Fetcher.prototype.parseArchivedPost = function(data, url, archive) { - var board, comment, greentext, i, j, media_link, o, post, ref, tag, text, text2, thread, thumb_link; - if (post = g.posts.get(this.boardID + "." + this.postID)) { - this.insert(post); - return; - } - if (data == null) { - $.addClass(this.root, 'warning'); - this.root.textContent = "Error fetching Post No." + this.postID + " from " + archive.name + "."; - return; - } - if (data.error) { - $.addClass(this.root, 'warning'); - this.root.textContent = data.error; - return; - } - comment = (data.comment || '').split(/(\n|\[\/?(?:b|spoiler|code|moot|banned|fortune(?: color="#\w+")?|i|red|green|blue)\])/); - comment = (function() { - var k, len, results; - results = []; - for (i = k = 0, len = comment.length; k < len; i = ++k) { - text = comment[i]; - if (i % 2 === 1) { - tag = this.archiveTags[text.replace(/\ .*\]/, ']')]; - if (typeof tag === 'function') { - results.push(tag(text)); - } else { - results.push(tag); - } - } else { - greentext = text[0] === '>'; - text = text.replace(/(\[\/?[a-z]+):lit(\])/g, '$1$2'); - text = (function() { - var l, len1, ref, results1; - ref = text.split(/(>>(?:>\/[a-z\d]+\/)?\d+)/g); - results1 = []; - for (j = l = 0, len1 = ref.length; l < len1; j = ++l) { - text2 = ref[j]; - results1.push({innerHTML: ((j % 2) ? "" + E(text2) + "" : E(text2))}); - } - return results1; - })(); - text = {innerHTML: ((greentext) ? "" + E.cat(text) + "" : E.cat(text))}; - results.push(text); - } - } - return results; - }).call(this); - comment = {innerHTML: E.cat(comment)}; - this.threadID = +data.thread_num; - o = { - ID: this.postID, - threadID: this.threadID, - boardID: this.boardID, - isReply: this.postID !== this.threadID - }; - o.info = { - subject: data.title, - email: data.email, - name: data.name || '', - tripcode: data.trip, - capcode: (function() { - switch (data.capcode) { - case 'M': - return 'Mod'; - case 'A': - return 'Admin'; - case 'D': - return 'Developer'; - case 'V': - return 'Verified'; - case 'F': - return 'Founder'; - case 'G': - return 'Manager'; - } - })(), - uniqueID: data.poster_hash, - flagCode: data.poster_country, - flagCodeTroll: data.troll_country_code, - flag: data.poster_country_name || data.troll_country_name, - dateUTC: data.timestamp, - dateText: data.fourchan_date, - commentHTML: comment - }; - if (o.info.capcode) { - delete o.info.uniqueID; - } - if (data.media && !!+data.media.banned) { - o.fileDeleted = true; - } else if ((ref = data.media) != null ? ref.media_filename : void 0) { - thumb_link = data.media.thumb_link; - if ((thumb_link != null ? thumb_link[0] : void 0) === '/') { - thumb_link = url.split('/', 3).join('/') + thumb_link; - } - if (!Redirect.securityCheck(thumb_link)) { - thumb_link = ''; - } - media_link = Redirect.to('file', { - boardID: this.boardID, - filename: data.media.media_orig - }); - if (!Redirect.securityCheck(media_link)) { - media_link = ''; - } - o.file = { - name: data.media.media_filename, - url: media_link || (this.boardID === 'f' ? location.protocol + "//" + (ImageHost.flashHost()) + "/" + this.boardID + "/" + (encodeURIComponent(E(data.media.media_filename))) : location.protocol + "//" + (ImageHost.host()) + "/" + this.boardID + "/" + data.media.media_orig), - height: data.media.media_h, - width: data.media.media_w, - MD5: data.media.media_hash, - size: $.bytesToString(data.media.media_size), - thumbURL: thumb_link || (location.protocol + "//" + (ImageHost.thumbHost()) + "/" + this.boardID + "/" + data.media.preview_orig), - theight: data.media.preview_h, - twidth: data.media.preview_w, - isSpoiler: data.media.spoiler === '1' - }; - if (!/\.pdf$/.test(o.file.url)) { - o.file.dimensions = o.file.width + "x" + o.file.height; - } - if (this.boardID === 'f' && data.media.exif) { - o.file.tag = JSON.parse(data.media.exif).Tag; - } - } - o.extra = $.dict(); - board = g.boards[this.boardID] || new Board(this.boardID); - thread = g.threads.get(this.boardID + "." + this.threadID) || new Thread(this.threadID, board); - post = new Post(g.SITE.Build.post(o), thread, board, { - isFetchedQuote: true - }); - post.kill(); - if (post.file) { - post.file.thumbURL = o.file.thumbURL; - } - Main.callbackNodes('Post', [post]); - return this.insert(post); - }; - - Fetcher.prototype.archiveTags = { - '\n': {innerHTML: "
    "}, - '[b]': {innerHTML: ""}, - '[/b]': {innerHTML: ""}, - '[spoiler]': {innerHTML: ""}, - '[/spoiler]': {innerHTML: ""}, - '[code]': {innerHTML: "
    "},
    -      '[/code]': {innerHTML: "
    "}, - '[moot]': {innerHTML: "
    "}, - '[/moot]': {innerHTML: "
    "}, - '[banned]': {innerHTML: ""}, - '[/banned]': {innerHTML: ""}, - '[fortune]': function(text) { - return {innerHTML: ""}; - }, - '[/fortune]': {innerHTML: ""}, - '[i]': {innerHTML: ""}, - '[/i]': {innerHTML: ""}, - '[red]': {innerHTML: ""}, - '[/red]': {innerHTML: ""}, - '[green]': {innerHTML: ""}, - '[/green]': {innerHTML: ""}, - '[blue]': {innerHTML: ""}, - '[/blue]': {innerHTML: ""} - }; - - return Fetcher; - - })(); - - return Fetcher; - -}).call(this); - -Notice = (function() { - var Notice, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; - - Notice = (function() { - function Notice(type, content, timeout, onclose) { - this.timeout = timeout; - this.onclose = onclose; - this.close = bind(this.close, this); - this.add = bind(this.add, this); - this.el = $.el('div', {innerHTML: "
    "}); - this.el.style.opacity = 0; - this.setType(type); - $.on(this.el.firstElementChild, 'click', this.close); - if (typeof content === 'string') { - content = $.tn(content); - } - $.add(this.el.lastElementChild, content); - $.ready(this.add); - } - - Notice.prototype.setType = function(type) { - return this.el.className = "notification " + type; - }; - - Notice.prototype.add = function() { - if (this.closed) { - return; - } - if (d.hidden) { - $.on(d, 'visibilitychange', this.add); - return; - } - $.off(d, 'visibilitychange', this.add); - $.add(Header.noticesRoot, this.el); - this.el.clientHeight; - this.el.style.opacity = 1; - if (this.timeout) { - return setTimeout(this.close, this.timeout * $.SECOND); - } - }; - - Notice.prototype.close = function() { - this.closed = true; - $.off(d, 'visibilitychange', this.add); - $.rm(this.el); - return typeof this.onclose === "function" ? this.onclose() : void 0; - }; - - return Notice; - - })(); - - return Notice; - -}).call(this); - -Post = (function() { - var Post, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Post = (function() { - Post.prototype.toString = function() { - return this.ID; - }; - - function Post(root, thread, board, flags) { - var clone, j, k, key, len, len1, ref, ref1, ref10, ref11, ref12, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, selector; - this.thread = thread; - this.board = board; - if (flags == null) { - flags = {}; - } - $.extend(this, flags); - this.ID = +root.id.match(/\d*$/)[0]; - this.postID = this.ID; - this.threadID = this.thread.ID; - this.boardID = this.board.ID; - this.siteID = g.SITE.ID; - this.fullID = this.board + "." + this.ID; - this.context = this; - this.isReply = this.ID !== this.threadID; - root.dataset.fullID = this.fullID; - this.nodes = this.parseNodes(root); - if (!this.isReply) { - this.thread.OP = this; - ref = ['isSticky', 'isClosed', 'isArchived']; - for (j = 0, len = ref.length; j < len; j++) { - key = ref[j]; - if ((selector = g.SITE.selectors.icons[key])) { - this.thread[key] = !!$(selector, this.nodes.info); - } - } - if (this.thread.isArchived) { - this.thread.isClosed = true; - this.thread.kill(); - } - } - this.info = { - subject: ((ref1 = this.nodes.subject) != null ? ref1.textContent : void 0) || void 0, - name: (ref2 = this.nodes.name) != null ? ref2.textContent : void 0, - email: this.nodes.email ? decodeURIComponent(this.nodes.email.href.replace(/^mailto:/, '')) : void 0, - tripcode: (ref3 = this.nodes.tripcode) != null ? ref3.textContent : void 0, - uniqueID: (ref4 = this.nodes.uniqueID) != null ? ref4.textContent : void 0, - capcode: (ref5 = this.nodes.capcode) != null ? ref5.textContent.replace('## ', '') : void 0, - pass: (ref6 = this.nodes.pass) != null ? ref6.title.match(/\d*$/)[0] : void 0, - flagCode: (ref7 = this.nodes.flag) != null ? (ref8 = ref7.className.match(/flag-(\w+)/)) != null ? ref8[1].toUpperCase() : void 0 : void 0, - flagCodeTroll: (ref9 = this.nodes.flag) != null ? (ref10 = ref9.className.match(/bfl-(\w+)/)) != null ? ref10[1].toUpperCase() : void 0 : void 0, - flag: (ref11 = this.nodes.flag) != null ? ref11.title : void 0, - date: this.nodes.date ? g.SITE.parseDate(this.nodes.date) : void 0 - }; - if (Conf['Anonymize']) { - this.info.nameBlock = 'Anonymous'; - } else { - this.info.nameBlock = ((this.info.name || '') + " " + (this.info.tripcode || '')).trim(); - } - if (this.info.capcode) { - this.info.nameBlock += " ## " + this.info.capcode; - } - if (this.info.uniqueID) { - this.info.nameBlock += " (ID: " + this.info.uniqueID + ")"; - } - this.parseComment(); - this.parseQuotes(); - this.parseFiles(); - this.isDead = false; - this.isHidden = false; - this.clones = []; - if (g.posts.get(this.fullID)) { - this.isRebuilt = true; - this.clones = g.posts.get(this.fullID).clones; - ref12 = this.clones; - for (k = 0, len1 = ref12.length; k < len1; k++) { - clone = ref12[k]; - clone.origin = this; - } - } - if (!this.isFetchedQuote && this.ID > this.thread.lastPost) { - this.thread.lastPost = this.ID; - } - this.board.posts.push(this.ID, this); - this.thread.posts.push(this.ID, this); - g.posts.push(this.fullID, this); - } - - Post.prototype.parseNodes = function(root) { - var base, info, key, nodes, post, ref, s, selector; - s = g.SITE.selectors; - post = $(s.post, root) || root; - info = $(s.infoRoot, post); - nodes = { - root: root, - bottom: this.isReply || !g.SITE.isOPContainerThread ? root : $(s.opBottom, root), - post: post, - info: info, - comment: $(s.comment, post), - quotelinks: [], - archivelinks: [], - embedlinks: [] - }; - ref = s.info; - for (key in ref) { - selector = ref[key]; - nodes[key] = $(selector, info); - } - if (typeof (base = g.SITE).parseNodes === "function") { - base.parseNodes(this, nodes); - } - nodes.uniqueIDRoot || (nodes.uniqueIDRoot = nodes.uniqueID); - if ($.engine === 'edge') { - Object.defineProperty(nodes, 'backlinks', { - configurable: true, - enumerable: true, - get: function() { - return post.getElementsByClassName('backlink'); - } - }); - } else { - nodes.backlinks = post.getElementsByClassName('backlink'); - } - return nodes; - }; - - Post.prototype.parseComment = function() { - var base, bq; - this.nodes.comment.normalize(); - this.nodes.commentClean = bq = this.nodes.comment.cloneNode(true); - if (typeof (base = g.SITE).cleanComment === "function") { - base.cleanComment(bq); - } - return this.info.comment = this.nodesToText(bq); - }; - - Post.prototype.commentDisplay = function() { - var base, bq; - bq = this.nodes.commentClean.cloneNode(true); - if (!(Conf['Remove Spoilers'] || Conf['Reveal Spoilers'])) { - this.cleanSpoilers(bq); - } - if (typeof (base = g.SITE).cleanCommentDisplay === "function") { - base.cleanCommentDisplay(bq); - } - return this.nodesToText(bq).trim().replace(/\s+$/gm, ''); - }; - - Post.prototype.commentOrig = function() { - var base, bq; - bq = this.nodes.commentClean.cloneNode(true); - if (typeof (base = g.SITE).insertTags === "function") { - base.insertTags(bq); - } - return this.nodesToText(bq); - }; - - Post.prototype.nodesToText = function(bq) { - var i, node, nodes, text; - text = ""; - nodes = $.X('.//br|.//text()', bq); - i = 0; - while (node = nodes.snapshotItem(i++)) { - text += node.data || '\n'; - } - return text; - }; - - Post.prototype.cleanSpoilers = function(bq) { - var j, len, node, spoilers; - spoilers = $$(g.SITE.selectors.spoiler, bq); - for (j = 0, len = spoilers.length; j < len; j++) { - node = spoilers[j]; - $.replace(node, $.tn('[spoiler]')); - } - }; - - Post.prototype.parseQuotes = function() { - var j, len, quotelink, ref; - this.quotes = []; - ref = $$(g.SITE.selectors.quotelink, this.nodes.comment); - for (j = 0, len = ref.length; j < len; j++) { - quotelink = ref[j]; - this.parseQuote(quotelink); - } - }; - - Post.prototype.parseQuote = function(quotelink) { - var fullID, match; - match = quotelink.href.match(g.SITE.regexp.quotelink); - if (!(match || (this.isClone && quotelink.dataset.postID))) { - return; - } - this.nodes.quotelinks.push(quotelink); - if (this.isClone) { - return; - } - fullID = match[1] + "." + match[3]; - if (indexOf.call(this.quotes, fullID) < 0) { - return this.quotes.push(fullID); - } - }; - - Post.prototype.parseFiles = function() { - var docIndex, file, fileRoot, fileRoots, index, j, len; - this.files = []; - fileRoots = this.fileRoots(); - index = 0; - for (docIndex = j = 0, len = fileRoots.length; j < len; docIndex = ++j) { - fileRoot = fileRoots[docIndex]; - if ((file = this.parseFile(fileRoot))) { - file.index = index++; - file.docIndex = docIndex; - this.files.push(file); - } - } - if (this.files.length) { - return this.file = this.files[0]; - } - }; - - Post.prototype.fileRoots = function() { - var roots; - if (g.SITE.selectors.multifile) { - roots = $$(g.SITE.selectors.multifile, this.nodes.root); - if (roots.length) { - return roots; - } - } - return [this.nodes.root]; - }; - - Post.prototype.parseFile = function(fileRoot) { - var file, key, ref, ref1, selector, size, unit; - file = {}; - ref = g.SITE.selectors.file; - for (key in ref) { - selector = ref[key]; - file[key] = $(selector, fileRoot); - } - file.thumbLink = (ref1 = file.thumb) != null ? ref1.parentNode : void 0; - if (!(file.text && file.link)) { - return; - } - if (!g.SITE.parseFile(this, file)) { - return; - } - $.extend(file, { - url: file.link.href, - isImage: $.isImage(file.link.href), - isVideo: $.isVideo(file.link.href) - }); - size = +file.size.match(/[\d.]+/)[0]; - unit = ['B', 'KB', 'MB', 'GB'].indexOf(file.size.match(/\w+$/)[0]); - while (unit-- > 0) { - size *= 1024; - } - file.sizeInBytes = size; - return file; - }; - - Post.deadMark = $.el('span', { - textContent: '\u00A0(Dead)', - className: 'qmark-dead' - }); - - Post.prototype.kill = function(file, index) { - var clone, j, k, len, len1, quotelink, ref, ref1, strong; - if (index == null) { - index = 0; - } - if (file) { - if (this.isDead || this.files[index].isDead) { - return; - } - this.files[index].isDead = true; - $.addClass(this.nodes.root, 'deleted-file'); - } else { - if (this.isDead) { - return; - } - this.isDead = true; - $.rmClass(this.nodes.root, 'deleted-file'); - $.addClass(this.nodes.root, 'deleted-post'); - } - if (!(strong = $('strong.warning', this.nodes.info))) { - strong = $.el('strong', { - className: 'warning' - }); - $.after($('input', this.nodes.info), strong); - } - strong.textContent = file ? '[File deleted]' : '[Deleted]'; - if (this.isClone) { - return; - } - ref = this.clones; - for (j = 0, len = ref.length; j < len; j++) { - clone = ref[j]; - clone.kill(file, index); - } - if (file) { - return; - } - ref1 = Get.allQuotelinksLinkingTo(this); - for (k = 0, len1 = ref1.length; k < len1; k++) { - quotelink = ref1[k]; - if (!(!$.hasClass(quotelink, 'deadlink'))) { - continue; - } - $.add(quotelink, Post.deadMark.cloneNode(true)); - $.addClass(quotelink, 'deadlink'); - } - }; - - Post.prototype.resurrect = function() { - var clone, j, k, len, len1, quotelink, ref, ref1, strong; - this.isDead = false; - $.rmClass(this.nodes.root, 'deleted-post'); - strong = $('strong.warning', this.nodes.info); - if (this.files.some(function(file) { - return file.isDead; - })) { - $.addClass(this.nodes.root, 'deleted-file'); - strong.textContent = '[File deleted]'; - } else { - $.rm(strong); - } - if (this.isClone) { - return; - } - ref = this.clones; - for (j = 0, len = ref.length; j < len; j++) { - clone = ref[j]; - clone.resurrect(); - } - ref1 = Get.allQuotelinksLinkingTo(this); - for (k = 0, len1 = ref1.length; k < len1; k++) { - quotelink = ref1[k]; - if (!($.hasClass(quotelink, 'deadlink'))) { - continue; - } - $.rm($('.qmark-dead', quotelink)); - $.rmClass(quotelink, 'deadlink'); - } - }; - - Post.prototype.collect = function() { - g.posts.rm(this.fullID); - this.thread.posts.rm(this); - return this.board.posts.rm(this); - }; - - Post.prototype.addClone = function(context, contractThumb) { - Callbacks.Post.execute(this); - return new Post.Clone(this, context, contractThumb); - }; - - Post.prototype.rmClone = function(index) { - var clone, j, len, ref; - this.clones.splice(index, 1); - ref = this.clones.slice(index); - for (j = 0, len = ref.length; j < len; j++) { - clone = ref[j]; - clone.nodes.root.dataset.clone = index++; - } - }; - - Post.prototype.setCatalogOP = function(isCatalogOP) { - this.nodes.root.classList.toggle('catalog-container', isCatalogOP); - this.nodes.root.classList.toggle('opContainer', !isCatalogOP); - this.nodes.post.classList.toggle('catalog-post', isCatalogOP); - this.nodes.post.classList.toggle('op', !isCatalogOP); - return this.nodes.post.style.left = this.nodes.post.style.right = null; - }; - - return Post; - - })(); - - return Post; - -}).call(this); - -(function() { - var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty, - slice = [].slice; - - Post.Clone = (function(superClass) { - extend(_Class, superClass); - - _Class.prototype.isClone = true; - - function _Class() { - var that; - that = Object.create(Post.Clone.prototype); - that.construct.apply(that, arguments); - return that; - } - - _Class.prototype.construct = function(origin, context, contractThumb) { - var base, file, fileRoot, fileRoots, i, inline, inlined, j, k, key, l, len, len1, len2, len3, len4, m, node, nodes, originFile, ref, ref1, ref2, ref3, ref4, ref5, ref6, root, selector, val; - this.origin = origin; - this.context = context; - ref = ['ID', 'postID', 'threadID', 'boardID', 'siteID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply']; - for (i = 0, len = ref.length; i < len; i++) { - key = ref[i]; - this[key] = this.origin[key]; - } - nodes = this.origin.nodes; - root = contractThumb ? this.cloneWithoutVideo(nodes.root) : nodes.root.cloneNode(true); - (base = Post.Clone).suffix || (base.suffix = 0); - ref1 = [root].concat(slice.call($$('[id]', root))); - for (j = 0, len1 = ref1.length; j < len1; j++) { - node = ref1[j]; - node.id += "_" + Post.Clone.suffix; - } - Post.Clone.suffix++; - ref2 = $$('.inline', root); - for (k = 0, len2 = ref2.length; k < len2; k++) { - inline = ref2[k]; - $.rm(inline); - } - ref3 = $$('.inlined', root); - for (l = 0, len3 = ref3.length; l < len3; l++) { - inlined = ref3[l]; - $.rmClass(inlined, 'inlined'); - } - this.nodes = this.parseNodes(root); - root.hidden = false; - $.rmClass(root, 'forwarded'); - $.rmClass(this.nodes.post, 'highlight'); - if (!this.isReply) { - this.setCatalogOP(false); - $.rm($('.catalog-link', this.nodes.post)); - $.rm($('.catalog-stats', this.nodes.post)); - $.rm($('.catalog-replies', this.nodes.post)); - } - this.parseQuotes(); - this.quotes = slice.call(this.origin.quotes); - this.files = []; - if (this.origin.files.length) { - fileRoots = this.fileRoots(); - } - ref4 = this.origin.files; - for (m = 0, len4 = ref4.length; m < len4; m++) { - originFile = ref4[m]; - file = {}; - for (key in originFile) { - val = originFile[key]; - file[key] = val; - } - fileRoot = fileRoots[file.docIndex]; - ref5 = g.SITE.selectors.file; - for (key in ref5) { - selector = ref5[key]; - file[key] = $(selector, fileRoot); - } - file.thumbLink = (ref6 = file.thumb) != null ? ref6.parentNode : void 0; - if (file.thumbLink) { - file.fullImage = $('.full-image', file.thumbLink); - } - file.videoControls = $('.video-controls', file.text); - if (file.videoThumb) { - file.thumb.muted = true; - } - this.files.push(file); - } - if (this.files.length) { - this.file = this.files[0]; - if (this.file.thumb && contractThumb) { - ImageExpand.contract(this); - } - } - if (this.origin.isDead) { - this.isDead = true; - } - return root.dataset.clone = this.origin.clones.push(this) - 1; - }; - - _Class.prototype.cloneWithoutVideo = function(node) { - var child, clone, i, len, ref; - if (node.tagName === 'VIDEO' && !node.dataset.md5) { - return []; - } else if (node.nodeType === Node.ELEMENT_NODE && $('video', node)) { - clone = node.cloneNode(false); - ref = node.childNodes; - for (i = 0, len = ref.length; i < len; i++) { - child = ref[i]; - $.add(clone, this.cloneWithoutVideo(child)); - } - return clone; - } else { - return node.cloneNode(true); - } - }; - - return _Class; - - })(Post); - -}).call(this); - -RandomAccessList = (function() { - var RandomAccessList; - - RandomAccessList = (function() { - function RandomAccessList(items) { - var i, item, len; - this.length = 0; - if (items) { - for (i = 0, len = items.length; i < len; i++) { - item = items[i]; - this.push(item); - } - } - } - - RandomAccessList.prototype.push = function(data) { - var ID, item, last; - ID = data.ID; - ID || (ID = data.id); - if (this[ID]) { - return; - } - last = this.last; - this[ID] = item = { - prev: last, - next: null, - data: data, - ID: ID - }; - item.prev = last; - this.last = last ? last.next = item : this.first = item; - return this.length++; - }; - - RandomAccessList.prototype.before = function(root, item) { - var prev; - if (item.next === root || item === root) { - return; - } - this.rmi(item); - prev = root.prev; - root.prev = item; - item.next = root; - item.prev = prev; - if (prev) { - return prev.next = item; - } else { - return this.first = item; - } - }; - - RandomAccessList.prototype.after = function(root, item) { - var next; - if (item.prev === root || item === root) { - return; - } - this.rmi(item); - next = root.next; - root.next = item; - item.prev = root; - item.next = next; - if (next) { - return next.prev = item; - } else { - return this.last = item; - } - }; - - RandomAccessList.prototype.prepend = function(item) { - var first; - first = this.first; - if (item === first || !this[item.ID]) { - return; - } - this.rmi(item); - item.next = first; - if (first) { - first.prev = item; - } else { - this.last = item; - } - this.first = item; - return delete item.prev; - }; - - RandomAccessList.prototype.shift = function() { - return this.rm(this.first.ID); - }; - - RandomAccessList.prototype.order = function() { - var item, order; - order = [item = this.first]; - while (item = item.next) { - order.push(item); - } - return order; - }; - - RandomAccessList.prototype.rm = function(ID) { - var item; - item = this[ID]; - if (!item) { - return; - } - delete this[ID]; - this.length--; - this.rmi(item); - delete item.next; - return delete item.prev; - }; - - RandomAccessList.prototype.rmi = function(item) { - var next, prev; - prev = item.prev, next = item.next; - if (prev) { - prev.next = next; - } else { - this.first = next; - } - if (next) { - return next.prev = prev; - } else { - return this.last = prev; - } - }; - - return RandomAccessList; - - })(); - - return RandomAccessList; - -}).call(this); - -ShimSet = (function() { - var ShimSet; - - ShimSet = (function() { - function ShimSet() { - this.elements = $.dict(); - this.size = 0; - } - - ShimSet.prototype.has = function(value) { - return value in this.elements; - }; - - ShimSet.prototype.add = function(value) { - if (this.elements[value]) { - return; - } - this.elements[value] = true; - return this.size++; - }; - - ShimSet.prototype["delete"] = function(value) { - if (!this.elements[value]) { - return; - } - delete this.elements[value]; - return this.size--; - }; - - return ShimSet; - - })(); - - if (!('Set' in window)) { - window.Set = ShimSet; - } - - return ShimSet; - -}).call(this); - -SimpleDict = (function() { - var SimpleDict, - slice = [].slice; - - SimpleDict = (function() { - function SimpleDict() { - this.keys = []; - } - - SimpleDict.prototype.push = function(key, data) { - key = "" + key; - if (!this[key]) { - this.keys.push(key); - } - return this[key] = data; - }; - - SimpleDict.prototype.rm = function(key) { - var i; - key = "" + key; - if ((i = this.keys.indexOf(key)) !== -1) { - this.keys.splice(i, 1); - return delete this[key]; - } - }; - - SimpleDict.prototype.forEach = function(fn) { - var j, key, len, ref; - ref = slice.call(this.keys); - for (j = 0, len = ref.length; j < len; j++) { - key = ref[j]; - fn(this[key]); - } - }; - - SimpleDict.prototype.get = function(key) { - if (key === 'keys') { - return void 0; - } else { - return $.getOwn(this, key); - } - }; - - return SimpleDict; - - })(); - - return SimpleDict; - -}).call(this); - -Thread = (function() { - var Thread; - - Thread = (function() { - Thread.prototype.toString = function() { - return this.ID; - }; - - function Thread(ID, board) { - this.board = board; - this.ID = +ID; - this.threadID = this.ID; - this.boardID = this.board.ID; - this.siteID = g.SITE.ID; - this.fullID = this.board + "." + this.ID; - this.posts = new SimpleDict(); - this.isDead = false; - this.isHidden = false; - this.isSticky = false; - this.isClosed = false; - this.isArchived = false; - this.postLimit = false; - this.fileLimit = false; - this.lastPost = 0; - this.ipCount = void 0; - this.json = null; - this.OP = null; - this.catalogView = null; - this.nodes = { - root: null - }; - this.board.threads.push(this.ID, this); - g.threads.push(this.fullID, this); - } - - Thread.prototype.setPage = function(pageNum) { - var icon, info, ref, reply; - ref = this.OP.nodes, info = ref.info, reply = ref.reply; - if (!(icon = $('.page-num', info))) { - icon = $.el('span', { - className: 'page-num' - }); - $.replace(reply.parentNode.previousSibling, [$.tn(' '), icon, $.tn(' ')]); - } - icon.title = "This thread is on page " + pageNum + " in the original index."; - icon.textContent = "[" + pageNum + "]"; - if (this.catalogView) { - return this.catalogView.nodes.pageCount.textContent = pageNum; - } - }; - - Thread.prototype.setCount = function(type, count, reachedLimit) { - var el; - if (!this.catalogView) { - return; - } - el = this.catalogView.nodes[type + "Count"]; - el.textContent = count; - return (reachedLimit ? $.addClass : $.rmClass)(el, 'warning'); - }; - - Thread.prototype.setStatus = function(type, status) { - var name; - name = "is" + type; - if (this[name] === status) { - return; - } - this[name] = status; - if (!this.OP) { - return; - } - this.setIcon('Sticky', this.isSticky); - this.setIcon('Closed', this.isClosed && !this.isArchived); - return this.setIcon('Archived', this.isArchived); - }; - - Thread.prototype.setIcon = function(type, status) { - var icon, root, typeLC; - typeLC = type.toLowerCase(); - icon = $("." + typeLC + "Icon", this.OP.nodes.info); - if (!!icon === status) { - return; - } - if (!status) { - $.rm(icon.previousSibling); - $.rm(icon); - if (this.catalogView) { - $.rm($("." + typeLC + "Icon", this.catalogView.nodes.icons)); - } - return; - } - icon = $.el('img', { - src: "" + g.SITE.Build.staticPath + typeLC + g.SITE.Build.gifIcon, - alt: type, - title: type, - className: typeLC + "Icon retina" - }); - if (g.BOARD.ID === 'f') { - icon.style.cssText = 'height: 18px; width: 18px;'; - } - root = type !== 'Sticky' && this.isSticky ? $('.stickyIcon', this.OP.nodes.info) : $('.page-num', this.OP.nodes.info) || this.OP.nodes.quote; - $.after(root, [$.tn(' '), icon]); - if (!this.catalogView) { - return; - } - return (type === 'Sticky' && this.isClosed ? $.prepend : $.add)(this.catalogView.nodes.icons, icon.cloneNode()); - }; - - Thread.prototype.kill = function() { - return this.isDead = true; - }; - - Thread.prototype.collect = function() { - var n; - n = 0; - this.posts.forEach(function(post) { - if (post.clones.length) { - return n++; - } else { - return post.collect(); - } - }); - if (!n) { - g.threads.rm(this.fullID); - return this.board.threads.rm(this); - } - }; - - return Thread; - - })(); - - return Thread; - -}).call(this); - -SW = {}; - -(function() { - var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - SW.tinyboard = { - isOPContainerThread: true, - mayLackJSON: true, - threadModTimeIgnoresSage: true, - disabledFeatures: ['Resurrect Quotes', 'Quick Reply Personas', 'Quick Reply', 'Cooldown', 'Report Link', 'Delete Link', 'Edit Link', 'Quote Inlining', 'Quote Previewing', 'Quote Backlinks', 'File Info Formatting', 'Image Expansion', 'Image Expansion (Menu)', 'Comment Expansion', 'Thread Expansion', 'Favicon', 'Quote Threading', 'Thread Updater', 'Banner', 'Flash Features', 'Reply Pruning'], - detect: function() { - var j, len, m, properties, ref, root, script; - ref = $$('script:not([src])', d.head); - for (j = 0, len = ref.length; j < len; j++) { - script = ref[j]; - if ((m = script.textContent.match(/\bvar configRoot=(".*?")/))) { - properties = $.dict(); - try { - root = JSON.parse(m[1]); - if (root[0] === '/') { - properties.root = location.origin + root; - } else if (/^https?:/.test(root)) { - properties.root = root; - } - } catch (error) {} - return properties; - } - } - return false; - }, - awaitBoard: function(cb) { - var reactUI, s; - if ((reactUI = $.id('react-ui'))) { - s = this.selectors = Object.create(this.selectors); - s.boardFor = { - index: '.page-container' - }; - s.thread = 'div[id^="thread_"]'; - return Main.mounted(cb); - } else { - return cb(); - } - }, - urls: { - thread: function(arg, isArchived) { - var boardID, ref, siteID, threadID; - siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID; - return "" + (((ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0) || ("http://" + siteID + "/")) + boardID + "/" + (isArchived ? 'archive/' : '') + "res/" + threadID + ".html"; - }, - post: function(arg) { - var postID; - postID = arg.postID; - return "#" + postID; - }, - index: function(arg) { - var boardID, ref, siteID; - siteID = arg.siteID, boardID = arg.boardID; - return "" + (((ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0) || ("http://" + siteID + "/")) + boardID + "/"; - }, - catalog: function(arg) { - var boardID, ref, siteID; - siteID = arg.siteID, boardID = arg.boardID; - return "" + (((ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0) || ("http://" + siteID + "/")) + boardID + "/catalog.html"; - }, - threadJSON: function(arg, isArchived) { - var boardID, ref, root, siteID, threadID; - siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID; - root = (ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0; - if (root) { - return "" + root + boardID + "/" + (isArchived ? 'archive/' : '') + "res/" + threadID + ".json"; - } else { - return ''; - } - }, - archivedThreadJSON: function(thread) { - return SW.tinyboard.urls.threadJSON(thread, true); - }, - threadsListJSON: function(arg) { - var boardID, ref, root, siteID; - siteID = arg.siteID, boardID = arg.boardID; - root = (ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0; - if (root) { - return "" + root + boardID + "/threads.json"; - } else { - return ''; - } - }, - archiveListJSON: function(arg) { - var boardID, ref, root, siteID; - siteID = arg.siteID, boardID = arg.boardID; - root = (ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0; - if (root) { - return "" + root + boardID + "/archive/archive.json"; - } else { - return ''; - } - }, - catalogJSON: function(arg) { - var boardID, ref, root, siteID; - siteID = arg.siteID, boardID = arg.boardID; - root = (ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0; - if (root) { - return "" + root + boardID + "/catalog.json"; - } else { - return ''; - } - }, - file: function(arg, filename) { - var boardID, ref, siteID; - siteID = arg.siteID, boardID = arg.boardID; - return "" + (((ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0) || ("http://" + siteID + "/")) + boardID + "/" + filename; - }, - thumb: function(board, filename) { - return SW.tinyboard.urls.file(board, filename); - } - }, - selectors: { - board: 'form[name="postcontrols"]', - thread: 'input[name="board"] ~ div[id^="thread_"]', - threadDivider: 'div[id^="thread_"] > hr:last-child', - summary: '.omitted', - postContainer: 'div[id^="reply_"]:not(.hidden)', - opBottom: '.op', - replyOriginal: 'div[id^="reply_"]:not(.hidden)', - infoRoot: '.intro', - info: { - subject: '.subject', - name: '.name', - email: '.email', - tripcode: '.trip', - uniqueID: '.poster_id', - capcode: '.capcode', - flag: '.flag', - date: 'time', - nameBlock: 'label', - quote: 'a[href*="#q"]', - reply: 'a[href*="/res/"]:not([href*="#"])' - }, - icons: { - isSticky: '.fa-thumb-tack', - isClosed: '.fa-lock' - }, - file: { - text: '.fileinfo', - link: '.fileinfo > a', - thumb: 'a > .post-image' - }, - thumbLink: '.file > a', - multifile: '.files > .file', - highlightable: { - op: ' > .op', - reply: '.reply', - catalog: ' > .thread' - }, - comment: '.body', - spoiler: '.spoiler', - quotelink: 'a[onclick*="highlightReply("]', - catalog: { - board: '#Grid', - thread: '.mix', - thumb: '.thread-image' - }, - boardList: '.boardlist', - boardListBottom: '.boardlist.bottom', - styleSheet: '#stylesheet', - psa: '.blotter', - nav: { - prev: '.pages > form > [value=Previous]', - next: '.pages > form > [value=Next]' - } - }, - classes: { - highlight: 'highlighted' - }, - xpath: { - thread: 'div[starts-with(@id,"thread_")]', - postContainer: 'div[starts-with(@id,"reply_") or starts-with(@id,"thread_")]', - replyContainer: 'div[starts-with(@id,"reply_")]' - }, - regexp: { - quotelink: /\/([^\/]+)\/res\/(\d+)(?:\.\w+)?#(\d+)$/, - quotelinkHTML: /]*\bhref="[^"]*\/([^\/]+)\/res\/(\d+)(?:\.\w+)?#(\d+)"/g - }, - Build: { - parseJSON: function(data, board) { - var extra_file, file, i, j, len, o, ref; - o = SW.yotsuba.Build.parseJSON(data, board); - if (data.ext === 'deleted') { - delete o.file; - $.extend(o, { - files: [], - fileDeleted: true, - filesDeleted: [0] - }); - } - if (data.extra_files) { - ref = data.extra_files; - for (i = j = 0, len = ref.length; j < len; i = ++j) { - extra_file = ref[i]; - if (extra_file.ext === 'deleted') { - o.filesDeleted.push(i); - } else { - file = SW.yotsuba.Build.parseJSONFile(data, board); - o.files.push(file); - } - } - if (o.files.length) { - o.file = o.files[0]; - } - } - return o; - }, - parseComment: function(html) { - html = html.replace(//gi, '\n').replace(/<[^>]*>/g, ''); - return $.unescape(html); - } - }, - bgColoredEl: function() { - return $.el('div', { - className: 'post reply' - }); - }, - isFileURL: function(url) { - return /\/src\/[^\/]+/.test(url.pathname); - }, - preParsingFixes: function(board) { - var broken; - if ((broken = $('a > input[name="board"]', board))) { - return $.before(broken.parentNode, broken); - } - }, - parseNodes: function(post, nodes) { - var m, nextSibling, node, text, uniqueID; - if (nodes.uniqueID) { - return; - } - text = ''; - node = nodes.nameBlock.nextSibling; - while (node && node.nodeType === 3) { - text += node.textContent; - node = node.nextSibling; - } - if ((m = text.match(/(\s*ID:\s*)(\S+)/))) { - nodes.info.normalize(); - nextSibling = nodes.nameBlock.nextSibling; - nextSibling = nextSibling.splitText(m[1].length); - nextSibling.splitText(m[2].length); - nodes.uniqueID = uniqueID = $.el('span', { - className: 'poster_id' - }); - $.replace(nextSibling, uniqueID); - return $.add(uniqueID, nextSibling); - } - }, - parseDate: function(node) { - var date, ref; - date = Date.parse((ref = node.getAttribute('datetime')) != null ? ref.trim() : void 0); - if (!isNaN(date)) { - return new Date(date); - } - date = Date.parse(node.textContent.trim() + ' UTC'); - if (!isNaN(date)) { - return new Date(date); - } - return void 0; - }, - parseFile: function(post, file) { - var info, infoNode, link, nameNode, ref, ref1, text, thumb; - text = file.text, link = file.link, thumb = file.thumb; - if ($.x("ancestor::" + this.xpath.postContainer + "[1]", text) !== post.nodes.root) { - return false; - } - if (!(infoNode = indexOf.call((ref = link.nextSibling) != null ? ref.textContent : void 0, '(') >= 0 ? link.nextSibling : link.nextElementSibling)) { - return false; - } - if (!(info = infoNode.textContent.match(/\((.*,\s*)?([\d.]+ ?[KMG]?B).*\)/))) { - return false; - } - nameNode = $('.postfilename', text); - $.extend(file, { - name: nameNode ? nameNode.title || nameNode.textContent : link.pathname.match(/[^\/]*$/)[0], - size: info[2], - dimensions: (ref1 = info[0].match(/\d+x\d+/)) != null ? ref1[0] : void 0 - }); - if (thumb) { - $.extend(file, { - thumbURL: /\/static\//.test(thumb.src) && $.isImage(link.href) ? link.href : thumb.src, - isSpoiler: /^Spoiler/i.test(info[1] || '') || link.textContent === 'Spoiler Image' - }); - } - return true; - }, - isThumbExpanded: function(file) { - return $.hasClass(file.thumb.parentNode, 'expanded') || file.thumb.parentNode.dataset.expanded === 'true'; - }, - isLinkified: function(link) { - return /\bnofollow\b/.test(link.rel); - }, - catalogPin: function(threadRoot) { - return threadRoot.dataset.sticky = 'true'; - } - }; - -}).call(this); - -(function() { - var slice = [].slice; - - SW.yotsuba = { - isOPContainerThread: false, - hasIPCount: true, - archivedBoardsKnown: true, - urls: { - thread: function(arg) { - var boardID, threadID; - boardID = arg.boardID, threadID = arg.threadID; - return location.protocol + "//" + (BoardConfig.domain(boardID)) + "/" + boardID + "/thread/" + threadID; - }, - post: function(arg) { - var postID; - postID = arg.postID; - return "#p" + postID; - }, - index: function(arg) { - var boardID; - boardID = arg.boardID; - return location.protocol + "//" + (BoardConfig.domain(boardID)) + "/" + boardID + "/"; - }, - catalog: function(arg) { - var boardID; - boardID = arg.boardID; - if (boardID === 'f') { - return void 0; - } else { - return location.protocol + "//" + (BoardConfig.domain(boardID)) + "/" + boardID + "/catalog"; - } - }, - archive: function(arg) { - var boardID; - boardID = arg.boardID; - if (BoardConfig.isArchived(boardID)) { - return location.protocol + "//" + (BoardConfig.domain(boardID)) + "/" + boardID + "/archive"; - } else { - return void 0; - } - }, - threadJSON: function(arg) { - var boardID, threadID; - boardID = arg.boardID, threadID = arg.threadID; - return location.protocol + "//a.4cdn.org/" + boardID + "/thread/" + threadID + ".json"; - }, - threadsListJSON: function(arg) { - var boardID; - boardID = arg.boardID; - return location.protocol + "//a.4cdn.org/" + boardID + "/threads.json"; - }, - archiveListJSON: function(arg) { - var boardID; - boardID = arg.boardID; - if (BoardConfig.isArchived(boardID)) { - return location.protocol + "//a.4cdn.org/" + boardID + "/archive.json"; - } else { - return ''; - } - }, - catalogJSON: function(arg) { - var boardID; - boardID = arg.boardID; - return location.protocol + "//a.4cdn.org/" + boardID + "/catalog.json"; - }, - file: function(arg, filename) { - var boardID, hostname; - boardID = arg.boardID; - hostname = boardID === 'f' ? ImageHost.flashHost() : ImageHost.host(); - return location.protocol + "//" + hostname + "/" + boardID + "/" + filename; - }, - thumb: function(arg, filename) { - var boardID; - boardID = arg.boardID; - return location.protocol + "//" + (ImageHost.thumbHost()) + "/" + boardID + "/" + filename; - } - }, - isPrunedByAge: function(arg) { - var boardID; - boardID = arg.boardID; - return boardID === 'f'; - }, - areMD5sDeferred: function(arg) { - var boardID; - boardID = arg.boardID; - return boardID === 'f'; - }, - isOnePage: function(arg) { - var boardID; - boardID = arg.boardID; - return boardID === 'f'; - }, - noAudio: function(arg) { - var boardID; - boardID = arg.boardID; - return BoardConfig.noAudio(boardID); - }, - selectors: { - board: '.board', - thread: '.thread', - threadDivider: '.board > hr', - summary: '.summary', - postContainer: '.postContainer', - replyOriginal: '.replyContainer:not([data-clone])', - sideArrows: 'div.sideArrows', - post: '.post', - infoRoot: '.postInfo', - info: { - subject: '.subject', - name: '.name', - email: '.useremail', - tripcode: '.postertrip', - uniqueIDRoot: '.posteruid', - uniqueID: '.posteruid > .hand', - capcode: '.capcode.hand', - pass: '.n-pu', - flag: '.flag, .bfl', - date: '.dateTime', - nameBlock: '.nameBlock', - quote: '.postNum > a:nth-of-type(2)', - reply: '.replylink' - }, - icons: { - isSticky: '.stickyIcon', - isClosed: '.closedIcon', - isArchived: '.archivedIcon' - }, - file: { - text: '.file > :first-child', - link: '.fileText > a', - thumb: 'a.fileThumb > [data-md5]' - }, - thumbLink: 'a.fileThumb', - highlightable: { - op: '.opContainer', - reply: ' > .reply', - catalog: '' - }, - comment: '.postMessage', - spoiler: 's', - quotelink: ':not(pre) > .quotelink', - catalog: { - board: '#threads', - thread: '.thread', - thumb: '.thumb' - }, - boardList: '#boardNavDesktop > .boardList', - boardListBottom: '#boardNavDesktopFoot > .boardList', - styleSheet: 'link[title=switch]', - psa: '#globalMessage', - psaTop: '#globalToggle', - searchBox: '#search-box', - nav: { - prev: '.prev > form > [type=submit]', - next: '.next > form > [type=submit]' - } - }, - classes: { - highlight: 'highlight' - }, - xpath: { - thread: 'div[contains(concat(" ",@class," ")," thread ")]', - postContainer: 'div[contains(@class,"postContainer")]', - replyContainer: 'div[contains(@class,"replyContainer")]' - }, - regexp: { - quotelink: /^https?:\/\/boards\.4chan(?:nel)?\.org\/+([^\/]+)\/+thread\/+(\d+)(?:[\/?][^#]*)?(?:#p(\d+))?$/, - quotelinkHTML: /]*\bhref="(?:(?:\/\/boards\.4chan(?:nel)?\.org)?\/([^\/]+)\/thread\/)?(\d+)?(?:#p(\d+))?"/g, - pass: /^https?:\/\/www\.4chan(?:nel)?\.org\/+pass(?:$|[?#])/, - captcha: /^https?:\/\/sys\.4chan(?:nel)?\.org\/+captcha(?:$|[?#])/ - }, - bgColoredEl: function() { - return $.el('div', { - className: 'reply' - }); - }, - isThisPageLegit: function() { - var ref, ref1; - return ((ref = location.hostname) === 'boards.4chan.org' || ref === 'boards.4channel.org') && d.doctype && !$('link[href*="favicon-status.ico"]', d.head) && ((ref1 = d.title) !== '4chan - Temporarily Offline' && ref1 !== '4chan - Error' && ref1 !== '504 Gateway Time-out' && ref1 !== 'MathJax Equation Source'); - }, - is404: function() { - var ref; - return ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') || (g.VIEW === 'thread' && $('.board') && !$('.opContainer')); - }, - isIncomplete: function() { - var ref; - return ((ref = g.VIEW) === 'index' || ref === 'thread') && !$('.board + *'); - }, - isBoardlessPage: function(url) { - var ref; - return (ref = url.hostname) === 'www.4chan.org' || ref === 'www.4channel.org'; - }, - isAuxiliaryPage: function(url) { - var ref; - return (ref = url.hostname) !== 'boards.4chan.org' && ref !== 'boards.4channel.org'; - }, - isFileURL: function(url) { - return ImageHost.test(url.hostname); - }, - initAuxiliary: function() { - var match, pathname; - switch (location.hostname) { - case 'www.4chan.org': - case 'www.4channel.org': - if (SW.yotsuba.regexp.pass.test(location.href)) { - PassMessage.init(); - } else { - $.onExists(doc, 'body', function() { - return $.addStyle(CSS.www); - }); - Captcha.replace.init(); - } - break; - case 'sys.4chan.org': - case 'sys.4channel.org': - pathname = location.pathname.split(/\/+/); - if (pathname[2] === 'imgboard.php') { - if (/\bmode=report\b/.test(location.search)) { - Report.init(); - } else if ((match = location.search.match(/\bres=(\d+)/))) { - $.ready(function() { - var ref; - if (Conf['404 Redirect'] && ((ref = $.id('errmsg')) != null ? ref.textContent : void 0) === 'Error: Specified thread does not exist.') { - return Redirect.navigate('thread', { - boardID: g.BOARD.ID, - postID: +match[1] - }); - } - }); - } - } else if (pathname[2] === 'post') { - PostSuccessful.init(); - } - } - }, - scriptData: function() { - var j, len, ref, script; - ref = $$('script:not([src])', d.head); - for (j = 0, len = ref.length; j < len; j++) { - script = ref[j]; - if (/\bcooldowns *=/.test(script.textContent)) { - return script.textContent; - } - } - return ''; - }, - parseThreadMetadata: function(thread) { - var file, m, scriptData; - scriptData = this.scriptData(); - thread.postLimit = /\bbumplimit *= *1\b/.test(scriptData); - thread.fileLimit = /\bimagelimit *= *1\b/.test(scriptData); - thread.ipCount = (m = scriptData.match(/\bunique_ips *= *(\d+)\b/)) ? +m[1] : void 0; - if (g.BOARD.ID === 'f' && thread.OP.file) { - file = thread.OP.file; - return $.ajax(this.urls.threadJSON({ - boardID: 'f', - threadID: thread.ID - }), { - timeout: $.MINUTE, - onloadend: function() { - if (this.response) { - return file.text.dataset.md5 = file.MD5 = this.response.posts[0].md5; - } - } - }); - } - }, - parseNodes: function(post, nodes) { - var icon, j, len, ref, results, type; - if (post.boardID === 'f') { - ref = ['Sticky', 'Closed']; - results = []; - for (j = 0, len = ref.length; j < len; j++) { - type = ref[j]; - if ((icon = $("img[alt=" + type + "]", nodes.info))) { - results.push($.addClass(icon, (type.toLowerCase()) + "Icon", 'retina')); - } - } - return results; - } - }, - parseDate: function(node) { - return new Date(node.dataset.utc * 1000); - }, - parseFile: function(post, file) { - var info, link, m, ref, ref1, ref2, text, thumb; - text = file.text, link = file.link, thumb = file.thumb; - if (!(info = (ref = link.nextSibling) != null ? ref.textContent.match(/\(([\d.]+ [KMG]?B).*\)/) : void 0)) { - return false; - } - $.extend(file, { - name: text.title || link.title || link.textContent, - size: info[1], - dimensions: (ref1 = info[0].match(/\d+x\d+/)) != null ? ref1[0] : void 0, - tag: (ref2 = info[0].match(/,[^,]*, ([a-z]+)\)/i)) != null ? ref2[1] : void 0, - MD5: text.dataset.md5 - }); - if (thumb) { - $.extend(file, { - thumbURL: thumb.src, - MD5: thumb.dataset.md5, - isSpoiler: $.hasClass(thumb.parentNode, 'imgspoiler') - }); - if (file.isSpoiler) { - file.thumbURL = (m = link.href.match(/\d+(?=\.\w+$)/)) ? location.protocol + "//" + (ImageHost.thumbHost()) + "/" + post.board + "/" + m[0] + "s.jpg" : void 0; - } - } - return true; - }, - cleanComment: function(bq) { - var abbr, br, i, j, k, len, node, ref; - if ((abbr = $('.abbr', bq))) { - ref = $$('.abbr + br, .exif', bq); - for (j = 0, len = ref.length; j < len; j++) { - node = ref[j]; - $.rm(node); - } - for (i = k = 0; k < 2; i = ++k) { - if ((br = abbr.previousSibling) && br.nodeName === 'BR') { - $.rm(br); - } - } - return $.rm(abbr); - } - }, - cleanCommentDisplay: function(bq) { - var b; - if ((b = $('b', bq)) && /^Rolled /.test(b.textContent)) { - $.rm(b); - } - return $.rm($('.fortune', bq)); - }, - insertTags: function(bq) { - var j, k, len, len1, node, ref, ref1; - ref = $$('s, .removed-spoiler', bq); - for (j = 0, len = ref.length; j < len; j++) { - node = ref[j]; - $.replace(node, [$.tn('[spoiler]')].concat(slice.call(node.childNodes), [$.tn('[/spoiler]')])); - } - ref1 = $$('.prettyprint', bq); - for (k = 0, len1 = ref1.length; k < len1; k++) { - node = ref1[k]; - $.replace(node, [$.tn('[code]')].concat(slice.call(node.childNodes), [$.tn('[/code]')])); - } - }, - hasCORS: function(url) { - return url.split('/').slice(0, 3).join('/') === location.protocol + '//a.4cdn.org'; - }, - sfwBoards: function(sfw) { - return BoardConfig.sfwBoards(sfw); - }, - uidColor: function(uid) { - var i, msg; - msg = 0; - i = 0; - while (i < 8) { - msg = (msg << 5) - msg + uid.charCodeAt(i++); - } - return (msg >> 8) & 0xFFFFFF; - }, - isLinkified: function(link) { - return ImageHost.test(link.hostname); - }, - testNativeExtension: function() { - return $.global(function() { - if (window.Parser.postMenuIcon) { - return this.enabled = 'true'; - } - }); - }, - transformBoardList: function() { - var a, chr, i, items, j, len, node, nodes, ref, spacer, span; - nodes = []; - spacer = function() { - return $.el('span', { - className: 'spacer' - }); - }; - items = $.X('.//a|.//text()[not(ancestor::a)]', $(SW.yotsuba.selectors.boardList)); - i = 0; - while (node = items.snapshotItem(i++)) { - switch (node.nodeName) { - case '#text': - ref = node.nodeValue; - for (j = 0, len = ref.length; j < len; j++) { - chr = ref[j]; - span = $.el('span', { - textContent: chr - }); - if (chr === ' ') { - span.className = 'space'; - } - if (chr === ']') { - nodes.push(spacer()); - } - nodes.push(span); - if (chr === '[') { - nodes.push(spacer()); - } - } - break; - case 'A': - a = node.cloneNode(true); - nodes.push(a); - } - } - return nodes; - } - }; - -}).call(this); - -(function() { - var Build, - slice = [].slice; - - Build = { - staticPath: '//s.4cdn.org/image/', - gifIcon: window.devicePixelRatio >= 2 ? '@2x.gif' : '.gif', - spoilerRange: $.dict(), - shortFilename: function(filename) { - var ext; - ext = filename.match(/\.?[^\.]*$/)[0]; - if (filename.length - ext.length > 30) { - return (filename.match(/(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[^]){0,25}/)[0]) + "(...)" + ext; - } else { - return filename; - } - }, - spoilerThumb: function(boardID) { - var spoilerRange; - if (spoilerRange = Build.spoilerRange[boardID]) { - return Build.staticPath + "spoiler-" + boardID + (Math.floor(1 + spoilerRange * Math.random())) + ".png"; - } else { - return Build.staticPath + "spoiler.png"; - } - }, - sameThread: function(boardID, threadID) { - return g.VIEW === 'thread' && g.BOARD.ID === boardID && g.THREADID === +threadID; - }, - threadURL: function(boardID, threadID) { - if (boardID !== g.BOARD.ID) { - return "//" + (BoardConfig.domain(boardID)) + "/" + boardID + "/thread/" + threadID; - } else if (g.VIEW !== 'thread' || +threadID !== g.THREADID) { - return "/" + boardID + "/thread/" + threadID; - } else { - return ''; - } - }, - postURL: function(boardID, threadID, postID) { - return (Build.threadURL(boardID, threadID)) + "#p" + postID; - }, - parseJSON: function(data, arg) { - var boardID, key, o, siteID; - siteID = arg.siteID, boardID = arg.boardID; - o = { - ID: data.no, - postID: data.no, - threadID: data.resto || data.no, - boardID: boardID, - siteID: siteID, - isReply: !!data.resto, - isSticky: !!data.sticky, - isClosed: !!data.closed, - isArchived: !!data.archived, - fileDeleted: !!data.filedeleted, - filesDeleted: data.filedeleted ? [0] : [] - }; - o.info = { - subject: $.unescape(data.sub), - email: $.unescape(data.email), - name: $.unescape(data.name) || '', - tripcode: data.trip, - pass: data.since4pass != null ? "" + data.since4pass : void 0, - uniqueID: data.id, - flagCode: data.country, - flagCodeTroll: data.board_flag, - flag: $.unescape(data.country_name || data.flag_name), - dateUTC: data.time, - dateText: data.now, - commentHTML: { - innerHTML: data.com || '' - } - }; - if (data.capcode) { - o.info.capcode = data.capcode.replace(/_highlight$/, '').replace(/_/g, ' ').replace(/\b\w/g, function(c) { - return c.toUpperCase(); - }); - o.capcodeHighlight = /_highlight$/.test(data.capcode); - delete o.info.uniqueID; - } - o.files = []; - if (data.ext) { - o.file = SW.yotsuba.Build.parseJSONFile(data, { - siteID: siteID, - boardID: boardID - }); - o.files.push(o.file); - } - o.extra = $.dict(); - for (key in data) { - if (key[0] === 'x') { - o.extra[key] = data[key]; - } - } - return o; - }, - parseJSONFile: function(data, arg) { - var boardID, filename, o, site, siteID; - siteID = arg.siteID, boardID = arg.boardID; - site = g.sites[siteID]; - filename = site.software === 'yotsuba' && boardID === 'f' ? "" + (encodeURIComponent(data.filename)) + data.ext : "" + data.tim + data.ext; - o = { - name: ($.unescape(data.filename)) + data.ext, - url: site.urls.file({ - siteID: siteID, - boardID: boardID - }, filename), - height: data.h, - width: data.w, - MD5: data.md5, - size: $.bytesToString(data.fsize), - thumbURL: site.urls.thumb({ - siteID: siteID, - boardID: boardID - }, data.tim + "s.jpg"), - theight: data.tn_h, - twidth: data.tn_w, - isSpoiler: !!data.spoiler, - tag: data.tag, - hasDownscale: !!data.m_img - }; - if ((data.h != null) && !/\.pdf$/.test(o.url)) { - o.dimensions = o.width + "x" + o.height; - } - return o; - }, - parseComment: function(html) { - html = html.replace(//gi, '\n').replace(/\n\n]*>/g, ''); - return $.unescape(html); - }, - parseCommentDisplay: function(html) { - var html2; - if (!(Conf['Remove Spoilers'] || Conf['Reveal Spoilers'])) { - while ((html2 = html.replace(/(?:(?!<\/?s>).)*<\/s>/g, '[spoiler]')) !== html) { - html = html2; - } - } - html = html.replace(/^Rolled [^<]*<\/b>/i, '').replace(/ " + ((!o.isReply || boardID === "f" || subject) ? "" + E(subject || "") + " " : "") + "" + ((email) ? "" : "") + "" + E(name) + "" + ((tripcode) ? " " + E(tripcode) + "" : "") + ((pass) ? " " : "") + ((capcode) ? " ## " + E(capcode) + "" : "") + ((email) ? "" : "") + ((boardID === "f" && !o.isReply || capcodeDescription) ? "" : " ") + ((capcodeDescription) ? " \""" : "") + ((uniqueID && !capcode) ? " (ID: " + E(uniqueID) + ")" : "") + ((flagCode) ? " " : "") + ((flagCodeTroll) ? " " : "") + "
    " + E(dateText) + " No." + E(ID) + "" + ((o.isSticky) ? " \"Sticky\"" : "") + ((o.isClosed && !o.isArchived) ? " \"Closed\"" : "") + ((o.isArchived) ? " \"Archived\"" : "") + ((!o.isReply && g.VIEW === "index") ? "   [Reply]" : "") + ""}; - - /* File Info */ - if (file) { - protocol = /^https?:(?=\/\/i\.4cdn\.org\/)/; - fileURL = file.url.replace(protocol, ''); - shortFilename = Build.shortFilename(file.name); - fileThumb = file.isSpoiler ? Build.spoilerThumb(boardID) : file.thumbURL.replace(protocol, ''); - } - fileBlock = {innerHTML: ((file) ? "
    " + ((boardID === "f") ? "
    File: " + E(file.name) + "-(" + E(file.size) + ", " + E(file.dimensions) + ((file.tag) ? ", " + E(file.tag) : "") + ")
    " : "
    File: " + ((file.isSpoiler) ? "Spoiler Image" : E(shortFilename)) + " (" + E(file.size) + ", " + E(file.dimensions || "PDF") + ")
    \""") + "
    " : ((o.fileDeleted) ? "
    \"File
    " : ""))}; - - /* Whole Post */ - postClass = o.isReply ? 'reply' : 'op'; - wholePost = {innerHTML: ((o.isReply) ? "
    >>
    " : "") + "
    " + ((o.isReply) ? (postInfo).innerHTML + (fileBlock).innerHTML : (fileBlock).innerHTML + (postInfo).innerHTML) + "
    " + (commentHTML).innerHTML + "
    "}; - container = $.el('div', { - className: "postContainer " + postClass + "Container", - id: "pc" + ID - }); - $.extend(container, wholePost); - ref1 = $$('.quotelink', container); - for (i = 0, len = ref1.length; i < len; i++) { - quote = ref1[i]; - href = quote.getAttribute('href'); - if (href[0] === '#') { - if (!Build.sameThread(boardID, threadID)) { - quote.href = Build.threadURL(boardID, threadID) + href; - } - } else { - if ((match = quote.href.match(SW.yotsuba.regexp.quotelink)) && (Build.sameThread(match[1], match[2]))) { - quote.href = href.match(/(#[^#]*)?$/)[0] || '#'; - } - } - } - return container; - }, - summaryText: function(status, posts, files) { - var text; - text = ''; - if (status) { - text += status + " "; - } - text += posts + " post" + (posts > 1 ? 's' : ''); - if (+files) { - text += " and " + files + " image repl" + (files > 1 ? 'ies' : 'y'); - } - return text += " " + (status === '-' ? 'shown' : 'omitted') + "."; - }, - summary: function(boardID, threadID, posts, files) { - return $.el('a', { - className: 'summary', - textContent: Build.summaryText('', posts, files), - href: "/" + boardID + "/thread/" + threadID - }); - }, - thread: function(thread, data, withReplies) { - var files, posts, ref, root, summary; - if ((root = thread.nodes.root)) { - $.rmAll(root); - } else { - thread.nodes.root = root = $.el('div', { - className: 'thread', - id: "t" + data.no - }); - } - if (Build.hat) { - $.add(root, Build.hat.cloneNode(false)); - } - $.add(root, thread.OP.nodes.root); - if (data.omitted_posts || !withReplies && data.replies) { - ref = withReplies ? [ - data.omitted_posts, data.images - data.last_replies.filter(function(data) { - return !!data.ext; - }).length - ] : [data.replies, data.images], posts = ref[0], files = ref[1]; - summary = Build.summary(thread.board.ID, data.no, posts, files); - $.add(root, summary); - } - return root; - }, - catalogThread: function(thread, data, pageCount) { - var br, container, cssText, fileCount, gifIcon, i, imgClass, len, postCount, ratio, ref, root, spoilerRange, src, staticPath, tn_h, tn_w; - staticPath = Build.staticPath, gifIcon = Build.gifIcon; - tn_w = data.tn_w, tn_h = data.tn_h; - if (data.spoiler && !Conf['Reveal Spoiler Thumbnails']) { - src = staticPath + "spoiler"; - if (spoilerRange = Build.spoilerRange[thread.board]) { - src += ("-" + thread.board) + Math.floor(1 + spoilerRange * Math.random()); - } - src += '.png'; - imgClass = 'spoiler-file'; - cssText = "--tn-w: 100; --tn-h: 100;"; - } else if (data.filedeleted) { - src = staticPath + "filedeleted-res" + gifIcon; - imgClass = 'deleted-file'; - } else if (thread.OP.file) { - src = thread.OP.file.thumbURL; - ratio = 250 / Math.max(tn_w, tn_h); - cssText = "--tn-w: " + (tn_w * ratio) + "; --tn-h: " + (tn_h * ratio) + ";"; - } else { - src = staticPath + "nofile.png"; - imgClass = 'no-file'; - } - postCount = data.replies + 1; - fileCount = data.images + !!data.ext; - container = $.el('div', {innerHTML: "
    " + E(postCount) + " / " + E(fileCount) + " / " + E(pageCount) + "" + ((thread.isSticky) ? "" : "") + ((thread.isClosed) ? "" : "") + "
    "}); - $.before(thread.OP.nodes.info, slice.call(container.childNodes)); - ref = $$('br', thread.OP.nodes.comment); - for (i = 0, len = ref.length; i < len; i++) { - br = ref[i]; - if (br.previousSibling && br.previousSibling.nodeName === 'BR') { - $.addClass(br, 'extra-linebreak'); - } - } - root = $.el('div', { - className: 'thread catalog-thread', - id: "t" + thread - }); - if (thread.OP.highlights) { - $.addClass.apply($, [root].concat(slice.call(thread.OP.highlights))); - } - if (!thread.OP.file) { - $.addClass(root, 'noFile'); - } - root.style.cssText = cssText || ''; - return root; - }, - catalogReply: function(thread, data) { - var excerpt, link; - excerpt = ''; - if (data.com) { - excerpt = Build.parseCommentDisplay(data.com).replace(/>>\d+/g, '').trim().replace(/\n+/g, ' // '); - } - if (data.ext) { - excerpt || (excerpt = "" + ($.unescape(data.filename)) + data.ext); - } - if (data.com) { - excerpt || (excerpt = $.unescape(data.com.replace(//gi, ' // '))); - } - excerpt || (excerpt = '\xA0'); - if (excerpt.length > 73) { - excerpt = excerpt.slice(0, 70) + "..."; - } - link = Build.postURL(thread.board.ID, thread.ID, data.no); - return $.el('div', { - className: 'catalog-reply' - }, {innerHTML: ": " + E(excerpt) + "..."}); - } - }; - - SW.yotsuba.Build = Build; - -}).call(this); - -Site = (function() { - var Site; - - Site = { - defaultProperties: { - '4chan.org': { - software: 'yotsuba' - }, - '4channel.org': { - canonical: '4chan.org' - }, - '4cdn.org': { - canonical: '4chan.org' - }, - 'notso.smuglo.li': { - canonical: 'smuglo.li' - }, - 'smugloli.net': { - canonical: 'smuglo.li' - }, - 'smug.nepu.moe': { - canonical: 'smuglo.li' - } - }, - init: function(cb) { - var hostname; - $.extend(Conf['siteProperties'], Site.defaultProperties); - hostname = Site.resolve(); - if (hostname && $.hasOwn(SW, Conf['siteProperties'][hostname].software)) { - this.set(hostname); - cb(); - } - return $.onExists(doc, 'body', (function(_this) { - return function() { - var base, base1, changed, changes, key, properties, software; - for (software in SW) { - if (!((changes = typeof (base = SW[software]).detect === "function" ? base.detect() : void 0))) { - continue; - } - changes.software = software; - hostname = location.hostname.replace(/^www\./, ''); - properties = ((base1 = Conf['siteProperties'])[hostname] || (base1[hostname] = $.dict())); - changed = 0; - for (key in changes) { - if (!(properties[key] !== changes[key])) { - continue; - } - properties[key] = changes[key]; - changed++; - } - if (changed) { - $.set('siteProperties', Conf['siteProperties']); - } - if (!g.SITE) { - _this.set(hostname); - cb(); - } - return; - } - }; - })(this)); - }, - resolve: function(url) { - var canonical, hostname; - if (url == null) { - url = location; - } - hostname = url.hostname; - while (hostname && !$.hasOwn(Conf['siteProperties'], hostname)) { - hostname = hostname.replace(/^[^.]*\.?/, ''); - } - if (hostname) { - if ((canonical = Conf['siteProperties'][hostname].canonical)) { - hostname = canonical; - } - } - return hostname; - }, - parseURL: function(url) { - var siteID; - siteID = Site.resolve(url); - return Main.parseURL(g.sites[siteID], url); - }, - set: function(hostname) { - var ID, properties, ref, site, software; - ref = Conf['siteProperties']; - for (ID in ref) { - properties = ref[ID]; - if (properties.canonical) { - continue; - } - software = properties.software; - if (!(software && $.hasOwn(SW, software))) { - continue; - } - g.sites[ID] = site = Object.create(SW[software]); - $.extend(site, { - ID: ID, - siteID: ID, - properties: properties, - software: software - }); - } - return g.SITE = g.sites[hostname]; - } - }; - - return Site; - -}).call(this); - -Redirect = (function() { - var Redirect, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Redirect = { - archives: [ - { "uid": 3, "name": "4plebs", "domain": "archive.4plebs.org", "http": true, "https": true, "software": "foolfuuka", "boards": [ "adv", "f", "hr", "mlpol", "mo", "o", "pol", "s4s", "sp", "tg", "trv", "tv", "x" ], "files": [ "adv", "f", "hr", "mlpol", "mo", "o", "pol", "s4s", "sp", "tg", "trv", "tv", "x" ], "reports": true }, - { "uid": 10, "name": "warosu", "domain": "warosu.org", "http": false, "https": true, "software": "fuuka", "boards": [ "3", "biz", "cgl", "ck", "diy", "fa", "ic", "jp", "lit", "sci", "vr", "vt" ], "files": [ "3", "biz", "cgl", "ck", "diy", "fa", "ic", "jp", "lit", "sci", "vr", "vt" ], "search": [ "biz", "cgl", "ck", "diy", "fa", "ic", "jp", "lit", "sci", "vr", "vt" ] }, - { "uid": 23, "name": "Desuarchive", "domain": "desuarchive.org", "http": true, "https": true, "software": "foolfuuka", "boards": [ "a", "aco", "an", "c", "cgl", "co", "d", "fit", "g", "his", "int", "k", "m", "mlp", "mu", "q", "qa", "r9k", "tg", "trash", "vr", "wsg" ], "files": [ "a", "aco", "an", "c", "cgl", "co", "d", "fit", "g", "his", "int", "k", "m", "mlp", "mu", "q", "qa", "r9k", "tg", "trash", "vr" ], "reports": true }, - { "uid": 24, "name": "fireden.net", "domain": "boards.fireden.net", "http": false, "https": true, "software": "foolfuuka", "boards": [ "cm", "co", "ic", "sci", "vip", "y" ], "files": [ "cm", "co", "ic", "sci", "vip", "y" ], "search": [ "cm", "co", "ic", "sci", "y" ] }, - { "uid": 25, "name": "arch.b4k.co", "domain": "arch.b4k.co", "http": true, "https": true, "software": "foolfuuka", "boards": [ "g", "mlp", "qb", "v", "vg", "vm", "vmg", "vp", "vrpg", "vst" ], "files": [ "qb", "v", "vg", "vm", "vmg", "vp", "vrpg", "vst" ], "search": [ "qb", "v", "vg", "vm", "vmg", "vp", "vrpg", "vst" ] }, - { "uid": 29, "name": "Archived.Moe", "domain": "archived.moe", "http": true, "https": true, "software": "foolfuuka", "boards": [ "3", "a", "aco", "adv", "an", "asp", "b", "bant", "biz", "c", "can", "cgl", "ck", "cm", "co", "cock", "con", "d", "diy", "e", "f", "fa", "fap", "fit", "fitlit", "g", "gd", "gif", "h", "hc", "his", "hm", "hr", "i", "ic", "int", "jp", "k", "lgbt", "lit", "m", "mlp", "mlpol", "mo", "mtv", "mu", "n", "news", "o", "out", "outsoc", "p", "po", "pol", "pw", "q", "qa", "qb", "qst", "r", "r9k", "s", "s4s", "sci", "soc", "sp", "spa", "t", "tg", "toy", "trash", "trv", "tv", "u", "v", "vg", "vint", "vip", "vm", "vmg", "vp", "vr", "vrpg", "vst", "vt", "w", "wg", "wsg", "wsr", "x", "xs", "y" ], "files": [ "can", "cock", "con", "fap", "fitlit", "gd", "mlpol", "mo", "mtv", "outsoc", "po", "q", "qb", "qst", "spa", "vint", "vip" ], "search": [ "aco", "adv", "an", "asp", "b", "bant", "biz", "c", "can", "cgl", "ck", "cm", "cock", "con", "d", "diy", "e", "f", "fap", "fitlit", "gd", "gif", "h", "hc", "his", "hm", "hr", "i", "ic", "lgbt", "lit", "mlpol", "mo", "mtv", "n", "news", "o", "out", "outsoc", "p", "po", "pw", "q", "qa", "qst", "r", "s", "soc", "spa", "trv", "u", "vint", "vip", "vrpg", "w", "wg", "wsg", "wsr", "x", "y" ], "reports": true }, - { "uid": 30, "name": "TheBArchive.com", "domain": "thebarchive.com", "http": true, "https": true, "software": "foolfuuka", "boards": [ "b", "bant" ], "files": [ "b", "bant" ], "reports": true }, - { "uid": 31, "name": "Archive Of Sins", "domain": "archiveofsins.com", "http": true, "https": true, "software": "foolfuuka", "boards": [ "h", "hc", "hm", "i", "lgbt", "r", "s", "soc", "t", "u" ], "files": [ "h", "hc", "hm", "i", "lgbt", "r", "s", "soc", "t", "u" ], "reports": true }, - { "uid": 34, "name": "TokyoChronos", "domain": "www.tokyochronos.net", "http": false, "https": true, "software": "foolfuuka", "boards": [ "c", "g", "jp", "mu", "vp", "vrpg", "vt" ], "files": [], "reports": true }, - { "uid": 36, "name": "palanq.win", "domain": "archive.palanq.win", "http": false, "https": true, "software": "foolfuuka", "boards": [ "bant", "c", "con", "e", "i", "n", "news", "out", "p", "pw", "qst", "toy", "vip", "vp", "vt", "w", "wg", "wsr" ], "files": [ "bant", "c", "e", "i", "n", "news", "out", "p", "pw", "qst", "toy", "vip", "vp", "vt", "w", "wg", "wsr" ], "reports": true }, - { "uid": 37, "name": "Eientei", "domain": "eientei.xyz", "http": false, "https": true, "software": "Eientei", "boards": [ "3", "i", "sci", "xs" ], "files": [ "3", "i", "sci", "xs" ], "reports": true } - ], - init: function() { - var now, ref; - this.selectArchives(); - if (Conf['archiveAutoUpdate']) { - now = Date.now(); - if (!((now - 2 * $.DAY < (ref = Conf['lastarchivecheck']) && ref <= now))) { - return this.update(); - } - } - }, - selectArchives: function() { - var archive, archives, boardID, boards, data, files, id, j, k, key, l, len, len1, len2, name, o, record, ref, ref1, ref2, software, type, uid; - o = { - thread: $.dict(), - post: $.dict(), - file: $.dict() - }; - archives = $.dict(); - ref = Conf['archives']; - for (j = 0, len = ref.length; j < len; j++) { - data = ref[j]; - ref1 = ['boards', 'files']; - for (k = 0, len1 = ref1.length; k < len1; k++) { - key = ref1[k]; - if (!(data[key] instanceof Array)) { - data[key] = []; - } - } - uid = data.uid, name = data.name, boards = data.boards, files = data.files, software = data.software; - if (software !== 'fuuka' && software !== 'foolfuuka') { - continue; - } - archives[JSON.stringify(uid != null ? uid : name)] = data; - for (l = 0, len2 = boards.length; l < len2; l++) { - boardID = boards[l]; - if (!(boardID in o.thread)) { - o.thread[boardID] = data; - } - if (!(boardID in o.post || software !== 'foolfuuka')) { - o.post[boardID] = data; - } - if (!(boardID in o.file || indexOf.call(files, boardID) < 0)) { - o.file[boardID] = data; - } - } - } - ref2 = Conf['selectedArchives']; - for (boardID in ref2) { - record = ref2[boardID]; - for (type in record) { - id = record[type]; - if (!((archive = archives[JSON.stringify(id)]) && $.hasOwn(o, type))) { - continue; - } - boards = type === 'file' ? archive.files : archive.boards; - if (indexOf.call(boards, boardID) >= 0) { - o[type][boardID] = archive; - } - } - } - return Redirect.data = o; - }, - update: function(cb) { - var err, fail, i, j, k, len, len1, load, nloaded, ref, ref1, response, responses, url, urls; - urls = []; - responses = []; - nloaded = 0; - ref = Conf['archiveLists'].split('\n'); - for (j = 0, len = ref.length; j < len; j++) { - url = ref[j]; - if (!(url[0] !== '#')) { - continue; - } - url = url.trim(); - if (url) { - urls.push(url); - } - } - fail = function(url, action, msg) { - return new Notice('warning', "Error " + action + " archive data from\n" + url + "\n" + msg, 20); - }; - load = function(i) { - return function() { - var response; - if (this.status !== 200) { - return fail(urls[i], 'fetching', (this.status ? "Error " + this.statusText + " (" + this.status + ")" : 'Connection Error')); - } - response = this.response; - if (!(response instanceof Array)) { - response = [response]; - } - responses[i] = response; - nloaded++; - if (nloaded === urls.length) { - return Redirect.parse(responses, cb); - } - }; - }; - if (urls.length) { - for (i = k = 0, len1 = urls.length; k < len1; i = ++k) { - url = urls[i]; - if ((ref1 = url[0]) === '[' || ref1 === '{') { - try { - response = JSON.parse(url); - } catch (error) { - err = error; - fail(url, 'parsing', err.message); - continue; - } - load(i).call({ - status: 200, - response: response - }); - } else { - CrossOrigin.ajax(url, { - onloadend: load(i) - }); - } - } - } else { - Redirect.parse([], cb); - } - }, - parse: function(responses, cb) { - var archiveUIDs, archives, data, items, j, k, len, len1, ref, response, uid; - archives = []; - archiveUIDs = $.dict(); - for (j = 0, len = responses.length; j < len; j++) { - response = responses[j]; - for (k = 0, len1 = response.length; k < len1; k++) { - data = response[k]; - uid = JSON.stringify((ref = data.uid) != null ? ref : data.name); - if (uid in archiveUIDs) { - $.extend(archiveUIDs[uid], data); - } else { - archiveUIDs[uid] = $.dict.clone(data); - archives.push(data); - } - } - } - items = { - archives: archives, - lastarchivecheck: Date.now() - }; - $.set(items); - $.extend(Conf, items); - Redirect.selectArchives(); - return typeof cb === "function" ? cb() : void 0; - }, - to: function(dest, data) { - var archive; - archive = (dest === 'search' || dest === 'board' ? Redirect.data.thread : Redirect.data[dest])[data.boardID]; - if (!archive) { - return ''; - } - return Redirect[dest](archive, data); - }, - protocol: function(archive) { - var protocol; - protocol = location.protocol; - if (!$.getOwn(archive, protocol.slice(0, -1))) { - protocol = protocol === 'https:' ? 'http:' : 'https:'; - } - return protocol + "//"; - }, - thread: function(archive, arg) { - var boardID, path, postID, threadID; - boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID; - path = threadID ? boardID + "/thread/" + threadID : boardID + "/post/" + postID; - if (archive.software === 'foolfuuka') { - path += '/'; - } - if (threadID && postID) { - path += archive.software === 'foolfuuka' ? "#" + postID : "#p" + postID; - } - return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path; - }, - post: function(archive, arg) { - var boardID, postID, protocol, url; - boardID = arg.boardID, postID = arg.postID; - protocol = Redirect.protocol(archive); - url = "" + protocol + archive.domain + "/_/api/chan/post/?board=" + boardID + "&num=" + postID; - if (!Redirect.securityCheck(url)) { - return ''; - } - return url; - }, - file: function(archive, arg) { - var boardID, filename; - boardID = arg.boardID, filename = arg.filename; - if (!filename) { - return ''; - } - if (boardID === 'f') { - filename = encodeURIComponent($.unescape(decodeURIComponent(filename))); - } else { - if (/[sm]\.jpg$/.test(filename)) { - return ''; - } - } - return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/full_image/" + filename; - }, - board: function(archive, arg) { - var boardID; - boardID = arg.boardID; - return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/"; - }, - search: function(archive, arg) { - var boardID, path, type, value; - boardID = arg.boardID, type = arg.type, value = arg.value; - type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type; - if (type === 'capcode') { - value = $.getOwn({ - 'Developer': 'dev', - 'Verified': 'ver' - }, value) || value.toLowerCase(); - } else if (type === 'image') { - value = value.replace(/[+\/=]/g, function(c) { - return { - '+': '-', - '/': '_', - '=': '' - }[c]; - }); - } - value = encodeURIComponent(value); - path = archive.software === 'foolfuuka' ? boardID + "/search/" + type + "/" + value + "/" : type === 'image' ? boardID + "/image/" + value : boardID + "/?task=search2&search_" + type + "=" + value; - return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path; - }, - report: function(boardID) { - var archive, boards, domain, https, j, len, name, ref, reports, software, urls; - urls = []; - ref = Conf['archives']; - for (j = 0, len = ref.length; j < len; j++) { - archive = ref[j]; - software = archive.software, https = archive.https, reports = archive.reports, boards = archive.boards, name = archive.name, domain = archive.domain; - if (software === 'foolfuuka' && https && reports && boards instanceof Array && indexOf.call(boards, boardID) >= 0) { - urls.push([name, "https://" + domain + "/_/api/chan/offsite_report/"]); - } - } - return urls; - }, - securityCheck: function(url) { - return /^https:\/\//.test(url) || location.protocol === 'http:' || Conf['Exempt Archives from Encryption']; - }, - navigate: function(dest, data, alternative) { - var url; - if (!Redirect.data) { - Redirect.init(); - } - url = Redirect.to(dest, data); - if (url && (Redirect.securityCheck(url) || confirm("Redirect to " + url + "?\n\nYour connection will not be encrypted."))) { - return location.replace(url); - } else if (alternative) { - return location.replace(alternative); - } - } - }; - - return Redirect; - -}).call(this); - -Anonymize = (function() { - var Anonymize; - - Anonymize = { - init: function() { - if (!Conf['Anonymize']) { - return; - } - return $.addClass(doc, 'anonymize'); - } - }; - - return Anonymize; - -}).call(this); - -Filter = (function() { - var Filter, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - slice = [].slice; - - Filter = { - filters: $.dict(), - init: function() { - var base, base1, boards, err, excludes, file, filter, hide, hl, i, isstring, j, key, len, len1, line, mask, noti, op, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, regexp, stub, top, type, types; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'catalog') && Conf['Filter'])) { - return; - } - if (g.VIEW === 'catalog' && !Conf['Filter in Native Catalog']) { - return; - } - if (!Conf['Filtered Backlinks']) { - $.addClass(doc, 'hide-backlinks'); - } - for (key in Config.filter) { - ref1 = Conf[key].split('\n'); - for (i = 0, len = ref1.length; i < len; i++) { - line = ref1[i]; - if (line[0] === '#') { - continue; - } - if (!(regexp = line.match(/\/(.*)\/(\w*)/))) { - continue; - } - filter = line.replace(regexp[0], ''); - boards = this.parseBoards((ref2 = filter.match(/(?:^|;)\s*boards:([^;]+)/)) != null ? ref2[1] : void 0); - excludes = this.parseBoards((ref3 = filter.match(/(?:^|;)\s*exclude:([^;]+)/)) != null ? ref3[1] : void 0); - if ((isstring = (key === 'uniqueID' || key === 'MD5'))) { - regexp = regexp[1]; - } else { - try { - regexp = RegExp(regexp[1], regexp[2]); - } catch (error) { - err = error; - new Notice('warning', [$.tn("Invalid " + key + " filter:"), $.el('br'), $.tn(line), $.el('br'), $.tn(err.message)], 60); - continue; - } - } - op = ((ref4 = filter.match(/(?:^|;)\s*op:(no|only)/)) != null ? ref4[1] : void 0) || ''; - mask = $.getOwn({ - 'no': 1, - 'only': 2 - }, op) || 0; - file = ((ref5 = filter.match(/(?:^|;)\s*file:(no|only)/)) != null ? ref5[1] : void 0) || ''; - mask = mask | ($.getOwn({ - 'no': 4, - 'only': 8 - }, file) || 0); - stub = (function() { - var ref6; - switch ((ref6 = filter.match(/(?:^|;)\s*stub:(yes|no)/)) != null ? ref6[1] : void 0) { - case 'yes': - return true; - case 'no': - return false; - default: - return Conf['Stubs']; - } - })(); - noti = /(?:^|;)\s*notify/.test(filter); - if ((hl = /(?:^|;)\s*highlight/.test(filter))) { - hl = ((ref6 = filter.match(/(?:^|;)\s*highlight:([\w-]+)/)) != null ? ref6[1] : void 0) || 'filter-highlight'; - top = ((ref7 = filter.match(/(?:^|;)\s*top:(yes|no)/)) != null ? ref7[1] : void 0) || 'yes'; - top = top === 'yes'; - } - if (key === 'general') { - if ((types = filter.match(/(?:^|;)\s*type:([^;]*)/))) { - types = types[1].split(','); - } else { - types = ['subject', 'name', 'filename', 'comment']; - } - } - hide = !(hl || noti); - filter = { - isstring: isstring, - regexp: regexp, - boards: boards, - excludes: excludes, - mask: mask, - hide: hide, - stub: stub, - hl: hl, - top: top, - noti: noti - }; - if (key === 'general') { - for (j = 0, len1 = types.length; j < len1; j++) { - type = types[j]; - ((base = this.filters)[type] || (base[type] = [])).push(filter); - } - } else { - ((base1 = this.filters)[key] || (base1[key] = [])).push(filter); - } - } - } - if (!Object.keys(this.filters).length) { - return; - } - if (g.VIEW === 'catalog') { - return Filter.catalog(); - } else { - return Callbacks.Post.push({ - name: 'Filter', - cb: this.node - }); - } - }, - parseBoards: function(boardsRaw) { - var boardID, boardID2, boards, i, j, len, len1, ref, ref1, ref2, ref3, site, siteFilter, siteID; - if (!boardsRaw) { - return false; - } - if ((boards = Filter.parseBoardsMemo[boardsRaw])) { - return boards; - } - boards = $.dict(); - siteFilter = ''; - ref = boardsRaw.split(','); - for (i = 0, len = ref.length; i < len; i++) { - boardID = ref[i]; - if (indexOf.call(boardID, ':') >= 0) { - ref1 = boardID.split(':').slice(-2), siteFilter = ref1[0], boardID = ref1[1]; - } - ref2 = g.sites; - for (siteID in ref2) { - site = ref2[siteID]; - if (siteID.slice(0, siteFilter.length) === siteFilter) { - if (boardID === 'nsfw' || boardID === 'sfw') { - ref3 = (typeof site.sfwBoards === "function" ? site.sfwBoards(boardID === 'sfw') : void 0) || []; - for (j = 0, len1 = ref3.length; j < len1; j++) { - boardID2 = ref3[j]; - boards[siteID + "/" + boardID2] = true; - } - } else { - boards[siteID + "/" + (encodeURIComponent(boardID))] = true; - } - } - } - } - Filter.parseBoardsMemo[boardsRaw] = boards; - return boards; - }, - parseBoardsMemo: $.dict(), - test: function(post, hideable) { - var board, filter, hide, hl, i, j, key, len, len1, mask, noti, ref, ref1, ref2, site, stub, top, value; - if (hideable == null) { - hideable = true; - } - if (post.filterResults) { - return post.filterResults; - } - hide = false; - stub = true; - hl = void 0; - top = false; - noti = false; - if (QuoteYou.isYou(post)) { - hideable = false; - } - mask = (post.isReply ? 2 : 1); - mask = mask | (post.file ? 4 : 8); - board = post.siteID + "/" + post.boardID; - site = post.siteID + "/*"; - for (key in Filter.filters) { - ref = Filter.values(key, post); - for (i = 0, len = ref.length; i < len; i++) { - value = ref[i]; - ref1 = Filter.filters[key]; - for (j = 0, len1 = ref1.length; j < len1; j++) { - filter = ref1[j]; - if ((filter.boards && !(filter.boards[board] || filter.boards[site])) || (filter.excludes && (filter.excludes[board] || filter.excludes[site])) || (filter.mask & mask) || (filter.isstring ? filter.regexp !== value : !filter.regexp.test(value))) { - continue; - } - if (filter.hide) { - if (hideable) { - hide = true; - stub && (stub = filter.stub); - } - } else { - if (!(hl && (ref2 = filter.hl, indexOf.call(hl, ref2) >= 0))) { - (hl || (hl = [])).push(filter.hl); - } - top || (top = filter.top); - if (filter.noti) { - noti = true; - } - } - } - } - } - if (hide) { - return { - hide: hide, - stub: stub - }; - } else { - return { - hl: hl, - top: top, - noti: noti - }; - } - }, - node: function() { - var hide, hl, noti, ref, stub, top; - if (this.isClone) { - return; - } - ref = Filter.test(this, !this.isFetchedQuote && (this.isReply || g.VIEW === 'index')), hide = ref.hide, stub = ref.stub, hl = ref.hl, top = ref.top, noti = ref.noti; - if (hide) { - if (this.isReply) { - PostHiding.hide(this, stub); - } else { - ThreadHiding.hide(this.thread, stub); - } - } else { - if (hl) { - this.highlights = hl; - $.addClass.apply($, [this.nodes.root].concat(slice.call(hl))); - } - } - if (noti && Unread.posts && (this.ID > Unread.lastReadPost) && !QuoteYou.isYou(this)) { - return Unread.openNotification(this, ' triggered a notification filter'); - } - }, - catalog: function() { - var base, url; - if (!(url = typeof (base = g.SITE.urls).catalogJSON === "function" ? base.catalogJSON(g.BOARD) : void 0)) { - return; - } - Filter.catalogData = $.dict(); - $.ajax(url, { - onloadend: Filter.catalogParse - }); - return Callbacks.CatalogThreadNative.push({ - name: 'Filter', - cb: this.catalogNode - }); - }, - catalogParse: function() { - var i, item, j, len, len1, page, ref, ref1, ref2; - if ((ref = this.status) !== 200 && ref !== 404) { - new Notice('warning', "Failed to fetch catalog JSON data. " + (this.status ? "Error " + this.statusText + " (" + this.status + ")" : 'Connection Error'), 1); - return; - } - ref1 = this.response; - for (i = 0, len = ref1.length; i < len; i++) { - page = ref1[i]; - ref2 = page.threads; - for (j = 0, len1 = ref2.length; j < len1; j++) { - item = ref2[j]; - Filter.catalogData[item.no] = item; - } - } - g.BOARD.threads.forEach(function(thread) { - if (thread.catalogViewNative) { - return Filter.catalogNode.call(thread.catalogViewNative); - } - }); - }, - catalogNode: function() { - var base, hide, hl, ref, ref1, top; - if (!(this.boardID === g.BOARD.ID && Filter.catalogData[this.ID])) { - return; - } - if ((ref = QuoteYou.db) != null ? ref.get({ - siteID: g.SITE.ID, - boardID: this.boardID, - threadID: this.ID, - postID: this.ID - }) : void 0) { - return; - } - ref1 = Filter.test(g.SITE.Build.parseJSON(Filter.catalogData[this.ID], this)), hide = ref1.hide, hl = ref1.hl, top = ref1.top; - if (hide) { - return this.nodes.root.hidden = true; - } else { - if (hl) { - this.highlights = hl; - $.addClass.apply($, [this.nodes.root].concat(slice.call(hl))); - } - if (top) { - $.prepend(this.nodes.root.parentNode, this.nodes.root); - return typeof (base = g.SITE).catalogPin === "function" ? base.catalogPin(this.nodes.root) : void 0; - } - } - }, - isHidden: function(post) { - return !!Filter.test(post).hide; - }, - valueF: { - postID: function(post) { - return ["" + post.ID]; - }, - name: function(post) { - return [post.info.name]; - }, - uniqueID: function(post) { - return [post.info.uniqueID || '']; - }, - tripcode: function(post) { - return [post.info.tripcode]; - }, - capcode: function(post) { - return [post.info.capcode]; - }, - pass: function(post) { - return [post.info.pass]; - }, - email: function(post) { - return [post.info.email]; - }, - subject: function(post) { - return [post.info.subject || (post.isReply ? void 0 : '')]; - }, - comment: function(post) { - var base, ref, ref1; - return [((base = post.info).comment != null ? base.comment : base.comment = (ref = g.sites[post.siteID]) != null ? (ref1 = ref.Build) != null ? typeof ref1.parseComment === "function" ? ref1.parseComment(post.info.commentHTML.innerHTML) : void 0 : void 0 : void 0)]; - }, - flag: function(post) { - return [post.info.flag]; - }, - filename: function(post) { - return post.files.map(function(f) { - return f.name; - }); - }, - dimensions: function(post) { - return post.files.map(function(f) { - return f.dimensions; - }); - }, - filesize: function(post) { - return post.files.map(function(f) { - return f.size; - }); - }, - MD5: function(post) { - return post.files.map(function(f) { - return f.MD5; - }); - } - }, - values: function(key, post) { - if ($.hasOwn(Filter.valueF, key)) { - return Filter.valueF[key](post).filter(function(v) { - return v != null; - }); - } else { - return [ - key.split('+').map(function(k) { - var f; - if ((f = $.getOwn(Filter.valueF, k))) { - return f(post).map(function(v) { - return v || ''; - }).join('\n'); - } else { - return ''; - } - }).join('\n') - ]; - } - }, - addFilter: function(type, re, cb) { - if (!$.hasOwn(Config.filter, type)) { - return; - } - return $.get(type, Conf[type], function(item) { - var save; - save = item[type]; - save = save ? save + "\n" + re : re; - return $.set(type, save, cb); - }); - }, - removeFilters: function(type, res, cb) { - return $.get(type, Conf[type], function(item) { - var save; - save = item[type]; - res = res.map(Filter.escape).join('|'); - save = save.replace(RegExp("(?:$\n|^)(?:" + res + ")$", 'mg'), ''); - return $.set(type, save, cb); - }); - }, - showFilters: function(type) { - var section, select; - Settings.open('Filter'); - section = $('.section-container'); - select = $('select[name=filter]', section); - select.value = type; - Settings.selectFilter.call(select); - return $.onExists(section, 'textarea', function(ta) { - var tl; - tl = ta.textLength; - ta.setSelectionRange(tl, tl); - return ta.focus(); - }); - }, - quickFilterMD5: function() { - var files, filter, links, msg, notice, origin, post; - post = Get.postFromNode(this); - files = post.files.filter(function(f) { - return f.MD5; - }); - if (!files.length) { - return; - } - filter = files.map(function(f) { - return "/" + f.MD5 + "/"; - }).join('\n'); - Filter.addFilter('MD5', filter); - origin = post.origin || post; - if (origin.isReply) { - PostHiding.hide(origin); - } else if (g.VIEW === 'index') { - ThreadHiding.hide(origin.thread); - } - if (!Conf['MD5 Quick Filter Notifications']) { - if (post.nodes.post.getBoundingClientRect().height) { - new Notice('info', 'MD5 filtered.', 2); - } - return; - } - notice = Filter.quickFilterMD5.notice; - if (notice) { - notice.filters.push(filter); - notice.posts.push(origin); - return $('span', notice.el).textContent = notice.filters.length + " MD5s filtered."; - } else { - msg = $.el('div', {innerHTML: "MD5 filtered. [show] [undo]"}); - notice = Filter.quickFilterMD5.notice = new Notice('info', msg, void 0, function() { - return delete Filter.quickFilterMD5.notice; - }); - notice.filters = [filter]; - notice.posts = [origin]; - links = $$('a', msg); - $.on(links[0], 'click', Filter.quickFilterCB.show.bind(notice)); - return $.on(links[1], 'click', Filter.quickFilterCB.undo.bind(notice)); - } - }, - quickFilterCB: { - show: function() { - Filter.showFilters('MD5'); - return this.close(); - }, - undo: function() { - var i, len, post, ref; - Filter.removeFilters('MD5', this.filters); - ref = this.posts; - for (i = 0, len = ref.length; i < len; i++) { - post = ref[i]; - if (post.isReply) { - PostHiding.show(post); - } else if (g.VIEW === 'index') { - ThreadHiding.show(post.thread); - } - } - return this.close(); - } - }, - escape: function(value) { - return value.replace(/\/|\\|\^|\$|\n|\.|\(|\)|\{|\}|\[|\]|\?|\*|\+|\|/g, function(c) { - if (c === '\n') { - return '\\n'; - } else if (c === '\\') { - return '\\\\'; - } else { - return "\\" + c; - } - }); - }, - menu: { - init: function() { - var div, entry, i, len, ref, ref1, type; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Filter'])) { - return; - } - div = $.el('div', { - textContent: 'Filter' - }); - entry = { - el: div, - order: 50, - open: function(post) { - Filter.menu.post = post; - return true; - }, - subEntries: [] - }; - ref1 = [['Name', 'name'], ['Unique ID', 'uniqueID'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Pass Date', 'pass'], ['Email', 'email'], ['Subject', 'subject'], ['Comment', 'comment'], ['Flag', 'flag'], ['Filename', 'filename'], ['Image dimensions', 'dimensions'], ['Filesize', 'filesize'], ['Image MD5', 'MD5']]; - for (i = 0, len = ref1.length; i < len; i++) { - type = ref1[i]; - entry.subEntries.push(Filter.menu.createSubEntry(type[0], type[1])); - } - return Menu.menu.addEntry(entry); - }, - createSubEntry: function(text, type) { - var el; - el = $.el('a', { - href: 'javascript:;', - textContent: text - }); - el.dataset.type = type; - $.on(el, 'click', Filter.menu.makeFilter); - return { - el: el, - open: function(post) { - return Filter.values(type, post).length; - } - }; - }, - makeFilter: function() { - var res, type, values; - type = this.dataset.type; - values = Filter.values(type, Filter.menu.post); - res = values.map(function(value) { - var re; - re = type === 'uniqueID' || type === 'MD5' ? value : Filter.escape(value); - if (type === 'uniqueID' || type === 'MD5') { - return "/" + re + "/"; - } else { - return "/^" + re + "$/"; - } - }).join('\n'); - return Filter.addFilter(type, res, function() { - return Filter.showFilters(type); - }); - } - } - }; - - return Filter; - -}).call(this); - -PostHiding = (function() { - var PostHiding; - - PostHiding = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link'])) { - return; - } - if (Conf['Reply Hiding Buttons']) { - $.addClass(doc, "reply-hide"); - } - this.db = new DataBoard('hiddenPosts'); - return Callbacks.Post.push({ - name: 'Reply Hiding', - cb: this.node - }); - }, - isHidden: function(boardID, threadID, postID) { - return !!(PostHiding.db && PostHiding.db.get({ - boardID: boardID, - threadID: threadID, - postID: postID - })); - }, - node: function() { - var button, data, sa, sideArrows; - if (!this.isReply || this.isClone || this.isFetchedQuote) { - return; - } - if (data = PostHiding.db.get({ - boardID: this.board.ID, - threadID: this.thread.ID, - postID: this.ID - })) { - if (data.thisPost) { - PostHiding.hide(this, data.makeStub, data.hideRecursively); - } else { - Recursive.apply(PostHiding.hide, this, data.makeStub, true); - Recursive.add(PostHiding.hide, this, data.makeStub, true); - } - } - if (!Conf['Reply Hiding Buttons']) { - return; - } - button = PostHiding.makeButton(this, 'hide'); - if ((sa = g.SITE.selectors.sideArrows)) { - sideArrows = $(sa, this.nodes.root); - $.replace(sideArrows.firstChild, button); - return sideArrows.className = 'replacedSideArrows'; - } else { - return $.prepend(this.nodes.info, button); - } - }, - menu: { - init: function() { - var apply, div, hideStubLink, makeStub, ref, replies, thisPost; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Menu'] || !Conf['Reply Hiding Link']) { - return; - } - div = $.el('div', { - className: 'hide-reply-link', - textContent: 'Hide' - }); - apply = $.el('a', { - textContent: 'Apply', - href: 'javascript:;' - }); - $.on(apply, 'click', PostHiding.menu.hide); - thisPost = UI.checkbox('thisPost', 'This post', true); - replies = UI.checkbox('replies', 'Hide replies', Conf['Recursive Hiding']); - makeStub = UI.checkbox('makeStub', 'Make stub', Conf['Stubs']); - Menu.menu.addEntry({ - el: div, - order: 20, - open: function(post) { - if (!post.isReply || post.isClone || post.isHidden) { - return false; - } - PostHiding.menu.post = post; - return true; - }, - subEntries: [ - { - el: apply - }, { - el: thisPost - }, { - el: replies - }, { - el: makeStub - } - ] - }); - div = $.el('div', { - className: 'show-reply-link', - textContent: 'Show' - }); - apply = $.el('a', { - textContent: 'Apply', - href: 'javascript:;' - }); - $.on(apply, 'click', PostHiding.menu.show); - thisPost = UI.checkbox('thisPost', 'This post', false); - replies = UI.checkbox('replies', 'Show replies', false); - hideStubLink = $.el('a', { - textContent: 'Hide stub', - href: 'javascript:;' - }); - $.on(hideStubLink, 'click', PostHiding.menu.hideStub); - Menu.menu.addEntry({ - el: div, - order: 20, - open: function(post) { - var data; - if (!post.isReply || post.isClone || !post.isHidden) { - return false; - } - if (!(data = PostHiding.db.get({ - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID - }))) { - return false; - } - PostHiding.menu.post = post; - thisPost.firstChild.checked = post.isHidden; - replies.firstChild.checked = (data != null ? data.hideRecursively : void 0) != null ? data.hideRecursively : Conf['Recursive Hiding']; - return true; - }, - subEntries: [ - { - el: apply - }, { - el: thisPost - }, { - el: replies - } - ] - }); - return Menu.menu.addEntry({ - el: hideStubLink, - order: 15, - open: function(post) { - var data; - if (!post.isReply || post.isClone || !post.isHidden) { - return false; - } - if (!(data = PostHiding.db.get({ - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID - }))) { - return false; - } - return PostHiding.menu.post = post; - } - }); - }, - hide: function() { - var makeStub, parent, post, replies, thisPost; - parent = this.parentNode; - thisPost = $('input[name=thisPost]', parent).checked; - replies = $('input[name=replies]', parent).checked; - makeStub = $('input[name=makeStub]', parent).checked; - post = PostHiding.menu.post; - if (thisPost) { - PostHiding.hide(post, makeStub, replies); - } else if (replies) { - Recursive.apply(PostHiding.hide, post, makeStub, true); - Recursive.add(PostHiding.hide, post, makeStub, true); - } else { - return; - } - PostHiding.saveHiddenState(post, true, thisPost, makeStub, replies); - return $.event('CloseMenu'); - }, - show: function() { - var data, parent, post, replies, thisPost; - parent = this.parentNode; - thisPost = $('input[name=thisPost]', parent).checked; - replies = $('input[name=replies]', parent).checked; - post = PostHiding.menu.post; - if (thisPost) { - PostHiding.show(post, replies); - } else if (replies) { - Recursive.apply(PostHiding.show, post, true); - Recursive.rm(PostHiding.hide, post, true); - } else { - return; - } - if (data = PostHiding.db.get({ - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID - })) { - PostHiding.saveHiddenState(post, !(thisPost && replies), !thisPost, data.makeStub, !replies); - } - return $.event('CloseMenu'); - }, - hideStub: function() { - var data, post; - post = PostHiding.menu.post; - if (data = PostHiding.db.get({ - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID - })) { - PostHiding.show(post, data.hideRecursively); - PostHiding.hide(post, false, data.hideRecursively); - PostHiding.saveHiddenState(post, true, true, false, data.hideRecursively); - } - $.event('CloseMenu'); - } - }, - makeButton: function(post, type) { - var a, span; - span = $.el('span', { - className: "fa fa-" + (type === 'hide' ? 'minus' : 'plus') + "-square-o", - textContent: "" - }); - a = $.el('a', { - className: type + "-reply-button", - href: 'javascript:;' - }); - $.add(a, span); - $.on(a, 'click', PostHiding.toggle); - return a; - }, - saveHiddenState: function(post, isHiding, thisPost, makeStub, hideRecursively) { - var data; - data = { - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID - }; - if (isHiding) { - data.val = { - thisPost: thisPost !== false, - makeStub: makeStub, - hideRecursively: hideRecursively - }; - return PostHiding.db.set(data); - } else { - return PostHiding.db["delete"](data); - } - }, - toggle: function() { - var post; - post = Get.postFromNode(this); - PostHiding[(post.isHidden ? 'show' : 'hide')](post); - return PostHiding.saveHiddenState(post, post.isHidden); - }, - hide: function(post, makeStub, hideRecursively) { - var a, i, len, quotelink, ref; - if (makeStub == null) { - makeStub = Conf['Stubs']; - } - if (hideRecursively == null) { - hideRecursively = Conf['Recursive Hiding']; - } - if (post.isHidden) { - return; - } - post.isHidden = true; - if (hideRecursively) { - Recursive.apply(PostHiding.hide, post, makeStub, true); - Recursive.add(PostHiding.hide, post, makeStub, true); - } - ref = Get.allQuotelinksLinkingTo(post); - for (i = 0, len = ref.length; i < len; i++) { - quotelink = ref[i]; - $.addClass(quotelink, 'filtered'); - } - if (!makeStub) { - post.nodes.root.hidden = true; - return; - } - a = PostHiding.makeButton(post, 'show'); - $.add(a, $.tn(" " + post.info.nameBlock)); - post.nodes.stub = $.el('div', { - className: 'stub' - }); - $.add(post.nodes.stub, a); - if (Conf['Menu']) { - $.add(post.nodes.stub, Menu.makeButton(post)); - } - return $.prepend(post.nodes.root, post.nodes.stub); - }, - show: function(post, showRecursively) { - var i, len, quotelink, ref; - if (showRecursively == null) { - showRecursively = Conf['Recursive Hiding']; - } - if (post.nodes.stub) { - $.rm(post.nodes.stub); - delete post.nodes.stub; - } else { - post.nodes.root.hidden = false; - } - post.isHidden = false; - if (showRecursively) { - Recursive.apply(PostHiding.show, post, true); - Recursive.rm(PostHiding.hide, post); - } - ref = Get.allQuotelinksLinkingTo(post); - for (i = 0, len = ref.length; i < len; i++) { - quotelink = ref[i]; - $.rmClass(quotelink, 'filtered'); - } - } - }; - - return PostHiding; - -}).call(this); - -Recursive = (function() { - var Recursive, - slice = [].slice, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Recursive = { - recursives: $.dict(), - init: function() { - var ref; - if ((ref = g.VIEW) !== 'index' && ref !== 'thread') { - return; - } - return Callbacks.Post.push({ - name: 'Recursive', - cb: this.node - }); - }, - node: function() { - var i, j, k, len, len1, obj, quote, recursive, ref, ref1; - if (this.isClone || this.isFetchedQuote) { - return; - } - ref = this.quotes; - for (j = 0, len = ref.length; j < len; j++) { - quote = ref[j]; - if (obj = Recursive.recursives[quote]) { - ref1 = obj.recursives; - for (i = k = 0, len1 = ref1.length; k < len1; i = ++k) { - recursive = ref1[i]; - recursive.apply(null, [this].concat(slice.call(obj.args[i]))); - } - } - } - }, - add: function() { - var args, base, name, obj, post, recursive; - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : []; - obj = (base = Recursive.recursives)[name = post.fullID] || (base[name] = { - recursives: [], - args: [] - }); - obj.recursives.push(recursive); - return obj.args.push(args); - }, - rm: function(recursive, post) { - var i, j, len, obj, rec, ref; - if (!(obj = Recursive.recursives[post.fullID])) { - return; - } - ref = obj.recursives; - for (i = j = 0, len = ref.length; j < len; i = ++j) { - rec = ref[i]; - if (!(rec === recursive)) { - continue; - } - obj.recursives.splice(i, 1); - obj.args.splice(i, 1); - } - }, - apply: function() { - var args, fullID, post, recursive; - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : []; - fullID = post.fullID; - return g.posts.forEach(function(post) { - if (indexOf.call(post.quotes, fullID) >= 0) { - return recursive.apply(null, [post].concat(slice.call(args))); - } - }); - } - }; - - return Recursive; - -}).call(this); - -ThreadHiding = (function() { - var ThreadHiding; - - ThreadHiding = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Index']) { - return; - } - this.db = new DataBoard('hiddenThreads'); - if (g.VIEW === 'catalog') { - return this.catalogWatch(); - } - this.catalogSet(g.BOARD); - $.on(d, 'IndexRefreshInternal', this.onIndexRefresh); - if (Conf['Thread Hiding Buttons']) { - $.addClass(doc, 'thread-hide'); - } - return Callbacks.Post.push({ - name: 'Thread Hiding', - cb: this.node - }); - }, - catalogSet: function(board) { - var hiddenThreads, threadID; - if (!($.hasStorage && g.SITE.software === 'yotsuba')) { - return; - } - hiddenThreads = ThreadHiding.db.get({ - boardID: board.ID, - defaultValue: $.dict() - }); - for (threadID in hiddenThreads) { - hiddenThreads[threadID] = true; - } - return localStorage.setItem("4chan-hide-t-" + board, JSON.stringify(hiddenThreads)); - }, - catalogWatch: function() { - if (!($.hasStorage && g.SITE.software === 'yotsuba')) { - return; - } - this.hiddenThreads = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {}; - return Main.ready(function() { - return new MutationObserver(ThreadHiding.catalogSave).observe($.id('threads'), { - attributes: true, - subtree: true, - attributeFilter: ['style'] - }); - }); - }, - catalogSave: function() { - var hiddenThreads2, threadID; - hiddenThreads2 = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {}; - for (threadID in hiddenThreads2) { - if (!$.hasOwn(ThreadHiding.hiddenThreads, threadID)) { - ThreadHiding.db.set({ - boardID: g.BOARD.ID, - threadID: threadID, - val: { - makeStub: Conf['Stubs'] - } - }); - } - } - for (threadID in ThreadHiding.hiddenThreads) { - if (!$.hasOwn(hiddenThreads2, threadID)) { - ThreadHiding.db["delete"]({ - boardID: g.BOARD.ID, - threadID: threadID - }); - } - } - return ThreadHiding.hiddenThreads = hiddenThreads2; - }, - isHidden: function(boardID, threadID) { - return !!(ThreadHiding.db && ThreadHiding.db.get({ - boardID: boardID, - threadID: threadID - })); - }, - node: function() { - var data; - if (this.isReply || this.isClone || this.isFetchedQuote) { - return; - } - if (Conf['Thread Hiding Buttons']) { - $.prepend(this.nodes.root, ThreadHiding.makeButton(this.thread, 'hide')); - } - if (data = ThreadHiding.db.get({ - boardID: this.board.ID, - threadID: this.ID - })) { - return ThreadHiding.hide(this.thread, data.makeStub); - } - }, - onIndexRefresh: function() { - return g.BOARD.threads.forEach(function(thread) { - var root; - root = thread.nodes.root; - if (thread.isHidden && thread.stub && !root.contains(thread.stub)) { - return ThreadHiding.makeStub(thread, root); - } - }); - }, - menu: { - init: function() { - var apply, div, hideStubLink, makeStub; - if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) { - return; - } - div = $.el('div', { - className: 'hide-thread-link', - textContent: 'Hide' - }); - apply = $.el('a', { - textContent: 'Apply', - href: 'javascript:;' - }); - $.on(apply, 'click', ThreadHiding.menu.hide); - makeStub = UI.checkbox('Stubs', 'Make stub'); - Menu.menu.addEntry({ - el: div, - order: 20, - open: function(arg) { - var isReply, thread; - thread = arg.thread, isReply = arg.isReply; - if (isReply || thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') { - return false; - } - ThreadHiding.menu.thread = thread; - return true; - }, - subEntries: [ - { - el: apply - }, { - el: makeStub - } - ] - }); - div = $.el('a', { - className: 'show-thread-link', - textContent: 'Show', - href: 'javascript:;' - }); - $.on(div, 'click', ThreadHiding.menu.show); - Menu.menu.addEntry({ - el: div, - order: 20, - open: function(arg) { - var isReply, thread; - thread = arg.thread, isReply = arg.isReply; - if (isReply || !thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') { - return false; - } - ThreadHiding.menu.thread = thread; - return true; - } - }); - hideStubLink = $.el('a', { - textContent: 'Hide stub', - href: 'javascript:;' - }); - $.on(hideStubLink, 'click', ThreadHiding.menu.hideStub); - return Menu.menu.addEntry({ - el: hideStubLink, - order: 15, - open: function(arg) { - var isReply, thread; - thread = arg.thread, isReply = arg.isReply; - if (isReply || !thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') { - return false; - } - return ThreadHiding.menu.thread = thread; - } - }); - }, - hide: function() { - var makeStub, thread; - makeStub = $('input', this.parentNode).checked; - thread = ThreadHiding.menu.thread; - ThreadHiding.hide(thread, makeStub); - ThreadHiding.saveHiddenState(thread, makeStub); - return $.event('CloseMenu'); - }, - show: function() { - var thread; - thread = ThreadHiding.menu.thread; - ThreadHiding.show(thread); - ThreadHiding.saveHiddenState(thread); - return $.event('CloseMenu'); - }, - hideStub: function() { - var thread; - thread = ThreadHiding.menu.thread; - ThreadHiding.show(thread); - ThreadHiding.hide(thread, false); - ThreadHiding.saveHiddenState(thread, false); - $.event('CloseMenu'); - } - }, - makeButton: function(thread, type) { - var a; - a = $.el('a', { - className: type + "-thread-button", - href: 'javascript:;' - }); - $.extend(a, {innerHTML: ""}); - a.dataset.fullID = thread.fullID; - $.on(a, 'click', ThreadHiding.toggle); - return a; - }, - makeStub: function(thread, root) { - var a, numReplies, summary, threadDivider; - numReplies = $$(g.SITE.selectors.replyOriginal, root).length; - if (summary = $(g.SITE.selectors.summary, root)) { - numReplies += +summary.textContent.match(/\d+/); - } - a = ThreadHiding.makeButton(thread, 'show'); - $.add(a, $.tn(" " + thread.OP.info.nameBlock + " (" + (numReplies === 1 ? '1 reply' : numReplies + " replies") + ")")); - thread.stub = $.el('div', { - className: 'stub' - }); - if (Conf['Menu']) { - $.add(thread.stub, [a, Menu.makeButton(thread.OP)]); - } else { - $.add(thread.stub, a); - } - $.prepend(root, thread.stub); - if ((threadDivider = $(g.SITE.selectors.threadDivider, root))) { - return $.addClass(threadDivider, 'threadDivider'); - } - }, - saveHiddenState: function(thread, makeStub) { - if (thread.isHidden) { - ThreadHiding.db.set({ - boardID: thread.board.ID, - threadID: thread.ID, - val: { - makeStub: makeStub - } - }); - } else { - ThreadHiding.db["delete"]({ - boardID: thread.board.ID, - threadID: thread.ID - }); - } - return ThreadHiding.catalogSet(thread.board); - }, - toggle: function(thread) { - if (!(thread instanceof Thread)) { - thread = g.threads.get(this.dataset.fullID); - } - if (thread.isHidden) { - ThreadHiding.show(thread); - } else { - ThreadHiding.hide(thread); - } - return ThreadHiding.saveHiddenState(thread); - }, - hide: function(thread, makeStub) { - var threadRoot; - if (makeStub == null) { - makeStub = Conf['Stubs']; - } - if (thread.isHidden) { - return; - } - threadRoot = thread.nodes.root; - thread.isHidden = true; - Index.updateHideLabel(); - if (thread.catalogView && !Index.showHiddenThreads) { - $.rm(thread.catalogView.nodes.root); - $.event('PostsRemoved', null, Index.root); - } - if (!makeStub) { - return threadRoot.hidden = true; - } - return ThreadHiding.makeStub(thread, threadRoot); - }, - show: function(thread) { - var threadRoot; - if (thread.stub) { - $.rm(thread.stub); - delete thread.stub; - } - threadRoot = thread.nodes.root; - threadRoot.hidden = thread.isHidden = false; - Index.updateHideLabel(); - if (thread.catalogView && Index.showHiddenThreads) { - $.rm(thread.catalogView.nodes.root); - return $.event('PostsRemoved', null, Index.root); - } - } - }; - - return ThreadHiding; - -}).call(this); - -BoardConfig = (function() { - var BoardConfig; - - BoardConfig = { - cbs: [], - init: function() { - var boards, now, ref; - if (g.SITE.software !== 'yotsuba') { - return; - } - now = Date.now(); - if (!((now - 2 * $.HOUR < (ref = Conf['boardConfig'].lastChecked || 0) && ref <= now))) { - return $.ajax(location.protocol + "//a.4cdn.org/boards.json", { - onloadend: this.load - }); - } else { - boards = Conf['boardConfig'].boards; - return this.set(boards); - } - }, - load: function() { - var board, boards, err, i, len, ref; - if (this.status === 200 && this.response && this.response.boards) { - boards = $.dict(); - ref = this.response.boards; - for (i = 0, len = ref.length; i < len; i++) { - board = ref[i]; - boards[board.board] = board; - } - $.set('boardConfig', { - boards: boards, - lastChecked: Date.now() - }); - } else { - boards = Conf['boardConfig'].boards; - err = (function() { - switch (this.status) { - case 0: - return 'Connection Error'; - case 200: - return 'Invalid Data'; - default: - return "Error " + this.statusText + " (" + this.status + ")"; - } - }).call(this); - new Notice('warning', "Failed to load board configuration. " + err, 20); - } - return BoardConfig.set(boards); - }, - set: function(boards1) { - var ID, board, cb, i, len, ref, ref1; - this.boards = boards1; - ref = g.boards; - for (ID in ref) { - board = ref[ID]; - board.config = this.boards[ID] || {}; - } - ref1 = this.cbs; - for (i = 0, len = ref1.length; i < len; i++) { - cb = ref1[i]; - $.queueTask(cb); - } - }, - ready: function(cb) { - if (this.boards) { - return cb(); - } else { - return this.cbs.push(cb); - } - }, - sfwBoards: function(sfw) { - var board, data, ref, results; - ref = this.boards || Conf['boardConfig'].boards; - results = []; - for (board in ref) { - data = ref[board]; - if (!!data.ws_board === sfw) { - results.push(board); - } - } - return results; - }, - isSFW: function(board) { - var ref; - return !!((ref = (this.boards || Conf['boardConfig'].boards)[board]) != null ? ref.ws_board : void 0); - }, - domain: function(board) { - return "boards." + (BoardConfig.isSFW(board) ? '4channel' : '4chan') + ".org"; - }, - isArchived: function(board) { - var data; - data = (this.boards || Conf['boardConfig'].boards)[board]; - return !data || data.is_archived; - }, - noAudio: function(boardID) { - var boards; - if (g.SITE.software !== 'yotsuba') { - return false; - } - boards = this.boards || Conf['boardConfig'].boards; - return boards && boards[boardID] && !boards[boardID].webm_audio; - }, - title: function(boardID) { - var ref, ref1; - return ((ref = this.boards || Conf['boardConfig'].boards) != null ? (ref1 = ref[boardID]) != null ? ref1.title : void 0 : void 0) || ''; - } - }; - - return BoardConfig; - -}).call(this); - -Get = (function() { - var Get, - slice = [].slice, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Get = { - url: function() { - var IDs, args, f, site, type; - type = arguments[0], IDs = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : []; - if ((site = g.sites[IDs.siteID]) && (f = $.getOwn(site.urls, type))) { - return f.apply(null, [IDs].concat(slice.call(args))); - } else { - return void 0; - } - }, - threadExcerpt: function(thread) { - var OP, excerpt, ref, ref1; - OP = thread.OP; - excerpt = ("/" + (decodeURIComponent(thread.board.ID)) + "/ - ") + (((ref = OP.info.subject) != null ? ref.trim() : void 0) || OP.commentDisplay().replace(/\n+/g, ' // ') || ((ref1 = OP.file) != null ? ref1.name : void 0) || ("No." + OP)); - if (excerpt.length > 73) { - return excerpt.slice(0, 70) + "..."; - } - return excerpt; - }, - threadFromRoot: function(root) { - var board; - if (root == null) { - return null; - } - board = root.dataset.board; - return g.threads.get((board ? encodeURIComponent(board) : g.BOARD.ID) + "." + (root.id.match(/\d*$/)[0])); - }, - threadFromNode: function(node) { - return Get.threadFromRoot($.x("ancestor-or-self::" + g.SITE.xpath.thread, node)); - }, - postFromRoot: function(root) { - var index, post; - if (root == null) { - return null; - } - post = g.posts.get(root.dataset.fullID); - index = root.dataset.clone; - if (index) { - return post.clones[+index]; - } else { - return post; - } - }, - postFromNode: function(root) { - return Get.postFromRoot($.x("ancestor-or-self::" + g.SITE.xpath.postContainer + "[1]", root)); - }, - postDataFromLink: function(link) { - var boardID, match, postID, ref, ref1, threadID; - if (link.dataset.postID) { - ref = link.dataset, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID; - threadID || (threadID = 0); - } else { - match = link.href.match(g.SITE.regexp.quotelink); - ref1 = match.slice(1), boardID = ref1[0], threadID = ref1[1], postID = ref1[2]; - postID || (postID = threadID); - } - return { - boardID: boardID, - threadID: +threadID, - postID: +postID - }; - }, - allQuotelinksLinkingTo: function(post) { - var fullID, handleQuotes, i, len, posts, qPost, quote, quotelinks, ref; - quotelinks = []; - posts = g.posts; - fullID = post.fullID; - handleQuotes = function(qPost, type) { - var clone, i, len, ref; - quotelinks.push.apply(quotelinks, qPost.nodes[type]); - ref = qPost.clones; - for (i = 0, len = ref.length; i < len; i++) { - clone = ref[i]; - quotelinks.push.apply(quotelinks, clone.nodes[type]); - } - }; - posts.forEach(function(qPost) { - if (indexOf.call(qPost.quotes, fullID) >= 0) { - return handleQuotes(qPost, 'quotelinks'); - } - }); - if (Conf['Quote Backlinks']) { - ref = post.quotes; - for (i = 0, len = ref.length; i < len; i++) { - quote = ref[i]; - if (qPost = posts.get(quote)) { - handleQuotes(qPost, 'backlinks'); - } - } - } - return quotelinks.filter(function(quotelink) { - var boardID, postID, ref1; - ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID; - return boardID === post.board.ID && postID === post.ID; - }); - } - }; - - return Get; - -}).call(this); - -Header = (function() { - var Header, - slice = [].slice; - - Header = { - init: function() { - var barFixedToggler, barPositionToggler, box, cs, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, menuButton, scrollHeaderToggler, shortcutToggler; - $.onExists(doc, 'body', (function(_this) { - return function() { - if (!Main.isThisPageLegit()) { - return; - } - $.add(_this.bar, [_this.noticesRoot, _this.toggle]); - $.prepend(d.body, _this.bar); - $.add(d.body, Header.hover); - return _this.setBarPosition(Conf['Bottom Header']); - }; - })(this)); - this.menu = new UI.Menu('header'); - menuButton = $.el('span', { - className: 'menu-button' - }); - $.extend(menuButton, {innerHTML: ""}); - box = UI.checkbox; - barFixedToggler = box('Fixed Header', 'Fixed Header'); - headerToggler = box('Header auto-hide', 'Auto-hide header'); - scrollHeaderToggler = box('Header auto-hide on scroll', 'Auto-hide header on scroll'); - barPositionToggler = box('Bottom Header', 'Bottom header'); - linkJustifyToggler = box('Centered links', 'Centered links'); - customNavToggler = box('Custom Board Navigation', 'Custom board navigation'); - footerToggler = box('Bottom Board List', 'Hide bottom board list'); - shortcutToggler = box('Shortcut Icons', 'Shortcut Icons'); - editCustomNav = $.el('a', { - textContent: 'Edit custom board navigation', - href: 'javascript:;' - }); - this.barFixedToggler = barFixedToggler.firstElementChild; - this.scrollHeaderToggler = scrollHeaderToggler.firstElementChild; - this.barPositionToggler = barPositionToggler.firstElementChild; - this.linkJustifyToggler = linkJustifyToggler.firstElementChild; - this.headerToggler = headerToggler.firstElementChild; - this.footerToggler = footerToggler.firstElementChild; - this.shortcutToggler = shortcutToggler.firstElementChild; - this.customNavToggler = customNavToggler.firstElementChild; - $.on(menuButton, 'click', this.menuToggle); - $.on(this.headerToggler, 'change', this.toggleBarVisibility); - $.on(this.barFixedToggler, 'change', this.toggleBarFixed); - $.on(this.barPositionToggler, 'change', this.toggleBarPosition); - $.on(this.scrollHeaderToggler, 'change', this.toggleHideBarOnScroll); - $.on(this.linkJustifyToggler, 'change', this.toggleLinkJustify); - $.on(this.footerToggler, 'change', this.toggleFooterVisibility); - $.on(this.shortcutToggler, 'change', this.toggleShortcutIcons); - $.on(this.customNavToggler, 'change', this.toggleCustomNav); - $.on(editCustomNav, 'click', this.editCustomNav); - this.setBarFixed(Conf['Fixed Header']); - this.setHideBarOnScroll(Conf['Header auto-hide on scroll']); - this.setBarVisibility(Conf['Header auto-hide']); - this.setLinkJustify(Conf['Centered links']); - this.setShortcutIcons(Conf['Shortcut Icons']); - this.setFooterVisibility(Conf['Bottom Board List']); - $.sync('Fixed Header', this.setBarFixed); - $.sync('Header auto-hide on scroll', this.setHideBarOnScroll); - $.sync('Bottom Header', this.setBarPosition); - $.sync('Shortcut Icons', this.setShortcutIcons); - $.sync('Header auto-hide', this.setBarVisibility); - $.sync('Centered links', this.setLinkJustify); - $.sync('Bottom Board List', this.setFooterVisibility); - this.addShortcut('menu', menuButton, 900); - this.menu.addEntry({ - el: $.el('span', { - textContent: 'Header' - }), - order: 107, - subEntries: [ - { - el: barFixedToggler - }, { - el: headerToggler - }, { - el: scrollHeaderToggler - }, { - el: barPositionToggler - }, { - el: linkJustifyToggler - }, { - el: footerToggler - }, { - el: shortcutToggler - }, { - el: customNavToggler - }, { - el: editCustomNav - } - ] - }); - $.on(window, 'load popstate', Header.hashScroll); - $.on(d, 'CreateNotification', this.createNotification); - this.setBoardList(); - $.onExists(doc, g.SITE.selectors.boardList + " + *", Header.generateFullBoardList); - Main.ready(function() { - var a, absbot, footer, i, len, ref; - if (g.SITE.software === 'yotsuba' && !(footer = $.id('boardNavDesktopFoot'))) { - if (!(absbot = $.id('absbot'))) { - return; - } - footer = $.id('boardNavDesktop').cloneNode(true); - footer.id = 'boardNavDesktopFoot'; - $('#navtopright', footer).id = 'navbotright'; - $('#settingsWindowLink', footer).id = 'settingsWindowLinkBot'; - $.before(absbot, footer); - $.global(function() { - return window.cloneTopNav = function() {}; - }); - } - if ((Header.bottomBoardList = $(g.SITE.selectors.boardListBottom))) { - ref = $$('a', Header.bottomBoardList); - for (i = 0, len = ref.length; i < len; i++) { - a = ref[i]; - if (a.hostname === location.hostname && a.pathname.split('/')[1] === g.BOARD.ID) { - a.className = 'current'; - } - } - return CatalogLinks.setLinks(Header.bottomBoardList); - } - }); - if (g.SITE.software === 'yotsuba' && (g.VIEW === 'catalog' || !Conf['Disable Native Extension'])) { - cs = $.el('a', { - href: 'javascript:;' - }); - if (g.VIEW === 'catalog') { - cs.title = cs.textContent = 'Catalog Settings'; - cs.className = 'fa fa-book'; - } else { - cs.title = cs.textContent = '4chan Settings'; - cs.className = 'native-settings'; - } - $.on(cs, 'click', function() { - return $.id('settingsWindowLink').click(); - }); - this.addShortcut('native', cs, 810); - } - return this.enableDesktopNotifications(); - }, - bar: $.el('div', { - id: 'header-bar' - }), - noticesRoot: $.el('div', { - id: 'notifications' - }), - shortcuts: $.el('span', { - id: 'shortcuts' - }), - hover: $.el('div', { - id: 'hoverUI' - }), - toggle: $.el('div', { - id: 'scroll-marker' - }), - setBoardList: function() { - var boardList, btn; - Header.boardList = boardList = $.el('span', { - id: 'board-list' - }); - $.extend(boardList, {innerHTML: ""}); - btn = $('.hide-board-list-button', boardList); - $.on(btn, 'click', Header.toggleBoardList); - $.prepend(Header.bar, [Header.boardList, Header.shortcuts]); - Header.setCustomNav(Conf['Custom Board Navigation']); - Header.generateBoardList(Conf['boardnav']); - $.sync('Custom Board Navigation', Header.setCustomNav); - return $.sync('boardnav', Header.generateBoardList); - }, - generateFullBoardList: function() { - var a, fullBoardList, i, len, nodes, ref; - if (g.SITE.transformBoardList) { - nodes = g.SITE.transformBoardList(); - } else { - nodes = slice.call($(g.SITE.selectors.boardList).cloneNode(true).childNodes); - } - fullBoardList = $('.boardList', Header.boardList); - $.add(fullBoardList, nodes); - ref = $$('a', fullBoardList); - for (i = 0, len = ref.length; i < len; i++) { - a = ref[i]; - if (a.hostname === location.hostname && a.pathname.split('/')[1] === g.BOARD.ID) { - a.className = 'current'; - } - } - return CatalogLinks.setLinks(fullBoardList); - }, - generateBoardList: function(boardnav) { - var list, nodes, re, t; - list = $('#custom-board-list', Header.boardList); - $.rmAll(list); - if (!boardnav) { - return; - } - boardnav = boardnav.replace(/(\r\n|\n|\r)/g, ' '); - re = /[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|nt|(mode|sort|text):"[^"]+"(,"[^"]+")?))*|[^\w@]+/g; - nodes = (function() { - var i, len, ref, results; - ref = boardnav.match(re); - results = []; - for (i = 0, len = ref.length; i < len; i++) { - t = ref[i]; - results.push(Header.mapCustomNavigation(t)); - } - return results; - })(); - $.add(list, nodes); - return CatalogLinks.setLinks(list); - }, - mapCustomNavigation: function(t) { - var a, boardID, href, indexOptions, m, ref, ref1, text, url, urlIC; - if (/^[^\w@]/.test(t)) { - return $.tn(t); - } - text = url = null; - t = t.replace(/-text:"([^"]+)"(?:,"([^"]+)")?/g, function(m0, m1, m2) { - text = m1; - url = m2; - return ''; - }); - indexOptions = []; - t = t.replace(/-(?:mode|sort):"([^"]+)"/g, function(m0, m1) { - indexOptions.push(m1.toLowerCase().replace(/\ /g, '-')); - return ''; - }); - indexOptions = indexOptions.join('/'); - if (/^toggle-all/.test(t)) { - a = $.el('a', { - className: 'show-board-list-button', - textContent: text || '+', - href: 'javascript:;' - }); - $.on(a, 'click', Header.toggleBoardList); - return a; - } - if (/^external/.test(t)) { - a = $.el('a', { - href: url || 'javascript:;', - textContent: text || '+', - className: 'external' - }); - if (/-nt/.test(t)) { - a.target = '_blank'; - a.rel = 'noopener'; - } - return a; - } - boardID = t.split('-')[0]; - if (boardID === 'current') { - if ((ref = location.hostname) === 'boards.4chan.org' || ref === 'boards.4channel.org') { - boardID = g.BOARD.ID; - } else { - a = $.el('a', { - href: "/" + g.BOARD.ID + "/", - textContent: text || decodeURIComponent(g.BOARD.ID), - className: 'current' - }); - if (/-nt/.test(t)) { - a.target = '_blank'; - a.rel = 'noopener'; - } - if (/-index/.test(t)) { - a.dataset.only = 'index'; - } else if (/-catalog/.test(t)) { - a.dataset.only = 'catalog'; - a.href += 'catalog.html'; - } else if (/-(archive|expired)/.test(t)) { - a = a.firstChild; - } - return a; - } - } - a = (function() { - var ref1, urlV; - if (boardID === '@') { - return $.el('a', { - href: 'https://twitter.com/4chan', - title: '4chan Twitter', - textContent: '@' - }); - } - a = $.el('a', { - href: "//" + (BoardConfig.domain(boardID)) + "/" + boardID + "/", - textContent: boardID, - title: BoardConfig.title(boardID) - }); - if (((ref1 = g.VIEW) === 'catalog' || ref1 === 'archive') && (urlV = Get.url(g.VIEW, { - siteID: '4chan.org', - boardID: boardID - }))) { - a.href = urlV; - } - if (a.hostname === location.hostname && boardID === g.BOARD.ID) { - a.className = 'current'; - } - return a; - })(); - a.textContent = /-title/.test(t) || /-replace/.test(t) && a.hostname === location.hostname && boardID === g.BOARD.ID ? a.title || a.textContent : /-full/.test(t) ? ("/" + boardID + "/") + (a.title ? " - " + a.title : '') : text || boardID; - if (m = t.match(/-(index|catalog)/)) { - urlIC = CatalogLinks[m[1]]({ - siteID: '4chan.org', - boardID: boardID - }); - if (urlIC) { - a.dataset.only = m[1]; - a.href = urlIC; - if (m[1] === 'catalog') { - $.addClass(a, 'catalog'); - } - } else { - return a.firstChild; - } - } - if (Conf['JSON Index'] && indexOptions) { - a.dataset.indexOptions = indexOptions; - if (((ref1 = a.hostname) === 'boards.4chan.org' || ref1 === 'boards.4channel.org') && a.pathname.split('/')[2] === '') { - a.href += (a.hash ? '/' : '#') + indexOptions; - } - } - if (/-archive/.test(t)) { - if (href = Redirect.to('board', { - boardID: boardID - })) { - a.href = href; - } else { - return a.firstChild; - } - } - if (/-expired/.test(t)) { - if (BoardConfig.isArchived(boardID)) { - a.href = "//" + (BoardConfig.domain(boardID)) + "/" + boardID + "/archive"; - } else { - return a.firstChild; - } - } - if (/-nt/.test(t)) { - a.target = '_blank'; - a.rel = 'noopener'; - } - if (boardID === '@') { - $.addClass(a, 'navSmall'); - } - return a; - }, - toggleBoardList: function() { - var bar, custom, full, showBoardList; - bar = Header.bar; - custom = $('#custom-board-list', bar); - full = $('#full-board-list', bar); - showBoardList = !full.hidden; - custom.hidden = !showBoardList; - return full.hidden = showBoardList; - }, - setLinkJustify: function(centered) { - Header.linkJustifyToggler.checked = centered; - if (centered) { - return $.addClass(doc, 'centered-links'); - } else { - return $.rmClass(doc, 'centered-links'); - } - }, - toggleLinkJustify: function() { - var centered; - $.event('CloseMenu'); - centered = this.nodeName === 'INPUT' ? this.checked : void 0; - Header.setLinkJustify(centered); - return $.set('Centered links', centered); - }, - setBarFixed: function(fixed) { - Header.barFixedToggler.checked = fixed; - if (fixed) { - $.addClass(doc, 'fixed'); - return $.addClass(Header.bar, 'dialog'); - } else { - $.rmClass(doc, 'fixed'); - return $.rmClass(Header.bar, 'dialog'); - } - }, - toggleBarFixed: function() { - $.event('CloseMenu'); - Header.setBarFixed(this.checked); - Conf['Fixed Header'] = this.checked; - return $.set('Fixed Header', this.checked); - }, - setShortcutIcons: function(show) { - Header.shortcutToggler.checked = show; - if (show) { - return $.addClass(doc, 'shortcut-icons'); - } else { - return $.rmClass(doc, 'shortcut-icons'); - } - }, - toggleShortcutIcons: function() { - $.event('CloseMenu'); - Header.setShortcutIcons(this.checked); - Conf['Shortcut Icons'] = this.checked; - return $.set('Shortcut Icons', this.checked); - }, - setBarVisibility: function(hide) { - Header.headerToggler.checked = hide; - $.event('CloseMenu'); - (hide ? $.addClass : $.rmClass)(Header.bar, 'autohide'); - return (hide ? $.addClass : $.rmClass)(doc, 'autohide'); - }, - toggleBarVisibility: function() { - var hide, message; - hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide'); - Conf['Header auto-hide'] = hide; - $.set('Header auto-hide', hide); - Header.setBarVisibility(hide); - message = "The header bar will " + (hide ? 'automatically hide itself.' : 'remain visible.'); - return new Notice('info', message, 2); - }, - setHideBarOnScroll: function(hide) { - Header.scrollHeaderToggler.checked = hide; - if (hide) { - $.on(window, 'scroll', Header.hideBarOnScroll); - return; - } - $.off(window, 'scroll', Header.hideBarOnScroll); - $.rmClass(Header.bar, 'scroll'); - return Header.bar.classList.toggle('autohide', Conf['Header auto-hide']); - }, - toggleHideBarOnScroll: function() { - var hide; - hide = this.checked; - $.cb.checked.call(this); - return Header.setHideBarOnScroll(hide); - }, - hideBarOnScroll: function() { - var offsetY; - offsetY = window.pageYOffset; - if (offsetY > (Header.previousOffset || 0)) { - $.addClass(Header.bar, 'autohide', 'scroll'); - } else { - $.rmClass(Header.bar, 'autohide', 'scroll'); - } - return Header.previousOffset = offsetY; - }, - setBarPosition: function(bottom) { - var args, ref; - if ((ref = Header.barPositionToggler) != null) { - ref.checked = bottom; - } - $.event('CloseMenu'); - args = bottom ? ['bottom-header', 'top-header', 'after'] : ['top-header', 'bottom-header', 'add']; - $.addClass(doc, args[0]); - $.rmClass(doc, args[1]); - return $[args[2]](Header.bar, Header.noticesRoot); - }, - toggleBarPosition: function() { - $.cb.checked.call(this); - return Header.setBarPosition(this.checked); - }, - setFooterVisibility: function(hide) { - Header.footerToggler.checked = hide; - return doc.classList.toggle('hide-bottom-board-list', hide); - }, - toggleFooterVisibility: function() { - var hide, message; - $.event('CloseMenu'); - hide = this.nodeName === 'INPUT' ? this.checked : $.hasClass(doc, 'hide-bottom-board-list'); - Header.setFooterVisibility(hide); - $.set('Bottom Board List', hide); - message = hide ? 'The bottom navigation will now be hidden.' : 'The bottom navigation will remain visible.'; - return new Notice('info', message, 2); - }, - setCustomNav: function(show) { - var btn, cust, full, ref; - Header.customNavToggler.checked = show; - cust = $('#custom-board-list', Header.bar); - full = $('#full-board-list', Header.bar); - btn = $('.hide-board-list-container', full); - return ref = show ? [false, true, false] : [true, false, true], cust.hidden = ref[0], full.hidden = ref[1], btn.hidden = ref[2], ref; - }, - toggleCustomNav: function() { - $.cb.checked.call(this); - return Header.setCustomNav(this.checked); - }, - editCustomNav: function() { - var settings; - Settings.open('Advanced'); - settings = $.id('fourchanx-settings'); - return $('[name=boardnav]', settings).focus(); - }, - hashScroll: function(e) { - var el, hash; - if (e) { - if (e.state) { - return; - } - if (!history.state) { - history.replaceState({}, ''); - } - } - if ((hash = location.hash.slice(1))) { - ReplyPruning.showIfHidden(hash); - if ((el = $.id(hash))) { - return $.queueTask(function() { - return Header.scrollTo(el); - }); - } - } - }, - scrollTo: function(root, down, needed) { - var height, x; - if (!root.offsetParent) { - return; - } - if (down) { - x = Header.getBottomOf(root); - if (Conf['Fixed Header'] && Conf['Header auto-hide on scroll'] && Conf['Bottom header']) { - height = Header.bar.getBoundingClientRect().height; - if (x <= 0) { - if (!Header.isHidden()) { - x += height; - } - } else { - if (Header.isHidden()) { - x -= height; - } - } - } - if (!(needed && x >= 0)) { - return window.scrollBy(0, -x); - } - } else { - x = Header.getTopOf(root); - if (Conf['Fixed Header'] && Conf['Header auto-hide on scroll'] && !Conf['Bottom header']) { - height = Header.bar.getBoundingClientRect().height; - if (x >= 0) { - if (!Header.isHidden()) { - x += height; - } - } else { - if (Header.isHidden()) { - x -= height; - } - } - } - if (!(needed && x >= 0)) { - return window.scrollBy(0, x); - } - } - }, - scrollToIfNeeded: function(root, down) { - return Header.scrollTo(root, down, true); - }, - getTopOf: function(root) { - var headRect, top; - top = root.getBoundingClientRect().top; - if (Conf['Fixed Header'] && !Conf['Bottom Header']) { - headRect = Header.toggle.getBoundingClientRect(); - top -= headRect.top + headRect.height; - } - return top; - }, - getBottomOf: function(root) { - var bottom, clientHeight, headRect; - clientHeight = doc.clientHeight; - bottom = clientHeight - root.getBoundingClientRect().bottom; - if (Conf['Fixed Header'] && Conf['Bottom Header']) { - headRect = Header.toggle.getBoundingClientRect(); - bottom -= clientHeight - headRect.bottom + headRect.height; - } - return bottom; - }, - isNodeVisible: function(node) { - var height; - if (d.hidden || !doc.contains(node)) { - return false; - } - height = node.getBoundingClientRect().height; - return Header.getTopOf(node) + height >= 0 && Header.getBottomOf(node) + height >= 0; - }, - isHidden: function() { - var top; - top = Header.bar.getBoundingClientRect().top; - if (Conf['Bottom header']) { - return top === doc.clientHeight; - } else { - return top < 0; - } - }, - addShortcut: function(id, el, index) { - var i, item, len, ref, shortcut; - shortcut = $.el('span', { - id: "shortcut-" + id, - className: 'shortcut brackets-wrap' - }); - $.add(shortcut, el); - shortcut.dataset.index = index; - ref = $$('[data-index]', Header.shortcuts); - for (i = 0, len = ref.length; i < len; i++) { - item = ref[i]; - if (!(+item.dataset.index > +index)) { - continue; - } - $.before(item, shortcut); - return; - } - return $.add(Header.shortcuts, shortcut); - }, - rmShortcut: function(el) { - return $.rm(el.parentElement); - }, - menuToggle: function(e) { - return Header.menu.toggle(e, this, g); - }, - createNotification: function(e) { - var content, lifetime, notice, ref, type; - ref = e.detail, type = ref.type, content = ref.content, lifetime = ref.lifetime; - return notice = new Notice(type, content, lifetime); - }, - areNotificationsEnabled: false, - enableDesktopNotifications: function() { - var authorize, disable, el, notice, ref; - if (!(window.Notification && Conf['Desktop Notifications'])) { - return; - } - switch (Notification.permission) { - case 'granted': - Header.areNotificationsEnabled = true; - return; - case 'denied': - return; - } - el = $.el('span', {innerHTML: "4chan X needs your permission to show desktop notifications. [FAQ]
    or "}); - ref = $$('button', el), authorize = ref[0], disable = ref[1]; - $.on(authorize, 'click', function() { - return Notification.requestPermission(function(status) { - Header.areNotificationsEnabled = status === 'granted'; - if (status === 'default') { - return; - } - return notice.close(); - }); - }); - $.on(disable, 'click', function() { - $.set('Desktop Notifications', false); - return notice.close(); - }); - return notice = new Notice('info', el); - } - }; - - return Header; - -}).call(this); - -Index = (function() { - var Index, - slice = [].slice, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Index = { - showHiddenThreads: false, - changed: {}, - enabledOn: function(arg) { - var boardID, siteID; - siteID = arg.siteID, boardID = arg.boardID; - return Conf['JSON Index'] && g.sites[siteID].software === 'yotsuba' && boardID !== 'f'; - }, - init: function() { - var arr, entries, i, input, inputs, k, l, label, len1, len2, name, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, select, sortEntry, tRaw, watchSettings; - if (g.VIEW !== 'index') { - return; - } - $.one(d, '4chanXInitFinished', this.cb.initFinished); - $.on(d, 'PostsInserted', this.cb.postsInserted); - if (!this.enabledOn(g.BOARD)) { - return; - } - this.enabled = true; - Callbacks.Post.push({ - name: 'Index Page Numbers', - cb: this.node - }); - Callbacks.CatalogThread.push({ - name: 'Catalog Features', - cb: this.catalogNode - }); - this.search = ((ref = history.state) != null ? ref.searched : void 0) || ''; - if ((ref1 = history.state) != null ? ref1.mode : void 0) { - Conf['Index Mode'] = (ref2 = history.state) != null ? ref2.mode : void 0; - } - this.currentSort = (ref3 = history.state) != null ? ref3.sort : void 0; - this.currentSort || (this.currentSort = typeof Conf['Index Sort'] === 'object' ? Conf['Index Sort'][g.BOARD.ID] || 'bump' : Conf['Index Sort']); - this.currentPage = this.getCurrentPage(); - this.processHash(); - $.addClass(doc, 'index-loading', (Conf['Index Mode'].replace(/\ /g, '-')) + "-mode"); - $.on(window, 'popstate', this.cb.popstate); - $.on(d, 'scroll', this.scroll); - $.on(d, 'SortIndex', this.cb.resort); - this.button = $.el('a', { - className: 'fa fa-refresh', - title: 'Refresh', - href: 'javascript:;', - textContent: 'Refresh Index' - }); - $.on(this.button, 'click', function() { - return Index.update(); - }); - Header.addShortcut('index-refresh', this.button, 590); - entries = []; - this.inputs = inputs = $.dict(); - ref4 = Config.Index; - for (name in ref4) { - arr = ref4[name]; - if (!(arr instanceof Array)) { - continue; - } - label = UI.checkbox(name, "" + name[0] + (name.slice(1).toLowerCase())); - label.title = arr[1]; - entries.push({ - el: label - }); - input = label.firstChild; - $.on(input, 'change', $.cb.checked); - inputs[name] = input; - } - $.on(inputs['Show Replies'], 'change', this.cb.replies); - $.on(inputs['Catalog Hover Expand'], 'change', this.cb.hover); - $.on(inputs['Pin Watched Threads'], 'change', this.cb.resort); - $.on(inputs['Anchor Hidden Threads'], 'change', this.cb.resort); - watchSettings = function(e) { - if ((input = $.getOwn(inputs, e.target.name))) { - input.checked = e.target.checked; - return $.event('change', null, input); - } - }; - $.on(d, 'OpenSettings', function() { - return $.on($.id('fourchanx-settings'), 'change', watchSettings); - }); - sortEntry = UI.checkbox('Per-Board Sort Type', 'Per-board sort type', typeof Conf['Index Sort'] === 'object'); - sortEntry.title = 'Set the sorting order of each board independently.'; - $.on(sortEntry.firstChild, 'change', this.cb.perBoardSort); - entries.splice(3, 0, { - el: sortEntry - }); - Header.menu.addEntry({ - el: $.el('span', { - textContent: 'Index Navigation' - }), - order: 100, - subEntries: entries - }); - this.navLinks = $.el('div', { - className: 'navLinks json-index' - }); - $.extend(this.navLinks, {innerHTML: "Index Catalog Archive Bottom ×"}); - $('.cataloglink a', this.navLinks).href = CatalogLinks.catalog(); - if (!BoardConfig.isArchived(g.BOARD.ID)) { - $('.archlistlink', this.navLinks).hidden = true; - } - $.on($('#index-last-refresh a', this.navLinks), 'click', this.cb.refreshFront); - this.searchInput = $('#index-search', this.navLinks); - this.setupSearch(); - $.on(this.searchInput, 'input', this.onSearchInput); - $.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch); - this.hideLabel = $('#hidden-label', this.navLinks); - $.on($('#hidden-toggle a', this.navLinks), 'click', this.cb.toggleHiddenThreads); - this.selectRev = $('#index-rev', this.navLinks); - this.selectMode = $('#index-mode', this.navLinks); - this.selectSort = $('#index-sort', this.navLinks); - this.selectSize = $('#index-size', this.navLinks); - $.on(this.selectRev, 'change', this.cb.sort); - $.on(this.selectMode, 'change', this.cb.mode); - $.on(this.selectSort, 'change', this.cb.sort); - $.on(this.selectSize, 'change', $.cb.value); - $.on(this.selectSize, 'change', this.cb.size); - ref5 = [this.selectMode, this.selectSize]; - for (k = 0, len1 = ref5.length; k < len1; k++) { - select = ref5[k]; - select.value = Conf[select.name]; - } - this.selectRev.checked = /-rev$/.test(Index.currentSort); - this.selectSort.value = Index.currentSort.replace(/-rev$/, ''); - this.lastLongOptions = $('#lastlong-options', this.navLinks); - this.lastLongInputs = $$('input', this.lastLongOptions); - this.lastLongThresholds = [0, 0]; - this.lastLongOptions.hidden = this.selectSort.value !== 'lastlong'; - ref6 = this.lastLongInputs; - for (i = l = 0, len2 = ref6.length; l < len2; i = ++l) { - input = ref6[i]; - $.on(input, 'change', this.cb.lastLongThresholds); - tRaw = Conf["Last Long Reply Thresholds " + i]; - input.value = this.lastLongThresholds[i] = typeof tRaw === 'object' ? (ref7 = tRaw[g.BOARD.ID]) != null ? ref7 : 100 : tRaw; - } - this.root = $.el('div', { - className: 'board json-index' - }); - $.on(this.root, 'click', this.cb.hoverToggle); - this.cb.size(); - this.cb.hover(); - this.pagelist = $.el('div', { - className: 'pagelist json-index' - }); - $.extend(this.pagelist, {innerHTML: "
    "}); - $('.cataloglink a', this.pagelist).href = CatalogLinks.catalog(); - $.on(this.pagelist, 'click', this.cb.pageNav); - this.update(true); - $.onExists(doc, 'title + *', function() { - return d.title = d.title.replace(/\ -\ Page\ \d+/, ''); - }); - $.onExists(doc, '.board > .thread > .postContainer, .board + *', function() { - var board, el, len3, m, ref8, timeEl, topNavPos; - g.SITE.Build.hat = $('.board > .thread > img:first-child'); - if (g.SITE.Build.hat) { - g.BOARD.threads.forEach(function(thread) { - if (thread.nodes.root) { - return $.prepend(thread.nodes.root, g.SITE.Build.hat.cloneNode(false)); - } - }); - $.addClass(doc, 'hats-enabled'); - $.addStyle(".catalog-thread::after {background-image: url(" + g.SITE.Build.hat.src + ");}"); - } - board = $('.board'); - $.replace(board, Index.root); - if (Index.loaded) { - $.event('PostsInserted', null, Index.root); - } - try { - d.implementation.createDocument(null, null, null).appendChild(board); - } catch (error) {} - ref8 = $$('.navLinks'); - for (m = 0, len3 = ref8.length; m < len3; m++) { - el = ref8[m]; - $.rm(el); - } - $.rm($.id('ctrl-top')); - topNavPos = $.id('delform').previousElementSibling; - $.before(topNavPos, $.el('hr')); - $.before(topNavPos, Index.navLinks); - timeEl = $('#index-last-refresh time', Index.navLinks); - if (timeEl.dataset.utc) { - return RelativeDates.update(timeEl); - } - }); - return Main.ready(function() { - var pagelist; - if ((pagelist = $('.pagelist'))) { - $.replace(pagelist, Index.pagelist); - } - return $.rmClass(doc, 'index-loading'); - }); - }, - scroll: function() { - var pageNum, threadIDs; - if (Index.req || !Index.liveThreadData || Conf['Index Mode'] !== 'infinite' || (window.scrollY <= doc.scrollHeight - (300 + window.innerHeight))) { - return; - } - if (Index.pageNum == null) { - Index.pageNum = Index.currentPage; - } - pageNum = ++Index.pageNum; - if (pageNum > Index.pagesNum) { - return Index.endNotice(); - } - threadIDs = Index.threadsOnPage(pageNum); - return Index.buildStructure(threadIDs); - }, - endNotice: (function() { - var notify, reset; - notify = false; - reset = function() { - return notify = false; - }; - return function() { - if (notify) { - return; - } - notify = true; - new Notice('info', "Last page reached.", 2); - return setTimeout(reset, 3 * $.SECOND); - }; - })(), - menu: { - init: function() { - if (!(g.VIEW === 'index' && Conf['Menu'] && Conf['Thread Hiding Link'] && Index.enabledOn(g.BOARD))) { - return; - } - return Menu.menu.addEntry({ - el: $.el('a', { - href: 'javascript:;', - className: 'has-shortcut-text' - }, {innerHTML: "Shift+click"}), - order: 20, - open: function(arg) { - var thread; - thread = arg.thread; - if (Conf['Index Mode'] !== 'catalog') { - return false; - } - this.el.firstElementChild.textContent = thread.isHidden ? 'Unhide' : 'Hide'; - if (this.cb) { - $.off(this.el, 'click', this.cb); - } - this.cb = function() { - $.event('CloseMenu'); - return Index.toggleHide(thread); - }; - $.on(this.el, 'click', this.cb); - return true; - } - }); - } - }, - node: function() { - if (this.isReply || this.isClone || !(Index.threadPosition[this.ID] != null)) { - return; - } - return this.thread.setPage(Math.floor(Index.threadPosition[this.ID] / Index.threadsNumPerPage) + 1); - }, - catalogNode: function() { - return $.on(this.nodes.root, 'mousedown click', (function(_this) { - return function(e) { - if (!(e.button === 0 && e.shiftKey)) { - return; - } - if (e.type === 'click') { - Index.toggleHide(_this.thread); - } - return e.preventDefault(); - }; - })(this)); - }, - toggleHide: function(thread) { - if (Index.showHiddenThreads) { - ThreadHiding.show(thread); - if (!ThreadHiding.db.get({ - boardID: thread.board.ID, - threadID: thread.ID - })) { - return; - } - } else { - ThreadHiding.hide(thread); - } - return ThreadHiding.saveHiddenState(thread); - }, - cycleSortType: function() { - var i, k, len1, type, types; - types = slice.call(Index.selectSort.options).filter(function(option) { - return !option.disabled; - }); - for (i = k = 0, len1 = types.length; k < len1; i = ++k) { - type = types[i]; - if (type.selected) { - break; - } - } - types[(i + 1) % types.length].selected = true; - return $.event('change', null, Index.selectSort); - }, - cb: { - initFinished: function() { - Index.initFinishedFired = true; - return $.queueTask(function() { - return Index.cb.postsInserted(); - }); - }, - postsInserted: function() { - var n; - if (!Index.initFinishedFired) { - return; - } - n = 0; - g.posts.forEach(function(post) { - if (!post.isFetchedQuote && !post.indexRefreshSeen && doc.contains(post.nodes.root)) { - post.indexRefreshSeen = true; - return n++; - } - }); - if (n) { - return $.event('IndexRefresh'); - } - }, - toggleHiddenThreads: function() { - $('#hidden-toggle a', Index.navLinks).textContent = (Index.showHiddenThreads = !Index.showHiddenThreads) ? 'Hide' : 'Show'; - Index.sort(); - return Index.buildIndex(); - }, - mode: function() { - Index.pushState({ - mode: this.value - }); - return Index.pageLoad(false); - }, - sort: function() { - var value; - value = Index.selectRev.checked ? Index.selectSort.value + "-rev" : Index.selectSort.value; - Index.pushState({ - sort: value - }); - return Index.pageLoad(false); - }, - resort: function(e) { - var ref; - Index.changed.order = true; - if (!(e != null ? (ref = e.detail) != null ? ref.deferred : void 0 : void 0)) { - return Index.pageLoad(false); - } - }, - perBoardSort: function() { - var i, k; - Conf['Index Sort'] = this.checked ? $.dict() : ''; - Index.saveSort(); - for (i = k = 0; k < 2; i = ++k) { - Conf["Last Long Reply Thresholds " + i] = this.checked ? $.dict() : ''; - Index.saveLastLongThresholds(i); - } - }, - lastLongThresholds: function() { - var i, value; - i = slice.call(this.parentNode.children).indexOf(this); - value = +this.value; - if (!Number.isFinite(value)) { - this.value = Index.lastLongThresholds[i]; - return; - } - Index.lastLongThresholds[i] = value; - Index.saveLastLongThresholds(i); - Index.changed.order = true; - return Index.pageLoad(false); - }, - size: function(e) { - if (Conf['Index Mode'] !== 'catalog') { - $.rmClass(Index.root, 'catalog-small'); - $.rmClass(Index.root, 'catalog-large'); - } else if (Conf['Index Size'] === 'small') { - $.addClass(Index.root, 'catalog-small'); - $.rmClass(Index.root, 'catalog-large'); - } else { - $.addClass(Index.root, 'catalog-large'); - $.rmClass(Index.root, 'catalog-small'); - } - if (e) { - return Index.buildIndex(); - } - }, - replies: function() { - return Index.buildIndex(); - }, - hover: function() { - return doc.classList.toggle('catalog-hover-expand', Conf['Catalog Hover Expand']); - }, - hoverToggle: function(e) { - var input, thread; - if (Conf['Catalog Hover Toggle'] && $.hasClass(doc, 'catalog-mode') && !$.modifiedClick(e) && !$.x('ancestor-or-self::a', e.target)) { - input = Index.inputs['Catalog Hover Expand']; - input.checked = !input.checked; - $.event('change', null, input); - if ((thread = Get.threadFromNode(e.target))) { - Index.cb.catalogReplies.call(thread); - return Index.cb.hoverAdjust.call(thread.OP.nodes); - } - } - }, - popstate: function(e) { - var mode, nCommands, page, ref, searched, sort; - if (e != null ? e.state : void 0) { - ref = e.state, searched = ref.searched, mode = ref.mode, sort = ref.sort; - page = Index.getCurrentPage(); - Index.setState({ - search: searched, - mode: mode, - sort: sort, - page: page - }); - return Index.pageLoad(false); - } else { - nCommands = Index.processHash(); - if (Conf['Refreshed Navigation'] && nCommands) { - return Index.update(); - } else { - return Index.pageLoad(); - } - } - }, - pageNav: function(e) { - var a; - if ($.modifiedClick(e)) { - return; - } - switch (e.target.nodeName) { - case 'BUTTON': - e.target.blur(); - a = e.target.parentNode; - break; - case 'A': - a = e.target; - break; - default: - return; - } - if (a.textContent === 'Catalog') { - return; - } - e.preventDefault(); - return Index.userPageNav(+a.pathname.split(/\/+/)[2] || 1); - }, - refreshFront: function() { - Index.pushState({ - page: 1 - }); - return Index.update(); - }, - catalogReplies: function() { - if (Conf['Show Replies'] && $.hasClass(doc, 'catalog-hover-expand') && !this.catalogView.nodes.replies) { - return Index.buildCatalogReplies(this); - } - }, - hoverAdjust: function() { - var rect, style, x; - if (!$.hasClass(doc, 'catalog-hover-expand')) { - return; - } - rect = this.post.getBoundingClientRect(); - if ((x = $.minmax(0, -rect.left, doc.clientWidth - rect.right))) { - style = this.post.style; - style.left = x + "px"; - style.right = (-x) + "px"; - return $.one(this.root, 'mouseleave', function() { - return style.left = style.right = null; - }); - } - } - }, - scrollToIndex: function() { - return Header.scrollToIfNeeded((Index.navLinks.getBoundingClientRect().height ? Index.navLinks : Index.root)); - }, - getCurrentPage: function() { - return +window.location.pathname.split(/\/+/)[2] || 1; - }, - userPageNav: function(page) { - Index.pushState({ - page: page - }); - if (Conf['Refreshed Navigation']) { - return Index.update(); - } else { - return Index.pageLoad(); - } - }, - hashCommands: { - mode: { - 'paged': 'paged', - 'infinite-scrolling': 'infinite', - 'infinite': 'infinite', - 'all-threads': 'all pages', - 'all-pages': 'all pages', - 'catalog': 'catalog' - }, - sort: { - 'bump-order': 'bump', - 'last-reply': 'lastreply', - 'last-long-reply': 'lastlong', - 'creation-date': 'birth', - 'reply-count': 'replycount', - 'file-count': 'filecount', - 'posts-per-minute': 'activity' - } - }, - processHash: function() { - var command, commands, hash, k, leftover, len1, mode, ref, sort, state; - hash = ((ref = location.href.match(/#.*/)) != null ? ref[0] : void 0) || ''; - state = { - replace: true - }; - commands = hash.slice(1).split('/'); - leftover = []; - for (k = 0, len1 = commands.length; k < len1; k++) { - command = commands[k]; - if ((mode = $.getOwn(Index.hashCommands.mode, command))) { - state.mode = mode; - } else if (command === 'index') { - state.mode = Conf['Previous Index Mode']; - state.page = 1; - } else if ((sort = $.getOwn(Index.hashCommands.sort, command.replace(/-rev$/, '')))) { - state.sort = sort; - if (/-rev$/.test(command)) { - state.sort += '-rev'; - } - } else if (/^s=/.test(command)) { - state.search = decodeURIComponent(command.slice(2)).replace(/\+/g, ' ').trim(); - } else { - leftover.push(command); - } - } - hash = leftover.join('/'); - if (hash) { - state.hash = "#" + hash; - } - Index.pushState(state); - return commands.length - leftover.length; - }, - pushState: function(state) { - var hash, pageBeforeSearch, pathname, ref, replace, search; - search = state.search, hash = state.hash, replace = state.replace; - pageBeforeSearch = (ref = history.state) != null ? ref.oldpage : void 0; - if ((search != null) && search !== Index.search) { - state.page = search ? 1 : pageBeforeSearch || 1; - if (!search) { - pageBeforeSearch = void 0; - } else if (!Index.search) { - pageBeforeSearch = Index.currentPage; - } - } - Index.setState(state); - pathname = Index.currentPage === 1 ? "/" + g.BOARD + "/" : "/" + g.BOARD + "/" + Index.currentPage; - hash || (hash = ''); - return history[replace ? 'replaceState' : 'pushState']({ - mode: Conf['Index Mode'], - sort: Index.currentSort, - searched: Index.search, - oldpage: pageBeforeSearch - }, '', location.protocol + "//" + location.host + pathname + hash); - }, - setState: function(arg) { - var hash, mode, page, ref, search, sort; - search = arg.search, mode = arg.mode, sort = arg.sort, page = arg.page, hash = arg.hash; - if ((search != null) && search !== Index.search) { - Index.changed.search = true; - Index.search = search; - } - if ((mode != null) && mode !== Conf['Index Mode']) { - Index.changed.mode = true; - Conf['Index Mode'] = mode; - $.set('Index Mode', mode); - if (!(mode === 'catalog' || Conf['Previous Index Mode'] === mode)) { - Conf['Previous Index Mode'] = mode; - $.set('Previous Index Mode', mode); - } - } - if ((sort != null) && sort !== Index.currentSort) { - Index.changed.sort = true; - Index.currentSort = sort; - Index.saveSort(); - } - if ((ref = Conf['Index Mode']) === 'all pages' || ref === 'catalog') { - page = 1; - } - if ((page != null) && page !== Index.currentPage) { - Index.changed.page = true; - Index.currentPage = page; - } - if (hash != null) { - return Index.changed.hash = true; - } - }, - savePerBoard: function(key, value) { - if (typeof Conf[key] === 'object') { - Conf[key][g.BOARD.ID] = value; - } else { - Conf[key] = value; - } - return $.set(key, Conf[key]); - }, - saveSort: function() { - return Index.savePerBoard('Index Sort', Index.currentSort); - }, - saveLastLongThresholds: function(i) { - return Index.savePerBoard("Last Long Reply Thresholds " + i, Index.lastLongThresholds[i]); - }, - pageLoad: function(scroll) { - var hash, mode, order, page, ref, search, sort, threads; - if (scroll == null) { - scroll = true; - } - if (!Index.liveThreadData) { - return; - } - ref = Index.changed, threads = ref.threads, order = ref.order, search = ref.search, mode = ref.mode, sort = ref.sort, page = ref.page, hash = ref.hash; - threads || (threads = search); - order || (order = sort); - if (threads || order) { - Index.sort(); - } - if (threads) { - Index.buildPagelist(); - } - if (search) { - Index.setupSearch(); - } - if (mode) { - Index.setupMode(); - } - if (sort) { - Index.setupSort(); - } - if (threads || mode || page || order) { - Index.buildIndex(); - } - if (threads || page) { - Index.setPage(); - } - if (scroll && !hash) { - Index.scrollToIndex(); - } - if (hash) { - Header.hashScroll(); - } - return Index.changed = {}; - }, - setupMode: function() { - var k, len1, mode, ref; - ref = ['paged', 'infinite', 'all pages', 'catalog']; - for (k = 0, len1 = ref.length; k < len1; k++) { - mode = ref[k]; - $[mode === Conf['Index Mode'] ? 'addClass' : 'rmClass'](doc, (mode.replace(/\ /g, '-')) + "-mode"); - } - Index.selectMode.value = Conf['Index Mode']; - Index.cb.size(); - Index.showHiddenThreads = false; - return $('#hidden-toggle a', Index.navLinks).textContent = 'Show'; - }, - setupSort: function() { - Index.selectRev.checked = /-rev$/.test(Index.currentSort); - Index.selectSort.value = Index.currentSort.replace(/-rev$/, ''); - return Index.lastLongOptions.hidden = Index.selectSort.value !== 'lastlong'; - }, - getPagesNum: function() { - if (Index.search) { - return Math.ceil(Index.sortedThreadIDs.length / Index.threadsNumPerPage); - } else { - return Index.pagesNum; - } - }, - getMaxPageNum: function() { - return Math.max(1, Index.getPagesNum()); - }, - buildPagelist: function() { - var a, i, k, maxPageNum, nodes, pagesRoot, ref; - pagesRoot = $('.pages', Index.pagelist); - maxPageNum = Index.getMaxPageNum(); - if (pagesRoot.childElementCount !== maxPageNum) { - nodes = []; - for (i = k = 1, ref = maxPageNum; k <= ref; i = k += 1) { - a = $.el('a', { - textContent: i, - href: i === 1 ? './' : i - }); - nodes.push($.tn('['), a, $.tn('] ')); - } - $.rmAll(pagesRoot); - return $.add(pagesRoot, nodes); - } - }, - setPage: function() { - var a, href, maxPageNum, next, pageNum, pagesRoot, prev, strong; - pageNum = Index.currentPage; - maxPageNum = Index.getMaxPageNum(); - pagesRoot = $('.pages', Index.pagelist); - prev = pagesRoot.previousSibling.firstChild; - next = pagesRoot.nextSibling.firstChild; - href = Math.max(pageNum - 1, 1); - prev.href = href === 1 ? './' : href; - prev.firstChild.disabled = href === pageNum; - href = Math.min(pageNum + 1, maxPageNum); - next.href = href === 1 ? './' : href; - next.firstChild.disabled = href === pageNum; - if (strong = $('strong', pagesRoot)) { - if (+strong.textContent === pageNum) { - return; - } - $.replace(strong, strong.firstChild); - } else { - strong = $.el('strong'); - } - if ((a = pagesRoot.children[pageNum - 1])) { - $.before(a, strong); - return $.add(strong, a); - } - }, - updateHideLabel: function() { - var hiddenCount, k, len1, ref, threadID; - if (!Index.hideLabel) { - return; - } - hiddenCount = 0; - ref = Index.liveThreadIDs; - for (k = 0, len1 = ref.length; k < len1; k++) { - threadID = ref[k]; - if (Index.isHidden(threadID)) { - hiddenCount++; - } - } - if (!hiddenCount) { - Index.hideLabel.hidden = true; - if (Index.showHiddenThreads) { - Index.cb.toggleHiddenThreads(); - } - return; - } - Index.hideLabel.hidden = false; - return $('#hidden-count', Index.navLinks).textContent = hiddenCount === 1 ? '1 hidden thread' : hiddenCount + " hidden threads"; - }, - update: function(firstTime) { - var oldReq; - if ((oldReq = Index.req)) { - delete Index.req; - oldReq.abort(); - } - if (Conf['Index Refresh Notifications']) { - Index.notice || (Index.notice = new Notice('info', 'Refreshing index...')); - Index.nTimeout || (Index.nTimeout = setTimeout(function() { - var ref; - return (ref = Index.notice) != null ? ref.el.lastElementChild.textContent += ' (disable JSON Index if this takes too long)' : void 0; - }, 3 * $.SECOND)); - } else { - Index.nTimeout || (Index.nTimeout = setTimeout(function() { - return Index.notice || (Index.notice = new Notice('info', 'Refreshing index... (disable JSON Index if this takes too long)')); - }, 3 * $.SECOND)); - } - if (!firstTime && d.readyState !== 'loading' && !$('.board + *')) { - location.reload(); - return; - } - Index.req = $.whenModified(g.SITE.urls.catalogJSON({ - boardID: g.BOARD.ID - }), 'Index', Index.load); - return $.addClass(Index.button, 'fa-spin'); - }, - load: function() { - var err, nTimeout, notice, ref, timeEl; - if (this !== Index.req) { - return; - } - $.rmClass(Index.button, 'fa-spin'); - notice = Index.notice, nTimeout = Index.nTimeout; - if (nTimeout) { - clearTimeout(nTimeout); - } - delete Index.nTimeout; - delete Index.req; - delete Index.notice; - if ((ref = this.status) !== 200 && ref !== 304) { - err = "Index refresh failed. " + (this.status ? "Error " + this.statusText + " (" + this.status + ")" : 'Connection Error'); - if (notice) { - notice.setType('warning'); - notice.el.lastElementChild.textContent = err; - setTimeout(notice.close, $.SECOND); - } else { - new Notice('warning', err, 1); - } - return; - } - try { - if (this.status === 200) { - Index.parse(this.response); - } else if (this.status === 304) { - Index.pageLoad(); - } - } catch (error) { - err = error; - c.error("Index failure: " + err.message, err.stack); - if (notice) { - notice.setType('error'); - notice.el.lastElementChild.textContent = 'Index refresh failed.'; - setTimeout(notice.close, $.SECOND); - } else { - new Notice('error', 'Index refresh failed.', 1); - } - return; - } - if (notice) { - if (Conf['Index Refresh Notifications']) { - notice.setType('success'); - notice.el.lastElementChild.textContent = 'Index refreshed!'; - setTimeout(notice.close, $.SECOND); - } else { - notice.close(); - } - } - timeEl = $('#index-last-refresh time', Index.navLinks); - timeEl.dataset.utc = Date.parse(this.getResponseHeader('Last-Modified')); - return RelativeDates.update(timeEl); - }, - parse: function(pages) { - $.cleanCache(function(url) { - return /^https?:\/\/a\.4cdn\.org\//.test(url); - }); - Index.parseThreadList(pages); - Index.changed.threads = true; - return Index.pageLoad(); - }, - parseThreadList: function(pages) { - var ID, data, i, k, l, len1, len2, obj, ref, ref1, ref2, reply, results; - Index.pagesNum = pages.length; - Index.threadsNumPerPage = ((ref = pages[0]) != null ? ref.threads.length : void 0) || 1; - Index.liveThreadData = pages.reduce((function(arr, next) { - return arr.concat(next.threads); - }), []); - Index.liveThreadIDs = Index.liveThreadData.map(function(data) { - return data.no; - }); - Index.liveThreadDict = $.dict(); - Index.threadPosition = $.dict(); - Index.parsedThreads = $.dict(); - Index.replyData = $.dict(); - ref1 = Index.liveThreadData; - for (i = k = 0, len1 = ref1.length; k < len1; i = ++k) { - data = ref1[i]; - Index.liveThreadDict[data.no] = data; - Index.threadPosition[data.no] = i; - Index.parsedThreads[data.no] = obj = g.SITE.Build.parseJSON(data, g.BOARD); - obj.filterResults = results = Filter.test(obj); - obj.isOnTop = results.top; - obj.isHidden = results.hide || ThreadHiding.isHidden(obj.boardID, obj.threadID); - if (data.last_replies) { - ref2 = data.last_replies; - for (l = 0, len2 = ref2.length; l < len2; l++) { - reply = ref2[l]; - Index.replyData[g.BOARD + "." + reply.no] = reply; - } - } - } - if (Index.liveThreadData[0]) { - g.SITE.Build.spoilerRange[g.BOARD.ID] = Index.liveThreadData[0].custom_spoiler; - } - g.BOARD.threads.forEach(function(thread) { - var ref3; - if (ref3 = thread.ID, indexOf.call(Index.liveThreadIDs, ref3) < 0) { - return thread.collect(); - } - }); - $.event('IndexUpdate', { - threads: (function() { - var len3, m, ref3, results1; - ref3 = Index.liveThreadIDs; - results1 = []; - for (m = 0, len3 = ref3.length; m < len3; m++) { - ID = ref3[m]; - results1.push(g.BOARD + "." + ID); - } - return results1; - })() - }); - }, - isHidden: function(threadID) { - var thread; - if ((thread = g.BOARD.threads.get(threadID)) && thread.OP && !thread.OP.isFetchedQuote) { - return thread.isHidden; - } else { - return Index.parsedThreads[threadID].isHidden; - } - }, - isHiddenReply: function(threadID, replyData) { - return PostHiding.isHidden(g.BOARD.ID, threadID, replyData.no) || Filter.isHidden(g.SITE.Build.parseJSON(replyData, g.BOARD)); - }, - buildThreads: function(threadIDs, isCatalog, withReplies) { - var ID, OP, err, errors, isStale, k, lastPost, len1, newPosts, newThreads, obj, opRoot, t, thread, threadData, threads; - threads = []; - newThreads = []; - newPosts = []; - for (k = 0, len1 = threadIDs.length; k < len1; k++) { - ID = threadIDs[k]; - try { - threadData = Index.liveThreadDict[ID]; - if ((thread = g.BOARD.threads.get(ID))) { - isStale = (thread.json !== threadData) && (JSON.stringify(thread.json) !== JSON.stringify(threadData)); - if (isStale) { - thread.setCount('post', threadData.replies + 1, threadData.bumplimit); - thread.setCount('file', threadData.images + !!threadData.ext, threadData.imagelimit); - thread.setStatus('Sticky', !!threadData.sticky); - thread.setStatus('Closed', !!threadData.closed); - } - if (thread.catalogView) { - $.rm(thread.catalogView.nodes.replies); - thread.catalogView.nodes.replies = null; - } - } else { - thread = new Thread(ID, g.BOARD); - newThreads.push(thread); - } - lastPost = threadData.last_replies && threadData.last_replies.length ? threadData.last_replies[threadData.last_replies.length - 1].no : ID; - if (lastPost > thread.lastPost) { - thread.lastPost = lastPost; - } - thread.json = threadData; - threads.push(thread); - if ((OP = thread.OP) && !OP.isFetchedQuote) { - OP.setCatalogOP(isCatalog); - thread.setPage(Math.floor(Index.threadPosition[ID] / Index.threadsNumPerPage) + 1); - } else { - obj = Index.parsedThreads[ID]; - opRoot = g.SITE.Build.post(obj); - OP = new Post(opRoot, thread, g.BOARD); - OP.filterResults = obj.filterResults; - newPosts.push(OP); - } - if (!(isCatalog && thread.nodes.root)) { - g.SITE.Build.thread(thread, threadData, withReplies); - } - } catch (error) { - err = error; - if (!errors) { - errors = []; - } - errors.push({ - message: "Parsing of Thread No." + thread + " failed. Thread will be skipped.", - error: err, - html: opRoot != null ? opRoot.outerHTML : void 0 - }); - } - } - if (errors) { - Main.handleErrors(errors); - } - if (withReplies) { - newPosts = newPosts.concat(Index.buildReplies(threads)); - } - Main.callbackNodes('Thread', newThreads); - Main.callbackNodes('Post', newPosts); - Index.updateHideLabel(); - $.event('IndexRefreshInternal', { - threadIDs: (function() { - var l, len2, results1; - results1 = []; - for (l = 0, len2 = threads.length; l < len2; l++) { - t = threads[l]; - results1.push(t.fullID); - } - return results1; - })(), - isCatalog: isCatalog - }); - return threads; - }, - buildReplies: function(threads) { - var data, err, errors, k, l, lastReplies, len1, len2, node, nodes, post, posts, thread; - posts = []; - for (k = 0, len1 = threads.length; k < len1; k++) { - thread = threads[k]; - if (!(lastReplies = Index.liveThreadDict[thread.ID].last_replies)) { - continue; - } - nodes = []; - for (l = 0, len2 = lastReplies.length; l < len2; l++) { - data = lastReplies[l]; - if ((post = thread.posts.get(data.no)) && !post.isFetchedQuote) { - nodes.push(post.nodes.root); - continue; - } - nodes.push(node = g.SITE.Build.postFromObject(data, thread.board.ID)); - try { - posts.push(new Post(node, thread, thread.board)); - } catch (error) { - err = error; - if (!errors) { - errors = []; - } - errors.push({ - message: "Parsing of Post No." + data.no + " failed. Post will be skipped.", - error: err, - html: node != null ? node.outerHTML : void 0 - }); - } - } - $.add(thread.nodes.root, nodes); - } - if (errors) { - Main.handleErrors(errors); - } - return posts; - }, - buildCatalogViews: function(threads) { - var ID, catalogThreads, k, len1, page, root, thread; - catalogThreads = []; - for (k = 0, len1 = threads.length; k < len1; k++) { - thread = threads[k]; - if (!(!thread.catalogView)) { - continue; - } - ID = thread.ID; - page = Math.floor(Index.threadPosition[ID] / Index.threadsNumPerPage) + 1; - root = g.SITE.Build.catalogThread(thread, Index.liveThreadDict[ID], page); - catalogThreads.push(new CatalogThread(root, thread)); - } - Main.callbackNodes('CatalogThread', catalogThreads); - }, - sizeCatalogViews: function(threads) { - var height, k, len1, ratio, ref, size, thread, thumb, width; - size = Conf['Index Size'] === 'small' ? 150 : 250; - for (k = 0, len1 = threads.length; k < len1; k++) { - thread = threads[k]; - thumb = thread.catalogView.nodes.thumb; - ref = thumb.dataset, width = ref.width, height = ref.height; - if (!width) { - continue; - } - ratio = size / Math.max(width, height); - thumb.style.width = width * ratio + 'px'; - thumb.style.height = height * ratio + 'px'; - } - }, - buildCatalogReplies: function(thread) { - var data, k, lastReplies, len1, nodes, replies, reply; - nodes = thread.catalogView.nodes; - if (!(lastReplies = Index.liveThreadDict[thread.ID].last_replies)) { - return; - } - replies = []; - for (k = 0, len1 = lastReplies.length; k < len1; k++) { - data = lastReplies[k]; - if (Index.isHiddenReply(thread.ID, data)) { - continue; - } - reply = g.SITE.Build.catalogReply(thread, data); - RelativeDates.update($('time', reply)); - $.on($('.catalog-reply-preview', reply), 'mouseover', QuotePreview.mouseover); - replies.push(reply); - } - nodes.replies = $.el('div', { - className: 'catalog-replies' - }); - $.add(nodes.replies, replies); - $.add(thread.OP.nodes.post, nodes.replies); - }, - sort: function() { - var lastlong, lastlongD, liveThreadData, liveThreadIDs, repliesAvailable, sortType, thread, threadIDs, tmp_time; - liveThreadIDs = Index.liveThreadIDs, liveThreadData = Index.liveThreadData; - if (!liveThreadData) { - return; - } - tmp_time = new Date().getTime() / 1000; - sortType = Index.currentSort.replace(/-rev$/, ''); - Index.sortedThreadIDs = (function() { - var k, len1; - switch (sortType) { - case 'lastreply': - case 'lastlong': - repliesAvailable = liveThreadData.some(function(thread) { - var ref; - return (ref = thread.last_replies) != null ? ref.length : void 0; - }); - lastlong = function(thread) { - var i, k, len, r, ref, ref1; - if (!repliesAvailable) { - return thread.last_modified; - } - ref = thread.last_replies || []; - for (i = k = ref.length - 1; k >= 0; i = k += -1) { - r = ref[i]; - if (Index.isHiddenReply(thread.no, r)) { - continue; - } - if (sortType === 'lastreply') { - return r; - } - len = r.com ? g.SITE.Build.parseComment(r.com).replace(/[^a-z]/ig, '').length : 0; - if (len >= Index.lastLongThresholds[+(!!r.ext)]) { - return r; - } - } - if (thread.omitted_posts && ((ref1 = thread.last_replies) != null ? ref1.length : void 0)) { - return thread.last_replies[0]; - } else { - return thread; - } - }; - lastlongD = $.dict(); - for (k = 0, len1 = liveThreadData.length; k < len1; k++) { - thread = liveThreadData[k]; - lastlongD[thread.no] = lastlong(thread).no; - } - return slice.call(liveThreadData).sort(function(a, b) { - return lastlongD[b.no] - lastlongD[a.no]; - }).map(function(post) { - return post.no; - }); - case 'bump': - return liveThreadIDs; - case 'birth': - return slice.call(liveThreadIDs).sort(function(a, b) { - return b - a; - }); - case 'replycount': - return slice.call(liveThreadData).sort(function(a, b) { - return b.replies - a.replies; - }).map(function(post) { - return post.no; - }); - case 'filecount': - return slice.call(liveThreadData).sort(function(a, b) { - return b.images - a.images; - }).map(function(post) { - return post.no; - }); - case 'activity': - return slice.call(liveThreadData).sort(function(a, b) { - return (tmp_time - a.time) / (a.replies + 1) - (tmp_time - b.time) / (b.replies + 1); - }).map(function(post) { - return post.no; - }); - default: - return liveThreadIDs; - } - })(); - if (/-rev$/.test(Index.currentSort)) { - Index.sortedThreadIDs = slice.call(Index.sortedThreadIDs).reverse(); - } - if (Index.search && (threadIDs = Index.querySearch(Index.search))) { - Index.sortedThreadIDs = threadIDs; - } - Index.sortOnTop(function(obj) { - return obj.isSticky; - }); - Index.sortOnTop(function(obj) { - return obj.isOnTop || Conf['Pin Watched Threads'] && ThreadWatcher.isWatchedRaw(obj.boardID, obj.threadID); - }); - if (Conf['Anchor Hidden Threads']) { - return Index.sortOnTop(function(obj) { - return !Index.isHidden(obj.threadID); - }); - } - }, - sortOnTop: function(match) { - var ID, bottomThreads, k, len1, ref, topThreads; - topThreads = []; - bottomThreads = []; - ref = Index.sortedThreadIDs; - for (k = 0, len1 = ref.length; k < len1; k++) { - ID = ref[k]; - (match(Index.parsedThreads[ID]) ? topThreads : bottomThreads).push(ID); - } - return Index.sortedThreadIDs = topThreads.concat(bottomThreads); - }, - buildIndex: function() { - var threadIDs; - if (!Index.liveThreadData) { - return; - } - switch (Conf['Index Mode']) { - case 'all pages': - threadIDs = Index.sortedThreadIDs; - break; - case 'catalog': - threadIDs = Index.sortedThreadIDs.filter(function(ID) { - return !Index.isHidden(ID) !== Index.showHiddenThreads; - }); - break; - default: - threadIDs = Index.threadsOnPage(Index.currentPage); - } - delete Index.pageNum; - $.rmAll(Index.root); - $.rmAll(Header.hover); - if (Index.loaded && Index.root.parentNode) { - $.event('PostsRemoved', null, Index.root); - } - if (Conf['Index Mode'] === 'catalog') { - Index.buildCatalog(threadIDs); - } else { - Index.buildStructure(threadIDs); - } - }, - threadsOnPage: function(pageNum) { - var nodesPerPage, offset; - nodesPerPage = Index.threadsNumPerPage; - offset = nodesPerPage * (pageNum - 1); - return Index.sortedThreadIDs.slice(offset, offset + nodesPerPage); - }, - buildStructure: function(threadIDs) { - var k, len1, nodes, thread, threads; - threads = Index.buildThreads(threadIDs, false, Conf['Show Replies']); - nodes = []; - for (k = 0, len1 = threads.length; k < len1; k++) { - thread = threads[k]; - nodes.push(thread.nodes.root, $.el('hr')); - } - $.add(Index.root, nodes); - if (Index.root.parentNode) { - $.event('PostsInserted', null, Index.root); - } - Index.loaded = true; - }, - buildCatalog: function(threadIDs) { - var fn, i, n, node0; - i = 0; - n = threadIDs.length; - node0 = null; - fn = function() { - var j; - if (node0 && !node0.parentNode) { - return; - } - j = i > 0 && Index.root.parentNode ? n : i + 30; - node0 = Index.buildCatalogPart(threadIDs.slice(i, j))[0]; - i = j; - if (i < n) { - return $.queueTask(fn); - } else { - if (Index.root.parentNode) { - $.event('PostsInserted', null, Index.root); - } - return Index.loaded = true; - } - }; - fn(); - }, - buildCatalogPart: function(threadIDs) { - var k, len1, nodes, thread, threads; - threads = Index.buildThreads(threadIDs, true); - Index.buildCatalogViews(threads); - Index.sizeCatalogViews(threads); - nodes = []; - for (k = 0, len1 = threads.length; k < len1; k++) { - thread = threads[k]; - thread.OP.setCatalogOP(true); - $.add(thread.catalogView.nodes.root, thread.OP.nodes.root); - nodes.push(thread.catalogView.nodes.root); - $.on(thread.catalogView.nodes.root, 'mouseenter', Index.cb.catalogReplies.bind(thread)); - $.on(thread.OP.nodes.root, 'mouseenter', Index.cb.hoverAdjust.bind(thread.OP.nodes)); - } - $.add(Index.root, nodes); - return nodes; - }, - clearSearch: function() { - Index.searchInput.value = ''; - Index.onSearchInput(); - return Index.searchInput.focus(); - }, - setupSearch: function() { - Index.searchInput.value = Index.search; - if (Index.search) { - return Index.searchInput.dataset.searching = 1; - } else { - return Index.searchInput.removeAttribute('data-searching'); - } - }, - onSearchInput: function() { - var search; - search = Index.searchInput.value.trim(); - if (search === Index.search) { - return; - } - Index.pushState({ - search: search, - replace: !!search === !!Index.search - }); - return Index.pageLoad(false); - }, - querySearch: function(query) { - var keywords, match, regexp; - if ((match = query.match(/^([\w+]+):\/(.*)\/(\w*)$/))) { - try { - regexp = RegExp(match[2], match[3]); - } catch (error) { - return []; - } - return Index.sortedThreadIDs.filter(function(ID) { - return regexp.test(Filter.values(match[1], Index.parsedThreads[ID]).join('\n')); - }); - } - if (!(keywords = query.toLowerCase().match(/\S+/g))) { - return; - } - return Index.sortedThreadIDs.filter(function(ID) { - return Index.searchMatch(Index.parsedThreads[ID], keywords); - }); - }, - searchMatch: function(obj, keywords) { - var file, info, k, key, keyword, l, len1, len2, ref, text; - info = obj.info, file = obj.file; - if (info.comment == null) { - info.comment = g.SITE.Build.parseComment(info.commentHTML.innerHTML); - } - text = []; - ref = ['comment', 'subject', 'name', 'tripcode']; - for (k = 0, len1 = ref.length; k < len1; k++) { - key = ref[k]; - if (key in info) { - text.push(info[key]); - } - } - if (file) { - text.push(file.name); - } - text = text.join(' ').toLowerCase(); - for (l = 0, len2 = keywords.length; l < len2; l++) { - keyword = keywords[l]; - if (-1 === text.indexOf(keyword)) { - return false; - } - } - return true; - } - }; - - return Index; - -}).call(this); - -Polyfill = (function() { - var Polyfill; - - Polyfill = { - init: function() { - var base; - this.toBlob(); - $.global(this.toBlob); - (base = Element.prototype).matches || (base.matches = Element.prototype.mozMatchesSelector || Element.prototype.webkitMatchesSelector); - }, - toBlob: function() { - if (HTMLCanvasElement.prototype.toBlob) { - return; - } - HTMLCanvasElement.prototype.toBlob = function(cb, type, encoderOptions) { - var data, i, j, l, ref, ui8a, url; - url = this.toDataURL(type, encoderOptions); - data = atob(url.slice(url.indexOf(',') + 1)); - l = data.length; - ui8a = new Uint8Array(l); - for (i = j = 0, ref = l; j < ref; i = j += 1) { - ui8a[i] = data.charCodeAt(i); - } - return cb(new Blob([ui8a], { - type: type || 'image/png' - })); - }; - } - }; - - return Polyfill; - -}).call(this); - -Settings = (function() { - var Settings, - slice = [].slice, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Settings = { - init: function() { - var add, link; - link = $.el('a', { - className: 'settings-link fa fa-wrench', - textContent: 'Settings', - title: '4chan X Settings', - href: 'javascript:;' - }); - $.on(link, 'click', Settings.open); - Header.addShortcut('settings', link, 820); - add = this.addSection; - add('Main', this.main); - add('Filter', this.filter); - add('Sauce', this.sauce); - add('Advanced', this.advanced); - add('Keybinds', this.keybinds); - $.on(d, 'AddSettingsSection', Settings.addSection); - $.on(d, 'OpenSettings', function(e) { - return Settings.open(e.detail); - }); - if (g.SITE.software === 'yotsuba' && Conf['Disable Native Extension']) { - if ($.hasStorage) { - return $.global(function() { - var settings; - try { - settings = JSON.parse(localStorage.getItem('4chan-settings')) || {}; - if (settings.disableAll) { - return; - } - settings.disableAll = true; - return localStorage.setItem('4chan-settings', JSON.stringify(settings)); - } catch (error) { - return Object.defineProperty(window, 'Config', { - value: { - disableAll: true - } - }); - } - }); - } else { - return $.global(function() { - return Object.defineProperty(window, 'Config', { - value: { - disableAll: true - } - }); - }); - } - } - }, - open: function(openSection) { - var dialog, j, len, link, links, ref, section, sectionToOpen; - if (Settings.dialog) { - return; - } - $.event('CloseMenu'); - Settings.dialog = dialog = $.el('div', { - id: 'overlay' - }, {innerHTML: ""}); - $.on($('.export', dialog), 'click', Settings["export"]); - $.on($('.import', dialog), 'click', Settings["import"]); - $.on($('.reset', dialog), 'click', Settings.reset); - $.on($('input', dialog), 'change', Settings.onImport); - links = []; - ref = Settings.sections; - for (j = 0, len = ref.length; j < len; j++) { - section = ref[j]; - link = $.el('a', { - className: "tab-" + section.hyphenatedTitle, - textContent: section.title, - href: 'javascript:;' - }); - $.on(link, 'click', Settings.openSection.bind(section)); - links.push(link, $.tn(' | ')); - if (section.title === openSection) { - sectionToOpen = link; - } - } - links.pop(); - $.add($('.sections-list', dialog), links); - if (openSection !== 'none') { - (sectionToOpen ? sectionToOpen : links[0]).click(); - } - $.on($('.close', dialog), 'click', Settings.close); - $.on(window, 'beforeunload', Settings.close); - $.on(dialog, 'click', Settings.close); - $.on(dialog.firstElementChild, 'click', function(e) { - return e.stopPropagation(); - }); - $.add(d.body, dialog); - return $.event('OpenSettings', null, dialog); - }, - close: function() { - var ref; - if (!Settings.dialog) { - return; - } - if ((ref = d.activeElement) != null) { - ref.blur(); - } - $.rm(Settings.dialog); - return delete Settings.dialog; - }, - sections: [], - addSection: function(title, open) { - var hyphenatedTitle, ref; - if (typeof title !== 'string') { - ref = title.detail, title = ref.title, open = ref.open; - } - hyphenatedTitle = title.toLowerCase().replace(/\s+/g, '-'); - return Settings.sections.push({ - title: title, - hyphenatedTitle: hyphenatedTitle, - open: open - }); - }, - openSection: function() { - var section, selected; - if (selected = $('.tab-selected', Settings.dialog)) { - $.rmClass(selected, 'tab-selected'); - } - $.addClass($(".tab-" + this.hyphenatedTitle, Settings.dialog), 'tab-selected'); - section = $('section', Settings.dialog); - $.rmAll(section); - section.className = "section-" + this.hyphenatedTitle; - this.open(section, g); - section.scrollTop = 0; - return $.event('OpenSettings', null, section); - }, - warnings: { - localStorage: function(cb) { - var why; - if ($.cantSync) { - why = $.cantSet ? 'save your settings' : 'synchronize settings between tabs'; - return cb($.el('li', { - textContent: "4chan X needs local storage to " + why + ".\nEnable it on boards." + (location.hostname.split('.')[1]) + ".org in your browser's privacy settings (may be listed as part of \"local data\" or \"cookies\")." - })); - } - }, - ads: function(cb) { - return $.onExists(doc, '.adg-rects > .desktop', function(ad) { - return $.onExists(ad, 'iframe', function() { - var url; - url = Redirect.to('thread', { - boardID: 'qa', - threadID: 362590 - }); - return cb($.el('li', {innerHTML: "To protect yourself from malicious ads, you should block ads on 4chan."})); - }); - }); - } - }, - main: function(section) { - var addCheckboxes, addWarning, button, div, fs, inputs, items, key, keyFS, obj, ref, ref1, warning, warnings; - warnings = $.el('fieldset', { - hidden: true - }, {innerHTML: "Warnings
      "}); - addWarning = function(item) { - $.add($('ul', warnings), item); - return warnings.hidden = false; - }; - ref = Settings.warnings; - for (key in ref) { - warning = ref[key]; - warning(addWarning); - } - $.add(section, warnings); - items = $.dict(); - inputs = $.dict(); - addCheckboxes = function(root, obj) { - var arr, container, containers, description, div, input, level, results; - containers = [root]; - results = []; - for (key in obj) { - arr = obj[key]; - if (!(arr instanceof Array)) { - continue; - } - description = arr[1]; - div = $.el('div', {innerHTML: ": " + E(description) + ""}); - div.dataset.name = key; - input = $('input', div); - $.on(input, 'change', $.cb.checked); - $.on(input, 'change', function() { - return this.parentNode.parentNode.dataset.checked = this.checked; - }); - items[key] = Conf[key]; - inputs[key] = input; - level = arr[2] || 0; - if (containers.length <= level) { - container = $.el('div', { - className: 'suboption-list' - }); - $.add(containers[containers.length - 1].lastElementChild, container); - containers[level] = container; - } else if (containers.length > level + 1) { - containers.splice(level + 1, containers.length - (level + 1)); - } - results.push($.add(containers[level], div)); - } - return results; - }; - ref1 = Config.main; - for (keyFS in ref1) { - obj = ref1[keyFS]; - fs = $.el('fieldset', {innerHTML: "" + E(keyFS) + ""}); - addCheckboxes(fs, obj); - if (keyFS === 'Posting and Captchas') { - $.add(fs, $.el('p', {innerHTML: "For more info on captcha options and issues, see the captcha FAQ."})); - } - $.add(section, fs); - } - addCheckboxes($('div[data-name="JSON Index"] > .suboption-list', section), Config.Index); - if ($.engine !== 'gecko') { - $('div[data-name="Remember QR Size"]', section).hidden = true; - } - if ($.perProtocolSettings || location.protocol !== 'https:') { - $('div[data-name="Redirect to HTTPS"]', section).hidden = true; - } - if ($.platform !== 'crx') { - $('div[data-name="Work around CORB Bug"]', section).hidden = true; - } - $.get(items, function(items) { - var val; - for (key in items) { - val = items[key]; - inputs[key].checked = val; - inputs[key].parentNode.parentNode.dataset.checked = val; - } - }); - div = $.el('div', {innerHTML: ": Clear manually-hidden threads and posts on all boards. Reload the page to apply."}); - button = $('button', div); - $.get({ - hiddenThreads: $.dict(), - hiddenPosts: $.dict() - }, function(arg) { - var ID, board, hiddenNum, hiddenPosts, hiddenThreads, ref2, ref3, ref4, ref5, site, thread; - hiddenThreads = arg.hiddenThreads, hiddenPosts = arg.hiddenPosts; - hiddenNum = 0; - for (ID in hiddenThreads) { - site = hiddenThreads[ID]; - if (ID !== 'boards') { - ref2 = site.boards; - for (ID in ref2) { - board = ref2[ID]; - hiddenNum += Object.keys(board).length; - } - } - } - ref3 = hiddenThreads.boards; - for (ID in ref3) { - board = ref3[ID]; - hiddenNum += Object.keys(board).length; - } - for (ID in hiddenPosts) { - site = hiddenPosts[ID]; - if (ID !== 'boards') { - ref4 = site.boards; - for (ID in ref4) { - board = ref4[ID]; - for (ID in board) { - thread = board[ID]; - hiddenNum += Object.keys(thread).length; - } - } - } - } - ref5 = hiddenPosts.boards; - for (ID in ref5) { - board = ref5[ID]; - for (ID in board) { - thread = board[ID]; - hiddenNum += Object.keys(thread).length; - } - } - return button.textContent = "Hidden: " + hiddenNum; - }); - $.on(button, 'click', function() { - this.textContent = 'Hidden: 0'; - return $.get('hiddenThreads', $.dict(), function(arg) { - var boardID, hiddenThreads, ref2; - hiddenThreads = arg.hiddenThreads; - if ($.hasStorage && g.SITE.software === 'yotsuba') { - for (boardID in (ref2 = hiddenThreads['4chan.org']) != null ? ref2.boards : void 0) { - localStorage.removeItem("4chan-hide-t-" + boardID); - } - for (boardID in hiddenThreads.boards) { - localStorage.removeItem("4chan-hide-t-" + boardID); - } - } - return $["delete"](['hiddenThreads', 'hiddenPosts']); - }); - }); - return $.after($('input[name="Stubs"]', section).parentNode.parentNode, div); - }, - "export": function() { - var Conf2; - Conf2 = $.dict(); - $.extend(Conf2, Conf); - return $.get(Conf2, function(Conf2) { - delete Conf2['boardConfig']; - return Settings.downloadExport({ - version: g.VERSION, - date: Date.now(), - Conf: Conf2 - }); - }); - }, - downloadExport: function(data) { - var a, blob, p, url; - blob = new Blob([JSON.stringify(data, null, 2)], { - type: 'application/json' - }); - url = URL.createObjectURL(blob); - a = $.el('a', { - download: "4chan X v" + g.VERSION + "-" + data.date + ".json", - href: url - }); - p = $('.imp-exp-result', Settings.dialog); - $.rmAll(p); - $.add(p, a); - return a.click(); - }, - "import": function() { - return $('input[type=file]', this.parentNode).click(); - }, - onImport: function() { - var file, output, reader; - if (!(file = this.files[0])) { - return; - } - this.value = null; - output = $('.imp-exp-result'); - if (!confirm('Your current settings will be entirely overwritten, are you sure?')) { - output.textContent = 'Import aborted.'; - return; - } - reader = new FileReader(); - reader.onload = function(e) { - var err; - try { - return Settings.loadSettings($.dict.json(e.target.result), function(err) { - if (err) { - return output.textContent = 'Import failed due to an error.'; - } else if (confirm('Import successful. Reload now?')) { - return window.location.reload(); - } - }); - } catch (error) { - err = error; - output.textContent = 'Import failed due to an error.'; - return c.error(err.stack); - } - }; - return reader.readAsText(file); - }, - convertFrom: { - loadletter: function(data) { - var base, boardID, convertSettings, key, ref, ref1, threadData, threadID, threads, val; - convertSettings = function(data, map) { - var newKey, prevKey; - for (prevKey in map) { - newKey = map[prevKey]; - if (newKey) { - data.Conf[newKey] = data.Conf[prevKey]; - } - delete data.Conf[prevKey]; - } - return data; - }; - data = convertSettings(data, { - 'Disable 4chan\'s extension': 'Disable Native Extension', - 'Comment Auto-Expansion': '', - 'Remove Slug': '', - 'Always HTTPS': 'Redirect to HTTPS', - 'Check for Updates': '', - 'Recursive Filtering': 'Recursive Hiding', - 'Reply Hiding': 'Reply Hiding Buttons', - 'Thread Hiding': 'Thread Hiding Buttons', - 'Show Stubs': 'Stubs', - 'Image Auto-Gif': 'Replace GIF', - 'Expand All WebM': 'Expand videos', - 'Reveal Spoilers': 'Reveal Spoiler Thumbnails', - 'Expand From Current': 'Expand from here', - 'Current Page': 'Page Count in Stats', - 'Current Page Position': '', - 'Alternative captcha': 'Use Recaptcha v1', - 'Alt index captcha': 'Use Recaptcha v1 on Index', - 'Auto Submit': 'Post on Captcha Completion', - 'Open Reply in New Tab': 'Open Post in New Tab', - 'Remember QR size': 'Remember QR Size', - 'Remember Subject': '', - 'Quote Inline': 'Quote Inlining', - 'Quote Preview': 'Quote Previewing', - 'Indicate OP quote': 'Mark OP Quotes', - 'Indicate You quote': 'Mark Quotes of You', - 'Indicate Cross-thread Quotes': 'Mark Cross-thread Quotes', - 'uniqueid': 'uniqueID', - 'mod': 'capcode', - 'email': '', - 'country': 'flag', - 'md5': 'MD5', - 'openEmptyQR': 'Open empty QR', - 'openQR': 'Open QR', - 'openOptions': 'Open settings', - 'close': 'Close', - 'spoiler': 'Spoiler tags', - 'sageru': 'Toggle sage', - 'code': 'Code tags', - 'sjis': 'SJIS tags', - 'submit': 'Submit QR', - 'watch': 'Watch', - 'update': 'Update', - 'unreadCountTo0': '', - 'expandAllImages': 'Expand images', - 'expandImage': 'Expand image', - 'zero': 'Front page', - 'nextPage': 'Next page', - 'previousPage': 'Previous page', - 'nextThread': 'Next thread', - 'previousThread': 'Previous thread', - 'expandThread': 'Expand thread', - 'openThreadTab': 'Open thread', - 'openThread': 'Open thread tab', - 'nextReply': 'Next reply', - 'previousReply': 'Previous reply', - 'hide': 'Hide', - 'Scrolling': 'Auto Scroll', - 'Verbose': '' - }); - if ('Always CDN' in data.Conf) { - data.Conf['fourchanImageHost'] = data.Conf['Always CDN'] ? 'i.4cdn.org' : ''; - delete data.Conf['Always CDN']; - } - data.Conf.sauces = data.Conf.sauces.replace(/\$\d/g, function(c) { - switch (c) { - case '$1': - return '%TURL'; - case '$2': - return '%URL'; - case '$3': - return '%MD5'; - case '$4': - return '%board'; - default: - return c; - } - }); - ref = Config.hotkeys; - for (key in ref) { - val = ref[key]; - if (key in data.Conf) { - data.Conf[key] = data.Conf[key].replace(/ctrl|alt|meta/g, function(s) { - return "" + (s[0].toUpperCase()) + s.slice(1); - }).replace(/(^|.+\+)[A-Z]$/g, function(s) { - return "Shift+" + s.slice(0, -1) + (s.slice(-1).toLowerCase()); - }); - } - } - if (data.WatchedThreads) { - data.Conf['watchedThreads'] = $.dict.clone({ - '4chan.org': { - boards: {} - } - }); - ref1 = data.WatchedThreads; - for (boardID in ref1) { - threads = ref1[boardID]; - for (threadID in threads) { - threadData = threads[threadID]; - ((base = data.Conf['watchedThreads']['4chan.org'].boards)[boardID] || (base[boardID] = $.dict()))[threadID] = { - excerpt: threadData.textContent - }; - } - } - } - return data; - } - }, - upgrade: function(data, version) { - var addCSS, addSauces, boardID, boards, changes, compareString, corrupted, db, hostname, j, k, key, l, lastChecked, len, len1, len2, len3, line, list, m, name, record, ref, ref1, ref10, ref11, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, rice, set, setD, siteProperties, software, type, uids, val, val2, value; - changes = $.dict(); - set = function(key, value) { - return data[key] = changes[key] = value; - }; - setD = function(key, value) { - if (data[key] == null) { - return set(key, value); - } - }; - addSauces = function(sauces) { - if (data['sauces'] != null) { - sauces = sauces.filter(function(s) { - return data['sauces'].indexOf(s.match(/[^#;\s]+|$/)[0]) < 0; - }); - if (sauces.length) { - return set('sauces', data['sauces'] + '\n\n' + sauces.join('\n')); - } - } - }; - addCSS = function(css) { - if (data['usercss'] == null) { - set('usercss', Config['usercss']); - } - if (data['usercss'].indexOf(css) < 0) { - return set('usercss', css + '\n\n' + data['usercss']); - } - }; - if ((corrupted = version[0] === '"')) { - try { - version = JSON.parse(version); - } catch (error) {} - } - compareString = version.replace(/\d+/g, function(x) { - return ('0000' + x).slice(-5); - }); - if (compareString < '00001.00013.00014.00008') { - for (key in data) { - val = data[key]; - if (!(typeof val === 'string' && typeof Conf[key] !== 'string' && (key !== 'Index Sort' && key !== 'Last Long Reply Thresholds 0' && key !== 'Last Long Reply Thresholds 1'))) { - continue; - } - corrupted = true; - break; - } - } - if (corrupted) { - for (key in data) { - val = data[key]; - if (typeof val === 'string') { - try { - val2 = JSON.parse(val); - set(key, val2); - } catch (error) {} - } - } - } - if (compareString < '00001.00011.00008.00000') { - if (data['Fixed Thread Watcher'] == null) { - set('Fixed Thread Watcher', (ref = data['Toggleable Thread Watcher']) != null ? ref : true); - } - if (data['Exempt Archives from Encryption'] == null) { - set('Exempt Archives from Encryption', (ref1 = data['Except Archives from Encryption']) != null ? ref1 : false); - } - } - if (compareString < '00001.00011.00010.00001') { - if (data['selectedArchives'] != null) { - uids = { - "Moe": 0, - "4plebs Archive": 3, - "Nyafuu Archive": 4, - "Love is Over": 5, - "Rebecca Black Tech": 8, - "warosu": 10, - "fgts": 15, - "not4plebs": 22, - "DesuStorage": 23, - "fireden.net": 24, - "disabled": null - }; - ref2 = data['selectedArchives']; - for (boardID in ref2) { - record = ref2[boardID]; - for (type in record) { - name = record[type]; - if ($.hasOwn(uids, name)) { - record[type] = uids[name]; - } - } - } - set('selectedArchives', data['selectedArchives']); - } - } - if (compareString < '00001.00011.00016.00000') { - if ((rice = Config['usercss'].match(/\/\* Board title rice \*\/(?:\n.+)*/)[0])) { - if ((data['usercss'] != null) && data['usercss'].indexOf(rice) < 0) { - set('usercss', rice + '\n\n' + data['usercss']); - } - } - } - if (compareString < '00001.00011.00017.00000') { - ref3 = ['Persistent QR', 'Color User IDs', 'Fappe Tyme', 'Werk Tyme', 'Highlight Posts Quoting You', 'Highlight Own Posts']; - for (j = 0, len = ref3.length; j < len; j++) { - key = ref3[j]; - if (data[key] == null) { - set(key, key === 'Persistent QR'); - } - } - } - if (compareString < '00001.00011.00017.00006') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^(#?\s*)http:\/\/iqdb\.org\//mg, '$1//iqdb.org/')); - } - } - if (compareString < '00001.00011.00019.00003' && !Settings.dialog) { - $.queueTask(function() { - return Settings.warnings.ads(function(item) { - return new Notice('warning', slice.call(item.childNodes)); - }); - }); - } - if (compareString < '00001.00011.00020.00003') { - ref4 = { - 'Inline Cross-thread Quotes Only': false, - 'Pass Link': true - }; - for (key in ref4) { - value = ref4[key]; - if (data[key] == null) { - set(key, value); - } - } - } - if (compareString < '00001.00011.00021.00003') { - if (data['Remember Your Posts'] == null) { - set('Remember Your Posts', (ref5 = data['Mark Quotes of You']) != null ? ref5 : true); - } - } - if (compareString < '00001.00011.00022.00000') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^(#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(?:IMG|URL))%3Fs\.jpg/mg, '$1')); - set('sauces', data['sauces'].replace(/^#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(?:IMG|T?URL)(?=$|;)/mg, '$&&safe=off')); - } - } - if (compareString < '00001.00011.00022.00002') { - if ((data['Use Recaptcha v1 in Reports'] == null) && data['Use Recaptcha v1'] && !data['Use Recaptcha v2 in Reports']) { - set('Use Recaptcha v1 in Reports', true); - } - } - if (compareString < '00001.00011.00024.00000') { - if ((data['JSON Navigation'] != null) && (data['JSON Index'] == null)) { - set('JSON Index', data['JSON Navigation']); - } - } - if (compareString < '00001.00011.00026.00000') { - if ((data['Oekaki Links'] != null) && (data['Edit Link'] == null)) { - set('Edit Link', data['Oekaki Links']); - } - if (data['Inline Cross-thread Quotes Only'] == null) { - set('Inline Cross-thread Quotes Only', true); - } - } - if (compareString < '00001.00011.00030.00000') { - if (data['Quote Threading'] && (data['Thread Quotes'] == null)) { - set('Thread Quotes', true); - } - } - if (compareString < '00001.00011.00032.00000') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^(#?\s*)http:\/\/3d\.iqdb\.org\//mg, '$1//3d.iqdb.org/')); - } - addSauces(['#https://desustorage.org/_/search/image/%sMD5/', '#https://boards.fireden.net/_/search/image/%sMD5/', '#https://foolz.fireden.net/_/search/image/%sMD5/', '#//www.gif-explode.com/%URL;types:gif']); - } - if (compareString < '00001.00011.00035.00000') { - addSauces(['https://whatanime.ga/?auto&url=%IMG;text:wait']); - } - if (compareString < '00001.00012.00000.00000') { - if (data['Exempt Archives from Encryption'] == null) { - set('Exempt Archives from Encryption', false); - } - if (data['Show New Thread Option in Threads'] == null) { - set('Show New Thread Option in Threads', false); - } - if (data['Show Name and Subject']) { - addCSS('#qr .persona .field {display: block !important;}'); - } - if (data['QR Shortcut'] === false) { - addCSS('#shortcut-qr {display: none;}'); - } - if (data['Bottom QR Link'] === false) { - addCSS('.qr-link-container-bottom {display: none;}'); - } - } - if (compareString < '00001.00012.00000.00006') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^(#?\s*)https:\/\/(?:desustorage|cuckchan)\.org\//mg, '$1https://desuarchive.org/')); - } - } - if (compareString < '00001.00012.00001.00000') { - if ((data['Persistent Thread Watcher'] == null) && (data['Toggleable Thread Watcher'] != null)) { - set('Persistent Thread Watcher', !data['Toggleable Thread Watcher']); - } - } - if (compareString < '00001.00012.00003.00000') { - ref6 = ['Image Hover in Catalog', 'Auto Watch', 'Auto Watch Reply']; - for (k = 0, len1 = ref6.length; k < len1; k++) { - key = ref6[k]; - setD(key, false); - } - } - if (compareString < '00001.00013.00001.00002') { - addSauces(['#//www.bing.com/images/search?q=imgurl:%IMG&view=detailv2&iss=sbi#enterInsights']); - } - if (compareString < '00001.00013.00005.00000') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^(#?\s*)http:\/\/regex\.info\/exif\.cgi/mg, '$1http://exif.regex.info/exif.cgi')); - } - addSauces(Config['sauces'].match(/# Known filename formats:(?:\n.+)*|$/)[0].split('\n')); - } - if (compareString < '00001.00013.00007.00002') { - setD('Require OP Quote Link', true); - } - if (compareString < '00001.00013.00008.00000') { - setD('Download Link', true); - } - if (compareString < '00001.00013.00009.00003') { - if (data['jsWhitelist'] != null) { - list = data['jsWhitelist'].split('\n'); - if (indexOf.call(list, 'https://cdnjs.cloudflare.com') < 0 && indexOf.call(list, 'https://cdn.mathjax.org') >= 0) { - set('jsWhitelist', data['jsWhitelist'] + '\n\nhttps://cdnjs.cloudflare.com'); - } - } - } - if (compareString < '00001.00014.00000.00006') { - if (data['siteSoftware'] != null) { - set('siteSoftware', data['siteSoftware'] + '\n4cdn.org yotsuba'); - } - } - if (compareString < '00001.00014.00003.00002') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^(#?\s*)https:\/\/whatanime\.ga\//mg, '$1https://trace.moe/')); - } - } - if (compareString < '00001.00014.00004.00004') { - if ((data['siteSoftware'] != null) && !/^4channel\.org yotsuba$/m.test(data['siteSoftware'])) { - set('siteSoftware', data['siteSoftware'] + '\n4channel.org yotsuba'); - } - } - if (compareString < '00001.00014.00005.00000') { - ref7 = DataBoard.keys; - for (l = 0, len2 = ref7.length; l < len2; l++) { - db = ref7[l]; - if ((ref8 = data[db]) != null ? ref8.boards : void 0) { - ref9 = data[db], boards = ref9.boards, lastChecked = ref9.lastChecked; - data[db]['4chan.org'] = { - boards: boards, - lastChecked: lastChecked - }; - delete data[db].boards; - delete data[db].lastChecked; - set(db, data[db]); - } - } - if ((data['siteSoftware'] != null) && (data['siteProperties'] == null)) { - siteProperties = $.dict(); - ref10 = data['siteSoftware'].split('\n'); - for (m = 0, len3 = ref10.length; m < len3; m++) { - line = ref10[m]; - ref11 = line.split(' '), hostname = ref11[0], software = ref11[1]; - siteProperties[hostname] = { - software: software - }; - } - set('siteProperties', siteProperties); - } - } - if (compareString < '00001.00014.00006.00006') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/\/\/%\$1\.deviantart\.com\/gallery\/#\/d%\$2;regexp:\/\^\\w\+_by_\(\\w\+\)-d\(\[\\da-z\]\+\)\//g, '//www.deviantart.com/gallery/#/d%$1%$2;regexp:/^\\w+_by_\\w+[_-]d([\\da-z]{6})\\b|^d([\\da-z]{6})-[\\da-z]{8}-/')); - } - } - if (compareString < '00001.00014.00008.00000') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/https:\/\/www\.yandex\.com\/images\/search/g, 'https://yandex.com/images/search')); - } - } - if (compareString < '00001.00014.00009.00000') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^(#?\s*)(?:http:)?\/\/(www\.pixiv\.net|www\.deviantart\.com|imgur\.com|flickr\.com)\//mg, '$1https://$2/')); - set('sauces', data['sauces'].replace(/https:\/\/yandex\.com\/images\/search\?rpt=imageview&img_url=%IMG/g, 'https://yandex.com/images/search?rpt=imageview&url=%IMG')); - } - } - if (compareString < '00001.00014.00009.00001') { - if ((data['Use Faster Image Host'] != null) && (data['fourchanImageHost'] == null)) { - set('fourchanImageHost', (data['Use Faster Image Host'] ? 'i.4cdn.org' : '')); - } - } - if (compareString < '00001.00014.00010.00001') { - if (data['Filter in Native Catalog'] == null) { - set('Filter in Native Catalog', false); - } - } - if (compareString < '00001.00014.00012.00008') { - if (data['boardnav'] == null) { - set('boardnav', "[ toggle-all ]\na-replace\nc-replace\ng-replace\nk-replace\nv-replace\nvg-replace\nvr-replace\nck-replace\nco-replace\nfit-replace\njp-replace\nmu-replace\nsp-replace\ntv-replace\nvp-replace\n[external-text:\"FAQ\",\"https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions\"]"); - } - } - if (compareString < '00001.00014.00016.00001') { - if (data['archiveLists'] != null) { - set('archiveLists', data['archiveLists'].replace('https://mayhemydg.github.io/archives.json/archives.json', 'https://nstepien.github.io/archives.json/archives.json')); - } - } - if (compareString < '00001.00014.00016.00007') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/https:\/\/www\.deviantart\.com\/gallery\/#\/d%\$1%\$2;regexp:\/\^\\w\+_by_\\w\+\[_-\]d\(\[\\da-z\]\{6\}\)\\b\|\^d\(\[\\da-z\]\{6\}\)-\[\\da-z\]\{8\}-\//g, 'javascript:void(open("https://www.deviantart.com/"+%$1.replace(/_/g,"-")+"/art/"+parseInt(%$2,36)));regexp:/^\\w+_by_(\\w+)[_-]d([\\da-z]{6})\\b/').replace(/\/\/imgops\.com\/%URL/g, '//imgops.com/start?url=%URL')); - } - } - if (compareString < '00001.00014.00017.00002') { - if (data['jsWhitelist'] != null) { - set('jsWhitelist', data['jsWhitelist'] + '\n\nhttps://hcaptcha.com\nhttps://*.hcaptcha.com'); - } - } - if (compareString < '00001.00014.00020.00004') { - if (data['archiveLists'] != null) { - set('archiveLists', data['archiveLists'].replace('https://nstepien.github.io/archives.json/archives.json', 'https://4chenz.github.io/archives.json/archives.json')); - } - } - if (compareString < '00001.00014.00022.00003') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(IMG|T?URL)&safe=off(?=$|;)/mg, 'https://www.google.com/searchbyimage?sbisrc=4chanx&image_url=%$1&safe=off')); - if (compareString === '00001.00014.00022.00002' && !/\bsbisrc=/.test(data['sauces'])) { - set('sauces', data['sauces'].replace(/^#?\s*https:\/\/lens\.google\.com\/uploadbyurl\?url=%(IMG|T?URL)(?=$|;)/m, 'https://www.google.com/searchbyimage?sbisrc=4chanx&image_url=%$1&safe=off')); - } - } - addSauces(['#https://lens.google.com/uploadbyurl?url=%IMG;text:lens']); - } - return changes; - }, - loadSettings: function(data, cb) { - if (data.version.split('.')[0] === '2') { - data = Settings.convertFrom.loadletter(data); - } else if (data.version !== g.VERSION) { - Settings.upgrade(data.Conf, data.version); - } - return $.clear(function(err) { - if (err) { - return cb(err); - } - return $.set(data.Conf, cb); - }); - }, - reset: function() { - if (confirm('Your current settings will be entirely wiped, are you sure?')) { - return $.clear(function(err) { - if (err) { - return $('.imp-exp-result').textContent = 'Import failed due to an error.'; - } else if (confirm('Reset successful. Reload now?')) { - return window.location.reload(); - } - }); - } - }, - filter: function(section) { - var select; - $.extend(section, {innerHTML: "
      "}); - select = $('select', section); - $.on(select, 'change', Settings.selectFilter); - return Settings.selectFilter.call(select); - }, - selectFilter: function() { - var div, filterTypes, name, ta; - div = this.nextElementSibling; - if ((name = this.value) !== 'guide') { - if (!$.hasOwn(Config.filter, name)) { - return; - } - $.rmAll(div); - ta = $.el('textarea', { - name: name, - className: 'field', - spellcheck: false - }); - $.on(ta, 'change', $.cb.value); - $.get(name, Conf[name], function(item) { - ta.value = item[name]; - return $.add(div, ta); - }); - return; - } - filterTypes = Object.keys(Config.filter).filter(function(x) { - return x !== 'general'; - }).map(function(x, i) { - return {innerHTML: ((i) ? "," : "") + "" + E(x)}; - }); - $.extend(div, {innerHTML: "
      Filter is disabled.

      Use regular expressions, one per line.
      Lines starting with a # will be ignored.
      For example, /weeaboo/i will filter posts containing the string `weeaboo`, case-insensitive.
      MD5 and Unique ID filtering use exact string matching, not regular expressions.

        You can use these settings with each regular expression, separate them with semicolons:
      • Per boards, separate them with commas. It is global if not specified. Use sfw and nsfw to reference all worksafe or not-worksafe boards.
        For example: boards:a,jp;.
        To specify boards on a particular site, put the beginning of the domain and a slash character before the list.
        Any initial www. should not be included, and all 4chan domains are considered 4chan.org.
        For example: boards:4:a,jp,sama:a,z;.
        An asterisk can be used to specify all boards on a site.
        For example: boards:4:*;.
      • Select boards to be excluded from the filter. The syntax is the same as for the boards: option above.
        For example: exclude:vg,v;.
      • Filter OPs only along with their threads (`only`) or replies only (`no`).
        For example: op:only; or op:no;.
      • Filter only posts with files (`only`) or only posts without files (`no`).
        For example: file:only; or file:no;.
      • Overrule the `Show Stubs` setting if specified: create a stub (`yes`) or not (`no`).
        For example: stub:yes; or stub:no;.
      • Highlight instead of hiding. You can specify a class name to use with a userstyle.
        For example: highlight; or highlight:wallpaper;.
      • Highlighted OPs will have their threads put on top of the board index by default.
        For example: top:yes; or top:no;.
      • Show a desktop notification instead of hiding.
        For example: notify;.
      • Filters in the \"General\" section apply to multiple fields, by default subject,name,filename,comment.
        The fields can be specified with the type option, separated by commas.
        For example: type:" + E.cat(filterTypes) + ";.
        Types can also be combined with a + sign; this indicates the filter applies to the given fields joined by newlines.
        For example: type:filename+filesize+dimensions;.
      "}); - return $('.warning', div).hidden = Conf['Filter']; - }, - sauce: function(section) { - var ta; - $.extend(section, {innerHTML: "
      Sauce is disabled.
      These parameters will be replaced by their corresponding values in the URL and displayed text:
      • %IMG: Full image URL for GIF, JPG, and PNG; thumbnail URL for other types.
      • %URL: Full image URL.
      • %TURL: Thumbnail URL.
      • %name: Original file name.
      • %board: Current board.
      • %MD5: MD5 hash in base64.
      • %sMD5: MD5 hash in base64 using - and _.
      • %hMD5: MD5 hash in hexadecimal.
      • %$0: Matched regular expression within the filename.
      • %$1, %$2, %$3, ... : Subexpressions within the matched regular expression.
      • %%, %semi: Literal % and ;.
      Lines starting with a # will be ignored.
      You can specify a display text by appending ;text:[text] to the URL.
      You can specify the applicable boards/sites by appending ;boards:[board1],[board2]. See the Filter guide for details.
      You can specify the applicable file types by appending ;types:[extension1],[extension2].
      You can specify a regular expression the filename must match by appending ;regexp:[regular expression].
      "}); - $('.warning', section).hidden = Conf['Sauce']; - ta = $('textarea', section); - $.get('sauces', Conf['sauces'], function(item) { - ta.value = item['sauces']; - return ta.hidden = false; - }); - return $.on(ta, 'change', $.cb.value); - }, - advanced: function(section) { - var applyCSS, boardSelect, customCSS, event, input, inputs, interval, items, itemsArchive, j, k, l, len, len1, len2, len3, listImageHost, m, name, ref, ref1, ref2, ref3, ref4, table, textContent, updateArchives, warning; - $.extend(section, {innerHTML: "
      Archives
      404 Redirect is disabled.
      Thread redirectionPost fetchingFile redirection

      Archive Lists: Each line below should be an archive list in this format or a URL to load an archive list from.
      Archive properties can be overriden by another item with the same uid (or if absent, its name).
      Last updated:
      External Catalog
      External Catalog is disabled. This will be used only as a fallback.
      URLs of external catalog sites, where %board is to be replaced by the board name.
      Each URL should be followed by ;boards: and optionally ;exclude: and a list of supported/excluded boards in the format explained in the Filter guide.
      Override 4chan Image Host
      Change 4chan image links to this domain. Leave blank for no change.
      Captcha Language
      Choose from list of language codes. Leave blank to autoselect.
      Custom Board Navigation
      New lines will be converted into spaces.

      In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
      Board link: g
      Archive link: g-archive
      Internal archive link: g-expired
      Title link: g-title
      Board link (Replace with title when on that board): g-replace
      Full text link: g-full
      Custom text link: g-text:"Install Gentoo"
      Index-only link: g-index
      Catalog-only link: g-catalog
      Index mode: g-mode:"infinite scrolling"
      Index sort: g-sort:"creation date rev"
      External link: external-text:"Google","http://www.google.com"
      Open in new tab: g-nt
      Combinations are possible: g-index-text:"Technology Index"
      Full board list toggle: toggle-all

      [ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:"Piracy"]
      will give you
      [ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
      if you are on /g/.
      Time Formatting is disabled.
      :
      Day: %a, %A, %d, %e
      Month: %m, %b, %B
      Year: %y, %Y
      Hour: %k, %H, %l, %I, %p, %P
      Minute: %M
      Second: %S
      Literal %: %%
      Quote Backlinks formatting is disabled.
      :
      Default pasted content filename
      .png
      File Info Formatting is disabled.
      :
      Link: %l (truncated), %L (untruncated), %T (4chan filename)
      Filename: %n (truncated), %N (untruncated), %t (4chan filename)
      Download button: %d
      Quick filter MD5: %f
      Spoiler indicator: %p
      Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
      Resolution: %r (Displays 'PDF' for PDF files)
      Tag: %g
      Literal %: %%
      Quick Reply Personas

      One item per line.
      Items will be added in the relevant input's auto-completion list.
      Password items will always be used, since there is no password input.
      Lines starting with a # will be ignored.

        You can use these settings with each item, separate them with semicolons:
      • Possible items are: name, options (or equivalently email), subject and password.
      • Wrap values of items with quotes, like this: options:"sage".
      • Force values as defaults with the always keyword, for example: options:"sage";always.
      • Select specific boards for an item, separated with commas, for example: options:"sage";boards:jp;always.
      Unread Favicon is disabled.
      Thread Updater is disabled.
      Interval: seconds
      Custom Cooldown Time
      Seconds:
      For more information about customizing 4chan X's CSS, see the styling guide.
      Javascript Whitelist
      Sources from which Javascript is allowed to be loaded by Content Security Policy.
      Lines starting with a # will be ignored.
      Known Banners
      List of known banners, used for click-to-change feature.
      "}); - ref = $$('.warning', section); - for (j = 0, len = ref.length; j < len; j++) { - warning = ref[j]; - warning.hidden = Conf[warning.dataset.feature]; - } - inputs = $.dict(); - ref1 = $$('[name]', section); - for (k = 0, len1 = ref1.length; k < len1; k++) { - input = ref1[k]; - inputs[input.name] = input; - } - $.on(inputs['archiveLists'], 'change', function() { - $.set('lastarchivecheck', 0); - Conf['lastarchivecheck'] = 0; - return $.id('lastarchivecheck').textContent = 'never'; - }); - items = $.dict(); - for (name in inputs) { - input = inputs[name]; - if (!(name !== 'Interval' && name !== 'Custom CSS')) { - continue; - } - items[name] = Conf[name]; - event = (input.nodeName === 'SELECT' || ((ref2 = input.type) === 'checkbox' || ref2 === 'radio') || (input.nodeName === 'TEXTAREA' && !(name in Settings))) ? 'change' : 'input'; - $.on(input, event, $.cb[input.type === 'checkbox' ? 'checked' : 'value']); - if (name in Settings) { - $.on(input, event, Settings[name]); - } - } - $.get(items, function(items) { - var key, val; - for (key in items) { - val = items[key]; - input = inputs[key]; - input[input.type === 'checkbox' ? 'checked' : 'value'] = val; - input.hidden = false; - if (key in Settings) { - Settings[key].call(input); - } - } - }); - listImageHost = $.id('list-fourchanImageHost'); - ref3 = ImageHost.suggestions; - for (l = 0, len2 = ref3.length; l < len2; l++) { - textContent = ref3[l]; - $.add(listImageHost, $.el('option', { - textContent: textContent - })); - } - interval = inputs['Interval']; - customCSS = inputs['Custom CSS']; - applyCSS = $('#apply-css', section); - interval.value = Conf['Interval']; - customCSS.checked = Conf['Custom CSS']; - inputs['usercss'].disabled = !Conf['Custom CSS']; - applyCSS.disabled = !Conf['Custom CSS']; - $.on(interval, 'change', ThreadUpdater.cb.interval); - $.on(customCSS, 'change', Settings.togglecss); - $.on(applyCSS, 'click', function() { - return CustomCSS.update(); - }); - itemsArchive = $.dict(); - ref4 = ['archives', 'selectedArchives', 'lastarchivecheck']; - for (m = 0, len3 = ref4.length; m < len3; m++) { - name = ref4[m]; - itemsArchive[name] = Conf[name]; - } - $.get(itemsArchive, function(itemsArchive) { - $.extend(Conf, itemsArchive); - Redirect.selectArchives(); - return Settings.addArchiveTable(section); - }); - boardSelect = $('#archive-board-select', section); - table = $('#archive-table', section); - updateArchives = $('#update-archives', section); - $.on(boardSelect, 'change', function() { - $('tbody > :not([hidden])', table).hidden = true; - return $("tbody > ." + this.value, table).hidden = false; - }); - return $.on(updateArchives, 'click', function() { - return Redirect.update(function() { - return Settings.addArchiveTable(section); - }); - }); - }, - addArchiveTable: function(section) { - var archBoards, archive, boardID, boardOptions, boardSelect, boards, data, files, id, item, j, k, l, len, len1, len2, len3, m, name, o, ref, ref1, ref2, ref3, ref4, row, rows, select, software, table, tbody, type, uid; - $('#lastarchivecheck', section).textContent = Conf['lastarchivecheck'] === 0 ? 'never' : new Date(Conf['lastarchivecheck']).toLocaleString(); - boardSelect = $('#archive-board-select', section); - table = $('#archive-table', section); - tbody = $('tbody', section); - $.rmAll(boardSelect); - $.rmAll(tbody); - archBoards = $.dict(); - ref = Conf['archives']; - for (j = 0, len = ref.length; j < len; j++) { - ref1 = ref[j], uid = ref1.uid, name = ref1.name, boards = ref1.boards, files = ref1.files, software = ref1.software; - if (software !== 'fuuka' && software !== 'foolfuuka') { - continue; - } - for (k = 0, len1 = boards.length; k < len1; k++) { - boardID = boards[k]; - o = archBoards[boardID] || (archBoards[boardID] = { - thread: [], - post: [], - file: [] - }); - archive = [uid != null ? uid : name, name]; - o.thread.push(archive); - if (software === 'foolfuuka') { - o.post.push(archive); - } - if (indexOf.call(files, boardID) >= 0) { - o.file.push(archive); - } - } - } - rows = []; - boardOptions = []; - ref2 = Object.keys(archBoards).sort(); - for (l = 0, len2 = ref2.length; l < len2; l++) { - boardID = ref2[l]; - row = $.el('tr', { - className: "board-" + boardID - }); - row.hidden = boardID !== g.BOARD.ID; - boardOptions.push($.el('option', { - textContent: "/" + boardID + "/", - value: "board-" + boardID, - selected: boardID === g.BOARD.ID - })); - o = archBoards[boardID]; - ref3 = ['thread', 'post', 'file']; - for (m = 0, len3 = ref3.length; m < len3; m++) { - item = ref3[m]; - $.add(row, Settings.addArchiveCell(boardID, o, item)); - } - rows.push(row); - } - if (rows.length === 0) { - boardSelect.hidden = table.hidden = true; - return; - } - boardSelect.hidden = table.hidden = false; - if (!(g.BOARD.ID in archBoards)) { - rows[0].hidden = false; - } - $.add(boardSelect, boardOptions); - $.add(tbody, rows); - ref4 = Conf['selectedArchives']; - for (boardID in ref4) { - data = ref4[boardID]; - for (type in data) { - id = data[type]; - if ((select = $("select[data-boardid='" + boardID + "'][data-type='" + type + "']", tbody))) { - select.value = JSON.stringify(id); - if (!select.value) { - select.value = select.firstChild.value; - } - } - } - } - }, - addArchiveCell: function(boardID, data, type) { - var archive, i, length, options, select, td; - length = data[type].length; - td = $.el('td', { - className: 'archive-cell' - }); - if (!length) { - td.textContent = '--'; - return td; - } - options = []; - i = 0; - while (i < length) { - archive = data[type][i++]; - options.push($.el('option', { - value: JSON.stringify(archive[0]), - textContent: archive[1] - })); - } - $.extend(td, {innerHTML: ""}); - select = td.firstElementChild; - if (!(select.disabled = length === 1)) { - select.setAttribute('data-boardid', boardID); - select.setAttribute('data-type', type); - $.on(select, 'change', Settings.saveSelectedArchive); - } - $.add(select, options); - return td; - }, - saveSelectedArchive: function() { - return $.get('selectedArchives', Conf['selectedArchives'], (function(_this) { - return function(arg) { - var name1, selectedArchives; - selectedArchives = arg.selectedArchives; - (selectedArchives[name1 = _this.dataset.boardid] || (selectedArchives[name1] = $.dict()))[_this.dataset.type] = JSON.parse(_this.value); - $.set('selectedArchives', selectedArchives); - Conf['selectedArchives'] = selectedArchives; - return Redirect.selectArchives(); - }; - })(this)); - }, - boardnav: function() { - return Header.generateBoardList(this.value); - }, - time: function() { - return this.nextElementSibling.textContent = Time.format(this.value, new Date()); - }, - timeLocale: function() { - return Settings.time.call($('[name=time]', Settings.dialog)); - }, - backlink: function() { - return this.nextElementSibling.textContent = this.value.replace(/%(?:id|%)/g, function(x) { - return { - '%id': '123456789', - '%%': '%' - }[x]; - }); - }, - fileInfo: function() { - var data; - data = { - isReply: true, - file: { - url: "//" + (ImageHost.host()) + "/g/1334437723720.jpg", - name: 'd9bb2efc98dd0df141a94399ff5880b7.jpg', - size: '276 KB', - sizeInBytes: 276 * 1024, - dimensions: '1280x720', - isImage: true, - isVideo: false, - isSpoiler: true, - tag: 'Loop' - } - }; - return FileInfo.format(this.value, data, this.nextElementSibling); - }, - favicon: function() { - var f, i, icon, img, j, len, ref; - Favicon["switch"](); - if (g.VIEW === 'thread' && Conf['Unread Favicon']) { - Unread.update(); - } - img = this.nextElementSibling.children; - f = Favicon; - ref = [f.SFW, f.unreadSFW, f.unreadSFWY, f.NSFW, f.unreadNSFW, f.unreadNSFWY, f.dead, f.unreadDead, f.unreadDeadY]; - for (i = j = 0, len = ref.length; j < len; i = ++j) { - icon = ref[i]; - if (!img[i]) { - $.add(this.nextElementSibling, $.el('img')); - } - img[i].src = icon; - } - }, - togglecss: function() { - if ($('textarea[name=usercss]', $.x('ancestor::fieldset[1]', this)).disabled = $.id('apply-css').disabled = !this.checked) { - CustomCSS.rmStyle(); - } else { - CustomCSS.addStyle(); - } - return $.cb.checked.call(this); - }, - keybinds: function(section) { - var arr, input, inputs, items, key, ref, tbody, tr; - $.extend(section, {innerHTML: "
      Keybinds are disabled.
      Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
      Press Backspace to disable a keybind.
      ActionsKeybinds
      "}); - $('.warning', section).hidden = Conf['Keybinds']; - tbody = $('tbody', section); - items = $.dict(); - inputs = $.dict(); - ref = Config.hotkeys; - for (key in ref) { - arr = ref[key]; - tr = $.el('tr', {innerHTML: "" + E(arr[1]) + ""}); - input = $('input', tr); - input.name = key; - input.spellcheck = false; - items[key] = Conf[key]; - inputs[key] = input; - $.on(input, 'keydown', Settings.keybind); - $.add(tbody, tr); - } - return $.get(items, function(items) { - var val; - for (key in items) { - val = items[key]; - inputs[key].value = val; - } - }); - }, - keybind: function(e) { - var key; - if (e.keyCode === 9) { - return; - } - e.preventDefault(); - e.stopPropagation(); - if ((key = Keybinds.keyCode(e)) == null) { - return; - } - this.value = key; - return $.cb.value.call(this); - } - }; - - return Settings; - -}).call(this); - -Test = (function() { - return Test; - -}).call(this); - -UI = (function() { - var Menu, UI, checkbox, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - slice = [].slice; - - dialog = function(id, properties) { - var child, el, i, len, move, ref; - el = $.el('div', { - className: 'dialog', - id: id - }); - $.extend(el, properties); - el.style.cssText = Conf[id + ".position"]; - move = $('.move', el); - $.on(move, 'touchstart mousedown', dragstart); - ref = move.children; - for (i = 0, len = ref.length; i < len; i++) { - child = ref[i]; - if (!child.tagName) { - continue; - } - $.on(child, 'touchstart mousedown', function(e) { - return e.stopPropagation(); - }); - } - return el; - }; - - Menu = (function() { - var currentMenu, lastToggledButton; - - currentMenu = null; - - lastToggledButton = null; - - function Menu(type) { - this.type = type; - this.addEntry = bind(this.addEntry, this); - this.onFocus = bind(this.onFocus, this); - this.keybinds = bind(this.keybinds, this); - this.close = bind(this.close, this); - this.setPosition = bind(this.setPosition, this); - $.on(d, 'AddMenuEntry', (function(_this) { - return function(arg) { - var detail; - detail = arg.detail; - if (detail.type !== _this.type) { - return; - } - delete detail.open; - return _this.addEntry(detail); - }; - })(this)); - this.entries = []; - } - - Menu.prototype.makeMenu = function() { - var menu; - menu = $.el('div', { - className: 'dialog', - id: 'menu', - tabIndex: 0 - }); - menu.dataset.type = this.type; - $.on(menu, 'click', function(e) { - return e.stopPropagation(); - }); - $.on(menu, 'keydown', this.keybinds); - return menu; - }; - - Menu.prototype.toggle = function(e, button, data) { - var previousButton; - e.preventDefault(); - e.stopPropagation(); - if (currentMenu) { - previousButton = lastToggledButton; - currentMenu.close(); - if (previousButton === button) { - return; - } - } - if (!this.entries.length) { - return; - } - return this.open(button, data); - }; - - Menu.prototype.open = function(button, data) { - var entry, i, len, menu, ref; - menu = this.menu = this.makeMenu(); - currentMenu = this; - lastToggledButton = button; - this.entries.sort(function(first, second) { - return first.order - second.order; - }); - ref = this.entries; - for (i = 0, len = ref.length; i < len; i++) { - entry = ref[i]; - this.insertEntry(entry, menu, data); - } - $.addClass(lastToggledButton, 'active'); - $.on(d, 'click CloseMenu', this.close); - $.on(d, 'scroll', this.setPosition); - $.on(window, 'resize', this.setPosition); - $.after(button, menu); - this.setPosition(); - entry = $('.entry', menu); - this.focus(entry); - return menu.focus(); - }; - - Menu.prototype.setPosition = function() { - var bLeft, bRect, bTop, bottom, cHeight, cWidth, left, mRect, ref, ref1, right, top; - mRect = this.menu.getBoundingClientRect(); - bRect = lastToggledButton.getBoundingClientRect(); - bTop = window.scrollY + bRect.top; - bLeft = window.scrollX + bRect.left; - cHeight = doc.clientHeight; - cWidth = doc.clientWidth; - ref = bRect.top + bRect.height + mRect.height < cHeight ? [bRect.bottom + "px", ''] : ['', (cHeight - bRect.top) + "px"], top = ref[0], bottom = ref[1]; - ref1 = bRect.left + mRect.width < cWidth ? [bRect.left + "px", ''] : ['', (cWidth - bRect.right) + "px"], left = ref1[0], right = ref1[1]; - $.extend(this.menu.style, { - top: top, - right: right, - bottom: bottom, - left: left - }); - return this.menu.classList.toggle('left', right); - }; - - Menu.prototype.insertEntry = function(entry, parent, data) { - var err, i, len, ref, subEntry, submenu; - if (typeof entry.open === 'function') { - try { - if (!entry.open(data)) { - return; - } - } catch (error) { - err = error; - Main.handleErrors({ - message: "Error in building the " + this.type + " menu.", - error: err - }); - return; - } - } - $.add(parent, entry.el); - if (!entry.subEntries) { - return; - } - if (submenu = $('.submenu', entry.el)) { - $.rm(submenu); - } - submenu = $.el('div', { - className: 'dialog submenu' - }); - ref = entry.subEntries; - for (i = 0, len = ref.length; i < len; i++) { - subEntry = ref[i]; - this.insertEntry(subEntry, submenu, data); - } - $.add(entry.el, submenu); - }; - - Menu.prototype.close = function() { - $.rm(this.menu); - delete this.menu; - $.rmClass(lastToggledButton, 'active'); - currentMenu = null; - lastToggledButton = null; - $.off(d, 'click scroll CloseMenu', this.close); - $.off(d, 'scroll', this.setPosition); - return $.off(window, 'resize', this.setPosition); - }; - - Menu.prototype.findNextEntry = function(entry, direction) { - var entries; - entries = slice.call(entry.parentNode.children); - entries.sort(function(first, second) { - return first.style.order - second.style.order; - }); - return entries[entries.indexOf(entry) + direction]; - }; - - Menu.prototype.keybinds = function(e) { - var entry, next, nextPrev, subEntry, submenu; - entry = $('.focused', this.menu); - while (subEntry = $('.focused', entry)) { - entry = subEntry; - } - switch (e.keyCode) { - case 27: - lastToggledButton.focus(); - this.close(); - break; - case 13: - case 32: - entry.click(); - break; - case 38: - if (next = this.findNextEntry(entry, -1)) { - this.focus(next); - } - break; - case 40: - if (next = this.findNextEntry(entry, +1)) { - this.focus(next); - } - break; - case 39: - if ((submenu = $('.submenu', entry)) && (next = submenu.firstElementChild)) { - while (nextPrev = this.findNextEntry(next, -1)) { - next = nextPrev; - } - this.focus(next); - } - break; - case 37: - if (next = $.x('parent::*[contains(@class,"submenu")]/parent::*', entry)) { - this.focus(next); - } - break; - default: - return; - } - e.preventDefault(); - return e.stopPropagation(); - }; - - Menu.prototype.onFocus = function(e) { - e.stopPropagation(); - return this.focus(e.target); - }; - - Menu.prototype.focus = function(entry) { - var bottom, cHeight, cWidth, eRect, focused, i, left, len, ref, ref1, ref2, right, sRect, style, submenu, top; - while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) { - $.rmClass(focused, 'focused'); - } - ref = $$('.focused', entry); - for (i = 0, len = ref.length; i < len; i++) { - focused = ref[i]; - $.rmClass(focused, 'focused'); - } - $.addClass(entry, 'focused'); - if (!(submenu = $('.submenu', entry))) { - return; - } - sRect = submenu.getBoundingClientRect(); - eRect = entry.getBoundingClientRect(); - cHeight = doc.clientHeight; - cWidth = doc.clientWidth; - ref1 = eRect.top + sRect.height < cHeight ? ['0px', 'auto'] : ['auto', '0px'], top = ref1[0], bottom = ref1[1]; - ref2 = eRect.right + sRect.width < cWidth - 150 ? ['100%', 'auto'] : ['auto', '100%'], left = ref2[0], right = ref2[1]; - style = submenu.style; - style.top = top; - style.bottom = bottom; - style.left = left; - return style.right = right; - }; - - Menu.prototype.addEntry = function(entry) { - this.parseEntry(entry); - return this.entries.push(entry); - }; - - Menu.prototype.parseEntry = function(entry) { - var el, i, len, subEntries, subEntry; - el = entry.el, subEntries = entry.subEntries; - $.addClass(el, 'entry'); - $.on(el, 'focus mouseover', this.onFocus); - el.style.order = entry.order || 100; - if (!subEntries) { - return; - } - $.addClass(el, 'has-submenu'); - for (i = 0, len = subEntries.length; i < len; i++) { - subEntry = subEntries[i]; - this.parseEntry(subEntry); - } - }; - - return Menu; - - })(); - - dragstart = function(e) { - var el, isTouching, o, rect, ref, screenHeight, screenWidth; - if (e.type === 'mousedown' && e.button !== 0) { - return; - } - e.preventDefault(); - if (isTouching = e.type === 'touchstart') { - e = e.changedTouches[e.changedTouches.length - 1]; - } - el = $.x('ancestor::div[contains(@class,"dialog")][1]', this); - rect = el.getBoundingClientRect(); - screenHeight = doc.clientHeight; - screenWidth = doc.clientWidth; - o = { - id: el.id, - style: el.style, - dx: e.clientX - rect.left, - dy: e.clientY - rect.top, - height: screenHeight - rect.height, - width: screenWidth - rect.width, - screenHeight: screenHeight, - screenWidth: screenWidth, - isTouching: isTouching - }; - ref = Conf['Header auto-hide'] || !Conf['Fixed Header'] ? [0, 0] : Conf['Bottom Header'] ? [0, Header.bar.getBoundingClientRect().height] : [Header.bar.getBoundingClientRect().height, 0], o.topBorder = ref[0], o.bottomBorder = ref[1]; - if (isTouching) { - o.identifier = e.identifier; - o.move = touchmove.bind(o); - o.up = touchend.bind(o); - $.on(d, 'touchmove', o.move); - return $.on(d, 'touchend touchcancel', o.up); - } else { - o.move = drag.bind(o); - o.up = dragend.bind(o); - $.on(d, 'mousemove', o.move); - return $.on(d, 'mouseup', o.up); - } - }; - - touchmove = function(e) { - var i, len, ref, touch; - ref = e.changedTouches; - for (i = 0, len = ref.length; i < len; i++) { - touch = ref[i]; - if (touch.identifier === this.identifier) { - drag.call(this, touch); - return; - } - } - }; - - drag = function(e) { - var bottom, clientX, clientY, left, right, style, top; - clientX = e.clientX, clientY = e.clientY; - left = clientX - this.dx; - left = left < 10 ? 0 : this.width - left < 10 ? '' : left / this.screenWidth * 100 + '%'; - top = clientY - this.dy; - top = top < (10 + this.topBorder) ? this.topBorder + 'px' : this.height - top < (10 + this.bottomBorder) ? '' : top / this.screenHeight * 100 + '%'; - right = left === '' ? 0 : ''; - bottom = top === '' ? this.bottomBorder + 'px' : ''; - style = this.style; - style.left = left; - style.right = right; - style.top = top; - return style.bottom = bottom; - }; - - touchend = function(e) { - var i, len, ref, touch; - ref = e.changedTouches; - for (i = 0, len = ref.length; i < len; i++) { - touch = ref[i]; - if (touch.identifier === this.identifier) { - dragend.call(this); - return; - } - } - }; - - dragend = function() { - if (this.isTouching) { - $.off(d, 'touchmove', this.move); - $.off(d, 'touchend touchcancel', this.up); - } else { - $.off(d, 'mousemove', this.move); - $.off(d, 'mouseup', this.up); - } - return $.set(this.id + ".position", this.style.cssText); - }; - - hoverstart = function(arg) { - var cb, el, endEvents, height, latestEvent, noRemove, o, rect, ref, root, width; - root = arg.root, el = arg.el, latestEvent = arg.latestEvent, endEvents = arg.endEvents, height = arg.height, width = arg.width, cb = arg.cb, noRemove = arg.noRemove; - rect = root.getBoundingClientRect(); - o = { - root: root, - el: el, - style: el.style, - isImage: (ref = el.nodeName) === 'IMG' || ref === 'VIDEO', - cb: cb, - endEvents: endEvents, - latestEvent: latestEvent, - clientHeight: doc.clientHeight, - clientWidth: doc.clientWidth, - height: height, - width: width, - noRemove: noRemove, - clientX: (rect.left + rect.right) / 2, - clientY: (rect.top + rect.bottom) / 2 - }; - o.hover = hover.bind(o); - o.hoverend = hoverend.bind(o); - o.hover(o.latestEvent); - new MutationObserver(function() { - if (el.parentNode) { - return o.hover(o.latestEvent); - } - }).observe(el, { - childList: true - }); - $.on(root, endEvents, o.hoverend); - if ($.x('ancestor::div[contains(@class,"inline")][1]', root)) { - $.on(d, 'keydown', o.hoverend); - } - $.on(root, 'mousemove', o.hover); - o.workaround = function(e) { - if (!root.contains(e.target)) { - return o.hoverend(e); - } - }; - return $.on(doc, 'mousemove', o.workaround); - }; - - hoverstart.padding = 25; - - hover = function(e) { - var clientX, clientY, height, left, marginX, ref, ref1, right, style, threshold, top, width; - this.latestEvent = e; - height = (this.height || this.el.offsetHeight) + hoverstart.padding; - width = this.width || this.el.offsetWidth; - ref = Conf['Follow Cursor'] ? e : this, clientX = ref.clientX, clientY = ref.clientY; - top = this.isImage ? Math.max(0, clientY * (this.clientHeight - height) / this.clientHeight) : Math.max(0, Math.min(this.clientHeight - height, clientY - 120)); - threshold = this.clientWidth / 2; - if (!this.isImage) { - threshold = Math.max(threshold, this.clientWidth - 400); - } - marginX = (clientX <= threshold ? clientX : this.clientWidth - clientX) + 45; - if (this.isImage) { - marginX = Math.min(marginX, this.clientWidth - width); - } - marginX += 'px'; - ref1 = clientX <= threshold ? [marginX, ''] : ['', marginX], left = ref1[0], right = ref1[1]; - style = this.style; - style.top = top + 'px'; - style.left = left; - return style.right = right; - }; - - hoverend = function(e) { - if (e.type === 'keydown' && e.keyCode !== 13 || e.target.nodeName === "TEXTAREA") { - return; - } - if (!this.noRemove) { - $.rm(this.el); - } - $.off(this.root, this.endEvents, this.hoverend); - $.off(d, 'keydown', this.hoverend); - $.off(this.root, 'mousemove', this.hover); - $.off(doc, 'mousemove', this.workaround); - if (this.cb) { - return this.cb.call(this); - } - }; - - checkbox = function(name, text, checked) { - var input, label; - if (checked == null) { - checked = Conf[name]; - } - label = $.el('label'); - input = $.el('input', { - type: 'checkbox', - name: name, - checked: checked - }); - $.add(label, [input, $.tn(" " + text)]); - return label; - }; - - UI = { - dialog: dialog, - Menu: Menu, - hover: hoverstart, - checkbox: checkbox - }; - - return UI; - -}).call(this); - -FappeTyme = (function() { - var FappeTyme; - - FappeTyme = { - init: function() { - var el, i, indicator, lc, len, ref, ref1, type; - if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive'))) { - return; - } - this.nodes = {}; - this.enabled = { - fappe: false, - werk: Conf['werk'] - }; - ref1 = ["Fappe", "Werk"]; - for (i = 0, len = ref1.length; i < len; i++) { - type = ref1[i]; - if (!Conf[type + " Tyme"]) { - continue; - } - lc = type.toLowerCase(); - el = UI.checkbox(lc, type + " Tyme", false); - el.title = type + " Tyme"; - this.nodes[lc] = el.firstElementChild; - if (Conf[lc]) { - this.set(lc, true); - } - $.on(this.nodes[lc], 'change', this.toggle.bind(this, lc)); - Header.menu.addEntry({ - el: el, - order: 97 - }); - indicator = $.el('span', { - className: 'indicator', - textContent: type[0], - title: type + " Tyme active" - }); - $.on(indicator, 'click', function() { - var check; - check = $.getOwn(FappeTyme.nodes, this.parentNode.id.replace('shortcut-', '')); - check.checked = !check.checked; - return $.event('change', null, check); - }); - Header.addShortcut(lc, indicator, 410); - } - if (Conf['Werk Tyme']) { - $.sync('werk', this.set.bind(this, 'werk')); - } - Callbacks.Post.push({ - name: 'Fappe Tyme', - cb: this.node - }); - return Callbacks.CatalogThread.push({ - name: 'Werk Tyme', - cb: this.catalogNode - }); - }, - node: function() { - return this.nodes.root.classList.toggle('noFile', !this.files.length); - }, - catalogNode: function() { - var file, filename; - file = this.thread.OP.files[0]; - if (!file) { - return; - } - filename = $.el('div', { - textContent: file.name, - className: 'werkTyme-filename' - }); - return $.add(this.nodes.thumb.parentNode, filename); - }, - set: function(type, enabled) { - this.enabled[type] = this.nodes[type].checked = enabled; - return $[(enabled ? 'add' : 'rm') + "Class"](doc, type + "Tyme"); - }, - toggle: function(type) { - this.set(type, !this.enabled[type]); - if (type === 'werk') { - return $.cb.checked.call(this.nodes[type]); - } - } - }; - - return FappeTyme; - -}).call(this); - -Gallery = (function() { - var Gallery; - - Gallery = { - init: function() { - var el, ref; - if (!(this.enabled = Conf['Gallery'] && ((ref = g.VIEW) === 'index' || ref === 'thread'))) { - return; - } - this.delay = Conf['Slide Delay']; - el = $.el('a', { - href: 'javascript:;', - title: 'Gallery', - className: 'fa fa-picture-o', - textContent: 'Gallery' - }); - $.on(el, 'click', this.cb.toggle); - Header.addShortcut('gallery', el, 530); - return Callbacks.Post.push({ - name: 'Gallery', - cb: this.node - }); - }, - node: function() { - var file, i, len, ref, results; - ref = this.files; - results = []; - for (i = 0, len = ref.length; i < len; i++) { - file = ref[i]; - if (!file.thumb) { - continue; - } - if (Gallery.nodes) { - Gallery.generateThumb(this, file); - Gallery.nodes.total.textContent = Gallery.images.length; - } - if (!(Conf['Image Expansion'] || (g.SITE.software === 'tinyboard' && Main.jsEnabled))) { - results.push($.on(file.thumbLink, 'click', Gallery.cb.image)); - } else { - results.push(void 0); - } - } - return results; - }, - build: function(image) { - var candidate, cb, dialog, entry, file, i, j, k, key, len, len1, len2, menuButton, nodes, post, postThumb, ref, ref1, ref2, ref3, thumb, value; - cb = Gallery.cb; - if (Conf['Fullscreen Gallery']) { - $.one(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', function() { - return $.on(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', cb.close); - }); - if (typeof doc.mozRequestFullScreen === "function") { - doc.mozRequestFullScreen(); - } - if (typeof doc.webkitRequestFullScreen === "function") { - doc.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT); - } - } - Gallery.images = []; - nodes = Gallery.nodes = {}; - Gallery.fileIDs = $.dict(); - Gallery.slideshow = false; - nodes.el = dialog = $.el('div', { - id: 'a-gallery' - }); - $.extend(dialog, {innerHTML: "
      ×
      /
      "}); - ref = { - buttons: '.gal-buttons', - frame: '.gal-image', - name: '.gal-name', - count: '.count', - total: '.total', - sauce: '.gal-sauce', - thumbs: '.gal-thumbnails', - next: '.gal-image a', - current: '.gal-image img' - }; - for (key in ref) { - value = ref[key]; - nodes[key] = $(value, dialog); - } - menuButton = $('.menu-button', dialog); - nodes.menu = new UI.Menu('gallery'); - $.on(nodes.frame, 'click', cb.blank); - if (Conf['Mouse Wheel Volume']) { - $.on(nodes.frame, 'wheel', Volume.wheel); - } - $.on(nodes.next, 'click', cb.click); - $.on(nodes.name, 'click', ImageCommon.download); - $.on($('.gal-prev', dialog), 'click', cb.prev); - $.on($('.gal-next', dialog), 'click', cb.next); - $.on($('.gal-start', dialog), 'click', cb.start); - $.on($('.gal-stop', dialog), 'click', cb.stop); - $.on($('.gal-close', dialog), 'click', cb.close); - $.on(menuButton, 'click', function(e) { - return nodes.menu.toggle(e, this, g); - }); - ref1 = Gallery.menu.createSubEntries(); - for (i = 0, len = ref1.length; i < len; i++) { - entry = ref1[i]; - entry.order = 0; - nodes.menu.addEntry(entry); - } - $.on(d, 'keydown', cb.keybinds); - if (Conf['Keybinds']) { - $.off(d, 'keydown', Keybinds.keydown); - } - $.on(window, 'resize', Gallery.cb.setHeight); - ref2 = $$(g.SITE.selectors.file.thumb); - for (j = 0, len1 = ref2.length; j < len1; j++) { - postThumb = ref2[j]; - if (!(post = Get.postFromNode(postThumb))) { - continue; - } - ref3 = post.files; - for (k = 0, len2 = ref3.length; k < len2; k++) { - file = ref3[k]; - if (!file.thumb) { - continue; - } - Gallery.generateThumb(post, file); - if (!image && Gallery.fileIDs[post.fullID + "." + file.index]) { - candidate = file.thumbLink; - if (Header.getTopOf(candidate) + candidate.getBoundingClientRect().height >= 0) { - image = candidate; - } - } - } - } - $.addClass(doc, 'gallery-open'); - $.add(d.body, dialog); - nodes.thumbs.scrollTop = 0; - nodes.current.parentElement.scrollTop = 0; - if (image) { - thumb = $("[href='" + image.href + "']", nodes.thumbs); - } - thumb || (thumb = Gallery.images[Gallery.images.length - 1]); - if (thumb) { - Gallery.open(thumb); - } - doc.style.overflow = 'hidden'; - return nodes.total.textContent = Gallery.images.length; - }, - generateThumb: function(post, file) { - var thumb, thumbImg; - if (post.isClone || post.isHidden) { - return; - } - if (!(file && file.thumb && (file.isImage || file.isVideo || Conf['PDF in Gallery']))) { - return; - } - if (Gallery.fileIDs[post.fullID + "." + file.index]) { - return; - } - Gallery.fileIDs[post.fullID + "." + file.index] = true; - thumb = $.el('a', { - className: 'gal-thumb', - href: file.url, - target: '_blank', - title: file.name - }); - thumb.dataset.id = Gallery.images.length; - thumb.dataset.post = post.fullID; - thumb.dataset.file = file.index; - thumbImg = file.thumb.cloneNode(false); - thumbImg.style.cssText = ''; - $.add(thumb, thumbImg); - $.on(thumb, 'click', Gallery.cb.open); - Gallery.images.push(thumb); - return $.add(Gallery.nodes.thumbs, thumb); - }, - load: function(thumb, errorCB) { - var elType, ext, file; - ext = thumb.href.match(/\w*$/); - elType = $.getOwn({ - 'webm': 'video', - 'mp4': 'video', - 'ogv': 'video', - 'pdf': 'iframe' - }, ext) || 'img'; - file = $.el(elType); - $.extend(file.dataset, thumb.dataset); - $.on(file, 'error', errorCB); - file.src = thumb.href; - return file; - }, - open: function(thumb) { - var el, file, i, len, link, newID, node, nodes, oldID, post, ref, ref1, sauces; - nodes = Gallery.nodes; - oldID = +nodes.current.dataset.id; - newID = +thumb.dataset.id; - if (el = Gallery.images[oldID]) { - $.rmClass(el, 'gal-highlight'); - } - $.addClass(thumb, 'gal-highlight'); - nodes.thumbs.scrollTop = thumb.offsetTop + thumb.offsetHeight / 2 - nodes.thumbs.clientHeight / 2; - if (((ref = Gallery.cache) != null ? ref.dataset.id : void 0) === '' + newID) { - file = Gallery.cache; - $.off(file, 'error', Gallery.cacheError); - $.on(file, 'error', Gallery.error); - } else { - file = Gallery.load(thumb, Gallery.error); - } - $.off(nodes.current, 'error', Gallery.error); - ImageCommon.pause(nodes.current); - $.replace(nodes.current, file); - nodes.current = file; - if (file.nodeName === 'VIDEO') { - file.loop = true; - Volume.setup(file); - if (Conf['Autoplay']) { - file.play(); - } - if (Conf['Show Controls']) { - ImageCommon.addControls(file); - } - } - doc.classList.toggle('gal-pdf', file.nodeName === 'IFRAME'); - Gallery.cb.setHeight(); - nodes.count.textContent = +thumb.dataset.id + 1; - nodes.name.download = nodes.name.textContent = thumb.title; - nodes.name.href = thumb.href; - nodes.frame.scrollTop = 0; - nodes.next.focus(); - $.rmAll(nodes.sauce); - if (Conf['Sauce'] && Sauce.links && (post = g.posts.get(file.dataset.post))) { - sauces = []; - ref1 = Sauce.links; - for (i = 0, len = ref1.length; i < len; i++) { - link = ref1[i]; - if ((node = Sauce.createSauceLink(link, post, post.files[+file.dataset.file]))) { - sauces.push($.tn(' '), node); - } - } - $.add(nodes.sauce, sauces); - } - if (Gallery.slideshow && (newID > oldID || (oldID === Gallery.images.length - 1 && newID === 0))) { - Gallery.setupTimer(); - } else { - Gallery.cb.stop(); - } - if (Conf['Scroll to Post'] && (post = g.posts.get(file.dataset.post))) { - Header.scrollTo(post.nodes.root); - } - if (isNaN(oldID) || newID === (oldID + 1) % Gallery.images.length) { - return Gallery.cache = Gallery.load(Gallery.images[(newID + 1) % Gallery.images.length], Gallery.cacheError); - } - }, - error: function() { - var file, post, ref; - if (((ref = this.error) != null ? ref.code : void 0) === MediaError.MEDIA_ERR_DECODE) { - return new Notice('error', 'Corrupt or unplayable video', 30); - } - if (ImageCommon.isFromArchive(this)) { - return; - } - post = g.posts.get(this.dataset.post); - file = post.files[+this.dataset.file]; - return ImageCommon.error(this, post, file, null, (function(_this) { - return function(url) { - if (!url) { - return; - } - Gallery.images[+_this.dataset.id].href = url; - if (Gallery.nodes.current === _this) { - return _this.src = url; - } - }; - })(this)); - }, - cacheError: function() { - return delete Gallery.cache; - }, - cleanupTimer: function() { - var current; - clearTimeout(Gallery.timeoutID); - current = Gallery.nodes.current; - $.off(current, 'canplaythrough load', Gallery.startTimer); - return $.off(current, 'ended', Gallery.cb.next); - }, - startTimer: function() { - return Gallery.timeoutID = setTimeout(Gallery.checkTimer, Gallery.delay * $.SECOND); - }, - setupTimer: function() { - var current, isVideo; - Gallery.cleanupTimer(); - current = Gallery.nodes.current; - isVideo = current.nodeName === 'VIDEO'; - if (isVideo) { - current.play(); - } - if ((isVideo ? current.readyState >= 4 : current.complete) || current.nodeName === 'IFRAME') { - return Gallery.startTimer(); - } else { - return $.on(current, (isVideo ? 'canplaythrough' : 'load'), Gallery.startTimer); - } - }, - checkTimer: function() { - var current; - current = Gallery.nodes.current; - if (current.nodeName === 'VIDEO' && !current.paused) { - $.on(current, 'ended', Gallery.cb.next); - return current.loop = false; - } else { - return Gallery.cb.next(); - } - }, - cb: { - keybinds: function(e) { - var cb, key; - if (!(key = Keybinds.keyCode(e))) { - return; - } - cb = (function() { - switch (key) { - case Conf['Close']: - case Conf['Open Gallery']: - return Gallery.cb.close; - case Conf['Next Gallery Image']: - return Gallery.cb.next; - case Conf['Advance Gallery']: - return Gallery.cb.advance; - case Conf['Previous Gallery Image']: - return Gallery.cb.prev; - case Conf['Pause']: - return Gallery.cb.pause; - case Conf['Slideshow']: - return Gallery.cb.toggleSlideshow; - case Conf['Rotate image anticlockwise']: - return Gallery.cb.rotateLeft; - case Conf['Rotate image clockwise']: - return Gallery.cb.rotateRight; - case Conf['Download Gallery Image']: - return Gallery.cb.download; - } - })(); - if (!cb) { - return; - } - e.stopPropagation(); - e.preventDefault(); - return cb(); - }, - open: function(e) { - if (e) { - e.preventDefault(); - } - if (this) { - return Gallery.open(this); - } - }, - image: function(e) { - e.preventDefault(); - e.stopPropagation(); - return Gallery.build(this); - }, - prev: function() { - return Gallery.cb.open.call(Gallery.images[+Gallery.nodes.current.dataset.id - 1] || Gallery.images[Gallery.images.length - 1]); - }, - next: function() { - return Gallery.cb.open.call(Gallery.images[+Gallery.nodes.current.dataset.id + 1] || Gallery.images[0]); - }, - click: function(e) { - if (ImageCommon.onControls(e)) { - return; - } - e.preventDefault(); - return Gallery.cb.advance(); - }, - advance: function() { - if (!Conf['Autoplay'] && Gallery.nodes.current.paused) { - return Gallery.nodes.current.play(); - } else { - return Gallery.cb.next(); - } - }, - toggle: function() { - return (Gallery.nodes ? Gallery.cb.close : Gallery.build)(); - }, - blank: function(e) { - if (e.target === this) { - return Gallery.cb.close(); - } - }, - toggleSlideshow: function() { - return Gallery.cb[Gallery.slideshow ? 'stop' : 'start'](); - }, - download: function() { - var name; - name = $('.gal-name'); - return name.click(); - }, - pause: function() { - var current; - Gallery.cb.stop(); - current = Gallery.nodes.current; - if (current.nodeName === 'VIDEO') { - return current[current.paused ? 'play' : 'pause'](); - } - }, - start: function() { - $.addClass(Gallery.nodes.buttons, 'gal-playing'); - Gallery.slideshow = true; - return Gallery.setupTimer(); - }, - stop: function() { - var current; - if (!Gallery.slideshow) { - return; - } - Gallery.cleanupTimer(); - current = Gallery.nodes.current; - if (current.nodeName === 'VIDEO') { - current.loop = true; - } - $.rmClass(Gallery.nodes.buttons, 'gal-playing'); - return Gallery.slideshow = false; - }, - rotateLeft: function() { - return Gallery.cb.rotate(270); - }, - rotateRight: function() { - return Gallery.cb.rotate(90); - }, - rotate: $.debounce(100, function(delta) { - var current; - current = Gallery.nodes.current; - if (current.nodeName === 'IFRAME') { - return; - } - current.dataRotate = ((current.dataRotate || 0) + delta) % 360; - current.style.transform = "rotate(" + current.dataRotate + "deg)"; - return Gallery.cb.setHeight(); - }), - close: function() { - $.off(Gallery.nodes.current, 'error', Gallery.error); - ImageCommon.pause(Gallery.nodes.current); - $.rm(Gallery.nodes.el); - $.rmClass(doc, 'gallery-open'); - if (Conf['Fullscreen Gallery']) { - $.off(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', Gallery.cb.close); - if (typeof d.mozCancelFullScreen === "function") { - d.mozCancelFullScreen(); - } - if (typeof d.webkitExitFullscreen === "function") { - d.webkitExitFullscreen(); - } - } - delete Gallery.nodes; - delete Gallery.fileIDs; - doc.style.overflow = ''; - $.off(d, 'keydown', Gallery.cb.keybinds); - if (Conf['Keybinds']) { - $.on(d, 'keydown', Keybinds.keydown); - } - $.off(window, 'resize', Gallery.cb.setHeight); - return clearTimeout(Gallery.timeoutID); - }, - setFitness: function() { - return (this.checked ? $.addClass : $.rmClass)(doc, "gal-" + (this.name.toLowerCase().replace(/\s+/g, '-'))); - }, - setHeight: $.debounce(100, function() { - var containerHeight, containerWidth, current, dim, frame, height, margin, minHeight, ref, ref1, ref2, ref3, style, width; - ref = Gallery.nodes, current = ref.current, frame = ref.frame; - style = current.style; - if (Conf['Stretch to Fit'] && (dim = (ref1 = g.posts.get(current.dataset.post)) != null ? ref1.files[+current.dataset.file].dimensions : void 0)) { - ref2 = dim.split('x'), width = ref2[0], height = ref2[1]; - containerWidth = frame.clientWidth; - containerHeight = doc.clientHeight - 25; - if ((current.dataRotate || 0) % 180 === 90) { - ref3 = [containerHeight, containerWidth], containerWidth = ref3[0], containerHeight = ref3[1]; - } - minHeight = Math.min(containerHeight, height / width * containerWidth); - style.minHeight = minHeight + 'px'; - style.minWidth = (width / height * minHeight) + 'px'; - } else { - style.minHeight = style.minWidth = ''; - } - if ((current.dataRotate || 0) % 180 === 90) { - style.maxWidth = Conf['Fit Height'] ? (doc.clientHeight - 25) + "px" : 'none'; - style.maxHeight = Conf['Fit Width'] ? frame.clientWidth + "px" : 'none'; - margin = (current.clientWidth - current.clientHeight) / 2; - return style.margin = margin + "px " + (-margin) + "px"; - } else { - return style.maxWidth = style.maxHeight = style.margin = ''; - } - }), - setDelay: function() { - return Gallery.delay = +this.value; - } - }, - menu: { - init: function() { - var el; - if (!Gallery.enabled) { - return; - } - el = $.el('span', { - textContent: 'Gallery', - className: 'gallery-link' - }); - return Header.menu.addEntry({ - el: el, - order: 105, - subEntries: Gallery.menu.createSubEntries() - }); - }, - createSubEntry: function(name) { - var input, label; - label = UI.checkbox(name, name); - input = label.firstElementChild; - if (name === 'Hide Thumbnails' || name === 'Fit Width' || name === 'Fit Height') { - $.on(input, 'change', Gallery.cb.setFitness); - } - $.event('change', null, input); - $.on(input, 'change', $.cb.checked); - if (name === 'Hide Thumbnails' || name === 'Fit Width' || name === 'Fit Height' || name === 'Stretch to Fit') { - $.on(input, 'change', Gallery.cb.setHeight); - } - return { - el: label - }; - }, - createSubEntries: function() { - var delayInput, delayLabel, item, subEntries; - subEntries = (function() { - var i, len, ref, results; - ref = ['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Stretch to Fit', 'Scroll to Post']; - results = []; - for (i = 0, len = ref.length; i < len; i++) { - item = ref[i]; - results.push(Gallery.menu.createSubEntry(item)); - } - return results; - })(); - delayLabel = $.el('label', {innerHTML: "Slide Delay: "}); - delayInput = delayLabel.firstElementChild; - delayInput.value = Gallery.delay; - $.on(delayInput, 'change', Gallery.cb.setDelay); - $.on(delayInput, 'change', $.cb.value); - subEntries.push({ - el: delayLabel - }); - return subEntries; - } - } - }; - - return Gallery; - -}).call(this); - -ImageCommon = (function() { - var ImageCommon, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - ImageCommon = { - pause: function(video) { - if (video.nodeName !== 'VIDEO') { - return; - } - video.pause(); - $.off(video, 'volumechange', Volume.change); - return video.muted = true; - }, - rewind: function(el) { - if (el.nodeName === 'VIDEO') { - if (el.readyState >= el.HAVE_METADATA) { - return el.currentTime = 0; - } - } else if (/\.gif$/.test(el.src)) { - return $.queueTask(function() { - return el.src = el.src; - }); - } - }, - pushCache: function(el) { - ImageCommon.cache = el; - return $.on(el, 'error', ImageCommon.cacheError); - }, - popCache: function() { - var el; - el = ImageCommon.cache; - $.off(el, 'error', ImageCommon.cacheError); - delete ImageCommon.cache; - return el; - }, - cacheError: function() { - if (ImageCommon.cache === this) { - return delete ImageCommon.cache; - } - }, - decodeError: function(file, fileObj) { - var message, ref; - if (((ref = file.error) != null ? ref.code : void 0) !== MediaError.MEDIA_ERR_DECODE) { - return false; - } - if (!(message = $('.warning', fileObj.thumb.parentNode))) { - message = $.el('div', { - className: 'warning' - }); - $.after(fileObj.thumb, message); - } - message.textContent = 'Error: Corrupt or unplayable video'; - return true; - }, - isFromArchive: function(file) { - return g.SITE.software === 'yotsuba' && !ImageHost.test(file.src.split('/')[2]); - }, - error: function(file, post, fileObj, delay, cb) { - var base, parseJSON, redirect, src, threadJSON, timeoutID, url; - src = fileObj.url.split('/'); - url = null; - if (g.SITE.software === 'yotsuba' && Conf['404 Redirect']) { - url = Redirect.to('file', { - boardID: post.board.ID, - filename: src[src.length - 1] - }); - } - if (!(url && Redirect.securityCheck(url))) { - url = null; - } - if ((post.isDead || fileObj.isDead) && !ImageCommon.isFromArchive(file)) { - return cb(url); - } - if (delay != null) { - timeoutID = setTimeout((function() { - return cb(url); - }), delay); - } - if (post.isDead || fileObj.isDead) { - return; - } - redirect = function() { - if (!ImageCommon.isFromArchive(file)) { - if (delay != null) { - clearTimeout(timeoutID); - } - return cb(url); - } - }; - threadJSON = typeof (base = g.SITE.urls).threadJSON === "function" ? base.threadJSON(post) : void 0; - if (!threadJSON) { - return; - } - parseJSON = function(isArchiveURL) { - var archivedThreadJSON, base1, i, len, postObj, ref, ref1; - if (this.status === 404) { - if (!isArchiveURL && (archivedThreadJSON = typeof (base1 = g.SITE.urls).archivedThreadJSON === "function" ? base1.archivedThreadJSON(post) : void 0)) { - $.ajax(archivedThreadJSON, { - onloadend: function() { - return parseJSON.call(this, true); - } - }); - } else { - post.kill(!post.isClone, fileObj.index); - } - } - if (this.status !== 200) { - return redirect(); - } - ref = this.response.posts; - for (i = 0, len = ref.length; i < len; i++) { - postObj = ref[i]; - if (postObj.no === post.ID) { - break; - } - } - if (postObj.no !== post.ID) { - post.kill(); - return redirect(); - } else if (ref1 = fileObj.docIndex, indexOf.call(g.SITE.Build.parseJSON(postObj, post.board).filesDeleted, ref1) >= 0) { - post.kill(true); - return redirect(); - } else { - return url = fileObj.url; - } - }; - return $.ajax(threadJSON, { - onloadend: function() { - return parseJSON.call(this); - } - }); - }, - addControls: function(video) { - var handler; - handler = function() { - var t; - $.off(video, 'mouseover', handler); - t = new Date().getTime(); - return $.asap((function() { - return $.engine !== 'gecko' || (video.readyState >= 3 && video.currentTime <= Math.max(0.1, video.duration - 0.5)) || new Date().getTime() >= t + 1000; - }), function() { - return video.controls = true; - }); - }; - return $.on(video, 'mouseover', handler); - }, - onControls: function(e) { - return (Conf['Show Controls'] && Conf['Click Passthrough'] && e.target.nodeName === 'VIDEO') || (e.target.controls && e.target.getBoundingClientRect().bottom - e.clientY < 35); - }, - download: function(e) { - var download, href, ref; - if (this.protocol === 'blob:') { - return true; - } - e.preventDefault(); - ref = this, href = ref.href, download = ref.download; - return CrossOrigin.file(href, function(blob) { - var a; - if (blob) { - a = $.el('a', { - href: URL.createObjectURL(blob), - download: download, - hidden: true - }); - $.add(d.body, a); - a.click(); - return $.rm(a); - } else { - return new Notice('warning', "Could not download " + href, 20); - } - }); - } - }; - - return ImageCommon; - -}).call(this); - -ImageExpand = (function() { - var ImageExpand, - slice = [].slice; - - ImageExpand = { - init: function() { - var ref; - if (!(this.enabled = Conf['Image Expansion'] && ((ref = g.VIEW) === 'index' || ref === 'thread'))) { - return; - } - this.EAI = $.el('a', { - className: 'expand-all-shortcut fa fa-expand', - textContent: 'EAI', - title: 'Expand All Images', - href: 'javascript:;' - }); - $.on(this.EAI, 'click', this.cb.toggleAll); - Header.addShortcut('expand-all', this.EAI, 520); - $.on(d, 'scroll visibilitychange', this.cb.playVideos); - this.videoControls = $.el('span', { - className: 'video-controls' - }); - $.extend(this.videoControls, {innerHTML: " contract"}); - return Callbacks.Post.push({ - name: 'Image Expansion', - cb: this.node - }); - }, - node: function() { - var ref; - if (!(this.file && (this.file.isImage || this.file.isVideo))) { - return; - } - $.on(this.file.thumbLink, 'click', ImageExpand.cb.toggle); - if (this.isClone) { - if (this.file.isExpanding) { - ImageExpand.contract(this); - return ImageExpand.expand(this); - } else if (this.file.isExpanded && this.file.isVideo) { - Volume.setup(this.file.fullImage); - ImageExpand.setupVideoCB(this); - return ImageExpand.setupVideo(this, !((ref = this.origin.file.fullImage) != null ? ref.paused : void 0) || this.origin.file.wasPlaying, this.file.fullImage.controls); - } - } else if (ImageExpand.on && !this.isHidden && !this.isFetchedQuote && (Conf['Expand spoilers'] || !this.file.isSpoiler) && (Conf['Expand videos'] || !this.file.isVideo)) { - return ImageExpand.expand(this); - } - }, - cb: { - toggle: function(e) { - var file, post, ref; - if ($.modifiedClick(e)) { - return; - } - post = Get.postFromNode(this); - file = post.file; - if (file.isExpanded && ImageCommon.onControls(e)) { - return; - } - e.preventDefault(); - if (!Conf['Autoplay'] && ((ref = file.fullImage) != null ? ref.paused : void 0)) { - return file.fullImage.play(); - } else { - return ImageExpand.toggle(post); - } - }, - toggleAll: function() { - var func, threadRoot, toggle; - $.event('CloseMenu'); - threadRoot = Nav.getThread(); - toggle = function(post) { - var file; - file = post.file; - if (!(file && (file.isImage || file.isVideo) && doc.contains(post.nodes.root))) { - return; - } - if (ImageExpand.on && (!Conf['Expand spoilers'] && file.isSpoiler || !Conf['Expand videos'] && file.isVideo || Conf['Expand from here'] && Header.getTopOf(file.thumb) < 0 || Conf['Expand thread only'] && g.VIEW === 'index' && !(threadRoot != null ? threadRoot.contains(file.thumb) : void 0))) { - return; - } - return $.queueTask(func, post); - }; - if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) { - ImageExpand.EAI.className = 'contract-all-shortcut fa fa-compress'; - ImageExpand.EAI.title = 'Contract All Images'; - func = ImageExpand.expand; - } else { - ImageExpand.EAI.className = 'expand-all-shortcut fa fa-expand'; - ImageExpand.EAI.title = 'Expand All Images'; - func = ImageExpand.contract; - } - return g.posts.forEach(function(post) { - var i, len, ref; - ref = [post].concat(slice.call(post.clones)); - for (i = 0, len = ref.length; i < len; i++) { - post = ref[i]; - toggle(post); - } - }); - }, - playVideos: function() { - return g.posts.forEach(function(post) { - var file, i, len, ref, video, visible; - ref = [post].concat(slice.call(post.clones)); - for (i = 0, len = ref.length; i < len; i++) { - post = ref[i]; - file = post.file; - if (!(file && file.isVideo && file.isExpanded)) { - continue; - } - video = file.fullImage; - visible = ($.hasAudio(video) && !video.muted) || Header.isNodeVisible(video); - if (visible && file.wasPlaying) { - delete file.wasPlaying; - video.play(); - } else if (!visible && !video.paused) { - file.wasPlaying = true; - video.pause(); - } - } - }); - }, - setFitness: function() { - return $[this.checked ? 'addClass' : 'rmClass'](doc, this.name.toLowerCase().replace(/\s+/g, '-')); - } - }, - toggle: function(post) { - var next; - if (!(post.file.isExpanding || post.file.isExpanded)) { - post.file.scrollIntoView = Conf['Scroll into view']; - ImageExpand.expand(post); - return; - } - ImageExpand.contract(post); - if (Conf['Advance on contract']) { - next = post.nodes.root; - while (next = $.x("following::div[contains(@class,'postContainer')][1]", next)) { - if (!($('.stub', next) || next.offsetHeight === 0)) { - break; - } - } - if (next) { - return Header.scrollTo(next); - } - } - }, - contract: function(post) { - var bottom, cb, el, eventName, file, i, len, oldHeight, ref, ref1, scrollY, top, x; - file = post.file; - if (el = file.fullImage) { - top = Header.getTopOf(el); - bottom = top + el.getBoundingClientRect().height; - oldHeight = d.body.clientHeight; - scrollY = window.scrollY; - } - $.rmClass(post.nodes.root, 'expanded-image'); - $.rmClass(file.thumb, 'expanding'); - $.rm(file.videoControls); - file.thumbLink.href = file.url; - file.thumbLink.target = '_blank'; - ref = ['isExpanding', 'isExpanded', 'videoControls', 'wasPlaying', 'scrollIntoView']; - for (i = 0, len = ref.length; i < len; i++) { - x = ref[i]; - delete file[x]; - } - if (!el) { - return; - } - if (doc.contains(el)) { - if (bottom <= 0) { - window.scrollBy(0, scrollY - window.scrollY + d.body.clientHeight - oldHeight); - } else { - Header.scrollToIfNeeded(post.nodes.root); - } - if (window.scrollX > 0) { - window.scrollBy(-window.scrollX, 0); - } - } - $.off(el, 'error', ImageExpand.error); - ImageCommon.pushCache(el); - if (file.isVideo) { - ImageCommon.pause(el); - ref1 = ImageExpand.videoCB; - for (eventName in ref1) { - cb = ref1[eventName]; - $.off(el, eventName, cb); - } - } - if (Conf['Restart when Opened']) { - ImageCommon.rewind(file.thumb); - } - delete file.fullImage; - return $.queueTask(function() { - if (file.isExpanding || file.isExpanded) { - return; - } - $.rmClass(el, 'full-image'); - if (el.id) { - return; - } - return $.rm(el); - }); - }, - expand: function(post, src) { - var el, file, isVideo, ref, thumb, thumbLink; - file = post.file; - thumb = file.thumb, thumbLink = file.thumbLink, isVideo = file.isVideo; - if (post.isHidden || file.isExpanding || file.isExpanded) { - return; - } - $.addClass(thumb, 'expanding'); - file.isExpanding = true; - if (file.fullImage) { - el = file.fullImage; - } else if (((ref = ImageCommon.cache) != null ? ref.dataset.fileID : void 0) === (post.fullID + "." + file.index)) { - el = file.fullImage = ImageCommon.popCache(); - $.on(el, 'error', ImageExpand.error); - if (Conf['Restart when Opened'] && el.id !== 'ihover') { - ImageCommon.rewind(el); - } - el.removeAttribute('id'); - } else { - el = file.fullImage = $.el((isVideo ? 'video' : 'img')); - el.dataset.fileID = post.fullID + "." + file.index; - $.on(el, 'error', ImageExpand.error); - el.src = src || file.url; - } - el.className = 'full-image'; - $.after(thumb, el); - if (isVideo) { - if (!file.videoControls) { - file.videoControls = ImageExpand.videoControls.cloneNode(true); - $.add(file.text, file.videoControls); - } - thumbLink.removeAttribute('href'); - thumbLink.removeAttribute('target'); - el.loop = true; - Volume.setup(el); - ImageExpand.setupVideoCB(post); - } - if (!isVideo) { - return $.asap((function() { - return el.naturalHeight; - }), function() { - return ImageExpand.completeExpand(post); - }); - } else if (el.readyState >= el.HAVE_METADATA) { - return ImageExpand.completeExpand(post); - } else { - return $.on(el, 'loadedmetadata', function() { - return ImageExpand.completeExpand(post); - }); - } - }, - completeExpand: function(post) { - var bottom, file, imageBottom, oldHeight, scrollY; - file = post.file; - if (!file.isExpanding) { - return; - } - bottom = Header.getTopOf(file.thumb) + file.thumb.getBoundingClientRect().height; - oldHeight = d.body.clientHeight; - scrollY = window.scrollY; - $.addClass(post.nodes.root, 'expanded-image'); - $.rmClass(file.thumb, 'expanding'); - file.isExpanded = true; - delete file.isExpanding; - if (doc.contains(post.nodes.root) && bottom <= 0) { - window.scrollBy(0, scrollY - window.scrollY + d.body.clientHeight - oldHeight); - } - if (file.scrollIntoView) { - delete file.scrollIntoView; - imageBottom = Math.min(doc.clientHeight - file.fullImage.getBoundingClientRect().bottom - 25, Header.getBottomOf(file.fullImage)); - if (imageBottom < 0) { - window.scrollBy(0, Math.min(-imageBottom, Header.getTopOf(file.fullImage))); - } - } - if (file.isVideo) { - return ImageExpand.setupVideo(post, Conf['Autoplay'], Conf['Show Controls']); - } - }, - setupVideo: function(post, playing, controls) { - var fullImage; - fullImage = post.file.fullImage; - if (!playing) { - fullImage.controls = controls; - return; - } - fullImage.controls = false; - $.asap((function() { - return doc.contains(fullImage); - }), function() { - if (!d.hidden && Header.isNodeVisible(fullImage)) { - return fullImage.play(); - } else { - return post.file.wasPlaying = true; - } - }); - if (controls) { - return ImageCommon.addControls(fullImage); - } - }, - videoCB: (function() { - var mousedown; - mousedown = false; - return { - mouseover: function() { - return mousedown = false; - }, - mousedown: function(e) { - if (e.button === 0) { - return mousedown = true; - } - }, - mouseup: function(e) { - if (e.button === 0) { - return mousedown = false; - } - }, - mouseout: function(e) { - if (((e.buttons & 1) || mousedown) && e.clientX <= this.getBoundingClientRect().left) { - return ImageExpand.toggle(Get.postFromNode(this)); - } - } - }; - })(), - setupVideoCB: function(post) { - var cb, eventName, ref; - ref = ImageExpand.videoCB; - for (eventName in ref) { - cb = ref[eventName]; - $.on(post.file.fullImage, eventName, cb); - } - if (post.file.videoControls) { - return $.on(post.file.videoControls.firstElementChild, 'click', function() { - return ImageExpand.toggle(post); - }); - } - }, - error: function() { - var post; - post = Get.postFromNode(this); - $.rm(this); - delete post.file.fullImage; - if (!(post.file.isExpanding || post.file.isExpanded)) { - return; - } - if (ImageCommon.decodeError(this, post.file)) { - return ImageExpand.contract(post); - } - if (ImageCommon.isFromArchive(this)) { - return ImageExpand.contract(post); - } - return ImageCommon.error(this, post, post.file, 10 * $.SECOND, function(URL) { - if (post.file.isExpanding || post.file.isExpanded) { - ImageExpand.contract(post); - if (URL) { - return ImageExpand.expand(post, URL); - } - } - }); - }, - menu: { - init: function() { - var conf, createSubEntry, el, name, ref, subEntries; - if (!ImageExpand.enabled) { - return; - } - el = $.el('span', { - textContent: 'Image Expansion', - className: 'image-expansion-link' - }); - createSubEntry = ImageExpand.menu.createSubEntry; - subEntries = []; - ref = Config.imageExpansion; - for (name in ref) { - conf = ref[name]; - subEntries.push(createSubEntry(name, conf[1])); - } - return Header.menu.addEntry({ - el: el, - order: 105, - subEntries: subEntries - }); - }, - createSubEntry: function(name, desc) { - var input, label; - label = UI.checkbox(name, name); - label.title = desc; - input = label.firstElementChild; - if (name === 'Fit width' || name === 'Fit height') { - $.on(input, 'change', ImageExpand.cb.setFitness); - } - $.event('change', null, input); - $.on(input, 'change', $.cb.checked); - return { - el: label - }; - } - } - }; - - return ImageExpand; - -}).call(this); - -ImageHost = (function() { - var ImageHost; - - ImageHost = { - init: function() { - var ref; - if (!((this.useFaster = /\S/.test(Conf['fourchanImageHost'])) && g.SITE.software === 'yotsuba' && ((ref = g.VIEW) === 'index' || ref === 'thread'))) { - return; - } - return Callbacks.Post.push({ - name: 'Image Host Rewriting', - cb: this.node - }); - }, - suggestions: ['i.4cdn.org', 'is2.4chan.org'], - host: function() { - return Conf['fourchanImageHost'].trim() || 'i.4cdn.org'; - }, - flashHost: function() { - return 'i.4cdn.org'; - }, - thumbHost: function() { - return 'i.4cdn.org'; - }, - test: function(hostname) { - return hostname === 'i.4cdn.org' || ImageHost.regex.test(hostname); - }, - regex: /^is\d*\.4chan(?:nel)?\.org$/, - node: function() { - var host; - if (this.isClone) { - return; - } - host = ImageHost.host(); - if (this.file && ImageHost.test(this.file.url.split('/')[2]) && !/\.swf$/.test(this.file.url)) { - this.file.link.hostname = host; - if (this.file.thumbLink) { - this.file.thumbLink.hostname = host; - } - this.file.url = this.file.link.href; - } - return ImageHost.fixLinks($$('a', this.nodes.comment)); - }, - fixLinks: function(links) { - var host, i, len, link; - for (i = 0, len = links.length; i < len; i++) { - link = links[i]; - if (!(ImageHost.test(link.hostname) && !/\.swf$/.test(link.pathname))) { - continue; - } - host = ImageHost.host(); - if (link.hostname !== host) { - link.hostname = host; - } - } - } - }; - - return ImageHost; - -}).call(this); - -ImageHover = (function() { - var ImageHover; - - ImageHover = { - init: function() { - var ref; - if ((ref = g.VIEW) !== 'index' && ref !== 'thread') { - return; - } - if (Conf['Image Hover']) { - Callbacks.Post.push({ - name: 'Image Hover', - cb: this.node - }); - } - if (Conf['Image Hover in Catalog']) { - return Callbacks.CatalogThread.push({ - name: 'Image Hover', - cb: this.catalogNode - }); - } - }, - node: function() { - var file, i, len, ref, results; - ref = this.files; - results = []; - for (i = 0, len = ref.length; i < len; i++) { - file = ref[i]; - if ((file.isImage || file.isVideo) && file.thumb) { - results.push($.on(file.thumb, 'mouseover', ImageHover.mouseover(this, file))); - } - } - return results; - }, - catalogNode: function() { - var file; - file = this.thread.OP.files[0]; - if (!(file && (file.isImage || file.isVideo))) { - return; - } - return $.on(this.nodes.thumb, 'mouseover', ImageHover.mouseover(this.thread.OP, file)); - }, - mouseover: function(post, file) { - return function(e) { - var base, el, error, height, isVideo, maxHeight, maxWidth, ref, ref1, scale, width, x; - if (!doc.contains(this)) { - return; - } - isVideo = file.isVideo; - if (file.isExpanding || file.isExpanded || (typeof (base = g.SITE).isThumbExpanded === "function" ? base.isThumbExpanded(file) : void 0)) { - return; - } - error = ImageHover.error(post, file); - if (((ref = ImageCommon.cache) != null ? ref.dataset.fileID : void 0) === (post.fullID + "." + file.index)) { - el = ImageCommon.popCache(); - $.on(el, 'error', error); - } else { - el = $.el((isVideo ? 'video' : 'img')); - el.dataset.fileID = post.fullID + "." + file.index; - $.on(el, 'error', error); - el.src = file.url; - } - if (Conf['Restart when Opened']) { - ImageCommon.rewind(el); - ImageCommon.rewind(this); - } - el.id = 'ihover'; - $.add(Header.hover, el); - if (isVideo) { - el.loop = true; - el.controls = false; - Volume.setup(el); - if (Conf['Autoplay']) { - el.play(); - if (this.nodeName === 'VIDEO') { - this.currentTime = el.currentTime; - } - } - } - if (file.dimensions) { - ref1 = (function() { - var i, len, ref1, results; - ref1 = file.dimensions.split('x'); - results = []; - for (i = 0, len = ref1.length; i < len; i++) { - x = ref1[i]; - results.push(+x); - } - return results; - })(), width = ref1[0], height = ref1[1]; - maxWidth = doc.clientWidth; - maxHeight = doc.clientHeight - UI.hover.padding; - scale = Math.min(1, maxWidth / width, maxHeight / height); - width *= scale; - height *= scale; - el.style.maxWidth = width + "px"; - el.style.maxHeight = height + "px"; - } - return UI.hover({ - root: this, - el: el, - latestEvent: e, - endEvents: 'mouseout click', - height: height, - width: width, - noRemove: true, - cb: function() { - $.off(el, 'error', error); - ImageCommon.pushCache(el); - ImageCommon.pause(el); - $.rm(el); - return el.removeAttribute('style'); - } - }); - }; - }, - error: function(post, file) { - return function() { - if (ImageCommon.decodeError(this, file)) { - return; - } - return ImageCommon.error(this, post, file, 3 * $.SECOND, (function(_this) { - return function(URL) { - if (URL) { - return _this.src = URL + (_this.src === URL ? '?' + Date.now() : ''); - } else { - return $.rm(_this); - } - }; - })(this)); - }; - } - }; - - return ImageHover; - -}).call(this); - -ImageLoader = (function() { - var ImageLoader, - slice = [].slice; - - ImageLoader = { - init: function() { - var el, ref, ref1, replace; - if ((ref = g.VIEW) !== 'index' && ref !== 'thread' && ref !== 'archive') { - return; - } - replace = Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM']; - if (!(Conf['Image Prefetching'] || replace)) { - return; - } - Callbacks.Post.push({ - name: 'Image Replace', - cb: this.node - }); - $.on(d, 'PostsInserted', function() { - if (ImageLoader.prefetchEnabled || replace) { - return g.posts.forEach(ImageLoader.prefetchAll); - } - }); - if (Conf['Replace WEBM']) { - $.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', this.playVideos); - } - if (!(Conf['Image Prefetching'] && ((ref1 = g.VIEW) === 'index' || ref1 === 'thread'))) { - return; - } - el = $.el('a', { - href: 'javascript:;', - title: 'Prefetch Images', - className: 'fa fa-bolt disabled', - textContent: 'Prefetch' - }); - $.on(el, 'click', this.toggle); - return Header.addShortcut('prefetch', el, 525); - }, - node: function() { - var file, i, len, ref; - if (this.isClone) { - return; - } - ref = this.files; - for (i = 0, len = ref.length; i < len; i++) { - file = ref[i]; - if (Conf['Replace WEBM'] && file.isVideo) { - ImageLoader.replaceVideo(this, file); - } - ImageLoader.prefetch(this, file); - } - }, - replaceVideo: function(post, file) { - var attr, i, len, ref, thumb, video; - thumb = file.thumb; - video = $.el('video', { - preload: 'none', - loop: true, - muted: true, - poster: thumb.src || thumb.dataset.src, - textContent: thumb.alt, - className: thumb.className - }); - video.setAttribute('muted', 'muted'); - video.dataset.md5 = thumb.dataset.md5; - ref = ['height', 'width', 'maxHeight', 'maxWidth']; - for (i = 0, len = ref.length; i < len; i++) { - attr = ref[i]; - video.style[attr] = thumb.style[attr]; - } - video.src = file.url; - $.replace(thumb, video); - file.thumb = video; - return file.videoThumb = true; - }, - prefetch: function(post, file) { - var clone, el, i, isImage, isVideo, len, ref, ref1, replace, thumb, type, url; - isImage = file.isImage, isVideo = file.isVideo, thumb = file.thumb, url = file.url; - if (file.isPrefetched || !(isImage || isVideo) || post.isHidden || post.thread.isHidden) { - return; - } - if (isVideo) { - type = 'WEBM'; - } else { - type = (ref = url.match(/\.([^.]+)$/)) != null ? ref[1].toUpperCase() : void 0; - if (type === 'JPEG') { - type = 'JPG'; - } - } - replace = Conf["Replace " + type] && !/spoiler/.test(thumb.src || thumb.dataset.src); - if (!(replace || ImageLoader.prefetchEnabled)) { - return; - } - if ($.hasClass(doc, 'catalog-mode')) { - return; - } - if (![post].concat(slice.call(post.clones)).some(function(clone) { - return doc.contains(clone.nodes.root); - })) { - return; - } - file.isPrefetched = true; - if (file.videoThumb) { - ref1 = post.clones; - for (i = 0, len = ref1.length; i < len; i++) { - clone = ref1[i]; - clone.file.thumb.preload = 'auto'; - } - thumb.preload = 'auto'; - if ($.engine === 'gecko') { - $.on(thumb, 'loadeddata', function() { - return this.removeAttribute('poster'); - }); - } - return; - } - el = $.el(isImage ? 'img' : 'video'); - if (isVideo) { - el.preload = 'auto'; - } - if (replace && isImage) { - $.on(el, 'load', function() { - var j, len1, ref2; - ref2 = post.clones; - for (j = 0, len1 = ref2.length; j < len1; j++) { - clone = ref2[j]; - clone.file.thumb.src = url; - } - return thumb.src = url; - }); - } - return el.src = url; - }, - prefetchAll: function(post) { - var file, i, len, ref; - ref = post.files; - for (i = 0, len = ref.length; i < len; i++) { - file = ref[i]; - ImageLoader.prefetch(post, file); - } - }, - toggle: function() { - ImageLoader.prefetchEnabled = !ImageLoader.prefetchEnabled; - this.classList.toggle('disabled', !ImageLoader.prefetchEnabled); - if (ImageLoader.prefetchEnabled) { - g.posts.forEach(ImageLoader.prefetchAll); - } - }, - playVideos: function() { - var qpClone, ref; - qpClone = (ref = $.id('qp')) != null ? ref.firstElementChild : void 0; - return g.posts.forEach(function(post) { - var file, i, j, len, len1, ref1, ref2, thumb; - ref1 = [post].concat(slice.call(post.clones)); - for (i = 0, len = ref1.length; i < len; i++) { - post = ref1[i]; - ref2 = post.files; - for (j = 0, len1 = ref2.length; j < len1; j++) { - file = ref2[j]; - if (!file.videoThumb) { - continue; - } - thumb = file.thumb; - if (Header.isNodeVisible(thumb) || post.nodes.root === qpClone) { - thumb.play(); - } else { - thumb.pause(); - } - } - } - }); - } - }; - - return ImageLoader; - -}).call(this); - -Metadata = (function() { - var Metadata; - - Metadata = { - init: function() { - var ref; - if (!(Conf['WEBM Metadata'] && ((ref = g.VIEW) === 'index' || ref === 'thread'))) { - return; - } - return Callbacks.Post.push({ - name: 'WEBM Metadata', - cb: this.node - }); - }, - node: function() { - var el, file, i, j, len1, ref; - ref = this.files; - for (i = j = 0, len1 = ref.length; j < len1; i = ++j) { - file = ref[i]; - if (!(/webm$/i.test(file.url))) { - continue; - } - if (this.isClone) { - el = $('.webm-title', file.text); - } else { - el = $.el('span', { - className: 'webm-title' - }); - el.dataset.index = i; - $.extend(el, {innerHTML: ""}); - $.add(file.text, [$.tn(' '), el]); - } - if (el.children.length === 1) { - $.one(el.lastElementChild, 'mouseover focus', Metadata.load); - } - } - }, - load: function() { - var index; - $.rmClass(this.parentNode, 'error'); - $.addClass(this.parentNode, 'loading'); - index = this.parentNode.dataset.index; - return CrossOrigin.binary(Get.postFromNode(this).files[+index].url, (function(_this) { - return function(data) { - var output, title; - $.rmClass(_this.parentNode, 'loading'); - if (data != null) { - title = Metadata.parse(data); - output = $.el('span', { - textContent: title || '' - }); - if (title == null) { - $.addClass(_this.parentNode, 'not-found'); - } - $.before(_this, output); - _this.parentNode.tabIndex = 0; - if (d.activeElement === _this) { - _this.parentNode.focus(); - } - return _this.tabIndex = -1; - } else { - $.addClass(_this.parentNode, 'error'); - return $.one(_this, 'click', Metadata.load); - } - }; - })(this), { - Range: 'bytes=0-9999' - }); - }, - parse: function(data) { - var element, i, readInt, size, title; - readInt = function() { - var len, n; - n = data[i++]; - len = 0; - while (n < (0x80 >> len)) { - len++; - } - n ^= 0x80 >> len; - while (len-- && i < data.length) { - n = (n << 8) ^ data[i++]; - } - return n; - }; - i = 0; - while (i < data.length) { - element = readInt(); - size = readInt(); - if (element === 0x3BA9) { - title = ''; - while (size-- && i < data.length) { - title += String.fromCharCode(data[i++]); - } - return decodeURIComponent(escape(title)); - } else if (element !== 0x8538067 && element !== 0x549A966) { - i += size; - } - } - return null; - } - }; - - return Metadata; - -}).call(this); - -RevealSpoilers = (function() { - var RevealSpoilers; - - RevealSpoilers = { - init: function() { - var ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive') && Conf['Reveal Spoiler Thumbnails'])) { - return; - } - return Callbacks.Post.push({ - name: 'Reveal Spoiler Thumbnails', - cb: this.node - }); - }, - node: function() { - var file, i, len, ref, thumb; - if (this.isClone) { - return; - } - ref = this.files; - for (i = 0, len = ref.length; i < len; i++) { - file = ref[i]; - if (!(file.thumb && file.isSpoiler)) { - continue; - } - thumb = file.thumb; - thumb.removeAttribute('style'); - thumb.style.maxHeight = thumb.style.maxWidth = this.isReply ? '125px' : '250px'; - if (thumb.src) { - thumb.src = file.thumbURL; - } else { - thumb.dataset.src = file.thumbURL; - } - } - } - }; - - return RevealSpoilers; - -}).call(this); - -Sauce = (function() { - var Sauce, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Sauce = { - init: function() { - var j, len, link, linkData, links, ref, ref1; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Sauce'])) { - return; - } - $.addClass(doc, 'show-sauce'); - links = []; - ref1 = Conf['sauces'].split('\n'); - for (j = 0, len = ref1.length; j < len; j++) { - link = ref1[j]; - if (link[0] !== '#' && (linkData = this.parseLink(link))) { - links.push(linkData); - } - } - if (!links.length) { - return; - } - this.links = links; - this.link = $.el('a', { - target: '_blank', - className: 'sauce' - }); - return Callbacks.Post.push({ - name: 'Sauce', - cb: this.node - }); - }, - parseLink: function(link) { - var err, i, j, len, m, part, parts, ref, ref1, regexp; - if (!(link = link.trim())) { - return null; - } - parts = $.dict(); - ref = link.split(/;(?=(?:text|boards|types|regexp|sandbox):?)/); - for (i = j = 0, len = ref.length; j < len; i = ++j) { - part = ref[i]; - if (i === 0) { - parts['url'] = part; - } else { - m = part.match(/^(\w*):?(.*)$/); - parts[m[1]] = m[2]; - } - } - parts['text'] || (parts['text'] = ((ref1 = parts['url'].match(/(\w+)\.\w+\//)) != null ? ref1[1] : void 0) || '?'); - if ('boards' in parts) { - parts['boards'] = Filter.parseBoards(parts['boards']); - } - if ('regexp' in parts) { - try { - if ((regexp = parts['regexp'].match(/^\/(.*)\/(\w*)$/))) { - parts['regexp'] = RegExp(regexp[1], regexp[2]); - } else { - parts['regexp'] = RegExp(parts['regexp']); - } - } catch (error) { - err = error; - new Notice('warning', [$.tn("Invalid regexp for Sauce link:"), $.el('br'), $.tn(link), $.el('br'), $.tn(err.message)], 60); - return null; - } - } - return parts; - }, - createSauceLink: function(link, post, file) { - var a, base, ext, j, key, len, matches, missing, parts, ref; - ext = file.url.match(/[^.]*$/)[0]; - parts = $.dict(); - $.extend(parts, link); - if (!(!parts['boards'] || parts['boards'][post.siteID + "/" + post.boardID] || parts['boards'][post.siteID + "/*"])) { - return null; - } - if (!(!parts['types'] || indexOf.call(parts['types'].split(','), ext) >= 0)) { - return null; - } - if (!(!parts['regexp'] || (matches = file.name.match(parts['regexp'])))) { - return null; - } - missing = []; - ref = ['url', 'text']; - for (j = 0, len = ref.length; j < len; j++) { - key = ref[j]; - parts[key] = parts[key].replace(/%(T?URL|IMG|[sh]?MD5|board|name|%|semi|\$\d+)/g, function(orig, parameter) { - var type; - if (parameter[0] === '$') { - if (!matches) { - return orig; - } - type = matches[parameter.slice(1)] || ''; - } else { - type = Sauce.formatters[parameter](post, file, ext); - if (type == null) { - missing.push(parameter); - return ''; - } - } - if (key === 'url' && (parameter !== '%' && parameter !== 'semi')) { - if (/^javascript:/i.test(parts['url'])) { - type = JSON.stringify(type); - } - type = encodeURIComponent(type); - } - return type; - }); - } - if ((typeof (base = g.SITE).areMD5sDeferred === "function" ? base.areMD5sDeferred(post.board) : void 0) && missing.length && !missing.filter(function(x) { - return !/^.?MD5$/.test(x); - }).length) { - a = Sauce.link.cloneNode(false); - a.dataset.skip = '1'; - return a; - } - if (missing.length) { - return null; - } - a = Sauce.link.cloneNode(false); - a.href = parts['url']; - a.textContent = parts['text']; - if (/^javascript:/i.test(parts['url'])) { - a.removeAttribute('target'); - } - return a; - }, - node: function() { - var file, j, len, ref; - if (this.isClone) { - return; - } - ref = this.files; - for (j = 0, len = ref.length; j < len; j++) { - file = ref[j]; - Sauce.file(this, file); - } - }, - file: function(post, file) { - var j, len, link, node, nodes, observer, ref, skipped; - nodes = []; - skipped = []; - ref = Sauce.links; - for (j = 0, len = ref.length; j < len; j++) { - link = ref[j]; - if ((node = Sauce.createSauceLink(link, post, file))) { - nodes.push($.tn(' '), node); - if (node.dataset.skip) { - skipped.push([link, node]); - } - } - } - $.add(file.text, nodes); - if (skipped.length) { - observer = new MutationObserver(function() { - var k, len1, node2, ref1; - if (file.text.dataset.md5) { - for (k = 0, len1 = skipped.length; k < len1; k++) { - ref1 = skipped[k], link = ref1[0], node = ref1[1]; - if ((node2 = Sauce.createSauceLink(link, post, file))) { - $.replace(node, node2); - } - } - return observer.disconnect(); - } - }); - return observer.observe(file.text, { - attributes: true - }); - } - }, - formatters: { - TURL: function(post, file) { - return file.thumbURL; - }, - URL: function(post, file) { - return file.url; - }, - IMG: function(post, file, ext) { - if (ext === 'gif' || ext === 'jpg' || ext === 'jpeg' || ext === 'png') { - return file.url; - } else { - return file.thumbURL; - } - }, - MD5: function(post, file) { - return file.MD5; - }, - sMD5: function(post, file) { - var ref; - return (ref = file.MD5) != null ? ref.replace(/[+\/=]/g, function(c) { - return { - '+': '-', - '/': '_', - '=': '' - }[c]; - }) : void 0; - }, - hMD5: function(post, file) { - var c; - if (file.MD5) { - return ((function() { - var j, len, ref, results; - ref = atob(file.MD5); - results = []; - for (j = 0, len = ref.length; j < len; j++) { - c = ref[j]; - results.push(("0" + (c.charCodeAt(0).toString(16))).slice(-2)); - } - return results; - })()).join(''); - } - }, - board: function(post) { - return post.board.ID; - }, - name: function(post, file) { - return file.name; - }, - '%': function() { - return '%'; - }, - semi: function() { - return ';'; - } - } - }; - - return Sauce; - -}).call(this); - -Volume = (function() { - var Volume; - - Volume = { - init: function() { - var base, ref, unmuteEntry, volumeEntry; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Image Expansion'] || Conf['Image Hover'] || Conf['Image Hover in Catalog'] || Conf['Gallery']))) { - return; - } - $.sync('Allow Sound', function(x) { - var ref1; - Conf['Allow Sound'] = x; - return (ref1 = Volume.inputs) != null ? ref1.unmute.checked = x : void 0; - }); - $.sync('Default Volume', function(x) { - var ref1; - Conf['Default Volume'] = x; - return (ref1 = Volume.inputs) != null ? ref1.volume.value = x : void 0; - }); - if (Conf['Mouse Wheel Volume']) { - Callbacks.Post.push({ - name: 'Mouse Wheel Volume', - cb: this.node - }); - } - if (typeof (base = g.SITE).noAudio === "function" ? base.noAudio(g.BOARD) : void 0) { - return; - } - if (Conf['Mouse Wheel Volume']) { - Callbacks.CatalogThread.push({ - name: 'Mouse Wheel Volume', - cb: this.catalogNode - }); - } - unmuteEntry = UI.checkbox('Allow Sound', 'Allow Sound'); - unmuteEntry.title = Config.main['Images and Videos']['Allow Sound'][1]; - volumeEntry = $.el('label', { - title: 'Default volume for videos.' - }); - $.extend(volumeEntry, {innerHTML: " Volume"}); - this.inputs = { - unmute: unmuteEntry.firstElementChild, - volume: volumeEntry.firstElementChild - }; - $.on(this.inputs.unmute, 'change', $.cb.checked); - $.on(this.inputs.volume, 'change', $.cb.value); - Header.menu.addEntry({ - el: unmuteEntry, - order: 200 - }); - return Header.menu.addEntry({ - el: volumeEntry, - order: 201 - }); - }, - setup: function(video) { - video.muted = !Conf['Allow Sound']; - video.volume = Conf['Default Volume']; - return $.on(video, 'volumechange', Volume.change); - }, - change: function() { - var items, key, muted, ref, val, volume; - ref = this, muted = ref.muted, volume = ref.volume; - items = { - 'Allow Sound': !muted, - 'Default Volume': volume - }; - for (key in items) { - val = items[key]; - if (Conf[key] === val) { - delete items[key]; - } - } - $.set(items); - $.extend(Conf, items); - if (Volume.inputs) { - Volume.inputs.unmute.checked = !muted; - return Volume.inputs.volume.value = volume; - } - }, - node: function() { - var base, file, i, len, ref; - if (typeof (base = g.SITE).noAudio === "function" ? base.noAudio(this.board) : void 0) { - return; - } - ref = this.files; - for (i = 0, len = ref.length; i < len; i++) { - file = ref[i]; - if (!file.isVideo) { - continue; - } - if (file.thumb) { - $.on(file.thumb, 'wheel', Volume.wheel.bind(Header.hover)); - } - $.on($('.file-info', file.text) || file.link, 'wheel', Volume.wheel.bind(file.thumbLink)); - } - }, - catalogNode: function() { - var file; - file = this.thread.OP.files[0]; - if (!(file != null ? file.isVideo : void 0)) { - return; - } - return $.on(this.nodes.thumb, 'wheel', Volume.wheel.bind(Header.hover)); - }, - wheel: function(e) { - var el, volume; - if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) { - return; - } - if (!(el = $('video:not([data-md5])', this))) { - return; - } - if (el.muted || !$.hasAudio(el)) { - return; - } - volume = el.volume + 0.1; - if (e.deltaY < 0) { - volume *= 1.1; - } - if (e.deltaY > 0) { - volume /= 1.1; - } - el.volume = $.minmax(volume - 0.1, 0, 1); - return e.preventDefault(); - } - }; - - return Volume; - -}).call(this); - -Embedding = (function() { - var Embedding, - slice = [].slice; - - Embedding = { - init: function() { - var j, len, ref, ref1, type; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive') && Conf['Linkify'] && (Conf['Embedding'] || Conf['Link Title'] || Conf['Cover Preview']))) { - return; - } - this.types = $.dict(); - ref1 = this.ordered_types; - for (j = 0, len = ref1.length; j < len; j++) { - type = ref1[j]; - this.types[type.key] = type; - } - if (Conf['Embedding'] && g.VIEW !== 'archive') { - this.dialog = UI.dialog('embedding', {innerHTML: "
      "}); - this.media = $('#media-embed', this.dialog); - $.one(d, '4chanXInitFinished', this.ready); - $.on(d, 'IndexRefreshInternal', function() { - return g.posts.forEach(function(post) { - var embed, k, l, len1, len2, ref2, ref3; - ref2 = [post].concat(slice.call(post.clones)); - for (k = 0, len1 = ref2.length; k < len1; k++) { - post = ref2[k]; - ref3 = post.nodes.embedlinks; - for (l = 0, len2 = ref3.length; l < len2; l++) { - embed = ref3[l]; - Embedding.cb.catalogRemove.call(embed); - } - } - }); - }); - } - if (Conf['Link Title']) { - return $.on(d, '4chanXInitFinished PostsInserted', function() { - var key, ref2, ref3, service; - ref2 = Embedding.types; - for (key in ref2) { - service = ref2[key]; - if ((ref3 = service.title) != null ? ref3.batchSize : void 0) { - Embedding.flushTitles(service.title); - } - } - }); - } - }, - events: function(post) { - var data, el, i, items; - if (g.VIEW === 'archive') { - return; - } - if (Conf['Embedding']) { - i = 0; - items = post.nodes.embedlinks = $$('.embedder', post.nodes.comment); - while (el = items[i++]) { - $.on(el, 'click', Embedding.cb.click); - if ($.hasClass(el, 'embedded')) { - Embedding.cb.toggle.call(el); - } - } - } - if (Conf['Cover Preview']) { - i = 0; - items = $$('.linkify', post.nodes.comment); - while (el = items[i++]) { - if ((data = Embedding.services(el))) { - Embedding.preview(data); - } - } - } - }, - process: function(link, post) { - var data; - if (!(Conf['Embedding'] || Conf['Link Title'] || Conf['Cover Preview'])) { - return; - } - if ($.x('ancestor::pre', link)) { - return; - } - if (data = Embedding.services(link)) { - data.post = post; - if (Conf['Embedding'] && g.VIEW !== 'archive') { - Embedding.embed(data); - } - if (Conf['Link Title']) { - Embedding.title(data); - } - if (Conf['Cover Preview'] && g.VIEW !== 'archive') { - return Embedding.preview(data); - } - } - }, - services: function(link) { - var href, j, len, match, ref, type; - href = link.href; - ref = Embedding.ordered_types; - for (j = 0, len = ref.length; j < len; j++) { - type = ref[j]; - if ((match = type.regExp.exec(href))) { - return { - key: type.key, - uid: match[1], - options: match[2], - link: link - }; - } - } - }, - embed: function(data) { - var embed, href, key, link, name, options, post, ref, uid, value; - key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post; - href = link.href; - $.addClass(link, key.toLowerCase()); - embed = $.el('a', { - className: 'embedder', - href: 'javascript:;' - }, {innerHTML: "(unembed)"}); - ref = { - key: key, - uid: uid, - options: options, - href: href - }; - for (name in ref) { - value = ref[name]; - embed.dataset[name] = value; - } - $.on(embed, 'click', Embedding.cb.click); - $.after(link, [$.tn(' '), embed]); - post.nodes.embedlinks.push(embed); - if (Conf['Auto-embed'] && !Conf['Floating Embeds'] && !post.isFetchedQuote) { - if ($.hasClass(doc, 'catalog-mode')) { - return $.addClass(embed, 'embed-removed'); - } else { - return Embedding.cb.toggle.call(embed); - } - } - }, - ready: function() { - if (!Main.isThisPageLegit()) { - return; - } - $.addClass(Embedding.dialog, 'empty'); - $.on($('.close', Embedding.dialog), 'click', Embedding.closeFloat); - $.on($('.move', Embedding.dialog), 'mousedown', Embedding.dragEmbed); - $.on($('.jump', Embedding.dialog), 'click', function() { - if (doc.contains(Embedding.lastEmbed)) { - return Header.scrollTo(Embedding.lastEmbed); - } - }); - return $.add(d.body, Embedding.dialog); - }, - closeFloat: function() { - delete Embedding.lastEmbed; - $.addClass(Embedding.dialog, 'empty'); - return $.replace(Embedding.media.firstChild, $.el('div')); - }, - dragEmbed: function() { - var style; - style = Embedding.media.style; - if (Embedding.dragEmbed.mouseup) { - $.off(d, 'mouseup', Embedding.dragEmbed); - Embedding.dragEmbed.mouseup = false; - style.pointerEvents = ''; - return; - } - $.on(d, 'mouseup', Embedding.dragEmbed); - Embedding.dragEmbed.mouseup = true; - return style.pointerEvents = 'none'; - }, - title: function(data) { - var key, link, options, post, service, uid; - key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post; - if (!(service = Embedding.types[key].title)) { - return; - } - $.addClass(link, key.toLowerCase()); - if (service.batchSize) { - (service.queue || (service.queue = [])).push(data); - if (service.queue.length >= service.batchSize) { - return Embedding.flushTitles(service); - } - } else { - return CrossOrigin.cache(service.api(uid), (function() { - return Embedding.cb.title(this, data); - })); - } - }, - flushTitles: function(service) { - var cb, data, queue; - queue = service.queue; - if (!(queue != null ? queue.length : void 0)) { - return; - } - service.queue = []; - cb = function() { - var data, j, len; - for (j = 0, len = queue.length; j < len; j++) { - data = queue[j]; - Embedding.cb.title(this, data); - } - }; - return CrossOrigin.cache(service.api((function() { - var j, len, results; - results = []; - for (j = 0, len = queue.length; j < len; j++) { - data = queue[j]; - results.push(data.uid); - } - return results; - })()), cb); - }, - preview: function(data) { - var key, link, service, uid; - key = data.key, uid = data.uid, link = data.link; - if (!(service = Embedding.types[key].preview)) { - return; - } - return $.on(link, 'mouseover', function(e) { - var el, height, src; - src = service.url(uid); - height = service.height; - el = $.el('img', { - src: src, - id: 'ihover' - }); - $.add(Header.hover, el); - return UI.hover({ - root: link, - el: el, - latestEvent: e, - endEvents: 'mouseout click', - height: height - }); - }); - }, - cb: { - click: function(e) { - var div; - e.preventDefault(); - if (!$.hasClass(this, 'embedded') && (Conf['Floating Embeds'] || $.hasClass(doc, 'catalog-mode'))) { - if (!(div = Embedding.media.firstChild)) { - return; - } - $.replace(div, Embedding.cb.embed(this)); - Embedding.lastEmbed = Get.postFromNode(this).nodes.root; - return $.rmClass(Embedding.dialog, 'empty'); - } else { - return Embedding.cb.toggle.call(this); - } - }, - toggle: function() { - if ($.hasClass(this, "embedded")) { - $.rm(this.nextElementSibling); - } else { - $.after(this, Embedding.cb.embed(this)); - } - return $.toggleClass(this, 'embedded'); - }, - embed: function(a) { - var container, el, type; - container = $.el('div', { - className: 'media-embed' - }); - $.add(container, el = (type = Embedding.types[a.dataset.key]).el(a)); - el.style.cssText = type.style != null ? type.style : 'border: none; width: 640px; height: 360px;'; - return container; - }, - catalogRemove: function() { - var isCatalog; - isCatalog = $.hasClass(doc, 'catalog-mode'); - if ((isCatalog && $.hasClass(this, 'embedded')) || (!isCatalog && $.hasClass(this, 'embed-removed'))) { - Embedding.cb.toggle.call(this); - return $.toggleClass(this, 'embed-removed'); - } - }, - title: function(req, data) { - var base1, j, k, key, len, len1, link, link2, options, post, post2, ref, ref1, service, status, text, uid; - key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post; - service = Embedding.types[key].title; - status = req.status; - if ((status === 200 || status === 304) && service.status) { - status = service.status(req.response)[0]; - } - if (!status) { - return; - } - text = "[" + key + "] " + ((function() { - switch (status) { - case 200: - case 304: - text = service.text(req.response, uid); - if (typeof text === 'string') { - return text; - } else { - return text = link.textContent; - } - break; - case 404: - return "Not Found"; - case 403: - case 401: - return "Forbidden or Private"; - default: - return status + "'d"; - } - })()); - link.dataset.original = link.textContent; - link.textContent = text; - ref = post.clones; - for (j = 0, len = ref.length; j < len; j++) { - post2 = ref[j]; - ref1 = $$('a.linkify', post2.nodes.comment); - for (k = 0, len1 = ref1.length; k < len1; k++) { - link2 = ref1[k]; - if (!(link2.href === link.href)) { - continue; - } - if ((base1 = link2.dataset).original == null) { - base1.original = link2.textContent; - } - link2.textContent = text; - } - } - } - }, - ordered_types: [ - { - key: 'audio', - regExp: /^[^?#]+\.(?:mp3|m4a|oga|wav|flac)(?:[?#]|$)/i, - style: '', - el: function(a) { - return $.el('audio', { - controls: true, - preload: 'auto', - src: a.dataset.href - }); - } - }, { - key: 'image', - regExp: /^[^?#]+\.(?:gif|png|jpg|jpeg|bmp|webp)(?::\w+)?(?:[?#]|$)/i, - style: '', - el: function(a) { - return $.el('div', {innerHTML: ""}); - } - }, { - key: 'video', - regExp: /^[^?#]+\.(?:og[gv]|webm|mp4)(?:[?#]|$)/i, - style: 'max-width: 80vw; max-height: 80vh;', - el: function(a) { - var el; - el = $.el('video', { - hidden: true, - controls: true, - preload: 'auto', - src: a.dataset.href, - loop: ImageHost.test(a.dataset.href.split('/')[2]) - }); - $.on(el, 'loadedmetadata', function() { - if (el.videoHeight === 0 && el.parentNode) { - return $.replace(el, Embedding.types.audio.el(a)); - } else { - return el.hidden = false; - } - }); - return el; - } - }, { - key: 'PeerTube', - regExp: /^(\w+:\/\/[^\/]+\/videos\/watch\/\w{8}-\w{4}-\w{4}-\w{4}-\w{12})(.*)/, - el: function(a) { - var el, options, start; - options = (start = a.dataset.options.match(/[?&](start=\w+)/)) ? "?" + start[1] : ''; - el = $.el('iframe', { - src: a.dataset.uid.replace('/videos/watch/', '/videos/embed/') + options - }); - el.setAttribute("allowfullscreen", "true"); - return el; - } - }, { - key: 'BitChute', - regExp: /^\w+:\/\/(?:www\.)?bitchute\.com\/video\/([\w\-]+)/, - el: function(a) { - var el; - el = $.el('iframe', { - src: "https://www.bitchute.com/embed/" + a.dataset.uid + "/" - }); - el.setAttribute("allowfullscreen", "true"); - return el; - } - }, { - key: 'Clyp', - regExp: /^\w+:\/\/(?:www\.)?clyp\.it\/(\w{8})/, - style: 'border: 0; width: 640px; height: 160px;', - el: function(a) { - return $.el('iframe', { - src: "https://clyp.it/" + a.dataset.uid + "/widget" - }); - }, - title: { - api: function(uid) { - return "https://api.clyp.it/oembed?url=https://clyp.it/" + uid; - }, - text: function(_) { - return _.title; - } - } - }, { - key: 'Dailymotion', - regExp: /^\w+:\/\/(?:(?:www\.)?dailymotion\.com\/(?:embed\/)?video|dai\.ly)\/([A-Za-z0-9]+)[^?]*(.*)/, - el: function(a) { - var el, options, start; - options = (start = a.dataset.options.match(/[?&](start=\d+)/)) ? "?" + start[1] : ''; - el = $.el('iframe', { - src: "//www.dailymotion.com/embed/video/" + a.dataset.uid + options - }); - el.setAttribute("allowfullscreen", "true"); - return el; - }, - title: { - api: function(uid) { - return "https://api.dailymotion.com/video/" + uid; - }, - text: function(_) { - return _.title; - } - }, - preview: { - url: function(uid) { - return "https://www.dailymotion.com/thumbnail/video/" + uid; - }, - height: 240 - } - }, { - key: 'Gfycat', - regExp: /^\w+:\/\/(?:www\.)?gfycat\.com\/(?:iframe\/)?(\w+)/, - el: function(a) { - var el; - el = $.el('iframe', { - src: "//gfycat.com/ifr/" + a.dataset.uid - }); - el.setAttribute("allowfullscreen", "true"); - return el; - } - }, { - key: 'Gist', - regExp: /^\w+:\/\/gist\.github\.com\/[\w\-]+\/(\w+)/, - style: '', - el: (function() { - var counter; - counter = 0; - return function(a) { - var el; - el = $.el('pre', { - hidden: true, - id: "gist-embed-" + (counter++) - }); - CrossOrigin.cache("https://api.github.com/gists/" + a.dataset.uid, function() { - el.textContent = Object.values(this.response.files)[0].content; - el.className = 'prettyprint'; - $.global(function() { - return typeof window.prettyPrint === "function" ? window.prettyPrint((function() {}), document.getElementById(document.currentScript.dataset.id).parentNode) : void 0; - }, { - id: el.id - }); - return el.hidden = false; - }); - return el; - }; - })(), - title: { - api: function(uid) { - return "https://api.github.com/gists/" + uid; - }, - text: function(arg) { - var file, files; - files = arg.files; - for (file in files) { - if (files.hasOwnProperty(file)) { - return file; - } - } - } - } - }, { - key: 'InstallGentoo', - regExp: /^\w+:\/\/paste\.installgentoo\.com\/view\/(?:raw\/|download\/|embed\/)?(\w+)/, - el: function(a) { - return $.el('iframe', { - src: "https://paste.installgentoo.com/view/embed/" + a.dataset.uid - }); - } - }, { - key: 'LiveLeak', - regExp: /^\w+:\/\/(?:\w+\.)?liveleak\.com\/.*\?.*[tif]=(\w+)/, - el: function(a) { - var el; - el = $.el('iframe', { - src: "https://www.liveleak.com/e/" + a.dataset.uid - }); - el.setAttribute("allowfullscreen", "true"); - return el; - } - }, { - key: 'Loopvid', - regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/#?((?:pf|kd|lv|gd|gh|db|dx|nn|cp|wu|ig|ky|mf|m2|pc|1c|pi|ni|wl|ko|mm|ic|gc)\/[\w\-\/]+(?:,[\w\-\/]+)*|fc\/\w+\/\d+|https?:\/\/.+)/, - style: 'max-width: 80vw; max-height: 80vh;', - el: function(a) { - var _, base, el, host, j, k, l, len, len1, len2, name, names, ref, ref1, type, types, url, urls; - el = $.el('video', { - controls: true, - preload: 'auto', - loop: true - }); - if (/^http/.test(a.dataset.uid)) { - $.add(el, $.el('source', { - src: a.dataset.uid - })); - return el; - } - ref = a.dataset.uid.match(/(\w+)\/(.*)/), _ = ref[0], host = ref[1], names = ref[2]; - types = (function() { - switch (host) { - case 'gd': - case 'wu': - case 'fc': - return ['']; - case 'gc': - return ['giant', 'fat', 'zippy']; - default: - return ['.webm', '.mp4']; - } - })(); - ref1 = names.split(','); - for (j = 0, len = ref1.length; j < len; j++) { - name = ref1[j]; - for (k = 0, len1 = types.length; k < len1; k++) { - type = types[k]; - base = "" + name + type; - urls = (function() { - switch (host) { - case 'pf': - return ["https://kastden.org/_loopvid_media/pf/" + base, "https://web.archive.org/web/2/http://a.pomf.se/" + base]; - case 'kd': - return ["https://kastden.org/loopvid/" + base]; - case 'lv': - return ["https://lv.kastden.org/" + base]; - case 'gd': - return ["https://docs.google.com/uc?export=download&id=" + base]; - case 'gh': - return ["https://googledrive.com/host/" + base]; - case 'db': - return ["https://dl.dropboxusercontent.com/u/" + base]; - case 'dx': - return ["https://dl.dropboxusercontent.com/" + base]; - case 'nn': - return ["https://kastden.org/_loopvid_media/nn/" + base]; - case 'cp': - return ["https://copy.com/" + base]; - case 'wu': - return ["http://webmup.com/" + base + "/vid.webm"]; - case 'ig': - return ["https://i.imgur.com/" + base]; - case 'ky': - return ["https://kastden.org/_loopvid_media/ky/" + base]; - case 'mf': - return ["https://kastden.org/_loopvid_media/mf/" + base, "https://web.archive.org/web/2/https://d.maxfile.ro/" + base]; - case 'm2': - return ["https://kastden.org/_loopvid_media/m2/" + base]; - case 'pc': - return ["https://kastden.org/_loopvid_media/pc/" + base, "https://web.archive.org/web/2/http://a.pomf.cat/" + base]; - case '1c': - return ["http://b.1339.cf/" + base]; - case 'pi': - return ["https://kastden.org/_loopvid_media/pi/" + base, "https://web.archive.org/web/2/https://u.pomf.is/" + base]; - case 'ni': - return ["https://kastden.org/_loopvid_media/ni/" + base, "https://web.archive.org/web/2/https://u.nya.is/" + base]; - case 'wl': - return ["http://webm.land/media/" + base]; - case 'ko': - return ["https://kordy.kastden.org/loopvid/" + base]; - case 'mm': - return ["https://kastden.org/_loopvid_media/mm/" + base, "https://web.archive.org/web/2/https://my.mixtape.moe/" + base]; - case 'ic': - return ["https://media.8ch.net/file_store/" + base]; - case 'fc': - return ["//" + (ImageHost.host()) + "/" + base + ".webm"]; - case 'gc': - return ["https://" + type + ".gfycat.com/" + name + ".webm"]; - } - })(); - for (l = 0, len2 = urls.length; l < len2; l++) { - url = urls[l]; - $.add(el, $.el('source', { - src: url - })); - } - } - } - return el; - } - }, { - key: 'Openings.moe', - regExp: /^\w+:\/\/openings.moe\/\?video=([^.&=]+)/, - style: 'width: 1280px; height: 720px; max-width: 80vw; max-height: 80vh;', - el: function(a) { - var el; - el = $.el('iframe', { - src: "https://openings.moe/?video=" + a.dataset.uid - }); - el.setAttribute("allowfullscreen", "true"); - return el; - } - }, { - key: 'Pastebin', - regExp: /^\w+:\/\/(?:\w+\.)?pastebin\.com\/(?!u\/)(?:[\w.]+(?:\/|\?i\=))?(\w+)/, - el: function(a) { - var div; - return div = $.el('iframe', { - src: "//pastebin.com/embed_iframe.php?i=" + a.dataset.uid - }); - } - }, { - key: 'SoundCloud', - regExp: /^\w+:\/\/(?:www\.)?(?:soundcloud\.com\/|snd\.sc\/)([\w\-\/]+)/, - style: 'border: 0; width: 500px; height: 400px;', - el: function(a) { - return $.el('iframe', { - src: "https://w.soundcloud.com/player/?visual=true&show_comments=false&url=https%3A%2F%2Fsoundcloud.com%2F" + (encodeURIComponent(a.dataset.uid)) - }); - }, - title: { - api: function(uid) { - return location.protocol + "//soundcloud.com/oembed?format=json&url=https%3A%2F%2Fsoundcloud.com%2F" + (encodeURIComponent(uid)); - }, - text: function(_) { - return _.title; - } - } - }, { - key: 'StrawPoll', - regExp: /^\w+:\/\/(?:www\.)?strawpoll\.me\/(?:embed_\d+\/)?(\d+(?:\/r)?)/, - style: 'border: 0; width: 600px; height: 406px;', - el: function(a) { - return $.el('iframe', { - src: "https://www.strawpoll.me/embed_1/" + a.dataset.uid - }); - } - }, { - key: 'Streamable', - regExp: /^\w+:\/\/(?:www\.)?streamable\.com\/(\w+)/, - el: function(a) { - var el; - el = $.el('iframe', { - src: "https://streamable.com/o/" + a.dataset.uid - }); - el.setAttribute("allowfullscreen", "true"); - return el; - }, - title: { - api: function(uid) { - return "https://api.streamable.com/oembed?url=https://streamable.com/" + uid; - }, - text: function(_) { - return _.title; - } - } - }, { - key: 'TwitchTV', - regExp: /^\w+:\/\/(?:www\.|secure\.|clips\.|m\.)?twitch\.tv\/(\w[^#\&\?]*)/, - el: function(a) { - var el, m, time, url; - m = a.dataset.href.match(/^\w+:\/\/(?:(clips\.)|\w+\.)?twitch\.tv\/(?:\w+\/)?(clip\/)?(\w[^#\&\?]*)/); - if (m[1] || m[2]) { - url = "//clips.twitch.tv/embed?clip=" + m[3] + "&parent=" + location.hostname; - } else { - m = a.dataset.uid.match(/(\w+)(?:\/(?:v\/)?(\d+))?/); - url = "//player.twitch.tv/?" + (m[2] ? "video=v" + m[2] : "channel=" + m[1]) + "&autoplay=false&parent=" + location.hostname; - if ((time = a.dataset.href.match(/\bt=(\w+)/))) { - url += "&time=" + time[1]; - } - } - el = $.el('iframe', { - src: url - }); - el.setAttribute("allowfullscreen", "true"); - return el; - } - }, { - key: 'Twitter', - regExp: /^\w+:\/\/(?:www\.|mobile\.)?twitter\.com\/(\w+\/status\/\d+)/, - style: 'border: none; width: 550px; height: 250px; overflow: hidden; resize: both;', - el: function(a) { - var cont, el, onMessage; - el = $.el('iframe'); - $.on(el, 'load', function() { - return this.contentWindow.postMessage({ - element: 't', - query: 'height' - }, 'https://twitframe.com'); - }); - onMessage = function(e) { - if (e.source === el.contentWindow && e.origin === 'https://twitframe.com') { - $.off(window, 'message', onMessage); - return (cont || el).style.height = (+$.minmax(e.data.height, 250, 0.8 * doc.clientHeight)) + "px"; - } - }; - $.on(window, 'message', onMessage); - el.src = "https://twitframe.com/show?url=https://twitter.com/" + a.dataset.uid; - if ($.engine === 'gecko') { - el.style.cssText = 'border: none; width: 100%; height: 100%;'; - cont = $.el('div'); - $.add(cont, el); - return cont; - } else { - return el; - } - } - }, { - key: 'VidLii', - regExp: /^\w+:\/\/(?:www\.)?vidlii\.com\/watch\?v=(\w{11})/, - style: 'border: none; width: 640px; height: 392px;', - el: function(a) { - var el; - el = $.el('iframe', { - src: "https://www.vidlii.com/embed?v=" + a.dataset.uid + "&a=0" - }); - el.setAttribute("allowfullscreen", "true"); - return el; - } - }, { - key: 'Vimeo', - regExp: /^\w+:\/\/(?:www\.)?vimeo\.com\/(\d+)/, - el: function(a) { - var el; - el = $.el('iframe', { - src: "//player.vimeo.com/video/" + a.dataset.uid + "?wmode=opaque" - }); - el.setAttribute("allowfullscreen", "true"); - return el; - }, - title: { - api: function(uid) { - return "https://vimeo.com/api/oembed.json?url=https://vimeo.com/" + uid; - }, - text: function(_) { - return _.title; - } - } - }, { - key: 'Vine', - regExp: /^\w+:\/\/(?:www\.)?vine\.co\/v\/(\w+)/, - style: 'border: none; width: 500px; height: 500px;', - el: function(a) { - return $.el('iframe', { - src: "https://vine.co/v/" + a.dataset.uid + "/card" - }); - } - }, { - key: 'Vocaroo', - regExp: /^\w+:\/\/(?:(?:www\.|old\.)?vocaroo\.com|voca\.ro)\/((?:i\/)?\w+)/, - style: '', - el: function(a) { - var el; - el = $.el('iframe'); - el.width = 300; - el.height = 60; - el.setAttribute('frameborder', 0); - el.src = "https://vocaroo.com/embed/" + (a.dataset.uid.replace(/^i\//, '')) + "?autoplay=0"; - return el; - } - }, { - key: 'YouTube', - regExp: /^\w+:\/\/(?:youtu.be\/|[\w.]*youtube[\w.]*\/.*(?:v=|\bembed\/|\bv\/))([\w\-]{11})(.*)/, - el: function(a) { - var el, start; - start = a.dataset.options.match(/\b(?:star)?t\=(\w+)/); - if (start) { - start = start[1]; - } - if (start && !/^\d+$/.test(start)) { - start += ' 0h0m0s'; - start = 3600 * start.match(/(\d+)h/)[1] + 60 * start.match(/(\d+)m/)[1] + 1 * start.match(/(\d+)s/)[1]; - } - el = $.el('iframe', { - src: "//www.youtube.com/embed/" + a.dataset.uid + "?rel=0&wmode=opaque" + (start ? '&start=' + start : '') - }); - el.setAttribute("allowfullscreen", "true"); - return el; - }, - title: { - api: function(uid) { - return "https://www.youtube.com/oembed?url=https%3A//www.youtube.com/watch%3Fv%3D" + uid + "&format=json"; - }, - text: function(_) { - return _.title; - }, - status: function(_) { - var m; - if (_.error) { - m = _.error.match(/^(\d*)\s*(.*)/); - return [+m[1], m[2]]; - } else { - return [200, 'OK']; - } - } - }, - preview: { - url: function(uid) { - return "https://img.youtube.com/vi/" + uid + "/0.jpg"; - }, - height: 360 - } - } - ] - }; - - return Embedding; - -}).call(this); - -Linkify = (function() { - var Linkify; - - Linkify = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread' && ref !== 'archive') || !Conf['Linkify']) { - return; - } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - Callbacks.Post.push({ - name: 'Linkify', - cb: this.node - }); - return Embedding.init(); - }, - node: function() { - var base, j, k, len, len1, link, links, ref; - if (this.isClone) { - return Embedding.events(this); - } - if (!Linkify.regString.test(this.info.comment)) { - return; - } - ref = $$('a', this.nodes.comment); - for (j = 0, len = ref.length; j < len; j++) { - link = ref[j]; - if (!(typeof (base = g.SITE).isLinkified === "function" ? base.isLinkified(link) : void 0)) { - continue; - } - $.addClass(link, 'linkify'); - if (ImageHost.useFaster) { - ImageHost.fixLinks([link]); - } - Embedding.process(link, this); - } - links = Linkify.process(this.nodes.comment); - if (ImageHost.useFaster) { - ImageHost.fixLinks(links); - } - for (k = 0, len1 = links.length; k < len1; k++) { - link = links[k]; - Embedding.process(link, this); - } - }, - process: function(node) { - var data, end, endNode, i, index, length, links, part1, part2, ref, ref1, result, saved, snapshot, space, test, word; - test = /[^\s"]+/g; - space = /[\s"]/; - snapshot = $.X('.//br|.//text()', node); - i = 0; - links = []; - while (node = snapshot.snapshotItem(i++)) { - data = node.data; - if (!data || node.parentElement.nodeName === "A") { - continue; - } - while (result = test.exec(data)) { - index = result.index; - endNode = node; - word = result[0]; - if ((length = index + word.length) === data.length) { - test.lastIndex = 0; - while ((saved = snapshot.snapshotItem(i++))) { - if (saved.nodeName === 'BR' || (saved.parentElement.nodeName === 'P' && !saved.previousSibling)) { - if ((part1 = word.match(/(https?:\/\/)?([a-z\d-]+\.)*[a-z\d-]+$/i)) && (part2 = (ref = snapshot.snapshotItem(i)) != null ? (ref1 = ref.data) != null ? ref1.match(/^(\.[a-z\d-]+)*\//i) : void 0 : void 0) && (part1[0] + part2[0]).search(Linkify.regString) === 0) { - continue; - } else { - break; - } - } - if (saved.parentElement.nodeName === "A" && !Linkify.regString.test(word)) { - break; - } - endNode = saved; - data = saved.data; - if (end = space.exec(data)) { - word += data.slice(0, end.index); - test.lastIndex = length = end.index; - i--; - break; - } else { - length = data.length; - word += data; - } - } - } - if (Linkify.regString.test(word)) { - links.push(Linkify.makeRange(node, endNode, index, length)); - } - if (!(test.lastIndex && node === endNode)) { - break; - } - } - } - i = links.length; - while (i--) { - links[i] = Linkify.makeLink(links[i]); - } - return links; - }, - regString: /((https?|mailto|git|magnet|ftp|irc):([a-z\d%\/?])|([-a-z\d]+[.])+(aero|asia|biz|cat|com|coop|dance|info|int|jobs|mobi|moe|museum|name|net|org|post|pro|tel|travel|xxx|xyz|edu|gov|mil|[a-z]{2})([:\/]|(?![^\s"]))|[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}|[-\w\d.@]+@[a-z\d.-]+\.[a-z\d])/i, - makeRange: function(startNode, endNode, startOffset, endOffset) { - var range; - range = document.createRange(); - range.setStart(startNode, startOffset); - range.setEnd(endNode, endOffset); - return range; - }, - makeLink: function(range) { - var a, encodedDomain, i, t, text; - text = range.toString(); - i = text.search(Linkify.regString); - if (i > 0) { - text = text.slice(i); - while (range.startOffset + i >= range.startContainer.data.length) { - i--; - } - if (i) { - range.setStart(range.startContainer, range.startOffset + i); - } - } - i = 0; - while (/[)\]}>.,]/.test(t = text.charAt(text.length - (1 + i)))) { - if (!(/[.,]/.test(t) || (text.match(/[()\[\]{}<>]/g)).length % 2)) { - break; - } - i++; - } - if (i) { - text = text.slice(0, -i); - while (range.endOffset - i < 0) { - i--; - } - if (i) { - range.setEnd(range.endContainer, range.endOffset - i); - } - } - if (!/((mailto|magnet):|.+:\/\/)/.test(text)) { - text = (/@/.test(text) ? 'mailto:' : 'http://') + text; - } - if (encodedDomain = text.match(/^(https?:\/\/[^\/]*%[0-9a-f]{2})(.*)$/i)) { - text = encodedDomain[1].replace(/%([0-9a-f]{2})/ig, function(x, y) { - if (y === '25') { - return x; - } else { - return String.fromCharCode(parseInt(y, 16)); - } - }) + encodedDomain[2]; - } - a = $.el('a', { - className: 'linkify', - rel: 'noreferrer noopener', - target: '_blank', - href: text - }); - $.add(a, range.extractContents()); - range.insertNode(a); - return a; - } - }; - - return Linkify; - -}).call(this); - -ArchiveLink = (function() { - var ArchiveLink; - - ArchiveLink = { - init: function() { - var div, entry, i, len, ref, ref1, type; - if (!(g.SITE.software === 'yotsuba' && ((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Archive Link'])) { - return; - } - div = $.el('div', { - textContent: 'Archive' - }); - entry = { - el: div, - order: 60, - open: function(arg) { - var ID, board, thread; - ID = arg.ID, thread = arg.thread, board = arg.board; - return !!Redirect.to('thread', { - postID: ID, - threadID: thread.ID, - boardID: board.ID - }); - }, - subEntries: [] - }; - ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Flag', 'country'], ['Filename', 'filename'], ['Image MD5', 'MD5']]; - for (i = 0, len = ref1.length; i < len; i++) { - type = ref1[i]; - entry.subEntries.push(this.createSubEntry(type[0], type[1])); - } - return Menu.menu.addEntry(entry); - }, - createSubEntry: function(text, type) { - var el, open; - el = $.el('a', { - textContent: text, - target: '_blank' - }); - open = type === 'post' ? function(arg) { - var ID, board, thread; - ID = arg.ID, thread = arg.thread, board = arg.board; - el.href = Redirect.to('thread', { - postID: ID, - threadID: thread.ID, - boardID: board.ID - }); - return true; - } : function(post) { - var ref, typeParam, value; - typeParam = type === 'country' && post.info.flagCodeTroll ? 'troll_country' : type; - value = type === 'country' ? post.info.flagCode || ((ref = post.info.flagCodeTroll) != null ? ref.toLowerCase() : void 0) : Filter.values(type, post)[0]; - if (!value) { - return false; - } - el.href = Redirect.to('search', { - boardID: post.board.ID, - type: typeParam, - value: value, - isSearch: true - }); - return true; - }; - return { - el: el, - open: open - }; - } - }; - - return ArchiveLink; - -}).call(this); - -CopyTextLink = (function() { - var CopyTextLink; - - CopyTextLink = { - init: function() { - var a, ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Copy Text Link'])) { - return; - } - a = $.el('a', { - className: 'copy-text-link', - href: 'javascript:;', - textContent: 'Copy Text' - }); - $.on(a, 'click', CopyTextLink.copy); - return Menu.menu.addEntry({ - el: a, - order: 12, - open: function(post) { - CopyTextLink.text = (post.origin || post).commentOrig(); - return true; - } - }); - }, - copy: function() { - var el; - el = $.el('textarea', { - className: 'copy-text-element', - value: CopyTextLink.text - }); - $.add(d.body, el); - el.select(); - try { - d.execCommand('copy'); - } catch (error) {} - return $.rm(el); - } - }; - - return CopyTextLink; - -}).call(this); - -DeleteLink = (function() { - var DeleteLink; - - DeleteLink = { - auto: [$.dict(), $.dict()], - init: function() { - var div, fileEl, fileEntry, postEl, postEntry, ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Delete Link'])) { - return; - } - div = $.el('div', { - className: 'delete-link', - textContent: 'Delete' - }); - postEl = $.el('a', { - className: 'delete-post', - href: 'javascript:;' - }); - fileEl = $.el('a', { - className: 'delete-file', - href: 'javascript:;' - }); - this.nodes = { - menu: div.firstChild, - links: [postEl, fileEl] - }; - postEntry = { - el: postEl, - open: function() { - postEl.textContent = DeleteLink.linkText(false); - $.on(postEl, 'click', DeleteLink.toggle); - return true; - } - }; - fileEntry = { - el: fileEl, - open: function(arg) { - var file; - file = arg.file; - if (!file || file.isDead) { - return false; - } - fileEl.textContent = DeleteLink.linkText(true); - $.on(fileEl, 'click', DeleteLink.toggle); - return true; - } - }; - return Menu.menu.addEntry({ - el: div, - order: 40, - open: function(post) { - if (post.isDead) { - return false; - } - DeleteLink.post = post; - DeleteLink.nodes.menu.textContent = DeleteLink.menuText(); - DeleteLink.cooldown.start(post); - return true; - }, - subEntries: [postEntry, fileEntry] - }); - }, - menuText: function() { - var seconds; - if (seconds = DeleteLink.cooldown.seconds[DeleteLink.post.fullID]) { - return "Delete (" + seconds + ")"; - } else { - return 'Delete'; - } - }, - linkText: function(fileOnly) { - var text; - text = fileOnly ? 'File' : 'Post'; - if (DeleteLink.auto[+fileOnly][DeleteLink.post.fullID]) { - text = "Deleting " + (text.toLowerCase()) + "..."; - } - return text; - }, - toggle: function() { - var auto, fileOnly, post; - post = DeleteLink.post; - fileOnly = $.hasClass(this, 'delete-file'); - auto = DeleteLink.auto[+fileOnly]; - if (auto[post.fullID]) { - delete auto[post.fullID]; - } else { - auto[post.fullID] = true; - } - this.textContent = DeleteLink.linkText(fileOnly); - if (!DeleteLink.cooldown.seconds[post.fullID]) { - return DeleteLink["delete"](post, fileOnly); - } - }, - "delete": function(post, fileOnly) { - var form, link; - link = DeleteLink.nodes.links[+fileOnly]; - delete DeleteLink.auto[+fileOnly][post.fullID]; - if (post.fullID === DeleteLink.post.fullID) { - $.off(link, 'click', DeleteLink.toggle); - } - form = { - mode: 'usrdel', - onlyimgdel: fileOnly, - pwd: QR.persona.getPassword() - }; - form[+post.ID] = 'delete'; - return $.ajax($.id('delform').action.replace("/" + g.BOARD + "/", "/" + post.board + "/"), { - responseType: 'document', - withCredentials: true, - onloadend: function() { - return DeleteLink.load(link, post, fileOnly, this.response); - }, - form: $.formData(form) - }); - }, - load: function(link, post, fileOnly, resDoc) { - var el, msg; - if (!resDoc) { - new Notice('warning', 'Connection error, please retry.', 20); - if (post.fullID === DeleteLink.post.fullID) { - $.on(link, 'click', DeleteLink.toggle); - } - return; - } - link.textContent = DeleteLink.linkText(fileOnly); - if (resDoc.title === '4chan - Banned') { - el = $.el('span', {innerHTML: "You can't delete posts because you are banned."}); - return new Notice('warning', el, 20); - } else if (msg = resDoc.getElementById('errmsg')) { - new Notice('warning', msg.textContent, 20); - if (post.fullID === DeleteLink.post.fullID) { - $.on(link, 'click', DeleteLink.toggle); - } - if (QR.cooldown.data && Conf['Cooldown'] && /\bwait\b/i.test(msg.textContent)) { - DeleteLink.cooldown.start(post, 5); - DeleteLink.auto[+fileOnly][post.fullID] = true; - return DeleteLink.nodes.links[+fileOnly].textContent = DeleteLink.linkText(fileOnly); - } - } else { - if (!fileOnly) { - QR.cooldown["delete"](post); - } - if (resDoc.title === 'Updating index...') { - (post.origin || post).kill(fileOnly); - } - if (post.fullID === DeleteLink.post.fullID) { - return link.textContent = 'Deleted'; - } - } - }, - cooldown: { - seconds: $.dict(), - start: function(post, seconds) { - if (DeleteLink.cooldown.seconds[post.fullID] != null) { - return; - } - if (seconds == null) { - seconds = QR.cooldown.secondsDeletion(post); - } - if (seconds > 0) { - DeleteLink.cooldown.seconds[post.fullID] = seconds; - return DeleteLink.cooldown.count(post); - } - }, - count: function(post) { - var fileOnly, i, len, ref; - if (post.fullID === DeleteLink.post.fullID) { - DeleteLink.nodes.menu.textContent = DeleteLink.menuText(); - } - if (DeleteLink.cooldown.seconds[post.fullID] > 0 && Conf['Cooldown']) { - DeleteLink.cooldown.seconds[post.fullID]--; - setTimeout(DeleteLink.cooldown.count, 1000, post); - } else { - delete DeleteLink.cooldown.seconds[post.fullID]; - ref = [false, true]; - for (i = 0, len = ref.length; i < len; i++) { - fileOnly = ref[i]; - if (DeleteLink.auto[+fileOnly][post.fullID]) { - DeleteLink["delete"](post, fileOnly); - } - } - } - } - } - }; - - return DeleteLink; - -}).call(this); - -DownloadLink = (function() { - var DownloadLink; - - DownloadLink = { - init: function() { - var a, ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Download Link'])) { - return; - } - a = $.el('a', { - className: 'download-link', - textContent: 'Download file' - }); - $.on(a, 'click', ImageCommon.download); - return Menu.menu.addEntry({ - el: a, - order: 100, - open: function(arg) { - var file; - file = arg.file; - if (!file) { - return false; - } - a.href = file.url; - a.download = file.name; - return true; - } - }); - } - }; - - return DownloadLink; - -}).call(this); - -Menu = (function() { - var Menu; - - Menu = { - init: function() { - var ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'])) { - return; - } - this.button = $.el('a', { - className: 'menu-button', - href: 'javascript:;' - }); - $.extend(this.button, {innerHTML: ""}); - this.menu = new UI.Menu('post'); - Callbacks.Post.push({ - name: 'Menu', - cb: this.node - }); - return Callbacks.CatalogThread.push({ - name: 'Menu', - cb: this.catalogNode - }); - }, - node: function() { - var button; - if (this.isClone) { - button = $('.menu-button', this.nodes.info); - $.rmClass(button, 'active'); - $.rm($('.dialog', this.nodes.info)); - Menu.makeButton(this, button); - return; - } - return $.add(this.nodes.info, Menu.makeButton(this)); - }, - catalogNode: function() { - return $.after(this.nodes.icons, Menu.makeButton(this.thread.OP)); - }, - makeButton: function(post, button) { - button || (button = Menu.button.cloneNode(true)); - $.on(button, 'click', function(e) { - return Menu.menu.toggle(e, this, post); - }); - return button; - } - }; - - return Menu; - -}).call(this); - -ReportLink = (function() { - var ReportLink; - - ReportLink = { - init: function() { - var a, ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Report Link'])) { - return; - } - a = $.el('a', { - className: 'report-link', - href: 'javascript:;', - textContent: 'Report' - }); - $.on(a, 'click', ReportLink.report); - return Menu.menu.addEntry({ - el: a, - order: 10, - open: function(post) { - ReportLink.url = "//sys." + (location.hostname.split('.')[1]) + ".org/" + post.board + "/imgboard.php?mode=report&no=" + post; - if (d.cookie.indexOf('pass_enabled=1') >= 0) { - ReportLink.dims = 'width=350,height=275'; - } else { - ReportLink.dims = 'width=400,height=550'; - } - return true; - } - }); - }, - report: function() { - var dims, id, set, url; - url = ReportLink.url, dims = ReportLink.dims; - id = Date.now(); - set = "toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1," + dims; - return window.open(url, id, set); - } - }; - - return ReportLink; - -}).call(this); - -AntiAutoplay = (function() { - var AntiAutoplay; - - AntiAutoplay = { - init: function() { - var audio, i, len, ref; - if (!Conf['Disable Autoplaying Sounds']) { - return; - } - $.addClass(doc, 'anti-autoplay'); - ref = $$('audio[autoplay]', doc); - for (i = 0, len = ref.length; i < len; i++) { - audio = ref[i]; - this.stop(audio); - } - window.addEventListener('loadstart', ((function(_this) { - return function(e) { - return _this.stop(e.target); - }; - })(this)), true); - Callbacks.Post.push({ - name: 'Disable Autoplaying Sounds', - cb: this.node - }); - return $.ready((function(_this) { - return function() { - return _this.process(d.body); - }; - })(this)); - }, - stop: function(audio) { - if (!audio.autoplay) { - return; - } - audio.pause(); - audio.autoplay = false; - if (audio.controls) { - return; - } - audio.controls = true; - return $.addClass(audio, 'controls-added'); - }, - node: function() { - return AntiAutoplay.process(this.nodes.comment); - }, - process: function(root) { - var i, iframe, j, len, len1, object, ref, ref1; - ref = $$('iframe[src*="youtube"][src*="autoplay=1"]', root); - for (i = 0, len = ref.length; i < len; i++) { - iframe = ref[i]; - AntiAutoplay.processVideo(iframe, 'src'); - } - ref1 = $$('object[data*="youtube"][data*="autoplay=1"]', root); - for (j = 0, len1 = ref1.length; j < len1; j++) { - object = ref1[j]; - AntiAutoplay.processVideo(object, 'data'); - } - }, - processVideo: function(el, attr) { - el[attr] = el[attr].replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', ''); - if (window.getComputedStyle(el).display === 'none') { - el.style.display = 'block'; - } - return $.addClass(el, 'autoplay-removed'); - } - }; - - return AntiAutoplay; - -}).call(this); - -Banner = (function() { - var Banner, - slice = [].slice; - - Banner = { - init: function() { - if (Conf['Custom Board Titles']) { - this.db = new DataBoard('customTitles', null, true); - } - $.asap((function() { - return d.body; - }), function() { - return $.asap((function() { - return $('hr'); - }), Banner.ready); - }); - if (g.BOARD.ID !== 'f') { - return Main.ready(function() { - return $.queueTask(Banner.load); - }); - } - }, - ready: function() { - var banner, children; - banner = $(".boardBanner"); - children = banner.children; - if (g.VIEW === 'thread' && Conf['Remove Thread Excerpt']) { - Banner.setTitle(children[1].textContent); - } - children[0].title = "Click to change"; - $.on(children[0], 'click', Banner.cb.toggle); - if (Conf['Custom Board Titles']) { - Banner.custom(children[1]); - if (children[2]) { - return Banner.custom(children[2]); - } - } - }, - load: function() { - var bannerCnt, img; - bannerCnt = $.id('bannerCnt'); - if (!bannerCnt.firstChild) { - img = $.el('img', { - alt: '4chan', - src: '//s.4cdn.org/image/title/' + bannerCnt.dataset.src - }); - return $.add(bannerCnt, img); - } - }, - setTitle: function(title) { - if (Unread.title != null) { - Unread.title = title; - return Unread.update(); - } else { - return d.title = title; - } - }, - cb: { - toggle: function() { - var banner, i, ref; - if (!((ref = Banner.choices) != null ? ref.length : void 0)) { - Banner.choices = Conf['knownBanners'].split(',').slice(); - } - i = Math.floor(Banner.choices.length * Math.random()); - banner = Banner.choices.splice(i, 1); - return $('img', this.parentNode).src = "//s.4cdn.org/image/title/" + banner; - }, - click: function(e) { - var base, br, j, len, name, ref; - if (!(e.ctrlKey || e.metaKey)) { - return; - } - if ((base = Banner.original)[name = this.className] == null) { - base[name] = this.cloneNode(true); - } - this.contentEditable = true; - ref = $$('br', this); - for (j = 0, len = ref.length; j < len; j++) { - br = ref[j]; - $.replace(br, $.tn('\n')); - } - return this.focus(); - }, - keydown: function(e) { - e.stopPropagation(); - if (!e.shiftKey && e.keyCode === 13) { - return this.blur(); - } - }, - blur: function() { - var br, j, len, ref; - ref = $$('br', this); - for (j = 0, len = ref.length; j < len; j++) { - br = ref[j]; - $.replace(br, $.tn('\n')); - } - if (this.textContent = this.textContent.replace(/\n*$/, '')) { - this.contentEditable = false; - return Banner.db.set({ - boardID: g.BOARD.ID, - threadID: this.className, - val: { - title: this.textContent, - orig: Banner.original[this.className].textContent - } - }); - } else { - $.rmAll(this); - $.add(this, slice.call(Banner.original[this.className].cloneNode(true).childNodes)); - return Banner.db["delete"]({ - boardID: g.BOARD.ID, - threadID: this.className - }); - } - } - }, - original: $.dict(), - custom: function(child) { - var className, data, event, j, len, ref; - className = child.className; - child.title = "Ctrl/\u2318+click to edit board " + (className.slice(5).toLowerCase()); - child.spellcheck = false; - ref = ['click', 'keydown', 'blur']; - for (j = 0, len = ref.length; j < len; j++) { - event = ref[j]; - $.on(child, event, Banner.cb[event]); - } - if (data = Banner.db.get({ - boardID: g.BOARD.ID, - threadID: className - })) { - if (Conf['Persistent Custom Board Titles'] || data.orig === child.textContent) { - Banner.original[className] = child.cloneNode(true); - return child.textContent = data.title; - } else { - return Banner.db["delete"]({ - boardID: g.BOARD.ID, - threadID: className - }); - } - } - } - }; - - return Banner; - -}).call(this); - -CatalogLinks = (function() { - var CatalogLinks; - - CatalogLinks = { - init: function() { - var el, input, selector; - if (g.SITE.software === 'yotsuba' && (Conf['External Catalog'] || Conf['JSON Index']) && !(Conf['JSON Index'] && g.VIEW === 'index')) { - selector = (function() { - switch (g.VIEW) { - case 'thread': - case 'archive': - return '.navLinks.desktop > a'; - case 'catalog': - return '.navLinks > :first-child > a'; - case 'index': - return '#ctrl-top > a, .cataloglink > a'; - } - })(); - $.ready(function() { - var base, catalogLink, catalogURL, i, len, link, link2, ref; - ref = $$(selector); - for (i = 0, len = ref.length; i < len; i++) { - link = ref[i]; - switch (link.pathname.replace(/\/+/g, '/')) { - case "/" + g.BOARD + "/": - if (Conf['JSON Index']) { - link.textContent = 'Index'; - } - link.href = CatalogLinks.index(); - break; - case "/" + g.BOARD + "/catalog": - link.href = CatalogLinks.catalog(); - } - if (g.VIEW === 'catalog' && (catalogURL = CatalogLinks.catalog()) !== (typeof (base = g.SITE.urls).catalog === "function" ? base.catalog(g.BOARD) : void 0)) { - catalogLink = link.parentNode.cloneNode(true); - link2 = catalogLink.firstElementChild; - link2.href = catalogURL; - link2.textContent = link2.hostname === location.hostname ? '4chan X Catalog' : 'External Catalog'; - $.after(link.parentNode, [$.tn(' '), catalogLink]); - } - } - }); - } - if (g.SITE.software === 'yotsuba' && Conf['JSON Index'] && Conf['Use 4chan X Catalog']) { - Callbacks.Post.push({ - name: 'Catalog Link Rewrite', - cb: this.node - }); - } - if ((this.enabled = Conf['Catalog Links'])) { - CatalogLinks.el = el = UI.checkbox('Header catalog links', 'Catalog Links'); - el.id = 'toggleCatalog'; - input = $('input', el); - $.on(input, 'change', this.toggle); - $.sync('Header catalog links', CatalogLinks.set); - return Header.menu.addEntry({ - el: el, - order: 95 - }); - } - }, - node: function() { - var a, i, len, m, ref; - ref = $$('a', this.nodes.comment); - for (i = 0, len = ref.length; i < len; i++) { - a = ref[i]; - if (m = a.href.match(/^https?:\/\/(boards\.4chan(?:nel)?\.org\/[^\/]+)\/catalog(#s=.*)?/)) { - a.href = "//" + m[1] + "/" + (m[2] || '#catalog'); - } - } - }, - toggle: function() { - $.event('CloseMenu'); - $.set('Header catalog links', this.checked); - return CatalogLinks.set(this.checked); - }, - set: function(useCatalog) { - Conf['Header catalog links'] = useCatalog; - CatalogLinks.setLinks(Header.boardList); - CatalogLinks.setLinks(Header.bottomBoardList); - CatalogLinks.el.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + "."; - return $('input', CatalogLinks.el).checked = useCatalog; - }, - setLinks: function(list) { - var VIEW, a, board, boardID, i, len, ref, ref1, ref2, ref3, siteID, tail, url; - if (!(((ref = CatalogLinks.enabled) != null ? ref : Conf['Catalog Links']) && list)) { - return; - } - tail = /(?:index)?(?:\.\w+)?$/; - ref1 = $$('a:not([data-only])', list); - for (i = 0, len = ref1.length; i < len; i++) { - a = ref1[i]; - ref2 = a.dataset, siteID = ref2.siteID, boardID = ref2.boardID; - if (!(siteID && boardID)) { - ref3 = Site.parseURL(a), siteID = ref3.siteID, boardID = ref3.boardID, VIEW = ref3.VIEW; - if (!(siteID && boardID && (VIEW === 'index' || VIEW === 'catalog') && (a.dataset.indexOptions || a.href.replace(tail, '') === (Get.url(VIEW, { - siteID: siteID, - boardID: boardID - }) || '').replace(tail, '')))) { - continue; - } - $.extend(a.dataset, { - siteID: siteID, - boardID: boardID - }); - } - board = { - siteID: siteID, - boardID: boardID - }; - url = Conf['Header catalog links'] ? CatalogLinks.catalog(board) : Get.url('index', board); - if (url) { - a.href = url; - if (a.dataset.indexOptions && url.split('#')[0] === Get.url('index', board)) { - a.href += (a.hash ? '/' : '#') + a.dataset.indexOptions; - } - } - } - }, - externalParse: function() { - var board, boards, excludes, i, len, line, ref, ref1, ref2, url; - CatalogLinks.externalList = $.dict(); - ref = Conf['externalCatalogURLs'].split('\n'); - for (i = 0, len = ref.length; i < len; i++) { - line = ref[i]; - if (line[0] === '#') { - continue; - } - url = line.split(';')[0]; - boards = Filter.parseBoards(((ref1 = line.match(/;boards:([^;]+)/)) != null ? ref1[1] : void 0) || '*'); - excludes = Filter.parseBoards((ref2 = line.match(/;exclude:([^;]+)/)) != null ? ref2[1] : void 0) || $.dict(); - for (board in boards) { - if (!(excludes[board] || excludes[board.split('/')[0] + '/*'])) { - CatalogLinks.externalList[board] = url; - } - } - } - }, - external: function(arg) { - var boardID, external, siteID; - siteID = arg.siteID, boardID = arg.boardID; - if (!CatalogLinks.externalList) { - CatalogLinks.externalParse(); - } - external = CatalogLinks.externalList[siteID + "/" + boardID] || CatalogLinks.externalList[siteID + "/*"]; - if (external) { - return external.replace(/%board/g, boardID); - } else { - return void 0; - } - }, - jsonIndex: function(board, hash) { - if (g.SITE.ID === board.siteID && g.BOARD.ID === board.boardID && g.VIEW === 'index') { - return hash; - } else { - return Get.url('index', board) + hash; - } - }, - catalog: function(board) { - var external, nativeCatalog; - if (board == null) { - board = g.BOARD; - } - if (Conf['External Catalog'] && (external = CatalogLinks.external(board))) { - return external; - } else if (Index.enabledOn(board) && Conf['Use 4chan X Catalog']) { - return CatalogLinks.jsonIndex(board, '#catalog'); - } else if ((nativeCatalog = Get.url('catalog', board))) { - return nativeCatalog; - } else { - return CatalogLinks.external(board); - } - }, - index: function(board) { - if (board == null) { - board = g.BOARD; - } - if (Index.enabledOn(board)) { - return CatalogLinks.jsonIndex(board, '#index'); - } else { - return Get.url('index', board); - } - } - }; - - return CatalogLinks; - -}).call(this); - -CustomCSS = (function() { - var CustomCSS; - - CustomCSS = { - init: function() { - if (!Conf['Custom CSS']) { - return; - } - return this.addStyle(); - }, - addStyle: function() { - return this.style = $.addStyle(CSS.sub(Conf['usercss']), 'custom-css', '#fourchanx-css'); - }, - rmStyle: function() { - if (this.style) { - $.rm(this.style); - return delete this.style; - } - }, - update: function() { - if (!this.style) { - return this.addStyle(); - } - return this.style.textContent = CSS.sub(Conf['usercss']); - } - }; - - return CustomCSS; - -}).call(this); - -ExpandComment = (function() { - var ExpandComment; - - ExpandComment = { - init: function() { - if (g.VIEW !== 'index' || !Conf['Comment Expansion'] || Conf['JSON Index']) { - return; - } - return Callbacks.Post.push({ - name: 'Comment Expansion', - cb: this.node - }); - }, - node: function() { - var a; - if (a = $('.abbr > a:not([onclick])', this.nodes.comment)) { - return $.on(a, 'click', ExpandComment.cb); - } - }, - callbacks: [], - cb: function(e) { - e.preventDefault(); - return ExpandComment.expand(Get.postFromNode(this)); - }, - expand: function(post) { - var a; - if (post.nodes.longComment && !post.nodes.longComment.parentNode) { - $.replace(post.nodes.shortComment, post.nodes.longComment); - post.nodes.comment = post.nodes.longComment; - return; - } - if (!(a = $('.abbr > a', post.nodes.comment))) { - return; - } - a.textContent = "Post No." + post + " Loading..."; - return $.cache(g.SITE.urls.threadJSON({ - boardID: post.boardID, - threadID: post.threadID - }), function() { - return ExpandComment.parse(this, a, post); - }); - }, - contract: function(post) { - var a; - if (!post.nodes.shortComment) { - return; - } - a = $('.abbr > a', post.nodes.shortComment); - a.textContent = 'here'; - $.replace(post.nodes.longComment, post.nodes.shortComment); - return post.nodes.comment = post.nodes.shortComment; - }, - parse: function(req, a, post) { - var callback, clone, comment, href, i, j, k, len, len1, len2, postObj, posts, quote, ref, ref1, spoilerRange, status; - status = req.status; - if (status !== 200 && status !== 304) { - a.textContent = status ? "Error " + req.statusText + " (" + status + ")" : 'Connection Error'; - return; - } - posts = req.response.posts; - if (spoilerRange = posts[0].custom_spoiler) { - g.SITE.Build.spoilerRange[g.BOARD] = spoilerRange; - } - for (i = 0, len = posts.length; i < len; i++) { - postObj = posts[i]; - if (postObj.no === post.ID) { - break; - } - } - if (postObj.no !== post.ID) { - a.textContent = "Post No." + post + " not found."; - return; - } - comment = post.nodes.comment; - clone = comment.cloneNode(false); - clone.innerHTML = postObj.com; - ref = $$('.quotelink', clone); - for (j = 0, len1 = ref.length; j < len1; j++) { - quote = ref[j]; - href = quote.getAttribute('href'); - if (href[0] === '/') { - continue; - } - if (href[0] === '#') { - quote.href = "" + (a.pathname.split(/\/+/).splice(0, 4).join('/')) + href; - } else { - quote.href = (a.pathname.split(/\/+/).splice(0, 3).join('/')) + "/" + href; - } - } - post.nodes.shortComment = comment; - $.replace(comment, clone); - post.nodes.comment = post.nodes.longComment = clone; - post.parseComment(); - post.parseQuotes(); - ref1 = ExpandComment.callbacks; - for (k = 0, len2 = ref1.length; k < len2; k++) { - callback = ref1[k]; - callback.call(post); - } - } - }; - - return ExpandComment; - -}).call(this); - -ExpandThread = (function() { - var ExpandThread, - slice = [].slice; - - ExpandThread = { - statuses: $.dict(), - init: function() { - if (!(g.VIEW === 'index' && Conf['Thread Expansion'])) { - return; - } - if (Conf['JSON Index']) { - return $.on(d, 'IndexRefreshInternal', this.onIndexRefresh); - } else { - return Callbacks.Thread.push({ - name: 'Expand Thread', - cb: function() { - return ExpandThread.setButton(this); - } - }); - } - }, - setButton: function(thread) { - var a, ref; - if (!(thread.nodes.root && (a = $('.summary', thread.nodes.root)))) { - return; - } - a.textContent = (ref = g.SITE.Build).summaryText.apply(ref, ['+'].concat(slice.call(a.textContent.match(/\d+/g)))); - a.style.cursor = 'pointer'; - return $.on(a, 'click', ExpandThread.cbToggle); - }, - disconnect: function(refresh) { - var oldReq, ref, status, threadID; - if (g.VIEW === 'thread' || !Conf['Thread Expansion']) { - return; - } - ref = ExpandThread.statuses; - for (threadID in ref) { - status = ref[threadID]; - if ((oldReq = status.req)) { - delete status.req; - oldReq.abort(); - } - delete ExpandThread.statuses[threadID]; - } - if (!refresh) { - return $.off(d, 'IndexRefreshInternal', this.onIndexRefresh); - } - }, - onIndexRefresh: function() { - ExpandThread.disconnect(true); - return g.BOARD.threads.forEach(function(thread) { - return ExpandThread.setButton(thread); - }); - }, - cbToggle: function(e) { - if ($.modifiedClick(e)) { - return; - } - e.preventDefault(); - return ExpandThread.toggle(Get.threadFromNode(this)); - }, - cbToggleBottom: function(e) { - var bottom, thread; - if ($.modifiedClick(e)) { - return; - } - e.preventDefault(); - thread = Get.threadFromNode(this); - $.rm(this); - bottom = thread.nodes.root.getBoundingClientRect().bottom; - ExpandThread.toggle(thread); - return window.scrollBy(0, thread.nodes.root.getBoundingClientRect().bottom - bottom); - }, - toggle: function(thread) { - var a; - if (!(thread.nodes.root && (a = $('.summary', thread.nodes.root)))) { - return; - } - if (thread.ID in ExpandThread.statuses) { - return ExpandThread.contract(thread, a, thread.nodes.root); - } else { - return ExpandThread.expand(thread, a); - } - }, - expand: function(thread, a) { - var ref, status; - ExpandThread.statuses[thread] = status = {}; - a.textContent = (ref = g.SITE.Build).summaryText.apply(ref, ['...'].concat(slice.call(a.textContent.match(/\d+/g)))); - status.req = $.cache(g.SITE.urls.threadJSON({ - boardID: thread.board.ID, - threadID: thread.ID - }), function() { - if (this !== status.req) { - return; - } - delete status.req; - return ExpandThread.parse(this, thread, a); - }); - return status.numReplies = $$(g.SITE.selectors.replyOriginal, thread.nodes.root).length; - }, - contract: function(thread, a, threadRoot) { - var filesCount, i, inlined, len, oldReq, postsCount, ref, replies, reply, status; - status = ExpandThread.statuses[thread]; - delete ExpandThread.statuses[thread]; - if ((oldReq = status.req)) { - delete status.req; - oldReq.abort(); - if (a) { - a.textContent = (ref = g.SITE.Build).summaryText.apply(ref, ['+'].concat(slice.call(a.textContent.match(/\d+/g)))); - } - return; - } - replies = $$('.thread > .replyContainer', threadRoot); - if (status.numReplies) { - replies = replies.slice(0, -status.numReplies); - } - postsCount = 0; - filesCount = 0; - for (i = 0, len = replies.length; i < len; i++) { - reply = replies[i]; - if (Conf['Quote Inlining']) { - while (inlined = $('.inlined', reply)) { - inlined.click(); - } - } - postsCount++; - if ('file' in Get.postFromRoot(reply)) { - filesCount++; - } - $.rm(reply); - } - if (Index.enabled) { - $.event('PostsRemoved', null, a.parentNode); - } - a.textContent = g.SITE.Build.summaryText('+', postsCount, filesCount); - return $.rm($('.summary-bottom', threadRoot)); - }, - parse: function(req, thread, a) { - var a2, filesCount, i, len, post, postData, posts, postsCount, postsRoot, ref, ref1, root; - if ((ref = req.status) !== 200 && ref !== 304) { - a.textContent = req.status ? "Error " + req.statusText + " (" + req.status + ")" : 'Connection Error'; - return; - } - g.SITE.Build.spoilerRange[thread.board] = req.response.posts[0].custom_spoiler; - posts = []; - postsRoot = []; - filesCount = 0; - ref1 = req.response.posts; - for (i = 0, len = ref1.length; i < len; i++) { - postData = ref1[i]; - if (postData.no === thread.ID) { - continue; - } - if ((post = thread.posts.get(postData.no)) && !post.isFetchedQuote) { - if ('file' in post) { - filesCount++; - } - root = post.nodes.root; - postsRoot.push(root); - continue; - } - root = g.SITE.Build.postFromObject(postData, thread.board.ID); - post = new Post(root, thread, thread.board); - if ('file' in post) { - filesCount++; - } - posts.push(post); - postsRoot.push(root); - } - Main.callbackNodes('Post', posts); - $.after(a, postsRoot); - $.event('PostsInserted', null, a.parentNode); - postsCount = postsRoot.length; - a.textContent = g.SITE.Build.summaryText('-', postsCount, filesCount); - if (root) { - a2 = a.cloneNode(true); - a2.classList.add('summary-bottom'); - $.on(a2, 'click', ExpandThread.cbToggleBottom); - return $.after(root, a2); - } - } - }; - - return ExpandThread; - -}).call(this); - -FileInfo = (function() { - var FileInfo; - - FileInfo = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread' && ref !== 'archive') || !Conf['File Info Formatting']) { - return; - } - return Callbacks.Post.push({ - name: 'File Info Formatting', - cb: this.node - }); - }, - node: function() { - var a, i, info, j, len, len1, oldInfo, ref, ref1; - if (!this.file) { - return; - } - if (this.isClone) { - ref = $$('.file-info .download-button', this.file.text); - for (i = 0, len = ref.length; i < len; i++) { - a = ref[i]; - $.on(a, 'click', ImageCommon.download); - } - ref1 = $$('.file-info .quick-filter-md5', this.file.text); - for (j = 0, len1 = ref1.length; j < len1; j++) { - a = ref1[j]; - $.on(a, 'click', Filter.quickFilterMD5); - } - return; - } - oldInfo = $.el('span', { - className: 'fileText-original' - }); - $.prepend(this.file.link.parentNode, oldInfo); - $.add(oldInfo, [this.file.link.previousSibling, this.file.link, this.file.link.nextSibling]); - info = $.el('span', { - className: 'file-info' - }); - FileInfo.format(Conf['fileInfo'], this, info); - return $.prepend(this.file.text, info); - }, - format: function(formatString, post, outputNode) { - var a, i, j, len, len1, output, ref, ref1; - output = []; - formatString.replace(/%(.)|[^%]+/g, function(s, c) { - output.push($.hasOwn(FileInfo.formatters, c) ? FileInfo.formatters[c].call(post) : {innerHTML: E(s)}); - return ''; - }); - $.extend(outputNode, {innerHTML: E.cat(output)}); - ref = $$('.download-button', outputNode); - for (i = 0, len = ref.length; i < len; i++) { - a = ref[i]; - $.on(a, 'click', ImageCommon.download); - } - ref1 = $$('.quick-filter-md5', outputNode); - for (j = 0, len1 = ref1.length; j < len1; j++) { - a = ref1[j]; - $.on(a, 'click', Filter.quickFilterMD5); - } - }, - formatters: { - t: function() { - return {innerHTML: E(this.file.url.match(/[^/]*$/)[0])}; - }, - T: function() { - return {innerHTML: "" + (FileInfo.formatters.t.call(this)).innerHTML + ""}; - }, - l: function() { - return {innerHTML: "" + (FileInfo.formatters.n.call(this)).innerHTML + ""}; - }, - L: function() { - return {innerHTML: "" + (FileInfo.formatters.N.call(this)).innerHTML + ""}; - }, - n: function() { - var fullname, shortname; - fullname = this.file.name; - shortname = SW.yotsuba.Build.shortFilename(this.file.name, this.isReply); - if (fullname === shortname) { - return {innerHTML: E(fullname)}; - } else { - return {innerHTML: "" + E(shortname) + "" + E(fullname) + ""}; - } - }, - N: function() { - return {innerHTML: E(this.file.name)}; - }, - d: function() { - return {innerHTML: ""}; - }, - f: function() { - return {innerHTML: ""}; - }, - p: function() { - return {innerHTML: ((this.file.isSpoiler) ? "Spoiler, " : "")}; - }, - s: function() { - return {innerHTML: E(this.file.size)}; - }, - B: function() { - return {innerHTML: E(Math.round(this.file.sizeInBytes)) + " Bytes"}; - }, - K: function() { - return {innerHTML: E(Math.round(this.file.sizeInBytes/1024)) + " KB"}; - }, - M: function() { - return {innerHTML: E(Math.round(this.file.sizeInBytes/1048576*100)/100) + " MB"}; - }, - r: function() { - return {innerHTML: E(this.file.dimensions || "PDF")}; - }, - g: function() { - return {innerHTML: ((this.file.tag) ? ", " + E(this.file.tag) : "")}; - }, - '%': function() { - return {innerHTML: "%"}; - } - } - }; - - return FileInfo; - -}).call(this); - -Flash = (function() { - var Flash; - - Flash = { - init: function() { - if (g.BOARD.ID === 'f' && Conf['Enable Native Flash Embedding']) { - return $.ready(Flash.initReady); - } - }, - initReady: function() { - if ($.hasStorage) { - return $.global(function() { - if (JSON.parse(localStorage['4chan-settings'] || '{}').disableAll) { - return window.SWFEmbed.init(); - } - }); - } else { - if (g.VIEW === 'thread') { - $.global(function() { - return window.Main.tid = location.pathname.split(/\/+/)[3]; - }); - } - return $.global(function() { - return window.SWFEmbed.init(); - }); - } - } - }; - - return Flash; - -}).call(this); - -Fourchan = (function() { - var Fourchan; - - Fourchan = { - init: function() { - var ref; - if (!(g.SITE.software === 'yotsuba' && ((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive'))) { - return; - } - BoardConfig.ready(this.initBoard); - return Main.ready(this.initReady); - }, - initBoard: function() { - if (g.BOARD.config.code_tags) { - $.on(window, 'prettyprint:cb', function(e) { - var post, pre; - if (!(post = g.posts.get(e.detail.ID))) { - return; - } - if (!(pre = $$('.prettyprint', post.nodes.comment)[+e.detail.i])) { - return; - } - if (!$.hasClass(pre, 'prettyprinted')) { - pre.innerHTML = e.detail.html; - return $.addClass(pre, 'prettyprinted'); - } - }); - $.global(function() { - return window.addEventListener('prettyprint', function(e) { - return window.dispatchEvent(new CustomEvent('prettyprint:cb', { - detail: { - ID: e.detail.ID, - i: e.detail.i, - html: window.prettyPrintOne(e.detail.html) - } - })); - }, false); - }); - Callbacks.Post.push({ - name: 'Parse [code] tags', - cb: Fourchan.code - }); - g.posts.forEach(function(post) { - if (post.callbacksExecuted) { - return Callbacks.Post.execute(post, ['Parse [code] tags'], true); - } - }); - ExpandComment.callbacks.push(Fourchan.code); - } - if (g.BOARD.config.math_tags) { - $.global(function() { - return window.addEventListener('mathjax', function(e) { - if (window.MathJax) { - return window.MathJax.Hub.Queue(['Typeset', window.MathJax.Hub, e.target]); - } else { - if (!document.querySelector('script[src^="//cdn.mathjax.org/"]')) { - window.loadMathJax(); - window.loadMathJax = function() {}; - } - if (!e.target.classList.contains('postMessage')) { - return document.querySelector('script[src^="//cdn.mathjax.org/"]').addEventListener('load', function() { - return window.MathJax.Hub.Queue(['Typeset', window.MathJax.Hub, e.target]); - }, false); - } - } - }, false); - }); - Callbacks.Post.push({ - name: 'Parse [math] tags', - cb: Fourchan.math - }); - g.posts.forEach(function(post) { - if (post.callbacksExecuted) { - return Callbacks.Post.execute(post, ['Parse [math] tags'], true); - } - }); - return ExpandComment.callbacks.push(Fourchan.math); - } - }, - initReady: function() { - return $.global(function() { - var j, len, node, ref; - window.clickable_ids = false; - ref = document.querySelectorAll('.posteruid, .capcode'); - for (j = 0, len = ref.length; j < len; j++) { - node = ref[j]; - node.removeEventListener('click', window.idClick, false); - } - }); - }, - code: function() { - if (this.isClone) { - return; - } - return $.ready((function(_this) { - return function() { - var i, j, len, pre, ref; - ref = $$('.prettyprint', _this.nodes.comment); - for (i = j = 0, len = ref.length; j < len; i = ++j) { - pre = ref[i]; - if (!$.hasClass(pre, 'prettyprinted')) { - $.event('prettyprint', { - ID: _this.fullID, - i: i, - html: pre.innerHTML - }, window); - } - } - }; - })(this)); - }, - math: function() { - var cb, j, len, wbr, wbrs; - if (!/\[(math|eqn)\]/.test(this.nodes.comment.textContent)) { - return; - } - if ((wbrs = $$('wbr', this.nodes.comment)).length) { - for (j = 0, len = wbrs.length; j < len; j++) { - wbr = wbrs[j]; - $.rm(wbr); - } - this.nodes.comment.normalize(); - } - cb = (function(_this) { - return function() { - if (!doc.contains(_this.nodes.comment)) { - return; - } - $.off(d, 'PostsInserted', cb); - return $.event('mathjax', null, _this.nodes.comment); - }; - })(this); - $.on(d, 'PostsInserted', cb); - return cb(); - } - }; - - return Fourchan; - -}).call(this); - -IDColor = (function() { - var IDColor; - - IDColor = { - init: function() { - var ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Color User IDs'])) { - return; - } - this.ids = $.dict(); - this.ids['Heaven'] = [0, 0, 0, '#fff']; - return Callbacks.Post.push({ - name: 'Color User IDs', - cb: this.node - }); - }, - node: function() { - var rgb, span, style, uid; - if (this.isClone || !((uid = this.info.uniqueID) && (span = this.nodes.uniqueID))) { - return; - } - rgb = IDColor.ids[uid] || IDColor.compute(uid); - style = span.style; - style.color = rgb[3]; - style.backgroundColor = "rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + ")"; - return $.addClass(span, 'painted'); - }, - compute: function(uid) { - var hash, rgb; - hash = g.SITE.uidColor ? g.SITE.uidColor(uid) : parseInt(uid, 16); - rgb = [(hash >> 16) & 0xFF, (hash >> 8) & 0xFF, hash & 0xFF]; - rgb.push($.luma(rgb) > 125 ? '#000' : '#fff'); - return this.ids[uid] = rgb; - } - }; - - return IDColor; - -}).call(this); - -IDHighlight = (function() { - var IDHighlight; - - IDHighlight = { - init: function() { - var ref; - if ((ref = g.VIEW) !== 'index' && ref !== 'thread') { - return; - } - return Callbacks.Post.push({ - name: 'Highlight by User ID', - cb: this.node - }); - }, - uniqueID: null, - node: function() { - if (this.nodes.uniqueIDRoot) { - $.on(this.nodes.uniqueIDRoot, 'click', IDHighlight.click(this)); - } - if (this.nodes.capcode) { - $.on(this.nodes.capcode, 'click', IDHighlight.click(this)); - } - if (!this.isClone) { - return IDHighlight.set(this); - } - }, - set: function(post) { - var match; - match = (post.info.uniqueID || post.info.capcode) === IDHighlight.uniqueID; - return $[match ? 'addClass' : 'rmClass'](post.nodes.post, 'highlight'); - }, - click: function(post) { - return function() { - var uniqueID; - uniqueID = post.info.uniqueID || post.info.capcode; - IDHighlight.uniqueID = IDHighlight.uniqueID === uniqueID ? null : uniqueID; - return g.posts.forEach(IDHighlight.set); - }; - } - }; - - return IDHighlight; - -}).call(this); - -IDPostCount = (function() { - var IDPostCount; - - IDPostCount = { - init: function() { - if (!(g.VIEW === 'thread' && Conf['Count Posts by ID'])) { - return; - } - Callbacks.Thread.push({ - name: 'Count Posts by ID', - cb: function() { - return IDPostCount.thread = this; - } - }); - return Callbacks.Post.push({ - name: 'Count Posts by ID', - cb: this.node - }); - }, - node: function() { - if (this.nodes.uniqueID && this.thread === IDPostCount.thread) { - return $.on(this.nodes.uniqueID, 'mouseover', IDPostCount.count); - } - }, - count: function() { - var n, uniqueID; - uniqueID = Get.postFromNode(this).info.uniqueID; - n = 0; - IDPostCount.thread.posts.forEach(function(post) { - if (post.info.uniqueID === uniqueID) { - return n++; - } - }); - return this.title = n + " post" + (n === 1 ? '' : 's') + " by this ID"; - } - }; - - return IDPostCount; - -}).call(this); - -Keybinds = (function() { - var Keybinds; - - Keybinds = { - init: function() { - var hotkey, init; - if (!Conf['Keybinds']) { - return; - } - for (hotkey in Config.hotkeys) { - $.sync(hotkey, Keybinds.sync); - } - init = function() { - var i, len, node, ref; - $.off(d, '4chanXInitFinished', init); - $.on(d, 'keydown', Keybinds.keydown); - ref = $$('[accesskey]'); - for (i = 0, len = ref.length; i < len; i++) { - node = ref[i]; - node.removeAttribute('accesskey'); - } - }; - return $.on(d, '4chanXInitFinished', init); - }, - sync: function(key, hotkey) { - return Conf[hotkey] = key; - }, - keydown: function(e) { - var base, base1, catalog, i, key, len, notification, notifications, post, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, searchInput, target, thread, threadRoot; - if (!(key = Keybinds.keyCode(e))) { - return; - } - target = e.target; - if ((ref = target.nodeName) === 'INPUT' || ref === 'TEXTAREA') { - if (!(/(Esc|Alt|Ctrl|Meta|Shift\+\w{2,})/.test(key) && !/^Alt\+(\d|Up|Down|Left|Right)$/.test(key))) { - return; - } - } - if ((ref1 = g.VIEW) === 'index' || ref1 === 'thread') { - threadRoot = Nav.getThread(); - thread = Get.threadFromRoot(threadRoot); - } - switch (key) { - case Conf['Toggle board list']: - if (!Conf['Custom Board Navigation']) { - return; - } - Header.toggleBoardList(); - break; - case Conf['Toggle header']: - Header.toggleBarVisibility(); - break; - case Conf['Open empty QR']: - if (!QR.postingIsEnabled) { - return; - } - Keybinds.qr(); - break; - case Conf['Open QR']: - if (!(QR.postingIsEnabled && threadRoot)) { - return; - } - Keybinds.qr(threadRoot); - break; - case Conf['Open settings']: - Settings.open(); - break; - case Conf['Close']: - if (Settings.dialog) { - Settings.close(); - } else if ((notifications = $$('.notification')).length) { - for (i = 0, len = notifications.length; i < len; i++) { - notification = notifications[i]; - $('.close', notification).click(); - } - } else if (QR.nodes && !(QR.nodes.el.hidden || window.getComputedStyle(QR.nodes.form).display === 'none')) { - if (Conf['Persistent QR']) { - QR.hide(); - } else { - QR.close(); - } - } else if (Embedding.lastEmbed) { - Embedding.closeFloat(); - } else { - return; - } - break; - case Conf['Spoiler tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('spoiler', target); - break; - case Conf['Code tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('code', target); - break; - case Conf['Eqn tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('eqn', target); - break; - case Conf['Math tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('math', target); - break; - case Conf['SJIS tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('sjis', target); - break; - case Conf['Toggle sage']: - if (!(QR.nodes && !QR.nodes.el.hidden)) { - return; - } - Keybinds.sage(); - break; - case Conf['Toggle Cooldown']: - if (!(QR.nodes && !QR.nodes.el.hidden && $.hasClass(QR.nodes.fileSubmit, 'custom-cooldown'))) { - return; - } - QR.toggleCustomCooldown(); - break; - case Conf['Post from URL']: - if (!QR.postingIsEnabled) { - return; - } - QR.handleUrl(''); - break; - case Conf['Add new post']: - if (!QR.postingIsEnabled) { - return; - } - QR.addPost(); - break; - case Conf['Submit QR']: - if (!(QR.nodes && !QR.nodes.el.hidden)) { - return; - } - if (!QR.status()) { - QR.submit(); - } - break; - case Conf['Update']: - switch (g.VIEW) { - case 'thread': - if (!ThreadUpdater.enabled) { - return; - } - ThreadUpdater.update(); - break; - case 'index': - if (!Index.enabled) { - return; - } - Index.update(); - break; - default: - return; - } - break; - case Conf['Watch']: - if (!(ThreadWatcher.enabled && thread)) { - return; - } - ThreadWatcher.toggle(thread); - break; - case Conf['Update thread watcher']: - if (!ThreadWatcher.enabled) { - return; - } - ThreadWatcher.buttonFetchAll(); - break; - case Conf['Toggle thread watcher']: - if (!ThreadWatcher.enabled) { - return; - } - ThreadWatcher.toggleWatcher(); - break; - case Conf['Toggle threading']: - if (!QuoteThreading.ready) { - return; - } - QuoteThreading.toggleThreading(); - break; - case Conf['Mark thread read']: - if (!(g.VIEW === 'index' && thread && UnreadIndex.enabled)) { - return; - } - UnreadIndex.markRead.call(threadRoot); - break; - case Conf['Expand image']: - if (!(ImageExpand.enabled && threadRoot)) { - return; - } - post = Get.postFromNode(Keybinds.post(threadRoot)); - if (post.file) { - ImageExpand.toggle(post); - } - break; - case Conf['Expand images']: - if (!ImageExpand.enabled) { - return; - } - ImageExpand.cb.toggleAll(); - break; - case Conf['Open Gallery']: - if (!Gallery.enabled) { - return; - } - Gallery.cb.toggle(); - break; - case Conf['fappeTyme']: - if (!((ref2 = FappeTyme.nodes) != null ? ref2.fappe : void 0)) { - return; - } - FappeTyme.toggle('fappe'); - break; - case Conf['werkTyme']: - if (!((ref3 = FappeTyme.nodes) != null ? ref3.werk : void 0)) { - return; - } - FappeTyme.toggle('werk'); - break; - case Conf['Front page']: - if (Index.enabled) { - Index.userPageNav(1); - } else { - location.href = "/" + g.BOARD + "/"; - } - break; - case Conf['Open front page']: - $.open(location.origin + "/" + g.BOARD + "/"); - break; - case Conf['Next page']: - if (!(g.VIEW === 'index' && !(typeof (base = g.SITE).isOnePage === "function" ? base.isOnePage(g.BOARD) : void 0))) { - return; - } - if (Index.enabled) { - if ((ref4 = Conf['Index Mode']) !== 'paged' && ref4 !== 'infinite') { - return; - } - $('.next button', Index.pagelist).click(); - } else { - if ((ref5 = $(g.SITE.selectors.nav.next)) != null) { - ref5.click(); - } - } - break; - case Conf['Previous page']: - if (!(g.VIEW === 'index' && !(typeof (base1 = g.SITE).isOnePage === "function" ? base1.isOnePage(g.BOARD) : void 0))) { - return; - } - if (Index.enabled) { - if ((ref6 = Conf['Index Mode']) !== 'paged' && ref6 !== 'infinite') { - return; - } - $('.prev button', Index.pagelist).click(); - } else { - if ((ref7 = $(g.SITE.selectors.nav.prev)) != null) { - ref7.click(); - } - } - break; - case Conf['Search form']: - if (g.VIEW !== 'index') { - return; - } - searchInput = Index.enabled ? Index.searchInput : g.SITE.selectors.searchBox ? $(g.SITE.selectors.searchBox) : void 0; - if (!searchInput) { - return; - } - Header.scrollToIfNeeded(searchInput); - searchInput.focus(); - break; - case Conf['Paged mode']: - if (!Index.enabledOn(g.BOARD)) { - return; - } - location.href = g.VIEW === 'index' ? '#paged' : "/" + g.BOARD + "/#paged"; - break; - case Conf['Infinite scrolling mode']: - if (!Index.enabledOn(g.BOARD)) { - return; - } - location.href = g.VIEW === 'index' ? '#infinite' : "/" + g.BOARD + "/#infinite"; - break; - case Conf['All pages mode']: - if (!Index.enabledOn(g.BOARD)) { - return; - } - location.href = g.VIEW === 'index' ? '#all-pages' : "/" + g.BOARD + "/#all-pages"; - break; - case Conf['Open catalog']: - if (!(catalog = CatalogLinks.catalog())) { - return; - } - location.href = catalog; - break; - case Conf['Cycle sort type']: - if (!Index.enabled) { - return; - } - Index.cycleSortType(); - break; - case Conf['Next thread']: - if (!(g.VIEW === 'index' && threadRoot)) { - return; - } - Nav.scroll(+1); - break; - case Conf['Previous thread']: - if (!(g.VIEW === 'index' && threadRoot)) { - return; - } - Nav.scroll(-1); - break; - case Conf['Expand thread']: - if (!(g.VIEW === 'index' && threadRoot)) { - return; - } - ExpandThread.toggle(thread); - Header.scrollTo(threadRoot); - break; - case Conf['Open thread']: - if (!(g.VIEW === 'index' && threadRoot)) { - return; - } - Keybinds.open(thread); - break; - case Conf['Open thread tab']: - if (!(g.VIEW === 'index' && threadRoot)) { - return; - } - Keybinds.open(thread, true); - break; - case Conf['Next reply']: - if (!threadRoot) { - return; - } - Keybinds.hl(+1, threadRoot); - break; - case Conf['Previous reply']: - if (!threadRoot) { - return; - } - Keybinds.hl(-1, threadRoot); - break; - case Conf['Deselect reply']: - if (!threadRoot) { - return; - } - Keybinds.hl(0, threadRoot); - break; - case Conf['Hide']: - if (!(thread && ThreadHiding.db)) { - return; - } - Header.scrollTo(threadRoot); - ThreadHiding.toggle(thread); - break; - case Conf['Quick Filter MD5']: - if (!threadRoot) { - return; - } - post = Keybinds.post(threadRoot); - Keybinds.hl(+1, threadRoot); - Filter.quickFilterMD5.call(post, e); - break; - case Conf['Previous Post Quoting You']: - if (!(threadRoot && QuoteYou.db)) { - return; - } - QuoteYou.cb.seek('preceding'); - break; - case Conf['Next Post Quoting You']: - if (!(threadRoot && QuoteYou.db)) { - return; - } - QuoteYou.cb.seek('following'); - break; - default: - return; - } - e.preventDefault(); - return e.stopPropagation(); - }, - keyCode: function(e) { - var kc, key; - key = (function() { - switch (kc = e.keyCode) { - case 8: - return ''; - case 13: - return 'Enter'; - case 27: - return 'Esc'; - case 32: - return 'Space'; - case 37: - return 'Left'; - case 38: - return 'Up'; - case 39: - return 'Right'; - case 40: - return 'Down'; - case 188: - return 'Comma'; - case 190: - return 'Period'; - case 191: - return 'Slash'; - case 59: - case 186: - return 'Semicolon'; - default: - if ((48 <= kc && kc <= 57) || (65 <= kc && kc <= 90)) { - return String.fromCharCode(kc).toLowerCase(); - } else if ((96 <= kc && kc <= 105)) { - return String.fromCharCode(kc - 48).toLowerCase(); - } else { - return null; - } - } - })(); - if (key) { - if (e.altKey) { - key = 'Alt+' + key; - } - if (e.ctrlKey) { - key = 'Ctrl+' + key; - } - if (e.metaKey) { - key = 'Meta+' + key; - } - if (e.shiftKey) { - key = 'Shift+' + key; - } - } - return key; - }, - post: function(thread) { - var s; - s = g.SITE.selectors; - return $("" + s.postContainer + s.highlightable.reply + "." + g.SITE.classes.highlight, thread) || $("" + (g.SITE.isOPContainerThread ? s.thread : s.postContainer) + s.highlightable.op, thread); - }, - qr: function(thread) { - QR.open(); - if (thread != null) { - QR.quote.call(Keybinds.post(thread)); - } - return QR.nodes.com.focus(); - }, - tags: function(tag, ta) { - var range, selEnd, selStart, value; - BoardConfig.ready(function() { - var config, supported; - config = g.BOARD.config; - supported = (function() { - switch (tag) { - case 'spoiler': - return !!config.spoilers; - case 'code': - return !!config.code_tags; - case 'math': - case 'eqn': - return !!config.math_tags; - case 'sjis': - return !!config.sjis_tags; - } - })(); - if (!supported) { - return new Notice('warning', "[" + tag + "] tags are not supported on /" + g.BOARD + "/.", 20); - } - }); - value = ta.value; - selStart = ta.selectionStart; - selEnd = ta.selectionEnd; - ta.value = value.slice(0, selStart) + ("[" + tag + "]") + value.slice(selStart, selEnd) + ("[/" + tag + "]") + value.slice(selEnd); - range = ("[" + tag + "]").length + selEnd; - ta.setSelectionRange(range, range); - return $.event('input', null, ta); - }, - sage: function() { - var isSage; - isSage = /sage/i.test(QR.nodes.email.value); - return QR.nodes.email.value = isSage ? "" : "sage"; - }, - open: function(thread, tab) { - var url; - if (g.VIEW !== 'index') { - return; - } - url = Get.url('thread', thread); - if (tab) { - return $.open(url); - } else { - return location.href = url; - } - }, - hl: function(delta, thread) { - var axis, height, highlight, i, len, next, postEl, replies, reply, replySelector, root; - replySelector = "" + g.SITE.selectors.postContainer + g.SITE.selectors.highlightable.reply; - highlight = g.SITE.classes.highlight; - postEl = $(replySelector + "." + highlight, thread); - if (!delta) { - if (postEl) { - $.rmClass(postEl, highlight); - } - return; - } - if (postEl) { - height = postEl.getBoundingClientRect().height; - if (Header.getTopOf(postEl) >= -height && Header.getBottomOf(postEl) >= -height) { - root = Get.postFromNode(postEl).nodes.root; - axis = delta === +1 ? 'following' : 'preceding'; - if (!(next = $.x(axis + "-sibling::" + g.SITE.xpath.replyContainer + "[not(@hidden) and not(child::div[@class='stub'])][1]", root))) { - return; - } - if (!next.matches(replySelector)) { - next = $(replySelector, next); - } - Header.scrollToIfNeeded(next, delta === +1); - $.addClass(next, highlight); - $.rmClass(postEl, highlight); - return; - } - $.rmClass(postEl, highlight); - } - replies = $$(replySelector, thread); - if (delta === -1) { - replies.reverse(); - } - for (i = 0, len = replies.length; i < len; i++) { - reply = replies[i]; - if (delta === +1 && Header.getTopOf(reply) > 0 || delta === -1 && Header.getBottomOf(reply) > 0) { - $.addClass(reply, highlight); - return; - } - } - } - }; - - return Keybinds; - -}).call(this); - -ModContact = (function() { - var ModContact; - - ModContact = { - init: function() { - var ref; - if (!(g.SITE.software === 'yotsuba' && ((ref = g.VIEW) === 'index' || ref === 'thread'))) { - return; - } - return Callbacks.Post.push({ - name: 'Mod Contact Links', - cb: this.node - }); - }, - node: function() { - var links, moveNote, moved; - if (this.isClone || !$.hasOwn(ModContact.specific, this.info.capcode)) { - return; - } - links = $.el('span', { - className: 'contact-links brackets-wrap' - }); - $.extend(links, ModContact.template(this.info.capcode)); - $.after(this.nodes.capcode, links); - if ((moved = this.info.comment.match(/This thread was moved to >>>\/(\w+)\//)) && $.hasOwn(ModContact.moveNote, moved[1])) { - moveNote = $.el('div', { - className: 'move-note' - }); - $.extend(moveNote, ModContact.moveNote[moved[1]]); - return $.add(this.nodes.post, moveNote); - } - }, - template: function(capcode) { - return {innerHTML: "feedback" + (ModContact.specific[capcode]()).innerHTML}; - }, - specific: { - Mod: function() { - return {innerHTML: " IRC"}; - }, - Manager: function() { - return ModContact.specific.Mod(); - }, - Developer: function() { - return {innerHTML: " github"}; - }, - Admin: function() { - return {innerHTML: " twitter"}; - } - }, - moveNote: { - qa: {innerHTML: "Moving a thread to /qa/ does not imply mods will read it. If you wish to contact mods, use feedback (https://www.4chan.org/feedback) or IRC (https://www.4chan-x.net/4chan-irc.html)."} - } - }; - - return ModContact; - -}).call(this); - -Nav = (function() { - var Nav; - - Nav = { - init: function() { - var append, next, prev, span; - switch (g.VIEW) { - case 'index': - if (!Conf['Index Navigation']) { - return; - } - break; - case 'thread': - if (!Conf['Reply Navigation']) { - return; - } - break; - default: - return; - } - span = $.el('span', { - id: 'navlinks' - }); - prev = $.el('a', { - textContent: '▲', - href: 'javascript:;' - }); - next = $.el('a', { - textContent: '▼', - href: 'javascript:;' - }); - $.on(prev, 'click', this.prev); - $.on(next, 'click', this.next); - $.add(span, [prev, $.tn(' '), next]); - append = function() { - $.off(d, '4chanXInitFinished', append); - return $.add(d.body, span); - }; - return $.on(d, '4chanXInitFinished', append); - }, - prev: function() { - if (g.VIEW === 'thread') { - return window.scrollTo(0, 0); - } else { - return Nav.scroll(-1); - } - }, - next: function() { - if (g.VIEW === 'thread') { - return window.scrollTo(0, d.body.scrollHeight); - } else { - return Nav.scroll(+1); - } - }, - getThread: function() { - var i, len, ref, thread, threadRoot; - if (g.VIEW === 'thread') { - return g.threads.get(g.BOARD + "." + g.THREADID).nodes.root; - } - if ($.hasClass(doc, 'catalog-mode')) { - return; - } - ref = $$(g.SITE.selectors.thread); - for (i = 0, len = ref.length; i < len; i++) { - threadRoot = ref[i]; - thread = Get.threadFromRoot(threadRoot); - if (thread.isHidden && !thread.stub) { - continue; - } - if (Header.getTopOf(threadRoot) >= -threadRoot.getBoundingClientRect().height) { - return threadRoot; - } - } - }, - scroll: function(delta) { - var axis, extra, next, ref, thread, top; - if ((ref = d.activeElement) != null) { - ref.blur(); - } - thread = Nav.getThread(); - if (!thread) { - return; - } - axis = delta === +1 ? 'following' : 'preceding'; - if (next = $.x(axis + "-sibling::" + g.SITE.xpath.thread + "[not(@hidden)][1]", thread)) { - top = Header.getTopOf(thread); - if (delta === +1 && top < 5 || delta === -1 && top > -5) { - thread = next; - } - } - extra = Header.getTopOf(thread) + doc.clientHeight - d.body.getBoundingClientRect().bottom; - if (extra > 0) { - d.body.style.marginBottom = extra + "px"; - } - Header.scrollTo(thread); - if (extra > 0 && !Nav.haveExtra) { - Nav.haveExtra = true; - return $.on(d, 'scroll', Nav.removeExtra); - } - }, - removeExtra: function() { - var extra; - extra = doc.clientHeight - d.body.getBoundingClientRect().bottom; - if (extra > 0) { - return d.body.style.marginBottom = extra + "px"; - } else { - d.body.style.marginBottom = ''; - delete Nav.haveExtra; - return $.off(d, 'scroll', Nav.removeExtra); - } - } - }; - - return Nav; - -}).call(this); - -NormalizeURL = (function() { - var NormalizeURL; - - NormalizeURL = { - init: function() { - var pathname; - if (!Conf['Normalize URL']) { - return; - } - pathname = location.pathname.split(/\/+/); - if (g.SITE.software === 'yotsuba') { - switch (g.VIEW) { - case 'thread': - pathname[2] = 'thread'; - pathname = pathname.slice(0, 4); - break; - case 'index': - pathname = pathname.slice(0, 3); - } - } - pathname = pathname.join('/'); - if (location.pathname !== pathname) { - return history.replaceState(history.state, '', location.protocol + "//" + location.host + pathname + location.hash); - } - } - }; - - return NormalizeURL; - -}).call(this); - -PSA = (function() { - var PSA, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - PSA = { - init: function() { - var announcement, el; - if (g.SITE.software === 'yotsuba' && g.BOARD.ID === 'qa') { - announcement = { - innerHTML: "Stay in touch with your /qa/ friends!" - }; - el = $.el('div', { - className: 'fcx-announcement' - }, announcement); - $.onExists(doc, '.boardBanner', function(banner) { - return $.after(banner, el); - }); - } - if ('samachan.org' in Conf['siteProperties'] && indexOf.call(Conf['PSAseen'], 'samachan') < 0) { - el = $.el('span', { - innerHTML: "Looking for a new home?
      Some former Samachan users are regrouping on SushiChan.

      (a message from 4chan X)" - }); - return Main.ready(function() { - new Notice('info', el); - Conf['PSAseen'].push('samachan'); - return $.set('PSAseen', Conf['PSAseen']); - }); - } - } - }; - - return PSA; - -}).call(this); - -PSAHiding = (function() { - var PSAHiding, - slice = [].slice; - - PSAHiding = { - init: function() { - if (!(Conf['Announcement Hiding'] && g.SITE.selectors.psa)) { - return; - } - $.addClass(doc, 'hide-announcement'); - $.onExists(doc, g.SITE.selectors.psa, this.setup); - return $.ready(function() { - if (!$(g.SITE.selectors.psa)) { - return $.rmClass(doc, 'hide-announcement'); - } - }); - }, - setup: function(psa) { - var btn, entry, hr, ref, ref1, ref2; - PSAHiding.psa = psa; - PSAHiding.text = (ref = psa.dataset.utc) != null ? ref : psa.innerHTML; - if (g.SITE.selectors.psaTop && (hr = (ref1 = $(g.SITE.selectors.psaTop)) != null ? ref1.previousElementSibling : void 0) && hr.nodeName === 'HR') { - PSAHiding.hr = hr; - } - PSAHiding.content = $.el('div'); - entry = { - el: $.el('a', { - textContent: 'Show announcement', - className: 'show-announcement', - href: 'javascript:;' - }), - order: 50, - open: function() { - return psa.hidden; - } - }; - Header.menu.addEntry(entry); - $.on(entry.el, 'click', PSAHiding.toggle); - PSAHiding.btn = btn = $.el('a', { - title: 'Mark announcement as read and hide.', - className: 'hide-announcement-button fa fa-minus-square', - href: 'javascript:;' - }); - $.on(btn, 'click', PSAHiding.toggle); - if (((ref2 = psa.firstChild) != null ? ref2.tagName : void 0) === 'HR') { - $.after(psa.firstChild, btn); - } else { - $.prepend(psa, btn); - } - PSAHiding.sync(Conf['hiddenPSAList']); - $.rmClass(doc, 'hide-announcement'); - return $.sync('hiddenPSAList', PSAHiding.sync); - }, - toggle: function() { - var hide, set; - hide = $.hasClass(this, 'hide-announcement-button'); - set = function(hiddenPSAList) { - if (hide) { - return hiddenPSAList[g.SITE.ID] = PSAHiding.text; - } else { - return delete hiddenPSAList[g.SITE.ID]; - } - }; - set(Conf['hiddenPSAList']); - PSAHiding.sync(Conf['hiddenPSAList']); - return $.get('hiddenPSAList', Conf['hiddenPSAList'], function(arg) { - var hiddenPSAList; - hiddenPSAList = arg.hiddenPSAList; - set(hiddenPSAList); - return $.set('hiddenPSAList', hiddenPSAList); - }); - }, - sync: function(hiddenPSAList) { - var content, psa, ref; - psa = PSAHiding.psa, content = PSAHiding.content; - psa.hidden = hiddenPSAList[g.SITE.ID] === PSAHiding.text; - if (psa.hidden) { - $.add(content, slice.call(psa.childNodes)); - } else { - $.add(psa, slice.call(content.childNodes)); - } - return (ref = PSAHiding.hr) != null ? ref.hidden = psa.hidden : void 0; - } - }; - - return PSAHiding; - -}).call(this); - -PassMessage = (function() { - var PassMessage; - - PassMessage = { - init: function() { - var close, msg; - if (Conf['passMessageClosed']) { - return; - } - msg = $.el('div', { - className: 'box-outer top-box' - }, {innerHTML: "

      Trouble buying a 4chan Pass? (a message from 4chan X) ×

      Check the 4chan X wiki for alternative solutions.
      "}); - msg.style.cssText = 'padding-bottom: 0;'; - close = $('a', msg); - $.on(close, 'click', function() { - $.rm(msg); - return $.set('passMessageClosed', true); - }); - return $.ready(function() { - var hd; - if ((hd = $.id('hd'))) { - return $.after(hd, msg); - } else { - return $.prepend(d.body, msg); - } - }); - } - }; - - return PassMessage; - -}).call(this); - -PostJumper = (function() { - var PostJumper; - - PostJumper = { - init: function() { - var ref; - if (!(Conf['Unique ID and Capcode Navigation'] && ((ref = g.VIEW) === 'index' || ref === 'thread'))) { - return; - } - this.buttons = this.makeButtons(); - return Callbacks.Post.push({ - name: 'Post Jumper', - cb: this.node - }); - }, - node: function() { - var buttons, i, len, ref; - if (this.isClone) { - ref = $$('.postJumper', this.nodes.info); - for (i = 0, len = ref.length; i < len; i++) { - buttons = ref[i]; - PostJumper.addListeners(buttons); - } - return; - } - if (this.nodes.uniqueIDRoot) { - PostJumper.addButtons(this, 'uniqueID'); - } - if (this.nodes.capcode) { - return PostJumper.addButtons(this, 'capcode'); - } - }, - addButtons: function(post, type) { - var buttons, value; - value = post.info[type]; - buttons = PostJumper.buttons.cloneNode(true); - $.extend(buttons.dataset, { - type: type, - value: value - }); - $.after(post.nodes[type + (type === 'capcode' ? '' : 'Root')], buttons); - return PostJumper.addListeners(buttons); - }, - addListeners: function(buttons) { - $.on(buttons.firstChild, 'click', PostJumper.buttonClick); - return $.on(buttons.lastChild, 'click', PostJumper.buttonClick); - }, - buttonClick: function() { - var dir, toJumper; - dir = $.hasClass(this, 'prev') ? -1 : 1; - if ((toJumper = PostJumper.find(this.parentNode, dir))) { - return PostJumper.scroll(this.parentNode, toJumper); - } - }, - find: function(jumper, dir) { - var axis, jumper2, ref, type, value, xpath; - ref = jumper.dataset, type = ref.type, value = ref.value; - xpath = "span[contains(@class,\"postJumper\") and @data-value=\"" + value + "\" and @data-type=\"" + type + "\"]"; - axis = dir < 0 ? 'preceding' : 'following'; - jumper2 = jumper; - while ((jumper2 = $.x(axis + "::" + xpath, jumper2))) { - if (jumper2.getBoundingClientRect().height) { - return jumper2; - } - } - if ((jumper2 = $.x("(//" + xpath + ")[" + (dir < 0 ? 'last()' : '1') + "]"))) { - if (jumper2.getBoundingClientRect().height) { - return jumper2; - } - } - while ((jumper2 = $.x(axis + "::" + xpath, jumper2)) && jumper2 !== jumper) { - if (jumper2.getBoundingClientRect().height) { - return jumper2; - } - } - return null; - }, - makeButtons: function() { - var charNext, charPrev, classNext, classPrev, span; - charPrev = '\u23EB'; - charNext = '\u23EC'; - classPrev = 'prev'; - classNext = 'next'; - span = $.el('span', { - className: 'postJumper' - }); - $.extend(span, {innerHTML: "" + E(charPrev) + "" + E(charNext) + ""}); - return span; - }, - scroll: function(fromJumper, toJumper) { - var destPos, prevPos; - prevPos = fromJumper.getBoundingClientRect().top; - destPos = toJumper.getBoundingClientRect().top; - return window.scrollBy(0, destPos - prevPos); - } - }; - - return PostJumper; - -}).call(this); - -RelativeDates = (function() { - var RelativeDates, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - RelativeDates = { - INTERVAL: $.MINUTE / 2, - init: function() { - var ref; - if (((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || Index.enabled) { - this.flush(); - $.on(d, 'visibilitychange PostsInserted', this.flush); - } - if (Conf['Relative Post Dates']) { - return Callbacks.Post.push({ - name: 'Relative Post Dates', - cb: this.node - }); - } - }, - node: function() { - var dateEl; - if (!this.info.date) { - return; - } - dateEl = this.nodes.date; - if (Conf['Relative Date Title']) { - $.on(dateEl, 'mouseover', (function(_this) { - return function() { - return RelativeDates.hover(_this); - }; - })(this)); - return; - } - if (this.isClone) { - return; - } - dateEl.title = dateEl.textContent; - return RelativeDates.update(this); - }, - relative: function(diff, now, date, abbrev) { - var days, months, number, rounded, unit, years; - unit = (number = diff / $.DAY) >= 1 ? (years = now.getFullYear() - date.getFullYear(), months = now.getMonth() - date.getMonth(), days = now.getDate() - date.getDate(), years > 1 ? (number = years - (months < 0 || months === 0 && days < 0), 'year') : years === 1 && (months > 0 || months === 0 && days >= 0) ? (number = years, 'year') : (months = months + 12 * years) > 1 ? (number = months - (days < 0), 'month') : months === 1 && days >= 0 ? (number = months, 'month') : 'day') : (number = diff / $.HOUR) >= 1 ? 'hour' : (number = diff / $.MINUTE) >= 1 ? 'minute' : (number = Math.max(0, diff) / $.SECOND, 'second'); - rounded = Math.round(number); - if (abbrev) { - unit = unit === 'month' ? 'mo' : unit[0]; - } else { - if (rounded !== 1) { - unit += 's'; - } - } - if (abbrev) { - return "" + rounded + unit; - } else { - return rounded + " " + unit + " ago"; - } - }, - stale: [], - flush: function() { - var data, i, len, now, ref; - if (d.hidden) { - return; - } - now = new Date(); - ref = RelativeDates.stale; - for (i = 0, len = ref.length; i < len; i++) { - data = ref[i]; - RelativeDates.update(data, now); - } - RelativeDates.stale = []; - clearTimeout(RelativeDates.timeout); - return RelativeDates.timeout = setTimeout(RelativeDates.flush, RelativeDates.INTERVAL); - }, - hover: function(post) { - var date, diff, now; - date = post.info.date; - now = new Date(); - diff = now - date; - return post.nodes.date.title = RelativeDates.relative(diff, now, date); - }, - update: function(data, now) { - var abbrev, date, diff, i, isPost, len, ref, relative, singlePost; - isPost = data instanceof Post; - if (isPost) { - date = data.info.date; - abbrev = false; - } else { - date = new Date(+data.dataset.utc); - abbrev = !!data.dataset.abbrev; - } - now || (now = new Date()); - diff = now - date; - relative = RelativeDates.relative(diff, now, date, abbrev); - if (isPost) { - ref = [data].concat(data.clones); - for (i = 0, len = ref.length; i < len; i++) { - singlePost = ref[i]; - singlePost.nodes.date.firstChild.textContent = relative; - } - } else { - data.firstChild.textContent = relative; - } - return RelativeDates.setOwnTimeout(diff, data); - }, - setOwnTimeout: function(diff, data) { - var delay; - delay = diff < $.MINUTE ? $.SECOND - (diff + $.SECOND / 2) % $.SECOND : diff < $.HOUR ? $.MINUTE - (diff + $.MINUTE / 2) % $.MINUTE : diff < $.DAY ? $.HOUR - (diff + $.HOUR / 2) % $.HOUR : $.DAY - (diff + $.DAY / 2) % $.DAY; - return setTimeout(RelativeDates.markStale, delay, data); - }, - markStale: function(data) { - if (indexOf.call(RelativeDates.stale, data) >= 0) { - return; - } - if (data instanceof Post && !g.posts.get(data.fullID)) { - return; - } - if (data instanceof Element && !doc.contains(data)) { - return; - } - return RelativeDates.stale.push(data); - } - }; - - return RelativeDates; - -}).call(this); - -RemoveSpoilers = (function() { - var RemoveSpoilers, - slice = [].slice; - - RemoveSpoilers = { - init: function() { - if (Conf['Reveal Spoilers']) { - $.addClass(doc, 'reveal-spoilers'); - } - if (!Conf['Remove Spoilers']) { - return; - } - Callbacks.Post.push({ - name: 'Reveal Spoilers', - cb: this.node - }); - if (g.VIEW === 'archive') { - return $.ready(function() { - return RemoveSpoilers.unspoiler($.id('arc-list')); - }); - } - }, - node: function() { - return RemoveSpoilers.unspoiler(this.nodes.comment); - }, - unspoiler: function(el) { - var i, len, span, spoiler, spoilers; - spoilers = $$(g.SITE.selectors.spoiler, el); - for (i = 0, len = spoilers.length; i < len; i++) { - spoiler = spoilers[i]; - span = $.el('span', { - className: 'removed-spoiler' - }); - $.replace(spoiler, span); - $.add(span, slice.call(spoiler.childNodes)); - } - } - }; - - return RemoveSpoilers; - -}).call(this); - -Report = (function() { - var Report; - - Report = { - init: function() { - var match; - if (!(match = location.search.match(/\bno=(\d+)/))) { - return; - } - Captcha.replace.init(); - this.postID = +match[1]; - return $.ready(this.ready); - }, - ready: function() { - $.addStyle(CSS.report); - if (Conf['Archive Report']) { - Report.archive(); - } - new MutationObserver(function() { - Report.fit('iframe[src^="https://www.google.com/recaptcha/api2/frame"]'); - return Report.fit('body'); - }).observe(d.body, { - childList: true, - attributes: true, - subtree: true - }); - return Report.fit('body'); - }, - fit: function(selector) { - var dy, el; - if (!((el = $(selector, doc)) && getComputedStyle(el).visibility !== 'hidden')) { - return; - } - dy = el.getBoundingClientRect().bottom - doc.clientHeight + 8; - if (dy > 0) { - return window.resizeBy(0, dy); - } - }, - archive: function() { - var enabled, fieldset, form, match, message, reason, submit, types, urls; - if (!(urls = Redirect.report(g.BOARD.ID)).length) { - return; - } - form = $('form'); - types = $.id('reportTypes'); - message = $('h3'); - fieldset = $.el('fieldset', { - id: 'archive-report', - hidden: true - }, {innerHTML: ""}); - enabled = $('#archive-report-enabled', fieldset); - reason = $('#archive-report-reason', fieldset); - submit = $('#archive-report-submit', fieldset); - $.on(enabled, 'change', function() { - return reason.disabled = !this.checked; - }); - if (form && types) { - fieldset.hidden = !$('[value="31"]', types).checked; - $.on(types, 'change', function(e) { - fieldset.hidden = e.target.value !== '31'; - return Report.fit('body'); - }); - $.after(types, fieldset); - Report.fit('body'); - $.one(form, 'submit', function(e) { - if (!fieldset.hidden && enabled.checked) { - e.preventDefault(); - return Report.archiveSubmit(urls, reason.value, (function(_this) { - return function(results) { - _this.action = '#archiveresults=' + encodeURIComponent(JSON.stringify(results)); - return _this.submit(); - }; - })(this)); - } - }); - } else if (message) { - fieldset.hidden = /Report submitted!/.test(message.textContent); - $.on(enabled, 'change', function() { - return submit.hidden = !this.checked; - }); - $.after(message, fieldset); - $.on(submit, 'click', function() { - return Report.archiveSubmit(urls, reason.value, Report.archiveResults); - }); - } - if ((match = location.hash.match(/^#archiveresults=(.*)$/))) { - try { - return Report.archiveResults(JSON.parse(decodeURIComponent(match[1]))); - } catch (error) {} - } - }, - archiveSubmit: function(urls, reason, cb) { - var fn, form, i, len, name, ref, results, url; - form = $.formData({ - board: g.BOARD.ID, - num: Report.postID, - reason: reason - }); - results = []; - fn = function(name, url) { - return $.ajax(url, { - onloadend: function() { - results.push([ - name, this.response || { - error: '' - } - ]); - if (results.length === urls.length) { - return cb(results); - } - }, - form: form - }); - }; - for (i = 0, len = urls.length; i < len; i++) { - ref = urls[i], name = ref[0], url = ref[1]; - fn(name, url); - } - }, - archiveResults: function(results) { - var fieldset, i, len, line, name, ref, response; - fieldset = $.id('archive-report'); - for (i = 0, len = results.length; i < len; i++) { - ref = results[i], name = ref[0], response = ref[1]; - line = $.el('h3', { - className: 'archive-report-response' - }); - if ('success' in response) { - $.addClass(line, 'archive-report-success'); - line.textContent = name + ": " + response.success; - } else { - $.addClass(line, 'archive-report-error'); - line.textContent = name + ": " + (response.error || 'Error reporting post.'); - } - if (fieldset) { - $.before(fieldset, line); - } else { - $.add(d.body, line); - } - } - } - }; - - return Report; - -}).call(this); - -ThreadLinks = (function() { - var ThreadLinks; - - ThreadLinks = { - init: function() { - if (!(g.VIEW === 'index' && Conf['Open Threads in New Tab'])) { - return; - } - Callbacks.Post.push({ - name: 'Thread Links', - cb: this.node - }); - return Callbacks.CatalogThread.push({ - name: 'Thread Links', - cb: this.catalogNode - }); - }, - node: function() { - if (this.isReply || this.isClone) { - return; - } - return ThreadLinks.process(this.nodes.reply); - }, - catalogNode: function() { - return ThreadLinks.process(this.nodes.thumb.parentNode); - }, - process: function(link) { - return link.target = '_blank'; - } - }; - - return ThreadLinks; - -}).call(this); - -Time = (function() { - var Time; - - Time = { - init: function() { - var ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive') && Conf['Time Formatting'])) { - return; - } - return Callbacks.Post.push({ - name: 'Time Formatting', - cb: this.node - }); - }, - node: function() { - var textContent; - if (!this.info.date || this.isClone) { - return; - } - textContent = this.nodes.date.textContent; - return this.nodes.date.textContent = textContent.match(/^\s*/)[0] + Time.format(Conf['time'], this.info.date) + textContent.match(/\s*$/)[0]; - }, - format: function(formatString, date) { - return formatString.replace(/%(.)/g, function(s, c) { - if ($.hasOwn(Time.formatters, c)) { - return Time.formatters[c].call(date); - } else { - return s; - } - }); - }, - day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], - month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - localeFormat: function(date, options, defaultValue) { - if (Conf['timeLocale']) { - try { - return Intl.DateTimeFormat(Conf['timeLocale'], options).format(date); - } catch (error) {} - } - return defaultValue; - }, - localeFormatPart: function(date, options, part, defaultValue) { - var parts; - if (Conf['timeLocale']) { - try { - parts = Intl.DateTimeFormat(Conf['timeLocale'], options).formatToParts(date); - return parts.map(function(x) { - if (x.type === part) { - return x.value; - } else { - return ''; - } - }).join(''); - } catch (error) {} - } - return defaultValue; - }, - zeroPad: function(n) { - if (n < 10) { - return "0" + n; - } else { - return n; - } - }, - formatters: { - a: function() { - return Time.localeFormat(this, { - weekday: 'short' - }, Time.day[this.getDay()].slice(0, 3)); - }, - A: function() { - return Time.localeFormat(this, { - weekday: 'long' - }, Time.day[this.getDay()]); - }, - b: function() { - return Time.localeFormat(this, { - month: 'short' - }, Time.month[this.getMonth()].slice(0, 3)); - }, - B: function() { - return Time.localeFormat(this, { - month: 'long' - }, Time.month[this.getMonth()]); - }, - d: function() { - return Time.zeroPad(this.getDate()); - }, - e: function() { - return this.getDate(); - }, - H: function() { - return Time.zeroPad(this.getHours()); - }, - I: function() { - return Time.zeroPad(this.getHours() % 12 || 12); - }, - k: function() { - return this.getHours(); - }, - l: function() { - return this.getHours() % 12 || 12; - }, - m: function() { - return Time.zeroPad(this.getMonth() + 1); - }, - M: function() { - return Time.zeroPad(this.getMinutes()); - }, - p: function() { - return Time.localeFormatPart(this, { - hour: 'numeric', - hour12: true - }, 'dayperiod', (this.getHours() < 12 ? 'AM' : 'PM')); - }, - P: function() { - return Time.formatters.p.call(this).toLowerCase(); - }, - S: function() { - return Time.zeroPad(this.getSeconds()); - }, - y: function() { - return this.getFullYear().toString().slice(2); - }, - Y: function() { - return this.getFullYear(); - }, - '%': function() { - return '%'; - } - } - }; - - return Time; - -}).call(this); - -Tinyboard = (function() { - var Tinyboard; - - Tinyboard = { - init: function() { - if (g.SITE.software !== 'tinyboard') { - return; - } - if (g.VIEW === 'thread') { - return Main.ready(function() { - return $.global(function() { - var base, boardID, form, originalNoko, ref, ref1, ref2, threadID; - ref = document.currentScript.dataset, boardID = ref.boardID, threadID = ref.threadID; - threadID = +threadID; - form = document.querySelector('form[name="post"]'); - window.$(document).ajaxComplete(function(event, request, settings) { - var detail, noko, postID, redirect, ref1, ref2; - if (settings.url !== form.action) { - return; - } - if (!(postID = +((ref1 = request.responseJSON) != null ? ref1.id : void 0))) { - return; - } - detail = { - boardID: boardID, - threadID: threadID, - postID: postID - }; - try { - ref2 = request.responseJSON, redirect = ref2.redirect, noko = ref2.noko; - if (redirect && (typeof originalNoko !== "undefined" && originalNoko !== null) && !originalNoko && !noko) { - detail.redirect = redirect; - } - } catch (error) {} - event = new CustomEvent('QRPostSuccessful', { - bubbles: true, - detail: detail - }); - return document.dispatchEvent(event); - }); - originalNoko = (ref1 = window.tb_settings) != null ? (ref2 = ref1.ajax) != null ? ref2.always_noko_replies : void 0 : void 0; - return ((base = (window.tb_settings || (window.tb_settings = {}))).ajax || (base.ajax = {})).always_noko_replies = true; - }, { - boardID: g.BOARD.ID, - threadID: g.THREADID - }); - }); - } - } - }; - - return Tinyboard; - -}).call(this); - -Favicon = (function() { - var Favicon; - - Favicon = { - init: function() { - return $.asap((function() { - return d.head && (Favicon.el = $('link[rel="shortcut icon"]', d.head)); - }), Favicon.initAsap); - }, - set: function(status) { - Favicon.status = status; - if (Favicon.el) { - Favicon.el.href = Favicon[status]; - return $.add(d.head, Favicon.el); - } - }, - initAsap: function() { - var href; - Favicon.el.type = 'image/x-icon'; - href = Favicon.el.href; - Favicon.isSFW = /ws\.ico$/.test(href); - Favicon["default"] = href; - Favicon["switch"](); - if (Favicon.status) { - return Favicon.set(Favicon.status); - } - }, - "switch": function() { - var f, i, items, t; - items = { - ferongr: ['iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///9zBQC/AADpDAP/gID/q6voCwJJTwpOAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPUCtJM7svankLrq/I+TY5e6Ueh1jyBMX7AFJi9vwfyVO4CbbO6jNYpp9GyVPbdkFhVgAQ2H0NOE5jk9DT8AAAAAElFTkSuQmCC', 'iVBORw0KGgoAAAANSUhEUg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JSAAAAJFBMVEUAAAAAAAAAAAAA1/H///8AISUALzQAeokACAkAQEcAorYAMTcE9WFNAAAAA3RSTlMAPse+s4iwAAAAMklEQVQI12NggAFmY2MDECaNAQZCilAzVJyg5oS4GqAxUtygjIp2KGOKJ5SxepcB3BUAcdYRqxAtgFoAAAAASUVORK5CYII=', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAABV/wErM5hwAAAAAXRSTlMAQObYZgAAABJJREFUCB1jZGBgrMNAQEEc4gCSfAX5bRw/NQAAAABJRU5ErkJggg==', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAAAAAAAAABV/wH///8NKAASOAAwkQADCgAZTABAwQATOwC5e3VGAAAAA3RSTlMAPse+s4iwAAAAMklEQVQI12NggAFmY2MDECaNAQZCilAzVJyg5oS4GqAxUtygjIp2KGOKJ5SxepcB3BUAcdYRqxAtgFoAAAAASUVORK5CYII='] - }; - items = $.getOwn(items, Conf['favicon']); - f = Favicon; - t = 'data:image/png;base64,'; - i = 0; - while (items[i]) { - items[i] = t + items[i++]; - } - f.unreadDead = items[0], f.unreadDeadY = items[1], f.unreadSFW = items[2], f.unreadSFWY = items[3], f.unreadNSFW = items[4], f.unreadNSFWY = items[5]; - return f.update(); - }, - update: function() { - if (this.isSFW) { - this.unread = this.unreadSFW; - return this.unreadY = this.unreadSFWY; - } else { - this.unread = this.unreadNSFW; - return this.unreadY = this.unreadNSFWY; - } - }, - SFW: '//s.4cdn.org/image/favicon-ws.ico', - NSFW: '//s.4cdn.org/image/favicon.ico', - dead: 'data:image/gif;base64,R0lGODlhEAAQAKECAAAAAP8AAP///////yH5BAEKAAIALAAAAAAQABAAAAIvlI+pq+D9DAgUoFkPDlbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw==', - logo: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACAAgMAAAC+UIlYAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAGlJREFUWMPtlkEKADEIA/tJP9lXLttQto2yHxgDHozTi0ToGK2WKZZ+HAQQMZc+xBwI4EZ+wAC2IfPuSIDOZJrSZQEAX9eVJhhwIuUYAnQe8rhAEMAZlTI2MID9f5Clyh0JeE1V1ZEAvB4qDfwuJTSGRAAAAABJRU5ErkJggg==' - }; - - return Favicon; - -}).call(this); - -MarkNewIPs = (function() { - var MarkNewIPs; - - MarkNewIPs = { - init: function() { - if (!(g.SITE.software === 'yotsuba' && g.VIEW === 'thread' && Conf['Mark New IPs'])) { - return; - } - return Callbacks.Thread.push({ - name: 'Mark New IPs', - cb: this.node - }); - }, - node: function() { - MarkNewIPs.ipCount = this.ipCount; - MarkNewIPs.postCount = this.posts.keys.length; - return $.on(d, 'ThreadUpdate', MarkNewIPs.onUpdate); - }, - onUpdate: function(e) { - var deletedPosts, fullID, i, ipCount, j, k, len, len1, newPosts, postCount, ref; - ref = e.detail, ipCount = ref.ipCount, postCount = ref.postCount, newPosts = ref.newPosts, deletedPosts = ref.deletedPosts; - if (ipCount == null) { - return; - } - switch (ipCount - MarkNewIPs.ipCount) { - case postCount - MarkNewIPs.postCount + deletedPosts.length: - i = MarkNewIPs.ipCount; - for (j = 0, len = newPosts.length; j < len; j++) { - fullID = newPosts[j]; - MarkNewIPs.markNew(g.posts.get(fullID), ++i); - } - break; - case -deletedPosts.length: - for (k = 0, len1 = newPosts.length; k < len1; k++) { - fullID = newPosts[k]; - MarkNewIPs.markOld(g.posts.get(fullID)); - } - } - MarkNewIPs.ipCount = ipCount; - return MarkNewIPs.postCount = postCount; - }, - markNew: function(post, ipCount) { - var counter, suffix; - suffix = (Math.floor(ipCount / 10)) % 10 === 1 ? 'th' : ['st', 'nd', 'rd'][ipCount % 10 - 1] || 'th'; - counter = $.el('span', { - className: 'ip-counter', - textContent: "(" + ipCount + ")" - }); - post.nodes.nameBlock.title = "This is the " + ipCount + suffix + " IP in the thread."; - $.add(post.nodes.nameBlock, [$.tn(' '), counter]); - return $.addClass(post.nodes.root, 'new-ip'); - }, - markOld: function(post) { - post.nodes.nameBlock.title = 'Not the first post from this IP.'; - return $.addClass(post.nodes.root, 'old-ip'); - } - }; - - return MarkNewIPs; - -}).call(this); - -ReplyPruning = (function() { - var ReplyPruning; - - ReplyPruning = { - init: function() { - var el, label; - if (!(g.VIEW === 'thread' && Conf['Reply Pruning'])) { - return; - } - this.container = $.frag(); - this.summary = $.el('span', { - hidden: true, - className: 'summary' - }); - this.summary.style.cursor = 'pointer'; - $.on(this.summary, 'click', (function(_this) { - return function() { - _this.inputs.enabled.checked = !_this.inputs.enabled.checked; - return $.event('change', null, _this.inputs.enabled); - }; - })(this)); - label = UI.checkbox('Prune Replies', 'Show Last', Conf['Prune All Threads']); - el = $.el('span', { - title: 'Maximum number of replies to show.' - }, {innerHTML: " "}); - $.prepend(el, label); - this.inputs = { - enabled: label.firstElementChild, - replies: el.lastElementChild - }; - this.setEnabled.call(this.inputs.enabled); - $.on(this.inputs.enabled, 'change', this.setEnabled); - $.on(this.inputs.replies, 'change', $.cb.value); - Header.menu.addEntry({ - el: el, - order: 190 - }); - return Callbacks.Thread.push({ - name: 'Reply Pruning', - cb: this.node - }); - }, - position: 0, - hidden: 0, - hiddenFiles: 0, - total: 0, - totalFiles: 0, - setEnabled: function() { - var other; - other = QuoteThreading.input; - if (this.checked && (other != null ? other.checked : void 0)) { - other.checked = false; - $.event('change', null, other); - } - return ReplyPruning.active = this.checked; - }, - showIfHidden: function(id) { - if (ReplyPruning.container && $("#" + id, ReplyPruning.container)) { - ReplyPruning.inputs.enabled.checked = false; - return $.event('change', null, ReplyPruning.inputs.enabled); - } - }, - node: function() { - var ref; - ReplyPruning.thread = this; - if (this.isSticky) { - ReplyPruning.active = ReplyPruning.inputs.enabled.checked = true; - if (QuoteThreading.input) { - Conf['Thread Quotes'] = QuoteThreading.input.checked = false; - } - } - this.posts.forEach(function(post) { - if (post.isReply) { - ReplyPruning.total++; - if (post.file) { - return ReplyPruning.totalFiles++; - } - } - }); - if (ReplyPruning.active && /^#p\d+$/.test(location.hash) && (1 <= (ref = this.posts.keys.indexOf(location.hash.slice(2))) && ref < 1 + Math.max(ReplyPruning.total - +Conf["Max Replies"], 0))) { - ReplyPruning.active = ReplyPruning.inputs.enabled.checked = false; - } - $.after(this.OP.nodes.root, ReplyPruning.summary); - $.on(ReplyPruning.inputs.enabled, 'change', ReplyPruning.update); - $.on(ReplyPruning.inputs.replies, 'change', ReplyPruning.update); - $.on(d, 'ThreadUpdate', ReplyPruning.updateCount); - $.on(d, 'ThreadUpdate', ReplyPruning.update); - return ReplyPruning.update(); - }, - updateCount: function(e) { - var fullID, i, len, ref; - if (e.detail[404]) { - return; - } - ref = e.detail.newPosts; - for (i = 0, len = ref.length; i < len; i++) { - fullID = ref[i]; - ReplyPruning.total++; - if (g.posts.get(fullID).file) { - ReplyPruning.totalFiles++; - } - } - }, - update: function() { - var boardTop, frag, hidden1, hidden2, node, oldPos, post, posts; - hidden1 = ReplyPruning.hidden; - hidden2 = ReplyPruning.active ? Math.max(ReplyPruning.total - +Conf["Max Replies"], 0) : 0; - oldPos = d.body.clientHeight - window.scrollY; - posts = ReplyPruning.thread.posts; - if (ReplyPruning.hidden < hidden2) { - while (ReplyPruning.hidden < hidden2 && ReplyPruning.position < posts.keys.length) { - post = posts.get(posts.keys[ReplyPruning.position++]); - if (post.isReply && !post.isFetchedQuote) { - while ((node = ReplyPruning.summary.nextSibling) && node !== post.nodes.root) { - $.add(ReplyPruning.container, node); - } - $.add(ReplyPruning.container, post.nodes.root); - ReplyPruning.hidden++; - if (post.file) { - ReplyPruning.hiddenFiles++; - } - } - } - } else if (ReplyPruning.hidden > hidden2) { - frag = $.frag(); - while (ReplyPruning.hidden > hidden2 && ReplyPruning.position > 0) { - post = posts.get(posts.keys[--ReplyPruning.position]); - if (post.isReply && !post.isFetchedQuote) { - while ((node = ReplyPruning.container.lastChild) && node !== post.nodes.root) { - $.prepend(frag, node); - } - $.prepend(frag, post.nodes.root); - ReplyPruning.hidden--; - if (post.file) { - ReplyPruning.hiddenFiles--; - } - } - } - $.after(ReplyPruning.summary, frag); - $.event('PostsInserted', null, ReplyPruning.summary.parentNode); - } - ReplyPruning.summary.textContent = ReplyPruning.active ? g.SITE.Build.summaryText('+', ReplyPruning.hidden, ReplyPruning.hiddenFiles) : g.SITE.Build.summaryText('-', ReplyPruning.total, ReplyPruning.totalFiles); - ReplyPruning.summary.hidden = ReplyPruning.total <= +Conf["Max Replies"]; - if (hidden1 !== hidden2 && (boardTop = Header.getTopOf($('.board'))) < 0) { - return window.scrollBy(0, Math.max(d.body.clientHeight - oldPos, window.scrollY + boardTop) - window.scrollY); - } - } - }; - - return ReplyPruning; - -}).call(this); - -ThreadStats = (function() { - var ThreadStats; - - ThreadStats = { - postCount: 0, - fileCount: 0, - postIndex: 0, - init: function() { - var base, sc, statsHTML, statsTitle; - if (g.VIEW !== 'thread' || !Conf['Thread Stats']) { - return; - } - if (Conf['Page Count in Stats']) { - this[(typeof (base = g.SITE).isPrunedByAge === "function" ? base.isPrunedByAge(g.BOARD) : void 0) ? 'showPurgePos' : 'showPage'] = true; - } - statsHTML = {innerHTML: "? / ?" + ((Conf["IP Count in Stats"] && g.SITE.hasIPCount) ? " / ?" : "") + ((Conf["Page Count in Stats"]) ? " / ?" : "")}; - statsTitle = 'Posts / Files'; - if (Conf['IP Count in Stats'] && g.SITE.hasIPCount) { - statsTitle += ' / IPs'; - } - if (Conf['Page Count in Stats']) { - statsTitle += (this.showPurgePos ? ' / Purge Position' : ' / Page'); - } - if (Conf['Updater and Stats in Header']) { - this.dialog = sc = $.el('span', { - id: 'thread-stats', - title: statsTitle - }); - $.extend(sc, statsHTML); - Header.addShortcut('stats', sc, 200); - } else { - this.dialog = sc = UI.dialog('thread-stats', {innerHTML: "
      " + (statsHTML).innerHTML + "
      "}); - $.addClass(doc, 'float'); - $.ready(function() { - return $.add(d.body, sc); - }); - } - this.postCountEl = $('#post-count', sc); - this.fileCountEl = $('#file-count', sc); - this.ipCountEl = $('#ip-count', sc); - this.pageCountEl = $('#page-count', sc); - if (this.pageCountEl) { - $.on(this.pageCountEl, 'click', ThreadStats.fetchPage); - } - return Callbacks.Thread.push({ - name: 'Thread Stats', - cb: this.node - }); - }, - node: function() { - ThreadStats.thread = this; - ThreadStats.count(); - ThreadStats.update(); - ThreadStats.fetchPage(); - $.on(d, 'PostsInserted', function() { - return $.queueTask(ThreadStats.onPostsInserted); - }); - return $.on(d, 'ThreadUpdate', ThreadStats.onUpdate); - }, - count: function() { - var i, j, n, post, posts, ref, ref1; - posts = ThreadStats.thread.posts; - n = posts.keys.length; - for (i = j = ref = ThreadStats.postIndex, ref1 = n; j < ref1; i = j += 1) { - post = posts.get(posts.keys[i]); - if (!post.isFetchedQuote) { - ThreadStats.postCount++; - ThreadStats.fileCount += post.files.length; - } - } - return ThreadStats.postIndex = n; - }, - onUpdate: function(e) { - var fileCount, postCount, ref; - if (e.detail[404]) { - return; - } - ref = e.detail, postCount = ref.postCount, fileCount = ref.fileCount; - $.extend(ThreadStats, { - postCount: postCount, - fileCount: fileCount - }); - ThreadStats.postIndex = ThreadStats.thread.posts.keys.length; - ThreadStats.update(); - if (ThreadStats.showPage && ThreadStats.pageCountEl.textContent !== '1') { - return ThreadStats.fetchPage(); - } - }, - onPostsInserted: function() { - if (!(ThreadStats.thread.posts.keys.length > ThreadStats.postIndex)) { - return; - } - ThreadStats.count(); - ThreadStats.update(); - if (ThreadStats.showPage && ThreadStats.pageCountEl.textContent !== '1') { - return ThreadStats.fetchPage(); - } - }, - update: function() { - var fileCountEl, ipCountEl, postCountEl, ref, thread; - thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl, ipCountEl = ThreadStats.ipCountEl; - postCountEl.textContent = ThreadStats.postCount; - fileCountEl.textContent = ThreadStats.fileCount; - if (ipCountEl != null) { - ipCountEl.textContent = (ref = thread.ipCount) != null ? ref : '?'; - } - postCountEl.classList.toggle('warning', thread.postLimit && !thread.isSticky); - return fileCountEl.classList.toggle('warning', thread.fileLimit && !thread.isSticky); - }, - fetchPage: function() { - if (!ThreadStats.pageCountEl) { - return; - } - clearTimeout(ThreadStats.timeout); - if (ThreadStats.thread.isDead) { - ThreadStats.pageCountEl.textContent = 'Dead'; - $.addClass(ThreadStats.pageCountEl, 'warning'); - return; - } - ThreadStats.timeout = setTimeout(ThreadStats.fetchPage, 2 * $.MINUTE); - return $.whenModified(g.SITE.urls.threadsListJSON(ThreadStats.thread), 'ThreadStats', ThreadStats.onThreadsLoad); - }, - onThreadsLoad: function() { - var i, j, k, l, len, len1, len2, len3, len4, m, nThreads, o, page, pageNum, purgePos, ref, ref1, ref2, ref3, ref4, thread; - if (this.status === 200) { - if (ThreadStats.showPurgePos) { - purgePos = 1; - ref = this.response; - for (j = 0, len = ref.length; j < len; j++) { - page = ref[j]; - ref1 = page.threads; - for (k = 0, len1 = ref1.length; k < len1; k++) { - thread = ref1[k]; - if (thread.no < ThreadStats.thread.ID) { - purgePos++; - } - } - } - ThreadStats.pageCountEl.textContent = purgePos; - return ThreadStats.pageCountEl.classList.toggle('warning', purgePos === 1); - } else { - i = nThreads = 0; - ref2 = this.response; - for (l = 0, len2 = ref2.length; l < len2; l++) { - page = ref2[l]; - nThreads += page.threads.length; - } - ref3 = this.response; - for (pageNum = m = 0, len3 = ref3.length; m < len3; pageNum = ++m) { - page = ref3[pageNum]; - ref4 = page.threads; - for (o = 0, len4 = ref4.length; o < len4; o++) { - thread = ref4[o]; - if (thread.no === ThreadStats.thread.ID) { - ThreadStats.pageCountEl.textContent = pageNum + 1; - ThreadStats.pageCountEl.classList.toggle('warning', i >= nThreads - this.response[0].threads.length); - ThreadStats.lastPageUpdate = new Date(thread.last_modified * $.SECOND); - ThreadStats.retry(); - return; - } - i++; - } - } - } - } else if (this.status === 304) { - return ThreadStats.retry(); - } - }, - retry: function() { - if (!(ThreadStats.showPage && ThreadStats.pageCountEl.textContent !== '1' && !g.SITE.threadModTimeIgnoresSage && ThreadStats.thread.posts.get(ThreadStats.thread.lastPost).info.date > ThreadStats.lastPageUpdate)) { - return; - } - clearTimeout(ThreadStats.timeout); - return ThreadStats.timeout = setTimeout(ThreadStats.fetchPage, 5 * $.SECOND); - } - }; - - return ThreadStats; - -}).call(this); - -ThreadUpdater = (function() { - var ThreadUpdater, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - ThreadUpdater = { - init: function() { - var conf, el, input, name, ref, sc, subEntries, updateLink; - if (g.VIEW !== 'thread' || !Conf['Thread Updater']) { - return; - } - this.enabled = true; - this.audio = $.el('audio'); - if ($.engine !== 'gecko') { - this.audio.src = this.beep; - } - if (Conf['Updater and Stats in Header']) { - this.dialog = sc = $.el('span', { - id: 'updater' - }); - $.extend(sc, {innerHTML: ""}); - Header.addShortcut('updater', sc, 100); - } else { - this.dialog = sc = UI.dialog('updater', {innerHTML: "
      "}); - $.addClass(doc, 'float'); - $.ready(function() { - return $.add(d.body, sc); - }); - } - this.checkPostCount = 0; - this.timer = $('#update-timer', sc); - this.status = $('#update-status', sc); - $.on(this.timer, 'click', this.update); - $.on(this.status, 'click', this.update); - updateLink = $.el('span', { - className: 'brackets-wrap updatelink' - }); - $.extend(updateLink, {innerHTML: "Update"}); - Main.ready(function() { - var navLinksBot; - if ((navLinksBot = $('.navLinksBot'))) { - return $.add(navLinksBot, [$.tn(' '), updateLink]); - } - }); - $.on(updateLink.firstElementChild, 'click', this.update); - subEntries = []; - ref = Config.updater.checkbox; - for (name in ref) { - conf = ref[name]; - el = UI.checkbox(name, name); - el.title = conf[1]; - input = el.firstElementChild; - $.on(input, 'change', $.cb.checked); - if (input.name === 'Scroll BG') { - $.on(input, 'change', this.cb.scrollBG); - this.cb.scrollBG(); - } else if (input.name === 'Auto Update') { - $.on(input, 'change', this.setInterval); - } - subEntries.push({ - el: el - }); - } - this.settings = $.el('span', {innerHTML: "Interval"}); - $.on(this.settings, 'click', this.intervalShortcut); - subEntries.push({ - el: this.settings - }); - Header.menu.addEntry(this.entry = { - el: $.el('span', { - textContent: 'Updater' - }), - order: 110, - subEntries: subEntries - }); - return Callbacks.Thread.push({ - name: 'Thread Updater', - cb: this.node - }); - }, - node: function() { - ThreadUpdater.thread = this; - ThreadUpdater.root = this.nodes.root; - ThreadUpdater.outdateCount = 0; - ThreadUpdater.postIDs = []; - ThreadUpdater.fileIDs = []; - this.posts.forEach(function(post) { - ThreadUpdater.postIDs.push(post.ID); - if (post.file) { - return ThreadUpdater.fileIDs.push(post.ID); - } - }); - ThreadUpdater.cb.interval.call($.el('input', { - value: Conf['Interval'] - })); - $.on(d, 'QRPostSuccessful', ThreadUpdater.cb.checkpost); - $.on(d, 'visibilitychange', ThreadUpdater.cb.visibility); - return ThreadUpdater.setInterval(); - }, - - /* - http://freesound.org/people/pierrecartoons1979/sounds/90112/ - cc-by-nc-3.0 - */ - beep: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA', - playBeep: function() { - var audio; - audio = ThreadUpdater.audio; - audio.src || (audio.src = ThreadUpdater.beep); - if (audio.paused) { - return audio.play(); - } else { - return $.one(audio, 'ended', ThreadUpdater.playBeep); - } - }, - cb: { - checkpost: function(e) { - if (e.detail.threadID !== ThreadUpdater.thread.ID) { - return; - } - ThreadUpdater.postID = e.detail.postID; - ThreadUpdater.checkPostCount = 0; - ThreadUpdater.outdateCount = 0; - return ThreadUpdater.setInterval(); - }, - visibility: function() { - if (d.hidden) { - return; - } - ThreadUpdater.outdateCount = 0; - if (ThreadUpdater.seconds > ThreadUpdater.interval) { - return ThreadUpdater.setInterval(); - } - }, - scrollBG: function() { - return ThreadUpdater.scrollBG = Conf['Scroll BG'] ? function() { - return true; - } : function() { - return !d.hidden; - }; - }, - interval: function(e) { - var val; - val = parseInt(this.value, 10); - if (val < 1) { - val = 1; - } - ThreadUpdater.interval = this.value = val; - if (e) { - return $.cb.value.call(this); - } - }, - load: function() { - if (this !== ThreadUpdater.req) { - return; - } - switch (this.status) { - case 200: - ThreadUpdater.parse(this); - if (ThreadUpdater.thread.isArchived) { - return ThreadUpdater.kill(); - } else { - return ThreadUpdater.setInterval(); - } - break; - case 404: - return $.ajax(g.SITE.urls.catalogJSON({ - boardID: ThreadUpdater.thread.board.ID - }), { - onloadend: function() { - var confirmed, i, k, len, len1, page, ref, ref1, thread; - if (this.status === 200) { - confirmed = true; - ref = this.response; - for (i = 0, len = ref.length; i < len; i++) { - page = ref[i]; - ref1 = page.threads; - for (k = 0, len1 = ref1.length; k < len1; k++) { - thread = ref1[k]; - if (thread.no === ThreadUpdater.thread.ID) { - confirmed = false; - break; - } - } - } - } else { - confirmed = false; - } - if (confirmed) { - return ThreadUpdater.kill(); - } else { - return ThreadUpdater.error(this); - } - } - }); - default: - return ThreadUpdater.error(this); - } - } - }, - kill: function() { - ThreadUpdater.thread.kill(); - ThreadUpdater.setInterval(); - return $.event('ThreadUpdate', { - 404: true, - threadID: ThreadUpdater.thread.fullID - }); - }, - error: function(req) { - if (req.status === 304) { - ThreadUpdater.set('status', ''); - } - ThreadUpdater.setInterval(); - if (!req.status) { - return ThreadUpdater.set('status', 'Connection Error', 'warning'); - } else if (req.status !== 304) { - return ThreadUpdater.set('status', req.statusText + " (" + req.status + ")", 'warning'); - } - }, - setInterval: function() { - var cur, interval, j, limit; - clearTimeout(ThreadUpdater.timeoutID); - if (ThreadUpdater.thread.isDead) { - ThreadUpdater.set('status', (ThreadUpdater.thread.isArchived ? 'Archived' : '404'), 'warning'); - ThreadUpdater.set('timer', ''); - return; - } - if (ThreadUpdater.postID && ThreadUpdater.checkPostCount < 5) { - ThreadUpdater.set('timer', '...', 'loading'); - ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * $.SECOND); - return; - } - if (!Conf['Auto Update']) { - ThreadUpdater.set('timer', 'Update'); - return; - } - interval = ThreadUpdater.interval; - if (Conf['Optional Increase']) { - limit = d.hidden ? 10 : 5; - j = Math.min(ThreadUpdater.outdateCount, limit); - cur = (Math.floor(interval * 0.1) || 1) * j * j; - ThreadUpdater.seconds = $.minmax(cur, interval, 300); - } else { - ThreadUpdater.seconds = interval; - } - return ThreadUpdater.timeout(); - }, - intervalShortcut: function() { - var settings; - Settings.open('Advanced'); - settings = $.id('fourchanx-settings'); - return $('input[name=Interval]', settings).focus(); - }, - set: function(name, text, klass) { - var el, node; - el = ThreadUpdater[name]; - if (node = el.firstChild) { - node.data = text; - } else { - el.textContent = text; - } - return el.className = klass != null ? klass : (text === '' ? 'empty' : ''); - }, - timeout: function() { - if (ThreadUpdater.seconds) { - ThreadUpdater.set('timer', ThreadUpdater.seconds); - ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); - } else { - ThreadUpdater.outdateCount++; - ThreadUpdater.update(); - } - return ThreadUpdater.seconds--; - }, - update: function() { - var oldReq; - clearTimeout(ThreadUpdater.timeoutID); - ThreadUpdater.set('timer', '...', 'loading'); - if ((oldReq = ThreadUpdater.req)) { - delete ThreadUpdater.req; - oldReq.abort(); - } - return ThreadUpdater.req = $.whenModified(g.SITE.urls.threadJSON({ - boardID: ThreadUpdater.thread.board.ID, - threadID: ThreadUpdater.thread.ID - }), 'ThreadUpdater', ThreadUpdater.cb.load, { - timeout: $.MINUTE - }); - }, - updateThreadStatus: function(type, status) { - var change, hasChanged; - if (!(hasChanged = ThreadUpdater.thread["is" + type] !== status)) { - return; - } - ThreadUpdater.thread.setStatus(type, status); - if (type === 'Closed' && ThreadUpdater.thread.isArchived) { - return; - } - change = type === 'Sticky' ? status ? 'now a sticky' : 'not a sticky anymore' : status ? 'now closed' : 'not closed anymore'; - return new Notice('info', "The thread is " + change + ".", 30); - }, - parse: function(req) { - var ID, OP, board, deletedFiles, deletedPosts, files, firstPost, i, index, ipCountEl, k, l, lastPost, len, len1, len2, len3, m, newPosts, node, post, postObject, postObjects, posts, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, scroll, thread, unreadCount, unreadQYCount; - postObjects = req.response.posts; - OP = postObjects[0]; - thread = ThreadUpdater.thread; - board = thread.board; - ref = ThreadUpdater.postIDs, lastPost = ref[ref.length - 1]; - if (postObjects[postObjects.length - 1].no < lastPost && new Date(req.getResponseHeader('Last-Modified')) - thread.posts.get(lastPost).info.date < 30 * $.SECOND) { - return; - } - g.SITE.Build.spoilerRange[board] = OP.custom_spoiler; - thread.setStatus('Archived', !!OP.archived); - ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky); - ThreadUpdater.updateThreadStatus('Closed', !!OP.closed); - thread.postLimit = !!OP.bumplimit; - thread.fileLimit = !!OP.imagelimit; - if (OP.unique_ips != null) { - thread.ipCount = OP.unique_ips; - } - posts = []; - index = []; - files = []; - newPosts = []; - for (i = 0, len = postObjects.length; i < len; i++) { - postObject = postObjects[i]; - ID = postObject.no; - index.push(ID); - if (postObject.fsize) { - files.push(ID); - } - if (ID <= lastPost) { - continue; - } - if ((post = thread.posts.get(ID)) && !post.isFetchedQuote) { - post.resurrect(); - continue; - } - newPosts.push(board + "." + ID); - node = g.SITE.Build.postFromObject(postObject, board.ID); - posts.push(new Post(node, thread, board)); - if (ThreadUpdater.postID === ID) { - delete ThreadUpdater.postID; - } - } - deletedPosts = []; - ref1 = ThreadUpdater.postIDs; - for (k = 0, len1 = ref1.length; k < len1; k++) { - ID = ref1[k]; - if (!(indexOf.call(index, ID) < 0)) { - continue; - } - thread.posts.get(ID).kill(); - deletedPosts.push(board + "." + ID); - } - ThreadUpdater.postIDs = index; - deletedFiles = []; - ref2 = ThreadUpdater.fileIDs; - for (l = 0, len2 = ref2.length; l < len2; l++) { - ID = ref2[l]; - if (!(!(indexOf.call(files, ID) >= 0 || (ref3 = board + "." + ID, indexOf.call(deletedPosts, ref3) >= 0)))) { - continue; - } - thread.posts.get(ID).kill(true); - deletedFiles.push(board + "." + ID); - } - ThreadUpdater.fileIDs = files; - if (!posts.length) { - ThreadUpdater.set('status', ''); - } else { - ThreadUpdater.set('status', "+" + posts.length, 'new'); - ThreadUpdater.outdateCount = 0; - unreadCount = (ref4 = Unread.posts) != null ? ref4.size : void 0; - unreadQYCount = (ref5 = Unread.postsQuotingYou) != null ? ref5.size : void 0; - Main.callbackNodes('Post', posts); - if (d.hidden || !d.hasFocus()) { - if (Conf['Beep Quoting You'] && ((ref6 = Unread.postsQuotingYou) != null ? ref6.size : void 0) > unreadQYCount) { - ThreadUpdater.playBeep(); - if (Conf['Beep']) { - ThreadUpdater.playBeep(); - } - } else if (Conf['Beep'] && ((ref7 = Unread.posts) != null ? ref7.size : void 0) > 0 && unreadCount === 0) { - ThreadUpdater.playBeep(); - } - } - scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25; - firstPost = null; - for (m = 0, len3 = posts.length; m < len3; m++) { - post = posts[m]; - if (!QuoteThreading.insert(post)) { - firstPost || (firstPost = post.nodes.root); - $.add(ThreadUpdater.root, post.nodes.root); - } - } - $.event('PostsInserted', null, ThreadUpdater.root); - if (scroll) { - if (Conf['Bottom Scroll']) { - window.scrollTo(0, d.body.clientHeight); - } else { - if (firstPost) { - Header.scrollTo(firstPost); - } - } - } - } - if ((OP.unique_ips != null) && (ipCountEl = $.id('unique-ips'))) { - ipCountEl.textContent = OP.unique_ips; - ipCountEl.previousSibling.textContent = ipCountEl.previousSibling.textContent.replace(/\b(?:is|are)\b/, OP.unique_ips === 1 ? 'is' : 'are'); - ipCountEl.nextSibling.textContent = ipCountEl.nextSibling.textContent.replace(/\bposters?\b/, OP.unique_ips === 1 ? 'poster' : 'posters'); - } - return $.event('ThreadUpdate', { - 404: false, - threadID: thread.fullID, - newPosts: newPosts, - deletedPosts: deletedPosts, - deletedFiles: deletedFiles, - postCount: OP.replies + 1, - fileCount: OP.images + !!OP.fsize, - ipCount: OP.unique_ips - }); - } - }; - - return ThreadUpdater; - -}).call(this); - -ThreadWatcher = (function() { - var ThreadWatcher, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - slice = [].slice; - - ThreadWatcher = { - init: function() { - var ref, sc; - if (!(this.enabled = Conf['Thread Watcher'])) { - return; - } - this.shortcut = sc = $.el('a', { - id: 'watcher-link', - textContent: 'Watcher', - title: 'Thread Watcher', - href: 'javascript:;', - className: 'fa fa-eye' - }); - this.db = new DataBoard('watchedThreads', this.refresh, true); - this.dbLM = new DataBoard('watcherLastModified', null, true); - this.dialog = UI.dialog('thread-watcher', {innerHTML: "
      Thread Watcher ×
      "}); - this.status = $('#watcher-status', this.dialog); - this.list = this.dialog.lastElementChild; - this.refreshButton = $('.refresh', this.dialog); - this.closeButton = $('.move > .close', this.dialog); - this.unreaddb = Unread.db || UnreadIndex.db || new DataBoard('lastReadPosts'); - this.unreadEnabled = Conf['Remember Last Read Post']; - $.on(d, 'QRPostSuccessful', this.cb.post); - $.on(sc, 'click', this.toggleWatcher); - $.on(this.refreshButton, 'click', this.buttonFetchAll); - $.on(this.closeButton, 'click', this.toggleWatcher); - this.menu.addHeaderMenuEntry(); - $.onExists(doc, 'body', this.addDialog); - switch (g.VIEW) { - case 'index': - $.on(d, 'IndexUpdate', this.cb.onIndexUpdate); - break; - case 'thread': - $.on(d, 'ThreadUpdate', this.cb.onThreadRefresh); - } - if (Conf['Fixed Thread Watcher']) { - $.addClass(doc, 'fixed-watcher'); - } - if (!Conf['Persistent Thread Watcher']) { - $.addClass(ThreadWatcher.shortcut, 'disabled'); - this.dialog.hidden = true; - } - Header.addShortcut('watcher', sc, 510); - ThreadWatcher.initLastModified(); - ThreadWatcher.fetchAuto(); - $.on(window, 'visibilitychange focus', function() { - return $.queueTask(ThreadWatcher.fetchAuto); - }); - if (Conf['Menu'] && Index.enabled) { - Menu.menu.addEntry({ - el: $.el('a', { - href: 'javascript:;', - className: 'has-shortcut-text' - }, {innerHTML: "Alt+click"}), - order: 6, - open: function(arg) { - var thread; - thread = arg.thread; - if (Conf['Index Mode'] !== 'catalog') { - return false; - } - this.el.firstElementChild.textContent = ThreadWatcher.isWatched(thread) ? 'Unwatch' : 'Watch'; - if (this.cb) { - $.off(this.el, 'click', this.cb); - } - this.cb = function() { - $.event('CloseMenu'); - return ThreadWatcher.toggle(thread); - }; - $.on(this.el, 'click', this.cb); - return true; - } - }); - } - if ((ref = g.VIEW) !== 'index' && ref !== 'thread') { - return; - } - Callbacks.Post.push({ - name: 'Thread Watcher', - cb: this.node - }); - return Callbacks.CatalogThread.push({ - name: 'Thread Watcher', - cb: this.catalogNode - }); - }, - isWatched: function(thread) { - var ref; - return !!((ref = ThreadWatcher.db) != null ? ref.get({ - boardID: thread.board.ID, - threadID: thread.ID - }) : void 0); - }, - isWatchedRaw: function(boardID, threadID) { - var ref; - return !!((ref = ThreadWatcher.db) != null ? ref.get({ - boardID: boardID, - threadID: threadID - }) : void 0); - }, - setToggler: function(toggler, isWatched) { - toggler.classList.toggle('watched', isWatched); - return toggler.title = (isWatched ? 'Unwatch' : 'Watch') + " Thread"; - }, - node: function() { - var boardID, data, siteID, threadID, toggler; - if (this.isReply) { - return; - } - if (this.isClone) { - toggler = $('.watch-thread-link', this.nodes.info); - } else { - toggler = $.el('a', { - href: 'javascript:;', - className: 'watch-thread-link' - }); - $.before($('input', this.nodes.info), toggler); - } - siteID = g.SITE.ID; - boardID = this.board.ID; - threadID = this.thread.ID; - data = ThreadWatcher.db.get({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }); - ThreadWatcher.setToggler(toggler, !!data); - $.on(toggler, 'click', ThreadWatcher.cb.toggle); - if (data && (data.excerpt == null)) { - return $.queueTask((function(_this) { - return function() { - return ThreadWatcher.update(siteID, boardID, threadID, { - excerpt: Get.threadExcerpt(_this.thread) - }); - }; - })(this)); - } - }, - catalogNode: function() { - if (ThreadWatcher.isWatched(this.thread)) { - $.addClass(this.nodes.root, 'watched'); - } - return $.on(this.nodes.root, 'mousedown click', (function(_this) { - return function(e) { - if (!(e.button === 0 && e.altKey)) { - return; - } - if (e.type === 'click') { - ThreadWatcher.toggle(_this.thread); - } - return e.preventDefault(); - }; - })(this)); - }, - addDialog: function() { - if (!Main.isThisPageLegit()) { - return; - } - ThreadWatcher.build(); - return $.prepend(d.body, ThreadWatcher.dialog); - }, - toggleWatcher: function() { - $.toggleClass(ThreadWatcher.shortcut, 'disabled'); - return ThreadWatcher.dialog.hidden = !ThreadWatcher.dialog.hidden; - }, - cb: { - openAll: function() { - var a, j, len1, ref; - if ($.hasClass(this, 'disabled')) { - return; - } - ref = $$('a.watcher-link', ThreadWatcher.list); - for (j = 0, len1 = ref.length; j < len1; j++) { - a = ref[j]; - $.open(a.href); - } - return $.event('CloseMenu'); - }, - openUnread: function() { - var a, j, len1, ref; - if ($.hasClass(this, 'disabled')) { - return; - } - ref = $$('.replies-unread > a.watcher-link', ThreadWatcher.list); - for (j = 0, len1 = ref.length; j < len1; j++) { - a = ref[j]; - $.open(a.href); - } - return $.event('CloseMenu'); - }, - openDeads: function() { - var a, j, len1, ref; - if ($.hasClass(this, 'disabled')) { - return; - } - ref = $$('.dead-thread > a.watcher-link', ThreadWatcher.list); - for (j = 0, len1 = ref.length; j < len1; j++) { - a = ref[j]; - $.open(a.href); - } - return $.event('CloseMenu'); - }, - pruneDeads: function() { - var boardID, data, j, len1, ref, ref1, siteID, threadID; - if ($.hasClass(this, 'disabled')) { - return; - } - ref = ThreadWatcher.getAll(); - for (j = 0, len1 = ref.length; j < len1; j++) { - ref1 = ref[j], siteID = ref1.siteID, boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data; - if (data.isDead) { - ThreadWatcher.db["delete"]({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }); - } - } - ThreadWatcher.refresh(); - return $.event('CloseMenu'); - }, - dismiss: function() { - var boardID, data, j, len1, ref, ref1, siteID, threadID; - ref = ThreadWatcher.getAll(); - for (j = 0, len1 = ref.length; j < len1; j++) { - ref1 = ref[j], siteID = ref1.siteID, boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data; - if (data.quotingYou) { - ThreadWatcher.update(siteID, boardID, threadID, { - dismiss: data.quotingYou || 0 - }); - } - } - return $.event('CloseMenu'); - }, - toggle: function() { - var thread; - thread = Get.postFromNode(this).thread; - return ThreadWatcher.toggle(thread); - }, - rm: function() { - var boardID, ref, siteID, threadID; - siteID = this.parentNode.dataset.siteID; - ref = this.parentNode.dataset.fullID.split('.'), boardID = ref[0], threadID = ref[1]; - return ThreadWatcher.rm(siteID, boardID, +threadID); - }, - post: function(e) { - var boardID, cb, postID, ref, threadID; - ref = e.detail, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID; - cb = PostRedirect.delay(); - if (postID === threadID) { - if (Conf['Auto Watch']) { - return ThreadWatcher.addRaw(boardID, threadID, {}, cb); - } - } else if (Conf['Auto Watch Reply']) { - return ThreadWatcher.add(g.threads.get(boardID + '.' + threadID) || new Thread(threadID, g.boards[boardID] || new Board(boardID)), cb); - } - }, - onIndexUpdate: function(e) { - var boardID, data, db, nKilled, ref, ref1, siteID, threadID; - db = ThreadWatcher.db; - siteID = g.SITE.ID; - boardID = g.BOARD.ID; - nKilled = 0; - ref = db.data[siteID].boards[boardID]; - for (threadID in ref) { - data = ref[threadID]; - if (!(!(data != null ? data.isDead : void 0) && (ref1 = boardID + "." + threadID, indexOf.call(e.detail.threads, ref1) < 0))) { - continue; - } - if (!e.detail.threads.some(function(fullID) { - return +fullID.split('.')[1] > threadID; - })) { - continue; - } - if (Conf['Auto Prune'] || !(data && typeof data === 'object')) { - db["delete"]({ - boardID: boardID, - threadID: threadID - }); - nKilled++; - } else { - ThreadWatcher.fetchStatus({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - data: data - }); - } - } - if (nKilled) { - return ThreadWatcher.refresh(); - } - }, - onThreadRefresh: function(e) { - var thread; - thread = g.threads.get(e.detail.threadID); - if (!(e.detail[404] && ThreadWatcher.isWatched(thread))) { - return; - } - return ThreadWatcher.add(thread); - } - }, - requests: [], - fetched: 0, - fetch: function(url, arg, args, cb) { - var ajax, force, onloadend, ref, req, siteID; - siteID = arg.siteID, force = arg.force; - if (ThreadWatcher.requests.length === 0) { - ThreadWatcher.status.textContent = '...'; - $.addClass(ThreadWatcher.refreshButton, 'fa-spin'); - } - onloadend = function() { - if (this.finished) { - return; - } - this.finished = true; - ThreadWatcher.fetched++; - if (ThreadWatcher.fetched === ThreadWatcher.requests.length) { - ThreadWatcher.clearRequests(); - } else { - ThreadWatcher.status.textContent = (Math.round(ThreadWatcher.fetched / ThreadWatcher.requests.length * 100)) + "%"; - } - return cb.apply(this, args); - }; - ajax = siteID === g.SITE.ID ? $.ajax : CrossOrigin.ajax; - if (force) { - if ((ref = $.lastModified.ThreadWatcher) != null) { - delete ref[url]; - } - } - req = $.whenModified(url, 'ThreadWatcher', onloadend, { - timeout: $.MINUTE, - ajax: ajax - }); - return ThreadWatcher.requests.push(req); - }, - clearRequests: function() { - ThreadWatcher.requests = []; - ThreadWatcher.fetched = 0; - ThreadWatcher.status.textContent = ''; - return $.rmClass(ThreadWatcher.refreshButton, 'fa-spin'); - }, - abort: function() { - var j, len1, ref, req; - delete ThreadWatcher.syncing; - ref = ThreadWatcher.requests; - for (j = 0, len1 = ref.length; j < len1; j++) { - req = ref[j]; - if (!(!req.finished)) { - continue; - } - req.finished = true; - req.abort(); - } - return ThreadWatcher.clearRequests(); - }, - initLastModified: function() { - var base, boardID, boards, data, date, lm, ref, ref1, siteID, url; - lm = ((base = $.lastModified)['ThreadWatcher'] || (base['ThreadWatcher'] = $.dict())); - ref = ThreadWatcher.dbLM.data; - for (siteID in ref) { - boards = ref[siteID]; - ref1 = boards.boards; - for (boardID in ref1) { - data = ref1[boardID]; - if (ThreadWatcher.db.get({ - siteID: siteID, - boardID: boardID - })) { - for (url in data) { - date = data[url]; - lm[url] = date; - } - } else { - ThreadWatcher.dbLM["delete"]({ - siteID: siteID, - boardID: boardID - }); - } - } - } - }, - fetchAuto: function() { - var db, interval, now, ref; - clearTimeout(ThreadWatcher.timeout); - if (!Conf['Auto Update Thread Watcher']) { - return; - } - db = ThreadWatcher.db; - interval = Conf['Show Page'] || (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) ? 5 * $.MINUTE : 2 * $.HOUR; - now = Date.now(); - if (!((now - interval < (ref = db.data.lastChecked || 0) && ref <= now) || d.hidden || !d.hasFocus())) { - ThreadWatcher.fetchAllStatus(interval); - } - return ThreadWatcher.timeout = setTimeout(ThreadWatcher.fetchAuto, interval); - }, - buttonFetchAll: function() { - if (ThreadWatcher.syncing || ThreadWatcher.requests.length) { - return ThreadWatcher.abort(); - } else { - return ThreadWatcher.fetchAllStatus(); - } - }, - fetchAllStatus: function(interval) { - var dbi, dbs, j, len1, n, results; - if (interval == null) { - interval = 0; - } - ThreadWatcher.status.textContent = '...'; - $.addClass(ThreadWatcher.refreshButton, 'fa-spin'); - ThreadWatcher.syncing = true; - dbs = [ThreadWatcher.db, ThreadWatcher.unreaddb, QuoteYou.db].filter(function(x) { - return x; - }); - n = 0; - results = []; - for (j = 0, len1 = dbs.length; j < len1; j++) { - dbi = dbs[j]; - results.push(dbi.forceSync(function() { - var board, boards, db, deep, k, len2, now, ref, ref1; - if ((++n) === dbs.length) { - if (!ThreadWatcher.syncing) { - return; - } - delete ThreadWatcher.syncing; - if (!((0 <= (ref = Date.now() - (ThreadWatcher.db.data.lastChecked || 0)) && ref < interval))) { - db = ThreadWatcher.db; - now = Date.now(); - deep = !((now - 2 * $.HOUR < (ref1 = db.data.lastChecked2 || 0) && ref1 <= now)); - boards = ThreadWatcher.getAll(true); - for (k = 0, len2 = boards.length; k < len2; k++) { - board = boards[k]; - ThreadWatcher.fetchBoard(board, deep); - } - db.setLastChecked(); - if (deep) { - db.setLastChecked('lastChecked2'); - } - } - if (ThreadWatcher.fetched === ThreadWatcher.requests.length) { - return ThreadWatcher.clearRequests(); - } - } - })); - } - return results; - }, - fetchBoard: function(board, deep) { - var base, boardID, data, force, j, len1, ref, site, siteID, thread, url, urlF; - if (!board.some(function(thread) { - return !thread.data.isDead; - })) { - return; - } - force = false; - for (j = 0, len1 = board.length; j < len1; j++) { - thread = board[j]; - data = thread.data; - if (!data.isDead && data.last !== -1) { - if (Conf['Show Page'] && (data.page == null)) { - force = true; - } - if (data.modified == null) { - force = thread.force = true; - } - } - } - ref = board[0], siteID = ref.siteID, boardID = ref.boardID; - site = g.sites[siteID]; - if (!site) { - return; - } - urlF = deep && site.threadModTimeIgnoresSage ? 'catalogJSON' : 'threadsListJSON'; - url = typeof (base = site.urls)[urlF] === "function" ? base[urlF]({ - siteID: siteID, - boardID: boardID - }) : void 0; - if (!url) { - return; - } - return ThreadWatcher.fetch(url, { - siteID: siteID, - force: force - }, [board, url], ThreadWatcher.parseBoard); - }, - parseBoard: function(board, url) { - var base, boardID, data, i, index, item, j, k, l, lastPage, len1, len2, len3, len4, lmDate, m, modified, nThreads, oldest, page, pageLength, ref, ref1, ref2, ref3, ref4, replies, siteID, thread, threadID, threads; - if (this.status !== 200) { - return; - } - ref = board[0], siteID = ref.siteID, boardID = ref.boardID; - lmDate = this.getResponseHeader('Last-Modified'); - ThreadWatcher.dbLM.extend({ - siteID: siteID, - boardID: boardID, - val: $.item(url, lmDate) - }); - threads = $.dict(); - pageLength = 0; - nThreads = 0; - oldest = null; - try { - pageLength = ((ref1 = this.response[0]) != null ? ref1.threads.length : void 0) || 0; - ref2 = this.response; - for (i = j = 0, len1 = ref2.length; j < len1; i = ++j) { - page = ref2[i]; - ref3 = page.threads; - for (k = 0, len2 = ref3.length; k < len2; k++) { - item = ref3[k]; - threads[item.no] = { - page: i + 1, - index: nThreads, - modified: item.last_modified, - replies: item.replies - }; - nThreads++; - if ((oldest == null) || item.no < oldest) { - oldest = item.no; - } - } - } - } catch (error) { - for (l = 0, len3 = board.length; l < len3; l++) { - thread = board[l]; - ThreadWatcher.fetchStatus(thread); - } - } - for (m = 0, len4 = board.length; m < len4; m++) { - thread = board[m]; - threadID = thread.threadID, data = thread.data; - if (threads[threadID]) { - ref4 = threads[threadID], page = ref4.page, index = ref4.index, modified = ref4.modified, replies = ref4.replies; - if (Conf['Show Page']) { - lastPage = (typeof (base = g.sites[siteID]).isPrunedByAge === "function" ? base.isPrunedByAge({ - siteID: siteID, - boardID: boardID - }) : void 0) ? threadID === oldest : index >= nThreads - pageLength; - ThreadWatcher.update(siteID, boardID, threadID, { - page: page, - lastPage: lastPage - }); - } - if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) { - if (modified !== data.modified || ((replies != null) && replies !== data.replies)) { - (thread.newData || (thread.newData = {})).modified = modified; - ThreadWatcher.fetchStatus(thread); - } - } - } else { - ThreadWatcher.fetchStatus(thread); - } - } - }, - fetchStatus: function(thread) { - var base, boardID, data, force, ref, siteID, threadID, url; - siteID = thread.siteID, boardID = thread.boardID, threadID = thread.threadID, data = thread.data, force = thread.force; - url = (ref = g.sites[siteID]) != null ? typeof (base = ref.urls).threadJSON === "function" ? base.threadJSON({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }) : void 0 : void 0; - if (!url) { - return; - } - if (data.isDead && !force) { - return; - } - if (data.last === -1) { - return; - } - return ThreadWatcher.fetch(url, { - siteID: siteID, - force: force - }, [thread], ThreadWatcher.parseStatus); - }, - parseStatus: function(thread, isArchiveURL) { - var archiveURL, base, boardID, data, force, isArchived, isDead, j, last, lastReadPost, len1, match, newData, postObj, quotesYou, quotingYou, ref, ref1, ref2, ref3, regexp, replies, site, siteID, threadID, unread, youOP; - siteID = thread.siteID, boardID = thread.boardID, threadID = thread.threadID, data = thread.data, newData = thread.newData, force = thread.force; - site = g.sites[siteID]; - if (this.status === 200 && this.response) { - last = this.response.posts[this.response.posts.length - 1].no; - replies = this.response.posts.length - 1; - isDead = isArchived = !!(this.response.posts[0].archived || isArchiveURL); - if (isDead && Conf['Auto Prune']) { - ThreadWatcher.rm(siteID, boardID, threadID); - return; - } - if (last === data.last && isDead === data.isDead && isArchived === data.isArchived) { - return; - } - lastReadPost = ThreadWatcher.unreaddb.get({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - defaultValue: 0 - }); - unread = data.unread || 0; - quotingYou = data.quotingYou || 0; - youOP = !!((ref = QuoteYou.db) != null ? ref.get({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - postID: threadID - }) : void 0); - ref1 = this.response.posts; - for (j = 0, len1 = ref1.length; j < len1; j++) { - postObj = ref1[j]; - if (!(postObj.no > (data.last || 0) && postObj.no > lastReadPost)) { - continue; - } - if ((ref2 = QuoteYou.db) != null ? ref2.get({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - postID: postObj.no - }) : void 0) { - continue; - } - quotesYou = false; - if (!Conf['Require OP Quote Link'] && youOP) { - quotesYou = true; - } else if (QuoteYou.db && postObj.com) { - regexp = site.regexp.quotelinkHTML; - regexp.lastIndex = 0; - while ((match = regexp.exec(postObj.com))) { - if (QuoteYou.db.get({ - siteID: siteID, - boardID: match[1] ? encodeURIComponent(match[1]) : boardID, - threadID: match[2] || threadID, - postID: match[3] || match[2] || threadID - })) { - quotesYou = true; - break; - } - } - } - if (!unread || (!quotingYou && quotesYou)) { - if (Filter.isHidden(site.Build.parseJSON(postObj, { - siteID: siteID, - boardID: boardID - }))) { - continue; - } - } - unread++; - if (quotesYou) { - quotingYou = postObj.no; - } - } - newData || (newData = {}); - $.extend(newData, { - last: last, - replies: replies, - isDead: isDead, - isArchived: isArchived, - unread: unread, - quotingYou: quotingYou - }); - return ThreadWatcher.update(siteID, boardID, threadID, newData); - } else if (this.status === 404) { - archiveURL = (ref3 = g.sites[siteID]) != null ? typeof (base = ref3.urls).archivedThreadJSON === "function" ? base.archivedThreadJSON({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }) : void 0 : void 0; - if (!isArchiveURL && archiveURL) { - return ThreadWatcher.fetch(archiveURL, { - siteID: siteID, - force: force - }, [thread, true], ThreadWatcher.parseStatus); - } else if (site.mayLackJSON && (data.last == null)) { - return ThreadWatcher.update(siteID, boardID, threadID, { - last: -1 - }); - } else { - return ThreadWatcher.update(siteID, boardID, threadID, { - isDead: true - }); - } - } - }, - getAll: function(groupByBoard) { - var all, boardID, boards, cont, data, ref, ref1, siteID, threadID, threads; - all = []; - ref = ThreadWatcher.db.data; - for (siteID in ref) { - boards = ref[siteID]; - ref1 = boards.boards; - for (boardID in ref1) { - threads = ref1[boardID]; - if (Conf['Current Board'] && (siteID !== g.SITE.ID || boardID !== g.BOARD.ID)) { - continue; - } - if (groupByBoard) { - all.push((cont = [])); - } - for (threadID in threads) { - data = threads[threadID]; - if (data && typeof data === 'object') { - (groupByBoard ? cont : all).push({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - data: data - }); - } - } - } - } - return all; - }, - makeLine: function(siteID, boardID, threadID, data) { - var count, div, excerpt, fullID, isArchived, link, page, ref, title, x; - x = $.el('a', { - className: 'fa fa-times', - href: 'javascript:;' - }); - $.on(x, 'click', ThreadWatcher.cb.rm); - excerpt = data.excerpt, isArchived = data.isArchived; - excerpt || (excerpt = "/" + boardID + "/ - No." + threadID); - if (Conf['Show Site Prefix']) { - excerpt = ThreadWatcher.prefixes[siteID] + excerpt; - } - link = $.el('a', { - href: ((ref = g.sites[siteID]) != null ? ref.urls.thread({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }, isArchived) : void 0) || '', - title: excerpt, - className: 'watcher-link' - }); - if (Conf['Show Page'] && (data.page != null)) { - page = $.el('span', { - textContent: "[" + data.page + "]", - className: 'watcher-page' - }); - $.add(link, page); - } - if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count'] && (data.unread != null)) { - count = $.el('span', { - textContent: "(" + data.unread + ")", - className: 'watcher-unread' - }); - $.add(link, count); - } - title = $.el('span', { - textContent: excerpt, - className: 'watcher-title' - }); - $.add(link, title); - div = $.el('div'); - fullID = boardID + "." + threadID; - div.dataset.fullID = fullID; - div.dataset.siteID = siteID; - if (g.VIEW === 'thread' && fullID === (g.BOARD + "." + g.THREADID)) { - $.addClass(div, 'current'); - } - if (data.isDead) { - $.addClass(div, 'dead-thread'); - } - if (Conf['Show Page']) { - if (data.lastPage) { - $.addClass(div, 'last-page'); - } - if (data.page != null) { - div.dataset.page = data.page; - } - } - if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) { - if (data.unread === 0) { - $.addClass(div, 'replies-read'); - } - if (data.unread) { - $.addClass(div, 'replies-unread'); - } - if ((data.quotingYou || 0) > (data.dismiss || 0)) { - $.addClass(div, 'replies-quoting-you'); - } - } - $.add(div, [x, $.tn(' '), link]); - return div; - }, - setPrefixes: function(threads) { - var conflicts, conflicts2, j, k, len, len1, len2, prefix, prefixes, siteID, siteID2; - prefixes = $.dict(); - for (j = 0, len1 = threads.length; j < len1; j++) { - siteID = threads[j].siteID; - if (siteID in prefixes) { - continue; - } - len = 0; - prefix = ''; - conflicts = Object.keys(prefixes); - while (conflicts.length > 0) { - len++; - prefix = siteID.slice(0, len); - conflicts2 = []; - for (k = 0, len2 = conflicts.length; k < len2; k++) { - siteID2 = conflicts[k]; - if (siteID2.slice(0, len) === prefix) { - conflicts2.push(siteID2); - } else if (prefixes[siteID2].length < len) { - prefixes[siteID2] = siteID2.slice(0, len); - } - } - conflicts = conflicts2; - } - prefixes[siteID] = prefix; - } - return ThreadWatcher.prefixes = prefixes; - }, - build: function() { - var boardID, data, j, len1, list, nodes, ref, siteID, thread, threadID, threads; - nodes = []; - threads = ThreadWatcher.getAll(); - ThreadWatcher.setPrefixes(threads); - for (j = 0, len1 = threads.length; j < len1; j++) { - ref = threads[j], siteID = ref.siteID, boardID = ref.boardID, threadID = ref.threadID, data = ref.data; - if ((data.excerpt == null) && siteID === g.SITE.ID && (thread = g.threads.get(boardID + "." + threadID)) && thread.OP) { - ThreadWatcher.db.extend({ - boardID: boardID, - threadID: threadID, - val: { - excerpt: Get.threadExcerpt(thread) - } - }); - } - nodes.push(ThreadWatcher.makeLine(siteID, boardID, threadID, data)); - } - list = ThreadWatcher.list; - $.rmAll(list); - $.add(list, nodes); - return ThreadWatcher.refreshIcon(); - }, - refresh: function() { - ThreadWatcher.build(); - g.threads.forEach(function(thread) { - var isWatched, j, len1, post, ref, toggler; - isWatched = ThreadWatcher.isWatched(thread); - if (thread.OP) { - ref = [thread.OP].concat(slice.call(thread.OP.clones)); - for (j = 0, len1 = ref.length; j < len1; j++) { - post = ref[j]; - if ((toggler = $('.watch-thread-link', post.nodes.info))) { - ThreadWatcher.setToggler(toggler, isWatched); - } - } - } - if (thread.catalogView) { - return thread.catalogView.nodes.root.classList.toggle('watched', isWatched); - } - }); - if (Conf['Pin Watched Threads']) { - return $.event('SortIndex', { - deferred: Conf['Index Mode'] !== 'catalog' - }); - } - }, - refreshIcon: function() { - var className, j, len1, ref; - ref = ['replies-unread', 'replies-quoting-you']; - for (j = 0, len1 = ref.length; j < len1; j++) { - className = ref[j]; - ThreadWatcher.shortcut.classList.toggle(className, !!$("." + className, ThreadWatcher.dialog)); - } - }, - update: function(siteID, boardID, threadID, newData) { - var data, j, key, len1, line, n, newLine, ref, ref1, val; - if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }) : void 0)) { - return; - } - if (newData.isDead && Conf['Auto Prune']) { - ThreadWatcher.rm(siteID, boardID, threadID); - return; - } - if (newData.isDead || newData.last === -1) { - ref1 = ['isArchived', 'page', 'lastPage', 'unread', 'quotingyou']; - for (j = 0, len1 = ref1.length; j < len1; j++) { - key = ref1[j]; - if (!(key in newData)) { - newData[key] = void 0; - } - } - } - if ((newData.last != null) && newData.last < data.last) { - newData.modified = void 0; - } - n = 0; - for (key in newData) { - val = newData[key]; - if (data[key] !== val) { - n++; - } - } - if (!n) { - return; - } - ThreadWatcher.db.extend({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - val: newData - }); - if ((line = $("#watched-threads > [data-site-i-d='" + siteID + "'][data-full-i-d='" + boardID + "." + threadID + "']", ThreadWatcher.dialog))) { - newLine = ThreadWatcher.makeLine(siteID, boardID, threadID, data); - $.replace(line, newLine); - return ThreadWatcher.refreshIcon(); - } else { - return ThreadWatcher.refresh(); - } - }, - set404: function(boardID, threadID, cb) { - var data, ref; - if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({ - boardID: boardID, - threadID: threadID - }) : void 0)) { - return cb(); - } - if (Conf['Auto Prune']) { - ThreadWatcher.db["delete"]({ - boardID: boardID, - threadID: threadID - }); - return cb(); - } - if (data.isDead && !((data.isArchived != null) || (data.page != null) || (data.lastPage != null) || (data.unread != null) || (data.quotingYou != null))) { - return cb(); - } - return ThreadWatcher.db.extend({ - boardID: boardID, - threadID: threadID, - val: { - isDead: true, - isArchived: void 0, - page: void 0, - lastPage: void 0, - unread: void 0, - quotingYou: void 0 - } - }, cb); - }, - toggle: function(thread) { - var boardID, siteID, threadID; - siteID = g.SITE.ID; - boardID = thread.board.ID; - threadID = thread.ID; - if (ThreadWatcher.db.get({ - boardID: boardID, - threadID: threadID - })) { - return ThreadWatcher.rm(siteID, boardID, threadID); - } else { - return ThreadWatcher.add(thread); - } - }, - add: function(thread, cb) { - var boardID, data, siteID, threadID; - data = {}; - siteID = g.SITE.ID; - boardID = thread.board.ID; - threadID = thread.ID; - if (thread.isDead) { - if (Conf['Auto Prune'] && ThreadWatcher.db.get({ - boardID: boardID, - threadID: threadID - })) { - ThreadWatcher.rm(siteID, boardID, threadID, cb); - return; - } - data.isDead = true; - } - if (thread.OP) { - data.excerpt = Get.threadExcerpt(thread); - } - return ThreadWatcher.addRaw(boardID, threadID, data, cb); - }, - addRaw: function(boardID, threadID, data, cb) { - var oldData, thread; - oldData = ThreadWatcher.db.get({ - boardID: boardID, - threadID: threadID, - defaultValue: $.dict() - }); - delete oldData.last; - delete oldData.modified; - $.extend(oldData, data); - ThreadWatcher.db.set({ - boardID: boardID, - threadID: threadID, - val: oldData - }, cb); - ThreadWatcher.refresh(); - thread = { - siteID: g.SITE.ID, - boardID: boardID, - threadID: threadID, - data: data, - force: true - }; - if (Conf['Show Page'] && !data.isDead) { - return ThreadWatcher.fetchBoard([thread]); - } else if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) { - return ThreadWatcher.fetchStatus(thread); - } - }, - rm: function(siteID, boardID, threadID, cb) { - ThreadWatcher.db["delete"]({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }, cb); - return ThreadWatcher.refresh(); - }, - menu: { - init: function() { - var menu; - if (!Conf['Thread Watcher']) { - return; - } - menu = this.menu = new UI.Menu('thread watcher'); - $.on($('.menu-button', ThreadWatcher.dialog), 'click', function(e) { - return menu.toggle(e, this, ThreadWatcher); - }); - return this.addMenuEntries(); - }, - addHeaderMenuEntry: function() { - var entryEl; - if (g.VIEW !== 'thread') { - return; - } - entryEl = $.el('a', { - href: 'javascript:;' - }); - Header.menu.addEntry({ - el: entryEl, - order: 60, - open: function() { - var addClass, ref, rmClass, text; - ref = !!ThreadWatcher.db.get({ - boardID: g.BOARD.ID, - threadID: g.THREADID - }) ? ['unwatch-thread', 'watch-thread', 'Unwatch thread'] : ['watch-thread', 'unwatch-thread', 'Watch thread'], addClass = ref[0], rmClass = ref[1], text = ref[2]; - $.addClass(entryEl, addClass); - $.rmClass(entryEl, rmClass); - entryEl.textContent = text; - return true; - } - }); - return $.on(entryEl, 'click', function() { - return ThreadWatcher.toggle(g.threads.get(g.BOARD + "." + g.THREADID)); - }); - }, - addMenuEntries: function() { - var cb, conf, entries, entry, j, len1, name, open, ref, ref1, text, title; - entries = []; - entries.push({ - text: 'Open all threads', - cb: ThreadWatcher.cb.openAll, - open: function() { - this.el.classList.toggle('disabled', !ThreadWatcher.list.firstElementChild); - return true; - } - }); - entries.push({ - text: 'Open unread threads', - cb: ThreadWatcher.cb.openUnread, - open: function() { - this.el.classList.toggle('disabled', !$('.replies-unread', ThreadWatcher.list)); - return true; - } - }); - entries.push({ - text: 'Open dead threads', - cb: ThreadWatcher.cb.openDeads, - open: function() { - this.el.classList.toggle('disabled', !$('.dead-thread', ThreadWatcher.list)); - return true; - } - }); - entries.push({ - text: 'Prune dead threads', - cb: ThreadWatcher.cb.pruneDeads, - open: function() { - this.el.classList.toggle('disabled', !$('.dead-thread', ThreadWatcher.list)); - return true; - } - }); - entries.push({ - text: 'Dismiss posts quoting you', - title: 'Unhighlight the thread watcher icon and threads until there are new replies quoting you.', - cb: ThreadWatcher.cb.dismiss, - open: function() { - this.el.classList.toggle('disabled', !$.hasClass(ThreadWatcher.shortcut, 'replies-quoting-you')); - return true; - } - }); - for (j = 0, len1 = entries.length; j < len1; j++) { - ref = entries[j], text = ref.text, title = ref.title, cb = ref.cb, open = ref.open; - entry = { - el: $.el('a', { - textContent: text, - href: 'javascript:;' - }) - }; - if (title) { - entry.el.title = title; - } - $.on(entry.el, 'click', cb); - entry.open = open.bind(entry); - this.menu.addEntry(entry); - } - ref1 = Config.threadWatcher; - for (name in ref1) { - conf = ref1[name]; - this.addCheckbox(name, conf[1]); - } - }, - addCheckbox: function(name, desc) { - var entry, input; - entry = { - type: 'thread watcher', - el: UI.checkbox(name, name.replace(' Thread Watcher', '')) - }; - entry.el.title = desc; - input = entry.el.firstElementChild; - if (name === 'Show Unread Count' && !ThreadWatcher.unreadEnabled) { - input.disabled = true; - $.addClass(entry.el, 'disabled'); - entry.el.title += '\n[Remember Last Read Post is disabled.]'; - } - $.on(input, 'change', $.cb.checked); - if (name === 'Current Board' || name === 'Show Page' || name === 'Show Unread Count' || name === 'Show Site Prefix') { - $.on(input, 'change', ThreadWatcher.refresh); - } - if (name === 'Show Page' || name === 'Show Unread Count' || name === 'Auto Update Thread Watcher') { - $.on(input, 'change', ThreadWatcher.fetchAuto); - } - return this.menu.addEntry(entry); - } - } - }; - - return ThreadWatcher; - -}).call(this); - -Unread = (function() { - var Unread; - - Unread = { - init: function() { - if (!(g.VIEW === 'thread' && (Conf['Unread Count'] || Conf['Unread Favicon'] || Conf['Unread Line'] || Conf['Remember Last Read Post'] || Conf['Desktop Notifications'] || Conf['Quote Threading']))) { - return; - } - if (Conf['Remember Last Read Post']) { - $.sync('Remember Last Read Post', function(enabled) { - return Conf['Remember Last Read Post'] = enabled; - }); - this.db = new DataBoard('lastReadPosts', this.sync); - } - this.hr = $.el('hr', { - id: 'unread-line', - className: 'unread-line' - }); - this.posts = new Set(); - this.postsQuotingYou = new Set(); - this.order = new RandomAccessList(); - this.position = null; - Callbacks.Thread.push({ - name: 'Unread', - cb: this.node - }); - return Callbacks.Post.push({ - name: 'Unread', - cb: this.addPost - }); - }, - node: function() { - var ID, j, len, ref, ref1, resetLink; - Unread.thread = this; - Unread.title = d.title; - Unread.lastReadPost = ((ref = Unread.db) != null ? ref.get({ - boardID: this.board.ID, - threadID: this.ID - }) : void 0) || 0; - Unread.readCount = 0; - ref1 = this.posts.keys; - for (j = 0, len = ref1.length; j < len; j++) { - ID = ref1[j]; - if (+ID <= Unread.lastReadPost) { - Unread.readCount++; - } - } - $.one(d, '4chanXInitFinished', Unread.ready); - $.on(d, 'PostsInserted', Unread.onUpdate); - $.on(d, 'ThreadUpdate', function(e) { - if (e.detail[404]) { - return Unread.update(); - } - }); - resetLink = $.el('a', { - href: 'javascript:;', - className: 'unread-reset', - textContent: 'Mark all unread' - }); - $.on(resetLink, 'click', Unread.reset); - return Header.menu.addEntry({ - el: resetLink, - order: 70 - }); - }, - ready: function() { - if (Conf['Remember Last Read Post'] && Conf['Scroll to Last Read Post']) { - Unread.scroll(); - } - Unread.setLine(true); - Unread.read(); - Unread.update(); - $.on(d, 'scroll visibilitychange', Unread.read); - if (Conf['Unread Line']) { - return $.on(d, 'visibilitychange', Unread.setLine); - } - }, - positionPrev: function() { - if (Unread.position) { - return Unread.position.prev; - } else { - return Unread.order.last; - } - }, - scroll: function() { - var bottom, hash, position; - if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) { - return; - } - position = Unread.positionPrev(); - while (position) { - bottom = position.data.nodes.bottom; - if (!bottom.getBoundingClientRect().height) { - position = position.prev; - } else { - Header.scrollToIfNeeded(bottom, true); - break; - } - } - }, - reset: function() { - if (Unread.lastReadPost == null) { - return; - } - Unread.posts = new Set(); - Unread.postsQuotingYou = new Set(); - Unread.order = new RandomAccessList(); - Unread.position = null; - Unread.lastReadPost = 0; - Unread.readCount = 0; - Unread.thread.posts.forEach(function(post) { - return Unread.addPost.call(post); - }); - $.forceSync('Remember Last Read Post'); - if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) { - Unread.db.set({ - boardID: Unread.thread.board.ID, - threadID: Unread.thread.ID, - val: 0 - }); - } - Unread.updatePosition(); - Unread.setLine(); - return Unread.update(); - }, - sync: function() { - var ID, i, j, lastReadPost, postIDs, ref, ref1; - if (Unread.lastReadPost == null) { - return; - } - lastReadPost = Unread.db.get({ - boardID: Unread.thread.board.ID, - threadID: Unread.thread.ID, - defaultValue: 0 - }); - if (!(Unread.lastReadPost < lastReadPost)) { - return; - } - Unread.lastReadPost = lastReadPost; - postIDs = Unread.thread.posts.keys; - for (i = j = ref = Unread.readCount, ref1 = postIDs.length; j < ref1; i = j += 1) { - ID = +postIDs[i]; - if (!Unread.thread.posts.get(ID).isFetchedQuote) { - if (ID > Unread.lastReadPost) { - break; - } - Unread.posts["delete"](ID); - Unread.postsQuotingYou["delete"](ID); - } - Unread.readCount++; - } - Unread.updatePosition(); - Unread.setLine(); - return Unread.update(); - }, - addPost: function() { - if (this.isFetchedQuote || this.isClone) { - return; - } - Unread.order.push(this); - if (this.ID <= Unread.lastReadPost || this.isHidden || QuoteYou.isYou(this)) { - return; - } - Unread.posts.add((Unread.posts.last = this.ID)); - Unread.addPostQuotingYou(this); - return Unread.position != null ? Unread.position : Unread.position = Unread.order[this.ID]; - }, - addPostQuotingYou: function(post) { - var j, len, quotelink, ref, ref1; - ref = post.nodes.quotelinks; - for (j = 0, len = ref.length; j < len; j++) { - quotelink = ref[j]; - if (!((ref1 = QuoteYou.db) != null ? ref1.get(Get.postDataFromLink(quotelink)) : void 0)) { - continue; - } - Unread.postsQuotingYou.add((Unread.postsQuotingYou.last = post.ID)); - Unread.openNotification(post); - return; - } - }, - openNotification: function(post, predicate) { - var notif; - if (predicate == null) { - predicate = ' replied to you'; - } - if (!Header.areNotificationsEnabled) { - return; - } - notif = new Notification("" + post.info.nameBlock + predicate, { - body: post.commentDisplay(), - icon: Favicon.logo - }); - notif.onclick = function() { - Header.scrollToIfNeeded(post.nodes.bottom, true); - return window.focus(); - }; - return notif.onshow = function() { - return setTimeout(function() { - return notif.close(); - }, 7 * $.SECOND); - }; - }, - onUpdate: function() { - return $.queueTask(function() { - Unread.setLine(); - Unread.read(); - return Unread.update(); - }); - }, - readSinglePost: function(post) { - var ID; - ID = post.ID; - if (!Unread.posts.has(ID)) { - return; - } - Unread.posts["delete"](ID); - Unread.postsQuotingYou["delete"](ID); - Unread.updatePosition(); - Unread.saveLastReadPost(); - return Unread.update(); - }, - read: $.debounce(100, function(e) { - var ID, bottom, count, data, ref; - if (!Unread.posts.size && Unread.readCount !== Unread.thread.posts.keys.length) { - Unread.saveLastReadPost(); - } - if (d.hidden || !Unread.posts.size) { - return; - } - count = 0; - while (Unread.position) { - ref = Unread.position, ID = ref.ID, data = ref.data; - bottom = data.nodes.bottom; - if (!(!bottom.getBoundingClientRect().height || Header.getBottomOf(bottom) > -1)) { - break; - } - count++; - Unread.posts["delete"](ID); - Unread.postsQuotingYou["delete"](ID); - Unread.position = Unread.position.next; - } - if (!count) { - return; - } - Unread.updatePosition(); - Unread.saveLastReadPost(); - if (e) { - return Unread.update(); - } - }), - updatePosition: function() { - while (Unread.position && !Unread.posts.has(Unread.position.ID)) { - Unread.position = Unread.position.next; - } - }, - saveLastReadPost: $.debounce(2 * $.SECOND, function() { - var ID, i, j, postIDs, ref, ref1; - $.forceSync('Remember Last Read Post'); - if (!(Conf['Remember Last Read Post'] && Unread.db)) { - return; - } - postIDs = Unread.thread.posts.keys; - for (i = j = ref = Unread.readCount, ref1 = postIDs.length; j < ref1; i = j += 1) { - ID = +postIDs[i]; - if (!Unread.thread.posts.get(ID).isFetchedQuote) { - if (Unread.posts.has(ID)) { - break; - } - Unread.lastReadPost = ID; - } - Unread.readCount++; - } - if (Unread.thread.isDead && !Unread.thread.isArchived) { - return; - } - return Unread.db.set({ - boardID: Unread.thread.board.ID, - threadID: Unread.thread.ID, - val: Unread.lastReadPost - }); - }), - setLine: function(force) { - var node, oldPosition, ref; - if (!Conf['Unread Line']) { - return; - } - if (Unread.hr.hidden || d.hidden || (force === true)) { - oldPosition = Unread.linePosition; - if ((Unread.linePosition = Unread.positionPrev())) { - if (Unread.linePosition !== oldPosition) { - node = Unread.linePosition.data.nodes.bottom; - if (((ref = node.nextSibling) != null ? ref.tagName : void 0) === 'BR') { - node = node.nextSibling; - } - $.after(node, Unread.hr); - } - } else { - $.rm(Unread.hr); - } - } - return Unread.hr.hidden = Unread.linePosition === Unread.order.last; - }, - update: function() { - var count, countQuotingYou, isDead, titleCount, titleDead, titleQuotingYou; - count = Unread.posts.size; - countQuotingYou = Unread.postsQuotingYou.size; - if (Conf['Unread Count']) { - titleQuotingYou = Conf['Quoted Title'] && countQuotingYou ? '(!) ' : ''; - titleCount = count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : ''; - titleDead = Unread.thread.isDead ? Unread.title.replace('-', (Unread.thread.isArchived ? '- Archived -' : '- 404 -')) : Unread.title; - d.title = "" + titleQuotingYou + titleCount + titleDead; - } - Unread.saveThreadWatcherCount(); - if (Conf['Unread Favicon'] && g.SITE.software === 'yotsuba') { - isDead = Unread.thread.isDead; - return Favicon.set((countQuotingYou ? (isDead ? 'unreadDeadY' : 'unreadY') : count ? (isDead ? 'unreadDead' : 'unread') : (isDead ? 'dead' : 'default'))); - } - }, - saveThreadWatcherCount: $.debounce(2 * $.SECOND, function() { - var i, j, posts, quotingYou, ref; - $.forceSync('Remember Last Read Post'); - if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) { - quotingYou = !Conf['Require OP Quote Link'] && QuoteYou.isYou(Unread.thread.OP) ? Unread.posts : Unread.postsQuotingYou; - if (!quotingYou.size) { - quotingYou.last = 0; - } else if (!quotingYou.has(quotingYou.last)) { - quotingYou.last = 0; - posts = Unread.thread.posts.keys; - for (i = j = ref = posts.length - 1; j >= 0; i = j += -1) { - if (quotingYou.has(+posts[i])) { - quotingYou.last = posts[i]; - break; - } - } - } - return ThreadWatcher.update(g.SITE.ID, Unread.thread.board.ID, Unread.thread.ID, { - last: Unread.thread.lastPost, - isDead: Unread.thread.isDead, - isArchived: Unread.thread.isArchived, - unread: Unread.posts.size, - quotingYou: quotingYou.last || 0 - }); - } - }) - }; - - return Unread; - -}).call(this); - -UnreadIndex = (function() { - var UnreadIndex; - - UnreadIndex = { - lastReadPost: $.dict(), - hr: $.dict(), - markReadLink: $.dict(), - init: function() { - if (!(g.VIEW === 'index' && Conf['Remember Last Read Post'] && Conf['Unread Line in Index'])) { - return; - } - this.enabled = true; - this.db = new DataBoard('lastReadPosts', this.sync); - Callbacks.Thread.push({ - name: 'Unread Line in Index', - cb: this.node - }); - $.on(d, 'IndexRefreshInternal', this.onIndexRefresh); - return $.on(d, 'PostsInserted PostsRemoved', this.onPostsInserted); - }, - node: function() { - UnreadIndex.lastReadPost[this.fullID] = UnreadIndex.db.get({ - boardID: this.board.ID, - threadID: this.ID - }) || 0; - if (!Index.enabled) { - return UnreadIndex.update(this); - } - }, - onIndexRefresh: function(e) { - var i, len, ref, results, thread, threadID; - if (e.detail.isCatalog) { - return; - } - ref = e.detail.threadIDs; - results = []; - for (i = 0, len = ref.length; i < len; i++) { - threadID = ref[i]; - thread = g.threads.get(threadID); - results.push(UnreadIndex.update(thread)); - } - return results; - }, - onPostsInserted: function(e) { - var ref, ref1, thread, wasVisible; - if (e.target === Index.root) { - return; - } - thread = Get.threadFromNode(e.target); - if (!thread || thread.nodes.root !== e.target) { - return; - } - wasVisible = !!((ref = UnreadIndex.hr[thread.fullID]) != null ? ref.parentNode : void 0); - UnreadIndex.update(thread); - if (Conf['Scroll to Last Read Post'] && e.type === 'PostsInserted' && !wasVisible && !!((ref1 = UnreadIndex.hr[thread.fullID]) != null ? ref1.parentNode : void 0)) { - return Header.scrollToIfNeeded(UnreadIndex.hr[thread.fullID], true); - } - }, - sync: function() { - return g.threads.forEach(function(thread) { - var lastReadPost, ref; - lastReadPost = UnreadIndex.db.get({ - boardID: thread.board.ID, - threadID: thread.ID - }) || 0; - if (lastReadPost !== UnreadIndex.lastReadPost[thread.fullID]) { - UnreadIndex.lastReadPost[thread.fullID] = lastReadPost; - if ((ref = thread.nodes.root) != null ? ref.parentNode : void 0) { - return UnreadIndex.update(thread); - } - } - }); - }, - update: function(thread) { - var divider, firstUnread, hasUnread, hr, lastReadPost, link, repliesRead, repliesShown; - lastReadPost = UnreadIndex.lastReadPost[thread.fullID]; - repliesShown = 0; - repliesRead = 0; - firstUnread = null; - thread.posts.forEach(function(post) { - if (post.isReply && thread.nodes.root.contains(post.nodes.root)) { - repliesShown++; - if (post.ID <= lastReadPost) { - return repliesRead++; - } else if ((!firstUnread || post.ID < firstUnread.ID) && !post.isHidden && !QuoteYou.isYou(post)) { - return firstUnread = post; - } - } - }); - hr = UnreadIndex.hr[thread.fullID]; - if (firstUnread && (repliesRead || (lastReadPost === thread.OP.ID && (!$(g.SITE.selectors.summary, thread.nodes.root) || thread.ID in ExpandThread.statuses)))) { - if (!hr) { - hr = UnreadIndex.hr[thread.fullID] = $.el('hr', { - className: 'unread-line' - }); - } - $.before(firstUnread.nodes.root, hr); - } else { - $.rm(hr); - } - hasUnread = repliesShown ? firstUnread || !repliesRead : Index.enabled ? thread.lastPost > lastReadPost : thread.OP.ID > lastReadPost; - thread.nodes.root.classList.toggle('unread-thread', hasUnread); - link = UnreadIndex.markReadLink[thread.fullID]; - if (!link) { - link = UnreadIndex.markReadLink[thread.fullID] = $.el('a', { - className: 'unread-mark-read brackets-wrap', - href: 'javascript:;', - textContent: 'Mark Read' - }); - $.on(link, 'click', UnreadIndex.markRead); - } - if ((divider = $(g.SITE.selectors.threadDivider, thread.nodes.root))) { - return $.before(divider, link); - } else { - return $.add(thread.nodes.root, link); - } - }, - markRead: function() { - var thread; - thread = Get.threadFromNode(this); - UnreadIndex.lastReadPost[thread.fullID] = thread.lastPost; - UnreadIndex.db.set({ - boardID: thread.board.ID, - threadID: thread.ID, - val: thread.lastPost - }); - $.rm(UnreadIndex.hr[thread.fullID]); - thread.nodes.root.classList.remove('unread-thread'); - return ThreadWatcher.update(g.SITE.ID, thread.board.ID, thread.ID, { - last: thread.lastPost, - unread: 0, - quotingYou: 0 - }); - } - }; - - return UnreadIndex; - -}).call(this); - -Captcha = {}; - -(function() { - Captcha.cache = { - init: function() { - $.on(d, 'SaveCaptcha', (function(_this) { - return function(e) { - return _this.saveAPI(e.detail); - }; - })(this)); - return $.on(d, 'NoCaptcha', (function(_this) { - return function(e) { - return _this.noCaptcha(e.detail); - }; - })(this)); - }, - captchas: [], - getCount: function() { - return this.captchas.length; - }, - neededRaw: function() { - return !(this.haveCookie() || this.captchas.length || QR.req || this.submitCB) && (QR.posts.length > 1 || Conf['Auto-load captcha'] || !QR.posts[0].isOnlyQuotes() || QR.posts[0].file); - }, - needed: function() { - return this.neededRaw() && $.event('LoadCaptcha'); - }, - prerequest: function() { - if (!Conf['Prerequest Captcha']) { - return; - } - return $.queueTask((function(_this) { - return function() { - var isReply; - if (!_this.prerequested && _this.neededRaw() && !$.event('LoadCaptcha') && !QR.captcha.occupied() && QR.cooldown.seconds <= 60 && QR.selected === QR.posts[QR.posts.length - 1] && !QR.selected.isOnlyQuotes()) { - isReply = QR.selected.thread !== 'new'; - if (!$.event('RequestCaptcha', { - isReply: isReply - })) { - _this.prerequested = true; - _this.submitCB = function(captcha) { - if (captcha) { - return _this.save(captcha); - } - }; - return _this.updateCount(); - } - } - }; - })(this)); - }, - haveCookie: function() { - return /\b_ct=/.test(d.cookie) && QR.posts[0].thread !== 'new'; - }, - getOne: function() { - var captcha; - delete this.prerequested; - this.clear(); - if ((captcha = this.captchas.shift())) { - this.count(); - return captcha; - } else { - return null; - } - }, - request: function(isReply) { - if (!this.submitCB) { - if ($.event('RequestCaptcha', { - isReply: isReply - })) { - return; - } - } - return (function(_this) { - return function(cb) { - _this.submitCB = cb; - return _this.updateCount(); - }; - })(this); - }, - abort: function() { - if (this.submitCB) { - delete this.submitCB; - $.event('AbortCaptcha'); - return this.updateCount(); - } - }, - saveAPI: function(captcha) { - var cb; - if ((cb = this.submitCB)) { - delete this.submitCB; - cb(captcha); - return this.updateCount(); - } else { - return this.save(captcha); - } - }, - noCaptcha: function(detail) { - var cb; - if ((cb = this.submitCB)) { - if (!this.haveCookie() || (detail != null ? detail.error : void 0)) { - QR.error((detail != null ? detail.error : void 0) || 'Failed to retrieve captcha.'); - QR.captcha.setup(d.activeElement === QR.nodes.status); - } - delete this.submitCB; - cb(); - return this.updateCount(); - } - }, - save: function(captcha) { - var cb; - if ((cb = this.submitCB)) { - this.abort(); - cb(captcha); - return; - } - this.captchas.push(captcha); - this.captchas.sort(function(a, b) { - return a.timeout - b.timeout; - }); - return this.count(); - }, - clear: function() { - var captcha, i, j, len, now, ref; - if (this.captchas.length) { - now = Date.now(); - ref = this.captchas; - for (i = j = 0, len = ref.length; j < len; i = ++j) { - captcha = ref[i]; - if (captcha.timeout > now) { - break; - } - } - if (i) { - this.captchas = this.captchas.slice(i); - return this.count(); - } - } - }, - count: function() { - clearTimeout(this.timer); - if (this.captchas.length) { - this.timer = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now()); - } - return this.updateCount(); - }, - updateCount: function() { - return $.event('CaptchaCount', this.captchas.length); - } - }; - -}).call(this); - -(function() { - Captcha.replace = { - init: function() { - var ref; - if (!(g.SITE.software === 'yotsuba' && d.cookie.indexOf('pass_enabled=1') < 0)) { - return; - } - if (Conf['Force Noscript Captcha'] && Main.jsEnabled) { - $.ready(Captcha.replace.noscript); - return; - } - if (Conf['captchaLanguage'].trim()) { - if ((ref = location.hostname) === 'boards.4chan.org' || ref === 'boards.4channel.org') { - return $.onExists(doc, '#captchaFormPart', function(node) { - return $.onExists(node, 'iframe[src^="https://www.google.com/recaptcha/"]', Captcha.replace.iframe); - }); - } else { - return $.onExists(doc, 'iframe[src^="https://www.google.com/recaptcha/"]', Captcha.replace.iframe); - } - } - }, - noscript: function() { - var insert, noscript, original, span, toggle; - if (!((original = $('#g-recaptcha')) && (noscript = $('noscript', original.parentNode)))) { - return; - } - span = $.el('span', { - id: 'captcha-forced-noscript' - }); - $.replace(noscript, span); - $.rm(original); - insert = function() { - span.innerHTML = noscript.textContent; - return Captcha.replace.iframe($('iframe[src^="https://www.google.com/recaptcha/"]', span)); - }; - if ((toggle = $('#togglePostFormLink a, #form-link'))) { - return $.on(toggle, 'click', insert); - } else { - return insert(); - } - }, - iframe: function(iframe) { - var lang, src; - if ((lang = Conf['captchaLanguage'].trim())) { - src = /[?&]hl=/.test(iframe.src) ? iframe.src.replace(/([?&]hl=)[^&]*/, '$1' + encodeURIComponent(lang)) : iframe.src + ("&hl=" + (encodeURIComponent(lang))); - if (iframe.src !== src) { - iframe.src = src; - } - } - } - }; - -}).call(this); - -(function() { - Captcha.t = { - init: function() { - var root; - if (d.cookie.indexOf('pass_enabled=1') >= 0) { - return; - } - if (!(this.isEnabled = !!$('#t-root') || !$.id('postForm'))) { - return; - } - root = $.el('div', { - className: 'captcha-root' - }); - this.nodes = { - root: root - }; - $.addClass(QR.nodes.el, 'has-captcha', 'captcha-t'); - return $.after(QR.nodes.com.parentNode, root); - }, - moreNeeded: function() {}, - getThread: function() { - var boardID, threadID; - boardID = g.BOARD.ID; - if (QR.posts[0].thread === 'new') { - threadID = '0'; - } else { - threadID = '' + QR.posts[0].thread; - } - return { - boardID: boardID, - threadID: threadID - }; - }, - setup: function(focus) { - if (!this.isEnabled) { - return; - } - if (!this.nodes.container) { - this.nodes.container = $.el('div', { - className: 'captcha-container' - }); - $.prepend(this.nodes.root, this.nodes.container); - Captcha.t.currentThread = Captcha.t.getThread(); - $.global(function() { - var el; - el = document.querySelector('#qr .captcha-container'); - window.TCaptcha.init(el, this.boardID, +this.threadID); - return window.TCaptcha.setErrorCb(function(err) { - return window.dispatchEvent(new CustomEvent('CreateNotification', { - detail: { - type: 'warning', - content: '' + err - } - })); - }); - }, Captcha.t.currentThread); - } - if (focus) { - return $('#t-resp').focus(); - } - }, - destroy: function() { - if (!(this.isEnabled && this.nodes.container)) { - return; - } - $.global(function() { - return window.TCaptcha.destroy(); - }); - $.rm(this.nodes.container); - return delete this.nodes.container; - }, - updateThread: function() { - var boardID, newThread, ref, threadID; - if (!this.isEnabled) { - return; - } - ref = Captcha.t.currentThread || {}, boardID = ref.boardID, threadID = ref.threadID; - newThread = Captcha.t.getThread(); - if (!(newThread.boardID === boardID && newThread.threadID === threadID)) { - Captcha.t.destroy(); - return Captcha.t.setup(); - } - }, - getOne: function() { - var el, i, key, len, ref, response; - response = {}; - if (this.nodes.container) { - ref = ['t-response', 't-challenge']; - for (i = 0, len = ref.length; i < len; i++) { - key = ref[i]; - response[key] = $("[name='" + key + "']", this.nodes.container).value; - } - } - if (!response['t-response'] && !((el = $('#t-msg')) && /Verification not required/i.test(el.textContent))) { - response = null; - } - return response; - }, - setUsed: function() { - if (!this.isEnabled) { - return; - } - if (this.nodes.container) { - return $.global(function() { - return window.TCaptcha.clearChallenge(); - }); - } - }, - occupied: function() { - return !!this.nodes.container; - } - }; - -}).call(this); - -(function() { - var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Captcha.v2 = { - lifetime: 2 * $.MINUTE, - init: function() { - var counter, root; - if (d.cookie.indexOf('pass_enabled=1') >= 0) { - return; - } - if (!(this.isEnabled = !!$('#g-recaptcha, #captcha-forced-noscript') || !$.id('postForm'))) { - return; - } - if ((this.noscript = Conf['Force Noscript Captcha'] || !Main.jsEnabled)) { - $.addClass(QR.nodes.el, 'noscript-captcha'); - } - Captcha.cache.init(); - $.on(d, 'CaptchaCount', this.count.bind(this)); - root = $.el('div', { - className: 'captcha-root' - }); - $.extend(root, {innerHTML: "
      "}); - counter = $('.captcha-counter > a', root); - this.nodes = { - root: root, - counter: counter - }; - this.count(); - $.addClass(QR.nodes.el, 'has-captcha', 'captcha-v2'); - $.after(QR.nodes.com.parentNode, root); - $.on(counter, 'click', this.toggle.bind(this)); - $.on(counter, 'keydown', (function(_this) { - return function(e) { - if (Keybinds.keyCode(e) !== 'Space') { - return; - } - _this.toggle(); - e.preventDefault(); - return e.stopPropagation(); - }; - })(this)); - return $.on(window, 'captcha:success', (function(_this) { - return function() { - return $.queueTask(function() { - return _this.save(false); - }); - }; - })(this)); - }, - timeouts: {}, - prevNeeded: 0, - noscriptURL: function() { - var lang, url; - url = 'https://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc'; - if ((lang = Conf['captchaLanguage'].trim())) { - url += "&hl=" + (encodeURIComponent(lang)); - } - return url; - }, - moreNeeded: function() { - return $.queueTask((function(_this) { - return function() { - var needed; - needed = Captcha.cache.needed(); - if (needed && !_this.prevNeeded) { - _this.setup(QR.cooldown.auto && d.activeElement === QR.nodes.status); - } - return _this.prevNeeded = needed; - }; - })(this)); - }, - toggle: function() { - if (this.nodes.container && !this.timeouts.destroy) { - return this.destroy(); - } else { - return this.setup(true, true); - } - }, - setup: function(focus, force) { - if (!(this.isEnabled && (Captcha.cache.needed() || force))) { - return; - } - if (focus) { - $.addClass(QR.nodes.el, 'focus'); - this.nodes.counter.focus(); - } - if (this.timeouts.destroy) { - clearTimeout(this.timeouts.destroy); - delete this.timeouts.destroy; - return this.reload(); - } - if (this.nodes.container) { - $.queueTask((function(_this) { - return function() { - var iframe; - if (_this.nodes.container && d.activeElement === _this.nodes.counter && (iframe = $('iframe[src^="https://www.google.com/recaptcha/"]', _this.nodes.container))) { - iframe.focus(); - return QR.focus(); - } - }; - })(this)); - return; - } - this.nodes.container = $.el('div', { - className: 'captcha-container' - }); - $.prepend(this.nodes.root, this.nodes.container); - new MutationObserver(this.afterSetup.bind(this)).observe(this.nodes.container, { - childList: true, - subtree: true - }); - if (this.noscript) { - return this.setupNoscript(); - } else { - return this.setupJS(); - } - }, - setupNoscript: function() { - var div, iframe, textarea; - iframe = $.el('iframe', { - id: 'qr-captcha-iframe', - scrolling: 'no', - src: this.noscriptURL() - }); - div = $.el('div'); - textarea = $.el('textarea'); - $.add(div, textarea); - return $.add(this.nodes.container, [iframe, div]); - }, - setupJS: function() { - return $.global(function() { - var cbNative, render, script; - render = function() { - var classList, container; - classList = document.documentElement.classList; - container = document.querySelector('#qr .captcha-container'); - return container.dataset.widgetID = window.grecaptcha.render(container, { - sitekey: '6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc', - theme: classList.contains('tomorrow') || classList.contains('spooky') || classList.contains('dark-captcha') ? 'dark' : 'light', - callback: function(response) { - return window.dispatchEvent(new CustomEvent('captcha:success', { - detail: response - })); - } - }); - }; - if (window.grecaptcha) { - return render(); - } else { - cbNative = window.onRecaptchaLoaded; - window.onRecaptchaLoaded = function() { - render(); - return cbNative(); - }; - if (!document.head.querySelector('script[src^="https://www.google.com/recaptcha/api.js"]')) { - script = document.createElement('script'); - script.src = 'https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoaded&render=explicit'; - return document.head.appendChild(script); - } - } - }); - }, - afterSetup: function(mutations) { - var i, iframe, j, len, len1, mutation, node, ref, textarea; - for (i = 0, len = mutations.length; i < len; i++) { - mutation = mutations[i]; - ref = mutation.addedNodes; - for (j = 0, len1 = ref.length; j < len1; j++) { - node = ref[j]; - if ((iframe = $.x('./descendant-or-self::iframe[starts-with(@src, "https://www.google.com/recaptcha/")]', node))) { - this.setupIFrame(iframe); - } - if ((textarea = $.x('./descendant-or-self::textarea', node))) { - this.setupTextArea(textarea); - } - } - } - }, - setupIFrame: function(iframe) { - var ref, ref1; - if (!doc.contains(iframe)) { - return; - } - Captcha.replace.iframe(iframe); - $.addClass(QR.nodes.el, 'captcha-open'); - this.fixQRPosition(); - $.on(iframe, 'load', this.fixQRPosition); - if (d.activeElement === this.nodes.counter) { - iframe.focus(); - } - if (((ref = $.engine) === 'blink' || ref === 'edge') && (ref1 = iframe.parentNode, indexOf.call($$('#qr .captcha-container > div > div:first-of-type'), ref1) >= 0)) { - return $.on(iframe.parentNode, 'scroll', function() { - return this.scrollTop = 0; - }); - } - }, - fixQRPosition: function() { - if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) { - QR.nodes.el.style.top = ''; - return QR.nodes.el.style.bottom = '0px'; - } - }, - setupTextArea: function(textarea) { - return $.one(textarea, 'input', (function(_this) { - return function() { - return _this.save(true); - }; - })(this)); - }, - destroy: function() { - if (!this.isEnabled) { - return; - } - delete this.timeouts.destroy; - $.rmClass(QR.nodes.el, 'captcha-open'); - if (this.nodes.container) { - $.global(function() { - var container; - container = document.querySelector('#qr .captcha-container'); - return window.grecaptcha.reset(container.dataset.widgetID); - }); - $.rm(this.nodes.container); - return delete this.nodes.container; - } - }, - getOne: function(isReply) { - return Captcha.cache.getOne(isReply); - }, - save: function(pasted, token) { - var base, focus, ref; - Captcha.cache.save({ - response: token || $('textarea', this.nodes.container).value, - timeout: Date.now() + this.lifetime - }); - focus = ((ref = d.activeElement) != null ? ref.nodeName : void 0) === 'IFRAME' && /https?:\/\/www\.google\.com\/recaptcha\//.test(d.activeElement.src); - if (Captcha.cache.needed()) { - if (focus) { - if (QR.cooldown.auto || Conf['Post on Captcha Completion']) { - this.nodes.counter.focus(); - } else { - QR.nodes.status.focus(); - } - } - this.reload(); - } else { - if (pasted) { - this.destroy(); - } else { - if ((base = this.timeouts).destroy == null) { - base.destroy = setTimeout(this.destroy.bind(this), 3 * $.SECOND); - } - } - if (focus) { - QR.nodes.status.focus(); - } - } - if (Conf['Post on Captcha Completion'] && !QR.cooldown.auto) { - return QR.submit(); - } - }, - count: function() { - var count, loading; - count = Captcha.cache.getCount(); - loading = Captcha.cache.submitCB ? '...' : ''; - this.nodes.counter.textContent = "Captchas: " + count + loading; - return this.moreNeeded(); - }, - reload: function() { - if ($('iframe[src^="https://www.google.com/recaptcha/api/fallback?"]', this.nodes.container)) { - this.destroy(); - return this.setup(false, true); - } else { - return $.global(function() { - var container; - container = document.querySelector('#qr .captcha-container'); - return window.grecaptcha.reset(container.dataset.widgetID); - }); - } - }, - occupied: function() { - return !!this.nodes.container && !this.timeouts.destroy; - } - }; - -}).call(this); - -PassLink = (function() { - var PassLink; - - PassLink = { - init: function() { - if (!(g.SITE.software === 'yotsuba' && Conf['Pass Link'])) { - return; - } - return Main.ready(this.ready); - }, - ready: function() { - var passLink, styleSelector; - if (!(styleSelector = $.id('styleSelector'))) { - return; - } - passLink = $.el('span', { - className: 'brackets-wrap pass-link-container' - }); - $.extend(passLink, {innerHTML: "4chan Pass"}); - $.on(passLink.firstElementChild, 'click', function() { - return window.open("//sys." + (location.hostname.split('.')[1]) + ".org/auth", Date.now(), 'width=500,height=280,toolbar=0'); - }); - return $.before(styleSelector.previousSibling, [passLink, $.tn('\u00A0\u00A0')]); - } - }; - - return PassLink; - -}).call(this); - -PostRedirect = (function() { - var PostRedirect; - - PostRedirect = { - init: function() { - return $.on(d, 'QRPostSuccessful', (function(_this) { - return function(e) { - if (!e.detail.redirect) { - return; - } - _this.event = e; - _this.delays = 0; - return $.queueTask(function() { - if (e === _this.event && _this.delays === 0) { - return location.href = e.detail.redirect; - } - }); - }; - })(this)); - }, - delays: 0, - delay: function() { - var e; - if (!this.event) { - return null; - } - e = this.event; - this.delays++; - return (function(_this) { - return function() { - if (e !== _this.event) { - return; - } - _this.delays--; - if (_this.delays === 0) { - return location.href = e.detail.redirect; - } - }; - })(this); - } - }; - - return PostRedirect; - -}).call(this); - -PostSuccessful = (function() { - var PostSuccessful; - - PostSuccessful = { - init: function() { - if (!Conf['Remember Your Posts']) { - return; - } - return $.ready(this.ready); - }, - ready: function() { - var _, db, postID, ref, threadID; - if (d.title !== 'Post successful!') { - return; - } - ref = $('h1').nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref[0], threadID = ref[1], postID = ref[2]; - postID = +postID; - threadID = +threadID || postID; - db = new DataBoard('yourPosts'); - return db.set({ - boardID: g.BOARD.ID, - threadID: threadID, - postID: postID, - val: true - }); - } - }; - - return PostSuccessful; - -}).call(this); - -QR = (function() { - var QR, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - slice = [].slice; - - QR = { - mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/vnd.adobe.flash.movie', 'application/x-shockwave-flash', 'video/webm'], - validExtension: /\.(jpe?g|png|gif|pdf|swf|webm)$/i, - typeFromExtension: { - 'jpg': 'image/jpeg', - 'jpeg': 'image/jpeg', - 'png': 'image/png', - 'gif': 'image/gif', - 'pdf': 'application/pdf', - 'swf': 'application/vnd.adobe.flash.movie', - 'webm': 'video/webm' - }, - extensionFromType: { - 'image/jpeg': 'jpg', - 'image/png': 'png', - 'image/gif': 'gif', - 'application/pdf': 'pdf', - 'application/vnd.adobe.flash.movie': 'swf', - 'application/x-shockwave-flash': 'swf', - 'video/webm': 'webm' - }, - init: function() { - var sc; - if (!Conf['Quick Reply']) { - return; - } - this.posts = []; - $.on(d, '4chanXInitFinished', function() { - return BoardConfig.ready(QR.initReady); - }); - Callbacks.Post.push({ - name: 'Quick Reply', - cb: this.node - }); - this.shortcut = sc = $.el('a', { - className: 'fa fa-comment-o disabled', - textContent: 'QR', - title: 'Quick Reply', - href: 'javascript:;' - }); - $.on(sc, 'click', function() { - if (!QR.postingIsEnabled) { - return; - } - if (Conf['Persistent QR'] || !QR.nodes || QR.nodes.el.hidden) { - QR.open(); - return QR.nodes.com.focus(); - } else { - return QR.close(); - } - }); - return Header.addShortcut('qr', sc, 540); - }, - initReady: function() { - var captchaVersion, config, link, linkBot, navLinksBot, origToggle, prop; - captchaVersion = $('#g-recaptcha, #captcha-forced-noscript') ? 'v2' : 't'; - QR.captcha = Captcha[captchaVersion]; - QR.postingIsEnabled = true; - config = g.BOARD.config; - prop = function(key, def) { - var ref; - return +((ref = config[key]) != null ? ref : def); - }; - QR.min_width = prop('min_image_width', 1); - QR.min_height = prop('min_image_height', 1); - QR.max_width = QR.max_height = 10000; - QR.max_size = prop('max_filesize', 4194304); - QR.max_size_video = prop('max_webm_filesize', QR.max_size); - QR.max_comment = prop('max_comment_chars', 2000); - QR.max_width_video = QR.max_height_video = 2048; - QR.max_duration_video = prop('max_webm_duration', 120); - QR.forcedAnon = !!config.forced_anon; - QR.spoiler = !!config.spoilers; - if ((origToggle = $.id('togglePostFormLink'))) { - link = $.el('h1', { - className: "qr-link-container" - }); - $.extend(link, {innerHTML: "" + ((g.VIEW === "thread") ? "Reply to Thread" : "Start a Thread") + ""}); - QR.link = link.firstElementChild; - $.on(link.firstChild, 'click', function() { - QR.open(); - return QR.nodes.com.focus(); - }); - $.before(origToggle, link); - origToggle.firstElementChild.textContent = 'Original Form'; - } - if (g.VIEW === 'thread') { - linkBot = $.el('div', { - className: "brackets-wrap qr-link-container-bottom" - }); - $.extend(linkBot, {innerHTML: "Reply to Thread"}); - $.on(linkBot.firstElementChild, 'click', function() { - QR.open(); - return QR.nodes.com.focus(); - }); - if ((navLinksBot = $('.navLinksBot'))) { - $.prepend(navLinksBot, linkBot); - } - } - $.on(d, 'QRGetFile', QR.getFile); - $.on(d, 'QRDrawFile', QR.drawFile); - $.on(d, 'QRSetFile', QR.setFile); - $.on(d, 'paste', QR.paste); - $.on(d, 'dragover', QR.dragOver); - $.on(d, 'drop', QR.dropFile); - $.on(d, 'dragstart dragend', QR.drag); - $.on(d, 'IndexRefreshInternal', QR.generatePostableThreadsList); - $.on(d, 'ThreadUpdate', QR.statusCheck); - if (!Conf['Persistent QR']) { - return; - } - QR.open(); - if (Conf['Auto Hide QR']) { - return QR.hide(); - } - }, - statusCheck: function() { - var thread; - if (!QR.nodes) { - return; - } - thread = QR.posts[0].thread; - if (thread !== 'new' && g.threads.get(g.BOARD + "." + thread).isDead) { - return QR.abort(); - } else { - return QR.status(); - } - }, - node: function() { - $.on(this.nodes.quote, 'click', QR.quote); - if (this.isFetchedQuote) { - return QR.generatePostableThreadsList(); - } - }, - open: function() { - var err; - if (QR.nodes) { - if (QR.nodes.el.hidden) { - QR.captcha.setup(); - } - QR.nodes.el.hidden = false; - QR.unhide(); - } else { - try { - QR.dialog(); - } catch (error) { - err = error; - delete QR.nodes; - Main.handleErrors({ - message: 'Quick Reply dialog creation crashed.', - error: err - }); - return; - } - } - return $.rmClass(QR.shortcut, 'disabled'); - }, - close: function() { - var j, len, post, ref; - if (QR.req) { - QR.abort(); - return; - } - QR.nodes.el.hidden = true; - QR.cleanNotifications(); - QR.blur(); - $.rmClass(QR.nodes.el, 'dump'); - $.addClass(QR.shortcut, 'disabled'); - new QR.post(true); - ref = QR.posts.splice(0, QR.posts.length - 1); - for (j = 0, len = ref.length; j < len; j++) { - post = ref[j]; - post["delete"](); - } - QR.cooldown.auto = false; - QR.status(); - return QR.captcha.destroy(); - }, - focus: function() { - return $.queueTask(function() { - if (!QR.inBubble()) { - QR.hasFocus = d.activeElement && QR.nodes.el.contains(d.activeElement); - return QR.nodes.el.classList.toggle('focus', QR.hasFocus); - } - }); - }, - inBubble: function() { - var bubbles, ref; - bubbles = $$('iframe[src^="https://www.google.com/recaptcha/api2/frame"]'); - return (ref = d.activeElement, indexOf.call(bubbles, ref) >= 0) || bubbles.some(function(el) { - return getComputedStyle(el).visibility !== 'hidden' && el.getBoundingClientRect().bottom > 0; - }); - }, - hide: function() { - QR.blur(); - $.addClass(QR.nodes.el, 'autohide'); - return QR.nodes.autohide.checked = true; - }, - unhide: function() { - $.rmClass(QR.nodes.el, 'autohide'); - return QR.nodes.autohide.checked = false; - }, - toggleHide: function() { - if (this.checked) { - return QR.hide(); - } else { - return QR.unhide(); - } - }, - blur: function() { - if (QR.nodes.el.contains(d.activeElement)) { - return d.activeElement.blur(); - } - }, - toggleSJIS: function(e) { - e.preventDefault(); - Conf['sjisPreview'] = !Conf['sjisPreview']; - $.set('sjisPreview', Conf['sjisPreview']); - return QR.nodes.el.classList.toggle('sjis-preview', Conf['sjisPreview']); - }, - texPreviewShow: function() { - if ($.hasClass(QR.nodes.el, 'tex-preview')) { - return QR.texPreviewHide(); - } - $.addClass(QR.nodes.el, 'tex-preview'); - QR.nodes.texPreview.textContent = QR.nodes.com.value; - return $.event('mathjax', null, QR.nodes.texPreview); - }, - texPreviewHide: function() { - return $.rmClass(QR.nodes.el, 'tex-preview'); - }, - addPost: function() { - var wasOpen; - wasOpen = QR.nodes && !QR.nodes.el.hidden; - QR.open(); - if (wasOpen) { - $.addClass(QR.nodes.el, 'dump'); - new QR.post(true); - } - return QR.nodes.com.focus(); - }, - setCustomCooldown: function(enabled) { - Conf['customCooldownEnabled'] = enabled; - QR.cooldown.customCooldown = enabled; - return QR.nodes.customCooldown.classList.toggle('disabled', !enabled); - }, - toggleCustomCooldown: function() { - var enabled; - enabled = $.hasClass(QR.nodes.customCooldown, 'disabled'); - QR.setCustomCooldown(enabled); - return $.set('customCooldownEnabled', enabled); - }, - error: function(err, focusOverride) { - var el, notice, notif; - QR.open(); - if (typeof err === 'string') { - el = $.tn(err); - } else { - el = err; - el.removeAttribute('style'); - } - notice = new Notice('warning', el); - QR.notifications.push(notice); - if (!Header.areNotificationsEnabled) { - if (d.hidden && !QR.cooldown.auto) { - return alert(el.textContent); - } - } else if (d.hidden || !(focusOverride || d.hasFocus())) { - notif = new Notification(el.textContent, { - body: el.textContent, - icon: Favicon.logo - }); - notif.onclick = function() { - return window.focus(); - }; - if ($.engine !== 'gecko') { - notif.onclose = function() { - return notice.close(); - }; - return notif.onshow = function() { - return setTimeout(function() { - notif.onclose = null; - return notif.close(); - }, 7 * $.SECOND); - }; - } - } - }, - connectionError: function() { - return $.el('span', {innerHTML: "Connection error while posting. [More info]"}); - }, - notifications: [], - cleanNotifications: function() { - var j, len, notification, ref; - ref = QR.notifications; - for (j = 0, len = ref.length; j < len; j++) { - notification = ref[j]; - notification.close(); - } - return QR.notifications = []; - }, - status: function() { - var disabled, status, thread, value; - if (!QR.nodes) { - return; - } - thread = QR.posts[0].thread; - if (thread !== 'new' && g.threads.get(g.BOARD + "." + thread).isDead) { - value = 'Dead'; - disabled = true; - QR.cooldown.auto = false; - } - value = QR.req ? QR.req.progress : QR.cooldown.seconds || value; - status = QR.nodes.status; - status.value = !value ? 'Submit' : QR.cooldown.auto ? "Auto " + value : value; - return status.disabled = disabled || false; - }, - openPost: function() { - var index; - QR.open(); - if (QR.selected.isLocked) { - index = QR.posts.indexOf(QR.selected); - (QR.posts[index + 1] || new QR.post()).select(); - $.addClass(QR.nodes.el, 'dump'); - return QR.cooldown.auto = true; - } - }, - quote: function(e) { - var ancestor, base, caretPos, com, frag, i, insideCode, j, k, l, len, len1, len2, len3, n, node, o, post, postRange, range, ref, ref1, ref2, ref3, ref4, ref5, ref6, root, sel, text, thread, wasOnlyQuotes; - if (e != null) { - e.preventDefault(); - } - if (!QR.postingIsEnabled) { - return; - } - sel = d.getSelection(); - post = Get.postFromNode(this); - root = post.nodes.root; - postRange = new Range(); - postRange.selectNode(root); - text = post.board.ID === g.BOARD.ID ? ">>" + post + "\n" : ">>>/" + post.board + "/" + post + "\n"; - for (i = j = 0, ref = sel.rangeCount; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) { - try { - range = sel.getRangeAt(i); - if (range.compareBoundaryPoints(Range.START_TO_START, postRange) < 0) { - range.setStartBefore(root); - } - if (range.compareBoundaryPoints(Range.END_TO_END, postRange) > 0) { - range.setEndAfter(root); - } - if (!range.toString().trim()) { - continue; - } - frag = range.cloneContents(); - ancestor = range.commonAncestorContainer; - if ($.x('ancestor-or-self::*[self::s or contains(@class,"removed-spoiler")]', ancestor)) { - $.prepend(frag, $.tn('[spoiler]')); - $.add(frag, $.tn('[/spoiler]')); - } - if (insideCode = $.x('ancestor-or-self::pre[contains(@class,"prettyprint")]', ancestor)) { - $.prepend(frag, $.tn('[code]')); - $.add(frag, $.tn('[/code]')); - } - ref1 = $$((insideCode ? 'br' : '.prettyprint br'), frag); - for (k = 0, len = ref1.length; k < len; k++) { - node = ref1[k]; - $.replace(node, $.tn('\n')); - } - ref2 = $$('br', frag); - for (l = 0, len1 = ref2.length; l < len1; l++) { - node = ref2[l]; - if (node !== frag.lastChild) { - $.replace(node, $.tn('\n>')); - } - } - if (typeof (base = g.SITE).insertTags === "function") { - base.insertTags(frag); - } - ref3 = $$('.linkify[data-original]', frag); - for (n = 0, len2 = ref3.length; n < len2; n++) { - node = ref3[n]; - $.replace(node, $.tn(node.dataset.original)); - } - ref4 = $$('.embedder', frag); - for (o = 0, len3 = ref4.length; o < len3; o++) { - node = ref4[o]; - if (((ref5 = node.previousSibling) != null ? ref5.nodeValue : void 0) === ' ') { - $.rm(node.previousSibling); - } - $.rm(node); - } - text += ">" + (frag.textContent.trim()) + "\n"; - } catch (error) {} - } - QR.openPost(); - ref6 = QR.nodes, com = ref6.com, thread = ref6.thread; - if (!com.value) { - thread.value = Get.threadFromNode(this); - } - wasOnlyQuotes = QR.selected.isOnlyQuotes(); - caretPos = com.selectionStart; - com.value = com.value.slice(0, caretPos) + text + com.value.slice(com.selectionEnd); - range = caretPos + text.length; - com.setSelectionRange(range, range); - com.focus(); - if (wasOnlyQuotes) { - QR.selected.quotedText = com.value; - } - QR.selected.save(com); - return QR.selected.save(thread); - }, - characterCount: function() { - var count, counter; - counter = QR.nodes.charCount; - count = QR.nodes.com.value.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, '_').length; - counter.textContent = count; - counter.hidden = count < QR.max_comment / 2; - return (count > QR.max_comment ? $.addClass : $.rmClass)(counter, 'warning'); - }, - getFile: function() { - var ref; - return $.event('QRFile', (ref = QR.selected) != null ? ref.file : void 0); - }, - drawFile: function(e) { - var el, file, isVideo, ref; - file = (ref = QR.selected) != null ? ref.file : void 0; - if (!(file && /^(image|video)\//.test(file.type))) { - return; - } - isVideo = /^video\//.test(file); - el = $.el((isVideo ? 'video' : 'img')); - $.on(el, 'error', function() { - return QR.openError(); - }); - $.on(el, (isVideo ? 'loadeddata' : 'load'), function() { - e.target.getContext('2d').drawImage(el, 0, 0); - URL.revokeObjectURL(el.src); - return $.event('QRImageDrawn', null, e.target); - }); - return el.src = URL.createObjectURL(file); - }, - openError: function() { - var div; - div = $.el('div'); - $.extend(div, {innerHTML: "Could not open file. [More info]"}); - return QR.error(div); - }, - setFile: function(e) { - var file, name, ref, source; - ref = e.detail, file = ref.file, name = ref.name, source = ref.source; - if (name != null) { - file.name = name; - } - if (source != null) { - file.source = source; - } - QR.open(); - return QR.handleFiles([file]); - }, - drag: function(e) { - var toggle; - toggle = e.type === 'dragstart' ? $.off : $.on; - toggle(d, 'dragover', QR.dragOver); - return toggle(d, 'drop', QR.dropFile); - }, - dragOver: function(e) { - e.preventDefault(); - return e.dataTransfer.dropEffect = 'copy'; - }, - dropFile: function(e) { - if (!e.dataTransfer.files.length) { - return; - } - e.preventDefault(); - QR.open(); - return QR.handleFiles(e.dataTransfer.files); - }, - paste: function(e) { - var blob, file, file2, item, j, len, ref, score, score2, type; - if (!e.clipboardData.items) { - return; - } - file = null; - score = -1; - ref = e.clipboardData.items; - for (j = 0, len = ref.length; j < len; j++) { - item = ref[j]; - if (!(item.kind === 'file' && (file2 = item.getAsFile()))) { - continue; - } - score2 = 2 * (file2.size <= QR.max_size) + (file2.type === 'image/png'); - if (score2 > score) { - file = file2; - score = score2; - } - } - if (file) { - type = file.type; - blob = new Blob([file], { - type: type - }); - blob.name = Conf['pastedname'] + "." + ($.getOwn(QR.extensionFromType, type) || 'jpg'); - QR.open(); - QR.handleFiles([blob]); - $.addClass(QR.nodes.el, 'dump'); - } - }, - pasteFF: function() { - var arr, blob, bstr, i, images, img, j, k, len, m, pasteArea, ref, src; - pasteArea = QR.nodes.pasteArea; - if (!pasteArea.childNodes.length) { - return; - } - images = $$('img', pasteArea); - $.rmAll(pasteArea); - for (j = 0, len = images.length; j < len; j++) { - img = images[j]; - src = img.src; - if (m = src.match(/data:(image\/(\w+));base64,(.+)/)) { - bstr = atob(m[3]); - arr = new Uint8Array(bstr.length); - for (i = k = 0, ref = bstr.length; 0 <= ref ? k < ref : k > ref; i = 0 <= ref ? ++k : --k) { - arr[i] = bstr.charCodeAt(i); - } - blob = new Blob([arr], { - type: m[1] - }); - blob.name = Conf['pastedname'] + "." + m[2]; - QR.handleFiles([blob]); - } else if (/^https?:\/\//.test(src)) { - QR.handleUrl(src); - } - } - }, - handleUrl: function(urlDefault) { - QR.open(); - QR.selected.preventAutoPost(); - return CrossOrigin.permission(function() { - var url; - url = prompt('Enter a URL:', urlDefault); - if (url === null) { - return; - } - QR.nodes.fileButton.focus(); - return CrossOrigin.file(url, function(blob) { - if (blob && !/^text\//.test(blob.type)) { - return QR.handleFiles([blob]); - } else { - return QR.error("Can't load file."); - } - }); - }); - }, - handleFiles: function(files) { - var file, j, len; - if (this !== QR) { - files = slice.call(this.files); - this.value = null; - } - if (!files.length) { - return; - } - QR.cleanNotifications(); - for (j = 0, len = files.length; j < len; j++) { - file = files[j]; - QR.handleFile(file, files.length); - } - if (files.length !== 1) { - $.addClass(QR.nodes.el, 'dump'); - } - if (d.activeElement === QR.nodes.fileButton && $.hasClass(QR.nodes.fileSubmit, 'has-file')) { - return QR.nodes.filename.focus(); - } - }, - handleFile: function(file, nfiles) { - var isText, post; - isText = /^text\//.test(file.type); - if (nfiles === 1) { - post = QR.selected; - } else { - post = QR.posts[QR.posts.length - 1]; - if ((isText ? post.com || post.pasting : post.file)) { - post = new QR.post(); - } - } - return post[isText ? 'pasteText' : 'setFile'](file); - }, - openFileInput: function() { - if (QR.nodes.fileButton.disabled) { - return; - } - QR.nodes.fileInput.click(); - return QR.nodes.fileButton.focus(); - }, - generatePostableThreadsList: function() { - var j, len, list, options, ref, thread, val; - if (!QR.nodes) { - return; - } - list = QR.nodes.thread; - options = [list.firstElementChild]; - ref = g.BOARD.threads.keys; - for (j = 0, len = ref.length; j < len; j++) { - thread = ref[j]; - options.push($.el('option', { - value: thread, - textContent: "Thread " + thread - })); - } - val = list.value; - $.rmAll(list); - $.add(list, options); - list.value = val; - if (list.value === val) { - return; - } - list.value = g.VIEW === 'thread' ? g.THREADID : 'new'; - return (g.VIEW === 'thread' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread'); - }, - dialog: function() { - var classList, config, dialog, event, i, items, name, node, nodes, save, setNode; - QR.nodes = nodes = { - el: dialog = UI.dialog('qr', {innerHTML: "
      ×
      No selected file
      "}) - }; - setNode = function(name, query) { - return nodes[name] = $(query, dialog); - }; - setNode('move', '.move'); - setNode('autohide', '#autohide'); - setNode('close', '.close'); - setNode('thread', 'select'); - setNode('form', 'form'); - setNode('sjisToggle', '#sjis-toggle'); - setNode('texButton', '#tex-preview-button'); - setNode('name', '[data-name=name]'); - setNode('email', '[data-name=email]'); - setNode('sub', '[data-name=sub]'); - setNode('com', '[data-name=com]'); - setNode('charCount', '#char-count'); - setNode('texPreview', '#tex-preview'); - setNode('dumpList', '#dump-list'); - setNode('addPost', '#add-post'); - setNode('oekaki', '.oekaki'); - setNode('drawButton', '#qr-draw-button'); - setNode('fileSubmit', '#file-n-submit'); - setNode('fileButton', '#qr-file-button'); - setNode('noFile', '#qr-no-file'); - setNode('filename', '#qr-filename'); - setNode('spoiler', '#qr-file-spoiler'); - setNode('oekakiButton', '#qr-oekaki-button'); - setNode('fileRM', '#qr-filerm'); - setNode('urlButton', '#url-button'); - setNode('pasteArea', '#paste-area'); - setNode('customCooldown', '#custom-cooldown-button'); - setNode('dumpButton', '#dump-button'); - setNode('status', '[type=submit]'); - setNode('flashTag', '[name=filetag]'); - setNode('fileInput', '[type=file]'); - config = g.BOARD.config; - classList = QR.nodes.el.classList; - classList.toggle('forced-anon', QR.forcedAnon); - classList.toggle('has-spoiler', QR.spoiler); - classList.toggle('has-sjis', !!config.sjis_tags); - classList.toggle('has-math', !!config.math_tags); - classList.toggle('sjis-preview', !!config.sjis_tags && Conf['sjisPreview']); - classList.toggle('show-new-thread-option', Conf['Show New Thread Option in Threads']); - if (parseInt(Conf['customCooldown'], 10) > 0) { - $.addClass(QR.nodes.fileSubmit, 'custom-cooldown'); - $.get('customCooldownEnabled', Conf['customCooldownEnabled'], function(arg) { - var customCooldownEnabled; - customCooldownEnabled = arg.customCooldownEnabled; - QR.setCustomCooldown(customCooldownEnabled); - return $.sync('customCooldownEnabled', QR.setCustomCooldown); - }); - } - QR.flagsInput(); - $.on(nodes.autohide, 'change', QR.toggleHide); - $.on(nodes.close, 'click', QR.close); - $.on(nodes.status, 'click', QR.submit); - $.on(nodes.form, 'submit', QR.submit); - $.on(nodes.sjisToggle, 'click', QR.toggleSJIS); - $.on(nodes.texButton, 'mousedown', QR.texPreviewShow); - $.on(nodes.texButton, 'mouseup', QR.texPreviewHide); - $.on(nodes.addPost, 'click', function() { - return new QR.post(true); - }); - $.on(nodes.drawButton, 'click', QR.oekaki.draw); - $.on(nodes.fileButton, 'click', QR.openFileInput); - $.on(nodes.noFile, 'click', QR.openFileInput); - $.on(nodes.filename, 'focus', function() { - return $.addClass(this.parentNode, 'focus'); - }); - $.on(nodes.filename, 'blur', function() { - return $.rmClass(this.parentNode, 'focus'); - }); - $.on(nodes.spoiler, 'change', function() { - return QR.selected.nodes.spoiler.click(); - }); - $.on(nodes.oekakiButton, 'click', QR.oekaki.button); - $.on(nodes.fileRM, 'click', function() { - return QR.selected.rmFile(); - }); - $.on(nodes.urlButton, 'click', function() { - return QR.handleUrl(''); - }); - $.on(nodes.customCooldown, 'click', QR.toggleCustomCooldown); - $.on(nodes.dumpButton, 'click', function() { - return nodes.el.classList.toggle('dump'); - }); - $.on(nodes.fileInput, 'change', QR.handleFiles); - window.addEventListener('focus', QR.focus, true); - window.addEventListener('blur', QR.focus, true); - $.on(d, 'click', QR.focus); - if ($.engine === 'gecko' && !window.DataTransferItemList) { - nodes.pasteArea.hidden = false; - } - new MutationObserver(QR.pasteFF).observe(nodes.pasteArea, { - childList: true - }); - items = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'flag']; - i = 0; - save = function() { - return QR.selected.save(this); - }; - while (name = items[i++]) { - if (!(node = nodes[name])) { - continue; - } - event = node.nodeName === 'SELECT' ? 'change' : 'input'; - $.on(nodes[name], event, save); - } - if ($.engine === 'gecko' && Conf['Remember QR Size']) { - $.get('QR Size', '', function(item) { - return nodes.com.style.cssText = item['QR Size']; - }); - $.on(nodes.com, 'mouseup', function(e) { - if (e.button !== 0) { - return; - } - return $.set('QR Size', this.style.cssText); - }); - } - QR.generatePostableThreadsList(); - QR.persona.load(); - new QR.post(true); - QR.status(); - QR.cooldown.setup(); - QR.captcha.init(); - $.add(d.body, dialog); - QR.captcha.setup(); - QR.oekaki.setup(); - return $.event('QRDialogCreation', null, dialog); - }, - flags: function() { - var addFlag, ref, select, textContent, value; - select = $.el('select', { - name: 'flag', - className: 'flagSelector' - }); - addFlag = function(value, textContent) { - return $.add(select, $.el('option', { - value: value, - textContent: textContent - })); - }; - addFlag('0', (g.BOARD.config.country_flags ? 'Geographic Location' : 'None')); - ref = g.BOARD.config.board_flags; - for (value in ref) { - textContent = ref[value]; - addFlag(value, textContent); - } - return select; - }, - flagsInput: function() { - var flag, nodes; - nodes = QR.nodes; - if (!nodes) { - return; - } - if (nodes.flag) { - $.rm(nodes.flag); - delete nodes.flag; - } - if (g.BOARD.config.board_flags) { - flag = QR.flags(); - flag.dataset.name = 'flag'; - flag.dataset["default"] = '0'; - nodes.flag = flag; - return $.add(nodes.form, flag); - } - }, - submit: function(e) { - var captcha, cb, err, filetag, force, formData, options, post, ref, thread, threadID; - if (e != null) { - e.preventDefault(); - } - force = e != null ? e.shiftKey : void 0; - if (QR.req) { - QR.abort(); - return; - } - $.forceSync('cooldowns'); - if (QR.cooldown.seconds) { - if (force) { - QR.cooldown.clear(); - } else { - QR.cooldown.auto = !QR.cooldown.auto; - QR.status(); - return; - } - } - post = QR.posts[0]; - delete post.quotedText; - post.forceSave(); - threadID = post.thread; - thread = g.BOARD.threads.get(threadID); - if (g.BOARD.ID === 'f' && threadID === 'new') { - filetag = QR.nodes.flashTag.value; - } - if (threadID === 'new') { - threadID = null; - if (!!g.BOARD.config.require_subject && !post.sub) { - err = 'New threads require a subject.'; - } else if (!(!!g.BOARD.config.text_only || post.file)) { - err = 'No file selected.'; - } - } else if (g.BOARD.threads.get(threadID).isClosed) { - err = 'You can\'t reply to this thread anymore.'; - } else if (!(post.com || post.file)) { - err = 'No comment or file.'; - } else if (post.file && thread.fileLimit) { - err = 'Max limit of image replies has been reached.'; - } - if (g.BOARD.ID === 'r9k' && !((ref = post.com) != null ? ref.match(/[a-z-]/i) : void 0)) { - err || (err = 'Original comment required.'); - } - if (QR.captcha.isEnabled && !(QR.captcha === Captcha.v2 && /\b_ct=/.test(d.cookie) && threadID) && !(err && !force)) { - captcha = QR.captcha.getOne(!!threadID); - if (QR.captcha === Captcha.v2) { - captcha || (captcha = Captcha.cache.request(!!threadID)); - } - if (!captcha) { - err = 'No valid captcha.'; - QR.captcha.setup(!QR.cooldown.auto || d.activeElement === QR.nodes.status); - } - } - QR.cleanNotifications(); - if (err && !force) { - QR.cooldown.auto = false; - QR.status(); - QR.error(err); - return; - } - QR.cooldown.auto = QR.posts.length > 1; - post.lock(); - formData = { - MAX_FILE_SIZE: QR.max_size, - mode: 'regist', - pwd: QR.persona.getPassword(), - resto: threadID, - name: !QR.forcedAnon ? post.name : void 0, - email: post.email, - sub: !(QR.forcedAnon || threadID) ? post.sub : void 0, - com: post.com, - upfile: post.file, - filetag: filetag, - spoiler: post.spoiler, - flag: post.flag - }; - options = { - responseType: 'document', - withCredentials: true, - onloadend: QR.response, - form: $.formData(formData) - }; - if (Conf['Show Upload Progress']) { - options.onprogress = function(e) { - var ref1; - if (this !== ((ref1 = QR.req) != null ? ref1.upload : void 0)) { - return; - } - if (e.loaded < e.total) { - QR.req.progress = (Math.round(e.loaded / e.total * 100)) + "%"; - } else { - QR.req.isUploadFinished = true; - QR.req.progress = '...'; - } - return QR.status(); - }; - } - cb = function(response) { - var key, val; - if (response != null) { - QR.currentCaptcha = response; - if (QR.captcha === Captcha.v2) { - if (response.challenge != null) { - options.form.append('recaptcha_challenge_field', response.challenge); - options.form.append('recaptcha_response_field', response.response); - } else { - options.form.append('g-recaptcha-response', response.response); - } - } else { - for (key in response) { - val = response[key]; - options.form.append(key, val); - } - } - } - QR.req = $.ajax("https://sys." + (location.hostname.split('.')[1]) + ".org/" + g.BOARD + "/post", options); - return QR.req.progress = '...'; - }; - if (typeof captcha === 'function') { - QR.req = { - progress: '...', - abort: function() { - if (QR.captcha === Captcha.v2) { - Captcha.cache.abort(); - } - return cb = null; - } - }; - captcha(function(response) { - if (QR.captcha === Captcha.v2 && Captcha.cache.haveCookie()) { - if (typeof cb === "function") { - cb(); - } - if (response) { - return Captcha.cache.save(response); - } - } else if (response) { - return typeof cb === "function" ? cb(response) : void 0; - } else { - delete QR.req; - post.unlock(); - QR.cooldown.auto = !!Captcha.cache.getCount(); - return QR.status(); - } - }); - } else { - cb(captcha); - } - return QR.status(); - }, - response: function() { - var URL, _, base, connErr, err, h1, isReply, j, lastPostToThread, len, m, mi, open, post, postID, postsCount, ref, ref1, ref2, ref3, seconds, threadID; - if (this !== QR.req) { - return; - } - delete QR.req; - post = QR.posts[0]; - post.unlock(); - if ((err = (ref = this.response) != null ? ref.getElementById('errmsg') : void 0)) { - if ((ref1 = $('a', err)) != null) { - ref1.target = '_blank'; - } - } else if ((connErr = !this.response || this.response.title !== 'Post successful!')) { - err = QR.connectionError(); - if (QR.captcha === Captcha.v2 && QR.currentCaptcha) { - Captcha.cache.save(QR.currentCaptcha); - } - } else if (this.status !== 200) { - err = "Error " + this.statusText + " (" + this.status + ")"; - } - if (!connErr) { - if (typeof (base = QR.captcha).setUsed === "function") { - base.setUsed(); - } - } - delete QR.currentCaptcha; - if (err) { - QR.errorCount = (QR.errorCount || 0) + 1; - if (/captcha|verification/i.test(err.textContent) || connErr) { - if (/mistyped/i.test(err.textContent)) { - err = 'You mistyped the CAPTCHA, or the CAPTCHA malfunctioned.'; - } else if (/expired/i.test(err.textContent)) { - err = 'This CAPTCHA is no longer valid because it has expired.'; - } - if (QR.errorCount >= 5) { - QR.cooldown.auto = false; - } else { - QR.cooldown.auto = QR.captcha.isEnabled || connErr; - QR.cooldown.addDelay(post, 2); - } - } else if (err.textContent && (m = err.textContent.match(/\d+\s+(?:minute|second)/gi)) && !/duplicate|hour/i.test(err.textContent)) { - QR.cooldown.auto = !/have\s+been\s+muted/i.test(err.textContent); - seconds = 0; - for (j = 0, len = m.length; j < len; j++) { - mi = m[j]; - seconds += (/minute/i.test(mi) ? 60 : 1) * (+mi.match(/\d+/)[0]); - } - if (/muted/i.test(err.textContent)) { - QR.cooldown.addMute(seconds); - } else { - QR.cooldown.addDelay(post, seconds); - } - } else { - QR.cooldown.auto = false; - } - QR.captcha.setup(QR.cooldown.auto && ((ref2 = d.activeElement) === QR.nodes.status || ref2 === d.body)); - QR.status(); - QR.error(err); - return; - } - delete QR.errorCount; - h1 = $('h1', this.response); - ref3 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref3[0], threadID = ref3[1], postID = ref3[2]; - postID = +postID; - threadID = +threadID || postID; - isReply = threadID !== postID; - $.event('QRPostSuccessful', { - boardID: g.BOARD.ID, - threadID: threadID, - postID: postID - }); - $.event('QRPostSuccessful_', { - boardID: g.BOARD.ID, - threadID: threadID, - postID: postID - }); - postsCount = QR.posts.length - 1; - QR.cooldown.auto = postsCount && isReply; - lastPostToThread = !((function() { - var k, len1, p, ref4; - ref4 = QR.posts.slice(1); - for (k = 0, len1 = ref4.length; k < len1; k++) { - p = ref4[k]; - if (p.thread === post.thread) { - return true; - } - } - })()); - if (postsCount) { - post.rm(); - QR.captcha.setup(d.activeElement === QR.nodes.status); - } else if (Conf['Persistent QR']) { - post.rm(); - if (Conf['Auto Hide QR']) { - QR.hide(); - } else { - QR.blur(); - } - } else { - QR.close(); - } - QR.cleanNotifications(); - if (Conf['Posting Success Notifications']) { - QR.notifications.push(new Notice('success', h1.textContent, 5)); - } - QR.cooldown.add(threadID, postID); - URL = threadID === postID ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID : threadID !== g.THREADID && lastPostToThread && Conf['Open Post in New Tab'] ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID + "#p" + postID : void 0; - if (URL) { - open = Conf['Open Post in New Tab'] || postsCount ? function() { - return $.open(URL); - } : function() { - return location.href = URL; - }; - if (threadID === postID) { - QR.waitForThread(URL, open); - } else { - open(); - } - } - return QR.status(); - }, - waitForThread: function(url, cb) { - var attempts, check; - attempts = 0; - check = function() { - return $.ajax(url, { - onloadend: function() { - attempts++; - if (attempts >= 6 || this.status === 200) { - return cb(); - } else { - return setTimeout(check, attempts * $.SECOND); - } - }, - responseType: 'text', - type: 'HEAD' - }); - }; - return check(); - }, - abort: function() { - var oldReq; - if ((oldReq = QR.req) && !QR.req.isUploadFinished) { - delete QR.req; - oldReq.abort(); - if (QR.captcha === Captcha.v2 && QR.currentCaptcha) { - Captcha.cache.save(QR.currentCaptcha); - } - delete QR.currentCaptcha; - QR.posts[0].unlock(); - QR.cooldown.auto = false; - QR.notifications.push(new Notice('info', 'QR upload aborted.', 5)); - } - return QR.status(); - } - }; - - return QR; - -}).call(this); - -(function() { - QR.cooldown = { - seconds: 0, - delays: { - deletion: 60 - }, - init: function() { - if (!Conf['Quick Reply']) { - return; - } - this.data = Conf['cooldowns']; - this.changes = $.dict(); - return $.sync('cooldowns', this.sync); - }, - setup: function() { - var delay, ref, type; - $.extend(QR.cooldown.delays, g.BOARD.cooldowns()); - QR.cooldown.maxDelay = 0; - ref = QR.cooldown.delays; - for (type in ref) { - delay = ref[type]; - if (type !== 'thread' && type !== 'thread_global') { - QR.cooldown.maxDelay = Math.max(QR.cooldown.maxDelay, delay); - } - } - QR.cooldown.isSetup = true; - return QR.cooldown.start(); - }, - start: function() { - var data; - data = QR.cooldown.data; - if (!(Conf['Cooldown'] && QR.cooldown.isSetup && !QR.cooldown.isCounting && Object.keys(data[g.BOARD.ID] || {}).length + Object.keys(data.global || {}).length > 0)) { - return; - } - QR.cooldown.isCounting = true; - return QR.cooldown.count(); - }, - sync: function(data) { - QR.cooldown.data = data || $.dict(); - return QR.cooldown.start(); - }, - add: function(threadID, postID) { - var boardID, start; - if (!Conf['Cooldown']) { - return; - } - start = Date.now(); - boardID = g.BOARD.ID; - QR.cooldown.set(boardID, start, { - threadID: threadID, - postID: postID - }); - if (threadID === postID) { - QR.cooldown.set('global', start, { - boardID: boardID, - threadID: threadID, - postID: postID - }); - } - QR.cooldown.save(); - return QR.cooldown.start(); - }, - addDelay: function(post, delay) { - var cooldown; - if (!Conf['Cooldown']) { - return; - } - cooldown = QR.cooldown.categorize(post); - cooldown.delay = delay; - QR.cooldown.set(g.BOARD.ID, Date.now(), cooldown); - QR.cooldown.save(); - return QR.cooldown.start(); - }, - addMute: function(delay) { - if (!Conf['Cooldown']) { - return; - } - QR.cooldown.set(g.BOARD.ID, Date.now(), { - type: 'mute', - delay: delay - }); - QR.cooldown.save(); - return QR.cooldown.start(); - }, - "delete": function(post) { - var base, cooldown, cooldowns, id, name; - if (!QR.cooldown.data) { - return; - } - cooldowns = ((base = QR.cooldown.data)[name = post.board.ID] || (base[name] = $.dict())); - for (id in cooldowns) { - cooldown = cooldowns[id]; - if ((cooldown.delay == null) && cooldown.threadID === post.thread.ID && cooldown.postID === post.ID) { - QR.cooldown.set(post.board.ID, id, null); - } - } - return QR.cooldown.save(); - }, - secondsDeletion: function(post) { - var cooldown, cooldowns, seconds, start; - if (!(QR.cooldown.data && Conf['Cooldown'])) { - return 0; - } - cooldowns = QR.cooldown.data[post.board.ID] || $.dict(); - for (start in cooldowns) { - cooldown = cooldowns[start]; - if ((cooldown.delay == null) && cooldown.threadID === post.thread.ID && cooldown.postID === post.ID) { - seconds = QR.cooldown.delays.deletion - Math.floor((Date.now() - start) / $.SECOND); - return Math.max(seconds, 0); - } - } - return 0; - }, - categorize: function(post) { - if (post.thread === 'new') { - return { - type: 'thread' - }; - } else { - return { - type: !!post.file ? 'image' : 'reply', - threadID: +post.thread - }; - } - }, - mergeChange: function(data, scope, id, value) { - if (value) { - return (data[scope] || (data[scope] = $.dict()))[id] = value; - } else if (scope in data) { - delete data[scope][id]; - if (Object.keys(data[scope]).length === 0) { - return delete data[scope]; - } - } - }, - set: function(scope, id, value) { - var base; - QR.cooldown.mergeChange(QR.cooldown.data, scope, id, value); - return ((base = QR.cooldown.changes)[scope] || (base[scope] = $.dict()))[id] = value; - }, - save: function() { - var changes; - changes = QR.cooldown.changes; - if (!Object.keys(changes).length) { - return; - } - return $.get('cooldowns', $.dict(), function(arg) { - var cooldowns, id, ref, scope, value; - cooldowns = arg.cooldowns; - for (scope in QR.cooldown.changes) { - ref = QR.cooldown.changes[scope]; - for (id in ref) { - value = ref[id]; - QR.cooldown.mergeChange(cooldowns, scope, id, value); - } - QR.cooldown.data = cooldowns; - } - return $.set('cooldowns', cooldowns, function() { - return QR.cooldown.changes = $.dict(); - }); - }); - }, - clear: function() { - QR.cooldown.data = $.dict(); - QR.cooldown.changes = $.dict(); - QR.cooldown.auto = false; - QR.cooldown.update(); - return $.queueTask($["delete"], 'cooldowns'); - }, - update: function() { - var base, cooldown, cooldowns, elapsed, i, len, maxDelay, nCooldowns, now, ref, ref1, save, scope, seconds, start, suffix, threadID, type, update; - if (!QR.cooldown.isCounting) { - return; - } - save = false; - nCooldowns = 0; - now = Date.now(); - ref = QR.cooldown.categorize(QR.posts[0]), type = ref.type, threadID = ref.threadID; - seconds = 0; - if (Conf['Cooldown']) { - ref1 = [g.BOARD.ID, 'global']; - for (i = 0, len = ref1.length; i < len; i++) { - scope = ref1[i]; - cooldowns = ((base = QR.cooldown.data)[scope] || (base[scope] = $.dict())); - for (start in cooldowns) { - cooldown = cooldowns[start]; - start = +start; - elapsed = Math.floor((now - start) / $.SECOND); - if (elapsed < 0) { - QR.cooldown.set(scope, start, null); - save = true; - continue; - } - if (cooldown.delay != null) { - if (cooldown.delay <= elapsed) { - QR.cooldown.set(scope, start, null); - save = true; - } else if ((cooldown.type === type && cooldown.threadID === threadID) || cooldown.type === 'mute') { - seconds = Math.max(seconds, cooldown.delay - elapsed); - } - continue; - } - maxDelay = cooldown.threadID !== cooldown.postID ? QR.cooldown.maxDelay : QR.cooldown.delays[scope === 'global' ? 'thread_global' : 'thread']; - if (QR.cooldown.customCooldown) { - maxDelay = Math.max(maxDelay, parseInt(Conf['customCooldown'], 10)); - } - if (maxDelay <= elapsed) { - QR.cooldown.set(scope, start, null); - save = true; - continue; - } - if ((type === 'thread') === (cooldown.threadID === cooldown.postID) && cooldown.boardID !== g.BOARD.ID) { - suffix = scope === 'global' ? '_global' : ''; - seconds = Math.max(seconds, QR.cooldown.delays[type + suffix] - elapsed); - if (QR.cooldown.customCooldown) { - seconds = Math.max(seconds, parseInt(Conf['customCooldown'], 10) - elapsed); - } - } - } - nCooldowns += Object.keys(cooldowns).length; - } - } - if (save) { - QR.cooldown.save; - } - if (nCooldowns) { - clearTimeout(QR.cooldown.timeout); - QR.cooldown.timeout = setTimeout(QR.cooldown.count, $.SECOND); - } else { - delete QR.cooldown.isCounting; - } - update = seconds !== QR.cooldown.seconds; - QR.cooldown.seconds = seconds; - if (update) { - return QR.status(); - } - }, - count: function() { - QR.cooldown.update(); - if (QR.cooldown.seconds === 0 && QR.cooldown.auto && !QR.req) { - return QR.submit(); - } - } - }; - -}).call(this); - -(function() { - QR.oekaki = { - menu: { - init: function() { - var a, ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Edit Link'] && Conf['Quick Reply'])) { - return; - } - a = $.el('a', { - className: 'edit-link', - href: 'javascript:;', - textContent: 'Edit image' - }); - $.on(a, 'click', this.editFile); - return Menu.menu.addEntry({ - el: a, - order: 90, - open: function(post) { - var file; - QR.oekaki.menu.post = post; - file = post.file; - return QR.postingIsEnabled && !!file && (file.isImage || file.isVideo); - } - }); - }, - editFile: function() { - var currentTime, isVideo, post, ref; - post = QR.oekaki.menu.post; - QR.quote.call(post.nodes.post); - isVideo = post.file.isVideo; - currentTime = ((ref = post.file.fullImage) != null ? ref.currentTime : void 0) || 0; - return CrossOrigin.file(post.file.url, function(blob) { - var video; - if (!blob) { - return QR.error("Can't load file."); - } else if (isVideo) { - video = $.el('video'); - $.on(video, 'loadedmetadata', function() { - $.on(video, 'seeked', function() { - var canvas; - canvas = $.el('canvas', { - width: video.videoWidth, - height: video.videoHeight - }); - canvas.getContext('2d').drawImage(video, 0, 0); - return canvas.toBlob(function(snapshot) { - snapshot.name = post.file.name.replace(/\.\w+$/, '') + '.png'; - QR.handleFiles([snapshot]); - return QR.oekaki.edit(); - }); - }); - return video.currentTime = currentTime; - }); - $.on(video, 'error', function() { - return QR.openError(); - }); - return video.src = URL.createObjectURL(blob); - } else { - blob.name = post.file.name; - QR.handleFiles([blob]); - return QR.oekaki.edit(); - } - }); - } - }, - setup: function() { - return $.global(function() { - var FCX; - FCX = window.FCX; - FCX.oekakiCB = function() { - return window.Tegaki.flatten().toBlob(function(file) { - var source; - source = "oekaki-" + (Date.now()); - FCX.oekakiLatest = source; - return document.dispatchEvent(new CustomEvent('QRSetFile', { - bubbles: true, - detail: { - file: file, - name: FCX.oekakiName, - source: source - } - })); - }); - }; - if (window.Tegaki) { - return document.querySelector('#qr .oekaki').hidden = false; - } - }); - }, - load: function(cb) { - var n, onload, script, style; - if ($('script[src^="//s.4cdn.org/js/tegaki"]', d.head)) { - return cb(); - } else { - style = $.el('link', { - rel: 'stylesheet', - href: "//s.4cdn.org/css/tegaki." + (Date.now()) + ".css" - }); - script = $.el('script', { - src: "//s.4cdn.org/js/tegaki.min." + (Date.now()) + ".js" - }); - n = 0; - onload = function() { - if (++n === 2) { - return cb(); - } - }; - $.on(style, 'load', onload); - $.on(script, 'load', onload); - return $.add(d.head, [style, script]); - } - }, - draw: function() { - return $.global(function() { - var FCX, Tegaki; - Tegaki = window.Tegaki, FCX = window.FCX; - if (Tegaki.bg) { - Tegaki.destroy(); - } - FCX.oekakiName = 'tegaki.png'; - return Tegaki.open({ - onDone: FCX.oekakiCB, - onCancel: function() { - return Tegaki.bgColor = '#ffffff'; - }, - width: +document.querySelector('#qr [name=oekaki-width]').value, - height: +document.querySelector('#qr [name=oekaki-height]').value, - bgColor: document.querySelector('#qr [name=oekaki-bg]').checked ? document.querySelector('#qr [name=oekaki-bgcolor]').value : 'transparent' - }); - }); - }, - button: function() { - if (QR.selected.file) { - return QR.oekaki.edit(); - } else { - return QR.oekaki.toggle(); - } - }, - edit: function() { - return QR.oekaki.load(function() { - return $.global(function() { - var FCX, Tegaki, cb, error, name, source; - Tegaki = window.Tegaki, FCX = window.FCX; - name = document.getElementById('qr-filename').value.replace(/\.\w+$/, '') + '.png'; - source = document.getElementById('file-n-submit').dataset.source; - error = function(content) { - return document.dispatchEvent(new CustomEvent('CreateNotification', { - bubbles: true, - detail: { - type: 'warning', - content: content, - lifetime: 20 - } - })); - }; - cb = function(e) { - var canvas, selected; - if (e) { - this.removeEventListener('QRMetadata', cb, false); - } - selected = document.getElementById('selected'); - if (!(selected != null ? selected.dataset.type : void 0)) { - return error('No file to edit.'); - } - if (!/^(image|video)\//.test(selected.dataset.type)) { - return error('Not an image.'); - } - if (!selected.dataset.height) { - return error('Metadata not available.'); - } - if (selected.dataset.height === 'loading') { - selected.addEventListener('QRMetadata', cb, false); - return; - } - if (Tegaki.bg) { - Tegaki.destroy(); - } - FCX.oekakiName = name; - Tegaki.open({ - onDone: FCX.oekakiCB, - onCancel: function() { - return Tegaki.bgColor = '#ffffff'; - }, - width: +selected.dataset.width, - height: +selected.dataset.height, - bgColor: 'transparent' - }); - canvas = document.createElement('canvas'); - canvas.width = canvas.naturalWidth = +selected.dataset.width; - canvas.height = canvas.naturalHeight = +selected.dataset.height; - canvas.hidden = true; - document.body.appendChild(canvas); - canvas.addEventListener('QRImageDrawn', function() { - this.remove(); - return Tegaki.onOpenImageLoaded.call(this); - }, false); - return canvas.dispatchEvent(new CustomEvent('QRDrawFile', { - bubbles: true - })); - }; - if (Tegaki.bg && Tegaki.onDoneCb === FCX.oekakiCB && source === FCX.oekakiLatest) { - FCX.oekakiName = name; - return Tegaki.resume(); - } else { - return cb(); - } - }); - }); - }, - toggle: function() { - return QR.oekaki.load(function() { - return QR.nodes.oekaki.hidden = !QR.nodes.oekaki.hidden; - }); - } - }; - -}).call(this); - -(function() { - var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - QR.persona = { - always: {}, - types: { - name: [], - email: [], - sub: [] - }, - init: function() { - var i, item, len, ref; - if (!(Conf['Quick Reply'] || (Conf['Menu'] && Conf['Delete Link']))) { - return; - } - ref = Conf['QR.personas'].split('\n'); - for (i = 0, len = ref.length; i < len; i++) { - item = ref[i]; - QR.persona.parseItem(item.trim()); - } - }, - parseItem: function(item) { - var boards, match, ref, ref1, ref2, type, val; - if (item[0] === '#') { - return; - } - if (!(match = item.match(/(name|options|email|subject|password):"(.*)"/i))) { - return; - } - ref = match, match = ref[0], type = ref[1], val = ref[2]; - item = item.replace(match, ''); - boards = ((ref1 = item.match(/boards:([^;]+)/i)) != null ? ref1[1].toLowerCase() : void 0) || 'global'; - if (boards !== 'global' && (ref2 = g.BOARD.ID, indexOf.call(boards.split(','), ref2) < 0)) { - return; - } - if (type === 'password') { - QR.persona.pwd = val; - return; - } - if (type === 'options') { - type = 'email'; - } - if (type === 'subject') { - type = 'sub'; - } - if (/always/i.test(item)) { - QR.persona.always[type] = val; - } - if (indexOf.call(QR.persona.types[type], val) < 0) { - return QR.persona.types[type].push(val); - } - }, - load: function() { - var arr, i, len, list, ref, type, val; - ref = QR.persona.types; - for (type in ref) { - arr = ref[type]; - list = $("#list-" + type, QR.nodes.el); - for (i = 0, len = arr.length; i < len; i++) { - val = arr[i]; - if (val) { - $.add(list, $.el('option', { - textContent: val - })); - } - } - } - }, - getPassword: function() { - var m; - if (QR.persona.pwd != null) { - return QR.persona.pwd; - } else if ((m = d.cookie.match(/4chan_pass=([^;]+)/))) { - return decodeURIComponent(m[1]); - } else { - return ''; - } - }, - get: function(cb) { - return $.get('QR.persona', {}, function(arg) { - var persona; - persona = arg['QR.persona']; - return cb(persona); - }); - }, - set: function(post) { - return $.get('QR.persona', {}, function(arg) { - var persona; - persona = arg['QR.persona']; - persona = { - name: post.name, - flag: post.flag - }; - return $.set('QR.persona', persona); - }); - } - }; - -}).call(this); - -(function() { - var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - slice = [].slice; - - QR.post = (function() { - function _Class(select) { - this.select = bind(this.select, this); - var el, event, i, j, label, len, len1, prev, ref, ref1; - el = $.el('a', { - className: 'qr-preview', - draggable: true, - href: 'javascript:;' - }); - $.extend(el, {innerHTML: ""}); - this.nodes = { - el: el, - rm: el.firstChild, - spoiler: $('.qr-preview-spoiler input', el), - span: el.lastChild - }; - $.on(el, 'click', this.select); - $.on(this.nodes.rm, 'click', (function(_this) { - return function(e) { - e.stopPropagation(); - return _this.rm(); - }; - })(this)); - $.on(this.nodes.spoiler, 'change', (function(_this) { - return function(e) { - _this.spoiler = e.target.checked; - if (_this === QR.selected) { - QR.nodes.spoiler.checked = _this.spoiler; - } - return _this.preventAutoPost(); - }; - })(this)); - ref = $$('label', el); - for (i = 0, len = ref.length; i < len; i++) { - label = ref[i]; - $.on(label, 'click', function(e) { - return e.stopPropagation(); - }); - } - $.add(QR.nodes.dumpList, el); - ref1 = ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop']; - for (j = 0, len1 = ref1.length; j < len1; j++) { - event = ref1[j]; - $.on(el, event.toLowerCase(), this[event]); - } - this.thread = g.VIEW === 'thread' ? g.THREADID : 'new'; - prev = QR.posts[QR.posts.length - 1]; - QR.posts.push(this); - this.nodes.spoiler.checked = this.spoiler = prev && Conf['Remember Spoiler'] ? prev.spoiler : false; - QR.persona.get((function(_this) { - return function(persona) { - _this.name = 'name' in QR.persona.always ? QR.persona.always.name : prev ? prev.name : persona.name; - _this.email = 'email' in QR.persona.always ? QR.persona.always.email : ''; - _this.sub = 'sub' in QR.persona.always ? QR.persona.always.sub : ''; - if (QR.nodes.flag) { - _this.flag = prev ? prev.flag : persona.flag && persona.flag in g.BOARD.config.board_flags ? persona.flag : void 0; - } - if (QR.selected === _this) { - return _this.load(); - } - }; - })(this)); - if (select) { - this.select(); - } - this.unlock(); - QR.captcha.moreNeeded(); - } - - _Class.prototype.rm = function() { - var base, index; - this["delete"](); - index = QR.posts.indexOf(this); - if (QR.posts.length === 1) { - new QR.post(true); - $.rmClass(QR.nodes.el, 'dump'); - } else if (this === QR.selected) { - (QR.posts[index - 1] || QR.posts[index + 1]).select(); - } - QR.posts.splice(index, 1); - QR.status(); - return typeof (base = QR.captcha).updateThread === "function" ? base.updateThread() : void 0; - }; - - _Class.prototype["delete"] = function() { - $.rm(this.nodes.el); - URL.revokeObjectURL(this.URL); - return this.dismissErrors(); - }; - - _Class.prototype.lock = function(lock) { - var i, len, name, node, ref; - if (lock == null) { - lock = true; - } - this.isLocked = lock; - if (this !== QR.selected) { - return; - } - ref = ['thread', 'name', 'email', 'sub', 'com', 'fileButton', 'filename', 'spoiler', 'flag']; - for (i = 0, len = ref.length; i < len; i++) { - name = ref[i]; - if (node = QR.nodes[name]) { - node.disabled = lock; - } - } - this.nodes.rm.style.visibility = lock ? 'hidden' : ''; - this.nodes.spoiler.disabled = lock; - return this.nodes.el.draggable = !lock; - }; - - _Class.prototype.unlock = function() { - return this.lock(false); - }; - - _Class.prototype.select = function() { - var rectEl, rectList; - if (QR.selected) { - QR.selected.nodes.el.removeAttribute('id'); - QR.selected.forceSave(); - } - QR.selected = this; - this.lock(this.isLocked); - this.nodes.el.id = 'selected'; - rectEl = this.nodes.el.getBoundingClientRect(); - rectList = this.nodes.el.parentNode.getBoundingClientRect(); - this.nodes.el.parentNode.scrollLeft += rectEl.left + rectEl.width / 2 - rectList.left - rectList.width / 2; - return this.load(); - }; - - _Class.prototype.load = function() { - var i, len, name, node, ref; - ref = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'flag']; - for (i = 0, len = ref.length; i < len; i++) { - name = ref[i]; - if (!(node = QR.nodes[name])) { - continue; - } - node.value = this[name] || node.dataset["default"] || ''; - } - (this.thread !== 'new' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread'); - this.showFileData(); - return QR.characterCount(); - }; - - _Class.prototype.save = function(input, forced) { - var base, name, prev; - if (input.type === 'checkbox') { - this.spoiler = input.checked; - return; - } - name = input.dataset.name; - if (name !== 'thread' && name !== 'name' && name !== 'email' && name !== 'sub' && name !== 'com' && name !== 'filename' && name !== 'flag') { - return; - } - prev = this[name] || input.dataset["default"] || null; - this[name] = input.value || input.dataset["default"] || null; - switch (name) { - case 'thread': - (this.thread !== 'new' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread'); - QR.status(); - if (typeof (base = QR.captcha).updateThread === "function") { - base.updateThread(); - } - break; - case 'com': - this.updateComment(); - break; - case 'filename': - if (!this.file) { - return; - } - this.saveFilename(); - this.updateFilename(); - break; - case 'name': - case 'flag': - if (this[name] !== prev) { - QR.persona.set(this); - } - } - if (!forced) { - return this.preventAutoPost(); - } - }; - - _Class.prototype.forceSave = function() { - var i, len, name, node, ref; - if (this !== QR.selected) { - return; - } - ref = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'spoiler', 'flag']; - for (i = 0, len = ref.length; i < len; i++) { - name = ref[i]; - if (!(node = QR.nodes[name])) { - continue; - } - this.save(node, true); - } - }; - - _Class.prototype.preventAutoPost = function() { - if (QR.cooldown.auto && this === QR.posts[0]) { - QR.cooldown.update(); - if (QR.cooldown.seconds <= 5) { - return QR.cooldown.auto = false; - } - } - }; - - _Class.prototype.setComment = function(com) { - this.com = com || null; - if (this === QR.selected) { - QR.nodes.com.value = this.com; - } - return this.updateComment(); - }; - - _Class.prototype.updateComment = function() { - if (this === QR.selected) { - QR.characterCount(); - } - this.nodes.span.textContent = this.com; - QR.captcha.moreNeeded(); - if (QR.captcha === Captcha.v2) { - return Captcha.cache.prerequest(); - } - }; - - _Class.prototype.isOnlyQuotes = function() { - return (this.com || '').trim() === (this.quotedText || '').trim(); - }; - - _Class.rmErrored = function(e) { - var error, errors, i, j, len, post, ref; - e.stopPropagation(); - ref = QR.posts; - for (i = ref.length - 1; i >= 0; i += -1) { - post = ref[i]; - if (errors = post.errors) { - for (j = 0, len = errors.length; j < len; j++) { - error = errors[j]; - if (!(doc.contains(error))) { - continue; - } - post.rm(); - break; - } - } - } - }; - - _Class.prototype.error = function(className, message, link) { - var div, ref, rm, rmAll; - div = $.el('div', { - className: className - }); - $.extend(div, {innerHTML: E(message) + ((link) ? " [More info]" : "") + "
      [delete post] [delete all]"}); - (this.errors || (this.errors = [])).push(div); - ref = $$('a', div), rm = ref[0], rmAll = ref[1]; - $.on(div, 'click', (function(_this) { - return function() { - if (indexOf.call(QR.posts, _this) >= 0) { - return _this.select(); - } - }; - })(this)); - $.on(rm, 'click', (function(_this) { - return function(e) { - e.stopPropagation(); - if (indexOf.call(QR.posts, _this) >= 0) { - return _this.rm(); - } - }; - })(this)); - $.on(rmAll, 'click', QR.post.rmErrored); - return QR.error(div, true); - }; - - _Class.prototype.fileError = function(message, link) { - return this.error('file-error', this.filename + ": " + message, link); - }; - - _Class.prototype.dismissErrors = function(test) { - var error, i, len, ref; - if (test == null) { - test = function() { - return true; - }; - } - if (this.errors) { - ref = this.errors; - for (i = 0, len = ref.length; i < len; i++) { - error = ref[i]; - if (doc.contains(error) && test(error)) { - error.parentNode.previousElementSibling.click(); - } - } - } - }; - - _Class.prototype.setFile = function(file1) { - var ext, ref; - this.file = file1; - if (Conf['Randomize Filename'] && g.BOARD.ID !== 'f') { - this.filename = "" + (Date.now() * 1000 - Math.floor(Math.random() * 365 * $.DAY * 1000)); - if (ext = this.file.name.match(QR.validExtension)) { - this.filename += ext[0]; - } - } else { - this.filename = this.file.name; - } - this.filesize = $.bytesToString(this.file.size); - this.checkSize(); - $.addClass(this.nodes.el, 'has-file'); - QR.captcha.moreNeeded(); - URL.revokeObjectURL(this.URL); - this.saveFilename(); - if (this === QR.selected) { - this.showFileData(); - } else { - this.updateFilename(); - } - this.rmMetadata(); - this.nodes.el.dataset.type = this.file.type; - this.nodes.el.style.backgroundImage = ''; - if (ref = this.file.type, indexOf.call(QR.mimeTypes, ref) < 0) { - this.fileError('Unsupported file type.'); - } else if (/^(image|video)\//.test(this.file.type)) { - this.readFile(); - } - return this.preventAutoPost(); - }; - - _Class.prototype.checkSize = function() { - var max; - max = QR.max_size; - if (/^video\//.test(this.file.type)) { - max = Math.min(max, QR.max_size_video); - } - if (this.file.size > max) { - return this.fileError("File too large (file: " + this.filesize + ", max: " + ($.bytesToString(max)) + ")."); - } - }; - - _Class.prototype.readFile = function() { - var el, event, isVideo, onerror, onload; - isVideo = /^video\//.test(this.file.type); - el = $.el(isVideo ? 'video' : 'img'); - if (isVideo && !el.canPlayType(this.file.type)) { - return; - } - event = isVideo ? 'loadeddata' : 'load'; - onload = (function(_this) { - return function() { - $.off(el, event, onload); - $.off(el, 'error', onerror); - _this.checkDimensions(el); - _this.setThumbnail(el); - return $.event('QRMetadata', null, _this.nodes.el); - }; - })(this); - onerror = (function(_this) { - return function() { - $.off(el, event, onload); - $.off(el, 'error', onerror); - _this.fileError("Corrupt " + (isVideo ? 'video' : 'image') + " or error reading metadata.", 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions#error-reading-metadata'); - URL.revokeObjectURL(el.src); - _this.nodes.el.removeAttribute('data-height'); - return $.event('QRMetadata', null, _this.nodes.el); - }; - })(this); - this.nodes.el.dataset.height = 'loading'; - $.on(el, event, onload); - $.on(el, 'error', onerror); - return el.src = URL.createObjectURL(this.file); - }; - - _Class.prototype.checkDimensions = function(el) { - var duration, height, max_height, max_width, videoHeight, videoWidth, width; - if (el.tagName === 'IMG') { - height = el.height, width = el.width; - this.nodes.el.dataset.height = height; - this.nodes.el.dataset.width = width; - if (height > QR.max_height || width > QR.max_width) { - this.fileError("Image too large (image: " + height + "x" + width + "px, max: " + QR.max_height + "x" + QR.max_width + "px)"); - } - if (height < QR.min_height || width < QR.min_width) { - return this.fileError("Image too small (image: " + height + "x" + width + "px, min: " + QR.min_height + "x" + QR.min_width + "px)"); - } - } else { - videoHeight = el.videoHeight, videoWidth = el.videoWidth, duration = el.duration; - this.nodes.el.dataset.height = videoHeight; - this.nodes.el.dataset.width = videoWidth; - this.nodes.el.dataset.duration = duration; - max_height = Math.min(QR.max_height, QR.max_height_video); - max_width = Math.min(QR.max_width, QR.max_width_video); - if (videoHeight > max_height || videoWidth > max_width) { - this.fileError("Video too large (video: " + videoHeight + "x" + videoWidth + "px, max: " + max_height + "x" + max_width + "px)"); - } - if (videoHeight < QR.min_height || videoWidth < QR.min_width) { - this.fileError("Video too small (video: " + videoHeight + "x" + videoWidth + "px, min: " + QR.min_height + "x" + QR.min_width + "px)"); - } - if (!isFinite(duration)) { - this.fileError('Video lacks duration metadata (try remuxing)'); - } else if (duration > QR.max_duration_video) { - this.fileError("Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)"); - } - if (BoardConfig.noAudio(g.BOARD.ID) && $.hasAudio(el)) { - return this.fileError('Audio not allowed'); - } - } - }; - - _Class.prototype.setThumbnail = function(el) { - var cv, height, isVideo, s, width; - isVideo = el.tagName === 'VIDEO'; - s = 90 * 2 * window.devicePixelRatio; - if (this.file.type === 'image/gif') { - s *= 3; - } - if (isVideo) { - height = el.videoHeight; - width = el.videoWidth; - } else { - height = el.height, width = el.width; - if (height < s || width < s) { - this.URL = el.src; - this.nodes.el.style.backgroundImage = "url(" + this.URL + ")"; - return; - } - } - if (height <= width) { - width = s / height * width; - height = s; - } else { - height = s / width * height; - width = s; - } - cv = $.el('canvas'); - cv.height = height; - cv.width = width; - cv.getContext('2d').drawImage(el, 0, 0, width, height); - URL.revokeObjectURL(el.src); - return cv.toBlob((function(_this) { - return function(blob) { - _this.URL = URL.createObjectURL(blob); - return _this.nodes.el.style.backgroundImage = "url(" + _this.URL + ")"; - }; - })(this)); - }; - - _Class.prototype.rmFile = function() { - if (this.isLocked) { - return; - } - delete this.file; - delete this.filename; - delete this.filesize; - this.nodes.el.removeAttribute('title'); - QR.nodes.filename.removeAttribute('title'); - this.rmMetadata(); - this.nodes.el.style.backgroundImage = ''; - $.rmClass(this.nodes.el, 'has-file'); - this.showFileData(); - URL.revokeObjectURL(this.URL); - this.dismissErrors(function(error) { - return $.hasClass(error, 'file-error'); - }); - return this.preventAutoPost(); - }; - - _Class.prototype.rmMetadata = function() { - var attr, i, len, ref; - ref = ['type', 'height', 'width', 'duration']; - for (i = 0, len = ref.length; i < len; i++) { - attr = ref[i]; - this.nodes.el.removeAttribute("data-" + attr); - } - }; - - _Class.prototype.saveFilename = function() { - this.file.newName = (this.filename || '').replace(/[\/\\]/g, '-'); - if (!QR.validExtension.test(this.filename)) { - return this.file.newName += "." + ($.getOwn(QR.extensionFromType, this.file.type) || 'jpg'); - } - }; - - _Class.prototype.updateFilename = function() { - var long; - long = this.filename + " (" + this.filesize + ")"; - this.nodes.el.title = long; - if (this !== QR.selected) { - return; - } - return QR.nodes.filename.title = long; - }; - - _Class.prototype.showFileData = function() { - var ref; - if (this.file) { - this.updateFilename(); - QR.nodes.filename.value = this.filename; - $.addClass(QR.nodes.oekaki, 'has-file'); - $.addClass(QR.nodes.fileSubmit, 'has-file'); - } else { - $.rmClass(QR.nodes.oekaki, 'has-file'); - $.rmClass(QR.nodes.fileSubmit, 'has-file'); - } - if (((ref = this.file) != null ? ref.source : void 0) != null) { - QR.nodes.fileSubmit.dataset.source = this.file.source; - } else { - QR.nodes.fileSubmit.removeAttribute('data-source'); - } - return QR.nodes.spoiler.checked = this.spoiler; - }; - - _Class.prototype.pasteText = function(file) { - var reader; - this.pasting = true; - this.preventAutoPost(); - reader = new FileReader(); - reader.onload = (function(_this) { - return function(e) { - var result; - result = e.target.result; - _this.setComment((_this.com ? _this.com + "\n" + result : result)); - return delete _this.pasting; - }; - })(this); - return reader.readAsText(file); - }; - - _Class.prototype.dragStart = function(e) { - var left, ref, top; - ref = this.getBoundingClientRect(), left = ref.left, top = ref.top; - e.dataTransfer.setDragImage(this, e.clientX - left, e.clientY - top); - return $.addClass(this, 'drag'); - }; - - _Class.prototype.dragEnd = function() { - return $.rmClass(this, 'drag'); - }; - - _Class.prototype.dragEnter = function() { - return $.addClass(this, 'over'); - }; - - _Class.prototype.dragLeave = function() { - return $.rmClass(this, 'over'); - }; - - _Class.prototype.dragOver = function(e) { - e.preventDefault(); - return e.dataTransfer.dropEffect = 'move'; - }; - - _Class.prototype.drop = function() { - var base, el, index, newIndex, oldIndex, post; - $.rmClass(this, 'over'); - if (!this.draggable) { - return; - } - el = $('.drag', this.parentNode); - index = function(el) { - return slice.call(el.parentNode.children).indexOf(el); - }; - oldIndex = index(el); - newIndex = index(this); - if (QR.posts[oldIndex].isLocked || QR.posts[newIndex].isLocked) { - return; - } - (oldIndex < newIndex ? $.after : $.before)(this, el); - post = QR.posts.splice(oldIndex, 1)[0]; - QR.posts.splice(newIndex, 0, post); - QR.status(); - return typeof (base = QR.captcha).updateThread === "function" ? base.updateThread() : void 0; - }; - - return _Class; - - })(); - -}).call(this); - -QuoteBacklink = (function() { - var QuoteBacklink; - - QuoteBacklink = { - containers: $.dict(), - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Backlinks']) { - return; - } - if ((this.bottomBacklinks = Conf['Bottom Backlinks'])) { - $.addClass(doc, 'bottom-backlinks'); - } - Callbacks.Post.push({ - name: 'Quote Backlinking Part 1', - cb: this.firstNode - }); - return Callbacks.Post.push({ - name: 'Quote Backlinking Part 2', - cb: this.secondNode - }); - }, - firstNode: function() { - var a, clone, container, containers, hash, i, j, k, len, len1, len2, link, markYours, nodes, post, quote, ref, ref1; - if (this.isClone || !this.quotes.length || this.isRebuilt) { - return; - } - markYours = Conf['Mark Quotes of You'] && QuoteYou.isYou(this); - a = $.el('a', { - href: g.SITE.Build.postURL(this.board.ID, this.thread.ID, this.ID), - className: this.isHidden ? 'filtered backlink' : 'backlink', - textContent: Conf['backlink'].replace(/%(?:id|%)/g, (function(_this) { - return function(x) { - return { - '%id': _this.ID, - '%%': '%' - }[x]; - }; - })(this)) - }); - if (markYours) { - $.add(a, QuoteYou.mark.cloneNode(true)); - } - ref = this.quotes; - for (i = 0, len = ref.length; i < len; i++) { - quote = ref[i]; - containers = [QuoteBacklink.getContainer(quote)]; - if ((post = g.posts.get(quote)) && post.nodes.backlinkContainer) { - ref1 = post.clones; - for (j = 0, len1 = ref1.length; j < len1; j++) { - clone = ref1[j]; - containers.push(clone.nodes.backlinkContainer); - } - } - for (k = 0, len2 = containers.length; k < len2; k++) { - container = containers[k]; - link = a.cloneNode(true); - nodes = container.firstChild ? [$.tn(' '), link] : [link]; - if (Conf['Quote Previewing']) { - $.on(link, 'mouseover', QuotePreview.mouseover); - } - if (Conf['Quote Inlining']) { - $.on(link, 'click', QuoteInline.toggle); - if (Conf['Quote Hash Navigation']) { - hash = QuoteInline.qiQuote(link, $.hasClass(link, 'filtered')); - nodes.push(hash); - } - } - $.add(container, nodes); - } - } - }, - secondNode: function() { - var container; - if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) { - this.nodes.backlinkContainer = $('.container', this.nodes.post); - return; - } - if (!(this.isReply || Conf['OP Backlinks'])) { - return; - } - container = QuoteBacklink.getContainer(this.fullID); - this.nodes.backlinkContainer = container; - if (QuoteBacklink.bottomBacklinks) { - return $.add(this.nodes.post, container); - } else { - return $.add(this.nodes.info, container); - } - }, - getContainer: function(id) { - var base; - return (base = this.containers)[id] || (base[id] = $.el('span', { - className: 'container' - })); - } - }; - - return QuoteBacklink; - -}).call(this); - -QuoteCT = (function() { - var QuoteCT; - - QuoteCT = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark Cross-thread Quotes']) { - return; - } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - this.mark = $.el('span', { - textContent: '\u00A0(Cross-thread)', - className: 'qmark-ct' - }); - return Callbacks.Post.push({ - name: 'Mark Cross-thread Quotes', - cb: this.node - }); - }, - node: function() { - var board, boardID, i, len, quotelink, ref, ref1, ref2, thread, threadID; - if (this.isClone && this.thread === this.context.thread) { - return; - } - ref = this.context, board = ref.board, thread = ref.thread; - ref1 = this.nodes.quotelinks; - for (i = 0, len = ref1.length; i < len; i++) { - quotelink = ref1[i]; - ref2 = Get.postDataFromLink(quotelink), boardID = ref2.boardID, threadID = ref2.threadID; - if (!threadID) { - continue; - } - if (this.isClone) { - $.rm($('.qmark-ct', quotelink)); - } - if (boardID === board.ID && threadID !== thread.ID) { - $.add(quotelink, QuoteCT.mark.cloneNode(true)); - } - } - } - }; - - return QuoteCT; - -}).call(this); - -QuoteInline = (function() { - var QuoteInline, - slice = [].slice; - - QuoteInline = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Inlining']) { - return; - } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - return Callbacks.Post.push({ - name: 'Quote Inlining', - cb: this.node - }); - }, - node: function() { - var i, isClone, len, link, process, ref; - process = QuoteInline.process; - isClone = this.isClone; - ref = this.nodes.quotelinks.concat(slice.call(this.nodes.backlinks), this.nodes.archivelinks); - for (i = 0, len = ref.length; i < len; i++) { - link = ref[i]; - process(link, isClone); - } - }, - process: function(link, clone) { - if (Conf['Quote Hash Navigation']) { - if (!clone) { - $.after(link, QuoteInline.qiQuote(link, $.hasClass(link, 'filtered'))); - } - } - return $.on(link, 'click', QuoteInline.toggle); - }, - qiQuote: function(link, hidden) { - var name; - name = "hashlink"; - if (hidden) { - name += " filtered"; - } - return $.el('a', { - className: name, - textContent: '#', - href: link.href - }); - }, - toggle: function(e) { - var boardID, context, postID, quoter, ref, ref1, threadID; - if ($.modifiedClick(e)) { - return; - } - ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID; - if (Conf['Inline Cross-thread Quotes Only'] && g.VIEW === 'thread' && ((ref1 = g.posts.get(boardID + "." + postID)) != null ? ref1.nodes.root.offsetParent : void 0)) { - return; - } - if ($.hasClass(doc, 'catalog-mode')) { - return; - } - e.preventDefault(); - quoter = Get.postFromNode(this); - context = quoter.context; - if ($.hasClass(this, 'inlined')) { - QuoteInline.rm(this, boardID, threadID, postID, context); - } else { - if ($.x("ancestor::div[@data-full-i-d='" + boardID + "." + postID + "']", this)) { - return; - } - QuoteInline.add(this, boardID, threadID, postID, context, quoter); - } - return this.classList.toggle('inlined'); - }, - findRoot: function(quotelink, isBacklink) { - if (isBacklink) { - return $.x('ancestor::*[parent::*[contains(@class,"post")]][1]', quotelink); - } else { - return $.x('ancestor-or-self::*[parent::blockquote][1]', quotelink); - } - }, - add: function(quotelink, boardID, threadID, postID, context, quoter) { - var inline, isBacklink, post, qroot, root; - isBacklink = $.hasClass(quotelink, 'backlink'); - inline = $.el('div', { - className: 'inline' - }); - inline.dataset.fullID = boardID + "." + postID; - root = QuoteInline.findRoot(quotelink, isBacklink); - $.after(root, inline); - qroot = $.x('ancestor::*[contains(@class,"postContainer")][1]', root); - $.addClass(qroot, 'hasInline'); - new Fetcher(boardID, threadID, postID, inline, quoter); - if (!((post = g.posts.get(boardID + "." + postID)) && context.thread === post.thread)) { - return; - } - if (isBacklink && Conf['Forward Hiding']) { - $.addClass(post.nodes.root, 'forwarded'); - post.forwarded++ || (post.forwarded = 1); - } - if (!Unread.posts) { - return; - } - return Unread.readSinglePost(post); - }, - rm: function(quotelink, boardID, threadID, postID, context) { - var el, inlined, isBacklink, parentNode, post, qroot, ref, root; - isBacklink = $.hasClass(quotelink, 'backlink'); - root = QuoteInline.findRoot(quotelink, isBacklink); - root = $.x("following-sibling::div[@data-full-i-d='" + boardID + "." + postID + "'][1]", root); - qroot = $.x('ancestor::*[contains(@class,"postContainer")][1]', root); - parentNode = root.parentNode; - $.rm(root); - $.event('PostsRemoved', null, parentNode); - if (!$('.inline', qroot)) { - $.rmClass(qroot, 'hasInline'); - } - if (!(el = root.firstElementChild)) { - return; - } - post = g.posts.get(boardID + "." + postID); - post.rmClone(el.dataset.clone); - if (Conf['Forward Hiding'] && isBacklink && context.thread === g.threads.get(boardID + "." + threadID) && !--post.forwarded) { - delete post.forwarded; - $.rmClass(post.nodes.root, 'forwarded'); - } - while (inlined = $('.inlined', el)) { - ref = Get.postDataFromLink(inlined), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID; - QuoteInline.rm(inlined, boardID, threadID, postID, context); - $.rmClass(inlined, 'inlined'); - } - } - }; - - return QuoteInline; - -}).call(this); - -QuoteOP = (function() { - var QuoteOP, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - QuoteOP = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark OP Quotes']) { - return; - } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - this.mark = $.el('span', { - textContent: '\u00A0(OP)', - className: 'qmark-op' - }); - return Callbacks.Post.push({ - name: 'Mark OP Quotes', - cb: this.node - }); - }, - node: function() { - var boardID, fullID, i, postID, quotelink, quotelinks, quotes, ref, ref1; - if (this.isClone && this.thread === this.context.thread) { - return; - } - if (!(quotes = this.quotes).length) { - return; - } - quotelinks = this.nodes.quotelinks; - if (this.isClone && (ref = this.thread.fullID, indexOf.call(quotes, ref) >= 0)) { - i = 0; - while (quotelink = quotelinks[i++]) { - $.rm($('.qmark-op', quotelink)); - } - } - fullID = this.context.thread.fullID; - if (indexOf.call(quotes, fullID) < 0) { - return; - } - i = 0; - while (quotelink = quotelinks[i++]) { - ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID; - if ((boardID + "." + postID) === fullID) { - $.add(quotelink, QuoteOP.mark.cloneNode(true)); - } - } - } - }; - - return QuoteOP; - -}).call(this); - -QuotePreview = (function() { - var QuotePreview, - slice = [].slice; - - QuotePreview = { - init: function() { - var ref; - if (!Conf['Quote Previewing']) { - return; - } - if (g.VIEW === 'archive') { - $.on(d, 'mouseover', function(e) { - if (e.target.nodeName === 'A' && $.hasClass(e.target, 'quotelink')) { - return QuotePreview.mouseover.call(e.target, e); - } - }); - } - if ((ref = g.VIEW) !== 'index' && ref !== 'thread') { - return; - } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - return Callbacks.Post.push({ - name: 'Quote Previewing', - cb: this.node - }); - }, - node: function() { - var i, len, link, ref; - ref = this.nodes.quotelinks.concat(slice.call(this.nodes.backlinks), this.nodes.archivelinks); - for (i = 0, len = ref.length; i < len; i++) { - link = ref[i]; - $.on(link, 'mouseover', QuotePreview.mouseover); - } - }, - mouseover: function(e) { - var boardID, i, len, origin, post, postID, posts, qp, ref, threadID; - if (($.hasClass(this, 'inlined') && !$.hasClass(doc, 'catalog-mode')) || !d.contains(this)) { - return; - } - ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID; - qp = $.el('div', { - id: 'qp', - className: 'dialog' - }); - $.add(Header.hover, qp); - new Fetcher(boardID, threadID, postID, qp, Get.postFromNode(this)); - UI.hover({ - root: this, - el: qp, - latestEvent: e, - endEvents: 'mouseout click', - cb: QuotePreview.mouseout - }); - if (Conf['Quote Highlighting'] && (origin = g.posts.get(boardID + "." + postID))) { - posts = [origin].concat(origin.clones); - posts.pop(); - for (i = 0, len = posts.length; i < len; i++) { - post = posts[i]; - $.addClass(post.nodes.post, 'qphl'); - } - } - }, - mouseout: function() { - var clone, i, len, post, ref, root; - if (!(root = this.el.firstElementChild)) { - return; - } - $.event('PostsRemoved', null, Header.hover); - clone = Get.postFromRoot(root); - post = clone.origin; - post.rmClone(root.dataset.clone); - if (!Conf['Quote Highlighting']) { - return; - } - ref = [post].concat(post.clones); - for (i = 0, len = ref.length; i < len; i++) { - post = ref[i]; - $.rmClass(post.nodes.post, 'qphl'); - } - } - }; - - return QuotePreview; - -}).call(this); - -QuoteStrikeThrough = (function() { - var QuoteStrikeThrough; - - QuoteStrikeThrough = { - init: function() { - var ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Reply Hiding Buttons'] || (Conf['Menu'] && Conf['Reply Hiding Link']) || Conf['Filter']))) { - return; - } - return Callbacks.Post.push({ - name: 'Strike-through Quotes', - cb: this.node - }); - }, - node: function() { - var boardID, i, len, postID, quotelink, ref, ref1, ref2; - if (this.isClone) { - return; - } - ref = this.nodes.quotelinks; - for (i = 0, len = ref.length; i < len; i++) { - quotelink = ref[i]; - ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID; - if ((ref2 = g.posts.get(boardID + "." + postID)) != null ? ref2.isHidden : void 0) { - $.addClass(quotelink, 'filtered'); - } - } - } - }; - - return QuoteStrikeThrough; - -}).call(this); - -QuoteThreading = -/* - <3 aeosynth - */ - -(function() { - var QuoteThreading; - - QuoteThreading = { - init: function() { - if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) { - return; - } - this.controls = $.el('label', {innerHTML: " Threading"}); - this.threadNewLink = $.el('span', { - className: 'brackets-wrap threadnewlink', - hidden: true - }); - $.extend(this.threadNewLink, {innerHTML: "Thread New Posts"}); - this.input = $('input', this.controls); - this.input.checked = Conf['Thread Quotes']; - $.on(this.input, 'change', this.setEnabled); - $.on(this.input, 'change', this.rethread); - $.on(this.threadNewLink.firstElementChild, 'click', this.rethread); - $.on(d, '4chanXInitFinished', (function(_this) { - return function() { - return _this.ready = true; - }; - })(this)); - Header.menu.addEntry(this.entry = { - el: this.controls, - order: 99 - }); - Callbacks.Thread.push({ - name: 'Quote Threading', - cb: this.setThread - }); - return Callbacks.Post.push({ - name: 'Quote Threading', - cb: this.node - }); - }, - parent: $.dict(), - children: $.dict(), - inserted: $.dict(), - toggleThreading: function() { - return this.setThreadingState(!Conf['Thread Quotes']); - }, - setThreadingState: function(enabled) { - this.input.checked = enabled; - this.setEnabled.call(this.input); - return this.rethread.call(this.input); - }, - setEnabled: function() { - var other, ref; - if (this.checked) { - $.set('Prune All Threads', false); - other = (ref = ReplyPruning.inputs) != null ? ref.enabled : void 0; - if (other != null ? other.checked : void 0) { - other.checked = false; - $.event('change', null, other); - } - } - return $.cb.checked.call(this); - }, - setThread: function() { - QuoteThreading.thread = this; - return $.asap((function() { - return !Conf['Thread Updater'] || $('.navLinksBot > .updatelink'); - }), function() { - var navLinksBot; - if ((navLinksBot = $('.navLinksBot'))) { - return $.add(navLinksBot, [$.tn(' '), QuoteThreading.threadNewLink]); - } - }); - }, - node: function() { - var ancestor, j, lastParent, len, parent, parents, quote, ref; - if (this.isFetchedQuote || this.isClone || !this.isReply) { - return; - } - parents = new Set(); - lastParent = null; - ref = this.quotes; - for (j = 0, len = ref.length; j < len; j++) { - quote = ref[j]; - if (parent = g.posts.get(quote)) { - if (!parent.isFetchedQuote && parent.isReply && parent.ID < this.ID) { - parents.add(parent.ID); - if (!lastParent || parent.ID > lastParent.ID) { - lastParent = parent; - } - } - } - } - if (!lastParent) { - return; - } - ancestor = lastParent; - while (ancestor = QuoteThreading.parent[ancestor.fullID]) { - parents["delete"](ancestor.ID); - } - if (parents.size === 1) { - return QuoteThreading.parent[this.fullID] = lastParent; - } - }, - descendants: function(post) { - var child, children, j, len, posts; - posts = [post]; - if (children = QuoteThreading.children[post.fullID]) { - for (j = 0, len = children.length; j < len; j++) { - child = children[j]; - posts = posts.concat(QuoteThreading.descendants(child)); - } - } - return posts; - }, - insert: function(post) { - var base, child, children, descendants, i, j, k, l, len, name, next, nodes, order, parent, prev, prev2, threadContainer, x; - if (!(Conf['Thread Quotes'] && (parent = QuoteThreading.parent[post.fullID]) && !QuoteThreading.inserted[post.fullID])) { - return false; - } - descendants = QuoteThreading.descendants(post); - if (!Unread.posts.has(parent.ID)) { - if ((function() { - var j, len, x; - for (j = 0, len = descendants.length; j < len; j++) { - x = descendants[j]; - if (Unread.posts.has(x.ID)) { - return true; - } - } - })()) { - QuoteThreading.threadNewLink.hidden = false; - return false; - } - } - order = Unread.order; - children = ((base = QuoteThreading.children)[name = parent.fullID] || (base[name] = [])); - threadContainer = parent.nodes.threadContainer || $.el('div', { - className: 'threadContainer' - }); - nodes = [post.nodes.root]; - if (post.nodes.threadContainer) { - nodes.push(post.nodes.threadContainer); - } - i = children.length; - for (j = children.length - 1; j >= 0; j += -1) { - child = children[j]; - if (child.ID >= post.ID) { - i--; - } - } - if (i !== children.length) { - next = children[i]; - for (k = 0, len = descendants.length; k < len; k++) { - x = descendants[k]; - order.before(order[next.ID], order[x.ID]); - } - children.splice(i, 0, post); - $.before(next.nodes.root, nodes); - } else { - prev = parent; - while ((prev2 = QuoteThreading.children[prev.fullID]) && prev2.length) { - prev = prev2[prev2.length - 1]; - } - for (l = descendants.length - 1; l >= 0; l += -1) { - x = descendants[l]; - order.after(order[prev.ID], order[x.ID]); - } - children.push(post); - $.add(threadContainer, nodes); - } - QuoteThreading.inserted[post.fullID] = true; - if (!parent.nodes.threadContainer) { - parent.nodes.threadContainer = threadContainer; - $.addClass(parent.nodes.root, 'threadOP'); - $.after(parent.nodes.root, threadContainer); - } - return true; - }, - rethread: function() { - var nodes, posts, thread; - if (!QuoteThreading.ready) { - return; - } - thread = QuoteThreading.thread; - posts = thread.posts; - QuoteThreading.threadNewLink.hidden = true; - if (Conf['Thread Quotes']) { - posts.forEach(QuoteThreading.insert); - } else { - nodes = []; - Unread.order = new RandomAccessList(); - QuoteThreading.inserted = $.dict(); - posts.forEach(function(post) { - if (post.isFetchedQuote) { - return; - } - Unread.order.push(post); - if (post.isReply) { - nodes.push(post.nodes.root); - } - if (QuoteThreading.children[post.fullID]) { - delete QuoteThreading.children[post.fullID]; - $.rmClass(post.nodes.root, 'threadOP'); - $.rm(post.nodes.threadContainer); - return delete post.nodes.threadContainer; - } - }); - $.add(thread.nodes.root, nodes); - } - Unread.position = Unread.order.first; - Unread.updatePosition(); - Unread.setLine(true); - Unread.read(); - return Unread.update(); - } - }; - - return QuoteThreading; - -}).call(this); - -QuoteYou = (function() { - var QuoteYou; - - QuoteYou = { - init: function() { - var ref; - if (!Conf['Remember Your Posts']) { - return; - } - this.db = new DataBoard('yourPosts'); - $.sync('Remember Your Posts', function(enabled) { - return Conf['Remember Your Posts'] = enabled; - }); - $.on(d, 'QRPostSuccessful', function(e) { - var cb; - cb = PostRedirect.delay(); - return $.get('Remember Your Posts', Conf['Remember Your Posts'], function(items) { - var boardID, postID, ref, threadID; - if (!items['Remember Your Posts']) { - return; - } - ref = e.detail, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID; - return QuoteYou.db.set({ - boardID: boardID, - threadID: threadID, - postID: postID, - val: true - }, cb); - }); - }); - if ((ref = g.VIEW) !== 'index' && ref !== 'thread' && ref !== 'archive') { - return; - } - if (Conf['Highlight Own Posts']) { - $.addClass(doc, 'highlight-own'); - } - if (Conf['Highlight Posts Quoting You']) { - $.addClass(doc, 'highlight-you'); - } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - this.mark = $.el('span', { - textContent: '\u00A0(You)', - className: 'qmark-you' - }); - Callbacks.Post.push({ - name: 'Mark Quotes of You', - cb: this.node - }); - return QuoteYou.menu.init(); - }, - isYou: function(post) { - var ref; - return !!((ref = QuoteYou.db) != null ? ref.get({ - boardID: post.boardID, - threadID: post.threadID, - postID: post.ID - }) : void 0); - }, - node: function() { - var i, len, quotelink, ref; - if (this.isClone) { - return; - } - if (QuoteYou.isYou(this)) { - $.addClass(this.nodes.root, 'yourPost'); - } - if (!this.quotes.length) { - return; - } - ref = this.nodes.quotelinks; - for (i = 0, len = ref.length; i < len; i++) { - quotelink = ref[i]; - if (!(QuoteYou.db.get(Get.postDataFromLink(quotelink)))) { - continue; - } - if (Conf['Mark Quotes of You']) { - $.add(quotelink, QuoteYou.mark.cloneNode(true)); - } - $.addClass(quotelink, 'you'); - $.addClass(this.nodes.root, 'quotesYou'); - } - }, - menu: { - init: function() { - var input, label, ref; - label = $.el('label', { - className: 'toggle-you' - }, {innerHTML: " You"}); - input = $('input', label); - $.on(input, 'change', QuoteYou.menu.toggle); - return (ref = Menu.menu) != null ? ref.addEntry({ - el: label, - order: 80, - open: function(post) { - QuoteYou.menu.post = post.origin || post; - input.checked = QuoteYou.isYou(post); - return true; - } - }) : void 0; - }, - toggle: function() { - var clone, data, i, j, len, len1, post, quotelink, quoter, ref, ref1; - post = QuoteYou.menu.post; - data = { - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID, - val: true - }; - if (this.checked) { - QuoteYou.db.set(data); - } else { - QuoteYou.db["delete"](data); - } - ref = [post].concat(post.clones); - for (i = 0, len = ref.length; i < len; i++) { - clone = ref[i]; - clone.nodes.root.classList.toggle('yourPost', this.checked); - } - ref1 = Get.allQuotelinksLinkingTo(post); - for (j = 0, len1 = ref1.length; j < len1; j++) { - quotelink = ref1[j]; - if (this.checked) { - if (Conf['Mark Quotes of You']) { - $.add(quotelink, QuoteYou.mark.cloneNode(true)); - } - } else { - $.rm($('.qmark-you', quotelink)); - } - quotelink.classList.toggle('you', this.checked); - if ($.hasClass(quotelink, 'quotelink')) { - quoter = Get.postFromNode(quotelink).nodes.root; - quoter.classList.toggle('quotesYou', !!$('.quotelink.you', quoter)); - } - } - } - }, - cb: { - seek: function(type) { - var highlight, highlighted, post, posts, result, str; - highlight = g.SITE.classes.highlight; - if ((highlighted = $("." + highlight))) { - $.rmClass(highlighted, highlight); - } - if (!(QuoteYou.lastRead && doc.contains(QuoteYou.lastRead) && $.hasClass(QuoteYou.lastRead, 'quotesYou'))) { - if (!(post = QuoteYou.lastRead = $('.quotesYou'))) { - new Notice('warning', 'No posts are currently quoting you, loser.', 20); - return; - } - if (QuoteYou.cb.scroll(post)) { - return; - } - } else { - post = QuoteYou.lastRead; - } - str = type + "::div[contains(@class,'quotesYou')]"; - while ((post = (result = $.X(str, post)).snapshotItem(type === 'preceding' ? result.snapshotLength - 1 : 0))) { - if (QuoteYou.cb.scroll(post)) { - return; - } - } - posts = $$('.quotesYou'); - return QuoteYou.cb.scroll(posts[type === 'following' ? 0 : posts.length - 1]); - }, - scroll: function(root) { - var node, post, sel; - post = Get.postFromRoot(root); - if (!post.nodes.post.getBoundingClientRect().height) { - return false; - } else { - QuoteYou.lastRead = root; - location.href = Get.url('post', post); - Header.scrollTo(post.nodes.post); - if (post.isReply) { - sel = "" + g.SITE.selectors.postContainer + g.SITE.selectors.highlightable.reply; - node = post.nodes.root; - if (!node.matches(sel)) { - node = $(sel, node); - } - $.addClass(node, g.SITE.classes.highlight); - } - return true; - } - } - } - }; - - return QuoteYou; - -}).call(this); - -Quotify = (function() { - var Quotify, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - slice = [].slice; - - Quotify = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Resurrect Quotes']) { - return; - } - $.addClass(doc, 'resurrect-quotes'); - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - return Callbacks.Post.push({ - name: 'Resurrect Quotes', - cb: this.node - }); - }, - node: function() { - var deadlink, i, j, len, len1, link, ref, ref1; - if (this.isClone) { - this.nodes.archivelinks = $$('a.linkify.quotelink', this.nodes.comment); - return; - } - ref = $$('a.linkify', this.nodes.comment); - for (i = 0, len = ref.length; i < len; i++) { - link = ref[i]; - Quotify.parseArchivelink.call(this, link); - } - ref1 = $$('.deadlink', this.nodes.comment); - for (j = 0, len1 = ref1.length; j < len1; j++) { - deadlink = ref1[j]; - Quotify.parseDeadlink.call(this, deadlink); - } - }, - parseArchivelink: function(link) { - var boardID, m, postID, ref, threadID; - if (!(m = link.pathname.match(/^\/([^\/]+)\/thread\/S?(\d+)\/?$/))) { - return; - } - if ((ref = link.hostname) === 'boards.4chan.org' || ref === 'boards.4channel.org') { - return; - } - boardID = m[1]; - threadID = m[2]; - postID = link.hash.match(/^#[pq]?(\d+)$|$/)[1] || threadID; - if (Redirect.to('post', { - boardID: boardID, - postID: postID - })) { - $.addClass(link, 'quotelink'); - $.extend(link.dataset, { - boardID: boardID, - threadID: threadID, - postID: postID - }); - return this.nodes.archivelinks.push(link); - } - }, - parseDeadlink: function(deadlink) { - var a, boardID, fetchable, m, post, postID, quote, quoteID, redirect, ref; - if ($.hasClass(deadlink.parentNode, 'prettyprint')) { - Quotify.fixDeadlink(deadlink); - return; - } - quote = deadlink.textContent; - if (!(postID = (ref = quote.match(/\d+$/)) != null ? ref[0] : void 0)) { - return; - } - if (postID[0] === '0') { - Quotify.fixDeadlink(deadlink); - return; - } - boardID = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : this.board.ID; - quoteID = boardID + "." + postID; - if (post = g.posts.get(quoteID)) { - if (!post.isDead) { - a = $.el('a', { - href: g.SITE.Build.postURL(boardID, post.thread.ID, postID), - className: 'quotelink', - textContent: quote - }); - } else { - a = $.el('a', { - href: g.SITE.Build.postURL(boardID, post.thread.ID, postID), - className: 'quotelink deadlink', - textContent: quote - }); - $.add(a, Post.deadMark.cloneNode(true)); - $.extend(a.dataset, { - boardID: boardID, - threadID: post.thread.ID, - postID: postID - }); - } - } else { - redirect = Redirect.to('thread', { - boardID: boardID, - threadID: 0, - postID: postID - }); - fetchable = Redirect.to('post', { - boardID: boardID, - postID: postID - }); - if (redirect || fetchable) { - a = $.el('a', { - href: redirect || 'javascript:;', - className: 'deadlink', - textContent: quote - }); - $.add(a, Post.deadMark.cloneNode(true)); - if (fetchable) { - $.addClass(a, 'quotelink'); - $.extend(a.dataset, { - boardID: boardID, - postID: postID - }); - } - } - } - if (indexOf.call(this.quotes, quoteID) < 0) { - this.quotes.push(quoteID); - } - if (!a) { - $.add(deadlink, Post.deadMark.cloneNode(true)); - return; - } - $.replace(deadlink, a); - if ($.hasClass(a, 'quotelink')) { - return this.nodes.quotelinks.push(a); - } - }, - fixDeadlink: function(deadlink) { - var el, green; - if (!(el = deadlink.previousSibling) || el.nodeName === 'BR') { - green = $.el('span', { - className: 'quote' - }); - $.before(deadlink, green); - $.add(green, deadlink); - } - return $.replace(deadlink, slice.call(deadlink.childNodes)); - } - }; - - return Quotify; - -}).call(this); - -Main = (function() { - var Main, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Main = { - init: function() { - var db, flatten, i, items, j, k, key, len, mountedCB, ref, ref1, ref2, w; - try { - w = window; - if ($.platform === 'crx') { - w = w.wrappedJSObject || w; - } - if ('4chan X antidup' in w) { - return; - } - w['4chan X antidup'] = true; - } catch (error1) {} - try { - if (window.frameElement && ((ref = window.frameElement.src) === '' || ref === 'about:blank')) { - return; - } - } catch (error1) {} - if (doc && $.hasClass(doc, 'fourchan-x')) { - return; - } - $.asap(docSet, function() { - $.addClass(doc, 'fourchan-x', 'seaweedchan'); - if ($.engine) { - return $.addClass(doc, "ua-" + $.engine); - } - }); - $.on(d, '4chanXInitFinished', function() { - if (Main.expectInitFinished) { - return delete Main.expectInitFinished; - } else { - new Notice('error', 'Error: Multiple copies of 4chan X are enabled.'); - return $.addClass(doc, 'tainted'); - } - }); - mountedCB = function() { - var cb, j, len, ref1, results; - d.removeEventListener('mounted', mountedCB, true); - Main.isMounted = true; - ref1 = Main.mountedCBs; - results = []; - for (j = 0, len = ref1.length; j < len; j++) { - cb = ref1[j]; - try { - results.push(cb()); - } catch (error1) {} - } - return results; - }; - d.addEventListener('mounted', mountedCB, true); - flatten = function(parent, obj) { - var key, val; - if (obj instanceof Array) { - Conf[parent] = $.dict.clone(obj[0]); - } else if (typeof obj === 'object') { - for (key in obj) { - val = obj[key]; - flatten(key, val); - } - } else { - Conf[parent] = obj; - } - }; - if ((ref1 = location.hostname) === 'boards.4chan.org' || ref1 === 'boards.4channel.org') { - $.global(function() { - var fromCharCode0; - fromCharCode0 = String.fromCharCode; - return String.fromCharCode = function() { - if (document.body) { - String.fromCharCode = fromCharCode0; - } else if (document.currentScript && !document.currentScript.src) { - throw Error(); - } - return fromCharCode0.apply(this, arguments); - }; - }); - $.asap(docSet, function() { - return $.onExists(doc, 'iframe[srcdoc]', $.rm); - }); - } - flatten(null, Config); - ref2 = DataBoard.keys; - for (j = 0, len = ref2.length; j < len; j++) { - db = ref2[j]; - Conf[db] = $.dict(); - } - Conf['customTitles'] = $.dict.clone({ - '4chan.org': { - boards: { - 'qa': { - 'boardTitle': { - orig: '/qa/ - Question & Answer', - title: '/qa/ - 2D/Random' - } - } - } - } - }); - Conf['boardConfig'] = { - boards: $.dict() - }; - Conf['archives'] = Redirect.archives; - Conf['selectedArchives'] = $.dict(); - Conf['cooldowns'] = $.dict(); - Conf['Index Sort'] = $.dict(); - for (i = k = 0; k < 2; i = ++k) { - Conf["Last Long Reply Thresholds " + i] = $.dict(); - } - Conf['siteProperties'] = $.dict(); - Conf['Except Archives from Encryption'] = false; - Conf['JSON Navigation'] = true; - Conf['Oekaki Links'] = true; - Conf['Show Name and Subject'] = false; - Conf['QR Shortcut'] = true; - Conf['Bottom QR Link'] = true; - Conf['Toggleable Thread Watcher'] = true; - Conf['siteSoftware'] = ''; - Conf['Use Faster Image Host'] = 'true'; - Conf['Captcha Fixes'] = true; - Conf['captchaServiceDomain'] = ''; - Conf['captchaServiceKey'] = $.dict(); - if (/\.4chan(?:nel)?\.org$/.test(location.hostname) && !SW.yotsuba.regexp.pass.test(location.href) && !SW.yotsuba.regexp.captcha.test(location.href) && !$$('script:not([src])', d).filter(function(s) { - return /this\[/.test(s.textContent); - }).length) { - ($.getSync || $.get)({ - 'jsWhitelist': Conf['jsWhitelist'] - }, function(arg) { - var jsWhitelist; - jsWhitelist = arg.jsWhitelist; - return $.addCSP("script-src " + (jsWhitelist.replace(/^#.*$/mg, '').replace(/[\s;]+/g, ' ').trim())); - }); - } - items = $.dict(); - for (key in Conf) { - items[key] = void 0; - } - items['previousversion'] = void 0; - return ($.getSync || $.get)(items, function(items) { - var ref3; - if (!$.perProtocolSettings && /\.4chan(?:nel)?\.org$/.test(location.hostname) && ((ref3 = items['Redirect to HTTPS']) != null ? ref3 : Conf['Redirect to HTTPS']) && location.protocol !== 'https:') { - location.replace('https://' + location.host + location.pathname + location.search + location.hash); - return; - } - return $.asap(docSet, function() { - var ref4, val; - if ($.cantSet) { - - } else if (items.previousversion == null) { - Main.isFirstRun = true; - Main.ready(function() { - $.set('previousversion', g.VERSION); - return Settings.open(); - }); - } else if (items.previousversion !== g.VERSION) { - Main.upgrade(items); - } - for (key in Conf) { - val = Conf[key]; - Conf[key] = (ref4 = items[key]) != null ? ref4 : val; - } - return Site.init(Main.initFeatures); - }); - }); - }, - upgrade: function(items) { - var changes, previousversion; - previousversion = items.previousversion; - changes = Settings.upgrade(items, previousversion); - items.previousversion = changes.previousversion = g.VERSION; - return $.set(changes, function() { - var el, ref; - if ((ref = items['Show Updated Notifications']) != null ? ref : true) { - el = $.el('span', {innerHTML: "4chan X has been updated to version " + E(g.VERSION) + "."}); - return new Notice('info', el, 15); - } - }); - }, - parseURL: function(site, url) { - var pathname, r, ref; - if (site == null) { - site = g.SITE; - } - if (url == null) { - url = location; - } - r = {}; - if (!site) { - return r; - } - r.siteID = site.ID; - if (typeof site.isBoardlessPage === "function" ? site.isBoardlessPage(url) : void 0) { - return r; - } - pathname = url.pathname.split(/\/+/); - r.boardID = pathname[1]; - if (site.isFileURL(url)) { - r.VIEW = 'file'; - } else if (typeof site.isAuxiliaryPage === "function" ? site.isAuxiliaryPage(url) : void 0) { - - } else if ((ref = pathname[2]) === 'thread' || ref === 'res') { - r.VIEW = 'thread'; - r.threadID = r.THREADID = +pathname[3].replace(/\.\w+$/, ''); - } else if (pathname[2] === 'archive' && pathname[3] === 'res') { - r.VIEW = 'thread'; - r.threadID = r.THREADID = +pathname[4].replace(/\.\w+$/, ''); - r.threadArchived = true; - } else if (/^(?:catalog|archive)(?:\.\w+)?$/.test(pathname[2])) { - r.VIEW = pathname[2].replace(/\.\w+$/, ''); - } else if (/^(?:index|\d*)(?:\.\w+)?$/.test(pathname[2])) { - r.VIEW = 'index'; - } - return r; - }, - initFeatures: function() { - var base, err, feature, j, len, name, ref, ref1; - $.global(function() { - document.documentElement.classList.add('js-enabled'); - return window.FCX = {}; - }); - Main.jsEnabled = $.hasClass(doc, 'js-enabled'); - if (typeof $.ajaxPageInit === "function") { - $.ajaxPageInit(); - } - $.extend(g, Main.parseURL()); - if (g.boardID) { - g.BOARD = new Board(g.boardID); - } - if (!g.VIEW) { - if (typeof (base = g.SITE).initAuxiliary === "function") { - base.initAuxiliary(); - } - return; - } - if (g.VIEW === 'file') { - $.asap((function() { - return d.readyState !== 'loading'; - }), function() { - var base1, pathname, video; - if (g.SITE.software === 'yotsuba' && Conf['404 Redirect'] && (typeof (base1 = g.SITE).is404 === "function" ? base1.is404() : void 0)) { - pathname = location.pathname.split(/\/+/); - return Redirect.navigate('file', { - boardID: g.BOARD.ID, - filename: pathname[pathname.length - 1] - }); - } else if (video = $('video')) { - if (Conf['Volume in New Tab']) { - Volume.setup(video); - } - if (Conf['Loop in New Tab']) { - video.loop = true; - video.controls = false; - video.play(); - return ImageCommon.addControls(video); - } - } - }); - return; - } - g.threads = new SimpleDict(); - g.posts = new SimpleDict(); - $.onExists(doc, 'body', Main.initStyle); - ref = Main.features; - for (j = 0, len = ref.length; j < len; j++) { - ref1 = ref[j], name = ref1[0], feature = ref1[1]; - if (g.SITE.disabledFeatures && indexOf.call(g.SITE.disabledFeatures, name) >= 0) { - continue; - } - try { - feature.init(); - } catch (error1) { - err = error1; - Main.handleErrors({ - message: "\"" + name + "\" initialization crashed.", - error: err - }); - } - } - return $.ready(Main.initReady); - }, - initStyle: function() { - var keyboard, ref; - if (!Main.isThisPageLegit()) { - return; - } - if ((ref = $('link[href*=mobile]', d.head)) != null) { - ref.disabled = true; - } - doc.dataset.host = location.host; - $.addClass(doc, "sw-" + g.SITE.software); - $.addClass(doc, g.VIEW === 'thread' ? 'thread-view' : g.VIEW); - $.onExists(doc, '.ad-cnt, .adg-rects > .desktop', function(ad) { - return $.onExists(ad, 'img, iframe', function() { - return $.addClass(doc, 'ads-loaded'); - }); - }); - if (Conf['Autohiding Scrollbar']) { - $.addClass(doc, 'autohiding-scrollbar'); - } - $.ready(function() { - if (d.body.clientHeight > doc.clientHeight && (window.innerWidth === doc.clientWidth) !== Conf['Autohiding Scrollbar']) { - Conf['Autohiding Scrollbar'] = !Conf['Autohiding Scrollbar']; - $.set('Autohiding Scrollbar', Conf['Autohiding Scrollbar']); - return $.toggleClass(doc, 'autohiding-scrollbar'); - } - }); - $.addStyle(CSS.sub(CSS.boards), 'fourchanx-css'); - Main.bgColorStyle = $.el('style', { - id: 'fourchanx-bgcolor-css' - }); - keyboard = false; - $.on(d, 'mousedown', function() { - return keyboard = false; - }); - $.on(d, 'keydown', function(e) { - if (e.keyCode === 9) { - return keyboard = true; - } - }); - window.addEventListener('focus', (function() { - return doc.classList.toggle('keyboard-focus', keyboard); - }), true); - return Main.setClass(); - }, - setClass: function() { - var j, knownStyles, len, mainStyleSheet, ref, ref1, setStyle, style, styleSheet, styleSheets; - knownStyles = ['yotsuba', 'yotsuba-b', 'futaba', 'burichan', 'photon', 'tomorrow', 'spooky']; - if (g.SITE.software === 'yotsuba' && g.VIEW === 'catalog') { - if ((mainStyleSheet = $.id('base-css'))) { - style = (ref = mainStyleSheet.href.match(/catalog_(\w+)/)) != null ? ref[1].replace('_new', '').replace(/_+/g, '-') : void 0; - if (indexOf.call(knownStyles, style) >= 0) { - $.addClass(doc, style); - return; - } - } - } - style = mainStyleSheet = styleSheets = null; - setStyle = function() { - var bgColor, css, div, j, len, rgb, s, styleSheet; - if (g.SITE.software === 'yotsuba') { - $.rmClass(doc, style); - style = null; - for (j = 0, len = styleSheets.length; j < len; j++) { - styleSheet = styleSheets[j]; - if (styleSheet.href === (mainStyleSheet != null ? mainStyleSheet.href : void 0)) { - style = styleSheet.title.toLowerCase().replace('new', '').trim().replace(/\s+/g, '-'); - if (style === '_special') { - style = styleSheet.href.match(/[a-z]*(?=[^\/]*$)/)[0]; - } - if (indexOf.call(knownStyles, style) < 0) { - style = null; - } - break; - } - } - if (style) { - $.addClass(doc, style); - $.rm(Main.bgColorStyle); - return; - } - } - div = g.SITE.bgColoredEl(); - div.style.position = 'absolute'; - div.style.visibility = 'hidden'; - $.add(d.body, div); - bgColor = window.getComputedStyle(div).backgroundColor; - $.rm(div); - rgb = bgColor.match(/[\d.]+/g); - if (!/^rgb\(/.test(bgColor)) { - s = window.getComputedStyle(d.body); - bgColor = s.backgroundColor + " " + s.backgroundImage + " " + s.backgroundRepeat + " " + s.backgroundPosition; - } - css = ".dialog, .suboption-list > div:last-of-type, :root.catalog-hover-expand .catalog-container:hover > .post {\n background: " + bgColor + ";\n}\n.unread-mark-read {\n background-color: rgba(" + (rgb.slice(0, 3).join(', ')) + ", " + (0.5 * (rgb[3] || 1)) + ");\n}"; - if ($.luma(rgb) < 100) { - css += ".watch-thread-link {\n background-image: url(\"data:image/svg+xml,\");\n}"; - } - Main.bgColorStyle.textContent = css; - return $.after($.id('fourchanx-css'), Main.bgColorStyle); - }; - $.onExists(d.head, g.SITE.selectors.styleSheet, function(el) { - mainStyleSheet = el; - if (g.SITE.software === 'yotsuba') { - styleSheets = $$('link[rel="alternate stylesheet"]', d.head); - } - new MutationObserver(setStyle).observe(mainStyleSheet, { - attributes: true, - attributeFilter: ['href'] - }); - $.on(mainStyleSheet, 'load', setStyle); - return setStyle(); - }); - if (!mainStyleSheet) { - ref1 = $$('link[rel="stylesheet"]', d.head); - for (j = 0, len = ref1.length; j < len; j++) { - styleSheet = ref1[j]; - $.on(styleSheet, 'load', setStyle); - } - return setStyle(); - } - }, - initReady: function() { - var base, base1, msg; - if (typeof (base = g.SITE).is404 === "function" ? base.is404() : void 0) { - if (g.VIEW === 'thread') { - ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() { - if (Conf['404 Redirect']) { - return Redirect.navigate('thread', { - boardID: g.BOARD.ID, - threadID: g.THREADID, - postID: +location.hash.match(/\d+/) - }, "/" + g.BOARD + "/"); - } - }); - } - return; - } - if (typeof (base1 = g.SITE).isIncomplete === "function" ? base1.isIncomplete() : void 0) { - msg = $.el('div', {innerHTML: "The page didn't load completely.
      Some features may not work unless you reload."}); - $.on($('a', msg), 'click', function() { - return location.reload(); - }); - new Notice('warning', msg); - } - if (g.VIEW === 'catalog') { - return Main.initCatalog(); - } else if (!Index.enabled) { - if (g.SITE.awaitBoard) { - return g.SITE.awaitBoard(Main.initThread); - } else { - return Main.initThread(); - } - } else { - Main.expectInitFinished = true; - return $.event('4chanXInitFinished'); - } - }, - initThread: function() { - var base, base1, board, errors, posts, ref, s, threads; - s = g.SITE.selectors; - if ((board = $(((ref = s.boardFor) != null ? ref[g.VIEW] : void 0) || s.board))) { - threads = []; - posts = []; - errors = []; - try { - if (typeof (base = g.SITE).preParsingFixes === "function") { - base.preParsingFixes(board); - } - } catch (error1) {} - Main.addThreadsObserver = new MutationObserver(Main.addThreads); - Main.addPostsObserver = new MutationObserver(Main.addPosts); - Main.addThreadsObserver.observe(board, { - childList: true - }); - Main.parseThreads($$(s.thread, board), threads, posts, errors); - if (errors.length) { - Main.handleErrors(errors); - } - if (g.VIEW === 'thread') { - if (g.threadArchived) { - threads[0].isArchived = true; - threads[0].kill(); - } - if (typeof (base1 = g.SITE).parseThreadMetadata === "function") { - base1.parseThreadMetadata(threads[0]); - } - } - Main.callbackNodes('Thread', threads); - return Main.callbackNodesDB('Post', posts, function() { - var j, len, post; - for (j = 0, len = posts.length; j < len; j++) { - post = posts[j]; - QuoteThreading.insert(post); - } - Main.expectInitFinished = true; - return $.event('4chanXInitFinished'); - }); - } else { - Main.expectInitFinished = true; - return $.event('4chanXInitFinished'); - } - }, - parseThreads: function(threadRoots, threads, posts, errors) { - var boardID, boardObj, j, len, postRoots, ref, thread, threadID, threadRoot; - for (j = 0, len = threadRoots.length; j < len; j++) { - threadRoot = threadRoots[j]; - boardObj = (boardID = threadRoot.dataset.board) ? (boardID = encodeURIComponent(boardID), g.boards[boardID] || new Board(boardID)) : g.BOARD; - threadID = +threadRoot.id.match(/\d*$/)[0]; - if (!threadID || ((ref = boardObj.threads.get(threadID)) != null ? ref.nodes.root : void 0)) { - return; - } - thread = new Thread(threadID, boardObj); - thread.nodes.root = threadRoot; - threads.push(thread); - postRoots = $$(g.SITE.selectors.postContainer, threadRoot); - if (g.SITE.isOPContainerThread) { - postRoots.unshift(threadRoot); - } - Main.parsePosts(postRoots, thread, posts, errors); - Main.addPostsObserver.observe(threadRoot, { - childList: true - }); - } - }, - parsePosts: function(postRoots, thread, posts, errors) { - var err, j, len, postRoot; - for (j = 0, len = postRoots.length; j < len; j++) { - postRoot = postRoots[j]; - if (!(postRoot.dataset.fullID && g.posts.get(postRoot.dataset.fullID)) && $(g.SITE.selectors.comment, postRoot)) { - try { - posts.push(new Post(postRoot, thread, thread.board)); - } catch (error1) { - err = error1; - errors.push({ - message: "Parsing of Post No." + (postRoot.id.match(/\d+/)) + " failed. Post will be skipped.", - error: err, - html: postRoot.outerHTML - }); - } - } - } - }, - addThreads: function(records) { - var errors, j, k, len, len1, node, posts, record, ref, threadRoots, threads; - threadRoots = []; - for (j = 0, len = records.length; j < len; j++) { - record = records[j]; - ref = record.addedNodes; - for (k = 0, len1 = ref.length; k < len1; k++) { - node = ref[k]; - if (node.nodeType === Node.ELEMENT_NODE && node.matches(g.SITE.selectors.thread)) { - threadRoots.push(node); - } - } - } - if (!threadRoots.length) { - return; - } - threads = []; - posts = []; - errors = []; - Main.parseThreads(threadRoots, threads, posts, errors); - if (errors.length) { - Main.handleErrors(errors); - } - Main.callbackNodes('Thread', threads); - return Main.callbackNodesDB('Post', posts, function() { - return $.event('PostsInserted', null, records[0].target); - }); - }, - addPosts: function(records) { - var anyRemoved, el, errors, j, k, l, len, len1, len2, n, node, postRoots, posts, record, ref, ref1, ref2, thread, threads, threadsRM; - threads = []; - threadsRM = []; - posts = []; - errors = []; - for (j = 0, len = records.length; j < len; j++) { - record = records[j]; - thread = Get.threadFromRoot(record.target); - postRoots = []; - ref = record.addedNodes; - for (k = 0, len1 = ref.length; k < len1; k++) { - node = ref[k]; - if (node.nodeType === Node.ELEMENT_NODE) { - if (node.matches(g.SITE.selectors.postContainer) || (node = $(g.SITE.selectors.postContainer, node))) { - postRoots.push(node); - } - } - } - n = posts.length; - Main.parsePosts(postRoots, thread, posts, errors); - if (posts.length > n && indexOf.call(threads, thread) < 0) { - threads.push(thread); - } - anyRemoved = false; - ref1 = record.removedNodes; - for (l = 0, len2 = ref1.length; l < len2; l++) { - el = ref1[l]; - if (((ref2 = Get.postFromRoot(el)) != null ? ref2.nodes.root : void 0) === el && !doc.contains(el)) { - anyRemoved = true; - break; - } - } - if (anyRemoved && indexOf.call(threadsRM, thread) < 0) { - threadsRM.push(thread); - } - } - if (errors.length) { - Main.handleErrors(errors); - } - return Main.callbackNodesDB('Post', posts, function() { - var len3, len4, m, o; - for (m = 0, len3 = threads.length; m < len3; m++) { - thread = threads[m]; - $.event('PostsInserted', null, thread.nodes.root); - } - for (o = 0, len4 = threadsRM.length; o < len4; o++) { - thread = threadsRM[o]; - $.event('PostsRemoved', null, thread.nodes.root); - } - }); - }, - initCatalog: function() { - var board, errors, s, threads; - s = g.SITE.selectors.catalog; - if (s && (board = $(s.board))) { - threads = []; - errors = []; - Main.addCatalogThreadsObserver = new MutationObserver(Main.addCatalogThreads); - Main.addCatalogThreadsObserver.observe(board, { - childList: true - }); - Main.parseCatalogThreads($$(s.thread, board), threads, errors); - if (errors.length) { - Main.handleErrors(errors); - } - Main.callbackNodes('CatalogThreadNative', threads); - } - Main.expectInitFinished = true; - return $.event('4chanXInitFinished'); - }, - parseCatalogThreads: function(threadRoots, threads, errors) { - var err, j, len, ref, thread, threadRoot; - for (j = 0, len = threadRoots.length; j < len; j++) { - threadRoot = threadRoots[j]; - try { - thread = new CatalogThreadNative(threadRoot); - if (((ref = thread.thread.catalogViewNative) != null ? ref.nodes.root : void 0) !== threadRoot) { - thread.thread.catalogViewNative = thread; - threads.push(thread); - } - } catch (error1) { - err = error1; - errors.push({ - message: "Parsing of Catalog Thread No." + ((threadRoot.dataset.id || threadRoot.id).match(/\d+/)) + " failed. Thread will be skipped.", - error: err, - html: threadRoot.outerHTML - }); - } - } - }, - addCatalogThreads: function(records) { - var errors, j, k, len, len1, node, record, ref, threadRoots, threads; - threadRoots = []; - for (j = 0, len = records.length; j < len; j++) { - record = records[j]; - ref = record.addedNodes; - for (k = 0, len1 = ref.length; k < len1; k++) { - node = ref[k]; - if (node.nodeType === Node.ELEMENT_NODE && node.matches(g.SITE.selectors.catalog.thread)) { - threadRoots.push(node); - } - } - } - if (!threadRoots.length) { - return; - } - threads = []; - errors = []; - Main.parseCatalogThreads(threadRoots, threads, errors); - if (errors.length) { - Main.handleErrors(errors); - } - return Main.callbackNodes('CatalogThreadNative', threads); - }, - callbackNodes: function(klass, nodes) { - var cb, i, node; - i = 0; - cb = Callbacks[klass]; - while (node = nodes[i++]) { - cb.execute(node); - } - }, - callbackNodesDB: function(klass, nodes, cb) { - var cbs, fn, i, softTask; - i = 0; - cbs = Callbacks[klass]; - fn = function() { - var node; - if (!(node = nodes[i])) { - return false; - } - cbs.execute(node); - return ++i % 25; - }; - softTask = function() { - while (fn()) { - continue; - } - if (!nodes[i]) { - if (cb) { - cb(); - } - return; - } - return setTimeout(softTask, 0); - }; - return softTask(); - }, - handleErrors: function(errors) { - var div, enabled, error, j, len, logs, msg; - if (d.body && $.hasClass(d.body, 'fourchan_x') && !$.hasClass(doc, 'tainted')) { - new Notice('error', 'Error: Multiple copies of 4chan X are enabled.'); - $.addClass(doc, 'tainted'); - } - if (g.SITE.testNativeExtension && !$.hasClass(doc, 'tainted')) { - enabled = g.SITE.testNativeExtension().enabled; - if (enabled) { - $.addClass(doc, 'tainted'); - if (Conf['Disable Native Extension'] && !Main.isFirstRun) { - msg = $.el('div', {innerHTML: "Failed to disable the native extension. You may need to block it."}); - new Notice('error', msg); - } - } - } - if (!(errors instanceof Array)) { - error = errors; - } else if (errors.length === 1) { - error = errors[0]; - } - if (error) { - new Notice('error', Main.parseError(error, Main.reportLink([error])), 15); - return; - } - div = $.el('div', {innerHTML: E(errors.length) + " errors occurred." + (Main.reportLink(errors)).innerHTML + " [show]"}); - $.on(div.lastElementChild, 'click', function() { - var ref; - return ref = this.textContent === 'show' ? ['hide', false] : ['show', true], this.textContent = ref[0], logs.hidden = ref[1], ref; - }); - logs = $.el('div', { - hidden: true - }); - for (j = 0, len = errors.length; j < len; j++) { - error = errors[j]; - $.add(logs, Main.parseError(error)); - } - return new Notice('error', [div, logs], 30); - }, - parseError: function(data, reportLink) { - var context, error, lines, message, ref, ref1; - c.error(data.message, data.error.stack); - message = $.el('div', {innerHTML: E(data.message) + ((reportLink) ? (reportLink).innerHTML : "")}); - error = $.el('div', { - textContent: (data.error.name || 'Error') + ": " + (data.error.message || 'see console for details') - }); - lines = ((ref = data.error.stack) != null ? (ref1 = ref.match(/\d+(?=:\d+\)?$)/mg)) != null ? ref1.join().replace(/^/, ' at ') : void 0 : void 0) || ''; - context = $.el('div', { - textContent: "(4chan X ccd0 v" + g.VERSION + " " + $.platform + " on " + $.engine + lines + ")" - }); - return [message, error, context]; - }, - reportLink: function(errors) { - var addDetails, data, details, info, title, url; - data = errors[0]; - title = data.message; - if (errors.length > 1) { - title += " (+" + (errors.length - 1) + " other errors)"; - } - details = ''; - addDetails = function(text) { - if (!(encodeURIComponent(title + details + text + '\n').length > 8143)) { - return details += text + '\n'; - } - }; - addDetails("[Please describe the steps needed to reproduce this error.]\n\nScript: 4chan X ccd0 v" + g.VERSION + " " + $.platform + "\nURL: " + location.href + "\nUser agent: " + navigator.userAgent); - if ($.platform === 'userscript' && (info = typeof GM !== "undefined" && GM !== null ? GM.info : (typeof GM_info !== "undefined" && GM_info !== null ? GM_info : void 0))) { - addDetails("Userscript manager: " + info.scriptHandler + " " + info.version); - } - addDetails('\n' + data.error); - if (data.error.stack) { - addDetails(data.error.stack.replace(data.error.toString(), '').trim()); - } - if (data.html) { - addDetails('\n`' + data.html + '`'); - } - details = details.replace(/file:\/{3}.+\//g, ''); - url = 'https://github.com/ccd0/4chan-x/issues'.replace('%title', encodeURIComponent(title)).replace('%details', encodeURIComponent(details)); - return {innerHTML: " [report]"}; - }, - isThisPageLegit: function() { - if (!('thisPageIsLegit' in Main)) { - Main.thisPageIsLegit = g.SITE.isThisPageLegit ? g.SITE.isThisPageLegit() : !/^[45]\d\d\b/.test(document.title) && !/\.(?:json|rss)$/.test(location.pathname); - } - return Main.thisPageIsLegit; - }, - ready: function(cb) { - return $.ready(function() { - if (Main.isThisPageLegit()) { - return cb(); - } - }); - }, - mounted: function(cb) { - if (Main.isMounted) { - return cb(); - } else { - return Main.mountedCBs.push(cb); - } - }, - mountedCBs: [], - features: [['Polyfill', Polyfill], ['Board Configuration', BoardConfig], ['Normalize URL', NormalizeURL], ['Delay Redirect on Post', PostRedirect], ['Captcha Configuration', Captcha.replace], ['Image Host Rewriting', ImageHost], ['Redirect', Redirect], ['Header', Header], ['Catalog Links', CatalogLinks], ['Settings', Settings], ['Index Generator', Index], ['Disable Autoplay', AntiAutoplay], ['Announcement Hiding', PSAHiding], ['Fourchan thingies', Fourchan], ['Tinyboard Glue', Tinyboard], ['Color User IDs', IDColor], ['Highlight by User ID', IDHighlight], ['Count Posts by ID', IDPostCount], ['Custom CSS', CustomCSS], ['Thread Links', ThreadLinks], ['Linkify', Linkify], ['Reveal Spoilers', RemoveSpoilers], ['Resurrect Quotes', Quotify], ['Filter', Filter], ['Thread Hiding Buttons', ThreadHiding], ['Reply Hiding Buttons', PostHiding], ['Recursive', Recursive], ['Strike-through Quotes', QuoteStrikeThrough], ['Quick Reply Personas', QR.persona], ['Quick Reply', QR], ['Cooldown', QR.cooldown], ['Post Jumper', PostJumper], ['Pass Link', PassLink], ['Menu', Menu], ['Index Generator (Menu)', Index.menu], ['Report Link', ReportLink], ['Copy Text Link', CopyTextLink], ['Thread Hiding (Menu)', ThreadHiding.menu], ['Reply Hiding (Menu)', PostHiding.menu], ['Delete Link', DeleteLink], ['Filter (Menu)', Filter.menu], ['Edit Link', QR.oekaki.menu], ['Download Link', DownloadLink], ['Archive Link', ArchiveLink], ['Quote Inlining', QuoteInline], ['Quote Previewing', QuotePreview], ['Quote Backlinks', QuoteBacklink], ['Mark Quotes of You', QuoteYou], ['Mark OP Quotes', QuoteOP], ['Mark Cross-thread Quotes', QuoteCT], ['Anonymize', Anonymize], ['Time Formatting', Time], ['Relative Post Dates', RelativeDates], ['File Info Formatting', FileInfo], ['Fappe Tyme', FappeTyme], ['Gallery', Gallery], ['Gallery (menu)', Gallery.menu], ['Sauce', Sauce], ['Image Expansion', ImageExpand], ['Image Expansion (Menu)', ImageExpand.menu], ['Reveal Spoiler Thumbnails', RevealSpoilers], ['Image Loading', ImageLoader], ['Image Hover', ImageHover], ['Volume Control', Volume], ['WEBM Metadata', Metadata], ['Comment Expansion', ExpandComment], ['Thread Expansion', ExpandThread], ['Favicon', Favicon], ['Unread', Unread], ['Unread Line in Index', UnreadIndex], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Watcher', ThreadWatcher], ['Thread Watcher (Menu)', ThreadWatcher.menu], ['Mark New IPs', MarkNewIPs], ['Index Navigation', Nav], ['Keybinds', Keybinds], ['Banner', Banner], ['Announcements', PSA], ['Flash Features', Flash], ['Reply Pruning', ReplyPruning], ['Mod Contact Links', ModContact]] - }; - - return Main; - -}).call(this); - -Main.init(); - -})(); diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx deleted file mode 100644 index d6deffe5a..000000000 Binary files a/builds/4chan-X.crx and /dev/null differ diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js deleted file mode 100644 index 1e2bf8e71..000000000 --- a/builds/4chan-X.meta.js +++ /dev/null @@ -1,113 +0,0 @@ -// ==UserScript== -// @name 4chan X -// @version 1.14.22.4 -// @minGMVer 1.14 -// @minFFVer 26 -// @namespace 4chan-X -// @description 4chan X is a script that adds various features to anonymous imageboards. -// @license MIT; https://github.com/ccd0/4chan-x/blob/master/LICENSE -// @include http://boards.4chan.org/* -// @include https://boards.4chan.org/* -// @include http://sys.4chan.org/* -// @include https://sys.4chan.org/* -// @include http://www.4chan.org/* -// @include https://www.4chan.org/* -// @include http://boards.4channel.org/* -// @include https://boards.4channel.org/* -// @include http://sys.4channel.org/* -// @include https://sys.4channel.org/* -// @include http://www.4channel.org/* -// @include https://www.4channel.org/* -// @include http://i.4cdn.org/* -// @include https://i.4cdn.org/* -// @include http://is.4chan.org/* -// @include https://is.4chan.org/* -// @include http://is2.4chan.org/* -// @include https://is2.4chan.org/* -// @include http://is.4channel.org/* -// @include https://is.4channel.org/* -// @include http://is2.4channel.org/* -// @include https://is2.4channel.org/* -// @include https://erischan.org/* -// @include https://www.erischan.org/* -// @include https://fufufu.moe/* -// @include https://gnfos.com/* -// @include https://himasugi.blog/* -// @include https://www.himasugi.blog/* -// @include https://kakashinenpo.com/* -// @include https://www.kakashinenpo.com/* -// @include https://kissu.moe/* -// @include https://www.kissu.moe/* -// @include https://lainchan.org/* -// @include https://www.lainchan.org/* -// @include https://merorin.com/* -// @include https://ota-ch.com/* -// @include https://www.ota-ch.com/* -// @include https://ponyville.us/* -// @include https://www.ponyville.us/* -// @include https://smuglo.li/* -// @include https://notso.smuglo.li/* -// @include https://smugloli.net/* -// @include https://smug.nepu.moe/* -// @include https://sportschan.org/* -// @include https://www.sportschan.org/* -// @include https://sushigirl.us/* -// @include https://www.sushigirl.us/* -// @include https://tvch.moe/* -// @exclude http://www.4chan.org/advertise -// @exclude https://www.4chan.org/advertise -// @exclude http://www.4chan.org/advertise?* -// @exclude https://www.4chan.org/advertise?* -// @exclude http://www.4chan.org/donate -// @exclude https://www.4chan.org/donate -// @exclude http://www.4chan.org/donate?* -// @exclude https://www.4chan.org/donate?* -// @exclude http://www.4channel.org/advertise -// @exclude https://www.4channel.org/advertise -// @exclude http://www.4channel.org/advertise?* -// @exclude https://www.4channel.org/advertise?* -// @exclude http://www.4channel.org/donate -// @exclude https://www.4channel.org/donate -// @exclude http://www.4channel.org/donate?* -// @exclude https://www.4channel.org/donate?* -// @connect 4chan.org -// @connect 4channel.org -// @connect 4cdn.org -// @connect 4chenz.github.io -// @connect archive.4plebs.org -// @connect warosu.org -// @connect desuarchive.org -// @connect boards.fireden.net -// @connect arch.b4k.co -// @connect archived.moe -// @connect thebarchive.com -// @connect archiveofsins.com -// @connect www.tokyochronos.net -// @connect archive.palanq.win -// @connect eientei.xyz -// @connect api.clyp.it -// @connect api.dailymotion.com -// @connect api.github.com -// @connect soundcloud.com -// @connect api.streamable.com -// @connect vimeo.com -// @connect www.youtube.com -// @connect * -// @grant GM_getValue -// @grant GM_setValue -// @grant GM_deleteValue -// @grant GM_listValues -// @grant GM_addValueChangeListener -// @grant GM_openInTab -// @grant GM_xmlhttpRequest -// @grant GM.getValue -// @grant GM.setValue -// @grant GM.deleteValue -// @grant GM.listValues -// @grant GM.openInTab -// @grant GM.xmlHttpRequest -// @run-at document-start -// @updateURL https://www.4chan-x.net/builds/4chan-X.meta.js -// @downloadURL https://www.4chan-x.net/builds/4chan-X.user.js -// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAF5JREFUeNrtkTESABAQxPD/R6tsE2dUGYUtFJvLDKf93KevHJAjpBorAQWSBIKqFASC4G0pCAkm4GfaEvgYXl0T6HBaE97f0vmnfYHbZOMLZCx9ISdKWwjOWZSC8GYm4SUGwfYgqI4AAAAASUVORK5CYII= -// ==/UserScript== diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js deleted file mode 100644 index 2cbbe7fb1..000000000 --- a/builds/4chan-X.user.js +++ /dev/null @@ -1,27999 +0,0 @@ -// ==UserScript== -// @name 4chan X -// @version 1.14.22.4 -// @minGMVer 1.14 -// @minFFVer 26 -// @namespace 4chan-X -// @description 4chan X is a script that adds various features to anonymous imageboards. -// @license MIT; https://github.com/ccd0/4chan-x/blob/master/LICENSE -// @include http://boards.4chan.org/* -// @include https://boards.4chan.org/* -// @include http://sys.4chan.org/* -// @include https://sys.4chan.org/* -// @include http://www.4chan.org/* -// @include https://www.4chan.org/* -// @include http://boards.4channel.org/* -// @include https://boards.4channel.org/* -// @include http://sys.4channel.org/* -// @include https://sys.4channel.org/* -// @include http://www.4channel.org/* -// @include https://www.4channel.org/* -// @include http://i.4cdn.org/* -// @include https://i.4cdn.org/* -// @include http://is.4chan.org/* -// @include https://is.4chan.org/* -// @include http://is2.4chan.org/* -// @include https://is2.4chan.org/* -// @include http://is.4channel.org/* -// @include https://is.4channel.org/* -// @include http://is2.4channel.org/* -// @include https://is2.4channel.org/* -// @include https://erischan.org/* -// @include https://www.erischan.org/* -// @include https://fufufu.moe/* -// @include https://gnfos.com/* -// @include https://himasugi.blog/* -// @include https://www.himasugi.blog/* -// @include https://kakashinenpo.com/* -// @include https://www.kakashinenpo.com/* -// @include https://kissu.moe/* -// @include https://www.kissu.moe/* -// @include https://lainchan.org/* -// @include https://www.lainchan.org/* -// @include https://merorin.com/* -// @include https://ota-ch.com/* -// @include https://www.ota-ch.com/* -// @include https://ponyville.us/* -// @include https://www.ponyville.us/* -// @include https://smuglo.li/* -// @include https://notso.smuglo.li/* -// @include https://smugloli.net/* -// @include https://smug.nepu.moe/* -// @include https://sportschan.org/* -// @include https://www.sportschan.org/* -// @include https://sushigirl.us/* -// @include https://www.sushigirl.us/* -// @include https://tvch.moe/* -// @exclude http://www.4chan.org/advertise -// @exclude https://www.4chan.org/advertise -// @exclude http://www.4chan.org/advertise?* -// @exclude https://www.4chan.org/advertise?* -// @exclude http://www.4chan.org/donate -// @exclude https://www.4chan.org/donate -// @exclude http://www.4chan.org/donate?* -// @exclude https://www.4chan.org/donate?* -// @exclude http://www.4channel.org/advertise -// @exclude https://www.4channel.org/advertise -// @exclude http://www.4channel.org/advertise?* -// @exclude https://www.4channel.org/advertise?* -// @exclude http://www.4channel.org/donate -// @exclude https://www.4channel.org/donate -// @exclude http://www.4channel.org/donate?* -// @exclude https://www.4channel.org/donate?* -// @connect 4chan.org -// @connect 4channel.org -// @connect 4cdn.org -// @connect 4chenz.github.io -// @connect archive.4plebs.org -// @connect warosu.org -// @connect desuarchive.org -// @connect boards.fireden.net -// @connect arch.b4k.co -// @connect archived.moe -// @connect thebarchive.com -// @connect archiveofsins.com -// @connect www.tokyochronos.net -// @connect archive.palanq.win -// @connect eientei.xyz -// @connect api.clyp.it -// @connect api.dailymotion.com -// @connect api.github.com -// @connect soundcloud.com -// @connect api.streamable.com -// @connect vimeo.com -// @connect www.youtube.com -// @connect * -// @grant GM_getValue -// @grant GM_setValue -// @grant GM_deleteValue -// @grant GM_listValues -// @grant GM_addValueChangeListener -// @grant GM_openInTab -// @grant GM_xmlhttpRequest -// @grant GM.getValue -// @grant GM.setValue -// @grant GM.deleteValue -// @grant GM.listValues -// @grant GM.openInTab -// @grant GM.xmlHttpRequest -// @run-at document-start -// @updateURL https://www.4chan-x.net/builds/4chan-X.meta.js -// @downloadURL https://www.4chan-x.net/builds/4chan-X.user.js -// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAF5JREFUeNrtkTESABAQxPD/R6tsE2dUGYUtFJvLDKf93KevHJAjpBorAQWSBIKqFASC4G0pCAkm4GfaEvgYXl0T6HBaE97f0vmnfYHbZOMLZCx9ISdKWwjOWZSC8GYm4SUGwfYgqI4AAAAASUVORK5CYII= -// ==/UserScript== - -/* -* 4chan X -* -* Licensed under the MIT license. -* https://github.com/ccd0/4chan-x/blob/master/LICENSE -* -* Appchan X Copyright © 2013-2016 Zixaphir -* http://zixaphir.github.io/appchan-x/ -* 4chan x Copyright © 2009-2011 James Campos -* https://github.com/aeosynth/4chan-x -* 4chan x Copyright © 2012-2014 Nicolas Stepien -* https://4chan-x.just-believe.in/ -* 4chan x Copyright © 2013-2014 Jordan Bates -* http://seaweedchan.github.io/4chan-x/ -* 4chan x Copyright © 2012-2013 ihavenoface -* http://ihavenoface.github.io/4chan-x/ -* 4chan SS Copyright © 2011-2013 Ahodesuka -* https://github.com/ahodesuka/4chan-Style-Script/ -* -* Permission is hereby granted, free of charge, to any person -* obtaining a copy of this software and associated documentation -* files (the "Software"), to deal in the Software without -* restriction, including without limitation the rights to use, -* copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following -* conditions: -* -* The above copyright notice and this permission notice shall be -* included in all copies or substantial portions of the Software. -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -* OTHER DEALINGS IN THE SOFTWARE. -* -* Contributors: -* aeosynth -* mayhemydg -* noface -* !K.WeEabo0o -* blaise -* that4chanwolf -* desuwa -* seaweed -* e000 -* ahodesuka -* Shou -* ferongr -* xat -* Ongpot -* thisisanon -* Anonymous -* Seiba -* herpaderpderp -* WakiMiko -* btmcsweeney -* AppleBloom -* detharonil -* -* All the people who've taken the time to write bug reports. -* -* Thank you. -*/ - -/* -* Contains data from external sources: -* -* src/Monitoring/ThreadUpdater/beep.wav from http://freesound.org/people/pierrecartoons1979/sounds/90112/ -* cc-by-nc-3.0 -* -* Font Awesome by Dave Gandy (http://fontawesome.io) -* license: http://fontawesome.io/license/ -* -* Icons used to identify various websites are property of the respective websites. -*/ - -(function() { - -'use strict'; - -var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, BoardConfig, CSS, Callbacks, Captcha, CatalogLinks, CatalogThread, CatalogThreadNative, Config, Connection, CopyTextLink, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Flash, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, IDPostCount, ImageCommon, ImageExpand, ImageHost, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, ModContact, Nav, NormalizeURL, Notice, PSA, PSAHiding, PassLink, PassMessage, Polyfill, Post, PostHiding, PostJumper, PostRedirect, PostSuccessful, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, ReplyPruning, Report, ReportLink, RevealSpoilers, SW, Sauce, Settings, ShimSet, SimpleDict, Site, Test, Thread, ThreadHiding, ThreadLinks, ThreadStats, ThreadUpdater, ThreadWatcher, Time, Tinyboard, UI, Unread, UnreadIndex, Volume; - -var Conf, E, c, d, doc, docSet, g; - -Conf = Object.create(null); -c = console; -d = document; -doc = d.documentElement; - -// Workaround for userscript managers that run script before document.documentElement is set -docSet = function() { - return (doc = d.documentElement); -}; - -g = { - VERSION: '1.14.22.4', - NAMESPACE: '4chan X.', - sites: Object.create(null), - boards: Object.create(null) -}; - -E = (function() { - var fn, r, regex, str; - str = { - '&': '&', - "'": ''', - '"': '"', - '<': '<', - '>': '>' - }; - r = String.prototype.replace; - regex = /[&"'<>]/g; - fn = function(x) { - return str[x]; - }; - return function(text) { - return r.call(text, regex, fn); - }; -})(); - -E.cat = function(templates) { - var html, i, len; - html = ''; - for (i = 0, len = templates.length; i < len; i++) { - html += templates[i].innerHTML; - } - return html; -}; - -Config = (function() { - var Config; - - Config = { - main: { - 'Miscellaneous': { - 'Redirect to HTTPS': [true, 'Redirect to the HTTPS version of 4chan.'], - 'JSON Index': [true, 'Replace the original board index with one supporting searching, sorting, infinite scrolling, and a catalog mode.'], - 'Use 4chan X Catalog': [true, 'Link to 4chan X\'s catalog instead of the native 4chan one.', 1], - 'Index Refresh Notifications': [false, 'Show a notice at the top of the page when the index is refreshed.', 1], - 'Follow Cursor': [true, 'Image Hover and Quote Preview move with the mouse cursor.'], - 'Open Threads in New Tab': [false, 'Make links to threads in the index / 4chan X catalog open in a new tab.'], - 'External Catalog': [false, 'Link to external catalog instead of the internal one.'], - 'Catalog Links': [false, 'Add toggle link in header menu to turn Navigation links into links to each board\'s catalog.'], - 'Announcement Hiding': [true, 'Add button to hide 4chan announcements.'], - 'Desktop Notifications': [true, 'Enables desktop notifications across various 4chan X features.'], - '404 Redirect': [true, 'Redirect dead threads and images to the archives.'], - 'Archive Report': [true, 'Enable reporting posts to supported archives.'], - 'Exempt Archives from Encryption': [true, 'Permit loading content from, and warningless redirects to, HTTP-only archives from HTTPS pages.'], - 'Keybinds': [true, 'Bind actions to keyboard shortcuts.'], - 'Time Formatting': [true, 'Localize and format timestamps.'], - 'Relative Post Dates': [true, 'Display dates like "3 minutes ago". Tooltip shows the timestamp.'], - 'Relative Date Title': [true, 'Show Relative Post Date only when hovering over dates.', 1], - 'Comment Expansion': [true, 'Expand comments that are too long to display on the index. Not applicable with JSON Index.'], - 'File Info Formatting': [true, 'Reformat the file information.'], - 'Thread Expansion': [true, 'Add buttons to expand threads.'], - 'Index Navigation': [false, 'Add buttons to navigate between threads.'], - 'Reply Navigation': [false, 'Add buttons to navigate to top / bottom of thread.'], - 'Unique ID and Capcode Navigation': [false, 'Add buttons to navigate to posts having the same unique ID or capcode.'], - 'Custom Board Titles': [true, 'Allow editing of the board title and subtitle by ctrl/\u2318+clicking them.'], - 'Persistent Custom Board Titles': [false, 'Force custom board titles to be persistent, even if the board titles are updated.', 1], - 'Show Updated Notifications': [true, 'Show notifications when 4chan X is successfully updated.'], - 'Color User IDs': [true, 'Assign unique colors to user IDs on boards that use them'], - 'Count Posts by ID': [true, 'Display number of posts in the thread when hovering over an ID.'], - 'Remove Spoilers': [false, 'Remove all spoilers in text.'], - 'Reveal Spoilers': [false, 'Indicate spoilers if Remove Spoilers is enabled, or make the text appear hovered if Remove Spoiler is disabled.'], - 'Normalize URL': [true, 'Rewrite the URL of the current page, removing slugs and excess slashes, and changing /res/ to /thread/.'], - 'Work around CORB Bug': [true, 'Leave this checked until your garbage browser is fixed.'], - 'Disable Autoplaying Sounds': [false, 'Prevent sounds on the page from autoplaying.'], - 'Disable Native Extension': [true, '4chan X is NOT designed to work with the native extension.'], - 'Enable Native Flash Embedding': [true, 'Activate the native extension\'s Flash embedding if the native extension is disabled.'] - }, - 'Linkification': { - 'Linkify': [true, 'Convert text into links where applicable.'], - 'Link Title': [true, 'Replace the link of a supported site with its actual title.', 1], - 'Cover Preview': [true, 'Show preview of supported links on hover.', 1], - 'Embedding': [true, 'Embed supported services. Note: Some services don\'t work on HTTPS.', 1], - 'Auto-embed': [false, 'Auto-embed Linkify Embeds.', 2], - 'Floating Embeds': [false, 'Embed content in a frame that remains in place when the page is scrolled.', 2] - }, - 'Filtering': { - 'Anonymize': [false, 'Make everyone Anonymous.'], - 'Filter': [true, 'Self-moderation placebo.'], - 'Filtered Backlinks': [false, 'When enabled, shows backlinks to filtered posts with a line-through decoration. Otherwise, hides the backlinks.', 1], - 'Filter in Native Catalog': [true, 'Apply 4chan X filters in native catalog.', 1], - 'MD5 Quick Filter Notifications': [true, 'Show notification when quick filtering MD5s using the button or keybind.', 1], - 'Recursive Hiding': [true, 'Hide replies of hidden posts, recursively.'], - 'Thread Hiding Buttons': [true, 'Add buttons to hide entire threads.'], - 'Reply Hiding Buttons': [true, 'Add buttons to hide single replies.'], - 'Stubs': [true, 'Show stubs of hidden threads / replies.'] - }, - 'Images and Videos': { - 'Image Expansion': [true, 'Expand images / videos.'], - 'Image Hover': [true, 'Show full image / video on mouseover.'], - 'Image Hover in Catalog': [true, 'Show full image / video on mouseover in 4chan X catalog.'], - 'Gallery': [true, 'Adds a simple and cute image gallery. Has more options in the gallery menu.'], - 'Fullscreen Gallery': [false, 'Open gallery in fullscreen mode.', 1], - 'PDF in Gallery': [false, 'Show PDF files in gallery.', 1], - 'Sauce': [true, 'Add sauce links to images.'], - 'WEBM Metadata': [true, 'Add link to fetch title metadata from webm videos.'], - 'Reveal Spoiler Thumbnails': [false, 'Replace spoiler thumbnails with the original image.'], - 'Replace GIF': [false, 'Replace gif thumbnails with the actual image.'], - 'Replace JPG': [false, 'Replace jpg thumbnails with the actual image.'], - 'Replace PNG': [false, 'Replace png thumbnails with the actual image.'], - 'Replace WEBM': [false, 'Replace webm, mp4, and ogv thumbnails with the actual video. Probably will degrade browser performance ;)'], - 'Image Prefetching': [true, 'Add a shortcut icon to the header to turn on image preloading.'], - 'Fappe Tyme': [true, 'Hide posts without images when header menu item is checked. *hint* *hint*'], - 'Werk Tyme': [true, 'Hide all post images when header menu item is checked.'], - 'Autoplay': [true, 'Videos begin playing immediately when opened.'], - 'Restart when Opened': [false, 'Restart GIFs and WebMs when you hover over or expand them.'], - 'Show Controls': [true, 'Show controls on videos expanded inline.'], - 'Click Passthrough': [false, 'Clicks on videos trigger your browser\'s default behavior. Videos can be contracted with button / dragging to the left.', 1], - 'Allow Sound': [true, 'Open videos with the sound unmuted.'], - 'Mouse Wheel Volume': [true, 'Adjust volume of videos with the mouse wheel over the thumbnail/filename/gallery.'], - 'Loop in New Tab': [true, 'Loop videos opened in their own tabs.'], - 'Volume in New Tab': [true, 'Apply 4chan X mute and volume settings to videos opened in their own tabs.'] - }, - 'Menu': { - 'Menu': [true, 'Add a drop-down menu to posts.'], - 'Report Link': [true, 'Add a report link to the menu.', 1], - 'Copy Text Link': [true, 'Add a link to copy the post\'s text.', 1], - 'Thread Hiding Link': [true, 'Add a link to hide entire threads.', 1], - 'Reply Hiding Link': [true, 'Add a link to hide single replies.', 1], - 'Delete Link': [true, 'Add post and image deletion links to the menu.', 1], - 'Archive Link': [true, 'Add an archive link to the menu.', 1], - 'Edit Link': [true, 'Add a link to edit the image in Tegaki, /i/\'s painting program. Requires Quick Reply.', 1], - 'Download Link': [false, 'Add a download with original filename link to the menu.', 1] - }, - 'Monitoring': { - 'Thread Updater': [true, 'Fetch and insert new replies. Has more options in the header menu and the "Advanced" tab.'], - 'Unread Count': [true, 'Show the unread posts count in the tab title.'], - 'Quoted Title': [false, 'Change the page title to reflect you\'ve been quoted.', 1], - 'Hide Unread Count at (0)': [false, 'Hide the unread posts count in the tab title when it reaches 0.', 1], - 'Unread Favicon': [true, 'Show a different favicon when there are unread posts.'], - 'Unread Line': [true, 'Show a line to distinguish read posts from unread ones.'], - 'Remember Last Read Post': [true, 'Remember how far you\'ve read after you close the thread.'], - 'Scroll to Last Read Post': [true, 'Scroll back to the last read post when reopening a thread.', 1], - 'Unread Line in Index': [false, 'Show a line between read and unread posts in threads in the index.', 1], - 'Remove Thread Excerpt': [false, 'Replace the excerpt of the thread in the tab title with the board title.'], - 'Thread Stats': [true, 'Display reply and image count.'], - 'IP Count in Stats': [true, 'Display the unique IP count in the thread stats.', 1], - 'Page Count in Stats': [true, 'Display the page count in the thread stats.', 1], - 'Updater and Stats in Header': [true, 'Places the thread updater and thread stats in the header instead of floating them.'], - 'Thread Watcher': [true, 'Bookmark threads. Has more options in the thread watcher menu.'], - 'Fixed Thread Watcher': [true, 'Makes the thread watcher scroll with the page.', 1], - 'Persistent Thread Watcher': [false, 'The thread watcher will be visible when the page is loaded.', 1], - 'Mark New IPs': [false, 'Label each post from a new IP with the thread\'s current IP count.'], - 'Reply Pruning': [true, 'Add option in header menu to hide old replies in long threads. Activated by default in stickies.'], - 'Prune All Threads': [false, 'Activate Reply Pruning by default in all threads.', 1] - }, - 'Posting and Captchas': { - 'Quick Reply': [true, 'All-in-one form to reply, create threads, automate dumping and more.'], - 'Persistent QR': [false, 'The Quick reply won\'t disappear after posting.', 1], - 'Auto Hide QR': [true, 'Automatically hide the quick reply when posting.', 2], - 'Open Post in New Tab': [true, 'Open new threads in a new tab, and open replies in a new tab if you\'re not already in the thread.', 1], - 'Remember QR Size': [false, 'Remember the size of the Quick reply.', 1], - 'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.', 1], - 'Randomize Filename': [false, 'Set the filename to a random timestamp within the past year. Disabled on /f/.', 1], - 'Show New Thread Option in Threads': [true, 'Show the option to post a new / different thread from inside a thread.', 1], - 'Show Upload Progress': [true, 'Track progress of file uploads as percentage in submit button.', 1], - 'Cooldown': [true, 'Indicate the remaining time before posting again.', 1], - 'Posting Success Notifications': [true, 'Show notifications on successful post creation or file uploading.', 1], - 'Auto-load captcha': [false, 'Automatically load the captcha in the QR even if your post is empty.', 1], - 'Post on Captcha Completion': [false, 'Submit the post immediately when the captcha is completed.', 1], - 'Force Noscript Captcha': [false, 'Use the non-Javascript fallback captcha even if Javascript is enabled.'], - 'Pass Link': [false, 'Add a 4chan Pass login link to the bottom of the page.'] - }, - 'Quote Links': { - 'Quote Backlinks': [true, 'Add quote backlinks.'], - 'OP Backlinks': [true, 'Add backlinks to the OP.', 1], - 'Bottom Backlinks': [false, 'Place backlinks at the bottom of posts.', 1], - 'Quote Inlining': [true, 'Inline quoted post on click.'], - 'Inline Cross-thread Quotes Only': [false, 'Don\'t inline quote links when the posts are visible in the thread.', 1], - 'Quote Hash Navigation': [false, 'Include an extra link after quotes for autoscrolling to quoted posts.', 1], - 'Forward Hiding': [true, 'Hide original posts of inlined backlinks.', 1], - 'Quote Previewing': [true, 'Show quoted post on hover.'], - 'Quote Highlighting': [true, 'Highlight the previewed post.', 1], - 'Resurrect Quotes': [true, 'Link dead quotes to the archives, and support inlining/previewing of archive links like quote links.'], - 'Remember Your Posts': [true, 'Remember your posting history.'], - 'Mark Quotes of You': [true, 'Add \'(You)\' to quotes linking to your posts.', 1], - 'Highlight Posts Quoting You': [true, 'Highlights any posts that contain a quote to your post.', 1], - 'Highlight Own Posts': [true, 'Highlights own posts.', 1], - 'Mark OP Quotes': [true, 'Add \'(OP)\' to OP quotes.'], - 'Mark Cross-thread Quotes': [true, 'Add \'(Cross-thread)\' to cross-threads quotes.'], - 'Quote Threading': [true, 'Add option in header menu to thread conversations.'] - } - }, - imageExpansion: { - 'Fit width': [true, ''], - 'Fit height': [false, ''], - 'Scroll into view': [true, 'Scroll down when expanding images to bring the full image into view.'], - 'Expand spoilers': [true, 'Expand all images along with spoilers.'], - 'Expand videos': [true, 'Expand all images also expands videos.'], - 'Expand from here': [false, 'Expand all images only from current position to thread end.'], - 'Expand thread only': [false, 'In index, expand all images only within the current thread.'], - 'Advance on contract': [false, 'Advance to next post when contracting an expanded image.'] - }, - gallery: { - 'Hide Thumbnails': [false], - 'Fit Width': [true], - 'Fit Height': [true], - 'Stretch to Fit': [false], - 'Scroll to Post': [true], - 'Slide Delay': [6.0] - }, - 'Default Volume': 1.0, - threadWatcher: { - 'Current Board': [false, 'Only show watched threads from the current board.'], - 'Auto Update Thread Watcher': [true, 'Periodically check status of watched threads.'], - 'Auto Watch': [true, 'Automatically watch threads you start.'], - 'Auto Watch Reply': [true, 'Automatically watch threads you reply to.'], - 'Auto Prune': [false, 'Automatically remove dead threads.'], - 'Show Page': [true, 'Show what page watched threads are on.'], - 'Show Unread Count': [true, 'Show number of unread posts in watched threads.'], - 'Show Site Prefix': [true, 'When multiple sites are shown in the thread watcher, add a prefix to board names to distinguish them.'], - 'Require OP Quote Link': [false, 'For purposes of thread watcher highlighting, only consider posts with a quote link to the OP as replies to the OP.'] - }, - filter: { - general: '', - postID: "# Highlight dubs on [s4s]:\n#/(\\d)\\1$/;highlight;top:no;boards:s4s", - name: "# Filter any namefags:\n#/^(?!Anonymous$)/", - uniqueID: "# Filter a specific ID:\n#/Txhvk1Tl/", - tripcode: "# Filter any tripfag\n#/^!/", - capcode: "# Set a custom class for mods:\n#/Mod$/;highlight:mod;op:yes\n# Set a custom class for admins:\n#/Admin$/;highlight:admin;op:yes", - pass: "# Filter anyone using since4pass:\n#/./", - email: '', - subject: "# Filter Generals on /v/:\n#/general/i;boards:v;op:only", - comment: "# Filter Stallman copypasta on /g/:\n#/what you\'re refer+ing to as linux/i;boards:g\n# Filter posts with 20 or more quote links:\n#/(?:>>\\d(?:(?!>>\\d)[^])*){20}/\n# Filter posts like T H I S / H / I / S:\n#/^>?\\s?\\w\\s?(\\w)\\s?(\\w)\\s?(\\w).*$[\\s>]+\\1[\\s>]+\\2[\\s>]+\\3/im", - flag: '', - filename: '', - dimensions: "# Highlight potential wallpapers:\n#/1920x1080/;op:yes;highlight;top:no;boards:w,wg", - filesize: '', - MD5: '' - }, - sauces: "# Known filename formats:\nhttps://www.pixiv.net/member_illust.php?mode=medium&illust_id=%$1;regexp:/^(\\d+)_p\\d+/\njavascript:void(open(\"https://www.deviantart.com/\"+%$1.replace(/_/g,\"-\")+\"/art/\"+parseInt(%$2,36)));regexp:/^\\w+_by_(\\w+)[_-]d([\\da-z]{6})\\b/\nhttps://imgur.com/%$1;regexp:/^(?![a-zA-Z][a-z]{6})(?![A-Z]{7})(?!\\d{7})([\\da-zA-Z]{7})(?: \\(\\d+\\))?\\.\\w+$/\nhttps://flickr.com/photo.gne?id=%$1;regexp:/^(\\d+)_[\\da-f]{10}(?:_\\w)*\\b/\nhttps://www.facebook.com/photo.php?fbid=%$1;regexp:/^\\d+_(\\d+)_\\d+_[no]\\b/\n\n# Reverse image search:\nhttps://www.google.com/searchbyimage?sbisrc=4chanx&image_url=%IMG&safe=off\nhttps://yandex.com/images/search?rpt=imageview&url=%IMG\n#//tineye.com/search?url=%IMG\n#//www.bing.com/images/search?q=imgurl:%IMG&view=detailv2&iss=sbi#enterInsights\n#https://lens.google.com/uploadbyurl?url=%IMG;text:lens\n\n# Specialized reverse image search:\n//iqdb.org/?url=%IMG\nhttps://trace.moe/?auto&url=%IMG;text:wait\n#//3d.iqdb.org/?url=%IMG\n#//saucenao.com/search.php?url=%IMG\n\n# \"View Same\" in archives:\nhttp://eye.swfchan.com/search/?q=%name;types:swf\n#https://desuarchive.org/_/search/image/%sMD5/\n#https://archive.4plebs.org/_/search/image/%sMD5/\n#https://boards.fireden.net/_/search/image/%sMD5/\n#https://foolz.fireden.net/_/search/image/%sMD5/\n\n# Other tools:\n#http://exif.regex.info/exif.cgi?imgurl=%URL\n#//imgops.com/start?url=%URL;types:gif,jpg,png\n#//www.gif-explode.com/%URL;types:gif", - FappeT: { - werk: false - }, - 'Custom CSS': true, - Index: { - 'Index Mode': 'paged', - 'Previous Index Mode': 'paged', - 'Index Size': 'small', - 'Show Replies': [true, 'Show replies in the index, and also in the catalog if "Catalog hover expand" is checked.'], - 'Catalog Hover Expand': [false, 'Expand the comment and show more details when you hover over a thread in the catalog.'], - 'Catalog Hover Toggle': [true, 'Turn "Catalog hover expand" on and off by clicking in the catalog.'], - 'Pin Watched Threads': [false, 'Move watched threads to the start of the index.'], - 'Anchor Hidden Threads': [true, 'Move hidden threads to the end of the index.'], - 'Refreshed Navigation': [false, 'Refresh index when navigating through pages.'] - }, - Header: { - 'Fixed Header': true, - 'Header auto-hide': false, - 'Header auto-hide on scroll': false, - 'Bottom Header': false, - 'Centered links': false, - 'Header catalog links': false, - 'Bottom Board List': true, - 'Shortcut Icons': true, - 'Custom Board Navigation': true - }, - archives: { - archiveLists: 'https://4chenz.github.io/archives.json/archives.json', - lastarchivecheck: 0, - archiveAutoUpdate: true - }, - externalCatalogURLs: "//catalog.neet.tv/%board/;boards:4chan.org:3,a,adv,an,asp,biz,c,cgl,ck,cm,co,diy,f,fa,fit,g,gd,his,i,int,jp,k,lgbt,lit,m,mlp,mu,n,news,o,out,p,po,pol,s4s,sci,sp,tg,toy,trv,tv,v,vg,vip,vp,vr,w,wg,wsg,wsr,x", - boardnav: "[ toggle-all ]\n[current-index-text:\"Index\"\ncurrent-catalog-text:\"Catalog\"\ncurrent-expired-text:\"Expired\"\ncurrent-archive-text:\"Archive\"]\n[external-text:\"FAQ\",\"https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions\"]", - QR: { - 'QR.personas': "#options:\"sage\";boards:jp;always", - sjisPreview: false - }, - jsWhitelist: 'http://s.4cdn.org\nhttps://s.4cdn.org\nhttp://www.google.com\nhttps://www.google.com\nhttps://www.gstatic.com\nhttp://cdn.mathjax.org\nhttps://cdn.mathjax.org\nhttps://cdnjs.cloudflare.com\nhttps://hcaptcha.com\nhttps://*.hcaptcha.com\n\'self\'\n\'unsafe-inline\'\n\'unsafe-eval\'', - captchaLanguage: '', - time: '%m/%d/%y(%a)%H:%M:%S', - timeLocale: '', - backlink: '>>%id', - pastedname: 'file', - fileInfo: '%l %d (%p%s, %r%g)', - favicon: 'ferongr', - usercss: "/* Board title rice */\ndiv.boardTitle {\n font-weight: 400 !important;\n}\n:root.yotsuba div.boardTitle {\n font-family: sans-serif !important;\n text-shadow: 1px 1px 1px rgba(100,0,0,0.6);\n}\n:root.yotsuba-b div.boardTitle {\n font-family: sans-serif !important;\n text-shadow: 1px 1px 1px rgba(105,10,15,0.6);\n}\n:root.photon div.boardTitle {\n font-family: sans-serif !important;\n text-shadow: 1px 1px 1px rgba(0,74,153,0.6);\n}\n:root.tomorrow div.boardTitle {\n font-family: sans-serif !important;\n text-shadow: 1px 1px 1px rgba(167,170,168,0.6);\n}\n", - hotkeys: { - 'Toggle board list': ['Ctrl+b', 'Toggle the full board list.'], - 'Toggle header': ['Shift+h', 'Toggle the auto-hide option of the header.'], - 'Open empty QR': ['q', 'Open QR without post number inserted.'], - 'Open QR': ['Shift+q', 'Open QR with post number inserted.'], - 'Open settings': ['Alt+o', 'Open Settings.'], - 'Close': ['Esc', 'Close dialogs or notifications.'], - 'Spoiler tags': ['Ctrl+s', 'Insert spoiler tags.'], - 'Code tags': ['Alt+c', 'Insert code tags.'], - 'Eqn tags': ['Alt+e', 'Insert eqn tags.'], - 'Math tags': ['Alt+m', 'Insert math tags.'], - 'SJIS tags': ['Alt+a', 'Insert SJIS tags.'], - 'Toggle sage': ['Alt+s', 'Toggle sage in options field.'], - 'Toggle Cooldown': ['Alt+Comma', 'Toggle custom cooldown timer.'], - 'Post from URL': ['Alt+l', 'Post from URL.'], - 'Add new post': ['Alt+n', 'Add new post to the QR dump list.'], - 'Submit QR': ['Ctrl+Enter', 'Submit post.'], - 'Watch': ['w', 'Watch thread.'], - 'Update': ['r', 'Update the thread / refresh the index.'], - 'Update thread watcher': ['Shift+r', 'Manually refresh thread watcher.'], - 'Toggle thread watcher': ['t', 'Toggle visibility of thread watcher.'], - 'Toggle threading': ['Shift+t', 'Toggle threading.'], - 'Mark thread read': ['Ctrl+0', 'Mark thread read from index (requires "Unread Line in Index").'], - 'Expand image': ['Shift+e', 'Expand selected image.'], - 'Expand images': ['e', 'Expand all images.'], - 'Open Gallery': ['g', 'Opens the gallery.'], - 'Next Gallery Image': ['Right', 'Go to the next image in gallery mode.'], - 'Previous Gallery Image': ['Left', 'Go to the previous image in gallery mode.'], - 'Advance Gallery': ['Enter', 'Go to next image or, if Autoplay is off, play video.'], - 'Pause': ['p', 'Pause/play videos in the gallery.'], - 'Slideshow': ['Ctrl+Right', 'Toggle the gallery slideshow mode.'], - 'Rotate image clockwise': ['Shift+Right', 'Rotate image clockwise in gallery.'], - 'Rotate image anticlockwise': ['Shift+Left', 'Rotate image anticlockwise in gallery.'], - 'Download Gallery Image': ['Shift+j', 'Download current image in gallery.'], - 'fappeTyme': ['f', 'Toggle Fappe Tyme.'], - 'werkTyme': ['Shift+w', 'Toggle Werk Tyme.'], - 'Front page': ['1', 'Jump to front page.'], - 'Open front page': ['Shift+1', 'Open front page in a new tab.'], - 'Next page': ['Ctrl+Right', 'Jump to the next page.'], - 'Previous page': ['Ctrl+Left', 'Jump to the previous page.'], - 'Paged mode': ['Alt+1', 'Open the index in paged mode.'], - 'Infinite scrolling mode': ['Alt+2', 'Open the index in infinite scrolling mode.'], - 'All pages mode': ['Alt+3', 'Open the index in all threads mode.'], - 'Open catalog': ['Shift+c', 'Open the catalog of the current board.'], - 'Search form': ['Ctrl+Alt+s', 'Focus the search field on the board index.'], - 'Cycle sort type': ['Alt+x', 'Cycle through index sort types.'], - 'Next thread': ['Ctrl+Down', 'See next thread.'], - 'Previous thread': ['Ctrl+Up', 'See previous thread.'], - 'Expand thread': ['Ctrl+e', 'Expand thread.'], - 'Open thread': ['o', 'Open thread in current tab.'], - 'Open thread tab': ['Shift+o', 'Open thread in new tab.'], - 'Next reply': ['j', 'Select next reply.'], - 'Previous reply': ['k', 'Select previous reply.'], - 'Deselect reply': ['Shift+d', 'Deselect reply.'], - 'Hide': ['x', 'Hide thread.'], - 'Quick Filter MD5': ['5', 'Add the MD5 of the selected image to the filter list.'], - 'Previous Post Quoting You': ['Alt+Up', 'Scroll to the previous post that quotes you.'], - 'Next Post Quoting You': ['Alt+Down', 'Scroll to the next post that quotes you.'] - }, - updater: { - checkbox: { - 'Beep': [false, 'Beep on new post to completely read thread.'], - 'Beep Quoting You': [false, 'Beep on new post quoting you.'], - 'Auto Scroll': [false, 'Scroll updated posts into view. Only enabled at bottom of page.'], - 'Bottom Scroll': [false, 'Always scroll to the bottom, not the first new post. Useful for event threads.'], - 'Scroll BG': [false, 'Auto-scroll background tabs.'], - 'Auto Update': [true, 'Automatically fetch new posts.'], - 'Optional Increase': [false, 'Increase the intervals between updates on threads without new posts.'] - }, - 'Interval': 5 - }, - customCooldown: 0, - customCooldownEnabled: true, - 'Thread Quotes': false, - 'Max Replies': 1000, - 'Autohiding Scrollbar': false, - position: { - 'embedding.position': 'top: 50px; right: 0px;', - 'thread-stats.position': 'bottom: 0px; right: 0px;', - 'updater.position': 'bottom: 0px; left: 0px;', - 'thread-watcher.position': 'top: 50px; left: 0px;', - 'qr.position': 'top: 50px; right: 0px;' - }, - fourchanImageHost: 'i.4cdn.org', - hiddenPSAList: [{}], - knownBanners: '0.jpg,1.jpg,2.jpg,4.jpg,6.jpg,7.jpg,8.jpg,9.jpg,10.jpg,11.jpg,12.jpg,13.jpg,14.jpg,16.jpg,17.jpg,18.jpg,19.jpg,20.jpg,21.jpg,22.jpg,24.jpg,25.jpg,26.jpg,28.jpg,29.jpg,33.jpg,38.jpg,39.jpg,43.jpg,44.jpg,45.jpg,46.jpg,47.jpg,52.jpg,54.jpg,57.jpg,59.jpg,60.jpg,61.jpg,64.jpg,66.jpg,67.jpg,69.jpg,71.jpg,72.jpg,76.jpg,77.jpg,81.jpg,82.jpg,83.jpg,84.jpg,88.jpg,90.jpg,91.jpg,96.jpg,98.jpg,99.jpg,100.jpg,104.jpg,106.jpg,116.jpg,119.jpg,137.jpg,140.jpg,148.jpg,149.jpg,150.jpg,154.jpg,156.jpg,157.jpg,158.jpg,159.jpg,161.jpg,162.jpg,164.jpg,165.jpg,166.jpg,167.jpg,168.jpg,169.jpg,170.jpg,171.jpg,172.jpg,173.jpg,174.jpg,175.jpg,176.jpg,178.jpg,179.jpg,180.jpg,181.jpg,182.jpg,183.jpg,186.jpg,189.jpg,190.jpg,192.jpg,193.jpg,194.jpg,197.jpg,198.jpg,200.jpg,201.jpg,202.jpg,203.jpg,205.jpg,206.jpg,207.jpg,208.jpg,210.jpg,213.jpg,214.jpg,215.jpg,216.jpg,218.jpg,219.jpg,220.jpg,221.jpg,222.jpg,223.jpg,224.jpg,227.jpg,0.png,1.png,2.png,3.png,5.png,6.png,9.png,10.png,11.png,12.png,14.png,16.png,19.png,20.png,21.png,22.png,23.png,24.png,26.png,27.png,28.png,29.png,30.png,31.png,32.png,33.png,34.png,37.png,39.png,40.png,41.png,42.png,43.png,44.png,45.png,48.png,49.png,50.png,51.png,52.png,53.png,57.png,58.png,59.png,64.png,66.png,67.png,68.png,69.png,70.png,71.png,72.png,76.png,78.png,79.png,81.png,82.png,85.png,86.png,87.png,89.png,95.png,98.png,100.png,101.png,102.png,105.png,106.png,107.png,109.png,110.png,111.png,112.png,113.png,114.png,115.png,116.png,118.png,119.png,120.png,121.png,122.png,123.png,126.png,128.png,130.png,134.png,136.png,138.png,139.png,140.png,142.png,145.png,146.png,149.png,150.png,151.png,152.png,153.png,154.png,155.png,156.png,157.png,158.png,159.png,160.png,163.png,164.png,165.png,166.png,167.png,168.png,169.png,170.png,171.png,172.png,173.png,174.png,178.png,179.png,180.png,181.png,182.png,184.png,186.png,188.png,190.png,192.png,193.png,194.png,195.png,196.png,197.png,198.png,200.png,202.png,203.png,205.png,206.png,207.png,209.png,212.png,213.png,214.png,216.png,217.png,218.png,219.png,220.png,221.png,222.png,223.png,224.png,225.png,226.png,229.png,231.png,232.png,233.png,234.png,235.png,237.png,238.png,239.png,240.png,241.png,242.png,244.png,245.png,246.png,247.png,248.png,249.png,250.png,253.png,254.png,255.png,256.png,257.png,258.png,259.png,260.png,262.png,268.png,0.gif,1.gif,2.gif,3.gif,4.gif,5.gif,6.gif,7.gif,8.gif,9.gif,10.gif,12.gif,13.gif,14.gif,15.gif,16.gif,18.gif,19.gif,20.gif,21.gif,22.gif,23.gif,24.gif,28.gif,29.gif,30.gif,33.gif,34.gif,35.gif,36.gif,37.gif,39.gif,40.gif,42.gif,44.gif,45.gif,46.gif,48.gif,50.gif,52.gif,54.gif,55.gif,57.gif,58.gif,59.gif,60.gif,61.gif,63.gif,64.gif,66.gif,67.gif,68.gif,69.gif,70.gif,72.gif,73.gif,75.gif,76.gif,77.gif,78.gif,80.gif,81.gif,82.gif,83.gif,86.gif,87.gif,88.gif,92.gif,93.gif,94.gif,95.gif,96.gif,97.gif,98.gif,99.gif,100.gif,101.gif,102.gif,103.gif,104.gif,105.gif,106.gif,108.gif,109.gif,110.gif,111.gif,112.gif,113.gif,115.gif,116.gif,117.gif,118.gif,119.gif,120.gif,122.gif,123.gif,124.gif,127.gif,129.gif,130.gif,131.gif,134.gif,135.gif,136.gif,138.gif,139.gif,141.gif,144.gif,146.gif,148.gif,149.gif,153.gif,154.gif,155.gif,157.gif,158.gif,159.gif,160.gif,161.gif,162.gif,164.gif,166.gif,167.gif,168.gif,169.gif,170.gif,171.gif,172.gif,173.gif,174.gif,175.gif,176.gif,177.gif,178.gif,181.gif,182.gif,183.gif,185.gif,186.gif,187.gif,188.gif,189.gif,190.gif,191.gif,192.gif,193.gif,195.gif,196.gif,197.gif,200.gif,201.gif,202.gif,203.gif,204.gif,205.gif,206.gif,207.gif,208.gif,209.gif,210.gif,211.gif,212.gif,213.gif,214.gif,215.gif,216.gif,217.gif,219.gif,220.gif,221.gif,222.gif,224.gif,225.gif,226.gif,227.gif,228.gif,230.gif,232.gif,233.gif,234.gif,235.gif,238.gif,240.gif,241.gif,243.gif,244.gif,245.gif,246.gif,247.gif,249.gif,250.gif,251.gif,253.gif', - passMessageClosed: false, - 'Prerequest Captcha': false, - 'PSAseen': [[]] - }; - - return Config; - -}).call(this); - -CSS = { - -boards: -"/*!\n\ - * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome\n\ - * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)\n\ - */\n\ -@font-face {\n\ - font-family: FontAwesome;\n\ - src: url('data:application/font-woff;base64,d09GRgABAAAAAX7oAA0AAAAChqwABAAHAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABMAAAABwAAAAca75HuUdERUYAAAFMAAAAHwAAACAC8AAET1MvMgAAAWwAAAA+AAAAYIgyekBjbWFwAAABrAAAAWkAAALyCr86f2dhc3AAAAMYAAAACAAAAAj//wADZ2x5ZgAAAyAAAV95AAJMvI/3rk1oZWFkAAFinAAAADMAAAA2EInlLWhoZWEAAWLQAAAAHwAAACQPAwq1aG10eAABYvAAAAL0AAAK8EV5GIVsb2NhAAFl5AAABxYAAAsQAvWiXG1heHAAAWz8AAAAHwAAACADLAIcbmFtZQABbRwAAAJEAAAEhuOXi6xwb3N0AAFvYAAAD4UAABp1r4+boQAAAAEAAAAAzD2izwAAAADLTzwwAAAAANQxaLl4nGNgZGBg4ANiCQYQYGJgZGBkOgQkWcA8BgAMuAD3AHicY2Bmy2ScwMDKwMDSw2LMwMDQBqGZihkYGLsY8ICCyqJi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6IYpCFMQLHqrxAguBMGic0sQIrohohtVQVQFIaIbIrohohsiuiGiGyK6IaIbIrohohsiuiGiGyK6IaIbIrohohsiujEpCIkEhkQCQyKBwaK3SlUV27Q0MaZrxpkivSnSmzoelCYMXZsyWJViQgrmM8VLpuhviv6m6G+K/qbob4r+puhviv6m6G+K/qbob4r+puhviv6m6G+K/qbob4r+Zim5lqVVeoWrxnVd0nVZ13qpq/RSV5m6rup6QteD+VbpekrX07qe0fVsUk9p3inNO6V5pzTvlOad0rxTmndK805p3inNO6V5pzTvlOad0rxTmlcHzdK05p3WvNOad1rzTmveac07rXmnNe+05p3WvNOad1rzTmveac2rY2tJx9bSjOad0bwzmldH2JKOsKUZzTujeWc074zmndG8M5p3RvPOaN5ZzTureWc176zmndW8s5p3VvPOilMmNemsJp3VpLOadFaTzmrS2dn/AboJB4wAAAA=') format('woff');\n\ - font-weight: 400;\n\ - font-style: normal;\n\ -}\n\ -.fa-glass:before {content: \"\\f000\";}\n\ -.fa-music:before {content: \"\\f001\";}\n\ -.fa-search:before {content: \"\\f002\";}\n\ -.fa-envelope-o:before {content: \"\\f003\";}\n\ -.fa-heart:before {content: \"\\f004\";}\n\ -.fa-star:before {content: \"\\f005\";}\n\ -.fa-star-o:before {content: \"\\f006\";}\n\ -.fa-user:before {content: \"\\f007\";}\n\ -.fa-film:before {content: \"\\f008\";}\n\ -.fa-th-large:before {content: \"\\f009\";}\n\ -.fa-th:before {content: \"\\f00a\";}\n\ -.fa-th-list:before {content: \"\\f00b\";}\n\ -.fa-check:before {content: \"\\f00c\";}\n\ -.fa-remove:before, .fa-close:before, .fa-times:before {content: \"\\f00d\";}\n\ -.fa-search-plus:before {content: \"\\f00e\";}\n\ -.fa-search-minus:before {content: \"\\f010\";}\n\ -.fa-power-off:before {content: \"\\f011\";}\n\ -.fa-signal:before {content: \"\\f012\";}\n\ -.fa-gear:before, .fa-cog:before {content: \"\\f013\";}\n\ -.fa-trash-o:before {content: \"\\f014\";}\n\ -.fa-home:before {content: \"\\f015\";}\n\ -.fa-file-o:before {content: \"\\f016\";}\n\ -.fa-clock-o:before {content: \"\\f017\";}\n\ -.fa-road:before {content: \"\\f018\";}\n\ -.fa-download:before {content: \"\\f019\";}\n\ -.fa-arrow-circle-o-down:before {content: \"\\f01a\";}\n\ -.fa-arrow-circle-o-up:before {content: \"\\f01b\";}\n\ -.fa-inbox:before {content: \"\\f01c\";}\n\ -.fa-play-circle-o:before {content: \"\\f01d\";}\n\ -.fa-rotate-right:before, .fa-repeat:before {content: \"\\f01e\";}\n\ -.fa-refresh:before {content: \"\\f021\";}\n\ -.fa-list-alt:before {content: \"\\f022\";}\n\ -.fa-lock:before {content: \"\\f023\";}\n\ -.fa-flag:before {content: \"\\f024\";}\n\ -.fa-headphones:before {content: \"\\f025\";}\n\ -.fa-volume-off:before {content: \"\\f026\";}\n\ -.fa-volume-down:before {content: \"\\f027\";}\n\ -.fa-volume-up:before {content: \"\\f028\";}\n\ -.fa-qrcode:before {content: \"\\f029\";}\n\ -.fa-barcode:before {content: \"\\f02a\";}\n\ -.fa-tag:before {content: \"\\f02b\";}\n\ -.fa-tags:before {content: \"\\f02c\";}\n\ -.fa-book:before {content: \"\\f02d\";}\n\ -.fa-bookmark:before {content: \"\\f02e\";}\n\ -.fa-print:before {content: \"\\f02f\";}\n\ -.fa-camera:before {content: \"\\f030\";}\n\ -.fa-font:before {content: \"\\f031\";}\n\ -.fa-bold:before {content: \"\\f032\";}\n\ -.fa-italic:before {content: \"\\f033\";}\n\ -.fa-text-height:before {content: \"\\f034\";}\n\ -.fa-text-width:before {content: \"\\f035\";}\n\ -.fa-align-left:before {content: \"\\f036\";}\n\ -.fa-align-center:before {content: \"\\f037\";}\n\ -.fa-align-right:before {content: \"\\f038\";}\n\ -.fa-align-justify:before {content: \"\\f039\";}\n\ -.fa-list:before {content: \"\\f03a\";}\n\ -.fa-dedent:before, .fa-outdent:before {content: \"\\f03b\";}\n\ -.fa-indent:before {content: \"\\f03c\";}\n\ -.fa-video-camera:before {content: \"\\f03d\";}\n\ -.fa-photo:before, .fa-image:before, .fa-picture-o:before {content: \"\\f03e\";}\n\ -.fa-pencil:before {content: \"\\f040\";}\n\ -.fa-map-marker:before {content: \"\\f041\";}\n\ -.fa-adjust:before {content: \"\\f042\";}\n\ -.fa-tint:before {content: \"\\f043\";}\n\ -.fa-edit:before, .fa-pencil-square-o:before {content: \"\\f044\";}\n\ -.fa-share-square-o:before {content: \"\\f045\";}\n\ -.fa-check-square-o:before {content: \"\\f046\";}\n\ -.fa-arrows:before {content: \"\\f047\";}\n\ -.fa-step-backward:before {content: \"\\f048\";}\n\ -.fa-fast-backward:before {content: \"\\f049\";}\n\ -.fa-backward:before {content: \"\\f04a\";}\n\ -.fa-play:before {content: \"\\f04b\";}\n\ -.fa-pause:before {content: \"\\f04c\";}\n\ -.fa-stop:before {content: \"\\f04d\";}\n\ -.fa-forward:before {content: \"\\f04e\";}\n\ -.fa-fast-forward:before {content: \"\\f050\";}\n\ -.fa-step-forward:before {content: \"\\f051\";}\n\ -.fa-eject:before {content: \"\\f052\";}\n\ -.fa-chevron-left:before {content: \"\\f053\";}\n\ -.fa-chevron-right:before {content: \"\\f054\";}\n\ -.fa-plus-circle:before {content: \"\\f055\";}\n\ -.fa-minus-circle:before {content: \"\\f056\";}\n\ -.fa-times-circle:before {content: \"\\f057\";}\n\ -.fa-check-circle:before {content: \"\\f058\";}\n\ -.fa-question-circle:before {content: \"\\f059\";}\n\ -.fa-info-circle:before {content: \"\\f05a\";}\n\ -.fa-crosshairs:before {content: \"\\f05b\";}\n\ -.fa-times-circle-o:before {content: \"\\f05c\";}\n\ -.fa-check-circle-o:before {content: \"\\f05d\";}\n\ -.fa-ban:before {content: \"\\f05e\";}\n\ -.fa-arrow-left:before {content: \"\\f060\";}\n\ -.fa-arrow-right:before {content: \"\\f061\";}\n\ -.fa-arrow-up:before {content: \"\\f062\";}\n\ -.fa-arrow-down:before {content: \"\\f063\";}\n\ -.fa-mail-forward:before, .fa-share:before {content: \"\\f064\";}\n\ -.fa-expand:before {content: \"\\f065\";}\n\ -.fa-compress:before {content: \"\\f066\";}\n\ -.fa-plus:before {content: \"\\f067\";}\n\ -.fa-minus:before {content: \"\\f068\";}\n\ -.fa-asterisk:before {content: \"\\f069\";}\n\ -.fa-exclamation-circle:before {content: \"\\f06a\";}\n\ -.fa-gift:before {content: \"\\f06b\";}\n\ -.fa-leaf:before {content: \"\\f06c\";}\n\ -.fa-fire:before {content: \"\\f06d\";}\n\ -.fa-eye:before {content: \"\\f06e\";}\n\ -.fa-eye-slash:before {content: \"\\f070\";}\n\ -.fa-warning:before, .fa-exclamation-triangle:before {content: \"\\f071\";}\n\ -.fa-plane:before {content: \"\\f072\";}\n\ -.fa-calendar:before {content: \"\\f073\";}\n\ -.fa-random:before {content: \"\\f074\";}\n\ -.fa-comment:before {content: \"\\f075\";}\n\ -.fa-magnet:before {content: \"\\f076\";}\n\ -.fa-chevron-up:before {content: \"\\f077\";}\n\ -.fa-chevron-down:before {content: \"\\f078\";}\n\ -.fa-retweet:before {content: \"\\f079\";}\n\ -.fa-shopping-cart:before {content: \"\\f07a\";}\n\ -.fa-folder:before {content: \"\\f07b\";}\n\ -.fa-folder-open:before {content: \"\\f07c\";}\n\ -.fa-arrows-v:before {content: \"\\f07d\";}\n\ -.fa-arrows-h:before {content: \"\\f07e\";}\n\ -.fa-bar-chart-o:before, .fa-bar-chart:before {content: \"\\f080\";}\n\ -.fa-twitter-square:before {content: \"\\f081\";}\n\ -.fa-facebook-square:before {content: \"\\f082\";}\n\ -.fa-camera-retro:before {content: \"\\f083\";}\n\ -.fa-key:before {content: \"\\f084\";}\n\ -.fa-gears:before, .fa-cogs:before {content: \"\\f085\";}\n\ -.fa-comments:before {content: \"\\f086\";}\n\ -.fa-thumbs-o-up:before {content: \"\\f087\";}\n\ -.fa-thumbs-o-down:before {content: \"\\f088\";}\n\ -.fa-star-half:before {content: \"\\f089\";}\n\ -.fa-heart-o:before {content: \"\\f08a\";}\n\ -.fa-sign-out:before {content: \"\\f08b\";}\n\ -.fa-linkedin-square:before {content: \"\\f08c\";}\n\ -.fa-thumb-tack:before {content: \"\\f08d\";}\n\ -.fa-external-link:before {content: \"\\f08e\";}\n\ -.fa-sign-in:before {content: \"\\f090\";}\n\ -.fa-trophy:before {content: \"\\f091\";}\n\ -.fa-github-square:before {content: \"\\f092\";}\n\ -.fa-upload:before {content: \"\\f093\";}\n\ -.fa-lemon-o:before {content: \"\\f094\";}\n\ -.fa-phone:before {content: \"\\f095\";}\n\ -.fa-square-o:before {content: \"\\f096\";}\n\ -.fa-bookmark-o:before {content: \"\\f097\";}\n\ -.fa-phone-square:before {content: \"\\f098\";}\n\ -.fa-twitter:before {content: \"\\f099\";}\n\ -.fa-facebook-f:before, .fa-facebook:before {content: \"\\f09a\";}\n\ -.fa-github:before {content: \"\\f09b\";}\n\ -.fa-unlock:before {content: \"\\f09c\";}\n\ -.fa-credit-card:before {content: \"\\f09d\";}\n\ -.fa-feed:before, .fa-rss:before {content: \"\\f09e\";}\n\ -.fa-hdd-o:before {content: \"\\f0a0\";}\n\ -.fa-bullhorn:before {content: \"\\f0a1\";}\n\ -.fa-bell:before {content: \"\\f0f3\";}\n\ -.fa-certificate:before {content: \"\\f0a3\";}\n\ -.fa-hand-o-right:before {content: \"\\f0a4\";}\n\ -.fa-hand-o-left:before {content: \"\\f0a5\";}\n\ -.fa-hand-o-up:before {content: \"\\f0a6\";}\n\ -.fa-hand-o-down:before {content: \"\\f0a7\";}\n\ -.fa-arrow-circle-left:before {content: \"\\f0a8\";}\n\ -.fa-arrow-circle-right:before {content: \"\\f0a9\";}\n\ -.fa-arrow-circle-up:before {content: \"\\f0aa\";}\n\ -.fa-arrow-circle-down:before {content: \"\\f0ab\";}\n\ -.fa-globe:before {content: \"\\f0ac\";}\n\ -.fa-wrench:before {content: \"\\f0ad\";}\n\ -.fa-tasks:before {content: \"\\f0ae\";}\n\ -.fa-filter:before {content: \"\\f0b0\";}\n\ -.fa-briefcase:before {content: \"\\f0b1\";}\n\ -.fa-arrows-alt:before {content: \"\\f0b2\";}\n\ -.fa-group:before, .fa-users:before {content: \"\\f0c0\";}\n\ -.fa-chain:before, .fa-link:before {content: \"\\f0c1\";}\n\ -.fa-cloud:before {content: \"\\f0c2\";}\n\ -.fa-flask:before {content: \"\\f0c3\";}\n\ -.fa-cut:before, .fa-scissors:before {content: \"\\f0c4\";}\n\ -.fa-copy:before, .fa-files-o:before {content: \"\\f0c5\";}\n\ -.fa-paperclip:before {content: \"\\f0c6\";}\n\ -.fa-save:before, .fa-floppy-o:before {content: \"\\f0c7\";}\n\ -.fa-square:before {content: \"\\f0c8\";}\n\ -.fa-navicon:before, .fa-reorder:before, .fa-bars:before {content: \"\\f0c9\";}\n\ -.fa-list-ul:before {content: \"\\f0ca\";}\n\ -.fa-list-ol:before {content: \"\\f0cb\";}\n\ -.fa-strikethrough:before {content: \"\\f0cc\";}\n\ -.fa-underline:before {content: \"\\f0cd\";}\n\ -.fa-table:before {content: \"\\f0ce\";}\n\ -.fa-magic:before {content: \"\\f0d0\";}\n\ -.fa-truck:before {content: \"\\f0d1\";}\n\ -.fa-pinterest:before {content: \"\\f0d2\";}\n\ -.fa-pinterest-square:before {content: \"\\f0d3\";}\n\ -.fa-google-plus-square:before {content: \"\\f0d4\";}\n\ -.fa-google-plus:before {content: \"\\f0d5\";}\n\ -.fa-money:before {content: \"\\f0d6\";}\n\ -.fa-caret-down:before {content: \"\\f0d7\";}\n\ -.fa-caret-up:before {content: \"\\f0d8\";}\n\ -.fa-caret-left:before {content: \"\\f0d9\";}\n\ -.fa-caret-right:before {content: \"\\f0da\";}\n\ -.fa-columns:before {content: \"\\f0db\";}\n\ -.fa-unsorted:before, .fa-sort:before {content: \"\\f0dc\";}\n\ -.fa-sort-down:before, .fa-sort-desc:before {content: \"\\f0dd\";}\n\ -.fa-sort-up:before, .fa-sort-asc:before {content: \"\\f0de\";}\n\ -.fa-envelope:before {content: \"\\f0e0\";}\n\ -.fa-linkedin:before {content: \"\\f0e1\";}\n\ -.fa-rotate-left:before, .fa-undo:before {content: \"\\f0e2\";}\n\ -.fa-legal:before, .fa-gavel:before {content: \"\\f0e3\";}\n\ -.fa-dashboard:before, .fa-tachometer:before {content: \"\\f0e4\";}\n\ -.fa-comment-o:before {content: \"\\f0e5\";}\n\ -.fa-comments-o:before {content: \"\\f0e6\";}\n\ -.fa-flash:before, .fa-bolt:before {content: \"\\f0e7\";}\n\ -.fa-sitemap:before {content: \"\\f0e8\";}\n\ -.fa-umbrella:before {content: \"\\f0e9\";}\n\ -.fa-paste:before, .fa-clipboard:before {content: \"\\f0ea\";}\n\ -.fa-lightbulb-o:before {content: \"\\f0eb\";}\n\ -.fa-exchange:before {content: \"\\f0ec\";}\n\ -.fa-cloud-download:before {content: \"\\f0ed\";}\n\ -.fa-cloud-upload:before {content: \"\\f0ee\";}\n\ -.fa-user-md:before {content: \"\\f0f0\";}\n\ -.fa-stethoscope:before {content: \"\\f0f1\";}\n\ -.fa-suitcase:before {content: \"\\f0f2\";}\n\ -.fa-bell-o:before {content: \"\\f0a2\";}\n\ -.fa-coffee:before {content: \"\\f0f4\";}\n\ -.fa-cutlery:before {content: \"\\f0f5\";}\n\ -.fa-file-text-o:before {content: \"\\f0f6\";}\n\ -.fa-building-o:before {content: \"\\f0f7\";}\n\ -.fa-hospital-o:before {content: \"\\f0f8\";}\n\ -.fa-ambulance:before {content: \"\\f0f9\";}\n\ -.fa-medkit:before {content: \"\\f0fa\";}\n\ -.fa-fighter-jet:before {content: \"\\f0fb\";}\n\ -.fa-beer:before {content: \"\\f0fc\";}\n\ -.fa-h-square:before {content: \"\\f0fd\";}\n\ -.fa-plus-square:before {content: \"\\f0fe\";}\n\ -.fa-angle-double-left:before {content: \"\\f100\";}\n\ -.fa-angle-double-right:before {content: \"\\f101\";}\n\ -.fa-angle-double-up:before {content: \"\\f102\";}\n\ -.fa-angle-double-down:before {content: \"\\f103\";}\n\ -.fa-angle-left:before {content: \"\\f104\";}\n\ -.fa-angle-right:before {content: \"\\f105\";}\n\ -.fa-angle-up:before {content: \"\\f106\";}\n\ -.fa-angle-down:before {content: \"\\f107\";}\n\ -.fa-desktop:before {content: \"\\f108\";}\n\ -.fa-laptop:before {content: \"\\f109\";}\n\ -.fa-tablet:before {content: \"\\f10a\";}\n\ -.fa-mobile-phone:before, .fa-mobile:before {content: \"\\f10b\";}\n\ -.fa-circle-o:before {content: \"\\f10c\";}\n\ -.fa-quote-left:before {content: \"\\f10d\";}\n\ -.fa-quote-right:before {content: \"\\f10e\";}\n\ -.fa-spinner:before {content: \"\\f110\";}\n\ -.fa-circle:before {content: \"\\f111\";}\n\ -.fa-mail-reply:before, .fa-reply:before {content: \"\\f112\";}\n\ -.fa-github-alt:before {content: \"\\f113\";}\n\ -.fa-folder-o:before {content: \"\\f114\";}\n\ -.fa-folder-open-o:before {content: \"\\f115\";}\n\ -.fa-smile-o:before {content: \"\\f118\";}\n\ -.fa-frown-o:before {content: \"\\f119\";}\n\ -.fa-meh-o:before {content: \"\\f11a\";}\n\ -.fa-gamepad:before {content: \"\\f11b\";}\n\ -.fa-keyboard-o:before {content: \"\\f11c\";}\n\ -.fa-flag-o:before {content: \"\\f11d\";}\n\ -.fa-flag-checkered:before {content: \"\\f11e\";}\n\ -.fa-terminal:before {content: \"\\f120\";}\n\ -.fa-code:before {content: \"\\f121\";}\n\ -.fa-mail-reply-all:before, .fa-reply-all:before {content: \"\\f122\";}\n\ -.fa-star-half-empty:before, .fa-star-half-full:before, .fa-star-half-o:before {content: \"\\f123\";}\n\ -.fa-location-arrow:before {content: \"\\f124\";}\n\ -.fa-crop:before {content: \"\\f125\";}\n\ -.fa-code-fork:before {content: \"\\f126\";}\n\ -.fa-unlink:before, .fa-chain-broken:before {content: \"\\f127\";}\n\ -.fa-question:before {content: \"\\f128\";}\n\ -.fa-info:before {content: \"\\f129\";}\n\ -.fa-exclamation:before {content: \"\\f12a\";}\n\ -.fa-superscript:before {content: \"\\f12b\";}\n\ -.fa-subscript:before {content: \"\\f12c\";}\n\ -.fa-eraser:before {content: \"\\f12d\";}\n\ -.fa-puzzle-piece:before {content: \"\\f12e\";}\n\ -.fa-microphone:before {content: \"\\f130\";}\n\ -.fa-microphone-slash:before {content: \"\\f131\";}\n\ -.fa-shield:before {content: \"\\f132\";}\n\ -.fa-calendar-o:before {content: \"\\f133\";}\n\ -.fa-fire-extinguisher:before {content: \"\\f134\";}\n\ -.fa-rocket:before {content: \"\\f135\";}\n\ -.fa-maxcdn:before {content: \"\\f136\";}\n\ -.fa-chevron-circle-left:before {content: \"\\f137\";}\n\ -.fa-chevron-circle-right:before {content: \"\\f138\";}\n\ -.fa-chevron-circle-up:before {content: \"\\f139\";}\n\ -.fa-chevron-circle-down:before {content: \"\\f13a\";}\n\ -.fa-html5:before {content: \"\\f13b\";}\n\ -.fa-css3:before {content: \"\\f13c\";}\n\ -.fa-anchor:before {content: \"\\f13d\";}\n\ -.fa-unlock-alt:before {content: \"\\f13e\";}\n\ -.fa-bullseye:before {content: \"\\f140\";}\n\ -.fa-ellipsis-h:before {content: \"\\f141\";}\n\ -.fa-ellipsis-v:before {content: \"\\f142\";}\n\ -.fa-rss-square:before {content: \"\\f143\";}\n\ -.fa-play-circle:before {content: \"\\f144\";}\n\ -.fa-ticket:before {content: \"\\f145\";}\n\ -.fa-minus-square:before {content: \"\\f146\";}\n\ -.fa-minus-square-o:before {content: \"\\f147\";}\n\ -.fa-level-up:before {content: \"\\f148\";}\n\ -.fa-level-down:before {content: \"\\f149\";}\n\ -.fa-check-square:before {content: \"\\f14a\";}\n\ -.fa-pencil-square:before {content: \"\\f14b\";}\n\ -.fa-external-link-square:before {content: \"\\f14c\";}\n\ -.fa-share-square:before {content: \"\\f14d\";}\n\ -.fa-compass:before {content: \"\\f14e\";}\n\ -.fa-toggle-down:before, .fa-caret-square-o-down:before {content: \"\\f150\";}\n\ -.fa-toggle-up:before, .fa-caret-square-o-up:before {content: \"\\f151\";}\n\ -.fa-toggle-right:before, .fa-caret-square-o-right:before {content: \"\\f152\";}\n\ -.fa-euro:before, .fa-eur:before {content: \"\\f153\";}\n\ -.fa-gbp:before {content: \"\\f154\";}\n\ -.fa-dollar:before, .fa-usd:before {content: \"\\f155\";}\n\ -.fa-rupee:before, .fa-inr:before {content: \"\\f156\";}\n\ -.fa-cny:before, .fa-rmb:before, .fa-yen:before, .fa-jpy:before {content: \"\\f157\";}\n\ -.fa-ruble:before, .fa-rouble:before, .fa-rub:before {content: \"\\f158\";}\n\ -.fa-won:before, .fa-krw:before {content: \"\\f159\";}\n\ -.fa-bitcoin:before, .fa-btc:before {content: \"\\f15a\";}\n\ -.fa-file:before {content: \"\\f15b\";}\n\ -.fa-file-text:before {content: \"\\f15c\";}\n\ -.fa-sort-alpha-asc:before {content: \"\\f15d\";}\n\ -.fa-sort-alpha-desc:before {content: \"\\f15e\";}\n\ -.fa-sort-amount-asc:before {content: \"\\f160\";}\n\ -.fa-sort-amount-desc:before {content: \"\\f161\";}\n\ -.fa-sort-numeric-asc:before {content: \"\\f162\";}\n\ -.fa-sort-numeric-desc:before {content: \"\\f163\";}\n\ -.fa-thumbs-up:before {content: \"\\f164\";}\n\ -.fa-thumbs-down:before {content: \"\\f165\";}\n\ -.fa-youtube-square:before {content: \"\\f166\";}\n\ -.fa-youtube:before {content: \"\\f167\";}\n\ -.fa-xing:before {content: \"\\f168\";}\n\ -.fa-xing-square:before {content: \"\\f169\";}\n\ -.fa-youtube-play:before {content: \"\\f16a\";}\n\ -.fa-dropbox:before {content: \"\\f16b\";}\n\ -.fa-stack-overflow:before {content: \"\\f16c\";}\n\ -.fa-instagram:before {content: \"\\f16d\";}\n\ -.fa-flickr:before {content: \"\\f16e\";}\n\ -.fa-adn:before {content: \"\\f170\";}\n\ -.fa-bitbucket:before {content: \"\\f171\";}\n\ -.fa-bitbucket-square:before {content: \"\\f172\";}\n\ -.fa-tumblr:before {content: \"\\f173\";}\n\ -.fa-tumblr-square:before {content: \"\\f174\";}\n\ -.fa-long-arrow-down:before {content: \"\\f175\";}\n\ -.fa-long-arrow-up:before {content: \"\\f176\";}\n\ -.fa-long-arrow-left:before {content: \"\\f177\";}\n\ -.fa-long-arrow-right:before {content: \"\\f178\";}\n\ -.fa-apple:before {content: \"\\f179\";}\n\ -.fa-windows:before {content: \"\\f17a\";}\n\ -.fa-android:before {content: \"\\f17b\";}\n\ -.fa-linux:before {content: \"\\f17c\";}\n\ -.fa-dribbble:before {content: \"\\f17d\";}\n\ -.fa-skype:before {content: \"\\f17e\";}\n\ -.fa-foursquare:before {content: \"\\f180\";}\n\ -.fa-trello:before {content: \"\\f181\";}\n\ -.fa-female:before {content: \"\\f182\";}\n\ -.fa-male:before {content: \"\\f183\";}\n\ -.fa-gittip:before, .fa-gratipay:before {content: \"\\f184\";}\n\ -.fa-sun-o:before {content: \"\\f185\";}\n\ -.fa-moon-o:before {content: \"\\f186\";}\n\ -.fa-archive:before {content: \"\\f187\";}\n\ -.fa-bug:before {content: \"\\f188\";}\n\ -.fa-vk:before {content: \"\\f189\";}\n\ -.fa-weibo:before {content: \"\\f18a\";}\n\ -.fa-renren:before {content: \"\\f18b\";}\n\ -.fa-pagelines:before {content: \"\\f18c\";}\n\ -.fa-stack-exchange:before {content: \"\\f18d\";}\n\ -.fa-arrow-circle-o-right:before {content: \"\\f18e\";}\n\ -.fa-arrow-circle-o-left:before {content: \"\\f190\";}\n\ -.fa-toggle-left:before, .fa-caret-square-o-left:before {content: \"\\f191\";}\n\ -.fa-dot-circle-o:before {content: \"\\f192\";}\n\ -.fa-wheelchair:before {content: \"\\f193\";}\n\ -.fa-vimeo-square:before {content: \"\\f194\";}\n\ -.fa-turkish-lira:before, .fa-try:before {content: \"\\f195\";}\n\ -.fa-plus-square-o:before {content: \"\\f196\";}\n\ -.fa-space-shuttle:before {content: \"\\f197\";}\n\ -.fa-slack:before {content: \"\\f198\";}\n\ -.fa-envelope-square:before {content: \"\\f199\";}\n\ -.fa-wordpress:before {content: \"\\f19a\";}\n\ -.fa-openid:before {content: \"\\f19b\";}\n\ -.fa-institution:before, .fa-bank:before, .fa-university:before {content: \"\\f19c\";}\n\ -.fa-mortar-board:before, .fa-graduation-cap:before {content: \"\\f19d\";}\n\ -.fa-yahoo:before {content: \"\\f19e\";}\n\ -.fa-google:before {content: \"\\f1a0\";}\n\ -.fa-reddit:before {content: \"\\f1a1\";}\n\ -.fa-reddit-square:before {content: \"\\f1a2\";}\n\ -.fa-stumbleupon-circle:before {content: \"\\f1a3\";}\n\ -.fa-stumbleupon:before {content: \"\\f1a4\";}\n\ -.fa-delicious:before {content: \"\\f1a5\";}\n\ -.fa-digg:before {content: \"\\f1a6\";}\n\ -.fa-pied-piper-pp:before {content: \"\\f1a7\";}\n\ -.fa-pied-piper-alt:before {content: \"\\f1a8\";}\n\ -.fa-drupal:before {content: \"\\f1a9\";}\n\ -.fa-joomla:before {content: \"\\f1aa\";}\n\ -.fa-language:before {content: \"\\f1ab\";}\n\ -.fa-fax:before {content: \"\\f1ac\";}\n\ -.fa-building:before {content: \"\\f1ad\";}\n\ -.fa-child:before {content: \"\\f1ae\";}\n\ -.fa-paw:before {content: \"\\f1b0\";}\n\ -.fa-spoon:before {content: \"\\f1b1\";}\n\ -.fa-cube:before {content: \"\\f1b2\";}\n\ -.fa-cubes:before {content: \"\\f1b3\";}\n\ -.fa-behance:before {content: \"\\f1b4\";}\n\ -.fa-behance-square:before {content: \"\\f1b5\";}\n\ -.fa-steam:before {content: \"\\f1b6\";}\n\ -.fa-steam-square:before {content: \"\\f1b7\";}\n\ -.fa-recycle:before {content: \"\\f1b8\";}\n\ -.fa-automobile:before, .fa-car:before {content: \"\\f1b9\";}\n\ -.fa-cab:before, .fa-taxi:before {content: \"\\f1ba\";}\n\ -.fa-tree:before {content: \"\\f1bb\";}\n\ -.fa-spotify:before {content: \"\\f1bc\";}\n\ -.fa-deviantart:before {content: \"\\f1bd\";}\n\ -.fa-soundcloud:before {content: \"\\f1be\";}\n\ -.fa-database:before {content: \"\\f1c0\";}\n\ -.fa-file-pdf-o:before {content: \"\\f1c1\";}\n\ -.fa-file-word-o:before {content: \"\\f1c2\";}\n\ -.fa-file-excel-o:before {content: \"\\f1c3\";}\n\ -.fa-file-powerpoint-o:before {content: \"\\f1c4\";}\n\ -.fa-file-photo-o:before, .fa-file-picture-o:before, .fa-file-image-o:before {content: \"\\f1c5\";}\n\ -.fa-file-zip-o:before, .fa-file-archive-o:before {content: \"\\f1c6\";}\n\ -.fa-file-sound-o:before, .fa-file-audio-o:before {content: \"\\f1c7\";}\n\ -.fa-file-movie-o:before, .fa-file-video-o:before {content: \"\\f1c8\";}\n\ -.fa-file-code-o:before {content: \"\\f1c9\";}\n\ -.fa-vine:before {content: \"\\f1ca\";}\n\ -.fa-codepen:before {content: \"\\f1cb\";}\n\ -.fa-jsfiddle:before {content: \"\\f1cc\";}\n\ -.fa-life-bouy:before, .fa-life-buoy:before, .fa-life-saver:before, .fa-support:before, .fa-life-ring:before {content: \"\\f1cd\";}\n\ -.fa-circle-o-notch:before {content: \"\\f1ce\";}\n\ -.fa-ra:before, .fa-resistance:before, .fa-rebel:before {content: \"\\f1d0\";}\n\ -.fa-ge:before, .fa-empire:before {content: \"\\f1d1\";}\n\ -.fa-git-square:before {content: \"\\f1d2\";}\n\ -.fa-git:before {content: \"\\f1d3\";}\n\ -.fa-y-combinator-square:before, .fa-yc-square:before, .fa-hacker-news:before {content: \"\\f1d4\";}\n\ -.fa-tencent-weibo:before {content: \"\\f1d5\";}\n\ -.fa-qq:before {content: \"\\f1d6\";}\n\ -.fa-wechat:before, .fa-weixin:before {content: \"\\f1d7\";}\n\ -.fa-send:before, .fa-paper-plane:before {content: \"\\f1d8\";}\n\ -.fa-send-o:before, .fa-paper-plane-o:before {content: \"\\f1d9\";}\n\ -.fa-history:before {content: \"\\f1da\";}\n\ -.fa-circle-thin:before {content: \"\\f1db\";}\n\ -.fa-header:before {content: \"\\f1dc\";}\n\ -.fa-paragraph:before {content: \"\\f1dd\";}\n\ -.fa-sliders:before {content: \"\\f1de\";}\n\ -.fa-share-alt:before {content: \"\\f1e0\";}\n\ -.fa-share-alt-square:before {content: \"\\f1e1\";}\n\ -.fa-bomb:before {content: \"\\f1e2\";}\n\ -.fa-soccer-ball-o:before, .fa-futbol-o:before {content: \"\\f1e3\";}\n\ -.fa-tty:before {content: \"\\f1e4\";}\n\ -.fa-binoculars:before {content: \"\\f1e5\";}\n\ -.fa-plug:before {content: \"\\f1e6\";}\n\ -.fa-slideshare:before {content: \"\\f1e7\";}\n\ -.fa-twitch:before {content: \"\\f1e8\";}\n\ -.fa-yelp:before {content: \"\\f1e9\";}\n\ -.fa-newspaper-o:before {content: \"\\f1ea\";}\n\ -.fa-wifi:before {content: \"\\f1eb\";}\n\ -.fa-calculator:before {content: \"\\f1ec\";}\n\ -.fa-paypal:before {content: \"\\f1ed\";}\n\ -.fa-google-wallet:before {content: \"\\f1ee\";}\n\ -.fa-cc-visa:before {content: \"\\f1f0\";}\n\ -.fa-cc-mastercard:before {content: \"\\f1f1\";}\n\ -.fa-cc-discover:before {content: \"\\f1f2\";}\n\ -.fa-cc-amex:before {content: \"\\f1f3\";}\n\ -.fa-cc-paypal:before {content: \"\\f1f4\";}\n\ -.fa-cc-stripe:before {content: \"\\f1f5\";}\n\ -.fa-bell-slash:before {content: \"\\f1f6\";}\n\ -.fa-bell-slash-o:before {content: \"\\f1f7\";}\n\ -.fa-trash:before {content: \"\\f1f8\";}\n\ -.fa-copyright:before {content: \"\\f1f9\";}\n\ -.fa-at:before {content: \"\\f1fa\";}\n\ -.fa-eyedropper:before {content: \"\\f1fb\";}\n\ -.fa-paint-brush:before {content: \"\\f1fc\";}\n\ -.fa-birthday-cake:before {content: \"\\f1fd\";}\n\ -.fa-area-chart:before {content: \"\\f1fe\";}\n\ -.fa-pie-chart:before {content: \"\\f200\";}\n\ -.fa-line-chart:before {content: \"\\f201\";}\n\ -.fa-lastfm:before {content: \"\\f202\";}\n\ -.fa-lastfm-square:before {content: \"\\f203\";}\n\ -.fa-toggle-off:before {content: \"\\f204\";}\n\ -.fa-toggle-on:before {content: \"\\f205\";}\n\ -.fa-bicycle:before {content: \"\\f206\";}\n\ -.fa-bus:before {content: \"\\f207\";}\n\ -.fa-ioxhost:before {content: \"\\f208\";}\n\ -.fa-angellist:before {content: \"\\f209\";}\n\ -.fa-cc:before {content: \"\\f20a\";}\n\ -.fa-shekel:before, .fa-sheqel:before, .fa-ils:before {content: \"\\f20b\";}\n\ -.fa-meanpath:before {content: \"\\f20c\";}\n\ -.fa-buysellads:before {content: \"\\f20d\";}\n\ -.fa-connectdevelop:before {content: \"\\f20e\";}\n\ -.fa-dashcube:before {content: \"\\f210\";}\n\ -.fa-forumbee:before {content: \"\\f211\";}\n\ -.fa-leanpub:before {content: \"\\f212\";}\n\ -.fa-sellsy:before {content: \"\\f213\";}\n\ -.fa-shirtsinbulk:before {content: \"\\f214\";}\n\ -.fa-simplybuilt:before {content: \"\\f215\";}\n\ -.fa-skyatlas:before {content: \"\\f216\";}\n\ -.fa-cart-plus:before {content: \"\\f217\";}\n\ -.fa-cart-arrow-down:before {content: \"\\f218\";}\n\ -.fa-diamond:before {content: \"\\f219\";}\n\ -.fa-ship:before {content: \"\\f21a\";}\n\ -.fa-user-secret:before {content: \"\\f21b\";}\n\ -.fa-motorcycle:before {content: \"\\f21c\";}\n\ -.fa-street-view:before {content: \"\\f21d\";}\n\ -.fa-heartbeat:before {content: \"\\f21e\";}\n\ -.fa-venus:before {content: \"\\f221\";}\n\ -.fa-mars:before {content: \"\\f222\";}\n\ -.fa-mercury:before {content: \"\\f223\";}\n\ -.fa-intersex:before, .fa-transgender:before {content: \"\\f224\";}\n\ -.fa-transgender-alt:before {content: \"\\f225\";}\n\ -.fa-venus-double:before {content: \"\\f226\";}\n\ -.fa-mars-double:before {content: \"\\f227\";}\n\ -.fa-venus-mars:before {content: \"\\f228\";}\n\ -.fa-mars-stroke:before {content: \"\\f229\";}\n\ -.fa-mars-stroke-v:before {content: \"\\f22a\";}\n\ -.fa-mars-stroke-h:before {content: \"\\f22b\";}\n\ -.fa-neuter:before {content: \"\\f22c\";}\n\ -.fa-genderless:before {content: \"\\f22d\";}\n\ -.fa-facebook-official:before {content: \"\\f230\";}\n\ -.fa-pinterest-p:before {content: \"\\f231\";}\n\ -.fa-whatsapp:before {content: \"\\f232\";}\n\ -.fa-server:before {content: \"\\f233\";}\n\ -.fa-user-plus:before {content: \"\\f234\";}\n\ -.fa-user-times:before {content: \"\\f235\";}\n\ -.fa-hotel:before, .fa-bed:before {content: \"\\f236\";}\n\ -.fa-viacoin:before {content: \"\\f237\";}\n\ -.fa-train:before {content: \"\\f238\";}\n\ -.fa-subway:before {content: \"\\f239\";}\n\ -.fa-medium:before {content: \"\\f23a\";}\n\ -.fa-yc:before, .fa-y-combinator:before {content: \"\\f23b\";}\n\ -.fa-optin-monster:before {content: \"\\f23c\";}\n\ -.fa-opencart:before {content: \"\\f23d\";}\n\ -.fa-expeditedssl:before {content: \"\\f23e\";}\n\ -.fa-battery-4:before, .fa-battery:before, .fa-battery-full:before {content: \"\\f240\";}\n\ -.fa-battery-3:before, .fa-battery-three-quarters:before {content: \"\\f241\";}\n\ -.fa-battery-2:before, .fa-battery-half:before {content: \"\\f242\";}\n\ -.fa-battery-1:before, .fa-battery-quarter:before {content: \"\\f243\";}\n\ -.fa-battery-0:before, .fa-battery-empty:before {content: \"\\f244\";}\n\ -.fa-mouse-pointer:before {content: \"\\f245\";}\n\ -.fa-i-cursor:before {content: \"\\f246\";}\n\ -.fa-object-group:before {content: \"\\f247\";}\n\ -.fa-object-ungroup:before {content: \"\\f248\";}\n\ -.fa-sticky-note:before {content: \"\\f249\";}\n\ -.fa-sticky-note-o:before {content: \"\\f24a\";}\n\ -.fa-cc-jcb:before {content: \"\\f24b\";}\n\ -.fa-cc-diners-club:before {content: \"\\f24c\";}\n\ -.fa-clone:before {content: \"\\f24d\";}\n\ -.fa-balance-scale:before {content: \"\\f24e\";}\n\ -.fa-hourglass-o:before {content: \"\\f250\";}\n\ -.fa-hourglass-1:before, .fa-hourglass-start:before {content: \"\\f251\";}\n\ -.fa-hourglass-2:before, .fa-hourglass-half:before {content: \"\\f252\";}\n\ -.fa-hourglass-3:before, .fa-hourglass-end:before {content: \"\\f253\";}\n\ -.fa-hourglass:before {content: \"\\f254\";}\n\ -.fa-hand-grab-o:before, .fa-hand-rock-o:before {content: \"\\f255\";}\n\ -.fa-hand-stop-o:before, .fa-hand-paper-o:before {content: \"\\f256\";}\n\ -.fa-hand-scissors-o:before {content: \"\\f257\";}\n\ -.fa-hand-lizard-o:before {content: \"\\f258\";}\n\ -.fa-hand-spock-o:before {content: \"\\f259\";}\n\ -.fa-hand-pointer-o:before {content: \"\\f25a\";}\n\ -.fa-hand-peace-o:before {content: \"\\f25b\";}\n\ -.fa-trademark:before {content: \"\\f25c\";}\n\ -.fa-registered:before {content: \"\\f25d\";}\n\ -.fa-creative-commons:before {content: \"\\f25e\";}\n\ -.fa-gg:before {content: \"\\f260\";}\n\ -.fa-gg-circle:before {content: \"\\f261\";}\n\ -.fa-tripadvisor:before {content: \"\\f262\";}\n\ -.fa-odnoklassniki:before {content: \"\\f263\";}\n\ -.fa-odnoklassniki-square:before {content: \"\\f264\";}\n\ -.fa-get-pocket:before {content: \"\\f265\";}\n\ -.fa-wikipedia-w:before {content: \"\\f266\";}\n\ -.fa-safari:before {content: \"\\f267\";}\n\ -.fa-chrome:before {content: \"\\f268\";}\n\ -.fa-firefox:before {content: \"\\f269\";}\n\ -.fa-opera:before {content: \"\\f26a\";}\n\ -.fa-internet-explorer:before {content: \"\\f26b\";}\n\ -.fa-tv:before, .fa-television:before {content: \"\\f26c\";}\n\ -.fa-contao:before {content: \"\\f26d\";}\n\ -.fa-500px:before {content: \"\\f26e\";}\n\ -.fa-amazon:before {content: \"\\f270\";}\n\ -.fa-calendar-plus-o:before {content: \"\\f271\";}\n\ -.fa-calendar-minus-o:before {content: \"\\f272\";}\n\ -.fa-calendar-times-o:before {content: \"\\f273\";}\n\ -.fa-calendar-check-o:before {content: \"\\f274\";}\n\ -.fa-industry:before {content: \"\\f275\";}\n\ -.fa-map-pin:before {content: \"\\f276\";}\n\ -.fa-map-signs:before {content: \"\\f277\";}\n\ -.fa-map-o:before {content: \"\\f278\";}\n\ -.fa-map:before {content: \"\\f279\";}\n\ -.fa-commenting:before {content: \"\\f27a\";}\n\ -.fa-commenting-o:before {content: \"\\f27b\";}\n\ -.fa-houzz:before {content: \"\\f27c\";}\n\ -.fa-vimeo:before {content: \"\\f27d\";}\n\ -.fa-black-tie:before {content: \"\\f27e\";}\n\ -.fa-fonticons:before {content: \"\\f280\";}\n\ -.fa-reddit-alien:before {content: \"\\f281\";}\n\ -.fa-edge:before {content: \"\\f282\";}\n\ -.fa-credit-card-alt:before {content: \"\\f283\";}\n\ -.fa-codiepie:before {content: \"\\f284\";}\n\ -.fa-modx:before {content: \"\\f285\";}\n\ -.fa-fort-awesome:before {content: \"\\f286\";}\n\ -.fa-usb:before {content: \"\\f287\";}\n\ -.fa-product-hunt:before {content: \"\\f288\";}\n\ -.fa-mixcloud:before {content: \"\\f289\";}\n\ -.fa-scribd:before {content: \"\\f28a\";}\n\ -.fa-pause-circle:before {content: \"\\f28b\";}\n\ -.fa-pause-circle-o:before {content: \"\\f28c\";}\n\ -.fa-stop-circle:before {content: \"\\f28d\";}\n\ -.fa-stop-circle-o:before {content: \"\\f28e\";}\n\ -.fa-shopping-bag:before {content: \"\\f290\";}\n\ -.fa-shopping-basket:before {content: \"\\f291\";}\n\ -.fa-hashtag:before {content: \"\\f292\";}\n\ -.fa-bluetooth:before {content: \"\\f293\";}\n\ -.fa-bluetooth-b:before {content: \"\\f294\";}\n\ -.fa-percent:before {content: \"\\f295\";}\n\ -.fa-gitlab:before {content: \"\\f296\";}\n\ -.fa-wpbeginner:before {content: \"\\f297\";}\n\ -.fa-wpforms:before {content: \"\\f298\";}\n\ -.fa-envira:before {content: \"\\f299\";}\n\ -.fa-universal-access:before {content: \"\\f29a\";}\n\ -.fa-wheelchair-alt:before {content: \"\\f29b\";}\n\ -.fa-question-circle-o:before {content: \"\\f29c\";}\n\ -.fa-blind:before {content: \"\\f29d\";}\n\ -.fa-audio-description:before {content: \"\\f29e\";}\n\ -.fa-volume-control-phone:before {content: \"\\f2a0\";}\n\ -.fa-braille:before {content: \"\\f2a1\";}\n\ -.fa-assistive-listening-systems:before {content: \"\\f2a2\";}\n\ -.fa-asl-interpreting:before, .fa-american-sign-language-interpreting:before {content: \"\\f2a3\";}\n\ -.fa-deafness:before, .fa-hard-of-hearing:before, .fa-deaf:before {content: \"\\f2a4\";}\n\ -.fa-glide:before {content: \"\\f2a5\";}\n\ -.fa-glide-g:before {content: \"\\f2a6\";}\n\ -.fa-signing:before, .fa-sign-language:before {content: \"\\f2a7\";}\n\ -.fa-low-vision:before {content: \"\\f2a8\";}\n\ -.fa-viadeo:before {content: \"\\f2a9\";}\n\ -.fa-viadeo-square:before {content: \"\\f2aa\";}\n\ -.fa-snapchat:before {content: \"\\f2ab\";}\n\ -.fa-snapchat-ghost:before {content: \"\\f2ac\";}\n\ -.fa-snapchat-square:before {content: \"\\f2ad\";}\n\ -.fa-pied-piper:before {content: \"\\f2ae\";}\n\ -.fa-first-order:before {content: \"\\f2b0\";}\n\ -.fa-yoast:before {content: \"\\f2b1\";}\n\ -.fa-themeisle:before {content: \"\\f2b2\";}\n\ -.fa-google-plus-circle:before, .fa-google-plus-official:before {content: \"\\f2b3\";}\n\ -.fa-fa:before, .fa-font-awesome:before {content: \"\\f2b4\";}\n\ -.fa-handshake-o:before {content: \"\\f2b5\";}\n\ -.fa-envelope-open:before {content: \"\\f2b6\";}\n\ -.fa-envelope-open-o:before {content: \"\\f2b7\";}\n\ -.fa-linode:before {content: \"\\f2b8\";}\n\ -.fa-address-book:before {content: \"\\f2b9\";}\n\ -.fa-address-book-o:before {content: \"\\f2ba\";}\n\ -.fa-vcard:before, .fa-address-card:before {content: \"\\f2bb\";}\n\ -.fa-vcard-o:before, .fa-address-card-o:before {content: \"\\f2bc\";}\n\ -.fa-user-circle:before {content: \"\\f2bd\";}\n\ -.fa-user-circle-o:before {content: \"\\f2be\";}\n\ -.fa-user-o:before {content: \"\\f2c0\";}\n\ -.fa-id-badge:before {content: \"\\f2c1\";}\n\ -.fa-drivers-license:before, .fa-id-card:before {content: \"\\f2c2\";}\n\ -.fa-drivers-license-o:before, .fa-id-card-o:before {content: \"\\f2c3\";}\n\ -.fa-quora:before {content: \"\\f2c4\";}\n\ -.fa-free-code-camp:before {content: \"\\f2c5\";}\n\ -.fa-telegram:before {content: \"\\f2c6\";}\n\ -.fa-thermometer-4:before, .fa-thermometer:before, .fa-thermometer-full:before {content: \"\\f2c7\";}\n\ -.fa-thermometer-3:before, .fa-thermometer-three-quarters:before {content: \"\\f2c8\";}\n\ -.fa-thermometer-2:before, .fa-thermometer-half:before {content: \"\\f2c9\";}\n\ -.fa-thermometer-1:before, .fa-thermometer-quarter:before {content: \"\\f2ca\";}\n\ -.fa-thermometer-0:before, .fa-thermometer-empty:before {content: \"\\f2cb\";}\n\ -.fa-shower:before {content: \"\\f2cc\";}\n\ -.fa-bathtub:before, .fa-s15:before, .fa-bath:before {content: \"\\f2cd\";}\n\ -.fa-podcast:before {content: \"\\f2ce\";}\n\ -.fa-window-maximize:before {content: \"\\f2d0\";}\n\ -.fa-window-minimize:before {content: \"\\f2d1\";}\n\ -.fa-window-restore:before {content: \"\\f2d2\";}\n\ -.fa-times-rectangle:before, .fa-window-close:before {content: \"\\f2d3\";}\n\ -.fa-times-rectangle-o:before, .fa-window-close-o:before {content: \"\\f2d4\";}\n\ -.fa-bandcamp:before {content: \"\\f2d5\";}\n\ -.fa-grav:before {content: \"\\f2d6\";}\n\ -.fa-etsy:before {content: \"\\f2d7\";}\n\ -.fa-imdb:before {content: \"\\f2d8\";}\n\ -.fa-ravelry:before {content: \"\\f2d9\";}\n\ -.fa-eercast:before {content: \"\\f2da\";}\n\ -.fa-microchip:before {content: \"\\f2db\";}\n\ -.fa-snowflake-o:before {content: \"\\f2dc\";}\n\ -.fa-superpowers:before {content: \"\\f2dd\";}\n\ -.fa-wpexplorer:before {content: \"\\f2de\";}\n\ -.fa-meetup:before {content: \"\\f2e0\";}\n\ -.fa::before {\n\ - font-family: FontAwesome;\n\ - font-weight: 400;\n\ - font-style: normal;\n\ - -webkit-font-smoothing: antialiased;\n\ - text-decoration: inherit;\n\ - speak: none;\n\ - display: inline-block;\n\ - font-size: 13px;\n\ - visibility: visible;\n\ -}\n\ -:root:not(.shortcut-icons) #shortcuts .fa::before {\n\ - display: none;\n\ -}\n\ -:root.shortcut-icons #shortcuts .fa::before {\n\ - font-size: 15px !important;\n\ - margin-top: -3px !important;\n\ - position: relative;\n\ - top: 1px;\n\ -}\n\ -:root.shortcut-icons #shortcuts .fa, .menu-button .fa {\n\ - font-size: 0;\n\ - visibility: hidden;\n\ -}\n\ -:root.shortcut-icons .shortcut.brackets-wrap::after,\n\ -:root.shortcut-icons .shortcut.brackets-wrap::before {\n\ - display: none;\n\ -}\n\ -:root.shortcut-icons #shortcuts a .fa,\n\ -.menu-button .fa,\n\ -.hide-reply-button .fa,\n\ -.hide-thread-button .fa {\n\ - display: inline;\n\ -}\n\ -.fa-spin::before {\n\ - -webkit-animation:spin 2s infinite linear;\n\ - -moz-animation:spin 2s infinite linear;\n\ - -o-animation:spin 2s infinite linear;\n\ - animation:spin 2s infinite linear;\n\ -}\n\ -@-moz-keyframes spin {\n\ - 0% {-moz-transform:rotate(0deg);}\n\ - 100% {-moz-transform:rotate(359deg);}\n\ -}\n\ -@-webkit-keyframes spin {\n\ - 0% {-webkit-transform:rotate(0deg);}\n\ - 100% {-webkit-transform:rotate(359deg);}\n\ -}\n\ -@keyframes spin {\n\ - 0% {transform:rotate(0deg);}\n\ - 100% {transform:rotate(359deg);}\n\ -}\n\ -/* General */\n\ -.dialog {\n\ - border: 1px solid;\n\ - display: block;\n\ - background-color: inherit;\n\ -}\n\ -.dialog:not(#qr):not(#thread-watcher):not(#header-bar) {\n\ - box-shadow: 0 1px 2px rgba(0, 0, 0, .15);\n\ -}\n\ -#qr,\n\ -#thread-watcher {\n\ - box-shadow: -1px 2px 2px rgba(0, 0, 0, 0.25);\n\ -}\n\ -.captcha-img,\n\ -.field {\n\ - background-color: #FFF;\n\ - border: 1px solid #CCC;\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ - color: #333;\n\ - font: 13px sans-serif;\n\ - outline: none;\n\ - transition: color .25s, border-color .25s;\n\ -}\n\ -.field::-moz-placeholder {\n\ - color: #AAA;\n\ - font-size: 13px;\n\ - opacity: 1;\n\ -}\n\ -.captch-img:hover,\n\ -.field:hover {\n\ - border-color: #999;\n\ -}\n\ -.field:hover, .field:focus, .field.focus {\n\ - color: #000;\n\ -}\n\ -.field[disabled] {\n\ - background-color: #F2F2F2;\n\ - color: #888;\n\ -}\n\ -.field::-webkit-search-decoration {\n\ - display: none;\n\ -}\n\ -.move {\n\ - cursor: move;\n\ - overflow: hidden;\n\ -}\n\ -label {\n\ - cursor: pointer;\n\ -}\n\ -a[href=\"javascript:;\"] {\n\ - text-decoration: none;\n\ -}\n\ -.warning {\n\ - color: red;\n\ -}\n\ -:root.sw-yotsuba #boardNavDesktop, :root.sw-yotsuba #boardNavMobile {\n\ - display: none !important;\n\ -}\n\ -:root.hide-bottom-board-list $site$boardListBottom {\n\ - display: none;\n\ -}\n\ -body.hasDropDownNav{\n\ - margin-top: 5px;\n\ -}\n\ -:root:not(.keyboard-focus) a {\n\ - outline: none;\n\ -}\n\ -.painted {\n\ - border-radius: 3px;\n\ - padding: 0px 2px;\n\ -}\n\ -[hidden] {\n\ - display: none !important;\n\ -}\n\ -/* 4chan style fixes */\n\ -/* overrides 4chan CSS on div.opContainer, div.op */\n\ -:root.sw-yotsuba .opContainer, :root.sw-yotsuba .op {\n\ - display: block;\n\ - overflow: visible;\n\ -}\n\ -:root.sw-yotsuba .reply > .file > .fileText {\n\ - margin: 0 20px;\n\ -}\n\ -:root.sw-yotsuba #arc-list span.quote {\n\ - color: #789922;\n\ -}\n\ -:root.sw-yotsuba .fileText a {\n\ - unicode-bidi: -moz-isolate;\n\ - unicode-bidi: -webkit-isolate;\n\ -}\n\ -:root.sw-yotsuba #g-recaptcha {\n\ - min-height: 78px;\n\ - height: auto;\n\ -}\n\ -:root.sw-yotsuba:not(.js-enabled) #postForm {\n\ - display: table;\n\ -}\n\ -:root.sw-yotsuba #captchaContainerAlt td:nth-child(2) {\n\ - display: table-cell !important;\n\ -}\n\ -:root.sw-yotsuba canvas#tegaki-canvas {\n\ - background: none;\n\ -}\n\ -/* Disable obnoxious captcha fade-in. */\n\ -:root.sw-yotsuba > body > div:last-of-type {\n\ - transition: none !important;\n\ -}\n\ -/* Fix captcha scrolling to top of page. */\n\ -:root.sw-yotsuba > body > div[style*=\" top: -10000px;\"] {\n\ - visibility: hidden !important;\n\ -}\n\ -/* Make long filenames wrap properly: https://github.com/ccd0/4chan-x/issues/1082 */\n\ -:root.sw-yotsuba .post > .file {\n\ - /* currently nonstandard but may be added: https://lists.w3.org/Archives/Public/www-style/2016Mar/0352.html, https://bugzilla.mozilla.org/show_bug.cgi?id=1296042 */\n\ - word-break: break-word;\n\ -}\n\ -:root.sw-yotsuba:not(.ua-webkit):not(.ua-blink) .fileText {\n\ - word-wrap: break-word;\n\ - max-width: calc(100vw - 90px);\n\ -}\n\ -:root.sw-yotsuba > body.is_catalog .thread > a > img {\n\ - display: inline-block;\n\ -}\n\ -/* Links to NSFW boards */\n\ -:root.sw-yotsuba .nwsb {\n\ - display: inline;\n\ -}\n\ -:root.sw-yotsuba .fileText {\n\ - max-width: auto;\n\ - white-space: normal;\n\ -}\n\ -/* Ads */\n\ -:root.sw-yotsuba .ad-cnt > *, :root.sw-yotsuba .adg-rects > *, :root.sw-yotsuba .bsa-cnt {\n\ - height: auto !important;\n\ -}\n\ -:root.sw-yotsuba:not(.ads-loaded) hr.abovePostForm,\n\ -:root.sw-yotsuba:not(.ads-loaded) .adg-rects > hr,\n\ -:root.sw-yotsuba #adg-ol + hr,\n\ -:root.sw-yotsuba .danbo-slot:empty {\n\ - display: none;\n\ -}\n\ -:root.sw-yotsuba .adg-rects {\n\ - margin: 0;\n\ - font-size: 0;\n\ -}\n\ -:root.sw-yotsuba div.center[style] {\n\ - display: none !important;\n\ -}\n\ -/* Tinyboard / vichan conflicts */\n\ -#menu > .hide-thread-link {\n\ - width: auto;\n\ - height: auto;\n\ - overflow: visible;\n\ - background-image: none;\n\ -}\n\ -#menu label.entry {\n\ - display: block;\n\ -}\n\ -#fourchanx-settings label {\n\ - display: inline;\n\ -}\n\ -.intro a[href=\"javascript:;\"],\n\ -#menu a {\n\ - margin: 0;\n\ -}\n\ -.gal-buttons.gal-buttons a {\n\ - font-size: inherit;\n\ -}\n\ -:root.sw-tinyboard.fixed.top-header:not(.autohide) .boardlist,\n\ -:root.sw-tinyboard.fixed.top-header:not(.autohide) .bar.top {\n\ - position: static;\n\ -}\n\ -:root.sw-tinyboard.fixed.top-header:not(.autohide) div.pages.top {\n\ - top: auto;\n\ - bottom: 0;\n\ -}\n\ -:root.sw-tinyboard.fixed.top-header.autohide .boardlist,\n\ -:root.sw-tinyboard.fixed.top-header.autohide .bar.top {\n\ - z-index: 3;\n\ -}\n\ -/* Tinyboard site style conflicts */\n\ -:root[data-host=\"fufufu.moe\"].fixed.top-header:not(.autohide) div.pages.top {\n\ - top: 26px;\n\ - bottom: auto;\n\ -}\n\ -:root[data-host=\"merorin.com\"].fixed.top-header:not(.autohide) span.settings {\n\ - top: 26px;\n\ -}\n\ -:root[data-host=\"fufufu.moe\"]:not(.fixed) #header-bar {\n\ - margin-top: 38px;\n\ -}\n\ -:root[data-host=\"lainchan.org\"]:not(.fixed) #header-bar {\n\ - margin-top: 17px;\n\ -}\n\ -:root[data-host=\"smuglo.li\"]:not(.fixed) #header-bar {\n\ - margin-top: 8px;\n\ -}\n\ -/* Anti-autoplay */\n\ -audio.controls-added {\n\ - display: block;\n\ - margin: auto;\n\ - white-space: normal;\n\ -}\n\ -:root.anti-autoplay div.embed {\n\ - position: static;\n\ - width: auto;\n\ - height: auto;\n\ - text-align: center;\n\ -}\n\ -:root.anti-autoplay .autoplay-removed {\n\ - visibility: visible !important;\n\ - min-width: 640px;\n\ - min-height: 360px;\n\ -}\n\ -/* fixed, z-index */\n\ -#overlay,\n\ -#qp, #ihover,\n\ -#navlinks, .fixed #header-bar,\n\ -:root.float #updater,\n\ -:root.float #thread-stats,\n\ -#qr {\n\ - position: fixed;\n\ -}\n\ -#overlay {\n\ - z-index: 999;\n\ -}\n\ -#qp, #ihover {\n\ - z-index: 60;\n\ -}\n\ -#menu, .gal-buttons {\n\ - z-index: 50;\n\ -}\n\ -#updater, #thread-stats {\n\ - z-index: 40;\n\ -}\n\ -:root.fixed #header-bar, #notifications {\n\ - z-index: 35;\n\ -}\n\ -#a-gallery {\n\ - z-index: 30;\n\ -}\n\ -#navlinks {\n\ - z-index: 25;\n\ -}\n\ -#qr {\n\ - z-index: 20;\n\ -}\n\ -#embedding {\n\ - z-index: 11;\n\ -}\n\ -:root.fixed-watcher #thread-watcher {\n\ - z-index: 10;\n\ -}\n\ -:root.fixed:not(.gallery-open) #header-bar:not(:hover) {\n\ - z-index: 8;\n\ -}\n\ -#thread-watcher {\n\ - z-index: 5;\n\ -}\n\ -/* Header */\n\ -.fixed.top-header body {\n\ - padding-top: 2em;\n\ -}\n\ -.fixed.bottom-header body {\n\ - padding-bottom: 2em;\n\ -}\n\ -.fixed #header-bar {\n\ - right: 0;\n\ - left: 0;\n\ - padding: 3px 4px 4px;\n\ - font-size: 12px;\n\ -}\n\ -.fixed.top-header #header-bar {\n\ - top: 0;\n\ -}\n\ -.fixed.bottom-header #header-bar {\n\ - bottom: 0;\n\ -}\n\ -#header-bar {\n\ - border-width: 0;\n\ - transition: all .1s .05s ease-in-out;\n\ -}\n\ -:root.fixed #header-bar {\n\ - box-shadow: -5px 1px 10px rgba(0, 0, 0, 0.20);\n\ -}\n\ -:root.centered-links #shortcuts {\n\ - width: 300px;\n\ - text-align: right;\n\ -}\n\ -:root.centered-links #header-bar {\n\ - text-align: center;\n\ -}\n\ -#custom-board-list {\n\ - font-size: 13px;\n\ - vertical-align: middle;\n\ -}\n\ -#full-board-list {\n\ - vertical-align: middle;\n\ -}\n\ -:root.centered-links #custom-board-list {\n\ - position: relative;\n\ - left: 150px;\n\ -}\n\ -.fixed.top-header #header-bar {\n\ - border-bottom-width: 1px;\n\ -}\n\ -.fixed.bottom-header #header-bar {\n\ - box-shadow: 0 -1px 2px rgba(0, 0, 0, .15);\n\ - border-top-width: 1px;\n\ -}\n\ -.fixed.bottom-header #header-bar .menu-button i {\n\ - border-top: none;\n\ - border-bottom: 6px solid;\n\ -}\n\ -.fixed #header-bar.autohide:not(:hover) {\n\ - box-shadow: none;\n\ - transition: all .8s .6s cubic-bezier(.55, .055, .675, .19);\n\ -}\n\ -.fixed.top-header #header-bar.autohide:not(:hover) {\n\ - margin-bottom: -1em;\n\ - -webkit-transform: translateY(-100%);\n\ - transform: translateY(-100%);\n\ -}\n\ -.fixed.bottom-header #header-bar.autohide:not(:hover) {\n\ - -webkit-transform: translateY(100%);\n\ - transform: translateY(100%);\n\ -}\n\ -#scroll-marker {\n\ - left: 0;\n\ - right: 0;\n\ - height: 10px;\n\ - position: absolute;\n\ -}\n\ -#header-bar:not(.autohide) #scroll-marker {\n\ - pointer-events: none;\n\ -}\n\ -#header-bar #scroll-marker {\n\ - display: none;\n\ -}\n\ -.fixed #header-bar #scroll-marker {\n\ - display: block;\n\ -}\n\ -.fixed.top-header #header-bar #scroll-marker {\n\ - top: 100%;\n\ -}\n\ -.fixed.bottom-header #header-bar #scroll-marker {\n\ - bottom: 100%;\n\ -}\n\ -#board-list a, #shortcuts a:not(.entry) {\n\ - text-decoration: none;\n\ - padding: 1px;\n\ -}\n\ -#shortcuts:empty {\n\ - display: none;\n\ -}\n\ -.brackets-wrap::before {\n\ - content: \"\\00a0[\";\n\ -}\n\ -.brackets-wrap::after {\n\ - content: \"]\\00a0\";\n\ -}\n\ -.dead-thread,\n\ -.disabled:not(.replies-quoting-you) {\n\ - opacity: .45;\n\ -}\n\ -#shortcuts {\n\ - float: right;\n\ -}\n\ -:root.autohiding-scrollbar #shortcuts {\n\ - margin-right: 12px;\n\ -}\n\ -.shortcut {\n\ - margin-left: 3px;\n\ - vertical-align: middle;\n\ -}\n\ -:root.shortcut-icons .native-settings {\n\ - font-size: 0;\n\ - color: transparent;\n\ - display: inline-block;\n\ - vertical-align: top;\n\ - height: 12px;\n\ - width: 14px;\n\ - background: url('//s.4cdn.org/image/favicon.ico') 0px -1px no-repeat;\n\ -}\n\ -#navbotright,\n\ -#navtopright {\n\ - display: none;\n\ -}\n\ -#toggleMsgBtn {\n\ - display: none !important;\n\ -}\n\ -.current,\n\ -:root.sw-yotsuba div#boardNavDesktopFoot a.current {\n\ - font-weight: bold;\n\ -}\n\ -@media (min-width: 1300px) {\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #header-bar {\n\ - white-space: nowrap;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: center;\n\ - align-items: center;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #board-list {\n\ - -webkit-flex: auto;\n\ - flex: auto;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list {\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) .hide-board-list-container {\n\ - -webkit-flex: none;\n\ - flex: none;\n\ - margin-right: 5px;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList {\n\ - -webkit-flex: auto;\n\ - flex: auto;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - width: 0px; /* XXX Fixes Edge not shrinking the board list below default size when needed */\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > a,\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span:not(.space):not(.spacer) {\n\ - -webkit-flex: none;\n\ - flex: none;\n\ - padding: .17em;\n\ - margin: -.17em -.32em;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span {\n\ - pointer-events: none;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span.space {\n\ - -webkit-flex: 0 .63 .63em;\n\ - flex: 0 .63 .63em;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span.spacer {\n\ - -webkit-flex: 0 .38 .38em;\n\ - flex: 0 .38 .38em;\n\ - }\n\ - :root.sw-yotsuba.fixed:not(.centered-links) #shortcuts {\n\ - float: initial;\n\ - -webkit-flex: none;\n\ - flex: none;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: center;\n\ - align-items: center;\n\ - }\n\ -}\n\ -/* 4chan X link brackets */\n\ -.brackets-wrap::before {\n\ - content: \"[\";\n\ -}\n\ -.brackets-wrap::after {\n\ - content: \"]\";\n\ -}\n\ -/* Notifications */\n\ -#notifications {\n\ - position: fixed;\n\ - top: 0;\n\ - height: 0;\n\ - text-align: center;\n\ - right: 0;\n\ - left: 0;\n\ - visibility: visible;\n\ -}\n\ -#notifications:empty {\n\ - display: none;\n\ -}\n\ -:root.fixed.top-header:not(.gallery-open) #header-bar #notifications,\n\ -:root.fixed.top-header #header-bar.autohide #notifications {\n\ - position: absolute;\n\ - top: 100%;\n\ -}\n\ -.notification {\n\ - color: #FFF;\n\ - font-weight: 700;\n\ - text-shadow: 0 1px 2px rgba(0, 0, 0, .5);\n\ - box-shadow: 0 1px 2px rgba(0, 0, 0, .15);\n\ - border-radius: 2px;\n\ - margin: 1px auto;\n\ - width: 550px;\n\ - max-width: 100%;\n\ - position: relative;\n\ - transition: all .25s ease-in-out;\n\ -}\n\ -.notification.error {\n\ - background-color: hsla(0, 100%, 38%, .9);\n\ -}\n\ -.notification.warning {\n\ - background-color: hsla(36, 100%, 38%, .9);\n\ -}\n\ -.notification.info {\n\ - background-color: hsla(200, 100%, 38%, .9);\n\ -}\n\ -.notification.success {\n\ - background-color: hsla(104, 100%, 38%, .9);\n\ -}\n\ -.notification a {\n\ - color: white;\n\ -}\n\ -.notification > .close {\n\ - padding: 7px;\n\ - top: 0px;\n\ - right: 5px;\n\ - position: absolute;\n\ -}\n\ -.notification > .fa-times::before {\n\ - font-size: 11px !important;\n\ -}\n\ -.message {\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ - padding: 6px 20px;\n\ - max-height: 200px;\n\ - width: 100%;\n\ - overflow: auto;\n\ - white-space: pre-line;\n\ -}\n\ -.message a {\n\ - text-decoration: underline;\n\ -}\n\ -:root.tainted .report-error {\n\ - display: none;\n\ -}\n\ -/* Settings */\n\ -:root.fourchan-x body {\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ -}\n\ -#overlay {\n\ - background-color: rgba(0, 0, 0, .5);\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - top: 0;\n\ - left: 0;\n\ - height: 100%;\n\ - width: 100%;\n\ -}\n\ -#fourchanx-settings {\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ - box-shadow: 0 0 15px rgba(0, 0, 0, .15);\n\ - height: 600px;\n\ - max-height: 100%;\n\ - width: 900px;\n\ - max-width: 100%;\n\ - margin: auto;\n\ - padding: 5px;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-flex-direction: column;\n\ - flex-direction: column;\n\ -}\n\ -#fourchanx-settings > nav {\n\ - padding: 2px 2px 8px;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ -}\n\ -#fourchanx-settings > nav a {\n\ - text-decoration: underline;\n\ -}\n\ -#fourchanx-settings > nav a.close {\n\ - text-decoration: none;\n\ - padding: 0 2px;\n\ - margin: 0;\n\ -}\n\ -.section-container {\n\ - -webkit-flex: 1;\n\ - flex: 1;\n\ - position: relative;\n\ - overflow: auto;\n\ - padding-right: 5px;\n\ - overscroll-behavior: contain;\n\ -}\n\ -.sections-list {\n\ - -webkit-flex: 1;\n\ - flex: 1;\n\ -}\n\ -.export, .import, .reset {\n\ - cursor: pointer;\n\ - text-decoration: none !important;\n\ -}\n\ -.tab-selected {\n\ - font-weight: 700;\n\ -}\n\ -.section-sauce ul,\n\ -.section-advanced ul {\n\ - list-style: none;\n\ - margin: 0;\n\ -}\n\ -.section-sauce ul {\n\ - padding: 8px;\n\ -}\n\ -.section-advanced ul {\n\ - padding: 0px;\n\ -}\n\ -.section-sauce li,\n\ -.section-advanced li {\n\ - padding-left: 4px;\n\ -}\n\ -.section-main ul {\n\ - margin: 0;\n\ - padding: 0 0 0 16px;\n\ -}\n\ -.section-main li {\n\ - white-space: pre-line;\n\ - list-style: disc;\n\ -}\n\ -.section-main li:not(:first-of-type) {\n\ - margin-top: 4px;\n\ -}\n\ -.section-main label {\n\ - text-decoration: underline;\n\ -}\n\ -div[data-checked=\"false\"] > .suboption-list {\n\ - display: none;\n\ -}\n\ -.suboption-list {\n\ - position: relative;\n\ -}\n\ -.suboption-list::before {\n\ - content: \"\";\n\ - display: inline-block;\n\ - position: absolute;\n\ - left: .7em;\n\ - width: 0;\n\ - height: 100%;\n\ - border-left: 1px solid;\n\ -}\n\ -.suboption-list > div {\n\ - position: relative;\n\ - padding-left: 1.4em;\n\ -}\n\ -.suboption-list > div::before {\n\ - content: \"\";\n\ - display: inline-block;\n\ - position: absolute;\n\ - left: .7em;\n\ - width: .7em;\n\ - height: .6em;\n\ - border-left: 1px solid;\n\ - border-bottom: 1px solid;\n\ -}\n\ -#fourchanx-settings .section-main p {\n\ - margin: .5em 0 0;\n\ -}\n\ -.section-filter ul {\n\ - padding: 0;\n\ -}\n\ -.section-filter li {\n\ - margin: 10px 40px;\n\ - list-style: disc;\n\ -}\n\ -.section-filter textarea {\n\ - height: 500px;\n\ -}\n\ -.section-main a, .section-filter a, .section-advanced a {\n\ - text-decoration: underline;\n\ -}\n\ -#sauce-doc-expand:not(:checked) ~ #sauce-doc {\n\ - max-height: 130px;\n\ - overflow: auto;\n\ -}\n\ -#sauce-doc > label {\n\ - float: right;\n\ - margin: 0 5px;\n\ -}\n\ -/* XXX for OneeChan */\n\ -#sauce-doc-expand + .riceCheck {\n\ - display: none;\n\ -}\n\ -.section-sauce textarea {\n\ - height: 430px;\n\ -}\n\ -.section-advanced .field[name=\"boardnav\"] {\n\ - width: 100%;\n\ -}\n\ -.section-advanced textarea {\n\ - height: 150px;\n\ -}\n\ -.section-advanced textarea[name=\"archiveLists\"],\n\ -.section-advanced textarea[name=\"externalCatalogURLs\"],\n\ -.section-advanced textarea[name=\"knownBanners\"] {\n\ - height: 75px;\n\ -}\n\ -.section-advanced .archive-cell {\n\ - min-width: 160px;\n\ - text-align: center;\n\ -}\n\ -.section-advanced #archive-board-select {\n\ - position: absolute;\n\ -}\n\ -.section-advanced .note {\n\ - font-size: 0.8em;\n\ - font-style: italic;\n\ - margin-left: 10px;\n\ -}\n\ -.section-advanced .note code {\n\ - font-style: normal;\n\ - font-size: 11px;\n\ -}\n\ -.favicon-preview > img {\n\ - vertical-align: middle;\n\ -}\n\ -.favicon-preview > img:nth-of-type(3n+1) {\n\ - margin-left: 4px;\n\ -}\n\ -.section-keybinds .field {\n\ - font-family: monospace;\n\ -}\n\ -#fourchanx-settings fieldset {\n\ - border: 1px solid;\n\ - border-radius: 3px;\n\ - padding: 0.35em 0.625em 0.75em;\n\ - margin: 0px 2px;\n\ -}\n\ -#fourchanx-settings legend {\n\ - font-weight: 700;\n\ - color: inherit;\n\ -}\n\ -#fourchanx-settings textarea {\n\ - font-family: monospace;\n\ - width: 100%;\n\ - resize: vertical;\n\ -}\n\ -#fourchanx-settings code {\n\ - color: #000;\n\ - background-color: #FFF;\n\ - padding: 0 2px;\n\ -}\n\ -#fourchanx-settings th {\n\ - text-align: center;\n\ - font-weight: bold;\n\ -}\n\ -#fourchanx-settings p {\n\ - margin: 1em 0px;\n\ -}\n\ -#fourchanx-settings table {\n\ - margin: auto;\n\ -}\n\ -/* Index */\n\ -:root.index-loading .navLinks:not(.json-index),\n\ -:root.index-loading .board:not(.json-index),\n\ -:root.index-loading .pagelist:not(.json-index),\n\ -:root.infinite-mode .pagelist,\n\ -:root.all-pages-mode .pagelist,\n\ -:root.catalog-mode .pagelist,\n\ -:root:not(.catalog-mode) .indexlink,\n\ -:root.catalog-mode .cataloglink,\n\ -:root:not(.catalog-mode) #hidden-label,\n\ -:root:not(.catalog-mode) #index-size {\n\ - display: none;\n\ -}\n\ -#index-search {\n\ - padding-right: 1.5em;\n\ - width: 100px;\n\ - transition: color .25s, border-color .25s, width .25s;\n\ -}\n\ -#index-search:focus,\n\ -#index-search[data-searching] {\n\ - width: 200px;\n\ -}\n\ -#index-search-clear {\n\ - color: gray;\n\ - display: inline-block;\n\ - position: relative;\n\ - left: -1em;\n\ - width: 0;\n\ -}\n\ -/* ``::-webkit-*'' selectors break selector lists on Firefox. */\n\ -#index-search::-webkit-search-cancel-button {\n\ - display: none;\n\ -}\n\ -#index-search:not([data-searching]) + #index-search-clear {\n\ - display: none;\n\ -}\n\ -#index-options {\n\ - float: right;\n\ -}\n\ -#lastlong-options {\n\ - display: inline-block;\n\ - vertical-align: middle;\n\ - height: 28px;\n\ - margin: -14px 0;\n\ -}\n\ -#lastlong-options > input {\n\ - padding: 0;\n\ - border: 0 !important;\n\ - text-align: center;\n\ - background: transparent;\n\ - display: block;\n\ - font-size: 12px;\n\ - height: 12px;\n\ - width: 30px;\n\ - margin: 1px 0;\n\ -}\n\ -.summary {\n\ - text-decoration: none;\n\ -}\n\ -/* Catalog */\n\ -:root.catalog-mode .board {\n\ - text-align: center;\n\ -}\n\ -.catalog-thread {\n\ - display: inline-block;\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ - border: 1px solid transparent;\n\ - word-wrap: break-word;\n\ - vertical-align: top;\n\ - position: relative;\n\ -}\n\ -/* overrides 4chan CSS on div.thread */\n\ -.catalog-thread.catalog-thread {\n\ - margin: 2px;\n\ -}\n\ -.catalog-small > .catalog-thread {\n\ - width: 165px;\n\ - height: 320px;\n\ -}\n\ -.catalog-large > .catalog-thread {\n\ - width: 270px;\n\ - height: 410px;\n\ -}\n\ -:root.catalog-hover-expand .catalog-thread:hover {\n\ - z-index: 1;\n\ -}\n\ -.catalog-container {\n\ - position: absolute;\n\ - top: -4px;\n\ - left: 0;\n\ - right: 0;\n\ - bottom: 0;\n\ -}\n\ -.catalog-container:not(:hover),\n\ -:root:not(.catalog-hover-expand) .catalog-container {\n\ - overflow: hidden;\n\ -}\n\ -.catalog-post {\n\ - position: absolute;\n\ - top: 4px;\n\ - left: 0;\n\ - right: 0;\n\ - border: 1px solid transparent;\n\ - padding-top: 20px;\n\ -}\n\ -/* overrides inline CSS from Index.cb.hoverAdjust */\n\ -:root:not(.catalog-hover-expand) .catalog-post {\n\ - left: 0 !important;\n\ - right: 0 !important;\n\ -}\n\ -/* overrides 4chan CSS on div.post */\n\ -.catalog-post.catalog-post {\n\ - margin: -21px -1px -1px;\n\ - overflow: visible;\n\ -}\n\ -.catalog-thread.noFile > * > .catalog-post {\n\ - margin-top: -7px;\n\ - padding-top: 6px;\n\ -}\n\ -:root.catalog-hover-expand .catalog-container:hover > .catalog-post {\n\ - margin-left: -61px;\n\ - margin-right: -61px;\n\ -}\n\ -:root.catalog-hover-expand .catalog-container:hover > * > :not(.catalog-replies) {\n\ - padding-left: 2px;\n\ - padding-right: 2px;\n\ -}\n\ -.catalog-link {\n\ - display: block;\n\ - position: relative;\n\ -}\n\ -.catalog-thumb {\n\ - border-radius: 2px;\n\ - box-shadow: 0 0 5px rgba(0, 0, 0, .25);\n\ - vertical-align: top;\n\ -}\n\ -.catalog-thumb.spoiler-file {\n\ - width: 100px;\n\ - height: 100px;\n\ -}\n\ -.catalog-thumb.deleted-file {\n\ - width: 127px;\n\ - height: 13px;\n\ - padding: 20px 11px;\n\ -}\n\ -.catalog-thumb.no-file {\n\ - width: 77px;\n\ - height: 13px;\n\ - padding: 20px 36px;\n\ -}\n\ -.catalog-icons > img,\n\ -.catalog-stats > .menu-button {\n\ - width: 1em;\n\ - height: 1em;\n\ - margin: 0;\n\ - vertical-align: text-top;\n\ - padding-left: 2px;\n\ -}\n\ -.catalog-stats > .menu-button {\n\ - font-weight: normal;\n\ -}\n\ -.catalog-stats > .menu-button > i::before {\n\ - line-height: 11px;\n\ -}\n\ -.catalog-stats {\n\ - font-size: 10px;\n\ - font-weight: 700;\n\ - padding-top: 2px;\n\ -}\n\ -.catalog-stats > [title] {\n\ - cursor: help;\n\ -}\n\ -.catalog-post > .postMessage {\n\ - margin: 0;\n\ - padding-bottom: .3em;\n\ -}\n\ -.catalog-container:not(:hover) > * > .file,\n\ -.catalog-container:not(:hover) > * > .postInfo > :not(.subject),\n\ -.catalog-container:not(:hover) > * > .catalog-replies,\n\ -.catalog-container:not(:hover) .extra-linebreak,\n\ -.catalog-container:not(:hover) .abbr,\n\ -:root:not(.catalog-hover-expand) .catalog-container > * > .file,\n\ -:root:not(.catalog-hover-expand) .catalog-container > * > .postInfo > :not(.subject),\n\ -:root:not(.catalog-hover-expand) .catalog-container > * > .catalog-replies,\n\ -:root:not(.catalog-hover-expand) .catalog-container .extra-linebreak,\n\ -:root:not(.catalog-hover-expand) .catalog-container .abbr,\n\ -.catalog-thread > .catalog-container > :not(.catalog-post),\n\ -.catalog-post > .file > :not(.fileText),\n\ -.catalog-post > * > .fileText > :not(:first-child),\n\ -.catalog-post > .postInfo > :not(.subject):not(.nameBlock):not(.dateTime),\n\ -.catalog-post > .postInfo > .nameBlock > .contact-links,\n\ -.catalog-post > * > * > .posteruid,\n\ -.catalog-post > * > * > .postJumper,\n\ -:root.bottom-backlinks .catalog-post > .container,\n\ -.post:not(.catalog-post) > .catalog-link,\n\ -.post:not(.catalog-post) > .catalog-stats,\n\ -.post:not(.catalog-post) > .catalog-replies {\n\ - display: none;\n\ -}\n\ -.catalog-post > .file {\n\ - position: absolute;\n\ - left: 0;\n\ - right: 0;\n\ - top: 0;\n\ - min-height: 20px;\n\ - background-color: inherit;\n\ -}\n\ -.catalog-post > * > .fileText {\n\ - position: relative;\n\ - padding: 2px;\n\ - background-color: inherit;\n\ -}\n\ -.catalog-small .catalog-post > * .fileText {\n\ - font-size: 10px;\n\ -}\n\ -.catalog-post > * > .fileText:not(:hover) {\n\ - white-space: nowrap;\n\ - overflow: hidden;\n\ - text-overflow: ellipsis;\n\ -}\n\ -.catalog-post > * > .fileText:hover {\n\ - z-index: 1;\n\ -}\n\ -/* overrides 4chan CSS on div.post div.postInfo */\n\ -.catalog-post > .postInfo.postInfo {\n\ - width: auto;\n\ -}\n\ -.catalog-post > * > .subject {\n\ - display: block;\n\ -}\n\ -.catalog-post > * > .dateTime {\n\ - display: inline-block;\n\ - font-style: italic;\n\ -}\n\ -:root.catalog-hover-expand .catalog-container:hover > * > * > .nameBlock,\n\ -:root.catalog-hover-expand .catalog-container:hover > * > * > .dateTime,\n\ -:root.catalog-hover-expand .catalog-container:hover > * > .postMessage:not(:empty) {\n\ - padding-top: .3em;\n\ -}\n\ -.catalog-post .extra-linebreak {\n\ - content: ''; /* makes this work in Blink/WebKit */\n\ - display: block;\n\ - margin-top: .3em;\n\ -}\n\ -.catalog-reply {\n\ - text-align: left;\n\ - white-space: nowrap;\n\ - border-top: 1px solid transparent;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-flex-direction: row;\n\ - flex-direction: row;\n\ - -webkit-align-items: stretch;\n\ - align-items: stretch;\n\ -}\n\ -.catalog-reply > * {\n\ - padding: 3px;\n\ - overflow: hidden;\n\ - -webkit-flex: none;\n\ - flex: none;\n\ -}\n\ -.catalog-reply > span {\n\ - font-style: italic;\n\ - font-weight: bold;\n\ -}\n\ -.catalog-reply-excerpt {\n\ - -webkit-flex: 1 1 auto;\n\ - flex: 1 1 auto;\n\ -}\n\ -.catalog-post .prettyprinted {\n\ - max-width: 100%;\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ -}\n\ -.catalog-post .MathJax_Display {\n\ - text-align: center !important;\n\ -}\n\ -.catalog-container:not(:hover) .exif,\n\ -:root:not(.catalog-hover-expand) .catalog-container .exif {\n\ - display: none !important;\n\ -}\n\ -.catalog-post > * > .exif {\n\ - border-collapse: collapse;\n\ -}\n\ -:root.catalog-hover-expand .catalog-container:hover .exif[style*=\"display: block;\"] {\n\ - display: inline-block !important;\n\ -}\n\ -.catalog-post > * > .exif,\n\ -.catalog-post > * > .exif > tbody {\n\ - background-color: inherit;\n\ -}\n\ -.catalog-post > * > .exif,\n\ -.catalog-post > * > .exif td {\n\ - min-width: 0;\n\ -}\n\ -.catalog-post > * > .exif td {\n\ - padding-top: 1px;\n\ -}\n\ -:root.hats-enabled .catalog-thread::after {\n\ - content: '';\n\ - pointer-events: none;\n\ - position: absolute;\n\ - background-size: contain;\n\ -}\n\ -:root.hats-enabled .catalog-small > .catalog-thread::after {\n\ - left: -8px;\n\ - top: -59px;\n\ - width: 96px;\n\ - height: 96px;\n\ -}\n\ -:root.hats-enabled:not(.werkTyme) .catalog-small > .catalog-thread:not(.noFile)::after {\n\ - left: calc(67px - .3px * var(--tn-w));\n\ -}\n\ -:root.hats-enabled .catalog-large > .catalog-thread::after {\n\ - left: -15px;\n\ - top: -98px;\n\ - width: 160px;\n\ - height: 160px;\n\ -}\n\ -:root.hats-enabled:not(.werkTyme) .catalog-large > .catalog-thread:not(.noFile)::after {\n\ - left: calc(110px - .5px * var(--tn-w));\n\ -}\n\ -/* Copy Text Link's textarea element */\n\ -textarea.copy-text-element {\n\ - height: 0;\n\ - width: 0;\n\ - position: absolute;\n\ - top: -10000px;\n\ -}\n\ -/* Announcement Hiding */\n\ -:root.hide-announcement $site$psa {\n\ - display: none;\n\ -}\n\ -.hide-announcement-button {\n\ - opacity: 0.4;\n\ - float: left;\n\ -}\n\ -/* Unread */\n\ -.unread-line {\n\ - margin: 0;\n\ - border-color: rgb(255,0,0);\n\ -}\n\ -.unread-line + br {\n\ - display: none;\n\ -}\n\ -.unread-mark-read {\n\ - float: right;\n\ - clear: both;\n\ - width: 100%;\n\ - text-align: right;\n\ -}\n\ -:not(.unread-thread) > .unread-mark-read {\n\ - display: none;\n\ -}\n\ -/* Thread Updater */\n\ -#updater {\n\ - background: none;\n\ - border: none;\n\ - box-shadow: none;\n\ -}\n\ -#updater > .move {\n\ - position: absolute;\n\ - top: -5px;\n\ - bottom: -5px;\n\ - left: -5px;\n\ - right: -5px;\n\ - z-index: -1;\n\ -}\n\ -#updater > div:last-child {\n\ - text-align: center;\n\ -}\n\ -#updater input[type=\"number\"] {\n\ - width: 4em;\n\ -}\n\ -:root.float #updater {\n\ - padding: 0px 3px;\n\ -}\n\ -:root:not(.float).shortcut-icons #updater {\n\ - display: inline-block;\n\ - min-width: 12pt;\n\ - text-align: right;\n\ -}\n\ -.new {\n\ - color: limegreen;\n\ -}\n\ -#update-status:not(.empty) + #update-timer:not(.empty):not(.loading) {\n\ - margin-left: 5px;\n\ -}\n\ -#update-timer {\n\ - cursor: pointer;\n\ -}\n\ -/* Thread Watcher */\n\ -#thread-watcher {\n\ - position: absolute;\n\ -}\n\ -#thread-watcher {\n\ - padding-bottom: 3px;\n\ - padding-left: 3px;\n\ - white-space: nowrap;\n\ - min-width: 146px;\n\ -}\n\ -#watched-threads {\n\ - overflow-x: hidden;\n\ - overflow-y: auto;\n\ -}\n\ -#thread-watcher .refresh {\n\ - padding: 0px 3px;\n\ -}\n\ -:root.fixed-watcher #thread-watcher {\n\ - position: fixed;\n\ -}\n\ -:root.fixed-watcher #watched-threads {\n\ - /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */\n\ - max-height: 85vh;\n\ - max-height: calc(100vh - 75px);\n\ -}\n\ -:root:not(.fixed-watcher) #watched-threads:not(:hover) {\n\ - max-height: 210px;\n\ - overflow-y: hidden;\n\ -}\n\ -#thread-watcher > .move {\n\ - padding-top: 3px;\n\ -}\n\ -#watched-threads > div {\n\ - padding-left: 3px;\n\ - padding-right: 3px;\n\ -}\n\ -#watched-threads .watcher-link {\n\ - max-width: 250px;\n\ - display: -webkit-inline-flex;\n\ - display: inline-flex;\n\ - -webkit-flex-direction: row;\n\ - flex-direction: row;\n\ -}\n\ -#watched-threads .watcher-page,\n\ -#watched-threads .watcher-unread {\n\ - -webkit-flex: 0 0 auto;\n\ - flex: 0 0 auto;\n\ - margin-right: 2px;\n\ -}\n\ -#watched-threads .watcher-title {\n\ - overflow: hidden;\n\ - text-overflow: ellipsis;\n\ - -webkit-flex: 0 1 auto;\n\ - flex: 0 1 auto;\n\ -}\n\ -#watched-threads .watcher-title:not(:first-child) {\n\ - margin-left: 2px;\n\ -}\n\ -.replies-quoting-you > a, #watcher-link.replies-quoting-you, .last-page > a > .watcher-page {\n\ - color: #F00;\n\ -}\n\ -#thread-watcher a {\n\ - text-decoration: none;\n\ -}\n\ -#thread-watcher .move > .close {\n\ - position: absolute;\n\ - right: 0px;\n\ - top: 0px;\n\ - padding: 0px 4px;\n\ -}\n\ -.watch-thread-link {\n\ - padding-top: 18px;\n\ - width: 18px;\n\ - height: 0px;\n\ - display: inline-block;\n\ - background-repeat: no-repeat;\n\ - opacity: 0.2;\n\ - position: relative;\n\ - top: 1px;\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -.watch-thread-link.watched {\n\ - opacity: 1;\n\ -}\n\ -/* Thread Stats */\n\ -#thread-stats {\n\ - background: none;\n\ - border: none;\n\ - box-shadow: none;\n\ -}\n\ -:root.float #thread-stats > .move > :not(#page-count) {\n\ - pointer-events: none;\n\ -}\n\ -:root.float #thread-stats {\n\ - padding: 0px 3px;\n\ -}\n\ -#page-count {\n\ - cursor: pointer;\n\ -}\n\ -/* Quote */\n\ -.hashlink::before {\n\ - content: ' ';\n\ - visibility: hidden;\n\ -}\n\ -.inline + .hashlink {\n\ - display: none !important;\n\ -}\n\ -:root.resurrect-quotes .deadlink {\n\ - text-decoration: none !important;\n\ -}\n\ -.catalog-post .qmark-ct {\n\ - display: none;\n\ -}\n\ -.backlink.deadlink:not(.forwardlink),\n\ -.quotelink.deadlink:not(.forwardlink) {\n\ - text-decoration: underline !important;\n\ -}\n\ -:root:not(.catalog-mode) .inlined {\n\ - opacity: .5;\n\ -}\n\ -#qp input, .forwarded {\n\ - display: none;\n\ -}\n\ -.quotelink.forwardlink,\n\ -.backlink.forwardlink {\n\ - text-decoration: none;\n\ - border-bottom: 1px dashed;\n\ -}\n\ -.filtered {\n\ - text-decoration: underline line-through;\n\ -}\n\ -:root.hide-backlinks .backlink.filtered,\n\ -:root.hide-backlinks .backlink.filtered + .hashlink.filtered {\n\ - display: none;\n\ -}\n\ -.postNum + .container::before {\n\ - content: \" \";\n\ -}\n\ -:root.bottom-backlinks .container {\n\ - display: block;\n\ - clear: both;\n\ - margin: 0 4px;\n\ -}\n\ -:root.bottom-backlinks .backlink {\n\ - font-size: 90%;\n\ -}\n\ -.inline {\n\ - border: 1px solid;\n\ - display: table;\n\ - margin: 2px 0;\n\ -}\n\ -.container ~ .inline {\n\ - margin-left: 20px;\n\ -}\n\ -:root.catalog-mode .inline {\n\ - display: none;\n\ -}\n\ -.inline .post {\n\ - border: 0 !important;\n\ - background-color: transparent !important;\n\ - display: table !important;\n\ - margin: 0 !important;\n\ - padding: 1px 2px !important;\n\ -}\n\ -#qp > .opContainer::after {\n\ - content: '';\n\ - clear: both;\n\ - display: table;\n\ -}\n\ -#qp .post {\n\ - border: none;\n\ - margin: 0;\n\ - padding: 2px 2px 5px;\n\ -}\n\ -#qp img {\n\ - max-height: 80vh;\n\ - max-width: 50vw;\n\ -}\n\ -/* Quote Threading */\n\ -.threadContainer {\n\ - margin-left: 20px;\n\ - border-left: 1px solid rgba(128,128,128,.3);\n\ -}\n\ -.threadOP {\n\ - clear: both;\n\ -}\n\ -/* File */\n\ -.fileText-original,\n\ -.fnswitch:hover > .fntrunc,\n\ -.fnswitch:not(:hover) > .fnfull,\n\ -.expanded-image > .post > .file > .fileThumb > video[data-md5],\n\ -.expanded-image > .post > .file > .fileThumb > img[data-md5] {\n\ - display: none;\n\ -}\n\ -.full-image[data-file-i-d] {\n\ - display: none;\n\ - cursor: pointer;\n\ -}\n\ -.expanded-image > .post > .file > .fileThumb > .full-image {\n\ - display: inline;\n\ -}\n\ -.expanded-image {\n\ - clear: left;\n\ -}\n\ -.expanding {\n\ - opacity: .5;\n\ -}\n\ -:root.fit-height .full-image {\n\ - max-height: 100vh;\n\ -}\n\ -:root.fit-height.fixed .full-image {\n\ - /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */\n\ - max-height: 93vh;\n\ - max-height: calc(100vh - 35px);\n\ -}\n\ -:root.fit-width .full-image {\n\ - max-width: 100%;\n\ -}\n\ -:root.ua-gecko.fit-width .full-image {\n\ - width: 100%;\n\ -}\n\ -.fileThumb > .warning {\n\ - clear: both;\n\ -}\n\ -#ihover {\n\ - pointer-events: none;\n\ - /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */\n\ - max-height: 95vh;\n\ - max-height: calc(100vh - 25px);\n\ - max-width: 100vw;\n\ -}\n\ -/* WEBM Metadata */\n\ -.webm-title > a::before {\n\ - content: \"title\";\n\ - text-decoration: underline;\n\ -}\n\ -.webm-title.loading > a::after {\n\ - content: \"...\";\n\ -}\n\ -.webm-title.error > a:hover::before,\n\ -.webm-title.error > a:focus::before {\n\ - content: \"error\";\n\ - text-decoration: none;\n\ -}\n\ -.webm-title > span {\n\ - cursor: text;\n\ -}\n\ -.webm-title.not-found > span::before {\n\ - content: \"not found\";\n\ -}\n\ -.webm-title:not(:hover):not(:focus) > span,\n\ -.webm-title:hover > span + a,\n\ -.webm-title:focus > span + a {\n\ - display: none;\n\ -}\n\ -/* Volume control */\n\ -input[name=\"Default Volume\"] {\n\ - width: 4em;\n\ - height: 1ex;\n\ - vertical-align: middle;\n\ - margin: 0px;\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.fappeTyme $site$replyOriginal.noFile,\n\ -:root.fappeTyme $site$replyOriginal.noFile + br {\n\ - display: none;\n\ -}\n\ -:root.werkTyme $site$thumbLink,\n\ -:root.werkTyme $site$file$thumb,\n\ -:root.werkTyme .catalog-thumb:not(.deleted-file):not(.no-file),\n\ -:root:not(.werkTyme) .werkTyme-filename {\n\ - display: none;\n\ -}\n\ -.werkTyme-filename {\n\ - font-weight: bold;\n\ - font-size: 110%;\n\ -}\n\ -:root.werkTyme .catalog-link {\n\ - box-shadow: 0 0 5px rgba(0, 0, 0, .25);\n\ - padding: 8px;\n\ - text-align: center;\n\ -}\n\ -:root.werkTyme .catalog-thumb {\n\ - box-shadow: none;\n\ - padding: 0;\n\ - vertical-align: middle;\n\ -}\n\ -.indicator {\n\ - background: rgba(255,0,0,0.8);\n\ - font-weight: bold;\n\ - display: inline-block;\n\ - min-width: 9px;\n\ - padding: 0px 2px;\n\ - margin: 0 1px;\n\ - text-align: center;\n\ - color: white;\n\ - border-radius: 2px;\n\ - cursor: pointer;\n\ -}\n\ -:root:not(.fappeTyme) #shortcut-fappe,\n\ -:root:not(.werkTyme) #shortcut-werk {\n\ - display: none;\n\ -}\n\ -/* Index/Reply Navigation */\n\ -#navlinks {\n\ - font-size: 16px;\n\ - top: 25px;\n\ - right: 10px;\n\ -}\n\ -:root.catalog-mode #navlinks {\n\ - display: none;\n\ -}\n\ -/* Highlighting */\n\ -.qphl {\n\ - outline: 2px solid rgba(216, 94, 49, .8);\n\ -}\n\ -:root.highlight-you .quotesYou$site$highlightable$op,\n\ -:root.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(221, 0, 0, .8);\n\ -}\n\ -:root.highlight-own .yourPost$site$highlightable$op,\n\ -:root.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(221, 0, 0, .8);\n\ -}\n\ -.filter-highlight$site$highlightable$op,\n\ -.filter-highlight$site$highlightable$reply {\n\ - box-shadow: inset 5px 0 rgba(221, 0, 0, .5);\n\ -}\n\ -:root.highlight-own .yourPost > $site$sideArrows,\n\ -:root.highlight-you .quotesYou > $site$sideArrows,\n\ -.filter-highlight > $site$sideArrows {\n\ - color: rgba(221, 0, 0, .8);\n\ -}\n\ -:root.highlight-own .yourPost$site$highlightable$op::after,\n\ -:root.highlight-you .quotesYou$site$highlightable$op::after,\n\ -.filter-highlight$site$highlightable$op::after {\n\ - content: \"\";\n\ - display: block;\n\ - clear: both;\n\ -}\n\ -:root:not(.werkTyme) .catalog-thread.filter-highlight .catalog-thumb,\n\ -:root.werkTyme .catalog-thread.filter-highlight:not(:hover),\n\ -:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.filter-highlight,\n\ -:root.werkTyme.catalog-hover-expand .catalog-thread.filter-highlight > .catalog-container:hover > .catalog-post,\n\ -:root.catalog $site$catalog$thread.filter-highlight$site$highlightable$catalog {\n\ - box-shadow: 0 0 3px 3px rgba(255, 0, 0, .5);\n\ -}\n\ -:root:not(.werkTyme) .catalog-thread.watched .catalog-thumb,\n\ -:root:root.werkTyme .catalog-thread.watched:not(:hover),\n\ -:root:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched,\n\ -:root.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post {\n\ - border: 2px solid rgba(255, 0, 0, .75);\n\ -}\n\ -/* Spoiler text */\n\ -:root.reveal-spoilers $site$spoiler,\n\ -:root.reveal-spoilers $site$spoiler > a {\n\ - color: white !important;\n\ -}\n\ -:root.reveal-spoilers .removed-spoiler::before {\n\ - content: \"[spoiler]\";\n\ -}\n\ -:root.reveal-spoilers .removed-spoiler::after {\n\ - content: \"[/spoiler]\";\n\ -}\n\ -/* Thread & Reply Hiding */\n\ -.hide-thread-button,\n\ -.hide-reply-button {\n\ - float: left;\n\ - margin-right: 4px;\n\ - padding: 2px;\n\ -}\n\ -$site$infoRoot a.hide-reply-button {\n\ - margin-right: 6px;\n\ - padding: 0;\n\ -}\n\ -.replacedSideArrows {\n\ - float: left;\n\ -}\n\ -.hide-thread-button:not(:hover),\n\ -.hide-reply-button:not(:hover) {\n\ - opacity: 0.4;\n\ -}\n\ -.threadContainer .hide-reply-button {\n\ - margin-left: 2px !important;\n\ - position: relative;\n\ - left: 1px;\n\ -}\n\ -.hide-thread-button {\n\ - margin-top: -1px;\n\ - width: 11px;\n\ -}\n\ -.stub ~ :not(.threadDivider) {\n\ - display: none !important;\n\ -}\n\ -.stub input {\n\ - display: inline-block;\n\ -}\n\ -$site$thread[hidden] + hr {\n\ - display: none;\n\ -}\n\ -:root.reply-hide $site$sideArrows {\n\ - display: none;\n\ -}\n\ -:root.sw-yotsuba.thread-hide .party-hat {\n\ - left: 19px;\n\ -}\n\ -/* Anonymize */\n\ -:root.anonymize $site$info$name,\n\ -:root.sw-yotsuba.anonymize .post-author:not([class*=capcode]) {\n\ - font-size: 0;\n\ -}\n\ -:root.anonymize $site$info$tripcode,\n\ -:root.sw-yotsuba.anonymize .n-pu {\n\ - display: none;\n\ -}\n\ -:root.anonymize $site$info$name::before,\n\ -:root.sw-yotsuba.anonymize .post-author:not([class*=capcode])::before {\n\ - content: \"Anonymous\";\n\ - font-size: 10pt;\n\ -}\n\ -:root.sw-yotsuba.anonymize .flashListing .name::before,\n\ -:root.sw-yotsuba.anonymize .post-last > .post-author:not([class*=capcode])::before {\n\ - font-size: 9pt;\n\ -}\n\ -/* QR */\n\ -:root.hide-original-post-form #togglePostFormLink,\n\ -#qr.autohide:not(.focus):not(:hover):not(:active) > form,\n\ -:root.thread-view #qr:not(.show-new-thread-option) select[data-name=\"thread\"],\n\ -#file-n-submit:not(.has-file) #qr-filerm {\n\ - display: none;\n\ -}\n\ -:root.hide-original-post-form #postForm {\n\ - display: none !important;\n\ -}\n\ -#qr select,\n\ -#qr-filename-container > a,\n\ -.remove,\n\ -.captcha-img {\n\ - cursor: pointer;\n\ -}\n\ -#qr {\n\ - position: fixed;\n\ - padding: 1px;\n\ - border: 1px solid transparent;\n\ - min-width: 300px;\n\ - border-radius: 3px 3px 0 0;\n\ -}\n\ -#qr > form {\n\ - /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */\n\ - max-height: 85vh;\n\ - max-height: calc(100vh - 75px);\n\ - overflow-y: auto;\n\ - overflow-x: hidden;\n\ -}\n\ -#qrtab {\n\ - border-radius: 3px 3px 0 0;\n\ -}\n\ -#qrtab {\n\ - margin-bottom: 1px;\n\ -}\n\ -#qr .close {\n\ - float: right;\n\ - padding: 0 3px;\n\ -}\n\ -.qr-link-container {\n\ - text-align: center;\n\ - margin: 16px 0;\n\ -}\n\ -.qr-link-container-bottom {\n\ - width: 200px;\n\ - position: absolute;\n\ - left: -100px;\n\ - margin-left: 50%;\n\ - text-align: center;\n\ -}\n\ -.qr-link {\n\ - border-radius: 3px;\n\ - padding: 6px 10px 5px;\n\ - font-weight: bold;\n\ - vertical-align: middle;\n\ - border-style: solid;\n\ - border-width: 1px;\n\ - font-size: 10pt;\n\ -}\n\ -.qr-link-container + #togglePostFormLink {\n\ - font-size: 10pt;\n\ - font-weight: normal;\n\ - margin: -8px 0 3.5px;\n\ -}\n\ -.persona {\n\ - width: 100%;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-flex-direction: row;\n\ - flex-direction: row;\n\ -}\n\ -.persona .field {\n\ - -webkit-flex: 1;\n\ - flex: 1;\n\ - width: 0;\n\ -}\n\ -#qr.forced-anon input[data-name=\"name\"]:not(.force-show),\n\ -#qr.forced-anon input[data-name=\"sub\"]:not(.force-show),\n\ -#qr.reply-to-thread input[data-name=\"sub\"]:not(.force-show),\n\ -body:not(.board_f) #qr select[name=\"filetag\"],\n\ -#qr.reply-to-thread select[name=\"filetag\"],\n\ -#qr:not(.has-sjis) #sjis-toggle,\n\ -#qr:not(.has-math) #tex-preview-button,\n\ -#qr.tex-preview .textarea > :not(#tex-preview),\n\ -#qr:not(.tex-preview) #tex-preview {\n\ - display: none;\n\ -}\n\ -.persona button {\n\ - -webkit-flex: 0 0 23px;\n\ - flex: 0 0 23px;\n\ - -webkit-align-self: stretch;\n\ - align-self: stretch;\n\ - border: 1px solid #BBB;\n\ - padding: 0;\n\ - background: linear-gradient(to bottom, #F8F8F8, #DCDCDC) no-repeat;\n\ - color: #000;\n\ -}\n\ -#qr.sjis-preview #sjis-toggle, #qr.tex-preview #tex-preview-button {\n\ - background: #DCDCDC;\n\ -}\n\ -#sjis-toggle, #qr.sjis-preview textarea.field {\n\ - font-family: \"IPAMonaPGothic\",\"Mona\",\"MS PGothic\",monospace;\n\ - font-size: 16px;\n\ - line-height: 17px;\n\ -}\n\ -#tex-preview-button {\n\ - font-size: 10px;\n\ -}\n\ -#tex-preview {\n\ - white-space: pre-line;\n\ -}\n\ -#qr textarea.field {\n\ - height: 14.8em;\n\ - min-height: 9em;\n\ -}\n\ -#qr.has-captcha textarea.field {\n\ - height: 9em;\n\ -}\n\ -input.field.tripped:not(:hover):not(:focus) {\n\ - color: transparent !important;\n\ - text-shadow: none !important;\n\ -}\n\ -#qr textarea {\n\ - min-width: 300px;\n\ - resize: both;\n\ -}\n\ -.field {\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ - margin: 0px;\n\ - padding: 2px 4px 3px;\n\ -}\n\ -#qr label input[type=\"checkbox\"] {\n\ - position: relative;\n\ - top: 2px;\n\ -}\n\ -/* Recaptcha v2 */\n\ -#qr .captcha-root {\n\ - position: relative;\n\ -}\n\ -#qr .captcha-container > div {\n\ - margin: auto;\n\ - width: 304px;\n\ -}\n\ -/* XXX scrollable with scroll bar hidden; prevents scroll on space press */\n\ -:root.ua-blink #qr .captcha-container > div,\n\ -:root.ua-edge #qr .captcha-container > div {\n\ - overflow: hidden;\n\ -}\n\ -:root.ua-blink #qr .captcha-container > div > div:first-of-type,\n\ -:root.ua-edge #qr .captcha-container > div > div:first-of-type {\n\ - overflow-y: scroll;\n\ - overflow-x: hidden;\n\ - padding-right: 30px;\n\ - height: 99%;\n\ - width: 100%;\n\ -}\n\ -#qr .captcha-counter {\n\ - display: block;\n\ - width: 100%;\n\ - text-align: center;\n\ - pointer-events: none;\n\ -}\n\ -#qr.captcha-open .captcha-counter {\n\ - position: absolute;\n\ - bottom: 3px;\n\ -}\n\ -#qr .captcha-counter > a {\n\ - pointer-events: auto;\n\ - display: inline-block; /* XXX https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8851747/ */\n\ -}\n\ -#qr:not(.captcha-open) .captcha-counter > a {\n\ - display: block;\n\ - width: 100%;\n\ -}\n\ -#qr.captcha-v2 #qr-captcha-iframe {\n\ - width: 302px;\n\ - height: 423px;\n\ - border: 0;\n\ - display: block;\n\ - margin: auto;\n\ -}\n\ -.goog-bubble-content {\n\ - max-width: 100vw;\n\ - max-height: 100vh;\n\ - overflow: auto;\n\ -}\n\ -.goog-bubble-content iframe {\n\ - position: static !important;\n\ -}\n\ -/* File Input, Submit Button, Oekaki */\n\ -#file-n-submit, #qr .oekaki {\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: stretch;\n\ - align-items: stretch;\n\ - height: 25px;\n\ - margin-top: 1px;\n\ -}\n\ -#file-n-submit > input, #qr-draw-button {\n\ - background: linear-gradient(to bottom, #F8F8F8, #DCDCDC) no-repeat;\n\ - border: 1px solid #BBB;\n\ - border-radius: 2px;\n\ - height: 100%;\n\ -}\n\ -#qr-file-button, #qr-draw-button {\n\ - width: 15%;\n\ -}\n\ -#file-n-submit input[type=\"submit\"] {\n\ - width: 25%;\n\ -}\n\ -#qr-filename-container {\n\ - -webkit-flex: 1 1 auto;\n\ - flex: 1 1 auto;\n\ - width: 0;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: center;\n\ - align-items: center;\n\ - position: relative;\n\ - padding: 1px;\n\ -}\n\ -input#qr-filename {\n\ - border: none !important;\n\ - background: none !important;\n\ - outline: none;\n\ -}\n\ -#qr-filename,\n\ -.has-file #qr-no-file {\n\ - display: none;\n\ -}\n\ -#qr-no-file,\n\ -.has-file #qr-filename {\n\ - -webkit-flex: 1 1 auto;\n\ - flex: 1 1 auto;\n\ - width: 0px; /* XXX Fixes filename not shrinking to allow space for buttons in Edge */\n\ - display: inline-block;\n\ - padding: 0;\n\ - padding-left: 3px;\n\ - overflow: hidden;\n\ - text-overflow: ellipsis;\n\ - white-space: nowrap;\n\ -}\n\ -#qr-no-file {\n\ - color: #AAA;\n\ -}\n\ -#qr .oekaki.has-file {\n\ - display: none;\n\ -}\n\ -#qr .oekaki > label {\n\ - -webkit-flex: 1 1 auto;\n\ - flex: 1 1 auto;\n\ - width: 0;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: center;\n\ - align-items: center;\n\ - height: 100%;\n\ -}\n\ -#qr .oekaki > label > span {\n\ - margin: 0 3px;\n\ -}\n\ -#qr .oekaki > label > input {\n\ - -webkit-flex: 1 1 auto;\n\ - flex: 1 1 auto;\n\ - width: 0;\n\ - height: 100%;\n\ -}\n\ -#qr .oekaki-bg {\n\ - position: relative;\n\ - display: inline-block;\n\ - height: 100%;\n\ - width: 10%;\n\ - margin-left: 3px;\n\ -}\n\ -#qr .oekaki-bg > * {\n\ - position: absolute;\n\ - top: 0;\n\ - left: 0;\n\ - margin: 0;\n\ -}\n\ -#qr .oekaki-bg > :not([name=\"oekaki-bgcolor\"]) {\n\ - z-index: 1;\n\ -}\n\ -#qr [name=\"oekaki-bgcolor\"] {\n\ - height: 100%;\n\ - width: 100%;\n\ - border: none;\n\ - padding: 0;\n\ -}\n\ -#qr [name=\"oekaki-bg\"]:not(:checked) ~ [name=\"oekaki-bgcolor\"] {\n\ - visibility: hidden;\n\ -}\n\ -#qr input[type=\"file\"] {\n\ - visibility: hidden;\n\ - position: absolute;\n\ -}\n\ -/* Spoiler Checkbox, QR Icons */\n\ -#qr-filename-container > label, #qr-filename-container > a {\n\ - -webkit-flex: none;\n\ - flex: none;\n\ - margin: 0;\n\ - margin-right: 3px;\n\ -}\n\ -#qr:not(.has-spoiler) #qr-spoiler-label,\n\ -#file-n-submit:not(.has-file) #qr-spoiler-label,\n\ -.has-file #paste-area,\n\ -.has-file #url-button,\n\ -#file-n-submit:not(.custom-cooldown) #custom-cooldown-button {\n\ - display: none;\n\ -}\n\ -#qr-filename-container > label {\n\ - position: relative;\n\ -}\n\ -#qr-filename-container input[type=\"checkbox\"] {\n\ - margin: 0;\n\ -}\n\ -.checkbox-letter {\n\ - font-size: 13px;\n\ - font-weight: bold;\n\ -}\n\ -#qr-filename-container label:not(:hover) > input[type=\"checkbox\"]:not(:focus):not(:checked),\n\ -#qr-filename-container label:not(:hover) > input[type=\"checkbox\"]:not(:focus):not(:checked) ~ :not(.checkbox-letter),\n\ -#qr-filename-container label:hover > .checkbox-letter,\n\ -input[type=\"checkbox\"]:focus ~ .checkbox-letter,\n\ -input[type=\"checkbox\"]:checked ~ .checkbox-letter {\n\ - /* not displayed but still focusable */\n\ - position: absolute;\n\ - opacity: 0;\n\ - pointer-events: none;\n\ -}\n\ -.checkbox-letter, #paste-area, #url-button, #custom-cooldown-button, #dump-button {\n\ - opacity: 0.6;\n\ -}\n\ -#paste-area {\n\ - font-size: 0;\n\ -}\n\ -#paste-area:focus {\n\ - opacity: 1;\n\ -}\n\ -#custom-cooldown-button.disabled {\n\ - opacity: 0.27;\n\ -}\n\ -/* Thread and Flash Tag Select */\n\ -#qr select {\n\ - background: white;\n\ - border: 1px solid #CCC;\n\ -}\n\ -#qr select[data-name=\"thread\"] {\n\ - float: right;\n\ -}\n\ -#qr > form > select {\n\ - margin-top: 1px;\n\ -}\n\ -/* Dumping UI */\n\ -.dump #dump-list-container {\n\ - display: block;\n\ -}\n\ -#dump-list-container {\n\ - display: none;\n\ - position: relative;\n\ - overflow-y: hidden;\n\ - margin-top: 1px;\n\ -}\n\ -#dump-list {\n\ - overflow-x: auto;\n\ - overflow-y: auto;\n\ - white-space: nowrap;\n\ - width: 248px;\n\ - max-height: 248px;\n\ - min-height: 90px;\n\ - max-width: 100%;\n\ - min-width: 100%;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-flex-wrap: wrap;\n\ - flex-wrap: wrap;\n\ -}\n\ -#dump-list:hover {\n\ - overflow-x: auto;\n\ -}\n\ -.qr-preview {\n\ - -moz-box-sizing: border-box;\n\ - box-sizing: border-box;\n\ - counter-increment: thumbnails;\n\ - cursor: move;\n\ - display: inline-block;\n\ - height: 90px;\n\ - width: 90px;\n\ - padding: 2px;\n\ - opacity: .5;\n\ - overflow: hidden;\n\ - position: relative;\n\ - text-shadow: 0 0 2px #000;\n\ - -webkit-transition: opacity .25s ease-in-out, -webkit-transform .25s ease-in-out;\n\ - transition: opacity .25s ease-in-out, transform .25s ease-in-out, -webkit-transform .25s ease-in-out;\n\ - vertical-align: top;\n\ - background-size: cover;\n\ - -webkit-flex: none;\n\ - flex: none;\n\ -}\n\ -.qr-preview:hover,\n\ -.qr-preview:focus {\n\ - opacity: .9;\n\ -}\n\ -.qr-preview::before {\n\ - content: counter(thumbnails);\n\ - color: #fff;\n\ - position: absolute;\n\ - top: 3px;\n\ - right: 3px;\n\ - text-shadow: 0 0 3px #000, 0 0 8px #000;\n\ -}\n\ -.qr-preview#selected {\n\ - opacity: 1;\n\ -}\n\ -.qr-preview.drag {\n\ - box-shadow: 0 0 10px rgba(0,0,0,.5);\n\ - -webkit-transform: scale(.8);\n\ - transform: scale(.8);\n\ -}\n\ -.qr-preview.over {\n\ - border-color: #fff;\n\ - -webkit-transform: scale(1.1);\n\ - transform: scale(1.1);\n\ - opacity: 0.9;\n\ - z-index: 10;\n\ -}\n\ -.qr-preview > span {\n\ - color: #fff;\n\ -}\n\ -.remove {\n\ - background: none;\n\ - color: #e00;\n\ - padding: 1px;\n\ -}\n\ -a:only-of-type > .remove {\n\ - display: none;\n\ -}\n\ -.remove:hover::after {\n\ - content: \" Remove\";\n\ -}\n\ -.qr-preview:not(.has-file) label,\n\ -#qr:not(.has-spoiler) .qr-preview-spoiler {\n\ - display: none;\n\ -}\n\ -.qr-preview > label {\n\ - background: rgba(0,0,0,.5);\n\ - color: #fff;\n\ - right: 0;\n\ - bottom: 0;\n\ - left: 0;\n\ - position: absolute;\n\ - text-align: center;\n\ -}\n\ -.qr-preview > label > input {\n\ - margin: 0;\n\ -}\n\ -#add-post {\n\ - cursor: pointer;\n\ - font-size: 2em;\n\ - position: absolute;\n\ - bottom: 20px;\n\ - right: 10px;\n\ - -webkit-transform: translateY(-50%);\n\ - transform: translateY(-50%);\n\ -}\n\ -.textarea {\n\ - position: relative;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ -}\n\ -#char-count {\n\ - color: #000;\n\ - background: hsla(0, 0%, 100%, .5);\n\ - font-size: 8pt;\n\ - position: absolute;\n\ - bottom: 1px;\n\ - right: 1px;\n\ - pointer-events: none;\n\ -}\n\ -#char-count.warning {\n\ - color: red;\n\ -}\n\ -/* Menu */\n\ -.menu-button:not(.fa-bars) {\n\ - display: inline-block;\n\ - position: relative;\n\ - cursor: pointer;\n\ -}\n\ -#header-bar .menu-button i {\n\ - border-top: 6px solid;\n\ - border-right: 4px solid transparent;\n\ - border-left: 4px solid transparent;\n\ - display: inline-block;\n\ - margin: 2px;\n\ - vertical-align: middle;\n\ -}\n\ -.postInfo > .menu-button,\n\ -#thread-watcher .menu-button {\n\ - width: 18px;\n\ - height: 15px;\n\ - text-align: center;\n\ -}\n\ -#menu {\n\ - position: fixed;\n\ - outline: none;\n\ - font-weight: normal;\n\ -}\n\ -#menu, .submenu {\n\ - border-radius: 3px;\n\ - padding-top: 1px;\n\ - padding-bottom: 3px;\n\ -}\n\ -.entry {\n\ - cursor: pointer;\n\ - display: block;\n\ - outline: none;\n\ - padding: 2px 10px;\n\ - position: relative;\n\ - text-decoration: none;\n\ - white-space: nowrap;\n\ - min-width: 70px;\n\ - text-align: left;\n\ - text-shadow: none;\n\ - font-size: 10pt;\n\ -}\n\ -.left>.entry.has-submenu {\n\ - padding-right: 17px !important;\n\ -}\n\ -.entry input[type=\"checkbox\"],\n\ -.entry input[type=\"radio\"] {\n\ - margin: 0px;\n\ - position: relative;\n\ - top: 2px;\n\ -}\n\ -.entry input[type=\"number\"] {\n\ - width: 4.5em;\n\ -}\n\ -.entry.has-shortcut-text {\n\ - display: flex;\n\ - justify-content: space-between;\n\ - align-items: center;\n\ -}\n\ -.entry .shortcut-text {\n\ - opacity: 0.5;\n\ - font-size: 70%;\n\ - margin-left: 5px;\n\ -}\n\ -.has-submenu::after {\n\ - content: \"\";\n\ - border-left: .5em solid;\n\ - border-top: .3em solid transparent;\n\ - border-bottom: .3em solid transparent;\n\ - display: inline-block;\n\ - margin: .3em;\n\ - position: absolute;\n\ - right: 3px;\n\ -}\n\ -.left .has-submenu::after {\n\ - border-left: 0;\n\ - border-right: .5em solid;\n\ -}\n\ -.submenu {\n\ - display: none;\n\ - position: absolute;\n\ - left: 100%;\n\ - top: -1px;\n\ - margin-left: 0px;\n\ - margin-top: -2px;\n\ -}\n\ -.focused > .submenu {\n\ - display: block;\n\ -}\n\ -.imp-exp-result {\n\ - position: absolute;\n\ - text-align: center;\n\ - margin: auto;\n\ - right: 0px;\n\ - left: 0px;\n\ - width: 200px;\n\ -}\n\ -/* Custom Board Titles */\n\ -.boardTitle, .boardSubtitle {\n\ - white-space: pre-line;\n\ -}\n\ -.boardTitle[contenteditable=\"true\"],\n\ -.boardSubtitle[contenteditable=\"true\"] {\n\ - cursor: text !important;\n\ -}\n\ -/* Embedding */\n\ -.embedder:not(.embedded) > span {\n\ - display: none;\n\ -}\n\ -#embedding {\n\ - padding: 1px 4px 1px 4px;\n\ - position: fixed;\n\ -}\n\ -#embedding.empty {\n\ - display: none;\n\ -}\n\ -#embedding > div:first-child {\n\ - display: -webkit-flex;\n\ - display: flex;\n\ -}\n\ -#embedding .move {\n\ - -webkit-flex: 1;\n\ - flex: 1;\n\ -}\n\ -#embedding .jump {\n\ - margin: -1px 4px;\n\ - text-decoration: none;\n\ -}\n\ -/* Gallery */\n\ -#a-gallery {\n\ - position: fixed;\n\ - top: 0;\n\ - bottom: 0;\n\ - left: 0;\n\ - right: 0;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-flex-direction: row;\n\ - flex-direction: row;\n\ - background: rgba(0,0,0,0.7);\n\ -}\n\ -.gal-viewport {\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: stretch;\n\ - align-items: stretch;\n\ - -webkit-flex-direction: row;\n\ - flex-direction: row;\n\ - -webkit-flex: 1 1 auto;\n\ - flex: 1 1 auto;\n\ - overflow: hidden;\n\ -}\n\ -.gal-thumbnails {\n\ - -webkit-flex: 0 0 150px;\n\ - flex: 0 0 150px;\n\ - overflow-y: auto;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-flex-direction: column;\n\ - flex-direction: column;\n\ - -webkit-align-items: stretch;\n\ - align-items: stretch;\n\ - text-align: center;\n\ - background: rgba(0,0,0,.5);\n\ - border-left: 1px solid #222;\n\ -}\n\ -.gal-hide-thumbnails .gal-thumbnails {\n\ - display: none;\n\ -}\n\ -.gal-thumb img,\n\ -.gal-thumb video {\n\ - max-width: 125px;\n\ - max-height: 125px;\n\ - height: auto;\n\ - width: auto;\n\ -}\n\ -.gal-thumb {\n\ - -webkit-flex: 0 0 auto;\n\ - flex: 0 0 auto;\n\ - padding: 3px;\n\ - line-height: 0;\n\ - transition: background .2s linear;\n\ -}\n\ -.gal-highlight {\n\ - background: rgba(0, 190, 255,.8);\n\ -}\n\ -.gal-prev {\n\ - border-right: 1px solid #222;\n\ -}\n\ -.gal-next {\n\ - border-left: 1px solid #222;\n\ -}\n\ -.gal-prev,\n\ -.gal-next {\n\ - -webkit-flex: 0 0 20px;\n\ - flex: 0 0 20px;\n\ - position: relative;\n\ - cursor: pointer;\n\ - opacity: 0.7;\n\ - background-color: rgba(0, 0, 0, 0.3);\n\ -}\n\ -.gal-prev:hover,\n\ -.gal-next:hover {\n\ - opacity: 1;\n\ -}\n\ -.gal-prev::after,\n\ -.gal-next::after {\n\ - position: absolute;\n\ - top: 48.6%;\n\ - -webkit-transform: translateY(-50%);\n\ - transform: translateY(-50%);\n\ - display: inline-block;\n\ - border-top: 11px solid transparent;\n\ - border-bottom: 11px solid transparent;\n\ - content: \"\";\n\ -}\n\ -.gal-prev::after {\n\ - border-right: 12px solid #fff;\n\ - right: 5px;\n\ -}\n\ -.gal-next::after {\n\ - border-left: 12px solid #fff;\n\ - right: 3px;\n\ -}\n\ -.gal-image {\n\ - -webkit-flex: 1 0 auto;\n\ - flex: 1 0 auto;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: flex-start;\n\ - align-items: flex-start;\n\ - -webkit-justify-content: space-around;\n\ - justify-content: space-around;\n\ - overflow: hidden;\n\ - /* Flex > Non-Flex child max-width and overflow fix (Firefox only?) */\n\ - width: 1%;\n\ -}\n\ -:root:not(.gal-fit-height):not(.gal-pdf) .gal-image {\n\ - overflow-y: scroll !important;\n\ -}\n\ -:root:not(.gal-fit-width):not(.gal-pdf) .gal-image {\n\ - overflow-x: scroll !important;\n\ -}\n\ -.gal-image a {\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-align-items: flex-start;\n\ - align-items: flex-start;\n\ - margin: auto;\n\ - line-height: 0;\n\ - max-width: 100%;\n\ -}\n\ -:root.gal-pdf .gal-image a {\n\ - width: 100%;\n\ - height: 100%;\n\ -}\n\ -.gal-image img,\n\ -.gal-image video {\n\ - -webkit-flex: none;\n\ - flex: none;\n\ -}\n\ -.gal-fit-width .gal-image img,\n\ -.gal-fit-width .gal-image video {\n\ - max-width: 100%;\n\ -}\n\ -.gal-fit-height .gal-image img,\n\ -.gal-fit-height .gal-image video {\n\ - /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */\n\ - max-height: 95vh;\n\ - max-height: calc(100vh - 25px);\n\ -}\n\ -.gal-image iframe {\n\ - width: 100%;\n\ - height: 100%;\n\ -}\n\ -.gal-buttons {\n\ - font-size: 2em;\n\ - margin-right: 3px;\n\ - padding-left: 7px;\n\ - padding-right: 7px;\n\ - top: 5px;\n\ -}\n\ -:root.gal-pdf .gal-buttons {\n\ - top: 40px;\n\ - background: rgba(0,0,0,0.6) !important;\n\ - border-radius: 3px;\n\ -}\n\ -.gal-buttons a {\n\ - color: #ffffff;\n\ - text-shadow: 0px 0px 1px #000000;\n\ -}\n\ -.gal-buttons i {\n\ - display: inline-block;\n\ - margin: 2px;\n\ - position: relative;\n\ -}\n\ -.gal-start i {\n\ - border-left: 10px solid;\n\ - border-top: 6px solid transparent;\n\ - border-bottom: 6px solid transparent;\n\ - bottom: 1px;\n\ -}\n\ -.gal-stop i {\n\ - border: 5px solid;\n\ - bottom: 2px;\n\ -}\n\ -.gal-buttons.gal-playing > .gal-start,\n\ -.gal-buttons:not(.gal-playing) > .gal-stop {\n\ - display: none;\n\ -}\n\ -.gal-buttons .menu-button i {\n\ - border-top: 10px solid;\n\ - border-right: 6px solid transparent;\n\ - border-left: 6px solid transparent;\n\ - bottom: 2px;\n\ - vertical-align: baseline;\n\ -}\n\ -.gal-labels {\n\ - position: fixed;\n\ - bottom: 6px;\n\ - display: -webkit-flex;\n\ - display: flex;\n\ - -webkit-flex-direction: column;\n\ - flex-direction: column;\n\ - -webkit-align-items: flex-end;\n\ - align-items: flex-end;\n\ -}\n\ -:root:not(.show-sauce) .gal-sauce {\n\ - display: none;\n\ -}\n\ -.gal-name,\n\ -.gal-count,\n\ -.gal-sauce {\n\ - background: rgba(0,0,0,0.6) !important;\n\ - border-radius: 3px;\n\ - padding: 1px 5px 2px 5px;\n\ - margin-top: 3px;\n\ - color: #ffffff !important;\n\ - text-decoration: none !important;\n\ -}\n\ -.gal-sauce a {\n\ - color: #ffffff !important;\n\ -}\n\ -.gal-name:hover,\n\ -.gal-buttons a:hover,\n\ -.gal-sauce a:hover {\n\ - color: rgb(95, 95, 101) !important;\n\ -}\n\ -:root.gal-pdf .gal-buttons a:hover {\n\ - color: rgb(204, 204, 204) !important;\n\ -}\n\ -.gal-buttons,\n\ -.gal-labels {\n\ - position: fixed;\n\ - right: 195px;\n\ -}\n\ -.gal-hide-thumbnails .gal-buttons,\n\ -.gal-hide-thumbnails .gal-labels {\n\ - right: 44px;\n\ -}\n\ -:root:not(.gal-fit-width):not(.gal-pdf) .gal-labels {\n\ - bottom: 23px !important;\n\ -}\n\ -:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-buttons,\n\ -:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-labels {\n\ - right: 178px !important;\n\ -}\n\ -:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-buttons,\n\ -:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-labels {\n\ - right: 28px !important;\n\ -}\n\ -:root.gallery-open.fixed #header-bar:not(.autohide),\n\ -:root.gallery-open.fixed #header-bar:not(.autohide) #shortcuts .fa::before {\n\ - visibility: hidden;\n\ -}\n\ -/* Mod Contact Links */\n\ -.contact-links {\n\ - margin-left: 2px;\n\ -}\n\ -.move-note > a {\n\ - text-decoration: underline;\n\ -}\n\ -.invisible {\n\ - font-size: 0;\n\ -}\n\ -/* PostJumper */\n\ -.postJumper > .prev,\n\ -.postJumper > .next {\n\ - font-size: 120%;\n\ -}\n\ -/* PSA */\n\ -.fcx-announcement {\n\ - text-align: center;\n\ -}\n\ -.fcx-announcement a {\n\ - text-decoration: underline;\n\ -}\n\ -/* General */\n\ -:root.yotsuba .dialog {\n\ - background-color: #F0E0D6;\n\ - border-color: #D9BFB7;\n\ -}\n\ -:root.yotsuba .field:focus,\n\ -:root.yotsuba .field.focus {\n\ - border-color: #EA8;\n\ -}\n\ -/* 4chan style fixes */\n\ -:root.yotsuba.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(221, 0, 0, .8) !important;\n\ -}\n\ -:root.yotsuba.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(221, 0, 0, .8) !important;\n\ -}\n\ -/* Header */\n\ -:root.yotsuba #header-bar.dialog {\n\ - background-color: rgba(240,224,214,0.98);\n\ -}\n\ -:root.yotsuba:not(.fixed) #header-bar, :root.yotsuba #notifications {\n\ - font-size: 9pt;\n\ -}\n\ -:root.yotsuba #header-bar, :root.yotsuba #notifications {\n\ - color: #B86;\n\ -}\n\ -:root.yotsuba #board-list a, :root.yotsuba #shortcuts a {\n\ - color: #800000;\n\ -}\n\ -/* Settings */\n\ -:root.yotsuba #fourchanx-settings fieldset, :root.yotsuba .section-main div::before {\n\ - border-color: #D9BFB7;\n\ -}\n\ -:root.yotsuba .suboption-list > div:last-of-type {\n\ - background-color: #F0E0D6;\n\ -}\n\ -/* Catalog */\n\ -:root.yotsuba.catalog-hover-expand .catalog-container:hover > .post {\n\ - background-color: #F0E0D6;\n\ -}\n\ -:root.yotsuba.werkTyme .catalog-thread:not(:hover),\n\ -:root.yotsuba.werkTyme:not(.catalog-hover-expand) .catalog-thread,\n\ -:root.yotsuba.catalog-hover-expand .catalog-container:hover > .post,\n\ -:root.yotsuba.catalog-hover-expand .catalog-container:hover .catalog-reply {\n\ - border-color: #D9BFB7;\n\ -}\n\ -/* Quote */\n\ -:root.yotsuba .backlink.deadlink {\n\ - color: #00E !important;\n\ -}\n\ -:root.yotsuba .inline {\n\ - border-color: #D9BFB7;\n\ - background-color: rgba(255, 255, 255, .14);\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.yotsuba .indicator {\n\ - color: #F0E0D6;\n\ -}\n\ -/* QR */\n\ -.yotsuba #dump-list::-webkit-scrollbar-thumb {\n\ - background-color: #F0E0D6;\n\ - border-color: #D9BFB7;\n\ -}\n\ -:root.yotsuba .qr-preview {\n\ - background-color: rgba(0, 0, 0, .15);\n\ -}\n\ -:root.yotsuba .qr-link {\n\ - border-color: rgb(225, 209, 199) rgb(225, 209, 199) rgb(210, 194, 184);\n\ - background: linear-gradient(#FFEFE5, #F0E0D6) repeat scroll 0% 0% transparent;\n\ -}\n\ -:root.yotsuba .qr-link:hover {\n\ - background: #F0E0D6;\n\ -}\n\ -/* Menu */\n\ -:root.yotsuba #menu {\n\ - color: #800000;\n\ -}\n\ -:root.yotsuba .entry {\n\ - font-size: 10pt;\n\ -}\n\ -:root.yotsuba .focused.entry {\n\ - background: rgba(255, 255, 255, .33);\n\ -}\n\ -/* Unread */\n\ -:root.yotsuba .unread-mark-read {\n\ - background-color: rgba(240,224,214,0.5);\n\ -}\n\ -/* Thread Watcher */\n\ -:root.yotsuba .replies-quoting-you > a, :root.yotsuba #watcher-link.replies-quoting-you, :root.yotsuba .last-page > a > .watcher-page {\n\ - color: #F00;\n\ -}\n\ -/* Watcher Favicon */\n\ -:root.yotsuba .watch-thread-link\n\ -{\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -/* General */\n\ -:root.yotsuba-b .dialog {\n\ - background-color: #D6DAF0;\n\ - border-color: #B7C5D9;\n\ -}\n\ -:root.yotsuba-b .field:focus,\n\ -:root.yotsuba-b .field.focus {\n\ - border-color: #98E;\n\ -}\n\ -/* 4chan style fixes */\n\ -:root.yotsuba-b.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(221, 0, 0, .8) !important;\n\ -}\n\ -:root.yotsuba-b.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(221, 0, 0, .8) !important;\n\ -}\n\ -/* Header */\n\ -:root.yotsuba-b #header-bar.dialog {\n\ - background-color: rgba(214,218,240,0.98);\n\ -}\n\ -:root.yotsuba-b:not(.fixed) #header-bar, :root.yotsuba-b #notifications {\n\ - font-size: 9pt;\n\ -}\n\ -:root.yotsuba-b #header-bar, :root.yotsuba-b #notifications {\n\ - color: #89A;\n\ -}\n\ -:root.yotsuba-b #board-list a, :root.yotsuba-b #shortcuts a {\n\ - color: #34345C;\n\ -}\n\ -/* Settings */\n\ -:root.yotsuba-b #fourchanx-settings fieldset, :root.yotsuba-b .section-main div::before {\n\ - border-color: #B7C5D9;\n\ -}\n\ -:root.yotsuba-b .suboption-list > div:last-of-type {\n\ - background-color: #D6DAF0;\n\ -}\n\ -/* Catalog */\n\ -:root.yotsuba-b.catalog-hover-expand .catalog-container:hover > .post {\n\ - background-color: #D6DAF0;\n\ -}\n\ -:root.yotsuba-b.werkTyme .catalog-thread:not(:hover),\n\ -:root.yotsuba-b.werkTyme:not(.catalog-hover-expand) .catalog-thread,\n\ -:root.yotsuba-b.catalog-hover-expand .catalog-container:hover > .post,\n\ -:root.yotsuba-b.catalog-hover-expand .catalog-container:hover .catalog-reply {\n\ - border-color: #B7C5D9;\n\ -}\n\ -/* Quote */\n\ -:root.yotsuba-b .backlink.deadlink {\n\ - color: #34345C !important;\n\ -}\n\ -:root.yotsuba-b .inline {\n\ - border-color: #B7C5D9;\n\ - background-color: rgba(255, 255, 255, .14);\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.yotsuba-b .indicator {\n\ - color: #D6DAF0;\n\ -}\n\ -/* QR */\n\ -.yotsuba-b #dump-list::-webkit-scrollbar-thumb {\n\ - background-color: #D6DAF0;\n\ - border-color: #B7C5D9;\n\ -}\n\ -:root.yotsuba-b .qr-preview {\n\ - background-color: rgba(0, 0, 0, .15);\n\ -}\n\ -:root.yotsuba-b .qr-link {\n\ - border-color: rgb(199, 203, 225) rgb(199, 203, 225) rgb(184, 188, 210);\n\ - background: linear-gradient(#E5E9FF, #D6DAF0) repeat scroll 0% 0% transparent;\n\ -}\n\ -:root.yotsuba-b .qr-link:hover {\n\ - background: #D9DDF3;\n\ -}\n\ -/* Menu */\n\ -:root.yotsuba-b #menu {\n\ - color: #000;\n\ -}\n\ -:root.yotsuba-b .entry {\n\ - font-size: 10pt;\n\ -}\n\ -:root.yotsuba-b .focused.entry {\n\ - background: rgba(255, 255, 255, .33);\n\ -}\n\ -/* Unread */\n\ -:root.yotsuba-b .unread-mark-read {\n\ - background-color: rgba(214,218,240,0.5);\n\ -}\n\ -/* Thread Watcher */\n\ -:root.yotsuba-b .replies-quoting-you > a, :root.yotsuba-b #watcher-link.replies-quoting-you {\n\ - color: #F00;\n\ -}\n\ -/* Watcher Favicon */\n\ -:root.yotsuba-b .watch-thread-link\n\ -{\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -/* General */\n\ -:root.futaba .dialog {\n\ - background-color: #F0E0D6;\n\ - border-color: #D9BFB7;\n\ -}\n\ -:root.futaba .field:focus,\n\ -:root.futaba .field.focus {\n\ - border-color: #EA8;\n\ -}\n\ -/* Header */\n\ -:root.futaba #header-bar.dialog {\n\ - background-color: rgba(240,224,214,0.98);\n\ -}\n\ -:root.futaba:not(.fixed) #header-bar, :root.futaba #notifications {\n\ - font-size: 11pt;\n\ -}\n\ -:root.futaba #header-bar, :root.futaba #notifications {\n\ - color: #B86;\n\ -}\n\ -:root.futaba #header-bar a, :root.futaba #notifications a {\n\ - color: #800000;\n\ -}\n\ -/* Settings */\n\ -:root.futaba #fourchanx-settings fieldset, :root.futaba .section-main div::before {\n\ - border-color: #D9BFB7;\n\ -}\n\ -:root.futaba .suboption-list > div:last-of-type {\n\ - background-color: #F0E0D6;\n\ -}\n\ -/* Catalog */\n\ -:root.futaba.catalog-hover-expand .catalog-container:hover > .post {\n\ - background-color: #F0E0D6;\n\ -}\n\ -:root.futaba.werkTyme .catalog-thread:not(:hover),\n\ -:root.futaba.werkTyme:not(.catalog-hover-expand) .catalog-thread,\n\ -:root.futaba.catalog-hover-expand .catalog-container:hover > .post,\n\ -:root.futaba.catalog-hover-expand .catalog-container:hover .catalog-reply {\n\ - border-color: #D9BFB7;\n\ -}\n\ -/* Quote */\n\ -:root.futaba .backlink.deadlink {\n\ - color: #00E !important;\n\ -}\n\ -:root.futaba .inline {\n\ - border-color: #D9BFB7;\n\ - background-color: rgba(255, 255, 255, .14);\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.futaba .indicator {\n\ - color: #F0E0D6;\n\ -}\n\ -/* Anonymize */\n\ -:root.futaba.anonymize $site$info$name::before {\n\ - font-size: 12pt;\n\ -}\n\ -/* QR */\n\ -.futaba #dump-list::-webkit-scrollbar-thumb {\n\ - background-color: #F0E0D6;\n\ - border-color: #D9BFB7;\n\ -}\n\ -:root.futaba .qr-preview {\n\ - background-color: rgba(0, 0, 0, .15);\n\ -}\n\ -:root.futaba .qr-link {\n\ - border-color: rgb(225, 209, 199) rgb(225, 209, 199) rgb(210, 194, 184);\n\ - background: linear-gradient(#FFEFE5, #F0E0D6) repeat scroll 0% 0% transparent;\n\ -}\n\ -:root.futaba .qr-link:hover {\n\ - background: #F0E0D6;\n\ -}\n\ -/* Menu */\n\ -:root.futaba #menu {\n\ - color: #800000;\n\ -}\n\ -:root.futaba .entry {\n\ - font-size: 12pt;\n\ -}\n\ -:root.futaba .focused.entry {\n\ - background: rgba(255, 255, 255, .33);\n\ -}\n\ -/* Unread */\n\ -:root.futaba .unread-mark-read {\n\ - background-color: rgba(240,224,214,0.5);\n\ -}\n\ -/* Thread Watcher */\n\ -:root.futaba .replies-quoting-you > a, :root.futaba #watcher-link.replies-quoting-you, :root.futaba .last-page > a > .watcher-page {\n\ - color: #F00;\n\ -}\n\ -/* Watcher Favicon */\n\ -:root.futaba .watch-thread-link\n\ -{\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -/* General */\n\ -:root.burichan .dialog {\n\ - background-color: #D6DAF0;\n\ - border-color: #B7C5D9;\n\ -}\n\ -:root.burichan .field:focus,\n\ -:root.burichan .field.focus {\n\ - border-color: #98E;\n\ -}\n\ -/* Header */\n\ -:root.burichan #header-bar.dialog {\n\ - background-color: rgba(214,218,240,0.98);\n\ -}\n\ -:root.burichan:not(.fixed) #header-bar, :root.burichan #header-bar #notifications {\n\ - font-size: 11pt;\n\ -}\n\ -:root.burichan #header-bar, :root.burichan #header-bar #notifications {\n\ - color: #89A;\n\ -}\n\ -:root.burichan #header-bar a, :root.burichan #header-bar #notifications a {\n\ - color: #34345C;\n\ -}\n\ -/* Settings */\n\ -:root.burichan #fourchanx-settings fieldset, :root.burichan .section-main div::before {\n\ - border-color: #B7C5D9;\n\ -}\n\ -:root.burichan .suboption-list > div:last-of-type {\n\ - background-color: #D6DAF0;\n\ -}\n\ -/* Catalog */\n\ -:root.burichan.catalog-hover-expand .catalog-container:hover > .post {\n\ - background-color: #D6DAF0;\n\ -}\n\ -:root.burichan.werkTyme .catalog-thread:not(:hover),\n\ -:root.burichan.werkTyme:not(.catalog-hover-expand) .catalog-thread,\n\ -:root.burichan.catalog-hover-expand .catalog-container:hover > .post,\n\ -:root.burichan.catalog-hover-expand .catalog-container:hover .catalog-reply {\n\ - border-color: #B7C5D9;\n\ -}\n\ -/* Quote */\n\ -:root.burichan .backlink.deadlink {\n\ - color: #34345C !important;\n\ -}\n\ -:root.burichan .inline {\n\ - border-color: #B7C5D9;\n\ - background-color: rgba(255, 255, 255, .14);\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.burichan .indicator {\n\ - color: #D6DAF0;\n\ -}\n\ -/* Anonymize */\n\ -:root.burichan.anonymize $site$info$name::before {\n\ - font-size: 12pt;\n\ -}\n\ -/* QR */\n\ -.burichan #dump-list::-webkit-scrollbar-thumb {\n\ - background-color: #D6DAF0;\n\ - border-color: #B7C5D9;\n\ -}\n\ -:root.burichan .qr-preview {\n\ - background-color: rgba(0, 0, 0, .15);\n\ -}\n\ -:root.burichan .qr-link {\n\ - border-color: rgb(199, 203, 225) rgb(199, 203, 225) rgb(184, 188, 210);\n\ - background: linear-gradient(#E5E9FF, #D6DAF0) repeat scroll 0% 0% transparent;\n\ -}\n\ -:root.burichan .qr-link:hover {\n\ - background: #D9DDF3;\n\ -}\n\ -/* Menu */\n\ -:root.burichan #menu {\n\ - color: #000000;\n\ -}\n\ -:root.burichan .entry {\n\ - font-size: 12pt;\n\ -}\n\ -:root.burichan .focused.entry {\n\ - background: rgba(255, 255, 255, .33);\n\ -}\n\ -/* Unread */\n\ -:root.burichan .unread-mark-read {\n\ - background-color: rgba(214,218,240,0.5);\n\ -}\n\ -/* Thread Watcher */\n\ -:root.burichan .replies-quoting-you > a, :root.burichan #watcher-link.replies-quoting-you, :root.burichan .last-page > a > .watcher-page {\n\ - color: #F00;\n\ -}\n\ -/* Watcher Favicon */\n\ -:root.burichan .watch-thread-link\n\ -{\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -/* General */\n\ -:root.tomorrow .dialog {\n\ - background-color: #282A2E;\n\ - border-color: #111;\n\ -}\n\ -/* 4chan style fixes */\n\ -:root.tomorrow #arc-list span.quote {\n\ - color: #B5BD68;\n\ -}\n\ -:root.tomorrow.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(145, 182, 214, .8) !important;\n\ -}\n\ -:root.tomorrow.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(145, 182, 214, .8) !important;\n\ -}\n\ -/* Header */\n\ -:root.tomorrow #header-bar.dialog {\n\ - background-color: rgba(40,42,46,0.9);\n\ -}\n\ -:root.tomorrow:not(.fixed) #header-bar, :root.tomorrow #notifications {\n\ - font-size: 9pt;\n\ -}\n\ -:root.tomorrow #header-bar, :root.tomorrow #notifications {\n\ - color: #C5C8C6;\n\ -}\n\ -:root.tomorrow #header-bar a, :root.tomorrow #notifications a {\n\ - color: #81A2BE;\n\ -}\n\ -:root.tomorrow.shortcut-icons .native-settings {\n\ - background-image: url('//s.4cdn.org/image/favicon-ws.ico');\n\ -}\n\ -/* Settings */\n\ -:root.tomorrow #fourchanx-settings fieldset, :root.tomorrow .section-main div::before {\n\ - border-color: #111;\n\ -}\n\ -:root.tomorrow .suboption-list > div:last-of-type {\n\ - background-color: #282A2E;\n\ -}\n\ -/* Catalog */\n\ -:root.tomorrow.catalog-hover-expand .catalog-container:hover > .post {\n\ - background-color: #282A2E;\n\ -}\n\ -:root.tomorrow.werkTyme .catalog-thread:not(:hover),\n\ -:root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread,\n\ -:root.tomorrow.catalog-hover-expand .catalog-container:hover > .post,\n\ -:root.tomorrow.catalog-hover-expand .catalog-container:hover .catalog-reply {\n\ - border-color: #111;\n\ -}\n\ -/* Quote */\n\ -:root.tomorrow .backlink.deadlink {\n\ - color: #81A2BE !important;\n\ -}\n\ -:root.tomorrow .inline {\n\ - border-color: #111;\n\ - background-color: rgba(0, 0, 0, .14);\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.tomorrow .indicator {\n\ - color: #282A2E;\n\ -}\n\ -/* Highlighting */\n\ -:root.tomorrow .qphl {\n\ - outline: 2px solid rgba(145, 182, 214, .8);\n\ -}\n\ -:root.tomorrow.highlight-you .quotesYou$site$highlightable$op,\n\ -:root.tomorrow.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(145, 182, 214, .8);\n\ -}\n\ -:root.tomorrow.highlight-own .yourPost$site$highlightable$op,\n\ -:root.tomorrow.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(145, 182, 214, .8);\n\ -}\n\ -:root.tomorrow .filter-highlight$site$highlightable$op,\n\ -:root.tomorrow .filter-highlight$site$highlightable$reply {\n\ - box-shadow: inset 5px 0 rgba(145, 182, 214, .5);\n\ -}\n\ -:root.tomorrow.highlight-own .yourPost > $site$sideArrows,\n\ -:root.tomorrow.highlight-you .quotesYou > $site$sideArrows,\n\ -:root.tomorrow .filter-highlight > $site$sideArrows {\n\ - color: rgb(155, 185, 210);\n\ -}\n\ -:root.tomorrow .catalog-thread.filter-highlight .catalog-thumb,\n\ -:root.tomorrow.werkTyme .catalog-thread.filter-highlight:not(:hover),\n\ -:root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread.filter-highlight,\n\ -:root.tomorrow.werkTyme.catalog-hover-expand .catalog-thread.filter-highlight > .catalog-container:hover > .catalog-post {\n\ - box-shadow: 0 0 3px 3px rgba(64, 192, 255, .7);\n\ -}\n\ -:root.tomorrow .catalog-thread.watched .catalog-thumb,\n\ -:root.tomorrow.werkTyme .catalog-thread.watched:not(:hover),\n\ -:root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched,\n\ -:root.tomorrow.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post {\n\ - border: 2px solid rgb(64, 192, 255);\n\ -}\n\ -/* QR */\n\ -.tomorrow #dump-list::-webkit-scrollbar-thumb {\n\ - background-color: #282A2E;\n\ - border-color: #111;\n\ -}\n\ -:root.tomorrow .qr-preview {\n\ - background-color: rgba(255, 255, 255, .15);\n\ -}\n\ -:root.tomorrow #qr .field {\n\ - background-color: rgb(26, 27, 29);\n\ - color: rgb(197,200,198);\n\ - border-color: rgb(40, 41, 42);\n\ -}\n\ -:root.tomorrow #qr .field:focus,\n\ -:root.tomorrow #qr .field.focus {\n\ - border-color: rgb(129, 162, 190) !important;\n\ - background-color: rgb(30,32,36);\n\ -}\n\ -:root.tomorrow .persona button {\n\ - background: linear-gradient(to bottom, #2E3035, #222427) no-repeat;\n\ - color: rgb(197,200,198);\n\ - border-color: rgb(40, 41, 42);\n\ - outline: none;\n\ -}\n\ -:root.tomorrow .persona button::-moz-focus-inner {\n\ - border: none;\n\ -}\n\ -:root.tomorrow .persona button:focus {\n\ - border-color: rgb(129, 162, 190);\n\ -}\n\ -:root.tomorrow #qr.sjis-preview #sjis-toggle,\n\ -:root.tomorrow #qr.tex-preview #tex-preview-button {\n\ - background: rgb(26, 27, 29);\n\ -}\n\ -:root.tomorrow #qr select,\n\ -:root.tomorrow #file-n-submit > input,\n\ -:root.tomorrow #qr-draw-button {\n\ - border-color: rgb(40, 41, 42);\n\ -}\n\ -:root.tomorrow #qr-filename {\n\ - color: rgb(197,200,198);\n\ -}\n\ -:root.tomorrow .qr-link {\n\ - border-color: rgb(25, 27, 31) rgb(25, 27, 31) rgb(10, 12, 16);\n\ - background: linear-gradient(#37393D, #282A2E) repeat scroll 0% 0% transparent;\n\ -}\n\ -:root.tomorrow .qr-link:hover {\n\ - background: #282A2E;\n\ -}\n\ -/* Menu */\n\ -:root.tomorrow #menu {\n\ - color: #C5C8C6;\n\ -}\n\ -:root.tomorrow .entry {\n\ - font-size: 10pt;\n\ -}\n\ -:root.tomorrow .focused.entry {\n\ - background: rgba(0, 0, 0, .33);\n\ -}\n\ -/* Unread */\n\ -:root.tomorrow .unread-line {\n\ - border-color: rgb(197, 200, 198);\n\ -}\n\ -:root.tomorrow .unread-mark-read {\n\ - background-color: rgba(40,42,46,0.5);\n\ -}\n\ -/* Thread Watcher */\n\ -:root.tomorrow .replies-quoting-you > a, :root.tomorrow #watcher-link.replies-quoting-you, :root.tomorrow .last-page > a > .watcher-page {\n\ - color: #F00 !important;\n\ -}\n\ -/* Watcher Favicon */\n\ -:root.tomorrow .watch-thread-link\n\ -{\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -/* General */\n\ -:root.photon .dialog {\n\ - background-color: #DDD;\n\ - border-color: #CCC;\n\ -}\n\ -:root.photon .field:focus,\n\ -:root.photon .field.focus {\n\ - border-color: #EA8;\n\ -}\n\ -/* 4chan style fixes */\n\ -:root.photon #arc-list tr:nth-of-type(odd) span.quote {\n\ - color: #C0E17A;\n\ -}\n\ -:root.photon.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(221, 0, 0, .8) !important;\n\ -}\n\ -:root.photon.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(221, 0, 0, .8) !important;\n\ -}\n\ -/* Header */\n\ -:root.photon #header-bar.dialog {\n\ - background-color: rgba(221,221,221,0.98);\n\ -}\n\ -:root.photon:not(.fixed) #header-bar, :root.photon #notifications {\n\ - font-size: 9pt;\n\ -}\n\ -:root.photon #header-bar, :root.photon #notifications {\n\ - color: #333;\n\ -}\n\ -:root.photon #header-bar a, :root.photon #notifications a {\n\ - color: #FF6600;\n\ -}\n\ -/* Settings */\n\ -:root.photon #fourchanx-settings fieldset, :root.photon .section-main div::before {\n\ - border-color: #CCC;\n\ -}\n\ -:root.photon .suboption-list > div:last-of-type {\n\ - background-color: #DDD;\n\ -}\n\ -/* Catalog */\n\ -:root.photon.catalog-hover-expand .catalog-container:hover > .post {\n\ - background-color: #DDD;\n\ -}\n\ -:root.photon.werkTyme .catalog-thread:not(:hover),\n\ -:root.photon.werkTyme:not(.catalog-hover-expand) .catalog-thread,\n\ -:root.photon.catalog-hover-expand .catalog-container:hover > .post,\n\ -:root.photon.catalog-hover-expand .catalog-container:hover .catalog-reply {\n\ - border-color: #CCC;\n\ -}\n\ -/* Quote */\n\ -:root.photon .backlink.deadlink {\n\ - color: #F60 !important;\n\ -}\n\ -:root.photon .inline {\n\ - border-color: #CCC;\n\ - background-color: rgba(255, 255, 255, .14);\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.photon .indicator {\n\ - color: #DDD;\n\ -}\n\ -/* QR */\n\ -.photon #dump-list::-webkit-scrollbar-thumb {\n\ - background-color: #DDD;\n\ - border-color: #CCC;\n\ -}\n\ -:root.photon .qr-preview {\n\ - background-color: rgba(0, 0, 0, .15);\n\ -}\n\ -:root.photon .qr-link {\n\ - border-color: rgb(206, 206, 206) rgb(206, 206, 206) rgb(191, 191, 191);\n\ - background: linear-gradient(#ECECEC, #DDD) repeat scroll 0% 0% transparent;\n\ -}\n\ -:root.photon .qr-link:hover {\n\ - background: #DDDDDD;\n\ -}\n\ -/* Menu */\n\ -:root.photon #menu {\n\ - color: #333;\n\ -}\n\ -:root.photon .entry {\n\ - font-size: 10pt;\n\ -}\n\ -:root.photon .focused.entry {\n\ - background: rgba(255, 255, 255, .33);\n\ -}\n\ -/* Unread */\n\ -:root.photon .unread-mark-read {\n\ - background-color: rgba(221,221,221,0.5);\n\ -}\n\ -/* Thread Watcher */\n\ -:root.photon .replies-quoting-you > a, :root.photon #watcher-link.replies-quoting-you, :root.photon .last-page > a > .watcher-page {\n\ - color: #00F !important;\n\ -}\n\ -/* Watcher Favicon */\n\ -:root.photon .watch-thread-link\n\ -{\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -/* General */\n\ -:root.spooky .dialog {\n\ - background-color: #171526;\n\ - border-color: #707070;\n\ -}\n\ -:root.spooky .field:focus,\n\ -:root.spooky .field.focus {\n\ - border-color: #98E;\n\ -}\n\ -/* 4chan style fixes */\n\ -:root.spooky #arc-list span.quote {\n\ - color: #634C2C;\n\ -}\n\ -:root.spooky.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(145, 182, 214, .8) !important;\n\ -}\n\ -:root.spooky.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(145, 182, 214, .8) !important;\n\ -}\n\ -/* Header */\n\ -:root.spooky #header-bar.dialog {\n\ - background-color: rgba(23,21,38,0.98);\n\ -}\n\ -:root.spooky:not(.fixed) #header-bar, :root.spooky #notifications {\n\ - font-size: 9pt;\n\ -}\n\ -:root.spooky #header-bar, :root.spooky #notifications {\n\ - color: #C49756;\n\ -}\n\ -:root.spooky #board-list a, :root.spooky #shortcuts a {\n\ - color: #FE9600;\n\ -}\n\ -:root.spooky.shortcut-icons .native-settings {\n\ - background-image: url('//s.4cdn.org/image/favicon-ws.ico');\n\ -}\n\ -/* Settings */\n\ -:root.spooky #fourchanx-settings fieldset, :root.spooky .section-main div::before {\n\ - border-color: #707070;\n\ -}\n\ -:root.spooky .suboption-list > div:last-of-type {\n\ - background-color: #171526;\n\ -}\n\ -/* Catalog */\n\ -:root.spooky.catalog-hover-expand .catalog-container:hover > .post {\n\ - background-color: #171526;\n\ -}\n\ -:root.spooky.werkTyme .catalog-thread:not(:hover),\n\ -:root.spooky.werkTyme:not(.catalog-hover-expand) .catalog-thread,\n\ -:root.spooky.catalog-hover-expand .catalog-container:hover > .post,\n\ -:root.spooky.catalog-hover-expand .catalog-container:hover .catalog-reply {\n\ - border-color: #707070;\n\ -}\n\ -/* Quote */\n\ -:root.spooky .backlink.deadlink {\n\ - color: #FE9600 !important;\n\ -}\n\ -:root.spooky .inline {\n\ - border-color: #707070;\n\ - background-color: rgba(255, 255, 255, .14);\n\ -}\n\ -/* Fappe and Werk Tyme */\n\ -:root.spooky .indicator {\n\ - color: #171526;\n\ -}\n\ -/* Highlighting */\n\ -:root.spooky .qphl {\n\ - outline: 2px solid rgba(145, 182, 214, .8);\n\ -}\n\ -:root.spooky.highlight-you .quotesYou$site$highlightable$op,\n\ -:root.spooky.highlight-you .quotesYou$site$highlightable$reply {\n\ - border-left: 3px solid rgba(145, 182, 214, .8);\n\ -}\n\ -:root.spooky.highlight-own .yourPost$site$highlightable$op,\n\ -:root.spooky.highlight-own .yourPost$site$highlightable$reply {\n\ - border-left: 3px dashed rgba(145, 182, 214, .8);\n\ -}\n\ -:root.spooky .filter-highlight$site$highlightable$op,\n\ -:root.spooky .filter-highlight$site$highlightable$reply {\n\ - box-shadow: inset 5px 0 rgba(145, 182, 214, .5);\n\ -}\n\ -:root.spooky.highlight-own .yourPost > $site$sideArrows,\n\ -:root.spooky.highlight-you .quotesYou > $site$sideArrows,\n\ -:root.spooky .filter-highlight > $site$sideArrows {\n\ - color: rgb(155, 185, 210);\n\ -}\n\ -/* QR */\n\ -.spooky #dump-list::-webkit-scrollbar-thumb {\n\ - background-color: #171526;\n\ - border-color: #707070;\n\ -}\n\ -:root.spooky .qr-preview {\n\ - background-color: rgba(0, 0, 0, .15);\n\ -}\n\ -:root.spooky #qr .field {\n\ - background-color: rgb(26, 27, 29);\n\ - color: rgb(197,200,198);\n\ - border-color: rgb(40, 41, 42);\n\ -}\n\ -:root.spooky #qr .field:focus,\n\ -:root.spooky #qr .field.focus {\n\ - border-color: rgb(254, 150, 0) !important;\n\ - background-color: rgb(30,32,36);\n\ -}\n\ -:root.spooky .persona button {\n\ - background: linear-gradient(to bottom, #2E3035, #222427) no-repeat;\n\ - color: rgb(197,200,198);\n\ - border-color: rgb(40, 41, 42);\n\ - outline: none;\n\ -}\n\ -:root.spooky .persona button::-moz-focus-inner {\n\ - border: none;\n\ -}\n\ -:root.spooky .persona button:focus {\n\ - border-color: rgb(254, 150, 0);\n\ -}\n\ -:root.spooky #qr.sjis-preview #sjis-toggle,\n\ -:root.spooky #qr.tex-preview #tex-preview-button {\n\ - background: rgb(26, 27, 29);\n\ -}\n\ -:root.spooky #qr select,\n\ -:root.spooky #file-n-submit > input,\n\ -:root.spooky #qr-draw-button {\n\ - border-color: rgb(40, 41, 42);\n\ -}\n\ -:root.spooky #qr-filename {\n\ - color: rgb(197,200,198);\n\ -}\n\ -:root.spooky .qr-link {\n\ - border-color: rgb(8, 6, 23) rgb(8, 6, 23) rgb(0, 0, 8);\n\ - background: linear-gradient(#262435, #171526) repeat scroll 0% 0% transparent;\n\ -}\n\ -:root.spooky .qr-link:hover {\n\ - background: #1A1829;\n\ -}\n\ -/* Menu */\n\ -:root.spooky #menu {\n\ - color: #FE9600;\n\ -}\n\ -:root.spooky .entry {\n\ - font-size: 10pt;\n\ -}\n\ -:root.spooky .focused.entry {\n\ - background: rgba(255, 255, 255, .33);\n\ -}\n\ -/* Unread */\n\ -:root.spooky .unread-line {\n\ - border-color: rgb(197, 200, 198);\n\ - visibility: visible;\n\ - opacity: 1;\n\ -}\n\ -:root.spooky .unread-mark-read {\n\ - background-color: rgba(23,21,38,0.5);\n\ -}\n\ -/* Thread Watcher */\n\ -:root.spooky .replies-quoting-you > a, :root.spooky #watcher-link.replies-quoting-you, :root.spooky .last-page > a > .watcher-page {\n\ - color: #F00 !important;\n\ -}\n\ -/* Watcher Favicon */\n\ -:root.spooky .watch-thread-link\n\ -{\n\ - background-image: url(\"data:image/svg+xml,\");\n\ -}\n\ -/* Link Title Favicons */\n\ -.linkify.audio::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAitJREFUOE9jYCAWKJWwavr0KyXWb/FIbDtUFFyzJx6nVofE2Xo5nXsj0rqPNSR0nVkR2Hjmgmfd+U9Otdf+m5Vf/6+SfeU/R9ChVVgNYDRtlfJuuPA/rPfe/4QpD/6nznj0P27Kw/9unff/69Xf+69c/+C/SO7N/0z+OAxgMmmRCe++/r9i3ev/KWvf/vdY8PK/bt/9/wrNV3/IN5y/IVt1YqNg4pGTTP4HsbuA2bhZ2qvpyn+xjIObxAp3VwqlrgngLFyryVy5nhPmZJHANS2cwYexG8BmVC/pWn3hP4NZlzWuQDJI3dIiFnUUuwEsQAOcq87jNcC7fHeLUtJxHF4AGmBWeAavAWH1+1rUUk7giAWjOknllON4DXAs2NEiG4/DBQxAF/CFHfrPYI4jDFSLuJVjNrUJhB/B7gIGo1pJRt99GAZYJK7wLJ1z7Xzl4vu/7aqv/GRBj0bjqAX2qb0nJ7mXH17C4HcUxQA+hymWtSue/C5a9up/9Ozn/7Vr7v1nRY7GqMb91T3b3v6vWvPmf/S0p/9ZQk+DDLCBRSOz06Jqk+o7/21nvfqvsebDf7kZL/5zBaxphkezd+OFn7HzXvz3Wvjmv9a8N//5Ek//ZTBpVYUrMG2X5wjcdl68+uI/wa5Lr3hSNjczGFeywOVZ/bbcVGp//F9izfv/Ql03f3P4LC/HSEQquYwMFnUCDJ7dzBhyjGZNQpye89M5gpfnMvtNUyE2h4PUAQBovvT7lyNljwAAAABJRU5ErkJggg==') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.bitchute::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAadQTFRFAAAAwzw8xDs7cY6O0iws0ysrtF9f0Sws1CwsyzU1zTIy1igoyzQ01icnY7i4t0hI0S4u0ysr1Soq1ikp1ikp1Soq0ysr0S4uu0VFzjEx1Csr1ygo2Ccn2Ccn1ygo1CoqzjExzjAw1Skp2Ccn2Ccn1ikp0TAwxzY21Soq1SoqyzQ00iws1ygo1ygo0yws1Soq1Skp1igo1igo1igo1igo1igo1igo1Coq1Soq0C0t1ygo1ygo0S4unV5e1Csr1ygo1ygo1CsruUdHxzg41Skp1ygo1CsryTU10C4u1igo1ycn1ygo0i0txjo60S0t1ikp1ygo1ikp1Cws1Coq1Coq0yws0S0tyzQ00iws1Soq0ysr0i0txDs72Ccn2CUl2CYm2CQk3EFB2S8v2zw82jY24FZW3D0931FR3EBA3UND8LS04FVV7qys4V9f4WBg+erq766u9t7e7qqq2Ckp54KC9+Pj6pSU+Ojo5XNz9NHR6YqK8bu765ub5G5u9M3N6ImJ88vL5XV165eX3UVF6pWV3UhI2Soq2jU12Coq2jQ02Cgo2Sws////FaxLuAAAAF10Uk5TAAAAAAAAAAAAAAAAAAAAASJnoLy9oWolAhBz1vr72XgTGKf8/a4cCpuiDVvz9mS6xOvy9vzg6aGsPOToRAFv9fh2Awm07XgIMd765UEDOsfemVhhY00nBommbCkEI8horgAAAL5JREFUKBUFwbFKA0EUQNF7387sMq4EmzRpLSSdIBYKFv6Af2prnSYkRT4gWFgkCBJQ0EIFdcZzBCeqqh4qdk7VW2ChPusw02sAYKU7z7wEAAA2piQKFbrWSHazc1J0XWs5pdxPDykcVX+7Y9UxUsSo+s7PibqPFBRV/C5qi4i/UkrJrc7L47Bt4ZWnUaMCAE9GSrtKBQD2fR+bnAEAeOn7dUTOwApe35bDsPz0zsniQlV98IN0tJ3f6P0XAMA/kxou7OXCdnoAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.clyp::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAwUExURTSY22ey5E2l4KbS75rM7Y3F64C/6f///8zl9nS45r/f9PL5/UGe3bPY8Vqr4v///wNjrzUAAAABYktHRA8YugDZAAAAB3RJTUUH4AINEi85AIH95AAAAE9JREFUCNdjYMAGGBWgDGYHCM2a3hkAZmi0dzSBaKaO9o5moCqmLiCjYzNQyw4QowIodQzI6E0AKcpo72gE6+Jyb1kAMehUA9RktgdYbQYAjGIVNGGXBJkAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.dailymotion::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURQBk3ff6/trp+kKO5wZt3xx54q7P9Ozz/IS17zOG5WKh653E8sbc9/GbbcoAAABZSURBVAjXY2BAASyhDhAGc9oECMOjyAAiESEEYrBYpLWBGcwHxcvBjDDxHelghpF0yDQwY3kVgweEUeEQDWbMEepqAjO8FMsLIeYsU8o+BrbCdWboTAe4AwALXxWGjW41FwAAAABJRU5ErkJggg==') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.gfycat::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAjVBMVEWn3gCo3gSr3w2t4BSu4Bav4Ri35C+45DK45DO55DXA50rA50vB50zC6E/D6FTF6VjG6VvL62vN7G/P7XbQ7XfW74vY8JDa8ZTe8qDe8qLf86Pi9Kzj9K7k9LHp9sDp98Lq98Ps+Mr0++L5/O75/fD6/fH6/fL6/fP7/fT7/fb8/ff8/vj8/vn+/v7///91X4cfAAAAcklEQVR42o3M2xKBUACF4aVQckrIuRJK6H//x2sme4/MuPDfre9i6c/Cc3U5Dj87BuAxsXvGu6JvIIXEHRWwNHCHQNrCzkAFkbSBg4EM8i+Yw7PXBa3zRfuxVyf/Bis7nKwGKAcWxgC8prI5Sc315OlnDfzpDar2S9/oAAAAAElFTkSuQmCC') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.gist::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABblBMVEXc3NykpKTW1tbb29ugoKCdnZ0AAAACAgIEDRcKCgoMDAwODg4QIzYRDAoTExMUDwwVAg0WICsaEw8aGhoiCBklGxUmERwwKCQ7LSU7Ozs8LSZFLyNINi1JNyxJNy1KSklMOi5VR1FXV1daQTRkZGRseYZwU0F4eHh7dnR8bWV/YE6IdGiKcGCKkJaNgYeNjY2RdGOScWCUcWCZmZmhoaGkpKSoqKirfmaurq6xsbG1tbW6urq+vr7AbmzBb23CwsLGxsbHx8fHyMjJycnJysrMzMzOiYbPi4fQ0NDRoYbT09PU1NTW1tbY2NjZqIzZ2dnb29vd3d3f39/i4uLktZrk5OTl5eXm5ubn5+fo6Ojq6urs7OzttKLu7u7wuqbw8PDx8fHz8/P4+Pj5+fn7uZj8vpz9ya79ybD/tZf/upr/wZ//w6H/xKH/xaL/xrH/yqj/y7T/zqv/z7D/07D/17n/2Lv/2Lz/3L//38n/4Mk3Q/ZuAAAABnRSTlMSFcbGzc5MNKFvAAAA1klEQVQoz2NgYPZHAswMDEwRSclwkBTBxOARn4gE4j0YXBOiJNUDg7y8Ar1UlOITXBkcY73Z2Li42dg42dn4wmIdGeyjQ7nZoEA4PNqewSZKlw0O9KJsGKwjBdl4ZeWkJGQUhNjEIq0ZrMI5+D0ri7Jz8itCRAXCrRgsQ3mUy+xicrPSbfO0REItGSyCVaVL3ONSU9LcCtQUgy0YzIJ85M1LizMzCsv9xF2CzBhMAwN99TV1DI0MtDWcAgNNGUycA5CAswkDi5kDwrMOZiwMjKzGSICVEQDhZj0UQV7PewAAAABJRU5ErkJggg==') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.image::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAs5JREFUOE+lk/tvi1EYx98/xT8gW4REIpGFMEQWl2FiM9ZMZhm2xRAyOsmujFFmdFRHu0tWm87UypxStr69zPauN5e5rHVp3IYhbOvHy+wHEQlxkm+ek+d8nm9OznkeSfrfldmgJC7QyUlTymsJTfuTZ25z4HdWYwyLreYhtpgekGPw0+kKvo1Eo+IXRSIiEhkWZuc9tqnsJD9EqTUopCxjSGTpB0iueczSo1HyW8cpsExQ1DbxI2pt45j9cXpexul4FEd79RnZphAa/SD7WvuFtO6UItbU9LC+YQxNI2w0wwYT5LRAdhOU3oBTIXC9gXP3oUSGgz2vST3gYHejR0jptT1C332f8yrUEYHrz8CgxDnpm6DKCUfc0KnmXa/AEVPPwnDcD0cvetA2uYRk67Ive/lpjO7YBO1PPuF8Df3vwf4cbNE4tqdw7YVq8HYyHx6FvhE1hkMEg8HDUqvFkjT4aIjMqkqyqkswDSrcfBfH+Q561YLAZ/B+BLda6FXlU/cPv0AoEPhuoP1h4Av7Wbh9E/Py15NWWUjeSR3nZDfeN+N0DY9hG/7K1eGP3P0S5/EYRFUF/IOTBrUXHPm9fT6mr1xEwupkZqxbzLyiDJYUZ5NSnkdqdSHpxyrYdFpPgdmAsdfJwPMI/Yr65bf7tZLGGBQ7DNdJWFtIYvoOZmbuZE7OXpIKKli86zAr9p9gTVktWTVnKTI2U95uRWe3U2IJUDbVB5p6hVm5x5m9Vc/cnedZUNzC8lILaQesZBy6hEZ3maKzgvJWFzVWD9XtXvVGQbSWASFtMATVRlJIKbOTWtlJXaeXepuPM1f6MNp9GLt8mLvvYLmp0OhQ2Fwvk6m7xaqDTvY0eYWUVtcnllXfYlGpnfklVuraHHg8HjxuN+6fktUHlWWZPaZeUo/ILK0UKttBcbNbSB9GP0yLxWJJUxoZGUn80zD9C/vXQ/4NHY10h3M1zmQAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.installgentoo::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABcVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB3dIYAAAAAAAAAAAAbGh4BBAcCBgoBBgoCBwsCCQ/QzucCCA7MyuXZ1eUBBQmTh8fo5/i9svIAAADh3vQAAAACCA0CCQ8CCQ4DDBQbGCUDChDr6vgAAAAAAAAREBIDCxK6tdfe2fTv7/cDCxIDDBQEDRUHDhgMJjXk4PZdXWdLUFoUNEYOKDgSMUMRLUBneI4eTGj08/QmW3onW3rTzvfOx/giU3IiVHMkWHdEaYJobHv3+PokWHpua6TNy9xZgZ+1quz8/foQKj0XPFInWn0nW38tZ4o6fqg8gq48grA9hrU/i7pAhrNAiLdBjLtEjr1FksNIjr5Il8pImMtKWnNqhL97odKFqti5q/q5rPq60+nCt/vLw/vPx/jV0vHY0/rc1/rg2/vh3fzn4fzu6/vx8vf19Pv19Pz49/v5+Pv8/Pv8/fr9/vv+/frziVtUAAAAT3RSTlMABQYHCAoNDhARGRobL0ZOV1xdXV5fYGBmZnB0eX2MjZSaoaGio6mqqqustLq7zubo6Ojo6evt7u/x8fLy9/f4+Pj5+vr6+vr6+/39/v7+XKgUSwAAAMhJREFUKM9jYGDg4OZmZgABKINT1dBAhBHIYFMxMBIDisjbhoZbCTExsCu5hoeY8DEwcOkEx8fY6MqpucTGB0izglVEplcU5/gmRYWBVQDNMK+s0hN3SvMyBpsBNJxXw0NfwTEjVQZqHQMHj5RfWW5mliSEC7TPzK6yJD/bXZQRzGdXcisqLy309okA2Q4Eis4peQWmstqBCdGW/CABraC45ERBBs3A6Fh/AbAKTwsHa34QZW8NVsGuLqwswQSjQICTmYMFQaEDAAF8JHLfKGswAAAAAElFTkSuQmCC') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.liveleak::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAlNJREFUGBkFwU2LVmUYAODrPu8Z5x1xSpRBXQyFoLsBE+wfiO5atJOgnf9DUPwFgtGinUgEaQsRhHYuMtpEiEWuG5iNjuOcj+c8z911xXcXL/68c3Dw1fzhg0QgEQAAEYGUKXFie9vxlSs/xk/rdavjGEkmkWSih65z4osv9GfOiK6LzEyZ2uGh4dUrmzs72ddlUUhkoiMr4PT167589Mh6c1N0nSRlqrX67dat+PDyZXRT19m5edPnt28rGFHxMcJ6d9fprS1/37tneP3aemPD1uamUydPOru3p5DdGOH0tWsu3LhhxIQJM2qEpRT/Pn3q/du3AhARSmvGTH0lplKMrVkiYpVpQaJlighzhDkzhmEA0fcWoqAfyaFW4zTlgCABxlrNmY4ylUzLsiREprFWc0T2M+ZSjKWY0AEaltZUjJixZJIpuk5pTWlNP2BYFvOyKJkCAKU1tTXHrZlqVWolUxdhxsfVSj9FmJfFMM9GdICGGa01HyMstYpMIFPJVNDPmYZSTOPoOEKHzNRlKpmWWh1j6TpLa2SKTKVWU6Z+Qolwdm/P9QcPZKa2LH69e9eIMs+WCL/cv2/98CGZPrt61am+V9APq1X89eyZ/968obVYaiXT4dGREgG+vnPHeHgYMsH2+fP+efEihtVKv7SWw/6+9/v7KYLMhIywTJPamvOXLomukyRsrNf+ePzYkpl9dJ3SWgSCSCQCfz5/7pMLF2yfO6eLiAQcHRz4/cmT+HR7O+Ob3d0fNt69+7a2BiICQCJbA0EgE5lpvbXl1OXL3/8Pfax4+6SjSukAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.pastebin::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAB1FBMVEUAAAAAAAAAAABWYWwAAABbY3BbYm5dZnFdZXJeZnMEBAQHCAhYYGpdZnFdZnBgaHIlJyomKCooKi09QkdESU5eZGtdYmhdYmleY2lrcXdqb3Rqb3Rqb3SSmJ+SlJeWmJutr7GtrrCWm6ChpKhbW1tmZmZvb290dHR3d3d4eHh5eXl6enp8fHx+gIJ/f3+CgoKDg4OEhISFhYWHh4eKioqKjI2Li4uMjIyOjo6Pj4+QkJCRkZGSkpKUlJSVl5mWlpaYmZqZm52ampqbm5ucnJydnZ2enp6fn5+hoaGioqKkpKSkpaalpaWmp6mmp6qnqauoqKioqquoqq2qqqqrrK2srKysra6srrCsrrGurq6vr6+wsLCxsbGysrKztLa0tLS1t7m2tra3t7e4uLi5ubm6urq7u7u8vLy9vb2+vr7AwMDAwsTBwcHExcfFxcXFxsnGxsbHx8fIyMjJycnMzMzNzc3Ozs7O0NLPz8/Q0NDR0dHR09XT09PV1dXV1dbV1tfV19rW1tbX19fX19jY2tzZ2dnZ2tva2tra3N3a3N7c3Nze3t7f39/f4OHg4ODi4uLl5+jm5ubs7Ozs7e3u7u7v7+/v8PDw8PDx8fHy8vLz8/P29vYSoLMZAAAAJHRSTlMABAUGCwsNHCAiLzMzMzZEYGJwgIuOnJycnqmqq9bc3+/w8fkZ0N/uAAAA/klEQVQoU2NgYGDl5YMDdgYGBmZZ3964CYFtIR3e9Q7K/AwMHI55KfaFmcHWMy3K3MwlGRg4wz0zdYpcorRbNbL0LaWAAp3ts2umV8wo6MupTauQBgqUG03VL7W3sfZSb1erAgm02M+yzYrVCXUy6zapAQlUx/dEdyX3J3ZHVUYVywAF8o2rDNN1Go2jzGLMokAC2QbuSc42mXmaOXop9iAtCXrJ5qXWjT59Abl2ESJAAX/tSIMMiyrrqQ3T6uS5gQK6kSqpqkUermGTexQFmYACflqR+hlWZSamzQpCLEDPsSmVVDT1TJw0JUhOAMRnYOARFRMTE5cQF+ZiBPIAII5B3EVG0b4AAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.peertube::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABIFBMVEUhHyAAAABzPBnxaA3CWBEnJSYbGRptbW16enpzc3PTayWhb04hHyAhHyAhHyAhHyAhHyAhHyAhHyAhHyAhHyAhHyAhHyAhHyAhHyAhHyApIh+0UhMfHiBWMhvsZg7zaQ0hHyAhHyAXHCHzaQ3xaA3xaA3xaA3xaA0hHyAhHyDxaA3xaA3xaA3xaA3xaA3xaA0oJickIiMdGxwUEhPxaA3xaA3xaA1sbGxwcHB3d3eFhYXxaA3xaA3xaA1zc3Nzc3Nzc3Nzc3Nzc3PxaA3xaA3xaA1zc3Nzc3NtdHjxaA3xaA1yc3STcFnvaA/yaAxzc3N4c2/FbDFzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3MhHyDxaA1zc3MAAAAfljyVAAAAXHRSTlMAAAAAAAAAAAAAAAAZkjMBHOLXYArj8p0u2VsJ1XaGL/OhKyXc1WEN2gwk2/SjKgEYiS4B/tYFGosqAdleAxzj12ML9Z8s850rJWbYeYMs1F8Koiri1V0MGZY0AYbIBFIAAAABYktHRAH/Ai3eAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4wYXFBUVX81QWQAAAKxJREFUGNNVz9UWgkAQANDBtdbu7lZsxe7ubpH//wxBPKDzNvdMAmi0Oj0QQgAYjCazBX7BStvsDqHoAzTtdLklf+Dx+vwICRAIhsKRaCyOvpAwJ6Up8pXOZHOIAFm+UCzJEQuvMhWrIFBUa/WGkodmq40Ad7q9/kDFwnA05lpYYCbT2ZykFvxQDhhmuVpvcvxaHra7vfp72KflcMSYEOB0vlyx+By+3R9PMSfe+P0enM1454kAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTktMDYtMjRUMDM6MjE6MjEtMDc6MDDse6MAAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE5LTA2LTI0VDAzOjIxOjIxLTA3OjAwnSYbvAAAAABJRU5ErkJggg==') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.soundcloud::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABsklEQVQ4y5WTy2pUQRCGv2rbzDjJeAlIBmOyipGIIJqFEBDElwh4yULGeRFXPoEIBl/AvQ/gC2RnxCAoxijiwks852S6+3dxzslcHJCpTXVX11/Xv0097gLPgVNMJxnQNfX4zsqleWbnpoMf/oa9d988MM9MC/rp+E0a+A0dsVobMNMCOO8B6McRoABJI+A6gJmN3D2A8jgEBCEkSEMBrcrsDAzDWWn3AjgKFaDMmgRqniGFgsaDp1jrLOngDf1XT1D+A1dFc4MKAkkiCVKjjVu7g9+4Rzx4i1u6hjXbuMWr0O5QPNvCu7IaCZwEKQukLGDrm5x8uI0tr6MkiGlkiv7yLfzN+6S5i6QsIMABkEfcxhbWWYMkVAOjxvYAjc3HNHrbKI9VBQBFwF25XQKSBjqIf1YBuAurEMrczgDygD6/x2LCpFLXLUyQ+PoldphhBhYfIX09XU1+Flaukz7uYqs3SHs7cG4BmTsmkBUF9mmXEwa28BNLPaQPLepuNcbGSWQquQC2/Kdcox1FUGkcB0ykck1nA2+wTzMs8stGnP4rbWGw74EuS/GFQWfK7/wF6P4F7fzIAYkdmdEAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.streamable::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABXFBMVEUPkPoNj/qExv0PkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoNj/oPkPoNj/oNj/qExv0PkPpruvwPkPornfoVk/opnPpnufwPkPqExv0Nj/oPkPoNj/oPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoPkPoOj/opnPsVk/oMjvoOkPoTkfo6pPsblfo3ovva7v7////v9/5Sr/whmPry+f5htvze8P7W7P5itvyl1v0imPu84P3o9P50v/zN6P73+/8lmvs8pfs+pfsKjvr9/v9EqfsNj/oom/v8/v9nufxAp/tJq/sQkPrb7v6t2f0IjPoclvr6/f9luPwUkvrp9f7h8f5ruvy/4f4kmftpuvwxoPum1v32+/8jmfpMrPvu9/7z+f9UsPs7pPv8/f/4/P9oufwalfpDqPsMj/ounvtVsPsnm/qzfQQ9AAAALXRSTlMAAAAggMzw0IYkBPb4iAamsgZ+jPwogpDO1vTYlPoulL4KivyUCiqO1PL01i67tUAWAAAAAWJLR0Q4oAel1gAAAAd0SU1FB+MGFxMuDXVcMbIAAADdSURBVBjTY2AAAmYWVjY2dg5OBgZGJiCXi4VbFwx4ePlAAlz8unAgIAgUENJFAsJMDMw8unp6+gaGRsYmpoa6IqIMYrp6ZuYWllbW5hY2toZ64gwSurp29g6OTs4urm7uHrqSDGy6nhZeet5WPr5+/gGBelJAgSCLYL+Q0LBw3YjIKKAAu250TGxcvE1CYlJySqquNAOHrl9aukVGZla2RU6uoZ4MA6esrl9evnWBYWFRMdBaOQYGXmSHyQNdyieA4CsogjzHpyQL4SqrqIJ9y8Cgpq6hqaWtogPyPgDmvSxRxBWM9AAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxOS0wNi0yNFQwMjo0NjoxMy0wNzowMCKUvXUAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTktMDYtMjRUMDI6NDY6MTMtMDc6MDBTyQXJAAAAAElFTkSuQmCC') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.twitchtv::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAYUExURf///2RBpWRBpWRBpWRBpWRBpWRBpf///+zQyUYAAAAGdFJOUwFdZX0lTzs4r5oAAAABYktHRAcWYYjrAAAAB3RJTUUH4AINEi42iSXRNAAAAD1JREFUCNdjYEiDAAZGGIMtjQEEUBlMCWoEGci6mGEMsxQgIy0BiB3AjLS0FAYQIw0kwABipoI1AhkBQBIAFCIXxiHgq80AAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.twitter::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAEsUExURf///1Cf21Gg3FGi31Gh3VKj4FGh3lKj4VKk4lKl41Ol5FOn51Sp6VSo6FOn5lCf21Gg3FGh3VGi31Gi31Gh3lGg3FGg3FGg3FGg3FGh3lGg3FGi31Kk4lKj4FGh3lGi31Kk4lGh3lGg3FGh3lOm5FOm5VGi31Kj4VSo6FGi31Gh3VGg3FKj4FOn51Gi31So6FWr7VOl5FGi31On51Sq6lKk4lOo51Sp6VOm5FSq61Ws7VOn51Oo51Sq61Ol5FOm5FSq61Wr7VOo51On51Sr7FWs7VSp6lGg3FGh3VOm5FWr7VSp6lKj4VOm5FSo6FSr7FWs7VWs7VWr7VSq6lOo51Om5FOo51So6FOm5VOl5FSq61Ws7VSr7FSp6lSp6VWs7lWr7VKk4lSq6v///6E3MNsAAABVdFJOUwAAAAAAAAAAAAAAAAAAAB0Ii+3xnBVTJhfsMKb+qTEp9GwBF/7lLAbo0m4pLkUTdvk2Ev3+EZnOBo/3Z8ffCRzH/D0OqPxiLnvx3UI8m9n1++GwXQZNS29BAAAAAWJLR0QAiAUdSAAAAAd0SU1FB+ACDRIwBwy67tEAAADKSURBVBjTY2BAB4xogIGRH8IQEBQSFhEVE2eQkJQC8ZmkQ8PCI2Rk5RjkIxUUlRgZlVWioqNjYlXVGNQ14iI1tbR14qLj4+MTdJkZ9PQNosJCE0OjgPz4KEMWBiPjhPiEmKQokIJ4E1MmBmazhHg4MGdlYmCzsLSC8ROsmRkZmFht4Eps7ViADmOzd4DyHZ2YmYACTOzOLmATXd04mIBOd/eQ9owFCXh5c7KB/MLi4+vnHxAYFBzCwcYEEmBi5uLm4eHl42RmAnsSAMZBLgZiFUQ5AAAAAElFTkSuQmCC') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.video::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAxgDGAP8nNqN7AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gMZBjQQLEEqGwAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAA5SURBVDjLY2AYaMDIwMDwn1JD/lPCZhpwL+B1wf///ykzgBhDiAoDfIYQZQAjIyP5BuDTPJqQqAQAvW0ZAMk8+EEAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.vidlii::before {\n\ - content: \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rJYhFwaR/uhCwP/x5tZzBWHy+n3OvA8u17jmpwgPrOz5jAF2+3FA7PdYG8fuPQaX5jAGAV/39MCmdy/e/RGz/vj5/f/rAXj4//z13n52i5qmmFQ1lqOQaTgIBAYKEAYAKGjtAgAAAKNJREFUGBkFwT0uRGEYBtD3ZJ77uT8iGrXCAixCr7OCyRA2oCKqiUYkOgoJwhqUbMAKLEChVYhk4pxswvcWfFGVEbYtuJutqir9Ibc0uh0+V+mf5gY69yN2PzKJiTjCg8qa3uLRAJpKM9AMoL1VOi9zJ4CQ9z0jwHX+RAwAURUxAMSB/L7u35wCGlKaHrDkPGVmwhlc6FN6l1iHKxupn+djAPgHrEwa+qrzy0oAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.vimeo::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAYFBMVEUAAAAIdZUKh6sLlLkLmr4LmsAMp88NrdYVW3MZj7Acstkrt9s1e5E7vN5EfI9JvdtKwuBijp5kpbl30eiDt8aG1uqRr7qTyNehxM+k4PCy3enB3OTg6Ovv9PXw+fz////L9U5WAAAAAXRSTlMAQObYZgAAAIFJREFUeNplz90OwiAMBWAQpAoyxclkP3je/y0H2AQXz0WT8100rRD6kNI9/cRroemQL3hXhoujZYj4OHoAmBvYGcBISwbWBvfXCrytnIDUQMkbsBpagMA7zhtQdyTFQAmIG7IkYniiZuh3XGsPqoOZkMOJOpAcLqUzNFGGu/57fwc1hgtp0mVSyQAAAABJRU5ErkJggg==') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.vine::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAHCUExURQAAAAC+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zAwyKFhYGSUY+MTkwpMTXNmFpibX+Di0rICWFldW9/A5tb2zu7ePtTrg0MeHePklPYzuDRw7uDF5RWvbwC32O0d7x8en55f4DHF6xv5/vHp6f/k6/vH+evuf1LAObptvSvrAAAAAElFTkSuQmCC') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.vocaroo::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAw9JREFUOE9jYMABuMwYmCyTJKUCGlSnFSy02TTzeOyCiQcDViX26qVz2TAyYtWmEMwuoZ3M7V40LcB79pHkc0svpvzY8jD//87nxf+3Pyn8v/ZO8v+VNyP/2mZJumI1QCWSI8232Hjumitlfw5+qPp/9l8TCt76JP//xkdx/wsXWCzjtWFkwTCkbWFe9plPk/+ga4Txz/xt/D/hkN//gMXif21a+NbyWjIwoRiy6GDT5rP/mlFsPfyp5n/NpOj/22+0gMUXXIz/H7hC/L/bFKFbPDZMrHAD5H35OPt2J9zacDv/f3V7xv9FhwrBGubsT/1//Pjx/1GJ/mD+/nfl/1v3Ovy3KRJNQbHdOlXCvOO03/+pm1P/v3v37n90hhtYw9HPtf8Xb2v937cmHswHeWPRxYj/LvkK3igGKARwicTO07118H3V/5kbi/4vPZMJtK3s/6YH2f+Pfq1B8VbjWrdnMu5s4nAD9CNFhKwz5DTUvLl419zKvAcLtG1P84BRl/b/5M/6/6f/NPzf/qzo84yj0Uus0xUU4Zor54bm9+4OfZG02OCuoAMTb9ZkC9ull1Nvrr2Z+XvRpaRfc65H/68F+jl9svEhzyLFWoccWVc+eyTHq/twydjlKRln7jX9bNMkMJnbhoFRL1xCqmKx6/yi2fYXa/c5/e846PV/5fW0/7OPx/yfcjzop34ulxdGGvDuU8mMXaX507lBuiN6ueadmQeT/p/93vf/1O+G//sP5fw/eL3o/5JLif8zVxs+Tlir9S26UyeFQQvJGBE7FvaFZ9LfN+1y+WjbItSb3GmXvXd15v8zroH/HxgE/D+aGPx/18vi/z07PeZNPRKxe/Kh0Ae8toxscCO4zBkYXArk9C1SxJUYjBkYPPIVtbbuTftz3cz//2O9wP/75iSAXdO72/dt2HL5F6YlfBW4MiJYXMiBiW3t7azHBx+V/t89N+H/8a+1//e9K/9attDp5LQjYX8SuvVL8RoAkmxa65299Erq1FnHo0qrl7t4BddriIs4MrM3rfWcFd+pGwVSAwBZ0bKP8yrZPAAAAABJRU5ErkJggg==') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -.linkify.youtube::before {\n\ - content: \"\";\n\ - background: transparent url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAMCAYAAABr5z2BAAABIklEQVQoz53LvUrDUBjG8bOoOammSf1IoBSvoCB4JeIqOHgBLt6AIMRBBQelWurQ2kERnMRBsBUcIp5FJSBI5oQsJVkkUHh8W0o5nhaFHvjBgef/Mq+Q46RJBMkI/vE+aOus956tnEswIZe1LV0QyJ5sE2GzgZfVMtRNIdiDpccEssdlB1mW4bvTwdvWJtRdErM7U+8S/FJykCRJX5qm+KpVce8UMNLRLbulz4iSjTAMh6Iowsd5BeNadp3nUF0VlxAEwZBotXC0Usa4ll3meZdA1iguwvf9vpvDA2wvmKgYGtSud8suDB4TyGr2PF49D/vra9jRZ1BVdknMzgwuCGSnZEObwu6sBnVTCHZiaC7BhFx2PKdxUidiAH/4lLo9Mv0DELVs9qsOHXwAAAAASUVORK5CYII=') center left no-repeat!important;\n\ - padding-left: 18px;\n\ -}\n\ -/* XXX Moved to end of stylesheet to avoid breaking whole stylesheet in Maxthon. */\n\ -@supports (text-decoration-style: dashed) or (-moz-text-decoration-style: dashed) {\n\ - .quotelink.forwardlink,\n\ - .backlink.forwardlink {\n\ - text-decoration: underline;\n\ - -moz-text-decoration-style: dashed;\n\ - text-decoration-style: dashed;\n\ - border-bottom: none;\n\ - }\n\ -}\n", - -report: -"#g-recaptcha,\n\ -:root:not(.js-enabled) #captchaContainerAlt {\n\ - height: auto;\n\ -}\n\ -#captchaContainerAlt td:nth-child(2) {\n\ - display: table-cell !important;\n\ -}\n\ -/* Archive reports */\n\ -#archive-report {\n\ - padding: 3px;\n\ -}\n\ -#archive-report-enabled {\n\ - vertical-align: middle;\n\ -}\n\ -#archive-report > label {\n\ - display: block;\n\ -}\n\ -#archive-report-reason {\n\ - display: block;\n\ - width: 98%;\n\ -}\n\ -.archive-report-success {\n\ - color: green;\n\ -}\n\ -.archive-report-error {\n\ - color: red;\n\ -}", - -www: -"#captcha-cnt {\n\ - height: auto;\n\ -}\n\ -:root:not(.js-enabled) #form {\n\ - display: block;\n\ -}\n\ -#bd > div[style], #bd > div[style] > * {\n\ - height: auto !important;\n\ - margin: 0 !important;\n\ - font-size: 0;\n\ -}\n", - -sub: function(css) { - var variables = { - site: g.SITE.selectors - }; - return css.replace(/\$[\w\$]+/g, function(name) { - var words = name.slice(1).split('$'); - var sel = variables; - for (var i = 0; i < words.length; i++) { - if (typeof sel !== 'object') return ':not(*)'; - sel = $.getOwn(sel, words[i]); - } - if (typeof sel !== 'string') return ':not(*)'; - return sel; - }); -} - -}; - -$ = (function() { - var $, - slice = [].slice, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - $ = function(selector, root) { - if (root == null) { - root = d.body; - } - return root.querySelector(selector); - }; - - $.DAY = 24 * ($.HOUR = 60 * ($.MINUTE = 60 * ($.SECOND = 1000))); - - $.id = function(id) { - return d.getElementById(id); - }; - - $.ready = function(fc) { - var cb; - if (d.readyState !== 'loading') { - $.queueTask(fc); - return; - } - cb = function() { - $.off(d, 'DOMContentLoaded', cb); - return fc(); - }; - return $.on(d, 'DOMContentLoaded', cb); - }; - - $.formData = function(form) { - var fd, key, val; - if (form instanceof HTMLFormElement) { - return new FormData(form); - } - fd = new FormData(); - for (key in form) { - val = form[key]; - if (val) { - if (typeof val === 'object' && 'newName' in val) { - fd.append(key, val, val.newName); - } else { - fd.append(key, val); - } - } - } - return fd; - }; - - $.extend = function(object, properties) { - var key, val; - for (key in properties) { - val = properties[key]; - object[key] = val; - } - }; - - $.dict = function() { - return Object.create(null); - }; - - $.dict.clone = function(obj) { - var arr, i, j, key, map, ref, val; - if (typeof obj !== 'object' || obj === null) { - return obj; - } else if (obj instanceof Array) { - arr = []; - for (i = j = 0, ref = obj.length; j < ref; i = j += 1) { - arr.push($.dict.clone(obj[i])); - } - return arr; - } else { - map = Object.create(null); - for (key in obj) { - val = obj[key]; - map[key] = $.dict.clone(val); - } - return map; - } - }; - - $.dict.json = function(str) { - return $.dict.clone(JSON.parse(str)); - }; - - $.hasOwn = function(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); - }; - - $.getOwn = function(obj, key) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - return obj[key]; - } else { - return void 0; - } - }; - - $.ajax = (function() { - var pageXHR; - if (window.wrappedJSObject && !XMLHttpRequest.wrappedJSObject) { - pageXHR = XPCNativeWrapper(window.wrappedJSObject.XMLHttpRequest); - } else { - pageXHR = XMLHttpRequest; - } - return function(url, options) { - var err, form, headers, key, onloadend, onprogress, r, ref, responseType, timeout, type, value, withCredentials; - if (options == null) { - options = {}; - } - if (options.responseType == null) { - options.responseType = 'json'; - } - options.type || (options.type = options.form && 'post' || 'get'); - url = url.replace(/^((?:https?:)?\/\/(?:\w+\.)?(?:4chan|4channel|4cdn)\.org)\/adv\//, '$1//adv/'); - onloadend = options.onloadend, timeout = options.timeout, responseType = options.responseType, withCredentials = options.withCredentials, type = options.type, onprogress = options.onprogress, form = options.form, headers = options.headers; - r = new pageXHR(); - try { - r.open(type, url, true); - ref = headers || {}; - for (key in ref) { - value = ref[key]; - r.setRequestHeader(key, value); - } - $.extend(r, { - onloadend: onloadend, - timeout: timeout, - responseType: responseType, - withCredentials: withCredentials - }); - $.extend(r.upload, { - onprogress: onprogress - }); - $.on(r, 'error', function() { - if (!r.status) { - return c.warn("4chan X failed to load: " + url); - } - }); - r.send(form); - } catch (error) { - err = error; - if (err.result !== 0x805e0006) { - throw err; - } - r.onloadend = onloadend; - $.queueTask($.event, 'error', null, r); - $.queueTask($.event, 'loadend', null, r); - } - return r; - }; - })(); - - $.lastModified = $.dict(); - - $.whenModified = function(url, bucket, cb, options) { - var ajax, headers, params, r, ref, t, timeout, url0; - if (options == null) { - options = {}; - } - timeout = options.timeout, ajax = options.ajax; - params = []; - if ($.engine === 'blink') { - params.push("s=" + bucket); - } - if (url.split('/')[2] === 'a.4cdn.org') { - params.push("t=" + (Date.now())); - } - url0 = url; - if (params.length) { - url += '?' + params.join('&'); - } - headers = $.dict(); - if ((t = (ref = $.lastModified[bucket]) != null ? ref[url0] : void 0) != null) { - headers['If-Modified-Since'] = t; - } - r = (ajax || $.ajax)(url, { - onloadend: function() { - var base; - ((base = $.lastModified)[bucket] || (base[bucket] = $.dict()))[url0] = this.getResponseHeader('Last-Modified'); - return cb.call(this); - }, - timeout: timeout, - headers: headers - }); - return r; - }; - - (function() { - var reqs; - reqs = $.dict(); - $.cache = function(url, cb, options) { - var ajax, onloadend, req; - if (options == null) { - options = {}; - } - ajax = options.ajax; - if ((req = reqs[url])) { - if (req.callbacks) { - req.callbacks.push(cb); - } else { - $.queueTask(function() { - return cb.call(req, { - isCached: true - }); - }); - } - return req; - } - onloadend = function() { - var fn1, j, len, ref; - if (!this.status) { - delete reqs[url]; - } - ref = this.callbacks; - fn1 = (function(_this) { - return function(cb) { - return $.queueTask(function() { - return cb.call(_this, { - isCached: false - }); - }); - }; - })(this); - for (j = 0, len = ref.length; j < len; j++) { - cb = ref[j]; - fn1(cb); - } - return delete this.callbacks; - }; - req = (ajax || $.ajax)(url, { - onloadend: onloadend - }); - req.callbacks = [cb]; - return reqs[url] = req; - }; - return $.cleanCache = function(testf) { - var url; - for (url in reqs) { - if (testf(url)) { - delete reqs[url]; - } - } - }; - })(); - - $.cb = { - checked: function() { - if ($.hasOwn(Conf, this.name)) { - $.set(this.name, this.checked); - return Conf[this.name] = this.checked; - } - }, - value: function() { - if ($.hasOwn(Conf, this.name)) { - $.set(this.name, this.value.trim()); - return Conf[this.name] = this.value; - } - } - }; - - $.asap = function(test, cb) { - if (test()) { - return cb(); - } else { - return setTimeout($.asap, 25, test, cb); - } - }; - - $.onExists = function(root, selector, cb) { - var el, observer; - if (el = $(selector, root)) { - return cb(el); - } - observer = new MutationObserver(function() { - if (el = $(selector, root)) { - observer.disconnect(); - return cb(el); - } - }); - return observer.observe(root, { - childList: true, - subtree: true - }); - }; - - $.addStyle = function(css, id, test) { - var style; - if (test == null) { - test = 'head'; - } - style = $.el('style', { - textContent: css - }); - if (id != null) { - style.id = id; - } - $.onExists(doc, test, function() { - return $.add(d.head, style); - }); - return style; - }; - - $.addCSP = function(policy) { - var head, meta; - meta = $.el('meta', { - httpEquiv: 'Content-Security-Policy', - content: policy - }); - if (d.head) { - $.add(d.head, meta); - return $.rm(meta); - } else { - head = $.add(doc || d, $.el('head')); - $.add(head, meta); - return $.rm(head); - } - }; - - $.x = function(path, root) { - root || (root = d.body); - return d.evaluate(path, root, null, 8, null).singleNodeValue; - }; - - $.X = function(path, root) { - root || (root = d.body); - return d.evaluate(path, root, null, 7, null); - }; - - $.addClass = function() { - var className, classNames, el, j, len; - el = arguments[0], classNames = 2 <= arguments.length ? slice.call(arguments, 1) : []; - for (j = 0, len = classNames.length; j < len; j++) { - className = classNames[j]; - el.classList.add(className); - } - }; - - $.rmClass = function() { - var className, classNames, el, j, len; - el = arguments[0], classNames = 2 <= arguments.length ? slice.call(arguments, 1) : []; - for (j = 0, len = classNames.length; j < len; j++) { - className = classNames[j]; - el.classList.remove(className); - } - }; - - $.toggleClass = function(el, className) { - return el.classList.toggle(className); - }; - - $.hasClass = function(el, className) { - return indexOf.call(el.classList, className) >= 0; - }; - - $.rm = function(el) { - return el != null ? el.remove() : void 0; - }; - - $.rmAll = function(root) { - return root.textContent = null; - }; - - $.tn = function(s) { - return d.createTextNode(s); - }; - - $.frag = function() { - return d.createDocumentFragment(); - }; - - $.nodes = function(nodes) { - var frag, j, len, node; - if (!(nodes instanceof Array)) { - return nodes; - } - frag = $.frag(); - for (j = 0, len = nodes.length; j < len; j++) { - node = nodes[j]; - frag.appendChild(node); - } - return frag; - }; - - $.add = function(parent, el) { - return parent.appendChild($.nodes(el)); - }; - - $.prepend = function(parent, el) { - return parent.insertBefore($.nodes(el), parent.firstChild); - }; - - $.after = function(root, el) { - return root.parentNode.insertBefore($.nodes(el), root.nextSibling); - }; - - $.before = function(root, el) { - return root.parentNode.insertBefore($.nodes(el), root); - }; - - $.replace = function(root, el) { - return root.parentNode.replaceChild($.nodes(el), root); - }; - - $.el = function(tag, properties, properties2) { - var el; - el = d.createElement(tag); - if (properties) { - $.extend(el, properties); - } - if (properties2) { - $.extend(el, properties2); - } - return el; - }; - - $.on = function(el, events, handler) { - var event, j, len, ref; - ref = events.split(' '); - for (j = 0, len = ref.length; j < len; j++) { - event = ref[j]; - el.addEventListener(event, handler, false); - } - }; - - $.off = function(el, events, handler) { - var event, j, len, ref; - ref = events.split(' '); - for (j = 0, len = ref.length; j < len; j++) { - event = ref[j]; - el.removeEventListener(event, handler, false); - } - }; - - $.one = function(el, events, handler) { - var cb; - cb = function(e) { - $.off(el, events, cb); - return handler.call(this, e); - }; - return $.on(el, events, cb); - }; - - $.event = function(event, detail, root) { - if (root == null) { - root = d; - } - if ((detail != null) && typeof cloneInto === 'function') { - detail = cloneInto(detail, d.defaultView); - } - return root.dispatchEvent(new CustomEvent(event, { - bubbles: true, - cancelable: true, - detail: detail - })); - }; - - (function() { - var clone, err, ref, unsafeConstructors; - if (!(/PaleMoon\//.test(navigator.userAgent) && +(typeof GM_info !== "undefined" && GM_info !== null ? (ref = GM_info.version) != null ? ref.split('.')[0] : void 0 : void 0) >= 2 && typeof cloneInto === 'undefined')) { - return; - } - try { - return new CustomEvent('x', { - detail: {} - }); - } catch (error) { - err = error; - unsafeConstructors = { - Object: unsafeWindow.Object, - Array: unsafeWindow.Array - }; - clone = function(obj) { - var constructor, key, obj2, val; - if ((obj != null) && typeof obj === 'object' && (constructor = unsafeConstructors[obj.constructor.name])) { - obj2 = new constructor(); - for (key in obj) { - val = obj[key]; - obj2[key] = clone(val); - } - return obj2; - } else { - return obj; - } - }; - return $.event = function(event, detail, root) { - if (root == null) { - root = d; - } - return root.dispatchEvent(new CustomEvent(event, { - bubbles: true, - cancelable: true, - detail: clone(detail) - })); - }; - } - })(); - - $.modifiedClick = function(e) { - return e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0; - }; - - $.open = (typeof GM !== "undefined" && GM !== null ? GM.openInTab : void 0) != null ? GM.openInTab : typeof GM_openInTab !== "undefined" && GM_openInTab !== null ? GM_openInTab : function(url) { - return window.open(url, '_blank'); - }; - - $.debounce = function(wait, fn) { - var args, exec, lastCall, that, timeout; - lastCall = 0; - timeout = null; - that = null; - args = null; - exec = function() { - lastCall = Date.now(); - return fn.apply(that, args); - }; - return function() { - args = arguments; - that = this; - if (lastCall < Date.now() - wait) { - return exec(); - } - clearTimeout(timeout); - return timeout = setTimeout(exec, wait); - }; - }; - - $.queueTask = (function() { - var execTask, taskChannel, taskQueue; - taskQueue = []; - execTask = function() { - var args, func, task; - task = taskQueue.shift(); - func = task[0]; - args = Array.prototype.slice.call(task, 1); - return func.apply(func, args); - }; - if (window.MessageChannel) { - taskChannel = new MessageChannel(); - taskChannel.port1.onmessage = execTask; - return function() { - taskQueue.push(arguments); - return taskChannel.port2.postMessage(null); - }; - } else { - return function() { - taskQueue.push(arguments); - return setTimeout(execTask, 0); - }; - } - })(); - - $.global = function(fn, data) { - var script; - if (doc) { - script = $.el('script', { - textContent: "(" + fn + ").call(document.currentScript.dataset);" - }); - if (data) { - $.extend(script.dataset, data); - } - $.add(d.head || doc, script); - $.rm(script); - return script.dataset; - } else { - try { - fn.call(data); - } catch (error) {} - return data; - } - }; - - $.bytesToString = function(size) { - var unit; - unit = 0; - while (size >= 1024) { - size /= 1024; - unit++; - } - size = unit > 1 ? Math.round(size * 100) / 100 : Math.round(size); - return size + " " + ['B', 'KB', 'MB', 'GB'][unit]; - }; - - $.minmax = function(value, min, max) { - return (value < min ? min : value > max ? max : value); - }; - - $.hasAudio = function(video) { - return video.mozHasAudio || !!video.webkitAudioDecodedByteCount; - }; - - $.luma = function(rgb) { - return rgb[0] * 0.299 + rgb[1] * 0.587 + rgb[2] * 0.114; - }; - - $.unescape = function(text) { - if (text == null) { - return text; - } - return text.replace(/<[^>]*>/g, '').replace(/&(amp|#039|quot|lt|gt|#44);/g, function(c) { - return { - '&': '&', - ''': "'", - '"': '"', - '<': '<', - '>': '>', - ',': ',' - }[c]; - }); - }; - - $.isImage = function(url) { - return /\.(jpe?g|jfif|png|gif|bmp|webp|avif|jxl)$/i.test(url); - }; - - $.isVideo = function(url) { - return /\.(webm|mp4|ogv)$/i.test(url); - }; - - $.engine = (function() { - if (/Edge\//.test(navigator.userAgent)) { - return 'edge'; - } - if (/Chrome\//.test(navigator.userAgent)) { - return 'blink'; - } - if (/WebKit\//.test(navigator.userAgent)) { - return 'webkit'; - } - if (/Gecko\/|Goanna/.test(navigator.userAgent)) { - return 'gecko'; - } - })(); - - $.platform = 'userscript'; - - $.hasStorage = (function() { - try { - if (localStorage.getItem(g.NAMESPACE + 'hasStorage') === 'true') { - return true; - } - localStorage.setItem(g.NAMESPACE + 'hasStorage', 'true'); - return localStorage.getItem(g.NAMESPACE + 'hasStorage') === 'true'; - } catch (error) { - return false; - } - })(); - - $.item = function(key, val) { - var item; - item = $.dict(); - item[key] = val; - return item; - }; - - $.oneItemSugar = function(fn) { - return function(key, val, cb) { - if (typeof key === 'string') { - return fn($.item(key, val), cb); - } else { - return fn(key, val); - } - }; - }; - - $.syncing = $.dict(); - - $.securityCheck = function(data) { - if (location.protocol !== 'https:') { - return delete data['Redirect to HTTPS']; - } - }; - - if (((typeof GM !== "undefined" && GM !== null ? GM.deleteValue : void 0) != null) && window.BroadcastChannel && (typeof GM_addValueChangeListener === "undefined" || GM_addValueChangeListener === null)) { - $.syncChannel = new BroadcastChannel(g.NAMESPACE + 'sync'); - $.on($.syncChannel, 'message', function(e) { - var cb, key, ref, results, val; - ref = e.data; - results = []; - for (key in ref) { - val = ref[key]; - if ((cb = $.syncing[key])) { - results.push(cb($.dict.json(JSON.stringify(val)), key)); - } - } - return results; - }); - $.sync = function(key, cb) { - return $.syncing[key] = cb; - }; - $.forceSync = function() {}; - $["delete"] = function(keys, cb) { - var key; - if (!(keys instanceof Array)) { - keys = [keys]; - } - return Promise.all((function() { - var j, len, results; - results = []; - for (j = 0, len = keys.length; j < len; j++) { - key = keys[j]; - results.push(GM.deleteValue(g.NAMESPACE + key)); - } - return results; - })()).then(function() { - var items, j, key, len; - items = $.dict(); - for (j = 0, len = keys.length; j < len; j++) { - key = keys[j]; - items[key] = void 0; - } - $.syncChannel.postMessage(items); - return typeof cb === "function" ? cb() : void 0; - }); - }; - $.get = $.oneItemSugar(function(items, cb) { - var key, keys; - keys = Object.keys(items); - return Promise.all((function() { - var j, len, results; - results = []; - for (j = 0, len = keys.length; j < len; j++) { - key = keys[j]; - results.push(GM.getValue(g.NAMESPACE + key)); - } - return results; - })()).then(function(values) { - var i, j, len, val; - for (i = j = 0, len = values.length; j < len; i = ++j) { - val = values[i]; - if (val) { - items[keys[i]] = $.dict.json(val); - } - } - return cb(items); - }); - }); - $.set = $.oneItemSugar(function(items, cb) { - var key, val; - $.securityCheck(items); - return Promise.all((function() { - var results; - results = []; - for (key in items) { - val = items[key]; - results.push(GM.setValue(g.NAMESPACE + key, JSON.stringify(val))); - } - return results; - })()).then(function() { - $.syncChannel.postMessage(items); - return typeof cb === "function" ? cb() : void 0; - }); - }); - $.clear = function(cb) { - return GM.listValues().then(function(keys) { - return $["delete"](keys.map(function(key) { - return key.replace(g.NAMESPACE, ''); - }), cb); - })["catch"](function() { - return $["delete"](Object.keys(Conf).concat(['previousversion', 'QR Size', 'QR.persona']), cb); - }); - }; - } else { - if (typeof GM_deleteValue === "undefined" || GM_deleteValue === null) { - $.perProtocolSettings = true; - } - if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) { - $.getValue = GM_getValue; - $.listValues = function() { - return GM_listValues(); - }; - } else if ($.hasStorage) { - $.getValue = function(key) { - return localStorage.getItem(key); - }; - $.listValues = function() { - var key, results; - results = []; - for (key in localStorage) { - if (key.slice(0, g.NAMESPACE.length) === g.NAMESPACE) { - results.push(key); - } - } - return results; - }; - } else { - $.getValue = function() {}; - $.listValues = function() { - return []; - }; - } - if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) { - $.setValue = GM_setValue; - $.deleteValue = GM_deleteValue; - } else if (typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) { - $.oldValue = $.dict(); - $.setValue = function(key, val) { - GM_setValue(key, val); - if (key in $.syncing) { - $.oldValue[key] = val; - if ($.hasStorage) { - return localStorage.setItem(key, val); - } - } - }; - $.deleteValue = function(key) { - GM_deleteValue(key); - if (key in $.syncing) { - delete $.oldValue[key]; - if ($.hasStorage) { - return localStorage.removeItem(key); - } - } - }; - if (!$.hasStorage) { - $.cantSync = true; - } - } else if ($.hasStorage) { - $.oldValue = $.dict(); - $.setValue = function(key, val) { - if (key in $.syncing) { - $.oldValue[key] = val; - } - return localStorage.setItem(key, val); - }; - $.deleteValue = function(key) { - if (key in $.syncing) { - delete $.oldValue[key]; - } - return localStorage.removeItem(key); - }; - } else { - $.setValue = function() {}; - $.deleteValue = function() {}; - $.cantSync = $.cantSet = true; - } - if (typeof GM_addValueChangeListener !== "undefined" && GM_addValueChangeListener !== null) { - $.sync = function(key, cb) { - return $.syncing[key] = GM_addValueChangeListener(g.NAMESPACE + key, function(key2, oldValue, newValue, remote) { - if (remote) { - if (newValue !== void 0) { - newValue = $.dict.json(newValue); - } - return cb(newValue, key); - } - }); - }; - $.forceSync = function() {}; - } else if ((typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null) || $.hasStorage) { - $.sync = function(key, cb) { - key = g.NAMESPACE + key; - $.syncing[key] = cb; - return $.oldValue[key] = $.getValue(key); - }; - (function() { - var onChange; - onChange = function(arg) { - var cb, key, newValue; - key = arg.key, newValue = arg.newValue; - if (!(cb = $.syncing[key])) { - return; - } - if (newValue != null) { - if (newValue === $.oldValue[key]) { - return; - } - $.oldValue[key] = newValue; - return cb($.dict.json(newValue), key.slice(g.NAMESPACE.length)); - } else { - if ($.oldValue[key] == null) { - return; - } - delete $.oldValue[key]; - return cb(void 0, key.slice(g.NAMESPACE.length)); - } - }; - $.on(window, 'storage', onChange); - return $.forceSync = function(key) { - key = g.NAMESPACE + key; - return onChange({ - key: key, - newValue: $.getValue(key) - }); - }; - })(); - } else { - $.sync = function() {}; - $.forceSync = function() {}; - } - $["delete"] = function(keys) { - var j, key, len; - if (!(keys instanceof Array)) { - keys = [keys]; - } - for (j = 0, len = keys.length; j < len; j++) { - key = keys[j]; - $.deleteValue(g.NAMESPACE + key); - } - }; - $.get = $.oneItemSugar(function(items, cb) { - return $.queueTask($.getSync, items, cb); - }); - $.getSync = function(items, cb) { - var err, key, val2; - for (key in items) { - if ((val2 = $.getValue(g.NAMESPACE + key))) { - try { - items[key] = $.dict.json(val2); - } catch (error) { - err = error; - if (!/^(?:undefined)*$/.test(val2)) { - throw err; - } - } - } - } - return cb(items); - }; - $.set = $.oneItemSugar(function(items, cb) { - $.securityCheck(items); - return $.queueTask(function() { - var key, value; - for (key in items) { - value = items[key]; - $.setValue(g.NAMESPACE + key, JSON.stringify(value)); - } - return typeof cb === "function" ? cb() : void 0; - }); - }); - $.clear = function(cb) { - $["delete"](Object.keys(Conf)); - $["delete"](['previousversion', 'QR Size', 'QR.persona']); - try { - $["delete"]($.listValues().map(function(key) { - return key.replace(g.NAMESPACE, ''); - })); - } catch (error) {} - return typeof cb === "function" ? cb() : void 0; - }; - } - - return $; - -}).call(this); - -$$ = (function() { - var $$, - slice = [].slice; - - $$ = function(selector, root) { - if (root == null) { - root = d.body; - } - return slice.call(root.querySelectorAll(selector)); - }; - - return $$; - -}).call(this); - -CrossOrigin = (function() { - var CrossOrigin, Request; - - CrossOrigin = { - binary: function(url, cb, headers) { - var fallback, gmOptions; - if (headers == null) { - headers = $.dict(); - } - url = url.replace(/^((?:https?:)?\/\/(?:\w+\.)?(?:4chan|4channel|4cdn)\.org)\/adv\//, '$1//adv/'); - fallback = function() { - return $.ajax(url, { - headers: headers, - responseType: 'arraybuffer', - onloadend: function() { - if (this.status && this.response) { - return cb(new Uint8Array(this.response), this.getAllResponseHeaders()); - } else { - return cb(null); - } - } - }); - }; - if (!(((typeof GM !== "undefined" && GM !== null ? GM.xmlHttpRequest : void 0) != null) || (typeof GM_xmlhttpRequest !== "undefined" && GM_xmlhttpRequest !== null))) { - fallback(); - return; - } - gmOptions = { - method: "GET", - url: url, - headers: headers, - responseType: 'arraybuffer', - overrideMimeType: 'text/plain; charset=x-user-defined', - onload: function(xhr) { - var data, i, r; - if (xhr.response instanceof ArrayBuffer) { - data = new Uint8Array(xhr.response); - } else { - r = xhr.responseText; - data = new Uint8Array(r.length); - i = 0; - while (i < r.length) { - data[i] = r.charCodeAt(i); - i++; - } - } - return cb(data, xhr.responseHeaders); - }, - onerror: function() { - return cb(null); - }, - onabort: function() { - return cb(null); - } - }; - try { - return ((typeof GM !== "undefined" && GM !== null ? GM.xmlHttpRequest : void 0) || GM_xmlhttpRequest)(gmOptions); - } catch (error) { - return fallback(); - } - }, - file: function(url, cb) { - return CrossOrigin.binary(url, function(data, headers) { - var blob, contentDisposition, contentType, match, mime, name, ref, ref1, ref2, ref3, ref4; - if (data == null) { - return cb(null); - } - name = (ref = url.match(/([^\/?#]+)\/*(?:$|[?#])/)) != null ? ref[1] : void 0; - contentType = (ref1 = headers.match(/Content-Type:\s*(.*)/i)) != null ? ref1[1] : void 0; - contentDisposition = (ref2 = headers.match(/Content-Disposition:\s*(.*)/i)) != null ? ref2[1] : void 0; - mime = (contentType != null ? contentType.match(/[^;]*/)[0] : void 0) || 'application/octet-stream'; - match = (contentDisposition != null ? (ref3 = contentDisposition.match(/\bfilename\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref3[1] : void 0 : void 0) || (contentType != null ? (ref4 = contentType.match(/\bname\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref4[1] : void 0 : void 0); - if (match) { - name = match.replace(/\\"/g, '"'); - } - if (/^text\/plain;\s*charset=x-user-defined$/i.test(mime)) { - mime = $.getOwn(QR.typeFromExtension, name.match(/[^.]*$/)[0].toLowerCase()) || 'application/octet-stream'; - } - blob = new Blob([data], { - type: mime - }); - blob.name = name; - return cb(blob); - }); - }, - Request: Request = (function() { - function Request() {} - - Request.prototype.status = 0; - - Request.prototype.statusText = ''; - - Request.prototype.response = null; - - Request.prototype.responseHeaderString = null; - - Request.prototype.getResponseHeader = function(headerName) { - var header, i, j, key, len, ref, ref1, ref2, val; - if ((this.responseHeaders == null) && (this.responseHeaderString != null)) { - this.responseHeaders = $.dict(); - ref = this.responseHeaderString.split('\r\n'); - for (j = 0, len = ref.length; j < len; j++) { - header = ref[j]; - if ((i = header.indexOf(':')) >= 0) { - key = header.slice(0, i).trim().toLowerCase(); - val = header.slice(i + 1).trim(); - this.responseHeaders[key] = val; - } - } - } - return (ref1 = (ref2 = this.responseHeaders) != null ? ref2[headerName.toLowerCase()] : void 0) != null ? ref1 : null; - }; - - Request.prototype.abort = function() {}; - - Request.prototype.onloadend = function() {}; - - return Request; - - })(), - ajax: function(url, options) { - var gmOptions, gmReq, headers, onloadend, req, responseType, timeout; - if (options == null) { - options = {}; - } - onloadend = options.onloadend, timeout = options.timeout, responseType = options.responseType, headers = options.headers; - if (responseType == null) { - responseType = 'json'; - } - if (!(((typeof GM !== "undefined" && GM !== null ? GM.xmlHttpRequest : void 0) != null) || (typeof GM_xmlhttpRequest !== "undefined" && GM_xmlhttpRequest !== null))) { - return $.ajax(url, options); - } - req = new CrossOrigin.Request(); - req.onloadend = onloadend; - gmOptions = { - method: 'GET', - url: url, - headers: headers, - timeout: timeout, - onload: function(xhr) { - var response; - try { - response = (function() { - switch (responseType) { - case 'json': - if (xhr.responseText) { - return JSON.parse(xhr.responseText); - } else { - return null; - } - break; - default: - return xhr.responseText; - } - })(); - $.extend(req, { - response: response, - status: xhr.status, - statusText: xhr.statusText, - responseHeaderString: xhr.responseHeaders - }); - } catch (error) {} - return req.onloadend(); - }, - onerror: function() { - return req.onloadend(); - }, - onabort: function() { - return req.onloadend(); - }, - ontimeout: function() { - return req.onloadend(); - } - }; - try { - gmReq = ((typeof GM !== "undefined" && GM !== null ? GM.xmlHttpRequest : void 0) || GM_xmlhttpRequest)(gmOptions); - } catch (error) { - return $.ajax(url, options); - } - if (gmReq && typeof gmReq.abort === 'function') { - req.abort = function() { - try { - return gmReq.abort(); - } catch (error) {} - }; - } - return req; - }, - cache: function(url, cb) { - return $.cache(url, cb, { - ajax: CrossOrigin.ajax - }); - }, - permission: function(cb) { - return cb(); - } - }; - - return CrossOrigin; - -}).call(this); - -Board = (function() { - var Board; - - Board = (function() { - Board.prototype.toString = function() { - return this.ID; - }; - - function Board(ID) { - var ref; - this.ID = ID; - this.boardID = this.ID; - this.siteID = g.SITE.ID; - this.threads = new SimpleDict(); - this.posts = new SimpleDict(); - this.config = ((ref = BoardConfig.boards) != null ? ref[this.ID] : void 0) || {}; - g.boards[this] = this; - } - - Board.prototype.cooldowns = function() { - var c, c2, i, key, len, ref; - c2 = (this.config || {}).cooldowns || {}; - c = { - thread: c2.threads || 0, - reply: c2.replies || 0, - image: c2.images || 0, - thread_global: 300 - }; - if (d.cookie.indexOf('pass_enabled=1') >= 0) { - ref = ['reply', 'image']; - for (i = 0, len = ref.length; i < len; i++) { - key = ref[i]; - c[key] = Math.ceil(c[key] / 2); - } - } - return c; - }; - - return Board; - - })(); - - return Board; - -}).call(this); - -Callbacks = (function() { - var Callbacks; - - Callbacks = (function() { - Callbacks.Post = new Callbacks('Post'); - - Callbacks.Thread = new Callbacks('Thread'); - - Callbacks.CatalogThread = new Callbacks('Catalog Thread'); - - Callbacks.CatalogThreadNative = new Callbacks('Catalog Thread'); - - function Callbacks(type) { - this.type = type; - this.keys = []; - } - - Callbacks.prototype.push = function(arg) { - var cb, name; - name = arg.name, cb = arg.cb; - if (!this[name]) { - this.keys.push(name); - } - return this[name] = cb; - }; - - Callbacks.prototype.execute = function(node, keys, force) { - var err, errors, i, len, name, ref, ref1, ref2; - if (keys == null) { - keys = this.keys; - } - if (force == null) { - force = false; - } - if (node.callbacksExecuted && !force) { - return; - } - node.callbacksExecuted = true; - for (i = 0, len = keys.length; i < len; i++) { - name = keys[i]; - try { - if ((ref = this[name]) != null) { - ref.call(node); - } - } catch (error) { - err = error; - if (!errors) { - errors = []; - } - errors.push({ - message: ['"', name, '" crashed on node ', this.type, ' No.', node.ID, ' (', node.board, ').'].join(''), - error: err, - html: (ref1 = node.nodes) != null ? (ref2 = ref1.root) != null ? ref2.outerHTML : void 0 : void 0 - }); - } - } - if (errors) { - return Main.handleErrors(errors); - } - }; - - return Callbacks; - - })(); - - return Callbacks; - -}).call(this); - -CatalogThread = (function() { - var CatalogThread; - - CatalogThread = (function() { - CatalogThread.prototype.toString = function() { - return this.ID; - }; - - function CatalogThread(root, thread) { - var post; - this.thread = thread; - this.ID = this.thread.ID; - this.board = this.thread.board; - post = this.thread.OP.nodes.post; - this.nodes = { - root: root, - thumb: $('.catalog-thumb', post), - icons: $('.catalog-icons', post), - postCount: $('.post-count', post), - fileCount: $('.file-count', post), - pageCount: $('.page-count', post), - replies: null - }; - this.thread.catalogView = this; - } - - return CatalogThread; - - })(); - - return CatalogThread; - -}).call(this); - -CatalogThreadNative = (function() { - var CatalogThreadNative; - - CatalogThreadNative = (function() { - CatalogThreadNative.prototype.toString = function() { - return this.ID; - }; - - function CatalogThreadNative(root) { - this.nodes = { - root: root, - thumb: $(g.SITE.selectors.catalog.thumb, root) - }; - this.siteID = g.SITE.ID; - this.boardID = this.nodes.thumb.parentNode.pathname.split(/\/+/)[1]; - this.board = g.boards[this.boardID] || new Board(this.boardID); - this.ID = this.threadID = +(root.dataset.id || root.id).match(/\d*$/)[0]; - this.thread = this.board.threads.get(this.ID) || new Thread(this.ID, this.board); - } - - return CatalogThreadNative; - - })(); - - return CatalogThreadNative; - -}).call(this); - -Connection = (function() { - var Connection, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; - - Connection = (function() { - function Connection(target, origin, cb) { - this.target = target; - this.origin = origin; - this.cb = cb != null ? cb : {}; - this.onMessage = bind(this.onMessage, this); - this.send = bind(this.send, this); - $.on(window, 'message', this.onMessage); - } - - Connection.prototype.targetWindow = function() { - if (this.target instanceof window.HTMLIFrameElement) { - return this.target.contentWindow; - } else { - return this.target; - } - }; - - Connection.prototype.send = function(data) { - return this.targetWindow().postMessage("" + g.NAMESPACE + (JSON.stringify(data)), this.origin); - }; - - Connection.prototype.onMessage = function(e) { - var data, type, value; - if (!(e.source === this.targetWindow() && e.origin === this.origin && typeof e.data === 'string' && e.data.slice(0, g.NAMESPACE.length) === g.NAMESPACE)) { - return; - } - data = JSON.parse(e.data.slice(g.NAMESPACE.length)); - for (type in data) { - value = data[type]; - if ($.hasOwn(this.cb, type)) { - this.cb[type](value); - } - } - }; - - return Connection; - - })(); - - return Connection; - -}).call(this); - -DataBoard = (function() { - var DataBoard, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; - - DataBoard = (function() { - DataBoard.keys = ['hiddenThreads', 'hiddenPosts', 'lastReadPosts', 'yourPosts', 'watchedThreads', 'watcherLastModified', 'customTitles']; - - function DataBoard(key1, sync, dontClean) { - var init; - this.key = key1; - this.onSync = bind(this.onSync, this); - this.initData(Conf[this.key]); - $.sync(this.key, this.onSync); - if (!dontClean) { - this.clean(); - } - if (!sync) { - return; - } - init = (function(_this) { - return function() { - $.off(d, '4chanXInitFinished', init); - return _this.sync = sync; - }; - })(this); - $.on(d, '4chanXInitFinished', init); - } - - DataBoard.prototype.initData = function(data1) { - var base, boards, lastChecked, name, ref; - this.data = data1; - if (this.data.boards) { - ref = this.data, boards = ref.boards, lastChecked = ref.lastChecked; - this.data['4chan.org'] = { - boards: boards, - lastChecked: lastChecked - }; - delete this.data.boards; - delete this.data.lastChecked; - } - return (base = this.data)[name = g.SITE.ID] || (base[name] = { - boards: $.dict() - }); - }; - - DataBoard.prototype.changes = []; - - DataBoard.prototype.save = function(change, cb) { - change(); - this.changes.push(change); - return $.get(this.key, { - boards: $.dict() - }, (function(_this) { - return function(items) { - var i, len, needSync, ref; - if (!_this.changes.length) { - return; - } - needSync = (items[_this.key].version || 0) > (_this.data.version || 0); - if (needSync) { - _this.initData(items[_this.key]); - ref = _this.changes; - for (i = 0, len = ref.length; i < len; i++) { - change = ref[i]; - change(); - } - } - _this.changes = []; - _this.data.version = (_this.data.version || 0) + 1; - return $.set(_this.key, _this.data, function() { - if (needSync) { - if (typeof _this.sync === "function") { - _this.sync(); - } - } - return typeof cb === "function" ? cb() : void 0; - }); - }; - })(this)); - }; - - DataBoard.prototype.forceSync = function(cb) { - return $.get(this.key, { - boards: $.dict() - }, (function(_this) { - return function(items) { - var change, i, len, ref; - if ((items[_this.key].version || 0) > (_this.data.version || 0)) { - _this.initData(items[_this.key]); - ref = _this.changes; - for (i = 0, len = ref.length; i < len; i++) { - change = ref[i]; - change(); - } - if (typeof _this.sync === "function") { - _this.sync(); - } - } - return typeof cb === "function" ? cb() : void 0; - }; - })(this)); - }; - - DataBoard.prototype["delete"] = function(arg, cb) { - var boardID, postID, siteID, threadID; - siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID; - siteID || (siteID = g.SITE.ID); - if (!this.data[siteID]) { - return; - } - return this.save((function(_this) { - return function() { - var ref; - if (postID) { - if (!((ref = _this.data[siteID].boards[boardID]) != null ? ref[threadID] : void 0)) { - return; - } - delete _this.data[siteID].boards[boardID][threadID][postID]; - return _this.deleteIfEmpty({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }); - } else if (threadID) { - if (!_this.data[siteID].boards[boardID]) { - return; - } - delete _this.data[siteID].boards[boardID][threadID]; - return _this.deleteIfEmpty({ - siteID: siteID, - boardID: boardID - }); - } else { - return delete _this.data[siteID].boards[boardID]; - } - }; - })(this), cb); - }; - - DataBoard.prototype.deleteIfEmpty = function(arg) { - var boardID, siteID, threadID; - siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID; - if (!this.data[siteID]) { - return; - } - if (threadID) { - if (!Object.keys(this.data[siteID].boards[boardID][threadID]).length) { - delete this.data[siteID].boards[boardID][threadID]; - return this.deleteIfEmpty({ - siteID: siteID, - boardID: boardID - }); - } - } else if (!Object.keys(this.data[siteID].boards[boardID]).length) { - return delete this.data[siteID].boards[boardID]; - } - }; - - DataBoard.prototype.set = function(data, cb) { - return this.save((function(_this) { - return function() { - return _this.setUnsafe(data); - }; - })(this), cb); - }; - - DataBoard.prototype.setUnsafe = function(arg) { - var base, base1, base2, base3, boardID, postID, siteID, threadID, val; - siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, val = arg.val; - siteID || (siteID = g.SITE.ID); - (base = this.data)[siteID] || (base[siteID] = { - boards: $.dict() - }); - if (postID !== void 0) { - return ((base1 = ((base2 = this.data[siteID].boards)[boardID] || (base2[boardID] = $.dict())))[threadID] || (base1[threadID] = $.dict()))[postID] = val; - } else if (threadID !== void 0) { - return ((base3 = this.data[siteID].boards)[boardID] || (base3[boardID] = $.dict()))[threadID] = val; - } else { - return this.data[siteID].boards[boardID] = val; - } - }; - - DataBoard.prototype.extend = function(arg, cb) { - var boardID, postID, siteID, threadID, val; - siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, val = arg.val; - return this.save((function(_this) { - return function() { - var key, oldVal, subVal; - oldVal = _this.get({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - postID: postID, - defaultValue: $.dict() - }); - for (key in val) { - subVal = val[key]; - if (typeof subVal === 'undefined') { - delete oldVal[key]; - } else { - oldVal[key] = subVal; - } - } - return _this.setUnsafe({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - postID: postID, - val: oldVal - }); - }; - })(this), cb); - }; - - DataBoard.prototype.setLastChecked = function(key) { - if (key == null) { - key = 'lastChecked'; - } - return this.save((function(_this) { - return function() { - return _this.data[key] = Date.now(); - }; - })(this)); - }; - - DataBoard.prototype.get = function(arg) { - var ID, board, boardID, defaultValue, i, len, postID, ref, siteID, thread, threadID, val; - siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, defaultValue = arg.defaultValue; - siteID || (siteID = g.SITE.ID); - if (board = (ref = this.data[siteID]) != null ? ref.boards[boardID] : void 0) { - if (threadID == null) { - if (postID != null) { - for (thread = i = 0, len = board.length; i < len; thread = ++i) { - ID = board[thread]; - if (postID in thread) { - val = thread[postID]; - break; - } - } - } else { - val = board; - } - } else if (thread = board[threadID]) { - val = postID != null ? thread[postID] : thread; - } - } - return val || defaultValue; - }; - - DataBoard.prototype.clean = function() { - var boardID, now, ref, ref1, siteID, val; - siteID = g.SITE.ID; - ref = this.data[siteID].boards; - for (boardID in ref) { - val = ref[boardID]; - this.deleteIfEmpty({ - siteID: siteID, - boardID: boardID - }); - } - now = Date.now(); - if (!((now - 2 * $.HOUR < (ref1 = this.data[siteID].lastChecked || 0) && ref1 <= now))) { - this.data[siteID].lastChecked = now; - for (boardID in this.data[siteID].boards) { - this.ajaxClean(boardID); - } - } - }; - - DataBoard.prototype.ajaxClean = function(boardID) { - var base, siteID, that, threadsList; - that = this; - siteID = g.SITE.ID; - threadsList = typeof (base = g.SITE.urls).threadsListJSON === "function" ? base.threadsListJSON({ - siteID: siteID, - boardID: boardID - }) : void 0; - if (!threadsList) { - return; - } - return $.cache(threadsList, function() { - var archiveList, base1, response1; - if (this.status !== 200) { - return; - } - archiveList = typeof (base1 = g.SITE.urls).archiveListJSON === "function" ? base1.archiveListJSON({ - siteID: siteID, - boardID: boardID - }) : void 0; - if (!archiveList) { - return that.ajaxCleanParse(boardID, this.response); - } - response1 = this.response; - return $.cache(archiveList, function() { - if (!(this.status === 200 || (!g.SITE.archivedBoardsKnown && this.status === 404))) { - return; - } - return that.ajaxCleanParse(boardID, response1, this.response); - }); - }); - }; - - DataBoard.prototype.ajaxCleanParse = function(boardID, response1, response2) { - var ID, board, i, j, k, len, len1, len2, page, ref, siteID, thread, threads; - siteID = g.SITE.ID; - if (!(board = this.data[siteID].boards[boardID])) { - return; - } - threads = $.dict(); - if (response1) { - for (i = 0, len = response1.length; i < len; i++) { - page = response1[i]; - ref = page.threads; - for (j = 0, len1 = ref.length; j < len1; j++) { - thread = ref[j]; - ID = thread.no; - if (ID in board) { - threads[ID] = board[ID]; - } - } - } - } - if (response2) { - for (k = 0, len2 = response2.length; k < len2; k++) { - ID = response2[k]; - if (ID in board) { - threads[ID] = board[ID]; - } - } - } - this.data[siteID].boards[boardID] = threads; - this.deleteIfEmpty({ - siteID: siteID, - boardID: boardID - }); - return $.set(this.key, this.data); - }; - - DataBoard.prototype.onSync = function(data) { - if (!((data.version || 0) > (this.data.version || 0))) { - return; - } - this.initData(data); - return typeof this.sync === "function" ? this.sync() : void 0; - }; - - return DataBoard; - - })(); - - return DataBoard; - -}).call(this); - -Fetcher = (function() { - var Fetcher, - slice = [].slice; - - Fetcher = (function() { - function Fetcher(boardID1, threadID, postID1, root, quoter) { - var board, post, ref, that, thread; - this.boardID = boardID1; - this.threadID = threadID; - this.postID = postID1; - this.root = root; - this.quoter = quoter; - if (post = g.posts.get(this.boardID + "." + this.postID)) { - this.insert(post); - return; - } - if ((post = (ref = Index.replyData) != null ? ref[this.boardID + "." + this.postID] : void 0) && (thread = g.threads.get(this.boardID + "." + this.threadID))) { - board = g.boards[this.boardID]; - post = new Post(g.SITE.Build.postFromObject(post, this.boardID), thread, board, { - isFetchedQuote: true - }); - Main.callbackNodes('Post', [post]); - this.insert(post); - return; - } - this.root.textContent = "Loading post No." + this.postID + "..."; - if (this.threadID) { - that = this; - $.cache(g.SITE.urls.threadJSON({ - boardID: this.boardID, - threadID: this.threadID - }), function(arg) { - var isCached; - isCached = arg.isCached; - return that.fetchedPost(this, isCached); - }); - } else { - this.archivedPost(); - } - } - - Fetcher.prototype.insert = function(post) { - var boardID, clone, cssVersion, k, len, nodes, postID, quote, ref, ref1, ref2; - if (!this.root.parentNode) { - return; - } - this.quoter || (this.quoter = post); - clone = post.addClone(this.quoter.context, $.hasClass(this.root, 'dialog')); - Main.callbackNodes('Post', [clone]); - nodes = clone.nodes; - $.rmAll(nodes.root); - $.add(nodes.root, nodes.post); - ref = clone.nodes.quotelinks.concat(slice.call(clone.nodes.backlinks)); - for (k = 0, len = ref.length; k < len; k++) { - quote = ref[k]; - ref1 = Get.postDataFromLink(quote), boardID = ref1.boardID, postID = ref1.postID; - if (postID === this.quoter.ID && boardID === this.quoter.board.ID) { - $.addClass(quote, 'forwardlink'); - } - } - if (clone.nodes.flag && !(Fetcher.flagCSS || (Fetcher.flagCSS = $('link[href^="//s.4cdn.org/css/flags."]')))) { - cssVersion = ((ref2 = $('link[href^="//s.4cdn.org/css/"]')) != null ? ref2.href.match(/\d+(?=\.css$)|$/)[0] : void 0) || Date.now(); - Fetcher.flagCSS = $.el('link', { - rel: 'stylesheet', - href: "//s.4cdn.org/css/flags." + cssVersion + ".css" - }); - $.add(d.head, Fetcher.flagCSS); - } - $.rmAll(this.root); - $.add(this.root, nodes.root); - return $.event('PostsInserted', null, this.root); - }; - - Fetcher.prototype.fetchedPost = function(req, isCached) { - var api, board, k, len, post, posts, status, that, thread; - if (post = g.posts.get(this.boardID + "." + this.postID)) { - this.insert(post); - return; - } - status = req.status; - if (status !== 200) { - if (status && this.archivedPost()) { - return; - } - $.addClass(this.root, 'warning'); - this.root.textContent = status === 404 ? "Thread No." + this.threadID + " 404'd." : !status ? 'Connection Error' : "Error " + req.statusText + " (" + req.status + ")."; - return; - } - posts = req.response.posts; - g.SITE.Build.spoilerRange[this.boardID] = posts[0].custom_spoiler; - for (k = 0, len = posts.length; k < len; k++) { - post = posts[k]; - if (post.no === this.postID) { - break; - } - } - if (post.no !== this.postID) { - if (isCached) { - api = g.SITE.urls.threadJSON({ - boardID: this.boardID, - threadID: this.threadID - }); - $.cleanCache(function(url) { - return url === api; - }); - that = this; - $.cache(api, function() { - return that.fetchedPost(this, false); - }); - return; - } - if (this.archivedPost()) { - return; - } - $.addClass(this.root, 'warning'); - this.root.textContent = "Post No." + this.postID + " was not found."; - return; - } - board = g.boards[this.boardID] || new Board(this.boardID); - thread = g.threads.get(this.boardID + "." + this.threadID) || new Thread(this.threadID, board); - post = new Post(g.SITE.Build.postFromObject(post, this.boardID), thread, board, { - isFetchedQuote: true - }); - Main.callbackNodes('Post', [post]); - return this.insert(post); - }; - - Fetcher.prototype.archivedPost = function() { - var archive, encryptionOK, that, url; - if (!Conf['Resurrect Quotes']) { - return false; - } - if (!(url = Redirect.to('post', { - boardID: this.boardID, - postID: this.postID - }))) { - return false; - } - archive = Redirect.data.post[this.boardID]; - encryptionOK = /^https:\/\//.test(url) || location.protocol === 'http:'; - if (encryptionOK || Conf['Exempt Archives from Encryption']) { - that = this; - CrossOrigin.cache(url, function() { - var key, media, ref, ref1; - if (!encryptionOK && ((ref = this.response) != null ? ref.media : void 0)) { - media = this.response.media; - for (key in media) { - if (/_link$/.test(key)) { - if (!((ref1 = $.getOwn(media, key)) != null ? ref1.match(/^http:\/\//) : void 0)) { - delete media[key]; - } - } - } - } - return that.parseArchivedPost(this.response, url, archive); - }); - return true; - } - return false; - }; - - Fetcher.prototype.parseArchivedPost = function(data, url, archive) { - var board, comment, greentext, i, j, media_link, o, post, ref, tag, text, text2, thread, thumb_link; - if (post = g.posts.get(this.boardID + "." + this.postID)) { - this.insert(post); - return; - } - if (data == null) { - $.addClass(this.root, 'warning'); - this.root.textContent = "Error fetching Post No." + this.postID + " from " + archive.name + "."; - return; - } - if (data.error) { - $.addClass(this.root, 'warning'); - this.root.textContent = data.error; - return; - } - comment = (data.comment || '').split(/(\n|\[\/?(?:b|spoiler|code|moot|banned|fortune(?: color="#\w+")?|i|red|green|blue)\])/); - comment = (function() { - var k, len, results; - results = []; - for (i = k = 0, len = comment.length; k < len; i = ++k) { - text = comment[i]; - if (i % 2 === 1) { - tag = this.archiveTags[text.replace(/\ .*\]/, ']')]; - if (typeof tag === 'function') { - results.push(tag(text)); - } else { - results.push(tag); - } - } else { - greentext = text[0] === '>'; - text = text.replace(/(\[\/?[a-z]+):lit(\])/g, '$1$2'); - text = (function() { - var l, len1, ref, results1; - ref = text.split(/(>>(?:>\/[a-z\d]+\/)?\d+)/g); - results1 = []; - for (j = l = 0, len1 = ref.length; l < len1; j = ++l) { - text2 = ref[j]; - results1.push({innerHTML: ((j % 2) ? "" + E(text2) + "" : E(text2))}); - } - return results1; - })(); - text = {innerHTML: ((greentext) ? "" + E.cat(text) + "" : E.cat(text))}; - results.push(text); - } - } - return results; - }).call(this); - comment = {innerHTML: E.cat(comment)}; - this.threadID = +data.thread_num; - o = { - ID: this.postID, - threadID: this.threadID, - boardID: this.boardID, - isReply: this.postID !== this.threadID - }; - o.info = { - subject: data.title, - email: data.email, - name: data.name || '', - tripcode: data.trip, - capcode: (function() { - switch (data.capcode) { - case 'M': - return 'Mod'; - case 'A': - return 'Admin'; - case 'D': - return 'Developer'; - case 'V': - return 'Verified'; - case 'F': - return 'Founder'; - case 'G': - return 'Manager'; - } - })(), - uniqueID: data.poster_hash, - flagCode: data.poster_country, - flagCodeTroll: data.troll_country_code, - flag: data.poster_country_name || data.troll_country_name, - dateUTC: data.timestamp, - dateText: data.fourchan_date, - commentHTML: comment - }; - if (o.info.capcode) { - delete o.info.uniqueID; - } - if (data.media && !!+data.media.banned) { - o.fileDeleted = true; - } else if ((ref = data.media) != null ? ref.media_filename : void 0) { - thumb_link = data.media.thumb_link; - if ((thumb_link != null ? thumb_link[0] : void 0) === '/') { - thumb_link = url.split('/', 3).join('/') + thumb_link; - } - if (!Redirect.securityCheck(thumb_link)) { - thumb_link = ''; - } - media_link = Redirect.to('file', { - boardID: this.boardID, - filename: data.media.media_orig - }); - if (!Redirect.securityCheck(media_link)) { - media_link = ''; - } - o.file = { - name: data.media.media_filename, - url: media_link || (this.boardID === 'f' ? location.protocol + "//" + (ImageHost.flashHost()) + "/" + this.boardID + "/" + (encodeURIComponent(E(data.media.media_filename))) : location.protocol + "//" + (ImageHost.host()) + "/" + this.boardID + "/" + data.media.media_orig), - height: data.media.media_h, - width: data.media.media_w, - MD5: data.media.media_hash, - size: $.bytesToString(data.media.media_size), - thumbURL: thumb_link || (location.protocol + "//" + (ImageHost.thumbHost()) + "/" + this.boardID + "/" + data.media.preview_orig), - theight: data.media.preview_h, - twidth: data.media.preview_w, - isSpoiler: data.media.spoiler === '1' - }; - if (!/\.pdf$/.test(o.file.url)) { - o.file.dimensions = o.file.width + "x" + o.file.height; - } - if (this.boardID === 'f' && data.media.exif) { - o.file.tag = JSON.parse(data.media.exif).Tag; - } - } - o.extra = $.dict(); - board = g.boards[this.boardID] || new Board(this.boardID); - thread = g.threads.get(this.boardID + "." + this.threadID) || new Thread(this.threadID, board); - post = new Post(g.SITE.Build.post(o), thread, board, { - isFetchedQuote: true - }); - post.kill(); - if (post.file) { - post.file.thumbURL = o.file.thumbURL; - } - Main.callbackNodes('Post', [post]); - return this.insert(post); - }; - - Fetcher.prototype.archiveTags = { - '\n': {innerHTML: "
      "}, - '[b]': {innerHTML: ""}, - '[/b]': {innerHTML: ""}, - '[spoiler]': {innerHTML: ""}, - '[/spoiler]': {innerHTML: ""}, - '[code]': {innerHTML: "
      "},
      -      '[/code]': {innerHTML: "
      "}, - '[moot]': {innerHTML: "
      "}, - '[/moot]': {innerHTML: "
      "}, - '[banned]': {innerHTML: ""}, - '[/banned]': {innerHTML: ""}, - '[fortune]': function(text) { - return {innerHTML: ""}; - }, - '[/fortune]': {innerHTML: ""}, - '[i]': {innerHTML: ""}, - '[/i]': {innerHTML: ""}, - '[red]': {innerHTML: ""}, - '[/red]': {innerHTML: ""}, - '[green]': {innerHTML: ""}, - '[/green]': {innerHTML: ""}, - '[blue]': {innerHTML: ""}, - '[/blue]': {innerHTML: ""} - }; - - return Fetcher; - - })(); - - return Fetcher; - -}).call(this); - -Notice = (function() { - var Notice, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; - - Notice = (function() { - function Notice(type, content, timeout, onclose) { - this.timeout = timeout; - this.onclose = onclose; - this.close = bind(this.close, this); - this.add = bind(this.add, this); - this.el = $.el('div', {innerHTML: "
      "}); - this.el.style.opacity = 0; - this.setType(type); - $.on(this.el.firstElementChild, 'click', this.close); - if (typeof content === 'string') { - content = $.tn(content); - } - $.add(this.el.lastElementChild, content); - $.ready(this.add); - } - - Notice.prototype.setType = function(type) { - return this.el.className = "notification " + type; - }; - - Notice.prototype.add = function() { - if (this.closed) { - return; - } - if (d.hidden) { - $.on(d, 'visibilitychange', this.add); - return; - } - $.off(d, 'visibilitychange', this.add); - $.add(Header.noticesRoot, this.el); - this.el.clientHeight; - this.el.style.opacity = 1; - if (this.timeout) { - return setTimeout(this.close, this.timeout * $.SECOND); - } - }; - - Notice.prototype.close = function() { - this.closed = true; - $.off(d, 'visibilitychange', this.add); - $.rm(this.el); - return typeof this.onclose === "function" ? this.onclose() : void 0; - }; - - return Notice; - - })(); - - return Notice; - -}).call(this); - -Post = (function() { - var Post, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Post = (function() { - Post.prototype.toString = function() { - return this.ID; - }; - - function Post(root, thread, board, flags) { - var clone, j, k, key, len, len1, ref, ref1, ref10, ref11, ref12, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, selector; - this.thread = thread; - this.board = board; - if (flags == null) { - flags = {}; - } - $.extend(this, flags); - this.ID = +root.id.match(/\d*$/)[0]; - this.postID = this.ID; - this.threadID = this.thread.ID; - this.boardID = this.board.ID; - this.siteID = g.SITE.ID; - this.fullID = this.board + "." + this.ID; - this.context = this; - this.isReply = this.ID !== this.threadID; - root.dataset.fullID = this.fullID; - this.nodes = this.parseNodes(root); - if (!this.isReply) { - this.thread.OP = this; - ref = ['isSticky', 'isClosed', 'isArchived']; - for (j = 0, len = ref.length; j < len; j++) { - key = ref[j]; - if ((selector = g.SITE.selectors.icons[key])) { - this.thread[key] = !!$(selector, this.nodes.info); - } - } - if (this.thread.isArchived) { - this.thread.isClosed = true; - this.thread.kill(); - } - } - this.info = { - subject: ((ref1 = this.nodes.subject) != null ? ref1.textContent : void 0) || void 0, - name: (ref2 = this.nodes.name) != null ? ref2.textContent : void 0, - email: this.nodes.email ? decodeURIComponent(this.nodes.email.href.replace(/^mailto:/, '')) : void 0, - tripcode: (ref3 = this.nodes.tripcode) != null ? ref3.textContent : void 0, - uniqueID: (ref4 = this.nodes.uniqueID) != null ? ref4.textContent : void 0, - capcode: (ref5 = this.nodes.capcode) != null ? ref5.textContent.replace('## ', '') : void 0, - pass: (ref6 = this.nodes.pass) != null ? ref6.title.match(/\d*$/)[0] : void 0, - flagCode: (ref7 = this.nodes.flag) != null ? (ref8 = ref7.className.match(/flag-(\w+)/)) != null ? ref8[1].toUpperCase() : void 0 : void 0, - flagCodeTroll: (ref9 = this.nodes.flag) != null ? (ref10 = ref9.className.match(/bfl-(\w+)/)) != null ? ref10[1].toUpperCase() : void 0 : void 0, - flag: (ref11 = this.nodes.flag) != null ? ref11.title : void 0, - date: this.nodes.date ? g.SITE.parseDate(this.nodes.date) : void 0 - }; - if (Conf['Anonymize']) { - this.info.nameBlock = 'Anonymous'; - } else { - this.info.nameBlock = ((this.info.name || '') + " " + (this.info.tripcode || '')).trim(); - } - if (this.info.capcode) { - this.info.nameBlock += " ## " + this.info.capcode; - } - if (this.info.uniqueID) { - this.info.nameBlock += " (ID: " + this.info.uniqueID + ")"; - } - this.parseComment(); - this.parseQuotes(); - this.parseFiles(); - this.isDead = false; - this.isHidden = false; - this.clones = []; - if (g.posts.get(this.fullID)) { - this.isRebuilt = true; - this.clones = g.posts.get(this.fullID).clones; - ref12 = this.clones; - for (k = 0, len1 = ref12.length; k < len1; k++) { - clone = ref12[k]; - clone.origin = this; - } - } - if (!this.isFetchedQuote && this.ID > this.thread.lastPost) { - this.thread.lastPost = this.ID; - } - this.board.posts.push(this.ID, this); - this.thread.posts.push(this.ID, this); - g.posts.push(this.fullID, this); - } - - Post.prototype.parseNodes = function(root) { - var base, info, key, nodes, post, ref, s, selector; - s = g.SITE.selectors; - post = $(s.post, root) || root; - info = $(s.infoRoot, post); - nodes = { - root: root, - bottom: this.isReply || !g.SITE.isOPContainerThread ? root : $(s.opBottom, root), - post: post, - info: info, - comment: $(s.comment, post), - quotelinks: [], - archivelinks: [], - embedlinks: [] - }; - ref = s.info; - for (key in ref) { - selector = ref[key]; - nodes[key] = $(selector, info); - } - if (typeof (base = g.SITE).parseNodes === "function") { - base.parseNodes(this, nodes); - } - nodes.uniqueIDRoot || (nodes.uniqueIDRoot = nodes.uniqueID); - if ($.engine === 'edge') { - Object.defineProperty(nodes, 'backlinks', { - configurable: true, - enumerable: true, - get: function() { - return post.getElementsByClassName('backlink'); - } - }); - } else { - nodes.backlinks = post.getElementsByClassName('backlink'); - } - return nodes; - }; - - Post.prototype.parseComment = function() { - var base, bq; - this.nodes.comment.normalize(); - this.nodes.commentClean = bq = this.nodes.comment.cloneNode(true); - if (typeof (base = g.SITE).cleanComment === "function") { - base.cleanComment(bq); - } - return this.info.comment = this.nodesToText(bq); - }; - - Post.prototype.commentDisplay = function() { - var base, bq; - bq = this.nodes.commentClean.cloneNode(true); - if (!(Conf['Remove Spoilers'] || Conf['Reveal Spoilers'])) { - this.cleanSpoilers(bq); - } - if (typeof (base = g.SITE).cleanCommentDisplay === "function") { - base.cleanCommentDisplay(bq); - } - return this.nodesToText(bq).trim().replace(/\s+$/gm, ''); - }; - - Post.prototype.commentOrig = function() { - var base, bq; - bq = this.nodes.commentClean.cloneNode(true); - if (typeof (base = g.SITE).insertTags === "function") { - base.insertTags(bq); - } - return this.nodesToText(bq); - }; - - Post.prototype.nodesToText = function(bq) { - var i, node, nodes, text; - text = ""; - nodes = $.X('.//br|.//text()', bq); - i = 0; - while (node = nodes.snapshotItem(i++)) { - text += node.data || '\n'; - } - return text; - }; - - Post.prototype.cleanSpoilers = function(bq) { - var j, len, node, spoilers; - spoilers = $$(g.SITE.selectors.spoiler, bq); - for (j = 0, len = spoilers.length; j < len; j++) { - node = spoilers[j]; - $.replace(node, $.tn('[spoiler]')); - } - }; - - Post.prototype.parseQuotes = function() { - var j, len, quotelink, ref; - this.quotes = []; - ref = $$(g.SITE.selectors.quotelink, this.nodes.comment); - for (j = 0, len = ref.length; j < len; j++) { - quotelink = ref[j]; - this.parseQuote(quotelink); - } - }; - - Post.prototype.parseQuote = function(quotelink) { - var fullID, match; - match = quotelink.href.match(g.SITE.regexp.quotelink); - if (!(match || (this.isClone && quotelink.dataset.postID))) { - return; - } - this.nodes.quotelinks.push(quotelink); - if (this.isClone) { - return; - } - fullID = match[1] + "." + match[3]; - if (indexOf.call(this.quotes, fullID) < 0) { - return this.quotes.push(fullID); - } - }; - - Post.prototype.parseFiles = function() { - var docIndex, file, fileRoot, fileRoots, index, j, len; - this.files = []; - fileRoots = this.fileRoots(); - index = 0; - for (docIndex = j = 0, len = fileRoots.length; j < len; docIndex = ++j) { - fileRoot = fileRoots[docIndex]; - if ((file = this.parseFile(fileRoot))) { - file.index = index++; - file.docIndex = docIndex; - this.files.push(file); - } - } - if (this.files.length) { - return this.file = this.files[0]; - } - }; - - Post.prototype.fileRoots = function() { - var roots; - if (g.SITE.selectors.multifile) { - roots = $$(g.SITE.selectors.multifile, this.nodes.root); - if (roots.length) { - return roots; - } - } - return [this.nodes.root]; - }; - - Post.prototype.parseFile = function(fileRoot) { - var file, key, ref, ref1, selector, size, unit; - file = {}; - ref = g.SITE.selectors.file; - for (key in ref) { - selector = ref[key]; - file[key] = $(selector, fileRoot); - } - file.thumbLink = (ref1 = file.thumb) != null ? ref1.parentNode : void 0; - if (!(file.text && file.link)) { - return; - } - if (!g.SITE.parseFile(this, file)) { - return; - } - $.extend(file, { - url: file.link.href, - isImage: $.isImage(file.link.href), - isVideo: $.isVideo(file.link.href) - }); - size = +file.size.match(/[\d.]+/)[0]; - unit = ['B', 'KB', 'MB', 'GB'].indexOf(file.size.match(/\w+$/)[0]); - while (unit-- > 0) { - size *= 1024; - } - file.sizeInBytes = size; - return file; - }; - - Post.deadMark = $.el('span', { - textContent: '\u00A0(Dead)', - className: 'qmark-dead' - }); - - Post.prototype.kill = function(file, index) { - var clone, j, k, len, len1, quotelink, ref, ref1, strong; - if (index == null) { - index = 0; - } - if (file) { - if (this.isDead || this.files[index].isDead) { - return; - } - this.files[index].isDead = true; - $.addClass(this.nodes.root, 'deleted-file'); - } else { - if (this.isDead) { - return; - } - this.isDead = true; - $.rmClass(this.nodes.root, 'deleted-file'); - $.addClass(this.nodes.root, 'deleted-post'); - } - if (!(strong = $('strong.warning', this.nodes.info))) { - strong = $.el('strong', { - className: 'warning' - }); - $.after($('input', this.nodes.info), strong); - } - strong.textContent = file ? '[File deleted]' : '[Deleted]'; - if (this.isClone) { - return; - } - ref = this.clones; - for (j = 0, len = ref.length; j < len; j++) { - clone = ref[j]; - clone.kill(file, index); - } - if (file) { - return; - } - ref1 = Get.allQuotelinksLinkingTo(this); - for (k = 0, len1 = ref1.length; k < len1; k++) { - quotelink = ref1[k]; - if (!(!$.hasClass(quotelink, 'deadlink'))) { - continue; - } - $.add(quotelink, Post.deadMark.cloneNode(true)); - $.addClass(quotelink, 'deadlink'); - } - }; - - Post.prototype.resurrect = function() { - var clone, j, k, len, len1, quotelink, ref, ref1, strong; - this.isDead = false; - $.rmClass(this.nodes.root, 'deleted-post'); - strong = $('strong.warning', this.nodes.info); - if (this.files.some(function(file) { - return file.isDead; - })) { - $.addClass(this.nodes.root, 'deleted-file'); - strong.textContent = '[File deleted]'; - } else { - $.rm(strong); - } - if (this.isClone) { - return; - } - ref = this.clones; - for (j = 0, len = ref.length; j < len; j++) { - clone = ref[j]; - clone.resurrect(); - } - ref1 = Get.allQuotelinksLinkingTo(this); - for (k = 0, len1 = ref1.length; k < len1; k++) { - quotelink = ref1[k]; - if (!($.hasClass(quotelink, 'deadlink'))) { - continue; - } - $.rm($('.qmark-dead', quotelink)); - $.rmClass(quotelink, 'deadlink'); - } - }; - - Post.prototype.collect = function() { - g.posts.rm(this.fullID); - this.thread.posts.rm(this); - return this.board.posts.rm(this); - }; - - Post.prototype.addClone = function(context, contractThumb) { - Callbacks.Post.execute(this); - return new Post.Clone(this, context, contractThumb); - }; - - Post.prototype.rmClone = function(index) { - var clone, j, len, ref; - this.clones.splice(index, 1); - ref = this.clones.slice(index); - for (j = 0, len = ref.length; j < len; j++) { - clone = ref[j]; - clone.nodes.root.dataset.clone = index++; - } - }; - - Post.prototype.setCatalogOP = function(isCatalogOP) { - this.nodes.root.classList.toggle('catalog-container', isCatalogOP); - this.nodes.root.classList.toggle('opContainer', !isCatalogOP); - this.nodes.post.classList.toggle('catalog-post', isCatalogOP); - this.nodes.post.classList.toggle('op', !isCatalogOP); - return this.nodes.post.style.left = this.nodes.post.style.right = null; - }; - - return Post; - - })(); - - return Post; - -}).call(this); - -(function() { - var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty, - slice = [].slice; - - Post.Clone = (function(superClass) { - extend(_Class, superClass); - - _Class.prototype.isClone = true; - - function _Class() { - var that; - that = Object.create(Post.Clone.prototype); - that.construct.apply(that, arguments); - return that; - } - - _Class.prototype.construct = function(origin, context, contractThumb) { - var base, file, fileRoot, fileRoots, i, inline, inlined, j, k, key, l, len, len1, len2, len3, len4, m, node, nodes, originFile, ref, ref1, ref2, ref3, ref4, ref5, ref6, root, selector, val; - this.origin = origin; - this.context = context; - ref = ['ID', 'postID', 'threadID', 'boardID', 'siteID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply']; - for (i = 0, len = ref.length; i < len; i++) { - key = ref[i]; - this[key] = this.origin[key]; - } - nodes = this.origin.nodes; - root = contractThumb ? this.cloneWithoutVideo(nodes.root) : nodes.root.cloneNode(true); - (base = Post.Clone).suffix || (base.suffix = 0); - ref1 = [root].concat(slice.call($$('[id]', root))); - for (j = 0, len1 = ref1.length; j < len1; j++) { - node = ref1[j]; - node.id += "_" + Post.Clone.suffix; - } - Post.Clone.suffix++; - ref2 = $$('.inline', root); - for (k = 0, len2 = ref2.length; k < len2; k++) { - inline = ref2[k]; - $.rm(inline); - } - ref3 = $$('.inlined', root); - for (l = 0, len3 = ref3.length; l < len3; l++) { - inlined = ref3[l]; - $.rmClass(inlined, 'inlined'); - } - this.nodes = this.parseNodes(root); - root.hidden = false; - $.rmClass(root, 'forwarded'); - $.rmClass(this.nodes.post, 'highlight'); - if (!this.isReply) { - this.setCatalogOP(false); - $.rm($('.catalog-link', this.nodes.post)); - $.rm($('.catalog-stats', this.nodes.post)); - $.rm($('.catalog-replies', this.nodes.post)); - } - this.parseQuotes(); - this.quotes = slice.call(this.origin.quotes); - this.files = []; - if (this.origin.files.length) { - fileRoots = this.fileRoots(); - } - ref4 = this.origin.files; - for (m = 0, len4 = ref4.length; m < len4; m++) { - originFile = ref4[m]; - file = {}; - for (key in originFile) { - val = originFile[key]; - file[key] = val; - } - fileRoot = fileRoots[file.docIndex]; - ref5 = g.SITE.selectors.file; - for (key in ref5) { - selector = ref5[key]; - file[key] = $(selector, fileRoot); - } - file.thumbLink = (ref6 = file.thumb) != null ? ref6.parentNode : void 0; - if (file.thumbLink) { - file.fullImage = $('.full-image', file.thumbLink); - } - file.videoControls = $('.video-controls', file.text); - if (file.videoThumb) { - file.thumb.muted = true; - } - this.files.push(file); - } - if (this.files.length) { - this.file = this.files[0]; - if (this.file.thumb && contractThumb) { - ImageExpand.contract(this); - } - } - if (this.origin.isDead) { - this.isDead = true; - } - return root.dataset.clone = this.origin.clones.push(this) - 1; - }; - - _Class.prototype.cloneWithoutVideo = function(node) { - var child, clone, i, len, ref; - if (node.tagName === 'VIDEO' && !node.dataset.md5) { - return []; - } else if (node.nodeType === Node.ELEMENT_NODE && $('video', node)) { - clone = node.cloneNode(false); - ref = node.childNodes; - for (i = 0, len = ref.length; i < len; i++) { - child = ref[i]; - $.add(clone, this.cloneWithoutVideo(child)); - } - return clone; - } else { - return node.cloneNode(true); - } - }; - - return _Class; - - })(Post); - -}).call(this); - -RandomAccessList = (function() { - var RandomAccessList; - - RandomAccessList = (function() { - function RandomAccessList(items) { - var i, item, len; - this.length = 0; - if (items) { - for (i = 0, len = items.length; i < len; i++) { - item = items[i]; - this.push(item); - } - } - } - - RandomAccessList.prototype.push = function(data) { - var ID, item, last; - ID = data.ID; - ID || (ID = data.id); - if (this[ID]) { - return; - } - last = this.last; - this[ID] = item = { - prev: last, - next: null, - data: data, - ID: ID - }; - item.prev = last; - this.last = last ? last.next = item : this.first = item; - return this.length++; - }; - - RandomAccessList.prototype.before = function(root, item) { - var prev; - if (item.next === root || item === root) { - return; - } - this.rmi(item); - prev = root.prev; - root.prev = item; - item.next = root; - item.prev = prev; - if (prev) { - return prev.next = item; - } else { - return this.first = item; - } - }; - - RandomAccessList.prototype.after = function(root, item) { - var next; - if (item.prev === root || item === root) { - return; - } - this.rmi(item); - next = root.next; - root.next = item; - item.prev = root; - item.next = next; - if (next) { - return next.prev = item; - } else { - return this.last = item; - } - }; - - RandomAccessList.prototype.prepend = function(item) { - var first; - first = this.first; - if (item === first || !this[item.ID]) { - return; - } - this.rmi(item); - item.next = first; - if (first) { - first.prev = item; - } else { - this.last = item; - } - this.first = item; - return delete item.prev; - }; - - RandomAccessList.prototype.shift = function() { - return this.rm(this.first.ID); - }; - - RandomAccessList.prototype.order = function() { - var item, order; - order = [item = this.first]; - while (item = item.next) { - order.push(item); - } - return order; - }; - - RandomAccessList.prototype.rm = function(ID) { - var item; - item = this[ID]; - if (!item) { - return; - } - delete this[ID]; - this.length--; - this.rmi(item); - delete item.next; - return delete item.prev; - }; - - RandomAccessList.prototype.rmi = function(item) { - var next, prev; - prev = item.prev, next = item.next; - if (prev) { - prev.next = next; - } else { - this.first = next; - } - if (next) { - return next.prev = prev; - } else { - return this.last = prev; - } - }; - - return RandomAccessList; - - })(); - - return RandomAccessList; - -}).call(this); - -ShimSet = (function() { - var ShimSet; - - ShimSet = (function() { - function ShimSet() { - this.elements = $.dict(); - this.size = 0; - } - - ShimSet.prototype.has = function(value) { - return value in this.elements; - }; - - ShimSet.prototype.add = function(value) { - if (this.elements[value]) { - return; - } - this.elements[value] = true; - return this.size++; - }; - - ShimSet.prototype["delete"] = function(value) { - if (!this.elements[value]) { - return; - } - delete this.elements[value]; - return this.size--; - }; - - return ShimSet; - - })(); - - if (!('Set' in window)) { - window.Set = ShimSet; - } - - return ShimSet; - -}).call(this); - -SimpleDict = (function() { - var SimpleDict, - slice = [].slice; - - SimpleDict = (function() { - function SimpleDict() { - this.keys = []; - } - - SimpleDict.prototype.push = function(key, data) { - key = "" + key; - if (!this[key]) { - this.keys.push(key); - } - return this[key] = data; - }; - - SimpleDict.prototype.rm = function(key) { - var i; - key = "" + key; - if ((i = this.keys.indexOf(key)) !== -1) { - this.keys.splice(i, 1); - return delete this[key]; - } - }; - - SimpleDict.prototype.forEach = function(fn) { - var j, key, len, ref; - ref = slice.call(this.keys); - for (j = 0, len = ref.length; j < len; j++) { - key = ref[j]; - fn(this[key]); - } - }; - - SimpleDict.prototype.get = function(key) { - if (key === 'keys') { - return void 0; - } else { - return $.getOwn(this, key); - } - }; - - return SimpleDict; - - })(); - - return SimpleDict; - -}).call(this); - -Thread = (function() { - var Thread; - - Thread = (function() { - Thread.prototype.toString = function() { - return this.ID; - }; - - function Thread(ID, board) { - this.board = board; - this.ID = +ID; - this.threadID = this.ID; - this.boardID = this.board.ID; - this.siteID = g.SITE.ID; - this.fullID = this.board + "." + this.ID; - this.posts = new SimpleDict(); - this.isDead = false; - this.isHidden = false; - this.isSticky = false; - this.isClosed = false; - this.isArchived = false; - this.postLimit = false; - this.fileLimit = false; - this.lastPost = 0; - this.ipCount = void 0; - this.json = null; - this.OP = null; - this.catalogView = null; - this.nodes = { - root: null - }; - this.board.threads.push(this.ID, this); - g.threads.push(this.fullID, this); - } - - Thread.prototype.setPage = function(pageNum) { - var icon, info, ref, reply; - ref = this.OP.nodes, info = ref.info, reply = ref.reply; - if (!(icon = $('.page-num', info))) { - icon = $.el('span', { - className: 'page-num' - }); - $.replace(reply.parentNode.previousSibling, [$.tn(' '), icon, $.tn(' ')]); - } - icon.title = "This thread is on page " + pageNum + " in the original index."; - icon.textContent = "[" + pageNum + "]"; - if (this.catalogView) { - return this.catalogView.nodes.pageCount.textContent = pageNum; - } - }; - - Thread.prototype.setCount = function(type, count, reachedLimit) { - var el; - if (!this.catalogView) { - return; - } - el = this.catalogView.nodes[type + "Count"]; - el.textContent = count; - return (reachedLimit ? $.addClass : $.rmClass)(el, 'warning'); - }; - - Thread.prototype.setStatus = function(type, status) { - var name; - name = "is" + type; - if (this[name] === status) { - return; - } - this[name] = status; - if (!this.OP) { - return; - } - this.setIcon('Sticky', this.isSticky); - this.setIcon('Closed', this.isClosed && !this.isArchived); - return this.setIcon('Archived', this.isArchived); - }; - - Thread.prototype.setIcon = function(type, status) { - var icon, root, typeLC; - typeLC = type.toLowerCase(); - icon = $("." + typeLC + "Icon", this.OP.nodes.info); - if (!!icon === status) { - return; - } - if (!status) { - $.rm(icon.previousSibling); - $.rm(icon); - if (this.catalogView) { - $.rm($("." + typeLC + "Icon", this.catalogView.nodes.icons)); - } - return; - } - icon = $.el('img', { - src: "" + g.SITE.Build.staticPath + typeLC + g.SITE.Build.gifIcon, - alt: type, - title: type, - className: typeLC + "Icon retina" - }); - if (g.BOARD.ID === 'f') { - icon.style.cssText = 'height: 18px; width: 18px;'; - } - root = type !== 'Sticky' && this.isSticky ? $('.stickyIcon', this.OP.nodes.info) : $('.page-num', this.OP.nodes.info) || this.OP.nodes.quote; - $.after(root, [$.tn(' '), icon]); - if (!this.catalogView) { - return; - } - return (type === 'Sticky' && this.isClosed ? $.prepend : $.add)(this.catalogView.nodes.icons, icon.cloneNode()); - }; - - Thread.prototype.kill = function() { - return this.isDead = true; - }; - - Thread.prototype.collect = function() { - var n; - n = 0; - this.posts.forEach(function(post) { - if (post.clones.length) { - return n++; - } else { - return post.collect(); - } - }); - if (!n) { - g.threads.rm(this.fullID); - return this.board.threads.rm(this); - } - }; - - return Thread; - - })(); - - return Thread; - -}).call(this); - -SW = {}; - -(function() { - var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - SW.tinyboard = { - isOPContainerThread: true, - mayLackJSON: true, - threadModTimeIgnoresSage: true, - disabledFeatures: ['Resurrect Quotes', 'Quick Reply Personas', 'Quick Reply', 'Cooldown', 'Report Link', 'Delete Link', 'Edit Link', 'Quote Inlining', 'Quote Previewing', 'Quote Backlinks', 'File Info Formatting', 'Image Expansion', 'Image Expansion (Menu)', 'Comment Expansion', 'Thread Expansion', 'Favicon', 'Quote Threading', 'Thread Updater', 'Banner', 'Flash Features', 'Reply Pruning'], - detect: function() { - var j, len, m, properties, ref, root, script; - ref = $$('script:not([src])', d.head); - for (j = 0, len = ref.length; j < len; j++) { - script = ref[j]; - if ((m = script.textContent.match(/\bvar configRoot=(".*?")/))) { - properties = $.dict(); - try { - root = JSON.parse(m[1]); - if (root[0] === '/') { - properties.root = location.origin + root; - } else if (/^https?:/.test(root)) { - properties.root = root; - } - } catch (error) {} - return properties; - } - } - return false; - }, - awaitBoard: function(cb) { - var reactUI, s; - if ((reactUI = $.id('react-ui'))) { - s = this.selectors = Object.create(this.selectors); - s.boardFor = { - index: '.page-container' - }; - s.thread = 'div[id^="thread_"]'; - return Main.mounted(cb); - } else { - return cb(); - } - }, - urls: { - thread: function(arg, isArchived) { - var boardID, ref, siteID, threadID; - siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID; - return "" + (((ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0) || ("http://" + siteID + "/")) + boardID + "/" + (isArchived ? 'archive/' : '') + "res/" + threadID + ".html"; - }, - post: function(arg) { - var postID; - postID = arg.postID; - return "#" + postID; - }, - index: function(arg) { - var boardID, ref, siteID; - siteID = arg.siteID, boardID = arg.boardID; - return "" + (((ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0) || ("http://" + siteID + "/")) + boardID + "/"; - }, - catalog: function(arg) { - var boardID, ref, siteID; - siteID = arg.siteID, boardID = arg.boardID; - return "" + (((ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0) || ("http://" + siteID + "/")) + boardID + "/catalog.html"; - }, - threadJSON: function(arg, isArchived) { - var boardID, ref, root, siteID, threadID; - siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID; - root = (ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0; - if (root) { - return "" + root + boardID + "/" + (isArchived ? 'archive/' : '') + "res/" + threadID + ".json"; - } else { - return ''; - } - }, - archivedThreadJSON: function(thread) { - return SW.tinyboard.urls.threadJSON(thread, true); - }, - threadsListJSON: function(arg) { - var boardID, ref, root, siteID; - siteID = arg.siteID, boardID = arg.boardID; - root = (ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0; - if (root) { - return "" + root + boardID + "/threads.json"; - } else { - return ''; - } - }, - archiveListJSON: function(arg) { - var boardID, ref, root, siteID; - siteID = arg.siteID, boardID = arg.boardID; - root = (ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0; - if (root) { - return "" + root + boardID + "/archive/archive.json"; - } else { - return ''; - } - }, - catalogJSON: function(arg) { - var boardID, ref, root, siteID; - siteID = arg.siteID, boardID = arg.boardID; - root = (ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0; - if (root) { - return "" + root + boardID + "/catalog.json"; - } else { - return ''; - } - }, - file: function(arg, filename) { - var boardID, ref, siteID; - siteID = arg.siteID, boardID = arg.boardID; - return "" + (((ref = Conf['siteProperties'][siteID]) != null ? ref.root : void 0) || ("http://" + siteID + "/")) + boardID + "/" + filename; - }, - thumb: function(board, filename) { - return SW.tinyboard.urls.file(board, filename); - } - }, - selectors: { - board: 'form[name="postcontrols"]', - thread: 'input[name="board"] ~ div[id^="thread_"]', - threadDivider: 'div[id^="thread_"] > hr:last-child', - summary: '.omitted', - postContainer: 'div[id^="reply_"]:not(.hidden)', - opBottom: '.op', - replyOriginal: 'div[id^="reply_"]:not(.hidden)', - infoRoot: '.intro', - info: { - subject: '.subject', - name: '.name', - email: '.email', - tripcode: '.trip', - uniqueID: '.poster_id', - capcode: '.capcode', - flag: '.flag', - date: 'time', - nameBlock: 'label', - quote: 'a[href*="#q"]', - reply: 'a[href*="/res/"]:not([href*="#"])' - }, - icons: { - isSticky: '.fa-thumb-tack', - isClosed: '.fa-lock' - }, - file: { - text: '.fileinfo', - link: '.fileinfo > a', - thumb: 'a > .post-image' - }, - thumbLink: '.file > a', - multifile: '.files > .file', - highlightable: { - op: ' > .op', - reply: '.reply', - catalog: ' > .thread' - }, - comment: '.body', - spoiler: '.spoiler', - quotelink: 'a[onclick*="highlightReply("]', - catalog: { - board: '#Grid', - thread: '.mix', - thumb: '.thread-image' - }, - boardList: '.boardlist', - boardListBottom: '.boardlist.bottom', - styleSheet: '#stylesheet', - psa: '.blotter', - nav: { - prev: '.pages > form > [value=Previous]', - next: '.pages > form > [value=Next]' - } - }, - classes: { - highlight: 'highlighted' - }, - xpath: { - thread: 'div[starts-with(@id,"thread_")]', - postContainer: 'div[starts-with(@id,"reply_") or starts-with(@id,"thread_")]', - replyContainer: 'div[starts-with(@id,"reply_")]' - }, - regexp: { - quotelink: /\/([^\/]+)\/res\/(\d+)(?:\.\w+)?#(\d+)$/, - quotelinkHTML: /]*\bhref="[^"]*\/([^\/]+)\/res\/(\d+)(?:\.\w+)?#(\d+)"/g - }, - Build: { - parseJSON: function(data, board) { - var extra_file, file, i, j, len, o, ref; - o = SW.yotsuba.Build.parseJSON(data, board); - if (data.ext === 'deleted') { - delete o.file; - $.extend(o, { - files: [], - fileDeleted: true, - filesDeleted: [0] - }); - } - if (data.extra_files) { - ref = data.extra_files; - for (i = j = 0, len = ref.length; j < len; i = ++j) { - extra_file = ref[i]; - if (extra_file.ext === 'deleted') { - o.filesDeleted.push(i); - } else { - file = SW.yotsuba.Build.parseJSONFile(data, board); - o.files.push(file); - } - } - if (o.files.length) { - o.file = o.files[0]; - } - } - return o; - }, - parseComment: function(html) { - html = html.replace(//gi, '\n').replace(/<[^>]*>/g, ''); - return $.unescape(html); - } - }, - bgColoredEl: function() { - return $.el('div', { - className: 'post reply' - }); - }, - isFileURL: function(url) { - return /\/src\/[^\/]+/.test(url.pathname); - }, - preParsingFixes: function(board) { - var broken; - if ((broken = $('a > input[name="board"]', board))) { - return $.before(broken.parentNode, broken); - } - }, - parseNodes: function(post, nodes) { - var m, nextSibling, node, text, uniqueID; - if (nodes.uniqueID) { - return; - } - text = ''; - node = nodes.nameBlock.nextSibling; - while (node && node.nodeType === 3) { - text += node.textContent; - node = node.nextSibling; - } - if ((m = text.match(/(\s*ID:\s*)(\S+)/))) { - nodes.info.normalize(); - nextSibling = nodes.nameBlock.nextSibling; - nextSibling = nextSibling.splitText(m[1].length); - nextSibling.splitText(m[2].length); - nodes.uniqueID = uniqueID = $.el('span', { - className: 'poster_id' - }); - $.replace(nextSibling, uniqueID); - return $.add(uniqueID, nextSibling); - } - }, - parseDate: function(node) { - var date, ref; - date = Date.parse((ref = node.getAttribute('datetime')) != null ? ref.trim() : void 0); - if (!isNaN(date)) { - return new Date(date); - } - date = Date.parse(node.textContent.trim() + ' UTC'); - if (!isNaN(date)) { - return new Date(date); - } - return void 0; - }, - parseFile: function(post, file) { - var info, infoNode, link, nameNode, ref, ref1, text, thumb; - text = file.text, link = file.link, thumb = file.thumb; - if ($.x("ancestor::" + this.xpath.postContainer + "[1]", text) !== post.nodes.root) { - return false; - } - if (!(infoNode = indexOf.call((ref = link.nextSibling) != null ? ref.textContent : void 0, '(') >= 0 ? link.nextSibling : link.nextElementSibling)) { - return false; - } - if (!(info = infoNode.textContent.match(/\((.*,\s*)?([\d.]+ ?[KMG]?B).*\)/))) { - return false; - } - nameNode = $('.postfilename', text); - $.extend(file, { - name: nameNode ? nameNode.title || nameNode.textContent : link.pathname.match(/[^\/]*$/)[0], - size: info[2], - dimensions: (ref1 = info[0].match(/\d+x\d+/)) != null ? ref1[0] : void 0 - }); - if (thumb) { - $.extend(file, { - thumbURL: /\/static\//.test(thumb.src) && $.isImage(link.href) ? link.href : thumb.src, - isSpoiler: /^Spoiler/i.test(info[1] || '') || link.textContent === 'Spoiler Image' - }); - } - return true; - }, - isThumbExpanded: function(file) { - return $.hasClass(file.thumb.parentNode, 'expanded') || file.thumb.parentNode.dataset.expanded === 'true'; - }, - isLinkified: function(link) { - return /\bnofollow\b/.test(link.rel); - }, - catalogPin: function(threadRoot) { - return threadRoot.dataset.sticky = 'true'; - } - }; - -}).call(this); - -(function() { - var slice = [].slice; - - SW.yotsuba = { - isOPContainerThread: false, - hasIPCount: true, - archivedBoardsKnown: true, - urls: { - thread: function(arg) { - var boardID, threadID; - boardID = arg.boardID, threadID = arg.threadID; - return location.protocol + "//" + (BoardConfig.domain(boardID)) + "/" + boardID + "/thread/" + threadID; - }, - post: function(arg) { - var postID; - postID = arg.postID; - return "#p" + postID; - }, - index: function(arg) { - var boardID; - boardID = arg.boardID; - return location.protocol + "//" + (BoardConfig.domain(boardID)) + "/" + boardID + "/"; - }, - catalog: function(arg) { - var boardID; - boardID = arg.boardID; - if (boardID === 'f') { - return void 0; - } else { - return location.protocol + "//" + (BoardConfig.domain(boardID)) + "/" + boardID + "/catalog"; - } - }, - archive: function(arg) { - var boardID; - boardID = arg.boardID; - if (BoardConfig.isArchived(boardID)) { - return location.protocol + "//" + (BoardConfig.domain(boardID)) + "/" + boardID + "/archive"; - } else { - return void 0; - } - }, - threadJSON: function(arg) { - var boardID, threadID; - boardID = arg.boardID, threadID = arg.threadID; - return location.protocol + "//a.4cdn.org/" + boardID + "/thread/" + threadID + ".json"; - }, - threadsListJSON: function(arg) { - var boardID; - boardID = arg.boardID; - return location.protocol + "//a.4cdn.org/" + boardID + "/threads.json"; - }, - archiveListJSON: function(arg) { - var boardID; - boardID = arg.boardID; - if (BoardConfig.isArchived(boardID)) { - return location.protocol + "//a.4cdn.org/" + boardID + "/archive.json"; - } else { - return ''; - } - }, - catalogJSON: function(arg) { - var boardID; - boardID = arg.boardID; - return location.protocol + "//a.4cdn.org/" + boardID + "/catalog.json"; - }, - file: function(arg, filename) { - var boardID, hostname; - boardID = arg.boardID; - hostname = boardID === 'f' ? ImageHost.flashHost() : ImageHost.host(); - return location.protocol + "//" + hostname + "/" + boardID + "/" + filename; - }, - thumb: function(arg, filename) { - var boardID; - boardID = arg.boardID; - return location.protocol + "//" + (ImageHost.thumbHost()) + "/" + boardID + "/" + filename; - } - }, - isPrunedByAge: function(arg) { - var boardID; - boardID = arg.boardID; - return boardID === 'f'; - }, - areMD5sDeferred: function(arg) { - var boardID; - boardID = arg.boardID; - return boardID === 'f'; - }, - isOnePage: function(arg) { - var boardID; - boardID = arg.boardID; - return boardID === 'f'; - }, - noAudio: function(arg) { - var boardID; - boardID = arg.boardID; - return BoardConfig.noAudio(boardID); - }, - selectors: { - board: '.board', - thread: '.thread', - threadDivider: '.board > hr', - summary: '.summary', - postContainer: '.postContainer', - replyOriginal: '.replyContainer:not([data-clone])', - sideArrows: 'div.sideArrows', - post: '.post', - infoRoot: '.postInfo', - info: { - subject: '.subject', - name: '.name', - email: '.useremail', - tripcode: '.postertrip', - uniqueIDRoot: '.posteruid', - uniqueID: '.posteruid > .hand', - capcode: '.capcode.hand', - pass: '.n-pu', - flag: '.flag, .bfl', - date: '.dateTime', - nameBlock: '.nameBlock', - quote: '.postNum > a:nth-of-type(2)', - reply: '.replylink' - }, - icons: { - isSticky: '.stickyIcon', - isClosed: '.closedIcon', - isArchived: '.archivedIcon' - }, - file: { - text: '.file > :first-child', - link: '.fileText > a', - thumb: 'a.fileThumb > [data-md5]' - }, - thumbLink: 'a.fileThumb', - highlightable: { - op: '.opContainer', - reply: ' > .reply', - catalog: '' - }, - comment: '.postMessage', - spoiler: 's', - quotelink: ':not(pre) > .quotelink', - catalog: { - board: '#threads', - thread: '.thread', - thumb: '.thumb' - }, - boardList: '#boardNavDesktop > .boardList', - boardListBottom: '#boardNavDesktopFoot > .boardList', - styleSheet: 'link[title=switch]', - psa: '#globalMessage', - psaTop: '#globalToggle', - searchBox: '#search-box', - nav: { - prev: '.prev > form > [type=submit]', - next: '.next > form > [type=submit]' - } - }, - classes: { - highlight: 'highlight' - }, - xpath: { - thread: 'div[contains(concat(" ",@class," ")," thread ")]', - postContainer: 'div[contains(@class,"postContainer")]', - replyContainer: 'div[contains(@class,"replyContainer")]' - }, - regexp: { - quotelink: /^https?:\/\/boards\.4chan(?:nel)?\.org\/+([^\/]+)\/+thread\/+(\d+)(?:[\/?][^#]*)?(?:#p(\d+))?$/, - quotelinkHTML: /]*\bhref="(?:(?:\/\/boards\.4chan(?:nel)?\.org)?\/([^\/]+)\/thread\/)?(\d+)?(?:#p(\d+))?"/g, - pass: /^https?:\/\/www\.4chan(?:nel)?\.org\/+pass(?:$|[?#])/, - captcha: /^https?:\/\/sys\.4chan(?:nel)?\.org\/+captcha(?:$|[?#])/ - }, - bgColoredEl: function() { - return $.el('div', { - className: 'reply' - }); - }, - isThisPageLegit: function() { - var ref, ref1; - return ((ref = location.hostname) === 'boards.4chan.org' || ref === 'boards.4channel.org') && d.doctype && !$('link[href*="favicon-status.ico"]', d.head) && ((ref1 = d.title) !== '4chan - Temporarily Offline' && ref1 !== '4chan - Error' && ref1 !== '504 Gateway Time-out' && ref1 !== 'MathJax Equation Source'); - }, - is404: function() { - var ref; - return ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') || (g.VIEW === 'thread' && $('.board') && !$('.opContainer')); - }, - isIncomplete: function() { - var ref; - return ((ref = g.VIEW) === 'index' || ref === 'thread') && !$('.board + *'); - }, - isBoardlessPage: function(url) { - var ref; - return (ref = url.hostname) === 'www.4chan.org' || ref === 'www.4channel.org'; - }, - isAuxiliaryPage: function(url) { - var ref; - return (ref = url.hostname) !== 'boards.4chan.org' && ref !== 'boards.4channel.org'; - }, - isFileURL: function(url) { - return ImageHost.test(url.hostname); - }, - initAuxiliary: function() { - var match, pathname; - switch (location.hostname) { - case 'www.4chan.org': - case 'www.4channel.org': - if (SW.yotsuba.regexp.pass.test(location.href)) { - PassMessage.init(); - } else { - $.onExists(doc, 'body', function() { - return $.addStyle(CSS.www); - }); - Captcha.replace.init(); - } - break; - case 'sys.4chan.org': - case 'sys.4channel.org': - pathname = location.pathname.split(/\/+/); - if (pathname[2] === 'imgboard.php') { - if (/\bmode=report\b/.test(location.search)) { - Report.init(); - } else if ((match = location.search.match(/\bres=(\d+)/))) { - $.ready(function() { - var ref; - if (Conf['404 Redirect'] && ((ref = $.id('errmsg')) != null ? ref.textContent : void 0) === 'Error: Specified thread does not exist.') { - return Redirect.navigate('thread', { - boardID: g.BOARD.ID, - postID: +match[1] - }); - } - }); - } - } else if (pathname[2] === 'post') { - PostSuccessful.init(); - } - } - }, - scriptData: function() { - var j, len, ref, script; - ref = $$('script:not([src])', d.head); - for (j = 0, len = ref.length; j < len; j++) { - script = ref[j]; - if (/\bcooldowns *=/.test(script.textContent)) { - return script.textContent; - } - } - return ''; - }, - parseThreadMetadata: function(thread) { - var file, m, scriptData; - scriptData = this.scriptData(); - thread.postLimit = /\bbumplimit *= *1\b/.test(scriptData); - thread.fileLimit = /\bimagelimit *= *1\b/.test(scriptData); - thread.ipCount = (m = scriptData.match(/\bunique_ips *= *(\d+)\b/)) ? +m[1] : void 0; - if (g.BOARD.ID === 'f' && thread.OP.file) { - file = thread.OP.file; - return $.ajax(this.urls.threadJSON({ - boardID: 'f', - threadID: thread.ID - }), { - timeout: $.MINUTE, - onloadend: function() { - if (this.response) { - return file.text.dataset.md5 = file.MD5 = this.response.posts[0].md5; - } - } - }); - } - }, - parseNodes: function(post, nodes) { - var icon, j, len, ref, results, type; - if (post.boardID === 'f') { - ref = ['Sticky', 'Closed']; - results = []; - for (j = 0, len = ref.length; j < len; j++) { - type = ref[j]; - if ((icon = $("img[alt=" + type + "]", nodes.info))) { - results.push($.addClass(icon, (type.toLowerCase()) + "Icon", 'retina')); - } - } - return results; - } - }, - parseDate: function(node) { - return new Date(node.dataset.utc * 1000); - }, - parseFile: function(post, file) { - var info, link, m, ref, ref1, ref2, text, thumb; - text = file.text, link = file.link, thumb = file.thumb; - if (!(info = (ref = link.nextSibling) != null ? ref.textContent.match(/\(([\d.]+ [KMG]?B).*\)/) : void 0)) { - return false; - } - $.extend(file, { - name: text.title || link.title || link.textContent, - size: info[1], - dimensions: (ref1 = info[0].match(/\d+x\d+/)) != null ? ref1[0] : void 0, - tag: (ref2 = info[0].match(/,[^,]*, ([a-z]+)\)/i)) != null ? ref2[1] : void 0, - MD5: text.dataset.md5 - }); - if (thumb) { - $.extend(file, { - thumbURL: thumb.src, - MD5: thumb.dataset.md5, - isSpoiler: $.hasClass(thumb.parentNode, 'imgspoiler') - }); - if (file.isSpoiler) { - file.thumbURL = (m = link.href.match(/\d+(?=\.\w+$)/)) ? location.protocol + "//" + (ImageHost.thumbHost()) + "/" + post.board + "/" + m[0] + "s.jpg" : void 0; - } - } - return true; - }, - cleanComment: function(bq) { - var abbr, br, i, j, k, len, node, ref; - if ((abbr = $('.abbr', bq))) { - ref = $$('.abbr + br, .exif', bq); - for (j = 0, len = ref.length; j < len; j++) { - node = ref[j]; - $.rm(node); - } - for (i = k = 0; k < 2; i = ++k) { - if ((br = abbr.previousSibling) && br.nodeName === 'BR') { - $.rm(br); - } - } - return $.rm(abbr); - } - }, - cleanCommentDisplay: function(bq) { - var b; - if ((b = $('b', bq)) && /^Rolled /.test(b.textContent)) { - $.rm(b); - } - return $.rm($('.fortune', bq)); - }, - insertTags: function(bq) { - var j, k, len, len1, node, ref, ref1; - ref = $$('s, .removed-spoiler', bq); - for (j = 0, len = ref.length; j < len; j++) { - node = ref[j]; - $.replace(node, [$.tn('[spoiler]')].concat(slice.call(node.childNodes), [$.tn('[/spoiler]')])); - } - ref1 = $$('.prettyprint', bq); - for (k = 0, len1 = ref1.length; k < len1; k++) { - node = ref1[k]; - $.replace(node, [$.tn('[code]')].concat(slice.call(node.childNodes), [$.tn('[/code]')])); - } - }, - hasCORS: function(url) { - return url.split('/').slice(0, 3).join('/') === location.protocol + '//a.4cdn.org'; - }, - sfwBoards: function(sfw) { - return BoardConfig.sfwBoards(sfw); - }, - uidColor: function(uid) { - var i, msg; - msg = 0; - i = 0; - while (i < 8) { - msg = (msg << 5) - msg + uid.charCodeAt(i++); - } - return (msg >> 8) & 0xFFFFFF; - }, - isLinkified: function(link) { - return ImageHost.test(link.hostname); - }, - testNativeExtension: function() { - return $.global(function() { - if (window.Parser.postMenuIcon) { - return this.enabled = 'true'; - } - }); - }, - transformBoardList: function() { - var a, chr, i, items, j, len, node, nodes, ref, spacer, span; - nodes = []; - spacer = function() { - return $.el('span', { - className: 'spacer' - }); - }; - items = $.X('.//a|.//text()[not(ancestor::a)]', $(SW.yotsuba.selectors.boardList)); - i = 0; - while (node = items.snapshotItem(i++)) { - switch (node.nodeName) { - case '#text': - ref = node.nodeValue; - for (j = 0, len = ref.length; j < len; j++) { - chr = ref[j]; - span = $.el('span', { - textContent: chr - }); - if (chr === ' ') { - span.className = 'space'; - } - if (chr === ']') { - nodes.push(spacer()); - } - nodes.push(span); - if (chr === '[') { - nodes.push(spacer()); - } - } - break; - case 'A': - a = node.cloneNode(true); - nodes.push(a); - } - } - return nodes; - } - }; - -}).call(this); - -(function() { - var Build, - slice = [].slice; - - Build = { - staticPath: '//s.4cdn.org/image/', - gifIcon: window.devicePixelRatio >= 2 ? '@2x.gif' : '.gif', - spoilerRange: $.dict(), - shortFilename: function(filename) { - var ext; - ext = filename.match(/\.?[^\.]*$/)[0]; - if (filename.length - ext.length > 30) { - return (filename.match(/(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[^]){0,25}/)[0]) + "(...)" + ext; - } else { - return filename; - } - }, - spoilerThumb: function(boardID) { - var spoilerRange; - if (spoilerRange = Build.spoilerRange[boardID]) { - return Build.staticPath + "spoiler-" + boardID + (Math.floor(1 + spoilerRange * Math.random())) + ".png"; - } else { - return Build.staticPath + "spoiler.png"; - } - }, - sameThread: function(boardID, threadID) { - return g.VIEW === 'thread' && g.BOARD.ID === boardID && g.THREADID === +threadID; - }, - threadURL: function(boardID, threadID) { - if (boardID !== g.BOARD.ID) { - return "//" + (BoardConfig.domain(boardID)) + "/" + boardID + "/thread/" + threadID; - } else if (g.VIEW !== 'thread' || +threadID !== g.THREADID) { - return "/" + boardID + "/thread/" + threadID; - } else { - return ''; - } - }, - postURL: function(boardID, threadID, postID) { - return (Build.threadURL(boardID, threadID)) + "#p" + postID; - }, - parseJSON: function(data, arg) { - var boardID, key, o, siteID; - siteID = arg.siteID, boardID = arg.boardID; - o = { - ID: data.no, - postID: data.no, - threadID: data.resto || data.no, - boardID: boardID, - siteID: siteID, - isReply: !!data.resto, - isSticky: !!data.sticky, - isClosed: !!data.closed, - isArchived: !!data.archived, - fileDeleted: !!data.filedeleted, - filesDeleted: data.filedeleted ? [0] : [] - }; - o.info = { - subject: $.unescape(data.sub), - email: $.unescape(data.email), - name: $.unescape(data.name) || '', - tripcode: data.trip, - pass: data.since4pass != null ? "" + data.since4pass : void 0, - uniqueID: data.id, - flagCode: data.country, - flagCodeTroll: data.board_flag, - flag: $.unescape(data.country_name || data.flag_name), - dateUTC: data.time, - dateText: data.now, - commentHTML: { - innerHTML: data.com || '' - } - }; - if (data.capcode) { - o.info.capcode = data.capcode.replace(/_highlight$/, '').replace(/_/g, ' ').replace(/\b\w/g, function(c) { - return c.toUpperCase(); - }); - o.capcodeHighlight = /_highlight$/.test(data.capcode); - delete o.info.uniqueID; - } - o.files = []; - if (data.ext) { - o.file = SW.yotsuba.Build.parseJSONFile(data, { - siteID: siteID, - boardID: boardID - }); - o.files.push(o.file); - } - o.extra = $.dict(); - for (key in data) { - if (key[0] === 'x') { - o.extra[key] = data[key]; - } - } - return o; - }, - parseJSONFile: function(data, arg) { - var boardID, filename, o, site, siteID; - siteID = arg.siteID, boardID = arg.boardID; - site = g.sites[siteID]; - filename = site.software === 'yotsuba' && boardID === 'f' ? "" + (encodeURIComponent(data.filename)) + data.ext : "" + data.tim + data.ext; - o = { - name: ($.unescape(data.filename)) + data.ext, - url: site.urls.file({ - siteID: siteID, - boardID: boardID - }, filename), - height: data.h, - width: data.w, - MD5: data.md5, - size: $.bytesToString(data.fsize), - thumbURL: site.urls.thumb({ - siteID: siteID, - boardID: boardID - }, data.tim + "s.jpg"), - theight: data.tn_h, - twidth: data.tn_w, - isSpoiler: !!data.spoiler, - tag: data.tag, - hasDownscale: !!data.m_img - }; - if ((data.h != null) && !/\.pdf$/.test(o.url)) { - o.dimensions = o.width + "x" + o.height; - } - return o; - }, - parseComment: function(html) { - html = html.replace(//gi, '\n').replace(/\n\n]*>/g, ''); - return $.unescape(html); - }, - parseCommentDisplay: function(html) { - var html2; - if (!(Conf['Remove Spoilers'] || Conf['Reveal Spoilers'])) { - while ((html2 = html.replace(/(?:(?!<\/?s>).)*<\/s>/g, '[spoiler]')) !== html) { - html = html2; - } - } - html = html.replace(/^Rolled [^<]*<\/b>/i, '').replace(/ " + ((!o.isReply || boardID === "f" || subject) ? "" + E(subject || "") + " " : "") + "" + ((email) ? "" : "") + "" + E(name) + "" + ((tripcode) ? " " + E(tripcode) + "" : "") + ((pass) ? " " : "") + ((capcode) ? " ## " + E(capcode) + "" : "") + ((email) ? "" : "") + ((boardID === "f" && !o.isReply || capcodeDescription) ? "" : " ") + ((capcodeDescription) ? " \""" : "") + ((uniqueID && !capcode) ? " (ID: " + E(uniqueID) + ")" : "") + ((flagCode) ? " " : "") + ((flagCodeTroll) ? " " : "") + "
      " + E(dateText) + " No." + E(ID) + "" + ((o.isSticky) ? " \"Sticky\"" : "") + ((o.isClosed && !o.isArchived) ? " \"Closed\"" : "") + ((o.isArchived) ? " \"Archived\"" : "") + ((!o.isReply && g.VIEW === "index") ? "   [Reply]" : "") + ""}; - - /* File Info */ - if (file) { - protocol = /^https?:(?=\/\/i\.4cdn\.org\/)/; - fileURL = file.url.replace(protocol, ''); - shortFilename = Build.shortFilename(file.name); - fileThumb = file.isSpoiler ? Build.spoilerThumb(boardID) : file.thumbURL.replace(protocol, ''); - } - fileBlock = {innerHTML: ((file) ? "
      " + ((boardID === "f") ? "
      File: " + E(file.name) + "-(" + E(file.size) + ", " + E(file.dimensions) + ((file.tag) ? ", " + E(file.tag) : "") + ")
      " : "
      File: " + ((file.isSpoiler) ? "Spoiler Image" : E(shortFilename)) + " (" + E(file.size) + ", " + E(file.dimensions || "PDF") + ")
      \""") + "
      " : ((o.fileDeleted) ? "
      \"File
      " : ""))}; - - /* Whole Post */ - postClass = o.isReply ? 'reply' : 'op'; - wholePost = {innerHTML: ((o.isReply) ? "
      >>
      " : "") + "
      " + ((o.isReply) ? (postInfo).innerHTML + (fileBlock).innerHTML : (fileBlock).innerHTML + (postInfo).innerHTML) + "
      " + (commentHTML).innerHTML + "
      "}; - container = $.el('div', { - className: "postContainer " + postClass + "Container", - id: "pc" + ID - }); - $.extend(container, wholePost); - ref1 = $$('.quotelink', container); - for (i = 0, len = ref1.length; i < len; i++) { - quote = ref1[i]; - href = quote.getAttribute('href'); - if (href[0] === '#') { - if (!Build.sameThread(boardID, threadID)) { - quote.href = Build.threadURL(boardID, threadID) + href; - } - } else { - if ((match = quote.href.match(SW.yotsuba.regexp.quotelink)) && (Build.sameThread(match[1], match[2]))) { - quote.href = href.match(/(#[^#]*)?$/)[0] || '#'; - } - } - } - return container; - }, - summaryText: function(status, posts, files) { - var text; - text = ''; - if (status) { - text += status + " "; - } - text += posts + " post" + (posts > 1 ? 's' : ''); - if (+files) { - text += " and " + files + " image repl" + (files > 1 ? 'ies' : 'y'); - } - return text += " " + (status === '-' ? 'shown' : 'omitted') + "."; - }, - summary: function(boardID, threadID, posts, files) { - return $.el('a', { - className: 'summary', - textContent: Build.summaryText('', posts, files), - href: "/" + boardID + "/thread/" + threadID - }); - }, - thread: function(thread, data, withReplies) { - var files, posts, ref, root, summary; - if ((root = thread.nodes.root)) { - $.rmAll(root); - } else { - thread.nodes.root = root = $.el('div', { - className: 'thread', - id: "t" + data.no - }); - } - if (Build.hat) { - $.add(root, Build.hat.cloneNode(false)); - } - $.add(root, thread.OP.nodes.root); - if (data.omitted_posts || !withReplies && data.replies) { - ref = withReplies ? [ - data.omitted_posts, data.images - data.last_replies.filter(function(data) { - return !!data.ext; - }).length - ] : [data.replies, data.images], posts = ref[0], files = ref[1]; - summary = Build.summary(thread.board.ID, data.no, posts, files); - $.add(root, summary); - } - return root; - }, - catalogThread: function(thread, data, pageCount) { - var br, container, cssText, fileCount, gifIcon, i, imgClass, len, postCount, ratio, ref, root, spoilerRange, src, staticPath, tn_h, tn_w; - staticPath = Build.staticPath, gifIcon = Build.gifIcon; - tn_w = data.tn_w, tn_h = data.tn_h; - if (data.spoiler && !Conf['Reveal Spoiler Thumbnails']) { - src = staticPath + "spoiler"; - if (spoilerRange = Build.spoilerRange[thread.board]) { - src += ("-" + thread.board) + Math.floor(1 + spoilerRange * Math.random()); - } - src += '.png'; - imgClass = 'spoiler-file'; - cssText = "--tn-w: 100; --tn-h: 100;"; - } else if (data.filedeleted) { - src = staticPath + "filedeleted-res" + gifIcon; - imgClass = 'deleted-file'; - } else if (thread.OP.file) { - src = thread.OP.file.thumbURL; - ratio = 250 / Math.max(tn_w, tn_h); - cssText = "--tn-w: " + (tn_w * ratio) + "; --tn-h: " + (tn_h * ratio) + ";"; - } else { - src = staticPath + "nofile.png"; - imgClass = 'no-file'; - } - postCount = data.replies + 1; - fileCount = data.images + !!data.ext; - container = $.el('div', {innerHTML: "
      " + E(postCount) + " / " + E(fileCount) + " / " + E(pageCount) + "" + ((thread.isSticky) ? "" : "") + ((thread.isClosed) ? "" : "") + "
      "}); - $.before(thread.OP.nodes.info, slice.call(container.childNodes)); - ref = $$('br', thread.OP.nodes.comment); - for (i = 0, len = ref.length; i < len; i++) { - br = ref[i]; - if (br.previousSibling && br.previousSibling.nodeName === 'BR') { - $.addClass(br, 'extra-linebreak'); - } - } - root = $.el('div', { - className: 'thread catalog-thread', - id: "t" + thread - }); - if (thread.OP.highlights) { - $.addClass.apply($, [root].concat(slice.call(thread.OP.highlights))); - } - if (!thread.OP.file) { - $.addClass(root, 'noFile'); - } - root.style.cssText = cssText || ''; - return root; - }, - catalogReply: function(thread, data) { - var excerpt, link; - excerpt = ''; - if (data.com) { - excerpt = Build.parseCommentDisplay(data.com).replace(/>>\d+/g, '').trim().replace(/\n+/g, ' // '); - } - if (data.ext) { - excerpt || (excerpt = "" + ($.unescape(data.filename)) + data.ext); - } - if (data.com) { - excerpt || (excerpt = $.unescape(data.com.replace(//gi, ' // '))); - } - excerpt || (excerpt = '\xA0'); - if (excerpt.length > 73) { - excerpt = excerpt.slice(0, 70) + "..."; - } - link = Build.postURL(thread.board.ID, thread.ID, data.no); - return $.el('div', { - className: 'catalog-reply' - }, {innerHTML: ": " + E(excerpt) + "..."}); - } - }; - - SW.yotsuba.Build = Build; - -}).call(this); - -Site = (function() { - var Site; - - Site = { - defaultProperties: { - '4chan.org': { - software: 'yotsuba' - }, - '4channel.org': { - canonical: '4chan.org' - }, - '4cdn.org': { - canonical: '4chan.org' - }, - 'notso.smuglo.li': { - canonical: 'smuglo.li' - }, - 'smugloli.net': { - canonical: 'smuglo.li' - }, - 'smug.nepu.moe': { - canonical: 'smuglo.li' - } - }, - init: function(cb) { - var hostname; - $.extend(Conf['siteProperties'], Site.defaultProperties); - hostname = Site.resolve(); - if (hostname && $.hasOwn(SW, Conf['siteProperties'][hostname].software)) { - this.set(hostname); - cb(); - } - return $.onExists(doc, 'body', (function(_this) { - return function() { - var base, base1, changed, changes, key, properties, software; - for (software in SW) { - if (!((changes = typeof (base = SW[software]).detect === "function" ? base.detect() : void 0))) { - continue; - } - changes.software = software; - hostname = location.hostname.replace(/^www\./, ''); - properties = ((base1 = Conf['siteProperties'])[hostname] || (base1[hostname] = $.dict())); - changed = 0; - for (key in changes) { - if (!(properties[key] !== changes[key])) { - continue; - } - properties[key] = changes[key]; - changed++; - } - if (changed) { - $.set('siteProperties', Conf['siteProperties']); - } - if (!g.SITE) { - _this.set(hostname); - cb(); - } - return; - } - }; - })(this)); - }, - resolve: function(url) { - var canonical, hostname; - if (url == null) { - url = location; - } - hostname = url.hostname; - while (hostname && !$.hasOwn(Conf['siteProperties'], hostname)) { - hostname = hostname.replace(/^[^.]*\.?/, ''); - } - if (hostname) { - if ((canonical = Conf['siteProperties'][hostname].canonical)) { - hostname = canonical; - } - } - return hostname; - }, - parseURL: function(url) { - var siteID; - siteID = Site.resolve(url); - return Main.parseURL(g.sites[siteID], url); - }, - set: function(hostname) { - var ID, properties, ref, site, software; - ref = Conf['siteProperties']; - for (ID in ref) { - properties = ref[ID]; - if (properties.canonical) { - continue; - } - software = properties.software; - if (!(software && $.hasOwn(SW, software))) { - continue; - } - g.sites[ID] = site = Object.create(SW[software]); - $.extend(site, { - ID: ID, - siteID: ID, - properties: properties, - software: software - }); - } - return g.SITE = g.sites[hostname]; - } - }; - - return Site; - -}).call(this); - -Redirect = (function() { - var Redirect, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Redirect = { - archives: [ - { "uid": 3, "name": "4plebs", "domain": "archive.4plebs.org", "http": true, "https": true, "software": "foolfuuka", "boards": [ "adv", "f", "hr", "mlpol", "mo", "o", "pol", "s4s", "sp", "tg", "trv", "tv", "x" ], "files": [ "adv", "f", "hr", "mlpol", "mo", "o", "pol", "s4s", "sp", "tg", "trv", "tv", "x" ], "reports": true }, - { "uid": 10, "name": "warosu", "domain": "warosu.org", "http": false, "https": true, "software": "fuuka", "boards": [ "3", "biz", "cgl", "ck", "diy", "fa", "ic", "jp", "lit", "sci", "vr", "vt" ], "files": [ "3", "biz", "cgl", "ck", "diy", "fa", "ic", "jp", "lit", "sci", "vr", "vt" ], "search": [ "biz", "cgl", "ck", "diy", "fa", "ic", "jp", "lit", "sci", "vr", "vt" ] }, - { "uid": 23, "name": "Desuarchive", "domain": "desuarchive.org", "http": true, "https": true, "software": "foolfuuka", "boards": [ "a", "aco", "an", "c", "cgl", "co", "d", "fit", "g", "his", "int", "k", "m", "mlp", "mu", "q", "qa", "r9k", "tg", "trash", "vr", "wsg" ], "files": [ "a", "aco", "an", "c", "cgl", "co", "d", "fit", "g", "his", "int", "k", "m", "mlp", "mu", "q", "qa", "r9k", "tg", "trash", "vr" ], "reports": true }, - { "uid": 24, "name": "fireden.net", "domain": "boards.fireden.net", "http": false, "https": true, "software": "foolfuuka", "boards": [ "cm", "co", "ic", "sci", "vip", "y" ], "files": [ "cm", "co", "ic", "sci", "vip", "y" ], "search": [ "cm", "co", "ic", "sci", "y" ] }, - { "uid": 25, "name": "arch.b4k.co", "domain": "arch.b4k.co", "http": true, "https": true, "software": "foolfuuka", "boards": [ "g", "mlp", "qb", "v", "vg", "vm", "vmg", "vp", "vrpg", "vst" ], "files": [ "qb", "v", "vg", "vm", "vmg", "vp", "vrpg", "vst" ], "search": [ "qb", "v", "vg", "vm", "vmg", "vp", "vrpg", "vst" ] }, - { "uid": 29, "name": "Archived.Moe", "domain": "archived.moe", "http": true, "https": true, "software": "foolfuuka", "boards": [ "3", "a", "aco", "adv", "an", "asp", "b", "bant", "biz", "c", "can", "cgl", "ck", "cm", "co", "cock", "con", "d", "diy", "e", "f", "fa", "fap", "fit", "fitlit", "g", "gd", "gif", "h", "hc", "his", "hm", "hr", "i", "ic", "int", "jp", "k", "lgbt", "lit", "m", "mlp", "mlpol", "mo", "mtv", "mu", "n", "news", "o", "out", "outsoc", "p", "po", "pol", "pw", "q", "qa", "qb", "qst", "r", "r9k", "s", "s4s", "sci", "soc", "sp", "spa", "t", "tg", "toy", "trash", "trv", "tv", "u", "v", "vg", "vint", "vip", "vm", "vmg", "vp", "vr", "vrpg", "vst", "vt", "w", "wg", "wsg", "wsr", "x", "xs", "y" ], "files": [ "can", "cock", "con", "fap", "fitlit", "gd", "mlpol", "mo", "mtv", "outsoc", "po", "q", "qb", "qst", "spa", "vint", "vip" ], "search": [ "aco", "adv", "an", "asp", "b", "bant", "biz", "c", "can", "cgl", "ck", "cm", "cock", "con", "d", "diy", "e", "f", "fap", "fitlit", "gd", "gif", "h", "hc", "his", "hm", "hr", "i", "ic", "lgbt", "lit", "mlpol", "mo", "mtv", "n", "news", "o", "out", "outsoc", "p", "po", "pw", "q", "qa", "qst", "r", "s", "soc", "spa", "trv", "u", "vint", "vip", "vrpg", "w", "wg", "wsg", "wsr", "x", "y" ], "reports": true }, - { "uid": 30, "name": "TheBArchive.com", "domain": "thebarchive.com", "http": true, "https": true, "software": "foolfuuka", "boards": [ "b", "bant" ], "files": [ "b", "bant" ], "reports": true }, - { "uid": 31, "name": "Archive Of Sins", "domain": "archiveofsins.com", "http": true, "https": true, "software": "foolfuuka", "boards": [ "h", "hc", "hm", "i", "lgbt", "r", "s", "soc", "t", "u" ], "files": [ "h", "hc", "hm", "i", "lgbt", "r", "s", "soc", "t", "u" ], "reports": true }, - { "uid": 34, "name": "TokyoChronos", "domain": "www.tokyochronos.net", "http": false, "https": true, "software": "foolfuuka", "boards": [ "c", "g", "jp", "mu", "vp", "vrpg", "vt" ], "files": [], "reports": true }, - { "uid": 36, "name": "palanq.win", "domain": "archive.palanq.win", "http": false, "https": true, "software": "foolfuuka", "boards": [ "bant", "c", "con", "e", "i", "n", "news", "out", "p", "pw", "qst", "toy", "vip", "vp", "vt", "w", "wg", "wsr" ], "files": [ "bant", "c", "e", "i", "n", "news", "out", "p", "pw", "qst", "toy", "vip", "vp", "vt", "w", "wg", "wsr" ], "reports": true }, - { "uid": 37, "name": "Eientei", "domain": "eientei.xyz", "http": false, "https": true, "software": "Eientei", "boards": [ "3", "i", "sci", "xs" ], "files": [ "3", "i", "sci", "xs" ], "reports": true } - ], - init: function() { - var now, ref; - this.selectArchives(); - if (Conf['archiveAutoUpdate']) { - now = Date.now(); - if (!((now - 2 * $.DAY < (ref = Conf['lastarchivecheck']) && ref <= now))) { - return this.update(); - } - } - }, - selectArchives: function() { - var archive, archives, boardID, boards, data, files, id, j, k, key, l, len, len1, len2, name, o, record, ref, ref1, ref2, software, type, uid; - o = { - thread: $.dict(), - post: $.dict(), - file: $.dict() - }; - archives = $.dict(); - ref = Conf['archives']; - for (j = 0, len = ref.length; j < len; j++) { - data = ref[j]; - ref1 = ['boards', 'files']; - for (k = 0, len1 = ref1.length; k < len1; k++) { - key = ref1[k]; - if (!(data[key] instanceof Array)) { - data[key] = []; - } - } - uid = data.uid, name = data.name, boards = data.boards, files = data.files, software = data.software; - if (software !== 'fuuka' && software !== 'foolfuuka') { - continue; - } - archives[JSON.stringify(uid != null ? uid : name)] = data; - for (l = 0, len2 = boards.length; l < len2; l++) { - boardID = boards[l]; - if (!(boardID in o.thread)) { - o.thread[boardID] = data; - } - if (!(boardID in o.post || software !== 'foolfuuka')) { - o.post[boardID] = data; - } - if (!(boardID in o.file || indexOf.call(files, boardID) < 0)) { - o.file[boardID] = data; - } - } - } - ref2 = Conf['selectedArchives']; - for (boardID in ref2) { - record = ref2[boardID]; - for (type in record) { - id = record[type]; - if (!((archive = archives[JSON.stringify(id)]) && $.hasOwn(o, type))) { - continue; - } - boards = type === 'file' ? archive.files : archive.boards; - if (indexOf.call(boards, boardID) >= 0) { - o[type][boardID] = archive; - } - } - } - return Redirect.data = o; - }, - update: function(cb) { - var err, fail, i, j, k, len, len1, load, nloaded, ref, ref1, response, responses, url, urls; - urls = []; - responses = []; - nloaded = 0; - ref = Conf['archiveLists'].split('\n'); - for (j = 0, len = ref.length; j < len; j++) { - url = ref[j]; - if (!(url[0] !== '#')) { - continue; - } - url = url.trim(); - if (url) { - urls.push(url); - } - } - fail = function(url, action, msg) { - return new Notice('warning', "Error " + action + " archive data from\n" + url + "\n" + msg, 20); - }; - load = function(i) { - return function() { - var response; - if (this.status !== 200) { - return fail(urls[i], 'fetching', (this.status ? "Error " + this.statusText + " (" + this.status + ")" : 'Connection Error')); - } - response = this.response; - if (!(response instanceof Array)) { - response = [response]; - } - responses[i] = response; - nloaded++; - if (nloaded === urls.length) { - return Redirect.parse(responses, cb); - } - }; - }; - if (urls.length) { - for (i = k = 0, len1 = urls.length; k < len1; i = ++k) { - url = urls[i]; - if ((ref1 = url[0]) === '[' || ref1 === '{') { - try { - response = JSON.parse(url); - } catch (error) { - err = error; - fail(url, 'parsing', err.message); - continue; - } - load(i).call({ - status: 200, - response: response - }); - } else { - CrossOrigin.ajax(url, { - onloadend: load(i) - }); - } - } - } else { - Redirect.parse([], cb); - } - }, - parse: function(responses, cb) { - var archiveUIDs, archives, data, items, j, k, len, len1, ref, response, uid; - archives = []; - archiveUIDs = $.dict(); - for (j = 0, len = responses.length; j < len; j++) { - response = responses[j]; - for (k = 0, len1 = response.length; k < len1; k++) { - data = response[k]; - uid = JSON.stringify((ref = data.uid) != null ? ref : data.name); - if (uid in archiveUIDs) { - $.extend(archiveUIDs[uid], data); - } else { - archiveUIDs[uid] = $.dict.clone(data); - archives.push(data); - } - } - } - items = { - archives: archives, - lastarchivecheck: Date.now() - }; - $.set(items); - $.extend(Conf, items); - Redirect.selectArchives(); - return typeof cb === "function" ? cb() : void 0; - }, - to: function(dest, data) { - var archive; - archive = (dest === 'search' || dest === 'board' ? Redirect.data.thread : Redirect.data[dest])[data.boardID]; - if (!archive) { - return ''; - } - return Redirect[dest](archive, data); - }, - protocol: function(archive) { - var protocol; - protocol = location.protocol; - if (!$.getOwn(archive, protocol.slice(0, -1))) { - protocol = protocol === 'https:' ? 'http:' : 'https:'; - } - return protocol + "//"; - }, - thread: function(archive, arg) { - var boardID, path, postID, threadID; - boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID; - path = threadID ? boardID + "/thread/" + threadID : boardID + "/post/" + postID; - if (archive.software === 'foolfuuka') { - path += '/'; - } - if (threadID && postID) { - path += archive.software === 'foolfuuka' ? "#" + postID : "#p" + postID; - } - return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path; - }, - post: function(archive, arg) { - var boardID, postID, protocol, url; - boardID = arg.boardID, postID = arg.postID; - protocol = Redirect.protocol(archive); - url = "" + protocol + archive.domain + "/_/api/chan/post/?board=" + boardID + "&num=" + postID; - if (!Redirect.securityCheck(url)) { - return ''; - } - return url; - }, - file: function(archive, arg) { - var boardID, filename; - boardID = arg.boardID, filename = arg.filename; - if (!filename) { - return ''; - } - if (boardID === 'f') { - filename = encodeURIComponent($.unescape(decodeURIComponent(filename))); - } else { - if (/[sm]\.jpg$/.test(filename)) { - return ''; - } - } - return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/full_image/" + filename; - }, - board: function(archive, arg) { - var boardID; - boardID = arg.boardID; - return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/"; - }, - search: function(archive, arg) { - var boardID, path, type, value; - boardID = arg.boardID, type = arg.type, value = arg.value; - type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type; - if (type === 'capcode') { - value = $.getOwn({ - 'Developer': 'dev', - 'Verified': 'ver' - }, value) || value.toLowerCase(); - } else if (type === 'image') { - value = value.replace(/[+\/=]/g, function(c) { - return { - '+': '-', - '/': '_', - '=': '' - }[c]; - }); - } - value = encodeURIComponent(value); - path = archive.software === 'foolfuuka' ? boardID + "/search/" + type + "/" + value + "/" : type === 'image' ? boardID + "/image/" + value : boardID + "/?task=search2&search_" + type + "=" + value; - return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path; - }, - report: function(boardID) { - var archive, boards, domain, https, j, len, name, ref, reports, software, urls; - urls = []; - ref = Conf['archives']; - for (j = 0, len = ref.length; j < len; j++) { - archive = ref[j]; - software = archive.software, https = archive.https, reports = archive.reports, boards = archive.boards, name = archive.name, domain = archive.domain; - if (software === 'foolfuuka' && https && reports && boards instanceof Array && indexOf.call(boards, boardID) >= 0) { - urls.push([name, "https://" + domain + "/_/api/chan/offsite_report/"]); - } - } - return urls; - }, - securityCheck: function(url) { - return /^https:\/\//.test(url) || location.protocol === 'http:' || Conf['Exempt Archives from Encryption']; - }, - navigate: function(dest, data, alternative) { - var url; - if (!Redirect.data) { - Redirect.init(); - } - url = Redirect.to(dest, data); - if (url && (Redirect.securityCheck(url) || confirm("Redirect to " + url + "?\n\nYour connection will not be encrypted."))) { - return location.replace(url); - } else if (alternative) { - return location.replace(alternative); - } - } - }; - - return Redirect; - -}).call(this); - -Anonymize = (function() { - var Anonymize; - - Anonymize = { - init: function() { - if (!Conf['Anonymize']) { - return; - } - return $.addClass(doc, 'anonymize'); - } - }; - - return Anonymize; - -}).call(this); - -Filter = (function() { - var Filter, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - slice = [].slice; - - Filter = { - filters: $.dict(), - init: function() { - var base, base1, boards, err, excludes, file, filter, hide, hl, i, isstring, j, key, len, len1, line, mask, noti, op, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, regexp, stub, top, type, types; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'catalog') && Conf['Filter'])) { - return; - } - if (g.VIEW === 'catalog' && !Conf['Filter in Native Catalog']) { - return; - } - if (!Conf['Filtered Backlinks']) { - $.addClass(doc, 'hide-backlinks'); - } - for (key in Config.filter) { - ref1 = Conf[key].split('\n'); - for (i = 0, len = ref1.length; i < len; i++) { - line = ref1[i]; - if (line[0] === '#') { - continue; - } - if (!(regexp = line.match(/\/(.*)\/(\w*)/))) { - continue; - } - filter = line.replace(regexp[0], ''); - boards = this.parseBoards((ref2 = filter.match(/(?:^|;)\s*boards:([^;]+)/)) != null ? ref2[1] : void 0); - excludes = this.parseBoards((ref3 = filter.match(/(?:^|;)\s*exclude:([^;]+)/)) != null ? ref3[1] : void 0); - if ((isstring = (key === 'uniqueID' || key === 'MD5'))) { - regexp = regexp[1]; - } else { - try { - regexp = RegExp(regexp[1], regexp[2]); - } catch (error) { - err = error; - new Notice('warning', [$.tn("Invalid " + key + " filter:"), $.el('br'), $.tn(line), $.el('br'), $.tn(err.message)], 60); - continue; - } - } - op = ((ref4 = filter.match(/(?:^|;)\s*op:(no|only)/)) != null ? ref4[1] : void 0) || ''; - mask = $.getOwn({ - 'no': 1, - 'only': 2 - }, op) || 0; - file = ((ref5 = filter.match(/(?:^|;)\s*file:(no|only)/)) != null ? ref5[1] : void 0) || ''; - mask = mask | ($.getOwn({ - 'no': 4, - 'only': 8 - }, file) || 0); - stub = (function() { - var ref6; - switch ((ref6 = filter.match(/(?:^|;)\s*stub:(yes|no)/)) != null ? ref6[1] : void 0) { - case 'yes': - return true; - case 'no': - return false; - default: - return Conf['Stubs']; - } - })(); - noti = /(?:^|;)\s*notify/.test(filter); - if ((hl = /(?:^|;)\s*highlight/.test(filter))) { - hl = ((ref6 = filter.match(/(?:^|;)\s*highlight:([\w-]+)/)) != null ? ref6[1] : void 0) || 'filter-highlight'; - top = ((ref7 = filter.match(/(?:^|;)\s*top:(yes|no)/)) != null ? ref7[1] : void 0) || 'yes'; - top = top === 'yes'; - } - if (key === 'general') { - if ((types = filter.match(/(?:^|;)\s*type:([^;]*)/))) { - types = types[1].split(','); - } else { - types = ['subject', 'name', 'filename', 'comment']; - } - } - hide = !(hl || noti); - filter = { - isstring: isstring, - regexp: regexp, - boards: boards, - excludes: excludes, - mask: mask, - hide: hide, - stub: stub, - hl: hl, - top: top, - noti: noti - }; - if (key === 'general') { - for (j = 0, len1 = types.length; j < len1; j++) { - type = types[j]; - ((base = this.filters)[type] || (base[type] = [])).push(filter); - } - } else { - ((base1 = this.filters)[key] || (base1[key] = [])).push(filter); - } - } - } - if (!Object.keys(this.filters).length) { - return; - } - if (g.VIEW === 'catalog') { - return Filter.catalog(); - } else { - return Callbacks.Post.push({ - name: 'Filter', - cb: this.node - }); - } - }, - parseBoards: function(boardsRaw) { - var boardID, boardID2, boards, i, j, len, len1, ref, ref1, ref2, ref3, site, siteFilter, siteID; - if (!boardsRaw) { - return false; - } - if ((boards = Filter.parseBoardsMemo[boardsRaw])) { - return boards; - } - boards = $.dict(); - siteFilter = ''; - ref = boardsRaw.split(','); - for (i = 0, len = ref.length; i < len; i++) { - boardID = ref[i]; - if (indexOf.call(boardID, ':') >= 0) { - ref1 = boardID.split(':').slice(-2), siteFilter = ref1[0], boardID = ref1[1]; - } - ref2 = g.sites; - for (siteID in ref2) { - site = ref2[siteID]; - if (siteID.slice(0, siteFilter.length) === siteFilter) { - if (boardID === 'nsfw' || boardID === 'sfw') { - ref3 = (typeof site.sfwBoards === "function" ? site.sfwBoards(boardID === 'sfw') : void 0) || []; - for (j = 0, len1 = ref3.length; j < len1; j++) { - boardID2 = ref3[j]; - boards[siteID + "/" + boardID2] = true; - } - } else { - boards[siteID + "/" + (encodeURIComponent(boardID))] = true; - } - } - } - } - Filter.parseBoardsMemo[boardsRaw] = boards; - return boards; - }, - parseBoardsMemo: $.dict(), - test: function(post, hideable) { - var board, filter, hide, hl, i, j, key, len, len1, mask, noti, ref, ref1, ref2, site, stub, top, value; - if (hideable == null) { - hideable = true; - } - if (post.filterResults) { - return post.filterResults; - } - hide = false; - stub = true; - hl = void 0; - top = false; - noti = false; - if (QuoteYou.isYou(post)) { - hideable = false; - } - mask = (post.isReply ? 2 : 1); - mask = mask | (post.file ? 4 : 8); - board = post.siteID + "/" + post.boardID; - site = post.siteID + "/*"; - for (key in Filter.filters) { - ref = Filter.values(key, post); - for (i = 0, len = ref.length; i < len; i++) { - value = ref[i]; - ref1 = Filter.filters[key]; - for (j = 0, len1 = ref1.length; j < len1; j++) { - filter = ref1[j]; - if ((filter.boards && !(filter.boards[board] || filter.boards[site])) || (filter.excludes && (filter.excludes[board] || filter.excludes[site])) || (filter.mask & mask) || (filter.isstring ? filter.regexp !== value : !filter.regexp.test(value))) { - continue; - } - if (filter.hide) { - if (hideable) { - hide = true; - stub && (stub = filter.stub); - } - } else { - if (!(hl && (ref2 = filter.hl, indexOf.call(hl, ref2) >= 0))) { - (hl || (hl = [])).push(filter.hl); - } - top || (top = filter.top); - if (filter.noti) { - noti = true; - } - } - } - } - } - if (hide) { - return { - hide: hide, - stub: stub - }; - } else { - return { - hl: hl, - top: top, - noti: noti - }; - } - }, - node: function() { - var hide, hl, noti, ref, stub, top; - if (this.isClone) { - return; - } - ref = Filter.test(this, !this.isFetchedQuote && (this.isReply || g.VIEW === 'index')), hide = ref.hide, stub = ref.stub, hl = ref.hl, top = ref.top, noti = ref.noti; - if (hide) { - if (this.isReply) { - PostHiding.hide(this, stub); - } else { - ThreadHiding.hide(this.thread, stub); - } - } else { - if (hl) { - this.highlights = hl; - $.addClass.apply($, [this.nodes.root].concat(slice.call(hl))); - } - } - if (noti && Unread.posts && (this.ID > Unread.lastReadPost) && !QuoteYou.isYou(this)) { - return Unread.openNotification(this, ' triggered a notification filter'); - } - }, - catalog: function() { - var base, url; - if (!(url = typeof (base = g.SITE.urls).catalogJSON === "function" ? base.catalogJSON(g.BOARD) : void 0)) { - return; - } - Filter.catalogData = $.dict(); - $.ajax(url, { - onloadend: Filter.catalogParse - }); - return Callbacks.CatalogThreadNative.push({ - name: 'Filter', - cb: this.catalogNode - }); - }, - catalogParse: function() { - var i, item, j, len, len1, page, ref, ref1, ref2; - if ((ref = this.status) !== 200 && ref !== 404) { - new Notice('warning', "Failed to fetch catalog JSON data. " + (this.status ? "Error " + this.statusText + " (" + this.status + ")" : 'Connection Error'), 1); - return; - } - ref1 = this.response; - for (i = 0, len = ref1.length; i < len; i++) { - page = ref1[i]; - ref2 = page.threads; - for (j = 0, len1 = ref2.length; j < len1; j++) { - item = ref2[j]; - Filter.catalogData[item.no] = item; - } - } - g.BOARD.threads.forEach(function(thread) { - if (thread.catalogViewNative) { - return Filter.catalogNode.call(thread.catalogViewNative); - } - }); - }, - catalogNode: function() { - var base, hide, hl, ref, ref1, top; - if (!(this.boardID === g.BOARD.ID && Filter.catalogData[this.ID])) { - return; - } - if ((ref = QuoteYou.db) != null ? ref.get({ - siteID: g.SITE.ID, - boardID: this.boardID, - threadID: this.ID, - postID: this.ID - }) : void 0) { - return; - } - ref1 = Filter.test(g.SITE.Build.parseJSON(Filter.catalogData[this.ID], this)), hide = ref1.hide, hl = ref1.hl, top = ref1.top; - if (hide) { - return this.nodes.root.hidden = true; - } else { - if (hl) { - this.highlights = hl; - $.addClass.apply($, [this.nodes.root].concat(slice.call(hl))); - } - if (top) { - $.prepend(this.nodes.root.parentNode, this.nodes.root); - return typeof (base = g.SITE).catalogPin === "function" ? base.catalogPin(this.nodes.root) : void 0; - } - } - }, - isHidden: function(post) { - return !!Filter.test(post).hide; - }, - valueF: { - postID: function(post) { - return ["" + post.ID]; - }, - name: function(post) { - return [post.info.name]; - }, - uniqueID: function(post) { - return [post.info.uniqueID || '']; - }, - tripcode: function(post) { - return [post.info.tripcode]; - }, - capcode: function(post) { - return [post.info.capcode]; - }, - pass: function(post) { - return [post.info.pass]; - }, - email: function(post) { - return [post.info.email]; - }, - subject: function(post) { - return [post.info.subject || (post.isReply ? void 0 : '')]; - }, - comment: function(post) { - var base, ref, ref1; - return [((base = post.info).comment != null ? base.comment : base.comment = (ref = g.sites[post.siteID]) != null ? (ref1 = ref.Build) != null ? typeof ref1.parseComment === "function" ? ref1.parseComment(post.info.commentHTML.innerHTML) : void 0 : void 0 : void 0)]; - }, - flag: function(post) { - return [post.info.flag]; - }, - filename: function(post) { - return post.files.map(function(f) { - return f.name; - }); - }, - dimensions: function(post) { - return post.files.map(function(f) { - return f.dimensions; - }); - }, - filesize: function(post) { - return post.files.map(function(f) { - return f.size; - }); - }, - MD5: function(post) { - return post.files.map(function(f) { - return f.MD5; - }); - } - }, - values: function(key, post) { - if ($.hasOwn(Filter.valueF, key)) { - return Filter.valueF[key](post).filter(function(v) { - return v != null; - }); - } else { - return [ - key.split('+').map(function(k) { - var f; - if ((f = $.getOwn(Filter.valueF, k))) { - return f(post).map(function(v) { - return v || ''; - }).join('\n'); - } else { - return ''; - } - }).join('\n') - ]; - } - }, - addFilter: function(type, re, cb) { - if (!$.hasOwn(Config.filter, type)) { - return; - } - return $.get(type, Conf[type], function(item) { - var save; - save = item[type]; - save = save ? save + "\n" + re : re; - return $.set(type, save, cb); - }); - }, - removeFilters: function(type, res, cb) { - return $.get(type, Conf[type], function(item) { - var save; - save = item[type]; - res = res.map(Filter.escape).join('|'); - save = save.replace(RegExp("(?:$\n|^)(?:" + res + ")$", 'mg'), ''); - return $.set(type, save, cb); - }); - }, - showFilters: function(type) { - var section, select; - Settings.open('Filter'); - section = $('.section-container'); - select = $('select[name=filter]', section); - select.value = type; - Settings.selectFilter.call(select); - return $.onExists(section, 'textarea', function(ta) { - var tl; - tl = ta.textLength; - ta.setSelectionRange(tl, tl); - return ta.focus(); - }); - }, - quickFilterMD5: function() { - var files, filter, links, msg, notice, origin, post; - post = Get.postFromNode(this); - files = post.files.filter(function(f) { - return f.MD5; - }); - if (!files.length) { - return; - } - filter = files.map(function(f) { - return "/" + f.MD5 + "/"; - }).join('\n'); - Filter.addFilter('MD5', filter); - origin = post.origin || post; - if (origin.isReply) { - PostHiding.hide(origin); - } else if (g.VIEW === 'index') { - ThreadHiding.hide(origin.thread); - } - if (!Conf['MD5 Quick Filter Notifications']) { - if (post.nodes.post.getBoundingClientRect().height) { - new Notice('info', 'MD5 filtered.', 2); - } - return; - } - notice = Filter.quickFilterMD5.notice; - if (notice) { - notice.filters.push(filter); - notice.posts.push(origin); - return $('span', notice.el).textContent = notice.filters.length + " MD5s filtered."; - } else { - msg = $.el('div', {innerHTML: "MD5 filtered. [show] [undo]"}); - notice = Filter.quickFilterMD5.notice = new Notice('info', msg, void 0, function() { - return delete Filter.quickFilterMD5.notice; - }); - notice.filters = [filter]; - notice.posts = [origin]; - links = $$('a', msg); - $.on(links[0], 'click', Filter.quickFilterCB.show.bind(notice)); - return $.on(links[1], 'click', Filter.quickFilterCB.undo.bind(notice)); - } - }, - quickFilterCB: { - show: function() { - Filter.showFilters('MD5'); - return this.close(); - }, - undo: function() { - var i, len, post, ref; - Filter.removeFilters('MD5', this.filters); - ref = this.posts; - for (i = 0, len = ref.length; i < len; i++) { - post = ref[i]; - if (post.isReply) { - PostHiding.show(post); - } else if (g.VIEW === 'index') { - ThreadHiding.show(post.thread); - } - } - return this.close(); - } - }, - escape: function(value) { - return value.replace(/\/|\\|\^|\$|\n|\.|\(|\)|\{|\}|\[|\]|\?|\*|\+|\|/g, function(c) { - if (c === '\n') { - return '\\n'; - } else if (c === '\\') { - return '\\\\'; - } else { - return "\\" + c; - } - }); - }, - menu: { - init: function() { - var div, entry, i, len, ref, ref1, type; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Filter'])) { - return; - } - div = $.el('div', { - textContent: 'Filter' - }); - entry = { - el: div, - order: 50, - open: function(post) { - Filter.menu.post = post; - return true; - }, - subEntries: [] - }; - ref1 = [['Name', 'name'], ['Unique ID', 'uniqueID'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Pass Date', 'pass'], ['Email', 'email'], ['Subject', 'subject'], ['Comment', 'comment'], ['Flag', 'flag'], ['Filename', 'filename'], ['Image dimensions', 'dimensions'], ['Filesize', 'filesize'], ['Image MD5', 'MD5']]; - for (i = 0, len = ref1.length; i < len; i++) { - type = ref1[i]; - entry.subEntries.push(Filter.menu.createSubEntry(type[0], type[1])); - } - return Menu.menu.addEntry(entry); - }, - createSubEntry: function(text, type) { - var el; - el = $.el('a', { - href: 'javascript:;', - textContent: text - }); - el.dataset.type = type; - $.on(el, 'click', Filter.menu.makeFilter); - return { - el: el, - open: function(post) { - return Filter.values(type, post).length; - } - }; - }, - makeFilter: function() { - var res, type, values; - type = this.dataset.type; - values = Filter.values(type, Filter.menu.post); - res = values.map(function(value) { - var re; - re = type === 'uniqueID' || type === 'MD5' ? value : Filter.escape(value); - if (type === 'uniqueID' || type === 'MD5') { - return "/" + re + "/"; - } else { - return "/^" + re + "$/"; - } - }).join('\n'); - return Filter.addFilter(type, res, function() { - return Filter.showFilters(type); - }); - } - } - }; - - return Filter; - -}).call(this); - -PostHiding = (function() { - var PostHiding; - - PostHiding = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link'])) { - return; - } - if (Conf['Reply Hiding Buttons']) { - $.addClass(doc, "reply-hide"); - } - this.db = new DataBoard('hiddenPosts'); - return Callbacks.Post.push({ - name: 'Reply Hiding', - cb: this.node - }); - }, - isHidden: function(boardID, threadID, postID) { - return !!(PostHiding.db && PostHiding.db.get({ - boardID: boardID, - threadID: threadID, - postID: postID - })); - }, - node: function() { - var button, data, sa, sideArrows; - if (!this.isReply || this.isClone || this.isFetchedQuote) { - return; - } - if (data = PostHiding.db.get({ - boardID: this.board.ID, - threadID: this.thread.ID, - postID: this.ID - })) { - if (data.thisPost) { - PostHiding.hide(this, data.makeStub, data.hideRecursively); - } else { - Recursive.apply(PostHiding.hide, this, data.makeStub, true); - Recursive.add(PostHiding.hide, this, data.makeStub, true); - } - } - if (!Conf['Reply Hiding Buttons']) { - return; - } - button = PostHiding.makeButton(this, 'hide'); - if ((sa = g.SITE.selectors.sideArrows)) { - sideArrows = $(sa, this.nodes.root); - $.replace(sideArrows.firstChild, button); - return sideArrows.className = 'replacedSideArrows'; - } else { - return $.prepend(this.nodes.info, button); - } - }, - menu: { - init: function() { - var apply, div, hideStubLink, makeStub, ref, replies, thisPost; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Menu'] || !Conf['Reply Hiding Link']) { - return; - } - div = $.el('div', { - className: 'hide-reply-link', - textContent: 'Hide' - }); - apply = $.el('a', { - textContent: 'Apply', - href: 'javascript:;' - }); - $.on(apply, 'click', PostHiding.menu.hide); - thisPost = UI.checkbox('thisPost', 'This post', true); - replies = UI.checkbox('replies', 'Hide replies', Conf['Recursive Hiding']); - makeStub = UI.checkbox('makeStub', 'Make stub', Conf['Stubs']); - Menu.menu.addEntry({ - el: div, - order: 20, - open: function(post) { - if (!post.isReply || post.isClone || post.isHidden) { - return false; - } - PostHiding.menu.post = post; - return true; - }, - subEntries: [ - { - el: apply - }, { - el: thisPost - }, { - el: replies - }, { - el: makeStub - } - ] - }); - div = $.el('div', { - className: 'show-reply-link', - textContent: 'Show' - }); - apply = $.el('a', { - textContent: 'Apply', - href: 'javascript:;' - }); - $.on(apply, 'click', PostHiding.menu.show); - thisPost = UI.checkbox('thisPost', 'This post', false); - replies = UI.checkbox('replies', 'Show replies', false); - hideStubLink = $.el('a', { - textContent: 'Hide stub', - href: 'javascript:;' - }); - $.on(hideStubLink, 'click', PostHiding.menu.hideStub); - Menu.menu.addEntry({ - el: div, - order: 20, - open: function(post) { - var data; - if (!post.isReply || post.isClone || !post.isHidden) { - return false; - } - if (!(data = PostHiding.db.get({ - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID - }))) { - return false; - } - PostHiding.menu.post = post; - thisPost.firstChild.checked = post.isHidden; - replies.firstChild.checked = (data != null ? data.hideRecursively : void 0) != null ? data.hideRecursively : Conf['Recursive Hiding']; - return true; - }, - subEntries: [ - { - el: apply - }, { - el: thisPost - }, { - el: replies - } - ] - }); - return Menu.menu.addEntry({ - el: hideStubLink, - order: 15, - open: function(post) { - var data; - if (!post.isReply || post.isClone || !post.isHidden) { - return false; - } - if (!(data = PostHiding.db.get({ - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID - }))) { - return false; - } - return PostHiding.menu.post = post; - } - }); - }, - hide: function() { - var makeStub, parent, post, replies, thisPost; - parent = this.parentNode; - thisPost = $('input[name=thisPost]', parent).checked; - replies = $('input[name=replies]', parent).checked; - makeStub = $('input[name=makeStub]', parent).checked; - post = PostHiding.menu.post; - if (thisPost) { - PostHiding.hide(post, makeStub, replies); - } else if (replies) { - Recursive.apply(PostHiding.hide, post, makeStub, true); - Recursive.add(PostHiding.hide, post, makeStub, true); - } else { - return; - } - PostHiding.saveHiddenState(post, true, thisPost, makeStub, replies); - return $.event('CloseMenu'); - }, - show: function() { - var data, parent, post, replies, thisPost; - parent = this.parentNode; - thisPost = $('input[name=thisPost]', parent).checked; - replies = $('input[name=replies]', parent).checked; - post = PostHiding.menu.post; - if (thisPost) { - PostHiding.show(post, replies); - } else if (replies) { - Recursive.apply(PostHiding.show, post, true); - Recursive.rm(PostHiding.hide, post, true); - } else { - return; - } - if (data = PostHiding.db.get({ - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID - })) { - PostHiding.saveHiddenState(post, !(thisPost && replies), !thisPost, data.makeStub, !replies); - } - return $.event('CloseMenu'); - }, - hideStub: function() { - var data, post; - post = PostHiding.menu.post; - if (data = PostHiding.db.get({ - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID - })) { - PostHiding.show(post, data.hideRecursively); - PostHiding.hide(post, false, data.hideRecursively); - PostHiding.saveHiddenState(post, true, true, false, data.hideRecursively); - } - $.event('CloseMenu'); - } - }, - makeButton: function(post, type) { - var a, span; - span = $.el('span', { - className: "fa fa-" + (type === 'hide' ? 'minus' : 'plus') + "-square-o", - textContent: "" - }); - a = $.el('a', { - className: type + "-reply-button", - href: 'javascript:;' - }); - $.add(a, span); - $.on(a, 'click', PostHiding.toggle); - return a; - }, - saveHiddenState: function(post, isHiding, thisPost, makeStub, hideRecursively) { - var data; - data = { - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID - }; - if (isHiding) { - data.val = { - thisPost: thisPost !== false, - makeStub: makeStub, - hideRecursively: hideRecursively - }; - return PostHiding.db.set(data); - } else { - return PostHiding.db["delete"](data); - } - }, - toggle: function() { - var post; - post = Get.postFromNode(this); - PostHiding[(post.isHidden ? 'show' : 'hide')](post); - return PostHiding.saveHiddenState(post, post.isHidden); - }, - hide: function(post, makeStub, hideRecursively) { - var a, i, len, quotelink, ref; - if (makeStub == null) { - makeStub = Conf['Stubs']; - } - if (hideRecursively == null) { - hideRecursively = Conf['Recursive Hiding']; - } - if (post.isHidden) { - return; - } - post.isHidden = true; - if (hideRecursively) { - Recursive.apply(PostHiding.hide, post, makeStub, true); - Recursive.add(PostHiding.hide, post, makeStub, true); - } - ref = Get.allQuotelinksLinkingTo(post); - for (i = 0, len = ref.length; i < len; i++) { - quotelink = ref[i]; - $.addClass(quotelink, 'filtered'); - } - if (!makeStub) { - post.nodes.root.hidden = true; - return; - } - a = PostHiding.makeButton(post, 'show'); - $.add(a, $.tn(" " + post.info.nameBlock)); - post.nodes.stub = $.el('div', { - className: 'stub' - }); - $.add(post.nodes.stub, a); - if (Conf['Menu']) { - $.add(post.nodes.stub, Menu.makeButton(post)); - } - return $.prepend(post.nodes.root, post.nodes.stub); - }, - show: function(post, showRecursively) { - var i, len, quotelink, ref; - if (showRecursively == null) { - showRecursively = Conf['Recursive Hiding']; - } - if (post.nodes.stub) { - $.rm(post.nodes.stub); - delete post.nodes.stub; - } else { - post.nodes.root.hidden = false; - } - post.isHidden = false; - if (showRecursively) { - Recursive.apply(PostHiding.show, post, true); - Recursive.rm(PostHiding.hide, post); - } - ref = Get.allQuotelinksLinkingTo(post); - for (i = 0, len = ref.length; i < len; i++) { - quotelink = ref[i]; - $.rmClass(quotelink, 'filtered'); - } - } - }; - - return PostHiding; - -}).call(this); - -Recursive = (function() { - var Recursive, - slice = [].slice, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Recursive = { - recursives: $.dict(), - init: function() { - var ref; - if ((ref = g.VIEW) !== 'index' && ref !== 'thread') { - return; - } - return Callbacks.Post.push({ - name: 'Recursive', - cb: this.node - }); - }, - node: function() { - var i, j, k, len, len1, obj, quote, recursive, ref, ref1; - if (this.isClone || this.isFetchedQuote) { - return; - } - ref = this.quotes; - for (j = 0, len = ref.length; j < len; j++) { - quote = ref[j]; - if (obj = Recursive.recursives[quote]) { - ref1 = obj.recursives; - for (i = k = 0, len1 = ref1.length; k < len1; i = ++k) { - recursive = ref1[i]; - recursive.apply(null, [this].concat(slice.call(obj.args[i]))); - } - } - } - }, - add: function() { - var args, base, name, obj, post, recursive; - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : []; - obj = (base = Recursive.recursives)[name = post.fullID] || (base[name] = { - recursives: [], - args: [] - }); - obj.recursives.push(recursive); - return obj.args.push(args); - }, - rm: function(recursive, post) { - var i, j, len, obj, rec, ref; - if (!(obj = Recursive.recursives[post.fullID])) { - return; - } - ref = obj.recursives; - for (i = j = 0, len = ref.length; j < len; i = ++j) { - rec = ref[i]; - if (!(rec === recursive)) { - continue; - } - obj.recursives.splice(i, 1); - obj.args.splice(i, 1); - } - }, - apply: function() { - var args, fullID, post, recursive; - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : []; - fullID = post.fullID; - return g.posts.forEach(function(post) { - if (indexOf.call(post.quotes, fullID) >= 0) { - return recursive.apply(null, [post].concat(slice.call(args))); - } - }); - } - }; - - return Recursive; - -}).call(this); - -ThreadHiding = (function() { - var ThreadHiding; - - ThreadHiding = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Index']) { - return; - } - this.db = new DataBoard('hiddenThreads'); - if (g.VIEW === 'catalog') { - return this.catalogWatch(); - } - this.catalogSet(g.BOARD); - $.on(d, 'IndexRefreshInternal', this.onIndexRefresh); - if (Conf['Thread Hiding Buttons']) { - $.addClass(doc, 'thread-hide'); - } - return Callbacks.Post.push({ - name: 'Thread Hiding', - cb: this.node - }); - }, - catalogSet: function(board) { - var hiddenThreads, threadID; - if (!($.hasStorage && g.SITE.software === 'yotsuba')) { - return; - } - hiddenThreads = ThreadHiding.db.get({ - boardID: board.ID, - defaultValue: $.dict() - }); - for (threadID in hiddenThreads) { - hiddenThreads[threadID] = true; - } - return localStorage.setItem("4chan-hide-t-" + board, JSON.stringify(hiddenThreads)); - }, - catalogWatch: function() { - if (!($.hasStorage && g.SITE.software === 'yotsuba')) { - return; - } - this.hiddenThreads = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {}; - return Main.ready(function() { - return new MutationObserver(ThreadHiding.catalogSave).observe($.id('threads'), { - attributes: true, - subtree: true, - attributeFilter: ['style'] - }); - }); - }, - catalogSave: function() { - var hiddenThreads2, threadID; - hiddenThreads2 = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {}; - for (threadID in hiddenThreads2) { - if (!$.hasOwn(ThreadHiding.hiddenThreads, threadID)) { - ThreadHiding.db.set({ - boardID: g.BOARD.ID, - threadID: threadID, - val: { - makeStub: Conf['Stubs'] - } - }); - } - } - for (threadID in ThreadHiding.hiddenThreads) { - if (!$.hasOwn(hiddenThreads2, threadID)) { - ThreadHiding.db["delete"]({ - boardID: g.BOARD.ID, - threadID: threadID - }); - } - } - return ThreadHiding.hiddenThreads = hiddenThreads2; - }, - isHidden: function(boardID, threadID) { - return !!(ThreadHiding.db && ThreadHiding.db.get({ - boardID: boardID, - threadID: threadID - })); - }, - node: function() { - var data; - if (this.isReply || this.isClone || this.isFetchedQuote) { - return; - } - if (Conf['Thread Hiding Buttons']) { - $.prepend(this.nodes.root, ThreadHiding.makeButton(this.thread, 'hide')); - } - if (data = ThreadHiding.db.get({ - boardID: this.board.ID, - threadID: this.ID - })) { - return ThreadHiding.hide(this.thread, data.makeStub); - } - }, - onIndexRefresh: function() { - return g.BOARD.threads.forEach(function(thread) { - var root; - root = thread.nodes.root; - if (thread.isHidden && thread.stub && !root.contains(thread.stub)) { - return ThreadHiding.makeStub(thread, root); - } - }); - }, - menu: { - init: function() { - var apply, div, hideStubLink, makeStub; - if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) { - return; - } - div = $.el('div', { - className: 'hide-thread-link', - textContent: 'Hide' - }); - apply = $.el('a', { - textContent: 'Apply', - href: 'javascript:;' - }); - $.on(apply, 'click', ThreadHiding.menu.hide); - makeStub = UI.checkbox('Stubs', 'Make stub'); - Menu.menu.addEntry({ - el: div, - order: 20, - open: function(arg) { - var isReply, thread; - thread = arg.thread, isReply = arg.isReply; - if (isReply || thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') { - return false; - } - ThreadHiding.menu.thread = thread; - return true; - }, - subEntries: [ - { - el: apply - }, { - el: makeStub - } - ] - }); - div = $.el('a', { - className: 'show-thread-link', - textContent: 'Show', - href: 'javascript:;' - }); - $.on(div, 'click', ThreadHiding.menu.show); - Menu.menu.addEntry({ - el: div, - order: 20, - open: function(arg) { - var isReply, thread; - thread = arg.thread, isReply = arg.isReply; - if (isReply || !thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') { - return false; - } - ThreadHiding.menu.thread = thread; - return true; - } - }); - hideStubLink = $.el('a', { - textContent: 'Hide stub', - href: 'javascript:;' - }); - $.on(hideStubLink, 'click', ThreadHiding.menu.hideStub); - return Menu.menu.addEntry({ - el: hideStubLink, - order: 15, - open: function(arg) { - var isReply, thread; - thread = arg.thread, isReply = arg.isReply; - if (isReply || !thread.isHidden || Conf['JSON Index'] && Conf['Index Mode'] === 'catalog') { - return false; - } - return ThreadHiding.menu.thread = thread; - } - }); - }, - hide: function() { - var makeStub, thread; - makeStub = $('input', this.parentNode).checked; - thread = ThreadHiding.menu.thread; - ThreadHiding.hide(thread, makeStub); - ThreadHiding.saveHiddenState(thread, makeStub); - return $.event('CloseMenu'); - }, - show: function() { - var thread; - thread = ThreadHiding.menu.thread; - ThreadHiding.show(thread); - ThreadHiding.saveHiddenState(thread); - return $.event('CloseMenu'); - }, - hideStub: function() { - var thread; - thread = ThreadHiding.menu.thread; - ThreadHiding.show(thread); - ThreadHiding.hide(thread, false); - ThreadHiding.saveHiddenState(thread, false); - $.event('CloseMenu'); - } - }, - makeButton: function(thread, type) { - var a; - a = $.el('a', { - className: type + "-thread-button", - href: 'javascript:;' - }); - $.extend(a, {innerHTML: ""}); - a.dataset.fullID = thread.fullID; - $.on(a, 'click', ThreadHiding.toggle); - return a; - }, - makeStub: function(thread, root) { - var a, numReplies, summary, threadDivider; - numReplies = $$(g.SITE.selectors.replyOriginal, root).length; - if (summary = $(g.SITE.selectors.summary, root)) { - numReplies += +summary.textContent.match(/\d+/); - } - a = ThreadHiding.makeButton(thread, 'show'); - $.add(a, $.tn(" " + thread.OP.info.nameBlock + " (" + (numReplies === 1 ? '1 reply' : numReplies + " replies") + ")")); - thread.stub = $.el('div', { - className: 'stub' - }); - if (Conf['Menu']) { - $.add(thread.stub, [a, Menu.makeButton(thread.OP)]); - } else { - $.add(thread.stub, a); - } - $.prepend(root, thread.stub); - if ((threadDivider = $(g.SITE.selectors.threadDivider, root))) { - return $.addClass(threadDivider, 'threadDivider'); - } - }, - saveHiddenState: function(thread, makeStub) { - if (thread.isHidden) { - ThreadHiding.db.set({ - boardID: thread.board.ID, - threadID: thread.ID, - val: { - makeStub: makeStub - } - }); - } else { - ThreadHiding.db["delete"]({ - boardID: thread.board.ID, - threadID: thread.ID - }); - } - return ThreadHiding.catalogSet(thread.board); - }, - toggle: function(thread) { - if (!(thread instanceof Thread)) { - thread = g.threads.get(this.dataset.fullID); - } - if (thread.isHidden) { - ThreadHiding.show(thread); - } else { - ThreadHiding.hide(thread); - } - return ThreadHiding.saveHiddenState(thread); - }, - hide: function(thread, makeStub) { - var threadRoot; - if (makeStub == null) { - makeStub = Conf['Stubs']; - } - if (thread.isHidden) { - return; - } - threadRoot = thread.nodes.root; - thread.isHidden = true; - Index.updateHideLabel(); - if (thread.catalogView && !Index.showHiddenThreads) { - $.rm(thread.catalogView.nodes.root); - $.event('PostsRemoved', null, Index.root); - } - if (!makeStub) { - return threadRoot.hidden = true; - } - return ThreadHiding.makeStub(thread, threadRoot); - }, - show: function(thread) { - var threadRoot; - if (thread.stub) { - $.rm(thread.stub); - delete thread.stub; - } - threadRoot = thread.nodes.root; - threadRoot.hidden = thread.isHidden = false; - Index.updateHideLabel(); - if (thread.catalogView && Index.showHiddenThreads) { - $.rm(thread.catalogView.nodes.root); - return $.event('PostsRemoved', null, Index.root); - } - } - }; - - return ThreadHiding; - -}).call(this); - -BoardConfig = (function() { - var BoardConfig; - - BoardConfig = { - cbs: [], - init: function() { - var boards, now, ref; - if (g.SITE.software !== 'yotsuba') { - return; - } - now = Date.now(); - if (!((now - 2 * $.HOUR < (ref = Conf['boardConfig'].lastChecked || 0) && ref <= now))) { - return $.ajax(location.protocol + "//a.4cdn.org/boards.json", { - onloadend: this.load - }); - } else { - boards = Conf['boardConfig'].boards; - return this.set(boards); - } - }, - load: function() { - var board, boards, err, i, len, ref; - if (this.status === 200 && this.response && this.response.boards) { - boards = $.dict(); - ref = this.response.boards; - for (i = 0, len = ref.length; i < len; i++) { - board = ref[i]; - boards[board.board] = board; - } - $.set('boardConfig', { - boards: boards, - lastChecked: Date.now() - }); - } else { - boards = Conf['boardConfig'].boards; - err = (function() { - switch (this.status) { - case 0: - return 'Connection Error'; - case 200: - return 'Invalid Data'; - default: - return "Error " + this.statusText + " (" + this.status + ")"; - } - }).call(this); - new Notice('warning', "Failed to load board configuration. " + err, 20); - } - return BoardConfig.set(boards); - }, - set: function(boards1) { - var ID, board, cb, i, len, ref, ref1; - this.boards = boards1; - ref = g.boards; - for (ID in ref) { - board = ref[ID]; - board.config = this.boards[ID] || {}; - } - ref1 = this.cbs; - for (i = 0, len = ref1.length; i < len; i++) { - cb = ref1[i]; - $.queueTask(cb); - } - }, - ready: function(cb) { - if (this.boards) { - return cb(); - } else { - return this.cbs.push(cb); - } - }, - sfwBoards: function(sfw) { - var board, data, ref, results; - ref = this.boards || Conf['boardConfig'].boards; - results = []; - for (board in ref) { - data = ref[board]; - if (!!data.ws_board === sfw) { - results.push(board); - } - } - return results; - }, - isSFW: function(board) { - var ref; - return !!((ref = (this.boards || Conf['boardConfig'].boards)[board]) != null ? ref.ws_board : void 0); - }, - domain: function(board) { - return "boards." + (BoardConfig.isSFW(board) ? '4channel' : '4chan') + ".org"; - }, - isArchived: function(board) { - var data; - data = (this.boards || Conf['boardConfig'].boards)[board]; - return !data || data.is_archived; - }, - noAudio: function(boardID) { - var boards; - if (g.SITE.software !== 'yotsuba') { - return false; - } - boards = this.boards || Conf['boardConfig'].boards; - return boards && boards[boardID] && !boards[boardID].webm_audio; - }, - title: function(boardID) { - var ref, ref1; - return ((ref = this.boards || Conf['boardConfig'].boards) != null ? (ref1 = ref[boardID]) != null ? ref1.title : void 0 : void 0) || ''; - } - }; - - return BoardConfig; - -}).call(this); - -Get = (function() { - var Get, - slice = [].slice, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Get = { - url: function() { - var IDs, args, f, site, type; - type = arguments[0], IDs = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : []; - if ((site = g.sites[IDs.siteID]) && (f = $.getOwn(site.urls, type))) { - return f.apply(null, [IDs].concat(slice.call(args))); - } else { - return void 0; - } - }, - threadExcerpt: function(thread) { - var OP, excerpt, ref, ref1; - OP = thread.OP; - excerpt = ("/" + (decodeURIComponent(thread.board.ID)) + "/ - ") + (((ref = OP.info.subject) != null ? ref.trim() : void 0) || OP.commentDisplay().replace(/\n+/g, ' // ') || ((ref1 = OP.file) != null ? ref1.name : void 0) || ("No." + OP)); - if (excerpt.length > 73) { - return excerpt.slice(0, 70) + "..."; - } - return excerpt; - }, - threadFromRoot: function(root) { - var board; - if (root == null) { - return null; - } - board = root.dataset.board; - return g.threads.get((board ? encodeURIComponent(board) : g.BOARD.ID) + "." + (root.id.match(/\d*$/)[0])); - }, - threadFromNode: function(node) { - return Get.threadFromRoot($.x("ancestor-or-self::" + g.SITE.xpath.thread, node)); - }, - postFromRoot: function(root) { - var index, post; - if (root == null) { - return null; - } - post = g.posts.get(root.dataset.fullID); - index = root.dataset.clone; - if (index) { - return post.clones[+index]; - } else { - return post; - } - }, - postFromNode: function(root) { - return Get.postFromRoot($.x("ancestor-or-self::" + g.SITE.xpath.postContainer + "[1]", root)); - }, - postDataFromLink: function(link) { - var boardID, match, postID, ref, ref1, threadID; - if (link.dataset.postID) { - ref = link.dataset, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID; - threadID || (threadID = 0); - } else { - match = link.href.match(g.SITE.regexp.quotelink); - ref1 = match.slice(1), boardID = ref1[0], threadID = ref1[1], postID = ref1[2]; - postID || (postID = threadID); - } - return { - boardID: boardID, - threadID: +threadID, - postID: +postID - }; - }, - allQuotelinksLinkingTo: function(post) { - var fullID, handleQuotes, i, len, posts, qPost, quote, quotelinks, ref; - quotelinks = []; - posts = g.posts; - fullID = post.fullID; - handleQuotes = function(qPost, type) { - var clone, i, len, ref; - quotelinks.push.apply(quotelinks, qPost.nodes[type]); - ref = qPost.clones; - for (i = 0, len = ref.length; i < len; i++) { - clone = ref[i]; - quotelinks.push.apply(quotelinks, clone.nodes[type]); - } - }; - posts.forEach(function(qPost) { - if (indexOf.call(qPost.quotes, fullID) >= 0) { - return handleQuotes(qPost, 'quotelinks'); - } - }); - if (Conf['Quote Backlinks']) { - ref = post.quotes; - for (i = 0, len = ref.length; i < len; i++) { - quote = ref[i]; - if (qPost = posts.get(quote)) { - handleQuotes(qPost, 'backlinks'); - } - } - } - return quotelinks.filter(function(quotelink) { - var boardID, postID, ref1; - ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID; - return boardID === post.board.ID && postID === post.ID; - }); - } - }; - - return Get; - -}).call(this); - -Header = (function() { - var Header, - slice = [].slice; - - Header = { - init: function() { - var barFixedToggler, barPositionToggler, box, cs, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, menuButton, scrollHeaderToggler, shortcutToggler; - $.onExists(doc, 'body', (function(_this) { - return function() { - if (!Main.isThisPageLegit()) { - return; - } - $.add(_this.bar, [_this.noticesRoot, _this.toggle]); - $.prepend(d.body, _this.bar); - $.add(d.body, Header.hover); - return _this.setBarPosition(Conf['Bottom Header']); - }; - })(this)); - this.menu = new UI.Menu('header'); - menuButton = $.el('span', { - className: 'menu-button' - }); - $.extend(menuButton, {innerHTML: ""}); - box = UI.checkbox; - barFixedToggler = box('Fixed Header', 'Fixed Header'); - headerToggler = box('Header auto-hide', 'Auto-hide header'); - scrollHeaderToggler = box('Header auto-hide on scroll', 'Auto-hide header on scroll'); - barPositionToggler = box('Bottom Header', 'Bottom header'); - linkJustifyToggler = box('Centered links', 'Centered links'); - customNavToggler = box('Custom Board Navigation', 'Custom board navigation'); - footerToggler = box('Bottom Board List', 'Hide bottom board list'); - shortcutToggler = box('Shortcut Icons', 'Shortcut Icons'); - editCustomNav = $.el('a', { - textContent: 'Edit custom board navigation', - href: 'javascript:;' - }); - this.barFixedToggler = barFixedToggler.firstElementChild; - this.scrollHeaderToggler = scrollHeaderToggler.firstElementChild; - this.barPositionToggler = barPositionToggler.firstElementChild; - this.linkJustifyToggler = linkJustifyToggler.firstElementChild; - this.headerToggler = headerToggler.firstElementChild; - this.footerToggler = footerToggler.firstElementChild; - this.shortcutToggler = shortcutToggler.firstElementChild; - this.customNavToggler = customNavToggler.firstElementChild; - $.on(menuButton, 'click', this.menuToggle); - $.on(this.headerToggler, 'change', this.toggleBarVisibility); - $.on(this.barFixedToggler, 'change', this.toggleBarFixed); - $.on(this.barPositionToggler, 'change', this.toggleBarPosition); - $.on(this.scrollHeaderToggler, 'change', this.toggleHideBarOnScroll); - $.on(this.linkJustifyToggler, 'change', this.toggleLinkJustify); - $.on(this.footerToggler, 'change', this.toggleFooterVisibility); - $.on(this.shortcutToggler, 'change', this.toggleShortcutIcons); - $.on(this.customNavToggler, 'change', this.toggleCustomNav); - $.on(editCustomNav, 'click', this.editCustomNav); - this.setBarFixed(Conf['Fixed Header']); - this.setHideBarOnScroll(Conf['Header auto-hide on scroll']); - this.setBarVisibility(Conf['Header auto-hide']); - this.setLinkJustify(Conf['Centered links']); - this.setShortcutIcons(Conf['Shortcut Icons']); - this.setFooterVisibility(Conf['Bottom Board List']); - $.sync('Fixed Header', this.setBarFixed); - $.sync('Header auto-hide on scroll', this.setHideBarOnScroll); - $.sync('Bottom Header', this.setBarPosition); - $.sync('Shortcut Icons', this.setShortcutIcons); - $.sync('Header auto-hide', this.setBarVisibility); - $.sync('Centered links', this.setLinkJustify); - $.sync('Bottom Board List', this.setFooterVisibility); - this.addShortcut('menu', menuButton, 900); - this.menu.addEntry({ - el: $.el('span', { - textContent: 'Header' - }), - order: 107, - subEntries: [ - { - el: barFixedToggler - }, { - el: headerToggler - }, { - el: scrollHeaderToggler - }, { - el: barPositionToggler - }, { - el: linkJustifyToggler - }, { - el: footerToggler - }, { - el: shortcutToggler - }, { - el: customNavToggler - }, { - el: editCustomNav - } - ] - }); - $.on(window, 'load popstate', Header.hashScroll); - $.on(d, 'CreateNotification', this.createNotification); - this.setBoardList(); - $.onExists(doc, g.SITE.selectors.boardList + " + *", Header.generateFullBoardList); - Main.ready(function() { - var a, absbot, footer, i, len, ref; - if (g.SITE.software === 'yotsuba' && !(footer = $.id('boardNavDesktopFoot'))) { - if (!(absbot = $.id('absbot'))) { - return; - } - footer = $.id('boardNavDesktop').cloneNode(true); - footer.id = 'boardNavDesktopFoot'; - $('#navtopright', footer).id = 'navbotright'; - $('#settingsWindowLink', footer).id = 'settingsWindowLinkBot'; - $.before(absbot, footer); - $.global(function() { - return window.cloneTopNav = function() {}; - }); - } - if ((Header.bottomBoardList = $(g.SITE.selectors.boardListBottom))) { - ref = $$('a', Header.bottomBoardList); - for (i = 0, len = ref.length; i < len; i++) { - a = ref[i]; - if (a.hostname === location.hostname && a.pathname.split('/')[1] === g.BOARD.ID) { - a.className = 'current'; - } - } - return CatalogLinks.setLinks(Header.bottomBoardList); - } - }); - if (g.SITE.software === 'yotsuba' && (g.VIEW === 'catalog' || !Conf['Disable Native Extension'])) { - cs = $.el('a', { - href: 'javascript:;' - }); - if (g.VIEW === 'catalog') { - cs.title = cs.textContent = 'Catalog Settings'; - cs.className = 'fa fa-book'; - } else { - cs.title = cs.textContent = '4chan Settings'; - cs.className = 'native-settings'; - } - $.on(cs, 'click', function() { - return $.id('settingsWindowLink').click(); - }); - this.addShortcut('native', cs, 810); - } - return this.enableDesktopNotifications(); - }, - bar: $.el('div', { - id: 'header-bar' - }), - noticesRoot: $.el('div', { - id: 'notifications' - }), - shortcuts: $.el('span', { - id: 'shortcuts' - }), - hover: $.el('div', { - id: 'hoverUI' - }), - toggle: $.el('div', { - id: 'scroll-marker' - }), - setBoardList: function() { - var boardList, btn; - Header.boardList = boardList = $.el('span', { - id: 'board-list' - }); - $.extend(boardList, {innerHTML: ""}); - btn = $('.hide-board-list-button', boardList); - $.on(btn, 'click', Header.toggleBoardList); - $.prepend(Header.bar, [Header.boardList, Header.shortcuts]); - Header.setCustomNav(Conf['Custom Board Navigation']); - Header.generateBoardList(Conf['boardnav']); - $.sync('Custom Board Navigation', Header.setCustomNav); - return $.sync('boardnav', Header.generateBoardList); - }, - generateFullBoardList: function() { - var a, fullBoardList, i, len, nodes, ref; - if (g.SITE.transformBoardList) { - nodes = g.SITE.transformBoardList(); - } else { - nodes = slice.call($(g.SITE.selectors.boardList).cloneNode(true).childNodes); - } - fullBoardList = $('.boardList', Header.boardList); - $.add(fullBoardList, nodes); - ref = $$('a', fullBoardList); - for (i = 0, len = ref.length; i < len; i++) { - a = ref[i]; - if (a.hostname === location.hostname && a.pathname.split('/')[1] === g.BOARD.ID) { - a.className = 'current'; - } - } - return CatalogLinks.setLinks(fullBoardList); - }, - generateBoardList: function(boardnav) { - var list, nodes, re, t; - list = $('#custom-board-list', Header.boardList); - $.rmAll(list); - if (!boardnav) { - return; - } - boardnav = boardnav.replace(/(\r\n|\n|\r)/g, ' '); - re = /[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|nt|(mode|sort|text):"[^"]+"(,"[^"]+")?))*|[^\w@]+/g; - nodes = (function() { - var i, len, ref, results; - ref = boardnav.match(re); - results = []; - for (i = 0, len = ref.length; i < len; i++) { - t = ref[i]; - results.push(Header.mapCustomNavigation(t)); - } - return results; - })(); - $.add(list, nodes); - return CatalogLinks.setLinks(list); - }, - mapCustomNavigation: function(t) { - var a, boardID, href, indexOptions, m, ref, ref1, text, url, urlIC; - if (/^[^\w@]/.test(t)) { - return $.tn(t); - } - text = url = null; - t = t.replace(/-text:"([^"]+)"(?:,"([^"]+)")?/g, function(m0, m1, m2) { - text = m1; - url = m2; - return ''; - }); - indexOptions = []; - t = t.replace(/-(?:mode|sort):"([^"]+)"/g, function(m0, m1) { - indexOptions.push(m1.toLowerCase().replace(/\ /g, '-')); - return ''; - }); - indexOptions = indexOptions.join('/'); - if (/^toggle-all/.test(t)) { - a = $.el('a', { - className: 'show-board-list-button', - textContent: text || '+', - href: 'javascript:;' - }); - $.on(a, 'click', Header.toggleBoardList); - return a; - } - if (/^external/.test(t)) { - a = $.el('a', { - href: url || 'javascript:;', - textContent: text || '+', - className: 'external' - }); - if (/-nt/.test(t)) { - a.target = '_blank'; - a.rel = 'noopener'; - } - return a; - } - boardID = t.split('-')[0]; - if (boardID === 'current') { - if ((ref = location.hostname) === 'boards.4chan.org' || ref === 'boards.4channel.org') { - boardID = g.BOARD.ID; - } else { - a = $.el('a', { - href: "/" + g.BOARD.ID + "/", - textContent: text || decodeURIComponent(g.BOARD.ID), - className: 'current' - }); - if (/-nt/.test(t)) { - a.target = '_blank'; - a.rel = 'noopener'; - } - if (/-index/.test(t)) { - a.dataset.only = 'index'; - } else if (/-catalog/.test(t)) { - a.dataset.only = 'catalog'; - a.href += 'catalog.html'; - } else if (/-(archive|expired)/.test(t)) { - a = a.firstChild; - } - return a; - } - } - a = (function() { - var ref1, urlV; - if (boardID === '@') { - return $.el('a', { - href: 'https://twitter.com/4chan', - title: '4chan Twitter', - textContent: '@' - }); - } - a = $.el('a', { - href: "//" + (BoardConfig.domain(boardID)) + "/" + boardID + "/", - textContent: boardID, - title: BoardConfig.title(boardID) - }); - if (((ref1 = g.VIEW) === 'catalog' || ref1 === 'archive') && (urlV = Get.url(g.VIEW, { - siteID: '4chan.org', - boardID: boardID - }))) { - a.href = urlV; - } - if (a.hostname === location.hostname && boardID === g.BOARD.ID) { - a.className = 'current'; - } - return a; - })(); - a.textContent = /-title/.test(t) || /-replace/.test(t) && a.hostname === location.hostname && boardID === g.BOARD.ID ? a.title || a.textContent : /-full/.test(t) ? ("/" + boardID + "/") + (a.title ? " - " + a.title : '') : text || boardID; - if (m = t.match(/-(index|catalog)/)) { - urlIC = CatalogLinks[m[1]]({ - siteID: '4chan.org', - boardID: boardID - }); - if (urlIC) { - a.dataset.only = m[1]; - a.href = urlIC; - if (m[1] === 'catalog') { - $.addClass(a, 'catalog'); - } - } else { - return a.firstChild; - } - } - if (Conf['JSON Index'] && indexOptions) { - a.dataset.indexOptions = indexOptions; - if (((ref1 = a.hostname) === 'boards.4chan.org' || ref1 === 'boards.4channel.org') && a.pathname.split('/')[2] === '') { - a.href += (a.hash ? '/' : '#') + indexOptions; - } - } - if (/-archive/.test(t)) { - if (href = Redirect.to('board', { - boardID: boardID - })) { - a.href = href; - } else { - return a.firstChild; - } - } - if (/-expired/.test(t)) { - if (BoardConfig.isArchived(boardID)) { - a.href = "//" + (BoardConfig.domain(boardID)) + "/" + boardID + "/archive"; - } else { - return a.firstChild; - } - } - if (/-nt/.test(t)) { - a.target = '_blank'; - a.rel = 'noopener'; - } - if (boardID === '@') { - $.addClass(a, 'navSmall'); - } - return a; - }, - toggleBoardList: function() { - var bar, custom, full, showBoardList; - bar = Header.bar; - custom = $('#custom-board-list', bar); - full = $('#full-board-list', bar); - showBoardList = !full.hidden; - custom.hidden = !showBoardList; - return full.hidden = showBoardList; - }, - setLinkJustify: function(centered) { - Header.linkJustifyToggler.checked = centered; - if (centered) { - return $.addClass(doc, 'centered-links'); - } else { - return $.rmClass(doc, 'centered-links'); - } - }, - toggleLinkJustify: function() { - var centered; - $.event('CloseMenu'); - centered = this.nodeName === 'INPUT' ? this.checked : void 0; - Header.setLinkJustify(centered); - return $.set('Centered links', centered); - }, - setBarFixed: function(fixed) { - Header.barFixedToggler.checked = fixed; - if (fixed) { - $.addClass(doc, 'fixed'); - return $.addClass(Header.bar, 'dialog'); - } else { - $.rmClass(doc, 'fixed'); - return $.rmClass(Header.bar, 'dialog'); - } - }, - toggleBarFixed: function() { - $.event('CloseMenu'); - Header.setBarFixed(this.checked); - Conf['Fixed Header'] = this.checked; - return $.set('Fixed Header', this.checked); - }, - setShortcutIcons: function(show) { - Header.shortcutToggler.checked = show; - if (show) { - return $.addClass(doc, 'shortcut-icons'); - } else { - return $.rmClass(doc, 'shortcut-icons'); - } - }, - toggleShortcutIcons: function() { - $.event('CloseMenu'); - Header.setShortcutIcons(this.checked); - Conf['Shortcut Icons'] = this.checked; - return $.set('Shortcut Icons', this.checked); - }, - setBarVisibility: function(hide) { - Header.headerToggler.checked = hide; - $.event('CloseMenu'); - (hide ? $.addClass : $.rmClass)(Header.bar, 'autohide'); - return (hide ? $.addClass : $.rmClass)(doc, 'autohide'); - }, - toggleBarVisibility: function() { - var hide, message; - hide = this.nodeName === 'INPUT' ? this.checked : !$.hasClass(Header.bar, 'autohide'); - Conf['Header auto-hide'] = hide; - $.set('Header auto-hide', hide); - Header.setBarVisibility(hide); - message = "The header bar will " + (hide ? 'automatically hide itself.' : 'remain visible.'); - return new Notice('info', message, 2); - }, - setHideBarOnScroll: function(hide) { - Header.scrollHeaderToggler.checked = hide; - if (hide) { - $.on(window, 'scroll', Header.hideBarOnScroll); - return; - } - $.off(window, 'scroll', Header.hideBarOnScroll); - $.rmClass(Header.bar, 'scroll'); - return Header.bar.classList.toggle('autohide', Conf['Header auto-hide']); - }, - toggleHideBarOnScroll: function() { - var hide; - hide = this.checked; - $.cb.checked.call(this); - return Header.setHideBarOnScroll(hide); - }, - hideBarOnScroll: function() { - var offsetY; - offsetY = window.pageYOffset; - if (offsetY > (Header.previousOffset || 0)) { - $.addClass(Header.bar, 'autohide', 'scroll'); - } else { - $.rmClass(Header.bar, 'autohide', 'scroll'); - } - return Header.previousOffset = offsetY; - }, - setBarPosition: function(bottom) { - var args, ref; - if ((ref = Header.barPositionToggler) != null) { - ref.checked = bottom; - } - $.event('CloseMenu'); - args = bottom ? ['bottom-header', 'top-header', 'after'] : ['top-header', 'bottom-header', 'add']; - $.addClass(doc, args[0]); - $.rmClass(doc, args[1]); - return $[args[2]](Header.bar, Header.noticesRoot); - }, - toggleBarPosition: function() { - $.cb.checked.call(this); - return Header.setBarPosition(this.checked); - }, - setFooterVisibility: function(hide) { - Header.footerToggler.checked = hide; - return doc.classList.toggle('hide-bottom-board-list', hide); - }, - toggleFooterVisibility: function() { - var hide, message; - $.event('CloseMenu'); - hide = this.nodeName === 'INPUT' ? this.checked : $.hasClass(doc, 'hide-bottom-board-list'); - Header.setFooterVisibility(hide); - $.set('Bottom Board List', hide); - message = hide ? 'The bottom navigation will now be hidden.' : 'The bottom navigation will remain visible.'; - return new Notice('info', message, 2); - }, - setCustomNav: function(show) { - var btn, cust, full, ref; - Header.customNavToggler.checked = show; - cust = $('#custom-board-list', Header.bar); - full = $('#full-board-list', Header.bar); - btn = $('.hide-board-list-container', full); - return ref = show ? [false, true, false] : [true, false, true], cust.hidden = ref[0], full.hidden = ref[1], btn.hidden = ref[2], ref; - }, - toggleCustomNav: function() { - $.cb.checked.call(this); - return Header.setCustomNav(this.checked); - }, - editCustomNav: function() { - var settings; - Settings.open('Advanced'); - settings = $.id('fourchanx-settings'); - return $('[name=boardnav]', settings).focus(); - }, - hashScroll: function(e) { - var el, hash; - if (e) { - if (e.state) { - return; - } - if (!history.state) { - history.replaceState({}, ''); - } - } - if ((hash = location.hash.slice(1))) { - ReplyPruning.showIfHidden(hash); - if ((el = $.id(hash))) { - return $.queueTask(function() { - return Header.scrollTo(el); - }); - } - } - }, - scrollTo: function(root, down, needed) { - var height, x; - if (!root.offsetParent) { - return; - } - if (down) { - x = Header.getBottomOf(root); - if (Conf['Fixed Header'] && Conf['Header auto-hide on scroll'] && Conf['Bottom header']) { - height = Header.bar.getBoundingClientRect().height; - if (x <= 0) { - if (!Header.isHidden()) { - x += height; - } - } else { - if (Header.isHidden()) { - x -= height; - } - } - } - if (!(needed && x >= 0)) { - return window.scrollBy(0, -x); - } - } else { - x = Header.getTopOf(root); - if (Conf['Fixed Header'] && Conf['Header auto-hide on scroll'] && !Conf['Bottom header']) { - height = Header.bar.getBoundingClientRect().height; - if (x >= 0) { - if (!Header.isHidden()) { - x += height; - } - } else { - if (Header.isHidden()) { - x -= height; - } - } - } - if (!(needed && x >= 0)) { - return window.scrollBy(0, x); - } - } - }, - scrollToIfNeeded: function(root, down) { - return Header.scrollTo(root, down, true); - }, - getTopOf: function(root) { - var headRect, top; - top = root.getBoundingClientRect().top; - if (Conf['Fixed Header'] && !Conf['Bottom Header']) { - headRect = Header.toggle.getBoundingClientRect(); - top -= headRect.top + headRect.height; - } - return top; - }, - getBottomOf: function(root) { - var bottom, clientHeight, headRect; - clientHeight = doc.clientHeight; - bottom = clientHeight - root.getBoundingClientRect().bottom; - if (Conf['Fixed Header'] && Conf['Bottom Header']) { - headRect = Header.toggle.getBoundingClientRect(); - bottom -= clientHeight - headRect.bottom + headRect.height; - } - return bottom; - }, - isNodeVisible: function(node) { - var height; - if (d.hidden || !doc.contains(node)) { - return false; - } - height = node.getBoundingClientRect().height; - return Header.getTopOf(node) + height >= 0 && Header.getBottomOf(node) + height >= 0; - }, - isHidden: function() { - var top; - top = Header.bar.getBoundingClientRect().top; - if (Conf['Bottom header']) { - return top === doc.clientHeight; - } else { - return top < 0; - } - }, - addShortcut: function(id, el, index) { - var i, item, len, ref, shortcut; - shortcut = $.el('span', { - id: "shortcut-" + id, - className: 'shortcut brackets-wrap' - }); - $.add(shortcut, el); - shortcut.dataset.index = index; - ref = $$('[data-index]', Header.shortcuts); - for (i = 0, len = ref.length; i < len; i++) { - item = ref[i]; - if (!(+item.dataset.index > +index)) { - continue; - } - $.before(item, shortcut); - return; - } - return $.add(Header.shortcuts, shortcut); - }, - rmShortcut: function(el) { - return $.rm(el.parentElement); - }, - menuToggle: function(e) { - return Header.menu.toggle(e, this, g); - }, - createNotification: function(e) { - var content, lifetime, notice, ref, type; - ref = e.detail, type = ref.type, content = ref.content, lifetime = ref.lifetime; - return notice = new Notice(type, content, lifetime); - }, - areNotificationsEnabled: false, - enableDesktopNotifications: function() { - var authorize, disable, el, notice, ref; - if (!(window.Notification && Conf['Desktop Notifications'])) { - return; - } - switch (Notification.permission) { - case 'granted': - Header.areNotificationsEnabled = true; - return; - case 'denied': - return; - } - el = $.el('span', {innerHTML: "4chan X needs your permission to show desktop notifications. [FAQ]
      or "}); - ref = $$('button', el), authorize = ref[0], disable = ref[1]; - $.on(authorize, 'click', function() { - return Notification.requestPermission(function(status) { - Header.areNotificationsEnabled = status === 'granted'; - if (status === 'default') { - return; - } - return notice.close(); - }); - }); - $.on(disable, 'click', function() { - $.set('Desktop Notifications', false); - return notice.close(); - }); - return notice = new Notice('info', el); - } - }; - - return Header; - -}).call(this); - -Index = (function() { - var Index, - slice = [].slice, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Index = { - showHiddenThreads: false, - changed: {}, - enabledOn: function(arg) { - var boardID, siteID; - siteID = arg.siteID, boardID = arg.boardID; - return Conf['JSON Index'] && g.sites[siteID].software === 'yotsuba' && boardID !== 'f'; - }, - init: function() { - var arr, entries, i, input, inputs, k, l, label, len1, len2, name, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, select, sortEntry, tRaw, watchSettings; - if (g.VIEW !== 'index') { - return; - } - $.one(d, '4chanXInitFinished', this.cb.initFinished); - $.on(d, 'PostsInserted', this.cb.postsInserted); - if (!this.enabledOn(g.BOARD)) { - return; - } - this.enabled = true; - Callbacks.Post.push({ - name: 'Index Page Numbers', - cb: this.node - }); - Callbacks.CatalogThread.push({ - name: 'Catalog Features', - cb: this.catalogNode - }); - this.search = ((ref = history.state) != null ? ref.searched : void 0) || ''; - if ((ref1 = history.state) != null ? ref1.mode : void 0) { - Conf['Index Mode'] = (ref2 = history.state) != null ? ref2.mode : void 0; - } - this.currentSort = (ref3 = history.state) != null ? ref3.sort : void 0; - this.currentSort || (this.currentSort = typeof Conf['Index Sort'] === 'object' ? Conf['Index Sort'][g.BOARD.ID] || 'bump' : Conf['Index Sort']); - this.currentPage = this.getCurrentPage(); - this.processHash(); - $.addClass(doc, 'index-loading', (Conf['Index Mode'].replace(/\ /g, '-')) + "-mode"); - $.on(window, 'popstate', this.cb.popstate); - $.on(d, 'scroll', this.scroll); - $.on(d, 'SortIndex', this.cb.resort); - this.button = $.el('a', { - className: 'fa fa-refresh', - title: 'Refresh', - href: 'javascript:;', - textContent: 'Refresh Index' - }); - $.on(this.button, 'click', function() { - return Index.update(); - }); - Header.addShortcut('index-refresh', this.button, 590); - entries = []; - this.inputs = inputs = $.dict(); - ref4 = Config.Index; - for (name in ref4) { - arr = ref4[name]; - if (!(arr instanceof Array)) { - continue; - } - label = UI.checkbox(name, "" + name[0] + (name.slice(1).toLowerCase())); - label.title = arr[1]; - entries.push({ - el: label - }); - input = label.firstChild; - $.on(input, 'change', $.cb.checked); - inputs[name] = input; - } - $.on(inputs['Show Replies'], 'change', this.cb.replies); - $.on(inputs['Catalog Hover Expand'], 'change', this.cb.hover); - $.on(inputs['Pin Watched Threads'], 'change', this.cb.resort); - $.on(inputs['Anchor Hidden Threads'], 'change', this.cb.resort); - watchSettings = function(e) { - if ((input = $.getOwn(inputs, e.target.name))) { - input.checked = e.target.checked; - return $.event('change', null, input); - } - }; - $.on(d, 'OpenSettings', function() { - return $.on($.id('fourchanx-settings'), 'change', watchSettings); - }); - sortEntry = UI.checkbox('Per-Board Sort Type', 'Per-board sort type', typeof Conf['Index Sort'] === 'object'); - sortEntry.title = 'Set the sorting order of each board independently.'; - $.on(sortEntry.firstChild, 'change', this.cb.perBoardSort); - entries.splice(3, 0, { - el: sortEntry - }); - Header.menu.addEntry({ - el: $.el('span', { - textContent: 'Index Navigation' - }), - order: 100, - subEntries: entries - }); - this.navLinks = $.el('div', { - className: 'navLinks json-index' - }); - $.extend(this.navLinks, {innerHTML: "Index Catalog Archive Bottom ×"}); - $('.cataloglink a', this.navLinks).href = CatalogLinks.catalog(); - if (!BoardConfig.isArchived(g.BOARD.ID)) { - $('.archlistlink', this.navLinks).hidden = true; - } - $.on($('#index-last-refresh a', this.navLinks), 'click', this.cb.refreshFront); - this.searchInput = $('#index-search', this.navLinks); - this.setupSearch(); - $.on(this.searchInput, 'input', this.onSearchInput); - $.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch); - this.hideLabel = $('#hidden-label', this.navLinks); - $.on($('#hidden-toggle a', this.navLinks), 'click', this.cb.toggleHiddenThreads); - this.selectRev = $('#index-rev', this.navLinks); - this.selectMode = $('#index-mode', this.navLinks); - this.selectSort = $('#index-sort', this.navLinks); - this.selectSize = $('#index-size', this.navLinks); - $.on(this.selectRev, 'change', this.cb.sort); - $.on(this.selectMode, 'change', this.cb.mode); - $.on(this.selectSort, 'change', this.cb.sort); - $.on(this.selectSize, 'change', $.cb.value); - $.on(this.selectSize, 'change', this.cb.size); - ref5 = [this.selectMode, this.selectSize]; - for (k = 0, len1 = ref5.length; k < len1; k++) { - select = ref5[k]; - select.value = Conf[select.name]; - } - this.selectRev.checked = /-rev$/.test(Index.currentSort); - this.selectSort.value = Index.currentSort.replace(/-rev$/, ''); - this.lastLongOptions = $('#lastlong-options', this.navLinks); - this.lastLongInputs = $$('input', this.lastLongOptions); - this.lastLongThresholds = [0, 0]; - this.lastLongOptions.hidden = this.selectSort.value !== 'lastlong'; - ref6 = this.lastLongInputs; - for (i = l = 0, len2 = ref6.length; l < len2; i = ++l) { - input = ref6[i]; - $.on(input, 'change', this.cb.lastLongThresholds); - tRaw = Conf["Last Long Reply Thresholds " + i]; - input.value = this.lastLongThresholds[i] = typeof tRaw === 'object' ? (ref7 = tRaw[g.BOARD.ID]) != null ? ref7 : 100 : tRaw; - } - this.root = $.el('div', { - className: 'board json-index' - }); - $.on(this.root, 'click', this.cb.hoverToggle); - this.cb.size(); - this.cb.hover(); - this.pagelist = $.el('div', { - className: 'pagelist json-index' - }); - $.extend(this.pagelist, {innerHTML: "
      "}); - $('.cataloglink a', this.pagelist).href = CatalogLinks.catalog(); - $.on(this.pagelist, 'click', this.cb.pageNav); - this.update(true); - $.onExists(doc, 'title + *', function() { - return d.title = d.title.replace(/\ -\ Page\ \d+/, ''); - }); - $.onExists(doc, '.board > .thread > .postContainer, .board + *', function() { - var board, el, len3, m, ref8, timeEl, topNavPos; - g.SITE.Build.hat = $('.board > .thread > img:first-child'); - if (g.SITE.Build.hat) { - g.BOARD.threads.forEach(function(thread) { - if (thread.nodes.root) { - return $.prepend(thread.nodes.root, g.SITE.Build.hat.cloneNode(false)); - } - }); - $.addClass(doc, 'hats-enabled'); - $.addStyle(".catalog-thread::after {background-image: url(" + g.SITE.Build.hat.src + ");}"); - } - board = $('.board'); - $.replace(board, Index.root); - if (Index.loaded) { - $.event('PostsInserted', null, Index.root); - } - try { - d.implementation.createDocument(null, null, null).appendChild(board); - } catch (error) {} - ref8 = $$('.navLinks'); - for (m = 0, len3 = ref8.length; m < len3; m++) { - el = ref8[m]; - $.rm(el); - } - $.rm($.id('ctrl-top')); - topNavPos = $.id('delform').previousElementSibling; - $.before(topNavPos, $.el('hr')); - $.before(topNavPos, Index.navLinks); - timeEl = $('#index-last-refresh time', Index.navLinks); - if (timeEl.dataset.utc) { - return RelativeDates.update(timeEl); - } - }); - return Main.ready(function() { - var pagelist; - if ((pagelist = $('.pagelist'))) { - $.replace(pagelist, Index.pagelist); - } - return $.rmClass(doc, 'index-loading'); - }); - }, - scroll: function() { - var pageNum, threadIDs; - if (Index.req || !Index.liveThreadData || Conf['Index Mode'] !== 'infinite' || (window.scrollY <= doc.scrollHeight - (300 + window.innerHeight))) { - return; - } - if (Index.pageNum == null) { - Index.pageNum = Index.currentPage; - } - pageNum = ++Index.pageNum; - if (pageNum > Index.pagesNum) { - return Index.endNotice(); - } - threadIDs = Index.threadsOnPage(pageNum); - return Index.buildStructure(threadIDs); - }, - endNotice: (function() { - var notify, reset; - notify = false; - reset = function() { - return notify = false; - }; - return function() { - if (notify) { - return; - } - notify = true; - new Notice('info', "Last page reached.", 2); - return setTimeout(reset, 3 * $.SECOND); - }; - })(), - menu: { - init: function() { - if (!(g.VIEW === 'index' && Conf['Menu'] && Conf['Thread Hiding Link'] && Index.enabledOn(g.BOARD))) { - return; - } - return Menu.menu.addEntry({ - el: $.el('a', { - href: 'javascript:;', - className: 'has-shortcut-text' - }, {innerHTML: "Shift+click"}), - order: 20, - open: function(arg) { - var thread; - thread = arg.thread; - if (Conf['Index Mode'] !== 'catalog') { - return false; - } - this.el.firstElementChild.textContent = thread.isHidden ? 'Unhide' : 'Hide'; - if (this.cb) { - $.off(this.el, 'click', this.cb); - } - this.cb = function() { - $.event('CloseMenu'); - return Index.toggleHide(thread); - }; - $.on(this.el, 'click', this.cb); - return true; - } - }); - } - }, - node: function() { - if (this.isReply || this.isClone || !(Index.threadPosition[this.ID] != null)) { - return; - } - return this.thread.setPage(Math.floor(Index.threadPosition[this.ID] / Index.threadsNumPerPage) + 1); - }, - catalogNode: function() { - return $.on(this.nodes.root, 'mousedown click', (function(_this) { - return function(e) { - if (!(e.button === 0 && e.shiftKey)) { - return; - } - if (e.type === 'click') { - Index.toggleHide(_this.thread); - } - return e.preventDefault(); - }; - })(this)); - }, - toggleHide: function(thread) { - if (Index.showHiddenThreads) { - ThreadHiding.show(thread); - if (!ThreadHiding.db.get({ - boardID: thread.board.ID, - threadID: thread.ID - })) { - return; - } - } else { - ThreadHiding.hide(thread); - } - return ThreadHiding.saveHiddenState(thread); - }, - cycleSortType: function() { - var i, k, len1, type, types; - types = slice.call(Index.selectSort.options).filter(function(option) { - return !option.disabled; - }); - for (i = k = 0, len1 = types.length; k < len1; i = ++k) { - type = types[i]; - if (type.selected) { - break; - } - } - types[(i + 1) % types.length].selected = true; - return $.event('change', null, Index.selectSort); - }, - cb: { - initFinished: function() { - Index.initFinishedFired = true; - return $.queueTask(function() { - return Index.cb.postsInserted(); - }); - }, - postsInserted: function() { - var n; - if (!Index.initFinishedFired) { - return; - } - n = 0; - g.posts.forEach(function(post) { - if (!post.isFetchedQuote && !post.indexRefreshSeen && doc.contains(post.nodes.root)) { - post.indexRefreshSeen = true; - return n++; - } - }); - if (n) { - return $.event('IndexRefresh'); - } - }, - toggleHiddenThreads: function() { - $('#hidden-toggle a', Index.navLinks).textContent = (Index.showHiddenThreads = !Index.showHiddenThreads) ? 'Hide' : 'Show'; - Index.sort(); - return Index.buildIndex(); - }, - mode: function() { - Index.pushState({ - mode: this.value - }); - return Index.pageLoad(false); - }, - sort: function() { - var value; - value = Index.selectRev.checked ? Index.selectSort.value + "-rev" : Index.selectSort.value; - Index.pushState({ - sort: value - }); - return Index.pageLoad(false); - }, - resort: function(e) { - var ref; - Index.changed.order = true; - if (!(e != null ? (ref = e.detail) != null ? ref.deferred : void 0 : void 0)) { - return Index.pageLoad(false); - } - }, - perBoardSort: function() { - var i, k; - Conf['Index Sort'] = this.checked ? $.dict() : ''; - Index.saveSort(); - for (i = k = 0; k < 2; i = ++k) { - Conf["Last Long Reply Thresholds " + i] = this.checked ? $.dict() : ''; - Index.saveLastLongThresholds(i); - } - }, - lastLongThresholds: function() { - var i, value; - i = slice.call(this.parentNode.children).indexOf(this); - value = +this.value; - if (!Number.isFinite(value)) { - this.value = Index.lastLongThresholds[i]; - return; - } - Index.lastLongThresholds[i] = value; - Index.saveLastLongThresholds(i); - Index.changed.order = true; - return Index.pageLoad(false); - }, - size: function(e) { - if (Conf['Index Mode'] !== 'catalog') { - $.rmClass(Index.root, 'catalog-small'); - $.rmClass(Index.root, 'catalog-large'); - } else if (Conf['Index Size'] === 'small') { - $.addClass(Index.root, 'catalog-small'); - $.rmClass(Index.root, 'catalog-large'); - } else { - $.addClass(Index.root, 'catalog-large'); - $.rmClass(Index.root, 'catalog-small'); - } - if (e) { - return Index.buildIndex(); - } - }, - replies: function() { - return Index.buildIndex(); - }, - hover: function() { - return doc.classList.toggle('catalog-hover-expand', Conf['Catalog Hover Expand']); - }, - hoverToggle: function(e) { - var input, thread; - if (Conf['Catalog Hover Toggle'] && $.hasClass(doc, 'catalog-mode') && !$.modifiedClick(e) && !$.x('ancestor-or-self::a', e.target)) { - input = Index.inputs['Catalog Hover Expand']; - input.checked = !input.checked; - $.event('change', null, input); - if ((thread = Get.threadFromNode(e.target))) { - Index.cb.catalogReplies.call(thread); - return Index.cb.hoverAdjust.call(thread.OP.nodes); - } - } - }, - popstate: function(e) { - var mode, nCommands, page, ref, searched, sort; - if (e != null ? e.state : void 0) { - ref = e.state, searched = ref.searched, mode = ref.mode, sort = ref.sort; - page = Index.getCurrentPage(); - Index.setState({ - search: searched, - mode: mode, - sort: sort, - page: page - }); - return Index.pageLoad(false); - } else { - nCommands = Index.processHash(); - if (Conf['Refreshed Navigation'] && nCommands) { - return Index.update(); - } else { - return Index.pageLoad(); - } - } - }, - pageNav: function(e) { - var a; - if ($.modifiedClick(e)) { - return; - } - switch (e.target.nodeName) { - case 'BUTTON': - e.target.blur(); - a = e.target.parentNode; - break; - case 'A': - a = e.target; - break; - default: - return; - } - if (a.textContent === 'Catalog') { - return; - } - e.preventDefault(); - return Index.userPageNav(+a.pathname.split(/\/+/)[2] || 1); - }, - refreshFront: function() { - Index.pushState({ - page: 1 - }); - return Index.update(); - }, - catalogReplies: function() { - if (Conf['Show Replies'] && $.hasClass(doc, 'catalog-hover-expand') && !this.catalogView.nodes.replies) { - return Index.buildCatalogReplies(this); - } - }, - hoverAdjust: function() { - var rect, style, x; - if (!$.hasClass(doc, 'catalog-hover-expand')) { - return; - } - rect = this.post.getBoundingClientRect(); - if ((x = $.minmax(0, -rect.left, doc.clientWidth - rect.right))) { - style = this.post.style; - style.left = x + "px"; - style.right = (-x) + "px"; - return $.one(this.root, 'mouseleave', function() { - return style.left = style.right = null; - }); - } - } - }, - scrollToIndex: function() { - return Header.scrollToIfNeeded((Index.navLinks.getBoundingClientRect().height ? Index.navLinks : Index.root)); - }, - getCurrentPage: function() { - return +window.location.pathname.split(/\/+/)[2] || 1; - }, - userPageNav: function(page) { - Index.pushState({ - page: page - }); - if (Conf['Refreshed Navigation']) { - return Index.update(); - } else { - return Index.pageLoad(); - } - }, - hashCommands: { - mode: { - 'paged': 'paged', - 'infinite-scrolling': 'infinite', - 'infinite': 'infinite', - 'all-threads': 'all pages', - 'all-pages': 'all pages', - 'catalog': 'catalog' - }, - sort: { - 'bump-order': 'bump', - 'last-reply': 'lastreply', - 'last-long-reply': 'lastlong', - 'creation-date': 'birth', - 'reply-count': 'replycount', - 'file-count': 'filecount', - 'posts-per-minute': 'activity' - } - }, - processHash: function() { - var command, commands, hash, k, leftover, len1, mode, ref, sort, state; - hash = ((ref = location.href.match(/#.*/)) != null ? ref[0] : void 0) || ''; - state = { - replace: true - }; - commands = hash.slice(1).split('/'); - leftover = []; - for (k = 0, len1 = commands.length; k < len1; k++) { - command = commands[k]; - if ((mode = $.getOwn(Index.hashCommands.mode, command))) { - state.mode = mode; - } else if (command === 'index') { - state.mode = Conf['Previous Index Mode']; - state.page = 1; - } else if ((sort = $.getOwn(Index.hashCommands.sort, command.replace(/-rev$/, '')))) { - state.sort = sort; - if (/-rev$/.test(command)) { - state.sort += '-rev'; - } - } else if (/^s=/.test(command)) { - state.search = decodeURIComponent(command.slice(2)).replace(/\+/g, ' ').trim(); - } else { - leftover.push(command); - } - } - hash = leftover.join('/'); - if (hash) { - state.hash = "#" + hash; - } - Index.pushState(state); - return commands.length - leftover.length; - }, - pushState: function(state) { - var hash, pageBeforeSearch, pathname, ref, replace, search; - search = state.search, hash = state.hash, replace = state.replace; - pageBeforeSearch = (ref = history.state) != null ? ref.oldpage : void 0; - if ((search != null) && search !== Index.search) { - state.page = search ? 1 : pageBeforeSearch || 1; - if (!search) { - pageBeforeSearch = void 0; - } else if (!Index.search) { - pageBeforeSearch = Index.currentPage; - } - } - Index.setState(state); - pathname = Index.currentPage === 1 ? "/" + g.BOARD + "/" : "/" + g.BOARD + "/" + Index.currentPage; - hash || (hash = ''); - return history[replace ? 'replaceState' : 'pushState']({ - mode: Conf['Index Mode'], - sort: Index.currentSort, - searched: Index.search, - oldpage: pageBeforeSearch - }, '', location.protocol + "//" + location.host + pathname + hash); - }, - setState: function(arg) { - var hash, mode, page, ref, search, sort; - search = arg.search, mode = arg.mode, sort = arg.sort, page = arg.page, hash = arg.hash; - if ((search != null) && search !== Index.search) { - Index.changed.search = true; - Index.search = search; - } - if ((mode != null) && mode !== Conf['Index Mode']) { - Index.changed.mode = true; - Conf['Index Mode'] = mode; - $.set('Index Mode', mode); - if (!(mode === 'catalog' || Conf['Previous Index Mode'] === mode)) { - Conf['Previous Index Mode'] = mode; - $.set('Previous Index Mode', mode); - } - } - if ((sort != null) && sort !== Index.currentSort) { - Index.changed.sort = true; - Index.currentSort = sort; - Index.saveSort(); - } - if ((ref = Conf['Index Mode']) === 'all pages' || ref === 'catalog') { - page = 1; - } - if ((page != null) && page !== Index.currentPage) { - Index.changed.page = true; - Index.currentPage = page; - } - if (hash != null) { - return Index.changed.hash = true; - } - }, - savePerBoard: function(key, value) { - if (typeof Conf[key] === 'object') { - Conf[key][g.BOARD.ID] = value; - } else { - Conf[key] = value; - } - return $.set(key, Conf[key]); - }, - saveSort: function() { - return Index.savePerBoard('Index Sort', Index.currentSort); - }, - saveLastLongThresholds: function(i) { - return Index.savePerBoard("Last Long Reply Thresholds " + i, Index.lastLongThresholds[i]); - }, - pageLoad: function(scroll) { - var hash, mode, order, page, ref, search, sort, threads; - if (scroll == null) { - scroll = true; - } - if (!Index.liveThreadData) { - return; - } - ref = Index.changed, threads = ref.threads, order = ref.order, search = ref.search, mode = ref.mode, sort = ref.sort, page = ref.page, hash = ref.hash; - threads || (threads = search); - order || (order = sort); - if (threads || order) { - Index.sort(); - } - if (threads) { - Index.buildPagelist(); - } - if (search) { - Index.setupSearch(); - } - if (mode) { - Index.setupMode(); - } - if (sort) { - Index.setupSort(); - } - if (threads || mode || page || order) { - Index.buildIndex(); - } - if (threads || page) { - Index.setPage(); - } - if (scroll && !hash) { - Index.scrollToIndex(); - } - if (hash) { - Header.hashScroll(); - } - return Index.changed = {}; - }, - setupMode: function() { - var k, len1, mode, ref; - ref = ['paged', 'infinite', 'all pages', 'catalog']; - for (k = 0, len1 = ref.length; k < len1; k++) { - mode = ref[k]; - $[mode === Conf['Index Mode'] ? 'addClass' : 'rmClass'](doc, (mode.replace(/\ /g, '-')) + "-mode"); - } - Index.selectMode.value = Conf['Index Mode']; - Index.cb.size(); - Index.showHiddenThreads = false; - return $('#hidden-toggle a', Index.navLinks).textContent = 'Show'; - }, - setupSort: function() { - Index.selectRev.checked = /-rev$/.test(Index.currentSort); - Index.selectSort.value = Index.currentSort.replace(/-rev$/, ''); - return Index.lastLongOptions.hidden = Index.selectSort.value !== 'lastlong'; - }, - getPagesNum: function() { - if (Index.search) { - return Math.ceil(Index.sortedThreadIDs.length / Index.threadsNumPerPage); - } else { - return Index.pagesNum; - } - }, - getMaxPageNum: function() { - return Math.max(1, Index.getPagesNum()); - }, - buildPagelist: function() { - var a, i, k, maxPageNum, nodes, pagesRoot, ref; - pagesRoot = $('.pages', Index.pagelist); - maxPageNum = Index.getMaxPageNum(); - if (pagesRoot.childElementCount !== maxPageNum) { - nodes = []; - for (i = k = 1, ref = maxPageNum; k <= ref; i = k += 1) { - a = $.el('a', { - textContent: i, - href: i === 1 ? './' : i - }); - nodes.push($.tn('['), a, $.tn('] ')); - } - $.rmAll(pagesRoot); - return $.add(pagesRoot, nodes); - } - }, - setPage: function() { - var a, href, maxPageNum, next, pageNum, pagesRoot, prev, strong; - pageNum = Index.currentPage; - maxPageNum = Index.getMaxPageNum(); - pagesRoot = $('.pages', Index.pagelist); - prev = pagesRoot.previousSibling.firstChild; - next = pagesRoot.nextSibling.firstChild; - href = Math.max(pageNum - 1, 1); - prev.href = href === 1 ? './' : href; - prev.firstChild.disabled = href === pageNum; - href = Math.min(pageNum + 1, maxPageNum); - next.href = href === 1 ? './' : href; - next.firstChild.disabled = href === pageNum; - if (strong = $('strong', pagesRoot)) { - if (+strong.textContent === pageNum) { - return; - } - $.replace(strong, strong.firstChild); - } else { - strong = $.el('strong'); - } - if ((a = pagesRoot.children[pageNum - 1])) { - $.before(a, strong); - return $.add(strong, a); - } - }, - updateHideLabel: function() { - var hiddenCount, k, len1, ref, threadID; - if (!Index.hideLabel) { - return; - } - hiddenCount = 0; - ref = Index.liveThreadIDs; - for (k = 0, len1 = ref.length; k < len1; k++) { - threadID = ref[k]; - if (Index.isHidden(threadID)) { - hiddenCount++; - } - } - if (!hiddenCount) { - Index.hideLabel.hidden = true; - if (Index.showHiddenThreads) { - Index.cb.toggleHiddenThreads(); - } - return; - } - Index.hideLabel.hidden = false; - return $('#hidden-count', Index.navLinks).textContent = hiddenCount === 1 ? '1 hidden thread' : hiddenCount + " hidden threads"; - }, - update: function(firstTime) { - var oldReq; - if ((oldReq = Index.req)) { - delete Index.req; - oldReq.abort(); - } - if (Conf['Index Refresh Notifications']) { - Index.notice || (Index.notice = new Notice('info', 'Refreshing index...')); - Index.nTimeout || (Index.nTimeout = setTimeout(function() { - var ref; - return (ref = Index.notice) != null ? ref.el.lastElementChild.textContent += ' (disable JSON Index if this takes too long)' : void 0; - }, 3 * $.SECOND)); - } else { - Index.nTimeout || (Index.nTimeout = setTimeout(function() { - return Index.notice || (Index.notice = new Notice('info', 'Refreshing index... (disable JSON Index if this takes too long)')); - }, 3 * $.SECOND)); - } - if (!firstTime && d.readyState !== 'loading' && !$('.board + *')) { - location.reload(); - return; - } - Index.req = $.whenModified(g.SITE.urls.catalogJSON({ - boardID: g.BOARD.ID - }), 'Index', Index.load); - return $.addClass(Index.button, 'fa-spin'); - }, - load: function() { - var err, nTimeout, notice, ref, timeEl; - if (this !== Index.req) { - return; - } - $.rmClass(Index.button, 'fa-spin'); - notice = Index.notice, nTimeout = Index.nTimeout; - if (nTimeout) { - clearTimeout(nTimeout); - } - delete Index.nTimeout; - delete Index.req; - delete Index.notice; - if ((ref = this.status) !== 200 && ref !== 304) { - err = "Index refresh failed. " + (this.status ? "Error " + this.statusText + " (" + this.status + ")" : 'Connection Error'); - if (notice) { - notice.setType('warning'); - notice.el.lastElementChild.textContent = err; - setTimeout(notice.close, $.SECOND); - } else { - new Notice('warning', err, 1); - } - return; - } - try { - if (this.status === 200) { - Index.parse(this.response); - } else if (this.status === 304) { - Index.pageLoad(); - } - } catch (error) { - err = error; - c.error("Index failure: " + err.message, err.stack); - if (notice) { - notice.setType('error'); - notice.el.lastElementChild.textContent = 'Index refresh failed.'; - setTimeout(notice.close, $.SECOND); - } else { - new Notice('error', 'Index refresh failed.', 1); - } - return; - } - if (notice) { - if (Conf['Index Refresh Notifications']) { - notice.setType('success'); - notice.el.lastElementChild.textContent = 'Index refreshed!'; - setTimeout(notice.close, $.SECOND); - } else { - notice.close(); - } - } - timeEl = $('#index-last-refresh time', Index.navLinks); - timeEl.dataset.utc = Date.parse(this.getResponseHeader('Last-Modified')); - return RelativeDates.update(timeEl); - }, - parse: function(pages) { - $.cleanCache(function(url) { - return /^https?:\/\/a\.4cdn\.org\//.test(url); - }); - Index.parseThreadList(pages); - Index.changed.threads = true; - return Index.pageLoad(); - }, - parseThreadList: function(pages) { - var ID, data, i, k, l, len1, len2, obj, ref, ref1, ref2, reply, results; - Index.pagesNum = pages.length; - Index.threadsNumPerPage = ((ref = pages[0]) != null ? ref.threads.length : void 0) || 1; - Index.liveThreadData = pages.reduce((function(arr, next) { - return arr.concat(next.threads); - }), []); - Index.liveThreadIDs = Index.liveThreadData.map(function(data) { - return data.no; - }); - Index.liveThreadDict = $.dict(); - Index.threadPosition = $.dict(); - Index.parsedThreads = $.dict(); - Index.replyData = $.dict(); - ref1 = Index.liveThreadData; - for (i = k = 0, len1 = ref1.length; k < len1; i = ++k) { - data = ref1[i]; - Index.liveThreadDict[data.no] = data; - Index.threadPosition[data.no] = i; - Index.parsedThreads[data.no] = obj = g.SITE.Build.parseJSON(data, g.BOARD); - obj.filterResults = results = Filter.test(obj); - obj.isOnTop = results.top; - obj.isHidden = results.hide || ThreadHiding.isHidden(obj.boardID, obj.threadID); - if (data.last_replies) { - ref2 = data.last_replies; - for (l = 0, len2 = ref2.length; l < len2; l++) { - reply = ref2[l]; - Index.replyData[g.BOARD + "." + reply.no] = reply; - } - } - } - if (Index.liveThreadData[0]) { - g.SITE.Build.spoilerRange[g.BOARD.ID] = Index.liveThreadData[0].custom_spoiler; - } - g.BOARD.threads.forEach(function(thread) { - var ref3; - if (ref3 = thread.ID, indexOf.call(Index.liveThreadIDs, ref3) < 0) { - return thread.collect(); - } - }); - $.event('IndexUpdate', { - threads: (function() { - var len3, m, ref3, results1; - ref3 = Index.liveThreadIDs; - results1 = []; - for (m = 0, len3 = ref3.length; m < len3; m++) { - ID = ref3[m]; - results1.push(g.BOARD + "." + ID); - } - return results1; - })() - }); - }, - isHidden: function(threadID) { - var thread; - if ((thread = g.BOARD.threads.get(threadID)) && thread.OP && !thread.OP.isFetchedQuote) { - return thread.isHidden; - } else { - return Index.parsedThreads[threadID].isHidden; - } - }, - isHiddenReply: function(threadID, replyData) { - return PostHiding.isHidden(g.BOARD.ID, threadID, replyData.no) || Filter.isHidden(g.SITE.Build.parseJSON(replyData, g.BOARD)); - }, - buildThreads: function(threadIDs, isCatalog, withReplies) { - var ID, OP, err, errors, isStale, k, lastPost, len1, newPosts, newThreads, obj, opRoot, t, thread, threadData, threads; - threads = []; - newThreads = []; - newPosts = []; - for (k = 0, len1 = threadIDs.length; k < len1; k++) { - ID = threadIDs[k]; - try { - threadData = Index.liveThreadDict[ID]; - if ((thread = g.BOARD.threads.get(ID))) { - isStale = (thread.json !== threadData) && (JSON.stringify(thread.json) !== JSON.stringify(threadData)); - if (isStale) { - thread.setCount('post', threadData.replies + 1, threadData.bumplimit); - thread.setCount('file', threadData.images + !!threadData.ext, threadData.imagelimit); - thread.setStatus('Sticky', !!threadData.sticky); - thread.setStatus('Closed', !!threadData.closed); - } - if (thread.catalogView) { - $.rm(thread.catalogView.nodes.replies); - thread.catalogView.nodes.replies = null; - } - } else { - thread = new Thread(ID, g.BOARD); - newThreads.push(thread); - } - lastPost = threadData.last_replies && threadData.last_replies.length ? threadData.last_replies[threadData.last_replies.length - 1].no : ID; - if (lastPost > thread.lastPost) { - thread.lastPost = lastPost; - } - thread.json = threadData; - threads.push(thread); - if ((OP = thread.OP) && !OP.isFetchedQuote) { - OP.setCatalogOP(isCatalog); - thread.setPage(Math.floor(Index.threadPosition[ID] / Index.threadsNumPerPage) + 1); - } else { - obj = Index.parsedThreads[ID]; - opRoot = g.SITE.Build.post(obj); - OP = new Post(opRoot, thread, g.BOARD); - OP.filterResults = obj.filterResults; - newPosts.push(OP); - } - if (!(isCatalog && thread.nodes.root)) { - g.SITE.Build.thread(thread, threadData, withReplies); - } - } catch (error) { - err = error; - if (!errors) { - errors = []; - } - errors.push({ - message: "Parsing of Thread No." + thread + " failed. Thread will be skipped.", - error: err, - html: opRoot != null ? opRoot.outerHTML : void 0 - }); - } - } - if (errors) { - Main.handleErrors(errors); - } - if (withReplies) { - newPosts = newPosts.concat(Index.buildReplies(threads)); - } - Main.callbackNodes('Thread', newThreads); - Main.callbackNodes('Post', newPosts); - Index.updateHideLabel(); - $.event('IndexRefreshInternal', { - threadIDs: (function() { - var l, len2, results1; - results1 = []; - for (l = 0, len2 = threads.length; l < len2; l++) { - t = threads[l]; - results1.push(t.fullID); - } - return results1; - })(), - isCatalog: isCatalog - }); - return threads; - }, - buildReplies: function(threads) { - var data, err, errors, k, l, lastReplies, len1, len2, node, nodes, post, posts, thread; - posts = []; - for (k = 0, len1 = threads.length; k < len1; k++) { - thread = threads[k]; - if (!(lastReplies = Index.liveThreadDict[thread.ID].last_replies)) { - continue; - } - nodes = []; - for (l = 0, len2 = lastReplies.length; l < len2; l++) { - data = lastReplies[l]; - if ((post = thread.posts.get(data.no)) && !post.isFetchedQuote) { - nodes.push(post.nodes.root); - continue; - } - nodes.push(node = g.SITE.Build.postFromObject(data, thread.board.ID)); - try { - posts.push(new Post(node, thread, thread.board)); - } catch (error) { - err = error; - if (!errors) { - errors = []; - } - errors.push({ - message: "Parsing of Post No." + data.no + " failed. Post will be skipped.", - error: err, - html: node != null ? node.outerHTML : void 0 - }); - } - } - $.add(thread.nodes.root, nodes); - } - if (errors) { - Main.handleErrors(errors); - } - return posts; - }, - buildCatalogViews: function(threads) { - var ID, catalogThreads, k, len1, page, root, thread; - catalogThreads = []; - for (k = 0, len1 = threads.length; k < len1; k++) { - thread = threads[k]; - if (!(!thread.catalogView)) { - continue; - } - ID = thread.ID; - page = Math.floor(Index.threadPosition[ID] / Index.threadsNumPerPage) + 1; - root = g.SITE.Build.catalogThread(thread, Index.liveThreadDict[ID], page); - catalogThreads.push(new CatalogThread(root, thread)); - } - Main.callbackNodes('CatalogThread', catalogThreads); - }, - sizeCatalogViews: function(threads) { - var height, k, len1, ratio, ref, size, thread, thumb, width; - size = Conf['Index Size'] === 'small' ? 150 : 250; - for (k = 0, len1 = threads.length; k < len1; k++) { - thread = threads[k]; - thumb = thread.catalogView.nodes.thumb; - ref = thumb.dataset, width = ref.width, height = ref.height; - if (!width) { - continue; - } - ratio = size / Math.max(width, height); - thumb.style.width = width * ratio + 'px'; - thumb.style.height = height * ratio + 'px'; - } - }, - buildCatalogReplies: function(thread) { - var data, k, lastReplies, len1, nodes, replies, reply; - nodes = thread.catalogView.nodes; - if (!(lastReplies = Index.liveThreadDict[thread.ID].last_replies)) { - return; - } - replies = []; - for (k = 0, len1 = lastReplies.length; k < len1; k++) { - data = lastReplies[k]; - if (Index.isHiddenReply(thread.ID, data)) { - continue; - } - reply = g.SITE.Build.catalogReply(thread, data); - RelativeDates.update($('time', reply)); - $.on($('.catalog-reply-preview', reply), 'mouseover', QuotePreview.mouseover); - replies.push(reply); - } - nodes.replies = $.el('div', { - className: 'catalog-replies' - }); - $.add(nodes.replies, replies); - $.add(thread.OP.nodes.post, nodes.replies); - }, - sort: function() { - var lastlong, lastlongD, liveThreadData, liveThreadIDs, repliesAvailable, sortType, thread, threadIDs, tmp_time; - liveThreadIDs = Index.liveThreadIDs, liveThreadData = Index.liveThreadData; - if (!liveThreadData) { - return; - } - tmp_time = new Date().getTime() / 1000; - sortType = Index.currentSort.replace(/-rev$/, ''); - Index.sortedThreadIDs = (function() { - var k, len1; - switch (sortType) { - case 'lastreply': - case 'lastlong': - repliesAvailable = liveThreadData.some(function(thread) { - var ref; - return (ref = thread.last_replies) != null ? ref.length : void 0; - }); - lastlong = function(thread) { - var i, k, len, r, ref, ref1; - if (!repliesAvailable) { - return thread.last_modified; - } - ref = thread.last_replies || []; - for (i = k = ref.length - 1; k >= 0; i = k += -1) { - r = ref[i]; - if (Index.isHiddenReply(thread.no, r)) { - continue; - } - if (sortType === 'lastreply') { - return r; - } - len = r.com ? g.SITE.Build.parseComment(r.com).replace(/[^a-z]/ig, '').length : 0; - if (len >= Index.lastLongThresholds[+(!!r.ext)]) { - return r; - } - } - if (thread.omitted_posts && ((ref1 = thread.last_replies) != null ? ref1.length : void 0)) { - return thread.last_replies[0]; - } else { - return thread; - } - }; - lastlongD = $.dict(); - for (k = 0, len1 = liveThreadData.length; k < len1; k++) { - thread = liveThreadData[k]; - lastlongD[thread.no] = lastlong(thread).no; - } - return slice.call(liveThreadData).sort(function(a, b) { - return lastlongD[b.no] - lastlongD[a.no]; - }).map(function(post) { - return post.no; - }); - case 'bump': - return liveThreadIDs; - case 'birth': - return slice.call(liveThreadIDs).sort(function(a, b) { - return b - a; - }); - case 'replycount': - return slice.call(liveThreadData).sort(function(a, b) { - return b.replies - a.replies; - }).map(function(post) { - return post.no; - }); - case 'filecount': - return slice.call(liveThreadData).sort(function(a, b) { - return b.images - a.images; - }).map(function(post) { - return post.no; - }); - case 'activity': - return slice.call(liveThreadData).sort(function(a, b) { - return (tmp_time - a.time) / (a.replies + 1) - (tmp_time - b.time) / (b.replies + 1); - }).map(function(post) { - return post.no; - }); - default: - return liveThreadIDs; - } - })(); - if (/-rev$/.test(Index.currentSort)) { - Index.sortedThreadIDs = slice.call(Index.sortedThreadIDs).reverse(); - } - if (Index.search && (threadIDs = Index.querySearch(Index.search))) { - Index.sortedThreadIDs = threadIDs; - } - Index.sortOnTop(function(obj) { - return obj.isSticky; - }); - Index.sortOnTop(function(obj) { - return obj.isOnTop || Conf['Pin Watched Threads'] && ThreadWatcher.isWatchedRaw(obj.boardID, obj.threadID); - }); - if (Conf['Anchor Hidden Threads']) { - return Index.sortOnTop(function(obj) { - return !Index.isHidden(obj.threadID); - }); - } - }, - sortOnTop: function(match) { - var ID, bottomThreads, k, len1, ref, topThreads; - topThreads = []; - bottomThreads = []; - ref = Index.sortedThreadIDs; - for (k = 0, len1 = ref.length; k < len1; k++) { - ID = ref[k]; - (match(Index.parsedThreads[ID]) ? topThreads : bottomThreads).push(ID); - } - return Index.sortedThreadIDs = topThreads.concat(bottomThreads); - }, - buildIndex: function() { - var threadIDs; - if (!Index.liveThreadData) { - return; - } - switch (Conf['Index Mode']) { - case 'all pages': - threadIDs = Index.sortedThreadIDs; - break; - case 'catalog': - threadIDs = Index.sortedThreadIDs.filter(function(ID) { - return !Index.isHidden(ID) !== Index.showHiddenThreads; - }); - break; - default: - threadIDs = Index.threadsOnPage(Index.currentPage); - } - delete Index.pageNum; - $.rmAll(Index.root); - $.rmAll(Header.hover); - if (Index.loaded && Index.root.parentNode) { - $.event('PostsRemoved', null, Index.root); - } - if (Conf['Index Mode'] === 'catalog') { - Index.buildCatalog(threadIDs); - } else { - Index.buildStructure(threadIDs); - } - }, - threadsOnPage: function(pageNum) { - var nodesPerPage, offset; - nodesPerPage = Index.threadsNumPerPage; - offset = nodesPerPage * (pageNum - 1); - return Index.sortedThreadIDs.slice(offset, offset + nodesPerPage); - }, - buildStructure: function(threadIDs) { - var k, len1, nodes, thread, threads; - threads = Index.buildThreads(threadIDs, false, Conf['Show Replies']); - nodes = []; - for (k = 0, len1 = threads.length; k < len1; k++) { - thread = threads[k]; - nodes.push(thread.nodes.root, $.el('hr')); - } - $.add(Index.root, nodes); - if (Index.root.parentNode) { - $.event('PostsInserted', null, Index.root); - } - Index.loaded = true; - }, - buildCatalog: function(threadIDs) { - var fn, i, n, node0; - i = 0; - n = threadIDs.length; - node0 = null; - fn = function() { - var j; - if (node0 && !node0.parentNode) { - return; - } - j = i > 0 && Index.root.parentNode ? n : i + 30; - node0 = Index.buildCatalogPart(threadIDs.slice(i, j))[0]; - i = j; - if (i < n) { - return $.queueTask(fn); - } else { - if (Index.root.parentNode) { - $.event('PostsInserted', null, Index.root); - } - return Index.loaded = true; - } - }; - fn(); - }, - buildCatalogPart: function(threadIDs) { - var k, len1, nodes, thread, threads; - threads = Index.buildThreads(threadIDs, true); - Index.buildCatalogViews(threads); - Index.sizeCatalogViews(threads); - nodes = []; - for (k = 0, len1 = threads.length; k < len1; k++) { - thread = threads[k]; - thread.OP.setCatalogOP(true); - $.add(thread.catalogView.nodes.root, thread.OP.nodes.root); - nodes.push(thread.catalogView.nodes.root); - $.on(thread.catalogView.nodes.root, 'mouseenter', Index.cb.catalogReplies.bind(thread)); - $.on(thread.OP.nodes.root, 'mouseenter', Index.cb.hoverAdjust.bind(thread.OP.nodes)); - } - $.add(Index.root, nodes); - return nodes; - }, - clearSearch: function() { - Index.searchInput.value = ''; - Index.onSearchInput(); - return Index.searchInput.focus(); - }, - setupSearch: function() { - Index.searchInput.value = Index.search; - if (Index.search) { - return Index.searchInput.dataset.searching = 1; - } else { - return Index.searchInput.removeAttribute('data-searching'); - } - }, - onSearchInput: function() { - var search; - search = Index.searchInput.value.trim(); - if (search === Index.search) { - return; - } - Index.pushState({ - search: search, - replace: !!search === !!Index.search - }); - return Index.pageLoad(false); - }, - querySearch: function(query) { - var keywords, match, regexp; - if ((match = query.match(/^([\w+]+):\/(.*)\/(\w*)$/))) { - try { - regexp = RegExp(match[2], match[3]); - } catch (error) { - return []; - } - return Index.sortedThreadIDs.filter(function(ID) { - return regexp.test(Filter.values(match[1], Index.parsedThreads[ID]).join('\n')); - }); - } - if (!(keywords = query.toLowerCase().match(/\S+/g))) { - return; - } - return Index.sortedThreadIDs.filter(function(ID) { - return Index.searchMatch(Index.parsedThreads[ID], keywords); - }); - }, - searchMatch: function(obj, keywords) { - var file, info, k, key, keyword, l, len1, len2, ref, text; - info = obj.info, file = obj.file; - if (info.comment == null) { - info.comment = g.SITE.Build.parseComment(info.commentHTML.innerHTML); - } - text = []; - ref = ['comment', 'subject', 'name', 'tripcode']; - for (k = 0, len1 = ref.length; k < len1; k++) { - key = ref[k]; - if (key in info) { - text.push(info[key]); - } - } - if (file) { - text.push(file.name); - } - text = text.join(' ').toLowerCase(); - for (l = 0, len2 = keywords.length; l < len2; l++) { - keyword = keywords[l]; - if (-1 === text.indexOf(keyword)) { - return false; - } - } - return true; - } - }; - - return Index; - -}).call(this); - -Polyfill = (function() { - var Polyfill; - - Polyfill = { - init: function() { - var base; - this.toBlob(); - $.global(this.toBlob); - (base = Element.prototype).matches || (base.matches = Element.prototype.mozMatchesSelector || Element.prototype.webkitMatchesSelector); - }, - toBlob: function() { - if (HTMLCanvasElement.prototype.toBlob) { - return; - } - HTMLCanvasElement.prototype.toBlob = function(cb, type, encoderOptions) { - var data, i, j, l, ref, ui8a, url; - url = this.toDataURL(type, encoderOptions); - data = atob(url.slice(url.indexOf(',') + 1)); - l = data.length; - ui8a = new Uint8Array(l); - for (i = j = 0, ref = l; j < ref; i = j += 1) { - ui8a[i] = data.charCodeAt(i); - } - return cb(new Blob([ui8a], { - type: type || 'image/png' - })); - }; - } - }; - - return Polyfill; - -}).call(this); - -Settings = (function() { - var Settings, - slice = [].slice, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Settings = { - init: function() { - var add, link; - link = $.el('a', { - className: 'settings-link fa fa-wrench', - textContent: 'Settings', - title: '4chan X Settings', - href: 'javascript:;' - }); - $.on(link, 'click', Settings.open); - Header.addShortcut('settings', link, 820); - add = this.addSection; - add('Main', this.main); - add('Filter', this.filter); - add('Sauce', this.sauce); - add('Advanced', this.advanced); - add('Keybinds', this.keybinds); - $.on(d, 'AddSettingsSection', Settings.addSection); - $.on(d, 'OpenSettings', function(e) { - return Settings.open(e.detail); - }); - if (g.SITE.software === 'yotsuba' && Conf['Disable Native Extension']) { - if ($.hasStorage) { - return $.global(function() { - var settings; - try { - settings = JSON.parse(localStorage.getItem('4chan-settings')) || {}; - if (settings.disableAll) { - return; - } - settings.disableAll = true; - return localStorage.setItem('4chan-settings', JSON.stringify(settings)); - } catch (error) { - return Object.defineProperty(window, 'Config', { - value: { - disableAll: true - } - }); - } - }); - } else { - return $.global(function() { - return Object.defineProperty(window, 'Config', { - value: { - disableAll: true - } - }); - }); - } - } - }, - open: function(openSection) { - var dialog, j, len, link, links, ref, section, sectionToOpen; - if (Settings.dialog) { - return; - } - $.event('CloseMenu'); - Settings.dialog = dialog = $.el('div', { - id: 'overlay' - }, {innerHTML: ""}); - $.on($('.export', dialog), 'click', Settings["export"]); - $.on($('.import', dialog), 'click', Settings["import"]); - $.on($('.reset', dialog), 'click', Settings.reset); - $.on($('input', dialog), 'change', Settings.onImport); - links = []; - ref = Settings.sections; - for (j = 0, len = ref.length; j < len; j++) { - section = ref[j]; - link = $.el('a', { - className: "tab-" + section.hyphenatedTitle, - textContent: section.title, - href: 'javascript:;' - }); - $.on(link, 'click', Settings.openSection.bind(section)); - links.push(link, $.tn(' | ')); - if (section.title === openSection) { - sectionToOpen = link; - } - } - links.pop(); - $.add($('.sections-list', dialog), links); - if (openSection !== 'none') { - (sectionToOpen ? sectionToOpen : links[0]).click(); - } - $.on($('.close', dialog), 'click', Settings.close); - $.on(window, 'beforeunload', Settings.close); - $.on(dialog, 'click', Settings.close); - $.on(dialog.firstElementChild, 'click', function(e) { - return e.stopPropagation(); - }); - $.add(d.body, dialog); - return $.event('OpenSettings', null, dialog); - }, - close: function() { - var ref; - if (!Settings.dialog) { - return; - } - if ((ref = d.activeElement) != null) { - ref.blur(); - } - $.rm(Settings.dialog); - return delete Settings.dialog; - }, - sections: [], - addSection: function(title, open) { - var hyphenatedTitle, ref; - if (typeof title !== 'string') { - ref = title.detail, title = ref.title, open = ref.open; - } - hyphenatedTitle = title.toLowerCase().replace(/\s+/g, '-'); - return Settings.sections.push({ - title: title, - hyphenatedTitle: hyphenatedTitle, - open: open - }); - }, - openSection: function() { - var section, selected; - if (selected = $('.tab-selected', Settings.dialog)) { - $.rmClass(selected, 'tab-selected'); - } - $.addClass($(".tab-" + this.hyphenatedTitle, Settings.dialog), 'tab-selected'); - section = $('section', Settings.dialog); - $.rmAll(section); - section.className = "section-" + this.hyphenatedTitle; - this.open(section, g); - section.scrollTop = 0; - return $.event('OpenSettings', null, section); - }, - warnings: { - localStorage: function(cb) { - var why; - if ($.cantSync) { - why = $.cantSet ? 'save your settings' : 'synchronize settings between tabs'; - return cb($.el('li', { - textContent: "4chan X needs local storage to " + why + ".\nEnable it on boards." + (location.hostname.split('.')[1]) + ".org in your browser's privacy settings (may be listed as part of \"local data\" or \"cookies\")." - })); - } - }, - ads: function(cb) { - return $.onExists(doc, '.adg-rects > .desktop', function(ad) { - return $.onExists(ad, 'iframe', function() { - var url; - url = Redirect.to('thread', { - boardID: 'qa', - threadID: 362590 - }); - return cb($.el('li', {innerHTML: "To protect yourself from malicious ads, you should block ads on 4chan."})); - }); - }); - } - }, - main: function(section) { - var addCheckboxes, addWarning, button, div, fs, inputs, items, key, keyFS, obj, ref, ref1, warning, warnings; - warnings = $.el('fieldset', { - hidden: true - }, {innerHTML: "Warnings
        "}); - addWarning = function(item) { - $.add($('ul', warnings), item); - return warnings.hidden = false; - }; - ref = Settings.warnings; - for (key in ref) { - warning = ref[key]; - warning(addWarning); - } - $.add(section, warnings); - items = $.dict(); - inputs = $.dict(); - addCheckboxes = function(root, obj) { - var arr, container, containers, description, div, input, level, results; - containers = [root]; - results = []; - for (key in obj) { - arr = obj[key]; - if (!(arr instanceof Array)) { - continue; - } - description = arr[1]; - div = $.el('div', {innerHTML: ": " + E(description) + ""}); - div.dataset.name = key; - input = $('input', div); - $.on(input, 'change', $.cb.checked); - $.on(input, 'change', function() { - return this.parentNode.parentNode.dataset.checked = this.checked; - }); - items[key] = Conf[key]; - inputs[key] = input; - level = arr[2] || 0; - if (containers.length <= level) { - container = $.el('div', { - className: 'suboption-list' - }); - $.add(containers[containers.length - 1].lastElementChild, container); - containers[level] = container; - } else if (containers.length > level + 1) { - containers.splice(level + 1, containers.length - (level + 1)); - } - results.push($.add(containers[level], div)); - } - return results; - }; - ref1 = Config.main; - for (keyFS in ref1) { - obj = ref1[keyFS]; - fs = $.el('fieldset', {innerHTML: "" + E(keyFS) + ""}); - addCheckboxes(fs, obj); - if (keyFS === 'Posting and Captchas') { - $.add(fs, $.el('p', {innerHTML: "For more info on captcha options and issues, see the captcha FAQ."})); - } - $.add(section, fs); - } - addCheckboxes($('div[data-name="JSON Index"] > .suboption-list', section), Config.Index); - if ($.engine !== 'gecko') { - $('div[data-name="Remember QR Size"]', section).hidden = true; - } - if ($.perProtocolSettings || location.protocol !== 'https:') { - $('div[data-name="Redirect to HTTPS"]', section).hidden = true; - } - if ($.platform !== 'crx') { - $('div[data-name="Work around CORB Bug"]', section).hidden = true; - } - $.get(items, function(items) { - var val; - for (key in items) { - val = items[key]; - inputs[key].checked = val; - inputs[key].parentNode.parentNode.dataset.checked = val; - } - }); - div = $.el('div', {innerHTML: ": Clear manually-hidden threads and posts on all boards. Reload the page to apply."}); - button = $('button', div); - $.get({ - hiddenThreads: $.dict(), - hiddenPosts: $.dict() - }, function(arg) { - var ID, board, hiddenNum, hiddenPosts, hiddenThreads, ref2, ref3, ref4, ref5, site, thread; - hiddenThreads = arg.hiddenThreads, hiddenPosts = arg.hiddenPosts; - hiddenNum = 0; - for (ID in hiddenThreads) { - site = hiddenThreads[ID]; - if (ID !== 'boards') { - ref2 = site.boards; - for (ID in ref2) { - board = ref2[ID]; - hiddenNum += Object.keys(board).length; - } - } - } - ref3 = hiddenThreads.boards; - for (ID in ref3) { - board = ref3[ID]; - hiddenNum += Object.keys(board).length; - } - for (ID in hiddenPosts) { - site = hiddenPosts[ID]; - if (ID !== 'boards') { - ref4 = site.boards; - for (ID in ref4) { - board = ref4[ID]; - for (ID in board) { - thread = board[ID]; - hiddenNum += Object.keys(thread).length; - } - } - } - } - ref5 = hiddenPosts.boards; - for (ID in ref5) { - board = ref5[ID]; - for (ID in board) { - thread = board[ID]; - hiddenNum += Object.keys(thread).length; - } - } - return button.textContent = "Hidden: " + hiddenNum; - }); - $.on(button, 'click', function() { - this.textContent = 'Hidden: 0'; - return $.get('hiddenThreads', $.dict(), function(arg) { - var boardID, hiddenThreads, ref2; - hiddenThreads = arg.hiddenThreads; - if ($.hasStorage && g.SITE.software === 'yotsuba') { - for (boardID in (ref2 = hiddenThreads['4chan.org']) != null ? ref2.boards : void 0) { - localStorage.removeItem("4chan-hide-t-" + boardID); - } - for (boardID in hiddenThreads.boards) { - localStorage.removeItem("4chan-hide-t-" + boardID); - } - } - return $["delete"](['hiddenThreads', 'hiddenPosts']); - }); - }); - return $.after($('input[name="Stubs"]', section).parentNode.parentNode, div); - }, - "export": function() { - var Conf2; - Conf2 = $.dict(); - $.extend(Conf2, Conf); - return $.get(Conf2, function(Conf2) { - delete Conf2['boardConfig']; - return Settings.downloadExport({ - version: g.VERSION, - date: Date.now(), - Conf: Conf2 - }); - }); - }, - downloadExport: function(data) { - var a, blob, p, url; - blob = new Blob([JSON.stringify(data, null, 2)], { - type: 'application/json' - }); - url = URL.createObjectURL(blob); - a = $.el('a', { - download: "4chan X v" + g.VERSION + "-" + data.date + ".json", - href: url - }); - p = $('.imp-exp-result', Settings.dialog); - $.rmAll(p); - $.add(p, a); - return a.click(); - }, - "import": function() { - return $('input[type=file]', this.parentNode).click(); - }, - onImport: function() { - var file, output, reader; - if (!(file = this.files[0])) { - return; - } - this.value = null; - output = $('.imp-exp-result'); - if (!confirm('Your current settings will be entirely overwritten, are you sure?')) { - output.textContent = 'Import aborted.'; - return; - } - reader = new FileReader(); - reader.onload = function(e) { - var err; - try { - return Settings.loadSettings($.dict.json(e.target.result), function(err) { - if (err) { - return output.textContent = 'Import failed due to an error.'; - } else if (confirm('Import successful. Reload now?')) { - return window.location.reload(); - } - }); - } catch (error) { - err = error; - output.textContent = 'Import failed due to an error.'; - return c.error(err.stack); - } - }; - return reader.readAsText(file); - }, - convertFrom: { - loadletter: function(data) { - var base, boardID, convertSettings, key, ref, ref1, threadData, threadID, threads, val; - convertSettings = function(data, map) { - var newKey, prevKey; - for (prevKey in map) { - newKey = map[prevKey]; - if (newKey) { - data.Conf[newKey] = data.Conf[prevKey]; - } - delete data.Conf[prevKey]; - } - return data; - }; - data = convertSettings(data, { - 'Disable 4chan\'s extension': 'Disable Native Extension', - 'Comment Auto-Expansion': '', - 'Remove Slug': '', - 'Always HTTPS': 'Redirect to HTTPS', - 'Check for Updates': '', - 'Recursive Filtering': 'Recursive Hiding', - 'Reply Hiding': 'Reply Hiding Buttons', - 'Thread Hiding': 'Thread Hiding Buttons', - 'Show Stubs': 'Stubs', - 'Image Auto-Gif': 'Replace GIF', - 'Expand All WebM': 'Expand videos', - 'Reveal Spoilers': 'Reveal Spoiler Thumbnails', - 'Expand From Current': 'Expand from here', - 'Current Page': 'Page Count in Stats', - 'Current Page Position': '', - 'Alternative captcha': 'Use Recaptcha v1', - 'Alt index captcha': 'Use Recaptcha v1 on Index', - 'Auto Submit': 'Post on Captcha Completion', - 'Open Reply in New Tab': 'Open Post in New Tab', - 'Remember QR size': 'Remember QR Size', - 'Remember Subject': '', - 'Quote Inline': 'Quote Inlining', - 'Quote Preview': 'Quote Previewing', - 'Indicate OP quote': 'Mark OP Quotes', - 'Indicate You quote': 'Mark Quotes of You', - 'Indicate Cross-thread Quotes': 'Mark Cross-thread Quotes', - 'uniqueid': 'uniqueID', - 'mod': 'capcode', - 'email': '', - 'country': 'flag', - 'md5': 'MD5', - 'openEmptyQR': 'Open empty QR', - 'openQR': 'Open QR', - 'openOptions': 'Open settings', - 'close': 'Close', - 'spoiler': 'Spoiler tags', - 'sageru': 'Toggle sage', - 'code': 'Code tags', - 'sjis': 'SJIS tags', - 'submit': 'Submit QR', - 'watch': 'Watch', - 'update': 'Update', - 'unreadCountTo0': '', - 'expandAllImages': 'Expand images', - 'expandImage': 'Expand image', - 'zero': 'Front page', - 'nextPage': 'Next page', - 'previousPage': 'Previous page', - 'nextThread': 'Next thread', - 'previousThread': 'Previous thread', - 'expandThread': 'Expand thread', - 'openThreadTab': 'Open thread', - 'openThread': 'Open thread tab', - 'nextReply': 'Next reply', - 'previousReply': 'Previous reply', - 'hide': 'Hide', - 'Scrolling': 'Auto Scroll', - 'Verbose': '' - }); - if ('Always CDN' in data.Conf) { - data.Conf['fourchanImageHost'] = data.Conf['Always CDN'] ? 'i.4cdn.org' : ''; - delete data.Conf['Always CDN']; - } - data.Conf.sauces = data.Conf.sauces.replace(/\$\d/g, function(c) { - switch (c) { - case '$1': - return '%TURL'; - case '$2': - return '%URL'; - case '$3': - return '%MD5'; - case '$4': - return '%board'; - default: - return c; - } - }); - ref = Config.hotkeys; - for (key in ref) { - val = ref[key]; - if (key in data.Conf) { - data.Conf[key] = data.Conf[key].replace(/ctrl|alt|meta/g, function(s) { - return "" + (s[0].toUpperCase()) + s.slice(1); - }).replace(/(^|.+\+)[A-Z]$/g, function(s) { - return "Shift+" + s.slice(0, -1) + (s.slice(-1).toLowerCase()); - }); - } - } - if (data.WatchedThreads) { - data.Conf['watchedThreads'] = $.dict.clone({ - '4chan.org': { - boards: {} - } - }); - ref1 = data.WatchedThreads; - for (boardID in ref1) { - threads = ref1[boardID]; - for (threadID in threads) { - threadData = threads[threadID]; - ((base = data.Conf['watchedThreads']['4chan.org'].boards)[boardID] || (base[boardID] = $.dict()))[threadID] = { - excerpt: threadData.textContent - }; - } - } - } - return data; - } - }, - upgrade: function(data, version) { - var addCSS, addSauces, boardID, boards, changes, compareString, corrupted, db, hostname, j, k, key, l, lastChecked, len, len1, len2, len3, line, list, m, name, record, ref, ref1, ref10, ref11, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, rice, set, setD, siteProperties, software, type, uids, val, val2, value; - changes = $.dict(); - set = function(key, value) { - return data[key] = changes[key] = value; - }; - setD = function(key, value) { - if (data[key] == null) { - return set(key, value); - } - }; - addSauces = function(sauces) { - if (data['sauces'] != null) { - sauces = sauces.filter(function(s) { - return data['sauces'].indexOf(s.match(/[^#;\s]+|$/)[0]) < 0; - }); - if (sauces.length) { - return set('sauces', data['sauces'] + '\n\n' + sauces.join('\n')); - } - } - }; - addCSS = function(css) { - if (data['usercss'] == null) { - set('usercss', Config['usercss']); - } - if (data['usercss'].indexOf(css) < 0) { - return set('usercss', css + '\n\n' + data['usercss']); - } - }; - if ((corrupted = version[0] === '"')) { - try { - version = JSON.parse(version); - } catch (error) {} - } - compareString = version.replace(/\d+/g, function(x) { - return ('0000' + x).slice(-5); - }); - if (compareString < '00001.00013.00014.00008') { - for (key in data) { - val = data[key]; - if (!(typeof val === 'string' && typeof Conf[key] !== 'string' && (key !== 'Index Sort' && key !== 'Last Long Reply Thresholds 0' && key !== 'Last Long Reply Thresholds 1'))) { - continue; - } - corrupted = true; - break; - } - } - if (corrupted) { - for (key in data) { - val = data[key]; - if (typeof val === 'string') { - try { - val2 = JSON.parse(val); - set(key, val2); - } catch (error) {} - } - } - } - if (compareString < '00001.00011.00008.00000') { - if (data['Fixed Thread Watcher'] == null) { - set('Fixed Thread Watcher', (ref = data['Toggleable Thread Watcher']) != null ? ref : true); - } - if (data['Exempt Archives from Encryption'] == null) { - set('Exempt Archives from Encryption', (ref1 = data['Except Archives from Encryption']) != null ? ref1 : false); - } - } - if (compareString < '00001.00011.00010.00001') { - if (data['selectedArchives'] != null) { - uids = { - "Moe": 0, - "4plebs Archive": 3, - "Nyafuu Archive": 4, - "Love is Over": 5, - "Rebecca Black Tech": 8, - "warosu": 10, - "fgts": 15, - "not4plebs": 22, - "DesuStorage": 23, - "fireden.net": 24, - "disabled": null - }; - ref2 = data['selectedArchives']; - for (boardID in ref2) { - record = ref2[boardID]; - for (type in record) { - name = record[type]; - if ($.hasOwn(uids, name)) { - record[type] = uids[name]; - } - } - } - set('selectedArchives', data['selectedArchives']); - } - } - if (compareString < '00001.00011.00016.00000') { - if ((rice = Config['usercss'].match(/\/\* Board title rice \*\/(?:\n.+)*/)[0])) { - if ((data['usercss'] != null) && data['usercss'].indexOf(rice) < 0) { - set('usercss', rice + '\n\n' + data['usercss']); - } - } - } - if (compareString < '00001.00011.00017.00000') { - ref3 = ['Persistent QR', 'Color User IDs', 'Fappe Tyme', 'Werk Tyme', 'Highlight Posts Quoting You', 'Highlight Own Posts']; - for (j = 0, len = ref3.length; j < len; j++) { - key = ref3[j]; - if (data[key] == null) { - set(key, key === 'Persistent QR'); - } - } - } - if (compareString < '00001.00011.00017.00006') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^(#?\s*)http:\/\/iqdb\.org\//mg, '$1//iqdb.org/')); - } - } - if (compareString < '00001.00011.00019.00003' && !Settings.dialog) { - $.queueTask(function() { - return Settings.warnings.ads(function(item) { - return new Notice('warning', slice.call(item.childNodes)); - }); - }); - } - if (compareString < '00001.00011.00020.00003') { - ref4 = { - 'Inline Cross-thread Quotes Only': false, - 'Pass Link': true - }; - for (key in ref4) { - value = ref4[key]; - if (data[key] == null) { - set(key, value); - } - } - } - if (compareString < '00001.00011.00021.00003') { - if (data['Remember Your Posts'] == null) { - set('Remember Your Posts', (ref5 = data['Mark Quotes of You']) != null ? ref5 : true); - } - } - if (compareString < '00001.00011.00022.00000') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^(#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(?:IMG|URL))%3Fs\.jpg/mg, '$1')); - set('sauces', data['sauces'].replace(/^#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(?:IMG|T?URL)(?=$|;)/mg, '$&&safe=off')); - } - } - if (compareString < '00001.00011.00022.00002') { - if ((data['Use Recaptcha v1 in Reports'] == null) && data['Use Recaptcha v1'] && !data['Use Recaptcha v2 in Reports']) { - set('Use Recaptcha v1 in Reports', true); - } - } - if (compareString < '00001.00011.00024.00000') { - if ((data['JSON Navigation'] != null) && (data['JSON Index'] == null)) { - set('JSON Index', data['JSON Navigation']); - } - } - if (compareString < '00001.00011.00026.00000') { - if ((data['Oekaki Links'] != null) && (data['Edit Link'] == null)) { - set('Edit Link', data['Oekaki Links']); - } - if (data['Inline Cross-thread Quotes Only'] == null) { - set('Inline Cross-thread Quotes Only', true); - } - } - if (compareString < '00001.00011.00030.00000') { - if (data['Quote Threading'] && (data['Thread Quotes'] == null)) { - set('Thread Quotes', true); - } - } - if (compareString < '00001.00011.00032.00000') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^(#?\s*)http:\/\/3d\.iqdb\.org\//mg, '$1//3d.iqdb.org/')); - } - addSauces(['#https://desustorage.org/_/search/image/%sMD5/', '#https://boards.fireden.net/_/search/image/%sMD5/', '#https://foolz.fireden.net/_/search/image/%sMD5/', '#//www.gif-explode.com/%URL;types:gif']); - } - if (compareString < '00001.00011.00035.00000') { - addSauces(['https://whatanime.ga/?auto&url=%IMG;text:wait']); - } - if (compareString < '00001.00012.00000.00000') { - if (data['Exempt Archives from Encryption'] == null) { - set('Exempt Archives from Encryption', false); - } - if (data['Show New Thread Option in Threads'] == null) { - set('Show New Thread Option in Threads', false); - } - if (data['Show Name and Subject']) { - addCSS('#qr .persona .field {display: block !important;}'); - } - if (data['QR Shortcut'] === false) { - addCSS('#shortcut-qr {display: none;}'); - } - if (data['Bottom QR Link'] === false) { - addCSS('.qr-link-container-bottom {display: none;}'); - } - } - if (compareString < '00001.00012.00000.00006') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^(#?\s*)https:\/\/(?:desustorage|cuckchan)\.org\//mg, '$1https://desuarchive.org/')); - } - } - if (compareString < '00001.00012.00001.00000') { - if ((data['Persistent Thread Watcher'] == null) && (data['Toggleable Thread Watcher'] != null)) { - set('Persistent Thread Watcher', !data['Toggleable Thread Watcher']); - } - } - if (compareString < '00001.00012.00003.00000') { - ref6 = ['Image Hover in Catalog', 'Auto Watch', 'Auto Watch Reply']; - for (k = 0, len1 = ref6.length; k < len1; k++) { - key = ref6[k]; - setD(key, false); - } - } - if (compareString < '00001.00013.00001.00002') { - addSauces(['#//www.bing.com/images/search?q=imgurl:%IMG&view=detailv2&iss=sbi#enterInsights']); - } - if (compareString < '00001.00013.00005.00000') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^(#?\s*)http:\/\/regex\.info\/exif\.cgi/mg, '$1http://exif.regex.info/exif.cgi')); - } - addSauces(Config['sauces'].match(/# Known filename formats:(?:\n.+)*|$/)[0].split('\n')); - } - if (compareString < '00001.00013.00007.00002') { - setD('Require OP Quote Link', true); - } - if (compareString < '00001.00013.00008.00000') { - setD('Download Link', true); - } - if (compareString < '00001.00013.00009.00003') { - if (data['jsWhitelist'] != null) { - list = data['jsWhitelist'].split('\n'); - if (indexOf.call(list, 'https://cdnjs.cloudflare.com') < 0 && indexOf.call(list, 'https://cdn.mathjax.org') >= 0) { - set('jsWhitelist', data['jsWhitelist'] + '\n\nhttps://cdnjs.cloudflare.com'); - } - } - } - if (compareString < '00001.00014.00000.00006') { - if (data['siteSoftware'] != null) { - set('siteSoftware', data['siteSoftware'] + '\n4cdn.org yotsuba'); - } - } - if (compareString < '00001.00014.00003.00002') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^(#?\s*)https:\/\/whatanime\.ga\//mg, '$1https://trace.moe/')); - } - } - if (compareString < '00001.00014.00004.00004') { - if ((data['siteSoftware'] != null) && !/^4channel\.org yotsuba$/m.test(data['siteSoftware'])) { - set('siteSoftware', data['siteSoftware'] + '\n4channel.org yotsuba'); - } - } - if (compareString < '00001.00014.00005.00000') { - ref7 = DataBoard.keys; - for (l = 0, len2 = ref7.length; l < len2; l++) { - db = ref7[l]; - if ((ref8 = data[db]) != null ? ref8.boards : void 0) { - ref9 = data[db], boards = ref9.boards, lastChecked = ref9.lastChecked; - data[db]['4chan.org'] = { - boards: boards, - lastChecked: lastChecked - }; - delete data[db].boards; - delete data[db].lastChecked; - set(db, data[db]); - } - } - if ((data['siteSoftware'] != null) && (data['siteProperties'] == null)) { - siteProperties = $.dict(); - ref10 = data['siteSoftware'].split('\n'); - for (m = 0, len3 = ref10.length; m < len3; m++) { - line = ref10[m]; - ref11 = line.split(' '), hostname = ref11[0], software = ref11[1]; - siteProperties[hostname] = { - software: software - }; - } - set('siteProperties', siteProperties); - } - } - if (compareString < '00001.00014.00006.00006') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/\/\/%\$1\.deviantart\.com\/gallery\/#\/d%\$2;regexp:\/\^\\w\+_by_\(\\w\+\)-d\(\[\\da-z\]\+\)\//g, '//www.deviantart.com/gallery/#/d%$1%$2;regexp:/^\\w+_by_\\w+[_-]d([\\da-z]{6})\\b|^d([\\da-z]{6})-[\\da-z]{8}-/')); - } - } - if (compareString < '00001.00014.00008.00000') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/https:\/\/www\.yandex\.com\/images\/search/g, 'https://yandex.com/images/search')); - } - } - if (compareString < '00001.00014.00009.00000') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^(#?\s*)(?:http:)?\/\/(www\.pixiv\.net|www\.deviantart\.com|imgur\.com|flickr\.com)\//mg, '$1https://$2/')); - set('sauces', data['sauces'].replace(/https:\/\/yandex\.com\/images\/search\?rpt=imageview&img_url=%IMG/g, 'https://yandex.com/images/search?rpt=imageview&url=%IMG')); - } - } - if (compareString < '00001.00014.00009.00001') { - if ((data['Use Faster Image Host'] != null) && (data['fourchanImageHost'] == null)) { - set('fourchanImageHost', (data['Use Faster Image Host'] ? 'i.4cdn.org' : '')); - } - } - if (compareString < '00001.00014.00010.00001') { - if (data['Filter in Native Catalog'] == null) { - set('Filter in Native Catalog', false); - } - } - if (compareString < '00001.00014.00012.00008') { - if (data['boardnav'] == null) { - set('boardnav', "[ toggle-all ]\na-replace\nc-replace\ng-replace\nk-replace\nv-replace\nvg-replace\nvr-replace\nck-replace\nco-replace\nfit-replace\njp-replace\nmu-replace\nsp-replace\ntv-replace\nvp-replace\n[external-text:\"FAQ\",\"https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions\"]"); - } - } - if (compareString < '00001.00014.00016.00001') { - if (data['archiveLists'] != null) { - set('archiveLists', data['archiveLists'].replace('https://mayhemydg.github.io/archives.json/archives.json', 'https://nstepien.github.io/archives.json/archives.json')); - } - } - if (compareString < '00001.00014.00016.00007') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/https:\/\/www\.deviantart\.com\/gallery\/#\/d%\$1%\$2;regexp:\/\^\\w\+_by_\\w\+\[_-\]d\(\[\\da-z\]\{6\}\)\\b\|\^d\(\[\\da-z\]\{6\}\)-\[\\da-z\]\{8\}-\//g, 'javascript:void(open("https://www.deviantart.com/"+%$1.replace(/_/g,"-")+"/art/"+parseInt(%$2,36)));regexp:/^\\w+_by_(\\w+)[_-]d([\\da-z]{6})\\b/').replace(/\/\/imgops\.com\/%URL/g, '//imgops.com/start?url=%URL')); - } - } - if (compareString < '00001.00014.00017.00002') { - if (data['jsWhitelist'] != null) { - set('jsWhitelist', data['jsWhitelist'] + '\n\nhttps://hcaptcha.com\nhttps://*.hcaptcha.com'); - } - } - if (compareString < '00001.00014.00020.00004') { - if (data['archiveLists'] != null) { - set('archiveLists', data['archiveLists'].replace('https://nstepien.github.io/archives.json/archives.json', 'https://4chenz.github.io/archives.json/archives.json')); - } - } - if (compareString < '00001.00014.00022.00003') { - if (data['sauces'] != null) { - set('sauces', data['sauces'].replace(/^#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(IMG|T?URL)&safe=off(?=$|;)/mg, 'https://www.google.com/searchbyimage?sbisrc=4chanx&image_url=%$1&safe=off')); - if (compareString === '00001.00014.00022.00002' && !/\bsbisrc=/.test(data['sauces'])) { - set('sauces', data['sauces'].replace(/^#?\s*https:\/\/lens\.google\.com\/uploadbyurl\?url=%(IMG|T?URL)(?=$|;)/m, 'https://www.google.com/searchbyimage?sbisrc=4chanx&image_url=%$1&safe=off')); - } - } - addSauces(['#https://lens.google.com/uploadbyurl?url=%IMG;text:lens']); - } - return changes; - }, - loadSettings: function(data, cb) { - if (data.version.split('.')[0] === '2') { - data = Settings.convertFrom.loadletter(data); - } else if (data.version !== g.VERSION) { - Settings.upgrade(data.Conf, data.version); - } - return $.clear(function(err) { - if (err) { - return cb(err); - } - return $.set(data.Conf, cb); - }); - }, - reset: function() { - if (confirm('Your current settings will be entirely wiped, are you sure?')) { - return $.clear(function(err) { - if (err) { - return $('.imp-exp-result').textContent = 'Import failed due to an error.'; - } else if (confirm('Reset successful. Reload now?')) { - return window.location.reload(); - } - }); - } - }, - filter: function(section) { - var select; - $.extend(section, {innerHTML: "
        "}); - select = $('select', section); - $.on(select, 'change', Settings.selectFilter); - return Settings.selectFilter.call(select); - }, - selectFilter: function() { - var div, filterTypes, name, ta; - div = this.nextElementSibling; - if ((name = this.value) !== 'guide') { - if (!$.hasOwn(Config.filter, name)) { - return; - } - $.rmAll(div); - ta = $.el('textarea', { - name: name, - className: 'field', - spellcheck: false - }); - $.on(ta, 'change', $.cb.value); - $.get(name, Conf[name], function(item) { - ta.value = item[name]; - return $.add(div, ta); - }); - return; - } - filterTypes = Object.keys(Config.filter).filter(function(x) { - return x !== 'general'; - }).map(function(x, i) { - return {innerHTML: ((i) ? "," : "") + "" + E(x)}; - }); - $.extend(div, {innerHTML: "
        Filter is disabled.

        Use regular expressions, one per line.
        Lines starting with a # will be ignored.
        For example, /weeaboo/i will filter posts containing the string `weeaboo`, case-insensitive.
        MD5 and Unique ID filtering use exact string matching, not regular expressions.

          You can use these settings with each regular expression, separate them with semicolons:
        • Per boards, separate them with commas. It is global if not specified. Use sfw and nsfw to reference all worksafe or not-worksafe boards.
          For example: boards:a,jp;.
          To specify boards on a particular site, put the beginning of the domain and a slash character before the list.
          Any initial www. should not be included, and all 4chan domains are considered 4chan.org.
          For example: boards:4:a,jp,sama:a,z;.
          An asterisk can be used to specify all boards on a site.
          For example: boards:4:*;.
        • Select boards to be excluded from the filter. The syntax is the same as for the boards: option above.
          For example: exclude:vg,v;.
        • Filter OPs only along with their threads (`only`) or replies only (`no`).
          For example: op:only; or op:no;.
        • Filter only posts with files (`only`) or only posts without files (`no`).
          For example: file:only; or file:no;.
        • Overrule the `Show Stubs` setting if specified: create a stub (`yes`) or not (`no`).
          For example: stub:yes; or stub:no;.
        • Highlight instead of hiding. You can specify a class name to use with a userstyle.
          For example: highlight; or highlight:wallpaper;.
        • Highlighted OPs will have their threads put on top of the board index by default.
          For example: top:yes; or top:no;.
        • Show a desktop notification instead of hiding.
          For example: notify;.
        • Filters in the \"General\" section apply to multiple fields, by default subject,name,filename,comment.
          The fields can be specified with the type option, separated by commas.
          For example: type:" + E.cat(filterTypes) + ";.
          Types can also be combined with a + sign; this indicates the filter applies to the given fields joined by newlines.
          For example: type:filename+filesize+dimensions;.
        "}); - return $('.warning', div).hidden = Conf['Filter']; - }, - sauce: function(section) { - var ta; - $.extend(section, {innerHTML: "
        Sauce is disabled.
        These parameters will be replaced by their corresponding values in the URL and displayed text:
        • %IMG: Full image URL for GIF, JPG, and PNG; thumbnail URL for other types.
        • %URL: Full image URL.
        • %TURL: Thumbnail URL.
        • %name: Original file name.
        • %board: Current board.
        • %MD5: MD5 hash in base64.
        • %sMD5: MD5 hash in base64 using - and _.
        • %hMD5: MD5 hash in hexadecimal.
        • %$0: Matched regular expression within the filename.
        • %$1, %$2, %$3, ... : Subexpressions within the matched regular expression.
        • %%, %semi: Literal % and ;.
        Lines starting with a # will be ignored.
        You can specify a display text by appending ;text:[text] to the URL.
        You can specify the applicable boards/sites by appending ;boards:[board1],[board2]. See the Filter guide for details.
        You can specify the applicable file types by appending ;types:[extension1],[extension2].
        You can specify a regular expression the filename must match by appending ;regexp:[regular expression].
        "}); - $('.warning', section).hidden = Conf['Sauce']; - ta = $('textarea', section); - $.get('sauces', Conf['sauces'], function(item) { - ta.value = item['sauces']; - return ta.hidden = false; - }); - return $.on(ta, 'change', $.cb.value); - }, - advanced: function(section) { - var applyCSS, boardSelect, customCSS, event, input, inputs, interval, items, itemsArchive, j, k, l, len, len1, len2, len3, listImageHost, m, name, ref, ref1, ref2, ref3, ref4, table, textContent, updateArchives, warning; - $.extend(section, {innerHTML: "
        Archives
        404 Redirect is disabled.
        Thread redirectionPost fetchingFile redirection

        Archive Lists: Each line below should be an archive list in this format or a URL to load an archive list from.
        Archive properties can be overriden by another item with the same uid (or if absent, its name).
        Last updated:
        External Catalog
        External Catalog is disabled. This will be used only as a fallback.
        URLs of external catalog sites, where %board is to be replaced by the board name.
        Each URL should be followed by ;boards: and optionally ;exclude: and a list of supported/excluded boards in the format explained in the Filter guide.
        Override 4chan Image Host
        Change 4chan image links to this domain. Leave blank for no change.
        Captcha Language
        Choose from list of language codes. Leave blank to autoselect.
        Custom Board Navigation
        New lines will be converted into spaces.

        In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
        Board link: g
        Archive link: g-archive
        Internal archive link: g-expired
        Title link: g-title
        Board link (Replace with title when on that board): g-replace
        Full text link: g-full
        Custom text link: g-text:"Install Gentoo"
        Index-only link: g-index
        Catalog-only link: g-catalog
        Index mode: g-mode:"infinite scrolling"
        Index sort: g-sort:"creation date rev"
        External link: external-text:"Google","http://www.google.com"
        Open in new tab: g-nt
        Combinations are possible: g-index-text:"Technology Index"
        Full board list toggle: toggle-all

        [ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:"Piracy"]
        will give you
        [ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
        if you are on /g/.
        Time Formatting is disabled.
        :
        Day: %a, %A, %d, %e
        Month: %m, %b, %B
        Year: %y, %Y
        Hour: %k, %H, %l, %I, %p, %P
        Minute: %M
        Second: %S
        Literal %: %%
        Quote Backlinks formatting is disabled.
        :
        Default pasted content filename
        .png
        File Info Formatting is disabled.
        :
        Link: %l (truncated), %L (untruncated), %T (4chan filename)
        Filename: %n (truncated), %N (untruncated), %t (4chan filename)
        Download button: %d
        Quick filter MD5: %f
        Spoiler indicator: %p
        Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
        Resolution: %r (Displays 'PDF' for PDF files)
        Tag: %g
        Literal %: %%
        Quick Reply Personas

        One item per line.
        Items will be added in the relevant input's auto-completion list.
        Password items will always be used, since there is no password input.
        Lines starting with a # will be ignored.

          You can use these settings with each item, separate them with semicolons:
        • Possible items are: name, options (or equivalently email), subject and password.
        • Wrap values of items with quotes, like this: options:"sage".
        • Force values as defaults with the always keyword, for example: options:"sage";always.
        • Select specific boards for an item, separated with commas, for example: options:"sage";boards:jp;always.
        Unread Favicon is disabled.
        Thread Updater is disabled.
        Interval: seconds
        Custom Cooldown Time
        Seconds:
        For more information about customizing 4chan X's CSS, see the styling guide.
        Javascript Whitelist
        Sources from which Javascript is allowed to be loaded by Content Security Policy.
        Lines starting with a # will be ignored.
        Known Banners
        List of known banners, used for click-to-change feature.
        "}); - ref = $$('.warning', section); - for (j = 0, len = ref.length; j < len; j++) { - warning = ref[j]; - warning.hidden = Conf[warning.dataset.feature]; - } - inputs = $.dict(); - ref1 = $$('[name]', section); - for (k = 0, len1 = ref1.length; k < len1; k++) { - input = ref1[k]; - inputs[input.name] = input; - } - $.on(inputs['archiveLists'], 'change', function() { - $.set('lastarchivecheck', 0); - Conf['lastarchivecheck'] = 0; - return $.id('lastarchivecheck').textContent = 'never'; - }); - items = $.dict(); - for (name in inputs) { - input = inputs[name]; - if (!(name !== 'Interval' && name !== 'Custom CSS')) { - continue; - } - items[name] = Conf[name]; - event = (input.nodeName === 'SELECT' || ((ref2 = input.type) === 'checkbox' || ref2 === 'radio') || (input.nodeName === 'TEXTAREA' && !(name in Settings))) ? 'change' : 'input'; - $.on(input, event, $.cb[input.type === 'checkbox' ? 'checked' : 'value']); - if (name in Settings) { - $.on(input, event, Settings[name]); - } - } - $.get(items, function(items) { - var key, val; - for (key in items) { - val = items[key]; - input = inputs[key]; - input[input.type === 'checkbox' ? 'checked' : 'value'] = val; - input.hidden = false; - if (key in Settings) { - Settings[key].call(input); - } - } - }); - listImageHost = $.id('list-fourchanImageHost'); - ref3 = ImageHost.suggestions; - for (l = 0, len2 = ref3.length; l < len2; l++) { - textContent = ref3[l]; - $.add(listImageHost, $.el('option', { - textContent: textContent - })); - } - interval = inputs['Interval']; - customCSS = inputs['Custom CSS']; - applyCSS = $('#apply-css', section); - interval.value = Conf['Interval']; - customCSS.checked = Conf['Custom CSS']; - inputs['usercss'].disabled = !Conf['Custom CSS']; - applyCSS.disabled = !Conf['Custom CSS']; - $.on(interval, 'change', ThreadUpdater.cb.interval); - $.on(customCSS, 'change', Settings.togglecss); - $.on(applyCSS, 'click', function() { - return CustomCSS.update(); - }); - itemsArchive = $.dict(); - ref4 = ['archives', 'selectedArchives', 'lastarchivecheck']; - for (m = 0, len3 = ref4.length; m < len3; m++) { - name = ref4[m]; - itemsArchive[name] = Conf[name]; - } - $.get(itemsArchive, function(itemsArchive) { - $.extend(Conf, itemsArchive); - Redirect.selectArchives(); - return Settings.addArchiveTable(section); - }); - boardSelect = $('#archive-board-select', section); - table = $('#archive-table', section); - updateArchives = $('#update-archives', section); - $.on(boardSelect, 'change', function() { - $('tbody > :not([hidden])', table).hidden = true; - return $("tbody > ." + this.value, table).hidden = false; - }); - return $.on(updateArchives, 'click', function() { - return Redirect.update(function() { - return Settings.addArchiveTable(section); - }); - }); - }, - addArchiveTable: function(section) { - var archBoards, archive, boardID, boardOptions, boardSelect, boards, data, files, id, item, j, k, l, len, len1, len2, len3, m, name, o, ref, ref1, ref2, ref3, ref4, row, rows, select, software, table, tbody, type, uid; - $('#lastarchivecheck', section).textContent = Conf['lastarchivecheck'] === 0 ? 'never' : new Date(Conf['lastarchivecheck']).toLocaleString(); - boardSelect = $('#archive-board-select', section); - table = $('#archive-table', section); - tbody = $('tbody', section); - $.rmAll(boardSelect); - $.rmAll(tbody); - archBoards = $.dict(); - ref = Conf['archives']; - for (j = 0, len = ref.length; j < len; j++) { - ref1 = ref[j], uid = ref1.uid, name = ref1.name, boards = ref1.boards, files = ref1.files, software = ref1.software; - if (software !== 'fuuka' && software !== 'foolfuuka') { - continue; - } - for (k = 0, len1 = boards.length; k < len1; k++) { - boardID = boards[k]; - o = archBoards[boardID] || (archBoards[boardID] = { - thread: [], - post: [], - file: [] - }); - archive = [uid != null ? uid : name, name]; - o.thread.push(archive); - if (software === 'foolfuuka') { - o.post.push(archive); - } - if (indexOf.call(files, boardID) >= 0) { - o.file.push(archive); - } - } - } - rows = []; - boardOptions = []; - ref2 = Object.keys(archBoards).sort(); - for (l = 0, len2 = ref2.length; l < len2; l++) { - boardID = ref2[l]; - row = $.el('tr', { - className: "board-" + boardID - }); - row.hidden = boardID !== g.BOARD.ID; - boardOptions.push($.el('option', { - textContent: "/" + boardID + "/", - value: "board-" + boardID, - selected: boardID === g.BOARD.ID - })); - o = archBoards[boardID]; - ref3 = ['thread', 'post', 'file']; - for (m = 0, len3 = ref3.length; m < len3; m++) { - item = ref3[m]; - $.add(row, Settings.addArchiveCell(boardID, o, item)); - } - rows.push(row); - } - if (rows.length === 0) { - boardSelect.hidden = table.hidden = true; - return; - } - boardSelect.hidden = table.hidden = false; - if (!(g.BOARD.ID in archBoards)) { - rows[0].hidden = false; - } - $.add(boardSelect, boardOptions); - $.add(tbody, rows); - ref4 = Conf['selectedArchives']; - for (boardID in ref4) { - data = ref4[boardID]; - for (type in data) { - id = data[type]; - if ((select = $("select[data-boardid='" + boardID + "'][data-type='" + type + "']", tbody))) { - select.value = JSON.stringify(id); - if (!select.value) { - select.value = select.firstChild.value; - } - } - } - } - }, - addArchiveCell: function(boardID, data, type) { - var archive, i, length, options, select, td; - length = data[type].length; - td = $.el('td', { - className: 'archive-cell' - }); - if (!length) { - td.textContent = '--'; - return td; - } - options = []; - i = 0; - while (i < length) { - archive = data[type][i++]; - options.push($.el('option', { - value: JSON.stringify(archive[0]), - textContent: archive[1] - })); - } - $.extend(td, {innerHTML: ""}); - select = td.firstElementChild; - if (!(select.disabled = length === 1)) { - select.setAttribute('data-boardid', boardID); - select.setAttribute('data-type', type); - $.on(select, 'change', Settings.saveSelectedArchive); - } - $.add(select, options); - return td; - }, - saveSelectedArchive: function() { - return $.get('selectedArchives', Conf['selectedArchives'], (function(_this) { - return function(arg) { - var name1, selectedArchives; - selectedArchives = arg.selectedArchives; - (selectedArchives[name1 = _this.dataset.boardid] || (selectedArchives[name1] = $.dict()))[_this.dataset.type] = JSON.parse(_this.value); - $.set('selectedArchives', selectedArchives); - Conf['selectedArchives'] = selectedArchives; - return Redirect.selectArchives(); - }; - })(this)); - }, - boardnav: function() { - return Header.generateBoardList(this.value); - }, - time: function() { - return this.nextElementSibling.textContent = Time.format(this.value, new Date()); - }, - timeLocale: function() { - return Settings.time.call($('[name=time]', Settings.dialog)); - }, - backlink: function() { - return this.nextElementSibling.textContent = this.value.replace(/%(?:id|%)/g, function(x) { - return { - '%id': '123456789', - '%%': '%' - }[x]; - }); - }, - fileInfo: function() { - var data; - data = { - isReply: true, - file: { - url: "//" + (ImageHost.host()) + "/g/1334437723720.jpg", - name: 'd9bb2efc98dd0df141a94399ff5880b7.jpg', - size: '276 KB', - sizeInBytes: 276 * 1024, - dimensions: '1280x720', - isImage: true, - isVideo: false, - isSpoiler: true, - tag: 'Loop' - } - }; - return FileInfo.format(this.value, data, this.nextElementSibling); - }, - favicon: function() { - var f, i, icon, img, j, len, ref; - Favicon["switch"](); - if (g.VIEW === 'thread' && Conf['Unread Favicon']) { - Unread.update(); - } - img = this.nextElementSibling.children; - f = Favicon; - ref = [f.SFW, f.unreadSFW, f.unreadSFWY, f.NSFW, f.unreadNSFW, f.unreadNSFWY, f.dead, f.unreadDead, f.unreadDeadY]; - for (i = j = 0, len = ref.length; j < len; i = ++j) { - icon = ref[i]; - if (!img[i]) { - $.add(this.nextElementSibling, $.el('img')); - } - img[i].src = icon; - } - }, - togglecss: function() { - if ($('textarea[name=usercss]', $.x('ancestor::fieldset[1]', this)).disabled = $.id('apply-css').disabled = !this.checked) { - CustomCSS.rmStyle(); - } else { - CustomCSS.addStyle(); - } - return $.cb.checked.call(this); - }, - keybinds: function(section) { - var arr, input, inputs, items, key, ref, tbody, tr; - $.extend(section, {innerHTML: "
        Keybinds are disabled.
        Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
        Press Backspace to disable a keybind.
        ActionsKeybinds
        "}); - $('.warning', section).hidden = Conf['Keybinds']; - tbody = $('tbody', section); - items = $.dict(); - inputs = $.dict(); - ref = Config.hotkeys; - for (key in ref) { - arr = ref[key]; - tr = $.el('tr', {innerHTML: "" + E(arr[1]) + ""}); - input = $('input', tr); - input.name = key; - input.spellcheck = false; - items[key] = Conf[key]; - inputs[key] = input; - $.on(input, 'keydown', Settings.keybind); - $.add(tbody, tr); - } - return $.get(items, function(items) { - var val; - for (key in items) { - val = items[key]; - inputs[key].value = val; - } - }); - }, - keybind: function(e) { - var key; - if (e.keyCode === 9) { - return; - } - e.preventDefault(); - e.stopPropagation(); - if ((key = Keybinds.keyCode(e)) == null) { - return; - } - this.value = key; - return $.cb.value.call(this); - } - }; - - return Settings; - -}).call(this); - -Test = (function() { - return Test; - -}).call(this); - -UI = (function() { - var Menu, UI, checkbox, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove, - bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - slice = [].slice; - - dialog = function(id, properties) { - var child, el, i, len, move, ref; - el = $.el('div', { - className: 'dialog', - id: id - }); - $.extend(el, properties); - el.style.cssText = Conf[id + ".position"]; - move = $('.move', el); - $.on(move, 'touchstart mousedown', dragstart); - ref = move.children; - for (i = 0, len = ref.length; i < len; i++) { - child = ref[i]; - if (!child.tagName) { - continue; - } - $.on(child, 'touchstart mousedown', function(e) { - return e.stopPropagation(); - }); - } - return el; - }; - - Menu = (function() { - var currentMenu, lastToggledButton; - - currentMenu = null; - - lastToggledButton = null; - - function Menu(type) { - this.type = type; - this.addEntry = bind(this.addEntry, this); - this.onFocus = bind(this.onFocus, this); - this.keybinds = bind(this.keybinds, this); - this.close = bind(this.close, this); - this.setPosition = bind(this.setPosition, this); - $.on(d, 'AddMenuEntry', (function(_this) { - return function(arg) { - var detail; - detail = arg.detail; - if (detail.type !== _this.type) { - return; - } - delete detail.open; - return _this.addEntry(detail); - }; - })(this)); - this.entries = []; - } - - Menu.prototype.makeMenu = function() { - var menu; - menu = $.el('div', { - className: 'dialog', - id: 'menu', - tabIndex: 0 - }); - menu.dataset.type = this.type; - $.on(menu, 'click', function(e) { - return e.stopPropagation(); - }); - $.on(menu, 'keydown', this.keybinds); - return menu; - }; - - Menu.prototype.toggle = function(e, button, data) { - var previousButton; - e.preventDefault(); - e.stopPropagation(); - if (currentMenu) { - previousButton = lastToggledButton; - currentMenu.close(); - if (previousButton === button) { - return; - } - } - if (!this.entries.length) { - return; - } - return this.open(button, data); - }; - - Menu.prototype.open = function(button, data) { - var entry, i, len, menu, ref; - menu = this.menu = this.makeMenu(); - currentMenu = this; - lastToggledButton = button; - this.entries.sort(function(first, second) { - return first.order - second.order; - }); - ref = this.entries; - for (i = 0, len = ref.length; i < len; i++) { - entry = ref[i]; - this.insertEntry(entry, menu, data); - } - $.addClass(lastToggledButton, 'active'); - $.on(d, 'click CloseMenu', this.close); - $.on(d, 'scroll', this.setPosition); - $.on(window, 'resize', this.setPosition); - $.after(button, menu); - this.setPosition(); - entry = $('.entry', menu); - this.focus(entry); - return menu.focus(); - }; - - Menu.prototype.setPosition = function() { - var bLeft, bRect, bTop, bottom, cHeight, cWidth, left, mRect, ref, ref1, right, top; - mRect = this.menu.getBoundingClientRect(); - bRect = lastToggledButton.getBoundingClientRect(); - bTop = window.scrollY + bRect.top; - bLeft = window.scrollX + bRect.left; - cHeight = doc.clientHeight; - cWidth = doc.clientWidth; - ref = bRect.top + bRect.height + mRect.height < cHeight ? [bRect.bottom + "px", ''] : ['', (cHeight - bRect.top) + "px"], top = ref[0], bottom = ref[1]; - ref1 = bRect.left + mRect.width < cWidth ? [bRect.left + "px", ''] : ['', (cWidth - bRect.right) + "px"], left = ref1[0], right = ref1[1]; - $.extend(this.menu.style, { - top: top, - right: right, - bottom: bottom, - left: left - }); - return this.menu.classList.toggle('left', right); - }; - - Menu.prototype.insertEntry = function(entry, parent, data) { - var err, i, len, ref, subEntry, submenu; - if (typeof entry.open === 'function') { - try { - if (!entry.open(data)) { - return; - } - } catch (error) { - err = error; - Main.handleErrors({ - message: "Error in building the " + this.type + " menu.", - error: err - }); - return; - } - } - $.add(parent, entry.el); - if (!entry.subEntries) { - return; - } - if (submenu = $('.submenu', entry.el)) { - $.rm(submenu); - } - submenu = $.el('div', { - className: 'dialog submenu' - }); - ref = entry.subEntries; - for (i = 0, len = ref.length; i < len; i++) { - subEntry = ref[i]; - this.insertEntry(subEntry, submenu, data); - } - $.add(entry.el, submenu); - }; - - Menu.prototype.close = function() { - $.rm(this.menu); - delete this.menu; - $.rmClass(lastToggledButton, 'active'); - currentMenu = null; - lastToggledButton = null; - $.off(d, 'click scroll CloseMenu', this.close); - $.off(d, 'scroll', this.setPosition); - return $.off(window, 'resize', this.setPosition); - }; - - Menu.prototype.findNextEntry = function(entry, direction) { - var entries; - entries = slice.call(entry.parentNode.children); - entries.sort(function(first, second) { - return first.style.order - second.style.order; - }); - return entries[entries.indexOf(entry) + direction]; - }; - - Menu.prototype.keybinds = function(e) { - var entry, next, nextPrev, subEntry, submenu; - entry = $('.focused', this.menu); - while (subEntry = $('.focused', entry)) { - entry = subEntry; - } - switch (e.keyCode) { - case 27: - lastToggledButton.focus(); - this.close(); - break; - case 13: - case 32: - entry.click(); - break; - case 38: - if (next = this.findNextEntry(entry, -1)) { - this.focus(next); - } - break; - case 40: - if (next = this.findNextEntry(entry, +1)) { - this.focus(next); - } - break; - case 39: - if ((submenu = $('.submenu', entry)) && (next = submenu.firstElementChild)) { - while (nextPrev = this.findNextEntry(next, -1)) { - next = nextPrev; - } - this.focus(next); - } - break; - case 37: - if (next = $.x('parent::*[contains(@class,"submenu")]/parent::*', entry)) { - this.focus(next); - } - break; - default: - return; - } - e.preventDefault(); - return e.stopPropagation(); - }; - - Menu.prototype.onFocus = function(e) { - e.stopPropagation(); - return this.focus(e.target); - }; - - Menu.prototype.focus = function(entry) { - var bottom, cHeight, cWidth, eRect, focused, i, left, len, ref, ref1, ref2, right, sRect, style, submenu, top; - while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) { - $.rmClass(focused, 'focused'); - } - ref = $$('.focused', entry); - for (i = 0, len = ref.length; i < len; i++) { - focused = ref[i]; - $.rmClass(focused, 'focused'); - } - $.addClass(entry, 'focused'); - if (!(submenu = $('.submenu', entry))) { - return; - } - sRect = submenu.getBoundingClientRect(); - eRect = entry.getBoundingClientRect(); - cHeight = doc.clientHeight; - cWidth = doc.clientWidth; - ref1 = eRect.top + sRect.height < cHeight ? ['0px', 'auto'] : ['auto', '0px'], top = ref1[0], bottom = ref1[1]; - ref2 = eRect.right + sRect.width < cWidth - 150 ? ['100%', 'auto'] : ['auto', '100%'], left = ref2[0], right = ref2[1]; - style = submenu.style; - style.top = top; - style.bottom = bottom; - style.left = left; - return style.right = right; - }; - - Menu.prototype.addEntry = function(entry) { - this.parseEntry(entry); - return this.entries.push(entry); - }; - - Menu.prototype.parseEntry = function(entry) { - var el, i, len, subEntries, subEntry; - el = entry.el, subEntries = entry.subEntries; - $.addClass(el, 'entry'); - $.on(el, 'focus mouseover', this.onFocus); - el.style.order = entry.order || 100; - if (!subEntries) { - return; - } - $.addClass(el, 'has-submenu'); - for (i = 0, len = subEntries.length; i < len; i++) { - subEntry = subEntries[i]; - this.parseEntry(subEntry); - } - }; - - return Menu; - - })(); - - dragstart = function(e) { - var el, isTouching, o, rect, ref, screenHeight, screenWidth; - if (e.type === 'mousedown' && e.button !== 0) { - return; - } - e.preventDefault(); - if (isTouching = e.type === 'touchstart') { - e = e.changedTouches[e.changedTouches.length - 1]; - } - el = $.x('ancestor::div[contains(@class,"dialog")][1]', this); - rect = el.getBoundingClientRect(); - screenHeight = doc.clientHeight; - screenWidth = doc.clientWidth; - o = { - id: el.id, - style: el.style, - dx: e.clientX - rect.left, - dy: e.clientY - rect.top, - height: screenHeight - rect.height, - width: screenWidth - rect.width, - screenHeight: screenHeight, - screenWidth: screenWidth, - isTouching: isTouching - }; - ref = Conf['Header auto-hide'] || !Conf['Fixed Header'] ? [0, 0] : Conf['Bottom Header'] ? [0, Header.bar.getBoundingClientRect().height] : [Header.bar.getBoundingClientRect().height, 0], o.topBorder = ref[0], o.bottomBorder = ref[1]; - if (isTouching) { - o.identifier = e.identifier; - o.move = touchmove.bind(o); - o.up = touchend.bind(o); - $.on(d, 'touchmove', o.move); - return $.on(d, 'touchend touchcancel', o.up); - } else { - o.move = drag.bind(o); - o.up = dragend.bind(o); - $.on(d, 'mousemove', o.move); - return $.on(d, 'mouseup', o.up); - } - }; - - touchmove = function(e) { - var i, len, ref, touch; - ref = e.changedTouches; - for (i = 0, len = ref.length; i < len; i++) { - touch = ref[i]; - if (touch.identifier === this.identifier) { - drag.call(this, touch); - return; - } - } - }; - - drag = function(e) { - var bottom, clientX, clientY, left, right, style, top; - clientX = e.clientX, clientY = e.clientY; - left = clientX - this.dx; - left = left < 10 ? 0 : this.width - left < 10 ? '' : left / this.screenWidth * 100 + '%'; - top = clientY - this.dy; - top = top < (10 + this.topBorder) ? this.topBorder + 'px' : this.height - top < (10 + this.bottomBorder) ? '' : top / this.screenHeight * 100 + '%'; - right = left === '' ? 0 : ''; - bottom = top === '' ? this.bottomBorder + 'px' : ''; - style = this.style; - style.left = left; - style.right = right; - style.top = top; - return style.bottom = bottom; - }; - - touchend = function(e) { - var i, len, ref, touch; - ref = e.changedTouches; - for (i = 0, len = ref.length; i < len; i++) { - touch = ref[i]; - if (touch.identifier === this.identifier) { - dragend.call(this); - return; - } - } - }; - - dragend = function() { - if (this.isTouching) { - $.off(d, 'touchmove', this.move); - $.off(d, 'touchend touchcancel', this.up); - } else { - $.off(d, 'mousemove', this.move); - $.off(d, 'mouseup', this.up); - } - return $.set(this.id + ".position", this.style.cssText); - }; - - hoverstart = function(arg) { - var cb, el, endEvents, height, latestEvent, noRemove, o, rect, ref, root, width; - root = arg.root, el = arg.el, latestEvent = arg.latestEvent, endEvents = arg.endEvents, height = arg.height, width = arg.width, cb = arg.cb, noRemove = arg.noRemove; - rect = root.getBoundingClientRect(); - o = { - root: root, - el: el, - style: el.style, - isImage: (ref = el.nodeName) === 'IMG' || ref === 'VIDEO', - cb: cb, - endEvents: endEvents, - latestEvent: latestEvent, - clientHeight: doc.clientHeight, - clientWidth: doc.clientWidth, - height: height, - width: width, - noRemove: noRemove, - clientX: (rect.left + rect.right) / 2, - clientY: (rect.top + rect.bottom) / 2 - }; - o.hover = hover.bind(o); - o.hoverend = hoverend.bind(o); - o.hover(o.latestEvent); - new MutationObserver(function() { - if (el.parentNode) { - return o.hover(o.latestEvent); - } - }).observe(el, { - childList: true - }); - $.on(root, endEvents, o.hoverend); - if ($.x('ancestor::div[contains(@class,"inline")][1]', root)) { - $.on(d, 'keydown', o.hoverend); - } - $.on(root, 'mousemove', o.hover); - o.workaround = function(e) { - if (!root.contains(e.target)) { - return o.hoverend(e); - } - }; - return $.on(doc, 'mousemove', o.workaround); - }; - - hoverstart.padding = 25; - - hover = function(e) { - var clientX, clientY, height, left, marginX, ref, ref1, right, style, threshold, top, width; - this.latestEvent = e; - height = (this.height || this.el.offsetHeight) + hoverstart.padding; - width = this.width || this.el.offsetWidth; - ref = Conf['Follow Cursor'] ? e : this, clientX = ref.clientX, clientY = ref.clientY; - top = this.isImage ? Math.max(0, clientY * (this.clientHeight - height) / this.clientHeight) : Math.max(0, Math.min(this.clientHeight - height, clientY - 120)); - threshold = this.clientWidth / 2; - if (!this.isImage) { - threshold = Math.max(threshold, this.clientWidth - 400); - } - marginX = (clientX <= threshold ? clientX : this.clientWidth - clientX) + 45; - if (this.isImage) { - marginX = Math.min(marginX, this.clientWidth - width); - } - marginX += 'px'; - ref1 = clientX <= threshold ? [marginX, ''] : ['', marginX], left = ref1[0], right = ref1[1]; - style = this.style; - style.top = top + 'px'; - style.left = left; - return style.right = right; - }; - - hoverend = function(e) { - if (e.type === 'keydown' && e.keyCode !== 13 || e.target.nodeName === "TEXTAREA") { - return; - } - if (!this.noRemove) { - $.rm(this.el); - } - $.off(this.root, this.endEvents, this.hoverend); - $.off(d, 'keydown', this.hoverend); - $.off(this.root, 'mousemove', this.hover); - $.off(doc, 'mousemove', this.workaround); - if (this.cb) { - return this.cb.call(this); - } - }; - - checkbox = function(name, text, checked) { - var input, label; - if (checked == null) { - checked = Conf[name]; - } - label = $.el('label'); - input = $.el('input', { - type: 'checkbox', - name: name, - checked: checked - }); - $.add(label, [input, $.tn(" " + text)]); - return label; - }; - - UI = { - dialog: dialog, - Menu: Menu, - hover: hoverstart, - checkbox: checkbox - }; - - return UI; - -}).call(this); - -FappeTyme = (function() { - var FappeTyme; - - FappeTyme = { - init: function() { - var el, i, indicator, lc, len, ref, ref1, type; - if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive'))) { - return; - } - this.nodes = {}; - this.enabled = { - fappe: false, - werk: Conf['werk'] - }; - ref1 = ["Fappe", "Werk"]; - for (i = 0, len = ref1.length; i < len; i++) { - type = ref1[i]; - if (!Conf[type + " Tyme"]) { - continue; - } - lc = type.toLowerCase(); - el = UI.checkbox(lc, type + " Tyme", false); - el.title = type + " Tyme"; - this.nodes[lc] = el.firstElementChild; - if (Conf[lc]) { - this.set(lc, true); - } - $.on(this.nodes[lc], 'change', this.toggle.bind(this, lc)); - Header.menu.addEntry({ - el: el, - order: 97 - }); - indicator = $.el('span', { - className: 'indicator', - textContent: type[0], - title: type + " Tyme active" - }); - $.on(indicator, 'click', function() { - var check; - check = $.getOwn(FappeTyme.nodes, this.parentNode.id.replace('shortcut-', '')); - check.checked = !check.checked; - return $.event('change', null, check); - }); - Header.addShortcut(lc, indicator, 410); - } - if (Conf['Werk Tyme']) { - $.sync('werk', this.set.bind(this, 'werk')); - } - Callbacks.Post.push({ - name: 'Fappe Tyme', - cb: this.node - }); - return Callbacks.CatalogThread.push({ - name: 'Werk Tyme', - cb: this.catalogNode - }); - }, - node: function() { - return this.nodes.root.classList.toggle('noFile', !this.files.length); - }, - catalogNode: function() { - var file, filename; - file = this.thread.OP.files[0]; - if (!file) { - return; - } - filename = $.el('div', { - textContent: file.name, - className: 'werkTyme-filename' - }); - return $.add(this.nodes.thumb.parentNode, filename); - }, - set: function(type, enabled) { - this.enabled[type] = this.nodes[type].checked = enabled; - return $[(enabled ? 'add' : 'rm') + "Class"](doc, type + "Tyme"); - }, - toggle: function(type) { - this.set(type, !this.enabled[type]); - if (type === 'werk') { - return $.cb.checked.call(this.nodes[type]); - } - } - }; - - return FappeTyme; - -}).call(this); - -Gallery = (function() { - var Gallery; - - Gallery = { - init: function() { - var el, ref; - if (!(this.enabled = Conf['Gallery'] && ((ref = g.VIEW) === 'index' || ref === 'thread'))) { - return; - } - this.delay = Conf['Slide Delay']; - el = $.el('a', { - href: 'javascript:;', - title: 'Gallery', - className: 'fa fa-picture-o', - textContent: 'Gallery' - }); - $.on(el, 'click', this.cb.toggle); - Header.addShortcut('gallery', el, 530); - return Callbacks.Post.push({ - name: 'Gallery', - cb: this.node - }); - }, - node: function() { - var file, i, len, ref, results; - ref = this.files; - results = []; - for (i = 0, len = ref.length; i < len; i++) { - file = ref[i]; - if (!file.thumb) { - continue; - } - if (Gallery.nodes) { - Gallery.generateThumb(this, file); - Gallery.nodes.total.textContent = Gallery.images.length; - } - if (!(Conf['Image Expansion'] || (g.SITE.software === 'tinyboard' && Main.jsEnabled))) { - results.push($.on(file.thumbLink, 'click', Gallery.cb.image)); - } else { - results.push(void 0); - } - } - return results; - }, - build: function(image) { - var candidate, cb, dialog, entry, file, i, j, k, key, len, len1, len2, menuButton, nodes, post, postThumb, ref, ref1, ref2, ref3, thumb, value; - cb = Gallery.cb; - if (Conf['Fullscreen Gallery']) { - $.one(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', function() { - return $.on(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', cb.close); - }); - if (typeof doc.mozRequestFullScreen === "function") { - doc.mozRequestFullScreen(); - } - if (typeof doc.webkitRequestFullScreen === "function") { - doc.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT); - } - } - Gallery.images = []; - nodes = Gallery.nodes = {}; - Gallery.fileIDs = $.dict(); - Gallery.slideshow = false; - nodes.el = dialog = $.el('div', { - id: 'a-gallery' - }); - $.extend(dialog, {innerHTML: "
        ×
        /
        "}); - ref = { - buttons: '.gal-buttons', - frame: '.gal-image', - name: '.gal-name', - count: '.count', - total: '.total', - sauce: '.gal-sauce', - thumbs: '.gal-thumbnails', - next: '.gal-image a', - current: '.gal-image img' - }; - for (key in ref) { - value = ref[key]; - nodes[key] = $(value, dialog); - } - menuButton = $('.menu-button', dialog); - nodes.menu = new UI.Menu('gallery'); - $.on(nodes.frame, 'click', cb.blank); - if (Conf['Mouse Wheel Volume']) { - $.on(nodes.frame, 'wheel', Volume.wheel); - } - $.on(nodes.next, 'click', cb.click); - $.on(nodes.name, 'click', ImageCommon.download); - $.on($('.gal-prev', dialog), 'click', cb.prev); - $.on($('.gal-next', dialog), 'click', cb.next); - $.on($('.gal-start', dialog), 'click', cb.start); - $.on($('.gal-stop', dialog), 'click', cb.stop); - $.on($('.gal-close', dialog), 'click', cb.close); - $.on(menuButton, 'click', function(e) { - return nodes.menu.toggle(e, this, g); - }); - ref1 = Gallery.menu.createSubEntries(); - for (i = 0, len = ref1.length; i < len; i++) { - entry = ref1[i]; - entry.order = 0; - nodes.menu.addEntry(entry); - } - $.on(d, 'keydown', cb.keybinds); - if (Conf['Keybinds']) { - $.off(d, 'keydown', Keybinds.keydown); - } - $.on(window, 'resize', Gallery.cb.setHeight); - ref2 = $$(g.SITE.selectors.file.thumb); - for (j = 0, len1 = ref2.length; j < len1; j++) { - postThumb = ref2[j]; - if (!(post = Get.postFromNode(postThumb))) { - continue; - } - ref3 = post.files; - for (k = 0, len2 = ref3.length; k < len2; k++) { - file = ref3[k]; - if (!file.thumb) { - continue; - } - Gallery.generateThumb(post, file); - if (!image && Gallery.fileIDs[post.fullID + "." + file.index]) { - candidate = file.thumbLink; - if (Header.getTopOf(candidate) + candidate.getBoundingClientRect().height >= 0) { - image = candidate; - } - } - } - } - $.addClass(doc, 'gallery-open'); - $.add(d.body, dialog); - nodes.thumbs.scrollTop = 0; - nodes.current.parentElement.scrollTop = 0; - if (image) { - thumb = $("[href='" + image.href + "']", nodes.thumbs); - } - thumb || (thumb = Gallery.images[Gallery.images.length - 1]); - if (thumb) { - Gallery.open(thumb); - } - doc.style.overflow = 'hidden'; - return nodes.total.textContent = Gallery.images.length; - }, - generateThumb: function(post, file) { - var thumb, thumbImg; - if (post.isClone || post.isHidden) { - return; - } - if (!(file && file.thumb && (file.isImage || file.isVideo || Conf['PDF in Gallery']))) { - return; - } - if (Gallery.fileIDs[post.fullID + "." + file.index]) { - return; - } - Gallery.fileIDs[post.fullID + "." + file.index] = true; - thumb = $.el('a', { - className: 'gal-thumb', - href: file.url, - target: '_blank', - title: file.name - }); - thumb.dataset.id = Gallery.images.length; - thumb.dataset.post = post.fullID; - thumb.dataset.file = file.index; - thumbImg = file.thumb.cloneNode(false); - thumbImg.style.cssText = ''; - $.add(thumb, thumbImg); - $.on(thumb, 'click', Gallery.cb.open); - Gallery.images.push(thumb); - return $.add(Gallery.nodes.thumbs, thumb); - }, - load: function(thumb, errorCB) { - var elType, ext, file; - ext = thumb.href.match(/\w*$/); - elType = $.getOwn({ - 'webm': 'video', - 'mp4': 'video', - 'ogv': 'video', - 'pdf': 'iframe' - }, ext) || 'img'; - file = $.el(elType); - $.extend(file.dataset, thumb.dataset); - $.on(file, 'error', errorCB); - file.src = thumb.href; - return file; - }, - open: function(thumb) { - var el, file, i, len, link, newID, node, nodes, oldID, post, ref, ref1, sauces; - nodes = Gallery.nodes; - oldID = +nodes.current.dataset.id; - newID = +thumb.dataset.id; - if (el = Gallery.images[oldID]) { - $.rmClass(el, 'gal-highlight'); - } - $.addClass(thumb, 'gal-highlight'); - nodes.thumbs.scrollTop = thumb.offsetTop + thumb.offsetHeight / 2 - nodes.thumbs.clientHeight / 2; - if (((ref = Gallery.cache) != null ? ref.dataset.id : void 0) === '' + newID) { - file = Gallery.cache; - $.off(file, 'error', Gallery.cacheError); - $.on(file, 'error', Gallery.error); - } else { - file = Gallery.load(thumb, Gallery.error); - } - $.off(nodes.current, 'error', Gallery.error); - ImageCommon.pause(nodes.current); - $.replace(nodes.current, file); - nodes.current = file; - if (file.nodeName === 'VIDEO') { - file.loop = true; - Volume.setup(file); - if (Conf['Autoplay']) { - file.play(); - } - if (Conf['Show Controls']) { - ImageCommon.addControls(file); - } - } - doc.classList.toggle('gal-pdf', file.nodeName === 'IFRAME'); - Gallery.cb.setHeight(); - nodes.count.textContent = +thumb.dataset.id + 1; - nodes.name.download = nodes.name.textContent = thumb.title; - nodes.name.href = thumb.href; - nodes.frame.scrollTop = 0; - nodes.next.focus(); - $.rmAll(nodes.sauce); - if (Conf['Sauce'] && Sauce.links && (post = g.posts.get(file.dataset.post))) { - sauces = []; - ref1 = Sauce.links; - for (i = 0, len = ref1.length; i < len; i++) { - link = ref1[i]; - if ((node = Sauce.createSauceLink(link, post, post.files[+file.dataset.file]))) { - sauces.push($.tn(' '), node); - } - } - $.add(nodes.sauce, sauces); - } - if (Gallery.slideshow && (newID > oldID || (oldID === Gallery.images.length - 1 && newID === 0))) { - Gallery.setupTimer(); - } else { - Gallery.cb.stop(); - } - if (Conf['Scroll to Post'] && (post = g.posts.get(file.dataset.post))) { - Header.scrollTo(post.nodes.root); - } - if (isNaN(oldID) || newID === (oldID + 1) % Gallery.images.length) { - return Gallery.cache = Gallery.load(Gallery.images[(newID + 1) % Gallery.images.length], Gallery.cacheError); - } - }, - error: function() { - var file, post, ref; - if (((ref = this.error) != null ? ref.code : void 0) === MediaError.MEDIA_ERR_DECODE) { - return new Notice('error', 'Corrupt or unplayable video', 30); - } - if (ImageCommon.isFromArchive(this)) { - return; - } - post = g.posts.get(this.dataset.post); - file = post.files[+this.dataset.file]; - return ImageCommon.error(this, post, file, null, (function(_this) { - return function(url) { - if (!url) { - return; - } - Gallery.images[+_this.dataset.id].href = url; - if (Gallery.nodes.current === _this) { - return _this.src = url; - } - }; - })(this)); - }, - cacheError: function() { - return delete Gallery.cache; - }, - cleanupTimer: function() { - var current; - clearTimeout(Gallery.timeoutID); - current = Gallery.nodes.current; - $.off(current, 'canplaythrough load', Gallery.startTimer); - return $.off(current, 'ended', Gallery.cb.next); - }, - startTimer: function() { - return Gallery.timeoutID = setTimeout(Gallery.checkTimer, Gallery.delay * $.SECOND); - }, - setupTimer: function() { - var current, isVideo; - Gallery.cleanupTimer(); - current = Gallery.nodes.current; - isVideo = current.nodeName === 'VIDEO'; - if (isVideo) { - current.play(); - } - if ((isVideo ? current.readyState >= 4 : current.complete) || current.nodeName === 'IFRAME') { - return Gallery.startTimer(); - } else { - return $.on(current, (isVideo ? 'canplaythrough' : 'load'), Gallery.startTimer); - } - }, - checkTimer: function() { - var current; - current = Gallery.nodes.current; - if (current.nodeName === 'VIDEO' && !current.paused) { - $.on(current, 'ended', Gallery.cb.next); - return current.loop = false; - } else { - return Gallery.cb.next(); - } - }, - cb: { - keybinds: function(e) { - var cb, key; - if (!(key = Keybinds.keyCode(e))) { - return; - } - cb = (function() { - switch (key) { - case Conf['Close']: - case Conf['Open Gallery']: - return Gallery.cb.close; - case Conf['Next Gallery Image']: - return Gallery.cb.next; - case Conf['Advance Gallery']: - return Gallery.cb.advance; - case Conf['Previous Gallery Image']: - return Gallery.cb.prev; - case Conf['Pause']: - return Gallery.cb.pause; - case Conf['Slideshow']: - return Gallery.cb.toggleSlideshow; - case Conf['Rotate image anticlockwise']: - return Gallery.cb.rotateLeft; - case Conf['Rotate image clockwise']: - return Gallery.cb.rotateRight; - case Conf['Download Gallery Image']: - return Gallery.cb.download; - } - })(); - if (!cb) { - return; - } - e.stopPropagation(); - e.preventDefault(); - return cb(); - }, - open: function(e) { - if (e) { - e.preventDefault(); - } - if (this) { - return Gallery.open(this); - } - }, - image: function(e) { - e.preventDefault(); - e.stopPropagation(); - return Gallery.build(this); - }, - prev: function() { - return Gallery.cb.open.call(Gallery.images[+Gallery.nodes.current.dataset.id - 1] || Gallery.images[Gallery.images.length - 1]); - }, - next: function() { - return Gallery.cb.open.call(Gallery.images[+Gallery.nodes.current.dataset.id + 1] || Gallery.images[0]); - }, - click: function(e) { - if (ImageCommon.onControls(e)) { - return; - } - e.preventDefault(); - return Gallery.cb.advance(); - }, - advance: function() { - if (!Conf['Autoplay'] && Gallery.nodes.current.paused) { - return Gallery.nodes.current.play(); - } else { - return Gallery.cb.next(); - } - }, - toggle: function() { - return (Gallery.nodes ? Gallery.cb.close : Gallery.build)(); - }, - blank: function(e) { - if (e.target === this) { - return Gallery.cb.close(); - } - }, - toggleSlideshow: function() { - return Gallery.cb[Gallery.slideshow ? 'stop' : 'start'](); - }, - download: function() { - var name; - name = $('.gal-name'); - return name.click(); - }, - pause: function() { - var current; - Gallery.cb.stop(); - current = Gallery.nodes.current; - if (current.nodeName === 'VIDEO') { - return current[current.paused ? 'play' : 'pause'](); - } - }, - start: function() { - $.addClass(Gallery.nodes.buttons, 'gal-playing'); - Gallery.slideshow = true; - return Gallery.setupTimer(); - }, - stop: function() { - var current; - if (!Gallery.slideshow) { - return; - } - Gallery.cleanupTimer(); - current = Gallery.nodes.current; - if (current.nodeName === 'VIDEO') { - current.loop = true; - } - $.rmClass(Gallery.nodes.buttons, 'gal-playing'); - return Gallery.slideshow = false; - }, - rotateLeft: function() { - return Gallery.cb.rotate(270); - }, - rotateRight: function() { - return Gallery.cb.rotate(90); - }, - rotate: $.debounce(100, function(delta) { - var current; - current = Gallery.nodes.current; - if (current.nodeName === 'IFRAME') { - return; - } - current.dataRotate = ((current.dataRotate || 0) + delta) % 360; - current.style.transform = "rotate(" + current.dataRotate + "deg)"; - return Gallery.cb.setHeight(); - }), - close: function() { - $.off(Gallery.nodes.current, 'error', Gallery.error); - ImageCommon.pause(Gallery.nodes.current); - $.rm(Gallery.nodes.el); - $.rmClass(doc, 'gallery-open'); - if (Conf['Fullscreen Gallery']) { - $.off(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', Gallery.cb.close); - if (typeof d.mozCancelFullScreen === "function") { - d.mozCancelFullScreen(); - } - if (typeof d.webkitExitFullscreen === "function") { - d.webkitExitFullscreen(); - } - } - delete Gallery.nodes; - delete Gallery.fileIDs; - doc.style.overflow = ''; - $.off(d, 'keydown', Gallery.cb.keybinds); - if (Conf['Keybinds']) { - $.on(d, 'keydown', Keybinds.keydown); - } - $.off(window, 'resize', Gallery.cb.setHeight); - return clearTimeout(Gallery.timeoutID); - }, - setFitness: function() { - return (this.checked ? $.addClass : $.rmClass)(doc, "gal-" + (this.name.toLowerCase().replace(/\s+/g, '-'))); - }, - setHeight: $.debounce(100, function() { - var containerHeight, containerWidth, current, dim, frame, height, margin, minHeight, ref, ref1, ref2, ref3, style, width; - ref = Gallery.nodes, current = ref.current, frame = ref.frame; - style = current.style; - if (Conf['Stretch to Fit'] && (dim = (ref1 = g.posts.get(current.dataset.post)) != null ? ref1.files[+current.dataset.file].dimensions : void 0)) { - ref2 = dim.split('x'), width = ref2[0], height = ref2[1]; - containerWidth = frame.clientWidth; - containerHeight = doc.clientHeight - 25; - if ((current.dataRotate || 0) % 180 === 90) { - ref3 = [containerHeight, containerWidth], containerWidth = ref3[0], containerHeight = ref3[1]; - } - minHeight = Math.min(containerHeight, height / width * containerWidth); - style.minHeight = minHeight + 'px'; - style.minWidth = (width / height * minHeight) + 'px'; - } else { - style.minHeight = style.minWidth = ''; - } - if ((current.dataRotate || 0) % 180 === 90) { - style.maxWidth = Conf['Fit Height'] ? (doc.clientHeight - 25) + "px" : 'none'; - style.maxHeight = Conf['Fit Width'] ? frame.clientWidth + "px" : 'none'; - margin = (current.clientWidth - current.clientHeight) / 2; - return style.margin = margin + "px " + (-margin) + "px"; - } else { - return style.maxWidth = style.maxHeight = style.margin = ''; - } - }), - setDelay: function() { - return Gallery.delay = +this.value; - } - }, - menu: { - init: function() { - var el; - if (!Gallery.enabled) { - return; - } - el = $.el('span', { - textContent: 'Gallery', - className: 'gallery-link' - }); - return Header.menu.addEntry({ - el: el, - order: 105, - subEntries: Gallery.menu.createSubEntries() - }); - }, - createSubEntry: function(name) { - var input, label; - label = UI.checkbox(name, name); - input = label.firstElementChild; - if (name === 'Hide Thumbnails' || name === 'Fit Width' || name === 'Fit Height') { - $.on(input, 'change', Gallery.cb.setFitness); - } - $.event('change', null, input); - $.on(input, 'change', $.cb.checked); - if (name === 'Hide Thumbnails' || name === 'Fit Width' || name === 'Fit Height' || name === 'Stretch to Fit') { - $.on(input, 'change', Gallery.cb.setHeight); - } - return { - el: label - }; - }, - createSubEntries: function() { - var delayInput, delayLabel, item, subEntries; - subEntries = (function() { - var i, len, ref, results; - ref = ['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Stretch to Fit', 'Scroll to Post']; - results = []; - for (i = 0, len = ref.length; i < len; i++) { - item = ref[i]; - results.push(Gallery.menu.createSubEntry(item)); - } - return results; - })(); - delayLabel = $.el('label', {innerHTML: "Slide Delay: "}); - delayInput = delayLabel.firstElementChild; - delayInput.value = Gallery.delay; - $.on(delayInput, 'change', Gallery.cb.setDelay); - $.on(delayInput, 'change', $.cb.value); - subEntries.push({ - el: delayLabel - }); - return subEntries; - } - } - }; - - return Gallery; - -}).call(this); - -ImageCommon = (function() { - var ImageCommon, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - ImageCommon = { - pause: function(video) { - if (video.nodeName !== 'VIDEO') { - return; - } - video.pause(); - $.off(video, 'volumechange', Volume.change); - return video.muted = true; - }, - rewind: function(el) { - if (el.nodeName === 'VIDEO') { - if (el.readyState >= el.HAVE_METADATA) { - return el.currentTime = 0; - } - } else if (/\.gif$/.test(el.src)) { - return $.queueTask(function() { - return el.src = el.src; - }); - } - }, - pushCache: function(el) { - ImageCommon.cache = el; - return $.on(el, 'error', ImageCommon.cacheError); - }, - popCache: function() { - var el; - el = ImageCommon.cache; - $.off(el, 'error', ImageCommon.cacheError); - delete ImageCommon.cache; - return el; - }, - cacheError: function() { - if (ImageCommon.cache === this) { - return delete ImageCommon.cache; - } - }, - decodeError: function(file, fileObj) { - var message, ref; - if (((ref = file.error) != null ? ref.code : void 0) !== MediaError.MEDIA_ERR_DECODE) { - return false; - } - if (!(message = $('.warning', fileObj.thumb.parentNode))) { - message = $.el('div', { - className: 'warning' - }); - $.after(fileObj.thumb, message); - } - message.textContent = 'Error: Corrupt or unplayable video'; - return true; - }, - isFromArchive: function(file) { - return g.SITE.software === 'yotsuba' && !ImageHost.test(file.src.split('/')[2]); - }, - error: function(file, post, fileObj, delay, cb) { - var base, parseJSON, redirect, src, threadJSON, timeoutID, url; - src = fileObj.url.split('/'); - url = null; - if (g.SITE.software === 'yotsuba' && Conf['404 Redirect']) { - url = Redirect.to('file', { - boardID: post.board.ID, - filename: src[src.length - 1] - }); - } - if (!(url && Redirect.securityCheck(url))) { - url = null; - } - if ((post.isDead || fileObj.isDead) && !ImageCommon.isFromArchive(file)) { - return cb(url); - } - if (delay != null) { - timeoutID = setTimeout((function() { - return cb(url); - }), delay); - } - if (post.isDead || fileObj.isDead) { - return; - } - redirect = function() { - if (!ImageCommon.isFromArchive(file)) { - if (delay != null) { - clearTimeout(timeoutID); - } - return cb(url); - } - }; - threadJSON = typeof (base = g.SITE.urls).threadJSON === "function" ? base.threadJSON(post) : void 0; - if (!threadJSON) { - return; - } - parseJSON = function(isArchiveURL) { - var archivedThreadJSON, base1, i, len, postObj, ref, ref1; - if (this.status === 404) { - if (!isArchiveURL && (archivedThreadJSON = typeof (base1 = g.SITE.urls).archivedThreadJSON === "function" ? base1.archivedThreadJSON(post) : void 0)) { - $.ajax(archivedThreadJSON, { - onloadend: function() { - return parseJSON.call(this, true); - } - }); - } else { - post.kill(!post.isClone, fileObj.index); - } - } - if (this.status !== 200) { - return redirect(); - } - ref = this.response.posts; - for (i = 0, len = ref.length; i < len; i++) { - postObj = ref[i]; - if (postObj.no === post.ID) { - break; - } - } - if (postObj.no !== post.ID) { - post.kill(); - return redirect(); - } else if (ref1 = fileObj.docIndex, indexOf.call(g.SITE.Build.parseJSON(postObj, post.board).filesDeleted, ref1) >= 0) { - post.kill(true); - return redirect(); - } else { - return url = fileObj.url; - } - }; - return $.ajax(threadJSON, { - onloadend: function() { - return parseJSON.call(this); - } - }); - }, - addControls: function(video) { - var handler; - handler = function() { - var t; - $.off(video, 'mouseover', handler); - t = new Date().getTime(); - return $.asap((function() { - return $.engine !== 'gecko' || (video.readyState >= 3 && video.currentTime <= Math.max(0.1, video.duration - 0.5)) || new Date().getTime() >= t + 1000; - }), function() { - return video.controls = true; - }); - }; - return $.on(video, 'mouseover', handler); - }, - onControls: function(e) { - return (Conf['Show Controls'] && Conf['Click Passthrough'] && e.target.nodeName === 'VIDEO') || (e.target.controls && e.target.getBoundingClientRect().bottom - e.clientY < 35); - }, - download: function(e) { - var download, href, ref; - if (this.protocol === 'blob:') { - return true; - } - e.preventDefault(); - ref = this, href = ref.href, download = ref.download; - return CrossOrigin.file(href, function(blob) { - var a; - if (blob) { - a = $.el('a', { - href: URL.createObjectURL(blob), - download: download, - hidden: true - }); - $.add(d.body, a); - a.click(); - return $.rm(a); - } else { - return new Notice('warning', "Could not download " + href, 20); - } - }); - } - }; - - return ImageCommon; - -}).call(this); - -ImageExpand = (function() { - var ImageExpand, - slice = [].slice; - - ImageExpand = { - init: function() { - var ref; - if (!(this.enabled = Conf['Image Expansion'] && ((ref = g.VIEW) === 'index' || ref === 'thread'))) { - return; - } - this.EAI = $.el('a', { - className: 'expand-all-shortcut fa fa-expand', - textContent: 'EAI', - title: 'Expand All Images', - href: 'javascript:;' - }); - $.on(this.EAI, 'click', this.cb.toggleAll); - Header.addShortcut('expand-all', this.EAI, 520); - $.on(d, 'scroll visibilitychange', this.cb.playVideos); - this.videoControls = $.el('span', { - className: 'video-controls' - }); - $.extend(this.videoControls, {innerHTML: " contract"}); - return Callbacks.Post.push({ - name: 'Image Expansion', - cb: this.node - }); - }, - node: function() { - var ref; - if (!(this.file && (this.file.isImage || this.file.isVideo))) { - return; - } - $.on(this.file.thumbLink, 'click', ImageExpand.cb.toggle); - if (this.isClone) { - if (this.file.isExpanding) { - ImageExpand.contract(this); - return ImageExpand.expand(this); - } else if (this.file.isExpanded && this.file.isVideo) { - Volume.setup(this.file.fullImage); - ImageExpand.setupVideoCB(this); - return ImageExpand.setupVideo(this, !((ref = this.origin.file.fullImage) != null ? ref.paused : void 0) || this.origin.file.wasPlaying, this.file.fullImage.controls); - } - } else if (ImageExpand.on && !this.isHidden && !this.isFetchedQuote && (Conf['Expand spoilers'] || !this.file.isSpoiler) && (Conf['Expand videos'] || !this.file.isVideo)) { - return ImageExpand.expand(this); - } - }, - cb: { - toggle: function(e) { - var file, post, ref; - if ($.modifiedClick(e)) { - return; - } - post = Get.postFromNode(this); - file = post.file; - if (file.isExpanded && ImageCommon.onControls(e)) { - return; - } - e.preventDefault(); - if (!Conf['Autoplay'] && ((ref = file.fullImage) != null ? ref.paused : void 0)) { - return file.fullImage.play(); - } else { - return ImageExpand.toggle(post); - } - }, - toggleAll: function() { - var func, threadRoot, toggle; - $.event('CloseMenu'); - threadRoot = Nav.getThread(); - toggle = function(post) { - var file; - file = post.file; - if (!(file && (file.isImage || file.isVideo) && doc.contains(post.nodes.root))) { - return; - } - if (ImageExpand.on && (!Conf['Expand spoilers'] && file.isSpoiler || !Conf['Expand videos'] && file.isVideo || Conf['Expand from here'] && Header.getTopOf(file.thumb) < 0 || Conf['Expand thread only'] && g.VIEW === 'index' && !(threadRoot != null ? threadRoot.contains(file.thumb) : void 0))) { - return; - } - return $.queueTask(func, post); - }; - if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) { - ImageExpand.EAI.className = 'contract-all-shortcut fa fa-compress'; - ImageExpand.EAI.title = 'Contract All Images'; - func = ImageExpand.expand; - } else { - ImageExpand.EAI.className = 'expand-all-shortcut fa fa-expand'; - ImageExpand.EAI.title = 'Expand All Images'; - func = ImageExpand.contract; - } - return g.posts.forEach(function(post) { - var i, len, ref; - ref = [post].concat(slice.call(post.clones)); - for (i = 0, len = ref.length; i < len; i++) { - post = ref[i]; - toggle(post); - } - }); - }, - playVideos: function() { - return g.posts.forEach(function(post) { - var file, i, len, ref, video, visible; - ref = [post].concat(slice.call(post.clones)); - for (i = 0, len = ref.length; i < len; i++) { - post = ref[i]; - file = post.file; - if (!(file && file.isVideo && file.isExpanded)) { - continue; - } - video = file.fullImage; - visible = ($.hasAudio(video) && !video.muted) || Header.isNodeVisible(video); - if (visible && file.wasPlaying) { - delete file.wasPlaying; - video.play(); - } else if (!visible && !video.paused) { - file.wasPlaying = true; - video.pause(); - } - } - }); - }, - setFitness: function() { - return $[this.checked ? 'addClass' : 'rmClass'](doc, this.name.toLowerCase().replace(/\s+/g, '-')); - } - }, - toggle: function(post) { - var next; - if (!(post.file.isExpanding || post.file.isExpanded)) { - post.file.scrollIntoView = Conf['Scroll into view']; - ImageExpand.expand(post); - return; - } - ImageExpand.contract(post); - if (Conf['Advance on contract']) { - next = post.nodes.root; - while (next = $.x("following::div[contains(@class,'postContainer')][1]", next)) { - if (!($('.stub', next) || next.offsetHeight === 0)) { - break; - } - } - if (next) { - return Header.scrollTo(next); - } - } - }, - contract: function(post) { - var bottom, cb, el, eventName, file, i, len, oldHeight, ref, ref1, scrollY, top, x; - file = post.file; - if (el = file.fullImage) { - top = Header.getTopOf(el); - bottom = top + el.getBoundingClientRect().height; - oldHeight = d.body.clientHeight; - scrollY = window.scrollY; - } - $.rmClass(post.nodes.root, 'expanded-image'); - $.rmClass(file.thumb, 'expanding'); - $.rm(file.videoControls); - file.thumbLink.href = file.url; - file.thumbLink.target = '_blank'; - ref = ['isExpanding', 'isExpanded', 'videoControls', 'wasPlaying', 'scrollIntoView']; - for (i = 0, len = ref.length; i < len; i++) { - x = ref[i]; - delete file[x]; - } - if (!el) { - return; - } - if (doc.contains(el)) { - if (bottom <= 0) { - window.scrollBy(0, scrollY - window.scrollY + d.body.clientHeight - oldHeight); - } else { - Header.scrollToIfNeeded(post.nodes.root); - } - if (window.scrollX > 0) { - window.scrollBy(-window.scrollX, 0); - } - } - $.off(el, 'error', ImageExpand.error); - ImageCommon.pushCache(el); - if (file.isVideo) { - ImageCommon.pause(el); - ref1 = ImageExpand.videoCB; - for (eventName in ref1) { - cb = ref1[eventName]; - $.off(el, eventName, cb); - } - } - if (Conf['Restart when Opened']) { - ImageCommon.rewind(file.thumb); - } - delete file.fullImage; - return $.queueTask(function() { - if (file.isExpanding || file.isExpanded) { - return; - } - $.rmClass(el, 'full-image'); - if (el.id) { - return; - } - return $.rm(el); - }); - }, - expand: function(post, src) { - var el, file, isVideo, ref, thumb, thumbLink; - file = post.file; - thumb = file.thumb, thumbLink = file.thumbLink, isVideo = file.isVideo; - if (post.isHidden || file.isExpanding || file.isExpanded) { - return; - } - $.addClass(thumb, 'expanding'); - file.isExpanding = true; - if (file.fullImage) { - el = file.fullImage; - } else if (((ref = ImageCommon.cache) != null ? ref.dataset.fileID : void 0) === (post.fullID + "." + file.index)) { - el = file.fullImage = ImageCommon.popCache(); - $.on(el, 'error', ImageExpand.error); - if (Conf['Restart when Opened'] && el.id !== 'ihover') { - ImageCommon.rewind(el); - } - el.removeAttribute('id'); - } else { - el = file.fullImage = $.el((isVideo ? 'video' : 'img')); - el.dataset.fileID = post.fullID + "." + file.index; - $.on(el, 'error', ImageExpand.error); - el.src = src || file.url; - } - el.className = 'full-image'; - $.after(thumb, el); - if (isVideo) { - if (!file.videoControls) { - file.videoControls = ImageExpand.videoControls.cloneNode(true); - $.add(file.text, file.videoControls); - } - thumbLink.removeAttribute('href'); - thumbLink.removeAttribute('target'); - el.loop = true; - Volume.setup(el); - ImageExpand.setupVideoCB(post); - } - if (!isVideo) { - return $.asap((function() { - return el.naturalHeight; - }), function() { - return ImageExpand.completeExpand(post); - }); - } else if (el.readyState >= el.HAVE_METADATA) { - return ImageExpand.completeExpand(post); - } else { - return $.on(el, 'loadedmetadata', function() { - return ImageExpand.completeExpand(post); - }); - } - }, - completeExpand: function(post) { - var bottom, file, imageBottom, oldHeight, scrollY; - file = post.file; - if (!file.isExpanding) { - return; - } - bottom = Header.getTopOf(file.thumb) + file.thumb.getBoundingClientRect().height; - oldHeight = d.body.clientHeight; - scrollY = window.scrollY; - $.addClass(post.nodes.root, 'expanded-image'); - $.rmClass(file.thumb, 'expanding'); - file.isExpanded = true; - delete file.isExpanding; - if (doc.contains(post.nodes.root) && bottom <= 0) { - window.scrollBy(0, scrollY - window.scrollY + d.body.clientHeight - oldHeight); - } - if (file.scrollIntoView) { - delete file.scrollIntoView; - imageBottom = Math.min(doc.clientHeight - file.fullImage.getBoundingClientRect().bottom - 25, Header.getBottomOf(file.fullImage)); - if (imageBottom < 0) { - window.scrollBy(0, Math.min(-imageBottom, Header.getTopOf(file.fullImage))); - } - } - if (file.isVideo) { - return ImageExpand.setupVideo(post, Conf['Autoplay'], Conf['Show Controls']); - } - }, - setupVideo: function(post, playing, controls) { - var fullImage; - fullImage = post.file.fullImage; - if (!playing) { - fullImage.controls = controls; - return; - } - fullImage.controls = false; - $.asap((function() { - return doc.contains(fullImage); - }), function() { - if (!d.hidden && Header.isNodeVisible(fullImage)) { - return fullImage.play(); - } else { - return post.file.wasPlaying = true; - } - }); - if (controls) { - return ImageCommon.addControls(fullImage); - } - }, - videoCB: (function() { - var mousedown; - mousedown = false; - return { - mouseover: function() { - return mousedown = false; - }, - mousedown: function(e) { - if (e.button === 0) { - return mousedown = true; - } - }, - mouseup: function(e) { - if (e.button === 0) { - return mousedown = false; - } - }, - mouseout: function(e) { - if (((e.buttons & 1) || mousedown) && e.clientX <= this.getBoundingClientRect().left) { - return ImageExpand.toggle(Get.postFromNode(this)); - } - } - }; - })(), - setupVideoCB: function(post) { - var cb, eventName, ref; - ref = ImageExpand.videoCB; - for (eventName in ref) { - cb = ref[eventName]; - $.on(post.file.fullImage, eventName, cb); - } - if (post.file.videoControls) { - return $.on(post.file.videoControls.firstElementChild, 'click', function() { - return ImageExpand.toggle(post); - }); - } - }, - error: function() { - var post; - post = Get.postFromNode(this); - $.rm(this); - delete post.file.fullImage; - if (!(post.file.isExpanding || post.file.isExpanded)) { - return; - } - if (ImageCommon.decodeError(this, post.file)) { - return ImageExpand.contract(post); - } - if (ImageCommon.isFromArchive(this)) { - return ImageExpand.contract(post); - } - return ImageCommon.error(this, post, post.file, 10 * $.SECOND, function(URL) { - if (post.file.isExpanding || post.file.isExpanded) { - ImageExpand.contract(post); - if (URL) { - return ImageExpand.expand(post, URL); - } - } - }); - }, - menu: { - init: function() { - var conf, createSubEntry, el, name, ref, subEntries; - if (!ImageExpand.enabled) { - return; - } - el = $.el('span', { - textContent: 'Image Expansion', - className: 'image-expansion-link' - }); - createSubEntry = ImageExpand.menu.createSubEntry; - subEntries = []; - ref = Config.imageExpansion; - for (name in ref) { - conf = ref[name]; - subEntries.push(createSubEntry(name, conf[1])); - } - return Header.menu.addEntry({ - el: el, - order: 105, - subEntries: subEntries - }); - }, - createSubEntry: function(name, desc) { - var input, label; - label = UI.checkbox(name, name); - label.title = desc; - input = label.firstElementChild; - if (name === 'Fit width' || name === 'Fit height') { - $.on(input, 'change', ImageExpand.cb.setFitness); - } - $.event('change', null, input); - $.on(input, 'change', $.cb.checked); - return { - el: label - }; - } - } - }; - - return ImageExpand; - -}).call(this); - -ImageHost = (function() { - var ImageHost; - - ImageHost = { - init: function() { - var ref; - if (!((this.useFaster = /\S/.test(Conf['fourchanImageHost'])) && g.SITE.software === 'yotsuba' && ((ref = g.VIEW) === 'index' || ref === 'thread'))) { - return; - } - return Callbacks.Post.push({ - name: 'Image Host Rewriting', - cb: this.node - }); - }, - suggestions: ['i.4cdn.org', 'is2.4chan.org'], - host: function() { - return Conf['fourchanImageHost'].trim() || 'i.4cdn.org'; - }, - flashHost: function() { - return 'i.4cdn.org'; - }, - thumbHost: function() { - return 'i.4cdn.org'; - }, - test: function(hostname) { - return hostname === 'i.4cdn.org' || ImageHost.regex.test(hostname); - }, - regex: /^is\d*\.4chan(?:nel)?\.org$/, - node: function() { - var host; - if (this.isClone) { - return; - } - host = ImageHost.host(); - if (this.file && ImageHost.test(this.file.url.split('/')[2]) && !/\.swf$/.test(this.file.url)) { - this.file.link.hostname = host; - if (this.file.thumbLink) { - this.file.thumbLink.hostname = host; - } - this.file.url = this.file.link.href; - } - return ImageHost.fixLinks($$('a', this.nodes.comment)); - }, - fixLinks: function(links) { - var host, i, len, link; - for (i = 0, len = links.length; i < len; i++) { - link = links[i]; - if (!(ImageHost.test(link.hostname) && !/\.swf$/.test(link.pathname))) { - continue; - } - host = ImageHost.host(); - if (link.hostname !== host) { - link.hostname = host; - } - } - } - }; - - return ImageHost; - -}).call(this); - -ImageHover = (function() { - var ImageHover; - - ImageHover = { - init: function() { - var ref; - if ((ref = g.VIEW) !== 'index' && ref !== 'thread') { - return; - } - if (Conf['Image Hover']) { - Callbacks.Post.push({ - name: 'Image Hover', - cb: this.node - }); - } - if (Conf['Image Hover in Catalog']) { - return Callbacks.CatalogThread.push({ - name: 'Image Hover', - cb: this.catalogNode - }); - } - }, - node: function() { - var file, i, len, ref, results; - ref = this.files; - results = []; - for (i = 0, len = ref.length; i < len; i++) { - file = ref[i]; - if ((file.isImage || file.isVideo) && file.thumb) { - results.push($.on(file.thumb, 'mouseover', ImageHover.mouseover(this, file))); - } - } - return results; - }, - catalogNode: function() { - var file; - file = this.thread.OP.files[0]; - if (!(file && (file.isImage || file.isVideo))) { - return; - } - return $.on(this.nodes.thumb, 'mouseover', ImageHover.mouseover(this.thread.OP, file)); - }, - mouseover: function(post, file) { - return function(e) { - var base, el, error, height, isVideo, maxHeight, maxWidth, ref, ref1, scale, width, x; - if (!doc.contains(this)) { - return; - } - isVideo = file.isVideo; - if (file.isExpanding || file.isExpanded || (typeof (base = g.SITE).isThumbExpanded === "function" ? base.isThumbExpanded(file) : void 0)) { - return; - } - error = ImageHover.error(post, file); - if (((ref = ImageCommon.cache) != null ? ref.dataset.fileID : void 0) === (post.fullID + "." + file.index)) { - el = ImageCommon.popCache(); - $.on(el, 'error', error); - } else { - el = $.el((isVideo ? 'video' : 'img')); - el.dataset.fileID = post.fullID + "." + file.index; - $.on(el, 'error', error); - el.src = file.url; - } - if (Conf['Restart when Opened']) { - ImageCommon.rewind(el); - ImageCommon.rewind(this); - } - el.id = 'ihover'; - $.add(Header.hover, el); - if (isVideo) { - el.loop = true; - el.controls = false; - Volume.setup(el); - if (Conf['Autoplay']) { - el.play(); - if (this.nodeName === 'VIDEO') { - this.currentTime = el.currentTime; - } - } - } - if (file.dimensions) { - ref1 = (function() { - var i, len, ref1, results; - ref1 = file.dimensions.split('x'); - results = []; - for (i = 0, len = ref1.length; i < len; i++) { - x = ref1[i]; - results.push(+x); - } - return results; - })(), width = ref1[0], height = ref1[1]; - maxWidth = doc.clientWidth; - maxHeight = doc.clientHeight - UI.hover.padding; - scale = Math.min(1, maxWidth / width, maxHeight / height); - width *= scale; - height *= scale; - el.style.maxWidth = width + "px"; - el.style.maxHeight = height + "px"; - } - return UI.hover({ - root: this, - el: el, - latestEvent: e, - endEvents: 'mouseout click', - height: height, - width: width, - noRemove: true, - cb: function() { - $.off(el, 'error', error); - ImageCommon.pushCache(el); - ImageCommon.pause(el); - $.rm(el); - return el.removeAttribute('style'); - } - }); - }; - }, - error: function(post, file) { - return function() { - if (ImageCommon.decodeError(this, file)) { - return; - } - return ImageCommon.error(this, post, file, 3 * $.SECOND, (function(_this) { - return function(URL) { - if (URL) { - return _this.src = URL + (_this.src === URL ? '?' + Date.now() : ''); - } else { - return $.rm(_this); - } - }; - })(this)); - }; - } - }; - - return ImageHover; - -}).call(this); - -ImageLoader = (function() { - var ImageLoader, - slice = [].slice; - - ImageLoader = { - init: function() { - var el, ref, ref1, replace; - if ((ref = g.VIEW) !== 'index' && ref !== 'thread' && ref !== 'archive') { - return; - } - replace = Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM']; - if (!(Conf['Image Prefetching'] || replace)) { - return; - } - Callbacks.Post.push({ - name: 'Image Replace', - cb: this.node - }); - $.on(d, 'PostsInserted', function() { - if (ImageLoader.prefetchEnabled || replace) { - return g.posts.forEach(ImageLoader.prefetchAll); - } - }); - if (Conf['Replace WEBM']) { - $.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', this.playVideos); - } - if (!(Conf['Image Prefetching'] && ((ref1 = g.VIEW) === 'index' || ref1 === 'thread'))) { - return; - } - el = $.el('a', { - href: 'javascript:;', - title: 'Prefetch Images', - className: 'fa fa-bolt disabled', - textContent: 'Prefetch' - }); - $.on(el, 'click', this.toggle); - return Header.addShortcut('prefetch', el, 525); - }, - node: function() { - var file, i, len, ref; - if (this.isClone) { - return; - } - ref = this.files; - for (i = 0, len = ref.length; i < len; i++) { - file = ref[i]; - if (Conf['Replace WEBM'] && file.isVideo) { - ImageLoader.replaceVideo(this, file); - } - ImageLoader.prefetch(this, file); - } - }, - replaceVideo: function(post, file) { - var attr, i, len, ref, thumb, video; - thumb = file.thumb; - video = $.el('video', { - preload: 'none', - loop: true, - muted: true, - poster: thumb.src || thumb.dataset.src, - textContent: thumb.alt, - className: thumb.className - }); - video.setAttribute('muted', 'muted'); - video.dataset.md5 = thumb.dataset.md5; - ref = ['height', 'width', 'maxHeight', 'maxWidth']; - for (i = 0, len = ref.length; i < len; i++) { - attr = ref[i]; - video.style[attr] = thumb.style[attr]; - } - video.src = file.url; - $.replace(thumb, video); - file.thumb = video; - return file.videoThumb = true; - }, - prefetch: function(post, file) { - var clone, el, i, isImage, isVideo, len, ref, ref1, replace, thumb, type, url; - isImage = file.isImage, isVideo = file.isVideo, thumb = file.thumb, url = file.url; - if (file.isPrefetched || !(isImage || isVideo) || post.isHidden || post.thread.isHidden) { - return; - } - if (isVideo) { - type = 'WEBM'; - } else { - type = (ref = url.match(/\.([^.]+)$/)) != null ? ref[1].toUpperCase() : void 0; - if (type === 'JPEG') { - type = 'JPG'; - } - } - replace = Conf["Replace " + type] && !/spoiler/.test(thumb.src || thumb.dataset.src); - if (!(replace || ImageLoader.prefetchEnabled)) { - return; - } - if ($.hasClass(doc, 'catalog-mode')) { - return; - } - if (![post].concat(slice.call(post.clones)).some(function(clone) { - return doc.contains(clone.nodes.root); - })) { - return; - } - file.isPrefetched = true; - if (file.videoThumb) { - ref1 = post.clones; - for (i = 0, len = ref1.length; i < len; i++) { - clone = ref1[i]; - clone.file.thumb.preload = 'auto'; - } - thumb.preload = 'auto'; - if ($.engine === 'gecko') { - $.on(thumb, 'loadeddata', function() { - return this.removeAttribute('poster'); - }); - } - return; - } - el = $.el(isImage ? 'img' : 'video'); - if (isVideo) { - el.preload = 'auto'; - } - if (replace && isImage) { - $.on(el, 'load', function() { - var j, len1, ref2; - ref2 = post.clones; - for (j = 0, len1 = ref2.length; j < len1; j++) { - clone = ref2[j]; - clone.file.thumb.src = url; - } - return thumb.src = url; - }); - } - return el.src = url; - }, - prefetchAll: function(post) { - var file, i, len, ref; - ref = post.files; - for (i = 0, len = ref.length; i < len; i++) { - file = ref[i]; - ImageLoader.prefetch(post, file); - } - }, - toggle: function() { - ImageLoader.prefetchEnabled = !ImageLoader.prefetchEnabled; - this.classList.toggle('disabled', !ImageLoader.prefetchEnabled); - if (ImageLoader.prefetchEnabled) { - g.posts.forEach(ImageLoader.prefetchAll); - } - }, - playVideos: function() { - var qpClone, ref; - qpClone = (ref = $.id('qp')) != null ? ref.firstElementChild : void 0; - return g.posts.forEach(function(post) { - var file, i, j, len, len1, ref1, ref2, thumb; - ref1 = [post].concat(slice.call(post.clones)); - for (i = 0, len = ref1.length; i < len; i++) { - post = ref1[i]; - ref2 = post.files; - for (j = 0, len1 = ref2.length; j < len1; j++) { - file = ref2[j]; - if (!file.videoThumb) { - continue; - } - thumb = file.thumb; - if (Header.isNodeVisible(thumb) || post.nodes.root === qpClone) { - thumb.play(); - } else { - thumb.pause(); - } - } - } - }); - } - }; - - return ImageLoader; - -}).call(this); - -Metadata = (function() { - var Metadata; - - Metadata = { - init: function() { - var ref; - if (!(Conf['WEBM Metadata'] && ((ref = g.VIEW) === 'index' || ref === 'thread'))) { - return; - } - return Callbacks.Post.push({ - name: 'WEBM Metadata', - cb: this.node - }); - }, - node: function() { - var el, file, i, j, len1, ref; - ref = this.files; - for (i = j = 0, len1 = ref.length; j < len1; i = ++j) { - file = ref[i]; - if (!(/webm$/i.test(file.url))) { - continue; - } - if (this.isClone) { - el = $('.webm-title', file.text); - } else { - el = $.el('span', { - className: 'webm-title' - }); - el.dataset.index = i; - $.extend(el, {innerHTML: ""}); - $.add(file.text, [$.tn(' '), el]); - } - if (el.children.length === 1) { - $.one(el.lastElementChild, 'mouseover focus', Metadata.load); - } - } - }, - load: function() { - var index; - $.rmClass(this.parentNode, 'error'); - $.addClass(this.parentNode, 'loading'); - index = this.parentNode.dataset.index; - return CrossOrigin.binary(Get.postFromNode(this).files[+index].url, (function(_this) { - return function(data) { - var output, title; - $.rmClass(_this.parentNode, 'loading'); - if (data != null) { - title = Metadata.parse(data); - output = $.el('span', { - textContent: title || '' - }); - if (title == null) { - $.addClass(_this.parentNode, 'not-found'); - } - $.before(_this, output); - _this.parentNode.tabIndex = 0; - if (d.activeElement === _this) { - _this.parentNode.focus(); - } - return _this.tabIndex = -1; - } else { - $.addClass(_this.parentNode, 'error'); - return $.one(_this, 'click', Metadata.load); - } - }; - })(this), { - Range: 'bytes=0-9999' - }); - }, - parse: function(data) { - var element, i, readInt, size, title; - readInt = function() { - var len, n; - n = data[i++]; - len = 0; - while (n < (0x80 >> len)) { - len++; - } - n ^= 0x80 >> len; - while (len-- && i < data.length) { - n = (n << 8) ^ data[i++]; - } - return n; - }; - i = 0; - while (i < data.length) { - element = readInt(); - size = readInt(); - if (element === 0x3BA9) { - title = ''; - while (size-- && i < data.length) { - title += String.fromCharCode(data[i++]); - } - return decodeURIComponent(escape(title)); - } else if (element !== 0x8538067 && element !== 0x549A966) { - i += size; - } - } - return null; - } - }; - - return Metadata; - -}).call(this); - -RevealSpoilers = (function() { - var RevealSpoilers; - - RevealSpoilers = { - init: function() { - var ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive') && Conf['Reveal Spoiler Thumbnails'])) { - return; - } - return Callbacks.Post.push({ - name: 'Reveal Spoiler Thumbnails', - cb: this.node - }); - }, - node: function() { - var file, i, len, ref, thumb; - if (this.isClone) { - return; - } - ref = this.files; - for (i = 0, len = ref.length; i < len; i++) { - file = ref[i]; - if (!(file.thumb && file.isSpoiler)) { - continue; - } - thumb = file.thumb; - thumb.removeAttribute('style'); - thumb.style.maxHeight = thumb.style.maxWidth = this.isReply ? '125px' : '250px'; - if (thumb.src) { - thumb.src = file.thumbURL; - } else { - thumb.dataset.src = file.thumbURL; - } - } - } - }; - - return RevealSpoilers; - -}).call(this); - -Sauce = (function() { - var Sauce, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Sauce = { - init: function() { - var j, len, link, linkData, links, ref, ref1; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Sauce'])) { - return; - } - $.addClass(doc, 'show-sauce'); - links = []; - ref1 = Conf['sauces'].split('\n'); - for (j = 0, len = ref1.length; j < len; j++) { - link = ref1[j]; - if (link[0] !== '#' && (linkData = this.parseLink(link))) { - links.push(linkData); - } - } - if (!links.length) { - return; - } - this.links = links; - this.link = $.el('a', { - target: '_blank', - className: 'sauce' - }); - return Callbacks.Post.push({ - name: 'Sauce', - cb: this.node - }); - }, - parseLink: function(link) { - var err, i, j, len, m, part, parts, ref, ref1, regexp; - if (!(link = link.trim())) { - return null; - } - parts = $.dict(); - ref = link.split(/;(?=(?:text|boards|types|regexp|sandbox):?)/); - for (i = j = 0, len = ref.length; j < len; i = ++j) { - part = ref[i]; - if (i === 0) { - parts['url'] = part; - } else { - m = part.match(/^(\w*):?(.*)$/); - parts[m[1]] = m[2]; - } - } - parts['text'] || (parts['text'] = ((ref1 = parts['url'].match(/(\w+)\.\w+\//)) != null ? ref1[1] : void 0) || '?'); - if ('boards' in parts) { - parts['boards'] = Filter.parseBoards(parts['boards']); - } - if ('regexp' in parts) { - try { - if ((regexp = parts['regexp'].match(/^\/(.*)\/(\w*)$/))) { - parts['regexp'] = RegExp(regexp[1], regexp[2]); - } else { - parts['regexp'] = RegExp(parts['regexp']); - } - } catch (error) { - err = error; - new Notice('warning', [$.tn("Invalid regexp for Sauce link:"), $.el('br'), $.tn(link), $.el('br'), $.tn(err.message)], 60); - return null; - } - } - return parts; - }, - createSauceLink: function(link, post, file) { - var a, base, ext, j, key, len, matches, missing, parts, ref; - ext = file.url.match(/[^.]*$/)[0]; - parts = $.dict(); - $.extend(parts, link); - if (!(!parts['boards'] || parts['boards'][post.siteID + "/" + post.boardID] || parts['boards'][post.siteID + "/*"])) { - return null; - } - if (!(!parts['types'] || indexOf.call(parts['types'].split(','), ext) >= 0)) { - return null; - } - if (!(!parts['regexp'] || (matches = file.name.match(parts['regexp'])))) { - return null; - } - missing = []; - ref = ['url', 'text']; - for (j = 0, len = ref.length; j < len; j++) { - key = ref[j]; - parts[key] = parts[key].replace(/%(T?URL|IMG|[sh]?MD5|board|name|%|semi|\$\d+)/g, function(orig, parameter) { - var type; - if (parameter[0] === '$') { - if (!matches) { - return orig; - } - type = matches[parameter.slice(1)] || ''; - } else { - type = Sauce.formatters[parameter](post, file, ext); - if (type == null) { - missing.push(parameter); - return ''; - } - } - if (key === 'url' && (parameter !== '%' && parameter !== 'semi')) { - if (/^javascript:/i.test(parts['url'])) { - type = JSON.stringify(type); - } - type = encodeURIComponent(type); - } - return type; - }); - } - if ((typeof (base = g.SITE).areMD5sDeferred === "function" ? base.areMD5sDeferred(post.board) : void 0) && missing.length && !missing.filter(function(x) { - return !/^.?MD5$/.test(x); - }).length) { - a = Sauce.link.cloneNode(false); - a.dataset.skip = '1'; - return a; - } - if (missing.length) { - return null; - } - a = Sauce.link.cloneNode(false); - a.href = parts['url']; - a.textContent = parts['text']; - if (/^javascript:/i.test(parts['url'])) { - a.removeAttribute('target'); - } - return a; - }, - node: function() { - var file, j, len, ref; - if (this.isClone) { - return; - } - ref = this.files; - for (j = 0, len = ref.length; j < len; j++) { - file = ref[j]; - Sauce.file(this, file); - } - }, - file: function(post, file) { - var j, len, link, node, nodes, observer, ref, skipped; - nodes = []; - skipped = []; - ref = Sauce.links; - for (j = 0, len = ref.length; j < len; j++) { - link = ref[j]; - if ((node = Sauce.createSauceLink(link, post, file))) { - nodes.push($.tn(' '), node); - if (node.dataset.skip) { - skipped.push([link, node]); - } - } - } - $.add(file.text, nodes); - if (skipped.length) { - observer = new MutationObserver(function() { - var k, len1, node2, ref1; - if (file.text.dataset.md5) { - for (k = 0, len1 = skipped.length; k < len1; k++) { - ref1 = skipped[k], link = ref1[0], node = ref1[1]; - if ((node2 = Sauce.createSauceLink(link, post, file))) { - $.replace(node, node2); - } - } - return observer.disconnect(); - } - }); - return observer.observe(file.text, { - attributes: true - }); - } - }, - formatters: { - TURL: function(post, file) { - return file.thumbURL; - }, - URL: function(post, file) { - return file.url; - }, - IMG: function(post, file, ext) { - if (ext === 'gif' || ext === 'jpg' || ext === 'jpeg' || ext === 'png') { - return file.url; - } else { - return file.thumbURL; - } - }, - MD5: function(post, file) { - return file.MD5; - }, - sMD5: function(post, file) { - var ref; - return (ref = file.MD5) != null ? ref.replace(/[+\/=]/g, function(c) { - return { - '+': '-', - '/': '_', - '=': '' - }[c]; - }) : void 0; - }, - hMD5: function(post, file) { - var c; - if (file.MD5) { - return ((function() { - var j, len, ref, results; - ref = atob(file.MD5); - results = []; - for (j = 0, len = ref.length; j < len; j++) { - c = ref[j]; - results.push(("0" + (c.charCodeAt(0).toString(16))).slice(-2)); - } - return results; - })()).join(''); - } - }, - board: function(post) { - return post.board.ID; - }, - name: function(post, file) { - return file.name; - }, - '%': function() { - return '%'; - }, - semi: function() { - return ';'; - } - } - }; - - return Sauce; - -}).call(this); - -Volume = (function() { - var Volume; - - Volume = { - init: function() { - var base, ref, unmuteEntry, volumeEntry; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Image Expansion'] || Conf['Image Hover'] || Conf['Image Hover in Catalog'] || Conf['Gallery']))) { - return; - } - $.sync('Allow Sound', function(x) { - var ref1; - Conf['Allow Sound'] = x; - return (ref1 = Volume.inputs) != null ? ref1.unmute.checked = x : void 0; - }); - $.sync('Default Volume', function(x) { - var ref1; - Conf['Default Volume'] = x; - return (ref1 = Volume.inputs) != null ? ref1.volume.value = x : void 0; - }); - if (Conf['Mouse Wheel Volume']) { - Callbacks.Post.push({ - name: 'Mouse Wheel Volume', - cb: this.node - }); - } - if (typeof (base = g.SITE).noAudio === "function" ? base.noAudio(g.BOARD) : void 0) { - return; - } - if (Conf['Mouse Wheel Volume']) { - Callbacks.CatalogThread.push({ - name: 'Mouse Wheel Volume', - cb: this.catalogNode - }); - } - unmuteEntry = UI.checkbox('Allow Sound', 'Allow Sound'); - unmuteEntry.title = Config.main['Images and Videos']['Allow Sound'][1]; - volumeEntry = $.el('label', { - title: 'Default volume for videos.' - }); - $.extend(volumeEntry, {innerHTML: " Volume"}); - this.inputs = { - unmute: unmuteEntry.firstElementChild, - volume: volumeEntry.firstElementChild - }; - $.on(this.inputs.unmute, 'change', $.cb.checked); - $.on(this.inputs.volume, 'change', $.cb.value); - Header.menu.addEntry({ - el: unmuteEntry, - order: 200 - }); - return Header.menu.addEntry({ - el: volumeEntry, - order: 201 - }); - }, - setup: function(video) { - video.muted = !Conf['Allow Sound']; - video.volume = Conf['Default Volume']; - return $.on(video, 'volumechange', Volume.change); - }, - change: function() { - var items, key, muted, ref, val, volume; - ref = this, muted = ref.muted, volume = ref.volume; - items = { - 'Allow Sound': !muted, - 'Default Volume': volume - }; - for (key in items) { - val = items[key]; - if (Conf[key] === val) { - delete items[key]; - } - } - $.set(items); - $.extend(Conf, items); - if (Volume.inputs) { - Volume.inputs.unmute.checked = !muted; - return Volume.inputs.volume.value = volume; - } - }, - node: function() { - var base, file, i, len, ref; - if (typeof (base = g.SITE).noAudio === "function" ? base.noAudio(this.board) : void 0) { - return; - } - ref = this.files; - for (i = 0, len = ref.length; i < len; i++) { - file = ref[i]; - if (!file.isVideo) { - continue; - } - if (file.thumb) { - $.on(file.thumb, 'wheel', Volume.wheel.bind(Header.hover)); - } - $.on($('.file-info', file.text) || file.link, 'wheel', Volume.wheel.bind(file.thumbLink)); - } - }, - catalogNode: function() { - var file; - file = this.thread.OP.files[0]; - if (!(file != null ? file.isVideo : void 0)) { - return; - } - return $.on(this.nodes.thumb, 'wheel', Volume.wheel.bind(Header.hover)); - }, - wheel: function(e) { - var el, volume; - if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) { - return; - } - if (!(el = $('video:not([data-md5])', this))) { - return; - } - if (el.muted || !$.hasAudio(el)) { - return; - } - volume = el.volume + 0.1; - if (e.deltaY < 0) { - volume *= 1.1; - } - if (e.deltaY > 0) { - volume /= 1.1; - } - el.volume = $.minmax(volume - 0.1, 0, 1); - return e.preventDefault(); - } - }; - - return Volume; - -}).call(this); - -Embedding = (function() { - var Embedding, - slice = [].slice; - - Embedding = { - init: function() { - var j, len, ref, ref1, type; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive') && Conf['Linkify'] && (Conf['Embedding'] || Conf['Link Title'] || Conf['Cover Preview']))) { - return; - } - this.types = $.dict(); - ref1 = this.ordered_types; - for (j = 0, len = ref1.length; j < len; j++) { - type = ref1[j]; - this.types[type.key] = type; - } - if (Conf['Embedding'] && g.VIEW !== 'archive') { - this.dialog = UI.dialog('embedding', {innerHTML: "
        "}); - this.media = $('#media-embed', this.dialog); - $.one(d, '4chanXInitFinished', this.ready); - $.on(d, 'IndexRefreshInternal', function() { - return g.posts.forEach(function(post) { - var embed, k, l, len1, len2, ref2, ref3; - ref2 = [post].concat(slice.call(post.clones)); - for (k = 0, len1 = ref2.length; k < len1; k++) { - post = ref2[k]; - ref3 = post.nodes.embedlinks; - for (l = 0, len2 = ref3.length; l < len2; l++) { - embed = ref3[l]; - Embedding.cb.catalogRemove.call(embed); - } - } - }); - }); - } - if (Conf['Link Title']) { - return $.on(d, '4chanXInitFinished PostsInserted', function() { - var key, ref2, ref3, service; - ref2 = Embedding.types; - for (key in ref2) { - service = ref2[key]; - if ((ref3 = service.title) != null ? ref3.batchSize : void 0) { - Embedding.flushTitles(service.title); - } - } - }); - } - }, - events: function(post) { - var data, el, i, items; - if (g.VIEW === 'archive') { - return; - } - if (Conf['Embedding']) { - i = 0; - items = post.nodes.embedlinks = $$('.embedder', post.nodes.comment); - while (el = items[i++]) { - $.on(el, 'click', Embedding.cb.click); - if ($.hasClass(el, 'embedded')) { - Embedding.cb.toggle.call(el); - } - } - } - if (Conf['Cover Preview']) { - i = 0; - items = $$('.linkify', post.nodes.comment); - while (el = items[i++]) { - if ((data = Embedding.services(el))) { - Embedding.preview(data); - } - } - } - }, - process: function(link, post) { - var data; - if (!(Conf['Embedding'] || Conf['Link Title'] || Conf['Cover Preview'])) { - return; - } - if ($.x('ancestor::pre', link)) { - return; - } - if (data = Embedding.services(link)) { - data.post = post; - if (Conf['Embedding'] && g.VIEW !== 'archive') { - Embedding.embed(data); - } - if (Conf['Link Title']) { - Embedding.title(data); - } - if (Conf['Cover Preview'] && g.VIEW !== 'archive') { - return Embedding.preview(data); - } - } - }, - services: function(link) { - var href, j, len, match, ref, type; - href = link.href; - ref = Embedding.ordered_types; - for (j = 0, len = ref.length; j < len; j++) { - type = ref[j]; - if ((match = type.regExp.exec(href))) { - return { - key: type.key, - uid: match[1], - options: match[2], - link: link - }; - } - } - }, - embed: function(data) { - var embed, href, key, link, name, options, post, ref, uid, value; - key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post; - href = link.href; - $.addClass(link, key.toLowerCase()); - embed = $.el('a', { - className: 'embedder', - href: 'javascript:;' - }, {innerHTML: "(unembed)"}); - ref = { - key: key, - uid: uid, - options: options, - href: href - }; - for (name in ref) { - value = ref[name]; - embed.dataset[name] = value; - } - $.on(embed, 'click', Embedding.cb.click); - $.after(link, [$.tn(' '), embed]); - post.nodes.embedlinks.push(embed); - if (Conf['Auto-embed'] && !Conf['Floating Embeds'] && !post.isFetchedQuote) { - if ($.hasClass(doc, 'catalog-mode')) { - return $.addClass(embed, 'embed-removed'); - } else { - return Embedding.cb.toggle.call(embed); - } - } - }, - ready: function() { - if (!Main.isThisPageLegit()) { - return; - } - $.addClass(Embedding.dialog, 'empty'); - $.on($('.close', Embedding.dialog), 'click', Embedding.closeFloat); - $.on($('.move', Embedding.dialog), 'mousedown', Embedding.dragEmbed); - $.on($('.jump', Embedding.dialog), 'click', function() { - if (doc.contains(Embedding.lastEmbed)) { - return Header.scrollTo(Embedding.lastEmbed); - } - }); - return $.add(d.body, Embedding.dialog); - }, - closeFloat: function() { - delete Embedding.lastEmbed; - $.addClass(Embedding.dialog, 'empty'); - return $.replace(Embedding.media.firstChild, $.el('div')); - }, - dragEmbed: function() { - var style; - style = Embedding.media.style; - if (Embedding.dragEmbed.mouseup) { - $.off(d, 'mouseup', Embedding.dragEmbed); - Embedding.dragEmbed.mouseup = false; - style.pointerEvents = ''; - return; - } - $.on(d, 'mouseup', Embedding.dragEmbed); - Embedding.dragEmbed.mouseup = true; - return style.pointerEvents = 'none'; - }, - title: function(data) { - var key, link, options, post, service, uid; - key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post; - if (!(service = Embedding.types[key].title)) { - return; - } - $.addClass(link, key.toLowerCase()); - if (service.batchSize) { - (service.queue || (service.queue = [])).push(data); - if (service.queue.length >= service.batchSize) { - return Embedding.flushTitles(service); - } - } else { - return CrossOrigin.cache(service.api(uid), (function() { - return Embedding.cb.title(this, data); - })); - } - }, - flushTitles: function(service) { - var cb, data, queue; - queue = service.queue; - if (!(queue != null ? queue.length : void 0)) { - return; - } - service.queue = []; - cb = function() { - var data, j, len; - for (j = 0, len = queue.length; j < len; j++) { - data = queue[j]; - Embedding.cb.title(this, data); - } - }; - return CrossOrigin.cache(service.api((function() { - var j, len, results; - results = []; - for (j = 0, len = queue.length; j < len; j++) { - data = queue[j]; - results.push(data.uid); - } - return results; - })()), cb); - }, - preview: function(data) { - var key, link, service, uid; - key = data.key, uid = data.uid, link = data.link; - if (!(service = Embedding.types[key].preview)) { - return; - } - return $.on(link, 'mouseover', function(e) { - var el, height, src; - src = service.url(uid); - height = service.height; - el = $.el('img', { - src: src, - id: 'ihover' - }); - $.add(Header.hover, el); - return UI.hover({ - root: link, - el: el, - latestEvent: e, - endEvents: 'mouseout click', - height: height - }); - }); - }, - cb: { - click: function(e) { - var div; - e.preventDefault(); - if (!$.hasClass(this, 'embedded') && (Conf['Floating Embeds'] || $.hasClass(doc, 'catalog-mode'))) { - if (!(div = Embedding.media.firstChild)) { - return; - } - $.replace(div, Embedding.cb.embed(this)); - Embedding.lastEmbed = Get.postFromNode(this).nodes.root; - return $.rmClass(Embedding.dialog, 'empty'); - } else { - return Embedding.cb.toggle.call(this); - } - }, - toggle: function() { - if ($.hasClass(this, "embedded")) { - $.rm(this.nextElementSibling); - } else { - $.after(this, Embedding.cb.embed(this)); - } - return $.toggleClass(this, 'embedded'); - }, - embed: function(a) { - var container, el, type; - container = $.el('div', { - className: 'media-embed' - }); - $.add(container, el = (type = Embedding.types[a.dataset.key]).el(a)); - el.style.cssText = type.style != null ? type.style : 'border: none; width: 640px; height: 360px;'; - return container; - }, - catalogRemove: function() { - var isCatalog; - isCatalog = $.hasClass(doc, 'catalog-mode'); - if ((isCatalog && $.hasClass(this, 'embedded')) || (!isCatalog && $.hasClass(this, 'embed-removed'))) { - Embedding.cb.toggle.call(this); - return $.toggleClass(this, 'embed-removed'); - } - }, - title: function(req, data) { - var base1, j, k, key, len, len1, link, link2, options, post, post2, ref, ref1, service, status, text, uid; - key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post; - service = Embedding.types[key].title; - status = req.status; - if ((status === 200 || status === 304) && service.status) { - status = service.status(req.response)[0]; - } - if (!status) { - return; - } - text = "[" + key + "] " + ((function() { - switch (status) { - case 200: - case 304: - text = service.text(req.response, uid); - if (typeof text === 'string') { - return text; - } else { - return text = link.textContent; - } - break; - case 404: - return "Not Found"; - case 403: - case 401: - return "Forbidden or Private"; - default: - return status + "'d"; - } - })()); - link.dataset.original = link.textContent; - link.textContent = text; - ref = post.clones; - for (j = 0, len = ref.length; j < len; j++) { - post2 = ref[j]; - ref1 = $$('a.linkify', post2.nodes.comment); - for (k = 0, len1 = ref1.length; k < len1; k++) { - link2 = ref1[k]; - if (!(link2.href === link.href)) { - continue; - } - if ((base1 = link2.dataset).original == null) { - base1.original = link2.textContent; - } - link2.textContent = text; - } - } - } - }, - ordered_types: [ - { - key: 'audio', - regExp: /^[^?#]+\.(?:mp3|m4a|oga|wav|flac)(?:[?#]|$)/i, - style: '', - el: function(a) { - return $.el('audio', { - controls: true, - preload: 'auto', - src: a.dataset.href - }); - } - }, { - key: 'image', - regExp: /^[^?#]+\.(?:gif|png|jpg|jpeg|bmp|webp)(?::\w+)?(?:[?#]|$)/i, - style: '', - el: function(a) { - return $.el('div', {innerHTML: ""}); - } - }, { - key: 'video', - regExp: /^[^?#]+\.(?:og[gv]|webm|mp4)(?:[?#]|$)/i, - style: 'max-width: 80vw; max-height: 80vh;', - el: function(a) { - var el; - el = $.el('video', { - hidden: true, - controls: true, - preload: 'auto', - src: a.dataset.href, - loop: ImageHost.test(a.dataset.href.split('/')[2]) - }); - $.on(el, 'loadedmetadata', function() { - if (el.videoHeight === 0 && el.parentNode) { - return $.replace(el, Embedding.types.audio.el(a)); - } else { - return el.hidden = false; - } - }); - return el; - } - }, { - key: 'PeerTube', - regExp: /^(\w+:\/\/[^\/]+\/videos\/watch\/\w{8}-\w{4}-\w{4}-\w{4}-\w{12})(.*)/, - el: function(a) { - var el, options, start; - options = (start = a.dataset.options.match(/[?&](start=\w+)/)) ? "?" + start[1] : ''; - el = $.el('iframe', { - src: a.dataset.uid.replace('/videos/watch/', '/videos/embed/') + options - }); - el.setAttribute("allowfullscreen", "true"); - return el; - } - }, { - key: 'BitChute', - regExp: /^\w+:\/\/(?:www\.)?bitchute\.com\/video\/([\w\-]+)/, - el: function(a) { - var el; - el = $.el('iframe', { - src: "https://www.bitchute.com/embed/" + a.dataset.uid + "/" - }); - el.setAttribute("allowfullscreen", "true"); - return el; - } - }, { - key: 'Clyp', - regExp: /^\w+:\/\/(?:www\.)?clyp\.it\/(\w{8})/, - style: 'border: 0; width: 640px; height: 160px;', - el: function(a) { - return $.el('iframe', { - src: "https://clyp.it/" + a.dataset.uid + "/widget" - }); - }, - title: { - api: function(uid) { - return "https://api.clyp.it/oembed?url=https://clyp.it/" + uid; - }, - text: function(_) { - return _.title; - } - } - }, { - key: 'Dailymotion', - regExp: /^\w+:\/\/(?:(?:www\.)?dailymotion\.com\/(?:embed\/)?video|dai\.ly)\/([A-Za-z0-9]+)[^?]*(.*)/, - el: function(a) { - var el, options, start; - options = (start = a.dataset.options.match(/[?&](start=\d+)/)) ? "?" + start[1] : ''; - el = $.el('iframe', { - src: "//www.dailymotion.com/embed/video/" + a.dataset.uid + options - }); - el.setAttribute("allowfullscreen", "true"); - return el; - }, - title: { - api: function(uid) { - return "https://api.dailymotion.com/video/" + uid; - }, - text: function(_) { - return _.title; - } - }, - preview: { - url: function(uid) { - return "https://www.dailymotion.com/thumbnail/video/" + uid; - }, - height: 240 - } - }, { - key: 'Gfycat', - regExp: /^\w+:\/\/(?:www\.)?gfycat\.com\/(?:iframe\/)?(\w+)/, - el: function(a) { - var el; - el = $.el('iframe', { - src: "//gfycat.com/ifr/" + a.dataset.uid - }); - el.setAttribute("allowfullscreen", "true"); - return el; - } - }, { - key: 'Gist', - regExp: /^\w+:\/\/gist\.github\.com\/[\w\-]+\/(\w+)/, - style: '', - el: (function() { - var counter; - counter = 0; - return function(a) { - var el; - el = $.el('pre', { - hidden: true, - id: "gist-embed-" + (counter++) - }); - CrossOrigin.cache("https://api.github.com/gists/" + a.dataset.uid, function() { - el.textContent = Object.values(this.response.files)[0].content; - el.className = 'prettyprint'; - $.global(function() { - return typeof window.prettyPrint === "function" ? window.prettyPrint((function() {}), document.getElementById(document.currentScript.dataset.id).parentNode) : void 0; - }, { - id: el.id - }); - return el.hidden = false; - }); - return el; - }; - })(), - title: { - api: function(uid) { - return "https://api.github.com/gists/" + uid; - }, - text: function(arg) { - var file, files; - files = arg.files; - for (file in files) { - if (files.hasOwnProperty(file)) { - return file; - } - } - } - } - }, { - key: 'InstallGentoo', - regExp: /^\w+:\/\/paste\.installgentoo\.com\/view\/(?:raw\/|download\/|embed\/)?(\w+)/, - el: function(a) { - return $.el('iframe', { - src: "https://paste.installgentoo.com/view/embed/" + a.dataset.uid - }); - } - }, { - key: 'LiveLeak', - regExp: /^\w+:\/\/(?:\w+\.)?liveleak\.com\/.*\?.*[tif]=(\w+)/, - el: function(a) { - var el; - el = $.el('iframe', { - src: "https://www.liveleak.com/e/" + a.dataset.uid - }); - el.setAttribute("allowfullscreen", "true"); - return el; - } - }, { - key: 'Loopvid', - regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/#?((?:pf|kd|lv|gd|gh|db|dx|nn|cp|wu|ig|ky|mf|m2|pc|1c|pi|ni|wl|ko|mm|ic|gc)\/[\w\-\/]+(?:,[\w\-\/]+)*|fc\/\w+\/\d+|https?:\/\/.+)/, - style: 'max-width: 80vw; max-height: 80vh;', - el: function(a) { - var _, base, el, host, j, k, l, len, len1, len2, name, names, ref, ref1, type, types, url, urls; - el = $.el('video', { - controls: true, - preload: 'auto', - loop: true - }); - if (/^http/.test(a.dataset.uid)) { - $.add(el, $.el('source', { - src: a.dataset.uid - })); - return el; - } - ref = a.dataset.uid.match(/(\w+)\/(.*)/), _ = ref[0], host = ref[1], names = ref[2]; - types = (function() { - switch (host) { - case 'gd': - case 'wu': - case 'fc': - return ['']; - case 'gc': - return ['giant', 'fat', 'zippy']; - default: - return ['.webm', '.mp4']; - } - })(); - ref1 = names.split(','); - for (j = 0, len = ref1.length; j < len; j++) { - name = ref1[j]; - for (k = 0, len1 = types.length; k < len1; k++) { - type = types[k]; - base = "" + name + type; - urls = (function() { - switch (host) { - case 'pf': - return ["https://kastden.org/_loopvid_media/pf/" + base, "https://web.archive.org/web/2/http://a.pomf.se/" + base]; - case 'kd': - return ["https://kastden.org/loopvid/" + base]; - case 'lv': - return ["https://lv.kastden.org/" + base]; - case 'gd': - return ["https://docs.google.com/uc?export=download&id=" + base]; - case 'gh': - return ["https://googledrive.com/host/" + base]; - case 'db': - return ["https://dl.dropboxusercontent.com/u/" + base]; - case 'dx': - return ["https://dl.dropboxusercontent.com/" + base]; - case 'nn': - return ["https://kastden.org/_loopvid_media/nn/" + base]; - case 'cp': - return ["https://copy.com/" + base]; - case 'wu': - return ["http://webmup.com/" + base + "/vid.webm"]; - case 'ig': - return ["https://i.imgur.com/" + base]; - case 'ky': - return ["https://kastden.org/_loopvid_media/ky/" + base]; - case 'mf': - return ["https://kastden.org/_loopvid_media/mf/" + base, "https://web.archive.org/web/2/https://d.maxfile.ro/" + base]; - case 'm2': - return ["https://kastden.org/_loopvid_media/m2/" + base]; - case 'pc': - return ["https://kastden.org/_loopvid_media/pc/" + base, "https://web.archive.org/web/2/http://a.pomf.cat/" + base]; - case '1c': - return ["http://b.1339.cf/" + base]; - case 'pi': - return ["https://kastden.org/_loopvid_media/pi/" + base, "https://web.archive.org/web/2/https://u.pomf.is/" + base]; - case 'ni': - return ["https://kastden.org/_loopvid_media/ni/" + base, "https://web.archive.org/web/2/https://u.nya.is/" + base]; - case 'wl': - return ["http://webm.land/media/" + base]; - case 'ko': - return ["https://kordy.kastden.org/loopvid/" + base]; - case 'mm': - return ["https://kastden.org/_loopvid_media/mm/" + base, "https://web.archive.org/web/2/https://my.mixtape.moe/" + base]; - case 'ic': - return ["https://media.8ch.net/file_store/" + base]; - case 'fc': - return ["//" + (ImageHost.host()) + "/" + base + ".webm"]; - case 'gc': - return ["https://" + type + ".gfycat.com/" + name + ".webm"]; - } - })(); - for (l = 0, len2 = urls.length; l < len2; l++) { - url = urls[l]; - $.add(el, $.el('source', { - src: url - })); - } - } - } - return el; - } - }, { - key: 'Openings.moe', - regExp: /^\w+:\/\/openings.moe\/\?video=([^.&=]+)/, - style: 'width: 1280px; height: 720px; max-width: 80vw; max-height: 80vh;', - el: function(a) { - var el; - el = $.el('iframe', { - src: "https://openings.moe/?video=" + a.dataset.uid - }); - el.setAttribute("allowfullscreen", "true"); - return el; - } - }, { - key: 'Pastebin', - regExp: /^\w+:\/\/(?:\w+\.)?pastebin\.com\/(?!u\/)(?:[\w.]+(?:\/|\?i\=))?(\w+)/, - el: function(a) { - var div; - return div = $.el('iframe', { - src: "//pastebin.com/embed_iframe.php?i=" + a.dataset.uid - }); - } - }, { - key: 'SoundCloud', - regExp: /^\w+:\/\/(?:www\.)?(?:soundcloud\.com\/|snd\.sc\/)([\w\-\/]+)/, - style: 'border: 0; width: 500px; height: 400px;', - el: function(a) { - return $.el('iframe', { - src: "https://w.soundcloud.com/player/?visual=true&show_comments=false&url=https%3A%2F%2Fsoundcloud.com%2F" + (encodeURIComponent(a.dataset.uid)) - }); - }, - title: { - api: function(uid) { - return location.protocol + "//soundcloud.com/oembed?format=json&url=https%3A%2F%2Fsoundcloud.com%2F" + (encodeURIComponent(uid)); - }, - text: function(_) { - return _.title; - } - } - }, { - key: 'StrawPoll', - regExp: /^\w+:\/\/(?:www\.)?strawpoll\.me\/(?:embed_\d+\/)?(\d+(?:\/r)?)/, - style: 'border: 0; width: 600px; height: 406px;', - el: function(a) { - return $.el('iframe', { - src: "https://www.strawpoll.me/embed_1/" + a.dataset.uid - }); - } - }, { - key: 'Streamable', - regExp: /^\w+:\/\/(?:www\.)?streamable\.com\/(\w+)/, - el: function(a) { - var el; - el = $.el('iframe', { - src: "https://streamable.com/o/" + a.dataset.uid - }); - el.setAttribute("allowfullscreen", "true"); - return el; - }, - title: { - api: function(uid) { - return "https://api.streamable.com/oembed?url=https://streamable.com/" + uid; - }, - text: function(_) { - return _.title; - } - } - }, { - key: 'TwitchTV', - regExp: /^\w+:\/\/(?:www\.|secure\.|clips\.|m\.)?twitch\.tv\/(\w[^#\&\?]*)/, - el: function(a) { - var el, m, time, url; - m = a.dataset.href.match(/^\w+:\/\/(?:(clips\.)|\w+\.)?twitch\.tv\/(?:\w+\/)?(clip\/)?(\w[^#\&\?]*)/); - if (m[1] || m[2]) { - url = "//clips.twitch.tv/embed?clip=" + m[3] + "&parent=" + location.hostname; - } else { - m = a.dataset.uid.match(/(\w+)(?:\/(?:v\/)?(\d+))?/); - url = "//player.twitch.tv/?" + (m[2] ? "video=v" + m[2] : "channel=" + m[1]) + "&autoplay=false&parent=" + location.hostname; - if ((time = a.dataset.href.match(/\bt=(\w+)/))) { - url += "&time=" + time[1]; - } - } - el = $.el('iframe', { - src: url - }); - el.setAttribute("allowfullscreen", "true"); - return el; - } - }, { - key: 'Twitter', - regExp: /^\w+:\/\/(?:www\.|mobile\.)?twitter\.com\/(\w+\/status\/\d+)/, - style: 'border: none; width: 550px; height: 250px; overflow: hidden; resize: both;', - el: function(a) { - var cont, el, onMessage; - el = $.el('iframe'); - $.on(el, 'load', function() { - return this.contentWindow.postMessage({ - element: 't', - query: 'height' - }, 'https://twitframe.com'); - }); - onMessage = function(e) { - if (e.source === el.contentWindow && e.origin === 'https://twitframe.com') { - $.off(window, 'message', onMessage); - return (cont || el).style.height = (+$.minmax(e.data.height, 250, 0.8 * doc.clientHeight)) + "px"; - } - }; - $.on(window, 'message', onMessage); - el.src = "https://twitframe.com/show?url=https://twitter.com/" + a.dataset.uid; - if ($.engine === 'gecko') { - el.style.cssText = 'border: none; width: 100%; height: 100%;'; - cont = $.el('div'); - $.add(cont, el); - return cont; - } else { - return el; - } - } - }, { - key: 'VidLii', - regExp: /^\w+:\/\/(?:www\.)?vidlii\.com\/watch\?v=(\w{11})/, - style: 'border: none; width: 640px; height: 392px;', - el: function(a) { - var el; - el = $.el('iframe', { - src: "https://www.vidlii.com/embed?v=" + a.dataset.uid + "&a=0" - }); - el.setAttribute("allowfullscreen", "true"); - return el; - } - }, { - key: 'Vimeo', - regExp: /^\w+:\/\/(?:www\.)?vimeo\.com\/(\d+)/, - el: function(a) { - var el; - el = $.el('iframe', { - src: "//player.vimeo.com/video/" + a.dataset.uid + "?wmode=opaque" - }); - el.setAttribute("allowfullscreen", "true"); - return el; - }, - title: { - api: function(uid) { - return "https://vimeo.com/api/oembed.json?url=https://vimeo.com/" + uid; - }, - text: function(_) { - return _.title; - } - } - }, { - key: 'Vine', - regExp: /^\w+:\/\/(?:www\.)?vine\.co\/v\/(\w+)/, - style: 'border: none; width: 500px; height: 500px;', - el: function(a) { - return $.el('iframe', { - src: "https://vine.co/v/" + a.dataset.uid + "/card" - }); - } - }, { - key: 'Vocaroo', - regExp: /^\w+:\/\/(?:(?:www\.|old\.)?vocaroo\.com|voca\.ro)\/((?:i\/)?\w+)/, - style: '', - el: function(a) { - var el; - el = $.el('iframe'); - el.width = 300; - el.height = 60; - el.setAttribute('frameborder', 0); - el.src = "https://vocaroo.com/embed/" + (a.dataset.uid.replace(/^i\//, '')) + "?autoplay=0"; - return el; - } - }, { - key: 'YouTube', - regExp: /^\w+:\/\/(?:youtu.be\/|[\w.]*youtube[\w.]*\/.*(?:v=|\bembed\/|\bv\/))([\w\-]{11})(.*)/, - el: function(a) { - var el, start; - start = a.dataset.options.match(/\b(?:star)?t\=(\w+)/); - if (start) { - start = start[1]; - } - if (start && !/^\d+$/.test(start)) { - start += ' 0h0m0s'; - start = 3600 * start.match(/(\d+)h/)[1] + 60 * start.match(/(\d+)m/)[1] + 1 * start.match(/(\d+)s/)[1]; - } - el = $.el('iframe', { - src: "//www.youtube.com/embed/" + a.dataset.uid + "?rel=0&wmode=opaque" + (start ? '&start=' + start : '') - }); - el.setAttribute("allowfullscreen", "true"); - return el; - }, - title: { - api: function(uid) { - return "https://www.youtube.com/oembed?url=https%3A//www.youtube.com/watch%3Fv%3D" + uid + "&format=json"; - }, - text: function(_) { - return _.title; - }, - status: function(_) { - var m; - if (_.error) { - m = _.error.match(/^(\d*)\s*(.*)/); - return [+m[1], m[2]]; - } else { - return [200, 'OK']; - } - } - }, - preview: { - url: function(uid) { - return "https://img.youtube.com/vi/" + uid + "/0.jpg"; - }, - height: 360 - } - } - ] - }; - - return Embedding; - -}).call(this); - -Linkify = (function() { - var Linkify; - - Linkify = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread' && ref !== 'archive') || !Conf['Linkify']) { - return; - } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - Callbacks.Post.push({ - name: 'Linkify', - cb: this.node - }); - return Embedding.init(); - }, - node: function() { - var base, j, k, len, len1, link, links, ref; - if (this.isClone) { - return Embedding.events(this); - } - if (!Linkify.regString.test(this.info.comment)) { - return; - } - ref = $$('a', this.nodes.comment); - for (j = 0, len = ref.length; j < len; j++) { - link = ref[j]; - if (!(typeof (base = g.SITE).isLinkified === "function" ? base.isLinkified(link) : void 0)) { - continue; - } - $.addClass(link, 'linkify'); - if (ImageHost.useFaster) { - ImageHost.fixLinks([link]); - } - Embedding.process(link, this); - } - links = Linkify.process(this.nodes.comment); - if (ImageHost.useFaster) { - ImageHost.fixLinks(links); - } - for (k = 0, len1 = links.length; k < len1; k++) { - link = links[k]; - Embedding.process(link, this); - } - }, - process: function(node) { - var data, end, endNode, i, index, length, links, part1, part2, ref, ref1, result, saved, snapshot, space, test, word; - test = /[^\s"]+/g; - space = /[\s"]/; - snapshot = $.X('.//br|.//text()', node); - i = 0; - links = []; - while (node = snapshot.snapshotItem(i++)) { - data = node.data; - if (!data || node.parentElement.nodeName === "A") { - continue; - } - while (result = test.exec(data)) { - index = result.index; - endNode = node; - word = result[0]; - if ((length = index + word.length) === data.length) { - test.lastIndex = 0; - while ((saved = snapshot.snapshotItem(i++))) { - if (saved.nodeName === 'BR' || (saved.parentElement.nodeName === 'P' && !saved.previousSibling)) { - if ((part1 = word.match(/(https?:\/\/)?([a-z\d-]+\.)*[a-z\d-]+$/i)) && (part2 = (ref = snapshot.snapshotItem(i)) != null ? (ref1 = ref.data) != null ? ref1.match(/^(\.[a-z\d-]+)*\//i) : void 0 : void 0) && (part1[0] + part2[0]).search(Linkify.regString) === 0) { - continue; - } else { - break; - } - } - if (saved.parentElement.nodeName === "A" && !Linkify.regString.test(word)) { - break; - } - endNode = saved; - data = saved.data; - if (end = space.exec(data)) { - word += data.slice(0, end.index); - test.lastIndex = length = end.index; - i--; - break; - } else { - length = data.length; - word += data; - } - } - } - if (Linkify.regString.test(word)) { - links.push(Linkify.makeRange(node, endNode, index, length)); - } - if (!(test.lastIndex && node === endNode)) { - break; - } - } - } - i = links.length; - while (i--) { - links[i] = Linkify.makeLink(links[i]); - } - return links; - }, - regString: /((https?|mailto|git|magnet|ftp|irc):([a-z\d%\/?])|([-a-z\d]+[.])+(aero|asia|biz|cat|com|coop|dance|info|int|jobs|mobi|moe|museum|name|net|org|post|pro|tel|travel|xxx|xyz|edu|gov|mil|[a-z]{2})([:\/]|(?![^\s"]))|[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}|[-\w\d.@]+@[a-z\d.-]+\.[a-z\d])/i, - makeRange: function(startNode, endNode, startOffset, endOffset) { - var range; - range = document.createRange(); - range.setStart(startNode, startOffset); - range.setEnd(endNode, endOffset); - return range; - }, - makeLink: function(range) { - var a, encodedDomain, i, t, text; - text = range.toString(); - i = text.search(Linkify.regString); - if (i > 0) { - text = text.slice(i); - while (range.startOffset + i >= range.startContainer.data.length) { - i--; - } - if (i) { - range.setStart(range.startContainer, range.startOffset + i); - } - } - i = 0; - while (/[)\]}>.,]/.test(t = text.charAt(text.length - (1 + i)))) { - if (!(/[.,]/.test(t) || (text.match(/[()\[\]{}<>]/g)).length % 2)) { - break; - } - i++; - } - if (i) { - text = text.slice(0, -i); - while (range.endOffset - i < 0) { - i--; - } - if (i) { - range.setEnd(range.endContainer, range.endOffset - i); - } - } - if (!/((mailto|magnet):|.+:\/\/)/.test(text)) { - text = (/@/.test(text) ? 'mailto:' : 'http://') + text; - } - if (encodedDomain = text.match(/^(https?:\/\/[^\/]*%[0-9a-f]{2})(.*)$/i)) { - text = encodedDomain[1].replace(/%([0-9a-f]{2})/ig, function(x, y) { - if (y === '25') { - return x; - } else { - return String.fromCharCode(parseInt(y, 16)); - } - }) + encodedDomain[2]; - } - a = $.el('a', { - className: 'linkify', - rel: 'noreferrer noopener', - target: '_blank', - href: text - }); - $.add(a, range.extractContents()); - range.insertNode(a); - return a; - } - }; - - return Linkify; - -}).call(this); - -ArchiveLink = (function() { - var ArchiveLink; - - ArchiveLink = { - init: function() { - var div, entry, i, len, ref, ref1, type; - if (!(g.SITE.software === 'yotsuba' && ((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Archive Link'])) { - return; - } - div = $.el('div', { - textContent: 'Archive' - }); - entry = { - el: div, - order: 60, - open: function(arg) { - var ID, board, thread; - ID = arg.ID, thread = arg.thread, board = arg.board; - return !!Redirect.to('thread', { - postID: ID, - threadID: thread.ID, - boardID: board.ID - }); - }, - subEntries: [] - }; - ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Flag', 'country'], ['Filename', 'filename'], ['Image MD5', 'MD5']]; - for (i = 0, len = ref1.length; i < len; i++) { - type = ref1[i]; - entry.subEntries.push(this.createSubEntry(type[0], type[1])); - } - return Menu.menu.addEntry(entry); - }, - createSubEntry: function(text, type) { - var el, open; - el = $.el('a', { - textContent: text, - target: '_blank' - }); - open = type === 'post' ? function(arg) { - var ID, board, thread; - ID = arg.ID, thread = arg.thread, board = arg.board; - el.href = Redirect.to('thread', { - postID: ID, - threadID: thread.ID, - boardID: board.ID - }); - return true; - } : function(post) { - var ref, typeParam, value; - typeParam = type === 'country' && post.info.flagCodeTroll ? 'troll_country' : type; - value = type === 'country' ? post.info.flagCode || ((ref = post.info.flagCodeTroll) != null ? ref.toLowerCase() : void 0) : Filter.values(type, post)[0]; - if (!value) { - return false; - } - el.href = Redirect.to('search', { - boardID: post.board.ID, - type: typeParam, - value: value, - isSearch: true - }); - return true; - }; - return { - el: el, - open: open - }; - } - }; - - return ArchiveLink; - -}).call(this); - -CopyTextLink = (function() { - var CopyTextLink; - - CopyTextLink = { - init: function() { - var a, ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Copy Text Link'])) { - return; - } - a = $.el('a', { - className: 'copy-text-link', - href: 'javascript:;', - textContent: 'Copy Text' - }); - $.on(a, 'click', CopyTextLink.copy); - return Menu.menu.addEntry({ - el: a, - order: 12, - open: function(post) { - CopyTextLink.text = (post.origin || post).commentOrig(); - return true; - } - }); - }, - copy: function() { - var el; - el = $.el('textarea', { - className: 'copy-text-element', - value: CopyTextLink.text - }); - $.add(d.body, el); - el.select(); - try { - d.execCommand('copy'); - } catch (error) {} - return $.rm(el); - } - }; - - return CopyTextLink; - -}).call(this); - -DeleteLink = (function() { - var DeleteLink; - - DeleteLink = { - auto: [$.dict(), $.dict()], - init: function() { - var div, fileEl, fileEntry, postEl, postEntry, ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Delete Link'])) { - return; - } - div = $.el('div', { - className: 'delete-link', - textContent: 'Delete' - }); - postEl = $.el('a', { - className: 'delete-post', - href: 'javascript:;' - }); - fileEl = $.el('a', { - className: 'delete-file', - href: 'javascript:;' - }); - this.nodes = { - menu: div.firstChild, - links: [postEl, fileEl] - }; - postEntry = { - el: postEl, - open: function() { - postEl.textContent = DeleteLink.linkText(false); - $.on(postEl, 'click', DeleteLink.toggle); - return true; - } - }; - fileEntry = { - el: fileEl, - open: function(arg) { - var file; - file = arg.file; - if (!file || file.isDead) { - return false; - } - fileEl.textContent = DeleteLink.linkText(true); - $.on(fileEl, 'click', DeleteLink.toggle); - return true; - } - }; - return Menu.menu.addEntry({ - el: div, - order: 40, - open: function(post) { - if (post.isDead) { - return false; - } - DeleteLink.post = post; - DeleteLink.nodes.menu.textContent = DeleteLink.menuText(); - DeleteLink.cooldown.start(post); - return true; - }, - subEntries: [postEntry, fileEntry] - }); - }, - menuText: function() { - var seconds; - if (seconds = DeleteLink.cooldown.seconds[DeleteLink.post.fullID]) { - return "Delete (" + seconds + ")"; - } else { - return 'Delete'; - } - }, - linkText: function(fileOnly) { - var text; - text = fileOnly ? 'File' : 'Post'; - if (DeleteLink.auto[+fileOnly][DeleteLink.post.fullID]) { - text = "Deleting " + (text.toLowerCase()) + "..."; - } - return text; - }, - toggle: function() { - var auto, fileOnly, post; - post = DeleteLink.post; - fileOnly = $.hasClass(this, 'delete-file'); - auto = DeleteLink.auto[+fileOnly]; - if (auto[post.fullID]) { - delete auto[post.fullID]; - } else { - auto[post.fullID] = true; - } - this.textContent = DeleteLink.linkText(fileOnly); - if (!DeleteLink.cooldown.seconds[post.fullID]) { - return DeleteLink["delete"](post, fileOnly); - } - }, - "delete": function(post, fileOnly) { - var form, link; - link = DeleteLink.nodes.links[+fileOnly]; - delete DeleteLink.auto[+fileOnly][post.fullID]; - if (post.fullID === DeleteLink.post.fullID) { - $.off(link, 'click', DeleteLink.toggle); - } - form = { - mode: 'usrdel', - onlyimgdel: fileOnly, - pwd: QR.persona.getPassword() - }; - form[+post.ID] = 'delete'; - return $.ajax($.id('delform').action.replace("/" + g.BOARD + "/", "/" + post.board + "/"), { - responseType: 'document', - withCredentials: true, - onloadend: function() { - return DeleteLink.load(link, post, fileOnly, this.response); - }, - form: $.formData(form) - }); - }, - load: function(link, post, fileOnly, resDoc) { - var el, msg; - if (!resDoc) { - new Notice('warning', 'Connection error, please retry.', 20); - if (post.fullID === DeleteLink.post.fullID) { - $.on(link, 'click', DeleteLink.toggle); - } - return; - } - link.textContent = DeleteLink.linkText(fileOnly); - if (resDoc.title === '4chan - Banned') { - el = $.el('span', {innerHTML: "You can't delete posts because you are banned."}); - return new Notice('warning', el, 20); - } else if (msg = resDoc.getElementById('errmsg')) { - new Notice('warning', msg.textContent, 20); - if (post.fullID === DeleteLink.post.fullID) { - $.on(link, 'click', DeleteLink.toggle); - } - if (QR.cooldown.data && Conf['Cooldown'] && /\bwait\b/i.test(msg.textContent)) { - DeleteLink.cooldown.start(post, 5); - DeleteLink.auto[+fileOnly][post.fullID] = true; - return DeleteLink.nodes.links[+fileOnly].textContent = DeleteLink.linkText(fileOnly); - } - } else { - if (!fileOnly) { - QR.cooldown["delete"](post); - } - if (resDoc.title === 'Updating index...') { - (post.origin || post).kill(fileOnly); - } - if (post.fullID === DeleteLink.post.fullID) { - return link.textContent = 'Deleted'; - } - } - }, - cooldown: { - seconds: $.dict(), - start: function(post, seconds) { - if (DeleteLink.cooldown.seconds[post.fullID] != null) { - return; - } - if (seconds == null) { - seconds = QR.cooldown.secondsDeletion(post); - } - if (seconds > 0) { - DeleteLink.cooldown.seconds[post.fullID] = seconds; - return DeleteLink.cooldown.count(post); - } - }, - count: function(post) { - var fileOnly, i, len, ref; - if (post.fullID === DeleteLink.post.fullID) { - DeleteLink.nodes.menu.textContent = DeleteLink.menuText(); - } - if (DeleteLink.cooldown.seconds[post.fullID] > 0 && Conf['Cooldown']) { - DeleteLink.cooldown.seconds[post.fullID]--; - setTimeout(DeleteLink.cooldown.count, 1000, post); - } else { - delete DeleteLink.cooldown.seconds[post.fullID]; - ref = [false, true]; - for (i = 0, len = ref.length; i < len; i++) { - fileOnly = ref[i]; - if (DeleteLink.auto[+fileOnly][post.fullID]) { - DeleteLink["delete"](post, fileOnly); - } - } - } - } - } - }; - - return DeleteLink; - -}).call(this); - -DownloadLink = (function() { - var DownloadLink; - - DownloadLink = { - init: function() { - var a, ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Download Link'])) { - return; - } - a = $.el('a', { - className: 'download-link', - textContent: 'Download file' - }); - $.on(a, 'click', ImageCommon.download); - return Menu.menu.addEntry({ - el: a, - order: 100, - open: function(arg) { - var file; - file = arg.file; - if (!file) { - return false; - } - a.href = file.url; - a.download = file.name; - return true; - } - }); - } - }; - - return DownloadLink; - -}).call(this); - -Menu = (function() { - var Menu; - - Menu = { - init: function() { - var ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'])) { - return; - } - this.button = $.el('a', { - className: 'menu-button', - href: 'javascript:;' - }); - $.extend(this.button, {innerHTML: ""}); - this.menu = new UI.Menu('post'); - Callbacks.Post.push({ - name: 'Menu', - cb: this.node - }); - return Callbacks.CatalogThread.push({ - name: 'Menu', - cb: this.catalogNode - }); - }, - node: function() { - var button; - if (this.isClone) { - button = $('.menu-button', this.nodes.info); - $.rmClass(button, 'active'); - $.rm($('.dialog', this.nodes.info)); - Menu.makeButton(this, button); - return; - } - return $.add(this.nodes.info, Menu.makeButton(this)); - }, - catalogNode: function() { - return $.after(this.nodes.icons, Menu.makeButton(this.thread.OP)); - }, - makeButton: function(post, button) { - button || (button = Menu.button.cloneNode(true)); - $.on(button, 'click', function(e) { - return Menu.menu.toggle(e, this, post); - }); - return button; - } - }; - - return Menu; - -}).call(this); - -ReportLink = (function() { - var ReportLink; - - ReportLink = { - init: function() { - var a, ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Report Link'])) { - return; - } - a = $.el('a', { - className: 'report-link', - href: 'javascript:;', - textContent: 'Report' - }); - $.on(a, 'click', ReportLink.report); - return Menu.menu.addEntry({ - el: a, - order: 10, - open: function(post) { - ReportLink.url = "//sys." + (location.hostname.split('.')[1]) + ".org/" + post.board + "/imgboard.php?mode=report&no=" + post; - if (d.cookie.indexOf('pass_enabled=1') >= 0) { - ReportLink.dims = 'width=350,height=275'; - } else { - ReportLink.dims = 'width=400,height=550'; - } - return true; - } - }); - }, - report: function() { - var dims, id, set, url; - url = ReportLink.url, dims = ReportLink.dims; - id = Date.now(); - set = "toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1," + dims; - return window.open(url, id, set); - } - }; - - return ReportLink; - -}).call(this); - -AntiAutoplay = (function() { - var AntiAutoplay; - - AntiAutoplay = { - init: function() { - var audio, i, len, ref; - if (!Conf['Disable Autoplaying Sounds']) { - return; - } - $.addClass(doc, 'anti-autoplay'); - ref = $$('audio[autoplay]', doc); - for (i = 0, len = ref.length; i < len; i++) { - audio = ref[i]; - this.stop(audio); - } - window.addEventListener('loadstart', ((function(_this) { - return function(e) { - return _this.stop(e.target); - }; - })(this)), true); - Callbacks.Post.push({ - name: 'Disable Autoplaying Sounds', - cb: this.node - }); - return $.ready((function(_this) { - return function() { - return _this.process(d.body); - }; - })(this)); - }, - stop: function(audio) { - if (!audio.autoplay) { - return; - } - audio.pause(); - audio.autoplay = false; - if (audio.controls) { - return; - } - audio.controls = true; - return $.addClass(audio, 'controls-added'); - }, - node: function() { - return AntiAutoplay.process(this.nodes.comment); - }, - process: function(root) { - var i, iframe, j, len, len1, object, ref, ref1; - ref = $$('iframe[src*="youtube"][src*="autoplay=1"]', root); - for (i = 0, len = ref.length; i < len; i++) { - iframe = ref[i]; - AntiAutoplay.processVideo(iframe, 'src'); - } - ref1 = $$('object[data*="youtube"][data*="autoplay=1"]', root); - for (j = 0, len1 = ref1.length; j < len1; j++) { - object = ref1[j]; - AntiAutoplay.processVideo(object, 'data'); - } - }, - processVideo: function(el, attr) { - el[attr] = el[attr].replace(/\?autoplay=1&?/, '?').replace('&autoplay=1', ''); - if (window.getComputedStyle(el).display === 'none') { - el.style.display = 'block'; - } - return $.addClass(el, 'autoplay-removed'); - } - }; - - return AntiAutoplay; - -}).call(this); - -Banner = (function() { - var Banner, - slice = [].slice; - - Banner = { - init: function() { - if (Conf['Custom Board Titles']) { - this.db = new DataBoard('customTitles', null, true); - } - $.asap((function() { - return d.body; - }), function() { - return $.asap((function() { - return $('hr'); - }), Banner.ready); - }); - if (g.BOARD.ID !== 'f') { - return Main.ready(function() { - return $.queueTask(Banner.load); - }); - } - }, - ready: function() { - var banner, children; - banner = $(".boardBanner"); - children = banner.children; - if (g.VIEW === 'thread' && Conf['Remove Thread Excerpt']) { - Banner.setTitle(children[1].textContent); - } - children[0].title = "Click to change"; - $.on(children[0], 'click', Banner.cb.toggle); - if (Conf['Custom Board Titles']) { - Banner.custom(children[1]); - if (children[2]) { - return Banner.custom(children[2]); - } - } - }, - load: function() { - var bannerCnt, img; - bannerCnt = $.id('bannerCnt'); - if (!bannerCnt.firstChild) { - img = $.el('img', { - alt: '4chan', - src: '//s.4cdn.org/image/title/' + bannerCnt.dataset.src - }); - return $.add(bannerCnt, img); - } - }, - setTitle: function(title) { - if (Unread.title != null) { - Unread.title = title; - return Unread.update(); - } else { - return d.title = title; - } - }, - cb: { - toggle: function() { - var banner, i, ref; - if (!((ref = Banner.choices) != null ? ref.length : void 0)) { - Banner.choices = Conf['knownBanners'].split(',').slice(); - } - i = Math.floor(Banner.choices.length * Math.random()); - banner = Banner.choices.splice(i, 1); - return $('img', this.parentNode).src = "//s.4cdn.org/image/title/" + banner; - }, - click: function(e) { - var base, br, j, len, name, ref; - if (!(e.ctrlKey || e.metaKey)) { - return; - } - if ((base = Banner.original)[name = this.className] == null) { - base[name] = this.cloneNode(true); - } - this.contentEditable = true; - ref = $$('br', this); - for (j = 0, len = ref.length; j < len; j++) { - br = ref[j]; - $.replace(br, $.tn('\n')); - } - return this.focus(); - }, - keydown: function(e) { - e.stopPropagation(); - if (!e.shiftKey && e.keyCode === 13) { - return this.blur(); - } - }, - blur: function() { - var br, j, len, ref; - ref = $$('br', this); - for (j = 0, len = ref.length; j < len; j++) { - br = ref[j]; - $.replace(br, $.tn('\n')); - } - if (this.textContent = this.textContent.replace(/\n*$/, '')) { - this.contentEditable = false; - return Banner.db.set({ - boardID: g.BOARD.ID, - threadID: this.className, - val: { - title: this.textContent, - orig: Banner.original[this.className].textContent - } - }); - } else { - $.rmAll(this); - $.add(this, slice.call(Banner.original[this.className].cloneNode(true).childNodes)); - return Banner.db["delete"]({ - boardID: g.BOARD.ID, - threadID: this.className - }); - } - } - }, - original: $.dict(), - custom: function(child) { - var className, data, event, j, len, ref; - className = child.className; - child.title = "Ctrl/\u2318+click to edit board " + (className.slice(5).toLowerCase()); - child.spellcheck = false; - ref = ['click', 'keydown', 'blur']; - for (j = 0, len = ref.length; j < len; j++) { - event = ref[j]; - $.on(child, event, Banner.cb[event]); - } - if (data = Banner.db.get({ - boardID: g.BOARD.ID, - threadID: className - })) { - if (Conf['Persistent Custom Board Titles'] || data.orig === child.textContent) { - Banner.original[className] = child.cloneNode(true); - return child.textContent = data.title; - } else { - return Banner.db["delete"]({ - boardID: g.BOARD.ID, - threadID: className - }); - } - } - } - }; - - return Banner; - -}).call(this); - -CatalogLinks = (function() { - var CatalogLinks; - - CatalogLinks = { - init: function() { - var el, input, selector; - if (g.SITE.software === 'yotsuba' && (Conf['External Catalog'] || Conf['JSON Index']) && !(Conf['JSON Index'] && g.VIEW === 'index')) { - selector = (function() { - switch (g.VIEW) { - case 'thread': - case 'archive': - return '.navLinks.desktop > a'; - case 'catalog': - return '.navLinks > :first-child > a'; - case 'index': - return '#ctrl-top > a, .cataloglink > a'; - } - })(); - $.ready(function() { - var base, catalogLink, catalogURL, i, len, link, link2, ref; - ref = $$(selector); - for (i = 0, len = ref.length; i < len; i++) { - link = ref[i]; - switch (link.pathname.replace(/\/+/g, '/')) { - case "/" + g.BOARD + "/": - if (Conf['JSON Index']) { - link.textContent = 'Index'; - } - link.href = CatalogLinks.index(); - break; - case "/" + g.BOARD + "/catalog": - link.href = CatalogLinks.catalog(); - } - if (g.VIEW === 'catalog' && (catalogURL = CatalogLinks.catalog()) !== (typeof (base = g.SITE.urls).catalog === "function" ? base.catalog(g.BOARD) : void 0)) { - catalogLink = link.parentNode.cloneNode(true); - link2 = catalogLink.firstElementChild; - link2.href = catalogURL; - link2.textContent = link2.hostname === location.hostname ? '4chan X Catalog' : 'External Catalog'; - $.after(link.parentNode, [$.tn(' '), catalogLink]); - } - } - }); - } - if (g.SITE.software === 'yotsuba' && Conf['JSON Index'] && Conf['Use 4chan X Catalog']) { - Callbacks.Post.push({ - name: 'Catalog Link Rewrite', - cb: this.node - }); - } - if ((this.enabled = Conf['Catalog Links'])) { - CatalogLinks.el = el = UI.checkbox('Header catalog links', 'Catalog Links'); - el.id = 'toggleCatalog'; - input = $('input', el); - $.on(input, 'change', this.toggle); - $.sync('Header catalog links', CatalogLinks.set); - return Header.menu.addEntry({ - el: el, - order: 95 - }); - } - }, - node: function() { - var a, i, len, m, ref; - ref = $$('a', this.nodes.comment); - for (i = 0, len = ref.length; i < len; i++) { - a = ref[i]; - if (m = a.href.match(/^https?:\/\/(boards\.4chan(?:nel)?\.org\/[^\/]+)\/catalog(#s=.*)?/)) { - a.href = "//" + m[1] + "/" + (m[2] || '#catalog'); - } - } - }, - toggle: function() { - $.event('CloseMenu'); - $.set('Header catalog links', this.checked); - return CatalogLinks.set(this.checked); - }, - set: function(useCatalog) { - Conf['Header catalog links'] = useCatalog; - CatalogLinks.setLinks(Header.boardList); - CatalogLinks.setLinks(Header.bottomBoardList); - CatalogLinks.el.title = "Turn catalog links " + (useCatalog ? 'off' : 'on') + "."; - return $('input', CatalogLinks.el).checked = useCatalog; - }, - setLinks: function(list) { - var VIEW, a, board, boardID, i, len, ref, ref1, ref2, ref3, siteID, tail, url; - if (!(((ref = CatalogLinks.enabled) != null ? ref : Conf['Catalog Links']) && list)) { - return; - } - tail = /(?:index)?(?:\.\w+)?$/; - ref1 = $$('a:not([data-only])', list); - for (i = 0, len = ref1.length; i < len; i++) { - a = ref1[i]; - ref2 = a.dataset, siteID = ref2.siteID, boardID = ref2.boardID; - if (!(siteID && boardID)) { - ref3 = Site.parseURL(a), siteID = ref3.siteID, boardID = ref3.boardID, VIEW = ref3.VIEW; - if (!(siteID && boardID && (VIEW === 'index' || VIEW === 'catalog') && (a.dataset.indexOptions || a.href.replace(tail, '') === (Get.url(VIEW, { - siteID: siteID, - boardID: boardID - }) || '').replace(tail, '')))) { - continue; - } - $.extend(a.dataset, { - siteID: siteID, - boardID: boardID - }); - } - board = { - siteID: siteID, - boardID: boardID - }; - url = Conf['Header catalog links'] ? CatalogLinks.catalog(board) : Get.url('index', board); - if (url) { - a.href = url; - if (a.dataset.indexOptions && url.split('#')[0] === Get.url('index', board)) { - a.href += (a.hash ? '/' : '#') + a.dataset.indexOptions; - } - } - } - }, - externalParse: function() { - var board, boards, excludes, i, len, line, ref, ref1, ref2, url; - CatalogLinks.externalList = $.dict(); - ref = Conf['externalCatalogURLs'].split('\n'); - for (i = 0, len = ref.length; i < len; i++) { - line = ref[i]; - if (line[0] === '#') { - continue; - } - url = line.split(';')[0]; - boards = Filter.parseBoards(((ref1 = line.match(/;boards:([^;]+)/)) != null ? ref1[1] : void 0) || '*'); - excludes = Filter.parseBoards((ref2 = line.match(/;exclude:([^;]+)/)) != null ? ref2[1] : void 0) || $.dict(); - for (board in boards) { - if (!(excludes[board] || excludes[board.split('/')[0] + '/*'])) { - CatalogLinks.externalList[board] = url; - } - } - } - }, - external: function(arg) { - var boardID, external, siteID; - siteID = arg.siteID, boardID = arg.boardID; - if (!CatalogLinks.externalList) { - CatalogLinks.externalParse(); - } - external = CatalogLinks.externalList[siteID + "/" + boardID] || CatalogLinks.externalList[siteID + "/*"]; - if (external) { - return external.replace(/%board/g, boardID); - } else { - return void 0; - } - }, - jsonIndex: function(board, hash) { - if (g.SITE.ID === board.siteID && g.BOARD.ID === board.boardID && g.VIEW === 'index') { - return hash; - } else { - return Get.url('index', board) + hash; - } - }, - catalog: function(board) { - var external, nativeCatalog; - if (board == null) { - board = g.BOARD; - } - if (Conf['External Catalog'] && (external = CatalogLinks.external(board))) { - return external; - } else if (Index.enabledOn(board) && Conf['Use 4chan X Catalog']) { - return CatalogLinks.jsonIndex(board, '#catalog'); - } else if ((nativeCatalog = Get.url('catalog', board))) { - return nativeCatalog; - } else { - return CatalogLinks.external(board); - } - }, - index: function(board) { - if (board == null) { - board = g.BOARD; - } - if (Index.enabledOn(board)) { - return CatalogLinks.jsonIndex(board, '#index'); - } else { - return Get.url('index', board); - } - } - }; - - return CatalogLinks; - -}).call(this); - -CustomCSS = (function() { - var CustomCSS; - - CustomCSS = { - init: function() { - if (!Conf['Custom CSS']) { - return; - } - return this.addStyle(); - }, - addStyle: function() { - return this.style = $.addStyle(CSS.sub(Conf['usercss']), 'custom-css', '#fourchanx-css'); - }, - rmStyle: function() { - if (this.style) { - $.rm(this.style); - return delete this.style; - } - }, - update: function() { - if (!this.style) { - return this.addStyle(); - } - return this.style.textContent = CSS.sub(Conf['usercss']); - } - }; - - return CustomCSS; - -}).call(this); - -ExpandComment = (function() { - var ExpandComment; - - ExpandComment = { - init: function() { - if (g.VIEW !== 'index' || !Conf['Comment Expansion'] || Conf['JSON Index']) { - return; - } - return Callbacks.Post.push({ - name: 'Comment Expansion', - cb: this.node - }); - }, - node: function() { - var a; - if (a = $('.abbr > a:not([onclick])', this.nodes.comment)) { - return $.on(a, 'click', ExpandComment.cb); - } - }, - callbacks: [], - cb: function(e) { - e.preventDefault(); - return ExpandComment.expand(Get.postFromNode(this)); - }, - expand: function(post) { - var a; - if (post.nodes.longComment && !post.nodes.longComment.parentNode) { - $.replace(post.nodes.shortComment, post.nodes.longComment); - post.nodes.comment = post.nodes.longComment; - return; - } - if (!(a = $('.abbr > a', post.nodes.comment))) { - return; - } - a.textContent = "Post No." + post + " Loading..."; - return $.cache(g.SITE.urls.threadJSON({ - boardID: post.boardID, - threadID: post.threadID - }), function() { - return ExpandComment.parse(this, a, post); - }); - }, - contract: function(post) { - var a; - if (!post.nodes.shortComment) { - return; - } - a = $('.abbr > a', post.nodes.shortComment); - a.textContent = 'here'; - $.replace(post.nodes.longComment, post.nodes.shortComment); - return post.nodes.comment = post.nodes.shortComment; - }, - parse: function(req, a, post) { - var callback, clone, comment, href, i, j, k, len, len1, len2, postObj, posts, quote, ref, ref1, spoilerRange, status; - status = req.status; - if (status !== 200 && status !== 304) { - a.textContent = status ? "Error " + req.statusText + " (" + status + ")" : 'Connection Error'; - return; - } - posts = req.response.posts; - if (spoilerRange = posts[0].custom_spoiler) { - g.SITE.Build.spoilerRange[g.BOARD] = spoilerRange; - } - for (i = 0, len = posts.length; i < len; i++) { - postObj = posts[i]; - if (postObj.no === post.ID) { - break; - } - } - if (postObj.no !== post.ID) { - a.textContent = "Post No." + post + " not found."; - return; - } - comment = post.nodes.comment; - clone = comment.cloneNode(false); - clone.innerHTML = postObj.com; - ref = $$('.quotelink', clone); - for (j = 0, len1 = ref.length; j < len1; j++) { - quote = ref[j]; - href = quote.getAttribute('href'); - if (href[0] === '/') { - continue; - } - if (href[0] === '#') { - quote.href = "" + (a.pathname.split(/\/+/).splice(0, 4).join('/')) + href; - } else { - quote.href = (a.pathname.split(/\/+/).splice(0, 3).join('/')) + "/" + href; - } - } - post.nodes.shortComment = comment; - $.replace(comment, clone); - post.nodes.comment = post.nodes.longComment = clone; - post.parseComment(); - post.parseQuotes(); - ref1 = ExpandComment.callbacks; - for (k = 0, len2 = ref1.length; k < len2; k++) { - callback = ref1[k]; - callback.call(post); - } - } - }; - - return ExpandComment; - -}).call(this); - -ExpandThread = (function() { - var ExpandThread, - slice = [].slice; - - ExpandThread = { - statuses: $.dict(), - init: function() { - if (!(g.VIEW === 'index' && Conf['Thread Expansion'])) { - return; - } - if (Conf['JSON Index']) { - return $.on(d, 'IndexRefreshInternal', this.onIndexRefresh); - } else { - return Callbacks.Thread.push({ - name: 'Expand Thread', - cb: function() { - return ExpandThread.setButton(this); - } - }); - } - }, - setButton: function(thread) { - var a, ref; - if (!(thread.nodes.root && (a = $('.summary', thread.nodes.root)))) { - return; - } - a.textContent = (ref = g.SITE.Build).summaryText.apply(ref, ['+'].concat(slice.call(a.textContent.match(/\d+/g)))); - a.style.cursor = 'pointer'; - return $.on(a, 'click', ExpandThread.cbToggle); - }, - disconnect: function(refresh) { - var oldReq, ref, status, threadID; - if (g.VIEW === 'thread' || !Conf['Thread Expansion']) { - return; - } - ref = ExpandThread.statuses; - for (threadID in ref) { - status = ref[threadID]; - if ((oldReq = status.req)) { - delete status.req; - oldReq.abort(); - } - delete ExpandThread.statuses[threadID]; - } - if (!refresh) { - return $.off(d, 'IndexRefreshInternal', this.onIndexRefresh); - } - }, - onIndexRefresh: function() { - ExpandThread.disconnect(true); - return g.BOARD.threads.forEach(function(thread) { - return ExpandThread.setButton(thread); - }); - }, - cbToggle: function(e) { - if ($.modifiedClick(e)) { - return; - } - e.preventDefault(); - return ExpandThread.toggle(Get.threadFromNode(this)); - }, - cbToggleBottom: function(e) { - var bottom, thread; - if ($.modifiedClick(e)) { - return; - } - e.preventDefault(); - thread = Get.threadFromNode(this); - $.rm(this); - bottom = thread.nodes.root.getBoundingClientRect().bottom; - ExpandThread.toggle(thread); - return window.scrollBy(0, thread.nodes.root.getBoundingClientRect().bottom - bottom); - }, - toggle: function(thread) { - var a; - if (!(thread.nodes.root && (a = $('.summary', thread.nodes.root)))) { - return; - } - if (thread.ID in ExpandThread.statuses) { - return ExpandThread.contract(thread, a, thread.nodes.root); - } else { - return ExpandThread.expand(thread, a); - } - }, - expand: function(thread, a) { - var ref, status; - ExpandThread.statuses[thread] = status = {}; - a.textContent = (ref = g.SITE.Build).summaryText.apply(ref, ['...'].concat(slice.call(a.textContent.match(/\d+/g)))); - status.req = $.cache(g.SITE.urls.threadJSON({ - boardID: thread.board.ID, - threadID: thread.ID - }), function() { - if (this !== status.req) { - return; - } - delete status.req; - return ExpandThread.parse(this, thread, a); - }); - return status.numReplies = $$(g.SITE.selectors.replyOriginal, thread.nodes.root).length; - }, - contract: function(thread, a, threadRoot) { - var filesCount, i, inlined, len, oldReq, postsCount, ref, replies, reply, status; - status = ExpandThread.statuses[thread]; - delete ExpandThread.statuses[thread]; - if ((oldReq = status.req)) { - delete status.req; - oldReq.abort(); - if (a) { - a.textContent = (ref = g.SITE.Build).summaryText.apply(ref, ['+'].concat(slice.call(a.textContent.match(/\d+/g)))); - } - return; - } - replies = $$('.thread > .replyContainer', threadRoot); - if (status.numReplies) { - replies = replies.slice(0, -status.numReplies); - } - postsCount = 0; - filesCount = 0; - for (i = 0, len = replies.length; i < len; i++) { - reply = replies[i]; - if (Conf['Quote Inlining']) { - while (inlined = $('.inlined', reply)) { - inlined.click(); - } - } - postsCount++; - if ('file' in Get.postFromRoot(reply)) { - filesCount++; - } - $.rm(reply); - } - if (Index.enabled) { - $.event('PostsRemoved', null, a.parentNode); - } - a.textContent = g.SITE.Build.summaryText('+', postsCount, filesCount); - return $.rm($('.summary-bottom', threadRoot)); - }, - parse: function(req, thread, a) { - var a2, filesCount, i, len, post, postData, posts, postsCount, postsRoot, ref, ref1, root; - if ((ref = req.status) !== 200 && ref !== 304) { - a.textContent = req.status ? "Error " + req.statusText + " (" + req.status + ")" : 'Connection Error'; - return; - } - g.SITE.Build.spoilerRange[thread.board] = req.response.posts[0].custom_spoiler; - posts = []; - postsRoot = []; - filesCount = 0; - ref1 = req.response.posts; - for (i = 0, len = ref1.length; i < len; i++) { - postData = ref1[i]; - if (postData.no === thread.ID) { - continue; - } - if ((post = thread.posts.get(postData.no)) && !post.isFetchedQuote) { - if ('file' in post) { - filesCount++; - } - root = post.nodes.root; - postsRoot.push(root); - continue; - } - root = g.SITE.Build.postFromObject(postData, thread.board.ID); - post = new Post(root, thread, thread.board); - if ('file' in post) { - filesCount++; - } - posts.push(post); - postsRoot.push(root); - } - Main.callbackNodes('Post', posts); - $.after(a, postsRoot); - $.event('PostsInserted', null, a.parentNode); - postsCount = postsRoot.length; - a.textContent = g.SITE.Build.summaryText('-', postsCount, filesCount); - if (root) { - a2 = a.cloneNode(true); - a2.classList.add('summary-bottom'); - $.on(a2, 'click', ExpandThread.cbToggleBottom); - return $.after(root, a2); - } - } - }; - - return ExpandThread; - -}).call(this); - -FileInfo = (function() { - var FileInfo; - - FileInfo = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread' && ref !== 'archive') || !Conf['File Info Formatting']) { - return; - } - return Callbacks.Post.push({ - name: 'File Info Formatting', - cb: this.node - }); - }, - node: function() { - var a, i, info, j, len, len1, oldInfo, ref, ref1; - if (!this.file) { - return; - } - if (this.isClone) { - ref = $$('.file-info .download-button', this.file.text); - for (i = 0, len = ref.length; i < len; i++) { - a = ref[i]; - $.on(a, 'click', ImageCommon.download); - } - ref1 = $$('.file-info .quick-filter-md5', this.file.text); - for (j = 0, len1 = ref1.length; j < len1; j++) { - a = ref1[j]; - $.on(a, 'click', Filter.quickFilterMD5); - } - return; - } - oldInfo = $.el('span', { - className: 'fileText-original' - }); - $.prepend(this.file.link.parentNode, oldInfo); - $.add(oldInfo, [this.file.link.previousSibling, this.file.link, this.file.link.nextSibling]); - info = $.el('span', { - className: 'file-info' - }); - FileInfo.format(Conf['fileInfo'], this, info); - return $.prepend(this.file.text, info); - }, - format: function(formatString, post, outputNode) { - var a, i, j, len, len1, output, ref, ref1; - output = []; - formatString.replace(/%(.)|[^%]+/g, function(s, c) { - output.push($.hasOwn(FileInfo.formatters, c) ? FileInfo.formatters[c].call(post) : {innerHTML: E(s)}); - return ''; - }); - $.extend(outputNode, {innerHTML: E.cat(output)}); - ref = $$('.download-button', outputNode); - for (i = 0, len = ref.length; i < len; i++) { - a = ref[i]; - $.on(a, 'click', ImageCommon.download); - } - ref1 = $$('.quick-filter-md5', outputNode); - for (j = 0, len1 = ref1.length; j < len1; j++) { - a = ref1[j]; - $.on(a, 'click', Filter.quickFilterMD5); - } - }, - formatters: { - t: function() { - return {innerHTML: E(this.file.url.match(/[^/]*$/)[0])}; - }, - T: function() { - return {innerHTML: "" + (FileInfo.formatters.t.call(this)).innerHTML + ""}; - }, - l: function() { - return {innerHTML: "" + (FileInfo.formatters.n.call(this)).innerHTML + ""}; - }, - L: function() { - return {innerHTML: "" + (FileInfo.formatters.N.call(this)).innerHTML + ""}; - }, - n: function() { - var fullname, shortname; - fullname = this.file.name; - shortname = SW.yotsuba.Build.shortFilename(this.file.name, this.isReply); - if (fullname === shortname) { - return {innerHTML: E(fullname)}; - } else { - return {innerHTML: "" + E(shortname) + "" + E(fullname) + ""}; - } - }, - N: function() { - return {innerHTML: E(this.file.name)}; - }, - d: function() { - return {innerHTML: ""}; - }, - f: function() { - return {innerHTML: ""}; - }, - p: function() { - return {innerHTML: ((this.file.isSpoiler) ? "Spoiler, " : "")}; - }, - s: function() { - return {innerHTML: E(this.file.size)}; - }, - B: function() { - return {innerHTML: E(Math.round(this.file.sizeInBytes)) + " Bytes"}; - }, - K: function() { - return {innerHTML: E(Math.round(this.file.sizeInBytes/1024)) + " KB"}; - }, - M: function() { - return {innerHTML: E(Math.round(this.file.sizeInBytes/1048576*100)/100) + " MB"}; - }, - r: function() { - return {innerHTML: E(this.file.dimensions || "PDF")}; - }, - g: function() { - return {innerHTML: ((this.file.tag) ? ", " + E(this.file.tag) : "")}; - }, - '%': function() { - return {innerHTML: "%"}; - } - } - }; - - return FileInfo; - -}).call(this); - -Flash = (function() { - var Flash; - - Flash = { - init: function() { - if (g.BOARD.ID === 'f' && Conf['Enable Native Flash Embedding']) { - return $.ready(Flash.initReady); - } - }, - initReady: function() { - if ($.hasStorage) { - return $.global(function() { - if (JSON.parse(localStorage['4chan-settings'] || '{}').disableAll) { - return window.SWFEmbed.init(); - } - }); - } else { - if (g.VIEW === 'thread') { - $.global(function() { - return window.Main.tid = location.pathname.split(/\/+/)[3]; - }); - } - return $.global(function() { - return window.SWFEmbed.init(); - }); - } - } - }; - - return Flash; - -}).call(this); - -Fourchan = (function() { - var Fourchan; - - Fourchan = { - init: function() { - var ref; - if (!(g.SITE.software === 'yotsuba' && ((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive'))) { - return; - } - BoardConfig.ready(this.initBoard); - return Main.ready(this.initReady); - }, - initBoard: function() { - if (g.BOARD.config.code_tags) { - $.on(window, 'prettyprint:cb', function(e) { - var post, pre; - if (!(post = g.posts.get(e.detail.ID))) { - return; - } - if (!(pre = $$('.prettyprint', post.nodes.comment)[+e.detail.i])) { - return; - } - if (!$.hasClass(pre, 'prettyprinted')) { - pre.innerHTML = e.detail.html; - return $.addClass(pre, 'prettyprinted'); - } - }); - $.global(function() { - return window.addEventListener('prettyprint', function(e) { - return window.dispatchEvent(new CustomEvent('prettyprint:cb', { - detail: { - ID: e.detail.ID, - i: e.detail.i, - html: window.prettyPrintOne(e.detail.html) - } - })); - }, false); - }); - Callbacks.Post.push({ - name: 'Parse [code] tags', - cb: Fourchan.code - }); - g.posts.forEach(function(post) { - if (post.callbacksExecuted) { - return Callbacks.Post.execute(post, ['Parse [code] tags'], true); - } - }); - ExpandComment.callbacks.push(Fourchan.code); - } - if (g.BOARD.config.math_tags) { - $.global(function() { - return window.addEventListener('mathjax', function(e) { - if (window.MathJax) { - return window.MathJax.Hub.Queue(['Typeset', window.MathJax.Hub, e.target]); - } else { - if (!document.querySelector('script[src^="//cdn.mathjax.org/"]')) { - window.loadMathJax(); - window.loadMathJax = function() {}; - } - if (!e.target.classList.contains('postMessage')) { - return document.querySelector('script[src^="//cdn.mathjax.org/"]').addEventListener('load', function() { - return window.MathJax.Hub.Queue(['Typeset', window.MathJax.Hub, e.target]); - }, false); - } - } - }, false); - }); - Callbacks.Post.push({ - name: 'Parse [math] tags', - cb: Fourchan.math - }); - g.posts.forEach(function(post) { - if (post.callbacksExecuted) { - return Callbacks.Post.execute(post, ['Parse [math] tags'], true); - } - }); - return ExpandComment.callbacks.push(Fourchan.math); - } - }, - initReady: function() { - return $.global(function() { - var j, len, node, ref; - window.clickable_ids = false; - ref = document.querySelectorAll('.posteruid, .capcode'); - for (j = 0, len = ref.length; j < len; j++) { - node = ref[j]; - node.removeEventListener('click', window.idClick, false); - } - }); - }, - code: function() { - if (this.isClone) { - return; - } - return $.ready((function(_this) { - return function() { - var i, j, len, pre, ref; - ref = $$('.prettyprint', _this.nodes.comment); - for (i = j = 0, len = ref.length; j < len; i = ++j) { - pre = ref[i]; - if (!$.hasClass(pre, 'prettyprinted')) { - $.event('prettyprint', { - ID: _this.fullID, - i: i, - html: pre.innerHTML - }, window); - } - } - }; - })(this)); - }, - math: function() { - var cb, j, len, wbr, wbrs; - if (!/\[(math|eqn)\]/.test(this.nodes.comment.textContent)) { - return; - } - if ((wbrs = $$('wbr', this.nodes.comment)).length) { - for (j = 0, len = wbrs.length; j < len; j++) { - wbr = wbrs[j]; - $.rm(wbr); - } - this.nodes.comment.normalize(); - } - cb = (function(_this) { - return function() { - if (!doc.contains(_this.nodes.comment)) { - return; - } - $.off(d, 'PostsInserted', cb); - return $.event('mathjax', null, _this.nodes.comment); - }; - })(this); - $.on(d, 'PostsInserted', cb); - return cb(); - } - }; - - return Fourchan; - -}).call(this); - -IDColor = (function() { - var IDColor; - - IDColor = { - init: function() { - var ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Color User IDs'])) { - return; - } - this.ids = $.dict(); - this.ids['Heaven'] = [0, 0, 0, '#fff']; - return Callbacks.Post.push({ - name: 'Color User IDs', - cb: this.node - }); - }, - node: function() { - var rgb, span, style, uid; - if (this.isClone || !((uid = this.info.uniqueID) && (span = this.nodes.uniqueID))) { - return; - } - rgb = IDColor.ids[uid] || IDColor.compute(uid); - style = span.style; - style.color = rgb[3]; - style.backgroundColor = "rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + ")"; - return $.addClass(span, 'painted'); - }, - compute: function(uid) { - var hash, rgb; - hash = g.SITE.uidColor ? g.SITE.uidColor(uid) : parseInt(uid, 16); - rgb = [(hash >> 16) & 0xFF, (hash >> 8) & 0xFF, hash & 0xFF]; - rgb.push($.luma(rgb) > 125 ? '#000' : '#fff'); - return this.ids[uid] = rgb; - } - }; - - return IDColor; - -}).call(this); - -IDHighlight = (function() { - var IDHighlight; - - IDHighlight = { - init: function() { - var ref; - if ((ref = g.VIEW) !== 'index' && ref !== 'thread') { - return; - } - return Callbacks.Post.push({ - name: 'Highlight by User ID', - cb: this.node - }); - }, - uniqueID: null, - node: function() { - if (this.nodes.uniqueIDRoot) { - $.on(this.nodes.uniqueIDRoot, 'click', IDHighlight.click(this)); - } - if (this.nodes.capcode) { - $.on(this.nodes.capcode, 'click', IDHighlight.click(this)); - } - if (!this.isClone) { - return IDHighlight.set(this); - } - }, - set: function(post) { - var match; - match = (post.info.uniqueID || post.info.capcode) === IDHighlight.uniqueID; - return $[match ? 'addClass' : 'rmClass'](post.nodes.post, 'highlight'); - }, - click: function(post) { - return function() { - var uniqueID; - uniqueID = post.info.uniqueID || post.info.capcode; - IDHighlight.uniqueID = IDHighlight.uniqueID === uniqueID ? null : uniqueID; - return g.posts.forEach(IDHighlight.set); - }; - } - }; - - return IDHighlight; - -}).call(this); - -IDPostCount = (function() { - var IDPostCount; - - IDPostCount = { - init: function() { - if (!(g.VIEW === 'thread' && Conf['Count Posts by ID'])) { - return; - } - Callbacks.Thread.push({ - name: 'Count Posts by ID', - cb: function() { - return IDPostCount.thread = this; - } - }); - return Callbacks.Post.push({ - name: 'Count Posts by ID', - cb: this.node - }); - }, - node: function() { - if (this.nodes.uniqueID && this.thread === IDPostCount.thread) { - return $.on(this.nodes.uniqueID, 'mouseover', IDPostCount.count); - } - }, - count: function() { - var n, uniqueID; - uniqueID = Get.postFromNode(this).info.uniqueID; - n = 0; - IDPostCount.thread.posts.forEach(function(post) { - if (post.info.uniqueID === uniqueID) { - return n++; - } - }); - return this.title = n + " post" + (n === 1 ? '' : 's') + " by this ID"; - } - }; - - return IDPostCount; - -}).call(this); - -Keybinds = (function() { - var Keybinds; - - Keybinds = { - init: function() { - var hotkey, init; - if (!Conf['Keybinds']) { - return; - } - for (hotkey in Config.hotkeys) { - $.sync(hotkey, Keybinds.sync); - } - init = function() { - var i, len, node, ref; - $.off(d, '4chanXInitFinished', init); - $.on(d, 'keydown', Keybinds.keydown); - ref = $$('[accesskey]'); - for (i = 0, len = ref.length; i < len; i++) { - node = ref[i]; - node.removeAttribute('accesskey'); - } - }; - return $.on(d, '4chanXInitFinished', init); - }, - sync: function(key, hotkey) { - return Conf[hotkey] = key; - }, - keydown: function(e) { - var base, base1, catalog, i, key, len, notification, notifications, post, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, searchInput, target, thread, threadRoot; - if (!(key = Keybinds.keyCode(e))) { - return; - } - target = e.target; - if ((ref = target.nodeName) === 'INPUT' || ref === 'TEXTAREA') { - if (!(/(Esc|Alt|Ctrl|Meta|Shift\+\w{2,})/.test(key) && !/^Alt\+(\d|Up|Down|Left|Right)$/.test(key))) { - return; - } - } - if ((ref1 = g.VIEW) === 'index' || ref1 === 'thread') { - threadRoot = Nav.getThread(); - thread = Get.threadFromRoot(threadRoot); - } - switch (key) { - case Conf['Toggle board list']: - if (!Conf['Custom Board Navigation']) { - return; - } - Header.toggleBoardList(); - break; - case Conf['Toggle header']: - Header.toggleBarVisibility(); - break; - case Conf['Open empty QR']: - if (!QR.postingIsEnabled) { - return; - } - Keybinds.qr(); - break; - case Conf['Open QR']: - if (!(QR.postingIsEnabled && threadRoot)) { - return; - } - Keybinds.qr(threadRoot); - break; - case Conf['Open settings']: - Settings.open(); - break; - case Conf['Close']: - if (Settings.dialog) { - Settings.close(); - } else if ((notifications = $$('.notification')).length) { - for (i = 0, len = notifications.length; i < len; i++) { - notification = notifications[i]; - $('.close', notification).click(); - } - } else if (QR.nodes && !(QR.nodes.el.hidden || window.getComputedStyle(QR.nodes.form).display === 'none')) { - if (Conf['Persistent QR']) { - QR.hide(); - } else { - QR.close(); - } - } else if (Embedding.lastEmbed) { - Embedding.closeFloat(); - } else { - return; - } - break; - case Conf['Spoiler tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('spoiler', target); - break; - case Conf['Code tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('code', target); - break; - case Conf['Eqn tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('eqn', target); - break; - case Conf['Math tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('math', target); - break; - case Conf['SJIS tags']: - if (target.nodeName !== 'TEXTAREA') { - return; - } - Keybinds.tags('sjis', target); - break; - case Conf['Toggle sage']: - if (!(QR.nodes && !QR.nodes.el.hidden)) { - return; - } - Keybinds.sage(); - break; - case Conf['Toggle Cooldown']: - if (!(QR.nodes && !QR.nodes.el.hidden && $.hasClass(QR.nodes.fileSubmit, 'custom-cooldown'))) { - return; - } - QR.toggleCustomCooldown(); - break; - case Conf['Post from URL']: - if (!QR.postingIsEnabled) { - return; - } - QR.handleUrl(''); - break; - case Conf['Add new post']: - if (!QR.postingIsEnabled) { - return; - } - QR.addPost(); - break; - case Conf['Submit QR']: - if (!(QR.nodes && !QR.nodes.el.hidden)) { - return; - } - if (!QR.status()) { - QR.submit(); - } - break; - case Conf['Update']: - switch (g.VIEW) { - case 'thread': - if (!ThreadUpdater.enabled) { - return; - } - ThreadUpdater.update(); - break; - case 'index': - if (!Index.enabled) { - return; - } - Index.update(); - break; - default: - return; - } - break; - case Conf['Watch']: - if (!(ThreadWatcher.enabled && thread)) { - return; - } - ThreadWatcher.toggle(thread); - break; - case Conf['Update thread watcher']: - if (!ThreadWatcher.enabled) { - return; - } - ThreadWatcher.buttonFetchAll(); - break; - case Conf['Toggle thread watcher']: - if (!ThreadWatcher.enabled) { - return; - } - ThreadWatcher.toggleWatcher(); - break; - case Conf['Toggle threading']: - if (!QuoteThreading.ready) { - return; - } - QuoteThreading.toggleThreading(); - break; - case Conf['Mark thread read']: - if (!(g.VIEW === 'index' && thread && UnreadIndex.enabled)) { - return; - } - UnreadIndex.markRead.call(threadRoot); - break; - case Conf['Expand image']: - if (!(ImageExpand.enabled && threadRoot)) { - return; - } - post = Get.postFromNode(Keybinds.post(threadRoot)); - if (post.file) { - ImageExpand.toggle(post); - } - break; - case Conf['Expand images']: - if (!ImageExpand.enabled) { - return; - } - ImageExpand.cb.toggleAll(); - break; - case Conf['Open Gallery']: - if (!Gallery.enabled) { - return; - } - Gallery.cb.toggle(); - break; - case Conf['fappeTyme']: - if (!((ref2 = FappeTyme.nodes) != null ? ref2.fappe : void 0)) { - return; - } - FappeTyme.toggle('fappe'); - break; - case Conf['werkTyme']: - if (!((ref3 = FappeTyme.nodes) != null ? ref3.werk : void 0)) { - return; - } - FappeTyme.toggle('werk'); - break; - case Conf['Front page']: - if (Index.enabled) { - Index.userPageNav(1); - } else { - location.href = "/" + g.BOARD + "/"; - } - break; - case Conf['Open front page']: - $.open(location.origin + "/" + g.BOARD + "/"); - break; - case Conf['Next page']: - if (!(g.VIEW === 'index' && !(typeof (base = g.SITE).isOnePage === "function" ? base.isOnePage(g.BOARD) : void 0))) { - return; - } - if (Index.enabled) { - if ((ref4 = Conf['Index Mode']) !== 'paged' && ref4 !== 'infinite') { - return; - } - $('.next button', Index.pagelist).click(); - } else { - if ((ref5 = $(g.SITE.selectors.nav.next)) != null) { - ref5.click(); - } - } - break; - case Conf['Previous page']: - if (!(g.VIEW === 'index' && !(typeof (base1 = g.SITE).isOnePage === "function" ? base1.isOnePage(g.BOARD) : void 0))) { - return; - } - if (Index.enabled) { - if ((ref6 = Conf['Index Mode']) !== 'paged' && ref6 !== 'infinite') { - return; - } - $('.prev button', Index.pagelist).click(); - } else { - if ((ref7 = $(g.SITE.selectors.nav.prev)) != null) { - ref7.click(); - } - } - break; - case Conf['Search form']: - if (g.VIEW !== 'index') { - return; - } - searchInput = Index.enabled ? Index.searchInput : g.SITE.selectors.searchBox ? $(g.SITE.selectors.searchBox) : void 0; - if (!searchInput) { - return; - } - Header.scrollToIfNeeded(searchInput); - searchInput.focus(); - break; - case Conf['Paged mode']: - if (!Index.enabledOn(g.BOARD)) { - return; - } - location.href = g.VIEW === 'index' ? '#paged' : "/" + g.BOARD + "/#paged"; - break; - case Conf['Infinite scrolling mode']: - if (!Index.enabledOn(g.BOARD)) { - return; - } - location.href = g.VIEW === 'index' ? '#infinite' : "/" + g.BOARD + "/#infinite"; - break; - case Conf['All pages mode']: - if (!Index.enabledOn(g.BOARD)) { - return; - } - location.href = g.VIEW === 'index' ? '#all-pages' : "/" + g.BOARD + "/#all-pages"; - break; - case Conf['Open catalog']: - if (!(catalog = CatalogLinks.catalog())) { - return; - } - location.href = catalog; - break; - case Conf['Cycle sort type']: - if (!Index.enabled) { - return; - } - Index.cycleSortType(); - break; - case Conf['Next thread']: - if (!(g.VIEW === 'index' && threadRoot)) { - return; - } - Nav.scroll(+1); - break; - case Conf['Previous thread']: - if (!(g.VIEW === 'index' && threadRoot)) { - return; - } - Nav.scroll(-1); - break; - case Conf['Expand thread']: - if (!(g.VIEW === 'index' && threadRoot)) { - return; - } - ExpandThread.toggle(thread); - Header.scrollTo(threadRoot); - break; - case Conf['Open thread']: - if (!(g.VIEW === 'index' && threadRoot)) { - return; - } - Keybinds.open(thread); - break; - case Conf['Open thread tab']: - if (!(g.VIEW === 'index' && threadRoot)) { - return; - } - Keybinds.open(thread, true); - break; - case Conf['Next reply']: - if (!threadRoot) { - return; - } - Keybinds.hl(+1, threadRoot); - break; - case Conf['Previous reply']: - if (!threadRoot) { - return; - } - Keybinds.hl(-1, threadRoot); - break; - case Conf['Deselect reply']: - if (!threadRoot) { - return; - } - Keybinds.hl(0, threadRoot); - break; - case Conf['Hide']: - if (!(thread && ThreadHiding.db)) { - return; - } - Header.scrollTo(threadRoot); - ThreadHiding.toggle(thread); - break; - case Conf['Quick Filter MD5']: - if (!threadRoot) { - return; - } - post = Keybinds.post(threadRoot); - Keybinds.hl(+1, threadRoot); - Filter.quickFilterMD5.call(post, e); - break; - case Conf['Previous Post Quoting You']: - if (!(threadRoot && QuoteYou.db)) { - return; - } - QuoteYou.cb.seek('preceding'); - break; - case Conf['Next Post Quoting You']: - if (!(threadRoot && QuoteYou.db)) { - return; - } - QuoteYou.cb.seek('following'); - break; - default: - return; - } - e.preventDefault(); - return e.stopPropagation(); - }, - keyCode: function(e) { - var kc, key; - key = (function() { - switch (kc = e.keyCode) { - case 8: - return ''; - case 13: - return 'Enter'; - case 27: - return 'Esc'; - case 32: - return 'Space'; - case 37: - return 'Left'; - case 38: - return 'Up'; - case 39: - return 'Right'; - case 40: - return 'Down'; - case 188: - return 'Comma'; - case 190: - return 'Period'; - case 191: - return 'Slash'; - case 59: - case 186: - return 'Semicolon'; - default: - if ((48 <= kc && kc <= 57) || (65 <= kc && kc <= 90)) { - return String.fromCharCode(kc).toLowerCase(); - } else if ((96 <= kc && kc <= 105)) { - return String.fromCharCode(kc - 48).toLowerCase(); - } else { - return null; - } - } - })(); - if (key) { - if (e.altKey) { - key = 'Alt+' + key; - } - if (e.ctrlKey) { - key = 'Ctrl+' + key; - } - if (e.metaKey) { - key = 'Meta+' + key; - } - if (e.shiftKey) { - key = 'Shift+' + key; - } - } - return key; - }, - post: function(thread) { - var s; - s = g.SITE.selectors; - return $("" + s.postContainer + s.highlightable.reply + "." + g.SITE.classes.highlight, thread) || $("" + (g.SITE.isOPContainerThread ? s.thread : s.postContainer) + s.highlightable.op, thread); - }, - qr: function(thread) { - QR.open(); - if (thread != null) { - QR.quote.call(Keybinds.post(thread)); - } - return QR.nodes.com.focus(); - }, - tags: function(tag, ta) { - var range, selEnd, selStart, value; - BoardConfig.ready(function() { - var config, supported; - config = g.BOARD.config; - supported = (function() { - switch (tag) { - case 'spoiler': - return !!config.spoilers; - case 'code': - return !!config.code_tags; - case 'math': - case 'eqn': - return !!config.math_tags; - case 'sjis': - return !!config.sjis_tags; - } - })(); - if (!supported) { - return new Notice('warning', "[" + tag + "] tags are not supported on /" + g.BOARD + "/.", 20); - } - }); - value = ta.value; - selStart = ta.selectionStart; - selEnd = ta.selectionEnd; - ta.value = value.slice(0, selStart) + ("[" + tag + "]") + value.slice(selStart, selEnd) + ("[/" + tag + "]") + value.slice(selEnd); - range = ("[" + tag + "]").length + selEnd; - ta.setSelectionRange(range, range); - return $.event('input', null, ta); - }, - sage: function() { - var isSage; - isSage = /sage/i.test(QR.nodes.email.value); - return QR.nodes.email.value = isSage ? "" : "sage"; - }, - open: function(thread, tab) { - var url; - if (g.VIEW !== 'index') { - return; - } - url = Get.url('thread', thread); - if (tab) { - return $.open(url); - } else { - return location.href = url; - } - }, - hl: function(delta, thread) { - var axis, height, highlight, i, len, next, postEl, replies, reply, replySelector, root; - replySelector = "" + g.SITE.selectors.postContainer + g.SITE.selectors.highlightable.reply; - highlight = g.SITE.classes.highlight; - postEl = $(replySelector + "." + highlight, thread); - if (!delta) { - if (postEl) { - $.rmClass(postEl, highlight); - } - return; - } - if (postEl) { - height = postEl.getBoundingClientRect().height; - if (Header.getTopOf(postEl) >= -height && Header.getBottomOf(postEl) >= -height) { - root = Get.postFromNode(postEl).nodes.root; - axis = delta === +1 ? 'following' : 'preceding'; - if (!(next = $.x(axis + "-sibling::" + g.SITE.xpath.replyContainer + "[not(@hidden) and not(child::div[@class='stub'])][1]", root))) { - return; - } - if (!next.matches(replySelector)) { - next = $(replySelector, next); - } - Header.scrollToIfNeeded(next, delta === +1); - $.addClass(next, highlight); - $.rmClass(postEl, highlight); - return; - } - $.rmClass(postEl, highlight); - } - replies = $$(replySelector, thread); - if (delta === -1) { - replies.reverse(); - } - for (i = 0, len = replies.length; i < len; i++) { - reply = replies[i]; - if (delta === +1 && Header.getTopOf(reply) > 0 || delta === -1 && Header.getBottomOf(reply) > 0) { - $.addClass(reply, highlight); - return; - } - } - } - }; - - return Keybinds; - -}).call(this); - -ModContact = (function() { - var ModContact; - - ModContact = { - init: function() { - var ref; - if (!(g.SITE.software === 'yotsuba' && ((ref = g.VIEW) === 'index' || ref === 'thread'))) { - return; - } - return Callbacks.Post.push({ - name: 'Mod Contact Links', - cb: this.node - }); - }, - node: function() { - var links, moveNote, moved; - if (this.isClone || !$.hasOwn(ModContact.specific, this.info.capcode)) { - return; - } - links = $.el('span', { - className: 'contact-links brackets-wrap' - }); - $.extend(links, ModContact.template(this.info.capcode)); - $.after(this.nodes.capcode, links); - if ((moved = this.info.comment.match(/This thread was moved to >>>\/(\w+)\//)) && $.hasOwn(ModContact.moveNote, moved[1])) { - moveNote = $.el('div', { - className: 'move-note' - }); - $.extend(moveNote, ModContact.moveNote[moved[1]]); - return $.add(this.nodes.post, moveNote); - } - }, - template: function(capcode) { - return {innerHTML: "feedback" + (ModContact.specific[capcode]()).innerHTML}; - }, - specific: { - Mod: function() { - return {innerHTML: " IRC"}; - }, - Manager: function() { - return ModContact.specific.Mod(); - }, - Developer: function() { - return {innerHTML: " github"}; - }, - Admin: function() { - return {innerHTML: " twitter"}; - } - }, - moveNote: { - qa: {innerHTML: "Moving a thread to /qa/ does not imply mods will read it. If you wish to contact mods, use feedback (https://www.4chan.org/feedback) or IRC (https://www.4chan-x.net/4chan-irc.html)."} - } - }; - - return ModContact; - -}).call(this); - -Nav = (function() { - var Nav; - - Nav = { - init: function() { - var append, next, prev, span; - switch (g.VIEW) { - case 'index': - if (!Conf['Index Navigation']) { - return; - } - break; - case 'thread': - if (!Conf['Reply Navigation']) { - return; - } - break; - default: - return; - } - span = $.el('span', { - id: 'navlinks' - }); - prev = $.el('a', { - textContent: '▲', - href: 'javascript:;' - }); - next = $.el('a', { - textContent: '▼', - href: 'javascript:;' - }); - $.on(prev, 'click', this.prev); - $.on(next, 'click', this.next); - $.add(span, [prev, $.tn(' '), next]); - append = function() { - $.off(d, '4chanXInitFinished', append); - return $.add(d.body, span); - }; - return $.on(d, '4chanXInitFinished', append); - }, - prev: function() { - if (g.VIEW === 'thread') { - return window.scrollTo(0, 0); - } else { - return Nav.scroll(-1); - } - }, - next: function() { - if (g.VIEW === 'thread') { - return window.scrollTo(0, d.body.scrollHeight); - } else { - return Nav.scroll(+1); - } - }, - getThread: function() { - var i, len, ref, thread, threadRoot; - if (g.VIEW === 'thread') { - return g.threads.get(g.BOARD + "." + g.THREADID).nodes.root; - } - if ($.hasClass(doc, 'catalog-mode')) { - return; - } - ref = $$(g.SITE.selectors.thread); - for (i = 0, len = ref.length; i < len; i++) { - threadRoot = ref[i]; - thread = Get.threadFromRoot(threadRoot); - if (thread.isHidden && !thread.stub) { - continue; - } - if (Header.getTopOf(threadRoot) >= -threadRoot.getBoundingClientRect().height) { - return threadRoot; - } - } - }, - scroll: function(delta) { - var axis, extra, next, ref, thread, top; - if ((ref = d.activeElement) != null) { - ref.blur(); - } - thread = Nav.getThread(); - if (!thread) { - return; - } - axis = delta === +1 ? 'following' : 'preceding'; - if (next = $.x(axis + "-sibling::" + g.SITE.xpath.thread + "[not(@hidden)][1]", thread)) { - top = Header.getTopOf(thread); - if (delta === +1 && top < 5 || delta === -1 && top > -5) { - thread = next; - } - } - extra = Header.getTopOf(thread) + doc.clientHeight - d.body.getBoundingClientRect().bottom; - if (extra > 0) { - d.body.style.marginBottom = extra + "px"; - } - Header.scrollTo(thread); - if (extra > 0 && !Nav.haveExtra) { - Nav.haveExtra = true; - return $.on(d, 'scroll', Nav.removeExtra); - } - }, - removeExtra: function() { - var extra; - extra = doc.clientHeight - d.body.getBoundingClientRect().bottom; - if (extra > 0) { - return d.body.style.marginBottom = extra + "px"; - } else { - d.body.style.marginBottom = ''; - delete Nav.haveExtra; - return $.off(d, 'scroll', Nav.removeExtra); - } - } - }; - - return Nav; - -}).call(this); - -NormalizeURL = (function() { - var NormalizeURL; - - NormalizeURL = { - init: function() { - var pathname; - if (!Conf['Normalize URL']) { - return; - } - pathname = location.pathname.split(/\/+/); - if (g.SITE.software === 'yotsuba') { - switch (g.VIEW) { - case 'thread': - pathname[2] = 'thread'; - pathname = pathname.slice(0, 4); - break; - case 'index': - pathname = pathname.slice(0, 3); - } - } - pathname = pathname.join('/'); - if (location.pathname !== pathname) { - return history.replaceState(history.state, '', location.protocol + "//" + location.host + pathname + location.hash); - } - } - }; - - return NormalizeURL; - -}).call(this); - -PSA = (function() { - var PSA, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - PSA = { - init: function() { - var announcement, el; - if (g.SITE.software === 'yotsuba' && g.BOARD.ID === 'qa') { - announcement = { - innerHTML: "Stay in touch with your /qa/ friends!" - }; - el = $.el('div', { - className: 'fcx-announcement' - }, announcement); - $.onExists(doc, '.boardBanner', function(banner) { - return $.after(banner, el); - }); - } - if ('samachan.org' in Conf['siteProperties'] && indexOf.call(Conf['PSAseen'], 'samachan') < 0) { - el = $.el('span', { - innerHTML: "Looking for a new home?
        Some former Samachan users are regrouping on SushiChan.

        (a message from 4chan X)" - }); - return Main.ready(function() { - new Notice('info', el); - Conf['PSAseen'].push('samachan'); - return $.set('PSAseen', Conf['PSAseen']); - }); - } - } - }; - - return PSA; - -}).call(this); - -PSAHiding = (function() { - var PSAHiding, - slice = [].slice; - - PSAHiding = { - init: function() { - if (!(Conf['Announcement Hiding'] && g.SITE.selectors.psa)) { - return; - } - $.addClass(doc, 'hide-announcement'); - $.onExists(doc, g.SITE.selectors.psa, this.setup); - return $.ready(function() { - if (!$(g.SITE.selectors.psa)) { - return $.rmClass(doc, 'hide-announcement'); - } - }); - }, - setup: function(psa) { - var btn, entry, hr, ref, ref1, ref2; - PSAHiding.psa = psa; - PSAHiding.text = (ref = psa.dataset.utc) != null ? ref : psa.innerHTML; - if (g.SITE.selectors.psaTop && (hr = (ref1 = $(g.SITE.selectors.psaTop)) != null ? ref1.previousElementSibling : void 0) && hr.nodeName === 'HR') { - PSAHiding.hr = hr; - } - PSAHiding.content = $.el('div'); - entry = { - el: $.el('a', { - textContent: 'Show announcement', - className: 'show-announcement', - href: 'javascript:;' - }), - order: 50, - open: function() { - return psa.hidden; - } - }; - Header.menu.addEntry(entry); - $.on(entry.el, 'click', PSAHiding.toggle); - PSAHiding.btn = btn = $.el('a', { - title: 'Mark announcement as read and hide.', - className: 'hide-announcement-button fa fa-minus-square', - href: 'javascript:;' - }); - $.on(btn, 'click', PSAHiding.toggle); - if (((ref2 = psa.firstChild) != null ? ref2.tagName : void 0) === 'HR') { - $.after(psa.firstChild, btn); - } else { - $.prepend(psa, btn); - } - PSAHiding.sync(Conf['hiddenPSAList']); - $.rmClass(doc, 'hide-announcement'); - return $.sync('hiddenPSAList', PSAHiding.sync); - }, - toggle: function() { - var hide, set; - hide = $.hasClass(this, 'hide-announcement-button'); - set = function(hiddenPSAList) { - if (hide) { - return hiddenPSAList[g.SITE.ID] = PSAHiding.text; - } else { - return delete hiddenPSAList[g.SITE.ID]; - } - }; - set(Conf['hiddenPSAList']); - PSAHiding.sync(Conf['hiddenPSAList']); - return $.get('hiddenPSAList', Conf['hiddenPSAList'], function(arg) { - var hiddenPSAList; - hiddenPSAList = arg.hiddenPSAList; - set(hiddenPSAList); - return $.set('hiddenPSAList', hiddenPSAList); - }); - }, - sync: function(hiddenPSAList) { - var content, psa, ref; - psa = PSAHiding.psa, content = PSAHiding.content; - psa.hidden = hiddenPSAList[g.SITE.ID] === PSAHiding.text; - if (psa.hidden) { - $.add(content, slice.call(psa.childNodes)); - } else { - $.add(psa, slice.call(content.childNodes)); - } - return (ref = PSAHiding.hr) != null ? ref.hidden = psa.hidden : void 0; - } - }; - - return PSAHiding; - -}).call(this); - -PassMessage = (function() { - var PassMessage; - - PassMessage = { - init: function() { - var close, msg; - if (Conf['passMessageClosed']) { - return; - } - msg = $.el('div', { - className: 'box-outer top-box' - }, {innerHTML: "

        Trouble buying a 4chan Pass? (a message from 4chan X) ×

        Check the 4chan X wiki for alternative solutions.
        "}); - msg.style.cssText = 'padding-bottom: 0;'; - close = $('a', msg); - $.on(close, 'click', function() { - $.rm(msg); - return $.set('passMessageClosed', true); - }); - return $.ready(function() { - var hd; - if ((hd = $.id('hd'))) { - return $.after(hd, msg); - } else { - return $.prepend(d.body, msg); - } - }); - } - }; - - return PassMessage; - -}).call(this); - -PostJumper = (function() { - var PostJumper; - - PostJumper = { - init: function() { - var ref; - if (!(Conf['Unique ID and Capcode Navigation'] && ((ref = g.VIEW) === 'index' || ref === 'thread'))) { - return; - } - this.buttons = this.makeButtons(); - return Callbacks.Post.push({ - name: 'Post Jumper', - cb: this.node - }); - }, - node: function() { - var buttons, i, len, ref; - if (this.isClone) { - ref = $$('.postJumper', this.nodes.info); - for (i = 0, len = ref.length; i < len; i++) { - buttons = ref[i]; - PostJumper.addListeners(buttons); - } - return; - } - if (this.nodes.uniqueIDRoot) { - PostJumper.addButtons(this, 'uniqueID'); - } - if (this.nodes.capcode) { - return PostJumper.addButtons(this, 'capcode'); - } - }, - addButtons: function(post, type) { - var buttons, value; - value = post.info[type]; - buttons = PostJumper.buttons.cloneNode(true); - $.extend(buttons.dataset, { - type: type, - value: value - }); - $.after(post.nodes[type + (type === 'capcode' ? '' : 'Root')], buttons); - return PostJumper.addListeners(buttons); - }, - addListeners: function(buttons) { - $.on(buttons.firstChild, 'click', PostJumper.buttonClick); - return $.on(buttons.lastChild, 'click', PostJumper.buttonClick); - }, - buttonClick: function() { - var dir, toJumper; - dir = $.hasClass(this, 'prev') ? -1 : 1; - if ((toJumper = PostJumper.find(this.parentNode, dir))) { - return PostJumper.scroll(this.parentNode, toJumper); - } - }, - find: function(jumper, dir) { - var axis, jumper2, ref, type, value, xpath; - ref = jumper.dataset, type = ref.type, value = ref.value; - xpath = "span[contains(@class,\"postJumper\") and @data-value=\"" + value + "\" and @data-type=\"" + type + "\"]"; - axis = dir < 0 ? 'preceding' : 'following'; - jumper2 = jumper; - while ((jumper2 = $.x(axis + "::" + xpath, jumper2))) { - if (jumper2.getBoundingClientRect().height) { - return jumper2; - } - } - if ((jumper2 = $.x("(//" + xpath + ")[" + (dir < 0 ? 'last()' : '1') + "]"))) { - if (jumper2.getBoundingClientRect().height) { - return jumper2; - } - } - while ((jumper2 = $.x(axis + "::" + xpath, jumper2)) && jumper2 !== jumper) { - if (jumper2.getBoundingClientRect().height) { - return jumper2; - } - } - return null; - }, - makeButtons: function() { - var charNext, charPrev, classNext, classPrev, span; - charPrev = '\u23EB'; - charNext = '\u23EC'; - classPrev = 'prev'; - classNext = 'next'; - span = $.el('span', { - className: 'postJumper' - }); - $.extend(span, {innerHTML: "" + E(charPrev) + "" + E(charNext) + ""}); - return span; - }, - scroll: function(fromJumper, toJumper) { - var destPos, prevPos; - prevPos = fromJumper.getBoundingClientRect().top; - destPos = toJumper.getBoundingClientRect().top; - return window.scrollBy(0, destPos - prevPos); - } - }; - - return PostJumper; - -}).call(this); - -RelativeDates = (function() { - var RelativeDates, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - RelativeDates = { - INTERVAL: $.MINUTE / 2, - init: function() { - var ref; - if (((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || Index.enabled) { - this.flush(); - $.on(d, 'visibilitychange PostsInserted', this.flush); - } - if (Conf['Relative Post Dates']) { - return Callbacks.Post.push({ - name: 'Relative Post Dates', - cb: this.node - }); - } - }, - node: function() { - var dateEl; - if (!this.info.date) { - return; - } - dateEl = this.nodes.date; - if (Conf['Relative Date Title']) { - $.on(dateEl, 'mouseover', (function(_this) { - return function() { - return RelativeDates.hover(_this); - }; - })(this)); - return; - } - if (this.isClone) { - return; - } - dateEl.title = dateEl.textContent; - return RelativeDates.update(this); - }, - relative: function(diff, now, date, abbrev) { - var days, months, number, rounded, unit, years; - unit = (number = diff / $.DAY) >= 1 ? (years = now.getFullYear() - date.getFullYear(), months = now.getMonth() - date.getMonth(), days = now.getDate() - date.getDate(), years > 1 ? (number = years - (months < 0 || months === 0 && days < 0), 'year') : years === 1 && (months > 0 || months === 0 && days >= 0) ? (number = years, 'year') : (months = months + 12 * years) > 1 ? (number = months - (days < 0), 'month') : months === 1 && days >= 0 ? (number = months, 'month') : 'day') : (number = diff / $.HOUR) >= 1 ? 'hour' : (number = diff / $.MINUTE) >= 1 ? 'minute' : (number = Math.max(0, diff) / $.SECOND, 'second'); - rounded = Math.round(number); - if (abbrev) { - unit = unit === 'month' ? 'mo' : unit[0]; - } else { - if (rounded !== 1) { - unit += 's'; - } - } - if (abbrev) { - return "" + rounded + unit; - } else { - return rounded + " " + unit + " ago"; - } - }, - stale: [], - flush: function() { - var data, i, len, now, ref; - if (d.hidden) { - return; - } - now = new Date(); - ref = RelativeDates.stale; - for (i = 0, len = ref.length; i < len; i++) { - data = ref[i]; - RelativeDates.update(data, now); - } - RelativeDates.stale = []; - clearTimeout(RelativeDates.timeout); - return RelativeDates.timeout = setTimeout(RelativeDates.flush, RelativeDates.INTERVAL); - }, - hover: function(post) { - var date, diff, now; - date = post.info.date; - now = new Date(); - diff = now - date; - return post.nodes.date.title = RelativeDates.relative(diff, now, date); - }, - update: function(data, now) { - var abbrev, date, diff, i, isPost, len, ref, relative, singlePost; - isPost = data instanceof Post; - if (isPost) { - date = data.info.date; - abbrev = false; - } else { - date = new Date(+data.dataset.utc); - abbrev = !!data.dataset.abbrev; - } - now || (now = new Date()); - diff = now - date; - relative = RelativeDates.relative(diff, now, date, abbrev); - if (isPost) { - ref = [data].concat(data.clones); - for (i = 0, len = ref.length; i < len; i++) { - singlePost = ref[i]; - singlePost.nodes.date.firstChild.textContent = relative; - } - } else { - data.firstChild.textContent = relative; - } - return RelativeDates.setOwnTimeout(diff, data); - }, - setOwnTimeout: function(diff, data) { - var delay; - delay = diff < $.MINUTE ? $.SECOND - (diff + $.SECOND / 2) % $.SECOND : diff < $.HOUR ? $.MINUTE - (diff + $.MINUTE / 2) % $.MINUTE : diff < $.DAY ? $.HOUR - (diff + $.HOUR / 2) % $.HOUR : $.DAY - (diff + $.DAY / 2) % $.DAY; - return setTimeout(RelativeDates.markStale, delay, data); - }, - markStale: function(data) { - if (indexOf.call(RelativeDates.stale, data) >= 0) { - return; - } - if (data instanceof Post && !g.posts.get(data.fullID)) { - return; - } - if (data instanceof Element && !doc.contains(data)) { - return; - } - return RelativeDates.stale.push(data); - } - }; - - return RelativeDates; - -}).call(this); - -RemoveSpoilers = (function() { - var RemoveSpoilers, - slice = [].slice; - - RemoveSpoilers = { - init: function() { - if (Conf['Reveal Spoilers']) { - $.addClass(doc, 'reveal-spoilers'); - } - if (!Conf['Remove Spoilers']) { - return; - } - Callbacks.Post.push({ - name: 'Reveal Spoilers', - cb: this.node - }); - if (g.VIEW === 'archive') { - return $.ready(function() { - return RemoveSpoilers.unspoiler($.id('arc-list')); - }); - } - }, - node: function() { - return RemoveSpoilers.unspoiler(this.nodes.comment); - }, - unspoiler: function(el) { - var i, len, span, spoiler, spoilers; - spoilers = $$(g.SITE.selectors.spoiler, el); - for (i = 0, len = spoilers.length; i < len; i++) { - spoiler = spoilers[i]; - span = $.el('span', { - className: 'removed-spoiler' - }); - $.replace(spoiler, span); - $.add(span, slice.call(spoiler.childNodes)); - } - } - }; - - return RemoveSpoilers; - -}).call(this); - -Report = (function() { - var Report; - - Report = { - init: function() { - var match; - if (!(match = location.search.match(/\bno=(\d+)/))) { - return; - } - Captcha.replace.init(); - this.postID = +match[1]; - return $.ready(this.ready); - }, - ready: function() { - $.addStyle(CSS.report); - if (Conf['Archive Report']) { - Report.archive(); - } - new MutationObserver(function() { - Report.fit('iframe[src^="https://www.google.com/recaptcha/api2/frame"]'); - return Report.fit('body'); - }).observe(d.body, { - childList: true, - attributes: true, - subtree: true - }); - return Report.fit('body'); - }, - fit: function(selector) { - var dy, el; - if (!((el = $(selector, doc)) && getComputedStyle(el).visibility !== 'hidden')) { - return; - } - dy = el.getBoundingClientRect().bottom - doc.clientHeight + 8; - if (dy > 0) { - return window.resizeBy(0, dy); - } - }, - archive: function() { - var enabled, fieldset, form, match, message, reason, submit, types, urls; - if (!(urls = Redirect.report(g.BOARD.ID)).length) { - return; - } - form = $('form'); - types = $.id('reportTypes'); - message = $('h3'); - fieldset = $.el('fieldset', { - id: 'archive-report', - hidden: true - }, {innerHTML: ""}); - enabled = $('#archive-report-enabled', fieldset); - reason = $('#archive-report-reason', fieldset); - submit = $('#archive-report-submit', fieldset); - $.on(enabled, 'change', function() { - return reason.disabled = !this.checked; - }); - if (form && types) { - fieldset.hidden = !$('[value="31"]', types).checked; - $.on(types, 'change', function(e) { - fieldset.hidden = e.target.value !== '31'; - return Report.fit('body'); - }); - $.after(types, fieldset); - Report.fit('body'); - $.one(form, 'submit', function(e) { - if (!fieldset.hidden && enabled.checked) { - e.preventDefault(); - return Report.archiveSubmit(urls, reason.value, (function(_this) { - return function(results) { - _this.action = '#archiveresults=' + encodeURIComponent(JSON.stringify(results)); - return _this.submit(); - }; - })(this)); - } - }); - } else if (message) { - fieldset.hidden = /Report submitted!/.test(message.textContent); - $.on(enabled, 'change', function() { - return submit.hidden = !this.checked; - }); - $.after(message, fieldset); - $.on(submit, 'click', function() { - return Report.archiveSubmit(urls, reason.value, Report.archiveResults); - }); - } - if ((match = location.hash.match(/^#archiveresults=(.*)$/))) { - try { - return Report.archiveResults(JSON.parse(decodeURIComponent(match[1]))); - } catch (error) {} - } - }, - archiveSubmit: function(urls, reason, cb) { - var fn, form, i, len, name, ref, results, url; - form = $.formData({ - board: g.BOARD.ID, - num: Report.postID, - reason: reason - }); - results = []; - fn = function(name, url) { - return $.ajax(url, { - onloadend: function() { - results.push([ - name, this.response || { - error: '' - } - ]); - if (results.length === urls.length) { - return cb(results); - } - }, - form: form - }); - }; - for (i = 0, len = urls.length; i < len; i++) { - ref = urls[i], name = ref[0], url = ref[1]; - fn(name, url); - } - }, - archiveResults: function(results) { - var fieldset, i, len, line, name, ref, response; - fieldset = $.id('archive-report'); - for (i = 0, len = results.length; i < len; i++) { - ref = results[i], name = ref[0], response = ref[1]; - line = $.el('h3', { - className: 'archive-report-response' - }); - if ('success' in response) { - $.addClass(line, 'archive-report-success'); - line.textContent = name + ": " + response.success; - } else { - $.addClass(line, 'archive-report-error'); - line.textContent = name + ": " + (response.error || 'Error reporting post.'); - } - if (fieldset) { - $.before(fieldset, line); - } else { - $.add(d.body, line); - } - } - } - }; - - return Report; - -}).call(this); - -ThreadLinks = (function() { - var ThreadLinks; - - ThreadLinks = { - init: function() { - if (!(g.VIEW === 'index' && Conf['Open Threads in New Tab'])) { - return; - } - Callbacks.Post.push({ - name: 'Thread Links', - cb: this.node - }); - return Callbacks.CatalogThread.push({ - name: 'Thread Links', - cb: this.catalogNode - }); - }, - node: function() { - if (this.isReply || this.isClone) { - return; - } - return ThreadLinks.process(this.nodes.reply); - }, - catalogNode: function() { - return ThreadLinks.process(this.nodes.thumb.parentNode); - }, - process: function(link) { - return link.target = '_blank'; - } - }; - - return ThreadLinks; - -}).call(this); - -Time = (function() { - var Time; - - Time = { - init: function() { - var ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread' || ref === 'archive') && Conf['Time Formatting'])) { - return; - } - return Callbacks.Post.push({ - name: 'Time Formatting', - cb: this.node - }); - }, - node: function() { - var textContent; - if (!this.info.date || this.isClone) { - return; - } - textContent = this.nodes.date.textContent; - return this.nodes.date.textContent = textContent.match(/^\s*/)[0] + Time.format(Conf['time'], this.info.date) + textContent.match(/\s*$/)[0]; - }, - format: function(formatString, date) { - return formatString.replace(/%(.)/g, function(s, c) { - if ($.hasOwn(Time.formatters, c)) { - return Time.formatters[c].call(date); - } else { - return s; - } - }); - }, - day: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], - month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - localeFormat: function(date, options, defaultValue) { - if (Conf['timeLocale']) { - try { - return Intl.DateTimeFormat(Conf['timeLocale'], options).format(date); - } catch (error) {} - } - return defaultValue; - }, - localeFormatPart: function(date, options, part, defaultValue) { - var parts; - if (Conf['timeLocale']) { - try { - parts = Intl.DateTimeFormat(Conf['timeLocale'], options).formatToParts(date); - return parts.map(function(x) { - if (x.type === part) { - return x.value; - } else { - return ''; - } - }).join(''); - } catch (error) {} - } - return defaultValue; - }, - zeroPad: function(n) { - if (n < 10) { - return "0" + n; - } else { - return n; - } - }, - formatters: { - a: function() { - return Time.localeFormat(this, { - weekday: 'short' - }, Time.day[this.getDay()].slice(0, 3)); - }, - A: function() { - return Time.localeFormat(this, { - weekday: 'long' - }, Time.day[this.getDay()]); - }, - b: function() { - return Time.localeFormat(this, { - month: 'short' - }, Time.month[this.getMonth()].slice(0, 3)); - }, - B: function() { - return Time.localeFormat(this, { - month: 'long' - }, Time.month[this.getMonth()]); - }, - d: function() { - return Time.zeroPad(this.getDate()); - }, - e: function() { - return this.getDate(); - }, - H: function() { - return Time.zeroPad(this.getHours()); - }, - I: function() { - return Time.zeroPad(this.getHours() % 12 || 12); - }, - k: function() { - return this.getHours(); - }, - l: function() { - return this.getHours() % 12 || 12; - }, - m: function() { - return Time.zeroPad(this.getMonth() + 1); - }, - M: function() { - return Time.zeroPad(this.getMinutes()); - }, - p: function() { - return Time.localeFormatPart(this, { - hour: 'numeric', - hour12: true - }, 'dayperiod', (this.getHours() < 12 ? 'AM' : 'PM')); - }, - P: function() { - return Time.formatters.p.call(this).toLowerCase(); - }, - S: function() { - return Time.zeroPad(this.getSeconds()); - }, - y: function() { - return this.getFullYear().toString().slice(2); - }, - Y: function() { - return this.getFullYear(); - }, - '%': function() { - return '%'; - } - } - }; - - return Time; - -}).call(this); - -Tinyboard = (function() { - var Tinyboard; - - Tinyboard = { - init: function() { - if (g.SITE.software !== 'tinyboard') { - return; - } - if (g.VIEW === 'thread') { - return Main.ready(function() { - return $.global(function() { - var base, boardID, form, originalNoko, ref, ref1, ref2, threadID; - ref = document.currentScript.dataset, boardID = ref.boardID, threadID = ref.threadID; - threadID = +threadID; - form = document.querySelector('form[name="post"]'); - window.$(document).ajaxComplete(function(event, request, settings) { - var detail, noko, postID, redirect, ref1, ref2; - if (settings.url !== form.action) { - return; - } - if (!(postID = +((ref1 = request.responseJSON) != null ? ref1.id : void 0))) { - return; - } - detail = { - boardID: boardID, - threadID: threadID, - postID: postID - }; - try { - ref2 = request.responseJSON, redirect = ref2.redirect, noko = ref2.noko; - if (redirect && (typeof originalNoko !== "undefined" && originalNoko !== null) && !originalNoko && !noko) { - detail.redirect = redirect; - } - } catch (error) {} - event = new CustomEvent('QRPostSuccessful', { - bubbles: true, - detail: detail - }); - return document.dispatchEvent(event); - }); - originalNoko = (ref1 = window.tb_settings) != null ? (ref2 = ref1.ajax) != null ? ref2.always_noko_replies : void 0 : void 0; - return ((base = (window.tb_settings || (window.tb_settings = {}))).ajax || (base.ajax = {})).always_noko_replies = true; - }, { - boardID: g.BOARD.ID, - threadID: g.THREADID - }); - }); - } - } - }; - - return Tinyboard; - -}).call(this); - -Favicon = (function() { - var Favicon; - - Favicon = { - init: function() { - return $.asap((function() { - return d.head && (Favicon.el = $('link[rel="shortcut icon"]', d.head)); - }), Favicon.initAsap); - }, - set: function(status) { - Favicon.status = status; - if (Favicon.el) { - Favicon.el.href = Favicon[status]; - return $.add(d.head, Favicon.el); - } - }, - initAsap: function() { - var href; - Favicon.el.type = 'image/x-icon'; - href = Favicon.el.href; - Favicon.isSFW = /ws\.ico$/.test(href); - Favicon["default"] = href; - Favicon["switch"](); - if (Favicon.status) { - return Favicon.set(Favicon.status); - } - }, - "switch": function() { - var f, i, items, t; - items = { - ferongr: ['iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///9zBQC/AADpDAP/gID/q6voCwJJTwpOAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPUCtJM7svankLrq/I+TY5e6Ueh1jyBMX7AFJi9vwfyVO4CbbO6jNYpp9GyVPbdkFhVgAQ2H0NOE5jk9DT8AAAAAElFTkSuQmCC', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAxUlEQVR42q1TOwrCQBB9s0FRtJI0WoqFt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FNAAAAA3RSTlMAPse+s4iwAAAAMklEQVQI12NggAFmY2MDECaNAQZCilAzVJyg5oS4GqAxUtygjIp2KGOKJ5SxepcB3BUAcdYRqxAtgFoAAAAASUVORK5CYII=', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAABV/wErM5hwAAAAAXRSTlMAQObYZgAAABJJREFUCB1jZGBgrMNAQEEc4gCSfAX5bRw/NQAAAABJRU5ErkJggg==', 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAAAAAAAAABV/wH///8NKAASOAAwkQADCgAZTABAwQATOwC5e3VGAAAAA3RSTlMAPse+s4iwAAAAMklEQVQI12NggAFmY2MDECaNAQZCilAzVJyg5oS4GqAxUtygjIp2KGOKJ5SxepcB3BUAcdYRqxAtgFoAAAAASUVORK5CYII='] - }; - items = $.getOwn(items, Conf['favicon']); - f = Favicon; - t = 'data:image/png;base64,'; - i = 0; - while (items[i]) { - items[i] = t + items[i++]; - } - f.unreadDead = items[0], f.unreadDeadY = items[1], f.unreadSFW = items[2], f.unreadSFWY = items[3], f.unreadNSFW = items[4], f.unreadNSFWY = items[5]; - return f.update(); - }, - update: function() { - if (this.isSFW) { - this.unread = this.unreadSFW; - return this.unreadY = this.unreadSFWY; - } else { - this.unread = this.unreadNSFW; - return this.unreadY = this.unreadNSFWY; - } - }, - SFW: '//s.4cdn.org/image/favicon-ws.ico', - NSFW: '//s.4cdn.org/image/favicon.ico', - dead: 'data:image/gif;base64,R0lGODlhEAAQAKECAAAAAP8AAP///////yH5BAEKAAIALAAAAAAQABAAAAIvlI+pq+D9DAgUoFkPDlbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw==', - logo: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACAAgMAAAC+UIlYAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAGlJREFUWMPtlkEKADEIA/tJP9lXLttQto2yHxgDHozTi0ToGK2WKZZ+HAQQMZc+xBwI4EZ+wAC2IfPuSIDOZJrSZQEAX9eVJhhwIuUYAnQe8rhAEMAZlTI2MID9f5Clyh0JeE1V1ZEAvB4qDfwuJTSGRAAAAABJRU5ErkJggg==' - }; - - return Favicon; - -}).call(this); - -MarkNewIPs = (function() { - var MarkNewIPs; - - MarkNewIPs = { - init: function() { - if (!(g.SITE.software === 'yotsuba' && g.VIEW === 'thread' && Conf['Mark New IPs'])) { - return; - } - return Callbacks.Thread.push({ - name: 'Mark New IPs', - cb: this.node - }); - }, - node: function() { - MarkNewIPs.ipCount = this.ipCount; - MarkNewIPs.postCount = this.posts.keys.length; - return $.on(d, 'ThreadUpdate', MarkNewIPs.onUpdate); - }, - onUpdate: function(e) { - var deletedPosts, fullID, i, ipCount, j, k, len, len1, newPosts, postCount, ref; - ref = e.detail, ipCount = ref.ipCount, postCount = ref.postCount, newPosts = ref.newPosts, deletedPosts = ref.deletedPosts; - if (ipCount == null) { - return; - } - switch (ipCount - MarkNewIPs.ipCount) { - case postCount - MarkNewIPs.postCount + deletedPosts.length: - i = MarkNewIPs.ipCount; - for (j = 0, len = newPosts.length; j < len; j++) { - fullID = newPosts[j]; - MarkNewIPs.markNew(g.posts.get(fullID), ++i); - } - break; - case -deletedPosts.length: - for (k = 0, len1 = newPosts.length; k < len1; k++) { - fullID = newPosts[k]; - MarkNewIPs.markOld(g.posts.get(fullID)); - } - } - MarkNewIPs.ipCount = ipCount; - return MarkNewIPs.postCount = postCount; - }, - markNew: function(post, ipCount) { - var counter, suffix; - suffix = (Math.floor(ipCount / 10)) % 10 === 1 ? 'th' : ['st', 'nd', 'rd'][ipCount % 10 - 1] || 'th'; - counter = $.el('span', { - className: 'ip-counter', - textContent: "(" + ipCount + ")" - }); - post.nodes.nameBlock.title = "This is the " + ipCount + suffix + " IP in the thread."; - $.add(post.nodes.nameBlock, [$.tn(' '), counter]); - return $.addClass(post.nodes.root, 'new-ip'); - }, - markOld: function(post) { - post.nodes.nameBlock.title = 'Not the first post from this IP.'; - return $.addClass(post.nodes.root, 'old-ip'); - } - }; - - return MarkNewIPs; - -}).call(this); - -ReplyPruning = (function() { - var ReplyPruning; - - ReplyPruning = { - init: function() { - var el, label; - if (!(g.VIEW === 'thread' && Conf['Reply Pruning'])) { - return; - } - this.container = $.frag(); - this.summary = $.el('span', { - hidden: true, - className: 'summary' - }); - this.summary.style.cursor = 'pointer'; - $.on(this.summary, 'click', (function(_this) { - return function() { - _this.inputs.enabled.checked = !_this.inputs.enabled.checked; - return $.event('change', null, _this.inputs.enabled); - }; - })(this)); - label = UI.checkbox('Prune Replies', 'Show Last', Conf['Prune All Threads']); - el = $.el('span', { - title: 'Maximum number of replies to show.' - }, {innerHTML: " "}); - $.prepend(el, label); - this.inputs = { - enabled: label.firstElementChild, - replies: el.lastElementChild - }; - this.setEnabled.call(this.inputs.enabled); - $.on(this.inputs.enabled, 'change', this.setEnabled); - $.on(this.inputs.replies, 'change', $.cb.value); - Header.menu.addEntry({ - el: el, - order: 190 - }); - return Callbacks.Thread.push({ - name: 'Reply Pruning', - cb: this.node - }); - }, - position: 0, - hidden: 0, - hiddenFiles: 0, - total: 0, - totalFiles: 0, - setEnabled: function() { - var other; - other = QuoteThreading.input; - if (this.checked && (other != null ? other.checked : void 0)) { - other.checked = false; - $.event('change', null, other); - } - return ReplyPruning.active = this.checked; - }, - showIfHidden: function(id) { - if (ReplyPruning.container && $("#" + id, ReplyPruning.container)) { - ReplyPruning.inputs.enabled.checked = false; - return $.event('change', null, ReplyPruning.inputs.enabled); - } - }, - node: function() { - var ref; - ReplyPruning.thread = this; - if (this.isSticky) { - ReplyPruning.active = ReplyPruning.inputs.enabled.checked = true; - if (QuoteThreading.input) { - Conf['Thread Quotes'] = QuoteThreading.input.checked = false; - } - } - this.posts.forEach(function(post) { - if (post.isReply) { - ReplyPruning.total++; - if (post.file) { - return ReplyPruning.totalFiles++; - } - } - }); - if (ReplyPruning.active && /^#p\d+$/.test(location.hash) && (1 <= (ref = this.posts.keys.indexOf(location.hash.slice(2))) && ref < 1 + Math.max(ReplyPruning.total - +Conf["Max Replies"], 0))) { - ReplyPruning.active = ReplyPruning.inputs.enabled.checked = false; - } - $.after(this.OP.nodes.root, ReplyPruning.summary); - $.on(ReplyPruning.inputs.enabled, 'change', ReplyPruning.update); - $.on(ReplyPruning.inputs.replies, 'change', ReplyPruning.update); - $.on(d, 'ThreadUpdate', ReplyPruning.updateCount); - $.on(d, 'ThreadUpdate', ReplyPruning.update); - return ReplyPruning.update(); - }, - updateCount: function(e) { - var fullID, i, len, ref; - if (e.detail[404]) { - return; - } - ref = e.detail.newPosts; - for (i = 0, len = ref.length; i < len; i++) { - fullID = ref[i]; - ReplyPruning.total++; - if (g.posts.get(fullID).file) { - ReplyPruning.totalFiles++; - } - } - }, - update: function() { - var boardTop, frag, hidden1, hidden2, node, oldPos, post, posts; - hidden1 = ReplyPruning.hidden; - hidden2 = ReplyPruning.active ? Math.max(ReplyPruning.total - +Conf["Max Replies"], 0) : 0; - oldPos = d.body.clientHeight - window.scrollY; - posts = ReplyPruning.thread.posts; - if (ReplyPruning.hidden < hidden2) { - while (ReplyPruning.hidden < hidden2 && ReplyPruning.position < posts.keys.length) { - post = posts.get(posts.keys[ReplyPruning.position++]); - if (post.isReply && !post.isFetchedQuote) { - while ((node = ReplyPruning.summary.nextSibling) && node !== post.nodes.root) { - $.add(ReplyPruning.container, node); - } - $.add(ReplyPruning.container, post.nodes.root); - ReplyPruning.hidden++; - if (post.file) { - ReplyPruning.hiddenFiles++; - } - } - } - } else if (ReplyPruning.hidden > hidden2) { - frag = $.frag(); - while (ReplyPruning.hidden > hidden2 && ReplyPruning.position > 0) { - post = posts.get(posts.keys[--ReplyPruning.position]); - if (post.isReply && !post.isFetchedQuote) { - while ((node = ReplyPruning.container.lastChild) && node !== post.nodes.root) { - $.prepend(frag, node); - } - $.prepend(frag, post.nodes.root); - ReplyPruning.hidden--; - if (post.file) { - ReplyPruning.hiddenFiles--; - } - } - } - $.after(ReplyPruning.summary, frag); - $.event('PostsInserted', null, ReplyPruning.summary.parentNode); - } - ReplyPruning.summary.textContent = ReplyPruning.active ? g.SITE.Build.summaryText('+', ReplyPruning.hidden, ReplyPruning.hiddenFiles) : g.SITE.Build.summaryText('-', ReplyPruning.total, ReplyPruning.totalFiles); - ReplyPruning.summary.hidden = ReplyPruning.total <= +Conf["Max Replies"]; - if (hidden1 !== hidden2 && (boardTop = Header.getTopOf($('.board'))) < 0) { - return window.scrollBy(0, Math.max(d.body.clientHeight - oldPos, window.scrollY + boardTop) - window.scrollY); - } - } - }; - - return ReplyPruning; - -}).call(this); - -ThreadStats = (function() { - var ThreadStats; - - ThreadStats = { - postCount: 0, - fileCount: 0, - postIndex: 0, - init: function() { - var base, sc, statsHTML, statsTitle; - if (g.VIEW !== 'thread' || !Conf['Thread Stats']) { - return; - } - if (Conf['Page Count in Stats']) { - this[(typeof (base = g.SITE).isPrunedByAge === "function" ? base.isPrunedByAge(g.BOARD) : void 0) ? 'showPurgePos' : 'showPage'] = true; - } - statsHTML = {innerHTML: "? / ?" + ((Conf["IP Count in Stats"] && g.SITE.hasIPCount) ? " / ?" : "") + ((Conf["Page Count in Stats"]) ? " / ?" : "")}; - statsTitle = 'Posts / Files'; - if (Conf['IP Count in Stats'] && g.SITE.hasIPCount) { - statsTitle += ' / IPs'; - } - if (Conf['Page Count in Stats']) { - statsTitle += (this.showPurgePos ? ' / Purge Position' : ' / Page'); - } - if (Conf['Updater and Stats in Header']) { - this.dialog = sc = $.el('span', { - id: 'thread-stats', - title: statsTitle - }); - $.extend(sc, statsHTML); - Header.addShortcut('stats', sc, 200); - } else { - this.dialog = sc = UI.dialog('thread-stats', {innerHTML: "
        " + (statsHTML).innerHTML + "
        "}); - $.addClass(doc, 'float'); - $.ready(function() { - return $.add(d.body, sc); - }); - } - this.postCountEl = $('#post-count', sc); - this.fileCountEl = $('#file-count', sc); - this.ipCountEl = $('#ip-count', sc); - this.pageCountEl = $('#page-count', sc); - if (this.pageCountEl) { - $.on(this.pageCountEl, 'click', ThreadStats.fetchPage); - } - return Callbacks.Thread.push({ - name: 'Thread Stats', - cb: this.node - }); - }, - node: function() { - ThreadStats.thread = this; - ThreadStats.count(); - ThreadStats.update(); - ThreadStats.fetchPage(); - $.on(d, 'PostsInserted', function() { - return $.queueTask(ThreadStats.onPostsInserted); - }); - return $.on(d, 'ThreadUpdate', ThreadStats.onUpdate); - }, - count: function() { - var i, j, n, post, posts, ref, ref1; - posts = ThreadStats.thread.posts; - n = posts.keys.length; - for (i = j = ref = ThreadStats.postIndex, ref1 = n; j < ref1; i = j += 1) { - post = posts.get(posts.keys[i]); - if (!post.isFetchedQuote) { - ThreadStats.postCount++; - ThreadStats.fileCount += post.files.length; - } - } - return ThreadStats.postIndex = n; - }, - onUpdate: function(e) { - var fileCount, postCount, ref; - if (e.detail[404]) { - return; - } - ref = e.detail, postCount = ref.postCount, fileCount = ref.fileCount; - $.extend(ThreadStats, { - postCount: postCount, - fileCount: fileCount - }); - ThreadStats.postIndex = ThreadStats.thread.posts.keys.length; - ThreadStats.update(); - if (ThreadStats.showPage && ThreadStats.pageCountEl.textContent !== '1') { - return ThreadStats.fetchPage(); - } - }, - onPostsInserted: function() { - if (!(ThreadStats.thread.posts.keys.length > ThreadStats.postIndex)) { - return; - } - ThreadStats.count(); - ThreadStats.update(); - if (ThreadStats.showPage && ThreadStats.pageCountEl.textContent !== '1') { - return ThreadStats.fetchPage(); - } - }, - update: function() { - var fileCountEl, ipCountEl, postCountEl, ref, thread; - thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl, ipCountEl = ThreadStats.ipCountEl; - postCountEl.textContent = ThreadStats.postCount; - fileCountEl.textContent = ThreadStats.fileCount; - if (ipCountEl != null) { - ipCountEl.textContent = (ref = thread.ipCount) != null ? ref : '?'; - } - postCountEl.classList.toggle('warning', thread.postLimit && !thread.isSticky); - return fileCountEl.classList.toggle('warning', thread.fileLimit && !thread.isSticky); - }, - fetchPage: function() { - if (!ThreadStats.pageCountEl) { - return; - } - clearTimeout(ThreadStats.timeout); - if (ThreadStats.thread.isDead) { - ThreadStats.pageCountEl.textContent = 'Dead'; - $.addClass(ThreadStats.pageCountEl, 'warning'); - return; - } - ThreadStats.timeout = setTimeout(ThreadStats.fetchPage, 2 * $.MINUTE); - return $.whenModified(g.SITE.urls.threadsListJSON(ThreadStats.thread), 'ThreadStats', ThreadStats.onThreadsLoad); - }, - onThreadsLoad: function() { - var i, j, k, l, len, len1, len2, len3, len4, m, nThreads, o, page, pageNum, purgePos, ref, ref1, ref2, ref3, ref4, thread; - if (this.status === 200) { - if (ThreadStats.showPurgePos) { - purgePos = 1; - ref = this.response; - for (j = 0, len = ref.length; j < len; j++) { - page = ref[j]; - ref1 = page.threads; - for (k = 0, len1 = ref1.length; k < len1; k++) { - thread = ref1[k]; - if (thread.no < ThreadStats.thread.ID) { - purgePos++; - } - } - } - ThreadStats.pageCountEl.textContent = purgePos; - return ThreadStats.pageCountEl.classList.toggle('warning', purgePos === 1); - } else { - i = nThreads = 0; - ref2 = this.response; - for (l = 0, len2 = ref2.length; l < len2; l++) { - page = ref2[l]; - nThreads += page.threads.length; - } - ref3 = this.response; - for (pageNum = m = 0, len3 = ref3.length; m < len3; pageNum = ++m) { - page = ref3[pageNum]; - ref4 = page.threads; - for (o = 0, len4 = ref4.length; o < len4; o++) { - thread = ref4[o]; - if (thread.no === ThreadStats.thread.ID) { - ThreadStats.pageCountEl.textContent = pageNum + 1; - ThreadStats.pageCountEl.classList.toggle('warning', i >= nThreads - this.response[0].threads.length); - ThreadStats.lastPageUpdate = new Date(thread.last_modified * $.SECOND); - ThreadStats.retry(); - return; - } - i++; - } - } - } - } else if (this.status === 304) { - return ThreadStats.retry(); - } - }, - retry: function() { - if (!(ThreadStats.showPage && ThreadStats.pageCountEl.textContent !== '1' && !g.SITE.threadModTimeIgnoresSage && ThreadStats.thread.posts.get(ThreadStats.thread.lastPost).info.date > ThreadStats.lastPageUpdate)) { - return; - } - clearTimeout(ThreadStats.timeout); - return ThreadStats.timeout = setTimeout(ThreadStats.fetchPage, 5 * $.SECOND); - } - }; - - return ThreadStats; - -}).call(this); - -ThreadUpdater = (function() { - var ThreadUpdater, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - ThreadUpdater = { - init: function() { - var conf, el, input, name, ref, sc, subEntries, updateLink; - if (g.VIEW !== 'thread' || !Conf['Thread Updater']) { - return; - } - this.enabled = true; - this.audio = $.el('audio'); - if ($.engine !== 'gecko') { - this.audio.src = this.beep; - } - if (Conf['Updater and Stats in Header']) { - this.dialog = sc = $.el('span', { - id: 'updater' - }); - $.extend(sc, {innerHTML: ""}); - Header.addShortcut('updater', sc, 100); - } else { - this.dialog = sc = UI.dialog('updater', {innerHTML: "
        "}); - $.addClass(doc, 'float'); - $.ready(function() { - return $.add(d.body, sc); - }); - } - this.checkPostCount = 0; - this.timer = $('#update-timer', sc); - this.status = $('#update-status', sc); - $.on(this.timer, 'click', this.update); - $.on(this.status, 'click', this.update); - updateLink = $.el('span', { - className: 'brackets-wrap updatelink' - }); - $.extend(updateLink, {innerHTML: "Update"}); - Main.ready(function() { - var navLinksBot; - if ((navLinksBot = $('.navLinksBot'))) { - return $.add(navLinksBot, [$.tn(' '), updateLink]); - } - }); - $.on(updateLink.firstElementChild, 'click', this.update); - subEntries = []; - ref = Config.updater.checkbox; - for (name in ref) { - conf = ref[name]; - el = UI.checkbox(name, name); - el.title = conf[1]; - input = el.firstElementChild; - $.on(input, 'change', $.cb.checked); - if (input.name === 'Scroll BG') { - $.on(input, 'change', this.cb.scrollBG); - this.cb.scrollBG(); - } else if (input.name === 'Auto Update') { - $.on(input, 'change', this.setInterval); - } - subEntries.push({ - el: el - }); - } - this.settings = $.el('span', {innerHTML: "Interval"}); - $.on(this.settings, 'click', this.intervalShortcut); - subEntries.push({ - el: this.settings - }); - Header.menu.addEntry(this.entry = { - el: $.el('span', { - textContent: 'Updater' - }), - order: 110, - subEntries: subEntries - }); - return Callbacks.Thread.push({ - name: 'Thread Updater', - cb: this.node - }); - }, - node: function() { - ThreadUpdater.thread = this; - ThreadUpdater.root = this.nodes.root; - ThreadUpdater.outdateCount = 0; - ThreadUpdater.postIDs = []; - ThreadUpdater.fileIDs = []; - this.posts.forEach(function(post) { - ThreadUpdater.postIDs.push(post.ID); - if (post.file) { - return ThreadUpdater.fileIDs.push(post.ID); - } - }); - ThreadUpdater.cb.interval.call($.el('input', { - value: Conf['Interval'] - })); - $.on(d, 'QRPostSuccessful', ThreadUpdater.cb.checkpost); - $.on(d, 'visibilitychange', ThreadUpdater.cb.visibility); - return ThreadUpdater.setInterval(); - }, - - /* - http://freesound.org/people/pierrecartoons1979/sounds/90112/ - cc-by-nc-3.0 - */ - beep: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA', - playBeep: function() { - var audio; - audio = ThreadUpdater.audio; - audio.src || (audio.src = ThreadUpdater.beep); - if (audio.paused) { - return audio.play(); - } else { - return $.one(audio, 'ended', ThreadUpdater.playBeep); - } - }, - cb: { - checkpost: function(e) { - if (e.detail.threadID !== ThreadUpdater.thread.ID) { - return; - } - ThreadUpdater.postID = e.detail.postID; - ThreadUpdater.checkPostCount = 0; - ThreadUpdater.outdateCount = 0; - return ThreadUpdater.setInterval(); - }, - visibility: function() { - if (d.hidden) { - return; - } - ThreadUpdater.outdateCount = 0; - if (ThreadUpdater.seconds > ThreadUpdater.interval) { - return ThreadUpdater.setInterval(); - } - }, - scrollBG: function() { - return ThreadUpdater.scrollBG = Conf['Scroll BG'] ? function() { - return true; - } : function() { - return !d.hidden; - }; - }, - interval: function(e) { - var val; - val = parseInt(this.value, 10); - if (val < 1) { - val = 1; - } - ThreadUpdater.interval = this.value = val; - if (e) { - return $.cb.value.call(this); - } - }, - load: function() { - if (this !== ThreadUpdater.req) { - return; - } - switch (this.status) { - case 200: - ThreadUpdater.parse(this); - if (ThreadUpdater.thread.isArchived) { - return ThreadUpdater.kill(); - } else { - return ThreadUpdater.setInterval(); - } - break; - case 404: - return $.ajax(g.SITE.urls.catalogJSON({ - boardID: ThreadUpdater.thread.board.ID - }), { - onloadend: function() { - var confirmed, i, k, len, len1, page, ref, ref1, thread; - if (this.status === 200) { - confirmed = true; - ref = this.response; - for (i = 0, len = ref.length; i < len; i++) { - page = ref[i]; - ref1 = page.threads; - for (k = 0, len1 = ref1.length; k < len1; k++) { - thread = ref1[k]; - if (thread.no === ThreadUpdater.thread.ID) { - confirmed = false; - break; - } - } - } - } else { - confirmed = false; - } - if (confirmed) { - return ThreadUpdater.kill(); - } else { - return ThreadUpdater.error(this); - } - } - }); - default: - return ThreadUpdater.error(this); - } - } - }, - kill: function() { - ThreadUpdater.thread.kill(); - ThreadUpdater.setInterval(); - return $.event('ThreadUpdate', { - 404: true, - threadID: ThreadUpdater.thread.fullID - }); - }, - error: function(req) { - if (req.status === 304) { - ThreadUpdater.set('status', ''); - } - ThreadUpdater.setInterval(); - if (!req.status) { - return ThreadUpdater.set('status', 'Connection Error', 'warning'); - } else if (req.status !== 304) { - return ThreadUpdater.set('status', req.statusText + " (" + req.status + ")", 'warning'); - } - }, - setInterval: function() { - var cur, interval, j, limit; - clearTimeout(ThreadUpdater.timeoutID); - if (ThreadUpdater.thread.isDead) { - ThreadUpdater.set('status', (ThreadUpdater.thread.isArchived ? 'Archived' : '404'), 'warning'); - ThreadUpdater.set('timer', ''); - return; - } - if (ThreadUpdater.postID && ThreadUpdater.checkPostCount < 5) { - ThreadUpdater.set('timer', '...', 'loading'); - ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * $.SECOND); - return; - } - if (!Conf['Auto Update']) { - ThreadUpdater.set('timer', 'Update'); - return; - } - interval = ThreadUpdater.interval; - if (Conf['Optional Increase']) { - limit = d.hidden ? 10 : 5; - j = Math.min(ThreadUpdater.outdateCount, limit); - cur = (Math.floor(interval * 0.1) || 1) * j * j; - ThreadUpdater.seconds = $.minmax(cur, interval, 300); - } else { - ThreadUpdater.seconds = interval; - } - return ThreadUpdater.timeout(); - }, - intervalShortcut: function() { - var settings; - Settings.open('Advanced'); - settings = $.id('fourchanx-settings'); - return $('input[name=Interval]', settings).focus(); - }, - set: function(name, text, klass) { - var el, node; - el = ThreadUpdater[name]; - if (node = el.firstChild) { - node.data = text; - } else { - el.textContent = text; - } - return el.className = klass != null ? klass : (text === '' ? 'empty' : ''); - }, - timeout: function() { - if (ThreadUpdater.seconds) { - ThreadUpdater.set('timer', ThreadUpdater.seconds); - ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); - } else { - ThreadUpdater.outdateCount++; - ThreadUpdater.update(); - } - return ThreadUpdater.seconds--; - }, - update: function() { - var oldReq; - clearTimeout(ThreadUpdater.timeoutID); - ThreadUpdater.set('timer', '...', 'loading'); - if ((oldReq = ThreadUpdater.req)) { - delete ThreadUpdater.req; - oldReq.abort(); - } - return ThreadUpdater.req = $.whenModified(g.SITE.urls.threadJSON({ - boardID: ThreadUpdater.thread.board.ID, - threadID: ThreadUpdater.thread.ID - }), 'ThreadUpdater', ThreadUpdater.cb.load, { - timeout: $.MINUTE - }); - }, - updateThreadStatus: function(type, status) { - var change, hasChanged; - if (!(hasChanged = ThreadUpdater.thread["is" + type] !== status)) { - return; - } - ThreadUpdater.thread.setStatus(type, status); - if (type === 'Closed' && ThreadUpdater.thread.isArchived) { - return; - } - change = type === 'Sticky' ? status ? 'now a sticky' : 'not a sticky anymore' : status ? 'now closed' : 'not closed anymore'; - return new Notice('info', "The thread is " + change + ".", 30); - }, - parse: function(req) { - var ID, OP, board, deletedFiles, deletedPosts, files, firstPost, i, index, ipCountEl, k, l, lastPost, len, len1, len2, len3, m, newPosts, node, post, postObject, postObjects, posts, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, scroll, thread, unreadCount, unreadQYCount; - postObjects = req.response.posts; - OP = postObjects[0]; - thread = ThreadUpdater.thread; - board = thread.board; - ref = ThreadUpdater.postIDs, lastPost = ref[ref.length - 1]; - if (postObjects[postObjects.length - 1].no < lastPost && new Date(req.getResponseHeader('Last-Modified')) - thread.posts.get(lastPost).info.date < 30 * $.SECOND) { - return; - } - g.SITE.Build.spoilerRange[board] = OP.custom_spoiler; - thread.setStatus('Archived', !!OP.archived); - ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky); - ThreadUpdater.updateThreadStatus('Closed', !!OP.closed); - thread.postLimit = !!OP.bumplimit; - thread.fileLimit = !!OP.imagelimit; - if (OP.unique_ips != null) { - thread.ipCount = OP.unique_ips; - } - posts = []; - index = []; - files = []; - newPosts = []; - for (i = 0, len = postObjects.length; i < len; i++) { - postObject = postObjects[i]; - ID = postObject.no; - index.push(ID); - if (postObject.fsize) { - files.push(ID); - } - if (ID <= lastPost) { - continue; - } - if ((post = thread.posts.get(ID)) && !post.isFetchedQuote) { - post.resurrect(); - continue; - } - newPosts.push(board + "." + ID); - node = g.SITE.Build.postFromObject(postObject, board.ID); - posts.push(new Post(node, thread, board)); - if (ThreadUpdater.postID === ID) { - delete ThreadUpdater.postID; - } - } - deletedPosts = []; - ref1 = ThreadUpdater.postIDs; - for (k = 0, len1 = ref1.length; k < len1; k++) { - ID = ref1[k]; - if (!(indexOf.call(index, ID) < 0)) { - continue; - } - thread.posts.get(ID).kill(); - deletedPosts.push(board + "." + ID); - } - ThreadUpdater.postIDs = index; - deletedFiles = []; - ref2 = ThreadUpdater.fileIDs; - for (l = 0, len2 = ref2.length; l < len2; l++) { - ID = ref2[l]; - if (!(!(indexOf.call(files, ID) >= 0 || (ref3 = board + "." + ID, indexOf.call(deletedPosts, ref3) >= 0)))) { - continue; - } - thread.posts.get(ID).kill(true); - deletedFiles.push(board + "." + ID); - } - ThreadUpdater.fileIDs = files; - if (!posts.length) { - ThreadUpdater.set('status', ''); - } else { - ThreadUpdater.set('status', "+" + posts.length, 'new'); - ThreadUpdater.outdateCount = 0; - unreadCount = (ref4 = Unread.posts) != null ? ref4.size : void 0; - unreadQYCount = (ref5 = Unread.postsQuotingYou) != null ? ref5.size : void 0; - Main.callbackNodes('Post', posts); - if (d.hidden || !d.hasFocus()) { - if (Conf['Beep Quoting You'] && ((ref6 = Unread.postsQuotingYou) != null ? ref6.size : void 0) > unreadQYCount) { - ThreadUpdater.playBeep(); - if (Conf['Beep']) { - ThreadUpdater.playBeep(); - } - } else if (Conf['Beep'] && ((ref7 = Unread.posts) != null ? ref7.size : void 0) > 0 && unreadCount === 0) { - ThreadUpdater.playBeep(); - } - } - scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25; - firstPost = null; - for (m = 0, len3 = posts.length; m < len3; m++) { - post = posts[m]; - if (!QuoteThreading.insert(post)) { - firstPost || (firstPost = post.nodes.root); - $.add(ThreadUpdater.root, post.nodes.root); - } - } - $.event('PostsInserted', null, ThreadUpdater.root); - if (scroll) { - if (Conf['Bottom Scroll']) { - window.scrollTo(0, d.body.clientHeight); - } else { - if (firstPost) { - Header.scrollTo(firstPost); - } - } - } - } - if ((OP.unique_ips != null) && (ipCountEl = $.id('unique-ips'))) { - ipCountEl.textContent = OP.unique_ips; - ipCountEl.previousSibling.textContent = ipCountEl.previousSibling.textContent.replace(/\b(?:is|are)\b/, OP.unique_ips === 1 ? 'is' : 'are'); - ipCountEl.nextSibling.textContent = ipCountEl.nextSibling.textContent.replace(/\bposters?\b/, OP.unique_ips === 1 ? 'poster' : 'posters'); - } - return $.event('ThreadUpdate', { - 404: false, - threadID: thread.fullID, - newPosts: newPosts, - deletedPosts: deletedPosts, - deletedFiles: deletedFiles, - postCount: OP.replies + 1, - fileCount: OP.images + !!OP.fsize, - ipCount: OP.unique_ips - }); - } - }; - - return ThreadUpdater; - -}).call(this); - -ThreadWatcher = (function() { - var ThreadWatcher, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - slice = [].slice; - - ThreadWatcher = { - init: function() { - var ref, sc; - if (!(this.enabled = Conf['Thread Watcher'])) { - return; - } - this.shortcut = sc = $.el('a', { - id: 'watcher-link', - textContent: 'Watcher', - title: 'Thread Watcher', - href: 'javascript:;', - className: 'fa fa-eye' - }); - this.db = new DataBoard('watchedThreads', this.refresh, true); - this.dbLM = new DataBoard('watcherLastModified', null, true); - this.dialog = UI.dialog('thread-watcher', {innerHTML: "
        Thread Watcher ×
        "}); - this.status = $('#watcher-status', this.dialog); - this.list = this.dialog.lastElementChild; - this.refreshButton = $('.refresh', this.dialog); - this.closeButton = $('.move > .close', this.dialog); - this.unreaddb = Unread.db || UnreadIndex.db || new DataBoard('lastReadPosts'); - this.unreadEnabled = Conf['Remember Last Read Post']; - $.on(d, 'QRPostSuccessful', this.cb.post); - $.on(sc, 'click', this.toggleWatcher); - $.on(this.refreshButton, 'click', this.buttonFetchAll); - $.on(this.closeButton, 'click', this.toggleWatcher); - this.menu.addHeaderMenuEntry(); - $.onExists(doc, 'body', this.addDialog); - switch (g.VIEW) { - case 'index': - $.on(d, 'IndexUpdate', this.cb.onIndexUpdate); - break; - case 'thread': - $.on(d, 'ThreadUpdate', this.cb.onThreadRefresh); - } - if (Conf['Fixed Thread Watcher']) { - $.addClass(doc, 'fixed-watcher'); - } - if (!Conf['Persistent Thread Watcher']) { - $.addClass(ThreadWatcher.shortcut, 'disabled'); - this.dialog.hidden = true; - } - Header.addShortcut('watcher', sc, 510); - ThreadWatcher.initLastModified(); - ThreadWatcher.fetchAuto(); - $.on(window, 'visibilitychange focus', function() { - return $.queueTask(ThreadWatcher.fetchAuto); - }); - if (Conf['Menu'] && Index.enabled) { - Menu.menu.addEntry({ - el: $.el('a', { - href: 'javascript:;', - className: 'has-shortcut-text' - }, {innerHTML: "Alt+click"}), - order: 6, - open: function(arg) { - var thread; - thread = arg.thread; - if (Conf['Index Mode'] !== 'catalog') { - return false; - } - this.el.firstElementChild.textContent = ThreadWatcher.isWatched(thread) ? 'Unwatch' : 'Watch'; - if (this.cb) { - $.off(this.el, 'click', this.cb); - } - this.cb = function() { - $.event('CloseMenu'); - return ThreadWatcher.toggle(thread); - }; - $.on(this.el, 'click', this.cb); - return true; - } - }); - } - if ((ref = g.VIEW) !== 'index' && ref !== 'thread') { - return; - } - Callbacks.Post.push({ - name: 'Thread Watcher', - cb: this.node - }); - return Callbacks.CatalogThread.push({ - name: 'Thread Watcher', - cb: this.catalogNode - }); - }, - isWatched: function(thread) { - var ref; - return !!((ref = ThreadWatcher.db) != null ? ref.get({ - boardID: thread.board.ID, - threadID: thread.ID - }) : void 0); - }, - isWatchedRaw: function(boardID, threadID) { - var ref; - return !!((ref = ThreadWatcher.db) != null ? ref.get({ - boardID: boardID, - threadID: threadID - }) : void 0); - }, - setToggler: function(toggler, isWatched) { - toggler.classList.toggle('watched', isWatched); - return toggler.title = (isWatched ? 'Unwatch' : 'Watch') + " Thread"; - }, - node: function() { - var boardID, data, siteID, threadID, toggler; - if (this.isReply) { - return; - } - if (this.isClone) { - toggler = $('.watch-thread-link', this.nodes.info); - } else { - toggler = $.el('a', { - href: 'javascript:;', - className: 'watch-thread-link' - }); - $.before($('input', this.nodes.info), toggler); - } - siteID = g.SITE.ID; - boardID = this.board.ID; - threadID = this.thread.ID; - data = ThreadWatcher.db.get({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }); - ThreadWatcher.setToggler(toggler, !!data); - $.on(toggler, 'click', ThreadWatcher.cb.toggle); - if (data && (data.excerpt == null)) { - return $.queueTask((function(_this) { - return function() { - return ThreadWatcher.update(siteID, boardID, threadID, { - excerpt: Get.threadExcerpt(_this.thread) - }); - }; - })(this)); - } - }, - catalogNode: function() { - if (ThreadWatcher.isWatched(this.thread)) { - $.addClass(this.nodes.root, 'watched'); - } - return $.on(this.nodes.root, 'mousedown click', (function(_this) { - return function(e) { - if (!(e.button === 0 && e.altKey)) { - return; - } - if (e.type === 'click') { - ThreadWatcher.toggle(_this.thread); - } - return e.preventDefault(); - }; - })(this)); - }, - addDialog: function() { - if (!Main.isThisPageLegit()) { - return; - } - ThreadWatcher.build(); - return $.prepend(d.body, ThreadWatcher.dialog); - }, - toggleWatcher: function() { - $.toggleClass(ThreadWatcher.shortcut, 'disabled'); - return ThreadWatcher.dialog.hidden = !ThreadWatcher.dialog.hidden; - }, - cb: { - openAll: function() { - var a, j, len1, ref; - if ($.hasClass(this, 'disabled')) { - return; - } - ref = $$('a.watcher-link', ThreadWatcher.list); - for (j = 0, len1 = ref.length; j < len1; j++) { - a = ref[j]; - $.open(a.href); - } - return $.event('CloseMenu'); - }, - openUnread: function() { - var a, j, len1, ref; - if ($.hasClass(this, 'disabled')) { - return; - } - ref = $$('.replies-unread > a.watcher-link', ThreadWatcher.list); - for (j = 0, len1 = ref.length; j < len1; j++) { - a = ref[j]; - $.open(a.href); - } - return $.event('CloseMenu'); - }, - openDeads: function() { - var a, j, len1, ref; - if ($.hasClass(this, 'disabled')) { - return; - } - ref = $$('.dead-thread > a.watcher-link', ThreadWatcher.list); - for (j = 0, len1 = ref.length; j < len1; j++) { - a = ref[j]; - $.open(a.href); - } - return $.event('CloseMenu'); - }, - pruneDeads: function() { - var boardID, data, j, len1, ref, ref1, siteID, threadID; - if ($.hasClass(this, 'disabled')) { - return; - } - ref = ThreadWatcher.getAll(); - for (j = 0, len1 = ref.length; j < len1; j++) { - ref1 = ref[j], siteID = ref1.siteID, boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data; - if (data.isDead) { - ThreadWatcher.db["delete"]({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }); - } - } - ThreadWatcher.refresh(); - return $.event('CloseMenu'); - }, - dismiss: function() { - var boardID, data, j, len1, ref, ref1, siteID, threadID; - ref = ThreadWatcher.getAll(); - for (j = 0, len1 = ref.length; j < len1; j++) { - ref1 = ref[j], siteID = ref1.siteID, boardID = ref1.boardID, threadID = ref1.threadID, data = ref1.data; - if (data.quotingYou) { - ThreadWatcher.update(siteID, boardID, threadID, { - dismiss: data.quotingYou || 0 - }); - } - } - return $.event('CloseMenu'); - }, - toggle: function() { - var thread; - thread = Get.postFromNode(this).thread; - return ThreadWatcher.toggle(thread); - }, - rm: function() { - var boardID, ref, siteID, threadID; - siteID = this.parentNode.dataset.siteID; - ref = this.parentNode.dataset.fullID.split('.'), boardID = ref[0], threadID = ref[1]; - return ThreadWatcher.rm(siteID, boardID, +threadID); - }, - post: function(e) { - var boardID, cb, postID, ref, threadID; - ref = e.detail, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID; - cb = PostRedirect.delay(); - if (postID === threadID) { - if (Conf['Auto Watch']) { - return ThreadWatcher.addRaw(boardID, threadID, {}, cb); - } - } else if (Conf['Auto Watch Reply']) { - return ThreadWatcher.add(g.threads.get(boardID + '.' + threadID) || new Thread(threadID, g.boards[boardID] || new Board(boardID)), cb); - } - }, - onIndexUpdate: function(e) { - var boardID, data, db, nKilled, ref, ref1, siteID, threadID; - db = ThreadWatcher.db; - siteID = g.SITE.ID; - boardID = g.BOARD.ID; - nKilled = 0; - ref = db.data[siteID].boards[boardID]; - for (threadID in ref) { - data = ref[threadID]; - if (!(!(data != null ? data.isDead : void 0) && (ref1 = boardID + "." + threadID, indexOf.call(e.detail.threads, ref1) < 0))) { - continue; - } - if (!e.detail.threads.some(function(fullID) { - return +fullID.split('.')[1] > threadID; - })) { - continue; - } - if (Conf['Auto Prune'] || !(data && typeof data === 'object')) { - db["delete"]({ - boardID: boardID, - threadID: threadID - }); - nKilled++; - } else { - ThreadWatcher.fetchStatus({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - data: data - }); - } - } - if (nKilled) { - return ThreadWatcher.refresh(); - } - }, - onThreadRefresh: function(e) { - var thread; - thread = g.threads.get(e.detail.threadID); - if (!(e.detail[404] && ThreadWatcher.isWatched(thread))) { - return; - } - return ThreadWatcher.add(thread); - } - }, - requests: [], - fetched: 0, - fetch: function(url, arg, args, cb) { - var ajax, force, onloadend, ref, req, siteID; - siteID = arg.siteID, force = arg.force; - if (ThreadWatcher.requests.length === 0) { - ThreadWatcher.status.textContent = '...'; - $.addClass(ThreadWatcher.refreshButton, 'fa-spin'); - } - onloadend = function() { - if (this.finished) { - return; - } - this.finished = true; - ThreadWatcher.fetched++; - if (ThreadWatcher.fetched === ThreadWatcher.requests.length) { - ThreadWatcher.clearRequests(); - } else { - ThreadWatcher.status.textContent = (Math.round(ThreadWatcher.fetched / ThreadWatcher.requests.length * 100)) + "%"; - } - return cb.apply(this, args); - }; - ajax = siteID === g.SITE.ID ? $.ajax : CrossOrigin.ajax; - if (force) { - if ((ref = $.lastModified.ThreadWatcher) != null) { - delete ref[url]; - } - } - req = $.whenModified(url, 'ThreadWatcher', onloadend, { - timeout: $.MINUTE, - ajax: ajax - }); - return ThreadWatcher.requests.push(req); - }, - clearRequests: function() { - ThreadWatcher.requests = []; - ThreadWatcher.fetched = 0; - ThreadWatcher.status.textContent = ''; - return $.rmClass(ThreadWatcher.refreshButton, 'fa-spin'); - }, - abort: function() { - var j, len1, ref, req; - delete ThreadWatcher.syncing; - ref = ThreadWatcher.requests; - for (j = 0, len1 = ref.length; j < len1; j++) { - req = ref[j]; - if (!(!req.finished)) { - continue; - } - req.finished = true; - req.abort(); - } - return ThreadWatcher.clearRequests(); - }, - initLastModified: function() { - var base, boardID, boards, data, date, lm, ref, ref1, siteID, url; - lm = ((base = $.lastModified)['ThreadWatcher'] || (base['ThreadWatcher'] = $.dict())); - ref = ThreadWatcher.dbLM.data; - for (siteID in ref) { - boards = ref[siteID]; - ref1 = boards.boards; - for (boardID in ref1) { - data = ref1[boardID]; - if (ThreadWatcher.db.get({ - siteID: siteID, - boardID: boardID - })) { - for (url in data) { - date = data[url]; - lm[url] = date; - } - } else { - ThreadWatcher.dbLM["delete"]({ - siteID: siteID, - boardID: boardID - }); - } - } - } - }, - fetchAuto: function() { - var db, interval, now, ref; - clearTimeout(ThreadWatcher.timeout); - if (!Conf['Auto Update Thread Watcher']) { - return; - } - db = ThreadWatcher.db; - interval = Conf['Show Page'] || (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) ? 5 * $.MINUTE : 2 * $.HOUR; - now = Date.now(); - if (!((now - interval < (ref = db.data.lastChecked || 0) && ref <= now) || d.hidden || !d.hasFocus())) { - ThreadWatcher.fetchAllStatus(interval); - } - return ThreadWatcher.timeout = setTimeout(ThreadWatcher.fetchAuto, interval); - }, - buttonFetchAll: function() { - if (ThreadWatcher.syncing || ThreadWatcher.requests.length) { - return ThreadWatcher.abort(); - } else { - return ThreadWatcher.fetchAllStatus(); - } - }, - fetchAllStatus: function(interval) { - var dbi, dbs, j, len1, n, results; - if (interval == null) { - interval = 0; - } - ThreadWatcher.status.textContent = '...'; - $.addClass(ThreadWatcher.refreshButton, 'fa-spin'); - ThreadWatcher.syncing = true; - dbs = [ThreadWatcher.db, ThreadWatcher.unreaddb, QuoteYou.db].filter(function(x) { - return x; - }); - n = 0; - results = []; - for (j = 0, len1 = dbs.length; j < len1; j++) { - dbi = dbs[j]; - results.push(dbi.forceSync(function() { - var board, boards, db, deep, k, len2, now, ref, ref1; - if ((++n) === dbs.length) { - if (!ThreadWatcher.syncing) { - return; - } - delete ThreadWatcher.syncing; - if (!((0 <= (ref = Date.now() - (ThreadWatcher.db.data.lastChecked || 0)) && ref < interval))) { - db = ThreadWatcher.db; - now = Date.now(); - deep = !((now - 2 * $.HOUR < (ref1 = db.data.lastChecked2 || 0) && ref1 <= now)); - boards = ThreadWatcher.getAll(true); - for (k = 0, len2 = boards.length; k < len2; k++) { - board = boards[k]; - ThreadWatcher.fetchBoard(board, deep); - } - db.setLastChecked(); - if (deep) { - db.setLastChecked('lastChecked2'); - } - } - if (ThreadWatcher.fetched === ThreadWatcher.requests.length) { - return ThreadWatcher.clearRequests(); - } - } - })); - } - return results; - }, - fetchBoard: function(board, deep) { - var base, boardID, data, force, j, len1, ref, site, siteID, thread, url, urlF; - if (!board.some(function(thread) { - return !thread.data.isDead; - })) { - return; - } - force = false; - for (j = 0, len1 = board.length; j < len1; j++) { - thread = board[j]; - data = thread.data; - if (!data.isDead && data.last !== -1) { - if (Conf['Show Page'] && (data.page == null)) { - force = true; - } - if (data.modified == null) { - force = thread.force = true; - } - } - } - ref = board[0], siteID = ref.siteID, boardID = ref.boardID; - site = g.sites[siteID]; - if (!site) { - return; - } - urlF = deep && site.threadModTimeIgnoresSage ? 'catalogJSON' : 'threadsListJSON'; - url = typeof (base = site.urls)[urlF] === "function" ? base[urlF]({ - siteID: siteID, - boardID: boardID - }) : void 0; - if (!url) { - return; - } - return ThreadWatcher.fetch(url, { - siteID: siteID, - force: force - }, [board, url], ThreadWatcher.parseBoard); - }, - parseBoard: function(board, url) { - var base, boardID, data, i, index, item, j, k, l, lastPage, len1, len2, len3, len4, lmDate, m, modified, nThreads, oldest, page, pageLength, ref, ref1, ref2, ref3, ref4, replies, siteID, thread, threadID, threads; - if (this.status !== 200) { - return; - } - ref = board[0], siteID = ref.siteID, boardID = ref.boardID; - lmDate = this.getResponseHeader('Last-Modified'); - ThreadWatcher.dbLM.extend({ - siteID: siteID, - boardID: boardID, - val: $.item(url, lmDate) - }); - threads = $.dict(); - pageLength = 0; - nThreads = 0; - oldest = null; - try { - pageLength = ((ref1 = this.response[0]) != null ? ref1.threads.length : void 0) || 0; - ref2 = this.response; - for (i = j = 0, len1 = ref2.length; j < len1; i = ++j) { - page = ref2[i]; - ref3 = page.threads; - for (k = 0, len2 = ref3.length; k < len2; k++) { - item = ref3[k]; - threads[item.no] = { - page: i + 1, - index: nThreads, - modified: item.last_modified, - replies: item.replies - }; - nThreads++; - if ((oldest == null) || item.no < oldest) { - oldest = item.no; - } - } - } - } catch (error) { - for (l = 0, len3 = board.length; l < len3; l++) { - thread = board[l]; - ThreadWatcher.fetchStatus(thread); - } - } - for (m = 0, len4 = board.length; m < len4; m++) { - thread = board[m]; - threadID = thread.threadID, data = thread.data; - if (threads[threadID]) { - ref4 = threads[threadID], page = ref4.page, index = ref4.index, modified = ref4.modified, replies = ref4.replies; - if (Conf['Show Page']) { - lastPage = (typeof (base = g.sites[siteID]).isPrunedByAge === "function" ? base.isPrunedByAge({ - siteID: siteID, - boardID: boardID - }) : void 0) ? threadID === oldest : index >= nThreads - pageLength; - ThreadWatcher.update(siteID, boardID, threadID, { - page: page, - lastPage: lastPage - }); - } - if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) { - if (modified !== data.modified || ((replies != null) && replies !== data.replies)) { - (thread.newData || (thread.newData = {})).modified = modified; - ThreadWatcher.fetchStatus(thread); - } - } - } else { - ThreadWatcher.fetchStatus(thread); - } - } - }, - fetchStatus: function(thread) { - var base, boardID, data, force, ref, siteID, threadID, url; - siteID = thread.siteID, boardID = thread.boardID, threadID = thread.threadID, data = thread.data, force = thread.force; - url = (ref = g.sites[siteID]) != null ? typeof (base = ref.urls).threadJSON === "function" ? base.threadJSON({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }) : void 0 : void 0; - if (!url) { - return; - } - if (data.isDead && !force) { - return; - } - if (data.last === -1) { - return; - } - return ThreadWatcher.fetch(url, { - siteID: siteID, - force: force - }, [thread], ThreadWatcher.parseStatus); - }, - parseStatus: function(thread, isArchiveURL) { - var archiveURL, base, boardID, data, force, isArchived, isDead, j, last, lastReadPost, len1, match, newData, postObj, quotesYou, quotingYou, ref, ref1, ref2, ref3, regexp, replies, site, siteID, threadID, unread, youOP; - siteID = thread.siteID, boardID = thread.boardID, threadID = thread.threadID, data = thread.data, newData = thread.newData, force = thread.force; - site = g.sites[siteID]; - if (this.status === 200 && this.response) { - last = this.response.posts[this.response.posts.length - 1].no; - replies = this.response.posts.length - 1; - isDead = isArchived = !!(this.response.posts[0].archived || isArchiveURL); - if (isDead && Conf['Auto Prune']) { - ThreadWatcher.rm(siteID, boardID, threadID); - return; - } - if (last === data.last && isDead === data.isDead && isArchived === data.isArchived) { - return; - } - lastReadPost = ThreadWatcher.unreaddb.get({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - defaultValue: 0 - }); - unread = data.unread || 0; - quotingYou = data.quotingYou || 0; - youOP = !!((ref = QuoteYou.db) != null ? ref.get({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - postID: threadID - }) : void 0); - ref1 = this.response.posts; - for (j = 0, len1 = ref1.length; j < len1; j++) { - postObj = ref1[j]; - if (!(postObj.no > (data.last || 0) && postObj.no > lastReadPost)) { - continue; - } - if ((ref2 = QuoteYou.db) != null ? ref2.get({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - postID: postObj.no - }) : void 0) { - continue; - } - quotesYou = false; - if (!Conf['Require OP Quote Link'] && youOP) { - quotesYou = true; - } else if (QuoteYou.db && postObj.com) { - regexp = site.regexp.quotelinkHTML; - regexp.lastIndex = 0; - while ((match = regexp.exec(postObj.com))) { - if (QuoteYou.db.get({ - siteID: siteID, - boardID: match[1] ? encodeURIComponent(match[1]) : boardID, - threadID: match[2] || threadID, - postID: match[3] || match[2] || threadID - })) { - quotesYou = true; - break; - } - } - } - if (!unread || (!quotingYou && quotesYou)) { - if (Filter.isHidden(site.Build.parseJSON(postObj, { - siteID: siteID, - boardID: boardID - }))) { - continue; - } - } - unread++; - if (quotesYou) { - quotingYou = postObj.no; - } - } - newData || (newData = {}); - $.extend(newData, { - last: last, - replies: replies, - isDead: isDead, - isArchived: isArchived, - unread: unread, - quotingYou: quotingYou - }); - return ThreadWatcher.update(siteID, boardID, threadID, newData); - } else if (this.status === 404) { - archiveURL = (ref3 = g.sites[siteID]) != null ? typeof (base = ref3.urls).archivedThreadJSON === "function" ? base.archivedThreadJSON({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }) : void 0 : void 0; - if (!isArchiveURL && archiveURL) { - return ThreadWatcher.fetch(archiveURL, { - siteID: siteID, - force: force - }, [thread, true], ThreadWatcher.parseStatus); - } else if (site.mayLackJSON && (data.last == null)) { - return ThreadWatcher.update(siteID, boardID, threadID, { - last: -1 - }); - } else { - return ThreadWatcher.update(siteID, boardID, threadID, { - isDead: true - }); - } - } - }, - getAll: function(groupByBoard) { - var all, boardID, boards, cont, data, ref, ref1, siteID, threadID, threads; - all = []; - ref = ThreadWatcher.db.data; - for (siteID in ref) { - boards = ref[siteID]; - ref1 = boards.boards; - for (boardID in ref1) { - threads = ref1[boardID]; - if (Conf['Current Board'] && (siteID !== g.SITE.ID || boardID !== g.BOARD.ID)) { - continue; - } - if (groupByBoard) { - all.push((cont = [])); - } - for (threadID in threads) { - data = threads[threadID]; - if (data && typeof data === 'object') { - (groupByBoard ? cont : all).push({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - data: data - }); - } - } - } - } - return all; - }, - makeLine: function(siteID, boardID, threadID, data) { - var count, div, excerpt, fullID, isArchived, link, page, ref, title, x; - x = $.el('a', { - className: 'fa fa-times', - href: 'javascript:;' - }); - $.on(x, 'click', ThreadWatcher.cb.rm); - excerpt = data.excerpt, isArchived = data.isArchived; - excerpt || (excerpt = "/" + boardID + "/ - No." + threadID); - if (Conf['Show Site Prefix']) { - excerpt = ThreadWatcher.prefixes[siteID] + excerpt; - } - link = $.el('a', { - href: ((ref = g.sites[siteID]) != null ? ref.urls.thread({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }, isArchived) : void 0) || '', - title: excerpt, - className: 'watcher-link' - }); - if (Conf['Show Page'] && (data.page != null)) { - page = $.el('span', { - textContent: "[" + data.page + "]", - className: 'watcher-page' - }); - $.add(link, page); - } - if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count'] && (data.unread != null)) { - count = $.el('span', { - textContent: "(" + data.unread + ")", - className: 'watcher-unread' - }); - $.add(link, count); - } - title = $.el('span', { - textContent: excerpt, - className: 'watcher-title' - }); - $.add(link, title); - div = $.el('div'); - fullID = boardID + "." + threadID; - div.dataset.fullID = fullID; - div.dataset.siteID = siteID; - if (g.VIEW === 'thread' && fullID === (g.BOARD + "." + g.THREADID)) { - $.addClass(div, 'current'); - } - if (data.isDead) { - $.addClass(div, 'dead-thread'); - } - if (Conf['Show Page']) { - if (data.lastPage) { - $.addClass(div, 'last-page'); - } - if (data.page != null) { - div.dataset.page = data.page; - } - } - if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) { - if (data.unread === 0) { - $.addClass(div, 'replies-read'); - } - if (data.unread) { - $.addClass(div, 'replies-unread'); - } - if ((data.quotingYou || 0) > (data.dismiss || 0)) { - $.addClass(div, 'replies-quoting-you'); - } - } - $.add(div, [x, $.tn(' '), link]); - return div; - }, - setPrefixes: function(threads) { - var conflicts, conflicts2, j, k, len, len1, len2, prefix, prefixes, siteID, siteID2; - prefixes = $.dict(); - for (j = 0, len1 = threads.length; j < len1; j++) { - siteID = threads[j].siteID; - if (siteID in prefixes) { - continue; - } - len = 0; - prefix = ''; - conflicts = Object.keys(prefixes); - while (conflicts.length > 0) { - len++; - prefix = siteID.slice(0, len); - conflicts2 = []; - for (k = 0, len2 = conflicts.length; k < len2; k++) { - siteID2 = conflicts[k]; - if (siteID2.slice(0, len) === prefix) { - conflicts2.push(siteID2); - } else if (prefixes[siteID2].length < len) { - prefixes[siteID2] = siteID2.slice(0, len); - } - } - conflicts = conflicts2; - } - prefixes[siteID] = prefix; - } - return ThreadWatcher.prefixes = prefixes; - }, - build: function() { - var boardID, data, j, len1, list, nodes, ref, siteID, thread, threadID, threads; - nodes = []; - threads = ThreadWatcher.getAll(); - ThreadWatcher.setPrefixes(threads); - for (j = 0, len1 = threads.length; j < len1; j++) { - ref = threads[j], siteID = ref.siteID, boardID = ref.boardID, threadID = ref.threadID, data = ref.data; - if ((data.excerpt == null) && siteID === g.SITE.ID && (thread = g.threads.get(boardID + "." + threadID)) && thread.OP) { - ThreadWatcher.db.extend({ - boardID: boardID, - threadID: threadID, - val: { - excerpt: Get.threadExcerpt(thread) - } - }); - } - nodes.push(ThreadWatcher.makeLine(siteID, boardID, threadID, data)); - } - list = ThreadWatcher.list; - $.rmAll(list); - $.add(list, nodes); - return ThreadWatcher.refreshIcon(); - }, - refresh: function() { - ThreadWatcher.build(); - g.threads.forEach(function(thread) { - var isWatched, j, len1, post, ref, toggler; - isWatched = ThreadWatcher.isWatched(thread); - if (thread.OP) { - ref = [thread.OP].concat(slice.call(thread.OP.clones)); - for (j = 0, len1 = ref.length; j < len1; j++) { - post = ref[j]; - if ((toggler = $('.watch-thread-link', post.nodes.info))) { - ThreadWatcher.setToggler(toggler, isWatched); - } - } - } - if (thread.catalogView) { - return thread.catalogView.nodes.root.classList.toggle('watched', isWatched); - } - }); - if (Conf['Pin Watched Threads']) { - return $.event('SortIndex', { - deferred: Conf['Index Mode'] !== 'catalog' - }); - } - }, - refreshIcon: function() { - var className, j, len1, ref; - ref = ['replies-unread', 'replies-quoting-you']; - for (j = 0, len1 = ref.length; j < len1; j++) { - className = ref[j]; - ThreadWatcher.shortcut.classList.toggle(className, !!$("." + className, ThreadWatcher.dialog)); - } - }, - update: function(siteID, boardID, threadID, newData) { - var data, j, key, len1, line, n, newLine, ref, ref1, val; - if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }) : void 0)) { - return; - } - if (newData.isDead && Conf['Auto Prune']) { - ThreadWatcher.rm(siteID, boardID, threadID); - return; - } - if (newData.isDead || newData.last === -1) { - ref1 = ['isArchived', 'page', 'lastPage', 'unread', 'quotingyou']; - for (j = 0, len1 = ref1.length; j < len1; j++) { - key = ref1[j]; - if (!(key in newData)) { - newData[key] = void 0; - } - } - } - if ((newData.last != null) && newData.last < data.last) { - newData.modified = void 0; - } - n = 0; - for (key in newData) { - val = newData[key]; - if (data[key] !== val) { - n++; - } - } - if (!n) { - return; - } - ThreadWatcher.db.extend({ - siteID: siteID, - boardID: boardID, - threadID: threadID, - val: newData - }); - if ((line = $("#watched-threads > [data-site-i-d='" + siteID + "'][data-full-i-d='" + boardID + "." + threadID + "']", ThreadWatcher.dialog))) { - newLine = ThreadWatcher.makeLine(siteID, boardID, threadID, data); - $.replace(line, newLine); - return ThreadWatcher.refreshIcon(); - } else { - return ThreadWatcher.refresh(); - } - }, - set404: function(boardID, threadID, cb) { - var data, ref; - if (!(data = (ref = ThreadWatcher.db) != null ? ref.get({ - boardID: boardID, - threadID: threadID - }) : void 0)) { - return cb(); - } - if (Conf['Auto Prune']) { - ThreadWatcher.db["delete"]({ - boardID: boardID, - threadID: threadID - }); - return cb(); - } - if (data.isDead && !((data.isArchived != null) || (data.page != null) || (data.lastPage != null) || (data.unread != null) || (data.quotingYou != null))) { - return cb(); - } - return ThreadWatcher.db.extend({ - boardID: boardID, - threadID: threadID, - val: { - isDead: true, - isArchived: void 0, - page: void 0, - lastPage: void 0, - unread: void 0, - quotingYou: void 0 - } - }, cb); - }, - toggle: function(thread) { - var boardID, siteID, threadID; - siteID = g.SITE.ID; - boardID = thread.board.ID; - threadID = thread.ID; - if (ThreadWatcher.db.get({ - boardID: boardID, - threadID: threadID - })) { - return ThreadWatcher.rm(siteID, boardID, threadID); - } else { - return ThreadWatcher.add(thread); - } - }, - add: function(thread, cb) { - var boardID, data, siteID, threadID; - data = {}; - siteID = g.SITE.ID; - boardID = thread.board.ID; - threadID = thread.ID; - if (thread.isDead) { - if (Conf['Auto Prune'] && ThreadWatcher.db.get({ - boardID: boardID, - threadID: threadID - })) { - ThreadWatcher.rm(siteID, boardID, threadID, cb); - return; - } - data.isDead = true; - } - if (thread.OP) { - data.excerpt = Get.threadExcerpt(thread); - } - return ThreadWatcher.addRaw(boardID, threadID, data, cb); - }, - addRaw: function(boardID, threadID, data, cb) { - var oldData, thread; - oldData = ThreadWatcher.db.get({ - boardID: boardID, - threadID: threadID, - defaultValue: $.dict() - }); - delete oldData.last; - delete oldData.modified; - $.extend(oldData, data); - ThreadWatcher.db.set({ - boardID: boardID, - threadID: threadID, - val: oldData - }, cb); - ThreadWatcher.refresh(); - thread = { - siteID: g.SITE.ID, - boardID: boardID, - threadID: threadID, - data: data, - force: true - }; - if (Conf['Show Page'] && !data.isDead) { - return ThreadWatcher.fetchBoard([thread]); - } else if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) { - return ThreadWatcher.fetchStatus(thread); - } - }, - rm: function(siteID, boardID, threadID, cb) { - ThreadWatcher.db["delete"]({ - siteID: siteID, - boardID: boardID, - threadID: threadID - }, cb); - return ThreadWatcher.refresh(); - }, - menu: { - init: function() { - var menu; - if (!Conf['Thread Watcher']) { - return; - } - menu = this.menu = new UI.Menu('thread watcher'); - $.on($('.menu-button', ThreadWatcher.dialog), 'click', function(e) { - return menu.toggle(e, this, ThreadWatcher); - }); - return this.addMenuEntries(); - }, - addHeaderMenuEntry: function() { - var entryEl; - if (g.VIEW !== 'thread') { - return; - } - entryEl = $.el('a', { - href: 'javascript:;' - }); - Header.menu.addEntry({ - el: entryEl, - order: 60, - open: function() { - var addClass, ref, rmClass, text; - ref = !!ThreadWatcher.db.get({ - boardID: g.BOARD.ID, - threadID: g.THREADID - }) ? ['unwatch-thread', 'watch-thread', 'Unwatch thread'] : ['watch-thread', 'unwatch-thread', 'Watch thread'], addClass = ref[0], rmClass = ref[1], text = ref[2]; - $.addClass(entryEl, addClass); - $.rmClass(entryEl, rmClass); - entryEl.textContent = text; - return true; - } - }); - return $.on(entryEl, 'click', function() { - return ThreadWatcher.toggle(g.threads.get(g.BOARD + "." + g.THREADID)); - }); - }, - addMenuEntries: function() { - var cb, conf, entries, entry, j, len1, name, open, ref, ref1, text, title; - entries = []; - entries.push({ - text: 'Open all threads', - cb: ThreadWatcher.cb.openAll, - open: function() { - this.el.classList.toggle('disabled', !ThreadWatcher.list.firstElementChild); - return true; - } - }); - entries.push({ - text: 'Open unread threads', - cb: ThreadWatcher.cb.openUnread, - open: function() { - this.el.classList.toggle('disabled', !$('.replies-unread', ThreadWatcher.list)); - return true; - } - }); - entries.push({ - text: 'Open dead threads', - cb: ThreadWatcher.cb.openDeads, - open: function() { - this.el.classList.toggle('disabled', !$('.dead-thread', ThreadWatcher.list)); - return true; - } - }); - entries.push({ - text: 'Prune dead threads', - cb: ThreadWatcher.cb.pruneDeads, - open: function() { - this.el.classList.toggle('disabled', !$('.dead-thread', ThreadWatcher.list)); - return true; - } - }); - entries.push({ - text: 'Dismiss posts quoting you', - title: 'Unhighlight the thread watcher icon and threads until there are new replies quoting you.', - cb: ThreadWatcher.cb.dismiss, - open: function() { - this.el.classList.toggle('disabled', !$.hasClass(ThreadWatcher.shortcut, 'replies-quoting-you')); - return true; - } - }); - for (j = 0, len1 = entries.length; j < len1; j++) { - ref = entries[j], text = ref.text, title = ref.title, cb = ref.cb, open = ref.open; - entry = { - el: $.el('a', { - textContent: text, - href: 'javascript:;' - }) - }; - if (title) { - entry.el.title = title; - } - $.on(entry.el, 'click', cb); - entry.open = open.bind(entry); - this.menu.addEntry(entry); - } - ref1 = Config.threadWatcher; - for (name in ref1) { - conf = ref1[name]; - this.addCheckbox(name, conf[1]); - } - }, - addCheckbox: function(name, desc) { - var entry, input; - entry = { - type: 'thread watcher', - el: UI.checkbox(name, name.replace(' Thread Watcher', '')) - }; - entry.el.title = desc; - input = entry.el.firstElementChild; - if (name === 'Show Unread Count' && !ThreadWatcher.unreadEnabled) { - input.disabled = true; - $.addClass(entry.el, 'disabled'); - entry.el.title += '\n[Remember Last Read Post is disabled.]'; - } - $.on(input, 'change', $.cb.checked); - if (name === 'Current Board' || name === 'Show Page' || name === 'Show Unread Count' || name === 'Show Site Prefix') { - $.on(input, 'change', ThreadWatcher.refresh); - } - if (name === 'Show Page' || name === 'Show Unread Count' || name === 'Auto Update Thread Watcher') { - $.on(input, 'change', ThreadWatcher.fetchAuto); - } - return this.menu.addEntry(entry); - } - } - }; - - return ThreadWatcher; - -}).call(this); - -Unread = (function() { - var Unread; - - Unread = { - init: function() { - if (!(g.VIEW === 'thread' && (Conf['Unread Count'] || Conf['Unread Favicon'] || Conf['Unread Line'] || Conf['Remember Last Read Post'] || Conf['Desktop Notifications'] || Conf['Quote Threading']))) { - return; - } - if (Conf['Remember Last Read Post']) { - $.sync('Remember Last Read Post', function(enabled) { - return Conf['Remember Last Read Post'] = enabled; - }); - this.db = new DataBoard('lastReadPosts', this.sync); - } - this.hr = $.el('hr', { - id: 'unread-line', - className: 'unread-line' - }); - this.posts = new Set(); - this.postsQuotingYou = new Set(); - this.order = new RandomAccessList(); - this.position = null; - Callbacks.Thread.push({ - name: 'Unread', - cb: this.node - }); - return Callbacks.Post.push({ - name: 'Unread', - cb: this.addPost - }); - }, - node: function() { - var ID, j, len, ref, ref1, resetLink; - Unread.thread = this; - Unread.title = d.title; - Unread.lastReadPost = ((ref = Unread.db) != null ? ref.get({ - boardID: this.board.ID, - threadID: this.ID - }) : void 0) || 0; - Unread.readCount = 0; - ref1 = this.posts.keys; - for (j = 0, len = ref1.length; j < len; j++) { - ID = ref1[j]; - if (+ID <= Unread.lastReadPost) { - Unread.readCount++; - } - } - $.one(d, '4chanXInitFinished', Unread.ready); - $.on(d, 'PostsInserted', Unread.onUpdate); - $.on(d, 'ThreadUpdate', function(e) { - if (e.detail[404]) { - return Unread.update(); - } - }); - resetLink = $.el('a', { - href: 'javascript:;', - className: 'unread-reset', - textContent: 'Mark all unread' - }); - $.on(resetLink, 'click', Unread.reset); - return Header.menu.addEntry({ - el: resetLink, - order: 70 - }); - }, - ready: function() { - if (Conf['Remember Last Read Post'] && Conf['Scroll to Last Read Post']) { - Unread.scroll(); - } - Unread.setLine(true); - Unread.read(); - Unread.update(); - $.on(d, 'scroll visibilitychange', Unread.read); - if (Conf['Unread Line']) { - return $.on(d, 'visibilitychange', Unread.setLine); - } - }, - positionPrev: function() { - if (Unread.position) { - return Unread.position.prev; - } else { - return Unread.order.last; - } - }, - scroll: function() { - var bottom, hash, position; - if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) { - return; - } - position = Unread.positionPrev(); - while (position) { - bottom = position.data.nodes.bottom; - if (!bottom.getBoundingClientRect().height) { - position = position.prev; - } else { - Header.scrollToIfNeeded(bottom, true); - break; - } - } - }, - reset: function() { - if (Unread.lastReadPost == null) { - return; - } - Unread.posts = new Set(); - Unread.postsQuotingYou = new Set(); - Unread.order = new RandomAccessList(); - Unread.position = null; - Unread.lastReadPost = 0; - Unread.readCount = 0; - Unread.thread.posts.forEach(function(post) { - return Unread.addPost.call(post); - }); - $.forceSync('Remember Last Read Post'); - if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) { - Unread.db.set({ - boardID: Unread.thread.board.ID, - threadID: Unread.thread.ID, - val: 0 - }); - } - Unread.updatePosition(); - Unread.setLine(); - return Unread.update(); - }, - sync: function() { - var ID, i, j, lastReadPost, postIDs, ref, ref1; - if (Unread.lastReadPost == null) { - return; - } - lastReadPost = Unread.db.get({ - boardID: Unread.thread.board.ID, - threadID: Unread.thread.ID, - defaultValue: 0 - }); - if (!(Unread.lastReadPost < lastReadPost)) { - return; - } - Unread.lastReadPost = lastReadPost; - postIDs = Unread.thread.posts.keys; - for (i = j = ref = Unread.readCount, ref1 = postIDs.length; j < ref1; i = j += 1) { - ID = +postIDs[i]; - if (!Unread.thread.posts.get(ID).isFetchedQuote) { - if (ID > Unread.lastReadPost) { - break; - } - Unread.posts["delete"](ID); - Unread.postsQuotingYou["delete"](ID); - } - Unread.readCount++; - } - Unread.updatePosition(); - Unread.setLine(); - return Unread.update(); - }, - addPost: function() { - if (this.isFetchedQuote || this.isClone) { - return; - } - Unread.order.push(this); - if (this.ID <= Unread.lastReadPost || this.isHidden || QuoteYou.isYou(this)) { - return; - } - Unread.posts.add((Unread.posts.last = this.ID)); - Unread.addPostQuotingYou(this); - return Unread.position != null ? Unread.position : Unread.position = Unread.order[this.ID]; - }, - addPostQuotingYou: function(post) { - var j, len, quotelink, ref, ref1; - ref = post.nodes.quotelinks; - for (j = 0, len = ref.length; j < len; j++) { - quotelink = ref[j]; - if (!((ref1 = QuoteYou.db) != null ? ref1.get(Get.postDataFromLink(quotelink)) : void 0)) { - continue; - } - Unread.postsQuotingYou.add((Unread.postsQuotingYou.last = post.ID)); - Unread.openNotification(post); - return; - } - }, - openNotification: function(post, predicate) { - var notif; - if (predicate == null) { - predicate = ' replied to you'; - } - if (!Header.areNotificationsEnabled) { - return; - } - notif = new Notification("" + post.info.nameBlock + predicate, { - body: post.commentDisplay(), - icon: Favicon.logo - }); - notif.onclick = function() { - Header.scrollToIfNeeded(post.nodes.bottom, true); - return window.focus(); - }; - return notif.onshow = function() { - return setTimeout(function() { - return notif.close(); - }, 7 * $.SECOND); - }; - }, - onUpdate: function() { - return $.queueTask(function() { - Unread.setLine(); - Unread.read(); - return Unread.update(); - }); - }, - readSinglePost: function(post) { - var ID; - ID = post.ID; - if (!Unread.posts.has(ID)) { - return; - } - Unread.posts["delete"](ID); - Unread.postsQuotingYou["delete"](ID); - Unread.updatePosition(); - Unread.saveLastReadPost(); - return Unread.update(); - }, - read: $.debounce(100, function(e) { - var ID, bottom, count, data, ref; - if (!Unread.posts.size && Unread.readCount !== Unread.thread.posts.keys.length) { - Unread.saveLastReadPost(); - } - if (d.hidden || !Unread.posts.size) { - return; - } - count = 0; - while (Unread.position) { - ref = Unread.position, ID = ref.ID, data = ref.data; - bottom = data.nodes.bottom; - if (!(!bottom.getBoundingClientRect().height || Header.getBottomOf(bottom) > -1)) { - break; - } - count++; - Unread.posts["delete"](ID); - Unread.postsQuotingYou["delete"](ID); - Unread.position = Unread.position.next; - } - if (!count) { - return; - } - Unread.updatePosition(); - Unread.saveLastReadPost(); - if (e) { - return Unread.update(); - } - }), - updatePosition: function() { - while (Unread.position && !Unread.posts.has(Unread.position.ID)) { - Unread.position = Unread.position.next; - } - }, - saveLastReadPost: $.debounce(2 * $.SECOND, function() { - var ID, i, j, postIDs, ref, ref1; - $.forceSync('Remember Last Read Post'); - if (!(Conf['Remember Last Read Post'] && Unread.db)) { - return; - } - postIDs = Unread.thread.posts.keys; - for (i = j = ref = Unread.readCount, ref1 = postIDs.length; j < ref1; i = j += 1) { - ID = +postIDs[i]; - if (!Unread.thread.posts.get(ID).isFetchedQuote) { - if (Unread.posts.has(ID)) { - break; - } - Unread.lastReadPost = ID; - } - Unread.readCount++; - } - if (Unread.thread.isDead && !Unread.thread.isArchived) { - return; - } - return Unread.db.set({ - boardID: Unread.thread.board.ID, - threadID: Unread.thread.ID, - val: Unread.lastReadPost - }); - }), - setLine: function(force) { - var node, oldPosition, ref; - if (!Conf['Unread Line']) { - return; - } - if (Unread.hr.hidden || d.hidden || (force === true)) { - oldPosition = Unread.linePosition; - if ((Unread.linePosition = Unread.positionPrev())) { - if (Unread.linePosition !== oldPosition) { - node = Unread.linePosition.data.nodes.bottom; - if (((ref = node.nextSibling) != null ? ref.tagName : void 0) === 'BR') { - node = node.nextSibling; - } - $.after(node, Unread.hr); - } - } else { - $.rm(Unread.hr); - } - } - return Unread.hr.hidden = Unread.linePosition === Unread.order.last; - }, - update: function() { - var count, countQuotingYou, isDead, titleCount, titleDead, titleQuotingYou; - count = Unread.posts.size; - countQuotingYou = Unread.postsQuotingYou.size; - if (Conf['Unread Count']) { - titleQuotingYou = Conf['Quoted Title'] && countQuotingYou ? '(!) ' : ''; - titleCount = count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : ''; - titleDead = Unread.thread.isDead ? Unread.title.replace('-', (Unread.thread.isArchived ? '- Archived -' : '- 404 -')) : Unread.title; - d.title = "" + titleQuotingYou + titleCount + titleDead; - } - Unread.saveThreadWatcherCount(); - if (Conf['Unread Favicon'] && g.SITE.software === 'yotsuba') { - isDead = Unread.thread.isDead; - return Favicon.set((countQuotingYou ? (isDead ? 'unreadDeadY' : 'unreadY') : count ? (isDead ? 'unreadDead' : 'unread') : (isDead ? 'dead' : 'default'))); - } - }, - saveThreadWatcherCount: $.debounce(2 * $.SECOND, function() { - var i, j, posts, quotingYou, ref; - $.forceSync('Remember Last Read Post'); - if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) { - quotingYou = !Conf['Require OP Quote Link'] && QuoteYou.isYou(Unread.thread.OP) ? Unread.posts : Unread.postsQuotingYou; - if (!quotingYou.size) { - quotingYou.last = 0; - } else if (!quotingYou.has(quotingYou.last)) { - quotingYou.last = 0; - posts = Unread.thread.posts.keys; - for (i = j = ref = posts.length - 1; j >= 0; i = j += -1) { - if (quotingYou.has(+posts[i])) { - quotingYou.last = posts[i]; - break; - } - } - } - return ThreadWatcher.update(g.SITE.ID, Unread.thread.board.ID, Unread.thread.ID, { - last: Unread.thread.lastPost, - isDead: Unread.thread.isDead, - isArchived: Unread.thread.isArchived, - unread: Unread.posts.size, - quotingYou: quotingYou.last || 0 - }); - } - }) - }; - - return Unread; - -}).call(this); - -UnreadIndex = (function() { - var UnreadIndex; - - UnreadIndex = { - lastReadPost: $.dict(), - hr: $.dict(), - markReadLink: $.dict(), - init: function() { - if (!(g.VIEW === 'index' && Conf['Remember Last Read Post'] && Conf['Unread Line in Index'])) { - return; - } - this.enabled = true; - this.db = new DataBoard('lastReadPosts', this.sync); - Callbacks.Thread.push({ - name: 'Unread Line in Index', - cb: this.node - }); - $.on(d, 'IndexRefreshInternal', this.onIndexRefresh); - return $.on(d, 'PostsInserted PostsRemoved', this.onPostsInserted); - }, - node: function() { - UnreadIndex.lastReadPost[this.fullID] = UnreadIndex.db.get({ - boardID: this.board.ID, - threadID: this.ID - }) || 0; - if (!Index.enabled) { - return UnreadIndex.update(this); - } - }, - onIndexRefresh: function(e) { - var i, len, ref, results, thread, threadID; - if (e.detail.isCatalog) { - return; - } - ref = e.detail.threadIDs; - results = []; - for (i = 0, len = ref.length; i < len; i++) { - threadID = ref[i]; - thread = g.threads.get(threadID); - results.push(UnreadIndex.update(thread)); - } - return results; - }, - onPostsInserted: function(e) { - var ref, ref1, thread, wasVisible; - if (e.target === Index.root) { - return; - } - thread = Get.threadFromNode(e.target); - if (!thread || thread.nodes.root !== e.target) { - return; - } - wasVisible = !!((ref = UnreadIndex.hr[thread.fullID]) != null ? ref.parentNode : void 0); - UnreadIndex.update(thread); - if (Conf['Scroll to Last Read Post'] && e.type === 'PostsInserted' && !wasVisible && !!((ref1 = UnreadIndex.hr[thread.fullID]) != null ? ref1.parentNode : void 0)) { - return Header.scrollToIfNeeded(UnreadIndex.hr[thread.fullID], true); - } - }, - sync: function() { - return g.threads.forEach(function(thread) { - var lastReadPost, ref; - lastReadPost = UnreadIndex.db.get({ - boardID: thread.board.ID, - threadID: thread.ID - }) || 0; - if (lastReadPost !== UnreadIndex.lastReadPost[thread.fullID]) { - UnreadIndex.lastReadPost[thread.fullID] = lastReadPost; - if ((ref = thread.nodes.root) != null ? ref.parentNode : void 0) { - return UnreadIndex.update(thread); - } - } - }); - }, - update: function(thread) { - var divider, firstUnread, hasUnread, hr, lastReadPost, link, repliesRead, repliesShown; - lastReadPost = UnreadIndex.lastReadPost[thread.fullID]; - repliesShown = 0; - repliesRead = 0; - firstUnread = null; - thread.posts.forEach(function(post) { - if (post.isReply && thread.nodes.root.contains(post.nodes.root)) { - repliesShown++; - if (post.ID <= lastReadPost) { - return repliesRead++; - } else if ((!firstUnread || post.ID < firstUnread.ID) && !post.isHidden && !QuoteYou.isYou(post)) { - return firstUnread = post; - } - } - }); - hr = UnreadIndex.hr[thread.fullID]; - if (firstUnread && (repliesRead || (lastReadPost === thread.OP.ID && (!$(g.SITE.selectors.summary, thread.nodes.root) || thread.ID in ExpandThread.statuses)))) { - if (!hr) { - hr = UnreadIndex.hr[thread.fullID] = $.el('hr', { - className: 'unread-line' - }); - } - $.before(firstUnread.nodes.root, hr); - } else { - $.rm(hr); - } - hasUnread = repliesShown ? firstUnread || !repliesRead : Index.enabled ? thread.lastPost > lastReadPost : thread.OP.ID > lastReadPost; - thread.nodes.root.classList.toggle('unread-thread', hasUnread); - link = UnreadIndex.markReadLink[thread.fullID]; - if (!link) { - link = UnreadIndex.markReadLink[thread.fullID] = $.el('a', { - className: 'unread-mark-read brackets-wrap', - href: 'javascript:;', - textContent: 'Mark Read' - }); - $.on(link, 'click', UnreadIndex.markRead); - } - if ((divider = $(g.SITE.selectors.threadDivider, thread.nodes.root))) { - return $.before(divider, link); - } else { - return $.add(thread.nodes.root, link); - } - }, - markRead: function() { - var thread; - thread = Get.threadFromNode(this); - UnreadIndex.lastReadPost[thread.fullID] = thread.lastPost; - UnreadIndex.db.set({ - boardID: thread.board.ID, - threadID: thread.ID, - val: thread.lastPost - }); - $.rm(UnreadIndex.hr[thread.fullID]); - thread.nodes.root.classList.remove('unread-thread'); - return ThreadWatcher.update(g.SITE.ID, thread.board.ID, thread.ID, { - last: thread.lastPost, - unread: 0, - quotingYou: 0 - }); - } - }; - - return UnreadIndex; - -}).call(this); - -Captcha = {}; - -(function() { - Captcha.cache = { - init: function() { - $.on(d, 'SaveCaptcha', (function(_this) { - return function(e) { - return _this.saveAPI(e.detail); - }; - })(this)); - return $.on(d, 'NoCaptcha', (function(_this) { - return function(e) { - return _this.noCaptcha(e.detail); - }; - })(this)); - }, - captchas: [], - getCount: function() { - return this.captchas.length; - }, - neededRaw: function() { - return !(this.haveCookie() || this.captchas.length || QR.req || this.submitCB) && (QR.posts.length > 1 || Conf['Auto-load captcha'] || !QR.posts[0].isOnlyQuotes() || QR.posts[0].file); - }, - needed: function() { - return this.neededRaw() && $.event('LoadCaptcha'); - }, - prerequest: function() { - if (!Conf['Prerequest Captcha']) { - return; - } - return $.queueTask((function(_this) { - return function() { - var isReply; - if (!_this.prerequested && _this.neededRaw() && !$.event('LoadCaptcha') && !QR.captcha.occupied() && QR.cooldown.seconds <= 60 && QR.selected === QR.posts[QR.posts.length - 1] && !QR.selected.isOnlyQuotes()) { - isReply = QR.selected.thread !== 'new'; - if (!$.event('RequestCaptcha', { - isReply: isReply - })) { - _this.prerequested = true; - _this.submitCB = function(captcha) { - if (captcha) { - return _this.save(captcha); - } - }; - return _this.updateCount(); - } - } - }; - })(this)); - }, - haveCookie: function() { - return /\b_ct=/.test(d.cookie) && QR.posts[0].thread !== 'new'; - }, - getOne: function() { - var captcha; - delete this.prerequested; - this.clear(); - if ((captcha = this.captchas.shift())) { - this.count(); - return captcha; - } else { - return null; - } - }, - request: function(isReply) { - if (!this.submitCB) { - if ($.event('RequestCaptcha', { - isReply: isReply - })) { - return; - } - } - return (function(_this) { - return function(cb) { - _this.submitCB = cb; - return _this.updateCount(); - }; - })(this); - }, - abort: function() { - if (this.submitCB) { - delete this.submitCB; - $.event('AbortCaptcha'); - return this.updateCount(); - } - }, - saveAPI: function(captcha) { - var cb; - if ((cb = this.submitCB)) { - delete this.submitCB; - cb(captcha); - return this.updateCount(); - } else { - return this.save(captcha); - } - }, - noCaptcha: function(detail) { - var cb; - if ((cb = this.submitCB)) { - if (!this.haveCookie() || (detail != null ? detail.error : void 0)) { - QR.error((detail != null ? detail.error : void 0) || 'Failed to retrieve captcha.'); - QR.captcha.setup(d.activeElement === QR.nodes.status); - } - delete this.submitCB; - cb(); - return this.updateCount(); - } - }, - save: function(captcha) { - var cb; - if ((cb = this.submitCB)) { - this.abort(); - cb(captcha); - return; - } - this.captchas.push(captcha); - this.captchas.sort(function(a, b) { - return a.timeout - b.timeout; - }); - return this.count(); - }, - clear: function() { - var captcha, i, j, len, now, ref; - if (this.captchas.length) { - now = Date.now(); - ref = this.captchas; - for (i = j = 0, len = ref.length; j < len; i = ++j) { - captcha = ref[i]; - if (captcha.timeout > now) { - break; - } - } - if (i) { - this.captchas = this.captchas.slice(i); - return this.count(); - } - } - }, - count: function() { - clearTimeout(this.timer); - if (this.captchas.length) { - this.timer = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now()); - } - return this.updateCount(); - }, - updateCount: function() { - return $.event('CaptchaCount', this.captchas.length); - } - }; - -}).call(this); - -(function() { - Captcha.replace = { - init: function() { - var ref; - if (!(g.SITE.software === 'yotsuba' && d.cookie.indexOf('pass_enabled=1') < 0)) { - return; - } - if (Conf['Force Noscript Captcha'] && Main.jsEnabled) { - $.ready(Captcha.replace.noscript); - return; - } - if (Conf['captchaLanguage'].trim()) { - if ((ref = location.hostname) === 'boards.4chan.org' || ref === 'boards.4channel.org') { - return $.onExists(doc, '#captchaFormPart', function(node) { - return $.onExists(node, 'iframe[src^="https://www.google.com/recaptcha/"]', Captcha.replace.iframe); - }); - } else { - return $.onExists(doc, 'iframe[src^="https://www.google.com/recaptcha/"]', Captcha.replace.iframe); - } - } - }, - noscript: function() { - var insert, noscript, original, span, toggle; - if (!((original = $('#g-recaptcha')) && (noscript = $('noscript', original.parentNode)))) { - return; - } - span = $.el('span', { - id: 'captcha-forced-noscript' - }); - $.replace(noscript, span); - $.rm(original); - insert = function() { - span.innerHTML = noscript.textContent; - return Captcha.replace.iframe($('iframe[src^="https://www.google.com/recaptcha/"]', span)); - }; - if ((toggle = $('#togglePostFormLink a, #form-link'))) { - return $.on(toggle, 'click', insert); - } else { - return insert(); - } - }, - iframe: function(iframe) { - var lang, src; - if ((lang = Conf['captchaLanguage'].trim())) { - src = /[?&]hl=/.test(iframe.src) ? iframe.src.replace(/([?&]hl=)[^&]*/, '$1' + encodeURIComponent(lang)) : iframe.src + ("&hl=" + (encodeURIComponent(lang))); - if (iframe.src !== src) { - iframe.src = src; - } - } - } - }; - -}).call(this); - -(function() { - Captcha.t = { - init: function() { - var root; - if (d.cookie.indexOf('pass_enabled=1') >= 0) { - return; - } - if (!(this.isEnabled = !!$('#t-root') || !$.id('postForm'))) { - return; - } - root = $.el('div', { - className: 'captcha-root' - }); - this.nodes = { - root: root - }; - $.addClass(QR.nodes.el, 'has-captcha', 'captcha-t'); - return $.after(QR.nodes.com.parentNode, root); - }, - moreNeeded: function() {}, - getThread: function() { - var boardID, threadID; - boardID = g.BOARD.ID; - if (QR.posts[0].thread === 'new') { - threadID = '0'; - } else { - threadID = '' + QR.posts[0].thread; - } - return { - boardID: boardID, - threadID: threadID - }; - }, - setup: function(focus) { - if (!this.isEnabled) { - return; - } - if (!this.nodes.container) { - this.nodes.container = $.el('div', { - className: 'captcha-container' - }); - $.prepend(this.nodes.root, this.nodes.container); - Captcha.t.currentThread = Captcha.t.getThread(); - $.global(function() { - var el; - el = document.querySelector('#qr .captcha-container'); - window.TCaptcha.init(el, this.boardID, +this.threadID); - return window.TCaptcha.setErrorCb(function(err) { - return window.dispatchEvent(new CustomEvent('CreateNotification', { - detail: { - type: 'warning', - content: '' + err - } - })); - }); - }, Captcha.t.currentThread); - } - if (focus) { - return $('#t-resp').focus(); - } - }, - destroy: function() { - if (!(this.isEnabled && this.nodes.container)) { - return; - } - $.global(function() { - return window.TCaptcha.destroy(); - }); - $.rm(this.nodes.container); - return delete this.nodes.container; - }, - updateThread: function() { - var boardID, newThread, ref, threadID; - if (!this.isEnabled) { - return; - } - ref = Captcha.t.currentThread || {}, boardID = ref.boardID, threadID = ref.threadID; - newThread = Captcha.t.getThread(); - if (!(newThread.boardID === boardID && newThread.threadID === threadID)) { - Captcha.t.destroy(); - return Captcha.t.setup(); - } - }, - getOne: function() { - var el, i, key, len, ref, response; - response = {}; - if (this.nodes.container) { - ref = ['t-response', 't-challenge']; - for (i = 0, len = ref.length; i < len; i++) { - key = ref[i]; - response[key] = $("[name='" + key + "']", this.nodes.container).value; - } - } - if (!response['t-response'] && !((el = $('#t-msg')) && /Verification not required/i.test(el.textContent))) { - response = null; - } - return response; - }, - setUsed: function() { - if (!this.isEnabled) { - return; - } - if (this.nodes.container) { - return $.global(function() { - return window.TCaptcha.clearChallenge(); - }); - } - }, - occupied: function() { - return !!this.nodes.container; - } - }; - -}).call(this); - -(function() { - var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Captcha.v2 = { - lifetime: 2 * $.MINUTE, - init: function() { - var counter, root; - if (d.cookie.indexOf('pass_enabled=1') >= 0) { - return; - } - if (!(this.isEnabled = !!$('#g-recaptcha, #captcha-forced-noscript') || !$.id('postForm'))) { - return; - } - if ((this.noscript = Conf['Force Noscript Captcha'] || !Main.jsEnabled)) { - $.addClass(QR.nodes.el, 'noscript-captcha'); - } - Captcha.cache.init(); - $.on(d, 'CaptchaCount', this.count.bind(this)); - root = $.el('div', { - className: 'captcha-root' - }); - $.extend(root, {innerHTML: "
        "}); - counter = $('.captcha-counter > a', root); - this.nodes = { - root: root, - counter: counter - }; - this.count(); - $.addClass(QR.nodes.el, 'has-captcha', 'captcha-v2'); - $.after(QR.nodes.com.parentNode, root); - $.on(counter, 'click', this.toggle.bind(this)); - $.on(counter, 'keydown', (function(_this) { - return function(e) { - if (Keybinds.keyCode(e) !== 'Space') { - return; - } - _this.toggle(); - e.preventDefault(); - return e.stopPropagation(); - }; - })(this)); - return $.on(window, 'captcha:success', (function(_this) { - return function() { - return $.queueTask(function() { - return _this.save(false); - }); - }; - })(this)); - }, - timeouts: {}, - prevNeeded: 0, - noscriptURL: function() { - var lang, url; - url = 'https://www.google.com/recaptcha/api/fallback?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc'; - if ((lang = Conf['captchaLanguage'].trim())) { - url += "&hl=" + (encodeURIComponent(lang)); - } - return url; - }, - moreNeeded: function() { - return $.queueTask((function(_this) { - return function() { - var needed; - needed = Captcha.cache.needed(); - if (needed && !_this.prevNeeded) { - _this.setup(QR.cooldown.auto && d.activeElement === QR.nodes.status); - } - return _this.prevNeeded = needed; - }; - })(this)); - }, - toggle: function() { - if (this.nodes.container && !this.timeouts.destroy) { - return this.destroy(); - } else { - return this.setup(true, true); - } - }, - setup: function(focus, force) { - if (!(this.isEnabled && (Captcha.cache.needed() || force))) { - return; - } - if (focus) { - $.addClass(QR.nodes.el, 'focus'); - this.nodes.counter.focus(); - } - if (this.timeouts.destroy) { - clearTimeout(this.timeouts.destroy); - delete this.timeouts.destroy; - return this.reload(); - } - if (this.nodes.container) { - $.queueTask((function(_this) { - return function() { - var iframe; - if (_this.nodes.container && d.activeElement === _this.nodes.counter && (iframe = $('iframe[src^="https://www.google.com/recaptcha/"]', _this.nodes.container))) { - iframe.focus(); - return QR.focus(); - } - }; - })(this)); - return; - } - this.nodes.container = $.el('div', { - className: 'captcha-container' - }); - $.prepend(this.nodes.root, this.nodes.container); - new MutationObserver(this.afterSetup.bind(this)).observe(this.nodes.container, { - childList: true, - subtree: true - }); - if (this.noscript) { - return this.setupNoscript(); - } else { - return this.setupJS(); - } - }, - setupNoscript: function() { - var div, iframe, textarea; - iframe = $.el('iframe', { - id: 'qr-captcha-iframe', - scrolling: 'no', - src: this.noscriptURL() - }); - div = $.el('div'); - textarea = $.el('textarea'); - $.add(div, textarea); - return $.add(this.nodes.container, [iframe, div]); - }, - setupJS: function() { - return $.global(function() { - var cbNative, render, script; - render = function() { - var classList, container; - classList = document.documentElement.classList; - container = document.querySelector('#qr .captcha-container'); - return container.dataset.widgetID = window.grecaptcha.render(container, { - sitekey: '6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc', - theme: classList.contains('tomorrow') || classList.contains('spooky') || classList.contains('dark-captcha') ? 'dark' : 'light', - callback: function(response) { - return window.dispatchEvent(new CustomEvent('captcha:success', { - detail: response - })); - } - }); - }; - if (window.grecaptcha) { - return render(); - } else { - cbNative = window.onRecaptchaLoaded; - window.onRecaptchaLoaded = function() { - render(); - return cbNative(); - }; - if (!document.head.querySelector('script[src^="https://www.google.com/recaptcha/api.js"]')) { - script = document.createElement('script'); - script.src = 'https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoaded&render=explicit'; - return document.head.appendChild(script); - } - } - }); - }, - afterSetup: function(mutations) { - var i, iframe, j, len, len1, mutation, node, ref, textarea; - for (i = 0, len = mutations.length; i < len; i++) { - mutation = mutations[i]; - ref = mutation.addedNodes; - for (j = 0, len1 = ref.length; j < len1; j++) { - node = ref[j]; - if ((iframe = $.x('./descendant-or-self::iframe[starts-with(@src, "https://www.google.com/recaptcha/")]', node))) { - this.setupIFrame(iframe); - } - if ((textarea = $.x('./descendant-or-self::textarea', node))) { - this.setupTextArea(textarea); - } - } - } - }, - setupIFrame: function(iframe) { - var ref, ref1; - if (!doc.contains(iframe)) { - return; - } - Captcha.replace.iframe(iframe); - $.addClass(QR.nodes.el, 'captcha-open'); - this.fixQRPosition(); - $.on(iframe, 'load', this.fixQRPosition); - if (d.activeElement === this.nodes.counter) { - iframe.focus(); - } - if (((ref = $.engine) === 'blink' || ref === 'edge') && (ref1 = iframe.parentNode, indexOf.call($$('#qr .captcha-container > div > div:first-of-type'), ref1) >= 0)) { - return $.on(iframe.parentNode, 'scroll', function() { - return this.scrollTop = 0; - }); - } - }, - fixQRPosition: function() { - if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) { - QR.nodes.el.style.top = ''; - return QR.nodes.el.style.bottom = '0px'; - } - }, - setupTextArea: function(textarea) { - return $.one(textarea, 'input', (function(_this) { - return function() { - return _this.save(true); - }; - })(this)); - }, - destroy: function() { - if (!this.isEnabled) { - return; - } - delete this.timeouts.destroy; - $.rmClass(QR.nodes.el, 'captcha-open'); - if (this.nodes.container) { - $.global(function() { - var container; - container = document.querySelector('#qr .captcha-container'); - return window.grecaptcha.reset(container.dataset.widgetID); - }); - $.rm(this.nodes.container); - return delete this.nodes.container; - } - }, - getOne: function(isReply) { - return Captcha.cache.getOne(isReply); - }, - save: function(pasted, token) { - var base, focus, ref; - Captcha.cache.save({ - response: token || $('textarea', this.nodes.container).value, - timeout: Date.now() + this.lifetime - }); - focus = ((ref = d.activeElement) != null ? ref.nodeName : void 0) === 'IFRAME' && /https?:\/\/www\.google\.com\/recaptcha\//.test(d.activeElement.src); - if (Captcha.cache.needed()) { - if (focus) { - if (QR.cooldown.auto || Conf['Post on Captcha Completion']) { - this.nodes.counter.focus(); - } else { - QR.nodes.status.focus(); - } - } - this.reload(); - } else { - if (pasted) { - this.destroy(); - } else { - if ((base = this.timeouts).destroy == null) { - base.destroy = setTimeout(this.destroy.bind(this), 3 * $.SECOND); - } - } - if (focus) { - QR.nodes.status.focus(); - } - } - if (Conf['Post on Captcha Completion'] && !QR.cooldown.auto) { - return QR.submit(); - } - }, - count: function() { - var count, loading; - count = Captcha.cache.getCount(); - loading = Captcha.cache.submitCB ? '...' : ''; - this.nodes.counter.textContent = "Captchas: " + count + loading; - return this.moreNeeded(); - }, - reload: function() { - if ($('iframe[src^="https://www.google.com/recaptcha/api/fallback?"]', this.nodes.container)) { - this.destroy(); - return this.setup(false, true); - } else { - return $.global(function() { - var container; - container = document.querySelector('#qr .captcha-container'); - return window.grecaptcha.reset(container.dataset.widgetID); - }); - } - }, - occupied: function() { - return !!this.nodes.container && !this.timeouts.destroy; - } - }; - -}).call(this); - -PassLink = (function() { - var PassLink; - - PassLink = { - init: function() { - if (!(g.SITE.software === 'yotsuba' && Conf['Pass Link'])) { - return; - } - return Main.ready(this.ready); - }, - ready: function() { - var passLink, styleSelector; - if (!(styleSelector = $.id('styleSelector'))) { - return; - } - passLink = $.el('span', { - className: 'brackets-wrap pass-link-container' - }); - $.extend(passLink, {innerHTML: "4chan Pass"}); - $.on(passLink.firstElementChild, 'click', function() { - return window.open("//sys." + (location.hostname.split('.')[1]) + ".org/auth", Date.now(), 'width=500,height=280,toolbar=0'); - }); - return $.before(styleSelector.previousSibling, [passLink, $.tn('\u00A0\u00A0')]); - } - }; - - return PassLink; - -}).call(this); - -PostRedirect = (function() { - var PostRedirect; - - PostRedirect = { - init: function() { - return $.on(d, 'QRPostSuccessful', (function(_this) { - return function(e) { - if (!e.detail.redirect) { - return; - } - _this.event = e; - _this.delays = 0; - return $.queueTask(function() { - if (e === _this.event && _this.delays === 0) { - return location.href = e.detail.redirect; - } - }); - }; - })(this)); - }, - delays: 0, - delay: function() { - var e; - if (!this.event) { - return null; - } - e = this.event; - this.delays++; - return (function(_this) { - return function() { - if (e !== _this.event) { - return; - } - _this.delays--; - if (_this.delays === 0) { - return location.href = e.detail.redirect; - } - }; - })(this); - } - }; - - return PostRedirect; - -}).call(this); - -PostSuccessful = (function() { - var PostSuccessful; - - PostSuccessful = { - init: function() { - if (!Conf['Remember Your Posts']) { - return; - } - return $.ready(this.ready); - }, - ready: function() { - var _, db, postID, ref, threadID; - if (d.title !== 'Post successful!') { - return; - } - ref = $('h1').nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref[0], threadID = ref[1], postID = ref[2]; - postID = +postID; - threadID = +threadID || postID; - db = new DataBoard('yourPosts'); - return db.set({ - boardID: g.BOARD.ID, - threadID: threadID, - postID: postID, - val: true - }); - } - }; - - return PostSuccessful; - -}).call(this); - -QR = (function() { - var QR, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - slice = [].slice; - - QR = { - mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/vnd.adobe.flash.movie', 'application/x-shockwave-flash', 'video/webm'], - validExtension: /\.(jpe?g|png|gif|pdf|swf|webm)$/i, - typeFromExtension: { - 'jpg': 'image/jpeg', - 'jpeg': 'image/jpeg', - 'png': 'image/png', - 'gif': 'image/gif', - 'pdf': 'application/pdf', - 'swf': 'application/vnd.adobe.flash.movie', - 'webm': 'video/webm' - }, - extensionFromType: { - 'image/jpeg': 'jpg', - 'image/png': 'png', - 'image/gif': 'gif', - 'application/pdf': 'pdf', - 'application/vnd.adobe.flash.movie': 'swf', - 'application/x-shockwave-flash': 'swf', - 'video/webm': 'webm' - }, - init: function() { - var sc; - if (!Conf['Quick Reply']) { - return; - } - this.posts = []; - $.on(d, '4chanXInitFinished', function() { - return BoardConfig.ready(QR.initReady); - }); - Callbacks.Post.push({ - name: 'Quick Reply', - cb: this.node - }); - this.shortcut = sc = $.el('a', { - className: 'fa fa-comment-o disabled', - textContent: 'QR', - title: 'Quick Reply', - href: 'javascript:;' - }); - $.on(sc, 'click', function() { - if (!QR.postingIsEnabled) { - return; - } - if (Conf['Persistent QR'] || !QR.nodes || QR.nodes.el.hidden) { - QR.open(); - return QR.nodes.com.focus(); - } else { - return QR.close(); - } - }); - return Header.addShortcut('qr', sc, 540); - }, - initReady: function() { - var captchaVersion, config, link, linkBot, navLinksBot, origToggle, prop; - captchaVersion = $('#g-recaptcha, #captcha-forced-noscript') ? 'v2' : 't'; - QR.captcha = Captcha[captchaVersion]; - QR.postingIsEnabled = true; - config = g.BOARD.config; - prop = function(key, def) { - var ref; - return +((ref = config[key]) != null ? ref : def); - }; - QR.min_width = prop('min_image_width', 1); - QR.min_height = prop('min_image_height', 1); - QR.max_width = QR.max_height = 10000; - QR.max_size = prop('max_filesize', 4194304); - QR.max_size_video = prop('max_webm_filesize', QR.max_size); - QR.max_comment = prop('max_comment_chars', 2000); - QR.max_width_video = QR.max_height_video = 2048; - QR.max_duration_video = prop('max_webm_duration', 120); - QR.forcedAnon = !!config.forced_anon; - QR.spoiler = !!config.spoilers; - if ((origToggle = $.id('togglePostFormLink'))) { - link = $.el('h1', { - className: "qr-link-container" - }); - $.extend(link, {innerHTML: "" + ((g.VIEW === "thread") ? "Reply to Thread" : "Start a Thread") + ""}); - QR.link = link.firstElementChild; - $.on(link.firstChild, 'click', function() { - QR.open(); - return QR.nodes.com.focus(); - }); - $.before(origToggle, link); - origToggle.firstElementChild.textContent = 'Original Form'; - } - if (g.VIEW === 'thread') { - linkBot = $.el('div', { - className: "brackets-wrap qr-link-container-bottom" - }); - $.extend(linkBot, {innerHTML: "Reply to Thread"}); - $.on(linkBot.firstElementChild, 'click', function() { - QR.open(); - return QR.nodes.com.focus(); - }); - if ((navLinksBot = $('.navLinksBot'))) { - $.prepend(navLinksBot, linkBot); - } - } - $.on(d, 'QRGetFile', QR.getFile); - $.on(d, 'QRDrawFile', QR.drawFile); - $.on(d, 'QRSetFile', QR.setFile); - $.on(d, 'paste', QR.paste); - $.on(d, 'dragover', QR.dragOver); - $.on(d, 'drop', QR.dropFile); - $.on(d, 'dragstart dragend', QR.drag); - $.on(d, 'IndexRefreshInternal', QR.generatePostableThreadsList); - $.on(d, 'ThreadUpdate', QR.statusCheck); - if (!Conf['Persistent QR']) { - return; - } - QR.open(); - if (Conf['Auto Hide QR']) { - return QR.hide(); - } - }, - statusCheck: function() { - var thread; - if (!QR.nodes) { - return; - } - thread = QR.posts[0].thread; - if (thread !== 'new' && g.threads.get(g.BOARD + "." + thread).isDead) { - return QR.abort(); - } else { - return QR.status(); - } - }, - node: function() { - $.on(this.nodes.quote, 'click', QR.quote); - if (this.isFetchedQuote) { - return QR.generatePostableThreadsList(); - } - }, - open: function() { - var err; - if (QR.nodes) { - if (QR.nodes.el.hidden) { - QR.captcha.setup(); - } - QR.nodes.el.hidden = false; - QR.unhide(); - } else { - try { - QR.dialog(); - } catch (error) { - err = error; - delete QR.nodes; - Main.handleErrors({ - message: 'Quick Reply dialog creation crashed.', - error: err - }); - return; - } - } - return $.rmClass(QR.shortcut, 'disabled'); - }, - close: function() { - var j, len, post, ref; - if (QR.req) { - QR.abort(); - return; - } - QR.nodes.el.hidden = true; - QR.cleanNotifications(); - QR.blur(); - $.rmClass(QR.nodes.el, 'dump'); - $.addClass(QR.shortcut, 'disabled'); - new QR.post(true); - ref = QR.posts.splice(0, QR.posts.length - 1); - for (j = 0, len = ref.length; j < len; j++) { - post = ref[j]; - post["delete"](); - } - QR.cooldown.auto = false; - QR.status(); - return QR.captcha.destroy(); - }, - focus: function() { - return $.queueTask(function() { - if (!QR.inBubble()) { - QR.hasFocus = d.activeElement && QR.nodes.el.contains(d.activeElement); - return QR.nodes.el.classList.toggle('focus', QR.hasFocus); - } - }); - }, - inBubble: function() { - var bubbles, ref; - bubbles = $$('iframe[src^="https://www.google.com/recaptcha/api2/frame"]'); - return (ref = d.activeElement, indexOf.call(bubbles, ref) >= 0) || bubbles.some(function(el) { - return getComputedStyle(el).visibility !== 'hidden' && el.getBoundingClientRect().bottom > 0; - }); - }, - hide: function() { - QR.blur(); - $.addClass(QR.nodes.el, 'autohide'); - return QR.nodes.autohide.checked = true; - }, - unhide: function() { - $.rmClass(QR.nodes.el, 'autohide'); - return QR.nodes.autohide.checked = false; - }, - toggleHide: function() { - if (this.checked) { - return QR.hide(); - } else { - return QR.unhide(); - } - }, - blur: function() { - if (QR.nodes.el.contains(d.activeElement)) { - return d.activeElement.blur(); - } - }, - toggleSJIS: function(e) { - e.preventDefault(); - Conf['sjisPreview'] = !Conf['sjisPreview']; - $.set('sjisPreview', Conf['sjisPreview']); - return QR.nodes.el.classList.toggle('sjis-preview', Conf['sjisPreview']); - }, - texPreviewShow: function() { - if ($.hasClass(QR.nodes.el, 'tex-preview')) { - return QR.texPreviewHide(); - } - $.addClass(QR.nodes.el, 'tex-preview'); - QR.nodes.texPreview.textContent = QR.nodes.com.value; - return $.event('mathjax', null, QR.nodes.texPreview); - }, - texPreviewHide: function() { - return $.rmClass(QR.nodes.el, 'tex-preview'); - }, - addPost: function() { - var wasOpen; - wasOpen = QR.nodes && !QR.nodes.el.hidden; - QR.open(); - if (wasOpen) { - $.addClass(QR.nodes.el, 'dump'); - new QR.post(true); - } - return QR.nodes.com.focus(); - }, - setCustomCooldown: function(enabled) { - Conf['customCooldownEnabled'] = enabled; - QR.cooldown.customCooldown = enabled; - return QR.nodes.customCooldown.classList.toggle('disabled', !enabled); - }, - toggleCustomCooldown: function() { - var enabled; - enabled = $.hasClass(QR.nodes.customCooldown, 'disabled'); - QR.setCustomCooldown(enabled); - return $.set('customCooldownEnabled', enabled); - }, - error: function(err, focusOverride) { - var el, notice, notif; - QR.open(); - if (typeof err === 'string') { - el = $.tn(err); - } else { - el = err; - el.removeAttribute('style'); - } - notice = new Notice('warning', el); - QR.notifications.push(notice); - if (!Header.areNotificationsEnabled) { - if (d.hidden && !QR.cooldown.auto) { - return alert(el.textContent); - } - } else if (d.hidden || !(focusOverride || d.hasFocus())) { - notif = new Notification(el.textContent, { - body: el.textContent, - icon: Favicon.logo - }); - notif.onclick = function() { - return window.focus(); - }; - if ($.engine !== 'gecko') { - notif.onclose = function() { - return notice.close(); - }; - return notif.onshow = function() { - return setTimeout(function() { - notif.onclose = null; - return notif.close(); - }, 7 * $.SECOND); - }; - } - } - }, - connectionError: function() { - return $.el('span', {innerHTML: "Connection error while posting. [More info]"}); - }, - notifications: [], - cleanNotifications: function() { - var j, len, notification, ref; - ref = QR.notifications; - for (j = 0, len = ref.length; j < len; j++) { - notification = ref[j]; - notification.close(); - } - return QR.notifications = []; - }, - status: function() { - var disabled, status, thread, value; - if (!QR.nodes) { - return; - } - thread = QR.posts[0].thread; - if (thread !== 'new' && g.threads.get(g.BOARD + "." + thread).isDead) { - value = 'Dead'; - disabled = true; - QR.cooldown.auto = false; - } - value = QR.req ? QR.req.progress : QR.cooldown.seconds || value; - status = QR.nodes.status; - status.value = !value ? 'Submit' : QR.cooldown.auto ? "Auto " + value : value; - return status.disabled = disabled || false; - }, - openPost: function() { - var index; - QR.open(); - if (QR.selected.isLocked) { - index = QR.posts.indexOf(QR.selected); - (QR.posts[index + 1] || new QR.post()).select(); - $.addClass(QR.nodes.el, 'dump'); - return QR.cooldown.auto = true; - } - }, - quote: function(e) { - var ancestor, base, caretPos, com, frag, i, insideCode, j, k, l, len, len1, len2, len3, n, node, o, post, postRange, range, ref, ref1, ref2, ref3, ref4, ref5, ref6, root, sel, text, thread, wasOnlyQuotes; - if (e != null) { - e.preventDefault(); - } - if (!QR.postingIsEnabled) { - return; - } - sel = d.getSelection(); - post = Get.postFromNode(this); - root = post.nodes.root; - postRange = new Range(); - postRange.selectNode(root); - text = post.board.ID === g.BOARD.ID ? ">>" + post + "\n" : ">>>/" + post.board + "/" + post + "\n"; - for (i = j = 0, ref = sel.rangeCount; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) { - try { - range = sel.getRangeAt(i); - if (range.compareBoundaryPoints(Range.START_TO_START, postRange) < 0) { - range.setStartBefore(root); - } - if (range.compareBoundaryPoints(Range.END_TO_END, postRange) > 0) { - range.setEndAfter(root); - } - if (!range.toString().trim()) { - continue; - } - frag = range.cloneContents(); - ancestor = range.commonAncestorContainer; - if ($.x('ancestor-or-self::*[self::s or contains(@class,"removed-spoiler")]', ancestor)) { - $.prepend(frag, $.tn('[spoiler]')); - $.add(frag, $.tn('[/spoiler]')); - } - if (insideCode = $.x('ancestor-or-self::pre[contains(@class,"prettyprint")]', ancestor)) { - $.prepend(frag, $.tn('[code]')); - $.add(frag, $.tn('[/code]')); - } - ref1 = $$((insideCode ? 'br' : '.prettyprint br'), frag); - for (k = 0, len = ref1.length; k < len; k++) { - node = ref1[k]; - $.replace(node, $.tn('\n')); - } - ref2 = $$('br', frag); - for (l = 0, len1 = ref2.length; l < len1; l++) { - node = ref2[l]; - if (node !== frag.lastChild) { - $.replace(node, $.tn('\n>')); - } - } - if (typeof (base = g.SITE).insertTags === "function") { - base.insertTags(frag); - } - ref3 = $$('.linkify[data-original]', frag); - for (n = 0, len2 = ref3.length; n < len2; n++) { - node = ref3[n]; - $.replace(node, $.tn(node.dataset.original)); - } - ref4 = $$('.embedder', frag); - for (o = 0, len3 = ref4.length; o < len3; o++) { - node = ref4[o]; - if (((ref5 = node.previousSibling) != null ? ref5.nodeValue : void 0) === ' ') { - $.rm(node.previousSibling); - } - $.rm(node); - } - text += ">" + (frag.textContent.trim()) + "\n"; - } catch (error) {} - } - QR.openPost(); - ref6 = QR.nodes, com = ref6.com, thread = ref6.thread; - if (!com.value) { - thread.value = Get.threadFromNode(this); - } - wasOnlyQuotes = QR.selected.isOnlyQuotes(); - caretPos = com.selectionStart; - com.value = com.value.slice(0, caretPos) + text + com.value.slice(com.selectionEnd); - range = caretPos + text.length; - com.setSelectionRange(range, range); - com.focus(); - if (wasOnlyQuotes) { - QR.selected.quotedText = com.value; - } - QR.selected.save(com); - return QR.selected.save(thread); - }, - characterCount: function() { - var count, counter; - counter = QR.nodes.charCount; - count = QR.nodes.com.value.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, '_').length; - counter.textContent = count; - counter.hidden = count < QR.max_comment / 2; - return (count > QR.max_comment ? $.addClass : $.rmClass)(counter, 'warning'); - }, - getFile: function() { - var ref; - return $.event('QRFile', (ref = QR.selected) != null ? ref.file : void 0); - }, - drawFile: function(e) { - var el, file, isVideo, ref; - file = (ref = QR.selected) != null ? ref.file : void 0; - if (!(file && /^(image|video)\//.test(file.type))) { - return; - } - isVideo = /^video\//.test(file); - el = $.el((isVideo ? 'video' : 'img')); - $.on(el, 'error', function() { - return QR.openError(); - }); - $.on(el, (isVideo ? 'loadeddata' : 'load'), function() { - e.target.getContext('2d').drawImage(el, 0, 0); - URL.revokeObjectURL(el.src); - return $.event('QRImageDrawn', null, e.target); - }); - return el.src = URL.createObjectURL(file); - }, - openError: function() { - var div; - div = $.el('div'); - $.extend(div, {innerHTML: "Could not open file. [More info]"}); - return QR.error(div); - }, - setFile: function(e) { - var file, name, ref, source; - ref = e.detail, file = ref.file, name = ref.name, source = ref.source; - if (name != null) { - file.name = name; - } - if (source != null) { - file.source = source; - } - QR.open(); - return QR.handleFiles([file]); - }, - drag: function(e) { - var toggle; - toggle = e.type === 'dragstart' ? $.off : $.on; - toggle(d, 'dragover', QR.dragOver); - return toggle(d, 'drop', QR.dropFile); - }, - dragOver: function(e) { - e.preventDefault(); - return e.dataTransfer.dropEffect = 'copy'; - }, - dropFile: function(e) { - if (!e.dataTransfer.files.length) { - return; - } - e.preventDefault(); - QR.open(); - return QR.handleFiles(e.dataTransfer.files); - }, - paste: function(e) { - var blob, file, file2, item, j, len, ref, score, score2, type; - if (!e.clipboardData.items) { - return; - } - file = null; - score = -1; - ref = e.clipboardData.items; - for (j = 0, len = ref.length; j < len; j++) { - item = ref[j]; - if (!(item.kind === 'file' && (file2 = item.getAsFile()))) { - continue; - } - score2 = 2 * (file2.size <= QR.max_size) + (file2.type === 'image/png'); - if (score2 > score) { - file = file2; - score = score2; - } - } - if (file) { - type = file.type; - blob = new Blob([file], { - type: type - }); - blob.name = Conf['pastedname'] + "." + ($.getOwn(QR.extensionFromType, type) || 'jpg'); - QR.open(); - QR.handleFiles([blob]); - $.addClass(QR.nodes.el, 'dump'); - } - }, - pasteFF: function() { - var arr, blob, bstr, i, images, img, j, k, len, m, pasteArea, ref, src; - pasteArea = QR.nodes.pasteArea; - if (!pasteArea.childNodes.length) { - return; - } - images = $$('img', pasteArea); - $.rmAll(pasteArea); - for (j = 0, len = images.length; j < len; j++) { - img = images[j]; - src = img.src; - if (m = src.match(/data:(image\/(\w+));base64,(.+)/)) { - bstr = atob(m[3]); - arr = new Uint8Array(bstr.length); - for (i = k = 0, ref = bstr.length; 0 <= ref ? k < ref : k > ref; i = 0 <= ref ? ++k : --k) { - arr[i] = bstr.charCodeAt(i); - } - blob = new Blob([arr], { - type: m[1] - }); - blob.name = Conf['pastedname'] + "." + m[2]; - QR.handleFiles([blob]); - } else if (/^https?:\/\//.test(src)) { - QR.handleUrl(src); - } - } - }, - handleUrl: function(urlDefault) { - QR.open(); - QR.selected.preventAutoPost(); - return CrossOrigin.permission(function() { - var url; - url = prompt('Enter a URL:', urlDefault); - if (url === null) { - return; - } - QR.nodes.fileButton.focus(); - return CrossOrigin.file(url, function(blob) { - if (blob && !/^text\//.test(blob.type)) { - return QR.handleFiles([blob]); - } else { - return QR.error("Can't load file."); - } - }); - }); - }, - handleFiles: function(files) { - var file, j, len; - if (this !== QR) { - files = slice.call(this.files); - this.value = null; - } - if (!files.length) { - return; - } - QR.cleanNotifications(); - for (j = 0, len = files.length; j < len; j++) { - file = files[j]; - QR.handleFile(file, files.length); - } - if (files.length !== 1) { - $.addClass(QR.nodes.el, 'dump'); - } - if (d.activeElement === QR.nodes.fileButton && $.hasClass(QR.nodes.fileSubmit, 'has-file')) { - return QR.nodes.filename.focus(); - } - }, - handleFile: function(file, nfiles) { - var isText, post; - isText = /^text\//.test(file.type); - if (nfiles === 1) { - post = QR.selected; - } else { - post = QR.posts[QR.posts.length - 1]; - if ((isText ? post.com || post.pasting : post.file)) { - post = new QR.post(); - } - } - return post[isText ? 'pasteText' : 'setFile'](file); - }, - openFileInput: function() { - if (QR.nodes.fileButton.disabled) { - return; - } - QR.nodes.fileInput.click(); - return QR.nodes.fileButton.focus(); - }, - generatePostableThreadsList: function() { - var j, len, list, options, ref, thread, val; - if (!QR.nodes) { - return; - } - list = QR.nodes.thread; - options = [list.firstElementChild]; - ref = g.BOARD.threads.keys; - for (j = 0, len = ref.length; j < len; j++) { - thread = ref[j]; - options.push($.el('option', { - value: thread, - textContent: "Thread " + thread - })); - } - val = list.value; - $.rmAll(list); - $.add(list, options); - list.value = val; - if (list.value === val) { - return; - } - list.value = g.VIEW === 'thread' ? g.THREADID : 'new'; - return (g.VIEW === 'thread' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread'); - }, - dialog: function() { - var classList, config, dialog, event, i, items, name, node, nodes, save, setNode; - QR.nodes = nodes = { - el: dialog = UI.dialog('qr', {innerHTML: "
        ×
        No selected file
        "}) - }; - setNode = function(name, query) { - return nodes[name] = $(query, dialog); - }; - setNode('move', '.move'); - setNode('autohide', '#autohide'); - setNode('close', '.close'); - setNode('thread', 'select'); - setNode('form', 'form'); - setNode('sjisToggle', '#sjis-toggle'); - setNode('texButton', '#tex-preview-button'); - setNode('name', '[data-name=name]'); - setNode('email', '[data-name=email]'); - setNode('sub', '[data-name=sub]'); - setNode('com', '[data-name=com]'); - setNode('charCount', '#char-count'); - setNode('texPreview', '#tex-preview'); - setNode('dumpList', '#dump-list'); - setNode('addPost', '#add-post'); - setNode('oekaki', '.oekaki'); - setNode('drawButton', '#qr-draw-button'); - setNode('fileSubmit', '#file-n-submit'); - setNode('fileButton', '#qr-file-button'); - setNode('noFile', '#qr-no-file'); - setNode('filename', '#qr-filename'); - setNode('spoiler', '#qr-file-spoiler'); - setNode('oekakiButton', '#qr-oekaki-button'); - setNode('fileRM', '#qr-filerm'); - setNode('urlButton', '#url-button'); - setNode('pasteArea', '#paste-area'); - setNode('customCooldown', '#custom-cooldown-button'); - setNode('dumpButton', '#dump-button'); - setNode('status', '[type=submit]'); - setNode('flashTag', '[name=filetag]'); - setNode('fileInput', '[type=file]'); - config = g.BOARD.config; - classList = QR.nodes.el.classList; - classList.toggle('forced-anon', QR.forcedAnon); - classList.toggle('has-spoiler', QR.spoiler); - classList.toggle('has-sjis', !!config.sjis_tags); - classList.toggle('has-math', !!config.math_tags); - classList.toggle('sjis-preview', !!config.sjis_tags && Conf['sjisPreview']); - classList.toggle('show-new-thread-option', Conf['Show New Thread Option in Threads']); - if (parseInt(Conf['customCooldown'], 10) > 0) { - $.addClass(QR.nodes.fileSubmit, 'custom-cooldown'); - $.get('customCooldownEnabled', Conf['customCooldownEnabled'], function(arg) { - var customCooldownEnabled; - customCooldownEnabled = arg.customCooldownEnabled; - QR.setCustomCooldown(customCooldownEnabled); - return $.sync('customCooldownEnabled', QR.setCustomCooldown); - }); - } - QR.flagsInput(); - $.on(nodes.autohide, 'change', QR.toggleHide); - $.on(nodes.close, 'click', QR.close); - $.on(nodes.status, 'click', QR.submit); - $.on(nodes.form, 'submit', QR.submit); - $.on(nodes.sjisToggle, 'click', QR.toggleSJIS); - $.on(nodes.texButton, 'mousedown', QR.texPreviewShow); - $.on(nodes.texButton, 'mouseup', QR.texPreviewHide); - $.on(nodes.addPost, 'click', function() { - return new QR.post(true); - }); - $.on(nodes.drawButton, 'click', QR.oekaki.draw); - $.on(nodes.fileButton, 'click', QR.openFileInput); - $.on(nodes.noFile, 'click', QR.openFileInput); - $.on(nodes.filename, 'focus', function() { - return $.addClass(this.parentNode, 'focus'); - }); - $.on(nodes.filename, 'blur', function() { - return $.rmClass(this.parentNode, 'focus'); - }); - $.on(nodes.spoiler, 'change', function() { - return QR.selected.nodes.spoiler.click(); - }); - $.on(nodes.oekakiButton, 'click', QR.oekaki.button); - $.on(nodes.fileRM, 'click', function() { - return QR.selected.rmFile(); - }); - $.on(nodes.urlButton, 'click', function() { - return QR.handleUrl(''); - }); - $.on(nodes.customCooldown, 'click', QR.toggleCustomCooldown); - $.on(nodes.dumpButton, 'click', function() { - return nodes.el.classList.toggle('dump'); - }); - $.on(nodes.fileInput, 'change', QR.handleFiles); - window.addEventListener('focus', QR.focus, true); - window.addEventListener('blur', QR.focus, true); - $.on(d, 'click', QR.focus); - if ($.engine === 'gecko' && !window.DataTransferItemList) { - nodes.pasteArea.hidden = false; - } - new MutationObserver(QR.pasteFF).observe(nodes.pasteArea, { - childList: true - }); - items = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'flag']; - i = 0; - save = function() { - return QR.selected.save(this); - }; - while (name = items[i++]) { - if (!(node = nodes[name])) { - continue; - } - event = node.nodeName === 'SELECT' ? 'change' : 'input'; - $.on(nodes[name], event, save); - } - if ($.engine === 'gecko' && Conf['Remember QR Size']) { - $.get('QR Size', '', function(item) { - return nodes.com.style.cssText = item['QR Size']; - }); - $.on(nodes.com, 'mouseup', function(e) { - if (e.button !== 0) { - return; - } - return $.set('QR Size', this.style.cssText); - }); - } - QR.generatePostableThreadsList(); - QR.persona.load(); - new QR.post(true); - QR.status(); - QR.cooldown.setup(); - QR.captcha.init(); - $.add(d.body, dialog); - QR.captcha.setup(); - QR.oekaki.setup(); - return $.event('QRDialogCreation', null, dialog); - }, - flags: function() { - var addFlag, ref, select, textContent, value; - select = $.el('select', { - name: 'flag', - className: 'flagSelector' - }); - addFlag = function(value, textContent) { - return $.add(select, $.el('option', { - value: value, - textContent: textContent - })); - }; - addFlag('0', (g.BOARD.config.country_flags ? 'Geographic Location' : 'None')); - ref = g.BOARD.config.board_flags; - for (value in ref) { - textContent = ref[value]; - addFlag(value, textContent); - } - return select; - }, - flagsInput: function() { - var flag, nodes; - nodes = QR.nodes; - if (!nodes) { - return; - } - if (nodes.flag) { - $.rm(nodes.flag); - delete nodes.flag; - } - if (g.BOARD.config.board_flags) { - flag = QR.flags(); - flag.dataset.name = 'flag'; - flag.dataset["default"] = '0'; - nodes.flag = flag; - return $.add(nodes.form, flag); - } - }, - submit: function(e) { - var captcha, cb, err, filetag, force, formData, options, post, ref, thread, threadID; - if (e != null) { - e.preventDefault(); - } - force = e != null ? e.shiftKey : void 0; - if (QR.req) { - QR.abort(); - return; - } - $.forceSync('cooldowns'); - if (QR.cooldown.seconds) { - if (force) { - QR.cooldown.clear(); - } else { - QR.cooldown.auto = !QR.cooldown.auto; - QR.status(); - return; - } - } - post = QR.posts[0]; - delete post.quotedText; - post.forceSave(); - threadID = post.thread; - thread = g.BOARD.threads.get(threadID); - if (g.BOARD.ID === 'f' && threadID === 'new') { - filetag = QR.nodes.flashTag.value; - } - if (threadID === 'new') { - threadID = null; - if (!!g.BOARD.config.require_subject && !post.sub) { - err = 'New threads require a subject.'; - } else if (!(!!g.BOARD.config.text_only || post.file)) { - err = 'No file selected.'; - } - } else if (g.BOARD.threads.get(threadID).isClosed) { - err = 'You can\'t reply to this thread anymore.'; - } else if (!(post.com || post.file)) { - err = 'No comment or file.'; - } else if (post.file && thread.fileLimit) { - err = 'Max limit of image replies has been reached.'; - } - if (g.BOARD.ID === 'r9k' && !((ref = post.com) != null ? ref.match(/[a-z-]/i) : void 0)) { - err || (err = 'Original comment required.'); - } - if (QR.captcha.isEnabled && !(QR.captcha === Captcha.v2 && /\b_ct=/.test(d.cookie) && threadID) && !(err && !force)) { - captcha = QR.captcha.getOne(!!threadID); - if (QR.captcha === Captcha.v2) { - captcha || (captcha = Captcha.cache.request(!!threadID)); - } - if (!captcha) { - err = 'No valid captcha.'; - QR.captcha.setup(!QR.cooldown.auto || d.activeElement === QR.nodes.status); - } - } - QR.cleanNotifications(); - if (err && !force) { - QR.cooldown.auto = false; - QR.status(); - QR.error(err); - return; - } - QR.cooldown.auto = QR.posts.length > 1; - post.lock(); - formData = { - MAX_FILE_SIZE: QR.max_size, - mode: 'regist', - pwd: QR.persona.getPassword(), - resto: threadID, - name: !QR.forcedAnon ? post.name : void 0, - email: post.email, - sub: !(QR.forcedAnon || threadID) ? post.sub : void 0, - com: post.com, - upfile: post.file, - filetag: filetag, - spoiler: post.spoiler, - flag: post.flag - }; - options = { - responseType: 'document', - withCredentials: true, - onloadend: QR.response, - form: $.formData(formData) - }; - if (Conf['Show Upload Progress']) { - options.onprogress = function(e) { - var ref1; - if (this !== ((ref1 = QR.req) != null ? ref1.upload : void 0)) { - return; - } - if (e.loaded < e.total) { - QR.req.progress = (Math.round(e.loaded / e.total * 100)) + "%"; - } else { - QR.req.isUploadFinished = true; - QR.req.progress = '...'; - } - return QR.status(); - }; - } - cb = function(response) { - var key, val; - if (response != null) { - QR.currentCaptcha = response; - if (QR.captcha === Captcha.v2) { - if (response.challenge != null) { - options.form.append('recaptcha_challenge_field', response.challenge); - options.form.append('recaptcha_response_field', response.response); - } else { - options.form.append('g-recaptcha-response', response.response); - } - } else { - for (key in response) { - val = response[key]; - options.form.append(key, val); - } - } - } - QR.req = $.ajax("https://sys." + (location.hostname.split('.')[1]) + ".org/" + g.BOARD + "/post", options); - return QR.req.progress = '...'; - }; - if (typeof captcha === 'function') { - QR.req = { - progress: '...', - abort: function() { - if (QR.captcha === Captcha.v2) { - Captcha.cache.abort(); - } - return cb = null; - } - }; - captcha(function(response) { - if (QR.captcha === Captcha.v2 && Captcha.cache.haveCookie()) { - if (typeof cb === "function") { - cb(); - } - if (response) { - return Captcha.cache.save(response); - } - } else if (response) { - return typeof cb === "function" ? cb(response) : void 0; - } else { - delete QR.req; - post.unlock(); - QR.cooldown.auto = !!Captcha.cache.getCount(); - return QR.status(); - } - }); - } else { - cb(captcha); - } - return QR.status(); - }, - response: function() { - var URL, _, base, connErr, err, h1, isReply, j, lastPostToThread, len, m, mi, open, post, postID, postsCount, ref, ref1, ref2, ref3, seconds, threadID; - if (this !== QR.req) { - return; - } - delete QR.req; - post = QR.posts[0]; - post.unlock(); - if ((err = (ref = this.response) != null ? ref.getElementById('errmsg') : void 0)) { - if ((ref1 = $('a', err)) != null) { - ref1.target = '_blank'; - } - } else if ((connErr = !this.response || this.response.title !== 'Post successful!')) { - err = QR.connectionError(); - if (QR.captcha === Captcha.v2 && QR.currentCaptcha) { - Captcha.cache.save(QR.currentCaptcha); - } - } else if (this.status !== 200) { - err = "Error " + this.statusText + " (" + this.status + ")"; - } - if (!connErr) { - if (typeof (base = QR.captcha).setUsed === "function") { - base.setUsed(); - } - } - delete QR.currentCaptcha; - if (err) { - QR.errorCount = (QR.errorCount || 0) + 1; - if (/captcha|verification/i.test(err.textContent) || connErr) { - if (/mistyped/i.test(err.textContent)) { - err = 'You mistyped the CAPTCHA, or the CAPTCHA malfunctioned.'; - } else if (/expired/i.test(err.textContent)) { - err = 'This CAPTCHA is no longer valid because it has expired.'; - } - if (QR.errorCount >= 5) { - QR.cooldown.auto = false; - } else { - QR.cooldown.auto = QR.captcha.isEnabled || connErr; - QR.cooldown.addDelay(post, 2); - } - } else if (err.textContent && (m = err.textContent.match(/\d+\s+(?:minute|second)/gi)) && !/duplicate|hour/i.test(err.textContent)) { - QR.cooldown.auto = !/have\s+been\s+muted/i.test(err.textContent); - seconds = 0; - for (j = 0, len = m.length; j < len; j++) { - mi = m[j]; - seconds += (/minute/i.test(mi) ? 60 : 1) * (+mi.match(/\d+/)[0]); - } - if (/muted/i.test(err.textContent)) { - QR.cooldown.addMute(seconds); - } else { - QR.cooldown.addDelay(post, seconds); - } - } else { - QR.cooldown.auto = false; - } - QR.captcha.setup(QR.cooldown.auto && ((ref2 = d.activeElement) === QR.nodes.status || ref2 === d.body)); - QR.status(); - QR.error(err); - return; - } - delete QR.errorCount; - h1 = $('h1', this.response); - ref3 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref3[0], threadID = ref3[1], postID = ref3[2]; - postID = +postID; - threadID = +threadID || postID; - isReply = threadID !== postID; - $.event('QRPostSuccessful', { - boardID: g.BOARD.ID, - threadID: threadID, - postID: postID - }); - $.event('QRPostSuccessful_', { - boardID: g.BOARD.ID, - threadID: threadID, - postID: postID - }); - postsCount = QR.posts.length - 1; - QR.cooldown.auto = postsCount && isReply; - lastPostToThread = !((function() { - var k, len1, p, ref4; - ref4 = QR.posts.slice(1); - for (k = 0, len1 = ref4.length; k < len1; k++) { - p = ref4[k]; - if (p.thread === post.thread) { - return true; - } - } - })()); - if (postsCount) { - post.rm(); - QR.captcha.setup(d.activeElement === QR.nodes.status); - } else if (Conf['Persistent QR']) { - post.rm(); - if (Conf['Auto Hide QR']) { - QR.hide(); - } else { - QR.blur(); - } - } else { - QR.close(); - } - QR.cleanNotifications(); - if (Conf['Posting Success Notifications']) { - QR.notifications.push(new Notice('success', h1.textContent, 5)); - } - QR.cooldown.add(threadID, postID); - URL = threadID === postID ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID : threadID !== g.THREADID && lastPostToThread && Conf['Open Post in New Tab'] ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID + "#p" + postID : void 0; - if (URL) { - open = Conf['Open Post in New Tab'] || postsCount ? function() { - return $.open(URL); - } : function() { - return location.href = URL; - }; - if (threadID === postID) { - QR.waitForThread(URL, open); - } else { - open(); - } - } - return QR.status(); - }, - waitForThread: function(url, cb) { - var attempts, check; - attempts = 0; - check = function() { - return $.ajax(url, { - onloadend: function() { - attempts++; - if (attempts >= 6 || this.status === 200) { - return cb(); - } else { - return setTimeout(check, attempts * $.SECOND); - } - }, - responseType: 'text', - type: 'HEAD' - }); - }; - return check(); - }, - abort: function() { - var oldReq; - if ((oldReq = QR.req) && !QR.req.isUploadFinished) { - delete QR.req; - oldReq.abort(); - if (QR.captcha === Captcha.v2 && QR.currentCaptcha) { - Captcha.cache.save(QR.currentCaptcha); - } - delete QR.currentCaptcha; - QR.posts[0].unlock(); - QR.cooldown.auto = false; - QR.notifications.push(new Notice('info', 'QR upload aborted.', 5)); - } - return QR.status(); - } - }; - - return QR; - -}).call(this); - -(function() { - QR.cooldown = { - seconds: 0, - delays: { - deletion: 60 - }, - init: function() { - if (!Conf['Quick Reply']) { - return; - } - this.data = Conf['cooldowns']; - this.changes = $.dict(); - return $.sync('cooldowns', this.sync); - }, - setup: function() { - var delay, ref, type; - $.extend(QR.cooldown.delays, g.BOARD.cooldowns()); - QR.cooldown.maxDelay = 0; - ref = QR.cooldown.delays; - for (type in ref) { - delay = ref[type]; - if (type !== 'thread' && type !== 'thread_global') { - QR.cooldown.maxDelay = Math.max(QR.cooldown.maxDelay, delay); - } - } - QR.cooldown.isSetup = true; - return QR.cooldown.start(); - }, - start: function() { - var data; - data = QR.cooldown.data; - if (!(Conf['Cooldown'] && QR.cooldown.isSetup && !QR.cooldown.isCounting && Object.keys(data[g.BOARD.ID] || {}).length + Object.keys(data.global || {}).length > 0)) { - return; - } - QR.cooldown.isCounting = true; - return QR.cooldown.count(); - }, - sync: function(data) { - QR.cooldown.data = data || $.dict(); - return QR.cooldown.start(); - }, - add: function(threadID, postID) { - var boardID, start; - if (!Conf['Cooldown']) { - return; - } - start = Date.now(); - boardID = g.BOARD.ID; - QR.cooldown.set(boardID, start, { - threadID: threadID, - postID: postID - }); - if (threadID === postID) { - QR.cooldown.set('global', start, { - boardID: boardID, - threadID: threadID, - postID: postID - }); - } - QR.cooldown.save(); - return QR.cooldown.start(); - }, - addDelay: function(post, delay) { - var cooldown; - if (!Conf['Cooldown']) { - return; - } - cooldown = QR.cooldown.categorize(post); - cooldown.delay = delay; - QR.cooldown.set(g.BOARD.ID, Date.now(), cooldown); - QR.cooldown.save(); - return QR.cooldown.start(); - }, - addMute: function(delay) { - if (!Conf['Cooldown']) { - return; - } - QR.cooldown.set(g.BOARD.ID, Date.now(), { - type: 'mute', - delay: delay - }); - QR.cooldown.save(); - return QR.cooldown.start(); - }, - "delete": function(post) { - var base, cooldown, cooldowns, id, name; - if (!QR.cooldown.data) { - return; - } - cooldowns = ((base = QR.cooldown.data)[name = post.board.ID] || (base[name] = $.dict())); - for (id in cooldowns) { - cooldown = cooldowns[id]; - if ((cooldown.delay == null) && cooldown.threadID === post.thread.ID && cooldown.postID === post.ID) { - QR.cooldown.set(post.board.ID, id, null); - } - } - return QR.cooldown.save(); - }, - secondsDeletion: function(post) { - var cooldown, cooldowns, seconds, start; - if (!(QR.cooldown.data && Conf['Cooldown'])) { - return 0; - } - cooldowns = QR.cooldown.data[post.board.ID] || $.dict(); - for (start in cooldowns) { - cooldown = cooldowns[start]; - if ((cooldown.delay == null) && cooldown.threadID === post.thread.ID && cooldown.postID === post.ID) { - seconds = QR.cooldown.delays.deletion - Math.floor((Date.now() - start) / $.SECOND); - return Math.max(seconds, 0); - } - } - return 0; - }, - categorize: function(post) { - if (post.thread === 'new') { - return { - type: 'thread' - }; - } else { - return { - type: !!post.file ? 'image' : 'reply', - threadID: +post.thread - }; - } - }, - mergeChange: function(data, scope, id, value) { - if (value) { - return (data[scope] || (data[scope] = $.dict()))[id] = value; - } else if (scope in data) { - delete data[scope][id]; - if (Object.keys(data[scope]).length === 0) { - return delete data[scope]; - } - } - }, - set: function(scope, id, value) { - var base; - QR.cooldown.mergeChange(QR.cooldown.data, scope, id, value); - return ((base = QR.cooldown.changes)[scope] || (base[scope] = $.dict()))[id] = value; - }, - save: function() { - var changes; - changes = QR.cooldown.changes; - if (!Object.keys(changes).length) { - return; - } - return $.get('cooldowns', $.dict(), function(arg) { - var cooldowns, id, ref, scope, value; - cooldowns = arg.cooldowns; - for (scope in QR.cooldown.changes) { - ref = QR.cooldown.changes[scope]; - for (id in ref) { - value = ref[id]; - QR.cooldown.mergeChange(cooldowns, scope, id, value); - } - QR.cooldown.data = cooldowns; - } - return $.set('cooldowns', cooldowns, function() { - return QR.cooldown.changes = $.dict(); - }); - }); - }, - clear: function() { - QR.cooldown.data = $.dict(); - QR.cooldown.changes = $.dict(); - QR.cooldown.auto = false; - QR.cooldown.update(); - return $.queueTask($["delete"], 'cooldowns'); - }, - update: function() { - var base, cooldown, cooldowns, elapsed, i, len, maxDelay, nCooldowns, now, ref, ref1, save, scope, seconds, start, suffix, threadID, type, update; - if (!QR.cooldown.isCounting) { - return; - } - save = false; - nCooldowns = 0; - now = Date.now(); - ref = QR.cooldown.categorize(QR.posts[0]), type = ref.type, threadID = ref.threadID; - seconds = 0; - if (Conf['Cooldown']) { - ref1 = [g.BOARD.ID, 'global']; - for (i = 0, len = ref1.length; i < len; i++) { - scope = ref1[i]; - cooldowns = ((base = QR.cooldown.data)[scope] || (base[scope] = $.dict())); - for (start in cooldowns) { - cooldown = cooldowns[start]; - start = +start; - elapsed = Math.floor((now - start) / $.SECOND); - if (elapsed < 0) { - QR.cooldown.set(scope, start, null); - save = true; - continue; - } - if (cooldown.delay != null) { - if (cooldown.delay <= elapsed) { - QR.cooldown.set(scope, start, null); - save = true; - } else if ((cooldown.type === type && cooldown.threadID === threadID) || cooldown.type === 'mute') { - seconds = Math.max(seconds, cooldown.delay - elapsed); - } - continue; - } - maxDelay = cooldown.threadID !== cooldown.postID ? QR.cooldown.maxDelay : QR.cooldown.delays[scope === 'global' ? 'thread_global' : 'thread']; - if (QR.cooldown.customCooldown) { - maxDelay = Math.max(maxDelay, parseInt(Conf['customCooldown'], 10)); - } - if (maxDelay <= elapsed) { - QR.cooldown.set(scope, start, null); - save = true; - continue; - } - if ((type === 'thread') === (cooldown.threadID === cooldown.postID) && cooldown.boardID !== g.BOARD.ID) { - suffix = scope === 'global' ? '_global' : ''; - seconds = Math.max(seconds, QR.cooldown.delays[type + suffix] - elapsed); - if (QR.cooldown.customCooldown) { - seconds = Math.max(seconds, parseInt(Conf['customCooldown'], 10) - elapsed); - } - } - } - nCooldowns += Object.keys(cooldowns).length; - } - } - if (save) { - QR.cooldown.save; - } - if (nCooldowns) { - clearTimeout(QR.cooldown.timeout); - QR.cooldown.timeout = setTimeout(QR.cooldown.count, $.SECOND); - } else { - delete QR.cooldown.isCounting; - } - update = seconds !== QR.cooldown.seconds; - QR.cooldown.seconds = seconds; - if (update) { - return QR.status(); - } - }, - count: function() { - QR.cooldown.update(); - if (QR.cooldown.seconds === 0 && QR.cooldown.auto && !QR.req) { - return QR.submit(); - } - } - }; - -}).call(this); - -(function() { - QR.oekaki = { - menu: { - init: function() { - var a, ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Menu'] && Conf['Edit Link'] && Conf['Quick Reply'])) { - return; - } - a = $.el('a', { - className: 'edit-link', - href: 'javascript:;', - textContent: 'Edit image' - }); - $.on(a, 'click', this.editFile); - return Menu.menu.addEntry({ - el: a, - order: 90, - open: function(post) { - var file; - QR.oekaki.menu.post = post; - file = post.file; - return QR.postingIsEnabled && !!file && (file.isImage || file.isVideo); - } - }); - }, - editFile: function() { - var currentTime, isVideo, post, ref; - post = QR.oekaki.menu.post; - QR.quote.call(post.nodes.post); - isVideo = post.file.isVideo; - currentTime = ((ref = post.file.fullImage) != null ? ref.currentTime : void 0) || 0; - return CrossOrigin.file(post.file.url, function(blob) { - var video; - if (!blob) { - return QR.error("Can't load file."); - } else if (isVideo) { - video = $.el('video'); - $.on(video, 'loadedmetadata', function() { - $.on(video, 'seeked', function() { - var canvas; - canvas = $.el('canvas', { - width: video.videoWidth, - height: video.videoHeight - }); - canvas.getContext('2d').drawImage(video, 0, 0); - return canvas.toBlob(function(snapshot) { - snapshot.name = post.file.name.replace(/\.\w+$/, '') + '.png'; - QR.handleFiles([snapshot]); - return QR.oekaki.edit(); - }); - }); - return video.currentTime = currentTime; - }); - $.on(video, 'error', function() { - return QR.openError(); - }); - return video.src = URL.createObjectURL(blob); - } else { - blob.name = post.file.name; - QR.handleFiles([blob]); - return QR.oekaki.edit(); - } - }); - } - }, - setup: function() { - return $.global(function() { - var FCX; - FCX = window.FCX; - FCX.oekakiCB = function() { - return window.Tegaki.flatten().toBlob(function(file) { - var source; - source = "oekaki-" + (Date.now()); - FCX.oekakiLatest = source; - return document.dispatchEvent(new CustomEvent('QRSetFile', { - bubbles: true, - detail: { - file: file, - name: FCX.oekakiName, - source: source - } - })); - }); - }; - if (window.Tegaki) { - return document.querySelector('#qr .oekaki').hidden = false; - } - }); - }, - load: function(cb) { - var n, onload, script, style; - if ($('script[src^="//s.4cdn.org/js/tegaki"]', d.head)) { - return cb(); - } else { - style = $.el('link', { - rel: 'stylesheet', - href: "//s.4cdn.org/css/tegaki." + (Date.now()) + ".css" - }); - script = $.el('script', { - src: "//s.4cdn.org/js/tegaki.min." + (Date.now()) + ".js" - }); - n = 0; - onload = function() { - if (++n === 2) { - return cb(); - } - }; - $.on(style, 'load', onload); - $.on(script, 'load', onload); - return $.add(d.head, [style, script]); - } - }, - draw: function() { - return $.global(function() { - var FCX, Tegaki; - Tegaki = window.Tegaki, FCX = window.FCX; - if (Tegaki.bg) { - Tegaki.destroy(); - } - FCX.oekakiName = 'tegaki.png'; - return Tegaki.open({ - onDone: FCX.oekakiCB, - onCancel: function() { - return Tegaki.bgColor = '#ffffff'; - }, - width: +document.querySelector('#qr [name=oekaki-width]').value, - height: +document.querySelector('#qr [name=oekaki-height]').value, - bgColor: document.querySelector('#qr [name=oekaki-bg]').checked ? document.querySelector('#qr [name=oekaki-bgcolor]').value : 'transparent' - }); - }); - }, - button: function() { - if (QR.selected.file) { - return QR.oekaki.edit(); - } else { - return QR.oekaki.toggle(); - } - }, - edit: function() { - return QR.oekaki.load(function() { - return $.global(function() { - var FCX, Tegaki, cb, error, name, source; - Tegaki = window.Tegaki, FCX = window.FCX; - name = document.getElementById('qr-filename').value.replace(/\.\w+$/, '') + '.png'; - source = document.getElementById('file-n-submit').dataset.source; - error = function(content) { - return document.dispatchEvent(new CustomEvent('CreateNotification', { - bubbles: true, - detail: { - type: 'warning', - content: content, - lifetime: 20 - } - })); - }; - cb = function(e) { - var canvas, selected; - if (e) { - this.removeEventListener('QRMetadata', cb, false); - } - selected = document.getElementById('selected'); - if (!(selected != null ? selected.dataset.type : void 0)) { - return error('No file to edit.'); - } - if (!/^(image|video)\//.test(selected.dataset.type)) { - return error('Not an image.'); - } - if (!selected.dataset.height) { - return error('Metadata not available.'); - } - if (selected.dataset.height === 'loading') { - selected.addEventListener('QRMetadata', cb, false); - return; - } - if (Tegaki.bg) { - Tegaki.destroy(); - } - FCX.oekakiName = name; - Tegaki.open({ - onDone: FCX.oekakiCB, - onCancel: function() { - return Tegaki.bgColor = '#ffffff'; - }, - width: +selected.dataset.width, - height: +selected.dataset.height, - bgColor: 'transparent' - }); - canvas = document.createElement('canvas'); - canvas.width = canvas.naturalWidth = +selected.dataset.width; - canvas.height = canvas.naturalHeight = +selected.dataset.height; - canvas.hidden = true; - document.body.appendChild(canvas); - canvas.addEventListener('QRImageDrawn', function() { - this.remove(); - return Tegaki.onOpenImageLoaded.call(this); - }, false); - return canvas.dispatchEvent(new CustomEvent('QRDrawFile', { - bubbles: true - })); - }; - if (Tegaki.bg && Tegaki.onDoneCb === FCX.oekakiCB && source === FCX.oekakiLatest) { - FCX.oekakiName = name; - return Tegaki.resume(); - } else { - return cb(); - } - }); - }); - }, - toggle: function() { - return QR.oekaki.load(function() { - return QR.nodes.oekaki.hidden = !QR.nodes.oekaki.hidden; - }); - } - }; - -}).call(this); - -(function() { - var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - QR.persona = { - always: {}, - types: { - name: [], - email: [], - sub: [] - }, - init: function() { - var i, item, len, ref; - if (!(Conf['Quick Reply'] || (Conf['Menu'] && Conf['Delete Link']))) { - return; - } - ref = Conf['QR.personas'].split('\n'); - for (i = 0, len = ref.length; i < len; i++) { - item = ref[i]; - QR.persona.parseItem(item.trim()); - } - }, - parseItem: function(item) { - var boards, match, ref, ref1, ref2, type, val; - if (item[0] === '#') { - return; - } - if (!(match = item.match(/(name|options|email|subject|password):"(.*)"/i))) { - return; - } - ref = match, match = ref[0], type = ref[1], val = ref[2]; - item = item.replace(match, ''); - boards = ((ref1 = item.match(/boards:([^;]+)/i)) != null ? ref1[1].toLowerCase() : void 0) || 'global'; - if (boards !== 'global' && (ref2 = g.BOARD.ID, indexOf.call(boards.split(','), ref2) < 0)) { - return; - } - if (type === 'password') { - QR.persona.pwd = val; - return; - } - if (type === 'options') { - type = 'email'; - } - if (type === 'subject') { - type = 'sub'; - } - if (/always/i.test(item)) { - QR.persona.always[type] = val; - } - if (indexOf.call(QR.persona.types[type], val) < 0) { - return QR.persona.types[type].push(val); - } - }, - load: function() { - var arr, i, len, list, ref, type, val; - ref = QR.persona.types; - for (type in ref) { - arr = ref[type]; - list = $("#list-" + type, QR.nodes.el); - for (i = 0, len = arr.length; i < len; i++) { - val = arr[i]; - if (val) { - $.add(list, $.el('option', { - textContent: val - })); - } - } - } - }, - getPassword: function() { - var m; - if (QR.persona.pwd != null) { - return QR.persona.pwd; - } else if ((m = d.cookie.match(/4chan_pass=([^;]+)/))) { - return decodeURIComponent(m[1]); - } else { - return ''; - } - }, - get: function(cb) { - return $.get('QR.persona', {}, function(arg) { - var persona; - persona = arg['QR.persona']; - return cb(persona); - }); - }, - set: function(post) { - return $.get('QR.persona', {}, function(arg) { - var persona; - persona = arg['QR.persona']; - persona = { - name: post.name, - flag: post.flag - }; - return $.set('QR.persona', persona); - }); - } - }; - -}).call(this); - -(function() { - var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - slice = [].slice; - - QR.post = (function() { - function _Class(select) { - this.select = bind(this.select, this); - var el, event, i, j, label, len, len1, prev, ref, ref1; - el = $.el('a', { - className: 'qr-preview', - draggable: true, - href: 'javascript:;' - }); - $.extend(el, {innerHTML: ""}); - this.nodes = { - el: el, - rm: el.firstChild, - spoiler: $('.qr-preview-spoiler input', el), - span: el.lastChild - }; - $.on(el, 'click', this.select); - $.on(this.nodes.rm, 'click', (function(_this) { - return function(e) { - e.stopPropagation(); - return _this.rm(); - }; - })(this)); - $.on(this.nodes.spoiler, 'change', (function(_this) { - return function(e) { - _this.spoiler = e.target.checked; - if (_this === QR.selected) { - QR.nodes.spoiler.checked = _this.spoiler; - } - return _this.preventAutoPost(); - }; - })(this)); - ref = $$('label', el); - for (i = 0, len = ref.length; i < len; i++) { - label = ref[i]; - $.on(label, 'click', function(e) { - return e.stopPropagation(); - }); - } - $.add(QR.nodes.dumpList, el); - ref1 = ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop']; - for (j = 0, len1 = ref1.length; j < len1; j++) { - event = ref1[j]; - $.on(el, event.toLowerCase(), this[event]); - } - this.thread = g.VIEW === 'thread' ? g.THREADID : 'new'; - prev = QR.posts[QR.posts.length - 1]; - QR.posts.push(this); - this.nodes.spoiler.checked = this.spoiler = prev && Conf['Remember Spoiler'] ? prev.spoiler : false; - QR.persona.get((function(_this) { - return function(persona) { - _this.name = 'name' in QR.persona.always ? QR.persona.always.name : prev ? prev.name : persona.name; - _this.email = 'email' in QR.persona.always ? QR.persona.always.email : ''; - _this.sub = 'sub' in QR.persona.always ? QR.persona.always.sub : ''; - if (QR.nodes.flag) { - _this.flag = prev ? prev.flag : persona.flag && persona.flag in g.BOARD.config.board_flags ? persona.flag : void 0; - } - if (QR.selected === _this) { - return _this.load(); - } - }; - })(this)); - if (select) { - this.select(); - } - this.unlock(); - QR.captcha.moreNeeded(); - } - - _Class.prototype.rm = function() { - var base, index; - this["delete"](); - index = QR.posts.indexOf(this); - if (QR.posts.length === 1) { - new QR.post(true); - $.rmClass(QR.nodes.el, 'dump'); - } else if (this === QR.selected) { - (QR.posts[index - 1] || QR.posts[index + 1]).select(); - } - QR.posts.splice(index, 1); - QR.status(); - return typeof (base = QR.captcha).updateThread === "function" ? base.updateThread() : void 0; - }; - - _Class.prototype["delete"] = function() { - $.rm(this.nodes.el); - URL.revokeObjectURL(this.URL); - return this.dismissErrors(); - }; - - _Class.prototype.lock = function(lock) { - var i, len, name, node, ref; - if (lock == null) { - lock = true; - } - this.isLocked = lock; - if (this !== QR.selected) { - return; - } - ref = ['thread', 'name', 'email', 'sub', 'com', 'fileButton', 'filename', 'spoiler', 'flag']; - for (i = 0, len = ref.length; i < len; i++) { - name = ref[i]; - if (node = QR.nodes[name]) { - node.disabled = lock; - } - } - this.nodes.rm.style.visibility = lock ? 'hidden' : ''; - this.nodes.spoiler.disabled = lock; - return this.nodes.el.draggable = !lock; - }; - - _Class.prototype.unlock = function() { - return this.lock(false); - }; - - _Class.prototype.select = function() { - var rectEl, rectList; - if (QR.selected) { - QR.selected.nodes.el.removeAttribute('id'); - QR.selected.forceSave(); - } - QR.selected = this; - this.lock(this.isLocked); - this.nodes.el.id = 'selected'; - rectEl = this.nodes.el.getBoundingClientRect(); - rectList = this.nodes.el.parentNode.getBoundingClientRect(); - this.nodes.el.parentNode.scrollLeft += rectEl.left + rectEl.width / 2 - rectList.left - rectList.width / 2; - return this.load(); - }; - - _Class.prototype.load = function() { - var i, len, name, node, ref; - ref = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'flag']; - for (i = 0, len = ref.length; i < len; i++) { - name = ref[i]; - if (!(node = QR.nodes[name])) { - continue; - } - node.value = this[name] || node.dataset["default"] || ''; - } - (this.thread !== 'new' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread'); - this.showFileData(); - return QR.characterCount(); - }; - - _Class.prototype.save = function(input, forced) { - var base, name, prev; - if (input.type === 'checkbox') { - this.spoiler = input.checked; - return; - } - name = input.dataset.name; - if (name !== 'thread' && name !== 'name' && name !== 'email' && name !== 'sub' && name !== 'com' && name !== 'filename' && name !== 'flag') { - return; - } - prev = this[name] || input.dataset["default"] || null; - this[name] = input.value || input.dataset["default"] || null; - switch (name) { - case 'thread': - (this.thread !== 'new' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread'); - QR.status(); - if (typeof (base = QR.captcha).updateThread === "function") { - base.updateThread(); - } - break; - case 'com': - this.updateComment(); - break; - case 'filename': - if (!this.file) { - return; - } - this.saveFilename(); - this.updateFilename(); - break; - case 'name': - case 'flag': - if (this[name] !== prev) { - QR.persona.set(this); - } - } - if (!forced) { - return this.preventAutoPost(); - } - }; - - _Class.prototype.forceSave = function() { - var i, len, name, node, ref; - if (this !== QR.selected) { - return; - } - ref = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'spoiler', 'flag']; - for (i = 0, len = ref.length; i < len; i++) { - name = ref[i]; - if (!(node = QR.nodes[name])) { - continue; - } - this.save(node, true); - } - }; - - _Class.prototype.preventAutoPost = function() { - if (QR.cooldown.auto && this === QR.posts[0]) { - QR.cooldown.update(); - if (QR.cooldown.seconds <= 5) { - return QR.cooldown.auto = false; - } - } - }; - - _Class.prototype.setComment = function(com) { - this.com = com || null; - if (this === QR.selected) { - QR.nodes.com.value = this.com; - } - return this.updateComment(); - }; - - _Class.prototype.updateComment = function() { - if (this === QR.selected) { - QR.characterCount(); - } - this.nodes.span.textContent = this.com; - QR.captcha.moreNeeded(); - if (QR.captcha === Captcha.v2) { - return Captcha.cache.prerequest(); - } - }; - - _Class.prototype.isOnlyQuotes = function() { - return (this.com || '').trim() === (this.quotedText || '').trim(); - }; - - _Class.rmErrored = function(e) { - var error, errors, i, j, len, post, ref; - e.stopPropagation(); - ref = QR.posts; - for (i = ref.length - 1; i >= 0; i += -1) { - post = ref[i]; - if (errors = post.errors) { - for (j = 0, len = errors.length; j < len; j++) { - error = errors[j]; - if (!(doc.contains(error))) { - continue; - } - post.rm(); - break; - } - } - } - }; - - _Class.prototype.error = function(className, message, link) { - var div, ref, rm, rmAll; - div = $.el('div', { - className: className - }); - $.extend(div, {innerHTML: E(message) + ((link) ? " [More info]" : "") + "
        [delete post] [delete all]"}); - (this.errors || (this.errors = [])).push(div); - ref = $$('a', div), rm = ref[0], rmAll = ref[1]; - $.on(div, 'click', (function(_this) { - return function() { - if (indexOf.call(QR.posts, _this) >= 0) { - return _this.select(); - } - }; - })(this)); - $.on(rm, 'click', (function(_this) { - return function(e) { - e.stopPropagation(); - if (indexOf.call(QR.posts, _this) >= 0) { - return _this.rm(); - } - }; - })(this)); - $.on(rmAll, 'click', QR.post.rmErrored); - return QR.error(div, true); - }; - - _Class.prototype.fileError = function(message, link) { - return this.error('file-error', this.filename + ": " + message, link); - }; - - _Class.prototype.dismissErrors = function(test) { - var error, i, len, ref; - if (test == null) { - test = function() { - return true; - }; - } - if (this.errors) { - ref = this.errors; - for (i = 0, len = ref.length; i < len; i++) { - error = ref[i]; - if (doc.contains(error) && test(error)) { - error.parentNode.previousElementSibling.click(); - } - } - } - }; - - _Class.prototype.setFile = function(file1) { - var ext, ref; - this.file = file1; - if (Conf['Randomize Filename'] && g.BOARD.ID !== 'f') { - this.filename = "" + (Date.now() * 1000 - Math.floor(Math.random() * 365 * $.DAY * 1000)); - if (ext = this.file.name.match(QR.validExtension)) { - this.filename += ext[0]; - } - } else { - this.filename = this.file.name; - } - this.filesize = $.bytesToString(this.file.size); - this.checkSize(); - $.addClass(this.nodes.el, 'has-file'); - QR.captcha.moreNeeded(); - URL.revokeObjectURL(this.URL); - this.saveFilename(); - if (this === QR.selected) { - this.showFileData(); - } else { - this.updateFilename(); - } - this.rmMetadata(); - this.nodes.el.dataset.type = this.file.type; - this.nodes.el.style.backgroundImage = ''; - if (ref = this.file.type, indexOf.call(QR.mimeTypes, ref) < 0) { - this.fileError('Unsupported file type.'); - } else if (/^(image|video)\//.test(this.file.type)) { - this.readFile(); - } - return this.preventAutoPost(); - }; - - _Class.prototype.checkSize = function() { - var max; - max = QR.max_size; - if (/^video\//.test(this.file.type)) { - max = Math.min(max, QR.max_size_video); - } - if (this.file.size > max) { - return this.fileError("File too large (file: " + this.filesize + ", max: " + ($.bytesToString(max)) + ")."); - } - }; - - _Class.prototype.readFile = function() { - var el, event, isVideo, onerror, onload; - isVideo = /^video\//.test(this.file.type); - el = $.el(isVideo ? 'video' : 'img'); - if (isVideo && !el.canPlayType(this.file.type)) { - return; - } - event = isVideo ? 'loadeddata' : 'load'; - onload = (function(_this) { - return function() { - $.off(el, event, onload); - $.off(el, 'error', onerror); - _this.checkDimensions(el); - _this.setThumbnail(el); - return $.event('QRMetadata', null, _this.nodes.el); - }; - })(this); - onerror = (function(_this) { - return function() { - $.off(el, event, onload); - $.off(el, 'error', onerror); - _this.fileError("Corrupt " + (isVideo ? 'video' : 'image') + " or error reading metadata.", 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions#error-reading-metadata'); - URL.revokeObjectURL(el.src); - _this.nodes.el.removeAttribute('data-height'); - return $.event('QRMetadata', null, _this.nodes.el); - }; - })(this); - this.nodes.el.dataset.height = 'loading'; - $.on(el, event, onload); - $.on(el, 'error', onerror); - return el.src = URL.createObjectURL(this.file); - }; - - _Class.prototype.checkDimensions = function(el) { - var duration, height, max_height, max_width, videoHeight, videoWidth, width; - if (el.tagName === 'IMG') { - height = el.height, width = el.width; - this.nodes.el.dataset.height = height; - this.nodes.el.dataset.width = width; - if (height > QR.max_height || width > QR.max_width) { - this.fileError("Image too large (image: " + height + "x" + width + "px, max: " + QR.max_height + "x" + QR.max_width + "px)"); - } - if (height < QR.min_height || width < QR.min_width) { - return this.fileError("Image too small (image: " + height + "x" + width + "px, min: " + QR.min_height + "x" + QR.min_width + "px)"); - } - } else { - videoHeight = el.videoHeight, videoWidth = el.videoWidth, duration = el.duration; - this.nodes.el.dataset.height = videoHeight; - this.nodes.el.dataset.width = videoWidth; - this.nodes.el.dataset.duration = duration; - max_height = Math.min(QR.max_height, QR.max_height_video); - max_width = Math.min(QR.max_width, QR.max_width_video); - if (videoHeight > max_height || videoWidth > max_width) { - this.fileError("Video too large (video: " + videoHeight + "x" + videoWidth + "px, max: " + max_height + "x" + max_width + "px)"); - } - if (videoHeight < QR.min_height || videoWidth < QR.min_width) { - this.fileError("Video too small (video: " + videoHeight + "x" + videoWidth + "px, min: " + QR.min_height + "x" + QR.min_width + "px)"); - } - if (!isFinite(duration)) { - this.fileError('Video lacks duration metadata (try remuxing)'); - } else if (duration > QR.max_duration_video) { - this.fileError("Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)"); - } - if (BoardConfig.noAudio(g.BOARD.ID) && $.hasAudio(el)) { - return this.fileError('Audio not allowed'); - } - } - }; - - _Class.prototype.setThumbnail = function(el) { - var cv, height, isVideo, s, width; - isVideo = el.tagName === 'VIDEO'; - s = 90 * 2 * window.devicePixelRatio; - if (this.file.type === 'image/gif') { - s *= 3; - } - if (isVideo) { - height = el.videoHeight; - width = el.videoWidth; - } else { - height = el.height, width = el.width; - if (height < s || width < s) { - this.URL = el.src; - this.nodes.el.style.backgroundImage = "url(" + this.URL + ")"; - return; - } - } - if (height <= width) { - width = s / height * width; - height = s; - } else { - height = s / width * height; - width = s; - } - cv = $.el('canvas'); - cv.height = height; - cv.width = width; - cv.getContext('2d').drawImage(el, 0, 0, width, height); - URL.revokeObjectURL(el.src); - return cv.toBlob((function(_this) { - return function(blob) { - _this.URL = URL.createObjectURL(blob); - return _this.nodes.el.style.backgroundImage = "url(" + _this.URL + ")"; - }; - })(this)); - }; - - _Class.prototype.rmFile = function() { - if (this.isLocked) { - return; - } - delete this.file; - delete this.filename; - delete this.filesize; - this.nodes.el.removeAttribute('title'); - QR.nodes.filename.removeAttribute('title'); - this.rmMetadata(); - this.nodes.el.style.backgroundImage = ''; - $.rmClass(this.nodes.el, 'has-file'); - this.showFileData(); - URL.revokeObjectURL(this.URL); - this.dismissErrors(function(error) { - return $.hasClass(error, 'file-error'); - }); - return this.preventAutoPost(); - }; - - _Class.prototype.rmMetadata = function() { - var attr, i, len, ref; - ref = ['type', 'height', 'width', 'duration']; - for (i = 0, len = ref.length; i < len; i++) { - attr = ref[i]; - this.nodes.el.removeAttribute("data-" + attr); - } - }; - - _Class.prototype.saveFilename = function() { - this.file.newName = (this.filename || '').replace(/[\/\\]/g, '-'); - if (!QR.validExtension.test(this.filename)) { - return this.file.newName += "." + ($.getOwn(QR.extensionFromType, this.file.type) || 'jpg'); - } - }; - - _Class.prototype.updateFilename = function() { - var long; - long = this.filename + " (" + this.filesize + ")"; - this.nodes.el.title = long; - if (this !== QR.selected) { - return; - } - return QR.nodes.filename.title = long; - }; - - _Class.prototype.showFileData = function() { - var ref; - if (this.file) { - this.updateFilename(); - QR.nodes.filename.value = this.filename; - $.addClass(QR.nodes.oekaki, 'has-file'); - $.addClass(QR.nodes.fileSubmit, 'has-file'); - } else { - $.rmClass(QR.nodes.oekaki, 'has-file'); - $.rmClass(QR.nodes.fileSubmit, 'has-file'); - } - if (((ref = this.file) != null ? ref.source : void 0) != null) { - QR.nodes.fileSubmit.dataset.source = this.file.source; - } else { - QR.nodes.fileSubmit.removeAttribute('data-source'); - } - return QR.nodes.spoiler.checked = this.spoiler; - }; - - _Class.prototype.pasteText = function(file) { - var reader; - this.pasting = true; - this.preventAutoPost(); - reader = new FileReader(); - reader.onload = (function(_this) { - return function(e) { - var result; - result = e.target.result; - _this.setComment((_this.com ? _this.com + "\n" + result : result)); - return delete _this.pasting; - }; - })(this); - return reader.readAsText(file); - }; - - _Class.prototype.dragStart = function(e) { - var left, ref, top; - ref = this.getBoundingClientRect(), left = ref.left, top = ref.top; - e.dataTransfer.setDragImage(this, e.clientX - left, e.clientY - top); - return $.addClass(this, 'drag'); - }; - - _Class.prototype.dragEnd = function() { - return $.rmClass(this, 'drag'); - }; - - _Class.prototype.dragEnter = function() { - return $.addClass(this, 'over'); - }; - - _Class.prototype.dragLeave = function() { - return $.rmClass(this, 'over'); - }; - - _Class.prototype.dragOver = function(e) { - e.preventDefault(); - return e.dataTransfer.dropEffect = 'move'; - }; - - _Class.prototype.drop = function() { - var base, el, index, newIndex, oldIndex, post; - $.rmClass(this, 'over'); - if (!this.draggable) { - return; - } - el = $('.drag', this.parentNode); - index = function(el) { - return slice.call(el.parentNode.children).indexOf(el); - }; - oldIndex = index(el); - newIndex = index(this); - if (QR.posts[oldIndex].isLocked || QR.posts[newIndex].isLocked) { - return; - } - (oldIndex < newIndex ? $.after : $.before)(this, el); - post = QR.posts.splice(oldIndex, 1)[0]; - QR.posts.splice(newIndex, 0, post); - QR.status(); - return typeof (base = QR.captcha).updateThread === "function" ? base.updateThread() : void 0; - }; - - return _Class; - - })(); - -}).call(this); - -QuoteBacklink = (function() { - var QuoteBacklink; - - QuoteBacklink = { - containers: $.dict(), - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Backlinks']) { - return; - } - if ((this.bottomBacklinks = Conf['Bottom Backlinks'])) { - $.addClass(doc, 'bottom-backlinks'); - } - Callbacks.Post.push({ - name: 'Quote Backlinking Part 1', - cb: this.firstNode - }); - return Callbacks.Post.push({ - name: 'Quote Backlinking Part 2', - cb: this.secondNode - }); - }, - firstNode: function() { - var a, clone, container, containers, hash, i, j, k, len, len1, len2, link, markYours, nodes, post, quote, ref, ref1; - if (this.isClone || !this.quotes.length || this.isRebuilt) { - return; - } - markYours = Conf['Mark Quotes of You'] && QuoteYou.isYou(this); - a = $.el('a', { - href: g.SITE.Build.postURL(this.board.ID, this.thread.ID, this.ID), - className: this.isHidden ? 'filtered backlink' : 'backlink', - textContent: Conf['backlink'].replace(/%(?:id|%)/g, (function(_this) { - return function(x) { - return { - '%id': _this.ID, - '%%': '%' - }[x]; - }; - })(this)) - }); - if (markYours) { - $.add(a, QuoteYou.mark.cloneNode(true)); - } - ref = this.quotes; - for (i = 0, len = ref.length; i < len; i++) { - quote = ref[i]; - containers = [QuoteBacklink.getContainer(quote)]; - if ((post = g.posts.get(quote)) && post.nodes.backlinkContainer) { - ref1 = post.clones; - for (j = 0, len1 = ref1.length; j < len1; j++) { - clone = ref1[j]; - containers.push(clone.nodes.backlinkContainer); - } - } - for (k = 0, len2 = containers.length; k < len2; k++) { - container = containers[k]; - link = a.cloneNode(true); - nodes = container.firstChild ? [$.tn(' '), link] : [link]; - if (Conf['Quote Previewing']) { - $.on(link, 'mouseover', QuotePreview.mouseover); - } - if (Conf['Quote Inlining']) { - $.on(link, 'click', QuoteInline.toggle); - if (Conf['Quote Hash Navigation']) { - hash = QuoteInline.qiQuote(link, $.hasClass(link, 'filtered')); - nodes.push(hash); - } - } - $.add(container, nodes); - } - } - }, - secondNode: function() { - var container; - if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) { - this.nodes.backlinkContainer = $('.container', this.nodes.post); - return; - } - if (!(this.isReply || Conf['OP Backlinks'])) { - return; - } - container = QuoteBacklink.getContainer(this.fullID); - this.nodes.backlinkContainer = container; - if (QuoteBacklink.bottomBacklinks) { - return $.add(this.nodes.post, container); - } else { - return $.add(this.nodes.info, container); - } - }, - getContainer: function(id) { - var base; - return (base = this.containers)[id] || (base[id] = $.el('span', { - className: 'container' - })); - } - }; - - return QuoteBacklink; - -}).call(this); - -QuoteCT = (function() { - var QuoteCT; - - QuoteCT = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark Cross-thread Quotes']) { - return; - } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - this.mark = $.el('span', { - textContent: '\u00A0(Cross-thread)', - className: 'qmark-ct' - }); - return Callbacks.Post.push({ - name: 'Mark Cross-thread Quotes', - cb: this.node - }); - }, - node: function() { - var board, boardID, i, len, quotelink, ref, ref1, ref2, thread, threadID; - if (this.isClone && this.thread === this.context.thread) { - return; - } - ref = this.context, board = ref.board, thread = ref.thread; - ref1 = this.nodes.quotelinks; - for (i = 0, len = ref1.length; i < len; i++) { - quotelink = ref1[i]; - ref2 = Get.postDataFromLink(quotelink), boardID = ref2.boardID, threadID = ref2.threadID; - if (!threadID) { - continue; - } - if (this.isClone) { - $.rm($('.qmark-ct', quotelink)); - } - if (boardID === board.ID && threadID !== thread.ID) { - $.add(quotelink, QuoteCT.mark.cloneNode(true)); - } - } - } - }; - - return QuoteCT; - -}).call(this); - -QuoteInline = (function() { - var QuoteInline, - slice = [].slice; - - QuoteInline = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Quote Inlining']) { - return; - } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - return Callbacks.Post.push({ - name: 'Quote Inlining', - cb: this.node - }); - }, - node: function() { - var i, isClone, len, link, process, ref; - process = QuoteInline.process; - isClone = this.isClone; - ref = this.nodes.quotelinks.concat(slice.call(this.nodes.backlinks), this.nodes.archivelinks); - for (i = 0, len = ref.length; i < len; i++) { - link = ref[i]; - process(link, isClone); - } - }, - process: function(link, clone) { - if (Conf['Quote Hash Navigation']) { - if (!clone) { - $.after(link, QuoteInline.qiQuote(link, $.hasClass(link, 'filtered'))); - } - } - return $.on(link, 'click', QuoteInline.toggle); - }, - qiQuote: function(link, hidden) { - var name; - name = "hashlink"; - if (hidden) { - name += " filtered"; - } - return $.el('a', { - className: name, - textContent: '#', - href: link.href - }); - }, - toggle: function(e) { - var boardID, context, postID, quoter, ref, ref1, threadID; - if ($.modifiedClick(e)) { - return; - } - ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID; - if (Conf['Inline Cross-thread Quotes Only'] && g.VIEW === 'thread' && ((ref1 = g.posts.get(boardID + "." + postID)) != null ? ref1.nodes.root.offsetParent : void 0)) { - return; - } - if ($.hasClass(doc, 'catalog-mode')) { - return; - } - e.preventDefault(); - quoter = Get.postFromNode(this); - context = quoter.context; - if ($.hasClass(this, 'inlined')) { - QuoteInline.rm(this, boardID, threadID, postID, context); - } else { - if ($.x("ancestor::div[@data-full-i-d='" + boardID + "." + postID + "']", this)) { - return; - } - QuoteInline.add(this, boardID, threadID, postID, context, quoter); - } - return this.classList.toggle('inlined'); - }, - findRoot: function(quotelink, isBacklink) { - if (isBacklink) { - return $.x('ancestor::*[parent::*[contains(@class,"post")]][1]', quotelink); - } else { - return $.x('ancestor-or-self::*[parent::blockquote][1]', quotelink); - } - }, - add: function(quotelink, boardID, threadID, postID, context, quoter) { - var inline, isBacklink, post, qroot, root; - isBacklink = $.hasClass(quotelink, 'backlink'); - inline = $.el('div', { - className: 'inline' - }); - inline.dataset.fullID = boardID + "." + postID; - root = QuoteInline.findRoot(quotelink, isBacklink); - $.after(root, inline); - qroot = $.x('ancestor::*[contains(@class,"postContainer")][1]', root); - $.addClass(qroot, 'hasInline'); - new Fetcher(boardID, threadID, postID, inline, quoter); - if (!((post = g.posts.get(boardID + "." + postID)) && context.thread === post.thread)) { - return; - } - if (isBacklink && Conf['Forward Hiding']) { - $.addClass(post.nodes.root, 'forwarded'); - post.forwarded++ || (post.forwarded = 1); - } - if (!Unread.posts) { - return; - } - return Unread.readSinglePost(post); - }, - rm: function(quotelink, boardID, threadID, postID, context) { - var el, inlined, isBacklink, parentNode, post, qroot, ref, root; - isBacklink = $.hasClass(quotelink, 'backlink'); - root = QuoteInline.findRoot(quotelink, isBacklink); - root = $.x("following-sibling::div[@data-full-i-d='" + boardID + "." + postID + "'][1]", root); - qroot = $.x('ancestor::*[contains(@class,"postContainer")][1]', root); - parentNode = root.parentNode; - $.rm(root); - $.event('PostsRemoved', null, parentNode); - if (!$('.inline', qroot)) { - $.rmClass(qroot, 'hasInline'); - } - if (!(el = root.firstElementChild)) { - return; - } - post = g.posts.get(boardID + "." + postID); - post.rmClone(el.dataset.clone); - if (Conf['Forward Hiding'] && isBacklink && context.thread === g.threads.get(boardID + "." + threadID) && !--post.forwarded) { - delete post.forwarded; - $.rmClass(post.nodes.root, 'forwarded'); - } - while (inlined = $('.inlined', el)) { - ref = Get.postDataFromLink(inlined), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID; - QuoteInline.rm(inlined, boardID, threadID, postID, context); - $.rmClass(inlined, 'inlined'); - } - } - }; - - return QuoteInline; - -}).call(this); - -QuoteOP = (function() { - var QuoteOP, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - QuoteOP = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Mark OP Quotes']) { - return; - } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - this.mark = $.el('span', { - textContent: '\u00A0(OP)', - className: 'qmark-op' - }); - return Callbacks.Post.push({ - name: 'Mark OP Quotes', - cb: this.node - }); - }, - node: function() { - var boardID, fullID, i, postID, quotelink, quotelinks, quotes, ref, ref1; - if (this.isClone && this.thread === this.context.thread) { - return; - } - if (!(quotes = this.quotes).length) { - return; - } - quotelinks = this.nodes.quotelinks; - if (this.isClone && (ref = this.thread.fullID, indexOf.call(quotes, ref) >= 0)) { - i = 0; - while (quotelink = quotelinks[i++]) { - $.rm($('.qmark-op', quotelink)); - } - } - fullID = this.context.thread.fullID; - if (indexOf.call(quotes, fullID) < 0) { - return; - } - i = 0; - while (quotelink = quotelinks[i++]) { - ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID; - if ((boardID + "." + postID) === fullID) { - $.add(quotelink, QuoteOP.mark.cloneNode(true)); - } - } - } - }; - - return QuoteOP; - -}).call(this); - -QuotePreview = (function() { - var QuotePreview, - slice = [].slice; - - QuotePreview = { - init: function() { - var ref; - if (!Conf['Quote Previewing']) { - return; - } - if (g.VIEW === 'archive') { - $.on(d, 'mouseover', function(e) { - if (e.target.nodeName === 'A' && $.hasClass(e.target, 'quotelink')) { - return QuotePreview.mouseover.call(e.target, e); - } - }); - } - if ((ref = g.VIEW) !== 'index' && ref !== 'thread') { - return; - } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - return Callbacks.Post.push({ - name: 'Quote Previewing', - cb: this.node - }); - }, - node: function() { - var i, len, link, ref; - ref = this.nodes.quotelinks.concat(slice.call(this.nodes.backlinks), this.nodes.archivelinks); - for (i = 0, len = ref.length; i < len; i++) { - link = ref[i]; - $.on(link, 'mouseover', QuotePreview.mouseover); - } - }, - mouseover: function(e) { - var boardID, i, len, origin, post, postID, posts, qp, ref, threadID; - if (($.hasClass(this, 'inlined') && !$.hasClass(doc, 'catalog-mode')) || !d.contains(this)) { - return; - } - ref = Get.postDataFromLink(this), boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID; - qp = $.el('div', { - id: 'qp', - className: 'dialog' - }); - $.add(Header.hover, qp); - new Fetcher(boardID, threadID, postID, qp, Get.postFromNode(this)); - UI.hover({ - root: this, - el: qp, - latestEvent: e, - endEvents: 'mouseout click', - cb: QuotePreview.mouseout - }); - if (Conf['Quote Highlighting'] && (origin = g.posts.get(boardID + "." + postID))) { - posts = [origin].concat(origin.clones); - posts.pop(); - for (i = 0, len = posts.length; i < len; i++) { - post = posts[i]; - $.addClass(post.nodes.post, 'qphl'); - } - } - }, - mouseout: function() { - var clone, i, len, post, ref, root; - if (!(root = this.el.firstElementChild)) { - return; - } - $.event('PostsRemoved', null, Header.hover); - clone = Get.postFromRoot(root); - post = clone.origin; - post.rmClone(root.dataset.clone); - if (!Conf['Quote Highlighting']) { - return; - } - ref = [post].concat(post.clones); - for (i = 0, len = ref.length; i < len; i++) { - post = ref[i]; - $.rmClass(post.nodes.post, 'qphl'); - } - } - }; - - return QuotePreview; - -}).call(this); - -QuoteStrikeThrough = (function() { - var QuoteStrikeThrough; - - QuoteStrikeThrough = { - init: function() { - var ref; - if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && (Conf['Reply Hiding Buttons'] || (Conf['Menu'] && Conf['Reply Hiding Link']) || Conf['Filter']))) { - return; - } - return Callbacks.Post.push({ - name: 'Strike-through Quotes', - cb: this.node - }); - }, - node: function() { - var boardID, i, len, postID, quotelink, ref, ref1, ref2; - if (this.isClone) { - return; - } - ref = this.nodes.quotelinks; - for (i = 0, len = ref.length; i < len; i++) { - quotelink = ref[i]; - ref1 = Get.postDataFromLink(quotelink), boardID = ref1.boardID, postID = ref1.postID; - if ((ref2 = g.posts.get(boardID + "." + postID)) != null ? ref2.isHidden : void 0) { - $.addClass(quotelink, 'filtered'); - } - } - } - }; - - return QuoteStrikeThrough; - -}).call(this); - -QuoteThreading = -/* - <3 aeosynth - */ - -(function() { - var QuoteThreading; - - QuoteThreading = { - init: function() { - if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) { - return; - } - this.controls = $.el('label', {innerHTML: " Threading"}); - this.threadNewLink = $.el('span', { - className: 'brackets-wrap threadnewlink', - hidden: true - }); - $.extend(this.threadNewLink, {innerHTML: "Thread New Posts"}); - this.input = $('input', this.controls); - this.input.checked = Conf['Thread Quotes']; - $.on(this.input, 'change', this.setEnabled); - $.on(this.input, 'change', this.rethread); - $.on(this.threadNewLink.firstElementChild, 'click', this.rethread); - $.on(d, '4chanXInitFinished', (function(_this) { - return function() { - return _this.ready = true; - }; - })(this)); - Header.menu.addEntry(this.entry = { - el: this.controls, - order: 99 - }); - Callbacks.Thread.push({ - name: 'Quote Threading', - cb: this.setThread - }); - return Callbacks.Post.push({ - name: 'Quote Threading', - cb: this.node - }); - }, - parent: $.dict(), - children: $.dict(), - inserted: $.dict(), - toggleThreading: function() { - return this.setThreadingState(!Conf['Thread Quotes']); - }, - setThreadingState: function(enabled) { - this.input.checked = enabled; - this.setEnabled.call(this.input); - return this.rethread.call(this.input); - }, - setEnabled: function() { - var other, ref; - if (this.checked) { - $.set('Prune All Threads', false); - other = (ref = ReplyPruning.inputs) != null ? ref.enabled : void 0; - if (other != null ? other.checked : void 0) { - other.checked = false; - $.event('change', null, other); - } - } - return $.cb.checked.call(this); - }, - setThread: function() { - QuoteThreading.thread = this; - return $.asap((function() { - return !Conf['Thread Updater'] || $('.navLinksBot > .updatelink'); - }), function() { - var navLinksBot; - if ((navLinksBot = $('.navLinksBot'))) { - return $.add(navLinksBot, [$.tn(' '), QuoteThreading.threadNewLink]); - } - }); - }, - node: function() { - var ancestor, j, lastParent, len, parent, parents, quote, ref; - if (this.isFetchedQuote || this.isClone || !this.isReply) { - return; - } - parents = new Set(); - lastParent = null; - ref = this.quotes; - for (j = 0, len = ref.length; j < len; j++) { - quote = ref[j]; - if (parent = g.posts.get(quote)) { - if (!parent.isFetchedQuote && parent.isReply && parent.ID < this.ID) { - parents.add(parent.ID); - if (!lastParent || parent.ID > lastParent.ID) { - lastParent = parent; - } - } - } - } - if (!lastParent) { - return; - } - ancestor = lastParent; - while (ancestor = QuoteThreading.parent[ancestor.fullID]) { - parents["delete"](ancestor.ID); - } - if (parents.size === 1) { - return QuoteThreading.parent[this.fullID] = lastParent; - } - }, - descendants: function(post) { - var child, children, j, len, posts; - posts = [post]; - if (children = QuoteThreading.children[post.fullID]) { - for (j = 0, len = children.length; j < len; j++) { - child = children[j]; - posts = posts.concat(QuoteThreading.descendants(child)); - } - } - return posts; - }, - insert: function(post) { - var base, child, children, descendants, i, j, k, l, len, name, next, nodes, order, parent, prev, prev2, threadContainer, x; - if (!(Conf['Thread Quotes'] && (parent = QuoteThreading.parent[post.fullID]) && !QuoteThreading.inserted[post.fullID])) { - return false; - } - descendants = QuoteThreading.descendants(post); - if (!Unread.posts.has(parent.ID)) { - if ((function() { - var j, len, x; - for (j = 0, len = descendants.length; j < len; j++) { - x = descendants[j]; - if (Unread.posts.has(x.ID)) { - return true; - } - } - })()) { - QuoteThreading.threadNewLink.hidden = false; - return false; - } - } - order = Unread.order; - children = ((base = QuoteThreading.children)[name = parent.fullID] || (base[name] = [])); - threadContainer = parent.nodes.threadContainer || $.el('div', { - className: 'threadContainer' - }); - nodes = [post.nodes.root]; - if (post.nodes.threadContainer) { - nodes.push(post.nodes.threadContainer); - } - i = children.length; - for (j = children.length - 1; j >= 0; j += -1) { - child = children[j]; - if (child.ID >= post.ID) { - i--; - } - } - if (i !== children.length) { - next = children[i]; - for (k = 0, len = descendants.length; k < len; k++) { - x = descendants[k]; - order.before(order[next.ID], order[x.ID]); - } - children.splice(i, 0, post); - $.before(next.nodes.root, nodes); - } else { - prev = parent; - while ((prev2 = QuoteThreading.children[prev.fullID]) && prev2.length) { - prev = prev2[prev2.length - 1]; - } - for (l = descendants.length - 1; l >= 0; l += -1) { - x = descendants[l]; - order.after(order[prev.ID], order[x.ID]); - } - children.push(post); - $.add(threadContainer, nodes); - } - QuoteThreading.inserted[post.fullID] = true; - if (!parent.nodes.threadContainer) { - parent.nodes.threadContainer = threadContainer; - $.addClass(parent.nodes.root, 'threadOP'); - $.after(parent.nodes.root, threadContainer); - } - return true; - }, - rethread: function() { - var nodes, posts, thread; - if (!QuoteThreading.ready) { - return; - } - thread = QuoteThreading.thread; - posts = thread.posts; - QuoteThreading.threadNewLink.hidden = true; - if (Conf['Thread Quotes']) { - posts.forEach(QuoteThreading.insert); - } else { - nodes = []; - Unread.order = new RandomAccessList(); - QuoteThreading.inserted = $.dict(); - posts.forEach(function(post) { - if (post.isFetchedQuote) { - return; - } - Unread.order.push(post); - if (post.isReply) { - nodes.push(post.nodes.root); - } - if (QuoteThreading.children[post.fullID]) { - delete QuoteThreading.children[post.fullID]; - $.rmClass(post.nodes.root, 'threadOP'); - $.rm(post.nodes.threadContainer); - return delete post.nodes.threadContainer; - } - }); - $.add(thread.nodes.root, nodes); - } - Unread.position = Unread.order.first; - Unread.updatePosition(); - Unread.setLine(true); - Unread.read(); - return Unread.update(); - } - }; - - return QuoteThreading; - -}).call(this); - -QuoteYou = (function() { - var QuoteYou; - - QuoteYou = { - init: function() { - var ref; - if (!Conf['Remember Your Posts']) { - return; - } - this.db = new DataBoard('yourPosts'); - $.sync('Remember Your Posts', function(enabled) { - return Conf['Remember Your Posts'] = enabled; - }); - $.on(d, 'QRPostSuccessful', function(e) { - var cb; - cb = PostRedirect.delay(); - return $.get('Remember Your Posts', Conf['Remember Your Posts'], function(items) { - var boardID, postID, ref, threadID; - if (!items['Remember Your Posts']) { - return; - } - ref = e.detail, boardID = ref.boardID, threadID = ref.threadID, postID = ref.postID; - return QuoteYou.db.set({ - boardID: boardID, - threadID: threadID, - postID: postID, - val: true - }, cb); - }); - }); - if ((ref = g.VIEW) !== 'index' && ref !== 'thread' && ref !== 'archive') { - return; - } - if (Conf['Highlight Own Posts']) { - $.addClass(doc, 'highlight-own'); - } - if (Conf['Highlight Posts Quoting You']) { - $.addClass(doc, 'highlight-you'); - } - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - this.mark = $.el('span', { - textContent: '\u00A0(You)', - className: 'qmark-you' - }); - Callbacks.Post.push({ - name: 'Mark Quotes of You', - cb: this.node - }); - return QuoteYou.menu.init(); - }, - isYou: function(post) { - var ref; - return !!((ref = QuoteYou.db) != null ? ref.get({ - boardID: post.boardID, - threadID: post.threadID, - postID: post.ID - }) : void 0); - }, - node: function() { - var i, len, quotelink, ref; - if (this.isClone) { - return; - } - if (QuoteYou.isYou(this)) { - $.addClass(this.nodes.root, 'yourPost'); - } - if (!this.quotes.length) { - return; - } - ref = this.nodes.quotelinks; - for (i = 0, len = ref.length; i < len; i++) { - quotelink = ref[i]; - if (!(QuoteYou.db.get(Get.postDataFromLink(quotelink)))) { - continue; - } - if (Conf['Mark Quotes of You']) { - $.add(quotelink, QuoteYou.mark.cloneNode(true)); - } - $.addClass(quotelink, 'you'); - $.addClass(this.nodes.root, 'quotesYou'); - } - }, - menu: { - init: function() { - var input, label, ref; - label = $.el('label', { - className: 'toggle-you' - }, {innerHTML: " You"}); - input = $('input', label); - $.on(input, 'change', QuoteYou.menu.toggle); - return (ref = Menu.menu) != null ? ref.addEntry({ - el: label, - order: 80, - open: function(post) { - QuoteYou.menu.post = post.origin || post; - input.checked = QuoteYou.isYou(post); - return true; - } - }) : void 0; - }, - toggle: function() { - var clone, data, i, j, len, len1, post, quotelink, quoter, ref, ref1; - post = QuoteYou.menu.post; - data = { - boardID: post.board.ID, - threadID: post.thread.ID, - postID: post.ID, - val: true - }; - if (this.checked) { - QuoteYou.db.set(data); - } else { - QuoteYou.db["delete"](data); - } - ref = [post].concat(post.clones); - for (i = 0, len = ref.length; i < len; i++) { - clone = ref[i]; - clone.nodes.root.classList.toggle('yourPost', this.checked); - } - ref1 = Get.allQuotelinksLinkingTo(post); - for (j = 0, len1 = ref1.length; j < len1; j++) { - quotelink = ref1[j]; - if (this.checked) { - if (Conf['Mark Quotes of You']) { - $.add(quotelink, QuoteYou.mark.cloneNode(true)); - } - } else { - $.rm($('.qmark-you', quotelink)); - } - quotelink.classList.toggle('you', this.checked); - if ($.hasClass(quotelink, 'quotelink')) { - quoter = Get.postFromNode(quotelink).nodes.root; - quoter.classList.toggle('quotesYou', !!$('.quotelink.you', quoter)); - } - } - } - }, - cb: { - seek: function(type) { - var highlight, highlighted, post, posts, result, str; - highlight = g.SITE.classes.highlight; - if ((highlighted = $("." + highlight))) { - $.rmClass(highlighted, highlight); - } - if (!(QuoteYou.lastRead && doc.contains(QuoteYou.lastRead) && $.hasClass(QuoteYou.lastRead, 'quotesYou'))) { - if (!(post = QuoteYou.lastRead = $('.quotesYou'))) { - new Notice('warning', 'No posts are currently quoting you, loser.', 20); - return; - } - if (QuoteYou.cb.scroll(post)) { - return; - } - } else { - post = QuoteYou.lastRead; - } - str = type + "::div[contains(@class,'quotesYou')]"; - while ((post = (result = $.X(str, post)).snapshotItem(type === 'preceding' ? result.snapshotLength - 1 : 0))) { - if (QuoteYou.cb.scroll(post)) { - return; - } - } - posts = $$('.quotesYou'); - return QuoteYou.cb.scroll(posts[type === 'following' ? 0 : posts.length - 1]); - }, - scroll: function(root) { - var node, post, sel; - post = Get.postFromRoot(root); - if (!post.nodes.post.getBoundingClientRect().height) { - return false; - } else { - QuoteYou.lastRead = root; - location.href = Get.url('post', post); - Header.scrollTo(post.nodes.post); - if (post.isReply) { - sel = "" + g.SITE.selectors.postContainer + g.SITE.selectors.highlightable.reply; - node = post.nodes.root; - if (!node.matches(sel)) { - node = $(sel, node); - } - $.addClass(node, g.SITE.classes.highlight); - } - return true; - } - } - } - }; - - return QuoteYou; - -}).call(this); - -Quotify = (function() { - var Quotify, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - slice = [].slice; - - Quotify = { - init: function() { - var ref; - if (((ref = g.VIEW) !== 'index' && ref !== 'thread') || !Conf['Resurrect Quotes']) { - return; - } - $.addClass(doc, 'resurrect-quotes'); - if (Conf['Comment Expansion']) { - ExpandComment.callbacks.push(this.node); - } - return Callbacks.Post.push({ - name: 'Resurrect Quotes', - cb: this.node - }); - }, - node: function() { - var deadlink, i, j, len, len1, link, ref, ref1; - if (this.isClone) { - this.nodes.archivelinks = $$('a.linkify.quotelink', this.nodes.comment); - return; - } - ref = $$('a.linkify', this.nodes.comment); - for (i = 0, len = ref.length; i < len; i++) { - link = ref[i]; - Quotify.parseArchivelink.call(this, link); - } - ref1 = $$('.deadlink', this.nodes.comment); - for (j = 0, len1 = ref1.length; j < len1; j++) { - deadlink = ref1[j]; - Quotify.parseDeadlink.call(this, deadlink); - } - }, - parseArchivelink: function(link) { - var boardID, m, postID, ref, threadID; - if (!(m = link.pathname.match(/^\/([^\/]+)\/thread\/S?(\d+)\/?$/))) { - return; - } - if ((ref = link.hostname) === 'boards.4chan.org' || ref === 'boards.4channel.org') { - return; - } - boardID = m[1]; - threadID = m[2]; - postID = link.hash.match(/^#[pq]?(\d+)$|$/)[1] || threadID; - if (Redirect.to('post', { - boardID: boardID, - postID: postID - })) { - $.addClass(link, 'quotelink'); - $.extend(link.dataset, { - boardID: boardID, - threadID: threadID, - postID: postID - }); - return this.nodes.archivelinks.push(link); - } - }, - parseDeadlink: function(deadlink) { - var a, boardID, fetchable, m, post, postID, quote, quoteID, redirect, ref; - if ($.hasClass(deadlink.parentNode, 'prettyprint')) { - Quotify.fixDeadlink(deadlink); - return; - } - quote = deadlink.textContent; - if (!(postID = (ref = quote.match(/\d+$/)) != null ? ref[0] : void 0)) { - return; - } - if (postID[0] === '0') { - Quotify.fixDeadlink(deadlink); - return; - } - boardID = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : this.board.ID; - quoteID = boardID + "." + postID; - if (post = g.posts.get(quoteID)) { - if (!post.isDead) { - a = $.el('a', { - href: g.SITE.Build.postURL(boardID, post.thread.ID, postID), - className: 'quotelink', - textContent: quote - }); - } else { - a = $.el('a', { - href: g.SITE.Build.postURL(boardID, post.thread.ID, postID), - className: 'quotelink deadlink', - textContent: quote - }); - $.add(a, Post.deadMark.cloneNode(true)); - $.extend(a.dataset, { - boardID: boardID, - threadID: post.thread.ID, - postID: postID - }); - } - } else { - redirect = Redirect.to('thread', { - boardID: boardID, - threadID: 0, - postID: postID - }); - fetchable = Redirect.to('post', { - boardID: boardID, - postID: postID - }); - if (redirect || fetchable) { - a = $.el('a', { - href: redirect || 'javascript:;', - className: 'deadlink', - textContent: quote - }); - $.add(a, Post.deadMark.cloneNode(true)); - if (fetchable) { - $.addClass(a, 'quotelink'); - $.extend(a.dataset, { - boardID: boardID, - postID: postID - }); - } - } - } - if (indexOf.call(this.quotes, quoteID) < 0) { - this.quotes.push(quoteID); - } - if (!a) { - $.add(deadlink, Post.deadMark.cloneNode(true)); - return; - } - $.replace(deadlink, a); - if ($.hasClass(a, 'quotelink')) { - return this.nodes.quotelinks.push(a); - } - }, - fixDeadlink: function(deadlink) { - var el, green; - if (!(el = deadlink.previousSibling) || el.nodeName === 'BR') { - green = $.el('span', { - className: 'quote' - }); - $.before(deadlink, green); - $.add(green, deadlink); - } - return $.replace(deadlink, slice.call(deadlink.childNodes)); - } - }; - - return Quotify; - -}).call(this); - -Main = (function() { - var Main, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Main = { - init: function() { - var db, flatten, i, items, j, k, key, len, mountedCB, ref, ref1, ref2, w; - try { - w = window; - if ($.platform === 'crx') { - w = w.wrappedJSObject || w; - } - if ('4chan X antidup' in w) { - return; - } - w['4chan X antidup'] = true; - } catch (error1) {} - try { - if (window.frameElement && ((ref = window.frameElement.src) === '' || ref === 'about:blank')) { - return; - } - } catch (error1) {} - if (doc && $.hasClass(doc, 'fourchan-x')) { - return; - } - $.asap(docSet, function() { - $.addClass(doc, 'fourchan-x', 'seaweedchan'); - if ($.engine) { - return $.addClass(doc, "ua-" + $.engine); - } - }); - $.on(d, '4chanXInitFinished', function() { - if (Main.expectInitFinished) { - return delete Main.expectInitFinished; - } else { - new Notice('error', 'Error: Multiple copies of 4chan X are enabled.'); - return $.addClass(doc, 'tainted'); - } - }); - mountedCB = function() { - var cb, j, len, ref1, results; - d.removeEventListener('mounted', mountedCB, true); - Main.isMounted = true; - ref1 = Main.mountedCBs; - results = []; - for (j = 0, len = ref1.length; j < len; j++) { - cb = ref1[j]; - try { - results.push(cb()); - } catch (error1) {} - } - return results; - }; - d.addEventListener('mounted', mountedCB, true); - flatten = function(parent, obj) { - var key, val; - if (obj instanceof Array) { - Conf[parent] = $.dict.clone(obj[0]); - } else if (typeof obj === 'object') { - for (key in obj) { - val = obj[key]; - flatten(key, val); - } - } else { - Conf[parent] = obj; - } - }; - if ((ref1 = location.hostname) === 'boards.4chan.org' || ref1 === 'boards.4channel.org') { - $.global(function() { - var fromCharCode0; - fromCharCode0 = String.fromCharCode; - return String.fromCharCode = function() { - if (document.body) { - String.fromCharCode = fromCharCode0; - } else if (document.currentScript && !document.currentScript.src) { - throw Error(); - } - return fromCharCode0.apply(this, arguments); - }; - }); - $.asap(docSet, function() { - return $.onExists(doc, 'iframe[srcdoc]', $.rm); - }); - } - flatten(null, Config); - ref2 = DataBoard.keys; - for (j = 0, len = ref2.length; j < len; j++) { - db = ref2[j]; - Conf[db] = $.dict(); - } - Conf['customTitles'] = $.dict.clone({ - '4chan.org': { - boards: { - 'qa': { - 'boardTitle': { - orig: '/qa/ - Question & Answer', - title: '/qa/ - 2D/Random' - } - } - } - } - }); - Conf['boardConfig'] = { - boards: $.dict() - }; - Conf['archives'] = Redirect.archives; - Conf['selectedArchives'] = $.dict(); - Conf['cooldowns'] = $.dict(); - Conf['Index Sort'] = $.dict(); - for (i = k = 0; k < 2; i = ++k) { - Conf["Last Long Reply Thresholds " + i] = $.dict(); - } - Conf['siteProperties'] = $.dict(); - Conf['Except Archives from Encryption'] = false; - Conf['JSON Navigation'] = true; - Conf['Oekaki Links'] = true; - Conf['Show Name and Subject'] = false; - Conf['QR Shortcut'] = true; - Conf['Bottom QR Link'] = true; - Conf['Toggleable Thread Watcher'] = true; - Conf['siteSoftware'] = ''; - Conf['Use Faster Image Host'] = 'true'; - Conf['Captcha Fixes'] = true; - Conf['captchaServiceDomain'] = ''; - Conf['captchaServiceKey'] = $.dict(); - if (/\.4chan(?:nel)?\.org$/.test(location.hostname) && !SW.yotsuba.regexp.pass.test(location.href) && !SW.yotsuba.regexp.captcha.test(location.href) && !$$('script:not([src])', d).filter(function(s) { - return /this\[/.test(s.textContent); - }).length) { - ($.getSync || $.get)({ - 'jsWhitelist': Conf['jsWhitelist'] - }, function(arg) { - var jsWhitelist; - jsWhitelist = arg.jsWhitelist; - return $.addCSP("script-src " + (jsWhitelist.replace(/^#.*$/mg, '').replace(/[\s;]+/g, ' ').trim())); - }); - } - items = $.dict(); - for (key in Conf) { - items[key] = void 0; - } - items['previousversion'] = void 0; - return ($.getSync || $.get)(items, function(items) { - var ref3; - if (!$.perProtocolSettings && /\.4chan(?:nel)?\.org$/.test(location.hostname) && ((ref3 = items['Redirect to HTTPS']) != null ? ref3 : Conf['Redirect to HTTPS']) && location.protocol !== 'https:') { - location.replace('https://' + location.host + location.pathname + location.search + location.hash); - return; - } - return $.asap(docSet, function() { - var ref4, val; - if ($.cantSet) { - - } else if (items.previousversion == null) { - Main.isFirstRun = true; - Main.ready(function() { - $.set('previousversion', g.VERSION); - return Settings.open(); - }); - } else if (items.previousversion !== g.VERSION) { - Main.upgrade(items); - } - for (key in Conf) { - val = Conf[key]; - Conf[key] = (ref4 = items[key]) != null ? ref4 : val; - } - return Site.init(Main.initFeatures); - }); - }); - }, - upgrade: function(items) { - var changes, previousversion; - previousversion = items.previousversion; - changes = Settings.upgrade(items, previousversion); - items.previousversion = changes.previousversion = g.VERSION; - return $.set(changes, function() { - var el, ref; - if ((ref = items['Show Updated Notifications']) != null ? ref : true) { - el = $.el('span', {innerHTML: "4chan X has been updated to version " + E(g.VERSION) + "."}); - return new Notice('info', el, 15); - } - }); - }, - parseURL: function(site, url) { - var pathname, r, ref; - if (site == null) { - site = g.SITE; - } - if (url == null) { - url = location; - } - r = {}; - if (!site) { - return r; - } - r.siteID = site.ID; - if (typeof site.isBoardlessPage === "function" ? site.isBoardlessPage(url) : void 0) { - return r; - } - pathname = url.pathname.split(/\/+/); - r.boardID = pathname[1]; - if (site.isFileURL(url)) { - r.VIEW = 'file'; - } else if (typeof site.isAuxiliaryPage === "function" ? site.isAuxiliaryPage(url) : void 0) { - - } else if ((ref = pathname[2]) === 'thread' || ref === 'res') { - r.VIEW = 'thread'; - r.threadID = r.THREADID = +pathname[3].replace(/\.\w+$/, ''); - } else if (pathname[2] === 'archive' && pathname[3] === 'res') { - r.VIEW = 'thread'; - r.threadID = r.THREADID = +pathname[4].replace(/\.\w+$/, ''); - r.threadArchived = true; - } else if (/^(?:catalog|archive)(?:\.\w+)?$/.test(pathname[2])) { - r.VIEW = pathname[2].replace(/\.\w+$/, ''); - } else if (/^(?:index|\d*)(?:\.\w+)?$/.test(pathname[2])) { - r.VIEW = 'index'; - } - return r; - }, - initFeatures: function() { - var base, err, feature, j, len, name, ref, ref1; - $.global(function() { - document.documentElement.classList.add('js-enabled'); - return window.FCX = {}; - }); - Main.jsEnabled = $.hasClass(doc, 'js-enabled'); - if (typeof $.ajaxPageInit === "function") { - $.ajaxPageInit(); - } - $.extend(g, Main.parseURL()); - if (g.boardID) { - g.BOARD = new Board(g.boardID); - } - if (!g.VIEW) { - if (typeof (base = g.SITE).initAuxiliary === "function") { - base.initAuxiliary(); - } - return; - } - if (g.VIEW === 'file') { - $.asap((function() { - return d.readyState !== 'loading'; - }), function() { - var base1, pathname, video; - if (g.SITE.software === 'yotsuba' && Conf['404 Redirect'] && (typeof (base1 = g.SITE).is404 === "function" ? base1.is404() : void 0)) { - pathname = location.pathname.split(/\/+/); - return Redirect.navigate('file', { - boardID: g.BOARD.ID, - filename: pathname[pathname.length - 1] - }); - } else if (video = $('video')) { - if (Conf['Volume in New Tab']) { - Volume.setup(video); - } - if (Conf['Loop in New Tab']) { - video.loop = true; - video.controls = false; - video.play(); - return ImageCommon.addControls(video); - } - } - }); - return; - } - g.threads = new SimpleDict(); - g.posts = new SimpleDict(); - $.onExists(doc, 'body', Main.initStyle); - ref = Main.features; - for (j = 0, len = ref.length; j < len; j++) { - ref1 = ref[j], name = ref1[0], feature = ref1[1]; - if (g.SITE.disabledFeatures && indexOf.call(g.SITE.disabledFeatures, name) >= 0) { - continue; - } - try { - feature.init(); - } catch (error1) { - err = error1; - Main.handleErrors({ - message: "\"" + name + "\" initialization crashed.", - error: err - }); - } - } - return $.ready(Main.initReady); - }, - initStyle: function() { - var keyboard, ref; - if (!Main.isThisPageLegit()) { - return; - } - if ((ref = $('link[href*=mobile]', d.head)) != null) { - ref.disabled = true; - } - doc.dataset.host = location.host; - $.addClass(doc, "sw-" + g.SITE.software); - $.addClass(doc, g.VIEW === 'thread' ? 'thread-view' : g.VIEW); - $.onExists(doc, '.ad-cnt, .adg-rects > .desktop', function(ad) { - return $.onExists(ad, 'img, iframe', function() { - return $.addClass(doc, 'ads-loaded'); - }); - }); - if (Conf['Autohiding Scrollbar']) { - $.addClass(doc, 'autohiding-scrollbar'); - } - $.ready(function() { - if (d.body.clientHeight > doc.clientHeight && (window.innerWidth === doc.clientWidth) !== Conf['Autohiding Scrollbar']) { - Conf['Autohiding Scrollbar'] = !Conf['Autohiding Scrollbar']; - $.set('Autohiding Scrollbar', Conf['Autohiding Scrollbar']); - return $.toggleClass(doc, 'autohiding-scrollbar'); - } - }); - $.addStyle(CSS.sub(CSS.boards), 'fourchanx-css'); - Main.bgColorStyle = $.el('style', { - id: 'fourchanx-bgcolor-css' - }); - keyboard = false; - $.on(d, 'mousedown', function() { - return keyboard = false; - }); - $.on(d, 'keydown', function(e) { - if (e.keyCode === 9) { - return keyboard = true; - } - }); - window.addEventListener('focus', (function() { - return doc.classList.toggle('keyboard-focus', keyboard); - }), true); - return Main.setClass(); - }, - setClass: function() { - var j, knownStyles, len, mainStyleSheet, ref, ref1, setStyle, style, styleSheet, styleSheets; - knownStyles = ['yotsuba', 'yotsuba-b', 'futaba', 'burichan', 'photon', 'tomorrow', 'spooky']; - if (g.SITE.software === 'yotsuba' && g.VIEW === 'catalog') { - if ((mainStyleSheet = $.id('base-css'))) { - style = (ref = mainStyleSheet.href.match(/catalog_(\w+)/)) != null ? ref[1].replace('_new', '').replace(/_+/g, '-') : void 0; - if (indexOf.call(knownStyles, style) >= 0) { - $.addClass(doc, style); - return; - } - } - } - style = mainStyleSheet = styleSheets = null; - setStyle = function() { - var bgColor, css, div, j, len, rgb, s, styleSheet; - if (g.SITE.software === 'yotsuba') { - $.rmClass(doc, style); - style = null; - for (j = 0, len = styleSheets.length; j < len; j++) { - styleSheet = styleSheets[j]; - if (styleSheet.href === (mainStyleSheet != null ? mainStyleSheet.href : void 0)) { - style = styleSheet.title.toLowerCase().replace('new', '').trim().replace(/\s+/g, '-'); - if (style === '_special') { - style = styleSheet.href.match(/[a-z]*(?=[^\/]*$)/)[0]; - } - if (indexOf.call(knownStyles, style) < 0) { - style = null; - } - break; - } - } - if (style) { - $.addClass(doc, style); - $.rm(Main.bgColorStyle); - return; - } - } - div = g.SITE.bgColoredEl(); - div.style.position = 'absolute'; - div.style.visibility = 'hidden'; - $.add(d.body, div); - bgColor = window.getComputedStyle(div).backgroundColor; - $.rm(div); - rgb = bgColor.match(/[\d.]+/g); - if (!/^rgb\(/.test(bgColor)) { - s = window.getComputedStyle(d.body); - bgColor = s.backgroundColor + " " + s.backgroundImage + " " + s.backgroundRepeat + " " + s.backgroundPosition; - } - css = ".dialog, .suboption-list > div:last-of-type, :root.catalog-hover-expand .catalog-container:hover > .post {\n background: " + bgColor + ";\n}\n.unread-mark-read {\n background-color: rgba(" + (rgb.slice(0, 3).join(', ')) + ", " + (0.5 * (rgb[3] || 1)) + ");\n}"; - if ($.luma(rgb) < 100) { - css += ".watch-thread-link {\n background-image: url(\"data:image/svg+xml,\");\n}"; - } - Main.bgColorStyle.textContent = css; - return $.after($.id('fourchanx-css'), Main.bgColorStyle); - }; - $.onExists(d.head, g.SITE.selectors.styleSheet, function(el) { - mainStyleSheet = el; - if (g.SITE.software === 'yotsuba') { - styleSheets = $$('link[rel="alternate stylesheet"]', d.head); - } - new MutationObserver(setStyle).observe(mainStyleSheet, { - attributes: true, - attributeFilter: ['href'] - }); - $.on(mainStyleSheet, 'load', setStyle); - return setStyle(); - }); - if (!mainStyleSheet) { - ref1 = $$('link[rel="stylesheet"]', d.head); - for (j = 0, len = ref1.length; j < len; j++) { - styleSheet = ref1[j]; - $.on(styleSheet, 'load', setStyle); - } - return setStyle(); - } - }, - initReady: function() { - var base, base1, msg; - if (typeof (base = g.SITE).is404 === "function" ? base.is404() : void 0) { - if (g.VIEW === 'thread') { - ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() { - if (Conf['404 Redirect']) { - return Redirect.navigate('thread', { - boardID: g.BOARD.ID, - threadID: g.THREADID, - postID: +location.hash.match(/\d+/) - }, "/" + g.BOARD + "/"); - } - }); - } - return; - } - if (typeof (base1 = g.SITE).isIncomplete === "function" ? base1.isIncomplete() : void 0) { - msg = $.el('div', {innerHTML: "The page didn't load completely.
        Some features may not work unless you reload."}); - $.on($('a', msg), 'click', function() { - return location.reload(); - }); - new Notice('warning', msg); - } - if (g.VIEW === 'catalog') { - return Main.initCatalog(); - } else if (!Index.enabled) { - if (g.SITE.awaitBoard) { - return g.SITE.awaitBoard(Main.initThread); - } else { - return Main.initThread(); - } - } else { - Main.expectInitFinished = true; - return $.event('4chanXInitFinished'); - } - }, - initThread: function() { - var base, base1, board, errors, posts, ref, s, threads; - s = g.SITE.selectors; - if ((board = $(((ref = s.boardFor) != null ? ref[g.VIEW] : void 0) || s.board))) { - threads = []; - posts = []; - errors = []; - try { - if (typeof (base = g.SITE).preParsingFixes === "function") { - base.preParsingFixes(board); - } - } catch (error1) {} - Main.addThreadsObserver = new MutationObserver(Main.addThreads); - Main.addPostsObserver = new MutationObserver(Main.addPosts); - Main.addThreadsObserver.observe(board, { - childList: true - }); - Main.parseThreads($$(s.thread, board), threads, posts, errors); - if (errors.length) { - Main.handleErrors(errors); - } - if (g.VIEW === 'thread') { - if (g.threadArchived) { - threads[0].isArchived = true; - threads[0].kill(); - } - if (typeof (base1 = g.SITE).parseThreadMetadata === "function") { - base1.parseThreadMetadata(threads[0]); - } - } - Main.callbackNodes('Thread', threads); - return Main.callbackNodesDB('Post', posts, function() { - var j, len, post; - for (j = 0, len = posts.length; j < len; j++) { - post = posts[j]; - QuoteThreading.insert(post); - } - Main.expectInitFinished = true; - return $.event('4chanXInitFinished'); - }); - } else { - Main.expectInitFinished = true; - return $.event('4chanXInitFinished'); - } - }, - parseThreads: function(threadRoots, threads, posts, errors) { - var boardID, boardObj, j, len, postRoots, ref, thread, threadID, threadRoot; - for (j = 0, len = threadRoots.length; j < len; j++) { - threadRoot = threadRoots[j]; - boardObj = (boardID = threadRoot.dataset.board) ? (boardID = encodeURIComponent(boardID), g.boards[boardID] || new Board(boardID)) : g.BOARD; - threadID = +threadRoot.id.match(/\d*$/)[0]; - if (!threadID || ((ref = boardObj.threads.get(threadID)) != null ? ref.nodes.root : void 0)) { - return; - } - thread = new Thread(threadID, boardObj); - thread.nodes.root = threadRoot; - threads.push(thread); - postRoots = $$(g.SITE.selectors.postContainer, threadRoot); - if (g.SITE.isOPContainerThread) { - postRoots.unshift(threadRoot); - } - Main.parsePosts(postRoots, thread, posts, errors); - Main.addPostsObserver.observe(threadRoot, { - childList: true - }); - } - }, - parsePosts: function(postRoots, thread, posts, errors) { - var err, j, len, postRoot; - for (j = 0, len = postRoots.length; j < len; j++) { - postRoot = postRoots[j]; - if (!(postRoot.dataset.fullID && g.posts.get(postRoot.dataset.fullID)) && $(g.SITE.selectors.comment, postRoot)) { - try { - posts.push(new Post(postRoot, thread, thread.board)); - } catch (error1) { - err = error1; - errors.push({ - message: "Parsing of Post No." + (postRoot.id.match(/\d+/)) + " failed. Post will be skipped.", - error: err, - html: postRoot.outerHTML - }); - } - } - } - }, - addThreads: function(records) { - var errors, j, k, len, len1, node, posts, record, ref, threadRoots, threads; - threadRoots = []; - for (j = 0, len = records.length; j < len; j++) { - record = records[j]; - ref = record.addedNodes; - for (k = 0, len1 = ref.length; k < len1; k++) { - node = ref[k]; - if (node.nodeType === Node.ELEMENT_NODE && node.matches(g.SITE.selectors.thread)) { - threadRoots.push(node); - } - } - } - if (!threadRoots.length) { - return; - } - threads = []; - posts = []; - errors = []; - Main.parseThreads(threadRoots, threads, posts, errors); - if (errors.length) { - Main.handleErrors(errors); - } - Main.callbackNodes('Thread', threads); - return Main.callbackNodesDB('Post', posts, function() { - return $.event('PostsInserted', null, records[0].target); - }); - }, - addPosts: function(records) { - var anyRemoved, el, errors, j, k, l, len, len1, len2, n, node, postRoots, posts, record, ref, ref1, ref2, thread, threads, threadsRM; - threads = []; - threadsRM = []; - posts = []; - errors = []; - for (j = 0, len = records.length; j < len; j++) { - record = records[j]; - thread = Get.threadFromRoot(record.target); - postRoots = []; - ref = record.addedNodes; - for (k = 0, len1 = ref.length; k < len1; k++) { - node = ref[k]; - if (node.nodeType === Node.ELEMENT_NODE) { - if (node.matches(g.SITE.selectors.postContainer) || (node = $(g.SITE.selectors.postContainer, node))) { - postRoots.push(node); - } - } - } - n = posts.length; - Main.parsePosts(postRoots, thread, posts, errors); - if (posts.length > n && indexOf.call(threads, thread) < 0) { - threads.push(thread); - } - anyRemoved = false; - ref1 = record.removedNodes; - for (l = 0, len2 = ref1.length; l < len2; l++) { - el = ref1[l]; - if (((ref2 = Get.postFromRoot(el)) != null ? ref2.nodes.root : void 0) === el && !doc.contains(el)) { - anyRemoved = true; - break; - } - } - if (anyRemoved && indexOf.call(threadsRM, thread) < 0) { - threadsRM.push(thread); - } - } - if (errors.length) { - Main.handleErrors(errors); - } - return Main.callbackNodesDB('Post', posts, function() { - var len3, len4, m, o; - for (m = 0, len3 = threads.length; m < len3; m++) { - thread = threads[m]; - $.event('PostsInserted', null, thread.nodes.root); - } - for (o = 0, len4 = threadsRM.length; o < len4; o++) { - thread = threadsRM[o]; - $.event('PostsRemoved', null, thread.nodes.root); - } - }); - }, - initCatalog: function() { - var board, errors, s, threads; - s = g.SITE.selectors.catalog; - if (s && (board = $(s.board))) { - threads = []; - errors = []; - Main.addCatalogThreadsObserver = new MutationObserver(Main.addCatalogThreads); - Main.addCatalogThreadsObserver.observe(board, { - childList: true - }); - Main.parseCatalogThreads($$(s.thread, board), threads, errors); - if (errors.length) { - Main.handleErrors(errors); - } - Main.callbackNodes('CatalogThreadNative', threads); - } - Main.expectInitFinished = true; - return $.event('4chanXInitFinished'); - }, - parseCatalogThreads: function(threadRoots, threads, errors) { - var err, j, len, ref, thread, threadRoot; - for (j = 0, len = threadRoots.length; j < len; j++) { - threadRoot = threadRoots[j]; - try { - thread = new CatalogThreadNative(threadRoot); - if (((ref = thread.thread.catalogViewNative) != null ? ref.nodes.root : void 0) !== threadRoot) { - thread.thread.catalogViewNative = thread; - threads.push(thread); - } - } catch (error1) { - err = error1; - errors.push({ - message: "Parsing of Catalog Thread No." + ((threadRoot.dataset.id || threadRoot.id).match(/\d+/)) + " failed. Thread will be skipped.", - error: err, - html: threadRoot.outerHTML - }); - } - } - }, - addCatalogThreads: function(records) { - var errors, j, k, len, len1, node, record, ref, threadRoots, threads; - threadRoots = []; - for (j = 0, len = records.length; j < len; j++) { - record = records[j]; - ref = record.addedNodes; - for (k = 0, len1 = ref.length; k < len1; k++) { - node = ref[k]; - if (node.nodeType === Node.ELEMENT_NODE && node.matches(g.SITE.selectors.catalog.thread)) { - threadRoots.push(node); - } - } - } - if (!threadRoots.length) { - return; - } - threads = []; - errors = []; - Main.parseCatalogThreads(threadRoots, threads, errors); - if (errors.length) { - Main.handleErrors(errors); - } - return Main.callbackNodes('CatalogThreadNative', threads); - }, - callbackNodes: function(klass, nodes) { - var cb, i, node; - i = 0; - cb = Callbacks[klass]; - while (node = nodes[i++]) { - cb.execute(node); - } - }, - callbackNodesDB: function(klass, nodes, cb) { - var cbs, fn, i, softTask; - i = 0; - cbs = Callbacks[klass]; - fn = function() { - var node; - if (!(node = nodes[i])) { - return false; - } - cbs.execute(node); - return ++i % 25; - }; - softTask = function() { - while (fn()) { - continue; - } - if (!nodes[i]) { - if (cb) { - cb(); - } - return; - } - return setTimeout(softTask, 0); - }; - return softTask(); - }, - handleErrors: function(errors) { - var div, enabled, error, j, len, logs, msg; - if (d.body && $.hasClass(d.body, 'fourchan_x') && !$.hasClass(doc, 'tainted')) { - new Notice('error', 'Error: Multiple copies of 4chan X are enabled.'); - $.addClass(doc, 'tainted'); - } - if (g.SITE.testNativeExtension && !$.hasClass(doc, 'tainted')) { - enabled = g.SITE.testNativeExtension().enabled; - if (enabled) { - $.addClass(doc, 'tainted'); - if (Conf['Disable Native Extension'] && !Main.isFirstRun) { - msg = $.el('div', {innerHTML: "Failed to disable the native extension. You may need to block it."}); - new Notice('error', msg); - } - } - } - if (!(errors instanceof Array)) { - error = errors; - } else if (errors.length === 1) { - error = errors[0]; - } - if (error) { - new Notice('error', Main.parseError(error, Main.reportLink([error])), 15); - return; - } - div = $.el('div', {innerHTML: E(errors.length) + " errors occurred." + (Main.reportLink(errors)).innerHTML + " [show]"}); - $.on(div.lastElementChild, 'click', function() { - var ref; - return ref = this.textContent === 'show' ? ['hide', false] : ['show', true], this.textContent = ref[0], logs.hidden = ref[1], ref; - }); - logs = $.el('div', { - hidden: true - }); - for (j = 0, len = errors.length; j < len; j++) { - error = errors[j]; - $.add(logs, Main.parseError(error)); - } - return new Notice('error', [div, logs], 30); - }, - parseError: function(data, reportLink) { - var context, error, lines, message, ref, ref1; - c.error(data.message, data.error.stack); - message = $.el('div', {innerHTML: E(data.message) + ((reportLink) ? (reportLink).innerHTML : "")}); - error = $.el('div', { - textContent: (data.error.name || 'Error') + ": " + (data.error.message || 'see console for details') - }); - lines = ((ref = data.error.stack) != null ? (ref1 = ref.match(/\d+(?=:\d+\)?$)/mg)) != null ? ref1.join().replace(/^/, ' at ') : void 0 : void 0) || ''; - context = $.el('div', { - textContent: "(4chan X ccd0 v" + g.VERSION + " " + $.platform + " on " + $.engine + lines + ")" - }); - return [message, error, context]; - }, - reportLink: function(errors) { - var addDetails, data, details, info, title, url; - data = errors[0]; - title = data.message; - if (errors.length > 1) { - title += " (+" + (errors.length - 1) + " other errors)"; - } - details = ''; - addDetails = function(text) { - if (!(encodeURIComponent(title + details + text + '\n').length > 8143)) { - return details += text + '\n'; - } - }; - addDetails("[Please describe the steps needed to reproduce this error.]\n\nScript: 4chan X ccd0 v" + g.VERSION + " " + $.platform + "\nURL: " + location.href + "\nUser agent: " + navigator.userAgent); - if ($.platform === 'userscript' && (info = typeof GM !== "undefined" && GM !== null ? GM.info : (typeof GM_info !== "undefined" && GM_info !== null ? GM_info : void 0))) { - addDetails("Userscript manager: " + info.scriptHandler + " " + info.version); - } - addDetails('\n' + data.error); - if (data.error.stack) { - addDetails(data.error.stack.replace(data.error.toString(), '').trim()); - } - if (data.html) { - addDetails('\n`' + data.html + '`'); - } - details = details.replace(/file:\/{3}.+\//g, ''); - url = 'https://github.com/ccd0/4chan-x/issues'.replace('%title', encodeURIComponent(title)).replace('%details', encodeURIComponent(details)); - return {innerHTML: " [report]"}; - }, - isThisPageLegit: function() { - if (!('thisPageIsLegit' in Main)) { - Main.thisPageIsLegit = g.SITE.isThisPageLegit ? g.SITE.isThisPageLegit() : !/^[45]\d\d\b/.test(document.title) && !/\.(?:json|rss)$/.test(location.pathname); - } - return Main.thisPageIsLegit; - }, - ready: function(cb) { - return $.ready(function() { - if (Main.isThisPageLegit()) { - return cb(); - } - }); - }, - mounted: function(cb) { - if (Main.isMounted) { - return cb(); - } else { - return Main.mountedCBs.push(cb); - } - }, - mountedCBs: [], - features: [['Polyfill', Polyfill], ['Board Configuration', BoardConfig], ['Normalize URL', NormalizeURL], ['Delay Redirect on Post', PostRedirect], ['Captcha Configuration', Captcha.replace], ['Image Host Rewriting', ImageHost], ['Redirect', Redirect], ['Header', Header], ['Catalog Links', CatalogLinks], ['Settings', Settings], ['Index Generator', Index], ['Disable Autoplay', AntiAutoplay], ['Announcement Hiding', PSAHiding], ['Fourchan thingies', Fourchan], ['Tinyboard Glue', Tinyboard], ['Color User IDs', IDColor], ['Highlight by User ID', IDHighlight], ['Count Posts by ID', IDPostCount], ['Custom CSS', CustomCSS], ['Thread Links', ThreadLinks], ['Linkify', Linkify], ['Reveal Spoilers', RemoveSpoilers], ['Resurrect Quotes', Quotify], ['Filter', Filter], ['Thread Hiding Buttons', ThreadHiding], ['Reply Hiding Buttons', PostHiding], ['Recursive', Recursive], ['Strike-through Quotes', QuoteStrikeThrough], ['Quick Reply Personas', QR.persona], ['Quick Reply', QR], ['Cooldown', QR.cooldown], ['Post Jumper', PostJumper], ['Pass Link', PassLink], ['Menu', Menu], ['Index Generator (Menu)', Index.menu], ['Report Link', ReportLink], ['Copy Text Link', CopyTextLink], ['Thread Hiding (Menu)', ThreadHiding.menu], ['Reply Hiding (Menu)', PostHiding.menu], ['Delete Link', DeleteLink], ['Filter (Menu)', Filter.menu], ['Edit Link', QR.oekaki.menu], ['Download Link', DownloadLink], ['Archive Link', ArchiveLink], ['Quote Inlining', QuoteInline], ['Quote Previewing', QuotePreview], ['Quote Backlinks', QuoteBacklink], ['Mark Quotes of You', QuoteYou], ['Mark OP Quotes', QuoteOP], ['Mark Cross-thread Quotes', QuoteCT], ['Anonymize', Anonymize], ['Time Formatting', Time], ['Relative Post Dates', RelativeDates], ['File Info Formatting', FileInfo], ['Fappe Tyme', FappeTyme], ['Gallery', Gallery], ['Gallery (menu)', Gallery.menu], ['Sauce', Sauce], ['Image Expansion', ImageExpand], ['Image Expansion (Menu)', ImageExpand.menu], ['Reveal Spoiler Thumbnails', RevealSpoilers], ['Image Loading', ImageLoader], ['Image Hover', ImageHover], ['Volume Control', Volume], ['WEBM Metadata', Metadata], ['Comment Expansion', ExpandComment], ['Thread Expansion', ExpandThread], ['Favicon', Favicon], ['Unread', Unread], ['Unread Line in Index', UnreadIndex], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Watcher', ThreadWatcher], ['Thread Watcher (Menu)', ThreadWatcher.menu], ['Mark New IPs', MarkNewIPs], ['Index Navigation', Nav], ['Keybinds', Keybinds], ['Banner', Banner], ['Announcements', PSA], ['Flash Features', Flash], ['Reply Pruning', ReplyPruning], ['Mod Contact Links', ModContact]] - }; - - return Main; - -}).call(this); - -Main.init(); - -})(); diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip deleted file mode 100644 index b927d4fc9..000000000 Binary files a/builds/4chan-X.zip and /dev/null differ diff --git a/builds/4chan-XT-noupdate.user.js b/builds/4chan-XT-noupdate.user.js new file mode 100644 index 000000000..6720af429 --- /dev/null +++ b/builds/4chan-XT-noupdate.user.js @@ -0,0 +1,27297 @@ +// ==UserScript== +// @name 4chan XT +// @version XT 2.0.0 +// @minGMVer 1.14 +// @minFFVer 74 +// @namespace 4chan-XT +// @description 4chan XT is a script that adds various features to anonymous imageboards. +// @license MIT; https://github.com/TuxedoTako/4chan-xt/blob/master/LICENSE +// @include http://boards.4chan.org/* +// @include https://boards.4chan.org/* +// @include http://sys.4chan.org/* +// @include https://sys.4chan.org/* +// @include http://www.4chan.org/* +// @include https://www.4chan.org/* +// @include http://boards.4channel.org/* +// @include https://boards.4channel.org/* +// @include http://sys.4channel.org/* +// @include https://sys.4channel.org/* +// @include http://www.4channel.org/* +// @include https://www.4channel.org/* +// @include http://i.4cdn.org/* +// @include https://i.4cdn.org/* +// @include http://is.4chan.org/* +// @include https://is.4chan.org/* +// @include http://is2.4chan.org/* +// @include https://is2.4chan.org/* +// @include http://is.4channel.org/* +// @include https://is.4channel.org/* +// @include http://is2.4channel.org/* +// @include https://is2.4channel.org/* +// @include https://erischan.org/* +// @include https://www.erischan.org/* +// @include https://fufufu.moe/* +// @include https://gnfos.com/* +// @include https://himasugi.blog/* +// @include https://www.himasugi.blog/* +// @include https://kakashinenpo.com/* +// @include https://www.kakashinenpo.com/* +// @include https://kissu.moe/* +// @include https://www.kissu.moe/* +// @include https://lainchan.org/* +// @include https://www.lainchan.org/* +// @include https://merorin.com/* +// @include https://ota-ch.com/* +// @include https://www.ota-ch.com/* +// @include https://ponyville.us/* +// @include https://www.ponyville.us/* +// @include https://smuglo.li/* +// @include https://notso.smuglo.li/* +// @include https://smugloli.net/* +// @include https://smug.nepu.moe/* +// @include https://sportschan.org/* +// @include https://www.sportschan.org/* +// @include https://sushigirl.us/* +// @include https://www.sushigirl.us/* +// @include https://tvch.moe/* +// @exclude http://www.4chan.org/advertise +// @exclude https://www.4chan.org/advertise +// @exclude http://www.4chan.org/advertise?* +// @exclude https://www.4chan.org/advertise?* +// @exclude http://www.4chan.org/donate +// @exclude https://www.4chan.org/donate +// @exclude http://www.4chan.org/donate?* +// @exclude https://www.4chan.org/donate?* +// @exclude http://www.4channel.org/advertise +// @exclude https://www.4channel.org/advertise +// @exclude http://www.4channel.org/advertise?* +// @exclude https://www.4channel.org/advertise?* +// @exclude http://www.4channel.org/donate +// @exclude https://www.4channel.org/donate +// @exclude http://www.4channel.org/donate?* +// @exclude https://www.4channel.org/donate?* +// @connect 4chan.org +// @connect 4channel.org +// @connect 4cdn.org +// @connect 4chenz.github.io +// @connect archive.4plebs.org +// @connect warosu.org +// @connect desuarchive.org +// @connect boards.fireden.net +// @connect arch.b4k.co +// @connect archived.moe +// @connect thebarchive.com +// @connect archiveofsins.com +// @connect www.tokyochronos.net +// @connect archive.palanq.win +// @connect eientei.xyz +// @connect api.clyp.it +// @connect api.dailymotion.com +// @connect api.github.com +// @connect soundcloud.com +// @connect api.streamable.com +// @connect vimeo.com +// @connect www.youtube.com +// @connect * +// @grant GM_getValue +// @grant GM_setValue +// @grant GM_deleteValue +// @grant GM_listValues +// @grant GM_addValueChangeListener +// @grant GM_openInTab +// @grant GM_xmlhttpRequest +// @grant GM.getValue +// @grant GM.setValue +// @grant GM.deleteValue +// @grant GM.listValues +// @grant GM.openInTab +// @grant GM.xmlHttpRequest +// @run-at document-start +// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAF5JREFUeNrtkTESABAQxPD/R6tsE2dUGYUtFJvLDKf93KevHJAjpBorAQWSBIKqFASC4G0pCAkm4GfaEvgYXl0T6HBaE97f0vmnfYHbZOMLZCx9ISdKWwjOWZSC8GYm4SUGwfYgqI4AAAAASUVORK5CYII= +// ==/UserScript== +/* +* 4chan X +* +* Licensed under the MIT license. +* https://github.com/ccd0/4chan-x/blob/master/LICENSE +* +* Appchan X Copyright © 2013-2016 Zixaphir +* http://zixaphir.github.io/appchan-x/ +* 4chan x Copyright © 2009-2011 James Campos +* https://github.com/aeosynth/4chan-x +* 4chan x Copyright © 2012-2014 Nicolas Stepien +* https://4chan-x.just-believe.in/ +* 4chan x Copyright © 2013-2014 Jordan Bates +* http://seaweedchan.github.io/4chan-x/ +* 4chan x Copyright © 2012-2013 ihavenoface +* http://ihavenoface.github.io/4chan-x/ +* 4chan SS Copyright © 2011-2013 Ahodesuka +* https://github.com/ahodesuka/4chan-Style-Script/ +* +* Permission is hereby granted, free of charge, to any person +* obtaining a copy of this software and associated documentation +* files (the "Software"), to deal in the Software without +* restriction, including without limitation the rights to use, +* copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following +* conditions: +* +* The above copyright notice and this permission notice shall be +* included in all copies or substantial portions of the Software. +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +* Contributors: +* aeosynth +* mayhemydg +* noface +* !K.WeEabo0o +* blaise +* that4chanwolf +* desuwa +* seaweed +* e000 +* ahodesuka +* Shou +* ferongr +* xat +* Ongpot +* thisisanon +* Anonymous +* Seiba +* herpaderpderp +* WakiMiko +* btmcsweeney +* AppleBloom +* detharonil +* +* All the people who've taken the time to write bug reports. +* +* Thank you. +*/ + +/* +* Contains data from external sources: +* +* src/Monitoring/ThreadUpdater/beep.wav from http://freesound.org/people/pierrecartoons1979/sounds/90112/ +* cc-by-nc-3.0 +* +* Icons used to identify various websites are property of the respective websites. +*/ + +(function () { + 'use strict'; + + var version = { + "version": "XT 2.0.0", + "date": "2023-04-30T13:46:25Z" + }; + + var meta = { + "name": "4chan XT", + "path": "4chan-XT", + "fork": "TuxedoTako", + "page": "https://github.com/TuxedoTako/4chan-xt", + "downloads": "https://github.com/TuxedoTako/4chan-xt/releases", + "oldVersions": "https://raw.githubusercontent.com/ccd0/4chan-x/", + "faq": "https://github.com/TuxedoTako/4chan-xt/wiki/Frequently-Asked-Questions", + "captchaFAQ": "https://github.com/TuxedoTako/4chan-xt/wiki/Captcha-FAQ", + "cssGuide": "https://github.com/TuxedoTako/4chan-xt/wiki/Styling-Guide", + "license": "https://github.com/TuxedoTako/4chan-xt/blob/master/LICENSE", + "changelog": "https://github.com/TuxedoTako/4chan-xt/blob/master/CHANGELOG.md", + "issues": "https://github.com/TuxedoTako/4chan-xt/issues", + "newIssue": "https://github.com/TuxedoTako/4chan-xt/issues", + "newIssueMaxLength": 8181, + "alternatives": "https://www.4chan-x.net/4chan_alternatives.html", + "appid": "lacclbnghgdicfifcamcmcnilckjamag", + "appidGecko": "4chan-x@4chan-x.net", + "chromeStoreID": "ohnjgmpcibpbafdlkimncjhflgedgpam", + "recaptchaKey": "6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc", + "distBranch": "gh-pages", + "includes_only": [ + "*://boards.4chan.org/*", + "*://sys.4chan.org/*", + "*://www.4chan.org/*", + "*://boards.4channel.org/*", + "*://sys.4channel.org/*", + "*://www.4channel.org/*", + "*://i.4cdn.org/*", + "*://is.4chan.org/*", + "*://is2.4chan.org/*", + "*://is.4channel.org/*", + "*://is2.4channel.org/*" + ], + "matches_only": [ + "*://*.4chan.org/*", + "*://*.4channel.org/*", + "*://*.4cdn.org/*" + ], + "matches": [ + "https://erischan.org/*", + "https://www.erischan.org/*", + "https://fufufu.moe/*", + "https://gnfos.com/*", + "https://himasugi.blog/*", + "https://www.himasugi.blog/*", + "https://kakashinenpo.com/*", + "https://www.kakashinenpo.com/*", + "https://kissu.moe/*", + "https://www.kissu.moe/*", + "https://lainchan.org/*", + "https://www.lainchan.org/*", + "https://merorin.com/*", + "https://ota-ch.com/*", + "https://www.ota-ch.com/*", + "https://ponyville.us/*", + "https://www.ponyville.us/*", + "https://smuglo.li/*", + "https://notso.smuglo.li/*", + "https://smugloli.net/*", + "https://smug.nepu.moe/*", + "https://sportschan.org/*", + "https://www.sportschan.org/*", + "https://sushigirl.us/*", + "https://www.sushigirl.us/*", + "https://tvch.moe/*" + ], + "matches_extra": [], + "exclude_matches": [ + "*://www.4chan.org/advertise", + "*://www.4chan.org/advertise?*", + "*://www.4chan.org/donate", + "*://www.4chan.org/donate?*", + "*://www.4channel.org/advertise", + "*://www.4channel.org/advertise?*", + "*://www.4channel.org/donate", + "*://www.4channel.org/donate?*" + ], + "grants": [ + "GM_getValue", + "GM_setValue", + "GM_deleteValue", + "GM_listValues", + "GM_addValueChangeListener", + "GM_openInTab", + "GM_xmlhttpRequest", + "GM.getValue", + "GM.setValue", + "GM.deleteValue", + "GM.listValues", + "GM.openInTab", + "GM.xmlHttpRequest" + ], + "min": { + "chrome": "80", + "firefox": "74", + "greasemonkey": "1.14" + } + }; + + const Conf = Object.create(null); + const g = { + VERSION: version.version, + NAMESPACE: meta.name, + sites: Object.create(null), + boards: Object.create(null) + }; + const E = (function () { + const str = { + '&': '&', + "'": ''', + '"': '"', + '<': '<', + '>': '>' + }; + const regex = /[&"'<>]/g; + const fn = function (x) { + return str[x]; + }; + const output = function (text) { + return text.toString().replace(regex, fn); + }; + output.cat = function (templates) { + let html = ''; + for (let i = 0; i < templates.length; i++) { + html += templates[i].innerHTML; + } + return html; + }; + return output; + })(); + const d$1 = document; + const doc$1 = d$1.documentElement; + const c = console; + const docSet = function () { + // return (doc = d.documentElement); + return doc$1; + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS206: Consider reworking classes to avoid initClass + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + class Callbacks { + static initClass() { + this.Post = new Callbacks('Post'); + this.Thread = new Callbacks('Thread'); + this.CatalogThread = new Callbacks('Catalog Thread'); + this.CatalogThreadNative = new Callbacks('Catalog Thread'); + } + + constructor(type) { + this.type = type; + this.keys = []; + } + + push({name, cb}) { + if (!this[name]) { this.keys.push(name); } + return this[name] = cb; + } + + execute(node, keys=this.keys, force=false) { + let errors; + if (node.callbacksExecuted && !force) { return; } + node.callbacksExecuted = true; + for (var name of keys) { + try { + this[name]?.call(node); + } catch (err) { + if (!errors) { errors = []; } + errors.push({ + message: ['"', name, '" crashed on node ', this.type, ' No.', node.ID, ' (', node.board, ').'].join(''), + error: err, + html: node.nodes?.root?.outerHTML + }); + } + } + + if (errors) { return Main$1.handleErrors(errors); } + } + } + Callbacks.initClass(); + + var userCss = `/* Board title rice */ +div.boardTitle { + font-weight: 400 !important; +} +:root.yotsuba div.boardTitle { + font-family: sans-serif !important; + text-shadow: 1px 1px 1px rgba(100,0,0,0.6); +} +:root.yotsuba-b div.boardTitle { + font-family: sans-serif !important; + text-shadow: 1px 1px 1px rgba(105,10,15,0.6); +} +:root.photon div.boardTitle { + font-family: sans-serif !important; + text-shadow: 1px 1px 1px rgba(0,74,153,0.6); +} +:root.tomorrow div.boardTitle { + font-family: sans-serif !important; + text-shadow: 1px 1px 1px rgba(167,170,168,0.6); +} +`; + + var banners = ["0.jpg", "1.jpg", "2.jpg", "4.jpg", "6.jpg", "7.jpg", "8.jpg", "9.jpg", "10.jpg", "11.jpg", "12.jpg", "13.jpg", "14.jpg", "16.jpg", "17.jpg", "18.jpg", "19.jpg", "20.jpg", "21.jpg", "22.jpg", "24.jpg", "25.jpg", "26.jpg", "28.jpg", "29.jpg", "33.jpg", "38.jpg", "39.jpg", "43.jpg", "44.jpg", "45.jpg", "46.jpg", "47.jpg", "52.jpg", "54.jpg", "57.jpg", "59.jpg", "60.jpg", "61.jpg", "64.jpg", "66.jpg", "67.jpg", "69.jpg", "71.jpg", "72.jpg", "76.jpg", "77.jpg", "81.jpg", "82.jpg", "83.jpg", "84.jpg", "88.jpg", "90.jpg", "91.jpg", "96.jpg", "98.jpg", "99.jpg", "100.jpg", "104.jpg", "106.jpg", "116.jpg", "119.jpg", "137.jpg", "140.jpg", "148.jpg", "149.jpg", "150.jpg", "154.jpg", "156.jpg", "157.jpg", "158.jpg", "159.jpg", "161.jpg", "162.jpg", "164.jpg", "165.jpg", "166.jpg", "167.jpg", "168.jpg", "169.jpg", "170.jpg", "171.jpg", "172.jpg", "173.jpg", "174.jpg", "175.jpg", "176.jpg", "178.jpg", "179.jpg", "180.jpg", "181.jpg", "182.jpg", "183.jpg", "186.jpg", "189.jpg", "190.jpg", "192.jpg", "193.jpg", "194.jpg", "197.jpg", "198.jpg", "200.jpg", "201.jpg", "202.jpg", "203.jpg", "205.jpg", "206.jpg", "207.jpg", "208.jpg", "210.jpg", "213.jpg", "214.jpg", "215.jpg", "216.jpg", "218.jpg", "219.jpg", "220.jpg", "221.jpg", "222.jpg", "223.jpg", "224.jpg", "227.jpg", "0.png", "1.png", "2.png", "3.png", "5.png", "6.png", "9.png", "10.png", "11.png", "12.png", "14.png", "16.png", "19.png", "20.png", "21.png", "22.png", "23.png", "24.png", "26.png", "27.png", "28.png", "29.png", "30.png", "31.png", "32.png", "33.png", "34.png", "37.png", "39.png", "40.png", "41.png", "42.png", "43.png", "44.png", "45.png", "48.png", "49.png", "50.png", "51.png", "52.png", "53.png", "57.png", "58.png", "59.png", "64.png", "66.png", "67.png", "68.png", "69.png", "70.png", "71.png", "72.png", "76.png", "78.png", "79.png", "81.png", "82.png", "85.png", "86.png", "87.png", "89.png", "95.png", "98.png", "100.png", "101.png", "102.png", "105.png", "106.png", "107.png", "109.png", "110.png", "111.png", "112.png", "113.png", "114.png", "115.png", "116.png", "118.png", "119.png", "120.png", "121.png", "122.png", "123.png", "126.png", "128.png", "130.png", "134.png", "136.png", "138.png", "139.png", "140.png", "142.png", "145.png", "146.png", "149.png", "150.png", "151.png", "152.png", "153.png", "154.png", "155.png", "156.png", "157.png", "158.png", "159.png", "160.png", "163.png", "164.png", "165.png", "166.png", "167.png", "168.png", "169.png", "170.png", "171.png", "172.png", "173.png", "174.png", "178.png", "179.png", "180.png", "181.png", "182.png", "184.png", "186.png", "188.png", "190.png", "192.png", "193.png", "194.png", "195.png", "196.png", "197.png", "198.png", "200.png", "202.png", "203.png", "205.png", "206.png", "207.png", "209.png", "212.png", "213.png", "214.png", "216.png", "217.png", "218.png", "219.png", "220.png", "221.png", "222.png", "223.png", "224.png", "225.png", "226.png", "229.png", "231.png", "232.png", "233.png", "234.png", "235.png", "237.png", "238.png", "239.png", "240.png", "241.png", "242.png", "244.png", "245.png", "246.png", "247.png", "248.png", "249.png", "250.png", "253.png", "254.png", "255.png", "256.png", "257.png", "258.png", "259.png", "260.png", "262.png", "268.png", "0.gif", "1.gif", "2.gif", "3.gif", "4.gif", "5.gif", "6.gif", "7.gif", "8.gif", "9.gif", "10.gif", "12.gif", "13.gif", "14.gif", "15.gif", "16.gif", "18.gif", "19.gif", "20.gif", "21.gif", "22.gif", "23.gif", "24.gif", "28.gif", "29.gif", "30.gif", "33.gif", "34.gif", "35.gif", "36.gif", "37.gif", "39.gif", "40.gif", "42.gif", "44.gif", "45.gif", "46.gif", "48.gif", "50.gif", "52.gif", "54.gif", "55.gif", "57.gif", "58.gif", "59.gif", "60.gif", "61.gif", "63.gif", "64.gif", "66.gif", "67.gif", "68.gif", "69.gif", "70.gif", "72.gif", "73.gif", "75.gif", "76.gif", "77.gif", "78.gif", "80.gif", "81.gif", "82.gif", "83.gif", "86.gif", "87.gif", "88.gif", "92.gif", "93.gif", "94.gif", "95.gif", "96.gif", "97.gif", "98.gif", "99.gif", "100.gif", "101.gif", "102.gif", "103.gif", "104.gif", "105.gif", "106.gif", "108.gif", "109.gif", "110.gif", "111.gif", "112.gif", "113.gif", "115.gif", "116.gif", "117.gif", "118.gif", "119.gif", "120.gif", "122.gif", "123.gif", "124.gif", "127.gif", "129.gif", "130.gif", "131.gif", "134.gif", "135.gif", "136.gif", "138.gif", "139.gif", "141.gif", "144.gif", "146.gif", "148.gif", "149.gif", "153.gif", "154.gif", "155.gif", "157.gif", "158.gif", "159.gif", "160.gif", "161.gif", "162.gif", "164.gif", "166.gif", "167.gif", "168.gif", "169.gif", "170.gif", "171.gif", "172.gif", "173.gif", "174.gif", "175.gif", "176.gif", "177.gif", "178.gif", "181.gif", "182.gif", "183.gif", "185.gif", "186.gif", "187.gif", "188.gif", "189.gif", "190.gif", "191.gif", "192.gif", "193.gif", "195.gif", "196.gif", "197.gif", "200.gif", "201.gif", "202.gif", "203.gif", "204.gif", "205.gif", "206.gif", "207.gif", "208.gif", "209.gif", "210.gif", "211.gif", "212.gif", "213.gif", "214.gif", "215.gif", "216.gif", "217.gif", "219.gif", "220.gif", "221.gif", "222.gif", "224.gif", "225.gif", "226.gif", "227.gif", "228.gif", "230.gif", "232.gif", "233.gif", "234.gif", "235.gif", "238.gif", "240.gif", "241.gif", "243.gif", "244.gif", "245.gif", "246.gif", "247.gif", "249.gif", "250.gif", "251.gif", "253.gif"]; + + const Config = { + main: { + 'Miscellaneous': { + 'Redirect to HTTPS': [ + true, + 'Redirect to the HTTPS version of 4chan.' + ], + 'JSON Index': [ + true, + 'Replace the original board index with one supporting searching, sorting, infinite scrolling, and a catalog mode.' + ], + [`Use ${meta.name} Catalog`]: [ + true, + `Link to ${meta.name}'s catalog instead of the native 4chan one.`, + 1 + ], + 'Index Refresh Notifications': [ + false, + 'Show a notice at the top of the page when the index is refreshed.', + 1 + ], + 'Follow Cursor': [ + true, + 'Image Hover and Quote Preview move with the mouse cursor.' + ], + 'Open Threads in New Tab': [ + false, + `Make links to threads in the index / ${meta.name} catalog open in a new tab.` + ], + 'External Catalog': [ + false, + 'Link to external catalog instead of the internal one.' + ], + 'Catalog Links': [ + false, + 'Add toggle link in header menu to turn Navigation links into links to each board\'s catalog.' + ], + 'Announcement Hiding': [ + true, + 'Add button to hide 4chan announcements.' + ], + 'Desktop Notifications': [ + true, + `Enables desktop notifications across various ${meta.name} features.` + ], + '404 Redirect': [ + true, + 'Redirect dead threads and images to the archives.' + ], + 'Archive Report': [ + true, + 'Enable reporting posts to supported archives.' + ], + 'Exempt Archives from Encryption': [ + true, + 'Permit loading content from, and warningless redirects to, HTTP-only archives from HTTPS pages.' + ], + 'Keybinds': [ + true, + 'Bind actions to keyboard shortcuts.' + ], + 'Time Formatting': [ + true, + 'Localize and format timestamps.' + ], + 'Relative Post Dates': [ + true, + 'Display dates like "3 minutes ago". Tooltip shows the timestamp.' + ], + 'Relative Date Title': [ + true, + 'Show Relative Post Date only when hovering over dates.', + 1 + ], + 'Comment Expansion': [ + true, + 'Expand comments that are too long to display on the index. Not applicable with JSON Index.' + ], + 'File Info Formatting': [ + true, + 'Reformat the file information.' + ], + 'Thread Expansion': [ + true, + 'Add buttons to expand threads.' + ], + 'Index Navigation': [ + false, + 'Add buttons to navigate between threads.' + ], + 'Reply Navigation': [ + false, + 'Add buttons to navigate to top / bottom of thread.' + ], + 'Unique ID and Capcode Navigation': [ + false, + 'Add buttons to navigate to posts having the same unique ID or capcode.' + ], + 'Custom Board Titles': [ + true, + 'Allow editing of the board title and subtitle by ctrl/\u2318+clicking them.' + ], + 'Persistent Custom Board Titles': [ + false, + 'Force custom board titles to be persistent, even if the board titles are updated.', + 1 + ], + 'Show Updated Notifications': [ + true, + `Show notifications when ${meta.name} is successfully updated.` + ], + 'Color User IDs': [ + true, + 'Assign unique colors to user IDs on boards that use them' + ], + 'Count Posts by ID': [ + true, + 'Display number of posts in the thread when hovering over an ID.' + ], + 'Remove Spoilers': [ + false, + 'Remove all spoilers in text.' + ], + 'Reveal Spoilers': [ + false, + 'Indicate spoilers if Remove Spoilers is enabled, or make the text appear hovered if Remove Spoiler is disabled.' + ], + 'Normalize URL': [ + true, + 'Rewrite the URL of the current page, removing slugs and excess slashes, and changing /res/ to /thread/.' + ], + 'Work around CORB Bug': [ + true, + 'Leave this checked until your garbage browser is fixed.' + ], + 'Disable Autoplaying Sounds': [ + false, + 'Prevent sounds on the page from autoplaying.' + ], + 'Disable Native Extension': [ + true, + `${meta.name} is NOT designed to work with the native extension.` + ], + 'Enable Native Flash Embedding': [ + true, + 'Activate the native extension\'s Flash embedding if the native extension is disabled.' + ] + }, + + 'Linkification': { + 'Linkify': [ + true, + 'Convert text into links where applicable.' + ], + 'Link Title': [ + true, + 'Replace the link of a supported site with its actual title.', + 1 + ], + 'Cover Preview': [ + true, + 'Show preview of supported links on hover.', + 1 + ], + 'Embedding': [ + true, + 'Embed supported services. Note: Some services don\'t work on HTTPS.', + 1 + ], + 'Auto-embed': [ + false, + 'Auto-embed Linkify Embeds.', + 2 + ], + 'Floating Embeds': [ + false, + 'Embed content in a frame that remains in place when the page is scrolled.', + 2 + ] + }, + + 'Filtering': { + 'Anonymize': [ + false, + 'Make everyone Anonymous.' + ], + 'Filter': [ + true, + 'Self-moderation placebo.' + ], + 'Filtered Backlinks': [ + false, + 'When enabled, shows backlinks to filtered posts with a line-through decoration. Otherwise, hides the backlinks.', + 1 + ], + 'Filter in Native Catalog': [ + true, + 'Apply 4chan X filters in native catalog.', + 1 + ], + 'MD5 Quick Filter Notifications': [ + true, + 'Show notification when quick filtering MD5s using the button or keybind.', + 1 + ], + 'Recursive Hiding': [ + true, + 'Hide replies of hidden posts, recursively.' + ], + 'Thread Hiding Buttons': [ + true, + 'Add buttons to hide entire threads.' + ], + 'Reply Hiding Buttons': [ + true, + 'Add buttons to hide single replies.' + ], + 'Stubs': [ + true, + 'Show stubs of hidden threads / replies.' + ] + }, + + 'Images and Videos': { + 'Image Expansion': [ + true, + 'Expand images / videos.' + ], + 'Image Hover': [ + true, + 'Show full image / video on mouseover.' + ], + 'Image Hover in Catalog': [ + true, + `Show full image / video on mouseover in ${meta.name} catalog.` + ], + 'Gallery': [ + true, + 'Adds a simple and cute image gallery. Has more options in the gallery menu.' + ], + 'Fullscreen Gallery': [ + false, + 'Open gallery in fullscreen mode.', + 1 + ], + 'PDF in Gallery': [ + false, + 'Show PDF files in gallery.', + 1 + ], + 'Sauce': [ + true, + 'Add sauce links to images.' + ], + 'WEBM Metadata': [ + true, + 'Add link to fetch title metadata from webm videos.' + ], + 'Reveal Spoiler Thumbnails': [ + false, + 'Replace spoiler thumbnails with the original image.' + ], + 'Replace GIF': [ + false, + 'Replace gif thumbnails with the actual image.' + ], + 'Replace JPG': [ + false, + 'Replace jpg thumbnails with the actual image.' + ], + 'Replace PNG': [ + false, + 'Replace png thumbnails with the actual image.' + ], + 'Replace WEBM': [ + false, + 'Replace webm, mp4, and ogv thumbnails with the actual video. Probably will degrade browser performance ;)' + ], + 'Image Prefetching': [ + true, + 'Add a shortcut icon to the header to turn on image preloading.' + ], + 'Fappe Tyme': [ + true, + 'Hide posts without images when header menu item is checked. *hint* *hint*' + ], + 'Werk Tyme': [ + true, + 'Hide all post images when header menu item is checked.' + ], + 'Autoplay': [ + true, + 'Videos begin playing immediately when opened.' + ], + 'Restart when Opened': [ + false, + 'Restart GIFs and WebMs when you hover over or expand them.' + ], + 'Show Controls': [ + true, + 'Show controls on videos expanded inline.' + ], + 'Click Passthrough': [ + false, + 'Clicks on videos trigger your browser\'s default behavior. Videos can be contracted with button / dragging to the left.', + 1 + ], + 'Allow Sound': [ + true, + 'Open videos with the sound unmuted.' + ], + 'Mouse Wheel Volume': [ + true, + 'Adjust volume of videos with the mouse wheel over the thumbnail/filename/gallery.' + ], + 'Loop in New Tab': [ + true, + 'Loop videos opened in their own tabs.' + ], + 'Volume in New Tab': [ + true, + `Apply ${meta.name} mute and volume settings to videos opened in their own tabs.` + ] + }, + + 'Menu': { + 'Menu': [ + true, + 'Add a drop-down menu to posts.' + ], + 'Report Link': [ + true, + 'Add a report link to the menu.', + 1 + ], + 'Copy Text Link': [ + true, + 'Add a link to copy the post\'s text.', + 1 + ], + 'Thread Hiding Link': [ + true, + 'Add a link to hide entire threads.', + 1 + ], + 'Reply Hiding Link': [ + true, + 'Add a link to hide single replies.', + 1 + ], + 'Delete Link': [ + true, + 'Add post and image deletion links to the menu.', + 1 + ], + 'Archive Link': [ + true, + 'Add an archive link to the menu.', + 1 + ], + 'Edit Link': [ + true, + 'Add a link to edit the image in Tegaki, /i/\'s painting program. Requires Quick Reply.', + 1 + ], + 'Download Link': [ + false, + 'Add a download with original filename link to the menu.', + 1 + ] + }, + + 'Monitoring': { + 'Thread Updater': [ + true, + 'Fetch and insert new replies. Has more options in the header menu and the "Advanced" tab.' + ], + 'Unread Count': [ + true, + 'Show the unread posts count in the tab title.' + ], + 'Quoted Title': [ + false, + 'Change the page title to reflect you\'ve been quoted.', + 1 + ], + 'Hide Unread Count at (0)': [ + false, + 'Hide the unread posts count in the tab title when it reaches 0.', + 1 + ], + 'Unread Favicon': [ + true, + 'Show a different favicon when there are unread posts.' + ], + 'Unread Line': [ + true, + 'Show a line to distinguish read posts from unread ones.' + ], + 'Remember Last Read Post': [ + true, + 'Remember how far you\'ve read after you close the thread.' + ], + 'Scroll to Last Read Post': [ + true, + 'Scroll back to the last read post when reopening a thread.', + 1 + ], + 'Unread Line in Index': [ + false, + 'Show a line between read and unread posts in threads in the index.', + 1 + ], + 'Remove Thread Excerpt': [ + false, + 'Replace the excerpt of the thread in the tab title with the board title.' + ], + 'Thread Stats': [ + true, + 'Display reply and image count.' + ], + 'IP Count in Stats': [ + true, + 'Display the unique IP count in the thread stats.', + 1 + ], + 'Page Count in Stats': [ + true, + 'Display the page count in the thread stats.', + 1 + ], + 'Updater and Stats in Header': [ + true, + 'Places the thread updater and thread stats in the header instead of floating them.' + ], + 'Thread Watcher': [ + true, + 'Bookmark threads. Has more options in the thread watcher menu.' + ], + 'Fixed Thread Watcher': [ + true, + 'Makes the thread watcher scroll with the page.', + 1 + ], + 'Persistent Thread Watcher': [ + false, + 'The thread watcher will be visible when the page is loaded.', + 1 + ], + 'Mark New IPs': [ + false, + 'Label each post from a new IP with the thread\'s current IP count.' + ], + 'Reply Pruning': [ + true, + 'Add option in header menu to hide old replies in long threads. Activated by default in stickies.' + ], + 'Prune All Threads': [ + false, + 'Activate Reply Pruning by default in all threads.', + 1 + ] + }, + + 'Posting and Captchas': { + 'Quick Reply': [ + true, + 'All-in-one form to reply, create threads, automate dumping and more.' + ], + 'Persistent QR': [ + false, + 'The Quick reply won\'t disappear after posting.', + 1 + ], + 'Auto Hide QR': [ + true, + 'Automatically hide the quick reply when posting.', + 2 + ], + 'Open Post in New Tab': [ + true, + 'Open new threads in a new tab, and open replies in a new tab if you\'re not already in the thread.', + 1 + ], + 'Remember QR Size': [ + false, + 'Remember the size of the Quick reply.', + 1 + ], + 'Remember Spoiler': [ + false, + 'Remember the spoiler state, instead of resetting after posting.', + 1 + ], + 'Randomize Filename': [ + false, + 'Set the filename to a random timestamp within the past year. Disabled on /f/.', + 1 + ], + 'Show New Thread Option in Threads': [ + true, + 'Show the option to post a new / different thread from inside a thread.', + 1 + ], + 'Show Upload Progress': [ + true, + 'Track progress of file uploads as percentage in submit button.', + 1 + ], + 'Cooldown': [ + true, + 'Indicate the remaining time before posting again.', + 1 + ], + 'Posting Success Notifications': [ + true, + 'Show notifications on successful post creation or file uploading.', + 1 + ], + 'Auto-load captcha': [ + false, + 'Automatically load the captcha in the QR even if your post is empty.', + 1 + ], + 'Post on Captcha Completion': [ + false, + 'Submit the post immediately when the captcha is completed.', + 1 + ], + 'Force Noscript Captcha': [ + false, + 'Use the non-Javascript fallback captcha even if Javascript is enabled.' + ], + 'Pass Link': [ + false, + 'Add a 4chan Pass login link to the bottom of the page.' + ] + }, + + 'Quote Links': { + 'Quote Backlinks': [ + true, + 'Add quote backlinks.' + ], + 'OP Backlinks': [ + true, + 'Add backlinks to the OP.', + 1 + ], + 'Bottom Backlinks': [ + false, + 'Place backlinks at the bottom of posts.', + 1 + ], + 'Quote Inlining': [ + true, + 'Inline quoted post on click.' + ], + 'Inline Cross-thread Quotes Only': [ + false, + 'Don\'t inline quote links when the posts are visible in the thread.', + 1 + ], + 'Quote Hash Navigation': [ + false, + 'Include an extra link after quotes for autoscrolling to quoted posts.', + 1 + ], + 'Forward Hiding': [ + true, + 'Hide original posts of inlined backlinks.', + 1 + ], + 'Quote Previewing': [ + true, + 'Show quoted post on hover.' + ], + 'Quote Highlighting': [ + true, + 'Highlight the previewed post.', + 1 + ], + 'Resurrect Quotes': [ + true, + 'Link dead quotes to the archives, and support inlining/previewing of archive links like quote links.' + ], + 'Remember Your Posts': [ + true, + 'Remember your posting history.' + ], + 'Mark Quotes of You': [ + true, + 'Add \'(You)\' to quotes linking to your posts.', + 1 + ], + 'Highlight Posts Quoting You': [ + true, + 'Highlights any posts that contain a quote to your post.', + 1 + ], + 'Highlight Own Posts': [ + true, + 'Highlights own posts.', + 1 + ], + 'Mark OP Quotes': [ + true, + 'Add \'(OP)\' to OP quotes.' + ], + 'Mark Cross-thread Quotes': [ + true, + 'Add \'(Cross-thread)\' to cross-threads quotes.' + ], + 'Quote Threading': [ + true, + 'Add option in header menu to thread conversations.' + ] + } + }, + + imageExpansion: { + 'Fit width': [ + true, + '' + ], + 'Fit height': [ + false, + '' + ], + 'Scroll into view': [ + true, + 'Scroll down when expanding images to bring the full image into view.' + ], + 'Expand spoilers': [ + true, + 'Expand all images along with spoilers.' + ], + 'Expand videos': [ + true, + 'Expand all images also expands videos.' + ], + 'Expand from here': [ + false, + 'Expand all images only from current position to thread end.' + ], + 'Expand thread only': [ + false, + 'In index, expand all images only within the current thread.' + ], + 'Advance on contract': [ + false, + 'Advance to next post when contracting an expanded image.' + ] + }, + + gallery: { + 'Hide Thumbnails': [ + false + ], + 'Fit Width': [ // 'Fit width' (lowercase W) belongs to Image Expansion. Engine limitations, heh. + true + ], + 'Fit Height': [ + true + ], + 'Stretch to Fit': [ + false + ], + 'Scroll to Post': [ + true + ], + 'Slide Delay': [ + 6.0 + ] + }, + + 'Default Volume': 1.0, + + threadWatcher: { + 'Current Board': [ + false, + 'Only show watched threads from the current board.' + ], + 'Auto Update Thread Watcher': [ + true, + 'Periodically check status of watched threads.' + ], + 'Auto Watch': [ + true, + 'Automatically watch threads you start.' + ], + 'Auto Watch Reply': [ + true, + 'Automatically watch threads you reply to.' + ], + 'Auto Prune': [ + false, + 'Automatically remove dead threads.' + ], + 'Show Page': [ + true, + 'Show what page watched threads are on.' + ], + 'Show Unread Count': [ + true, + 'Show number of unread posts in watched threads.' + ], + 'Show Site Prefix': [ + true, + 'When multiple sites are shown in the thread watcher, add a prefix to board names to distinguish them.' + ], + 'Require OP Quote Link': [ + false, + 'For purposes of thread watcher highlighting, only consider posts with a quote link to the OP as replies to the OP.' + ] + }, + + filter: { + general: '', + + postID: `\ +# Highlight dubs on [s4s]: +#/(\\d)\\1$/;highlight;top:no;boards:s4s\ +`, + + name: `\ +# Filter any namefags: +#/^(?!Anonymous$)/\ +`, + + uniqueID: `\ +# Filter a specific ID: +#/Txhvk1Tl/\ +`, + + tripcode: `\ +# Filter any tripfag +#/^!/\ +`, + + capcode: `\ +# Set a custom class for mods: +#/Mod$/;highlight:mod;op:yes +# Set a custom class for admins: +#/Admin$/;highlight:admin;op:yes\ +`, + + pass: `\ +# Filter anyone using since4pass: +#/./\ +`, + + email: '', + + subject: `\ +# Filter Generals on /v/: +#/general/i;boards:v;op:only\ +`, + + comment: `\ +# Filter Stallman copypasta on /g/: +#/what you\'re refer+ing to as linux/i;boards:g +# Filter posts with 20 or more quote links: +#/(?:>>\\d(?:(?!>>\\d)[^])*){20}/ +# Filter posts like T H I S / H / I / S: +#/^>?\\s?\\w\\s?(\\w)\\s?(\\w)\\s?(\\w).*$[\\s>]+\\1[\\s>]+\\2[\\s>]+\\3/im\ +`, + + flag: '', + filename: '', + dimensions: `\ +# Highlight potential wallpapers: +#/1920x1080/;op:yes;highlight;top:no;boards:w,wg\ +`, + + filesize: '', + + MD5: '' + }, + + sauces: `\ +# Known filename formats: +https://www.pixiv.net/member_illust.php?mode=medium&illust_id=%$1;regexp:/^(\\d+)_p\\d+/ +javascript:void(open("https://www.deviantart.com/"+%$1.replace(/_/g,"-")+"/art/"+parseInt(%$2,36)));regexp:/^\\w+_by_(\\w+)[_-]d([\\da-z]{6})\\b/ +https://imgur.com/%$1;regexp:/^(?![a-zA-Z][a-z]{6})(?![A-Z]{7})(?!\\d{7})([\\da-zA-Z]{7})(?: \\(\\d+\\))?\\.\\w+$/ +https://flickr.com/photo.gne?id=%$1;regexp:/^(\\d+)_[\\da-f]{10}(?:_\\w)*\\b/ +https://www.facebook.com/photo.php?fbid=%$1;regexp:/^\\d+_(\\d+)_\\d+_[no]\\b/ + +# Reverse image search: +https://www.google.com/searchbyimage?sbisrc=4chanx&image_url=%IMG&safe=off +https://yandex.com/images/search?rpt=imageview&url=%IMG +#//tineye.com/search?url=%IMG +#//www.bing.com/images/search?q=imgurl:%IMG&view=detailv2&iss=sbi#enterInsights +#https://lens.google.com/uploadbyurl?url=%IMG;text:lens + +# Specialized reverse image search: +//iqdb.org/?url=%IMG +https://trace.moe/?auto&url=%IMG;text:wait +#//3d.iqdb.org/?url=%IMG +#//saucenao.com/search.php?url=%IMG + +# "View Same" in archives: +http://eye.swfchan.com/search/?q=%name;types:swf +#https://desuarchive.org/_/search/image/%sMD5/ +#https://archive.4plebs.org/_/search/image/%sMD5/ +#https://boards.fireden.net/_/search/image/%sMD5/ +#https://foolz.fireden.net/_/search/image/%sMD5/ + +# Other tools: +#http://exif.regex.info/exif.cgi?imgurl=%URL +#//imgops.com/start?url=%URL;types:gif,jpg,png +#//www.gif-explode.com/%URL;types:gif\ +`, + + FappeT: { + werk: false + }, + + 'Custom CSS': true, + + Index: { + 'Index Mode': 'paged', + 'Previous Index Mode': 'paged', + 'Index Size': 'small', + 'Show Replies': [true, 'Show replies in the index, and also in the catalog if "Catalog hover expand" is checked.'], + 'Catalog Hover Expand': [false, 'Expand the comment and show more details when you hover over a thread in the catalog.'], + 'Catalog Hover Toggle': [true, 'Turn "Catalog hover expand" on and off by clicking in the catalog.'], + 'Pin Watched Threads': [false, 'Move watched threads to the start of the index.'], + 'Anchor Hidden Threads': [true, 'Move hidden threads to the end of the index.'], + 'Refreshed Navigation': [false, 'Refresh index when navigating through pages.'] + }, + + Header: { + 'Fixed Header': true, + 'Header auto-hide': false, + 'Header auto-hide on scroll': false, + 'Bottom Header': false, + 'Centered links': false, + 'Header catalog links': false, + 'Bottom Board List': true, + 'Shortcut Icons': true, + 'Custom Board Navigation': true + }, + + archives: { + archiveLists: 'https://4chenz.github.io/archives.json/archives.json', + lastarchivecheck: 0, + archiveAutoUpdate: true + }, + + externalCatalogURLs: `\ +//catalog.neet.tv/%board/;boards:4chan.org:3,a,adv,an,asp,biz,c,cgl,ck,cm,co,diy,f,fa,fit,g,gd,his,i,int,jp,k,lgbt,lit,m,mlp,mu,n,news,o,out,p,po,pol,s4s,sci,sp,tg,toy,trv,tv,v,vg,vip,vp,vr,w,wg,wsg,wsr,x\ +`, + + boardnav: `\ +[ toggle-all ] +[current-index-text:"Index" +current-catalog-text:"Catalog" +current-expired-text:"Expired" +current-archive-text:"Archive"] +[external-text:"FAQ","${meta.name}"]\ +`, + + QR: { + 'QR.personas': `\ +#options:"sage";boards:jp;always\ +`, + sjisPreview: false + }, + + jsWhitelist: `\ +http://s.4cdn.org +https://s.4cdn.org +http://www.google.com +https://www.google.com +https://www.gstatic.com +http://cdn.mathjax.org +https://cdn.mathjax.org +https://cdnjs.cloudflare.com +https://hcaptcha.com +https://*.hcaptcha.com +'self' +'unsafe-inline' +'unsafe-eval'\ +`, + + captchaLanguage: '', + + time: '%m/%d/%y(%a)%H:%M:%S', + timeLocale: '', + + backlink: '>>%id', + + pastedname: 'file', + + fileInfo: '%l %d (%p%s, %r%g)', + + favicon: 'ferongr', + + usercss: userCss, + + hotkeys: { + // QR & Options + 'Toggle board list': [ + 'Ctrl+b', + 'Toggle the full board list.' + ], + 'Toggle header': [ + 'Shift+h', + 'Toggle the auto-hide option of the header.' + ], + 'Open empty QR': [ + 'q', + 'Open QR without post number inserted.' + ], + 'Open QR': [ + 'Shift+q', + 'Open QR with post number inserted.' + ], + 'Open settings': [ + 'Alt+o', + 'Open Settings.' + ], + 'Close': [ + 'Esc', + 'Close dialogs or notifications.' + ], + 'Spoiler tags': [ + 'Ctrl+s', + 'Insert spoiler tags.' + ], + 'Code tags': [ + 'Alt+c', + 'Insert code tags.' + ], + 'Eqn tags': [ + 'Alt+e', + 'Insert eqn tags.' + ], + 'Math tags': [ + 'Alt+m', + 'Insert math tags.' + ], + 'SJIS tags': [ + 'Alt+a', + 'Insert SJIS tags.' + ], + 'Toggle sage': [ + 'Alt+s', + 'Toggle sage in options field.' + ], + 'Toggle Cooldown': [ + 'Alt+Comma', + 'Toggle custom cooldown timer.' + ], + 'Post from URL': [ + 'Alt+l', + 'Post from URL.' + ], + 'Add new post': [ + 'Alt+n', + 'Add new post to the QR dump list.' + ], + 'Submit QR': [ + 'Ctrl+Enter', + 'Submit post.' + ], + // Thread related + 'Watch': [ + 'w', + 'Watch thread.' + ], + 'Update': [ + 'r', + 'Update the thread / refresh the index.' + ], + 'Update thread watcher': [ + 'Shift+r', + 'Manually refresh thread watcher.' + ], + 'Toggle thread watcher': [ + 't', + 'Toggle visibility of thread watcher.' + ], + 'Toggle threading': [ + 'Shift+t', + 'Toggle threading.' + ], + 'Mark thread read': [ + 'Ctrl+0', + 'Mark thread read from index (requires "Unread Line in Index").' + ], + // Images + 'Expand image': [ + 'Shift+e', + 'Expand selected image.' + ], + 'Expand images': [ + 'e', + 'Expand all images.' + ], + 'Open Gallery': [ + 'g', + 'Opens the gallery.' + ], + 'Next Gallery Image': [ + 'Right', + 'Go to the next image in gallery mode.' + ], + 'Previous Gallery Image': [ + 'Left', + 'Go to the previous image in gallery mode.' + ], + 'Advance Gallery': [ + 'Enter', + 'Go to next image or, if Autoplay is off, play video.' + ], + 'Pause': [ + 'p', + 'Pause/play videos in the gallery.' + ], + 'Slideshow': [ + 'Ctrl+Right', + 'Toggle the gallery slideshow mode.' + ], + 'Rotate image clockwise': [ + 'Shift+Right', + 'Rotate image clockwise in gallery.' + ], + 'Rotate image anticlockwise': [ + 'Shift+Left', + 'Rotate image anticlockwise in gallery.' + ], + 'Download Gallery Image': [ + 'Shift+j', + 'Download current image in gallery.' + ], + 'fappeTyme': [ + 'f', + 'Toggle Fappe Tyme.' + ], + 'werkTyme': [ + 'Shift+w', + 'Toggle Werk Tyme.' + ], + // Board Navigation + 'Front page': [ + '1', + 'Jump to front page.' + ], + 'Open front page': [ + 'Shift+1', + 'Open front page in a new tab.' + ], + 'Next page': [ + 'Ctrl+Right', + 'Jump to the next page.' + ], + 'Previous page': [ + 'Ctrl+Left', + 'Jump to the previous page.' + ], + 'Paged mode': [ + 'Alt+1', + 'Open the index in paged mode.' + ], + 'Infinite scrolling mode': [ + 'Alt+2', + 'Open the index in infinite scrolling mode.' + ], + 'All pages mode': [ + 'Alt+3', + 'Open the index in all threads mode.' + ], + 'Open catalog': [ + 'Shift+c', + 'Open the catalog of the current board.' + ], + 'Search form': [ + 'Ctrl+Alt+s', + 'Focus the search field on the board index.' + ], + 'Cycle sort type': [ + 'Alt+x', + 'Cycle through index sort types.' + ], + // Thread Navigation + 'Next thread': [ + 'Ctrl+Down', + 'See next thread.' + ], + 'Previous thread': [ + 'Ctrl+Up', + 'See previous thread.' + ], + 'Expand thread': [ + 'Ctrl+e', + 'Expand thread.' + ], + 'Open thread': [ + 'o', + 'Open thread in current tab.' + ], + 'Open thread tab': [ + 'Shift+o', + 'Open thread in new tab.' + ], + // Reply Navigation + 'Next reply': [ + 'j', + 'Select next reply.' + ], + 'Previous reply': [ + 'k', + 'Select previous reply.' + ], + 'Deselect reply': [ + 'Shift+d', + 'Deselect reply.' + ], + 'Hide': [ + 'x', + 'Hide thread.' + ], + 'Quick Filter MD5': [ + '5', + 'Add the MD5 of the selected image to the filter list.' + ], + 'Previous Post Quoting You': [ + 'Alt+Up', + 'Scroll to the previous post that quotes you.' + ], + 'Next Post Quoting You': [ + 'Alt+Down', + 'Scroll to the next post that quotes you.' + ] + }, + + updater: { + checkbox: { + 'Beep': [ + false, + 'Beep on new post to completely read thread.' + ], + 'Beep Quoting You': [ + false, + 'Beep on new post quoting you.' + ], + 'Auto Scroll': [ + false, + 'Scroll updated posts into view. Only enabled at bottom of page.' + ], + 'Bottom Scroll': [ + false, + 'Always scroll to the bottom, not the first new post. Useful for event threads.' + ], + 'Scroll BG': [ + false, + 'Auto-scroll background tabs.' + ], + 'Auto Update': [ + true, + 'Automatically fetch new posts.' + ], + 'Optional Increase': [ + false, + 'Increase the intervals between updates on threads without new posts.' + ] + }, + 'Interval': 5 + }, + + customCooldown: 0, + customCooldownEnabled: true, + + 'Thread Quotes': false, + + 'Max Replies': 1000, + + 'Autohiding Scrollbar': false, + + position: { + 'embedding.position': 'top: 50px; right: 0px;', + 'thread-stats.position': 'bottom: 0px; right: 0px;', + 'updater.position': 'bottom: 0px; left: 0px;', + 'thread-watcher.position': 'top: 50px; left: 0px;', + 'qr.position': 'top: 50px; right: 0px;' + }, + + fourchanImageHost: 'i.4cdn.org', + + hiddenPSAList: [{}], + + knownBanners: banners.join(','), + + passMessageClosed: false, + + 'Prerequest Captcha': false, + + 'PSAseen': [[]] + }; + + var QuickReplyPage = `
        + + × + +
        +
        +
        + + + + + +
        +
        + + +
        +
        +
        +
        + + +
        + +
        + + + No selected file + + + ✎︎ + + 🔗︎ + + 🕒︎ + + + + +
        + + +
        + + + +`; + + var ferongr_unreadDead = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///9zBQC/AADpDAP/gID/q6voCwJJTwpOAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPUCtJM7svankLrq/I+TY5e6Ueh1jyBMX7AFJi9vwfyVO4CbbO6jNYpp9GyVPbdkFhVgAQ2H0NOE5jk9DT8AAAAAElFTkSuQmCC'; + + var ferongr_unreadDeadY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAxUlEQVR42q1TOwrCQBB9s0FRtJI0WoqFtSLYegoP4gVSeJsUHsHSI3iFeIqRXXgwrhlXwYHHhLwPTB7B36abBCV+0pA4DUBQUNZYQptGtW3jtoKyxgoe0yrBCoyZfL/5ioQ3URZO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k9DT8AAAAAElFTkSuQmCC'; + + var ferongr_unreadNSFWY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAx0lEQVQ4y2NgoBYI+cfwH4ZJVgMS0KhEYGyG4FQDkzjzf9P/d/+fgWl0QwiqgSkI/c8IxsgKkDXD5LFq9rwDweiK0A2HqcNqCK5wICSPEcLYAtH+AMN/IXMIBrEJRie6OEgjDAC5x3FqxuUFNiEUA67j1IweTTBxBQ1puAG86jgSEraogskJWSBcwCGF5k30qMJmgMFEhv/MXBAs5oLDAFj8IsczTE7UEeECbhU8+QGZRpaTi2b4L2zF8J9TGk80wjThykzY5AAW/2O1C2mIbgAAAABJRU5ErkJggg=='; + + var xat_unreadDead = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAG1BMVEX+AACLkZFub2yfaF3zZGIAAAD/AAD/iYr/zs8IPcF6AAAABXRSTlMAeprJ7xzg6IEAAABZSURBVAjXY2DABKGBSkqioQwMrGmpxsZhaQEMDGFpIa5pqSCRtPDSNJBIaGh5eShQDYOye0V7iREKAyQFYoiCFAcyILQDGcGmEEZYkGoqiMHKysAQEICwGwAAjBmBqhYlagAAAABJRU5ErkJggg=='; + + var xat_unreadDeadY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAPFBMVEUAAACEgoBva2ilamDxcG7IaWYgFBNOSEf//f0PDQwBAAA7LCwAAAD/AAD+hIX+m5z+zc5HAADPAAAGAADl032uAAAADHRSTlMAzNv0/vz+6v3+7ALrmfyXAAAAaUlEQVQY042PyxKAIAhFAc1eV7T6/3/N8VXOtAgWwBm4ANEPA8AswpySXHvvYZLlpBNrh9pDtcSqAQ1BUTVIjNUQY5icmwfglmXNgE0d6QBF9GigrU0A9LoM53U1kFzk6SBQuWfD/vHqDUCpBmVKTTM4AAAAAElFTkSuQmCC'; + + var xat_unreadSFW = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIVBMVEUAAACRjop4dXVpZ2tdcI9dfKdisfMAAAAumMN9xv+s2/+PADT2AAAAB3RSTlMAepGdv83v3HIc4QAAAFxJREFUCNdjYMAE5YXKRuLlDAzsHe2uIRUdBQwMFR1l6R3tIJGOyukdIJHy8lkry4FqGEwzV62aFozMUAFJOQEZ4iDFhQwI7UBGaTiEUVFs3g5isLMzMBQUIOwGAJRlIu9hk08QAAAAAElFTkSuQmCC'; + + var xat_unreadSFWY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAMFBMVEUAAACAgYVlc4ljsu4AAAAAAAAAAAAumMODyP6b1P6e1f/g8v89msgSIiwNFxwbPU3tQYj5AAAABnRSTlMAxej+9VTmD9ciAAAAZElEQVQI12NgwARpiUKKYmkMDGzlZUpK6eUJDAzp5clm5WUgkfKMtnKQSFpa54o0oBoGJYvZO88+gjJu7wMyhIBS2SCGGFDxaxADpP32NjAjSe0bSFd6epIaWISNjYEhJRVhNwAGlyJpYtcvcAAAAABJRU5ErkJggg=='; + + var xat_unreadNSFW = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAHlBMVEUfJSCRi5Frbm9dn19082KR/30AAABmzDOq/5vZ/9Gt/vt2AAAABnRSTlMAe5rJ7/4vxEp4AAAAWUlEQVQI12NgwARpiUpKYmkMDGzlZcbG6eUJDAzp5Slu5WUgkfLUsHKQSFpaRGsaUA2DsmvnjBAjFAZICsQQAylOZEBoBzKSzSCM9CS1MhCDjY2BISEBYTcAtgAcKSK2vuIAAAAASUVORK5CYII='; + + var xat_unreadNSFWY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAM1BMVEUAAACBj39tfm1qj2RepFlu2VQAAQAAAAAAAABmyzOX/oSr/pus/pzk/98PGgtatC4CBAI1ENblAAAACHRSTlMA09/p9v77ig0SBcQAAABnSURBVBjTjY9LDsAgCEQRsR2xWu9/2hK/adJFY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ng9xAETMYhDrWmeHAMcmvycWAAAAAElFTkSuQmCC'; + + var fourChanJS_unreadDeadY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAD1BMVEUAAAAAAAD/AABmZmYA/wBD99DBAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAE9JREFUCNdljcsRACEIQ5MOiNKAdGAJ9N/Uiu7nsMzABHgB4B8ygFoZA2hhVWavhhGeURPJU9q45+17hGbfGxa82Ndex3hEM44SJGD2/b4AzDgGlHbl388AAAAASUVORK5CYII='; + + var fourChanJS_unreadSFW = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAD1BMVEUBAAAAAAAul8NnZ2f////82iC9AAAAAXRSTlMAQObYZgAAAEFJREFUeNqNjgEKACAMAjvX/98cAkkxgmSgO8Bt/Ai4ApJ6KKhzF3OiEMDASrGB/QWgPEHsUpN+Ng9xAETMYhDrWmeHAMcmvycWAAAAAElFTkSuQmCC'; + + var fourChanJS_unreadSFWY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAD1BMVEUAAAAAAAAul8NnZ2f/AAD7B+mqAAAAAXRSTlMAQObYZgAAAAlwSFlzAAALEgAACxIB0t1+/AAAAE9JREFUCNdljcsRACEIQ5MOiNKAdGAJ9N/Uiu7nsMzABHgB4B8ygFoZA2hhVWavhhGeURPJU9q45+17hGbfGxa82Ndex3hEM44SJGD2/b4AzDgGlHbl388AAAAASUVORK5CYII='; + + var fourChanJS_unreadNSFW = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAElBMVEUBAAAAAABmzDNlyjJnZ2f///+6o7dfAAAAAXRSTlMAQObYZgAAAERJREFUeF6NjkEKADEIA51o///lJZfQxUsHITogWi8AvwZJuxmYa25xDooBLEwOWFTYAsYVhdorLZt9Ng9xCUTCUCQ2H3F4ANrZ2WNiAAAAAElFTkSuQmCC'; + + var fourChanJS_unreadNSFWY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAD1BMVEUAAAAAAABmzDNmZmb/AAC8/wCMAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAE9JREFUCNdljcsRACEIQ5MOiNKAdGAJ9N/Uiu7nsMzABHgB4B8ygFoZA2hhVWavhhGeURPJU9q45+17hGbfGxa82Ndex3hEM44SJGD2/b4AzDgGlHbl388AAAAASUVORK5CYII='; + + var Original_unreadDead = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX/////AAD///8AAABBZmS3AAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; + + var Original_unreadDeadY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAhElEQVR42q1RwQnAMAjMu5M4guAKXa4j5dUROo5tipSDcrFChUONd0di2m/hEGVOHDyIPufgwAFASDkpoSzmBrkJ2UMyR9LsJ3rvrqo3Rt1YMIMhhNnOxLMnoMFBxHyJAr2IOBFzA8U+6pLBdmEJTA0aMVjpDd6Loks0s5HZNwYx8tfZCZ0kll7ORffZAAAAAElFTkSuQmCC'; + + var Original_unreadSFW = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX///8ul8P///8AAACaqgkzAAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; + + var Original_unreadSFWY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAALVBMVEUAAAAAAAAAAAAAAAABBQcHFx4KISoNLToaVW4oKCgul8M4ODg7OzvBwcH///8uS/CdAAAAA3RSTlMAx9dmesIgAAAAV0lEQVR42m2NWw6AIBAD1eILZO5/XI0UAgm7H9tOsu0yGWAQSOoFijHOxOANGqm/LczpOaXs4gISrPZ+gc2+hO5w2xdwgOjBFUIF+sEJrhUl9JFr+badFwR+BfqlmGUJAAAAAElFTkSuQmCC'; + + var Original_unreadNSFW = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX///9mzDP///8AAACT0n1lAAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; + + var Original_unreadNSFWY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAALVBMVEUAAAAAAAAAAAAAAAAECAIQIAgWLAsePA8oKCg4ODg6dB07OztmzDPBwcH///+rsf3XAAAAA3RSTlMAx9dmesIgAAAAV0lEQVR42m2NWw6AIBAD1eIDhbn/cTVSCCTsfmw7ybbLZIBBIKkXKKU0E4M3aKT+tjCn5xiziwuIsNr7BTb7ErrDZV/AAaIHdwgV6AcnuFaU0Eeu5dt2XiUyBjCQ2bIrAAAAAElFTkSuQmCC'; + + var Metro_unreadDead = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAC/AABrZQDiAAAAAXRSTlMAQObYZgAAABJJREFUCB1jZGBgrMNAQEEc4gCSfAX5bRw/NQAAAABJRU5ErkJggg=='; + + var Metro_unreadDeadY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAAAAAAAAAC/AAD///8dAAApAABsAAAHAAA4AACQAAAsAABMCpCvAAAAA3RSTlMAPse+s4iwAAAAMklEQVQI12NggAFmY2MDECaNAQZCilAzVJyg5oS4GqAxUtygjIp2KGOKJ5SxepcB3BUAcdYRqxAtgFoAAAAASUVORK5CYII='; + + var Metro_unreadSFW = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAAA1/GhpCidAAAAAXRSTlMAQObYZgAAABJJREFUCB1jZGBgrMNAQEEc4gCSfAX5bRw/NQAAAABJRU5ErkJggg=='; + + var Metro_unreadSFWY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAAAAAAAAAAA1/H///8AISUALzQAeokACAkAQEcAorYAMTcE9WFNAAAAA3RSTlMAPse+s4iwAAAAMklEQVQI12NggAFmY2MDECaNAQZCilAzVJyg5oS4GqAxUtygjIp2KGOKJ5SxepcB3BUAcdYRqxAtgFoAAAAASUVORK5CYII='; + + var Metro_unreadNSFW = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAABV/wErM5hwAAAAAXRSTlMAQObYZgAAABJJREFUCB1jZGBgrMNAQEEc4gCSfAX5bRw/NQAAAABJRU5ErkJggg=='; + + var Metro_unreadNSFWY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAAAAAAAAABV/wH///8NKAASOAAwkQADCgAZTABAwQATOwC5e3VGAAAAA3RSTlMAPse+s4iwAAAAMklEQVQI12NggAFmY2MDECaNAQZCilAzVJyg5oS4GqAxUtygjIp2KGOKJ5SxepcB3BUAcdYRqxAtgFoAAAAASUVORK5CYII='; + + var dead = 'R0lGODlhEAAQAKECAAAAAP8AAP///////yH5BAEKAAIALAAAAAAQABAAAAIvlI+pq+D9DAgUoFkPDlbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw=='; + + var empty = 'R0lGODlhEAAQAJEAAAAAAP///9vb2////yH5BAEAAAMALAAAAAAQABAAAAIvnI+pq+D9DBAUoFkPFnbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw=='; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + + var Favicon = { + init() { + return $$1.asap((() => d$1.head && (Favicon.el = $$1('link[rel="shortcut icon"]', d$1.head))), Favicon.initAsap); + }, + + set(status) { + Favicon.status = status; + if (Favicon.el) { + Favicon.el.href = Favicon[status]; + // `favicon.href = href` doesn't work on Firefox. + return $$1.add(d$1.head, Favicon.el); + } + }, + + initAsap() { + Favicon.el.type = 'image/x-icon'; + const {href} = Favicon.el; + Favicon.isSFW = /ws\.ico$/.test(href); + Favicon.default = href; + Favicon.switch(); + if (Favicon.status) { + return Favicon.set(Favicon.status); + } + }, + + switch() { + let items = { + ferongr: [ + ferongr_unreadDead, + ferongr_unreadDeadY, + ferongr_unreadSFW, + ferongr_unreadSFWY, + ferongr_unreadNSFW, + ferongr_unreadNSFWY, + ], + 'xat-': [ + xat_unreadDead, + xat_unreadDeadY, + xat_unreadSFW, + xat_unreadSFWY, + xat_unreadNSFW, + xat_unreadNSFWY, + ], + Mayhem: [ + Mayhem_unreadDead, + Mayhem_unreadDeadY, + Mayhem_unreadSFW, + Mayhem_unreadSFWY, + Mayhem_unreadNSFW, + Mayhem_unreadNSFWY, + ], + '4chanJS': [ + fourChanJS_unreadDead, + fourChanJS_unreadDeadY, + fourChanJS_unreadSFW, + fourChanJS_unreadSFWY, + fourChanJS_unreadNSFW, + fourChanJS_unreadNSFWY, + ], + Original: [ + Original_unreadDead, + Original_unreadDeadY, + Original_unreadSFW, + Original_unreadSFWY, + Original_unreadNSFW, + Original_unreadNSFWY, + ], + 'Metro': [ + Metro_unreadDead, + Metro_unreadDeadY, + Metro_unreadSFW, + Metro_unreadSFWY, + Metro_unreadNSFW, + Metro_unreadNSFWY, + ] + }; + items = $$1.getOwn(items, Conf['favicon']); + + const f = Favicon; + const t = 'data:image/png;base64,'; + let i = 0; + while (items[i]) { + items[i] = t + items[i++]; + } + + [f.unreadDead, f.unreadDeadY, f.unreadSFW, f.unreadSFWY, f.unreadNSFW, f.unreadNSFWY] = Array.from(items); + return f.update(); + }, + + update() { + if (this.isSFW) { + this.unread = this.unreadSFW; + return this.unreadY = this.unreadSFWY; + } else { + this.unread = this.unreadNSFW; + return this.unreadY = this.unreadNSFWY; + } + }, + + SFW: '//s.4cdn.org/image/favicon-ws.ico', + NSFW: '//s.4cdn.org/image/favicon.ico', + dead: `data:image/gif;base64,${dead}`, + logo: `data:image/png;base64,${empty}`, + }; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + const $$ = (selector, root = d$1.body) => [...Array.from(root.querySelectorAll(selector))]; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + const CaptchaReplace = { + init() { + if ((g.SITE.software !== 'yotsuba') || (d$1.cookie.indexOf('pass_enabled=1') >= 0)) { return; } + + if (Conf['Force Noscript Captcha'] && Main$1.jsEnabled) { + $$1.ready(Captcha.replace.noscript); + return; + } + + if (Conf['captchaLanguage'].trim()) { + if (['boards.4chan.org', 'boards.4channel.org'].includes(location.hostname)) { + return $$1.onExists(doc$1, '#captchaFormPart', node => $$1.onExists(node, 'iframe[src^="https://www.google.com/recaptcha/"]', Captcha.replace.iframe)); + } else { + return $$1.onExists(doc$1, 'iframe[src^="https://www.google.com/recaptcha/"]', Captcha.replace.iframe); + } + } + }, + + noscript() { + let noscript, original, toggle; + if (!((original = $$1('#g-recaptcha')) && (noscript = $$1('noscript', original.parentNode)))) { return; } + const span = $$1.el('span', + {id: 'captcha-forced-noscript'}); + $$1.replace(noscript, span); + $$1.rm(original); + const insert = function() { + span.innerHTML = noscript.textContent; + return Captcha.replace.iframe($$1('iframe[src^="https://www.google.com/recaptcha/"]', span)); + }; + if (toggle = $$1('#togglePostFormLink a, #form-link')) { + return $$1.on(toggle, 'click', insert); + } else { + return insert(); + } + }, + + iframe(iframe) { + let lang; + if (lang = Conf['captchaLanguage'].trim()) { + const src = /[?&]hl=/.test(iframe.src) ? + iframe.src.replace(/([?&]hl=)[^&]*/, '$1' + encodeURIComponent(lang)) + : + iframe.src + `&hl=${encodeURIComponent(lang)}`; + if (iframe.src !== src) { iframe.src = src; } + } + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + const CaptchaT = { + init() { + if (d$1.cookie.indexOf('pass_enabled=1') >= 0) { return; } + if (!(this.isEnabled = !!$$1('#t-root') || !$$1.id('postForm'))) { return; } + + const root = $$1.el('div', {className: 'captcha-root'}); + this.nodes = {root}; + + $$1.addClass(QR.nodes.el, 'has-captcha', 'captcha-t'); + return $$1.after(QR.nodes.com.parentNode, root); + }, + + moreNeeded() { + }, + + getThread() { + let threadID; + const boardID = g.BOARD.ID; + if (QR.posts[0].thread === 'new') { + threadID = '0'; + } else { + threadID = '' + QR.posts[0].thread; + } + return {boardID, threadID}; + }, + + setup(focus) { + if (!this.isEnabled) { return; } + + if (!this.nodes.container) { + this.nodes.container = $$1.el('div', {className: 'captcha-container'}); + $$1.prepend(this.nodes.root, this.nodes.container); + CaptchaT.currentThread = CaptchaT.getThread(); + $$1.global(function() { + const el = document.querySelector('#qr .captcha-container'); + window.TCaptcha.init(el, this.boardID, +this.threadID); + return window.TCaptcha.setErrorCb(err => window.dispatchEvent(new CustomEvent('CreateNotification', {detail: { + type: 'warning', + content: '' + err + }}) + )); + } + , CaptchaT.currentThread); + } + + if (focus) { + return $$1('#t-resp').focus(); + } + }, + + destroy() { + if (!this.isEnabled || !this.nodes.container) { return; } + $$1.global(() => window.TCaptcha.destroy()); + $$1.rm(this.nodes.container); + return delete this.nodes.container; + }, + + updateThread() { + if (!this.isEnabled) { return; } + const {boardID, threadID} = (CaptchaT.currentThread || {}); + const newThread = CaptchaT.getThread(); + if ((newThread.boardID !== boardID) || (newThread.threadID !== threadID)) { + CaptchaT.destroy(); + return CaptchaT.setup(); + } + }, + + getOne() { + let el; + let response = {}; + if (this.nodes.container) { + for (var key of ['t-response', 't-challenge']) { + response[key] = $$1(`[name='${key}']`, this.nodes.container).value; + } + } + if (!response['t-response'] && !((el = $$1('#t-msg')) && /Verification not required/i.test(el.textContent))) { + response = null; + } + return response; + }, + + setUsed() { + if (!this.isEnabled) { return; } + if (this.nodes.container) { + return $$1.global(() => window.TCaptcha.clearChallenge()); + } + }, + + occupied() { + return !!this.nodes.container; + } + }; + + // This file was created because these functions on $ were sometimes not initialized yet because of circular + // dependencies, so try to keep this file without dependencies, so these functions don't have to wait for something else + const debounce = (wait, fn) => { + let lastCall = 0; + let timeout = null; + let that = null; + let args = null; + const exec = function () { + lastCall = Date.now(); + return fn.apply(that, args); + }; + return function () { + args = arguments; + that = this; + if (lastCall < (Date.now() - wait)) { + return exec(); + } + // stop current reset + clearTimeout(timeout); + // after wait, let next invocation execute immediately + return timeout = setTimeout(exec, wait); + }; + }; + const dict = () => Object.create(null); + dict.clone = function (obj) { + if ((typeof obj !== 'object') || (obj === null)) { + return obj; + } + else if (obj instanceof Array) { + const arr = []; + for (let i = 0, end = obj.length; i < end; i++) { + arr.push(dict.clone(obj[i])); + } + return arr; + } + else { + const map = Object.create(null); + for (var key in obj) { + var val = obj[key]; + map[key] = dict.clone(val); + } + return map; + } + }; + dict.json = (str) => dict.clone(JSON.parse(str)); + const SECOND = 1000; + const MINUTE = SECOND * 60; + const HOUR = MINUTE * 60; + const DAY = HOUR * 24; + const platform = window.GM_xmlhttpRequest ? 'userscript' : 'crx'; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS104: Avoid inline assignments + * DS206: Consider reworking classes to avoid initClass + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + class DataBoard { + static initClass() { + this.keys = ['hiddenThreads', 'hiddenPosts', 'lastReadPosts', 'yourPosts', 'watchedThreads', 'watcherLastModified', 'customTitles']; + + this.changes = []; + } + + constructor(key, sync, dontClean) { + this.onSync = this.onSync.bind(this); + this.key = key; + this.initData(Conf[this.key]); + $$1.sync(this.key, this.onSync); + if (!dontClean) { this.clean(); } + if (!sync) { return; } + // Chrome also fires the onChanged callback on the current tab, + // so we only start syncing when we're ready. + var init = () => { + $$1.off(d$1, '4chanXInitFinished', init); + return this.sync = sync; + }; + $$1.on(d$1, '4chanXInitFinished', init); + } + + initData(data) { + let boards; + this.data = data; + if (this.data.boards) { + let lastChecked; + ({boards, lastChecked} = this.data); + this.data['4chan.org'] = {boards, lastChecked}; + delete this.data.boards; + delete this.data.lastChecked; + } + return this.data[g.SITE.ID] || (this.data[g.SITE.ID] = { boards: dict() }); + } + + save(change, cb) { + change(); + DataBoard.changes.push(change); + return $$1.get(this.key, { boards: dict() }, items => { + if (!DataBoard.changes.length) { return; } + const needSync = ((items[this.key].version || 0) > (this.data.version || 0)); + if (needSync) { + this.initData(items[this.key]); + for (change of DataBoard.changes) { change(); } + } + DataBoard.changes = []; + this.data.version = (this.data.version || 0) + 1; + return $$1.set(this.key, this.data, () => { + if (needSync) { this.sync?.(); } + return cb?.(); + }); + }); + } + + forceSync(cb) { + return $$1.get(this.key, { boards: dict() }, items => { + if ((items[this.key].version || 0) > (this.data.version || 0)) { + this.initData(items[this.key]); + for (var change of DataBoard.changes) { change(); } + this.sync?.(); + } + return cb?.(); + }); + } + + delete({siteID, boardID, threadID, postID}, cb) { + if (!siteID) { siteID = g.SITE.ID; } + if (!this.data[siteID]) { return; } + return this.save(() => { + if (postID) { + if (!this.data[siteID].boards[boardID]?.[threadID]) { return; } + delete this.data[siteID].boards[boardID][threadID][postID]; + return this.deleteIfEmpty({siteID, boardID, threadID}); + } else if (threadID) { + if (!this.data[siteID].boards[boardID]) { return; } + delete this.data[siteID].boards[boardID][threadID]; + return this.deleteIfEmpty({siteID, boardID}); + } else { + return delete this.data[siteID].boards[boardID]; + } + } + , cb); + } + + deleteIfEmpty({siteID, boardID, threadID}) { + if (!this.data[siteID]) { return; } + if (threadID) { + if (!Object.keys(this.data[siteID].boards[boardID][threadID]).length) { + delete this.data[siteID].boards[boardID][threadID]; + return this.deleteIfEmpty({siteID, boardID}); + } + } else if (!Object.keys(this.data[siteID].boards[boardID]).length) { + return delete this.data[siteID].boards[boardID]; + } + } + + set(data, cb) { + return this.save(() => { + return this.setUnsafe(data); + } + , cb); + } + + setUnsafe({siteID, boardID, threadID, postID, val}) { + if (!siteID) { siteID = g.SITE.ID; } + if (!this.data[siteID]) { this.data[siteID] = { boards: dict() }; } + if (postID !== undefined) { + let base; + return (((base = this.data[siteID].boards[boardID] || (this.data[siteID].boards[boardID] = dict())))[threadID] || (base[threadID] = dict()))[postID] = val; + } else if (threadID !== undefined) { + return (this.data[siteID].boards[boardID] || (this.data[siteID].boards[boardID] = dict()))[threadID] = val; + } else { + return this.data[siteID].boards[boardID] = val; + } + } + + extend({siteID, boardID, threadID, postID, val}, cb) { + return this.save(() => { + const oldVal = this.get({ siteID, boardID, threadID, postID, defaultValue: dict() }); + for (var key in val) { + var subVal = val[key]; + if (typeof subVal === 'undefined') { + delete oldVal[key]; + } else { + oldVal[key] = subVal; + } + } + return this.setUnsafe({siteID, boardID, threadID, postID, val: oldVal}); + } + , cb); + } + + setLastChecked(key='lastChecked') { + return this.save(() => { + return this.data[key] = Date.now(); + }); + } + + get({siteID, boardID, threadID, postID, defaultValue}) { + let board, val; + if (!siteID) { siteID = g.SITE.ID; } + if (board = this.data[siteID]?.boards[boardID]) { + let thread; + if (threadID == null) { + if (postID != null) { + for (thread = 0; thread < board.length; thread++) { + board[thread]; + if (postID in thread) { + val = thread[postID]; + break; + } + } + } else { + val = board; + } + } else if (thread = board[threadID]) { + val = (postID != null) ? + thread[postID] + : + thread; + } + } + return val || defaultValue; + } + + clean() { + let boardID, middle; + const siteID = g.SITE.ID; + for (boardID in this.data[siteID].boards) { + this.data[siteID].boards[boardID]; + this.deleteIfEmpty({siteID, boardID}); + } + const now = Date.now(); + if (now - (2 * HOUR) >= ((middle = this.data[siteID].lastChecked || 0)) || middle > now) { + this.data[siteID].lastChecked = now; + for (boardID in this.data[siteID].boards) { + this.ajaxClean(boardID); + } + } + } + + ajaxClean(boardID) { + const that = this; + const siteID = g.SITE.ID; + const threadsList = g.SITE.urls.threadsListJSON?.({siteID, boardID}); + if (!threadsList) { return; } + return $$1.cache(threadsList, function() { + if (this.status !== 200) { return; } + const archiveList = g.SITE.urls.archiveListJSON?.({siteID, boardID}); + if (!archiveList) { return that.ajaxCleanParse(boardID, this.response); } + const response1 = this.response; + return $$1.cache(archiveList, function() { + if ((this.status !== 200) && (!!g.SITE.archivedBoardsKnown || (this.status !== 404))) { return; } + return that.ajaxCleanParse(boardID, response1, this.response); + }); + }); + } + + ajaxCleanParse(boardID, response1, response2) { + let board, ID; + const siteID = g.SITE.ID; + if (!(board = this.data[siteID].boards[boardID])) { return; } + const threads = dict(); + if (response1) { + for (var page of response1) { + for (var thread of page.threads) { + ID = thread.no; + if (ID in board) { threads[ID] = board[ID]; } + } + } + } + if (response2) { + for (ID of response2) { + if (ID in board) { threads[ID] = board[ID]; } + } + } + this.data[siteID].boards[boardID] = threads; + this.deleteIfEmpty({siteID, boardID}); + return $$1.set(this.key, this.data); + } + + onSync(data) { + if ((data.version || 0) <= (this.data.version || 0)) { return; } + this.initData(data); + return this.sync?.(); + } + } + DataBoard.initClass(); + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + class SimpleDict { + constructor() { + this.keys = []; + } + push(key, data) { + key = `${key}`; + if (!this[key]) { + this.keys.push(key); + } + return this[key] = data; + } + rm(key) { + let i; + key = `${key}`; + if ((i = this.keys.indexOf(key)) !== -1) { + this.keys.splice(i, 1); + return delete this[key]; + } + } + forEach(fn) { + for (var key of [...Array.from(this.keys)]) { + fn(this[key]); + } + } + get(key) { + if (key === 'keys') { + return undefined; + } + else { + return $$1.getOwn(this, key); + } + } + } + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + class Thread { + toString() { return this.ID; } + + constructor(ID, board) { + this.board = board; + this.ID = +ID; + this.threadID = this.ID; + this.boardID = this.board.ID; + this.siteID = g.SITE.ID; + this.fullID = `${this.board}.${this.ID}`; + this.posts = new SimpleDict(); + this.isDead = false; + this.isHidden = false; + this.isSticky = false; + this.isClosed = false; + this.isArchived = false; + this.postLimit = false; + this.fileLimit = false; + this.lastPost = 0; + this.ipCount = undefined; + this.json = null; + + this.OP = null; + this.catalogView = null; + + this.nodes = + {root: null}; + + this.board.threads.push(this.ID, this); + g.threads.push(this.fullID, this); + } + + setPage(pageNum) { + let icon; + const {info, reply} = this.OP.nodes; + if (!(icon = $$1('.page-num', info))) { + icon = $$1.el('span', {className: 'page-num'}); + $$1.replace(reply.parentNode.previousSibling, [$$1.tn(' '), icon, $$1.tn(' ')]); + } + icon.title = `This thread is on page ${pageNum} in the original index.`; + icon.textContent = `[${pageNum}]`; + if (this.catalogView) { return this.catalogView.nodes.pageCount.textContent = pageNum; } + } + + setCount(type, count, reachedLimit) { + if (!this.catalogView) { return; } + const el = this.catalogView.nodes[`${type}Count`]; + el.textContent = count; + return (reachedLimit ? $$1.addClass : $$1.rmClass)(el, 'warning'); + } + + setStatus(type, status) { + const name = `is${type}`; + if (this[name] === status) { return; } + this[name] = status; + if (!this.OP) { return; } + this.setIcon('Sticky', this.isSticky); + this.setIcon('Closed', this.isClosed && !this.isArchived); + return this.setIcon('Archived', this.isArchived); + } + + setIcon(type, status) { + const typeLC = type.toLowerCase(); + let icon = $$1(`.${typeLC}Icon`, this.OP.nodes.info); + if (!!icon === status) { return; } + + if (!status) { + $$1.rm(icon.previousSibling); + $$1.rm(icon); + if (this.catalogView) { $$1.rm($$1(`.${typeLC}Icon`, this.catalogView.nodes.icons)); } + return; + } + icon = $$1.el('img', { + src: `${g.SITE.Build.staticPath}${typeLC}${g.SITE.Build.gifIcon}`, + alt: type, + title: type, + className: `${typeLC}Icon retina` + } + ); + if (g.BOARD.ID === 'f') { + icon.style.cssText = 'height: 18px; width: 18px;'; + } + + const root = (type !== 'Sticky') && this.isSticky ? + $$1('.stickyIcon', this.OP.nodes.info) + : + $$1('.page-num', this.OP.nodes.info) || this.OP.nodes.quote; + $$1.after(root, [$$1.tn(' '), icon]); + + if (!this.catalogView) { return; } + return ((type === 'Sticky') && this.isClosed ? $$1.prepend : $$1.add)(this.catalogView.nodes.icons, icon.cloneNode()); + } + + kill() { + return this.isDead = true; + } + + collect() { + let n = 0; + this.posts.forEach(function(post) { + if (post.clones.length) { + return n++; + } else { + return post.collect(); + } + }); + if (!n) { + g.threads.rm(this.fullID); + return this.board.threads.rm(this); + } + } + } + + class CatalogThread { + toString() { return this.ID; } + + constructor(root, thread) { + this.thread = thread; + this.ID = this.thread.ID; + this.board = this.thread.board; + const {post} = this.thread.OP.nodes; + this.nodes = { + root, + thumb: $$1('.catalog-thumb', post), + icons: $$1('.catalog-icons', post), + postCount: $$1('.post-count', post), + fileCount: $$1('.file-count', post), + pageCount: $$1('.page-count', post), + replies: null + }; + this.thread.catalogView = this; + } + } + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * DS206: Consider reworking classes to avoid initClass + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + const dialog = function(id, properties) { + const el = $$1.el('div', { + className: 'dialog', + id + } + ); + $$1.extend(el, properties); + el.style.cssText = Conf[`${id}.position`]; + + const move = $$1('.move', el); + $$1.on(move, 'touchstart mousedown', dragstart); + for (var child of move.children) { + if (!child.tagName) { continue; } + $$1.on(child, 'touchstart mousedown', e => e.stopPropagation()); + } + + return el; + }; + + var Menu$1 = (function() { + let currentMenu = undefined; + let lastToggledButton = undefined; + Menu$1 = class Menu { + static initClass() { + currentMenu = null; + lastToggledButton = null; + } + + constructor(type) { + // XXX AddMenuEntry event is deprecated + this.setPosition = this.setPosition.bind(this); + this.close = this.close.bind(this); + this.keybinds = this.keybinds.bind(this); + this.onFocus = this.onFocus.bind(this); + this.addEntry = this.addEntry.bind(this); + this.type = type; + $$1.on(d$1, 'AddMenuEntry', ({detail}) => { + if (detail.type !== this.type) { return; } + delete detail.open; + return this.addEntry(detail); + }); + this.entries = []; + } + + makeMenu() { + const menu = $$1.el('div', { + className: 'dialog', + id: 'menu', + tabIndex: 0 + } + ); + menu.dataset.type = this.type; + $$1.on(menu, 'click', e => e.stopPropagation()); + $$1.on(menu, 'keydown', this.keybinds); + return menu; + } + + toggle(e, button, data) { + e.preventDefault(); + e.stopPropagation(); + + if (currentMenu) { + // Close if it's already opened. + // Reopen if we clicked on another button. + const previousButton = lastToggledButton; + currentMenu.close(); + if (previousButton === button) { return; } + } + + if (!this.entries.length) { return; } + return this.open(button, data); + } + + open(button, data) { + let entry; + const menu = (this.menu = this.makeMenu()); + currentMenu = this; + lastToggledButton = button; + + this.entries.sort((first, second) => first.order - second.order); + + for (entry of this.entries) { + this.insertEntry(entry, menu, data); + } + + $$1.addClass(lastToggledButton, 'active'); + + $$1.on(d$1, 'click CloseMenu', this.close); + $$1.on(d$1, 'scroll', this.setPosition); + $$1.on(window, 'resize', this.setPosition); + $$1.after(button, menu); + + this.setPosition(); + + entry = $$1('.entry', menu); + // We've removed flexbox, so we don't use order anymore. + // while prevEntry = @findNextEntry entry, -1 + // entry = prevEntry + this.focus(entry); + + return menu.focus(); + } + + setPosition() { + const mRect = this.menu.getBoundingClientRect(); + const bRect = lastToggledButton.getBoundingClientRect(); + window.scrollY + bRect.top; + window.scrollX + bRect.left; + const cHeight = doc$1.clientHeight; + const cWidth = doc$1.clientWidth; + const [top, bottom] = Array.from((bRect.top + bRect.height + mRect.height) < cHeight ? + [`${bRect.bottom}px`, ''] + : + ['', `${cHeight - bRect.top}px`]); + const [left, right] = Array.from((bRect.left + mRect.width) < cWidth ? + [`${bRect.left}px`, ''] + : + ['', `${cWidth - bRect.right}px`]); + $$1.extend(this.menu.style, {top, right, bottom, left}); + return this.menu.classList.toggle('left', right); + } + + insertEntry(entry, parent, data) { + let submenu; + if (typeof entry.open === 'function') { + try { + if (!entry.open(data)) { return; } + } catch (err) { + Main$1.handleErrors({ + message: `Error in building the ${this.type} menu.`, + error: err + }); + return; + } + } + $$1.add(parent, entry.el); + + if (!entry.subEntries) { return; } + if (submenu = $$1('.submenu', entry.el)) { + // Reset sub menu, remove irrelevant entries. + $$1.rm(submenu); + } + submenu = $$1.el('div', + {className: 'dialog submenu'}); + for (var subEntry of entry.subEntries) { + this.insertEntry(subEntry, submenu, data); + } + $$1.add(entry.el, submenu); + } + + close() { + $$1.rm(this.menu); + delete this.menu; + $$1.rmClass(lastToggledButton, 'active'); + currentMenu = null; + lastToggledButton = null; + $$1.off(d$1, 'click scroll CloseMenu', this.close); + $$1.off(d$1, 'scroll', this.setPosition); + return $$1.off(window, 'resize', this.setPosition); + } + + findNextEntry(entry, direction) { + const entries = [...Array.from(entry.parentNode.children)]; + entries.sort((first, second) => first.style.order - second.style.order); + return entries[entries.indexOf(entry) + direction]; + } + + keybinds(e) { + let subEntry; + let next, submenu; + let entry = $$1('.focused', this.menu); + while ((subEntry = $$1('.focused', entry))) { + entry = subEntry; + } + + switch (e.keyCode) { + case 27: // Esc + lastToggledButton.focus(); + this.close(); + break; + case 13: case 32: // Enter, Space + entry.click(); + break; + case 38: // Up + if (next = this.findNextEntry(entry, -1)) { + this.focus(next); + } + break; + case 40: // Down + if (next = this.findNextEntry(entry, +1)) { + this.focus(next); + } + break; + case 39: // Right + if ((submenu = $$1('.submenu', entry)) && (next = submenu.firstElementChild)) { + let nextPrev; + while ((nextPrev = this.findNextEntry(next, -1))) { + next = nextPrev; + } + this.focus(next); + } + break; + case 37: // Left + if (next = $$1.x('parent::*[contains(@class,"submenu")]/parent::*', entry)) { + this.focus(next); + } + break; + default: + return; + } + + e.preventDefault(); + return e.stopPropagation(); + } + + onFocus(e) { + e.stopPropagation(); + return this.focus(e.target); + } + + focus(entry) { + let focused, submenu; + while ((focused = $$1.x('parent::*/child::*[contains(@class,"focused")]', entry))) { + $$1.rmClass(focused, 'focused'); + } + for (focused of $$('.focused', entry)) { + $$1.rmClass(focused, 'focused'); + } + $$1.addClass(entry, 'focused'); + + // Submenu positioning. + if (!(submenu = $$1('.submenu', entry))) { return; } + const sRect = submenu.getBoundingClientRect(); + const eRect = entry.getBoundingClientRect(); + const cHeight = doc$1.clientHeight; + const cWidth = doc$1.clientWidth; + const [top, bottom] = Array.from((eRect.top + sRect.height) < cHeight ? + ['0px', 'auto'] + : + ['auto', '0px']); + const [left, right] = Array.from((eRect.right + sRect.width) < (cWidth - 150) ? + ['100%', 'auto'] + : + ['auto', '100%']); + const {style} = submenu; + style.top = top; + style.bottom = bottom; + style.left = left; + return style.right = right; + } + + addEntry(entry) { + this.parseEntry(entry); + return this.entries.push(entry); + } + + parseEntry(entry) { + const {el, subEntries} = entry; + $$1.addClass(el, 'entry'); + $$1.on(el, 'focus mouseover', this.onFocus); + el.style.order = entry.order || 100; + if (!subEntries) { return; } + $$1.addClass(el, 'has-submenu'); + for (var subEntry of subEntries) { + this.parseEntry(subEntry); + } + } + }; + Menu$1.initClass(); + return Menu$1; + })(); + + var dragstart = function (e) { + let isTouching; + if ((e.type === 'mousedown') && (e.button !== 0)) { return; } // not LMB + // prevent text selection + e.preventDefault(); + if (isTouching = e.type === 'touchstart') { + e = e.changedTouches[e.changedTouches.length - 1]; + } + // distance from pointer to el edge is constant; calculate it here. + const el = $$1.x('ancestor::div[contains(@class,"dialog")][1]', this); + const rect = el.getBoundingClientRect(); + const screenHeight = doc$1.clientHeight; + const screenWidth = doc$1.clientWidth; + const o = { + id: el.id, + style: el.style, + dx: e.clientX - rect.left, + dy: e.clientY - rect.top, + height: screenHeight - rect.height, + width: screenWidth - rect.width, + screenHeight, + screenWidth, + isTouching + }; + + [o.topBorder, o.bottomBorder] = Array.from(Conf['Header auto-hide'] || !Conf['Fixed Header'] ? + [0, 0] + : Conf['Bottom Header'] ? + [0, Header$1.bar.getBoundingClientRect().height] + : + [Header$1.bar.getBoundingClientRect().height, 0]); + + if (isTouching) { + o.identifier = e.identifier; + o.move = touchmove.bind(o); + o.up = touchend.bind(o); + $$1.on(d$1, 'touchmove', o.move); + return $$1.on(d$1, 'touchend touchcancel', o.up); + } else { // mousedown + o.move = drag.bind(o); + o.up = dragend.bind(o); + $$1.on(d$1, 'mousemove', o.move); + return $$1.on(d$1, 'mouseup', o.up); + } + }; + + var touchmove = function (e) { + for (var touch of e.changedTouches) { + if (touch.identifier === this.identifier) { + drag.call(this, touch); + return; + } + } + }; + + var drag = function (e) { + const {clientX, clientY} = e; + + let left = clientX - this.dx; + left = left < 10 ? + 0 + : (this.width - left) < 10 ? + '' + : + ((left / this.screenWidth) * 100) + '%'; + + let top = clientY - this.dy; + top = top < (10 + this.topBorder) ? + this.topBorder + 'px' + : (this.height - top) < (10 + this.bottomBorder) ? + '' + : + ((top / this.screenHeight) * 100) + '%'; + + const right = left === '' ? + 0 + : + ''; + + const bottom = top === '' ? + this.bottomBorder + 'px' + : + ''; + + const {style} = this; + style.left = left; + style.right = right; + style.top = top; + return style.bottom = bottom; + }; + + var touchend = function (e) { + for (var touch of e.changedTouches) { + if (touch.identifier === this.identifier) { + dragend.call(this); + return; + } + } + }; + + var dragend = function () { + if (this.isTouching) { + $$1.off(d$1, 'touchmove', this.move); + $$1.off(d$1, 'touchend touchcancel', this.up); + } else { // mouseup + $$1.off(d$1, 'mousemove', this.move); + $$1.off(d$1, 'mouseup', this.up); + } + return $$1.set(`${this.id}.position`, this.style.cssText); + }; + + const hoverstart = function ({ root, el, latestEvent, endEvents, height, width, cb, noRemove }) { + const rect = root.getBoundingClientRect(); + const o = { + root, + el, + style: el.style, + isImage: ['IMG', 'VIDEO'].includes(el.nodeName), + cb, + endEvents, + latestEvent, + clientHeight: doc$1.clientHeight, + clientWidth: doc$1.clientWidth, + height, + width, + noRemove, + clientX: (rect.left + rect.right) / 2, + clientY: (rect.top + rect.bottom) / 2 + }; + o.hover = hover.bind(o); + o.hoverend = hoverend.bind(o); + + o.hover(o.latestEvent); + new MutationObserver(function() { + if (el.parentNode) { return o.hover(o.latestEvent); } + }).observe(el, {childList: true}); + + $$1.on(root, endEvents, o.hoverend); + if ($$1.x('ancestor::div[contains(@class,"inline")][1]', root)) { + $$1.on(d$1, 'keydown', o.hoverend); + } + $$1.on(root, 'mousemove', o.hover); + + // Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=674955 + o.workaround = function(e) { if (!root.contains(e.target)) { return o.hoverend(e); } }; + return $$1.on(doc$1, 'mousemove', o.workaround); + }; + + hoverstart.padding = 25; + + var hover = function (e) { + this.latestEvent = e; + const height = (this.height || this.el.offsetHeight) + hoverstart.padding; + const width = (this.width || this.el.offsetWidth); + const {clientX, clientY} = Conf['Follow Cursor'] ? e : this; + + const top = this.isImage ? + Math.max(0, (clientY * (this.clientHeight - height)) / this.clientHeight) + : + Math.max(0, Math.min(this.clientHeight - height, clientY - 120)); + + let threshold = this.clientWidth / 2; + if (!this.isImage) { threshold = Math.max(threshold, this.clientWidth - 400); } + let marginX = (clientX <= threshold ? clientX : this.clientWidth - clientX) + 45; + if (this.isImage) { marginX = Math.min(marginX, this.clientWidth - width); } + marginX += 'px'; + const [left, right] = Array.from(clientX <= threshold ? [marginX, ''] : ['', marginX]); + + const {style} = this; + style.top = top + 'px'; + style.left = left; + return style.right = right; + }; + + var hoverend = function (e) { + if (((e.type === 'keydown') && (e.keyCode !== 13)) || (e.target.nodeName === "TEXTAREA")) { return; } + if (!this.noRemove) { $$1.rm(this.el); } + $$1.off(this.root, this.endEvents, this.hoverend); + $$1.off(d$1, 'keydown', this.hoverend); + $$1.off(this.root, 'mousemove', this.hover); + // Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=674955 + $$1.off(doc$1, 'mousemove', this.workaround); + if (this.cb) { return this.cb.call(this); } + }; + + const checkbox = function (name, text, checked) { + if (checked == null) { checked = Conf[name]; } + const label = $$1.el('label'); + const input = $$1.el('input', {type: 'checkbox', name, checked}); + $$1.add(label, [input, $$1.tn(` ${text}`)]); + return label; + }; + + const UI = { + dialog, + Menu: Menu$1, + hover: hoverstart, + checkbox + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var Nav = { + init() { + switch (g.VIEW) { + case 'index': + if (!Conf['Index Navigation']) { return; } + break; + case 'thread': + if (!Conf['Reply Navigation']) { return; } + break; + default: + return; + } + + const span = $$1.el('span', + {id: 'navlinks'}); + const prev = $$1.el('a', { + textContent: '▲', + href: 'javascript:;' + } + ); + const next = $$1.el('a', { + textContent: '▼', + href: 'javascript:;' + } + ); + + $$1.on(prev, 'click', this.prev); + $$1.on(next, 'click', this.next); + + $$1.add(span, [prev, $$1.tn(' '), next]); + var append = function() { + $$1.off(d$1, '4chanXInitFinished', append); + return $$1.add(d$1.body, span); + }; + return $$1.on(d$1, '4chanXInitFinished', append); + }, + + prev() { + if (g.VIEW === 'thread') { + return window.scrollTo(0, 0); + } else { + return Nav.scroll(-1); + } + }, + + next() { + if (g.VIEW === 'thread') { + return window.scrollTo(0, d$1.body.scrollHeight); + } else { + return Nav.scroll(+1); + } + }, + + getThread() { + if (g.VIEW === 'thread') { return g.threads.get(`${g.BOARD}.${g.THREADID}`).nodes.root; } + if ($$1.hasClass(doc$1, 'catalog-mode')) { return; } + for (var threadRoot of $$(g.SITE.selectors.thread)) { + var thread = Get$1.threadFromRoot(threadRoot); + if (thread.isHidden && !thread.stub) { continue; } + if (Header$1.getTopOf(threadRoot) >= -threadRoot.getBoundingClientRect().height) { // not scrolled past + return threadRoot; + } + } + }, + + scroll(delta) { + let next; + d$1.activeElement?.blur(); + let thread = Nav.getThread(); + if (!thread) { return; } + const axis = delta === +1 ? + 'following' + : + 'preceding'; + if (next = $$1.x(`${axis}-sibling::${g.SITE.xpath.thread}[not(@hidden)][1]`, thread)) { + // Unless we're not at the beginning of the current thread, + // and thus wanting to move to beginning, + // or we're above the first thread and don't want to skip it. + const top = Header$1.getTopOf(thread); + if (((delta === +1) && (top < 5)) || ((delta === -1) && (top > -5))) { thread = next; } + } + // Add extra space to the end of the page if necessary so that all threads can be selected by keybinds. + const extra = (Header$1.getTopOf(thread) + doc$1.clientHeight) - d$1.body.getBoundingClientRect().bottom; + if (extra > 0) { d$1.body.style.marginBottom = `${extra}px`; } + + Header$1.scrollTo(thread); + + if ((extra > 0) && !Nav.haveExtra) { + Nav.haveExtra = true; + return $$1.on(d$1, 'scroll', Nav.removeExtra); + } + }, + + removeExtra() { + const extra = doc$1.clientHeight - d$1.body.getBoundingClientRect().bottom; + if (extra > 0) { + return d$1.body.style.marginBottom = `${extra}px`; + } else { + d$1.body.style.marginBottom = ''; + delete Nav.haveExtra; + return $$1.off(d$1, 'scroll', Nav.removeExtra); + } + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var ImageHost = { + init() { + if ((!(this.useFaster = /\S/.test(Conf['fourchanImageHost']))) || (g.SITE.software !== 'yotsuba') || !['index', 'thread'].includes(g.VIEW)) { return; } + return Callbacks.Post.push({ + name: 'Image Host Rewriting', + cb: this.node + }); + }, + + suggestions: ['i.4cdn.org', 'is2.4chan.org'], + + host() { + return Conf['fourchanImageHost'].trim() || 'i.4cdn.org'; + }, + flashHost() { + return 'i.4cdn.org'; + }, + thumbHost() { + return 'i.4cdn.org'; + }, + test(hostname) { + return (hostname === 'i.4cdn.org') || ImageHost.regex.test(hostname); + }, + + regex: /^is\d*\.4chan(?:nel)?\.org$/, + + node() { + if (this.isClone) { return; } + const host = ImageHost.host(); + if (this.file && ImageHost.test(this.file.url.split('/')[2]) && !/\.swf$/.test(this.file.url)) { + this.file.link.hostname = host; + if (this.file.thumbLink) { this.file.thumbLink.hostname = host; } + this.file.url = this.file.link.href; + } + return ImageHost.fixLinks($$('a', this.nodes.comment)); + }, + + fixLinks(links) { + for (var link of links) { + if (ImageHost.test(link.hostname) && !/\.swf$/.test(link.pathname)) { + var host = ImageHost.host(); + if (link.hostname !== host) { link.hostname = host; } + } + } + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var Volume = { + init() { + if (!['index', 'thread'].includes(g.VIEW) || + (!Conf['Image Expansion'] && !Conf['Image Hover'] && !Conf['Image Hover in Catalog'] && !Conf['Gallery'])) { return; } + + $$1.sync('Allow Sound', function(x) { + Conf['Allow Sound'] = x; + if (Volume.inputs) Volume.inputs.unmute.checked = x; + }); + + $$1.sync('Default Volume', function(x) { + Conf['Default Volume'] = x; + if (Volume.inputs) Volume.inputs.volume.value = x; + }); + + if (Conf['Mouse Wheel Volume']) { + Callbacks.Post.push({ + name: 'Mouse Wheel Volume', + cb: this.node + }); + } + + if (g.SITE.noAudio?.(g.BOARD)) { return; } + + if (Conf['Mouse Wheel Volume']) { + Callbacks.CatalogThread.push({ + name: 'Mouse Wheel Volume', + cb: this.catalogNode + }); + } + + const unmuteEntry = UI.checkbox('Allow Sound', 'Allow Sound'); + unmuteEntry.title = Config.main['Images and Videos']['Allow Sound'][1]; + + const volumeEntry = $$1.el('label', + {title: 'Default volume for videos.'}); + $$1.extend(volumeEntry, + {innerHTML: " Volume"}); + + this.inputs = { + unmute: unmuteEntry.firstElementChild, + volume: volumeEntry.firstElementChild + }; + + $$1.on(this.inputs.unmute, 'change', $$1.cb.checked); + $$1.on(this.inputs.volume, 'change', $$1.cb.value); + + Header$1.menu.addEntry({el: unmuteEntry, order: 200}); + return Header$1.menu.addEntry({el: volumeEntry, order: 201}); + }, + + setup(video) { + video.muted = !Conf['Allow Sound']; + video.volume = Conf['Default Volume']; + return $$1.on(video, 'volumechange', Volume.change); + }, + + change() { + const {muted, volume} = this; + const items = { + 'Allow Sound': !muted, + 'Default Volume': volume + }; + for (var key in items) { + var val = items[key]; + if (Conf[key] === val) { + delete items[key]; + } + } + $$1.set(items); + $$1.extend(Conf, items); + if (Volume.inputs) { + Volume.inputs.unmute.checked = !muted; + return Volume.inputs.volume.value = volume; + } + }, + + node() { + if (g.SITE.noAudio?.(this.board)) { return; } + for (var file of this.files) { + if (file.isVideo) { + if (file.thumb) { $$1.on(file.thumb, 'wheel', Volume.wheel.bind(Header$1.hover)); } + $$1.on(($$1('.file-info', file.text) || file.link), 'wheel', Volume.wheel.bind(file.thumbLink)); + } + } + }, + + catalogNode() { + const file = this.thread.OP.files[0]; + if (!file?.isVideo) { return; } + return $$1.on(this.nodes.thumb, 'wheel', Volume.wheel.bind(Header$1.hover)); + }, + + wheel(e) { + let el; + if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) { return; } + if (!(el = $$1('video:not([data-md5])', this))) { return; } + if (el.muted || !$$1.hasAudio(el)) { return; } + let volume = el.volume + 0.1; + if (e.deltaY < 0) { volume *= 1.1; } + if (e.deltaY > 0) { volume /= 1.1; } + el.volume = $$1.minmax(volume - 0.1, 0, 1); + return e.preventDefault(); + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS104: Avoid inline assignments + * DS204: Change includes calls to have a more natural evaluation order + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var ImageCommon = { + // Pause and mute video in preparation for removing the element from the document. + pause(video) { + if (video.nodeName !== 'VIDEO') { return; } + video.pause(); + $$1.off(video, 'volumechange', Volume.change); + return video.muted = true; + }, + + rewind(el) { + if (el.nodeName === 'VIDEO') { + if (el.readyState >= el.HAVE_METADATA) { return el.currentTime = 0; } + } else if (/\.gif$/.test(el.src)) { + return $$1.queueTask(() => el.src = el.src); + } + }, + + pushCache(el) { + ImageCommon.cache = el; + return $$1.on(el, 'error', ImageCommon.cacheError); + }, + + popCache() { + const el = ImageCommon.cache; + $$1.off(el, 'error', ImageCommon.cacheError); + delete ImageCommon.cache; + return el; + }, + + cacheError() { + if (ImageCommon.cache === this) { return delete ImageCommon.cache; } + }, + + decodeError(file, fileObj) { + let message; + if (file.error?.code !== MediaError.MEDIA_ERR_DECODE) { return false; } + if (!(message = $$1('.warning', fileObj.thumb.parentNode))) { + message = $$1.el('div', {className: 'warning'}); + $$1.after(fileObj.thumb, message); + } + message.textContent = 'Error: Corrupt or unplayable video'; + return true; + }, + + isFromArchive(file) { + return (g.SITE.software === 'yotsuba') && !ImageHost.test(file.src.split('/')[2]); + }, + + error(file, post, fileObj, delay, cb) { + let timeoutID; + const src = fileObj.url.split('/'); + let url = null; + if ((g.SITE.software === 'yotsuba') && Conf['404 Redirect']) { + url = Redirect$1.to('file', { + boardID: post.board.ID, + filename: src[src.length - 1] + }); + } + if (!url || !Redirect$1.securityCheck(url)) { url = null; } + + if ((post.isDead || fileObj.isDead) && !ImageCommon.isFromArchive(file)) { return cb(url); } + + if (delay != null) { timeoutID = setTimeout((() => cb(url)), delay); } + if (post.isDead || fileObj.isDead) { return; } + const redirect = function() { + if (!ImageCommon.isFromArchive(file)) { + if (delay != null) { clearTimeout(timeoutID); } + return cb(url); + } + }; + + const threadJSON = g.SITE.urls.threadJSON?.(post); + if (!threadJSON) { return; } + var parseJSON = function(isArchiveURL) { + let needle, postObj; + if (this.status === 404) { + let archivedThreadJSON; + if (!isArchiveURL && (archivedThreadJSON = g.SITE.urls.archivedThreadJSON?.(post))) { + $$1.ajax(archivedThreadJSON, {onloadend() { return parseJSON.call(this, true); }}); + } else { + post.kill(!post.isClone, fileObj.index); + } + } + if (this.status !== 200) { return redirect(); } + for (postObj of this.response.posts) { + if (postObj.no === post.ID) { break; } + } + if (postObj.no !== post.ID) { + post.kill(); + return redirect(); + } else if ((needle = fileObj.docIndex, g.SITE.Build.parseJSON(postObj, post.board).filesDeleted.includes(needle))) { + post.kill(true); + return redirect(); + } else { + return url = fileObj.url; + } + }; + return $$1.ajax(threadJSON, {onloadend() { return parseJSON.call(this); }}); + }, + + // Add controls, but not until the mouse is moved over the video. + addControls(video) { + var handler = function() { + $$1.off(video, 'mouseover', handler); + // Hacky workaround for Firefox forever-loading bug for very short videos + const t = new Date().getTime(); + return $$1.asap((() => ($$1.engine !== 'gecko') || ((video.readyState >= 3) && (video.currentTime <= Math.max(0.1, (video.duration - 0.5)))) || (new Date().getTime() >= (t + 1000))), () => video.controls = true); + }; + return $$1.on(video, 'mouseover', handler); + }, + + // XXX Estimate whether clicks are on the video controls and should be ignored. + onControls(e) { + return (Conf['Show Controls'] && Conf['Click Passthrough'] && (e.target.nodeName === 'VIDEO')) || + (e.target.controls && ((e.target.getBoundingClientRect().bottom - e.clientY) < 35)); + }, + + download(e) { + if (this.protocol === 'blob:') { return true; } + e.preventDefault(); + const {href, download} = this; + return CrossOrigin$1.file(href, function(blob) { + if (blob) { + const a = $$1.el('a', { + href: URL.createObjectURL(blob), + download, + hidden: true + } + ); + $$1.add(d$1.body, a); + a.click(); + return $$1.rm(a); + } else { + return new Notice('warning', `Could not download ${href}`, 20); + } + }); + } + }; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var ImageExpand = { + init() { + if (!(this.enabled = Conf['Image Expansion'] && ['index', 'thread'].includes(g.VIEW))) { return; } + + this.EAI = $$1.el('a', { + className: 'expand-all-shortcut', + textContent: '➕︎', + title: 'Expand All Images', + href: 'javascript:;' + } + ); + + $$1.on(this.EAI, 'click', this.cb.toggleAll); + Header$1.addShortcut('expand-all', this.EAI, 520); + $$1.on(d$1, 'scroll visibilitychange', this.cb.playVideos); + this.videoControls = $$1.el('span', {className: 'video-controls'}); + $$1.extend(this.videoControls, {innerHTML: " contract"}); + + return Callbacks.Post.push({ + name: 'Image Expansion', + cb: this.node + }); + }, + + node() { + if (!this.file || (!this.file.isImage && !this.file.isVideo)) { return; } + $$1.on(this.file.thumbLink, 'click', ImageExpand.cb.toggle); + + if (this.isClone) { + if (this.file.isExpanding) { + // If we clone a post where the image is still loading, + // make it loading in the clone too. + ImageExpand.contract(this); + return ImageExpand.expand(this); + + } else if (this.file.isExpanded && this.file.isVideo) { + Volume.setup(this.file.fullImage); + ImageExpand.setupVideoCB(this); + return ImageExpand.setupVideo(this, !this.origin.file.fullImage?.paused || this.origin.file.wasPlaying, this.file.fullImage.controls); + } + + } else if (ImageExpand.on && !this.isHidden && !this.isFetchedQuote && + (Conf['Expand spoilers'] || !this.file.isSpoiler) && + (Conf['Expand videos'] || !this.file.isVideo)) { + return ImageExpand.expand(this); + } + }, + + cb: { + toggle(e) { + if ($$1.modifiedClick(e)) { return; } + const post = Get$1.postFromNode(this); + const {file} = post; + if (file.isExpanded && ImageCommon.onControls(e)) { return; } + e.preventDefault(); + if (!Conf['Autoplay'] && file.fullImage?.paused) { + return file.fullImage.play(); + } else { + return ImageExpand.toggle(post); + } + }, + + toggleAll() { + let func; + $$1.event('CloseMenu'); + const threadRoot = Nav.getThread(); + const toggle = function(post) { + const {file} = post; + if (!file || (!file.isImage && !file.isVideo) || !doc$1.contains(post.nodes.root)) { return; } + if (ImageExpand.on && + ((!Conf['Expand spoilers'] && file.isSpoiler) || + (!Conf['Expand videos'] && file.isVideo) || + (Conf['Expand from here'] && (Header$1.getTopOf(file.thumb) < 0)) || + (Conf['Expand thread only'] && (g.VIEW === 'index') && !threadRoot?.contains(file.thumb)))) { + return; + } + return $$1.queueTask(func, post); + }; + + if (ImageExpand.on = $$1.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) { + ImageExpand.EAI.className = 'contract-all-shortcut'; + ImageExpand.EAI.title = 'Contract All Images'; + ImageExpand.EAI.textContent = '➖︎'; + func = ImageExpand.expand; + } else { + ImageExpand.EAI.className = 'expand-all-shortcut'; + ImageExpand.EAI.title = 'Expand All Images'; + ImageExpand.EAI.textContent = '➕︎'; + func = ImageExpand.contract; + } + + return g.posts.forEach(function(post) { + for (post of [post, ...Array.from(post.clones)]) { toggle(post); } + }); + }, + + playVideos() { + return g.posts.forEach(function(post) { + for (post of [post, ...Array.from(post.clones)]) { + var {file} = post; + if (!file || !file.isVideo || !file.isExpanded) { continue; } + + var video = file.fullImage; + var visible = ($$1.hasAudio(video) && !video.muted) || Header$1.isNodeVisible(video); + if (visible && file.wasPlaying) { + delete file.wasPlaying; + video.play(); + } else if (!visible && !video.paused) { + file.wasPlaying = true; + video.pause(); + } + } + }); + }, + + setFitness() { + return $$1[this.checked ? 'addClass' : 'rmClass'](doc$1, this.name.toLowerCase().replace(/\s+/g, '-')); + } + }, + + toggle(post) { + if (!post.file.isExpanding && !post.file.isExpanded) { + post.file.scrollIntoView = Conf['Scroll into view']; + ImageExpand.expand(post); + return; + } + + ImageExpand.contract(post); + + if (Conf['Advance on contract']) { + let next = post.nodes.root; + while ((next = $$1.x("following::div[contains(@class,'postContainer')][1]", next))) { + if (!$$1('.stub', next) && (next.offsetHeight !== 0)) { break; } + } + if (next) { + return Header$1.scrollTo(next); + } + } + }, + + contract(post) { + let bottom, el, oldHeight, scrollY; + const {file} = post; + + if (el = file.fullImage) { + const top = Header$1.getTopOf(el); + bottom = top + el.getBoundingClientRect().height; + oldHeight = d$1.body.clientHeight; + ({scrollY} = window); + } + + $$1.rmClass(post.nodes.root, 'expanded-image'); + $$1.rmClass(file.thumb, 'expanding'); + $$1.rm(file.videoControls); + file.thumbLink.href = file.url; + file.thumbLink.target = '_blank'; + for (var x of ['isExpanding', 'isExpanded', 'videoControls', 'wasPlaying', 'scrollIntoView']) { + delete file[x]; + } + + if (!el) { return; } + + if (doc$1.contains(el)) { + if (bottom <= 0) { + // For images entirely above us, scroll to remain in place. + window.scrollBy(0, ((scrollY - window.scrollY) + d$1.body.clientHeight) - oldHeight); + } else { + // For images not above us that would be moved above us, scroll to the thumbnail. + Header$1.scrollToIfNeeded(post.nodes.root); + } + if (window.scrollX > 0) { + // If we have scrolled right viewing an expanded image, return to the left. + window.scrollBy(-window.scrollX, 0); + } + } + + $$1.off(el, 'error', ImageExpand.error); + ImageCommon.pushCache(el); + if (file.isVideo) { + ImageCommon.pause(el); + for (var eventName in ImageExpand.videoCB) { + var cb = ImageExpand.videoCB[eventName]; + $$1.off(el, eventName, cb); + } + } + if (Conf['Restart when Opened']) { ImageCommon.rewind(file.thumb); } + delete file.fullImage; + return $$1.queueTask(function() { + // XXX Work around Chrome/Chromium not firing mouseover on the thumbnail. + if (file.isExpanding || file.isExpanded) { return; } + $$1.rmClass(el, 'full-image'); + if (el.id) { return; } + return $$1.rm(el); + }); + }, + + expand(post, src) { + // Do not expand images of hidden/filtered replies, or already expanded pictures. + let el; + const {file} = post; + const {thumb, thumbLink, isVideo} = file; + if (post.isHidden || file.isExpanding || file.isExpanded) { return; } + + $$1.addClass(thumb, 'expanding'); + file.isExpanding = true; + + if (file.fullImage) { + el = file.fullImage; + } else if (ImageCommon.cache?.dataset.fileID === `${post.fullID}.${file.index}`) { + el = (file.fullImage = ImageCommon.popCache()); + $$1.on(el, 'error', ImageExpand.error); + if (Conf['Restart when Opened'] && (el.id !== 'ihover')) { ImageCommon.rewind(el); } + el.removeAttribute('id'); + } else { + el = (file.fullImage = $$1.el((isVideo ? 'video' : 'img'))); + el.dataset.fileID = `${post.fullID}.${file.index}`; + $$1.on(el, 'error', ImageExpand.error); + el.src = src || file.url; + } + + el.className = 'full-image'; + $$1.after(thumb, el); + + if (isVideo) { + // add contract link to file info + if (!file.videoControls) { + file.videoControls = ImageExpand.videoControls.cloneNode(true); + $$1.add(file.text, file.videoControls); + } + + // disable link to file so native controls can work + thumbLink.removeAttribute('href'); + thumbLink.removeAttribute('target'); + + el.loop = true; + Volume.setup(el); + ImageExpand.setupVideoCB(post); + } + + if (!isVideo) { + return $$1.asap((() => el.naturalHeight), () => ImageExpand.completeExpand(post)); + } else if (el.readyState >= el.HAVE_METADATA) { + return ImageExpand.completeExpand(post); + } else { + return $$1.on(el, 'loadedmetadata', () => ImageExpand.completeExpand(post)); + } + }, + + completeExpand(post) { + const {file} = post; + if (!file.isExpanding) { return; } // contracted before the image loaded + + const bottom = Header$1.getTopOf(file.thumb) + file.thumb.getBoundingClientRect().height; + const oldHeight = d$1.body.clientHeight; + const {scrollY} = window; + + $$1.addClass(post.nodes.root, 'expanded-image'); + $$1.rmClass(file.thumb, 'expanding'); + file.isExpanded = true; + delete file.isExpanding; + + // Scroll to keep our place in the thread when images are expanded above us. + if (doc$1.contains(post.nodes.root) && (bottom <= 0)) { + window.scrollBy(0, ((scrollY - window.scrollY) + d$1.body.clientHeight) - oldHeight); + } + + // Scroll to display full image. + if (file.scrollIntoView) { + delete file.scrollIntoView; + const imageBottom = Math.min(doc$1.clientHeight - file.fullImage.getBoundingClientRect().bottom - 25, Header$1.getBottomOf(file.fullImage)); + if (imageBottom < 0) { + window.scrollBy(0, Math.min(-imageBottom, Header$1.getTopOf(file.fullImage))); + } + } + + if (file.isVideo) { + return ImageExpand.setupVideo(post, Conf['Autoplay'], Conf['Show Controls']); + } + }, + + setupVideo(post, playing, controls) { + const {fullImage} = post.file; + if (!playing) { + fullImage.controls = controls; + return; + } + fullImage.controls = false; + $$1.asap((() => doc$1.contains(fullImage)), function() { + if (!d$1.hidden && Header$1.isNodeVisible(fullImage)) { + return fullImage.play(); + } else { + return post.file.wasPlaying = true; + } + }); + if (controls) { + return ImageCommon.addControls(fullImage); + } + }, + + videoCB: (function() { + // dragging to the left contracts the video + let mousedown = false; + return { + mouseover() { return mousedown = false; }, + mousedown(e) { if (e.button === 0) { return mousedown = true; } }, + mouseup(e) { if (e.button === 0) { return mousedown = false; } }, + mouseout(e) { if (((e.buttons & 1) || mousedown) && (e.clientX <= this.getBoundingClientRect().left)) { return ImageExpand.toggle(Get$1.postFromNode(this)); } } + }; + })(), + + setupVideoCB(post) { + for (var eventName in ImageExpand.videoCB) { + var cb = ImageExpand.videoCB[eventName]; + $$1.on(post.file.fullImage, eventName, cb); + } + if (post.file.videoControls) { + return $$1.on(post.file.videoControls.firstElementChild, 'click', () => ImageExpand.toggle(post)); + } + }, + + error() { + const post = Get$1.postFromNode(this); + $$1.rm(this); + delete post.file.fullImage; + // Images can error: + // - before the image started loading. + // - after the image started loading. + // Don't try to re-expand if it was already contracted. + if (!post.file.isExpanding && !post.file.isExpanded) { return; } + if (ImageCommon.decodeError(this, post.file)) { + return ImageExpand.contract(post); + } + // Don't autoretry images from the archive. + if (ImageCommon.isFromArchive(this)) { + return ImageExpand.contract(post); + } + return ImageCommon.error(this, post, post.file, 10 * SECOND, function(URL) { + if (post.file.isExpanding || post.file.isExpanded) { + ImageExpand.contract(post); + if (URL) { return ImageExpand.expand(post, URL); } + } + }); + }, + + menu: { + init() { + if (!ImageExpand.enabled) { return; } + + const el = $$1.el('span', { + textContent: 'Image Expansion', + className: 'image-expansion-link' + } + ); + + const {createSubEntry} = ImageExpand.menu; + const subEntries = []; + for (var name in Config.imageExpansion) { + var conf = Config.imageExpansion[name]; + subEntries.push(createSubEntry(name, conf[1])); + } + + return Header$1.menu.addEntry({ + el, + order: 105, + subEntries + }); + }, + + createSubEntry(name, desc) { + const label = UI.checkbox(name, name); + label.title = desc; + const input = label.firstElementChild; + if (['Fit width', 'Fit height'].includes(name)) { + $$1.on(input, 'change', ImageExpand.cb.setFitness); + } + $$1.event('change', null, input); + $$1.on(input, 'change', $$1.cb.checked); + return {el: label}; + } + } + }; + + class Post { + toString() { return this.ID; } + constructor(root, thread, board, flags = {}) { + // <% if (readJSON('/.tests_enabled')) { %> + // @normalizedOriginal = Test.normalize root + // <% } %> + // Skip initialization for PostClone + if (root === undefined && thread === undefined && board === undefined) + return; + this.root = root; + this.thread = thread; + this.board = board; + $$1.extend(this, flags); + this.ID = +root.id.match(/\d*$/)[0]; + this.postID = this.ID; + this.threadID = this.thread.ID; + this.boardID = this.board.ID; + this.siteID = g.SITE.ID; + this.fullID = `${this.board}.${this.ID}`; + this.context = this; + this.isReply = (this.ID !== this.threadID); + root.dataset.fullID = this.fullID; + this.nodes = this.parseNodes(root); + if (!this.isReply) { + this.thread.OP = this; + for (var key of ['isSticky', 'isClosed', 'isArchived']) { + var selector; + if (selector = g.SITE.selectors.icons[key]) { + this.thread[key] = !!$$1(selector, this.nodes.info); + } + } + if (this.thread.isArchived) { + this.thread.isClosed = true; + this.thread.kill(); + } + } + const name = this.nodes.name?.textContent; + const tripcode = this.nodes.tripcode?.textContent; + this.info = { + subject: this.nodes.subject?.textContent || undefined, + name, + email: this.nodes.email ? decodeURIComponent(this.nodes.email.href.replace(/^mailto:/, '')) : undefined, + tripcode, + uniqueID: this.nodes.uniqueID?.textContent, + capcode: this.nodes.capcode?.textContent.replace('## ', ''), + pass: this.nodes.pass?.title.match(/\d*$/)[0], + flagCode: this.nodes.flag?.className.match(/flag-(\w+)/)?.[1].toUpperCase(), + flagCodeTroll: this.nodes.flag?.className.match(/bfl-(\w+)/)?.[1].toUpperCase(), + flag: this.nodes.flag?.title, + date: this.nodes.date ? g.SITE.parseDate(this.nodes.date) : undefined, + nameBlock: Conf['Anonymize'] ? 'Anonymous' : `${name || ''} ${tripcode || ''}`.trim(), + }; + if (this.info.capcode) { + this.info.nameBlock += ` ## ${this.info.capcode}`; + } + if (this.info.uniqueID) { + this.info.nameBlock += ` (ID: ${this.info.uniqueID})`; + } + this.parseComment(); + this.parseQuotes(); + this.parseFiles(); + this.isDead = false; + this.isHidden = false; + this.clones = []; + // <% if (readJSON('/.tests_enabled')) { %> + // return if @forBuildTest + // <% } %> + if (g.posts.get(this.fullID)) { + this.isRebuilt = true; + this.clones = g.posts.get(this.fullID).clones; + for (var clone of this.clones) { + clone.origin = this; + } + } + if (!this.isFetchedQuote && (this.ID > this.thread.lastPost)) { + this.thread.lastPost = this.ID; + } + this.board.posts.push(this.ID, this); + this.thread.posts.push(this.ID, this); + g.posts.push(this.fullID, this); + this.isFetchedQuote = false; + this.isClone = false; + } + parseNodes(root) { + const s = g.SITE.selectors; + const post = $$1(s.post, root) || root; + const info = $$1(s.infoRoot, post); + const nodes = { + root, + bottom: this.isReply || !g.SITE.isOPContainerThread ? root : $$1(s.opBottom, root), + post, + info, + comment: $$1(s.comment, post), + quotelinks: [], + archivelinks: [], + embedlinks: [], + backlinks: post.getElementsByClassName('backlink'), + uniqueIDRoot: undefined, + uniqueID: undefined, + }; + for (var key in s.info) { + var selector = s.info[key]; + nodes[key] = $$1(selector, info); + } + g.SITE.parseNodes?.(this, nodes); + if (!nodes.uniqueIDRoot) { + nodes.uniqueIDRoot = nodes.uniqueID; + } + return nodes; + } + parseComment() { + // Merge text nodes and remove empty ones. + let bq; + this.nodes.comment.normalize(); + // Get the comment's text. + //
        -> \n + // Remove: + // 'Comment too long'... + // EXIF data. (/p/) + this.nodes.commentClean = (bq = this.nodes.comment.cloneNode(true)); + g.SITE.cleanComment?.(bq); + return this.info.comment = this.nodesToText(bq); + } + commentDisplay() { + // Get the comment's text for display purposes (e.g. notifications, excerpts). + // In addition to what's done in generating `@info.comment`, remove: + // Spoilers. (filter to '[spoiler]') + // Rolls. (/tg/, /qst/) + // Fortunes. (/s4s/) + // Preceding and following new lines. + // Trailing spaces. + const bq = this.nodes.commentClean.cloneNode(true); + if (!Conf['Remove Spoilers'] && !Conf['Reveal Spoilers']) { + this.cleanSpoilers(bq); + } + g.SITE.cleanCommentDisplay?.(bq); + return this.nodesToText(bq).trim().replace(/\s+$/gm, ''); + } + commentOrig() { + // Get the comment's text for reposting purposes. + const bq = this.nodes.commentClean.cloneNode(true); + g.SITE.insertTags?.(bq); + return this.nodesToText(bq); + } + nodesToText(bq) { + let node; + let text = ""; + const nodes = $$1.X('.//br|.//text()', bq); + let i = 0; + while ((node = nodes.snapshotItem(i++))) { + text += node.data || '\n'; + } + return text; + } + cleanSpoilers(bq) { + const spoilers = $$(g.SITE.selectors.spoiler, bq); + for (var node of spoilers) { + $$1.replace(node, $$1.tn('[spoiler]')); + } + } + parseQuotes() { + this.quotes = []; + for (var quotelink of $$(g.SITE.selectors.quotelink, this.nodes.comment)) { + this.parseQuote(quotelink); + } + } + parseQuote(quotelink) { + // Only add quotes that link to posts on an imageboard. + // Don't add: + // - board links. (>>>/b/) + // - catalog links. (>>>/b/catalog or >>>/b/search) + // - rules links. (>>>/a/rules) + // - text-board quotelinks. (>>>/img/1234) + const match = quotelink.href.match(g.SITE.regexp.quotelink); + if (!match && (!this.isClone || !quotelink.dataset.postID)) { + return; + } // normal or resurrected quote + this.nodes.quotelinks.push(quotelink); + if (this.isClone) { + return; + } + // ES6 Set when? + const fullID = `${match[1]}.${match[3]}`; + if (!this.quotes.includes(fullID)) + this.quotes.push(fullID); + } + parseFiles() { + let file; + this.files = []; + const fileRoots = this.fileRoots(); + let index = 0; + for (let docIndex = 0; docIndex < fileRoots.length; docIndex++) { + var fileRoot = fileRoots[docIndex]; + if (file = this.parseFile(fileRoot)) { + file.index = (index++); + file.docIndex = docIndex; + this.files.push(file); + } + } + if (this.files.length) { + return this.file = this.files[0]; + } + } + fileRoots() { + if (g.SITE.selectors.multifile) { + const roots = $$(g.SITE.selectors.multifile, this.nodes.root); + if (roots.length) { + return roots; + } + } + return [this.nodes.root]; + } + parseFile(fileRoot) { + const file = { isDead: false }; + for (var key in g.SITE.selectors.file) { + var selector = g.SITE.selectors.file[key]; + file[key] = $$1(selector, fileRoot); + } + file.thumbLink = file.thumb?.parentNode; + if (!(file.text && file.link)) { + return; + } + if (!g.SITE.parseFile(this, file)) { + return; + } + $$1.extend(file, { + url: file.link.href, + isImage: $$1.isImage(file.link.href), + isVideo: $$1.isVideo(file.link.href) + }); + let size = +file.size.match(/[\d.]+/)[0]; + let unit = ['B', 'KB', 'MB', 'GB'].indexOf(file.size.match(/\w+$/)[0]); + while (unit-- > 0) { + size *= 1024; + } + file.sizeInBytes = size; + return file; + } + kill(file, index = 0) { + let strong; + if (file) { + if (this.isDead || this.files[index].isDead) { + return; + } + this.files[index].isDead = true; + $$1.addClass(this.nodes.root, 'deleted-file'); + } + else { + if (this.isDead) { + return; + } + this.isDead = true; + $$1.rmClass(this.nodes.root, 'deleted-file'); + $$1.addClass(this.nodes.root, 'deleted-post'); + } + if (!(strong = $$1('strong.warning', this.nodes.info))) { + strong = $$1.el('strong', { className: 'warning' }); + $$1.after($$1('input', this.nodes.info), strong); + } + strong.textContent = file ? '[File deleted]' : '[Deleted]'; + if (this.isClone) { + return; + } + for (var clone of this.clones) { + clone.kill(file, index); + } + if (file) { + return; + } + // Get quotelinks/backlinks to this post + // and paint them (Dead). + for (var quotelink of Get$1.allQuotelinksLinkingTo(this)) { + if (!$$1.hasClass(quotelink, 'deadlink')) { + $$1.add(quotelink, Post.deadMark.cloneNode(true)); + $$1.addClass(quotelink, 'deadlink'); + } + } + } + // XXX Workaround for 4chan's racing condition + // giving us false-positive dead posts. + resurrect() { + this.isDead = false; + $$1.rmClass(this.nodes.root, 'deleted-post'); + const strong = $$1('strong.warning', this.nodes.info); + // no false-positive files + if (this.files.some(file => file.isDead)) { + $$1.addClass(this.nodes.root, 'deleted-file'); + strong.textContent = '[File deleted]'; + } + else { + $$1.rm(strong); + } + if (this.isClone) { + return; + } + for (var clone of this.clones) { + clone.resurrect(); + } + for (var quotelink of Get$1.allQuotelinksLinkingTo(this)) { + if ($$1.hasClass(quotelink, 'deadlink')) { + $$1.rm($$1('.qmark-dead', quotelink)); + $$1.rmClass(quotelink, 'deadlink'); + } + } + } + collect() { + g.posts.rm(this.fullID); + this.thread.posts.rm(this); + this.board.posts.rm(this); + } + addClone(context, contractThumb) { + // Callbacks may not have been run yet due to anti-browser-lock delay in Main.callbackNodesDB. + Callbacks.Post.execute(this); + return new PostClone(this, context, contractThumb); + } + rmClone(index) { + this.clones.splice(index, 1); + for (var clone of this.clones.slice(index)) { + clone.nodes.root.dataset.clone = index++; + } + } + setCatalogOP(isCatalogOP) { + this.nodes.root.classList.toggle('catalog-container', isCatalogOP); + this.nodes.root.classList.toggle('opContainer', !isCatalogOP); + this.nodes.post.classList.toggle('catalog-post', isCatalogOP); + this.nodes.post.classList.toggle('op', !isCatalogOP); + this.nodes.post.style.left = (this.nodes.post.style.right = null); + } + } + // because of a circular dependency $ might not be initialized, so we can't use $.el + Post.deadMark = (() => { + const el = document.createElement('span'); + // \u00A0 is nbsp + el.textContent = '\u00A0(Dead)'; + el.className = 'qmark-dead'; + return el; + })(); + class PostClone extends Post { + constructor(origin, context, contractThumb) { + super(); + this.isClone = true; + let file, fileRoots, key; + this.origin = origin; + this.context = context; + for (key of ['ID', 'postID', 'threadID', 'boardID', 'siteID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply']) { + // Copy or point to the origin's key value. + this[key] = this.origin[key]; + } + const { nodes } = this.origin; + const root = contractThumb ? this.cloneWithoutVideo(nodes.root) : nodes.root.cloneNode(true); + for (var node of [root, ...$$('[id]', root)]) { + node.id += `_${PostClone.suffix}`; + } + PostClone.suffix++; + // Remove inlined posts inside of this post. + for (var inline of $$('.inline', root)) { + $$1.rm(inline); + } + for (var inlined of $$('.inlined', root)) { + $$1.rmClass(inlined, 'inlined'); + } + this.nodes = this.parseNodes(root); + root.hidden = false; // post hiding + $$1.rmClass(root, 'forwarded'); // quote inlining + $$1.rmClass(this.nodes.post, 'highlight'); // keybind navigation, ID highlighting + // Remove catalog stuff. + if (!this.isReply) { + this.setCatalogOP(false); + $$1.rm($$1('.catalog-link', this.nodes.post)); + $$1.rm($$1('.catalog-stats', this.nodes.post)); + $$1.rm($$1('.catalog-replies', this.nodes.post)); + } + this.parseQuotes(); + this.quotes = [...this.origin.quotes]; + this.files = []; + if (this.origin.files.length) { + fileRoots = this.fileRoots(); + } + for (var originFile of this.origin.files) { + // Copy values, point to relevant elements. + file = { ...originFile }; + var fileRoot = fileRoots[file.docIndex]; + for (key in g.SITE.selectors.file) { + var selector = g.SITE.selectors.file[key]; + file[key] = $$1(selector, fileRoot); + } + file.thumbLink = file.thumb?.parentNode; + if (file.thumbLink) { + file.fullImage = $$1('.full-image', file.thumbLink); + } + file.videoControls = $$1('.video-controls', file.text); + if (file.videoThumb) { + file.thumb.muted = true; + } + this.files.push(file); + } + if (this.files.length) { + this.file = this.files[0]; + // Contract thumbnails in quote preview + if (this.file.thumb && contractThumb) { + ImageExpand.contract(this); + } + } + if (this.origin.isDead) { + this.isDead = true; + } + root.dataset.clone = this.origin.clones.push(this) - 1; + return this; + } + cloneWithoutVideo(node) { + if ((node.tagName === 'VIDEO') && !node.dataset.md5) { // (exception for WebM thumbnails) + return []; + } + else if ((node.nodeType === Node.ELEMENT_NODE) && $$1('video', node)) { + const clone = node.cloneNode(false); + for (var child of node.childNodes) { + $$1.add(clone, this.cloneWithoutVideo(child)); + } + return clone; + } + else { + return node.cloneNode(true); + } + } + } + PostClone.suffix = 0; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var Menu = { + init() { + if (!['index', 'thread'].includes(g.VIEW) || !Conf['Menu']) { return; } + + this.button = $$1.el('a', { + className: 'menu-button', + href: 'javascript:;' + } + ); + + $$1.extend(this.button, {textContent: "🞃"}); + + this.menu = new UI.Menu('post'); + Callbacks.Post.push({ + name: 'Menu', + cb: this.node + }); + + return Callbacks.CatalogThread.push({ + name: 'Menu', + cb: this.catalogNode + }); + }, + + node() { + if (this.isClone) { + const button = $$1('.menu-button', this.nodes.info); + $$1.rmClass(button, 'active'); + $$1.rm($$1('.dialog', this.nodes.info)); + Menu.makeButton(this, button); + return; + } + return $$1.add(this.nodes.info, Menu.makeButton(this)); + }, + + catalogNode() { + return $$1.after(this.nodes.icons, Menu.makeButton(this.thread.OP)); + }, + + makeButton(post, button) { + if (!button) { button = Menu.button.cloneNode(true); } + $$1.on(button, 'click', function(e) { + return Menu.menu.toggle(e, this, post); + }); + return button; + } + }; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var Recursive = { + recursives: dict(), + init() { + if (!['index', 'thread'].includes(g.VIEW)) { return; } + return Callbacks.Post.push({ + name: 'Recursive', + cb: this.node + }); + }, + + node() { + if (this.isClone || this.isFetchedQuote) { return; } + for (var quote of this.quotes) { + var obj; + if ((obj = Recursive.recursives[quote])) { + for (var i = 0; i < obj.recursives.length; i++) { + var recursive = obj.recursives[i]; + recursive(this, ...Array.from(obj.args[i])); + } + } + } + }, + + add(recursive, post, ...args) { + const obj = Recursive.recursives[post.fullID] || (Recursive.recursives[post.fullID] = { + recursives: [], + args: [] + }); + obj.recursives.push(recursive); + return obj.args.push(args); + }, + + rm(recursive, post) { + let obj; + if (!(obj = Recursive.recursives[post.fullID])) { return; } + for (let i = 0; i < obj.recursives.length; i++) { + var rec = obj.recursives[i]; + if (rec === recursive) { + obj.recursives.splice(i, 1); + obj.args.splice(i, 1); + } + } + }, + + apply(recursive, post, ...args) { + const {fullID} = post; + return g.posts.forEach(function(post) { + if (post.quotes.includes(fullID)) { + return recursive(post, ...Array.from(args)); + } + }); + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var PostHiding = { + init() { + if (!['index', 'thread'].includes(g.VIEW) || (!Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link']))) { return; } + + if (Conf['Reply Hiding Buttons']) { + $$1.addClass(doc$1, "reply-hide"); + } + + this.db = new DataBoard('hiddenPosts'); + return Callbacks.Post.push({ + name: 'Reply Hiding', + cb: this.node + }); + }, + + isHidden(boardID, threadID, postID) { + return !!(PostHiding.db && PostHiding.db.get({boardID, threadID, postID})); + }, + + node() { + let data, sa; + if (!this.isReply || this.isClone || this.isFetchedQuote) { return; } + + if (data = PostHiding.db.get({boardID: this.board.ID, threadID: this.thread.ID, postID: this.ID})) { + if (data.thisPost) { + PostHiding.hide(this, data.makeStub, data.hideRecursively); + } else { + Recursive.apply(PostHiding.hide, this, data.makeStub, true); + Recursive.add(PostHiding.hide, this, data.makeStub, true); + } + } + + if (!Conf['Reply Hiding Buttons']) { return; } + + const button = PostHiding.makeButton(this, 'hide'); + if (sa = g.SITE.selectors.sideArrows) { + const sideArrows = $$1(sa, this.nodes.root); + $$1.replace(sideArrows.firstChild, button); + return sideArrows.className = 'replacedSideArrows'; + } else { + return $$1.prepend(this.nodes.info, button); + } + }, + + menu: { + init() { + if (!['index', 'thread'].includes(g.VIEW) || !Conf['Menu'] || !Conf['Reply Hiding Link']) { return; } + + // Hide + let div = $$1.el('div', { + className: 'hide-reply-link', + textContent: 'Hide' + } + ); + + let apply = $$1.el('a', { + textContent: 'Apply', + href: 'javascript:;' + } + ); + $$1.on(apply, 'click', PostHiding.menu.hide); + + let thisPost = UI.checkbox('thisPost', 'This post', true); + let replies = UI.checkbox('replies', 'Hide replies', Conf['Recursive Hiding']); + const makeStub = UI.checkbox('makeStub', 'Make stub', Conf['Stubs']); + + Menu.menu.addEntry({ + el: div, + order: 20, + open(post) { + if (!post.isReply || post.isClone || post.isHidden) { + return false; + } + PostHiding.menu.post = post; + return true; + }, + subEntries: [ + {el: apply} + , + {el: thisPost} + , + {el: replies} + , + {el: makeStub} + ]}); + + // Show + div = $$1.el('div', { + className: 'show-reply-link', + textContent: 'Show' + } + ); + + apply = $$1.el('a', { + textContent: 'Apply', + href: 'javascript:;' + } + ); + $$1.on(apply, 'click', PostHiding.menu.show); + + thisPost = UI.checkbox('thisPost', 'This post', false); + replies = UI.checkbox('replies', 'Show replies', false); + const hideStubLink = $$1.el('a', { + textContent: 'Hide stub', + href: 'javascript:;' + } + ); + $$1.on(hideStubLink, 'click', PostHiding.menu.hideStub); + + Menu.menu.addEntry({ + el: div, + order: 20, + open(post) { + let data; + if (!post.isReply || post.isClone || !post.isHidden) { + return false; + } + if (!(data = PostHiding.db.get({boardID: post.board.ID, threadID: post.thread.ID, postID: post.ID}))) { + return false; + } + PostHiding.menu.post = post; + thisPost.firstChild.checked = post.isHidden; + replies.firstChild.checked = (data?.hideRecursively != null) ? data.hideRecursively : Conf['Recursive Hiding']; + return true; + }, + subEntries: [ + {el: apply} + , + {el: thisPost} + , + {el: replies} + ]}); + + return Menu.menu.addEntry({ + el: hideStubLink, + order: 15, + open(post) { + if (!post.isReply || post.isClone || !post.isHidden) { + return false; + } + if (!(PostHiding.db.get({boardID: post.board.ID, threadID: post.thread.ID, postID: post.ID}))) { + return false; + } + return PostHiding.menu.post = post; + } + }); + }, + + hide() { + const parent = this.parentNode; + const thisPost = $$1('input[name=thisPost]', parent).checked; + const replies = $$1('input[name=replies]', parent).checked; + const makeStub = $$1('input[name=makeStub]', parent).checked; + const {post} = PostHiding.menu; + if (thisPost) { + PostHiding.hide(post, makeStub, replies); + } else if (replies) { + Recursive.apply(PostHiding.hide, post, makeStub, true); + Recursive.add(PostHiding.hide, post, makeStub, true); + } else { + return; + } + PostHiding.saveHiddenState(post, true, thisPost, makeStub, replies); + return $$1.event('CloseMenu'); + }, + + show() { + let data; + const parent = this.parentNode; + const thisPost = $$1('input[name=thisPost]', parent).checked; + const replies = $$1('input[name=replies]', parent).checked; + const {post} = PostHiding.menu; + if (thisPost) { + PostHiding.show(post, replies); + } else if (replies) { + Recursive.apply(PostHiding.show, post, true); + Recursive.rm(PostHiding.hide, post, true); + } else { + return; + } + if (data = PostHiding.db.get({boardID: post.board.ID, threadID: post.thread.ID, postID: post.ID})) { + PostHiding.saveHiddenState(post, !(thisPost && replies), !thisPost, data.makeStub, !replies); + } + return $$1.event('CloseMenu'); + }, + hideStub() { + let data; + const {post} = PostHiding.menu; + if (data = PostHiding.db.get({boardID: post.board.ID, threadID: post.thread.ID, postID: post.ID})) { + PostHiding.show(post, data.hideRecursively); + PostHiding.hide(post, false, data.hideRecursively); + PostHiding.saveHiddenState(post, true, true, false, data.hideRecursively); + } + $$1.event('CloseMenu'); + } + }, + + makeButton(post, type) { + const span = $$1.el('span', { + textContent: type === 'hide' ? '➖︎' : '➕︎', + }); + const a = $$1.el('a', { + className: `${type}-reply-button`, + href: 'javascript:;' + } + ); + $$1.add(a, span); + $$1.on(a, 'click', PostHiding.toggle); + return a; + }, + + saveHiddenState(post, isHiding, thisPost, makeStub, hideRecursively) { + const data = { + boardID: post.board.ID, + threadID: post.thread.ID, + postID: post.ID + }; + if (isHiding) { + data.val = { + thisPost: thisPost !== false, // undefined -> true + makeStub, + hideRecursively + }; + return PostHiding.db.set(data); + } else { + return PostHiding.db.delete(data); + } + }, + + toggle() { + const post = Get$1.postFromNode(this); + PostHiding[(post.isHidden ? 'show' : 'hide')](post); + return PostHiding.saveHiddenState(post, post.isHidden); + }, + + hide(post, makeStub=Conf['Stubs'], hideRecursively=Conf['Recursive Hiding']) { + if (post.isHidden) { return; } + post.isHidden = true; + + if (hideRecursively) { + Recursive.apply(PostHiding.hide, post, makeStub, true); + Recursive.add(PostHiding.hide, post, makeStub, true); + } + + for (var quotelink of Get$1.allQuotelinksLinkingTo(post)) { + $$1.addClass(quotelink, 'filtered'); + } + + if (!makeStub) { + post.nodes.root.hidden = true; + return; + } + + const a = PostHiding.makeButton(post, 'show'); + $$1.add(a, $$1.tn(` ${post.info.nameBlock}`)); + post.nodes.stub = $$1.el('div', + {className: 'stub'}); + $$1.add(post.nodes.stub, a); + if (Conf['Menu']) { + $$1.add(post.nodes.stub, Menu.makeButton(post)); + } + return $$1.prepend(post.nodes.root, post.nodes.stub); + }, + + show(post, showRecursively=Conf['Recursive Hiding']) { + if (post.nodes.stub) { + $$1.rm(post.nodes.stub); + delete post.nodes.stub; + } else { + post.nodes.root.hidden = false; + } + post.isHidden = false; + if (showRecursively) { + Recursive.apply(PostHiding.show, post, true); + Recursive.rm(PostHiding.hide, post); + } + for (var quotelink of Get$1.allQuotelinksLinkingTo(post)) { + $$1.rmClass(quotelink, 'filtered'); + } + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS205: Consider reworking code to avoid use of IIFEs + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var RelativeDates = { + INTERVAL: 30000, + + init() { + if ( + (['index', 'thread', 'archive'].includes(g.VIEW) && Conf['Relative Post Dates'] && !Conf['Relative Date Title']) || + Index$1.enabled + ) { + this.flush(); + $$1.on(d$1, 'visibilitychange PostsInserted', this.flush); + } + + if (Conf['Relative Post Dates']) { + return Callbacks.Post.push({ + name: 'Relative Post Dates', + cb: this.node + }); + } + }, + + node() { + if (!this.info.date) { return; } + const dateEl = this.nodes.date; + if (Conf['Relative Date Title']) { + $$1.on(dateEl, 'mouseover', () => RelativeDates.hover(this)); + return; + } + if (this.isClone) { return; } + + // Show original absolute time as tooltip so users can still know exact times + // Since "Time Formatting" runs its `node` before us, the title tooltip will + // pick up the user-formatted time instead of 4chan time when enabled. + dateEl.title = dateEl.textContent; + + return RelativeDates.update(this); + }, + + // diff is milliseconds from now. + relative(diff, now, date, abbrev) { + let number; + let unit = (() => { + if ((number = (diff / DAY)) >= 1) { + const years = now.getFullYear() - date.getFullYear(); + let months = now.getMonth() - date.getMonth(); + const days = now.getDate() - date.getDate(); + if (years > 1) { + number = years - ((months < 0) || ((months === 0) && (days < 0))); + return 'year'; + } else if ((years === 1) && ((months > 0) || ((months === 0) && (days >= 0)))) { + number = years; + return 'year'; + } else if ((months = months + (12*years)) > 1) { + number = months - (days < 0); + return 'month'; + } else if ((months === 1) && (days >= 0)) { + number = months; + return 'month'; + } else { + return 'day'; + } + } else if ((number = (diff / HOUR)) >= 1) { + return 'hour'; + } else if ((number = (diff / MINUTE)) >= 1) { + return 'minute'; + } else { + // prevent "-1 seconds ago" + number = Math.max(0, diff) / SECOND; + return 'second'; + } + })(); + + const rounded = Math.round(number); + + if (abbrev) { + unit = unit === 'month' ? 'mo' : unit[0]; + } else { + if (rounded !== 1) { unit += 's'; } // pluralize + } + + if (abbrev) { return `${rounded}${unit}`; } else { return `${rounded} ${unit} ago`; } + }, + + // Changing all relative dates as soon as possible incurs many annoying + // redraws and scroll stuttering. Thus, sacrifice accuracy for UX/CPU economy, + // and perform redraws when the DOM is otherwise being manipulated (and scroll + // stuttering won't be noticed), falling back to INTERVAL while the page + // is visible. + // + // Each individual dateTime element will add its update() function to the stale list + // when it is to be called. + stale: [], + flush() { + // No point in changing the dates until the user sees them. + if (d$1.hidden) { return; } + + const now = new Date(); + for (var data of RelativeDates.stale) { RelativeDates.update(data, now); } + RelativeDates.stale = []; + + // Reset automatic flush. + clearTimeout(RelativeDates.timeout); + return RelativeDates.timeout = setTimeout(RelativeDates.flush, RelativeDates.INTERVAL); + }, + + hover(post) { + const { + date + } = post.info; + const now = new Date(); + const diff = now - date; + return post.nodes.date.title = RelativeDates.relative(diff, now, date); + }, + + // `update()`, when called from `flush()`, updates the elements, + // and re-calls `setOwnTimeout()` to re-add `data` to the stale list later. + update(data, now) { + let abbrev, date; + const isPost = data instanceof Post; + if (isPost) { + ({ + date + } = data.info); + abbrev = false; + } else { + date = new Date(+data.dataset.utc); + abbrev = !!data.dataset.abbrev; + } + if (!now) { now = new Date(); } + const diff = now - date; + const relative = RelativeDates.relative(diff, now, date, abbrev); + if (isPost) { + for (var singlePost of [data].concat(data.clones)) { + singlePost.nodes.date.firstChild.textContent = relative; + } + } else { + data.firstChild.textContent = relative; + } + return RelativeDates.setOwnTimeout(diff, data); + }, + + setOwnTimeout(diff, data) { + const delay = diff < MINUTE ? + SECOND - ((diff + (SECOND / 2)) % SECOND) + : diff < HOUR ? + MINUTE - ((diff + (MINUTE / 2)) % MINUTE) + : diff < DAY ? + HOUR - ((diff + (HOUR / 2)) % HOUR) + : + DAY - ((diff + (DAY / 2)) % DAY); + return setTimeout(RelativeDates.markStale, delay, data); + }, + + markStale(data) { + if (RelativeDates.stale.includes(data)) { return; } // We can call RelativeDates.update() multiple times. + if (data instanceof Post && !g.posts.get(data.fullID)) { return; } // collected post. + if (data instanceof Element && !doc$1.contains(data)) { return; } // removed catalog reply. + return RelativeDates.stale.push(data); + } + }; + + var ThreadWatcherPage = `
        + Thread Watcher 🗘 + + 🞃 + × +
        +
        +`; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS104: Avoid inline assignments + * DS205: Consider reworking code to avoid use of IIFEs + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var BoardConfig = { + cbs: [], + + init() { + let middle; + if (g.SITE.software !== 'yotsuba') { return; } + const now = Date.now(); + if (now - (2 * HOUR) >= ((middle = Conf['boardConfig'].lastChecked || 0)) || middle > now) { + return $$1.ajax(`${location.protocol}//a.4cdn.org/boards.json`, + {onloadend: this.load}); + } else { + const {boards} = Conf['boardConfig']; + return this.set(boards); + } + }, + + load() { + let boards; + if ((this.status === 200) && this.response && this.response.boards) { + boards = dict(); + for (var board of this.response.boards) { + boards[board.board] = board; + } + $$1.set('boardConfig', {boards, lastChecked: Date.now()}); + } else { + ({boards} = Conf['boardConfig']); + const err = (() => { switch (this.status) { + case 0: return 'Connection Error'; + case 200: return 'Invalid Data'; + default: return `Error ${this.statusText} (${this.status})`; + } })(); + new Notice('warning', `Failed to load board configuration. ${err}`, 20); + } + return BoardConfig.set(boards); + }, + + set(boards) { + this.boards = boards; + for (var ID in g.boards) { + var board = g.boards[ID]; + board.config = this.boards[ID] || {}; + } + for (var cb of this.cbs) { + $$1.queueTask(cb); + } + }, + + ready(cb) { + if (this.boards) { + return cb(); + } else { + return this.cbs.push(cb); + } + }, + + sfwBoards(sfw) { + return (() => { + const result = []; + const object = this.boards || Conf['boardConfig'].boards; + for (var board in object) { + var data = object[board]; + if (!!data.ws_board === sfw) { + result.push(board); + } + } + return result; + })(); + }, + + isSFW(board) { + return !!(this.boards || Conf['boardConfig'].boards)[board]?.ws_board; + }, + + domain(board) { + return `boards.${BoardConfig.isSFW(board) ? '4channel' : '4chan'}.org`; + }, + + isArchived(board) { + // assume archive exists if no data available to prevent cleaning of archived threads + const data = (this.boards || Conf['boardConfig'].boards)[board]; + return !data || data.is_archived; + }, + + noAudio(boardID) { + if (g.SITE.software !== 'yotsuba') { return false; } + const boards = this.boards || Conf['boardConfig'].boards; + return boards && boards[boardID] && !boards[boardID].webm_audio; + }, + + title(boardID) { + return (this.boards || Conf['boardConfig'].boards)?.[boardID]?.title || ''; + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + class Board { + toString() { return this.ID; } + + constructor(ID) { + this.ID = ID; + this.boardID = this.ID; + this.siteID = g.SITE.ID; + this.threads = new SimpleDict(); + this.posts = new SimpleDict(); + this.config = BoardConfig.boards?.[this.ID] || {}; + + g.boards[this] = this; + } + + cooldowns() { + const c2 = (this.config || {}).cooldowns || {}; + const c = { + thread: c2.threads || 0, + reply: c2.replies || 0, + image: c2.images || 0, + thread_global: 300 // inter-board thread cooldown + }; + // Pass users have reduced cooldowns. + if (d$1.cookie.indexOf('pass_enabled=1') >= 0) { + for (var key of ['reply', 'image']) { + c[key] = Math.ceil(c[key] / 2); + } + } + return c; + } + } + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + const PostRedirect = { + init() { + return $$1.on(d$1, 'QRPostSuccessful', e => { + if (!e.detail.redirect) { return; } + this.event = e; + this.delays = 0; + return $$1.queueTask(() => { + if ((e === this.event) && (this.delays === 0)) { + return location.href = e.detail.redirect; + } + }); + }); + }, + + delays: 0, + + delay() { + if (!this.event) { return null; } + const e = this.event; + this.delays++; + return () => { + if (e !== this.event) { return; } + this.delays--; + if (this.delays === 0) { + return location.href = e.detail.redirect; + } + }; + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var ExpandComment = { + init() { + if ((g.VIEW !== 'index') || !Conf['Comment Expansion'] || Conf['JSON Index']) { return; } + + return Callbacks.Post.push({ + name: 'Comment Expansion', + cb: this.node + }); + }, + + node() { + let a; + if (a = $$1('.abbr > a:not([onclick])', this.nodes.comment)) { + return $$1.on(a, 'click', ExpandComment.cb); + } + }, + + callbacks: [], + + cb(e) { + e.preventDefault(); + return ExpandComment.expand(Get$1.postFromNode(this)); + }, + + expand(post) { + let a; + if (post.nodes.longComment && !post.nodes.longComment.parentNode) { + $$1.replace(post.nodes.shortComment, post.nodes.longComment); + post.nodes.comment = post.nodes.longComment; + return; + } + if (!(a = $$1('.abbr > a', post.nodes.comment))) { return; } + a.textContent = `Post No.${post} Loading...`; + return $$1.cache(g.SITE.urls.threadJSON({boardID: post.boardID, threadID: post.threadID}), function() { return ExpandComment.parse(this, a, post); }); + }, + + contract(post) { + if (!post.nodes.shortComment) { return; } + const a = $$1('.abbr > a', post.nodes.shortComment); + a.textContent = 'here'; + $$1.replace(post.nodes.longComment, post.nodes.shortComment); + return post.nodes.comment = post.nodes.shortComment; + }, + + parse(req, a, post) { + let postObj, spoilerRange; + const {status} = req; + if (![200, 304].includes(status)) { + a.textContent = status ? `Error ${req.statusText} (${status})` : 'Connection Error'; + return; + } + + const { + posts + } = req.response; + if (spoilerRange = posts[0].custom_spoiler) { + g.SITE.Build.spoilerRange[g.BOARD] = spoilerRange; + } + + for (postObj of posts) { + if (postObj.no === post.ID) { break; } + } + if (postObj.no !== post.ID) { + a.textContent = `Post No.${post} not found.`; + return; + } + + const {comment} = post.nodes; + const clone = comment.cloneNode(false); + clone.innerHTML = postObj.com; + // Fix pathnames + for (var quote of $$('.quotelink', clone)) { + var href = quote.getAttribute('href'); + if (href[0] === '/') { continue; } // Cross-board quote, or board link + if (href[0] === '#') { + quote.href = `${a.pathname.split(/\/+/).splice(0,4).join('/')}${href}`; + } else { + quote.href = `${a.pathname.split(/\/+/).splice(0,3).join('/')}/${href}`; + } + } + post.nodes.shortComment = comment; + $$1.replace(comment, clone); + post.nodes.comment = (post.nodes.longComment = clone); + post.parseComment(); + post.parseQuotes(); + + for (var callback of ExpandComment.callbacks) { + callback.call(post); + } + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var QuoteYou = { + init() { + if (!Conf['Remember Your Posts']) { return; } + + this.db = new DataBoard('yourPosts'); + $$1.sync('Remember Your Posts', enabled => Conf['Remember Your Posts'] = enabled); + $$1.on(d$1, 'QRPostSuccessful', function(e) { + const cb = PostRedirect.delay(); + return $$1.get('Remember Your Posts', Conf['Remember Your Posts'], function(items) { + if (!items['Remember Your Posts']) { return; } + const {boardID, threadID, postID} = e.detail; + return QuoteYou.db.set({boardID, threadID, postID, val: true}, cb); + }); + }); + + if (!['index', 'thread', 'archive'].includes(g.VIEW)) { return; } + + if (Conf['Highlight Own Posts']) { + $$1.addClass(doc$1, 'highlight-own'); + } + + if (Conf['Highlight Posts Quoting You']) { + $$1.addClass(doc$1, 'highlight-you'); + } + + if (Conf['Comment Expansion']) { + ExpandComment.callbacks.push(this.node); + } + + // \u00A0 is nbsp + this.mark = $$1.el('span', { + textContent: '\u00A0(You)', + className: 'qmark-you' + } + ); + Callbacks.Post.push({ + name: 'Mark Quotes of You', + cb: this.node + }); + + return QuoteYou.menu.init(); + }, + + isYou(post) { + return !!QuoteYou.db?.get({ + boardID: post.boardID, + threadID: post.threadID, + postID: post.ID + }); + }, + + node() { + if (this.isClone) { return; } + + if (QuoteYou.isYou(this)) { + $$1.addClass(this.nodes.root, 'yourPost'); + } + + // Stop there if there's no quotes in that post. + if (!this.quotes.length) { return; } + + for (var quotelink of this.nodes.quotelinks) { + if (QuoteYou.db.get(Get$1.postDataFromLink(quotelink))) { + if (Conf['Mark Quotes of You']) { $$1.add(quotelink, QuoteYou.mark.cloneNode(true)); } + $$1.addClass(quotelink, 'you'); + $$1.addClass(this.nodes.root, 'quotesYou'); + } + } + }, + + menu: { + init() { + const label = $$1.el('label', + {className: 'toggle-you'} + , + {innerHTML: ' You'}); + const input = $$1('input', label); + $$1.on(input, 'change', QuoteYou.menu.toggle); + return Menu.menu?.addEntry({ + el: label, + order: 80, + open(post) { + QuoteYou.menu.post = (post.origin || post); + input.checked = QuoteYou.isYou(post); + return true; + } + }); + }, + + toggle() { + const {post} = QuoteYou.menu; + const data = {boardID: post.board.ID, threadID: post.thread.ID, postID: post.ID, val: true}; + if (this.checked) { + QuoteYou.db.set(data); + } else { + QuoteYou.db.delete(data); + } + for (var clone of [post].concat(post.clones)) { + clone.nodes.root.classList.toggle('yourPost', this.checked); + } + for (var quotelink of Get$1.allQuotelinksLinkingTo(post)) { + if (this.checked) { + if (Conf['Mark Quotes of You']) { $$1.add(quotelink, QuoteYou.mark.cloneNode(true)); } + } else { + $$1.rm($$1('.qmark-you', quotelink)); + } + quotelink.classList.toggle('you', this.checked); + if ($$1.hasClass(quotelink, 'quotelink')) { + var quoter = Get$1.postFromNode(quotelink).nodes.root; + quoter.classList.toggle('quotesYou', !!$$1('.quotelink.you', quoter)); + } + } + } + }, + + cb: { + seek(type) { + let highlighted, post; + let result; + const {highlight} = g.SITE.classes; + if (highlighted = $$1(`.${highlight}`)) { $$1.rmClass(highlighted, highlight); } + + if (!QuoteYou.lastRead || !doc$1.contains(QuoteYou.lastRead) || !$$1.hasClass(QuoteYou.lastRead, 'quotesYou')) { + if (!(post = (QuoteYou.lastRead = $$1('.quotesYou')))) { + new Notice('warning', 'No posts are currently quoting you, loser.', 20); + return; + } + if (QuoteYou.cb.scroll(post)) { return; } + } else { + post = QuoteYou.lastRead; + } + + const str = `${type}::div[contains(@class,'quotesYou')]`; + + while (post = (result = $$1.X(str, post)).snapshotItem(type === 'preceding' ? result.snapshotLength - 1 : 0)) { + if (QuoteYou.cb.scroll(post)) { return; } + } + + const posts = $$('.quotesYou'); + return QuoteYou.cb.scroll(posts[type === 'following' ? 0 : posts.length - 1]); + }, + + scroll(root) { + const post = Get$1.postFromRoot(root); + if (!post.nodes.post.getBoundingClientRect().height) { + return false; + } else { + QuoteYou.lastRead = root; + location.href = Get$1.url('post', post); + Header$1.scrollTo(post.nodes.post); + if (post.isReply) { + const sel = `${g.SITE.selectors.postContainer}${g.SITE.selectors.highlightable.reply}`; + let node = post.nodes.root; + if (!node.matches(sel)) { node = $$1(sel, node); } + $$1.addClass(node, g.SITE.classes.highlight); + } + return true; + } + } + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + class RandomAccessList { + constructor(items) { + this.length = 0; + if (items) { for (var item of items) { this.push(item); } } + } + + push(data) { + let item; + let {ID} = data; + if (!ID) { ID = data.id; } + if (this[ID]) { return; } + const {last} = this; + this[ID] = (item = { + prev: last, + next: null, + data, + ID + }); + item.prev = last; + this.last = last ? + (last.next = item) + : + (this.first = item); + return this.length++; + } + + before(root, item) { + if ((item.next === root) || (item === root)) { return; } + + this.rmi(item); + + const {prev} = root; + root.prev = item; + item.next = root; + item.prev = prev; + if (prev) { + return prev.next = item; + } else { + return this.first = item; + } + } + + after(root, item) { + if ((item.prev === root) || (item === root)) { return; } + + this.rmi(item); + + const {next} = root; + root.next = item; + item.prev = root; + item.next = next; + if (next) { + return next.prev = item; + } else { + return this.last = item; + } + } + + prepend(item) { + const {first} = this; + if ((item === first) || !this[item.ID]) { return; } + this.rmi(item); + item.next = first; + if (first) { + first.prev = item; + } else { + this.last = item; + } + this.first = item; + return delete item.prev; + } + + shift() { + return this.rm(this.first.ID); + } + + order() { + let item; + const order = [(item = this.first)]; + while ((item = item.next)) { order.push(item); } + return order; + } + + rm(ID) { + const item = this[ID]; + if (!item) { return; } + delete this[ID]; + this.length--; + this.rmi(item); + delete item.next; + return delete item.prev; + } + + rmi(item) { + const {prev, next} = item; + if (prev) { + prev.next = next; + } else { + this.first = next; + } + if (next) { + return next.prev = prev; + } else { + return this.last = prev; + } + } + } + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var Unread = { + init() { + if ((g.VIEW !== 'thread') || ( + !Conf['Unread Count'] && + !Conf['Unread Favicon'] && + !Conf['Unread Line'] && + !Conf['Remember Last Read Post'] && + !Conf['Desktop Notifications'] && + !Conf['Quote Threading'] + )) { return; } + + if (Conf['Remember Last Read Post']) { + $$1.sync('Remember Last Read Post', enabled => Conf['Remember Last Read Post'] = enabled); + this.db = new DataBoard('lastReadPosts', this.sync); + } + + this.hr = $$1.el('hr', { + id: 'unread-line', + className: 'unread-line' + } + ); + this.posts = new Set(); + this.postsQuotingYou = new Set(); + this.order = new RandomAccessList(); + this.position = null; + + Callbacks.Thread.push({ + name: 'Unread', + cb: this.node + }); + + return Callbacks.Post.push({ + name: 'Unread', + cb: this.addPost + }); + }, + + node() { + Unread.thread = this; + Unread.title = d$1.title; + Unread.lastReadPost = Unread.db?.get({ + boardID: this.board.ID, + threadID: this.ID + }) || 0; + Unread.readCount = 0; + for (var ID of this.posts.keys) { if (+ID <= Unread.lastReadPost) { Unread.readCount++; } } + $$1.one(d$1, '4chanXInitFinished', Unread.ready); + $$1.on(d$1, 'PostsInserted', Unread.onUpdate); + $$1.on(d$1, 'ThreadUpdate', function(e) { if (e.detail[404]) { return Unread.update(); } }); + const resetLink = $$1.el('a', { + href: 'javascript:;', + className: 'unread-reset', + textContent: 'Mark all unread' + } + ); + $$1.on(resetLink, 'click', Unread.reset); + return Header$1.menu.addEntry({ + el: resetLink, + order: 70 + }); + }, + + ready() { + if (Conf['Remember Last Read Post'] && Conf['Scroll to Last Read Post']) { Unread.scroll(); } + Unread.setLine(true); + Unread.read(); + Unread.update(); + $$1.on(d$1, 'scroll visibilitychange', Unread.read); + if (Conf['Unread Line']) { return $$1.on(d$1, 'visibilitychange', Unread.setLine); } + }, + + positionPrev() { + if (Unread.position) { return Unread.position.prev; } else { return Unread.order.last; } + }, + + scroll() { + // Let the header's onload callback handle it. + let hash; + if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) { return; } + + let position = Unread.positionPrev(); + while (position) { + var {bottom} = position.data.nodes; + if (!bottom.getBoundingClientRect().height) { + // Don't try to scroll to posts with display: none + position = position.prev; + } else { + Header$1.scrollToIfNeeded(bottom, true); + break; + } + } + }, + + reset() { + if (Unread.lastReadPost == null) { return; } + + Unread.posts = new Set(); + Unread.postsQuotingYou = new Set(); + Unread.order = new RandomAccessList(); + Unread.position = null; + Unread.lastReadPost = 0; + Unread.readCount = 0; + Unread.thread.posts.forEach(post => Unread.addPost.call(post)); + + $$1.forceSync('Remember Last Read Post'); + if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) { + Unread.db.set({ + boardID: Unread.thread.board.ID, + threadID: Unread.thread.ID, + val: 0 + }); + } + + Unread.updatePosition(); + Unread.setLine(); + return Unread.update(); + }, + + sync() { + if (Unread.lastReadPost == null) { return; } + const lastReadPost = Unread.db.get({ + boardID: Unread.thread.board.ID, + threadID: Unread.thread.ID, + defaultValue: 0 + }); + if (Unread.lastReadPost >= lastReadPost) { return; } + Unread.lastReadPost = lastReadPost; + + const postIDs = Unread.thread.posts.keys; + for (let i = Unread.readCount, end = postIDs.length; i < end; i++) { + var ID = +postIDs[i]; + if (!Unread.thread.posts.get(ID).isFetchedQuote) { + if (ID > Unread.lastReadPost) { break; } + Unread.posts.delete(ID); + Unread.postsQuotingYou.delete(ID); + } + Unread.readCount++; + } + + Unread.updatePosition(); + Unread.setLine(); + return Unread.update(); + }, + + addPost() { + if (this.isFetchedQuote || this.isClone) { return; } + Unread.order.push(this); + if ((this.ID <= Unread.lastReadPost) || this.isHidden || QuoteYou.isYou(this)) { return; } + Unread.posts.add((Unread.posts.last = this.ID)); + Unread.addPostQuotingYou(this); + return Unread.position != null ? Unread.position : (Unread.position = Unread.order[this.ID]); + }, + + addPostQuotingYou(post) { + for (var quotelink of post.nodes.quotelinks) { + if (QuoteYou.db?.get(Get$1.postDataFromLink(quotelink))) { + Unread.postsQuotingYou.add((Unread.postsQuotingYou.last = post.ID)); + Unread.openNotification(post); + return; + } + } + }, + + openNotification(post, predicate=' replied to you') { + if (!Header$1.areNotificationsEnabled) { return; } + const notif = new Notification(`${post.info.nameBlock}${predicate}`, { + body: post.commentDisplay(), + icon: Favicon.logo + } + ); + notif.onclick = function() { + Header$1.scrollToIfNeeded(post.nodes.bottom, true); + return window.focus(); + }; + return notif.onshow = () => setTimeout(() => notif.close() + , 7 * SECOND); + }, + + onUpdate() { + return $$1.queueTask(function() { // ThreadUpdater may scroll immediately after inserting posts + Unread.setLine(); + Unread.read(); + return Unread.update(); + }); + }, + + readSinglePost(post) { + const {ID} = post; + if (!Unread.posts.has(ID)) { return; } + Unread.posts.delete(ID); + Unread.postsQuotingYou.delete(ID); + Unread.updatePosition(); + Unread.saveLastReadPost(); + return Unread.update(); + }, + + read: debounce(100, function(e) { + // Update the lastReadPost when hidden posts are added to the thread. + if (!Unread.posts.size && (Unread.readCount !== Unread.thread.posts.keys.length)) { + Unread.saveLastReadPost(); + } + + if (d$1.hidden || !Unread.posts.size) { return; } + + let count = 0; + while (Unread.position) { + var {ID, data} = Unread.position; + var {bottom} = data.nodes; + if (!!bottom.getBoundingClientRect().height && // post has been hidden + (Header$1.getBottomOf(bottom) <= -1)) { break; } // post is completely read + count++; + Unread.posts.delete(ID); + Unread.postsQuotingYou.delete(ID); + Unread.position = Unread.position.next; + } + + if (!count) { return; } + Unread.updatePosition(); + Unread.saveLastReadPost(); + if (e) { return Unread.update(); } + }), + + updatePosition() { + while (Unread.position && !Unread.posts.has(Unread.position.ID)) { + Unread.position = Unread.position.next; + } + }, + + saveLastReadPost: debounce(2 * SECOND, function() { + let ID; + $$1.forceSync('Remember Last Read Post'); + if (!Conf['Remember Last Read Post'] || !Unread.db) { return; } + const postIDs = Unread.thread.posts.keys; + for (let i = Unread.readCount, end = postIDs.length; i < end; i++) { + ID = +postIDs[i]; + if (!Unread.thread.posts.get(ID).isFetchedQuote) { + if (Unread.posts.has(ID)) { break; } + Unread.lastReadPost = ID; + } + Unread.readCount++; + } + if (Unread.thread.isDead && !Unread.thread.isArchived) { return; } + return Unread.db.set({ + boardID: Unread.thread.board.ID, + threadID: Unread.thread.ID, + val: Unread.lastReadPost + }); + }), + + setLine(force) { + if (!Conf['Unread Line']) { return; } + if (Unread.hr.hidden || d$1.hidden || (force === true)) { + const oldPosition = Unread.linePosition; + if (Unread.linePosition = Unread.positionPrev()) { + if (Unread.linePosition !== oldPosition) { + let node = Unread.linePosition.data.nodes.bottom; + if (node.nextSibling?.tagName === 'BR') { node = node.nextSibling; } + $$1.after(node, Unread.hr); + } + } else { + $$1.rm(Unread.hr); + } + } + return Unread.hr.hidden = Unread.linePosition === Unread.order.last; + }, + + update() { + const count = Unread.posts.size; + const countQuotingYou = Unread.postsQuotingYou.size; + + if (Conf['Unread Count']) { + const titleQuotingYou = Conf['Quoted Title'] && countQuotingYou ? '(!) ' : ''; + const titleCount = count || !Conf['Hide Unread Count at (0)'] ? `(${count}) ` : ''; + const titleDead = Unread.thread.isDead ? + Unread.title.replace('-', (Unread.thread.isArchived ? '- Archived -' : '- 404 -')) + : + Unread.title; + d$1.title = `${titleQuotingYou}${titleCount}${titleDead}`; + } + + Unread.saveThreadWatcherCount(); + + if (Conf['Unread Favicon'] && (g.SITE.software === 'yotsuba')) { + const {isDead} = Unread.thread; + return Favicon.set(( + countQuotingYou ? + (isDead ? 'unreadDeadY' : 'unreadY') + : count ? + (isDead ? 'unreadDead' : 'unread') + : + (isDead ? 'dead' : 'default') + ) + ); + } + }, + + saveThreadWatcherCount: debounce(2 * SECOND, function() { + $$1.forceSync('Remember Last Read Post'); + if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) { + let posts; + const quotingYou = !Conf['Require OP Quote Link'] && QuoteYou.isYou(Unread.thread.OP) ? Unread.posts : Unread.postsQuotingYou; + if (!quotingYou.size) { + quotingYou.last = 0; + } else if (!quotingYou.has(quotingYou.last)) { + quotingYou.last = 0; + posts = Unread.thread.posts.keys; + for (let i = posts.length - 1; i >= 0; i--) { + if (quotingYou.has(+posts[i])) { + quotingYou.last = posts[i]; + break; + } + } + } + return ThreadWatcher$1.update(g.SITE.ID, Unread.thread.board.ID, Unread.thread.ID, { + last: Unread.thread.lastPost, + isDead: Unread.thread.isDead, + isArchived: Unread.thread.isArchived, + unread: Unread.posts.size, + quotingYou: (quotingYou.last || 0) + } + ); + } + }) + }; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var ExpandThread = { + statuses: dict(), + init() { + if (!((g.VIEW === 'index') && Conf['Thread Expansion'])) { return; } + if (Conf['JSON Index']) { + return $$1.on(d$1, 'IndexRefreshInternal', this.onIndexRefresh); + } else { + return Callbacks.Thread.push({ + name: 'Expand Thread', + cb() { return ExpandThread.setButton(this); } + }); + } + }, + + setButton(thread) { + let a; + if (!(thread.nodes.root && (a = $$1('.summary', thread.nodes.root)))) { return; } + a.textContent = g.SITE.Build.summaryText('+', ...Array.from(a.textContent.match(/\d+/g))); + a.style.cursor = 'pointer'; + return $$1.on(a, 'click', ExpandThread.cbToggle); + }, + + disconnect(refresh) { + if ((g.VIEW === 'thread') || !Conf['Thread Expansion']) { return; } + for (var threadID in ExpandThread.statuses) { + var oldReq; + var status = ExpandThread.statuses[threadID]; + if (oldReq = status.req) { + delete status.req; + oldReq.abort(); + } + delete ExpandThread.statuses[threadID]; + } + + if (!refresh) { return $$1.off(d$1, 'IndexRefreshInternal', this.onIndexRefresh); } + }, + + onIndexRefresh() { + ExpandThread.disconnect(true); + return g.BOARD.threads.forEach(thread => ExpandThread.setButton(thread)); + }, + + cbToggle(e) { + if ($$1.modifiedClick(e)) { return; } + e.preventDefault(); + return ExpandThread.toggle(Get$1.threadFromNode(this)); + }, + + cbToggleBottom(e) { + if ($$1.modifiedClick(e)) { return; } + e.preventDefault(); + const thread = Get$1.threadFromNode(this); + $$1.rm(this); // remove before fixing bottom of thread position + const {bottom} = thread.nodes.root.getBoundingClientRect(); + ExpandThread.toggle(thread); + return window.scrollBy(0, (thread.nodes.root.getBoundingClientRect().bottom - bottom)); + }, + + toggle(thread) { + let a; + if (!(thread.nodes.root && (a = $$1('.summary', thread.nodes.root)))) { return; } + if (thread.ID in ExpandThread.statuses) { + return ExpandThread.contract(thread, a, thread.nodes.root); + } else { + return ExpandThread.expand(thread, a); + } + }, + + expand(thread, a) { + let status; + ExpandThread.statuses[thread] = (status = {}); + a.textContent = g.SITE.Build.summaryText('...', ...Array.from(a.textContent.match(/\d+/g))); + status.req = $$1.cache(g.SITE.urls.threadJSON({boardID: thread.board.ID, threadID: thread.ID}), function() { + if (this !== status.req) { return; } // aborted + delete status.req; + return ExpandThread.parse(this, thread, a); + }); + return status.numReplies = $$(g.SITE.selectors.replyOriginal, thread.nodes.root).length; + }, + + contract(thread, a, threadRoot) { + let oldReq; + const status = ExpandThread.statuses[thread]; + delete ExpandThread.statuses[thread]; + if (oldReq = status.req) { + delete status.req; + oldReq.abort(); + if (a) { a.textContent = g.SITE.Build.summaryText('+', ...Array.from(a.textContent.match(/\d+/g))); } + return; + } + + let replies = $$('.thread > .replyContainer', threadRoot); + if (status.numReplies) { replies = replies.slice(0, (-status.numReplies)); } + let postsCount = 0; + let filesCount = 0; + for (var reply of replies) { + // rm clones + if (Conf['Quote Inlining']) { var inlined; + while ((inlined = $$1('.inlined', reply))) { inlined.click(); } } + postsCount++; + if ('file' in Get$1.postFromRoot(reply)) { filesCount++; } + $$1.rm(reply); + } + if (Index$1.enabled) { // otherwise handled by Main.addPosts + $$1.event('PostsRemoved', null, a.parentNode); + } + a.textContent = g.SITE.Build.summaryText('+', postsCount, filesCount); + return $$1.rm($$1('.summary-bottom', threadRoot)); + }, + + parse(req, thread, a) { + let root; + if (![200, 304].includes(req.status)) { + a.textContent = req.status ? `Error ${req.statusText} (${req.status})` : 'Connection Error'; + return; + } + + g.SITE.Build.spoilerRange[thread.board] = req.response.posts[0].custom_spoiler; + + const posts = []; + const postsRoot = []; + let filesCount = 0; + for (var postData of req.response.posts) { + var post; + if (postData.no === thread.ID) { continue; } + if ((post = thread.posts.get(postData.no)) && !post.isFetchedQuote) { + if ('file' in post) { filesCount++; } + ({root} = post.nodes); + postsRoot.push(root); + continue; + } + root = g.SITE.Build.postFromObject(postData, thread.board.ID); + post = new Post(root, thread, thread.board); + if ('file' in post) { filesCount++; } + posts.push(post); + postsRoot.push(root); + } + Main$1.callbackNodes('Post', posts); + $$1.after(a, postsRoot); + $$1.event('PostsInserted', null, a.parentNode); + + const postsCount = postsRoot.length; + a.textContent = g.SITE.Build.summaryText('-', postsCount, filesCount); + + if (root) { + const a2 = a.cloneNode(true); + a2.classList.add('summary-bottom'); + $$1.on(a2, 'click', ExpandThread.cbToggleBottom); + return $$1.after(root, a2); + } + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS205: Consider reworking code to avoid use of IIFEs + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var UnreadIndex = { + lastReadPost: dict(), + hr: dict(), + markReadLink: dict(), + + init() { + if ((g.VIEW !== 'index') || !Conf['Remember Last Read Post'] || !Conf['Unread Line in Index']) { return; } + + this.enabled = true; + this.db = new DataBoard('lastReadPosts', this.sync); + + Callbacks.Thread.push({ + name: 'Unread Line in Index', + cb: this.node + }); + + $$1.on(d$1, 'IndexRefreshInternal', this.onIndexRefresh); + return $$1.on(d$1, 'PostsInserted PostsRemoved', this.onPostsInserted); + }, + + node() { + UnreadIndex.lastReadPost[this.fullID] = UnreadIndex.db.get({ + boardID: this.board.ID, + threadID: this.ID + }) || 0; + if (!Index$1.enabled) { // let onIndexRefresh handle JSON Index + return UnreadIndex.update(this); + } + }, + + onIndexRefresh(e) { + if (e.detail.isCatalog) { return; } + return (() => { + const result = []; + for (var threadID of e.detail.threadIDs) { + var thread = g.threads.get(threadID); + result.push(UnreadIndex.update(thread)); + } + return result; + })(); + }, + + onPostsInserted(e) { + if (e.target === Index$1.root) { return; } // onIndexRefresh handles this case + const thread = Get$1.threadFromNode(e.target); + if (!thread || (thread.nodes.root !== e.target)) { return; } + const wasVisible = !!UnreadIndex.hr[thread.fullID]?.parentNode; + UnreadIndex.update(thread); + if (Conf['Scroll to Last Read Post'] && (e.type === 'PostsInserted') && !wasVisible && !!UnreadIndex.hr[thread.fullID]?.parentNode) { + return Header$1.scrollToIfNeeded(UnreadIndex.hr[thread.fullID], true); + } + }, + + sync() { + return g.threads.forEach(function(thread) { + const lastReadPost = UnreadIndex.db.get({ + boardID: thread.board.ID, + threadID: thread.ID + }) || 0; + if (lastReadPost !== UnreadIndex.lastReadPost[thread.fullID]) { + UnreadIndex.lastReadPost[thread.fullID] = lastReadPost; + if (thread.nodes.root?.parentNode) { + return UnreadIndex.update(thread); + } + } + }); + }, + + update(thread) { + let divider; + const lastReadPost = UnreadIndex.lastReadPost[thread.fullID]; + let repliesShown = 0; + let repliesRead = 0; + let firstUnread = null; + thread.posts.forEach(function(post) { + if (post.isReply && thread.nodes.root.contains(post.nodes.root)) { + repliesShown++; + if (post.ID <= lastReadPost) { + return repliesRead++; + } else if ((!firstUnread || (post.ID < firstUnread.ID)) && !post.isHidden && !QuoteYou.isYou(post)) { + return firstUnread = post; + } + } + }); + + let hr = UnreadIndex.hr[thread.fullID]; + if (firstUnread && (repliesRead || ((lastReadPost === thread.OP.ID) && (!$$1(g.SITE.selectors.summary, thread.nodes.root) || thread.ID in ExpandThread.statuses)))) { + if (!hr) { + hr = (UnreadIndex.hr[thread.fullID] = $$1.el('hr', + {className: 'unread-line'})); + } + $$1.before(firstUnread.nodes.root, hr); + } else { + $$1.rm(hr); + } + + const hasUnread = repliesShown ? + firstUnread || !repliesRead + : Index$1.enabled ? + thread.lastPost > lastReadPost + : + thread.OP.ID > lastReadPost; + thread.nodes.root.classList.toggle('unread-thread', hasUnread); + + let link = UnreadIndex.markReadLink[thread.fullID]; + if (!link) { + link = (UnreadIndex.markReadLink[thread.fullID] = $$1.el('a', { + className: 'unread-mark-read brackets-wrap', + href: 'javascript:;', + textContent: 'Mark Read' + } + )); + $$1.on(link, 'click', UnreadIndex.markRead); + } + if (divider = $$1(g.SITE.selectors.threadDivider, thread.nodes.root)) { // divider inside thread as in Tinyboard + return $$1.before(divider, link); + } else { + return $$1.add(thread.nodes.root, link); + } + }, + + markRead() { + const thread = Get$1.threadFromNode(this); + UnreadIndex.lastReadPost[thread.fullID] = thread.lastPost; + UnreadIndex.db.set({ + boardID: thread.board.ID, + threadID: thread.ID, + val: thread.lastPost + }); + $$1.rm(UnreadIndex.hr[thread.fullID]); + thread.nodes.root.classList.remove('unread-thread'); + return ThreadWatcher$1.update(g.SITE.ID, thread.board.ID, thread.ID, { + last: thread.lastPost, + unread: 0, + quotingYou: 0 + } + ); + } + }; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * DS104: Avoid inline assignments + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + + var ThreadWatcher = { + init() { + let sc; + if (!(this.enabled = Conf['Thread Watcher'])) { return; } + + this.shortcut = (sc = $$1.el('a', { + id: 'watcher-link', + textContent: '👁︎', + title: 'Thread Watcher', + href: 'javascript:;', + } + )); + + this.db = new DataBoard('watchedThreads', this.refresh, true); + this.dbLM = new DataBoard('watcherLastModified', null, true); + this.dialog = UI.dialog('thread-watcher', { innerHTML: ThreadWatcherPage }); + this.status = $$1('#watcher-status', this.dialog); + this.list = this.dialog.lastElementChild; + this.refreshButton = $$1('.refresh', this.dialog); + this.closeButton = $$1('.move > .close', this.dialog); + this.unreaddb = Unread.db || UnreadIndex.db || new DataBoard('lastReadPosts'); + this.unreadEnabled = Conf['Remember Last Read Post']; + + $$1.on(d$1, 'QRPostSuccessful', this.cb.post); + $$1.on(sc, 'click', this.toggleWatcher); + $$1.on(this.refreshButton, 'click', this.buttonFetchAll); + $$1.on(this.closeButton, 'click', this.toggleWatcher); + + this.menu.addHeaderMenuEntry(); + $$1.onExists(doc$1, 'body', this.addDialog); + + switch (g.VIEW) { + case 'index': + $$1.on(d$1, 'IndexUpdate', this.cb.onIndexUpdate); + break; + case 'thread': + $$1.on(d$1, 'ThreadUpdate', this.cb.onThreadRefresh); + break; + } + + if (Conf['Fixed Thread Watcher']) { + $$1.addClass(doc$1, 'fixed-watcher'); + } + if (!Conf['Persistent Thread Watcher']) { + $$1.addClass(ThreadWatcher.shortcut, 'disabled'); + this.dialog.hidden = true; + } + + Header$1.addShortcut('watcher', sc, 510); + + ThreadWatcher.initLastModified(); + ThreadWatcher.fetchAuto(); + $$1.on(window, 'visibilitychange focus', () => $$1.queueTask(ThreadWatcher.fetchAuto)); + + if (Conf['Menu'] && Index$1.enabled) { + Menu.menu.addEntry({ + el: $$1.el('a', { + href: 'javascript:;', + className: 'has-shortcut-text' + } + , {innerHTML: 'Alt+click'}), + order: 6, + open({thread}) { + if (Conf['Index Mode'] !== 'catalog') { return false; } + this.el.firstElementChild.textContent = ThreadWatcher.isWatched(thread) ? + 'Unwatch' + : + 'Watch'; + if (this.cb) { $$1.off(this.el, 'click', this.cb); } + this.cb = function() { + $$1.event('CloseMenu'); + return ThreadWatcher.toggle(thread); + }; + $$1.on(this.el, 'click', this.cb); + return true; + } + }); + } + + if (!['index', 'thread'].includes(g.VIEW)) { return; } + + Callbacks.Post.push({ + name: 'Thread Watcher', + cb: this.node + }); + return Callbacks.CatalogThread.push({ + name: 'Thread Watcher', + cb: this.catalogNode + }); + }, + + isWatched(thread) { + return !!ThreadWatcher.db?.get({boardID: thread.board.ID, threadID: thread.ID}); + }, + + isWatchedRaw(boardID, threadID) { + return !!ThreadWatcher.db?.get({boardID, threadID}); + }, + + setToggler(toggler, isWatched) { + toggler.classList.toggle('watched', isWatched); + return toggler.title = `${isWatched ? 'Unwatch' : 'Watch'} Thread`; + }, + + node() { + let toggler; + if (this.isReply) { return; } + if (this.isClone) { + toggler = $$1('.watch-thread-link', this.nodes.info); + } else { + toggler = $$1.el('a', { + href: 'javascript:;', + className: 'watch-thread-link' + } + ); + $$1.before($$1('input', this.nodes.info), toggler); + } + const siteID = g.SITE.ID; + const boardID = this.board.ID; + const threadID = this.thread.ID; + const data = ThreadWatcher.db.get({siteID, boardID, threadID}); + ThreadWatcher.setToggler(toggler, !!data); + $$1.on(toggler, 'click', ThreadWatcher.cb.toggle); + // Add missing excerpt for threads added by Auto Watch + if (data && (data.excerpt == null)) { + return $$1.queueTask(() => { + return ThreadWatcher.update(siteID, boardID, threadID, {excerpt: Get$1.threadExcerpt(this.thread)}); + }); + } + }, + + catalogNode() { + if (ThreadWatcher.isWatched(this.thread)) { $$1.addClass(this.nodes.root, 'watched'); } + return $$1.on(this.nodes.root, 'mousedown click', e => { + if ((e.button !== 0) || !e.altKey) { return; } + if (e.type === 'click') { ThreadWatcher.toggle(this.thread); } + return e.preventDefault(); + }); + }, // Also on mousedown to prevent highlighting thumbnail in Firefox. + + addDialog() { + if (!Main$1.isThisPageLegit()) { return; } + ThreadWatcher.build(); + return $$1.prepend(d$1.body, ThreadWatcher.dialog); + }, + + toggleWatcher() { + $$1.toggleClass(ThreadWatcher.shortcut, 'disabled'); + return ThreadWatcher.dialog.hidden = !ThreadWatcher.dialog.hidden; + }, + + cb: { + openAll() { + if ($$1.hasClass(this, 'disabled')) { return; } + for (var a of $$('a.watcher-link', ThreadWatcher.list)) { + $$1.open(a.href); + } + return $$1.event('CloseMenu'); + }, + openUnread() { + if ($$1.hasClass(this, 'disabled')) { return; } + for (var a of $$('.replies-unread > a.watcher-link', ThreadWatcher.list)) { + $$1.open(a.href); + } + return $$1.event('CloseMenu'); + }, + openDeads() { + if ($$1.hasClass(this, 'disabled')) { return; } + for (var a of $$('.dead-thread > a.watcher-link', ThreadWatcher.list)) { + $$1.open(a.href); + } + return $$1.event('CloseMenu'); + }, + pruneDeads() { + if ($$1.hasClass(this, 'disabled')) { return; } + for (var {siteID, boardID, threadID, data} of ThreadWatcher.getAll()) { + if (data.isDead) { + ThreadWatcher.db.delete({siteID, boardID, threadID}); + } + } + ThreadWatcher.refresh(); + return $$1.event('CloseMenu'); + }, + dismiss() { + for (var {siteID, boardID, threadID, data} of ThreadWatcher.getAll()) { + if (data.quotingYou) { + ThreadWatcher.update(siteID, boardID, threadID, {dismiss: data.quotingYou || 0}); + } + } + return $$1.event('CloseMenu'); + }, + toggle() { + const {thread} = Get$1.postFromNode(this); + return ThreadWatcher.toggle(thread); + }, + rm() { + const {siteID} = this.parentNode.dataset; + const [boardID, threadID] = Array.from(this.parentNode.dataset.fullID.split('.')); + return ThreadWatcher.rm(siteID, boardID, +threadID); + }, + post(e) { + const {boardID, threadID, postID} = e.detail; + const cb = PostRedirect.delay(); + if (postID === threadID) { + if (Conf['Auto Watch']) { + return ThreadWatcher.addRaw(boardID, threadID, {}, cb); + } + } else if (Conf['Auto Watch Reply']) { + return ThreadWatcher.add((g.threads.get(boardID + '.' + threadID) || new Thread(threadID, g.boards[boardID] || new Board(boardID))), cb); + } + }, + onIndexUpdate(e) { + const {db} = ThreadWatcher; + const siteID = g.SITE.ID; + const boardID = g.BOARD.ID; + let nKilled = 0; + for (var threadID in db.data[siteID].boards[boardID]) { + // Don't prune threads that have yet to appear in index. + var data = db.data[siteID].boards[boardID][threadID]; + if (!data?.isDead && !e.detail.threads.includes(`${boardID}.${threadID}`)) { + if (!e.detail.threads.some(fullID => +fullID.split('.')[1] > threadID)) { continue; } + if (Conf['Auto Prune'] || !(data && (typeof data === 'object'))) { // corrupt data + db.delete({boardID, threadID}); + nKilled++; + } else { + ThreadWatcher.fetchStatus({siteID, boardID, threadID, data}); + } + } + } + if (nKilled) { return ThreadWatcher.refresh(); } + }, + onThreadRefresh(e) { + const thread = g.threads.get(e.detail.threadID); + if (!e.detail[404] || !ThreadWatcher.isWatched(thread)) { return; } + // Update dead status. + return ThreadWatcher.add(thread); + } + }, + + requests: [], + fetched: 0, + + fetch(url, {siteID, force}, args, cb) { + if (ThreadWatcher.requests.length === 0) { + ThreadWatcher.status.textContent = '...'; + $$1.addClass(ThreadWatcher.refreshButton, 'spin'); + } + const onloadend = function() { + if (this.finished) { return; } + this.finished = true; + ThreadWatcher.fetched++; + if (ThreadWatcher.fetched === ThreadWatcher.requests.length) { + ThreadWatcher.clearRequests(); + } else { + ThreadWatcher.status.textContent = `${Math.round((ThreadWatcher.fetched / ThreadWatcher.requests.length) * 100)}%`; + } + return cb.apply(this, args); + }; + const ajax = siteID === g.SITE.ID ? $$1.ajax : CrossOrigin$1.ajax; + if (force) { + delete $$1.lastModified.ThreadWatcher?.[url]; + } + const req = $$1.whenModified( + url, + 'ThreadWatcher', + onloadend, + { timeout: MINUTE, ajax } + ); + return ThreadWatcher.requests.push(req); + }, + + clearRequests() { + ThreadWatcher.requests = []; + ThreadWatcher.fetched = 0; + ThreadWatcher.status.textContent = ''; + return $$1.rmClass(ThreadWatcher.refreshButton, 'spin'); + }, + + abort() { + delete ThreadWatcher.syncing; + for (var req of ThreadWatcher.requests) { + if (!req.finished) { + req.finished = true; + req.abort(); + } + } + return ThreadWatcher.clearRequests(); + }, + + initLastModified() { + const lm = ($$1.lastModified['ThreadWatcher'] || ($$1.lastModified['ThreadWatcher'] = dict())); + for (var siteID in ThreadWatcher.dbLM.data) { + var boards = ThreadWatcher.dbLM.data[siteID]; + for (var boardID in boards.boards) { + var data = boards.boards[boardID]; + if (ThreadWatcher.db.get({siteID, boardID})) { + for (var url in data) { + var date = data[url]; + lm[url] = date; + } + } else { + ThreadWatcher.dbLM.delete({siteID, boardID}); + } + } + } + }, + + fetchAuto() { + let middle; + clearTimeout(ThreadWatcher.timeout); + if (!Conf['Auto Update Thread Watcher']) { return; } + const {db} = ThreadWatcher; + const interval = Conf['Show Page'] || (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) ? 5 * MINUTE : 2 * HOUR; + const now = Date.now(); + if ((now - interval >= ((middle = db.data.lastChecked || 0)) || middle > now) && !d$1.hidden && !!d$1.hasFocus()) { + ThreadWatcher.fetchAllStatus(interval); + } + return ThreadWatcher.timeout = setTimeout(ThreadWatcher.fetchAuto, interval); + }, + + buttonFetchAll() { + if (ThreadWatcher.syncing || ThreadWatcher.requests.length) { + return ThreadWatcher.abort(); + } else { + return ThreadWatcher.fetchAllStatus(); + } + }, + + fetchAllStatus(interval=0) { + ThreadWatcher.status.textContent = '...'; + $$1.addClass(ThreadWatcher.refreshButton, 'spin'); + ThreadWatcher.syncing = true; + const dbs = [ThreadWatcher.db, ThreadWatcher.unreaddb, QuoteYou.db].filter(x => x); + let n = 0; + return dbs.map((dbi) => + dbi.forceSync(function() { + if ((++n) === dbs.length) { + let middle; + if (!ThreadWatcher.syncing) { return; } // aborted + delete ThreadWatcher.syncing; + if (0 > (middle = Date.now() - (ThreadWatcher.db.data.lastChecked || 0)) || middle >= interval) { // not checked in another tab + // XXX On vichan boards, last_modified field of threads.json does not account for sage posts. + // Occasionally check replies field of catalog.json to find these posts. + let middle1; + const {db} = ThreadWatcher; + const now = Date.now(); + const deep = !(now - (2 * HOUR) < ((middle1 = db.data.lastChecked2 || 0)) && middle1 <= now); + const boards = ThreadWatcher.getAll(true); + for (var board of boards) { + ThreadWatcher.fetchBoard(board, deep); + } + db.setLastChecked(); + if (deep) { db.setLastChecked('lastChecked2'); } + } + if (ThreadWatcher.fetched === ThreadWatcher.requests.length) { + return ThreadWatcher.clearRequests(); + } + } + })); + }, + + fetchBoard(board, deep) { + if (!board.some(thread => !thread.data.isDead)) { return; } + let force = false; + for (var thread of board) { + var {data} = thread; + if (!data.isDead && (data.last !== -1)) { + if (Conf['Show Page'] && (data.page == null)) { force = true; } + if ((data.modified == null)) { force = (thread.force = true); } + } + } + const {siteID, boardID} = board[0]; + const site = g.sites[siteID]; + if (!site) { return; } + const urlF = deep && site.threadModTimeIgnoresSage ? 'catalogJSON' : 'threadsListJSON'; + const url = site.urls[urlF]?.({siteID, boardID}); + if (!url) { return; } + return ThreadWatcher.fetch(url, {siteID, force}, [board, url], ThreadWatcher.parseBoard); + }, + + parseBoard(board, url) { + let page, thread; + if (this.status !== 200) { return; } + const {siteID, boardID} = board[0]; + const lmDate = this.getResponseHeader('Last-Modified'); + ThreadWatcher.dbLM.extend({siteID, boardID, val: $$1.item(url, lmDate)}); + const threads = dict(); + let pageLength = 0; + let nThreads = 0; + let oldest = null; + try { + pageLength = this.response[0]?.threads.length || 0; + for (let i = 0; i < this.response.length; i++) { + page = this.response[i]; + for (var item of page.threads) { + threads[item.no] = { + page: i + 1, + index: nThreads, + modified: item.last_modified, + replies: item.replies + }; + nThreads++; + if ((oldest == null) || (item.no < oldest)) { + oldest = item.no; + } + } + } + } catch (error) { + for (thread of board) { + ThreadWatcher.fetchStatus(thread); + } + } + for (thread of board) { + var {threadID, data} = thread; + if (threads[threadID]) { + var index, modified, replies; + ({page, index, modified, replies} = threads[threadID]); + if (Conf['Show Page']) { + var lastPage = g.sites[siteID].isPrunedByAge?.({siteID, boardID}) ? + threadID === oldest + : + index >= (nThreads - pageLength); + ThreadWatcher.update(siteID, boardID, threadID, {page, lastPage}); + } + if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) { + if ((modified !== data.modified) || ((replies != null) && (replies !== data.replies))) { + (thread.newData || (thread.newData = {})).modified = modified; + ThreadWatcher.fetchStatus(thread); + } + } + } else { + ThreadWatcher.fetchStatus(thread); + } + } + }, + + fetchStatus(thread) { + const {siteID, boardID, threadID, data, force} = thread; + const url = g.sites[siteID]?.urls.threadJSON?.({siteID, boardID, threadID}); + if (!url) { return; } + if (data.isDead && !force) { return; } + if (data.last === -1) { return; } // 404 or no JSON API + return ThreadWatcher.fetch(url, {siteID, force}, [thread], ThreadWatcher.parseStatus); + }, + + parseStatus(thread, isArchiveURL) { + let isDead, last; + let {siteID, boardID, threadID, data, newData, force} = thread; + const site = g.sites[siteID]; + if ((this.status === 200) && this.response) { + let isArchived; + last = this.response.posts[this.response.posts.length-1].no; + const replies = this.response.posts.length-1; + isDead = (isArchived = !!(this.response.posts[0].archived || isArchiveURL)); + if (isDead && Conf['Auto Prune']) { + ThreadWatcher.rm(siteID, boardID, threadID); + return; + } + + if ((last === data.last) && (isDead === data.isDead) && (isArchived === data.isArchived)) { return; } + + const lastReadPost = ThreadWatcher.unreaddb.get({siteID, boardID, threadID, defaultValue: 0}); + let unread = data.unread || 0; + let quotingYou = data.quotingYou || 0; + const youOP = !!QuoteYou.db?.get({siteID, boardID, threadID, postID: threadID}); + + for (var postObj of this.response.posts) { + if ((postObj.no <= (data.last || 0)) || (postObj.no <= lastReadPost)) { continue; } + if (QuoteYou.db?.get({siteID, boardID, threadID, postID: postObj.no})) { continue; } + + var quotesYou = false; + if (!Conf['Require OP Quote Link'] && youOP) { + quotesYou = true; + } else if (QuoteYou.db && postObj.com) { + var match; + var regexp = site.regexp.quotelinkHTML; + regexp.lastIndex = 0; + while (match = regexp.exec(postObj.com)) { + if (QuoteYou.db.get({ + siteID, + boardID: match[1] ? encodeURIComponent(match[1]) : boardID, + threadID: match[2] || threadID, + postID: match[3] || match[2] || threadID + })) { + quotesYou = true; + break; + } + } + } + + if (!unread || (!quotingYou && quotesYou)) { + if (Filter.isHidden(site.Build.parseJSON(postObj, {siteID, boardID}))) { continue; } + } + + unread++; + if (quotesYou) { quotingYou = postObj.no; } + } + + if (!newData) { newData = {}; } + $$1.extend(newData, {last, replies, isDead, isArchived, unread, quotingYou}); + return ThreadWatcher.update(siteID, boardID, threadID, newData); + + } else if (this.status === 404) { + const archiveURL = g.sites[siteID]?.urls.archivedThreadJSON?.({siteID, boardID, threadID}); + if (!isArchiveURL && archiveURL) { + return ThreadWatcher.fetch(archiveURL, {siteID, force}, [thread, true], ThreadWatcher.parseStatus); + } else if (site.mayLackJSON && (data.last == null)) { + return ThreadWatcher.update(siteID, boardID, threadID, {last: -1}); + } else { + return ThreadWatcher.update(siteID, boardID, threadID, {isDead: true}); + } + } + }, + + getAll(groupByBoard) { + const all = []; + for (var siteID in ThreadWatcher.db.data) { + var boards = ThreadWatcher.db.data[siteID]; + for (var boardID in boards.boards) { + var cont; + var threads = boards.boards[boardID]; + if (Conf['Current Board'] && ((siteID !== g.SITE.ID) || (boardID !== g.BOARD.ID))) { + continue; + } + if (groupByBoard) { + all.push((cont = [])); + } + for (var threadID in threads) { + var data = threads[threadID]; + if (data && (typeof data === 'object')) { + (groupByBoard ? cont : all).push({siteID, boardID, threadID, data}); + } + } + } + } + return all; + }, + + makeLine(siteID, boardID, threadID, data) { + let page; + const x = $$1.el('a', { + textContent: '✕', + href: 'javascript:;' + } + ); + $$1.on(x, 'click', ThreadWatcher.cb.rm); + + let {excerpt, isArchived} = data; + if (!excerpt) { excerpt = `/${boardID}/ - No.${threadID}`; } + if (Conf['Show Site Prefix']) { excerpt = ThreadWatcher.prefixes[siteID] + excerpt; } + + const link = $$1.el('a', { + href: g.sites[siteID]?.urls.thread({siteID, boardID, threadID}, isArchived) || '', + title: excerpt, + className: 'watcher-link' + } + ); + + if (Conf['Show Page'] && (data.page != null)) { + page = $$1.el('span', { + textContent: `[${data.page}]`, + className: 'watcher-page' + } + ); + $$1.add(link, page); + } + + if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count'] && (data.unread != null)) { + const count = $$1.el('span', { + textContent: `(${data.unread})`, + className: 'watcher-unread' + } + ); + $$1.add(link, count); + } + + const title = $$1.el('span', { + textContent: excerpt, + className: 'watcher-title' + } + ); + $$1.add(link, title); + + const div = $$1.el('div'); + const fullID = `${boardID}.${threadID}`; + div.dataset.fullID = fullID; + div.dataset.siteID = siteID; + if ((g.VIEW === 'thread') && (fullID === `${g.BOARD}.${g.THREADID}`)) { $$1.addClass(div, 'current'); } + if (data.isDead) { $$1.addClass(div, 'dead-thread'); } + if (Conf['Show Page']) { + if (data.lastPage) { $$1.addClass(div, 'last-page'); } + if (data.page != null) { div.dataset.page = data.page; } + } + if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) { + if (data.unread === 0) { $$1.addClass(div, 'replies-read'); } + if (data.unread) { $$1.addClass(div, 'replies-unread'); } + if ((data.quotingYou || 0) > (data.dismiss || 0)) { $$1.addClass(div, 'replies-quoting-you'); } + } + $$1.add(div, [x, $$1.tn(' '), link]); + return div; + }, + + setPrefixes(threads) { + const prefixes = dict(); + for (var {siteID} of threads) { + if (siteID in prefixes) { continue; } + var len = 0; + var prefix = ''; + var conflicts = Object.keys(prefixes); + while (conflicts.length > 0) { + len++; + prefix = siteID.slice(0, len); + var conflicts2 = []; + for (var siteID2 of conflicts) { + if (siteID2.slice(0, len) === prefix) { + conflicts2.push(siteID2); + } else if (prefixes[siteID2].length < len) { + prefixes[siteID2] = siteID2.slice(0, len); + } + } + conflicts = conflicts2; + } + prefixes[siteID] = prefix; + } + return ThreadWatcher.prefixes = prefixes; + }, + + build() { + const nodes = []; + const threads = ThreadWatcher.getAll(); + ThreadWatcher.setPrefixes(threads); + for (var {siteID, boardID, threadID, data} of threads) { + // Add missing excerpt for threads added by Auto Watch + var thread; + if ((data.excerpt == null) && (siteID === g.SITE.ID) && (thread = g.threads.get(`${boardID}.${threadID}`)) && thread.OP) { + ThreadWatcher.db.extend({boardID, threadID, val: {excerpt: Get$1.threadExcerpt(thread)}}); + } + nodes.push(ThreadWatcher.makeLine(siteID, boardID, threadID, data)); + } + const {list} = ThreadWatcher; + $$1.rmAll(list); + $$1.add(list, nodes); + + return ThreadWatcher.refreshIcon(); + }, + + refresh() { + ThreadWatcher.build(); + + g.threads.forEach(function(thread) { + const isWatched = ThreadWatcher.isWatched(thread); + if (thread.OP) { + for (var post of [thread.OP, ...Array.from(thread.OP.clones)]) { + var toggler; + if (toggler = $$1('.watch-thread-link', post.nodes.info)) { + ThreadWatcher.setToggler(toggler, isWatched); + } + } + } + if (thread.catalogView) { return thread.catalogView.nodes.root.classList.toggle('watched', isWatched); } + }); + + if (Conf['Pin Watched Threads']) { + return $$1.event('SortIndex', {deferred: Conf['Index Mode'] !== 'catalog'}); + } + }, + + refreshIcon() { + for (var className of ['replies-unread', 'replies-quoting-you']) { + ThreadWatcher.shortcut.classList.toggle(className, !!$$1(`.${className}`, ThreadWatcher.dialog)); + } + }, + + update(siteID, boardID, threadID, newData) { + let data, key, line, val; + if (!(data = ThreadWatcher.db?.get({siteID, boardID, threadID}))) { return; } + if (newData.isDead && Conf['Auto Prune']) { + ThreadWatcher.rm(siteID, boardID, threadID); + return; + } + if (newData.isDead || (newData.last === -1)) { + for (key of ['isArchived', 'page', 'lastPage', 'unread', 'quotingyou']) { + if (!(key in newData)) { + newData[key] = undefined; + } + } + } + if ((newData.last != null) && (newData.last < data.last)) { + newData.modified = undefined; + } + let n = 0; + for (key in newData) { val = newData[key]; if (data[key] !== val) { n++; } } + if (!n) { return; } + ThreadWatcher.db.extend({siteID, boardID, threadID, val: newData}); + if (line = $$1(`#watched-threads > [data-site-i-d='${siteID}'][data-full-i-d='${boardID}.${threadID}']`, ThreadWatcher.dialog)) { + const newLine = ThreadWatcher.makeLine(siteID, boardID, threadID, data); + $$1.replace(line, newLine); + return ThreadWatcher.refreshIcon(); + } else { + return ThreadWatcher.refresh(); + } + }, + + set404(boardID, threadID, cb) { + let data; + if (!(data = ThreadWatcher.db?.get({boardID, threadID}))) { return cb(); } + if (Conf['Auto Prune']) { + ThreadWatcher.db.delete({boardID, threadID}); + return cb(); + } + if (data.isDead && !((data.isArchived != null) || (data.page != null) || (data.lastPage != null) || (data.unread != null) || (data.quotingYou != null))) { return cb(); } + return ThreadWatcher.db.extend({boardID, threadID, val: {isDead: true, isArchived: undefined, page: undefined, lastPage: undefined, unread: undefined, quotingYou: undefined}}, cb); + }, + + toggle(thread) { + const siteID = g.SITE.ID; + const boardID = thread.board.ID; + const threadID = thread.ID; + if (ThreadWatcher.db.get({boardID, threadID})) { + return ThreadWatcher.rm(siteID, boardID, threadID); + } else { + return ThreadWatcher.add(thread); + } + }, + + add(thread, cb) { + const data = {}; + const siteID = g.SITE.ID; + const boardID = thread.board.ID; + const threadID = thread.ID; + if (thread.isDead) { + if (Conf['Auto Prune'] && ThreadWatcher.db.get({boardID, threadID})) { + ThreadWatcher.rm(siteID, boardID, threadID, cb); + return; + } + data.isDead = true; + } + if (thread.OP) { data.excerpt = Get$1.threadExcerpt(thread); } + return ThreadWatcher.addRaw(boardID, threadID, data, cb); + }, + + addRaw(boardID, threadID, data, cb) { + const oldData = ThreadWatcher.db.get({ boardID, threadID, defaultValue: dict() }); + delete oldData.last; + delete oldData.modified; + $$1.extend(oldData, data); + ThreadWatcher.db.set({boardID, threadID, val: oldData}, cb); + ThreadWatcher.refresh(); + const thread = {siteID: g.SITE.ID, boardID, threadID, data, force: true}; + if (Conf['Show Page'] && !data.isDead) { + return ThreadWatcher.fetchBoard([thread]); + } else if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) { + return ThreadWatcher.fetchStatus(thread); + } + }, + + rm(siteID, boardID, threadID, cb) { + ThreadWatcher.db.delete({siteID, boardID, threadID}, cb); + return ThreadWatcher.refresh(); + }, + + menu: { + init() { + if (!Conf['Thread Watcher']) { return; } + const menu = (this.menu = new UI.Menu('thread watcher')); + $$1.on($$1('.menu-button', ThreadWatcher.dialog), 'click', function(e) { + return menu.toggle(e, this, ThreadWatcher); + }); + return this.addMenuEntries(); + }, + + addHeaderMenuEntry() { + if (g.VIEW !== 'thread') { return; } + const entryEl = $$1.el('a', + {href: 'javascript:;'}); + Header$1.menu.addEntry({ + el: entryEl, + order: 60, + open() { + const [addClass, rmClass, text] = Array.from(!!ThreadWatcher.db.get({boardID: g.BOARD.ID, threadID: g.THREADID}) ? + ['unwatch-thread', 'watch-thread', 'Unwatch thread'] + : + ['watch-thread', 'unwatch-thread', 'Watch thread']); + $$1.addClass(entryEl, addClass); + $$1.rmClass(entryEl, rmClass); + entryEl.textContent = text; + return true; + } + }); + return $$1.on(entryEl, 'click', () => ThreadWatcher.toggle(g.threads.get(`${g.BOARD}.${g.THREADID}`))); + }, + + addMenuEntries() { + const entries = []; + + // `Open all` entry + entries.push({ + text: 'Open all threads', + cb: ThreadWatcher.cb.openAll, + open() { + this.el.classList.toggle('disabled', !ThreadWatcher.list.firstElementChild); + return true; + } + }); + + // `Open Unread` entry + entries.push({ + text: 'Open unread threads', + cb: ThreadWatcher.cb.openUnread, + open() { + this.el.classList.toggle('disabled', !$$1('.replies-unread', ThreadWatcher.list)); + return true; + } + }); + + // `Open dead threads` entry + entries.push({ + text: 'Open dead threads', + cb: ThreadWatcher.cb.openDeads, + open() { + this.el.classList.toggle('disabled', !$$1('.dead-thread', ThreadWatcher.list)); + return true; + } + }); + + // `Prune dead threads` entry + entries.push({ + text: 'Prune dead threads', + cb: ThreadWatcher.cb.pruneDeads, + open() { + this.el.classList.toggle('disabled', !$$1('.dead-thread', ThreadWatcher.list)); + return true; + } + }); + + // `Dismiss posts quoting you` entry + entries.push({ + text: 'Dismiss posts quoting you', + title: 'Unhighlight the thread watcher icon and threads until there are new replies quoting you.', + cb: ThreadWatcher.cb.dismiss, + open() { + this.el.classList.toggle('disabled', !$$1.hasClass(ThreadWatcher.shortcut, 'replies-quoting-you')); + return true; + } + }); + + for (var {text, title, cb, open} of entries) { + var entry = { + el: $$1.el('a', { + textContent: text, + href: 'javascript:;' + } + ) + }; + if (title) { entry.el.title = title; } + $$1.on(entry.el, 'click', cb); + entry.open = open.bind(entry); + this.menu.addEntry(entry); + } + + // Settings checkbox entries: + for (var name in Config.threadWatcher) { + var conf = Config.threadWatcher[name]; + this.addCheckbox(name, conf[1]); + } + + }, + + addCheckbox(name, desc) { + const entry = { + type: 'thread watcher', + el: UI.checkbox(name, name.replace(' Thread Watcher', '')) + }; + entry.el.title = desc; + const input = entry.el.firstElementChild; + if ((name === 'Show Unread Count') && !ThreadWatcher.unreadEnabled) { + input.disabled = true; + $$1.addClass(entry.el, 'disabled'); + entry.el.title += '\n[Remember Last Read Post is disabled.]'; + } + $$1.on(input, 'change', $$1.cb.checked); + if (['Current Board', 'Show Page', 'Show Unread Count', 'Show Site Prefix'].includes(name)) { $$1.on(input, 'change', ThreadWatcher.refresh); } + if (['Show Page', 'Show Unread Count', 'Auto Update Thread Watcher'].includes(name)) { $$1.on(input, 'change', ThreadWatcher.fetchAuto); } + return this.menu.addEntry(entry); + } + } + }; + var ThreadWatcher$1 = ThreadWatcher; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * DS205: Consider reworking code to avoid use of IIFEs + * DS206: Consider reworking classes to avoid initClass + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + class Fetcher { + static initClass() { + + this.prototype.archiveTags = { + '\n': {innerHTML: "
        "}, + '[b]': {innerHTML: ""}, + '[/b]': {innerHTML: ""}, + '[spoiler]': {innerHTML: ""}, + '[/spoiler]': {innerHTML: ""}, + '[code]': {innerHTML: "
        "},
        +        '[/code]':    {innerHTML: "
        "}, + '[moot]': {innerHTML: "
        "}, + '[/moot]': {innerHTML: "
        "}, + '[banned]': {innerHTML: ""}, + '[/banned]': {innerHTML: ""}, + '[fortune]'(text) { return {innerHTML: ""}; }, + '[/fortune]': {innerHTML: ""}, + '[i]': {innerHTML: ""}, + '[/i]': {innerHTML: ""}, + '[red]': {innerHTML: ""}, + '[/red]': {innerHTML: ""}, + '[green]': {innerHTML: ""}, + '[/green]': {innerHTML: ""}, + '[blue]': {innerHTML: ""}, + '[/blue]': {innerHTML: ""} + }; + } + constructor(boardID, threadID, postID, root, quoter) { + let post, thread; + this.boardID = boardID; + this.threadID = threadID; + this.postID = postID; + this.root = root; + this.quoter = quoter; + if (post = g.posts.get(`${this.boardID}.${this.postID}`)) { + this.insert(post); + return; + } + + // 4chan X catalog data + if ((post = Index$1.replyData?.[`${this.boardID}.${this.postID}`]) && (thread = g.threads.get(`${this.boardID}.${this.threadID}`))) { + const board = g.boards[this.boardID]; + post = new Post(g.SITE.Build.postFromObject(post, this.boardID), thread, board, {isFetchedQuote: true}); + Main$1.callbackNodes('Post', [post]); + this.insert(post); + return; + } + + this.root.textContent = `Loading post No.${this.postID}...`; + if (this.threadID) { + const that = this; + $$1.cache(g.SITE.urls.threadJSON({boardID: this.boardID, threadID: this.threadID}), function({isCached}) { + return that.fetchedPost(this, isCached); + }); + } else { + this.archivedPost(); + } + } + + insert(post) { + // Stop here if the container has been removed while loading. + if (!this.root.parentNode) { return; } + if (!this.quoter) { this.quoter = post; } + const clone = post.addClone(this.quoter.context, ($$1.hasClass(this.root, 'dialog'))); + Main$1.callbackNodes('Post', [clone]); + + // Get rid of the side arrows/stubs. + const {nodes} = clone; + $$1.rmAll(nodes.root); + $$1.add(nodes.root, nodes.post); + + // Indicate links to the containing post. + const quotes = [...clone.nodes.quotelinks, ...clone.nodes.backlinks]; + for (var quote of quotes) { + var {boardID, postID} = Get$1.postDataFromLink(quote); + if ((postID === this.quoter.ID) && (boardID === this.quoter.board.ID)) { + $$1.addClass(quote, 'forwardlink'); + } + } + + // Set up flag CSS for cross-board links to boards with flags + if (clone.nodes.flag && !(Fetcher.flagCSS || (Fetcher.flagCSS = $$1('link[href^="//s.4cdn.org/css/flags."]')))) { + const cssVersion = $$1('link[href^="//s.4cdn.org/css/"]')?.href.match(/\d+(?=\.css$)|$/)[0] || Date.now(); + Fetcher.flagCSS = $$1.el('link', { + rel: 'stylesheet', + href: `//s.4cdn.org/css/flags.${cssVersion}.css` + } + ); + $$1.add(d$1.head, Fetcher.flagCSS); + } + + $$1.rmAll(this.root); + $$1.add(this.root, nodes.root); + return $$1.event('PostsInserted', null, this.root); + } + + fetchedPost(req, isCached) { + // In case of multiple callbacks for the same request, + // don't parse the same original post more than once. + let post; + if (post = g.posts.get(`${this.boardID}.${this.postID}`)) { + this.insert(post); + return; + } + + const {status} = req; + if (status !== 200) { + // The thread can die by the time we check a quote. + if (status && this.archivedPost()) { return; } + + $$1.addClass(this.root, 'warning'); + this.root.textContent = + status === 404 ? + `Thread No.${this.threadID} 404'd.` + : !status ? + 'Connection Error' + : + `Error ${req.statusText} (${req.status}).`; + return; + } + + const {posts} = req.response; + g.SITE.Build.spoilerRange[this.boardID] = posts[0].custom_spoiler; + for (post of posts) { + if (post.no === this.postID) { break; } + } // we found it! + + if (post.no !== this.postID) { + // Cached requests can be stale and must be rechecked. + if (isCached) { + const api = g.SITE.urls.threadJSON({boardID: this.boardID, threadID: this.threadID}); + $$1.cleanCache(url => url === api); + const that = this; + $$1.cache(api, function() { + return that.fetchedPost(this, false); + }); + return; + } + + // The post can be deleted by the time we check a quote. + if (this.archivedPost()) { return; } + + $$1.addClass(this.root, 'warning'); + this.root.textContent = `Post No.${this.postID} was not found.`; + return; + } + + const board = g.boards[this.boardID] || + new Board(this.boardID); + const thread = g.threads.get(`${this.boardID}.${this.threadID}`) || + new Thread(this.threadID, board); + post = new Post(g.SITE.Build.postFromObject(post, this.boardID), thread, board, {isFetchedQuote: true}); + Main$1.callbackNodes('Post', [post]); + return this.insert(post); + } + + archivedPost() { + let url; + if (!Conf['Resurrect Quotes']) { return false; } + if (!(url = Redirect$1.to('post', {boardID: this.boardID, postID: this.postID}))) { return false; } + const archive = Redirect$1.data.post[this.boardID]; + const encryptionOK = /^https:\/\//.test(url) || (location.protocol === 'http:'); + if (encryptionOK || Conf['Exempt Archives from Encryption']) { + const that = this; + CrossOrigin$1.cache(url, function() { + if (!encryptionOK && this.response?.media) { + const {media} = this.response; + for (var key in media) { + // Image/thumbnail URLs loaded over HTTP can be modified in transit. + // Require them to be from an HTTP host so that no referrer is sent to them from an HTTPS page. + if (/_link$/.test(key)) { + if (!$$1.getOwn(media, key)?.match(/^http:\/\//)) { delete media[key]; } + } + } + } + return that.parseArchivedPost(this.response, url, archive); + }); + return true; + } + return false; + } + + parseArchivedPost(data, url, archive) { + // In case of multiple callbacks for the same request, + // don't parse the same original post more than once. + let post; + if (post = g.posts.get(`${this.boardID}.${this.postID}`)) { + this.insert(post); + return; + } + + if (data == null) { + $$1.addClass(this.root, 'warning'); + this.root.textContent = `Error fetching Post No.${this.postID} from ${archive.name}.`; + return; + } + + if (data.error) { + $$1.addClass(this.root, 'warning'); + this.root.textContent = data.error; + return; + } + + // https://github.com/eksopl/asagi/blob/v0.4.0b74/src/main/java/net/easymodo/asagi/YotsubaAbstract.java#L82-L129 + // https://github.com/FoolCode/FoolFuuka/blob/800bd090835489e7e24371186db6e336f04b85c0/src/Model/Comment.php#L368-L428 + // https://github.com/bstats/b-stats/blob/6abe7bffaf6e5f523498d760e54b110df5331fbb/inc/classes/Yotsuba.php#L157-L168 + let comment = (data.comment || '').split(/(\n|\[\/?(?:b|spoiler|code|moot|banned|fortune(?: color="#\w+")?|i|red|green|blue)\])/); + comment = (() => { + const result = []; + for (let i = 0; i < comment.length; i++) { + var text = comment[i]; + if ((i % 2) === 1) { + var tag = Fetcher.archiveTags[text.replace(/\ .*\]/, ']')]; + if (typeof tag === 'function') { result.push(tag(text)); } else { result.push(tag); } + } else { + var greentext = text[0] === '>'; + text = text.replace(/(\[\/?[a-z]+):lit(\])/g, '$1$2'); + text = text.split(/(>>(?:>\/[a-z\d]+\/)?\d+)/g).map((text2, j) => + {((j % 2) ? "" + E(text2) + "" : E(text2));}); + text = {innerHTML: ((greentext) ? "" + E.cat(text) + "" : E.cat(text))}; + result.push(text); + } + } + return result; + })(); + comment = {innerHTML: E.cat(comment)}; + + this.threadID = +data.thread_num; + const o = { + ID: this.postID, + threadID: this.threadID, + boardID: this.boardID, + isReply: this.postID !== this.threadID + }; + o.info = { + subject: data.title, + email: data.email, + name: data.name || '', + tripcode: data.trip, + capcode: (() => { switch (data.capcode) { + // https://github.com/pleebe/FoolFuuka/blob/bf4224eed04637a4d0bd4411c2bf5f9945dfec0b/assets/themes/foolz/foolfuuka-theme-fuuka/src/Partial/Board.php#L77 + case 'M': return 'Mod'; + case 'A': return 'Admin'; + case 'D': return 'Developer'; + case 'V': return 'Verified'; + case 'F': return 'Founder'; + case 'G': return 'Manager'; + } })(), + uniqueID: data.poster_hash, + flagCode: data.poster_country, + flagCodeTroll: data.troll_country_code, + flag: data.poster_country_name || data.troll_country_name, + dateUTC: data.timestamp, + dateText: data.fourchan_date, + commentHTML: comment + }; + if (o.info.capcode) { delete o.info.uniqueID; } + if (data.media && !!+data.media.banned) { + o.fileDeleted = true; + } else if (data.media?.media_filename) { + let {thumb_link} = data.media; + // Fix URLs missing origin + if (thumb_link?.[0] === '/') { thumb_link = url.split('/', 3).join('/') + thumb_link; } + if (!Redirect$1.securityCheck(thumb_link)) { thumb_link = ''; } + let media_link = Redirect$1.to('file', {boardID: this.boardID, filename: data.media.media_orig}); + if (!Redirect$1.securityCheck(media_link)) { media_link = ''; } + o.file = { + name: data.media.media_filename, + url: media_link || + (this.boardID === 'f' ? + `${location.protocol}//${ImageHost.flashHost()}/${this.boardID}/${encodeURIComponent(E(data.media.media_filename))}` + : + `${location.protocol}//${ImageHost.host()}/${this.boardID}/${data.media.media_orig}`), + height: data.media.media_h, + width: data.media.media_w, + MD5: data.media.media_hash, + size: $$1.bytesToString(data.media.media_size), + thumbURL: thumb_link || `${location.protocol}//${ImageHost.thumbHost()}/${this.boardID}/${data.media.preview_orig}`, + theight: data.media.preview_h, + twidth: data.media.preview_w, + isSpoiler: data.media.spoiler === '1' + }; + if (!/\.pdf$/.test(o.file.url)) { o.file.dimensions = `${o.file.width}x${o.file.height}`; } + if ((this.boardID === 'f') && data.media.exif) { o.file.tag = JSON.parse(data.media.exif).Tag; } + } + o.extra = dict(); + + const board = g.boards[this.boardID] || + new Board(this.boardID); + const thread = g.threads.get(`${this.boardID}.${this.threadID}`) || + new Thread(this.threadID, board); + post = new Post(g.SITE.Build.post(o), thread, board, {isFetchedQuote: true}); + post.kill(); + if (post.file) { post.file.thumbURL = o.file.thumbURL; } + Main$1.callbackNodes('Post', [post]); + return this.insert(post); + } + } + Fetcher.initClass(); + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var QuotePreview = { + init() { + if (!Conf['Quote Previewing']) { return; } + + if (g.VIEW === 'archive') { + $$1.on(d$1, 'mouseover', function(e) { + if ((e.target.nodeName === 'A') && $$1.hasClass(e.target, 'quotelink')) { + return QuotePreview.mouseover.call(e.target, e); + } + }); + } + + if (!['index', 'thread'].includes(g.VIEW)) { return; } + + if (Conf['Comment Expansion']) { + ExpandComment.callbacks.push(this.node); + } + + return Callbacks.Post.push({ + name: 'Quote Previewing', + cb: this.node + }); + }, + + node() { + for (var link of this.nodes.quotelinks.concat([...Array.from(this.nodes.backlinks)], this.nodes.archivelinks)) { + $$1.on(link, 'mouseover', QuotePreview.mouseover); + } + }, + + mouseover(e) { + let origin; + if (($$1.hasClass(this, 'inlined') && !$$1.hasClass(doc, 'catalog-mode')) || !d$1.contains(this)) { return; } + + const {boardID, threadID, postID} = Get$1.postDataFromLink(this); + + const qp = $$1.el('div', { + id: 'qp', + className: 'dialog' + } + ); + + $$1.add(Header$1.hover, qp); + new Fetcher(boardID, threadID, postID, qp, Get$1.postFromNode(this)); + + UI.hover({ + root: this, + el: qp, + latestEvent: e, + endEvents: 'mouseout click', + cb: QuotePreview.mouseout + }); + + if (Conf['Quote Highlighting'] && (origin = g.posts.get(`${boardID}.${postID}`))) { + const posts = [origin].concat(origin.clones); + // Remove the clone that's in the qp from the array. + posts.pop(); + for (var post of posts) { + $$1.addClass(post.nodes.post, 'qphl'); + } + } + }, + + mouseout() { + // Stop if it only contains text. + let root; + if (!(root = this.el.firstElementChild)) { return; } + + $$1.event('PostsRemoved', null, Header$1.hover); + + const clone = Get$1.postFromRoot(root); + let post = clone.origin; + post.rmClone(root.dataset.clone); + + if (!Conf['Quote Highlighting']) { return; } + for (post of [post].concat(post.clones)) { + $$1.rmClass(post.nodes.post, 'qphl'); + } + } + }; + + var NavLinksPage = `Index +Catalog +Archive +Bottom + + +× + + + + + + + + +`; + + var PageList = ` +
        + + +`; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * DS205: Consider reworking code to avoid use of IIFEs + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + + var Index = { + showHiddenThreads: false, + changed: {}, + + enabledOn({siteID, boardID}) { + return Conf['JSON Index'] && (g.sites[siteID].software === 'yotsuba') && (boardID !== 'f'); + }, + + init() { + let input, inputs, name; + if (g.VIEW !== 'index') { return; } + + // For IndexRefresh events + $$1.one(d$1, '4chanXInitFinished', this.cb.initFinished); + $$1.on(d$1, 'PostsInserted', this.cb.postsInserted); + + if (!this.enabledOn(g.BOARD)) { return; } + + this.enabled = true; + + Callbacks.Post.push({ + name: 'Index Page Numbers', + cb: this.node + }); + Callbacks.CatalogThread.push({ + name: 'Catalog Features', + cb: this.catalogNode + }); + + this.search = history.state?.searched || ''; + if (history.state?.mode) { + Conf['Index Mode'] = history.state?.mode; + } + this.currentSort = history.state?.sort; + if (!this.currentSort) { this.currentSort = typeof Conf['Index Sort'] === 'object' ? ( + Conf['Index Sort'][g.BOARD.ID] || 'bump' + ) : ( + Conf['Index Sort'] + ); } + this.currentPage = this.getCurrentPage(); + this.processHash(); + + $$1.addClass(doc$1, 'index-loading', `${Conf['Index Mode'].replace(/\ /g, '-')}-mode`); + $$1.on(window, 'popstate', this.cb.popstate); + $$1.on(d$1, 'scroll', this.scroll); + $$1.on(d$1, 'SortIndex', this.cb.resort); + + // Header refresh button + this.button = $$1.el('a', { + title: 'Refresh', + href: 'javascript:;', + textContent: '🗘' + } + ); + $$1.on(this.button, 'click', () => Index.update()); + Header$1.addShortcut('index-refresh', this.button, 590); + + // Header "Index Navigation" submenu + const entries = []; + this.inputs = (inputs = dict()); + for (name in Config.Index) { + var arr = Config.Index[name]; + if (arr instanceof Array) { + var label = UI.checkbox(name, `${name[0]}${name.slice(1).toLowerCase()}`); + label.title = arr[1]; + entries.push({el: label}); + input = label.firstChild; + $$1.on(input, 'change', $$1.cb.checked); + inputs[name] = input; + } + } + $$1.on(inputs['Show Replies'], 'change', this.cb.replies); + $$1.on(inputs['Catalog Hover Expand'], 'change', this.cb.hover); + $$1.on(inputs['Pin Watched Threads'], 'change', this.cb.resort); + $$1.on(inputs['Anchor Hidden Threads'], 'change', this.cb.resort); + + const watchSettings = function(e) { + if (input = $$1.getOwn(inputs, e.target.name)) { + input.checked = e.target.checked; + return $$1.event('change', null, input); + } + }; + $$1.on(d$1, 'OpenSettings', () => $$1.on($$1.id('fourchanx-settings'), 'change', watchSettings)); + + const sortEntry = UI.checkbox('Per-Board Sort Type', 'Per-board sort type', (typeof Conf['Index Sort'] === 'object')); + sortEntry.title = 'Set the sorting order of each board independently.'; + $$1.on(sortEntry.firstChild, 'change', this.cb.perBoardSort); + entries.splice(3, 0, {el: sortEntry}); + + Header$1.menu.addEntry({ + el: $$1.el('span', + {textContent: 'Index Navigation'}), + order: 100, + subEntries: entries + }); + + // Navigation links at top of index + this.navLinks = $$1.el('div', {className: 'navLinks json-index'}); + $$1.extend(this.navLinks, {innerHTML: NavLinksPage}); + $$1('.cataloglink a', this.navLinks).href = CatalogLinks.catalog(); + if (!BoardConfig.isArchived(g.BOARD.ID)) { $$1('.archlistlink', this.navLinks).hidden = true; } + $$1.on($$1('#index-last-refresh a', this.navLinks), 'click', this.cb.refreshFront); + + // Search field + this.searchInput = $$1('#index-search', this.navLinks); + this.setupSearch(); + $$1.on(this.searchInput, 'input', this.onSearchInput); + $$1.on($$1('#index-search-clear', this.navLinks), 'click', this.clearSearch); + + // Hidden threads toggle + this.hideLabel = $$1('#hidden-label', this.navLinks); + $$1.on($$1('#hidden-toggle a', this.navLinks), 'click', this.cb.toggleHiddenThreads); + + // Drop-down menus and reverse sort toggle + this.selectRev = $$1('#index-rev', this.navLinks); + this.selectMode = $$1('#index-mode', this.navLinks); + this.selectSort = $$1('#index-sort', this.navLinks); + this.selectSize = $$1('#index-size', this.navLinks); + $$1.on(this.selectRev, 'change', this.cb.sort); + $$1.on(this.selectMode, 'change', this.cb.mode); + $$1.on(this.selectSort, 'change', this.cb.sort); + $$1.on(this.selectSize, 'change', $$1.cb.value); + $$1.on(this.selectSize, 'change', this.cb.size); + for (var select of [this.selectMode, this.selectSize]) { + select.value = Conf[select.name]; + } + this.selectRev.checked = /-rev$/.test(Index.currentSort); + this.selectSort.value = Index.currentSort.replace(/-rev$/, ''); + + // Last Long Reply options + this.lastLongOptions = $$1('#lastlong-options', this.navLinks); + this.lastLongInputs = $$('input', this.lastLongOptions); + this.lastLongThresholds = [0, 0]; + this.lastLongOptions.hidden = (this.selectSort.value !== 'lastlong'); + for (let i = 0; i < this.lastLongInputs.length; i++) { + input = this.lastLongInputs[i]; + $$1.on(input, 'change', this.cb.lastLongThresholds); + var tRaw = Conf[`Last Long Reply Thresholds ${i}`]; + input.value = (this.lastLongThresholds[i] = + typeof tRaw === 'object' ? (tRaw[g.BOARD.ID] ?? 100) : tRaw); + } + + // Thread container + this.root = $$1.el('div', {className: 'board json-index'}); + $$1.on(this.root, 'click', this.cb.hoverToggle); + this.cb.size(); + this.cb.hover(); + + // Page list + this.pagelist = $$1.el('div', {className: 'pagelist json-index'}); + $$1.extend(this.pagelist, {innerHTML: PageList}); + $$1('.cataloglink a', this.pagelist).href = CatalogLinks.catalog(); + $$1.on(this.pagelist, 'click', this.cb.pageNav); + + this.update(true); + + $$1.onExists(doc$1, 'title + *', () => d$1.title = d$1.title.replace(/\ -\ Page\ \d+/, '')); + + $$1.onExists(doc$1, '.board > .thread > .postContainer, .board + *', function() { + let el; + g.SITE.Build.hat = $$1('.board > .thread > img:first-child'); + if (g.SITE.Build.hat) { + g.BOARD.threads.forEach(function(thread) { + if (thread.nodes.root) { + return $$1.prepend(thread.nodes.root, g.SITE.Build.hat.cloneNode(false)); + } + }); + $$1.addClass(doc$1, 'hats-enabled'); + $$1.addStyle(`.catalog-thread::after {background-image: url(${g.SITE.Build.hat.src});}`); + } + + const board = $$1('.board'); + $$1.replace(board, Index.root); + if (Index.loaded) { + $$1.event('PostsInserted', null, Index.root); + } + // Hacks: + // - When removing an element from the document during page load, + // its ancestors will still be correctly created inside of it. + // - Creating loadable elements inside of an origin-less document + // will not download them. + // - Combine the two and you get a download canceller! + // Does not work on Firefox unfortunately. bugzil.la/939713 + try { + d$1.implementation.createDocument(null, null, null).appendChild(board); + } catch (error) {} + + for (el of $$('.navLinks')) { $$1.rm(el); } + $$1.rm($$1.id('ctrl-top')); + const topNavPos = $$1.id('delform').previousElementSibling; + $$1.before(topNavPos, $$1.el('hr')); + $$1.before(topNavPos, Index.navLinks); + const timeEl = $$1('#index-last-refresh time', Index.navLinks); + if (timeEl.dataset.utc) { return RelativeDates.update(timeEl); } + }); + + return Main$1.ready(function() { + let pagelist; + if (pagelist = $$1('.pagelist')) { + $$1.replace(pagelist, Index.pagelist); + } + return $$1.rmClass(doc$1, 'index-loading'); + }); + }, + + scroll() { + if (Index.req || !Index.liveThreadData || (Conf['Index Mode'] !== 'infinite') || (window.scrollY <= (doc$1.scrollHeight - (300 + window.innerHeight)))) { return; } + if (Index.pageNum == null) { Index.pageNum = Index.currentPage; } // Avoid having to pushState to keep track of the current page + + const pageNum = ++Index.pageNum; + if (pageNum > Index.pagesNum) { return Index.endNotice(); } + + const threadIDs = Index.threadsOnPage(pageNum); + return Index.buildStructure(threadIDs); + }, + + endNotice: (function() { + let notify = false; + const reset = () => notify = false; + return function() { + if (notify) { return; } + notify = true; + new Notice('info', "Last page reached.", 2); + return setTimeout(reset, 3 * SECOND); + }; + })(), + + menu: { + init() { + if ((g.VIEW !== 'index') || !Conf['Menu'] || !Conf['Thread Hiding Link'] || !Index.enabledOn(g.BOARD)) { return; } + + return Menu.menu.addEntry({ + el: $$1.el('a', { + href: 'javascript:;', + className: 'has-shortcut-text' + } + , {innerHTML: "Shift+click"}), + order: 20, + open({thread}) { + if (Conf['Index Mode'] !== 'catalog') { return false; } + this.el.firstElementChild.textContent = thread.isHidden ? + 'Unhide' + : + 'Hide'; + if (this.cb) { $$1.off(this.el, 'click', this.cb); } + this.cb = function() { + $$1.event('CloseMenu'); + return Index.toggleHide(thread); + }; + $$1.on(this.el, 'click', this.cb); + return true; + } + }); + } + }, + + node() { + if (this.isReply || this.isClone || (Index.threadPosition[this.ID] == null)) { return; } + return this.thread.setPage(Math.floor(Index.threadPosition[this.ID] / Index.threadsNumPerPage) + 1); + }, + + catalogNode() { + return $$1.on(this.nodes.root, 'mousedown click', e => { + if ((e.button !== 0) || !e.shiftKey) { return; } + if (e.type === 'click') { Index.toggleHide(this.thread); } + return e.preventDefault(); + }); + }, // Also on mousedown to prevent highlighting text. + + toggleHide(thread) { + if (Index.showHiddenThreads) { + ThreadHiding.show(thread); + if (!ThreadHiding.db.get({boardID: thread.board.ID, threadID: thread.ID})) { return; } + // Don't save when un-hiding filtered threads. + } else { + ThreadHiding.hide(thread); + } + return ThreadHiding.saveHiddenState(thread); + }, + + cycleSortType() { + let i; + const types = [...Array.from(Index.selectSort.options)].filter(option => !option.disabled); + for (i = 0; i < types.length; i++) { + var type = types[i]; + if (type.selected) { break; } + } + types[(i + 1) % types.length].selected = true; + return $$1.event('change', null, Index.selectSort); + }, + + cb: { + initFinished() { + Index.initFinishedFired = true; + return $$1.queueTask(() => Index.cb.postsInserted()); + }, + + postsInserted() { + if (!Index.initFinishedFired) { return; } + let n = 0; + g.posts.forEach(function(post) { + if (!post.isFetchedQuote && !post.indexRefreshSeen && doc$1.contains(post.nodes.root)) { + post.indexRefreshSeen = true; + return n++; + } + }); + if (n) { return $$1.event('IndexRefresh'); } + }, + + toggleHiddenThreads() { + $$1('#hidden-toggle a', Index.navLinks).textContent = (Index.showHiddenThreads = !Index.showHiddenThreads) ? + 'Hide' + : + 'Show'; + Index.sort(); + return Index.buildIndex(); + }, + + mode() { + Index.pushState({mode: this.value}); + return Index.pageLoad(false); + }, + + sort() { + const value = Index.selectRev.checked ? Index.selectSort.value + "-rev" : Index.selectSort.value; + Index.pushState({sort: value}); + return Index.pageLoad(false); + }, + + resort(e) { + Index.changed.order = true; + if (!e?.detail?.deferred) { return Index.pageLoad(false); } + }, + + perBoardSort() { + Conf['Index Sort'] = this.checked ? dict() : ''; + Index.saveSort(); + for (let i = 0; i < 2; i++) { + Conf[`Last Long Reply Thresholds ${i}`] = this.checked ? dict() : ''; + Index.saveLastLongThresholds(i); + } + }, + + lastLongThresholds() { + const i = [...Array.from(this.parentNode.children)].indexOf(this); + const value = +this.value; + if (!Number.isFinite(value)) { + this.value = Index.lastLongThresholds[i]; + return; + } + Index.lastLongThresholds[i] = value; + Index.saveLastLongThresholds(i); + Index.changed.order = true; + return Index.pageLoad(false); + }, + + size(e) { + if (Conf['Index Mode'] !== 'catalog') { + $$1.rmClass(Index.root, 'catalog-small'); + $$1.rmClass(Index.root, 'catalog-large'); + } else if (Conf['Index Size'] === 'small') { + $$1.addClass(Index.root, 'catalog-small'); + $$1.rmClass(Index.root, 'catalog-large'); + } else { + $$1.addClass(Index.root, 'catalog-large'); + $$1.rmClass(Index.root, 'catalog-small'); + } + if (e) { return Index.buildIndex(); } + }, + + replies() { + return Index.buildIndex(); + }, + + hover() { + return doc$1.classList.toggle('catalog-hover-expand', Conf['Catalog Hover Expand']); + }, + + hoverToggle(e) { + if (Conf['Catalog Hover Toggle'] && $$1.hasClass(doc$1, 'catalog-mode') && !$$1.modifiedClick(e) && !$$1.x('ancestor-or-self::a', e.target)) { + let thread; + const input = Index.inputs['Catalog Hover Expand']; + input.checked = !input.checked; + $$1.event('change', null, input); + if (thread = Get$1.threadFromNode(e.target)) { + Index.cb.catalogReplies.call(thread); + return Index.cb.hoverAdjust.call(thread.OP.nodes); + } + } + }, + + popstate(e) { + if (e?.state) { + const {searched, mode, sort} = e.state; + const page = Index.getCurrentPage(); + Index.setState({search: searched, mode, sort, page}); + return Index.pageLoad(false); + } else { + // page load or hash change + const nCommands = Index.processHash(); + if (Conf['Refreshed Navigation'] && nCommands) { + return Index.update(); + } else { + return Index.pageLoad(); + } + } + }, + + pageNav(e) { + let a; + if ($$1.modifiedClick(e)) { return; } + switch (e.target.nodeName) { + case 'BUTTON': + e.target.blur(); + a = e.target.parentNode; + break; + case 'A': + a = e.target; + break; + default: + return; + } + if (a.textContent === 'Catalog') { return; } + e.preventDefault(); + return Index.userPageNav(+a.pathname.split(/\/+/)[2] || 1); + }, + + refreshFront() { + Index.pushState({page: 1}); + return Index.update(); + }, + + catalogReplies() { + if (Conf['Show Replies'] && $$1.hasClass(doc$1, 'catalog-hover-expand') && !this.catalogView.nodes.replies) { + return Index.buildCatalogReplies(this); + } + }, + + hoverAdjust() { + // Prevent hovered catalog threads from going offscreen. + let x; + if (!$$1.hasClass(doc$1, 'catalog-hover-expand')) { return; } + const rect = this.post.getBoundingClientRect(); + if (x = $$1.minmax(0, -rect.left, doc$1.clientWidth - rect.right)) { + const {style} = this.post; + style.left = `${x}px`; + style.right = `${-x}px`; + return $$1.one(this.root, 'mouseleave', () => style.left = (style.right = null)); + } + } + }, + + scrollToIndex() { + // Scroll to navlinks, or top of board if navlinks are hidden. + return Header$1.scrollToIfNeeded((Index.navLinks.getBoundingClientRect().height ? Index.navLinks : Index.root)); + }, + + getCurrentPage() { + return +window.location.pathname.split(/\/+/)[2] || 1; + }, + + userPageNav(page) { + Index.pushState({page}); + if (Conf['Refreshed Navigation']) { + return Index.update(); + } else { + return Index.pageLoad(); + } + }, + + hashCommands: { + mode: { + 'paged': 'paged', + 'infinite-scrolling': 'infinite', + 'infinite': 'infinite', + 'all-threads': 'all pages', + 'all-pages': 'all pages', + 'catalog': 'catalog' + }, + sort: { + 'bump-order': 'bump', + 'last-reply': 'lastreply', + 'last-long-reply': 'lastlong', + 'creation-date': 'birth', + 'reply-count': 'replycount', + 'file-count': 'filecount', + 'posts-per-minute': 'activity' + } + }, + + processHash() { + // XXX https://bugzilla.mozilla.org/show_bug.cgi?id=483304 + let hash = location.href.match(/#.*/)?.[0] || ''; + const state = + {replace: true}; + const commands = hash.slice(1).split('/'); + const leftover = []; + for (var command of commands) { + var mode, sort; + if (mode = $$1.getOwn(Index.hashCommands.mode, command)) { + state.mode = mode; + } else if (command === 'index') { + state.mode = Conf['Previous Index Mode']; + state.page = 1; + } else if (sort = $$1.getOwn(Index.hashCommands.sort, command.replace(/-rev$/, ''))) { + state.sort = sort; + if (/-rev$/.test(command)) { state.sort += '-rev'; } + } else if (/^s=/.test(command)) { + state.search = decodeURIComponent(command.slice(2)).replace(/\+/g, ' ').trim(); + } else { + leftover.push(command); + } + } + hash = leftover.join('/'); + if (hash) { state.hash = `#${hash}`; } + Index.pushState(state); + return commands.length - leftover.length; + }, + + pushState(state) { + let {search, hash, replace} = state; + let pageBeforeSearch = history.state?.oldpage; + if ((search != null) && (search !== Index.search)) { + state.page = search ? 1 : (pageBeforeSearch || 1); + if (!search) { + pageBeforeSearch = undefined; + } else if (!Index.search) { + pageBeforeSearch = Index.currentPage; + } + } + Index.setState(state); + const pathname = Index.currentPage === 1 ? `/${g.BOARD}/` : `/${g.BOARD}/${Index.currentPage}`; + if (!hash) { hash = ''; } + return history[replace ? 'replaceState' : 'pushState']({ + mode: Conf['Index Mode'], + sort: Index.currentSort, + searched: Index.search, + oldpage: pageBeforeSearch + } + , '', `${location.protocol}//${location.host}${pathname}${hash}`); + }, + + setState({search, mode, sort, page, hash}) { + if ((search != null) && (search !== Index.search)) { + Index.changed.search = true; + Index.search = search; + } + if ((mode != null) && (mode !== Conf['Index Mode'])) { + Index.changed.mode = true; + Conf['Index Mode'] = mode; + $$1.set('Index Mode', mode); + if ((mode !== 'catalog') && (Conf['Previous Index Mode'] !== mode)) { + Conf['Previous Index Mode'] = mode; + $$1.set('Previous Index Mode', mode); + } + } + if ((sort != null) && (sort !== Index.currentSort)) { + Index.changed.sort = true; + Index.currentSort = sort; + Index.saveSort(); + } + if (['all pages', 'catalog'].includes(Conf['Index Mode'])) { page = 1; } + if ((page != null) && (page !== Index.currentPage)) { + Index.changed.page = true; + Index.currentPage = page; + } + if (hash != null) { + return Index.changed.hash = true; + } + }, + + savePerBoard(key, value) { + if (typeof Conf[key] === 'object') { + Conf[key][g.BOARD.ID] = value; + } else { + Conf[key] = value; + } + return $$1.set(key, Conf[key]); + }, + + saveSort() { + return Index.savePerBoard('Index Sort', Index.currentSort); + }, + + saveLastLongThresholds(i) { + return Index.savePerBoard(`Last Long Reply Thresholds ${i}`, Index.lastLongThresholds[i]); + }, + + pageLoad(scroll=true) { + if (!Index.liveThreadData) { return; } + let {threads, order, search, mode, sort, page, hash} = Index.changed; + if (!threads) { threads = search; } + if (!order) { order = sort; } + if (threads || order) { Index.sort(); } + if (threads) { Index.buildPagelist(); } + if (search) { Index.setupSearch(); } + if (mode) { Index.setupMode(); } + if (sort) { Index.setupSort(); } + if (threads || mode || page || order) { Index.buildIndex(); } + if (threads || page) { Index.setPage(); } + if (scroll && !hash) { Index.scrollToIndex(); } + if (hash) { Header$1.hashScroll(); } + return Index.changed = {}; + }, + + setupMode() { + for (var mode of ['paged', 'infinite', 'all pages', 'catalog']) { + $$1[mode === Conf['Index Mode'] ? 'addClass' : 'rmClass'](doc$1, `${mode.replace(/\ /g, '-')}-mode`); + } + Index.selectMode.value = Conf['Index Mode']; + Index.cb.size(); + Index.showHiddenThreads = false; + return $$1('#hidden-toggle a', Index.navLinks).textContent = 'Show'; + }, + + setupSort() { + Index.selectRev.checked = /-rev$/.test(Index.currentSort); + Index.selectSort.value = Index.currentSort.replace(/-rev$/, ''); + return Index.lastLongOptions.hidden = (Index.selectSort.value !== 'lastlong'); + }, + + getPagesNum() { + if (Index.search) { + return Math.ceil(Index.sortedThreadIDs.length / Index.threadsNumPerPage); + } else { + return Index.pagesNum; + } + }, + + getMaxPageNum() { + return Math.max(1, Index.getPagesNum()); + }, + + buildPagelist() { + const pagesRoot = $$1('.pages', Index.pagelist); + const maxPageNum = Index.getMaxPageNum(); + if (pagesRoot.childElementCount !== maxPageNum) { + const nodes = []; + for (let i = 1, end = maxPageNum; i <= end; i++) { + var a = $$1.el('a', { + textContent: i, + href: i === 1 ? './' : i + } + ); + nodes.push($$1.tn('['), a, $$1.tn('] ')); + } + $$1.rmAll(pagesRoot); + return $$1.add(pagesRoot, nodes); + } + }, + + setPage() { + let a, strong; + const pageNum = Index.currentPage; + const maxPageNum = Index.getMaxPageNum(); + const pagesRoot = $$1('.pages', Index.pagelist); + + // Previous/Next buttons + const prev = pagesRoot.previousElementSibling.firstElementChild; + const next = pagesRoot.nextElementSibling.firstElementChild; + let href = Math.max(pageNum - 1, 1); + prev.href = href === 1 ? './' : href; + prev.firstElementChild.disabled = href === pageNum; + href = Math.min(pageNum + 1, maxPageNum); + next.href = href === 1 ? './' : href; + next.firstElementChild.disabled = href === pageNum; + + // current page + if (strong = $$1('strong', pagesRoot)) { + if (+strong.textContent === pageNum) { return; } + $$1.replace(strong, strong.firstChild); + } else { + strong = $$1.el('strong'); + } + + if (a = pagesRoot.children[pageNum - 1]) { + $$1.before(a, strong); + return $$1.add(strong, a); + } + }, + + updateHideLabel() { + if (!Index.hideLabel) { return; } + let hiddenCount = 0; + for (var threadID of Index.liveThreadIDs) { + if (Index.isHidden(threadID)) { + hiddenCount++; + } + } + if (!hiddenCount) { + Index.hideLabel.hidden = true; + if (Index.showHiddenThreads) { Index.cb.toggleHiddenThreads(); } + return; + } + Index.hideLabel.hidden = false; + return $$1('#hidden-count', Index.navLinks).textContent = hiddenCount === 1 ? + '1 hidden thread' + : + `${hiddenCount} hidden threads`; + }, + + update(firstTime) { + let oldReq; + if (oldReq = Index.req) { + delete Index.req; + oldReq.abort(); + } + + if (Conf['Index Refresh Notifications']) { + // Optional notification for manual refreshes + if (!Index.notice) { Index.notice = new Notice('info', 'Refreshing index...'); } + if (!Index.nTimeout) { Index.nTimeout = setTimeout(() => { + if (Index.notice) { + Index.notice.el.lastElementChild.textContent += ' (disable JSON Index if this takes too long)'; + } + } + , 3 * SECOND); } + } else { + // Also display notice if Index Refresh is taking too long + if (!Index.nTimeout) { Index.nTimeout = setTimeout(() => Index.notice || (Index.notice = new Notice('info', 'Refreshing index... (disable JSON Index if this takes too long)')) + , 3 * SECOND); } + } + + // Hard refresh in case of incomplete page load. + if (!firstTime && (d$1.readyState !== 'loading') && !$$1('.board + *')) { + location.reload(); + return; + } + + Index.req = $$1.whenModified( + g.SITE.urls.catalogJSON({boardID: g.BOARD.ID}), + 'Index', + Index.load + ); + return $$1.addClass(Index.button, 'spin'); + }, + + load() { + let err; + if (this !== Index.req) { return; } // aborted + + $$1.rmClass(Index.button, 'spin'); + const {notice, nTimeout} = Index; + if (nTimeout) { clearTimeout(nTimeout); } + delete Index.nTimeout; + delete Index.req; + delete Index.notice; + + if (![200, 304].includes(this.status)) { + err = `Index refresh failed. ${this.status ? `Error ${this.statusText} (${this.status})` : 'Connection Error'}`; + if (notice) { + notice.setType('warning'); + notice.el.lastElementChild.textContent = err; + setTimeout(notice.close, SECOND); + } else { + new Notice('warning', err, 1); + } + return; + } + + try { + if (this.status === 200) { + Index.parse(this.response); + } else if (this.status === 304) { + Index.pageLoad(); + } + } catch (error) { + err = error; + c.error(`Index failure: ${err.message}`, err.stack); + if (notice) { + notice.setType('error'); + notice.el.lastElementChild.textContent = 'Index refresh failed.'; + setTimeout(notice.close, SECOND); + } else { + new Notice('error', 'Index refresh failed.', 1); + } + return; + } + + if (notice) { + if (Conf['Index Refresh Notifications']) { + notice.setType('success'); + notice.el.lastElementChild.textContent = 'Index refreshed!'; + setTimeout(notice.close, SECOND); + } else { + notice.close(); + } + } + + const timeEl = $$1('#index-last-refresh time', Index.navLinks); + timeEl.dataset.utc = Date.parse(this.getResponseHeader('Last-Modified')); + return RelativeDates.update(timeEl); + }, + + parse(pages) { + $$1.cleanCache(url => /^https?:\/\/a\.4cdn\.org\//.test(url)); + Index.parseThreadList(pages); + Index.changed.threads = true; + return Index.pageLoad(); + }, + + parseThreadList(pages) { + Index.pagesNum = pages.length; + Index.threadsNumPerPage = pages[0]?.threads.length || 1; + Index.liveThreadData = pages.reduce(((arr, next) => arr.concat(next.threads)), []); + Index.liveThreadIDs = Index.liveThreadData.map(data => data.no); + Index.liveThreadDict = dict(); + Index.threadPosition = dict(); + Index.parsedThreads = dict(); + Index.replyData = dict(); + for (let i = 0; i < Index.liveThreadData.length; i++) { + var obj, results; + var data = Index.liveThreadData[i]; + Index.liveThreadDict[data.no] = data; + Index.threadPosition[data.no] = i; + Index.parsedThreads[data.no] = (obj = g.SITE.Build.parseJSON(data, g.BOARD)); + obj.filterResults = (results = Filter.test(obj)); + obj.isOnTop = results.top; + obj.isHidden = results.hide || ThreadHiding.isHidden(obj.boardID, obj.threadID); + if (data.last_replies) { + for (var reply of data.last_replies) { + Index.replyData[`${g.BOARD}.${reply.no}`] = reply; + } + } + } + if (Index.liveThreadData[0]) { + g.SITE.Build.spoilerRange[g.BOARD.ID] = Index.liveThreadData[0].custom_spoiler; + } + g.BOARD.threads.forEach(function(thread) { + if (!Index.liveThreadIDs.includes(thread.ID)) { return thread.collect(); } + }); + $$1.event('IndexUpdate', + {threads: ((Index.liveThreadIDs.map((ID) => `${g.BOARD}.${ID}`)))}); + }, + + isHidden(threadID) { + let thread; + if ((thread = g.BOARD.threads.get(threadID)) && thread.OP && !thread.OP.isFetchedQuote) { + return thread.isHidden; + } else { + return Index.parsedThreads[threadID].isHidden; + } + }, + + isHiddenReply(threadID, replyData) { + return PostHiding.isHidden(g.BOARD.ID, threadID, replyData.no) || Filter.isHidden(g.SITE.Build.parseJSON(replyData, g.BOARD)); + }, + + buildThreads(threadIDs, isCatalog, withReplies) { + let errors; + const threads = []; + const newThreads = []; + let newPosts = []; + for (var ID of threadIDs) { + var opRoot, thread; + try { + var OP; + var threadData = Index.liveThreadDict[ID]; + + if (thread = g.BOARD.threads.get(ID)) { + var isStale = (thread.json !== threadData) && (JSON.stringify(thread.json) !== JSON.stringify(threadData)); + if (isStale) { + thread.setCount('post', threadData.replies + 1, threadData.bumplimit); + thread.setCount('file', threadData.images + !!threadData.ext, threadData.imagelimit); + thread.setStatus('Sticky', !!threadData.sticky); + thread.setStatus('Closed', !!threadData.closed); + } + if (thread.catalogView) { + $$1.rm(thread.catalogView.nodes.replies); + thread.catalogView.nodes.replies = null; + } + } else { + thread = new Thread(ID, g.BOARD); + newThreads.push(thread); + } + var lastPost = threadData.last_replies && threadData.last_replies.length ? threadData.last_replies[threadData.last_replies.length - 1].no : ID; + if (lastPost > thread.lastPost) { thread.lastPost = lastPost; } + thread.json = threadData; + threads.push(thread); + + if ((OP = thread.OP) && !OP.isFetchedQuote) { + OP.setCatalogOP(isCatalog); + thread.setPage(Math.floor(Index.threadPosition[ID] / Index.threadsNumPerPage) + 1); + } else { + var obj = Index.parsedThreads[ID]; + opRoot = g.SITE.Build.post(obj); + OP = new Post(opRoot, thread, g.BOARD); + OP.filterResults = obj.filterResults; + newPosts.push(OP); + } + + if (!isCatalog || !thread.nodes.root) { + g.SITE.Build.thread(thread, threadData, withReplies); + } + } catch (err) { + // Skip posts that we failed to parse. + if (!errors) { errors = []; } + errors.push({ + message: `Parsing of Thread No.${thread} failed. Thread will be skipped.`, + error: err, + html: opRoot?.outerHTML + }); + } + } + if (errors) { Main$1.handleErrors(errors); } + + if (withReplies) { + newPosts = newPosts.concat(Index.buildReplies(threads)); + } + + Main$1.callbackNodes('Thread', newThreads); + Main$1.callbackNodes('Post', newPosts); + Index.updateHideLabel(); + $$1.event('IndexRefreshInternal', {threadIDs: (threads.map((t) => t.fullID)), isCatalog}); + + return threads; + }, + + buildReplies(threads) { + let errors; + const posts = []; + for (var thread of threads) { + var lastReplies; + if (!(lastReplies = Index.liveThreadDict[thread.ID].last_replies)) { continue; } + var nodes = []; + for (var data of lastReplies) { + var node, post; + if ((post = thread.posts.get(data.no)) && !post.isFetchedQuote) { + nodes.push(post.nodes.root); + continue; + } + nodes.push(node = g.SITE.Build.postFromObject(data, thread.board.ID)); + try { + posts.push(new Post(node, thread, thread.board)); + } catch (err) { + // Skip posts that we failed to parse. + if (!errors) { errors = []; } + errors.push({ + message: `Parsing of Post No.${data.no} failed. Post will be skipped.`, + error: err, + html: node?.outerHTML + }); + } + } + $$1.add(thread.nodes.root, nodes); + } + + if (errors) { Main$1.handleErrors(errors); } + return posts; + }, + + buildCatalogViews(threads) { + const catalogThreads = []; + for (var thread of threads) { + if (!thread.catalogView) { + var {ID} = thread; + var page = Math.floor(Index.threadPosition[ID] / Index.threadsNumPerPage) + 1; + var root = g.SITE.Build.catalogThread(thread, Index.liveThreadDict[ID], page); + catalogThreads.push(new CatalogThread(root, thread)); + } + } + Main$1.callbackNodes('CatalogThread', catalogThreads); + }, + + sizeCatalogViews(threads) { + // XXX When browsers support CSS3 attr(), use it instead. + const size = Conf['Index Size'] === 'small' ? 150 : 250; + for (var thread of threads) { + var {thumb} = thread.catalogView.nodes; + var {width, height} = thumb.dataset; + if (!width) { continue; } + var ratio = size / Math.max(width, height); + thumb.style.width = (width * ratio) + 'px'; + thumb.style.height = (height * ratio) + 'px'; + } + }, + + buildCatalogReplies(thread) { + let lastReplies; + const {nodes} = thread.catalogView; + if (!(lastReplies = Index.liveThreadDict[thread.ID].last_replies)) { return; } + + const replies = []; + for (var data of lastReplies) { + if (Index.isHiddenReply(thread.ID, data)) { continue; } + var reply = g.SITE.Build.catalogReply(thread, data); + RelativeDates.update($$1('time', reply)); + $$1.on($$1('.catalog-reply-preview', reply), 'mouseover', QuotePreview.mouseover); + replies.push(reply); + } + + nodes.replies = $$1.el('div', {className: 'catalog-replies'}); + $$1.add(nodes.replies, replies); + $$1.add(thread.OP.nodes.post, nodes.replies); + }, + + sort() { + let threadIDs; + const {liveThreadIDs, liveThreadData} = Index; + if (!liveThreadData) { return; } + const tmp_time = new Date().getTime()/1000; + const sortType = Index.currentSort.replace(/-rev$/, ''); + Index.sortedThreadIDs = (() => { switch (sortType) { + case 'lastreply': case 'lastlong': + var repliesAvailable = liveThreadData.some(thread => thread.last_replies?.length); + var lastlong = function(thread) { + if (!repliesAvailable) { + return thread.last_modified; + } + const iterable = thread.last_replies || []; + for (let i = iterable.length - 1; i >= 0; i--) { + var r = iterable[i]; + if (Index.isHiddenReply(thread.no, r)) { continue; } + if (sortType === 'lastreply') { + return r; + } + var len = r.com ? g.SITE.Build.parseComment(r.com).replace(/[^a-z]/ig, '').length : 0; + if (len >= Index.lastLongThresholds[+!!r.ext]) { + return r; + } + } + if (thread.omitted_posts && thread.last_replies?.length) { return thread.last_replies[0]; } else { return thread; } + }; + var lastlongD = dict(); + for (var thread of liveThreadData) { + lastlongD[thread.no] = lastlong(thread).no; + } + return [...Array.from(liveThreadData)].sort((a, b) => lastlongD[b.no] - lastlongD[a.no]).map(post => post.no); + case 'bump': return liveThreadIDs; + case 'birth': return [...Array.from(liveThreadIDs) ].sort((a, b) => b - a); + case 'replycount': return [...Array.from(liveThreadData)].sort((a, b) => b.replies - a.replies).map(post => post.no); + case 'filecount': return [...Array.from(liveThreadData)].sort((a, b) => b.images - a.images).map(post => post.no); + case 'activity': return [...Array.from(liveThreadData)].sort((a, b) => ((tmp_time-a.time)/(a.replies+1)) - ((tmp_time-b.time)/(b.replies+1))).map(post => post.no); + default: return liveThreadIDs; + } })(); + if (/-rev$/.test(Index.currentSort)) { + Index.sortedThreadIDs = [...Array.from(Index.sortedThreadIDs)].reverse(); + } + if (Index.search && (threadIDs = Index.querySearch(Index.search))) { + Index.sortedThreadIDs = threadIDs; + } + // Sticky threads + Index.sortOnTop(obj => obj.isSticky); + // Highlighted threads + Index.sortOnTop(obj => obj.isOnTop || (Conf['Pin Watched Threads'] && ThreadWatcher$1.isWatchedRaw(obj.boardID, obj.threadID))); + // Non-hidden threads + if (Conf['Anchor Hidden Threads']) { return Index.sortOnTop(obj => !Index.isHidden(obj.threadID)); } + }, + + sortOnTop(match) { + const topThreads = []; + const bottomThreads = []; + for (var ID of Index.sortedThreadIDs) { + (match(Index.parsedThreads[ID]) ? topThreads : bottomThreads).push(ID); + } + return Index.sortedThreadIDs = topThreads.concat(bottomThreads); + }, + + buildIndex() { + let threadIDs; + if (!Index.liveThreadData) { return; } + switch (Conf['Index Mode']) { + case 'all pages': + threadIDs = Index.sortedThreadIDs; + break; + case 'catalog': + threadIDs = Index.sortedThreadIDs.filter(ID => !Index.isHidden(ID) !== Index.showHiddenThreads); + break; + default: + threadIDs = Index.threadsOnPage(Index.currentPage); + } + delete Index.pageNum; + $$1.rmAll(Index.root); + $$1.rmAll(Header$1.hover); + if (Index.loaded && Index.root.parentNode) { + $$1.event('PostsRemoved', null, Index.root); + } + if (Conf['Index Mode'] === 'catalog') { + Index.buildCatalog(threadIDs); + } else { + Index.buildStructure(threadIDs); + } + }, + + threadsOnPage(pageNum) { + const nodesPerPage = Index.threadsNumPerPage; + const offset = nodesPerPage * (pageNum - 1); + return Index.sortedThreadIDs.slice(offset , offset + nodesPerPage); + }, + + buildStructure(threadIDs) { + const threads = Index.buildThreads(threadIDs, false, Conf['Show Replies']); + const nodes = []; + for (var thread of threads) { + nodes.push(thread.nodes.root, $$1.el('hr')); + } + $$1.add(Index.root, nodes); + if (Index.root.parentNode) { + $$1.event('PostsInserted', null, Index.root); + } + Index.loaded = true; + }, + + buildCatalog(threadIDs) { + let i = 0; + const n = threadIDs.length; + let node0 = null; + var fn = function() { + if (node0 && !node0.parentNode) { return; } // Index.root cleared + const j = (i > 0) && Index.root.parentNode ? n : i + 30; + node0 = Index.buildCatalogPart(threadIDs.slice(i, j))[0]; + i = j; + if (i < n) { + return $$1.queueTask(fn); + } else { + if (Index.root.parentNode) { + $$1.event('PostsInserted', null, Index.root); + } + return Index.loaded = true; + } + }; + fn(); + }, + + buildCatalogPart(threadIDs) { + const threads = Index.buildThreads(threadIDs, true); + Index.buildCatalogViews(threads); + Index.sizeCatalogViews(threads); + const nodes = []; + for (var thread of threads) { + thread.OP.setCatalogOP(true); + $$1.add(thread.catalogView.nodes.root, thread.OP.nodes.root); + nodes.push(thread.catalogView.nodes.root); + $$1.on(thread.catalogView.nodes.root, 'mouseenter', Index.cb.catalogReplies.bind(thread)); + $$1.on(thread.OP.nodes.root, 'mouseenter', Index.cb.hoverAdjust.bind(thread.OP.nodes)); + } + $$1.add(Index.root, nodes); + return nodes; + }, + + clearSearch() { + Index.searchInput.value = ''; + Index.onSearchInput(); + return Index.searchInput.focus(); + }, + + setupSearch() { + Index.searchInput.value = Index.search; + if (Index.search) { + return Index.searchInput.dataset.searching = 1; + } else { + // XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1021289 + return Index.searchInput.removeAttribute('data-searching'); + } + }, + + onSearchInput() { + const search = Index.searchInput.value.trim(); + if (search === Index.search) { return; } + Index.pushState({ + search, + replace: !!search === !!Index.search + }); + return Index.pageLoad(false); + }, + + querySearch(query) { + let keywords, match; + if (match = query.match(/^([\w+]+):\/(.*)\/(\w*)$/)) { + let regexp; + try { + regexp = RegExp(match[2], match[3]); + } catch (error) { + return []; + } + return Index.sortedThreadIDs.filter(ID => regexp.test(Filter.values(match[1], Index.parsedThreads[ID]).join('\n'))); + } + if (!(keywords = query.toLowerCase().match(/\S+/g))) { return; } + return Index.sortedThreadIDs.filter(ID => Index.searchMatch(Index.parsedThreads[ID], keywords)); + }, + + searchMatch(obj, keywords) { + const {info, file} = obj; + if (info.comment == null) { info.comment = g.SITE.Build.parseComment(info.commentHTML.innerHTML); } + let text = []; + for (var key of ['comment', 'subject', 'name', 'tripcode']) { + if (key in info) { text.push(info[key]); } + } + if (file) { text.push(file.name); } + text = text.join(' ').toLowerCase(); + for (var keyword of keywords) { + if (-1 === text.indexOf(keyword)) { return false; } + } + return true; + } + }; + var Index$1 = Index; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var ThreadHiding = { + init() { + if (!['index', 'catalog'].includes(g.VIEW) || (!Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Index'])) { return; } + this.db = new DataBoard('hiddenThreads'); + if (g.VIEW === 'catalog') { return this.catalogWatch(); } + this.catalogSet(g.BOARD); + $$1.on(d$1, 'IndexRefreshInternal', this.onIndexRefresh); + if (Conf['Thread Hiding Buttons']) { + $$1.addClass(doc$1, 'thread-hide'); + } + return Callbacks.Post.push({ + name: 'Thread Hiding', + cb: this.node + }); + }, + + catalogSet(board) { + if (!$$1.hasStorage || (g.SITE.software !== 'yotsuba')) { return; } + const hiddenThreads = ThreadHiding.db.get({ + boardID: board.ID, + defaultValue: dict() + }); + for (var threadID in hiddenThreads) { hiddenThreads[threadID] = true; } + return localStorage.setItem(`4chan-hide-t-${board}`, JSON.stringify(hiddenThreads)); + }, + + catalogWatch() { + if (!$$1.hasStorage || (g.SITE.software !== 'yotsuba')) { return; } + this.hiddenThreads = JSON.parse(localStorage.getItem(`4chan-hide-t-${g.BOARD}`)) || {}; + return Main$1.ready(() => // 4chan's catalog sets the style to "display: none;" when hiding or unhiding a thread. + new MutationObserver(ThreadHiding.catalogSave).observe($$1.id('threads'), { + attributes: true, + subtree: true, + attributeFilter: ['style'] + })); + }, + + catalogSave() { + let threadID; + const hiddenThreads2 = JSON.parse(localStorage.getItem(`4chan-hide-t-${g.BOARD}`)) || {}; + for (threadID in hiddenThreads2) { + if (!$$1.hasOwn(ThreadHiding.hiddenThreads, threadID)) { + ThreadHiding.db.set({ + boardID: g.BOARD.ID, + threadID, + val: {makeStub: Conf['Stubs']}}); + } + } + for (threadID in ThreadHiding.hiddenThreads) { + if (!$$1.hasOwn(hiddenThreads2, threadID)) { + ThreadHiding.db.delete({ + boardID: g.BOARD.ID, + threadID + }); + } + } + return ThreadHiding.hiddenThreads = hiddenThreads2; + }, + + isHidden(boardID, threadID) { + return !!(ThreadHiding.db && ThreadHiding.db.get({boardID, threadID})); + }, + + node() { + let data; + if (this.isReply || this.isClone || this.isFetchedQuote) { return; } + + if (Conf['Thread Hiding Buttons']) { + $$1.prepend(this.nodes.root, ThreadHiding.makeButton(this.thread, 'hide')); + } + + if (data = ThreadHiding.db.get({boardID: this.board.ID, threadID: this.ID})) { + return ThreadHiding.hide(this.thread, data.makeStub); + } + }, + + onIndexRefresh() { + return g.BOARD.threads.forEach(function(thread) { + const {root} = thread.nodes; + if (thread.isHidden && thread.stub && !root.contains(thread.stub)) { + return ThreadHiding.makeStub(thread, root); + } + }); + }, + + menu: { + init() { + if ((g.VIEW !== 'index') || !Conf['Menu'] || !Conf['Thread Hiding Link']) { return; } + + let div = $$1.el('div', { + className: 'hide-thread-link', + textContent: 'Hide' + } + ); + + const apply = $$1.el('a', { + textContent: 'Apply', + href: 'javascript:;' + } + ); + $$1.on(apply, 'click', ThreadHiding.menu.hide); + + const makeStub = UI.checkbox('Stubs', 'Make stub'); + + Menu.menu.addEntry({ + el: div, + order: 20, + open({thread, isReply}) { + if (isReply || thread.isHidden || (Conf['JSON Index'] && (Conf['Index Mode'] === 'catalog'))) { + return false; + } + ThreadHiding.menu.thread = thread; + return true; + }, + subEntries: [{el: apply}, {el: makeStub}]}); + + div = $$1.el('a', { + className: 'show-thread-link', + textContent: 'Show', + href: 'javascript:;' + } + ); + $$1.on(div, 'click', ThreadHiding.menu.show); + + Menu.menu.addEntry({ + el: div, + order: 20, + open({thread, isReply}) { + if (isReply || !thread.isHidden || (Conf['JSON Index'] && (Conf['Index Mode'] === 'catalog'))) { + return false; + } + ThreadHiding.menu.thread = thread; + return true; + } + }); + + const hideStubLink = $$1.el('a', { + textContent: 'Hide stub', + href: 'javascript:;' + } + ); + $$1.on(hideStubLink, 'click', ThreadHiding.menu.hideStub); + + return Menu.menu.addEntry({ + el: hideStubLink, + order: 15, + open({thread, isReply}) { + if (isReply || !thread.isHidden || (Conf['JSON Index'] && (Conf['Index Mode'] === 'catalog'))) { + return false; + } + return ThreadHiding.menu.thread = thread; + } + }); + }, + + hide() { + const makeStub = $$1('input', this.parentNode).checked; + const {thread} = ThreadHiding.menu; + ThreadHiding.hide(thread, makeStub); + ThreadHiding.saveHiddenState(thread, makeStub); + return $$1.event('CloseMenu'); + }, + + show() { + const {thread} = ThreadHiding.menu; + ThreadHiding.show(thread); + ThreadHiding.saveHiddenState(thread); + return $$1.event('CloseMenu'); + }, + + hideStub() { + const {thread} = ThreadHiding.menu; + ThreadHiding.show(thread); + ThreadHiding.hide(thread, false); + ThreadHiding.saveHiddenState(thread, false); + $$1.event('CloseMenu'); + } + }, + + makeButton(thread, type) { + const a = $$1.el('a', { + className: `${type}-thread-button`, + href: 'javascript:;' + } + ); + $$1.extend(a, {textContent: type === "hide" ? '➖︎' : '➕︎' }); + a.dataset.fullID = thread.fullID; + $$1.on(a, 'click', ThreadHiding.toggle); + return a; + }, + + makeStub(thread, root) { + let summary, threadDivider; + let numReplies = $$(g.SITE.selectors.replyOriginal, root).length; + if (summary = $$1(g.SITE.selectors.summary, root)) { numReplies += +summary.textContent.match(/\d+/); } + + const a = ThreadHiding.makeButton(thread, 'show'); + $$1.add(a, $$1.tn(` ${thread.OP.info.nameBlock} (${numReplies === 1 ? '1 reply' : `${numReplies} replies`})`)); + thread.stub = $$1.el('div', + {className: 'stub'}); + if (Conf['Menu']) { + $$1.add(thread.stub, [a, Menu.makeButton(thread.OP)]); + } else { + $$1.add(thread.stub, a); + } + $$1.prepend(root, thread.stub); + + // Prevent hiding of thread divider on sites that put it inside the thread + if (threadDivider = $$1(g.SITE.selectors.threadDivider, root)) { + return $$1.addClass(threadDivider, 'threadDivider'); + } + }, + + saveHiddenState(thread, makeStub) { + if (thread.isHidden) { + ThreadHiding.db.set({ + boardID: thread.board.ID, + threadID: thread.ID, + val: {makeStub}}); + } else { + ThreadHiding.db.delete({ + boardID: thread.board.ID, + threadID: thread.ID + }); + } + return ThreadHiding.catalogSet(thread.board); + }, + + toggle(thread) { + if (!(thread instanceof Thread)) { + thread = g.threads.get(this.dataset.fullID); + } + if (thread.isHidden) { + ThreadHiding.show(thread); + } else { + ThreadHiding.hide(thread); + } + return ThreadHiding.saveHiddenState(thread); + }, + + hide(thread, makeStub=Conf['Stubs']) { + if (thread.isHidden) { return; } + const threadRoot = thread.nodes.root; + thread.isHidden = true; + Index$1.updateHideLabel(); + if (thread.catalogView && !Index$1.showHiddenThreads) { + $$1.rm(thread.catalogView.nodes.root); + $$1.event('PostsRemoved', null, Index$1.root); + } + + if (!makeStub) { return threadRoot.hidden = true; } + + return ThreadHiding.makeStub(thread, threadRoot); + }, + + show(thread) { + if (thread.stub) { + $$1.rm(thread.stub); + delete thread.stub; + } + const threadRoot = thread.nodes.root; + threadRoot.hidden = (thread.isHidden = false); + Index$1.updateHideLabel(); + if (thread.catalogView && Index$1.showHiddenThreads) { + $$1.rm(thread.catalogView.nodes.root); + return $$1.event('PostsRemoved', null, Index$1.root); + } + } + }; + + /* + * This file has the code for the jsx to { innerHTML: "safe string" } + * + * Usage: import h from this file. + * Attributes are stringified raw, so the names must be like html text: eg class and not className. + * Boolean values are stringified as followed: true will mean the attribute is there, false means it will be omitted. + * Strings bound to attributes and children will be escaped automatically. + * It returns interface EscapedHtml { innerHTML: "safe string", [isEscaped]: true } + * + * For strings that don't have a parent element you can use fragments: <>. + * Note that you need to import hFragment, which for some reason isn't auto imported on "add all missing imports" + */ + /** + * The symbol indicating that a string is safely escaped. + * This is a symbol so it can't be faked by a json blob from the internet. + */ + const isEscaped = Symbol('isEscaped'); + const voidElements = new Set(['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'source', 'track', 'wbr',]); + const hFragment = Symbol('hFragment'); + /** Function that jsx/tsx will be compiled to. */ + function h(tag, attributes, ...children) { + let innerHTML = tag === hFragment ? '' : `<${tag}`; + if (attributes) { + for (const [attribute, value] of Object.entries(attributes)) { + if (!value && value !== 0) + continue; + innerHTML += ` ${attribute}`; + if (value === true) + continue; + innerHTML += `="${E(value.toString())}"`; + } + } + if (tag !== hFragment) + innerHTML += '>'; + const isVoid = tag !== hFragment && voidElements.has(tag); + if (isVoid) { + if (children.length) + throw new TypeError(`${tag} is a void html element and can't have child elements`); + } + else { + for (const child of children) { + if (child === null || child === undefined || child === '') + continue; + if (child instanceof Object && "innerHTML" in child && child[isEscaped]) { + innerHTML += child.innerHTML; + continue; + } + innerHTML += E(child.toString()); + } + } + if (!isVoid && tag !== hFragment) + innerHTML += ``; + return { innerHTML, [isEscaped]: true }; + } + + // \u00A0 is non breaking space + const separator = '\u00A0|\u00A0'; + const settingsHtml = h("div", { id: "fourchanx-settings", class: "dialog" }, + h("nav", null, + h("div", { class: "sections-list" }), + h("p", { class: "imp-exp-result warning" }), + h("div", { class: "credits" }, + h("a", { class: "export" }, "Export"), + separator, + h("a", { class: "import" }, "Import"), + separator, + h("a", { class: "reset" }, "Reset Settings"), + separator, + h("input", { type: "file", hidden: true }), + h("a", { href: meta.page, target: "_blank" }, meta.name), + separator, + h("a", { href: meta.changelog, target: "_blank" }, g.VERSION), + separator, + h("a", { href: meta.issues, target: "_blank" }, "Issues"), + separator, + h("a", { href: "javascript:;", class: "close", title: "Close" }, "\u2715"))), + h("div", { class: "section-container" }, + h("section", null))); + + var FilterGuidePage = `
        Filter is disabled.
        +

        + Use regular expressions, one per line.
        + Lines starting with a # will be ignored.
        + For example, /weeaboo/i will filter posts containing the string \`weeaboo\`, case-insensitive.
        + MD5 and Unique ID filtering use exact string matching, not regular expressions. +

        +
          You can use these settings with each regular expression, separate them with semicolons: +
        • + Per boards, separate them with commas. It is global if not specified. Use sfw and nsfw to reference all worksafe or not-worksafe boards.
          + For example: boards:a,jp;.
          + To specify boards on a particular site, put the beginning of the domain and a slash character before the list.
          + Any initial www. should not be included, and all 4chan domains are considered 4chan.org.
          + For example: boards:4:a,jp,sama:a,z;.
          + An asterisk can be used to specify all boards on a site.
          + For example: boards:4:*;.
          +
        • +
        • + Select boards to be excluded from the filter. The syntax is the same as for the boards: option above.
          + For example: exclude:vg,v;. +
        • +
        • + Filter OPs only along with their threads (\`only\`) or replies only (\`no\`).
          + For example: op:only; or op:no;. +
        • +
        • + Filter only posts with files (\`only\`) or only posts without files (\`no\`).
          + For example: file:only; or file:no;. +
        • +
        • + Overrule the \`Show Stubs\` setting if specified: create a stub (\`yes\`) or not (\`no\`).
          + For example: stub:yes; or stub:no;. +
        • +
        • + Highlight instead of hiding. You can specify a class name to use with a userstyle.
          + For example: highlight; or highlight:wallpaper;. +
        • +
        • + Highlighted OPs will have their threads put on top of the board index by default.
          + For example: top:yes; or top:no;. +
        • +
        • + Show a desktop notification instead of hiding.
          + For example: notify;. +
        • +
        • + Filters in the "General" section apply to multiple fields, by default subject,name,filename,comment.
          + The fields can be specified with the type option, separated by commas.
          + For example: type:@{filterTypes};.
          + Types can also be combined with a + sign; this indicates the filter applies to the given fields joined by newlines.
          + For example: type:filename+filesize+dimensions;.
          +
        • +
        +`; + + var SaucePage = `
        Sauce is disabled.
        + +
        + +
        These parameters will be replaced by their corresponding values in the URL and displayed text:
        +
          +
        • %IMG: Full image URL for GIF, JPG, and PNG; thumbnail URL for other types.
        • +
        • %URL: Full image URL.
        • +
        • %TURL: Thumbnail URL.
        • +
        • %name: Original file name.
        • +
        • %board: Current board.
        • +
        • %MD5: MD5 hash in base64.
        • +
        • %sMD5: MD5 hash in base64 using - and _.
        • +
        • %hMD5: MD5 hash in hexadecimal.
        • +
        • %$0: Matched regular expression within the filename.
        • +
        • %$1, %$2, %$3, ... : Subexpressions within the matched regular expression.
        • +
        • %%, %semi: Literal % and ;.
        • +
        +
        Lines starting with a # will be ignored.
        +
        You can specify a display text by appending ;text:[text] to the URL.
        +
        You can specify the applicable boards/sites by appending ;boards:[board1],[board2]. See the Filter guide for details.
        +
        You can specify the applicable file types by appending ;types:[extension1],[extension2].
        +
        You can specify a regular expression the filename must match by appending ;regexp:[regular expression].
        +
        + +`; + + var AdvancedPage = `
        + Archives +
        404 Redirect is disabled.
        + + + + + + + + +
        Thread redirectionPost fetchingFile redirection
        +
        +
        + Archive Lists: Each line below should be an archive list in this format or a URL to load an archive list from.
        + Archive properties can be overriden by another item with the same uid (or if absent, its name). +
        + + Last updated: +
        + +
        + External Catalog +
        External Catalog is disabled. This will be used only as a fallback.
        +
        + URLs of external catalog sites, where %board is to be replaced by the board name.
        + Each URL should be followed by ;boards: and optionally ;exclude: and a list of supported/excluded boards in the format explained in the Filter guide. +
        + +
        + +
        + Override 4chan Image Host +
        Change 4chan image links to this domain. Leave blank for no change.
        +
        + +
        + +
        + Captcha Language +
        Choose from list of language codes. Leave blank to autoselect.
        +
        +
        + +
        + Custom Board Navigation +
        + New lines will be converted into spaces.

        +
        In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
        +
        Board link: g
        +
        Archive link: g-archive
        +
        Internal archive link: g-expired
        +
        Title link: g-title
        +
        Board link (Replace with title when on that board): g-replace
        +
        Full text link: g-full
        +
        Custom text link: g-text:"Install Gentoo"
        +
        Index-only link: g-index
        +
        Catalog-only link: g-catalog
        +
        Index mode: g-mode:"infinite scrolling"
        +
        Index sort: g-sort:"creation date rev"
        +
        External link: external-text:"Google","http://www.google.com"
        +
        Open in new tab: g-nt
        +
        Combinations are possible: g-index-text:"Technology Index"
        +
        Full board list toggle: toggle-all
        +
        +
        + [ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:"Piracy"]
        + will give you
        + [ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
        + if you are on /g/. +
        +
        + +
        + Time Formatting is disabled. +
        :
        + +
        Day: %a, %A, %d, %e
        +
        Month: %m, %b, %B
        +
        Year: %y, %Y
        +
        Hour: %k, %H, %l, %I, %p, %P
        +
        Minute: %M
        +
        Second: %S
        +
        Literal %: %%
        + +
        + +
        + Quote Backlinks formatting is disabled. +
        :
        +
        + +
        + Default pasted content filename +
        .png
        +
        + +
        + File Info Formatting is disabled. +
        :
        +
        Link: %l (truncated), %L (untruncated), %T (4chan filename)
        +
        Filename: %n (truncated), %N (untruncated), %t (4chan filename)
        +
        Download button: %d
        +
        Quick filter MD5: %f
        +
        Spoiler indicator: %p
        +
        Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
        +
        Resolution: %r (Displays 'PDF' for PDF files)
        +
        Tag: %g +
        Literal %: %%
        +
        + +
        + Quick Reply Personas + +

        + One item per line.
        + Items will be added in the relevant input's auto-completion list.
        + Password items will always be used, since there is no password input.
        + Lines starting with a # will be ignored. +

        +
          You can use these settings with each item, separate them with semicolons: +
        • Possible items are: name, options (or equivalently email), subject and password.
        • +
        • Wrap values of items with quotes, like this: options:"sage".
        • +
        • Force values as defaults with the always keyword, for example: options:"sage";always.
        • +
        • Select specific boards for an item, separated with commas, for example: options:"sage";boards:jp;always.
        • +
        +
        + +
        + Unread Favicon is disabled. + + +
        + +
        + Thread Updater is disabled. +
        + Interval: seconds +
        +
        + +
        + Custom Cooldown Time +
        + Seconds: +
        +
        + +
        + + + +
        For more information about customizing 4chan X's CSS, see the styling guide.
        + + +
        + +
        + Javascript Whitelist +
        + Sources from which Javascript is allowed to be loaded by Content Security Policy.
        + Lines starting with a # will be ignored. +
        + +
        + +
        + Known Banners +
        List of known banners, used for click-to-change feature.
        + +
        +`; + + var KeybindsPage = `
        Keybinds are disabled.
        +
        Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
        +
        Press Backspace to disable a keybind.
        + + +
        ActionsKeybinds
        +`; + + var FilterSelectPage = ` +
        +`; + + var burichan = `/* General */ +:root.burichan .dialog { + background-color: #D6DAF0; + border-color: #B7C5D9; +} +:root.burichan .field:focus, +:root.burichan .field.focus { + border-color: #98E; +} + +/* Header */ +:root.burichan #header-bar.dialog { + background-color: rgba(214,218,240,0.98); +} +:root.burichan:not(.fixed) #header-bar, :root.burichan #header-bar #notifications { + font-size: 11pt; +} +:root.burichan #header-bar, :root.burichan #header-bar #notifications { + color: #89A; +} +:root.burichan #header-bar a, :root.burichan #header-bar #notifications a { + color: #34345C; +} + +/* Settings */ +:root.burichan #fourchanx-settings fieldset, :root.burichan .section-main div::before { + border-color: #B7C5D9; +} +:root.burichan .suboption-list > div:last-of-type { + background-color: #D6DAF0; +} + +/* Catalog */ +:root.burichan.catalog-hover-expand .catalog-container:hover > .post { + background-color: #D6DAF0; +} +:root.burichan.werkTyme .catalog-thread:not(:hover), +:root.burichan.werkTyme:not(.catalog-hover-expand) .catalog-thread, +:root.burichan.catalog-hover-expand .catalog-container:hover > .post, +:root.burichan.catalog-hover-expand .catalog-container:hover .catalog-reply { + border-color: #B7C5D9; +} + +/* Quote */ +:root.burichan .backlink.deadlink { + color: #34345C !important; +} +:root.burichan .inline { + border-color: #B7C5D9; + background-color: rgba(255, 255, 255, .14); +} + +/* Fappe and Werk Tyme */ +:root.burichan .indicator { + color: #D6DAF0; +} + +/* Anonymize */ +:root.burichan.anonymize $site$info$name::before { + font-size: 12pt; +} + +/* QR */ +.burichan #dump-list::-webkit-scrollbar-thumb { + background-color: #D6DAF0; + border-color: #B7C5D9; +} +:root.burichan .qr-preview { + background-color: rgba(0, 0, 0, .15); +} +:root.burichan .qr-link { + border-color: rgb(199, 203, 225) rgb(199, 203, 225) rgb(184, 188, 210); + background: linear-gradient(#E5E9FF, #D6DAF0) repeat scroll 0% 0% transparent; +} +:root.burichan .qr-link:hover { + background: #D9DDF3; +} + +/* Menu */ +:root.burichan #menu { + color: #000000; +} +:root.burichan .entry { + font-size: 12pt; +} +:root.burichan .focused.entry { + background: rgba(255, 255, 255, .33); +} + +/* Unread */ +:root.burichan .unread-mark-read { + background-color: rgba(214,218,240,0.5); +} + +/* Thread Watcher */ +:root.burichan .replies-quoting-you > a, :root.burichan #watcher-link.replies-quoting-you, :root.burichan .last-page > a > .watcher-page { + color: #F00; +} + +/* Watcher Favicon */ +:root.burichan .watch-thread-link +{ + background-image: url("data:image/svg+xml,"); +} +`; + + var futaba = `/* General */ +:root.futaba .dialog { + background-color: #F0E0D6; + border-color: #D9BFB7; +} +:root.futaba .field:focus, +:root.futaba .field.focus { + border-color: #EA8; +} + +/* Header */ +:root.futaba #header-bar.dialog { + background-color: rgba(240,224,214,0.98); +} +:root.futaba:not(.fixed) #header-bar, :root.futaba #notifications { + font-size: 11pt; +} +:root.futaba #header-bar, :root.futaba #notifications { + color: #B86; +} +:root.futaba #header-bar a, :root.futaba #notifications a { + color: #800000; +} + +/* Settings */ +:root.futaba #fourchanx-settings fieldset, :root.futaba .section-main div::before { + border-color: #D9BFB7; +} +:root.futaba .suboption-list > div:last-of-type { + background-color: #F0E0D6; +} + +/* Catalog */ +:root.futaba.catalog-hover-expand .catalog-container:hover > .post { + background-color: #F0E0D6; +} +:root.futaba.werkTyme .catalog-thread:not(:hover), +:root.futaba.werkTyme:not(.catalog-hover-expand) .catalog-thread, +:root.futaba.catalog-hover-expand .catalog-container:hover > .post, +:root.futaba.catalog-hover-expand .catalog-container:hover .catalog-reply { + border-color: #D9BFB7; +} + +/* Quote */ +:root.futaba .backlink.deadlink { + color: #00E !important; +} +:root.futaba .inline { + border-color: #D9BFB7; + background-color: rgba(255, 255, 255, .14); +} + +/* Fappe and Werk Tyme */ +:root.futaba .indicator { + color: #F0E0D6; +} + +/* Anonymize */ +:root.futaba.anonymize $site$info$name::before { + font-size: 12pt; +} + +/* QR */ +.futaba #dump-list::-webkit-scrollbar-thumb { + background-color: #F0E0D6; + border-color: #D9BFB7; +} +:root.futaba .qr-preview { + background-color: rgba(0, 0, 0, .15); +} +:root.futaba .qr-link { + border-color: rgb(225, 209, 199) rgb(225, 209, 199) rgb(210, 194, 184); + background: linear-gradient(#FFEFE5, #F0E0D6) repeat scroll 0% 0% transparent; +} +:root.futaba .qr-link:hover { + background: #F0E0D6; +} + +/* Menu */ +:root.futaba #menu { + color: #800000; +} +:root.futaba .entry { + font-size: 12pt; +} +:root.futaba .focused.entry { + background: rgba(255, 255, 255, .33); +} + +/* Unread */ +:root.futaba .unread-mark-read { + background-color: rgba(240,224,214,0.5); +} + +/* Thread Watcher */ +:root.futaba .replies-quoting-you > a, :root.futaba #watcher-link.replies-quoting-you, :root.futaba .last-page > a > .watcher-page { + color: #F00; +} + +/* Watcher Favicon */ +:root.futaba .watch-thread-link +{ + background-image: url("data:image/svg+xml,"); +} +`; + + var linkifyAudio = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAitJREFUOE9jYCAWKJWwavr0KyXWb/FIbDtUFFyzJx6nVofE2Xo5nXsj0rqPNSR0nVkR2Hjmgmfd+U9Otdf+m5Vf/6+SfeU/R9ChVVgNYDRtlfJuuPA/rPfe/4QpD/6nznj0P27Kw/9unff/69Xf+69c/+C/SO7N/0z+OAxgMmmRCe++/r9i3ev/KWvf/vdY8PK/bt/9/wrNV3/IN5y/IVt1YqNg4pGTTP4HsbuA2bhZ2qvpyn+xjIObxAp3VwqlrgngLFyryVy5nhPmZJHANS2cwYexG8BmVC/pWn3hP4NZlzWuQDJI3dIiFnUUuwEsQAOcq87jNcC7fHeLUtJxHF4AGmBWeAavAWH1+1rUUk7giAWjOknllON4DXAs2NEiG4/DBQxAF/CFHfrPYI4jDFSLuJVjNrUJhB/B7gIGo1pJRt99GAZYJK7wLJ1z7Xzl4vu/7aqv/GRBj0bjqAX2qb0nJ7mXH17C4HcUxQA+hymWtSue/C5a9up/9Ozn/7Vr7v1nRY7GqMb91T3b3v6vWvPmf/S0p/9ZQk+DDLCBRSOz06Jqk+o7/21nvfqvsebDf7kZL/5zBaxphkezd+OFn7HzXvz3Wvjmv9a8N//5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T4gWFgkCBJQ0EIFdcZzBCeqqh4qdk7VW2ChPusw02sAYKU7z7wEAAA2piQKFbrWSHazc1J0XWs5pdxPDykcVX+7Y9UxUsSo+s7PibqPFBRV/C5qi4i/UkrJrc7L47Bt4ZWnUaMCAE9GSrtKBQD2fR+bnAEAeOn7dUTOwApe35bDsPz0zsniQlV98IN0tJ3f6P0XAMA/kxou7OXCdnoAAAAASUVORK5CYII='; + + var linkifyClyp = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAwUExURTSY22ey5E2l4KbS75rM7Y3F64C/6f///8zl9nS45r/f9PL5/UGe3bPY8Vqr4v///wNjrzUAAAABYktHRA8YugDZAAAAB3RJTUUH4AINEi85AIH95AAAAE9JREFUCNdjYMAGGBWgDGYHCM2a3hkAZmi0dzSBaKaO9o5moCqmLiCjYzNQyw4QowIodQzI6E0AKcpo72gE6+Jyb1kAMehUA9RktgdYbQYAjGIVNGGXBJkAAAAASUVORK5CYII='; + + var linkifyDailymotion = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURQBk3ff6/trp+kKO5wZt3xx54q7P9Ozz/IS17zOG5WKh653E8sbc9/GbbcoAAABZSURBVAjXY2BAASyhDhAGc9oECMOjyAAiESEEYrBYpLWBGcwHxcvBjDDxHelghpF0yDQwY3kVgweEUeEQDWbMEepqAjO8FMsLIeYsU8o+BrbCdWboTAe4AwALXxWGjW41FwAAAABJRU5ErkJggg=='; + + var linkifyGfycat = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAjVBMVEWn3gCo3gSr3w2t4BSu4Bav4Ri35C+45DK45DO55DXA50rA50vB50zC6E/D6FTF6VjG6VvL62vN7G/P7XbQ7XfW74vY8JDa8ZTe8qDe8q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AAAAASUVORK5CYII='; + + var photon = `/* General */ +:root.photon .dialog { + background-color: #DDD; + border-color: #CCC; +} +:root.photon .field:focus, +:root.photon .field.focus { + border-color: #EA8; +} + +/* 4chan style fixes */ +:root.photon #arc-list tr:nth-of-type(odd) span.quote { + color: #C0E17A; +} +:root.photon.highlight-you .quotesYou$site$highlightable$reply { + border-left: 3px solid rgba(221, 0, 0, .8) !important; +} +:root.photon.highlight-own .yourPost$site$highlightable$reply { + border-left: 3px dashed rgba(221, 0, 0, .8) !important; +} + +/* Header */ +:root.photon #header-bar.dialog { + background-color: rgba(221,221,221,0.98); +} +:root.photon:not(.fixed) #header-bar, :root.photon #notifications { + font-size: 9pt; +} +:root.photon #header-bar, :root.photon #notifications { + color: #333; +} +:root.photon #header-bar a, :root.photon #notifications a { + color: #FF6600; +} + +/* Settings */ +:root.photon #fourchanx-settings fieldset, :root.photon .section-main div::before { + border-color: #CCC; +} +:root.photon .suboption-list > div:last-of-type { + background-color: #DDD; +} + +/* Catalog */ +:root.photon.catalog-hover-expand .catalog-container:hover > .post { + background-color: #DDD; +} +:root.photon.werkTyme .catalog-thread:not(:hover), +:root.photon.werkTyme:not(.catalog-hover-expand) .catalog-thread, +:root.photon.catalog-hover-expand .catalog-container:hover > .post, +:root.photon.catalog-hover-expand .catalog-container:hover .catalog-reply { + border-color: #CCC; +} + +/* Quote */ +:root.photon .backlink.deadlink { + color: #F60 !important; +} +:root.photon .inline { + border-color: #CCC; + background-color: rgba(255, 255, 255, .14); +} + +/* Fappe and Werk Tyme */ +:root.photon .indicator { + color: #DDD; +} + +/* QR */ +.photon #dump-list::-webkit-scrollbar-thumb { + background-color: #DDD; + border-color: #CCC; +} +:root.photon .qr-preview { + background-color: rgba(0, 0, 0, .15); +} +:root.photon .qr-link { + border-color: rgb(206, 206, 206) rgb(206, 206, 206) rgb(191, 191, 191); + background: linear-gradient(#ECECEC, #DDD) repeat scroll 0% 0% transparent; +} +:root.photon .qr-link:hover { + background: #DDDDDD; +} + +/* Menu */ +:root.photon #menu { + color: #333; +} +:root.photon .entry { + font-size: 10pt; +} +:root.photon .focused.entry { + background: rgba(255, 255, 255, .33); +} + +/* Unread */ +:root.photon .unread-mark-read { + background-color: rgba(221,221,221,0.5); +} + +/* Thread Watcher */ +:root.photon .replies-quoting-you > a, :root.photon #watcher-link.replies-quoting-you, :root.photon .last-page > a > .watcher-page { + color: #00F !important; +} + +/* Watcher Favicon */ +:root.photon .watch-thread-link +{ + background-image: url("data:image/svg+xml,"); +} +`; + + var report = `#g-recaptcha, +:root:not(.js-enabled) #captchaContainerAlt { + height: auto; +} +#captchaContainerAlt td:nth-child(2) { + display: table-cell !important; +} + +/* Archive reports */ +#archive-report { + padding: 3px; +} +#archive-report-enabled { + vertical-align: middle; +} +#archive-report > label { + display: block; +} +#archive-report-reason { + display: block; + width: 98%; +} +.archive-report-success { + color: green; +} +.archive-report-error { + color: red; +}`; + + var spooky = `/* General */ +:root.spooky .dialog { + background-color: #171526; + border-color: #707070; +} +:root.spooky .field:focus, +:root.spooky .field.focus { + border-color: #98E; +} + +/* 4chan style fixes */ +:root.spooky #arc-list span.quote { + color: #634C2C; +} +:root.spooky.highlight-you .quotesYou$site$highlightable$reply { + border-left: 3px solid rgba(145, 182, 214, .8) !important; +} +:root.spooky.highlight-own .yourPost$site$highlightable$reply { + border-left: 3px dashed rgba(145, 182, 214, .8) !important; +} + +/* Header */ +:root.spooky #header-bar.dialog { + background-color: rgba(23,21,38,0.98); +} +:root.spooky:not(.fixed) #header-bar, :root.spooky #notifications { + font-size: 9pt; +} +:root.spooky #header-bar, :root.spooky #notifications { + color: #C49756; +} +:root.spooky #board-list a, :root.spooky #shortcuts a { + color: #FE9600; +} +:root.spooky.shortcut-icons .native-settings { + background-image: url('//s.4cdn.org/image/favicon-ws.ico'); +} + +/* Settings */ +:root.spooky #fourchanx-settings fieldset, :root.spooky .section-main div::before { + border-color: #707070; +} +:root.spooky .suboption-list > div:last-of-type { + background-color: #171526; +} + +/* Catalog */ +:root.spooky.catalog-hover-expand .catalog-container:hover > .post { + background-color: #171526; +} +:root.spooky.werkTyme .catalog-thread:not(:hover), +:root.spooky.werkTyme:not(.catalog-hover-expand) .catalog-thread, +:root.spooky.catalog-hover-expand .catalog-container:hover > .post, +:root.spooky.catalog-hover-expand .catalog-container:hover .catalog-reply { + border-color: #707070; +} + +/* Quote */ +:root.spooky .backlink.deadlink { + color: #FE9600 !important; +} +:root.spooky .inline { + border-color: #707070; + background-color: rgba(255, 255, 255, .14); +} + +/* Fappe and Werk Tyme */ +:root.spooky .indicator { + color: #171526; +} + +/* Highlighting */ +:root.spooky .qphl { + outline: 2px solid rgba(145, 182, 214, .8); +} +:root.spooky.highlight-you .quotesYou$site$highlightable$op, +:root.spooky.highlight-you .quotesYou$site$highlightable$reply { + border-left: 3px solid rgba(145, 182, 214, .8); +} +:root.spooky.highlight-own .yourPost$site$highlightable$op, +:root.spooky.highlight-own .yourPost$site$highlightable$reply { + border-left: 3px dashed rgba(145, 182, 214, .8); +} +:root.spooky .filter-highlight$site$highlightable$op, +:root.spooky .filter-highlight$site$highlightable$reply { + box-shadow: inset 5px 0 rgba(145, 182, 214, .5); +} +:root.spooky.highlight-own .yourPost > $site$sideArrows, +:root.spooky.highlight-you .quotesYou > $site$sideArrows, +:root.spooky .filter-highlight > $site$sideArrows { + color: rgb(155, 185, 210); +} + +/* QR */ +.spooky #dump-list::-webkit-scrollbar-thumb { + background-color: #171526; + border-color: #707070; +} +:root.spooky .qr-preview { + background-color: rgba(0, 0, 0, .15); +} +:root.spooky #qr .field { + background-color: rgb(26, 27, 29); + color: rgb(197,200,198); + border-color: rgb(40, 41, 42); +} +:root.spooky #qr .field:focus, +:root.spooky #qr .field.focus { + border-color: rgb(254, 150, 0) !important; + background-color: rgb(30,32,36); +} +:root.spooky .persona button { + background: linear-gradient(to bottom, #2E3035, #222427) no-repeat; + color: rgb(197,200,198); + border-color: rgb(40, 41, 42); + outline: none; +} +:root.spooky .persona button::-moz-focus-inner { + border: none; +} +:root.spooky .persona button:focus { + border-color: rgb(254, 150, 0); +} +:root.spooky #qr.sjis-preview #sjis-toggle, +:root.spooky #qr.tex-preview #tex-preview-button { + background: rgb(26, 27, 29); +} +:root.spooky #qr select, +:root.spooky #file-n-submit > input, +:root.spooky #qr-draw-button { + border-color: rgb(40, 41, 42); +} +:root.spooky #qr-filename { + color: rgb(197,200,198); +} + +:root.spooky .qr-link { + border-color: rgb(8, 6, 23) rgb(8, 6, 23) rgb(0, 0, 8); + background: linear-gradient(#262435, #171526) repeat scroll 0% 0% transparent; +} +:root.spooky .qr-link:hover { + background: #1A1829; +} + + +/* Menu */ +:root.spooky #menu { + color: #FE9600; +} +:root.spooky .entry { + font-size: 10pt; +} +:root.spooky .focused.entry { + background: rgba(255, 255, 255, .33); +} + +/* Unread */ +:root.spooky .unread-line { + border-color: rgb(197, 200, 198); + visibility: visible; + opacity: 1; +} +:root.spooky .unread-mark-read { + background-color: rgba(23,21,38,0.5); +} + +/* Thread Watcher */ +:root.spooky .replies-quoting-you > a, :root.spooky #watcher-link.replies-quoting-you, :root.spooky .last-page > a > .watcher-page { + color: #F00 !important; +} + +/* Watcher Favicon */ +:root.spooky .watch-thread-link +{ + background-image: url("data:image/svg+xml,"); +} +`; + + var style = `/* General */ +.dialog { + border: 1px solid; + display: block; + background-color: inherit; +} +.dialog:not(#qr):not(#thread-watcher):not(#header-bar) { + box-shadow: 0 1px 2px rgba(0, 0, 0, .15); +} +#qr, +#thread-watcher { + box-shadow: -1px 2px 2px rgba(0, 0, 0, 0.25); +} +.captcha-img, +.field { + background-color: #FFF; + border: 1px solid #CCC; + -moz-box-sizing: border-box; + box-sizing: border-box; + color: #333; + font: 13px sans-serif; + outline: none; + transition: color .25s, border-color .25s; +} +.field::-moz-placeholder { + color: #AAA; + font-size: 13px; + opacity: 1; +} +.captch-img:hover, +.field:hover { + border-color: #999; +} +.field:hover, .field:focus, .field.focus { + color: #000; +} +.field[disabled] { + background-color: #F2F2F2; + color: #888; +} +.field::-webkit-search-decoration { + display: none; +} +.move { + cursor: move; + overflow: hidden; +} +label { + cursor: pointer; +} +a[href="javascript:;"] { + text-decoration: none; +} +.warning { + color: red; +} +:root.sw-yotsuba #boardNavDesktop, :root.sw-yotsuba #boardNavMobile { + display: none !important; +} +:root.hide-bottom-board-list $site$boardListBottom { + display: none; +} +body.hasDropDownNav{ + margin-top: 5px; +} +:root:not(.keyboard-focus) a { + outline: none; +} +.painted { + border-radius: 3px; + padding: 0px 2px; +} +[hidden] { + display: none !important; +} + +/* 4chan style fixes */ +/* overrides 4chan CSS on div.opContainer, div.op */ +:root.sw-yotsuba .opContainer, :root.sw-yotsuba .op { + display: block; + overflow: visible; +} +:root.sw-yotsuba .reply > .file > .fileText { + margin: 0 20px; +} +:root.sw-yotsuba #arc-list span.quote { + color: #789922; +} +:root.sw-yotsuba .fileText a { + unicode-bidi: -moz-isolate; + unicode-bidi: -webkit-isolate; +} +:root.sw-yotsuba #g-recaptcha { + min-height: 78px; + height: auto; +} +:root.sw-yotsuba:not(.js-enabled) #postForm { + display: table; +} +:root.sw-yotsuba #captchaContainerAlt td:nth-child(2) { + display: table-cell !important; +} +:root.sw-yotsuba canvas#tegaki-canvas { + background: none; +} +/* Disable obnoxious captcha fade-in. */ +:root.sw-yotsuba > body > div:last-of-type { + transition: none !important; +} +/* Fix captcha scrolling to top of page. */ +:root.sw-yotsuba > body > div[style*=" top: -10000px;"] { + visibility: hidden !important; +} +/* Make long filenames wrap properly: https://github.com/ccd0/4chan-x/issues/1082 */ +:root.sw-yotsuba .post > .file { + /* currently nonstandard but may be added: https://lists.w3.org/Archives/Public/www-style/2016Mar/0352.html, https://bugzilla.mozilla.org/show_bug.cgi?id=1296042 */ + word-break: break-word; +} +:root.sw-yotsuba:not(.ua-webkit):not(.ua-blink) .fileText { + word-wrap: break-word; + max-width: calc(100vw - 90px); +} +:root.sw-yotsuba > body.is_catalog .thread > a > img { + display: inline-block; +} +/* Links to NSFW boards */ +:root.sw-yotsuba .nwsb { + display: inline; +} +:root.sw-yotsuba .fileText { + max-width: auto; + white-space: normal; +} + +/* Ads */ +:root.sw-yotsuba .ad-cnt > *, :root.sw-yotsuba .adg-rects > *, :root.sw-yotsuba .bsa-cnt { + height: auto !important; +} +:root.sw-yotsuba:not(.ads-loaded) hr.abovePostForm, +:root.sw-yotsuba:not(.ads-loaded) .adg-rects > hr, +:root.sw-yotsuba #adg-ol + hr, +:root.sw-yotsuba .danbo-slot:empty { + display: none; +} +:root.sw-yotsuba .adg-rects { + margin: 0; + font-size: 0; +} +:root.sw-yotsuba div.center[style] { + display: none !important; +} + +/* Tinyboard / vichan conflicts */ +#menu > .hide-thread-link { + width: auto; + height: auto; + overflow: visible; + background-image: none; +} +#menu label.entry { + display: block; +} +#fourchanx-settings label { + display: inline; +} +.intro a[href="javascript:;"], +#menu a { + margin: 0; +} +.gal-buttons.gal-buttons a { + font-size: inherit; +} +:root.sw-tinyboard.fixed.top-header:not(.autohide) .boardlist, +:root.sw-tinyboard.fixed.top-header:not(.autohide) .bar.top { + position: static; +} +:root.sw-tinyboard.fixed.top-header:not(.autohide) div.pages.top { + top: auto; + bottom: 0; +} +:root.sw-tinyboard.fixed.top-header.autohide .boardlist, +:root.sw-tinyboard.fixed.top-header.autohide .bar.top { + z-index: 3; +} + +/* Tinyboard site style conflicts */ +:root[data-host="fufufu.moe"].fixed.top-header:not(.autohide) div.pages.top { + top: 26px; + bottom: auto; +} +:root[data-host="merorin.com"].fixed.top-header:not(.autohide) span.settings { + top: 26px; +} +:root[data-host="fufufu.moe"]:not(.fixed) #header-bar { + margin-top: 38px; +} +:root[data-host="lainchan.org"]:not(.fixed) #header-bar { + margin-top: 17px; +} +:root[data-host="smuglo.li"]:not(.fixed) #header-bar { + margin-top: 8px; +} + +/* Anti-autoplay */ +audio.controls-added { + display: block; + margin: auto; + white-space: normal; +} +:root.anti-autoplay div.embed { + position: static; + width: auto; + height: auto; + text-align: center; +} +:root.anti-autoplay .autoplay-removed { + visibility: visible !important; + min-width: 640px; + min-height: 360px; +} + +/* fixed, z-index */ +#overlay, +#qp, #ihover, +#navlinks, .fixed #header-bar, +:root.float #updater, +:root.float #thread-stats, +#qr { + position: fixed; +} +#overlay { + z-index: 999; +} +#qp, #ihover { + z-index: 60; +} +#menu, .gal-buttons { + z-index: 50; +} +#updater, #thread-stats { + z-index: 40; +} +:root.fixed #header-bar, #notifications { + z-index: 35; +} +#a-gallery { + z-index: 30; +} +#navlinks { + z-index: 25; +} +#qr { + z-index: 20; +} +#embedding { + z-index: 11; +} +:root.fixed-watcher #thread-watcher { + z-index: 10; +} +:root.fixed:not(.gallery-open) #header-bar:not(:hover) { + z-index: 8; +} +#thread-watcher { + z-index: 5; +} + +/* Header */ +.fixed.top-header body { + padding-top: 2em; +} +.fixed.bottom-header body { + padding-bottom: 2em; +} +.fixed #header-bar { + right: 0; + left: 0; + padding: 3px 4px 4px; + font-size: 12px; +} +.fixed.top-header #header-bar { + top: 0; +} +.fixed.bottom-header #header-bar { + bottom: 0; +} +#header-bar { + border-width: 0; + transition: all .1s .05s ease-in-out; +} +:root.fixed #header-bar { + box-shadow: -5px 1px 10px rgba(0, 0, 0, 0.20); +} +:root.centered-links #shortcuts { + width: 300px; + text-align: right; +} +:root.centered-links #header-bar { + text-align: center; +} +#custom-board-list { + font-size: 13px; + vertical-align: middle; +} +#full-board-list { + vertical-align: middle; +} +:root.centered-links #custom-board-list { + position: relative; + left: 150px; +} +.fixed.top-header #header-bar { + border-bottom-width: 1px; +} +.fixed.bottom-header #header-bar { + box-shadow: 0 -1px 2px rgba(0, 0, 0, .15); + border-top-width: 1px; +} +.fixed.bottom-header #header-bar .menu-button i { + border-top: none; + border-bottom: 6px solid; +} +.fixed #header-bar.autohide:not(:hover) { + box-shadow: none; + transition: all .8s .6s cubic-bezier(.55, .055, .675, .19); +} +.fixed.top-header #header-bar.autohide:not(:hover) { + margin-bottom: -1em; + -webkit-transform: translateY(-100%); + transform: translateY(-100%); +} +.fixed.bottom-header #header-bar.autohide:not(:hover) { + -webkit-transform: translateY(100%); + transform: translateY(100%); +} +#scroll-marker { + left: 0; + right: 0; + height: 10px; + position: absolute; +} +#header-bar:not(.autohide) #scroll-marker { + pointer-events: none; +} +#header-bar #scroll-marker { + display: none; +} +.fixed #header-bar #scroll-marker { + display: block; +} +.fixed.top-header #header-bar #scroll-marker { + top: 100%; +} +.fixed.bottom-header #header-bar #scroll-marker { + bottom: 100%; +} +#board-list a, #shortcuts a:not(.entry) { + text-decoration: none; + padding: 1px; +} +#shortcuts:empty { + display: none; +} +.brackets-wrap::before { + content: "\\00a0["; +} +.brackets-wrap::after { + content: "]\\00a0"; +} +.dead-thread, +.disabled:not(.replies-quoting-you) { + opacity: .45; +} +#shortcuts { + float: right; +} +:root.autohiding-scrollbar #shortcuts { + margin-right: 12px; +} +.shortcut { + margin-left: 3px; + vertical-align: middle; +} +:root.shortcut-icons .native-settings { + font-size: 0; + color: transparent; + display: inline-block; + vertical-align: top; + height: 12px; + width: 14px; + background: url('//s.4cdn.org/image/favicon.ico') 0px -1px no-repeat; +} +#navbotright, +#navtopright { + display: none; +} +#toggleMsgBtn { + display: none !important; +} +.current, +:root.sw-yotsuba div#boardNavDesktopFoot a.current { + font-weight: bold; +} +@media (min-width: 1300px) { + :root.sw-yotsuba.fixed:not(.centered-links) #header-bar { + white-space: nowrap; + display: -webkit-flex; + display: flex; + -webkit-align-items: center; + align-items: center; + } + :root.sw-yotsuba.fixed:not(.centered-links) #board-list { + -webkit-flex: auto; + flex: auto; + } + :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list { + display: -webkit-flex; + display: flex; + } + :root.sw-yotsuba.fixed:not(.centered-links) .hide-board-list-container { + -webkit-flex: none; + flex: none; + margin-right: 5px; + } + :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList { + -webkit-flex: auto; + flex: auto; + display: -webkit-flex; + display: flex; + width: 0px; /* XXX Fixes Edge not shrinking the board list below default size when needed */ + } + :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > a, + :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span:not(.space):not(.spacer) { + -webkit-flex: none; + flex: none; + padding: .17em; + margin: -.17em -.32em; + } + :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span { + pointer-events: none; + } + :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span.space { + -webkit-flex: 0 .63 .63em; + flex: 0 .63 .63em; + } + :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span.spacer { + -webkit-flex: 0 .38 .38em; + flex: 0 .38 .38em; + } + :root.sw-yotsuba.fixed:not(.centered-links) #shortcuts { + float: initial; + -webkit-flex: none; + flex: none; + display: -webkit-flex; + display: flex; + -webkit-align-items: center; + align-items: center; + } +} +/* 4chan X link brackets */ +.brackets-wrap::before { + content: "["; +} +.brackets-wrap::after { + content: "]"; +} +/* Notifications */ +#notifications { + position: fixed; + top: 0; + height: 0; + text-align: center; + right: 0; + left: 0; + visibility: visible; +} +#notifications:empty { + display: none; +} +:root.fixed.top-header:not(.gallery-open) #header-bar #notifications, +:root.fixed.top-header #header-bar.autohide #notifications { + position: absolute; + top: 100%; +} +.notification { + color: #FFF; + font-weight: 700; + text-shadow: 0 1px 2px rgba(0, 0, 0, .5); + box-shadow: 0 1px 2px rgba(0, 0, 0, .15); + border-radius: 2px; + margin: 1px auto; + width: 550px; + max-width: 100%; + position: relative; + transition: all .25s ease-in-out; +} +.notification.error { + background-color: hsla(0, 100%, 38%, .9); +} +.notification.warning { + background-color: hsla(36, 100%, 38%, .9); +} +.notification.info { + background-color: hsla(200, 100%, 38%, .9); +} +.notification.success { + background-color: hsla(104, 100%, 38%, .9); +} +.notification a { + color: white; +} +.notification > .close { + padding: 7px; + top: 0px; + right: 5px; + position: absolute; +} +.notification > .fa-times::before { + font-size: 11px !important; +} +.message { + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 6px 20px; + max-height: 200px; + width: 100%; + overflow: auto; + white-space: pre-line; +} +.message a { + text-decoration: underline; +} +:root.tainted .report-error { + display: none; +} + +/* Settings */ +:root.fourchan-x body { + -moz-box-sizing: border-box; + box-sizing: border-box; +} +#overlay { + background-color: rgba(0, 0, 0, .5); + display: -webkit-flex; + display: flex; + top: 0; + left: 0; + height: 100%; + width: 100%; +} +#fourchanx-settings { + -moz-box-sizing: border-box; + box-sizing: border-box; + box-shadow: 0 0 15px rgba(0, 0, 0, .15); + height: 600px; + max-height: 100%; + width: 900px; + max-width: 100%; + margin: auto; + padding: 5px; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: column; + flex-direction: column; +} +#fourchanx-settings > nav { + padding: 2px 2px 8px; + display: -webkit-flex; + display: flex; +} +#fourchanx-settings > nav a { + text-decoration: underline; +} +#fourchanx-settings > nav a.close { + text-decoration: none; + padding: 0 2px; + margin: 0; +} +.section-container { + -webkit-flex: 1; + flex: 1; + position: relative; + overflow: auto; + padding-right: 5px; + overscroll-behavior: contain; +} +.sections-list { + -webkit-flex: 1; + flex: 1; +} +.export, .import, .reset { + cursor: pointer; + text-decoration: none !important; +} +.tab-selected { + font-weight: 700; +} +.section-sauce ul, +.section-advanced ul { + list-style: none; + margin: 0; +} +.section-sauce ul { + padding: 8px; +} +.section-advanced ul { + padding: 0px; +} +.section-sauce li, +.section-advanced li { + padding-left: 4px; +} +.section-main ul { + margin: 0; + padding: 0 0 0 16px; +} +.section-main li { + white-space: pre-line; + list-style: disc; +} +.section-main li:not(:first-of-type) { + margin-top: 4px; +} +.section-main label { + text-decoration: underline; +} +div[data-checked="false"] > .suboption-list { + display: none; +} +.suboption-list { + position: relative; +} +.suboption-list::before { + content: ""; + display: inline-block; + position: absolute; + left: .7em; + width: 0; + height: 100%; + border-left: 1px solid; +} +.suboption-list > div { + position: relative; + padding-left: 1.4em; +} +.suboption-list > div::before { + content: ""; + display: inline-block; + position: absolute; + left: .7em; + width: .7em; + height: .6em; + border-left: 1px solid; + border-bottom: 1px solid; +} +#fourchanx-settings .section-main p { + margin: .5em 0 0; +} +.section-filter ul { + padding: 0; +} +.section-filter li { + margin: 10px 40px; + list-style: disc; +} +.section-filter textarea { + height: 500px; +} +.section-main a, .section-filter a, .section-advanced a { + text-decoration: underline; +} +#sauce-doc-expand:not(:checked) ~ #sauce-doc { + max-height: 130px; + overflow: auto; +} +#sauce-doc > label { + float: right; + margin: 0 5px; +} +/* XXX for OneeChan */ +#sauce-doc-expand + .riceCheck { + display: none; +} +.section-sauce textarea { + height: 430px; +} +.section-advanced .field[name="boardnav"] { + width: 100%; +} +.section-advanced textarea { + height: 150px; +} +.section-advanced textarea[name="archiveLists"], +.section-advanced textarea[name="externalCatalogURLs"], +.section-advanced textarea[name="knownBanners"] { + height: 75px; +} +.section-advanced .archive-cell { + min-width: 160px; + text-align: center; +} +.section-advanced #archive-board-select { + position: absolute; +} +.section-advanced .note { + font-size: 0.8em; + font-style: italic; + margin-left: 10px; +} +.section-advanced .note code { + font-style: normal; + font-size: 11px; +} +.favicon-preview > img { + vertical-align: middle; +} +.favicon-preview > img:nth-of-type(3n+1) { + margin-left: 4px; +} +.section-keybinds .field { + font-family: monospace; +} +#fourchanx-settings fieldset { + border: 1px solid; + border-radius: 3px; + padding: 0.35em 0.625em 0.75em; + margin: 0px 2px; +} +#fourchanx-settings legend { + font-weight: 700; + color: inherit; +} +#fourchanx-settings textarea { + font-family: monospace; + width: 100%; + resize: vertical; +} +#fourchanx-settings code { + color: #000; + background-color: #FFF; + padding: 0 2px; +} +#fourchanx-settings th { + text-align: center; + font-weight: bold; +} +#fourchanx-settings p { + margin: 1em 0px; +} +#fourchanx-settings table { + margin: auto; +} + +/* Index */ +:root.index-loading .navLinks:not(.json-index), +:root.index-loading .board:not(.json-index), +:root.index-loading .pagelist:not(.json-index), +:root.infinite-mode .pagelist, +:root.all-pages-mode .pagelist, +:root.catalog-mode .pagelist, +:root:not(.catalog-mode) .indexlink, +:root.catalog-mode .cataloglink, +:root:not(.catalog-mode) #hidden-label, +:root:not(.catalog-mode) #index-size { + display: none; +} +#index-search { + padding-right: 1.5em; + width: 100px; + transition: color .25s, border-color .25s, width .25s; +} +#index-search:focus, +#index-search[data-searching] { + width: 200px; +} +#index-search-clear { + color: gray; + display: inline-block; + position: relative; + left: -1em; + width: 0; +} +/* \`\`::-webkit-*'' selectors break selector lists on Firefox. */ +#index-search::-webkit-search-cancel-button { + display: none; +} +#index-search:not([data-searching]) + #index-search-clear { + display: none; +} +#index-options { + float: right; +} +#lastlong-options { + display: inline-block; + vertical-align: middle; + height: 28px; + margin: -14px 0; +} +#lastlong-options > input { + padding: 0; + border: 0 !important; + text-align: center; + background: transparent; + display: block; + font-size: 12px; + height: 12px; + width: 30px; + margin: 1px 0; +} +.summary { + text-decoration: none; +} + +/* Catalog */ +:root.catalog-mode .board { + text-align: center; +} +.catalog-thread { + display: inline-block; + -moz-box-sizing: border-box; + box-sizing: border-box; + border: 1px solid transparent; + word-wrap: break-word; + vertical-align: top; + position: relative; +} +/* overrides 4chan CSS on div.thread */ +.catalog-thread.catalog-thread { + margin: 2px; +} +.catalog-small > .catalog-thread { + width: 165px; + height: 320px; +} +.catalog-large > .catalog-thread { + width: 270px; + height: 410px; +} +:root.catalog-hover-expand .catalog-thread:hover { + z-index: 1; +} +.catalog-container { + position: absolute; + top: -4px; + left: 0; + right: 0; + bottom: 0; +} +.catalog-container:not(:hover), +:root:not(.catalog-hover-expand) .catalog-container { + overflow: hidden; +} +.catalog-post { + position: absolute; + top: 4px; + left: 0; + right: 0; + border: 1px solid transparent; + padding-top: 20px; +} +/* overrides inline CSS from Index.cb.hoverAdjust */ +:root:not(.catalog-hover-expand) .catalog-post { + left: 0 !important; + right: 0 !important; +} +/* overrides 4chan CSS on div.post */ +.catalog-post.catalog-post { + margin: -21px -1px -1px; + overflow: visible; +} +.catalog-thread.noFile > * > .catalog-post { + margin-top: -7px; + padding-top: 6px; +} +:root.catalog-hover-expand .catalog-container:hover > .catalog-post { + margin-left: -61px; + margin-right: -61px; +} +:root.catalog-hover-expand .catalog-container:hover > * > :not(.catalog-replies) { + padding-left: 2px; + padding-right: 2px; +} +.catalog-link { + display: block; + position: relative; +} +.catalog-thumb { + border-radius: 2px; + box-shadow: 0 0 5px rgba(0, 0, 0, .25); + vertical-align: top; +} +.catalog-thumb.spoiler-file { + width: 100px; + height: 100px; +} +.catalog-thumb.deleted-file { + width: 127px; + height: 13px; + padding: 20px 11px; +} +.catalog-thumb.no-file { + width: 77px; + height: 13px; + padding: 20px 36px; +} +.catalog-icons > img, +.catalog-stats > .menu-button { + width: 1em; + height: 1em; + margin: 0; + vertical-align: text-top; + padding-left: 2px; +} +.catalog-stats > .menu-button { + font-weight: normal; +} +.catalog-stats > .menu-button > i::before { + line-height: 11px; +} +.catalog-stats { + font-size: 10px; + font-weight: 700; + padding-top: 2px; +} +.catalog-stats > [title] { + cursor: help; +} +.catalog-post > .postMessage { + margin: 0; + padding-bottom: .3em; +} +.catalog-container:not(:hover) > * > .file, +.catalog-container:not(:hover) > * > .postInfo > :not(.subject), +.catalog-container:not(:hover) > * > .catalog-replies, +.catalog-container:not(:hover) .extra-linebreak, +.catalog-container:not(:hover) .abbr, +:root:not(.catalog-hover-expand) .catalog-container > * > .file, +:root:not(.catalog-hover-expand) .catalog-container > * > .postInfo > :not(.subject), +:root:not(.catalog-hover-expand) .catalog-container > * > .catalog-replies, +:root:not(.catalog-hover-expand) .catalog-container .extra-linebreak, +:root:not(.catalog-hover-expand) .catalog-container .abbr, +.catalog-thread > .catalog-container > :not(.catalog-post), +.catalog-post > .file > :not(.fileText), +.catalog-post > * > .fileText > :not(:first-child), +.catalog-post > .postInfo > :not(.subject):not(.nameBlock):not(.dateTime), +.catalog-post > .postInfo > .nameBlock > .contact-links, +.catalog-post > * > * > .posteruid, +.catalog-post > * > * > .postJumper, +:root.bottom-backlinks .catalog-post > .container, +.post:not(.catalog-post) > .catalog-link, +.post:not(.catalog-post) > .catalog-stats, +.post:not(.catalog-post) > .catalog-replies { + display: none; +} +.catalog-post > .file { + position: absolute; + left: 0; + right: 0; + top: 0; + min-height: 20px; + background-color: inherit; +} +.catalog-post > * > .fileText { + position: relative; + padding: 2px; + background-color: inherit; +} +.catalog-small .catalog-post > * .fileText { + font-size: 10px; +} +.catalog-post > * > .fileText:not(:hover) { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.catalog-post > * > .fileText:hover { + z-index: 1; +} +/* overrides 4chan CSS on div.post div.postInfo */ +.catalog-post > .postInfo.postInfo { + width: auto; +} +.catalog-post > * > .subject { + display: block; +} +.catalog-post > * > .dateTime { + display: inline-block; + font-style: italic; +} +:root.catalog-hover-expand .catalog-container:hover > * > * > .nameBlock, +:root.catalog-hover-expand .catalog-container:hover > * > * > .dateTime, +:root.catalog-hover-expand .catalog-container:hover > * > .postMessage:not(:empty) { + padding-top: .3em; +} +.catalog-post .extra-linebreak { + content: ''; /* makes this work in Blink/WebKit */ + display: block; + margin-top: .3em; +} +.catalog-reply { + text-align: left; + white-space: nowrap; + border-top: 1px solid transparent; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: row; + flex-direction: row; + -webkit-align-items: stretch; + align-items: stretch; +} +.catalog-reply > * { + padding: 3px; + overflow: hidden; + -webkit-flex: none; + flex: none; +} +.catalog-reply > span { + font-style: italic; + font-weight: bold; +} +.catalog-reply-excerpt { + -webkit-flex: 1 1 auto; + flex: 1 1 auto; +} +.catalog-post .prettyprinted { + max-width: 100%; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.catalog-post .MathJax_Display { + text-align: center !important; +} +.catalog-container:not(:hover) .exif, +:root:not(.catalog-hover-expand) .catalog-container .exif { + display: none !important; +} +.catalog-post > * > .exif { + border-collapse: collapse; +} +:root.catalog-hover-expand .catalog-container:hover .exif[style*="display: block;"] { + display: inline-block !important; +} +.catalog-post > * > .exif, +.catalog-post > * > .exif > tbody { + background-color: inherit; +} +.catalog-post > * > .exif, +.catalog-post > * > .exif td { + min-width: 0; +} +.catalog-post > * > .exif td { + padding-top: 1px; +} +:root.hats-enabled .catalog-thread::after { + content: ''; + pointer-events: none; + position: absolute; + background-size: contain; +} +:root.hats-enabled .catalog-small > .catalog-thread::after { + left: -8px; + top: -59px; + width: 96px; + height: 96px; +} +:root.hats-enabled:not(.werkTyme) .catalog-small > .catalog-thread:not(.noFile)::after { + left: calc(67px - .3px * var(--tn-w)); +} +:root.hats-enabled .catalog-large > .catalog-thread::after { + left: -15px; + top: -98px; + width: 160px; + height: 160px; +} +:root.hats-enabled:not(.werkTyme) .catalog-large > .catalog-thread:not(.noFile)::after { + left: calc(110px - .5px * var(--tn-w)); +} + +/* Copy Text Link's textarea element */ +textarea.copy-text-element { + height: 0; + width: 0; + position: absolute; + top: -10000px; +} + +/* Announcement Hiding */ +:root.hide-announcement $site$psa { + display: none; +} +.hide-announcement-button { + opacity: 0.4; + float: left; +} + +/* Unread */ +.unread-line { + margin: 0; + border-color: rgb(255,0,0); +} +.unread-line + br { + display: none; +} +.unread-mark-read { + float: right; + clear: both; + width: 100%; + text-align: right; +} +:not(.unread-thread) > .unread-mark-read { + display: none; +} + +/* Thread Updater */ +#updater { + background: none; + border: none; + box-shadow: none; +} +#updater > .move { + position: absolute; + top: -5px; + bottom: -5px; + left: -5px; + right: -5px; + z-index: -1; +} +#updater > div:last-child { + text-align: center; +} +#updater input[type="number"] { + width: 4em; +} +:root.float #updater { + padding: 0px 3px; +} +:root:not(.float).shortcut-icons #updater { + display: inline-block; + min-width: 12pt; + text-align: right; +} +.new { + color: limegreen; +} +#update-status:not(.empty) + #update-timer:not(.empty):not(.loading) { + margin-left: 5px; +} +#update-timer { + cursor: pointer; +} + +/* Thread Watcher */ +#thread-watcher { + position: absolute; +} +#thread-watcher { + padding-bottom: 3px; + padding-left: 3px; + white-space: nowrap; + min-width: 146px; +} +#watched-threads { + overflow-x: hidden; + overflow-y: auto; +} +#thread-watcher .refresh { + padding: 0px 3px; +} +:root.fixed-watcher #thread-watcher { + position: fixed; +} +:root.fixed-watcher #watched-threads { + /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */ + max-height: 85vh; + max-height: calc(100vh - 75px); +} +:root:not(.fixed-watcher) #watched-threads:not(:hover) { + max-height: 210px; + overflow-y: hidden; +} +#thread-watcher > .move { + padding-top: 3px; +} +#watched-threads > div { + padding-left: 3px; + padding-right: 3px; +} +#watched-threads .watcher-link { + max-width: 250px; + display: -webkit-inline-flex; + display: inline-flex; + -webkit-flex-direction: row; + flex-direction: row; +} +#watched-threads .watcher-page, +#watched-threads .watcher-unread { + -webkit-flex: 0 0 auto; + flex: 0 0 auto; + margin-right: 2px; +} +#watched-threads .watcher-title { + overflow: hidden; + text-overflow: ellipsis; + -webkit-flex: 0 1 auto; + flex: 0 1 auto; +} +#watched-threads .watcher-title:not(:first-child) { + margin-left: 2px; +} +.replies-quoting-you > a, #watcher-link.replies-quoting-you, .last-page > a > .watcher-page { + color: #F00; +} +#thread-watcher a { + text-decoration: none; +} +#thread-watcher .move > .close { + position: absolute; + right: 0px; + top: 0px; + padding: 0px 4px; +} +.watch-thread-link { + padding-top: 18px; + width: 18px; + height: 0px; + display: inline-block; + background-repeat: no-repeat; + opacity: 0.2; + position: relative; + top: 1px; + background-image: url("data:image/svg+xml,"); +} +.watch-thread-link.watched { + opacity: 1; +} + + +/* Thread Stats */ +#thread-stats { + background: none; + border: none; + box-shadow: none; +} +:root.float #thread-stats > .move > :not(#page-count) { + pointer-events: none; +} +:root.float #thread-stats { + padding: 0px 3px; +} +#page-count { + cursor: pointer; +} + +/* Quote */ +.hashlink::before { + content: ' '; + visibility: hidden; +} +.inline + .hashlink { + display: none !important; +} +:root.resurrect-quotes .deadlink { + text-decoration: none !important; +} +.catalog-post .qmark-ct { + display: none; +} +.backlink.deadlink:not(.forwardlink), +.quotelink.deadlink:not(.forwardlink) { + text-decoration: underline !important; +} +:root:not(.catalog-mode) .inlined { + opacity: .5; +} +#qp input, .forwarded { + display: none; +} +.quotelink.forwardlink, +.backlink.forwardlink { + text-decoration: none; + border-bottom: 1px dashed; +} +.filtered { + text-decoration: underline line-through; +} +:root.hide-backlinks .backlink.filtered, +:root.hide-backlinks .backlink.filtered + .hashlink.filtered { + display: none; +} +.postNum + .container::before { + content: " "; +} +:root.bottom-backlinks .container { + display: block; + clear: both; + margin: 0 4px; +} +:root.bottom-backlinks .backlink { + font-size: 90%; +} +.inline { + border: 1px solid; + display: table; + margin: 2px 0; +} +.container ~ .inline { + margin-left: 20px; +} +:root.catalog-mode .inline { + display: none; +} +.inline .post { + border: 0 !important; + background-color: transparent !important; + display: table !important; + margin: 0 !important; + padding: 1px 2px !important; +} +#qp > .opContainer::after { + content: ''; + clear: both; + display: table; +} +#qp .post { + border: none; + margin: 0; + padding: 2px 2px 5px; +} +#qp img { + max-height: 80vh; + max-width: 50vw; +} + +/* Quote Threading */ +.threadContainer { + margin-left: 20px; + border-left: 1px solid rgba(128,128,128,.3); +} +.threadOP { + clear: both; +} + +/* File */ +.fileText-original, +.fnswitch:hover > .fntrunc, +.fnswitch:not(:hover) > .fnfull, +.expanded-image > .post > .file > .fileThumb > video[data-md5], +.expanded-image > .post > .file > .fileThumb > img[data-md5] { + display: none; +} +.full-image[data-file-i-d] { + display: none; + cursor: pointer; +} +.expanded-image > .post > .file > .fileThumb > .full-image { + display: inline; +} +.expanded-image { + clear: left; +} +.expanding { + opacity: .5; +} +:root.fit-height .full-image { + max-height: 100vh; +} +:root.fit-height.fixed .full-image { + /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */ + max-height: 93vh; + max-height: calc(100vh - 35px); +} +:root.fit-width .full-image { + max-width: 100%; +} +:root.ua-gecko.fit-width .full-image { + width: 100%; +} +.fileThumb > .warning { + clear: both; +} +#ihover { + pointer-events: none; + /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */ + max-height: 95vh; + max-height: calc(100vh - 25px); + max-width: 100vw; +} +/* WEBM Metadata */ +.webm-title > a::before { + content: "title"; + text-decoration: underline; +} +.webm-title.loading > a::after { + content: "..."; +} +.webm-title.error > a:hover::before, +.webm-title.error > a:focus::before { + content: "error"; + text-decoration: none; +} +.webm-title > span { + cursor: text; +} +.webm-title.not-found > span::before { + content: "not found"; +} +.webm-title:not(:hover):not(:focus) > span, +.webm-title:hover > span + a, +.webm-title:focus > span + a { + display: none; +} +/* Volume control */ +input[name="Default Volume"] { + width: 4em; + height: 1ex; + vertical-align: middle; + margin: 0px; +} +/* Fappe and Werk Tyme */ +:root.fappeTyme $site$replyOriginal.noFile, +:root.fappeTyme $site$replyOriginal.noFile + br { + display: none; +} +:root.werkTyme $site$thumbLink, +:root.werkTyme $site$file$thumb, +:root.werkTyme .catalog-thumb:not(.deleted-file):not(.no-file), +:root:not(.werkTyme) .werkTyme-filename { + display: none; +} +.werkTyme-filename { + font-weight: bold; + font-size: 110%; +} +:root.werkTyme .catalog-link { + box-shadow: 0 0 5px rgba(0, 0, 0, .25); + padding: 8px; + text-align: center; +} +:root.werkTyme .catalog-thumb { + box-shadow: none; + padding: 0; + vertical-align: middle; +} +.indicator { + background: rgba(255,0,0,0.8); + font-weight: bold; + display: inline-block; + min-width: 9px; + padding: 0px 2px; + margin: 0 1px; + text-align: center; + color: white; + border-radius: 2px; + cursor: pointer; +} +:root:not(.fappeTyme) #shortcut-fappe, +:root:not(.werkTyme) #shortcut-werk { + display: none; +} + +/* Index/Reply Navigation */ +#navlinks { + font-size: 16px; + top: 25px; + right: 10px; +} +:root.catalog-mode #navlinks { + display: none; +} + +/* Highlighting */ +.qphl { + outline: 2px solid rgba(216, 94, 49, .8); +} +:root.highlight-you .quotesYou$site$highlightable$op, +:root.highlight-you .quotesYou$site$highlightable$reply { + border-left: 3px solid rgba(221, 0, 0, .8); +} +:root.highlight-own .yourPost$site$highlightable$op, +:root.highlight-own .yourPost$site$highlightable$reply { + border-left: 3px dashed rgba(221, 0, 0, .8); +} +.filter-highlight$site$highlightable$op, +.filter-highlight$site$highlightable$reply { + box-shadow: inset 5px 0 rgba(221, 0, 0, .5); +} +:root.highlight-own .yourPost > $site$sideArrows, +:root.highlight-you .quotesYou > $site$sideArrows, +.filter-highlight > $site$sideArrows { + color: rgba(221, 0, 0, .8); +} +:root.highlight-own .yourPost$site$highlightable$op::after, +:root.highlight-you .quotesYou$site$highlightable$op::after, +.filter-highlight$site$highlightable$op::after { + content: ""; + display: block; + clear: both; +} +:root:not(.werkTyme) .catalog-thread.filter-highlight .catalog-thumb, +:root.werkTyme .catalog-thread.filter-highlight:not(:hover), +:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.filter-highlight, +:root.werkTyme.catalog-hover-expand .catalog-thread.filter-highlight > .catalog-container:hover > .catalog-post, +:root.catalog $site$catalog$thread.filter-highlight$site$highlightable$catalog { + box-shadow: 0 0 3px 3px rgba(255, 0, 0, .5); +} +:root:not(.werkTyme) .catalog-thread.watched .catalog-thumb, +:root:root.werkTyme .catalog-thread.watched:not(:hover), +:root:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched, +:root.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post { + border: 2px solid rgba(255, 0, 0, .75); +} + +/* Spoiler text */ +:root.reveal-spoilers $site$spoiler, +:root.reveal-spoilers $site$spoiler > a { + color: white !important; +} +:root.reveal-spoilers .removed-spoiler::before { + content: "[spoiler]"; +} +:root.reveal-spoilers .removed-spoiler::after { + content: "[/spoiler]"; +} + +/* Thread & Reply Hiding */ +.hide-thread-button, +.hide-reply-button { + float: left; + margin-right: 4px; + padding: 2px; +} +$site$infoRoot a.hide-reply-button { + margin-right: 6px; + padding: 0; +} +.replacedSideArrows { + float: left; +} +.hide-thread-button:not(:hover), +.hide-reply-button:not(:hover) { + opacity: 0.4; +} +.threadContainer .hide-reply-button { + margin-left: 2px !important; + position: relative; + left: 1px; +} +.hide-thread-button { + margin-top: -1px; + width: 11px; +} +.stub ~ :not(.threadDivider) { + display: none !important; +} +.stub input { + display: inline-block; +} +$site$thread[hidden] + hr { + display: none; +} +:root.reply-hide $site$sideArrows { + display: none; +} +:root.sw-yotsuba.thread-hide .party-hat { + left: 19px; +} + +/* Anonymize */ +:root.anonymize $site$info$name, +:root.sw-yotsuba.anonymize .post-author:not([class*=capcode]) { + font-size: 0; +} +:root.anonymize $site$info$tripcode, +:root.sw-yotsuba.anonymize .n-pu { + display: none; +} +:root.anonymize $site$info$name::before, +:root.sw-yotsuba.anonymize .post-author:not([class*=capcode])::before { + content: "Anonymous"; + font-size: 10pt; +} +:root.sw-yotsuba.anonymize .flashListing .name::before, +:root.sw-yotsuba.anonymize .post-last > .post-author:not([class*=capcode])::before { + font-size: 9pt; +} + +/* QR */ +:root.hide-original-post-form #togglePostFormLink, +#qr.autohide:not(.focus):not(:hover):not(:active) > form, +:root.thread-view #qr:not(.show-new-thread-option) select[data-name="thread"], +#file-n-submit:not(.has-file) #qr-filerm { + display: none; +} +:root.hide-original-post-form #postForm { + display: none !important; +} +#qr select, +#qr-filename-container > a, +.remove, +.captcha-img { + cursor: pointer; +} +#qr { + position: fixed; + padding: 1px; + border: 1px solid transparent; + min-width: 300px; + border-radius: 3px 3px 0 0; +} +#qr > form { + /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */ + max-height: 85vh; + max-height: calc(100vh - 75px); + overflow-y: auto; + overflow-x: hidden; +} +#qrtab { + border-radius: 3px 3px 0 0; +} +#qrtab { + margin-bottom: 1px; +} +#qr .close { + float: right; + padding: 0 3px; +} +.qr-link-container { + text-align: center; + margin: 16px 0; +} +.qr-link-container-bottom { + width: 200px; + position: absolute; + left: -100px; + margin-left: 50%; + text-align: center; +} +.qr-link { + border-radius: 3px; + padding: 6px 10px 5px; + font-weight: bold; + vertical-align: middle; + border-style: solid; + border-width: 1px; + font-size: 10pt; +} +.qr-link-container + #togglePostFormLink { + font-size: 10pt; + font-weight: normal; + margin: -8px 0 3.5px; +} +.persona { + width: 100%; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: row; + flex-direction: row; +} +.persona .field { + -webkit-flex: 1; + flex: 1; + width: 0; +} +#qr.forced-anon input[data-name="name"]:not(.force-show), +#qr.forced-anon input[data-name="sub"]:not(.force-show), +#qr.reply-to-thread input[data-name="sub"]:not(.force-show), +body:not(.board_f) #qr select[name="filetag"], +#qr.reply-to-thread select[name="filetag"], +#qr:not(.has-sjis) #sjis-toggle, +#qr:not(.has-math) #tex-preview-button, +#qr.tex-preview .textarea > :not(#tex-preview), +#qr:not(.tex-preview) #tex-preview { + display: none; +} +.persona button { + -webkit-flex: 0 0 23px; + flex: 0 0 23px; + -webkit-align-self: stretch; + align-self: stretch; + border: 1px solid #BBB; + padding: 0; + background: linear-gradient(to bottom, #F8F8F8, #DCDCDC) no-repeat; + color: #000; +} +#qr.sjis-preview #sjis-toggle, #qr.tex-preview #tex-preview-button { + background: #DCDCDC; +} +#sjis-toggle, #qr.sjis-preview textarea.field { + font-family: "IPAMonaPGothic","Mona","MS PGothic",monospace; + font-size: 16px; + line-height: 17px; +} +#tex-preview-button { + font-size: 10px; +} +#tex-preview { + white-space: pre-line; +} +#qr textarea.field { + height: 14.8em; + min-height: 9em; +} +#qr.has-captcha textarea.field { + height: 9em; +} +input.field.tripped:not(:hover):not(:focus) { + color: transparent !important; + text-shadow: none !important; +} +#qr textarea { + min-width: 300px; + resize: both; +} +.field { + -moz-box-sizing: border-box; + box-sizing: border-box; + margin: 0px; + padding: 2px 4px 3px; +} +#qr label input[type="checkbox"] { + position: relative; + top: 2px; +} + +/* Recaptcha v2 */ +#qr .captcha-root { + position: relative; +} +#qr .captcha-container > div { + margin: auto; + width: 304px; +} +/* XXX scrollable with scroll bar hidden; prevents scroll on space press */ +:root.ua-blink #qr .captcha-container > div, +:root.ua-edge #qr .captcha-container > div { + overflow: hidden; +} +:root.ua-blink #qr .captcha-container > div > div:first-of-type, +:root.ua-edge #qr .captcha-container > div > div:first-of-type { + overflow-y: scroll; + overflow-x: hidden; + padding-right: 30px; + height: 99%; + width: 100%; +} +#qr .captcha-counter { + display: block; + width: 100%; + text-align: center; + pointer-events: none; +} +#qr.captcha-open .captcha-counter { + position: absolute; + bottom: 3px; +} +#qr .captcha-counter > a { + pointer-events: auto; + display: inline-block; /* XXX https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8851747/ */ +} +#qr:not(.captcha-open) .captcha-counter > a { + display: block; + width: 100%; +} +#qr.captcha-v2 #qr-captcha-iframe { + width: 302px; + height: 423px; + border: 0; + display: block; + margin: auto; +} +.goog-bubble-content { + max-width: 100vw; + max-height: 100vh; + overflow: auto; +} +.goog-bubble-content iframe { + position: static !important; +} + +/* File Input, Submit Button, Oekaki */ +#file-n-submit, #qr .oekaki { + display: -webkit-flex; + display: flex; + -webkit-align-items: stretch; + align-items: stretch; + height: 25px; + margin-top: 1px; +} +#file-n-submit > input, #qr-draw-button { + background: linear-gradient(to bottom, #F8F8F8, #DCDCDC) no-repeat; + border: 1px solid #BBB; + border-radius: 2px; + height: 100%; +} +#qr-file-button, #qr-draw-button { + width: 15%; +} +#file-n-submit input[type="submit"] { + width: 25%; +} +#qr-filename-container { + -webkit-flex: 1 1 auto; + flex: 1 1 auto; + width: 0; + display: -webkit-flex; + display: flex; + -webkit-align-items: center; + align-items: center; + position: relative; + padding: 1px; +} +input#qr-filename { + border: none !important; + background: none !important; + outline: none; +} +#qr-filename, +.has-file #qr-no-file { + display: none; +} +#qr-no-file, +.has-file #qr-filename { + -webkit-flex: 1 1 auto; + flex: 1 1 auto; + width: 0px; /* XXX Fixes filename not shrinking to allow space for buttons in Edge */ + display: inline-block; + padding: 0; + padding-left: 3px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +#qr-no-file { + color: #AAA; +} +#qr .oekaki.has-file { + display: none; +} +#qr .oekaki > label { + -webkit-flex: 1 1 auto; + flex: 1 1 auto; + width: 0; + display: -webkit-flex; + display: flex; + -webkit-align-items: center; + align-items: center; + height: 100%; +} +#qr .oekaki > label > span { + margin: 0 3px; +} +#qr .oekaki > label > input { + -webkit-flex: 1 1 auto; + flex: 1 1 auto; + width: 0; + height: 100%; +} +#qr .oekaki-bg { + position: relative; + display: inline-block; + height: 100%; + width: 10%; + margin-left: 3px; +} +#qr .oekaki-bg > * { + position: absolute; + top: 0; + left: 0; + margin: 0; +} +#qr .oekaki-bg > :not([name="oekaki-bgcolor"]) { + z-index: 1; +} +#qr [name="oekaki-bgcolor"] { + height: 100%; + width: 100%; + border: none; + padding: 0; +} +#qr [name="oekaki-bg"]:not(:checked) ~ [name="oekaki-bgcolor"] { + visibility: hidden; +} +#qr input[type="file"] { + visibility: hidden; + position: absolute; +} + +/* Spoiler Checkbox, QR Icons */ +#qr-filename-container > label, #qr-filename-container > a { + -webkit-flex: none; + flex: none; + margin: 0; + margin-right: 3px; +} +#qr:not(.has-spoiler) #qr-spoiler-label, +#file-n-submit:not(.has-file) #qr-spoiler-label, +.has-file #paste-area, +.has-file #url-button, +#file-n-submit:not(.custom-cooldown) #custom-cooldown-button { + display: none; +} +#qr-filename-container > label { + position: relative; +} +#qr-filename-container input[type="checkbox"] { + margin: 0; +} +.checkbox-letter { + font-size: 13px; + font-weight: bold; +} +#qr-filename-container label:not(:hover) > input[type="checkbox"]:not(:focus):not(:checked), +#qr-filename-container label:not(:hover) > input[type="checkbox"]:not(:focus):not(:checked) ~ :not(.checkbox-letter), +#qr-filename-container label:hover > .checkbox-letter, +input[type="checkbox"]:focus ~ .checkbox-letter, +input[type="checkbox"]:checked ~ .checkbox-letter { + /* not displayed but still focusable */ + position: absolute; + opacity: 0; + pointer-events: none; +} +.checkbox-letter, #paste-area, #url-button, #custom-cooldown-button, #dump-button { + opacity: 0.6; +} +#paste-area { + font-size: 0; +} +#paste-area:focus { + opacity: 1; +} +#custom-cooldown-button.disabled { + opacity: 0.27; +} + +/* Thread and Flash Tag Select */ +#qr select { + background: white; + border: 1px solid #CCC; +} +#qr select[data-name="thread"] { + float: right; +} +#qr > form > select { + margin-top: 1px; +} + +/* Dumping UI */ +.dump #dump-list-container { + display: block; +} +#dump-list-container { + display: none; + position: relative; + overflow-y: hidden; + margin-top: 1px; +} +#dump-list { + overflow-x: auto; + overflow-y: auto; + white-space: nowrap; + width: 248px; + max-height: 248px; + min-height: 90px; + max-width: 100%; + min-width: 100%; + display: -webkit-flex; + display: flex; + -webkit-flex-wrap: wrap; + flex-wrap: wrap; +} +#dump-list:hover { + overflow-x: auto; +} +.qr-preview { + -moz-box-sizing: border-box; + box-sizing: border-box; + counter-increment: thumbnails; + cursor: move; + display: inline-block; + height: 90px; + width: 90px; + padding: 2px; + opacity: .5; + overflow: hidden; + position: relative; + text-shadow: 0 0 2px #000; + -webkit-transition: opacity .25s ease-in-out, -webkit-transform .25s ease-in-out; + transition: opacity .25s ease-in-out, transform .25s ease-in-out, -webkit-transform .25s ease-in-out; + vertical-align: top; + background-size: cover; + -webkit-flex: none; + flex: none; +} +.qr-preview:hover, +.qr-preview:focus { + opacity: .9; +} +.qr-preview::before { + content: counter(thumbnails); + color: #fff; + position: absolute; + top: 3px; + right: 3px; + text-shadow: 0 0 3px #000, 0 0 8px #000; +} +.qr-preview#selected { + opacity: 1; +} +.qr-preview.drag { + box-shadow: 0 0 10px rgba(0,0,0,.5); + -webkit-transform: scale(.8); + transform: scale(.8); +} +.qr-preview.over { + border-color: #fff; + -webkit-transform: scale(1.1); + transform: scale(1.1); + opacity: 0.9; + z-index: 10; +} +.qr-preview > span { + color: #fff; +} +.remove { + background: none; + color: #e00; + padding: 1px; +} +a:only-of-type > .remove { + display: none; +} +.remove:hover::after { + content: " Remove"; +} +.qr-preview:not(.has-file) label, +#qr:not(.has-spoiler) .qr-preview-spoiler { + display: none; +} +.qr-preview > label { + background: rgba(0,0,0,.5); + color: #fff; + right: 0; + bottom: 0; + left: 0; + position: absolute; + text-align: center; +} +.qr-preview > label > input { + margin: 0; +} +#add-post { + cursor: pointer; + font-size: 2em; + position: absolute; + bottom: 20px; + right: 10px; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); +} +.textarea { + position: relative; + display: -webkit-flex; + display: flex; +} +#char-count { + color: #000; + background: hsla(0, 0%, 100%, .5); + font-size: 8pt; + position: absolute; + bottom: 1px; + right: 1px; + pointer-events: none; +} +#char-count.warning { + color: red; +} + +/* Menu */ +.menu-button:not(.fa-bars) { + display: inline-block; + position: relative; + cursor: pointer; +} +#header-bar .menu-button i { + border-top: 6px solid; + border-right: 4px solid transparent; + border-left: 4px solid transparent; + display: inline-block; + margin: 2px; + vertical-align: middle; +} +.postInfo > .menu-button, +#thread-watcher .menu-button { + width: 18px; + height: 15px; + text-align: center; +} +#menu { + position: fixed; + outline: none; + font-weight: normal; +} +#menu, .submenu { + border-radius: 3px; + padding-top: 1px; + padding-bottom: 3px; +} +.entry { + cursor: pointer; + display: block; + outline: none; + padding: 2px 10px; + position: relative; + text-decoration: none; + white-space: nowrap; + min-width: 70px; + text-align: left; + text-shadow: none; + font-size: 10pt; +} +.left>.entry.has-submenu { + padding-right: 17px !important; +} +.entry input[type="checkbox"], +.entry input[type="radio"] { + margin: 0px; + position: relative; + top: 2px; +} +.entry input[type="number"] { + width: 4.5em; +} +.entry.has-shortcut-text { + display: flex; + justify-content: space-between; + align-items: center; +} +.entry .shortcut-text { + opacity: 0.5; + font-size: 70%; + margin-left: 5px; +} +.has-submenu::after { + content: ""; + border-left: .5em solid; + border-top: .3em solid transparent; + border-bottom: .3em solid transparent; + display: inline-block; + margin: .3em; + position: absolute; + right: 3px; +} +.left .has-submenu::after { + border-left: 0; + border-right: .5em solid; +} +.submenu { + display: none; + position: absolute; + left: 100%; + top: -1px; + margin-left: 0px; + margin-top: -2px; +} +.focused > .submenu { + display: block; +} +.imp-exp-result { + position: absolute; + text-align: center; + margin: auto; + right: 0px; + left: 0px; + width: 200px; +} + +/* Custom Board Titles */ +.boardTitle, .boardSubtitle { + white-space: pre-line; +} +.boardTitle[contenteditable="true"], +.boardSubtitle[contenteditable="true"] { + cursor: text !important; +} + +/* Embedding */ +.embedder:not(.embedded) > span { + display: none; +} +#embedding { + padding: 1px 4px 1px 4px; + position: fixed; +} +#embedding.empty { + display: none; +} +#embedding > div:first-child { + display: -webkit-flex; + display: flex; +} +#embedding .move { + -webkit-flex: 1; + flex: 1; +} +#embedding .jump { + margin: -1px 4px; + text-decoration: none; +} + +/* Gallery */ +#a-gallery { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: row; + flex-direction: row; + background: rgba(0,0,0,0.7); +} +.gal-viewport { + display: -webkit-flex; + display: flex; + -webkit-align-items: stretch; + align-items: stretch; + -webkit-flex-direction: row; + flex-direction: row; + -webkit-flex: 1 1 auto; + flex: 1 1 auto; + overflow: hidden; +} +.gal-thumbnails { + -webkit-flex: 0 0 150px; + flex: 0 0 150px; + overflow-y: auto; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: column; + flex-direction: column; + -webkit-align-items: stretch; + align-items: stretch; + text-align: center; + background: rgba(0,0,0,.5); + border-left: 1px solid #222; +} +.gal-hide-thumbnails .gal-thumbnails { + display: none; +} +.gal-thumb img, +.gal-thumb video { + max-width: 125px; + max-height: 125px; + height: auto; + width: auto; +} +.gal-thumb { + -webkit-flex: 0 0 auto; + flex: 0 0 auto; + padding: 3px; + line-height: 0; + transition: background .2s linear; +} +.gal-highlight { + background: rgba(0, 190, 255,.8); +} +.gal-prev { + border-right: 1px solid #222; +} +.gal-next { + border-left: 1px solid #222; +} +.gal-prev, +.gal-next { + -webkit-flex: 0 0 20px; + flex: 0 0 20px; + position: relative; + cursor: pointer; + opacity: 0.7; + background-color: rgba(0, 0, 0, 0.3); +} +.gal-prev:hover, +.gal-next:hover { + opacity: 1; +} +.gal-prev::after, +.gal-next::after { + position: absolute; + top: 48.6%; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); + display: inline-block; + border-top: 11px solid transparent; + border-bottom: 11px solid transparent; + content: ""; +} +.gal-prev::after { + border-right: 12px solid #fff; + right: 5px; +} +.gal-next::after { + border-left: 12px solid #fff; + right: 3px; +} +.gal-image { + -webkit-flex: 1 0 auto; + flex: 1 0 auto; + display: -webkit-flex; + display: flex; + -webkit-align-items: flex-start; + align-items: flex-start; + -webkit-justify-content: space-around; + justify-content: space-around; + overflow: hidden; + /* Flex > Non-Flex child max-width and overflow fix (Firefox only?) */ + width: 1%; +} +:root:not(.gal-fit-height):not(.gal-pdf) .gal-image { + overflow-y: scroll !important; +} +:root:not(.gal-fit-width):not(.gal-pdf) .gal-image { + overflow-x: scroll !important; +} +.gal-image a { + display: -webkit-flex; + display: flex; + -webkit-align-items: flex-start; + align-items: flex-start; + margin: auto; + line-height: 0; + max-width: 100%; +} +:root.gal-pdf .gal-image a { + width: 100%; + height: 100%; +} +.gal-image img, +.gal-image video { + -webkit-flex: none; + flex: none; +} +.gal-fit-width .gal-image img, +.gal-fit-width .gal-image video { + max-width: 100%; +} +.gal-fit-height .gal-image img, +.gal-fit-height .gal-image video { + /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */ + max-height: 95vh; + max-height: calc(100vh - 25px); +} +.gal-image iframe { + width: 100%; + height: 100%; +} +.gal-buttons { + font-size: 2em; + margin-right: 3px; + padding-left: 7px; + padding-right: 7px; + top: 5px; +} +:root.gal-pdf .gal-buttons { + top: 40px; + background: rgba(0,0,0,0.6) !important; + border-radius: 3px; +} +.gal-buttons a { + color: #ffffff; + text-shadow: 0px 0px 1px #000000; +} +.gal-buttons i { + display: inline-block; + margin: 2px; + position: relative; +} +.gal-start i { + border-left: 10px solid; + border-top: 6px solid transparent; + border-bottom: 6px solid transparent; + bottom: 1px; +} +.gal-stop i { + border: 5px solid; + bottom: 2px; +} +.gal-buttons.gal-playing > .gal-start, +.gal-buttons:not(.gal-playing) > .gal-stop { + display: none; +} +.gal-buttons .menu-button i { + border-top: 10px solid; + border-right: 6px solid transparent; + border-left: 6px solid transparent; + bottom: 2px; + vertical-align: baseline; +} +.gal-labels { + position: fixed; + bottom: 6px; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: column; + flex-direction: column; + -webkit-align-items: flex-end; + align-items: flex-end; + +} +:root:not(.show-sauce) .gal-sauce { + display: none; +} +.gal-name, +.gal-count, +.gal-sauce { + background: rgba(0,0,0,0.6) !important; + border-radius: 3px; + padding: 1px 5px 2px 5px; + margin-top: 3px; + color: #ffffff !important; + text-decoration: none !important; +} +.gal-sauce a { + color: #ffffff !important; +} +.gal-name:hover, +.gal-buttons a:hover, +.gal-sauce a:hover { + color: rgb(95, 95, 101) !important; +} +:root.gal-pdf .gal-buttons a:hover { + color: rgb(204, 204, 204) !important; +} +.gal-buttons, +.gal-labels { + position: fixed; + right: 195px; +} +.gal-hide-thumbnails .gal-buttons, +.gal-hide-thumbnails .gal-labels { + right: 44px; +} +:root:not(.gal-fit-width):not(.gal-pdf) .gal-labels { + bottom: 23px !important; +} +:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-buttons, +:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-labels { + right: 178px !important; +} +:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-buttons, +:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-labels { + right: 28px !important; +} +:root.gallery-open.fixed #header-bar:not(.autohide), +:root.gallery-open.fixed #header-bar:not(.autohide) #shortcuts .fa::before { + visibility: hidden; +} + +/* Mod Contact Links */ +.contact-links { + margin-left: 2px; +} +.move-note > a { + text-decoration: underline; +} +.invisible { + font-size: 0; +} + +/* PostJumper */ +.postJumper > .prev, +.postJumper > .next { + font-size: 120%; +} + +/* PSA */ +.fcx-announcement { + text-align: center; +} +.fcx-announcement a { + text-decoration: underline; +} + +@keyframes spin { + 0% {transform:rotate(0deg);} + 100% {transform:rotate(359deg);} +} + +.spin { + animation:spin 2s infinite linear; +} +`; + + var supports = `/* XXX Moved to end of stylesheet to avoid breaking whole stylesheet in Maxthon. */ +@supports (text-decoration-style: dashed) or (-moz-text-decoration-style: dashed) { + .quotelink.forwardlink, + .backlink.forwardlink { + text-decoration: underline; + -moz-text-decoration-style: dashed; + text-decoration-style: dashed; + border-bottom: none; + } +} +`; + + var tomorrow = `/* General */ +:root.tomorrow .dialog { + background-color: #282A2E; + border-color: #111; +} + +/* 4chan style fixes */ +:root.tomorrow #arc-list span.quote { + color: #B5BD68; +} +:root.tomorrow.highlight-you .quotesYou$site$highlightable$reply { + border-left: 3px solid rgba(145, 182, 214, .8) !important; +} +:root.tomorrow.highlight-own .yourPost$site$highlightable$reply { + border-left: 3px dashed rgba(145, 182, 214, .8) !important; +} + +/* Header */ +:root.tomorrow #header-bar.dialog { + background-color: rgba(40,42,46,0.9); +} +:root.tomorrow:not(.fixed) #header-bar, :root.tomorrow #notifications { + font-size: 9pt; +} +:root.tomorrow #header-bar, :root.tomorrow #notifications { + color: #C5C8C6; +} +:root.tomorrow #header-bar a, :root.tomorrow #notifications a { + color: #81A2BE; +} +:root.tomorrow.shortcut-icons .native-settings { + background-image: url('//s.4cdn.org/image/favicon-ws.ico'); +} + +/* Settings */ +:root.tomorrow #fourchanx-settings fieldset, :root.tomorrow .section-main div::before { + border-color: #111; +} +:root.tomorrow .suboption-list > div:last-of-type { + background-color: #282A2E; +} + +/* Catalog */ +:root.tomorrow.catalog-hover-expand .catalog-container:hover > .post { + background-color: #282A2E; +} +:root.tomorrow.werkTyme .catalog-thread:not(:hover), +:root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread, +:root.tomorrow.catalog-hover-expand .catalog-container:hover > .post, +:root.tomorrow.catalog-hover-expand .catalog-container:hover .catalog-reply { + border-color: #111; +} + +/* Quote */ +:root.tomorrow .backlink.deadlink { + color: #81A2BE !important; +} +:root.tomorrow .inline { + border-color: #111; + background-color: rgba(0, 0, 0, .14); +} + +/* Fappe and Werk Tyme */ +:root.tomorrow .indicator { + color: #282A2E; +} + +/* Highlighting */ +:root.tomorrow .qphl { + outline: 2px solid rgba(145, 182, 214, .8); +} +:root.tomorrow.highlight-you .quotesYou$site$highlightable$op, +:root.tomorrow.highlight-you .quotesYou$site$highlightable$reply { + border-left: 3px solid rgba(145, 182, 214, .8); +} +:root.tomorrow.highlight-own .yourPost$site$highlightable$op, +:root.tomorrow.highlight-own .yourPost$site$highlightable$reply { + border-left: 3px dashed rgba(145, 182, 214, .8); +} +:root.tomorrow .filter-highlight$site$highlightable$op, +:root.tomorrow .filter-highlight$site$highlightable$reply { + box-shadow: inset 5px 0 rgba(145, 182, 214, .5); +} +:root.tomorrow.highlight-own .yourPost > $site$sideArrows, +:root.tomorrow.highlight-you .quotesYou > $site$sideArrows, +:root.tomorrow .filter-highlight > $site$sideArrows { + color: rgb(155, 185, 210); +} +:root.tomorrow .catalog-thread.filter-highlight .catalog-thumb, +:root.tomorrow.werkTyme .catalog-thread.filter-highlight:not(:hover), +:root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread.filter-highlight, +:root.tomorrow.werkTyme.catalog-hover-expand .catalog-thread.filter-highlight > .catalog-container:hover > .catalog-post { + box-shadow: 0 0 3px 3px rgba(64, 192, 255, .7); +} +:root.tomorrow .catalog-thread.watched .catalog-thumb, +:root.tomorrow.werkTyme .catalog-thread.watched:not(:hover), +:root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched, +:root.tomorrow.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post { + border: 2px solid rgb(64, 192, 255); +} + + +/* QR */ +.tomorrow #dump-list::-webkit-scrollbar-thumb { + background-color: #282A2E; + border-color: #111; +} +:root.tomorrow .qr-preview { + background-color: rgba(255, 255, 255, .15); +} +:root.tomorrow #qr .field { + background-color: rgb(26, 27, 29); + color: rgb(197,200,198); + border-color: rgb(40, 41, 42); +} +:root.tomorrow #qr .field:focus, +:root.tomorrow #qr .field.focus { + border-color: rgb(129, 162, 190) !important; + background-color: rgb(30,32,36); +} +:root.tomorrow .persona button { + background: linear-gradient(to bottom, #2E3035, #222427) no-repeat; + color: rgb(197,200,198); + border-color: rgb(40, 41, 42); + outline: none; +} +:root.tomorrow .persona button::-moz-focus-inner { + border: none; +} +:root.tomorrow .persona button:focus { + border-color: rgb(129, 162, 190); +} +:root.tomorrow #qr.sjis-preview #sjis-toggle, +:root.tomorrow #qr.tex-preview #tex-preview-button { + background: rgb(26, 27, 29); +} +:root.tomorrow #qr select, +:root.tomorrow #file-n-submit > input, +:root.tomorrow #qr-draw-button { + border-color: rgb(40, 41, 42); +} +:root.tomorrow #qr-filename { + color: rgb(197,200,198); +} +:root.tomorrow .qr-link { + border-color: rgb(25, 27, 31) rgb(25, 27, 31) rgb(10, 12, 16); + background: linear-gradient(#37393D, #282A2E) repeat scroll 0% 0% transparent; +} +:root.tomorrow .qr-link:hover { + background: #282A2E; +} + +/* Menu */ +:root.tomorrow #menu { + color: #C5C8C6; +} +:root.tomorrow .entry { + font-size: 10pt; +} +:root.tomorrow .focused.entry { + background: rgba(0, 0, 0, .33); +} + +/* Unread */ +:root.tomorrow .unread-line { + border-color: rgb(197, 200, 198); +} +:root.tomorrow .unread-mark-read { + background-color: rgba(40,42,46,0.5); +} + +/* Thread Watcher */ +:root.tomorrow .replies-quoting-you > a, :root.tomorrow #watcher-link.replies-quoting-you, :root.tomorrow .last-page > a > .watcher-page { + color: #F00 !important; +} + +/* Watcher Favicon */ +:root.tomorrow .watch-thread-link +{ + background-image: url("data:image/svg+xml,"); +} +`; + + var www = `#captcha-cnt { + height: auto; +} +:root:not(.js-enabled) #form { + display: block; +} +#bd > div[style], #bd > div[style] > * { + height: auto !important; + margin: 0 !important; + font-size: 0; +} +`; + + var yotsubaB = `/* General */ +:root.yotsuba-b .dialog { + background-color: #D6DAF0; + border-color: #B7C5D9; +} +:root.yotsuba-b .field:focus, +:root.yotsuba-b .field.focus { + border-color: #98E; +} + +/* 4chan style fixes */ +:root.yotsuba-b.highlight-you .quotesYou$site$highlightable$reply { + border-left: 3px solid rgba(221, 0, 0, .8) !important; +} +:root.yotsuba-b.highlight-own .yourPost$site$highlightable$reply { + border-left: 3px dashed rgba(221, 0, 0, .8) !important; +} + +/* Header */ +:root.yotsuba-b #header-bar.dialog { + background-color: rgba(214,218,240,0.98); +} +:root.yotsuba-b:not(.fixed) #header-bar, :root.yotsuba-b #notifications { + font-size: 9pt; +} +:root.yotsuba-b #header-bar, :root.yotsuba-b #notifications { + color: #89A; +} +:root.yotsuba-b #board-list a, :root.yotsuba-b #shortcuts a { + color: #34345C; +} + +/* Settings */ +:root.yotsuba-b #fourchanx-settings fieldset, :root.yotsuba-b .section-main div::before { + border-color: #B7C5D9; +} +:root.yotsuba-b .suboption-list > div:last-of-type { + background-color: #D6DAF0; +} + +/* Catalog */ +:root.yotsuba-b.catalog-hover-expand .catalog-container:hover > .post { + background-color: #D6DAF0; +} +:root.yotsuba-b.werkTyme .catalog-thread:not(:hover), +:root.yotsuba-b.werkTyme:not(.catalog-hover-expand) .catalog-thread, +:root.yotsuba-b.catalog-hover-expand .catalog-container:hover > .post, +:root.yotsuba-b.catalog-hover-expand .catalog-container:hover .catalog-reply { + border-color: #B7C5D9; +} + +/* Quote */ +:root.yotsuba-b .backlink.deadlink { + color: #34345C !important; +} +:root.yotsuba-b .inline { + border-color: #B7C5D9; + background-color: rgba(255, 255, 255, .14); +} + +/* Fappe and Werk Tyme */ +:root.yotsuba-b .indicator { + color: #D6DAF0; +} + +/* QR */ +.yotsuba-b #dump-list::-webkit-scrollbar-thumb { + background-color: #D6DAF0; + border-color: #B7C5D9; +} +:root.yotsuba-b .qr-preview { + background-color: rgba(0, 0, 0, .15); +} +:root.yotsuba-b .qr-link { + border-color: rgb(199, 203, 225) rgb(199, 203, 225) rgb(184, 188, 210); + background: linear-gradient(#E5E9FF, #D6DAF0) repeat scroll 0% 0% transparent; +} +:root.yotsuba-b .qr-link:hover { + background: #D9DDF3; +} + + +/* Menu */ +:root.yotsuba-b #menu { + color: #000; +} +:root.yotsuba-b .entry { + font-size: 10pt; +} +:root.yotsuba-b .focused.entry { + background: rgba(255, 255, 255, .33); +} + +/* Unread */ +:root.yotsuba-b .unread-mark-read { + background-color: rgba(214,218,240,0.5); +} + +/* Thread Watcher */ +:root.yotsuba-b .replies-quoting-you > a, :root.yotsuba-b #watcher-link.replies-quoting-you { + color: #F00; +} + +/* Watcher Favicon */ +:root.yotsuba-b .watch-thread-link +{ + background-image: url("data:image/svg+xml,"); +} +`; + + var yotsuba = `/* General */ +:root.yotsuba .dialog { + background-color: #F0E0D6; + border-color: #D9BFB7; +} +:root.yotsuba .field:focus, +:root.yotsuba .field.focus { + border-color: #EA8; +} + +/* 4chan style fixes */ +:root.yotsuba.highlight-you .quotesYou$site$highlightable$reply { + border-left: 3px solid rgba(221, 0, 0, .8) !important; +} +:root.yotsuba.highlight-own .yourPost$site$highlightable$reply { + border-left: 3px dashed rgba(221, 0, 0, .8) !important; +} + +/* Header */ +:root.yotsuba #header-bar.dialog { + background-color: rgba(240,224,214,0.98); +} +:root.yotsuba:not(.fixed) #header-bar, :root.yotsuba #notifications { + font-size: 9pt; +} +:root.yotsuba #header-bar, :root.yotsuba #notifications { + color: #B86; +} +:root.yotsuba #board-list a, :root.yotsuba #shortcuts a { + color: #800000; +} + +/* Settings */ +:root.yotsuba #fourchanx-settings fieldset, :root.yotsuba .section-main div::before { + border-color: #D9BFB7; +} +:root.yotsuba .suboption-list > div:last-of-type { + background-color: #F0E0D6; +} + +/* Catalog */ +:root.yotsuba.catalog-hover-expand .catalog-container:hover > .post { + background-color: #F0E0D6; +} +:root.yotsuba.werkTyme .catalog-thread:not(:hover), +:root.yotsuba.werkTyme:not(.catalog-hover-expand) .catalog-thread, +:root.yotsuba.catalog-hover-expand .catalog-container:hover > .post, +:root.yotsuba.catalog-hover-expand .catalog-container:hover .catalog-reply { + border-color: #D9BFB7; +} + +/* Quote */ +:root.yotsuba .backlink.deadlink { + color: #00E !important; +} +:root.yotsuba .inline { + border-color: #D9BFB7; + background-color: rgba(255, 255, 255, .14); +} + +/* Fappe and Werk Tyme */ +:root.yotsuba .indicator { + color: #F0E0D6; +} + +/* QR */ +.yotsuba #dump-list::-webkit-scrollbar-thumb { + background-color: #F0E0D6; + border-color: #D9BFB7; +} +:root.yotsuba .qr-preview { + background-color: rgba(0, 0, 0, .15); +} +:root.yotsuba .qr-link { + border-color: rgb(225, 209, 199) rgb(225, 209, 199) rgb(210, 194, 184); + background: linear-gradient(#FFEFE5, #F0E0D6) repeat scroll 0% 0% transparent; +} +:root.yotsuba .qr-link:hover { + background: #F0E0D6; +} + +/* Menu */ +:root.yotsuba #menu { + color: #800000; +} +:root.yotsuba .entry { + font-size: 10pt; +} +:root.yotsuba .focused.entry { + background: rgba(255, 255, 255, .33); +} + +/* Unread */ +:root.yotsuba .unread-mark-read { + background-color: rgba(240,224,214,0.5); +} + +/* Thread Watcher */ +:root.yotsuba .replies-quoting-you > a, :root.yotsuba #watcher-link.replies-quoting-you, :root.yotsuba .last-page > a > .watcher-page { + color: #F00; +} + +/* Watcher Favicon */ +:root.yotsuba .watch-thread-link +{ + background-image: url("data:image/svg+xml,"); +} +`; + + // == Create CSS for Link Title Favicons == // + const icons = (data) => ('/* Link Title Favicons */\n' + + data.map(({ name, data }) => `.linkify.${name}::before { + content: ""; + background: transparent url('data:image/png;base64,${data}') center left no-repeat!important; + padding-left: 18px; +} +`).join('')); + + // cSpell:ignore installGentoo, webfont + // <% + // var inc = require['style']; + // var faCSS = read('/node_modules/font-awesome/css/font-awesome.css'); + // var mainCSS = ['font-awesome', 'style', 'yotsuba', 'yotsuba-b', 'futaba', 'burichan', 'tomorrow', 'photon', 'spooky'].map(x => read(`${x}.css`)).join(''); + // var iconNames = files.filter(f => /^linkify\.[^.]+\.png$/.test(f)); + // var icons = iconNames.map(readBase64); + // %> + const mainCSS = style + yotsuba + yotsubaB + futaba + burichan + tomorrow + photon + spooky; + const faIcons = [ + { name: "Audio", data: linkifyAudio }, + { name: "Bitchute", data: linkifyBitchute }, + { name: "Clyp", data: linkifyClyp }, + { name: "Dailymotion", data: linkifyDailymotion }, + { name: "Gfycat", data: linkifyGfycat }, + { name: "Gist", data: linkifyGist }, + { name: "Image", data: linkifyImage }, + { name: "Installgentoo", data: linkifyInstallgentoo }, + { name: "Liveleak", data: linkifyLiveleak }, + { name: "Pastebin", data: linkifyPastebin }, + { name: "Peertube", data: linkifyPeertube }, + { name: "Soundcloud", data: linkifySoundcloud }, + { name: "Streamable", data: linkifyStreamable }, + { name: "Twitchtv", data: linkifyTwitchtv }, + { name: "Twitter", data: linkifyTwitter }, + { name: "Video", data: linkifyVideo }, + { name: "Vidlii", data: linkifyVidlii }, + { name: "Cimeo", data: linkifyCimeo }, + { name: "Vine", data: linkifyVine }, + { name: "Vocaroo", data: linkifyVocaroo }, + { name: "Youtube", data: linkifyYoutube }, + ]; + const CSS = { + boards: mainCSS + icons(faIcons) + supports, + report, + www, + sub: function (css) { + var variables = { + site: g.SITE.selectors + }; + return css.replace(/\$[\w\$]+/g, function (name) { + var words = name.slice(1).split('$'); + var sel = variables; + for (var i = 0; i < words.length; i++) { + if (typeof sel !== 'object') + return ':not(*)'; + sel = $$1.getOwn(sel, words[i]); + } + if (typeof sel !== 'string') + return ':not(*)'; + return sel; + }); + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + const CustomCSS = { + init() { + if (!Conf['Custom CSS']) { return; } + return this.addStyle(); + }, + + addStyle() { + return this.style = $$1.addStyle(CSS.sub(Conf['usercss']), 'custom-css', '#fourchanx-css'); + }, + + rmStyle() { + if (this.style) { + $$1.rm(this.style); + return delete this.style; + } + }, + + update() { + if (!this.style) { + return this.addStyle(); + } + return this.style.textContent = CSS.sub(Conf['usercss']); + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + const SWTinyboard = { + isOPContainerThread: true, + mayLackJSON: true, + threadModTimeIgnoresSage: true, + + disabledFeatures: [ + 'Resurrect Quotes', + 'Quick Reply Personas', + 'Quick Reply', + 'Cooldown', + 'Report Link', + 'Delete Link', + 'Edit Link', + 'Quote Inlining', + 'Quote Previewing', + 'Quote Backlinks', + 'File Info Formatting', + 'Image Expansion', + 'Image Expansion (Menu)', + 'Comment Expansion', + 'Thread Expansion', + 'Favicon', + 'Quote Threading', + 'Thread Updater', + 'Banner', + 'Flash Features', + 'Reply Pruning' + ], + + detect() { + for (var script of $$('script:not([src])', d$1.head)) { + var m; + if (m = script.textContent.match(/\bvar configRoot=(".*?")/)) { + var properties = dict(); + try { + var root = JSON.parse(m[1]); + if (root[0] === '/') { + properties.root = location.origin + root; + } else if (/^https?:/.test(root)) { + properties.root = root; + } + } catch (error) {} + return properties; + } + } + return false; + }, + + awaitBoard(cb) { + if ($$1.id('react-ui')) { + const s = (this.selectors = Object.create(this.selectors)); + s.boardFor = {index: '.page-container'}; + s.thread = 'div[id^="thread_"]'; + return Main$1.mounted(cb); + } else { + return cb(); + } + }, + + urls: { + thread({siteID, boardID, threadID}, isArchived) { + return `${Conf['siteProperties'][siteID]?.root || `http://${siteID}/`}${boardID}/${isArchived ? 'archive/' : ''}res/${threadID}.html`; + }, + post({postID}) { return `#${postID}`; }, + index({siteID, boardID}) { return `${Conf['siteProperties'][siteID]?.root || `http://${siteID}/`}${boardID}/`; }, + catalog({siteID, boardID}) { return `${Conf['siteProperties'][siteID]?.root || `http://${siteID}/`}${boardID}/catalog.html`; }, + threadJSON({siteID, boardID, threadID}, isArchived) { + const root = Conf['siteProperties'][siteID]?.root; + if (root) { return `${root}${boardID}/${isArchived ? 'archive/' : ''}res/${threadID}.json`; } else { return ''; } + }, + archivedThreadJSON(thread) { + return SWTinyboard.urls.threadJSON(thread, true); + }, + threadsListJSON({siteID, boardID}) { + const root = Conf['siteProperties'][siteID]?.root; + if (root) { return `${root}${boardID}/threads.json`; } else { return ''; } + }, + archiveListJSON({siteID, boardID}) { + const root = Conf['siteProperties'][siteID]?.root; + if (root) { return `${root}${boardID}/archive/archive.json`; } else { return ''; } + }, + catalogJSON({siteID, boardID}) { + const root = Conf['siteProperties'][siteID]?.root; + if (root) { return `${root}${boardID}/catalog.json`; } else { return ''; } + }, + file({siteID, boardID}, filename) { + return `${Conf['siteProperties'][siteID]?.root || `http://${siteID}/`}${boardID}/${filename}`; + }, + thumb(board, filename) { + return SWTinyboard.urls.file(board, filename); + } + }, + + selectors: { + board: 'form[name="postcontrols"]', + thread: 'input[name="board"] ~ div[id^="thread_"]', + threadDivider: 'div[id^="thread_"] > hr:last-child', + summary: '.omitted', + postContainer: 'div[id^="reply_"]:not(.hidden)', // postContainer is thread for OP + opBottom: '.op', + replyOriginal: 'div[id^="reply_"]:not(.hidden)', + infoRoot: '.intro', + info: { + subject: '.subject', + name: '.name', + email: '.email', + tripcode: '.trip', + uniqueID: '.poster_id', + capcode: '.capcode', + flag: '.flag', + date: 'time', + nameBlock: 'label', + quote: 'a[href*="#q"]', + reply: 'a[href*="/res/"]:not([href*="#"])' + }, + icons: { + isSticky: '.fa-thumb-tack', + isClosed: '.fa-lock' + }, + file: { + text: '.fileinfo', + link: '.fileinfo > a', + thumb: 'a > .post-image' + }, + thumbLink: '.file > a', + multifile: '.files > .file', + highlightable: { + op: ' > .op', + reply: '.reply', + catalog: ' > .thread' + }, + comment: '.body', + spoiler: '.spoiler', + quotelink: 'a[onclick*="highlightReply("]', + catalog: { + board: '#Grid', + thread: '.mix', + thumb: '.thread-image' + }, + boardList: '.boardlist', + boardListBottom: '.boardlist.bottom', + styleSheet: '#stylesheet', + psa: '.blotter', + nav: { + prev: '.pages > form > [value=Previous]', + next: '.pages > form > [value=Next]' + } + }, + + classes: { + highlight: 'highlighted' + }, + + xpath: { + thread: 'div[starts-with(@id,"thread_")]', + postContainer: 'div[starts-with(@id,"reply_") or starts-with(@id,"thread_")]', + replyContainer: 'div[starts-with(@id,"reply_")]' + }, + + regexp: { + quotelink: + new RegExp(`\ +/\ +([^/]+)\ +/res/\ +(\\d+)\ +(?:\\.\\w+)?#\ +(\\d+)\ +$\ +`), + quotelinkHTML: + /]*\bhref="[^"]*\/([^\/]+)\/res\/(\d+)(?:\.\w+)?#(\d+)"/g + }, + + Build: { + parseJSON(data, board) { + const o = this.parseJSON(data, board); + if (data.ext === 'deleted') { + delete o.file; + $$1.extend(o, { + files: [], + fileDeleted: true, + filesDeleted: [0] + }); + } + if (data.extra_files) { + let file; + for (let i = 0; i < data.extra_files.length; i++) { + var extra_file = data.extra_files[i]; + if (extra_file.ext === 'deleted') { + o.filesDeleted.push(i); + } else { + file = this.parseJSONFile(data, board); + o.files.push(file); + } + } + if (o.files.length) { + o.file = o.files[0]; + } + } + return o; + }, + + parseComment(html) { + html = html + .replace(//gi, '\n') + .replace(/<[^>]*>/g, ''); + return $$1.unescape(html); + } + }, + + bgColoredEl() { + return $$1.el('div', {className: 'post reply'}); + }, + + isFileURL(url) { + return /\/src\/[^\/]+/.test(url.pathname); + }, + + preParsingFixes(board) { + // fixes effects of unclosed link in announcement + let broken; + if (broken = $$1('a > input[name="board"]', board)) { + return $$1.before(broken.parentNode, broken); + } + }, + + parseNodes(post, nodes) { + // Add vichan's span.poster_id around the ID if not already present. + let m; + if (nodes.uniqueID) { return; } + let text = ''; + let node = nodes.nameBlock.nextSibling; + while (node && (node.nodeType === 3)) { + text += node.textContent; + node = node.nextSibling; + } + if (m = text.match(/(\s*ID:\s*)(\S+)/)) { + let uniqueID; + nodes.info.normalize(); + let {nextSibling} = nodes.nameBlock; + nextSibling = nextSibling.splitText(m[1].length); + nextSibling.splitText(m[2].length); + nodes.uniqueID = (uniqueID = $$1.el('span', {className: 'poster_id'})); + $$1.replace(nextSibling, uniqueID); + return $$1.add(uniqueID, nextSibling); + } + }, + + parseDate(node) { + let date = Date.parse(node.getAttribute('datetime')?.trim()); + if (!isNaN(date)) { return new Date(date); } + date = Date.parse(node.textContent.trim() + ' UTC'); // e.g. onesixtwo.club + if (!isNaN(date)) { return new Date(date); } + return undefined; + }, + + parseFile(post, file) { + let info, infoNode; + const {text, link, thumb} = file; + if ($$1.x(`ancestor::${this.xpath.postContainer}[1]`, text) !== post.nodes.root) { return false; } // file belongs to a reply + if (!(infoNode = link.nextSibling?.textContent.includes('(') ? link.nextSibling : link.nextElementSibling)) { return false; } + if (!(info = infoNode.textContent.match(/\((.*,\s*)?([\d.]+ ?[KMG]?B).*\)/))) { return false; } + const nameNode = $$1('.postfilename', text); + $$1.extend(file, { + name: nameNode ? (nameNode.title || nameNode.textContent) : link.pathname.match(/[^/]*$/)[0], + size: info[2], + dimensions: info[0].match(/\d+x\d+/)?.[0] + }); + if (thumb) { + $$1.extend(file, { + thumbURL: /\/static\//.test(thumb.src) && $$1.isImage(link.href) ? link.href : thumb.src, + isSpoiler: /^Spoiler/i.test(info[1] || '') || (link.textContent === 'Spoiler Image') + } + ); + } + return true; + }, + + isThumbExpanded(file) { + // Detect old Tinyboard image expansion that changes src attribute on thumbnail. + return $$1.hasClass(file.thumb.parentNode, 'expanded') || (file.thumb.parentNode.dataset.expanded === 'true'); + }, + + isLinkified(link) { + return /\bnofollow\b/.test(link.rel); + }, + + catalogPin(threadRoot) { + return threadRoot.dataset.sticky = 'true'; + } + }; + + const passMessagePage = h("div", { class: "box-inner" }, + h("div", { class: "boxbar" }, + h("h2", null, + "Trouble buying a 4chan Pass? (a message from 4chan X)", + h("a", { href: "javascript:;", style: "text-decoration: none; float: right; margin-right: 4px;", title: "Close" }, "\u00D7"))), + h("div", { class: "boxcontent" }, + "Check the 4chan X wiki for ", + h("a", { href: `${meta.captchaFAQ}#alternatives`, target: "_blank", rel: "noopener" }, "alternative solutions"), + ".")); + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + + const PassMessage = { + init() { + if (Conf['passMessageClosed']) { return; } + const msg = $$1.el('div', + {className: 'box-outer top-box'} + , + passMessagePage); + msg.style.cssText = 'padding-bottom: 0;'; + const close = $$1('a', msg); + $$1.on(close, 'click', function() { + $$1.rm(msg); + return $$1.set('passMessageClosed', true); + }); + return $$1.ready(function() { + let hd; + if (hd = $$1.id('hd')) { + return $$1.after(hd, msg); + } else { + return $$1.prepend(d$1.body, msg); + } + }); + } + }; + + var ReportPage = ` + + + +`; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + + var Report = { + init() { + let match; + if (!(match = location.search.match(/\bno=(\d+)/))) { return; } + Captcha.replace.init(); + this.postID = +match[1]; + return $$1.ready(this.ready); + }, + + ready() { + $$1.addStyle(CSS.report); + + if (Conf['Archive Report']) { Report.archive(); } + + new MutationObserver(function() { + Report.fit('iframe[src^="https://www.google.com/recaptcha/api2/frame"]'); + return Report.fit('body'); + }).observe(d$1.body, { + childList: true, + attributes: true, + subtree: true + } + ); + return Report.fit('body'); + }, + + fit(selector) { + let el; + if (!((el = $$1(selector, doc)) && (getComputedStyle(el).visibility !== 'hidden'))) { return; } + const dy = (el.getBoundingClientRect().bottom - doc.clientHeight) + 8; + if (dy > 0) { return window.resizeBy(0, dy); } + }, + + archive() { + let match, urls; + if (!(urls = Redirect$1.report(g.BOARD.ID)).length) { return; } + + const form = $$1('form'); + const types = $$1.id('reportTypes'); + const message = $$1('h3'); + + const fieldset = $$1.el('fieldset', { + id: 'archive-report', + hidden: true + } + , + { innerHTML: ReportPage }); + const enabled = $$1('#archive-report-enabled', fieldset); + const reason = $$1('#archive-report-reason', fieldset); + const submit = $$1('#archive-report-submit', fieldset); + + $$1.on(enabled, 'change', function() { + return reason.disabled = !this.checked; + }); + + if (form && types) { + fieldset.hidden = !$$1('[value="31"]', types).checked; + $$1.on(types, 'change', function(e) { + fieldset.hidden = (e.target.value !== '31'); + return Report.fit('body'); + }); + $$1.after(types, fieldset); + Report.fit('body'); + $$1.one(form, 'submit', function(e) { + if (!fieldset.hidden && enabled.checked) { + e.preventDefault(); + return Report.archiveSubmit(urls, reason.value, results => { + this.action = '#archiveresults=' + encodeURIComponent(JSON.stringify(results)); + return this.submit(); + }); + } + }); + } else if (message) { + fieldset.hidden = /Report submitted!/.test(message.textContent); + $$1.on(enabled, 'change', function() { + return submit.hidden = !this.checked; + }); + $$1.after(message, fieldset); + $$1.on(submit, 'click', () => Report.archiveSubmit(urls, reason.value, Report.archiveResults)); + } + + if (match = location.hash.match(/^#archiveresults=(.*)$/)) { + try { + return Report.archiveResults(JSON.parse(decodeURIComponent(match[1]))); + } catch (error) {} + } + }, + + archiveSubmit(urls, reason, cb) { + const form = $$1.formData({ + board: g.BOARD.ID, + num: Report.postID, + reason + }); + const results = []; + for (var [name, url] of urls) { + (function(name, url) { + return $$1.ajax(url, { + onloadend() { + results.push([name, this.response || {error: ''}]); + if (results.length === urls.length) { + return cb(results); + } + }, + form + }); + })(name, url); + } + }, + + archiveResults(results) { + const fieldset = $$1.id('archive-report'); + for (var [name, response] of results) { + var line = $$1.el('h3', + {className: 'archive-report-response'}); + if ('success' in response) { + $$1.addClass(line, 'archive-report-success'); + line.textContent = `${name}: ${response.success}`; + } else { + $$1.addClass(line, 'archive-report-error'); + line.textContent = `${name}: ${response.error || 'Error reporting post.'}`; + } + if (fieldset) { + $$1.before(fieldset, line); + } else { + $$1.add(d$1.body, line); + } + } + } + }; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + const PostSuccessful = { + init() { + if (!Conf['Remember Your Posts']) { return; } + return $$1.ready(this.ready); + }, + + ready() { + if (d$1.title !== 'Post successful!') { return; } + + let [_, threadID, postID] = Array.from($$1('h1').nextSibling.textContent.match(/thread:(\d+),no:(\d+)/)); + postID = +postID; + threadID = +threadID || postID; + + const db = new DataBoard('yourPosts'); + return db.set({ + boardID: g.BOARD.ID, + threadID, + postID, + val: true + }); + } + }; + + function generatePostInfoHtml(ID, o, subject, capcode, email, name, tripcode, pass, capcodeLC, capcodePlural, staticPath, gifIcon, capcodeDescription, uniqueID, flag, flagCode, flagCodeTroll, dateUTC, dateText, postLink, quoteLink, boardID, threadID) { + const nameHtml = [h("span", { class: `name${capcode ? ' ' + capcode : ''}` }, name)]; + if (tripcode) + nameHtml.push(' ', h("span", { class: "postertrip" }, tripcode)); + if (pass) + nameHtml.push(' ', h("span", { title: `Pass user since ${pass}`, class: "n-pu" })); + if (capcode) { + nameHtml.push(' ', h("strong", { class: `capcode hand id_${capcodeLC}`, title: `Highlight posts by ${capcodePlural}` }, + "## ", + capcode)); + } + const nameBlockContent = email ? [' ', h("a", { href: `mailto:${email}`, class: "useremail" }, ...nameHtml)] : nameHtml; + if (!(boardID === "f" && !o.isReply || capcodeDescription)) + nameBlockContent.push(' '); + if (capcodeDescription) { + nameBlockContent.push(h("img", { src: `${staticPath}${capcodeLC}icon${gifIcon}`, alt: `${capcode} Icon}`, title: `This user is ${capcodeDescription}.`, class: "identityIcon retina" })); + if (uniqueID && !capcode) { + nameBlockContent.push(h("span", { class: `posteruid id_${uniqueID}` }, + "(ID: ", + h("span", { class: "hand", title: "Highlight posts by this ID" }, + "$", + uniqueID), + ")")); + } + } + if (flagCode) + nameBlockContent.push(' ', h("span", { title: flag, class: `flag flag-${flagCode.toLowerCase()}` })); + if (flagCodeTroll) + nameBlockContent.push(' ', h("span", { title: flag, class: `bfl bfl-${flagCodeTroll.toLowerCase()}` })); + const postNumContent = [ + h("a", { href: postLink, title: "Link to this post" }, "No."), + h("a", { href: quoteLink, title: "Reply to this post" }, ID), + ]; + if (o.isSticky) { + const src = `${staticPath}sticky${gifIcon}`; + postNumContent.push(' '); + if (boardID === "f") { + postNumContent.push(h("img", { src: src, alt: "Sticky", title: "Sticky", style: "height: 18px; width: 18px;" })); + } + else { + postNumContent.push(h("img", { src: src, alt: "Sticky", title: "Sticky", class: "stickyIcon retina" })); + } + } + if (o.isClosed && !o.isArchived) { + postNumContent.push(' '); + const src = `${staticPath}closed${gifIcon}`; + if (boardID === "f") { + postNumContent.push(h("img", { src: src, alt: "Closed", title: "Closed", style: "height: 18px; width: 18px;" })); + } + else { + postNumContent.push(h("img", { src: src, alt: "Closed", title: "Closed", class: "closedIcon retina" })); + } + } + if (o.isArchived) { + postNumContent.push(' ', h("img", { src: `${staticPath}archived${gifIcon}`, alt: "Archived", title: "Archived", class: "archivedIcon retina" })); + } + if (!o.isReply && g.VIEW === "index") { + // \u00A0 is nbsp + postNumContent.push(' \u00A0 '); + postNumContent.push(h("span", null, + "[", + h("a", { href: `/${boardID}/thread/${threadID}`, class: "replylink" }, "Reply"), + "]")); + } + return h("div", { class: "postInfo desktop", id: `pi${ID}` }, + h("input", { type: "checkbox", name: ID, value: "delete" }), + ' ', + ...((!o.isReply || boardID === "f" || subject) ? [h("span", { class: "subject" }, subject), ' '] : []), + h("span", { class: `nameBlock${capcode || ''}` }, ...nameBlockContent), + ' ', + h("span", { class: "dateTime", "data-utc": dateUTC }, dateText), + ' ', + h("span", { class: `postNum${!(boardID === " f" && !o.isReply) ? ' desktop' : ''}` }, ...postNumContent)); + } + + function generateFileHtml(file, ID, boardID, fileURL, shortFilename, fileThumb, o, staticPath, gifIcon) { + if (file) { + const fileContent = []; + if (boardID === "f") { + fileContent.push(h("div", { class: "fileInfo", "data-md5": file.MD5 }, + h("span", { class: "fileText", id: `fT${ID}` }, + 'File: ', + h("a", { "data-width": file.width, "data-height": file.height, href: fileURL, target: "_blank" }, file.name), + "-(", + file.size, + ", ", + file.dimensions, + file.tag ? ', ' + file.tag : '', + ")"))); + } + else { + fileContent.push(h("div", { class: "fileText", id: `fT${ID}`, title: file.isSpoiler ? file.name : null }, + 'File: ', + h("a", { title: file.name === shortFilename || file.isSpoiler ? null : file.name, href: fileURL, target: "_blank" }, file.isSpoiler ? 'Spoiler Image' : shortFilename), + ` (${file.size}, ${file.dimensions || "PDF"})`), h("a", { class: `fileThumb${file.isSpoiler ? ' imgspoiler' : ''}`, href: fileURL, target: "_blank", "data-m": file.hasDownscale ? '' : null }, + h("img", { src: fileThumb, alt: file.size, "data-md5": file.MD5, style: `height: ${file.isSpoiler ? '100' : file.theight}px; width: ${file.isSpoiler ? '100' : file.twidth}px;`, loading: "lazy" }))); + } + return h("div", { class: "file", id: `f${ID}` }, ...fileContent); + } + else if (o.fileDeleted) { + return h("div", { class: "file", id: `f${ID}` }, + h("span", { class: "fileThumb" }, + h("img", { src: `${staticPath}filedeleted-res${gifIcon}`, alt: "File deleted.", class: "fileDeletedRes retina" }))); + } + return { innerHTML: '', [isEscaped]: true }; + } + + function generateCatalogThreadHtml(thread, src, imgClass, data, postCount, fileCount, pageCount, staticPath, gifIcon) { + return h(hFragment, null, + h("a", { class: "catalog-link", href: `/${thread.board}/thread/${thread.ID}` }, imgClass ? + h("img", { src: src, class: `catalog-thumb ${imgClass}` }) : + h("img", { src: src, class: "catalog-thumb", "data-width": data.tn_w, "data-height": data.tn_h })), + h("div", { class: "catalog-stats" }, + h("span", { title: "Posts / Files / Page" }, + h("span", { class: `post-count${data.bumplimit ? ' warning' : ''}` }, postCount), + ' / ', + h("span", { class: `file-count${data.imagelimit ? ' warning' : ''}` }, fileCount), + ' / ', + h("span", { class: "page-count" }, pageCount)), + h("span", { class: "catalog-icons" }, + thread.isSticky ? h("img", { src: `${staticPath}sticky${gifIcon}`, class: "stickyIcon", title: "Sticky" }) : '', + thread.isClosed ? h("img", { src: `${staticPath}closed${gifIcon}`, class: "closedIcon", title: "Closed" }) : ''))); + } + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * DS205: Consider reworking code to avoid use of IIFEs + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + const SWYotsuba = { + isOPContainerThread: false, + hasIPCount: true, + archivedBoardsKnown: true, + urls: { + thread({ boardID, threadID }) { return `${location.protocol}//${BoardConfig.domain(boardID)}/${boardID}/thread/${threadID}`; }, + post({ postID }) { return `#p${postID}`; }, + index({ boardID }) { return `${location.protocol}//${BoardConfig.domain(boardID)}/${boardID}/`; }, + catalog({ boardID }) { if (boardID === 'f') { + return undefined; + } + else { + return `${location.protocol}//${BoardConfig.domain(boardID)}/${boardID}/catalog`; + } }, + archive({ boardID }) { if (BoardConfig.isArchived(boardID)) { + return `${location.protocol}//${BoardConfig.domain(boardID)}/${boardID}/archive`; + } + else { + return undefined; + } }, + threadJSON({ boardID, threadID }) { return `${location.protocol}//a.4cdn.org/${boardID}/thread/${threadID}.json`; }, + threadsListJSON({ boardID }) { return `${location.protocol}//a.4cdn.org/${boardID}/threads.json`; }, + archiveListJSON({ boardID }) { if (BoardConfig.isArchived(boardID)) { + return `${location.protocol}//a.4cdn.org/${boardID}/archive.json`; + } + else { + return ''; + } }, + catalogJSON({ boardID }) { return `${location.protocol}//a.4cdn.org/${boardID}/catalog.json`; }, + file({ boardID }, filename) { + const hostname = boardID === 'f' ? ImageHost.flashHost() : ImageHost.host(); + return `${location.protocol}//${hostname}/${boardID}/${filename}`; + }, + thumb({ boardID }, filename) { + return `${location.protocol}//${ImageHost.thumbHost()}/${boardID}/${filename}`; + } + }, + isPrunedByAge({ boardID }) { return boardID === 'f'; }, + areMD5sDeferred({ boardID }) { return boardID === 'f'; }, + isOnePage({ boardID }) { return boardID === 'f'; }, + noAudio({ boardID }) { return BoardConfig.noAudio(boardID); }, + selectors: { + board: '.board', + thread: '.thread', + threadDivider: '.board > hr', + summary: '.summary', + postContainer: '.postContainer', + replyOriginal: '.replyContainer:not([data-clone])', + sideArrows: 'div.sideArrows', + post: '.post', + infoRoot: '.postInfo', + info: { + subject: '.subject', + name: '.name', + email: '.useremail', + tripcode: '.postertrip', + uniqueIDRoot: '.posteruid', + uniqueID: '.posteruid > .hand', + capcode: '.capcode.hand', + pass: '.n-pu', + flag: '.flag, .bfl', + date: '.dateTime', + nameBlock: '.nameBlock', + quote: '.postNum > a:nth-of-type(2)', + reply: '.replylink' + }, + icons: { + isSticky: '.stickyIcon', + isClosed: '.closedIcon', + isArchived: '.archivedIcon' + }, + file: { + text: '.file > :first-child', + link: '.fileText > a', + thumb: 'a.fileThumb > [data-md5]' + }, + thumbLink: 'a.fileThumb', + highlightable: { + op: '.opContainer', + reply: ' > .reply', + catalog: '' + }, + comment: '.postMessage', + spoiler: 's', + quotelink: ':not(pre) > .quotelink', + catalog: { + board: '#threads', + thread: '.thread', + thumb: '.thumb' + }, + boardList: '#boardNavDesktop > .boardList', + boardListBottom: '#boardNavDesktopFoot > .boardList', + styleSheet: 'link[title=switch]', + psa: '#globalMessage', + psaTop: '#globalToggle', + searchBox: '#search-box', + nav: { + prev: '.prev > form > [type=submit]', + next: '.next > form > [type=submit]' + } + }, + classes: { + highlight: 'highlight' + }, + xpath: { + thread: 'div[contains(concat(" ",@class," ")," thread ")]', + postContainer: 'div[contains(@class,"postContainer")]', + replyContainer: 'div[contains(@class,"replyContainer")]' + }, + regexp: { + quotelink: new RegExp(`\ +^https?://boards\\.4chan(?:nel)?\\.org/+\ +([^/]+)\ +/+thread/+\ +(\\d+)\ +(?:[/?][^#]*)?\ +(?:#p\ +(\\d+)\ +)?\ +$\ +`), + quotelinkHTML: /]*\bhref="(?:(?:\/\/boards\.4chan(?:nel)?\.org)?\/([^\/]+)\/thread\/)?(\d+)?(?:#p(\d+))?"/g, + pass: /^https?:\/\/www\.4chan(?:nel)?\.org\/+pass(?:$|[?#])/, + captcha: /^https?:\/\/sys\.4chan(?:nel)?\.org\/+captcha(?:$|[?#])/, + }, + bgColoredEl() { + return $$1.el('div', { className: 'reply' }); + }, + isThisPageLegit() { + // not 404 error page or similar. + return ['boards.4chan.org', 'boards.4channel.org'].includes(location.hostname) && + d$1.doctype && + !$$1('link[href*="favicon-status.ico"]', d$1.head) && + !['4chan - Temporarily Offline', '4chan - Error', '504 Gateway Time-out', 'MathJax Equation Source'].includes(d$1.title); + }, + is404() { + // XXX Sometimes threads don't 404 but are left over as stubs containing one garbage reply post. + return ['4chan - Temporarily Offline', '4chan - 404 Not Found'].includes(d$1.title) || ((g.VIEW === 'thread') && $$1('.board') && !$$1('.opContainer')); + }, + isIncomplete() { + return ['index', 'thread'].includes(g.VIEW) && !$$1('.board + *'); + }, + isBoardlessPage(url) { + return ['www.4chan.org', 'www.4channel.org'].includes(url.hostname); + }, + isAuxiliaryPage(url) { + return !['boards.4chan.org', 'boards.4channel.org'].includes(url.hostname); + }, + isFileURL(url) { + return ImageHost.test(url.hostname); + }, + initAuxiliary() { + switch (location.hostname) { + case 'www.4chan.org': + case 'www.4channel.org': + if (SWYotsuba.regexp.pass.test(location.href)) { + PassMessage.init(); + } + else { + $$1.onExists(doc$1, 'body', () => $$1.addStyle(CSS.www)); + Captcha.replace.init(); + } + return; + case 'sys.4chan.org': + case 'sys.4channel.org': + var pathname = location.pathname.split(/\/+/); + if (pathname[2] === 'imgboard.php') { + let match; + if (/\bmode=report\b/.test(location.search)) { + Report.init(); + } + else if (match = location.search.match(/\bres=(\d+)/)) { + $$1.ready(function () { + if (Conf['404 Redirect'] && ($$1.id('errmsg')?.textContent === 'Error: Specified thread does not exist.')) { + return Redirect$1.navigate('thread', { + boardID: g.BOARD.ID, + postID: +match[1] + }); + } + }); + } + } + else if (pathname[2] === 'post') { + PostSuccessful.init(); + } + return; + } + }, + scriptData() { + for (var script of $$('script:not([src])', d$1.head)) { + if (/\bcooldowns *=/.test(script.textContent)) { + return script.textContent; + } + } + return ''; + }, + parseThreadMetadata(thread) { + let m; + const scriptData = this.scriptData(); + thread.postLimit = /\bbumplimit *= *1\b/.test(scriptData); + thread.fileLimit = /\bimagelimit *= *1\b/.test(scriptData); + thread.ipCount = (m = scriptData.match(/\bunique_ips *= *(\d+)\b/)) ? +m[1] : undefined; + if ((g.BOARD.ID === 'f') && thread.OP.file) { + const { file } = thread.OP; + return $$1.ajax(this.urls.threadJSON({ boardID: 'f', threadID: thread.ID }), { + timeout: MINUTE, + onloadend() { + if (this.response) { + return file.text.dataset.md5 = (file.MD5 = this.response.posts[0].md5); + } + } + }); + } + }, + parseNodes(post, nodes) { + // Add CSS classes to sticky/closed icons on /f/ to match other boards. + if (post.boardID === 'f') { + return (() => { + const result = []; + for (var type of ['Sticky', 'Closed']) { + var icon; + if (icon = $$1(`img[alt=${type}]`, nodes.info)) { + result.push($$1.addClass(icon, `${type.toLowerCase()}Icon`, 'retina')); + } + } + return result; + })(); + } + }, + parseDate(node) { + return new Date(node.dataset.utc * 1000); + }, + parseFile(post, file) { + let info; + const { text, link, thumb } = file; + if (!(info = link.nextSibling?.textContent.match(/\(([\d.]+ [KMG]?B).*\)/))) { + return false; + } + $$1.extend(file, { + name: text.title || link.title || link.textContent, + size: info[1], + dimensions: info[0].match(/\d+x\d+/)?.[0], + tag: info[0].match(/,[^,]*, ([a-z]+)\)/i)?.[1], + MD5: text.dataset.md5 + }); + if (thumb) { + $$1.extend(file, { + thumbURL: thumb.src, + MD5: thumb.dataset.md5, + isSpoiler: $$1.hasClass(thumb.parentNode, 'imgspoiler') + }); + if (file.isSpoiler) { + let m; + file.thumbURL = (m = link.href.match(/\d+(?=\.\w+$)/)) ? `${location.protocol}//${ImageHost.thumbHost()}/${post.board}/${m[0]}s.jpg` : undefined; + } + } + return true; + }, + cleanComment(bq) { + let abbr; + if (abbr = $$1('.abbr', bq)) { // 'Comment too long' or 'EXIF data available' + for (var node of $$('.abbr + br, .exif', bq)) { + $$1.rm(node); + } + for (let i = 0; i < 2; i++) { + var br; + if ((br = abbr.previousSibling) && (br.nodeName === 'BR')) { + $$1.rm(br); + } + } + return $$1.rm(abbr); + } + }, + cleanCommentDisplay(bq) { + let b; + if ((b = $$1('b', bq)) && /^Rolled /.test(b.textContent)) { + $$1.rm(b); + } + return $$1.rm($$1('.fortune', bq)); + }, + insertTags(bq) { + let node; + for (node of $$('s, .removed-spoiler', bq)) { + $$1.replace(node, [$$1.tn('[spoiler]'), ...Array.from(node.childNodes), $$1.tn('[/spoiler]')]); + } + for (node of $$('.prettyprint', bq)) { + $$1.replace(node, [$$1.tn('[code]'), ...Array.from(node.childNodes), $$1.tn('[/code]')]); + } + }, + hasCORS(url) { + return url.split('/').slice(0, 3).join('/') === (location.protocol + '//a.4cdn.org'); + }, + sfwBoards(sfw) { + return BoardConfig.sfwBoards(sfw); + }, + uidColor(uid) { + let msg = 0; + let i = 0; + while (i < 8) { + msg = ((msg << 5) - msg) + uid.charCodeAt(i++); + } + return (msg >> 8) & 0xFFFFFF; + }, + isLinkified(link) { + return ImageHost.test(link.hostname); + }, + testNativeExtension() { + return $$1.global(function () { + if (window.Parser?.postMenuIcon) { + return this.enabled = 'true'; + } + }); + }, + transformBoardList() { + let node; + const nodes = []; + const spacer = () => $$1.el('span', { className: 'spacer' }); + const items = $$1.X('.//a|.//text()[not(ancestor::a)]', $$1(SWYotsuba.selectors.boardList)); + let i = 0; + while ((node = items.snapshotItem(i++))) { + switch (node.nodeName) { + case '#text': + for (var chr of node.nodeValue) { + var span = $$1.el('span', { textContent: chr }); + if (chr === ' ') { + span.className = 'space'; + } + if (chr === ']') { + nodes.push(spacer()); + } + nodes.push(span); + if (chr === '[') { + nodes.push(spacer()); + } + } + break; + case 'A': + var a = node.cloneNode(true); + nodes.push(a); + break; + } + } + return nodes; + }, + Build: { + staticPath: '//s.4cdn.org/image/', + gifIcon: window.devicePixelRatio >= 2 ? '@2x.gif' : '.gif', + spoilerRange: Object.create(null), + shortFilename(filename) { + const ext = filename.match(/\.?[^\.]*$/)[0]; + if ((filename.length - ext.length) > 30) { + return `${filename.match(/(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[^]){0,25}/)[0]}(...)${ext}`; + } + else { + return filename; + } + }, + spoilerThumb(boardID) { + let spoilerRange; + if ((spoilerRange = this.spoilerRange[boardID])) { + // Randomize the spoiler image. + return `${this.staticPath}spoiler-${boardID}${Math.floor(1 + (spoilerRange * Math.random()))}.png`; + } + else { + return `${this.staticPath}spoiler.png`; + } + }, + sameThread(boardID, threadID) { + return (g.VIEW === 'thread') && (g.BOARD.ID === boardID) && (g.THREADID === +threadID); + }, + threadURL(boardID, threadID) { + if (boardID !== g.BOARD.ID) { + return `//${BoardConfig.domain(boardID)}/${boardID}/thread/${threadID}`; + } + else if ((g.VIEW !== 'thread') || (+threadID !== g.THREADID)) { + return `/${boardID}/thread/${threadID}`; + } + else { + return ''; + } + }, + postURL(boardID, threadID, postID) { + return `${this.threadURL(boardID, threadID)}#p${postID}`; + }, + parseJSON(data, { siteID, boardID }) { + const o = { + // id + ID: data.no, + postID: data.no, + threadID: data.resto || data.no, + boardID, + siteID, + isReply: !!data.resto, + // thread status + isSticky: !!data.sticky, + isClosed: !!data.closed, + isArchived: !!data.archived, + // file status + fileDeleted: !!data.filedeleted, + filesDeleted: data.filedeleted ? [0] : [] + }; + o.info = { + subject: $$1.unescape(data.sub), + email: $$1.unescape(data.email), + name: $$1.unescape(data.name) || '', + tripcode: data.trip, + pass: (data.since4pass != null) ? `${data.since4pass}` : undefined, + uniqueID: data.id, + flagCode: data.country, + flagCodeTroll: data.board_flag, + flag: $$1.unescape((data.country_name || data.flag_name)), + dateUTC: data.time, + dateText: data.now, + // Yes, we use the raw string here + commentHTML: { innerHTML: data.com || '', [isEscaped]: true } + }; + if (data.capcode) { + o.info.capcode = data.capcode.replace(/_highlight$/, '').replace(/_/g, ' ').replace(/\b\w/g, c => c.toUpperCase()); + o.capcodeHighlight = /_highlight$/.test(data.capcode); + delete o.info.uniqueID; + } + o.files = []; + if (data.ext) { + o.file = this.parseJSONFile(data, { siteID, boardID }); + o.files.push(o.file); + } + // Temporary JSON properties for events such as April 1 / Halloween + o.extra = dict(); + for (var key in data) { + if (key[0] === 'x') { + o.extra[key] = data[key]; + } + } + return o; + }, + parseJSONFile(data, { siteID, boardID }) { + const site = g.sites[siteID]; + const filename = (site.software === 'yotsuba') && (boardID === 'f') ? + `${encodeURIComponent(data.filename)}${data.ext}` + : + `${data.tim}${data.ext}`; + const o = { + name: ($$1.unescape(data.filename)) + data.ext, + url: site.urls.file({ siteID, boardID }, filename), + height: data.h, + width: data.w, + MD5: data.md5, + size: $$1.bytesToString(data.fsize), + thumbURL: site.urls.thumb({ siteID, boardID }, `${data.tim}s.jpg`), + theight: data.tn_h, + twidth: data.tn_w, + isSpoiler: !!data.spoiler, + tag: data.tag, + hasDownscale: !!data.m_img + }; + if ((data.h != null) && !/\.pdf$/.test(o.url)) { + o.dimensions = `${o.width}x${o.height}`; + } + return o; + }, + parseComment(html) { + html = html + .replace(//gi, '\n') + .replace(/\n\n]*>/g, ''); + return $$1.unescape(html); + }, + parseCommentDisplay(html) { + // Hide spoilers. + if (!Conf['Remove Spoilers'] && !Conf['Reveal Spoilers']) { + let html2; + while ((html2 = html.replace(/(?:(?!<\/?s>).)*<\/s>/g, '[spoiler]')) !== html) { + html = html2; + } + } + html = html + .replace(/^Rolled [^<]*<\/b>/i, '') // Rolls (/tg/, /qst/) + .replace(/>") : ''), + h("div", { id: `p${ID}`, class: `post ${postClass}${o.capcodeHighlight ? ' highlightPost' : ''}` }, + (o.isReply ? h(hFragment, null, + postInfo, + fileBlock) : h(hFragment, null, + fileBlock, + postInfo)), + h("blockquote", { class: "postMessage", id: `m${ID}` }, commentHTML))); + const container = $$1.el('div', { + className: `postContainer ${postClass}Container`, + id: `pc${ID}` + }); + $$1.extend(container, wholePost); + // Fix quotelinks + for (var quote of $$('.quotelink', container)) { + var href = quote.getAttribute('href'); + if (href[0] === '#') { + if (!this.sameThread(boardID, threadID)) { + quote.href = this.threadURL(boardID, threadID) + href; + } + } + else { + var match; + if ((match = quote.href.match(SWYotsuba.regexp.quotelink)) && (this.sameThread(match[1], match[2]))) { + quote.href = href.match(/(#[^#]*)?$/)[0] || '#'; + } + } + } + return container; + }, + summaryText(status, posts, files) { + let text = ''; + if (status) { + text += `${status} `; + } + text += `${posts} post${posts > 1 ? 's' : ''}`; + if (+files) { + text += ` and ${files} image repl${files > 1 ? 'ies' : 'y'}`; + } + return text += ` ${status === '-' ? 'shown' : 'omitted'}.`; + }, + summary(boardID, threadID, posts, files) { + return $$1.el('a', { + className: 'summary', + textContent: this.summaryText('', posts, files), + href: `/${boardID}/thread/${threadID}` + }); + }, + thread(thread, data, withReplies) { + let root; + if (root = thread.nodes.root) { + $$1.rmAll(root); + } + else { + thread.nodes.root = (root = $$1.el('div', { + className: 'thread', + id: `t${data.no}` + })); + } + if (this.hat) { + $$1.add(root, this.hat.cloneNode(false)); + } + $$1.add(root, thread.OP.nodes.root); + if (data.omitted_posts || (!withReplies && data.replies)) { + const [posts, files] = Array.from(withReplies ? + // XXX data.omitted_images is not accurate. + [data.omitted_posts, data.images - data.last_replies.filter(data => !!data.ext).length] + : + [data.replies, data.images]); + const summary = this.summary(thread.board.ID, data.no, posts, files); + $$1.add(root, summary); + } + return root; + }, + catalogThread(thread, data, pageCount) { + let cssText, imgClass, src; + const { staticPath, gifIcon } = this; + const { tn_w, tn_h } = data; + if (data.spoiler && !Conf['Reveal Spoiler Thumbnails']) { + let spoilerRange; + src = `${staticPath}spoiler`; + if (spoilerRange = this.spoilerRange[thread.board]) { + // Randomize the spoiler image. + src += (`-${thread.board}`) + Math.floor(1 + (spoilerRange * Math.random())); + } + src += '.png'; + imgClass = 'spoiler-file'; + cssText = "--tn-w: 100; --tn-h: 100;"; + } + else if (data.filedeleted) { + src = `${staticPath}filedeleted-res${gifIcon}`; + imgClass = 'deleted-file'; + } + else if (thread.OP.file) { + src = thread.OP.file.thumbURL; + const ratio = 250 / Math.max(tn_w, tn_h); + cssText = `--tn-w: ${tn_w * ratio}; --tn-h: ${tn_h * ratio};`; + } + else { + src = `${staticPath}nofile.png`; + imgClass = 'no-file'; + } + const postCount = data.replies + 1; + const fileCount = data.images + !!data.ext; + const container = $$1.el('div', generateCatalogThreadHtml(thread, src, imgClass, data, postCount, fileCount, pageCount, staticPath, gifIcon)); + $$1.before(thread.OP.nodes.info, [...Array.from(container.childNodes)]); + for (var br of $$('br', thread.OP.nodes.comment)) { + if (br.previousSibling && (br.previousSibling.nodeName === 'BR')) { + $$1.addClass(br, 'extra-linebreak'); + } + } + const root = $$1.el('div', { + className: 'thread catalog-thread', + id: `t${thread}` + }); + if (thread.OP.highlights) { + $$1.addClass(root, ...Array.from(thread.OP.highlights)); + } + if (!thread.OP.file) { + $$1.addClass(root, 'noFile'); + } + root.style.cssText = cssText || ''; + return root; + }, + catalogReply(thread, data) { + let excerpt = ''; + if (data.com) { + excerpt = this.parseCommentDisplay(data.com).replace(/>>\d+/g, '').trim().replace(/\n+/g, ' // '); + } + if (data.ext) { + if (!excerpt) { + excerpt = `${$$1.unescape(data.filename)}${data.ext}`; + } + } + if (data.com) { + if (!excerpt) { + excerpt = $$1.unescape(data.com.replace(//gi, ' // ')); + } + } + if (!excerpt) { + excerpt = '\xA0'; + } + if (excerpt.length > 73) { + excerpt = `${excerpt.slice(0, 70)}...`; + } + const link = this.postURL(thread.board.ID, thread.ID, data.no); + return $$1.el('div', { className: 'catalog-reply' }, h(hFragment, null, + h("span", null, + h("time", { "data-utc": data.time * 1000, "data-abbrev": "1" }, "..."), + ": "), + h("a", { class: "catalog-reply-excerpt", href: link }, excerpt), + h("a", { class: "catalog-reply-preview", href: link }, "..."))); + } + } + }; + + const SW = { tinyboard: SWTinyboard, yotsuba: SWYotsuba }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var FileInfo = { + init() { + if (!['index', 'thread', 'archive'].includes(g.VIEW) || !Conf['File Info Formatting']) { + return; + } + return Callbacks.Post.push({ + name: 'File Info Formatting', + cb: this.node + }); + }, + node() { + if (!this.file) { + return; + } + if (this.isClone) { + let a; + for (a of $$('.file-info .download-button', this.file.text)) { + $$1.on(a, 'click', ImageCommon.download); + } + for (a of $$('.file-info .quick-filter-md5', this.file.text)) { + $$1.on(a, 'click', Filter.quickFilterMD5); + } + return; + } + const oldInfo = $$1.el('span', { className: 'fileText-original' }); + $$1.prepend(this.file.link.parentNode, oldInfo); + $$1.add(oldInfo, [this.file.link.previousSibling, this.file.link, this.file.link.nextSibling]); + const info = $$1.el('span', { className: 'file-info' }); + FileInfo.format(Conf['fileInfo'], this, info); + return $$1.prepend(this.file.text, info); + }, + format(formatString, post, outputNode) { + let a; + const output = []; + formatString.replace(/%(.)|[^%]+/g, function (s, c) { + output.push($$1.hasOwn(FileInfo.formatters, c) ? + FileInfo.formatters[c].call(post) + : + { innerHTML: E(s) }); + return ''; + }); + $$1.extend(outputNode, { innerHTML: E.cat(output) }); + for (a of $$('.download-button', outputNode)) { + $$1.on(a, 'click', ImageCommon.download); + } + for (a of $$('.quick-filter-md5', outputNode)) { + $$1.on(a, 'click', Filter.quickFilterMD5); + } + }, + formatters: { + t() { return { innerHTML: E(this.file.url.match(/[^/]*$/)[0]), [isEscaped]: true }; }, + T() { return h("a", { href: this.file.url, target: "_blank" }, FileInfo.formatters.t.call(this)); }, + l() { return h("a", { href: this.file.url, target: "_blank" }, FileInfo.formatters.n.call(this)); }, + L() { return h("a", { href: this.file.url, target: "_blank" }, FileInfo.formatters.N.call(this)); }, + n() { + const fullname = this.file.name; + const shortname = SW.yotsuba.Build.shortFilename(this.file.name, this.isReply); + if (fullname === shortname) { + return { innerHTML: E(fullname), [isEscaped]: true }; + } + else { + return h("span", { class: "fnswitch" }, + h("span", { class: "fntrunc" }, shortname), + h("span", { class: "fnfull" }, fullname)); + } + }, + N() { return { innerHTML: E(this.file.name), [isEscaped]: true }; }, + d() { return h("a", { href: this.file.url, download: this.file.name, class: "download-button" }, "\uD83D\uDCE5\uFE0E"); }, + f() { + return { innerHTML: "", [isEscaped]: true }; + }, + p() { return { innerHTML: ((this.file.isSpoiler) ? "Spoiler, " : ""), [isEscaped]: true }; }, + s() { return { innerHTML: E(this.file.size), [isEscaped]: true }; }, + B() { return { innerHTML: Math.round(this.file.sizeInBytes) + " Bytes", [isEscaped]: true }; }, + K() { return { innerHTML: (Math.round(this.file.sizeInBytes / 1024)) + " KB", [isEscaped]: true }; }, + M() { return { innerHTML: (Math.round(this.file.sizeInBytes / 1048576 * 100) / 100) + " MB", [isEscaped]: true }; }, + r() { return { innerHTML: E(this.file.dimensions || "PDF"), [isEscaped]: true }; }, + g() { return { innerHTML: ((this.file.tag) ? ", " + E(this.file.tag) : ""), [isEscaped]: true }; }, + '%'() { return { innerHTML: "%", [isEscaped]: true }; } + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var Time = { + init() { + if (!['index', 'thread', 'archive'].includes(g.VIEW) || !Conf['Time Formatting']) { return; } + + return Callbacks.Post.push({ + name: 'Time Formatting', + cb: this.node + }); + }, + + node() { + if (!this.info.date || this.isClone) { return; } + const {textContent} = this.nodes.date; + return this.nodes.date.textContent = textContent.match(/^\s*/)[0] + Time.format(Conf['time'], this.info.date) + textContent.match(/\s*$/)[0]; + }, + + format(formatString, date) { + return formatString.replace(/%(.)/g, function(s, c) { + if ($$1.hasOwn(Time.formatters, c)) { + return Time.formatters[c].call(date); + } else { + return s; + } + }); + }, + + day: [ + 'Sunday', + 'Monday', + 'Tuesday', + 'Wednesday', + 'Thursday', + 'Friday', + 'Saturday' + ], + + month: [ + 'January', + 'February', + 'March', + 'April', + 'May', + 'June', + 'July', + 'August', + 'September', + 'October', + 'November', + 'December' + ], + + localeFormat(date, options, defaultValue) { + if (Conf['timeLocale']) { + try { + return Intl.DateTimeFormat(Conf['timeLocale'], options).format(date); + } catch (error) {} + } + return defaultValue; + }, + + localeFormatPart(date, options, part, defaultValue) { + if (Conf['timeLocale']) { + try { + const parts = Intl.DateTimeFormat(Conf['timeLocale'], options).formatToParts(date); + return parts.map(function(x) { if (x.type === part) { return x.value; } else { return ''; } }).join(''); + } catch (error) {} + } + return defaultValue; + }, + + zeroPad(n) { if (n < 10) { return `0${n}`; } else { return n; } }, + + formatters: { + a() { return Time.localeFormat(this, {weekday: 'short'}, Time.day[this.getDay()].slice(0, 3)); }, + A() { return Time.localeFormat(this, {weekday: 'long'}, Time.day[this.getDay()]); }, + b() { return Time.localeFormat(this, {month: 'short'}, Time.month[this.getMonth()].slice(0, 3)); }, + B() { return Time.localeFormat(this, {month: 'long'}, Time.month[this.getMonth()]); }, + d() { return Time.zeroPad(this.getDate()); }, + e() { return this.getDate(); }, + H() { return Time.zeroPad(this.getHours()); }, + I() { return Time.zeroPad((this.getHours() % 12) || 12); }, + k() { return this.getHours(); }, + l() { return (this.getHours() % 12) || 12; }, + m() { return Time.zeroPad(this.getMonth() + 1); }, + M() { return Time.zeroPad(this.getMinutes()); }, + p() { return Time.localeFormatPart(this, {hour: 'numeric', hour12: true}, 'dayperiod', (this.getHours() < 12 ? 'AM' : 'PM')); }, + P() { return Time.formatters.p.call(this).toLowerCase(); }, + S() { return Time.zeroPad(this.getSeconds()); }, + y() { return this.getFullYear().toString().slice(2); }, + Y() { return this.getFullYear(); }, + '%'() { return '%'; } + } + }; + + var Beep = 'UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA'; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS104: Avoid inline assignments + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var ReplyPruning = { + init() { + if ((g.VIEW !== 'thread') || !Conf['Reply Pruning']) { return; } + + this.container = $$1.frag(); + + this.summary = $$1.el('span', { + hidden: true, + className: 'summary' + } + ); + this.summary.style.cursor = 'pointer'; + $$1.on(this.summary, 'click', () => { + this.inputs.enabled.checked = !this.inputs.enabled.checked; + return $$1.event('change', null, this.inputs.enabled); + }); + + const label = UI.checkbox('Prune Replies', 'Show Last', Conf['Prune All Threads']); + const el = $$1.el('span', + {title: 'Maximum number of replies to show.'} + , + {innerHTML: " "}); + $$1.prepend(el, label); + + this.inputs = { + enabled: label.firstElementChild, + replies: el.lastElementChild + }; + + this.setEnabled.call(this.inputs.enabled); + $$1.on(this.inputs.enabled, 'change', this.setEnabled); + $$1.on(this.inputs.replies, 'change', $$1.cb.value); + + Header$1.menu.addEntry({ + el, + order: 190 + }); + + return Callbacks.Thread.push({ + name: 'Reply Pruning', + cb: this.node + }); + }, + + position: 0, + hidden: 0, + hiddenFiles: 0, + total: 0, + totalFiles: 0, + + setEnabled() { + const other = QuoteThreading.input; + if (this.checked && other?.checked) { + other.checked = false; + $$1.event('change', null, other); + } + return ReplyPruning.active = this.checked; + }, + + showIfHidden(id) { + if (ReplyPruning.container && $$1(`#${id}`, ReplyPruning.container)) { + ReplyPruning.inputs.enabled.checked = false; + return $$1.event('change', null, ReplyPruning.inputs.enabled); + } + }, + + node() { + let middle; + ReplyPruning.thread = this; + + if (this.isSticky) { + ReplyPruning.active = (ReplyPruning.inputs.enabled.checked = true); + if (QuoteThreading.input) { + // Disable Quote Threading for this thread but don't save the setting. + Conf['Thread Quotes'] = (QuoteThreading.input.checked = false); + } + } + + this.posts.forEach(function(post) { + if (post.isReply) { + ReplyPruning.total++; + if (post.file) { return ReplyPruning.totalFiles++; } + } + }); + + // If we're linked to a post that we would hide, don't hide the posts in the first place. + if ( + ReplyPruning.active && + /^#p\d+$/.test(location.hash) && + (1 <= (middle = this.posts.keys.indexOf(location.hash.slice(2))) && middle < 1 + Math.max(ReplyPruning.total - +Conf["Max Replies"], 0)) + ) { + ReplyPruning.active = (ReplyPruning.inputs.enabled.checked = false); + } + + $$1.after(this.OP.nodes.root, ReplyPruning.summary); + + $$1.on(ReplyPruning.inputs.enabled, 'change', ReplyPruning.update); + $$1.on(ReplyPruning.inputs.replies, 'change', ReplyPruning.update); + $$1.on(d$1, 'ThreadUpdate', ReplyPruning.updateCount); + $$1.on(d$1, 'ThreadUpdate', ReplyPruning.update); + + return ReplyPruning.update(); + }, + + updateCount(e) { + if (e.detail[404]) { return; } + for (var fullID of e.detail.newPosts) { + ReplyPruning.total++; + if (g.posts.get(fullID).file) { ReplyPruning.totalFiles++; } + } + }, + + update() { + let boardTop, node, post; + const hidden1 = ReplyPruning.hidden; + const hidden2 = ReplyPruning.active ? + Math.max(ReplyPruning.total - +Conf["Max Replies"], 0) + : + 0; + + // Record position from bottom of document + const oldPos = d$1.body.clientHeight - window.scrollY; + + const {posts} = ReplyPruning.thread; + + if (ReplyPruning.hidden < hidden2) { + while ((ReplyPruning.hidden < hidden2) && (ReplyPruning.position < posts.keys.length)) { + post = posts.get(posts.keys[ReplyPruning.position++]); + if (post.isReply && !post.isFetchedQuote) { + while ((node = ReplyPruning.summary.nextSibling) && (node !== post.nodes.root)) { $$1.add(ReplyPruning.container, node); } + $$1.add(ReplyPruning.container, post.nodes.root); + ReplyPruning.hidden++; + if (post.file) { ReplyPruning.hiddenFiles++; } + } + } + + } else if (ReplyPruning.hidden > hidden2) { + const frag = $$1.frag(); + while ((ReplyPruning.hidden > hidden2) && (ReplyPruning.position > 0)) { + post = posts.get(posts.keys[--ReplyPruning.position]); + if (post.isReply && !post.isFetchedQuote) { + while ((node = ReplyPruning.container.lastChild) && (node !== post.nodes.root)) { $$1.prepend(frag, node); } + $$1.prepend(frag, post.nodes.root); + ReplyPruning.hidden--; + if (post.file) { ReplyPruning.hiddenFiles--; } + } + } + $$1.after(ReplyPruning.summary, frag); + $$1.event('PostsInserted', null, ReplyPruning.summary.parentNode); + } + + ReplyPruning.summary.textContent = ReplyPruning.active ? + g.SITE.Build.summaryText('+', ReplyPruning.hidden, ReplyPruning.hiddenFiles) + : + g.SITE.Build.summaryText('-', ReplyPruning.total, ReplyPruning.totalFiles); + ReplyPruning.summary.hidden = (ReplyPruning.total <= +Conf["Max Replies"]); + + // Maintain position in thread when posts are added/removed above + if ((hidden1 !== hidden2) && ((boardTop = Header$1.getTopOf($$1('.board'))) < 0)) { + return window.scrollBy(0, Math.max(d$1.body.clientHeight - oldPos, window.scrollY + boardTop) - window.scrollY); + } + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + /* + <3 aeosynth + */ + + var QuoteThreading = { + init() { + if (!Conf['Quote Threading'] || (g.VIEW !== 'thread')) { return; } + + this.controls = $$1.el('label', + {innerHTML: " Threading"}); + + this.threadNewLink = $$1.el('span', { + className: 'brackets-wrap threadnewlink', + hidden: true + } + ); + $$1.extend(this.threadNewLink, {innerHTML: "Thread New Posts"}); + + this.input = $$1('input', this.controls); + this.input.checked = Conf['Thread Quotes']; + + $$1.on(this.input, 'change', this.setEnabled); + $$1.on(this.input, 'change', this.rethread); + $$1.on(this.threadNewLink.firstElementChild, 'click', this.rethread); + $$1.on(d$1, '4chanXInitFinished', () => { return this.ready = true; }); + + Header$1.menu.addEntry(this.entry = { + el: this.controls, + order: 99 + } + ); + + Callbacks.Thread.push({ + name: 'Quote Threading', + cb: this.setThread + }); + + return Callbacks.Post.push({ + name: 'Quote Threading', + cb: this.node + }); + }, + + parent: dict(), + children: dict(), + inserted: dict(), + + toggleThreading() { + return this.setThreadingState(!Conf['Thread Quotes']); + }, + + setThreadingState(enabled) { + this.input.checked = enabled; + this.setEnabled.call(this.input); + return this.rethread.call(this.input); + }, + + setEnabled() { + if (this.checked) { + $$1.set('Prune All Threads', false); + const other = ReplyPruning.inputs?.enabled; + if (other?.checked) { + other.checked = false; + $$1.event('change', null, other); + } + } + return $$1.cb.checked.call(this); + }, + + setThread() { + QuoteThreading.thread = this; + return $$1.asap((() => !Conf['Thread Updater'] || $$1('.navLinksBot > .updatelink')), function() { + let navLinksBot; + if (navLinksBot = $$1('.navLinksBot')) { return $$1.add(navLinksBot, [$$1.tn(' '), QuoteThreading.threadNewLink]); } + }); + }, + + node() { + let parent; + if (this.isFetchedQuote || this.isClone || !this.isReply) { return; } + + const parents = new Set(); + let lastParent = null; + for (var quote of this.quotes) { + if ((parent = g.posts.get(quote))) { + if (!parent.isFetchedQuote && parent.isReply && (parent.ID < this.ID)) { + parents.add(parent.ID); + if (!lastParent || (parent.ID > lastParent.ID)) { lastParent = parent; } + } + } + } + + if (!lastParent) { return; } + + let ancestor = lastParent; + while ((ancestor = QuoteThreading.parent[ancestor.fullID])) { + parents.delete(ancestor.ID); + } + + if (parents.size === 1) { + return QuoteThreading.parent[this.fullID] = lastParent; + } + }, + + descendants(post) { + let children; + let posts = [post]; + if (children = QuoteThreading.children[post.fullID]) { + for (var child of children) { + posts = posts.concat(QuoteThreading.descendants(child)); + } + } + return posts; + }, + + insert(post) { + let parent, x; + if (!( + Conf['Thread Quotes'] && + (parent = QuoteThreading.parent[post.fullID]) && + !QuoteThreading.inserted[post.fullID] + )) { return false; } + + const descendants = QuoteThreading.descendants(post); + if (!Unread.posts.has(parent.ID)) { + if ((function() { for (var x of descendants) { if (Unread.posts.has(x.ID)) { return true; } } })()) { + QuoteThreading.threadNewLink.hidden = false; + return false; + } + } + + const {order} = Unread; + const children = (QuoteThreading.children[parent.fullID] || (QuoteThreading.children[parent.fullID] = [])); + const threadContainer = parent.nodes.threadContainer || $$1.el('div', {className: 'threadContainer'}); + const nodes = [post.nodes.root]; + if (post.nodes.threadContainer) { nodes.push(post.nodes.threadContainer); } + + let i = children.length; + for (let j = children.length - 1; j >= 0; j--) { var child = children[j]; if (child.ID >= post.ID) { i--; } } + if (i !== children.length) { + const next = children[i]; + for (x of descendants) { order.before(order[next.ID], order[x.ID]); } + children.splice(i, 0, post); + $$1.before(next.nodes.root, nodes); + } else { + let prev2; + let prev = parent; + while ((prev2 = QuoteThreading.children[prev.fullID]) && prev2.length) { + prev = prev2[prev2.length-1]; + } + for (let k = descendants.length - 1; k >= 0; k--) { x = descendants[k]; order.after(order[prev.ID], order[x.ID]); } + children.push(post); + $$1.add(threadContainer, nodes); + } + + QuoteThreading.inserted[post.fullID] = true; + + if (!parent.nodes.threadContainer) { + parent.nodes.threadContainer = threadContainer; + $$1.addClass(parent.nodes.root, 'threadOP'); + $$1.after(parent.nodes.root, threadContainer); + } + + return true; + }, + + rethread() { + if (!QuoteThreading.ready) { return; } + const {thread} = QuoteThreading; + const {posts} = thread; + + QuoteThreading.threadNewLink.hidden = true; + + if (Conf['Thread Quotes']) { + posts.forEach(QuoteThreading.insert); + } else { + const nodes = []; + Unread.order = new RandomAccessList(); + QuoteThreading.inserted = dict(); + posts.forEach(function(post) { + if (post.isFetchedQuote) { return; } + Unread.order.push(post); + if (post.isReply) { nodes.push(post.nodes.root); } + if (QuoteThreading.children[post.fullID]) { + delete QuoteThreading.children[post.fullID]; + $$1.rmClass(post.nodes.root, 'threadOP'); + $$1.rm(post.nodes.threadContainer); + return delete post.nodes.threadContainer; + } + }); + $$1.add(thread.nodes.root, nodes); + } + + Unread.position = Unread.order.first; + Unread.updatePosition(); + Unread.setLine(true); + Unread.read(); + return Unread.update(); + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS201: Simplify complex destructure assignments + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + + var ThreadUpdater = { + init() { + let el, name, sc; + if ((g.VIEW !== 'thread') || !Conf['Thread Updater']) { return; } + this.enabled = true; + + // Chromium won't play audio created in an inactive tab until the tab has been focused, so set it up now. + // XXX Sometimes the loading stalls in Firefox, esp. when opening in private browsing window followed by normal window. + // Don't let it keep the loading icon on indefinitely. + this.audio = $$1.el('audio'); + if ($$1.engine !== 'gecko') { this.audio.src = this.beep; } + + if (Conf['Updater and Stats in Header']) { + this.dialog = (sc = $$1.el('span', + {id: 'updater'})); + $$1.extend(sc, {innerHTML: ''}); + Header$1.addShortcut('updater', sc, 100); + } else { + this.dialog = (sc = UI.dialog('updater', + {innerHTML: '
        '})); + $$1.addClass(doc$1, 'float'); + $$1.ready(() => $$1.add(d$1.body, sc)); + } + + this.checkPostCount = 0; + + this.timer = $$1('#update-timer', sc); + this.status = $$1('#update-status', sc); + + $$1.on(this.timer, 'click', this.update); + $$1.on(this.status, 'click', this.update); + + const updateLink = $$1.el('span', + {className: 'brackets-wrap updatelink'}); + $$1.extend(updateLink, {innerHTML: 'Update'}); + Main$1.ready(function() { + let navLinksBot; + if (navLinksBot = $$1('.navLinksBot')) { return $$1.add(navLinksBot, [$$1.tn(' '), updateLink]); } + }); + $$1.on(updateLink.firstElementChild, 'click', this.update); + + const subEntries = []; + for (name in Config.updater.checkbox) { + var conf = Config.updater.checkbox[name]; + el = UI.checkbox(name, name); + el.title = conf[1]; + var input = el.firstElementChild; + $$1.on(input, 'change', $$1.cb.checked); + if (input.name === 'Scroll BG') { + $$1.on(input, 'change', this.cb.scrollBG); + this.cb.scrollBG(); + } else if (input.name === 'Auto Update') { + $$1.on(input, 'change', this.setInterval); + } + subEntries.push({el}); + } + + this.settings = $$1.el('span', + {innerHTML: 'Interval'}); + + $$1.on(this.settings, 'click', this.intervalShortcut); + + subEntries.push({el: this.settings}); + + Header$1.menu.addEntry(this.entry = { + el: $$1.el('span', + {textContent: 'Updater'}), + order: 110, + subEntries + } + ); + + return Callbacks.Thread.push({ + name: 'Thread Updater', + cb: this.node + }); + }, + + node() { + ThreadUpdater.thread = this; + ThreadUpdater.root = this.nodes.root; + ThreadUpdater.outdateCount = 0; + + // We must keep track of our own list of live posts/files + // to provide an accurate deletedPosts/deletedFiles on update + // as posts may be `kill`ed elsewhere. + ThreadUpdater.postIDs = []; + ThreadUpdater.fileIDs = []; + this.posts.forEach(function(post) { + ThreadUpdater.postIDs.push(post.ID); + if (post.file) { return ThreadUpdater.fileIDs.push(post.ID); } + }); + + ThreadUpdater.cb.interval.call($$1.el('input', {value: Conf['Interval']})); + + $$1.on(d$1, 'QRPostSuccessful', ThreadUpdater.cb.checkpost); + $$1.on(d$1, 'visibilitychange', ThreadUpdater.cb.visibility); + + return ThreadUpdater.setInterval(); + }, + + /* + http://freesound.org/people/pierrecartoons1979/sounds/90112/ + cc-by-nc-3.0 + */ + beep: `data:audio/wav;base64,${Beep}`, + + playBeep() { + const {audio} = ThreadUpdater; + if (!audio.src) { audio.src = ThreadUpdater.beep; } + if (audio.paused) { + return audio.play(); + } else { + return $$1.one(audio, 'ended', ThreadUpdater.playBeep); + } + }, + + cb: { + checkpost(e) { + if (e.detail.threadID !== ThreadUpdater.thread.ID) { return; } + ThreadUpdater.postID = e.detail.postID; + ThreadUpdater.checkPostCount = 0; + ThreadUpdater.outdateCount = 0; + return ThreadUpdater.setInterval(); + }, + + visibility() { + if (d$1.hidden) { return; } + // Reset the counter when we focus this tab. + ThreadUpdater.outdateCount = 0; + if (ThreadUpdater.seconds > ThreadUpdater.interval) { + return ThreadUpdater.setInterval(); + } + }, + + scrollBG() { + return ThreadUpdater.scrollBG = Conf['Scroll BG'] ? + () => true + : + () => !d$1.hidden; + }, + + interval(e) { + let val = parseInt(this.value, 10); + if (val < 1) { val = 1; } + ThreadUpdater.interval = (this.value = val); + if (e) { return $$1.cb.value.call(this); } + }, + + load() { + if (this !== ThreadUpdater.req) { return; } // aborted + switch (this.status) { + case 200: + ThreadUpdater.parse(this); + if (ThreadUpdater.thread.isArchived) { + return ThreadUpdater.kill(); + } else { + return ThreadUpdater.setInterval(); + } + case 404: + // XXX workaround for 4chan sending false 404s + return $$1.ajax(g.SITE.urls.catalogJSON({boardID: ThreadUpdater.thread.board.ID}), { onloadend() { + let confirmed; + if (this.status === 200) { + confirmed = true; + for (var page of this.response) { + for (var thread of page.threads) { + if (thread.no === ThreadUpdater.thread.ID) { + confirmed = false; + break; + } + } + } + } else { + confirmed = false; + } + if (confirmed) { + return ThreadUpdater.kill(); + } else { + return ThreadUpdater.error(this); + } + } + } + ); + default: + return ThreadUpdater.error(this); + } + } + }, + + kill() { + ThreadUpdater.thread.kill(); + ThreadUpdater.setInterval(); + return $$1.event('ThreadUpdate', { + 404: true, + threadID: ThreadUpdater.thread.fullID + } + ); + }, + + error(req) { + if (req.status === 304) { + ThreadUpdater.set('status', ''); + } + ThreadUpdater.setInterval(); + if (!req.status) { + return ThreadUpdater.set('status', 'Connection Error', 'warning'); + } else if (req.status !== 304) { + return ThreadUpdater.set('status', `${req.statusText} (${req.status})`, 'warning'); + } + }, + + setInterval() { + clearTimeout(ThreadUpdater.timeoutID); + + if (ThreadUpdater.thread.isDead) { + ThreadUpdater.set('status', (ThreadUpdater.thread.isArchived ? 'Archived' : '404'), 'warning'); + ThreadUpdater.set('timer', ''); + return; + } + + // Fetching your own posts after posting + if (ThreadUpdater.postID && (ThreadUpdater.checkPostCount < 5)) { + ThreadUpdater.set('timer', '...', 'loading'); + ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * SECOND); + return; + } + + if (!Conf['Auto Update']) { + ThreadUpdater.set('timer', 'Update'); + return; + } + + const {interval} = ThreadUpdater; + if (Conf['Optional Increase']) { + // Lower the max refresh rate limit on visible tabs. + const limit = d$1.hidden ? 10 : 5; + const j = Math.min(ThreadUpdater.outdateCount, limit); + + // 1 second to 100, 30 to 300. + const cur = (Math.floor(interval * 0.1) || 1) * j * j; + ThreadUpdater.seconds = $$1.minmax(cur, interval, 300); + } else { + ThreadUpdater.seconds = interval; + } + + return ThreadUpdater.timeout(); + }, + + intervalShortcut() { + Settings.open('Advanced'); + const settings = $$1.id('fourchanx-settings'); + return $$1('input[name=Interval]', settings).focus(); + }, + + set(name, text, klass) { + let node; + const el = ThreadUpdater[name]; + if ((node = el.firstChild)) { + // Prevent the creation of a new DOM Node + // by setting the text node's data. + node.data = text; + } else { + el.textContent = text; + } + return el.className = klass ?? (text === '' ? 'empty' : ''); + }, + + timeout() { + if (ThreadUpdater.seconds) { + ThreadUpdater.set('timer', ThreadUpdater.seconds); + ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); + } else { + ThreadUpdater.outdateCount++; + ThreadUpdater.update(); + } + return ThreadUpdater.seconds--; + }, + + update() { + let oldReq; + clearTimeout(ThreadUpdater.timeoutID); + ThreadUpdater.set('timer', '...', 'loading'); + if (oldReq = ThreadUpdater.req) { + delete ThreadUpdater.req; + oldReq.abort(); + } + return ThreadUpdater.req = $$1.whenModified( + g.SITE.urls.threadJSON({boardID: ThreadUpdater.thread.board.ID, threadID: ThreadUpdater.thread.ID}), + 'ThreadUpdater', + ThreadUpdater.cb.load, + { timeout: MINUTE } + ); + }, + + updateThreadStatus(type, status) { + if (!(ThreadUpdater.thread[`is${type}`] !== status)) { return; } + ThreadUpdater.thread.setStatus(type, status); + if ((type === 'Closed') && ThreadUpdater.thread.isArchived) { return; } + const change = type === 'Sticky' ? + status ? + 'now a sticky' + : + 'not a sticky anymore' + : + status ? + 'now closed' + : + 'not closed anymore'; + return new Notice('info', `The thread is ${change}.`, 30); + }, + + parse(req) { + let ID, ipCountEl, post; + const postObjects = req.response.posts; + const OP = postObjects[0]; + const {thread} = ThreadUpdater; + const {board} = thread; + const lastPost = ThreadUpdater.postIDs[ThreadUpdater.postIDs.length - 1]; + + // XXX Reject updates that falsely delete the last post. + if ((postObjects[postObjects.length-1].no < lastPost) && + ((new Date(req.getResponseHeader('Last-Modified')) - thread.posts.get(lastPost).info.date) < (30 * SECOND))) { return; } + + g.SITE.Build.spoilerRange[board] = OP.custom_spoiler; + thread.setStatus('Archived', !!OP.archived); + ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky); + ThreadUpdater.updateThreadStatus('Closed', !!OP.closed); + thread.postLimit = !!OP.bumplimit; + thread.fileLimit = !!OP.imagelimit; + if (OP.unique_ips != null) { thread.ipCount = OP.unique_ips; } + + const posts = []; // new post objects + const index = []; // existing posts + const files = []; // existing files + const newPosts = []; // new post fullID list for API + + // Build the index, create posts. + for (var postObject of postObjects) { + ID = postObject.no; + index.push(ID); + if (postObject.fsize) { files.push(ID); } + + // Insert new posts, not older ones. + if (ID <= lastPost) { continue; } + + // XXX Resurrect wrongly deleted posts. + if ((post = thread.posts.get(ID)) && !post.isFetchedQuote) { + post.resurrect(); + continue; + } + + newPosts.push(`${board}.${ID}`); + var node = g.SITE.Build.postFromObject(postObject, board.ID); + posts.push(new Post(node, thread, board)); + // Fetching your own posts after posting + if (ThreadUpdater.postID === ID) { delete ThreadUpdater.postID; } + } + + // Check for deleted posts. + const deletedPosts = []; + for (ID of ThreadUpdater.postIDs) { + if (!index.includes(ID)) { + thread.posts.get(ID).kill(); + deletedPosts.push(`${board}.${ID}`); + } + } + ThreadUpdater.postIDs = index; + + // Check for deleted files. + const deletedFiles = []; + for (ID of ThreadUpdater.fileIDs) { + if (!(files.includes(ID) || deletedPosts.includes(`${board}.${ID}`))) { + thread.posts.get(ID).kill(true); + deletedFiles.push(`${board}.${ID}`); + } + } + ThreadUpdater.fileIDs = files; + + if (!posts.length) { + ThreadUpdater.set('status', ''); + } else { + ThreadUpdater.set('status', `+${posts.length}`, 'new'); + ThreadUpdater.outdateCount = 0; + + const unreadCount = Unread.posts?.size; + const unreadQYCount = Unread.postsQuotingYou?.size; + + Main$1.callbackNodes('Post', posts); + + if (d$1.hidden || !d$1.hasFocus()) { + if (Conf['Beep Quoting You'] && (Unread.postsQuotingYou?.size > unreadQYCount)) { + ThreadUpdater.playBeep(); + if (Conf['Beep']) { ThreadUpdater.playBeep(); } + } else if (Conf['Beep'] && (Unread.posts?.size > 0) && (unreadCount === 0)) { + ThreadUpdater.playBeep(); + } + } + + const scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && + ((ThreadUpdater.root.getBoundingClientRect().bottom - doc$1.clientHeight) < 25); + + let firstPost = null; + for (post of posts) { + if (!QuoteThreading.insert(post)) { + if (!firstPost) { firstPost = post.nodes.root; } + $$1.add(ThreadUpdater.root, post.nodes.root); + } + } + $$1.event('PostsInserted', null, ThreadUpdater.root); + + if (scroll) { + if (Conf['Bottom Scroll']) { + window.scrollTo(0, d$1.body.clientHeight); + } else { + if (firstPost) { Header$1.scrollTo(firstPost); } + } + } + } + + // Update IP count in original post form. + if ((OP.unique_ips != null) && (ipCountEl = $$1.id('unique-ips'))) { + ipCountEl.textContent = OP.unique_ips; + ipCountEl.previousSibling.textContent = ipCountEl.previousSibling.textContent.replace(/\b(?:is|are)\b/, OP.unique_ips === 1 ? 'is' : 'are'); + ipCountEl.nextSibling.textContent = ipCountEl.nextSibling.textContent.replace(/\bposters?\b/, OP.unique_ips === 1 ? 'poster' : 'posters'); + } + + return $$1.event('ThreadUpdate', { + 404: false, + threadID: thread.fullID, + newPosts, + deletedPosts, + deletedFiles, + postCount: OP.replies + 1, + fileCount: OP.images + !!OP.fsize, + ipCount: OP.unique_ips + } + ); + } + }; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * DS205: Consider reworking code to avoid use of IIFEs + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var Settings = { + dialog: undefined, + init() { + // 4chan X settings link + const link = $$1.el('a', { + className: 'settings-link', + textContent: '🔧︎', + title: `${meta.name} Settings`, + href: 'javascript:;' + }); + $$1.on(link, 'click', Settings.open); + Header$1.addShortcut('settings', link, 820); + const add = this.addSection; + add('Main', this.main); + add('Filter', this.filter); + add('Sauce', this.sauce); + add('Advanced', this.advanced); + add('Keybinds', this.keybinds); + $$1.on(d$1, 'AddSettingsSection', Settings.addSection); + $$1.on(d$1, 'OpenSettings', e => Settings.open(e.detail)); + if ((g.SITE.software === 'yotsuba') && Conf['Disable Native Extension']) { + if ($$1.hasStorage) { + // Run in page context to handle case where 4chan X has localStorage access but not the page. + // (e.g. Pale Moon 26.2.2, GM 3.8, cookies disabled for 4chan only) + return $$1.global(function () { + try { + const settings = JSON.parse(localStorage.getItem('4chan-settings')) || {}; + if (settings.disableAll) { + return; + } + settings.disableAll = true; + return localStorage.setItem('4chan-settings', JSON.stringify(settings)); + } + catch (error) { + return Object.defineProperty(window, 'Config', { value: { disableAll: true } }); + } + }); + } + else { + return $$1.global(() => Object.defineProperty(window, 'Config', { value: { disableAll: true } })); + } + } + }, + open(openSection) { + let dialog, sectionToOpen; + if (Settings.dialog) { + return; + } + $$1.event('CloseMenu'); + Settings.dialog = (dialog = $$1.el('div', { id: 'overlay' }, settingsHtml)); + $$1.on($$1('.export', dialog), 'click', Settings.export); + $$1.on($$1('.import', dialog), 'click', Settings.import); + $$1.on($$1('.reset', dialog), 'click', Settings.reset); + $$1.on($$1('input', dialog), 'change', Settings.onImport); + const links = []; + for (var section of Settings.sections) { + var link = $$1.el('a', { + className: `tab-${section.hyphenatedTitle}`, + textContent: section.title, + href: 'javascript:;' + }); + $$1.on(link, 'click', Settings.openSection.bind(section)); + links.push(link, $$1.tn(' | ')); + if (section.title === openSection) { + sectionToOpen = link; + } + } + links.pop(); + $$1.add($$1('.sections-list', dialog), links); + if (openSection !== 'none') { + (sectionToOpen ? sectionToOpen : links[0]).click(); + } + $$1.on($$1('.close', dialog), 'click', Settings.close); + $$1.on(window, 'beforeunload', Settings.close); + $$1.on(dialog, 'click', Settings.close); + $$1.on(dialog.firstElementChild, 'click', e => e.stopPropagation()); + $$1.add(d$1.body, dialog); + return $$1.event('OpenSettings', null, dialog); + }, + close() { + if (!Settings.dialog) { + return; + } + // Unfocus current field to trigger change event. + d$1.activeElement?.blur(); + $$1.rm(Settings.dialog); + return delete Settings.dialog; + }, + sections: [], + addSection(title, open) { + if (typeof title !== 'string') { + ({ title, open } = title.detail); + } + const hyphenatedTitle = title.toLowerCase().replace(/\s+/g, '-'); + return Settings.sections.push({ title, hyphenatedTitle, open }); + }, + openSection() { + let selected; + if (selected = $$1('.tab-selected', Settings.dialog)) { + $$1.rmClass(selected, 'tab-selected'); + } + $$1.addClass($$1(`.tab-${this.hyphenatedTitle}`, Settings.dialog), 'tab-selected'); + const section = $$1('section', Settings.dialog); + $$1.rmAll(section); + section.className = `section-${this.hyphenatedTitle}`; + this.open(section, g); + section.scrollTop = 0; + return $$1.event('OpenSettings', null, section); + }, + warnings: { + localStorage(cb) { + if ($$1.cantSync) { + const why = $$1.cantSet ? 'save your settings' : 'synchronize settings between tabs'; + return cb($$1.el('li', { + textContent: `\ +${meta.name} needs local storage to ${why}. +Enable it on boards.${location.hostname.split('.')[1]}.org in your browser's privacy settings (may be listed as part of "local data" or "cookies").\ +` + })); + } + }, + ads(cb) { + return $$1.onExists(doc$1, '.adg-rects > .desktop', ad => $$1.onExists(ad, 'iframe', function () { + const url = Redirect$1.to('thread', { boardID: 'qa', threadID: 362590 }); + return cb($$1.el('li', h(hFragment, null, + "To protect yourself from ", + h("a", { href: url, target: "_blank" }, "malicious ads"), + ", you should ", + h("a", { href: "https://github.com/gorhill/uBlock#ublock-origin", target: "_blank" }, "block ads"), + " on 4chan."))); + })); + } + }, + main(section) { + let key; + const warnings = $$1.el('fieldset', { hidden: true }, { innerHTML: 'Warnings
          ' }); + const addWarning = function (item) { + $$1.add($$1('ul', warnings), item); + return warnings.hidden = false; + }; + for (key in Settings.warnings) { + var warning = Settings.warnings[key]; + warning(addWarning); + } + $$1.add(section, warnings); + const items = dict(); + const inputs = dict(); + const addCheckboxes = function (root, obj) { + const containers = [root]; + return (() => { + const result = []; + for (key in obj) { + var arr = obj[key]; + if (arr instanceof Array) { + var description = arr[1]; + var div = $$1.el('div', { innerHTML: `: ${description}` }); + div.dataset.name = key; + var input = $$1('input', div); + $$1.on(input, 'change', $$1.cb.checked); + $$1.on(input, 'change', function () { return this.parentNode.parentNode.dataset.checked = this.checked; }); + items[key] = Conf[key]; + inputs[key] = input; + var level = arr[2] || 0; + if (containers.length <= level) { + var container = $$1.el('div', { className: 'suboption-list' }); + $$1.add(containers[containers.length - 1].lastElementChild, container); + containers[level] = container; + } + else if (containers.length > (level + 1)) { + containers.splice(level + 1, containers.length - (level + 1)); + } + result.push($$1.add(containers[level], div)); + } + } + return result; + })(); + }; + for (var keyFS in Config.main) { + var obj = Config.main[keyFS]; + var fs = $$1.el('fieldset', { innerHTML: `${keyFS}` }); + addCheckboxes(fs, obj); + if (keyFS === 'Posting and Captchas') { + $$1.add(fs, $$1.el('p', { innerHTML: 'For more info on captcha options and issues, see the captcha FAQ.' })); + } + $$1.add(section, fs); + } + addCheckboxes($$1('div[data-name="JSON Index"] > .suboption-list', section), Config.Index); + // Unsupported options + if ($$1.engine !== 'gecko') { + $$1('div[data-name="Remember QR Size"]', section).hidden = true; + } + if ($$1.perProtocolSettings || (location.protocol !== 'https:')) { + $$1('div[data-name="Redirect to HTTPS"]', section).hidden = true; + } + if (platform !== 'crx') { + $$1('div[data-name="Work around CORB Bug"]', section).hidden = true; + } + $$1.get(items, function (items) { + for (key in items) { + var val = items[key]; + inputs[key].checked = val; + inputs[key].parentNode.parentNode.dataset.checked = val; + } + }); + const div = $$1.el('div', { innerHTML: ': Clear manually-hidden threads and posts on all boards. Reload the page to apply.' }); + const button = $$1('button', div); + $$1.get({ hiddenThreads: dict(), hiddenPosts: dict() }, function ({ hiddenThreads, hiddenPosts }) { + let board, ID, site, thread; + let hiddenNum = 0; + for (ID in hiddenThreads) { + site = hiddenThreads[ID]; + if (ID !== 'boards') { + for (ID in site.boards) { + board = site.boards[ID]; + hiddenNum += Object.keys(board).length; + } + } + } + for (ID in hiddenThreads.boards) { + board = hiddenThreads.boards[ID]; + hiddenNum += Object.keys(board).length; + } + for (ID in hiddenPosts) { + site = hiddenPosts[ID]; + if (ID !== 'boards') { + for (ID in site.boards) { + board = site.boards[ID]; + for (ID in board) { + thread = board[ID]; + hiddenNum += Object.keys(thread).length; + } + } + } + } + for (ID in hiddenPosts.boards) { + board = hiddenPosts.boards[ID]; + for (ID in board) { + thread = board[ID]; + hiddenNum += Object.keys(thread).length; + } + } + return button.textContent = `Hidden: ${hiddenNum}`; + }); + $$1.on(button, 'click', function () { + this.textContent = 'Hidden: 0'; + return $$1.get('hiddenThreads', dict(), function ({ hiddenThreads }) { + if ($$1.hasStorage && (g.SITE.software === 'yotsuba')) { + let boardID; + for (boardID in hiddenThreads['4chan.org']?.boards) { + localStorage.removeItem(`4chan-hide-t-${boardID}`); + } + for (boardID in hiddenThreads.boards) { + localStorage.removeItem(`4chan-hide-t-${boardID}`); + } + } + return ($$1.delete(['hiddenThreads', 'hiddenPosts'])); + }); + }); + return $$1.after($$1('input[name="Stubs"]', section).parentNode.parentNode, div); + }, + export() { + // Make sure to export the most recent data, but don't overwrite existing `Conf` object. + const Conf2 = dict(); + $$1.extend(Conf2, Conf); + return $$1.get(Conf2, function (Conf2) { + // Don't export cached JSON data. + delete Conf2['boardConfig']; + return (Settings.downloadExport({ version: g.VERSION, date: Date.now(), Conf: Conf2 })); + }); + }, + downloadExport(data) { + const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' }); + const url = URL.createObjectURL(blob); + const a = $$1.el('a', { + download: `${meta.name} v${g.VERSION}-${data.date}.json`, + href: url + }); + const p = $$1('.imp-exp-result', Settings.dialog); + $$1.rmAll(p); + $$1.add(p, a); + return a.click(); + }, + import() { + return $$1('input[type=file]', this.parentNode).click(); + }, + onImport() { + let file; + if (!(file = this.files[0])) { + return; + } + this.value = null; + const output = $$1('.imp-exp-result'); + if (!confirm('Your current settings will be entirely overwritten, are you sure?')) { + output.textContent = 'Import aborted.'; + return; + } + const reader = new FileReader(); + reader.onload = function (e) { + try { + return Settings.loadSettings(dict.json(e.target.result), function (err) { + if (err) { + return output.textContent = 'Import failed due to an error.'; + } + else if (confirm('Import successful. Reload now?')) { + return window.location.reload(); + } + }); + } + catch (error) { + const err = error; + output.textContent = 'Import failed due to an error.'; + return c.error(err.stack); + } + }; + return reader.readAsText(file); + }, + convertFrom: { + loadletter(data) { + const convertSettings = function (data, map) { + for (var prevKey in map) { + var newKey = map[prevKey]; + if (newKey) { + data.Conf[newKey] = data.Conf[prevKey]; + } + delete data.Conf[prevKey]; + } + return data; + }; + data = convertSettings(data, { + // General confs + 'Disable 4chan\'s extension': 'Disable Native Extension', + 'Comment Auto-Expansion': '', + 'Remove Slug': '', + 'Always HTTPS': 'Redirect to HTTPS', + 'Check for Updates': '', + 'Recursive Filtering': 'Recursive Hiding', + 'Reply Hiding': 'Reply Hiding Buttons', + 'Thread Hiding': 'Thread Hiding Buttons', + 'Show Stubs': 'Stubs', + 'Image Auto-Gif': 'Replace GIF', + 'Expand All WebM': 'Expand videos', + 'Reveal Spoilers': 'Reveal Spoiler Thumbnails', + 'Expand From Current': 'Expand from here', + 'Current Page': 'Page Count in Stats', + 'Current Page Position': '', + 'Alternative captcha': 'Use Recaptcha v1', + 'Alt index captcha': 'Use Recaptcha v1 on Index', + 'Auto Submit': 'Post on Captcha Completion', + 'Open Reply in New Tab': 'Open Post in New Tab', + 'Remember QR size': 'Remember QR Size', + 'Remember Subject': '', + 'Quote Inline': 'Quote Inlining', + 'Quote Preview': 'Quote Previewing', + 'Indicate OP quote': 'Mark OP Quotes', + 'Indicate You quote': 'Mark Quotes of You', + 'Indicate Cross-thread Quotes': 'Mark Cross-thread Quotes', + // filter + 'uniqueid': 'uniqueID', + 'mod': 'capcode', + 'email': '', + 'country': 'flag', + 'md5': 'MD5', + // keybinds + 'openEmptyQR': 'Open empty QR', + 'openQR': 'Open QR', + 'openOptions': 'Open settings', + 'close': 'Close', + 'spoiler': 'Spoiler tags', + 'sageru': 'Toggle sage', + 'code': 'Code tags', + 'sjis': 'SJIS tags', + 'submit': 'Submit QR', + 'watch': 'Watch', + 'update': 'Update', + 'unreadCountTo0': '', + 'expandAllImages': 'Expand images', + 'expandImage': 'Expand image', + 'zero': 'Front page', + 'nextPage': 'Next page', + 'previousPage': 'Previous page', + 'nextThread': 'Next thread', + 'previousThread': 'Previous thread', + 'expandThread': 'Expand thread', + 'openThreadTab': 'Open thread', + 'openThread': 'Open thread tab', + 'nextReply': 'Next reply', + 'previousReply': 'Previous reply', + 'hide': 'Hide', + // updater + 'Scrolling': 'Auto Scroll', + 'Verbose': '' + }); + if ('Always CDN' in data.Conf) { + data.Conf['fourchanImageHost'] = data.Conf['Always CDN'] ? 'i.4cdn.org' : ''; + delete data.Conf['Always CDN']; + } + data.Conf.sauces = data.Conf.sauces.replace(/\$\d/g, function (c) { + switch (c) { + case '$1': + return '%TURL'; + case '$2': + return '%URL'; + case '$3': + return '%MD5'; + case '$4': + return '%board'; + default: + return c; + } + }); + for (var key in Config.hotkeys) { + Config.hotkeys[key]; + if (key in data.Conf) { + data.Conf[key] = data.Conf[key].replace(/ctrl|alt|meta/g, s => `${s[0].toUpperCase()}${s.slice(1)}`).replace(/(^|.+\+)[A-Z]$/g, s => `Shift+${s.slice(0, -1)}${s.slice(-1).toLowerCase()}`); + } + } + if (data.WatchedThreads) { + data.Conf['watchedThreads'] = dict.clone({ '4chan.org': { boards: {} } }); + for (var boardID in data.WatchedThreads) { + var threads = data.WatchedThreads[boardID]; + for (var threadID in threads) { + var threadData = threads[threadID]; + (data.Conf['watchedThreads']['4chan.org'].boards[boardID] || (data.Conf['watchedThreads']['4chan.org'].boards[boardID] = dict()))[threadID] = { excerpt: threadData.textContent }; + } + } + } + return data; + } + }, + upgrade(data, version) { + let corrupted, key, val; + const changes = dict(); + const set = (key, value) => data[key] = (changes[key] = value); + const setD = function (key, value) { + if (data[key] == null) { + return set(key, value); + } + }; + const addSauces = function (sauces) { + if (data['sauces'] != null) { + sauces = sauces.filter(s => data['sauces'].indexOf(s.match(/[^#;\s]+|$/)[0]) < 0); + if (sauces.length) { + return set('sauces', data['sauces'] + '\n\n' + sauces.join('\n')); + } + } + }; + const addCSS = function (css) { + if (data['usercss'] == null) { + set('usercss', Config['usercss']); + } + if (data['usercss'].indexOf(css) < 0) { + return set('usercss', css + '\n\n' + data['usercss']); + } + }; + // XXX https://github.com/greasemonkey/greasemonkey/issues/2600 + if (corrupted = (version[0] === '"')) { + try { + version = JSON.parse(version); + } + catch (error) { } + } + const compareString = version.replace(/\d+/g, x => ('0000' + x).slice(-5)); + if (compareString < '00001.00013.00014.00008') { + for (key in data) { + val = data[key]; + if ((typeof val === 'string') && (typeof Conf[key] !== 'string') && !['Index Sort', 'Last Long Reply Thresholds 0', 'Last Long Reply Thresholds 1'].includes(key)) { + corrupted = true; + break; + } + } + } + if (corrupted) { + for (key in data) { + val = data[key]; + if (typeof val === 'string') { + try { + var val2 = JSON.parse(val); + set(key, val2); + } + catch (error1) { } + } + } + } + if (compareString < '00001.00011.00008.00000') { + if (data['Fixed Thread Watcher'] == null) { + set('Fixed Thread Watcher', data['Toggleable Thread Watcher'] ?? true); + } + if (data['Exempt Archives from Encryption'] == null) { + set('Exempt Archives from Encryption', data['Except Archives from Encryption'] ?? false); + } + } + if (compareString < '00001.00011.00010.00001') { + if (data['selectedArchives'] != null) { + const uids = { "Moe": 0, "4plebs Archive": 3, "Nyafuu Archive": 4, "Love is Over": 5, "Rebecca Black Tech": 8, "warosu": 10, "fgts": 15, "not4plebs": 22, "DesuStorage": 23, "fireden.net": 24, "disabled": null }; + for (var boardID in data['selectedArchives']) { + var record = data['selectedArchives'][boardID]; + for (var type in record) { + var name = record[type]; + if ($$1.hasOwn(uids, name)) { + record[type] = uids[name]; + } + } + } + set('selectedArchives', data['selectedArchives']); + } + } + if (compareString < '00001.00011.00016.00000') { + let rice; + if (rice = Config['usercss'].match(/\/\* Board title rice \*\/(?:\n.+)*/)[0]) { + if ((data['usercss'] != null) && (data['usercss'].indexOf(rice) < 0)) { + set('usercss', rice + '\n\n' + data['usercss']); + } + } + } + if (compareString < '00001.00011.00017.00000') { + for (key of ['Persistent QR', 'Color User IDs', 'Fappe Tyme', 'Werk Tyme', 'Highlight Posts Quoting You', 'Highlight Own Posts']) { + if (data[key] == null) { + set(key, (key === 'Persistent QR')); + } + } + } + if (compareString < '00001.00011.00017.00006') { + if (data['sauces'] != null) { + set('sauces', data['sauces'].replace(/^(#?\s*)http:\/\/iqdb\.org\//mg, '$1//iqdb.org/')); + } + } + if ((compareString < '00001.00011.00019.00003') && !Settings.dialog) { + $$1.queueTask(() => Settings.warnings.ads(item => new Notice('warning', [...Array.from(item.childNodes)]))); + } + if (compareString < '00001.00011.00020.00003') { + const object = { 'Inline Cross-thread Quotes Only': false, 'Pass Link': true }; + for (key in object) { + var value = object[key]; + if (data[key] == null) { + set(key, value); + } + } + } + if (compareString < '00001.00011.00021.00003') { + if (data['Remember Your Posts'] == null) { + set('Remember Your Posts', data['Mark Quotes of You'] ?? true); + } + } + if (compareString < '00001.00011.00022.00000') { + if (data['sauces'] != null) { + set('sauces', data['sauces'].replace(/^(#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(?:IMG|URL))%3Fs\.jpg/mg, '$1')); + set('sauces', data['sauces'].replace(/^#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(?:IMG|T?URL)(?=$|;)/mg, '$&&safe=off')); + } + } + if (compareString < '00001.00011.00022.00002') { + if ((data['Use Recaptcha v1 in Reports'] == null) && data['Use Recaptcha v1'] && !data['Use Recaptcha v2 in Reports']) { + set('Use Recaptcha v1 in Reports', true); + } + } + if (compareString < '00001.00011.00024.00000') { + if ((data['JSON Navigation'] != null) && (data['JSON Index'] == null)) { + set('JSON Index', data['JSON Navigation']); + } + } + if (compareString < '00001.00011.00026.00000') { + if ((data['Oekaki Links'] != null) && (data['Edit Link'] == null)) { + set('Edit Link', data['Oekaki Links']); + } + if (data['Inline Cross-thread Quotes Only'] == null) { + set('Inline Cross-thread Quotes Only', true); + } + } + if (compareString < '00001.00011.00030.00000') { + if (data['Quote Threading'] && (data['Thread Quotes'] == null)) { + set('Thread Quotes', true); + } + } + if (compareString < '00001.00011.00032.00000') { + if (data['sauces'] != null) { + set('sauces', data['sauces'].replace(/^(#?\s*)http:\/\/3d\.iqdb\.org\//mg, '$1//3d.iqdb.org/')); + } + addSauces([ + '#https://desustorage.org/_/search/image/%sMD5/', + '#https://boards.fireden.net/_/search/image/%sMD5/', + '#https://foolz.fireden.net/_/search/image/%sMD5/', + '#//www.gif-explode.com/%URL;types:gif' + ]); + } + if (compareString < '00001.00011.00035.00000') { + addSauces(['https://whatanime.ga/?auto&url=%IMG;text:wait']); + } + if (compareString < '00001.00012.00000.00000') { + if (data['Exempt Archives from Encryption'] == null) { + set('Exempt Archives from Encryption', false); + } + if (data['Show New Thread Option in Threads'] == null) { + set('Show New Thread Option in Threads', false); + } + if (data['Show Name and Subject']) { + addCSS('#qr .persona .field {display: block !important;}'); + } + if (data['QR Shortcut'] === false) { + addCSS('#shortcut-qr {display: none;}'); + } + if (data['Bottom QR Link'] === false) { + addCSS('.qr-link-container-bottom {display: none;}'); + } + } + if (compareString < '00001.00012.00000.00006') { + if (data['sauces'] != null) { + set('sauces', data['sauces'].replace(/^(#?\s*)https:\/\/(?:desustorage|cuckchan)\.org\//mg, '$1https://desuarchive.org/')); + } + } + if (compareString < '00001.00012.00001.00000') { + if ((data['Persistent Thread Watcher'] == null) && (data['Toggleable Thread Watcher'] != null)) { + set('Persistent Thread Watcher', !data['Toggleable Thread Watcher']); + } + } + if (compareString < '00001.00012.00003.00000') { + for (key of ['Image Hover in Catalog', 'Auto Watch', 'Auto Watch Reply']) { + setD(key, false); + } + } + if (compareString < '00001.00013.00001.00002') { + addSauces(['#//www.bing.com/images/search?q=imgurl:%IMG&view=detailv2&iss=sbi#enterInsights']); + } + if (compareString < '00001.00013.00005.00000') { + if (data['sauces'] != null) { + set('sauces', data['sauces'].replace(/^(#?\s*)http:\/\/regex\.info\/exif\.cgi/mg, '$1http://exif.regex.info/exif.cgi')); + } + addSauces(Config['sauces'].match(/# Known filename formats:(?:\n.+)*|$/)[0].split('\n')); + } + if (compareString < '00001.00013.00007.00002') { + setD('Require OP Quote Link', true); + } + if (compareString < '00001.00013.00008.00000') { + setD('Download Link', true); + } + if (compareString < '00001.00013.00009.00003') { + if (data['jsWhitelist'] != null) { + const list = data['jsWhitelist'].split('\n'); + if (!list.includes('https://cdnjs.cloudflare.com') && list.includes('https://cdn.mathjax.org')) { + set('jsWhitelist', data['jsWhitelist'] + '\n\nhttps://cdnjs.cloudflare.com'); + } + } + } + if (compareString < '00001.00014.00000.00006') { + if (data['siteSoftware'] != null) { + set('siteSoftware', data['siteSoftware'] + '\n4cdn.org yotsuba'); + } + } + if (compareString < '00001.00014.00003.00002') { + if (data['sauces'] != null) { + set('sauces', data['sauces'].replace(/^(#?\s*)https:\/\/whatanime\.ga\//mg, '$1https://trace.moe/')); + } + } + if (compareString < '00001.00014.00004.00004') { + if ((data['siteSoftware'] != null) && !/^4channel\.org yotsuba$/m.test(data['siteSoftware'])) { + set('siteSoftware', data['siteSoftware'] + '\n4channel.org yotsuba'); + } + } + if (compareString < '00001.00014.00005.00000') { + for (var db of DataBoard.keys) { + if (data[db]?.boards) { + var { boards, lastChecked } = data[db]; + data[db]['4chan.org'] = { boards, lastChecked }; + delete data[db].boards; + delete data[db].lastChecked; + set(db, data[db]); + } + } + if ((data['siteSoftware'] != null) && (data['siteProperties'] == null)) { + const siteProperties = dict(); + for (var line of data['siteSoftware'].split('\n')) { + var [hostname, software] = Array.from(line.split(' ')); + siteProperties[hostname] = { software }; + } + set('siteProperties', siteProperties); + } + } + if (compareString < '00001.00014.00006.00006') { + if (data['sauces'] != null) { + set('sauces', data['sauces'].replace(/\/\/%\$1\.deviantart\.com\/gallery\/#\/d%\$2;regexp:\/\^\\w\+_by_\(\\w\+\)-d\(\[\\da-z\]\+\)\//g, '//www.deviantart.com/gallery/#/d%$1%$2;regexp:/^\\w+_by_\\w+[_-]d([\\da-z]{6})\\b|^d([\\da-z]{6})-[\\da-z]{8}-/')); + } + } + if (compareString < '00001.00014.00008.00000') { + if (data['sauces'] != null) { + set('sauces', data['sauces'].replace(/https:\/\/www\.yandex\.com\/images\/search/g, 'https://yandex.com/images/search')); + } + } + if (compareString < '00001.00014.00009.00000') { + if (data['sauces'] != null) { + set('sauces', data['sauces'].replace(/^(#?\s*)(?:http:)?\/\/(www\.pixiv\.net|www\.deviantart\.com|imgur\.com|flickr\.com)\//mg, '$1https://$2/')); + set('sauces', data['sauces'].replace(/https:\/\/yandex\.com\/images\/search\?rpt=imageview&img_url=%IMG/g, 'https://yandex.com/images/search?rpt=imageview&url=%IMG')); + } + } + if (compareString < '00001.00014.00009.00001') { + if ((data['Use Faster Image Host'] != null) && (data['fourchanImageHost'] == null)) { + set('fourchanImageHost', (data['Use Faster Image Host'] ? 'i.4cdn.org' : '')); + } + } + if (compareString < '00001.00014.00010.00001') { + if (data['Filter in Native Catalog'] == null) { + set('Filter in Native Catalog', false); + } + } + if (compareString < '00001.00014.00012.00008') { + if (data['boardnav'] == null) { + set('boardnav', `\ +[ toggle-all ] +a-replace +c-replace +g-replace +k-replace +v-replace +vg-replace +vr-replace +ck-replace +co-replace +fit-replace +jp-replace +mu-replace +sp-replace +tv-replace +vp-replace +[external-text:"FAQ","${meta.faq}"]\ +`); + } + } + if (compareString < '00001.00014.00016.00001') { + if (data['archiveLists'] != null) { + set('archiveLists', data['archiveLists'].replace('https://mayhemydg.github.io/archives.json/archives.json', 'https://nstepien.github.io/archives.json/archives.json')); + } + } + if (compareString < '00001.00014.00016.00007') { + if (data['sauces'] != null) { + set('sauces', data['sauces'].replace(/https:\/\/www\.deviantart\.com\/gallery\/#\/d%\$1%\$2;regexp:\/\^\\w\+_by_\\w\+\[_-\]d\(\[\\da-z\]\{6\}\)\\b\|\^d\(\[\\da-z\]\{6\}\)-\[\\da-z\]\{8\}-\//g, 'javascript:void(open("https://www.deviantart.com/"+%$1.replace(/_/g,"-")+"/art/"+parseInt(%$2,36)));regexp:/^\\w+_by_(\\w+)[_-]d([\\da-z]{6})\\b/').replace(/\/\/imgops\.com\/%URL/g, '//imgops.com/start?url=%URL')); + } + } + if (compareString < '00001.00014.00017.00002') { + if (data['jsWhitelist'] != null) { + set('jsWhitelist', data['jsWhitelist'] + '\n\nhttps://hcaptcha.com\nhttps://*.hcaptcha.com'); + } + } + if (compareString < '00001.00014.00020.00004') { + if (data['archiveLists'] != null) { + set('archiveLists', data['archiveLists'].replace('https://nstepien.github.io/archives.json/archives.json', 'https://4chenz.github.io/archives.json/archives.json')); + } + } + if (compareString < '00001.00014.00022.00003') { + if (data['sauces']) { + set('sauces', data['sauces'].replace(/^#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(IMG|T?URL)&safe=off(?=$|;)/mg, 'https://www.google.com/searchbyimage?sbisrc=4chanx&image_url=%$1&safe=off')); + if (compareString === '00001.00014.00022.00002' && !/\bsbisrc=/.test(data['sauces'])) { + set('sauces', data['sauces'].replace(/^#?\s*https:\/\/lens\.google\.com\/uploadbyurl\?url=%(IMG|T?URL)(?=$|;)/m, 'https://www.google.com/searchbyimage?sbisrc=4chanx&image_url=%$1&safe=off')); + } + } + } + return changes; + }, + loadSettings(data, cb) { + if (data.version.split('.')[0] === '2') { // https://github.com/loadletter/4chan-x + data = Settings.convertFrom.loadletter(data); + } + else if (data.version !== g.VERSION) { + Settings.upgrade(data.Conf, data.version); + } + return $$1.clear(function (err) { + if (err) { + return cb(err); + } + return $$1.set(data.Conf, cb); + }); + }, + reset() { + if (confirm('Your current settings will be entirely wiped, are you sure?')) { + return $$1.clear(function (err) { + if (err) { + return $$1('.imp-exp-result').textContent = 'Import failed due to an error.'; + } + else if (confirm('Reset successful. Reload now?')) { + return window.location.reload(); + } + }); + } + }, + filter(section) { + $$1.extend(section, { innerHTML: FilterSelectPage }); + const select = $$1('select', section); + $$1.on(select, 'change', Settings.selectFilter); + return Settings.selectFilter.call(select); + }, + selectFilter() { + let name; + const div = this.nextElementSibling; + if ((name = this.value) !== 'guide') { + if (!$$1.hasOwn(Config.filter, name)) { + return; + } + $$1.rmAll(div); + const ta = $$1.el('textarea', { + name, + className: 'field', + spellcheck: false + }); + $$1.on(ta, 'change', $$1.cb.value); + $$1.get(name, Conf[name], function (item) { + ta.value = item[name]; + return $$1.add(div, ta); + }); + return; + } + Object.keys(Config.filter).filter(x => x !== 'general').map((x, i) => ({ + innerHTML: (i ? "," : "") + `${E(x)}` + })); + $$1.extend(div, { innerHTML: FilterGuidePage }); + return $$1('.warning', div).hidden = Conf['Filter']; + }, + sauce(section) { + $$1.extend(section, { innerHTML: SaucePage }); + $$1('.warning', section).hidden = Conf['Sauce']; + const ta = $$1('textarea', section); + $$1.get('sauces', Conf['sauces'], function (item) { + ta.value = item['sauces']; + return (ta.hidden = false); + }); // XXX prevent Firefox from adding initialization to undo queue + return $$1.on(ta, 'change', $$1.cb.value); + }, + advanced(section) { + let input, name; + $$1.extend(section, { innerHTML: AdvancedPage }); + for (var warning of $$('.warning', section)) { + warning.hidden = Conf[warning.dataset.feature]; + } + const inputs = dict(); + for (input of $$('[name]', section)) { + inputs[input.name] = input; + } + $$1.on(inputs['archiveLists'], 'change', function () { + $$1.set('lastarchivecheck', 0); + Conf['lastarchivecheck'] = 0; + return $$1.id('lastarchivecheck').textContent = 'never'; + }); + const items = dict(); + for (name in inputs) { + input = inputs[name]; + if (!['Interval', 'Custom CSS'].includes(name)) { + items[name] = Conf[name]; + var event = ((input.nodeName === 'SELECT') || + ['checkbox', 'radio'].includes(input.type) || + ((input.nodeName === 'TEXTAREA') && !(name in Settings))) ? 'change' : 'input'; + $$1.on(input, event, $$1.cb[input.type === 'checkbox' ? 'checked' : 'value']); + if (name in Settings) { + $$1.on(input, event, Settings[name]); + } + } + } + $$1.get(items, function (items) { + for (var key in items) { + var val = items[key]; + input = inputs[key]; + input[input.type === 'checkbox' ? 'checked' : 'value'] = val; + input.hidden = false; // XXX prevent Firefox from adding initialization to undo queue + if (key in Settings) { + Settings[key].call(input); + } + } + }); + const listImageHost = $$1.id('list-fourchanImageHost'); + for (var textContent of ImageHost.suggestions) { + $$1.add(listImageHost, $$1.el('option', { textContent })); + } + const interval = inputs['Interval']; + const customCSS = inputs['Custom CSS']; + const applyCSS = $$1('#apply-css', section); + interval.value = Conf['Interval']; + customCSS.checked = Conf['Custom CSS']; + inputs['usercss'].disabled = !Conf['Custom CSS']; + applyCSS.disabled = !Conf['Custom CSS']; + $$1.on(interval, 'change', ThreadUpdater.cb.interval); + $$1.on(customCSS, 'change', Settings.togglecss); + $$1.on(applyCSS, 'click', () => CustomCSS.update()); + const itemsArchive = dict(); + for (name of ['archives', 'selectedArchives', 'lastarchivecheck']) { + itemsArchive[name] = Conf[name]; + } + $$1.get(itemsArchive, function (itemsArchive) { + $$1.extend(Conf, itemsArchive); + Redirect$1.selectArchives(); + return Settings.addArchiveTable(section); + }); + const boardSelect = $$1('#archive-board-select', section); + const table = $$1('#archive-table', section); + const updateArchives = $$1('#update-archives', section); + $$1.on(boardSelect, 'change', function () { + $$1('tbody > :not([hidden])', table).hidden = true; + return $$1(`tbody > .${this.value}`, table).hidden = false; + }); + return $$1.on(updateArchives, 'click', () => Redirect$1.update(() => Settings.addArchiveTable(section))); + }, + addArchiveTable(section) { + let boardID, o; + $$1('#lastarchivecheck', section).textContent = Conf['lastarchivecheck'] === 0 ? + 'never' + : + new Date(Conf['lastarchivecheck']).toLocaleString(); + const boardSelect = $$1('#archive-board-select', section); + const table = $$1('#archive-table', section); + const tbody = $$1('tbody', section); + $$1.rmAll(boardSelect); + $$1.rmAll(tbody); + const archBoards = dict(); + for (var { uid, name, boards, files, software } of Conf['archives']) { + if (!['fuuka', 'foolfuuka'].includes(software)) { + continue; + } + for (boardID of boards) { + o = archBoards[boardID] || (archBoards[boardID] = { + thread: [], + post: [], + file: [] + }); + var archive = [uid ?? name, name]; + o.thread.push(archive); + if (software === 'foolfuuka') { + o.post.push(archive); + } + if (files.includes(boardID)) { + o.file.push(archive); + } + } + } + const rows = []; + const boardOptions = []; + for (boardID of Object.keys(archBoards).sort()) { // Alphabetical order + var row = $$1.el('tr', { className: `board-${boardID}` }); + row.hidden = boardID !== g.BOARD.ID; + boardOptions.push($$1.el('option', { + textContent: `/${boardID}/`, + value: `board-${boardID}`, + selected: boardID === g.BOARD.ID + })); + o = archBoards[boardID]; + for (var item of ['thread', 'post', 'file']) { + $$1.add(row, Settings.addArchiveCell(boardID, o, item)); + } + rows.push(row); + } + if (rows.length === 0) { + boardSelect.hidden = (table.hidden = true); + return; + } + boardSelect.hidden = (table.hidden = false); + if (!(g.BOARD.ID in archBoards)) { + rows[0].hidden = false; + } + $$1.add(boardSelect, boardOptions); + $$1.add(tbody, rows); + for (boardID in Conf['selectedArchives']) { + var data = Conf['selectedArchives'][boardID]; + for (var type in data) { + var select; + var id = data[type]; + if (select = $$1(`select[data-boardid='${boardID}'][data-type='${type}']`, tbody)) { + select.value = JSON.stringify(id); + if (!select.value) { + select.value = select.firstChild.value; + } + } + } + } + }, + addArchiveCell(boardID, data, type) { + const { length } = data[type]; + const td = $$1.el('td', { className: 'archive-cell' }); + if (!length) { + td.textContent = '--'; + return td; + } + const options = []; + let i = 0; + while (i < length) { + var archive = data[type][i++]; + options.push($$1.el('option', { + value: JSON.stringify(archive[0]), + textContent: archive[1] + })); + } + $$1.extend(td, { innerHTML: '' }); + const select = td.firstElementChild; + if (!(select.disabled = length === 1)) { + // XXX GM can't into datasets + select.setAttribute('data-boardid', boardID); + select.setAttribute('data-type', type); + $$1.on(select, 'change', Settings.saveSelectedArchive); + } + $$1.add(select, options); + return td; + }, + saveSelectedArchive() { + return $$1.get('selectedArchives', Conf['selectedArchives'], ({ selectedArchives }) => { + (selectedArchives[this.dataset.boardid] || (selectedArchives[this.dataset.boardid] = dict()))[this.dataset.type] = JSON.parse(this.value); + $$1.set('selectedArchives', selectedArchives); + Conf['selectedArchives'] = selectedArchives; + return Redirect$1.selectArchives(); + }); + }, + boardnav() { + return Header$1.generateBoardList(this.value); + }, + time() { + return this.nextElementSibling.textContent = Time.format(this.value, new Date()); + }, + timeLocale() { + return Settings.time.call($$1('[name=time]', Settings.dialog)); + }, + backlink() { + return this.nextElementSibling.textContent = this.value.replace(/%(?:id|%)/g, x => ({ '%id': '123456789', '%%': '%' })[x]); + }, + fileInfo() { + const data = { + isReply: true, + file: { + url: `//${ImageHost.host()}/g/1334437723720.jpg`, + name: 'd9bb2efc98dd0df141a94399ff5880b7.jpg', + size: '276 KB', + sizeInBytes: 276 * 1024, + dimensions: '1280x720', + isImage: true, + isVideo: false, + isSpoiler: true, + tag: 'Loop' + } + }; + return FileInfo.format(this.value, data, this.nextElementSibling); + }, + favicon() { + Favicon.switch(); + if ((g.VIEW === 'thread') && Conf['Unread Favicon']) { + Unread.update(); + } + const img = this.nextElementSibling.children; + const f = Favicon; + const iterable = [f.SFW, f.unreadSFW, f.unreadSFWY, f.NSFW, f.unreadNSFW, f.unreadNSFWY, f.dead, f.unreadDead, f.unreadDeadY]; + for (let i = 0; i < iterable.length; i++) { + var icon = iterable[i]; + if (!img[i]) { + $$1.add(this.nextElementSibling, $$1.el('img')); + } + img[i].src = icon; + } + }, + togglecss() { + if (($$1('textarea[name=usercss]', $$1.x('ancestor::fieldset[1]', this)).disabled = ($$1.id('apply-css').disabled = !this.checked))) { + CustomCSS.rmStyle(); + } + else { + CustomCSS.addStyle(); + } + return $$1.cb.checked.call(this); + }, + keybinds(section) { + let key; + $$1.extend(section, { innerHTML: KeybindsPage }); + $$1('.warning', section).hidden = Conf['Keybinds']; + const tbody = $$1('tbody', section); + const items = dict(); + const inputs = dict(); + for (key in Config.hotkeys) { + var arr = Config.hotkeys[key]; + var tr = $$1.el('tr', { innerHTML: `${arr[1]}` }); + var input = $$1('input', tr); + input.name = key; + input.spellcheck = false; + items[key] = Conf[key]; + inputs[key] = input; + $$1.on(input, 'keydown', Settings.keybind); + $$1.add(tbody, tr); + } + return $$1.get(items, function (items) { + for (key in items) { + var val = items[key]; + inputs[key].value = val; + } + }); + }, + keybind(e) { + let key; + if (e.keyCode === 9) { + return; + } // tab + e.preventDefault(); + e.stopPropagation(); + if ((key = Keybinds.keyCode(e)) == null) { + return; + } + this.value = key; + return $$1.cb.value.call(this); + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var FappeTyme = { + init() { + if ((!Conf['Fappe Tyme'] && !Conf['Werk Tyme']) || !['index', 'thread', 'archive'].includes(g.VIEW)) { return; } + + this.nodes = {}; + this.enabled = { + fappe: false, + werk: Conf['werk'] + }; + + for (var type of ["Fappe", "Werk"]) { + if (Conf[`${type} Tyme`]) { + var lc = type.toLowerCase(); + var el = UI.checkbox(lc, `${type} Tyme`, false); + el.title = `${type} Tyme`; + + this.nodes[lc] = el.firstElementChild; + if (Conf[lc]) { this.set(lc, true); } + $$1.on(this.nodes[lc], 'change', this.toggle.bind(this, lc)); + + Header$1.menu.addEntry({ + el, + order: 97 + }); + + var indicator = $$1.el('span', { + className: 'indicator', + textContent: type[0], + title: `${type} Tyme active` + } + ); + $$1.on(indicator, 'click', function() { + const check = $$1.getOwn(FappeTyme.nodes, this.parentNode.id.replace('shortcut-', '')); + check.checked = !check.checked; + return $$1.event('change', null, check); + }); + Header$1.addShortcut(lc, indicator, 410); + } + } + + if (Conf['Werk Tyme']) { + $$1.sync('werk', this.set.bind(this, 'werk')); + } + + Callbacks.Post.push({ + name: 'Fappe Tyme', + cb: this.node + }); + + return Callbacks.CatalogThread.push({ + name: 'Werk Tyme', + cb: this.catalogNode + }); + }, + + node() { + return this.nodes.root.classList.toggle('noFile', !this.files.length); + }, + + catalogNode() { + const file = this.thread.OP.files[0]; + if (!file) { return; } + const filename = $$1.el('div', { + textContent: file.name, + className: 'werkTyme-filename' + } + ); + return $$1.add(this.nodes.thumb.parentNode, filename); + }, + + set(type, enabled) { + this.enabled[type] = (this.nodes[type].checked = enabled); + return $$1[`${enabled ? 'add' : 'rm'}Class`](doc$1, `${type}Tyme`); + }, + + toggle(type) { + this.set(type, !this.enabled[type]); + if (type === 'werk') { return $$1.cb.checked.call(this.nodes[type]); } + } + }; + + var galleryPage = `
          + + + + + × + +
          + + / + + + +
          +
          +
          + +
          +
          +
          +
          +`; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS104: Avoid inline assignments + * DS204: Change includes calls to have a more natural evaluation order + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var Sauce = { + init() { + let link; + if (!['index', 'thread'].includes(g.VIEW) || !Conf['Sauce']) { return; } + $$1.addClass(doc$1, 'show-sauce'); + + const links = []; + for (link of Conf['sauces'].split('\n')) { + var linkData; + if ((link[0] !== '#') && (linkData = this.parseLink(link))) { + links.push(linkData); + } + } + if (!links.length) { return; } + + this.links = links; + this.link = $$1.el('a', { + target: '_blank', + className: 'sauce' + } + ); + return Callbacks.Post.push({ + name: 'Sauce', + cb: this.node + }); + }, + + parseLink(link) { + if (!(link = link.trim())) { return null; } + const parts = dict(); + const iterable = link.split(/;(?=(?:text|boards|types|regexp|sandbox):?)/); + for (let i = 0; i < iterable.length; i++) { + var part = iterable[i]; + if (i === 0) { + parts['url'] = part; + } else { + var m = part.match(/^(\w*):?(.*)$/); + parts[m[1]] = m[2]; + } + } + if (!parts['text']) { parts['text'] = parts['url'].match(/(\w+)\.\w+\//)?.[1] || '?'; } + if ('boards' in parts) { + parts['boards'] = Filter.parseBoards(parts['boards']); + } + if ('regexp' in parts) { + try { + let regexp; + if (regexp = parts['regexp'].match(/^\/(.*)\/(\w*)$/)) { + parts['regexp'] = RegExp(regexp[1], regexp[2]); + } else { + parts['regexp'] = RegExp(parts['regexp']); + } + } catch (err) { + new Notice('warning', [ + $$1.tn("Invalid regexp for Sauce link:"), + $$1.el('br'), + $$1.tn(link), + $$1.el('br'), + $$1.tn(err.message) + ], 60); + return null; + } + } + return parts; + }, + + createSauceLink(link, post, file) { + let a, matches, needle; + const ext = file.url.match(/[^.]*$/)[0]; + const parts = dict(); + $$1.extend(parts, link); + + if (!!parts['boards'] && !parts['boards'][`${post.siteID}/${post.boardID}`] && !parts['boards'][`${post.siteID}/*`]) { return null; } + if (!!parts['types'] && (needle = ext, !parts['types'].split(',').includes(needle))) { return null; } + if (!!parts['regexp'] && (!(matches = file.name.match(parts['regexp'])))) { return null; } + + const missing = []; + for (var key of ['url', 'text']) { + parts[key] = parts[key].replace(/%(T?URL|IMG|[sh]?MD5|board|name|%|semi|\$\d+)/g, function(orig, parameter) { + let type; + if (parameter[0] === '$') { + if (!matches) { return orig; } + type = matches[parameter.slice(1)] || ''; + } else { + type = Sauce.formatters[parameter](post, file, ext); + if ((type == null)) { + missing.push(parameter); + return ''; + } + } + + if ((key === 'url') && !['%', 'semi'].includes(parameter)) { + if (/^javascript:/i.test(parts['url'])) { type = JSON.stringify(type); } + type = encodeURIComponent(type); + } + return type; + }); + } + + if (g.SITE.areMD5sDeferred?.(post.board) && missing.length && !missing.filter(x => !/^.?MD5$/.test(x)).length) { + a = Sauce.link.cloneNode(false); + a.dataset.skip = '1'; + return a; + } + + if (missing.length) { return null; } + + a = Sauce.link.cloneNode(false); + a.href = parts['url']; + a.textContent = parts['text']; + if (/^javascript:/i.test(parts['url'])) { a.removeAttribute('target'); } + return a; + }, + + node() { + if (this.isClone) { return; } + for (var file of this.files) { + Sauce.file(this, file); + } + }, + + file(post, file) { + let link, node; + const nodes = []; + const skipped = []; + for (link of Sauce.links) { + if (node = Sauce.createSauceLink(link, post, file)) { + nodes.push($$1.tn(' '), node); + if (node.dataset.skip) { skipped.push([link, node]); } + } + } + $$1.add(file.text, nodes); + + if (skipped.length) { + var observer = new MutationObserver(function() { + if (file.text.dataset.md5) { + for ([link, node] of skipped) { + var node2; + if (node2 = Sauce.createSauceLink(link, post, file)) { + $$1.replace(node, node2); + } + } + return observer.disconnect(); + } + }); + return observer.observe(file.text, {attributes: true}); + } + }, + + formatters: { + TURL(post, file) { return file.thumbURL; }, + URL(post, file) { return file.url; }, + IMG(post, file, ext) { if (['gif', 'jpg', 'jpeg', 'png'].includes(ext)) { return file.url; } else { return file.thumbURL; } }, + MD5(post, file) { return file.MD5; }, + sMD5(post, file) { return file.MD5?.replace(/[+/=]/g, c => ({'+': '-', '/': '_', '=': ''})[c]); }, + hMD5(post, file) { if (file.MD5) { return (atob(file.MD5).map((c) => `0${c.charCodeAt(0).toString(16)}`.slice(-2))).join(''); } }, + board(post) { return post.board.ID; }, + name(post, file) { return file.name; }, + '%'() { return '%'; }, + semi() { return ';'; } + } + }; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * DS205: Consider reworking code to avoid use of IIFEs + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + + var Gallery = { + init() { + if (!(this.enabled = Conf['Gallery'] && ['index', 'thread'].includes(g.VIEW))) { return; } + + this.delay = Conf['Slide Delay']; + + const el = $$1.el('a', { + href: 'javascript:;', + title: 'Gallery', + textContent: '🖼︎', + }); + + $$1.on(el, 'click', this.cb.toggle); + + Header$1.addShortcut('gallery', el, 530); + + return Callbacks.Post.push({ + name: 'Gallery', + cb: this.node + }); + }, + + node() { + return (() => { + const result = []; + for (var file of this.files) { + if (file.thumb) { + if (Gallery.nodes) { + Gallery.generateThumb(this, file); + Gallery.nodes.total.textContent = Gallery.images.length; + } + + if (!Conf['Image Expansion'] && ((g.SITE.software !== 'tinyboard') || !Main$1.jsEnabled)) { + result.push($$1.on(file.thumbLink, 'click', Gallery.cb.image)); + } else { + result.push(undefined); + } + } + } + return result; + })(); + }, + + build(image) { + let dialog, thumb; + const {cb} = Gallery; + + if (Conf['Fullscreen Gallery']) { + $$1.one(d$1, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', () => $$1.on(d$1, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', cb.close)); + doc$1.mozRequestFullScreen?.(); + doc$1.webkitRequestFullScreen?.(Element.ALLOW_KEYBOARD_INPUT); + } + + Gallery.images = []; + const nodes = (Gallery.nodes = {}); + Gallery.fileIDs = dict(); + Gallery.slideshow = false; + + nodes.el = (dialog = $$1.el('div', + {id: 'a-gallery'})); + $$1.extend(dialog, {innerHTML: galleryPage }); + + const object = { + buttons: '.gal-buttons', + frame: '.gal-image', + name: '.gal-name', + count: '.count', + total: '.total', + sauce: '.gal-sauce', + thumbs: '.gal-thumbnails', + next: '.gal-image a', + current: '.gal-image img' + }; + for (var key in object) { var value = object[key]; nodes[key] = $$1(value, dialog); } + + const menuButton = $$1('.menu-button', dialog); + nodes.menu = new UI.Menu('gallery'); + + $$1.on(nodes.frame, 'click', cb.blank); + if (Conf['Mouse Wheel Volume']) { $$1.on(nodes.frame, 'wheel', Volume.wheel); } + $$1.on(nodes.next, 'click', cb.click); + $$1.on(nodes.name, 'click', ImageCommon.download); + + $$1.on($$1('.gal-prev', dialog), 'click', cb.prev); + $$1.on($$1('.gal-next', dialog), 'click', cb.next); + $$1.on($$1('.gal-start', dialog), 'click', cb.start); + $$1.on($$1('.gal-stop', dialog), 'click', cb.stop); + $$1.on($$1('.gal-close', dialog), 'click', cb.close); + + $$1.on(menuButton, 'click', function(e) { + return nodes.menu.toggle(e, this, g); + }); + + for (var entry of Gallery.menu.createSubEntries()) { + entry.order = 0; + nodes.menu.addEntry(entry); + } + + $$1.on(d$1, 'keydown', cb.keybinds); + if (Conf['Keybinds']) { $$1.off(d$1, 'keydown', Keybinds.keydown); } + + $$1.on(window, 'resize', Gallery.cb.setHeight); + + for (var postThumb of $$(g.SITE.selectors.file.thumb)) { + var post; + if (!(post = Get$1.postFromNode(postThumb))) { continue; } + for (var file of post.files) { + if (file.thumb) { + Gallery.generateThumb(post, file); + // If no image to open is given, pick image we have scrolled to. + if (!image && Gallery.fileIDs[`${post.fullID}.${file.index}`]) { + var candidate = file.thumbLink; + if ((Header$1.getTopOf(candidate) + candidate.getBoundingClientRect().height) >= 0) { + image = candidate; + } + } + } + } + } + $$1.addClass(doc$1, 'gallery-open'); + + $$1.add(d$1.body, dialog); + + nodes.thumbs.scrollTop = 0; + nodes.current.parentElement.scrollTop = 0; + + if (image) { thumb = $$1(`[href='${image.href}']`, nodes.thumbs); } + if (!thumb) { thumb = Gallery.images[Gallery.images.length-1]; } + if (thumb) { Gallery.open(thumb); } + + doc$1.style.overflow = 'hidden'; + return nodes.total.textContent = Gallery.images.length; + }, + + generateThumb(post, file) { + if (post.isClone || post.isHidden) { return; } + if (!file || !file.thumb || (!file.isImage && !file.isVideo && !Conf['PDF in Gallery'])) { return; } + if (Gallery.fileIDs[`${post.fullID}.${file.index}`]) { return; } + + Gallery.fileIDs[`${post.fullID}.${file.index}`] = true; + + const thumb = $$1.el('a', { + className: 'gal-thumb', + href: file.url, + target: '_blank', + title: file.name + } + ); + + thumb.dataset.id = Gallery.images.length; + thumb.dataset.post = post.fullID; + thumb.dataset.file = file.index; + + const thumbImg = file.thumb.cloneNode(false); + thumbImg.style.cssText = ''; + $$1.add(thumb, thumbImg); + + $$1.on(thumb, 'click', Gallery.cb.open); + + Gallery.images.push(thumb); + return $$1.add(Gallery.nodes.thumbs, thumb); + }, + + load(thumb, errorCB) { + const ext = thumb.href.match(/\w*$/); + const elType = $$1.getOwn({'webm': 'video', 'mp4': 'video', 'ogv': 'video', 'pdf': 'iframe'}, ext) || 'img'; + const file = $$1.el(elType); + $$1.extend(file.dataset, thumb.dataset); + $$1.on(file, 'error', errorCB); + file.src = thumb.href; + return file; + }, + + open(thumb) { + let el, file, post; + const {nodes} = Gallery; + const oldID = +nodes.current.dataset.id; + const newID = +thumb.dataset.id; + + // Highlight, center selected thumbnail + if (el = Gallery.images[oldID]) { $$1.rmClass(el, 'gal-highlight'); } + $$1.addClass(thumb, 'gal-highlight'); + nodes.thumbs.scrollTop = (thumb.offsetTop + (thumb.offsetHeight/2)) - (nodes.thumbs.clientHeight/2); + + // Load image or use preloaded image + if (Gallery.cache?.dataset.id === (''+newID)) { + file = Gallery.cache; + $$1.off(file, 'error', Gallery.cacheError); + $$1.on(file, 'error', Gallery.error); + } else { + file = Gallery.load(thumb, Gallery.error); + } + + // Replace old image with new one + $$1.off(nodes.current, 'error', Gallery.error); + ImageCommon.pause(nodes.current); + $$1.replace(nodes.current, file); + nodes.current = file; + + if (file.nodeName === 'VIDEO') { + file.loop = true; + Volume.setup(file); + if (Conf['Autoplay']) { file.play(); } + if (Conf['Show Controls']) { ImageCommon.addControls(file); } + } + + doc$1.classList.toggle('gal-pdf', file.nodeName === 'IFRAME'); + Gallery.cb.setHeight(); + nodes.count.textContent = +thumb.dataset.id + 1; + nodes.name.download = (nodes.name.textContent = thumb.title); + nodes.name.href = thumb.href; + nodes.frame.scrollTop = 0; + nodes.next.focus(); + + // Set sauce links + $$1.rmAll(nodes.sauce); + if (Conf['Sauce'] && Sauce.links && (post = g.posts.get(file.dataset.post))) { + const sauces = []; + for (var link of Sauce.links) { + var node; + if (node = Sauce.createSauceLink(link, post, post.files[+file.dataset.file])) { + sauces.push($$1.tn(' '), node); + } + } + $$1.add(nodes.sauce, sauces); + } + + // Continue slideshow if moving forward, stop otherwise + if (Gallery.slideshow && ((newID > oldID) || ((oldID === (Gallery.images.length-1)) && (newID === 0)))) { + Gallery.setupTimer(); + } else { + Gallery.cb.stop(); + } + + // Scroll to post + if (Conf['Scroll to Post'] && (post = g.posts.get(file.dataset.post))) { + Header$1.scrollTo(post.nodes.root); + } + + // Preload next image + if (isNaN(oldID) || (newID === ((oldID + 1) % Gallery.images.length))) { + return Gallery.cache = Gallery.load(Gallery.images[(newID + 1) % Gallery.images.length], Gallery.cacheError); + } + }, + + error() { + if (this.error?.code === MediaError.MEDIA_ERR_DECODE) { + return new Notice('error', 'Corrupt or unplayable video', 30); + } + if (ImageCommon.isFromArchive(this)) { return; } + const post = g.posts.get(this.dataset.post); + const file = post.files[+this.dataset.file]; + return ImageCommon.error(this, post, file, null, url => { + if (!url) { return; } + Gallery.images[+this.dataset.id].href = url; + if (Gallery.nodes.current === this) { return this.src = url; } + }); + }, + + cacheError() { + return delete Gallery.cache; + }, + + cleanupTimer() { + clearTimeout(Gallery.timeoutID); + const {current} = Gallery.nodes; + $$1.off(current, 'canplaythrough load', Gallery.startTimer); + return $$1.off(current, 'ended', Gallery.cb.next); + }, + + startTimer() { + return Gallery.timeoutID = setTimeout(Gallery.checkTimer, Gallery.delay * SECOND); + }, + + setupTimer() { + Gallery.cleanupTimer(); + const {current} = Gallery.nodes; + const isVideo = current.nodeName === 'VIDEO'; + if (isVideo) { current.play(); } + if ((isVideo ? current.readyState >= 4 : current.complete) || (current.nodeName === 'IFRAME')) { + return Gallery.startTimer(); + } else { + return $$1.on(current, (isVideo ? 'canplaythrough' : 'load'), Gallery.startTimer); + } + }, + + checkTimer() { + const {current} = Gallery.nodes; + if ((current.nodeName === 'VIDEO') && !current.paused) { + $$1.on(current, 'ended', Gallery.cb.next); + return current.loop = false; + } else { + return Gallery.cb.next(); + } + }, + + cb: { + keybinds(e) { + let key; + if (!(key = Keybinds.keyCode(e))) { return; } + + const cb = (() => { switch (key) { + case Conf['Close']: case Conf['Open Gallery']: + return Gallery.cb.close; + case Conf['Next Gallery Image']: + return Gallery.cb.next; + case Conf['Advance Gallery']: + return Gallery.cb.advance; + case Conf['Previous Gallery Image']: + return Gallery.cb.prev; + case Conf['Pause']: + return Gallery.cb.pause; + case Conf['Slideshow']: + return Gallery.cb.toggleSlideshow; + case Conf['Rotate image anticlockwise']: + return Gallery.cb.rotateLeft; + case Conf['Rotate image clockwise']: + return Gallery.cb.rotateRight; + case Conf['Download Gallery Image']: + return Gallery.cb.download; + } })(); + + if (!cb) { return; } + e.stopPropagation(); + e.preventDefault(); + return cb(); + }, + + open(e) { + if (e) { e.preventDefault(); } + if (this) { return Gallery.open(this); } + }, + + image(e) { + e.preventDefault(); + e.stopPropagation(); + return Gallery.build(this); + }, + + prev() { + return Gallery.cb.open.call( + Gallery.images[+Gallery.nodes.current.dataset.id - 1] || Gallery.images[Gallery.images.length - 1] + ); + }, + next() { + return Gallery.cb.open.call( + Gallery.images[+Gallery.nodes.current.dataset.id + 1] || Gallery.images[0] + ); + }, + + click(e) { + if (ImageCommon.onControls(e)) { return; } + e.preventDefault(); + return Gallery.cb.advance(); + }, + + advance() { if (!Conf['Autoplay'] && Gallery.nodes.current.paused) { return Gallery.nodes.current.play(); } else { return Gallery.cb.next(); } }, + toggle() { return (Gallery.nodes ? Gallery.cb.close : Gallery.build)(); }, + blank(e) { if (e.target === this) { return Gallery.cb.close(); } }, + toggleSlideshow() { return Gallery.cb[Gallery.slideshow ? 'stop' : 'start'](); }, + + download() { + const name = $$1('.gal-name'); + return name.click(); + }, + + pause() { + Gallery.cb.stop(); + const {current} = Gallery.nodes; + if (current.nodeName === 'VIDEO') { return current[current.paused ? 'play' : 'pause'](); } + }, + + start() { + $$1.addClass(Gallery.nodes.buttons, 'gal-playing'); + Gallery.slideshow = true; + return Gallery.setupTimer(); + }, + + stop() { + if (!Gallery.slideshow) { return; } + Gallery.cleanupTimer(); + const {current} = Gallery.nodes; + if (current.nodeName === 'VIDEO') { current.loop = true; } + $$1.rmClass(Gallery.nodes.buttons, 'gal-playing'); + return Gallery.slideshow = false; + }, + + rotateLeft() { return Gallery.cb.rotate(270); }, + rotateRight() { return Gallery.cb.rotate(90); }, + + rotate: debounce(100, function(delta) { + const {current} = Gallery.nodes; + if (current.nodeName === 'IFRAME') { return; } + current.dataRotate = ((current.dataRotate || 0) + delta) % 360; + current.style.transform = `rotate(${current.dataRotate}deg)`; + return Gallery.cb.setHeight(); + }), + + close() { + $$1.off(Gallery.nodes.current, 'error', Gallery.error); + ImageCommon.pause(Gallery.nodes.current); + $$1.rm(Gallery.nodes.el); + $$1.rmClass(doc$1, 'gallery-open'); + if (Conf['Fullscreen Gallery']) { + $$1.off(d$1, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', Gallery.cb.close); + d$1.mozCancelFullScreen?.(); + d$1.webkitExitFullscreen?.(); + } + delete Gallery.nodes; + delete Gallery.fileIDs; + doc$1.style.overflow = ''; + + $$1.off(d$1, 'keydown', Gallery.cb.keybinds); + if (Conf['Keybinds']) { $$1.on(d$1, 'keydown', Keybinds.keydown); } + $$1.off(window, 'resize', Gallery.cb.setHeight); + return clearTimeout(Gallery.timeoutID); + }, + + setFitness() { + return (this.checked ? $$1.addClass : $$1.rmClass)(doc$1, `gal-${this.name.toLowerCase().replace(/\s+/g, '-')}`); + }, + + setHeight: debounce(100, function () { + let dim, margin, minHeight; + const {current, frame} = Gallery.nodes; + const {style} = current; + + if (Conf['Stretch to Fit'] && (dim = g.posts.get(current.dataset.post)?.files[+current.dataset.file].dimensions)) { + const [width, height] = Array.from(dim.split('x')); + let containerWidth = frame.clientWidth; + let containerHeight = doc$1.clientHeight - 25; + if (((current.dataRotate || 0) % 180) === 90) { + [containerWidth, containerHeight] = Array.from([containerHeight, containerWidth]); + } + minHeight = Math.min(containerHeight, (height / width) * containerWidth); + style.minHeight = minHeight + 'px'; + style.minWidth = ((width / height) * minHeight) + 'px'; + } else { + style.minHeight = (style.minWidth = ''); + } + + if (((current.dataRotate || 0) % 180) === 90) { + style.maxWidth = Conf['Fit Height'] ? `${doc$1.clientHeight - 25}px` : 'none'; + style.maxHeight = Conf['Fit Width'] ? `${frame.clientWidth}px` : 'none'; + margin = (current.clientWidth - current.clientHeight)/2; + return style.margin = `${margin}px ${-margin}px`; + } else { + return style.maxWidth = (style.maxHeight = (style.margin = '')); + } + }), + + setDelay() { return Gallery.delay = +this.value; } + }, + + menu: { + init() { + if (!Gallery.enabled) { return; } + + const el = $$1.el('span', { + textContent: 'Gallery', + className: 'gallery-link' + } + ); + + return Header$1.menu.addEntry({ + el, + order: 105, + subEntries: Gallery.menu.createSubEntries() + }); + }, + + createSubEntry(name) { + const label = UI.checkbox(name, name); + const input = label.firstElementChild; + if (['Hide Thumbnails', 'Fit Width', 'Fit Height'].includes(name)) { $$1.on(input, 'change', Gallery.cb.setFitness); } + $$1.event('change', null, input); + $$1.on(input, 'change', $$1.cb.checked); + if (['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Stretch to Fit'].includes(name)) { $$1.on(input, 'change', Gallery.cb.setHeight); } + return {el: label}; + }, + + createSubEntries() { + const subEntries = (['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Stretch to Fit', 'Scroll to Post'].map((item) => Gallery.menu.createSubEntry(item))); + + const delayLabel = $$1.el('label', {innerHTML: 'Slide Delay: '}); + const delayInput = delayLabel.firstElementChild; + delayInput.value = Gallery.delay; + $$1.on(delayInput, 'change', Gallery.cb.setDelay); + $$1.on(delayInput, 'change', $$1.cb.value); + subEntries.push({el: delayLabel}); + + return subEntries; + } + } + }; + + var EmbeddingPage = `
          +
          + + × +
          +
          +`; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * DS205: Consider reworking code to avoid use of IIFEs + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + + var Embedding = { + init() { + if (!['index', 'thread', 'archive'].includes(g.VIEW) || !Conf['Linkify'] || (!Conf['Embedding'] && !Conf['Link Title'] && !Conf['Cover Preview'])) { return; } + this.types = dict(); + for (var type of this.ordered_types) { this.types[type.key] = type; } + + if (Conf['Embedding'] && (g.VIEW !== 'archive')) { + this.dialog = UI.dialog('embedding', + { innerHTML: EmbeddingPage }); + this.media = $$1('#media-embed', this.dialog); + $$1.one(d$1, '4chanXInitFinished', this.ready); + $$1.on(d$1, 'IndexRefreshInternal', () => g.posts.forEach(function(post) { + for (post of [post, ...Array.from(post.clones)]) { + for (var embed of post.nodes.embedlinks) { + Embedding.cb.catalogRemove.call(embed); + } + } + })); + } + if (Conf['Link Title']) { + return $$1.on(d$1, '4chanXInitFinished PostsInserted', function() { + for (var key in Embedding.types) { + var service = Embedding.types[key]; + if (service.title?.batchSize) { + Embedding.flushTitles(service.title); + } + } + }); + } + }, + + events(post) { + let el, i, items; + if (g.VIEW === 'archive') { return; } + if (Conf['Embedding']) { + i = 0; + items = (post.nodes.embedlinks = $$('.embedder', post.nodes.comment)); + while ((el = items[i++])) { + $$1.on(el, 'click', Embedding.cb.click); + if ($$1.hasClass(el, 'embedded')) { Embedding.cb.toggle.call(el); } + } + } + if (Conf['Cover Preview']) { + i = 0; + items = $$('.linkify', post.nodes.comment); + while ((el = items[i++])) { + var data; + if (data = Embedding.services(el)) { + Embedding.preview(data); + } + } + return; + } + }, + + process(link, post) { + let data; + if (!Conf['Embedding'] && !Conf['Link Title'] && !Conf['Cover Preview']) { return; } + if ($$1.x('ancestor::pre', link)) { return; } + if (data = Embedding.services(link)) { + data.post = post; + if (Conf['Embedding'] && (g.VIEW !== 'archive')) { Embedding.embed(data); } + if (Conf['Link Title']) { Embedding.title(data); } + if (Conf['Cover Preview'] && (g.VIEW !== 'archive')) { return Embedding.preview(data); } + } + }, + + services(link) { + const {href} = link; + for (var type of Embedding.ordered_types) { + var match; + if (match = type.regExp.exec(href)) { + return {key: type.key, uid: match[1], options: match[2], link}; + } + } + }, + + embed(data) { + const {key, uid, options, link, post} = data; + const {href} = link; + + $$1.addClass(link, key.toLowerCase()); + + const embed = $$1.el('a', { + className: 'embedder', + href: 'javascript:;' + } + , + {innerHTML: '(unembed)'}); + + const object = {key, uid, options, href}; + for (var name in object) { var value = object[name]; embed.dataset[name] = value; } + + $$1.on(embed, 'click', Embedding.cb.click); + $$1.after(link, [$$1.tn(' '), embed]); + post.nodes.embedlinks.push(embed); + + if (Conf['Auto-embed'] && !Conf['Floating Embeds'] && !post.isFetchedQuote) { + if ($$1.hasClass(doc$1, 'catalog-mode')) { + return $$1.addClass(embed, 'embed-removed'); + } else { + return Embedding.cb.toggle.call(embed); + } + } + }, + + ready() { + if (!Main$1.isThisPageLegit()) { return; } + $$1.addClass(Embedding.dialog, 'empty'); + $$1.on($$1('.close', Embedding.dialog), 'click', Embedding.closeFloat); + $$1.on($$1('.move', Embedding.dialog), 'mousedown', Embedding.dragEmbed); + $$1.on($$1('.jump', Embedding.dialog), 'click', function() { + if (doc$1.contains(Embedding.lastEmbed)) { return Header$1.scrollTo(Embedding.lastEmbed); } + }); + return $$1.add(d$1.body, Embedding.dialog); + }, + + closeFloat() { + delete Embedding.lastEmbed; + $$1.addClass(Embedding.dialog, 'empty'); + return $$1.replace(Embedding.media.firstChild, $$1.el('div')); + }, + + dragEmbed() { + // only webkit can handle a blocking div + const {style} = Embedding.media; + if (Embedding.dragEmbed.mouseup) { + $$1.off(d$1, 'mouseup', Embedding.dragEmbed); + Embedding.dragEmbed.mouseup = false; + style.pointerEvents = ''; + return; + } + $$1.on(d$1, 'mouseup', Embedding.dragEmbed); + Embedding.dragEmbed.mouseup = true; + return style.pointerEvents = 'none'; + }, + + title(data) { + let service; + const {key, uid, options, link, post} = data; + if (!(service = Embedding.types[key].title)) { return; } + $$1.addClass(link, key.toLowerCase()); + if (service.batchSize) { + (service.queue || (service.queue = [])).push(data); + if (service.queue.length >= service.batchSize) { + return Embedding.flushTitles(service); + } + } else { + return CrossOrigin$1.cache(service.api(uid), (function() { return Embedding.cb.title(this, data); })); + } + }, + + flushTitles(service) { + let data; + const {queue} = service; + if (!queue?.length) { return; } + service.queue = []; + const cb = function() { + for (data of queue) { Embedding.cb.title(this, data); } + }; + return CrossOrigin$1.cache(service.api((() => { + const result = []; + for (data of queue) { result.push(data.uid); + } + return result; + })()), cb); + }, + + preview(data) { + let service; + const {key, uid, link} = data; + if (!(service = Embedding.types[key].preview)) { return; } + return $$1.on(link, 'mouseover', function(e) { + const src = service.url(uid); + const {height} = service; + const el = $$1.el('img', { + src, + id: 'ihover' + } + ); + $$1.add(Header$1.hover, el); + return UI.hover({ + root: link, + el, + latestEvent: e, + endEvents: 'mouseout click', + height + }); + }); + }, + + cb: { + click(e) { + e.preventDefault(); + if (!$$1.hasClass(this, 'embedded') && (Conf['Floating Embeds'] || $$1.hasClass(doc$1, 'catalog-mode'))) { + let div; + if (!(div = Embedding.media.firstChild)) { return; } + $$1.replace(div, Embedding.cb.embed(this)); + Embedding.lastEmbed = Get$1.postFromNode(this).nodes.root; + return $$1.rmClass(Embedding.dialog, 'empty'); + } else { + return Embedding.cb.toggle.call(this); + } + }, + + toggle() { + if ($$1.hasClass(this, "embedded")) { + $$1.rm(this.nextElementSibling); + } else { + $$1.after(this, Embedding.cb.embed(this)); + } + return $$1.toggleClass(this, 'embedded'); + }, + + embed(a) { + // We create an element to embed + let el, type; + const container = $$1.el('div', {className: 'media-embed'}); + $$1.add(container, (el = (type = Embedding.types[a.dataset.key]).el(a))); + + // Set style values. + el.style.cssText = (type.style != null) ? + type.style + : + 'border: none; width: 640px; height: 360px;'; + + return container; + }, + + catalogRemove() { + const isCatalog = $$1.hasClass(doc$1, 'catalog-mode'); + if ((isCatalog && $$1.hasClass(this, 'embedded')) || (!isCatalog && $$1.hasClass(this, 'embed-removed'))) { + Embedding.cb.toggle.call(this); + return $$1.toggleClass(this, 'embed-removed'); + } + }, + + title(req, data) { + let text; + const {key, uid, options, link, post} = data; + const service = Embedding.types[key].title; + + let {status} = req; + if ([200, 304].includes(status) && service.status) { + status = service.status(req.response)[0]; + } + + if (!status) { return; } + + text = `[${key}] ${(() => { switch (status) { + case 200: case 304: + text = service.text(req.response, uid); + if (typeof text === 'string') { + return text; + } else { + return text = link.textContent; + } + case 404: + return "Not Found"; + case 403: case 401: + return "Forbidden or Private"; + default: + return `${status}'d`; + } })() + }`; + + link.dataset.original = link.textContent; + link.textContent = text; + for (var post2 of post.clones) { + for (var link2 of $$('a.linkify', post2.nodes.comment)) { + if (link2.href === link.href) { + if (link2.dataset.original == null) { link2.dataset.original = link2.textContent; } + link2.textContent = text; + } + } + } + } + }, + + ordered_types: [{ + key: 'audio', + regExp: /^[^?#]+\.(?:mp3|m4a|oga|wav|flac)(?:[?#]|$)/i, + style: '', + el(a) { + return $$1.el('audio', { + controls: true, + preload: 'auto', + src: a.dataset.href + } + ); + } + } + , { + key: 'image', + regExp: /^[^?#]+\.(?:gif|png|jpg|jpeg|bmp|webp)(?::\w+)?(?:[?#]|$)/i, + style: '', + el(a) { + const hrefEsc = E(a.dataset.href); + return $$1.el('div', { innerHTML: ``}); + } + } + , { + key: 'video', + regExp: /^[^?#]+\.(?:og[gv]|webm|mp4)(?:[?#]|$)/i, + style: 'max-width: 80vw; max-height: 80vh;', + el(a) { + const el = $$1.el('video', { + hidden: true, + controls: true, + preload: 'auto', + src: a.dataset.href, + loop: ImageHost.test(a.dataset.href.split('/')[2]) + }); + $$1.on(el, 'loadedmetadata', function() { + if ((el.videoHeight === 0) && el.parentNode) { + return $$1.replace(el, Embedding.types.audio.el(a)); + } else { + return el.hidden = false; + } + }); + return el; + } + } + , { + key: 'PeerTube', + regExp: /^(\w+:\/\/[^\/]+\/videos\/watch\/\w{8}-\w{4}-\w{4}-\w{4}-\w{12})(.*)/, + el(a) { + let start; + const options = (start = a.dataset.options.match(/[?&](start=\w+)/)) ? `?${start[1]}` : ''; + const el = $$1.el('iframe', + {src: a.dataset.uid.replace('/videos/watch/', '/videos/embed/') + options}); + el.setAttribute("allowfullscreen", "true"); + return el; + } + } + , { + key: 'BitChute', + regExp: /^\w+:\/\/(?:www\.)?bitchute\.com\/video\/([\w\-]+)/, + el(a) { + const el = $$1.el('iframe', + {src: `https://www.bitchute.com/embed/${a.dataset.uid}/`}); + el.setAttribute("allowfullscreen", "true"); + return el; + } + } + , { + key: 'Clyp', + regExp: /^\w+:\/\/(?:www\.)?clyp\.it\/(\w{8})/, + style: 'border: 0; width: 640px; height: 160px;', + el(a) { + return $$1.el('iframe', + {src: `https://clyp.it/${a.dataset.uid}/widget`}); + }, + title: { + api(uid) { return `https://api.clyp.it/oembed?url=https://clyp.it/${uid}`; }, + text(_) { return _.title; } + } + } + , { + key: 'Dailymotion', + regExp: /^\w+:\/\/(?:(?:www\.)?dailymotion\.com\/(?:embed\/)?video|dai\.ly)\/([A-Za-z0-9]+)[^?]*(.*)/, + el(a) { + let start; + const options = (start = a.dataset.options.match(/[?&](start=\d+)/)) ? `?${start[1]}` : ''; + const el = $$1.el('iframe', + {src: `//www.dailymotion.com/embed/video/${a.dataset.uid}${options}`}); + el.setAttribute("allowfullscreen", "true"); + return el; + }, + title: { + api(uid) { return `https://api.dailymotion.com/video/${uid}`; }, + text(_) { return _.title; } + }, + preview: { + url(uid) { return `https://www.dailymotion.com/thumbnail/video/${uid}`; }, + height: 240 + } + } + , { + key: 'Gfycat', + regExp: /^\w+:\/\/(?:www\.)?gfycat\.com\/(?:iframe\/)?(\w+)/, + el(a) { + const el = $$1.el('iframe', + {src: `//gfycat.com/ifr/${a.dataset.uid}`}); + el.setAttribute("allowfullscreen", "true"); + return el; + } + } + , { + key: 'Gist', + regExp: /^\w+:\/\/gist\.github\.com\/[\w\-]+\/(\w+)/, + style: '', + el: (function() { + let counter = 0; + return function(a) { + const el = $$1.el('pre', { + hidden: true, + id: `gist-embed-${counter++}` + } + ); + CrossOrigin$1.cache(`https://api.github.com/gists/${a.dataset.uid}`, function() { + el.textContent = Object.values(this.response.files)[0].content; + el.className = 'prettyprint'; + $$1.global(() => window.prettyPrint?.((function() {}), document.getElementById(document.currentScript.dataset.id).parentNode) + , {id: el.id}); + return el.hidden = false; + }); + return el; + }; + })(), + title: { + api(uid) { return `https://api.github.com/gists/${uid}`; }, + text({files}) { + for (var file in files) { if (files.hasOwnProperty(file)) { return file; } } + } + } + } + , { + key: 'InstallGentoo', + regExp: /^\w+:\/\/paste\.installgentoo\.com\/view\/(?:raw\/|download\/|embed\/)?(\w+)/, + el(a) { + return $$1.el('iframe', + {src: `https://paste.installgentoo.com/view/embed/${a.dataset.uid}`}); + } + } + , { + key: 'LiveLeak', + regExp: /^\w+:\/\/(?:\w+\.)?liveleak\.com\/.*\?.*[tif]=(\w+)/, + el(a) { + const el = $$1.el('iframe', + {src: `https://www.liveleak.com/e/${a.dataset.uid}`,}); + el.setAttribute("allowfullscreen", "true"); + return el; + } + } + , { + key: 'Loopvid', + regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/#?((?:pf|kd|lv|gd|gh|db|dx|nn|cp|wu|ig|ky|mf|m2|pc|1c|pi|ni|wl|ko|mm|ic|gc)\/[\w\-\/]+(?:,[\w\-\/]+)*|fc\/\w+\/\d+|https?:\/\/.+)/, + style: 'max-width: 80vw; max-height: 80vh;', + el(a) { + const el = $$1.el('video', { + controls: true, + preload: 'auto', + loop: true + } + ); + if (/^http/.test(a.dataset.uid)) { + $$1.add(el, $$1.el('source', {src: a.dataset.uid})); + return el; + } + const [_, host, names] = Array.from(a.dataset.uid.match(/(\w+)\/(.*)/)); + const types = (() => { switch (host) { + case 'gd': case 'wu': case 'fc': return ['']; + case 'gc': return ['giant', 'fat', 'zippy']; + default: return ['.webm', '.mp4']; + } })(); + for (var name of names.split(',')) { + for (var type of types) { + var base = `${name}${type}`; + var urls = (() => { switch (host) { + // list from src/common.py at http://loopvid.appspot.com/source.html + case 'pf': return [`https://kastden.org/_loopvid_media/pf/${base}`, `https://web.archive.org/web/2/http://a.pomf.se/${base}`]; + case 'kd': return [`https://kastden.org/loopvid/${base}`]; + case 'lv': return [`https://lv.kastden.org/${base}`]; + case 'gd': return [`https://docs.google.com/uc?export=download&id=${base}`]; + case 'gh': return [`https://googledrive.com/host/${base}`]; + case 'db': return [`https://dl.dropboxusercontent.com/u/${base}`]; + case 'dx': return [`https://dl.dropboxusercontent.com/${base}`]; + case 'nn': return [`https://kastden.org/_loopvid_media/nn/${base}`]; + case 'cp': return [`https://copy.com/${base}`]; + case 'wu': return [`http://webmup.com/${base}/vid.webm`]; + case 'ig': return [`https://i.imgur.com/${base}`]; + case 'ky': return [`https://kastden.org/_loopvid_media/ky/${base}`]; + case 'mf': return [`https://kastden.org/_loopvid_media/mf/${base}`, `https://web.archive.org/web/2/https://d.maxfile.ro/${base}`]; + case 'm2': return [`https://kastden.org/_loopvid_media/m2/${base}`]; + case 'pc': return [`https://kastden.org/_loopvid_media/pc/${base}`, `https://web.archive.org/web/2/http://a.pomf.cat/${base}`]; + case '1c': return [`http://b.1339.cf/${base}`]; + case 'pi': return [`https://kastden.org/_loopvid_media/pi/${base}`, `https://web.archive.org/web/2/https://u.pomf.is/${base}`]; + case 'ni': return [`https://kastden.org/_loopvid_media/ni/${base}`, `https://web.archive.org/web/2/https://u.nya.is/${base}`]; + case 'wl': return [`http://webm.land/media/${base}`]; + case 'ko': return [`https://kordy.kastden.org/loopvid/${base}`]; + case 'mm': return [`https://kastden.org/_loopvid_media/mm/${base}`, `https://web.archive.org/web/2/https://my.mixtape.moe/${base}`]; + case 'ic': return [`https://media.8ch.net/file_store/${base}`]; + case 'fc': return [`//${ImageHost.host()}/${base}.webm`]; + case 'gc': return [`https://${type}.gfycat.com/${name}.webm`]; + } })(); + + for (var url of urls) { + $$1.add(el, $$1.el('source', {src: url})); + } + } + } + return el; + } + } + , { + key: 'Openings.moe', + regExp: /^\w+:\/\/openings.moe\/\?video=([^.&=]+)/, + style: 'width: 1280px; height: 720px; max-width: 80vw; max-height: 80vh;', + el(a) { + const el = $$1.el('iframe', + {src: `https://openings.moe/?video=${a.dataset.uid}`,}); + el.setAttribute("allowfullscreen", "true"); + return el; + } + } + , { + key: 'Pastebin', + regExp: /^\w+:\/\/(?:\w+\.)?pastebin\.com\/(?!u\/)(?:[\w.]+(?:\/|\?i\=))?(\w+)/, + el(a) { + return $$1.el('iframe', + {src: `//pastebin.com/embed_iframe.php?i=${a.dataset.uid}`}); + } + } + , { + key: 'SoundCloud', + regExp: /^\w+:\/\/(?:www\.)?(?:soundcloud\.com\/|snd\.sc\/)([\w\-\/]+)/, + style: 'border: 0; width: 500px; height: 400px;', + el(a) { + return $$1.el('iframe', + {src: `https://w.soundcloud.com/player/?visual=true&show_comments=false&url=https%3A%2F%2Fsoundcloud.com%2F${encodeURIComponent(a.dataset.uid)}`}); + }, + title: { + api(uid) { return `${location.protocol}//soundcloud.com/oembed?format=json&url=https%3A%2F%2Fsoundcloud.com%2F${encodeURIComponent(uid)}`; }, + text(_) { return _.title; } + } + } + , { + key: 'StrawPoll', + regExp: /^\w+:\/\/(?:www\.)?strawpoll\.me\/(?:embed_\d+\/)?(\d+(?:\/r)?)/, + style: 'border: 0; width: 600px; height: 406px;', + el(a) { + return $$1.el('iframe', + {src: `https://www.strawpoll.me/embed_1/${a.dataset.uid}`}); + } + } + , { + key: 'Streamable', + regExp: /^\w+:\/\/(?:www\.)?streamable\.com\/(\w+)/, + el(a) { + const el = $$1.el('iframe', + {src: `https://streamable.com/o/${a.dataset.uid}`}); + el.setAttribute("allowfullscreen", "true"); + return el; + }, + title: { + api(uid) { return `https://api.streamable.com/oembed?url=https://streamable.com/${uid}`; }, + text(_) { return _.title; } + } + } + , { + key: 'TwitchTV', + regExp: /^\w+:\/\/(?:www\.|secure\.|clips\.|m\.)?twitch\.tv\/(\w[^#\&\?]*)/, + el(a) { + let url; + let m = a.dataset.href.match(/^\w+:\/\/(?:(clips\.)|\w+\.)?twitch\.tv\/(?:\w+\/)?(clip\/)?(\w[^#\&\?]*)/); + if (m[1] || m[2]) { + url = `//clips.twitch.tv/embed?clip=${m[3]}&parent=${location.hostname}`; + } else { + let time; + m = a.dataset.uid.match(/(\w+)(?:\/(?:v\/)?(\d+))?/); + url = `//player.twitch.tv/?${m[2] ? `video=v${m[2]}` : `channel=${m[1]}`}&autoplay=false&parent=${location.hostname}`; + if (time = a.dataset.href.match(/\bt=(\w+)/)) { + url += `&time=${time[1]}`; + } + } + const el = $$1.el('iframe', + {src: url}); + el.setAttribute("allowfullscreen", "true"); + return el; + } + } + , { + key: 'Twitter', + regExp: /^\w+:\/\/(?:www\.|mobile\.)?twitter\.com\/(\w+\/status\/\d+)/, + style: 'border: none; width: 550px; height: 250px; overflow: hidden; resize: both;', + el(a) { + const el = $$1.el('iframe'); + $$1.on(el, 'load', function() { + return this.contentWindow.postMessage({element: 't', query: 'height'}, 'https://twitframe.com'); + }); + var onMessage = function(e) { + if ((e.source === el.contentWindow) && (e.origin === 'https://twitframe.com')) { + $$1.off(window, 'message', onMessage); + return (cont || el).style.height = `${+$$1.minmax(e.data.height, 250, 0.8 * doc$1.clientHeight)}px`; + } + }; + $$1.on(window, 'message', onMessage); + el.src = `https://twitframe.com/show?url=https://twitter.com/${a.dataset.uid}`; + if ($$1.engine === 'gecko') { + // XXX https://bugzilla.mozilla.org/show_bug.cgi?id=680823 + el.style.cssText = 'border: none; width: 100%; height: 100%;'; + var cont = $$1.el('div'); + $$1.add(cont, el); + return cont; + } else { + return el; + } + } + } + , { + key: 'VidLii', + regExp: /^\w+:\/\/(?:www\.)?vidlii\.com\/watch\?v=(\w{11})/, + style: 'border: none; width: 640px; height: 392px;', + el(a) { + const el = $$1.el('iframe', + {src: `https://www.vidlii.com/embed?v=${a.dataset.uid}&a=0`}); + el.setAttribute("allowfullscreen", "true"); + return el; + } + } + , { + key: 'Vimeo', + regExp: /^\w+:\/\/(?:www\.)?vimeo\.com\/(\d+)/, + el(a) { + const el = $$1.el('iframe', + {src: `//player.vimeo.com/video/${a.dataset.uid}?wmode=opaque`}); + el.setAttribute("allowfullscreen", "true"); + return el; + }, + title: { + api(uid) { return `https://vimeo.com/api/oembed.json?url=https://vimeo.com/${uid}`; }, + text(_) { return _.title; } + } + } + , { + key: 'Vine', + regExp: /^\w+:\/\/(?:www\.)?vine\.co\/v\/(\w+)/, + style: 'border: none; width: 500px; height: 500px;', + el(a) { + return $$1.el('iframe', + {src: `https://vine.co/v/${a.dataset.uid}/card`}); + } + } + , { + key: 'Vocaroo', + regExp: /^\w+:\/\/(?:(?:www\.|old\.)?vocaroo\.com|voca\.ro)\/((?:i\/)?\w+)/, + style: '', + el(a) { + const el = $$1.el('iframe'); + el.width = 300; + el.height = 60; + el.setAttribute('frameborder', 0); + el.src = `https://vocaroo.com/embed/${a.dataset.uid.replace(/^i\//, '')}?autoplay=0`; + return el; + } + } + , { + key: 'YouTube', + regExp: /^\w+:\/\/(?:youtu.be\/|[\w.]*youtube[\w.]*\/.*(?:v=|\bembed\/|\bv\/|live\/))([\w\-]{11})(.*)/, + el(a) { + let start = a.dataset.options.match(/\b(?:star)?t\=(\w+)/); + if (start) { start = start[1]; } + if (start && !/^\d+$/.test(start)) { + start += ' 0h0m0s'; + start = (3600 * start.match(/(\d+)h/)[1]) + (60 * start.match(/(\d+)m/)[1]) + (1 * start.match(/(\d+)s/)[1]); + } + const el = $$1.el('iframe', + {src: `//www.youtube.com/embed/${a.dataset.uid}?rel=0&wmode=opaque${start ? '&start=' + start : ''}`}); + el.setAttribute("allowfullscreen", "true"); + return el; + }, + title: { + api(uid) { return `https://www.youtube.com/oembed?url=https%3A//www.youtube.com/watch%3Fv%3D${uid}&format=json`; }, + text(_) { return _.title; }, + status(_) { + if (_.error) { + const m = _.error.match(/^(\d*)\s*(.*)/); + return [+m[1], m[2]]; + } else { + return [200, 'OK']; + } + } + }, + preview: { + url(uid) { return `https://img.youtube.com/vi/${uid}/0.jpg`; }, + height: 360 + } + } + ] + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS205: Consider reworking code to avoid use of IIFEs + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var Keybinds = { + init() { + if (!Conf['Keybinds']) { return; } + + for (var hotkey in Config.hotkeys) { + $$1.sync(hotkey, Keybinds.sync); + } + + var init = function() { + $$1.off(d$1, '4chanXInitFinished', init); + $$1.on(d$1, 'keydown', Keybinds.keydown); + for (var node of $$('[accesskey]')) { + node.removeAttribute('accesskey'); + } + }; + return $$1.on(d$1, '4chanXInitFinished', init); + }, + + sync(key, hotkey) { + return Conf[hotkey] = key; + }, + + keydown(e) { + let key, thread, threadRoot; + let catalog, notifications; + if (!(key = Keybinds.keyCode(e))) { return; } + const {target} = e; + if (['INPUT', 'TEXTAREA'].includes(target.nodeName)) { + if (!/(Esc|Alt|Ctrl|Meta|Shift\+\w{2,})/.test(key) || !!/^Alt\+(\d|Up|Down|Left|Right)$/.test(key)) { return; } + } + if (['index', 'thread'].includes(g.VIEW)) { + threadRoot = Nav.getThread(); + thread = Get$1.threadFromRoot(threadRoot); + } + switch (key) { + // QR & Options + case Conf['Toggle board list']: + if (!Conf['Custom Board Navigation']) { return; } + Header$1.toggleBoardList(); + break; + case Conf['Toggle header']: + Header$1.toggleBarVisibility(); + break; + case Conf['Open empty QR']: + if (!QR.postingIsEnabled) { return; } + Keybinds.qr(); + break; + case Conf['Open QR']: + if (!QR.postingIsEnabled || !threadRoot) { return; } + Keybinds.qr(threadRoot); + break; + case Conf['Open settings']: + Settings.open(); + break; + case Conf['Close']: + if (Settings.dialog) { + Settings.close(); + } else if ((notifications = $$('.notification')).length) { + for (var notification of notifications) { + $$1('.close', notification).click(); + } + } else if (QR.nodes && !(QR.nodes.el.hidden || (window.getComputedStyle(QR.nodes.form).display === 'none'))) { + if (Conf['Persistent QR']) { + QR.hide(); + } else { + QR.close(); + } + } else if (Embedding.lastEmbed) { + Embedding.closeFloat(); + } else { + return; + } + break; + case Conf['Spoiler tags']: + if (target.nodeName !== 'TEXTAREA') { return; } + Keybinds.tags('spoiler', target); + break; + case Conf['Code tags']: + if (target.nodeName !== 'TEXTAREA') { return; } + Keybinds.tags('code', target); + break; + case Conf['Eqn tags']: + if (target.nodeName !== 'TEXTAREA') { return; } + Keybinds.tags('eqn', target); + break; + case Conf['Math tags']: + if (target.nodeName !== 'TEXTAREA') { return; } + Keybinds.tags('math', target); + break; + case Conf['SJIS tags']: + if (target.nodeName !== 'TEXTAREA') { return; } + Keybinds.tags('sjis', target); + break; + case Conf['Toggle sage']: + if (!QR.nodes || !!QR.nodes.el.hidden) { return; } + Keybinds.sage(); + break; + case Conf['Toggle Cooldown']: + if (!QR.nodes || !!QR.nodes.el.hidden || !$$1.hasClass(QR.nodes.fileSubmit, 'custom-cooldown')) { return; } + QR.toggleCustomCooldown(); + break; + case Conf['Post from URL']: + if (!QR.postingIsEnabled) { return; } + QR.handleUrl(''); + break; + case Conf['Add new post']: + if (!QR.postingIsEnabled) { return; } + QR.addPost(); + break; + case Conf['Submit QR']: + if (!QR.nodes || !!QR.nodes.el.hidden) { return; } + if (!QR.status()) { QR.submit(); } + break; + // Index/Thread related + case Conf['Update']: + switch (g.VIEW) { + case 'thread': + if (!ThreadUpdater.enabled) { return; } + ThreadUpdater.update(); + break; + case 'index': + if (!Index$1.enabled) { return; } + Index$1.update(); + break; + default: + return; + } + break; + case Conf['Watch']: + if (!ThreadWatcher$1.enabled || !thread) { return; } + ThreadWatcher$1.toggle(thread); + break; + case Conf['Update thread watcher']: + if (!ThreadWatcher$1.enabled) { return; } + ThreadWatcher$1.buttonFetchAll(); + break; + case Conf['Toggle thread watcher']: + if (!ThreadWatcher$1.enabled) { return; } + ThreadWatcher$1.toggleWatcher(); + break; + case Conf['Toggle threading']: + if (!QuoteThreading.ready) { return; } + QuoteThreading.toggleThreading(); + break; + case Conf['Mark thread read']: + if ((g.VIEW !== 'index') || !thread || !UnreadIndex.enabled) { return; } + UnreadIndex.markRead.call(threadRoot); + break; + // Images + case Conf['Expand image']: + if (!ImageExpand.enabled || !threadRoot) { return; } + var post = Get$1.postFromNode(Keybinds.post(threadRoot)); + if (post.file) { ImageExpand.toggle(post); } + break; + case Conf['Expand images']: + if (!ImageExpand.enabled) { return; } + ImageExpand.cb.toggleAll(); + break; + case Conf['Open Gallery']: + if (!Gallery.enabled) { return; } + Gallery.cb.toggle(); + break; + case Conf['fappeTyme']: + if (!FappeTyme.nodes?.fappe) { return; } + FappeTyme.toggle('fappe'); + break; + case Conf['werkTyme']: + if (!FappeTyme.nodes?.werk) { return; } + FappeTyme.toggle('werk'); + break; + // Board Navigation + case Conf['Front page']: + if (Index$1.enabled) { + Index$1.userPageNav(1); + } else { + location.href = `/${g.BOARD}/`; + } + break; + case Conf['Open front page']: + $$1.open(`${location.origin}/${g.BOARD}/`); + break; + case Conf['Next page']: + if ((g.VIEW !== 'index') || !!g.SITE.isOnePage?.(g.BOARD)) { return; } + if (Index$1.enabled) { + if (!['paged', 'infinite'].includes(Conf['Index Mode'])) { return; } + $$1('.next button', Index$1.pagelist).click(); + } else { + $$1(g.SITE.selectors.nav.next)?.click(); + } + break; + case Conf['Previous page']: + if ((g.VIEW !== 'index') || !!g.SITE.isOnePage?.(g.BOARD)) { return; } + if (Index$1.enabled) { + if (!['paged', 'infinite'].includes(Conf['Index Mode'])) { return; } + $$1('.prev button', Index$1.pagelist).click(); + } else { + $$1(g.SITE.selectors.nav.prev)?.click(); + } + break; + case Conf['Search form']: + if (g.VIEW !== 'index') { return; } + var searchInput = Index$1.enabled ? + Index$1.searchInput + : g.SITE.selectors.searchBox ? + $$1(g.SITE.selectors.searchBox) + : + undefined; + if (!searchInput) { return; } + Header$1.scrollToIfNeeded(searchInput); + searchInput.focus(); + break; + case Conf['Paged mode']: + if (!Index$1.enabledOn(g.BOARD)) { return; } + location.href = g.VIEW === 'index' ? '#paged' : `/${g.BOARD}/#paged`; + break; + case Conf['Infinite scrolling mode']: + if (!Index$1.enabledOn(g.BOARD)) { return; } + location.href = g.VIEW === 'index' ? '#infinite' : `/${g.BOARD}/#infinite`; + break; + case Conf['All pages mode']: + if (!Index$1.enabledOn(g.BOARD)) { return; } + location.href = g.VIEW === 'index' ? '#all-pages' : `/${g.BOARD}/#all-pages`; + break; + case Conf['Open catalog']: + if (!(catalog = CatalogLinks.catalog())) { return; } + location.href = catalog; + break; + case Conf['Cycle sort type']: + if (!Index$1.enabled) { return; } + Index$1.cycleSortType(); + break; + // Thread Navigation + case Conf['Next thread']: + if ((g.VIEW !== 'index') || !threadRoot) { return; } + Nav.scroll(+1); + break; + case Conf['Previous thread']: + if ((g.VIEW !== 'index') || !threadRoot) { return; } + Nav.scroll(-1); + break; + case Conf['Expand thread']: + if ((g.VIEW !== 'index') || !threadRoot) { return; } + ExpandThread.toggle(thread); + // Keep thread from moving off screen when contracted. + Header$1.scrollTo(threadRoot); + break; + case Conf['Open thread']: + if ((g.VIEW !== 'index') || !threadRoot) { return; } + Keybinds.open(thread); + break; + case Conf['Open thread tab']: + if ((g.VIEW !== 'index') || !threadRoot) { return; } + Keybinds.open(thread, true); + break; + // Reply Navigation + case Conf['Next reply']: + if (!threadRoot) { return; } + Keybinds.hl(+1, threadRoot); + break; + case Conf['Previous reply']: + if (!threadRoot) { return; } + Keybinds.hl(-1, threadRoot); + break; + case Conf['Deselect reply']: + if (!threadRoot) { return; } + Keybinds.hl(0, threadRoot); + break; + case Conf['Hide']: + if (!thread || !ThreadHiding.db) { return; } + Header$1.scrollTo(threadRoot); + ThreadHiding.toggle(thread); + break; + case Conf['Quick Filter MD5']: + if (!threadRoot) { return; } + post = Keybinds.post(threadRoot); + Keybinds.hl(+1, threadRoot); + Filter.quickFilterMD5.call(post, e); + break; + case Conf['Previous Post Quoting You']: + if (!threadRoot || !QuoteYou.db) { return; } + QuoteYou.cb.seek('preceding'); + break; + case Conf['Next Post Quoting You']: + if (!threadRoot || !QuoteYou.db) { return; } + QuoteYou.cb.seek('following'); + break; + default: + return; + } + e.preventDefault(); + return e.stopPropagation(); + }, + + keyCode(e) { + let key = (() => { let kc; + switch ((kc = e.keyCode)) { + case 8: // return + return ''; + case 13: + return 'Enter'; + case 27: + return 'Esc'; + case 32: + return 'Space'; + case 37: + return 'Left'; + case 38: + return 'Up'; + case 39: + return 'Right'; + case 40: + return 'Down'; + case 188: + return 'Comma'; + case 190: + return 'Period'; + case 191: + return 'Slash'; + case 59: case 186: + return 'Semicolon'; + default: + if ((48 <= kc && kc <= 57) || (65 <= kc && kc <= 90)) { // 0-9, A-Z + return String.fromCharCode(kc).toLowerCase(); + } else if (96 <= kc && kc <= 105) { // numpad 0-9 + return String.fromCharCode(kc - 48).toLowerCase(); + } else { + return null; + } + } })(); + if (key) { + if (e.altKey) { key = 'Alt+' + key; } + if (e.ctrlKey) { key = 'Ctrl+' + key; } + if (e.metaKey) { key = 'Meta+' + key; } + if (e.shiftKey) { key = 'Shift+' + key; } + } + return key; + }, + + post(thread) { + const s = g.SITE.selectors; + return ( + $$1(`${s.postContainer}${s.highlightable.reply}.${g.SITE.classes.highlight}`, thread) || + $$1(`${g.SITE.isOPContainerThread ? s.thread : s.postContainer}${s.highlightable.op}`, thread) + ); + }, + + qr(thread) { + QR.open(); + if (thread != null) { + QR.quote.call(Keybinds.post(thread)); + } + return QR.nodes.com.focus(); + }, + + tags(tag, ta) { + BoardConfig.ready(function() { + const {config} = g.BOARD; + const supported = (() => { switch (tag) { + case 'spoiler': return !!config.spoilers; + case 'code': return !!config.code_tags; + case 'math': case 'eqn': return !!config.math_tags; + case 'sjis': return !!config.sjis_tags; + } })(); + if (!supported) { return new Notice('warning', `[${tag}] tags are not supported on /${g.BOARD}/.`, 20); } + }); + + const { + value + } = ta; + const selStart = ta.selectionStart; + const selEnd = ta.selectionEnd; + + ta.value = + value.slice(0, selStart) + + `[${tag}]` + value.slice(selStart, selEnd) + `[/${tag}]` + + value.slice(selEnd); + + // Move the caret to the end of the selection. + const range = (`[${tag}]`).length + selEnd; + ta.setSelectionRange(range, range); + + // Fire the 'input' event + return $$1.event('input', null, ta); + }, + + sage() { + const isSage = /sage/i.test(QR.nodes.email.value); + return QR.nodes.email.value = isSage ? + "" + : "sage"; + }, + + open(thread, tab) { + if (g.VIEW !== 'index') { return; } + const url = Get$1.url('thread', thread); + if (tab) { + return $$1.open(url); + } else { + return location.href = url; + } + }, + + hl(delta, thread) { + const replySelector = `${g.SITE.selectors.postContainer}${g.SITE.selectors.highlightable.reply}`; + const {highlight} = g.SITE.classes; + + const postEl = $$1(`${replySelector}.${highlight}`, thread); + + if (!delta) { + if (postEl) { $$1.rmClass(postEl, highlight); } + return; + } + + if (postEl) { + const {height} = postEl.getBoundingClientRect(); + if ((Header$1.getTopOf(postEl) >= -height) && (Header$1.getBottomOf(postEl) >= -height)) { // We're at least partially visible + let next; + const {root} = Get$1.postFromNode(postEl).nodes; + const axis = delta === +1 ? + 'following' + : + 'preceding'; + if (!(next = $$1.x(`${axis}-sibling::${g.SITE.xpath.replyContainer}[not(@hidden) and not(child::div[@class='stub'])][1]`, root))) { return; } + if (!next.matches(replySelector)) { next = $$1(replySelector, next); } + Header$1.scrollToIfNeeded(next, delta === +1); + $$1.addClass(next, highlight); + $$1.rmClass(postEl, highlight); + return; + } + $$1.rmClass(postEl, highlight); + } + + const replies = $$(replySelector, thread); + if (delta === -1) { replies.reverse(); } + for (var reply of replies) { + if (((delta === +1) && (Header$1.getTopOf(reply) > 0)) || ((delta === -1) && (Header$1.getBottomOf(reply) > 0))) { + $$1.addClass(reply, highlight); + return; + } + } + } + }; + + const Captcha = { + Cache: { + init() { + $$1.on(d$1, 'SaveCaptcha', e => { + return this.saveAPI(e.detail); + }); + return $$1.on(d$1, 'NoCaptcha', e => { + return this.noCaptcha(e.detail); + }); + }, + + captchas: [], + + getCount() { + return this.captchas.length; + }, + + neededRaw() { + return !( + this.haveCookie() || this.captchas.length || QR.req || this.submitCB + ) && ( + (QR.posts.length > 1) || Conf['Auto-load captcha'] || !QR.posts[0].isOnlyQuotes() || QR.posts[0].file + ); + }, + + needed() { + return this.neededRaw() && $$1.event('LoadCaptcha'); + }, + + prerequest() { + if (!Conf['Prerequest Captcha']) { return; } + // Post count temporarily off by 1 when called from QR.post.rm, QR.close, or QR.submit + return $$1.queueTask(() => { + if ( + !this.prerequested && + this.neededRaw() && + !$$1.event('LoadCaptcha') && + !QR.captcha.occupied() && + (QR.cooldown.seconds <= 60) && + (QR.selected === QR.posts[QR.posts.length - 1]) && + !QR.selected.isOnlyQuotes() + ) { + const isReply = (QR.selected.thread !== 'new'); + if (!$$1.event('RequestCaptcha', { isReply })) { + this.prerequested = true; + this.submitCB = captcha => { + if (captcha) { return this.save(captcha); } + }; + return this.updateCount(); + } + } + }); + }, + + haveCookie() { + return /\b_ct=/.test(d$1.cookie) && (QR.posts[0].thread !== 'new'); + }, + + getOne() { + let captcha; + delete this.prerequested; + this.clear(); + if (captcha = this.captchas.shift()) { + this.count(); + return captcha; + } else { + return null; + } + }, + + request(isReply) { + if (!this.submitCB) { + if ($$1.event('RequestCaptcha', { isReply })) { return; } + } + return cb => { + this.submitCB = cb; + return this.updateCount(); + }; + }, + + abort() { + if (this.submitCB) { + delete this.submitCB; + $$1.event('AbortCaptcha'); + return this.updateCount(); + } + }, + + saveAPI(captcha) { + let cb; + if (cb = this.submitCB) { + delete this.submitCB; + cb(captcha); + return this.updateCount(); + } else { + return this.save(captcha); + } + }, + + noCaptcha(detail) { + let cb; + if (cb = this.submitCB) { + if (!this.haveCookie() || detail?.error) { + QR.error(detail?.error || 'Failed to retrieve captcha.'); + QR.captcha.setup(d$1.activeElement === QR.nodes.status); + } + delete this.submitCB; + cb(); + return this.updateCount(); + } + }, + + save(captcha) { + let cb; + if (cb = this.submitCB) { + this.abort(); + cb(captcha); + return; + } + this.captchas.push(captcha); + this.captchas.sort((a, b) => a.timeout - b.timeout); + return this.count(); + }, + + clear() { + if (this.captchas.length) { + let i; + const now = Date.now(); + for (i = 0; i < this.captchas.length; i++) { + var captcha = this.captchas[i]; + if (captcha.timeout > now) { break; } + } + if (i) { + this.captchas = this.captchas.slice(i); + return this.count(); + } + } + }, + + count() { + clearTimeout(this.timer); + if (this.captchas.length) { + this.timer = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now()); + } + return this.updateCount(); + }, + + updateCount() { + return $$1.event('CaptchaCount', this.captchas.length); + } + }, Replace: CaptchaReplace, t: CaptchaT, v2: { + lifetime: 2 * MINUTE, + + init() { + if (d$1.cookie.indexOf('pass_enabled=1') >= 0) { return; } + if (!(this.isEnabled = !!$$1('#g-recaptcha, #captcha-forced-noscript') || !$$1.id('postForm'))) { return; } + + if (this.noscript = Conf['Force Noscript Captcha'] || !Main$1.jsEnabled) { + $$1.addClass(QR.nodes.el, 'noscript-captcha'); + } + + Captcha.cache.init(); + $$1.on(d$1, 'CaptchaCount', this.count.bind(this)); + + const root = $$1.el('div', { className: 'captcha-root' }); + $$1.extend(root, { + innerHTML: + '
          ' + } + ); + const counter = $$1('.captcha-counter > a', root); + this.nodes = { root, counter }; + this.count(); + $$1.addClass(QR.nodes.el, 'has-captcha', 'captcha-v2'); + $$1.after(QR.nodes.com.parentNode, root); + + $$1.on(counter, 'click', this.toggle.bind(this)); + $$1.on(counter, 'keydown', e => { + if (Keybinds.keyCode(e) !== 'Space') { return; } + this.toggle(); + e.preventDefault(); + return e.stopPropagation(); + }); + return $$1.on(window, 'captcha:success', () => { + // XXX Greasemonkey 1.x workaround to gain access to GM_* functions. + return $$1.queueTask(() => this.save(false)); + }); + }, + + timeouts: {}, + prevNeeded: 0, + + noscriptURL() { + let lang; + let url = `https://www.google.com/recaptcha/api/fallback?k=${meta.recaptchaKey}`; + if (lang = Conf['captchaLanguage'].trim()) { + url += `&hl=${encodeURIComponent(lang)}`; + } + return url; + }, + + moreNeeded() { + // Post count temporarily off by 1 when called from QR.post.rm, QR.close, or QR.submit + return $$1.queueTask(() => { + const needed = Captcha.cache.needed(); + if (needed && !this.prevNeeded) { + this.setup(QR.cooldown.auto && (d$1.activeElement === QR.nodes.status)); + } + return this.prevNeeded = needed; + }); + }, + + toggle() { + if (this.nodes.container && !this.timeouts.destroy) { + return this.destroy(); + } else { + return this.setup(true, true); + } + }, + + setup(focus, force) { + if (!this.isEnabled || (!Captcha.cache.needed() && !force)) { return; } + + if (focus) { + $$1.addClass(QR.nodes.el, 'focus'); + this.nodes.counter.focus(); + } + + if (this.timeouts.destroy) { + clearTimeout(this.timeouts.destroy); + delete this.timeouts.destroy; + return this.reload(); + } + + if (this.nodes.container) { + // XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1226835 + $$1.queueTask(() => { + let iframe; + if (this.nodes.container && (d$1.activeElement === this.nodes.counter) && (iframe = $$1('iframe[src^="https://www.google.com/recaptcha/"]', this.nodes.container))) { + iframe.focus(); + return QR.focus(); + } + }); // Event handler not fired in Firefox + return; + } + + this.nodes.container = $$1.el('div', { className: 'captcha-container' }); + $$1.prepend(this.nodes.root, this.nodes.container); + new MutationObserver(this.afterSetup.bind(this)).observe(this.nodes.container, { + childList: true, + subtree: true + } + ); + + if (this.noscript) { + return this.setupNoscript(); + } else { + return this.setupJS(); + } + }, + + setupNoscript() { + const iframe = $$1.el('iframe', { + id: 'qr-captcha-iframe', + scrolling: 'no', + src: this.noscriptURL() + } + ); + const div = $$1.el('div'); + const textarea = $$1.el('textarea'); + $$1.add(div, textarea); + return $$1.add(this.nodes.container, [iframe, div]); + }, + + setupJS() { + return $$1.global(function () { + const render = function () { + const { classList } = document.documentElement; + const container = document.querySelector('#qr .captcha-container'); + return container.dataset.widgetID = window.grecaptcha.render(container, { + sitekey: meta.recaptchaKey, + theme: classList.contains('tomorrow') || classList.contains('spooky') || classList.contains('dark-captcha') ? 'dark' : 'light', + callback(response) { + return window.dispatchEvent(new CustomEvent('captcha:success', { detail: response })); + } + } + ); + }; + if (window.grecaptcha) { + return render(); + } else { + const cbNative = window.onRecaptchaLoaded; + window.onRecaptchaLoaded = function () { + render(); + return cbNative(); + }; + if (!document.head.querySelector('script[src^="https://www.google.com/recaptcha/api.js"]')) { + const script = document.createElement('script'); + script.src = 'https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoaded&render=explicit'; + return document.head.appendChild(script); + } + } + }); + }, + + afterSetup(mutations) { + for (var mutation of mutations) { + for (var node of mutation.addedNodes) { + var iframe, textarea; + if (iframe = $$1.x('./descendant-or-self::iframe[starts-with(@src, "https://www.google.com/recaptcha/")]', node)) { this.setupIFrame(iframe); } + if (textarea = $$1.x('./descendant-or-self::textarea', node)) { this.setupTextArea(textarea); } + } + } + }, + + setupIFrame(iframe) { + let needle; + if (!doc.contains(iframe)) { return; } + Captcha.replace.iframe(iframe); + $$1.addClass(QR.nodes.el, 'captcha-open'); + this.fixQRPosition(); + $$1.on(iframe, 'load', this.fixQRPosition); + if (d$1.activeElement === this.nodes.counter) { iframe.focus(); } + // XXX Make sure scroll on space prevention (see src/css/style.css) doesn't cause scrolling of div + if (['blink', 'edge'].includes($$1.engine) && (needle = iframe.parentNode, $$('#qr .captcha-container > div > div:first-of-type').includes(needle))) { + return $$1.on(iframe.parentNode, 'scroll', function () { return this.scrollTop = 0; }); + } + }, + + fixQRPosition() { + if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) { + QR.nodes.el.style.top = ''; + return QR.nodes.el.style.bottom = '0px'; + } + }, + + setupTextArea(textarea) { + return $$1.one(textarea, 'input', () => this.save(true)); + }, + + destroy() { + if (!this.isEnabled) { return; } + delete this.timeouts.destroy; + $$1.rmClass(QR.nodes.el, 'captcha-open'); + if (this.nodes.container) { + $$1.global(function () { + const container = document.querySelector('#qr .captcha-container'); + return window.grecaptcha.reset(container.dataset.widgetID); + }); + $$1.rm(this.nodes.container); + return delete this.nodes.container; + } + }, + + getOne(isReply) { + return Captcha.cache.getOne(isReply); + }, + + save(pasted, token) { + Captcha.cache.save({ + response: token || $$1('textarea', this.nodes.container).value, + timeout: Date.now() + this.lifetime + }); + + const focus = (d$1.activeElement?.nodeName === 'IFRAME') && /https?:\/\/www\.google\.com\/recaptcha\//.test(d$1.activeElement.src); + if (Captcha.cache.needed()) { + if (focus) { + if (QR.cooldown.auto || Conf['Post on Captcha Completion']) { + this.nodes.counter.focus(); + } else { + QR.nodes.status.focus(); + } + } + this.reload(); + } else { + if (pasted) { + this.destroy(); + } else { + if (this.timeouts.destroy == null) { this.timeouts.destroy = setTimeout(this.destroy.bind(this), 3 * SECOND); } + } + if (focus) { QR.nodes.status.focus(); } + } + + if (Conf['Post on Captcha Completion'] && !QR.cooldown.auto) { return QR.submit(); } + }, + + count() { + const count = Captcha.cache.getCount(); + const loading = Captcha.cache.submitCB ? '...' : ''; + this.nodes.counter.textContent = `Captchas: ${count}${loading}`; + return this.moreNeeded(); + }, + + reload() { + if ($$1('iframe[src^="https://www.google.com/recaptcha/api/fallback?"]', this.nodes.container)) { + this.destroy(); + return this.setup(false, true); + } else { + return $$1.global(function () { + const container = document.querySelector('#qr .captcha-container'); + return window.grecaptcha.reset(container.dataset.widgetID); + }); + } + }, + + occupied() { + return !!this.nodes.container && !this.timeouts.destroy; + } + } + }; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * DS202: Simplify dynamic range loops + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + + var QR = { + mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/vnd.adobe.flash.movie', 'application/x-shockwave-flash', 'video/webm'], + + validExtension: /\.(jpe?g|png|gif|pdf|swf|webm)$/i, + + typeFromExtension: { + 'jpg': 'image/jpeg', + 'jpeg': 'image/jpeg', + 'png': 'image/png', + 'gif': 'image/gif', + 'pdf': 'application/pdf', + 'swf': 'application/vnd.adobe.flash.movie', + 'webm': 'video/webm' + }, + + extensionFromType: { + 'image/jpeg': 'jpg', + 'image/png': 'png', + 'image/gif': 'gif', + 'application/pdf': 'pdf', + 'application/vnd.adobe.flash.movie': 'swf', + 'application/x-shockwave-flash': 'swf', + 'video/webm': 'webm' + }, + + init() { + let sc; + if (!Conf['Quick Reply']) { return; } + + this.posts = []; + + $$1.on(d$1, '4chanXInitFinished', () => BoardConfig.ready(QR.initReady)); + + Callbacks.Post.push({ + name: 'Quick Reply', + cb: this.node + }); + + this.shortcut = (sc = $$1.el('a', { + className: 'disabled', + textContent: '↩', + title: 'Quick Reply', + href: 'javascript:;' + } + )); + $$1.on(sc, 'click', function() { + if (!QR.postingIsEnabled) { return; } + if (Conf['Persistent QR'] || !QR.nodes || QR.nodes.el.hidden) { + QR.open(); + return QR.nodes.com.focus(); + } else { + return QR.close(); + } + }); + + return Header$1.addShortcut('qr', sc, 540); + }, + + initReady() { + let origToggle; + const captchaVersion = $$1('#g-recaptcha, #captcha-forced-noscript') ? 'v2' : 't'; + QR.captcha = Captcha[captchaVersion]; + QR.postingIsEnabled = true; + + const {config} = g.BOARD; + const prop = (key, def) => +(config[key] ?? def); + + QR.min_width = prop('min_image_width', 1); + QR.min_height = prop('min_image_height', 1); + QR.max_width = (QR.max_height = 10000); + + QR.max_size = prop('max_filesize', 4194304); + QR.max_size_video = prop('max_webm_filesize', QR.max_size); + QR.max_comment = prop('max_comment_chars', 2000); + + QR.max_width_video = (QR.max_height_video = 2048); + QR.max_duration_video = prop('max_webm_duration', 120); + + QR.forcedAnon = !!config.forced_anon; + QR.spoiler = !!config.spoilers; + + if (origToggle = $$1.id('togglePostFormLink')) { + const link = $$1.el('h1', + {className: "qr-link-container"}); + $$1.extend(link, { + innerHTML: + `${g.VIEW === "thread" ? "Reply to Thread" : "Start a Thread"}` + }); + + QR.link = link.firstElementChild; + $$1.on(link.firstChild, 'click', function() { + QR.open(); + return QR.nodes.com.focus(); + }); + + $$1.before(origToggle, link); + origToggle.firstElementChild.textContent = 'Original Form'; + } + + if (g.VIEW === 'thread') { + let navLinksBot; + const linkBot = $$1.el('div', + {className: "brackets-wrap qr-link-container-bottom"}); + $$1.extend(linkBot, {innerHTML: 'Reply to Thread'}); + + $$1.on(linkBot.firstElementChild, 'click', function() { + QR.open(); + return QR.nodes.com.focus(); + }); + + if (navLinksBot = $$1('.navLinksBot')) { $$1.prepend(navLinksBot, linkBot); } + } + + $$1.on(d$1, 'QRGetFile', QR.getFile); + $$1.on(d$1, 'QRDrawFile', QR.drawFile); + $$1.on(d$1, 'QRSetFile', QR.setFile); + + $$1.on(d$1, 'paste', QR.paste); + $$1.on(d$1, 'dragover', QR.dragOver); + $$1.on(d$1, 'drop', QR.dropFile); + $$1.on(d$1, 'dragstart dragend', QR.drag); + + $$1.on(d$1, 'IndexRefreshInternal', QR.generatePostableThreadsList); + $$1.on(d$1, 'ThreadUpdate', QR.statusCheck); + + if (!Conf['Persistent QR']) { return; } + QR.open(); + if (Conf['Auto Hide QR']) { return QR.hide(); } + }, + + statusCheck() { + if (!QR.nodes) { return; } + const {thread} = QR.posts[0]; + if ((thread !== 'new') && g.threads.get(`${g.BOARD}.${thread}`).isDead) { + return QR.abort(); + } else { + return QR.status(); + } + }, + + node() { + $$1.on(this.nodes.quote, 'click', QR.quote); + if (this.isFetchedQuote) { return QR.generatePostableThreadsList(); } + }, + + open() { + if (QR.nodes) { + if (QR.nodes.el.hidden) { QR.captcha.setup(); } + QR.nodes.el.hidden = false; + QR.unhide(); + } else { + try { + QR.dialog(); + } catch (err) { + delete QR.nodes; + Main$1.handleErrors({ + message: 'Quick Reply dialog creation crashed.', + error: err + }); + return; + } + } + return $$1.rmClass(QR.shortcut, 'disabled'); + }, + + close() { + if (QR.req) { + QR.abort(); + return; + } + QR.nodes.el.hidden = true; + QR.cleanNotifications(); + QR.blur(); + $$1.rmClass(QR.nodes.el, 'dump'); + $$1.addClass(QR.shortcut, 'disabled'); + new QR.post(true); + for (var post of QR.posts.splice(0, QR.posts.length - 1)) { + post.delete(); + } + QR.cooldown.auto = false; + QR.status(); + return QR.captcha.destroy(); + }, + + focus() { + return $$1.queueTask(function() { + if (!QR.inBubble()) { + QR.hasFocus = d$1.activeElement && QR.nodes.el.contains(d$1.activeElement); + return QR.nodes.el.classList.toggle('focus', QR.hasFocus); + } + }); + }, + + inBubble() { + const bubbles = $$('iframe[src^="https://www.google.com/recaptcha/api2/frame"]'); + return bubbles.includes(d$1.activeElement) || bubbles.some(el => (getComputedStyle(el).visibility !== 'hidden') && (el.getBoundingClientRect().bottom > 0)); + }, + + hide() { + QR.blur(); + $$1.addClass(QR.nodes.el, 'autohide'); + return QR.nodes.autohide.checked = true; + }, + + unhide() { + $$1.rmClass(QR.nodes.el, 'autohide'); + return QR.nodes.autohide.checked = false; + }, + + toggleHide() { + if (this.checked) { + return QR.hide(); + } else { + return QR.unhide(); + } + }, + + blur() { + if (QR.nodes.el.contains(d$1.activeElement)) { return d$1.activeElement.blur(); } + }, + + toggleSJIS(e) { + e.preventDefault(); + Conf['sjisPreview'] = !Conf['sjisPreview']; + $$1.set('sjisPreview', Conf['sjisPreview']); + return QR.nodes.el.classList.toggle('sjis-preview', Conf['sjisPreview']); + }, + + texPreviewShow() { + if ($$1.hasClass(QR.nodes.el, 'tex-preview')) { return QR.texPreviewHide(); } + $$1.addClass(QR.nodes.el, 'tex-preview'); + QR.nodes.texPreview.textContent = QR.nodes.com.value; + return $$1.event('mathjax', null, QR.nodes.texPreview); + }, + + texPreviewHide() { + return $$1.rmClass(QR.nodes.el, 'tex-preview'); + }, + + addPost() { + const wasOpen = (QR.nodes && !QR.nodes.el.hidden); + QR.open(); + if (wasOpen) { + $$1.addClass(QR.nodes.el, 'dump'); + new QR.post(true); + } + return QR.nodes.com.focus(); + }, + + setCustomCooldown(enabled) { + Conf['customCooldownEnabled'] = enabled; + QR.cooldown.customCooldown = enabled; + return QR.nodes.customCooldown.classList.toggle('disabled', !enabled); + }, + + toggleCustomCooldown() { + const enabled = $$1.hasClass(QR.nodes.customCooldown, 'disabled'); + QR.setCustomCooldown(enabled); + return $$1.set('customCooldownEnabled', enabled); + }, + + error(err, focusOverride) { + let el; + QR.open(); + if (typeof err === 'string') { + el = $$1.tn(err); + } else { + el = err; + el.removeAttribute('style'); + } + const notice = new Notice('warning', el); + QR.notifications.push(notice); + if (!Header$1.areNotificationsEnabled) { + if (d$1.hidden && !QR.cooldown.auto) { return alert(el.textContent); } + } else if (d$1.hidden || !(focusOverride || d$1.hasFocus())) { + const notif = new Notification(el.textContent, { + body: el.textContent, + icon: Favicon.logo + } + ); + notif.onclick = () => window.focus(); + if ($$1.engine !== 'gecko') { + // Firefox automatically closes notifications + // so we can't control the onclose properly. + notif.onclose = () => notice.close(); + return notif.onshow = () => setTimeout(function() { + notif.onclose = null; + return notif.close(); + } + , 7 * SECOND); + } + } + }, + + connectionError() { + return $$1.el('span', + { innerHTML: + 'Connection error while posting. ' + + '[More info]' + } + ); + }, + + notifications: [], + + cleanNotifications() { + for (var notification of QR.notifications) { + notification.close(); + } + return QR.notifications = []; + }, + + status() { + let disabled, value; + if (!QR.nodes) { return; } + const {thread} = QR.posts[0]; + if ((thread !== 'new') && g.threads.get(`${g.BOARD}.${thread}`).isDead) { + value = 'Dead'; + disabled = true; + QR.cooldown.auto = false; + } + + value = QR.req ? + QR.req.progress + : + QR.cooldown.seconds || value; + + const {status} = QR.nodes; + status.value = !value ? + 'Submit' + : QR.cooldown.auto ? + `Auto ${value}` + : + value; + return status.disabled = disabled || false; + }, + + openPost() { + QR.open(); + if (QR.selected.isLocked) { + const index = QR.posts.indexOf(QR.selected); + (QR.posts[index+1] || new QR.post()).select(); + $$1.addClass(QR.nodes.el, 'dump'); + return QR.cooldown.auto = true; + } + }, + + quote(e) { + let range; + e?.preventDefault(); + if (!QR.postingIsEnabled) { return; } + const sel = d$1.getSelection(); + const post = Get$1.postFromNode(this); + const {root} = post.nodes; + const postRange = new Range(); + postRange.selectNode(root); + let text = post.board.ID === g.BOARD.ID ? `>>${post}\n` : `>>>/${post.board}/${post}\n`; + for (let i = 0, end = sel.rangeCount, asc = 0 <= end; asc ? i < end : i > end; asc ? i++ : i--) { + try { + var insideCode, node; + range = sel.getRangeAt(i); + // Trim range to be fully inside post + if (range.compareBoundaryPoints(Range.START_TO_START, postRange) < 0) { + range.setStartBefore(root); + } + if (range.compareBoundaryPoints(Range.END_TO_END, postRange) > 0) { + range.setEndAfter(root); + } + + if (!range.toString().trim()) { continue; } + + var frag = range.cloneContents(); + var ancestor = range.commonAncestorContainer; + // Quoting the insides of a spoiler/code tag. + if ($$1.x('ancestor-or-self::*[self::s or contains(@class,"removed-spoiler")]', ancestor)) { + $$1.prepend(frag, $$1.tn('[spoiler]')); + $$1.add(frag, $$1.tn('[/spoiler]')); + } + if (insideCode = $$1.x('ancestor-or-self::pre[contains(@class,"prettyprint")]', ancestor)) { + $$1.prepend(frag, $$1.tn('[code]')); + $$1.add(frag, $$1.tn('[/code]')); + } + for (node of $$((insideCode ? 'br' : '.prettyprint br'), frag)) { + $$1.replace(node, $$1.tn('\n')); + } + for (node of $$('br', frag)) { + if (node !== frag.lastChild) { $$1.replace(node, $$1.tn('\n>')); } + } + g.SITE.insertTags?.(frag); + for (node of $$('.linkify[data-original]', frag)) { + $$1.replace(node, $$1.tn(node.dataset.original)); + } + for (node of $$('.embedder', frag)) { + if (node.previousSibling?.nodeValue === ' ') { $$1.rm(node.previousSibling); } + $$1.rm(node); + } + text += `>${frag.textContent.trim()}\n`; + } catch (error) { } + } + + QR.openPost(); + const {com, thread} = QR.nodes; + if (!com.value) { thread.value = Get$1.threadFromNode(this); } + + const wasOnlyQuotes = QR.selected.isOnlyQuotes(); + + const caretPos = com.selectionStart; + // Replace selection for text. + com.value = com.value.slice(0, caretPos) + text + com.value.slice(com.selectionEnd); + // Move the caret to the end of the new quote. + range = caretPos + text.length; + com.setSelectionRange(range, range); + com.focus(); + + // This allows us to determine if any text other than quotes has been typed. + if (wasOnlyQuotes) { QR.selected.quotedText = com.value; } + + QR.selected.save(com); + return QR.selected.save(thread); + }, + + characterCount() { + const counter = QR.nodes.charCount; + const count = QR.nodes.com.value.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, '_').length; + counter.textContent = count; + counter.hidden = count < (QR.max_comment/2); + return (count > QR.max_comment ? $$1.addClass : $$1.rmClass)(counter, 'warning'); + }, + + getFile() { + return $$1.event('QRFile', QR.selected?.file); + }, + + drawFile(e) { + const file = QR.selected?.file; + if (!file || !/^(image|video)\//.test(file.type)) { return; } + const isVideo = /^video\//.test(file); + const el = $$1.el((isVideo ? 'video' : 'img')); + $$1.on(el, 'error', () => QR.openError()); + $$1.on(el, (isVideo ? 'loadeddata' : 'load'), function() { + e.target.getContext('2d').drawImage(el, 0, 0); + URL.revokeObjectURL(el.src); + return $$1.event('QRImageDrawn', null, e.target); + }); + return el.src = URL.createObjectURL(file); + }, + + openError() { + const div = $$1.el('div'); + $$1.extend(div, { + innerHTML: + 'Could not open file. [More info]' + }); + return QR.error(div); + }, + + setFile(e) { + const {file, name, source} = e.detail; + if (name != null) { file.name = name; } + if (source != null) { file.source = source; } + QR.open(); + return QR.handleFiles([file]); + }, + + drag(e) { + // Let it drag anything from the page. + const toggle = e.type === 'dragstart' ? $$1.off : $$1.on; + toggle(d$1, 'dragover', QR.dragOver); + return toggle(d$1, 'drop', QR.dropFile); + }, + + dragOver(e) { + e.preventDefault(); + return e.dataTransfer.dropEffect = 'copy'; + }, // cursor feedback + + dropFile(e) { + // Let it only handle files from the desktop. + if (!e.dataTransfer.files.length) { return; } + e.preventDefault(); + QR.open(); + return QR.handleFiles(e.dataTransfer.files); + }, + + paste(e) { + if (!e.clipboardData.items) { return; } + let file = null; + let score = -1; + for (var item of e.clipboardData.items) { + var file2; + if ((item.kind === 'file') && (file2 = item.getAsFile())) { + var score2 = (2*(file2.size <= QR.max_size)) + (file2.type === 'image/png'); + if (score2 > score) { + file = file2; + score = score2; + } + } + } + if (file) { + const {type} = file; + const blob = new Blob([file], {type}); + blob.name = `${Conf['pastedname']}.${$$1.getOwn(QR.extensionFromType, type) || 'jpg'}`; + QR.open(); + QR.handleFiles([blob]); + $$1.addClass(QR.nodes.el, 'dump'); + } + }, + + pasteFF() { + const {pasteArea} = QR.nodes; + if (!pasteArea.childNodes.length) { return; } + const images = $$('img', pasteArea); + $$1.rmAll(pasteArea); + for (var img of images) { + var m; + var {src} = img; + if (m = src.match(/data:(image\/(\w+));base64,(.+)/)) { + var bstr = atob(m[3]); + var arr = new Uint8Array(bstr.length); + for (var i = 0, end = bstr.length, asc = 0 <= end; asc ? i < end : i > end; asc ? i++ : i--) { + arr[i] = bstr.charCodeAt(i); + } + var blob = new Blob([arr], {type: m[1]}); + blob.name = `${Conf['pastedname']}.${m[2]}`; + QR.handleFiles([blob]); + } else if (/^https?:\/\//.test(src)) { + QR.handleUrl(src); + } + } + }, + + handleUrl(urlDefault) { + QR.open(); + QR.selected.preventAutoPost(); + return CrossOrigin$1.permission(function() { + const url = prompt('Enter a URL:', urlDefault); + if (url === null) { return; } + QR.nodes.fileButton.focus(); + return CrossOrigin$1.file(url, function(blob) { + if (blob && !/^text\//.test(blob.type)) { + return QR.handleFiles([blob]); + } else { + return QR.error("Can't load file."); + } + }); + }); + }, + + handleFiles(files) { + if (this !== QR) { // file input + files = [...Array.from(this.files)]; + this.value = null; + } + if (!files.length) { return; } + QR.cleanNotifications(); + for (var file of files) { + QR.handleFile(file, files.length); + } + if (files.length !== 1) { $$1.addClass(QR.nodes.el, 'dump'); } + if ((d$1.activeElement === QR.nodes.fileButton) && $$1.hasClass(QR.nodes.fileSubmit, 'has-file')) { + return QR.nodes.filename.focus(); + } + }, + + handleFile(file, nfiles) { + let post; + const isText = /^text\//.test(file.type); + if (nfiles === 1) { + post = QR.selected; + } else { + post = QR.posts[QR.posts.length - 1]; + if (isText ? post.com || post.pasting : post.file) { + post = new QR.post(); + } + } + return post[isText ? 'pasteText' : 'setFile'](file); + }, + + openFileInput() { + if (QR.nodes.fileButton.disabled) { return; } + QR.nodes.fileInput.click(); + return QR.nodes.fileButton.focus(); + }, + + generatePostableThreadsList() { + if (!QR.nodes) { return; } + const list = QR.nodes.thread; + const options = [list.firstElementChild]; + for (var thread of g.BOARD.threads.keys) { + options.push($$1.el('option', { + value: thread, + textContent: `Thread ${thread}` + } + ) + ); + } + const val = list.value; + $$1.rmAll(list); + $$1.add(list, options); + list.value = val; + if (list.value === val) { return; } + // Fix the value if the option disappeared. + list.value = g.VIEW === 'thread' ? + g.THREADID + : + 'new'; + return (g.VIEW === 'thread' ? $$1.addClass : $$1.rmClass)(QR.nodes.el, 'reply-to-thread'); + }, + + dialog() { + let dialog, event, nodes; + let name; + QR.nodes = (nodes = { + el: (dialog = UI.dialog('qr', + { innerHTML: QuickReplyPage })) + }); + + const setNode = (name, query) => nodes[name] = $$1(query, dialog); + + setNode('move', '.move'); + setNode('autohide', '#autohide'); + setNode('close', '.close'); + setNode('thread', 'select'); + setNode('form', 'form'); + setNode('sjisToggle', '#sjis-toggle'); + setNode('texButton', '#tex-preview-button'); + setNode('name', '[data-name=name]'); + setNode('email', '[data-name=email]'); + setNode('sub', '[data-name=sub]'); + setNode('com', '[data-name=com]'); + setNode('charCount', '#char-count'); + setNode('texPreview', '#tex-preview'); + setNode('dumpList', '#dump-list'); + setNode('addPost', '#add-post'); + setNode('oekaki', '.oekaki'); + setNode('drawButton', '#qr-draw-button'); + setNode('fileSubmit', '#file-n-submit'); + setNode('fileButton', '#qr-file-button'); + setNode('noFile', '#qr-no-file'); + setNode('filename', '#qr-filename'); + setNode('spoiler', '#qr-file-spoiler'); + setNode('oekakiButton', '#qr-oekaki-button'); + setNode('fileRM', '#qr-filerm'); + setNode('urlButton', '#url-button'); + setNode('pasteArea', '#paste-area'); + setNode('customCooldown', '#custom-cooldown-button'); + setNode('dumpButton', '#dump-button'); + setNode('status', '[type=submit]'); + setNode('flashTag', '[name=filetag]'); + setNode('fileInput', '[type=file]'); + + const {config} = g.BOARD; + const {classList} = QR.nodes.el; + classList.toggle('forced-anon', QR.forcedAnon); + classList.toggle('has-spoiler', QR.spoiler); + classList.toggle('has-sjis', !!config.sjis_tags); + classList.toggle('has-math', !!config.math_tags); + classList.toggle('sjis-preview', !!config.sjis_tags && Conf['sjisPreview']); + classList.toggle('show-new-thread-option', Conf['Show New Thread Option in Threads']); + + if (parseInt(Conf['customCooldown'], 10) > 0) { + $$1.addClass(QR.nodes.fileSubmit, 'custom-cooldown'); + $$1.get('customCooldownEnabled', Conf['customCooldownEnabled'], function({customCooldownEnabled}) { + QR.setCustomCooldown(customCooldownEnabled); + return $$1.sync('customCooldownEnabled', QR.setCustomCooldown); + }); + } + + QR.flagsInput(); + + $$1.on(nodes.autohide, 'change', QR.toggleHide); + $$1.on(nodes.close, 'click', QR.close); + $$1.on(nodes.status, 'click', QR.submit); + $$1.on(nodes.form, 'submit', QR.submit); + $$1.on(nodes.sjisToggle, 'click', QR.toggleSJIS); + $$1.on(nodes.texButton, 'mousedown', QR.texPreviewShow); + $$1.on(nodes.texButton, 'mouseup', QR.texPreviewHide); + $$1.on(nodes.addPost, 'click', () => new QR.post(true)); + $$1.on(nodes.drawButton, 'click', QR.oekaki.draw); + $$1.on(nodes.fileButton, 'click', QR.openFileInput); + $$1.on(nodes.noFile, 'click', QR.openFileInput); + $$1.on(nodes.filename, 'focus', function() { return $$1.addClass(this.parentNode, 'focus'); }); + $$1.on(nodes.filename, 'blur', function() { return $$1.rmClass(this.parentNode, 'focus'); }); + $$1.on(nodes.spoiler, 'change', () => QR.selected.nodes.spoiler.click()); + $$1.on(nodes.oekakiButton, 'click', QR.oekaki.button); + $$1.on(nodes.fileRM, 'click', () => QR.selected.rmFile()); + $$1.on(nodes.urlButton, 'click', () => QR.handleUrl('')); + $$1.on(nodes.customCooldown, 'click', QR.toggleCustomCooldown); + $$1.on(nodes.dumpButton, 'click', () => nodes.el.classList.toggle('dump')); + $$1.on(nodes.fileInput, 'change', QR.handleFiles); + + window.addEventListener('focus', QR.focus, true); + window.addEventListener('blur', QR.focus, true); + // We don't receive blur events from captcha iframe. + $$1.on(d$1, 'click', QR.focus); + + // XXX Workaround for image pasting in Firefox, obsolete as of v50. + // https://bugzilla.mozilla.org/show_bug.cgi?id=906420 + if (($$1.engine === 'gecko') && !window.DataTransferItemList) { + nodes.pasteArea.hidden = false; + } + new MutationObserver(QR.pasteFF).observe(nodes.pasteArea, {childList: true}); + + // save selected post's data + const items = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'flag']; + let i = 0; + const save = function() { return QR.selected.save(this); }; + while ((name = items[i++])) { + var node; + if (!(node = nodes[name])) { continue; } + event = node.nodeName === 'SELECT' ? 'change' : 'input'; + $$1.on(nodes[name], event, save); + } + + // XXX Blink and WebKit treat width and height of \n\n'}),s=He("#archive-report-enabled",r),l=He("#archive-report-reason",r),d=He("#archive-report-submit",r);if(He.on(s,"change",(function(){return l.disabled=!this.checked})),o&&a?(r.hidden=!He('[value="31"]',a).checked,He.on(a,"change",(function(e){return r.hidden="31"!==e.target.value,xe.fit("body")})),He.after(a,r),xe.fit("body"),He.one(o,"submit",(function(e){if(!r.hidden&&s.checked)return e.preventDefault(),xe.archiveSubmit(t,l.value,(e=>(this.action="#archiveresults="+encodeURIComponent(JSON.stringify(e)), +this.submit())))}))):i&&(r.hidden=/Report submitted!/.test(i.textContent),He.on(s,"change",(function(){return d.hidden=!this.checked})),He.after(i,r),He.on(d,"click",(()=>xe.archiveSubmit(t,l.value,xe.archiveResults)))),e=location.hash.match(/^#archiveresults=(.*)$/))try{return xe.archiveResults(JSON.parse(decodeURIComponent(e[1])))}catch(e){}},archiveSubmit(e,t,o){const a=He.formData({board:n.BOARD.ID,num:xe.postID,reason:t}),i=[];for(var[r,s]of e)!function(t,n){He.ajax(n,{onloadend(){if(i.push([t,this.response||{error:""}]),i.length===e.length)return o(i)},form:a})}(r,s)},archiveResults(e){const t=He.id("archive-report");for(var[n,o]of e){var i=He.el("h3",{className:"archive-report-response"});"success"in o?(He.addClass(i,"archive-report-success"),i.textContent=`${n}: ${o.success}`):(He.addClass(i,"archive-report-error"),i.textContent=`${n}: ${o.error||"Error reporting post."}`),t?He.before(t,i):He.add(a.body,i)}}};const ye={init(){ +if(t["Remember Your Posts"])return He.ready(this.ready)},ready(){if("Post successful!"!==a.title)return;let[e,t,o]=Array.from(He("h1").nextSibling.textContent.match(/thread:(\d+),no:(\d+)/));o=+o,t=+t||o;return new y("yourPosts").set({boardID:n.BOARD.ID,threadID:t,postID:o,val:!0})}};const ke={isOPContainerThread:!1,hasIPCount:!0,archivedBoardsKnown:!0,urls:{thread:({boardID:e,threadID:t})=>`${location.protocol}//${G.domain(e)}/${e}/thread/${t}`,post:({postID:e})=>`#p${e}`,index:({boardID:e})=>`${location.protocol}//${G.domain(e)}/${e}/`,catalog:({boardID:e})=>"f"===e?void 0:`${location.protocol}//${G.domain(e)}/${e}/catalog`,archive:({boardID:e})=>G.isArchived(e)?`${location.protocol}//${G.domain(e)}/${e}/archive`:void 0,threadJSON:({boardID:e,threadID:t})=>`${location.protocol}//a.4cdn.org/${e}/thread/${t}.json`,threadsListJSON:({boardID:e})=>`${location.protocol}//a.4cdn.org/${e}/threads.json`, +archiveListJSON:({boardID:e})=>G.isArchived(e)?`${location.protocol}//a.4cdn.org/${e}/archive.json`:"",catalogJSON:({boardID:e})=>`${location.protocol}//a.4cdn.org/${e}/catalog.json`,file({boardID:e},t){const n="f"===e?O.flashHost():O.host();return`${location.protocol}//${n}/${e}/${t}`},thumb:({boardID:e},t)=>`${location.protocol}//${O.thumbHost()}/${e}/${t}`},isPrunedByAge:({boardID:e})=>"f"===e,areMD5sDeferred:({boardID:e})=>"f"===e,isOnePage:({boardID:e})=>"f"===e,noAudio:({boardID:e})=>G.noAudio(e),selectors:{board:".board",thread:".thread",threadDivider:".board > hr",summary:".summary",postContainer:".postContainer",replyOriginal:".replyContainer:not([data-clone])",sideArrows:"div.sideArrows",post:".post",infoRoot:".postInfo",info:{subject:".subject",name:".name",email:".useremail",tripcode:".postertrip",uniqueIDRoot:".posteruid",uniqueID:".posteruid > .hand",capcode:".capcode.hand",pass:".n-pu",flag:".flag, .bfl",date:".dateTime",nameBlock:".nameBlock", +quote:".postNum > a:nth-of-type(2)",reply:".replylink"},icons:{isSticky:".stickyIcon",isClosed:".closedIcon",isArchived:".archivedIcon"},file:{text:".file > :first-child",link:".fileText > a",thumb:"a.fileThumb > [data-md5]"},thumbLink:"a.fileThumb",highlightable:{op:".opContainer",reply:" > .reply",catalog:""},comment:".postMessage",spoiler:"s",quotelink:":not(pre) > .quotelink",catalog:{board:"#threads",thread:".thread",thumb:".thumb"},boardList:"#boardNavDesktop > .boardList",boardListBottom:"#boardNavDesktopFoot > .boardList",styleSheet:"link[title=switch]",psa:"#globalMessage",psaTop:"#globalToggle",searchBox:"#search-box",nav:{prev:".prev > form > [type=submit]",next:".next > form > [type=submit]"}},classes:{highlight:"highlight"},xpath:{thread:'div[contains(concat(" ",@class," ")," thread ")]',postContainer:'div[contains(@class,"postContainer")]',replyContainer:'div[contains(@class,"replyContainer")]'},regexp:{ +quotelink:new RegExp("^https?://boards\\.4chan(?:nel)?\\.org/+([^/]+)/+thread/+(\\d+)(?:[/?][^#]*)?(?:#p(\\d+))?$"),quotelinkHTML:/]*\bhref="(?:(?:\/\/boards\.4chan(?:nel)?\.org)?\/([^\/]+)\/thread\/)?(\d+)?(?:#p(\d+))?"/g,pass:/^https?:\/\/www\.4chan(?:nel)?\.org\/+pass(?:$|[?#])/,captcha:/^https?:\/\/sys\.4chan(?:nel)?\.org\/+captcha(?:$|[?#])/},bgColoredEl:()=>He.el("div",{className:"reply"}),isThisPageLegit:()=>["boards.4chan.org","boards.4channel.org"].includes(location.hostname)&&a.doctype&&!He('link[href*="favicon-status.ico"]',a.head)&&!["4chan - Temporarily Offline","4chan - Error","504 Gateway Time-out","MathJax Equation Source"].includes(a.title),is404:()=>["4chan - Temporarily Offline","4chan - 404 Not Found"].includes(a.title)||"thread"===n.VIEW&&He(".board")&&!He(".opContainer"),isIncomplete:()=>["index","thread"].includes(n.VIEW)&&!He(".board + *"),isBoardlessPage:e=>["www.4chan.org","www.4channel.org"].includes(e.hostname), +isAuxiliaryPage:e=>!["boards.4chan.org","boards.4channel.org"].includes(e.hostname),isFileURL:e=>O.test(e.hostname),initAuxiliary(){switch(location.hostname){case"www.4chan.org":case"www.4channel.org":return void(ke.regexp.pass.test(location.href)?we.init():(He.onExists(i,"body",(()=>He.addStyle(fe.www))),Le.replace.init()));case"sys.4chan.org":case"sys.4channel.org":var e=location.pathname.split(/\/+/);if("imgboard.php"===e[2]){let e;/\bmode=report\b/.test(location.search)?xe.init():(e=location.search.match(/\bres=(\d+)/))&&He.ready((function(){if(t["404 Redirect"]&&"Error: Specified thread does not exist."===He.id("errmsg")?.textContent)return _e.navigate("thread",{boardID:n.BOARD.ID,postID:+e[1]})}))}else"post"===e[2]&&ye.init();return}},scriptData(){for(var e of u("script:not([src])",a.head))if(/\bcooldowns *=/.test(e.textContent))return e.textContent;return""},parseThreadMetadata(e){let t;const o=this.scriptData();if(e.postLimit=/\bbumplimit *= *1\b/.test(o), +e.fileLimit=/\bimagelimit *= *1\b/.test(o),e.ipCount=(t=o.match(/\bunique_ips *= *(\d+)\b/))?+t[1]:void 0,"f"===n.BOARD.ID&&e.OP.file){const{file:t}=e.OP;return He.ajax(this.urls.threadJSON({boardID:"f",threadID:e.ID}),{timeout:A,onloadend(){if(this.response)return t.text.dataset.md5=t.MD5=this.response.posts[0].md5}})}},parseNodes(e,t){if("f"===e.boardID)return(()=>{const e=[];for(var n of["Sticky","Closed"]){var o;(o=He(`img[alt=${n}]`,t.info))&&e.push(He.addClass(o,`${n.toLowerCase()}Icon`,"retina"))}return e})()},parseDate:e=>new Date(1e3*e.dataset.utc),parseFile(e,t){let n;const{text:o,link:a,thumb:i}=t;if(!(n=a.nextSibling?.textContent.match(/\(([\d.]+ [KMG]?B).*\)/)))return!1;if(He.extend(t,{name:o.title||a.title||a.textContent,size:n[1],dimensions:n[0].match(/\d+x\d+/)?.[0],tag:n[0].match(/,[^,]*, ([a-z]+)\)/i)?.[1],MD5:o.dataset.md5}),i&&(He.extend(t,{thumbURL:i.src,MD5:i.dataset.md5,isSpoiler:He.hasClass(i.parentNode,"imgspoiler")}),t.isSpoiler)){let n +;t.thumbURL=(n=a.href.match(/\d+(?=\.\w+$)/))?`${location.protocol}//${O.thumbHost()}/${e.board}/${n[0]}s.jpg`:void 0}return!0},cleanComment(e){let t;if(t=He(".abbr",e)){for(var n of u(".abbr + br, .exif",e))He.rm(n);for(let e=0;e<2;e++){var o;(o=t.previousSibling)&&"BR"===o.nodeName&&He.rm(o)}return He.rm(t)}},cleanCommentDisplay(e){let t;return(t=He("b",e))&&/^Rolled /.test(t.textContent)&&He.rm(t),He.rm(He(".fortune",e))},insertTags(e){let t;for(t of u("s, .removed-spoiler",e))He.replace(t,[He.tn("[spoiler]"),...Array.from(t.childNodes),He.tn("[/spoiler]")]);for(t of u(".prettyprint",e))He.replace(t,[He.tn("[code]"),...Array.from(t.childNodes),He.tn("[/code]")])},hasCORS:e=>e.split("/").slice(0,3).join("/")===location.protocol+"//a.4cdn.org",sfwBoards:e=>G.sfwBoards(e),uidColor(e){let t=0,n=0;for(;n<8;)t=(t<<5)-t+e.charCodeAt(n++);return t>>8&16777215},isLinkified:e=>O.test(e.hostname),testNativeExtension:()=>He.global((function(){ +if(window.Parser?.postMenuIcon)return this.enabled="true"})),transformBoardList(){let e;const t=[],n=()=>He.el("span",{className:"spacer"}),o=He.X(".//a|.//text()[not(ancestor::a)]",He(ke.selectors.boardList));let a=0;for(;e=o.snapshotItem(a++);)switch(e.nodeName){case"#text":for(var i of e.nodeValue){var r=He.el("span",{textContent:i});" "===i&&(r.className="space"),"]"===i&&t.push(n()),t.push(r),"["===i&&t.push(n())}break;case"A":var s=e.cloneNode(!0);t.push(s)}return t},Build:{staticPath:"//s.4cdn.org/image/",gifIcon:window.devicePixelRatio>=2?"@2x.gif":".gif",spoilerRange:Object.create(null),shortFilename(e){const t=e.match(/\.?[^\.]*$/)[0];return e.length-t.length>30?`${e.match(/(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[^]){0,25}/)[0]}(...)${t}`:e},spoilerThumb(e){let t;return(t=this.spoilerRange[e])?`${this.staticPath}spoiler-${e}${Math.floor(1+t*Math.random())}.png`:`${this.staticPath}spoiler.png`},sameThread:(e,t)=>"thread"===n.VIEW&&n.BOARD.ID===e&&n.THREADID===+t, +threadURL:(e,t)=>e!==n.BOARD.ID?`//${G.domain(e)}/${e}/thread/${t}`:"thread"!==n.VIEW||+t!==n.THREADID?`/${e}/thread/${t}`:"",postURL(e,t,n){return`${this.threadURL(e,t)}#p${n}`},parseJSON(e,{siteID:t,boardID:n}){const o={ID:e.no,postID:e.no,threadID:e.resto||e.no,boardID:n,siteID:t,isReply:!!e.resto,isSticky:!!e.sticky,isClosed:!!e.closed,isArchived:!!e.archived,fileDeleted:!!e.filedeleted,filesDeleted:e.filedeleted?[0]:[]};for(var a in o.info={subject:He.unescape(e.sub),email:He.unescape(e.email),name:He.unescape(e.name)||"",tripcode:e.trip,pass:null!=e.since4pass?`${e.since4pass}`:void 0,uniqueID:e.id,flagCode:e.country,flagCodeTroll:e.board_flag,flag:He.unescape(e.country_name||e.flag_name),dateUTC:e.time,dateText:e.now,commentHTML:{innerHTML:e.com||"",[de]:!0}},e.capcode&&(o.info.capcode=e.capcode.replace(/_highlight$/,"").replace(/_/g," ").replace(/\b\w/g,(e=>e.toUpperCase())),o.capcodeHighlight=/_highlight$/.test(e.capcode),delete o.info.uniqueID),o.files=[], +e.ext&&(o.file=this.parseJSONFile(e,{siteID:t,boardID:n}),o.files.push(o.file)),o.extra=m(),e)"x"===a[0]&&(o.extra[a]=e[a]);return o},parseJSONFile(e,{siteID:t,boardID:o}){const a=n.sites[t],i="yotsuba"===a.software&&"f"===o?`${encodeURIComponent(e.filename)}${e.ext}`:`${e.tim}${e.ext}`,r={name:He.unescape(e.filename)+e.ext,url:a.urls.file({siteID:t,boardID:o},i),height:e.h,width:e.w,MD5:e.md5,size:He.bytesToString(e.fsize),thumbURL:a.urls.thumb({siteID:t,boardID:o},`${e.tim}s.jpg`),theight:e.tn_h,twidth:e.tn_w,isSpoiler:!!e.spoiler,tag:e.tag,hasDownscale:!!e.m_img};return null==e.h||/\.pdf$/.test(r.url)||(r.dimensions=`${r.width}x${r.height}`),r},parseComment:e=>(e=e.replace(//gi,"\n").replace(/\n\n]*>/g,""),He.unescape(e)),parseCommentDisplay(e){if(!t["Remove Spoilers"]&&!t["Reveal Spoilers"]){let t;for(;(t=e.replace(/(?:(?!<\/?s>).)*<\/s>/g,"[spoiler]"))!==e;)e=t} +return e=e.replace(/^Rolled [^<]*<\/b>/i,"").replace(/>"):"",ue("div",{id:`p${t}`,class:`post ${P}${e.capcodeHighlight?" highlightPost":""}`},e.isReply?ue(he,null,D,B):ue(he,null,B,D),ue("blockquote",{class:"postMessage",id:`m${t}`},v))),N=He.el("div",{className:`postContainer ${P}Container`,id:`pc${t}`});for(var F of(He.extend(N,M),u(".quotelink",N))){var L,O=F.getAttribute("href");if("#"===O[0])this.sameThread(a,o)||(F.href=this.threadURL(a,o)+O);else(L=F.href.match(ke.regexp.quotelink))&&this.sameThread(L[1],L[2])&&(F.href=O.match(/(#[^#]*)?$/)[0]||"#")}return N},summaryText(e,t,n){let o="";return e&&(o+=`${e} `),o+=`${t} post${t>1?"s":""}`,+n&&(o+=` and ${n} image repl${n>1?"ies":"y"}`),o+` ${"-"===e?"shown":"omitted"}.`},summary(e,t,n,o){return He.el("a",{className:"summary", +textContent:this.summaryText("",n,o),href:`/${e}/thread/${t}`})},thread(e,t,n){let o;if((o=e.nodes.root)?He.rmAll(o):e.nodes.root=o=He.el("div",{className:"thread",id:`t${t.no}`}),this.hat&&He.add(o,this.hat.cloneNode(!1)),He.add(o,e.OP.nodes.root),t.omitted_posts||!n&&t.replies){const[a,i]=Array.from(n?[t.omitted_posts,t.images-t.last_replies.filter((e=>!!e.ext)).length]:[t.replies,t.images]),r=this.summary(e.board.ID,t.no,a,i);He.add(o,r)}return o},catalogThread(e,n,o){let a,i,r;const{staticPath:s,gifIcon:l}=this,{tn_w:d,tn_h:c}=n;if(n.spoiler&&!t["Reveal Spoiler Thumbnails"]){let t;r=`${s}spoiler`,(t=this.spoilerRange[e.board])&&(r+=`-${e.board}`+Math.floor(1+t*Math.random())),r+=".png",i="spoiler-file",a="--tn-w: 100; --tn-h: 100;"}else if(n.filedeleted)r=`${s}filedeleted-res${l}`,i="deleted-file";else if(e.OP.file){r=e.OP.file.thumbURL;const t=250/Math.max(d,c);a=`--tn-w: ${d*t}; --tn-h: ${c*t};`}else r=`${s}nofile.png`,i="no-file" +;const h=n.replies+1,p=n.images+!!n.ext,g=He.el("div",function(e,t,n,o,a,i,r,s,l){return ue(he,null,ue("a",{class:"catalog-link",href:`/${e.board}/thread/${e.ID}`},ue("img",n?{src:t,class:`catalog-thumb ${n}`}:{src:t,class:"catalog-thumb","data-width":o.tn_w,"data-height":o.tn_h})),ue("div",{class:"catalog-stats"},ue("span",{title:"Posts / Files / Page"},ue("span",{class:"post-count"+(o.bumplimit?" warning":"")},a)," / ",ue("span",{class:"file-count"+(o.imagelimit?" warning":"")},i)," / ",ue("span",{class:"page-count"},r)),ue("span",{class:"catalog-icons"},e.isSticky?ue("img",{src:`${s}sticky${l}`,class:"stickyIcon",title:"Sticky"}):"",e.isClosed?ue("img",{src:`${s}closed${l}`,class:"closedIcon",title:"Closed"}):"")))}(e,r,i,n,h,p,o,s,l));for(var f of(He.before(e.OP.nodes.info,[...Array.from(g.childNodes)]),u("br",e.OP.nodes.comment)))f.previousSibling&&"BR"===f.previousSibling.nodeName&&He.addClass(f,"extra-linebreak");const m=He.el("div",{className:"thread catalog-thread",id:`t${e}` +});return e.OP.highlights&&He.addClass(m,...Array.from(e.OP.highlights)),e.OP.file||He.addClass(m,"noFile"),m.style.cssText=a||"",m},catalogReply(e,t){let n="";t.com&&(n=this.parseCommentDisplay(t.com).replace(/>>\d+/g,"").trim().replace(/\n+/g," // ")),t.ext&&(n||(n=`${He.unescape(t.filename)}${t.ext}`)),t.com&&(n||(n=He.unescape(t.com.replace(//gi," // ")))),n||(n=" "),n.length>73&&(n=`${n.slice(0,70)}...`);const o=this.postURL(e.board.ID,e.ID,t.no);return He.el("div",{className:"catalog-reply"},ue(he,null,ue("span",null,ue("time",{"data-utc":1e3*t.time,"data-abbrev":"1"},"..."),": "),ue("a",{class:"catalog-reply-excerpt",href:o},n),ue("a",{class:"catalog-reply-preview",href:o},"...")))}}},Ie={tinyboard:Ae,yotsuba:ke};var Ce={init(){if(["index","thread","archive"].includes(n.VIEW)&&t["File Info Formatting"])return l.Post.push({name:"File Info Formatting",cb:this.node})},node(){if(!this.file)return;if(this.isClone){let e +;for(e of u(".file-info .download-button",this.file.text))He.on(e,"click",j.download);for(e of u(".file-info .quick-filter-md5",this.file.text))He.on(e,"click",ze.quickFilterMD5);return}const e=He.el("span",{className:"fileText-original"});He.prepend(this.file.link.parentNode,e),He.add(e,[this.file.link.previousSibling,this.file.link,this.file.link.nextSibling]);const n=He.el("span",{className:"file-info"});return Ce.format(t.fileInfo,this,n),He.prepend(this.file.text,n)},format(e,t,n){let a;const i=[];for(a of(e.replace(/%(.)|[^%]+/g,(function(e,n){return i.push(He.hasOwn(Ce.formatters,n)?Ce.formatters[n].call(t):{innerHTML:o(e)}),""})),He.extend(n,{innerHTML:o.cat(i)}),u(".download-button",n)))He.on(a,"click",j.download);for(a of u(".quick-filter-md5",n))He.on(a,"click",ze.quickFilterMD5)},formatters:{t(){return{innerHTML:o(this.file.url.match(/[^/]*$/)[0]),[de]:!0}},T(){return ue("a",{href:this.file.url,target:"_blank"},Ce.formatters.t.call(this))},l(){return ue("a",{ +href:this.file.url,target:"_blank"},Ce.formatters.n.call(this))},L(){return ue("a",{href:this.file.url,target:"_blank"},Ce.formatters.N.call(this))},n(){const e=this.file.name,t=Ie.yotsuba.Build.shortFilename(this.file.name,this.isReply);return e===t?{innerHTML:o(e),[de]:!0}:ue("span",{class:"fnswitch"},ue("span",{class:"fntrunc"},t),ue("span",{class:"fnfull"},e))},N(){return{innerHTML:o(this.file.name),[de]:!0}},d(){return ue("a",{href:this.file.url,download:this.file.name,class:"download-button"},"📥︎")},f:()=>({innerHTML:'',[de]:!0}),p(){return{innerHTML:this.file.isSpoiler?"Spoiler, ":"",[de]:!0}},s(){return{innerHTML:o(this.file.size),[de]:!0}},B(){return{innerHTML:Math.round(this.file.sizeInBytes)+" Bytes",[de]:!0}},K(){return{innerHTML:Math.round(this.file.sizeInBytes/1024)+" KB",[de]:!0}},M(){return{innerHTML:Math.round(this.file.sizeInBytes/1048576*100)/100+" MB",[de]:!0}},r(){return{innerHTML:o(this.file.dimensions||"PDF"), +[de]:!0}},g(){return{innerHTML:this.file.tag?", "+o(this.file.tag):"",[de]:!0}},"%":()=>({innerHTML:"%",[de]:!0})}},De={init(){if(["index","thread","archive"].includes(n.VIEW)&&t["Time Formatting"])return l.Post.push({name:"Time Formatting",cb:this.node})},node(){if(!this.info.date||this.isClone)return;const{textContent:e}=this.nodes.date;return this.nodes.date.textContent=e.match(/^\s*/)[0]+De.format(t.time,this.info.date)+e.match(/\s*$/)[0]},format:(e,t)=>e.replace(/%(.)/g,(function(e,n){return He.hasOwn(De.formatters,n)?De.formatters[n].call(t):e})),day:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],month:["January","February","March","April","May","June","July","August","September","October","November","December"],localeFormat(e,n,o){if(t.timeLocale)try{return Intl.DateTimeFormat(t.timeLocale,n).format(e)}catch(e){}return o},localeFormatPart(e,n,o,a){if(t.timeLocale)try{return Intl.DateTimeFormat(t.timeLocale,n).formatToParts(e).map((function(e){ +return e.type===o?e.value:""})).join("")}catch(e){}return a},zeroPad:e=>e<10?`0${e}`:e,formatters:{a(){return De.localeFormat(this,{weekday:"short"},De.day[this.getDay()].slice(0,3))},A(){return De.localeFormat(this,{weekday:"long"},De.day[this.getDay()])},b(){return De.localeFormat(this,{month:"short"},De.month[this.getMonth()].slice(0,3))},B(){return De.localeFormat(this,{month:"long"},De.month[this.getMonth()])},d(){return De.zeroPad(this.getDate())},e(){return this.getDate()},H(){return De.zeroPad(this.getHours())},I(){return De.zeroPad(this.getHours()%12||12)},k(){return this.getHours()},l(){return this.getHours()%12||12},m(){return De.zeroPad(this.getMonth()+1)},M(){return De.zeroPad(this.getMinutes())},p(){return De.localeFormatPart(this,{hour:"numeric",hour12:!0},"dayperiod",this.getHours()<12?"AM":"PM")},P(){return De.formatters.p.call(this).toLowerCase()},S(){return De.zeroPad(this.getSeconds())},y(){return this.getFullYear().toString().slice(2)},Y(){return this.getFullYear() +},"%":()=>"%"}},Ee={init(){if("thread"!==n.VIEW||!t["Reply Pruning"])return;this.container=He.frag(),this.summary=He.el("span",{hidden:!0,className:"summary"}),this.summary.style.cursor="pointer",He.on(this.summary,"click",(()=>(this.inputs.enabled.checked=!this.inputs.enabled.checked,He.event("change",null,this.inputs.enabled))));const e=F.checkbox("Prune Replies","Show Last",t["Prune All Threads"]),a=He.el("span",{title:"Maximum number of replies to show."},{innerHTML:' '});return He.prepend(a,e),this.inputs={enabled:e.firstElementChild,replies:a.lastElementChild},this.setEnabled.call(this.inputs.enabled),He.on(this.inputs.enabled,"change",this.setEnabled),He.on(this.inputs.replies,"change",He.cb.value),Je.menu.addEntry({el:a,order:190}),l.Thread.push({name:"Reply Pruning",cb:this.node})},position:0,hidden:0,hiddenFiles:0,total:0,totalFiles:0,setEnabled(){const e=Se.input +;return this.checked&&e?.checked&&(e.checked=!1,He.event("change",null,e)),Ee.active=this.checked},showIfHidden(e){if(Ee.container&&He(`#${e}`,Ee.container))return Ee.inputs.enabled.checked=!1,He.event("change",null,Ee.inputs.enabled)},node(){let e;return Ee.thread=this,this.isSticky&&(Ee.active=Ee.inputs.enabled.checked=!0,Se.input&&(t["Thread Quotes"]=Se.input.checked=!1)),this.posts.forEach((function(e){if(e.isReply&&(Ee.total++,e.file))return Ee.totalFiles++})),Ee.active&&/^#p\d+$/.test(location.hash)&&1<=(e=this.posts.keys.indexOf(location.hash.slice(2)))&&e<1+Math.max(Ee.total-+t["Max Replies"],0)&&(Ee.active=Ee.inputs.enabled.checked=!1),He.after(this.OP.nodes.root,Ee.summary),He.on(Ee.inputs.enabled,"change",Ee.update),He.on(Ee.inputs.replies,"change",Ee.update),He.on(a,"ThreadUpdate",Ee.updateCount),He.on(a,"ThreadUpdate",Ee.update),Ee.update()},updateCount(e){if(!e.detail[404])for(var t of e.detail.newPosts)Ee.total++,n.posts.get(t).file&&Ee.totalFiles++},update(){let e,o,i +;const r=Ee.hidden,s=Ee.active?Math.max(Ee.total-+t["Max Replies"],0):0,l=a.body.clientHeight-window.scrollY,{posts:d}=Ee.thread;if(Ee.hiddens){const e=He.frag();for(;Ee.hidden>s&&Ee.position>0;)if(i=d.get(d.keys[--Ee.position]),i.isReply&&!i.isFetchedQuote){for(;(o=Ee.container.lastChild)&&o!==i.nodes.root;)He.prepend(e,o);He.prepend(e,i.nodes.root),Ee.hidden--,i.file&&Ee.hiddenFiles--}He.after(Ee.summary,e),He.event("PostsInserted",null,Ee.summary.parentNode)}if(Ee.summary.textContent=Ee.active?n.SITE.Build.summaryText("+",Ee.hidden,Ee.hiddenFiles):n.SITE.Build.summaryText("-",Ee.total,Ee.totalFiles),Ee.summary.hidden=Ee.total<=+t["Max Replies"], +r!==s&&(e=Je.getTopOf(He(".board")))<0)return window.scrollBy(0,Math.max(a.body.clientHeight-l,window.scrollY+e)-window.scrollY)}},Se={init(){if(t["Quote Threading"]&&"thread"===n.VIEW)return this.controls=He.el("label",{innerHTML:' Threading'}),this.threadNewLink=He.el("span",{className:"brackets-wrap threadnewlink",hidden:!0}),He.extend(this.threadNewLink,{innerHTML:'Thread New Posts'}),this.input=He("input",this.controls),this.input.checked=t["Thread Quotes"],He.on(this.input,"change",this.setEnabled),He.on(this.input,"change",this.rethread),He.on(this.threadNewLink.firstElementChild,"click",this.rethread),He.on(a,"4chanXInitFinished",(()=>this.ready=!0)),Je.menu.addEntry(this.entry={el:this.controls,order:99}),l.Thread.push({name:"Quote Threading",cb:this.setThread}),l.Post.push({name:"Quote Threading",cb:this.node})},parent:m(),children:m(),inserted:m(),toggleThreading(){ +return this.setThreadingState(!t["Thread Quotes"])},setThreadingState(e){return this.input.checked=e,this.setEnabled.call(this.input),this.rethread.call(this.input)},setEnabled(){if(this.checked){He.set("Prune All Threads",!1);const e=Ee.inputs?.enabled;e?.checked&&(e.checked=!1,He.event("change",null,e))}return He.cb.checked.call(this)},setThread(){return Se.thread=this,He.asap((()=>!t["Thread Updater"]||He(".navLinksBot > .updatelink")),(function(){let e;if(e=He(".navLinksBot"))return He.add(e,[He.tn(" "),Se.threadNewLink])}))},node(){let e;if(this.isFetchedQuote||this.isClone||!this.isReply)return;const t=new Set;let o=null;for(var a of this.quotes)(e=n.posts.get(a))&&!e.isFetchedQuote&&e.isReply&&e.IDo.ID)&&(o=e));if(!o)return;let i=o;for(;i=Se.parent[i.fullID];)t.delete(i.ID);return 1===t.size?Se.parent[this.fullID]=o:void 0},descendants(e){let t,n=[e];if(t=Se.children[e.fullID])for(var o of t)n=n.concat(Se.descendants(o));return n},insert(e){ +let n,o;if(!t["Thread Quotes"]||!(n=Se.parent[e.fullID])||Se.inserted[e.fullID])return!1;const a=Se.descendants(e);if(!Z.posts.has(n.ID)&&function(){for(var e of a)if(Z.posts.has(e.ID))return!0}())return Se.threadNewLink.hidden=!1,!1;const{order:i}=Z,r=Se.children[n.fullID]||(Se.children[n.fullID]=[]),s=n.nodes.threadContainer||He.el("div",{className:"threadContainer"}),l=[e.nodes.root];e.nodes.threadContainer&&l.push(e.nodes.threadContainer);let d=r.length;for(let t=r.length-1;t>=0;t--){r[t].ID>=e.ID&&d--}if(d!==r.length){const t=r[d];for(o of a)i.before(i[t.ID],i[o.ID]);r.splice(d,0,e),He.before(t.nodes.root,l)}else{let t,d=n;for(;(t=Se.children[d.fullID])&&t.length;)d=t[t.length-1];for(let e=a.length-1;e>=0;e--)o=a[e],i.after(i[d.ID],i[o.ID]);r.push(e),He.add(s,l)}return Se.inserted[e.fullID]=!0,n.nodes.threadContainer||(n.nodes.threadContainer=s,He.addClass(n.nodes.root,"threadOP"),He.after(n.nodes.root,s)),!0},rethread(){if(!Se.ready)return;const{thread:e}=Se,{posts:n}=e +;if(Se.threadNewLink.hidden=!0,t["Thread Quotes"])n.forEach(Se.insert);else{const t=[];Z.order=new _,Se.inserted=m(),n.forEach((function(e){if(!e.isFetchedQuote)return Z.order.push(e),e.isReply&&t.push(e.nodes.root),Se.children[e.fullID]?(delete Se.children[e.fullID],He.rmClass(e.nodes.root,"threadOP"),He.rm(e.nodes.threadContainer),delete e.nodes.threadContainer):void 0})),He.add(e.nodes.root,t)}return Z.position=Z.order.first,Z.updatePosition(),Z.setLine(!0),Z.read(),Z.update()}},Te={init(){let e,o,r;if("thread"!==n.VIEW||!t["Thread Updater"])return;this.enabled=!0,this.audio=He.el("audio"),"gecko"!==He.engine&&(this.audio.src=this.beep),t["Updater and Stats in Header"]?(this.dialog=r=He.el("span",{id:"updater"}),He.extend(r,{innerHTML:''}),Je.addShortcut("updater",r,100)):(this.dialog=r=F.dialog("updater",{ +innerHTML:'
          '}),He.addClass(i,"float"),He.ready((()=>He.add(a.body,r)))),this.checkPostCount=0,this.timer=He("#update-timer",r),this.status=He("#update-status",r),He.on(this.timer,"click",this.update),He.on(this.status,"click",this.update);const s=He.el("span",{className:"brackets-wrap updatelink"});He.extend(s,{innerHTML:'Update'}),Lt.ready((function(){let e;if(e=He(".navLinksBot"))return He.add(e,[He.tn(" "),s])})),He.on(s.firstElementChild,"click",this.update);const d=[];for(o in c.updater.checkbox){var h=c.updater.checkbox[o];e=F.checkbox(o,o),e.title=h[1];var u=e.firstElementChild;He.on(u,"change",He.cb.checked),"Scroll BG"===u.name?(He.on(u,"change",this.cb.scrollBG),this.cb.scrollBG()):"Auto Update"===u.name&&He.on(u,"change",this.setInterval),d.push({el:e})}return this.settings=He.el("span",{ +innerHTML:'Interval'}),He.on(this.settings,"click",this.intervalShortcut),d.push({el:this.settings}),Je.menu.addEntry(this.entry={el:He.el("span",{textContent:"Updater"}),order:110,subEntries:d}),l.Thread.push({name:"Thread Updater",cb:this.node})},node(){return Te.thread=this,Te.root=this.nodes.root,Te.outdateCount=0,Te.postIDs=[],Te.fileIDs=[],this.posts.forEach((function(e){if(Te.postIDs.push(e.ID),e.file)return Te.fileIDs.push(e.ID)})),Te.cb.interval.call(He.el("input",{value:t.Interval})),He.on(a,"QRPostSuccessful",Te.cb.checkpost),He.on(a,"visibilitychange",Te.cb.visibility),Te.setInterval()}, +/* + http://freesound.org/people/pierrecartoons1979/sounds/90112/ + cc-by-nc-3.0 + */ +beep:"data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA", +playBeep(){const{audio:e}=Te;return e.src||(e.src=Te.beep),e.paused?e.play():He.one(e,"ended",Te.playBeep)},cb:{checkpost(e){if(e.detail.threadID===Te.thread.ID)return Te.postID=e.detail.postID,Te.checkPostCount=0,Te.outdateCount=0,Te.setInterval()},visibility(){if(!a.hidden)return Te.outdateCount=0,Te.seconds>Te.interval?Te.setInterval():void 0},scrollBG:()=>Te.scrollBG=t["Scroll BG"]?()=>!0:()=>!a.hidden,interval(e){let t=parseInt(this.value,10);if(t<1&&(t=1),Te.interval=this.value=t,e)return He.cb.value.call(this)},load(){if(this===Te.req)switch(this.status){case 200:return Te.parse(this),Te.thread.isArchived?Te.kill():Te.setInterval();case 404:return He.ajax(n.SITE.urls.catalogJSON({boardID:Te.thread.board.ID}),{onloadend(){let e;if(200===this.status){for(var t of(e=!0,this.response))for(var n of t.threads)if(n.no===Te.thread.ID){e=!1;break}}else e=!1;return e?Te.kill():Te.error(this)}});default:return Te.error(this)}}},kill:()=>(Te.thread.kill(),Te.setInterval(), +He.event("ThreadUpdate",{404:!0,threadID:Te.thread.fullID})),error:e=>(304===e.status&&Te.set("status",""),Te.setInterval(),e.status?304!==e.status?Te.set("status",`${e.statusText} (${e.status})`,"warning"):void 0:Te.set("status","Connection Error","warning")),setInterval(){if(clearTimeout(Te.timeoutID),Te.thread.isDead)return Te.set("status",Te.thread.isArchived?"Archived":"404","warning"),void Te.set("timer","");if(Te.postID&&Te.checkPostCount<5)return Te.set("timer","...","loading"),void(Te.timeoutID=setTimeout(Te.update,++Te.checkPostCount*b));if(!t["Auto Update"])return void Te.set("timer","Update");const{interval:e}=Te;if(t["Optional Increase"]){const t=a.hidden?10:5,n=Math.min(Te.outdateCount,t),o=(Math.floor(.1*e)||1)*n*n;Te.seconds=He.minmax(o,e,300)}else Te.seconds=e;return Te.timeout()},intervalShortcut(){Re.open("Advanced");const e=He.id("fourchanx-settings");return He("input[name=Interval]",e).focus()},set(e,t,n){let o;const a=Te[e] +;return(o=a.firstChild)?o.data=t:a.textContent=t,a.className=n??(""===t?"empty":"")},timeout:()=>(Te.seconds?(Te.set("timer",Te.seconds),Te.timeoutID=setTimeout(Te.timeout,1e3)):(Te.outdateCount++,Te.update()),Te.seconds--),update(){let e;return clearTimeout(Te.timeoutID),Te.set("timer","...","loading"),(e=Te.req)&&(delete Te.req,e.abort()),Te.req=He.whenModified(n.SITE.urls.threadJSON({boardID:Te.thread.board.ID,threadID:Te.thread.ID}),"ThreadUpdater",Te.cb.load,{timeout:A})},updateThreadStatus(e,t){if(Te.thread[`is${e}`]===t)return;if(Te.thread.setStatus(e,t),"Closed"===e&&Te.thread.isArchived)return;return new Ke("info",`The thread is ${"Sticky"===e?t?"now a sticky":"not a sticky anymore":t?"now closed":"not closed anymore"}.`,30)},parse(e){let o,r,s;const l=e.response.posts,d=l[0],{thread:c}=Te,{board:h}=c,u=Te.postIDs[Te.postIDs.length-1];if(l[l.length-1].non?(Te.playBeep(), +t.Beep&&Te.playBeep()):t.Beep&&Z.posts?.size>0&&0===e&&Te.playBeep());const o=t["Auto Scroll"]&&Te.scrollBG()&&Te.root.getBoundingClientRect().bottom-i.clientHeight<25;let r=null;for(s of p)Se.insert(s)||(r||(r=s.nodes.root),He.add(Te.root,s.nodes.root));He.event("PostsInserted",null,Te.root),o&&(t["Bottom Scroll"]?window.scrollTo(0,a.body.clientHeight):r&&Je.scrollTo(r))}else Te.set("status","");return null!=d.unique_ips&&(r=He.id("unique-ips"))&&(r.textContent=d.unique_ips,r.previousSibling.textContent=r.previousSibling.textContent.replace(/\b(?:is|are)\b/,1===d.unique_ips?"is":"are"),r.nextSibling.textContent=r.nextSibling.textContent.replace(/\bposters?\b/,1===d.unique_ips?"poster":"posters")),He.event("ThreadUpdate",{404:!1,threadID:c.fullID,newPosts:m,deletedPosts:v,deletedFiles:w,postCount:d.replies+1,fileCount:d.images+!!d.fsize,ipCount:d.unique_ips})}},Re={dialog:void 0,init(){const o=He.el("a",{className:"settings-link",textContent:"🔧︎",title:`${e.name} Settings`, +href:"javascript:;"});He.on(o,"click",Re.open),Je.addShortcut("settings",o,820);const i=this.addSection;if(i("Main",this.main),i("Filter",this.filter),i("Sauce",this.sauce),i("Advanced",this.advanced),i("Keybinds",this.keybinds),He.on(a,"AddSettingsSection",Re.addSection),He.on(a,"OpenSettings",(e=>Re.open(e.detail))),"yotsuba"===n.SITE.software&&t["Disable Native Extension"])return He.hasStorage?He.global((function(){try{const e=JSON.parse(localStorage.getItem("4chan-settings"))||{};if(e.disableAll)return;return e.disableAll=!0,localStorage.setItem("4chan-settings",JSON.stringify(e))}catch(e){return Object.defineProperty(window,"Config",{value:{disableAll:!0}})}})):He.global((()=>Object.defineProperty(window,"Config",{value:{disableAll:!0}})))},open(e){let t,n;if(Re.dialog)return;He.event("CloseMenu"),Re.dialog=t=He.el("div",{id:"overlay"},ge),He.on(He(".export",t),"click",Re.export),He.on(He(".import",t),"click",Re.import),He.on(He(".reset",t),"click",Re.reset), +He.on(He("input",t),"change",Re.onImport);const o=[];for(var i of Re.sections){var r=He.el("a",{className:`tab-${i.hyphenatedTitle}`,textContent:i.title,href:"javascript:;"});He.on(r,"click",Re.openSection.bind(i)),o.push(r,He.tn(" | ")),i.title===e&&(n=r)}return o.pop(),He.add(He(".sections-list",t),o),"none"!==e&&(n||o[0]).click(),He.on(He(".close",t),"click",Re.close),He.on(window,"beforeunload",Re.close),He.on(t,"click",Re.close),He.on(t.firstElementChild,"click",(e=>e.stopPropagation())),He.add(a.body,t),He.event("OpenSettings",null,t)},close(){if(Re.dialog)return a.activeElement?.blur(),He.rm(Re.dialog),delete Re.dialog},sections:[],addSection(e,t){"string"!=typeof e&&({title:e,open:t}=e.detail);const n=e.toLowerCase().replace(/\s+/g,"-");return Re.sections.push({title:e,hyphenatedTitle:n,open:t})},openSection(){let e;(e=He(".tab-selected",Re.dialog))&&He.rmClass(e,"tab-selected"),He.addClass(He(`.tab-${this.hyphenatedTitle}`,Re.dialog),"tab-selected") +;const t=He("section",Re.dialog);return He.rmAll(t),t.className=`section-${this.hyphenatedTitle}`,this.open(t,n),t.scrollTop=0,He.event("OpenSettings",null,t)},warnings:{localStorage(t){if(He.cantSync){const n=He.cantSet?"save your settings":"synchronize settings between tabs";return t(He.el("li",{textContent:`${e.name} needs local storage to ${n}.\nEnable it on boards.${location.hostname.split(".")[1]}.org in your browser's privacy settings (may be listed as part of "local data" or "cookies").`}))}},ads:e=>He.onExists(i,".adg-rects > .desktop",(t=>He.onExists(t,"iframe",(function(){const t=_e.to("thread",{boardID:"qa",threadID:362590});return e(He.el("li",ue(he,null,"To protect yourself from ",ue("a",{href:t,target:"_blank"},"malicious ads"),", you should ",ue("a",{href:"https://github.com/gorhill/uBlock#ublock-origin",target:"_blank"},"block ads")," on 4chan.")))}))))},main(o){let a;const i=He.el("fieldset",{hidden:!0},{innerHTML:"Warnings
            "}),r=function(e){ +return He.add(He("ul",i),e),i.hidden=!1};for(a in Re.warnings){(0,Re.warnings[a])(r)}He.add(o,i);const s=m(),l=m(),d=function(e,n){const o=[e];return(()=>{const e=[];for(a in n){var i=n[a];if(i instanceof Array){var r=i[1],d=He.el("div",{innerHTML:`: ${r}`});d.dataset.name=a;var c=He("input",d);He.on(c,"change",He.cb.checked),He.on(c,"change",(function(){return this.parentNode.parentNode.dataset.checked=this.checked})),s[a]=t[a],l[a]=c;var h=i[2]||0;if(o.length<=h){var u=He.el("div",{className:"suboption-list"});He.add(o[o.length-1].lastElementChild,u),o[h]=u}else o.length>h+1&&o.splice(h+1,o.length-(h+1));e.push(He.add(o[h],d))}}return e})()};for(var h in c.main){var u=c.main[h],p=He.el("fieldset",{innerHTML:`${h}`});d(p,u),"Posting and Captchas"===h&&He.add(p,He.el("p",{ +innerHTML:'For more info on captcha options and issues, see the captcha FAQ.'})),He.add(o,p)}d(He('div[data-name="JSON Index"] > .suboption-list',o),c.Index),"gecko"!==He.engine&&(He('div[data-name="Remember QR Size"]',o).hidden=!0),(He.perProtocolSettings||"https:"!==location.protocol)&&(He('div[data-name="Redirect to HTTPS"]',o).hidden=!0),"crx"!==x&&(He('div[data-name="Work around CORB Bug"]',o).hidden=!0),He.get(s,(function(e){for(a in e){var t=e[a];l[a].checked=t,l[a].parentNode.parentNode.dataset.checked=t}}));const g=He.el("div",{innerHTML:': Clear manually-hidden threads and posts on all boards. Reload the page to apply.'}),f=He("button",g);return He.get({hiddenThreads:m(),hiddenPosts:m()},(function({hiddenThreads:e,hiddenPosts:t}){let n,o,a,i,r=0;for(o in e)if(a=e[o],"boards"!==o)for(o in a.boards)n=a.boards[o],r+=Object.keys(n).length;for(o in e.boards)n=e.boards[o], +r+=Object.keys(n).length;for(o in t)if(a=t[o],"boards"!==o)for(o in a.boards)for(o in n=a.boards[o],n)i=n[o],r+=Object.keys(i).length;for(o in t.boards)for(o in n=t.boards[o],n)i=n[o],r+=Object.keys(i).length;return f.textContent=`Hidden: ${r}`})),He.on(f,"click",(function(){return this.textContent="Hidden: 0",He.get("hiddenThreads",m(),(function({hiddenThreads:e}){if(He.hasStorage&&"yotsuba"===n.SITE.software){let t;for(t in e["4chan.org"]?.boards)localStorage.removeItem(`4chan-hide-t-${t}`);for(t in e.boards)localStorage.removeItem(`4chan-hide-t-${t}`)}return He.delete(["hiddenThreads","hiddenPosts"])}))})),He.after(He('input[name="Stubs"]',o).parentNode.parentNode,g)},export(){const e=m();return He.extend(e,t),He.get(e,(function(e){return delete e.boardConfig,Re.downloadExport({version:n.VERSION,date:Date.now(),Conf:e})}))},downloadExport(t){const o=new Blob([JSON.stringify(t,null,2)],{type:"application/json"}),a=URL.createObjectURL(o),i=He.el("a",{ +download:`${e.name} v${n.VERSION}-${t.date}.json`,href:a}),r=He(".imp-exp-result",Re.dialog);return He.rmAll(r),He.add(r,i),i.click()},import(){return He("input[type=file]",this.parentNode).click()},onImport(){let e;if(!(e=this.files[0]))return;this.value=null;const t=He(".imp-exp-result");if(!confirm("Your current settings will be entirely overwritten, are you sure?"))return void(t.textContent="Import aborted.");const n=new FileReader;return n.onload=function(e){try{return Re.loadSettings(m.json(e.target.result),(function(e){return e?t.textContent="Import failed due to an error.":confirm("Import successful. Reload now?")?window.location.reload():void 0}))}catch(e){const n=e;return t.textContent="Import failed due to an error.",r.error(n.stack)}},n.readAsText(e)},convertFrom:{loadletter(e){for(var t in"Always CDN"in(e=function(e,t){for(var n in t){var o=t[n];o&&(e.Conf[o]=e.Conf[n]),delete e.Conf[n]}return e}(e,{"Disable 4chan's extension":"Disable Native Extension", +"Comment Auto-Expansion":"","Remove Slug":"","Always HTTPS":"Redirect to HTTPS","Check for Updates":"","Recursive Filtering":"Recursive Hiding","Reply Hiding":"Reply Hiding Buttons","Thread Hiding":"Thread Hiding Buttons","Show Stubs":"Stubs","Image Auto-Gif":"Replace GIF","Expand All WebM":"Expand videos","Reveal Spoilers":"Reveal Spoiler Thumbnails","Expand From Current":"Expand from here","Current Page":"Page Count in Stats","Current Page Position":"","Alternative captcha":"Use Recaptcha v1","Alt index captcha":"Use Recaptcha v1 on Index","Auto Submit":"Post on Captcha Completion","Open Reply in New Tab":"Open Post in New Tab","Remember QR size":"Remember QR Size","Remember Subject":"","Quote Inline":"Quote Inlining","Quote Preview":"Quote Previewing","Indicate OP quote":"Mark OP Quotes","Indicate You quote":"Mark Quotes of You","Indicate Cross-thread Quotes":"Mark Cross-thread Quotes",uniqueid:"uniqueID",mod:"capcode",email:"",country:"flag",md5:"MD5",openEmptyQR:"Open empty QR", +openQR:"Open QR",openOptions:"Open settings",close:"Close",spoiler:"Spoiler tags",sageru:"Toggle sage",code:"Code tags",sjis:"SJIS tags",submit:"Submit QR",watch:"Watch",update:"Update",unreadCountTo0:"",expandAllImages:"Expand images",expandImage:"Expand image",zero:"Front page",nextPage:"Next page",previousPage:"Previous page",nextThread:"Next thread",previousThread:"Previous thread",expandThread:"Expand thread",openThreadTab:"Open thread",openThread:"Open thread tab",nextReply:"Next reply",previousReply:"Previous reply",hide:"Hide",Scrolling:"Auto Scroll",Verbose:""})).Conf&&(e.Conf.fourchanImageHost=e.Conf["Always CDN"]?"i.4cdn.org":"",delete e.Conf["Always CDN"]),e.Conf.sauces=e.Conf.sauces.replace(/\$\d/g,(function(e){switch(e){case"$1":return"%TURL";case"$2":return"%URL";case"$3":return"%MD5";case"$4":return"%board";default:return e}})),c.hotkeys)c.hotkeys[t], +t in e.Conf&&(e.Conf[t]=e.Conf[t].replace(/ctrl|alt|meta/g,(e=>`${e[0].toUpperCase()}${e.slice(1)}`)).replace(/(^|.+\+)[A-Z]$/g,(e=>`Shift+${e.slice(0,-1)}${e.slice(-1).toLowerCase()}`)));if(e.WatchedThreads)for(var n in e.Conf.watchedThreads=m.clone({"4chan.org":{boards:{}}}),e.WatchedThreads){var o=e.WatchedThreads[n];for(var a in o){var i=o[a];(e.Conf.watchedThreads["4chan.org"].boards[n]||(e.Conf.watchedThreads["4chan.org"].boards[n]=m()))[a]={excerpt:i.textContent}}}return e}},upgrade(n,o){let a,i,r;const s=m(),l=(e,t)=>n[e]=s[e]=t,d=function(e,t){if(null==n[e])return l(e,t)},h=function(e){if(null!=n.sauces&&(e=e.filter((e=>n.sauces.indexOf(e.match(/[^#;\s]+|$/)[0])<0))).length)return l("sauces",n.sauces+"\n\n"+e.join("\n"))},u=function(e){if(null==n.usercss&&l("usercss",c.usercss),n.usercss.indexOf(e)<0)return l("usercss",e+"\n\n"+n.usercss)};if(a='"'===o[0])try{o=JSON.parse(o)}catch(e){}const p=o.replace(/\d+/g,(e=>("0000"+e).slice(-5))) +;if(p<"00001.00013.00014.00008")for(i in n)if(r=n[i],"string"==typeof r&&"string"!=typeof t[i]&&!["Index Sort","Last Long Reply Thresholds 0","Last Long Reply Thresholds 1"].includes(i)){a=!0;break}if(a)for(i in n)if(r=n[i],"string"==typeof r)try{var g=JSON.parse(r);l(i,g)}catch(e){}if(p<"00001.00011.00008.00000"&&(null==n["Fixed Thread Watcher"]&&l("Fixed Thread Watcher",n["Toggleable Thread Watcher"]??!0),null==n["Exempt Archives from Encryption"]&&l("Exempt Archives from Encryption",n["Except Archives from Encryption"]??!1)),p<"00001.00011.00010.00001"&&null!=n.selectedArchives){const e={Moe:0,"4plebs Archive":3,"Nyafuu Archive":4,"Love is Over":5,"Rebecca Black Tech":8,warosu:10,fgts:15,not4plebs:22,DesuStorage:23,"fireden.net":24,disabled:null};for(var f in n.selectedArchives){var b=n.selectedArchives[f];for(var A in b){var v=b[A];He.hasOwn(e,v)&&(b[A]=e[v])}}l("selectedArchives",n.selectedArchives)}if(p<"00001.00011.00016.00000"){let e +;(e=c.usercss.match(/\/\* Board title rice \*\/(?:\n.+)*/)[0])&&null!=n.usercss&&n.usercss.indexOf(e)<0&&l("usercss",e+"\n\n"+n.usercss)}if(p<"00001.00011.00017.00000")for(i of["Persistent QR","Color User IDs","Fappe Tyme","Werk Tyme","Highlight Posts Quoting You","Highlight Own Posts"])null==n[i]&&l(i,"Persistent QR"===i);if(p<"00001.00011.00017.00006"&&null!=n.sauces&&l("sauces",n.sauces.replace(/^(#?\s*)http:\/\/iqdb\.org\//gm,"$1//iqdb.org/")),p<"00001.00011.00019.00003"&&!Re.dialog&&He.queueTask((()=>Re.warnings.ads((e=>new Ke("warning",[...Array.from(e.childNodes)]))))),p<"00001.00011.00020.00003"){const e={"Inline Cross-thread Quotes Only":!1,"Pass Link":!0};for(i in e){var w=e[i];null==n[i]&&l(i,w)}}if(p<"00001.00011.00021.00003"&&null==n["Remember Your Posts"]&&l("Remember Your Posts",n["Mark Quotes of You"]??!0), +p<"00001.00011.00022.00000"&&null!=n.sauces&&(l("sauces",n.sauces.replace(/^(#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(?:IMG|URL))%3Fs\.jpg/gm,"$1")),l("sauces",n.sauces.replace(/^#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(?:IMG|T?URL)(?=$|;)/gm,"$&&safe=off"))),p<"00001.00011.00022.00002"&&null==n["Use Recaptcha v1 in Reports"]&&n["Use Recaptcha v1"]&&!n["Use Recaptcha v2 in Reports"]&&l("Use Recaptcha v1 in Reports",!0),p<"00001.00011.00024.00000"&&null!=n["JSON Navigation"]&&null==n["JSON Index"]&&l("JSON Index",n["JSON Navigation"]),p<"00001.00011.00026.00000"&&(null!=n["Oekaki Links"]&&null==n["Edit Link"]&&l("Edit Link",n["Oekaki Links"]),null==n["Inline Cross-thread Quotes Only"]&&l("Inline Cross-thread Quotes Only",!0)),p<"00001.00011.00030.00000"&&n["Quote Threading"]&&null==n["Thread Quotes"]&&l("Thread Quotes",!0), +p<"00001.00011.00032.00000"&&(null!=n.sauces&&l("sauces",n.sauces.replace(/^(#?\s*)http:\/\/3d\.iqdb\.org\//gm,"$1//3d.iqdb.org/")),h(["#https://desustorage.org/_/search/image/%sMD5/","#https://boards.fireden.net/_/search/image/%sMD5/","#https://foolz.fireden.net/_/search/image/%sMD5/","#//www.gif-explode.com/%URL;types:gif"])),p<"00001.00011.00035.00000"&&h(["https://whatanime.ga/?auto&url=%IMG;text:wait"]),p<"00001.00012.00000.00000"&&(null==n["Exempt Archives from Encryption"]&&l("Exempt Archives from Encryption",!1),null==n["Show New Thread Option in Threads"]&&l("Show New Thread Option in Threads",!1),n["Show Name and Subject"]&&u("#qr .persona .field {display: block !important;}"),!1===n["QR Shortcut"]&&u("#shortcut-qr {display: none;}"),!1===n["Bottom QR Link"]&&u(".qr-link-container-bottom {display: none;}")),p<"00001.00012.00000.00006"&&null!=n.sauces&&l("sauces",n.sauces.replace(/^(#?\s*)https:\/\/(?:desustorage|cuckchan)\.org\//gm,"$1https://desuarchive.org/")), +p<"00001.00012.00001.00000"&&null==n["Persistent Thread Watcher"]&&null!=n["Toggleable Thread Watcher"]&&l("Persistent Thread Watcher",!n["Toggleable Thread Watcher"]),p<"00001.00012.00003.00000")for(i of["Image Hover in Catalog","Auto Watch","Auto Watch Reply"])d(i,!1);if(p<"00001.00013.00001.00002"&&h(["#//www.bing.com/images/search?q=imgurl:%IMG&view=detailv2&iss=sbi#enterInsights"]),p<"00001.00013.00005.00000"&&(null!=n.sauces&&l("sauces",n.sauces.replace(/^(#?\s*)http:\/\/regex\.info\/exif\.cgi/gm,"$1http://exif.regex.info/exif.cgi")),h(c.sauces.match(/# Known filename formats:(?:\n.+)*|$/)[0].split("\n"))),p<"00001.00013.00007.00002"&&d("Require OP Quote Link",!0),p<"00001.00013.00008.00000"&&d("Download Link",!0),p<"00001.00013.00009.00003"&&null!=n.jsWhitelist){const e=n.jsWhitelist.split("\n");!e.includes("https://cdnjs.cloudflare.com")&&e.includes("https://cdn.mathjax.org")&&l("jsWhitelist",n.jsWhitelist+"\n\nhttps://cdnjs.cloudflare.com")} +if(p<"00001.00014.00000.00006"&&null!=n.siteSoftware&&l("siteSoftware",n.siteSoftware+"\n4cdn.org yotsuba"),p<"00001.00014.00003.00002"&&null!=n.sauces&&l("sauces",n.sauces.replace(/^(#?\s*)https:\/\/whatanime\.ga\//gm,"$1https://trace.moe/")),p<"00001.00014.00004.00004"&&(null==n.siteSoftware||/^4channel\.org yotsuba$/m.test(n.siteSoftware)||l("siteSoftware",n.siteSoftware+"\n4channel.org yotsuba")),p<"00001.00014.00005.00000"){for(var x of y.keys)if(n[x]?.boards){var{boards:k,lastChecked:I}=n[x];n[x]["4chan.org"]={boards:k,lastChecked:I},delete n[x].boards,delete n[x].lastChecked,l(x,n[x])}if(null!=n.siteSoftware&&null==n.siteProperties){const e=m();for(var C of n.siteSoftware.split("\n")){var[D,E]=Array.from(C.split(" "));e[D]={software:E}}l("siteProperties",e)}} +return p<"00001.00014.00006.00006"&&null!=n.sauces&&l("sauces",n.sauces.replace(/\/\/%\$1\.deviantart\.com\/gallery\/#\/d%\$2;regexp:\/\^\\w\+_by_\(\\w\+\)-d\(\[\\da-z\]\+\)\//g,"//www.deviantart.com/gallery/#/d%$1%$2;regexp:/^\\w+_by_\\w+[_-]d([\\da-z]{6})\\b|^d([\\da-z]{6})-[\\da-z]{8}-/")),p<"00001.00014.00008.00000"&&null!=n.sauces&&l("sauces",n.sauces.replace(/https:\/\/www\.yandex\.com\/images\/search/g,"https://yandex.com/images/search")),p<"00001.00014.00009.00000"&&null!=n.sauces&&(l("sauces",n.sauces.replace(/^(#?\s*)(?:http:)?\/\/(www\.pixiv\.net|www\.deviantart\.com|imgur\.com|flickr\.com)\//gm,"$1https://$2/")),l("sauces",n.sauces.replace(/https:\/\/yandex\.com\/images\/search\?rpt=imageview&img_url=%IMG/g,"https://yandex.com/images/search?rpt=imageview&url=%IMG"))),p<"00001.00014.00009.00001"&&null!=n["Use Faster Image Host"]&&null==n.fourchanImageHost&&l("fourchanImageHost",n["Use Faster Image Host"]?"i.4cdn.org":""), +p<"00001.00014.00010.00001"&&null==n["Filter in Native Catalog"]&&l("Filter in Native Catalog",!1),p<"00001.00014.00012.00008"&&null==n.boardnav&&l("boardnav",`[ toggle-all ]\na-replace\nc-replace\ng-replace\nk-replace\nv-replace\nvg-replace\nvr-replace\nck-replace\nco-replace\nfit-replace\njp-replace\nmu-replace\nsp-replace\ntv-replace\nvp-replace\n[external-text:"FAQ","${e.faq}"]`),p<"00001.00014.00016.00001"&&null!=n.archiveLists&&l("archiveLists",n.archiveLists.replace("https://mayhemydg.github.io/archives.json/archives.json","https://nstepien.github.io/archives.json/archives.json")), +p<"00001.00014.00016.00007"&&null!=n.sauces&&l("sauces",n.sauces.replace(/https:\/\/www\.deviantart\.com\/gallery\/#\/d%\$1%\$2;regexp:\/\^\\w\+_by_\\w\+\[_-\]d\(\[\\da-z\]\{6\}\)\\b\|\^d\(\[\\da-z\]\{6\}\)-\[\\da-z\]\{8\}-\//g,'javascript:void(open("https://www.deviantart.com/"+%$1.replace(/_/g,"-")+"/art/"+parseInt(%$2,36)));regexp:/^\\w+_by_(\\w+)[_-]d([\\da-z]{6})\\b/').replace(/\/\/imgops\.com\/%URL/g,"//imgops.com/start?url=%URL")),p<"00001.00014.00017.00002"&&null!=n.jsWhitelist&&l("jsWhitelist",n.jsWhitelist+"\n\nhttps://hcaptcha.com\nhttps://*.hcaptcha.com"),p<"00001.00014.00020.00004"&&null!=n.archiveLists&&l("archiveLists",n.archiveLists.replace("https://nstepien.github.io/archives.json/archives.json","https://4chenz.github.io/archives.json/archives.json")), +p<"00001.00014.00022.00003"&&n.sauces&&(l("sauces",n.sauces.replace(/^#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(IMG|T?URL)&safe=off(?=$|;)/gm,"https://www.google.com/searchbyimage?sbisrc=4chanx&image_url=%$1&safe=off")),"00001.00014.00022.00002"!==p||/\bsbisrc=/.test(n.sauces)||l("sauces",n.sauces.replace(/^#?\s*https:\/\/lens\.google\.com\/uploadbyurl\?url=%(IMG|T?URL)(?=$|;)/m,"https://www.google.com/searchbyimage?sbisrc=4chanx&image_url=%$1&safe=off"))),s},loadSettings:(e,t)=>("2"===e.version.split(".")[0]?e=Re.convertFrom.loadletter(e):e.version!==n.VERSION&&Re.upgrade(e.Conf,e.version),He.clear((function(n){return n?t(n):He.set(e.Conf,t)}))),reset(){if(confirm("Your current settings will be entirely wiped, are you sure?"))return He.clear((function(e){return e?He(".imp-exp-result").textContent="Import failed due to an error.":confirm("Reset successful. Reload now?")?window.location.reload():void 0}))},filter(e){He.extend(e,{ +innerHTML:'\n
            \n'});const t=He("select",e);return He.on(t,"change",Re.selectFilter),Re.selectFilter.call(t)},selectFilter(){let e;const n=this.nextElementSibling;if("guide"!==(e=this.value)){if(!He.hasOwn(c.filter,e))return;He.rmAll(n) +;const o=He.el("textarea",{name:e,className:"field",spellcheck:!1});return He.on(o,"change",He.cb.value),void He.get(e,t[e],(function(t){return o.value=t[e],He.add(n,o)}))}return Object.keys(c.filter).filter((e=>"general"!==e)).map(((e,t)=>({innerHTML:(t?",":"")+`${o(e)}`}))),He.extend(n,{ +innerHTML:'
            Filter is disabled.
            \n

            \n Use regular expressions, one per line.
            \n Lines starting with a # will be ignored.
            \n For example, /weeaboo/i will filter posts containing the string `weeaboo`, case-insensitive.
            \n MD5 and Unique ID filtering use exact string matching, not regular expressions.\n

            \n
              You can use these settings with each regular expression, separate them with semicolons:\n
            • \n Per boards, separate them with commas. It is global if not specified. Use sfw and nsfw to reference all worksafe or not-worksafe boards.
              \n For example: boards:a,jp;.
              \n To specify boards on a particular site, put the beginning of the domain and a slash character before the list.
              \n Any initial www. should not be included, and all 4chan domains are considered 4chan.org.
              \n For example: boards:4:a,jp,sama:a,z;.
              \n An asterisk can be used to specify all boards on a site.
              \n For example: boards:4:*;.
              \n
            • \n
            • \n Select boards to be excluded from the filter. The syntax is the same as for the boards: option above.
              \n For example: exclude:vg,v;.\n
            • \n
            • \n Filter OPs only along with their threads (`only`) or replies only (`no`).
              \n For example: op:only; or op:no;.\n
            • \n
            • \n Filter only posts with files (`only`) or only posts without files (`no`).
              \n For example: file:only; or file:no;.\n
            • \n
            • \n Overrule the `Show Stubs` setting if specified: create a stub (`yes`) or not (`no`).
              \n For example: stub:yes; or stub:no;.\n
            • \n
            • \n Highlight instead of hiding. You can specify a class name to use with a userstyle.
              \n For example: highlight; or highlight:wallpaper;.\n
            • \n
            • \n Highlighted OPs will have their threads put on top of the board index by default.
              \n For example: top:yes; or top:no;.\n
            • \n
            • \n Show a desktop notification instead of hiding.
              \n For example: notify;.\n
            • \n
            • \n Filters in the "General" section apply to multiple fields, by default subject,name,filename,comment.
              \n The fields can be specified with the type option, separated by commas.
              \n For example: type:@{filterTypes};.
              \n Types can also be combined with a + sign; this indicates the filter applies to the given fields joined by newlines.
              \n For example: type:filename+filesize+dimensions;.
              \n
            • \n
            \n' +}),He(".warning",n).hidden=t.Filter},sauce(e){He.extend(e,{ +innerHTML:'
            Sauce is disabled.
            \n\n
            \n \n
            These parameters will be replaced by their corresponding values in the URL and displayed text:
            \n
              \n
            • %IMG: Full image URL for GIF, JPG, and PNG; thumbnail URL for other types.
            • \n
            • %URL: Full image URL.
            • \n
            • %TURL: Thumbnail URL.
            • \n
            • %name: Original file name.
            • \n
            • %board: Current board.
            • \n
            • %MD5: MD5 hash in base64.
            • \n
            • %sMD5: MD5 hash in base64 using - and _.
            • \n
            • %hMD5: MD5 hash in hexadecimal.
            • \n
            • %$0: Matched regular expression within the filename.
            • \n
            • %$1, %$2, %$3, ... : Subexpressions within the matched regular expression.
            • \n
            • %%, %semi: Literal % and ;.
            • \n
            \n
            Lines starting with a # will be ignored.
            \n
            You can specify a display text by appending ;text:[text] to the URL.
            \n
            You can specify the applicable boards/sites by appending ;boards:[board1],[board2]. See the Filter guide for details.
            \n
            You can specify the applicable file types by appending ;types:[extension1],[extension2].
            \n
            You can specify a regular expression the filename must match by appending ;regexp:[regular expression].
            \n
            \n\n' +}),He(".warning",e).hidden=t.Sauce;const n=He("textarea",e);return He.get("sauces",t.sauces,(function(e){return n.value=e.sauces,n.hidden=!1})),He.on(n,"change",He.cb.value)},advanced(e){let n,o;for(var a of(He.extend(e,{ +innerHTML:'
            \n Archives\n
            404 Redirect is disabled.
            \n \n \n \n \n \n \n \n \n
            Thread redirectionPost fetchingFile redirection
            \n
            \n
            \n Archive Lists: Each line below should be an archive list in this format or a URL to load an archive list from.
            \n Archive properties can be overriden by another item with the same uid (or if absent, its name).\n
            \n \n Last updated: \n
            \n\n
            \n External Catalog\n
            External Catalog is disabled. This will be used only as a fallback.
            \n
            \n URLs of external catalog sites, where %board is to be replaced by the board name.
            \n Each URL should be followed by ;boards: and optionally ;exclude: and a list of supported/excluded boards in the format explained in the Filter guide.\n
            \n \n
            \n\n
            \n Override 4chan Image Host\n
            Change 4chan image links to this domain. Leave blank for no change.
            \n
            \n \n
            \n\n
            \n Captcha Language\n
            Choose from list of language codes. Leave blank to autoselect.
            \n
            \n
            \n\n
            \n Custom Board Navigation\n
            \n New lines will be converted into spaces.

            \n
            In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
            \n
            Board link: g
            \n
            Archive link: g-archive
            \n
            Internal archive link: g-expired
            \n
            Title link: g-title
            \n
            Board link (Replace with title when on that board): g-replace
            \n
            Full text link: g-full
            \n
            Custom text link: g-text:"Install Gentoo"
            \n
            Index-only link: g-index
            \n
            Catalog-only link: g-catalog
            \n
            Index mode: g-mode:"infinite scrolling"
            \n
            Index sort: g-sort:"creation date rev"
            \n
            External link: external-text:"Google","http://www.google.com"
            \n
            Open in new tab: g-nt
            \n
            Combinations are possible: g-index-text:"Technology Index"
            \n
            Full board list toggle: toggle-all
            \n
            \n
            \n [ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:"Piracy"]
            \n will give you
            \n [ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
            \n if you are on /g/.\n
            \n
            \n\n
            \n Time Formatting is disabled.\n
            :
            \n \n
            Day: %a, %A, %d, %e
            \n
            Month: %m, %b, %B
            \n
            Year: %y, %Y
            \n
            Hour: %k, %H, %l, %I, %p, %P
            \n
            Minute: %M
            \n
            Second: %S
            \n
            Literal %: %%
            \n \n
            \n\n
            \n Quote Backlinks formatting is disabled.\n
            :
            \n
            \n\n
            \n Default pasted content filename\n
            .png
            \n
            \n\n
            \n File Info Formatting is disabled.\n
            :
            \n
            Link: %l (truncated), %L (untruncated), %T (4chan filename)
            \n
            Filename: %n (truncated), %N (untruncated), %t (4chan filename)
            \n
            Download button: %d
            \n
            Quick filter MD5: %f
            \n
            Spoiler indicator: %p
            \n
            Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
            \n
            Resolution: %r (Displays 'PDF' for PDF files)
            \n
            Tag: %g\n
            Literal %: %%
            \n
            \n\n
            \n Quick Reply Personas\n \n

            \n One item per line.
            \n Items will be added in the relevant input's auto-completion list.
            \n Password items will always be used, since there is no password input.
            \n Lines starting with a # will be ignored.\n

            \n
              You can use these settings with each item, separate them with semicolons:\n
            • Possible items are: name, options (or equivalently email), subject and password.
            • \n
            • Wrap values of items with quotes, like this: options:"sage".
            • \n
            • Force values as defaults with the always keyword, for example: options:"sage";always.
            • \n
            • Select specific boards for an item, separated with commas, for example: options:"sage";boards:jp;always.
            • \n
            \n
            \n\n
            \n Unread Favicon is disabled.\n \n \n
            \n\n
            \n Thread Updater is disabled.\n
            \n Interval: seconds\n
            \n
            \n\n
            \n Custom Cooldown Time\n
            \n Seconds: \n
            \n
            \n\n
            \n \n \n \n
            For more information about customizing 4chan X's CSS, see the styling guide.
            \n \n \n
            \n\n
            \n Javascript Whitelist\n
            \n Sources from which Javascript is allowed to be loaded by Content Security Policy.
            \n Lines starting with a # will be ignored.\n
            \n \n
            \n\n
            \n Known Banners\n
            List of known banners, used for click-to-change feature.
            \n \n
            \n' +}),u(".warning",e)))a.hidden=t[a.dataset.feature];const i=m();for(n of u("[name]",e))i[n.name]=n;He.on(i.archiveLists,"change",(function(){return He.set("lastarchivecheck",0),t.lastarchivecheck=0,He.id("lastarchivecheck").textContent="never"}));const r=m();for(o in i)if(n=i[o],!["Interval","Custom CSS"].includes(o)){r[o]=t[o];var s="SELECT"===n.nodeName||["checkbox","radio"].includes(n.type)||"TEXTAREA"===n.nodeName&&!(o in Re)?"change":"input";He.on(n,s,He.cb["checkbox"===n.type?"checked":"value"]),o in Re&&He.on(n,s,Re[o])}He.get(r,(function(e){for(var t in e){var o=e[t];n=i[t],n["checkbox"===n.type?"checked":"value"]=o,n.hidden=!1,t in Re&&Re[t].call(n)}}));const l=He.id("list-fourchanImageHost");for(var d of O.suggestions)He.add(l,He.el("option",{textContent:d}));const c=i.Interval,h=i["Custom CSS"],p=He("#apply-css",e);c.value=t.Interval,h.checked=t["Custom CSS"],i.usercss.disabled=!t["Custom CSS"],p.disabled=!t["Custom CSS"],He.on(c,"change",Te.cb.interval), +He.on(h,"change",Re.togglecss),He.on(p,"click",(()=>be.update()));const g=m();for(o of["archives","selectedArchives","lastarchivecheck"])g[o]=t[o];He.get(g,(function(n){return He.extend(t,n),_e.selectArchives(),Re.addArchiveTable(e)}));const f=He("#archive-board-select",e),b=He("#archive-table",e),A=He("#update-archives",e);return He.on(f,"change",(function(){return He("tbody > :not([hidden])",b).hidden=!0,He(`tbody > .${this.value}`,b).hidden=!1})),He.on(A,"click",(()=>_e.update((()=>Re.addArchiveTable(e)))))},addArchiveTable(e){let o,a;He("#lastarchivecheck",e).textContent=0===t.lastarchivecheck?"never":new Date(t.lastarchivecheck).toLocaleString();const i=He("#archive-board-select",e),r=He("#archive-table",e),s=He("tbody",e);He.rmAll(i),He.rmAll(s);const l=m();for(var{uid:d,name:c,boards:h,files:u,software:p}of t.archives)if(["fuuka","foolfuuka"].includes(p))for(o of h){a=l[o]||(l[o]={thread:[],post:[],file:[]});var g=[d??c,c];a.thread.push(g),"foolfuuka"===p&&a.post.push(g), +u.includes(o)&&a.file.push(g)}const f=[],b=[];for(o of Object.keys(l).sort()){var A=He.el("tr",{className:`board-${o}`});for(var v of(A.hidden=o!==n.BOARD.ID,b.push(He.el("option",{textContent:`/${o}/`,value:`board-${o}`,selected:o===n.BOARD.ID})),a=l[o],["thread","post","file"]))He.add(A,Re.addArchiveCell(o,a,v));f.push(A)}if(0!==f.length)for(o in i.hidden=r.hidden=!1,n.BOARD.ID in l||(f[0].hidden=!1),He.add(i,b),He.add(s,f),t.selectedArchives){var w=t.selectedArchives[o];for(var x in w){var y,k=w[x];(y=He(`select[data-boardid='${o}'][data-type='${x}']`,s))&&(y.value=JSON.stringify(k),y.value||(y.value=y.firstChild.value))}}else i.hidden=r.hidden=!0},addArchiveCell(e,t,n){const{length:o}=t[n],a=He.el("td",{className:"archive-cell"});if(!o)return a.textContent="--",a;const i=[];let r=0;for(;r"});const l=a.firstElementChild +;return(l.disabled=1===o)||(l.setAttribute("data-boardid",e),l.setAttribute("data-type",n),He.on(l,"change",Re.saveSelectedArchive)),He.add(l,i),a},saveSelectedArchive(){return He.get("selectedArchives",t.selectedArchives,(({selectedArchives:e})=>((e[this.dataset.boardid]||(e[this.dataset.boardid]=m()))[this.dataset.type]=JSON.parse(this.value),He.set("selectedArchives",e),t.selectedArchives=e,_e.selectArchives())))},boardnav(){return Je.generateBoardList(this.value)},time(){return this.nextElementSibling.textContent=De.format(this.value,new Date)},timeLocale:()=>Re.time.call(He("[name=time]",Re.dialog)),backlink(){return this.nextElementSibling.textContent=this.value.replace(/%(?:id|%)/g,(e=>({"%id":"123456789","%%":"%"}[e])))},fileInfo(){const e={isReply:!0,file:{url:`//${O.host()}/g/1334437723720.jpg`,name:"d9bb2efc98dd0df141a94399ff5880b7.jpg",size:"276 KB",sizeInBytes:282624,dimensions:"1280x720",isImage:!0,isVideo:!1,isSpoiler:!0,tag:"Loop"}} +;return Ce.format(this.value,e,this.nextElementSibling)},favicon(){h.switch(),"thread"===n.VIEW&&t["Unread Favicon"]&&Z.update();const e=this.nextElementSibling.children,o=h,a=[o.SFW,o.unreadSFW,o.unreadSFWY,o.NSFW,o.unreadNSFW,o.unreadNSFWY,o.dead,o.unreadDead,o.unreadDeadY];for(let t=0;tKeybinds are disabled.\n
            Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
            \n
            Press Backspace to disable a keybind.
            \n\n \n
            ActionsKeybinds
            \n'}),He(".warning",e).hidden=t.Keybinds;const o=He("tbody",e),a=m(),i=m();for(n in c.hotkeys){var r=c.hotkeys[n],s=He.el("tr",{innerHTML:`${r[1]}`}),l=He("input",s);l.name=n,l.spellcheck=!1,a[n]=t[n],i[n]=l,He.on(l,"keydown",Re.keybind),He.add(o,s)}return He.get(a,(function(e){for(n in e){var t=e[n];i[n].value=t}}))},keybind(e){let t;if(9!==e.keyCode&&(e.preventDefault(),e.stopPropagation(),null!=(t=Fe.keyCode(e))))return this.value=t,He.cb.value.call(this)}},Be={init(){ +if((t["Fappe Tyme"]||t["Werk Tyme"])&&["index","thread","archive"].includes(n.VIEW)){for(var e of(this.nodes={},this.enabled={fappe:!1,werk:t.werk},["Fappe","Werk"]))if(t[`${e} Tyme`]){var o=e.toLowerCase(),a=F.checkbox(o,`${e} Tyme`,!1);a.title=`${e} Tyme`,this.nodes[o]=a.firstElementChild,t[o]&&this.set(o,!0),He.on(this.nodes[o],"change",this.toggle.bind(this,o)),Je.menu.addEntry({el:a,order:97});var i=He.el("span",{className:"indicator",textContent:e[0],title:`${e} Tyme active`});He.on(i,"click",(function(){const e=He.getOwn(Be.nodes,this.parentNode.id.replace("shortcut-",""));return e.checked=!e.checked,He.event("change",null,e)})),Je.addShortcut(o,i,410)}return t["Werk Tyme"]&&He.sync("werk",this.set.bind(this,"werk")),l.Post.push({name:"Fappe Tyme",cb:this.node}),l.CatalogThread.push({name:"Werk Tyme",cb:this.catalogNode})}},node(){return this.nodes.root.classList.toggle("noFile",!this.files.length)},catalogNode(){const e=this.thread.OP.files[0];if(!e)return;const t=He.el("div",{ +textContent:e.name,className:"werkTyme-filename"});return He.add(this.nodes.thumb.parentNode,t)},set(e,t){return this.enabled[e]=this.nodes[e].checked=t,He[(t?"add":"rm")+"Class"](i,`${e}Tyme`)},toggle(e){if(this.set(e,!this.enabled[e]),"werk"===e)return He.cb.checked.call(this.nodes[e])}},Pe={init(){let e;if(!["index","thread"].includes(n.VIEW)||!t.Sauce)return;He.addClass(i,"show-sauce");const o=[];for(e of t.sauces.split("\n")){var a;"#"!==e[0]&&(a=this.parseLink(e))&&o.push(a)}return o.length?(this.links=o,this.link=He.el("a",{target:"_blank",className:"sauce"}),l.Post.push({name:"Sauce",cb:this.node})):void 0},parseLink(e){if(!(e=e.trim()))return null;const t=m(),n=e.split(/;(?=(?:text|boards|types|regexp|sandbox):?)/);for(let e=0;e!/^.?MD5$/.test(e))).length?(a=Pe.link.cloneNode(!1),a.dataset.skip="1",a):d.length?null:(a=Pe.link.cloneNode(!1),a.href=l.url,a.textContent=l.text,/^javascript:/i.test(l.url)&&a.removeAttribute("target"),a)},node(){if(!this.isClone)for(var e of this.files)Pe.file(this,e)},file(e,t){let n,o;const a=[],i=[];for(n of Pe.links)(o=Pe.createSauceLink(n,e,t))&&(a.push(He.tn(" "),o),o.dataset.skip&&i.push([n,o]));if(He.add(t.text,a),i.length){var r=new MutationObserver((function(){if(t.text.dataset.md5){for([n,o]of i){var a;(a=Pe.createSauceLink(n,e,t))&&He.replace(o,a)}return r.disconnect()}}));return r.observe(t.text,{attributes:!0})}},formatters:{TURL:(e,t)=>t.thumbURL,URL:(e,t)=>t.url,IMG:(e,t,n)=>["gif","jpg","jpeg","png"].includes(n)?t.url:t.thumbURL,MD5:(e,t)=>t.MD5,sMD5:(e,t)=>t.MD5?.replace(/[+/=]/g,(e=>({"+":"-","/":"_","=":""}[e]))),hMD5(e,t){ +if(t.MD5)return atob(t.MD5).map((e=>`0${e.charCodeAt(0).toString(16)}`.slice(-2))).join("")},board:e=>e.board.ID,name:(e,t)=>t.name,"%":()=>"%",semi:()=>";"}},Me={init(){if(!(this.enabled=t.Gallery&&["index","thread"].includes(n.VIEW)))return;this.delay=t["Slide Delay"];const e=He.el("a",{href:"javascript:;",title:"Gallery",textContent:"🖼︎"});return He.on(e,"click",this.cb.toggle),Je.addShortcut("gallery",e,530),l.Post.push({name:"Gallery",cb:this.node})},node(){return(()=>{const e=[];for(var o of this.files)o.thumb&&(Me.nodes&&(Me.generateThumb(this,o),Me.nodes.total.textContent=Me.images.length),t["Image Expansion"]||"tinyboard"===n.SITE.software&&Lt.jsEnabled?e.push(void 0):e.push(He.on(o.thumbLink,"click",Me.cb.image)));return e})()},build(e){let o,r;const{cb:s}=Me;t["Fullscreen Gallery"]&&(He.one(a,"fullscreenchange mozfullscreenchange webkitfullscreenchange",(()=>He.on(a,"fullscreenchange mozfullscreenchange webkitfullscreenchange",s.close))),i.mozRequestFullScreen?.(), +i.webkitRequestFullScreen?.(Element.ALLOW_KEYBOARD_INPUT)),Me.images=[];const l=Me.nodes={};Me.fileIDs=m(),Me.slideshow=!1,l.el=o=He.el("div",{id:"a-gallery"}),He.extend(o,{innerHTML:'
            \n \n \n \n \n ×\n \n
            \n \n / \n \n \n \n
            \n
            \n
            \n \n
            \n
            \n
            \n
            \n'});const d={buttons:".gal-buttons",frame:".gal-image", +name:".gal-name",count:".count",total:".total",sauce:".gal-sauce",thumbs:".gal-thumbnails",next:".gal-image a",current:".gal-image img"};for(var c in d){var h=d[c];l[c]=He(h,o)}const p=He(".menu-button",o);for(var g of(l.menu=new F.Menu("gallery"),He.on(l.frame,"click",s.blank),t["Mouse Wheel Volume"]&&He.on(l.frame,"wheel",$.wheel),He.on(l.next,"click",s.click),He.on(l.name,"click",j.download),He.on(He(".gal-prev",o),"click",s.prev),He.on(He(".gal-next",o),"click",s.next),He.on(He(".gal-start",o),"click",s.start),He.on(He(".gal-stop",o),"click",s.stop),He.on(He(".gal-close",o),"click",s.close),He.on(p,"click",(function(e){return l.menu.toggle(e,this,n)})),Me.menu.createSubEntries()))g.order=0,l.menu.addEntry(g);for(var f of(He.on(a,"keydown",s.keybinds),t.Keybinds&&He.off(a,"keydown",Fe.keydown),He.on(window,"resize",Me.cb.setHeight),u(n.SITE.selectors.file.thumb))){var b;if(b=Qe.postFromNode(f))for(var A of b.files)if(A.thumb&&(Me.generateThumb(b,A), +!e&&Me.fileIDs[`${b.fullID}.${A.index}`])){var v=A.thumbLink;Je.getTopOf(v)+v.getBoundingClientRect().height>=0&&(e=v)}}return He.addClass(i,"gallery-open"),He.add(a.body,o),l.thumbs.scrollTop=0,l.current.parentElement.scrollTop=0,e&&(r=He(`[href='${e.href}']`,l.thumbs)),r||(r=Me.images[Me.images.length-1]),r&&Me.open(r),i.style.overflow="hidden",l.total.textContent=Me.images.length},generateThumb(e,n){if(e.isClone||e.isHidden)return;if(!n||!n.thumb||!n.isImage&&!n.isVideo&&!t["PDF in Gallery"])return;if(Me.fileIDs[`${e.fullID}.${n.index}`])return;Me.fileIDs[`${e.fullID}.${n.index}`]=!0;const o=He.el("a",{className:"gal-thumb",href:n.url,target:"_blank",title:n.name});o.dataset.id=Me.images.length,o.dataset.post=e.fullID,o.dataset.file=n.index;const a=n.thumb.cloneNode(!1);return a.style.cssText="",He.add(o,a),He.on(o,"click",Me.cb.open),Me.images.push(o),He.add(Me.nodes.thumbs,o)},load(e,t){const n=e.href.match(/\w*$/),o=He.getOwn({webm:"video",mp4:"video",ogv:"video",pdf:"iframe" +},n)||"img",a=He.el(o);return He.extend(a.dataset,e.dataset),He.on(a,"error",t),a.src=e.href,a},open(e){let o,a,r;const{nodes:s}=Me,l=+s.current.dataset.id,d=+e.dataset.id;if((o=Me.images[l])&&He.rmClass(o,"gal-highlight"),He.addClass(e,"gal-highlight"),s.thumbs.scrollTop=e.offsetTop+e.offsetHeight/2-s.thumbs.clientHeight/2,Me.cache?.dataset.id===""+d?(a=Me.cache,He.off(a,"error",Me.cacheError),He.on(a,"error",Me.error)):a=Me.load(e,Me.error),He.off(s.current,"error",Me.error),j.pause(s.current),He.replace(s.current,a),s.current=a,"VIDEO"===a.nodeName&&(a.loop=!0,$.setup(a),t.Autoplay&&a.play(),t["Show Controls"]&&j.addControls(a)),i.classList.toggle("gal-pdf","IFRAME"===a.nodeName),Me.cb.setHeight(),s.count.textContent=+e.dataset.id+1,s.name.download=s.name.textContent=e.title,s.name.href=e.href,s.frame.scrollTop=0,s.next.focus(),He.rmAll(s.sauce),t.Sauce&&Pe.links&&(r=n.posts.get(a.dataset.post))){const e=[];for(var c of Pe.links){var h +;(h=Pe.createSauceLink(c,r,r.files[+a.dataset.file]))&&e.push(He.tn(" "),h)}He.add(s.sauce,e)}if(Me.slideshow&&(d>l||l===Me.images.length-1&&0===d)?Me.setupTimer():Me.cb.stop(),t["Scroll to Post"]&&(r=n.posts.get(a.dataset.post))&&Je.scrollTo(r.nodes.root),isNaN(l)||d===(l+1)%Me.images.length)return Me.cache=Me.load(Me.images[(d+1)%Me.images.length],Me.cacheError)},error(){if(this.error?.code===MediaError.MEDIA_ERR_DECODE)return new Ke("error","Corrupt or unplayable video",30);if(j.isFromArchive(this))return;const e=n.posts.get(this.dataset.post),t=e.files[+this.dataset.file];return j.error(this,e,t,null,(e=>{if(e)return Me.images[+this.dataset.id].href=e,Me.nodes.current===this?this.src=e:void 0}))},cacheError:()=>delete Me.cache,cleanupTimer(){clearTimeout(Me.timeoutID);const{current:e}=Me.nodes;return He.off(e,"canplaythrough load",Me.startTimer),He.off(e,"ended",Me.cb.next)},startTimer:()=>Me.timeoutID=setTimeout(Me.checkTimer,Me.delay*b),setupTimer(){Me.cleanupTimer() +;const{current:e}=Me.nodes,t="VIDEO"===e.nodeName;return t&&e.play(),(t?e.readyState>=4:e.complete)||"IFRAME"===e.nodeName?Me.startTimer():He.on(e,t?"canplaythrough":"load",Me.startTimer)},checkTimer(){const{current:e}=Me.nodes;return"VIDEO"!==e.nodeName||e.paused?Me.cb.next():(He.on(e,"ended",Me.cb.next),e.loop=!1)},cb:{keybinds(e){let n;if(!(n=Fe.keyCode(e)))return;const o=(()=>{switch(n){case t.Close:case t["Open Gallery"]:return Me.cb.close;case t["Next Gallery Image"]:return Me.cb.next;case t["Advance Gallery"]:return Me.cb.advance;case t["Previous Gallery Image"]:return Me.cb.prev;case t.Pause:return Me.cb.pause;case t.Slideshow:return Me.cb.toggleSlideshow;case t["Rotate image anticlockwise"]:return Me.cb.rotateLeft;case t["Rotate image clockwise"]:return Me.cb.rotateRight;case t["Download Gallery Image"]:return Me.cb.download}})();return o?(e.stopPropagation(),e.preventDefault(),o()):void 0},open(e){if(e&&e.preventDefault(),this)return Me.open(this)},image(e){ +return e.preventDefault(),e.stopPropagation(),Me.build(this)},prev:()=>Me.cb.open.call(Me.images[+Me.nodes.current.dataset.id-1]||Me.images[Me.images.length-1]),next:()=>Me.cb.open.call(Me.images[+Me.nodes.current.dataset.id+1]||Me.images[0]),click(e){if(!j.onControls(e))return e.preventDefault(),Me.cb.advance()},advance:()=>!t.Autoplay&&Me.nodes.current.paused?Me.nodes.current.play():Me.cb.next(),toggle:()=>(Me.nodes?Me.cb.close:Me.build)(),blank(e){if(e.target===this)return Me.cb.close()},toggleSlideshow:()=>Me.cb[Me.slideshow?"stop":"start"](),download:()=>He(".gal-name").click(),pause(){Me.cb.stop();const{current:e}=Me.nodes;if("VIDEO"===e.nodeName)return e[e.paused?"play":"pause"]()},start:()=>(He.addClass(Me.nodes.buttons,"gal-playing"),Me.slideshow=!0,Me.setupTimer()),stop(){if(!Me.slideshow)return;Me.cleanupTimer();const{current:e}=Me.nodes;return"VIDEO"===e.nodeName&&(e.loop=!0),He.rmClass(Me.nodes.buttons,"gal-playing"),Me.slideshow=!1},rotateLeft:()=>Me.cb.rotate(270), +rotateRight:()=>Me.cb.rotate(90),rotate:f(100,(function(e){const{current:t}=Me.nodes;if("IFRAME"!==t.nodeName)return t.dataRotate=((t.dataRotate||0)+e)%360,t.style.transform=`rotate(${t.dataRotate}deg)`,Me.cb.setHeight()})),close:()=>(He.off(Me.nodes.current,"error",Me.error),j.pause(Me.nodes.current),He.rm(Me.nodes.el),He.rmClass(i,"gallery-open"),t["Fullscreen Gallery"]&&(He.off(a,"fullscreenchange mozfullscreenchange webkitfullscreenchange",Me.cb.close),a.mozCancelFullScreen?.(),a.webkitExitFullscreen?.()),delete Me.nodes,delete Me.fileIDs,i.style.overflow="",He.off(a,"keydown",Me.cb.keybinds),t.Keybinds&&He.on(a,"keydown",Fe.keydown),He.off(window,"resize",Me.cb.setHeight),clearTimeout(Me.timeoutID)),setFitness(){return(this.checked?He.addClass:He.rmClass)(i,`gal-${this.name.toLowerCase().replace(/\s+/g,"-")}`)},setHeight:f(100,(function(){let e,o,a;const{current:r,frame:s}=Me.nodes,{style:l}=r +;if(t["Stretch to Fit"]&&(e=n.posts.get(r.dataset.post)?.files[+r.dataset.file].dimensions)){const[t,n]=Array.from(e.split("x"));let o=s.clientWidth,d=i.clientHeight-25;(r.dataRotate||0)%180==90&&([o,d]=Array.from([d,o])),a=Math.min(d,n/t*o),l.minHeight=a+"px",l.minWidth=t/n*a+"px"}else l.minHeight=l.minWidth="";return(r.dataRotate||0)%180==90?(l.maxWidth=t["Fit Height"]?i.clientHeight-25+"px":"none",l.maxHeight=t["Fit Width"]?`${s.clientWidth}px`:"none",o=(r.clientWidth-r.clientHeight)/2,l.margin=`${o}px ${-o}px`):l.maxWidth=l.maxHeight=l.margin=""})),setDelay(){return Me.delay=+this.value}},menu:{init(){if(!Me.enabled)return;const e=He.el("span",{textContent:"Gallery",className:"gallery-link"});return Je.menu.addEntry({el:e,order:105,subEntries:Me.menu.createSubEntries()})},createSubEntry(e){const t=F.checkbox(e,e),n=t.firstElementChild;return["Hide Thumbnails","Fit Width","Fit Height"].includes(e)&&He.on(n,"change",Me.cb.setFitness),He.event("change",null,n), +He.on(n,"change",He.cb.checked),["Hide Thumbnails","Fit Width","Fit Height","Stretch to Fit"].includes(e)&&He.on(n,"change",Me.cb.setHeight),{el:t}},createSubEntries(){const e=["Hide Thumbnails","Fit Width","Fit Height","Stretch to Fit","Scroll to Post"].map((e=>Me.menu.createSubEntry(e))),t=He.el("label",{innerHTML:'Slide Delay: '}),n=t.firstElementChild;return n.value=Me.delay,He.on(n,"change",Me.cb.setDelay),He.on(n,"change",He.cb.value),e.push({el:t}),e}}},Ne={init(){if(["index","thread","archive"].includes(n.VIEW)&&t.Linkify&&(t.Embedding||t["Link Title"]||t["Cover Preview"])){for(var e of(this.types=m(),this.ordered_types))this.types[e.key]=e;return t.Embedding&&"archive"!==n.VIEW&&(this.dialog=F.dialog("embedding",{ +innerHTML:'
            \n
            \n \n ×\n
            \n
            \n'}),this.media=He("#media-embed",this.dialog),He.one(a,"4chanXInitFinished",this.ready),He.on(a,"IndexRefreshInternal",(()=>n.posts.forEach((function(e){for(e of[e,...Array.from(e.clones)])for(var t of e.nodes.embedlinks)Ne.cb.catalogRemove.call(t)}))))),t["Link Title"]?He.on(a,"4chanXInitFinished PostsInserted",(function(){for(var e in Ne.types){var t=Ne.types[e];t.title?.batchSize&&Ne.flushTitles(t.title)}})):void 0}},events(e){let o,a,i;if("archive"!==n.VIEW){if(t.Embedding)for(a=0,i=e.nodes.embedlinks=u(".embedder",e.nodes.comment);o=i[a++];)He.on(o,"click",Ne.cb.click),He.hasClass(o,"embedded")&&Ne.cb.toggle.call(o);if(t["Cover Preview"])for(a=0,i=u(".linkify",e.nodes.comment);o=i[a++];){var r;(r=Ne.services(o))&&Ne.preview(r)}else;}},process(e,o){let a +;if((t.Embedding||t["Link Title"]||t["Cover Preview"])&&!He.x("ancestor::pre",e))return(a=Ne.services(e))&&(a.post=o,t.Embedding&&"archive"!==n.VIEW&&Ne.embed(a),t["Link Title"]&&Ne.title(a),t["Cover Preview"]&&"archive"!==n.VIEW)?Ne.preview(a):void 0},services(e){const{href:t}=e;for(var n of Ne.ordered_types){var o;if(o=n.regExp.exec(t))return{key:n.key,uid:o[1],options:o[2],link:e}}},embed(e){const{key:n,uid:o,options:a,link:r,post:s}=e,{href:l}=r;He.addClass(r,n.toLowerCase());const d=He.el("a",{className:"embedder",href:"javascript:;"},{innerHTML:"(unembed)"}),c={key:n,uid:o,options:a,href:l};for(var h in c){var u=c[h];d.dataset[h]=u}if(He.on(d,"click",Ne.cb.click),He.after(r,[He.tn(" "),d]),s.nodes.embedlinks.push(d),t["Auto-embed"]&&!t["Floating Embeds"]&&!s.isFetchedQuote)return He.hasClass(i,"catalog-mode")?He.addClass(d,"embed-removed"):Ne.cb.toggle.call(d)},ready(){if(Lt.isThisPageLegit())return He.addClass(Ne.dialog,"empty"), +He.on(He(".close",Ne.dialog),"click",Ne.closeFloat),He.on(He(".move",Ne.dialog),"mousedown",Ne.dragEmbed),He.on(He(".jump",Ne.dialog),"click",(function(){if(i.contains(Ne.lastEmbed))return Je.scrollTo(Ne.lastEmbed)})),He.add(a.body,Ne.dialog)},closeFloat:()=>(delete Ne.lastEmbed,He.addClass(Ne.dialog,"empty"),He.replace(Ne.media.firstChild,He.el("div"))),dragEmbed(){const{style:e}=Ne.media;return Ne.dragEmbed.mouseup?(He.off(a,"mouseup",Ne.dragEmbed),Ne.dragEmbed.mouseup=!1,void(e.pointerEvents="")):(He.on(a,"mouseup",Ne.dragEmbed),Ne.dragEmbed.mouseup=!0,e.pointerEvents="none")},title(e){let t;const{key:n,uid:o,options:a,link:i,post:r}=e;if(t=Ne.types[n].title)return He.addClass(i,n.toLowerCase()),t.batchSize?((t.queue||(t.queue=[])).push(e),t.queue.length>=t.batchSize?Ne.flushTitles(t):void 0):qe.cache(t.api(o),(function(){return Ne.cb.title(this,e)}))},flushTitles(e){let t;const{queue:n}=e;if(!n?.length)return;e.queue=[];return qe.cache(e.api((()=>{const e=[] +;for(t of n)e.push(t.uid);return e})()),(function(){for(t of n)Ne.cb.title(this,t)}))},preview(e){let t;const{key:n,uid:o,link:a}=e;if(t=Ne.types[n].preview)return He.on(a,"mouseover",(function(e){const n=t.url(o),{height:i}=t,r=He.el("img",{src:n,id:"ihover"});return He.add(Je.hover,r),F.hover({root:a,el:r,latestEvent:e,endEvents:"mouseout click",height:i})}))},cb:{click(e){if(e.preventDefault(),He.hasClass(this,"embedded")||!t["Floating Embeds"]&&!He.hasClass(i,"catalog-mode"))return Ne.cb.toggle.call(this);{let e;if(!(e=Ne.media.firstChild))return;return He.replace(e,Ne.cb.embed(this)),Ne.lastEmbed=Qe.postFromNode(this).nodes.root,He.rmClass(Ne.dialog,"empty")}},toggle(){return He.hasClass(this,"embedded")?He.rm(this.nextElementSibling):He.after(this,Ne.cb.embed(this)),He.toggleClass(this,"embedded")},embed(e){let t,n;const o=He.el("div",{className:"media-embed"});return He.add(o,t=(n=Ne.types[e.dataset.key]).el(e)), +t.style.cssText=null!=n.style?n.style:"border: none; width: 640px; height: 360px;",o},catalogRemove(){const e=He.hasClass(i,"catalog-mode");if(e&&He.hasClass(this,"embedded")||!e&&He.hasClass(this,"embed-removed"))return Ne.cb.toggle.call(this),He.toggleClass(this,"embed-removed")},title(e,t){let n;const{key:o,uid:a,options:i,link:r,post:s}=t,l=Ne.types[o].title;let{status:d}=e;if([200,304].includes(d)&&l.status&&(d=l.status(e.response)[0]),d)for(var c of(n=`[${o}] ${(()=>{switch(d){case 200:case 304:return n=l.text(e.response,a),"string"==typeof n?n:n=r.textContent;case 404:return"Not Found";case 403:case 401:return"Forbidden or Private";default:return`${d}'d`}})()}`,r.dataset.original=r.textContent,r.textContent=n,s.clones))for(var h of u("a.linkify",c.nodes.comment))h.href===r.href&&(null==h.dataset.original&&(h.dataset.original=h.textContent),h.textContent=n)}},ordered_types:[{key:"audio",regExp:/^[^?#]+\.(?:mp3|m4a|oga|wav|flac)(?:[?#]|$)/i,style:"",el:e=>He.el("audio",{ +controls:!0,preload:"auto",src:e.dataset.href})},{key:"image",regExp:/^[^?#]+\.(?:gif|png|jpg|jpeg|bmp|webp)(?::\w+)?(?:[?#]|$)/i,style:"",el(e){const t=o(e.dataset.href);return He.el("div",{innerHTML:``})}},{key:"video",regExp:/^[^?#]+\.(?:og[gv]|webm|mp4)(?:[?#]|$)/i,style:"max-width: 80vw; max-height: 80vh;",el(e){const t=He.el("video",{hidden:!0,controls:!0,preload:"auto",src:e.dataset.href,loop:O.test(e.dataset.href.split("/")[2])});return He.on(t,"loadedmetadata",(function(){return 0===t.videoHeight&&t.parentNode?He.replace(t,Ne.types.audio.el(e)):t.hidden=!1})),t}},{key:"PeerTube",regExp:/^(\w+:\/\/[^\/]+\/videos\/watch\/\w{8}-\w{4}-\w{4}-\w{4}-\w{12})(.*)/,el(e){let t;const n=(t=e.dataset.options.match(/[?&](start=\w+)/))?`?${t[1]}`:"",o=He.el("iframe",{src:e.dataset.uid.replace("/videos/watch/","/videos/embed/")+n});return o.setAttribute("allowfullscreen","true"),o}},{key:"BitChute", +regExp:/^\w+:\/\/(?:www\.)?bitchute\.com\/video\/([\w\-]+)/,el(e){const t=He.el("iframe",{src:`https://www.bitchute.com/embed/${e.dataset.uid}/`});return t.setAttribute("allowfullscreen","true"),t}},{key:"Clyp",regExp:/^\w+:\/\/(?:www\.)?clyp\.it\/(\w{8})/,style:"border: 0; width: 640px; height: 160px;",el:e=>He.el("iframe",{src:`https://clyp.it/${e.dataset.uid}/widget`}),title:{api:e=>`https://api.clyp.it/oembed?url=https://clyp.it/${e}`,text:e=>e.title}},{key:"Dailymotion",regExp:/^\w+:\/\/(?:(?:www\.)?dailymotion\.com\/(?:embed\/)?video|dai\.ly)\/([A-Za-z0-9]+)[^?]*(.*)/,el(e){let t;const n=(t=e.dataset.options.match(/[?&](start=\d+)/))?`?${t[1]}`:"",o=He.el("iframe",{src:`//www.dailymotion.com/embed/video/${e.dataset.uid}${n}`});return o.setAttribute("allowfullscreen","true"),o},title:{api:e=>`https://api.dailymotion.com/video/${e}`,text:e=>e.title},preview:{url:e=>`https://www.dailymotion.com/thumbnail/video/${e}`,height:240}},{key:"Gfycat", +regExp:/^\w+:\/\/(?:www\.)?gfycat\.com\/(?:iframe\/)?(\w+)/,el(e){const t=He.el("iframe",{src:`//gfycat.com/ifr/${e.dataset.uid}`});return t.setAttribute("allowfullscreen","true"),t}},{key:"Gist",regExp:/^\w+:\/\/gist\.github\.com\/[\w\-]+\/(\w+)/,style:"",el:function(){let e=0;return function(t){const n=He.el("pre",{hidden:!0,id:"gist-embed-"+e++});return qe.cache(`https://api.github.com/gists/${t.dataset.uid}`,(function(){return n.textContent=Object.values(this.response.files)[0].content,n.className="prettyprint",He.global((()=>window.prettyPrint?.((function(){}),document.getElementById(document.currentScript.dataset.id).parentNode)),{id:n.id}),n.hidden=!1})),n}}(),title:{api:e=>`https://api.github.com/gists/${e}`,text({files:e}){for(var t in e)if(e.hasOwnProperty(t))return t}}},{key:"InstallGentoo",regExp:/^\w+:\/\/paste\.installgentoo\.com\/view\/(?:raw\/|download\/|embed\/)?(\w+)/,el:e=>He.el("iframe",{src:`https://paste.installgentoo.com/view/embed/${e.dataset.uid}`})},{ +key:"LiveLeak",regExp:/^\w+:\/\/(?:\w+\.)?liveleak\.com\/.*\?.*[tif]=(\w+)/,el(e){const t=He.el("iframe",{src:`https://www.liveleak.com/e/${e.dataset.uid}`});return t.setAttribute("allowfullscreen","true"),t}},{key:"Loopvid",regExp:/^\w+:\/\/(?:www\.)?loopvid.appspot.com\/#?((?:pf|kd|lv|gd|gh|db|dx|nn|cp|wu|ig|ky|mf|m2|pc|1c|pi|ni|wl|ko|mm|ic|gc)\/[\w\-\/]+(?:,[\w\-\/]+)*|fc\/\w+\/\d+|https?:\/\/.+)/,style:"max-width: 80vw; max-height: 80vh;",el(e){const t=He.el("video",{controls:!0,preload:"auto",loop:!0});if(/^http/.test(e.dataset.uid))return He.add(t,He.el("source",{src:e.dataset.uid})),t;const[n,o,a]=Array.from(e.dataset.uid.match(/(\w+)\/(.*)/)),i=(()=>{switch(o){case"gd":case"wu":case"fc":return[""];case"gc":return["giant","fat","zippy"];default:return[".webm",".mp4"]}})();for(var r of a.split(","))for(var s of i){var l=`${r}${s}`,d=(()=>{switch(o){case"pf":return[`https://kastden.org/_loopvid_media/pf/${l}`,`https://web.archive.org/web/2/http://a.pomf.se/${l}`];case"kd": +return[`https://kastden.org/loopvid/${l}`];case"lv":return[`https://lv.kastden.org/${l}`];case"gd":return[`https://docs.google.com/uc?export=download&id=${l}`];case"gh":return[`https://googledrive.com/host/${l}`];case"db":return[`https://dl.dropboxusercontent.com/u/${l}`];case"dx":return[`https://dl.dropboxusercontent.com/${l}`];case"nn":return[`https://kastden.org/_loopvid_media/nn/${l}`];case"cp":return[`https://copy.com/${l}`];case"wu":return[`http://webmup.com/${l}/vid.webm`];case"ig":return[`https://i.imgur.com/${l}`];case"ky":return[`https://kastden.org/_loopvid_media/ky/${l}`];case"mf":return[`https://kastden.org/_loopvid_media/mf/${l}`,`https://web.archive.org/web/2/https://d.maxfile.ro/${l}`];case"m2":return[`https://kastden.org/_loopvid_media/m2/${l}`];case"pc":return[`https://kastden.org/_loopvid_media/pc/${l}`,`https://web.archive.org/web/2/http://a.pomf.cat/${l}`];case"1c":return[`http://b.1339.cf/${l}`];case"pi": +return[`https://kastden.org/_loopvid_media/pi/${l}`,`https://web.archive.org/web/2/https://u.pomf.is/${l}`];case"ni":return[`https://kastden.org/_loopvid_media/ni/${l}`,`https://web.archive.org/web/2/https://u.nya.is/${l}`];case"wl":return[`http://webm.land/media/${l}`];case"ko":return[`https://kordy.kastden.org/loopvid/${l}`];case"mm":return[`https://kastden.org/_loopvid_media/mm/${l}`,`https://web.archive.org/web/2/https://my.mixtape.moe/${l}`];case"ic":return[`https://media.8ch.net/file_store/${l}`];case"fc":return[`//${O.host()}/${l}.webm`];case"gc":return[`https://${s}.gfycat.com/${r}.webm`]}})();for(var c of d)He.add(t,He.el("source",{src:c}))}return t}},{key:"Openings.moe",regExp:/^\w+:\/\/openings.moe\/\?video=([^.&=]+)/,style:"width: 1280px; height: 720px; max-width: 80vw; max-height: 80vh;",el(e){const t=He.el("iframe",{src:`https://openings.moe/?video=${e.dataset.uid}`});return t.setAttribute("allowfullscreen","true"),t}},{key:"Pastebin", +regExp:/^\w+:\/\/(?:\w+\.)?pastebin\.com\/(?!u\/)(?:[\w.]+(?:\/|\?i\=))?(\w+)/,el:e=>He.el("iframe",{src:`//pastebin.com/embed_iframe.php?i=${e.dataset.uid}`})},{key:"SoundCloud",regExp:/^\w+:\/\/(?:www\.)?(?:soundcloud\.com\/|snd\.sc\/)([\w\-\/]+)/,style:"border: 0; width: 500px; height: 400px;",el:e=>He.el("iframe",{src:`https://w.soundcloud.com/player/?visual=true&show_comments=false&url=https%3A%2F%2Fsoundcloud.com%2F${encodeURIComponent(e.dataset.uid)}`}),title:{api:e=>`${location.protocol}//soundcloud.com/oembed?format=json&url=https%3A%2F%2Fsoundcloud.com%2F${encodeURIComponent(e)}`,text:e=>e.title}},{key:"StrawPoll",regExp:/^\w+:\/\/(?:www\.)?strawpoll\.me\/(?:embed_\d+\/)?(\d+(?:\/r)?)/,style:"border: 0; width: 600px; height: 406px;",el:e=>He.el("iframe",{src:`https://www.strawpoll.me/embed_1/${e.dataset.uid}`})},{key:"Streamable",regExp:/^\w+:\/\/(?:www\.)?streamable\.com\/(\w+)/,el(e){const t=He.el("iframe",{src:`https://streamable.com/o/${e.dataset.uid}`}) +;return t.setAttribute("allowfullscreen","true"),t},title:{api:e=>`https://api.streamable.com/oembed?url=https://streamable.com/${e}`,text:e=>e.title}},{key:"TwitchTV",regExp:/^\w+:\/\/(?:www\.|secure\.|clips\.|m\.)?twitch\.tv\/(\w[^#\&\?]*)/,el(e){let t,n=e.dataset.href.match(/^\w+:\/\/(?:(clips\.)|\w+\.)?twitch\.tv\/(?:\w+\/)?(clip\/)?(\w[^#\&\?]*)/);if(n[1]||n[2])t=`//clips.twitch.tv/embed?clip=${n[3]}&parent=${location.hostname}`;else{let o;n=e.dataset.uid.match(/(\w+)(?:\/(?:v\/)?(\d+))?/),t=`//player.twitch.tv/?${n[2]?`video=v${n[2]}`:`channel=${n[1]}`}&autoplay=false&parent=${location.hostname}`,(o=e.dataset.href.match(/\bt=(\w+)/))&&(t+=`&time=${o[1]}`)}const o=He.el("iframe",{src:t});return o.setAttribute("allowfullscreen","true"),o}},{key:"Twitter",regExp:/^\w+:\/\/(?:www\.|mobile\.)?twitter\.com\/(\w+\/status\/\d+)/,style:"border: none; width: 550px; height: 250px; overflow: hidden; resize: both;",el(e){const t=He.el("iframe");He.on(t,"load",(function(){ +return this.contentWindow.postMessage({element:"t",query:"height"},"https://twitframe.com")}));var n=function(e){if(e.source===t.contentWindow&&"https://twitframe.com"===e.origin)return He.off(window,"message",n),(o||t).style.height=+He.minmax(e.data.height,250,.8*i.clientHeight)+"px"};if(He.on(window,"message",n),t.src=`https://twitframe.com/show?url=https://twitter.com/${e.dataset.uid}`,"gecko"===He.engine){t.style.cssText="border: none; width: 100%; height: 100%;";var o=He.el("div");return He.add(o,t),o}return t}},{key:"VidLii",regExp:/^\w+:\/\/(?:www\.)?vidlii\.com\/watch\?v=(\w{11})/,style:"border: none; width: 640px; height: 392px;",el(e){const t=He.el("iframe",{src:`https://www.vidlii.com/embed?v=${e.dataset.uid}&a=0`});return t.setAttribute("allowfullscreen","true"),t}},{key:"Vimeo",regExp:/^\w+:\/\/(?:www\.)?vimeo\.com\/(\d+)/,el(e){const t=He.el("iframe",{src:`//player.vimeo.com/video/${e.dataset.uid}?wmode=opaque`});return t.setAttribute("allowfullscreen","true"),t},title:{ +api:e=>`https://vimeo.com/api/oembed.json?url=https://vimeo.com/${e}`,text:e=>e.title}},{key:"Vine",regExp:/^\w+:\/\/(?:www\.)?vine\.co\/v\/(\w+)/,style:"border: none; width: 500px; height: 500px;",el:e=>He.el("iframe",{src:`https://vine.co/v/${e.dataset.uid}/card`})},{key:"Vocaroo",regExp:/^\w+:\/\/(?:(?:www\.|old\.)?vocaroo\.com|voca\.ro)\/((?:i\/)?\w+)/,style:"",el(e){const t=He.el("iframe");return t.width=300,t.height=60,t.setAttribute("frameborder",0),t.src=`https://vocaroo.com/embed/${e.dataset.uid.replace(/^i\//,"")}?autoplay=0`,t}},{key:"YouTube",regExp:/^\w+:\/\/(?:youtu.be\/|[\w.]*youtube[\w.]*\/.*(?:v=|\bembed\/|\bv\/|live\/))([\w\-]{11})(.*)/,el(e){let t=e.dataset.options.match(/\b(?:star)?t\=(\w+)/);t&&(t=t[1]),t&&!/^\d+$/.test(t)&&(t+=" 0h0m0s",t=3600*t.match(/(\d+)h/)[1]+60*t.match(/(\d+)m/)[1]+1*t.match(/(\d+)s/)[1]);const n=He.el("iframe",{src:`//www.youtube.com/embed/${e.dataset.uid}?rel=0&wmode=opaque${t?"&start="+t:""}`}) +;return n.setAttribute("allowfullscreen","true"),n},title:{api:e=>`https://www.youtube.com/oembed?url=https%3A//www.youtube.com/watch%3Fv%3D${e}&format=json`,text:e=>e.title,status(e){if(e.error){const t=e.error.match(/^(\d*)\s*(.*)/);return[+t[1],t[2]]}return[200,"OK"]}},preview:{url:e=>`https://img.youtube.com/vi/${e}/0.jpg`,height:360}}]},Fe={init(){if(t.Keybinds){for(var e in c.hotkeys)He.sync(e,Fe.sync);var n=function(){for(var e of(He.off(a,"4chanXInitFinished",n),He.on(a,"keydown",Fe.keydown),u("[accesskey]")))e.removeAttribute("accesskey")};return He.on(a,"4chanXInitFinished",n)}},sync:(e,n)=>t[n]=e,keydown(e){let o,a,i,r,s;if(!(o=Fe.keyCode(e)))return;const{target:l}=e;if(!["INPUT","TEXTAREA"].includes(l.nodeName)||/(Esc|Alt|Ctrl|Meta|Shift\+\w{2,})/.test(o)&&!/^Alt\+(\d|Up|Down|Left|Right)$/.test(o)){switch(["index","thread"].includes(n.VIEW)&&(i=L.getThread(),a=Qe.threadFromRoot(i)),o){case t["Toggle board list"]:if(!t["Custom Board Navigation"])return;Je.toggleBoardList() +;break;case t["Toggle header"]:Je.toggleBarVisibility();break;case t["Open empty QR"]:if(!Oe.postingIsEnabled)return;Fe.qr();break;case t["Open QR"]:if(!Oe.postingIsEnabled||!i)return;Fe.qr(i);break;case t["Open settings"]:Re.open();break;case t.Close:if(Re.dialog)Re.close();else if((s=u(".notification")).length)for(var d of s)He(".close",d).click();else if(Oe.nodes&&!Oe.nodes.el.hidden&&"none"!==window.getComputedStyle(Oe.nodes.form).display)t["Persistent QR"]?Oe.hide():Oe.close();else{if(!Ne.lastEmbed)return;Ne.closeFloat()}break;case t["Spoiler tags"]:if("TEXTAREA"!==l.nodeName)return;Fe.tags("spoiler",l);break;case t["Code tags"]:if("TEXTAREA"!==l.nodeName)return;Fe.tags("code",l);break;case t["Eqn tags"]:if("TEXTAREA"!==l.nodeName)return;Fe.tags("eqn",l);break;case t["Math tags"]:if("TEXTAREA"!==l.nodeName)return;Fe.tags("math",l);break;case t["SJIS tags"]:if("TEXTAREA"!==l.nodeName)return;Fe.tags("sjis",l);break;case t["Toggle sage"]:if(!Oe.nodes||Oe.nodes.el.hidden)return +;Fe.sage();break;case t["Toggle Cooldown"]:if(!Oe.nodes||Oe.nodes.el.hidden||!He.hasClass(Oe.nodes.fileSubmit,"custom-cooldown"))return;Oe.toggleCustomCooldown();break;case t["Post from URL"]:if(!Oe.postingIsEnabled)return;Oe.handleUrl("");break;case t["Add new post"]:if(!Oe.postingIsEnabled)return;Oe.addPost();break;case t["Submit QR"]:if(!Oe.nodes||Oe.nodes.el.hidden)return;Oe.status()||Oe.submit();break;case t.Update:switch(n.VIEW){case"thread":if(!Te.enabled)return;Te.update();break;case"index":if(!se.enabled)return;se.update();break;default:return}break;case t.Watch:if(!oe.enabled||!a)return;oe.toggle(a);break;case t["Update thread watcher"]:if(!oe.enabled)return;oe.buttonFetchAll();break;case t["Toggle thread watcher"]:if(!oe.enabled)return;oe.toggleWatcher();break;case t["Toggle threading"]:if(!Se.ready)return;Se.toggleThreading();break;case t["Mark thread read"]:if("index"!==n.VIEW||!a||!te.enabled)return;te.markRead.call(i);break;case t["Expand image"]:if(!q.enabled||!i)return +;var c=Qe.postFromNode(Fe.post(i));c.file&&q.toggle(c);break;case t["Expand images"]:if(!q.enabled)return;q.cb.toggleAll();break;case t["Open Gallery"]:if(!Me.enabled)return;Me.cb.toggle();break;case t.fappeTyme:if(!Be.nodes?.fappe)return;Be.toggle("fappe");break;case t.werkTyme:if(!Be.nodes?.werk)return;Be.toggle("werk");break;case t["Front page"]:se.enabled?se.userPageNav(1):location.href=`/${n.BOARD}/`;break;case t["Open front page"]:He.open(`${location.origin}/${n.BOARD}/`);break;case t["Next page"]:if("index"!==n.VIEW||n.SITE.isOnePage?.(n.BOARD))return;if(se.enabled){if(!["paged","infinite"].includes(t["Index Mode"]))return;He(".next button",se.pagelist).click()}else He(n.SITE.selectors.nav.next)?.click();break;case t["Previous page"]:if("index"!==n.VIEW||n.SITE.isOnePage?.(n.BOARD))return;if(se.enabled){if(!["paged","infinite"].includes(t["Index Mode"]))return;He(".prev button",se.pagelist).click()}else He(n.SITE.selectors.nav.prev)?.click();break;case t["Search form"]: +if("index"!==n.VIEW)return;var h=se.enabled?se.searchInput:n.SITE.selectors.searchBox?He(n.SITE.selectors.searchBox):void 0;if(!h)return;Je.scrollToIfNeeded(h),h.focus();break;case t["Paged mode"]:if(!se.enabledOn(n.BOARD))return;location.href="index"===n.VIEW?"#paged":`/${n.BOARD}/#paged`;break;case t["Infinite scrolling mode"]:if(!se.enabledOn(n.BOARD))return;location.href="index"===n.VIEW?"#infinite":`/${n.BOARD}/#infinite`;break;case t["All pages mode"]:if(!se.enabledOn(n.BOARD))return;location.href="index"===n.VIEW?"#all-pages":`/${n.BOARD}/#all-pages`;break;case t["Open catalog"]:if(!(r=Ge.catalog()))return;location.href=r;break;case t["Cycle sort type"]:if(!se.enabled)return;se.cycleSortType();break;case t["Next thread"]:if("index"!==n.VIEW||!i)return;L.scroll(1);break;case t["Previous thread"]:if("index"!==n.VIEW||!i)return;L.scroll(-1);break;case t["Expand thread"]:if("index"!==n.VIEW||!i)return;ee.toggle(a),Je.scrollTo(i);break;case t["Open thread"]: +if("index"!==n.VIEW||!i)return;Fe.open(a);break;case t["Open thread tab"]:if("index"!==n.VIEW||!i)return;Fe.open(a,!0);break;case t["Next reply"]:if(!i)return;Fe.hl(1,i);break;case t["Previous reply"]:if(!i)return;Fe.hl(-1,i);break;case t["Deselect reply"]:if(!i)return;Fe.hl(0,i);break;case t.Hide:if(!a||!le.db)return;Je.scrollTo(i),le.toggle(a);break;case t["Quick Filter MD5"]:if(!i)return;c=Fe.post(i),Fe.hl(1,i),ze.quickFilterMD5.call(c,e);break;case t["Previous Post Quoting You"]:if(!i||!X.db)return;X.cb.seek("preceding");break;case t["Next Post Quoting You"]:if(!i||!X.db)return;X.cb.seek("following");break;default:return}return e.preventDefault(),e.stopPropagation()}},keyCode(e){let t=(()=>{let t;switch(t=e.keyCode){case 8:return"";case 13:return"Enter";case 27:return"Esc";case 32:return"Space";case 37:return"Left";case 38:return"Up";case 39:return"Right";case 40:return"Down";case 188:return"Comma";case 190:return"Period";case 191:return"Slash";case 59:case 186:return"Semicolon" +;default:return 48<=t&&t<=57||65<=t&&t<=90?String.fromCharCode(t).toLowerCase():96<=t&&t<=105?String.fromCharCode(t-48).toLowerCase():null}})();return t&&(e.altKey&&(t="Alt+"+t),e.ctrlKey&&(t="Ctrl+"+t),e.metaKey&&(t="Meta+"+t),e.shiftKey&&(t="Shift+"+t)),t},post(e){const t=n.SITE.selectors;return He(`${t.postContainer}${t.highlightable.reply}.${n.SITE.classes.highlight}`,e)||He(`${n.SITE.isOPContainerThread?t.thread:t.postContainer}${t.highlightable.op}`,e)},qr:e=>(Oe.open(),null!=e&&Oe.quote.call(Fe.post(e)),Oe.nodes.com.focus()),tags(e,t){G.ready((function(){const{config:t}=n.BOARD;if(!(()=>{switch(e){case"spoiler":return!!t.spoilers;case"code":return!!t.code_tags;case"math":case"eqn":return!!t.math_tags;case"sjis":return!!t.sjis_tags}})())return new Ke("warning",`[${e}] tags are not supported on /${n.BOARD}/.`,20)}));const{value:o}=t,a=t.selectionStart,i=t.selectionEnd;t.value=o.slice(0,a)+`[${e}]`+o.slice(a,i)+`[/${e}]`+o.slice(i);const r=`[${e}]`.length+i +;return t.setSelectionRange(r,r),He.event("input",null,t)},sage(){const e=/sage/i.test(Oe.nodes.email.value);return Oe.nodes.email.value=e?"":"sage"},open(e,t){if("index"!==n.VIEW)return;const o=Qe.url("thread",e);return t?He.open(o):location.href=o},hl(e,t){const o=`${n.SITE.selectors.postContainer}${n.SITE.selectors.highlightable.reply}`,{highlight:a}=n.SITE.classes,i=He(`${o}.${a}`,t);if(!e)return void(i&&He.rmClass(i,a));if(i){const{height:t}=i.getBoundingClientRect();if(Je.getTopOf(i)>=-t&&Je.getBottomOf(i)>=-t){let t;const{root:r}=Qe.postFromNode(i).nodes,s=1===e?"following":"preceding";if(!(t=He.x(`${s}-sibling::${n.SITE.xpath.replyContainer}[not(@hidden) and not(child::div[@class='stub'])][1]`,r)))return;return t.matches(o)||(t=He(o,t)),Je.scrollToIfNeeded(t,1===e),He.addClass(t,a),void He.rmClass(i,a)}He.rmClass(i,a)}const r=u(o,t);for(var s of(-1===e&&r.reverse(),r))if(1===e&&Je.getTopOf(s)>0||-1===e&&Je.getBottomOf(s)>0)return void He.addClass(s,a)}};const Le={Cache:{init(){ +return He.on(a,"SaveCaptcha",(e=>this.saveAPI(e.detail))),He.on(a,"NoCaptcha",(e=>this.noCaptcha(e.detail)))},captchas:[],getCount(){return this.captchas.length},neededRaw(){return!(this.haveCookie()||this.captchas.length||Oe.req||this.submitCB)&&(Oe.posts.length>1||t["Auto-load captcha"]||!Oe.posts[0].isOnlyQuotes()||Oe.posts[0].file)},needed(){return this.neededRaw()&&He.event("LoadCaptcha")},prerequest(){if(t["Prerequest Captcha"])return He.queueTask((()=>{if(!this.prerequested&&this.neededRaw()&&!He.event("LoadCaptcha")&&!Oe.captcha.occupied()&&Oe.cooldown.seconds<=60&&Oe.selected===Oe.posts[Oe.posts.length-1]&&!Oe.selected.isOnlyQuotes()){const e="new"!==Oe.selected.thread;if(!He.event("RequestCaptcha",{isReply:e}))return this.prerequested=!0,this.submitCB=e=>{if(e)return this.save(e)},this.updateCount()}}))},haveCookie:()=>/\b_ct=/.test(a.cookie)&&"new"!==Oe.posts[0].thread,getOne(){let e;return delete this.prerequested,this.clear(),(e=this.captchas.shift())?(this.count(),e):null +},request(e){if(this.submitCB||!He.event("RequestCaptcha",{isReply:e}))return e=>(this.submitCB=e,this.updateCount())},abort(){if(this.submitCB)return delete this.submitCB,He.event("AbortCaptcha"),this.updateCount()},saveAPI(e){let t;return(t=this.submitCB)?(delete this.submitCB,t(e),this.updateCount()):this.save(e)},noCaptcha(e){let t;if(t=this.submitCB)return this.haveCookie()&&!e?.error||(Oe.error(e?.error||"Failed to retrieve captcha."),Oe.captcha.setup(a.activeElement===Oe.nodes.status)),delete this.submitCB,t(),this.updateCount()},save(e){let t;return(t=this.submitCB)?(this.abort(),void t(e)):(this.captchas.push(e),this.captchas.sort(((e,t)=>e.timeout-t.timeout)),this.count())},clear(){if(this.captchas.length){let e;const t=Date.now();for(e=0;et)break}if(e)return this.captchas=this.captchas.slice(e),this.count()}},count(){return clearTimeout(this.timer), +this.captchas.length&&(this.timer=setTimeout(this.clear.bind(this),this.captchas[0].timeout-Date.now())),this.updateCount()},updateCount(){return He.event("CaptchaCount",this.captchas.length)}},Replace:p,t:g,v2:{lifetime:12e4,init(){if(a.cookie.indexOf("pass_enabled=1")>=0)return;if(!(this.isEnabled=!!He("#g-recaptcha, #captcha-forced-noscript")||!He.id("postForm")))return;(this.noscript=t["Force Noscript Captcha"]||!Lt.jsEnabled)&&He.addClass(Oe.nodes.el,"noscript-captcha"),Le.cache.init(),He.on(a,"CaptchaCount",this.count.bind(this));const e=He.el("div",{className:"captcha-root"});He.extend(e,{innerHTML:'
            '});const n=He(".captcha-counter > a",e);return this.nodes={root:e,counter:n},this.count(),He.addClass(Oe.nodes.el,"has-captcha","captcha-v2"),He.after(Oe.nodes.com.parentNode,e),He.on(n,"click",this.toggle.bind(this)),He.on(n,"keydown",(e=>{if("Space"===Fe.keyCode(e))return this.toggle(),e.preventDefault(), +e.stopPropagation()})),He.on(window,"captcha:success",(()=>He.queueTask((()=>this.save(!1)))))},timeouts:{},prevNeeded:0,noscriptURL(){let n,o=`https://www.google.com/recaptcha/api/fallback?k=${e.recaptchaKey}`;return(n=t.captchaLanguage.trim())&&(o+=`&hl=${encodeURIComponent(n)}`),o},moreNeeded(){return He.queueTask((()=>{const e=Le.cache.needed();return e&&!this.prevNeeded&&this.setup(Oe.cooldown.auto&&a.activeElement===Oe.nodes.status),this.prevNeeded=e}))},toggle(){return this.nodes.container&&!this.timeouts.destroy?this.destroy():this.setup(!0,!0)},setup(e,t){if(this.isEnabled&&(Le.cache.needed()||t)){if(e&&(He.addClass(Oe.nodes.el,"focus"),this.nodes.counter.focus()),this.timeouts.destroy)return clearTimeout(this.timeouts.destroy),delete this.timeouts.destroy,this.reload();if(!this.nodes.container)return this.nodes.container=He.el("div",{className:"captcha-container"}),He.prepend(this.nodes.root,this.nodes.container), +new MutationObserver(this.afterSetup.bind(this)).observe(this.nodes.container,{childList:!0,subtree:!0}),this.noscript?this.setupNoscript():this.setupJS();He.queueTask((()=>{let e;if(this.nodes.container&&a.activeElement===this.nodes.counter&&(e=He('iframe[src^="https://www.google.com/recaptcha/"]',this.nodes.container)))return e.focus(),Oe.focus()}))}},setupNoscript(){const e=He.el("iframe",{id:"qr-captcha-iframe",scrolling:"no",src:this.noscriptURL()}),t=He.el("div"),n=He.el("textarea");return He.add(t,n),He.add(this.nodes.container,[e,t])},setupJS:()=>He.global((function(){const t=function(){const{classList:t}=document.documentElement,n=document.querySelector("#qr .captcha-container");return n.dataset.widgetID=window.grecaptcha.render(n,{sitekey:e.recaptchaKey,theme:t.contains("tomorrow")||t.contains("spooky")||t.contains("dark-captcha")?"dark":"light",callback:e=>window.dispatchEvent(new CustomEvent("captcha:success",{detail:e}))})};if(window.grecaptcha)return t();{ +const e=window.onRecaptchaLoaded;if(window.onRecaptchaLoaded=function(){return t(),e()},!document.head.querySelector('script[src^="https://www.google.com/recaptcha/api.js"]')){const e=document.createElement("script");return e.src="https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoaded&render=explicit",document.head.appendChild(e)}}})),afterSetup(e){for(var t of e)for(var n of t.addedNodes){var o,a;(o=He.x('./descendant-or-self::iframe[starts-with(@src, "https://www.google.com/recaptcha/")]',n))&&this.setupIFrame(o),(a=He.x("./descendant-or-self::textarea",n))&&this.setupTextArea(a)}},setupIFrame(e){let t;if(doc.contains(e))return Le.replace.iframe(e),He.addClass(Oe.nodes.el,"captcha-open"),this.fixQRPosition(),He.on(e,"load",this.fixQRPosition),a.activeElement===this.nodes.counter&&e.focus(),["blink","edge"].includes(He.engine)&&(t=e.parentNode,u("#qr .captcha-container > div > div:first-of-type").includes(t))?He.on(e.parentNode,"scroll",(function(){return this.scrollTop=0 +})):void 0},fixQRPosition(){if(Oe.nodes.el.getBoundingClientRect().bottom>doc.clientHeight)return Oe.nodes.el.style.top="",Oe.nodes.el.style.bottom="0px"},setupTextArea(e){return He.one(e,"input",(()=>this.save(!0)))},destroy(){if(this.isEnabled)return delete this.timeouts.destroy,He.rmClass(Oe.nodes.el,"captcha-open"),this.nodes.container?(He.global((function(){const e=document.querySelector("#qr .captcha-container");return window.grecaptcha.reset(e.dataset.widgetID)})),He.rm(this.nodes.container),delete this.nodes.container):void 0},getOne:e=>Le.cache.getOne(e),save(e,n){Le.cache.save({response:n||He("textarea",this.nodes.container).value,timeout:Date.now()+this.lifetime});const o="IFRAME"===a.activeElement?.nodeName&&/https?:\/\/www\.google\.com\/recaptcha\//.test(a.activeElement.src);if(Le.cache.needed()?(o&&(Oe.cooldown.auto||t["Post on Captcha Completion"]?this.nodes.counter.focus():Oe.nodes.status.focus()), +this.reload()):(e?this.destroy():null==this.timeouts.destroy&&(this.timeouts.destroy=setTimeout(this.destroy.bind(this),3e3)),o&&Oe.nodes.status.focus()),t["Post on Captcha Completion"]&&!Oe.cooldown.auto)return Oe.submit()},count(){const e=Le.cache.getCount(),t=Le.cache.submitCB?"...":"";return this.nodes.counter.textContent=`Captchas: ${e}${t}`,this.moreNeeded()},reload(){return He('iframe[src^="https://www.google.com/recaptcha/api/fallback?"]',this.nodes.container)?(this.destroy(),this.setup(!1,!0)):He.global((function(){const e=document.querySelector("#qr .captcha-container");return window.grecaptcha.reset(e.dataset.widgetID)}))},occupied(){return!!this.nodes.container&&!this.timeouts.destroy}}};var Oe={mimeTypes:["image/jpeg","image/png","image/gif","application/pdf","application/vnd.adobe.flash.movie","application/x-shockwave-flash","video/webm"],validExtension:/\.(jpe?g|png|gif|pdf|swf|webm)$/i,typeFromExtension:{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png", +gif:"image/gif",pdf:"application/pdf",swf:"application/vnd.adobe.flash.movie",webm:"video/webm"},extensionFromType:{"image/jpeg":"jpg","image/png":"png","image/gif":"gif","application/pdf":"pdf","application/vnd.adobe.flash.movie":"swf","application/x-shockwave-flash":"swf","video/webm":"webm"},init(){let e;if(t["Quick Reply"])return this.posts=[],He.on(a,"4chanXInitFinished",(()=>G.ready(Oe.initReady))),l.Post.push({name:"Quick Reply",cb:this.node}),this.shortcut=e=He.el("a",{className:"disabled",textContent:"↩",title:"Quick Reply",href:"javascript:;"}),He.on(e,"click",(function(){if(Oe.postingIsEnabled)return t["Persistent QR"]||!Oe.nodes||Oe.nodes.el.hidden?(Oe.open(),Oe.nodes.com.focus()):Oe.close()})),Je.addShortcut("qr",e,540)},initReady(){let e;const o=He("#g-recaptcha, #captcha-forced-noscript")?"v2":"t";Oe.captcha=Le[o],Oe.postingIsEnabled=!0;const{config:i}=n.BOARD,r=(e,t)=>+(i[e]??t);if(Oe.min_width=r("min_image_width",1),Oe.min_height=r("min_image_height",1), +Oe.max_width=Oe.max_height=1e4,Oe.max_size=r("max_filesize",4194304),Oe.max_size_video=r("max_webm_filesize",Oe.max_size),Oe.max_comment=r("max_comment_chars",2e3),Oe.max_width_video=Oe.max_height_video=2048,Oe.max_duration_video=r("max_webm_duration",120),Oe.forcedAnon=!!i.forced_anon,Oe.spoiler=!!i.spoilers,e=He.id("togglePostFormLink")){const t=He.el("h1",{className:"qr-link-container"});He.extend(t,{innerHTML:`${"thread"===n.VIEW?"Reply to Thread":"Start a Thread"}`}),Oe.link=t.firstElementChild,He.on(t.firstChild,"click",(function(){return Oe.open(),Oe.nodes.com.focus()})),He.before(e,t),e.firstElementChild.textContent="Original Form"}if("thread"===n.VIEW){let e;const t=He.el("div",{className:"brackets-wrap qr-link-container-bottom"});He.extend(t,{innerHTML:'Reply to Thread'}),He.on(t.firstElementChild,"click",(function(){return Oe.open(),Oe.nodes.com.focus()})), +(e=He(".navLinksBot"))&&He.prepend(e,t)}if(He.on(a,"QRGetFile",Oe.getFile),He.on(a,"QRDrawFile",Oe.drawFile),He.on(a,"QRSetFile",Oe.setFile),He.on(a,"paste",Oe.paste),He.on(a,"dragover",Oe.dragOver),He.on(a,"drop",Oe.dropFile),He.on(a,"dragstart dragend",Oe.drag),He.on(a,"IndexRefreshInternal",Oe.generatePostableThreadsList),He.on(a,"ThreadUpdate",Oe.statusCheck),t["Persistent QR"])return Oe.open(),t["Auto Hide QR"]?Oe.hide():void 0},statusCheck(){if(!Oe.nodes)return;const{thread:e}=Oe.posts[0];return"new"!==e&&n.threads.get(`${n.BOARD}.${e}`).isDead?Oe.abort():Oe.status()},node(){if(He.on(this.nodes.quote,"click",Oe.quote),this.isFetchedQuote)return Oe.generatePostableThreadsList()},open(){if(Oe.nodes)Oe.nodes.el.hidden&&Oe.captcha.setup(),Oe.nodes.el.hidden=!1,Oe.unhide();else try{Oe.dialog()}catch(e){return delete Oe.nodes,void Lt.handleErrors({message:"Quick Reply dialog creation crashed.",error:e})}return He.rmClass(Oe.shortcut,"disabled")},close(){if(!Oe.req){ +for(var e of(Oe.nodes.el.hidden=!0,Oe.cleanNotifications(),Oe.blur(),He.rmClass(Oe.nodes.el,"dump"),He.addClass(Oe.shortcut,"disabled"),new Oe.post(!0),Oe.posts.splice(0,Oe.posts.length-1)))e.delete();return Oe.cooldown.auto=!1,Oe.status(),Oe.captcha.destroy()}Oe.abort()},focus:()=>He.queueTask((function(){if(!Oe.inBubble())return Oe.hasFocus=a.activeElement&&Oe.nodes.el.contains(a.activeElement),Oe.nodes.el.classList.toggle("focus",Oe.hasFocus)})),inBubble(){const e=u('iframe[src^="https://www.google.com/recaptcha/api2/frame"]');return e.includes(a.activeElement)||e.some((e=>"hidden"!==getComputedStyle(e).visibility&&e.getBoundingClientRect().bottom>0))},hide:()=>(Oe.blur(),He.addClass(Oe.nodes.el,"autohide"),Oe.nodes.autohide.checked=!0),unhide:()=>(He.rmClass(Oe.nodes.el,"autohide"),Oe.nodes.autohide.checked=!1),toggleHide(){return this.checked?Oe.hide():Oe.unhide()},blur(){if(Oe.nodes.el.contains(a.activeElement))return a.activeElement.blur()},toggleSJIS:e=>(e.preventDefault(), +t.sjisPreview=!t.sjisPreview,He.set("sjisPreview",t.sjisPreview),Oe.nodes.el.classList.toggle("sjis-preview",t.sjisPreview)),texPreviewShow:()=>He.hasClass(Oe.nodes.el,"tex-preview")?Oe.texPreviewHide():(He.addClass(Oe.nodes.el,"tex-preview"),Oe.nodes.texPreview.textContent=Oe.nodes.com.value,He.event("mathjax",null,Oe.nodes.texPreview)),texPreviewHide:()=>He.rmClass(Oe.nodes.el,"tex-preview"),addPost(){const e=Oe.nodes&&!Oe.nodes.el.hidden;return Oe.open(),e&&(He.addClass(Oe.nodes.el,"dump"),new Oe.post(!0)),Oe.nodes.com.focus()},setCustomCooldown:e=>(t.customCooldownEnabled=e,Oe.cooldown.customCooldown=e,Oe.nodes.customCooldown.classList.toggle("disabled",!e)),toggleCustomCooldown(){const e=He.hasClass(Oe.nodes.customCooldown,"disabled");return Oe.setCustomCooldown(e),He.set("customCooldownEnabled",e)},error(e,t){let n;Oe.open(),"string"==typeof e?n=He.tn(e):(n=e,n.removeAttribute("style"));const o=new Ke("warning",n);if(Oe.notifications.push(o),Je.areNotificationsEnabled){ +if(a.hidden||!t&&!a.hasFocus()){const e=new Notification(n.textContent,{body:n.textContent,icon:h.logo});if(e.onclick=()=>window.focus(),"gecko"!==He.engine)return e.onclose=()=>o.close(),e.onshow=()=>setTimeout((function(){return e.onclose=null,e.close()}),7e3)}}else if(a.hidden&&!Oe.cooldown.auto)return alert(n.textContent)},connectionError:()=>He.el("span",{innerHTML:'Connection error while posting. [More info]'}),notifications:[],cleanNotifications(){for(var e of Oe.notifications)e.close();return Oe.notifications=[]},status(){let e,t;if(!Oe.nodes)return;const{thread:o}=Oe.posts[0];"new"!==o&&n.threads.get(`${n.BOARD}.${o}`).isDead&&(t="Dead",e=!0,Oe.cooldown.auto=!1),t=Oe.req?Oe.req.progress:Oe.cooldown.seconds||t;const{status:a}=Oe.nodes;return a.value=t?Oe.cooldown.auto?`Auto ${t}`:t:"Submit",a.disabled=e||!1},openPost(){if(Oe.open(),Oe.selected.isLocked){const e=Oe.posts.indexOf(Oe.selected) +;return(Oe.posts[e+1]||new Oe.post).select(),He.addClass(Oe.nodes.el,"dump"),Oe.cooldown.auto=!0}},quote(e){let t;if(e?.preventDefault(),!Oe.postingIsEnabled)return;const o=a.getSelection(),i=Qe.postFromNode(this),{root:r}=i.nodes,s=new Range;s.selectNode(r);let l=i.board.ID===n.BOARD.ID?`>>${i}\n`:`>>>/${i.board}/${i}\n`;for(let e=0,a=o.rangeCount,i=0<=a;i?ea;i?e++:e--)try{var d,c;if(t=o.getRangeAt(e),t.compareBoundaryPoints(Range.START_TO_START,s)<0&&t.setStartBefore(r),t.compareBoundaryPoints(Range.END_TO_END,s)>0&&t.setEndAfter(r),!t.toString().trim())continue;var h=t.cloneContents(),p=t.commonAncestorContainer;for(c of(He.x('ancestor-or-self::*[self::s or contains(@class,"removed-spoiler")]',p)&&(He.prepend(h,He.tn("[spoiler]")),He.add(h,He.tn("[/spoiler]"))),(d=He.x('ancestor-or-self::pre[contains(@class,"prettyprint")]',p))&&(He.prepend(h,He.tn("[code]")),He.add(h,He.tn("[/code]"))),u(d?"br":".prettyprint br",h)))He.replace(c,He.tn("\n")) +;for(c of u("br",h))c!==h.lastChild&&He.replace(c,He.tn("\n>"));for(c of(n.SITE.insertTags?.(h),u(".linkify[data-original]",h)))He.replace(c,He.tn(c.dataset.original));for(c of u(".embedder",h))" "===c.previousSibling?.nodeValue&&He.rm(c.previousSibling),He.rm(c);l+=`>${h.textContent.trim()}\n`}catch(e){}Oe.openPost();const{com:g,thread:f}=Oe.nodes;g.value||(f.value=Qe.threadFromNode(this));const m=Oe.selected.isOnlyQuotes(),b=g.selectionStart;return g.value=g.value.slice(0,b)+l+g.value.slice(g.selectionEnd),t=b+l.length,g.setSelectionRange(t,t),g.focus(),m&&(Oe.selected.quotedText=g.value),Oe.selected.save(g),Oe.selected.save(f)},characterCount(){const e=Oe.nodes.charCount,t=Oe.nodes.com.value.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length;return e.textContent=t,e.hidden=tOe.max_comment?He.addClass:He.rmClass)(e,"warning")},getFile:()=>He.event("QRFile",Oe.selected?.file),drawFile(e){const t=Oe.selected?.file;if(!t||!/^(image|video)\//.test(t.type))return +;const n=/^video\//.test(t),o=He.el(n?"video":"img");return He.on(o,"error",(()=>Oe.openError())),He.on(o,n?"loadeddata":"load",(function(){return e.target.getContext("2d").drawImage(o,0,0),URL.revokeObjectURL(o.src),He.event("QRImageDrawn",null,e.target)})),o.src=URL.createObjectURL(t)},openError(){const t=He.el("div");return He.extend(t,{innerHTML:'Could not open file. [More info]'}),Oe.error(t)},setFile(e){const{file:t,name:n,source:o}=e.detail;return null!=n&&(t.name=n),null!=o&&(t.source=o),Oe.open(),Oe.handleFiles([t])},drag(e){const t="dragstart"===e.type?He.off:He.on;return t(a,"dragover",Oe.dragOver),t(a,"drop",Oe.dropFile)},dragOver:e=>(e.preventDefault(),e.dataTransfer.dropEffect="copy"),dropFile(e){if(e.dataTransfer.files.length)return e.preventDefault(),Oe.open(),Oe.handleFiles(e.dataTransfer.files)},paste(e){if(!e.clipboardData.items)return;let n=null,o=-1;for(var a of e.clipboardData.items){var i +;if("file"===a.kind&&(i=a.getAsFile())){var r=2*(i.size<=Oe.max_size)+("image/png"===i.type);r>o&&(n=i,o=r)}}if(n){const{type:e}=n,o=new Blob([n],{type:e});o.name=`${t.pastedname}.${He.getOwn(Oe.extensionFromType,e)||"jpg"}`,Oe.open(),Oe.handleFiles([o]),He.addClass(Oe.nodes.el,"dump")}},pasteFF(){const{pasteArea:e}=Oe.nodes;if(!e.childNodes.length)return;const n=u("img",e);for(var o of(He.rmAll(e),n)){var a,{src:i}=o;if(a=i.match(/data:(image\/(\w+));base64,(.+)/)){for(var r=atob(a[3]),s=new Uint8Array(r.length),l=0,d=r.length,c=0<=d;c?ld;c?l++:l--)s[l]=r.charCodeAt(l);var h=new Blob([s],{type:a[1]});h.name=`${t.pastedname}.${a[2]}`,Oe.handleFiles([h])}else/^https?:\/\//.test(i)&&Oe.handleUrl(i)}},handleUrl:e=>(Oe.open(),Oe.selected.preventAutoPost(),qe.permission((function(){const t=prompt("Enter a URL:",e);if(null!==t)return Oe.nodes.fileButton.focus(),qe.file(t,(function(e){return e&&!/^text\//.test(e.type)?Oe.handleFiles([e]):Oe.error("Can't load file.")}))}))), +handleFiles(e){if(this!==Oe&&(e=[...Array.from(this.files)],this.value=null),e.length){for(var t of(Oe.cleanNotifications(),e))Oe.handleFile(t,e.length);return 1!==e.length&&He.addClass(Oe.nodes.el,"dump"),a.activeElement===Oe.nodes.fileButton&&He.hasClass(Oe.nodes.fileSubmit,"has-file")?Oe.nodes.filename.focus():void 0}},handleFile(e,t){let n;const o=/^text\//.test(e.type);return 1===t?n=Oe.selected:(n=Oe.posts[Oe.posts.length-1],(o?n.com||n.pasting:n.file)&&(n=new Oe.post)),n[o?"pasteText":"setFile"](e)},openFileInput(){if(!Oe.nodes.fileButton.disabled)return Oe.nodes.fileInput.click(),Oe.nodes.fileButton.focus()},generatePostableThreadsList(){if(!Oe.nodes)return;const e=Oe.nodes.thread,t=[e.firstElementChild];for(var o of n.BOARD.threads.keys)t.push(He.el("option",{value:o,textContent:`Thread ${o}`}));const a=e.value;return He.rmAll(e),He.add(e,t),e.value=a,e.value!==a?(e.value="thread"===n.VIEW?n.THREADID:"new", +("thread"===n.VIEW?He.addClass:He.rmClass)(Oe.nodes.el,"reply-to-thread")):void 0},dialog(){let e,o,i,r;Oe.nodes=i={el:e=F.dialog("qr",{ +innerHTML:'
            \n \n ×\n \n
            \n
            \n
            \n \n \n \n \n \n
            \n
            \n \n \n
            \n
            \n
            \n
            \n +\n
            \n \n
            \n \n \n No selected file\n \n \n ✎︎\n \n 🔗︎\n \n 🕒︎\n +\n \n \n
            \n \n \n
            \n\n\n\n' +})};const s=(t,n)=>i[t]=He(n,e);s("move",".move"),s("autohide","#autohide"),s("close",".close"),s("thread","select"),s("form","form"),s("sjisToggle","#sjis-toggle"),s("texButton","#tex-preview-button"),s("name","[data-name=name]"),s("email","[data-name=email]"),s("sub","[data-name=sub]"),s("com","[data-name=com]"),s("charCount","#char-count"),s("texPreview","#tex-preview"),s("dumpList","#dump-list"),s("addPost","#add-post"),s("oekaki",".oekaki"),s("drawButton","#qr-draw-button"),s("fileSubmit","#file-n-submit"),s("fileButton","#qr-file-button"),s("noFile","#qr-no-file"),s("filename","#qr-filename"),s("spoiler","#qr-file-spoiler"),s("oekakiButton","#qr-oekaki-button"),s("fileRM","#qr-filerm"),s("urlButton","#url-button"),s("pasteArea","#paste-area"),s("customCooldown","#custom-cooldown-button"),s("dumpButton","#dump-button"),s("status","[type=submit]"),s("flashTag","[name=filetag]"),s("fileInput","[type=file]");const{config:l}=n.BOARD,{classList:d}=Oe.nodes.el +;d.toggle("forced-anon",Oe.forcedAnon),d.toggle("has-spoiler",Oe.spoiler),d.toggle("has-sjis",!!l.sjis_tags),d.toggle("has-math",!!l.math_tags),d.toggle("sjis-preview",!!l.sjis_tags&&t.sjisPreview),d.toggle("show-new-thread-option",t["Show New Thread Option in Threads"]),parseInt(t.customCooldown,10)>0&&(He.addClass(Oe.nodes.fileSubmit,"custom-cooldown"),He.get("customCooldownEnabled",t.customCooldownEnabled,(function({customCooldownEnabled:e}){return Oe.setCustomCooldown(e),He.sync("customCooldownEnabled",Oe.setCustomCooldown)}))),Oe.flagsInput(),He.on(i.autohide,"change",Oe.toggleHide),He.on(i.close,"click",Oe.close),He.on(i.status,"click",Oe.submit),He.on(i.form,"submit",Oe.submit),He.on(i.sjisToggle,"click",Oe.toggleSJIS),He.on(i.texButton,"mousedown",Oe.texPreviewShow),He.on(i.texButton,"mouseup",Oe.texPreviewHide),He.on(i.addPost,"click",(()=>new Oe.post(!0))),He.on(i.drawButton,"click",Oe.oekaki.draw),He.on(i.fileButton,"click",Oe.openFileInput), +He.on(i.noFile,"click",Oe.openFileInput),He.on(i.filename,"focus",(function(){return He.addClass(this.parentNode,"focus")})),He.on(i.filename,"blur",(function(){return He.rmClass(this.parentNode,"focus")})),He.on(i.spoiler,"change",(()=>Oe.selected.nodes.spoiler.click())),He.on(i.oekakiButton,"click",Oe.oekaki.button),He.on(i.fileRM,"click",(()=>Oe.selected.rmFile())),He.on(i.urlButton,"click",(()=>Oe.handleUrl(""))),He.on(i.customCooldown,"click",Oe.toggleCustomCooldown),He.on(i.dumpButton,"click",(()=>i.el.classList.toggle("dump"))),He.on(i.fileInput,"change",Oe.handleFiles),window.addEventListener("focus",Oe.focus,!0),window.addEventListener("blur",Oe.focus,!0),He.on(a,"click",Oe.focus),"gecko"!==He.engine||window.DataTransferItemList||(i.pasteArea.hidden=!1),new MutationObserver(Oe.pasteFF).observe(i.pasteArea,{childList:!0});const c=["thread","name","email","sub","com","filename","flag"];let h=0;const u=function(){return Oe.selected.save(this)};for(;r=c[h++];){var p +;(p=i[r])&&(o="SELECT"===p.nodeName?"change":"input",He.on(i[r],o,u))}return"gecko"===He.engine&&t["Remember QR Size"]&&(He.get("QR Size","",(e=>i.com.style.cssText=e["QR Size"])),He.on(i.com,"mouseup",(function(e){if(0===e.button)return He.set("QR Size",this.style.cssText)}))),Oe.generatePostableThreadsList(),Oe.persona.load(),new Oe.post(!0),Oe.status(),Oe.cooldown.setup(),Oe.captcha.init(),He.add(a.body,e),Oe.captcha.setup(),Oe.oekaki.setup(),He.event("QRDialogCreation",null,e)},flags(){const e=He.el("select",{name:"flag",className:"flagSelector"}),t=(t,n)=>He.add(e,He.el("option",{value:t,textContent:n}));for(var o in t("0",n.BOARD.config.country_flags?"Geographic Location":"None"),n.BOARD.config.board_flags){t(o,n.BOARD.config.board_flags[o])}return e},flagsInput(){const{nodes:e}=Oe;if(e&&(e.flag&&(He.rm(e.flag),delete e.flag),n.BOARD.config.board_flags)){const t=Oe.flags();return t.dataset.name="flag",t.dataset.default="0",e.flag=t,He.add(e.form,t)}},submit(e){let o,i,r +;e?.preventDefault();const s=e?.shiftKey;if(Oe.req)return void Oe.abort();if(He.forceSync("cooldowns"),Oe.cooldown.seconds){if(!s)return Oe.cooldown.auto=!Oe.cooldown.auto,void Oe.status();Oe.cooldown.clear()}const l=Oe.posts[0];delete l.quotedText,l.forceSave();let d=l.thread;const c=n.BOARD.threads.get(d);if("f"===n.BOARD.ID&&"new"===d&&(r=Oe.nodes.flashTag.value),"new"===d?(d=null,n.BOARD.config.require_subject&&!l.sub?i="New threads require a subject.":n.BOARD.config.text_only||l.file||(i="No file selected.")):n.BOARD.threads.get(d).isClosed?i="You can't reply to this thread anymore.":l.com||l.file?l.file&&c.fileLimit&&(i="Max limit of image replies has been reached."):i="No comment or file.","r9k"!==n.BOARD.ID||l.com?.match(/[a-z-]/i)||i||(i="Original comment required."),!Oe.captcha.isEnabled||Oe.captcha===Le.v2&&/\b_ct=/.test(a.cookie)&&d||i&&!s||(o=Oe.captcha.getOne(!!d),Oe.captcha===Le.v2&&(o||(o=Le.cache.request(!!d))),o||(i="No valid captcha.", +Oe.captcha.setup(!Oe.cooldown.auto||a.activeElement===Oe.nodes.status))),Oe.cleanNotifications(),i&&!s)return Oe.cooldown.auto=!1,Oe.status(),void Oe.error(i);Oe.cooldown.auto=Oe.posts.length>1,l.lock();const h={MAX_FILE_SIZE:Oe.max_size,mode:"regist",pwd:Oe.persona.getPassword(),resto:d,name:Oe.forcedAnon?void 0:l.name,email:l.email,sub:Oe.forcedAnon||d?void 0:l.sub,com:l.com,upfile:l.file,filetag:r,spoiler:l.spoiler,flag:l.flag},u={responseType:"document",withCredentials:!0,onloadend:Oe.response,form:He.formData(h)};t["Show Upload Progress"]&&(u.onprogress=function(e){if(this===Oe.req?.upload)return e.loaded(Oe.captcha===Le.v2&&Le.cache.abort(),p=null)},o((function(e){return Oe.captcha===Le.v2&&Le.cache.haveCookie()?(p?.(),e?Le.cache.save(e):void 0):e?p?.(e):(delete Oe.req,l.unlock(),Oe.cooldown.auto=!!Le.cache.getCount(),Oe.status())}))):p(o),Oe.status()},response(){let e,o;if(this!==Oe.req)return;delete Oe.req;const i=Oe.posts[0];if(i.unlock(),o=this.response?.getElementById("errmsg")){const e=He("a",o);e&&(e.target="_blank")}else(e=!this.response||"Post successful!"!==this.response.title)?(o=Oe.connectionError(),Oe.captcha===Le.v2&&Oe.currentCaptcha&&Le.cache.save(Oe.currentCaptcha)):200!==this.status&&(o=`Error ${this.statusText} (${this.status})`) +;if(e||Oe.captcha.setUsed?.(),delete Oe.currentCaptcha,o){let t;if(Oe.errorCount=(Oe.errorCount||0)+1,/captcha|verification/i.test(o.textContent)||e)/mistyped/i.test(o.textContent)?o="You mistyped the CAPTCHA, or the CAPTCHA malfunctioned.":/expired/i.test(o.textContent)&&(o="This CAPTCHA is no longer valid because it has expired."),Oe.errorCount>=5?Oe.cooldown.auto=!1:(Oe.cooldown.auto=Oe.captcha.isEnabled||e,Oe.cooldown.addDelay(i,2));else if(o.textContent&&(t=o.textContent.match(/\d+\s+(?:minute|second)/gi))&&!/duplicate|hour/i.test(o.textContent)){Oe.cooldown.auto=!/have\s+been\s+muted/i.test(o.textContent);let e=0;for(var r of t)e+=(/minute/i.test(r)?60:1)*+r.match(/\d+/)[0];/muted/i.test(o.textContent)?Oe.cooldown.addMute(e):Oe.cooldown.addDelay(i,e)}else Oe.cooldown.auto=!1;return Oe.captcha.setup(Oe.cooldown.auto&&[Oe.nodes.status,a.body].includes(a.activeElement)),Oe.status(),void Oe.error(o)}delete Oe.errorCount;const s=He("h1",this.response) +;let[l,d,c]=Array.from(s.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/));c=+c,d=+d||c;const h=d!==c;He.event("QRPostSuccessful",{boardID:n.BOARD.ID,threadID:d,postID:c}),He.event("QRPostSuccessful_",{boardID:n.BOARD.ID,threadID:d,postID:c});const u=Oe.posts.length-1;Oe.cooldown.auto=u&&h;const p=!function(){for(var e of Oe.posts.slice(1))if(e.thread===i.thread)return!0}();u?(i.rm(),Oe.captcha.setup(a.activeElement===Oe.nodes.status)):t["Persistent QR"]?(i.rm(),t["Auto Hide QR"]?Oe.hide():Oe.blur()):Oe.close(),Oe.cleanNotifications(),t["Posting Success Notifications"]&&Oe.notifications.push(new Ke("success",s.textContent,5)),Oe.cooldown.add(d,c);const g=d===c?`${window.location.origin}/${n.BOARD}/thread/${d}`:d!==n.THREADID&&p&&t["Open Post in New Tab"]?`${window.location.origin}/${n.BOARD}/thread/${d}#p${c}`:void 0;if(g){const e=t["Open Post in New Tab"]||u?()=>He.open(g):()=>location.href=g;d===c?Oe.waitForThread(g,e):e()}return Oe.status()},waitForThread(e,t){let n=0 +;var o=function(){return He.ajax(e,{onloadend(){return n++,n>=6||200===this.status?t():setTimeout(o,n*b)},responseType:"text",type:"HEAD"})};return o()},abort(){let e;return(e=Oe.req)&&!Oe.req.isUploadFinished&&(delete Oe.req,e.abort(),Oe.captcha===Le.v2&&Oe.currentCaptcha&&Le.cache.save(Oe.currentCaptcha),delete Oe.currentCaptcha,Oe.posts[0].unlock(),Oe.cooldown.auto=!1,Oe.notifications.push(new Ke("info","QR upload aborted.",5))),Oe.status()},cooldown:{seconds:0,delays:{deletion:60},init(){if(t["Quick Reply"])return this.data=t.cooldowns,this.changes=m(),He.sync("cooldowns",this.sync)},setup(){for(var e in He.extend(Oe.cooldown.delays,n.BOARD.cooldowns()),Oe.cooldown.maxDelay=0,Oe.cooldown.delays){var t=Oe.cooldown.delays[e];["thread","thread_global"].includes(e)||(Oe.cooldown.maxDelay=Math.max(Oe.cooldown.maxDelay,t))}return Oe.cooldown.isSetup=!0,Oe.cooldown.start()},start(){const{data:e}=Oe.cooldown +;if(t.Cooldown&&Oe.cooldown.isSetup&&!Oe.cooldown.isCounting&&!(Object.keys(e[n.BOARD.ID]||{}).length+Object.keys(e.global||{}).length<=0))return Oe.cooldown.isCounting=!0,Oe.cooldown.count()},sync:e=>(Oe.cooldown.data=e||m(),Oe.cooldown.start()),add(e,o){if(!t.Cooldown)return;const a=Date.now(),i=n.BOARD.ID;return Oe.cooldown.set(i,a,{threadID:e,postID:o}),e===o&&Oe.cooldown.set("global",a,{boardID:i,threadID:e,postID:o}),Oe.cooldown.save(),Oe.cooldown.start()},addDelay(e,o){if(!t.Cooldown)return;const a=Oe.cooldown.categorize(e);return a.delay=o,Oe.cooldown.set(n.BOARD.ID,Date.now(),a),Oe.cooldown.save(),Oe.cooldown.start()},addMute(e){if(t.Cooldown)return Oe.cooldown.set(n.BOARD.ID,Date.now(),{type:"mute",delay:e}),Oe.cooldown.save(),Oe.cooldown.start()},delete(e){let t;if(!Oe.cooldown.data)return;const n=Oe.cooldown.data[e.board.ID]||(Oe.cooldown.data[e.board.ID]=m());for(var o in n)t=n[o],null==t.delay&&t.threadID===e.thread.ID&&t.postID===e.ID&&Oe.cooldown.set(e.board.ID,o,null) +;return Oe.cooldown.save()},secondsDeletion(e){if(!Oe.cooldown.data||!t.Cooldown)return 0;const n=Oe.cooldown.data[e.board.ID]||m();for(var o in n){var a=n[o];if(null==a.delay&&a.threadID===e.thread.ID&&a.postID===e.ID){var i=Oe.cooldown.delays.deletion-Math.floor((Date.now()-o)/b);return Math.max(i,0)}}return 0},categorize:e=>"new"===e.thread?{type:"thread"}:{type:e.file?"image":"reply",threadID:+e.thread},mergeChange:(e,t,n,o)=>o?(e[t]||(e[t]=m()))[n]=o:t in e&&(delete e[t][n],0===Object.keys(e[t]).length)?delete e[t]:void 0,set:(e,t,n)=>(Oe.cooldown.mergeChange(Oe.cooldown.data,e,t,n),(Oe.cooldown.changes[e]||(Oe.cooldown.changes[e]=m()))[t]=n),save(){const{changes:e}=Oe.cooldown;if(Object.keys(e).length)return He.get("cooldowns",m(),(function({cooldowns:e}){for(var t in Oe.cooldown.changes){for(var n in Oe.cooldown.changes[t]){var o=Oe.cooldown.changes[t][n];Oe.cooldown.mergeChange(e,t,n,o)}Oe.cooldown.data=e}return He.set("cooldowns",e,(()=>Oe.cooldown.changes=m()))}))}, +clear:()=>(Oe.cooldown.data=m(),Oe.cooldown.changes=m(),Oe.cooldown.auto=!1,Oe.cooldown.update(),He.queueTask(He.delete,"cooldowns")),update(){let e;if(!Oe.cooldown.isCounting)return;let o=!1,a=0;const i=Date.now(),{type:r,threadID:s}=Oe.cooldown.categorize(Oe.posts[0]);let l=0;if(t.Cooldown)for(var d of[n.BOARD.ID,"global"]){var c=Oe.cooldown.data[d]||(Oe.cooldown.data[d]=m());for(var h in c){e=c[h],h=+h;var u=Math.floor((i-h)/b);if(u<0)Oe.cooldown.set(d,h,null),o=!0;else if(null==e.delay){var p=e.threadID!==e.postID?Oe.cooldown.maxDelay:Oe.cooldown.delays["global"===d?"thread_global":"thread"];if(Oe.cooldown.customCooldown&&(p=Math.max(p,parseInt(t.customCooldown,10))),p<=u)Oe.cooldown.set(d,h,null),o=!0;else if("thread"===r==(e.threadID===e.postID)&&e.boardID!==n.BOARD.ID){var g="global"===d?"_global":"";l=Math.max(l,Oe.cooldown.delays[r+g]-u),Oe.cooldown.customCooldown&&(l=Math.max(l,parseInt(t.customCooldown,10)-u))}}else e.delay<=u?(Oe.cooldown.set(d,h,null), +o=!0):(e.type===r&&e.threadID===s||"mute"===e.type)&&(l=Math.max(l,e.delay-u))}a+=Object.keys(c).length}o&&Oe.cooldown.save,a?(clearTimeout(Oe.cooldown.timeout),Oe.cooldown.timeout=setTimeout(Oe.cooldown.count,b)):delete Oe.cooldown.isCounting;const f=l!==Oe.cooldown.seconds;return Oe.cooldown.seconds=l,f?Oe.status():void 0},count(){if(Oe.cooldown.update(),0===Oe.cooldown.seconds&&Oe.cooldown.auto&&!Oe.req)return Oe.submit()}},oekaki:{menu:{init(){if(!(["index","thread"].includes(n.VIEW)&&t.Menu&&t["Edit Link"]&&t["Quick Reply"]))return;const e=He.el("a",{className:"edit-link",href:"javascript:;",textContent:"Edit image"});return He.on(e,"click",this.editFile),V.menu.addEntry({el:e,order:90,open(e){Oe.oekaki.menu.post=e;const{file:t}=e;return Oe.postingIsEnabled&&!!t&&(t.isImage||t.isVideo)}})},editFile(){const{post:e}=Oe.oekaki.menu;Oe.quote.call(e.nodes.post);const{isVideo:t}=e.file,n=e.file.fullImage?.currentTime||0;return qe.file(e.file.url,(function(o){if(o){if(t){ +const t=He.el("video");return He.on(t,"loadedmetadata",(function(){return He.on(t,"seeked",(function(){const n=He.el("canvas",{width:t.videoWidth,height:t.videoHeight});return n.getContext("2d").drawImage(t,0,0),n.toBlob((function(t){return t.name=e.file.name.replace(/\.\w+$/,"")+".png",Oe.handleFiles([t]),Oe.oekaki.edit()}))})),t.currentTime=n})),He.on(t,"error",(()=>Oe.openError())),t.src=URL.createObjectURL(o)}return o.name=e.file.name,Oe.handleFiles([o]),Oe.oekaki.edit()}return Oe.error("Can't load file.")}))}},setup:()=>He.global((function(){const{FCX:e}=window;if(e.oekakiCB=()=>window.Tegaki.flatten().toBlob((function(t){const n=`oekaki-${Date.now()}`;return e.oekakiLatest=n,document.dispatchEvent(new CustomEvent("QRSetFile",{bubbles:!0,detail:{file:t,name:e.oekakiName,source:n}}))})),window.Tegaki)return document.querySelector("#qr .oekaki").hidden=!1})),load(e){if(He('script[src^="//s.4cdn.org/js/tegaki"]',a.head))return e();{const t=He.el("link",{rel:"stylesheet", +href:`//s.4cdn.org/css/tegaki.${Date.now()}.css`}),n=He.el("script",{src:`//s.4cdn.org/js/tegaki.min.${Date.now()}.js`});let o=0;const i=function(){if(2==++o)return e()};return He.on(t,"load",i),He.on(n,"load",i),He.add(a.head,[t,n])}},draw:()=>He.global((function(){const{Tegaki:e,FCX:t}=window;return e.bg&&e.destroy(),t.oekakiName="tegaki.png",e.open({onDone:t.oekakiCB,onCancel:()=>e.bgColor="#ffffff",width:+document.querySelector("#qr [name=oekaki-width]").value,height:+document.querySelector("#qr [name=oekaki-height]").value,bgColor:document.querySelector("#qr [name=oekaki-bg]").checked?document.querySelector("#qr [name=oekaki-bgcolor]").value:"transparent"})})),button:()=>Oe.selected.file?Oe.oekaki.edit():Oe.oekaki.toggle(),edit:()=>Oe.oekaki.load((()=>He.global((function(){ +const{Tegaki:e,FCX:t}=window,n=document.getElementById("qr-filename").value.replace(/\.\w+$/,"")+".png",{source:o}=document.getElementById("file-n-submit").dataset,a=e=>document.dispatchEvent(new CustomEvent("CreateNotification",{bubbles:!0,detail:{type:"warning",content:e,lifetime:20}}));var i=function(o){o&&this.removeEventListener("QRMetadata",i,!1);const r=document.getElementById("selected");if(!r?.dataset.type)return a("No file to edit.");if(!/^(image|video)\//.test(r.dataset.type))return a("Not an image.");if(!r.dataset.height)return a("Metadata not available.");if("loading"===r.dataset.height)return void r.addEventListener("QRMetadata",i,!1);e.bg&&e.destroy(),t.oekakiName=n,e.open({onDone:t.oekakiCB,onCancel:()=>e.bgColor="#ffffff",width:+r.dataset.width,height:+r.dataset.height,bgColor:"transparent"});const s=document.createElement("canvas");return s.width=s.naturalWidth=+r.dataset.width,s.height=s.naturalHeight=+r.dataset.height,s.hidden=!0,document.body.appendChild(s), +s.addEventListener("QRImageDrawn",(function(){return this.remove(),e.onOpenImageLoaded.call(this)}),!1),s.dispatchEvent(new CustomEvent("QRDrawFile",{bubbles:!0}))};return e.bg&&e.onDoneCb===t.oekakiCB&&o===t.oekakiLatest?(t.oekakiName=n,e.resume()):i()})))),toggle:()=>Oe.oekaki.load((()=>Oe.nodes.oekaki.hidden=!Oe.nodes.oekaki.hidden))},persona:{always:{},types:{name:[],email:[],sub:[]},init(){if(t["Quick Reply"]||t.Menu&&t["Delete Link"])for(var e of t["QR.personas"].split("\n"))Oe.persona.parseItem(e.trim())},parseItem(e){let t,o,a,i;if("#"===e[0])return;if(!(t=e.match(/(name|options|email|subject|password):"(.*)"/i)))return;[t,a,i]=Array.from(t),e=e.replace(t,"");const r=e.match(/boards:([^;]+)/i)?.[1].toLowerCase()||"global";if("global"===r||(o=n.BOARD.ID,r.split(",").includes(o))){if("password"!==a)return"options"===a&&(a="email"),"subject"===a&&(a="sub"),/always/i.test(e)&&(Oe.persona.always[a]=i),Oe.persona.types[a].includes(i)?void 0:Oe.persona.types[a].push(i) +;Oe.persona.pwd=i}},load(){for(var e in Oe.persona.types){var t=Oe.persona.types[e],n=He(`#list-${e}`,Oe.nodes.el);for(var o of t)o&&He.add(n,He.el("option",{textContent:o}))}},getPassword(){let e;return null!=Oe.persona.pwd?Oe.persona.pwd:(e=a.cookie.match(/4chan_pass=([^;]+)/))?decodeURIComponent(e[1]):""},get:e=>He.get("QR.persona",{},(({"QR.persona":t})=>e(t))),set:e=>He.get("QR.persona",{},(function({"QR.persona":t}){return t={name:e.name,flag:e.flag},He.set("QR.persona",t)}))},post:class{constructor(e){this.select=this.select.bind(this);const o=He.el("a",{className:"qr-preview",draggable:!0,href:"javascript:;"});for(var a of(He.extend(o,{innerHTML:''}),this.nodes={el:o,rm:o.firstChild,spoiler:He(".qr-preview-spoiler input",o),span:o.lastChild},He.on(o,"click",this.select),He.on(this.nodes.rm,"click",(e=>(e.stopPropagation(),this.rm()))), +He.on(this.nodes.spoiler,"change",(e=>(this.spoiler=e.target.checked,this===Oe.selected&&(Oe.nodes.spoiler.checked=this.spoiler),this.preventAutoPost()))),u("label",o)))He.on(a,"click",(e=>e.stopPropagation()));for(var i of(He.add(Oe.nodes.dumpList,o),["dragStart","dragEnter","dragLeave","dragOver","dragEnd","drop"]))He.on(o,i.toLowerCase(),this[i]);this.thread="thread"===n.VIEW?n.THREADID:"new";const r=Oe.posts[Oe.posts.length-1];Oe.posts.push(this),this.nodes.spoiler.checked=this.spoiler=!(!r||!t["Remember Spoiler"])&&r.spoiler,Oe.persona.get((e=>{if(this.name="name"in Oe.persona.always?Oe.persona.always.name:r?r.name:e.name,this.email="email"in Oe.persona.always?Oe.persona.always.email:"",this.sub="sub"in Oe.persona.always?Oe.persona.always.sub:"",Oe.nodes.flag&&(this.flag=r?r.flag:e.flag&&e.flag in n.BOARD.config.board_flags?e.flag:void 0),Oe.selected===this)return this.load()})),e&&this.select(),this.unlock(),Oe.captcha.moreNeeded()}rm(){this.delete() +;const e=Oe.posts.indexOf(this);return 1===Oe.posts.length?(new Oe.post(!0),He.rmClass(Oe.nodes.el,"dump")):this===Oe.selected&&(Oe.posts[e-1]||Oe.posts[e+1]).select(),Oe.posts.splice(e,1),Oe.status(),Oe.captcha.updateThread?.()}delete(){return He.rm(this.nodes.el),URL.revokeObjectURL(this.URL),this.dismissErrors()}lock(e=!0){if(this.isLocked=e,this===Oe.selected){for(var t of["thread","name","email","sub","com","fileButton","filename","spoiler","flag"]){var n;(n=Oe.nodes[t])&&(n.disabled=e)}return this.nodes.rm.style.visibility=e?"hidden":"",this.nodes.spoiler.disabled=e,this.nodes.el.draggable=!e}}unlock(){return this.lock(!1)}select(){Oe.selected&&(Oe.selected.nodes.el.removeAttribute("id"),Oe.selected.forceSave()),Oe.selected=this,this.lock(this.isLocked),this.nodes.el.id="selected";const e=this.nodes.el.getBoundingClientRect(),t=this.nodes.el.parentNode.getBoundingClientRect();return this.nodes.el.parentNode.scrollLeft+=e.left+e.width/2-t.left-t.width/2,this.load()}load(){ +for(var e of["thread","name","email","sub","com","filename","flag"]){var t;(t=Oe.nodes[e])&&(t.value=this[e]||t.dataset.default||"")}return("new"!==this.thread?He.addClass:He.rmClass)(Oe.nodes.el,"reply-to-thread"),this.showFileData(),Oe.characterCount()}save(e,t){if("checkbox"===e.type)return void(this.spoiler=e.checked);const{name:n}=e.dataset;if(!["thread","name","email","sub","com","filename","flag"].includes(n))return;const o=this[n]||e.dataset.default||null;switch(this[n]=e.value||e.dataset.default||null,n){case"thread":("new"!==this.thread?He.addClass:He.rmClass)(Oe.nodes.el,"reply-to-thread"),Oe.status(),Oe.captcha.updateThread?.();break;case"com":this.updateComment();break;case"filename":if(!this.file)return;this.saveFilename(),this.updateFilename();break;case"name":case"flag":this[n]!==o&&Oe.persona.set(this)}return t?void 0:this.preventAutoPost()}forceSave(){if(this===Oe.selected)for(var e of["thread","name","email","sub","com","filename","spoiler","flag"]){var t +;(t=Oe.nodes[e])&&this.save(t,!0)}}preventAutoPost(){if(Oe.cooldown.auto&&this===Oe.posts[0]&&(Oe.cooldown.update(),Oe.cooldown.seconds<=5))return Oe.cooldown.auto=!1}setComment(e){return this.com=e||null,this===Oe.selected&&(Oe.nodes.com.value=this.com),this.updateComment()}updateComment(){if(this===Oe.selected&&Oe.characterCount(),this.nodes.span.textContent=this.com,Oe.captcha.moreNeeded(),Oe.captcha===Le.v2)return Le.cache.prerequest()}isOnlyQuotes(){return(this.com||"").trim()===(this.quotedText||"").trim()}static rmErrored(e){e.stopPropagation();for(let e=Oe.posts.length-1;e>=0;e--){var t,n=Oe.posts[e];if(t=n.errors)for(var o of t)if(i.contains(o)){n.rm();break}}}error(e,t,n){const a=He.el("div",{className:e});He.extend(a,{innerHTML:t+(n?` [More info]`:"")+'
            [delete post] [delete all]'}),(this.errors||(this.errors=[])).push(a);const[i,r]=Array.from(u("a",a)) +;return He.on(a,"click",(()=>{if(Oe.posts.includes(this))return this.select()})),He.on(i,"click",(e=>{if(e.stopPropagation(),Oe.posts.includes(this))return this.rm()})),He.on(r,"click",Oe.post.rmErrored),Oe.error(a,!0)}fileError(e,t){return this.error("file-error",`${this.filename}: ${e}`,t)}dismissErrors(e=(()=>!0)){if(this.errors)for(var t of this.errors)i.contains(t)&&e(t)&&t.parentNode.previousElementSibling.click()}setFile(e){if(this.file=e,t["Randomize Filename"]&&"f"!==n.BOARD.ID){let e;this.filename=""+(1e3*Date.now()-Math.floor(365*Math.random()*w*1e3)),(e=this.file.name.match(Oe.validExtension))&&(this.filename+=e[0])}else this.filename=this.file.name;return this.filesize=He.bytesToString(this.file.size),this.checkSize(),He.addClass(this.nodes.el,"has-file"),Oe.captcha.moreNeeded(),URL.revokeObjectURL(this.URL),this.saveFilename(),this===Oe.selected?this.showFileData():this.updateFilename(),this.rmMetadata(),this.nodes.el.dataset.type=this.file.type, +this.nodes.el.style.backgroundImage="",Oe.mimeTypes.includes(this.file.type)?/^(image|video)\//.test(this.file.type)&&this.readFile():this.fileError("Unsupported file type."),this.preventAutoPost()}checkSize(){let e=Oe.max_size;if(/^video\//.test(this.file.type)&&(e=Math.min(e,Oe.max_size_video)),this.file.size>e)return this.fileError(`File too large (file: ${this.filesize}, max: ${He.bytesToString(e)}).`)}readFile(){const t=/^video\//.test(this.file.type),n=He.el(t?"video":"img");if(t&&!n.canPlayType(this.file.type))return;const o=t?"loadeddata":"load";var a=()=>(He.off(n,o,a),He.off(n,"error",i),this.checkDimensions(n),this.setThumbnail(n),He.event("QRMetadata",null,this.nodes.el)),i=()=>(He.off(n,o,a),He.off(n,"error",i),this.fileError(`Corrupt ${t?"video":"image"} or error reading metadata.`,e.faq+"#error-reading-metadata"),URL.revokeObjectURL(n.src),this.nodes.el.removeAttribute("data-height"),He.event("QRMetadata",null,this.nodes.el)) +;return this.nodes.el.dataset.height="loading",He.on(n,o,a),He.on(n,"error",i),n.src=URL.createObjectURL(this.file)}checkDimensions(e){let t,o;if("IMG"===e.tagName){if(({height:t,width:o}=e),this.nodes.el.dataset.height=t,this.nodes.el.dataset.width=o,(t>Oe.max_height||o>Oe.max_width)&&this.fileError(`Image too large (image: ${t}x${o}px, max: ${Oe.max_height}x${Oe.max_width}px)`),ti||o>r)&&this.fileError(`Video too large (video: ${t}x${o}px, max: ${i}x${r}px)`),(tOe.max_duration_video&&this.fileError(`Video too long (video: ${a}s, max: ${Oe.max_duration_video}s)`):this.fileError("Video lacks duration metadata (try remuxing)"),G.noAudio(n.BOARD.ID)&&He.hasAudio(e))return this.fileError("Audio not allowed")}}setThumbnail(e){let t,n;const o="VIDEO"===e.tagName;let a=180*window.devicePixelRatio;if("image/gif"===this.file.type&&(a*=3),o)t=e.videoHeight,n=e.videoWidth;else if(({height:t,width:n}=e),t(this.URL=URL.createObjectURL(e),this.nodes.el.style.backgroundImage=`url(${this.URL})`)))}rmFile(){if(!this.isLocked)return delete this.file,delete this.filename,delete this.filesize,this.nodes.el.removeAttribute("title"),Oe.nodes.filename.removeAttribute("title"),this.rmMetadata(), +this.nodes.el.style.backgroundImage="",He.rmClass(this.nodes.el,"has-file"),this.showFileData(),URL.revokeObjectURL(this.URL),this.dismissErrors((e=>He.hasClass(e,"file-error"))),this.preventAutoPost()}rmMetadata(){for(var e of["type","height","width","duration"])this.nodes.el.removeAttribute(`data-${e}`)}saveFilename(){if(this.file.newName=(this.filename||"").replace(/[/\\]/g,"-"),!Oe.validExtension.test(this.filename))return this.file.newName+=`.${He.getOwn(Oe.extensionFromType,this.file.type)||"jpg"}`}updateFilename(){const e=`${this.filename} (${this.filesize})`;if(this.nodes.el.title=e,this===Oe.selected)return Oe.nodes.filename.title=e}showFileData(){return this.file?(this.updateFilename(),Oe.nodes.filename.value=this.filename,He.addClass(Oe.nodes.oekaki,"has-file"),He.addClass(Oe.nodes.fileSubmit,"has-file")):(He.rmClass(Oe.nodes.oekaki,"has-file"),He.rmClass(Oe.nodes.fileSubmit,"has-file")), +null!=this.file?.source?Oe.nodes.fileSubmit.dataset.source=this.file.source:Oe.nodes.fileSubmit.removeAttribute("data-source"),Oe.nodes.spoiler.checked=this.spoiler}pasteText(e){this.pasting=!0,this.preventAutoPost();const t=new FileReader;return t.onload=e=>{const{result:t}=e.target;return this.setComment(this.com?`${this.com}\n${t}`:t),delete this.pasting},t.readAsText(e)}dragStart(e){const{left:t,top:n}=this.getBoundingClientRect();return e.dataTransfer.setDragImage(this,e.clientX-t,e.clientY-n),He.addClass(this,"drag")}dragEnd(){return He.rmClass(this,"drag")}dragEnter(){return He.addClass(this,"over")}dragLeave(){return He.rmClass(this,"over")}dragOver(e){return e.preventDefault(),e.dataTransfer.dropEffect="move"}drop(){if(He.rmClass(this,"over"),!this.draggable)return;const e=He(".drag",this.parentNode),t=e=>[...Array.from(e.parentNode.children)].indexOf(e),n=t(e),o=t(this);if(Oe.posts[n].isLocked||Oe.posts[o].isLocked)return;(nchrome.runtime.sendMessage(t,(t=>e[t]=n))}());var je={binary(e,t,n=m()){if(e=e.replace(/^((?:https?:)?\/\/(?:\w+\.)?(?:4chan|4channel|4cdn)\.org)\/adv\//,"$1//adv/"),"crx"===x)$e({type:"ajax",url:e,headers:n,responseType:"arraybuffer"},(function({response:e,responseHeaderString:n}){return e&&(e=new Uint8Array(e)),t(e,n)}));else{const o=function(){return He.ajax(e,{headers:n,responseType:"arraybuffer",onloadend(){return this.status&&this.response?t(new Uint8Array(this.response),this.getAllResponseHeaders()):t(null)}})};if(void 0===window.GM_xmlhttpRequest||null===window.GM_xmlhttpRequest)return void o();const a={method:"GET",url:e,headers:n,responseType:"arraybuffer",overrideMimeType:"text/plain; charset=x-user-defined",onload(e){let n +;if(e.response instanceof ArrayBuffer)n=new Uint8Array(e.response);else{const t=e.responseText;n=new Uint8Array(t.length);let o=0;for(;ot(null),onabort:()=>t(null)};try{return(GM?.xmlHttpRequest||GM_xmlhttpRequest)(a)}catch(e){return o()}}},file:(e,t)=>je.binary(e,(function(n,o){if(null==n)return t(null);let a=e.match(/([^\/?#]+)\/*(?:$|[?#])/)?.[1];const i=o.match(/Content-Type:\s*(.*)/i)?.[1],r=o.match(/Content-Disposition:\s*(.*)/i)?.[1];let s=i?.match(/[^;]*/)[0]||"application/octet-stream";const l=r?.match(/\bfilename\s*=\s*"((\\"|[^"])+)"/i)?.[1]||i?.match(/\bname\s*=\s*"((\\"|[^"])+)"/i)?.[1];l&&(a=l.replace(/\\"/g,'"')),/^text\/plain;\s*charset=x-user-defined$/i.test(s)&&(s=He.getOwn(Oe.typeFromExtension,a.match(/[^.]*$/)[0].toLowerCase())||"application/octet-stream");const d=new Blob([n],{type:s});return d.name=a,t(d)})),Request:function(){const e=class{static initClass(){this.prototype.status=0, +this.prototype.statusText="",this.prototype.response=null,this.prototype.responseHeaderString=null}getResponseHeader(e){if(null==this.responseHeaders&&null!=this.responseHeaderString)for(var t of(this.responseHeaders=m(),this.responseHeaderString.split("\r\n"))){var n;if((n=t.indexOf(":"))>=0){var o=t.slice(0,n).trim().toLowerCase(),a=t.slice(n+1).trim();this.responseHeaders[o]=a}}return this.responseHeaders?.[e.toLowerCase()]??null}abort(){}onloadend(){}};return e.initClass(),e}(),ajax(e,t={}){let n,{onloadend:o,timeout:a,responseType:i,headers:r}=t;if(null==i&&(i="json"),null==window.GM?.xmlHttpRequest&&(void 0===window.GM_xmlhttpRequest||null===window.GM_xmlhttpRequest))return He.ajax(e,t);const s=new je.Request;if(s.onloadend=o,"userscript"===x){const o={method:"GET",url:e,headers:r,timeout:a,onload(e){try{const t="json"===i?e.responseText?JSON.parse(e.responseText):null:e.responseText;He.extend(s,{response:t,status:e.status,statusText:e.statusText, +responseHeaderString:e.responseHeaders})}catch(e){}return s.onloadend()},onerror:()=>s.onloadend(),onabort:()=>s.onloadend(),ontimeout:()=>s.onloadend()};try{n=(GM?.xmlHttpRequest||GM_xmlhttpRequest)(o)}catch(n){return He.ajax(e,t)}n&&"function"==typeof n.abort&&(s.abort=function(){try{return n.abort()}catch(e){}})}else $e({type:"ajax",url:e,responseType:i,headers:r,timeout:a},(function(e){return e.status&&He.extend(s,e),s.onloadend()}));return s},cache:(e,t)=>He.cache(e,t,{ajax:je.ajax}),permission:(e,t,n)=>"crx"===x?$e({type:"permission",origins:n},(function(n){return n?e():t()})):e()},qe=je;const Ue=(e,t=document.body)=>t.querySelector(e);Ue.id=e=>a.getElementById(e),Ue.ready=function(e){if("loading"===a.readyState){var t=function(){return Ue.off(a,"DOMContentLoaded",t),e()};return Ue.on(a,"DOMContentLoaded",t)}Ue.queueTask(e)},Ue.formData=function(e){if(e instanceof HTMLFormElement)return new FormData(e);const t=new FormData;for(var n in e){var o=e[n] +;o&&("object"==typeof o&&"newName"in o?t.append(n,o,o.newName):t.append(n,o))}return t},Ue.extend=function(e,t){for(var n in t){var o=t[n];e[n]=o}},Ue.hasOwn=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Ue.getOwn=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0},Ue.ajax=function(){let e;e=window.wrappedJSObject&&!XMLHttpRequest.wrappedJSObject?XPCNativeWrapper(window.wrappedJSObject.XMLHttpRequest):XMLHttpRequest;if("userscript"===x)return function(o,a={}){if(null==a.responseType&&(a.responseType="json"),a.type||(a.type=a.form?"post":"get"),o=o.replace(/^((?:https?:)?\/\/(?:\w+\.)?(?:4chan|4channel|4cdn)\.org)\/adv\//,"$1//adv/"),"crx"===x&&t["Work around CORB Bug"]&&"yotsuba"===n.SITE.software&&!a.testCORB&&FormData.prototype.entries)return Ue.ajaxPage(o,a);const{onloadend:i,timeout:s,responseType:l,withCredentials:d,type:c,onprogress:h,form:u,headers:p}=a,g=new e;try{g.open(c,o,!0);const e=p||{};for(var f in e){var m=e[f];g.setRequestHeader(f,m)} +Ue.extend(g,{onloadend:i,timeout:s,responseType:l,withCredentials:d}),Ue.extend(g.upload,{onprogress:h}),Ue.on(g,"error",(function(){if(!g.status)return r.warn(`4chan X failed to load: ${o}`)})),"crx"===x&&Ue.on(g,"load",(()=>{t["Work around CORB Bug"]||4!==g.readyState||200!==g.status||""!==g.statusText||null!==g.response||Ue.set("Work around CORB Bug",t["Work around CORB Bug"]=Date.now())})),g.send(u)}catch(e){if(2153644038!==e.result)throw e;g.onloadend=i,Ue.queueTask(Ue.event,"error",null,g),Ue.queueTask(Ue.event,"loadend",null,g)}return g};{let e=0;const t=m();return Ue.ajaxPageInit=function(){return Ue.global((function(){return window.FCX.requests=Object.create(null),document.addEventListener("4chanXAjax",(function(e){let t,n;const{url:o,timeout:a,responseType:i,withCredentials:r,type:s,onprogress:l,form:d,headers:c,id:h}=e.detail;window.FCX.requests[h]=n=new XMLHttpRequest,n.open(s,o,!0);const u=c||{};for(var p in u){var g=u[p];n.setRequestHeader(p,g)} +if(n.responseType="document"===i?"text":i,n.timeout=a,n.withCredentials=r,l&&(n.upload.onprogress=function(e){const{loaded:t,total:n}=e,o={loaded:t,total:n,id:h};return document.dispatchEvent(new CustomEvent("4chanXAjaxProgress",{bubbles:!0,detail:o}))}),n.onloadend=function(){delete window.FCX.requests[h];const{status:e,statusText:t,response:n}=this,o={status:e,statusText:t,response:n,responseHeaderString:this.getAllResponseHeaders(),id:h};return document.dispatchEvent(new CustomEvent("4chanXAjaxLoadend",{bubbles:!0,detail:o}))},n.onerror=function(){if(!n.status)return console.warn(`4chan X failed to load: ${o}`)},d)for(var f of(t=new FormData,d))t.append(f[0],f[1]);else t=null;return n.send(t)}),!1),document.addEventListener("4chanXAjaxAbort",(function(e){let t;if(t=window.FCX.requests[e.detail.id])return t.abort()}),!1)})),Ue.on(a,"4chanXAjaxProgress",(function(e){let n;if(n=t[e.detail.id])return n.upload.onprogress.call(n.upload,e.detail)})), +Ue.on(a,"4chanXAjaxLoadend",(function(e){let n;if(n=t[e.detail.id]){if(delete t[e.detail.id],e.detail.status){for(var o of["status","statusText","response","responseHeaderString"])n[o]=e.detail[o];"document"===n.responseType&&(n.response=(new DOMParser).parseFromString(e.detail.response,"text/html"))}return n.onloadend()}}))},Ue.ajaxPage=function(n,o={}){let a,{onloadend:i,timeout:r,responseType:s,withCredentials:l,type:d,onprogress:c,form:h,headers:u}=o;const p=e++;return t[p]=a=new qe.Request,Ue.extend(a,{responseType:s,onloadend:i}),a.upload={onprogress:c},a.abort=()=>Ue.event("4chanXAjaxAbort",{id:p}),h&&(h=Array.from(h.entries())),Ue.event("4chanXAjax",{url:n,timeout:r,responseType:s,withCredentials:l,type:d,onprogress:!!c,form:h,headers:u,id:p}),a}}}(),Ue.lastModified=m(),Ue.whenModified=function(e,t,n,o={}){let a;const{timeout:i,ajax:r}=o,s=[];"blink"===Ue.engine&&s.push(`s=${t}`),"a.4cdn.org"===e.split("/")[2]&&s.push(`t=${Date.now()}`);const l=e;s.length&&(e+="?"+s.join("&")) +;const d=m();null!=(a=Ue.lastModified[t]?.[l])&&(d["If-Modified-Since"]=a);return(r||Ue.ajax)(e,{onloadend(){return(Ue.lastModified[t]||(Ue.lastModified[t]=m()))[l]=this.getResponseHeader("Last-Modified"),n.call(this)},timeout:i,headers:d})},function(){const e=m();Ue.cache=function(t,n,o={}){let a;const{ajax:i}=o;if(a=e[t])return a.callbacks?a.callbacks.push(n):Ue.queueTask((()=>n.call(a,{isCached:!0}))),a;return a=(i||Ue.ajax)(t,{onloadend:function(){for(n of(this.status||delete e[t],this.callbacks))(e=>{Ue.queueTask((()=>e.call(this,{isCached:!1})))})(n);return delete this.callbacks}}),a.callbacks=[n],e[t]=a},Ue.cleanCache=function(t){for(var n in e)t(n)&&delete e[n]}}(),Ue.cb={checked(){if(Ue.hasOwn(t,this.name))return Ue.set(this.name,this.checked),t[this.name]=this.checked},value(){if(Ue.hasOwn(t,this.name))return Ue.set(this.name,this.value.trim()),t[this.name]=this.value}},Ue.asap=function(e,t){return e()?t():setTimeout(Ue.asap,25,e,t)},Ue.onExists=function(e,t,n){let o +;if(o=Ue(t,e))return n(o);var a=new MutationObserver((function(){if(o=Ue(t,e))return a.disconnect(),n(o)}));return a.observe(e,{childList:!0,subtree:!0})},Ue.addStyle=function(e,t,n="head"){const o=Ue.el("style",{textContent:e});return null!=t&&(o.id=t),Ue.onExists(i,n,(()=>Ue.add(a.head,o))),o},Ue.addCSP=function(e){const t=Ue.el("meta",{httpEquiv:"Content-Security-Policy",content:e});if(a.head)return Ue.add(a.head,t),Ue.rm(t);{const e=Ue.add(i||a,Ue.el("head"));return Ue.add(e,t),Ue.rm(e)}},Ue.x=function(e,t){return t||(t=a.body),a.evaluate(e,t,null,8,null).singleNodeValue},Ue.X=function(e,t){return t||(t=a.body),a.evaluate(e,t,null,7,null)},Ue.addClass=function(e,...t){for(var n of t)e.classList.add(n)},Ue.rmClass=function(e,...t){for(var n of t)e.classList.remove(n)},Ue.toggleClass=(e,t)=>e.classList.toggle(t),Ue.hasClass=(e,t)=>e.classList.contains(t),Ue.rm=e=>e?.remove(),Ue.rmAll=e=>e.textContent=null,Ue.tn=e=>a.createTextNode(e),Ue.frag=()=>a.createDocumentFragment(), +Ue.nodes=function(e){if(!(e instanceof Array))return e;const t=Ue.frag();for(var n of e)t.appendChild(n);return t},Ue.add=(e,t)=>e.appendChild(Ue.nodes(t)),Ue.prepend=(e,t)=>e.insertBefore(Ue.nodes(t),e.firstChild),Ue.after=(e,t)=>e.parentNode.insertBefore(Ue.nodes(t),e.nextSibling),Ue.before=(e,t)=>e.parentNode.insertBefore(Ue.nodes(t),e),Ue.replace=(e,t)=>e.parentNode.replaceChild(Ue.nodes(t),e),Ue.el=function(e,t,n){const o=a.createElement(e);return t&&Ue.extend(o,t),n&&Ue.extend(o,n),o},Ue.on=function(e,t,n){for(var o of t.split(" "))e.addEventListener(o,n,!1)},Ue.off=function(e,t,n){for(var o of t.split(" "))e.removeEventListener(o,n,!1)},Ue.one=function(e,t,n){var o=function(a){return Ue.off(e,t,o),n.call(this,a)};return Ue.on(e,t,o)},Ue.event=function(e,t,n=a){return globalThis.chrome?.extension||null!=t&&"function"==typeof cloneInto&&(t=cloneInto(t,a.defaultView)),n.dispatchEvent(new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:t}))},"userscript"===x&&function(){ +if(/PaleMoon\//.test(navigator.userAgent)&&!(+GM_info?.version?.split(".")[0]<2)&&"undefined"==typeof cloneInto)try{return new CustomEvent("x",{detail:{}})}catch(t){const n={Object:unsafeWindow.Object,Array:unsafeWindow.Array};var e=function(t){let o;if(null!=t&&"object"==typeof t&&(o=n[t.constructor.name])){const n=new o;for(var a in t){var i=t[a];n[a]=e(i)}return n}return t};return Ue.event=(t,n,o=a)=>o.dispatchEvent(new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e(n)}))}}(),Ue.modifiedClick=e=>e.shiftKey||e.altKey||e.ctrlKey||e.metaKey||0!==e.button,Ue.open=globalThis.chrome?.extension?e=>window.open(e,"_blank"):null!=GM?.openInTab?GM.openInTab:"undefined"!=typeof GM_openInTab&&null!==GM_openInTab?GM_openInTab:e=>window.open(e,"_blank"),Ue.debounce=function(e,t){let n=0,o=null,a=null,i=null;const r=function(){return n=Date.now(),t.apply(a,i)};return function(){return i=arguments,a=this,n=1024;)e/=1024,t++;return`${e=t>1?Math.round(100*e)/100:Math.round(e)} ${["B","KB","MB","GB"][t]}`},Ue.minmax=(e,t,n)=>en?n:e,Ue.hasAudio=e=>e.mozHasAudio||!!e.webkitAudioDecodedByteCount,Ue.luma=e=>.299*e[0]+.587*e[1]+.114*e[2],Ue.unescape=function(e){return null==e?e:e.replace(/<[^>]*>/g,"").replace(/&(amp|#039|quot|lt|gt|#44);/g,(e=>({"&":"&","'":"'",""":'"',"<":"<",">":">",",":","}[e]))) +},Ue.isImage=e=>/\.(jpe?g|jfif|png|gif|bmp|webp|avif|jxl)$/i.test(e),Ue.isVideo=e=>/\.(webm|mp4|ogv)$/i.test(e),Ue.engine=/Edge\//.test(navigator.userAgent)?"edge":/Chrome\//.test(navigator.userAgent)?"blink":/WebKit\//.test(navigator.userAgent)?"webkit":/Gecko\/|Goanna/.test(navigator.userAgent)?"gecko":void 0,Ue.hasStorage=function(){try{return"true"===localStorage.getItem(n.NAMESPACE+"hasStorage")||(localStorage.setItem(n.NAMESPACE+"hasStorage","true"),"true"===localStorage.getItem(n.NAMESPACE+"hasStorage"))}catch(e){return!1}}(),Ue.item=function(e,t){const n=m();return n[e]=t,n},Ue.oneItemSugar=e=>function(t,n,o){return"string"==typeof t?e(Ue.item(t,n),o):e(t,n)},Ue.syncing=m(),Ue.securityCheck=function(e){if("https:"!==location.protocol)return delete e["Redirect to HTTPS"]},"crx"===x?(Ue.oldValue={local:m(),sync:m()},chrome.storage.onChanged.addListener((function(e,t){for(var n in e){var o=Ue.oldValue.local[n]??Ue.oldValue.sync[n];Ue.oldValue[t][n]=m.clone(e[n].newValue) +;var a=Ue.oldValue.local[n]??Ue.oldValue.sync[n],i=Ue.syncing[n];i&&JSON.stringify(a)!==JSON.stringify(o)&&i(a,n)}})),Ue.sync=(e,t)=>Ue.syncing[e]=t,Ue.forceSync=function(){},Ue.crxWorking=function(){try{if(chrome.runtime.getManifest())return!0}catch(e){}if(!Ue.crxWarningShown){const e=Ue.el("div",{innerHTML:'4chan X seems to have been updated. You will need to reload the page.'});Ue.on(Ue("a",e),"click",(()=>location.reload())),new Ke("warning",e),Ue.crxWarningShown=!0}return!1},Ue.get=Ue.oneItemSugar((function(e,t){if(!Ue.crxWorking())return;const n={},o=function(o){let a=Object.keys(e);return"gecko"===Ue.engine&&"sync"===o&&a.length>3&&(a=null),chrome.storage[o].get(a,(function(i){let s;if(i=m.clone(i),chrome.runtime.lastError&&r.error(chrome.runtime.lastError.message),null===a){const t=m();for(s in i){var l=i[s];Ue.hasOwn(e,s)&&(t[s]=l)}i=t}for(s in e)Ue.oldValue[o][s]=i[s];if(n[o]=i,n.local&&n.sync)return Ue.extend(e,n.sync),Ue.extend(e,n.local),t(e)}))} +;return o("local"),o("sync")})),function(){const e={local:m(),sync:m()},t=(e,t)=>unescape(encodeURIComponent(JSON.stringify(e))).length+unescape(encodeURIComponent(JSON.stringify(t))).length>chrome.storage.sync.QUOTA_BYTES_PER_ITEM;Ue.delete=function(t){if(Ue.crxWorking()){for(var n of("string"==typeof t&&(t=[t]),t))delete e.local[n],delete e.sync[n];return chrome.storage.local.remove(t),chrome.storage.sync.remove(t)}};const n={};var o=function(i,s){const l=m();if(Ue.extend(l,e[i]),Object.keys(l).length&&!(n[i]>Date.now()))return chrome.storage[i].set(l,(function(){let d,c;if(d=chrome.runtime.lastError)return r.error(d.message),setTimeout(o,A,i),n[i]=Date.now()+A,s?.(d);for(c in delete n[i],l)e[i][c]===l[c]&&delete e[i][c];if("local"===i){for(c in l){var h=l[c];t(c,h)||(e.sync[c]=h)}a()}else chrome.storage.local.remove((()=>{const t=[];for(c in l)c in e.local||t.push(c);return t})());return s?.()}))},a=f(b,(()=>o("sync")));Ue.set=Ue.oneItemSugar((function(t,n){ +if(Ue.crxWorking())return Ue.securityCheck(t),Ue.extend(e.local,t),o("local",n)})),Ue.clear=function(t){if(!Ue.crxWorking())return;e.local=m(),e.sync=m();let n=2,o=null;const a=function(){if(chrome.runtime.lastError&&r.error(chrome.runtime.lastError.message),null==o&&(o=chrome.runtime.lastError),!--n)return t?.(o)};return chrome.storage.local.clear(a),chrome.storage.sync.clear(a)}}()):null==GM?.deleteValue||!window.BroadcastChannel||"undefined"!=typeof GM_addValueChangeListener&&null!==GM_addValueChangeListener?("undefined"!=typeof GM_deleteValue&&null!==GM_deleteValue||(Ue.perProtocolSettings=!0),"undefined"!=typeof GM_deleteValue&&null!==GM_deleteValue?(Ue.getValue=GM_getValue,Ue.listValues=()=>GM_listValues()):Ue.hasStorage?(Ue.getValue=e=>localStorage.getItem(e),Ue.listValues=()=>(()=>{const e=[];for(var t in localStorage)t.slice(0,n.NAMESPACE.length)===n.NAMESPACE&&e.push(t);return e})()):(Ue.getValue=function(){},Ue.listValues=()=>[]), +"undefined"!=typeof GM_addValueChangeListener&&null!==GM_addValueChangeListener?(Ue.setValue=GM_setValue,Ue.deleteValue=GM_deleteValue):"undefined"!=typeof GM_deleteValue&&null!==GM_deleteValue?(Ue.oldValue=m(),Ue.setValue=function(e,t){if(GM_setValue(e,t),e in Ue.syncing&&(Ue.oldValue[e]=t,Ue.hasStorage))return localStorage.setItem(e,t)},Ue.deleteValue=function(e){if(GM_deleteValue(e),e in Ue.syncing&&(delete Ue.oldValue[e],Ue.hasStorage))return localStorage.removeItem(e)},Ue.hasStorage||(Ue.cantSync=!0)):Ue.hasStorage?(Ue.oldValue=m(),Ue.setValue=function(e,t){return e in Ue.syncing&&(Ue.oldValue[e]=t),localStorage.setItem(e,t)},Ue.deleteValue=function(e){return e in Ue.syncing&&delete Ue.oldValue[e],localStorage.removeItem(e)}):(Ue.setValue=function(){},Ue.deleteValue=function(){},Ue.cantSync=Ue.cantSet=!0),"undefined"!=typeof GM_addValueChangeListener&&null!==GM_addValueChangeListener?(Ue.sync=(e,t)=>Ue.syncing[e]=GM_addValueChangeListener(n.NAMESPACE+e,(function(n,o,a,i){ +if(i)return void 0!==a&&(a=m.json(a)),t(a,e)})),Ue.forceSync=function(){}):"undefined"!=typeof GM_deleteValue&&null!==GM_deleteValue||Ue.hasStorage?(Ue.sync=function(e,t){return e=n.NAMESPACE+e,Ue.syncing[e]=t,Ue.oldValue[e]=Ue.getValue(e)},function(){const e=function({key:e,newValue:t}){let o;if(o=Ue.syncing[e]){if(null!=t){if(t===Ue.oldValue[e])return;return Ue.oldValue[e]=t,o(m.json(t),e.slice(n.NAMESPACE.length))}if(null!=Ue.oldValue[e])return delete Ue.oldValue[e],o(void 0,e.slice(n.NAMESPACE.length))}};Ue.on(window,"storage",e),Ue.forceSync=function(t){return t=n.NAMESPACE+t,e({key:t,newValue:Ue.getValue(t)})}}()):(Ue.sync=function(){},Ue.forceSync=function(){}),Ue.delete=function(e){for(var t of(e instanceof Array||(e=[e]),e))Ue.deleteValue(n.NAMESPACE+t)},Ue.get=Ue.oneItemSugar(((e,t)=>Ue.queueTask(Ue.getSync,e,t))),Ue.getSync=function(e,t){for(var o in e){var a;if(a=Ue.getValue(n.NAMESPACE+o))try{e[o]=m.json(a)}catch(e){if(!/^(?:undefined)*$/.test(a))throw e}}return t(e)}, +Ue.set=Ue.oneItemSugar((function(e,t){return Ue.securityCheck(e),Ue.queueTask((function(){for(var o in e){var a=e[o];Ue.setValue(n.NAMESPACE+o,JSON.stringify(a))}return t?.()}))})),Ue.clear=function(e){Ue.delete(Object.keys(t)),Ue.delete(["previousversion","QR Size","QR.persona"]);try{Ue.delete(Ue.listValues().map((e=>e.replace(n.NAMESPACE,""))))}catch(e){}return e?.()}):(Ue.syncChannel=new BroadcastChannel(n.NAMESPACE+"sync"),Ue.on(Ue.syncChannel,"message",(e=>(()=>{const t=[];for(var n in e.data){var o,a=e.data[n];(o=Ue.syncing[n])&&t.push(o(m.json(JSON.stringify(a)),n))}return t})())),Ue.sync=(e,t)=>Ue.syncing[e]=t,Ue.forceSync=function(){},Ue.delete=function(e,t){let o;return e instanceof Array||(e=[e]),Promise.all((()=>{const t=[];for(o of e)t.push(GM.deleteValue(n.NAMESPACE+o));return t})()).then((function(){const n=m();for(o of e)n[o]=void 0;return Ue.syncChannel.postMessage(n),t?.()}))},Ue.get=Ue.oneItemSugar((function(e,t){const o=Object.keys(e) +;return Promise.all(o.map((e=>GM.getValue(n.NAMESPACE+e)))).then((function(n){for(let t=0;t{const t=[];for(var o in e){var a=e[o];t.push(GM.setValue(n.NAMESPACE+o,JSON.stringify(a)))}return t})()).then((function(){return Ue.syncChannel.postMessage(e),t?.()}))})),Ue.clear=e=>GM.listValues().then((t=>Ue.delete(t.map((e=>e.replace(n.NAMESPACE,""))),e))).catch((()=>Ue.delete(Object.keys(t).concat(["previousversion","QR Size","QR.persona"]),e))));var He=Ue,Ve={url(e,t,...o){let a,i;return(i=n.sites[t.siteID])&&(a=He.getOwn(i.urls,e))?a(t,...Array.from(o)):void 0},threadExcerpt(e){const{OP:t}=e,n=`/${decodeURIComponent(e.board.ID)}/ - `+(t.info.subject?.trim()||t.commentDisplay().replace(/\n+/g," // ")||t.file?.name||`No.${t}`);return n.length>73?`${n.slice(0,70)}...`:n},threadFromRoot(e){if(null==e)return null;const{board:t}=e.dataset +;return n.threads.get(`${t?encodeURIComponent(t):n.BOARD.ID}.${e.id.match(/\d*$/)[0]}`)},threadFromNode:e=>Ve.threadFromRoot(He.x(`ancestor-or-self::${n.SITE.xpath.thread}`,e)),postFromRoot(e){if(null==e)return null;const t=n.posts.get(e.dataset.fullID),o=e.dataset.clone;return o?t.clones[+o]:t},postFromNode:e=>Ve.postFromRoot(He.x(`ancestor-or-self::${n.SITE.xpath.postContainer}[1]`,e)),postDataFromLink(e){let t,o,a;if(e.dataset.postID)({boardID:t,threadID:a,postID:o}=e.dataset),a||(a=0);else{const i=e.href.match(n.SITE.regexp.quotelink);[t,a,o]=Array.from(i.slice(1)),o||(o=a)}return{boardID:t,threadID:+a,postID:+o}},allQuotelinksLinkingTo(e){const o=[],{posts:a}=n,{fullID:i}=e,r=function(e,t){for(var n of(o.push(...Array.from(e.nodes[t]||[])),e.clones))o.push(...Array.from(n.nodes[t]||[]))};if(a.forEach((function(e){if(e.quotes.includes(i))return r(e,"quotelinks")})),t["Quote Backlinks"])for(var s of e.quotes){var l;(l=a.get(s))&&r(l,"backlinks")}return o.filter((function(t){ +const{boardID:n,postID:o}=Ve.postDataFromLink(t);return n===e.board.ID&&o===e.ID}))}},Qe=Ve,ze={filters:new Map,init(){if(["index","thread","catalog"].includes(n.VIEW)&&t.Filter&&("catalog"!==n.VIEW||t["Filter in Native Catalog"])){for(var e in t["Filtered Backlinks"]||He.addClass(i,"hide-backlinks"),c.filter)for(var o of t[e].split("\n")){let n,i,l,c,m;if("#"===o[0])continue;if(!(l=o.match(/\/(.*)\/(\w*)/)))continue;var a=o.replace(l[0],""),r=this.parseBoards(a.match(/(?:^|;)\s*boards:([^;]+)/)?.[1]),s=this.parseBoards(a.match(/(?:^|;)\s*exclude:([^;]+)/)?.[1]);if(i=["uniqueID","MD5"].includes(e))l=l[1];else try{l=RegExp(l[1],l[2])}catch(t){new Ke("warning",[He.tn(`Invalid ${e} filter:`),He.el("br"),He.tn(o),He.el("br"),He.tn(t.message)],60);continue}var d=a.match(/(?:^|;)\s*op:(no|only)/)?.[1]||"",h=He.getOwn({no:1,only:2},d)||0,u=a.match(/(?:^|;)\s*file:(no|only)/)?.[1]||"";h|=He.getOwn({no:4,only:8},u)||0;var p=(()=>{switch(a.match(/(?:^|;)\s*stub:(yes|no)/)?.[1]){case"yes": +return!0;case"no":return!1;default:return t.Stubs}})(),g=/(?:^|;)\s*notify/.test(a);(n=/(?:^|;)\s*highlight/.test(a))&&(n=a.match(/(?:^|;)\s*highlight:([\w-]+)/)?.[1]||"filter-highlight",c=a.match(/(?:^|;)\s*top:(yes|no)/)?.[1]||"yes",c="yes"===c),"general"===e&&(m=(m=a.match(/(?:^|;)\s*type:([^;]*)/))?m[1].split(","):["subject","name","filename","comment"]);const b={isstring:i,regexp:l,boards:r,excludes:s,mask:h,hide:!(n||g),stub:p,hl:n,top:c,noti:g};if("general"===e)for(var f of m)this.filters.get(f)?.push(b)??this.filters.set(f,[b]);else this.filters.get(e)?.push(b)??this.filters.set(e,[b])}if(this.filters.size){for(const e of["MD5","uniqueID"]){const t=this.filters.get(e);if(!t)continue;const n=new Map;for(const e of t)n.get(e.regexp)?.push(e)??n.set(e.regexp,[e]);this.filters.set(e,n)}return"catalog"===n.VIEW?ze.catalog():l.Post.push({name:"Filter",cb:this.node})}}},parseBoards(e){let t;if(!e)return!1;if(t=ze.parseBoardsMemo[e])return t;t=m();let o="" +;for(var a of e.split(","))for(var i in a.includes(":")&&([o,a]=Array.from(a.split(":").slice(-2))),n.sites){var r=n.sites[i];if(i.slice(0,o.length)===o)if(["nsfw","sfw"].includes(a))for(var s of r.sfwBoards?.("sfw"===a)||[])t[`${i}/${s}`]=!0;else t[`${i}/${encodeURIComponent(a)}`]=!0}return ze.parseBoardsMemo[e]=t,t},parseBoardsMemo:m(),test(e,t=!0){if(e.filterResults)return e.filterResults;let n,o=!1,a=!0,i=!1,r=!1;X.isYou(e)&&(t=!1);let s=e.isReply?2:1;s|=e.file?4:8;const l=`${e.siteID}/${e.boardID}`,d=`${e.siteID}/*`;for(const c of ze.filters.keys())for(const h of ze.values(c,e)){const e=ze.filters.get(c),u=Array.isArray(e)?e:e.get(h);if(u)for(const e of u)e.boards&&!e.boards[l]&&!e.boards[d]||e.excludes&&(e.excludes[l]||e.excludes[d])||e.mask&s||!(e.isstring?e.regexp===h:e.regexp.test(h))||(e.hide?t&&(o=!0,a&&({stub:a}=e)):(n&&n.includes(e.hl)||(n||(n=[])).push(e.hl),i||({top:i}=e),e.noti&&(r=!0)))}return o?{hide:o,stub:a}:{hl:n,top:i,noti:r}},node(){if(this.isClone)return +;const{hide:e,stub:t,hl:o,top:a,noti:i}=ze.test(this,!this.isFetchedQuote&&(this.isReply||"index"===n.VIEW));return e?this.isReply?z.hide(this,t):le.hide(this.thread,t):o&&(this.highlights=o,He.addClass(this.nodes.root,...Array.from(o))),i&&Z.posts&&this.ID>Z.lastReadPost&&!X.isYou(this)?Z.openNotification(this," triggered a notification filter"):void 0},catalog(){let e;if(e=n.SITE.urls.catalogJSON?.(n.BOARD))return ze.catalogData=m(),He.ajax(e,{onloadend:ze.catalogParse}),l.CatalogThreadNative.push({name:"Filter",cb:this.catalogNode})},catalogParse(){if([200,404].includes(this.status)){for(var e of this.response)for(var t of e.threads)ze.catalogData[t.no]=t;n.BOARD.threads.forEach((function(e){if(e.catalogViewNative)return ze.catalogNode.call(e.catalogViewNative)}))}else new Ke("warning","Failed to fetch catalog JSON data. "+(this.status?`Error ${this.statusText} (${this.status})`:"Connection Error"),1)},catalogNode(){if(this.boardID!==n.BOARD.ID||!ze.catalogData[this.ID])return +;if(X.db?.get({siteID:n.SITE.ID,boardID:this.boardID,threadID:this.ID,postID:this.ID}))return;const{hide:e,hl:t,top:o}=ze.test(n.SITE.Build.parseJSON(ze.catalogData[this.ID],this));return e?this.nodes.root.hidden=!0:(t&&(this.highlights=t,He.addClass(this.nodes.root,...Array.from(t))),o?(He.prepend(this.nodes.root.parentNode,this.nodes.root),n.SITE.catalogPin?.(this.nodes.root)):void 0)},isHidden:e=>!!ze.test(e).hide,valueF:{postID:e=>[`${e.ID}`],name:e=>void 0===e.info.name?[]:[e.info.name],uniqueID:e=>[e.info.uniqueID||""],tripcode:e=>void 0===e.info.tripcode?[]:[e.info.tripcode],capcode:e=>void 0===e.info.capcode?[]:[e.info.capcode],pass:e=>[e.info.pass],email:e=>[e.info.email],subject:e=>[e.info.subject||(e.isReply?void 0:"")],comment:e=>(null==e.info.comment&&(e.info.comment=n.sites[e.siteID]?.Build?.parseComment?.(e.info.commentHTML.innerHTML)),[e.info.comment]),flag:e=>void 0===e.info.flag?[]:[e.info.flag],filename:e=>e.files.map((e=>e.name)), +dimensions:e=>e.files.map((e=>e.dimensions)),filesize:e=>e.files.map((e=>e.size)),MD5:e=>e.files.map((e=>e.MD5))},values:(e,t)=>He.hasOwn(ze.valueF,e)?ze.valueF[e](t).filter((e=>null!=e)):[e.split("+").map((function(e){let n;return(n=He.getOwn(ze.valueF,e))?n(t).map((e=>e||"")).join("\n"):""})).join("\n")],addFilter(e,n,o){if(He.hasOwn(c.filter,e))return He.get(e,t[e],(function(t){let a=t[e];return a=a?`${a}\n${n}`:n,He.set(e,a,o)}))},removeFilters:(e,n,o)=>He.get(e,t[e],(function(t){let a=t[e];const i=(Array.isArray(n)?n:[...n.values()].flat()).map(ze.escape).join("|");return a=a.replace(RegExp(`(?:$\n|^)(?:${i})$`,"mg"),""),He.set(e,a,o)})),showFilters(e){Re.open("Filter");const t=He(".section-container"),n=He("select[name=filter]",t);return n.value=e,Re.selectFilter.call(n),He.onExists(t,"textarea",(function(e){const t=e.textLength;return e.setSelectionRange(t,t),e.focus()}))},quickFilterMD5(){const e=Qe.postFromNode(this),o=e.files.filter((e=>e.MD5));if(!o.length)return +;const a=o.map((e=>`/${e.MD5}/`)).join("\n");ze.addFilter("MD5",a);const i=e.origin||e;if(i.isReply?z.hide(i):"index"===n.VIEW&&le.hide(i.thread),!t["MD5 Quick Filter Notifications"])return void(e.nodes.post.getBoundingClientRect().height&&new Ke("info","MD5 filtered.",2));let{notice:r}=ze.quickFilterMD5;if(r)return r.filters.push(a),r.posts.push(i),He("span",r.el).textContent=`${r.filters.length} MD5s filtered.`;{const e=He.el("div",{innerHTML:'MD5 filtered. [show] [undo]'});r=ze.quickFilterMD5.notice=new Ke("info",e,void 0,(()=>delete ze.quickFilterMD5.notice)),r.filters=[a],r.posts=[i];const t=u("a",e);return He.on(t[0],"click",ze.quickFilterCB.show.bind(r)),He.on(t[1],"click",ze.quickFilterCB.undo.bind(r))}},quickFilterCB:{show(){return ze.showFilters("MD5"),this.close()},undo(){for(var e of(ze.removeFilters("MD5",this.filters),this.posts))e.isReply?z.show(e):"index"===n.VIEW&&le.show(e.thread);return this.close()} +},escape:e=>e.replace(new RegExp("/|\\\\|\\^|\\$|\\n|\\.|\\(|\\)|\\{|\\}|\\[|\\]|\\?|\\*|\\+|\\|","g"),(function(e){return"\n"===e?"\\n":"\\"===e?"\\\\":`\\${e}`})),menu:{init(){if(!["index","thread"].includes(n.VIEW)||!t.Menu||!t.Filter)return;const e={el:He.el("div",{textContent:"Filter"}),order:50,open:e=>(ze.menu.post=e,!0),subEntries:[]};for(var o of[["Name","name"],["Unique ID","uniqueID"],["Tripcode","tripcode"],["Capcode","capcode"],["Pass Date","pass"],["Email","email"],["Subject","subject"],["Comment","comment"],["Flag","flag"],["Filename","filename"],["Image dimensions","dimensions"],["Filesize","filesize"],["Image MD5","MD5"]])e.subEntries.push(ze.menu.createSubEntry(o[0],o[1]));return V.menu.addEntry(e)},createSubEntry(e,t){const n=He.el("a",{href:"javascript:;",textContent:e});return n.dataset.type=t,He.on(n,"click",ze.menu.makeFilter),{el:n,open:e=>ze.values(t,e).length}},makeFilter(){const{type:e}=this.dataset,t=ze.values(e,ze.menu.post).map((function(t){ +const n=["uniqueID","MD5"].includes(e)?t:ze.escape(t);return["uniqueID","MD5"].includes(e)?`/${n}/`:`/^${n}$/`})).join("\n");return ze.addFilter(e,t,(()=>ze.showFilters(e)))}}},We={defaultProperties:{"4chan.org":{software:"yotsuba"},"4channel.org":{canonical:"4chan.org"},"4cdn.org":{canonical:"4chan.org"},"notso.smuglo.li":{canonical:"smuglo.li"},"smugloli.net":{canonical:"smuglo.li"},"smug.nepu.moe":{canonical:"smuglo.li"}},init(e){He.extend(t.siteProperties,We.defaultProperties);let o=We.resolve();return o&&He.hasOwn(Ie,t.siteProperties[o].software)&&(this.set(o),e()),He.onExists(i,"body",(()=>{for(var a in Ie){var i;if(i=Ie[a].detect?.()){i.software=a,o=location.hostname.replace(/^www\./,"");var r=t.siteProperties[o]||(t.siteProperties[o]=m()),s=0;for(var l in i)r[l]!==i[l]&&(r[l]=i[l],s++);return s&&He.set("siteProperties",t.siteProperties),void(n.SITE||(this.set(o),e()))}}}))},resolve(e=location){let{hostname:n}=e;for(;n&&!He.hasOwn(t.siteProperties,n);)n=n.replace(/^[^.]*\.?/,"") +;if(n){let e;(e=t.siteProperties[n].canonical)&&(n=e)}return n},parseURL(e){const t=We.resolve(e);return Lt.parseURL(n.sites[t],e)},set(e){for(var o in t.siteProperties){var a,i=t.siteProperties[o];if(!i.canonical){var{software:r}=i;r&&He.hasOwn(Ie,r)&&(n.sites[o]=a=Object.create(Ie[r]),He.extend(a,{ID:o,siteID:o,properties:i,software:r}))}}return n.SITE=n.sites[e]}},Ge={init(){if("yotsuba"===n.SITE.software&&(t["External Catalog"]||t["JSON Index"])&&(!t["JSON Index"]||"index"!==n.VIEW)){const o=(()=>{switch(n.VIEW){case"thread":case"archive":return".navLinks.desktop > a";case"catalog":return".navLinks > :first-child > a";case"index":return"#ctrl-top > a, .cataloglink > a"}})();He.ready((function(){for(var a of u(o)){var i;switch(a.pathname.replace(/\/+/g,"/")){case`/${n.BOARD}/`:t["JSON Index"]&&(a.textContent="Index"),a.href=Ge.index();break;case`/${n.BOARD}/catalog`:a.href=Ge.catalog()}if("catalog"===n.VIEW&&(i=Ge.catalog())!==n.SITE.urls.catalog?.(n.BOARD)){ +var r=a.parentNode.cloneNode(!0),s=r.firstElementChild;s.href=i,s.textContent=s.hostname===location.hostname?`${e.name} Catalog`:"External Catalog",He.after(a.parentNode,[He.tn(" "),r])}}}))}if("yotsuba"===n.SITE.software&&t["JSON Index"]&&t[`Use ${e.name} Catalog`]&&l.Post.push({name:"Catalog Link Rewrite",cb:this.node}),this.enabled=t["Catalog Links"]){let e;Ge.el=e=F.checkbox("Header catalog links","Catalog Links"),e.id="toggleCatalog";const t=He("input",e);return He.on(t,"change",this.toggle),He.sync("Header catalog links",Ge.set),Je.menu.addEntry({el:e,order:95})}},node(){for(var e of u("a",this.nodes.comment)){var t;(t=e.href.match(/^https?:\/\/(boards\.4chan(?:nel)?\.org\/[^\/]+)\/catalog(#s=.*)?/))&&(e.href=`//${t[1]}/${t[2]||"#catalog"}`)}},toggle(){return He.event("CloseMenu"),He.set("Header catalog links",this.checked),Ge.set(this.checked)},set:e=>(t["Header catalog links"]=e,Ge.setLinks(Je.boardList),Ge.setLinks(Je.bottomBoardList), +Ge.el.title=`Turn catalog links ${e?"off":"on"}.`,He("input",Ge.el).checked=e),setLinks(e){if(!(Ge.enabled??t["Catalog Links"])||!e)return;const n=/(?:index)?(?:\.\w+)?$/;for(var o of u("a:not([data-only])",e)){var{siteID:a,boardID:i}=o.dataset;if(!a||!i){var r;if(({siteID:a,boardID:i,VIEW:r}=We.parseURL(o)),!a||!i||!["index","catalog"].includes(r)||!o.dataset.indexOptions&&o.href.replace(n,"")!==(Qe.url(r,{siteID:a,boardID:i})||"").replace(n,""))continue;He.extend(o.dataset,{siteID:a,boardID:i})}var s={siteID:a,boardID:i},l=t["Header catalog links"]?Ge.catalog(s):Qe.url("index",s);l&&(o.href=l,o.dataset.indexOptions&&l.split("#")[0]===Qe.url("index",s)&&(o.href+=(o.hash?"/":"#")+o.dataset.indexOptions))}},externalParse(){for(var e of(Ge.externalList=m(),t.externalCatalogURLs.split("\n")))if("#"!==e[0]){var n=e.split(";")[0],o=ze.parseBoards(e.match(/;boards:([^;]+)/)?.[1]||"*"),a=ze.parseBoards(e.match(/;exclude:([^;]+)/)?.[1])||m() +;for(var i in o)a[i]||a[i.split("/")[0]+"/*"]||(Ge.externalList[i]=n)}},external({siteID:e,boardID:t}){Ge.externalList||Ge.externalParse();const n=Ge.externalList[`${e}/${t}`]||Ge.externalList[`${e}/*`];return n?n.replace(/%board/g,t):void 0},jsonIndex:(e,t)=>n.SITE.ID===e.siteID&&n.BOARD.ID===e.boardID&&"index"===n.VIEW?t:Qe.url("index",e)+t,catalog(o=n.BOARD){let a,i;return t["External Catalog"]&&(a=Ge.external(o))?a:se.enabledOn(o)&&t[`Use ${e.name} Catalog`]?Ge.jsonIndex(o,"#catalog"):(i=Qe.url("catalog",o))?i:Ge.external(o)},index:(e=n.BOARD)=>se.enabledOn(e)?Ge.jsonIndex(e,"#index"):Qe.url("index",e)},Ye={init(){He.onExists(i,"body",(()=>{if(Lt.isThisPageLegit())return He.add(this.bar,[this.noticesRoot,this.toggle]),He.prepend(a.body,this.bar),He.add(a.body,Ye.hover),this.setBarPosition(t["Bottom Header"])})),this.menu=new F.Menu("header");const e=He.el("span",{className:"menu-button"});He.extend(e,{innerHTML:""}) +;const o=F.checkbox,r=o("Fixed Header","Fixed Header"),s=o("Header auto-hide","Auto-hide header"),l=o("Header auto-hide on scroll","Auto-hide header on scroll"),d=o("Bottom Header","Bottom header"),c=o("Centered links","Centered links"),h=o("Custom Board Navigation","Custom board navigation"),p=o("Bottom Board List","Hide bottom board list"),g=o("Shortcut Icons","Shortcut Icons"),f=He.el("a",{textContent:"Edit custom board navigation",href:"javascript:;"});if(this.barFixedToggler=r.firstElementChild,this.scrollHeaderToggler=l.firstElementChild,this.barPositionToggler=d.firstElementChild,this.linkJustifyToggler=c.firstElementChild,this.headerToggler=s.firstElementChild,this.footerToggler=p.firstElementChild,this.shortcutToggler=g.firstElementChild,this.customNavToggler=h.firstElementChild,He.on(e,"click",this.menuToggle),He.on(this.headerToggler,"change",this.toggleBarVisibility),He.on(this.barFixedToggler,"change",this.toggleBarFixed), +He.on(this.barPositionToggler,"change",this.toggleBarPosition),He.on(this.scrollHeaderToggler,"change",this.toggleHideBarOnScroll),He.on(this.linkJustifyToggler,"change",this.toggleLinkJustify),He.on(this.footerToggler,"change",this.toggleFooterVisibility),He.on(this.shortcutToggler,"change",this.toggleShortcutIcons),He.on(this.customNavToggler,"change",this.toggleCustomNav),He.on(f,"click",this.editCustomNav),this.setBarFixed(t["Fixed Header"]),this.setHideBarOnScroll(t["Header auto-hide on scroll"]),this.setBarVisibility(t["Header auto-hide"]),this.setLinkJustify(t["Centered links"]),this.setShortcutIcons(t["Shortcut Icons"]),this.setFooterVisibility(t["Bottom Board List"]),He.sync("Fixed Header",this.setBarFixed),He.sync("Header auto-hide on scroll",this.setHideBarOnScroll),He.sync("Bottom Header",this.setBarPosition),He.sync("Shortcut Icons",this.setShortcutIcons),He.sync("Header auto-hide",this.setBarVisibility),He.sync("Centered links",this.setLinkJustify), +He.sync("Bottom Board List",this.setFooterVisibility),this.addShortcut("menu",e,900),this.menu.addEntry({el:He.el("span",{textContent:"Header"}),order:107,subEntries:[{el:r},{el:s},{el:l},{el:d},{el:c},{el:p},{el:g},{el:h},{el:f}]}),He.on(window,"load popstate",Ye.hashScroll),He.on(a,"CreateNotification",this.createNotification),this.setBoardList(),He.onExists(i,`${n.SITE.selectors.boardList} + *`,Ye.generateFullBoardList),Lt.ready((function(){let e;if("yotsuba"===n.SITE.software&&!(e=He.id("boardNavDesktopFoot"))){let t;if(!(t=He.id("absbot")))return;e=He.id("boardNavDesktop").cloneNode(!0),e.id="boardNavDesktopFoot",He("#navtopright",e).id="navbotright",He("#settingsWindowLink",e).id="settingsWindowLinkBot",He.before(t,e),He.global((()=>window.cloneTopNav=function(){}))}if(Ye.bottomBoardList=He(n.SITE.selectors.boardListBottom)){for(var t of u("a",Ye.bottomBoardList))t.hostname===location.hostname&&t.pathname.split("/")[1]===n.BOARD.ID&&(t.className="current") +;return Ge.setLinks(Ye.bottomBoardList)}})),"yotsuba"===n.SITE.software&&("catalog"===n.VIEW||!t["Disable Native Extension"])){const e=He.el("a",{href:"javascript:;"});"catalog"===n.VIEW?(e.title=e.textContent="Catalog Settings",e.textContent="🕮︎"):(e.title=e.textContent="4chan Settings",e.className="native-settings"),He.on(e,"click",(()=>He.id("settingsWindowLink").click())),this.addShortcut("native",e,810)}return this.enableDesktopNotifications()},bar:He.el("div",{id:"header-bar"}),noticesRoot:He.el("div",{id:"notifications"}),shortcuts:He.el("span",{id:"shortcuts"}),hover:He.el("div",{id:"hoverUI"}),toggle:He.el("div",{id:"scroll-marker"}),setBoardList(){let e;Ye.boardList=e=He.el("span",{id:"board-list"}),He.extend(e,{innerHTML:''}) +;const n=He(".hide-board-list-button",e);return He.on(n,"click",Ye.toggleBoardList),He.prepend(Ye.bar,[Ye.boardList,Ye.shortcuts]),Ye.setCustomNav(t["Custom Board Navigation"]),Ye.generateBoardList(t.boardnav),He.sync("Custom Board Navigation",Ye.setCustomNav),He.sync("boardnav",Ye.generateBoardList)},generateFullBoardList(){let e;e=n.SITE.transformBoardList?n.SITE.transformBoardList():[...Array.from(He(n.SITE.selectors.boardList).cloneNode(!0).childNodes)];const t=He(".boardList",Ye.boardList);for(var o of(He.add(t,e),u("a",t)))o.hostname===location.hostname&&o.pathname.split("/")[1]===n.BOARD.ID&&(o.className="current");return Ge.setLinks(t)},generateBoardList(e){const t=He("#custom-board-list",Ye.boardList);if(He.rmAll(t),!e)return;const n=(e=e.replace(/(\r\n|\n|\r)/g," ")).match(/[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|nt|(mode|sort|text):"[^"]+"(,"[^"]+")?))*|[^\w@]+/g).map((e=>Ye.mapCustomNavigation(e)));return He.add(t,n),Ge.setLinks(t)}, +mapCustomNavigation(e){let o,a,i,r;if(/^[^\w@]/.test(e))return He.tn(e);let s=r=null;e=e.replace(/-text:"([^"]+)"(?:,"([^"]+)")?/g,(function(e,t,n){return s=t,r=n,""}));let l=[];if(e=e.replace(/-(?:mode|sort):"([^"]+)"/g,(function(e,t){return l.push(t.toLowerCase().replace(/\ /g,"-")),""})),l=l.join("/"),/^toggle-all/.test(e))return o=He.el("a",{className:"show-board-list-button",textContent:s||"+",href:"javascript:;"}),He.on(o,"click",Ye.toggleBoardList),o;if(/^external/.test(e))return o=He.el("a",{href:r||"javascript:;",textContent:s||"+",className:"external"}),/-nt/.test(e)&&(o.target="_blank",o.rel="noopener"),o;let d=e.split("-")[0];if("current"===d){if(!["boards.4chan.org","boards.4channel.org"].includes(location.hostname))return o=He.el("a",{href:`/${n.BOARD.ID}/`,textContent:s||decodeURIComponent(n.BOARD.ID),className:"current"}),/-nt/.test(e)&&(o.target="_blank",o.rel="noopener"),/-index/.test(e)?o.dataset.only="index":/-catalog/.test(e)?(o.dataset.only="catalog", +o.href+="catalog.html"):/-(archive|expired)/.test(e)&&(o=o.firstChild),o;d=n.BOARD.ID}if(o=function(){let e;return"@"===d?He.el("a",{href:"https://twitter.com/4chan",title:"4chan Twitter",textContent:"@"}):(o=He.el("a",{href:`//${G.domain(d)}/${d}/`,textContent:d,title:G.title(d)}),["catalog","archive"].includes(n.VIEW)&&(e=Qe.url(n.VIEW,{siteID:"4chan.org",boardID:d}))&&(o.href=e),o.hostname===location.hostname&&d===n.BOARD.ID&&(o.className="current"),o)}(),o.textContent=/-title/.test(e)||/-replace/.test(e)&&o.hostname===location.hostname&&d===n.BOARD.ID?o.title||o.textContent:/-full/.test(e)?`/${d}/`+(o.title?` - ${o.title}`:""):s||d,i=e.match(/-(index|catalog)/)){const e=Ge[i[1]]({siteID:"4chan.org",boardID:d});if(!e)return o.firstChild;o.dataset.only=i[1],o.href=e,"catalog"===i[1]&&He.addClass(o,"catalog")}if(t["JSON Index"]&&l&&(o.dataset.indexOptions=l,["boards.4chan.org","boards.4channel.org"].includes(o.hostname)&&""===o.pathname.split("/")[2]&&(o.href+=(o.hash?"/":"#")+l)), +/-archive/.test(e)){if(!(a=_e.to("board",{boardID:d})))return o.firstChild;o.href=a}if(/-expired/.test(e)){if(!G.isArchived(d))return o.firstChild;o.href=`//${G.domain(d)}/${d}/archive`}return/-nt/.test(e)&&(o.target="_blank",o.rel="noopener"),"@"===d&&He.addClass(o,"navSmall"),o},toggleBoardList(){const{bar:e}=Ye,t=He("#custom-board-list",e),n=He("#full-board-list",e),o=!n.hidden;return t.hidden=!o,n.hidden=o},setLinkJustify:e=>(Ye.linkJustifyToggler.checked=e,e?He.addClass(i,"centered-links"):He.rmClass(i,"centered-links")),toggleLinkJustify(){He.event("CloseMenu");const e="INPUT"===this.nodeName?this.checked:void 0;return Ye.setLinkJustify(e),He.set("Centered links",e)},setBarFixed:e=>(Ye.barFixedToggler.checked=e,e?(He.addClass(i,"fixed"),He.addClass(Ye.bar,"dialog")):(He.rmClass(i,"fixed"),He.rmClass(Ye.bar,"dialog"))),toggleBarFixed(){return He.event("CloseMenu"),Ye.setBarFixed(this.checked),t["Fixed Header"]=this.checked,He.set("Fixed Header",this.checked)}, +setShortcutIcons:e=>(Ye.shortcutToggler.checked=e,e?He.addClass(i,"shortcut-icons"):He.rmClass(i,"shortcut-icons")),toggleShortcutIcons(){return He.event("CloseMenu"),Ye.setShortcutIcons(this.checked),t["Shortcut Icons"]=this.checked,He.set("Shortcut Icons",this.checked)},setBarVisibility:e=>(Ye.headerToggler.checked=e,He.event("CloseMenu"),(e?He.addClass:He.rmClass)(Ye.bar,"autohide"),(e?He.addClass:He.rmClass)(i,"autohide")),toggleBarVisibility(){const e="INPUT"===this.nodeName?this.checked:!He.hasClass(Ye.bar,"autohide");t["Header auto-hide"]=e,He.set("Header auto-hide",e),Ye.setBarVisibility(e);return new Ke("info","The header bar will "+(e?"automatically hide itself.":"remain visible."),2)},setHideBarOnScroll(e){if(Ye.scrollHeaderToggler.checked=e,!e)return He.off(window,"scroll",Ye.hideBarOnScroll),He.rmClass(Ye.bar,"scroll"),Ye.bar.classList.toggle("autohide",t["Header auto-hide"]);He.on(window,"scroll",Ye.hideBarOnScroll)},toggleHideBarOnScroll(){const e=this.checked +;return He.cb.checked.call(this),Ye.setHideBarOnScroll(e)},hideBarOnScroll(){const e=window.pageYOffset;return e>(Ye.previousOffset||0)?He.addClass(Ye.bar,"autohide","scroll"):He.rmClass(Ye.bar,"autohide","scroll"),Ye.previousOffset=e},setBarPosition(e){Ye.barPositionToggler&&(Ye.barPositionToggler.checked=e),He.event("CloseMenu");const t=e?["bottom-header","top-header","after"]:["top-header","bottom-header","add"];return He.addClass(i,t[0]),He.rmClass(i,t[1]),He[t[2]](Ye.bar,Ye.noticesRoot)},toggleBarPosition(){return He.cb.checked.call(this),Ye.setBarPosition(this.checked)},setFooterVisibility:e=>(Ye.footerToggler.checked=e,i.classList.toggle("hide-bottom-board-list",e)),toggleFooterVisibility(){He.event("CloseMenu");const e="INPUT"===this.nodeName?this.checked:He.hasClass(i,"hide-bottom-board-list");Ye.setFooterVisibility(e),He.set("Bottom Board List",e);return new Ke("info",e?"The bottom navigation will now be hidden.":"The bottom navigation will remain visible.",2)}, +setCustomNav(e){let t;Ye.customNavToggler.checked=e;const n=He("#custom-board-list",Ye.bar),o=He("#full-board-list",Ye.bar),a=He(".hide-board-list-container",o);return[n.hidden,o.hidden,a.hidden]=Array.from(t=e?[!1,!0,!1]:[!0,!1,!0]),t},toggleCustomNav(){return He.cb.checked.call(this),Ye.setCustomNav(this.checked)},editCustomNav(){Re.open("Advanced");const e=He.id("fourchanx-settings");return He("[name=boardnav]",e).focus()},hashScroll(e){let t;if(e){if(e.state)return;history.state||history.replaceState({},"")}if(t=location.hash.slice(1)){let e;if(Ee.showIfHidden(t),e=He.id(t))return He.queueTask((()=>Ye.scrollTo(e)))}},scrollTo(e,n,o){let a,i;if(e.offsetParent)if(n){if(i=Ye.getBottomOf(e),t["Fixed Header"]&&t["Header auto-hide on scroll"]&&t["Bottom header"]&&(({height:a}=Ye.bar.getBoundingClientRect()),i<=0?Ye.isHidden()||(i+=a):Ye.isHidden()&&(i-=a)),!o||i<0)return window.scrollBy(0,-i)}else if(i=Ye.getTopOf(e), +t["Fixed Header"]&&t["Header auto-hide on scroll"]&&!t["Bottom header"]&&(({height:a}=Ye.bar.getBoundingClientRect()),i>=0?Ye.isHidden()||(i+=a):Ye.isHidden()&&(i-=a)),!o||i<0)return window.scrollBy(0,i)},scrollToIfNeeded:(e,t)=>Ye.scrollTo(e,t,!0),getTopOf(e){let{top:n}=e.getBoundingClientRect();if(t["Fixed Header"]&&!t["Bottom Header"]){const e=Ye.toggle.getBoundingClientRect();n-=e.top+e.height}return n},getBottomOf(e){const{clientHeight:n}=i;let o=n-e.getBoundingClientRect().bottom;if(t["Fixed Header"]&&t["Bottom Header"]){const e=Ye.toggle.getBoundingClientRect();o-=n-e.bottom+e.height}return o},isNodeVisible(e){if(a.hidden||!i.contains(e))return!1;const{height:t}=e.getBoundingClientRect();return Ye.getTopOf(e)+t>=0&&Ye.getBottomOf(e)+t>=0},isHidden(){const{top:e}=Ye.bar.getBoundingClientRect();return t["Bottom header"]?e===i.clientHeight:e<0},addShortcut(e,t,n){const o=He.el("span",{id:`shortcut-${e}`,className:"shortcut brackets-wrap"});for(var a of(He.add(o,t), +o.dataset.index=n,u("[data-index]",Ye.shortcuts)))if(+a.dataset.index>+n)return void He.before(a,o);return He.add(Ye.shortcuts,o)},rmShortcut:e=>He.rm(e.parentElement),menuToggle(e){return Ye.menu.toggle(e,this,n)},createNotification(e){const{type:t,content:n,lifetime:o}=e.detail;return new Ke(t,n,o)},areNotificationsEnabled:!1,enableDesktopNotifications(){let n;if(!window.Notification||!t["Desktop Notifications"])return;switch(Notification.permission){case"granted":return void(Ye.areNotificationsEnabled=!0);case"denied":return}const o=He.el("span",{innerHTML:`${e.name} needs your permission to show desktop notifications. [FAQ]
            or `}),[a,i]=Array.from(u("button",o));return He.on(a,"click",(()=>Notification.requestPermission((function(e){if(Ye.areNotificationsEnabled="granted"===e,"default"!==e)return n.close()})))), +He.on(i,"click",(function(){return He.set("Desktop Notifications",!1),n.close()})),n=new Ke("info",o)}},Je=Ye;class Ke{constructor(e,t,n,o){this.add=this.add.bind(this),this.close=this.close.bind(this),this.timeout=n,this.onclose=o,this.el=He.el("div",{innerHTML:'
            '}),this.el.style.opacity=0,this.setType(e),He.on(this.el.firstElementChild,"click",this.close),"string"==typeof t&&(t=He.tn(t)),He.add(this.el.lastElementChild,t),He.ready(this.add)}setType(e){return this.el.className=`notification ${e}`}add(){if(!this.closed){if(!a.hidden)return He.off(a,"visibilitychange",this.add),He.add(Je.noticesRoot,this.el),this.el.clientHeight,this.el.style.opacity=1,this.timeout?setTimeout(this.close,this.timeout*b):void 0;He.on(a,"visibilitychange",this.add)}}close(){return this.closed=!0,He.off(a,"visibilitychange",this.add),He.rm(this.el),this.onclose?.()}}var Xe={archives:[{uid:3,name:"4plebs", +domain:"archive.4plebs.org",http:!0,https:!0,software:"foolfuuka",boards:["adv","f","hr","mlpol","mo","o","pol","s4s","sp","tg","trv","tv","x"],files:["adv","f","hr","mlpol","mo","o","pol","s4s","sp","tg","trv","tv","x"],reports:!0},{uid:10,name:"warosu",domain:"warosu.org",http:!1,https:!0,software:"fuuka",boards:["3","biz","cgl","ck","diy","fa","ic","jp","lit","sci","vr","vt"],files:["3","biz","cgl","ck","diy","fa","ic","jp","lit","sci","vr","vt"],search:["biz","cgl","ck","diy","fa","ic","jp","lit","sci","vr","vt"]},{uid:23,name:"Desuarchive",domain:"desuarchive.org",http:!0,https:!0,software:"foolfuuka",boards:["a","aco","an","c","cgl","co","d","fit","g","his","int","k","m","mlp","mu","q","qa","r9k","tg","trash","vr","wsg"],files:["a","aco","an","c","cgl","co","d","fit","g","his","int","k","m","mlp","mu","q","qa","r9k","tg","trash","vr"],reports:!0},{uid:24,name:"fireden.net",domain:"boards.fireden.net",http:!1,https:!0,software:"foolfuuka",boards:["cm","co","ic","sci","vip","y"], +files:["cm","co","ic","sci","vip","y"],search:["cm","co","ic","sci","y"]},{uid:25,name:"arch.b4k.co",domain:"arch.b4k.co",http:!0,https:!0,software:"foolfuuka",boards:["g","mlp","qb","v","vg","vm","vmg","vp","vrpg","vst"],files:["qb","v","vg","vm","vmg","vp","vrpg","vst"],search:["qb","v","vg","vm","vmg","vp","vrpg","vst"]},{uid:29,name:"Archived.Moe",domain:"archived.moe",http:!0,https:!0,software:"foolfuuka",boards:["3","a","aco","adv","an","asp","b","bant","biz","c","can","cgl","ck","cm","co","cock","con","d","diy","e","f","fa","fap","fit","fitlit","g","gd","gif","h","hc","his","hm","hr","i","ic","int","jp","k","lgbt","lit","m","mlp","mlpol","mo","mtv","mu","n","news","o","out","outsoc","p","po","pol","pw","q","qa","qb","qst","r","r9k","s","s4s","sci","soc","sp","spa","t","tg","toy","trash","trv","tv","u","v","vg","vint","vip","vm","vmg","vp","vr","vrpg","vst","vt","w","wg","wsg","wsr","x","xs","y"], +files:["can","cock","con","fap","fitlit","gd","mlpol","mo","mtv","outsoc","po","q","qb","qst","spa","vint","vip"],search:["aco","adv","an","asp","b","bant","biz","c","can","cgl","ck","cm","cock","con","d","diy","e","f","fap","fitlit","gd","gif","h","hc","his","hm","hr","i","ic","lgbt","lit","mlpol","mo","mtv","n","news","o","out","outsoc","p","po","pw","q","qa","qst","r","s","soc","spa","trv","u","vint","vip","vrpg","w","wg","wsg","wsr","x","y"],reports:!0},{uid:30,name:"TheBArchive.com",domain:"thebarchive.com",http:!0,https:!0,software:"foolfuuka",boards:["b","bant"],files:["b","bant"],reports:!0},{uid:31,name:"Archive Of Sins",domain:"archiveofsins.com",http:!0,https:!0,software:"foolfuuka",boards:["h","hc","hm","i","lgbt","r","s","soc","t","u"],files:["h","hc","hm","i","lgbt","r","s","soc","t","u"],reports:!0},{uid:34,name:"TokyoChronos",domain:"www.tokyochronos.net",http:!1,https:!0,software:"foolfuuka",boards:["c","g","jp","mu","vp","vrpg","vt"],files:[],reports:!0},{uid:36, +name:"palanq.win",domain:"archive.palanq.win",http:!1,https:!0,software:"foolfuuka",boards:["bant","c","con","e","i","n","news","out","p","pw","qst","toy","vip","vp","vt","w","wg","wsr"],files:["bant","c","e","i","n","news","out","p","pw","qst","toy","vip","vp","vt","w","wg","wsr"],reports:!0},{uid:37,name:"Eientei",domain:"eientei.xyz",http:!1,https:!0,software:"Eientei",boards:["3","i","sci","xs"],files:["3","i","sci","xs"],reports:!0}],init(){if(this.selectArchives(),t.archiveAutoUpdate){const e=Date.now();if(e-2*w>=t.lastarchivecheck||t.lastarchivecheck>e)return this.update()}},selectArchives(){let e,n,o,a;const i={thread:m(),post:m(),file:m()},r=m();for(o of t.archives){var s,l,d;for(var c of["boards","files"])o[c]instanceof Array||(o[c]=[]);if(({uid:d,name:s,boards:n,files:a,software:l}=o),["fuuka","foolfuuka"].includes(l))for(e of(r[JSON.stringify(d??s)]=o,n))e in i.thread||(i.thread[e]=o),e in i.post||"foolfuuka"!==l||(i.post[e]=o),!(e in i.file)&&a.includes(e)&&(i.file[e]=o)} +for(e in t.selectedArchives){var h=t.selectedArchives[e];for(var u in h){var p,g=h[u];(p=r[JSON.stringify(g)])&&He.hasOwn(i,u)&&(n="file"===u?p.files:p.boards,n.includes(e)&&(i[u][e]=p))}}return Xe.data=i},update(e){let n;const o=[],a=[];let i=0;for(n of t.archiveLists.split("\n"))"#"!==n[0]&&(n=n.trim(),n&&o.push(n));const r=(e,t,n)=>new Ke("warning",`Error ${t} archive data from\n${e}\n${n}`,20),s=t=>function(){if(200!==this.status)return r(o[t],"fetching",this.status?`Error ${this.statusText} (${this.status})`:"Connection Error");let{response:n}=this;return n instanceof Array||(n=[n]),a[t]=n,i++,i===o.length?Xe.parse(a,e):void 0};if(o.length)for(let e=0;e`${Xe.protocol(e)}${e.domain}/${t}/`,search(e,{boardID:t,type:n,value:o}){"capcode"===(n="name"===n?"username":"MD5"===n?"image":n)?o=He.getOwn({Developer:"dev",Verified:"ver"},o)||o.toLowerCase():"image"===n&&(o=o.replace(/[+/=]/g,(e=>({"+":"-","/":"_","=":""}[e])))),o=encodeURIComponent(o);const a="foolfuuka"===e.software?`${t}/search/${n}/${o}/`:"image"===n?`${t}/image/${o}`:`${t}/?task=search2&search_${n}=${o}`;return`${Xe.protocol(e)}${e.domain}/${a}`},report(e){const n=[];for(var o of t.archives){var{software:a,https:i,reports:r,boards:s,name:l,domain:d}=o;"foolfuuka"===a&&i&&r&&s instanceof Array&&s.includes(e)&&n.push([l,`https://${d}/_/api/chan/offsite_report/`])}return n},securityCheck:e=>/^https:\/\//.test(e)||"http:"===location.protocol||t["Exempt Archives from Encryption"],navigate(e,t,n){Xe.data||Xe.init();const o=Xe.to(e,t) +;return o&&(Xe.securityCheck(o)||confirm(`Redirect to ${o}?\n\nYour connection will not be encrypted.`))?location.replace(o):n?location.replace(n):void 0}},_e=Xe;class Ze{toString(){return this.ID}constructor(e){this.nodes={root:e,thumb:He(n.SITE.selectors.catalog.thumb,e)},this.siteID=n.SITE.ID,this.boardID=this.nodes.thumb.parentNode.pathname.split(/\/+/)[1],this.board=n.boards[this.boardID]||new Y(this.boardID),this.ID=this.threadID=+(e.dataset.id||e.id).match(/\d*$/)[0],this.thread=this.board.threads.get(this.ID)||new I(this.ID,this.board)}}const et={init(){if(t.Anonymize)return He.addClass(i,"anonymize")}};var tt={init(){if(["index","thread"].includes(n.VIEW))return t["Image Hover"]&&l.Post.push({name:"Image Hover",cb:this.node}),t["Image Hover in Catalog"]?l.CatalogThread.push({name:"Image Hover",cb:this.catalogNode}):void 0},node(){return this.files.filter((e=>(e.isImage||e.isVideo)&&e.thumb)).map((e=>He.on(e.thumb,"mouseover",tt.mouseover(this,e))))},catalogNode(){ +const e=this.thread.OP.files[0];if(e&&(e.isImage||e.isVideo))return He.on(this.nodes.thumb,"mouseover",tt.mouseover(this.thread.OP,e))},mouseover:(e,o)=>function(a){let r,s,l;if(!i.contains(this))return;const{isVideo:d}=o;if(o.isExpanding||o.isExpanded||n.SITE.isThumbExpanded?.(o))return;const c=tt.error(e,o);if(j.cache?.dataset.fileID===`${e.fullID}.${o.index}`?(r=j.popCache(),He.on(r,"error",c)):(r=He.el(d?"video":"img"),r.dataset.fileID=`${e.fullID}.${o.index}`,He.on(r,"error",c),r.src=o.url),t["Restart when Opened"]&&(j.rewind(r),j.rewind(this)),r.id="ihover",He.add(Je.hover,r),d&&(r.loop=!0,r.controls=!1,$.setup(r),t.Autoplay&&(r.play(),"VIDEO"===this.nodeName&&(this.currentTime=r.currentTime))),o.dimensions){[l,s]=Array.from(o.dimensions.split("x").map((e=>+e)));const e=i.clientWidth,t=i.clientHeight-F.hover.padding,n=Math.min(1,e/l,t/s);l*=n,s*=n,r.style.maxWidth=`${l}px`,r.style.maxHeight=`${s}px`}return F.hover({root:this,el:r,latestEvent:a,endEvents:"mouseout click",height:s, +width:l,noRemove:!0,cb:()=>(He.off(r,"error",c),j.pushCache(r),j.pause(r),He.rm(r),r.removeAttribute("style"))})},error:(e,t)=>function(){if(!j.decodeError(this,t))return j.error(this,e,t,3e3,(e=>e?this.src=e+(this.src===e?"?"+Date.now():""):He.rm(this)))}},nt={init(){if(!["index","thread","archive"].includes(n.VIEW))return;const e=t["Replace JPG"]||t["Replace PNG"]||t["Replace GIF"]||t["Replace WEBM"];if(!t["Image Prefetching"]&&!e)return;if(l.Post.push({name:"Image Replace",cb:this.node}),He.on(a,"PostsInserted",(function(){if(nt.prefetchEnabled||e)return n.posts.forEach(nt.prefetchAll)})),t["Replace WEBM"]&&He.on(a,"scroll visibilitychange 4chanXInitFinished PostsInserted",this.playVideos),!t["Image Prefetching"]||!["index","thread"].includes(n.VIEW))return;const o=He.el("a",{href:"javascript:;",title:"Prefetch Images",innerHTML:"🗲︎"});return He.on(o,"click",this.toggle),Je.addShortcut("prefetch",o,525)},node(){ +if(!this.isClone)for(var e of this.files)t["Replace WEBM"]&&e.isVideo&&nt.replaceVideo(this,e),nt.prefetch(this,e)},replaceVideo(e,t){const{thumb:n}=t,o=He.el("video",{preload:"none",loop:!0,muted:!0,poster:n.src||n.dataset.src,textContent:n.alt,className:n.className});for(var a of(o.setAttribute("muted","muted"),o.dataset.md5=n.dataset.md5,["height","width","maxHeight","maxWidth"]))o.style[a]=n.style[a];return o.src=t.url,He.replace(n,o),t.thumb=o,t.videoThumb=!0},prefetch(e,n){let o,a;const{isImage:i,isVideo:r,thumb:s,url:l}=n;if(n.isPrefetched||!i&&!r||e.isHidden||e.thread.isHidden)return;r?a="WEBM":(a=l.match(/\.([^.]+)$/)?.[1].toUpperCase(),"JPEG"===a&&(a="JPG"));const d=t[`Replace ${a}`]&&!/spoiler/.test(s.src||s.dataset.src);if(!d&&!nt.prefetchEnabled)return;if(He.hasClass(doc,"catalog-mode"))return;if(![e,...Array.from(e.clones)].some((e=>doc.contains(e.nodes.root))))return;if(n.isPrefetched=!0,n.videoThumb){for(o of e.clones)o.file.thumb.preload="auto";return s.preload="auto", +void("gecko"===He.engine&&He.on(s,"loadeddata",(function(){return this.removeAttribute("poster")})))}const c=He.el(i?"img":"video");return r&&(c.preload="auto"),d&&i&&He.on(c,"load",(function(){for(o of e.clones)o.file.thumb.src=l;return s.src=l})),c.src=l},prefetchAll(e){for(var t of e.files)nt.prefetch(e,t)},toggle(){nt.prefetchEnabled=!nt.prefetchEnabled,this.classList.toggle("disabled",!nt.prefetchEnabled),nt.prefetchEnabled&&n.posts.forEach(nt.prefetchAll)},playVideos(){const e=He.id("qp")?.firstElementChild;return n.posts.forEach((function(t){for(t of[t,...Array.from(t.clones)])for(var n of t.files)if(n.videoThumb){var{thumb:o}=n;Je.isNodeVisible(o)||t.nodes.root===e?o.play():o.pause()}}))}},ot={init(){if(t["WEBM Metadata"]&&["index","thread"].includes(n.VIEW))return l.Post.push({name:"WEBM Metadata",cb:this.node})},node(){for(let n=0;n'}),He.add(t.text,[He.tn(" "),e])),1===e.children.length&&He.one(e.lastElementChild,"mouseover focus",ot.load)}},load(){He.rmClass(this.parentNode,"error"),He.addClass(this.parentNode,"loading");const{index:e}=this.parentNode.dataset;return qe.binary(Qe.postFromNode(this).files[+e].url,(e=>{if(He.rmClass(this.parentNode,"loading"),null!=e){const t=ot.parse(e),n=He.el("span",{textContent:t||""});return null==t&&He.addClass(this.parentNode,"not-found"),He.before(this,n),this.parentNode.tabIndex=0,a.activeElement===this&&this.parentNode.focus(),this.tabIndex=-1}return He.addClass(this.parentNode,"error"),He.one(this,"click",ot.load)}),{Range:"bytes=0-9999"})},parse(e){const t=function(){let t=e[n++],o=0;for(;t<128>>o;)o++;for(t^=128>>o;o--&&n0){for(o=o.slice(a);e.startOffset+a>=e.startContainer.data.length;)a--;a&&e.setStart(e.startContainer,e.startOffset+a)}for(a=0;/[)\]}>.,]/.test(t=o.charAt(o.length-(1+a)))&&(/[.,]/.test(t)||o.match(/[()\[\]{}<>]/g).length%2);)a++;if(a){for(o=o.slice(0,-a);e.endOffset-a<0;)a--;a&&e.setEnd(e.endContainer,e.endOffset-a)}/((mailto|magnet):|.+:\/\/)/.test(o)||(o=(/@/.test(o)?"mailto:":"http://")+o),(n=o.match(/^(https?:\/\/[^/]*%[0-9a-f]{2})(.*)$/i))&&(o=n[1].replace(/%([0-9a-f]{2})/gi,(function(e,t){ +return"25"===t?e:String.fromCharCode(parseInt(t,16))}))+n[2]);const i=He.el("a",{className:"linkify",rel:"noreferrer noopener",target:"_blank",href:o});return He.add(i,e.extractContents()),e.insertNode(i),i}};const rt={init(){if("yotsuba"!==n.SITE.software||!["index","thread"].includes(n.VIEW)||!t.Menu||!t["Archive Link"])return;const e={el:He.el("div",{textContent:"Archive"}),order:60,open:({ID:e,thread:t,board:n})=>!!_e.to("thread",{postID:e,threadID:t.ID,boardID:n.ID}),subEntries:[]};for(var o of[["Post","post"],["Name","name"],["Tripcode","tripcode"],["Capcode","capcode"],["Subject","subject"],["Flag","country"],["Filename","filename"],["Image MD5","MD5"]])e.subEntries.push(this.createSubEntry(o[0],o[1]));return V.menu.addEntry(e)},createSubEntry(e,t){const n=He.el("a",{textContent:e,target:"_blank"}),o="post"===t?function({ID:e,thread:t,board:o}){return n.href=_e.to("thread",{postID:e,threadID:t.ID,boardID:o.ID}),!0}:function(e){ +const o="country"===t&&e.info.flagCodeTroll?"troll_country":t,a="country"===t?e.info.flagCode||e.info.flagCodeTroll?.toLowerCase():ze.values(t,e)[0];return!!a&&(n.href=_e.to("search",{boardID:e.board.ID,type:o,value:a,isSearch:!0}),!0)};return{el:n,open:o}}};var st={init(){if(!["index","thread"].includes(n.VIEW)||!t.Menu||!t["Copy Text Link"])return;const e=He.el("a",{className:"copy-text-link",href:"javascript:;",textContent:"Copy Text"});return He.on(e,"click",st.copy),V.menu.addEntry({el:e,order:12,open:e=>(st.text=(e.origin||e).commentOrig(),!0)})},copy(){const e=He.el("textarea",{className:"copy-text-element",value:st.text});He.add(a.body,e),e.select();try{a.execCommand("copy")}catch(e){}return He.rm(e)}},lt={auto:[m(),m()],init(){if(!["index","thread"].includes(n.VIEW)||!t.Menu||!t["Delete Link"])return;const e=He.el("div",{className:"delete-link",textContent:"Delete"}),o=He.el("a",{className:"delete-post",href:"javascript:;"}),a=He.el("a",{className:"delete-file", +href:"javascript:;"});this.nodes={menu:e.firstChild,links:[o,a]};const i={el:o,open:()=>(o.textContent=lt.linkText(!1),He.on(o,"click",lt.toggle),!0)},r={el:a,open:({file:e})=>!(!e||e.isDead)&&(a.textContent=lt.linkText(!0),He.on(a,"click",lt.toggle),!0)};return V.menu.addEntry({el:e,order:40,open:e=>!e.isDead&&(lt.post=e,lt.nodes.menu.textContent=lt.menuText(),lt.cooldown.start(e),!0),subEntries:[i,r]})},menuText(){let e;return(e=lt.cooldown.seconds[lt.post.fullID])?`Delete (${e})`:"Delete"},linkText(e){let t=e?"File":"Post";return lt.auto[+e][lt.post.fullID]&&(t=`Deleting ${t.toLowerCase()}...`),t},toggle(){const{post:e}=lt,t=He.hasClass(this,"delete-file"),n=lt.auto[+t];if(n[e.fullID]?delete n[e.fullID]:n[e.fullID]=!0,this.textContent=lt.linkText(t),!lt.cooldown.seconds[e.fullID])return lt.delete(e,t)},delete(e,t){const o=lt.nodes.links[+t];delete lt.auto[+t][e.fullID],e.fullID===lt.post.fullID&&He.off(o,"click",lt.toggle);const a={mode:"usrdel",onlyimgdel:t, +pwd:Oe.persona.getPassword()};return a[+e.ID]="delete",He.ajax(He.id("delform").action.replace(`/${n.BOARD}/`,`/${e.board}/`),{responseType:"document",withCredentials:!0,onloadend(){return lt.load(o,e,t,this.response)},form:He.formData(a)})},load(e,n,o,a){let i;if(!a)return new Ke("warning","Connection error, please retry.",20),void(n.fullID===lt.post.fullID&&He.on(e,"click",lt.toggle));if(e.textContent=lt.linkText(o),"4chan - Banned"===a.title){const e=He.el("span",{innerHTML:'You can't delete posts because you are banned.'});return new Ke("warning",e,20)}if(i=a.getElementById("errmsg")){if(new Ke("warning",i.textContent,20),n.fullID===lt.post.fullID&&He.on(e,"click",lt.toggle),Oe.cooldown.data&&t.Cooldown&&/\bwait\b/i.test(i.textContent))return lt.cooldown.start(n,5),lt.auto[+o][n.fullID]=!0,lt.nodes.links[+o].textContent=lt.linkText(o)}else if(o||Oe.cooldown.delete(n),"Updating index..."===a.title&&(n.origin||n).kill(o), +n.fullID===lt.post.fullID)return e.textContent="Deleted"},cooldown:{seconds:m(),start(e,t){if(null==lt.cooldown.seconds[e.fullID])return null==t&&(t=Oe.cooldown.secondsDeletion(e)),t>0?(lt.cooldown.seconds[e.fullID]=t,lt.cooldown.count(e)):void 0},count(e){if(e.fullID===lt.post.fullID&&(lt.nodes.menu.textContent=lt.menuText()),lt.cooldown.seconds[e.fullID]>0&&t.Cooldown)lt.cooldown.seconds[e.fullID]--,setTimeout(lt.cooldown.count,1e3,e);else for(var n of(delete lt.cooldown.seconds[e.fullID],[!1,!0]))lt.auto[+n][e.fullID]&<.delete(e,n)}}};const dt={init(){if(!["index","thread"].includes(n.VIEW)||!t.Menu||!t["Download Link"])return;const e=He.el("a",{className:"download-link",textContent:"Download file"});return He.on(e,"click",j.download),V.menu.addEntry({el:e,order:100,open:({file:t})=>!!t&&(e.href=t.url,e.download=t.name,!0)})}};var ct={init(){if(!["index","thread"].includes(n.VIEW)||!t.Menu||!t["Report Link"])return;const e=He.el("a",{className:"report-link",href:"javascript:;", +textContent:"Report"});return He.on(e,"click",ct.report),V.menu.addEntry({el:e,order:10,open:e=>(ct.url=`//sys.${location.hostname.split(".")[1]}.org/${e.board}/imgboard.php?mode=report&no=${e}`,a.cookie.indexOf("pass_enabled=1")>=0?ct.dims="width=350,height=275":ct.dims="width=400,height=550",!0)})},report(){const{url:e,dims:t}=ct,n=Date.now(),o=`toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1,${t}`;return window.open(e,n,o)}},ht={init(){if(t["Disable Autoplaying Sounds"]){for(var e of(He.addClass(i,"anti-autoplay"),u("audio[autoplay]",i)))this.stop(e);return window.addEventListener("loadstart",(e=>this.stop(e.target)),!0),l.Post.push({name:"Disable Autoplaying Sounds",cb:this.node}),He.ready((()=>this.process(d.body)))}},stop(e){if(e.autoplay&&(e.pause(),e.autoplay=!1,!e.controls))return e.controls=!0,He.addClass(e,"controls-added")},node(){return ht.process(this.nodes.comment)},process(e){ +for(var t of u('iframe[src*="youtube"][src*="autoplay=1"]',e))ht.processVideo(t,"src");for(var n of u('object[data*="youtube"][data*="autoplay=1"]',e))ht.processVideo(n,"data")},processVideo:(e,t)=>(e[t]=e[t].replace(/\?autoplay=1&?/,"?").replace("&autoplay=1",""),"none"===window.getComputedStyle(e).display&&(e.style.display="block"),He.addClass(e,"autoplay-removed"))},ut={init(){if(t["Custom Board Titles"]&&(this.db=new y("customTitles",null,!0)),He.asap((()=>a.body),(()=>He.asap((()=>He("hr")),ut.ready))),"f"!==n.BOARD.ID)return Lt.ready((()=>He.queueTask(ut.load)))},ready(){const e=He(".boardBanner"),{children:o}=e;if("thread"===n.VIEW&&t["Remove Thread Excerpt"]&&ut.setTitle(o[1].textContent),o[0].title="Click to change",He.on(o[0],"click",ut.cb.toggle),t["Custom Board Titles"]&&(ut.custom(o[1]),o[2]))return ut.custom(o[2])},load(){const e=He.id("bannerCnt");if(!e.firstChild){const t=He.el("img",{alt:"4chan",src:"//s.4cdn.org/image/title/"+e.dataset.src});return He.add(e,t)}}, +setTitle:e=>null!=Z.title?(Z.title=e,Z.update()):a.title=e,cb:{toggle(){ut.choices?.length||(ut.choices=t.knownBanners.split(",").slice());const e=Math.floor(ut.choices.length*Math.random()),n=ut.choices.splice(e,1);return He("img",this.parentNode).src=`//s.4cdn.org/image/title/${n}`},click(e){if(e.ctrlKey||e.metaKey){for(var t of(null==ut.original[this.className]&&(ut.original[this.className]=this.cloneNode(!0)),this.contentEditable=!0,u("br",this)))He.replace(t,He.tn("\n"));return this.focus()}},keydown(e){if(e.stopPropagation(),!e.shiftKey&&13===e.keyCode)return this.blur()},blur(){for(var e of u("br",this))He.replace(e,He.tn("\n"));return(this.textContent=this.textContent.replace(/\n*$/,""))?(this.contentEditable=!1,ut.db.set({boardID:n.BOARD.ID,threadID:this.className,val:{title:this.textContent,orig:ut.original[this.className].textContent}})):(He.rmAll(this),He.add(this,[...Array.from(ut.original[this.className].cloneNode(!0).childNodes)]),ut.db.delete({boardID:n.BOARD.ID, +threadID:this.className}))}},original:m(),custom(e){let o;const{className:a}=e;for(var i of(e.title=`Ctrl/⌘+click to edit board ${a.slice(5).toLowerCase()}`,e.spellcheck=!1,["click","keydown","blur"]))He.on(e,i,ut.cb[i]);if(o=ut.db.get({boardID:n.BOARD.ID,threadID:a}))return t["Persistent Custom Board Titles"]||o.orig===e.textContent?(ut.original[a]=e.cloneNode(!0),e.textContent=o.title):ut.db.delete({boardID:n.BOARD.ID,threadID:a})}},pt={init(){if("f"===n.BOARD.ID&&t["Enable Native Flash Embedding"])return He.ready(pt.initReady)},initReady:()=>He.hasStorage?He.global((function(){if(JSON.parse(localStorage["4chan-settings"]||"{}").disableAll)return window.SWFEmbed.init()})):("thread"===n.VIEW&&He.global((()=>window.Main.tid=location.pathname.split(/\/+/)[3])),He.global((()=>window.SWFEmbed.init())))},gt={init(){if("yotsuba"===n.SITE.software&&["index","thread","archive"].includes(n.VIEW))return G.ready(this.initBoard),Lt.ready(this.initReady)},initBoard(){ +if(n.BOARD.config.code_tags&&(He.on(window,"prettyprint:cb",(function(e){let t,o;if((t=n.posts.get(e.detail.ID))&&(o=u(".prettyprint",t.nodes.comment)[+e.detail.i]))return He.hasClass(o,"prettyprinted")?void 0:(o.innerHTML=e.detail.html,He.addClass(o,"prettyprinted"))})),He.global((()=>window.addEventListener("prettyprint",(e=>window.dispatchEvent(new CustomEvent("prettyprint:cb",{detail:{ID:e.detail.ID,i:e.detail.i,html:window.prettyPrintOne(e.detail.html)}}))),!1))),l.Post.push({name:"Parse [code] tags",cb:gt.code}),n.posts.forEach((function(e){if(e.callbacksExecuted)return l.Post.execute(e,["Parse [code] tags"],!0)})),K.callbacks.push(gt.code)),n.BOARD.config.math_tags)return He.global((()=>window.addEventListener("mathjax",(function(e){return window.MathJax?window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,e.target]):(document.querySelector('script[src^="//cdn.mathjax.org/"]')||(window.loadMathJax(),window.loadMathJax=function(){}), +e.target.classList.contains("postMessage")?void 0:document.querySelector('script[src^="//cdn.mathjax.org/"]').addEventListener("load",(()=>window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,e.target])),!1))}),!1))),l.Post.push({name:"Parse [math] tags",cb:gt.math}),n.posts.forEach((function(e){if(e.callbacksExecuted)return l.Post.execute(e,["Parse [math] tags"],!0)})),K.callbacks.push(gt.math)},initReady:()=>He.global((function(){for(var e of(window.clickable_ids=!1,document.querySelectorAll(".posteruid, .capcode")))e.removeEventListener("click",window.idClick,!1)})),code(){if(!this.isClone)return He.ready((()=>{const e=u(".prettyprint",this.nodes.comment);for(let n=0;n{ +if(i.contains(this.nodes.comment))return He.off(a,"PostsInserted",n),He.event("mathjax",null,this.nodes.comment)};return He.on(a,"PostsInserted",n),n()}}},ft={init(){if(["index","thread"].includes(n.VIEW)&&t["Color User IDs"])return this.ids=m(),this.ids.Heaven=[0,0,0,"#fff"],l.Post.push({name:"Color User IDs",cb:this.node})},node(){let e,t;if(this.isClone||!(t=this.info.uniqueID)||!(e=this.nodes.uniqueID))return;const n=ft.ids[t]||ft.compute(t),{style:o}=e;return o.color=n[3],o.backgroundColor=`rgb(${n[0]},${n[1]},${n[2]})`,He.addClass(e,"painted")},compute(e){const t=n.SITE.uidColor?n.SITE.uidColor(e):parseInt(e,16),o=[t>>16&255,t>>8&255,255&t];return o.push(He.luma(o)>125?"#000":"#fff"),this.ids[e]=o}},mt={init(){if(["index","thread"].includes(n.VIEW))return l.Post.push({name:"Highlight by User ID",cb:this.node})},uniqueID:null,node(){if(this.nodes.uniqueIDRoot&&He.on(this.nodes.uniqueIDRoot,"click",mt.click(this)), +this.nodes.capcode&&He.on(this.nodes.capcode,"click",mt.click(this)),!this.isClone)return mt.set(this)},set(e){const t=(e.info.uniqueID||e.info.capcode)===mt.uniqueID;return He[t?"addClass":"rmClass"](e.nodes.post,"highlight")},click:e=>function(){const t=e.info.uniqueID||e.info.capcode;return mt.uniqueID=mt.uniqueID===t?null:t,n.posts.forEach(mt.set)}},bt={init(){if("thread"===n.VIEW&&t["Count Posts by ID"])return l.Thread.push({name:"Count Posts by ID",cb(){return bt.thread=this}}),l.Post.push({name:"Count Posts by ID",cb:this.node})},node(){if(this.nodes.uniqueID&&this.thread===bt.thread)return He.on(this.nodes.uniqueID,"mouseover",bt.count)},count(){const{uniqueID:e}=Qe.postFromNode(this).info;let t=0;return bt.thread.posts.forEach((function(n){if(n.info.uniqueID===e)return t++})),this.title=`${t} post${1===t?"":"s"} by this ID`}},At={init(){if("yotsuba"===n.SITE.software&&["index","thread"].includes(n.VIEW))return l.Post.push({name:"Mod Contact Links",cb:this.node})},node(){let e +;if(this.isClone||!He.hasOwn(At.specific,this.info.capcode))return;const t=He.el("span",{className:"contact-links brackets-wrap"});if(He.extend(t,At.template(this.info.capcode)),He.after(this.nodes.capcode,t),(e=this.info.comment.match(/This thread was moved to >>>\/(\w+)\//))&&He.hasOwn(At.moveNote,e[1])){const t=He.el("div",{className:"move-note"});return He.extend(t,At.moveNote[e[1]]),He.add(this.nodes.post,t)}},template:e=>({innerHTML:'feedback'+At.specific[e]().innerHTML}),specific:{Mod:()=>({innerHTML:' IRC'}),Manager:()=>At.specific.Mod(),Developer:()=>({innerHTML:' github'}),Admin:()=>({innerHTML:' twitter'})},moveNote:{qa:{ +innerHTML:'Moving a thread to /qa/ does not imply mods will read it. If you wish to contact mods, use feedback or IRC.'}}};const vt={init(){if(!t["Normalize URL"])return;let e=location.pathname.split(/\/+/);if("yotsuba"===n.SITE.software)switch(n.VIEW){case"thread":e[2]="thread",e=e.slice(0,4);break;case"index":e=e.slice(0,3)}return e=e.join("/"),location.pathname!==e?history.replaceState(history.state,"",`${location.protocol}//${location.host}${e}${location.hash}`):void 0}};var wt={init(){if(t["Unique ID and Capcode Navigation"]&&["index","thread"].includes(n.VIEW))return this.buttons=this.makeButtons(),l.Post.push({name:"Post Jumper",cb:this.node})},node(){ +if(this.isClone)for(var e of u(".postJumper",this.nodes.info))wt.addListeners(e);else if(this.nodes.uniqueIDRoot&&wt.addButtons(this,"uniqueID"),this.nodes.capcode)return wt.addButtons(this,"capcode")},addButtons(e,t){const n=e.info[t],o=wt.buttons.cloneNode(!0);return He.extend(o.dataset,{type:t,value:n}),He.after(e.nodes[t+("capcode"===t?"":"Root")],o),wt.addListeners(o)},addListeners:e=>(He.on(e.firstChild,"click",wt.buttonClick),He.on(e.lastChild,"click",wt.buttonClick)),buttonClick(){let e;const t=He.hasClass(this,"prev")?-1:1;if(e=wt.find(this.parentNode,t))return wt.scroll(this.parentNode,e)},find(e,t){const{type:n,value:o}=e.dataset,a=`span[contains(@class,"postJumper") and @data-value="${o}" and @data-type="${n}"]`,i=t<0?"preceding":"following";let r=e;for(;r=He.x(`${i}::${a}`,r);)if(r.getBoundingClientRect().height)return r;if((r=He.x(`(//${a})[${t<0?"last()":"1"}]`))&&r.getBoundingClientRect().height)return r +;for(;(r=He.x(`${i}::${a}`,r))&&r!==e;)if(r.getBoundingClientRect().height)return r;return null},makeButtons(){const e=He.el("span",{className:"postJumper"});return He.extend(e,{innerHTML:''+o("⏫")+''+o("⏬")+""}),e},scroll(e,t){const n=e.getBoundingClientRect().top,o=t.getBoundingClientRect().top;return window.scrollBy(0,o-n)}};const xt={init(){let e;if("yotsuba"===n.SITE.software&&"qa"===n.BOARD.ID){const t={innerHTML:'Stay in touch with your /qa/ friends!'};e=He.el("div",{className:"fcx-announcement"},t),He.onExists(i,".boardBanner",(t=>He.after(t,e)))}if("samachan.org"in t.siteProperties&&!t.PSAseen.includes("samachan"))return e=He.el("span",{ +innerHTML:'Looking for a new home?
            Some former Samachan users are regrouping on SushiChan.

            (a message from 4chan X)'}),Lt.ready((function(){return new Ke("info",e),t.PSAseen.push("samachan"),He.set("PSAseen",t.PSAseen)}))}};var yt={init(){if(t["Announcement Hiding"]&&n.SITE.selectors.psa)return He.addClass(i,"hide-announcement"),He.onExists(i,n.SITE.selectors.psa,this.setup),He.ready((function(){if(!He(n.SITE.selectors.psa))return He.rmClass(i,"hide-announcement")}))},setup(e){let o,a;yt.psa=e,yt.text=e.dataset.utc??e.innerHTML,n.SITE.selectors.psaTop&&(a=He(n.SITE.selectors.psaTop)?.previousElementSibling)&&"HR"===a.nodeName&&(yt.hr=a),yt.content=He.el("div");const r={el:He.el("a",{textContent:"Show announcement",className:"show-announcement",href:"javascript:;"}),order:50,open:()=>e.hidden};return Je.menu.addEntry(r),He.on(r.el,"click",yt.toggle),yt.btn=o=He.el("a",{ +title:"Mark announcement as read and hide.",className:"hide-announcement-button",href:"javascript:;",textContent:"➖︎"}),He.on(o,"click",yt.toggle),"HR"===e.firstChild?.tagName?He.after(e.firstChild,o):He.prepend(e,o),yt.sync(t.hiddenPSAList),He.rmClass(i,"hide-announcement"),He.sync("hiddenPSAList",yt.sync)},toggle(){const e=He.hasClass(this,"hide-announcement-button"),o=function(t){return e?t[n.SITE.ID]=yt.text:delete t[n.SITE.ID]};return o(t.hiddenPSAList),yt.sync(t.hiddenPSAList),He.get("hiddenPSAList",t.hiddenPSAList,(function({hiddenPSAList:e}){return o(e),He.set("hiddenPSAList",e)}))},sync(e){const{psa:t,content:o}=yt;t.hidden=e[n.SITE.ID]===yt.text,t.hidden?He.add(o,[...Array.from(t.childNodes)]):He.add(t,[...Array.from(o.childNodes)]),yt.hr&&(yt.hr.hidden=t.hidden)}},kt={init(){if(t["Reveal Spoilers"]&&He.addClass(i,"reveal-spoilers"),t["Remove Spoilers"])return l.Post.push({name:"Reveal Spoilers",cb:this.node}), +"archive"===n.VIEW?He.ready((()=>kt.unspoiler(He.id("arc-list")))):void 0},node(){return kt.unspoiler(this.nodes.comment)},unspoiler(e){const t=u(n.SITE.selectors.spoiler,e);for(var o of t){var a=He.el("span",{className:"removed-spoiler"});He.replace(o,a),He.add(a,[...Array.from(o.childNodes)])}}},It={init(){if("index"===n.VIEW&&t["Open Threads in New Tab"])return l.Post.push({name:"Thread Links",cb:this.node}),l.CatalogThread.push({name:"Thread Links",cb:this.catalogNode})},node(){if(!this.isReply&&!this.isClone)return It.process(this.nodes.reply)},catalogNode(){return It.process(this.nodes.thumb.parentNode)},process:e=>e.target="_blank"};const Ct={init(){if("tinyboard"===n.SITE.software)return"thread"===n.VIEW?Lt.ready((()=>He.global((function(){let e,{boardID:t,threadID:n}=document.currentScript.dataset;n=+n;const o=document.querySelector('form[name="post"]');window.$(document).ajaxComplete((function(e,i,r){let s;if(r.url!==o.action)return;if(!(s=+i.responseJSON?.id))return +;const l={boardID:t,threadID:n,postID:s};try{const{redirect:e,noko:t}=i.responseJSON;!e||null==a||a||t||(l.redirect=e)}catch(e){}return e=new CustomEvent("QRPostSuccessful",{bubbles:!0,detail:l}),document.dispatchEvent(e)}));var a=window.tb_settings?.ajax?.always_noko_replies;return((e=window.tb_settings||(window.tb_settings={})).ajax||(e.ajax={})).always_noko_replies=!0}),{boardID:n.BOARD.ID,threadID:n.THREADID}))):void 0}};var Dt={init(){if("yotsuba"===n.SITE.software&&"thread"===n.VIEW&&t["Mark New IPs"])return l.Thread.push({name:"Mark New IPs",cb:this.node})},node(){return Dt.ipCount=this.ipCount,Dt.postCount=this.posts.keys.length,He.on(a,"ThreadUpdate",Dt.onUpdate)},onUpdate(e){let t;const{ipCount:o,postCount:a,newPosts:i,deletedPosts:r}=e.detail;if(null!=o){switch(o-Dt.ipCount){case a-Dt.postCount+r.length:var s=Dt.ipCount;for(t of i)Dt.markNew(n.posts.get(t),++s);break;case-r.length:for(t of i)Dt.markOld(n.posts.get(t))}return Dt.ipCount=o,Dt.postCount=a}},markNew(e,t){ +const n=Math.floor(t/10)%10==1?"th":["st","nd","rd"][t%10-1]||"th",o=He.el("span",{className:"ip-counter",textContent:`(${t})`});return e.nodes.nameBlock.title=`This is the ${t}${n} IP in the thread.`,He.add(e.nodes.nameBlock,[He.tn(" "),o]),He.addClass(e.nodes.root,"new-ip")},markOld:e=>(e.nodes.nameBlock.title="Not the first post from this IP.",He.addClass(e.nodes.root,"old-ip"))},Et={postCount:0,fileCount:0,postIndex:0,init(){let e;if("thread"!==n.VIEW||!t["Thread Stats"])return;t["Page Count in Stats"]&&(this[n.SITE.isPrunedByAge?.(n.BOARD)?"showPurgePos":"showPage"]=!0);const r={innerHTML:'? / ?'+(t["IP Count in Stats"]&&n.SITE.hasIPCount?' / ?':"")+(t["Page Count in Stats"]?' / ?':"")};let s="Posts / Files";return t["IP Count in Stats"]&&n.SITE.hasIPCount&&(s+=" / IPs"),t["Page Count in Stats"]&&(s+=this.showPurgePos?" / Purge Position":" / Page"), +t["Updater and Stats in Header"]?(this.dialog=e=He.el("span",{id:"thread-stats",title:s}),He.extend(e,r),Je.addShortcut("stats",e,200)):(this.dialog=e=F.dialog("thread-stats",{innerHTML:'
            '+r.innerHTML+"
            "}),He.addClass(i,"float"),He.ready((()=>He.add(a.body,e)))),this.postCountEl=He("#post-count",e),this.fileCountEl=He("#file-count",e),this.ipCountEl=He("#ip-count",e),this.pageCountEl=He("#page-count",e),this.pageCountEl&&He.on(this.pageCountEl,"click",Et.fetchPage),l.Thread.push({name:"Thread Stats",cb:this.node})},node(){return Et.thread=this,Et.count(),Et.update(),Et.fetchPage(),He.on(a,"PostsInserted",(()=>He.queueTask(Et.onPostsInserted))),He.on(a,"ThreadUpdate",Et.onUpdate)},count(){const{posts:e}=Et.thread,t=e.keys.length;for(let o=Et.postIndex,a=t;o=n-this.response[0].threads.length),Et.lastPageUpdate=new Date(t.last_modified*b),void Et.retry();o++}}}else if(304===this.status)return Et.retry()},retry(){if(!(!Et.showPage||"1"===Et.pageCountEl.textContent||n.SITE.threadModTimeIgnoresSage||Et.thread.posts.get(Et.thread.lastPost).info.date<=Et.lastPageUpdate))return clearTimeout(Et.timeout),Et.timeout=setTimeout(Et.fetchPage,5e3)}};const St={init(){if("yotsuba"===n.SITE.software&&t["Pass Link"])return Lt.ready(this.ready)},ready(){let e;if(!(e=He.id("styleSelector")))return;const t=He.el("span",{className:"brackets-wrap pass-link-container"}) +;return He.extend(t,{innerHTML:'4chan Pass'}),He.on(t.firstElementChild,"click",(()=>window.open(`//sys.${location.hostname.split(".")[1]}.org/auth`,Date.now(),"width=500,height=280,toolbar=0"))),He.before(e.previousSibling,[t,He.tn("  ")])}};var Tt={init(){if(["index","thread"].includes(n.VIEW)&&t["Quote Inlining"])return t["Comment Expansion"]&&K.callbacks.push(this.node),l.Post.push({name:"Quote Inlining",cb:this.node})},node(){const{process:e}=Tt,{isClone:t}=this;for(var n of this.nodes.quotelinks.concat([...Array.from(this.nodes.backlinks)],this.nodes.archivelinks))e(n,t)},process:(e,n)=>(t["Quote Hash Navigation"]&&(n||He.after(e,Tt.qiQuote(e,He.hasClass(e,"filtered")))),He.on(e,"click",Tt.toggle)),qiQuote(e,t){let n="hashlink";return t&&(n+=" filtered"),He.el("a",{className:n,textContent:"#",href:e.href})},toggle(e){if(He.modifiedClick(e))return;const{boardID:o,threadID:a,postID:r}=Qe.postDataFromLink(this) +;if(t["Inline Cross-thread Quotes Only"]&&"thread"===n.VIEW&&n.posts.get(`${o}.${r}`)?.nodes.root.offsetParent)return;if(He.hasClass(i,"catalog-mode"))return;e.preventDefault();const s=Qe.postFromNode(this),{context:l}=s;if(He.hasClass(this,"inlined"))Tt.rm(this,o,a,r,l);else{if(He.x(`ancestor::div[@data-full-i-d='${o}.${r}']`,this))return;Tt.add(this,o,a,r,l,s)}return this.classList.toggle("inlined")},findRoot:(e,t)=>t?He.x('ancestor::*[parent::*[contains(@class,"post")]][1]',e):He.x("ancestor-or-self::*[parent::blockquote][1]",e),add(e,o,a,i,r,s){let l;const d=He.hasClass(e,"backlink"),c=He.el("div",{className:"inline"});c.dataset.fullID=`${o}.${i}`;const h=Tt.findRoot(e,d);He.after(h,c);const u=He.x('ancestor::*[contains(@class,"postContainer")][1]',h);if(He.addClass(u,"hasInline"),new ae(o,a,i,c,s),(l=n.posts.get(`${o}.${i}`))&&r.thread===l.thread&&(d&&t["Forward Hiding"]&&(He.addClass(l.nodes.root,"forwarded"),l.forwarded++||(l.forwarded=1)),Z.posts))return Z.readSinglePost(l)}, +rm(e,o,a,i,r){let s,l;const d=He.hasClass(e,"backlink");let c=Tt.findRoot(e,d);c=He.x(`following-sibling::div[@data-full-i-d='${o}.${i}'][1]`,c);const h=He.x('ancestor::*[contains(@class,"postContainer")][1]',c),{parentNode:u}=c;if(He.rm(c),He.event("PostsRemoved",null,u),He(".inline",h)||He.rmClass(h,"hasInline"),!(s=c.firstElementChild))return;const p=n.posts.get(`${o}.${i}`);for(p.rmClone(s.dataset.clone),t["Forward Hiding"]&&d&&r.thread===n.threads.get(`${o}.${a}`)&&!--p.forwarded&&(delete p.forwarded,He.rmClass(p.nodes.root,"forwarded"));l=He(".inlined",s);)({boardID:o,threadID:a,postID:i}=Qe.postDataFromLink(l)),Tt.rm(l,o,a,i,r),He.rmClass(l,"inlined")}},Rt={containers:m(),init(){if(["index","thread"].includes(n.VIEW)&&t["Quote Backlinks"])return(this.bottomBacklinks=t["Bottom Backlinks"])&&He.addClass(i,"bottom-backlinks"),l.Post.push({name:"Quote Backlinking Part 1",cb:this.firstNode}),l.Post.push({name:"Quote Backlinking Part 2",cb:this.secondNode})},firstNode(){ +if(this.isClone||!this.quotes.length||this.isRebuilt)return;const e=t["Mark Quotes of You"]&&X.isYou(this),o=He.el("a",{href:n.SITE.Build.postURL(this.board.ID,this.thread.ID,this.ID),className:this.isHidden?"filtered backlink":"backlink",textContent:t.backlink.replace(/%(?:id|%)/g,(e=>({"%id":this.ID,"%%":"%"}[e])))});for(var a of(e&&He.add(o,X.mark.cloneNode(!0)),this.quotes)){var i,r=[Rt.getContainer(a)];if((i=n.posts.get(a))&&i.nodes.backlinkContainer)for(var s of i.clones)r.push(s.nodes.backlinkContainer);for(var l of r){var d=o.cloneNode(!0),c=l.firstChild?[He.tn(" "),d]:[d];if(t["Quote Previewing"]&&He.on(d,"mouseover",ie.mouseover),t["Quote Inlining"]&&(He.on(d,"click",Tt.toggle),t["Quote Hash Navigation"])){var h=Tt.qiQuote(d,He.hasClass(d,"filtered"));c.push(h)}He.add(l,c)}}},secondNode(){if(this.isClone&&(this.origin.isReply||t["OP Backlinks"]))return void(this.nodes.backlinkContainer=He(".container",this.nodes.post));if(!this.isReply&&!t["OP Backlinks"])return +;const e=Rt.getContainer(this.fullID);return this.nodes.backlinkContainer=e,Rt.bottomBacklinks?He.add(this.nodes.post,e):He.add(this.nodes.info,e)},getContainer(e){return this.containers[e]||(this.containers[e]=He.el("span",{className:"container"}))}},Bt={init(){if(["index","thread"].includes(n.VIEW)&&t["Mark Cross-thread Quotes"])return t["Comment Expansion"]&&K.callbacks.push(this.node),this.mark=He.el("span",{textContent:" (Cross-thread)",className:"qmark-ct"}),l.Post.push({name:"Mark Cross-thread Quotes",cb:this.node})},node(){if(this.isClone&&this.thread===this.context.thread)return;const{board:e,thread:t}=this.context;for(var n of this.nodes.quotelinks){var{boardID:o,threadID:a}=Qe.postDataFromLink(n);a&&(this.isClone&&He.rm(He(".qmark-ct",n)),o===e.ID&&a!==t.ID&&He.add(n,Bt.mark.cloneNode(!0)))}}},Pt={init(){if(["index","thread"].includes(n.VIEW)&&t["Mark OP Quotes"])return t["Comment Expansion"]&&K.callbacks.push(this.node),this.mark=He.el("span",{textContent:" (OP)", +className:"qmark-op"}),l.Post.push({name:"Mark OP Quotes",cb:this.node})},node(){let e,t,n;if(this.isClone&&this.thread===this.context.thread)return;if(!(n=this.quotes).length)return;const{quotelinks:o}=this.nodes;if(this.isClone&&n.includes(this.thread.fullID))for(e=0;t=o[e++];)He.rm(He(".qmark-op",t));const{fullID:a}=this.context.thread;if(n.includes(a))for(e=0;t=o[e++];){var{boardID:i,postID:r}=Qe.postDataFromLink(t);`${i}.${r}`===a&&He.add(t,Pt.mark.cloneNode(!0))}}};var Mt={init(){if(["index","thread"].includes(n.VIEW)&&t["Resurrect Quotes"])return He.addClass(i,"resurrect-quotes"),t["Comment Expansion"]&&K.callbacks.push(this.node),l.Post.push({name:"Resurrect Quotes",cb:this.node})},node(){if(this.isClone)this.nodes.archivelinks=u("a.linkify.quotelink",this.nodes.comment);else{for(var e of u("a.linkify",this.nodes.comment))Mt.parseArchivelink.call(this,e);for(var t of u(".deadlink",this.nodes.comment))Mt.parseDeadlink.call(this,t)}},parseArchivelink(e){let t +;if(!(t=e.pathname.match(/^\/([^/]+)\/thread\/S?(\d+)\/?$/)))return;if(["boards.4chan.org","boards.4channel.org"].includes(e.hostname))return;const n=t[1],o=t[2],a=e.hash.match(/^#[pq]?(\d+)$|$/)[1]||o;return _e.to("post",{boardID:n,postID:a})?(He.addClass(e,"quotelink"),He.extend(e.dataset,{boardID:n,threadID:o,postID:a}),this.nodes.archivelinks.push(e)):void 0},parseDeadlink(e){let t,o,a,i;if(He.hasClass(e.parentNode,"prettyprint"))return void Mt.fixDeadlink(e);const r=e.textContent;if(!(i=r.match(/\d+$/)?.[0]))return;if("0"===i[0])return void Mt.fixDeadlink(e);const s=(o=r.match(/^>>>\/([a-z\d]+)/))?o[1]:this.board.ID,l=`${s}.${i}`;if(a=n.posts.get(l))a.isDead?(t=He.el("a",{href:n.SITE.Build.postURL(s,a.thread.ID,i),className:"quotelink deadlink",textContent:r}),He.add(t,U.deadMark.cloneNode(!0)),He.extend(t.dataset,{boardID:s,threadID:a.thread.ID,postID:i})):t=He.el("a",{href:n.SITE.Build.postURL(s,a.thread.ID,i),className:"quotelink",textContent:r});else{const e=_e.to("thread",{ +boardID:s,threadID:0,postID:i}),n=_e.to("post",{boardID:s,postID:i});(e||n)&&(t=He.el("a",{href:e||"javascript:;",className:"deadlink",textContent:r}),He.add(t,U.deadMark.cloneNode(!0)),n&&(He.addClass(t,"quotelink"),He.extend(t.dataset,{boardID:s,postID:i})))}if(this.quotes.includes(l)||this.quotes.push(l),t)return He.replace(e,t),He.hasClass(t,"quotelink")?this.nodes.quotelinks.push(t):void 0;He.add(e,U.deadMark.cloneNode(!0))},fixDeadlink(e){let t;if(!(t=e.previousSibling)||"BR"===t.nodeName){const t=He.el("span",{className:"quote"});He.before(e,t),He.add(t,e)}return He.replace(e,[...Array.from(e.childNodes)])}};const Nt={init(){this.toBlob(),He.global(this.toBlob),Element.prototype.matches||(Element.prototype.matches=Element.prototype.mozMatchesSelector||Element.prototype.webkitMatchesSelector)},toBlob:function(){HTMLCanvasElement.prototype.toBlob||(HTMLCanvasElement.prototype.toBlob=function(e,t,n){ +const o=this.toDataURL(t,n),a=atob(o.slice(o.indexOf(",")+1)),i=a.length,r=new Uint8Array(i);for(let e=0,t=i;e(()=>{try{return e()}catch(e){}})()))};a.addEventListener("mounted",r,!0);var l=function(e,n){ +if(n instanceof Array)t[e]=m.clone(n[0]);else if("object"==typeof n)for(var o in n){var a=n[o];l(o,a)}else t[e]=n};for(var d of(["boards.4chan.org","boards.4channel.org"].includes(location.hostname)&&(He.global((function(){const e=String.fromCharCode;return String.fromCharCode=function(){if(document.body)String.fromCharCode=e;else if(document.currentScript&&!document.currentScript.src)throw Error();return e.apply(this,arguments)}})),He.asap(s,(()=>He.onExists(i,"iframe[srcdoc]",He.rm)))),l(null,c),y.keys))t[d]=m();t.customTitles=m.clone({"4chan.org":{boards:{qa:{boardTitle:{orig:"/qa/ - Question & Answer",title:"/qa/ - 2D/Random"}}}}}),t.boardConfig={boards:m()},t.archives=_e.archives,t.selectedArchives=m(),t.cooldowns=m(),t["Index Sort"]=m();for(let e=0;e<2;e++)t[`Last Long Reply Thresholds ${e}`]=m();t.siteProperties=m(),t["Except Archives from Encryption"]=!1,t["JSON Navigation"]=!0,t["Oekaki Links"]=!0,t["Show Name and Subject"]=!1,t["QR Shortcut"]=!0,t["Bottom QR Link"]=!0, +t["Toggleable Thread Watcher"]=!0,t.siteSoftware="",t["Use Faster Image Host"]="true",t["Captcha Fixes"]=!0,t.captchaServiceDomain="",t.captchaServiceKey=m(),!/\.4chan(?:nel)?\.org$/.test(location.hostname)||Ie.yotsuba.regexp.pass.test(location.href)||Ie.yotsuba.regexp.captcha.test(location.href)||u("script:not([src])",a).filter((e=>/this\[/.test(e.textContent))).length||(He.getSync||He.get)({jsWhitelist:t.jsWhitelist},(({jsWhitelist:e})=>He.addCSP(`script-src ${e.replace(/^#.*$/gm,"").replace(/[\s;]+/g," ").trim()}`)));const h=m();for(o in t)h[o]=void 0;return h.previousversion=void 0,(He.getSync||He.get)(h,(function(e){if(He.perProtocolSettings||!/\.4chan(?:nel)?\.org$/.test(location.hostname)||!(e["Redirect to HTTPS"]??t["Redirect to HTTPS"])||"https:"===location.protocol)return He.asap(s,(function(){for(o in He.cantSet||(null==e.previousversion?(Ft.isFirstRun=!0,Ft.ready((function(){return He.set("previousversion",n.VERSION),Re.open() +}))):e.previousversion!==n.VERSION&&Ft.upgrade(e)),t){var a=t[o];t[o]=e[o]??a}return We.init(Ft.initFeatures)}));location.replace("https://"+location.host+location.pathname+location.search+location.hash)}))},upgrade(t){const{previousversion:o}=t,a=Re.upgrade(t,o);return t.previousversion=a.previousversion=n.VERSION,He.set(a,(function(){if(t["Show Updated Notifications"]??1){const t=He.el("span",{innerHTML:`${e.name} has been updated to version ${n.VERSION}.`});return new Ke("info",t,15)}}))},parseURL(e=n.SITE,t=location){const o={};if(!e)return o;if(o.siteID=e.ID,e.isBoardlessPage?.(t))return o;const a=t.pathname.split(/\/+/);return o.boardID=a[1],e.isFileURL(t)?o.VIEW="file":e.isAuxiliaryPage?.(t)||(["thread","res"].includes(a[2])?(o.VIEW="thread",o.threadID=o.THREADID=+a[3].replace(/\.\w+$/,"")):"archive"===a[2]&&"res"===a[3]?(o.VIEW="thread",o.threadID=o.THREADID=+a[4].replace(/\.\w+$/,""), +o.threadArchived=!0):/^(?:catalog|archive)(?:\.\w+)?$/.test(a[2])?o.VIEW=a[2].replace(/\.\w+$/,""):/^(?:index|\d*)(?:\.\w+)?$/.test(a[2])&&(o.VIEW="index")),o},initFeatures(){if(He.global((function(){return document.documentElement.classList.add("js-enabled"),window.FCX={}})),Ft.jsEnabled=He.hasClass(i,"js-enabled"),He.ajaxPageInit?.(),He.extend(n,Ft.parseURL()),n.boardID&&(n.BOARD=new Y(n.boardID)),n.VIEW){if("file"!==n.VIEW){for(var[e,o]of(n.threads=new k,n.posts=new k,He.onExists(i,"body",Ft.initStyle),Ft.features))if(!n.SITE.disabledFeatures||!n.SITE.disabledFeatures.includes(e))try{o.init()}catch(t){Ft.handleErrors({message:`"${e}" initialization crashed.`,error:t})}return He.ready(Ft.initReady)}He.asap((()=>"loading"!==a.readyState),(function(){let e;if("yotsuba"===n.SITE.software&&t["404 Redirect"]&&n.SITE.is404?.()){const e=location.pathname.split(/\/+/);return _e.navigate("file",{boardID:n.BOARD.ID,filename:e[e.length-1]})} +if((e=He("video"))&&(t["Volume in New Tab"]&&$.setup(e),t["Loop in New Tab"]))return e.loop=!0,e.controls=!1,e.play(),j.addControls(e)}))}else n.SITE.initAuxiliary?.()},initStyle(){if(!Ft.isThisPageLegit())return;const e=He("link[href*=mobile]",a.head);e&&(e.disabled=!0),i.dataset.host=location.host,He.addClass(i,`sw-${n.SITE.software}`),He.addClass(i,"thread"===n.VIEW?"thread-view":n.VIEW),He.onExists(i,".ad-cnt, .adg-rects > .desktop",(e=>He.onExists(e,"img, iframe",(()=>He.addClass(i,"ads-loaded"))))),t["Autohiding Scrollbar"]&&He.addClass(i,"autohiding-scrollbar"),He.ready((function(){if(a.body.clientHeight>i.clientHeight&&window.innerWidth===i.clientWidth!==t["Autohiding Scrollbar"])return t["Autohiding Scrollbar"]=!t["Autohiding Scrollbar"],He.set("Autohiding Scrollbar",t["Autohiding Scrollbar"]),He.toggleClass(i,"autohiding-scrollbar")})),He.addStyle(fe.sub(fe.boards),"fourchanx-css"),Ft.bgColorStyle=He.el("style",{id:"fourchanx-bgcolor-css"});let o=!1 +;return He.on(a,"mousedown",(()=>o=!1)),He.on(a,"keydown",(function(e){if(9===e.keyCode)return o=!0})),window.addEventListener("focus",(()=>i.classList.toggle("keyboard-focus",o)),!0),Ft.setClass()},setClass(){let e,t,o;const r=["yotsuba","yotsuba-b","futaba","burichan","photon","tomorrow","spooky"];if("yotsuba"===n.SITE.software&&"catalog"===n.VIEW&&(e=He.id("base-css"))&&(t=e.href.match(/catalog_(\w+)/)?.[1].replace("_new","").replace(/_+/g,"-"),r.includes(t)))return void He.addClass(i,t);t=e=o=null;const s=function(){if("yotsuba"===n.SITE.software){for(var s of(He.rmClass(i,t),t=null,o))if(s.href===e?.href){t=s.title.toLowerCase().replace("new","").trim().replace(/\s+/g,"-"),"_special"===t&&(t=s.href.match(/[a-z]*(?=[^/]*$)/)[0]),r.includes(t)||(t=null);break}if(t)return He.addClass(i,t),void He.rm(Ft.bgColorStyle)}const l=n.SITE.bgColoredEl();l.style.position="absolute",l.style.visibility="hidden",He.add(a.body,l);let d=window.getComputedStyle(l).backgroundColor;He.rm(l) +;const c=d.match(/[\d.]+/g);if(!/^rgb\(/.test(d)){const e=window.getComputedStyle(a.body);d=`${e.backgroundColor} ${e.backgroundImage} ${e.backgroundRepeat} ${e.backgroundPosition}`}let h=`.dialog, .suboption-list > div:last-of-type, :root.catalog-hover-expand .catalog-container:hover > .post {\n background: ${d};\n}\n.unread-mark-read {\n background-color: rgba(${c.slice(0,3).join(", ")}, ${.5*(c[3]||1)});\n}`;return He.luma(c)<100&&(h+=".watch-thread-link {\n background-image: url(\"data:image/svg+xml,\");\n}"),Ft.bgColorStyle.textContent=h,He.after(He.id("fourchanx-css"),Ft.bgColorStyle)} +;if(He.onExists(a.head,n.SITE.selectors.styleSheet,(function(t){return e=t,"yotsuba"===n.SITE.software&&(o=u('link[rel="alternate stylesheet"]',a.head)),new MutationObserver(s).observe(e,{attributes:!0,attributeFilter:["href"]}),He.on(e,"load",s),s()})),!e){for(var l of u('link[rel="stylesheet"]',a.head))He.on(l,"load",s);return s()}},initReady(){if(!n.SITE.is404?.()){if(n.SITE.isIncomplete?.()){const e=He.el("div",{innerHTML:'The page didn't load completely.
            Some features may not work unless you reload.'});He.on(He("a",e),"click",(()=>location.reload())),new Ke("warning",e)}return"catalog"===n.VIEW?Ft.initCatalog():se.enabled?(Ft.expectInitFinished=!0,He.event("4chanXInitFinished")):n.SITE.awaitBoard?n.SITE.awaitBoard(Ft.initThread):Ft.initThread()}"thread"===n.VIEW&&oe.set404(n.BOARD.ID,n.THREADID,(function(){if(t["404 Redirect"])return _e.navigate("thread",{boardID:n.BOARD.ID,threadID:n.THREADID,postID:+location.hash.match(/\d+/)},`/${n.BOARD}/`) +}))},initThread(){let e;const t=n.SITE.selectors;if(e=He(t.boardFor?.[n.VIEW]||t.board)){const o=[],a=[],i=[];try{n.SITE.preParsingFixes?.(e)}catch(e){}return Ft.addThreadsObserver=new MutationObserver(Ft.addThreads),Ft.addPostsObserver=new MutationObserver(Ft.addPosts),Ft.addThreadsObserver.observe(e,{childList:!0}),Ft.parseThreads(u(t.thread,e),o,a,i),i.length&&Ft.handleErrors(i),"thread"===n.VIEW&&(n.threadArchived&&(o[0].isArchived=!0,o[0].kill()),n.SITE.parseThreadMetadata?.(o[0])),Ft.callbackNodes("Thread",o),Ft.callbackNodesDB("Post",a,(function(){for(var e of a)Se.insert(e);return Ft.expectInitFinished=!0,He.event("4chanXInitFinished")}))}return Ft.expectInitFinished=!0,He.event("4chanXInitFinished")},parseThreads(e,t,o,a){for(var i of e){var r=(()=>{let e;return(e=i.dataset.board)?(e=encodeURIComponent(e),n.boards[e]||new Y(e)):n.BOARD})(),s=+i.id.match(/\d*$/)[0];if(!s||r.threads.get(s)?.nodes.root)return;var l=new I(s,r);l.nodes.root=i,t.push(l) +;var d=u(n.SITE.selectors.postContainer,i);n.SITE.isOPContainerThread&&d.unshift(i),Ft.parsePosts(d,l,o,a),Ft.addPostsObserver.observe(i,{childList:!0})}},parsePosts(e,t,o,a){for(var i of e)if((!i.dataset.fullID||!n.posts.get(i.dataset.fullID))&&He(n.SITE.selectors.comment,i))try{o.push(new U(i,t,t.board))}catch(e){a.push({message:`Parsing of Post No.${i.id.match(/\d+/)} failed. Post will be skipped.`,error:e,html:i.outerHTML})}},addThreads(e){const t=[];for(var o of e)for(var a of o.addedNodes)a.nodeType===Node.ELEMENT_NODE&&a.matches(n.SITE.selectors.thread)&&t.push(a);if(!t.length)return;const i=[],r=[],s=[];return Ft.parseThreads(t,i,r,s),s.length&&Ft.handleErrors(s),Ft.callbackNodes("Thread",i),Ft.callbackNodesDB("Post",r,(()=>He.event("PostsInserted",null,e[0].target)))},addPosts(e){let t;const o=[],a=[],r=[],s=[];for(var l of e){t=Qe.threadFromRoot(l.target);var d=[] +;for(var c of l.addedNodes)c.nodeType===Node.ELEMENT_NODE&&(c.matches(n.SITE.selectors.postContainer)||(c=He(n.SITE.selectors.postContainer,c)))&&d.push(c);var h=r.length;Ft.parsePosts(d,t,r,s),r.length>h&&!o.includes(t)&&o.push(t);var u=!1;for(var p of l.removedNodes)if(Qe.postFromRoot(p)?.nodes.root===p&&!i.contains(p)){u=!0;break}u&&!a.includes(t)&&a.push(t)}return s.length&&Ft.handleErrors(s),Ft.callbackNodesDB("Post",r,(function(){for(t of o)He.event("PostsInserted",null,t.nodes.root);for(t of a)He.event("PostsRemoved",null,t.nodes.root)}))},initCatalog(){let e;const t=n.SITE.selectors.catalog;if(t&&(e=He(t.board))){const n=[],o=[];Ft.addCatalogThreadsObserver=new MutationObserver(Ft.addCatalogThreads),Ft.addCatalogThreadsObserver.observe(e,{childList:!0}),Ft.parseCatalogThreads(u(t.thread,e),n,o),o.length&&Ft.handleErrors(o),Ft.callbackNodes("CatalogThreadNative",n)}return Ft.expectInitFinished=!0,He.event("4chanXInitFinished")},parseCatalogThreads(e,t,n){for(var o of e)try{ +var a=new Ze(o);a.thread.catalogViewNative?.nodes.root!==o&&(a.thread.catalogViewNative=a,t.push(a))}catch(e){n.push({message:`Parsing of Catalog Thread No.${(o.dataset.id||o.id).match(/\d+/)} failed. Thread will be skipped.`,error:e,html:o.outerHTML})}},addCatalogThreads(e){const t=[];for(var o of e)for(var a of o.addedNodes)a.nodeType===Node.ELEMENT_NODE&&a.matches(n.SITE.selectors.catalog.thread)&&t.push(a);if(!t.length)return;const i=[],r=[];return Ft.parseCatalogThreads(t,i,r),r.length&&Ft.handleErrors(r),Ft.callbackNodes("CatalogThreadNative",i)},callbackNodes(e,t){let n,o=0;const a=l[e];for(;n=t[o++];)a.execute(n)},callbackNodesDB(e,t,n){let o=0;const a=l[e],i=function(){let e;return!!(e=t[o])&&(a.execute(e),++o%25)};var r=function(){for(;i(););if(t[o])return setTimeout(r,0);n&&n()};return r()},handleErrors(r){let s;if(a.body&&He.hasClass(a.body,"fourchan_x")&&!He.hasClass(i,"tainted")&&(new Ke("error","Error: Multiple copies of 4chan X are enabled."),He.addClass(i,"tainted")), +n.SITE.testNativeExtension&&!He.hasClass(i,"tainted")){const{enabled:a}=n.SITE.testNativeExtension();if(a&&(He.addClass(i,"tainted"),t["Disable Native Extension"]&&!Ft.isFirstRun)){const t=He.el("div",{innerHTML:'Failed to disable the native extension. You may need to block it.'});new Ke("error",t)}}if(r instanceof Array?1===r.length&&(s=r[0]):s=r,s)return void new Ke("error",Ft.parseError(s,Ft.reportLink([s])),15);const l=He.el("div",{innerHTML:`${r.length} errors occurred.${Ft.reportLink(r).innerHTML} [show]`});He.on(l.lastElementChild,"click",(function(){let e;return[this.textContent,d.hidden]=Array.from(e="show"===this.textContent?["hide",!1]:["show",!0]),e}));var d=He.el("div",{hidden:!0});for(s of r)He.add(d,Ft.parseError(s));return new Ke("error",[l,d],30)},parseError(t,a){r.error(t.message,t.error.stack);const i=He.el("div",{innerHTML:o(t.message)+(a?a.innerHTML:"")}),s=He.el("div",{ +textContent:`${t.error.name||"Error"}: ${t.error.message||"see console for details"}`}),l=t.error.stack?.match(/\d+(?=:\d+\)?$)/gm)?.join().replace(/^/," at ")||"";return[i,s,He.el("div",{textContent:`(${e.name} ${e.fork} v${n.VERSION} ${x} on ${He.engine}${l})`})]},reportLink(t){let o;const a=t[0];let i=a.message;t.length>1&&(i+=` (+${t.length-1} other errors)`);let r="";const s=function(t){if(encodeURIComponent(i+r+t+"\n").length<=e.newIssueMaxLength-e.newIssue.replace(/%(title|details)/,"").length)return r+=t+"\n"};s(`[Please describe the steps needed to reproduce this error.]\n\nScript: ${e.name} ${e.fork} v${n.VERSION} ${x}\nURL: ${location.href}\nUser agent: ${navigator.userAgent}`),"userscript"===x&&(o="undefined"!=typeof GM&&null!==GM?GM.info:"undefined"!=typeof GM_info&&null!==GM_info?GM_info:void 0)&&s(`Userscript manager: ${o.scriptHandler} ${o.version}`),s("\n"+a.error),a.error.stack&&s(a.error.stack.replace(a.error.toString(),"").trim()),a.html&&s("\n`"+a.html+"`"), +r=r.replace(/file:\/{3}.+\//g,"");return{innerHTML:` [report]`}},isThisPageLegit:()=>("thisPageIsLegit"in Ft||(Ft.thisPageIsLegit=n.SITE.isThisPageLegit?n.SITE.isThisPageLegit():!/^[45]\d\d\b/.test(document.title)&&!/\.(?:json|rss)$/.test(location.pathname)),Ft.thisPageIsLegit),ready:e=>He.ready((function(){if(Ft.isThisPageLegit())return e()})),mounted:e=>Ft.isMounted?e():Ft.mountedCBs.push(e),mountedCBs:[], +features:[["Polyfill",Nt],["Board Configuration",G],["Normalize URL",vt],["Delay Redirect on Post",J],["Captcha Configuration",p],["Image Host Rewriting",O],["Redirect",_e],["Header",Je],["Catalog Links",Ge],["Settings",Re],["Index Generator",se],["Disable Autoplay",ht],["Announcement Hiding",yt],["Fourchan thingies",gt],["Tinyboard Glue",Ct],["Color User IDs",ft],["Highlight by User ID",mt],["Count Posts by ID",bt],["Custom CSS",be],["Thread Links",It],["Linkify",it],["Reveal Spoilers",kt],["Resurrect Quotes",Mt],["Filter",ze],["Thread Hiding Buttons",le],["Reply Hiding Buttons",z],["Recursive",Q],["Strike-through Quotes",{init(){if(["index","thread"].includes(n.VIEW)&&(t["Reply Hiding Buttons"]||t.Menu&&t["Reply Hiding Link"]||t.Filter))return l.Post.push({name:"Strike-through Quotes",cb:this.node})},node(){if(!this.isClone)for(var e of this.nodes.quotelinks){var{boardID:t,postID:o}=Qe.postDataFromLink(e);n.posts.get(`${t}.${o}`)?.isHidden&&He.addClass(e,"filtered")}} +}],["Quick Reply Personas",Oe.persona],["Quick Reply",Oe],["Cooldown",Oe.cooldown],["Post Jumper",wt],["Pass Link",St],["Menu",V],["Index Generator (Menu)",se.menu],["Report Link",ct],["Copy Text Link",st],["Thread Hiding (Menu)",le.menu],["Reply Hiding (Menu)",z.menu],["Delete Link",lt],["Filter (Menu)",ze.menu],["Edit Link",Oe.oekaki.menu],["Download Link",dt],["Archive Link",rt],["Quote Inlining",Tt],["Quote Previewing",ie],["Quote Backlinks",Rt],["Mark Quotes of You",X],["Mark OP Quotes",Pt],["Mark Cross-thread Quotes",Bt],["Anonymize",et],["Time Formatting",De],["Relative Post Dates",W],["File Info Formatting",Ce],["Fappe Tyme",Be],["Gallery",Me],["Gallery (menu)",Me.menu],["Sauce",Pe],["Image Expansion",q],["Image Expansion (Menu)",q.menu],["Reveal Spoiler Thumbnails",at],["Image Loading",nt],["Image Hover",tt],["Volume Control",$],["WEBM Metadata",ot],["Comment Expansion",K],["Thread Expansion",ee],["Favicon",h],["Unread",Z],["Unread Line in Index",te],["Quote Threading",Se],["Thread Stats",Et],["Thread Updater",Te],["Thread Watcher",oe],["Thread Watcher (Menu)",oe.menu],["Mark New IPs",Dt],["Index Navigation",L],["Keybinds",Fe],["Banner",ut],["Announcements",xt],["Flash Features",pt],["Reply Pruning",Ee],["Mod Contact Links",At]] +},Lt=Ft;He.ready((()=>Ft.init()))}(); +//# sourceMappingURL=4chan-XT-noupdate.user.min.js.map diff --git a/builds/4chan-XT-noupdate.user.min.js.map b/builds/4chan-XT-noupdate.user.min.js.map new file mode 100644 index 000000000..2bd0c8f60 --- /dev/null +++ b/builds/4chan-XT-noupdate.user.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"4chan-XT-noupdate.user.min.js","sources":["../../../../src/globals/globals.ts","../src/classes/Callbacks.js","../src/config/Config.js","../src/Monitoring/Favicon.js","../src/Monitoring/Favicon/ferongr.unreadDead.png","../src/Monitoring/Favicon/ferongr.unreadDeadY.png","../src/Monitoring/Favicon/ferongr.unreadSFW.png","../src/Monitoring/Favicon/ferongr.unreadSFWY.png","../src/Monitoring/Favicon/ferongr.unreadNSFW.png","../src/Monitoring/Favicon/ferongr.unreadNSFWY.png","../src/Monitoring/Favicon/xat-.unreadDead.png","../src/Monitoring/Favicon/xat-.unreadDeadY.png","../src/Monitoring/Favicon/xat-.unreadSFW.png","../src/Monitoring/Favicon/xat-.unreadSFWY.png","../src/Monitoring/Favicon/xat-.unreadNSFW.png","../src/Monitoring/Favicon/xat-.unreadNSFWY.png","../src/Monitoring/Favicon/Mayhem.unreadDead.png","../src/Monitoring/Favicon/Mayhem.unreadDeadY.png","../src/Monitoring/Favicon/Mayhem.unreadSFW.png","../src/Monitoring/Favicon/Mayhem.unreadSFWY.png","../src/Monitoring/Favicon/Mayhem.unreadNSFW.png","../src/Monitoring/Favicon/Mayhem.unreadNSFWY.png","../src/Monitoring/Favicon/4chanJS.unreadDead.png","../src/Monitoring/Favicon/4chanJS.unreadDeadY.png","../src/Monitoring/Favicon/4chanJS.unreadSFW.png","../src/Monitoring/Favicon/4chanJS.unreadSFWY.png","../src/Monitoring/Favicon/4chanJS.unreadNSFW.png","../src/Monitoring/Favicon/4chanJS.unreadNSFWY.png","../src/Monitoring/Favicon/Original.unreadDead.png","../src/Monitoring/Favicon/Original.unreadDeadY.png","../src/Monitoring/Favicon/Original.unreadSFW.png","../src/Monitoring/Favicon/Original.unreadSFWY.png","../src/Monitoring/Favicon/Original.unreadNSFW.png","../src/Monitoring/Favicon/Original.unreadNSFWY.png","../src/Monitoring/Favicon/Metro.unreadDead.png","../src/Monitoring/Favicon/Metro.unreadDeadY.png","../src/Monitoring/Favicon/Metro.unreadSFW.png","../src/Monitoring/Favicon/Metro.unreadSFWY.png","../src/Monitoring/Favicon/Metro.unreadNSFW.png","../src/Monitoring/Favicon/Metro.unreadNSFWY.png","../src/platform/$$.js","../src/Posting/Captcha.replace.js","../src/Posting/Captcha.t.js","../../../../src/platform/helpers.ts","../src/classes/DataBoard.js","../../../../src/classes/SimpleDict.ts","../src/classes/Thread.js","../src/classes/CatalogThread.js","../src/General/UI.js","../src/Miscellaneous/Nav.js","../src/Images/ImageHost.js","../src/Images/Volume.js","../src/Images/ImageCommon.js","../src/Images/ImageExpand.js","../../../../src/classes/Post.ts","../src/Menu/Menu.js","../src/Filtering/Recursive.js","../src/Filtering/PostHiding.js","../src/Miscellaneous/RelativeDates.js","../src/General/BoardConfig.js","../src/classes/Board.js","../src/Posting/PostRedirect.js","../src/Miscellaneous/ExpandComment.js","../src/Quotelinks/QuoteYou.js","../src/classes/RandomAccessList.js","../src/Monitoring/Unread.js","../src/Miscellaneous/ExpandThread.js","../src/Monitoring/UnreadIndex.js","../src/Monitoring/ThreadWatcher.js","../src/classes/Fetcher.js","../src/Quotelinks/QuotePreview.js","../src/General/Index.js","../src/Filtering/ThreadHiding.js","../../../../src/globals/jsx.ts","../../../../src/General/Settings/SettingsHtml.tsx","../../../../src/css/style.ts","../../../../src/css/CSS.ts","../src/css/linkify.audio.png","../src/css/linkify.bitchute.png","../src/css/linkify.clyp.png","../src/css/linkify.dailymotion.png","../src/css/linkify.gfycat.png","../src/css/linkify.gist.png","../src/css/linkify.image.png","../src/css/linkify.installgentoo.png","../src/css/linkify.liveleak.png","../src/css/linkify.pastebin.png","../src/css/linkify.peertube.png","../src/css/linkify.soundcloud.png","../src/css/linkify.streamable.png","../src/css/linkify.twitchtv.png","../src/css/linkify.twitter.png","../src/css/linkify.video.png","../src/css/linkify.vidlii.png","../src/css/linkify.vimeo.png","../src/css/linkify.vine.png","../src/css/linkify.vocaroo.png","../src/css/linkify.youtube.png","../src/Miscellaneous/CustomCSS.js","../src/site/SW.tinyboard.js","../../../../src/Miscellaneous/PassMessage/PassMessageHtml.tsx","../src/Miscellaneous/PassMessage.js","../src/Miscellaneous/Report.js","../src/Posting/PostSuccessful.js","../../../../src/site/SW.yotsuba.tsx","../../../../src/site/SW.yotsuba.Build/PostInfoHtml.tsx","../../../../src/site/SW.yotsuba.Build/FileHtml.tsx","../../../../src/site/SW.yotsuba.Build/CatalogThreadHtml.tsx","../src/site/SW.js","../../../../src/Miscellaneous/FileInfo.tsx","../src/Miscellaneous/Time.js","../src/Monitoring/ReplyPruning.js","../src/Quotelinks/QuoteThreading.js","../src/Monitoring/ThreadUpdater.js","../../../../src/General/Settings.tsx","../src/Images/FappeTyme.js","../src/Images/Sauce.js","../src/Images/Gallery.js","../src/Linkification/Embedding.js","../src/Miscellaneous/Keybinds.js","../src/Posting/Captcha.js","../src/Posting/QR.js","../src/platform/CrossOrigin.js","../src/platform/$.js","../src/General/Get.js","../../../../src/Filtering/Filter.ts","../src/site/Site.js","../src/Miscellaneous/CatalogLinks.js","../src/General/Header.js","../src/classes/Notice.js","../src/Archive/Redirect.js","../src/classes/CatalogThreadNative.js","../src/Filtering/Anonymize.js","../src/Images/ImageHover.js","../src/Images/ImageLoader.js","../src/Images/Metadata.js","../src/Images/RevealSpoilers.js","../src/Linkification/Linkify.js","../src/Menu/ArchiveLink.js","../src/Menu/CopyTextLink.js","../src/Menu/DeleteLink.js","../src/Menu/DownloadLink.js","../src/Menu/ReportLink.js","../src/Miscellaneous/AntiAutoplay.js","../src/Miscellaneous/Banner.js","../src/Miscellaneous/Flash.js","../src/Miscellaneous/Fourchan.js","../src/Miscellaneous/IDColor.js","../src/Miscellaneous/IDHighlight.js","../src/Miscellaneous/IDPostCount.js","../src/Miscellaneous/ModContact.js","../src/Miscellaneous/NormalizeURL.js","../src/Miscellaneous/PostJumper.js","../src/Miscellaneous/PSA.js","../src/Miscellaneous/PSAHiding.js","../src/Miscellaneous/RemoveSpoilers.js","../src/Miscellaneous/ThreadLinks.js","../src/Miscellaneous/Tinyboard.js","../src/Monitoring/MarkNewIPs.js","../src/Monitoring/ThreadStats.js","../src/Posting/PassLink.js","../src/Quotelinks/QuoteInline.js","../src/Quotelinks/QuoteBacklink.js","../src/Quotelinks/QuoteCT.js","../src/Quotelinks/QuoteOP.js","../src/Quotelinks/Quotify.js","../src/General/Polyfill.js","../src/main/Main.js","../src/Quotelinks/QuoteStrikeThrough.js"],"sourcesContent":[null,"import Main from \"../main/Main\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * DS206: Consider reworking classes to avoid initClass\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nexport default class Callbacks {\r\n static initClass() {\r\n this.Post = new Callbacks('Post');\r\n this.Thread = new Callbacks('Thread');\r\n this.CatalogThread = new Callbacks('Catalog Thread');\r\n this.CatalogThreadNative = new Callbacks('Catalog Thread');\r\n }\r\n\r\n constructor(type) {\r\n this.type = type;\r\n this.keys = [];\r\n }\r\n\r\n push({name, cb}) {\r\n if (!this[name]) { this.keys.push(name); }\r\n return this[name] = cb;\r\n }\r\n\r\n execute(node, keys=this.keys, force=false) {\r\n let errors;\r\n if (node.callbacksExecuted && !force) { return; }\r\n node.callbacksExecuted = true;\r\n for (var name of keys) {\r\n try {\r\n this[name]?.call(node);\r\n } catch (err) {\r\n if (!errors) { errors = []; }\r\n errors.push({\r\n message: ['\"', name, '\" crashed on node ', this.type, ' No.', node.ID, ' (', node.board, ').'].join(''),\r\n error: err,\r\n html: node.nodes?.root?.outerHTML\r\n });\r\n }\r\n }\r\n\r\n if (errors) { return Main.handleErrors(errors); }\r\n }\r\n}\r\nCallbacks.initClass();\r\n","import userCss from './user.css';\r\nimport banners from './banners.json';\r\nimport meta from '../../package.json';\r\n\r\nconst Config = {\r\n main: {\r\n 'Miscellaneous': {\r\n 'Redirect to HTTPS': [\r\n true,\r\n 'Redirect to the HTTPS version of 4chan.'\r\n ],\r\n 'JSON Index': [\r\n true,\r\n 'Replace the original board index with one supporting searching, sorting, infinite scrolling, and a catalog mode.'\r\n ],\r\n [`Use ${meta.name} Catalog`]: [\r\n true,\r\n `Link to ${meta.name}'s catalog instead of the native 4chan one.`,\r\n 1\r\n ],\r\n 'Index Refresh Notifications': [\r\n false,\r\n 'Show a notice at the top of the page when the index is refreshed.',\r\n 1\r\n ],\r\n 'Follow Cursor': [\r\n true,\r\n 'Image Hover and Quote Preview move with the mouse cursor.'\r\n ],\r\n 'Open Threads in New Tab': [\r\n false,\r\n `Make links to threads in the index / ${meta.name} catalog open in a new tab.`\r\n ],\r\n 'External Catalog': [\r\n false,\r\n 'Link to external catalog instead of the internal one.'\r\n ],\r\n 'Catalog Links': [\r\n false,\r\n 'Add toggle link in header menu to turn Navigation links into links to each board\\'s catalog.'\r\n ],\r\n 'Announcement Hiding': [\r\n true,\r\n 'Add button to hide 4chan announcements.'\r\n ],\r\n 'Desktop Notifications': [\r\n true,\r\n `Enables desktop notifications across various ${meta.name} features.`\r\n ],\r\n '404 Redirect': [\r\n true,\r\n 'Redirect dead threads and images to the archives.'\r\n ],\r\n 'Archive Report': [\r\n true,\r\n 'Enable reporting posts to supported archives.'\r\n ],\r\n 'Exempt Archives from Encryption': [\r\n true,\r\n 'Permit loading content from, and warningless redirects to, HTTP-only archives from HTTPS pages.'\r\n ],\r\n 'Keybinds': [\r\n true,\r\n 'Bind actions to keyboard shortcuts.'\r\n ],\r\n 'Time Formatting': [\r\n true,\r\n 'Localize and format timestamps.'\r\n ],\r\n 'Relative Post Dates': [\r\n true,\r\n 'Display dates like \"3 minutes ago\". Tooltip shows the timestamp.'\r\n ],\r\n 'Relative Date Title': [\r\n true,\r\n 'Show Relative Post Date only when hovering over dates.',\r\n 1\r\n ],\r\n 'Comment Expansion': [\r\n true,\r\n 'Expand comments that are too long to display on the index. Not applicable with JSON Index.'\r\n ],\r\n 'File Info Formatting': [\r\n true,\r\n 'Reformat the file information.'\r\n ],\r\n 'Thread Expansion': [\r\n true,\r\n 'Add buttons to expand threads.'\r\n ],\r\n 'Index Navigation': [\r\n false,\r\n 'Add buttons to navigate between threads.'\r\n ],\r\n 'Reply Navigation': [\r\n false,\r\n 'Add buttons to navigate to top / bottom of thread.'\r\n ],\r\n 'Unique ID and Capcode Navigation': [\r\n false,\r\n 'Add buttons to navigate to posts having the same unique ID or capcode.'\r\n ],\r\n 'Custom Board Titles': [\r\n true,\r\n 'Allow editing of the board title and subtitle by ctrl/\\u2318+clicking them.'\r\n ],\r\n 'Persistent Custom Board Titles': [\r\n false,\r\n 'Force custom board titles to be persistent, even if the board titles are updated.',\r\n 1\r\n ],\r\n 'Show Updated Notifications': [\r\n true,\r\n `Show notifications when ${meta.name} is successfully updated.`\r\n ],\r\n 'Color User IDs': [\r\n true,\r\n 'Assign unique colors to user IDs on boards that use them'\r\n ],\r\n 'Count Posts by ID': [\r\n true,\r\n 'Display number of posts in the thread when hovering over an ID.'\r\n ],\r\n 'Remove Spoilers': [\r\n false,\r\n 'Remove all spoilers in text.'\r\n ],\r\n 'Reveal Spoilers': [\r\n false,\r\n 'Indicate spoilers if Remove Spoilers is enabled, or make the text appear hovered if Remove Spoiler is disabled.'\r\n ],\r\n 'Normalize URL': [\r\n true,\r\n 'Rewrite the URL of the current page, removing slugs and excess slashes, and changing /res/ to /thread/.'\r\n ],\r\n 'Work around CORB Bug': [\r\n true,\r\n 'Leave this checked until your garbage browser is fixed.'\r\n ],\r\n 'Disable Autoplaying Sounds': [\r\n false,\r\n 'Prevent sounds on the page from autoplaying.'\r\n ],\r\n 'Disable Native Extension': [\r\n true,\r\n `${meta.name} is NOT designed to work with the native extension.`\r\n ],\r\n 'Enable Native Flash Embedding': [\r\n true,\r\n 'Activate the native extension\\'s Flash embedding if the native extension is disabled.'\r\n ]\r\n },\r\n\r\n 'Linkification': {\r\n 'Linkify': [\r\n true,\r\n 'Convert text into links where applicable.'\r\n ],\r\n 'Link Title': [\r\n true,\r\n 'Replace the link of a supported site with its actual title.',\r\n 1\r\n ],\r\n 'Cover Preview': [\r\n true,\r\n 'Show preview of supported links on hover.',\r\n 1\r\n ],\r\n 'Embedding': [\r\n true,\r\n 'Embed supported services. Note: Some services don\\'t work on HTTPS.',\r\n 1\r\n ],\r\n 'Auto-embed': [\r\n false,\r\n 'Auto-embed Linkify Embeds.',\r\n 2\r\n ],\r\n 'Floating Embeds': [\r\n false,\r\n 'Embed content in a frame that remains in place when the page is scrolled.',\r\n 2\r\n ]\r\n },\r\n\r\n 'Filtering': {\r\n 'Anonymize': [\r\n false,\r\n 'Make everyone Anonymous.'\r\n ],\r\n 'Filter': [\r\n true,\r\n 'Self-moderation placebo.'\r\n ],\r\n 'Filtered Backlinks': [\r\n false,\r\n 'When enabled, shows backlinks to filtered posts with a line-through decoration. Otherwise, hides the backlinks.',\r\n 1\r\n ],\r\n 'Filter in Native Catalog': [\r\n true,\r\n 'Apply 4chan X filters in native catalog.',\r\n 1\r\n ],\r\n 'MD5 Quick Filter Notifications': [\r\n true,\r\n 'Show notification when quick filtering MD5s using the button or keybind.',\r\n 1\r\n ],\r\n 'Recursive Hiding': [\r\n true,\r\n 'Hide replies of hidden posts, recursively.'\r\n ],\r\n 'Thread Hiding Buttons': [\r\n true,\r\n 'Add buttons to hide entire threads.'\r\n ],\r\n 'Reply Hiding Buttons': [\r\n true,\r\n 'Add buttons to hide single replies.'\r\n ],\r\n 'Stubs': [\r\n true,\r\n 'Show stubs of hidden threads / replies.'\r\n ]\r\n },\r\n\r\n 'Images and Videos': {\r\n 'Image Expansion': [\r\n true,\r\n 'Expand images / videos.'\r\n ],\r\n 'Image Hover': [\r\n true,\r\n 'Show full image / video on mouseover.'\r\n ],\r\n 'Image Hover in Catalog': [\r\n true,\r\n `Show full image / video on mouseover in ${meta.name} catalog.`\r\n ],\r\n 'Gallery': [\r\n true,\r\n 'Adds a simple and cute image gallery. Has more options in the gallery menu.'\r\n ],\r\n 'Fullscreen Gallery': [\r\n false,\r\n 'Open gallery in fullscreen mode.',\r\n 1\r\n ],\r\n 'PDF in Gallery': [\r\n false,\r\n 'Show PDF files in gallery.',\r\n 1\r\n ],\r\n 'Sauce': [\r\n true,\r\n 'Add sauce links to images.'\r\n ],\r\n 'WEBM Metadata': [\r\n true,\r\n 'Add link to fetch title metadata from webm videos.'\r\n ],\r\n 'Reveal Spoiler Thumbnails': [\r\n false,\r\n 'Replace spoiler thumbnails with the original image.'\r\n ],\r\n 'Replace GIF': [\r\n false,\r\n 'Replace gif thumbnails with the actual image.'\r\n ],\r\n 'Replace JPG': [\r\n false,\r\n 'Replace jpg thumbnails with the actual image.'\r\n ],\r\n 'Replace PNG': [\r\n false,\r\n 'Replace png thumbnails with the actual image.'\r\n ],\r\n 'Replace WEBM': [\r\n false,\r\n 'Replace webm, mp4, and ogv thumbnails with the actual video. Probably will degrade browser performance ;)'\r\n ],\r\n 'Image Prefetching': [\r\n true,\r\n 'Add a shortcut icon to the header to turn on image preloading.'\r\n ],\r\n 'Fappe Tyme': [\r\n true,\r\n 'Hide posts without images when header menu item is checked. *hint* *hint*'\r\n ],\r\n 'Werk Tyme': [\r\n true,\r\n 'Hide all post images when header menu item is checked.'\r\n ],\r\n 'Autoplay': [\r\n true,\r\n 'Videos begin playing immediately when opened.'\r\n ],\r\n 'Restart when Opened': [\r\n false,\r\n 'Restart GIFs and WebMs when you hover over or expand them.'\r\n ],\r\n 'Show Controls': [\r\n true,\r\n 'Show controls on videos expanded inline.'\r\n ],\r\n 'Click Passthrough': [\r\n false,\r\n 'Clicks on videos trigger your browser\\'s default behavior. Videos can be contracted with button / dragging to the left.',\r\n 1\r\n ],\r\n 'Allow Sound': [\r\n true,\r\n 'Open videos with the sound unmuted.'\r\n ],\r\n 'Mouse Wheel Volume': [\r\n true,\r\n 'Adjust volume of videos with the mouse wheel over the thumbnail/filename/gallery.'\r\n ],\r\n 'Loop in New Tab': [\r\n true,\r\n 'Loop videos opened in their own tabs.'\r\n ],\r\n 'Volume in New Tab': [\r\n true,\r\n `Apply ${meta.name} mute and volume settings to videos opened in their own tabs.`\r\n ]\r\n },\r\n\r\n 'Menu': {\r\n 'Menu': [\r\n true,\r\n 'Add a drop-down menu to posts.'\r\n ],\r\n 'Report Link': [\r\n true,\r\n 'Add a report link to the menu.',\r\n 1\r\n ],\r\n 'Copy Text Link': [\r\n true,\r\n 'Add a link to copy the post\\'s text.',\r\n 1\r\n ],\r\n 'Thread Hiding Link': [\r\n true,\r\n 'Add a link to hide entire threads.',\r\n 1\r\n ],\r\n 'Reply Hiding Link': [\r\n true,\r\n 'Add a link to hide single replies.',\r\n 1\r\n ],\r\n 'Delete Link': [\r\n true,\r\n 'Add post and image deletion links to the menu.',\r\n 1\r\n ],\r\n 'Archive Link': [\r\n true,\r\n 'Add an archive link to the menu.',\r\n 1\r\n ],\r\n 'Edit Link': [\r\n true,\r\n 'Add a link to edit the image in Tegaki, /i/\\'s painting program. Requires Quick Reply.',\r\n 1\r\n ],\r\n 'Download Link': [\r\n false,\r\n 'Add a download with original filename link to the menu.',\r\n 1\r\n ]\r\n },\r\n\r\n 'Monitoring': {\r\n 'Thread Updater': [\r\n true,\r\n 'Fetch and insert new replies. Has more options in the header menu and the \"Advanced\" tab.'\r\n ],\r\n 'Unread Count': [\r\n true,\r\n 'Show the unread posts count in the tab title.'\r\n ],\r\n 'Quoted Title': [\r\n false,\r\n 'Change the page title to reflect you\\'ve been quoted.',\r\n 1\r\n ],\r\n 'Hide Unread Count at (0)': [\r\n false,\r\n 'Hide the unread posts count in the tab title when it reaches 0.',\r\n 1\r\n ],\r\n 'Unread Favicon': [\r\n true,\r\n 'Show a different favicon when there are unread posts.'\r\n ],\r\n 'Unread Line': [\r\n true,\r\n 'Show a line to distinguish read posts from unread ones.'\r\n ],\r\n 'Remember Last Read Post': [\r\n true,\r\n 'Remember how far you\\'ve read after you close the thread.'\r\n ],\r\n 'Scroll to Last Read Post': [\r\n true,\r\n 'Scroll back to the last read post when reopening a thread.',\r\n 1\r\n ],\r\n 'Unread Line in Index': [\r\n false,\r\n 'Show a line between read and unread posts in threads in the index.',\r\n 1\r\n ],\r\n 'Remove Thread Excerpt': [\r\n false,\r\n 'Replace the excerpt of the thread in the tab title with the board title.'\r\n ],\r\n 'Thread Stats': [\r\n true,\r\n 'Display reply and image count.'\r\n ],\r\n 'IP Count in Stats': [\r\n true,\r\n 'Display the unique IP count in the thread stats.',\r\n 1\r\n ],\r\n 'Page Count in Stats': [\r\n true,\r\n 'Display the page count in the thread stats.',\r\n 1\r\n ],\r\n 'Updater and Stats in Header': [\r\n true,\r\n 'Places the thread updater and thread stats in the header instead of floating them.'\r\n ],\r\n 'Thread Watcher': [\r\n true,\r\n 'Bookmark threads. Has more options in the thread watcher menu.'\r\n ],\r\n 'Fixed Thread Watcher': [\r\n true,\r\n 'Makes the thread watcher scroll with the page.',\r\n 1\r\n ],\r\n 'Persistent Thread Watcher': [\r\n false,\r\n 'The thread watcher will be visible when the page is loaded.',\r\n 1\r\n ],\r\n 'Mark New IPs': [\r\n false,\r\n 'Label each post from a new IP with the thread\\'s current IP count.'\r\n ],\r\n 'Reply Pruning': [\r\n true,\r\n 'Add option in header menu to hide old replies in long threads. Activated by default in stickies.'\r\n ],\r\n 'Prune All Threads': [\r\n false,\r\n 'Activate Reply Pruning by default in all threads.',\r\n 1\r\n ]\r\n },\r\n\r\n 'Posting and Captchas': {\r\n 'Quick Reply': [\r\n true,\r\n 'All-in-one form to reply, create threads, automate dumping and more.'\r\n ],\r\n 'Persistent QR': [\r\n false,\r\n 'The Quick reply won\\'t disappear after posting.',\r\n 1\r\n ],\r\n 'Auto Hide QR': [\r\n true,\r\n 'Automatically hide the quick reply when posting.',\r\n 2\r\n ],\r\n 'Open Post in New Tab': [\r\n true,\r\n 'Open new threads in a new tab, and open replies in a new tab if you\\'re not already in the thread.',\r\n 1\r\n ],\r\n 'Remember QR Size': [\r\n false,\r\n 'Remember the size of the Quick reply.',\r\n 1\r\n ],\r\n 'Remember Spoiler': [\r\n false,\r\n 'Remember the spoiler state, instead of resetting after posting.',\r\n 1\r\n ],\r\n 'Randomize Filename': [\r\n false,\r\n 'Set the filename to a random timestamp within the past year. Disabled on /f/.',\r\n 1\r\n ],\r\n 'Show New Thread Option in Threads': [\r\n true,\r\n 'Show the option to post a new / different thread from inside a thread.',\r\n 1\r\n ],\r\n 'Show Upload Progress': [\r\n true,\r\n 'Track progress of file uploads as percentage in submit button.',\r\n 1\r\n ],\r\n 'Cooldown': [\r\n true,\r\n 'Indicate the remaining time before posting again.',\r\n 1\r\n ],\r\n 'Posting Success Notifications': [\r\n true,\r\n 'Show notifications on successful post creation or file uploading.',\r\n 1\r\n ],\r\n 'Auto-load captcha': [\r\n false,\r\n 'Automatically load the captcha in the QR even if your post is empty.',\r\n 1\r\n ],\r\n 'Post on Captcha Completion': [\r\n false,\r\n 'Submit the post immediately when the captcha is completed.',\r\n 1\r\n ],\r\n 'Force Noscript Captcha': [\r\n false,\r\n 'Use the non-Javascript fallback captcha even if Javascript is enabled.'\r\n ],\r\n 'Pass Link': [\r\n false,\r\n 'Add a 4chan Pass login link to the bottom of the page.'\r\n ]\r\n },\r\n\r\n 'Quote Links': {\r\n 'Quote Backlinks': [\r\n true,\r\n 'Add quote backlinks.'\r\n ],\r\n 'OP Backlinks': [\r\n true,\r\n 'Add backlinks to the OP.',\r\n 1\r\n ],\r\n 'Bottom Backlinks': [\r\n false,\r\n 'Place backlinks at the bottom of posts.',\r\n 1\r\n ],\r\n 'Quote Inlining': [\r\n true,\r\n 'Inline quoted post on click.'\r\n ],\r\n 'Inline Cross-thread Quotes Only': [\r\n false,\r\n 'Don\\'t inline quote links when the posts are visible in the thread.',\r\n 1\r\n ],\r\n 'Quote Hash Navigation': [\r\n false,\r\n 'Include an extra link after quotes for autoscrolling to quoted posts.',\r\n 1\r\n ],\r\n 'Forward Hiding': [\r\n true,\r\n 'Hide original posts of inlined backlinks.',\r\n 1\r\n ],\r\n 'Quote Previewing': [\r\n true,\r\n 'Show quoted post on hover.'\r\n ],\r\n 'Quote Highlighting': [\r\n true,\r\n 'Highlight the previewed post.',\r\n 1\r\n ],\r\n 'Resurrect Quotes': [\r\n true,\r\n 'Link dead quotes to the archives, and support inlining/previewing of archive links like quote links.'\r\n ],\r\n 'Remember Your Posts': [\r\n true,\r\n 'Remember your posting history.'\r\n ],\r\n 'Mark Quotes of You': [\r\n true,\r\n 'Add \\'(You)\\' to quotes linking to your posts.',\r\n 1\r\n ],\r\n 'Highlight Posts Quoting You': [\r\n true,\r\n 'Highlights any posts that contain a quote to your post.',\r\n 1\r\n ],\r\n 'Highlight Own Posts': [\r\n true,\r\n 'Highlights own posts.',\r\n 1\r\n ],\r\n 'Mark OP Quotes': [\r\n true,\r\n 'Add \\'(OP)\\' to OP quotes.'\r\n ],\r\n 'Mark Cross-thread Quotes': [\r\n true,\r\n 'Add \\'(Cross-thread)\\' to cross-threads quotes.'\r\n ],\r\n 'Quote Threading': [\r\n true,\r\n 'Add option in header menu to thread conversations.'\r\n ]\r\n }\r\n },\r\n\r\n imageExpansion: {\r\n 'Fit width': [\r\n true,\r\n ''\r\n ],\r\n 'Fit height': [\r\n false,\r\n ''\r\n ],\r\n 'Scroll into view': [\r\n true,\r\n 'Scroll down when expanding images to bring the full image into view.'\r\n ],\r\n 'Expand spoilers': [\r\n true,\r\n 'Expand all images along with spoilers.'\r\n ],\r\n 'Expand videos': [\r\n true,\r\n 'Expand all images also expands videos.'\r\n ],\r\n 'Expand from here': [\r\n false,\r\n 'Expand all images only from current position to thread end.'\r\n ],\r\n 'Expand thread only': [\r\n false,\r\n 'In index, expand all images only within the current thread.'\r\n ],\r\n 'Advance on contract': [\r\n false,\r\n 'Advance to next post when contracting an expanded image.'\r\n ]\r\n },\r\n\r\n gallery: {\r\n 'Hide Thumbnails': [\r\n false\r\n ],\r\n 'Fit Width': [ // 'Fit width' (lowercase W) belongs to Image Expansion. Engine limitations, heh.\r\n true\r\n ],\r\n 'Fit Height': [\r\n true\r\n ],\r\n 'Stretch to Fit': [\r\n false\r\n ],\r\n 'Scroll to Post': [\r\n true\r\n ],\r\n 'Slide Delay': [\r\n 6.0\r\n ]\r\n },\r\n\r\n 'Default Volume': 1.0,\r\n\r\n threadWatcher: {\r\n 'Current Board': [\r\n false,\r\n 'Only show watched threads from the current board.'\r\n ],\r\n 'Auto Update Thread Watcher': [\r\n true,\r\n 'Periodically check status of watched threads.'\r\n ],\r\n 'Auto Watch': [\r\n true,\r\n 'Automatically watch threads you start.'\r\n ],\r\n 'Auto Watch Reply': [\r\n true,\r\n 'Automatically watch threads you reply to.'\r\n ],\r\n 'Auto Prune': [\r\n false,\r\n 'Automatically remove dead threads.'\r\n ],\r\n 'Show Page': [\r\n true,\r\n 'Show what page watched threads are on.'\r\n ],\r\n 'Show Unread Count': [\r\n true,\r\n 'Show number of unread posts in watched threads.'\r\n ],\r\n 'Show Site Prefix': [\r\n true,\r\n 'When multiple sites are shown in the thread watcher, add a prefix to board names to distinguish them.'\r\n ],\r\n 'Require OP Quote Link': [\r\n false,\r\n 'For purposes of thread watcher highlighting, only consider posts with a quote link to the OP as replies to the OP.'\r\n ]\r\n },\r\n\r\n filter: {\r\n general: '',\r\n\r\n postID: `\\\r\n# Highlight dubs on [s4s]:\r\n#/(\\\\d)\\\\1$/;highlight;top:no;boards:s4s\\\r\n`,\r\n\r\n name: `\\\r\n# Filter any namefags:\r\n#/^(?!Anonymous$)/\\\r\n`,\r\n\r\n uniqueID: `\\\r\n# Filter a specific ID:\r\n#/Txhvk1Tl/\\\r\n`,\r\n\r\n tripcode: `\\\r\n# Filter any tripfag\r\n#/^!/\\\r\n`,\r\n\r\n capcode: `\\\r\n# Set a custom class for mods:\r\n#/Mod$/;highlight:mod;op:yes\r\n# Set a custom class for admins:\r\n#/Admin$/;highlight:admin;op:yes\\\r\n`,\r\n\r\n pass: `\\\r\n# Filter anyone using since4pass:\r\n#/./\\\r\n`,\r\n\r\n email: '',\r\n\r\n subject: `\\\r\n# Filter Generals on /v/:\r\n#/general/i;boards:v;op:only\\\r\n`,\r\n\r\n comment: `\\\r\n# Filter Stallman copypasta on /g/:\r\n#/what you\\'re refer+ing to as linux/i;boards:g\r\n# Filter posts with 20 or more quote links:\r\n#/(?:>>\\\\d(?:(?!>>\\\\d)[^])*){20}/\r\n# Filter posts like T H I S / H / I / S:\r\n#/^>?\\\\s?\\\\w\\\\s?(\\\\w)\\\\s?(\\\\w)\\\\s?(\\\\w).*$[\\\\s>]+\\\\1[\\\\s>]+\\\\2[\\\\s>]+\\\\3/im\\\r\n`,\r\n\r\n flag: '',\r\n filename: '',\r\n dimensions: `\\\r\n# Highlight potential wallpapers:\r\n#/1920x1080/;op:yes;highlight;top:no;boards:w,wg\\\r\n`,\r\n\r\n filesize: '',\r\n\r\n MD5: ''\r\n },\r\n\r\n sauces: `\\\r\n# Known filename formats:\r\nhttps://www.pixiv.net/member_illust.php?mode=medium&illust_id=%$1;regexp:/^(\\\\d+)_p\\\\d+/\r\njavascript:void(open(\"https://www.deviantart.com/\"+%$1.replace(/_/g,\"-\")+\"/art/\"+parseInt(%$2,36)));regexp:/^\\\\w+_by_(\\\\w+)[_-]d([\\\\da-z]{6})\\\\b/\r\nhttps://imgur.com/%$1;regexp:/^(?![a-zA-Z][a-z]{6})(?![A-Z]{7})(?!\\\\d{7})([\\\\da-zA-Z]{7})(?: \\\\(\\\\d+\\\\))?\\\\.\\\\w+$/\r\nhttps://flickr.com/photo.gne?id=%$1;regexp:/^(\\\\d+)_[\\\\da-f]{10}(?:_\\\\w)*\\\\b/\r\nhttps://www.facebook.com/photo.php?fbid=%$1;regexp:/^\\\\d+_(\\\\d+)_\\\\d+_[no]\\\\b/\r\n\r\n# Reverse image search:\r\nhttps://www.google.com/searchbyimage?sbisrc=4chanx&image_url=%IMG&safe=off\r\nhttps://yandex.com/images/search?rpt=imageview&url=%IMG\r\n#//tineye.com/search?url=%IMG\r\n#//www.bing.com/images/search?q=imgurl:%IMG&view=detailv2&iss=sbi#enterInsights\r\n#https://lens.google.com/uploadbyurl?url=%IMG;text:lens\r\n\r\n# Specialized reverse image search:\r\n//iqdb.org/?url=%IMG\r\nhttps://trace.moe/?auto&url=%IMG;text:wait\r\n#//3d.iqdb.org/?url=%IMG\r\n#//saucenao.com/search.php?url=%IMG\r\n\r\n# \"View Same\" in archives:\r\nhttp://eye.swfchan.com/search/?q=%name;types:swf\r\n#https://desuarchive.org/_/search/image/%sMD5/\r\n#https://archive.4plebs.org/_/search/image/%sMD5/\r\n#https://boards.fireden.net/_/search/image/%sMD5/\r\n#https://foolz.fireden.net/_/search/image/%sMD5/\r\n\r\n# Other tools:\r\n#http://exif.regex.info/exif.cgi?imgurl=%URL\r\n#//imgops.com/start?url=%URL;types:gif,jpg,png\r\n#//www.gif-explode.com/%URL;types:gif\\\r\n`,\r\n\r\n FappeT: {\r\n werk: false\r\n },\r\n\r\n 'Custom CSS': true,\r\n\r\n Index: {\r\n 'Index Mode': 'paged',\r\n 'Previous Index Mode': 'paged',\r\n 'Index Size': 'small',\r\n 'Show Replies': [true, 'Show replies in the index, and also in the catalog if \"Catalog hover expand\" is checked.'],\r\n 'Catalog Hover Expand': [false, 'Expand the comment and show more details when you hover over a thread in the catalog.'],\r\n 'Catalog Hover Toggle': [true, 'Turn \"Catalog hover expand\" on and off by clicking in the catalog.'],\r\n 'Pin Watched Threads': [false, 'Move watched threads to the start of the index.'],\r\n 'Anchor Hidden Threads': [true, 'Move hidden threads to the end of the index.'],\r\n 'Refreshed Navigation': [false, 'Refresh index when navigating through pages.']\r\n },\r\n\r\n Header: {\r\n 'Fixed Header': true,\r\n 'Header auto-hide': false,\r\n 'Header auto-hide on scroll': false,\r\n 'Bottom Header': false,\r\n 'Centered links': false,\r\n 'Header catalog links': false,\r\n 'Bottom Board List': true,\r\n 'Shortcut Icons': true,\r\n 'Custom Board Navigation': true\r\n },\r\n\r\n archives: {\r\n archiveLists: 'https://4chenz.github.io/archives.json/archives.json',\r\n lastarchivecheck: 0,\r\n archiveAutoUpdate: true\r\n },\r\n\r\n externalCatalogURLs: `\\\r\n//catalog.neet.tv/%board/;boards:4chan.org:3,a,adv,an,asp,biz,c,cgl,ck,cm,co,diy,f,fa,fit,g,gd,his,i,int,jp,k,lgbt,lit,m,mlp,mu,n,news,o,out,p,po,pol,s4s,sci,sp,tg,toy,trv,tv,v,vg,vip,vp,vr,w,wg,wsg,wsr,x\\\r\n`,\r\n\r\n boardnav: `\\\r\n[ toggle-all ]\r\n[current-index-text:\"Index\"\r\ncurrent-catalog-text:\"Catalog\"\r\ncurrent-expired-text:\"Expired\"\r\ncurrent-archive-text:\"Archive\"]\r\n[external-text:\"FAQ\",\"${meta.name}\"]\\\r\n`,\r\n\r\n QR: {\r\n 'QR.personas': `\\\r\n#options:\"sage\";boards:jp;always\\\r\n`,\r\n sjisPreview: false\r\n },\r\n\r\n jsWhitelist: `\\\r\nhttp://s.4cdn.org\r\nhttps://s.4cdn.org\r\nhttp://www.google.com\r\nhttps://www.google.com\r\nhttps://www.gstatic.com\r\nhttp://cdn.mathjax.org\r\nhttps://cdn.mathjax.org\r\nhttps://cdnjs.cloudflare.com\r\nhttps://hcaptcha.com\r\nhttps://*.hcaptcha.com\r\n'self'\r\n'unsafe-inline'\r\n'unsafe-eval'\\\r\n`,\r\n\r\n captchaLanguage: '',\r\n\r\n time: '%m/%d/%y(%a)%H:%M:%S',\r\n timeLocale: '',\r\n\r\n backlink: '>>%id',\r\n\r\n pastedname: 'file',\r\n\r\n fileInfo: '%l %d (%p%s, %r%g)',\r\n\r\n favicon: 'ferongr',\r\n\r\n usercss: userCss,\r\n\r\n hotkeys: {\r\n // QR & Options\r\n 'Toggle board list': [\r\n 'Ctrl+b',\r\n 'Toggle the full board list.'\r\n ],\r\n 'Toggle header': [\r\n 'Shift+h',\r\n 'Toggle the auto-hide option of the header.'\r\n ],\r\n 'Open empty QR': [\r\n 'q',\r\n 'Open QR without post number inserted.'\r\n ],\r\n 'Open QR': [\r\n 'Shift+q',\r\n 'Open QR with post number inserted.'\r\n ],\r\n 'Open settings': [\r\n 'Alt+o',\r\n 'Open Settings.'\r\n ],\r\n 'Close': [\r\n 'Esc',\r\n 'Close dialogs or notifications.'\r\n ],\r\n 'Spoiler tags': [\r\n 'Ctrl+s',\r\n 'Insert spoiler tags.'\r\n ],\r\n 'Code tags': [\r\n 'Alt+c',\r\n 'Insert code tags.'\r\n ],\r\n 'Eqn tags': [\r\n 'Alt+e',\r\n 'Insert eqn tags.'\r\n ],\r\n 'Math tags': [\r\n 'Alt+m',\r\n 'Insert math tags.'\r\n ],\r\n 'SJIS tags': [\r\n 'Alt+a',\r\n 'Insert SJIS tags.'\r\n ],\r\n 'Toggle sage': [\r\n 'Alt+s',\r\n 'Toggle sage in options field.'\r\n ],\r\n 'Toggle Cooldown': [\r\n 'Alt+Comma',\r\n 'Toggle custom cooldown timer.'\r\n ],\r\n 'Post from URL': [\r\n 'Alt+l',\r\n 'Post from URL.'\r\n ],\r\n 'Add new post': [\r\n 'Alt+n',\r\n 'Add new post to the QR dump list.'\r\n ],\r\n 'Submit QR': [\r\n 'Ctrl+Enter',\r\n 'Submit post.'\r\n ],\r\n // Thread related\r\n 'Watch': [\r\n 'w',\r\n 'Watch thread.'\r\n ],\r\n 'Update': [\r\n 'r',\r\n 'Update the thread / refresh the index.'\r\n ],\r\n 'Update thread watcher': [\r\n 'Shift+r',\r\n 'Manually refresh thread watcher.'\r\n ],\r\n 'Toggle thread watcher': [\r\n 't',\r\n 'Toggle visibility of thread watcher.'\r\n ],\r\n 'Toggle threading': [\r\n 'Shift+t',\r\n 'Toggle threading.'\r\n ],\r\n 'Mark thread read': [\r\n 'Ctrl+0',\r\n 'Mark thread read from index (requires \"Unread Line in Index\").'\r\n ],\r\n // Images\r\n 'Expand image': [\r\n 'Shift+e',\r\n 'Expand selected image.'\r\n ],\r\n 'Expand images': [\r\n 'e',\r\n 'Expand all images.'\r\n ],\r\n 'Open Gallery': [\r\n 'g',\r\n 'Opens the gallery.'\r\n ],\r\n 'Next Gallery Image': [\r\n 'Right',\r\n 'Go to the next image in gallery mode.'\r\n ],\r\n 'Previous Gallery Image': [\r\n 'Left',\r\n 'Go to the previous image in gallery mode.'\r\n ],\r\n 'Advance Gallery': [\r\n 'Enter',\r\n 'Go to next image or, if Autoplay is off, play video.'\r\n ],\r\n 'Pause': [\r\n 'p',\r\n 'Pause/play videos in the gallery.'\r\n ],\r\n 'Slideshow': [\r\n 'Ctrl+Right',\r\n 'Toggle the gallery slideshow mode.'\r\n ],\r\n 'Rotate image clockwise': [\r\n 'Shift+Right',\r\n 'Rotate image clockwise in gallery.'\r\n ],\r\n 'Rotate image anticlockwise': [\r\n 'Shift+Left',\r\n 'Rotate image anticlockwise in gallery.'\r\n ],\r\n 'Download Gallery Image': [\r\n 'Shift+j',\r\n 'Download current image in gallery.'\r\n ],\r\n 'fappeTyme': [\r\n 'f',\r\n 'Toggle Fappe Tyme.'\r\n ],\r\n 'werkTyme': [\r\n 'Shift+w',\r\n 'Toggle Werk Tyme.'\r\n ],\r\n // Board Navigation\r\n 'Front page': [\r\n '1',\r\n 'Jump to front page.'\r\n ],\r\n 'Open front page': [\r\n 'Shift+1',\r\n 'Open front page in a new tab.'\r\n ],\r\n 'Next page': [\r\n 'Ctrl+Right',\r\n 'Jump to the next page.'\r\n ],\r\n 'Previous page': [\r\n 'Ctrl+Left',\r\n 'Jump to the previous page.'\r\n ],\r\n 'Paged mode': [\r\n 'Alt+1',\r\n 'Open the index in paged mode.'\r\n ],\r\n 'Infinite scrolling mode': [\r\n 'Alt+2',\r\n 'Open the index in infinite scrolling mode.'\r\n ],\r\n 'All pages mode': [\r\n 'Alt+3',\r\n 'Open the index in all threads mode.'\r\n ],\r\n 'Open catalog': [\r\n 'Shift+c',\r\n 'Open the catalog of the current board.'\r\n ],\r\n 'Search form': [\r\n 'Ctrl+Alt+s',\r\n 'Focus the search field on the board index.'\r\n ],\r\n 'Cycle sort type': [\r\n 'Alt+x',\r\n 'Cycle through index sort types.'\r\n ],\r\n // Thread Navigation\r\n 'Next thread': [\r\n 'Ctrl+Down',\r\n 'See next thread.'\r\n ],\r\n 'Previous thread': [\r\n 'Ctrl+Up',\r\n 'See previous thread.'\r\n ],\r\n 'Expand thread': [\r\n 'Ctrl+e',\r\n 'Expand thread.'\r\n ],\r\n 'Open thread': [\r\n 'o',\r\n 'Open thread in current tab.'\r\n ],\r\n 'Open thread tab': [\r\n 'Shift+o',\r\n 'Open thread in new tab.'\r\n ],\r\n // Reply Navigation\r\n 'Next reply': [\r\n 'j',\r\n 'Select next reply.'\r\n ],\r\n 'Previous reply': [\r\n 'k',\r\n 'Select previous reply.'\r\n ],\r\n 'Deselect reply': [\r\n 'Shift+d',\r\n 'Deselect reply.'\r\n ],\r\n 'Hide': [\r\n 'x',\r\n 'Hide thread.'\r\n ],\r\n 'Quick Filter MD5': [\r\n '5',\r\n 'Add the MD5 of the selected image to the filter list.'\r\n ],\r\n 'Previous Post Quoting You': [\r\n 'Alt+Up',\r\n 'Scroll to the previous post that quotes you.'\r\n ],\r\n 'Next Post Quoting You': [\r\n 'Alt+Down',\r\n 'Scroll to the next post that quotes you.'\r\n ]\r\n },\r\n\r\n updater: {\r\n checkbox: {\r\n 'Beep': [\r\n false,\r\n 'Beep on new post to completely read thread.'\r\n ],\r\n 'Beep Quoting You': [\r\n false,\r\n 'Beep on new post quoting you.'\r\n ],\r\n 'Auto Scroll': [\r\n false,\r\n 'Scroll updated posts into view. Only enabled at bottom of page.'\r\n ],\r\n 'Bottom Scroll': [\r\n false,\r\n 'Always scroll to the bottom, not the first new post. Useful for event threads.'\r\n ],\r\n 'Scroll BG': [\r\n false,\r\n 'Auto-scroll background tabs.'\r\n ],\r\n 'Auto Update': [\r\n true,\r\n 'Automatically fetch new posts.'\r\n ],\r\n 'Optional Increase': [\r\n false,\r\n 'Increase the intervals between updates on threads without new posts.'\r\n ]\r\n },\r\n 'Interval': 5\r\n },\r\n\r\n customCooldown: 0,\r\n customCooldownEnabled: true,\r\n\r\n 'Thread Quotes': false,\r\n\r\n 'Max Replies': 1000,\r\n\r\n 'Autohiding Scrollbar': false,\r\n\r\n position: {\r\n 'embedding.position': 'top: 50px; right: 0px;',\r\n 'thread-stats.position': 'bottom: 0px; right: 0px;',\r\n 'updater.position': 'bottom: 0px; left: 0px;',\r\n 'thread-watcher.position': 'top: 50px; left: 0px;',\r\n 'qr.position': 'top: 50px; right: 0px;'\r\n },\r\n\r\n fourchanImageHost: 'i.4cdn.org',\r\n\r\n hiddenPSAList: [{}],\r\n\r\n knownBanners: banners.join(','),\r\n\r\n passMessageClosed: false,\r\n\r\n 'Prerequest Captcha': false,\r\n\r\n 'PSAseen': [[]]\r\n};\r\nexport default Config;\r\n","import ferongr_unreadDead from './Favicon/ferongr.unreadDead.png';\r\nimport ferongr_unreadDeadY from './Favicon/ferongr.unreadDeadY.png';\r\nimport ferongr_unreadSFW from './Favicon/ferongr.unreadSFW.png';\r\nimport ferongr_unreadSFWY from './Favicon/ferongr.unreadSFWY.png';\r\nimport ferongr_unreadNSFW from './Favicon/ferongr.unreadNSFW.png';\r\nimport ferongr_unreadNSFWY from './Favicon/ferongr.unreadNSFWY.png';\r\nimport xat_unreadDead from './Favicon/xat-.unreadDead.png';\r\nimport xat_unreadDeadY from './Favicon/xat-.unreadDeadY.png';\r\nimport xat_unreadSFW from './Favicon/xat-.unreadSFW.png';\r\nimport xat_unreadSFWY from './Favicon/xat-.unreadSFWY.png';\r\nimport xat_unreadNSFW from './Favicon/xat-.unreadNSFW.png';\r\nimport xat_unreadNSFWY from './Favicon/xat-.unreadNSFWY.png';\r\nimport Mayhem_unreadDead from './Favicon/Mayhem.unreadDead.png';\r\nimport Mayhem_unreadDeadY from './Favicon/Mayhem.unreadDeadY.png';\r\nimport Mayhem_unreadSFW from './Favicon/Mayhem.unreadSFW.png';\r\nimport Mayhem_unreadSFWY from './Favicon/Mayhem.unreadSFWY.png';\r\nimport Mayhem_unreadNSFW from './Favicon/Mayhem.unreadNSFW.png';\r\nimport Mayhem_unreadNSFWY from './Favicon/Mayhem.unreadNSFWY.png';\r\nimport fourChanJS_unreadDead from './Favicon/4chanJS.unreadDead.png';\r\nimport fourChanJS_unreadDeadY from './Favicon/4chanJS.unreadDeadY.png';\r\nimport fourChanJS_unreadSFW from './Favicon/4chanJS.unreadSFW.png';\r\nimport fourChanJS_unreadSFWY from './Favicon/4chanJS.unreadSFWY.png';\r\nimport fourChanJS_unreadNSFW from './Favicon/4chanJS.unreadNSFW.png';\r\nimport fourChanJS_unreadNSFWY from './Favicon/4chanJS.unreadNSFWY.png';\r\nimport Original_unreadDead from './Favicon/Original.unreadDead.png';\r\nimport Original_unreadDeadY from './Favicon/Original.unreadDeadY.png';\r\nimport Original_unreadSFW from './Favicon/Original.unreadSFW.png';\r\nimport Original_unreadSFWY from './Favicon/Original.unreadSFWY.png';\r\nimport Original_unreadNSFW from './Favicon/Original.unreadNSFW.png';\r\nimport Original_unreadNSFWY from './Favicon/Original.unreadNSFWY.png';\r\nimport Metro_unreadDead from './Favicon/Metro.unreadDead.png';\r\nimport Metro_unreadDeadY from './Favicon/Metro.unreadDeadY.png';\r\nimport Metro_unreadSFW from './Favicon/Metro.unreadSFW.png';\r\nimport Metro_unreadSFWY from './Favicon/Metro.unreadSFWY.png';\r\nimport Metro_unreadNSFW from './Favicon/Metro.unreadNSFW.png';\r\nimport Metro_unreadNSFWY from './Favicon/Metro.unreadNSFWY.png';\r\nimport dead from './Favicon/dead.gif';\r\nimport empty from './Favicon/empty.gif';\r\nimport $ from '../platform/$';\r\nimport { Conf, d } from '../globals/globals';\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS101: Remove unnecessary use of Array.from\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\n\r\nvar Favicon = {\r\n init() {\r\n return $.asap((() => d.head && (Favicon.el = $('link[rel=\"shortcut icon\"]', d.head))), Favicon.initAsap);\r\n },\r\n\r\n set(status) {\r\n Favicon.status = status;\r\n if (Favicon.el) {\r\n Favicon.el.href = Favicon[status];\r\n // `favicon.href = href` doesn't work on Firefox.\r\n return $.add(d.head, Favicon.el);\r\n }\r\n },\r\n\r\n initAsap() {\r\n Favicon.el.type = 'image/x-icon';\r\n const {href} = Favicon.el;\r\n Favicon.isSFW = /ws\\.ico$/.test(href);\r\n Favicon.default = href;\r\n Favicon.switch();\r\n if (Favicon.status) {\r\n return Favicon.set(Favicon.status);\r\n }\r\n },\r\n\r\n switch() {\r\n let items = {\r\n ferongr: [\r\n ferongr_unreadDead,\r\n ferongr_unreadDeadY,\r\n ferongr_unreadSFW,\r\n ferongr_unreadSFWY,\r\n ferongr_unreadNSFW,\r\n ferongr_unreadNSFWY,\r\n ],\r\n 'xat-': [\r\n xat_unreadDead,\r\n xat_unreadDeadY,\r\n xat_unreadSFW,\r\n xat_unreadSFWY,\r\n xat_unreadNSFW,\r\n xat_unreadNSFWY,\r\n ],\r\n Mayhem: [\r\n Mayhem_unreadDead,\r\n Mayhem_unreadDeadY,\r\n Mayhem_unreadSFW,\r\n Mayhem_unreadSFWY,\r\n Mayhem_unreadNSFW,\r\n Mayhem_unreadNSFWY,\r\n ],\r\n '4chanJS': [\r\n fourChanJS_unreadDead,\r\n fourChanJS_unreadDeadY,\r\n fourChanJS_unreadSFW,\r\n fourChanJS_unreadSFWY,\r\n fourChanJS_unreadNSFW,\r\n fourChanJS_unreadNSFWY,\r\n ],\r\n Original: [\r\n Original_unreadDead,\r\n Original_unreadDeadY,\r\n Original_unreadSFW,\r\n Original_unreadSFWY,\r\n Original_unreadNSFW,\r\n Original_unreadNSFWY,\r\n ],\r\n 'Metro': [\r\n Metro_unreadDead,\r\n Metro_unreadDeadY,\r\n Metro_unreadSFW,\r\n Metro_unreadSFWY,\r\n Metro_unreadNSFW,\r\n Metro_unreadNSFWY,\r\n ]\r\n };\r\n items = $.getOwn(items, Conf['favicon']);\r\n\r\n const f = Favicon;\r\n const t = 'data:image/png;base64,';\r\n let i = 0;\r\n while (items[i]) {\r\n items[i] = t + items[i++];\r\n }\r\n\r\n [f.unreadDead, f.unreadDeadY, f.unreadSFW, f.unreadSFWY, f.unreadNSFW, f.unreadNSFWY] = Array.from(items);\r\n return f.update();\r\n },\r\n\r\n update() {\r\n if (this.isSFW) {\r\n this.unread = this.unreadSFW;\r\n return this.unreadY = this.unreadSFWY;\r\n } else {\r\n this.unread = this.unreadNSFW;\r\n return this.unreadY = this.unreadNSFWY;\r\n }\r\n },\r\n\r\n SFW: '//s.4cdn.org/image/favicon-ws.ico',\r\n NSFW: '//s.4cdn.org/image/favicon.ico',\r\n dead: `data:image/gif;base64,${dead}`,\r\n logo: `data:image/png;base64,${empty}`,\r\n};\r\nexport default Favicon;\r\n","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///9zBQC/AADpDAP/gID/q6voCwJJTwpOAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPUCtJM7svankLrq/I+TY5e6Ueh1jyBMX7AFJi9vwfyVO4CbbO6jNYpp9GyVPbdkFhVgAQ2H0NOE5jk9DT8AAAAAElFTkSuQmCC';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAxUlEQVR42q1TOwrCQBB9s0FRtJI0WoqFtSLYegoP4gVSeJsUHsHSI3iFeIqRXXgwrhlXwYHHhLwPTB7B36abBCV+0pA4DUBQUNZYQptGtW3jtoKyxgoe0yrBCoyZfL/5ioQ3URZOXW9I341l3oo+NXEZiW4CEuIzvPECopED4OaZ3RNmeAm4u+a8Jr5f17VyVoL8fr8qcltzwlyyj2iqcgPOQ9ExkHAITgD75bYBe0A5S4H/P9htuWMF3QXoQpwaKeT+lnsC6JE5I6aq6fEAAAAASUVORK5CYII=';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///8AcH4AtswA2PJ55fKi6fIA1/FtpPADAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPUCtJM7svankLrq/I+TY5e6Ueh1jyBMX7AFJi9vwfyVO4CbbO6jNYpp9GyVPbdkFhVgAQ2H0NOE5jk9DT8AAAAAElFTkSuQmCC';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAxElEQVQ4y2NgoBq4/vE/HJOsBiRQUIfA2AzBqQYqUfn00/9FLz+BaQxDCKqBmX7j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mEEZYkGoqiMHKysAQEICwGwAAjBmBqhYlagAAAABJRU5ErkJggg==';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAPFBMVEUAAACEgoBva2ilamDxcG7IaWYgFBNOSEf//f0PDQwBAAA7LCwAAAD/AAD+hIX+m5z+zc5HAADPAAAGAADl032uAAAADHRSTlMAzNv0/vz+6v3+7ALrmfyXAAAAaUlEQVQY042PyxKAIAhFAc1eV7T6/3/N8VXOtAgWwBm4ANEPA8AswpySXHvvYZLlpBNrh9pDtcSqAQ1BUTVIjNUQY5icmwfglmXNgE0d6QBF9GigrU0A9LoM53U1kFzk6SBQuWfD/vHqDUCpBmVKTTM4AAAAAElFTkSuQmCC';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIVBMVEUAAACRjop4dXVpZ2tdcI9dfKdisfMAAAAumMN9xv+s2/+PADT2AAAAB3RSTlMAepGdv83v3HIc4QAAAFxJREFUCNdjYMAE5YXKRuLlDAzsHe2uIRUdBQwMFR1l6R3tIJGOyukdIJHy8lkry4FqGEwzV62aFozMUAFJOQEZ4iDFhQwI7UBGaTiEUVFs3g5isLMzMBQUIOwGAJRlIu9hk08QAAAAAElFTkSuQmCC';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAMFBMVEUAAACAgYVlc4ljsu4AAAAAAAAAAAAumMODyP6b1P6e1f/g8v89msgSIiwNFxwbPU3tQYj5AAAABnRSTlMAxej+9VTmD9ciAAAAZElEQVQI12NgwARpiUKKYmkMDGzlZUpK6eUJDAzp5clm5WUgkfKMtnKQSFpa54o0oBoGJYvZO88+gjJu7wMyhIBS2SCGGFDxaxADpP32NjAjSe0bSFd6epIaWISNjYEhJRVhNwAGlyJpYtcvcAAAAABJRU5ErkJggg==';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAHlBMVEUfJSCRi5Frbm9dn19082KR/30AAABmzDOq/5vZ/9Gt/vt2AAAABnRSTlMAe5rJ7/4vxEp4AAAAWUlEQVQI12NgwARpiUpKYmkMDGzlZcbG6eUJDAzp5Slu5WUgkfLUsHKQSFpaRGsaUA2DsmvnjBAjFAZICsQQAylOZEBoBzKSzSCM9CS1MhCDjY2BISEBYTcAtgAcKSK2vuIAAAAASUVORK5CYII=';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAM1BMVEUAAACBj39tfm1qj2RepFlu2VQAAQAAAAAAAABmyzOX/oSr/pus/pzk/98PGgtatC4CBAI1ENblAAAACHRSTlMA09/p9v77ig0SBcQAAABnSURBVBjTjY9LDsAgCEQRsR2xWu9/2hK/adJFYQG8wABEPwyAYzNnSatjjPAiviWLhPCqI1R7HBrQdCmGBrEETTmnUAq/QMm5dODHyAQOXXR1zLUGsIEI7lonMGfeHQTq9xw4P159AIxSBSC53km7AAAAAElFTkSuQmCC';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABFklEQVR4AZ2R4WqEMBCEFy1yiJQQ14gcIhIuFBFR+qPQ93+v66QMksrlTwMfkZ2ZZbMKTgVqYIDl3YAbeCM31lJP/Zul4MAEPJjBQGNDLGsz8PQ6aqLAP5PTdd1WlmU09mSKtdTDRgrkzspJPKq6RxMahfj9yhOzQEZwZAwfzrk1ox3MXibIN8hO4MAjeV72CemJGWblnRsOYOdoGw0jebB20BPAwKzUQPlrFhrXFw1Wagu9yuzZwINzVAZCURRL+gRr7Wd8Vtqg4Th/lsUmewyk9WQ/A7NiwJz5VV/GmO+MNjMrFvh/NPDMigHTaeJN09a27ZHRJmalBg54CgfvAGYSLpoHjlmpuAwFdzDy7oGS/qIpM9UPFGg1b1kUlssAAAAASUVORK5CYII=';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABR0lEQVR4AYWSQWq0QBCFCw0SRIK0PQ4hiIhEZBhEySLyewU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izLwpeoXnYpbQM34kAB9peP58aueZ4NPPRKxPusaRoYG6UizbquyH1O04T4RA+8EvAwUr6sgjFnDuReLaUn+ANygUa7+9SCWgAAAABJRU5ErkJggg==';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAD1BMVEUBAAAAAAD/AABnZ2f///8nFk05AAAAAXRSTlMAQObYZgAAAEFJREFUeNqNjgEKACAMAjvX/98cAkkxgmSgO8Bt/Ai4ApJ6KKhzF3OiEMDASrGB/QWgPEHsUpN+Ng9xAETMYhDrWmeHAMcmvycWAAAAAElFTkSuQmCC';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAD1BMVEUAAAAAAAD/AABmZmYA/wBD99DBAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAE9JREFUCNdljcsRACEIQ5MOiNKAdGAJ9N/Uiu7nsMzABHgB4B8ygFoZA2hhVWavhhGeURPJU9q45+17hGbfGxa82Ndex3hEM44SJGD2/b4AzDgGlHbl388AAAAASUVORK5CYII=';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAD1BMVEUBAAAAAAAul8NnZ2f////82iC9AAAAAXRSTlMAQObYZgAAAEFJREFUeNqNjgEKACAMAjvX/98cAkkxgmSgO8Bt/Ai4ApJ6KKhzF3OiEMDASrGB/QWgPEHsUpN+Ng9xAETMYhDrWmeHAMcmvycWAAAAAElFTkSuQmCC';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAD1BMVEUAAAAAAAAul8NnZ2f/AAD7B+mqAAAAAXRSTlMAQObYZgAAAAlwSFlzAAALEgAACxIB0t1+/AAAAE9JREFUCNdljcsRACEIQ5MOiNKAdGAJ9N/Uiu7nsMzABHgB4B8ygFoZA2hhVWavhhGeURPJU9q45+17hGbfGxa82Ndex3hEM44SJGD2/b4AzDgGlHbl388AAAAASUVORK5CYII=';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAElBMVEUBAAAAAABmzDNlyjJnZ2f///+6o7dfAAAAAXRSTlMAQObYZgAAAERJREFUeF6NjkEKADEIA51o///lJZfQxUsHITogWi8AvwZJuxmYa25xDooBLEwOWFTYAsYVhdorLZt9Ng9xCUTCUCQ2H3F4ANrZ2WNiAAAAAElFTkSuQmCC';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAD1BMVEUAAAAAAABmzDNmZmb/AAC8/wCMAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAE9JREFUCNdljcsRACEIQ5MOiNKAdGAJ9N/Uiu7nsMzABHgB4B8ygFoZA2hhVWavhhGeURPJU9q45+17hGbfGxa82Ndex3hEM44SJGD2/b4AzDgGlHbl388AAAAASUVORK5CYII=';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX/////AAD///8AAABBZmS3AAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII=';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAhElEQVR42q1RwQnAMAjMu5M4guAKXa4j5dUROo5tipSDcrFChUONd0di2m/hEGVOHDyIPufgwAFASDkpoSzmBrkJ2UMyR9LsJ3rvrqo3Rt1YMIMhhNnOxLMnoMFBxHyJAr2IOBFzA8U+6pLBdmEJTA0aMVjpDd6Loks0s5HZNwYx8tfZCZ0kll7ORffZAAAAAElFTkSuQmCC';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX///8ul8P///8AAACaqgkzAAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII=';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAALVBMVEUAAAAAAAAAAAAAAAABBQcHFx4KISoNLToaVW4oKCgul8M4ODg7OzvBwcH///8uS/CdAAAAA3RSTlMAx9dmesIgAAAAV0lEQVR42m2NWw6AIBAD1eILZO5/XI0UAgm7H9tOsu0yGWAQSOoFijHOxOANGqm/LczpOaXs4gISrPZ+gc2+hO5w2xdwgOjBFUIF+sEJrhUl9JFr+badFwR+BfqlmGUJAAAAAElFTkSuQmCC';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX///9mzDP///8AAACT0n1lAAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII=';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAALVBMVEUAAAAAAAAAAAAAAAAECAIQIAgWLAsePA8oKCg4ODg6dB07OztmzDPBwcH///+rsf3XAAAAA3RSTlMAx9dmesIgAAAAV0lEQVR42m2NWw6AIBAD1eIDhbn/cTVSCCTsfmw7ybbLZIBBIKkXKKU0E4M3aKT+tjCn5xiziwuIsNr7BTb7ErrDZV/AAaIHdwgV6AcnuFaU0Eeu5dt2XiUyBjCQ2bIrAAAAAElFTkSuQmCC';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAC/AABrZQDiAAAAAXRSTlMAQObYZgAAABJJREFUCB1jZGBgrMNAQEEc4gCSfAX5bRw/NQAAAABJRU5ErkJggg==';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAAAAAAAAAC/AAD///8dAAApAABsAAAHAAA4AACQAAAsAABMCpCvAAAAA3RSTlMAPse+s4iwAAAAMklEQVQI12NggAFmY2MDECaNAQZCilAzVJyg5oS4GqAxUtygjIp2KGOKJ5SxepcB3BUAcdYRqxAtgFoAAAAASUVORK5CYII=';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAAA1/GhpCidAAAAAXRSTlMAQObYZgAAABJJREFUCB1jZGBgrMNAQEEc4gCSfAX5bRw/NQAAAABJRU5ErkJggg==';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAAAAAAAAAAA1/H///8AISUALzQAeokACAkAQEcAorYAMTcE9WFNAAAAA3RSTlMAPse+s4iwAAAAMklEQVQI12NggAFmY2MDECaNAQZCilAzVJyg5oS4GqAxUtygjIp2KGOKJ5SxepcB3BUAcdYRqxAtgFoAAAAASUVORK5CYII=';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAABV/wErM5hwAAAAAXRSTlMAQObYZgAAABJJREFUCB1jZGBgrMNAQEEc4gCSfAX5bRw/NQAAAABJRU5ErkJggg==';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAAAAAAAAABV/wH///8NKAASOAAwkQADCgAZTABAwQATOwC5e3VGAAAAA3RSTlMAPse+s4iwAAAAMklEQVQI12NggAFmY2MDECaNAQZCilAzVJyg5oS4GqAxUtygjIp2KGOKJ5SxepcB3BUAcdYRqxAtgFoAAAAASUVORK5CYII=';","import { d } from \"../globals/globals\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS101: Remove unnecessary use of Array.from\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nconst $$ = (selector, root = d.body) => [...Array.from(root.querySelectorAll(selector))];\r\nexport default $$;\r\n","import { g, Conf, doc, d } from \"../globals/globals\";\r\nimport Main from \"../main/Main\";\r\nimport $ from \"../platform/$\";\r\nimport Captcha from \"./Captcha\";\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nconst CaptchaReplace = {\r\n init() {\r\n if ((g.SITE.software !== 'yotsuba') || (d.cookie.indexOf('pass_enabled=1') >= 0)) { return; }\r\n\r\n if (Conf['Force Noscript Captcha'] && Main.jsEnabled) {\r\n $.ready(Captcha.replace.noscript);\r\n return;\r\n }\r\n\r\n if (Conf['captchaLanguage'].trim()) {\r\n if (['boards.4chan.org', 'boards.4channel.org'].includes(location.hostname)) {\r\n return $.onExists(doc, '#captchaFormPart', node => $.onExists(node, 'iframe[src^=\"https://www.google.com/recaptcha/\"]', Captcha.replace.iframe));\r\n } else {\r\n return $.onExists(doc, 'iframe[src^=\"https://www.google.com/recaptcha/\"]', Captcha.replace.iframe);\r\n }\r\n }\r\n },\r\n\r\n noscript() {\r\n let noscript, original, toggle;\r\n if (!((original = $('#g-recaptcha')) && (noscript = $('noscript', original.parentNode)))) { return; }\r\n const span = $.el('span',\r\n {id: 'captcha-forced-noscript'});\r\n $.replace(noscript, span);\r\n $.rm(original);\r\n const insert = function() {\r\n span.innerHTML = noscript.textContent;\r\n return Captcha.replace.iframe($('iframe[src^=\"https://www.google.com/recaptcha/\"]', span));\r\n };\r\n if (toggle = $('#togglePostFormLink a, #form-link')) {\r\n return $.on(toggle, 'click', insert);\r\n } else {\r\n return insert();\r\n }\r\n },\r\n\r\n iframe(iframe) {\r\n let lang;\r\n if (lang = Conf['captchaLanguage'].trim()) {\r\n const src = /[?&]hl=/.test(iframe.src) ?\r\n iframe.src.replace(/([?&]hl=)[^&]*/, '$1' + encodeURIComponent(lang))\r\n :\r\n iframe.src + `&hl=${encodeURIComponent(lang)}`;\r\n if (iframe.src !== src) { iframe.src = src; }\r\n }\r\n }\r\n};\r\nexport default CaptchaReplace;\r\n","import { d, g } from \"../globals/globals\";\r\nimport $ from \"../platform/$\";\r\nimport QR from \"./QR\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nconst CaptchaT = {\r\n init() {\r\n if (d.cookie.indexOf('pass_enabled=1') >= 0) { return; }\r\n if (!(this.isEnabled = !!$('#t-root') || !$.id('postForm'))) { return; }\r\n\r\n const root = $.el('div', {className: 'captcha-root'});\r\n this.nodes = {root};\r\n\r\n $.addClass(QR.nodes.el, 'has-captcha', 'captcha-t');\r\n return $.after(QR.nodes.com.parentNode, root);\r\n },\r\n\r\n moreNeeded() {\r\n },\r\n\r\n getThread() {\r\n let threadID;\r\n const boardID = g.BOARD.ID;\r\n if (QR.posts[0].thread === 'new') {\r\n threadID = '0';\r\n } else {\r\n threadID = '' + QR.posts[0].thread;\r\n }\r\n return {boardID, threadID};\r\n },\r\n\r\n setup(focus) {\r\n if (!this.isEnabled) { return; }\r\n\r\n if (!this.nodes.container) {\r\n this.nodes.container = $.el('div', {className: 'captcha-container'});\r\n $.prepend(this.nodes.root, this.nodes.container);\r\n CaptchaT.currentThread = CaptchaT.getThread();\r\n $.global(function() {\r\n const el = document.querySelector('#qr .captcha-container');\r\n window.TCaptcha.init(el, this.boardID, +this.threadID);\r\n return window.TCaptcha.setErrorCb(err => window.dispatchEvent(new CustomEvent('CreateNotification', {detail: {\r\n type: 'warning',\r\n content: '' + err\r\n }})\r\n ));\r\n }\r\n , CaptchaT.currentThread);\r\n }\r\n\r\n if (focus) {\r\n return $('#t-resp').focus();\r\n }\r\n },\r\n\r\n destroy() {\r\n if (!this.isEnabled || !this.nodes.container) { return; }\r\n $.global(() => window.TCaptcha.destroy());\r\n $.rm(this.nodes.container);\r\n return delete this.nodes.container;\r\n },\r\n\r\n updateThread() {\r\n if (!this.isEnabled) { return; }\r\n const {boardID, threadID} = (CaptchaT.currentThread || {});\r\n const newThread = CaptchaT.getThread();\r\n if ((newThread.boardID !== boardID) || (newThread.threadID !== threadID)) {\r\n CaptchaT.destroy();\r\n return CaptchaT.setup();\r\n }\r\n },\r\n\r\n getOne() {\r\n let el;\r\n let response = {};\r\n if (this.nodes.container) {\r\n for (var key of ['t-response', 't-challenge']) {\r\n response[key] = $(`[name='${key}']`, this.nodes.container).value;\r\n }\r\n }\r\n if (!response['t-response'] && !((el = $('#t-msg')) && /Verification not required/i.test(el.textContent))) {\r\n response = null;\r\n }\r\n return response;\r\n },\r\n\r\n setUsed() {\r\n if (!this.isEnabled) { return; }\r\n if (this.nodes.container) {\r\n return $.global(() => window.TCaptcha.clearChallenge());\r\n }\r\n },\r\n\r\n occupied() {\r\n return !!this.nodes.container;\r\n }\r\n};\r\nexport default CaptchaT;\r\n",null,"import { Conf, d, g } from \"../globals/globals\";\r\nimport $ from \"../platform/$\";\r\nimport { dict, HOUR } from \"../platform/helpers\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * DS104: Avoid inline assignments\r\n * DS206: Consider reworking classes to avoid initClass\r\n * DS207: Consider shorter variations of null checks\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nexport default class DataBoard {\r\n static initClass() {\r\n this.keys = ['hiddenThreads', 'hiddenPosts', 'lastReadPosts', 'yourPosts', 'watchedThreads', 'watcherLastModified', 'customTitles'];\r\n\r\n this.changes = [];\r\n }\r\n\r\n constructor(key, sync, dontClean) {\r\n this.onSync = this.onSync.bind(this);\r\n this.key = key;\r\n this.initData(Conf[this.key]);\r\n $.sync(this.key, this.onSync);\r\n if (!dontClean) { this.clean(); }\r\n if (!sync) { return; }\r\n // Chrome also fires the onChanged callback on the current tab,\r\n // so we only start syncing when we're ready.\r\n var init = () => {\r\n $.off(d, '4chanXInitFinished', init);\r\n return this.sync = sync;\r\n };\r\n $.on(d, '4chanXInitFinished', init);\r\n }\r\n\r\n initData(data) {\r\n let boards;\r\n this.data = data;\r\n if (this.data.boards) {\r\n let lastChecked;\r\n ({boards, lastChecked} = this.data);\r\n this.data['4chan.org'] = {boards, lastChecked};\r\n delete this.data.boards;\r\n delete this.data.lastChecked;\r\n }\r\n return this.data[g.SITE.ID] || (this.data[g.SITE.ID] = { boards: dict() });\r\n }\r\n\r\n save(change, cb) {\r\n change();\r\n DataBoard.changes.push(change);\r\n return $.get(this.key, { boards: dict() }, items => {\r\n if (!DataBoard.changes.length) { return; }\r\n const needSync = ((items[this.key].version || 0) > (this.data.version || 0));\r\n if (needSync) {\r\n this.initData(items[this.key]);\r\n for (change of DataBoard.changes) { change(); }\r\n }\r\n DataBoard.changes = [];\r\n this.data.version = (this.data.version || 0) + 1;\r\n return $.set(this.key, this.data, () => {\r\n if (needSync) { this.sync?.(); }\r\n return cb?.();\r\n });\r\n });\r\n }\r\n\r\n forceSync(cb) {\r\n return $.get(this.key, { boards: dict() }, items => {\r\n if ((items[this.key].version || 0) > (this.data.version || 0)) {\r\n this.initData(items[this.key]);\r\n for (var change of DataBoard.changes) { change(); }\r\n this.sync?.();\r\n }\r\n return cb?.();\r\n });\r\n }\r\n\r\n delete({siteID, boardID, threadID, postID}, cb) {\r\n if (!siteID) { siteID = g.SITE.ID; }\r\n if (!this.data[siteID]) { return; }\r\n return this.save(() => {\r\n if (postID) {\r\n if (!this.data[siteID].boards[boardID]?.[threadID]) { return; }\r\n delete this.data[siteID].boards[boardID][threadID][postID];\r\n return this.deleteIfEmpty({siteID, boardID, threadID});\r\n } else if (threadID) {\r\n if (!this.data[siteID].boards[boardID]) { return; }\r\n delete this.data[siteID].boards[boardID][threadID];\r\n return this.deleteIfEmpty({siteID, boardID});\r\n } else {\r\n return delete this.data[siteID].boards[boardID];\r\n }\r\n }\r\n , cb);\r\n }\r\n\r\n deleteIfEmpty({siteID, boardID, threadID}) {\r\n if (!this.data[siteID]) { return; }\r\n if (threadID) {\r\n if (!Object.keys(this.data[siteID].boards[boardID][threadID]).length) {\r\n delete this.data[siteID].boards[boardID][threadID];\r\n return this.deleteIfEmpty({siteID, boardID});\r\n }\r\n } else if (!Object.keys(this.data[siteID].boards[boardID]).length) {\r\n return delete this.data[siteID].boards[boardID];\r\n }\r\n }\r\n\r\n set(data, cb) {\r\n return this.save(() => {\r\n return this.setUnsafe(data);\r\n }\r\n , cb);\r\n }\r\n\r\n setUnsafe({siteID, boardID, threadID, postID, val}) {\r\n if (!siteID) { siteID = g.SITE.ID; }\r\n if (!this.data[siteID]) { this.data[siteID] = { boards: dict() }; }\r\n if (postID !== undefined) {\r\n let base;\r\n return (((base = this.data[siteID].boards[boardID] || (this.data[siteID].boards[boardID] = dict())))[threadID] || (base[threadID] = dict()))[postID] = val;\r\n } else if (threadID !== undefined) {\r\n return (this.data[siteID].boards[boardID] || (this.data[siteID].boards[boardID] = dict()))[threadID] = val;\r\n } else {\r\n return this.data[siteID].boards[boardID] = val;\r\n }\r\n }\r\n\r\n extend({siteID, boardID, threadID, postID, val}, cb) {\r\n return this.save(() => {\r\n const oldVal = this.get({ siteID, boardID, threadID, postID, defaultValue: dict() });\r\n for (var key in val) {\r\n var subVal = val[key];\r\n if (typeof subVal === 'undefined') {\r\n delete oldVal[key];\r\n } else {\r\n oldVal[key] = subVal;\r\n }\r\n }\r\n return this.setUnsafe({siteID, boardID, threadID, postID, val: oldVal});\r\n }\r\n , cb);\r\n }\r\n\r\n setLastChecked(key='lastChecked') {\r\n return this.save(() => {\r\n return this.data[key] = Date.now();\r\n });\r\n }\r\n\r\n get({siteID, boardID, threadID, postID, defaultValue}) {\r\n let board, val;\r\n if (!siteID) { siteID = g.SITE.ID; }\r\n if (board = this.data[siteID]?.boards[boardID]) {\r\n let thread;\r\n if (threadID == null) {\r\n if (postID != null) {\r\n for (thread = 0; thread < board.length; thread++) {\r\n var ID = board[thread];\r\n if (postID in thread) {\r\n val = thread[postID];\r\n break;\r\n }\r\n }\r\n } else {\r\n val = board;\r\n }\r\n } else if (thread = board[threadID]) {\r\n val = (postID != null) ?\r\n thread[postID]\r\n :\r\n thread;\r\n }\r\n }\r\n return val || defaultValue;\r\n }\r\n\r\n clean() {\r\n let boardID, middle;\r\n const siteID = g.SITE.ID;\r\n for (boardID in this.data[siteID].boards) {\r\n var val = this.data[siteID].boards[boardID];\r\n this.deleteIfEmpty({siteID, boardID});\r\n }\r\n const now = Date.now();\r\n if (now - (2 * HOUR) >= ((middle = this.data[siteID].lastChecked || 0)) || middle > now) {\r\n this.data[siteID].lastChecked = now;\r\n for (boardID in this.data[siteID].boards) {\r\n this.ajaxClean(boardID);\r\n }\r\n }\r\n }\r\n\r\n ajaxClean(boardID) {\r\n const that = this;\r\n const siteID = g.SITE.ID;\r\n const threadsList = g.SITE.urls.threadsListJSON?.({siteID, boardID});\r\n if (!threadsList) { return; }\r\n return $.cache(threadsList, function() {\r\n if (this.status !== 200) { return; }\r\n const archiveList = g.SITE.urls.archiveListJSON?.({siteID, boardID});\r\n if (!archiveList) { return that.ajaxCleanParse(boardID, this.response); }\r\n const response1 = this.response;\r\n return $.cache(archiveList, function() {\r\n if ((this.status !== 200) && (!!g.SITE.archivedBoardsKnown || (this.status !== 404))) { return; }\r\n return that.ajaxCleanParse(boardID, response1, this.response);\r\n });\r\n });\r\n }\r\n\r\n ajaxCleanParse(boardID, response1, response2) {\r\n let board, ID;\r\n const siteID = g.SITE.ID;\r\n if (!(board = this.data[siteID].boards[boardID])) { return; }\r\n const threads = dict();\r\n if (response1) {\r\n for (var page of response1) {\r\n for (var thread of page.threads) {\r\n ID = thread.no;\r\n if (ID in board) { threads[ID] = board[ID]; }\r\n }\r\n }\r\n }\r\n if (response2) {\r\n for (ID of response2) {\r\n if (ID in board) { threads[ID] = board[ID]; }\r\n }\r\n }\r\n this.data[siteID].boards[boardID] = threads;\r\n this.deleteIfEmpty({siteID, boardID});\r\n return $.set(this.key, this.data);\r\n }\r\n\r\n onSync(data) {\r\n if ((data.version || 0) <= (this.data.version || 0)) { return; }\r\n this.initData(data);\r\n return this.sync?.();\r\n }\r\n}\r\nDataBoard.initClass();\r\n",null,"import SimpleDict from \"./SimpleDict\";\r\nimport $ from \"../platform/$\";\r\nimport { g } from \"../globals/globals\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nexport default class Thread {\r\n toString() { return this.ID; }\r\n\r\n constructor(ID, board) {\r\n this.board = board;\r\n this.ID = +ID;\r\n this.threadID = this.ID;\r\n this.boardID = this.board.ID;\r\n this.siteID = g.SITE.ID;\r\n this.fullID = `${this.board}.${this.ID}`;\r\n this.posts = new SimpleDict();\r\n this.isDead = false;\r\n this.isHidden = false;\r\n this.isSticky = false;\r\n this.isClosed = false;\r\n this.isArchived = false;\r\n this.postLimit = false;\r\n this.fileLimit = false;\r\n this.lastPost = 0;\r\n this.ipCount = undefined;\r\n this.json = null;\r\n\r\n this.OP = null;\r\n this.catalogView = null;\r\n\r\n this.nodes =\r\n {root: null};\r\n\r\n this.board.threads.push(this.ID, this);\r\n g.threads.push(this.fullID, this);\r\n }\r\n\r\n setPage(pageNum) {\r\n let icon;\r\n const {info, reply} = this.OP.nodes;\r\n if (!(icon = $('.page-num', info))) {\r\n icon = $.el('span', {className: 'page-num'});\r\n $.replace(reply.parentNode.previousSibling, [$.tn(' '), icon, $.tn(' ')]);\r\n }\r\n icon.title = `This thread is on page ${pageNum} in the original index.`;\r\n icon.textContent = `[${pageNum}]`;\r\n if (this.catalogView) { return this.catalogView.nodes.pageCount.textContent = pageNum; }\r\n }\r\n\r\n setCount(type, count, reachedLimit) {\r\n if (!this.catalogView) { return; }\r\n const el = this.catalogView.nodes[`${type}Count`];\r\n el.textContent = count;\r\n return (reachedLimit ? $.addClass : $.rmClass)(el, 'warning');\r\n }\r\n\r\n setStatus(type, status) {\r\n const name = `is${type}`;\r\n if (this[name] === status) { return; }\r\n this[name] = status;\r\n if (!this.OP) { return; }\r\n this.setIcon('Sticky', this.isSticky);\r\n this.setIcon('Closed', this.isClosed && !this.isArchived);\r\n return this.setIcon('Archived', this.isArchived);\r\n }\r\n\r\n setIcon(type, status) {\r\n const typeLC = type.toLowerCase();\r\n let icon = $(`.${typeLC}Icon`, this.OP.nodes.info);\r\n if (!!icon === status) { return; }\r\n\r\n if (!status) {\r\n $.rm(icon.previousSibling);\r\n $.rm(icon);\r\n if (this.catalogView) { $.rm($(`.${typeLC}Icon`, this.catalogView.nodes.icons)); }\r\n return;\r\n }\r\n icon = $.el('img', {\r\n src: `${g.SITE.Build.staticPath}${typeLC}${g.SITE.Build.gifIcon}`,\r\n alt: type,\r\n title: type,\r\n className: `${typeLC}Icon retina`\r\n }\r\n );\r\n if (g.BOARD.ID === 'f') {\r\n icon.style.cssText = 'height: 18px; width: 18px;';\r\n }\r\n\r\n const root = (type !== 'Sticky') && this.isSticky ?\r\n $('.stickyIcon', this.OP.nodes.info)\r\n :\r\n $('.page-num', this.OP.nodes.info) || this.OP.nodes.quote;\r\n $.after(root, [$.tn(' '), icon]);\r\n\r\n if (!this.catalogView) { return; }\r\n return ((type === 'Sticky') && this.isClosed ? $.prepend : $.add)(this.catalogView.nodes.icons, icon.cloneNode());\r\n }\r\n\r\n kill() {\r\n return this.isDead = true;\r\n }\r\n\r\n collect() {\r\n let n = 0;\r\n this.posts.forEach(function(post) {\r\n if (post.clones.length) {\r\n return n++;\r\n } else {\r\n return post.collect();\r\n }\r\n });\r\n if (!n) {\r\n g.threads.rm(this.fullID);\r\n return this.board.threads.rm(this);\r\n }\r\n }\r\n}\r\n","import $ from \"../platform/$\";\r\n\r\nexport default class CatalogThread {\r\n toString() { return this.ID; }\r\n\r\n constructor(root, thread) {\r\n this.thread = thread;\r\n this.ID = this.thread.ID;\r\n this.board = this.thread.board;\r\n const {post} = this.thread.OP.nodes;\r\n this.nodes = {\r\n root,\r\n thumb: $('.catalog-thumb', post),\r\n icons: $('.catalog-icons', post),\r\n postCount: $('.post-count', post),\r\n fileCount: $('.file-count', post),\r\n pageCount: $('.page-count', post),\r\n replies: null\r\n };\r\n this.thread.catalogView = this;\r\n }\r\n}\r\n","import { Conf, d, doc } from \"../globals/globals\";\r\nimport Main from \"../main/Main\";\r\nimport $ from \"../platform/$\";\r\nimport $$ from \"../platform/$$\";\r\nimport Header from \"./Header\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS101: Remove unnecessary use of Array.from\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * DS206: Consider reworking classes to avoid initClass\r\n * DS207: Consider shorter variations of null checks\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nconst dialog = function(id, properties) {\r\n const el = $.el('div', {\r\n className: 'dialog',\r\n id\r\n }\r\n );\r\n $.extend(el, properties);\r\n el.style.cssText = Conf[`${id}.position`];\r\n\r\n const move = $('.move', el);\r\n $.on(move, 'touchstart mousedown', dragstart);\r\n for (var child of move.children) {\r\n if (!child.tagName) { continue; }\r\n $.on(child, 'touchstart mousedown', e => e.stopPropagation());\r\n }\r\n\r\n return el;\r\n};\r\n\r\nvar Menu = (function() {\r\n let currentMenu = undefined;\r\n let lastToggledButton = undefined;\r\n Menu = class Menu {\r\n static initClass() {\r\n currentMenu = null;\r\n lastToggledButton = null;\r\n }\r\n\r\n constructor(type) {\r\n // XXX AddMenuEntry event is deprecated\r\n this.setPosition = this.setPosition.bind(this);\r\n this.close = this.close.bind(this);\r\n this.keybinds = this.keybinds.bind(this);\r\n this.onFocus = this.onFocus.bind(this);\r\n this.addEntry = this.addEntry.bind(this);\r\n this.type = type;\r\n $.on(d, 'AddMenuEntry', ({detail}) => {\r\n if (detail.type !== this.type) { return; }\r\n delete detail.open;\r\n return this.addEntry(detail);\r\n });\r\n this.entries = [];\r\n }\r\n\r\n makeMenu() {\r\n const menu = $.el('div', {\r\n className: 'dialog',\r\n id: 'menu',\r\n tabIndex: 0\r\n }\r\n );\r\n menu.dataset.type = this.type;\r\n $.on(menu, 'click', e => e.stopPropagation());\r\n $.on(menu, 'keydown', this.keybinds);\r\n return menu;\r\n }\r\n\r\n toggle(e, button, data) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n\r\n if (currentMenu) {\r\n // Close if it's already opened.\r\n // Reopen if we clicked on another button.\r\n const previousButton = lastToggledButton;\r\n currentMenu.close();\r\n if (previousButton === button) { return; }\r\n }\r\n\r\n if (!this.entries.length) { return; }\r\n return this.open(button, data);\r\n }\r\n\r\n open(button, data) {\r\n let entry;\r\n const menu = (this.menu = this.makeMenu());\r\n currentMenu = this;\r\n lastToggledButton = button;\r\n\r\n this.entries.sort((first, second) => first.order - second.order);\r\n\r\n for (entry of this.entries) {\r\n this.insertEntry(entry, menu, data);\r\n }\r\n\r\n $.addClass(lastToggledButton, 'active');\r\n\r\n $.on(d, 'click CloseMenu', this.close);\r\n $.on(d, 'scroll', this.setPosition);\r\n $.on(window, 'resize', this.setPosition);\r\n $.after(button, menu);\r\n\r\n this.setPosition();\r\n\r\n entry = $('.entry', menu);\r\n // We've removed flexbox, so we don't use order anymore.\r\n // while prevEntry = @findNextEntry entry, -1\r\n // entry = prevEntry\r\n this.focus(entry);\r\n\r\n return menu.focus();\r\n }\r\n\r\n setPosition() {\r\n const mRect = this.menu.getBoundingClientRect();\r\n const bRect = lastToggledButton.getBoundingClientRect();\r\n const bTop = window.scrollY + bRect.top;\r\n const bLeft = window.scrollX + bRect.left;\r\n const cHeight = doc.clientHeight;\r\n const cWidth = doc.clientWidth;\r\n const [top, bottom] = Array.from((bRect.top + bRect.height + mRect.height) < cHeight ?\r\n [`${bRect.bottom}px`, '']\r\n :\r\n ['', `${cHeight - bRect.top}px`]);\r\n const [left, right] = Array.from((bRect.left + mRect.width) < cWidth ?\r\n [`${bRect.left}px`, '']\r\n :\r\n ['', `${cWidth - bRect.right}px`]);\r\n $.extend(this.menu.style, {top, right, bottom, left});\r\n return this.menu.classList.toggle('left', right);\r\n }\r\n\r\n insertEntry(entry, parent, data) {\r\n let submenu;\r\n if (typeof entry.open === 'function') {\r\n try {\r\n if (!entry.open(data)) { return; }\r\n } catch (err) {\r\n Main.handleErrors({\r\n message: `Error in building the ${this.type} menu.`,\r\n error: err\r\n });\r\n return;\r\n }\r\n }\r\n $.add(parent, entry.el);\r\n\r\n if (!entry.subEntries) { return; }\r\n if (submenu = $('.submenu', entry.el)) {\r\n // Reset sub menu, remove irrelevant entries.\r\n $.rm(submenu);\r\n }\r\n submenu = $.el('div',\r\n {className: 'dialog submenu'});\r\n for (var subEntry of entry.subEntries) {\r\n this.insertEntry(subEntry, submenu, data);\r\n }\r\n $.add(entry.el, submenu);\r\n }\r\n\r\n close() {\r\n $.rm(this.menu);\r\n delete this.menu;\r\n $.rmClass(lastToggledButton, 'active');\r\n currentMenu = null;\r\n lastToggledButton = null;\r\n $.off(d, 'click scroll CloseMenu', this.close);\r\n $.off(d, 'scroll', this.setPosition);\r\n return $.off(window, 'resize', this.setPosition);\r\n }\r\n\r\n findNextEntry(entry, direction) {\r\n const entries = [...Array.from(entry.parentNode.children)];\r\n entries.sort((first, second) => first.style.order - second.style.order);\r\n return entries[entries.indexOf(entry) + direction];\r\n }\r\n\r\n keybinds(e) {\r\n let subEntry;\r\n let next, submenu;\r\n let entry = $('.focused', this.menu);\r\n while ((subEntry = $('.focused', entry))) {\r\n entry = subEntry;\r\n }\r\n\r\n switch (e.keyCode) {\r\n case 27: // Esc\r\n lastToggledButton.focus();\r\n this.close();\r\n break;\r\n case 13: case 32: // Enter, Space\r\n entry.click();\r\n break;\r\n case 38: // Up\r\n if (next = this.findNextEntry(entry, -1)) {\r\n this.focus(next);\r\n }\r\n break;\r\n case 40: // Down\r\n if (next = this.findNextEntry(entry, +1)) {\r\n this.focus(next);\r\n }\r\n break;\r\n case 39: // Right\r\n if ((submenu = $('.submenu', entry)) && (next = submenu.firstElementChild)) {\r\n let nextPrev;\r\n while ((nextPrev = this.findNextEntry(next, -1))) {\r\n next = nextPrev;\r\n }\r\n this.focus(next);\r\n }\r\n break;\r\n case 37: // Left\r\n if (next = $.x('parent::*[contains(@class,\"submenu\")]/parent::*', entry)) {\r\n this.focus(next);\r\n }\r\n break;\r\n default:\r\n return;\r\n }\r\n\r\n e.preventDefault();\r\n return e.stopPropagation();\r\n }\r\n\r\n onFocus(e) {\r\n e.stopPropagation();\r\n return this.focus(e.target);\r\n }\r\n\r\n focus(entry) {\r\n let focused, submenu;\r\n while ((focused = $.x('parent::*/child::*[contains(@class,\"focused\")]', entry))) {\r\n $.rmClass(focused, 'focused');\r\n }\r\n for (focused of $$('.focused', entry)) {\r\n $.rmClass(focused, 'focused');\r\n }\r\n $.addClass(entry, 'focused');\r\n\r\n // Submenu positioning.\r\n if (!(submenu = $('.submenu', entry))) { return; }\r\n const sRect = submenu.getBoundingClientRect();\r\n const eRect = entry.getBoundingClientRect();\r\n const cHeight = doc.clientHeight;\r\n const cWidth = doc.clientWidth;\r\n const [top, bottom] = Array.from((eRect.top + sRect.height) < cHeight ?\r\n ['0px', 'auto']\r\n :\r\n ['auto', '0px']);\r\n const [left, right] = Array.from((eRect.right + sRect.width) < (cWidth - 150) ?\r\n ['100%', 'auto']\r\n :\r\n ['auto', '100%']);\r\n const {style} = submenu;\r\n style.top = top;\r\n style.bottom = bottom;\r\n style.left = left;\r\n return style.right = right;\r\n }\r\n\r\n addEntry(entry) {\r\n this.parseEntry(entry);\r\n return this.entries.push(entry);\r\n }\r\n\r\n parseEntry(entry) {\r\n const {el, subEntries} = entry;\r\n $.addClass(el, 'entry');\r\n $.on(el, 'focus mouseover', this.onFocus);\r\n el.style.order = entry.order || 100;\r\n if (!subEntries) { return; }\r\n $.addClass(el, 'has-submenu');\r\n for (var subEntry of subEntries) {\r\n this.parseEntry(subEntry);\r\n }\r\n }\r\n };\r\n Menu.initClass();\r\n return Menu;\r\n})();\r\n\r\nexport var dragstart = function (e) {\r\n let isTouching;\r\n if ((e.type === 'mousedown') && (e.button !== 0)) { return; } // not LMB\r\n // prevent text selection\r\n e.preventDefault();\r\n if (isTouching = e.type === 'touchstart') {\r\n e = e.changedTouches[e.changedTouches.length - 1];\r\n }\r\n // distance from pointer to el edge is constant; calculate it here.\r\n const el = $.x('ancestor::div[contains(@class,\"dialog\")][1]', this);\r\n const rect = el.getBoundingClientRect();\r\n const screenHeight = doc.clientHeight;\r\n const screenWidth = doc.clientWidth;\r\n const o = {\r\n id: el.id,\r\n style: el.style,\r\n dx: e.clientX - rect.left,\r\n dy: e.clientY - rect.top,\r\n height: screenHeight - rect.height,\r\n width: screenWidth - rect.width,\r\n screenHeight,\r\n screenWidth,\r\n isTouching\r\n };\r\n\r\n [o.topBorder, o.bottomBorder] = Array.from(Conf['Header auto-hide'] || !Conf['Fixed Header'] ?\r\n [0, 0]\r\n : Conf['Bottom Header'] ?\r\n [0, Header.bar.getBoundingClientRect().height]\r\n :\r\n [Header.bar.getBoundingClientRect().height, 0]);\r\n\r\n if (isTouching) {\r\n o.identifier = e.identifier;\r\n o.move = touchmove.bind(o);\r\n o.up = touchend.bind(o);\r\n $.on(d, 'touchmove', o.move);\r\n return $.on(d, 'touchend touchcancel', o.up);\r\n } else { // mousedown\r\n o.move = drag.bind(o);\r\n o.up = dragend.bind(o);\r\n $.on(d, 'mousemove', o.move);\r\n return $.on(d, 'mouseup', o.up);\r\n }\r\n};\r\n\r\nexport var touchmove = function (e) {\r\n for (var touch of e.changedTouches) {\r\n if (touch.identifier === this.identifier) {\r\n drag.call(this, touch);\r\n return;\r\n }\r\n }\r\n};\r\n\r\nexport var drag = function (e) {\r\n const {clientX, clientY} = e;\r\n\r\n let left = clientX - this.dx;\r\n left = left < 10 ?\r\n 0\r\n : (this.width - left) < 10 ?\r\n ''\r\n :\r\n ((left / this.screenWidth) * 100) + '%';\r\n\r\n let top = clientY - this.dy;\r\n top = top < (10 + this.topBorder) ?\r\n this.topBorder + 'px'\r\n : (this.height - top) < (10 + this.bottomBorder) ?\r\n ''\r\n :\r\n ((top / this.screenHeight) * 100) + '%';\r\n\r\n const right = left === '' ?\r\n 0\r\n :\r\n '';\r\n\r\n const bottom = top === '' ?\r\n this.bottomBorder + 'px'\r\n :\r\n '';\r\n\r\n const {style} = this;\r\n style.left = left;\r\n style.right = right;\r\n style.top = top;\r\n return style.bottom = bottom;\r\n};\r\n\r\nexport var touchend = function (e) {\r\n for (var touch of e.changedTouches) {\r\n if (touch.identifier === this.identifier) {\r\n dragend.call(this);\r\n return;\r\n }\r\n }\r\n};\r\n\r\nexport var dragend = function () {\r\n if (this.isTouching) {\r\n $.off(d, 'touchmove', this.move);\r\n $.off(d, 'touchend touchcancel', this.up);\r\n } else { // mouseup\r\n $.off(d, 'mousemove', this.move);\r\n $.off(d, 'mouseup', this.up);\r\n }\r\n return $.set(`${this.id}.position`, this.style.cssText);\r\n};\r\n\r\nconst hoverstart = function ({ root, el, latestEvent, endEvents, height, width, cb, noRemove }) {\r\n const rect = root.getBoundingClientRect();\r\n const o = {\r\n root,\r\n el,\r\n style: el.style,\r\n isImage: ['IMG', 'VIDEO'].includes(el.nodeName),\r\n cb,\r\n endEvents,\r\n latestEvent,\r\n clientHeight: doc.clientHeight,\r\n clientWidth: doc.clientWidth,\r\n height,\r\n width,\r\n noRemove,\r\n clientX: (rect.left + rect.right) / 2,\r\n clientY: (rect.top + rect.bottom) / 2\r\n };\r\n o.hover = hover.bind(o);\r\n o.hoverend = hoverend.bind(o);\r\n\r\n o.hover(o.latestEvent);\r\n new MutationObserver(function() {\r\n if (el.parentNode) { return o.hover(o.latestEvent); }\r\n }).observe(el, {childList: true});\r\n\r\n $.on(root, endEvents, o.hoverend);\r\n if ($.x('ancestor::div[contains(@class,\"inline\")][1]', root)) {\r\n $.on(d, 'keydown', o.hoverend);\r\n }\r\n $.on(root, 'mousemove', o.hover);\r\n\r\n // Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=674955\r\n o.workaround = function(e) { if (!root.contains(e.target)) { return o.hoverend(e); } };\r\n return $.on(doc, 'mousemove', o.workaround);\r\n};\r\n\r\nhoverstart.padding = 25;\r\n\r\nexport var hover = function (e) {\r\n this.latestEvent = e;\r\n const height = (this.height || this.el.offsetHeight) + hoverstart.padding;\r\n const width = (this.width || this.el.offsetWidth);\r\n const {clientX, clientY} = Conf['Follow Cursor'] ? e : this;\r\n\r\n const top = this.isImage ?\r\n Math.max(0, (clientY * (this.clientHeight - height)) / this.clientHeight)\r\n :\r\n Math.max(0, Math.min(this.clientHeight - height, clientY - 120));\r\n\r\n let threshold = this.clientWidth / 2;\r\n if (!this.isImage) { threshold = Math.max(threshold, this.clientWidth - 400); }\r\n let marginX = (clientX <= threshold ? clientX : this.clientWidth - clientX) + 45;\r\n if (this.isImage) { marginX = Math.min(marginX, this.clientWidth - width); }\r\n marginX += 'px';\r\n const [left, right] = Array.from(clientX <= threshold ? [marginX, ''] : ['', marginX]);\r\n\r\n const {style} = this;\r\n style.top = top + 'px';\r\n style.left = left;\r\n return style.right = right;\r\n};\r\n\r\nexport var hoverend = function (e) {\r\n if (((e.type === 'keydown') && (e.keyCode !== 13)) || (e.target.nodeName === \"TEXTAREA\")) { return; }\r\n if (!this.noRemove) { $.rm(this.el); }\r\n $.off(this.root, this.endEvents, this.hoverend);\r\n $.off(d, 'keydown', this.hoverend);\r\n $.off(this.root, 'mousemove', this.hover);\r\n // Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=674955\r\n $.off(doc, 'mousemove', this.workaround);\r\n if (this.cb) { return this.cb.call(this); }\r\n};\r\n\r\nexport const checkbox = function (name, text, checked) {\r\n if (checked == null) { checked = Conf[name]; }\r\n const label = $.el('label');\r\n const input = $.el('input', {type: 'checkbox', name, checked});\r\n $.add(label, [input, $.tn(` ${text}`)]);\r\n return label;\r\n};\r\n\r\nconst UI = {\r\n dialog,\r\n Menu,\r\n hover: hoverstart,\r\n checkbox\r\n};\r\nexport default UI;\r\n","import Get from \"../General/Get\";\r\nimport Header from \"../General/Header\";\r\nimport { g, Conf, d, doc } from \"../globals/globals\";\r\nimport $ from \"../platform/$\";\r\nimport $$ from \"../platform/$$\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar Nav = {\r\n init() {\r\n switch (g.VIEW) {\r\n case 'index':\r\n if (!Conf['Index Navigation']) { return; }\r\n break;\r\n case 'thread':\r\n if (!Conf['Reply Navigation']) { return; }\r\n break;\r\n default:\r\n return;\r\n }\r\n\r\n const span = $.el('span',\r\n {id: 'navlinks'});\r\n const prev = $.el('a', {\r\n textContent: '▲',\r\n href: 'javascript:;'\r\n }\r\n );\r\n const next = $.el('a', {\r\n textContent: '▼',\r\n href: 'javascript:;'\r\n }\r\n );\r\n\r\n $.on(prev, 'click', this.prev);\r\n $.on(next, 'click', this.next);\r\n\r\n $.add(span, [prev, $.tn(' '), next]);\r\n var append = function() {\r\n $.off(d, '4chanXInitFinished', append);\r\n return $.add(d.body, span);\r\n };\r\n return $.on(d, '4chanXInitFinished', append);\r\n },\r\n\r\n prev() {\r\n if (g.VIEW === 'thread') {\r\n return window.scrollTo(0, 0);\r\n } else {\r\n return Nav.scroll(-1);\r\n }\r\n },\r\n\r\n next() {\r\n if (g.VIEW === 'thread') {\r\n return window.scrollTo(0, d.body.scrollHeight);\r\n } else {\r\n return Nav.scroll(+1);\r\n }\r\n },\r\n\r\n getThread() {\r\n if (g.VIEW === 'thread') { return g.threads.get(`${g.BOARD}.${g.THREADID}`).nodes.root; }\r\n if ($.hasClass(doc, 'catalog-mode')) { return; }\r\n for (var threadRoot of $$(g.SITE.selectors.thread)) {\r\n var thread = Get.threadFromRoot(threadRoot);\r\n if (thread.isHidden && !thread.stub) { continue; }\r\n if (Header.getTopOf(threadRoot) >= -threadRoot.getBoundingClientRect().height) { // not scrolled past\r\n return threadRoot;\r\n }\r\n }\r\n },\r\n\r\n scroll(delta) {\r\n let next;\r\n d.activeElement?.blur();\r\n let thread = Nav.getThread();\r\n if (!thread) { return; }\r\n const axis = delta === +1 ?\r\n 'following'\r\n :\r\n 'preceding';\r\n if (next = $.x(`${axis}-sibling::${g.SITE.xpath.thread}[not(@hidden)][1]`, thread)) {\r\n // Unless we're not at the beginning of the current thread,\r\n // and thus wanting to move to beginning,\r\n // or we're above the first thread and don't want to skip it.\r\n const top = Header.getTopOf(thread);\r\n if (((delta === +1) && (top < 5)) || ((delta === -1) && (top > -5))) { thread = next; }\r\n }\r\n // Add extra space to the end of the page if necessary so that all threads can be selected by keybinds.\r\n const extra = (Header.getTopOf(thread) + doc.clientHeight) - d.body.getBoundingClientRect().bottom;\r\n if (extra > 0) { d.body.style.marginBottom = `${extra}px`; }\r\n\r\n Header.scrollTo(thread);\r\n\r\n if ((extra > 0) && !Nav.haveExtra) {\r\n Nav.haveExtra = true;\r\n return $.on(d, 'scroll', Nav.removeExtra);\r\n }\r\n },\r\n\r\n removeExtra() {\r\n const extra = doc.clientHeight - d.body.getBoundingClientRect().bottom;\r\n if (extra > 0) {\r\n return d.body.style.marginBottom = `${extra}px`;\r\n } else {\r\n d.body.style.marginBottom = '';\r\n delete Nav.haveExtra;\r\n return $.off(d, 'scroll', Nav.removeExtra);\r\n }\r\n }\r\n};\r\nexport default Nav;\r\n","import Callbacks from \"../classes/Callbacks\";\r\nimport { Conf, g } from \"../globals/globals\";\r\nimport $$ from \"../platform/$$\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar ImageHost = {\r\n init() {\r\n if ((!(this.useFaster = /\\S/.test(Conf['fourchanImageHost']))) || (g.SITE.software !== 'yotsuba') || !['index', 'thread'].includes(g.VIEW)) { return; }\r\n return Callbacks.Post.push({\r\n name: 'Image Host Rewriting',\r\n cb: this.node\r\n });\r\n },\r\n\r\n suggestions: ['i.4cdn.org', 'is2.4chan.org'],\r\n\r\n host() {\r\n return Conf['fourchanImageHost'].trim() || 'i.4cdn.org';\r\n },\r\n flashHost() {\r\n return 'i.4cdn.org';\r\n },\r\n thumbHost() {\r\n return 'i.4cdn.org';\r\n },\r\n test(hostname) {\r\n return (hostname === 'i.4cdn.org') || ImageHost.regex.test(hostname);\r\n },\r\n\r\n regex: /^is\\d*\\.4chan(?:nel)?\\.org$/,\r\n\r\n node() {\r\n if (this.isClone) { return; }\r\n const host = ImageHost.host();\r\n if (this.file && ImageHost.test(this.file.url.split('/')[2]) && !/\\.swf$/.test(this.file.url)) {\r\n this.file.link.hostname = host;\r\n if (this.file.thumbLink) { this.file.thumbLink.hostname = host; }\r\n this.file.url = this.file.link.href;\r\n }\r\n return ImageHost.fixLinks($$('a', this.nodes.comment));\r\n },\r\n\r\n fixLinks(links) {\r\n for (var link of links) {\r\n if (ImageHost.test(link.hostname) && !/\\.swf$/.test(link.pathname)) {\r\n var host = ImageHost.host();\r\n if (link.hostname !== host) { link.hostname = host; }\r\n }\r\n }\r\n }\r\n};\r\nexport default ImageHost;\r\n","import Callbacks from \"../classes/Callbacks\";\r\nimport Config from \"../config/Config\";\r\nimport Header from \"../General/Header\";\r\nimport UI from \"../General/UI\";\r\nimport { g, Conf, E } from \"../globals/globals\";\r\nimport $ from \"../platform/$\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar Volume = {\r\n init() {\r\n if (!['index', 'thread'].includes(g.VIEW) ||\r\n (!Conf['Image Expansion'] && !Conf['Image Hover'] && !Conf['Image Hover in Catalog'] && !Conf['Gallery'])) { return; }\r\n\r\n $.sync('Allow Sound', function(x) {\r\n Conf['Allow Sound'] = x;\r\n if (Volume.inputs) Volume.inputs.unmute.checked = x;\r\n });\r\n\r\n $.sync('Default Volume', function(x) {\r\n Conf['Default Volume'] = x;\r\n if (Volume.inputs) Volume.inputs.volume.value = x;\r\n });\r\n\r\n if (Conf['Mouse Wheel Volume']) {\r\n Callbacks.Post.push({\r\n name: 'Mouse Wheel Volume',\r\n cb: this.node\r\n });\r\n }\r\n\r\n if (g.SITE.noAudio?.(g.BOARD)) { return; }\r\n\r\n if (Conf['Mouse Wheel Volume']) {\r\n Callbacks.CatalogThread.push({\r\n name: 'Mouse Wheel Volume',\r\n cb: this.catalogNode\r\n });\r\n }\r\n\r\n const unmuteEntry = UI.checkbox('Allow Sound', 'Allow Sound');\r\n unmuteEntry.title = Config.main['Images and Videos']['Allow Sound'][1];\r\n\r\n const volumeEntry = $.el('label',\r\n {title: 'Default volume for videos.'});\r\n $.extend(volumeEntry,\r\n {innerHTML: \" Volume\"});\r\n\r\n this.inputs = {\r\n unmute: unmuteEntry.firstElementChild,\r\n volume: volumeEntry.firstElementChild\r\n };\r\n\r\n $.on(this.inputs.unmute, 'change', $.cb.checked);\r\n $.on(this.inputs.volume, 'change', $.cb.value);\r\n\r\n Header.menu.addEntry({el: unmuteEntry, order: 200});\r\n return Header.menu.addEntry({el: volumeEntry, order: 201});\r\n },\r\n\r\n setup(video) {\r\n video.muted = !Conf['Allow Sound'];\r\n video.volume = Conf['Default Volume'];\r\n return $.on(video, 'volumechange', Volume.change);\r\n },\r\n\r\n change() {\r\n const {muted, volume} = this;\r\n const items = {\r\n 'Allow Sound': !muted,\r\n 'Default Volume': volume\r\n };\r\n for (var key in items) {\r\n var val = items[key];\r\n if (Conf[key] === val) {\r\n delete items[key];\r\n }\r\n }\r\n $.set(items);\r\n $.extend(Conf, items);\r\n if (Volume.inputs) {\r\n Volume.inputs.unmute.checked = !muted;\r\n return Volume.inputs.volume.value = volume;\r\n }\r\n },\r\n\r\n node() {\r\n if (g.SITE.noAudio?.(this.board)) { return; }\r\n for (var file of this.files) {\r\n if (file.isVideo) {\r\n if (file.thumb) { $.on(file.thumb, 'wheel', Volume.wheel.bind(Header.hover)); }\r\n $.on(($('.file-info', file.text) || file.link), 'wheel', Volume.wheel.bind(file.thumbLink));\r\n }\r\n }\r\n },\r\n\r\n catalogNode() {\r\n const file = this.thread.OP.files[0];\r\n if (!file?.isVideo) { return; }\r\n return $.on(this.nodes.thumb, 'wheel', Volume.wheel.bind(Header.hover));\r\n },\r\n\r\n wheel(e) {\r\n let el;\r\n if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) { return; }\r\n if (!(el = $('video:not([data-md5])', this))) { return; }\r\n if (el.muted || !$.hasAudio(el)) { return; }\r\n let volume = el.volume + 0.1;\r\n if (e.deltaY < 0) { volume *= 1.1; }\r\n if (e.deltaY > 0) { volume /= 1.1; }\r\n el.volume = $.minmax(volume - 0.1, 0, 1);\r\n return e.preventDefault();\r\n }\r\n};\r\nexport default Volume;\r\n","import Redirect from \"../Archive/Redirect\";\r\nimport Notice from \"../classes/Notice\";\r\nimport { g, Conf, d } from \"../globals/globals\";\r\nimport $ from \"../platform/$\";\r\nimport CrossOrigin from \"../platform/CrossOrigin\";\r\nimport ImageHost from \"./ImageHost\";\r\nimport Volume from \"./Volume\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * DS104: Avoid inline assignments\r\n * DS204: Change includes calls to have a more natural evaluation order\r\n * DS207: Consider shorter variations of null checks\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar ImageCommon = {\r\n // Pause and mute video in preparation for removing the element from the document.\r\n pause(video) {\r\n if (video.nodeName !== 'VIDEO') { return; }\r\n video.pause();\r\n $.off(video, 'volumechange', Volume.change);\r\n return video.muted = true;\r\n },\r\n\r\n rewind(el) {\r\n if (el.nodeName === 'VIDEO') {\r\n if (el.readyState >= el.HAVE_METADATA) { return el.currentTime = 0; }\r\n } else if (/\\.gif$/.test(el.src)) {\r\n return $.queueTask(() => el.src = el.src);\r\n }\r\n },\r\n\r\n pushCache(el) {\r\n ImageCommon.cache = el;\r\n return $.on(el, 'error', ImageCommon.cacheError);\r\n },\r\n\r\n popCache() {\r\n const el = ImageCommon.cache;\r\n $.off(el, 'error', ImageCommon.cacheError);\r\n delete ImageCommon.cache;\r\n return el;\r\n },\r\n\r\n cacheError() {\r\n if (ImageCommon.cache === this) { return delete ImageCommon.cache; }\r\n },\r\n\r\n decodeError(file, fileObj) {\r\n let message;\r\n if (file.error?.code !== MediaError.MEDIA_ERR_DECODE) { return false; }\r\n if (!(message = $('.warning', fileObj.thumb.parentNode))) {\r\n message = $.el('div', {className: 'warning'});\r\n $.after(fileObj.thumb, message);\r\n }\r\n message.textContent = 'Error: Corrupt or unplayable video';\r\n return true;\r\n },\r\n\r\n isFromArchive(file) {\r\n return (g.SITE.software === 'yotsuba') && !ImageHost.test(file.src.split('/')[2]);\r\n },\r\n\r\n error(file, post, fileObj, delay, cb) {\r\n let timeoutID;\r\n const src = fileObj.url.split('/');\r\n let url = null;\r\n if ((g.SITE.software === 'yotsuba') && Conf['404 Redirect']) {\r\n url = Redirect.to('file', {\r\n boardID: post.board.ID,\r\n filename: src[src.length - 1]\r\n });\r\n }\r\n if (!url || !Redirect.securityCheck(url)) { url = null; }\r\n\r\n if ((post.isDead || fileObj.isDead) && !ImageCommon.isFromArchive(file)) { return cb(url); }\r\n\r\n if (delay != null) { timeoutID = setTimeout((() => cb(url)), delay); }\r\n if (post.isDead || fileObj.isDead) { return; }\r\n const redirect = function() {\r\n if (!ImageCommon.isFromArchive(file)) {\r\n if (delay != null) { clearTimeout(timeoutID); }\r\n return cb(url);\r\n }\r\n };\r\n\r\n const threadJSON = g.SITE.urls.threadJSON?.(post);\r\n if (!threadJSON) { return; }\r\n var parseJSON = function(isArchiveURL) {\r\n let needle, postObj;\r\n if (this.status === 404) {\r\n let archivedThreadJSON;\r\n if (!isArchiveURL && (archivedThreadJSON = g.SITE.urls.archivedThreadJSON?.(post))) {\r\n $.ajax(archivedThreadJSON, {onloadend() { return parseJSON.call(this, true); }});\r\n } else {\r\n post.kill(!post.isClone, fileObj.index);\r\n }\r\n }\r\n if (this.status !== 200) { return redirect(); }\r\n for (postObj of this.response.posts) {\r\n if (postObj.no === post.ID) { break; }\r\n }\r\n if (postObj.no !== post.ID) {\r\n post.kill();\r\n return redirect();\r\n } else if ((needle = fileObj.docIndex, g.SITE.Build.parseJSON(postObj, post.board).filesDeleted.includes(needle))) {\r\n post.kill(true);\r\n return redirect();\r\n } else {\r\n return url = fileObj.url;\r\n }\r\n };\r\n return $.ajax(threadJSON, {onloadend() { return parseJSON.call(this); }});\r\n },\r\n\r\n // Add controls, but not until the mouse is moved over the video.\r\n addControls(video) {\r\n var handler = function() {\r\n $.off(video, 'mouseover', handler);\r\n // Hacky workaround for Firefox forever-loading bug for very short videos\r\n const t = new Date().getTime();\r\n return $.asap((() => ($.engine !== 'gecko') || ((video.readyState >= 3) && (video.currentTime <= Math.max(0.1, (video.duration - 0.5)))) || (new Date().getTime() >= (t + 1000))), () => video.controls = true);\r\n };\r\n return $.on(video, 'mouseover', handler);\r\n },\r\n\r\n // XXX Estimate whether clicks are on the video controls and should be ignored.\r\n onControls(e) {\r\n return (Conf['Show Controls'] && Conf['Click Passthrough'] && (e.target.nodeName === 'VIDEO')) ||\r\n (e.target.controls && ((e.target.getBoundingClientRect().bottom - e.clientY) < 35));\r\n },\r\n\r\n download(e) {\r\n if (this.protocol === 'blob:') { return true; }\r\n e.preventDefault();\r\n const {href, download} = this;\r\n return CrossOrigin.file(href, function(blob) {\r\n if (blob) {\r\n const a = $.el('a', {\r\n href: URL.createObjectURL(blob),\r\n download,\r\n hidden: true\r\n }\r\n );\r\n $.add(d.body, a);\r\n a.click();\r\n return $.rm(a);\r\n } else {\r\n return new Notice('warning', `Could not download ${href}`, 20);\r\n }\r\n });\r\n }\r\n};\r\nexport default ImageCommon;\r\n","import Callbacks from \"../classes/Callbacks\";\r\nimport Config from \"../config/Config\";\r\nimport Get from \"../General/Get\";\r\nimport Header from \"../General/Header\";\r\nimport UI from \"../General/UI\";\r\nimport { Conf, d, doc, g } from \"../globals/globals\";\r\nimport Nav from \"../Miscellaneous/Nav\";\r\nimport $ from \"../platform/$\";\r\nimport { SECOND } from \"../platform/helpers\";\r\nimport ImageCommon from \"./ImageCommon\";\r\nimport Volume from \"./Volume\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS101: Remove unnecessary use of Array.from\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar ImageExpand = {\r\n init() {\r\n if (!(this.enabled = Conf['Image Expansion'] && ['index', 'thread'].includes(g.VIEW))) { return; }\r\n\r\n this.EAI = $.el('a', {\r\n className: 'expand-all-shortcut',\r\n textContent: '➕︎',\r\n title: 'Expand All Images',\r\n href: 'javascript:;'\r\n }\r\n );\r\n\r\n $.on(this.EAI, 'click', this.cb.toggleAll);\r\n Header.addShortcut('expand-all', this.EAI, 520);\r\n $.on(d, 'scroll visibilitychange', this.cb.playVideos);\r\n this.videoControls = $.el('span', {className: 'video-controls'});\r\n $.extend(this.videoControls, {innerHTML: \" contract\"});\r\n\r\n return Callbacks.Post.push({\r\n name: 'Image Expansion',\r\n cb: this.node\r\n });\r\n },\r\n\r\n node() {\r\n if (!this.file || (!this.file.isImage && !this.file.isVideo)) { return; }\r\n $.on(this.file.thumbLink, 'click', ImageExpand.cb.toggle);\r\n\r\n if (this.isClone) {\r\n if (this.file.isExpanding) {\r\n // If we clone a post where the image is still loading,\r\n // make it loading in the clone too.\r\n ImageExpand.contract(this);\r\n return ImageExpand.expand(this);\r\n\r\n } else if (this.file.isExpanded && this.file.isVideo) {\r\n Volume.setup(this.file.fullImage);\r\n ImageExpand.setupVideoCB(this);\r\n return ImageExpand.setupVideo(this, !this.origin.file.fullImage?.paused || this.origin.file.wasPlaying, this.file.fullImage.controls);\r\n }\r\n\r\n } else if (ImageExpand.on && !this.isHidden && !this.isFetchedQuote &&\r\n (Conf['Expand spoilers'] || !this.file.isSpoiler) &&\r\n (Conf['Expand videos'] || !this.file.isVideo)) {\r\n return ImageExpand.expand(this);\r\n }\r\n },\r\n\r\n cb: {\r\n toggle(e) {\r\n if ($.modifiedClick(e)) { return; }\r\n const post = Get.postFromNode(this);\r\n const {file} = post;\r\n if (file.isExpanded && ImageCommon.onControls(e)) { return; }\r\n e.preventDefault();\r\n if (!Conf['Autoplay'] && file.fullImage?.paused) {\r\n return file.fullImage.play();\r\n } else {\r\n return ImageExpand.toggle(post);\r\n }\r\n },\r\n\r\n toggleAll() {\r\n let func;\r\n $.event('CloseMenu');\r\n const threadRoot = Nav.getThread();\r\n const toggle = function(post) {\r\n const {file} = post;\r\n if (!file || (!file.isImage && !file.isVideo) || !doc.contains(post.nodes.root)) { return; }\r\n if (ImageExpand.on &&\r\n ((!Conf['Expand spoilers'] && file.isSpoiler) ||\r\n (!Conf['Expand videos'] && file.isVideo) ||\r\n (Conf['Expand from here'] && (Header.getTopOf(file.thumb) < 0)) ||\r\n (Conf['Expand thread only'] && (g.VIEW === 'index') && !threadRoot?.contains(file.thumb)))) {\r\n return;\r\n }\r\n return $.queueTask(func, post);\r\n };\r\n\r\n if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) {\r\n ImageExpand.EAI.className = 'contract-all-shortcut';\r\n ImageExpand.EAI.title = 'Contract All Images';\r\n ImageExpand.EAI.textContent = '➖︎';\r\n func = ImageExpand.expand;\r\n } else {\r\n ImageExpand.EAI.className = 'expand-all-shortcut';\r\n ImageExpand.EAI.title = 'Expand All Images';\r\n ImageExpand.EAI.textContent = '➕︎';\r\n func = ImageExpand.contract;\r\n }\r\n\r\n return g.posts.forEach(function(post) {\r\n for (post of [post, ...Array.from(post.clones)]) { toggle(post); }\r\n });\r\n },\r\n\r\n playVideos() {\r\n return g.posts.forEach(function(post) {\r\n for (post of [post, ...Array.from(post.clones)]) {\r\n var {file} = post;\r\n if (!file || !file.isVideo || !file.isExpanded) { continue; }\r\n\r\n var video = file.fullImage;\r\n var visible = ($.hasAudio(video) && !video.muted) || Header.isNodeVisible(video);\r\n if (visible && file.wasPlaying) {\r\n delete file.wasPlaying;\r\n video.play();\r\n } else if (!visible && !video.paused) {\r\n file.wasPlaying = true;\r\n video.pause();\r\n }\r\n }\r\n });\r\n },\r\n\r\n setFitness() {\r\n return $[this.checked ? 'addClass' : 'rmClass'](doc, this.name.toLowerCase().replace(/\\s+/g, '-'));\r\n }\r\n },\r\n\r\n toggle(post) {\r\n if (!post.file.isExpanding && !post.file.isExpanded) {\r\n post.file.scrollIntoView = Conf['Scroll into view'];\r\n ImageExpand.expand(post);\r\n return;\r\n }\r\n\r\n ImageExpand.contract(post);\r\n\r\n if (Conf['Advance on contract']) {\r\n let next = post.nodes.root;\r\n while ((next = $.x(\"following::div[contains(@class,'postContainer')][1]\", next))) {\r\n if (!$('.stub', next) && (next.offsetHeight !== 0)) { break; }\r\n }\r\n if (next) {\r\n return Header.scrollTo(next);\r\n }\r\n }\r\n },\r\n\r\n contract(post) {\r\n let bottom, el, oldHeight, scrollY;\r\n const {file} = post;\r\n\r\n if (el = file.fullImage) {\r\n const top = Header.getTopOf(el);\r\n bottom = top + el.getBoundingClientRect().height;\r\n oldHeight = d.body.clientHeight;\r\n ({scrollY} = window);\r\n }\r\n\r\n $.rmClass(post.nodes.root, 'expanded-image');\r\n $.rmClass(file.thumb, 'expanding');\r\n $.rm(file.videoControls);\r\n file.thumbLink.href = file.url;\r\n file.thumbLink.target = '_blank';\r\n for (var x of ['isExpanding', 'isExpanded', 'videoControls', 'wasPlaying', 'scrollIntoView']) {\r\n delete file[x];\r\n }\r\n\r\n if (!el) { return; }\r\n\r\n if (doc.contains(el)) {\r\n if (bottom <= 0) {\r\n // For images entirely above us, scroll to remain in place.\r\n window.scrollBy(0, ((scrollY - window.scrollY) + d.body.clientHeight) - oldHeight);\r\n } else {\r\n // For images not above us that would be moved above us, scroll to the thumbnail.\r\n Header.scrollToIfNeeded(post.nodes.root);\r\n }\r\n if (window.scrollX > 0) {\r\n // If we have scrolled right viewing an expanded image, return to the left.\r\n window.scrollBy(-window.scrollX, 0);\r\n }\r\n }\r\n\r\n $.off(el, 'error', ImageExpand.error);\r\n ImageCommon.pushCache(el);\r\n if (file.isVideo) {\r\n ImageCommon.pause(el);\r\n for (var eventName in ImageExpand.videoCB) {\r\n var cb = ImageExpand.videoCB[eventName];\r\n $.off(el, eventName, cb);\r\n }\r\n }\r\n if (Conf['Restart when Opened']) { ImageCommon.rewind(file.thumb); }\r\n delete file.fullImage;\r\n return $.queueTask(function() {\r\n // XXX Work around Chrome/Chromium not firing mouseover on the thumbnail.\r\n if (file.isExpanding || file.isExpanded) { return; }\r\n $.rmClass(el, 'full-image');\r\n if (el.id) { return; }\r\n return $.rm(el);\r\n });\r\n },\r\n\r\n expand(post, src) {\r\n // Do not expand images of hidden/filtered replies, or already expanded pictures.\r\n let el;\r\n const {file} = post;\r\n const {thumb, thumbLink, isVideo} = file;\r\n if (post.isHidden || file.isExpanding || file.isExpanded) { return; }\r\n\r\n $.addClass(thumb, 'expanding');\r\n file.isExpanding = true;\r\n\r\n if (file.fullImage) {\r\n el = file.fullImage;\r\n } else if (ImageCommon.cache?.dataset.fileID === `${post.fullID}.${file.index}`) {\r\n el = (file.fullImage = ImageCommon.popCache());\r\n $.on(el, 'error', ImageExpand.error);\r\n if (Conf['Restart when Opened'] && (el.id !== 'ihover')) { ImageCommon.rewind(el); }\r\n el.removeAttribute('id');\r\n } else {\r\n el = (file.fullImage = $.el((isVideo ? 'video' : 'img')));\r\n el.dataset.fileID = `${post.fullID}.${file.index}`;\r\n $.on(el, 'error', ImageExpand.error);\r\n el.src = src || file.url;\r\n }\r\n\r\n el.className = 'full-image';\r\n $.after(thumb, el);\r\n\r\n if (isVideo) {\r\n // add contract link to file info\r\n if (!file.videoControls) {\r\n file.videoControls = ImageExpand.videoControls.cloneNode(true);\r\n $.add(file.text, file.videoControls);\r\n }\r\n\r\n // disable link to file so native controls can work\r\n thumbLink.removeAttribute('href');\r\n thumbLink.removeAttribute('target');\r\n\r\n el.loop = true;\r\n Volume.setup(el);\r\n ImageExpand.setupVideoCB(post);\r\n }\r\n\r\n if (!isVideo) {\r\n return $.asap((() => el.naturalHeight), () => ImageExpand.completeExpand(post));\r\n } else if (el.readyState >= el.HAVE_METADATA) {\r\n return ImageExpand.completeExpand(post);\r\n } else {\r\n return $.on(el, 'loadedmetadata', () => ImageExpand.completeExpand(post));\r\n }\r\n },\r\n\r\n completeExpand(post) {\r\n const {file} = post;\r\n if (!file.isExpanding) { return; } // contracted before the image loaded\r\n\r\n const bottom = Header.getTopOf(file.thumb) + file.thumb.getBoundingClientRect().height;\r\n const oldHeight = d.body.clientHeight;\r\n const {scrollY} = window;\r\n\r\n $.addClass(post.nodes.root, 'expanded-image');\r\n $.rmClass(file.thumb, 'expanding');\r\n file.isExpanded = true;\r\n delete file.isExpanding;\r\n\r\n // Scroll to keep our place in the thread when images are expanded above us.\r\n if (doc.contains(post.nodes.root) && (bottom <= 0)) {\r\n window.scrollBy(0, ((scrollY - window.scrollY) + d.body.clientHeight) - oldHeight);\r\n }\r\n\r\n // Scroll to display full image.\r\n if (file.scrollIntoView) {\r\n delete file.scrollIntoView;\r\n const imageBottom = Math.min(doc.clientHeight - file.fullImage.getBoundingClientRect().bottom - 25, Header.getBottomOf(file.fullImage));\r\n if (imageBottom < 0) {\r\n window.scrollBy(0, Math.min(-imageBottom, Header.getTopOf(file.fullImage)));\r\n }\r\n }\r\n\r\n if (file.isVideo) {\r\n return ImageExpand.setupVideo(post, Conf['Autoplay'], Conf['Show Controls']);\r\n }\r\n },\r\n\r\n setupVideo(post, playing, controls) {\r\n const {fullImage} = post.file;\r\n if (!playing) {\r\n fullImage.controls = controls;\r\n return;\r\n }\r\n fullImage.controls = false;\r\n $.asap((() => doc.contains(fullImage)), function() {\r\n if (!d.hidden && Header.isNodeVisible(fullImage)) {\r\n return fullImage.play();\r\n } else {\r\n return post.file.wasPlaying = true;\r\n }\r\n });\r\n if (controls) {\r\n return ImageCommon.addControls(fullImage);\r\n }\r\n },\r\n\r\n videoCB: (function() {\r\n // dragging to the left contracts the video\r\n let mousedown = false;\r\n return {\r\n mouseover() { return mousedown = false; },\r\n mousedown(e) { if (e.button === 0) { return mousedown = true; } },\r\n mouseup(e) { if (e.button === 0) { return mousedown = false; } },\r\n mouseout(e) { if (((e.buttons & 1) || mousedown) && (e.clientX <= this.getBoundingClientRect().left)) { return ImageExpand.toggle(Get.postFromNode(this)); } }\r\n };\r\n })(),\r\n\r\n setupVideoCB(post) {\r\n for (var eventName in ImageExpand.videoCB) {\r\n var cb = ImageExpand.videoCB[eventName];\r\n $.on(post.file.fullImage, eventName, cb);\r\n }\r\n if (post.file.videoControls) {\r\n return $.on(post.file.videoControls.firstElementChild, 'click', () => ImageExpand.toggle(post));\r\n }\r\n },\r\n\r\n error() {\r\n const post = Get.postFromNode(this);\r\n $.rm(this);\r\n delete post.file.fullImage;\r\n // Images can error:\r\n // - before the image started loading.\r\n // - after the image started loading.\r\n // Don't try to re-expand if it was already contracted.\r\n if (!post.file.isExpanding && !post.file.isExpanded) { return; }\r\n if (ImageCommon.decodeError(this, post.file)) {\r\n return ImageExpand.contract(post);\r\n }\r\n // Don't autoretry images from the archive.\r\n if (ImageCommon.isFromArchive(this)) {\r\n return ImageExpand.contract(post);\r\n }\r\n return ImageCommon.error(this, post, post.file, 10 * SECOND, function(URL) {\r\n if (post.file.isExpanding || post.file.isExpanded) {\r\n ImageExpand.contract(post);\r\n if (URL) { return ImageExpand.expand(post, URL); }\r\n }\r\n });\r\n },\r\n\r\n menu: {\r\n init() {\r\n if (!ImageExpand.enabled) { return; }\r\n\r\n const el = $.el('span', {\r\n textContent: 'Image Expansion',\r\n className: 'image-expansion-link'\r\n }\r\n );\r\n\r\n const {createSubEntry} = ImageExpand.menu;\r\n const subEntries = [];\r\n for (var name in Config.imageExpansion) {\r\n var conf = Config.imageExpansion[name];\r\n subEntries.push(createSubEntry(name, conf[1]));\r\n }\r\n\r\n return Header.menu.addEntry({\r\n el,\r\n order: 105,\r\n subEntries\r\n });\r\n },\r\n\r\n createSubEntry(name, desc) {\r\n const label = UI.checkbox(name, name);\r\n label.title = desc;\r\n const input = label.firstElementChild;\r\n if (['Fit width', 'Fit height'].includes(name)) {\r\n $.on(input, 'change', ImageExpand.cb.setFitness);\r\n }\r\n $.event('change', null, input);\r\n $.on(input, 'change', $.cb.checked);\r\n return {el: label};\r\n }\r\n }\r\n};\r\nexport default ImageExpand;\r\n",null,"import Callbacks from \"../classes/Callbacks\";\r\nimport UI from \"../General/UI\";\r\nimport { g, Conf } from \"../globals/globals\";\r\nimport $ from \"../platform/$\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar Menu = {\r\n init() {\r\n if (!['index', 'thread'].includes(g.VIEW) || !Conf['Menu']) { return; }\r\n\r\n this.button = $.el('a', {\r\n className: 'menu-button',\r\n href: 'javascript:;'\r\n }\r\n );\r\n\r\n $.extend(this.button, {textContent: \"🞃\"});\r\n\r\n this.menu = new UI.Menu('post');\r\n Callbacks.Post.push({\r\n name: 'Menu',\r\n cb: this.node\r\n });\r\n\r\n return Callbacks.CatalogThread.push({\r\n name: 'Menu',\r\n cb: this.catalogNode\r\n });\r\n },\r\n\r\n node() {\r\n if (this.isClone) {\r\n const button = $('.menu-button', this.nodes.info);\r\n $.rmClass(button, 'active');\r\n $.rm($('.dialog', this.nodes.info));\r\n Menu.makeButton(this, button);\r\n return;\r\n }\r\n return $.add(this.nodes.info, Menu.makeButton(this));\r\n },\r\n\r\n catalogNode() {\r\n return $.after(this.nodes.icons, Menu.makeButton(this.thread.OP));\r\n },\r\n\r\n makeButton(post, button) {\r\n if (!button) { button = Menu.button.cloneNode(true); }\r\n $.on(button, 'click', function(e) {\r\n return Menu.menu.toggle(e, this, post);\r\n });\r\n return button;\r\n }\r\n};\r\nexport default Menu;\r\n","import Callbacks from \"../classes/Callbacks\";\r\nimport { g } from \"../globals/globals\";\r\nimport { dict } from \"../platform/helpers\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS101: Remove unnecessary use of Array.from\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar Recursive = {\r\n recursives: dict(),\r\n init() {\r\n if (!['index', 'thread'].includes(g.VIEW)) { return; }\r\n return Callbacks.Post.push({\r\n name: 'Recursive',\r\n cb: this.node\r\n });\r\n },\r\n\r\n node() {\r\n if (this.isClone || this.isFetchedQuote) { return; }\r\n for (var quote of this.quotes) {\r\n var obj;\r\n if ((obj = Recursive.recursives[quote])) {\r\n for (var i = 0; i < obj.recursives.length; i++) {\r\n var recursive = obj.recursives[i];\r\n recursive(this, ...Array.from(obj.args[i]));\r\n }\r\n }\r\n }\r\n },\r\n\r\n add(recursive, post, ...args) {\r\n const obj = Recursive.recursives[post.fullID] || (Recursive.recursives[post.fullID] = {\r\n recursives: [],\r\n args: []\r\n });\r\n obj.recursives.push(recursive);\r\n return obj.args.push(args);\r\n },\r\n\r\n rm(recursive, post) {\r\n let obj;\r\n if (!(obj = Recursive.recursives[post.fullID])) { return; }\r\n for (let i = 0; i < obj.recursives.length; i++) {\r\n var rec = obj.recursives[i];\r\n if (rec === recursive) {\r\n obj.recursives.splice(i, 1);\r\n obj.args.splice(i, 1);\r\n }\r\n }\r\n },\r\n\r\n apply(recursive, post, ...args) {\r\n const {fullID} = post;\r\n return g.posts.forEach(function(post) {\r\n if (post.quotes.includes(fullID)) {\r\n return recursive(post, ...Array.from(args));\r\n }\r\n });\r\n }\r\n};\r\nexport default Recursive;\r\n","import Callbacks from \"../classes/Callbacks\";\r\nimport DataBoard from \"../classes/DataBoard\";\r\nimport Get from \"../General/Get\";\r\nimport UI from \"../General/UI\";\r\nimport { g, Conf, doc } from \"../globals/globals\";\r\nimport Menu from \"../Menu/Menu\";\r\nimport $ from \"../platform/$\";\r\nimport Recursive from \"./Recursive\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * DS207: Consider shorter variations of null checks\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar PostHiding = {\r\n init() {\r\n if (!['index', 'thread'].includes(g.VIEW) || (!Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link']))) { return; }\r\n\r\n if (Conf['Reply Hiding Buttons']) {\r\n $.addClass(doc, \"reply-hide\");\r\n }\r\n\r\n this.db = new DataBoard('hiddenPosts');\r\n return Callbacks.Post.push({\r\n name: 'Reply Hiding',\r\n cb: this.node\r\n });\r\n },\r\n\r\n isHidden(boardID, threadID, postID) {\r\n return !!(PostHiding.db && PostHiding.db.get({boardID, threadID, postID}));\r\n },\r\n\r\n node() {\r\n let data, sa;\r\n if (!this.isReply || this.isClone || this.isFetchedQuote) { return; }\r\n\r\n if (data = PostHiding.db.get({boardID: this.board.ID, threadID: this.thread.ID, postID: this.ID})) {\r\n if (data.thisPost) {\r\n PostHiding.hide(this, data.makeStub, data.hideRecursively);\r\n } else {\r\n Recursive.apply(PostHiding.hide, this, data.makeStub, true);\r\n Recursive.add(PostHiding.hide, this, data.makeStub, true);\r\n }\r\n }\r\n\r\n if (!Conf['Reply Hiding Buttons']) { return; }\r\n\r\n const button = PostHiding.makeButton(this, 'hide');\r\n if (sa = g.SITE.selectors.sideArrows) {\r\n const sideArrows = $(sa, this.nodes.root);\r\n $.replace(sideArrows.firstChild, button);\r\n return sideArrows.className = 'replacedSideArrows';\r\n } else {\r\n return $.prepend(this.nodes.info, button);\r\n }\r\n },\r\n\r\n menu: {\r\n init() {\r\n if (!['index', 'thread'].includes(g.VIEW) || !Conf['Menu'] || !Conf['Reply Hiding Link']) { return; }\r\n\r\n // Hide\r\n let div = $.el('div', {\r\n className: 'hide-reply-link',\r\n textContent: 'Hide'\r\n }\r\n );\r\n\r\n let apply = $.el('a', {\r\n textContent: 'Apply',\r\n href: 'javascript:;'\r\n }\r\n );\r\n $.on(apply, 'click', PostHiding.menu.hide);\r\n\r\n let thisPost = UI.checkbox('thisPost', 'This post', true);\r\n let replies = UI.checkbox('replies', 'Hide replies', Conf['Recursive Hiding']);\r\n const makeStub = UI.checkbox('makeStub', 'Make stub', Conf['Stubs']);\r\n\r\n Menu.menu.addEntry({\r\n el: div,\r\n order: 20,\r\n open(post) {\r\n if (!post.isReply || post.isClone || post.isHidden) {\r\n return false;\r\n }\r\n PostHiding.menu.post = post;\r\n return true;\r\n },\r\n subEntries: [\r\n {el: apply}\r\n ,\r\n {el: thisPost}\r\n ,\r\n {el: replies}\r\n ,\r\n {el: makeStub}\r\n ]});\r\n\r\n // Show\r\n div = $.el('div', {\r\n className: 'show-reply-link',\r\n textContent: 'Show'\r\n }\r\n );\r\n\r\n apply = $.el('a', {\r\n textContent: 'Apply',\r\n href: 'javascript:;'\r\n }\r\n );\r\n $.on(apply, 'click', PostHiding.menu.show);\r\n\r\n thisPost = UI.checkbox('thisPost', 'This post', false);\r\n replies = UI.checkbox('replies', 'Show replies', false);\r\n const hideStubLink = $.el('a', {\r\n textContent: 'Hide stub',\r\n href: 'javascript:;'\r\n }\r\n );\r\n $.on(hideStubLink, 'click', PostHiding.menu.hideStub);\r\n\r\n Menu.menu.addEntry({\r\n el: div,\r\n order: 20,\r\n open(post) {\r\n let data;\r\n if (!post.isReply || post.isClone || !post.isHidden) {\r\n return false;\r\n }\r\n if (!(data = PostHiding.db.get({boardID: post.board.ID, threadID: post.thread.ID, postID: post.ID}))) {\r\n return false;\r\n }\r\n PostHiding.menu.post = post;\r\n thisPost.firstChild.checked = post.isHidden;\r\n replies.firstChild.checked = (data?.hideRecursively != null) ? data.hideRecursively : Conf['Recursive Hiding'];\r\n return true;\r\n },\r\n subEntries: [\r\n {el: apply}\r\n ,\r\n {el: thisPost}\r\n ,\r\n {el: replies}\r\n ]});\r\n\r\n return Menu.menu.addEntry({\r\n el: hideStubLink,\r\n order: 15,\r\n open(post) {\r\n let data;\r\n if (!post.isReply || post.isClone || !post.isHidden) {\r\n return false;\r\n }\r\n if (!(data = PostHiding.db.get({boardID: post.board.ID, threadID: post.thread.ID, postID: post.ID}))) {\r\n return false;\r\n }\r\n return PostHiding.menu.post = post;\r\n }\r\n });\r\n },\r\n\r\n hide() {\r\n const parent = this.parentNode;\r\n const thisPost = $('input[name=thisPost]', parent).checked;\r\n const replies = $('input[name=replies]', parent).checked;\r\n const makeStub = $('input[name=makeStub]', parent).checked;\r\n const {post} = PostHiding.menu;\r\n if (thisPost) {\r\n PostHiding.hide(post, makeStub, replies);\r\n } else if (replies) {\r\n Recursive.apply(PostHiding.hide, post, makeStub, true);\r\n Recursive.add(PostHiding.hide, post, makeStub, true);\r\n } else {\r\n return;\r\n }\r\n PostHiding.saveHiddenState(post, true, thisPost, makeStub, replies);\r\n return $.event('CloseMenu');\r\n },\r\n\r\n show() {\r\n let data;\r\n const parent = this.parentNode;\r\n const thisPost = $('input[name=thisPost]', parent).checked;\r\n const replies = $('input[name=replies]', parent).checked;\r\n const {post} = PostHiding.menu;\r\n if (thisPost) {\r\n PostHiding.show(post, replies);\r\n } else if (replies) {\r\n Recursive.apply(PostHiding.show, post, true);\r\n Recursive.rm(PostHiding.hide, post, true);\r\n } else {\r\n return;\r\n }\r\n if (data = PostHiding.db.get({boardID: post.board.ID, threadID: post.thread.ID, postID: post.ID})) {\r\n PostHiding.saveHiddenState(post, !(thisPost && replies), !thisPost, data.makeStub, !replies);\r\n }\r\n return $.event('CloseMenu');\r\n },\r\n hideStub() {\r\n let data;\r\n const {post} = PostHiding.menu;\r\n if (data = PostHiding.db.get({boardID: post.board.ID, threadID: post.thread.ID, postID: post.ID})) {\r\n PostHiding.show(post, data.hideRecursively);\r\n PostHiding.hide(post, false, data.hideRecursively);\r\n PostHiding.saveHiddenState(post, true, true, false, data.hideRecursively);\r\n }\r\n $.event('CloseMenu');\r\n }\r\n },\r\n\r\n makeButton(post, type) {\r\n const span = $.el('span', {\r\n textContent: type === 'hide' ? '➖︎' : '➕︎',\r\n });\r\n const a = $.el('a', {\r\n className: `${type}-reply-button`,\r\n href: 'javascript:;'\r\n }\r\n );\r\n $.add(a, span);\r\n $.on(a, 'click', PostHiding.toggle);\r\n return a;\r\n },\r\n\r\n saveHiddenState(post, isHiding, thisPost, makeStub, hideRecursively) {\r\n const data = {\r\n boardID: post.board.ID,\r\n threadID: post.thread.ID,\r\n postID: post.ID\r\n };\r\n if (isHiding) {\r\n data.val = {\r\n thisPost: thisPost !== false, // undefined -> true\r\n makeStub,\r\n hideRecursively\r\n };\r\n return PostHiding.db.set(data);\r\n } else {\r\n return PostHiding.db.delete(data);\r\n }\r\n },\r\n\r\n toggle() {\r\n const post = Get.postFromNode(this);\r\n PostHiding[(post.isHidden ? 'show' : 'hide')](post);\r\n return PostHiding.saveHiddenState(post, post.isHidden);\r\n },\r\n\r\n hide(post, makeStub=Conf['Stubs'], hideRecursively=Conf['Recursive Hiding']) {\r\n if (post.isHidden) { return; }\r\n post.isHidden = true;\r\n\r\n if (hideRecursively) {\r\n Recursive.apply(PostHiding.hide, post, makeStub, true);\r\n Recursive.add(PostHiding.hide, post, makeStub, true);\r\n }\r\n\r\n for (var quotelink of Get.allQuotelinksLinkingTo(post)) {\r\n $.addClass(quotelink, 'filtered');\r\n }\r\n\r\n if (!makeStub) {\r\n post.nodes.root.hidden = true;\r\n return;\r\n }\r\n\r\n const a = PostHiding.makeButton(post, 'show');\r\n $.add(a, $.tn(` ${post.info.nameBlock}`));\r\n post.nodes.stub = $.el('div',\r\n {className: 'stub'});\r\n $.add(post.nodes.stub, a);\r\n if (Conf['Menu']) {\r\n $.add(post.nodes.stub, Menu.makeButton(post));\r\n }\r\n return $.prepend(post.nodes.root, post.nodes.stub);\r\n },\r\n\r\n show(post, showRecursively=Conf['Recursive Hiding']) {\r\n if (post.nodes.stub) {\r\n $.rm(post.nodes.stub);\r\n delete post.nodes.stub;\r\n } else {\r\n post.nodes.root.hidden = false;\r\n }\r\n post.isHidden = false;\r\n if (showRecursively) {\r\n Recursive.apply(PostHiding.show, post, true);\r\n Recursive.rm(PostHiding.hide, post);\r\n }\r\n for (var quotelink of Get.allQuotelinksLinkingTo(post)) {\r\n $.rmClass(quotelink, 'filtered');\r\n }\r\n }\r\n};\r\nexport default PostHiding;\r\n","import Callbacks from \"../classes/Callbacks\";\r\nimport Post from \"../classes/Post\";\r\nimport Index from \"../General/Index\";\r\nimport { g, Conf, d, doc } from \"../globals/globals\";\r\nimport $ from \"../platform/$\";\r\nimport { DAY, HOUR, MINUTE, SECOND } from \"../platform/helpers\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * DS205: Consider reworking code to avoid use of IIFEs\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar RelativeDates = {\r\n INTERVAL: 30000,\r\n\r\n init() {\r\n if (\r\n (['index', 'thread', 'archive'].includes(g.VIEW) && Conf['Relative Post Dates'] && !Conf['Relative Date Title']) ||\r\n Index.enabled\r\n ) {\r\n this.flush();\r\n $.on(d, 'visibilitychange PostsInserted', this.flush);\r\n }\r\n\r\n if (Conf['Relative Post Dates']) {\r\n return Callbacks.Post.push({\r\n name: 'Relative Post Dates',\r\n cb: this.node\r\n });\r\n }\r\n },\r\n\r\n node() {\r\n if (!this.info.date) { return; }\r\n const dateEl = this.nodes.date;\r\n if (Conf['Relative Date Title']) {\r\n $.on(dateEl, 'mouseover', () => RelativeDates.hover(this));\r\n return;\r\n }\r\n if (this.isClone) { return; }\r\n\r\n // Show original absolute time as tooltip so users can still know exact times\r\n // Since \"Time Formatting\" runs its `node` before us, the title tooltip will\r\n // pick up the user-formatted time instead of 4chan time when enabled.\r\n dateEl.title = dateEl.textContent;\r\n\r\n return RelativeDates.update(this);\r\n },\r\n\r\n // diff is milliseconds from now.\r\n relative(diff, now, date, abbrev) {\r\n let number;\r\n let unit = (() => {\r\n if ((number = (diff / DAY)) >= 1) {\r\n const years = now.getFullYear() - date.getFullYear();\r\n let months = now.getMonth() - date.getMonth();\r\n const days = now.getDate() - date.getDate();\r\n if (years > 1) {\r\n number = years - ((months < 0) || ((months === 0) && (days < 0)));\r\n return 'year';\r\n } else if ((years === 1) && ((months > 0) || ((months === 0) && (days >= 0)))) {\r\n number = years;\r\n return 'year';\r\n } else if ((months = months + (12*years)) > 1) {\r\n number = months - (days < 0);\r\n return 'month';\r\n } else if ((months === 1) && (days >= 0)) {\r\n number = months;\r\n return 'month';\r\n } else {\r\n return 'day';\r\n }\r\n } else if ((number = (diff / HOUR)) >= 1) {\r\n return 'hour';\r\n } else if ((number = (diff / MINUTE)) >= 1) {\r\n return 'minute';\r\n } else {\r\n // prevent \"-1 seconds ago\"\r\n number = Math.max(0, diff) / SECOND;\r\n return 'second';\r\n }\r\n })();\r\n\r\n const rounded = Math.round(number);\r\n\r\n if (abbrev) {\r\n unit = unit === 'month' ? 'mo' : unit[0];\r\n } else {\r\n if (rounded !== 1) { unit += 's'; } // pluralize\r\n }\r\n\r\n if (abbrev) { return `${rounded}${unit}`; } else { return `${rounded} ${unit} ago`; }\r\n },\r\n\r\n // Changing all relative dates as soon as possible incurs many annoying\r\n // redraws and scroll stuttering. Thus, sacrifice accuracy for UX/CPU economy,\r\n // and perform redraws when the DOM is otherwise being manipulated (and scroll\r\n // stuttering won't be noticed), falling back to INTERVAL while the page\r\n // is visible.\r\n //\r\n // Each individual dateTime element will add its update() function to the stale list\r\n // when it is to be called.\r\n stale: [],\r\n flush() {\r\n // No point in changing the dates until the user sees them.\r\n if (d.hidden) { return; }\r\n\r\n const now = new Date();\r\n for (var data of RelativeDates.stale) { RelativeDates.update(data, now); }\r\n RelativeDates.stale = [];\r\n\r\n // Reset automatic flush.\r\n clearTimeout(RelativeDates.timeout);\r\n return RelativeDates.timeout = setTimeout(RelativeDates.flush, RelativeDates.INTERVAL);\r\n },\r\n\r\n hover(post) {\r\n const {\r\n date\r\n } = post.info;\r\n const now = new Date();\r\n const diff = now - date;\r\n return post.nodes.date.title = RelativeDates.relative(diff, now, date);\r\n },\r\n\r\n // `update()`, when called from `flush()`, updates the elements,\r\n // and re-calls `setOwnTimeout()` to re-add `data` to the stale list later.\r\n update(data, now) {\r\n let abbrev, date;\r\n const isPost = data instanceof Post;\r\n if (isPost) {\r\n ({\r\n date\r\n } = data.info);\r\n abbrev = false;\r\n } else {\r\n date = new Date(+data.dataset.utc);\r\n abbrev = !!data.dataset.abbrev;\r\n }\r\n if (!now) { now = new Date(); }\r\n const diff = now - date;\r\n const relative = RelativeDates.relative(diff, now, date, abbrev);\r\n if (isPost) {\r\n for (var singlePost of [data].concat(data.clones)) {\r\n singlePost.nodes.date.firstChild.textContent = relative;\r\n }\r\n } else {\r\n data.firstChild.textContent = relative;\r\n }\r\n return RelativeDates.setOwnTimeout(diff, data);\r\n },\r\n\r\n setOwnTimeout(diff, data) {\r\n const delay = diff < MINUTE ?\r\n SECOND - ((diff + (SECOND / 2)) % SECOND)\r\n : diff < HOUR ?\r\n MINUTE - ((diff + (MINUTE / 2)) % MINUTE)\r\n : diff < DAY ?\r\n HOUR - ((diff + (HOUR / 2)) % HOUR)\r\n :\r\n DAY - ((diff + (DAY / 2)) % DAY);\r\n return setTimeout(RelativeDates.markStale, delay, data);\r\n },\r\n\r\n markStale(data) {\r\n if (RelativeDates.stale.includes(data)) { return; } // We can call RelativeDates.update() multiple times.\r\n if (data instanceof Post && !g.posts.get(data.fullID)) { return; } // collected post.\r\n if (data instanceof Element && !doc.contains(data)) { return; } // removed catalog reply.\r\n return RelativeDates.stale.push(data);\r\n }\r\n};\r\nexport default RelativeDates;\r\n","import Notice from \"../classes/Notice\";\r\nimport { g, Conf } from \"../globals/globals\";\r\nimport $ from \"../platform/$\";\r\nimport { dict, HOUR } from \"../platform/helpers\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * DS104: Avoid inline assignments\r\n * DS205: Consider reworking code to avoid use of IIFEs\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar BoardConfig = {\r\n cbs: [],\r\n\r\n init() {\r\n let middle;\r\n if (g.SITE.software !== 'yotsuba') { return; }\r\n const now = Date.now();\r\n if (now - (2 * HOUR) >= ((middle = Conf['boardConfig'].lastChecked || 0)) || middle > now) {\r\n return $.ajax(`${location.protocol}//a.4cdn.org/boards.json`,\r\n {onloadend: this.load});\r\n } else {\r\n const {boards} = Conf['boardConfig'];\r\n return this.set(boards);\r\n }\r\n },\r\n\r\n load() {\r\n let boards;\r\n if ((this.status === 200) && this.response && this.response.boards) {\r\n boards = dict();\r\n for (var board of this.response.boards) {\r\n boards[board.board] = board;\r\n }\r\n $.set('boardConfig', {boards, lastChecked: Date.now()});\r\n } else {\r\n ({boards} = Conf['boardConfig']);\r\n const err = (() => { switch (this.status) {\r\n case 0: return 'Connection Error';\r\n case 200: return 'Invalid Data';\r\n default: return `Error ${this.statusText} (${this.status})`;\r\n } })();\r\n new Notice('warning', `Failed to load board configuration. ${err}`, 20);\r\n }\r\n return BoardConfig.set(boards);\r\n },\r\n\r\n set(boards) {\r\n this.boards = boards;\r\n for (var ID in g.boards) {\r\n var board = g.boards[ID];\r\n board.config = this.boards[ID] || {};\r\n }\r\n for (var cb of this.cbs) {\r\n $.queueTask(cb);\r\n }\r\n },\r\n\r\n ready(cb) {\r\n if (this.boards) {\r\n return cb();\r\n } else {\r\n return this.cbs.push(cb);\r\n }\r\n },\r\n\r\n sfwBoards(sfw) {\r\n return (() => {\r\n const result = [];\r\n const object = this.boards || Conf['boardConfig'].boards;\r\n for (var board in object) {\r\n var data = object[board];\r\n if (!!data.ws_board === sfw) {\r\n result.push(board);\r\n }\r\n }\r\n return result;\r\n })();\r\n },\r\n\r\n isSFW(board) {\r\n return !!(this.boards || Conf['boardConfig'].boards)[board]?.ws_board;\r\n },\r\n\r\n domain(board) {\r\n return `boards.${BoardConfig.isSFW(board) ? '4channel' : '4chan'}.org`;\r\n },\r\n\r\n isArchived(board) {\r\n // assume archive exists if no data available to prevent cleaning of archived threads\r\n const data = (this.boards || Conf['boardConfig'].boards)[board];\r\n return !data || data.is_archived;\r\n },\r\n\r\n noAudio(boardID) {\r\n if (g.SITE.software !== 'yotsuba') { return false; }\r\n const boards = this.boards || Conf['boardConfig'].boards;\r\n return boards && boards[boardID] && !boards[boardID].webm_audio;\r\n },\r\n\r\n title(boardID) {\r\n return (this.boards || Conf['boardConfig'].boards)?.[boardID]?.title || '';\r\n }\r\n};\r\nexport default BoardConfig;\r\n","import BoardConfig from \"../General/BoardConfig\";\r\nimport { d, g } from \"../globals/globals\";\r\nimport SimpleDict from \"./SimpleDict\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nexport default class Board {\r\n toString() { return this.ID; }\r\n\r\n constructor(ID) {\r\n this.ID = ID;\r\n this.boardID = this.ID;\r\n this.siteID = g.SITE.ID;\r\n this.threads = new SimpleDict();\r\n this.posts = new SimpleDict();\r\n this.config = BoardConfig.boards?.[this.ID] || {};\r\n\r\n g.boards[this] = this;\r\n }\r\n\r\n cooldowns() {\r\n const c2 = (this.config || {}).cooldowns || {};\r\n const c = {\r\n thread: c2.threads || 0,\r\n reply: c2.replies || 0,\r\n image: c2.images || 0,\r\n thread_global: 300 // inter-board thread cooldown\r\n };\r\n // Pass users have reduced cooldowns.\r\n if (d.cookie.indexOf('pass_enabled=1') >= 0) {\r\n for (var key of ['reply', 'image']) {\r\n c[key] = Math.ceil(c[key] / 2);\r\n }\r\n }\r\n return c;\r\n }\r\n}\r\n","import { d } from \"../globals/globals\";\r\nimport $ from \"../platform/$\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nconst PostRedirect = {\r\n init() {\r\n return $.on(d, 'QRPostSuccessful', e => {\r\n if (!e.detail.redirect) { return; }\r\n this.event = e;\r\n this.delays = 0;\r\n return $.queueTask(() => {\r\n if ((e === this.event) && (this.delays === 0)) {\r\n return location.href = e.detail.redirect;\r\n }\r\n });\r\n });\r\n },\r\n\r\n delays: 0,\r\n\r\n delay() {\r\n if (!this.event) { return null; }\r\n const e = this.event;\r\n this.delays++;\r\n return () => {\r\n if (e !== this.event) { return; }\r\n this.delays--;\r\n if (this.delays === 0) {\r\n return location.href = e.detail.redirect;\r\n }\r\n };\r\n }\r\n};\r\nexport default PostRedirect;\r\n","import Callbacks from \"../classes/Callbacks\";\r\nimport Get from \"../General/Get\";\r\nimport { g, Conf } from \"../globals/globals\";\r\nimport $ from \"../platform/$\";\r\nimport $$ from \"../platform/$$\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar ExpandComment = {\r\n init() {\r\n if ((g.VIEW !== 'index') || !Conf['Comment Expansion'] || Conf['JSON Index']) { return; }\r\n\r\n return Callbacks.Post.push({\r\n name: 'Comment Expansion',\r\n cb: this.node\r\n });\r\n },\r\n\r\n node() {\r\n let a;\r\n if (a = $('.abbr > a:not([onclick])', this.nodes.comment)) {\r\n return $.on(a, 'click', ExpandComment.cb);\r\n }\r\n },\r\n\r\n callbacks: [],\r\n\r\n cb(e) {\r\n e.preventDefault();\r\n return ExpandComment.expand(Get.postFromNode(this));\r\n },\r\n\r\n expand(post) {\r\n let a;\r\n if (post.nodes.longComment && !post.nodes.longComment.parentNode) {\r\n $.replace(post.nodes.shortComment, post.nodes.longComment);\r\n post.nodes.comment = post.nodes.longComment;\r\n return;\r\n }\r\n if (!(a = $('.abbr > a', post.nodes.comment))) { return; }\r\n a.textContent = `Post No.${post} Loading...`;\r\n return $.cache(g.SITE.urls.threadJSON({boardID: post.boardID, threadID: post.threadID}), function() { return ExpandComment.parse(this, a, post); });\r\n },\r\n\r\n contract(post) {\r\n if (!post.nodes.shortComment) { return; }\r\n const a = $('.abbr > a', post.nodes.shortComment);\r\n a.textContent = 'here';\r\n $.replace(post.nodes.longComment, post.nodes.shortComment);\r\n return post.nodes.comment = post.nodes.shortComment;\r\n },\r\n\r\n parse(req, a, post) {\r\n let postObj, spoilerRange;\r\n const {status} = req;\r\n if (![200, 304].includes(status)) {\r\n a.textContent = status ? `Error ${req.statusText} (${status})` : 'Connection Error';\r\n return;\r\n }\r\n\r\n const {\r\n posts\r\n } = req.response;\r\n if (spoilerRange = posts[0].custom_spoiler) {\r\n g.SITE.Build.spoilerRange[g.BOARD] = spoilerRange;\r\n }\r\n\r\n for (postObj of posts) {\r\n if (postObj.no === post.ID) { break; }\r\n }\r\n if (postObj.no !== post.ID) {\r\n a.textContent = `Post No.${post} not found.`;\r\n return;\r\n }\r\n\r\n const {comment} = post.nodes;\r\n const clone = comment.cloneNode(false);\r\n clone.innerHTML = postObj.com;\r\n // Fix pathnames\r\n for (var quote of $$('.quotelink', clone)) {\r\n var href = quote.getAttribute('href');\r\n if (href[0] === '/') { continue; } // Cross-board quote, or board link\r\n if (href[0] === '#') {\r\n quote.href = `${a.pathname.split(/\\/+/).splice(0,4).join('/')}${href}`;\r\n } else {\r\n quote.href = `${a.pathname.split(/\\/+/).splice(0,3).join('/')}/${href}`;\r\n }\r\n }\r\n post.nodes.shortComment = comment;\r\n $.replace(comment, clone);\r\n post.nodes.comment = (post.nodes.longComment = clone);\r\n post.parseComment();\r\n post.parseQuotes();\r\n\r\n for (var callback of ExpandComment.callbacks) {\r\n callback.call(post);\r\n }\r\n }\r\n};\r\nexport default ExpandComment;;\r\n","import Callbacks from \"../classes/Callbacks\";\r\nimport DataBoard from \"../classes/DataBoard\";\r\nimport Notice from \"../classes/Notice\";\r\nimport Get from \"../General/Get\";\r\nimport Header from \"../General/Header\";\r\nimport { Conf, d, doc, g } from \"../globals/globals\";\r\nimport Menu from \"../Menu/Menu\";\r\nimport ExpandComment from \"../Miscellaneous/ExpandComment\";\r\nimport $ from \"../platform/$\";\r\nimport $$ from \"../platform/$$\";\r\nimport PostRedirect from \"../Posting/PostRedirect\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar QuoteYou = {\r\n init() {\r\n if (!Conf['Remember Your Posts']) { return; }\r\n\r\n this.db = new DataBoard('yourPosts');\r\n $.sync('Remember Your Posts', enabled => Conf['Remember Your Posts'] = enabled);\r\n $.on(d, 'QRPostSuccessful', function(e) {\r\n const cb = PostRedirect.delay();\r\n return $.get('Remember Your Posts', Conf['Remember Your Posts'], function(items) {\r\n if (!items['Remember Your Posts']) { return; }\r\n const {boardID, threadID, postID} = e.detail;\r\n return QuoteYou.db.set({boardID, threadID, postID, val: true}, cb);\r\n });\r\n });\r\n\r\n if (!['index', 'thread', 'archive'].includes(g.VIEW)) { return; }\r\n\r\n if (Conf['Highlight Own Posts']) {\r\n $.addClass(doc, 'highlight-own');\r\n }\r\n\r\n if (Conf['Highlight Posts Quoting You']) {\r\n $.addClass(doc, 'highlight-you');\r\n }\r\n\r\n if (Conf['Comment Expansion']) {\r\n ExpandComment.callbacks.push(this.node);\r\n }\r\n\r\n // \\u00A0 is nbsp\r\n this.mark = $.el('span', {\r\n textContent: '\\u00A0(You)',\r\n className: 'qmark-you'\r\n }\r\n );\r\n Callbacks.Post.push({\r\n name: 'Mark Quotes of You',\r\n cb: this.node\r\n });\r\n\r\n return QuoteYou.menu.init();\r\n },\r\n\r\n isYou(post) {\r\n return !!QuoteYou.db?.get({\r\n boardID: post.boardID,\r\n threadID: post.threadID,\r\n postID: post.ID\r\n });\r\n },\r\n\r\n node() {\r\n if (this.isClone) { return; }\r\n\r\n if (QuoteYou.isYou(this)) {\r\n $.addClass(this.nodes.root, 'yourPost');\r\n }\r\n\r\n // Stop there if there's no quotes in that post.\r\n if (!this.quotes.length) { return; }\r\n\r\n for (var quotelink of this.nodes.quotelinks) {\r\n if (QuoteYou.db.get(Get.postDataFromLink(quotelink))) {\r\n if (Conf['Mark Quotes of You']) { $.add(quotelink, QuoteYou.mark.cloneNode(true)); }\r\n $.addClass(quotelink, 'you');\r\n $.addClass(this.nodes.root, 'quotesYou');\r\n }\r\n }\r\n },\r\n\r\n menu: {\r\n init() {\r\n const label = $.el('label',\r\n {className: 'toggle-you'}\r\n ,\r\n {innerHTML: ' You'});\r\n const input = $('input', label);\r\n $.on(input, 'change', QuoteYou.menu.toggle);\r\n return Menu.menu?.addEntry({\r\n el: label,\r\n order: 80,\r\n open(post) {\r\n QuoteYou.menu.post = (post.origin || post);\r\n input.checked = QuoteYou.isYou(post);\r\n return true;\r\n }\r\n });\r\n },\r\n\r\n toggle() {\r\n const {post} = QuoteYou.menu;\r\n const data = {boardID: post.board.ID, threadID: post.thread.ID, postID: post.ID, val: true};\r\n if (this.checked) {\r\n QuoteYou.db.set(data);\r\n } else {\r\n QuoteYou.db.delete(data);\r\n }\r\n for (var clone of [post].concat(post.clones)) {\r\n clone.nodes.root.classList.toggle('yourPost', this.checked);\r\n }\r\n for (var quotelink of Get.allQuotelinksLinkingTo(post)) {\r\n if (this.checked) {\r\n if (Conf['Mark Quotes of You']) { $.add(quotelink, QuoteYou.mark.cloneNode(true)); }\r\n } else {\r\n $.rm($('.qmark-you', quotelink));\r\n }\r\n quotelink.classList.toggle('you', this.checked);\r\n if ($.hasClass(quotelink, 'quotelink')) {\r\n var quoter = Get.postFromNode(quotelink).nodes.root;\r\n quoter.classList.toggle('quotesYou', !!$('.quotelink.you', quoter));\r\n }\r\n }\r\n }\r\n },\r\n\r\n cb: {\r\n seek(type) {\r\n let highlighted, post;\r\n let result;\r\n const {highlight} = g.SITE.classes;\r\n if (highlighted = $(`.${highlight}`)) { $.rmClass(highlighted, highlight); }\r\n\r\n if (!QuoteYou.lastRead || !doc.contains(QuoteYou.lastRead) || !$.hasClass(QuoteYou.lastRead, 'quotesYou')) {\r\n if (!(post = (QuoteYou.lastRead = $('.quotesYou')))) {\r\n new Notice('warning', 'No posts are currently quoting you, loser.', 20);\r\n return;\r\n }\r\n if (QuoteYou.cb.scroll(post)) { return; }\r\n } else {\r\n post = QuoteYou.lastRead;\r\n }\r\n\r\n const str = `${type}::div[contains(@class,'quotesYou')]`;\r\n\r\n while (post = (result = $.X(str, post)).snapshotItem(type === 'preceding' ? result.snapshotLength - 1 : 0)) {\r\n if (QuoteYou.cb.scroll(post)) { return; }\r\n }\r\n\r\n const posts = $$('.quotesYou');\r\n return QuoteYou.cb.scroll(posts[type === 'following' ? 0 : posts.length - 1]);\r\n },\r\n\r\n scroll(root) {\r\n const post = Get.postFromRoot(root);\r\n if (!post.nodes.post.getBoundingClientRect().height) {\r\n return false;\r\n } else {\r\n QuoteYou.lastRead = root;\r\n location.href = Get.url('post', post);\r\n Header.scrollTo(post.nodes.post);\r\n if (post.isReply) {\r\n const sel = `${g.SITE.selectors.postContainer}${g.SITE.selectors.highlightable.reply}`;\r\n let node = post.nodes.root;\r\n if (!node.matches(sel)) { node = $(sel, node); }\r\n $.addClass(node, g.SITE.classes.highlight);\r\n }\r\n return true;\r\n }\r\n }\r\n }\r\n};\r\nexport default QuoteYou;\r\n","/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nexport default class RandomAccessList {\r\n constructor(items) {\r\n this.length = 0;\r\n if (items) { for (var item of items) { this.push(item); } }\r\n }\r\n\r\n push(data) {\r\n let item;\r\n let {ID} = data;\r\n if (!ID) { ID = data.id; }\r\n if (this[ID]) { return; }\r\n const {last} = this;\r\n this[ID] = (item = {\r\n prev: last,\r\n next: null,\r\n data,\r\n ID\r\n });\r\n item.prev = last;\r\n this.last = last ?\r\n (last.next = item)\r\n :\r\n (this.first = item);\r\n return this.length++;\r\n }\r\n\r\n before(root, item) {\r\n if ((item.next === root) || (item === root)) { return; }\r\n\r\n this.rmi(item);\r\n\r\n const {prev} = root;\r\n root.prev = item;\r\n item.next = root;\r\n item.prev = prev;\r\n if (prev) {\r\n return prev.next = item;\r\n } else {\r\n return this.first = item;\r\n }\r\n }\r\n\r\n after(root, item) {\r\n if ((item.prev === root) || (item === root)) { return; }\r\n\r\n this.rmi(item);\r\n\r\n const {next} = root;\r\n root.next = item;\r\n item.prev = root;\r\n item.next = next;\r\n if (next) {\r\n return next.prev = item;\r\n } else {\r\n return this.last = item;\r\n }\r\n }\r\n\r\n prepend(item) {\r\n const {first} = this;\r\n if ((item === first) || !this[item.ID]) { return; }\r\n this.rmi(item);\r\n item.next = first;\r\n if (first) {\r\n first.prev = item;\r\n } else {\r\n this.last = item;\r\n }\r\n this.first = item;\r\n return delete item.prev;\r\n }\r\n\r\n shift() {\r\n return this.rm(this.first.ID);\r\n }\r\n\r\n order() {\r\n let item;\r\n const order = [(item = this.first)];\r\n while ((item = item.next)) { order.push(item); }\r\n return order;\r\n }\r\n\r\n rm(ID) {\r\n const item = this[ID];\r\n if (!item) { return; }\r\n delete this[ID];\r\n this.length--;\r\n this.rmi(item);\r\n delete item.next;\r\n return delete item.prev;\r\n }\r\n\r\n rmi(item) {\r\n const {prev, next} = item;\r\n if (prev) {\r\n prev.next = next;\r\n } else {\r\n this.first = next;\r\n }\r\n if (next) {\r\n return next.prev = prev;\r\n } else {\r\n return this.last = prev;\r\n }\r\n }\r\n}\r\n","import Callbacks from \"../classes/Callbacks\";\r\nimport DataBoard from \"../classes/DataBoard\";\r\nimport RandomAccessList from \"../classes/RandomAccessList\";\r\nimport Get from \"../General/Get\";\r\nimport Header from \"../General/Header\";\r\nimport { g, Conf, d } from \"../globals/globals\";\r\nimport $ from \"../platform/$\";\r\nimport { debounce, SECOND } from \"../platform/helpers\";\r\nimport QuoteYou from \"../Quotelinks/QuoteYou\";\r\nimport Favicon from \"./Favicon\";\r\nimport ThreadWatcher from \"./ThreadWatcher\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * DS207: Consider shorter variations of null checks\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar Unread = {\r\n init() {\r\n if ((g.VIEW !== 'thread') || (\r\n !Conf['Unread Count'] &&\r\n !Conf['Unread Favicon'] &&\r\n !Conf['Unread Line'] &&\r\n !Conf['Remember Last Read Post'] &&\r\n !Conf['Desktop Notifications'] &&\r\n !Conf['Quote Threading']\r\n )) { return; }\r\n\r\n if (Conf['Remember Last Read Post']) {\r\n $.sync('Remember Last Read Post', enabled => Conf['Remember Last Read Post'] = enabled);\r\n this.db = new DataBoard('lastReadPosts', this.sync);\r\n }\r\n\r\n this.hr = $.el('hr', {\r\n id: 'unread-line',\r\n className: 'unread-line'\r\n }\r\n );\r\n this.posts = new Set();\r\n this.postsQuotingYou = new Set();\r\n this.order = new RandomAccessList();\r\n this.position = null;\r\n\r\n Callbacks.Thread.push({\r\n name: 'Unread',\r\n cb: this.node\r\n });\r\n\r\n return Callbacks.Post.push({\r\n name: 'Unread',\r\n cb: this.addPost\r\n });\r\n },\r\n\r\n node() {\r\n Unread.thread = this;\r\n Unread.title = d.title;\r\n Unread.lastReadPost = Unread.db?.get({\r\n boardID: this.board.ID,\r\n threadID: this.ID\r\n }) || 0;\r\n Unread.readCount = 0;\r\n for (var ID of this.posts.keys) { if (+ID <= Unread.lastReadPost) { Unread.readCount++; } }\r\n $.one(d, '4chanXInitFinished', Unread.ready);\r\n $.on(d, 'PostsInserted', Unread.onUpdate);\r\n $.on(d, 'ThreadUpdate', function(e) { if (e.detail[404]) { return Unread.update(); } });\r\n const resetLink = $.el('a', {\r\n href: 'javascript:;',\r\n className: 'unread-reset',\r\n textContent: 'Mark all unread'\r\n }\r\n );\r\n $.on(resetLink, 'click', Unread.reset);\r\n return Header.menu.addEntry({\r\n el: resetLink,\r\n order: 70\r\n });\r\n },\r\n\r\n ready() {\r\n if (Conf['Remember Last Read Post'] && Conf['Scroll to Last Read Post']) { Unread.scroll(); }\r\n Unread.setLine(true);\r\n Unread.read();\r\n Unread.update();\r\n $.on(d, 'scroll visibilitychange', Unread.read);\r\n if (Conf['Unread Line']) { return $.on(d, 'visibilitychange', Unread.setLine); }\r\n },\r\n\r\n positionPrev() {\r\n if (Unread.position) { return Unread.position.prev; } else { return Unread.order.last; }\r\n },\r\n\r\n scroll() {\r\n // Let the header's onload callback handle it.\r\n let hash;\r\n if ((hash = location.hash.match(/\\d+/)) && hash[0] in Unread.thread.posts) { return; }\r\n\r\n let position = Unread.positionPrev();\r\n while (position) {\r\n var {bottom} = position.data.nodes;\r\n if (!bottom.getBoundingClientRect().height) {\r\n // Don't try to scroll to posts with display: none\r\n position = position.prev;\r\n } else {\r\n Header.scrollToIfNeeded(bottom, true);\r\n break;\r\n }\r\n }\r\n },\r\n\r\n reset() {\r\n if (Unread.lastReadPost == null) { return; }\r\n\r\n Unread.posts = new Set();\r\n Unread.postsQuotingYou = new Set();\r\n Unread.order = new RandomAccessList();\r\n Unread.position = null;\r\n Unread.lastReadPost = 0;\r\n Unread.readCount = 0;\r\n Unread.thread.posts.forEach(post => Unread.addPost.call(post));\r\n\r\n $.forceSync('Remember Last Read Post');\r\n if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) {\r\n Unread.db.set({\r\n boardID: Unread.thread.board.ID,\r\n threadID: Unread.thread.ID,\r\n val: 0\r\n });\r\n }\r\n\r\n Unread.updatePosition();\r\n Unread.setLine();\r\n return Unread.update();\r\n },\r\n\r\n sync() {\r\n if (Unread.lastReadPost == null) { return; }\r\n const lastReadPost = Unread.db.get({\r\n boardID: Unread.thread.board.ID,\r\n threadID: Unread.thread.ID,\r\n defaultValue: 0\r\n });\r\n if (Unread.lastReadPost >= lastReadPost) { return; }\r\n Unread.lastReadPost = lastReadPost;\r\n\r\n const postIDs = Unread.thread.posts.keys;\r\n for (let i = Unread.readCount, end = postIDs.length; i < end; i++) {\r\n var ID = +postIDs[i];\r\n if (!Unread.thread.posts.get(ID).isFetchedQuote) {\r\n if (ID > Unread.lastReadPost) { break; }\r\n Unread.posts.delete(ID);\r\n Unread.postsQuotingYou.delete(ID);\r\n }\r\n Unread.readCount++;\r\n }\r\n\r\n Unread.updatePosition();\r\n Unread.setLine();\r\n return Unread.update();\r\n },\r\n\r\n addPost() {\r\n if (this.isFetchedQuote || this.isClone) { return; }\r\n Unread.order.push(this);\r\n if ((this.ID <= Unread.lastReadPost) || this.isHidden || QuoteYou.isYou(this)) { return; }\r\n Unread.posts.add((Unread.posts.last = this.ID));\r\n Unread.addPostQuotingYou(this);\r\n return Unread.position != null ? Unread.position : (Unread.position = Unread.order[this.ID]);\r\n },\r\n\r\n addPostQuotingYou(post) {\r\n for (var quotelink of post.nodes.quotelinks) {\r\n if (QuoteYou.db?.get(Get.postDataFromLink(quotelink))) {\r\n Unread.postsQuotingYou.add((Unread.postsQuotingYou.last = post.ID));\r\n Unread.openNotification(post);\r\n return;\r\n }\r\n }\r\n },\r\n\r\n openNotification(post, predicate=' replied to you') {\r\n if (!Header.areNotificationsEnabled) { return; }\r\n const notif = new Notification(`${post.info.nameBlock}${predicate}`, {\r\n body: post.commentDisplay(),\r\n icon: Favicon.logo\r\n }\r\n );\r\n notif.onclick = function() {\r\n Header.scrollToIfNeeded(post.nodes.bottom, true);\r\n return window.focus();\r\n };\r\n return notif.onshow = () => setTimeout(() => notif.close()\r\n , 7 * SECOND);\r\n },\r\n\r\n onUpdate() {\r\n return $.queueTask(function() { // ThreadUpdater may scroll immediately after inserting posts\r\n Unread.setLine();\r\n Unread.read();\r\n return Unread.update();\r\n });\r\n },\r\n\r\n readSinglePost(post) {\r\n const {ID} = post;\r\n if (!Unread.posts.has(ID)) { return; }\r\n Unread.posts.delete(ID);\r\n Unread.postsQuotingYou.delete(ID);\r\n Unread.updatePosition();\r\n Unread.saveLastReadPost();\r\n return Unread.update();\r\n },\r\n\r\n read: debounce(100, function(e) {\r\n // Update the lastReadPost when hidden posts are added to the thread.\r\n if (!Unread.posts.size && (Unread.readCount !== Unread.thread.posts.keys.length)) {\r\n Unread.saveLastReadPost();\r\n }\r\n\r\n if (d.hidden || !Unread.posts.size) { return; }\r\n\r\n let count = 0;\r\n while (Unread.position) {\r\n var {ID, data} = Unread.position;\r\n var {bottom} = data.nodes;\r\n if (!!bottom.getBoundingClientRect().height && // post has been hidden\r\n (Header.getBottomOf(bottom) <= -1)) { break; } // post is completely read\r\n count++;\r\n Unread.posts.delete(ID);\r\n Unread.postsQuotingYou.delete(ID);\r\n Unread.position = Unread.position.next;\r\n }\r\n\r\n if (!count) { return; }\r\n Unread.updatePosition();\r\n Unread.saveLastReadPost();\r\n if (e) { return Unread.update(); }\r\n }),\r\n\r\n updatePosition() {\r\n while (Unread.position && !Unread.posts.has(Unread.position.ID)) {\r\n Unread.position = Unread.position.next;\r\n }\r\n },\r\n\r\n saveLastReadPost: debounce(2 * SECOND, function() {\r\n let ID;\r\n $.forceSync('Remember Last Read Post');\r\n if (!Conf['Remember Last Read Post'] || !Unread.db) { return; }\r\n const postIDs = Unread.thread.posts.keys;\r\n for (let i = Unread.readCount, end = postIDs.length; i < end; i++) {\r\n ID = +postIDs[i];\r\n if (!Unread.thread.posts.get(ID).isFetchedQuote) {\r\n if (Unread.posts.has(ID)) { break; }\r\n Unread.lastReadPost = ID;\r\n }\r\n Unread.readCount++;\r\n }\r\n if (Unread.thread.isDead && !Unread.thread.isArchived) { return; }\r\n return Unread.db.set({\r\n boardID: Unread.thread.board.ID,\r\n threadID: Unread.thread.ID,\r\n val: Unread.lastReadPost\r\n });\r\n }),\r\n\r\n setLine(force) {\r\n if (!Conf['Unread Line']) { return; }\r\n if (Unread.hr.hidden || d.hidden || (force === true)) {\r\n const oldPosition = Unread.linePosition;\r\n if (Unread.linePosition = Unread.positionPrev()) {\r\n if (Unread.linePosition !== oldPosition) {\r\n let node = Unread.linePosition.data.nodes.bottom;\r\n if (node.nextSibling?.tagName === 'BR') { node = node.nextSibling; }\r\n $.after(node, Unread.hr);\r\n }\r\n } else {\r\n $.rm(Unread.hr);\r\n }\r\n }\r\n return Unread.hr.hidden = Unread.linePosition === Unread.order.last;\r\n },\r\n\r\n update() {\r\n const count = Unread.posts.size;\r\n const countQuotingYou = Unread.postsQuotingYou.size;\r\n\r\n if (Conf['Unread Count']) {\r\n const titleQuotingYou = Conf['Quoted Title'] && countQuotingYou ? '(!) ' : '';\r\n const titleCount = count || !Conf['Hide Unread Count at (0)'] ? `(${count}) ` : '';\r\n const titleDead = Unread.thread.isDead ?\r\n Unread.title.replace('-', (Unread.thread.isArchived ? '- Archived -' : '- 404 -'))\r\n :\r\n Unread.title;\r\n d.title = `${titleQuotingYou}${titleCount}${titleDead}`;\r\n }\r\n\r\n Unread.saveThreadWatcherCount();\r\n\r\n if (Conf['Unread Favicon'] && (g.SITE.software === 'yotsuba')) {\r\n const {isDead} = Unread.thread;\r\n return Favicon.set((\r\n countQuotingYou ?\r\n (isDead ? 'unreadDeadY' : 'unreadY')\r\n : count ?\r\n (isDead ? 'unreadDead' : 'unread')\r\n :\r\n (isDead ? 'dead' : 'default')\r\n )\r\n );\r\n }\r\n },\r\n\r\n saveThreadWatcherCount: debounce(2 * SECOND, function() {\r\n $.forceSync('Remember Last Read Post');\r\n if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) {\r\n let posts;\r\n const quotingYou = !Conf['Require OP Quote Link'] && QuoteYou.isYou(Unread.thread.OP) ? Unread.posts : Unread.postsQuotingYou;\r\n if (!quotingYou.size) {\r\n quotingYou.last = 0;\r\n } else if (!quotingYou.has(quotingYou.last)) {\r\n quotingYou.last = 0;\r\n posts = Unread.thread.posts.keys;\r\n for (let i = posts.length - 1; i >= 0; i--) {\r\n if (quotingYou.has(+posts[i])) {\r\n quotingYou.last = posts[i];\r\n break;\r\n }\r\n }\r\n }\r\n return ThreadWatcher.update(g.SITE.ID, Unread.thread.board.ID, Unread.thread.ID, {\r\n last: Unread.thread.lastPost,\r\n isDead: Unread.thread.isDead,\r\n isArchived: Unread.thread.isArchived,\r\n unread: Unread.posts.size,\r\n quotingYou: (quotingYou.last || 0)\r\n }\r\n );\r\n }\r\n })\r\n};\r\nexport default Unread;\r\n","import Callbacks from \"../classes/Callbacks\";\r\nimport Post from \"../classes/Post\";\r\nimport Get from \"../General/Get\";\r\nimport Index from \"../General/Index\";\r\nimport { g, Conf, d } from \"../globals/globals\";\r\nimport Main from \"../main/Main\";\r\nimport $ from \"../platform/$\";\r\nimport $$ from \"../platform/$$\";\r\nimport { dict } from \"../platform/helpers\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS101: Remove unnecessary use of Array.from\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar ExpandThread = {\r\n statuses: dict(),\r\n init() {\r\n if (!((g.VIEW === 'index') && Conf['Thread Expansion'])) { return; }\r\n if (Conf['JSON Index']) {\r\n return $.on(d, 'IndexRefreshInternal', this.onIndexRefresh);\r\n } else {\r\n return Callbacks.Thread.push({\r\n name: 'Expand Thread',\r\n cb() { return ExpandThread.setButton(this); }\r\n });\r\n }\r\n },\r\n\r\n setButton(thread) {\r\n let a;\r\n if (!(thread.nodes.root && (a = $('.summary', thread.nodes.root)))) { return; }\r\n a.textContent = g.SITE.Build.summaryText('+', ...Array.from(a.textContent.match(/\\d+/g)));\r\n a.style.cursor = 'pointer';\r\n return $.on(a, 'click', ExpandThread.cbToggle);\r\n },\r\n \r\n disconnect(refresh) {\r\n if ((g.VIEW === 'thread') || !Conf['Thread Expansion']) { return; }\r\n for (var threadID in ExpandThread.statuses) {\r\n var oldReq;\r\n var status = ExpandThread.statuses[threadID];\r\n if (oldReq = status.req) {\r\n delete status.req;\r\n oldReq.abort();\r\n }\r\n delete ExpandThread.statuses[threadID];\r\n }\r\n\r\n if (!refresh) { return $.off(d, 'IndexRefreshInternal', this.onIndexRefresh); }\r\n },\r\n\r\n onIndexRefresh() {\r\n ExpandThread.disconnect(true);\r\n return g.BOARD.threads.forEach(thread => ExpandThread.setButton(thread));\r\n },\r\n\r\n cbToggle(e) {\r\n if ($.modifiedClick(e)) { return; }\r\n e.preventDefault();\r\n return ExpandThread.toggle(Get.threadFromNode(this));\r\n },\r\n\r\n cbToggleBottom(e) {\r\n if ($.modifiedClick(e)) { return; }\r\n e.preventDefault();\r\n const thread = Get.threadFromNode(this);\r\n $.rm(this); // remove before fixing bottom of thread position\r\n const {bottom} = thread.nodes.root.getBoundingClientRect();\r\n ExpandThread.toggle(thread);\r\n return window.scrollBy(0, (thread.nodes.root.getBoundingClientRect().bottom - bottom));\r\n },\r\n\r\n toggle(thread) {\r\n let a;\r\n if (!(thread.nodes.root && (a = $('.summary', thread.nodes.root)))) { return; }\r\n if (thread.ID in ExpandThread.statuses) {\r\n return ExpandThread.contract(thread, a, thread.nodes.root);\r\n } else {\r\n return ExpandThread.expand(thread, a);\r\n }\r\n },\r\n\r\n expand(thread, a) {\r\n let status;\r\n ExpandThread.statuses[thread] = (status = {});\r\n a.textContent = g.SITE.Build.summaryText('...', ...Array.from(a.textContent.match(/\\d+/g)));\r\n status.req = $.cache(g.SITE.urls.threadJSON({boardID: thread.board.ID, threadID: thread.ID}), function() {\r\n if (this !== status.req) { return; } // aborted\r\n delete status.req;\r\n return ExpandThread.parse(this, thread, a);\r\n });\r\n return status.numReplies = $$(g.SITE.selectors.replyOriginal, thread.nodes.root).length;\r\n },\r\n\r\n contract(thread, a, threadRoot) {\r\n let oldReq;\r\n const status = ExpandThread.statuses[thread];\r\n delete ExpandThread.statuses[thread];\r\n if (oldReq = status.req) {\r\n delete status.req;\r\n oldReq.abort();\r\n if (a) { a.textContent = g.SITE.Build.summaryText('+', ...Array.from(a.textContent.match(/\\d+/g))); }\r\n return;\r\n }\r\n\r\n let replies = $$('.thread > .replyContainer', threadRoot);\r\n if (status.numReplies) { replies = replies.slice(0, (-status.numReplies)); }\r\n let postsCount = 0;\r\n let filesCount = 0;\r\n for (var reply of replies) {\r\n // rm clones\r\n if (Conf['Quote Inlining']) { var inlined;\r\n while ((inlined = $('.inlined', reply))) { inlined.click(); } }\r\n postsCount++;\r\n if ('file' in Get.postFromRoot(reply)) { filesCount++; }\r\n $.rm(reply);\r\n }\r\n if (Index.enabled) { // otherwise handled by Main.addPosts\r\n $.event('PostsRemoved', null, a.parentNode);\r\n }\r\n a.textContent = g.SITE.Build.summaryText('+', postsCount, filesCount);\r\n return $.rm($('.summary-bottom', threadRoot));\r\n },\r\n\r\n parse(req, thread, a) {\r\n let root;\r\n if (![200, 304].includes(req.status)) {\r\n a.textContent = req.status ? `Error ${req.statusText} (${req.status})` : 'Connection Error';\r\n return;\r\n }\r\n\r\n g.SITE.Build.spoilerRange[thread.board] = req.response.posts[0].custom_spoiler;\r\n\r\n const posts = [];\r\n const postsRoot = [];\r\n let filesCount = 0;\r\n for (var postData of req.response.posts) {\r\n var post;\r\n if (postData.no === thread.ID) { continue; }\r\n if ((post = thread.posts.get(postData.no)) && !post.isFetchedQuote) {\r\n if ('file' in post) { filesCount++; }\r\n ({root} = post.nodes);\r\n postsRoot.push(root);\r\n continue;\r\n }\r\n root = g.SITE.Build.postFromObject(postData, thread.board.ID);\r\n post = new Post(root, thread, thread.board);\r\n if ('file' in post) { filesCount++; }\r\n posts.push(post);\r\n postsRoot.push(root);\r\n }\r\n Main.callbackNodes('Post', posts);\r\n $.after(a, postsRoot);\r\n $.event('PostsInserted', null, a.parentNode);\r\n\r\n const postsCount = postsRoot.length;\r\n a.textContent = g.SITE.Build.summaryText('-', postsCount, filesCount);\r\n\r\n if (root) {\r\n const a2 = a.cloneNode(true);\r\n a2.classList.add('summary-bottom');\r\n $.on(a2, 'click', ExpandThread.cbToggleBottom);\r\n return $.after(root, a2);\r\n }\r\n }\r\n};\r\nexport default ExpandThread;\r\n","import Callbacks from \"../classes/Callbacks\";\r\nimport DataBoard from \"../classes/DataBoard\";\r\nimport Get from \"../General/Get\";\r\nimport Header from \"../General/Header\";\r\nimport Index from \"../General/Index\";\r\nimport { g, Conf, d } from \"../globals/globals\";\r\nimport ExpandThread from \"../Miscellaneous/ExpandThread\";\r\nimport $ from \"../platform/$\";\r\nimport { dict } from \"../platform/helpers\";\r\nimport QuoteYou from \"../Quotelinks/QuoteYou\";\r\nimport ThreadWatcher from \"./ThreadWatcher\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * DS205: Consider reworking code to avoid use of IIFEs\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar UnreadIndex = {\r\n lastReadPost: dict(),\r\n hr: dict(),\r\n markReadLink: dict(),\r\n\r\n init() {\r\n if ((g.VIEW !== 'index') || !Conf['Remember Last Read Post'] || !Conf['Unread Line in Index']) { return; }\r\n\r\n this.enabled = true;\r\n this.db = new DataBoard('lastReadPosts', this.sync);\r\n\r\n Callbacks.Thread.push({\r\n name: 'Unread Line in Index',\r\n cb: this.node\r\n });\r\n\r\n $.on(d, 'IndexRefreshInternal', this.onIndexRefresh);\r\n return $.on(d, 'PostsInserted PostsRemoved', this.onPostsInserted);\r\n },\r\n\r\n node() {\r\n UnreadIndex.lastReadPost[this.fullID] = UnreadIndex.db.get({\r\n boardID: this.board.ID,\r\n threadID: this.ID\r\n }) || 0;\r\n if (!Index.enabled) { // let onIndexRefresh handle JSON Index\r\n return UnreadIndex.update(this);\r\n }\r\n },\r\n\r\n onIndexRefresh(e) {\r\n if (e.detail.isCatalog) { return; }\r\n return (() => {\r\n const result = [];\r\n for (var threadID of e.detail.threadIDs) {\r\n var thread = g.threads.get(threadID);\r\n result.push(UnreadIndex.update(thread));\r\n }\r\n return result;\r\n })();\r\n },\r\n\r\n onPostsInserted(e) {\r\n if (e.target === Index.root) { return; } // onIndexRefresh handles this case\r\n const thread = Get.threadFromNode(e.target);\r\n if (!thread || (thread.nodes.root !== e.target)) { return; }\r\n const wasVisible = !!UnreadIndex.hr[thread.fullID]?.parentNode;\r\n UnreadIndex.update(thread);\r\n if (Conf['Scroll to Last Read Post'] && (e.type === 'PostsInserted') && !wasVisible && !!UnreadIndex.hr[thread.fullID]?.parentNode) {\r\n return Header.scrollToIfNeeded(UnreadIndex.hr[thread.fullID], true);\r\n }\r\n },\r\n\r\n sync() {\r\n return g.threads.forEach(function(thread) {\r\n const lastReadPost = UnreadIndex.db.get({\r\n boardID: thread.board.ID,\r\n threadID: thread.ID\r\n }) || 0;\r\n if (lastReadPost !== UnreadIndex.lastReadPost[thread.fullID]) {\r\n UnreadIndex.lastReadPost[thread.fullID] = lastReadPost;\r\n if (thread.nodes.root?.parentNode) {\r\n return UnreadIndex.update(thread);\r\n }\r\n }\r\n });\r\n },\r\n\r\n update(thread) {\r\n let divider;\r\n const lastReadPost = UnreadIndex.lastReadPost[thread.fullID];\r\n let repliesShown = 0;\r\n let repliesRead = 0;\r\n let firstUnread = null;\r\n thread.posts.forEach(function(post) {\r\n if (post.isReply && thread.nodes.root.contains(post.nodes.root)) {\r\n repliesShown++;\r\n if (post.ID <= lastReadPost) {\r\n return repliesRead++;\r\n } else if ((!firstUnread || (post.ID < firstUnread.ID)) && !post.isHidden && !QuoteYou.isYou(post)) {\r\n return firstUnread = post;\r\n }\r\n }\r\n });\r\n\r\n let hr = UnreadIndex.hr[thread.fullID];\r\n if (firstUnread && (repliesRead || ((lastReadPost === thread.OP.ID) && (!$(g.SITE.selectors.summary, thread.nodes.root) || thread.ID in ExpandThread.statuses)))) {\r\n if (!hr) {\r\n hr = (UnreadIndex.hr[thread.fullID] = $.el('hr',\r\n {className: 'unread-line'}));\r\n }\r\n $.before(firstUnread.nodes.root, hr);\r\n } else {\r\n $.rm(hr);\r\n }\r\n\r\n const hasUnread = repliesShown ?\r\n firstUnread || !repliesRead\r\n : Index.enabled ?\r\n thread.lastPost > lastReadPost\r\n :\r\n thread.OP.ID > lastReadPost;\r\n thread.nodes.root.classList.toggle('unread-thread', hasUnread);\r\n\r\n let link = UnreadIndex.markReadLink[thread.fullID];\r\n if (!link) {\r\n link = (UnreadIndex.markReadLink[thread.fullID] = $.el('a', {\r\n className: 'unread-mark-read brackets-wrap',\r\n href: 'javascript:;',\r\n textContent: 'Mark Read'\r\n }\r\n ));\r\n $.on(link, 'click', UnreadIndex.markRead);\r\n }\r\n if (divider = $(g.SITE.selectors.threadDivider, thread.nodes.root)) { // divider inside thread as in Tinyboard\r\n return $.before(divider, link);\r\n } else {\r\n return $.add(thread.nodes.root, link);\r\n }\r\n },\r\n\r\n markRead() {\r\n const thread = Get.threadFromNode(this);\r\n UnreadIndex.lastReadPost[thread.fullID] = thread.lastPost;\r\n UnreadIndex.db.set({\r\n boardID: thread.board.ID,\r\n threadID: thread.ID,\r\n val: thread.lastPost\r\n });\r\n $.rm(UnreadIndex.hr[thread.fullID]);\r\n thread.nodes.root.classList.remove('unread-thread');\r\n return ThreadWatcher.update(g.SITE.ID, thread.board.ID, thread.ID, {\r\n last: thread.lastPost,\r\n unread: 0,\r\n quotingYou: 0\r\n }\r\n );\r\n }\r\n};\r\nexport default UnreadIndex;\r\n","import ThreadWatcherPage from './ThreadWatcher/ThreadWatcher.html';\r\nimport $ from \"../platform/$\";\r\nimport Board from '../classes/Board';\r\nimport Callbacks from '../classes/Callbacks';\r\nimport DataBoard from '../classes/DataBoard';\r\nimport Thread from '../classes/Thread';\r\nimport Filter from '../Filtering/Filter';\r\nimport Main from '../main/Main';\r\nimport $$ from '../platform/$$';\r\nimport Config from '../config/Config';\r\nimport CrossOrigin from '../platform/CrossOrigin';\r\nimport PostRedirect from '../Posting/PostRedirect';\r\nimport QuoteYou from '../Quotelinks/QuoteYou';\r\nimport Unread from './Unread';\r\nimport UnreadIndex from './UnreadIndex';\r\nimport Header from '../General/Header';\r\nimport Index from '../General/Index';\r\nimport { Conf, d, doc, g } from '../globals/globals';\r\nimport Menu from '../Menu/Menu';\r\nimport UI from '../General/UI';\r\nimport Get from '../General/Get';\r\nimport { dict, HOUR, MINUTE } from '../platform/helpers';\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS101: Remove unnecessary use of Array.from\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * DS104: Avoid inline assignments\r\n * DS207: Consider shorter variations of null checks\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\n\r\nvar ThreadWatcher = {\r\n init() {\r\n let sc;\r\n if (!(this.enabled = Conf['Thread Watcher'])) { return; }\r\n\r\n this.shortcut = (sc = $.el('a', {\r\n id: 'watcher-link',\r\n textContent: '👁︎',\r\n title: 'Thread Watcher',\r\n href: 'javascript:;',\r\n }\r\n ));\r\n\r\n this.db = new DataBoard('watchedThreads', this.refresh, true);\r\n this.dbLM = new DataBoard('watcherLastModified', null, true);\r\n this.dialog = UI.dialog('thread-watcher', { innerHTML: ThreadWatcherPage });\r\n this.status = $('#watcher-status', this.dialog);\r\n this.list = this.dialog.lastElementChild;\r\n this.refreshButton = $('.refresh', this.dialog);\r\n this.closeButton = $('.move > .close', this.dialog);\r\n this.unreaddb = Unread.db || UnreadIndex.db || new DataBoard('lastReadPosts');\r\n this.unreadEnabled = Conf['Remember Last Read Post'];\r\n\r\n $.on(d, 'QRPostSuccessful', this.cb.post);\r\n $.on(sc, 'click', this.toggleWatcher);\r\n $.on(this.refreshButton, 'click', this.buttonFetchAll);\r\n $.on(this.closeButton, 'click', this.toggleWatcher);\r\n\r\n this.menu.addHeaderMenuEntry();\r\n $.onExists(doc, 'body', this.addDialog);\r\n\r\n switch (g.VIEW) {\r\n case 'index':\r\n $.on(d, 'IndexUpdate', this.cb.onIndexUpdate);\r\n break;\r\n case 'thread':\r\n $.on(d, 'ThreadUpdate', this.cb.onThreadRefresh);\r\n break;\r\n }\r\n\r\n if (Conf['Fixed Thread Watcher']) {\r\n $.addClass(doc, 'fixed-watcher');\r\n }\r\n if (!Conf['Persistent Thread Watcher']) {\r\n $.addClass(ThreadWatcher.shortcut, 'disabled');\r\n this.dialog.hidden = true;\r\n }\r\n\r\n Header.addShortcut('watcher', sc, 510);\r\n\r\n ThreadWatcher.initLastModified();\r\n ThreadWatcher.fetchAuto();\r\n $.on(window, 'visibilitychange focus', () => $.queueTask(ThreadWatcher.fetchAuto));\r\n\r\n if (Conf['Menu'] && Index.enabled) {\r\n Menu.menu.addEntry({\r\n el: $.el('a', {\r\n href: 'javascript:;',\r\n className: 'has-shortcut-text'\r\n }\r\n , {innerHTML: 'Alt+click'}),\r\n order: 6,\r\n open({thread}) {\r\n if (Conf['Index Mode'] !== 'catalog') { return false; }\r\n this.el.firstElementChild.textContent = ThreadWatcher.isWatched(thread) ?\r\n 'Unwatch'\r\n :\r\n 'Watch';\r\n if (this.cb) { $.off(this.el, 'click', this.cb); }\r\n this.cb = function() {\r\n $.event('CloseMenu');\r\n return ThreadWatcher.toggle(thread);\r\n };\r\n $.on(this.el, 'click', this.cb);\r\n return true;\r\n }\r\n });\r\n }\r\n\r\n if (!['index', 'thread'].includes(g.VIEW)) { return; }\r\n\r\n Callbacks.Post.push({\r\n name: 'Thread Watcher',\r\n cb: this.node\r\n });\r\n return Callbacks.CatalogThread.push({\r\n name: 'Thread Watcher',\r\n cb: this.catalogNode\r\n });\r\n },\r\n\r\n isWatched(thread) {\r\n return !!ThreadWatcher.db?.get({boardID: thread.board.ID, threadID: thread.ID});\r\n },\r\n\r\n isWatchedRaw(boardID, threadID) {\r\n return !!ThreadWatcher.db?.get({boardID, threadID});\r\n },\r\n\r\n setToggler(toggler, isWatched) {\r\n toggler.classList.toggle('watched', isWatched);\r\n return toggler.title = `${isWatched ? 'Unwatch' : 'Watch'} Thread`;\r\n },\r\n\r\n node() {\r\n let toggler;\r\n if (this.isReply) { return; }\r\n if (this.isClone) {\r\n toggler = $('.watch-thread-link', this.nodes.info);\r\n } else {\r\n toggler = $.el('a', {\r\n href: 'javascript:;',\r\n className: 'watch-thread-link'\r\n }\r\n );\r\n $.before($('input', this.nodes.info), toggler);\r\n }\r\n const siteID = g.SITE.ID;\r\n const boardID = this.board.ID;\r\n const threadID = this.thread.ID;\r\n const data = ThreadWatcher.db.get({siteID, boardID, threadID});\r\n ThreadWatcher.setToggler(toggler, !!data);\r\n $.on(toggler, 'click', ThreadWatcher.cb.toggle);\r\n // Add missing excerpt for threads added by Auto Watch\r\n if (data && (data.excerpt == null)) {\r\n return $.queueTask(() => {\r\n return ThreadWatcher.update(siteID, boardID, threadID, {excerpt: Get.threadExcerpt(this.thread)});\r\n });\r\n }\r\n },\r\n\r\n catalogNode() {\r\n if (ThreadWatcher.isWatched(this.thread)) { $.addClass(this.nodes.root, 'watched'); }\r\n return $.on(this.nodes.root, 'mousedown click', e => {\r\n if ((e.button !== 0) || !e.altKey) { return; }\r\n if (e.type === 'click') { ThreadWatcher.toggle(this.thread); }\r\n return e.preventDefault();\r\n });\r\n }, // Also on mousedown to prevent highlighting thumbnail in Firefox.\r\n\r\n addDialog() {\r\n if (!Main.isThisPageLegit()) { return; }\r\n ThreadWatcher.build();\r\n return $.prepend(d.body, ThreadWatcher.dialog);\r\n },\r\n\r\n toggleWatcher() {\r\n $.toggleClass(ThreadWatcher.shortcut, 'disabled');\r\n return ThreadWatcher.dialog.hidden = !ThreadWatcher.dialog.hidden;\r\n },\r\n\r\n cb: {\r\n openAll() {\r\n if ($.hasClass(this, 'disabled')) { return; }\r\n for (var a of $$('a.watcher-link', ThreadWatcher.list)) {\r\n $.open(a.href);\r\n }\r\n return $.event('CloseMenu');\r\n },\r\n openUnread() {\r\n if ($.hasClass(this, 'disabled')) { return; }\r\n for (var a of $$('.replies-unread > a.watcher-link', ThreadWatcher.list)) {\r\n $.open(a.href);\r\n }\r\n return $.event('CloseMenu');\r\n },\r\n openDeads() {\r\n if ($.hasClass(this, 'disabled')) { return; }\r\n for (var a of $$('.dead-thread > a.watcher-link', ThreadWatcher.list)) {\r\n $.open(a.href);\r\n }\r\n return $.event('CloseMenu');\r\n },\r\n pruneDeads() {\r\n if ($.hasClass(this, 'disabled')) { return; }\r\n for (var {siteID, boardID, threadID, data} of ThreadWatcher.getAll()) {\r\n if (data.isDead) {\r\n ThreadWatcher.db.delete({siteID, boardID, threadID});\r\n }\r\n }\r\n ThreadWatcher.refresh();\r\n return $.event('CloseMenu');\r\n },\r\n dismiss() {\r\n for (var {siteID, boardID, threadID, data} of ThreadWatcher.getAll()) {\r\n if (data.quotingYou) {\r\n ThreadWatcher.update(siteID, boardID, threadID, {dismiss: data.quotingYou || 0});\r\n }\r\n }\r\n return $.event('CloseMenu');\r\n },\r\n toggle() {\r\n const {thread} = Get.postFromNode(this);\r\n return ThreadWatcher.toggle(thread);\r\n },\r\n rm() {\r\n const {siteID} = this.parentNode.dataset;\r\n const [boardID, threadID] = Array.from(this.parentNode.dataset.fullID.split('.'));\r\n return ThreadWatcher.rm(siteID, boardID, +threadID);\r\n },\r\n post(e) {\r\n const {boardID, threadID, postID} = e.detail;\r\n const cb = PostRedirect.delay();\r\n if (postID === threadID) {\r\n if (Conf['Auto Watch']) {\r\n return ThreadWatcher.addRaw(boardID, threadID, {}, cb);\r\n }\r\n } else if (Conf['Auto Watch Reply']) {\r\n return ThreadWatcher.add((g.threads.get(boardID + '.' + threadID) || new Thread(threadID, g.boards[boardID] || new Board(boardID))), cb);\r\n }\r\n },\r\n onIndexUpdate(e) {\r\n const {db} = ThreadWatcher;\r\n const siteID = g.SITE.ID;\r\n const boardID = g.BOARD.ID;\r\n let nKilled = 0;\r\n for (var threadID in db.data[siteID].boards[boardID]) {\r\n // Don't prune threads that have yet to appear in index.\r\n var data = db.data[siteID].boards[boardID][threadID];\r\n if (!data?.isDead && !e.detail.threads.includes(`${boardID}.${threadID}`)) {\r\n if (!e.detail.threads.some(fullID => +fullID.split('.')[1] > threadID)) { continue; }\r\n if (Conf['Auto Prune'] || !(data && (typeof data === 'object'))) { // corrupt data\r\n db.delete({boardID, threadID});\r\n nKilled++;\r\n } else {\r\n ThreadWatcher.fetchStatus({siteID, boardID, threadID, data});\r\n }\r\n }\r\n }\r\n if (nKilled) { return ThreadWatcher.refresh(); }\r\n },\r\n onThreadRefresh(e) {\r\n const thread = g.threads.get(e.detail.threadID);\r\n if (!e.detail[404] || !ThreadWatcher.isWatched(thread)) { return; }\r\n // Update dead status.\r\n return ThreadWatcher.add(thread);\r\n }\r\n },\r\n\r\n requests: [],\r\n fetched: 0,\r\n\r\n fetch(url, {siteID, force}, args, cb) {\r\n if (ThreadWatcher.requests.length === 0) {\r\n ThreadWatcher.status.textContent = '...';\r\n $.addClass(ThreadWatcher.refreshButton, 'spin');\r\n }\r\n const onloadend = function() {\r\n if (this.finished) { return; }\r\n this.finished = true;\r\n ThreadWatcher.fetched++;\r\n if (ThreadWatcher.fetched === ThreadWatcher.requests.length) {\r\n ThreadWatcher.clearRequests();\r\n } else {\r\n ThreadWatcher.status.textContent = `${Math.round((ThreadWatcher.fetched / ThreadWatcher.requests.length) * 100)}%`;\r\n }\r\n return cb.apply(this, args);\r\n };\r\n const ajax = siteID === g.SITE.ID ? $.ajax : CrossOrigin.ajax;\r\n if (force) {\r\n delete $.lastModified.ThreadWatcher?.[url];\r\n }\r\n const req = $.whenModified(\r\n url,\r\n 'ThreadWatcher',\r\n onloadend,\r\n { timeout: MINUTE, ajax }\r\n );\r\n return ThreadWatcher.requests.push(req);\r\n },\r\n\r\n clearRequests() {\r\n ThreadWatcher.requests = [];\r\n ThreadWatcher.fetched = 0;\r\n ThreadWatcher.status.textContent = '';\r\n return $.rmClass(ThreadWatcher.refreshButton, 'spin');\r\n },\r\n\r\n abort() {\r\n delete ThreadWatcher.syncing;\r\n for (var req of ThreadWatcher.requests) {\r\n if (!req.finished) {\r\n req.finished = true;\r\n req.abort();\r\n }\r\n }\r\n return ThreadWatcher.clearRequests();\r\n },\r\n\r\n initLastModified() {\r\n const lm = ($.lastModified['ThreadWatcher'] || ($.lastModified['ThreadWatcher'] = dict()));\r\n for (var siteID in ThreadWatcher.dbLM.data) {\r\n var boards = ThreadWatcher.dbLM.data[siteID];\r\n for (var boardID in boards.boards) {\r\n var data = boards.boards[boardID];\r\n if (ThreadWatcher.db.get({siteID, boardID})) {\r\n for (var url in data) {\r\n var date = data[url];\r\n lm[url] = date;\r\n }\r\n } else {\r\n ThreadWatcher.dbLM.delete({siteID, boardID});\r\n }\r\n }\r\n }\r\n },\r\n\r\n fetchAuto() {\r\n let middle;\r\n clearTimeout(ThreadWatcher.timeout);\r\n if (!Conf['Auto Update Thread Watcher']) { return; }\r\n const {db} = ThreadWatcher;\r\n const interval = Conf['Show Page'] || (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) ? 5 * MINUTE : 2 * HOUR;\r\n const now = Date.now();\r\n if ((now - interval >= ((middle = db.data.lastChecked || 0)) || middle > now) && !d.hidden && !!d.hasFocus()) {\r\n ThreadWatcher.fetchAllStatus(interval);\r\n }\r\n return ThreadWatcher.timeout = setTimeout(ThreadWatcher.fetchAuto, interval);\r\n },\r\n\r\n buttonFetchAll() {\r\n if (ThreadWatcher.syncing || ThreadWatcher.requests.length) {\r\n return ThreadWatcher.abort();\r\n } else {\r\n return ThreadWatcher.fetchAllStatus();\r\n }\r\n },\r\n\r\n fetchAllStatus(interval=0) {\r\n ThreadWatcher.status.textContent = '...';\r\n $.addClass(ThreadWatcher.refreshButton, 'spin');\r\n ThreadWatcher.syncing = true;\r\n const dbs = [ThreadWatcher.db, ThreadWatcher.unreaddb, QuoteYou.db].filter(x => x);\r\n let n = 0;\r\n return dbs.map((dbi) =>\r\n dbi.forceSync(function() {\r\n if ((++n) === dbs.length) {\r\n let middle;\r\n if (!ThreadWatcher.syncing) { return; } // aborted\r\n delete ThreadWatcher.syncing;\r\n if (0 > (middle = Date.now() - (ThreadWatcher.db.data.lastChecked || 0)) || middle >= interval) { // not checked in another tab\r\n // XXX On vichan boards, last_modified field of threads.json does not account for sage posts.\r\n // Occasionally check replies field of catalog.json to find these posts.\r\n let middle1;\r\n const {db} = ThreadWatcher;\r\n const now = Date.now();\r\n const deep = !(now - (2 * HOUR) < ((middle1 = db.data.lastChecked2 || 0)) && middle1 <= now);\r\n const boards = ThreadWatcher.getAll(true);\r\n for (var board of boards) {\r\n ThreadWatcher.fetchBoard(board, deep);\r\n }\r\n db.setLastChecked();\r\n if (deep) { db.setLastChecked('lastChecked2'); }\r\n }\r\n if (ThreadWatcher.fetched === ThreadWatcher.requests.length) {\r\n return ThreadWatcher.clearRequests();\r\n }\r\n }\r\n }));\r\n },\r\n\r\n fetchBoard(board, deep) {\r\n if (!board.some(thread => !thread.data.isDead)) { return; }\r\n let force = false;\r\n for (var thread of board) {\r\n var {data} = thread;\r\n if (!data.isDead && (data.last !== -1)) {\r\n if (Conf['Show Page'] && (data.page == null)) { force = true; }\r\n if ((data.modified == null)) { force = (thread.force = true); }\r\n }\r\n }\r\n const {siteID, boardID} = board[0];\r\n const site = g.sites[siteID];\r\n if (!site) { return; }\r\n const urlF = deep && site.threadModTimeIgnoresSage ? 'catalogJSON' : 'threadsListJSON';\r\n const url = site.urls[urlF]?.({siteID, boardID});\r\n if (!url) { return; }\r\n return ThreadWatcher.fetch(url, {siteID, force}, [board, url], ThreadWatcher.parseBoard);\r\n },\r\n\r\n parseBoard(board, url) {\r\n let page, thread;\r\n if (this.status !== 200) { return; }\r\n const {siteID, boardID} = board[0];\r\n const lmDate = this.getResponseHeader('Last-Modified');\r\n ThreadWatcher.dbLM.extend({siteID, boardID, val: $.item(url, lmDate)});\r\n const threads = dict();\r\n let pageLength = 0;\r\n let nThreads = 0;\r\n let oldest = null;\r\n try {\r\n pageLength = this.response[0]?.threads.length || 0;\r\n for (let i = 0; i < this.response.length; i++) {\r\n page = this.response[i];\r\n for (var item of page.threads) {\r\n threads[item.no] = {\r\n page: i + 1,\r\n index: nThreads,\r\n modified: item.last_modified,\r\n replies: item.replies\r\n };\r\n nThreads++;\r\n if ((oldest == null) || (item.no < oldest)) {\r\n oldest = item.no;\r\n }\r\n }\r\n }\r\n } catch (error) {\r\n for (thread of board) {\r\n ThreadWatcher.fetchStatus(thread);\r\n }\r\n }\r\n for (thread of board) {\r\n var {threadID, data} = thread;\r\n if (threads[threadID]) {\r\n var index, modified, replies;\r\n ({page, index, modified, replies} = threads[threadID]);\r\n if (Conf['Show Page']) {\r\n var lastPage = g.sites[siteID].isPrunedByAge?.({siteID, boardID}) ?\r\n threadID === oldest\r\n :\r\n index >= (nThreads - pageLength);\r\n ThreadWatcher.update(siteID, boardID, threadID, {page, lastPage});\r\n }\r\n if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) {\r\n if ((modified !== data.modified) || ((replies != null) && (replies !== data.replies))) {\r\n (thread.newData || (thread.newData = {})).modified = modified;\r\n ThreadWatcher.fetchStatus(thread);\r\n }\r\n }\r\n } else {\r\n ThreadWatcher.fetchStatus(thread);\r\n }\r\n }\r\n },\r\n\r\n fetchStatus(thread) {\r\n const {siteID, boardID, threadID, data, force} = thread;\r\n const url = g.sites[siteID]?.urls.threadJSON?.({siteID, boardID, threadID});\r\n if (!url) { return; }\r\n if (data.isDead && !force) { return; }\r\n if (data.last === -1) { return; } // 404 or no JSON API\r\n return ThreadWatcher.fetch(url, {siteID, force}, [thread], ThreadWatcher.parseStatus);\r\n },\r\n\r\n parseStatus(thread, isArchiveURL) {\r\n let isDead, last;\r\n let {siteID, boardID, threadID, data, newData, force} = thread;\r\n const site = g.sites[siteID];\r\n if ((this.status === 200) && this.response) {\r\n let isArchived;\r\n last = this.response.posts[this.response.posts.length-1].no;\r\n const replies = this.response.posts.length-1;\r\n isDead = (isArchived = !!(this.response.posts[0].archived || isArchiveURL));\r\n if (isDead && Conf['Auto Prune']) {\r\n ThreadWatcher.rm(siteID, boardID, threadID);\r\n return;\r\n }\r\n\r\n if ((last === data.last) && (isDead === data.isDead) && (isArchived === data.isArchived)) { return; }\r\n\r\n const lastReadPost = ThreadWatcher.unreaddb.get({siteID, boardID, threadID, defaultValue: 0});\r\n let unread = data.unread || 0;\r\n let quotingYou = data.quotingYou || 0;\r\n const youOP = !!QuoteYou.db?.get({siteID, boardID, threadID, postID: threadID});\r\n\r\n for (var postObj of this.response.posts) {\r\n if ((postObj.no <= (data.last || 0)) || (postObj.no <= lastReadPost)) { continue; }\r\n if (QuoteYou.db?.get({siteID, boardID, threadID, postID: postObj.no})) { continue; }\r\n\r\n var quotesYou = false;\r\n if (!Conf['Require OP Quote Link'] && youOP) {\r\n quotesYou = true;\r\n } else if (QuoteYou.db && postObj.com) {\r\n var match;\r\n var regexp = site.regexp.quotelinkHTML;\r\n regexp.lastIndex = 0;\r\n while (match = regexp.exec(postObj.com)) {\r\n if (QuoteYou.db.get({\r\n siteID,\r\n boardID: match[1] ? encodeURIComponent(match[1]) : boardID,\r\n threadID: match[2] || threadID,\r\n postID: match[3] || match[2] || threadID\r\n })) {\r\n quotesYou = true;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (!unread || (!quotingYou && quotesYou)) {\r\n if (Filter.isHidden(site.Build.parseJSON(postObj, {siteID, boardID}))) { continue; }\r\n }\r\n\r\n unread++;\r\n if (quotesYou) { quotingYou = postObj.no; }\r\n }\r\n\r\n if (!newData) { newData = {}; }\r\n $.extend(newData, {last, replies, isDead, isArchived, unread, quotingYou});\r\n return ThreadWatcher.update(siteID, boardID, threadID, newData);\r\n\r\n } else if (this.status === 404) {\r\n const archiveURL = g.sites[siteID]?.urls.archivedThreadJSON?.({siteID, boardID, threadID});\r\n if (!isArchiveURL && archiveURL) {\r\n return ThreadWatcher.fetch(archiveURL, {siteID, force}, [thread, true], ThreadWatcher.parseStatus);\r\n } else if (site.mayLackJSON && (data.last == null)) {\r\n return ThreadWatcher.update(siteID, boardID, threadID, {last: -1});\r\n } else {\r\n return ThreadWatcher.update(siteID, boardID, threadID, {isDead: true});\r\n }\r\n }\r\n },\r\n\r\n getAll(groupByBoard) {\r\n const all = [];\r\n for (var siteID in ThreadWatcher.db.data) {\r\n var boards = ThreadWatcher.db.data[siteID];\r\n for (var boardID in boards.boards) {\r\n var cont;\r\n var threads = boards.boards[boardID];\r\n if (Conf['Current Board'] && ((siteID !== g.SITE.ID) || (boardID !== g.BOARD.ID))) {\r\n continue;\r\n }\r\n if (groupByBoard) {\r\n all.push((cont = []));\r\n }\r\n for (var threadID in threads) {\r\n var data = threads[threadID];\r\n if (data && (typeof data === 'object')) {\r\n (groupByBoard ? cont : all).push({siteID, boardID, threadID, data});\r\n }\r\n }\r\n }\r\n }\r\n return all;\r\n },\r\n\r\n makeLine(siteID, boardID, threadID, data) {\r\n let page;\r\n const x = $.el('a', {\r\n textContent: '✕',\r\n href: 'javascript:;'\r\n }\r\n );\r\n $.on(x, 'click', ThreadWatcher.cb.rm);\r\n\r\n let {excerpt, isArchived} = data;\r\n if (!excerpt) { excerpt = `/${boardID}/ - No.${threadID}`; }\r\n if (Conf['Show Site Prefix']) { excerpt = ThreadWatcher.prefixes[siteID] + excerpt; }\r\n\r\n const link = $.el('a', {\r\n href: g.sites[siteID]?.urls.thread({siteID, boardID, threadID}, isArchived) || '',\r\n title: excerpt,\r\n className: 'watcher-link'\r\n }\r\n );\r\n\r\n if (Conf['Show Page'] && (data.page != null)) {\r\n page = $.el('span', {\r\n textContent: `[${data.page}]`,\r\n className: 'watcher-page'\r\n }\r\n );\r\n $.add(link, page);\r\n }\r\n\r\n if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count'] && (data.unread != null)) {\r\n const count = $.el('span', {\r\n textContent: `(${data.unread})`,\r\n className: 'watcher-unread'\r\n }\r\n );\r\n $.add(link, count);\r\n }\r\n\r\n const title = $.el('span', {\r\n textContent: excerpt,\r\n className: 'watcher-title'\r\n }\r\n );\r\n $.add(link, title);\r\n\r\n const div = $.el('div');\r\n const fullID = `${boardID}.${threadID}`;\r\n div.dataset.fullID = fullID;\r\n div.dataset.siteID = siteID;\r\n if ((g.VIEW === 'thread') && (fullID === `${g.BOARD}.${g.THREADID}`)) { $.addClass(div, 'current'); }\r\n if (data.isDead) { $.addClass(div, 'dead-thread'); }\r\n if (Conf['Show Page']) {\r\n if (data.lastPage) { $.addClass(div, 'last-page'); }\r\n if (data.page != null) { div.dataset.page = data.page; }\r\n }\r\n if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) {\r\n if (data.unread === 0) { $.addClass(div, 'replies-read'); }\r\n if (data.unread) { $.addClass(div, 'replies-unread'); }\r\n if ((data.quotingYou || 0) > (data.dismiss || 0)) { $.addClass(div, 'replies-quoting-you'); }\r\n }\r\n $.add(div, [x, $.tn(' '), link]);\r\n return div;\r\n },\r\n\r\n setPrefixes(threads) {\r\n const prefixes = dict();\r\n for (var {siteID} of threads) {\r\n if (siteID in prefixes) { continue; }\r\n var len = 0;\r\n var prefix = '';\r\n var conflicts = Object.keys(prefixes);\r\n while (conflicts.length > 0) {\r\n len++;\r\n prefix = siteID.slice(0, len);\r\n var conflicts2 = [];\r\n for (var siteID2 of conflicts) {\r\n if (siteID2.slice(0, len) === prefix) {\r\n conflicts2.push(siteID2);\r\n } else if (prefixes[siteID2].length < len) {\r\n prefixes[siteID2] = siteID2.slice(0, len);\r\n }\r\n }\r\n conflicts = conflicts2;\r\n }\r\n prefixes[siteID] = prefix;\r\n }\r\n return ThreadWatcher.prefixes = prefixes;\r\n },\r\n\r\n build() {\r\n const nodes = [];\r\n const threads = ThreadWatcher.getAll();\r\n ThreadWatcher.setPrefixes(threads);\r\n for (var {siteID, boardID, threadID, data} of threads) {\r\n // Add missing excerpt for threads added by Auto Watch\r\n var thread;\r\n if ((data.excerpt == null) && (siteID === g.SITE.ID) && (thread = g.threads.get(`${boardID}.${threadID}`)) && thread.OP) {\r\n ThreadWatcher.db.extend({boardID, threadID, val: {excerpt: Get.threadExcerpt(thread)}});\r\n }\r\n nodes.push(ThreadWatcher.makeLine(siteID, boardID, threadID, data));\r\n }\r\n const {list} = ThreadWatcher;\r\n $.rmAll(list);\r\n $.add(list, nodes);\r\n\r\n return ThreadWatcher.refreshIcon();\r\n },\r\n\r\n refresh() {\r\n ThreadWatcher.build();\r\n\r\n g.threads.forEach(function(thread) {\r\n const isWatched = ThreadWatcher.isWatched(thread);\r\n if (thread.OP) {\r\n for (var post of [thread.OP, ...Array.from(thread.OP.clones)]) {\r\n var toggler;\r\n if (toggler = $('.watch-thread-link', post.nodes.info)) {\r\n ThreadWatcher.setToggler(toggler, isWatched);\r\n }\r\n }\r\n }\r\n if (thread.catalogView) { return thread.catalogView.nodes.root.classList.toggle('watched', isWatched); }\r\n });\r\n\r\n if (Conf['Pin Watched Threads']) {\r\n return $.event('SortIndex', {deferred: Conf['Index Mode'] !== 'catalog'});\r\n }\r\n },\r\n\r\n refreshIcon() {\r\n for (var className of ['replies-unread', 'replies-quoting-you']) {\r\n ThreadWatcher.shortcut.classList.toggle(className, !!$(`.${className}`, ThreadWatcher.dialog));\r\n }\r\n },\r\n\r\n update(siteID, boardID, threadID, newData) {\r\n let data, key, line, val;\r\n if (!(data = ThreadWatcher.db?.get({siteID, boardID, threadID}))) { return; }\r\n if (newData.isDead && Conf['Auto Prune']) {\r\n ThreadWatcher.rm(siteID, boardID, threadID);\r\n return;\r\n }\r\n if (newData.isDead || (newData.last === -1)) {\r\n for (key of ['isArchived', 'page', 'lastPage', 'unread', 'quotingyou']) {\r\n if (!(key in newData)) {\r\n newData[key] = undefined;\r\n }\r\n }\r\n }\r\n if ((newData.last != null) && (newData.last < data.last)) {\r\n newData.modified = undefined;\r\n }\r\n let n = 0;\r\n for (key in newData) { val = newData[key]; if (data[key] !== val) { n++; } }\r\n if (!n) { return; }\r\n ThreadWatcher.db.extend({siteID, boardID, threadID, val: newData});\r\n if (line = $(`#watched-threads > [data-site-i-d='${siteID}'][data-full-i-d='${boardID}.${threadID}']`, ThreadWatcher.dialog)) {\r\n const newLine = ThreadWatcher.makeLine(siteID, boardID, threadID, data);\r\n $.replace(line, newLine);\r\n return ThreadWatcher.refreshIcon();\r\n } else {\r\n return ThreadWatcher.refresh();\r\n }\r\n },\r\n\r\n set404(boardID, threadID, cb) {\r\n let data;\r\n if (!(data = ThreadWatcher.db?.get({boardID, threadID}))) { return cb(); }\r\n if (Conf['Auto Prune']) {\r\n ThreadWatcher.db.delete({boardID, threadID});\r\n return cb();\r\n }\r\n if (data.isDead && !((data.isArchived != null) || (data.page != null) || (data.lastPage != null) || (data.unread != null) || (data.quotingYou != null))) { return cb(); }\r\n return ThreadWatcher.db.extend({boardID, threadID, val: {isDead: true, isArchived: undefined, page: undefined, lastPage: undefined, unread: undefined, quotingYou: undefined}}, cb);\r\n },\r\n\r\n toggle(thread) {\r\n const siteID = g.SITE.ID;\r\n const boardID = thread.board.ID;\r\n const threadID = thread.ID;\r\n if (ThreadWatcher.db.get({boardID, threadID})) {\r\n return ThreadWatcher.rm(siteID, boardID, threadID);\r\n } else {\r\n return ThreadWatcher.add(thread);\r\n }\r\n },\r\n\r\n add(thread, cb) {\r\n const data = {};\r\n const siteID = g.SITE.ID;\r\n const boardID = thread.board.ID;\r\n const threadID = thread.ID;\r\n if (thread.isDead) {\r\n if (Conf['Auto Prune'] && ThreadWatcher.db.get({boardID, threadID})) {\r\n ThreadWatcher.rm(siteID, boardID, threadID, cb);\r\n return;\r\n }\r\n data.isDead = true;\r\n }\r\n if (thread.OP) { data.excerpt = Get.threadExcerpt(thread); }\r\n return ThreadWatcher.addRaw(boardID, threadID, data, cb);\r\n },\r\n\r\n addRaw(boardID, threadID, data, cb) {\r\n const oldData = ThreadWatcher.db.get({ boardID, threadID, defaultValue: dict() });\r\n delete oldData.last;\r\n delete oldData.modified;\r\n $.extend(oldData, data);\r\n ThreadWatcher.db.set({boardID, threadID, val: oldData}, cb);\r\n ThreadWatcher.refresh();\r\n const thread = {siteID: g.SITE.ID, boardID, threadID, data, force: true};\r\n if (Conf['Show Page'] && !data.isDead) {\r\n return ThreadWatcher.fetchBoard([thread]);\r\n } else if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) {\r\n return ThreadWatcher.fetchStatus(thread);\r\n }\r\n },\r\n\r\n rm(siteID, boardID, threadID, cb) {\r\n ThreadWatcher.db.delete({siteID, boardID, threadID}, cb);\r\n return ThreadWatcher.refresh();\r\n },\r\n\r\n menu: {\r\n init() {\r\n if (!Conf['Thread Watcher']) { return; }\r\n const menu = (this.menu = new UI.Menu('thread watcher'));\r\n $.on($('.menu-button', ThreadWatcher.dialog), 'click', function(e) {\r\n return menu.toggle(e, this, ThreadWatcher);\r\n });\r\n return this.addMenuEntries();\r\n },\r\n\r\n addHeaderMenuEntry() {\r\n if (g.VIEW !== 'thread') { return; }\r\n const entryEl = $.el('a',\r\n {href: 'javascript:;'});\r\n Header.menu.addEntry({\r\n el: entryEl,\r\n order: 60,\r\n open() {\r\n const [addClass, rmClass, text] = Array.from(!!ThreadWatcher.db.get({boardID: g.BOARD.ID, threadID: g.THREADID}) ?\r\n ['unwatch-thread', 'watch-thread', 'Unwatch thread']\r\n :\r\n ['watch-thread', 'unwatch-thread', 'Watch thread']);\r\n $.addClass(entryEl, addClass);\r\n $.rmClass(entryEl, rmClass);\r\n entryEl.textContent = text;\r\n return true;\r\n }\r\n });\r\n return $.on(entryEl, 'click', () => ThreadWatcher.toggle(g.threads.get(`${g.BOARD}.${g.THREADID}`)));\r\n },\r\n\r\n addMenuEntries() {\r\n const entries = [];\r\n\r\n // `Open all` entry\r\n entries.push({\r\n text: 'Open all threads',\r\n cb: ThreadWatcher.cb.openAll,\r\n open() {\r\n this.el.classList.toggle('disabled', !ThreadWatcher.list.firstElementChild);\r\n return true;\r\n }\r\n });\r\n\r\n // `Open Unread` entry\r\n entries.push({\r\n text: 'Open unread threads',\r\n cb: ThreadWatcher.cb.openUnread,\r\n open() {\r\n this.el.classList.toggle('disabled', !$('.replies-unread', ThreadWatcher.list));\r\n return true;\r\n }\r\n });\r\n\r\n // `Open dead threads` entry\r\n entries.push({\r\n text: 'Open dead threads',\r\n cb: ThreadWatcher.cb.openDeads,\r\n open() {\r\n this.el.classList.toggle('disabled', !$('.dead-thread', ThreadWatcher.list));\r\n return true;\r\n }\r\n });\r\n\r\n // `Prune dead threads` entry\r\n entries.push({\r\n text: 'Prune dead threads',\r\n cb: ThreadWatcher.cb.pruneDeads,\r\n open() {\r\n this.el.classList.toggle('disabled', !$('.dead-thread', ThreadWatcher.list));\r\n return true;\r\n }\r\n });\r\n\r\n // `Dismiss posts quoting you` entry\r\n entries.push({\r\n text: 'Dismiss posts quoting you',\r\n title: 'Unhighlight the thread watcher icon and threads until there are new replies quoting you.',\r\n cb: ThreadWatcher.cb.dismiss,\r\n open() {\r\n this.el.classList.toggle('disabled', !$.hasClass(ThreadWatcher.shortcut, 'replies-quoting-you'));\r\n return true;\r\n }\r\n });\r\n\r\n for (var {text, title, cb, open} of entries) {\r\n var entry = {\r\n el: $.el('a', {\r\n textContent: text,\r\n href: 'javascript:;'\r\n }\r\n )\r\n };\r\n if (title) { entry.el.title = title; }\r\n $.on(entry.el, 'click', cb);\r\n entry.open = open.bind(entry);\r\n this.menu.addEntry(entry);\r\n }\r\n\r\n // Settings checkbox entries:\r\n for (var name in Config.threadWatcher) {\r\n var conf = Config.threadWatcher[name];\r\n this.addCheckbox(name, conf[1]);\r\n }\r\n\r\n },\r\n\r\n addCheckbox(name, desc) {\r\n const entry = {\r\n type: 'thread watcher',\r\n el: UI.checkbox(name, name.replace(' Thread Watcher', ''))\r\n };\r\n entry.el.title = desc;\r\n const input = entry.el.firstElementChild;\r\n if ((name === 'Show Unread Count') && !ThreadWatcher.unreadEnabled) {\r\n input.disabled = true;\r\n $.addClass(entry.el, 'disabled');\r\n entry.el.title += '\\n[Remember Last Read Post is disabled.]';\r\n }\r\n $.on(input, 'change', $.cb.checked);\r\n if (['Current Board', 'Show Page', 'Show Unread Count', 'Show Site Prefix'].includes(name)) { $.on(input, 'change', ThreadWatcher.refresh); }\r\n if (['Show Page', 'Show Unread Count', 'Auto Update Thread Watcher'].includes(name)) { $.on(input, 'change', ThreadWatcher.fetchAuto); }\r\n return this.menu.addEntry(entry);\r\n }\r\n }\r\n};\r\nexport default ThreadWatcher;\r\n","import Redirect from \"../Archive/Redirect\";\r\nimport Board from \"./Board\";\r\nimport Post from \"./Post\";\r\nimport Thread from \"./Thread\";\r\nimport $ from \"../platform/$\";\r\nimport Main from \"../main/Main\";\r\nimport Index from \"../General/Index\";\r\nimport { E, g, Conf, d } from \"../globals/globals\";\r\nimport ImageHost from \"../Images/ImageHost\";\r\nimport CrossOrigin from \"../platform/CrossOrigin\";\r\nimport Get from \"../General/Get\";\r\nimport { dict } from \"../platform/helpers\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS101: Remove unnecessary use of Array.from\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * DS205: Consider reworking code to avoid use of IIFEs\r\n * DS206: Consider reworking classes to avoid initClass\r\n * DS207: Consider shorter variations of null checks\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nexport default class Fetcher {\r\n static initClass() {\r\n \r\n this.prototype.archiveTags = {\r\n '\\n': {innerHTML: \"
            \"},\r\n '[b]': {innerHTML: \"\"},\r\n '[/b]': {innerHTML: \"\"},\r\n '[spoiler]': {innerHTML: \"\"},\r\n '[/spoiler]': {innerHTML: \"\"},\r\n '[code]': {innerHTML: \"
            \"},\r\n      '[/code]':    {innerHTML: \"
            \"},\r\n '[moot]': {innerHTML: \"
            \"},\r\n '[/moot]': {innerHTML: \"
            \"},\r\n '[banned]': {innerHTML: \"\"},\r\n '[/banned]': {innerHTML: \"\"},\r\n '[fortune]'(text) { return {innerHTML: \"\"}; },\r\n '[/fortune]': {innerHTML: \"\"},\r\n '[i]': {innerHTML: \"\"},\r\n '[/i]': {innerHTML: \"\"},\r\n '[red]': {innerHTML: \"\"},\r\n '[/red]': {innerHTML: \"\"},\r\n '[green]': {innerHTML: \"\"},\r\n '[/green]': {innerHTML: \"\"},\r\n '[blue]': {innerHTML: \"\"},\r\n '[/blue]': {innerHTML: \"\"}\r\n };\r\n }\r\n constructor(boardID, threadID, postID, root, quoter) {\r\n let post, thread;\r\n this.boardID = boardID;\r\n this.threadID = threadID;\r\n this.postID = postID;\r\n this.root = root;\r\n this.quoter = quoter;\r\n if (post = g.posts.get(`${this.boardID}.${this.postID}`)) {\r\n this.insert(post);\r\n return;\r\n }\r\n\r\n // 4chan X catalog data\r\n if ((post = Index.replyData?.[`${this.boardID}.${this.postID}`]) && (thread = g.threads.get(`${this.boardID}.${this.threadID}`))) {\r\n const board = g.boards[this.boardID];\r\n post = new Post(g.SITE.Build.postFromObject(post, this.boardID), thread, board, {isFetchedQuote: true});\r\n Main.callbackNodes('Post', [post]);\r\n this.insert(post);\r\n return;\r\n }\r\n\r\n this.root.textContent = `Loading post No.${this.postID}...`;\r\n if (this.threadID) {\r\n const that = this;\r\n $.cache(g.SITE.urls.threadJSON({boardID: this.boardID, threadID: this.threadID}), function({isCached}) {\r\n return that.fetchedPost(this, isCached);\r\n });\r\n } else {\r\n this.archivedPost();\r\n }\r\n }\r\n\r\n insert(post) {\r\n // Stop here if the container has been removed while loading.\r\n if (!this.root.parentNode) { return; }\r\n if (!this.quoter) { this.quoter = post; }\r\n const clone = post.addClone(this.quoter.context, ($.hasClass(this.root, 'dialog')));\r\n Main.callbackNodes('Post', [clone]);\r\n\r\n // Get rid of the side arrows/stubs.\r\n const {nodes} = clone;\r\n $.rmAll(nodes.root);\r\n $.add(nodes.root, nodes.post);\r\n\r\n // Indicate links to the containing post.\r\n const quotes = [...clone.nodes.quotelinks, ...clone.nodes.backlinks];\r\n for (var quote of quotes) {\r\n var {boardID, postID} = Get.postDataFromLink(quote);\r\n if ((postID === this.quoter.ID) && (boardID === this.quoter.board.ID)) {\r\n $.addClass(quote, 'forwardlink');\r\n }\r\n }\r\n\r\n // Set up flag CSS for cross-board links to boards with flags\r\n if (clone.nodes.flag && !(Fetcher.flagCSS || (Fetcher.flagCSS = $('link[href^=\"//s.4cdn.org/css/flags.\"]')))) {\r\n const cssVersion = $('link[href^=\"//s.4cdn.org/css/\"]')?.href.match(/\\d+(?=\\.css$)|$/)[0] || Date.now();\r\n Fetcher.flagCSS = $.el('link', {\r\n rel: 'stylesheet',\r\n href: `//s.4cdn.org/css/flags.${cssVersion}.css`\r\n }\r\n );\r\n $.add(d.head, Fetcher.flagCSS);\r\n }\r\n\r\n $.rmAll(this.root);\r\n $.add(this.root, nodes.root);\r\n return $.event('PostsInserted', null, this.root);\r\n }\r\n\r\n fetchedPost(req, isCached) {\r\n // In case of multiple callbacks for the same request,\r\n // don't parse the same original post more than once.\r\n let post;\r\n if (post = g.posts.get(`${this.boardID}.${this.postID}`)) {\r\n this.insert(post);\r\n return;\r\n }\r\n\r\n const {status} = req;\r\n if (status !== 200) {\r\n // The thread can die by the time we check a quote.\r\n if (status && this.archivedPost()) { return; }\r\n\r\n $.addClass(this.root, 'warning');\r\n this.root.textContent =\r\n status === 404 ?\r\n `Thread No.${this.threadID} 404'd.`\r\n : !status ?\r\n 'Connection Error'\r\n :\r\n `Error ${req.statusText} (${req.status}).`;\r\n return;\r\n }\r\n\r\n const {posts} = req.response;\r\n g.SITE.Build.spoilerRange[this.boardID] = posts[0].custom_spoiler;\r\n for (post of posts) {\r\n if (post.no === this.postID) { break; }\r\n } // we found it!\r\n\r\n if (post.no !== this.postID) {\r\n // Cached requests can be stale and must be rechecked.\r\n if (isCached) {\r\n const api = g.SITE.urls.threadJSON({boardID: this.boardID, threadID: this.threadID});\r\n $.cleanCache(url => url === api);\r\n const that = this;\r\n $.cache(api, function() {\r\n return that.fetchedPost(this, false);\r\n });\r\n return;\r\n }\r\n\r\n // The post can be deleted by the time we check a quote.\r\n if (this.archivedPost()) { return; }\r\n\r\n $.addClass(this.root, 'warning');\r\n this.root.textContent = `Post No.${this.postID} was not found.`;\r\n return;\r\n }\r\n\r\n const board = g.boards[this.boardID] ||\r\n new Board(this.boardID);\r\n const thread = g.threads.get(`${this.boardID}.${this.threadID}`) ||\r\n new Thread(this.threadID, board);\r\n post = new Post(g.SITE.Build.postFromObject(post, this.boardID), thread, board, {isFetchedQuote: true});\r\n Main.callbackNodes('Post', [post]);\r\n return this.insert(post);\r\n }\r\n\r\n archivedPost() {\r\n let url;\r\n if (!Conf['Resurrect Quotes']) { return false; }\r\n if (!(url = Redirect.to('post', {boardID: this.boardID, postID: this.postID}))) { return false; }\r\n const archive = Redirect.data.post[this.boardID];\r\n const encryptionOK = /^https:\\/\\//.test(url) || (location.protocol === 'http:');\r\n if (encryptionOK || Conf['Exempt Archives from Encryption']) {\r\n const that = this;\r\n CrossOrigin.cache(url, function() {\r\n if (!encryptionOK && this.response?.media) {\r\n const {media} = this.response;\r\n for (var key in media) {\r\n // Image/thumbnail URLs loaded over HTTP can be modified in transit.\r\n // Require them to be from an HTTP host so that no referrer is sent to them from an HTTPS page.\r\n if (/_link$/.test(key)) {\r\n if (!$.getOwn(media, key)?.match(/^http:\\/\\//)) { delete media[key]; }\r\n }\r\n }\r\n }\r\n return that.parseArchivedPost(this.response, url, archive);\r\n });\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n parseArchivedPost(data, url, archive) {\r\n // In case of multiple callbacks for the same request,\r\n // don't parse the same original post more than once.\r\n let post;\r\n if (post = g.posts.get(`${this.boardID}.${this.postID}`)) {\r\n this.insert(post);\r\n return;\r\n }\r\n\r\n if (data == null) {\r\n $.addClass(this.root, 'warning');\r\n this.root.textContent = `Error fetching Post No.${this.postID} from ${archive.name}.`;\r\n return;\r\n }\r\n\r\n if (data.error) {\r\n $.addClass(this.root, 'warning');\r\n this.root.textContent = data.error;\r\n return;\r\n }\r\n\r\n // https://github.com/eksopl/asagi/blob/v0.4.0b74/src/main/java/net/easymodo/asagi/YotsubaAbstract.java#L82-L129\r\n // https://github.com/FoolCode/FoolFuuka/blob/800bd090835489e7e24371186db6e336f04b85c0/src/Model/Comment.php#L368-L428\r\n // https://github.com/bstats/b-stats/blob/6abe7bffaf6e5f523498d760e54b110df5331fbb/inc/classes/Yotsuba.php#L157-L168\r\n let comment = (data.comment || '').split(/(\\n|\\[\\/?(?:b|spoiler|code|moot|banned|fortune(?: color=\"#\\w+\")?|i|red|green|blue)\\])/);\r\n comment = (() => {\r\n const result = [];\r\n for (let i = 0; i < comment.length; i++) {\r\n var text = comment[i];\r\n if ((i % 2) === 1) {\r\n var tag = Fetcher.archiveTags[text.replace(/\\ .*\\]/, ']')];\r\n if (typeof tag === 'function') { result.push(tag(text)); } else { result.push(tag); }\r\n } else {\r\n var greentext = text[0] === '>';\r\n text = text.replace(/(\\[\\/?[a-z]+):lit(\\])/g, '$1$2');\r\n text = text.split(/(>>(?:>\\/[a-z\\d]+\\/)?\\d+)/g).map((text2, j) =>\r\n {innerHTML: ((j % 2) ? \"\" + E(text2) + \"\" : E(text2));});\r\n text = {innerHTML: ((greentext) ? \"\" + E.cat(text) + \"\" : E.cat(text))};\r\n result.push(text);\r\n }\r\n }\r\n return result;\r\n })();\r\n comment = {innerHTML: E.cat(comment)};\r\n\r\n this.threadID = +data.thread_num;\r\n const o = {\r\n ID: this.postID,\r\n threadID: this.threadID,\r\n boardID: this.boardID,\r\n isReply: this.postID !== this.threadID\r\n };\r\n o.info = {\r\n subject: data.title,\r\n email: data.email,\r\n name: data.name || '',\r\n tripcode: data.trip,\r\n capcode: (() => { switch (data.capcode) {\r\n // https://github.com/pleebe/FoolFuuka/blob/bf4224eed04637a4d0bd4411c2bf5f9945dfec0b/assets/themes/foolz/foolfuuka-theme-fuuka/src/Partial/Board.php#L77\r\n case 'M': return 'Mod';\r\n case 'A': return 'Admin';\r\n case 'D': return 'Developer';\r\n case 'V': return 'Verified';\r\n case 'F': return 'Founder';\r\n case 'G': return 'Manager';\r\n } })(),\r\n uniqueID: data.poster_hash,\r\n flagCode: data.poster_country,\r\n flagCodeTroll: data.troll_country_code,\r\n flag: data.poster_country_name || data.troll_country_name,\r\n dateUTC: data.timestamp,\r\n dateText: data.fourchan_date,\r\n commentHTML: comment\r\n };\r\n if (o.info.capcode) { delete o.info.uniqueID; }\r\n if (data.media && !!+data.media.banned) {\r\n o.fileDeleted = true;\r\n } else if (data.media?.media_filename) {\r\n let {thumb_link} = data.media;\r\n // Fix URLs missing origin\r\n if (thumb_link?.[0] === '/') { thumb_link = url.split('/', 3).join('/') + thumb_link; }\r\n if (!Redirect.securityCheck(thumb_link)) { thumb_link = ''; }\r\n let media_link = Redirect.to('file', {boardID: this.boardID, filename: data.media.media_orig});\r\n if (!Redirect.securityCheck(media_link)) { media_link = ''; }\r\n o.file = {\r\n name: data.media.media_filename,\r\n url: media_link ||\r\n (this.boardID === 'f' ?\r\n `${location.protocol}//${ImageHost.flashHost()}/${this.boardID}/${encodeURIComponent(E(data.media.media_filename))}`\r\n :\r\n `${location.protocol}//${ImageHost.host()}/${this.boardID}/${data.media.media_orig}`),\r\n height: data.media.media_h,\r\n width: data.media.media_w,\r\n MD5: data.media.media_hash,\r\n size: $.bytesToString(data.media.media_size),\r\n thumbURL: thumb_link || `${location.protocol}//${ImageHost.thumbHost()}/${this.boardID}/${data.media.preview_orig}`,\r\n theight: data.media.preview_h,\r\n twidth: data.media.preview_w,\r\n isSpoiler: data.media.spoiler === '1'\r\n };\r\n if (!/\\.pdf$/.test(o.file.url)) { o.file.dimensions = `${o.file.width}x${o.file.height}`; }\r\n if ((this.boardID === 'f') && data.media.exif) { o.file.tag = JSON.parse(data.media.exif).Tag; }\r\n }\r\n o.extra = dict();\r\n\r\n const board = g.boards[this.boardID] ||\r\n new Board(this.boardID);\r\n const thread = g.threads.get(`${this.boardID}.${this.threadID}`) ||\r\n new Thread(this.threadID, board);\r\n post = new Post(g.SITE.Build.post(o), thread, board, {isFetchedQuote: true});\r\n post.kill();\r\n if (post.file) { post.file.thumbURL = o.file.thumbURL; }\r\n Main.callbackNodes('Post', [post]);\r\n return this.insert(post);\r\n }\r\n}\r\nFetcher.initClass();\r\n","import Callbacks from \"../classes/Callbacks\";\r\nimport Fetcher from \"../classes/Fetcher\";\r\nimport Get from \"../General/Get\";\r\nimport Header from \"../General/Header\";\r\nimport UI from \"../General/UI\";\r\nimport { Conf, d, g } from \"../globals/globals\";\r\nimport ExpandComment from \"../Miscellaneous/ExpandComment\";\r\nimport $ from \"../platform/$\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS101: Remove unnecessary use of Array.from\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar QuotePreview = {\r\n init() {\r\n if (!Conf['Quote Previewing']) { return; }\r\n\r\n if (g.VIEW === 'archive') {\r\n $.on(d, 'mouseover', function(e) {\r\n if ((e.target.nodeName === 'A') && $.hasClass(e.target, 'quotelink')) {\r\n return QuotePreview.mouseover.call(e.target, e);\r\n }\r\n });\r\n }\r\n\r\n if (!['index', 'thread'].includes(g.VIEW)) { return; }\r\n\r\n if (Conf['Comment Expansion']) {\r\n ExpandComment.callbacks.push(this.node);\r\n }\r\n\r\n return Callbacks.Post.push({\r\n name: 'Quote Previewing',\r\n cb: this.node\r\n });\r\n },\r\n\r\n node() {\r\n for (var link of this.nodes.quotelinks.concat([...Array.from(this.nodes.backlinks)], this.nodes.archivelinks)) {\r\n $.on(link, 'mouseover', QuotePreview.mouseover);\r\n }\r\n },\r\n\r\n mouseover(e) {\r\n let origin;\r\n if (($.hasClass(this, 'inlined') && !$.hasClass(doc, 'catalog-mode')) || !d.contains(this)) { return; }\r\n\r\n const {boardID, threadID, postID} = Get.postDataFromLink(this);\r\n\r\n const qp = $.el('div', {\r\n id: 'qp',\r\n className: 'dialog'\r\n }\r\n );\r\n\r\n $.add(Header.hover, qp);\r\n new Fetcher(boardID, threadID, postID, qp, Get.postFromNode(this));\r\n\r\n UI.hover({\r\n root: this,\r\n el: qp,\r\n latestEvent: e,\r\n endEvents: 'mouseout click',\r\n cb: QuotePreview.mouseout\r\n });\r\n\r\n if (Conf['Quote Highlighting'] && (origin = g.posts.get(`${boardID}.${postID}`))) {\r\n const posts = [origin].concat(origin.clones);\r\n // Remove the clone that's in the qp from the array.\r\n posts.pop();\r\n for (var post of posts) {\r\n $.addClass(post.nodes.post, 'qphl');\r\n }\r\n }\r\n },\r\n\r\n mouseout() {\r\n // Stop if it only contains text.\r\n let root;\r\n if (!(root = this.el.firstElementChild)) { return; }\r\n\r\n $.event('PostsRemoved', null, Header.hover);\r\n\r\n const clone = Get.postFromRoot(root);\r\n let post = clone.origin;\r\n post.rmClone(root.dataset.clone);\r\n\r\n if (!Conf['Quote Highlighting']) { return; }\r\n for (post of [post].concat(post.clones)) {\r\n $.rmClass(post.nodes.post, 'qphl');\r\n }\r\n }\r\n};\r\nexport default QuotePreview;\r\n","/*\r\n * decaffeinate suggestions:\r\n * DS101: Remove unnecessary use of Array.from\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * DS205: Consider reworking code to avoid use of IIFEs\r\n * DS207: Consider shorter variations of null checks\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nimport Callbacks from '../classes/Callbacks';\r\nimport CatalogThread from '../classes/CatalogThread';\r\nimport Notice from '../classes/Notice';\r\nimport Post from '../classes/Post';\r\nimport Thread from '../classes/Thread';\r\nimport Config from '../config/Config';\r\nimport Filter from '../Filtering/Filter';\r\nimport PostHiding from '../Filtering/PostHiding';\r\nimport ThreadHiding from '../Filtering/ThreadHiding';\r\nimport Main from '../main/Main';\r\nimport CatalogLinks from '../Miscellaneous/CatalogLinks';\r\nimport RelativeDates from '../Miscellaneous/RelativeDates';\r\nimport ThreadWatcher from '../Monitoring/ThreadWatcher';\r\nimport $$ from '../platform/$$';\r\nimport $ from '../platform/$';\r\nimport QuotePreview from '../Quotelinks/QuotePreview';\r\nimport { c, Conf, d, doc, g } from '../globals/globals';\r\nimport Header from './Header';\r\nimport UI from './UI';\r\nimport Menu from '../Menu/Menu';\r\n\r\nimport NavLinksPage from './Index/NavLinks.html';\r\nimport PageList from './Index/PageList.html';\r\nimport BoardConfig from './BoardConfig';\r\nimport Get from './Get';\r\nimport { dict, SECOND } from '../platform/helpers';\r\n\r\nvar Index = {\r\n showHiddenThreads: false,\r\n changed: {},\r\n\r\n enabledOn({siteID, boardID}) {\r\n return Conf['JSON Index'] && (g.sites[siteID].software === 'yotsuba') && (boardID !== 'f');\r\n },\r\n\r\n init() {\r\n let input, inputs, name;\r\n if (g.VIEW !== 'index') { return; }\r\n\r\n // For IndexRefresh events\r\n $.one(d, '4chanXInitFinished', this.cb.initFinished);\r\n $.on(d, 'PostsInserted', this.cb.postsInserted);\r\n\r\n if (!this.enabledOn(g.BOARD)) { return; }\r\n\r\n this.enabled = true;\r\n\r\n Callbacks.Post.push({\r\n name: 'Index Page Numbers',\r\n cb: this.node\r\n });\r\n Callbacks.CatalogThread.push({\r\n name: 'Catalog Features',\r\n cb: this.catalogNode\r\n });\r\n\r\n this.search = history.state?.searched || '';\r\n if (history.state?.mode) {\r\n Conf['Index Mode'] = history.state?.mode;\r\n }\r\n this.currentSort = history.state?.sort;\r\n if (!this.currentSort) { this.currentSort = typeof Conf['Index Sort'] === 'object' ? (\r\n Conf['Index Sort'][g.BOARD.ID] || 'bump'\r\n ) : (\r\n Conf['Index Sort']\r\n ); }\r\n this.currentPage = this.getCurrentPage();\r\n this.processHash();\r\n\r\n $.addClass(doc, 'index-loading', `${Conf['Index Mode'].replace(/\\ /g, '-')}-mode`);\r\n $.on(window, 'popstate', this.cb.popstate);\r\n $.on(d, 'scroll', this.scroll);\r\n $.on(d, 'SortIndex', this.cb.resort);\r\n\r\n // Header refresh button\r\n this.button = $.el('a', {\r\n title: 'Refresh',\r\n href: 'javascript:;',\r\n textContent: '🗘'\r\n }\r\n );\r\n $.on(this.button, 'click', () => Index.update());\r\n Header.addShortcut('index-refresh', this.button, 590);\r\n\r\n // Header \"Index Navigation\" submenu\r\n const entries = [];\r\n this.inputs = (inputs = dict());\r\n for (name in Config.Index) {\r\n var arr = Config.Index[name];\r\n if (arr instanceof Array) {\r\n var label = UI.checkbox(name, `${name[0]}${name.slice(1).toLowerCase()}`);\r\n label.title = arr[1];\r\n entries.push({el: label});\r\n input = label.firstChild;\r\n $.on(input, 'change', $.cb.checked);\r\n inputs[name] = input;\r\n }\r\n }\r\n $.on(inputs['Show Replies'], 'change', this.cb.replies);\r\n $.on(inputs['Catalog Hover Expand'], 'change', this.cb.hover);\r\n $.on(inputs['Pin Watched Threads'], 'change', this.cb.resort);\r\n $.on(inputs['Anchor Hidden Threads'], 'change', this.cb.resort);\r\n\r\n const watchSettings = function(e) {\r\n if (input = $.getOwn(inputs, e.target.name)) {\r\n input.checked = e.target.checked;\r\n return $.event('change', null, input);\r\n }\r\n };\r\n $.on(d, 'OpenSettings', () => $.on($.id('fourchanx-settings'), 'change', watchSettings));\r\n\r\n const sortEntry = UI.checkbox('Per-Board Sort Type', 'Per-board sort type', (typeof Conf['Index Sort'] === 'object'));\r\n sortEntry.title = 'Set the sorting order of each board independently.';\r\n $.on(sortEntry.firstChild, 'change', this.cb.perBoardSort);\r\n entries.splice(3, 0, {el: sortEntry});\r\n\r\n Header.menu.addEntry({\r\n el: $.el('span',\r\n {textContent: 'Index Navigation'}),\r\n order: 100,\r\n subEntries: entries\r\n });\r\n\r\n // Navigation links at top of index\r\n this.navLinks = $.el('div', {className: 'navLinks json-index'});\r\n $.extend(this.navLinks, {innerHTML: NavLinksPage});\r\n $('.cataloglink a', this.navLinks).href = CatalogLinks.catalog();\r\n if (!BoardConfig.isArchived(g.BOARD.ID)) { $('.archlistlink', this.navLinks).hidden = true; }\r\n $.on($('#index-last-refresh a', this.navLinks), 'click', this.cb.refreshFront);\r\n\r\n // Search field\r\n this.searchInput = $('#index-search', this.navLinks);\r\n this.setupSearch();\r\n $.on(this.searchInput, 'input', this.onSearchInput);\r\n $.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch);\r\n\r\n // Hidden threads toggle\r\n this.hideLabel = $('#hidden-label', this.navLinks);\r\n $.on($('#hidden-toggle a', this.navLinks), 'click', this.cb.toggleHiddenThreads);\r\n\r\n // Drop-down menus and reverse sort toggle\r\n this.selectRev = $('#index-rev', this.navLinks);\r\n this.selectMode = $('#index-mode', this.navLinks);\r\n this.selectSort = $('#index-sort', this.navLinks);\r\n this.selectSize = $('#index-size', this.navLinks);\r\n $.on(this.selectRev, 'change', this.cb.sort);\r\n $.on(this.selectMode, 'change', this.cb.mode);\r\n $.on(this.selectSort, 'change', this.cb.sort);\r\n $.on(this.selectSize, 'change', $.cb.value);\r\n $.on(this.selectSize, 'change', this.cb.size);\r\n for (var select of [this.selectMode, this.selectSize]) {\r\n select.value = Conf[select.name];\r\n }\r\n this.selectRev.checked = /-rev$/.test(Index.currentSort);\r\n this.selectSort.value = Index.currentSort.replace(/-rev$/, '');\r\n\r\n // Last Long Reply options\r\n this.lastLongOptions = $('#lastlong-options', this.navLinks);\r\n this.lastLongInputs = $$('input', this.lastLongOptions);\r\n this.lastLongThresholds = [0, 0];\r\n this.lastLongOptions.hidden = (this.selectSort.value !== 'lastlong');\r\n for (let i = 0; i < this.lastLongInputs.length; i++) {\r\n input = this.lastLongInputs[i];\r\n $.on(input, 'change', this.cb.lastLongThresholds);\r\n var tRaw = Conf[`Last Long Reply Thresholds ${i}`];\r\n input.value = (this.lastLongThresholds[i] =\r\n typeof tRaw === 'object' ? (tRaw[g.BOARD.ID] ?? 100) : tRaw);\r\n }\r\n\r\n // Thread container\r\n this.root = $.el('div', {className: 'board json-index'});\r\n $.on(this.root, 'click', this.cb.hoverToggle);\r\n this.cb.size();\r\n this.cb.hover();\r\n\r\n // Page list\r\n this.pagelist = $.el('div', {className: 'pagelist json-index'});\r\n $.extend(this.pagelist, {innerHTML: PageList});\r\n $('.cataloglink a', this.pagelist).href = CatalogLinks.catalog();\r\n $.on(this.pagelist, 'click', this.cb.pageNav);\r\n\r\n this.update(true);\r\n\r\n $.onExists(doc, 'title + *', () => d.title = d.title.replace(/\\ -\\ Page\\ \\d+/, ''));\r\n\r\n $.onExists(doc, '.board > .thread > .postContainer, .board + *', function() {\r\n let el;\r\n g.SITE.Build.hat = $('.board > .thread > img:first-child');\r\n if (g.SITE.Build.hat) {\r\n g.BOARD.threads.forEach(function(thread) {\r\n if (thread.nodes.root) {\r\n return $.prepend(thread.nodes.root, g.SITE.Build.hat.cloneNode(false));\r\n }\r\n });\r\n $.addClass(doc, 'hats-enabled');\r\n $.addStyle(`.catalog-thread::after {background-image: url(${g.SITE.Build.hat.src});}`);\r\n }\r\n\r\n const board = $('.board');\r\n $.replace(board, Index.root);\r\n if (Index.loaded) {\r\n $.event('PostsInserted', null, Index.root);\r\n }\r\n // Hacks:\r\n // - When removing an element from the document during page load,\r\n // its ancestors will still be correctly created inside of it.\r\n // - Creating loadable elements inside of an origin-less document\r\n // will not download them.\r\n // - Combine the two and you get a download canceller!\r\n // Does not work on Firefox unfortunately. bugzil.la/939713\r\n try {\r\n d.implementation.createDocument(null, null, null).appendChild(board);\r\n } catch (error) {}\r\n\r\n for (el of $$('.navLinks')) { $.rm(el); }\r\n $.rm($.id('ctrl-top'));\r\n const topNavPos = $.id('delform').previousElementSibling;\r\n $.before(topNavPos, $.el('hr'));\r\n $.before(topNavPos, Index.navLinks);\r\n const timeEl = $('#index-last-refresh time', Index.navLinks);\r\n if (timeEl.dataset.utc) { return RelativeDates.update(timeEl); }\r\n });\r\n\r\n return Main.ready(function() {\r\n let pagelist;\r\n if (pagelist = $('.pagelist')) {\r\n $.replace(pagelist, Index.pagelist);\r\n }\r\n return $.rmClass(doc, 'index-loading');\r\n });\r\n },\r\n\r\n scroll() {\r\n if (Index.req || !Index.liveThreadData || (Conf['Index Mode'] !== 'infinite') || (window.scrollY <= (doc.scrollHeight - (300 + window.innerHeight)))) { return; }\r\n if (Index.pageNum == null) { Index.pageNum = Index.currentPage; } // Avoid having to pushState to keep track of the current page\r\n\r\n const pageNum = ++Index.pageNum;\r\n if (pageNum > Index.pagesNum) { return Index.endNotice(); }\r\n\r\n const threadIDs = Index.threadsOnPage(pageNum);\r\n return Index.buildStructure(threadIDs);\r\n },\r\n\r\n endNotice: (function() {\r\n let notify = false;\r\n const reset = () => notify = false;\r\n return function() {\r\n if (notify) { return; }\r\n notify = true;\r\n new Notice('info', \"Last page reached.\", 2);\r\n return setTimeout(reset, 3 * SECOND);\r\n };\r\n })(),\r\n\r\n menu: {\r\n init() {\r\n if ((g.VIEW !== 'index') || !Conf['Menu'] || !Conf['Thread Hiding Link'] || !Index.enabledOn(g.BOARD)) { return; }\r\n\r\n return Menu.menu.addEntry({\r\n el: $.el('a', {\r\n href: 'javascript:;',\r\n className: 'has-shortcut-text'\r\n }\r\n , {innerHTML: \"Shift+click\"}),\r\n order: 20,\r\n open({thread}) {\r\n if (Conf['Index Mode'] !== 'catalog') { return false; }\r\n this.el.firstElementChild.textContent = thread.isHidden ?\r\n 'Unhide'\r\n :\r\n 'Hide';\r\n if (this.cb) { $.off(this.el, 'click', this.cb); }\r\n this.cb = function() {\r\n $.event('CloseMenu');\r\n return Index.toggleHide(thread);\r\n };\r\n $.on(this.el, 'click', this.cb);\r\n return true;\r\n }\r\n });\r\n }\r\n },\r\n\r\n node() {\r\n if (this.isReply || this.isClone || (Index.threadPosition[this.ID] == null)) { return; }\r\n return this.thread.setPage(Math.floor(Index.threadPosition[this.ID] / Index.threadsNumPerPage) + 1);\r\n },\r\n\r\n catalogNode() {\r\n return $.on(this.nodes.root, 'mousedown click', e => {\r\n if ((e.button !== 0) || !e.shiftKey) { return; }\r\n if (e.type === 'click') { Index.toggleHide(this.thread); }\r\n return e.preventDefault();\r\n });\r\n }, // Also on mousedown to prevent highlighting text.\r\n\r\n toggleHide(thread) {\r\n if (Index.showHiddenThreads) {\r\n ThreadHiding.show(thread);\r\n if (!ThreadHiding.db.get({boardID: thread.board.ID, threadID: thread.ID})) { return; }\r\n // Don't save when un-hiding filtered threads.\r\n } else {\r\n ThreadHiding.hide(thread);\r\n }\r\n return ThreadHiding.saveHiddenState(thread);\r\n },\r\n\r\n cycleSortType() {\r\n let i;\r\n const types = [...Array.from(Index.selectSort.options)].filter(option => !option.disabled);\r\n for (i = 0; i < types.length; i++) {\r\n var type = types[i];\r\n if (type.selected) { break; }\r\n }\r\n types[(i + 1) % types.length].selected = true;\r\n return $.event('change', null, Index.selectSort);\r\n },\r\n\r\n cb: {\r\n initFinished() {\r\n Index.initFinishedFired = true;\r\n return $.queueTask(() => Index.cb.postsInserted());\r\n },\r\n\r\n postsInserted() {\r\n if (!Index.initFinishedFired) { return; }\r\n let n = 0;\r\n g.posts.forEach(function(post) {\r\n if (!post.isFetchedQuote && !post.indexRefreshSeen && doc.contains(post.nodes.root)) {\r\n post.indexRefreshSeen = true;\r\n return n++;\r\n }\r\n });\r\n if (n) { return $.event('IndexRefresh'); }\r\n },\r\n\r\n toggleHiddenThreads() {\r\n $('#hidden-toggle a', Index.navLinks).textContent = (Index.showHiddenThreads = !Index.showHiddenThreads) ?\r\n 'Hide'\r\n :\r\n 'Show';\r\n Index.sort();\r\n return Index.buildIndex();\r\n },\r\n\r\n mode() {\r\n Index.pushState({mode: this.value});\r\n return Index.pageLoad(false);\r\n },\r\n\r\n sort() {\r\n const value = Index.selectRev.checked ? Index.selectSort.value + \"-rev\" : Index.selectSort.value;\r\n Index.pushState({sort: value});\r\n return Index.pageLoad(false);\r\n },\r\n\r\n resort(e) {\r\n Index.changed.order = true;\r\n if (!e?.detail?.deferred) { return Index.pageLoad(false); }\r\n },\r\n\r\n perBoardSort() {\r\n Conf['Index Sort'] = this.checked ? dict() : '';\r\n Index.saveSort();\r\n for (let i = 0; i < 2; i++) {\r\n Conf[`Last Long Reply Thresholds ${i}`] = this.checked ? dict() : '';\r\n Index.saveLastLongThresholds(i);\r\n }\r\n },\r\n\r\n lastLongThresholds() {\r\n const i = [...Array.from(this.parentNode.children)].indexOf(this);\r\n const value = +this.value;\r\n if (!Number.isFinite(value)) {\r\n this.value = Index.lastLongThresholds[i];\r\n return;\r\n }\r\n Index.lastLongThresholds[i] = value;\r\n Index.saveLastLongThresholds(i);\r\n Index.changed.order = true;\r\n return Index.pageLoad(false);\r\n },\r\n\r\n size(e) {\r\n if (Conf['Index Mode'] !== 'catalog') {\r\n $.rmClass(Index.root, 'catalog-small');\r\n $.rmClass(Index.root, 'catalog-large');\r\n } else if (Conf['Index Size'] === 'small') {\r\n $.addClass(Index.root, 'catalog-small');\r\n $.rmClass(Index.root, 'catalog-large');\r\n } else {\r\n $.addClass(Index.root, 'catalog-large');\r\n $.rmClass(Index.root, 'catalog-small');\r\n }\r\n if (e) { return Index.buildIndex(); }\r\n },\r\n\r\n replies() {\r\n return Index.buildIndex();\r\n },\r\n\r\n hover() {\r\n return doc.classList.toggle('catalog-hover-expand', Conf['Catalog Hover Expand']);\r\n },\r\n\r\n hoverToggle(e) {\r\n if (Conf['Catalog Hover Toggle'] && $.hasClass(doc, 'catalog-mode') && !$.modifiedClick(e) && !$.x('ancestor-or-self::a', e.target)) {\r\n let thread;\r\n const input = Index.inputs['Catalog Hover Expand'];\r\n input.checked = !input.checked;\r\n $.event('change', null, input);\r\n if (thread = Get.threadFromNode(e.target)) {\r\n Index.cb.catalogReplies.call(thread);\r\n return Index.cb.hoverAdjust.call(thread.OP.nodes);\r\n }\r\n }\r\n },\r\n\r\n popstate(e) {\r\n if (e?.state) {\r\n const {searched, mode, sort} = e.state;\r\n const page = Index.getCurrentPage();\r\n Index.setState({search: searched, mode, sort, page});\r\n return Index.pageLoad(false);\r\n } else {\r\n // page load or hash change\r\n const nCommands = Index.processHash();\r\n if (Conf['Refreshed Navigation'] && nCommands) {\r\n return Index.update();\r\n } else {\r\n return Index.pageLoad();\r\n }\r\n }\r\n },\r\n\r\n pageNav(e) {\r\n let a;\r\n if ($.modifiedClick(e)) { return; }\r\n switch (e.target.nodeName) {\r\n case 'BUTTON':\r\n e.target.blur();\r\n a = e.target.parentNode;\r\n break;\r\n case 'A':\r\n a = e.target;\r\n break;\r\n default:\r\n return;\r\n }\r\n if (a.textContent === 'Catalog') { return; }\r\n e.preventDefault();\r\n return Index.userPageNav(+a.pathname.split(/\\/+/)[2] || 1);\r\n },\r\n\r\n refreshFront() {\r\n Index.pushState({page: 1});\r\n return Index.update();\r\n },\r\n\r\n catalogReplies() {\r\n if (Conf['Show Replies'] && $.hasClass(doc, 'catalog-hover-expand') && !this.catalogView.nodes.replies) {\r\n return Index.buildCatalogReplies(this);\r\n }\r\n },\r\n\r\n hoverAdjust() {\r\n // Prevent hovered catalog threads from going offscreen.\r\n let x;\r\n if (!$.hasClass(doc, 'catalog-hover-expand')) { return; }\r\n const rect = this.post.getBoundingClientRect();\r\n if (x = $.minmax(0, -rect.left, doc.clientWidth - rect.right)) {\r\n const {style} = this.post;\r\n style.left = `${x}px`;\r\n style.right = `${-x}px`;\r\n return $.one(this.root, 'mouseleave', () => style.left = (style.right = null));\r\n }\r\n }\r\n },\r\n\r\n scrollToIndex() {\r\n // Scroll to navlinks, or top of board if navlinks are hidden.\r\n return Header.scrollToIfNeeded((Index.navLinks.getBoundingClientRect().height ? Index.navLinks : Index.root));\r\n },\r\n\r\n getCurrentPage() {\r\n return +window.location.pathname.split(/\\/+/)[2] || 1;\r\n },\r\n\r\n userPageNav(page) {\r\n Index.pushState({page});\r\n if (Conf['Refreshed Navigation']) {\r\n return Index.update();\r\n } else {\r\n return Index.pageLoad();\r\n }\r\n },\r\n\r\n hashCommands: {\r\n mode: {\r\n 'paged': 'paged',\r\n 'infinite-scrolling': 'infinite',\r\n 'infinite': 'infinite',\r\n 'all-threads': 'all pages',\r\n 'all-pages': 'all pages',\r\n 'catalog': 'catalog'\r\n },\r\n sort: {\r\n 'bump-order': 'bump',\r\n 'last-reply': 'lastreply',\r\n 'last-long-reply': 'lastlong',\r\n 'creation-date': 'birth',\r\n 'reply-count': 'replycount',\r\n 'file-count': 'filecount',\r\n 'posts-per-minute': 'activity'\r\n }\r\n },\r\n\r\n processHash() {\r\n // XXX https://bugzilla.mozilla.org/show_bug.cgi?id=483304\r\n let hash = location.href.match(/#.*/)?.[0] || '';\r\n const state =\r\n {replace: true};\r\n const commands = hash.slice(1).split('/');\r\n const leftover = [];\r\n for (var command of commands) {\r\n var mode, sort;\r\n if (mode = $.getOwn(Index.hashCommands.mode, command)) {\r\n state.mode = mode;\r\n } else if (command === 'index') {\r\n state.mode = Conf['Previous Index Mode'];\r\n state.page = 1;\r\n } else if (sort = $.getOwn(Index.hashCommands.sort, command.replace(/-rev$/, ''))) {\r\n state.sort = sort;\r\n if (/-rev$/.test(command)) { state.sort += '-rev'; }\r\n } else if (/^s=/.test(command)) {\r\n state.search = decodeURIComponent(command.slice(2)).replace(/\\+/g, ' ').trim();\r\n } else {\r\n leftover.push(command);\r\n }\r\n }\r\n hash = leftover.join('/');\r\n if (hash) { state.hash = `#${hash}`; }\r\n Index.pushState(state);\r\n return commands.length - leftover.length;\r\n },\r\n\r\n pushState(state) {\r\n let {search, hash, replace} = state;\r\n let pageBeforeSearch = history.state?.oldpage;\r\n if ((search != null) && (search !== Index.search)) {\r\n state.page = search ? 1 : (pageBeforeSearch || 1);\r\n if (!search) {\r\n pageBeforeSearch = undefined;\r\n } else if (!Index.search) {\r\n pageBeforeSearch = Index.currentPage;\r\n }\r\n }\r\n Index.setState(state);\r\n const pathname = Index.currentPage === 1 ? `/${g.BOARD}/` : `/${g.BOARD}/${Index.currentPage}`;\r\n if (!hash) { hash = ''; }\r\n return history[replace ? 'replaceState' : 'pushState']({\r\n mode: Conf['Index Mode'],\r\n sort: Index.currentSort,\r\n searched: Index.search,\r\n oldpage: pageBeforeSearch\r\n }\r\n , '', `${location.protocol}//${location.host}${pathname}${hash}`);\r\n },\r\n\r\n setState({search, mode, sort, page, hash}) {\r\n if ((search != null) && (search !== Index.search)) {\r\n Index.changed.search = true;\r\n Index.search = search;\r\n }\r\n if ((mode != null) && (mode !== Conf['Index Mode'])) {\r\n Index.changed.mode = true;\r\n Conf['Index Mode'] = mode;\r\n $.set('Index Mode', mode);\r\n if ((mode !== 'catalog') && (Conf['Previous Index Mode'] !== mode)) {\r\n Conf['Previous Index Mode'] = mode;\r\n $.set('Previous Index Mode', mode);\r\n }\r\n }\r\n if ((sort != null) && (sort !== Index.currentSort)) {\r\n Index.changed.sort = true;\r\n Index.currentSort = sort;\r\n Index.saveSort();\r\n }\r\n if (['all pages', 'catalog'].includes(Conf['Index Mode'])) { page = 1; }\r\n if ((page != null) && (page !== Index.currentPage)) {\r\n Index.changed.page = true;\r\n Index.currentPage = page;\r\n }\r\n if (hash != null) {\r\n return Index.changed.hash = true;\r\n }\r\n },\r\n\r\n savePerBoard(key, value) {\r\n if (typeof Conf[key] === 'object') {\r\n Conf[key][g.BOARD.ID] = value;\r\n } else {\r\n Conf[key] = value;\r\n }\r\n return $.set(key, Conf[key]);\r\n },\r\n\r\n saveSort() {\r\n return Index.savePerBoard('Index Sort', Index.currentSort);\r\n },\r\n\r\n saveLastLongThresholds(i) {\r\n return Index.savePerBoard(`Last Long Reply Thresholds ${i}`, Index.lastLongThresholds[i]);\r\n },\r\n\r\n pageLoad(scroll=true) {\r\n if (!Index.liveThreadData) { return; }\r\n let {threads, order, search, mode, sort, page, hash} = Index.changed;\r\n if (!threads) { threads = search; }\r\n if (!order) { order = sort; }\r\n if (threads || order) { Index.sort(); }\r\n if (threads) { Index.buildPagelist(); }\r\n if (search) { Index.setupSearch(); }\r\n if (mode) { Index.setupMode(); }\r\n if (sort) { Index.setupSort(); }\r\n if (threads || mode || page || order) { Index.buildIndex(); }\r\n if (threads || page) { Index.setPage(); }\r\n if (scroll && !hash) { Index.scrollToIndex(); }\r\n if (hash) { Header.hashScroll(); }\r\n return Index.changed = {};\r\n },\r\n\r\n setupMode() {\r\n for (var mode of ['paged', 'infinite', 'all pages', 'catalog']) {\r\n $[mode === Conf['Index Mode'] ? 'addClass' : 'rmClass'](doc, `${mode.replace(/\\ /g, '-')}-mode`);\r\n }\r\n Index.selectMode.value = Conf['Index Mode'];\r\n Index.cb.size();\r\n Index.showHiddenThreads = false;\r\n return $('#hidden-toggle a', Index.navLinks).textContent = 'Show';\r\n },\r\n\r\n setupSort() {\r\n Index.selectRev.checked = /-rev$/.test(Index.currentSort);\r\n Index.selectSort.value = Index.currentSort.replace(/-rev$/, '');\r\n return Index.lastLongOptions.hidden = (Index.selectSort.value !== 'lastlong');\r\n },\r\n\r\n getPagesNum() {\r\n if (Index.search) {\r\n return Math.ceil(Index.sortedThreadIDs.length / Index.threadsNumPerPage);\r\n } else {\r\n return Index.pagesNum;\r\n }\r\n },\r\n\r\n getMaxPageNum() {\r\n return Math.max(1, Index.getPagesNum());\r\n },\r\n\r\n buildPagelist() {\r\n const pagesRoot = $('.pages', Index.pagelist);\r\n const maxPageNum = Index.getMaxPageNum();\r\n if (pagesRoot.childElementCount !== maxPageNum) {\r\n const nodes = [];\r\n for (let i = 1, end = maxPageNum; i <= end; i++) {\r\n var a = $.el('a', {\r\n textContent: i,\r\n href: i === 1 ? './' : i\r\n }\r\n );\r\n nodes.push($.tn('['), a, $.tn('] '));\r\n }\r\n $.rmAll(pagesRoot);\r\n return $.add(pagesRoot, nodes);\r\n }\r\n },\r\n\r\n setPage() {\r\n let a, strong;\r\n const pageNum = Index.currentPage;\r\n const maxPageNum = Index.getMaxPageNum();\r\n const pagesRoot = $('.pages', Index.pagelist);\r\n\r\n // Previous/Next buttons\r\n const prev = pagesRoot.previousElementSibling.firstElementChild;\r\n const next = pagesRoot.nextElementSibling.firstElementChild;\r\n let href = Math.max(pageNum - 1, 1);\r\n prev.href = href === 1 ? './' : href;\r\n prev.firstElementChild.disabled = href === pageNum;\r\n href = Math.min(pageNum + 1, maxPageNum);\r\n next.href = href === 1 ? './' : href;\r\n next.firstElementChild.disabled = href === pageNum;\r\n\r\n // current page\r\n if (strong = $('strong', pagesRoot)) {\r\n if (+strong.textContent === pageNum) { return; }\r\n $.replace(strong, strong.firstChild);\r\n } else {\r\n strong = $.el('strong');\r\n }\r\n\r\n if (a = pagesRoot.children[pageNum - 1]) {\r\n $.before(a, strong);\r\n return $.add(strong, a);\r\n }\r\n },\r\n\r\n updateHideLabel() {\r\n if (!Index.hideLabel) { return; }\r\n let hiddenCount = 0;\r\n for (var threadID of Index.liveThreadIDs) {\r\n if (Index.isHidden(threadID)) {\r\n hiddenCount++;\r\n }\r\n }\r\n if (!hiddenCount) {\r\n Index.hideLabel.hidden = true;\r\n if (Index.showHiddenThreads) { Index.cb.toggleHiddenThreads(); }\r\n return;\r\n }\r\n Index.hideLabel.hidden = false;\r\n return $('#hidden-count', Index.navLinks).textContent = hiddenCount === 1 ?\r\n '1 hidden thread'\r\n :\r\n `${hiddenCount} hidden threads`;\r\n },\r\n\r\n update(firstTime) {\r\n let oldReq;\r\n if (oldReq = Index.req) {\r\n delete Index.req;\r\n oldReq.abort();\r\n }\r\n\r\n if (Conf['Index Refresh Notifications']) {\r\n // Optional notification for manual refreshes\r\n if (!Index.notice) { Index.notice = new Notice('info', 'Refreshing index...'); }\r\n if (!Index.nTimeout) { Index.nTimeout = setTimeout(() => {\r\n if (Index.notice) {\r\n Index.notice.el.lastElementChild.textContent += ' (disable JSON Index if this takes too long)';\r\n }\r\n }\r\n , 3 * SECOND); }\r\n } else {\r\n // Also display notice if Index Refresh is taking too long\r\n if (!Index.nTimeout) { Index.nTimeout = setTimeout(() => Index.notice || (Index.notice = new Notice('info', 'Refreshing index... (disable JSON Index if this takes too long)'))\r\n , 3 * SECOND); }\r\n }\r\n\r\n // Hard refresh in case of incomplete page load.\r\n if (!firstTime && (d.readyState !== 'loading') && !$('.board + *')) {\r\n location.reload();\r\n return;\r\n }\r\n\r\n Index.req = $.whenModified(\r\n g.SITE.urls.catalogJSON({boardID: g.BOARD.ID}),\r\n 'Index',\r\n Index.load\r\n );\r\n return $.addClass(Index.button, 'spin');\r\n },\r\n\r\n load() {\r\n let err;\r\n if (this !== Index.req) { return; } // aborted\r\n\r\n $.rmClass(Index.button, 'spin');\r\n const {notice, nTimeout} = Index;\r\n if (nTimeout) { clearTimeout(nTimeout); }\r\n delete Index.nTimeout;\r\n delete Index.req;\r\n delete Index.notice;\r\n\r\n if (![200, 304].includes(this.status)) {\r\n err = `Index refresh failed. ${this.status ? `Error ${this.statusText} (${this.status})` : 'Connection Error'}`;\r\n if (notice) {\r\n notice.setType('warning');\r\n notice.el.lastElementChild.textContent = err;\r\n setTimeout(notice.close, SECOND);\r\n } else {\r\n new Notice('warning', err, 1);\r\n }\r\n return;\r\n }\r\n\r\n try {\r\n if (this.status === 200) {\r\n Index.parse(this.response);\r\n } else if (this.status === 304) {\r\n Index.pageLoad();\r\n }\r\n } catch (error) {\r\n err = error;\r\n c.error(`Index failure: ${err.message}`, err.stack);\r\n if (notice) {\r\n notice.setType('error');\r\n notice.el.lastElementChild.textContent = 'Index refresh failed.';\r\n setTimeout(notice.close, SECOND);\r\n } else {\r\n new Notice('error', 'Index refresh failed.', 1);\r\n }\r\n return;\r\n }\r\n\r\n if (notice) {\r\n if (Conf['Index Refresh Notifications']) {\r\n notice.setType('success');\r\n notice.el.lastElementChild.textContent = 'Index refreshed!';\r\n setTimeout(notice.close, SECOND);\r\n } else {\r\n notice.close();\r\n }\r\n }\r\n\r\n const timeEl = $('#index-last-refresh time', Index.navLinks);\r\n timeEl.dataset.utc = Date.parse(this.getResponseHeader('Last-Modified'));\r\n return RelativeDates.update(timeEl);\r\n },\r\n\r\n parse(pages) {\r\n $.cleanCache(url => /^https?:\\/\\/a\\.4cdn\\.org\\//.test(url));\r\n Index.parseThreadList(pages);\r\n Index.changed.threads = true;\r\n return Index.pageLoad();\r\n },\r\n\r\n parseThreadList(pages) {\r\n Index.pagesNum = pages.length;\r\n Index.threadsNumPerPage = pages[0]?.threads.length || 1;\r\n Index.liveThreadData = pages.reduce(((arr, next) => arr.concat(next.threads)), []);\r\n Index.liveThreadIDs = Index.liveThreadData.map(data => data.no);\r\n Index.liveThreadDict = dict();\r\n Index.threadPosition = dict();\r\n Index.parsedThreads = dict();\r\n Index.replyData = dict();\r\n for (let i = 0; i < Index.liveThreadData.length; i++) {\r\n var obj, results;\r\n var data = Index.liveThreadData[i];\r\n Index.liveThreadDict[data.no] = data;\r\n Index.threadPosition[data.no] = i;\r\n Index.parsedThreads[data.no] = (obj = g.SITE.Build.parseJSON(data, g.BOARD));\r\n obj.filterResults = (results = Filter.test(obj));\r\n obj.isOnTop = results.top;\r\n obj.isHidden = results.hide || ThreadHiding.isHidden(obj.boardID, obj.threadID);\r\n if (data.last_replies) {\r\n for (var reply of data.last_replies) {\r\n Index.replyData[`${g.BOARD}.${reply.no}`] = reply;\r\n }\r\n }\r\n }\r\n if (Index.liveThreadData[0]) {\r\n g.SITE.Build.spoilerRange[g.BOARD.ID] = Index.liveThreadData[0].custom_spoiler;\r\n }\r\n g.BOARD.threads.forEach(function(thread) {\r\n if (!Index.liveThreadIDs.includes(thread.ID)) { return thread.collect(); }\r\n });\r\n $.event('IndexUpdate',\r\n {threads: ((Index.liveThreadIDs.map((ID) => `${g.BOARD}.${ID}`)))});\r\n },\r\n\r\n isHidden(threadID) {\r\n let thread;\r\n if ((thread = g.BOARD.threads.get(threadID)) && thread.OP && !thread.OP.isFetchedQuote) {\r\n return thread.isHidden;\r\n } else {\r\n return Index.parsedThreads[threadID].isHidden;\r\n }\r\n },\r\n\r\n isHiddenReply(threadID, replyData) {\r\n return PostHiding.isHidden(g.BOARD.ID, threadID, replyData.no) || Filter.isHidden(g.SITE.Build.parseJSON(replyData, g.BOARD));\r\n },\r\n\r\n buildThreads(threadIDs, isCatalog, withReplies) {\r\n let errors;\r\n const threads = [];\r\n const newThreads = [];\r\n let newPosts = [];\r\n for (var ID of threadIDs) {\r\n var opRoot, thread;\r\n try {\r\n var OP;\r\n var threadData = Index.liveThreadDict[ID];\r\n\r\n if (thread = g.BOARD.threads.get(ID)) {\r\n var isStale = (thread.json !== threadData) && (JSON.stringify(thread.json) !== JSON.stringify(threadData));\r\n if (isStale) {\r\n thread.setCount('post', threadData.replies + 1, threadData.bumplimit);\r\n thread.setCount('file', threadData.images + !!threadData.ext, threadData.imagelimit);\r\n thread.setStatus('Sticky', !!threadData.sticky);\r\n thread.setStatus('Closed', !!threadData.closed);\r\n }\r\n if (thread.catalogView) {\r\n $.rm(thread.catalogView.nodes.replies);\r\n thread.catalogView.nodes.replies = null;\r\n }\r\n } else {\r\n thread = new Thread(ID, g.BOARD);\r\n newThreads.push(thread);\r\n }\r\n var lastPost = threadData.last_replies && threadData.last_replies.length ? threadData.last_replies[threadData.last_replies.length - 1].no : ID;\r\n if (lastPost > thread.lastPost) { thread.lastPost = lastPost; }\r\n thread.json = threadData;\r\n threads.push(thread);\r\n\r\n if ((OP = thread.OP) && !OP.isFetchedQuote) {\r\n OP.setCatalogOP(isCatalog);\r\n thread.setPage(Math.floor(Index.threadPosition[ID] / Index.threadsNumPerPage) + 1);\r\n } else {\r\n var obj = Index.parsedThreads[ID];\r\n opRoot = g.SITE.Build.post(obj);\r\n OP = new Post(opRoot, thread, g.BOARD);\r\n OP.filterResults = obj.filterResults;\r\n newPosts.push(OP);\r\n }\r\n\r\n if (!isCatalog || !thread.nodes.root) {\r\n g.SITE.Build.thread(thread, threadData, withReplies);\r\n }\r\n } catch (err) {\r\n // Skip posts that we failed to parse.\r\n if (!errors) { errors = []; }\r\n errors.push({\r\n message: `Parsing of Thread No.${thread} failed. Thread will be skipped.`,\r\n error: err,\r\n html: opRoot?.outerHTML\r\n });\r\n }\r\n }\r\n if (errors) { Main.handleErrors(errors); }\r\n\r\n if (withReplies) {\r\n newPosts = newPosts.concat(Index.buildReplies(threads));\r\n }\r\n\r\n Main.callbackNodes('Thread', newThreads);\r\n Main.callbackNodes('Post', newPosts);\r\n Index.updateHideLabel();\r\n $.event('IndexRefreshInternal', {threadIDs: (threads.map((t) => t.fullID)), isCatalog});\r\n\r\n return threads;\r\n },\r\n\r\n buildReplies(threads) {\r\n let errors;\r\n const posts = [];\r\n for (var thread of threads) {\r\n var lastReplies;\r\n if (!(lastReplies = Index.liveThreadDict[thread.ID].last_replies)) { continue; }\r\n var nodes = [];\r\n for (var data of lastReplies) {\r\n var node, post;\r\n if ((post = thread.posts.get(data.no)) && !post.isFetchedQuote) {\r\n nodes.push(post.nodes.root);\r\n continue;\r\n }\r\n nodes.push(node = g.SITE.Build.postFromObject(data, thread.board.ID));\r\n try {\r\n posts.push(new Post(node, thread, thread.board));\r\n } catch (err) {\r\n // Skip posts that we failed to parse.\r\n if (!errors) { errors = []; }\r\n errors.push({\r\n message: `Parsing of Post No.${data.no} failed. Post will be skipped.`,\r\n error: err,\r\n html: node?.outerHTML\r\n });\r\n }\r\n }\r\n $.add(thread.nodes.root, nodes);\r\n }\r\n\r\n if (errors) { Main.handleErrors(errors); }\r\n return posts;\r\n },\r\n\r\n buildCatalogViews(threads) {\r\n const catalogThreads = [];\r\n for (var thread of threads) {\r\n if (!thread.catalogView) {\r\n var {ID} = thread;\r\n var page = Math.floor(Index.threadPosition[ID] / Index.threadsNumPerPage) + 1;\r\n var root = g.SITE.Build.catalogThread(thread, Index.liveThreadDict[ID], page);\r\n catalogThreads.push(new CatalogThread(root, thread));\r\n }\r\n }\r\n Main.callbackNodes('CatalogThread', catalogThreads);\r\n },\r\n\r\n sizeCatalogViews(threads) {\r\n // XXX When browsers support CSS3 attr(), use it instead.\r\n const size = Conf['Index Size'] === 'small' ? 150 : 250;\r\n for (var thread of threads) {\r\n var {thumb} = thread.catalogView.nodes;\r\n var {width, height} = thumb.dataset;\r\n if (!width) { continue; }\r\n var ratio = size / Math.max(width, height);\r\n thumb.style.width = (width * ratio) + 'px';\r\n thumb.style.height = (height * ratio) + 'px';\r\n }\r\n },\r\n\r\n buildCatalogReplies(thread) {\r\n let lastReplies;\r\n const {nodes} = thread.catalogView;\r\n if (!(lastReplies = Index.liveThreadDict[thread.ID].last_replies)) { return; }\r\n\r\n const replies = [];\r\n for (var data of lastReplies) {\r\n if (Index.isHiddenReply(thread.ID, data)) { continue; }\r\n var reply = g.SITE.Build.catalogReply(thread, data);\r\n RelativeDates.update($('time', reply));\r\n $.on($('.catalog-reply-preview', reply), 'mouseover', QuotePreview.mouseover);\r\n replies.push(reply);\r\n }\r\n\r\n nodes.replies = $.el('div', {className: 'catalog-replies'});\r\n $.add(nodes.replies, replies);\r\n $.add(thread.OP.nodes.post, nodes.replies);\r\n },\r\n\r\n sort() {\r\n let threadIDs;\r\n const {liveThreadIDs, liveThreadData} = Index;\r\n if (!liveThreadData) { return; }\r\n const tmp_time = new Date().getTime()/1000;\r\n const sortType = Index.currentSort.replace(/-rev$/, '');\r\n Index.sortedThreadIDs = (() => { switch (sortType) {\r\n case 'lastreply': case 'lastlong':\r\n var repliesAvailable = liveThreadData.some(thread => thread.last_replies?.length);\r\n var lastlong = function(thread) {\r\n if (!repliesAvailable) {\r\n return thread.last_modified;\r\n }\r\n const iterable = thread.last_replies || [];\r\n for (let i = iterable.length - 1; i >= 0; i--) {\r\n var r = iterable[i];\r\n if (Index.isHiddenReply(thread.no, r)) { continue; }\r\n if (sortType === 'lastreply') {\r\n return r;\r\n }\r\n var len = r.com ? g.SITE.Build.parseComment(r.com).replace(/[^a-z]/ig, '').length : 0;\r\n if (len >= Index.lastLongThresholds[+!!r.ext]) {\r\n return r;\r\n }\r\n }\r\n if (thread.omitted_posts && thread.last_replies?.length) { return thread.last_replies[0]; } else { return thread; }\r\n };\r\n var lastlongD = dict();\r\n for (var thread of liveThreadData) {\r\n lastlongD[thread.no] = lastlong(thread).no;\r\n }\r\n return [...Array.from(liveThreadData)].sort((a, b) => lastlongD[b.no] - lastlongD[a.no]).map(post => post.no);\r\n case 'bump': return liveThreadIDs;\r\n case 'birth': return [...Array.from(liveThreadIDs) ].sort((a, b) => b - a);\r\n case 'replycount': return [...Array.from(liveThreadData)].sort((a, b) => b.replies - a.replies).map(post => post.no);\r\n case 'filecount': return [...Array.from(liveThreadData)].sort((a, b) => b.images - a.images).map(post => post.no);\r\n case 'activity': return [...Array.from(liveThreadData)].sort((a, b) => ((tmp_time-a.time)/(a.replies+1)) - ((tmp_time-b.time)/(b.replies+1))).map(post => post.no);\r\n default: return liveThreadIDs;\r\n } })();\r\n if (/-rev$/.test(Index.currentSort)) {\r\n Index.sortedThreadIDs = [...Array.from(Index.sortedThreadIDs)].reverse();\r\n }\r\n if (Index.search && (threadIDs = Index.querySearch(Index.search))) {\r\n Index.sortedThreadIDs = threadIDs;\r\n }\r\n // Sticky threads\r\n Index.sortOnTop(obj => obj.isSticky);\r\n // Highlighted threads\r\n Index.sortOnTop(obj => obj.isOnTop || (Conf['Pin Watched Threads'] && ThreadWatcher.isWatchedRaw(obj.boardID, obj.threadID)));\r\n // Non-hidden threads\r\n if (Conf['Anchor Hidden Threads']) { return Index.sortOnTop(obj => !Index.isHidden(obj.threadID)); }\r\n },\r\n\r\n sortOnTop(match) {\r\n const topThreads = [];\r\n const bottomThreads = [];\r\n for (var ID of Index.sortedThreadIDs) {\r\n (match(Index.parsedThreads[ID]) ? topThreads : bottomThreads).push(ID);\r\n }\r\n return Index.sortedThreadIDs = topThreads.concat(bottomThreads);\r\n },\r\n\r\n buildIndex() {\r\n let threadIDs;\r\n if (!Index.liveThreadData) { return; }\r\n switch (Conf['Index Mode']) {\r\n case 'all pages':\r\n threadIDs = Index.sortedThreadIDs;\r\n break;\r\n case 'catalog':\r\n threadIDs = Index.sortedThreadIDs.filter(ID => !Index.isHidden(ID) !== Index.showHiddenThreads);\r\n break;\r\n default:\r\n threadIDs = Index.threadsOnPage(Index.currentPage);\r\n }\r\n delete Index.pageNum;\r\n $.rmAll(Index.root);\r\n $.rmAll(Header.hover);\r\n if (Index.loaded && Index.root.parentNode) {\r\n $.event('PostsRemoved', null, Index.root);\r\n }\r\n if (Conf['Index Mode'] === 'catalog') {\r\n Index.buildCatalog(threadIDs);\r\n } else {\r\n Index.buildStructure(threadIDs);\r\n }\r\n },\r\n\r\n threadsOnPage(pageNum) {\r\n const nodesPerPage = Index.threadsNumPerPage;\r\n const offset = nodesPerPage * (pageNum - 1);\r\n return Index.sortedThreadIDs.slice(offset , offset + nodesPerPage);\r\n },\r\n\r\n buildStructure(threadIDs) {\r\n const threads = Index.buildThreads(threadIDs, false, Conf['Show Replies']);\r\n const nodes = [];\r\n for (var thread of threads) {\r\n nodes.push(thread.nodes.root, $.el('hr'));\r\n }\r\n $.add(Index.root, nodes);\r\n if (Index.root.parentNode) {\r\n $.event('PostsInserted', null, Index.root);\r\n }\r\n Index.loaded = true;\r\n },\r\n\r\n buildCatalog(threadIDs) {\r\n let i = 0;\r\n const n = threadIDs.length;\r\n let node0 = null;\r\n var fn = function() {\r\n if (node0 && !node0.parentNode) { return; } // Index.root cleared\r\n const j = (i > 0) && Index.root.parentNode ? n : i + 30;\r\n node0 = Index.buildCatalogPart(threadIDs.slice(i, j))[0];\r\n i = j;\r\n if (i < n) {\r\n return $.queueTask(fn);\r\n } else {\r\n if (Index.root.parentNode) {\r\n $.event('PostsInserted', null, Index.root);\r\n }\r\n return Index.loaded = true;\r\n }\r\n };\r\n fn();\r\n },\r\n\r\n buildCatalogPart(threadIDs) {\r\n const threads = Index.buildThreads(threadIDs, true);\r\n Index.buildCatalogViews(threads);\r\n Index.sizeCatalogViews(threads);\r\n const nodes = [];\r\n for (var thread of threads) {\r\n thread.OP.setCatalogOP(true);\r\n $.add(thread.catalogView.nodes.root, thread.OP.nodes.root);\r\n nodes.push(thread.catalogView.nodes.root);\r\n $.on(thread.catalogView.nodes.root, 'mouseenter', Index.cb.catalogReplies.bind(thread));\r\n $.on(thread.OP.nodes.root, 'mouseenter', Index.cb.hoverAdjust.bind(thread.OP.nodes));\r\n }\r\n $.add(Index.root, nodes);\r\n return nodes;\r\n },\r\n\r\n clearSearch() {\r\n Index.searchInput.value = '';\r\n Index.onSearchInput();\r\n return Index.searchInput.focus();\r\n },\r\n\r\n setupSearch() {\r\n Index.searchInput.value = Index.search;\r\n if (Index.search) {\r\n return Index.searchInput.dataset.searching = 1;\r\n } else {\r\n // XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1021289\r\n return Index.searchInput.removeAttribute('data-searching');\r\n }\r\n },\r\n\r\n onSearchInput() {\r\n const search = Index.searchInput.value.trim();\r\n if (search === Index.search) { return; }\r\n Index.pushState({\r\n search,\r\n replace: !!search === !!Index.search\r\n });\r\n return Index.pageLoad(false);\r\n },\r\n\r\n querySearch(query) {\r\n let keywords, match;\r\n if (match = query.match(/^([\\w+]+):\\/(.*)\\/(\\w*)$/)) {\r\n let regexp;\r\n try {\r\n regexp = RegExp(match[2], match[3]);\r\n } catch (error) {\r\n return [];\r\n }\r\n return Index.sortedThreadIDs.filter(ID => regexp.test(Filter.values(match[1], Index.parsedThreads[ID]).join('\\n')));\r\n }\r\n if (!(keywords = query.toLowerCase().match(/\\S+/g))) { return; }\r\n return Index.sortedThreadIDs.filter(ID => Index.searchMatch(Index.parsedThreads[ID], keywords));\r\n },\r\n\r\n searchMatch(obj, keywords) {\r\n const {info, file} = obj;\r\n if (info.comment == null) { info.comment = g.SITE.Build.parseComment(info.commentHTML.innerHTML); }\r\n let text = [];\r\n for (var key of ['comment', 'subject', 'name', 'tripcode']) {\r\n if (key in info) { text.push(info[key]); }\r\n }\r\n if (file) { text.push(file.name); }\r\n text = text.join(' ').toLowerCase();\r\n for (var keyword of keywords) {\r\n if (-1 === text.indexOf(keyword)) { return false; }\r\n }\r\n return true;\r\n }\r\n};\r\nexport default Index;\r\n","import Callbacks from \"../classes/Callbacks\";\r\nimport DataBoard from \"../classes/DataBoard\";\r\nimport Thread from \"../classes/Thread\";\r\nimport Index from \"../General/Index\";\r\nimport UI from \"../General/UI\";\r\nimport { g, Conf, d, doc } from \"../globals/globals\";\r\nimport Main from \"../main/Main\";\r\nimport Menu from \"../Menu/Menu\";\r\nimport $ from \"../platform/$\";\r\nimport $$ from \"../platform/$$\";\r\nimport { dict } from \"../platform/helpers\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar ThreadHiding = {\r\n init() {\r\n if (!['index', 'catalog'].includes(g.VIEW) || (!Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Index'])) { return; }\r\n this.db = new DataBoard('hiddenThreads');\r\n if (g.VIEW === 'catalog') { return this.catalogWatch(); }\r\n this.catalogSet(g.BOARD);\r\n $.on(d, 'IndexRefreshInternal', this.onIndexRefresh);\r\n if (Conf['Thread Hiding Buttons']) {\r\n $.addClass(doc, 'thread-hide');\r\n }\r\n return Callbacks.Post.push({\r\n name: 'Thread Hiding',\r\n cb: this.node\r\n });\r\n },\r\n\r\n catalogSet(board) {\r\n if (!$.hasStorage || (g.SITE.software !== 'yotsuba')) { return; }\r\n const hiddenThreads = ThreadHiding.db.get({\r\n boardID: board.ID,\r\n defaultValue: dict()\r\n });\r\n for (var threadID in hiddenThreads) { hiddenThreads[threadID] = true; }\r\n return localStorage.setItem(`4chan-hide-t-${board}`, JSON.stringify(hiddenThreads));\r\n },\r\n\r\n catalogWatch() {\r\n if (!$.hasStorage || (g.SITE.software !== 'yotsuba')) { return; }\r\n this.hiddenThreads = JSON.parse(localStorage.getItem(`4chan-hide-t-${g.BOARD}`)) || {};\r\n return Main.ready(() => // 4chan's catalog sets the style to \"display: none;\" when hiding or unhiding a thread.\r\n new MutationObserver(ThreadHiding.catalogSave).observe($.id('threads'), {\r\n attributes: true,\r\n subtree: true,\r\n attributeFilter: ['style']\r\n }));\r\n },\r\n\r\n catalogSave() {\r\n let threadID;\r\n const hiddenThreads2 = JSON.parse(localStorage.getItem(`4chan-hide-t-${g.BOARD}`)) || {};\r\n for (threadID in hiddenThreads2) {\r\n if (!$.hasOwn(ThreadHiding.hiddenThreads, threadID)) {\r\n ThreadHiding.db.set({\r\n boardID: g.BOARD.ID,\r\n threadID,\r\n val: {makeStub: Conf['Stubs']}});\r\n }\r\n }\r\n for (threadID in ThreadHiding.hiddenThreads) {\r\n if (!$.hasOwn(hiddenThreads2, threadID)) {\r\n ThreadHiding.db.delete({\r\n boardID: g.BOARD.ID,\r\n threadID\r\n });\r\n }\r\n }\r\n return ThreadHiding.hiddenThreads = hiddenThreads2;\r\n },\r\n\r\n isHidden(boardID, threadID) {\r\n return !!(ThreadHiding.db && ThreadHiding.db.get({boardID, threadID}));\r\n },\r\n\r\n node() {\r\n let data;\r\n if (this.isReply || this.isClone || this.isFetchedQuote) { return; }\r\n\r\n if (Conf['Thread Hiding Buttons']) {\r\n $.prepend(this.nodes.root, ThreadHiding.makeButton(this.thread, 'hide'));\r\n }\r\n\r\n if (data = ThreadHiding.db.get({boardID: this.board.ID, threadID: this.ID})) {\r\n return ThreadHiding.hide(this.thread, data.makeStub);\r\n }\r\n },\r\n\r\n onIndexRefresh() {\r\n return g.BOARD.threads.forEach(function(thread) {\r\n const {root} = thread.nodes;\r\n if (thread.isHidden && thread.stub && !root.contains(thread.stub)) {\r\n return ThreadHiding.makeStub(thread, root);\r\n }\r\n });\r\n },\r\n\r\n menu: {\r\n init() {\r\n if ((g.VIEW !== 'index') || !Conf['Menu'] || !Conf['Thread Hiding Link']) { return; }\r\n\r\n let div = $.el('div', {\r\n className: 'hide-thread-link',\r\n textContent: 'Hide'\r\n }\r\n );\r\n\r\n const apply = $.el('a', {\r\n textContent: 'Apply',\r\n href: 'javascript:;'\r\n }\r\n );\r\n $.on(apply, 'click', ThreadHiding.menu.hide);\r\n\r\n const makeStub = UI.checkbox('Stubs', 'Make stub');\r\n\r\n Menu.menu.addEntry({\r\n el: div,\r\n order: 20,\r\n open({thread, isReply}) {\r\n if (isReply || thread.isHidden || (Conf['JSON Index'] && (Conf['Index Mode'] === 'catalog'))) {\r\n return false;\r\n }\r\n ThreadHiding.menu.thread = thread;\r\n return true;\r\n },\r\n subEntries: [{el: apply}, {el: makeStub}]});\r\n\r\n div = $.el('a', {\r\n className: 'show-thread-link',\r\n textContent: 'Show',\r\n href: 'javascript:;'\r\n }\r\n );\r\n $.on(div, 'click', ThreadHiding.menu.show);\r\n\r\n Menu.menu.addEntry({\r\n el: div,\r\n order: 20,\r\n open({thread, isReply}) {\r\n if (isReply || !thread.isHidden || (Conf['JSON Index'] && (Conf['Index Mode'] === 'catalog'))) {\r\n return false;\r\n }\r\n ThreadHiding.menu.thread = thread;\r\n return true;\r\n }\r\n });\r\n\r\n const hideStubLink = $.el('a', {\r\n textContent: 'Hide stub',\r\n href: 'javascript:;'\r\n }\r\n );\r\n $.on(hideStubLink, 'click', ThreadHiding.menu.hideStub);\r\n\r\n return Menu.menu.addEntry({\r\n el: hideStubLink,\r\n order: 15,\r\n open({thread, isReply}) {\r\n if (isReply || !thread.isHidden || (Conf['JSON Index'] && (Conf['Index Mode'] === 'catalog'))) {\r\n return false;\r\n }\r\n return ThreadHiding.menu.thread = thread;\r\n }\r\n });\r\n },\r\n\r\n hide() {\r\n const makeStub = $('input', this.parentNode).checked;\r\n const {thread} = ThreadHiding.menu;\r\n ThreadHiding.hide(thread, makeStub);\r\n ThreadHiding.saveHiddenState(thread, makeStub);\r\n return $.event('CloseMenu');\r\n },\r\n\r\n show() {\r\n const {thread} = ThreadHiding.menu;\r\n ThreadHiding.show(thread);\r\n ThreadHiding.saveHiddenState(thread);\r\n return $.event('CloseMenu');\r\n },\r\n\r\n hideStub() {\r\n const {thread} = ThreadHiding.menu;\r\n ThreadHiding.show(thread);\r\n ThreadHiding.hide(thread, false);\r\n ThreadHiding.saveHiddenState(thread, false);\r\n $.event('CloseMenu');\r\n }\r\n },\r\n\r\n makeButton(thread, type) {\r\n const a = $.el('a', {\r\n className: `${type}-thread-button`,\r\n href: 'javascript:;'\r\n }\r\n );\r\n $.extend(a, {textContent: type === \"hide\" ? '➖︎' : '➕︎' });\r\n a.dataset.fullID = thread.fullID;\r\n $.on(a, 'click', ThreadHiding.toggle);\r\n return a;\r\n },\r\n\r\n makeStub(thread, root) {\r\n let summary, threadDivider;\r\n let numReplies = $$(g.SITE.selectors.replyOriginal, root).length;\r\n if (summary = $(g.SITE.selectors.summary, root)) { numReplies += +summary.textContent.match(/\\d+/); }\r\n\r\n const a = ThreadHiding.makeButton(thread, 'show');\r\n $.add(a, $.tn(` ${thread.OP.info.nameBlock} (${numReplies === 1 ? '1 reply' : `${numReplies} replies`})`));\r\n thread.stub = $.el('div',\r\n {className: 'stub'});\r\n if (Conf['Menu']) {\r\n $.add(thread.stub, [a, Menu.makeButton(thread.OP)]);\r\n } else {\r\n $.add(thread.stub, a);\r\n }\r\n $.prepend(root, thread.stub);\r\n\r\n // Prevent hiding of thread divider on sites that put it inside the thread\r\n if (threadDivider = $(g.SITE.selectors.threadDivider, root)) {\r\n return $.addClass(threadDivider, 'threadDivider');\r\n }\r\n },\r\n\r\n saveHiddenState(thread, makeStub) {\r\n if (thread.isHidden) {\r\n ThreadHiding.db.set({\r\n boardID: thread.board.ID,\r\n threadID: thread.ID,\r\n val: {makeStub}});\r\n } else {\r\n ThreadHiding.db.delete({\r\n boardID: thread.board.ID,\r\n threadID: thread.ID\r\n });\r\n }\r\n return ThreadHiding.catalogSet(thread.board);\r\n },\r\n\r\n toggle(thread) {\r\n if (!(thread instanceof Thread)) {\r\n thread = g.threads.get(this.dataset.fullID);\r\n }\r\n if (thread.isHidden) {\r\n ThreadHiding.show(thread);\r\n } else {\r\n ThreadHiding.hide(thread);\r\n }\r\n return ThreadHiding.saveHiddenState(thread);\r\n },\r\n\r\n hide(thread, makeStub=Conf['Stubs']) {\r\n if (thread.isHidden) { return; }\r\n const threadRoot = thread.nodes.root;\r\n thread.isHidden = true;\r\n Index.updateHideLabel();\r\n if (thread.catalogView && !Index.showHiddenThreads) {\r\n $.rm(thread.catalogView.nodes.root);\r\n $.event('PostsRemoved', null, Index.root);\r\n }\r\n\r\n if (!makeStub) { return threadRoot.hidden = true; }\r\n\r\n return ThreadHiding.makeStub(thread, threadRoot);\r\n },\r\n\r\n show(thread) {\r\n if (thread.stub) {\r\n $.rm(thread.stub);\r\n delete thread.stub;\r\n }\r\n const threadRoot = thread.nodes.root;\r\n threadRoot.hidden = (thread.isHidden = false);\r\n Index.updateHideLabel();\r\n if (thread.catalogView && Index.showHiddenThreads) {\r\n $.rm(thread.catalogView.nodes.root);\r\n return $.event('PostsRemoved', null, Index.root);\r\n }\r\n }\r\n};\r\nexport default ThreadHiding;\r\n",null,null,null,null,"export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAitJREFUOE9jYCAWKJWwavr0KyXWb/FIbDtUFFyzJx6nVofE2Xo5nXsj0rqPNSR0nVkR2Hjmgmfd+U9Otdf+m5Vf/6+SfeU/R9ChVVgNYDRtlfJuuPA/rPfe/4QpD/6nznj0P27Kw/9unff/69Xf+69c/+C/SO7N/0z+OAxgMmmRCe++/r9i3ev/KWvf/vdY8PK/bt/9/wrNV3/IN5y/IVt1YqNg4pGTTP4HsbuA2bhZ2qvpyn+xjIObxAp3VwqlrgngLFyryVy5nhPmZJHANS2cwYexG8BmVC/pWn3hP4NZlzWuQDJI3dIiFnUUuwEsQAOcq87jNcC7fHeLUtJxHF4AGmBWeAavAWH1+1rUUk7giAWjOknllON4DXAs2NEiG4/DBQxAF/CFHfrPYI4jDFSLuJVjNrUJhB/B7gIGo1pJRt99GAZYJK7wLJ1z7Xzl4vu/7aqv/GRBj0bjqAX2qb0nJ7mXH17C4HcUxQA+hymWtSue/C5a9up/9Ozn/7Vr7v1nRY7GqMb91T3b3v6vWvPmf/S0p/9ZQk+DDLCBRSOz06Jqk+o7/21nvfqvsebDf7kZL/5zBax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dIBYKFv6Af2prnSYkRT4gWFgkCBJQ0EIFdcZzBCeqqh4qdk7VW2ChPusw02sAYKU7z7wEAAA2piQKFbrWSHazc1J0XWs5pdxPDykcVX+7Y9UxUsSo+s7PibqPFBRV/C5qi4i/UkrJrc7L47Bt4ZWnUaMCAE9GSrtKBQD2fR+bnAEAeOn7dUTOwApe35bDsPz0zsniQlV98IN0tJ3f6P0XAMA/kxou7OXCdnoAAAAASUVORK5CYII=';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAwUExURTSY22ey5E2l4KbS75rM7Y3F64C/6f///8zl9nS45r/f9PL5/UGe3bPY8Vqr4v///wNjrzUAAAABYktHRA8YugDZAAAAB3RJTUUH4AINEi85AIH95AAAAE9JREFUCNdjYMAGGBWgDGYHCM2a3hkAZmi0dzSBaKaO9o5moCqmLiCjYzNQyw4QowIodQzI6E0AKcpo72gE6+Jyb1kAMehUA9RktgdYbQYAjGIVNGGXBJkAAAAASUVORK5CYII=';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURQBk3ff6/trp+kKO5wZt3xx54q7P9Ozz/IS17zOG5WKh653E8sbc9/GbbcoAAABZSURBVAjXY2BAASyhDhAGc9oECMOjyAAiESEEYrBYpLWBGcwHxcvBjDDxHelghpF0yDQwY3kVgweEUeEQDWbMEepqAjO8FMsLIeYsU8o+BrbCdWboTAe4AwALXxWGjW41FwAAAABJRU5ErkJggg==';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAjVBMVEWn3gCo3gSr3w2t4BSu4Bav4Ri35C+45DK45DO55DXA50rA50vB50zC6E/D6FTF6VjG6VvL62vN7G/P7XbQ7XfW74vY8JDa8ZTe8qDe8qLf86Pi9Kzj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9svEhzyLFWoccWVc+eyTHq/twydjlKRln7jX9bNMkMJnbhoFRL1xCqmKx6/yi2fYXa/c5/e846PV/5fW0/7OPx/yfcjzop34ulxdGGvDuU8mMXaX507lBuiN6ueadmQeT/p/93vf/1O+G//sP5fw/eL3o/5JLif8zVxs+Tlir9S26UyeFQQvJGBE7FvaFZ9LfN+1y+WjbItSb3GmXvXd15v8zroH/HxgE/D+aGPx/18vi/z07PeZNPRKxe/Kh0Ae8toxscCO4zBkYXArk9C1SxJUYjBkYPPIVtbbuTftz3cz//2O9wP/75iSAXdO72/dt2HL5F6YlfBW4MiJYXMiBiW3t7azHBx+V/t89N+H/8a+1//e9K/9attDp5LQjYX8SuvVL8RoAkmxa65299Erq1FnHo0qrl7t4BddriIs4MrM3rfWcFd+pGwVSAwBZ0bKP8yrZPAAAAABJRU5ErkJggg==';","export default 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAMCAYAAABr5z2BAAABIklEQVQoz53LvUrDUBjG8bOoOammSf1IoBSvoCB4JeIqOHgBLt6AIMRBBQelWurQ2kERnMRBsBUcIp5FJSBI5oQsJVkkUHh8W0o5nhaFHvjBgef/Mq+Q46RJBMkI/vE+aOus956tnEswIZe1LV0QyJ5sE2GzgZfVMtRNIdiDpccEssdlB1mW4bvTwdvWJtRdErM7U+8S/FJykCRJX5qm+KpVce8UMNLRLbulz4iSjTAMh6Iowsd5BeNadp3nUF0VlxAEwZBotXC0Usa4ll3meZdA1iguwvf9vpvDA2wvmKgYGtSud8suDB4TyGr2PF49D/vra9jRZ1BVdknMzgwuCGSnZEObwu6sBnVTCHZiaC7BhFx2PKdxUidiAH/4lLo9Mv0DELVs9qsOHXwAAAAASUVORK5CYII=';","import $ from \"../platform/$\";\r\nimport CSS from \"../css/CSS\";\r\nimport { Conf } from \"../globals/globals\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nconst CustomCSS = {\r\n init() {\r\n if (!Conf['Custom CSS']) { return; }\r\n return this.addStyle();\r\n },\r\n\r\n addStyle() {\r\n return this.style = $.addStyle(CSS.sub(Conf['usercss']), 'custom-css', '#fourchanx-css');\r\n },\r\n\r\n rmStyle() {\r\n if (this.style) {\r\n $.rm(this.style);\r\n return delete this.style;\r\n }\r\n },\r\n\r\n update() {\r\n if (!this.style) {\r\n return this.addStyle();\r\n }\r\n return this.style.textContent = CSS.sub(Conf['usercss']);\r\n }\r\n};\r\nexport default CustomCSS;\r\n","import { Conf, d } from \"../globals/globals\";\r\nimport Main from \"../main/Main\";\r\nimport $ from \"../platform/$\";\r\nimport $$ from \"../platform/$$\";\r\nimport { dict } from \"../platform/helpers\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nconst SWTinyboard = {\r\n isOPContainerThread: true,\r\n mayLackJSON: true,\r\n threadModTimeIgnoresSage: true,\r\n\r\n disabledFeatures: [\r\n 'Resurrect Quotes',\r\n 'Quick Reply Personas',\r\n 'Quick Reply',\r\n 'Cooldown',\r\n 'Report Link',\r\n 'Delete Link',\r\n 'Edit Link',\r\n 'Quote Inlining',\r\n 'Quote Previewing',\r\n 'Quote Backlinks',\r\n 'File Info Formatting',\r\n 'Image Expansion',\r\n 'Image Expansion (Menu)',\r\n 'Comment Expansion',\r\n 'Thread Expansion',\r\n 'Favicon',\r\n 'Quote Threading',\r\n 'Thread Updater',\r\n 'Banner',\r\n 'Flash Features',\r\n 'Reply Pruning'\r\n ],\r\n\r\n detect() {\r\n for (var script of $$('script:not([src])', d.head)) {\r\n var m;\r\n if (m = script.textContent.match(/\\bvar configRoot=(\".*?\")/)) {\r\n var properties = dict();\r\n try {\r\n var root = JSON.parse(m[1]);\r\n if (root[0] === '/') {\r\n properties.root = location.origin + root;\r\n } else if (/^https?:/.test(root)) {\r\n properties.root = root;\r\n }\r\n } catch (error) {}\r\n return properties;\r\n }\r\n }\r\n return false;\r\n },\r\n\r\n awaitBoard(cb) {\r\n let reactUI;\r\n if (reactUI = $.id('react-ui')) {\r\n const s = (this.selectors = Object.create(this.selectors));\r\n s.boardFor = {index: '.page-container'};\r\n s.thread = 'div[id^=\"thread_\"]';\r\n return Main.mounted(cb);\r\n } else {\r\n return cb();\r\n }\r\n },\r\n\r\n urls: {\r\n thread({siteID, boardID, threadID}, isArchived) {\r\n return `${Conf['siteProperties'][siteID]?.root || `http://${siteID}/`}${boardID}/${isArchived ? 'archive/' : ''}res/${threadID}.html`;\r\n },\r\n post({postID}) { return `#${postID}`; },\r\n index({siteID, boardID}) { return `${Conf['siteProperties'][siteID]?.root || `http://${siteID}/`}${boardID}/`; },\r\n catalog({siteID, boardID}) { return `${Conf['siteProperties'][siteID]?.root || `http://${siteID}/`}${boardID}/catalog.html`; },\r\n threadJSON({siteID, boardID, threadID}, isArchived) {\r\n const root = Conf['siteProperties'][siteID]?.root;\r\n if (root) { return `${root}${boardID}/${isArchived ? 'archive/' : ''}res/${threadID}.json`; } else { return ''; }\r\n },\r\n archivedThreadJSON(thread) {\r\n return SWTinyboard.urls.threadJSON(thread, true);\r\n },\r\n threadsListJSON({siteID, boardID}) {\r\n const root = Conf['siteProperties'][siteID]?.root;\r\n if (root) { return `${root}${boardID}/threads.json`; } else { return ''; }\r\n },\r\n archiveListJSON({siteID, boardID}) {\r\n const root = Conf['siteProperties'][siteID]?.root;\r\n if (root) { return `${root}${boardID}/archive/archive.json`; } else { return ''; }\r\n },\r\n catalogJSON({siteID, boardID}) {\r\n const root = Conf['siteProperties'][siteID]?.root;\r\n if (root) { return `${root}${boardID}/catalog.json`; } else { return ''; }\r\n },\r\n file({siteID, boardID}, filename) {\r\n return `${Conf['siteProperties'][siteID]?.root || `http://${siteID}/`}${boardID}/${filename}`;\r\n },\r\n thumb(board, filename) {\r\n return SWTinyboard.urls.file(board, filename);\r\n }\r\n },\r\n\r\n selectors: {\r\n board: 'form[name=\"postcontrols\"]',\r\n thread: 'input[name=\"board\"] ~ div[id^=\"thread_\"]',\r\n threadDivider: 'div[id^=\"thread_\"] > hr:last-child',\r\n summary: '.omitted',\r\n postContainer: 'div[id^=\"reply_\"]:not(.hidden)', // postContainer is thread for OP\r\n opBottom: '.op',\r\n replyOriginal: 'div[id^=\"reply_\"]:not(.hidden)',\r\n infoRoot: '.intro',\r\n info: {\r\n subject: '.subject',\r\n name: '.name',\r\n email: '.email',\r\n tripcode: '.trip',\r\n uniqueID: '.poster_id',\r\n capcode: '.capcode',\r\n flag: '.flag',\r\n date: 'time',\r\n nameBlock: 'label',\r\n quote: 'a[href*=\"#q\"]',\r\n reply: 'a[href*=\"/res/\"]:not([href*=\"#\"])'\r\n },\r\n icons: {\r\n isSticky: '.fa-thumb-tack',\r\n isClosed: '.fa-lock'\r\n },\r\n file: {\r\n text: '.fileinfo',\r\n link: '.fileinfo > a',\r\n thumb: 'a > .post-image'\r\n },\r\n thumbLink: '.file > a',\r\n multifile: '.files > .file',\r\n highlightable: {\r\n op: ' > .op',\r\n reply: '.reply',\r\n catalog: ' > .thread'\r\n },\r\n comment: '.body',\r\n spoiler: '.spoiler',\r\n quotelink: 'a[onclick*=\"highlightReply(\"]',\r\n catalog: {\r\n board: '#Grid',\r\n thread: '.mix',\r\n thumb: '.thread-image'\r\n },\r\n boardList: '.boardlist',\r\n boardListBottom: '.boardlist.bottom',\r\n styleSheet: '#stylesheet',\r\n psa: '.blotter',\r\n nav: {\r\n prev: '.pages > form > [value=Previous]',\r\n next: '.pages > form > [value=Next]'\r\n }\r\n },\r\n\r\n classes: {\r\n highlight: 'highlighted'\r\n },\r\n\r\n xpath: {\r\n thread: 'div[starts-with(@id,\"thread_\")]',\r\n postContainer: 'div[starts-with(@id,\"reply_\") or starts-with(@id,\"thread_\")]',\r\n replyContainer: 'div[starts-with(@id,\"reply_\")]'\r\n },\r\n\r\n regexp: {\r\n quotelink:\r\n new RegExp(`\\\r\n/\\\r\n([^/]+)\\\r\n/res/\\\r\n(\\\\d+)\\\r\n(?:\\\\.\\\\w+)?#\\\r\n(\\\\d+)\\\r\n$\\\r\n`),\r\n quotelinkHTML:\r\n /]*\\bhref=\"[^\"]*\\/([^\\/]+)\\/res\\/(\\d+)(?:\\.\\w+)?#(\\d+)\"/g\r\n },\r\n\r\n Build: {\r\n parseJSON(data, board) {\r\n const o = this.parseJSON(data, board);\r\n if (data.ext === 'deleted') {\r\n delete o.file;\r\n $.extend(o, {\r\n files: [],\r\n fileDeleted: true,\r\n filesDeleted: [0]\r\n });\r\n }\r\n if (data.extra_files) {\r\n let file;\r\n for (let i = 0; i < data.extra_files.length; i++) {\r\n var extra_file = data.extra_files[i];\r\n if (extra_file.ext === 'deleted') {\r\n o.filesDeleted.push(i);\r\n } else {\r\n file = this.parseJSONFile(data, board);\r\n o.files.push(file);\r\n }\r\n }\r\n if (o.files.length) {\r\n o.file = o.files[0];\r\n }\r\n }\r\n return o;\r\n },\r\n\r\n parseComment(html) {\r\n html = html\r\n .replace(//gi, '\\n')\r\n .replace(/<[^>]*>/g, '');\r\n return $.unescape(html);\r\n }\r\n },\r\n\r\n bgColoredEl() {\r\n return $.el('div', {className: 'post reply'});\r\n },\r\n\r\n isFileURL(url) {\r\n return /\\/src\\/[^\\/]+/.test(url.pathname);\r\n },\r\n\r\n preParsingFixes(board) {\r\n // fixes effects of unclosed link in announcement\r\n let broken;\r\n if (broken = $('a > input[name=\"board\"]', board)) {\r\n return $.before(broken.parentNode, broken);\r\n }\r\n },\r\n\r\n parseNodes(post, nodes) {\r\n // Add vichan's span.poster_id around the ID if not already present.\r\n let m;\r\n if (nodes.uniqueID) { return; }\r\n let text = '';\r\n let node = nodes.nameBlock.nextSibling;\r\n while (node && (node.nodeType === 3)) {\r\n text += node.textContent;\r\n node = node.nextSibling;\r\n }\r\n if (m = text.match(/(\\s*ID:\\s*)(\\S+)/)) {\r\n let uniqueID;\r\n nodes.info.normalize();\r\n let {nextSibling} = nodes.nameBlock;\r\n nextSibling = nextSibling.splitText(m[1].length);\r\n nextSibling.splitText(m[2].length);\r\n nodes.uniqueID = (uniqueID = $.el('span', {className: 'poster_id'}));\r\n $.replace(nextSibling, uniqueID);\r\n return $.add(uniqueID, nextSibling);\r\n }\r\n },\r\n\r\n parseDate(node) {\r\n let date = Date.parse(node.getAttribute('datetime')?.trim());\r\n if (!isNaN(date)) { return new Date(date); }\r\n date = Date.parse(node.textContent.trim() + ' UTC'); // e.g. onesixtwo.club\r\n if (!isNaN(date)) { return new Date(date); }\r\n return undefined;\r\n },\r\n\r\n parseFile(post, file) {\r\n let info, infoNode;\r\n const {text, link, thumb} = file;\r\n if ($.x(`ancestor::${this.xpath.postContainer}[1]`, text) !== post.nodes.root) { return false; } // file belongs to a reply\r\n if (!(infoNode = link.nextSibling?.textContent.includes('(') ? link.nextSibling : link.nextElementSibling)) { return false; }\r\n if (!(info = infoNode.textContent.match(/\\((.*,\\s*)?([\\d.]+ ?[KMG]?B).*\\)/))) { return false; }\r\n const nameNode = $('.postfilename', text);\r\n $.extend(file, {\r\n name: nameNode ? (nameNode.title || nameNode.textContent) : link.pathname.match(/[^/]*$/)[0],\r\n size: info[2],\r\n dimensions: info[0].match(/\\d+x\\d+/)?.[0]\r\n });\r\n if (thumb) {\r\n $.extend(file, {\r\n thumbURL: /\\/static\\//.test(thumb.src) && $.isImage(link.href) ? link.href : thumb.src,\r\n isSpoiler: /^Spoiler/i.test(info[1] || '') || (link.textContent === 'Spoiler Image')\r\n }\r\n );\r\n }\r\n return true;\r\n },\r\n\r\n isThumbExpanded(file) {\r\n // Detect old Tinyboard image expansion that changes src attribute on thumbnail.\r\n return $.hasClass(file.thumb.parentNode, 'expanded') || (file.thumb.parentNode.dataset.expanded === 'true');\r\n },\r\n\r\n isLinkified(link) {\r\n return /\\bnofollow\\b/.test(link.rel);\r\n },\r\n\r\n catalogPin(threadRoot) {\r\n return threadRoot.dataset.sticky = 'true';\r\n }\r\n};\r\nexport default SWTinyboard;\r\n",null,"import { Conf, d } from \"../globals/globals\";\r\nimport $ from \"../platform/$\";\r\nimport PassMessagePage from './PassMessage/PassMessageHtml';\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\n\r\nconst PassMessage = {\r\n init() {\r\n if (Conf['passMessageClosed']) { return; }\r\n const msg = $.el('div',\r\n {className: 'box-outer top-box'}\r\n ,\r\n PassMessagePage);\r\n msg.style.cssText = 'padding-bottom: 0;';\r\n const close = $('a', msg);\r\n $.on(close, 'click', function() {\r\n $.rm(msg);\r\n return $.set('passMessageClosed', true);\r\n });\r\n return $.ready(function() {\r\n let hd;\r\n if (hd = $.id('hd')) {\r\n return $.after(hd, msg);\r\n } else {\r\n return $.prepend(d.body, msg);\r\n }\r\n });\r\n }\r\n};\r\nexport default PassMessage;\r\n","import Redirect from \"../Archive/Redirect\";\r\nimport $ from \"../platform/$\";\r\nimport ReportPage from './Report/ArchiveReport.html';\r\nimport CSS from \"../css/CSS\";\r\nimport Captcha from \"../Posting/Captcha\";\r\nimport { Conf, d, g } from \"../globals/globals\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\n\r\nvar Report = {\r\n init() {\r\n let match;\r\n if (!(match = location.search.match(/\\bno=(\\d+)/))) { return; }\r\n Captcha.replace.init();\r\n this.postID = +match[1];\r\n return $.ready(this.ready);\r\n },\r\n\r\n ready() {\r\n $.addStyle(CSS.report);\r\n\r\n if (Conf['Archive Report']) { Report.archive(); }\r\n\r\n new MutationObserver(function() {\r\n Report.fit('iframe[src^=\"https://www.google.com/recaptcha/api2/frame\"]');\r\n return Report.fit('body');\r\n }).observe(d.body, {\r\n childList: true,\r\n attributes: true,\r\n subtree: true\r\n }\r\n );\r\n return Report.fit('body');\r\n },\r\n\r\n fit(selector) {\r\n let el;\r\n if (!((el = $(selector, doc)) && (getComputedStyle(el).visibility !== 'hidden'))) { return; }\r\n const dy = (el.getBoundingClientRect().bottom - doc.clientHeight) + 8;\r\n if (dy > 0) { return window.resizeBy(0, dy); }\r\n },\r\n\r\n archive() {\r\n let match, urls;\r\n if (!(urls = Redirect.report(g.BOARD.ID)).length) { return; }\r\n\r\n const form = $('form');\r\n const types = $.id('reportTypes');\r\n const message = $('h3');\r\n\r\n const fieldset = $.el('fieldset', {\r\n id: 'archive-report',\r\n hidden: true\r\n }\r\n ,\r\n { innerHTML: ReportPage });\r\n const enabled = $('#archive-report-enabled', fieldset);\r\n const reason = $('#archive-report-reason', fieldset);\r\n const submit = $('#archive-report-submit', fieldset);\r\n\r\n $.on(enabled, 'change', function() {\r\n return reason.disabled = !this.checked;\r\n });\r\n\r\n if (form && types) {\r\n fieldset.hidden = !$('[value=\"31\"]', types).checked;\r\n $.on(types, 'change', function(e) {\r\n fieldset.hidden = (e.target.value !== '31');\r\n return Report.fit('body');\r\n });\r\n $.after(types, fieldset);\r\n Report.fit('body');\r\n $.one(form, 'submit', function(e) {\r\n if (!fieldset.hidden && enabled.checked) {\r\n e.preventDefault();\r\n return Report.archiveSubmit(urls, reason.value, results => {\r\n this.action = '#archiveresults=' + encodeURIComponent(JSON.stringify(results));\r\n return this.submit();\r\n });\r\n }\r\n });\r\n } else if (message) {\r\n fieldset.hidden = /Report submitted!/.test(message.textContent);\r\n $.on(enabled, 'change', function() {\r\n return submit.hidden = !this.checked;\r\n });\r\n $.after(message, fieldset);\r\n $.on(submit, 'click', () => Report.archiveSubmit(urls, reason.value, Report.archiveResults));\r\n }\r\n\r\n if (match = location.hash.match(/^#archiveresults=(.*)$/)) {\r\n try {\r\n return Report.archiveResults(JSON.parse(decodeURIComponent(match[1])));\r\n } catch (error) {}\r\n }\r\n },\r\n\r\n archiveSubmit(urls, reason, cb) {\r\n const form = $.formData({\r\n board: g.BOARD.ID,\r\n num: Report.postID,\r\n reason\r\n });\r\n const results = [];\r\n for (var [name, url] of urls) {\r\n (function(name, url) {\r\n return $.ajax(url, {\r\n onloadend() {\r\n results.push([name, this.response || {error: ''}]);\r\n if (results.length === urls.length) {\r\n return cb(results);\r\n }\r\n },\r\n form\r\n });\r\n })(name, url);\r\n }\r\n },\r\n\r\n archiveResults(results) {\r\n const fieldset = $.id('archive-report');\r\n for (var [name, response] of results) {\r\n var line = $.el('h3',\r\n {className: 'archive-report-response'});\r\n if ('success' in response) {\r\n $.addClass(line, 'archive-report-success');\r\n line.textContent = `${name}: ${response.success}`;\r\n } else {\r\n $.addClass(line, 'archive-report-error');\r\n line.textContent = `${name}: ${response.error || 'Error reporting post.'}`;\r\n }\r\n if (fieldset) {\r\n $.before(fieldset, line);\r\n } else {\r\n $.add(d.body, line);\r\n }\r\n }\r\n }\r\n};\r\nexport default Report;\r\n","import DataBoard from \"../classes/DataBoard\";\r\nimport { Conf, d, g } from \"../globals/globals\";\r\nimport $ from \"../platform/$\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS101: Remove unnecessary use of Array.from\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nconst PostSuccessful = {\r\n init() {\r\n if (!Conf['Remember Your Posts']) { return; }\r\n return $.ready(this.ready);\r\n },\r\n\r\n ready() {\r\n if (d.title !== 'Post successful!') { return; }\r\n\r\n let [_, threadID, postID] = Array.from($('h1').nextSibling.textContent.match(/thread:(\\d+),no:(\\d+)/));\r\n postID = +postID;\r\n threadID = +threadID || postID;\r\n\r\n const db = new DataBoard('yourPosts');\r\n return db.set({\r\n boardID: g.BOARD.ID,\r\n threadID,\r\n postID,\r\n val: true\r\n });\r\n }\r\n};\r\nexport default PostSuccessful;\r\n",null,null,null,null,"import SWTinyboard from \"./SW.tinyboard\";\r\nimport SWYotsuba from \"./SW.yotsuba\";\r\n\r\nconst SW = { tinyboard: SWTinyboard, yotsuba: SWYotsuba };\r\nexport default SW;\r\n",null,"import $ from \"../platform/$\";\r\nimport Callbacks from \"../classes/Callbacks\";\r\nimport { g, Conf } from \"../globals/globals\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar Time = {\r\n init() {\r\n if (!['index', 'thread', 'archive'].includes(g.VIEW) || !Conf['Time Formatting']) { return; }\r\n\r\n return Callbacks.Post.push({\r\n name: 'Time Formatting',\r\n cb: this.node\r\n });\r\n },\r\n\r\n node() {\r\n if (!this.info.date || this.isClone) { return; }\r\n const {textContent} = this.nodes.date;\r\n return this.nodes.date.textContent = textContent.match(/^\\s*/)[0] + Time.format(Conf['time'], this.info.date) + textContent.match(/\\s*$/)[0];\r\n },\r\n\r\n format(formatString, date) {\r\n return formatString.replace(/%(.)/g, function(s, c) {\r\n if ($.hasOwn(Time.formatters, c)) {\r\n return Time.formatters[c].call(date);\r\n } else {\r\n return s;\r\n }\r\n });\r\n },\r\n\r\n day: [\r\n 'Sunday',\r\n 'Monday',\r\n 'Tuesday',\r\n 'Wednesday',\r\n 'Thursday',\r\n 'Friday',\r\n 'Saturday'\r\n ],\r\n\r\n month: [\r\n 'January',\r\n 'February',\r\n 'March',\r\n 'April',\r\n 'May',\r\n 'June',\r\n 'July',\r\n 'August',\r\n 'September',\r\n 'October',\r\n 'November',\r\n 'December'\r\n ],\r\n\r\n localeFormat(date, options, defaultValue) {\r\n if (Conf['timeLocale']) {\r\n try {\r\n return Intl.DateTimeFormat(Conf['timeLocale'], options).format(date);\r\n } catch (error) {}\r\n }\r\n return defaultValue;\r\n },\r\n\r\n localeFormatPart(date, options, part, defaultValue) {\r\n if (Conf['timeLocale']) {\r\n try {\r\n const parts = Intl.DateTimeFormat(Conf['timeLocale'], options).formatToParts(date);\r\n return parts.map(function(x) { if (x.type === part) { return x.value; } else { return ''; } }).join('');\r\n } catch (error) {}\r\n }\r\n return defaultValue;\r\n },\r\n\r\n zeroPad(n) { if (n < 10) { return `0${n}`; } else { return n; } },\r\n\r\n formatters: {\r\n a() { return Time.localeFormat(this, {weekday: 'short'}, Time.day[this.getDay()].slice(0, 3)); },\r\n A() { return Time.localeFormat(this, {weekday: 'long'}, Time.day[this.getDay()]); },\r\n b() { return Time.localeFormat(this, {month: 'short'}, Time.month[this.getMonth()].slice(0, 3)); },\r\n B() { return Time.localeFormat(this, {month: 'long'}, Time.month[this.getMonth()]); },\r\n d() { return Time.zeroPad(this.getDate()); },\r\n e() { return this.getDate(); },\r\n H() { return Time.zeroPad(this.getHours()); },\r\n I() { return Time.zeroPad((this.getHours() % 12) || 12); },\r\n k() { return this.getHours(); },\r\n l() { return (this.getHours() % 12) || 12; },\r\n m() { return Time.zeroPad(this.getMonth() + 1); },\r\n M() { return Time.zeroPad(this.getMinutes()); },\r\n p() { return Time.localeFormatPart(this, {hour: 'numeric', hour12: true}, 'dayperiod', (this.getHours() < 12 ? 'AM' : 'PM')); },\r\n P() { return Time.formatters.p.call(this).toLowerCase(); },\r\n S() { return Time.zeroPad(this.getSeconds()); },\r\n y() { return this.getFullYear().toString().slice(2); },\r\n Y() { return this.getFullYear(); },\r\n '%'() { return '%'; }\r\n }\r\n};\r\nexport default Time;\r\n","import Callbacks from \"../classes/Callbacks\";\r\nimport Header from \"../General/Header\";\r\nimport UI from \"../General/UI\";\r\nimport { g, Conf, E, d } from \"../globals/globals\";\r\nimport $ from \"../platform/$\";\r\nimport QuoteThreading from \"../Quotelinks/QuoteThreading\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * DS104: Avoid inline assignments\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar ReplyPruning = {\r\n init() {\r\n if ((g.VIEW !== 'thread') || !Conf['Reply Pruning']) { return; }\r\n\r\n this.container = $.frag();\r\n\r\n this.summary = $.el('span', {\r\n hidden: true,\r\n className: 'summary'\r\n }\r\n );\r\n this.summary.style.cursor = 'pointer';\r\n $.on(this.summary, 'click', () => {\r\n this.inputs.enabled.checked = !this.inputs.enabled.checked;\r\n return $.event('change', null, this.inputs.enabled);\r\n });\r\n\r\n const label = UI.checkbox('Prune Replies', 'Show Last', Conf['Prune All Threads']);\r\n const el = $.el('span',\r\n {title: 'Maximum number of replies to show.'}\r\n ,\r\n {innerHTML: \" \"});\r\n $.prepend(el, label);\r\n\r\n this.inputs = {\r\n enabled: label.firstElementChild,\r\n replies: el.lastElementChild\r\n };\r\n\r\n this.setEnabled.call(this.inputs.enabled);\r\n $.on(this.inputs.enabled, 'change', this.setEnabled);\r\n $.on(this.inputs.replies, 'change', $.cb.value);\r\n\r\n Header.menu.addEntry({\r\n el,\r\n order: 190\r\n });\r\n\r\n return Callbacks.Thread.push({\r\n name: 'Reply Pruning',\r\n cb: this.node\r\n });\r\n },\r\n\r\n position: 0,\r\n hidden: 0,\r\n hiddenFiles: 0,\r\n total: 0,\r\n totalFiles: 0,\r\n\r\n setEnabled() {\r\n const other = QuoteThreading.input;\r\n if (this.checked && other?.checked) {\r\n other.checked = false;\r\n $.event('change', null, other);\r\n }\r\n return ReplyPruning.active = this.checked;\r\n },\r\n\r\n showIfHidden(id) {\r\n if (ReplyPruning.container && $(`#${id}`, ReplyPruning.container)) {\r\n ReplyPruning.inputs.enabled.checked = false;\r\n return $.event('change', null, ReplyPruning.inputs.enabled);\r\n }\r\n },\r\n\r\n node() {\r\n let middle;\r\n ReplyPruning.thread = this;\r\n\r\n if (this.isSticky) {\r\n ReplyPruning.active = (ReplyPruning.inputs.enabled.checked = true);\r\n if (QuoteThreading.input) {\r\n // Disable Quote Threading for this thread but don't save the setting.\r\n Conf['Thread Quotes'] = (QuoteThreading.input.checked = false);\r\n }\r\n }\r\n\r\n this.posts.forEach(function(post) {\r\n if (post.isReply) {\r\n ReplyPruning.total++;\r\n if (post.file) { return ReplyPruning.totalFiles++; }\r\n }\r\n });\r\n\r\n // If we're linked to a post that we would hide, don't hide the posts in the first place.\r\n if (\r\n ReplyPruning.active &&\r\n /^#p\\d+$/.test(location.hash) &&\r\n (1 <= (middle = this.posts.keys.indexOf(location.hash.slice(2))) && middle < 1 + Math.max(ReplyPruning.total - +Conf[\"Max Replies\"], 0))\r\n ) {\r\n ReplyPruning.active = (ReplyPruning.inputs.enabled.checked = false);\r\n }\r\n\r\n $.after(this.OP.nodes.root, ReplyPruning.summary);\r\n\r\n $.on(ReplyPruning.inputs.enabled, 'change', ReplyPruning.update);\r\n $.on(ReplyPruning.inputs.replies, 'change', ReplyPruning.update);\r\n $.on(d, 'ThreadUpdate', ReplyPruning.updateCount);\r\n $.on(d, 'ThreadUpdate', ReplyPruning.update);\r\n\r\n return ReplyPruning.update();\r\n },\r\n\r\n updateCount(e) {\r\n if (e.detail[404]) { return; }\r\n for (var fullID of e.detail.newPosts) {\r\n ReplyPruning.total++;\r\n if (g.posts.get(fullID).file) { ReplyPruning.totalFiles++; }\r\n }\r\n },\r\n\r\n update() {\r\n let boardTop, node, post;\r\n const hidden1 = ReplyPruning.hidden;\r\n const hidden2 = ReplyPruning.active ?\r\n Math.max(ReplyPruning.total - +Conf[\"Max Replies\"], 0)\r\n :\r\n 0;\r\n\r\n // Record position from bottom of document\r\n const oldPos = d.body.clientHeight - window.scrollY;\r\n\r\n const {posts} = ReplyPruning.thread;\r\n\r\n if (ReplyPruning.hidden < hidden2) {\r\n while ((ReplyPruning.hidden < hidden2) && (ReplyPruning.position < posts.keys.length)) {\r\n post = posts.get(posts.keys[ReplyPruning.position++]);\r\n if (post.isReply && !post.isFetchedQuote) {\r\n while ((node = ReplyPruning.summary.nextSibling) && (node !== post.nodes.root)) { $.add(ReplyPruning.container, node); }\r\n $.add(ReplyPruning.container, post.nodes.root);\r\n ReplyPruning.hidden++;\r\n if (post.file) { ReplyPruning.hiddenFiles++; }\r\n }\r\n }\r\n\r\n } else if (ReplyPruning.hidden > hidden2) {\r\n const frag = $.frag();\r\n while ((ReplyPruning.hidden > hidden2) && (ReplyPruning.position > 0)) {\r\n post = posts.get(posts.keys[--ReplyPruning.position]);\r\n if (post.isReply && !post.isFetchedQuote) {\r\n while ((node = ReplyPruning.container.lastChild) && (node !== post.nodes.root)) { $.prepend(frag, node); }\r\n $.prepend(frag, post.nodes.root);\r\n ReplyPruning.hidden--;\r\n if (post.file) { ReplyPruning.hiddenFiles--; }\r\n }\r\n }\r\n $.after(ReplyPruning.summary, frag);\r\n $.event('PostsInserted', null, ReplyPruning.summary.parentNode);\r\n }\r\n\r\n ReplyPruning.summary.textContent = ReplyPruning.active ?\r\n g.SITE.Build.summaryText('+', ReplyPruning.hidden, ReplyPruning.hiddenFiles)\r\n :\r\n g.SITE.Build.summaryText('-', ReplyPruning.total, ReplyPruning.totalFiles);\r\n ReplyPruning.summary.hidden = (ReplyPruning.total <= +Conf[\"Max Replies\"]);\r\n\r\n // Maintain position in thread when posts are added/removed above\r\n if ((hidden1 !== hidden2) && ((boardTop = Header.getTopOf($('.board'))) < 0)) {\r\n return window.scrollBy(0, Math.max(d.body.clientHeight - oldPos, window.scrollY + boardTop) - window.scrollY);\r\n }\r\n }\r\n};\r\nexport default ReplyPruning;\r\n","import Callbacks from \"../classes/Callbacks\";\r\nimport RandomAccessList from \"../classes/RandomAccessList\";\r\nimport Header from \"../General/Header\";\r\nimport { Conf, d, g } from \"../globals/globals\";\r\nimport ReplyPruning from \"../Monitoring/ReplyPruning\";\r\nimport Unread from \"../Monitoring/Unread\";\r\nimport $ from \"../platform/$\";\r\nimport { dict } from \"../platform/helpers\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\n/*\r\n <3 aeosynth\r\n*/\r\n\r\nvar QuoteThreading = {\r\n init() {\r\n if (!Conf['Quote Threading'] || (g.VIEW !== 'thread')) { return; }\r\n\r\n this.controls = $.el('label',\r\n {innerHTML: \" Threading\"});\r\n\r\n this.threadNewLink = $.el('span', {\r\n className: 'brackets-wrap threadnewlink',\r\n hidden: true\r\n }\r\n );\r\n $.extend(this.threadNewLink, {innerHTML: \"Thread New Posts\"});\r\n\r\n this.input = $('input', this.controls);\r\n this.input.checked = Conf['Thread Quotes'];\r\n\r\n $.on(this.input, 'change', this.setEnabled);\r\n $.on(this.input, 'change', this.rethread);\r\n $.on(this.threadNewLink.firstElementChild, 'click', this.rethread);\r\n $.on(d, '4chanXInitFinished', () => { return this.ready = true; });\r\n\r\n Header.menu.addEntry(this.entry = {\r\n el: this.controls,\r\n order: 99\r\n }\r\n );\r\n\r\n Callbacks.Thread.push({\r\n name: 'Quote Threading',\r\n cb: this.setThread\r\n });\r\n\r\n return Callbacks.Post.push({\r\n name: 'Quote Threading',\r\n cb: this.node\r\n });\r\n },\r\n\r\n parent: dict(),\r\n children: dict(),\r\n inserted: dict(),\r\n\r\n toggleThreading() {\r\n return this.setThreadingState(!Conf['Thread Quotes']);\r\n },\r\n\r\n setThreadingState(enabled) {\r\n this.input.checked = enabled;\r\n this.setEnabled.call(this.input);\r\n return this.rethread.call(this.input);\r\n },\r\n\r\n setEnabled() {\r\n if (this.checked) {\r\n $.set('Prune All Threads', false);\r\n const other = ReplyPruning.inputs?.enabled;\r\n if (other?.checked) {\r\n other.checked = false;\r\n $.event('change', null, other);\r\n }\r\n }\r\n return $.cb.checked.call(this);\r\n },\r\n\r\n setThread() {\r\n QuoteThreading.thread = this;\r\n return $.asap((() => !Conf['Thread Updater'] || $('.navLinksBot > .updatelink')), function() {\r\n let navLinksBot;\r\n if (navLinksBot = $('.navLinksBot')) { return $.add(navLinksBot, [$.tn(' '), QuoteThreading.threadNewLink]); }\r\n });\r\n },\r\n\r\n node() {\r\n let parent;\r\n if (this.isFetchedQuote || this.isClone || !this.isReply) { return; }\r\n\r\n const parents = new Set();\r\n let lastParent = null;\r\n for (var quote of this.quotes) {\r\n if ((parent = g.posts.get(quote))) {\r\n if (!parent.isFetchedQuote && parent.isReply && (parent.ID < this.ID)) {\r\n parents.add(parent.ID);\r\n if (!lastParent || (parent.ID > lastParent.ID)) { lastParent = parent; }\r\n }\r\n }\r\n }\r\n\r\n if (!lastParent) { return; }\r\n\r\n let ancestor = lastParent;\r\n while ((ancestor = QuoteThreading.parent[ancestor.fullID])) {\r\n parents.delete(ancestor.ID);\r\n }\r\n\r\n if (parents.size === 1) {\r\n return QuoteThreading.parent[this.fullID] = lastParent;\r\n }\r\n },\r\n\r\n descendants(post) {\r\n let children;\r\n let posts = [post];\r\n if (children = QuoteThreading.children[post.fullID]) {\r\n for (var child of children) {\r\n posts = posts.concat(QuoteThreading.descendants(child));\r\n }\r\n }\r\n return posts;\r\n },\r\n\r\n insert(post) {\r\n let parent, x;\r\n if (!(\r\n Conf['Thread Quotes'] &&\r\n (parent = QuoteThreading.parent[post.fullID]) &&\r\n !QuoteThreading.inserted[post.fullID]\r\n )) { return false; }\r\n\r\n const descendants = QuoteThreading.descendants(post);\r\n if (!Unread.posts.has(parent.ID)) {\r\n if ((function() { for (var x of descendants) { if (Unread.posts.has(x.ID)) { return true; } } })()) {\r\n QuoteThreading.threadNewLink.hidden = false;\r\n return false;\r\n }\r\n }\r\n\r\n const {order} = Unread;\r\n const children = (QuoteThreading.children[parent.fullID] || (QuoteThreading.children[parent.fullID] = []));\r\n const threadContainer = parent.nodes.threadContainer || $.el('div', {className: 'threadContainer'});\r\n const nodes = [post.nodes.root];\r\n if (post.nodes.threadContainer) { nodes.push(post.nodes.threadContainer); }\r\n\r\n let i = children.length;\r\n for (let j = children.length - 1; j >= 0; j--) { var child = children[j]; if (child.ID >= post.ID) { i--; } }\r\n if (i !== children.length) {\r\n const next = children[i];\r\n for (x of descendants) { order.before(order[next.ID], order[x.ID]); }\r\n children.splice(i, 0, post);\r\n $.before(next.nodes.root, nodes);\r\n } else {\r\n let prev2;\r\n let prev = parent;\r\n while ((prev2 = QuoteThreading.children[prev.fullID]) && prev2.length) {\r\n prev = prev2[prev2.length-1];\r\n }\r\n for (let k = descendants.length - 1; k >= 0; k--) { x = descendants[k]; order.after(order[prev.ID], order[x.ID]); }\r\n children.push(post);\r\n $.add(threadContainer, nodes);\r\n }\r\n\r\n QuoteThreading.inserted[post.fullID] = true;\r\n\r\n if (!parent.nodes.threadContainer) {\r\n parent.nodes.threadContainer = threadContainer;\r\n $.addClass(parent.nodes.root, 'threadOP');\r\n $.after(parent.nodes.root, threadContainer);\r\n }\r\n\r\n return true;\r\n },\r\n\r\n rethread() {\r\n if (!QuoteThreading.ready) { return; }\r\n const {thread} = QuoteThreading;\r\n const {posts} = thread;\r\n\r\n QuoteThreading.threadNewLink.hidden = true;\r\n\r\n if (Conf['Thread Quotes']) {\r\n posts.forEach(QuoteThreading.insert);\r\n } else {\r\n const nodes = [];\r\n Unread.order = new RandomAccessList();\r\n QuoteThreading.inserted = dict();\r\n posts.forEach(function(post) {\r\n if (post.isFetchedQuote) { return; }\r\n Unread.order.push(post);\r\n if (post.isReply) { nodes.push(post.nodes.root); }\r\n if (QuoteThreading.children[post.fullID]) {\r\n delete QuoteThreading.children[post.fullID];\r\n $.rmClass(post.nodes.root, 'threadOP');\r\n $.rm(post.nodes.threadContainer);\r\n return delete post.nodes.threadContainer;\r\n }\r\n });\r\n $.add(thread.nodes.root, nodes);\r\n }\r\n\r\n Unread.position = Unread.order.first;\r\n Unread.updatePosition();\r\n Unread.setLine(true);\r\n Unread.read();\r\n return Unread.update();\r\n }\r\n};\r\nexport default QuoteThreading;\r\n","import Beep from './ThreadUpdater/beep.wav';\r\nimport $ from \"../platform/$\";\r\nimport Callbacks from '../classes/Callbacks';\r\nimport Notice from '../classes/Notice';\r\nimport Post from '../classes/Post';\r\nimport Main from '../main/Main';\r\nimport Config from '../config/Config';\r\nimport Settings from '../General/Settings';\r\nimport QuoteThreading from '../Quotelinks/QuoteThreading';\r\nimport Unread from './Unread';\r\nimport Header from '../General/Header';\r\nimport { g, Conf, d, doc } from '../globals/globals';\r\nimport UI from '../General/UI';\r\nimport { MINUTE, SECOND } from '../platform/helpers';\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * DS201: Simplify complex destructure assignments\r\n * DS207: Consider shorter variations of null checks\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\n\r\nvar ThreadUpdater = {\r\n init() {\r\n let el, name, sc;\r\n if ((g.VIEW !== 'thread') || !Conf['Thread Updater']) { return; }\r\n this.enabled = true;\r\n\r\n // Chromium won't play audio created in an inactive tab until the tab has been focused, so set it up now.\r\n // XXX Sometimes the loading stalls in Firefox, esp. when opening in private browsing window followed by normal window.\r\n // Don't let it keep the loading icon on indefinitely.\r\n this.audio = $.el('audio');\r\n if ($.engine !== 'gecko') { this.audio.src = this.beep; }\r\n\r\n if (Conf['Updater and Stats in Header']) {\r\n this.dialog = (sc = $.el('span',\r\n {id: 'updater'}));\r\n $.extend(sc, {innerHTML: ''});\r\n Header.addShortcut('updater', sc, 100);\r\n } else {\r\n this.dialog = (sc = UI.dialog('updater',\r\n {innerHTML: '
            '}));\r\n $.addClass(doc, 'float');\r\n $.ready(() => $.add(d.body, sc));\r\n }\r\n\r\n this.checkPostCount = 0;\r\n\r\n this.timer = $('#update-timer', sc);\r\n this.status = $('#update-status', sc);\r\n\r\n $.on(this.timer, 'click', this.update);\r\n $.on(this.status, 'click', this.update);\r\n\r\n const updateLink = $.el('span',\r\n {className: 'brackets-wrap updatelink'});\r\n $.extend(updateLink, {innerHTML: 'Update'});\r\n Main.ready(function() {\r\n let navLinksBot;\r\n if (navLinksBot = $('.navLinksBot')) { return $.add(navLinksBot, [$.tn(' '), updateLink]); }\r\n });\r\n $.on(updateLink.firstElementChild, 'click', this.update);\r\n\r\n const subEntries = [];\r\n for (name in Config.updater.checkbox) {\r\n var conf = Config.updater.checkbox[name];\r\n el = UI.checkbox(name, name);\r\n el.title = conf[1];\r\n var input = el.firstElementChild;\r\n $.on(input, 'change', $.cb.checked);\r\n if (input.name === 'Scroll BG') {\r\n $.on(input, 'change', this.cb.scrollBG);\r\n this.cb.scrollBG();\r\n } else if (input.name === 'Auto Update') {\r\n $.on(input, 'change', this.setInterval);\r\n }\r\n subEntries.push({el});\r\n }\r\n\r\n this.settings = $.el('span',\r\n {innerHTML: 'Interval'});\r\n\r\n $.on(this.settings, 'click', this.intervalShortcut);\r\n\r\n subEntries.push({el: this.settings});\r\n\r\n Header.menu.addEntry(this.entry = {\r\n el: $.el('span',\r\n {textContent: 'Updater'}),\r\n order: 110,\r\n subEntries\r\n }\r\n );\r\n\r\n return Callbacks.Thread.push({\r\n name: 'Thread Updater',\r\n cb: this.node\r\n });\r\n },\r\n\r\n node() {\r\n ThreadUpdater.thread = this;\r\n ThreadUpdater.root = this.nodes.root;\r\n ThreadUpdater.outdateCount = 0;\r\n\r\n // We must keep track of our own list of live posts/files\r\n // to provide an accurate deletedPosts/deletedFiles on update\r\n // as posts may be `kill`ed elsewhere.\r\n ThreadUpdater.postIDs = [];\r\n ThreadUpdater.fileIDs = [];\r\n this.posts.forEach(function(post) {\r\n ThreadUpdater.postIDs.push(post.ID);\r\n if (post.file) { return ThreadUpdater.fileIDs.push(post.ID); }\r\n });\r\n\r\n ThreadUpdater.cb.interval.call($.el('input', {value: Conf['Interval']}));\r\n\r\n $.on(d, 'QRPostSuccessful', ThreadUpdater.cb.checkpost);\r\n $.on(d, 'visibilitychange', ThreadUpdater.cb.visibility);\r\n\r\n return ThreadUpdater.setInterval();\r\n },\r\n\r\n /*\r\n http://freesound.org/people/pierrecartoons1979/sounds/90112/\r\n cc-by-nc-3.0\r\n */\r\n beep: `data:audio/wav;base64,${Beep}`,\r\n\r\n playBeep() {\r\n const {audio} = ThreadUpdater;\r\n if (!audio.src) { audio.src = ThreadUpdater.beep; }\r\n if (audio.paused) {\r\n return audio.play();\r\n } else {\r\n return $.one(audio, 'ended', ThreadUpdater.playBeep);\r\n }\r\n },\r\n\r\n cb: {\r\n checkpost(e) {\r\n if (e.detail.threadID !== ThreadUpdater.thread.ID) { return; }\r\n ThreadUpdater.postID = e.detail.postID;\r\n ThreadUpdater.checkPostCount = 0;\r\n ThreadUpdater.outdateCount = 0;\r\n return ThreadUpdater.setInterval();\r\n },\r\n\r\n visibility() {\r\n if (d.hidden) { return; }\r\n // Reset the counter when we focus this tab.\r\n ThreadUpdater.outdateCount = 0;\r\n if (ThreadUpdater.seconds > ThreadUpdater.interval) {\r\n return ThreadUpdater.setInterval();\r\n }\r\n },\r\n\r\n scrollBG() {\r\n return ThreadUpdater.scrollBG = Conf['Scroll BG'] ?\r\n () => true\r\n :\r\n () => !d.hidden;\r\n },\r\n\r\n interval(e) {\r\n let val = parseInt(this.value, 10);\r\n if (val < 1) { val = 1; }\r\n ThreadUpdater.interval = (this.value = val);\r\n if (e) { return $.cb.value.call(this); }\r\n },\r\n\r\n load() {\r\n if (this !== ThreadUpdater.req) { return; } // aborted\r\n switch (this.status) {\r\n case 200:\r\n ThreadUpdater.parse(this);\r\n if (ThreadUpdater.thread.isArchived) {\r\n return ThreadUpdater.kill();\r\n } else {\r\n return ThreadUpdater.setInterval();\r\n }\r\n case 404:\r\n // XXX workaround for 4chan sending false 404s\r\n return $.ajax(g.SITE.urls.catalogJSON({boardID: ThreadUpdater.thread.board.ID}), { onloadend() {\r\n let confirmed;\r\n if (this.status === 200) {\r\n confirmed = true;\r\n for (var page of this.response) {\r\n for (var thread of page.threads) {\r\n if (thread.no === ThreadUpdater.thread.ID) {\r\n confirmed = false;\r\n break;\r\n }\r\n }\r\n }\r\n } else {\r\n confirmed = false;\r\n }\r\n if (confirmed) {\r\n return ThreadUpdater.kill();\r\n } else {\r\n return ThreadUpdater.error(this);\r\n }\r\n }\r\n }\r\n );\r\n default:\r\n return ThreadUpdater.error(this);\r\n }\r\n }\r\n },\r\n\r\n kill() {\r\n ThreadUpdater.thread.kill();\r\n ThreadUpdater.setInterval();\r\n return $.event('ThreadUpdate', {\r\n 404: true,\r\n threadID: ThreadUpdater.thread.fullID\r\n }\r\n );\r\n },\r\n\r\n error(req) {\r\n if (req.status === 304) {\r\n ThreadUpdater.set('status', '');\r\n }\r\n ThreadUpdater.setInterval();\r\n if (!req.status) {\r\n return ThreadUpdater.set('status', 'Connection Error', 'warning');\r\n } else if (req.status !== 304) {\r\n return ThreadUpdater.set('status', `${req.statusText} (${req.status})`, 'warning');\r\n }\r\n },\r\n\r\n setInterval() {\r\n clearTimeout(ThreadUpdater.timeoutID);\r\n\r\n if (ThreadUpdater.thread.isDead) {\r\n ThreadUpdater.set('status', (ThreadUpdater.thread.isArchived ? 'Archived' : '404'), 'warning');\r\n ThreadUpdater.set('timer', '');\r\n return;\r\n }\r\n\r\n // Fetching your own posts after posting\r\n if (ThreadUpdater.postID && (ThreadUpdater.checkPostCount < 5)) {\r\n ThreadUpdater.set('timer', '...', 'loading');\r\n ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * SECOND);\r\n return;\r\n }\r\n\r\n if (!Conf['Auto Update']) {\r\n ThreadUpdater.set('timer', 'Update');\r\n return;\r\n }\r\n\r\n const {interval} = ThreadUpdater;\r\n if (Conf['Optional Increase']) {\r\n // Lower the max refresh rate limit on visible tabs.\r\n const limit = d.hidden ? 10 : 5;\r\n const j = Math.min(ThreadUpdater.outdateCount, limit);\r\n\r\n // 1 second to 100, 30 to 300.\r\n const cur = (Math.floor(interval * 0.1) || 1) * j * j;\r\n ThreadUpdater.seconds = $.minmax(cur, interval, 300);\r\n } else {\r\n ThreadUpdater.seconds = interval;\r\n }\r\n\r\n return ThreadUpdater.timeout();\r\n },\r\n\r\n intervalShortcut() {\r\n Settings.open('Advanced');\r\n const settings = $.id('fourchanx-settings');\r\n return $('input[name=Interval]', settings).focus();\r\n },\r\n\r\n set(name, text, klass) {\r\n let node;\r\n const el = ThreadUpdater[name];\r\n if ((node = el.firstChild)) {\r\n // Prevent the creation of a new DOM Node\r\n // by setting the text node's data.\r\n node.data = text;\r\n } else {\r\n el.textContent = text;\r\n }\r\n return el.className = klass ?? (text === '' ? 'empty' : '');\r\n },\r\n\r\n timeout() {\r\n if (ThreadUpdater.seconds) {\r\n ThreadUpdater.set('timer', ThreadUpdater.seconds);\r\n ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000);\r\n } else {\r\n ThreadUpdater.outdateCount++;\r\n ThreadUpdater.update();\r\n }\r\n return ThreadUpdater.seconds--;\r\n },\r\n\r\n update() {\r\n let oldReq;\r\n clearTimeout(ThreadUpdater.timeoutID);\r\n ThreadUpdater.set('timer', '...', 'loading');\r\n if (oldReq = ThreadUpdater.req) {\r\n delete ThreadUpdater.req;\r\n oldReq.abort();\r\n }\r\n return ThreadUpdater.req = $.whenModified(\r\n g.SITE.urls.threadJSON({boardID: ThreadUpdater.thread.board.ID, threadID: ThreadUpdater.thread.ID}),\r\n 'ThreadUpdater',\r\n ThreadUpdater.cb.load,\r\n { timeout: MINUTE }\r\n );\r\n },\r\n\r\n updateThreadStatus(type, status) {\r\n let hasChanged;\r\n if (!(hasChanged = ThreadUpdater.thread[`is${type}`] !== status)) { return; }\r\n ThreadUpdater.thread.setStatus(type, status);\r\n if ((type === 'Closed') && ThreadUpdater.thread.isArchived) { return; }\r\n const change = type === 'Sticky' ?\r\n status ?\r\n 'now a sticky'\r\n :\r\n 'not a sticky anymore'\r\n :\r\n status ?\r\n 'now closed'\r\n :\r\n 'not closed anymore';\r\n return new Notice('info', `The thread is ${change}.`, 30);\r\n },\r\n\r\n parse(req) {\r\n let ID, ipCountEl, post;\r\n const postObjects = req.response.posts;\r\n const OP = postObjects[0];\r\n const {thread} = ThreadUpdater;\r\n const {board} = thread;\r\n const lastPost = ThreadUpdater.postIDs[ThreadUpdater.postIDs.length - 1];\r\n\r\n // XXX Reject updates that falsely delete the last post.\r\n if ((postObjects[postObjects.length-1].no < lastPost) &&\r\n ((new Date(req.getResponseHeader('Last-Modified')) - thread.posts.get(lastPost).info.date) < (30 * SECOND))) { return; }\r\n\r\n g.SITE.Build.spoilerRange[board] = OP.custom_spoiler;\r\n thread.setStatus('Archived', !!OP.archived);\r\n ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky);\r\n ThreadUpdater.updateThreadStatus('Closed', !!OP.closed);\r\n thread.postLimit = !!OP.bumplimit;\r\n thread.fileLimit = !!OP.imagelimit;\r\n if (OP.unique_ips != null) { thread.ipCount = OP.unique_ips; }\r\n\r\n const posts = []; // new post objects\r\n const index = []; // existing posts\r\n const files = []; // existing files\r\n const newPosts = []; // new post fullID list for API\r\n\r\n // Build the index, create posts.\r\n for (var postObject of postObjects) {\r\n ID = postObject.no;\r\n index.push(ID);\r\n if (postObject.fsize) { files.push(ID); }\r\n\r\n // Insert new posts, not older ones.\r\n if (ID <= lastPost) { continue; }\r\n\r\n // XXX Resurrect wrongly deleted posts.\r\n if ((post = thread.posts.get(ID)) && !post.isFetchedQuote) {\r\n post.resurrect();\r\n continue;\r\n }\r\n\r\n newPosts.push(`${board}.${ID}`);\r\n var node = g.SITE.Build.postFromObject(postObject, board.ID);\r\n posts.push(new Post(node, thread, board));\r\n // Fetching your own posts after posting\r\n if (ThreadUpdater.postID === ID) { delete ThreadUpdater.postID; }\r\n }\r\n\r\n // Check for deleted posts.\r\n const deletedPosts = [];\r\n for (ID of ThreadUpdater.postIDs) {\r\n if (!index.includes(ID)) {\r\n thread.posts.get(ID).kill();\r\n deletedPosts.push(`${board}.${ID}`);\r\n }\r\n }\r\n ThreadUpdater.postIDs = index;\r\n\r\n // Check for deleted files.\r\n const deletedFiles = [];\r\n for (ID of ThreadUpdater.fileIDs) {\r\n if (!(files.includes(ID) || deletedPosts.includes(`${board}.${ID}`))) {\r\n thread.posts.get(ID).kill(true);\r\n deletedFiles.push(`${board}.${ID}`);\r\n }\r\n }\r\n ThreadUpdater.fileIDs = files;\r\n\r\n if (!posts.length) {\r\n ThreadUpdater.set('status', '');\r\n } else {\r\n ThreadUpdater.set('status', `+${posts.length}`, 'new');\r\n ThreadUpdater.outdateCount = 0;\r\n\r\n const unreadCount = Unread.posts?.size;\r\n const unreadQYCount = Unread.postsQuotingYou?.size;\r\n\r\n Main.callbackNodes('Post', posts);\r\n\r\n if (d.hidden || !d.hasFocus()) {\r\n if (Conf['Beep Quoting You'] && (Unread.postsQuotingYou?.size > unreadQYCount)) {\r\n ThreadUpdater.playBeep();\r\n if (Conf['Beep']) { ThreadUpdater.playBeep(); }\r\n } else if (Conf['Beep'] && (Unread.posts?.size > 0) && (unreadCount === 0)) {\r\n ThreadUpdater.playBeep();\r\n }\r\n }\r\n\r\n const scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() &&\r\n ((ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight) < 25);\r\n\r\n let firstPost = null;\r\n for (post of posts) {\r\n if (!QuoteThreading.insert(post)) {\r\n if (!firstPost) { firstPost = post.nodes.root; }\r\n $.add(ThreadUpdater.root, post.nodes.root);\r\n }\r\n }\r\n $.event('PostsInserted', null, ThreadUpdater.root);\r\n\r\n if (scroll) {\r\n if (Conf['Bottom Scroll']) {\r\n window.scrollTo(0, d.body.clientHeight);\r\n } else {\r\n if (firstPost) { Header.scrollTo(firstPost); }\r\n }\r\n }\r\n }\r\n\r\n // Update IP count in original post form.\r\n if ((OP.unique_ips != null) && (ipCountEl = $.id('unique-ips'))) {\r\n ipCountEl.textContent = OP.unique_ips;\r\n ipCountEl.previousSibling.textContent = ipCountEl.previousSibling.textContent.replace(/\\b(?:is|are)\\b/, OP.unique_ips === 1 ? 'is' : 'are');\r\n ipCountEl.nextSibling.textContent = ipCountEl.nextSibling.textContent.replace(/\\bposters?\\b/, OP.unique_ips === 1 ? 'poster' : 'posters');\r\n }\r\n\r\n return $.event('ThreadUpdate', {\r\n 404: false,\r\n threadID: thread.fullID,\r\n newPosts,\r\n deletedPosts,\r\n deletedFiles,\r\n postCount: OP.replies + 1,\r\n fileCount: OP.images + !!OP.fsize,\r\n ipCount: OP.unique_ips\r\n }\r\n );\r\n }\r\n};\r\nexport default ThreadUpdater;\r\n",null,"import Callbacks from \"../classes/Callbacks\";\r\nimport Header from \"../General/Header\";\r\nimport UI from \"../General/UI\";\r\nimport { Conf, doc, g } from \"../globals/globals\";\r\nimport $ from \"../platform/$\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar FappeTyme = {\r\n init() {\r\n if ((!Conf['Fappe Tyme'] && !Conf['Werk Tyme']) || !['index', 'thread', 'archive'].includes(g.VIEW)) { return; }\r\n\r\n this.nodes = {};\r\n this.enabled = {\r\n fappe: false,\r\n werk: Conf['werk']\r\n };\r\n\r\n for (var type of [\"Fappe\", \"Werk\"]) {\r\n if (Conf[`${type} Tyme`]) {\r\n var lc = type.toLowerCase();\r\n var el = UI.checkbox(lc, `${type} Tyme`, false);\r\n el.title = `${type} Tyme`;\r\n\r\n this.nodes[lc] = el.firstElementChild;\r\n if (Conf[lc]) { this.set(lc, true); }\r\n $.on(this.nodes[lc], 'change', this.toggle.bind(this, lc));\r\n\r\n Header.menu.addEntry({\r\n el,\r\n order: 97\r\n });\r\n\r\n var indicator = $.el('span', {\r\n className: 'indicator',\r\n textContent: type[0],\r\n title: `${type} Tyme active`\r\n }\r\n );\r\n $.on(indicator, 'click', function() {\r\n const check = $.getOwn(FappeTyme.nodes, this.parentNode.id.replace('shortcut-', ''));\r\n check.checked = !check.checked;\r\n return $.event('change', null, check);\r\n });\r\n Header.addShortcut(lc, indicator, 410);\r\n }\r\n }\r\n\r\n if (Conf['Werk Tyme']) {\r\n $.sync('werk', this.set.bind(this, 'werk'));\r\n }\r\n\r\n Callbacks.Post.push({\r\n name: 'Fappe Tyme',\r\n cb: this.node\r\n });\r\n\r\n return Callbacks.CatalogThread.push({\r\n name: 'Werk Tyme',\r\n cb: this.catalogNode\r\n });\r\n },\r\n\r\n node() {\r\n return this.nodes.root.classList.toggle('noFile', !this.files.length);\r\n },\r\n\r\n catalogNode() {\r\n const file = this.thread.OP.files[0];\r\n if (!file) { return; }\r\n const filename = $.el('div', {\r\n textContent: file.name,\r\n className: 'werkTyme-filename'\r\n }\r\n );\r\n return $.add(this.nodes.thumb.parentNode, filename);\r\n },\r\n\r\n set(type, enabled) {\r\n this.enabled[type] = (this.nodes[type].checked = enabled);\r\n return $[`${enabled ? 'add' : 'rm'}Class`](doc, `${type}Tyme`);\r\n },\r\n\r\n toggle(type) {\r\n this.set(type, !this.enabled[type]);\r\n if (type === 'werk') { return $.cb.checked.call(this.nodes[type]); }\r\n }\r\n};\r\nexport default FappeTyme;\r\n","import Callbacks from \"../classes/Callbacks\";\r\nimport Notice from \"../classes/Notice\";\r\nimport Filter from \"../Filtering/Filter\";\r\nimport { g, Conf, doc } from \"../globals/globals\";\r\nimport $ from \"../platform/$\";\r\nimport { dict } from \"../platform/helpers\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * DS104: Avoid inline assignments\r\n * DS204: Change includes calls to have a more natural evaluation order\r\n * DS207: Consider shorter variations of null checks\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar Sauce = {\r\n init() {\r\n let link;\r\n if (!['index', 'thread'].includes(g.VIEW) || !Conf['Sauce']) { return; }\r\n $.addClass(doc, 'show-sauce');\r\n\r\n const links = [];\r\n for (link of Conf['sauces'].split('\\n')) {\r\n var linkData;\r\n if ((link[0] !== '#') && (linkData = this.parseLink(link))) {\r\n links.push(linkData);\r\n }\r\n }\r\n if (!links.length) { return; }\r\n\r\n this.links = links;\r\n this.link = $.el('a', {\r\n target: '_blank',\r\n className: 'sauce'\r\n }\r\n );\r\n return Callbacks.Post.push({\r\n name: 'Sauce',\r\n cb: this.node\r\n });\r\n },\r\n\r\n parseLink(link) {\r\n if (!(link = link.trim())) { return null; }\r\n const parts = dict();\r\n const iterable = link.split(/;(?=(?:text|boards|types|regexp|sandbox):?)/);\r\n for (let i = 0; i < iterable.length; i++) {\r\n var part = iterable[i];\r\n if (i === 0) {\r\n parts['url'] = part;\r\n } else {\r\n var m = part.match(/^(\\w*):?(.*)$/);\r\n parts[m[1]] = m[2];\r\n }\r\n }\r\n if (!parts['text']) { parts['text'] = parts['url'].match(/(\\w+)\\.\\w+\\//)?.[1] || '?'; }\r\n if ('boards' in parts) {\r\n parts['boards'] = Filter.parseBoards(parts['boards']);\r\n }\r\n if ('regexp' in parts) {\r\n try {\r\n let regexp;\r\n if (regexp = parts['regexp'].match(/^\\/(.*)\\/(\\w*)$/)) {\r\n parts['regexp'] = RegExp(regexp[1], regexp[2]);\r\n } else {\r\n parts['regexp'] = RegExp(parts['regexp']);\r\n }\r\n } catch (err) {\r\n new Notice('warning', [\r\n $.tn(\"Invalid regexp for Sauce link:\"),\r\n $.el('br'),\r\n $.tn(link),\r\n $.el('br'),\r\n $.tn(err.message)\r\n ], 60);\r\n return null;\r\n }\r\n }\r\n return parts;\r\n },\r\n\r\n createSauceLink(link, post, file) {\r\n let a, matches, needle;\r\n const ext = file.url.match(/[^.]*$/)[0];\r\n const parts = dict();\r\n $.extend(parts, link);\r\n\r\n if (!!parts['boards'] && !parts['boards'][`${post.siteID}/${post.boardID}`] && !parts['boards'][`${post.siteID}/*`]) { return null; }\r\n if (!!parts['types'] && (needle = ext, !parts['types'].split(',').includes(needle))) { return null; }\r\n if (!!parts['regexp'] && (!(matches = file.name.match(parts['regexp'])))) { return null; }\r\n\r\n const missing = [];\r\n for (var key of ['url', 'text']) {\r\n parts[key] = parts[key].replace(/%(T?URL|IMG|[sh]?MD5|board|name|%|semi|\\$\\d+)/g, function(orig, parameter) {\r\n let type;\r\n if (parameter[0] === '$') {\r\n if (!matches) { return orig; }\r\n type = matches[parameter.slice(1)] || '';\r\n } else {\r\n type = Sauce.formatters[parameter](post, file, ext);\r\n if ((type == null)) {\r\n missing.push(parameter);\r\n return '';\r\n }\r\n }\r\n\r\n if ((key === 'url') && !['%', 'semi'].includes(parameter)) {\r\n if (/^javascript:/i.test(parts['url'])) { type = JSON.stringify(type); }\r\n type = encodeURIComponent(type);\r\n }\r\n return type;\r\n });\r\n }\r\n\r\n if (g.SITE.areMD5sDeferred?.(post.board) && missing.length && !missing.filter(x => !/^.?MD5$/.test(x)).length) {\r\n a = Sauce.link.cloneNode(false);\r\n a.dataset.skip = '1';\r\n return a;\r\n }\r\n\r\n if (missing.length) { return null; }\r\n\r\n a = Sauce.link.cloneNode(false);\r\n a.href = parts['url'];\r\n a.textContent = parts['text'];\r\n if (/^javascript:/i.test(parts['url'])) { a.removeAttribute('target'); }\r\n return a;\r\n },\r\n\r\n node() {\r\n if (this.isClone) { return; }\r\n for (var file of this.files) {\r\n Sauce.file(this, file);\r\n }\r\n },\r\n\r\n file(post, file) {\r\n let link, node;\r\n const nodes = [];\r\n const skipped = [];\r\n for (link of Sauce.links) {\r\n if (node = Sauce.createSauceLink(link, post, file)) {\r\n nodes.push($.tn(' '), node);\r\n if (node.dataset.skip) { skipped.push([link, node]); }\r\n }\r\n }\r\n $.add(file.text, nodes);\r\n\r\n if (skipped.length) {\r\n var observer = new MutationObserver(function() {\r\n if (file.text.dataset.md5) {\r\n for ([link, node] of skipped) {\r\n var node2;\r\n if (node2 = Sauce.createSauceLink(link, post, file)) {\r\n $.replace(node, node2);\r\n }\r\n }\r\n return observer.disconnect();\r\n }\r\n });\r\n return observer.observe(file.text, {attributes: true});\r\n }\r\n },\r\n\r\n formatters: {\r\n TURL(post, file) { return file.thumbURL; },\r\n URL(post, file) { return file.url; },\r\n IMG(post, file, ext) { if (['gif', 'jpg', 'jpeg', 'png'].includes(ext)) { return file.url; } else { return file.thumbURL; } },\r\n MD5(post, file) { return file.MD5; },\r\n sMD5(post, file) { return file.MD5?.replace(/[+/=]/g, c => ({'+': '-', '/': '_', '=': ''})[c]); },\r\n hMD5(post, file) { if (file.MD5) { return (atob(file.MD5).map((c) => `0${c.charCodeAt(0).toString(16)}`.slice(-2))).join(''); } },\r\n board(post) { return post.board.ID; },\r\n name(post, file) { return file.name; },\r\n '%'() { return '%'; },\r\n semi() { return ';'; }\r\n }\r\n};\r\nexport default Sauce;\r\n","/*\r\n * decaffeinate suggestions:\r\n * DS101: Remove unnecessary use of Array.from\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * DS205: Consider reworking code to avoid use of IIFEs\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nimport galleryPage from './Gallery/Gallery.html';\r\nimport $ from '../platform/$';\r\nimport Callbacks from '../classes/Callbacks';\r\nimport Notice from '../classes/Notice';\r\nimport Main from '../main/Main';\r\nimport Keybinds from '../Miscellaneous/Keybinds';\r\nimport $$ from '../platform/$$';\r\nimport ImageCommon from './ImageCommon';\r\nimport Sauce from './Sauce';\r\nimport Volume from './Volume';\r\nimport Header from '../General/Header';\r\nimport { Conf, d, doc, g } from '../globals/globals';\r\nimport UI from '../General/UI';\r\nimport Get from '../General/Get';\r\nimport { debounce, dict, SECOND } from '../platform/helpers';\r\n\r\nvar Gallery = {\r\n init() {\r\n if (!(this.enabled = Conf['Gallery'] && ['index', 'thread'].includes(g.VIEW))) { return; }\r\n\r\n this.delay = Conf['Slide Delay'];\r\n\r\n const el = $.el('a', {\r\n href: 'javascript:;',\r\n title: 'Gallery',\r\n textContent: '🖼︎',\r\n });\r\n\r\n $.on(el, 'click', this.cb.toggle);\r\n\r\n Header.addShortcut('gallery', el, 530);\r\n\r\n return Callbacks.Post.push({\r\n name: 'Gallery',\r\n cb: this.node\r\n });\r\n },\r\n\r\n node() {\r\n return (() => {\r\n const result = [];\r\n for (var file of this.files) {\r\n if (file.thumb) {\r\n if (Gallery.nodes) {\r\n Gallery.generateThumb(this, file);\r\n Gallery.nodes.total.textContent = Gallery.images.length;\r\n }\r\n\r\n if (!Conf['Image Expansion'] && ((g.SITE.software !== 'tinyboard') || !Main.jsEnabled)) {\r\n result.push($.on(file.thumbLink, 'click', Gallery.cb.image));\r\n } else {\r\n result.push(undefined);\r\n }\r\n }\r\n }\r\n return result;\r\n })();\r\n },\r\n\r\n build(image) {\r\n let dialog, thumb;\r\n const {cb} = Gallery;\r\n\r\n if (Conf['Fullscreen Gallery']) {\r\n $.one(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', () => $.on(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', cb.close));\r\n doc.mozRequestFullScreen?.();\r\n doc.webkitRequestFullScreen?.(Element.ALLOW_KEYBOARD_INPUT);\r\n }\r\n\r\n Gallery.images = [];\r\n const nodes = (Gallery.nodes = {});\r\n Gallery.fileIDs = dict();\r\n Gallery.slideshow = false;\r\n\r\n nodes.el = (dialog = $.el('div',\r\n {id: 'a-gallery'}));\r\n $.extend(dialog, {innerHTML: galleryPage });\r\n\r\n const object = {\r\n buttons: '.gal-buttons',\r\n frame: '.gal-image',\r\n name: '.gal-name',\r\n count: '.count',\r\n total: '.total',\r\n sauce: '.gal-sauce',\r\n thumbs: '.gal-thumbnails',\r\n next: '.gal-image a',\r\n current: '.gal-image img'\r\n };\r\n for (var key in object) { var value = object[key]; nodes[key] = $(value, dialog); }\r\n\r\n const menuButton = $('.menu-button', dialog);\r\n nodes.menu = new UI.Menu('gallery');\r\n\r\n $.on(nodes.frame, 'click', cb.blank);\r\n if (Conf['Mouse Wheel Volume']) { $.on(nodes.frame, 'wheel', Volume.wheel); }\r\n $.on(nodes.next, 'click', cb.click);\r\n $.on(nodes.name, 'click', ImageCommon.download);\r\n\r\n $.on($('.gal-prev', dialog), 'click', cb.prev);\r\n $.on($('.gal-next', dialog), 'click', cb.next);\r\n $.on($('.gal-start', dialog), 'click', cb.start);\r\n $.on($('.gal-stop', dialog), 'click', cb.stop);\r\n $.on($('.gal-close', dialog), 'click', cb.close);\r\n\r\n $.on(menuButton, 'click', function(e) {\r\n return nodes.menu.toggle(e, this, g);\r\n });\r\n\r\n for (var entry of Gallery.menu.createSubEntries()) {\r\n entry.order = 0;\r\n nodes.menu.addEntry(entry);\r\n }\r\n\r\n $.on(d, 'keydown', cb.keybinds);\r\n if (Conf['Keybinds']) { $.off(d, 'keydown', Keybinds.keydown); }\r\n\r\n $.on(window, 'resize', Gallery.cb.setHeight);\r\n\r\n for (var postThumb of $$(g.SITE.selectors.file.thumb)) {\r\n var post;\r\n if (!(post = Get.postFromNode(postThumb))) { continue; }\r\n for (var file of post.files) {\r\n if (file.thumb) {\r\n Gallery.generateThumb(post, file);\r\n // If no image to open is given, pick image we have scrolled to.\r\n if (!image && Gallery.fileIDs[`${post.fullID}.${file.index}`]) {\r\n var candidate = file.thumbLink;\r\n if ((Header.getTopOf(candidate) + candidate.getBoundingClientRect().height) >= 0) {\r\n image = candidate;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n $.addClass(doc, 'gallery-open');\r\n\r\n $.add(d.body, dialog);\r\n\r\n nodes.thumbs.scrollTop = 0;\r\n nodes.current.parentElement.scrollTop = 0;\r\n\r\n if (image) { thumb = $(`[href='${image.href}']`, nodes.thumbs); }\r\n if (!thumb) { thumb = Gallery.images[Gallery.images.length-1]; }\r\n if (thumb) { Gallery.open(thumb); }\r\n\r\n doc.style.overflow = 'hidden';\r\n return nodes.total.textContent = Gallery.images.length;\r\n },\r\n\r\n generateThumb(post, file) {\r\n if (post.isClone || post.isHidden) { return; }\r\n if (!file || !file.thumb || (!file.isImage && !file.isVideo && !Conf['PDF in Gallery'])) { return; }\r\n if (Gallery.fileIDs[`${post.fullID}.${file.index}`]) { return; }\r\n\r\n Gallery.fileIDs[`${post.fullID}.${file.index}`] = true;\r\n\r\n const thumb = $.el('a', {\r\n className: 'gal-thumb',\r\n href: file.url,\r\n target: '_blank',\r\n title: file.name\r\n }\r\n );\r\n\r\n thumb.dataset.id = Gallery.images.length;\r\n thumb.dataset.post = post.fullID;\r\n thumb.dataset.file = file.index;\r\n\r\n const thumbImg = file.thumb.cloneNode(false);\r\n thumbImg.style.cssText = '';\r\n $.add(thumb, thumbImg);\r\n\r\n $.on(thumb, 'click', Gallery.cb.open);\r\n\r\n Gallery.images.push(thumb);\r\n return $.add(Gallery.nodes.thumbs, thumb);\r\n },\r\n\r\n load(thumb, errorCB) {\r\n const ext = thumb.href.match(/\\w*$/);\r\n const elType = $.getOwn({'webm': 'video', 'mp4': 'video', 'ogv': 'video', 'pdf': 'iframe'}, ext) || 'img';\r\n const file = $.el(elType);\r\n $.extend(file.dataset, thumb.dataset);\r\n $.on(file, 'error', errorCB);\r\n file.src = thumb.href;\r\n return file;\r\n },\r\n\r\n open(thumb) {\r\n let el, file, post;\r\n const {nodes} = Gallery;\r\n const oldID = +nodes.current.dataset.id;\r\n const newID = +thumb.dataset.id;\r\n\r\n // Highlight, center selected thumbnail\r\n if (el = Gallery.images[oldID]) { $.rmClass(el, 'gal-highlight'); }\r\n $.addClass(thumb, 'gal-highlight');\r\n nodes.thumbs.scrollTop = (thumb.offsetTop + (thumb.offsetHeight/2)) - (nodes.thumbs.clientHeight/2);\r\n\r\n // Load image or use preloaded image\r\n if (Gallery.cache?.dataset.id === (''+newID)) {\r\n file = Gallery.cache;\r\n $.off(file, 'error', Gallery.cacheError);\r\n $.on(file, 'error', Gallery.error);\r\n } else {\r\n file = Gallery.load(thumb, Gallery.error);\r\n }\r\n\r\n // Replace old image with new one\r\n $.off(nodes.current, 'error', Gallery.error);\r\n ImageCommon.pause(nodes.current);\r\n $.replace(nodes.current, file);\r\n nodes.current = file;\r\n\r\n if (file.nodeName === 'VIDEO') {\r\n file.loop = true;\r\n Volume.setup(file);\r\n if (Conf['Autoplay']) { file.play(); }\r\n if (Conf['Show Controls']) { ImageCommon.addControls(file); }\r\n }\r\n\r\n doc.classList.toggle('gal-pdf', file.nodeName === 'IFRAME');\r\n Gallery.cb.setHeight();\r\n nodes.count.textContent = +thumb.dataset.id + 1;\r\n nodes.name.download = (nodes.name.textContent = thumb.title);\r\n nodes.name.href = thumb.href;\r\n nodes.frame.scrollTop = 0;\r\n nodes.next.focus();\r\n\r\n // Set sauce links\r\n $.rmAll(nodes.sauce);\r\n if (Conf['Sauce'] && Sauce.links && (post = g.posts.get(file.dataset.post))) {\r\n const sauces = [];\r\n for (var link of Sauce.links) {\r\n var node;\r\n if (node = Sauce.createSauceLink(link, post, post.files[+file.dataset.file])) {\r\n sauces.push($.tn(' '), node);\r\n }\r\n }\r\n $.add(nodes.sauce, sauces);\r\n }\r\n\r\n // Continue slideshow if moving forward, stop otherwise\r\n if (Gallery.slideshow && ((newID > oldID) || ((oldID === (Gallery.images.length-1)) && (newID === 0)))) {\r\n Gallery.setupTimer();\r\n } else {\r\n Gallery.cb.stop();\r\n }\r\n\r\n // Scroll to post\r\n if (Conf['Scroll to Post'] && (post = g.posts.get(file.dataset.post))) {\r\n Header.scrollTo(post.nodes.root);\r\n }\r\n\r\n // Preload next image\r\n if (isNaN(oldID) || (newID === ((oldID + 1) % Gallery.images.length))) {\r\n return Gallery.cache = Gallery.load(Gallery.images[(newID + 1) % Gallery.images.length], Gallery.cacheError);\r\n }\r\n },\r\n\r\n error() {\r\n if (this.error?.code === MediaError.MEDIA_ERR_DECODE) {\r\n return new Notice('error', 'Corrupt or unplayable video', 30);\r\n }\r\n if (ImageCommon.isFromArchive(this)) { return; }\r\n const post = g.posts.get(this.dataset.post);\r\n const file = post.files[+this.dataset.file];\r\n return ImageCommon.error(this, post, file, null, url => {\r\n if (!url) { return; }\r\n Gallery.images[+this.dataset.id].href = url;\r\n if (Gallery.nodes.current === this) { return this.src = url; }\r\n });\r\n },\r\n\r\n cacheError() {\r\n return delete Gallery.cache;\r\n },\r\n\r\n cleanupTimer() {\r\n clearTimeout(Gallery.timeoutID);\r\n const {current} = Gallery.nodes;\r\n $.off(current, 'canplaythrough load', Gallery.startTimer);\r\n return $.off(current, 'ended', Gallery.cb.next);\r\n },\r\n\r\n startTimer() {\r\n return Gallery.timeoutID = setTimeout(Gallery.checkTimer, Gallery.delay * SECOND);\r\n },\r\n\r\n setupTimer() {\r\n Gallery.cleanupTimer();\r\n const {current} = Gallery.nodes;\r\n const isVideo = current.nodeName === 'VIDEO';\r\n if (isVideo) { current.play(); }\r\n if ((isVideo ? current.readyState >= 4 : current.complete) || (current.nodeName === 'IFRAME')) {\r\n return Gallery.startTimer();\r\n } else {\r\n return $.on(current, (isVideo ? 'canplaythrough' : 'load'), Gallery.startTimer);\r\n }\r\n },\r\n\r\n checkTimer() {\r\n const {current} = Gallery.nodes;\r\n if ((current.nodeName === 'VIDEO') && !current.paused) {\r\n $.on(current, 'ended', Gallery.cb.next);\r\n return current.loop = false;\r\n } else {\r\n return Gallery.cb.next();\r\n }\r\n },\r\n\r\n cb: {\r\n keybinds(e) {\r\n let key;\r\n if (!(key = Keybinds.keyCode(e))) { return; }\r\n\r\n const cb = (() => { switch (key) {\r\n case Conf['Close']: case Conf['Open Gallery']:\r\n return Gallery.cb.close;\r\n case Conf['Next Gallery Image']:\r\n return Gallery.cb.next;\r\n case Conf['Advance Gallery']:\r\n return Gallery.cb.advance;\r\n case Conf['Previous Gallery Image']:\r\n return Gallery.cb.prev;\r\n case Conf['Pause']:\r\n return Gallery.cb.pause;\r\n case Conf['Slideshow']:\r\n return Gallery.cb.toggleSlideshow;\r\n case Conf['Rotate image anticlockwise']:\r\n return Gallery.cb.rotateLeft;\r\n case Conf['Rotate image clockwise']:\r\n return Gallery.cb.rotateRight;\r\n case Conf['Download Gallery Image']:\r\n return Gallery.cb.download;\r\n } })();\r\n\r\n if (!cb) { return; }\r\n e.stopPropagation();\r\n e.preventDefault();\r\n return cb();\r\n },\r\n\r\n open(e) {\r\n if (e) { e.preventDefault(); }\r\n if (this) { return Gallery.open(this); }\r\n },\r\n\r\n image(e) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n return Gallery.build(this);\r\n },\r\n\r\n prev() {\r\n return Gallery.cb.open.call(\r\n Gallery.images[+Gallery.nodes.current.dataset.id - 1] || Gallery.images[Gallery.images.length - 1]\r\n );\r\n },\r\n next() {\r\n return Gallery.cb.open.call(\r\n Gallery.images[+Gallery.nodes.current.dataset.id + 1] || Gallery.images[0]\r\n );\r\n },\r\n\r\n click(e) {\r\n if (ImageCommon.onControls(e)) { return; }\r\n e.preventDefault();\r\n return Gallery.cb.advance();\r\n },\r\n\r\n advance() { if (!Conf['Autoplay'] && Gallery.nodes.current.paused) { return Gallery.nodes.current.play(); } else { return Gallery.cb.next(); } },\r\n toggle() { return (Gallery.nodes ? Gallery.cb.close : Gallery.build)(); },\r\n blank(e) { if (e.target === this) { return Gallery.cb.close(); } },\r\n toggleSlideshow() { return Gallery.cb[Gallery.slideshow ? 'stop' : 'start'](); },\r\n\r\n download() {\r\n const name = $('.gal-name');\r\n return name.click();\r\n },\r\n\r\n pause() {\r\n Gallery.cb.stop();\r\n const {current} = Gallery.nodes;\r\n if (current.nodeName === 'VIDEO') { return current[current.paused ? 'play' : 'pause'](); }\r\n },\r\n\r\n start() {\r\n $.addClass(Gallery.nodes.buttons, 'gal-playing');\r\n Gallery.slideshow = true;\r\n return Gallery.setupTimer();\r\n },\r\n\r\n stop() {\r\n if (!Gallery.slideshow) { return; }\r\n Gallery.cleanupTimer();\r\n const {current} = Gallery.nodes;\r\n if (current.nodeName === 'VIDEO') { current.loop = true; }\r\n $.rmClass(Gallery.nodes.buttons, 'gal-playing');\r\n return Gallery.slideshow = false;\r\n },\r\n\r\n rotateLeft() { return Gallery.cb.rotate(270); },\r\n rotateRight() { return Gallery.cb.rotate(90); },\r\n\r\n rotate: debounce(100, function(delta) {\r\n const {current} = Gallery.nodes;\r\n if (current.nodeName === 'IFRAME') { return; }\r\n current.dataRotate = ((current.dataRotate || 0) + delta) % 360;\r\n current.style.transform = `rotate(${current.dataRotate}deg)`;\r\n return Gallery.cb.setHeight();\r\n }),\r\n\r\n close() {\r\n $.off(Gallery.nodes.current, 'error', Gallery.error);\r\n ImageCommon.pause(Gallery.nodes.current);\r\n $.rm(Gallery.nodes.el);\r\n $.rmClass(doc, 'gallery-open');\r\n if (Conf['Fullscreen Gallery']) {\r\n $.off(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', Gallery.cb.close);\r\n d.mozCancelFullScreen?.();\r\n d.webkitExitFullscreen?.();\r\n }\r\n delete Gallery.nodes;\r\n delete Gallery.fileIDs;\r\n doc.style.overflow = '';\r\n\r\n $.off(d, 'keydown', Gallery.cb.keybinds);\r\n if (Conf['Keybinds']) { $.on(d, 'keydown', Keybinds.keydown); }\r\n $.off(window, 'resize', Gallery.cb.setHeight);\r\n return clearTimeout(Gallery.timeoutID);\r\n },\r\n\r\n setFitness() {\r\n return (this.checked ? $.addClass : $.rmClass)(doc, `gal-${this.name.toLowerCase().replace(/\\s+/g, '-')}`);\r\n },\r\n\r\n setHeight: debounce(100, function () {\r\n let dim, margin, minHeight;\r\n const {current, frame} = Gallery.nodes;\r\n const {style} = current;\r\n\r\n if (Conf['Stretch to Fit'] && (dim = g.posts.get(current.dataset.post)?.files[+current.dataset.file].dimensions)) {\r\n const [width, height] = Array.from(dim.split('x'));\r\n let containerWidth = frame.clientWidth;\r\n let containerHeight = doc.clientHeight - 25;\r\n if (((current.dataRotate || 0) % 180) === 90) {\r\n [containerWidth, containerHeight] = Array.from([containerHeight, containerWidth]);\r\n }\r\n minHeight = Math.min(containerHeight, (height / width) * containerWidth);\r\n style.minHeight = minHeight + 'px';\r\n style.minWidth = ((width / height) * minHeight) + 'px';\r\n } else {\r\n style.minHeight = (style.minWidth = '');\r\n }\r\n\r\n if (((current.dataRotate || 0) % 180) === 90) {\r\n style.maxWidth = Conf['Fit Height'] ? `${doc.clientHeight - 25}px` : 'none';\r\n style.maxHeight = Conf['Fit Width'] ? `${frame.clientWidth}px` : 'none';\r\n margin = (current.clientWidth - current.clientHeight)/2;\r\n return style.margin = `${margin}px ${-margin}px`;\r\n } else {\r\n return style.maxWidth = (style.maxHeight = (style.margin = ''));\r\n }\r\n }),\r\n\r\n setDelay() { return Gallery.delay = +this.value; }\r\n },\r\n\r\n menu: {\r\n init() {\r\n if (!Gallery.enabled) { return; }\r\n\r\n const el = $.el('span', {\r\n textContent: 'Gallery',\r\n className: 'gallery-link'\r\n }\r\n );\r\n\r\n return Header.menu.addEntry({\r\n el,\r\n order: 105,\r\n subEntries: Gallery.menu.createSubEntries()\r\n });\r\n },\r\n\r\n createSubEntry(name) {\r\n const label = UI.checkbox(name, name);\r\n const input = label.firstElementChild;\r\n if (['Hide Thumbnails', 'Fit Width', 'Fit Height'].includes(name)) { $.on(input, 'change', Gallery.cb.setFitness); }\r\n $.event('change', null, input);\r\n $.on(input, 'change', $.cb.checked);\r\n if (['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Stretch to Fit'].includes(name)) { $.on(input, 'change', Gallery.cb.setHeight); }\r\n return {el: label};\r\n },\r\n\r\n createSubEntries() {\r\n const subEntries = (['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Stretch to Fit', 'Scroll to Post'].map((item) => Gallery.menu.createSubEntry(item)));\r\n\r\n const delayLabel = $.el('label', {innerHTML: 'Slide Delay: '});\r\n const delayInput = delayLabel.firstElementChild;\r\n delayInput.value = Gallery.delay;\r\n $.on(delayInput, 'change', Gallery.cb.setDelay);\r\n $.on(delayInput, 'change', $.cb.value);\r\n subEntries.push({el: delayLabel});\r\n\r\n return subEntries;\r\n }\r\n }\r\n};\r\nexport default Gallery;\r\n","import Get from '../General/Get';\r\nimport Header from '../General/Header';\r\nimport UI from '../General/UI';\r\nimport { g, Conf, d, doc, E } from '../globals/globals';\r\nimport ImageHost from '../Images/ImageHost';\r\nimport Main from '../main/Main';\r\nimport $ from '../platform/$';\r\nimport $$ from '../platform/$$';\r\nimport CrossOrigin from '../platform/CrossOrigin';\r\nimport { dict } from '../platform/helpers';\r\nimport EmbeddingPage from './Embedding/Embed.html';\r\n/*\r\n * decaffeinate suggestions:\r\n * DS101: Remove unnecessary use of Array.from\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * DS205: Consider reworking code to avoid use of IIFEs\r\n * DS207: Consider shorter variations of null checks\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\n\r\nvar Embedding = {\r\n init() {\r\n if (!['index', 'thread', 'archive'].includes(g.VIEW) || !Conf['Linkify'] || (!Conf['Embedding'] && !Conf['Link Title'] && !Conf['Cover Preview'])) { return; }\r\n this.types = dict();\r\n for (var type of this.ordered_types) { this.types[type.key] = type; }\r\n\r\n if (Conf['Embedding'] && (g.VIEW !== 'archive')) {\r\n this.dialog = UI.dialog('embedding',\r\n { innerHTML: EmbeddingPage });\r\n this.media = $('#media-embed', this.dialog);\r\n $.one(d, '4chanXInitFinished', this.ready);\r\n $.on(d, 'IndexRefreshInternal', () => g.posts.forEach(function(post) {\r\n for (post of [post, ...Array.from(post.clones)]) {\r\n for (var embed of post.nodes.embedlinks) {\r\n Embedding.cb.catalogRemove.call(embed);\r\n }\r\n }\r\n }));\r\n }\r\n if (Conf['Link Title']) {\r\n return $.on(d, '4chanXInitFinished PostsInserted', function() {\r\n for (var key in Embedding.types) {\r\n var service = Embedding.types[key];\r\n if (service.title?.batchSize) {\r\n Embedding.flushTitles(service.title);\r\n }\r\n }\r\n });\r\n }\r\n },\r\n\r\n events(post) {\r\n let el, i, items;\r\n if (g.VIEW === 'archive') { return; }\r\n if (Conf['Embedding']) {\r\n i = 0;\r\n items = (post.nodes.embedlinks = $$('.embedder', post.nodes.comment));\r\n while ((el = items[i++])) {\r\n $.on(el, 'click', Embedding.cb.click);\r\n if ($.hasClass(el, 'embedded')) { Embedding.cb.toggle.call(el); }\r\n }\r\n }\r\n if (Conf['Cover Preview']) {\r\n i = 0;\r\n items = $$('.linkify', post.nodes.comment);\r\n while ((el = items[i++])) {\r\n var data;\r\n if (data = Embedding.services(el)) {\r\n Embedding.preview(data);\r\n }\r\n }\r\n return;\r\n }\r\n },\r\n\r\n process(link, post) {\r\n let data;\r\n if (!Conf['Embedding'] && !Conf['Link Title'] && !Conf['Cover Preview']) { return; }\r\n if ($.x('ancestor::pre', link)) { return; }\r\n if (data = Embedding.services(link)) {\r\n data.post = post;\r\n if (Conf['Embedding'] && (g.VIEW !== 'archive')) { Embedding.embed(data); }\r\n if (Conf['Link Title']) { Embedding.title(data); }\r\n if (Conf['Cover Preview'] && (g.VIEW !== 'archive')) { return Embedding.preview(data); }\r\n }\r\n },\r\n\r\n services(link) {\r\n const {href} = link;\r\n for (var type of Embedding.ordered_types) {\r\n var match;\r\n if (match = type.regExp.exec(href)) {\r\n return {key: type.key, uid: match[1], options: match[2], link};\r\n }\r\n }\r\n },\r\n\r\n embed(data) {\r\n const {key, uid, options, link, post} = data;\r\n const {href} = link;\r\n\r\n $.addClass(link, key.toLowerCase());\r\n\r\n const embed = $.el('a', {\r\n className: 'embedder',\r\n href: 'javascript:;'\r\n }\r\n ,\r\n {innerHTML: '(unembed)'});\r\n\r\n const object = {key, uid, options, href};\r\n for (var name in object) { var value = object[name]; embed.dataset[name] = value; }\r\n\r\n $.on(embed, 'click', Embedding.cb.click);\r\n $.after(link, [$.tn(' '), embed]);\r\n post.nodes.embedlinks.push(embed);\r\n\r\n if (Conf['Auto-embed'] && !Conf['Floating Embeds'] && !post.isFetchedQuote) {\r\n if ($.hasClass(doc, 'catalog-mode')) {\r\n return $.addClass(embed, 'embed-removed');\r\n } else {\r\n return Embedding.cb.toggle.call(embed);\r\n }\r\n }\r\n },\r\n\r\n ready() {\r\n if (!Main.isThisPageLegit()) { return; }\r\n $.addClass(Embedding.dialog, 'empty');\r\n $.on($('.close', Embedding.dialog), 'click', Embedding.closeFloat);\r\n $.on($('.move', Embedding.dialog), 'mousedown', Embedding.dragEmbed);\r\n $.on($('.jump', Embedding.dialog), 'click', function() {\r\n if (doc.contains(Embedding.lastEmbed)) { return Header.scrollTo(Embedding.lastEmbed); }\r\n });\r\n return $.add(d.body, Embedding.dialog);\r\n },\r\n\r\n closeFloat() {\r\n delete Embedding.lastEmbed;\r\n $.addClass(Embedding.dialog, 'empty');\r\n return $.replace(Embedding.media.firstChild, $.el('div'));\r\n },\r\n\r\n dragEmbed() {\r\n // only webkit can handle a blocking div\r\n const {style} = Embedding.media;\r\n if (Embedding.dragEmbed.mouseup) {\r\n $.off(d, 'mouseup', Embedding.dragEmbed);\r\n Embedding.dragEmbed.mouseup = false;\r\n style.pointerEvents = '';\r\n return;\r\n }\r\n $.on(d, 'mouseup', Embedding.dragEmbed);\r\n Embedding.dragEmbed.mouseup = true;\r\n return style.pointerEvents = 'none';\r\n },\r\n\r\n title(data) {\r\n let service;\r\n const {key, uid, options, link, post} = data;\r\n if (!(service = Embedding.types[key].title)) { return; }\r\n $.addClass(link, key.toLowerCase());\r\n if (service.batchSize) {\r\n (service.queue || (service.queue = [])).push(data);\r\n if (service.queue.length >= service.batchSize) {\r\n return Embedding.flushTitles(service);\r\n }\r\n } else {\r\n return CrossOrigin.cache(service.api(uid), (function() { return Embedding.cb.title(this, data); }));\r\n }\r\n },\r\n\r\n flushTitles(service) {\r\n let data;\r\n const {queue} = service;\r\n if (!queue?.length) { return; }\r\n service.queue = [];\r\n const cb = function() {\r\n for (data of queue) { Embedding.cb.title(this, data); }\r\n };\r\n return CrossOrigin.cache(service.api((() => {\r\n const result = [];\r\n for (data of queue) { result.push(data.uid);\r\n }\r\n return result;\r\n })()), cb);\r\n },\r\n\r\n preview(data) {\r\n let service;\r\n const {key, uid, link} = data;\r\n if (!(service = Embedding.types[key].preview)) { return; }\r\n return $.on(link, 'mouseover', function(e) {\r\n const src = service.url(uid);\r\n const {height} = service;\r\n const el = $.el('img', {\r\n src,\r\n id: 'ihover'\r\n }\r\n );\r\n $.add(Header.hover, el);\r\n return UI.hover({\r\n root: link,\r\n el,\r\n latestEvent: e,\r\n endEvents: 'mouseout click',\r\n height\r\n });\r\n });\r\n },\r\n\r\n cb: {\r\n click(e) {\r\n e.preventDefault();\r\n if (!$.hasClass(this, 'embedded') && (Conf['Floating Embeds'] || $.hasClass(doc, 'catalog-mode'))) {\r\n let div;\r\n if (!(div = Embedding.media.firstChild)) { return; }\r\n $.replace(div, Embedding.cb.embed(this));\r\n Embedding.lastEmbed = Get.postFromNode(this).nodes.root;\r\n return $.rmClass(Embedding.dialog, 'empty');\r\n } else {\r\n return Embedding.cb.toggle.call(this);\r\n }\r\n },\r\n\r\n toggle() {\r\n if ($.hasClass(this, \"embedded\")) {\r\n $.rm(this.nextElementSibling);\r\n } else {\r\n $.after(this, Embedding.cb.embed(this));\r\n }\r\n return $.toggleClass(this, 'embedded');\r\n },\r\n\r\n embed(a) {\r\n // We create an element to embed\r\n let el, type;\r\n const container = $.el('div', {className: 'media-embed'});\r\n $.add(container, (el = (type = Embedding.types[a.dataset.key]).el(a)));\r\n\r\n // Set style values.\r\n el.style.cssText = (type.style != null) ?\r\n type.style\r\n :\r\n 'border: none; width: 640px; height: 360px;';\r\n\r\n return container;\r\n },\r\n\r\n catalogRemove() {\r\n const isCatalog = $.hasClass(doc, 'catalog-mode');\r\n if ((isCatalog && $.hasClass(this, 'embedded')) || (!isCatalog && $.hasClass(this, 'embed-removed'))) {\r\n Embedding.cb.toggle.call(this);\r\n return $.toggleClass(this, 'embed-removed');\r\n }\r\n },\r\n\r\n title(req, data) {\r\n let text;\r\n const {key, uid, options, link, post} = data;\r\n const service = Embedding.types[key].title;\r\n\r\n let {status} = req;\r\n if ([200, 304].includes(status) && service.status) {\r\n status = service.status(req.response)[0];\r\n }\r\n\r\n if (!status) { return; }\r\n\r\n text = `[${key}] ${(() => { switch (status) {\r\n case 200: case 304:\r\n text = service.text(req.response, uid);\r\n if (typeof text === 'string') {\r\n return text;\r\n } else {\r\n return text = link.textContent;\r\n }\r\n case 404:\r\n return \"Not Found\";\r\n case 403: case 401:\r\n return \"Forbidden or Private\";\r\n default:\r\n return `${status}'d`;\r\n } })()\r\n }`;\r\n\r\n link.dataset.original = link.textContent;\r\n link.textContent = text;\r\n for (var post2 of post.clones) {\r\n for (var link2 of $$('a.linkify', post2.nodes.comment)) {\r\n if (link2.href === link.href) {\r\n if (link2.dataset.original == null) { link2.dataset.original = link2.textContent; }\r\n link2.textContent = text;\r\n }\r\n }\r\n }\r\n }\r\n },\r\n\r\n ordered_types: [{\r\n key: 'audio',\r\n regExp: /^[^?#]+\\.(?:mp3|m4a|oga|wav|flac)(?:[?#]|$)/i,\r\n style: '',\r\n el(a) {\r\n return $.el('audio', {\r\n controls: true,\r\n preload: 'auto',\r\n src: a.dataset.href\r\n }\r\n );\r\n }\r\n }\r\n , {\r\n key: 'image',\r\n regExp: /^[^?#]+\\.(?:gif|png|jpg|jpeg|bmp|webp)(?::\\w+)?(?:[?#]|$)/i,\r\n style: '',\r\n el(a) {\r\n const hrefEsc = E(a.dataset.href);\r\n return $.el('div', { innerHTML: ``});\r\n }\r\n }\r\n , {\r\n key: 'video',\r\n regExp: /^[^?#]+\\.(?:og[gv]|webm|mp4)(?:[?#]|$)/i,\r\n style: 'max-width: 80vw; max-height: 80vh;',\r\n el(a) {\r\n const el = $.el('video', {\r\n hidden: true,\r\n controls: true,\r\n preload: 'auto',\r\n src: a.dataset.href,\r\n loop: ImageHost.test(a.dataset.href.split('/')[2])\r\n });\r\n $.on(el, 'loadedmetadata', function() {\r\n if ((el.videoHeight === 0) && el.parentNode) {\r\n return $.replace(el, Embedding.types.audio.el(a));\r\n } else {\r\n return el.hidden = false;\r\n }\r\n });\r\n return el;\r\n }\r\n }\r\n , {\r\n key: 'PeerTube',\r\n regExp: /^(\\w+:\\/\\/[^\\/]+\\/videos\\/watch\\/\\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12})(.*)/,\r\n el(a) {\r\n let start;\r\n const options = (start = a.dataset.options.match(/[?&](start=\\w+)/)) ? `?${start[1]}` : '';\r\n const el = $.el('iframe',\r\n {src: a.dataset.uid.replace('/videos/watch/', '/videos/embed/') + options});\r\n el.setAttribute(\"allowfullscreen\", \"true\");\r\n return el;\r\n }\r\n }\r\n , {\r\n key: 'BitChute',\r\n regExp: /^\\w+:\\/\\/(?:www\\.)?bitchute\\.com\\/video\\/([\\w\\-]+)/,\r\n el(a) {\r\n const el = $.el('iframe',\r\n {src: `https://www.bitchute.com/embed/${a.dataset.uid}/`});\r\n el.setAttribute(\"allowfullscreen\", \"true\");\r\n return el;\r\n }\r\n }\r\n , {\r\n key: 'Clyp',\r\n regExp: /^\\w+:\\/\\/(?:www\\.)?clyp\\.it\\/(\\w{8})/,\r\n style: 'border: 0; width: 640px; height: 160px;',\r\n el(a) {\r\n return $.el('iframe',\r\n {src: `https://clyp.it/${a.dataset.uid}/widget`});\r\n },\r\n title: {\r\n api(uid) { return `https://api.clyp.it/oembed?url=https://clyp.it/${uid}`; },\r\n text(_) { return _.title; }\r\n }\r\n }\r\n , {\r\n key: 'Dailymotion',\r\n regExp: /^\\w+:\\/\\/(?:(?:www\\.)?dailymotion\\.com\\/(?:embed\\/)?video|dai\\.ly)\\/([A-Za-z0-9]+)[^?]*(.*)/,\r\n el(a) {\r\n let start;\r\n const options = (start = a.dataset.options.match(/[?&](start=\\d+)/)) ? `?${start[1]}` : '';\r\n const el = $.el('iframe',\r\n {src: `//www.dailymotion.com/embed/video/${a.dataset.uid}${options}`});\r\n el.setAttribute(\"allowfullscreen\", \"true\");\r\n return el;\r\n },\r\n title: {\r\n api(uid) { return `https://api.dailymotion.com/video/${uid}`; },\r\n text(_) { return _.title; }\r\n },\r\n preview: {\r\n url(uid) { return `https://www.dailymotion.com/thumbnail/video/${uid}`; },\r\n height: 240\r\n }\r\n }\r\n , {\r\n key: 'Gfycat',\r\n regExp: /^\\w+:\\/\\/(?:www\\.)?gfycat\\.com\\/(?:iframe\\/)?(\\w+)/,\r\n el(a) {\r\n const el = $.el('iframe',\r\n {src: `//gfycat.com/ifr/${a.dataset.uid}`});\r\n el.setAttribute(\"allowfullscreen\", \"true\");\r\n return el;\r\n }\r\n }\r\n , {\r\n key: 'Gist',\r\n regExp: /^\\w+:\\/\\/gist\\.github\\.com\\/[\\w\\-]+\\/(\\w+)/,\r\n style: '',\r\n el: (function() {\r\n let counter = 0;\r\n return function(a) {\r\n const el = $.el('pre', {\r\n hidden: true,\r\n id: `gist-embed-${counter++}`\r\n }\r\n );\r\n CrossOrigin.cache(`https://api.github.com/gists/${a.dataset.uid}`, function() {\r\n el.textContent = Object.values(this.response.files)[0].content;\r\n el.className = 'prettyprint';\r\n $.global(() => window.prettyPrint?.((function() {}), document.getElementById(document.currentScript.dataset.id).parentNode)\r\n , {id: el.id});\r\n return el.hidden = false;\r\n });\r\n return el;\r\n };\r\n })(),\r\n title: {\r\n api(uid) { return `https://api.github.com/gists/${uid}`; },\r\n text({files}) {\r\n for (var file in files) { if (files.hasOwnProperty(file)) { return file; } }\r\n }\r\n }\r\n }\r\n , {\r\n key: 'InstallGentoo',\r\n regExp: /^\\w+:\\/\\/paste\\.installgentoo\\.com\\/view\\/(?:raw\\/|download\\/|embed\\/)?(\\w+)/,\r\n el(a) {\r\n return $.el('iframe',\r\n {src: `https://paste.installgentoo.com/view/embed/${a.dataset.uid}`});\r\n }\r\n }\r\n , {\r\n key: 'LiveLeak',\r\n regExp: /^\\w+:\\/\\/(?:\\w+\\.)?liveleak\\.com\\/.*\\?.*[tif]=(\\w+)/,\r\n el(a) {\r\n const el = $.el('iframe',\r\n {src: `https://www.liveleak.com/e/${a.dataset.uid}`,});\r\n el.setAttribute(\"allowfullscreen\", \"true\");\r\n return el;\r\n }\r\n }\r\n , {\r\n key: 'Loopvid',\r\n regExp: /^\\w+:\\/\\/(?:www\\.)?loopvid.appspot.com\\/#?((?:pf|kd|lv|gd|gh|db|dx|nn|cp|wu|ig|ky|mf|m2|pc|1c|pi|ni|wl|ko|mm|ic|gc)\\/[\\w\\-\\/]+(?:,[\\w\\-\\/]+)*|fc\\/\\w+\\/\\d+|https?:\\/\\/.+)/,\r\n style: 'max-width: 80vw; max-height: 80vh;',\r\n el(a) {\r\n const el = $.el('video', {\r\n controls: true,\r\n preload: 'auto',\r\n loop: true\r\n }\r\n );\r\n if (/^http/.test(a.dataset.uid)) {\r\n $.add(el, $.el('source', {src: a.dataset.uid}));\r\n return el;\r\n }\r\n const [_, host, names] = Array.from(a.dataset.uid.match(/(\\w+)\\/(.*)/));\r\n const types = (() => { switch (host) {\r\n case 'gd': case 'wu': case 'fc': return [''];\r\n case 'gc': return ['giant', 'fat', 'zippy'];\r\n default: return ['.webm', '.mp4'];\r\n } })();\r\n for (var name of names.split(',')) {\r\n for (var type of types) {\r\n var base = `${name}${type}`;\r\n var urls = (() => { switch (host) {\r\n // list from src/common.py at http://loopvid.appspot.com/source.html\r\n case 'pf': return [`https://kastden.org/_loopvid_media/pf/${base}`, `https://web.archive.org/web/2/http://a.pomf.se/${base}`];\r\n case 'kd': return [`https://kastden.org/loopvid/${base}`];\r\n case 'lv': return [`https://lv.kastden.org/${base}`];\r\n case 'gd': return [`https://docs.google.com/uc?export=download&id=${base}`];\r\n case 'gh': return [`https://googledrive.com/host/${base}`];\r\n case 'db': return [`https://dl.dropboxusercontent.com/u/${base}`];\r\n case 'dx': return [`https://dl.dropboxusercontent.com/${base}`];\r\n case 'nn': return [`https://kastden.org/_loopvid_media/nn/${base}`];\r\n case 'cp': return [`https://copy.com/${base}`];\r\n case 'wu': return [`http://webmup.com/${base}/vid.webm`];\r\n case 'ig': return [`https://i.imgur.com/${base}`];\r\n case 'ky': return [`https://kastden.org/_loopvid_media/ky/${base}`];\r\n case 'mf': return [`https://kastden.org/_loopvid_media/mf/${base}`, `https://web.archive.org/web/2/https://d.maxfile.ro/${base}`];\r\n case 'm2': return [`https://kastden.org/_loopvid_media/m2/${base}`];\r\n case 'pc': return [`https://kastden.org/_loopvid_media/pc/${base}`, `https://web.archive.org/web/2/http://a.pomf.cat/${base}`];\r\n case '1c': return [`http://b.1339.cf/${base}`];\r\n case 'pi': return [`https://kastden.org/_loopvid_media/pi/${base}`, `https://web.archive.org/web/2/https://u.pomf.is/${base}`];\r\n case 'ni': return [`https://kastden.org/_loopvid_media/ni/${base}`, `https://web.archive.org/web/2/https://u.nya.is/${base}`];\r\n case 'wl': return [`http://webm.land/media/${base}`];\r\n case 'ko': return [`https://kordy.kastden.org/loopvid/${base}`];\r\n case 'mm': return [`https://kastden.org/_loopvid_media/mm/${base}`, `https://web.archive.org/web/2/https://my.mixtape.moe/${base}`];\r\n case 'ic': return [`https://media.8ch.net/file_store/${base}`];\r\n case 'fc': return [`//${ImageHost.host()}/${base}.webm`];\r\n case 'gc': return [`https://${type}.gfycat.com/${name}.webm`];\r\n } })();\r\n\r\n for (var url of urls) {\r\n $.add(el, $.el('source', {src: url}));\r\n }\r\n }\r\n }\r\n return el;\r\n }\r\n }\r\n , {\r\n key: 'Openings.moe',\r\n regExp: /^\\w+:\\/\\/openings.moe\\/\\?video=([^.&=]+)/,\r\n style: 'width: 1280px; height: 720px; max-width: 80vw; max-height: 80vh;',\r\n el(a) {\r\n const el = $.el('iframe',\r\n {src: `https://openings.moe/?video=${a.dataset.uid}`,});\r\n el.setAttribute(\"allowfullscreen\", \"true\");\r\n return el;\r\n }\r\n }\r\n , {\r\n key: 'Pastebin',\r\n regExp: /^\\w+:\\/\\/(?:\\w+\\.)?pastebin\\.com\\/(?!u\\/)(?:[\\w.]+(?:\\/|\\?i\\=))?(\\w+)/,\r\n el(a) {\r\n let div;\r\n return div = $.el('iframe',\r\n {src: `//pastebin.com/embed_iframe.php?i=${a.dataset.uid}`});\r\n }\r\n }\r\n , {\r\n key: 'SoundCloud',\r\n regExp: /^\\w+:\\/\\/(?:www\\.)?(?:soundcloud\\.com\\/|snd\\.sc\\/)([\\w\\-\\/]+)/,\r\n style: 'border: 0; width: 500px; height: 400px;',\r\n el(a) {\r\n return $.el('iframe',\r\n {src: `https://w.soundcloud.com/player/?visual=true&show_comments=false&url=https%3A%2F%2Fsoundcloud.com%2F${encodeURIComponent(a.dataset.uid)}`});\r\n },\r\n title: {\r\n api(uid) { return `${location.protocol}//soundcloud.com/oembed?format=json&url=https%3A%2F%2Fsoundcloud.com%2F${encodeURIComponent(uid)}`; },\r\n text(_) { return _.title; }\r\n }\r\n }\r\n , {\r\n key: 'StrawPoll',\r\n regExp: /^\\w+:\\/\\/(?:www\\.)?strawpoll\\.me\\/(?:embed_\\d+\\/)?(\\d+(?:\\/r)?)/,\r\n style: 'border: 0; width: 600px; height: 406px;',\r\n el(a) {\r\n return $.el('iframe',\r\n {src: `https://www.strawpoll.me/embed_1/${a.dataset.uid}`});\r\n }\r\n }\r\n , {\r\n key: 'Streamable',\r\n regExp: /^\\w+:\\/\\/(?:www\\.)?streamable\\.com\\/(\\w+)/,\r\n el(a) {\r\n const el = $.el('iframe',\r\n {src: `https://streamable.com/o/${a.dataset.uid}`});\r\n el.setAttribute(\"allowfullscreen\", \"true\");\r\n return el;\r\n },\r\n title: {\r\n api(uid) { return `https://api.streamable.com/oembed?url=https://streamable.com/${uid}`; },\r\n text(_) { return _.title; }\r\n }\r\n }\r\n , {\r\n key: 'TwitchTV',\r\n regExp: /^\\w+:\\/\\/(?:www\\.|secure\\.|clips\\.|m\\.)?twitch\\.tv\\/(\\w[^#\\&\\?]*)/,\r\n el(a) {\r\n let url;\r\n let m = a.dataset.href.match(/^\\w+:\\/\\/(?:(clips\\.)|\\w+\\.)?twitch\\.tv\\/(?:\\w+\\/)?(clip\\/)?(\\w[^#\\&\\?]*)/);\r\n if (m[1] || m[2]) {\r\n url = `//clips.twitch.tv/embed?clip=${m[3]}&parent=${location.hostname}`;\r\n } else {\r\n let time;\r\n m = a.dataset.uid.match(/(\\w+)(?:\\/(?:v\\/)?(\\d+))?/);\r\n url = `//player.twitch.tv/?${m[2] ? `video=v${m[2]}` : `channel=${m[1]}`}&autoplay=false&parent=${location.hostname}`;\r\n if (time = a.dataset.href.match(/\\bt=(\\w+)/)) {\r\n url += `&time=${time[1]}`;\r\n }\r\n }\r\n const el = $.el('iframe',\r\n {src: url});\r\n el.setAttribute(\"allowfullscreen\", \"true\");\r\n return el;\r\n }\r\n }\r\n , {\r\n key: 'Twitter',\r\n regExp: /^\\w+:\\/\\/(?:www\\.|mobile\\.)?twitter\\.com\\/(\\w+\\/status\\/\\d+)/,\r\n style: 'border: none; width: 550px; height: 250px; overflow: hidden; resize: both;',\r\n el(a) {\r\n const el = $.el('iframe');\r\n $.on(el, 'load', function() {\r\n return this.contentWindow.postMessage({element: 't', query: 'height'}, 'https://twitframe.com');\r\n });\r\n var onMessage = function(e) {\r\n if ((e.source === el.contentWindow) && (e.origin === 'https://twitframe.com')) {\r\n $.off(window, 'message', onMessage);\r\n return (cont || el).style.height = `${+$.minmax(e.data.height, 250, 0.8 * doc.clientHeight)}px`;\r\n }\r\n };\r\n $.on(window, 'message', onMessage);\r\n el.src = `https://twitframe.com/show?url=https://twitter.com/${a.dataset.uid}`;\r\n if ($.engine === 'gecko') {\r\n // XXX https://bugzilla.mozilla.org/show_bug.cgi?id=680823\r\n el.style.cssText = 'border: none; width: 100%; height: 100%;';\r\n var cont = $.el('div');\r\n $.add(cont, el);\r\n return cont;\r\n } else {\r\n return el;\r\n }\r\n }\r\n }\r\n , {\r\n key: 'VidLii',\r\n regExp: /^\\w+:\\/\\/(?:www\\.)?vidlii\\.com\\/watch\\?v=(\\w{11})/,\r\n style: 'border: none; width: 640px; height: 392px;',\r\n el(a) {\r\n const el = $.el('iframe',\r\n {src: `https://www.vidlii.com/embed?v=${a.dataset.uid}&a=0`});\r\n el.setAttribute(\"allowfullscreen\", \"true\");\r\n return el;\r\n }\r\n }\r\n , {\r\n key: 'Vimeo',\r\n regExp: /^\\w+:\\/\\/(?:www\\.)?vimeo\\.com\\/(\\d+)/,\r\n el(a) {\r\n const el = $.el('iframe',\r\n {src: `//player.vimeo.com/video/${a.dataset.uid}?wmode=opaque`});\r\n el.setAttribute(\"allowfullscreen\", \"true\");\r\n return el;\r\n },\r\n title: {\r\n api(uid) { return `https://vimeo.com/api/oembed.json?url=https://vimeo.com/${uid}`; },\r\n text(_) { return _.title; }\r\n }\r\n }\r\n , {\r\n key: 'Vine',\r\n regExp: /^\\w+:\\/\\/(?:www\\.)?vine\\.co\\/v\\/(\\w+)/,\r\n style: 'border: none; width: 500px; height: 500px;',\r\n el(a) {\r\n return $.el('iframe',\r\n {src: `https://vine.co/v/${a.dataset.uid}/card`});\r\n }\r\n }\r\n , {\r\n key: 'Vocaroo',\r\n regExp: /^\\w+:\\/\\/(?:(?:www\\.|old\\.)?vocaroo\\.com|voca\\.ro)\\/((?:i\\/)?\\w+)/,\r\n style: '',\r\n el(a) {\r\n const el = $.el('iframe');\r\n el.width = 300;\r\n el.height = 60;\r\n el.setAttribute('frameborder', 0);\r\n el.src = `https://vocaroo.com/embed/${a.dataset.uid.replace(/^i\\//, '')}?autoplay=0`;\r\n return el;\r\n }\r\n }\r\n , {\r\n key: 'YouTube',\r\n regExp: /^\\w+:\\/\\/(?:youtu.be\\/|[\\w.]*youtube[\\w.]*\\/.*(?:v=|\\bembed\\/|\\bv\\/|live\\/))([\\w\\-]{11})(.*)/,\r\n el(a) {\r\n let start = a.dataset.options.match(/\\b(?:star)?t\\=(\\w+)/);\r\n if (start) { start = start[1]; }\r\n if (start && !/^\\d+$/.test(start)) {\r\n start += ' 0h0m0s';\r\n start = (3600 * start.match(/(\\d+)h/)[1]) + (60 * start.match(/(\\d+)m/)[1]) + (1 * start.match(/(\\d+)s/)[1]);\r\n }\r\n const el = $.el('iframe',\r\n {src: `//www.youtube.com/embed/${a.dataset.uid}?rel=0&wmode=opaque${start ? '&start=' + start : ''}`});\r\n el.setAttribute(\"allowfullscreen\", \"true\");\r\n return el;\r\n },\r\n title: {\r\n api(uid) { return `https://www.youtube.com/oembed?url=https%3A//www.youtube.com/watch%3Fv%3D${uid}&format=json`; },\r\n text(_) { return _.title; },\r\n status(_) {\r\n if (_.error) {\r\n const m = _.error.match(/^(\\d*)\\s*(.*)/);\r\n return [+m[1], m[2]];\r\n } else {\r\n return [200, 'OK'];\r\n }\r\n }\r\n },\r\n preview: {\r\n url(uid) { return `https://img.youtube.com/vi/${uid}/0.jpg`; },\r\n height: 360\r\n }\r\n }\r\n ]\r\n};\r\nexport default Embedding;\r\n","import Notice from \"../classes/Notice\";\r\nimport Config from \"../config/Config\";\r\nimport Filter from \"../Filtering/Filter\";\r\nimport ThreadHiding from \"../Filtering/ThreadHiding\";\r\nimport BoardConfig from \"../General/BoardConfig\";\r\nimport Get from \"../General/Get\";\r\nimport Header from \"../General/Header\";\r\nimport Index from \"../General/Index\";\r\nimport Settings from \"../General/Settings\";\r\nimport { Conf, d, g } from \"../globals/globals\";\r\nimport FappeTyme from \"../Images/FappeTyme\";\r\nimport Gallery from \"../Images/Gallery\";\r\nimport ImageExpand from \"../Images/ImageExpand\";\r\nimport Embedding from \"../Linkification/Embedding\";\r\nimport ThreadUpdater from \"../Monitoring/ThreadUpdater\";\r\nimport ThreadWatcher from \"../Monitoring/ThreadWatcher\";\r\nimport UnreadIndex from \"../Monitoring/UnreadIndex\";\r\nimport $ from \"../platform/$\";\r\nimport $$ from \"../platform/$$\";\r\nimport QR from \"../Posting/QR\";\r\nimport QuoteThreading from \"../Quotelinks/QuoteThreading\";\r\nimport QuoteYou from \"../Quotelinks/QuoteYou\";\r\nimport CatalogLinks from \"./CatalogLinks\";\r\nimport ExpandThread from \"./ExpandThread\";\r\nimport Nav from \"./Nav\";\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * DS205: Consider reworking code to avoid use of IIFEs\r\n * DS207: Consider shorter variations of null checks\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\nvar Keybinds = {\r\n init() {\r\n if (!Conf['Keybinds']) { return; }\r\n\r\n for (var hotkey in Config.hotkeys) {\r\n $.sync(hotkey, Keybinds.sync);\r\n }\r\n\r\n var init = function() {\r\n $.off(d, '4chanXInitFinished', init);\r\n $.on(d, 'keydown', Keybinds.keydown);\r\n for (var node of $$('[accesskey]')) {\r\n node.removeAttribute('accesskey');\r\n }\r\n };\r\n return $.on(d, '4chanXInitFinished', init);\r\n },\r\n\r\n sync(key, hotkey) {\r\n return Conf[hotkey] = key;\r\n },\r\n\r\n keydown(e) {\r\n let key, thread, threadRoot;\r\n let catalog, notifications;\r\n if (!(key = Keybinds.keyCode(e))) { return; }\r\n const {target} = e;\r\n if (['INPUT', 'TEXTAREA'].includes(target.nodeName)) {\r\n if (!/(Esc|Alt|Ctrl|Meta|Shift\\+\\w{2,})/.test(key) || !!/^Alt\\+(\\d|Up|Down|Left|Right)$/.test(key)) { return; }\r\n }\r\n if (['index', 'thread'].includes(g.VIEW)) {\r\n threadRoot = Nav.getThread();\r\n thread = Get.threadFromRoot(threadRoot);\r\n }\r\n switch (key) {\r\n // QR & Options\r\n case Conf['Toggle board list']:\r\n if (!Conf['Custom Board Navigation']) { return; }\r\n Header.toggleBoardList();\r\n break;\r\n case Conf['Toggle header']:\r\n Header.toggleBarVisibility();\r\n break;\r\n case Conf['Open empty QR']:\r\n if (!QR.postingIsEnabled) { return; }\r\n Keybinds.qr();\r\n break;\r\n case Conf['Open QR']:\r\n if (!QR.postingIsEnabled || !threadRoot) { return; }\r\n Keybinds.qr(threadRoot);\r\n break;\r\n case Conf['Open settings']:\r\n Settings.open();\r\n break;\r\n case Conf['Close']:\r\n if (Settings.dialog) {\r\n Settings.close();\r\n } else if ((notifications = $$('.notification')).length) {\r\n for (var notification of notifications) {\r\n $('.close', notification).click();\r\n }\r\n } else if (QR.nodes && !(QR.nodes.el.hidden || (window.getComputedStyle(QR.nodes.form).display === 'none'))) {\r\n if (Conf['Persistent QR']) {\r\n QR.hide();\r\n } else {\r\n QR.close();\r\n }\r\n } else if (Embedding.lastEmbed) {\r\n Embedding.closeFloat();\r\n } else {\r\n return;\r\n }\r\n break;\r\n case Conf['Spoiler tags']:\r\n if (target.nodeName !== 'TEXTAREA') { return; }\r\n Keybinds.tags('spoiler', target);\r\n break;\r\n case Conf['Code tags']:\r\n if (target.nodeName !== 'TEXTAREA') { return; }\r\n Keybinds.tags('code', target);\r\n break;\r\n case Conf['Eqn tags']:\r\n if (target.nodeName !== 'TEXTAREA') { return; }\r\n Keybinds.tags('eqn', target);\r\n break;\r\n case Conf['Math tags']:\r\n if (target.nodeName !== 'TEXTAREA') { return; }\r\n Keybinds.tags('math', target);\r\n break;\r\n case Conf['SJIS tags']:\r\n if (target.nodeName !== 'TEXTAREA') { return; }\r\n Keybinds.tags('sjis', target);\r\n break;\r\n case Conf['Toggle sage']:\r\n if (!QR.nodes || !!QR.nodes.el.hidden) { return; }\r\n Keybinds.sage();\r\n break;\r\n case Conf['Toggle Cooldown']:\r\n if (!QR.nodes || !!QR.nodes.el.hidden || !$.hasClass(QR.nodes.fileSubmit, 'custom-cooldown')) { return; }\r\n QR.toggleCustomCooldown();\r\n break;\r\n case Conf['Post from URL']:\r\n if (!QR.postingIsEnabled) { return; }\r\n QR.handleUrl('');\r\n break;\r\n case Conf['Add new post']:\r\n if (!QR.postingIsEnabled) { return; }\r\n QR.addPost();\r\n break;\r\n case Conf['Submit QR']:\r\n if (!QR.nodes || !!QR.nodes.el.hidden) { return; }\r\n if (!QR.status()) { QR.submit(); }\r\n break;\r\n // Index/Thread related\r\n case Conf['Update']:\r\n switch (g.VIEW) {\r\n case 'thread':\r\n if (!ThreadUpdater.enabled) { return; }\r\n ThreadUpdater.update();\r\n break;\r\n case 'index':\r\n if (!Index.enabled) { return; }\r\n Index.update();\r\n break;\r\n default:\r\n return;\r\n }\r\n break;\r\n case Conf['Watch']:\r\n if (!ThreadWatcher.enabled || !thread) { return; }\r\n ThreadWatcher.toggle(thread);\r\n break;\r\n case Conf['Update thread watcher']:\r\n if (!ThreadWatcher.enabled) { return; }\r\n ThreadWatcher.buttonFetchAll();\r\n break;\r\n case Conf['Toggle thread watcher']:\r\n if (!ThreadWatcher.enabled) { return; }\r\n ThreadWatcher.toggleWatcher();\r\n break;\r\n case Conf['Toggle threading']:\r\n if (!QuoteThreading.ready) { return; }\r\n QuoteThreading.toggleThreading();\r\n break;\r\n case Conf['Mark thread read']:\r\n if ((g.VIEW !== 'index') || !thread || !UnreadIndex.enabled) { return; }\r\n UnreadIndex.markRead.call(threadRoot);\r\n break;\r\n // Images\r\n case Conf['Expand image']:\r\n if (!ImageExpand.enabled || !threadRoot) { return; }\r\n var post = Get.postFromNode(Keybinds.post(threadRoot));\r\n if (post.file) { ImageExpand.toggle(post); }\r\n break;\r\n case Conf['Expand images']:\r\n if (!ImageExpand.enabled) { return; }\r\n ImageExpand.cb.toggleAll();\r\n break;\r\n case Conf['Open Gallery']:\r\n if (!Gallery.enabled) { return; }\r\n Gallery.cb.toggle();\r\n break;\r\n case Conf['fappeTyme']:\r\n if (!FappeTyme.nodes?.fappe) { return; }\r\n FappeTyme.toggle('fappe');\r\n break;\r\n case Conf['werkTyme']:\r\n if (!FappeTyme.nodes?.werk) { return; }\r\n FappeTyme.toggle('werk');\r\n break;\r\n // Board Navigation\r\n case Conf['Front page']:\r\n if (Index.enabled) {\r\n Index.userPageNav(1);\r\n } else {\r\n location.href = `/${g.BOARD}/`;\r\n }\r\n break;\r\n case Conf['Open front page']:\r\n $.open(`${location.origin}/${g.BOARD}/`);\r\n break;\r\n case Conf['Next page']:\r\n if ((g.VIEW !== 'index') || !!g.SITE.isOnePage?.(g.BOARD)) { return; }\r\n if (Index.enabled) {\r\n if (!['paged', 'infinite'].includes(Conf['Index Mode'])) { return; }\r\n $('.next button', Index.pagelist).click();\r\n } else {\r\n $(g.SITE.selectors.nav.next)?.click();\r\n }\r\n break;\r\n case Conf['Previous page']:\r\n if ((g.VIEW !== 'index') || !!g.SITE.isOnePage?.(g.BOARD)) { return; }\r\n if (Index.enabled) {\r\n if (!['paged', 'infinite'].includes(Conf['Index Mode'])) { return; }\r\n $('.prev button', Index.pagelist).click();\r\n } else {\r\n $(g.SITE.selectors.nav.prev)?.click();\r\n }\r\n break;\r\n case Conf['Search form']:\r\n if (g.VIEW !== 'index') { return; }\r\n var searchInput = Index.enabled ?\r\n Index.searchInput\r\n : g.SITE.selectors.searchBox ?\r\n $(g.SITE.selectors.searchBox)\r\n :\r\n undefined;\r\n if (!searchInput) { return; }\r\n Header.scrollToIfNeeded(searchInput);\r\n searchInput.focus();\r\n break;\r\n case Conf['Paged mode']:\r\n if (!Index.enabledOn(g.BOARD)) { return; }\r\n location.href = g.VIEW === 'index' ? '#paged' : `/${g.BOARD}/#paged`;\r\n break;\r\n case Conf['Infinite scrolling mode']:\r\n if (!Index.enabledOn(g.BOARD)) { return; }\r\n location.href = g.VIEW === 'index' ? '#infinite' : `/${g.BOARD}/#infinite`;\r\n break;\r\n case Conf['All pages mode']:\r\n if (!Index.enabledOn(g.BOARD)) { return; }\r\n location.href = g.VIEW === 'index' ? '#all-pages' : `/${g.BOARD}/#all-pages`;\r\n break;\r\n case Conf['Open catalog']:\r\n if (!(catalog = CatalogLinks.catalog())) { return; }\r\n location.href = catalog;\r\n break;\r\n case Conf['Cycle sort type']:\r\n if (!Index.enabled) { return; }\r\n Index.cycleSortType();\r\n break;\r\n // Thread Navigation\r\n case Conf['Next thread']:\r\n if ((g.VIEW !== 'index') || !threadRoot) { return; }\r\n Nav.scroll(+1);\r\n break;\r\n case Conf['Previous thread']:\r\n if ((g.VIEW !== 'index') || !threadRoot) { return; }\r\n Nav.scroll(-1);\r\n break;\r\n case Conf['Expand thread']:\r\n if ((g.VIEW !== 'index') || !threadRoot) { return; }\r\n ExpandThread.toggle(thread);\r\n // Keep thread from moving off screen when contracted.\r\n Header.scrollTo(threadRoot);\r\n break;\r\n case Conf['Open thread']:\r\n if ((g.VIEW !== 'index') || !threadRoot) { return; }\r\n Keybinds.open(thread);\r\n break;\r\n case Conf['Open thread tab']:\r\n if ((g.VIEW !== 'index') || !threadRoot) { return; }\r\n Keybinds.open(thread, true);\r\n break;\r\n // Reply Navigation\r\n case Conf['Next reply']:\r\n if (!threadRoot) { return; }\r\n Keybinds.hl(+1, threadRoot);\r\n break;\r\n case Conf['Previous reply']:\r\n if (!threadRoot) { return; }\r\n Keybinds.hl(-1, threadRoot);\r\n break;\r\n case Conf['Deselect reply']:\r\n if (!threadRoot) { return; }\r\n Keybinds.hl(0, threadRoot);\r\n break;\r\n case Conf['Hide']:\r\n if (!thread || !ThreadHiding.db) { return; }\r\n Header.scrollTo(threadRoot);\r\n ThreadHiding.toggle(thread);\r\n break;\r\n case Conf['Quick Filter MD5']:\r\n if (!threadRoot) { return; }\r\n post = Keybinds.post(threadRoot);\r\n Keybinds.hl(+1, threadRoot);\r\n Filter.quickFilterMD5.call(post, e);\r\n break;\r\n case Conf['Previous Post Quoting You']:\r\n if (!threadRoot || !QuoteYou.db) { return; }\r\n QuoteYou.cb.seek('preceding');\r\n break;\r\n case Conf['Next Post Quoting You']:\r\n if (!threadRoot || !QuoteYou.db) { return; }\r\n QuoteYou.cb.seek('following');\r\n break;\r\n default:\r\n return;\r\n }\r\n e.preventDefault();\r\n return e.stopPropagation();\r\n },\r\n\r\n keyCode(e) {\r\n let key = (() => { let kc;\r\n switch ((kc = e.keyCode)) {\r\n case 8: // return\r\n return '';\r\n case 13:\r\n return 'Enter';\r\n case 27:\r\n return 'Esc';\r\n case 32:\r\n return 'Space';\r\n case 37:\r\n return 'Left';\r\n case 38:\r\n return 'Up';\r\n case 39:\r\n return 'Right';\r\n case 40:\r\n return 'Down';\r\n case 188:\r\n return 'Comma';\r\n case 190:\r\n return 'Period';\r\n case 191:\r\n return 'Slash';\r\n case 59: case 186:\r\n return 'Semicolon';\r\n default:\r\n if ((48 <= kc && kc <= 57) || (65 <= kc && kc <= 90)) { // 0-9, A-Z\r\n return String.fromCharCode(kc).toLowerCase();\r\n } else if (96 <= kc && kc <= 105) { // numpad 0-9\r\n return String.fromCharCode(kc - 48).toLowerCase();\r\n } else {\r\n return null;\r\n }\r\n } })();\r\n if (key) {\r\n if (e.altKey) { key = 'Alt+' + key; }\r\n if (e.ctrlKey) { key = 'Ctrl+' + key; }\r\n if (e.metaKey) { key = 'Meta+' + key; }\r\n if (e.shiftKey) { key = 'Shift+' + key; }\r\n }\r\n return key;\r\n },\r\n\r\n post(thread) {\r\n const s = g.SITE.selectors;\r\n return (\r\n $(`${s.postContainer}${s.highlightable.reply}.${g.SITE.classes.highlight}`, thread) ||\r\n $(`${g.SITE.isOPContainerThread ? s.thread : s.postContainer}${s.highlightable.op}`, thread)\r\n );\r\n },\r\n\r\n qr(thread) {\r\n QR.open();\r\n if (thread != null) {\r\n QR.quote.call(Keybinds.post(thread));\r\n }\r\n return QR.nodes.com.focus();\r\n },\r\n\r\n tags(tag, ta) {\r\n BoardConfig.ready(function() {\r\n const {config} = g.BOARD;\r\n const supported = (() => { switch (tag) {\r\n case 'spoiler': return !!config.spoilers;\r\n case 'code': return !!config.code_tags;\r\n case 'math': case 'eqn': return !!config.math_tags;\r\n case 'sjis': return !!config.sjis_tags;\r\n } })();\r\n if (!supported) { return new Notice('warning', `[${tag}] tags are not supported on /${g.BOARD}/.`, 20); }\r\n });\r\n\r\n const {\r\n value\r\n } = ta;\r\n const selStart = ta.selectionStart;\r\n const selEnd = ta.selectionEnd;\r\n\r\n ta.value =\r\n value.slice(0, selStart) +\r\n `[${tag}]` + value.slice(selStart, selEnd) + `[/${tag}]` +\r\n value.slice(selEnd);\r\n\r\n // Move the caret to the end of the selection.\r\n const range = (`[${tag}]`).length + selEnd;\r\n ta.setSelectionRange(range, range);\r\n\r\n // Fire the 'input' event\r\n return $.event('input', null, ta);\r\n },\r\n\r\n sage() {\r\n const isSage = /sage/i.test(QR.nodes.email.value);\r\n return QR.nodes.email.value = isSage ?\r\n \"\"\r\n : \"sage\";\r\n },\r\n\r\n open(thread, tab) {\r\n if (g.VIEW !== 'index') { return; }\r\n const url = Get.url('thread', thread);\r\n if (tab) {\r\n return $.open(url);\r\n } else {\r\n return location.href = url;\r\n }\r\n },\r\n\r\n hl(delta, thread) {\r\n const replySelector = `${g.SITE.selectors.postContainer}${g.SITE.selectors.highlightable.reply}`;\r\n const {highlight} = g.SITE.classes;\r\n\r\n const postEl = $(`${replySelector}.${highlight}`, thread);\r\n\r\n if (!delta) {\r\n if (postEl) { $.rmClass(postEl, highlight); }\r\n return;\r\n }\r\n\r\n if (postEl) {\r\n const {height} = postEl.getBoundingClientRect();\r\n if ((Header.getTopOf(postEl) >= -height) && (Header.getBottomOf(postEl) >= -height)) { // We're at least partially visible\r\n let next;\r\n const {root} = Get.postFromNode(postEl).nodes;\r\n const axis = delta === +1 ?\r\n 'following'\r\n :\r\n 'preceding';\r\n if (!(next = $.x(`${axis}-sibling::${g.SITE.xpath.replyContainer}[not(@hidden) and not(child::div[@class='stub'])][1]`, root))) { return; }\r\n if (!next.matches(replySelector)) { next = $(replySelector, next); }\r\n Header.scrollToIfNeeded(next, delta === +1);\r\n $.addClass(next, highlight);\r\n $.rmClass(postEl, highlight);\r\n return;\r\n }\r\n $.rmClass(postEl, highlight);\r\n }\r\n\r\n const replies = $$(replySelector, thread);\r\n if (delta === -1) { replies.reverse(); }\r\n for (var reply of replies) {\r\n if (((delta === +1) && (Header.getTopOf(reply) > 0)) || ((delta === -1) && (Header.getBottomOf(reply) > 0))) {\r\n $.addClass(reply, highlight);\r\n return;\r\n }\r\n }\r\n }\r\n};\r\nexport default Keybinds;\r\n","import $ from \"../platform/$\";\r\nimport CaptchaReplace from \"./Captcha.replace\";\r\nimport CaptchaT from \"./Captcha.t\";\r\nimport meta from '../../package.json';\r\nimport Main from \"../main/Main\";\r\nimport Keybinds from \"../Miscellaneous/Keybinds\";\r\nimport $$ from \"../platform/$$\";\r\nimport QR from \"./QR\";\r\nimport { Conf, d } from \"../globals/globals\";\r\nimport { MINUTE, SECOND } from \"../platform/helpers\";\r\n\r\nconst Captcha = {\r\n Cache: {\r\n init() {\r\n $.on(d, 'SaveCaptcha', e => {\r\n return this.saveAPI(e.detail);\r\n });\r\n return $.on(d, 'NoCaptcha', e => {\r\n return this.noCaptcha(e.detail);\r\n });\r\n },\r\n\r\n captchas: [],\r\n\r\n getCount() {\r\n return this.captchas.length;\r\n },\r\n\r\n neededRaw() {\r\n return !(\r\n this.haveCookie() || this.captchas.length || QR.req || this.submitCB\r\n ) && (\r\n (QR.posts.length > 1) || Conf['Auto-load captcha'] || !QR.posts[0].isOnlyQuotes() || QR.posts[0].file\r\n );\r\n },\r\n\r\n needed() {\r\n return this.neededRaw() && $.event('LoadCaptcha');\r\n },\r\n\r\n prerequest() {\r\n if (!Conf['Prerequest Captcha']) { return; }\r\n // Post count temporarily off by 1 when called from QR.post.rm, QR.close, or QR.submit\r\n return $.queueTask(() => {\r\n if (\r\n !this.prerequested &&\r\n this.neededRaw() &&\r\n !$.event('LoadCaptcha') &&\r\n !QR.captcha.occupied() &&\r\n (QR.cooldown.seconds <= 60) &&\r\n (QR.selected === QR.posts[QR.posts.length - 1]) &&\r\n !QR.selected.isOnlyQuotes()\r\n ) {\r\n const isReply = (QR.selected.thread !== 'new');\r\n if (!$.event('RequestCaptcha', { isReply })) {\r\n this.prerequested = true;\r\n this.submitCB = captcha => {\r\n if (captcha) { return this.save(captcha); }\r\n };\r\n return this.updateCount();\r\n }\r\n }\r\n });\r\n },\r\n\r\n haveCookie() {\r\n return /\\b_ct=/.test(d.cookie) && (QR.posts[0].thread !== 'new');\r\n },\r\n\r\n getOne() {\r\n let captcha;\r\n delete this.prerequested;\r\n this.clear();\r\n if (captcha = this.captchas.shift()) {\r\n this.count();\r\n return captcha;\r\n } else {\r\n return null;\r\n }\r\n },\r\n\r\n request(isReply) {\r\n if (!this.submitCB) {\r\n if ($.event('RequestCaptcha', { isReply })) { return; }\r\n }\r\n return cb => {\r\n this.submitCB = cb;\r\n return this.updateCount();\r\n };\r\n },\r\n\r\n abort() {\r\n if (this.submitCB) {\r\n delete this.submitCB;\r\n $.event('AbortCaptcha');\r\n return this.updateCount();\r\n }\r\n },\r\n\r\n saveAPI(captcha) {\r\n let cb;\r\n if (cb = this.submitCB) {\r\n delete this.submitCB;\r\n cb(captcha);\r\n return this.updateCount();\r\n } else {\r\n return this.save(captcha);\r\n }\r\n },\r\n\r\n noCaptcha(detail) {\r\n let cb;\r\n if (cb = this.submitCB) {\r\n if (!this.haveCookie() || detail?.error) {\r\n QR.error(detail?.error || 'Failed to retrieve captcha.');\r\n QR.captcha.setup(d.activeElement === QR.nodes.status);\r\n }\r\n delete this.submitCB;\r\n cb();\r\n return this.updateCount();\r\n }\r\n },\r\n\r\n save(captcha) {\r\n let cb;\r\n if (cb = this.submitCB) {\r\n this.abort();\r\n cb(captcha);\r\n return;\r\n }\r\n this.captchas.push(captcha);\r\n this.captchas.sort((a, b) => a.timeout - b.timeout);\r\n return this.count();\r\n },\r\n\r\n clear() {\r\n if (this.captchas.length) {\r\n let i;\r\n const now = Date.now();\r\n for (i = 0; i < this.captchas.length; i++) {\r\n var captcha = this.captchas[i];\r\n if (captcha.timeout > now) { break; }\r\n }\r\n if (i) {\r\n this.captchas = this.captchas.slice(i);\r\n return this.count();\r\n }\r\n }\r\n },\r\n\r\n count() {\r\n clearTimeout(this.timer);\r\n if (this.captchas.length) {\r\n this.timer = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now());\r\n }\r\n return this.updateCount();\r\n },\r\n\r\n updateCount() {\r\n return $.event('CaptchaCount', this.captchas.length);\r\n }\r\n }, Replace: CaptchaReplace, t: CaptchaT, v2: {\r\n lifetime: 2 * MINUTE,\r\n\r\n init() {\r\n if (d.cookie.indexOf('pass_enabled=1') >= 0) { return; }\r\n if (!(this.isEnabled = !!$('#g-recaptcha, #captcha-forced-noscript') || !$.id('postForm'))) { return; }\r\n\r\n if (this.noscript = Conf['Force Noscript Captcha'] || !Main.jsEnabled) {\r\n $.addClass(QR.nodes.el, 'noscript-captcha');\r\n }\r\n\r\n Captcha.cache.init();\r\n $.on(d, 'CaptchaCount', this.count.bind(this));\r\n\r\n const root = $.el('div', { className: 'captcha-root' });\r\n $.extend(root, {\r\n innerHTML:\r\n '
            '\r\n }\r\n );\r\n const counter = $('.captcha-counter > a', root);\r\n this.nodes = { root, counter };\r\n this.count();\r\n $.addClass(QR.nodes.el, 'has-captcha', 'captcha-v2');\r\n $.after(QR.nodes.com.parentNode, root);\r\n\r\n $.on(counter, 'click', this.toggle.bind(this));\r\n $.on(counter, 'keydown', e => {\r\n if (Keybinds.keyCode(e) !== 'Space') { return; }\r\n this.toggle();\r\n e.preventDefault();\r\n return e.stopPropagation();\r\n });\r\n return $.on(window, 'captcha:success', () => {\r\n // XXX Greasemonkey 1.x workaround to gain access to GM_* functions.\r\n return $.queueTask(() => this.save(false));\r\n });\r\n },\r\n\r\n timeouts: {},\r\n prevNeeded: 0,\r\n\r\n noscriptURL() {\r\n let lang;\r\n let url = `https://www.google.com/recaptcha/api/fallback?k=${meta.recaptchaKey}`;\r\n if (lang = Conf['captchaLanguage'].trim()) {\r\n url += `&hl=${encodeURIComponent(lang)}`;\r\n }\r\n return url;\r\n },\r\n\r\n moreNeeded() {\r\n // Post count temporarily off by 1 when called from QR.post.rm, QR.close, or QR.submit\r\n return $.queueTask(() => {\r\n const needed = Captcha.cache.needed();\r\n if (needed && !this.prevNeeded) {\r\n this.setup(QR.cooldown.auto && (d.activeElement === QR.nodes.status));\r\n }\r\n return this.prevNeeded = needed;\r\n });\r\n },\r\n\r\n toggle() {\r\n if (this.nodes.container && !this.timeouts.destroy) {\r\n return this.destroy();\r\n } else {\r\n return this.setup(true, true);\r\n }\r\n },\r\n\r\n setup(focus, force) {\r\n if (!this.isEnabled || (!Captcha.cache.needed() && !force)) { return; }\r\n\r\n if (focus) {\r\n $.addClass(QR.nodes.el, 'focus');\r\n this.nodes.counter.focus();\r\n }\r\n\r\n if (this.timeouts.destroy) {\r\n clearTimeout(this.timeouts.destroy);\r\n delete this.timeouts.destroy;\r\n return this.reload();\r\n }\r\n\r\n if (this.nodes.container) {\r\n // XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1226835\r\n $.queueTask(() => {\r\n let iframe;\r\n if (this.nodes.container && (d.activeElement === this.nodes.counter) && (iframe = $('iframe[src^=\"https://www.google.com/recaptcha/\"]', this.nodes.container))) {\r\n iframe.focus();\r\n return QR.focus();\r\n }\r\n }); // Event handler not fired in Firefox\r\n return;\r\n }\r\n\r\n this.nodes.container = $.el('div', { className: 'captcha-container' });\r\n $.prepend(this.nodes.root, this.nodes.container);\r\n new MutationObserver(this.afterSetup.bind(this)).observe(this.nodes.container, {\r\n childList: true,\r\n subtree: true\r\n }\r\n );\r\n\r\n if (this.noscript) {\r\n return this.setupNoscript();\r\n } else {\r\n return this.setupJS();\r\n }\r\n },\r\n\r\n setupNoscript() {\r\n const iframe = $.el('iframe', {\r\n id: 'qr-captcha-iframe',\r\n scrolling: 'no',\r\n src: this.noscriptURL()\r\n }\r\n );\r\n const div = $.el('div');\r\n const textarea = $.el('textarea');\r\n $.add(div, textarea);\r\n return $.add(this.nodes.container, [iframe, div]);\r\n },\r\n\r\n setupJS() {\r\n return $.global(function () {\r\n const render = function () {\r\n const { classList } = document.documentElement;\r\n const container = document.querySelector('#qr .captcha-container');\r\n return container.dataset.widgetID = window.grecaptcha.render(container, {\r\n sitekey: meta.recaptchaKey,\r\n theme: classList.contains('tomorrow') || classList.contains('spooky') || classList.contains('dark-captcha') ? 'dark' : 'light',\r\n callback(response) {\r\n return window.dispatchEvent(new CustomEvent('captcha:success', { detail: response }));\r\n }\r\n }\r\n );\r\n };\r\n if (window.grecaptcha) {\r\n return render();\r\n } else {\r\n const cbNative = window.onRecaptchaLoaded;\r\n window.onRecaptchaLoaded = function () {\r\n render();\r\n return cbNative();\r\n };\r\n if (!document.head.querySelector('script[src^=\"https://www.google.com/recaptcha/api.js\"]')) {\r\n const script = document.createElement('script');\r\n script.src = 'https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoaded&render=explicit';\r\n return document.head.appendChild(script);\r\n }\r\n }\r\n });\r\n },\r\n\r\n afterSetup(mutations) {\r\n for (var mutation of mutations) {\r\n for (var node of mutation.addedNodes) {\r\n var iframe, textarea;\r\n if (iframe = $.x('./descendant-or-self::iframe[starts-with(@src, \"https://www.google.com/recaptcha/\")]', node)) { this.setupIFrame(iframe); }\r\n if (textarea = $.x('./descendant-or-self::textarea', node)) { this.setupTextArea(textarea); }\r\n }\r\n }\r\n },\r\n\r\n setupIFrame(iframe) {\r\n let needle;\r\n if (!doc.contains(iframe)) { return; }\r\n Captcha.replace.iframe(iframe);\r\n $.addClass(QR.nodes.el, 'captcha-open');\r\n this.fixQRPosition();\r\n $.on(iframe, 'load', this.fixQRPosition);\r\n if (d.activeElement === this.nodes.counter) { iframe.focus(); }\r\n // XXX Make sure scroll on space prevention (see src/css/style.css) doesn't cause scrolling of div\r\n if (['blink', 'edge'].includes($.engine) && (needle = iframe.parentNode, $$('#qr .captcha-container > div > div:first-of-type').includes(needle))) {\r\n return $.on(iframe.parentNode, 'scroll', function () { return this.scrollTop = 0; });\r\n }\r\n },\r\n\r\n fixQRPosition() {\r\n if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) {\r\n QR.nodes.el.style.top = '';\r\n return QR.nodes.el.style.bottom = '0px';\r\n }\r\n },\r\n\r\n setupTextArea(textarea) {\r\n return $.one(textarea, 'input', () => this.save(true));\r\n },\r\n\r\n destroy() {\r\n if (!this.isEnabled) { return; }\r\n delete this.timeouts.destroy;\r\n $.rmClass(QR.nodes.el, 'captcha-open');\r\n if (this.nodes.container) {\r\n $.global(function () {\r\n const container = document.querySelector('#qr .captcha-container');\r\n return window.grecaptcha.reset(container.dataset.widgetID);\r\n });\r\n $.rm(this.nodes.container);\r\n return delete this.nodes.container;\r\n }\r\n },\r\n\r\n getOne(isReply) {\r\n return Captcha.cache.getOne(isReply);\r\n },\r\n\r\n save(pasted, token) {\r\n Captcha.cache.save({\r\n response: token || $('textarea', this.nodes.container).value,\r\n timeout: Date.now() + this.lifetime\r\n });\r\n\r\n const focus = (d.activeElement?.nodeName === 'IFRAME') && /https?:\\/\\/www\\.google\\.com\\/recaptcha\\//.test(d.activeElement.src);\r\n if (Captcha.cache.needed()) {\r\n if (focus) {\r\n if (QR.cooldown.auto || Conf['Post on Captcha Completion']) {\r\n this.nodes.counter.focus();\r\n } else {\r\n QR.nodes.status.focus();\r\n }\r\n }\r\n this.reload();\r\n } else {\r\n if (pasted) {\r\n this.destroy();\r\n } else {\r\n if (this.timeouts.destroy == null) { this.timeouts.destroy = setTimeout(this.destroy.bind(this), 3 * SECOND); }\r\n }\r\n if (focus) { QR.nodes.status.focus(); }\r\n }\r\n\r\n if (Conf['Post on Captcha Completion'] && !QR.cooldown.auto) { return QR.submit(); }\r\n },\r\n\r\n count() {\r\n const count = Captcha.cache.getCount();\r\n const loading = Captcha.cache.submitCB ? '...' : '';\r\n this.nodes.counter.textContent = `Captchas: ${count}${loading}`;\r\n return this.moreNeeded();\r\n },\r\n\r\n reload() {\r\n if ($('iframe[src^=\"https://www.google.com/recaptcha/api/fallback?\"]', this.nodes.container)) {\r\n this.destroy();\r\n return this.setup(false, true);\r\n } else {\r\n return $.global(function () {\r\n const container = document.querySelector('#qr .captcha-container');\r\n return window.grecaptcha.reset(container.dataset.widgetID);\r\n });\r\n }\r\n },\r\n\r\n occupied() {\r\n return !!this.nodes.container && !this.timeouts.destroy;\r\n }\r\n }\r\n};\r\nexport default Captcha;\r\n","import QuickReplyPage from './QR/QuickReply.html';\r\nimport $ from '../platform/$';\r\nimport Callbacks from '../classes/Callbacks';\r\nimport Notice from '../classes/Notice';\r\nimport Main from '../main/Main';\r\nimport Favicon from '../Monitoring/Favicon';\r\nimport $$ from '../platform/$$';\r\nimport CrossOrigin from '../platform/CrossOrigin';\r\nimport Captcha from './Captcha';\r\nimport meta from '../../package.json';\r\nimport Header from '../General/Header';\r\nimport { Conf, E, d, doc, g } from '../globals/globals';\r\nimport Menu from '../Menu/Menu';\r\nimport UI from '../General/UI';\r\nimport BoardConfig from '../General/BoardConfig';\r\nimport Get from '../General/Get';\r\nimport { DAY, dict, SECOND } from '../platform/helpers';\r\n\r\n/*\r\n * decaffeinate suggestions:\r\n * DS101: Remove unnecessary use of Array.from\r\n * DS102: Remove unnecessary code created because of implicit returns\r\n * DS202: Simplify dynamic range loops\r\n * DS207: Consider shorter variations of null checks\r\n * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md\r\n */\r\n\r\nvar QR = {\r\n mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/vnd.adobe.flash.movie', 'application/x-shockwave-flash', 'video/webm'],\r\n\r\n validExtension: /\\.(jpe?g|png|gif|pdf|swf|webm)$/i,\r\n\r\n typeFromExtension: {\r\n 'jpg': 'image/jpeg',\r\n 'jpeg': 'image/jpeg',\r\n 'png': 'image/png',\r\n 'gif': 'image/gif',\r\n 'pdf': 'application/pdf',\r\n 'swf': 'application/vnd.adobe.flash.movie',\r\n 'webm': 'video/webm'\r\n },\r\n\r\n extensionFromType: {\r\n 'image/jpeg': 'jpg',\r\n 'image/png': 'png',\r\n 'image/gif': 'gif',\r\n 'application/pdf': 'pdf',\r\n 'application/vnd.adobe.flash.movie': 'swf',\r\n 'application/x-shockwave-flash': 'swf',\r\n 'video/webm': 'webm'\r\n },\r\n\r\n init() {\r\n let sc;\r\n if (!Conf['Quick Reply']) { return; }\r\n\r\n this.posts = [];\r\n\r\n $.on(d, '4chanXInitFinished', () => BoardConfig.ready(QR.initReady));\r\n\r\n Callbacks.Post.push({\r\n name: 'Quick Reply',\r\n cb: this.node\r\n });\r\n\r\n this.shortcut = (sc = $.el('a', {\r\n className: 'disabled',\r\n textContent: '↩',\r\n title: 'Quick Reply',\r\n href: 'javascript:;'\r\n }\r\n ));\r\n $.on(sc, 'click', function() {\r\n if (!QR.postingIsEnabled) { return; }\r\n if (Conf['Persistent QR'] || !QR.nodes || QR.nodes.el.hidden) {\r\n QR.open();\r\n return QR.nodes.com.focus();\r\n } else {\r\n return QR.close();\r\n }\r\n });\r\n\r\n return Header.addShortcut('qr', sc, 540);\r\n },\r\n\r\n initReady() {\r\n let origToggle;\r\n const captchaVersion = $('#g-recaptcha, #captcha-forced-noscript') ? 'v2' : 't';\r\n QR.captcha = Captcha[captchaVersion];\r\n QR.postingIsEnabled = true;\r\n\r\n const {config} = g.BOARD;\r\n const prop = (key, def) => +(config[key] ?? def);\r\n\r\n QR.min_width = prop('min_image_width', 1);\r\n QR.min_height = prop('min_image_height', 1);\r\n QR.max_width = (QR.max_height = 10000);\r\n\r\n QR.max_size = prop('max_filesize', 4194304);\r\n QR.max_size_video = prop('max_webm_filesize', QR.max_size);\r\n QR.max_comment = prop('max_comment_chars', 2000);\r\n\r\n QR.max_width_video = (QR.max_height_video = 2048);\r\n QR.max_duration_video = prop('max_webm_duration', 120);\r\n\r\n QR.forcedAnon = !!config.forced_anon;\r\n QR.spoiler = !!config.spoilers;\r\n\r\n if (origToggle = $.id('togglePostFormLink')) {\r\n const link = $.el('h1',\r\n {className: \"qr-link-container\"});\r\n $.extend(link, {\r\n innerHTML:\r\n `${g.VIEW === \"thread\" ? \"Reply to Thread\" : \"Start a Thread\"}`\r\n });\r\n\r\n QR.link = link.firstElementChild;\r\n $.on(link.firstChild, 'click', function() {\r\n QR.open();\r\n return QR.nodes.com.focus();\r\n });\r\n\r\n $.before(origToggle, link);\r\n origToggle.firstElementChild.textContent = 'Original Form';\r\n }\r\n\r\n if (g.VIEW === 'thread') {\r\n let navLinksBot;\r\n const linkBot = $.el('div',\r\n {className: \"brackets-wrap qr-link-container-bottom\"});\r\n $.extend(linkBot, {innerHTML: 'Reply to Thread'});\r\n\r\n $.on(linkBot.firstElementChild, 'click', function() {\r\n QR.open();\r\n return QR.nodes.com.focus();\r\n });\r\n\r\n if (navLinksBot = $('.navLinksBot')) { $.prepend(navLinksBot, linkBot); }\r\n }\r\n\r\n $.on(d, 'QRGetFile', QR.getFile);\r\n $.on(d, 'QRDrawFile', QR.drawFile);\r\n $.on(d, 'QRSetFile', QR.setFile);\r\n\r\n $.on(d, 'paste', QR.paste);\r\n $.on(d, 'dragover', QR.dragOver);\r\n $.on(d, 'drop', QR.dropFile);\r\n $.on(d, 'dragstart dragend', QR.drag);\r\n\r\n $.on(d, 'IndexRefreshInternal', QR.generatePostableThreadsList);\r\n $.on(d, 'ThreadUpdate', QR.statusCheck);\r\n\r\n if (!Conf['Persistent QR']) { return; }\r\n QR.open();\r\n if (Conf['Auto Hide QR']) { return QR.hide(); }\r\n },\r\n\r\n statusCheck() {\r\n if (!QR.nodes) { return; }\r\n const {thread} = QR.posts[0];\r\n if ((thread !== 'new') && g.threads.get(`${g.BOARD}.${thread}`).isDead) {\r\n return QR.abort();\r\n } else {\r\n return QR.status();\r\n }\r\n },\r\n\r\n node() {\r\n $.on(this.nodes.quote, 'click', QR.quote);\r\n if (this.isFetchedQuote) { return QR.generatePostableThreadsList(); }\r\n },\r\n\r\n open() {\r\n if (QR.nodes) {\r\n if (QR.nodes.el.hidden) { QR.captcha.setup(); }\r\n QR.nodes.el.hidden = false;\r\n QR.unhide();\r\n } else {\r\n try {\r\n QR.dialog();\r\n } catch (err) {\r\n delete QR.nodes;\r\n Main.handleErrors({\r\n message: 'Quick Reply dialog creation crashed.',\r\n error: err\r\n });\r\n return;\r\n }\r\n }\r\n return $.rmClass(QR.shortcut, 'disabled');\r\n },\r\n\r\n close() {\r\n if (QR.req) {\r\n QR.abort();\r\n return;\r\n }\r\n QR.nodes.el.hidden = true;\r\n QR.cleanNotifications();\r\n QR.blur();\r\n $.rmClass(QR.nodes.el, 'dump');\r\n $.addClass(QR.shortcut, 'disabled');\r\n new QR.post(true);\r\n for (var post of QR.posts.splice(0, QR.posts.length - 1)) {\r\n post.delete();\r\n }\r\n QR.cooldown.auto = false;\r\n QR.status();\r\n return QR.captcha.destroy();\r\n },\r\n\r\n focus() {\r\n return $.queueTask(function() {\r\n if (!QR.inBubble()) {\r\n QR.hasFocus = d.activeElement && QR.nodes.el.contains(d.activeElement);\r\n return QR.nodes.el.classList.toggle('focus', QR.hasFocus);\r\n }\r\n });\r\n },\r\n\r\n inBubble() {\r\n const bubbles = $$('iframe[src^=\"https://www.google.com/recaptcha/api2/frame\"]');\r\n return bubbles.includes(d.activeElement) || bubbles.some(el => (getComputedStyle(el).visibility !== 'hidden') && (el.getBoundingClientRect().bottom > 0));\r\n },\r\n\r\n hide() {\r\n QR.blur();\r\n $.addClass(QR.nodes.el, 'autohide');\r\n return QR.nodes.autohide.checked = true;\r\n },\r\n\r\n unhide() {\r\n $.rmClass(QR.nodes.el, 'autohide');\r\n return QR.nodes.autohide.checked = false;\r\n },\r\n\r\n toggleHide() {\r\n if (this.checked) {\r\n return QR.hide();\r\n } else {\r\n return QR.unhide();\r\n }\r\n },\r\n\r\n blur() {\r\n if (QR.nodes.el.contains(d.activeElement)) { return d.activeElement.blur(); }\r\n },\r\n\r\n toggleSJIS(e) {\r\n e.preventDefault();\r\n Conf['sjisPreview'] = !Conf['sjisPreview'];\r\n $.set('sjisPreview', Conf['sjisPreview']);\r\n return QR.nodes.el.classList.toggle('sjis-preview', Conf['sjisPreview']);\r\n },\r\n\r\n texPreviewShow() {\r\n if ($.hasClass(QR.nodes.el, 'tex-preview')) { return QR.texPreviewHide(); }\r\n $.addClass(QR.nodes.el, 'tex-preview');\r\n QR.nodes.texPreview.textContent = QR.nodes.com.value;\r\n return $.event('mathjax', null, QR.nodes.texPreview);\r\n },\r\n\r\n texPreviewHide() {\r\n return $.rmClass(QR.nodes.el, 'tex-preview');\r\n },\r\n\r\n addPost() {\r\n const wasOpen = (QR.nodes && !QR.nodes.el.hidden);\r\n QR.open();\r\n if (wasOpen) {\r\n $.addClass(QR.nodes.el, 'dump');\r\n new QR.post(true);\r\n }\r\n return QR.nodes.com.focus();\r\n },\r\n\r\n setCustomCooldown(enabled) {\r\n Conf['customCooldownEnabled'] = enabled;\r\n QR.cooldown.customCooldown = enabled;\r\n return QR.nodes.customCooldown.classList.toggle('disabled', !enabled);\r\n },\r\n\r\n toggleCustomCooldown() {\r\n const enabled = $.hasClass(QR.nodes.customCooldown, 'disabled');\r\n QR.setCustomCooldown(enabled);\r\n return $.set('customCooldownEnabled', enabled);\r\n },\r\n\r\n error(err, focusOverride) {\r\n let el;\r\n QR.open();\r\n if (typeof err === 'string') {\r\n el = $.tn(err);\r\n } else {\r\n el = err;\r\n el.removeAttribute('style');\r\n }\r\n const notice = new Notice('warning', el);\r\n QR.notifications.push(notice);\r\n if (!Header.areNotificationsEnabled) {\r\n if (d.hidden && !QR.cooldown.auto) { return alert(el.textContent); }\r\n } else if (d.hidden || !(focusOverride || d.hasFocus())) {\r\n const notif = new Notification(el.textContent, {\r\n body: el.textContent,\r\n icon: Favicon.logo\r\n }\r\n );\r\n notif.onclick = () => window.focus();\r\n if ($.engine !== 'gecko') {\r\n // Firefox automatically closes notifications\r\n // so we can't control the onclose properly.\r\n notif.onclose = () => notice.close();\r\n return notif.onshow = () => setTimeout(function() {\r\n notif.onclose = null;\r\n return notif.close();\r\n }\r\n , 7 * SECOND);\r\n }\r\n }\r\n },\r\n\r\n connectionError() {\r\n return $.el('span',\r\n { innerHTML:\r\n 'Connection error while posting. ' +\r\n '[More info]'\r\n }\r\n );\r\n },\r\n\r\n notifications: [],\r\n\r\n cleanNotifications() {\r\n for (var notification of QR.notifications) {\r\n notification.close();\r\n }\r\n return QR.notifications = [];\r\n },\r\n\r\n status() {\r\n let disabled, value;\r\n if (!QR.nodes) { return; }\r\n const {thread} = QR.posts[0];\r\n if ((thread !== 'new') && g.threads.get(`${g.BOARD}.${thread}`).isDead) {\r\n value = 'Dead';\r\n disabled = true;\r\n QR.cooldown.auto = false;\r\n }\r\n\r\n value = QR.req ?\r\n QR.req.progress\r\n :\r\n QR.cooldown.seconds || value;\r\n\r\n const {status} = QR.nodes;\r\n status.value = !value ?\r\n 'Submit'\r\n : QR.cooldown.auto ?\r\n `Auto ${value}`\r\n :\r\n value;\r\n return status.disabled = disabled || false;\r\n },\r\n\r\n openPost() {\r\n QR.open();\r\n if (QR.selected.isLocked) {\r\n const index = QR.posts.indexOf(QR.selected);\r\n (QR.posts[index+1] || new QR.post()).select();\r\n $.addClass(QR.nodes.el, 'dump');\r\n return QR.cooldown.auto = true;\r\n }\r\n },\r\n\r\n quote(e) {\r\n let range;\r\n e?.preventDefault();\r\n if (!QR.postingIsEnabled) { return; }\r\n const sel = d.getSelection();\r\n const post = Get.postFromNode(this);\r\n const {root} = post.nodes;\r\n const postRange = new Range();\r\n postRange.selectNode(root);\r\n let text = post.board.ID === g.BOARD.ID ? `>>${post}\\n` : `>>>/${post.board}/${post}\\n`;\r\n for (let i = 0, end = sel.rangeCount, asc = 0 <= end; asc ? i < end : i > end; asc ? i++ : i--) {\r\n try {\r\n var insideCode, node;\r\n range = sel.getRangeAt(i);\r\n // Trim range to be fully inside post\r\n if (range.compareBoundaryPoints(Range.START_TO_START, postRange) < 0) {\r\n range.setStartBefore(root);\r\n }\r\n if (range.compareBoundaryPoints(Range.END_TO_END, postRange) > 0) {\r\n range.setEndAfter(root);\r\n }\r\n\r\n if (!range.toString().trim()) { continue; }\r\n\r\n var frag = range.cloneContents();\r\n var ancestor = range.commonAncestorContainer;\r\n // Quoting the insides of a spoiler/code tag.\r\n if ($.x('ancestor-or-self::*[self::s or contains(@class,\"removed-spoiler\")]', ancestor)) {\r\n $.prepend(frag, $.tn('[spoiler]'));\r\n $.add(frag, $.tn('[/spoiler]'));\r\n }\r\n if (insideCode = $.x('ancestor-or-self::pre[contains(@class,\"prettyprint\")]', ancestor)) {\r\n $.prepend(frag, $.tn('[code]'));\r\n $.add(frag, $.tn('[/code]'));\r\n }\r\n for (node of $$((insideCode ? 'br' : '.prettyprint br'), frag)) {\r\n $.replace(node, $.tn('\\n'));\r\n }\r\n for (node of $$('br', frag)) {\r\n if (node !== frag.lastChild) { $.replace(node, $.tn('\\n>')); }\r\n }\r\n g.SITE.insertTags?.(frag);\r\n for (node of $$('.linkify[data-original]', frag)) {\r\n $.replace(node, $.tn(node.dataset.original));\r\n }\r\n for (node of $$('.embedder', frag)) {\r\n if (node.previousSibling?.nodeValue === ' ') { $.rm(node.previousSibling); }\r\n $.rm(node);\r\n }\r\n text += `>${frag.textContent.trim()}\\n`;\r\n } catch (error) { }\r\n }\r\n\r\n QR.openPost();\r\n const {com, thread} = QR.nodes;\r\n if (!com.value) { thread.value = Get.threadFromNode(this); }\r\n\r\n const wasOnlyQuotes = QR.selected.isOnlyQuotes();\r\n\r\n const caretPos = com.selectionStart;\r\n // Replace selection for text.\r\n com.value = com.value.slice(0, caretPos) + text + com.value.slice(com.selectionEnd);\r\n // Move the caret to the end of the new quote.\r\n range = caretPos + text.length;\r\n com.setSelectionRange(range, range);\r\n com.focus();\r\n\r\n // This allows us to determine if any text other than quotes has been typed.\r\n if (wasOnlyQuotes) { QR.selected.quotedText = com.value; }\r\n\r\n QR.selected.save(com);\r\n return QR.selected.save(thread);\r\n },\r\n\r\n characterCount() {\r\n const counter = QR.nodes.charCount;\r\n const count = QR.nodes.com.value.replace(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g, '_').length;\r\n counter.textContent = count;\r\n counter.hidden = count < (QR.max_comment/2);\r\n return (count > QR.max_comment ? $.addClass : $.rmClass)(counter, 'warning');\r\n },\r\n\r\n getFile() {\r\n return $.event('QRFile', QR.selected?.file);\r\n },\r\n\r\n drawFile(e) {\r\n const file = QR.selected?.file;\r\n if (!file || !/^(image|video)\\//.test(file.type)) { return; }\r\n const isVideo = /^video\\//.test(file);\r\n const el = $.el((isVideo ? 'video' : 'img'));\r\n $.on(el, 'error', () => QR.openError());\r\n $.on(el, (isVideo ? 'loadeddata' : 'load'), function() {\r\n e.target.getContext('2d').drawImage(el, 0, 0);\r\n URL.revokeObjectURL(el.src);\r\n return $.event('QRImageDrawn', null, e.target);\r\n });\r\n return el.src = URL.createObjectURL(file);\r\n },\r\n\r\n openError() {\r\n const div = $.el('div');\r\n $.extend(div, {\r\n innerHTML:\r\n 'Could not open file. [More info]'\r\n });\r\n return QR.error(div);\r\n },\r\n\r\n setFile(e) {\r\n const {file, name, source} = e.detail;\r\n if (name != null) { file.name = name; }\r\n if (source != null) { file.source = source; }\r\n QR.open();\r\n return QR.handleFiles([file]);\r\n },\r\n\r\n drag(e) {\r\n // Let it drag anything from the page.\r\n const toggle = e.type === 'dragstart' ? $.off : $.on;\r\n toggle(d, 'dragover', QR.dragOver);\r\n return toggle(d, 'drop', QR.dropFile);\r\n },\r\n\r\n dragOver(e) {\r\n e.preventDefault();\r\n return e.dataTransfer.dropEffect = 'copy';\r\n }, // cursor feedback\r\n\r\n dropFile(e) {\r\n // Let it only handle files from the desktop.\r\n if (!e.dataTransfer.files.length) { return; }\r\n e.preventDefault();\r\n QR.open();\r\n return QR.handleFiles(e.dataTransfer.files);\r\n },\r\n\r\n paste(e) {\r\n if (!e.clipboardData.items) { return; }\r\n let file = null;\r\n let score = -1;\r\n for (var item of e.clipboardData.items) {\r\n var file2;\r\n if ((item.kind === 'file') && (file2 = item.getAsFile())) {\r\n var score2 = (2*(file2.size <= QR.max_size)) + (file2.type === 'image/png');\r\n if (score2 > score) {\r\n file = file2;\r\n score = score2;\r\n }\r\n }\r\n }\r\n if (file) {\r\n const {type} = file;\r\n const blob = new Blob([file], {type});\r\n blob.name = `${Conf['pastedname']}.${$.getOwn(QR.extensionFromType, type) || 'jpg'}`;\r\n QR.open();\r\n QR.handleFiles([blob]);\r\n $.addClass(QR.nodes.el, 'dump');\r\n }\r\n },\r\n\r\n pasteFF() {\r\n const {pasteArea} = QR.nodes;\r\n if (!pasteArea.childNodes.length) { return; }\r\n const images = $$('img', pasteArea);\r\n $.rmAll(pasteArea);\r\n for (var img of images) {\r\n var m;\r\n var {src} = img;\r\n if (m = src.match(/data:(image\\/(\\w+));base64,(.+)/)) {\r\n var bstr = atob(m[3]);\r\n var arr = new Uint8Array(bstr.length);\r\n for (var i = 0, end = bstr.length, asc = 0 <= end; asc ? i < end : i > end; asc ? i++ : i--) {\r\n arr[i] = bstr.charCodeAt(i);\r\n }\r\n var blob = new Blob([arr], {type: m[1]});\r\n blob.name = `${Conf['pastedname']}.${m[2]}`;\r\n QR.handleFiles([blob]);\r\n } else if (/^https?:\\/\\//.test(src)) {\r\n QR.handleUrl(src);\r\n }\r\n }\r\n },\r\n\r\n handleUrl(urlDefault) {\r\n QR.open();\r\n QR.selected.preventAutoPost();\r\n return CrossOrigin.permission(function() {\r\n const url = prompt('Enter a URL:', urlDefault);\r\n if (url === null) { return; }\r\n QR.nodes.fileButton.focus();\r\n return CrossOrigin.file(url, function(blob) {\r\n if (blob && !/^text\\//.test(blob.type)) {\r\n return QR.handleFiles([blob]);\r\n } else {\r\n return QR.error(\"Can't load file.\");\r\n }\r\n });\r\n });\r\n },\r\n\r\n handleFiles(files) {\r\n if (this !== QR) { // file input\r\n files = [...Array.from(this.files)];\r\n this.value = null;\r\n }\r\n if (!files.length) { return; }\r\n QR.cleanNotifications();\r\n for (var file of files) {\r\n QR.handleFile(file, files.length);\r\n }\r\n if (files.length !== 1) { $.addClass(QR.nodes.el, 'dump'); }\r\n if ((d.activeElement === QR.nodes.fileButton) && $.hasClass(QR.nodes.fileSubmit, 'has-file')) {\r\n return QR.nodes.filename.focus();\r\n }\r\n },\r\n\r\n handleFile(file, nfiles) {\r\n let post;\r\n const isText = /^text\\//.test(file.type);\r\n if (nfiles === 1) {\r\n post = QR.selected;\r\n } else {\r\n post = QR.posts[QR.posts.length - 1];\r\n if (isText ? post.com || post.pasting : post.file) {\r\n post = new QR.post();\r\n }\r\n }\r\n return post[isText ? 'pasteText' : 'setFile'](file);\r\n },\r\n\r\n openFileInput() {\r\n if (QR.nodes.fileButton.disabled) { return; }\r\n QR.nodes.fileInput.click();\r\n return QR.nodes.fileButton.focus();\r\n },\r\n\r\n generatePostableThreadsList() {\r\n if (!QR.nodes) { return; }\r\n const list = QR.nodes.thread;\r\n const options = [list.firstElementChild];\r\n for (var thread of g.BOARD.threads.keys) {\r\n options.push($.el('option', {\r\n value: thread,\r\n textContent: `Thread ${thread}`\r\n }\r\n )\r\n );\r\n }\r\n const val = list.value;\r\n $.rmAll(list);\r\n $.add(list, options);\r\n list.value = val;\r\n if (list.value === val) { return; }\r\n // Fix the value if the option disappeared.\r\n list.value = g.VIEW === 'thread' ?\r\n g.THREADID\r\n :\r\n 'new';\r\n return (g.VIEW === 'thread' ? $.addClass : $.rmClass)(QR.nodes.el, 'reply-to-thread');\r\n },\r\n\r\n dialog() {\r\n let dialog, event, nodes;\r\n let name;\r\n QR.nodes = (nodes = {\r\n el: (dialog = UI.dialog('qr',\r\n { innerHTML: QuickReplyPage }))\r\n });\r\n\r\n const setNode = (name, query) => nodes[name] = $(query, dialog);\r\n\r\n setNode('move', '.move');\r\n setNode('autohide', '#autohide');\r\n setNode('close', '.close');\r\n setNode('thread', 'select');\r\n setNode('form', 'form');\r\n setNode('sjisToggle', '#sjis-toggle');\r\n setNode('texButton', '#tex-preview-button');\r\n setNode('name', '[data-name=name]');\r\n setNode('email', '[data-name=email]');\r\n setNode('sub', '[data-name=sub]');\r\n setNode('com', '[data-name=com]');\r\n setNode('charCount', '#char-count');\r\n setNode('texPreview', '#tex-preview');\r\n setNode('dumpList', '#dump-list');\r\n setNode('addPost', '#add-post');\r\n setNode('oekaki', '.oekaki');\r\n setNode('drawButton', '#qr-draw-button');\r\n setNode('fileSubmit', '#file-n-submit');\r\n setNode('fileButton', '#qr-file-button');\r\n setNode('noFile', '#qr-no-file');\r\n setNode('filename', '#qr-filename');\r\n setNode('spoiler', '#qr-file-spoiler');\r\n setNode('oekakiButton', '#qr-oekaki-button');\r\n setNode('fileRM', '#qr-filerm');\r\n setNode('urlButton', '#url-button');\r\n setNode('pasteArea', '#paste-area');\r\n setNode('customCooldown', '#custom-cooldown-button');\r\n setNode('dumpButton', '#dump-button');\r\n setNode('status', '[type=submit]');\r\n setNode('flashTag', '[name=filetag]');\r\n setNode('fileInput', '[type=file]');\r\n\r\n const {config} = g.BOARD;\r\n const {classList} = QR.nodes.el;\r\n classList.toggle('forced-anon', QR.forcedAnon);\r\n classList.toggle('has-spoiler', QR.spoiler);\r\n classList.toggle('has-sjis', !!config.sjis_tags);\r\n classList.toggle('has-math', !!config.math_tags);\r\n classList.toggle('sjis-preview', !!config.sjis_tags && Conf['sjisPreview']);\r\n classList.toggle('show-new-thread-option', Conf['Show New Thread Option in Threads']);\r\n\r\n if (parseInt(Conf['customCooldown'], 10) > 0) {\r\n $.addClass(QR.nodes.fileSubmit, 'custom-cooldown');\r\n $.get('customCooldownEnabled', Conf['customCooldownEnabled'], function({customCooldownEnabled}) {\r\n QR.setCustomCooldown(customCooldownEnabled);\r\n return $.sync('customCooldownEnabled', QR.setCustomCooldown);\r\n });\r\n }\r\n\r\n QR.flagsInput();\r\n\r\n $.on(nodes.autohide, 'change', QR.toggleHide);\r\n $.on(nodes.close, 'click', QR.close);\r\n $.on(nodes.status, 'click', QR.submit);\r\n $.on(nodes.form, 'submit', QR.submit);\r\n $.on(nodes.sjisToggle, 'click', QR.toggleSJIS);\r\n $.on(nodes.texButton, 'mousedown', QR.texPreviewShow);\r\n $.on(nodes.texButton, 'mouseup', QR.texPreviewHide);\r\n $.on(nodes.addPost, 'click', () => new QR.post(true));\r\n $.on(nodes.drawButton, 'click', QR.oekaki.draw);\r\n $.on(nodes.fileButton, 'click', QR.openFileInput);\r\n $.on(nodes.noFile, 'click', QR.openFileInput);\r\n $.on(nodes.filename, 'focus', function() { return $.addClass(this.parentNode, 'focus'); });\r\n $.on(nodes.filename, 'blur', function() { return $.rmClass(this.parentNode, 'focus'); });\r\n $.on(nodes.spoiler, 'change', () => QR.selected.nodes.spoiler.click());\r\n $.on(nodes.oekakiButton, 'click', QR.oekaki.button);\r\n $.on(nodes.fileRM, 'click', () => QR.selected.rmFile());\r\n $.on(nodes.urlButton, 'click', () => QR.handleUrl(''));\r\n $.on(nodes.customCooldown, 'click', QR.toggleCustomCooldown);\r\n $.on(nodes.dumpButton, 'click', () => nodes.el.classList.toggle('dump'));\r\n $.on(nodes.fileInput, 'change', QR.handleFiles);\r\n\r\n window.addEventListener('focus', QR.focus, true);\r\n window.addEventListener('blur', QR.focus, true);\r\n // We don't receive blur events from captcha iframe.\r\n $.on(d, 'click', QR.focus);\r\n\r\n // XXX Workaround for image pasting in Firefox, obsolete as of v50.\r\n // https://bugzilla.mozilla.org/show_bug.cgi?id=906420\r\n if (($.engine === 'gecko') && !window.DataTransferItemList) {\r\n nodes.pasteArea.hidden = false;\r\n }\r\n new MutationObserver(QR.pasteFF).observe(nodes.pasteArea, {childList: true});\r\n\r\n // save selected post's data\r\n const items = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'flag'];\r\n let i = 0;\r\n const save = function() { return QR.selected.save(this); };\r\n while ((name = items[i++])) {\r\n var node;\r\n if (!(node = nodes[name])) { continue; }\r\n event = node.nodeName === 'SELECT' ? 'change' : 'input';\r\n $.on(nodes[name], event, save);\r\n }\r\n\r\n // XXX Blink and WebKit treat width and height of + +
            + +
            +
            + + +
            + +
            + + + No selected file + + + ✎︎ + + 🔗︎ + + 🕒︎ + + + + +
            + + + + + + +`; + + var ferongr_unreadDead = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAFVBMVEX///9zBQC/AADpDAP/gID/q6voCwJJTwpOAAAAAXRSTlMAQObYZgAAAGJJREFUeF5Fi7ENg0AQBCfa/AFdDh2gdwPIogMK2E2+/xLslwOvdqRJhv+GQQPUCtJM7svankLrq/I+TY5e6Ueh1jyBMX7AFJi9vwfyVO4CbbO6jNYpp9GyVPbdkFhVgAQ2H0NOE5jk9DT8AAAAAElFTkSuQmCC'; + + var ferongr_unreadDeadY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAxUlEQVR42q1TOwrCQBB9s0FRtJI0WoqFtSLYegoP4gVSeJsUHsHSI3iFeIqRXXgwrhlXwYHHhLwPTB7B36abBCV+0pA4DUBQUNZYQptGtW3jtoKyxgoe0yrBCoyZfL/5ioQ3URZOXW9I341l3oo+NXEZiW4CEuIzvPECopED4OaZ3RNmeAm4u+a8Jr5f17VyVoL8fr8qcltzwlyyj2iqcgPOQ9ExkHAITgD75bYBe0A5S4H/P9htuWMF3QXoQpwaKeT+lnsC6JE5I6aq6fEAAAAASUVORK5CYII='; + + var ferongr_unreadSFW = 'iVBORw0KGgoAAAANSUh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NqCK5wICSPEcLYAtH+AMN/IXMIBrEJRie6OEgjDAC5x3FqxuUFNiEUA67j1IweTTBxBQ1puAG86jgSEraogskJWSBcwCGF5k30qMJmgMFEhv/MXBAs5oLDAFj8IsczTE7UEeECbhU8+QGZRpaTi2b4L2zF8J9TGk80wjThykzY5AAW/2O1C2mIbgAAAABJRU5ErkJggg=='; + + var xat_unreadDead = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAG1BMVEX+AACLkZFub2yfaF3zZGIAAAD/AAD/iYr/zs8IPcF6AAAABXRSTlMAeprJ7xzg6IEAAABZSURBVAjXY2DABKGBSkqioQwMrGmpxsZhaQEMDGFpIa5pqSCRtPDSNJBIaGh5eShQDYOye0V7iREKAyQFYoiCFAcyILQDGcGmEEZYkGoqiMHKysAQEICwGwAAjBmBqhYlagAAAABJRU5ErkJggg=='; + + var xat_unreadDeadY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAPFBMVEUAAACEgoBva2ilamDxcG7IaWYgFBNOSEf//f0PDQwBAAA7LCwAAAD/AAD+hIX+m5z+zc5HAADPAAAGAADl032uAAAADHRSTlMAzNv0/vz+6v3+7ALrmfyXAAAAaUlEQVQY042PyxKAIAhFAc1eV7T6/3/N8VXOtAgWwBm4ANEPA8AswpySXHvvYZLlpBNrh9pDtcSqAQ1BUTVIjNUQY5icmwfglmXNgE0d6QBF9GigrU0A9LoM53U1kFzk6SBQuWfD/vHqDUCpBmVKTTM4AAAAAElFTkSuQmCC'; + + var xat_unreadSFW = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIVBMVEUAAACRjop4dXVpZ2tdcI9dfKdisfMAAAAumMN9xv+s2/+PADT2AAAAB3RSTlMAepGdv83v3HIc4QAAAFxJREFUCNdjYMAE5YXKRuLlDAzsHe2uIRUdBQwMFR1l6R3tIJGOyukdIJHy8lkry4FqGEwzV62aFozMUAFJOQEZ4iDFhQwI7UBGaTiEUVFs3g5isLMzMBQUIOwGAJRlIu9hk08QAAAAAElFTkSuQmCC'; + + var xat_unreadSFWY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAMFBMVEUAAACAgYVlc4ljsu4AAAAAAAAAAAAumMODyP6b1P6e1f/g8v89msgSIiwNFxwbPU3tQYj5AAAABnRSTlMAxej+9VTmD9ciAAAAZElEQVQI12NgwARpiUKKYmkMDGzlZUpK6eUJDAzp5clm5WUgkfKMtnKQSFpa54o0oBoGJYvZO88+gjJu7wMyhIBS2SCGGFDxaxADpP32NjAjSe0bSFd6epIaWISNjYEhJRVhNwAGlyJpYtcvcAAAAABJRU5ErkJggg=='; + + var xat_unreadNSFW = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAHlBMVEUfJSCRi5Frbm9dn19082KR/30AAABmzDOq/5vZ/9Gt/vt2AAAABnRSTlMAe5rJ7/4vxEp4AAAAWUlEQVQI12NgwARpiUpKYmkMDGzlZcbG6eUJDAzp5Slu5WUgkfLUsHKQSFpaRGsaUA2DsmvnjBAjFAZICsQQAylOZEBoBzKSzSCM9CS1MhCDjY2BISEBYTcAtgAcKSK2vuIAAAAASUVORK5CYII='; + + var xat_unreadNSFWY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAM1BMVEUAAACBj39tfm1qj2RepFlu2VQAAQAAAAAAAABmyzOX/oSr/pus/pzk/98PGgtatC4CBAI1ENblAAAACHRSTlMA09/p9v77ig0SBcQAAABnSURBVBjTjY9LDsAgCEQRsR2xWu9/2hK/adJFYQG8wABEPwyAYzNnSatjjPAiviWLhPCqI1R7HBrQdCmGBrEETTmnUAq/QMm5dODHyAQOXXR1zLUGsIEI7lonMGfeHQTq9xw4P159AIxSBSC53km7AAAAAElFTkSuQmCC'; + + var Mayhem_unreadDead = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABFkl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acCs6y6S8psGNU1hw4Bu4JHuUB3pzJBHZcviLiKV9jkyO4vxHyBx1h+qlcY5b2Wj+raE0vlU33dKrNFXWsR/7EgqmtPBIXuIw+dt8osqGsOPaIGSeeGRbZiFtVxsAYeHSbMOgd0MhSzTp3mD4RaQX4aW3NMAAAAAElFTkSuQmCC'; + + var Mayhem_unreadNSFWY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABP0lEQVR4AYWS0UqFQBCGhziImNRBRImDmUgiIaF0kWSP4AMEXXXTE/QiPpL3UdR19Crb/PAvLEtyFj5mmfn/cdxd0RUokbJXEsZYCZUd4D72NBG8wkKmlEqtVMoFhTFJmKuoKelBTVIkjbNE5IainJTIeZqaXjkg8fp+Z7GCjiLQbWgOihTKsCFowUZtoNef4HgDf4JMuTbe8n/Br8NDr5zxhBul52i3FBQE+xflmzzTA69ESmpPmubunwZfztc/6IncBrXSe7/QkK5tW3f8H7dBjHH8q6Kwt033V6Hb4JeeWPgsq42rugfYZ92psWscRwMPvZIo9bEGD2+F2YUnBizLwpeoXnYpbQM34kAB9peP58aueZ4NPPRKxPusaRoYG6UizbquyH1O04T4RA+8EvAwUr6sgjFnDuReLaUn+ANygUa7+9SCWgAAAABJRU5ErkJggg=='; + + var fourChanJS_unreadDead = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAD1BMVEUBAAAAAAD/AABnZ2f///8nFk05AAAAAXRSTlMAQObYZgAAAEFJREFUeNqNjgEKACAMAjvX/98cAkkxgmSgO8Bt/Ai4ApJ6KKhzF3OiEMDASrGB/QWgPEHsUpN+Ng9xAETMYhDrWmeHAMcmvycWAAAAAElFTkSuQmCC'; + + var fourChanJS_unreadDeadY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAD1BMVEUAAAAAAAD/AABmZmYA/wBD99DBAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAE9JREFUCNdljcsRACEIQ5MOiNKAdGAJ9N/Uiu7nsMzABHgB4B8ygFoZA2hhVWavhhGeURPJU9q45+17hGbfGxa82Ndex3hEM44SJGD2/b4AzDgGlHbl388AAAAASUVORK5CYII='; + + var fourChanJS_unreadSFW = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAD1BMVEUBAAAAAAAul8NnZ2f////82iC9AAAAAXRSTlMAQObYZgAAAEFJREFUeNqNjgEKACAMAjvX/98cAkkxgmSgO8Bt/Ai4ApJ6KKhzF3OiEMDASrGB/QWgPEHsUpN+Ng9xAETMYhDrWmeHAMcmvycWAAAAAElFTkSuQmCC'; + + var fourChanJS_unreadSFWY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAD1BMVEUAAAAAAAAul8NnZ2f/AAD7B+mqAAAAAXRSTlMAQObYZgAAAAlwSFlzAAALEgAACxIB0t1+/AAAAE9JREFUCNdljcsRACEIQ5MOiNKAdGAJ9N/Uiu7nsMzABHgB4B8ygFoZA2hhVWavhhGeURPJU9q45+17hGbfGxa82Ndex3hEM44SJGD2/b4AzDgGlHbl388AAAAASUVORK5CYII='; + + var fourChanJS_unreadNSFW = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAElBMVEUBAAAAAABmzDNlyjJnZ2f///+6o7dfAAAAAXRSTlMAQObYZgAAAERJREFUeF6NjkEKADEIA51o///lJZfQxUsHITogWi8AvwZJuxmYa25xDooBLEwOWFTYAsYVhdorLZt9Ng9xCUTCUCQ2H3F4ANrZ2WNiAAAAAElFTkSuQmCC'; + + var fourChanJS_unreadNSFWY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAD1BMVEUAAAAAAABmzDNmZmb/AAC8/wCMAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAE9JREFUCNdljcsRACEIQ5MOiNKAdGAJ9N/Uiu7nsMzABHgB4B8ygFoZA2hhVWavhhGeURPJU9q45+17hGbfGxa82Ndex3hEM44SJGD2/b4AzDgGlHbl388AAAAASUVORK5CYII='; + + var Original_unreadDead = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX/////AAD///8AAABBZmS3AAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; + + var Original_unreadDeadY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAhElEQVR42q1RwQnAMAjMu5M4guAKXa4j5dUROo5tipSDcrFChUONd0di2m/hEGVOHDyIPufgwAFASDkpoSzmBrkJ2UMyR9LsJ3rvrqo3Rt1YMIMhhNnOxLMnoMFBxHyJAr2IOBFzA8U+6pLBdmEJTA0aMVjpDd6Loks0s5HZNwYx8tfZCZ0kll7ORffZAAAAAElFTkSuQmCC'; + + var Original_unreadSFW = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX///8ul8P///8AAACaqgkzAAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; + + var Original_unreadSFWY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAALVBMVEUAAAAAAAAAAAAAAAABBQcHFx4KISoNLToaVW4oKCgul8M4ODg7OzvBwcH///8uS/CdAAAAA3RSTlMAx9dmesIgAAAAV0lEQVR42m2NWw6AIBAD1eILZO5/XI0UAgm7H9tOsu0yGWAQSOoFijHOxOANGqm/LczpOaXs4gISrPZ+gc2+hO5w2xdwgOjBFUIF+sEJrhUl9JFr+badFwR+BfqlmGUJAAAAAElFTkSuQmCC'; + + var Original_unreadNSFW = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEX///9mzDP///8AAACT0n1lAAAAAXRSTlMAQObYZgAAAExJREFUeF4tyrENgDAMAMFXKuQswQLBG3mOlBnFS1gwDfIYLpEivvjq2MlqjmYvYg5jWEzCwtDSQlwcXKCVLrpFbvLvvSf9uZJ2HusDtJAY7Tkn1oYAAAAASUVORK5CYII='; + + var Original_unreadNSFWY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAALVBMVEUAAAAAAAAAAAAAAAAECAIQIAgWLAsePA8oKCg4ODg6dB07OztmzDPBwcH///+rsf3XAAAAA3RSTlMAx9dmesIgAAAAV0lEQVR42m2NWw6AIBAD1eIDhbn/cTVSCCTsfmw7ybbLZIBBIKkXKKU0E4M3aKT+tjCn5xiziwuIsNr7BTb7ErrDZV/AAaIHdwgV6AcnuFaU0Eeu5dt2XiUyBjCQ2bIrAAAAAElFTkSuQmCC'; + + var Metro_unreadDead = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAC/AABrZQDiAAAAAXRSTlMAQObYZgAAABJJREFUCB1jZGBgrMNAQEEc4gCSfAX5bRw/NQAAAABJRU5ErkJggg=='; + + var Metro_unreadDeadY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAAAAAAAAAC/AAD///8dAAApAABsAAAHAAA4AACQAAAsAABMCpCvAAAAA3RSTlMAPse+s4iwAAAAMklEQVQI12NggAFmY2MDECaNAQZCilAzVJyg5oS4GqAxUtygjIp2KGOKJ5SxepcB3BUAcdYRqxAtgFoAAAAASUVORK5CYII='; + + var Metro_unreadSFW = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAAA1/GhpCidAAAAAXRSTlMAQObYZgAAABJJREFUCB1jZGBgrMNAQEEc4gCSfAX5bRw/NQAAAABJRU5ErkJggg=='; + + var Metro_unreadSFWY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAAAAAAAAAAA1/H///8AISUALzQAeokACAkAQEcAorYAMTcE9WFNAAAAA3RSTlMAPse+s4iwAAAAMklEQVQI12NggAFmY2MDECaNAQZCilAzVJyg5oS4GqAxUtygjIp2KGOKJ5SxepcB3BUAcdYRqxAtgFoAAAAASUVORK5CYII='; + + var Metro_unreadNSFW = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAABV/wErM5hwAAAAAXRSTlMAQObYZgAAABJJREFUCB1jZGBgrMNAQEEc4gCSfAX5bRw/NQAAAABJRU5ErkJggg=='; + + var Metro_unreadNSFWY = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAAAAAAAAABV/wH///8NKAASOAAwkQADCgAZTABAwQATOwC5e3VGAAAAA3RSTlMAPse+s4iwAAAAMklEQVQI12NggAFmY2MDECaNAQZCilAzVJyg5oS4GqAxUtygjIp2KGOKJ5SxepcB3BUAcdYRqxAtgFoAAAAASUVORK5CYII='; + + var dead = 'R0lGODlhEAAQAKECAAAAAP8AAP///////yH5BAEKAAIALAAAAAAQABAAAAIvlI+pq+D9DAgUoFkPDlbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw=='; + + var empty = 'R0lGODlhEAAQAJEAAAAAAP///9vb2////yH5BAEAAAMALAAAAAAQABAAAAIvnI+pq+D9DBAUoFkPFnbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw=='; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + + var Favicon = { + init() { + return $$1.asap((() => d$1.head && (Favicon.el = $$1('link[rel="shortcut icon"]', d$1.head))), Favicon.initAsap); + }, + + set(status) { + Favicon.status = status; + if (Favicon.el) { + Favicon.el.href = Favicon[status]; + // `favicon.href = href` doesn't work on Firefox. + return $$1.add(d$1.head, Favicon.el); + } + }, + + initAsap() { + Favicon.el.type = 'image/x-icon'; + const {href} = Favicon.el; + Favicon.isSFW = /ws\.ico$/.test(href); + Favicon.default = href; + Favicon.switch(); + if (Favicon.status) { + return Favicon.set(Favicon.status); + } + }, + + switch() { + let items = { + ferongr: [ + ferongr_unreadDead, + ferongr_unreadDeadY, + ferongr_unreadSFW, + ferongr_unreadSFWY, + ferongr_unreadNSFW, + ferongr_unreadNSFWY, + ], + 'xat-': [ + xat_unreadDead, + xat_unreadDeadY, + xat_unreadSFW, + xat_unreadSFWY, + xat_unreadNSFW, + xat_unreadNSFWY, + ], + Mayhem: [ + Mayhem_unreadDead, + Mayhem_unreadDeadY, + Mayhem_unreadSFW, + Mayhem_unreadSFWY, + Mayhem_unreadNSFW, + Mayhem_unreadNSFWY, + ], + '4chanJS': [ + fourChanJS_unreadDead, + fourChanJS_unreadDeadY, + fourChanJS_unreadSFW, + fourChanJS_unreadSFWY, + fourChanJS_unreadNSFW, + fourChanJS_unreadNSFWY, + ], + Original: [ + Original_unreadDead, + Original_unreadDeadY, + Original_unreadSFW, + Original_unreadSFWY, + Original_unreadNSFW, + Original_unreadNSFWY, + ], + 'Metro': [ + Metro_unreadDead, + Metro_unreadDeadY, + Metro_unreadSFW, + Metro_unreadSFWY, + Metro_unreadNSFW, + Metro_unreadNSFWY, + ] + }; + items = $$1.getOwn(items, Conf['favicon']); + + const f = Favicon; + const t = 'data:image/png;base64,'; + let i = 0; + while (items[i]) { + items[i] = t + items[i++]; + } + + [f.unreadDead, f.unreadDeadY, f.unreadSFW, f.unreadSFWY, f.unreadNSFW, f.unreadNSFWY] = Array.from(items); + return f.update(); + }, + + update() { + if (this.isSFW) { + this.unread = this.unreadSFW; + return this.unreadY = this.unreadSFWY; + } else { + this.unread = this.unreadNSFW; + return this.unreadY = this.unreadNSFWY; + } + }, + + SFW: '//s.4cdn.org/image/favicon-ws.ico', + NSFW: '//s.4cdn.org/image/favicon.ico', + dead: `data:image/gif;base64,${dead}`, + logo: `data:image/png;base64,${empty}`, + }; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + const $$ = (selector, root = d$1.body) => [...Array.from(root.querySelectorAll(selector))]; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + const CaptchaReplace = { + init() { + if ((g.SITE.software !== 'yotsuba') || (d$1.cookie.indexOf('pass_enabled=1') >= 0)) { return; } + + if (Conf['Force Noscript Captcha'] && Main$1.jsEnabled) { + $$1.ready(Captcha.replace.noscript); + return; + } + + if (Conf['captchaLanguage'].trim()) { + if (['boards.4chan.org', 'boards.4channel.org'].includes(location.hostname)) { + return $$1.onExists(doc$1, '#captchaFormPart', node => $$1.onExists(node, 'iframe[src^="https://www.google.com/recaptcha/"]', Captcha.replace.iframe)); + } else { + return $$1.onExists(doc$1, 'iframe[src^="https://www.google.com/recaptcha/"]', Captcha.replace.iframe); + } + } + }, + + noscript() { + let noscript, original, toggle; + if (!((original = $$1('#g-recaptcha')) && (noscript = $$1('noscript', original.parentNode)))) { return; } + const span = $$1.el('span', + {id: 'captcha-forced-noscript'}); + $$1.replace(noscript, span); + $$1.rm(original); + const insert = function() { + span.innerHTML = noscript.textContent; + return Captcha.replace.iframe($$1('iframe[src^="https://www.google.com/recaptcha/"]', span)); + }; + if (toggle = $$1('#togglePostFormLink a, #form-link')) { + return $$1.on(toggle, 'click', insert); + } else { + return insert(); + } + }, + + iframe(iframe) { + let lang; + if (lang = Conf['captchaLanguage'].trim()) { + const src = /[?&]hl=/.test(iframe.src) ? + iframe.src.replace(/([?&]hl=)[^&]*/, '$1' + encodeURIComponent(lang)) + : + iframe.src + `&hl=${encodeURIComponent(lang)}`; + if (iframe.src !== src) { iframe.src = src; } + } + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + const CaptchaT = { + init() { + if (d$1.cookie.indexOf('pass_enabled=1') >= 0) { return; } + if (!(this.isEnabled = !!$$1('#t-root') || !$$1.id('postForm'))) { return; } + + const root = $$1.el('div', {className: 'captcha-root'}); + this.nodes = {root}; + + $$1.addClass(QR.nodes.el, 'has-captcha', 'captcha-t'); + return $$1.after(QR.nodes.com.parentNode, root); + }, + + moreNeeded() { + }, + + getThread() { + let threadID; + const boardID = g.BOARD.ID; + if (QR.posts[0].thread === 'new') { + threadID = '0'; + } else { + threadID = '' + QR.posts[0].thread; + } + return {boardID, threadID}; + }, + + setup(focus) { + if (!this.isEnabled) { return; } + + if (!this.nodes.container) { + this.nodes.container = $$1.el('div', {className: 'captcha-container'}); + $$1.prepend(this.nodes.root, this.nodes.container); + CaptchaT.currentThread = CaptchaT.getThread(); + $$1.global(function() { + const el = document.querySelector('#qr .captcha-container'); + window.TCaptcha.init(el, this.boardID, +this.threadID); + return window.TCaptcha.setErrorCb(err => window.dispatchEvent(new CustomEvent('CreateNotification', {detail: { + type: 'warning', + content: '' + err + }}) + )); + } + , CaptchaT.currentThread); + } + + if (focus) { + return $$1('#t-resp').focus(); + } + }, + + destroy() { + if (!this.isEnabled || !this.nodes.container) { return; } + $$1.global(() => window.TCaptcha.destroy()); + $$1.rm(this.nodes.container); + return delete this.nodes.container; + }, + + updateThread() { + if (!this.isEnabled) { return; } + const {boardID, threadID} = (CaptchaT.currentThread || {}); + const newThread = CaptchaT.getThread(); + if ((newThread.boardID !== boardID) || (newThread.threadID !== threadID)) { + CaptchaT.destroy(); + return CaptchaT.setup(); + } + }, + + getOne() { + let el; + let response = {}; + if (this.nodes.container) { + for (var key of ['t-response', 't-challenge']) { + response[key] = $$1(`[name='${key}']`, this.nodes.container).value; + } + } + if (!response['t-response'] && !((el = $$1('#t-msg')) && /Verification not required/i.test(el.textContent))) { + response = null; + } + return response; + }, + + setUsed() { + if (!this.isEnabled) { return; } + if (this.nodes.container) { + return $$1.global(() => window.TCaptcha.clearChallenge()); + } + }, + + occupied() { + return !!this.nodes.container; + } + }; + + // This file was created because these functions on $ were sometimes not initialized yet because of circular + // dependencies, so try to keep this file without dependencies, so these functions don't have to wait for something else + const debounce = (wait, fn) => { + let lastCall = 0; + let timeout = null; + let that = null; + let args = null; + const exec = function () { + lastCall = Date.now(); + return fn.apply(that, args); + }; + return function () { + args = arguments; + that = this; + if (lastCall < (Date.now() - wait)) { + return exec(); + } + // stop current reset + clearTimeout(timeout); + // after wait, let next invocation execute immediately + return timeout = setTimeout(exec, wait); + }; + }; + const dict = () => Object.create(null); + dict.clone = function (obj) { + if ((typeof obj !== 'object') || (obj === null)) { + return obj; + } + else if (obj instanceof Array) { + const arr = []; + for (let i = 0, end = obj.length; i < end; i++) { + arr.push(dict.clone(obj[i])); + } + return arr; + } + else { + const map = Object.create(null); + for (var key in obj) { + var val = obj[key]; + map[key] = dict.clone(val); + } + return map; + } + }; + dict.json = (str) => dict.clone(JSON.parse(str)); + const SECOND = 1000; + const MINUTE = SECOND * 60; + const HOUR = MINUTE * 60; + const DAY = HOUR * 24; + const platform = window.GM_xmlhttpRequest ? 'userscript' : 'crx'; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS104: Avoid inline assignments + * DS206: Consider reworking classes to avoid initClass + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + class DataBoard { + static initClass() { + this.keys = ['hiddenThreads', 'hiddenPosts', 'lastReadPosts', 'yourPosts', 'watchedThreads', 'watcherLastModified', 'customTitles']; + + this.changes = []; + } + + constructor(key, sync, dontClean) { + this.onSync = this.onSync.bind(this); + this.key = key; + this.initData(Conf[this.key]); + $$1.sync(this.key, this.onSync); + if (!dontClean) { this.clean(); } + if (!sync) { return; } + // Chrome also fires the onChanged callback on the current tab, + // so we only start syncing when we're ready. + var init = () => { + $$1.off(d$1, '4chanXInitFinished', init); + return this.sync = sync; + }; + $$1.on(d$1, '4chanXInitFinished', init); + } + + initData(data) { + let boards; + this.data = data; + if (this.data.boards) { + let lastChecked; + ({boards, lastChecked} = this.data); + this.data['4chan.org'] = {boards, lastChecked}; + delete this.data.boards; + delete this.data.lastChecked; + } + return this.data[g.SITE.ID] || (this.data[g.SITE.ID] = { boards: dict() }); + } + + save(change, cb) { + change(); + DataBoard.changes.push(change); + return $$1.get(this.key, { boards: dict() }, items => { + if (!DataBoard.changes.length) { return; } + const needSync = ((items[this.key].version || 0) > (this.data.version || 0)); + if (needSync) { + this.initData(items[this.key]); + for (change of DataBoard.changes) { change(); } + } + DataBoard.changes = []; + this.data.version = (this.data.version || 0) + 1; + return $$1.set(this.key, this.data, () => { + if (needSync) { this.sync?.(); } + return cb?.(); + }); + }); + } + + forceSync(cb) { + return $$1.get(this.key, { boards: dict() }, items => { + if ((items[this.key].version || 0) > (this.data.version || 0)) { + this.initData(items[this.key]); + for (var change of DataBoard.changes) { change(); } + this.sync?.(); + } + return cb?.(); + }); + } + + delete({siteID, boardID, threadID, postID}, cb) { + if (!siteID) { siteID = g.SITE.ID; } + if (!this.data[siteID]) { return; } + return this.save(() => { + if (postID) { + if (!this.data[siteID].boards[boardID]?.[threadID]) { return; } + delete this.data[siteID].boards[boardID][threadID][postID]; + return this.deleteIfEmpty({siteID, boardID, threadID}); + } else if (threadID) { + if (!this.data[siteID].boards[boardID]) { return; } + delete this.data[siteID].boards[boardID][threadID]; + return this.deleteIfEmpty({siteID, boardID}); + } else { + return delete this.data[siteID].boards[boardID]; + } + } + , cb); + } + + deleteIfEmpty({siteID, boardID, threadID}) { + if (!this.data[siteID]) { return; } + if (threadID) { + if (!Object.keys(this.data[siteID].boards[boardID][threadID]).length) { + delete this.data[siteID].boards[boardID][threadID]; + return this.deleteIfEmpty({siteID, boardID}); + } + } else if (!Object.keys(this.data[siteID].boards[boardID]).length) { + return delete this.data[siteID].boards[boardID]; + } + } + + set(data, cb) { + return this.save(() => { + return this.setUnsafe(data); + } + , cb); + } + + setUnsafe({siteID, boardID, threadID, postID, val}) { + if (!siteID) { siteID = g.SITE.ID; } + if (!this.data[siteID]) { this.data[siteID] = { boards: dict() }; } + if (postID !== undefined) { + let base; + return (((base = this.data[siteID].boards[boardID] || (this.data[siteID].boards[boardID] = dict())))[threadID] || (base[threadID] = dict()))[postID] = val; + } else if (threadID !== undefined) { + return (this.data[siteID].boards[boardID] || (this.data[siteID].boards[boardID] = dict()))[threadID] = val; + } else { + return this.data[siteID].boards[boardID] = val; + } + } + + extend({siteID, boardID, threadID, postID, val}, cb) { + return this.save(() => { + const oldVal = this.get({ siteID, boardID, threadID, postID, defaultValue: dict() }); + for (var key in val) { + var subVal = val[key]; + if (typeof subVal === 'undefined') { + delete oldVal[key]; + } else { + oldVal[key] = subVal; + } + } + return this.setUnsafe({siteID, boardID, threadID, postID, val: oldVal}); + } + , cb); + } + + setLastChecked(key='lastChecked') { + return this.save(() => { + return this.data[key] = Date.now(); + }); + } + + get({siteID, boardID, threadID, postID, defaultValue}) { + let board, val; + if (!siteID) { siteID = g.SITE.ID; } + if (board = this.data[siteID]?.boards[boardID]) { + let thread; + if (threadID == null) { + if (postID != null) { + for (thread = 0; thread < board.length; thread++) { + board[thread]; + if (postID in thread) { + val = thread[postID]; + break; + } + } + } else { + val = board; + } + } else if (thread = board[threadID]) { + val = (postID != null) ? + thread[postID] + : + thread; + } + } + return val || defaultValue; + } + + clean() { + let boardID, middle; + const siteID = g.SITE.ID; + for (boardID in this.data[siteID].boards) { + this.data[siteID].boards[boardID]; + this.deleteIfEmpty({siteID, boardID}); + } + const now = Date.now(); + if (now - (2 * HOUR) >= ((middle = this.data[siteID].lastChecked || 0)) || middle > now) { + this.data[siteID].lastChecked = now; + for (boardID in this.data[siteID].boards) { + this.ajaxClean(boardID); + } + } + } + + ajaxClean(boardID) { + const that = this; + const siteID = g.SITE.ID; + const threadsList = g.SITE.urls.threadsListJSON?.({siteID, boardID}); + if (!threadsList) { return; } + return $$1.cache(threadsList, function() { + if (this.status !== 200) { return; } + const archiveList = g.SITE.urls.archiveListJSON?.({siteID, boardID}); + if (!archiveList) { return that.ajaxCleanParse(boardID, this.response); } + const response1 = this.response; + return $$1.cache(archiveList, function() { + if ((this.status !== 200) && (!!g.SITE.archivedBoardsKnown || (this.status !== 404))) { return; } + return that.ajaxCleanParse(boardID, response1, this.response); + }); + }); + } + + ajaxCleanParse(boardID, response1, response2) { + let board, ID; + const siteID = g.SITE.ID; + if (!(board = this.data[siteID].boards[boardID])) { return; } + const threads = dict(); + if (response1) { + for (var page of response1) { + for (var thread of page.threads) { + ID = thread.no; + if (ID in board) { threads[ID] = board[ID]; } + } + } + } + if (response2) { + for (ID of response2) { + if (ID in board) { threads[ID] = board[ID]; } + } + } + this.data[siteID].boards[boardID] = threads; + this.deleteIfEmpty({siteID, boardID}); + return $$1.set(this.key, this.data); + } + + onSync(data) { + if ((data.version || 0) <= (this.data.version || 0)) { return; } + this.initData(data); + return this.sync?.(); + } + } + DataBoard.initClass(); + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + class SimpleDict { + constructor() { + this.keys = []; + } + push(key, data) { + key = `${key}`; + if (!this[key]) { + this.keys.push(key); + } + return this[key] = data; + } + rm(key) { + let i; + key = `${key}`; + if ((i = this.keys.indexOf(key)) !== -1) { + this.keys.splice(i, 1); + return delete this[key]; + } + } + forEach(fn) { + for (var key of [...Array.from(this.keys)]) { + fn(this[key]); + } + } + get(key) { + if (key === 'keys') { + return undefined; + } + else { + return $$1.getOwn(this, key); + } + } + } + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + class Thread { + toString() { return this.ID; } + + constructor(ID, board) { + this.board = board; + this.ID = +ID; + this.threadID = this.ID; + this.boardID = this.board.ID; + this.siteID = g.SITE.ID; + this.fullID = `${this.board}.${this.ID}`; + this.posts = new SimpleDict(); + this.isDead = false; + this.isHidden = false; + this.isSticky = false; + this.isClosed = false; + this.isArchived = false; + this.postLimit = false; + this.fileLimit = false; + this.lastPost = 0; + this.ipCount = undefined; + this.json = null; + + this.OP = null; + this.catalogView = null; + + this.nodes = + {root: null}; + + this.board.threads.push(this.ID, this); + g.threads.push(this.fullID, this); + } + + setPage(pageNum) { + let icon; + const {info, reply} = this.OP.nodes; + if (!(icon = $$1('.page-num', info))) { + icon = $$1.el('span', {className: 'page-num'}); + $$1.replace(reply.parentNode.previousSibling, [$$1.tn(' '), icon, $$1.tn(' ')]); + } + icon.title = `This thread is on page ${pageNum} in the original index.`; + icon.textContent = `[${pageNum}]`; + if (this.catalogView) { return this.catalogView.nodes.pageCount.textContent = pageNum; } + } + + setCount(type, count, reachedLimit) { + if (!this.catalogView) { return; } + const el = this.catalogView.nodes[`${type}Count`]; + el.textContent = count; + return (reachedLimit ? $$1.addClass : $$1.rmClass)(el, 'warning'); + } + + setStatus(type, status) { + const name = `is${type}`; + if (this[name] === status) { return; } + this[name] = status; + if (!this.OP) { return; } + this.setIcon('Sticky', this.isSticky); + this.setIcon('Closed', this.isClosed && !this.isArchived); + return this.setIcon('Archived', this.isArchived); + } + + setIcon(type, status) { + const typeLC = type.toLowerCase(); + let icon = $$1(`.${typeLC}Icon`, this.OP.nodes.info); + if (!!icon === status) { return; } + + if (!status) { + $$1.rm(icon.previousSibling); + $$1.rm(icon); + if (this.catalogView) { $$1.rm($$1(`.${typeLC}Icon`, this.catalogView.nodes.icons)); } + return; + } + icon = $$1.el('img', { + src: `${g.SITE.Build.staticPath}${typeLC}${g.SITE.Build.gifIcon}`, + alt: type, + title: type, + className: `${typeLC}Icon retina` + } + ); + if (g.BOARD.ID === 'f') { + icon.style.cssText = 'height: 18px; width: 18px;'; + } + + const root = (type !== 'Sticky') && this.isSticky ? + $$1('.stickyIcon', this.OP.nodes.info) + : + $$1('.page-num', this.OP.nodes.info) || this.OP.nodes.quote; + $$1.after(root, [$$1.tn(' '), icon]); + + if (!this.catalogView) { return; } + return ((type === 'Sticky') && this.isClosed ? $$1.prepend : $$1.add)(this.catalogView.nodes.icons, icon.cloneNode()); + } + + kill() { + return this.isDead = true; + } + + collect() { + let n = 0; + this.posts.forEach(function(post) { + if (post.clones.length) { + return n++; + } else { + return post.collect(); + } + }); + if (!n) { + g.threads.rm(this.fullID); + return this.board.threads.rm(this); + } + } + } + + class CatalogThread { + toString() { return this.ID; } + + constructor(root, thread) { + this.thread = thread; + this.ID = this.thread.ID; + this.board = this.thread.board; + const {post} = this.thread.OP.nodes; + this.nodes = { + root, + thumb: $$1('.catalog-thumb', post), + icons: $$1('.catalog-icons', post), + postCount: $$1('.post-count', post), + fileCount: $$1('.file-count', post), + pageCount: $$1('.page-count', post), + replies: null + }; + this.thread.catalogView = this; + } + } + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * DS206: Consider reworking classes to avoid initClass + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + const dialog = function(id, properties) { + const el = $$1.el('div', { + className: 'dialog', + id + } + ); + $$1.extend(el, properties); + el.style.cssText = Conf[`${id}.position`]; + + const move = $$1('.move', el); + $$1.on(move, 'touchstart mousedown', dragstart); + for (var child of move.children) { + if (!child.tagName) { continue; } + $$1.on(child, 'touchstart mousedown', e => e.stopPropagation()); + } + + return el; + }; + + var Menu$1 = (function() { + let currentMenu = undefined; + let lastToggledButton = undefined; + Menu$1 = class Menu { + static initClass() { + currentMenu = null; + lastToggledButton = null; + } + + constructor(type) { + // XXX AddMenuEntry event is deprecated + this.setPosition = this.setPosition.bind(this); + this.close = this.close.bind(this); + this.keybinds = this.keybinds.bind(this); + this.onFocus = this.onFocus.bind(this); + this.addEntry = this.addEntry.bind(this); + this.type = type; + $$1.on(d$1, 'AddMenuEntry', ({detail}) => { + if (detail.type !== this.type) { return; } + delete detail.open; + return this.addEntry(detail); + }); + this.entries = []; + } + + makeMenu() { + const menu = $$1.el('div', { + className: 'dialog', + id: 'menu', + tabIndex: 0 + } + ); + menu.dataset.type = this.type; + $$1.on(menu, 'click', e => e.stopPropagation()); + $$1.on(menu, 'keydown', this.keybinds); + return menu; + } + + toggle(e, button, data) { + e.preventDefault(); + e.stopPropagation(); + + if (currentMenu) { + // Close if it's already opened. + // Reopen if we clicked on another button. + const previousButton = lastToggledButton; + currentMenu.close(); + if (previousButton === button) { return; } + } + + if (!this.entries.length) { return; } + return this.open(button, data); + } + + open(button, data) { + let entry; + const menu = (this.menu = this.makeMenu()); + currentMenu = this; + lastToggledButton = button; + + this.entries.sort((first, second) => first.order - second.order); + + for (entry of this.entries) { + this.insertEntry(entry, menu, data); + } + + $$1.addClass(lastToggledButton, 'active'); + + $$1.on(d$1, 'click CloseMenu', this.close); + $$1.on(d$1, 'scroll', this.setPosition); + $$1.on(window, 'resize', this.setPosition); + $$1.after(button, menu); + + this.setPosition(); + + entry = $$1('.entry', menu); + // We've removed flexbox, so we don't use order anymore. + // while prevEntry = @findNextEntry entry, -1 + // entry = prevEntry + this.focus(entry); + + return menu.focus(); + } + + setPosition() { + const mRect = this.menu.getBoundingClientRect(); + const bRect = lastToggledButton.getBoundingClientRect(); + window.scrollY + bRect.top; + window.scrollX + bRect.left; + const cHeight = doc$1.clientHeight; + const cWidth = doc$1.clientWidth; + const [top, bottom] = Array.from((bRect.top + bRect.height + mRect.height) < cHeight ? + [`${bRect.bottom}px`, ''] + : + ['', `${cHeight - bRect.top}px`]); + const [left, right] = Array.from((bRect.left + mRect.width) < cWidth ? + [`${bRect.left}px`, ''] + : + ['', `${cWidth - bRect.right}px`]); + $$1.extend(this.menu.style, {top, right, bottom, left}); + return this.menu.classList.toggle('left', right); + } + + insertEntry(entry, parent, data) { + let submenu; + if (typeof entry.open === 'function') { + try { + if (!entry.open(data)) { return; } + } catch (err) { + Main$1.handleErrors({ + message: `Error in building the ${this.type} menu.`, + error: err + }); + return; + } + } + $$1.add(parent, entry.el); + + if (!entry.subEntries) { return; } + if (submenu = $$1('.submenu', entry.el)) { + // Reset sub menu, remove irrelevant entries. + $$1.rm(submenu); + } + submenu = $$1.el('div', + {className: 'dialog submenu'}); + for (var subEntry of entry.subEntries) { + this.insertEntry(subEntry, submenu, data); + } + $$1.add(entry.el, submenu); + } + + close() { + $$1.rm(this.menu); + delete this.menu; + $$1.rmClass(lastToggledButton, 'active'); + currentMenu = null; + lastToggledButton = null; + $$1.off(d$1, 'click scroll CloseMenu', this.close); + $$1.off(d$1, 'scroll', this.setPosition); + return $$1.off(window, 'resize', this.setPosition); + } + + findNextEntry(entry, direction) { + const entries = [...Array.from(entry.parentNode.children)]; + entries.sort((first, second) => first.style.order - second.style.order); + return entries[entries.indexOf(entry) + direction]; + } + + keybinds(e) { + let subEntry; + let next, submenu; + let entry = $$1('.focused', this.menu); + while ((subEntry = $$1('.focused', entry))) { + entry = subEntry; + } + + switch (e.keyCode) { + case 27: // Esc + lastToggledButton.focus(); + this.close(); + break; + case 13: case 32: // Enter, Space + entry.click(); + break; + case 38: // Up + if (next = this.findNextEntry(entry, -1)) { + this.focus(next); + } + break; + case 40: // Down + if (next = this.findNextEntry(entry, +1)) { + this.focus(next); + } + break; + case 39: // Right + if ((submenu = $$1('.submenu', entry)) && (next = submenu.firstElementChild)) { + let nextPrev; + while ((nextPrev = this.findNextEntry(next, -1))) { + next = nextPrev; + } + this.focus(next); + } + break; + case 37: // Left + if (next = $$1.x('parent::*[contains(@class,"submenu")]/parent::*', entry)) { + this.focus(next); + } + break; + default: + return; + } + + e.preventDefault(); + return e.stopPropagation(); + } + + onFocus(e) { + e.stopPropagation(); + return this.focus(e.target); + } + + focus(entry) { + let focused, submenu; + while ((focused = $$1.x('parent::*/child::*[contains(@class,"focused")]', entry))) { + $$1.rmClass(focused, 'focused'); + } + for (focused of $$('.focused', entry)) { + $$1.rmClass(focused, 'focused'); + } + $$1.addClass(entry, 'focused'); + + // Submenu positioning. + if (!(submenu = $$1('.submenu', entry))) { return; } + const sRect = submenu.getBoundingClientRect(); + const eRect = entry.getBoundingClientRect(); + const cHeight = doc$1.clientHeight; + const cWidth = doc$1.clientWidth; + const [top, bottom] = Array.from((eRect.top + sRect.height) < cHeight ? + ['0px', 'auto'] + : + ['auto', '0px']); + const [left, right] = Array.from((eRect.right + sRect.width) < (cWidth - 150) ? + ['100%', 'auto'] + : + ['auto', '100%']); + const {style} = submenu; + style.top = top; + style.bottom = bottom; + style.left = left; + return style.right = right; + } + + addEntry(entry) { + this.parseEntry(entry); + return this.entries.push(entry); + } + + parseEntry(entry) { + const {el, subEntries} = entry; + $$1.addClass(el, 'entry'); + $$1.on(el, 'focus mouseover', this.onFocus); + el.style.order = entry.order || 100; + if (!subEntries) { return; } + $$1.addClass(el, 'has-submenu'); + for (var subEntry of subEntries) { + this.parseEntry(subEntry); + } + } + }; + Menu$1.initClass(); + return Menu$1; + })(); + + var dragstart = function (e) { + let isTouching; + if ((e.type === 'mousedown') && (e.button !== 0)) { return; } // not LMB + // prevent text selection + e.preventDefault(); + if (isTouching = e.type === 'touchstart') { + e = e.changedTouches[e.changedTouches.length - 1]; + } + // distance from pointer to el edge is constant; calculate it here. + const el = $$1.x('ancestor::div[contains(@class,"dialog")][1]', this); + const rect = el.getBoundingClientRect(); + const screenHeight = doc$1.clientHeight; + const screenWidth = doc$1.clientWidth; + const o = { + id: el.id, + style: el.style, + dx: e.clientX - rect.left, + dy: e.clientY - rect.top, + height: screenHeight - rect.height, + width: screenWidth - rect.width, + screenHeight, + screenWidth, + isTouching + }; + + [o.topBorder, o.bottomBorder] = Array.from(Conf['Header auto-hide'] || !Conf['Fixed Header'] ? + [0, 0] + : Conf['Bottom Header'] ? + [0, Header$1.bar.getBoundingClientRect().height] + : + [Header$1.bar.getBoundingClientRect().height, 0]); + + if (isTouching) { + o.identifier = e.identifier; + o.move = touchmove.bind(o); + o.up = touchend.bind(o); + $$1.on(d$1, 'touchmove', o.move); + return $$1.on(d$1, 'touchend touchcancel', o.up); + } else { // mousedown + o.move = drag.bind(o); + o.up = dragend.bind(o); + $$1.on(d$1, 'mousemove', o.move); + return $$1.on(d$1, 'mouseup', o.up); + } + }; + + var touchmove = function (e) { + for (var touch of e.changedTouches) { + if (touch.identifier === this.identifier) { + drag.call(this, touch); + return; + } + } + }; + + var drag = function (e) { + const {clientX, clientY} = e; + + let left = clientX - this.dx; + left = left < 10 ? + 0 + : (this.width - left) < 10 ? + '' + : + ((left / this.screenWidth) * 100) + '%'; + + let top = clientY - this.dy; + top = top < (10 + this.topBorder) ? + this.topBorder + 'px' + : (this.height - top) < (10 + this.bottomBorder) ? + '' + : + ((top / this.screenHeight) * 100) + '%'; + + const right = left === '' ? + 0 + : + ''; + + const bottom = top === '' ? + this.bottomBorder + 'px' + : + ''; + + const {style} = this; + style.left = left; + style.right = right; + style.top = top; + return style.bottom = bottom; + }; + + var touchend = function (e) { + for (var touch of e.changedTouches) { + if (touch.identifier === this.identifier) { + dragend.call(this); + return; + } + } + }; + + var dragend = function () { + if (this.isTouching) { + $$1.off(d$1, 'touchmove', this.move); + $$1.off(d$1, 'touchend touchcancel', this.up); + } else { // mouseup + $$1.off(d$1, 'mousemove', this.move); + $$1.off(d$1, 'mouseup', this.up); + } + return $$1.set(`${this.id}.position`, this.style.cssText); + }; + + const hoverstart = function ({ root, el, latestEvent, endEvents, height, width, cb, noRemove }) { + const rect = root.getBoundingClientRect(); + const o = { + root, + el, + style: el.style, + isImage: ['IMG', 'VIDEO'].includes(el.nodeName), + cb, + endEvents, + latestEvent, + clientHeight: doc$1.clientHeight, + clientWidth: doc$1.clientWidth, + height, + width, + noRemove, + clientX: (rect.left + rect.right) / 2, + clientY: (rect.top + rect.bottom) / 2 + }; + o.hover = hover.bind(o); + o.hoverend = hoverend.bind(o); + + o.hover(o.latestEvent); + new MutationObserver(function() { + if (el.parentNode) { return o.hover(o.latestEvent); } + }).observe(el, {childList: true}); + + $$1.on(root, endEvents, o.hoverend); + if ($$1.x('ancestor::div[contains(@class,"inline")][1]', root)) { + $$1.on(d$1, 'keydown', o.hoverend); + } + $$1.on(root, 'mousemove', o.hover); + + // Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=674955 + o.workaround = function(e) { if (!root.contains(e.target)) { return o.hoverend(e); } }; + return $$1.on(doc$1, 'mousemove', o.workaround); + }; + + hoverstart.padding = 25; + + var hover = function (e) { + this.latestEvent = e; + const height = (this.height || this.el.offsetHeight) + hoverstart.padding; + const width = (this.width || this.el.offsetWidth); + const {clientX, clientY} = Conf['Follow Cursor'] ? e : this; + + const top = this.isImage ? + Math.max(0, (clientY * (this.clientHeight - height)) / this.clientHeight) + : + Math.max(0, Math.min(this.clientHeight - height, clientY - 120)); + + let threshold = this.clientWidth / 2; + if (!this.isImage) { threshold = Math.max(threshold, this.clientWidth - 400); } + let marginX = (clientX <= threshold ? clientX : this.clientWidth - clientX) + 45; + if (this.isImage) { marginX = Math.min(marginX, this.clientWidth - width); } + marginX += 'px'; + const [left, right] = Array.from(clientX <= threshold ? [marginX, ''] : ['', marginX]); + + const {style} = this; + style.top = top + 'px'; + style.left = left; + return style.right = right; + }; + + var hoverend = function (e) { + if (((e.type === 'keydown') && (e.keyCode !== 13)) || (e.target.nodeName === "TEXTAREA")) { return; } + if (!this.noRemove) { $$1.rm(this.el); } + $$1.off(this.root, this.endEvents, this.hoverend); + $$1.off(d$1, 'keydown', this.hoverend); + $$1.off(this.root, 'mousemove', this.hover); + // Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=674955 + $$1.off(doc$1, 'mousemove', this.workaround); + if (this.cb) { return this.cb.call(this); } + }; + + const checkbox = function (name, text, checked) { + if (checked == null) { checked = Conf[name]; } + const label = $$1.el('label'); + const input = $$1.el('input', {type: 'checkbox', name, checked}); + $$1.add(label, [input, $$1.tn(` ${text}`)]); + return label; + }; + + const UI = { + dialog, + Menu: Menu$1, + hover: hoverstart, + checkbox + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var Nav = { + init() { + switch (g.VIEW) { + case 'index': + if (!Conf['Index Navigation']) { return; } + break; + case 'thread': + if (!Conf['Reply Navigation']) { return; } + break; + default: + return; + } + + const span = $$1.el('span', + {id: 'navlinks'}); + const prev = $$1.el('a', { + textContent: '▲', + href: 'javascript:;' + } + ); + const next = $$1.el('a', { + textContent: '▼', + href: 'javascript:;' + } + ); + + $$1.on(prev, 'click', this.prev); + $$1.on(next, 'click', this.next); + + $$1.add(span, [prev, $$1.tn(' '), next]); + var append = function() { + $$1.off(d$1, '4chanXInitFinished', append); + return $$1.add(d$1.body, span); + }; + return $$1.on(d$1, '4chanXInitFinished', append); + }, + + prev() { + if (g.VIEW === 'thread') { + return window.scrollTo(0, 0); + } else { + return Nav.scroll(-1); + } + }, + + next() { + if (g.VIEW === 'thread') { + return window.scrollTo(0, d$1.body.scrollHeight); + } else { + return Nav.scroll(+1); + } + }, + + getThread() { + if (g.VIEW === 'thread') { return g.threads.get(`${g.BOARD}.${g.THREADID}`).nodes.root; } + if ($$1.hasClass(doc$1, 'catalog-mode')) { return; } + for (var threadRoot of $$(g.SITE.selectors.thread)) { + var thread = Get$1.threadFromRoot(threadRoot); + if (thread.isHidden && !thread.stub) { continue; } + if (Header$1.getTopOf(threadRoot) >= -threadRoot.getBoundingClientRect().height) { // not scrolled past + return threadRoot; + } + } + }, + + scroll(delta) { + let next; + d$1.activeElement?.blur(); + let thread = Nav.getThread(); + if (!thread) { return; } + const axis = delta === +1 ? + 'following' + : + 'preceding'; + if (next = $$1.x(`${axis}-sibling::${g.SITE.xpath.thread}[not(@hidden)][1]`, thread)) { + // Unless we're not at the beginning of the current thread, + // and thus wanting to move to beginning, + // or we're above the first thread and don't want to skip it. + const top = Header$1.getTopOf(thread); + if (((delta === +1) && (top < 5)) || ((delta === -1) && (top > -5))) { thread = next; } + } + // Add extra space to the end of the page if necessary so that all threads can be selected by keybinds. + const extra = (Header$1.getTopOf(thread) + doc$1.clientHeight) - d$1.body.getBoundingClientRect().bottom; + if (extra > 0) { d$1.body.style.marginBottom = `${extra}px`; } + + Header$1.scrollTo(thread); + + if ((extra > 0) && !Nav.haveExtra) { + Nav.haveExtra = true; + return $$1.on(d$1, 'scroll', Nav.removeExtra); + } + }, + + removeExtra() { + const extra = doc$1.clientHeight - d$1.body.getBoundingClientRect().bottom; + if (extra > 0) { + return d$1.body.style.marginBottom = `${extra}px`; + } else { + d$1.body.style.marginBottom = ''; + delete Nav.haveExtra; + return $$1.off(d$1, 'scroll', Nav.removeExtra); + } + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var ImageHost = { + init() { + if ((!(this.useFaster = /\S/.test(Conf['fourchanImageHost']))) || (g.SITE.software !== 'yotsuba') || !['index', 'thread'].includes(g.VIEW)) { return; } + return Callbacks.Post.push({ + name: 'Image Host Rewriting', + cb: this.node + }); + }, + + suggestions: ['i.4cdn.org', 'is2.4chan.org'], + + host() { + return Conf['fourchanImageHost'].trim() || 'i.4cdn.org'; + }, + flashHost() { + return 'i.4cdn.org'; + }, + thumbHost() { + return 'i.4cdn.org'; + }, + test(hostname) { + return (hostname === 'i.4cdn.org') || ImageHost.regex.test(hostname); + }, + + regex: /^is\d*\.4chan(?:nel)?\.org$/, + + node() { + if (this.isClone) { return; } + const host = ImageHost.host(); + if (this.file && ImageHost.test(this.file.url.split('/')[2]) && !/\.swf$/.test(this.file.url)) { + this.file.link.hostname = host; + if (this.file.thumbLink) { this.file.thumbLink.hostname = host; } + this.file.url = this.file.link.href; + } + return ImageHost.fixLinks($$('a', this.nodes.comment)); + }, + + fixLinks(links) { + for (var link of links) { + if (ImageHost.test(link.hostname) && !/\.swf$/.test(link.pathname)) { + var host = ImageHost.host(); + if (link.hostname !== host) { link.hostname = host; } + } + } + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var Volume = { + init() { + if (!['index', 'thread'].includes(g.VIEW) || + (!Conf['Image Expansion'] && !Conf['Image Hover'] && !Conf['Image Hover in Catalog'] && !Conf['Gallery'])) { return; } + + $$1.sync('Allow Sound', function(x) { + Conf['Allow Sound'] = x; + if (Volume.inputs) Volume.inputs.unmute.checked = x; + }); + + $$1.sync('Default Volume', function(x) { + Conf['Default Volume'] = x; + if (Volume.inputs) Volume.inputs.volume.value = x; + }); + + if (Conf['Mouse Wheel Volume']) { + Callbacks.Post.push({ + name: 'Mouse Wheel Volume', + cb: this.node + }); + } + + if (g.SITE.noAudio?.(g.BOARD)) { return; } + + if (Conf['Mouse Wheel Volume']) { + Callbacks.CatalogThread.push({ + name: 'Mouse Wheel Volume', + cb: this.catalogNode + }); + } + + const unmuteEntry = UI.checkbox('Allow Sound', 'Allow Sound'); + unmuteEntry.title = Config.main['Images and Videos']['Allow Sound'][1]; + + const volumeEntry = $$1.el('label', + {title: 'Default volume for videos.'}); + $$1.extend(volumeEntry, + {innerHTML: " Volume"}); + + this.inputs = { + unmute: unmuteEntry.firstElementChild, + volume: volumeEntry.firstElementChild + }; + + $$1.on(this.inputs.unmute, 'change', $$1.cb.checked); + $$1.on(this.inputs.volume, 'change', $$1.cb.value); + + Header$1.menu.addEntry({el: unmuteEntry, order: 200}); + return Header$1.menu.addEntry({el: volumeEntry, order: 201}); + }, + + setup(video) { + video.muted = !Conf['Allow Sound']; + video.volume = Conf['Default Volume']; + return $$1.on(video, 'volumechange', Volume.change); + }, + + change() { + const {muted, volume} = this; + const items = { + 'Allow Sound': !muted, + 'Default Volume': volume + }; + for (var key in items) { + var val = items[key]; + if (Conf[key] === val) { + delete items[key]; + } + } + $$1.set(items); + $$1.extend(Conf, items); + if (Volume.inputs) { + Volume.inputs.unmute.checked = !muted; + return Volume.inputs.volume.value = volume; + } + }, + + node() { + if (g.SITE.noAudio?.(this.board)) { return; } + for (var file of this.files) { + if (file.isVideo) { + if (file.thumb) { $$1.on(file.thumb, 'wheel', Volume.wheel.bind(Header$1.hover)); } + $$1.on(($$1('.file-info', file.text) || file.link), 'wheel', Volume.wheel.bind(file.thumbLink)); + } + } + }, + + catalogNode() { + const file = this.thread.OP.files[0]; + if (!file?.isVideo) { return; } + return $$1.on(this.nodes.thumb, 'wheel', Volume.wheel.bind(Header$1.hover)); + }, + + wheel(e) { + let el; + if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) { return; } + if (!(el = $$1('video:not([data-md5])', this))) { return; } + if (el.muted || !$$1.hasAudio(el)) { return; } + let volume = el.volume + 0.1; + if (e.deltaY < 0) { volume *= 1.1; } + if (e.deltaY > 0) { volume /= 1.1; } + el.volume = $$1.minmax(volume - 0.1, 0, 1); + return e.preventDefault(); + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS104: Avoid inline assignments + * DS204: Change includes calls to have a more natural evaluation order + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var ImageCommon = { + // Pause and mute video in preparation for removing the element from the document. + pause(video) { + if (video.nodeName !== 'VIDEO') { return; } + video.pause(); + $$1.off(video, 'volumechange', Volume.change); + return video.muted = true; + }, + + rewind(el) { + if (el.nodeName === 'VIDEO') { + if (el.readyState >= el.HAVE_METADATA) { return el.currentTime = 0; } + } else if (/\.gif$/.test(el.src)) { + return $$1.queueTask(() => el.src = el.src); + } + }, + + pushCache(el) { + ImageCommon.cache = el; + return $$1.on(el, 'error', ImageCommon.cacheError); + }, + + popCache() { + const el = ImageCommon.cache; + $$1.off(el, 'error', ImageCommon.cacheError); + delete ImageCommon.cache; + return el; + }, + + cacheError() { + if (ImageCommon.cache === this) { return delete ImageCommon.cache; } + }, + + decodeError(file, fileObj) { + let message; + if (file.error?.code !== MediaError.MEDIA_ERR_DECODE) { return false; } + if (!(message = $$1('.warning', fileObj.thumb.parentNode))) { + message = $$1.el('div', {className: 'warning'}); + $$1.after(fileObj.thumb, message); + } + message.textContent = 'Error: Corrupt or unplayable video'; + return true; + }, + + isFromArchive(file) { + return (g.SITE.software === 'yotsuba') && !ImageHost.test(file.src.split('/')[2]); + }, + + error(file, post, fileObj, delay, cb) { + let timeoutID; + const src = fileObj.url.split('/'); + let url = null; + if ((g.SITE.software === 'yotsuba') && Conf['404 Redirect']) { + url = Redirect$1.to('file', { + boardID: post.board.ID, + filename: src[src.length - 1] + }); + } + if (!url || !Redirect$1.securityCheck(url)) { url = null; } + + if ((post.isDead || fileObj.isDead) && !ImageCommon.isFromArchive(file)) { return cb(url); } + + if (delay != null) { timeoutID = setTimeout((() => cb(url)), delay); } + if (post.isDead || fileObj.isDead) { return; } + const redirect = function() { + if (!ImageCommon.isFromArchive(file)) { + if (delay != null) { clearTimeout(timeoutID); } + return cb(url); + } + }; + + const threadJSON = g.SITE.urls.threadJSON?.(post); + if (!threadJSON) { return; } + var parseJSON = function(isArchiveURL) { + let needle, postObj; + if (this.status === 404) { + let archivedThreadJSON; + if (!isArchiveURL && (archivedThreadJSON = g.SITE.urls.archivedThreadJSON?.(post))) { + $$1.ajax(archivedThreadJSON, {onloadend() { return parseJSON.call(this, true); }}); + } else { + post.kill(!post.isClone, fileObj.index); + } + } + if (this.status !== 200) { return redirect(); } + for (postObj of this.response.posts) { + if (postObj.no === post.ID) { break; } + } + if (postObj.no !== post.ID) { + post.kill(); + return redirect(); + } else if ((needle = fileObj.docIndex, g.SITE.Build.parseJSON(postObj, post.board).filesDeleted.includes(needle))) { + post.kill(true); + return redirect(); + } else { + return url = fileObj.url; + } + }; + return $$1.ajax(threadJSON, {onloadend() { return parseJSON.call(this); }}); + }, + + // Add controls, but not until the mouse is moved over the video. + addControls(video) { + var handler = function() { + $$1.off(video, 'mouseover', handler); + // Hacky workaround for Firefox forever-loading bug for very short videos + const t = new Date().getTime(); + return $$1.asap((() => ($$1.engine !== 'gecko') || ((video.readyState >= 3) && (video.currentTime <= Math.max(0.1, (video.duration - 0.5)))) || (new Date().getTime() >= (t + 1000))), () => video.controls = true); + }; + return $$1.on(video, 'mouseover', handler); + }, + + // XXX Estimate whether clicks are on the video controls and should be ignored. + onControls(e) { + return (Conf['Show Controls'] && Conf['Click Passthrough'] && (e.target.nodeName === 'VIDEO')) || + (e.target.controls && ((e.target.getBoundingClientRect().bottom - e.clientY) < 35)); + }, + + download(e) { + if (this.protocol === 'blob:') { return true; } + e.preventDefault(); + const {href, download} = this; + return CrossOrigin$1.file(href, function(blob) { + if (blob) { + const a = $$1.el('a', { + href: URL.createObjectURL(blob), + download, + hidden: true + } + ); + $$1.add(d$1.body, a); + a.click(); + return $$1.rm(a); + } else { + return new Notice('warning', `Could not download ${href}`, 20); + } + }); + } + }; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var ImageExpand = { + init() { + if (!(this.enabled = Conf['Image Expansion'] && ['index', 'thread'].includes(g.VIEW))) { return; } + + this.EAI = $$1.el('a', { + className: 'expand-all-shortcut', + textContent: '➕︎', + title: 'Expand All Images', + href: 'javascript:;' + } + ); + + $$1.on(this.EAI, 'click', this.cb.toggleAll); + Header$1.addShortcut('expand-all', this.EAI, 520); + $$1.on(d$1, 'scroll visibilitychange', this.cb.playVideos); + this.videoControls = $$1.el('span', {className: 'video-controls'}); + $$1.extend(this.videoControls, {innerHTML: " contract"}); + + return Callbacks.Post.push({ + name: 'Image Expansion', + cb: this.node + }); + }, + + node() { + if (!this.file || (!this.file.isImage && !this.file.isVideo)) { return; } + $$1.on(this.file.thumbLink, 'click', ImageExpand.cb.toggle); + + if (this.isClone) { + if (this.file.isExpanding) { + // If we clone a post where the image is still loading, + // make it loading in the clone too. + ImageExpand.contract(this); + return ImageExpand.expand(this); + + } else if (this.file.isExpanded && this.file.isVideo) { + Volume.setup(this.file.fullImage); + ImageExpand.setupVideoCB(this); + return ImageExpand.setupVideo(this, !this.origin.file.fullImage?.paused || this.origin.file.wasPlaying, this.file.fullImage.controls); + } + + } else if (ImageExpand.on && !this.isHidden && !this.isFetchedQuote && + (Conf['Expand spoilers'] || !this.file.isSpoiler) && + (Conf['Expand videos'] || !this.file.isVideo)) { + return ImageExpand.expand(this); + } + }, + + cb: { + toggle(e) { + if ($$1.modifiedClick(e)) { return; } + const post = Get$1.postFromNode(this); + const {file} = post; + if (file.isExpanded && ImageCommon.onControls(e)) { return; } + e.preventDefault(); + if (!Conf['Autoplay'] && file.fullImage?.paused) { + return file.fullImage.play(); + } else { + return ImageExpand.toggle(post); + } + }, + + toggleAll() { + let func; + $$1.event('CloseMenu'); + const threadRoot = Nav.getThread(); + const toggle = function(post) { + const {file} = post; + if (!file || (!file.isImage && !file.isVideo) || !doc$1.contains(post.nodes.root)) { return; } + if (ImageExpand.on && + ((!Conf['Expand spoilers'] && file.isSpoiler) || + (!Conf['Expand videos'] && file.isVideo) || + (Conf['Expand from here'] && (Header$1.getTopOf(file.thumb) < 0)) || + (Conf['Expand thread only'] && (g.VIEW === 'index') && !threadRoot?.contains(file.thumb)))) { + return; + } + return $$1.queueTask(func, post); + }; + + if (ImageExpand.on = $$1.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) { + ImageExpand.EAI.className = 'contract-all-shortcut'; + ImageExpand.EAI.title = 'Contract All Images'; + ImageExpand.EAI.textContent = '➖︎'; + func = ImageExpand.expand; + } else { + ImageExpand.EAI.className = 'expand-all-shortcut'; + ImageExpand.EAI.title = 'Expand All Images'; + ImageExpand.EAI.textContent = '➕︎'; + func = ImageExpand.contract; + } + + return g.posts.forEach(function(post) { + for (post of [post, ...Array.from(post.clones)]) { toggle(post); } + }); + }, + + playVideos() { + return g.posts.forEach(function(post) { + for (post of [post, ...Array.from(post.clones)]) { + var {file} = post; + if (!file || !file.isVideo || !file.isExpanded) { continue; } + + var video = file.fullImage; + var visible = ($$1.hasAudio(video) && !video.muted) || Header$1.isNodeVisible(video); + if (visible && file.wasPlaying) { + delete file.wasPlaying; + video.play(); + } else if (!visible && !video.paused) { + file.wasPlaying = true; + video.pause(); + } + } + }); + }, + + setFitness() { + return $$1[this.checked ? 'addClass' : 'rmClass'](doc$1, this.name.toLowerCase().replace(/\s+/g, '-')); + } + }, + + toggle(post) { + if (!post.file.isExpanding && !post.file.isExpanded) { + post.file.scrollIntoView = Conf['Scroll into view']; + ImageExpand.expand(post); + return; + } + + ImageExpand.contract(post); + + if (Conf['Advance on contract']) { + let next = post.nodes.root; + while ((next = $$1.x("following::div[contains(@class,'postContainer')][1]", next))) { + if (!$$1('.stub', next) && (next.offsetHeight !== 0)) { break; } + } + if (next) { + return Header$1.scrollTo(next); + } + } + }, + + contract(post) { + let bottom, el, oldHeight, scrollY; + const {file} = post; + + if (el = file.fullImage) { + const top = Header$1.getTopOf(el); + bottom = top + el.getBoundingClientRect().height; + oldHeight = d$1.body.clientHeight; + ({scrollY} = window); + } + + $$1.rmClass(post.nodes.root, 'expanded-image'); + $$1.rmClass(file.thumb, 'expanding'); + $$1.rm(file.videoControls); + file.thumbLink.href = file.url; + file.thumbLink.target = '_blank'; + for (var x of ['isExpanding', 'isExpanded', 'videoControls', 'wasPlaying', 'scrollIntoView']) { + delete file[x]; + } + + if (!el) { return; } + + if (doc$1.contains(el)) { + if (bottom <= 0) { + // For images entirely above us, scroll to remain in place. + window.scrollBy(0, ((scrollY - window.scrollY) + d$1.body.clientHeight) - oldHeight); + } else { + // For images not above us that would be moved above us, scroll to the thumbnail. + Header$1.scrollToIfNeeded(post.nodes.root); + } + if (window.scrollX > 0) { + // If we have scrolled right viewing an expanded image, return to the left. + window.scrollBy(-window.scrollX, 0); + } + } + + $$1.off(el, 'error', ImageExpand.error); + ImageCommon.pushCache(el); + if (file.isVideo) { + ImageCommon.pause(el); + for (var eventName in ImageExpand.videoCB) { + var cb = ImageExpand.videoCB[eventName]; + $$1.off(el, eventName, cb); + } + } + if (Conf['Restart when Opened']) { ImageCommon.rewind(file.thumb); } + delete file.fullImage; + return $$1.queueTask(function() { + // XXX Work around Chrome/Chromium not firing mouseover on the thumbnail. + if (file.isExpanding || file.isExpanded) { return; } + $$1.rmClass(el, 'full-image'); + if (el.id) { return; } + return $$1.rm(el); + }); + }, + + expand(post, src) { + // Do not expand images of hidden/filtered replies, or already expanded pictures. + let el; + const {file} = post; + const {thumb, thumbLink, isVideo} = file; + if (post.isHidden || file.isExpanding || file.isExpanded) { return; } + + $$1.addClass(thumb, 'expanding'); + file.isExpanding = true; + + if (file.fullImage) { + el = file.fullImage; + } else if (ImageCommon.cache?.dataset.fileID === `${post.fullID}.${file.index}`) { + el = (file.fullImage = ImageCommon.popCache()); + $$1.on(el, 'error', ImageExpand.error); + if (Conf['Restart when Opened'] && (el.id !== 'ihover')) { ImageCommon.rewind(el); } + el.removeAttribute('id'); + } else { + el = (file.fullImage = $$1.el((isVideo ? 'video' : 'img'))); + el.dataset.fileID = `${post.fullID}.${file.index}`; + $$1.on(el, 'error', ImageExpand.error); + el.src = src || file.url; + } + + el.className = 'full-image'; + $$1.after(thumb, el); + + if (isVideo) { + // add contract link to file info + if (!file.videoControls) { + file.videoControls = ImageExpand.videoControls.cloneNode(true); + $$1.add(file.text, file.videoControls); + } + + // disable link to file so native controls can work + thumbLink.removeAttribute('href'); + thumbLink.removeAttribute('target'); + + el.loop = true; + Volume.setup(el); + ImageExpand.setupVideoCB(post); + } + + if (!isVideo) { + return $$1.asap((() => el.naturalHeight), () => ImageExpand.completeExpand(post)); + } else if (el.readyState >= el.HAVE_METADATA) { + return ImageExpand.completeExpand(post); + } else { + return $$1.on(el, 'loadedmetadata', () => ImageExpand.completeExpand(post)); + } + }, + + completeExpand(post) { + const {file} = post; + if (!file.isExpanding) { return; } // contracted before the image loaded + + const bottom = Header$1.getTopOf(file.thumb) + file.thumb.getBoundingClientRect().height; + const oldHeight = d$1.body.clientHeight; + const {scrollY} = window; + + $$1.addClass(post.nodes.root, 'expanded-image'); + $$1.rmClass(file.thumb, 'expanding'); + file.isExpanded = true; + delete file.isExpanding; + + // Scroll to keep our place in the thread when images are expanded above us. + if (doc$1.contains(post.nodes.root) && (bottom <= 0)) { + window.scrollBy(0, ((scrollY - window.scrollY) + d$1.body.clientHeight) - oldHeight); + } + + // Scroll to display full image. + if (file.scrollIntoView) { + delete file.scrollIntoView; + const imageBottom = Math.min(doc$1.clientHeight - file.fullImage.getBoundingClientRect().bottom - 25, Header$1.getBottomOf(file.fullImage)); + if (imageBottom < 0) { + window.scrollBy(0, Math.min(-imageBottom, Header$1.getTopOf(file.fullImage))); + } + } + + if (file.isVideo) { + return ImageExpand.setupVideo(post, Conf['Autoplay'], Conf['Show Controls']); + } + }, + + setupVideo(post, playing, controls) { + const {fullImage} = post.file; + if (!playing) { + fullImage.controls = controls; + return; + } + fullImage.controls = false; + $$1.asap((() => doc$1.contains(fullImage)), function() { + if (!d$1.hidden && Header$1.isNodeVisible(fullImage)) { + return fullImage.play(); + } else { + return post.file.wasPlaying = true; + } + }); + if (controls) { + return ImageCommon.addControls(fullImage); + } + }, + + videoCB: (function() { + // dragging to the left contracts the video + let mousedown = false; + return { + mouseover() { return mousedown = false; }, + mousedown(e) { if (e.button === 0) { return mousedown = true; } }, + mouseup(e) { if (e.button === 0) { return mousedown = false; } }, + mouseout(e) { if (((e.buttons & 1) || mousedown) && (e.clientX <= this.getBoundingClientRect().left)) { return ImageExpand.toggle(Get$1.postFromNode(this)); } } + }; + })(), + + setupVideoCB(post) { + for (var eventName in ImageExpand.videoCB) { + var cb = ImageExpand.videoCB[eventName]; + $$1.on(post.file.fullImage, eventName, cb); + } + if (post.file.videoControls) { + return $$1.on(post.file.videoControls.firstElementChild, 'click', () => ImageExpand.toggle(post)); + } + }, + + error() { + const post = Get$1.postFromNode(this); + $$1.rm(this); + delete post.file.fullImage; + // Images can error: + // - before the image started loading. + // - after the image started loading. + // Don't try to re-expand if it was already contracted. + if (!post.file.isExpanding && !post.file.isExpanded) { return; } + if (ImageCommon.decodeError(this, post.file)) { + return ImageExpand.contract(post); + } + // Don't autoretry images from the archive. + if (ImageCommon.isFromArchive(this)) { + return ImageExpand.contract(post); + } + return ImageCommon.error(this, post, post.file, 10 * SECOND, function(URL) { + if (post.file.isExpanding || post.file.isExpanded) { + ImageExpand.contract(post); + if (URL) { return ImageExpand.expand(post, URL); } + } + }); + }, + + menu: { + init() { + if (!ImageExpand.enabled) { return; } + + const el = $$1.el('span', { + textContent: 'Image Expansion', + className: 'image-expansion-link' + } + ); + + const {createSubEntry} = ImageExpand.menu; + const subEntries = []; + for (var name in Config.imageExpansion) { + var conf = Config.imageExpansion[name]; + subEntries.push(createSubEntry(name, conf[1])); + } + + return Header$1.menu.addEntry({ + el, + order: 105, + subEntries + }); + }, + + createSubEntry(name, desc) { + const label = UI.checkbox(name, name); + label.title = desc; + const input = label.firstElementChild; + if (['Fit width', 'Fit height'].includes(name)) { + $$1.on(input, 'change', ImageExpand.cb.setFitness); + } + $$1.event('change', null, input); + $$1.on(input, 'change', $$1.cb.checked); + return {el: label}; + } + } + }; + + class Post { + toString() { return this.ID; } + constructor(root, thread, board, flags = {}) { + // <% if (readJSON('/.tests_enabled')) { %> + // @normalizedOriginal = Test.normalize root + // <% } %> + // Skip initialization for PostClone + if (root === undefined && thread === undefined && board === undefined) + return; + this.root = root; + this.thread = thread; + this.board = board; + $$1.extend(this, flags); + this.ID = +root.id.match(/\d*$/)[0]; + this.postID = this.ID; + this.threadID = this.thread.ID; + this.boardID = this.board.ID; + this.siteID = g.SITE.ID; + this.fullID = `${this.board}.${this.ID}`; + this.context = this; + this.isReply = (this.ID !== this.threadID); + root.dataset.fullID = this.fullID; + this.nodes = this.parseNodes(root); + if (!this.isReply) { + this.thread.OP = this; + for (var key of ['isSticky', 'isClosed', 'isArchived']) { + var selector; + if (selector = g.SITE.selectors.icons[key]) { + this.thread[key] = !!$$1(selector, this.nodes.info); + } + } + if (this.thread.isArchived) { + this.thread.isClosed = true; + this.thread.kill(); + } + } + const name = this.nodes.name?.textContent; + const tripcode = this.nodes.tripcode?.textContent; + this.info = { + subject: this.nodes.subject?.textContent || undefined, + name, + email: this.nodes.email ? decodeURIComponent(this.nodes.email.href.replace(/^mailto:/, '')) : undefined, + tripcode, + uniqueID: this.nodes.uniqueID?.textContent, + capcode: this.nodes.capcode?.textContent.replace('## ', ''), + pass: this.nodes.pass?.title.match(/\d*$/)[0], + flagCode: this.nodes.flag?.className.match(/flag-(\w+)/)?.[1].toUpperCase(), + flagCodeTroll: this.nodes.flag?.className.match(/bfl-(\w+)/)?.[1].toUpperCase(), + flag: this.nodes.flag?.title, + date: this.nodes.date ? g.SITE.parseDate(this.nodes.date) : undefined, + nameBlock: Conf['Anonymize'] ? 'Anonymous' : `${name || ''} ${tripcode || ''}`.trim(), + }; + if (this.info.capcode) { + this.info.nameBlock += ` ## ${this.info.capcode}`; + } + if (this.info.uniqueID) { + this.info.nameBlock += ` (ID: ${this.info.uniqueID})`; + } + this.parseComment(); + this.parseQuotes(); + this.parseFiles(); + this.isDead = false; + this.isHidden = false; + this.clones = []; + // <% if (readJSON('/.tests_enabled')) { %> + // return if @forBuildTest + // <% } %> + if (g.posts.get(this.fullID)) { + this.isRebuilt = true; + this.clones = g.posts.get(this.fullID).clones; + for (var clone of this.clones) { + clone.origin = this; + } + } + if (!this.isFetchedQuote && (this.ID > this.thread.lastPost)) { + this.thread.lastPost = this.ID; + } + this.board.posts.push(this.ID, this); + this.thread.posts.push(this.ID, this); + g.posts.push(this.fullID, this); + this.isFetchedQuote = false; + this.isClone = false; + } + parseNodes(root) { + const s = g.SITE.selectors; + const post = $$1(s.post, root) || root; + const info = $$1(s.infoRoot, post); + const nodes = { + root, + bottom: this.isReply || !g.SITE.isOPContainerThread ? root : $$1(s.opBottom, root), + post, + info, + comment: $$1(s.comment, post), + quotelinks: [], + archivelinks: [], + embedlinks: [], + backlinks: post.getElementsByClassName('backlink'), + uniqueIDRoot: undefined, + uniqueID: undefined, + }; + for (var key in s.info) { + var selector = s.info[key]; + nodes[key] = $$1(selector, info); + } + g.SITE.parseNodes?.(this, nodes); + if (!nodes.uniqueIDRoot) { + nodes.uniqueIDRoot = nodes.uniqueID; + } + return nodes; + } + parseComment() { + // Merge text nodes and remove empty ones. + let bq; + this.nodes.comment.normalize(); + // Get the comment's text. + //
            -> \n + // Remove: + // 'Comment too long'... + // EXIF data. (/p/) + this.nodes.commentClean = (bq = this.nodes.comment.cloneNode(true)); + g.SITE.cleanComment?.(bq); + return this.info.comment = this.nodesToText(bq); + } + commentDisplay() { + // Get the comment's text for display purposes (e.g. notifications, excerpts). + // In addition to what's done in generating `@info.comment`, remove: + // Spoilers. (filter to '[spoiler]') + // Rolls. (/tg/, /qst/) + // Fortunes. (/s4s/) + // Preceding and following new lines. + // Trailing spaces. + const bq = this.nodes.commentClean.cloneNode(true); + if (!Conf['Remove Spoilers'] && !Conf['Reveal Spoilers']) { + this.cleanSpoilers(bq); + } + g.SITE.cleanCommentDisplay?.(bq); + return this.nodesToText(bq).trim().replace(/\s+$/gm, ''); + } + commentOrig() { + // Get the comment's text for reposting purposes. + const bq = this.nodes.commentClean.cloneNode(true); + g.SITE.insertTags?.(bq); + return this.nodesToText(bq); + } + nodesToText(bq) { + let node; + let text = ""; + const nodes = $$1.X('.//br|.//text()', bq); + let i = 0; + while ((node = nodes.snapshotItem(i++))) { + text += node.data || '\n'; + } + return text; + } + cleanSpoilers(bq) { + const spoilers = $$(g.SITE.selectors.spoiler, bq); + for (var node of spoilers) { + $$1.replace(node, $$1.tn('[spoiler]')); + } + } + parseQuotes() { + this.quotes = []; + for (var quotelink of $$(g.SITE.selectors.quotelink, this.nodes.comment)) { + this.parseQuote(quotelink); + } + } + parseQuote(quotelink) { + // Only add quotes that link to posts on an imageboard. + // Don't add: + // - board links. (>>>/b/) + // - catalog links. (>>>/b/catalog or >>>/b/search) + // - rules links. (>>>/a/rules) + // - text-board quotelinks. (>>>/img/1234) + const match = quotelink.href.match(g.SITE.regexp.quotelink); + if (!match && (!this.isClone || !quotelink.dataset.postID)) { + return; + } // normal or resurrected quote + this.nodes.quotelinks.push(quotelink); + if (this.isClone) { + return; + } + // ES6 Set when? + const fullID = `${match[1]}.${match[3]}`; + if (!this.quotes.includes(fullID)) + this.quotes.push(fullID); + } + parseFiles() { + let file; + this.files = []; + const fileRoots = this.fileRoots(); + let index = 0; + for (let docIndex = 0; docIndex < fileRoots.length; docIndex++) { + var fileRoot = fileRoots[docIndex]; + if (file = this.parseFile(fileRoot)) { + file.index = (index++); + file.docIndex = docIndex; + this.files.push(file); + } + } + if (this.files.length) { + return this.file = this.files[0]; + } + } + fileRoots() { + if (g.SITE.selectors.multifile) { + const roots = $$(g.SITE.selectors.multifile, this.nodes.root); + if (roots.length) { + return roots; + } + } + return [this.nodes.root]; + } + parseFile(fileRoot) { + const file = { isDead: false }; + for (var key in g.SITE.selectors.file) { + var selector = g.SITE.selectors.file[key]; + file[key] = $$1(selector, fileRoot); + } + file.thumbLink = file.thumb?.parentNode; + if (!(file.text && file.link)) { + return; + } + if (!g.SITE.parseFile(this, file)) { + return; + } + $$1.extend(file, { + url: file.link.href, + isImage: $$1.isImage(file.link.href), + isVideo: $$1.isVideo(file.link.href) + }); + let size = +file.size.match(/[\d.]+/)[0]; + let unit = ['B', 'KB', 'MB', 'GB'].indexOf(file.size.match(/\w+$/)[0]); + while (unit-- > 0) { + size *= 1024; + } + file.sizeInBytes = size; + return file; + } + kill(file, index = 0) { + let strong; + if (file) { + if (this.isDead || this.files[index].isDead) { + return; + } + this.files[index].isDead = true; + $$1.addClass(this.nodes.root, 'deleted-file'); + } + else { + if (this.isDead) { + return; + } + this.isDead = true; + $$1.rmClass(this.nodes.root, 'deleted-file'); + $$1.addClass(this.nodes.root, 'deleted-post'); + } + if (!(strong = $$1('strong.warning', this.nodes.info))) { + strong = $$1.el('strong', { className: 'warning' }); + $$1.after($$1('input', this.nodes.info), strong); + } + strong.textContent = file ? '[File deleted]' : '[Deleted]'; + if (this.isClone) { + return; + } + for (var clone of this.clones) { + clone.kill(file, index); + } + if (file) { + return; + } + // Get quotelinks/backlinks to this post + // and paint them (Dead). + for (var quotelink of Get$1.allQuotelinksLinkingTo(this)) { + if (!$$1.hasClass(quotelink, 'deadlink')) { + $$1.add(quotelink, Post.deadMark.cloneNode(true)); + $$1.addClass(quotelink, 'deadlink'); + } + } + } + // XXX Workaround for 4chan's racing condition + // giving us false-positive dead posts. + resurrect() { + this.isDead = false; + $$1.rmClass(this.nodes.root, 'deleted-post'); + const strong = $$1('strong.warning', this.nodes.info); + // no false-positive files + if (this.files.some(file => file.isDead)) { + $$1.addClass(this.nodes.root, 'deleted-file'); + strong.textContent = '[File deleted]'; + } + else { + $$1.rm(strong); + } + if (this.isClone) { + return; + } + for (var clone of this.clones) { + clone.resurrect(); + } + for (var quotelink of Get$1.allQuotelinksLinkingTo(this)) { + if ($$1.hasClass(quotelink, 'deadlink')) { + $$1.rm($$1('.qmark-dead', quotelink)); + $$1.rmClass(quotelink, 'deadlink'); + } + } + } + collect() { + g.posts.rm(this.fullID); + this.thread.posts.rm(this); + this.board.posts.rm(this); + } + addClone(context, contractThumb) { + // Callbacks may not have been run yet due to anti-browser-lock delay in Main.callbackNodesDB. + Callbacks.Post.execute(this); + return new PostClone(this, context, contractThumb); + } + rmClone(index) { + this.clones.splice(index, 1); + for (var clone of this.clones.slice(index)) { + clone.nodes.root.dataset.clone = index++; + } + } + setCatalogOP(isCatalogOP) { + this.nodes.root.classList.toggle('catalog-container', isCatalogOP); + this.nodes.root.classList.toggle('opContainer', !isCatalogOP); + this.nodes.post.classList.toggle('catalog-post', isCatalogOP); + this.nodes.post.classList.toggle('op', !isCatalogOP); + this.nodes.post.style.left = (this.nodes.post.style.right = null); + } + } + // because of a circular dependency $ might not be initialized, so we can't use $.el + Post.deadMark = (() => { + const el = document.createElement('span'); + // \u00A0 is nbsp + el.textContent = '\u00A0(Dead)'; + el.className = 'qmark-dead'; + return el; + })(); + class PostClone extends Post { + constructor(origin, context, contractThumb) { + super(); + this.isClone = true; + let file, fileRoots, key; + this.origin = origin; + this.context = context; + for (key of ['ID', 'postID', 'threadID', 'boardID', 'siteID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply']) { + // Copy or point to the origin's key value. + this[key] = this.origin[key]; + } + const { nodes } = this.origin; + const root = contractThumb ? this.cloneWithoutVideo(nodes.root) : nodes.root.cloneNode(true); + for (var node of [root, ...$$('[id]', root)]) { + node.id += `_${PostClone.suffix}`; + } + PostClone.suffix++; + // Remove inlined posts inside of this post. + for (var inline of $$('.inline', root)) { + $$1.rm(inline); + } + for (var inlined of $$('.inlined', root)) { + $$1.rmClass(inlined, 'inlined'); + } + this.nodes = this.parseNodes(root); + root.hidden = false; // post hiding + $$1.rmClass(root, 'forwarded'); // quote inlining + $$1.rmClass(this.nodes.post, 'highlight'); // keybind navigation, ID highlighting + // Remove catalog stuff. + if (!this.isReply) { + this.setCatalogOP(false); + $$1.rm($$1('.catalog-link', this.nodes.post)); + $$1.rm($$1('.catalog-stats', this.nodes.post)); + $$1.rm($$1('.catalog-replies', this.nodes.post)); + } + this.parseQuotes(); + this.quotes = [...this.origin.quotes]; + this.files = []; + if (this.origin.files.length) { + fileRoots = this.fileRoots(); + } + for (var originFile of this.origin.files) { + // Copy values, point to relevant elements. + file = { ...originFile }; + var fileRoot = fileRoots[file.docIndex]; + for (key in g.SITE.selectors.file) { + var selector = g.SITE.selectors.file[key]; + file[key] = $$1(selector, fileRoot); + } + file.thumbLink = file.thumb?.parentNode; + if (file.thumbLink) { + file.fullImage = $$1('.full-image', file.thumbLink); + } + file.videoControls = $$1('.video-controls', file.text); + if (file.videoThumb) { + file.thumb.muted = true; + } + this.files.push(file); + } + if (this.files.length) { + this.file = this.files[0]; + // Contract thumbnails in quote preview + if (this.file.thumb && contractThumb) { + ImageExpand.contract(this); + } + } + if (this.origin.isDead) { + this.isDead = true; + } + root.dataset.clone = this.origin.clones.push(this) - 1; + return this; + } + cloneWithoutVideo(node) { + if ((node.tagName === 'VIDEO') && !node.dataset.md5) { // (exception for WebM thumbnails) + return []; + } + else if ((node.nodeType === Node.ELEMENT_NODE) && $$1('video', node)) { + const clone = node.cloneNode(false); + for (var child of node.childNodes) { + $$1.add(clone, this.cloneWithoutVideo(child)); + } + return clone; + } + else { + return node.cloneNode(true); + } + } + } + PostClone.suffix = 0; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var Menu = { + init() { + if (!['index', 'thread'].includes(g.VIEW) || !Conf['Menu']) { return; } + + this.button = $$1.el('a', { + className: 'menu-button', + href: 'javascript:;' + } + ); + + $$1.extend(this.button, {textContent: "🞃"}); + + this.menu = new UI.Menu('post'); + Callbacks.Post.push({ + name: 'Menu', + cb: this.node + }); + + return Callbacks.CatalogThread.push({ + name: 'Menu', + cb: this.catalogNode + }); + }, + + node() { + if (this.isClone) { + const button = $$1('.menu-button', this.nodes.info); + $$1.rmClass(button, 'active'); + $$1.rm($$1('.dialog', this.nodes.info)); + Menu.makeButton(this, button); + return; + } + return $$1.add(this.nodes.info, Menu.makeButton(this)); + }, + + catalogNode() { + return $$1.after(this.nodes.icons, Menu.makeButton(this.thread.OP)); + }, + + makeButton(post, button) { + if (!button) { button = Menu.button.cloneNode(true); } + $$1.on(button, 'click', function(e) { + return Menu.menu.toggle(e, this, post); + }); + return button; + } + }; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var Recursive = { + recursives: dict(), + init() { + if (!['index', 'thread'].includes(g.VIEW)) { return; } + return Callbacks.Post.push({ + name: 'Recursive', + cb: this.node + }); + }, + + node() { + if (this.isClone || this.isFetchedQuote) { return; } + for (var quote of this.quotes) { + var obj; + if ((obj = Recursive.recursives[quote])) { + for (var i = 0; i < obj.recursives.length; i++) { + var recursive = obj.recursives[i]; + recursive(this, ...Array.from(obj.args[i])); + } + } + } + }, + + add(recursive, post, ...args) { + const obj = Recursive.recursives[post.fullID] || (Recursive.recursives[post.fullID] = { + recursives: [], + args: [] + }); + obj.recursives.push(recursive); + return obj.args.push(args); + }, + + rm(recursive, post) { + let obj; + if (!(obj = Recursive.recursives[post.fullID])) { return; } + for (let i = 0; i < obj.recursives.length; i++) { + var rec = obj.recursives[i]; + if (rec === recursive) { + obj.recursives.splice(i, 1); + obj.args.splice(i, 1); + } + } + }, + + apply(recursive, post, ...args) { + const {fullID} = post; + return g.posts.forEach(function(post) { + if (post.quotes.includes(fullID)) { + return recursive(post, ...Array.from(args)); + } + }); + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var PostHiding = { + init() { + if (!['index', 'thread'].includes(g.VIEW) || (!Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link']))) { return; } + + if (Conf['Reply Hiding Buttons']) { + $$1.addClass(doc$1, "reply-hide"); + } + + this.db = new DataBoard('hiddenPosts'); + return Callbacks.Post.push({ + name: 'Reply Hiding', + cb: this.node + }); + }, + + isHidden(boardID, threadID, postID) { + return !!(PostHiding.db && PostHiding.db.get({boardID, threadID, postID})); + }, + + node() { + let data, sa; + if (!this.isReply || this.isClone || this.isFetchedQuote) { return; } + + if (data = PostHiding.db.get({boardID: this.board.ID, threadID: this.thread.ID, postID: this.ID})) { + if (data.thisPost) { + PostHiding.hide(this, data.makeStub, data.hideRecursively); + } else { + Recursive.apply(PostHiding.hide, this, data.makeStub, true); + Recursive.add(PostHiding.hide, this, data.makeStub, true); + } + } + + if (!Conf['Reply Hiding Buttons']) { return; } + + const button = PostHiding.makeButton(this, 'hide'); + if (sa = g.SITE.selectors.sideArrows) { + const sideArrows = $$1(sa, this.nodes.root); + $$1.replace(sideArrows.firstChild, button); + return sideArrows.className = 'replacedSideArrows'; + } else { + return $$1.prepend(this.nodes.info, button); + } + }, + + menu: { + init() { + if (!['index', 'thread'].includes(g.VIEW) || !Conf['Menu'] || !Conf['Reply Hiding Link']) { return; } + + // Hide + let div = $$1.el('div', { + className: 'hide-reply-link', + textContent: 'Hide' + } + ); + + let apply = $$1.el('a', { + textContent: 'Apply', + href: 'javascript:;' + } + ); + $$1.on(apply, 'click', PostHiding.menu.hide); + + let thisPost = UI.checkbox('thisPost', 'This post', true); + let replies = UI.checkbox('replies', 'Hide replies', Conf['Recursive Hiding']); + const makeStub = UI.checkbox('makeStub', 'Make stub', Conf['Stubs']); + + Menu.menu.addEntry({ + el: div, + order: 20, + open(post) { + if (!post.isReply || post.isClone || post.isHidden) { + return false; + } + PostHiding.menu.post = post; + return true; + }, + subEntries: [ + {el: apply} + , + {el: thisPost} + , + {el: replies} + , + {el: makeStub} + ]}); + + // Show + div = $$1.el('div', { + className: 'show-reply-link', + textContent: 'Show' + } + ); + + apply = $$1.el('a', { + textContent: 'Apply', + href: 'javascript:;' + } + ); + $$1.on(apply, 'click', PostHiding.menu.show); + + thisPost = UI.checkbox('thisPost', 'This post', false); + replies = UI.checkbox('replies', 'Show replies', false); + const hideStubLink = $$1.el('a', { + textContent: 'Hide stub', + href: 'javascript:;' + } + ); + $$1.on(hideStubLink, 'click', PostHiding.menu.hideStub); + + Menu.menu.addEntry({ + el: div, + order: 20, + open(post) { + let data; + if (!post.isReply || post.isClone || !post.isHidden) { + return false; + } + if (!(data = PostHiding.db.get({boardID: post.board.ID, threadID: post.thread.ID, postID: post.ID}))) { + return false; + } + PostHiding.menu.post = post; + thisPost.firstChild.checked = post.isHidden; + replies.firstChild.checked = (data?.hideRecursively != null) ? data.hideRecursively : Conf['Recursive Hiding']; + return true; + }, + subEntries: [ + {el: apply} + , + {el: thisPost} + , + {el: replies} + ]}); + + return Menu.menu.addEntry({ + el: hideStubLink, + order: 15, + open(post) { + if (!post.isReply || post.isClone || !post.isHidden) { + return false; + } + if (!(PostHiding.db.get({boardID: post.board.ID, threadID: post.thread.ID, postID: post.ID}))) { + return false; + } + return PostHiding.menu.post = post; + } + }); + }, + + hide() { + const parent = this.parentNode; + const thisPost = $$1('input[name=thisPost]', parent).checked; + const replies = $$1('input[name=replies]', parent).checked; + const makeStub = $$1('input[name=makeStub]', parent).checked; + const {post} = PostHiding.menu; + if (thisPost) { + PostHiding.hide(post, makeStub, replies); + } else if (replies) { + Recursive.apply(PostHiding.hide, post, makeStub, true); + Recursive.add(PostHiding.hide, post, makeStub, true); + } else { + return; + } + PostHiding.saveHiddenState(post, true, thisPost, makeStub, replies); + return $$1.event('CloseMenu'); + }, + + show() { + let data; + const parent = this.parentNode; + const thisPost = $$1('input[name=thisPost]', parent).checked; + const replies = $$1('input[name=replies]', parent).checked; + const {post} = PostHiding.menu; + if (thisPost) { + PostHiding.show(post, replies); + } else if (replies) { + Recursive.apply(PostHiding.show, post, true); + Recursive.rm(PostHiding.hide, post, true); + } else { + return; + } + if (data = PostHiding.db.get({boardID: post.board.ID, threadID: post.thread.ID, postID: post.ID})) { + PostHiding.saveHiddenState(post, !(thisPost && replies), !thisPost, data.makeStub, !replies); + } + return $$1.event('CloseMenu'); + }, + hideStub() { + let data; + const {post} = PostHiding.menu; + if (data = PostHiding.db.get({boardID: post.board.ID, threadID: post.thread.ID, postID: post.ID})) { + PostHiding.show(post, data.hideRecursively); + PostHiding.hide(post, false, data.hideRecursively); + PostHiding.saveHiddenState(post, true, true, false, data.hideRecursively); + } + $$1.event('CloseMenu'); + } + }, + + makeButton(post, type) { + const span = $$1.el('span', { + textContent: type === 'hide' ? '➖︎' : '➕︎', + }); + const a = $$1.el('a', { + className: `${type}-reply-button`, + href: 'javascript:;' + } + ); + $$1.add(a, span); + $$1.on(a, 'click', PostHiding.toggle); + return a; + }, + + saveHiddenState(post, isHiding, thisPost, makeStub, hideRecursively) { + const data = { + boardID: post.board.ID, + threadID: post.thread.ID, + postID: post.ID + }; + if (isHiding) { + data.val = { + thisPost: thisPost !== false, // undefined -> true + makeStub, + hideRecursively + }; + return PostHiding.db.set(data); + } else { + return PostHiding.db.delete(data); + } + }, + + toggle() { + const post = Get$1.postFromNode(this); + PostHiding[(post.isHidden ? 'show' : 'hide')](post); + return PostHiding.saveHiddenState(post, post.isHidden); + }, + + hide(post, makeStub=Conf['Stubs'], hideRecursively=Conf['Recursive Hiding']) { + if (post.isHidden) { return; } + post.isHidden = true; + + if (hideRecursively) { + Recursive.apply(PostHiding.hide, post, makeStub, true); + Recursive.add(PostHiding.hide, post, makeStub, true); + } + + for (var quotelink of Get$1.allQuotelinksLinkingTo(post)) { + $$1.addClass(quotelink, 'filtered'); + } + + if (!makeStub) { + post.nodes.root.hidden = true; + return; + } + + const a = PostHiding.makeButton(post, 'show'); + $$1.add(a, $$1.tn(` ${post.info.nameBlock}`)); + post.nodes.stub = $$1.el('div', + {className: 'stub'}); + $$1.add(post.nodes.stub, a); + if (Conf['Menu']) { + $$1.add(post.nodes.stub, Menu.makeButton(post)); + } + return $$1.prepend(post.nodes.root, post.nodes.stub); + }, + + show(post, showRecursively=Conf['Recursive Hiding']) { + if (post.nodes.stub) { + $$1.rm(post.nodes.stub); + delete post.nodes.stub; + } else { + post.nodes.root.hidden = false; + } + post.isHidden = false; + if (showRecursively) { + Recursive.apply(PostHiding.show, post, true); + Recursive.rm(PostHiding.hide, post); + } + for (var quotelink of Get$1.allQuotelinksLinkingTo(post)) { + $$1.rmClass(quotelink, 'filtered'); + } + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS205: Consider reworking code to avoid use of IIFEs + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var RelativeDates = { + INTERVAL: 30000, + + init() { + if ( + (['index', 'thread', 'archive'].includes(g.VIEW) && Conf['Relative Post Dates'] && !Conf['Relative Date Title']) || + Index$1.enabled + ) { + this.flush(); + $$1.on(d$1, 'visibilitychange PostsInserted', this.flush); + } + + if (Conf['Relative Post Dates']) { + return Callbacks.Post.push({ + name: 'Relative Post Dates', + cb: this.node + }); + } + }, + + node() { + if (!this.info.date) { return; } + const dateEl = this.nodes.date; + if (Conf['Relative Date Title']) { + $$1.on(dateEl, 'mouseover', () => RelativeDates.hover(this)); + return; + } + if (this.isClone) { return; } + + // Show original absolute time as tooltip so users can still know exact times + // Since "Time Formatting" runs its `node` before us, the title tooltip will + // pick up the user-formatted time instead of 4chan time when enabled. + dateEl.title = dateEl.textContent; + + return RelativeDates.update(this); + }, + + // diff is milliseconds from now. + relative(diff, now, date, abbrev) { + let number; + let unit = (() => { + if ((number = (diff / DAY)) >= 1) { + const years = now.getFullYear() - date.getFullYear(); + let months = now.getMonth() - date.getMonth(); + const days = now.getDate() - date.getDate(); + if (years > 1) { + number = years - ((months < 0) || ((months === 0) && (days < 0))); + return 'year'; + } else if ((years === 1) && ((months > 0) || ((months === 0) && (days >= 0)))) { + number = years; + return 'year'; + } else if ((months = months + (12*years)) > 1) { + number = months - (days < 0); + return 'month'; + } else if ((months === 1) && (days >= 0)) { + number = months; + return 'month'; + } else { + return 'day'; + } + } else if ((number = (diff / HOUR)) >= 1) { + return 'hour'; + } else if ((number = (diff / MINUTE)) >= 1) { + return 'minute'; + } else { + // prevent "-1 seconds ago" + number = Math.max(0, diff) / SECOND; + return 'second'; + } + })(); + + const rounded = Math.round(number); + + if (abbrev) { + unit = unit === 'month' ? 'mo' : unit[0]; + } else { + if (rounded !== 1) { unit += 's'; } // pluralize + } + + if (abbrev) { return `${rounded}${unit}`; } else { return `${rounded} ${unit} ago`; } + }, + + // Changing all relative dates as soon as possible incurs many annoying + // redraws and scroll stuttering. Thus, sacrifice accuracy for UX/CPU economy, + // and perform redraws when the DOM is otherwise being manipulated (and scroll + // stuttering won't be noticed), falling back to INTERVAL while the page + // is visible. + // + // Each individual dateTime element will add its update() function to the stale list + // when it is to be called. + stale: [], + flush() { + // No point in changing the dates until the user sees them. + if (d$1.hidden) { return; } + + const now = new Date(); + for (var data of RelativeDates.stale) { RelativeDates.update(data, now); } + RelativeDates.stale = []; + + // Reset automatic flush. + clearTimeout(RelativeDates.timeout); + return RelativeDates.timeout = setTimeout(RelativeDates.flush, RelativeDates.INTERVAL); + }, + + hover(post) { + const { + date + } = post.info; + const now = new Date(); + const diff = now - date; + return post.nodes.date.title = RelativeDates.relative(diff, now, date); + }, + + // `update()`, when called from `flush()`, updates the elements, + // and re-calls `setOwnTimeout()` to re-add `data` to the stale list later. + update(data, now) { + let abbrev, date; + const isPost = data instanceof Post; + if (isPost) { + ({ + date + } = data.info); + abbrev = false; + } else { + date = new Date(+data.dataset.utc); + abbrev = !!data.dataset.abbrev; + } + if (!now) { now = new Date(); } + const diff = now - date; + const relative = RelativeDates.relative(diff, now, date, abbrev); + if (isPost) { + for (var singlePost of [data].concat(data.clones)) { + singlePost.nodes.date.firstChild.textContent = relative; + } + } else { + data.firstChild.textContent = relative; + } + return RelativeDates.setOwnTimeout(diff, data); + }, + + setOwnTimeout(diff, data) { + const delay = diff < MINUTE ? + SECOND - ((diff + (SECOND / 2)) % SECOND) + : diff < HOUR ? + MINUTE - ((diff + (MINUTE / 2)) % MINUTE) + : diff < DAY ? + HOUR - ((diff + (HOUR / 2)) % HOUR) + : + DAY - ((diff + (DAY / 2)) % DAY); + return setTimeout(RelativeDates.markStale, delay, data); + }, + + markStale(data) { + if (RelativeDates.stale.includes(data)) { return; } // We can call RelativeDates.update() multiple times. + if (data instanceof Post && !g.posts.get(data.fullID)) { return; } // collected post. + if (data instanceof Element && !doc$1.contains(data)) { return; } // removed catalog reply. + return RelativeDates.stale.push(data); + } + }; + + var ThreadWatcherPage = `
            + Thread Watcher 🗘 + + 🞃 + × +
            +
            +`; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS104: Avoid inline assignments + * DS205: Consider reworking code to avoid use of IIFEs + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var BoardConfig = { + cbs: [], + + init() { + let middle; + if (g.SITE.software !== 'yotsuba') { return; } + const now = Date.now(); + if (now - (2 * HOUR) >= ((middle = Conf['boardConfig'].lastChecked || 0)) || middle > now) { + return $$1.ajax(`${location.protocol}//a.4cdn.org/boards.json`, + {onloadend: this.load}); + } else { + const {boards} = Conf['boardConfig']; + return this.set(boards); + } + }, + + load() { + let boards; + if ((this.status === 200) && this.response && this.response.boards) { + boards = dict(); + for (var board of this.response.boards) { + boards[board.board] = board; + } + $$1.set('boardConfig', {boards, lastChecked: Date.now()}); + } else { + ({boards} = Conf['boardConfig']); + const err = (() => { switch (this.status) { + case 0: return 'Connection Error'; + case 200: return 'Invalid Data'; + default: return `Error ${this.statusText} (${this.status})`; + } })(); + new Notice('warning', `Failed to load board configuration. ${err}`, 20); + } + return BoardConfig.set(boards); + }, + + set(boards) { + this.boards = boards; + for (var ID in g.boards) { + var board = g.boards[ID]; + board.config = this.boards[ID] || {}; + } + for (var cb of this.cbs) { + $$1.queueTask(cb); + } + }, + + ready(cb) { + if (this.boards) { + return cb(); + } else { + return this.cbs.push(cb); + } + }, + + sfwBoards(sfw) { + return (() => { + const result = []; + const object = this.boards || Conf['boardConfig'].boards; + for (var board in object) { + var data = object[board]; + if (!!data.ws_board === sfw) { + result.push(board); + } + } + return result; + })(); + }, + + isSFW(board) { + return !!(this.boards || Conf['boardConfig'].boards)[board]?.ws_board; + }, + + domain(board) { + return `boards.${BoardConfig.isSFW(board) ? '4channel' : '4chan'}.org`; + }, + + isArchived(board) { + // assume archive exists if no data available to prevent cleaning of archived threads + const data = (this.boards || Conf['boardConfig'].boards)[board]; + return !data || data.is_archived; + }, + + noAudio(boardID) { + if (g.SITE.software !== 'yotsuba') { return false; } + const boards = this.boards || Conf['boardConfig'].boards; + return boards && boards[boardID] && !boards[boardID].webm_audio; + }, + + title(boardID) { + return (this.boards || Conf['boardConfig'].boards)?.[boardID]?.title || ''; + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + class Board { + toString() { return this.ID; } + + constructor(ID) { + this.ID = ID; + this.boardID = this.ID; + this.siteID = g.SITE.ID; + this.threads = new SimpleDict(); + this.posts = new SimpleDict(); + this.config = BoardConfig.boards?.[this.ID] || {}; + + g.boards[this] = this; + } + + cooldowns() { + const c2 = (this.config || {}).cooldowns || {}; + const c = { + thread: c2.threads || 0, + reply: c2.replies || 0, + image: c2.images || 0, + thread_global: 300 // inter-board thread cooldown + }; + // Pass users have reduced cooldowns. + if (d$1.cookie.indexOf('pass_enabled=1') >= 0) { + for (var key of ['reply', 'image']) { + c[key] = Math.ceil(c[key] / 2); + } + } + return c; + } + } + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + const PostRedirect = { + init() { + return $$1.on(d$1, 'QRPostSuccessful', e => { + if (!e.detail.redirect) { return; } + this.event = e; + this.delays = 0; + return $$1.queueTask(() => { + if ((e === this.event) && (this.delays === 0)) { + return location.href = e.detail.redirect; + } + }); + }); + }, + + delays: 0, + + delay() { + if (!this.event) { return null; } + const e = this.event; + this.delays++; + return () => { + if (e !== this.event) { return; } + this.delays--; + if (this.delays === 0) { + return location.href = e.detail.redirect; + } + }; + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var ExpandComment = { + init() { + if ((g.VIEW !== 'index') || !Conf['Comment Expansion'] || Conf['JSON Index']) { return; } + + return Callbacks.Post.push({ + name: 'Comment Expansion', + cb: this.node + }); + }, + + node() { + let a; + if (a = $$1('.abbr > a:not([onclick])', this.nodes.comment)) { + return $$1.on(a, 'click', ExpandComment.cb); + } + }, + + callbacks: [], + + cb(e) { + e.preventDefault(); + return ExpandComment.expand(Get$1.postFromNode(this)); + }, + + expand(post) { + let a; + if (post.nodes.longComment && !post.nodes.longComment.parentNode) { + $$1.replace(post.nodes.shortComment, post.nodes.longComment); + post.nodes.comment = post.nodes.longComment; + return; + } + if (!(a = $$1('.abbr > a', post.nodes.comment))) { return; } + a.textContent = `Post No.${post} Loading...`; + return $$1.cache(g.SITE.urls.threadJSON({boardID: post.boardID, threadID: post.threadID}), function() { return ExpandComment.parse(this, a, post); }); + }, + + contract(post) { + if (!post.nodes.shortComment) { return; } + const a = $$1('.abbr > a', post.nodes.shortComment); + a.textContent = 'here'; + $$1.replace(post.nodes.longComment, post.nodes.shortComment); + return post.nodes.comment = post.nodes.shortComment; + }, + + parse(req, a, post) { + let postObj, spoilerRange; + const {status} = req; + if (![200, 304].includes(status)) { + a.textContent = status ? `Error ${req.statusText} (${status})` : 'Connection Error'; + return; + } + + const { + posts + } = req.response; + if (spoilerRange = posts[0].custom_spoiler) { + g.SITE.Build.spoilerRange[g.BOARD] = spoilerRange; + } + + for (postObj of posts) { + if (postObj.no === post.ID) { break; } + } + if (postObj.no !== post.ID) { + a.textContent = `Post No.${post} not found.`; + return; + } + + const {comment} = post.nodes; + const clone = comment.cloneNode(false); + clone.innerHTML = postObj.com; + // Fix pathnames + for (var quote of $$('.quotelink', clone)) { + var href = quote.getAttribute('href'); + if (href[0] === '/') { continue; } // Cross-board quote, or board link + if (href[0] === '#') { + quote.href = `${a.pathname.split(/\/+/).splice(0,4).join('/')}${href}`; + } else { + quote.href = `${a.pathname.split(/\/+/).splice(0,3).join('/')}/${href}`; + } + } + post.nodes.shortComment = comment; + $$1.replace(comment, clone); + post.nodes.comment = (post.nodes.longComment = clone); + post.parseComment(); + post.parseQuotes(); + + for (var callback of ExpandComment.callbacks) { + callback.call(post); + } + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var QuoteYou = { + init() { + if (!Conf['Remember Your Posts']) { return; } + + this.db = new DataBoard('yourPosts'); + $$1.sync('Remember Your Posts', enabled => Conf['Remember Your Posts'] = enabled); + $$1.on(d$1, 'QRPostSuccessful', function(e) { + const cb = PostRedirect.delay(); + return $$1.get('Remember Your Posts', Conf['Remember Your Posts'], function(items) { + if (!items['Remember Your Posts']) { return; } + const {boardID, threadID, postID} = e.detail; + return QuoteYou.db.set({boardID, threadID, postID, val: true}, cb); + }); + }); + + if (!['index', 'thread', 'archive'].includes(g.VIEW)) { return; } + + if (Conf['Highlight Own Posts']) { + $$1.addClass(doc$1, 'highlight-own'); + } + + if (Conf['Highlight Posts Quoting You']) { + $$1.addClass(doc$1, 'highlight-you'); + } + + if (Conf['Comment Expansion']) { + ExpandComment.callbacks.push(this.node); + } + + // \u00A0 is nbsp + this.mark = $$1.el('span', { + textContent: '\u00A0(You)', + className: 'qmark-you' + } + ); + Callbacks.Post.push({ + name: 'Mark Quotes of You', + cb: this.node + }); + + return QuoteYou.menu.init(); + }, + + isYou(post) { + return !!QuoteYou.db?.get({ + boardID: post.boardID, + threadID: post.threadID, + postID: post.ID + }); + }, + + node() { + if (this.isClone) { return; } + + if (QuoteYou.isYou(this)) { + $$1.addClass(this.nodes.root, 'yourPost'); + } + + // Stop there if there's no quotes in that post. + if (!this.quotes.length) { return; } + + for (var quotelink of this.nodes.quotelinks) { + if (QuoteYou.db.get(Get$1.postDataFromLink(quotelink))) { + if (Conf['Mark Quotes of You']) { $$1.add(quotelink, QuoteYou.mark.cloneNode(true)); } + $$1.addClass(quotelink, 'you'); + $$1.addClass(this.nodes.root, 'quotesYou'); + } + } + }, + + menu: { + init() { + const label = $$1.el('label', + {className: 'toggle-you'} + , + {innerHTML: ' You'}); + const input = $$1('input', label); + $$1.on(input, 'change', QuoteYou.menu.toggle); + return Menu.menu?.addEntry({ + el: label, + order: 80, + open(post) { + QuoteYou.menu.post = (post.origin || post); + input.checked = QuoteYou.isYou(post); + return true; + } + }); + }, + + toggle() { + const {post} = QuoteYou.menu; + const data = {boardID: post.board.ID, threadID: post.thread.ID, postID: post.ID, val: true}; + if (this.checked) { + QuoteYou.db.set(data); + } else { + QuoteYou.db.delete(data); + } + for (var clone of [post].concat(post.clones)) { + clone.nodes.root.classList.toggle('yourPost', this.checked); + } + for (var quotelink of Get$1.allQuotelinksLinkingTo(post)) { + if (this.checked) { + if (Conf['Mark Quotes of You']) { $$1.add(quotelink, QuoteYou.mark.cloneNode(true)); } + } else { + $$1.rm($$1('.qmark-you', quotelink)); + } + quotelink.classList.toggle('you', this.checked); + if ($$1.hasClass(quotelink, 'quotelink')) { + var quoter = Get$1.postFromNode(quotelink).nodes.root; + quoter.classList.toggle('quotesYou', !!$$1('.quotelink.you', quoter)); + } + } + } + }, + + cb: { + seek(type) { + let highlighted, post; + let result; + const {highlight} = g.SITE.classes; + if (highlighted = $$1(`.${highlight}`)) { $$1.rmClass(highlighted, highlight); } + + if (!QuoteYou.lastRead || !doc$1.contains(QuoteYou.lastRead) || !$$1.hasClass(QuoteYou.lastRead, 'quotesYou')) { + if (!(post = (QuoteYou.lastRead = $$1('.quotesYou')))) { + new Notice('warning', 'No posts are currently quoting you, loser.', 20); + return; + } + if (QuoteYou.cb.scroll(post)) { return; } + } else { + post = QuoteYou.lastRead; + } + + const str = `${type}::div[contains(@class,'quotesYou')]`; + + while (post = (result = $$1.X(str, post)).snapshotItem(type === 'preceding' ? result.snapshotLength - 1 : 0)) { + if (QuoteYou.cb.scroll(post)) { return; } + } + + const posts = $$('.quotesYou'); + return QuoteYou.cb.scroll(posts[type === 'following' ? 0 : posts.length - 1]); + }, + + scroll(root) { + const post = Get$1.postFromRoot(root); + if (!post.nodes.post.getBoundingClientRect().height) { + return false; + } else { + QuoteYou.lastRead = root; + location.href = Get$1.url('post', post); + Header$1.scrollTo(post.nodes.post); + if (post.isReply) { + const sel = `${g.SITE.selectors.postContainer}${g.SITE.selectors.highlightable.reply}`; + let node = post.nodes.root; + if (!node.matches(sel)) { node = $$1(sel, node); } + $$1.addClass(node, g.SITE.classes.highlight); + } + return true; + } + } + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + class RandomAccessList { + constructor(items) { + this.length = 0; + if (items) { for (var item of items) { this.push(item); } } + } + + push(data) { + let item; + let {ID} = data; + if (!ID) { ID = data.id; } + if (this[ID]) { return; } + const {last} = this; + this[ID] = (item = { + prev: last, + next: null, + data, + ID + }); + item.prev = last; + this.last = last ? + (last.next = item) + : + (this.first = item); + return this.length++; + } + + before(root, item) { + if ((item.next === root) || (item === root)) { return; } + + this.rmi(item); + + const {prev} = root; + root.prev = item; + item.next = root; + item.prev = prev; + if (prev) { + return prev.next = item; + } else { + return this.first = item; + } + } + + after(root, item) { + if ((item.prev === root) || (item === root)) { return; } + + this.rmi(item); + + const {next} = root; + root.next = item; + item.prev = root; + item.next = next; + if (next) { + return next.prev = item; + } else { + return this.last = item; + } + } + + prepend(item) { + const {first} = this; + if ((item === first) || !this[item.ID]) { return; } + this.rmi(item); + item.next = first; + if (first) { + first.prev = item; + } else { + this.last = item; + } + this.first = item; + return delete item.prev; + } + + shift() { + return this.rm(this.first.ID); + } + + order() { + let item; + const order = [(item = this.first)]; + while ((item = item.next)) { order.push(item); } + return order; + } + + rm(ID) { + const item = this[ID]; + if (!item) { return; } + delete this[ID]; + this.length--; + this.rmi(item); + delete item.next; + return delete item.prev; + } + + rmi(item) { + const {prev, next} = item; + if (prev) { + prev.next = next; + } else { + this.first = next; + } + if (next) { + return next.prev = prev; + } else { + return this.last = prev; + } + } + } + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var Unread = { + init() { + if ((g.VIEW !== 'thread') || ( + !Conf['Unread Count'] && + !Conf['Unread Favicon'] && + !Conf['Unread Line'] && + !Conf['Remember Last Read Post'] && + !Conf['Desktop Notifications'] && + !Conf['Quote Threading'] + )) { return; } + + if (Conf['Remember Last Read Post']) { + $$1.sync('Remember Last Read Post', enabled => Conf['Remember Last Read Post'] = enabled); + this.db = new DataBoard('lastReadPosts', this.sync); + } + + this.hr = $$1.el('hr', { + id: 'unread-line', + className: 'unread-line' + } + ); + this.posts = new Set(); + this.postsQuotingYou = new Set(); + this.order = new RandomAccessList(); + this.position = null; + + Callbacks.Thread.push({ + name: 'Unread', + cb: this.node + }); + + return Callbacks.Post.push({ + name: 'Unread', + cb: this.addPost + }); + }, + + node() { + Unread.thread = this; + Unread.title = d$1.title; + Unread.lastReadPost = Unread.db?.get({ + boardID: this.board.ID, + threadID: this.ID + }) || 0; + Unread.readCount = 0; + for (var ID of this.posts.keys) { if (+ID <= Unread.lastReadPost) { Unread.readCount++; } } + $$1.one(d$1, '4chanXInitFinished', Unread.ready); + $$1.on(d$1, 'PostsInserted', Unread.onUpdate); + $$1.on(d$1, 'ThreadUpdate', function(e) { if (e.detail[404]) { return Unread.update(); } }); + const resetLink = $$1.el('a', { + href: 'javascript:;', + className: 'unread-reset', + textContent: 'Mark all unread' + } + ); + $$1.on(resetLink, 'click', Unread.reset); + return Header$1.menu.addEntry({ + el: resetLink, + order: 70 + }); + }, + + ready() { + if (Conf['Remember Last Read Post'] && Conf['Scroll to Last Read Post']) { Unread.scroll(); } + Unread.setLine(true); + Unread.read(); + Unread.update(); + $$1.on(d$1, 'scroll visibilitychange', Unread.read); + if (Conf['Unread Line']) { return $$1.on(d$1, 'visibilitychange', Unread.setLine); } + }, + + positionPrev() { + if (Unread.position) { return Unread.position.prev; } else { return Unread.order.last; } + }, + + scroll() { + // Let the header's onload callback handle it. + let hash; + if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) { return; } + + let position = Unread.positionPrev(); + while (position) { + var {bottom} = position.data.nodes; + if (!bottom.getBoundingClientRect().height) { + // Don't try to scroll to posts with display: none + position = position.prev; + } else { + Header$1.scrollToIfNeeded(bottom, true); + break; + } + } + }, + + reset() { + if (Unread.lastReadPost == null) { return; } + + Unread.posts = new Set(); + Unread.postsQuotingYou = new Set(); + Unread.order = new RandomAccessList(); + Unread.position = null; + Unread.lastReadPost = 0; + Unread.readCount = 0; + Unread.thread.posts.forEach(post => Unread.addPost.call(post)); + + $$1.forceSync('Remember Last Read Post'); + if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) { + Unread.db.set({ + boardID: Unread.thread.board.ID, + threadID: Unread.thread.ID, + val: 0 + }); + } + + Unread.updatePosition(); + Unread.setLine(); + return Unread.update(); + }, + + sync() { + if (Unread.lastReadPost == null) { return; } + const lastReadPost = Unread.db.get({ + boardID: Unread.thread.board.ID, + threadID: Unread.thread.ID, + defaultValue: 0 + }); + if (Unread.lastReadPost >= lastReadPost) { return; } + Unread.lastReadPost = lastReadPost; + + const postIDs = Unread.thread.posts.keys; + for (let i = Unread.readCount, end = postIDs.length; i < end; i++) { + var ID = +postIDs[i]; + if (!Unread.thread.posts.get(ID).isFetchedQuote) { + if (ID > Unread.lastReadPost) { break; } + Unread.posts.delete(ID); + Unread.postsQuotingYou.delete(ID); + } + Unread.readCount++; + } + + Unread.updatePosition(); + Unread.setLine(); + return Unread.update(); + }, + + addPost() { + if (this.isFetchedQuote || this.isClone) { return; } + Unread.order.push(this); + if ((this.ID <= Unread.lastReadPost) || this.isHidden || QuoteYou.isYou(this)) { return; } + Unread.posts.add((Unread.posts.last = this.ID)); + Unread.addPostQuotingYou(this); + return Unread.position != null ? Unread.position : (Unread.position = Unread.order[this.ID]); + }, + + addPostQuotingYou(post) { + for (var quotelink of post.nodes.quotelinks) { + if (QuoteYou.db?.get(Get$1.postDataFromLink(quotelink))) { + Unread.postsQuotingYou.add((Unread.postsQuotingYou.last = post.ID)); + Unread.openNotification(post); + return; + } + } + }, + + openNotification(post, predicate=' replied to you') { + if (!Header$1.areNotificationsEnabled) { return; } + const notif = new Notification(`${post.info.nameBlock}${predicate}`, { + body: post.commentDisplay(), + icon: Favicon.logo + } + ); + notif.onclick = function() { + Header$1.scrollToIfNeeded(post.nodes.bottom, true); + return window.focus(); + }; + return notif.onshow = () => setTimeout(() => notif.close() + , 7 * SECOND); + }, + + onUpdate() { + return $$1.queueTask(function() { // ThreadUpdater may scroll immediately after inserting posts + Unread.setLine(); + Unread.read(); + return Unread.update(); + }); + }, + + readSinglePost(post) { + const {ID} = post; + if (!Unread.posts.has(ID)) { return; } + Unread.posts.delete(ID); + Unread.postsQuotingYou.delete(ID); + Unread.updatePosition(); + Unread.saveLastReadPost(); + return Unread.update(); + }, + + read: debounce(100, function(e) { + // Update the lastReadPost when hidden posts are added to the thread. + if (!Unread.posts.size && (Unread.readCount !== Unread.thread.posts.keys.length)) { + Unread.saveLastReadPost(); + } + + if (d$1.hidden || !Unread.posts.size) { return; } + + let count = 0; + while (Unread.position) { + var {ID, data} = Unread.position; + var {bottom} = data.nodes; + if (!!bottom.getBoundingClientRect().height && // post has been hidden + (Header$1.getBottomOf(bottom) <= -1)) { break; } // post is completely read + count++; + Unread.posts.delete(ID); + Unread.postsQuotingYou.delete(ID); + Unread.position = Unread.position.next; + } + + if (!count) { return; } + Unread.updatePosition(); + Unread.saveLastReadPost(); + if (e) { return Unread.update(); } + }), + + updatePosition() { + while (Unread.position && !Unread.posts.has(Unread.position.ID)) { + Unread.position = Unread.position.next; + } + }, + + saveLastReadPost: debounce(2 * SECOND, function() { + let ID; + $$1.forceSync('Remember Last Read Post'); + if (!Conf['Remember Last Read Post'] || !Unread.db) { return; } + const postIDs = Unread.thread.posts.keys; + for (let i = Unread.readCount, end = postIDs.length; i < end; i++) { + ID = +postIDs[i]; + if (!Unread.thread.posts.get(ID).isFetchedQuote) { + if (Unread.posts.has(ID)) { break; } + Unread.lastReadPost = ID; + } + Unread.readCount++; + } + if (Unread.thread.isDead && !Unread.thread.isArchived) { return; } + return Unread.db.set({ + boardID: Unread.thread.board.ID, + threadID: Unread.thread.ID, + val: Unread.lastReadPost + }); + }), + + setLine(force) { + if (!Conf['Unread Line']) { return; } + if (Unread.hr.hidden || d$1.hidden || (force === true)) { + const oldPosition = Unread.linePosition; + if (Unread.linePosition = Unread.positionPrev()) { + if (Unread.linePosition !== oldPosition) { + let node = Unread.linePosition.data.nodes.bottom; + if (node.nextSibling?.tagName === 'BR') { node = node.nextSibling; } + $$1.after(node, Unread.hr); + } + } else { + $$1.rm(Unread.hr); + } + } + return Unread.hr.hidden = Unread.linePosition === Unread.order.last; + }, + + update() { + const count = Unread.posts.size; + const countQuotingYou = Unread.postsQuotingYou.size; + + if (Conf['Unread Count']) { + const titleQuotingYou = Conf['Quoted Title'] && countQuotingYou ? '(!) ' : ''; + const titleCount = count || !Conf['Hide Unread Count at (0)'] ? `(${count}) ` : ''; + const titleDead = Unread.thread.isDead ? + Unread.title.replace('-', (Unread.thread.isArchived ? '- Archived -' : '- 404 -')) + : + Unread.title; + d$1.title = `${titleQuotingYou}${titleCount}${titleDead}`; + } + + Unread.saveThreadWatcherCount(); + + if (Conf['Unread Favicon'] && (g.SITE.software === 'yotsuba')) { + const {isDead} = Unread.thread; + return Favicon.set(( + countQuotingYou ? + (isDead ? 'unreadDeadY' : 'unreadY') + : count ? + (isDead ? 'unreadDead' : 'unread') + : + (isDead ? 'dead' : 'default') + ) + ); + } + }, + + saveThreadWatcherCount: debounce(2 * SECOND, function() { + $$1.forceSync('Remember Last Read Post'); + if (Conf['Remember Last Read Post'] && (!Unread.thread.isDead || Unread.thread.isArchived)) { + let posts; + const quotingYou = !Conf['Require OP Quote Link'] && QuoteYou.isYou(Unread.thread.OP) ? Unread.posts : Unread.postsQuotingYou; + if (!quotingYou.size) { + quotingYou.last = 0; + } else if (!quotingYou.has(quotingYou.last)) { + quotingYou.last = 0; + posts = Unread.thread.posts.keys; + for (let i = posts.length - 1; i >= 0; i--) { + if (quotingYou.has(+posts[i])) { + quotingYou.last = posts[i]; + break; + } + } + } + return ThreadWatcher$1.update(g.SITE.ID, Unread.thread.board.ID, Unread.thread.ID, { + last: Unread.thread.lastPost, + isDead: Unread.thread.isDead, + isArchived: Unread.thread.isArchived, + unread: Unread.posts.size, + quotingYou: (quotingYou.last || 0) + } + ); + } + }) + }; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var ExpandThread = { + statuses: dict(), + init() { + if (!((g.VIEW === 'index') && Conf['Thread Expansion'])) { return; } + if (Conf['JSON Index']) { + return $$1.on(d$1, 'IndexRefreshInternal', this.onIndexRefresh); + } else { + return Callbacks.Thread.push({ + name: 'Expand Thread', + cb() { return ExpandThread.setButton(this); } + }); + } + }, + + setButton(thread) { + let a; + if (!(thread.nodes.root && (a = $$1('.summary', thread.nodes.root)))) { return; } + a.textContent = g.SITE.Build.summaryText('+', ...Array.from(a.textContent.match(/\d+/g))); + a.style.cursor = 'pointer'; + return $$1.on(a, 'click', ExpandThread.cbToggle); + }, + + disconnect(refresh) { + if ((g.VIEW === 'thread') || !Conf['Thread Expansion']) { return; } + for (var threadID in ExpandThread.statuses) { + var oldReq; + var status = ExpandThread.statuses[threadID]; + if (oldReq = status.req) { + delete status.req; + oldReq.abort(); + } + delete ExpandThread.statuses[threadID]; + } + + if (!refresh) { return $$1.off(d$1, 'IndexRefreshInternal', this.onIndexRefresh); } + }, + + onIndexRefresh() { + ExpandThread.disconnect(true); + return g.BOARD.threads.forEach(thread => ExpandThread.setButton(thread)); + }, + + cbToggle(e) { + if ($$1.modifiedClick(e)) { return; } + e.preventDefault(); + return ExpandThread.toggle(Get$1.threadFromNode(this)); + }, + + cbToggleBottom(e) { + if ($$1.modifiedClick(e)) { return; } + e.preventDefault(); + const thread = Get$1.threadFromNode(this); + $$1.rm(this); // remove before fixing bottom of thread position + const {bottom} = thread.nodes.root.getBoundingClientRect(); + ExpandThread.toggle(thread); + return window.scrollBy(0, (thread.nodes.root.getBoundingClientRect().bottom - bottom)); + }, + + toggle(thread) { + let a; + if (!(thread.nodes.root && (a = $$1('.summary', thread.nodes.root)))) { return; } + if (thread.ID in ExpandThread.statuses) { + return ExpandThread.contract(thread, a, thread.nodes.root); + } else { + return ExpandThread.expand(thread, a); + } + }, + + expand(thread, a) { + let status; + ExpandThread.statuses[thread] = (status = {}); + a.textContent = g.SITE.Build.summaryText('...', ...Array.from(a.textContent.match(/\d+/g))); + status.req = $$1.cache(g.SITE.urls.threadJSON({boardID: thread.board.ID, threadID: thread.ID}), function() { + if (this !== status.req) { return; } // aborted + delete status.req; + return ExpandThread.parse(this, thread, a); + }); + return status.numReplies = $$(g.SITE.selectors.replyOriginal, thread.nodes.root).length; + }, + + contract(thread, a, threadRoot) { + let oldReq; + const status = ExpandThread.statuses[thread]; + delete ExpandThread.statuses[thread]; + if (oldReq = status.req) { + delete status.req; + oldReq.abort(); + if (a) { a.textContent = g.SITE.Build.summaryText('+', ...Array.from(a.textContent.match(/\d+/g))); } + return; + } + + let replies = $$('.thread > .replyContainer', threadRoot); + if (status.numReplies) { replies = replies.slice(0, (-status.numReplies)); } + let postsCount = 0; + let filesCount = 0; + for (var reply of replies) { + // rm clones + if (Conf['Quote Inlining']) { var inlined; + while ((inlined = $$1('.inlined', reply))) { inlined.click(); } } + postsCount++; + if ('file' in Get$1.postFromRoot(reply)) { filesCount++; } + $$1.rm(reply); + } + if (Index$1.enabled) { // otherwise handled by Main.addPosts + $$1.event('PostsRemoved', null, a.parentNode); + } + a.textContent = g.SITE.Build.summaryText('+', postsCount, filesCount); + return $$1.rm($$1('.summary-bottom', threadRoot)); + }, + + parse(req, thread, a) { + let root; + if (![200, 304].includes(req.status)) { + a.textContent = req.status ? `Error ${req.statusText} (${req.status})` : 'Connection Error'; + return; + } + + g.SITE.Build.spoilerRange[thread.board] = req.response.posts[0].custom_spoiler; + + const posts = []; + const postsRoot = []; + let filesCount = 0; + for (var postData of req.response.posts) { + var post; + if (postData.no === thread.ID) { continue; } + if ((post = thread.posts.get(postData.no)) && !post.isFetchedQuote) { + if ('file' in post) { filesCount++; } + ({root} = post.nodes); + postsRoot.push(root); + continue; + } + root = g.SITE.Build.postFromObject(postData, thread.board.ID); + post = new Post(root, thread, thread.board); + if ('file' in post) { filesCount++; } + posts.push(post); + postsRoot.push(root); + } + Main$1.callbackNodes('Post', posts); + $$1.after(a, postsRoot); + $$1.event('PostsInserted', null, a.parentNode); + + const postsCount = postsRoot.length; + a.textContent = g.SITE.Build.summaryText('-', postsCount, filesCount); + + if (root) { + const a2 = a.cloneNode(true); + a2.classList.add('summary-bottom'); + $$1.on(a2, 'click', ExpandThread.cbToggleBottom); + return $$1.after(root, a2); + } + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS205: Consider reworking code to avoid use of IIFEs + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var UnreadIndex = { + lastReadPost: dict(), + hr: dict(), + markReadLink: dict(), + + init() { + if ((g.VIEW !== 'index') || !Conf['Remember Last Read Post'] || !Conf['Unread Line in Index']) { return; } + + this.enabled = true; + this.db = new DataBoard('lastReadPosts', this.sync); + + Callbacks.Thread.push({ + name: 'Unread Line in Index', + cb: this.node + }); + + $$1.on(d$1, 'IndexRefreshInternal', this.onIndexRefresh); + return $$1.on(d$1, 'PostsInserted PostsRemoved', this.onPostsInserted); + }, + + node() { + UnreadIndex.lastReadPost[this.fullID] = UnreadIndex.db.get({ + boardID: this.board.ID, + threadID: this.ID + }) || 0; + if (!Index$1.enabled) { // let onIndexRefresh handle JSON Index + return UnreadIndex.update(this); + } + }, + + onIndexRefresh(e) { + if (e.detail.isCatalog) { return; } + return (() => { + const result = []; + for (var threadID of e.detail.threadIDs) { + var thread = g.threads.get(threadID); + result.push(UnreadIndex.update(thread)); + } + return result; + })(); + }, + + onPostsInserted(e) { + if (e.target === Index$1.root) { return; } // onIndexRefresh handles this case + const thread = Get$1.threadFromNode(e.target); + if (!thread || (thread.nodes.root !== e.target)) { return; } + const wasVisible = !!UnreadIndex.hr[thread.fullID]?.parentNode; + UnreadIndex.update(thread); + if (Conf['Scroll to Last Read Post'] && (e.type === 'PostsInserted') && !wasVisible && !!UnreadIndex.hr[thread.fullID]?.parentNode) { + return Header$1.scrollToIfNeeded(UnreadIndex.hr[thread.fullID], true); + } + }, + + sync() { + return g.threads.forEach(function(thread) { + const lastReadPost = UnreadIndex.db.get({ + boardID: thread.board.ID, + threadID: thread.ID + }) || 0; + if (lastReadPost !== UnreadIndex.lastReadPost[thread.fullID]) { + UnreadIndex.lastReadPost[thread.fullID] = lastReadPost; + if (thread.nodes.root?.parentNode) { + return UnreadIndex.update(thread); + } + } + }); + }, + + update(thread) { + let divider; + const lastReadPost = UnreadIndex.lastReadPost[thread.fullID]; + let repliesShown = 0; + let repliesRead = 0; + let firstUnread = null; + thread.posts.forEach(function(post) { + if (post.isReply && thread.nodes.root.contains(post.nodes.root)) { + repliesShown++; + if (post.ID <= lastReadPost) { + return repliesRead++; + } else if ((!firstUnread || (post.ID < firstUnread.ID)) && !post.isHidden && !QuoteYou.isYou(post)) { + return firstUnread = post; + } + } + }); + + let hr = UnreadIndex.hr[thread.fullID]; + if (firstUnread && (repliesRead || ((lastReadPost === thread.OP.ID) && (!$$1(g.SITE.selectors.summary, thread.nodes.root) || thread.ID in ExpandThread.statuses)))) { + if (!hr) { + hr = (UnreadIndex.hr[thread.fullID] = $$1.el('hr', + {className: 'unread-line'})); + } + $$1.before(firstUnread.nodes.root, hr); + } else { + $$1.rm(hr); + } + + const hasUnread = repliesShown ? + firstUnread || !repliesRead + : Index$1.enabled ? + thread.lastPost > lastReadPost + : + thread.OP.ID > lastReadPost; + thread.nodes.root.classList.toggle('unread-thread', hasUnread); + + let link = UnreadIndex.markReadLink[thread.fullID]; + if (!link) { + link = (UnreadIndex.markReadLink[thread.fullID] = $$1.el('a', { + className: 'unread-mark-read brackets-wrap', + href: 'javascript:;', + textContent: 'Mark Read' + } + )); + $$1.on(link, 'click', UnreadIndex.markRead); + } + if (divider = $$1(g.SITE.selectors.threadDivider, thread.nodes.root)) { // divider inside thread as in Tinyboard + return $$1.before(divider, link); + } else { + return $$1.add(thread.nodes.root, link); + } + }, + + markRead() { + const thread = Get$1.threadFromNode(this); + UnreadIndex.lastReadPost[thread.fullID] = thread.lastPost; + UnreadIndex.db.set({ + boardID: thread.board.ID, + threadID: thread.ID, + val: thread.lastPost + }); + $$1.rm(UnreadIndex.hr[thread.fullID]); + thread.nodes.root.classList.remove('unread-thread'); + return ThreadWatcher$1.update(g.SITE.ID, thread.board.ID, thread.ID, { + last: thread.lastPost, + unread: 0, + quotingYou: 0 + } + ); + } + }; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * DS104: Avoid inline assignments + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + + var ThreadWatcher = { + init() { + let sc; + if (!(this.enabled = Conf['Thread Watcher'])) { return; } + + this.shortcut = (sc = $$1.el('a', { + id: 'watcher-link', + textContent: '👁︎', + title: 'Thread Watcher', + href: 'javascript:;', + } + )); + + this.db = new DataBoard('watchedThreads', this.refresh, true); + this.dbLM = new DataBoard('watcherLastModified', null, true); + this.dialog = UI.dialog('thread-watcher', { innerHTML: ThreadWatcherPage }); + this.status = $$1('#watcher-status', this.dialog); + this.list = this.dialog.lastElementChild; + this.refreshButton = $$1('.refresh', this.dialog); + this.closeButton = $$1('.move > .close', this.dialog); + this.unreaddb = Unread.db || UnreadIndex.db || new DataBoard('lastReadPosts'); + this.unreadEnabled = Conf['Remember Last Read Post']; + + $$1.on(d$1, 'QRPostSuccessful', this.cb.post); + $$1.on(sc, 'click', this.toggleWatcher); + $$1.on(this.refreshButton, 'click', this.buttonFetchAll); + $$1.on(this.closeButton, 'click', this.toggleWatcher); + + this.menu.addHeaderMenuEntry(); + $$1.onExists(doc$1, 'body', this.addDialog); + + switch (g.VIEW) { + case 'index': + $$1.on(d$1, 'IndexUpdate', this.cb.onIndexUpdate); + break; + case 'thread': + $$1.on(d$1, 'ThreadUpdate', this.cb.onThreadRefresh); + break; + } + + if (Conf['Fixed Thread Watcher']) { + $$1.addClass(doc$1, 'fixed-watcher'); + } + if (!Conf['Persistent Thread Watcher']) { + $$1.addClass(ThreadWatcher.shortcut, 'disabled'); + this.dialog.hidden = true; + } + + Header$1.addShortcut('watcher', sc, 510); + + ThreadWatcher.initLastModified(); + ThreadWatcher.fetchAuto(); + $$1.on(window, 'visibilitychange focus', () => $$1.queueTask(ThreadWatcher.fetchAuto)); + + if (Conf['Menu'] && Index$1.enabled) { + Menu.menu.addEntry({ + el: $$1.el('a', { + href: 'javascript:;', + className: 'has-shortcut-text' + } + , {innerHTML: 'Alt+click'}), + order: 6, + open({thread}) { + if (Conf['Index Mode'] !== 'catalog') { return false; } + this.el.firstElementChild.textContent = ThreadWatcher.isWatched(thread) ? + 'Unwatch' + : + 'Watch'; + if (this.cb) { $$1.off(this.el, 'click', this.cb); } + this.cb = function() { + $$1.event('CloseMenu'); + return ThreadWatcher.toggle(thread); + }; + $$1.on(this.el, 'click', this.cb); + return true; + } + }); + } + + if (!['index', 'thread'].includes(g.VIEW)) { return; } + + Callbacks.Post.push({ + name: 'Thread Watcher', + cb: this.node + }); + return Callbacks.CatalogThread.push({ + name: 'Thread Watcher', + cb: this.catalogNode + }); + }, + + isWatched(thread) { + return !!ThreadWatcher.db?.get({boardID: thread.board.ID, threadID: thread.ID}); + }, + + isWatchedRaw(boardID, threadID) { + return !!ThreadWatcher.db?.get({boardID, threadID}); + }, + + setToggler(toggler, isWatched) { + toggler.classList.toggle('watched', isWatched); + return toggler.title = `${isWatched ? 'Unwatch' : 'Watch'} Thread`; + }, + + node() { + let toggler; + if (this.isReply) { return; } + if (this.isClone) { + toggler = $$1('.watch-thread-link', this.nodes.info); + } else { + toggler = $$1.el('a', { + href: 'javascript:;', + className: 'watch-thread-link' + } + ); + $$1.before($$1('input', this.nodes.info), toggler); + } + const siteID = g.SITE.ID; + const boardID = this.board.ID; + const threadID = this.thread.ID; + const data = ThreadWatcher.db.get({siteID, boardID, threadID}); + ThreadWatcher.setToggler(toggler, !!data); + $$1.on(toggler, 'click', ThreadWatcher.cb.toggle); + // Add missing excerpt for threads added by Auto Watch + if (data && (data.excerpt == null)) { + return $$1.queueTask(() => { + return ThreadWatcher.update(siteID, boardID, threadID, {excerpt: Get$1.threadExcerpt(this.thread)}); + }); + } + }, + + catalogNode() { + if (ThreadWatcher.isWatched(this.thread)) { $$1.addClass(this.nodes.root, 'watched'); } + return $$1.on(this.nodes.root, 'mousedown click', e => { + if ((e.button !== 0) || !e.altKey) { return; } + if (e.type === 'click') { ThreadWatcher.toggle(this.thread); } + return e.preventDefault(); + }); + }, // Also on mousedown to prevent highlighting thumbnail in Firefox. + + addDialog() { + if (!Main$1.isThisPageLegit()) { return; } + ThreadWatcher.build(); + return $$1.prepend(d$1.body, ThreadWatcher.dialog); + }, + + toggleWatcher() { + $$1.toggleClass(ThreadWatcher.shortcut, 'disabled'); + return ThreadWatcher.dialog.hidden = !ThreadWatcher.dialog.hidden; + }, + + cb: { + openAll() { + if ($$1.hasClass(this, 'disabled')) { return; } + for (var a of $$('a.watcher-link', ThreadWatcher.list)) { + $$1.open(a.href); + } + return $$1.event('CloseMenu'); + }, + openUnread() { + if ($$1.hasClass(this, 'disabled')) { return; } + for (var a of $$('.replies-unread > a.watcher-link', ThreadWatcher.list)) { + $$1.open(a.href); + } + return $$1.event('CloseMenu'); + }, + openDeads() { + if ($$1.hasClass(this, 'disabled')) { return; } + for (var a of $$('.dead-thread > a.watcher-link', ThreadWatcher.list)) { + $$1.open(a.href); + } + return $$1.event('CloseMenu'); + }, + pruneDeads() { + if ($$1.hasClass(this, 'disabled')) { return; } + for (var {siteID, boardID, threadID, data} of ThreadWatcher.getAll()) { + if (data.isDead) { + ThreadWatcher.db.delete({siteID, boardID, threadID}); + } + } + ThreadWatcher.refresh(); + return $$1.event('CloseMenu'); + }, + dismiss() { + for (var {siteID, boardID, threadID, data} of ThreadWatcher.getAll()) { + if (data.quotingYou) { + ThreadWatcher.update(siteID, boardID, threadID, {dismiss: data.quotingYou || 0}); + } + } + return $$1.event('CloseMenu'); + }, + toggle() { + const {thread} = Get$1.postFromNode(this); + return ThreadWatcher.toggle(thread); + }, + rm() { + const {siteID} = this.parentNode.dataset; + const [boardID, threadID] = Array.from(this.parentNode.dataset.fullID.split('.')); + return ThreadWatcher.rm(siteID, boardID, +threadID); + }, + post(e) { + const {boardID, threadID, postID} = e.detail; + const cb = PostRedirect.delay(); + if (postID === threadID) { + if (Conf['Auto Watch']) { + return ThreadWatcher.addRaw(boardID, threadID, {}, cb); + } + } else if (Conf['Auto Watch Reply']) { + return ThreadWatcher.add((g.threads.get(boardID + '.' + threadID) || new Thread(threadID, g.boards[boardID] || new Board(boardID))), cb); + } + }, + onIndexUpdate(e) { + const {db} = ThreadWatcher; + const siteID = g.SITE.ID; + const boardID = g.BOARD.ID; + let nKilled = 0; + for (var threadID in db.data[siteID].boards[boardID]) { + // Don't prune threads that have yet to appear in index. + var data = db.data[siteID].boards[boardID][threadID]; + if (!data?.isDead && !e.detail.threads.includes(`${boardID}.${threadID}`)) { + if (!e.detail.threads.some(fullID => +fullID.split('.')[1] > threadID)) { continue; } + if (Conf['Auto Prune'] || !(data && (typeof data === 'object'))) { // corrupt data + db.delete({boardID, threadID}); + nKilled++; + } else { + ThreadWatcher.fetchStatus({siteID, boardID, threadID, data}); + } + } + } + if (nKilled) { return ThreadWatcher.refresh(); } + }, + onThreadRefresh(e) { + const thread = g.threads.get(e.detail.threadID); + if (!e.detail[404] || !ThreadWatcher.isWatched(thread)) { return; } + // Update dead status. + return ThreadWatcher.add(thread); + } + }, + + requests: [], + fetched: 0, + + fetch(url, {siteID, force}, args, cb) { + if (ThreadWatcher.requests.length === 0) { + ThreadWatcher.status.textContent = '...'; + $$1.addClass(ThreadWatcher.refreshButton, 'spin'); + } + const onloadend = function() { + if (this.finished) { return; } + this.finished = true; + ThreadWatcher.fetched++; + if (ThreadWatcher.fetched === ThreadWatcher.requests.length) { + ThreadWatcher.clearRequests(); + } else { + ThreadWatcher.status.textContent = `${Math.round((ThreadWatcher.fetched / ThreadWatcher.requests.length) * 100)}%`; + } + return cb.apply(this, args); + }; + const ajax = siteID === g.SITE.ID ? $$1.ajax : CrossOrigin$1.ajax; + if (force) { + delete $$1.lastModified.ThreadWatcher?.[url]; + } + const req = $$1.whenModified( + url, + 'ThreadWatcher', + onloadend, + { timeout: MINUTE, ajax } + ); + return ThreadWatcher.requests.push(req); + }, + + clearRequests() { + ThreadWatcher.requests = []; + ThreadWatcher.fetched = 0; + ThreadWatcher.status.textContent = ''; + return $$1.rmClass(ThreadWatcher.refreshButton, 'spin'); + }, + + abort() { + delete ThreadWatcher.syncing; + for (var req of ThreadWatcher.requests) { + if (!req.finished) { + req.finished = true; + req.abort(); + } + } + return ThreadWatcher.clearRequests(); + }, + + initLastModified() { + const lm = ($$1.lastModified['ThreadWatcher'] || ($$1.lastModified['ThreadWatcher'] = dict())); + for (var siteID in ThreadWatcher.dbLM.data) { + var boards = ThreadWatcher.dbLM.data[siteID]; + for (var boardID in boards.boards) { + var data = boards.boards[boardID]; + if (ThreadWatcher.db.get({siteID, boardID})) { + for (var url in data) { + var date = data[url]; + lm[url] = date; + } + } else { + ThreadWatcher.dbLM.delete({siteID, boardID}); + } + } + } + }, + + fetchAuto() { + let middle; + clearTimeout(ThreadWatcher.timeout); + if (!Conf['Auto Update Thread Watcher']) { return; } + const {db} = ThreadWatcher; + const interval = Conf['Show Page'] || (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) ? 5 * MINUTE : 2 * HOUR; + const now = Date.now(); + if ((now - interval >= ((middle = db.data.lastChecked || 0)) || middle > now) && !d$1.hidden && !!d$1.hasFocus()) { + ThreadWatcher.fetchAllStatus(interval); + } + return ThreadWatcher.timeout = setTimeout(ThreadWatcher.fetchAuto, interval); + }, + + buttonFetchAll() { + if (ThreadWatcher.syncing || ThreadWatcher.requests.length) { + return ThreadWatcher.abort(); + } else { + return ThreadWatcher.fetchAllStatus(); + } + }, + + fetchAllStatus(interval=0) { + ThreadWatcher.status.textContent = '...'; + $$1.addClass(ThreadWatcher.refreshButton, 'spin'); + ThreadWatcher.syncing = true; + const dbs = [ThreadWatcher.db, ThreadWatcher.unreaddb, QuoteYou.db].filter(x => x); + let n = 0; + return dbs.map((dbi) => + dbi.forceSync(function() { + if ((++n) === dbs.length) { + let middle; + if (!ThreadWatcher.syncing) { return; } // aborted + delete ThreadWatcher.syncing; + if (0 > (middle = Date.now() - (ThreadWatcher.db.data.lastChecked || 0)) || middle >= interval) { // not checked in another tab + // XXX On vichan boards, last_modified field of threads.json does not account for sage posts. + // Occasionally check replies field of catalog.json to find these posts. + let middle1; + const {db} = ThreadWatcher; + const now = Date.now(); + const deep = !(now - (2 * HOUR) < ((middle1 = db.data.lastChecked2 || 0)) && middle1 <= now); + const boards = ThreadWatcher.getAll(true); + for (var board of boards) { + ThreadWatcher.fetchBoard(board, deep); + } + db.setLastChecked(); + if (deep) { db.setLastChecked('lastChecked2'); } + } + if (ThreadWatcher.fetched === ThreadWatcher.requests.length) { + return ThreadWatcher.clearRequests(); + } + } + })); + }, + + fetchBoard(board, deep) { + if (!board.some(thread => !thread.data.isDead)) { return; } + let force = false; + for (var thread of board) { + var {data} = thread; + if (!data.isDead && (data.last !== -1)) { + if (Conf['Show Page'] && (data.page == null)) { force = true; } + if ((data.modified == null)) { force = (thread.force = true); } + } + } + const {siteID, boardID} = board[0]; + const site = g.sites[siteID]; + if (!site) { return; } + const urlF = deep && site.threadModTimeIgnoresSage ? 'catalogJSON' : 'threadsListJSON'; + const url = site.urls[urlF]?.({siteID, boardID}); + if (!url) { return; } + return ThreadWatcher.fetch(url, {siteID, force}, [board, url], ThreadWatcher.parseBoard); + }, + + parseBoard(board, url) { + let page, thread; + if (this.status !== 200) { return; } + const {siteID, boardID} = board[0]; + const lmDate = this.getResponseHeader('Last-Modified'); + ThreadWatcher.dbLM.extend({siteID, boardID, val: $$1.item(url, lmDate)}); + const threads = dict(); + let pageLength = 0; + let nThreads = 0; + let oldest = null; + try { + pageLength = this.response[0]?.threads.length || 0; + for (let i = 0; i < this.response.length; i++) { + page = this.response[i]; + for (var item of page.threads) { + threads[item.no] = { + page: i + 1, + index: nThreads, + modified: item.last_modified, + replies: item.replies + }; + nThreads++; + if ((oldest == null) || (item.no < oldest)) { + oldest = item.no; + } + } + } + } catch (error) { + for (thread of board) { + ThreadWatcher.fetchStatus(thread); + } + } + for (thread of board) { + var {threadID, data} = thread; + if (threads[threadID]) { + var index, modified, replies; + ({page, index, modified, replies} = threads[threadID]); + if (Conf['Show Page']) { + var lastPage = g.sites[siteID].isPrunedByAge?.({siteID, boardID}) ? + threadID === oldest + : + index >= (nThreads - pageLength); + ThreadWatcher.update(siteID, boardID, threadID, {page, lastPage}); + } + if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) { + if ((modified !== data.modified) || ((replies != null) && (replies !== data.replies))) { + (thread.newData || (thread.newData = {})).modified = modified; + ThreadWatcher.fetchStatus(thread); + } + } + } else { + ThreadWatcher.fetchStatus(thread); + } + } + }, + + fetchStatus(thread) { + const {siteID, boardID, threadID, data, force} = thread; + const url = g.sites[siteID]?.urls.threadJSON?.({siteID, boardID, threadID}); + if (!url) { return; } + if (data.isDead && !force) { return; } + if (data.last === -1) { return; } // 404 or no JSON API + return ThreadWatcher.fetch(url, {siteID, force}, [thread], ThreadWatcher.parseStatus); + }, + + parseStatus(thread, isArchiveURL) { + let isDead, last; + let {siteID, boardID, threadID, data, newData, force} = thread; + const site = g.sites[siteID]; + if ((this.status === 200) && this.response) { + let isArchived; + last = this.response.posts[this.response.posts.length-1].no; + const replies = this.response.posts.length-1; + isDead = (isArchived = !!(this.response.posts[0].archived || isArchiveURL)); + if (isDead && Conf['Auto Prune']) { + ThreadWatcher.rm(siteID, boardID, threadID); + return; + } + + if ((last === data.last) && (isDead === data.isDead) && (isArchived === data.isArchived)) { return; } + + const lastReadPost = ThreadWatcher.unreaddb.get({siteID, boardID, threadID, defaultValue: 0}); + let unread = data.unread || 0; + let quotingYou = data.quotingYou || 0; + const youOP = !!QuoteYou.db?.get({siteID, boardID, threadID, postID: threadID}); + + for (var postObj of this.response.posts) { + if ((postObj.no <= (data.last || 0)) || (postObj.no <= lastReadPost)) { continue; } + if (QuoteYou.db?.get({siteID, boardID, threadID, postID: postObj.no})) { continue; } + + var quotesYou = false; + if (!Conf['Require OP Quote Link'] && youOP) { + quotesYou = true; + } else if (QuoteYou.db && postObj.com) { + var match; + var regexp = site.regexp.quotelinkHTML; + regexp.lastIndex = 0; + while (match = regexp.exec(postObj.com)) { + if (QuoteYou.db.get({ + siteID, + boardID: match[1] ? encodeURIComponent(match[1]) : boardID, + threadID: match[2] || threadID, + postID: match[3] || match[2] || threadID + })) { + quotesYou = true; + break; + } + } + } + + if (!unread || (!quotingYou && quotesYou)) { + if (Filter.isHidden(site.Build.parseJSON(postObj, {siteID, boardID}))) { continue; } + } + + unread++; + if (quotesYou) { quotingYou = postObj.no; } + } + + if (!newData) { newData = {}; } + $$1.extend(newData, {last, replies, isDead, isArchived, unread, quotingYou}); + return ThreadWatcher.update(siteID, boardID, threadID, newData); + + } else if (this.status === 404) { + const archiveURL = g.sites[siteID]?.urls.archivedThreadJSON?.({siteID, boardID, threadID}); + if (!isArchiveURL && archiveURL) { + return ThreadWatcher.fetch(archiveURL, {siteID, force}, [thread, true], ThreadWatcher.parseStatus); + } else if (site.mayLackJSON && (data.last == null)) { + return ThreadWatcher.update(siteID, boardID, threadID, {last: -1}); + } else { + return ThreadWatcher.update(siteID, boardID, threadID, {isDead: true}); + } + } + }, + + getAll(groupByBoard) { + const all = []; + for (var siteID in ThreadWatcher.db.data) { + var boards = ThreadWatcher.db.data[siteID]; + for (var boardID in boards.boards) { + var cont; + var threads = boards.boards[boardID]; + if (Conf['Current Board'] && ((siteID !== g.SITE.ID) || (boardID !== g.BOARD.ID))) { + continue; + } + if (groupByBoard) { + all.push((cont = [])); + } + for (var threadID in threads) { + var data = threads[threadID]; + if (data && (typeof data === 'object')) { + (groupByBoard ? cont : all).push({siteID, boardID, threadID, data}); + } + } + } + } + return all; + }, + + makeLine(siteID, boardID, threadID, data) { + let page; + const x = $$1.el('a', { + textContent: '✕', + href: 'javascript:;' + } + ); + $$1.on(x, 'click', ThreadWatcher.cb.rm); + + let {excerpt, isArchived} = data; + if (!excerpt) { excerpt = `/${boardID}/ - No.${threadID}`; } + if (Conf['Show Site Prefix']) { excerpt = ThreadWatcher.prefixes[siteID] + excerpt; } + + const link = $$1.el('a', { + href: g.sites[siteID]?.urls.thread({siteID, boardID, threadID}, isArchived) || '', + title: excerpt, + className: 'watcher-link' + } + ); + + if (Conf['Show Page'] && (data.page != null)) { + page = $$1.el('span', { + textContent: `[${data.page}]`, + className: 'watcher-page' + } + ); + $$1.add(link, page); + } + + if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count'] && (data.unread != null)) { + const count = $$1.el('span', { + textContent: `(${data.unread})`, + className: 'watcher-unread' + } + ); + $$1.add(link, count); + } + + const title = $$1.el('span', { + textContent: excerpt, + className: 'watcher-title' + } + ); + $$1.add(link, title); + + const div = $$1.el('div'); + const fullID = `${boardID}.${threadID}`; + div.dataset.fullID = fullID; + div.dataset.siteID = siteID; + if ((g.VIEW === 'thread') && (fullID === `${g.BOARD}.${g.THREADID}`)) { $$1.addClass(div, 'current'); } + if (data.isDead) { $$1.addClass(div, 'dead-thread'); } + if (Conf['Show Page']) { + if (data.lastPage) { $$1.addClass(div, 'last-page'); } + if (data.page != null) { div.dataset.page = data.page; } + } + if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) { + if (data.unread === 0) { $$1.addClass(div, 'replies-read'); } + if (data.unread) { $$1.addClass(div, 'replies-unread'); } + if ((data.quotingYou || 0) > (data.dismiss || 0)) { $$1.addClass(div, 'replies-quoting-you'); } + } + $$1.add(div, [x, $$1.tn(' '), link]); + return div; + }, + + setPrefixes(threads) { + const prefixes = dict(); + for (var {siteID} of threads) { + if (siteID in prefixes) { continue; } + var len = 0; + var prefix = ''; + var conflicts = Object.keys(prefixes); + while (conflicts.length > 0) { + len++; + prefix = siteID.slice(0, len); + var conflicts2 = []; + for (var siteID2 of conflicts) { + if (siteID2.slice(0, len) === prefix) { + conflicts2.push(siteID2); + } else if (prefixes[siteID2].length < len) { + prefixes[siteID2] = siteID2.slice(0, len); + } + } + conflicts = conflicts2; + } + prefixes[siteID] = prefix; + } + return ThreadWatcher.prefixes = prefixes; + }, + + build() { + const nodes = []; + const threads = ThreadWatcher.getAll(); + ThreadWatcher.setPrefixes(threads); + for (var {siteID, boardID, threadID, data} of threads) { + // Add missing excerpt for threads added by Auto Watch + var thread; + if ((data.excerpt == null) && (siteID === g.SITE.ID) && (thread = g.threads.get(`${boardID}.${threadID}`)) && thread.OP) { + ThreadWatcher.db.extend({boardID, threadID, val: {excerpt: Get$1.threadExcerpt(thread)}}); + } + nodes.push(ThreadWatcher.makeLine(siteID, boardID, threadID, data)); + } + const {list} = ThreadWatcher; + $$1.rmAll(list); + $$1.add(list, nodes); + + return ThreadWatcher.refreshIcon(); + }, + + refresh() { + ThreadWatcher.build(); + + g.threads.forEach(function(thread) { + const isWatched = ThreadWatcher.isWatched(thread); + if (thread.OP) { + for (var post of [thread.OP, ...Array.from(thread.OP.clones)]) { + var toggler; + if (toggler = $$1('.watch-thread-link', post.nodes.info)) { + ThreadWatcher.setToggler(toggler, isWatched); + } + } + } + if (thread.catalogView) { return thread.catalogView.nodes.root.classList.toggle('watched', isWatched); } + }); + + if (Conf['Pin Watched Threads']) { + return $$1.event('SortIndex', {deferred: Conf['Index Mode'] !== 'catalog'}); + } + }, + + refreshIcon() { + for (var className of ['replies-unread', 'replies-quoting-you']) { + ThreadWatcher.shortcut.classList.toggle(className, !!$$1(`.${className}`, ThreadWatcher.dialog)); + } + }, + + update(siteID, boardID, threadID, newData) { + let data, key, line, val; + if (!(data = ThreadWatcher.db?.get({siteID, boardID, threadID}))) { return; } + if (newData.isDead && Conf['Auto Prune']) { + ThreadWatcher.rm(siteID, boardID, threadID); + return; + } + if (newData.isDead || (newData.last === -1)) { + for (key of ['isArchived', 'page', 'lastPage', 'unread', 'quotingyou']) { + if (!(key in newData)) { + newData[key] = undefined; + } + } + } + if ((newData.last != null) && (newData.last < data.last)) { + newData.modified = undefined; + } + let n = 0; + for (key in newData) { val = newData[key]; if (data[key] !== val) { n++; } } + if (!n) { return; } + ThreadWatcher.db.extend({siteID, boardID, threadID, val: newData}); + if (line = $$1(`#watched-threads > [data-site-i-d='${siteID}'][data-full-i-d='${boardID}.${threadID}']`, ThreadWatcher.dialog)) { + const newLine = ThreadWatcher.makeLine(siteID, boardID, threadID, data); + $$1.replace(line, newLine); + return ThreadWatcher.refreshIcon(); + } else { + return ThreadWatcher.refresh(); + } + }, + + set404(boardID, threadID, cb) { + let data; + if (!(data = ThreadWatcher.db?.get({boardID, threadID}))) { return cb(); } + if (Conf['Auto Prune']) { + ThreadWatcher.db.delete({boardID, threadID}); + return cb(); + } + if (data.isDead && !((data.isArchived != null) || (data.page != null) || (data.lastPage != null) || (data.unread != null) || (data.quotingYou != null))) { return cb(); } + return ThreadWatcher.db.extend({boardID, threadID, val: {isDead: true, isArchived: undefined, page: undefined, lastPage: undefined, unread: undefined, quotingYou: undefined}}, cb); + }, + + toggle(thread) { + const siteID = g.SITE.ID; + const boardID = thread.board.ID; + const threadID = thread.ID; + if (ThreadWatcher.db.get({boardID, threadID})) { + return ThreadWatcher.rm(siteID, boardID, threadID); + } else { + return ThreadWatcher.add(thread); + } + }, + + add(thread, cb) { + const data = {}; + const siteID = g.SITE.ID; + const boardID = thread.board.ID; + const threadID = thread.ID; + if (thread.isDead) { + if (Conf['Auto Prune'] && ThreadWatcher.db.get({boardID, threadID})) { + ThreadWatcher.rm(siteID, boardID, threadID, cb); + return; + } + data.isDead = true; + } + if (thread.OP) { data.excerpt = Get$1.threadExcerpt(thread); } + return ThreadWatcher.addRaw(boardID, threadID, data, cb); + }, + + addRaw(boardID, threadID, data, cb) { + const oldData = ThreadWatcher.db.get({ boardID, threadID, defaultValue: dict() }); + delete oldData.last; + delete oldData.modified; + $$1.extend(oldData, data); + ThreadWatcher.db.set({boardID, threadID, val: oldData}, cb); + ThreadWatcher.refresh(); + const thread = {siteID: g.SITE.ID, boardID, threadID, data, force: true}; + if (Conf['Show Page'] && !data.isDead) { + return ThreadWatcher.fetchBoard([thread]); + } else if (ThreadWatcher.unreadEnabled && Conf['Show Unread Count']) { + return ThreadWatcher.fetchStatus(thread); + } + }, + + rm(siteID, boardID, threadID, cb) { + ThreadWatcher.db.delete({siteID, boardID, threadID}, cb); + return ThreadWatcher.refresh(); + }, + + menu: { + init() { + if (!Conf['Thread Watcher']) { return; } + const menu = (this.menu = new UI.Menu('thread watcher')); + $$1.on($$1('.menu-button', ThreadWatcher.dialog), 'click', function(e) { + return menu.toggle(e, this, ThreadWatcher); + }); + return this.addMenuEntries(); + }, + + addHeaderMenuEntry() { + if (g.VIEW !== 'thread') { return; } + const entryEl = $$1.el('a', + {href: 'javascript:;'}); + Header$1.menu.addEntry({ + el: entryEl, + order: 60, + open() { + const [addClass, rmClass, text] = Array.from(!!ThreadWatcher.db.get({boardID: g.BOARD.ID, threadID: g.THREADID}) ? + ['unwatch-thread', 'watch-thread', 'Unwatch thread'] + : + ['watch-thread', 'unwatch-thread', 'Watch thread']); + $$1.addClass(entryEl, addClass); + $$1.rmClass(entryEl, rmClass); + entryEl.textContent = text; + return true; + } + }); + return $$1.on(entryEl, 'click', () => ThreadWatcher.toggle(g.threads.get(`${g.BOARD}.${g.THREADID}`))); + }, + + addMenuEntries() { + const entries = []; + + // `Open all` entry + entries.push({ + text: 'Open all threads', + cb: ThreadWatcher.cb.openAll, + open() { + this.el.classList.toggle('disabled', !ThreadWatcher.list.firstElementChild); + return true; + } + }); + + // `Open Unread` entry + entries.push({ + text: 'Open unread threads', + cb: ThreadWatcher.cb.openUnread, + open() { + this.el.classList.toggle('disabled', !$$1('.replies-unread', ThreadWatcher.list)); + return true; + } + }); + + // `Open dead threads` entry + entries.push({ + text: 'Open dead threads', + cb: ThreadWatcher.cb.openDeads, + open() { + this.el.classList.toggle('disabled', !$$1('.dead-thread', ThreadWatcher.list)); + return true; + } + }); + + // `Prune dead threads` entry + entries.push({ + text: 'Prune dead threads', + cb: ThreadWatcher.cb.pruneDeads, + open() { + this.el.classList.toggle('disabled', !$$1('.dead-thread', ThreadWatcher.list)); + return true; + } + }); + + // `Dismiss posts quoting you` entry + entries.push({ + text: 'Dismiss posts quoting you', + title: 'Unhighlight the thread watcher icon and threads until there are new replies quoting you.', + cb: ThreadWatcher.cb.dismiss, + open() { + this.el.classList.toggle('disabled', !$$1.hasClass(ThreadWatcher.shortcut, 'replies-quoting-you')); + return true; + } + }); + + for (var {text, title, cb, open} of entries) { + var entry = { + el: $$1.el('a', { + textContent: text, + href: 'javascript:;' + } + ) + }; + if (title) { entry.el.title = title; } + $$1.on(entry.el, 'click', cb); + entry.open = open.bind(entry); + this.menu.addEntry(entry); + } + + // Settings checkbox entries: + for (var name in Config.threadWatcher) { + var conf = Config.threadWatcher[name]; + this.addCheckbox(name, conf[1]); + } + + }, + + addCheckbox(name, desc) { + const entry = { + type: 'thread watcher', + el: UI.checkbox(name, name.replace(' Thread Watcher', '')) + }; + entry.el.title = desc; + const input = entry.el.firstElementChild; + if ((name === 'Show Unread Count') && !ThreadWatcher.unreadEnabled) { + input.disabled = true; + $$1.addClass(entry.el, 'disabled'); + entry.el.title += '\n[Remember Last Read Post is disabled.]'; + } + $$1.on(input, 'change', $$1.cb.checked); + if (['Current Board', 'Show Page', 'Show Unread Count', 'Show Site Prefix'].includes(name)) { $$1.on(input, 'change', ThreadWatcher.refresh); } + if (['Show Page', 'Show Unread Count', 'Auto Update Thread Watcher'].includes(name)) { $$1.on(input, 'change', ThreadWatcher.fetchAuto); } + return this.menu.addEntry(entry); + } + } + }; + var ThreadWatcher$1 = ThreadWatcher; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * DS205: Consider reworking code to avoid use of IIFEs + * DS206: Consider reworking classes to avoid initClass + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + class Fetcher { + static initClass() { + + this.prototype.archiveTags = { + '\n': {innerHTML: "
            "}, + '[b]': {innerHTML: ""}, + '[/b]': {innerHTML: ""}, + '[spoiler]': {innerHTML: ""}, + '[/spoiler]': {innerHTML: ""}, + '[code]': {innerHTML: "
            "},
            +        '[/code]':    {innerHTML: "
            "}, + '[moot]': {innerHTML: "
            "}, + '[/moot]': {innerHTML: "
            "}, + '[banned]': {innerHTML: ""}, + '[/banned]': {innerHTML: ""}, + '[fortune]'(text) { return {innerHTML: ""}; }, + '[/fortune]': {innerHTML: ""}, + '[i]': {innerHTML: ""}, + '[/i]': {innerHTML: ""}, + '[red]': {innerHTML: ""}, + '[/red]': {innerHTML: ""}, + '[green]': {innerHTML: ""}, + '[/green]': {innerHTML: ""}, + '[blue]': {innerHTML: ""}, + '[/blue]': {innerHTML: ""} + }; + } + constructor(boardID, threadID, postID, root, quoter) { + let post, thread; + this.boardID = boardID; + this.threadID = threadID; + this.postID = postID; + this.root = root; + this.quoter = quoter; + if (post = g.posts.get(`${this.boardID}.${this.postID}`)) { + this.insert(post); + return; + } + + // 4chan X catalog data + if ((post = Index$1.replyData?.[`${this.boardID}.${this.postID}`]) && (thread = g.threads.get(`${this.boardID}.${this.threadID}`))) { + const board = g.boards[this.boardID]; + post = new Post(g.SITE.Build.postFromObject(post, this.boardID), thread, board, {isFetchedQuote: true}); + Main$1.callbackNodes('Post', [post]); + this.insert(post); + return; + } + + this.root.textContent = `Loading post No.${this.postID}...`; + if (this.threadID) { + const that = this; + $$1.cache(g.SITE.urls.threadJSON({boardID: this.boardID, threadID: this.threadID}), function({isCached}) { + return that.fetchedPost(this, isCached); + }); + } else { + this.archivedPost(); + } + } + + insert(post) { + // Stop here if the container has been removed while loading. + if (!this.root.parentNode) { return; } + if (!this.quoter) { this.quoter = post; } + const clone = post.addClone(this.quoter.context, ($$1.hasClass(this.root, 'dialog'))); + Main$1.callbackNodes('Post', [clone]); + + // Get rid of the side arrows/stubs. + const {nodes} = clone; + $$1.rmAll(nodes.root); + $$1.add(nodes.root, nodes.post); + + // Indicate links to the containing post. + const quotes = [...clone.nodes.quotelinks, ...clone.nodes.backlinks]; + for (var quote of quotes) { + var {boardID, postID} = Get$1.postDataFromLink(quote); + if ((postID === this.quoter.ID) && (boardID === this.quoter.board.ID)) { + $$1.addClass(quote, 'forwardlink'); + } + } + + // Set up flag CSS for cross-board links to boards with flags + if (clone.nodes.flag && !(Fetcher.flagCSS || (Fetcher.flagCSS = $$1('link[href^="//s.4cdn.org/css/flags."]')))) { + const cssVersion = $$1('link[href^="//s.4cdn.org/css/"]')?.href.match(/\d+(?=\.css$)|$/)[0] || Date.now(); + Fetcher.flagCSS = $$1.el('link', { + rel: 'stylesheet', + href: `//s.4cdn.org/css/flags.${cssVersion}.css` + } + ); + $$1.add(d$1.head, Fetcher.flagCSS); + } + + $$1.rmAll(this.root); + $$1.add(this.root, nodes.root); + return $$1.event('PostsInserted', null, this.root); + } + + fetchedPost(req, isCached) { + // In case of multiple callbacks for the same request, + // don't parse the same original post more than once. + let post; + if (post = g.posts.get(`${this.boardID}.${this.postID}`)) { + this.insert(post); + return; + } + + const {status} = req; + if (status !== 200) { + // The thread can die by the time we check a quote. + if (status && this.archivedPost()) { return; } + + $$1.addClass(this.root, 'warning'); + this.root.textContent = + status === 404 ? + `Thread No.${this.threadID} 404'd.` + : !status ? + 'Connection Error' + : + `Error ${req.statusText} (${req.status}).`; + return; + } + + const {posts} = req.response; + g.SITE.Build.spoilerRange[this.boardID] = posts[0].custom_spoiler; + for (post of posts) { + if (post.no === this.postID) { break; } + } // we found it! + + if (post.no !== this.postID) { + // Cached requests can be stale and must be rechecked. + if (isCached) { + const api = g.SITE.urls.threadJSON({boardID: this.boardID, threadID: this.threadID}); + $$1.cleanCache(url => url === api); + const that = this; + $$1.cache(api, function() { + return that.fetchedPost(this, false); + }); + return; + } + + // The post can be deleted by the time we check a quote. + if (this.archivedPost()) { return; } + + $$1.addClass(this.root, 'warning'); + this.root.textContent = `Post No.${this.postID} was not found.`; + return; + } + + const board = g.boards[this.boardID] || + new Board(this.boardID); + const thread = g.threads.get(`${this.boardID}.${this.threadID}`) || + new Thread(this.threadID, board); + post = new Post(g.SITE.Build.postFromObject(post, this.boardID), thread, board, {isFetchedQuote: true}); + Main$1.callbackNodes('Post', [post]); + return this.insert(post); + } + + archivedPost() { + let url; + if (!Conf['Resurrect Quotes']) { return false; } + if (!(url = Redirect$1.to('post', {boardID: this.boardID, postID: this.postID}))) { return false; } + const archive = Redirect$1.data.post[this.boardID]; + const encryptionOK = /^https:\/\//.test(url) || (location.protocol === 'http:'); + if (encryptionOK || Conf['Exempt Archives from Encryption']) { + const that = this; + CrossOrigin$1.cache(url, function() { + if (!encryptionOK && this.response?.media) { + const {media} = this.response; + for (var key in media) { + // Image/thumbnail URLs loaded over HTTP can be modified in transit. + // Require them to be from an HTTP host so that no referrer is sent to them from an HTTPS page. + if (/_link$/.test(key)) { + if (!$$1.getOwn(media, key)?.match(/^http:\/\//)) { delete media[key]; } + } + } + } + return that.parseArchivedPost(this.response, url, archive); + }); + return true; + } + return false; + } + + parseArchivedPost(data, url, archive) { + // In case of multiple callbacks for the same request, + // don't parse the same original post more than once. + let post; + if (post = g.posts.get(`${this.boardID}.${this.postID}`)) { + this.insert(post); + return; + } + + if (data == null) { + $$1.addClass(this.root, 'warning'); + this.root.textContent = `Error fetching Post No.${this.postID} from ${archive.name}.`; + return; + } + + if (data.error) { + $$1.addClass(this.root, 'warning'); + this.root.textContent = data.error; + return; + } + + // https://github.com/eksopl/asagi/blob/v0.4.0b74/src/main/java/net/easymodo/asagi/YotsubaAbstract.java#L82-L129 + // https://github.com/FoolCode/FoolFuuka/blob/800bd090835489e7e24371186db6e336f04b85c0/src/Model/Comment.php#L368-L428 + // https://github.com/bstats/b-stats/blob/6abe7bffaf6e5f523498d760e54b110df5331fbb/inc/classes/Yotsuba.php#L157-L168 + let comment = (data.comment || '').split(/(\n|\[\/?(?:b|spoiler|code|moot|banned|fortune(?: color="#\w+")?|i|red|green|blue)\])/); + comment = (() => { + const result = []; + for (let i = 0; i < comment.length; i++) { + var text = comment[i]; + if ((i % 2) === 1) { + var tag = Fetcher.archiveTags[text.replace(/\ .*\]/, ']')]; + if (typeof tag === 'function') { result.push(tag(text)); } else { result.push(tag); } + } else { + var greentext = text[0] === '>'; + text = text.replace(/(\[\/?[a-z]+):lit(\])/g, '$1$2'); + text = text.split(/(>>(?:>\/[a-z\d]+\/)?\d+)/g).map((text2, j) => + {((j % 2) ? "" + E(text2) + "" : E(text2));}); + text = {innerHTML: ((greentext) ? "" + E.cat(text) + "" : E.cat(text))}; + result.push(text); + } + } + return result; + })(); + comment = {innerHTML: E.cat(comment)}; + + this.threadID = +data.thread_num; + const o = { + ID: this.postID, + threadID: this.threadID, + boardID: this.boardID, + isReply: this.postID !== this.threadID + }; + o.info = { + subject: data.title, + email: data.email, + name: data.name || '', + tripcode: data.trip, + capcode: (() => { switch (data.capcode) { + // https://github.com/pleebe/FoolFuuka/blob/bf4224eed04637a4d0bd4411c2bf5f9945dfec0b/assets/themes/foolz/foolfuuka-theme-fuuka/src/Partial/Board.php#L77 + case 'M': return 'Mod'; + case 'A': return 'Admin'; + case 'D': return 'Developer'; + case 'V': return 'Verified'; + case 'F': return 'Founder'; + case 'G': return 'Manager'; + } })(), + uniqueID: data.poster_hash, + flagCode: data.poster_country, + flagCodeTroll: data.troll_country_code, + flag: data.poster_country_name || data.troll_country_name, + dateUTC: data.timestamp, + dateText: data.fourchan_date, + commentHTML: comment + }; + if (o.info.capcode) { delete o.info.uniqueID; } + if (data.media && !!+data.media.banned) { + o.fileDeleted = true; + } else if (data.media?.media_filename) { + let {thumb_link} = data.media; + // Fix URLs missing origin + if (thumb_link?.[0] === '/') { thumb_link = url.split('/', 3).join('/') + thumb_link; } + if (!Redirect$1.securityCheck(thumb_link)) { thumb_link = ''; } + let media_link = Redirect$1.to('file', {boardID: this.boardID, filename: data.media.media_orig}); + if (!Redirect$1.securityCheck(media_link)) { media_link = ''; } + o.file = { + name: data.media.media_filename, + url: media_link || + (this.boardID === 'f' ? + `${location.protocol}//${ImageHost.flashHost()}/${this.boardID}/${encodeURIComponent(E(data.media.media_filename))}` + : + `${location.protocol}//${ImageHost.host()}/${this.boardID}/${data.media.media_orig}`), + height: data.media.media_h, + width: data.media.media_w, + MD5: data.media.media_hash, + size: $$1.bytesToString(data.media.media_size), + thumbURL: thumb_link || `${location.protocol}//${ImageHost.thumbHost()}/${this.boardID}/${data.media.preview_orig}`, + theight: data.media.preview_h, + twidth: data.media.preview_w, + isSpoiler: data.media.spoiler === '1' + }; + if (!/\.pdf$/.test(o.file.url)) { o.file.dimensions = `${o.file.width}x${o.file.height}`; } + if ((this.boardID === 'f') && data.media.exif) { o.file.tag = JSON.parse(data.media.exif).Tag; } + } + o.extra = dict(); + + const board = g.boards[this.boardID] || + new Board(this.boardID); + const thread = g.threads.get(`${this.boardID}.${this.threadID}`) || + new Thread(this.threadID, board); + post = new Post(g.SITE.Build.post(o), thread, board, {isFetchedQuote: true}); + post.kill(); + if (post.file) { post.file.thumbURL = o.file.thumbURL; } + Main$1.callbackNodes('Post', [post]); + return this.insert(post); + } + } + Fetcher.initClass(); + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var QuotePreview = { + init() { + if (!Conf['Quote Previewing']) { return; } + + if (g.VIEW === 'archive') { + $$1.on(d$1, 'mouseover', function(e) { + if ((e.target.nodeName === 'A') && $$1.hasClass(e.target, 'quotelink')) { + return QuotePreview.mouseover.call(e.target, e); + } + }); + } + + if (!['index', 'thread'].includes(g.VIEW)) { return; } + + if (Conf['Comment Expansion']) { + ExpandComment.callbacks.push(this.node); + } + + return Callbacks.Post.push({ + name: 'Quote Previewing', + cb: this.node + }); + }, + + node() { + for (var link of this.nodes.quotelinks.concat([...Array.from(this.nodes.backlinks)], this.nodes.archivelinks)) { + $$1.on(link, 'mouseover', QuotePreview.mouseover); + } + }, + + mouseover(e) { + let origin; + if (($$1.hasClass(this, 'inlined') && !$$1.hasClass(doc, 'catalog-mode')) || !d$1.contains(this)) { return; } + + const {boardID, threadID, postID} = Get$1.postDataFromLink(this); + + const qp = $$1.el('div', { + id: 'qp', + className: 'dialog' + } + ); + + $$1.add(Header$1.hover, qp); + new Fetcher(boardID, threadID, postID, qp, Get$1.postFromNode(this)); + + UI.hover({ + root: this, + el: qp, + latestEvent: e, + endEvents: 'mouseout click', + cb: QuotePreview.mouseout + }); + + if (Conf['Quote Highlighting'] && (origin = g.posts.get(`${boardID}.${postID}`))) { + const posts = [origin].concat(origin.clones); + // Remove the clone that's in the qp from the array. + posts.pop(); + for (var post of posts) { + $$1.addClass(post.nodes.post, 'qphl'); + } + } + }, + + mouseout() { + // Stop if it only contains text. + let root; + if (!(root = this.el.firstElementChild)) { return; } + + $$1.event('PostsRemoved', null, Header$1.hover); + + const clone = Get$1.postFromRoot(root); + let post = clone.origin; + post.rmClone(root.dataset.clone); + + if (!Conf['Quote Highlighting']) { return; } + for (post of [post].concat(post.clones)) { + $$1.rmClass(post.nodes.post, 'qphl'); + } + } + }; + + var NavLinksPage = `Index +Catalog +Archive +Bottom + + +× + + + + + + + + +`; + + var PageList = ` +
            + + +`; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * DS205: Consider reworking code to avoid use of IIFEs + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + + var Index = { + showHiddenThreads: false, + changed: {}, + + enabledOn({siteID, boardID}) { + return Conf['JSON Index'] && (g.sites[siteID].software === 'yotsuba') && (boardID !== 'f'); + }, + + init() { + let input, inputs, name; + if (g.VIEW !== 'index') { return; } + + // For IndexRefresh events + $$1.one(d$1, '4chanXInitFinished', this.cb.initFinished); + $$1.on(d$1, 'PostsInserted', this.cb.postsInserted); + + if (!this.enabledOn(g.BOARD)) { return; } + + this.enabled = true; + + Callbacks.Post.push({ + name: 'Index Page Numbers', + cb: this.node + }); + Callbacks.CatalogThread.push({ + name: 'Catalog Features', + cb: this.catalogNode + }); + + this.search = history.state?.searched || ''; + if (history.state?.mode) { + Conf['Index Mode'] = history.state?.mode; + } + this.currentSort = history.state?.sort; + if (!this.currentSort) { this.currentSort = typeof Conf['Index Sort'] === 'object' ? ( + Conf['Index Sort'][g.BOARD.ID] || 'bump' + ) : ( + Conf['Index Sort'] + ); } + this.currentPage = this.getCurrentPage(); + this.processHash(); + + $$1.addClass(doc$1, 'index-loading', `${Conf['Index Mode'].replace(/\ /g, '-')}-mode`); + $$1.on(window, 'popstate', this.cb.popstate); + $$1.on(d$1, 'scroll', this.scroll); + $$1.on(d$1, 'SortIndex', this.cb.resort); + + // Header refresh button + this.button = $$1.el('a', { + title: 'Refresh', + href: 'javascript:;', + textContent: '🗘' + } + ); + $$1.on(this.button, 'click', () => Index.update()); + Header$1.addShortcut('index-refresh', this.button, 590); + + // Header "Index Navigation" submenu + const entries = []; + this.inputs = (inputs = dict()); + for (name in Config.Index) { + var arr = Config.Index[name]; + if (arr instanceof Array) { + var label = UI.checkbox(name, `${name[0]}${name.slice(1).toLowerCase()}`); + label.title = arr[1]; + entries.push({el: label}); + input = label.firstChild; + $$1.on(input, 'change', $$1.cb.checked); + inputs[name] = input; + } + } + $$1.on(inputs['Show Replies'], 'change', this.cb.replies); + $$1.on(inputs['Catalog Hover Expand'], 'change', this.cb.hover); + $$1.on(inputs['Pin Watched Threads'], 'change', this.cb.resort); + $$1.on(inputs['Anchor Hidden Threads'], 'change', this.cb.resort); + + const watchSettings = function(e) { + if (input = $$1.getOwn(inputs, e.target.name)) { + input.checked = e.target.checked; + return $$1.event('change', null, input); + } + }; + $$1.on(d$1, 'OpenSettings', () => $$1.on($$1.id('fourchanx-settings'), 'change', watchSettings)); + + const sortEntry = UI.checkbox('Per-Board Sort Type', 'Per-board sort type', (typeof Conf['Index Sort'] === 'object')); + sortEntry.title = 'Set the sorting order of each board independently.'; + $$1.on(sortEntry.firstChild, 'change', this.cb.perBoardSort); + entries.splice(3, 0, {el: sortEntry}); + + Header$1.menu.addEntry({ + el: $$1.el('span', + {textContent: 'Index Navigation'}), + order: 100, + subEntries: entries + }); + + // Navigation links at top of index + this.navLinks = $$1.el('div', {className: 'navLinks json-index'}); + $$1.extend(this.navLinks, {innerHTML: NavLinksPage}); + $$1('.cataloglink a', this.navLinks).href = CatalogLinks.catalog(); + if (!BoardConfig.isArchived(g.BOARD.ID)) { $$1('.archlistlink', this.navLinks).hidden = true; } + $$1.on($$1('#index-last-refresh a', this.navLinks), 'click', this.cb.refreshFront); + + // Search field + this.searchInput = $$1('#index-search', this.navLinks); + this.setupSearch(); + $$1.on(this.searchInput, 'input', this.onSearchInput); + $$1.on($$1('#index-search-clear', this.navLinks), 'click', this.clearSearch); + + // Hidden threads toggle + this.hideLabel = $$1('#hidden-label', this.navLinks); + $$1.on($$1('#hidden-toggle a', this.navLinks), 'click', this.cb.toggleHiddenThreads); + + // Drop-down menus and reverse sort toggle + this.selectRev = $$1('#index-rev', this.navLinks); + this.selectMode = $$1('#index-mode', this.navLinks); + this.selectSort = $$1('#index-sort', this.navLinks); + this.selectSize = $$1('#index-size', this.navLinks); + $$1.on(this.selectRev, 'change', this.cb.sort); + $$1.on(this.selectMode, 'change', this.cb.mode); + $$1.on(this.selectSort, 'change', this.cb.sort); + $$1.on(this.selectSize, 'change', $$1.cb.value); + $$1.on(this.selectSize, 'change', this.cb.size); + for (var select of [this.selectMode, this.selectSize]) { + select.value = Conf[select.name]; + } + this.selectRev.checked = /-rev$/.test(Index.currentSort); + this.selectSort.value = Index.currentSort.replace(/-rev$/, ''); + + // Last Long Reply options + this.lastLongOptions = $$1('#lastlong-options', this.navLinks); + this.lastLongInputs = $$('input', this.lastLongOptions); + this.lastLongThresholds = [0, 0]; + this.lastLongOptions.hidden = (this.selectSort.value !== 'lastlong'); + for (let i = 0; i < this.lastLongInputs.length; i++) { + input = this.lastLongInputs[i]; + $$1.on(input, 'change', this.cb.lastLongThresholds); + var tRaw = Conf[`Last Long Reply Thresholds ${i}`]; + input.value = (this.lastLongThresholds[i] = + typeof tRaw === 'object' ? (tRaw[g.BOARD.ID] ?? 100) : tRaw); + } + + // Thread container + this.root = $$1.el('div', {className: 'board json-index'}); + $$1.on(this.root, 'click', this.cb.hoverToggle); + this.cb.size(); + this.cb.hover(); + + // Page list + this.pagelist = $$1.el('div', {className: 'pagelist json-index'}); + $$1.extend(this.pagelist, {innerHTML: PageList}); + $$1('.cataloglink a', this.pagelist).href = CatalogLinks.catalog(); + $$1.on(this.pagelist, 'click', this.cb.pageNav); + + this.update(true); + + $$1.onExists(doc$1, 'title + *', () => d$1.title = d$1.title.replace(/\ -\ Page\ \d+/, '')); + + $$1.onExists(doc$1, '.board > .thread > .postContainer, .board + *', function() { + let el; + g.SITE.Build.hat = $$1('.board > .thread > img:first-child'); + if (g.SITE.Build.hat) { + g.BOARD.threads.forEach(function(thread) { + if (thread.nodes.root) { + return $$1.prepend(thread.nodes.root, g.SITE.Build.hat.cloneNode(false)); + } + }); + $$1.addClass(doc$1, 'hats-enabled'); + $$1.addStyle(`.catalog-thread::after {background-image: url(${g.SITE.Build.hat.src});}`); + } + + const board = $$1('.board'); + $$1.replace(board, Index.root); + if (Index.loaded) { + $$1.event('PostsInserted', null, Index.root); + } + // Hacks: + // - When removing an element from the document during page load, + // its ancestors will still be correctly created inside of it. + // - Creating loadable elements inside of an origin-less document + // will not download them. + // - Combine the two and you get a download canceller! + // Does not work on Firefox unfortunately. bugzil.la/939713 + try { + d$1.implementation.createDocument(null, null, null).appendChild(board); + } catch (error) {} + + for (el of $$('.navLinks')) { $$1.rm(el); } + $$1.rm($$1.id('ctrl-top')); + const topNavPos = $$1.id('delform').previousElementSibling; + $$1.before(topNavPos, $$1.el('hr')); + $$1.before(topNavPos, Index.navLinks); + const timeEl = $$1('#index-last-refresh time', Index.navLinks); + if (timeEl.dataset.utc) { return RelativeDates.update(timeEl); } + }); + + return Main$1.ready(function() { + let pagelist; + if (pagelist = $$1('.pagelist')) { + $$1.replace(pagelist, Index.pagelist); + } + return $$1.rmClass(doc$1, 'index-loading'); + }); + }, + + scroll() { + if (Index.req || !Index.liveThreadData || (Conf['Index Mode'] !== 'infinite') || (window.scrollY <= (doc$1.scrollHeight - (300 + window.innerHeight)))) { return; } + if (Index.pageNum == null) { Index.pageNum = Index.currentPage; } // Avoid having to pushState to keep track of the current page + + const pageNum = ++Index.pageNum; + if (pageNum > Index.pagesNum) { return Index.endNotice(); } + + const threadIDs = Index.threadsOnPage(pageNum); + return Index.buildStructure(threadIDs); + }, + + endNotice: (function() { + let notify = false; + const reset = () => notify = false; + return function() { + if (notify) { return; } + notify = true; + new Notice('info', "Last page reached.", 2); + return setTimeout(reset, 3 * SECOND); + }; + })(), + + menu: { + init() { + if ((g.VIEW !== 'index') || !Conf['Menu'] || !Conf['Thread Hiding Link'] || !Index.enabledOn(g.BOARD)) { return; } + + return Menu.menu.addEntry({ + el: $$1.el('a', { + href: 'javascript:;', + className: 'has-shortcut-text' + } + , {innerHTML: "Shift+click"}), + order: 20, + open({thread}) { + if (Conf['Index Mode'] !== 'catalog') { return false; } + this.el.firstElementChild.textContent = thread.isHidden ? + 'Unhide' + : + 'Hide'; + if (this.cb) { $$1.off(this.el, 'click', this.cb); } + this.cb = function() { + $$1.event('CloseMenu'); + return Index.toggleHide(thread); + }; + $$1.on(this.el, 'click', this.cb); + return true; + } + }); + } + }, + + node() { + if (this.isReply || this.isClone || (Index.threadPosition[this.ID] == null)) { return; } + return this.thread.setPage(Math.floor(Index.threadPosition[this.ID] / Index.threadsNumPerPage) + 1); + }, + + catalogNode() { + return $$1.on(this.nodes.root, 'mousedown click', e => { + if ((e.button !== 0) || !e.shiftKey) { return; } + if (e.type === 'click') { Index.toggleHide(this.thread); } + return e.preventDefault(); + }); + }, // Also on mousedown to prevent highlighting text. + + toggleHide(thread) { + if (Index.showHiddenThreads) { + ThreadHiding.show(thread); + if (!ThreadHiding.db.get({boardID: thread.board.ID, threadID: thread.ID})) { return; } + // Don't save when un-hiding filtered threads. + } else { + ThreadHiding.hide(thread); + } + return ThreadHiding.saveHiddenState(thread); + }, + + cycleSortType() { + let i; + const types = [...Array.from(Index.selectSort.options)].filter(option => !option.disabled); + for (i = 0; i < types.length; i++) { + var type = types[i]; + if (type.selected) { break; } + } + types[(i + 1) % types.length].selected = true; + return $$1.event('change', null, Index.selectSort); + }, + + cb: { + initFinished() { + Index.initFinishedFired = true; + return $$1.queueTask(() => Index.cb.postsInserted()); + }, + + postsInserted() { + if (!Index.initFinishedFired) { return; } + let n = 0; + g.posts.forEach(function(post) { + if (!post.isFetchedQuote && !post.indexRefreshSeen && doc$1.contains(post.nodes.root)) { + post.indexRefreshSeen = true; + return n++; + } + }); + if (n) { return $$1.event('IndexRefresh'); } + }, + + toggleHiddenThreads() { + $$1('#hidden-toggle a', Index.navLinks).textContent = (Index.showHiddenThreads = !Index.showHiddenThreads) ? + 'Hide' + : + 'Show'; + Index.sort(); + return Index.buildIndex(); + }, + + mode() { + Index.pushState({mode: this.value}); + return Index.pageLoad(false); + }, + + sort() { + const value = Index.selectRev.checked ? Index.selectSort.value + "-rev" : Index.selectSort.value; + Index.pushState({sort: value}); + return Index.pageLoad(false); + }, + + resort(e) { + Index.changed.order = true; + if (!e?.detail?.deferred) { return Index.pageLoad(false); } + }, + + perBoardSort() { + Conf['Index Sort'] = this.checked ? dict() : ''; + Index.saveSort(); + for (let i = 0; i < 2; i++) { + Conf[`Last Long Reply Thresholds ${i}`] = this.checked ? dict() : ''; + Index.saveLastLongThresholds(i); + } + }, + + lastLongThresholds() { + const i = [...Array.from(this.parentNode.children)].indexOf(this); + const value = +this.value; + if (!Number.isFinite(value)) { + this.value = Index.lastLongThresholds[i]; + return; + } + Index.lastLongThresholds[i] = value; + Index.saveLastLongThresholds(i); + Index.changed.order = true; + return Index.pageLoad(false); + }, + + size(e) { + if (Conf['Index Mode'] !== 'catalog') { + $$1.rmClass(Index.root, 'catalog-small'); + $$1.rmClass(Index.root, 'catalog-large'); + } else if (Conf['Index Size'] === 'small') { + $$1.addClass(Index.root, 'catalog-small'); + $$1.rmClass(Index.root, 'catalog-large'); + } else { + $$1.addClass(Index.root, 'catalog-large'); + $$1.rmClass(Index.root, 'catalog-small'); + } + if (e) { return Index.buildIndex(); } + }, + + replies() { + return Index.buildIndex(); + }, + + hover() { + return doc$1.classList.toggle('catalog-hover-expand', Conf['Catalog Hover Expand']); + }, + + hoverToggle(e) { + if (Conf['Catalog Hover Toggle'] && $$1.hasClass(doc$1, 'catalog-mode') && !$$1.modifiedClick(e) && !$$1.x('ancestor-or-self::a', e.target)) { + let thread; + const input = Index.inputs['Catalog Hover Expand']; + input.checked = !input.checked; + $$1.event('change', null, input); + if (thread = Get$1.threadFromNode(e.target)) { + Index.cb.catalogReplies.call(thread); + return Index.cb.hoverAdjust.call(thread.OP.nodes); + } + } + }, + + popstate(e) { + if (e?.state) { + const {searched, mode, sort} = e.state; + const page = Index.getCurrentPage(); + Index.setState({search: searched, mode, sort, page}); + return Index.pageLoad(false); + } else { + // page load or hash change + const nCommands = Index.processHash(); + if (Conf['Refreshed Navigation'] && nCommands) { + return Index.update(); + } else { + return Index.pageLoad(); + } + } + }, + + pageNav(e) { + let a; + if ($$1.modifiedClick(e)) { return; } + switch (e.target.nodeName) { + case 'BUTTON': + e.target.blur(); + a = e.target.parentNode; + break; + case 'A': + a = e.target; + break; + default: + return; + } + if (a.textContent === 'Catalog') { return; } + e.preventDefault(); + return Index.userPageNav(+a.pathname.split(/\/+/)[2] || 1); + }, + + refreshFront() { + Index.pushState({page: 1}); + return Index.update(); + }, + + catalogReplies() { + if (Conf['Show Replies'] && $$1.hasClass(doc$1, 'catalog-hover-expand') && !this.catalogView.nodes.replies) { + return Index.buildCatalogReplies(this); + } + }, + + hoverAdjust() { + // Prevent hovered catalog threads from going offscreen. + let x; + if (!$$1.hasClass(doc$1, 'catalog-hover-expand')) { return; } + const rect = this.post.getBoundingClientRect(); + if (x = $$1.minmax(0, -rect.left, doc$1.clientWidth - rect.right)) { + const {style} = this.post; + style.left = `${x}px`; + style.right = `${-x}px`; + return $$1.one(this.root, 'mouseleave', () => style.left = (style.right = null)); + } + } + }, + + scrollToIndex() { + // Scroll to navlinks, or top of board if navlinks are hidden. + return Header$1.scrollToIfNeeded((Index.navLinks.getBoundingClientRect().height ? Index.navLinks : Index.root)); + }, + + getCurrentPage() { + return +window.location.pathname.split(/\/+/)[2] || 1; + }, + + userPageNav(page) { + Index.pushState({page}); + if (Conf['Refreshed Navigation']) { + return Index.update(); + } else { + return Index.pageLoad(); + } + }, + + hashCommands: { + mode: { + 'paged': 'paged', + 'infinite-scrolling': 'infinite', + 'infinite': 'infinite', + 'all-threads': 'all pages', + 'all-pages': 'all pages', + 'catalog': 'catalog' + }, + sort: { + 'bump-order': 'bump', + 'last-reply': 'lastreply', + 'last-long-reply': 'lastlong', + 'creation-date': 'birth', + 'reply-count': 'replycount', + 'file-count': 'filecount', + 'posts-per-minute': 'activity' + } + }, + + processHash() { + // XXX https://bugzilla.mozilla.org/show_bug.cgi?id=483304 + let hash = location.href.match(/#.*/)?.[0] || ''; + const state = + {replace: true}; + const commands = hash.slice(1).split('/'); + const leftover = []; + for (var command of commands) { + var mode, sort; + if (mode = $$1.getOwn(Index.hashCommands.mode, command)) { + state.mode = mode; + } else if (command === 'index') { + state.mode = Conf['Previous Index Mode']; + state.page = 1; + } else if (sort = $$1.getOwn(Index.hashCommands.sort, command.replace(/-rev$/, ''))) { + state.sort = sort; + if (/-rev$/.test(command)) { state.sort += '-rev'; } + } else if (/^s=/.test(command)) { + state.search = decodeURIComponent(command.slice(2)).replace(/\+/g, ' ').trim(); + } else { + leftover.push(command); + } + } + hash = leftover.join('/'); + if (hash) { state.hash = `#${hash}`; } + Index.pushState(state); + return commands.length - leftover.length; + }, + + pushState(state) { + let {search, hash, replace} = state; + let pageBeforeSearch = history.state?.oldpage; + if ((search != null) && (search !== Index.search)) { + state.page = search ? 1 : (pageBeforeSearch || 1); + if (!search) { + pageBeforeSearch = undefined; + } else if (!Index.search) { + pageBeforeSearch = Index.currentPage; + } + } + Index.setState(state); + const pathname = Index.currentPage === 1 ? `/${g.BOARD}/` : `/${g.BOARD}/${Index.currentPage}`; + if (!hash) { hash = ''; } + return history[replace ? 'replaceState' : 'pushState']({ + mode: Conf['Index Mode'], + sort: Index.currentSort, + searched: Index.search, + oldpage: pageBeforeSearch + } + , '', `${location.protocol}//${location.host}${pathname}${hash}`); + }, + + setState({search, mode, sort, page, hash}) { + if ((search != null) && (search !== Index.search)) { + Index.changed.search = true; + Index.search = search; + } + if ((mode != null) && (mode !== Conf['Index Mode'])) { + Index.changed.mode = true; + Conf['Index Mode'] = mode; + $$1.set('Index Mode', mode); + if ((mode !== 'catalog') && (Conf['Previous Index Mode'] !== mode)) { + Conf['Previous Index Mode'] = mode; + $$1.set('Previous Index Mode', mode); + } + } + if ((sort != null) && (sort !== Index.currentSort)) { + Index.changed.sort = true; + Index.currentSort = sort; + Index.saveSort(); + } + if (['all pages', 'catalog'].includes(Conf['Index Mode'])) { page = 1; } + if ((page != null) && (page !== Index.currentPage)) { + Index.changed.page = true; + Index.currentPage = page; + } + if (hash != null) { + return Index.changed.hash = true; + } + }, + + savePerBoard(key, value) { + if (typeof Conf[key] === 'object') { + Conf[key][g.BOARD.ID] = value; + } else { + Conf[key] = value; + } + return $$1.set(key, Conf[key]); + }, + + saveSort() { + return Index.savePerBoard('Index Sort', Index.currentSort); + }, + + saveLastLongThresholds(i) { + return Index.savePerBoard(`Last Long Reply Thresholds ${i}`, Index.lastLongThresholds[i]); + }, + + pageLoad(scroll=true) { + if (!Index.liveThreadData) { return; } + let {threads, order, search, mode, sort, page, hash} = Index.changed; + if (!threads) { threads = search; } + if (!order) { order = sort; } + if (threads || order) { Index.sort(); } + if (threads) { Index.buildPagelist(); } + if (search) { Index.setupSearch(); } + if (mode) { Index.setupMode(); } + if (sort) { Index.setupSort(); } + if (threads || mode || page || order) { Index.buildIndex(); } + if (threads || page) { Index.setPage(); } + if (scroll && !hash) { Index.scrollToIndex(); } + if (hash) { Header$1.hashScroll(); } + return Index.changed = {}; + }, + + setupMode() { + for (var mode of ['paged', 'infinite', 'all pages', 'catalog']) { + $$1[mode === Conf['Index Mode'] ? 'addClass' : 'rmClass'](doc$1, `${mode.replace(/\ /g, '-')}-mode`); + } + Index.selectMode.value = Conf['Index Mode']; + Index.cb.size(); + Index.showHiddenThreads = false; + return $$1('#hidden-toggle a', Index.navLinks).textContent = 'Show'; + }, + + setupSort() { + Index.selectRev.checked = /-rev$/.test(Index.currentSort); + Index.selectSort.value = Index.currentSort.replace(/-rev$/, ''); + return Index.lastLongOptions.hidden = (Index.selectSort.value !== 'lastlong'); + }, + + getPagesNum() { + if (Index.search) { + return Math.ceil(Index.sortedThreadIDs.length / Index.threadsNumPerPage); + } else { + return Index.pagesNum; + } + }, + + getMaxPageNum() { + return Math.max(1, Index.getPagesNum()); + }, + + buildPagelist() { + const pagesRoot = $$1('.pages', Index.pagelist); + const maxPageNum = Index.getMaxPageNum(); + if (pagesRoot.childElementCount !== maxPageNum) { + const nodes = []; + for (let i = 1, end = maxPageNum; i <= end; i++) { + var a = $$1.el('a', { + textContent: i, + href: i === 1 ? './' : i + } + ); + nodes.push($$1.tn('['), a, $$1.tn('] ')); + } + $$1.rmAll(pagesRoot); + return $$1.add(pagesRoot, nodes); + } + }, + + setPage() { + let a, strong; + const pageNum = Index.currentPage; + const maxPageNum = Index.getMaxPageNum(); + const pagesRoot = $$1('.pages', Index.pagelist); + + // Previous/Next buttons + const prev = pagesRoot.previousElementSibling.firstElementChild; + const next = pagesRoot.nextElementSibling.firstElementChild; + let href = Math.max(pageNum - 1, 1); + prev.href = href === 1 ? './' : href; + prev.firstElementChild.disabled = href === pageNum; + href = Math.min(pageNum + 1, maxPageNum); + next.href = href === 1 ? './' : href; + next.firstElementChild.disabled = href === pageNum; + + // current page + if (strong = $$1('strong', pagesRoot)) { + if (+strong.textContent === pageNum) { return; } + $$1.replace(strong, strong.firstChild); + } else { + strong = $$1.el('strong'); + } + + if (a = pagesRoot.children[pageNum - 1]) { + $$1.before(a, strong); + return $$1.add(strong, a); + } + }, + + updateHideLabel() { + if (!Index.hideLabel) { return; } + let hiddenCount = 0; + for (var threadID of Index.liveThreadIDs) { + if (Index.isHidden(threadID)) { + hiddenCount++; + } + } + if (!hiddenCount) { + Index.hideLabel.hidden = true; + if (Index.showHiddenThreads) { Index.cb.toggleHiddenThreads(); } + return; + } + Index.hideLabel.hidden = false; + return $$1('#hidden-count', Index.navLinks).textContent = hiddenCount === 1 ? + '1 hidden thread' + : + `${hiddenCount} hidden threads`; + }, + + update(firstTime) { + let oldReq; + if (oldReq = Index.req) { + delete Index.req; + oldReq.abort(); + } + + if (Conf['Index Refresh Notifications']) { + // Optional notification for manual refreshes + if (!Index.notice) { Index.notice = new Notice('info', 'Refreshing index...'); } + if (!Index.nTimeout) { Index.nTimeout = setTimeout(() => { + if (Index.notice) { + Index.notice.el.lastElementChild.textContent += ' (disable JSON Index if this takes too long)'; + } + } + , 3 * SECOND); } + } else { + // Also display notice if Index Refresh is taking too long + if (!Index.nTimeout) { Index.nTimeout = setTimeout(() => Index.notice || (Index.notice = new Notice('info', 'Refreshing index... (disable JSON Index if this takes too long)')) + , 3 * SECOND); } + } + + // Hard refresh in case of incomplete page load. + if (!firstTime && (d$1.readyState !== 'loading') && !$$1('.board + *')) { + location.reload(); + return; + } + + Index.req = $$1.whenModified( + g.SITE.urls.catalogJSON({boardID: g.BOARD.ID}), + 'Index', + Index.load + ); + return $$1.addClass(Index.button, 'spin'); + }, + + load() { + let err; + if (this !== Index.req) { return; } // aborted + + $$1.rmClass(Index.button, 'spin'); + const {notice, nTimeout} = Index; + if (nTimeout) { clearTimeout(nTimeout); } + delete Index.nTimeout; + delete Index.req; + delete Index.notice; + + if (![200, 304].includes(this.status)) { + err = `Index refresh failed. ${this.status ? `Error ${this.statusText} (${this.status})` : 'Connection Error'}`; + if (notice) { + notice.setType('warning'); + notice.el.lastElementChild.textContent = err; + setTimeout(notice.close, SECOND); + } else { + new Notice('warning', err, 1); + } + return; + } + + try { + if (this.status === 200) { + Index.parse(this.response); + } else if (this.status === 304) { + Index.pageLoad(); + } + } catch (error) { + err = error; + c.error(`Index failure: ${err.message}`, err.stack); + if (notice) { + notice.setType('error'); + notice.el.lastElementChild.textContent = 'Index refresh failed.'; + setTimeout(notice.close, SECOND); + } else { + new Notice('error', 'Index refresh failed.', 1); + } + return; + } + + if (notice) { + if (Conf['Index Refresh Notifications']) { + notice.setType('success'); + notice.el.lastElementChild.textContent = 'Index refreshed!'; + setTimeout(notice.close, SECOND); + } else { + notice.close(); + } + } + + const timeEl = $$1('#index-last-refresh time', Index.navLinks); + timeEl.dataset.utc = Date.parse(this.getResponseHeader('Last-Modified')); + return RelativeDates.update(timeEl); + }, + + parse(pages) { + $$1.cleanCache(url => /^https?:\/\/a\.4cdn\.org\//.test(url)); + Index.parseThreadList(pages); + Index.changed.threads = true; + return Index.pageLoad(); + }, + + parseThreadList(pages) { + Index.pagesNum = pages.length; + Index.threadsNumPerPage = pages[0]?.threads.length || 1; + Index.liveThreadData = pages.reduce(((arr, next) => arr.concat(next.threads)), []); + Index.liveThreadIDs = Index.liveThreadData.map(data => data.no); + Index.liveThreadDict = dict(); + Index.threadPosition = dict(); + Index.parsedThreads = dict(); + Index.replyData = dict(); + for (let i = 0; i < Index.liveThreadData.length; i++) { + var obj, results; + var data = Index.liveThreadData[i]; + Index.liveThreadDict[data.no] = data; + Index.threadPosition[data.no] = i; + Index.parsedThreads[data.no] = (obj = g.SITE.Build.parseJSON(data, g.BOARD)); + obj.filterResults = (results = Filter.test(obj)); + obj.isOnTop = results.top; + obj.isHidden = results.hide || ThreadHiding.isHidden(obj.boardID, obj.threadID); + if (data.last_replies) { + for (var reply of data.last_replies) { + Index.replyData[`${g.BOARD}.${reply.no}`] = reply; + } + } + } + if (Index.liveThreadData[0]) { + g.SITE.Build.spoilerRange[g.BOARD.ID] = Index.liveThreadData[0].custom_spoiler; + } + g.BOARD.threads.forEach(function(thread) { + if (!Index.liveThreadIDs.includes(thread.ID)) { return thread.collect(); } + }); + $$1.event('IndexUpdate', + {threads: ((Index.liveThreadIDs.map((ID) => `${g.BOARD}.${ID}`)))}); + }, + + isHidden(threadID) { + let thread; + if ((thread = g.BOARD.threads.get(threadID)) && thread.OP && !thread.OP.isFetchedQuote) { + return thread.isHidden; + } else { + return Index.parsedThreads[threadID].isHidden; + } + }, + + isHiddenReply(threadID, replyData) { + return PostHiding.isHidden(g.BOARD.ID, threadID, replyData.no) || Filter.isHidden(g.SITE.Build.parseJSON(replyData, g.BOARD)); + }, + + buildThreads(threadIDs, isCatalog, withReplies) { + let errors; + const threads = []; + const newThreads = []; + let newPosts = []; + for (var ID of threadIDs) { + var opRoot, thread; + try { + var OP; + var threadData = Index.liveThreadDict[ID]; + + if (thread = g.BOARD.threads.get(ID)) { + var isStale = (thread.json !== threadData) && (JSON.stringify(thread.json) !== JSON.stringify(threadData)); + if (isStale) { + thread.setCount('post', threadData.replies + 1, threadData.bumplimit); + thread.setCount('file', threadData.images + !!threadData.ext, threadData.imagelimit); + thread.setStatus('Sticky', !!threadData.sticky); + thread.setStatus('Closed', !!threadData.closed); + } + if (thread.catalogView) { + $$1.rm(thread.catalogView.nodes.replies); + thread.catalogView.nodes.replies = null; + } + } else { + thread = new Thread(ID, g.BOARD); + newThreads.push(thread); + } + var lastPost = threadData.last_replies && threadData.last_replies.length ? threadData.last_replies[threadData.last_replies.length - 1].no : ID; + if (lastPost > thread.lastPost) { thread.lastPost = lastPost; } + thread.json = threadData; + threads.push(thread); + + if ((OP = thread.OP) && !OP.isFetchedQuote) { + OP.setCatalogOP(isCatalog); + thread.setPage(Math.floor(Index.threadPosition[ID] / Index.threadsNumPerPage) + 1); + } else { + var obj = Index.parsedThreads[ID]; + opRoot = g.SITE.Build.post(obj); + OP = new Post(opRoot, thread, g.BOARD); + OP.filterResults = obj.filterResults; + newPosts.push(OP); + } + + if (!isCatalog || !thread.nodes.root) { + g.SITE.Build.thread(thread, threadData, withReplies); + } + } catch (err) { + // Skip posts that we failed to parse. + if (!errors) { errors = []; } + errors.push({ + message: `Parsing of Thread No.${thread} failed. Thread will be skipped.`, + error: err, + html: opRoot?.outerHTML + }); + } + } + if (errors) { Main$1.handleErrors(errors); } + + if (withReplies) { + newPosts = newPosts.concat(Index.buildReplies(threads)); + } + + Main$1.callbackNodes('Thread', newThreads); + Main$1.callbackNodes('Post', newPosts); + Index.updateHideLabel(); + $$1.event('IndexRefreshInternal', {threadIDs: (threads.map((t) => t.fullID)), isCatalog}); + + return threads; + }, + + buildReplies(threads) { + let errors; + const posts = []; + for (var thread of threads) { + var lastReplies; + if (!(lastReplies = Index.liveThreadDict[thread.ID].last_replies)) { continue; } + var nodes = []; + for (var data of lastReplies) { + var node, post; + if ((post = thread.posts.get(data.no)) && !post.isFetchedQuote) { + nodes.push(post.nodes.root); + continue; + } + nodes.push(node = g.SITE.Build.postFromObject(data, thread.board.ID)); + try { + posts.push(new Post(node, thread, thread.board)); + } catch (err) { + // Skip posts that we failed to parse. + if (!errors) { errors = []; } + errors.push({ + message: `Parsing of Post No.${data.no} failed. Post will be skipped.`, + error: err, + html: node?.outerHTML + }); + } + } + $$1.add(thread.nodes.root, nodes); + } + + if (errors) { Main$1.handleErrors(errors); } + return posts; + }, + + buildCatalogViews(threads) { + const catalogThreads = []; + for (var thread of threads) { + if (!thread.catalogView) { + var {ID} = thread; + var page = Math.floor(Index.threadPosition[ID] / Index.threadsNumPerPage) + 1; + var root = g.SITE.Build.catalogThread(thread, Index.liveThreadDict[ID], page); + catalogThreads.push(new CatalogThread(root, thread)); + } + } + Main$1.callbackNodes('CatalogThread', catalogThreads); + }, + + sizeCatalogViews(threads) { + // XXX When browsers support CSS3 attr(), use it instead. + const size = Conf['Index Size'] === 'small' ? 150 : 250; + for (var thread of threads) { + var {thumb} = thread.catalogView.nodes; + var {width, height} = thumb.dataset; + if (!width) { continue; } + var ratio = size / Math.max(width, height); + thumb.style.width = (width * ratio) + 'px'; + thumb.style.height = (height * ratio) + 'px'; + } + }, + + buildCatalogReplies(thread) { + let lastReplies; + const {nodes} = thread.catalogView; + if (!(lastReplies = Index.liveThreadDict[thread.ID].last_replies)) { return; } + + const replies = []; + for (var data of lastReplies) { + if (Index.isHiddenReply(thread.ID, data)) { continue; } + var reply = g.SITE.Build.catalogReply(thread, data); + RelativeDates.update($$1('time', reply)); + $$1.on($$1('.catalog-reply-preview', reply), 'mouseover', QuotePreview.mouseover); + replies.push(reply); + } + + nodes.replies = $$1.el('div', {className: 'catalog-replies'}); + $$1.add(nodes.replies, replies); + $$1.add(thread.OP.nodes.post, nodes.replies); + }, + + sort() { + let threadIDs; + const {liveThreadIDs, liveThreadData} = Index; + if (!liveThreadData) { return; } + const tmp_time = new Date().getTime()/1000; + const sortType = Index.currentSort.replace(/-rev$/, ''); + Index.sortedThreadIDs = (() => { switch (sortType) { + case 'lastreply': case 'lastlong': + var repliesAvailable = liveThreadData.some(thread => thread.last_replies?.length); + var lastlong = function(thread) { + if (!repliesAvailable) { + return thread.last_modified; + } + const iterable = thread.last_replies || []; + for (let i = iterable.length - 1; i >= 0; i--) { + var r = iterable[i]; + if (Index.isHiddenReply(thread.no, r)) { continue; } + if (sortType === 'lastreply') { + return r; + } + var len = r.com ? g.SITE.Build.parseComment(r.com).replace(/[^a-z]/ig, '').length : 0; + if (len >= Index.lastLongThresholds[+!!r.ext]) { + return r; + } + } + if (thread.omitted_posts && thread.last_replies?.length) { return thread.last_replies[0]; } else { return thread; } + }; + var lastlongD = dict(); + for (var thread of liveThreadData) { + lastlongD[thread.no] = lastlong(thread).no; + } + return [...Array.from(liveThreadData)].sort((a, b) => lastlongD[b.no] - lastlongD[a.no]).map(post => post.no); + case 'bump': return liveThreadIDs; + case 'birth': return [...Array.from(liveThreadIDs) ].sort((a, b) => b - a); + case 'replycount': return [...Array.from(liveThreadData)].sort((a, b) => b.replies - a.replies).map(post => post.no); + case 'filecount': return [...Array.from(liveThreadData)].sort((a, b) => b.images - a.images).map(post => post.no); + case 'activity': return [...Array.from(liveThreadData)].sort((a, b) => ((tmp_time-a.time)/(a.replies+1)) - ((tmp_time-b.time)/(b.replies+1))).map(post => post.no); + default: return liveThreadIDs; + } })(); + if (/-rev$/.test(Index.currentSort)) { + Index.sortedThreadIDs = [...Array.from(Index.sortedThreadIDs)].reverse(); + } + if (Index.search && (threadIDs = Index.querySearch(Index.search))) { + Index.sortedThreadIDs = threadIDs; + } + // Sticky threads + Index.sortOnTop(obj => obj.isSticky); + // Highlighted threads + Index.sortOnTop(obj => obj.isOnTop || (Conf['Pin Watched Threads'] && ThreadWatcher$1.isWatchedRaw(obj.boardID, obj.threadID))); + // Non-hidden threads + if (Conf['Anchor Hidden Threads']) { return Index.sortOnTop(obj => !Index.isHidden(obj.threadID)); } + }, + + sortOnTop(match) { + const topThreads = []; + const bottomThreads = []; + for (var ID of Index.sortedThreadIDs) { + (match(Index.parsedThreads[ID]) ? topThreads : bottomThreads).push(ID); + } + return Index.sortedThreadIDs = topThreads.concat(bottomThreads); + }, + + buildIndex() { + let threadIDs; + if (!Index.liveThreadData) { return; } + switch (Conf['Index Mode']) { + case 'all pages': + threadIDs = Index.sortedThreadIDs; + break; + case 'catalog': + threadIDs = Index.sortedThreadIDs.filter(ID => !Index.isHidden(ID) !== Index.showHiddenThreads); + break; + default: + threadIDs = Index.threadsOnPage(Index.currentPage); + } + delete Index.pageNum; + $$1.rmAll(Index.root); + $$1.rmAll(Header$1.hover); + if (Index.loaded && Index.root.parentNode) { + $$1.event('PostsRemoved', null, Index.root); + } + if (Conf['Index Mode'] === 'catalog') { + Index.buildCatalog(threadIDs); + } else { + Index.buildStructure(threadIDs); + } + }, + + threadsOnPage(pageNum) { + const nodesPerPage = Index.threadsNumPerPage; + const offset = nodesPerPage * (pageNum - 1); + return Index.sortedThreadIDs.slice(offset , offset + nodesPerPage); + }, + + buildStructure(threadIDs) { + const threads = Index.buildThreads(threadIDs, false, Conf['Show Replies']); + const nodes = []; + for (var thread of threads) { + nodes.push(thread.nodes.root, $$1.el('hr')); + } + $$1.add(Index.root, nodes); + if (Index.root.parentNode) { + $$1.event('PostsInserted', null, Index.root); + } + Index.loaded = true; + }, + + buildCatalog(threadIDs) { + let i = 0; + const n = threadIDs.length; + let node0 = null; + var fn = function() { + if (node0 && !node0.parentNode) { return; } // Index.root cleared + const j = (i > 0) && Index.root.parentNode ? n : i + 30; + node0 = Index.buildCatalogPart(threadIDs.slice(i, j))[0]; + i = j; + if (i < n) { + return $$1.queueTask(fn); + } else { + if (Index.root.parentNode) { + $$1.event('PostsInserted', null, Index.root); + } + return Index.loaded = true; + } + }; + fn(); + }, + + buildCatalogPart(threadIDs) { + const threads = Index.buildThreads(threadIDs, true); + Index.buildCatalogViews(threads); + Index.sizeCatalogViews(threads); + const nodes = []; + for (var thread of threads) { + thread.OP.setCatalogOP(true); + $$1.add(thread.catalogView.nodes.root, thread.OP.nodes.root); + nodes.push(thread.catalogView.nodes.root); + $$1.on(thread.catalogView.nodes.root, 'mouseenter', Index.cb.catalogReplies.bind(thread)); + $$1.on(thread.OP.nodes.root, 'mouseenter', Index.cb.hoverAdjust.bind(thread.OP.nodes)); + } + $$1.add(Index.root, nodes); + return nodes; + }, + + clearSearch() { + Index.searchInput.value = ''; + Index.onSearchInput(); + return Index.searchInput.focus(); + }, + + setupSearch() { + Index.searchInput.value = Index.search; + if (Index.search) { + return Index.searchInput.dataset.searching = 1; + } else { + // XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1021289 + return Index.searchInput.removeAttribute('data-searching'); + } + }, + + onSearchInput() { + const search = Index.searchInput.value.trim(); + if (search === Index.search) { return; } + Index.pushState({ + search, + replace: !!search === !!Index.search + }); + return Index.pageLoad(false); + }, + + querySearch(query) { + let keywords, match; + if (match = query.match(/^([\w+]+):\/(.*)\/(\w*)$/)) { + let regexp; + try { + regexp = RegExp(match[2], match[3]); + } catch (error) { + return []; + } + return Index.sortedThreadIDs.filter(ID => regexp.test(Filter.values(match[1], Index.parsedThreads[ID]).join('\n'))); + } + if (!(keywords = query.toLowerCase().match(/\S+/g))) { return; } + return Index.sortedThreadIDs.filter(ID => Index.searchMatch(Index.parsedThreads[ID], keywords)); + }, + + searchMatch(obj, keywords) { + const {info, file} = obj; + if (info.comment == null) { info.comment = g.SITE.Build.parseComment(info.commentHTML.innerHTML); } + let text = []; + for (var key of ['comment', 'subject', 'name', 'tripcode']) { + if (key in info) { text.push(info[key]); } + } + if (file) { text.push(file.name); } + text = text.join(' ').toLowerCase(); + for (var keyword of keywords) { + if (-1 === text.indexOf(keyword)) { return false; } + } + return true; + } + }; + var Index$1 = Index; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var ThreadHiding = { + init() { + if (!['index', 'catalog'].includes(g.VIEW) || (!Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Index'])) { return; } + this.db = new DataBoard('hiddenThreads'); + if (g.VIEW === 'catalog') { return this.catalogWatch(); } + this.catalogSet(g.BOARD); + $$1.on(d$1, 'IndexRefreshInternal', this.onIndexRefresh); + if (Conf['Thread Hiding Buttons']) { + $$1.addClass(doc$1, 'thread-hide'); + } + return Callbacks.Post.push({ + name: 'Thread Hiding', + cb: this.node + }); + }, + + catalogSet(board) { + if (!$$1.hasStorage || (g.SITE.software !== 'yotsuba')) { return; } + const hiddenThreads = ThreadHiding.db.get({ + boardID: board.ID, + defaultValue: dict() + }); + for (var threadID in hiddenThreads) { hiddenThreads[threadID] = true; } + return localStorage.setItem(`4chan-hide-t-${board}`, JSON.stringify(hiddenThreads)); + }, + + catalogWatch() { + if (!$$1.hasStorage || (g.SITE.software !== 'yotsuba')) { return; } + this.hiddenThreads = JSON.parse(localStorage.getItem(`4chan-hide-t-${g.BOARD}`)) || {}; + return Main$1.ready(() => // 4chan's catalog sets the style to "display: none;" when hiding or unhiding a thread. + new MutationObserver(ThreadHiding.catalogSave).observe($$1.id('threads'), { + attributes: true, + subtree: true, + attributeFilter: ['style'] + })); + }, + + catalogSave() { + let threadID; + const hiddenThreads2 = JSON.parse(localStorage.getItem(`4chan-hide-t-${g.BOARD}`)) || {}; + for (threadID in hiddenThreads2) { + if (!$$1.hasOwn(ThreadHiding.hiddenThreads, threadID)) { + ThreadHiding.db.set({ + boardID: g.BOARD.ID, + threadID, + val: {makeStub: Conf['Stubs']}}); + } + } + for (threadID in ThreadHiding.hiddenThreads) { + if (!$$1.hasOwn(hiddenThreads2, threadID)) { + ThreadHiding.db.delete({ + boardID: g.BOARD.ID, + threadID + }); + } + } + return ThreadHiding.hiddenThreads = hiddenThreads2; + }, + + isHidden(boardID, threadID) { + return !!(ThreadHiding.db && ThreadHiding.db.get({boardID, threadID})); + }, + + node() { + let data; + if (this.isReply || this.isClone || this.isFetchedQuote) { return; } + + if (Conf['Thread Hiding Buttons']) { + $$1.prepend(this.nodes.root, ThreadHiding.makeButton(this.thread, 'hide')); + } + + if (data = ThreadHiding.db.get({boardID: this.board.ID, threadID: this.ID})) { + return ThreadHiding.hide(this.thread, data.makeStub); + } + }, + + onIndexRefresh() { + return g.BOARD.threads.forEach(function(thread) { + const {root} = thread.nodes; + if (thread.isHidden && thread.stub && !root.contains(thread.stub)) { + return ThreadHiding.makeStub(thread, root); + } + }); + }, + + menu: { + init() { + if ((g.VIEW !== 'index') || !Conf['Menu'] || !Conf['Thread Hiding Link']) { return; } + + let div = $$1.el('div', { + className: 'hide-thread-link', + textContent: 'Hide' + } + ); + + const apply = $$1.el('a', { + textContent: 'Apply', + href: 'javascript:;' + } + ); + $$1.on(apply, 'click', ThreadHiding.menu.hide); + + const makeStub = UI.checkbox('Stubs', 'Make stub'); + + Menu.menu.addEntry({ + el: div, + order: 20, + open({thread, isReply}) { + if (isReply || thread.isHidden || (Conf['JSON Index'] && (Conf['Index Mode'] === 'catalog'))) { + return false; + } + ThreadHiding.menu.thread = thread; + return true; + }, + subEntries: [{el: apply}, {el: makeStub}]}); + + div = $$1.el('a', { + className: 'show-thread-link', + textContent: 'Show', + href: 'javascript:;' + } + ); + $$1.on(div, 'click', ThreadHiding.menu.show); + + Menu.menu.addEntry({ + el: div, + order: 20, + open({thread, isReply}) { + if (isReply || !thread.isHidden || (Conf['JSON Index'] && (Conf['Index Mode'] === 'catalog'))) { + return false; + } + ThreadHiding.menu.thread = thread; + return true; + } + }); + + const hideStubLink = $$1.el('a', { + textContent: 'Hide stub', + href: 'javascript:;' + } + ); + $$1.on(hideStubLink, 'click', ThreadHiding.menu.hideStub); + + return Menu.menu.addEntry({ + el: hideStubLink, + order: 15, + open({thread, isReply}) { + if (isReply || !thread.isHidden || (Conf['JSON Index'] && (Conf['Index Mode'] === 'catalog'))) { + return false; + } + return ThreadHiding.menu.thread = thread; + } + }); + }, + + hide() { + const makeStub = $$1('input', this.parentNode).checked; + const {thread} = ThreadHiding.menu; + ThreadHiding.hide(thread, makeStub); + ThreadHiding.saveHiddenState(thread, makeStub); + return $$1.event('CloseMenu'); + }, + + show() { + const {thread} = ThreadHiding.menu; + ThreadHiding.show(thread); + ThreadHiding.saveHiddenState(thread); + return $$1.event('CloseMenu'); + }, + + hideStub() { + const {thread} = ThreadHiding.menu; + ThreadHiding.show(thread); + ThreadHiding.hide(thread, false); + ThreadHiding.saveHiddenState(thread, false); + $$1.event('CloseMenu'); + } + }, + + makeButton(thread, type) { + const a = $$1.el('a', { + className: `${type}-thread-button`, + href: 'javascript:;' + } + ); + $$1.extend(a, {textContent: type === "hide" ? '➖︎' : '➕︎' }); + a.dataset.fullID = thread.fullID; + $$1.on(a, 'click', ThreadHiding.toggle); + return a; + }, + + makeStub(thread, root) { + let summary, threadDivider; + let numReplies = $$(g.SITE.selectors.replyOriginal, root).length; + if (summary = $$1(g.SITE.selectors.summary, root)) { numReplies += +summary.textContent.match(/\d+/); } + + const a = ThreadHiding.makeButton(thread, 'show'); + $$1.add(a, $$1.tn(` ${thread.OP.info.nameBlock} (${numReplies === 1 ? '1 reply' : `${numReplies} replies`})`)); + thread.stub = $$1.el('div', + {className: 'stub'}); + if (Conf['Menu']) { + $$1.add(thread.stub, [a, Menu.makeButton(thread.OP)]); + } else { + $$1.add(thread.stub, a); + } + $$1.prepend(root, thread.stub); + + // Prevent hiding of thread divider on sites that put it inside the thread + if (threadDivider = $$1(g.SITE.selectors.threadDivider, root)) { + return $$1.addClass(threadDivider, 'threadDivider'); + } + }, + + saveHiddenState(thread, makeStub) { + if (thread.isHidden) { + ThreadHiding.db.set({ + boardID: thread.board.ID, + threadID: thread.ID, + val: {makeStub}}); + } else { + ThreadHiding.db.delete({ + boardID: thread.board.ID, + threadID: thread.ID + }); + } + return ThreadHiding.catalogSet(thread.board); + }, + + toggle(thread) { + if (!(thread instanceof Thread)) { + thread = g.threads.get(this.dataset.fullID); + } + if (thread.isHidden) { + ThreadHiding.show(thread); + } else { + ThreadHiding.hide(thread); + } + return ThreadHiding.saveHiddenState(thread); + }, + + hide(thread, makeStub=Conf['Stubs']) { + if (thread.isHidden) { return; } + const threadRoot = thread.nodes.root; + thread.isHidden = true; + Index$1.updateHideLabel(); + if (thread.catalogView && !Index$1.showHiddenThreads) { + $$1.rm(thread.catalogView.nodes.root); + $$1.event('PostsRemoved', null, Index$1.root); + } + + if (!makeStub) { return threadRoot.hidden = true; } + + return ThreadHiding.makeStub(thread, threadRoot); + }, + + show(thread) { + if (thread.stub) { + $$1.rm(thread.stub); + delete thread.stub; + } + const threadRoot = thread.nodes.root; + threadRoot.hidden = (thread.isHidden = false); + Index$1.updateHideLabel(); + if (thread.catalogView && Index$1.showHiddenThreads) { + $$1.rm(thread.catalogView.nodes.root); + return $$1.event('PostsRemoved', null, Index$1.root); + } + } + }; + + /* + * This file has the code for the jsx to { innerHTML: "safe string" } + * + * Usage: import h from this file. + * Attributes are stringified raw, so the names must be like html text: eg class and not className. + * Boolean values are stringified as followed: true will mean the attribute is there, false means it will be omitted. + * Strings bound to attributes and children will be escaped automatically. + * It returns interface EscapedHtml { innerHTML: "safe string", [isEscaped]: true } + * + * For strings that don't have a parent element you can use fragments: <>. + * Note that you need to import hFragment, which for some reason isn't auto imported on "add all missing imports" + */ + /** + * The symbol indicating that a string is safely escaped. + * This is a symbol so it can't be faked by a json blob from the internet. + */ + const isEscaped = Symbol('isEscaped'); + const voidElements = new Set(['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'source', 'track', 'wbr',]); + const hFragment = Symbol('hFragment'); + /** Function that jsx/tsx will be compiled to. */ + function h(tag, attributes, ...children) { + let innerHTML = tag === hFragment ? '' : `<${tag}`; + if (attributes) { + for (const [attribute, value] of Object.entries(attributes)) { + if (!value && value !== 0) + continue; + innerHTML += ` ${attribute}`; + if (value === true) + continue; + innerHTML += `="${E(value.toString())}"`; + } + } + if (tag !== hFragment) + innerHTML += '>'; + const isVoid = tag !== hFragment && voidElements.has(tag); + if (isVoid) { + if (children.length) + throw new TypeError(`${tag} is a void html element and can't have child elements`); + } + else { + for (const child of children) { + if (child === null || child === undefined || child === '') + continue; + if (child instanceof Object && "innerHTML" in child && child[isEscaped]) { + innerHTML += child.innerHTML; + continue; + } + innerHTML += E(child.toString()); + } + } + if (!isVoid && tag !== hFragment) + innerHTML += ``; + return { innerHTML, [isEscaped]: true }; + } + + // \u00A0 is non breaking space + const separator = '\u00A0|\u00A0'; + const settingsHtml = h("div", { id: "fourchanx-settings", class: "dialog" }, + h("nav", null, + h("div", { class: "sections-list" }), + h("p", { class: "imp-exp-result warning" }), + h("div", { class: "credits" }, + h("a", { class: "export" }, "Export"), + separator, + h("a", { class: "import" }, "Import"), + separator, + h("a", { class: "reset" }, "Reset Settings"), + separator, + h("input", { type: "file", hidden: true }), + h("a", { href: meta.page, target: "_blank" }, meta.name), + separator, + h("a", { href: meta.changelog, target: "_blank" }, g.VERSION), + separator, + h("a", { href: meta.issues, target: "_blank" }, "Issues"), + separator, + h("a", { href: "javascript:;", class: "close", title: "Close" }, "\u2715"))), + h("div", { class: "section-container" }, + h("section", null))); + + var FilterGuidePage = `
            Filter is disabled.
            +

            + Use regular expressions, one per line.
            + Lines starting with a # will be ignored.
            + For example, /weeaboo/i will filter posts containing the string \`weeaboo\`, case-insensitive.
            + MD5 and Unique ID filtering use exact string matching, not regular expressions. +

            +
              You can use these settings with each regular expression, separate them with semicolons: +
            • + Per boards, separate them with commas. It is global if not specified. Use sfw and nsfw to reference all worksafe or not-worksafe boards.
              + For example: boards:a,jp;.
              + To specify boards on a particular site, put the beginning of the domain and a slash character before the list.
              + Any initial www. should not be included, and all 4chan domains are considered 4chan.org.
              + For example: boards:4:a,jp,sama:a,z;.
              + An asterisk can be used to specify all boards on a site.
              + For example: boards:4:*;.
              +
            • +
            • + Select boards to be excluded from the filter. The syntax is the same as for the boards: option above.
              + For example: exclude:vg,v;. +
            • +
            • + Filter OPs only along with their threads (\`only\`) or replies only (\`no\`).
              + For example: op:only; or op:no;. +
            • +
            • + Filter only posts with files (\`only\`) or only posts without files (\`no\`).
              + For example: file:only; or file:no;. +
            • +
            • + Overrule the \`Show Stubs\` setting if specified: create a stub (\`yes\`) or not (\`no\`).
              + For example: stub:yes; or stub:no;. +
            • +
            • + Highlight instead of hiding. You can specify a class name to use with a userstyle.
              + For example: highlight; or highlight:wallpaper;. +
            • +
            • + Highlighted OPs will have their threads put on top of the board index by default.
              + For example: top:yes; or top:no;. +
            • +
            • + Show a desktop notification instead of hiding.
              + For example: notify;. +
            • +
            • + Filters in the "General" section apply to multiple fields, by default subject,name,filename,comment.
              + The fields can be specified with the type option, separated by commas.
              + For example: type:@{filterTypes};.
              + Types can also be combined with a + sign; this indicates the filter applies to the given fields joined by newlines.
              + For example: type:filename+filesize+dimensions;.
              +
            • +
            +`; + + var SaucePage = `
            Sauce is disabled.
            + +
            + +
            These parameters will be replaced by their corresponding values in the URL and displayed text:
            +
              +
            • %IMG: Full image URL for GIF, JPG, and PNG; thumbnail URL for other types.
            • +
            • %URL: Full image URL.
            • +
            • %TURL: Thumbnail URL.
            • +
            • %name: Original file name.
            • +
            • %board: Current board.
            • +
            • %MD5: MD5 hash in base64.
            • +
            • %sMD5: MD5 hash in base64 using - and _.
            • +
            • %hMD5: MD5 hash in hexadecimal.
            • +
            • %$0: Matched regular expression within the filename.
            • +
            • %$1, %$2, %$3, ... : Subexpressions within the matched regular expression.
            • +
            • %%, %semi: Literal % and ;.
            • +
            +
            Lines starting with a # will be ignored.
            +
            You can specify a display text by appending ;text:[text] to the URL.
            +
            You can specify the applicable boards/sites by appending ;boards:[board1],[board2]. See the Filter guide for details.
            +
            You can specify the applicable file types by appending ;types:[extension1],[extension2].
            +
            You can specify a regular expression the filename must match by appending ;regexp:[regular expression].
            +
            + +`; + + var AdvancedPage = `
            + Archives +
            404 Redirect is disabled.
            + + + + + + + + +
            Thread redirectionPost fetchingFile redirection
            +
            +
            + Archive Lists: Each line below should be an archive list in this format or a URL to load an archive list from.
            + Archive properties can be overriden by another item with the same uid (or if absent, its name). +
            + + Last updated: +
            + +
            + External Catalog +
            External Catalog is disabled. This will be used only as a fallback.
            +
            + URLs of external catalog sites, where %board is to be replaced by the board name.
            + Each URL should be followed by ;boards: and optionally ;exclude: and a list of supported/excluded boards in the format explained in the Filter guide. +
            + +
            + +
            + Override 4chan Image Host +
            Change 4chan image links to this domain. Leave blank for no change.
            +
            + +
            + +
            + Captcha Language +
            Choose from list of language codes. Leave blank to autoselect.
            +
            +
            + +
            + Custom Board Navigation +
            + New lines will be converted into spaces.

            +
            In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
            +
            Board link: g
            +
            Archive link: g-archive
            +
            Internal archive link: g-expired
            +
            Title link: g-title
            +
            Board link (Replace with title when on that board): g-replace
            +
            Full text link: g-full
            +
            Custom text link: g-text:"Install Gentoo"
            +
            Index-only link: g-index
            +
            Catalog-only link: g-catalog
            +
            Index mode: g-mode:"infinite scrolling"
            +
            Index sort: g-sort:"creation date rev"
            +
            External link: external-text:"Google","http://www.google.com"
            +
            Open in new tab: g-nt
            +
            Combinations are possible: g-index-text:"Technology Index"
            +
            Full board list toggle: toggle-all
            +
            +
            + [ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:"Piracy"]
            + will give you
            + [ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
            + if you are on /g/. +
            +
            + +
            + Time Formatting is disabled. +
            :
            + +
            Day: %a, %A, %d, %e
            +
            Month: %m, %b, %B
            +
            Year: %y, %Y
            +
            Hour: %k, %H, %l, %I, %p, %P
            +
            Minute: %M
            +
            Second: %S
            +
            Literal %: %%
            + +
            + +
            + Quote Backlinks formatting is disabled. +
            :
            +
            + +
            + Default pasted content filename +
            .png
            +
            + +
            + File Info Formatting is disabled. +
            :
            +
            Link: %l (truncated), %L (untruncated), %T (4chan filename)
            +
            Filename: %n (truncated), %N (untruncated), %t (4chan filename)
            +
            Download button: %d
            +
            Quick filter MD5: %f
            +
            Spoiler indicator: %p
            +
            Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
            +
            Resolution: %r (Displays 'PDF' for PDF files)
            +
            Tag: %g +
            Literal %: %%
            +
            + +
            + Quick Reply Personas + +

            + One item per line.
            + Items will be added in the relevant input's auto-completion list.
            + Password items will always be used, since there is no password input.
            + Lines starting with a # will be ignored. +

            +
              You can use these settings with each item, separate them with semicolons: +
            • Possible items are: name, options (or equivalently email), subject and password.
            • +
            • Wrap values of items with quotes, like this: options:"sage".
            • +
            • Force values as defaults with the always keyword, for example: options:"sage";always.
            • +
            • Select specific boards for an item, separated with commas, for example: options:"sage";boards:jp;always.
            • +
            +
            + +
            + Unread Favicon is disabled. + + +
            + +
            + Thread Updater is disabled. +
            + Interval: seconds +
            +
            + +
            + Custom Cooldown Time +
            + Seconds: +
            +
            + +
            + + + +
            For more information about customizing 4chan X's CSS, see the styling guide.
            + + +
            + +
            + Javascript Whitelist +
            + Sources from which Javascript is allowed to be loaded by Content Security Policy.
            + Lines starting with a # will be ignored. +
            + +
            + +
            + Known Banners +
            List of known banners, used for click-to-change feature.
            + +
            +`; + + var KeybindsPage = `
            Keybinds are disabled.
            +
            Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
            +
            Press Backspace to disable a keybind.
            + + +
            ActionsKeybinds
            +`; + + var FilterSelectPage = ` +
            +`; + + var burichan = `/* General */ +:root.burichan .dialog { + background-color: #D6DAF0; + border-color: #B7C5D9; +} +:root.burichan .field:focus, +:root.burichan .field.focus { + border-color: #98E; +} + +/* Header */ +:root.burichan #header-bar.dialog { + background-color: rgba(214,218,240,0.98); +} +:root.burichan:not(.fixed) #header-bar, :root.burichan #header-bar #notifications { + font-size: 11pt; +} +:root.burichan #header-bar, :root.burichan #header-bar #notifications { + color: #89A; +} +:root.burichan #header-bar a, :root.burichan #header-bar #notifications a { + color: #34345C; +} + +/* Settings */ +:root.burichan #fourchanx-settings fieldset, :root.burichan .section-main div::before { + border-color: #B7C5D9; +} +:root.burichan .suboption-list > div:last-of-type { + background-color: #D6DAF0; +} + +/* Catalog */ +:root.burichan.catalog-hover-expand .catalog-container:hover > .post { + background-color: #D6DAF0; +} +:root.burichan.werkTyme .catalog-thread:not(:hover), +:root.burichan.werkTyme:not(.catalog-hover-expand) .catalog-thread, +:root.burichan.catalog-hover-expand .catalog-container:hover > .post, +:root.burichan.catalog-hover-expand .catalog-container:hover .catalog-reply { + border-color: #B7C5D9; +} + +/* Quote */ +:root.burichan .backlink.deadlink { + color: #34345C !important; +} +:root.burichan .inline { + border-color: #B7C5D9; + background-color: rgba(255, 255, 255, .14); +} + +/* Fappe and Werk Tyme */ +:root.burichan .indicator { + color: #D6DAF0; +} + +/* Anonymize */ +:root.burichan.anonymize $site$info$name::before { + font-size: 12pt; +} + +/* QR */ +.burichan #dump-list::-webkit-scrollbar-thumb { + background-color: #D6DAF0; + border-color: #B7C5D9; +} +:root.burichan .qr-preview { + background-color: rgba(0, 0, 0, .15); +} +:root.burichan .qr-link { + border-color: rgb(199, 203, 225) rgb(199, 203, 225) rgb(184, 188, 210); + background: linear-gradient(#E5E9FF, #D6DAF0) repeat scroll 0% 0% transparent; +} +:root.burichan .qr-link:hover { + background: #D9DDF3; +} + +/* Menu */ +:root.burichan #menu { + color: #000000; +} +:root.burichan .entry { + font-size: 12pt; +} +:root.burichan .focused.entry { + background: rgba(255, 255, 255, .33); +} + +/* Unread */ +:root.burichan .unread-mark-read { + background-color: rgba(214,218,240,0.5); +} + +/* Thread Watcher */ +:root.burichan .replies-quoting-you > a, :root.burichan #watcher-link.replies-quoting-you, :root.burichan .last-page > a > .watcher-page { + color: #F00; +} + +/* Watcher Favicon */ +:root.burichan .watch-thread-link +{ + background-image: url("data:image/svg+xml,"); +} +`; + + var futaba = `/* General */ +:root.futaba .dialog { + background-color: #F0E0D6; + border-color: #D9BFB7; +} +:root.futaba .field:focus, +:root.futaba .field.focus { + border-color: #EA8; +} + +/* Header */ +:root.futaba #header-bar.dialog { + background-color: rgba(240,224,214,0.98); +} +:root.futaba:not(.fixed) #header-bar, :root.futaba #notifications { + font-size: 11pt; +} +:root.futaba #header-bar, :root.futaba #notifications { + color: #B86; +} +:root.futaba #header-bar a, :root.futaba #notifications a { + color: #800000; +} + +/* Settings */ +:root.futaba #fourchanx-settings fieldset, :root.futaba .section-main div::before { + border-color: #D9BFB7; +} +:root.futaba .suboption-list > div:last-of-type { + background-color: #F0E0D6; +} + +/* Catalog */ +:root.futaba.catalog-hover-expand .catalog-container:hover > .post { + background-color: #F0E0D6; +} +:root.futaba.werkTyme .catalog-thread:not(:hover), +:root.futaba.werkTyme:not(.catalog-hover-expand) .catalog-thread, +:root.futaba.catalog-hover-expand .catalog-container:hover > .post, +:root.futaba.catalog-hover-expand .catalog-container:hover .catalog-reply { + border-color: #D9BFB7; +} + +/* Quote */ +:root.futaba .backlink.deadlink { + color: #00E !important; +} +:root.futaba .inline { + border-color: #D9BFB7; + background-color: rgba(255, 255, 255, .14); +} + +/* Fappe and Werk Tyme */ +:root.futaba .indicator { + color: #F0E0D6; +} + +/* Anonymize */ +:root.futaba.anonymize $site$info$name::before { + font-size: 12pt; +} + +/* QR */ +.futaba #dump-list::-webkit-scrollbar-thumb { + background-color: #F0E0D6; + border-color: #D9BFB7; +} +:root.futaba .qr-preview { + background-color: rgba(0, 0, 0, .15); +} +:root.futaba .qr-link { + border-color: rgb(225, 209, 199) rgb(225, 209, 199) rgb(210, 194, 184); + background: linear-gradient(#FFEFE5, #F0E0D6) repeat scroll 0% 0% transparent; +} +:root.futaba .qr-link:hover { + background: #F0E0D6; +} + +/* Menu */ +:root.futaba #menu { + color: #800000; +} +:root.futaba .entry { + font-size: 12pt; +} +:root.futaba .focused.entry { + background: rgba(255, 255, 255, .33); +} + +/* Unread */ +:root.futaba .unread-mark-read { + background-color: rgba(240,224,214,0.5); +} + +/* Thread Watcher */ +:root.futaba .replies-quoting-you > a, :root.futaba #watcher-link.replies-quoting-you, :root.futaba .last-page > a > .watcher-page { + color: #F00; +} + +/* Watcher Favicon */ +:root.futaba .watch-thread-link +{ + background-image: url("data:image/svg+xml,"); +} +`; + + var linkifyAudio = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAitJREFUOE9jYCAWKJWwavr0KyXWb/FIbDtUFFyzJx6nVofE2Xo5nXsj0rqPNSR0nVkR2Hjmgmfd+U9Otdf+m5Vf/6+SfeU/R9ChVVgNYDRtlfJuuPA/rPfe/4QpD/6nznj0P27Kw/9unff/69Xf+69c/+C/SO7N/0z+OAxgMmmRCe++/r9i3ev/KWvf/vdY8PK/bt/9/wrNV3/IN5y/IVt1YqNg4pGTTP4HsbuA2bhZ2qvpyn+xjIObxAp3VwqlrgngLFyryVy5nhPmZJHANS2cwYexG8BmVC/pWn3hP4NZlzWuQDJI3dIiFnUUuwEsQAOcq87jNcC7fHeLUtJxHF4AGmBWeAavAWH1+1rUUk7giAWjOknllON4DXAs2NEiG4/DBQxAF/CFHfrPYI4jDFSLuJVjNrUJhB/B7gIGo1pJRt99GAZYJK7wLJ1z7Xzl4vu/7aqv/GRBj0bjqAX2qb0nJ7mXH17C4HcUxQA+hymWtSue/C5a9up/9Ozn/7Vr7v1nRY7GqMb91T3b3v6vWvPmf/S0p/9ZQk+DDLCBRSOz06Jqk+o7/21nvfqvsebDf7kZL/5zBaxphkezd+OFn7HzXvz3Wvjmv9a8N//5Ek//ZTBpVYUrMG2X5wjcdl68+uI/wa5Lr3hSNjczGFeywOVZ/bbcVGp//F9izfv/Ql03f3P4LC/HSEQquYwMFnUCDJ7dzBhyjGZNQpye89M5gpfnMvtNUyE2h4PUAQBovvT7lyNljwAAAABJRU5ErkJggg=='; + + var linkifyBitchute = 'iVBORw0KGgoAAAANSUhE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J3f6P0XAMA/kxou7OXCdnoAAAAASUVORK5CYII='; + + var linkifyClyp = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAwUExURTSY22ey5E2l4KbS75rM7Y3F64C/6f///8zl9nS45r/f9PL5/UGe3bPY8Vqr4v///wNjrzUAAAABYktHRA8YugDZAAAAB3RJTUUH4AINEi85AIH95AAAAE9JREFUCNdjYMAGGBWgDGYHCM2a3hkAZmi0dzSBaKaO9o5moCqmLiCjYzNQyw4QowIodQzI6E0AKcpo72gE6+Jyb1kAMehUA9RktgdYbQYAjGIVNGGXBJkAAAAASUVORK5CYII='; + + var linkifyDailymotion = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURQBk3ff6/trp+kKO5wZt3xx54q7P9Ozz/IS17zOG5WKh653E8sbc9/GbbcoAAABZSURBVAjXY2BAASyhDhAGc9oECMOjyAAiESEEYrBYpLWBGcwHxcvBjDDxHelghpF0yDQwY3kVgweEUeEQDWbMEepqAjO8FMsLIeYsU8o+BrbCdWboTAe4AwALXxWGjW41FwAAAABJRU5ErkJggg=='; + + var linkifyGfycat = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAjVBMVEWn3gCo3gSr3w2t4BSu4Bav4Ri35C+45DK45DO55DXA50rA50vB50zC6E/D6FTF6VjG6VvL62vN7G/P7XbQ7XfW74vY8JDa8ZTe8qDe8qLf86Pi9Kzj9K7k9LHp9sDp98Lq98Ps+Mr0++L5/O75/fD6/fH6/fL6/fP7/fT7/fb8/ff8/vj8/vn+/v7///91X4cfAAAAcklEQVR42o3M2xKBUACF4aVQckrIuRJK6H//x2sme4/MuPDfre9i6c/Cc3U5Dj87BuAxsXvGu6JvIIXEHRWwNHCHQNrCzkAF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Rln7jX9bNMkMJnbhoFRL1xCqmKx6/yi2fYXa/c5/e846PV/5fW0/7OPx/yfcjzop34ulxdGGvDuU8mMXaX507lBuiN6ueadmQeT/p/93vf/1O+G//sP5fw/eL3o/5JLif8zVxs+Tlir9S26UyeFQQvJGBE7FvaFZ9LfN+1y+WjbItSb3GmXvXd15v8zroH/HxgE/D+aGPx/18vi/z07PeZNPRKxe/Kh0Ae8toxscCO4zBkYXArk9C1SxJUYjBkYPPIVtbbuTftz3cz//2O9wP/75iSAXdO72/dt2HL5F6YlfBW4MiJYXMiBiW3t7azHBx+V/t89N+H/8a+1//e9K/9attDp5LQjYX8SuvVL8RoAkmxa65299Erq1FnHo0qrl7t4BddriIs4MrM3rfWcFd+pGwVSAwBZ0bKP8yrZPAAAAABJRU5ErkJggg=='; + + var linkifyYoutube = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAMCAYAAABr5z2BAAABIklEQVQoz53LvUrDUBjG8bOoOammSf1IoBSvoCB4JeIqOHgBLt6AIMRBBQelWurQ2kERnMRBsBUcIp5FJSBI5oQsJVkkUHh8W0o5nhaFHvjBgef/Mq+Q46RJBMkI/vE+aOus956tnEswIZe1LV0QyJ5sE2GzgZfVMtRNIdiDpccEssdlB1mW4bvTwdvWJtRdErM7U+8S/FJykCRJX5qm+KpVce8UMNLRLbulz4iSjTAMh6Iowsd5BeNadp3nUF0VlxAEwZBotXC0Usa4ll3meZdA1iguwvf9vpvDA2wvmKgYGtSud8suDB4TyGr2PF49D/vra9jRZ1BVdknMzgwuCGSnZEObwu6sBnVTCHZiaC7BhFx2PKdxUidiAH/4lLo9Mv0DELVs9qsOHXwAAAAASUVORK5CYII='; + + var photon = `/* General */ +:root.photon .dialog { + background-color: #DDD; + border-color: #CCC; +} +:root.photon .field:focus, +:root.photon .field.focus { + border-color: #EA8; +} + +/* 4chan style fixes */ +:root.photon #arc-list tr:nth-of-type(odd) span.quote { + color: #C0E17A; +} +:root.photon.highlight-you .quotesYou$site$highlightable$reply { + border-left: 3px solid rgba(221, 0, 0, .8) !important; +} +:root.photon.highlight-own .yourPost$site$highlightable$reply { + border-left: 3px dashed rgba(221, 0, 0, .8) !important; +} + +/* Header */ +:root.photon #header-bar.dialog { + background-color: rgba(221,221,221,0.98); +} +:root.photon:not(.fixed) #header-bar, :root.photon #notifications { + font-size: 9pt; +} +:root.photon #header-bar, :root.photon #notifications { + color: #333; +} +:root.photon #header-bar a, :root.photon #notifications a { + color: #FF6600; +} + +/* Settings */ +:root.photon #fourchanx-settings fieldset, :root.photon .section-main div::before { + border-color: #CCC; +} +:root.photon .suboption-list > div:last-of-type { + background-color: #DDD; +} + +/* Catalog */ +:root.photon.catalog-hover-expand .catalog-container:hover > .post { + background-color: #DDD; +} +:root.photon.werkTyme .catalog-thread:not(:hover), +:root.photon.werkTyme:not(.catalog-hover-expand) .catalog-thread, +:root.photon.catalog-hover-expand .catalog-container:hover > .post, +:root.photon.catalog-hover-expand .catalog-container:hover .catalog-reply { + border-color: #CCC; +} + +/* Quote */ +:root.photon .backlink.deadlink { + color: #F60 !important; +} +:root.photon .inline { + border-color: #CCC; + background-color: rgba(255, 255, 255, .14); +} + +/* Fappe and Werk Tyme */ +:root.photon .indicator { + color: #DDD; +} + +/* QR */ +.photon #dump-list::-webkit-scrollbar-thumb { + background-color: #DDD; + border-color: #CCC; +} +:root.photon .qr-preview { + background-color: rgba(0, 0, 0, .15); +} +:root.photon .qr-link { + border-color: rgb(206, 206, 206) rgb(206, 206, 206) rgb(191, 191, 191); + background: linear-gradient(#ECECEC, #DDD) repeat scroll 0% 0% transparent; +} +:root.photon .qr-link:hover { + background: #DDDDDD; +} + +/* Menu */ +:root.photon #menu { + color: #333; +} +:root.photon .entry { + font-size: 10pt; +} +:root.photon .focused.entry { + background: rgba(255, 255, 255, .33); +} + +/* Unread */ +:root.photon .unread-mark-read { + background-color: rgba(221,221,221,0.5); +} + +/* Thread Watcher */ +:root.photon .replies-quoting-you > a, :root.photon #watcher-link.replies-quoting-you, :root.photon .last-page > a > .watcher-page { + color: #00F !important; +} + +/* Watcher Favicon */ +:root.photon .watch-thread-link +{ + background-image: url("data:image/svg+xml,"); +} +`; + + var report = `#g-recaptcha, +:root:not(.js-enabled) #captchaContainerAlt { + height: auto; +} +#captchaContainerAlt td:nth-child(2) { + display: table-cell !important; +} + +/* Archive reports */ +#archive-report { + padding: 3px; +} +#archive-report-enabled { + vertical-align: middle; +} +#archive-report > label { + display: block; +} +#archive-report-reason { + display: block; + width: 98%; +} +.archive-report-success { + color: green; +} +.archive-report-error { + color: red; +}`; + + var spooky = `/* General */ +:root.spooky .dialog { + background-color: #171526; + border-color: #707070; +} +:root.spooky .field:focus, +:root.spooky .field.focus { + border-color: #98E; +} + +/* 4chan style fixes */ +:root.spooky #arc-list span.quote { + color: #634C2C; +} +:root.spooky.highlight-you .quotesYou$site$highlightable$reply { + border-left: 3px solid rgba(145, 182, 214, .8) !important; +} +:root.spooky.highlight-own .yourPost$site$highlightable$reply { + border-left: 3px dashed rgba(145, 182, 214, .8) !important; +} + +/* Header */ +:root.spooky #header-bar.dialog { + background-color: rgba(23,21,38,0.98); +} +:root.spooky:not(.fixed) #header-bar, :root.spooky #notifications { + font-size: 9pt; +} +:root.spooky #header-bar, :root.spooky #notifications { + color: #C49756; +} +:root.spooky #board-list a, :root.spooky #shortcuts a { + color: #FE9600; +} +:root.spooky.shortcut-icons .native-settings { + background-image: url('//s.4cdn.org/image/favicon-ws.ico'); +} + +/* Settings */ +:root.spooky #fourchanx-settings fieldset, :root.spooky .section-main div::before { + border-color: #707070; +} +:root.spooky .suboption-list > div:last-of-type { + background-color: #171526; +} + +/* Catalog */ +:root.spooky.catalog-hover-expand .catalog-container:hover > .post { + background-color: #171526; +} +:root.spooky.werkTyme .catalog-thread:not(:hover), +:root.spooky.werkTyme:not(.catalog-hover-expand) .catalog-thread, +:root.spooky.catalog-hover-expand .catalog-container:hover > .post, +:root.spooky.catalog-hover-expand .catalog-container:hover .catalog-reply { + border-color: #707070; +} + +/* Quote */ +:root.spooky .backlink.deadlink { + color: #FE9600 !important; +} +:root.spooky .inline { + border-color: #707070; + background-color: rgba(255, 255, 255, .14); +} + +/* Fappe and Werk Tyme */ +:root.spooky .indicator { + color: #171526; +} + +/* Highlighting */ +:root.spooky .qphl { + outline: 2px solid rgba(145, 182, 214, .8); +} +:root.spooky.highlight-you .quotesYou$site$highlightable$op, +:root.spooky.highlight-you .quotesYou$site$highlightable$reply { + border-left: 3px solid rgba(145, 182, 214, .8); +} +:root.spooky.highlight-own .yourPost$site$highlightable$op, +:root.spooky.highlight-own .yourPost$site$highlightable$reply { + border-left: 3px dashed rgba(145, 182, 214, .8); +} +:root.spooky .filter-highlight$site$highlightable$op, +:root.spooky .filter-highlight$site$highlightable$reply { + box-shadow: inset 5px 0 rgba(145, 182, 214, .5); +} +:root.spooky.highlight-own .yourPost > $site$sideArrows, +:root.spooky.highlight-you .quotesYou > $site$sideArrows, +:root.spooky .filter-highlight > $site$sideArrows { + color: rgb(155, 185, 210); +} + +/* QR */ +.spooky #dump-list::-webkit-scrollbar-thumb { + background-color: #171526; + border-color: #707070; +} +:root.spooky .qr-preview { + background-color: rgba(0, 0, 0, .15); +} +:root.spooky #qr .field { + background-color: rgb(26, 27, 29); + color: rgb(197,200,198); + border-color: rgb(40, 41, 42); +} +:root.spooky #qr .field:focus, +:root.spooky #qr .field.focus { + border-color: rgb(254, 150, 0) !important; + background-color: rgb(30,32,36); +} +:root.spooky .persona button { + background: linear-gradient(to bottom, #2E3035, #222427) no-repeat; + color: rgb(197,200,198); + border-color: rgb(40, 41, 42); + outline: none; +} +:root.spooky .persona button::-moz-focus-inner { + border: none; +} +:root.spooky .persona button:focus { + border-color: rgb(254, 150, 0); +} +:root.spooky #qr.sjis-preview #sjis-toggle, +:root.spooky #qr.tex-preview #tex-preview-button { + background: rgb(26, 27, 29); +} +:root.spooky #qr select, +:root.spooky #file-n-submit > input, +:root.spooky #qr-draw-button { + border-color: rgb(40, 41, 42); +} +:root.spooky #qr-filename { + color: rgb(197,200,198); +} + +:root.spooky .qr-link { + border-color: rgb(8, 6, 23) rgb(8, 6, 23) rgb(0, 0, 8); + background: linear-gradient(#262435, #171526) repeat scroll 0% 0% transparent; +} +:root.spooky .qr-link:hover { + background: #1A1829; +} + + +/* Menu */ +:root.spooky #menu { + color: #FE9600; +} +:root.spooky .entry { + font-size: 10pt; +} +:root.spooky .focused.entry { + background: rgba(255, 255, 255, .33); +} + +/* Unread */ +:root.spooky .unread-line { + border-color: rgb(197, 200, 198); + visibility: visible; + opacity: 1; +} +:root.spooky .unread-mark-read { + background-color: rgba(23,21,38,0.5); +} + +/* Thread Watcher */ +:root.spooky .replies-quoting-you > a, :root.spooky #watcher-link.replies-quoting-you, :root.spooky .last-page > a > .watcher-page { + color: #F00 !important; +} + +/* Watcher Favicon */ +:root.spooky .watch-thread-link +{ + background-image: url("data:image/svg+xml,"); +} +`; + + var style = `/* General */ +.dialog { + border: 1px solid; + display: block; + background-color: inherit; +} +.dialog:not(#qr):not(#thread-watcher):not(#header-bar) { + box-shadow: 0 1px 2px rgba(0, 0, 0, .15); +} +#qr, +#thread-watcher { + box-shadow: -1px 2px 2px rgba(0, 0, 0, 0.25); +} +.captcha-img, +.field { + background-color: #FFF; + border: 1px solid #CCC; + -moz-box-sizing: border-box; + box-sizing: border-box; + color: #333; + font: 13px sans-serif; + outline: none; + transition: color .25s, border-color .25s; +} +.field::-moz-placeholder { + color: #AAA; + font-size: 13px; + opacity: 1; +} +.captch-img:hover, +.field:hover { + border-color: #999; +} +.field:hover, .field:focus, .field.focus { + color: #000; +} +.field[disabled] { + background-color: #F2F2F2; + color: #888; +} +.field::-webkit-search-decoration { + display: none; +} +.move { + cursor: move; + overflow: hidden; +} +label { + cursor: pointer; +} +a[href="javascript:;"] { + text-decoration: none; +} +.warning { + color: red; +} +:root.sw-yotsuba #boardNavDesktop, :root.sw-yotsuba #boardNavMobile { + display: none !important; +} +:root.hide-bottom-board-list $site$boardListBottom { + display: none; +} +body.hasDropDownNav{ + margin-top: 5px; +} +:root:not(.keyboard-focus) a { + outline: none; +} +.painted { + border-radius: 3px; + padding: 0px 2px; +} +[hidden] { + display: none !important; +} + +/* 4chan style fixes */ +/* overrides 4chan CSS on div.opContainer, div.op */ +:root.sw-yotsuba .opContainer, :root.sw-yotsuba .op { + display: block; + overflow: visible; +} +:root.sw-yotsuba .reply > .file > .fileText { + margin: 0 20px; +} +:root.sw-yotsuba #arc-list span.quote { + color: #789922; +} +:root.sw-yotsuba .fileText a { + unicode-bidi: -moz-isolate; + unicode-bidi: -webkit-isolate; +} +:root.sw-yotsuba #g-recaptcha { + min-height: 78px; + height: auto; +} +:root.sw-yotsuba:not(.js-enabled) #postForm { + display: table; +} +:root.sw-yotsuba #captchaContainerAlt td:nth-child(2) { + display: table-cell !important; +} +:root.sw-yotsuba canvas#tegaki-canvas { + background: none; +} +/* Disable obnoxious captcha fade-in. */ +:root.sw-yotsuba > body > div:last-of-type { + transition: none !important; +} +/* Fix captcha scrolling to top of page. */ +:root.sw-yotsuba > body > div[style*=" top: -10000px;"] { + visibility: hidden !important; +} +/* Make long filenames wrap properly: https://github.com/ccd0/4chan-x/issues/1082 */ +:root.sw-yotsuba .post > .file { + /* currently nonstandard but may be added: https://lists.w3.org/Archives/Public/www-style/2016Mar/0352.html, https://bugzilla.mozilla.org/show_bug.cgi?id=1296042 */ + word-break: break-word; +} +:root.sw-yotsuba:not(.ua-webkit):not(.ua-blink) .fileText { + word-wrap: break-word; + max-width: calc(100vw - 90px); +} +:root.sw-yotsuba > body.is_catalog .thread > a > img { + display: inline-block; +} +/* Links to NSFW boards */ +:root.sw-yotsuba .nwsb { + display: inline; +} +:root.sw-yotsuba .fileText { + max-width: auto; + white-space: normal; +} + +/* Ads */ +:root.sw-yotsuba .ad-cnt > *, :root.sw-yotsuba .adg-rects > *, :root.sw-yotsuba .bsa-cnt { + height: auto !important; +} +:root.sw-yotsuba:not(.ads-loaded) hr.abovePostForm, +:root.sw-yotsuba:not(.ads-loaded) .adg-rects > hr, +:root.sw-yotsuba #adg-ol + hr, +:root.sw-yotsuba .danbo-slot:empty { + display: none; +} +:root.sw-yotsuba .adg-rects { + margin: 0; + font-size: 0; +} +:root.sw-yotsuba div.center[style] { + display: none !important; +} + +/* Tinyboard / vichan conflicts */ +#menu > .hide-thread-link { + width: auto; + height: auto; + overflow: visible; + background-image: none; +} +#menu label.entry { + display: block; +} +#fourchanx-settings label { + display: inline; +} +.intro a[href="javascript:;"], +#menu a { + margin: 0; +} +.gal-buttons.gal-buttons a { + font-size: inherit; +} +:root.sw-tinyboard.fixed.top-header:not(.autohide) .boardlist, +:root.sw-tinyboard.fixed.top-header:not(.autohide) .bar.top { + position: static; +} +:root.sw-tinyboard.fixed.top-header:not(.autohide) div.pages.top { + top: auto; + bottom: 0; +} +:root.sw-tinyboard.fixed.top-header.autohide .boardlist, +:root.sw-tinyboard.fixed.top-header.autohide .bar.top { + z-index: 3; +} + +/* Tinyboard site style conflicts */ +:root[data-host="fufufu.moe"].fixed.top-header:not(.autohide) div.pages.top { + top: 26px; + bottom: auto; +} +:root[data-host="merorin.com"].fixed.top-header:not(.autohide) span.settings { + top: 26px; +} +:root[data-host="fufufu.moe"]:not(.fixed) #header-bar { + margin-top: 38px; +} +:root[data-host="lainchan.org"]:not(.fixed) #header-bar { + margin-top: 17px; +} +:root[data-host="smuglo.li"]:not(.fixed) #header-bar { + margin-top: 8px; +} + +/* Anti-autoplay */ +audio.controls-added { + display: block; + margin: auto; + white-space: normal; +} +:root.anti-autoplay div.embed { + position: static; + width: auto; + height: auto; + text-align: center; +} +:root.anti-autoplay .autoplay-removed { + visibility: visible !important; + min-width: 640px; + min-height: 360px; +} + +/* fixed, z-index */ +#overlay, +#qp, #ihover, +#navlinks, .fixed #header-bar, +:root.float #updater, +:root.float #thread-stats, +#qr { + position: fixed; +} +#overlay { + z-index: 999; +} +#qp, #ihover { + z-index: 60; +} +#menu, .gal-buttons { + z-index: 50; +} +#updater, #thread-stats { + z-index: 40; +} +:root.fixed #header-bar, #notifications { + z-index: 35; +} +#a-gallery { + z-index: 30; +} +#navlinks { + z-index: 25; +} +#qr { + z-index: 20; +} +#embedding { + z-index: 11; +} +:root.fixed-watcher #thread-watcher { + z-index: 10; +} +:root.fixed:not(.gallery-open) #header-bar:not(:hover) { + z-index: 8; +} +#thread-watcher { + z-index: 5; +} + +/* Header */ +.fixed.top-header body { + padding-top: 2em; +} +.fixed.bottom-header body { + padding-bottom: 2em; +} +.fixed #header-bar { + right: 0; + left: 0; + padding: 3px 4px 4px; + font-size: 12px; +} +.fixed.top-header #header-bar { + top: 0; +} +.fixed.bottom-header #header-bar { + bottom: 0; +} +#header-bar { + border-width: 0; + transition: all .1s .05s ease-in-out; +} +:root.fixed #header-bar { + box-shadow: -5px 1px 10px rgba(0, 0, 0, 0.20); +} +:root.centered-links #shortcuts { + width: 300px; + text-align: right; +} +:root.centered-links #header-bar { + text-align: center; +} +#custom-board-list { + font-size: 13px; + vertical-align: middle; +} +#full-board-list { + vertical-align: middle; +} +:root.centered-links #custom-board-list { + position: relative; + left: 150px; +} +.fixed.top-header #header-bar { + border-bottom-width: 1px; +} +.fixed.bottom-header #header-bar { + box-shadow: 0 -1px 2px rgba(0, 0, 0, .15); + border-top-width: 1px; +} +.fixed.bottom-header #header-bar .menu-button i { + border-top: none; + border-bottom: 6px solid; +} +.fixed #header-bar.autohide:not(:hover) { + box-shadow: none; + transition: all .8s .6s cubic-bezier(.55, .055, .675, .19); +} +.fixed.top-header #header-bar.autohide:not(:hover) { + margin-bottom: -1em; + -webkit-transform: translateY(-100%); + transform: translateY(-100%); +} +.fixed.bottom-header #header-bar.autohide:not(:hover) { + -webkit-transform: translateY(100%); + transform: translateY(100%); +} +#scroll-marker { + left: 0; + right: 0; + height: 10px; + position: absolute; +} +#header-bar:not(.autohide) #scroll-marker { + pointer-events: none; +} +#header-bar #scroll-marker { + display: none; +} +.fixed #header-bar #scroll-marker { + display: block; +} +.fixed.top-header #header-bar #scroll-marker { + top: 100%; +} +.fixed.bottom-header #header-bar #scroll-marker { + bottom: 100%; +} +#board-list a, #shortcuts a:not(.entry) { + text-decoration: none; + padding: 1px; +} +#shortcuts:empty { + display: none; +} +.brackets-wrap::before { + content: "\\00a0["; +} +.brackets-wrap::after { + content: "]\\00a0"; +} +.dead-thread, +.disabled:not(.replies-quoting-you) { + opacity: .45; +} +#shortcuts { + float: right; +} +:root.autohiding-scrollbar #shortcuts { + margin-right: 12px; +} +.shortcut { + margin-left: 3px; + vertical-align: middle; +} +:root.shortcut-icons .native-settings { + font-size: 0; + color: transparent; + display: inline-block; + vertical-align: top; + height: 12px; + width: 14px; + background: url('//s.4cdn.org/image/favicon.ico') 0px -1px no-repeat; +} +#navbotright, +#navtopright { + display: none; +} +#toggleMsgBtn { + display: none !important; +} +.current, +:root.sw-yotsuba div#boardNavDesktopFoot a.current { + font-weight: bold; +} +@media (min-width: 1300px) { + :root.sw-yotsuba.fixed:not(.centered-links) #header-bar { + white-space: nowrap; + display: -webkit-flex; + display: flex; + -webkit-align-items: center; + align-items: center; + } + :root.sw-yotsuba.fixed:not(.centered-links) #board-list { + -webkit-flex: auto; + flex: auto; + } + :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list { + display: -webkit-flex; + display: flex; + } + :root.sw-yotsuba.fixed:not(.centered-links) .hide-board-list-container { + -webkit-flex: none; + flex: none; + margin-right: 5px; + } + :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList { + -webkit-flex: auto; + flex: auto; + display: -webkit-flex; + display: flex; + width: 0px; /* XXX Fixes Edge not shrinking the board list below default size when needed */ + } + :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > a, + :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span:not(.space):not(.spacer) { + -webkit-flex: none; + flex: none; + padding: .17em; + margin: -.17em -.32em; + } + :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span { + pointer-events: none; + } + :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span.space { + -webkit-flex: 0 .63 .63em; + flex: 0 .63 .63em; + } + :root.sw-yotsuba.fixed:not(.centered-links) #full-board-list > .boardList > span.spacer { + -webkit-flex: 0 .38 .38em; + flex: 0 .38 .38em; + } + :root.sw-yotsuba.fixed:not(.centered-links) #shortcuts { + float: initial; + -webkit-flex: none; + flex: none; + display: -webkit-flex; + display: flex; + -webkit-align-items: center; + align-items: center; + } +} +/* 4chan X link brackets */ +.brackets-wrap::before { + content: "["; +} +.brackets-wrap::after { + content: "]"; +} +/* Notifications */ +#notifications { + position: fixed; + top: 0; + height: 0; + text-align: center; + right: 0; + left: 0; + visibility: visible; +} +#notifications:empty { + display: none; +} +:root.fixed.top-header:not(.gallery-open) #header-bar #notifications, +:root.fixed.top-header #header-bar.autohide #notifications { + position: absolute; + top: 100%; +} +.notification { + color: #FFF; + font-weight: 700; + text-shadow: 0 1px 2px rgba(0, 0, 0, .5); + box-shadow: 0 1px 2px rgba(0, 0, 0, .15); + border-radius: 2px; + margin: 1px auto; + width: 550px; + max-width: 100%; + position: relative; + transition: all .25s ease-in-out; +} +.notification.error { + background-color: hsla(0, 100%, 38%, .9); +} +.notification.warning { + background-color: hsla(36, 100%, 38%, .9); +} +.notification.info { + background-color: hsla(200, 100%, 38%, .9); +} +.notification.success { + background-color: hsla(104, 100%, 38%, .9); +} +.notification a { + color: white; +} +.notification > .close { + padding: 7px; + top: 0px; + right: 5px; + position: absolute; +} +.notification > .fa-times::before { + font-size: 11px !important; +} +.message { + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 6px 20px; + max-height: 200px; + width: 100%; + overflow: auto; + white-space: pre-line; +} +.message a { + text-decoration: underline; +} +:root.tainted .report-error { + display: none; +} + +/* Settings */ +:root.fourchan-x body { + -moz-box-sizing: border-box; + box-sizing: border-box; +} +#overlay { + background-color: rgba(0, 0, 0, .5); + display: -webkit-flex; + display: flex; + top: 0; + left: 0; + height: 100%; + width: 100%; +} +#fourchanx-settings { + -moz-box-sizing: border-box; + box-sizing: border-box; + box-shadow: 0 0 15px rgba(0, 0, 0, .15); + height: 600px; + max-height: 100%; + width: 900px; + max-width: 100%; + margin: auto; + padding: 5px; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: column; + flex-direction: column; +} +#fourchanx-settings > nav { + padding: 2px 2px 8px; + display: -webkit-flex; + display: flex; +} +#fourchanx-settings > nav a { + text-decoration: underline; +} +#fourchanx-settings > nav a.close { + text-decoration: none; + padding: 0 2px; + margin: 0; +} +.section-container { + -webkit-flex: 1; + flex: 1; + position: relative; + overflow: auto; + padding-right: 5px; + overscroll-behavior: contain; +} +.sections-list { + -webkit-flex: 1; + flex: 1; +} +.export, .import, .reset { + cursor: pointer; + text-decoration: none !important; +} +.tab-selected { + font-weight: 700; +} +.section-sauce ul, +.section-advanced ul { + list-style: none; + margin: 0; +} +.section-sauce ul { + padding: 8px; +} +.section-advanced ul { + padding: 0px; +} +.section-sauce li, +.section-advanced li { + padding-left: 4px; +} +.section-main ul { + margin: 0; + padding: 0 0 0 16px; +} +.section-main li { + white-space: pre-line; + list-style: disc; +} +.section-main li:not(:first-of-type) { + margin-top: 4px; +} +.section-main label { + text-decoration: underline; +} +div[data-checked="false"] > .suboption-list { + display: none; +} +.suboption-list { + position: relative; +} +.suboption-list::before { + content: ""; + display: inline-block; + position: absolute; + left: .7em; + width: 0; + height: 100%; + border-left: 1px solid; +} +.suboption-list > div { + position: relative; + padding-left: 1.4em; +} +.suboption-list > div::before { + content: ""; + display: inline-block; + position: absolute; + left: .7em; + width: .7em; + height: .6em; + border-left: 1px solid; + border-bottom: 1px solid; +} +#fourchanx-settings .section-main p { + margin: .5em 0 0; +} +.section-filter ul { + padding: 0; +} +.section-filter li { + margin: 10px 40px; + list-style: disc; +} +.section-filter textarea { + height: 500px; +} +.section-main a, .section-filter a, .section-advanced a { + text-decoration: underline; +} +#sauce-doc-expand:not(:checked) ~ #sauce-doc { + max-height: 130px; + overflow: auto; +} +#sauce-doc > label { + float: right; + margin: 0 5px; +} +/* XXX for OneeChan */ +#sauce-doc-expand + .riceCheck { + display: none; +} +.section-sauce textarea { + height: 430px; +} +.section-advanced .field[name="boardnav"] { + width: 100%; +} +.section-advanced textarea { + height: 150px; +} +.section-advanced textarea[name="archiveLists"], +.section-advanced textarea[name="externalCatalogURLs"], +.section-advanced textarea[name="knownBanners"] { + height: 75px; +} +.section-advanced .archive-cell { + min-width: 160px; + text-align: center; +} +.section-advanced #archive-board-select { + position: absolute; +} +.section-advanced .note { + font-size: 0.8em; + font-style: italic; + margin-left: 10px; +} +.section-advanced .note code { + font-style: normal; + font-size: 11px; +} +.favicon-preview > img { + vertical-align: middle; +} +.favicon-preview > img:nth-of-type(3n+1) { + margin-left: 4px; +} +.section-keybinds .field { + font-family: monospace; +} +#fourchanx-settings fieldset { + border: 1px solid; + border-radius: 3px; + padding: 0.35em 0.625em 0.75em; + margin: 0px 2px; +} +#fourchanx-settings legend { + font-weight: 700; + color: inherit; +} +#fourchanx-settings textarea { + font-family: monospace; + width: 100%; + resize: vertical; +} +#fourchanx-settings code { + color: #000; + background-color: #FFF; + padding: 0 2px; +} +#fourchanx-settings th { + text-align: center; + font-weight: bold; +} +#fourchanx-settings p { + margin: 1em 0px; +} +#fourchanx-settings table { + margin: auto; +} + +/* Index */ +:root.index-loading .navLinks:not(.json-index), +:root.index-loading .board:not(.json-index), +:root.index-loading .pagelist:not(.json-index), +:root.infinite-mode .pagelist, +:root.all-pages-mode .pagelist, +:root.catalog-mode .pagelist, +:root:not(.catalog-mode) .indexlink, +:root.catalog-mode .cataloglink, +:root:not(.catalog-mode) #hidden-label, +:root:not(.catalog-mode) #index-size { + display: none; +} +#index-search { + padding-right: 1.5em; + width: 100px; + transition: color .25s, border-color .25s, width .25s; +} +#index-search:focus, +#index-search[data-searching] { + width: 200px; +} +#index-search-clear { + color: gray; + display: inline-block; + position: relative; + left: -1em; + width: 0; +} +/* \`\`::-webkit-*'' selectors break selector lists on Firefox. */ +#index-search::-webkit-search-cancel-button { + display: none; +} +#index-search:not([data-searching]) + #index-search-clear { + display: none; +} +#index-options { + float: right; +} +#lastlong-options { + display: inline-block; + vertical-align: middle; + height: 28px; + margin: -14px 0; +} +#lastlong-options > input { + padding: 0; + border: 0 !important; + text-align: center; + background: transparent; + display: block; + font-size: 12px; + height: 12px; + width: 30px; + margin: 1px 0; +} +.summary { + text-decoration: none; +} + +/* Catalog */ +:root.catalog-mode .board { + text-align: center; +} +.catalog-thread { + display: inline-block; + -moz-box-sizing: border-box; + box-sizing: border-box; + border: 1px solid transparent; + word-wrap: break-word; + vertical-align: top; + position: relative; +} +/* overrides 4chan CSS on div.thread */ +.catalog-thread.catalog-thread { + margin: 2px; +} +.catalog-small > .catalog-thread { + width: 165px; + height: 320px; +} +.catalog-large > .catalog-thread { + width: 270px; + height: 410px; +} +:root.catalog-hover-expand .catalog-thread:hover { + z-index: 1; +} +.catalog-container { + position: absolute; + top: -4px; + left: 0; + right: 0; + bottom: 0; +} +.catalog-container:not(:hover), +:root:not(.catalog-hover-expand) .catalog-container { + overflow: hidden; +} +.catalog-post { + position: absolute; + top: 4px; + left: 0; + right: 0; + border: 1px solid transparent; + padding-top: 20px; +} +/* overrides inline CSS from Index.cb.hoverAdjust */ +:root:not(.catalog-hover-expand) .catalog-post { + left: 0 !important; + right: 0 !important; +} +/* overrides 4chan CSS on div.post */ +.catalog-post.catalog-post { + margin: -21px -1px -1px; + overflow: visible; +} +.catalog-thread.noFile > * > .catalog-post { + margin-top: -7px; + padding-top: 6px; +} +:root.catalog-hover-expand .catalog-container:hover > .catalog-post { + margin-left: -61px; + margin-right: -61px; +} +:root.catalog-hover-expand .catalog-container:hover > * > :not(.catalog-replies) { + padding-left: 2px; + padding-right: 2px; +} +.catalog-link { + display: block; + position: relative; +} +.catalog-thumb { + border-radius: 2px; + box-shadow: 0 0 5px rgba(0, 0, 0, .25); + vertical-align: top; +} +.catalog-thumb.spoiler-file { + width: 100px; + height: 100px; +} +.catalog-thumb.deleted-file { + width: 127px; + height: 13px; + padding: 20px 11px; +} +.catalog-thumb.no-file { + width: 77px; + height: 13px; + padding: 20px 36px; +} +.catalog-icons > img, +.catalog-stats > .menu-button { + width: 1em; + height: 1em; + margin: 0; + vertical-align: text-top; + padding-left: 2px; +} +.catalog-stats > .menu-button { + font-weight: normal; +} +.catalog-stats > .menu-button > i::before { + line-height: 11px; +} +.catalog-stats { + font-size: 10px; + font-weight: 700; + padding-top: 2px; +} +.catalog-stats > [title] { + cursor: help; +} +.catalog-post > .postMessage { + margin: 0; + padding-bottom: .3em; +} +.catalog-container:not(:hover) > * > .file, +.catalog-container:not(:hover) > * > .postInfo > :not(.subject), +.catalog-container:not(:hover) > * > .catalog-replies, +.catalog-container:not(:hover) .extra-linebreak, +.catalog-container:not(:hover) .abbr, +:root:not(.catalog-hover-expand) .catalog-container > * > .file, +:root:not(.catalog-hover-expand) .catalog-container > * > .postInfo > :not(.subject), +:root:not(.catalog-hover-expand) .catalog-container > * > .catalog-replies, +:root:not(.catalog-hover-expand) .catalog-container .extra-linebreak, +:root:not(.catalog-hover-expand) .catalog-container .abbr, +.catalog-thread > .catalog-container > :not(.catalog-post), +.catalog-post > .file > :not(.fileText), +.catalog-post > * > .fileText > :not(:first-child), +.catalog-post > .postInfo > :not(.subject):not(.nameBlock):not(.dateTime), +.catalog-post > .postInfo > .nameBlock > .contact-links, +.catalog-post > * > * > .posteruid, +.catalog-post > * > * > .postJumper, +:root.bottom-backlinks .catalog-post > .container, +.post:not(.catalog-post) > .catalog-link, +.post:not(.catalog-post) > .catalog-stats, +.post:not(.catalog-post) > .catalog-replies { + display: none; +} +.catalog-post > .file { + position: absolute; + left: 0; + right: 0; + top: 0; + min-height: 20px; + background-color: inherit; +} +.catalog-post > * > .fileText { + position: relative; + padding: 2px; + background-color: inherit; +} +.catalog-small .catalog-post > * .fileText { + font-size: 10px; +} +.catalog-post > * > .fileText:not(:hover) { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.catalog-post > * > .fileText:hover { + z-index: 1; +} +/* overrides 4chan CSS on div.post div.postInfo */ +.catalog-post > .postInfo.postInfo { + width: auto; +} +.catalog-post > * > .subject { + display: block; +} +.catalog-post > * > .dateTime { + display: inline-block; + font-style: italic; +} +:root.catalog-hover-expand .catalog-container:hover > * > * > .nameBlock, +:root.catalog-hover-expand .catalog-container:hover > * > * > .dateTime, +:root.catalog-hover-expand .catalog-container:hover > * > .postMessage:not(:empty) { + padding-top: .3em; +} +.catalog-post .extra-linebreak { + content: ''; /* makes this work in Blink/WebKit */ + display: block; + margin-top: .3em; +} +.catalog-reply { + text-align: left; + white-space: nowrap; + border-top: 1px solid transparent; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: row; + flex-direction: row; + -webkit-align-items: stretch; + align-items: stretch; +} +.catalog-reply > * { + padding: 3px; + overflow: hidden; + -webkit-flex: none; + flex: none; +} +.catalog-reply > span { + font-style: italic; + font-weight: bold; +} +.catalog-reply-excerpt { + -webkit-flex: 1 1 auto; + flex: 1 1 auto; +} +.catalog-post .prettyprinted { + max-width: 100%; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.catalog-post .MathJax_Display { + text-align: center !important; +} +.catalog-container:not(:hover) .exif, +:root:not(.catalog-hover-expand) .catalog-container .exif { + display: none !important; +} +.catalog-post > * > .exif { + border-collapse: collapse; +} +:root.catalog-hover-expand .catalog-container:hover .exif[style*="display: block;"] { + display: inline-block !important; +} +.catalog-post > * > .exif, +.catalog-post > * > .exif > tbody { + background-color: inherit; +} +.catalog-post > * > .exif, +.catalog-post > * > .exif td { + min-width: 0; +} +.catalog-post > * > .exif td { + padding-top: 1px; +} +:root.hats-enabled .catalog-thread::after { + content: ''; + pointer-events: none; + position: absolute; + background-size: contain; +} +:root.hats-enabled .catalog-small > .catalog-thread::after { + left: -8px; + top: -59px; + width: 96px; + height: 96px; +} +:root.hats-enabled:not(.werkTyme) .catalog-small > .catalog-thread:not(.noFile)::after { + left: calc(67px - .3px * var(--tn-w)); +} +:root.hats-enabled .catalog-large > .catalog-thread::after { + left: -15px; + top: -98px; + width: 160px; + height: 160px; +} +:root.hats-enabled:not(.werkTyme) .catalog-large > .catalog-thread:not(.noFile)::after { + left: calc(110px - .5px * var(--tn-w)); +} + +/* Copy Text Link's textarea element */ +textarea.copy-text-element { + height: 0; + width: 0; + position: absolute; + top: -10000px; +} + +/* Announcement Hiding */ +:root.hide-announcement $site$psa { + display: none; +} +.hide-announcement-button { + opacity: 0.4; + float: left; +} + +/* Unread */ +.unread-line { + margin: 0; + border-color: rgb(255,0,0); +} +.unread-line + br { + display: none; +} +.unread-mark-read { + float: right; + clear: both; + width: 100%; + text-align: right; +} +:not(.unread-thread) > .unread-mark-read { + display: none; +} + +/* Thread Updater */ +#updater { + background: none; + border: none; + box-shadow: none; +} +#updater > .move { + position: absolute; + top: -5px; + bottom: -5px; + left: -5px; + right: -5px; + z-index: -1; +} +#updater > div:last-child { + text-align: center; +} +#updater input[type="number"] { + width: 4em; +} +:root.float #updater { + padding: 0px 3px; +} +:root:not(.float).shortcut-icons #updater { + display: inline-block; + min-width: 12pt; + text-align: right; +} +.new { + color: limegreen; +} +#update-status:not(.empty) + #update-timer:not(.empty):not(.loading) { + margin-left: 5px; +} +#update-timer { + cursor: pointer; +} + +/* Thread Watcher */ +#thread-watcher { + position: absolute; +} +#thread-watcher { + padding-bottom: 3px; + padding-left: 3px; + white-space: nowrap; + min-width: 146px; +} +#watched-threads { + overflow-x: hidden; + overflow-y: auto; +} +#thread-watcher .refresh { + padding: 0px 3px; +} +:root.fixed-watcher #thread-watcher { + position: fixed; +} +:root.fixed-watcher #watched-threads { + /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */ + max-height: 85vh; + max-height: calc(100vh - 75px); +} +:root:not(.fixed-watcher) #watched-threads:not(:hover) { + max-height: 210px; + overflow-y: hidden; +} +#thread-watcher > .move { + padding-top: 3px; +} +#watched-threads > div { + padding-left: 3px; + padding-right: 3px; +} +#watched-threads .watcher-link { + max-width: 250px; + display: -webkit-inline-flex; + display: inline-flex; + -webkit-flex-direction: row; + flex-direction: row; +} +#watched-threads .watcher-page, +#watched-threads .watcher-unread { + -webkit-flex: 0 0 auto; + flex: 0 0 auto; + margin-right: 2px; +} +#watched-threads .watcher-title { + overflow: hidden; + text-overflow: ellipsis; + -webkit-flex: 0 1 auto; + flex: 0 1 auto; +} +#watched-threads .watcher-title:not(:first-child) { + margin-left: 2px; +} +.replies-quoting-you > a, #watcher-link.replies-quoting-you, .last-page > a > .watcher-page { + color: #F00; +} +#thread-watcher a { + text-decoration: none; +} +#thread-watcher .move > .close { + position: absolute; + right: 0px; + top: 0px; + padding: 0px 4px; +} +.watch-thread-link { + padding-top: 18px; + width: 18px; + height: 0px; + display: inline-block; + background-repeat: no-repeat; + opacity: 0.2; + position: relative; + top: 1px; + background-image: url("data:image/svg+xml,"); +} +.watch-thread-link.watched { + opacity: 1; +} + + +/* Thread Stats */ +#thread-stats { + background: none; + border: none; + box-shadow: none; +} +:root.float #thread-stats > .move > :not(#page-count) { + pointer-events: none; +} +:root.float #thread-stats { + padding: 0px 3px; +} +#page-count { + cursor: pointer; +} + +/* Quote */ +.hashlink::before { + content: ' '; + visibility: hidden; +} +.inline + .hashlink { + display: none !important; +} +:root.resurrect-quotes .deadlink { + text-decoration: none !important; +} +.catalog-post .qmark-ct { + display: none; +} +.backlink.deadlink:not(.forwardlink), +.quotelink.deadlink:not(.forwardlink) { + text-decoration: underline !important; +} +:root:not(.catalog-mode) .inlined { + opacity: .5; +} +#qp input, .forwarded { + display: none; +} +.quotelink.forwardlink, +.backlink.forwardlink { + text-decoration: none; + border-bottom: 1px dashed; +} +.filtered { + text-decoration: underline line-through; +} +:root.hide-backlinks .backlink.filtered, +:root.hide-backlinks .backlink.filtered + .hashlink.filtered { + display: none; +} +.postNum + .container::before { + content: " "; +} +:root.bottom-backlinks .container { + display: block; + clear: both; + margin: 0 4px; +} +:root.bottom-backlinks .backlink { + font-size: 90%; +} +.inline { + border: 1px solid; + display: table; + margin: 2px 0; +} +.container ~ .inline { + margin-left: 20px; +} +:root.catalog-mode .inline { + display: none; +} +.inline .post { + border: 0 !important; + background-color: transparent !important; + display: table !important; + margin: 0 !important; + padding: 1px 2px !important; +} +#qp > .opContainer::after { + content: ''; + clear: both; + display: table; +} +#qp .post { + border: none; + margin: 0; + padding: 2px 2px 5px; +} +#qp img { + max-height: 80vh; + max-width: 50vw; +} + +/* Quote Threading */ +.threadContainer { + margin-left: 20px; + border-left: 1px solid rgba(128,128,128,.3); +} +.threadOP { + clear: both; +} + +/* File */ +.fileText-original, +.fnswitch:hover > .fntrunc, +.fnswitch:not(:hover) > .fnfull, +.expanded-image > .post > .file > .fileThumb > video[data-md5], +.expanded-image > .post > .file > .fileThumb > img[data-md5] { + display: none; +} +.full-image[data-file-i-d] { + display: none; + cursor: pointer; +} +.expanded-image > .post > .file > .fileThumb > .full-image { + display: inline; +} +.expanded-image { + clear: left; +} +.expanding { + opacity: .5; +} +:root.fit-height .full-image { + max-height: 100vh; +} +:root.fit-height.fixed .full-image { + /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */ + max-height: 93vh; + max-height: calc(100vh - 35px); +} +:root.fit-width .full-image { + max-width: 100%; +} +:root.ua-gecko.fit-width .full-image { + width: 100%; +} +.fileThumb > .warning { + clear: both; +} +#ihover { + pointer-events: none; + /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */ + max-height: 95vh; + max-height: calc(100vh - 25px); + max-width: 100vw; +} +/* WEBM Metadata */ +.webm-title > a::before { + content: "title"; + text-decoration: underline; +} +.webm-title.loading > a::after { + content: "..."; +} +.webm-title.error > a:hover::before, +.webm-title.error > a:focus::before { + content: "error"; + text-decoration: none; +} +.webm-title > span { + cursor: text; +} +.webm-title.not-found > span::before { + content: "not found"; +} +.webm-title:not(:hover):not(:focus) > span, +.webm-title:hover > span + a, +.webm-title:focus > span + a { + display: none; +} +/* Volume control */ +input[name="Default Volume"] { + width: 4em; + height: 1ex; + vertical-align: middle; + margin: 0px; +} +/* Fappe and Werk Tyme */ +:root.fappeTyme $site$replyOriginal.noFile, +:root.fappeTyme $site$replyOriginal.noFile + br { + display: none; +} +:root.werkTyme $site$thumbLink, +:root.werkTyme $site$file$thumb, +:root.werkTyme .catalog-thumb:not(.deleted-file):not(.no-file), +:root:not(.werkTyme) .werkTyme-filename { + display: none; +} +.werkTyme-filename { + font-weight: bold; + font-size: 110%; +} +:root.werkTyme .catalog-link { + box-shadow: 0 0 5px rgba(0, 0, 0, .25); + padding: 8px; + text-align: center; +} +:root.werkTyme .catalog-thumb { + box-shadow: none; + padding: 0; + vertical-align: middle; +} +.indicator { + background: rgba(255,0,0,0.8); + font-weight: bold; + display: inline-block; + min-width: 9px; + padding: 0px 2px; + margin: 0 1px; + text-align: center; + color: white; + border-radius: 2px; + cursor: pointer; +} +:root:not(.fappeTyme) #shortcut-fappe, +:root:not(.werkTyme) #shortcut-werk { + display: none; +} + +/* Index/Reply Navigation */ +#navlinks { + font-size: 16px; + top: 25px; + right: 10px; +} +:root.catalog-mode #navlinks { + display: none; +} + +/* Highlighting */ +.qphl { + outline: 2px solid rgba(216, 94, 49, .8); +} +:root.highlight-you .quotesYou$site$highlightable$op, +:root.highlight-you .quotesYou$site$highlightable$reply { + border-left: 3px solid rgba(221, 0, 0, .8); +} +:root.highlight-own .yourPost$site$highlightable$op, +:root.highlight-own .yourPost$site$highlightable$reply { + border-left: 3px dashed rgba(221, 0, 0, .8); +} +.filter-highlight$site$highlightable$op, +.filter-highlight$site$highlightable$reply { + box-shadow: inset 5px 0 rgba(221, 0, 0, .5); +} +:root.highlight-own .yourPost > $site$sideArrows, +:root.highlight-you .quotesYou > $site$sideArrows, +.filter-highlight > $site$sideArrows { + color: rgba(221, 0, 0, .8); +} +:root.highlight-own .yourPost$site$highlightable$op::after, +:root.highlight-you .quotesYou$site$highlightable$op::after, +.filter-highlight$site$highlightable$op::after { + content: ""; + display: block; + clear: both; +} +:root:not(.werkTyme) .catalog-thread.filter-highlight .catalog-thumb, +:root.werkTyme .catalog-thread.filter-highlight:not(:hover), +:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.filter-highlight, +:root.werkTyme.catalog-hover-expand .catalog-thread.filter-highlight > .catalog-container:hover > .catalog-post, +:root.catalog $site$catalog$thread.filter-highlight$site$highlightable$catalog { + box-shadow: 0 0 3px 3px rgba(255, 0, 0, .5); +} +:root:not(.werkTyme) .catalog-thread.watched .catalog-thumb, +:root:root.werkTyme .catalog-thread.watched:not(:hover), +:root:root.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched, +:root.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post { + border: 2px solid rgba(255, 0, 0, .75); +} + +/* Spoiler text */ +:root.reveal-spoilers $site$spoiler, +:root.reveal-spoilers $site$spoiler > a { + color: white !important; +} +:root.reveal-spoilers .removed-spoiler::before { + content: "[spoiler]"; +} +:root.reveal-spoilers .removed-spoiler::after { + content: "[/spoiler]"; +} + +/* Thread & Reply Hiding */ +.hide-thread-button, +.hide-reply-button { + float: left; + margin-right: 4px; + padding: 2px; +} +$site$infoRoot a.hide-reply-button { + margin-right: 6px; + padding: 0; +} +.replacedSideArrows { + float: left; +} +.hide-thread-button:not(:hover), +.hide-reply-button:not(:hover) { + opacity: 0.4; +} +.threadContainer .hide-reply-button { + margin-left: 2px !important; + position: relative; + left: 1px; +} +.hide-thread-button { + margin-top: -1px; + width: 11px; +} +.stub ~ :not(.threadDivider) { + display: none !important; +} +.stub input { + display: inline-block; +} +$site$thread[hidden] + hr { + display: none; +} +:root.reply-hide $site$sideArrows { + display: none; +} +:root.sw-yotsuba.thread-hide .party-hat { + left: 19px; +} + +/* Anonymize */ +:root.anonymize $site$info$name, +:root.sw-yotsuba.anonymize .post-author:not([class*=capcode]) { + font-size: 0; +} +:root.anonymize $site$info$tripcode, +:root.sw-yotsuba.anonymize .n-pu { + display: none; +} +:root.anonymize $site$info$name::before, +:root.sw-yotsuba.anonymize .post-author:not([class*=capcode])::before { + content: "Anonymous"; + font-size: 10pt; +} +:root.sw-yotsuba.anonymize .flashListing .name::before, +:root.sw-yotsuba.anonymize .post-last > .post-author:not([class*=capcode])::before { + font-size: 9pt; +} + +/* QR */ +:root.hide-original-post-form #togglePostFormLink, +#qr.autohide:not(.focus):not(:hover):not(:active) > form, +:root.thread-view #qr:not(.show-new-thread-option) select[data-name="thread"], +#file-n-submit:not(.has-file) #qr-filerm { + display: none; +} +:root.hide-original-post-form #postForm { + display: none !important; +} +#qr select, +#qr-filename-container > a, +.remove, +.captcha-img { + cursor: pointer; +} +#qr { + position: fixed; + padding: 1px; + border: 1px solid transparent; + min-width: 300px; + border-radius: 3px 3px 0 0; +} +#qr > form { + /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */ + max-height: 85vh; + max-height: calc(100vh - 75px); + overflow-y: auto; + overflow-x: hidden; +} +#qrtab { + border-radius: 3px 3px 0 0; +} +#qrtab { + margin-bottom: 1px; +} +#qr .close { + float: right; + padding: 0 3px; +} +.qr-link-container { + text-align: center; + margin: 16px 0; +} +.qr-link-container-bottom { + width: 200px; + position: absolute; + left: -100px; + margin-left: 50%; + text-align: center; +} +.qr-link { + border-radius: 3px; + padding: 6px 10px 5px; + font-weight: bold; + vertical-align: middle; + border-style: solid; + border-width: 1px; + font-size: 10pt; +} +.qr-link-container + #togglePostFormLink { + font-size: 10pt; + font-weight: normal; + margin: -8px 0 3.5px; +} +.persona { + width: 100%; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: row; + flex-direction: row; +} +.persona .field { + -webkit-flex: 1; + flex: 1; + width: 0; +} +#qr.forced-anon input[data-name="name"]:not(.force-show), +#qr.forced-anon input[data-name="sub"]:not(.force-show), +#qr.reply-to-thread input[data-name="sub"]:not(.force-show), +body:not(.board_f) #qr select[name="filetag"], +#qr.reply-to-thread select[name="filetag"], +#qr:not(.has-sjis) #sjis-toggle, +#qr:not(.has-math) #tex-preview-button, +#qr.tex-preview .textarea > :not(#tex-preview), +#qr:not(.tex-preview) #tex-preview { + display: none; +} +.persona button { + -webkit-flex: 0 0 23px; + flex: 0 0 23px; + -webkit-align-self: stretch; + align-self: stretch; + border: 1px solid #BBB; + padding: 0; + background: linear-gradient(to bottom, #F8F8F8, #DCDCDC) no-repeat; + color: #000; +} +#qr.sjis-preview #sjis-toggle, #qr.tex-preview #tex-preview-button { + background: #DCDCDC; +} +#sjis-toggle, #qr.sjis-preview textarea.field { + font-family: "IPAMonaPGothic","Mona","MS PGothic",monospace; + font-size: 16px; + line-height: 17px; +} +#tex-preview-button { + font-size: 10px; +} +#tex-preview { + white-space: pre-line; +} +#qr textarea.field { + height: 14.8em; + min-height: 9em; +} +#qr.has-captcha textarea.field { + height: 9em; +} +input.field.tripped:not(:hover):not(:focus) { + color: transparent !important; + text-shadow: none !important; +} +#qr textarea { + min-width: 300px; + resize: both; +} +.field { + -moz-box-sizing: border-box; + box-sizing: border-box; + margin: 0px; + padding: 2px 4px 3px; +} +#qr label input[type="checkbox"] { + position: relative; + top: 2px; +} + +/* Recaptcha v2 */ +#qr .captcha-root { + position: relative; +} +#qr .captcha-container > div { + margin: auto; + width: 304px; +} +/* XXX scrollable with scroll bar hidden; prevents scroll on space press */ +:root.ua-blink #qr .captcha-container > div, +:root.ua-edge #qr .captcha-container > div { + overflow: hidden; +} +:root.ua-blink #qr .captcha-container > div > div:first-of-type, +:root.ua-edge #qr .captcha-container > div > div:first-of-type { + overflow-y: scroll; + overflow-x: hidden; + padding-right: 30px; + height: 99%; + width: 100%; +} +#qr .captcha-counter { + display: block; + width: 100%; + text-align: center; + pointer-events: none; +} +#qr.captcha-open .captcha-counter { + position: absolute; + bottom: 3px; +} +#qr .captcha-counter > a { + pointer-events: auto; + display: inline-block; /* XXX https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8851747/ */ +} +#qr:not(.captcha-open) .captcha-counter > a { + display: block; + width: 100%; +} +#qr.captcha-v2 #qr-captcha-iframe { + width: 302px; + height: 423px; + border: 0; + display: block; + margin: auto; +} +.goog-bubble-content { + max-width: 100vw; + max-height: 100vh; + overflow: auto; +} +.goog-bubble-content iframe { + position: static !important; +} + +/* File Input, Submit Button, Oekaki */ +#file-n-submit, #qr .oekaki { + display: -webkit-flex; + display: flex; + -webkit-align-items: stretch; + align-items: stretch; + height: 25px; + margin-top: 1px; +} +#file-n-submit > input, #qr-draw-button { + background: linear-gradient(to bottom, #F8F8F8, #DCDCDC) no-repeat; + border: 1px solid #BBB; + border-radius: 2px; + height: 100%; +} +#qr-file-button, #qr-draw-button { + width: 15%; +} +#file-n-submit input[type="submit"] { + width: 25%; +} +#qr-filename-container { + -webkit-flex: 1 1 auto; + flex: 1 1 auto; + width: 0; + display: -webkit-flex; + display: flex; + -webkit-align-items: center; + align-items: center; + position: relative; + padding: 1px; +} +input#qr-filename { + border: none !important; + background: none !important; + outline: none; +} +#qr-filename, +.has-file #qr-no-file { + display: none; +} +#qr-no-file, +.has-file #qr-filename { + -webkit-flex: 1 1 auto; + flex: 1 1 auto; + width: 0px; /* XXX Fixes filename not shrinking to allow space for buttons in Edge */ + display: inline-block; + padding: 0; + padding-left: 3px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +#qr-no-file { + color: #AAA; +} +#qr .oekaki.has-file { + display: none; +} +#qr .oekaki > label { + -webkit-flex: 1 1 auto; + flex: 1 1 auto; + width: 0; + display: -webkit-flex; + display: flex; + -webkit-align-items: center; + align-items: center; + height: 100%; +} +#qr .oekaki > label > span { + margin: 0 3px; +} +#qr .oekaki > label > input { + -webkit-flex: 1 1 auto; + flex: 1 1 auto; + width: 0; + height: 100%; +} +#qr .oekaki-bg { + position: relative; + display: inline-block; + height: 100%; + width: 10%; + margin-left: 3px; +} +#qr .oekaki-bg > * { + position: absolute; + top: 0; + left: 0; + margin: 0; +} +#qr .oekaki-bg > :not([name="oekaki-bgcolor"]) { + z-index: 1; +} +#qr [name="oekaki-bgcolor"] { + height: 100%; + width: 100%; + border: none; + padding: 0; +} +#qr [name="oekaki-bg"]:not(:checked) ~ [name="oekaki-bgcolor"] { + visibility: hidden; +} +#qr input[type="file"] { + visibility: hidden; + position: absolute; +} + +/* Spoiler Checkbox, QR Icons */ +#qr-filename-container > label, #qr-filename-container > a { + -webkit-flex: none; + flex: none; + margin: 0; + margin-right: 3px; +} +#qr:not(.has-spoiler) #qr-spoiler-label, +#file-n-submit:not(.has-file) #qr-spoiler-label, +.has-file #paste-area, +.has-file #url-button, +#file-n-submit:not(.custom-cooldown) #custom-cooldown-button { + display: none; +} +#qr-filename-container > label { + position: relative; +} +#qr-filename-container input[type="checkbox"] { + margin: 0; +} +.checkbox-letter { + font-size: 13px; + font-weight: bold; +} +#qr-filename-container label:not(:hover) > input[type="checkbox"]:not(:focus):not(:checked), +#qr-filename-container label:not(:hover) > input[type="checkbox"]:not(:focus):not(:checked) ~ :not(.checkbox-letter), +#qr-filename-container label:hover > .checkbox-letter, +input[type="checkbox"]:focus ~ .checkbox-letter, +input[type="checkbox"]:checked ~ .checkbox-letter { + /* not displayed but still focusable */ + position: absolute; + opacity: 0; + pointer-events: none; +} +.checkbox-letter, #paste-area, #url-button, #custom-cooldown-button, #dump-button { + opacity: 0.6; +} +#paste-area { + font-size: 0; +} +#paste-area:focus { + opacity: 1; +} +#custom-cooldown-button.disabled { + opacity: 0.27; +} + +/* Thread and Flash Tag Select */ +#qr select { + background: white; + border: 1px solid #CCC; +} +#qr select[data-name="thread"] { + float: right; +} +#qr > form > select { + margin-top: 1px; +} + +/* Dumping UI */ +.dump #dump-list-container { + display: block; +} +#dump-list-container { + display: none; + position: relative; + overflow-y: hidden; + margin-top: 1px; +} +#dump-list { + overflow-x: auto; + overflow-y: auto; + white-space: nowrap; + width: 248px; + max-height: 248px; + min-height: 90px; + max-width: 100%; + min-width: 100%; + display: -webkit-flex; + display: flex; + -webkit-flex-wrap: wrap; + flex-wrap: wrap; +} +#dump-list:hover { + overflow-x: auto; +} +.qr-preview { + -moz-box-sizing: border-box; + box-sizing: border-box; + counter-increment: thumbnails; + cursor: move; + display: inline-block; + height: 90px; + width: 90px; + padding: 2px; + opacity: .5; + overflow: hidden; + position: relative; + text-shadow: 0 0 2px #000; + -webkit-transition: opacity .25s ease-in-out, -webkit-transform .25s ease-in-out; + transition: opacity .25s ease-in-out, transform .25s ease-in-out, -webkit-transform .25s ease-in-out; + vertical-align: top; + background-size: cover; + -webkit-flex: none; + flex: none; +} +.qr-preview:hover, +.qr-preview:focus { + opacity: .9; +} +.qr-preview::before { + content: counter(thumbnails); + color: #fff; + position: absolute; + top: 3px; + right: 3px; + text-shadow: 0 0 3px #000, 0 0 8px #000; +} +.qr-preview#selected { + opacity: 1; +} +.qr-preview.drag { + box-shadow: 0 0 10px rgba(0,0,0,.5); + -webkit-transform: scale(.8); + transform: scale(.8); +} +.qr-preview.over { + border-color: #fff; + -webkit-transform: scale(1.1); + transform: scale(1.1); + opacity: 0.9; + z-index: 10; +} +.qr-preview > span { + color: #fff; +} +.remove { + background: none; + color: #e00; + padding: 1px; +} +a:only-of-type > .remove { + display: none; +} +.remove:hover::after { + content: " Remove"; +} +.qr-preview:not(.has-file) label, +#qr:not(.has-spoiler) .qr-preview-spoiler { + display: none; +} +.qr-preview > label { + background: rgba(0,0,0,.5); + color: #fff; + right: 0; + bottom: 0; + left: 0; + position: absolute; + text-align: center; +} +.qr-preview > label > input { + margin: 0; +} +#add-post { + cursor: pointer; + font-size: 2em; + position: absolute; + bottom: 20px; + right: 10px; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); +} +.textarea { + position: relative; + display: -webkit-flex; + display: flex; +} +#char-count { + color: #000; + background: hsla(0, 0%, 100%, .5); + font-size: 8pt; + position: absolute; + bottom: 1px; + right: 1px; + pointer-events: none; +} +#char-count.warning { + color: red; +} + +/* Menu */ +.menu-button:not(.fa-bars) { + display: inline-block; + position: relative; + cursor: pointer; +} +#header-bar .menu-button i { + border-top: 6px solid; + border-right: 4px solid transparent; + border-left: 4px solid transparent; + display: inline-block; + margin: 2px; + vertical-align: middle; +} +.postInfo > .menu-button, +#thread-watcher .menu-button { + width: 18px; + height: 15px; + text-align: center; +} +#menu { + position: fixed; + outline: none; + font-weight: normal; +} +#menu, .submenu { + border-radius: 3px; + padding-top: 1px; + padding-bottom: 3px; +} +.entry { + cursor: pointer; + display: block; + outline: none; + padding: 2px 10px; + position: relative; + text-decoration: none; + white-space: nowrap; + min-width: 70px; + text-align: left; + text-shadow: none; + font-size: 10pt; +} +.left>.entry.has-submenu { + padding-right: 17px !important; +} +.entry input[type="checkbox"], +.entry input[type="radio"] { + margin: 0px; + position: relative; + top: 2px; +} +.entry input[type="number"] { + width: 4.5em; +} +.entry.has-shortcut-text { + display: flex; + justify-content: space-between; + align-items: center; +} +.entry .shortcut-text { + opacity: 0.5; + font-size: 70%; + margin-left: 5px; +} +.has-submenu::after { + content: ""; + border-left: .5em solid; + border-top: .3em solid transparent; + border-bottom: .3em solid transparent; + display: inline-block; + margin: .3em; + position: absolute; + right: 3px; +} +.left .has-submenu::after { + border-left: 0; + border-right: .5em solid; +} +.submenu { + display: none; + position: absolute; + left: 100%; + top: -1px; + margin-left: 0px; + margin-top: -2px; +} +.focused > .submenu { + display: block; +} +.imp-exp-result { + position: absolute; + text-align: center; + margin: auto; + right: 0px; + left: 0px; + width: 200px; +} + +/* Custom Board Titles */ +.boardTitle, .boardSubtitle { + white-space: pre-line; +} +.boardTitle[contenteditable="true"], +.boardSubtitle[contenteditable="true"] { + cursor: text !important; +} + +/* Embedding */ +.embedder:not(.embedded) > span { + display: none; +} +#embedding { + padding: 1px 4px 1px 4px; + position: fixed; +} +#embedding.empty { + display: none; +} +#embedding > div:first-child { + display: -webkit-flex; + display: flex; +} +#embedding .move { + -webkit-flex: 1; + flex: 1; +} +#embedding .jump { + margin: -1px 4px; + text-decoration: none; +} + +/* Gallery */ +#a-gallery { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: row; + flex-direction: row; + background: rgba(0,0,0,0.7); +} +.gal-viewport { + display: -webkit-flex; + display: flex; + -webkit-align-items: stretch; + align-items: stretch; + -webkit-flex-direction: row; + flex-direction: row; + -webkit-flex: 1 1 auto; + flex: 1 1 auto; + overflow: hidden; +} +.gal-thumbnails { + -webkit-flex: 0 0 150px; + flex: 0 0 150px; + overflow-y: auto; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: column; + flex-direction: column; + -webkit-align-items: stretch; + align-items: stretch; + text-align: center; + background: rgba(0,0,0,.5); + border-left: 1px solid #222; +} +.gal-hide-thumbnails .gal-thumbnails { + display: none; +} +.gal-thumb img, +.gal-thumb video { + max-width: 125px; + max-height: 125px; + height: auto; + width: auto; +} +.gal-thumb { + -webkit-flex: 0 0 auto; + flex: 0 0 auto; + padding: 3px; + line-height: 0; + transition: background .2s linear; +} +.gal-highlight { + background: rgba(0, 190, 255,.8); +} +.gal-prev { + border-right: 1px solid #222; +} +.gal-next { + border-left: 1px solid #222; +} +.gal-prev, +.gal-next { + -webkit-flex: 0 0 20px; + flex: 0 0 20px; + position: relative; + cursor: pointer; + opacity: 0.7; + background-color: rgba(0, 0, 0, 0.3); +} +.gal-prev:hover, +.gal-next:hover { + opacity: 1; +} +.gal-prev::after, +.gal-next::after { + position: absolute; + top: 48.6%; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); + display: inline-block; + border-top: 11px solid transparent; + border-bottom: 11px solid transparent; + content: ""; +} +.gal-prev::after { + border-right: 12px solid #fff; + right: 5px; +} +.gal-next::after { + border-left: 12px solid #fff; + right: 3px; +} +.gal-image { + -webkit-flex: 1 0 auto; + flex: 1 0 auto; + display: -webkit-flex; + display: flex; + -webkit-align-items: flex-start; + align-items: flex-start; + -webkit-justify-content: space-around; + justify-content: space-around; + overflow: hidden; + /* Flex > Non-Flex child max-width and overflow fix (Firefox only?) */ + width: 1%; +} +:root:not(.gal-fit-height):not(.gal-pdf) .gal-image { + overflow-y: scroll !important; +} +:root:not(.gal-fit-width):not(.gal-pdf) .gal-image { + overflow-x: scroll !important; +} +.gal-image a { + display: -webkit-flex; + display: flex; + -webkit-align-items: flex-start; + align-items: flex-start; + margin: auto; + line-height: 0; + max-width: 100%; +} +:root.gal-pdf .gal-image a { + width: 100%; + height: 100%; +} +.gal-image img, +.gal-image video { + -webkit-flex: none; + flex: none; +} +.gal-fit-width .gal-image img, +.gal-fit-width .gal-image video { + max-width: 100%; +} +.gal-fit-height .gal-image img, +.gal-fit-height .gal-image video { + /* XXX https://code.google.com/p/chromium/issues/detail?id=168840, https://bugs.webkit.org/show_bug.cgi?id=94158 */ + max-height: 95vh; + max-height: calc(100vh - 25px); +} +.gal-image iframe { + width: 100%; + height: 100%; +} +.gal-buttons { + font-size: 2em; + margin-right: 3px; + padding-left: 7px; + padding-right: 7px; + top: 5px; +} +:root.gal-pdf .gal-buttons { + top: 40px; + background: rgba(0,0,0,0.6) !important; + border-radius: 3px; +} +.gal-buttons a { + color: #ffffff; + text-shadow: 0px 0px 1px #000000; +} +.gal-buttons i { + display: inline-block; + margin: 2px; + position: relative; +} +.gal-start i { + border-left: 10px solid; + border-top: 6px solid transparent; + border-bottom: 6px solid transparent; + bottom: 1px; +} +.gal-stop i { + border: 5px solid; + bottom: 2px; +} +.gal-buttons.gal-playing > .gal-start, +.gal-buttons:not(.gal-playing) > .gal-stop { + display: none; +} +.gal-buttons .menu-button i { + border-top: 10px solid; + border-right: 6px solid transparent; + border-left: 6px solid transparent; + bottom: 2px; + vertical-align: baseline; +} +.gal-labels { + position: fixed; + bottom: 6px; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: column; + flex-direction: column; + -webkit-align-items: flex-end; + align-items: flex-end; + +} +:root:not(.show-sauce) .gal-sauce { + display: none; +} +.gal-name, +.gal-count, +.gal-sauce { + background: rgba(0,0,0,0.6) !important; + border-radius: 3px; + padding: 1px 5px 2px 5px; + margin-top: 3px; + color: #ffffff !important; + text-decoration: none !important; +} +.gal-sauce a { + color: #ffffff !important; +} +.gal-name:hover, +.gal-buttons a:hover, +.gal-sauce a:hover { + color: rgb(95, 95, 101) !important; +} +:root.gal-pdf .gal-buttons a:hover { + color: rgb(204, 204, 204) !important; +} +.gal-buttons, +.gal-labels { + position: fixed; + right: 195px; +} +.gal-hide-thumbnails .gal-buttons, +.gal-hide-thumbnails .gal-labels { + right: 44px; +} +:root:not(.gal-fit-width):not(.gal-pdf) .gal-labels { + bottom: 23px !important; +} +:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-buttons, +:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-labels { + right: 178px !important; +} +:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-buttons, +:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-labels { + right: 28px !important; +} +:root.gallery-open.fixed #header-bar:not(.autohide), +:root.gallery-open.fixed #header-bar:not(.autohide) #shortcuts .fa::before { + visibility: hidden; +} + +/* Mod Contact Links */ +.contact-links { + margin-left: 2px; +} +.move-note > a { + text-decoration: underline; +} +.invisible { + font-size: 0; +} + +/* PostJumper */ +.postJumper > .prev, +.postJumper > .next { + font-size: 120%; +} + +/* PSA */ +.fcx-announcement { + text-align: center; +} +.fcx-announcement a { + text-decoration: underline; +} + +@keyframes spin { + 0% {transform:rotate(0deg);} + 100% {transform:rotate(359deg);} +} + +.spin { + animation:spin 2s infinite linear; +} +`; + + var supports = `/* XXX Moved to end of stylesheet to avoid breaking whole stylesheet in Maxthon. */ +@supports (text-decoration-style: dashed) or (-moz-text-decoration-style: dashed) { + .quotelink.forwardlink, + .backlink.forwardlink { + text-decoration: underline; + -moz-text-decoration-style: dashed; + text-decoration-style: dashed; + border-bottom: none; + } +} +`; + + var tomorrow = `/* General */ +:root.tomorrow .dialog { + background-color: #282A2E; + border-color: #111; +} + +/* 4chan style fixes */ +:root.tomorrow #arc-list span.quote { + color: #B5BD68; +} +:root.tomorrow.highlight-you .quotesYou$site$highlightable$reply { + border-left: 3px solid rgba(145, 182, 214, .8) !important; +} +:root.tomorrow.highlight-own .yourPost$site$highlightable$reply { + border-left: 3px dashed rgba(145, 182, 214, .8) !important; +} + +/* Header */ +:root.tomorrow #header-bar.dialog { + background-color: rgba(40,42,46,0.9); +} +:root.tomorrow:not(.fixed) #header-bar, :root.tomorrow #notifications { + font-size: 9pt; +} +:root.tomorrow #header-bar, :root.tomorrow #notifications { + color: #C5C8C6; +} +:root.tomorrow #header-bar a, :root.tomorrow #notifications a { + color: #81A2BE; +} +:root.tomorrow.shortcut-icons .native-settings { + background-image: url('//s.4cdn.org/image/favicon-ws.ico'); +} + +/* Settings */ +:root.tomorrow #fourchanx-settings fieldset, :root.tomorrow .section-main div::before { + border-color: #111; +} +:root.tomorrow .suboption-list > div:last-of-type { + background-color: #282A2E; +} + +/* Catalog */ +:root.tomorrow.catalog-hover-expand .catalog-container:hover > .post { + background-color: #282A2E; +} +:root.tomorrow.werkTyme .catalog-thread:not(:hover), +:root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread, +:root.tomorrow.catalog-hover-expand .catalog-container:hover > .post, +:root.tomorrow.catalog-hover-expand .catalog-container:hover .catalog-reply { + border-color: #111; +} + +/* Quote */ +:root.tomorrow .backlink.deadlink { + color: #81A2BE !important; +} +:root.tomorrow .inline { + border-color: #111; + background-color: rgba(0, 0, 0, .14); +} + +/* Fappe and Werk Tyme */ +:root.tomorrow .indicator { + color: #282A2E; +} + +/* Highlighting */ +:root.tomorrow .qphl { + outline: 2px solid rgba(145, 182, 214, .8); +} +:root.tomorrow.highlight-you .quotesYou$site$highlightable$op, +:root.tomorrow.highlight-you .quotesYou$site$highlightable$reply { + border-left: 3px solid rgba(145, 182, 214, .8); +} +:root.tomorrow.highlight-own .yourPost$site$highlightable$op, +:root.tomorrow.highlight-own .yourPost$site$highlightable$reply { + border-left: 3px dashed rgba(145, 182, 214, .8); +} +:root.tomorrow .filter-highlight$site$highlightable$op, +:root.tomorrow .filter-highlight$site$highlightable$reply { + box-shadow: inset 5px 0 rgba(145, 182, 214, .5); +} +:root.tomorrow.highlight-own .yourPost > $site$sideArrows, +:root.tomorrow.highlight-you .quotesYou > $site$sideArrows, +:root.tomorrow .filter-highlight > $site$sideArrows { + color: rgb(155, 185, 210); +} +:root.tomorrow .catalog-thread.filter-highlight .catalog-thumb, +:root.tomorrow.werkTyme .catalog-thread.filter-highlight:not(:hover), +:root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread.filter-highlight, +:root.tomorrow.werkTyme.catalog-hover-expand .catalog-thread.filter-highlight > .catalog-container:hover > .catalog-post { + box-shadow: 0 0 3px 3px rgba(64, 192, 255, .7); +} +:root.tomorrow .catalog-thread.watched .catalog-thumb, +:root.tomorrow.werkTyme .catalog-thread.watched:not(:hover), +:root.tomorrow.werkTyme:not(.catalog-hover-expand) .catalog-thread.watched, +:root.tomorrow.werkTyme.catalog-hover-expand .catalog-thread.watched > .catalog-container:hover > .catalog-post { + border: 2px solid rgb(64, 192, 255); +} + + +/* QR */ +.tomorrow #dump-list::-webkit-scrollbar-thumb { + background-color: #282A2E; + border-color: #111; +} +:root.tomorrow .qr-preview { + background-color: rgba(255, 255, 255, .15); +} +:root.tomorrow #qr .field { + background-color: rgb(26, 27, 29); + color: rgb(197,200,198); + border-color: rgb(40, 41, 42); +} +:root.tomorrow #qr .field:focus, +:root.tomorrow #qr .field.focus { + border-color: rgb(129, 162, 190) !important; + background-color: rgb(30,32,36); +} +:root.tomorrow .persona button { + background: linear-gradient(to bottom, #2E3035, #222427) no-repeat; + color: rgb(197,200,198); + border-color: rgb(40, 41, 42); + outline: none; +} +:root.tomorrow .persona button::-moz-focus-inner { + border: none; +} +:root.tomorrow .persona button:focus { + border-color: rgb(129, 162, 190); +} +:root.tomorrow #qr.sjis-preview #sjis-toggle, +:root.tomorrow #qr.tex-preview #tex-preview-button { + background: rgb(26, 27, 29); +} +:root.tomorrow #qr select, +:root.tomorrow #file-n-submit > input, +:root.tomorrow #qr-draw-button { + border-color: rgb(40, 41, 42); +} +:root.tomorrow #qr-filename { + color: rgb(197,200,198); +} +:root.tomorrow .qr-link { + border-color: rgb(25, 27, 31) rgb(25, 27, 31) rgb(10, 12, 16); + background: linear-gradient(#37393D, #282A2E) repeat scroll 0% 0% transparent; +} +:root.tomorrow .qr-link:hover { + background: #282A2E; +} + +/* Menu */ +:root.tomorrow #menu { + color: #C5C8C6; +} +:root.tomorrow .entry { + font-size: 10pt; +} +:root.tomorrow .focused.entry { + background: rgba(0, 0, 0, .33); +} + +/* Unread */ +:root.tomorrow .unread-line { + border-color: rgb(197, 200, 198); +} +:root.tomorrow .unread-mark-read { + background-color: rgba(40,42,46,0.5); +} + +/* Thread Watcher */ +:root.tomorrow .replies-quoting-you > a, :root.tomorrow #watcher-link.replies-quoting-you, :root.tomorrow .last-page > a > .watcher-page { + color: #F00 !important; +} + +/* Watcher Favicon */ +:root.tomorrow .watch-thread-link +{ + background-image: url("data:image/svg+xml,"); +} +`; + + var www = `#captcha-cnt { + height: auto; +} +:root:not(.js-enabled) #form { + display: block; +} +#bd > div[style], #bd > div[style] > * { + height: auto !important; + margin: 0 !important; + font-size: 0; +} +`; + + var yotsubaB = `/* General */ +:root.yotsuba-b .dialog { + background-color: #D6DAF0; + border-color: #B7C5D9; +} +:root.yotsuba-b .field:focus, +:root.yotsuba-b .field.focus { + border-color: #98E; +} + +/* 4chan style fixes */ +:root.yotsuba-b.highlight-you .quotesYou$site$highlightable$reply { + border-left: 3px solid rgba(221, 0, 0, .8) !important; +} +:root.yotsuba-b.highlight-own .yourPost$site$highlightable$reply { + border-left: 3px dashed rgba(221, 0, 0, .8) !important; +} + +/* Header */ +:root.yotsuba-b #header-bar.dialog { + background-color: rgba(214,218,240,0.98); +} +:root.yotsuba-b:not(.fixed) #header-bar, :root.yotsuba-b #notifications { + font-size: 9pt; +} +:root.yotsuba-b #header-bar, :root.yotsuba-b #notifications { + color: #89A; +} +:root.yotsuba-b #board-list a, :root.yotsuba-b #shortcuts a { + color: #34345C; +} + +/* Settings */ +:root.yotsuba-b #fourchanx-settings fieldset, :root.yotsuba-b .section-main div::before { + border-color: #B7C5D9; +} +:root.yotsuba-b .suboption-list > div:last-of-type { + background-color: #D6DAF0; +} + +/* Catalog */ +:root.yotsuba-b.catalog-hover-expand .catalog-container:hover > .post { + background-color: #D6DAF0; +} +:root.yotsuba-b.werkTyme .catalog-thread:not(:hover), +:root.yotsuba-b.werkTyme:not(.catalog-hover-expand) .catalog-thread, +:root.yotsuba-b.catalog-hover-expand .catalog-container:hover > .post, +:root.yotsuba-b.catalog-hover-expand .catalog-container:hover .catalog-reply { + border-color: #B7C5D9; +} + +/* Quote */ +:root.yotsuba-b .backlink.deadlink { + color: #34345C !important; +} +:root.yotsuba-b .inline { + border-color: #B7C5D9; + background-color: rgba(255, 255, 255, .14); +} + +/* Fappe and Werk Tyme */ +:root.yotsuba-b .indicator { + color: #D6DAF0; +} + +/* QR */ +.yotsuba-b #dump-list::-webkit-scrollbar-thumb { + background-color: #D6DAF0; + border-color: #B7C5D9; +} +:root.yotsuba-b .qr-preview { + background-color: rgba(0, 0, 0, .15); +} +:root.yotsuba-b .qr-link { + border-color: rgb(199, 203, 225) rgb(199, 203, 225) rgb(184, 188, 210); + background: linear-gradient(#E5E9FF, #D6DAF0) repeat scroll 0% 0% transparent; +} +:root.yotsuba-b .qr-link:hover { + background: #D9DDF3; +} + + +/* Menu */ +:root.yotsuba-b #menu { + color: #000; +} +:root.yotsuba-b .entry { + font-size: 10pt; +} +:root.yotsuba-b .focused.entry { + background: rgba(255, 255, 255, .33); +} + +/* Unread */ +:root.yotsuba-b .unread-mark-read { + background-color: rgba(214,218,240,0.5); +} + +/* Thread Watcher */ +:root.yotsuba-b .replies-quoting-you > a, :root.yotsuba-b #watcher-link.replies-quoting-you { + color: #F00; +} + +/* Watcher Favicon */ +:root.yotsuba-b .watch-thread-link +{ + background-image: url("data:image/svg+xml,"); +} +`; + + var yotsuba = `/* General */ +:root.yotsuba .dialog { + background-color: #F0E0D6; + border-color: #D9BFB7; +} +:root.yotsuba .field:focus, +:root.yotsuba .field.focus { + border-color: #EA8; +} + +/* 4chan style fixes */ +:root.yotsuba.highlight-you .quotesYou$site$highlightable$reply { + border-left: 3px solid rgba(221, 0, 0, .8) !important; +} +:root.yotsuba.highlight-own .yourPost$site$highlightable$reply { + border-left: 3px dashed rgba(221, 0, 0, .8) !important; +} + +/* Header */ +:root.yotsuba #header-bar.dialog { + background-color: rgba(240,224,214,0.98); +} +:root.yotsuba:not(.fixed) #header-bar, :root.yotsuba #notifications { + font-size: 9pt; +} +:root.yotsuba #header-bar, :root.yotsuba #notifications { + color: #B86; +} +:root.yotsuba #board-list a, :root.yotsuba #shortcuts a { + color: #800000; +} + +/* Settings */ +:root.yotsuba #fourchanx-settings fieldset, :root.yotsuba .section-main div::before { + border-color: #D9BFB7; +} +:root.yotsuba .suboption-list > div:last-of-type { + background-color: #F0E0D6; +} + +/* Catalog */ +:root.yotsuba.catalog-hover-expand .catalog-container:hover > .post { + background-color: #F0E0D6; +} +:root.yotsuba.werkTyme .catalog-thread:not(:hover), +:root.yotsuba.werkTyme:not(.catalog-hover-expand) .catalog-thread, +:root.yotsuba.catalog-hover-expand .catalog-container:hover > .post, +:root.yotsuba.catalog-hover-expand .catalog-container:hover .catalog-reply { + border-color: #D9BFB7; +} + +/* Quote */ +:root.yotsuba .backlink.deadlink { + color: #00E !important; +} +:root.yotsuba .inline { + border-color: #D9BFB7; + background-color: rgba(255, 255, 255, .14); +} + +/* Fappe and Werk Tyme */ +:root.yotsuba .indicator { + color: #F0E0D6; +} + +/* QR */ +.yotsuba #dump-list::-webkit-scrollbar-thumb { + background-color: #F0E0D6; + border-color: #D9BFB7; +} +:root.yotsuba .qr-preview { + background-color: rgba(0, 0, 0, .15); +} +:root.yotsuba .qr-link { + border-color: rgb(225, 209, 199) rgb(225, 209, 199) rgb(210, 194, 184); + background: linear-gradient(#FFEFE5, #F0E0D6) repeat scroll 0% 0% transparent; +} +:root.yotsuba .qr-link:hover { + background: #F0E0D6; +} + +/* Menu */ +:root.yotsuba #menu { + color: #800000; +} +:root.yotsuba .entry { + font-size: 10pt; +} +:root.yotsuba .focused.entry { + background: rgba(255, 255, 255, .33); +} + +/* Unread */ +:root.yotsuba .unread-mark-read { + background-color: rgba(240,224,214,0.5); +} + +/* Thread Watcher */ +:root.yotsuba .replies-quoting-you > a, :root.yotsuba #watcher-link.replies-quoting-you, :root.yotsuba .last-page > a > .watcher-page { + color: #F00; +} + +/* Watcher Favicon */ +:root.yotsuba .watch-thread-link +{ + background-image: url("data:image/svg+xml,"); +} +`; + + // == Create CSS for Link Title Favicons == // + const icons = (data) => ('/* Link Title Favicons */\n' + + data.map(({ name, data }) => `.linkify.${name}::before { + content: ""; + background: transparent url('data:image/png;base64,${data}') center left no-repeat!important; + padding-left: 18px; +} +`).join('')); + + // cSpell:ignore installGentoo, webfont + // <% + // var inc = require['style']; + // var faCSS = read('/node_modules/font-awesome/css/font-awesome.css'); + // var mainCSS = ['font-awesome', 'style', 'yotsuba', 'yotsuba-b', 'futaba', 'burichan', 'tomorrow', 'photon', 'spooky'].map(x => read(`${x}.css`)).join(''); + // var iconNames = files.filter(f => /^linkify\.[^.]+\.png$/.test(f)); + // var icons = iconNames.map(readBase64); + // %> + const mainCSS = style + yotsuba + yotsubaB + futaba + burichan + tomorrow + photon + spooky; + const faIcons = [ + { name: "Audio", data: linkifyAudio }, + { name: "Bitchute", data: linkifyBitchute }, + { name: "Clyp", data: linkifyClyp }, + { name: "Dailymotion", data: linkifyDailymotion }, + { name: "Gfycat", data: linkifyGfycat }, + { name: "Gist", data: linkifyGist }, + { name: "Image", data: linkifyImage }, + { name: "Installgentoo", data: linkifyInstallgentoo }, + { name: "Liveleak", data: linkifyLiveleak }, + { name: "Pastebin", data: linkifyPastebin }, + { name: "Peertube", data: linkifyPeertube }, + { name: "Soundcloud", data: linkifySoundcloud }, + { name: "Streamable", data: linkifyStreamable }, + { name: "Twitchtv", data: linkifyTwitchtv }, + { name: "Twitter", data: linkifyTwitter }, + { name: "Video", data: linkifyVideo }, + { name: "Vidlii", data: linkifyVidlii }, + { name: "Cimeo", data: linkifyCimeo }, + { name: "Vine", data: linkifyVine }, + { name: "Vocaroo", data: linkifyVocaroo }, + { name: "Youtube", data: linkifyYoutube }, + ]; + const CSS = { + boards: mainCSS + icons(faIcons) + supports, + report, + www, + sub: function (css) { + var variables = { + site: g.SITE.selectors + }; + return css.replace(/\$[\w\$]+/g, function (name) { + var words = name.slice(1).split('$'); + var sel = variables; + for (var i = 0; i < words.length; i++) { + if (typeof sel !== 'object') + return ':not(*)'; + sel = $$1.getOwn(sel, words[i]); + } + if (typeof sel !== 'string') + return ':not(*)'; + return sel; + }); + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + const CustomCSS = { + init() { + if (!Conf['Custom CSS']) { return; } + return this.addStyle(); + }, + + addStyle() { + return this.style = $$1.addStyle(CSS.sub(Conf['usercss']), 'custom-css', '#fourchanx-css'); + }, + + rmStyle() { + if (this.style) { + $$1.rm(this.style); + return delete this.style; + } + }, + + update() { + if (!this.style) { + return this.addStyle(); + } + return this.style.textContent = CSS.sub(Conf['usercss']); + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + const SWTinyboard = { + isOPContainerThread: true, + mayLackJSON: true, + threadModTimeIgnoresSage: true, + + disabledFeatures: [ + 'Resurrect Quotes', + 'Quick Reply Personas', + 'Quick Reply', + 'Cooldown', + 'Report Link', + 'Delete Link', + 'Edit Link', + 'Quote Inlining', + 'Quote Previewing', + 'Quote Backlinks', + 'File Info Formatting', + 'Image Expansion', + 'Image Expansion (Menu)', + 'Comment Expansion', + 'Thread Expansion', + 'Favicon', + 'Quote Threading', + 'Thread Updater', + 'Banner', + 'Flash Features', + 'Reply Pruning' + ], + + detect() { + for (var script of $$('script:not([src])', d$1.head)) { + var m; + if (m = script.textContent.match(/\bvar configRoot=(".*?")/)) { + var properties = dict(); + try { + var root = JSON.parse(m[1]); + if (root[0] === '/') { + properties.root = location.origin + root; + } else if (/^https?:/.test(root)) { + properties.root = root; + } + } catch (error) {} + return properties; + } + } + return false; + }, + + awaitBoard(cb) { + if ($$1.id('react-ui')) { + const s = (this.selectors = Object.create(this.selectors)); + s.boardFor = {index: '.page-container'}; + s.thread = 'div[id^="thread_"]'; + return Main$1.mounted(cb); + } else { + return cb(); + } + }, + + urls: { + thread({siteID, boardID, threadID}, isArchived) { + return `${Conf['siteProperties'][siteID]?.root || `http://${siteID}/`}${boardID}/${isArchived ? 'archive/' : ''}res/${threadID}.html`; + }, + post({postID}) { return `#${postID}`; }, + index({siteID, boardID}) { return `${Conf['siteProperties'][siteID]?.root || `http://${siteID}/`}${boardID}/`; }, + catalog({siteID, boardID}) { return `${Conf['siteProperties'][siteID]?.root || `http://${siteID}/`}${boardID}/catalog.html`; }, + threadJSON({siteID, boardID, threadID}, isArchived) { + const root = Conf['siteProperties'][siteID]?.root; + if (root) { return `${root}${boardID}/${isArchived ? 'archive/' : ''}res/${threadID}.json`; } else { return ''; } + }, + archivedThreadJSON(thread) { + return SWTinyboard.urls.threadJSON(thread, true); + }, + threadsListJSON({siteID, boardID}) { + const root = Conf['siteProperties'][siteID]?.root; + if (root) { return `${root}${boardID}/threads.json`; } else { return ''; } + }, + archiveListJSON({siteID, boardID}) { + const root = Conf['siteProperties'][siteID]?.root; + if (root) { return `${root}${boardID}/archive/archive.json`; } else { return ''; } + }, + catalogJSON({siteID, boardID}) { + const root = Conf['siteProperties'][siteID]?.root; + if (root) { return `${root}${boardID}/catalog.json`; } else { return ''; } + }, + file({siteID, boardID}, filename) { + return `${Conf['siteProperties'][siteID]?.root || `http://${siteID}/`}${boardID}/${filename}`; + }, + thumb(board, filename) { + return SWTinyboard.urls.file(board, filename); + } + }, + + selectors: { + board: 'form[name="postcontrols"]', + thread: 'input[name="board"] ~ div[id^="thread_"]', + threadDivider: 'div[id^="thread_"] > hr:last-child', + summary: '.omitted', + postContainer: 'div[id^="reply_"]:not(.hidden)', // postContainer is thread for OP + opBottom: '.op', + replyOriginal: 'div[id^="reply_"]:not(.hidden)', + infoRoot: '.intro', + info: { + subject: '.subject', + name: '.name', + email: '.email', + tripcode: '.trip', + uniqueID: '.poster_id', + capcode: '.capcode', + flag: '.flag', + date: 'time', + nameBlock: 'label', + quote: 'a[href*="#q"]', + reply: 'a[href*="/res/"]:not([href*="#"])' + }, + icons: { + isSticky: '.fa-thumb-tack', + isClosed: '.fa-lock' + }, + file: { + text: '.fileinfo', + link: '.fileinfo > a', + thumb: 'a > .post-image' + }, + thumbLink: '.file > a', + multifile: '.files > .file', + highlightable: { + op: ' > .op', + reply: '.reply', + catalog: ' > .thread' + }, + comment: '.body', + spoiler: '.spoiler', + quotelink: 'a[onclick*="highlightReply("]', + catalog: { + board: '#Grid', + thread: '.mix', + thumb: '.thread-image' + }, + boardList: '.boardlist', + boardListBottom: '.boardlist.bottom', + styleSheet: '#stylesheet', + psa: '.blotter', + nav: { + prev: '.pages > form > [value=Previous]', + next: '.pages > form > [value=Next]' + } + }, + + classes: { + highlight: 'highlighted' + }, + + xpath: { + thread: 'div[starts-with(@id,"thread_")]', + postContainer: 'div[starts-with(@id,"reply_") or starts-with(@id,"thread_")]', + replyContainer: 'div[starts-with(@id,"reply_")]' + }, + + regexp: { + quotelink: + new RegExp(`\ +/\ +([^/]+)\ +/res/\ +(\\d+)\ +(?:\\.\\w+)?#\ +(\\d+)\ +$\ +`), + quotelinkHTML: + /]*\bhref="[^"]*\/([^\/]+)\/res\/(\d+)(?:\.\w+)?#(\d+)"/g + }, + + Build: { + parseJSON(data, board) { + const o = this.parseJSON(data, board); + if (data.ext === 'deleted') { + delete o.file; + $$1.extend(o, { + files: [], + fileDeleted: true, + filesDeleted: [0] + }); + } + if (data.extra_files) { + let file; + for (let i = 0; i < data.extra_files.length; i++) { + var extra_file = data.extra_files[i]; + if (extra_file.ext === 'deleted') { + o.filesDeleted.push(i); + } else { + file = this.parseJSONFile(data, board); + o.files.push(file); + } + } + if (o.files.length) { + o.file = o.files[0]; + } + } + return o; + }, + + parseComment(html) { + html = html + .replace(//gi, '\n') + .replace(/<[^>]*>/g, ''); + return $$1.unescape(html); + } + }, + + bgColoredEl() { + return $$1.el('div', {className: 'post reply'}); + }, + + isFileURL(url) { + return /\/src\/[^\/]+/.test(url.pathname); + }, + + preParsingFixes(board) { + // fixes effects of unclosed link in announcement + let broken; + if (broken = $$1('a > input[name="board"]', board)) { + return $$1.before(broken.parentNode, broken); + } + }, + + parseNodes(post, nodes) { + // Add vichan's span.poster_id around the ID if not already present. + let m; + if (nodes.uniqueID) { return; } + let text = ''; + let node = nodes.nameBlock.nextSibling; + while (node && (node.nodeType === 3)) { + text += node.textContent; + node = node.nextSibling; + } + if (m = text.match(/(\s*ID:\s*)(\S+)/)) { + let uniqueID; + nodes.info.normalize(); + let {nextSibling} = nodes.nameBlock; + nextSibling = nextSibling.splitText(m[1].length); + nextSibling.splitText(m[2].length); + nodes.uniqueID = (uniqueID = $$1.el('span', {className: 'poster_id'})); + $$1.replace(nextSibling, uniqueID); + return $$1.add(uniqueID, nextSibling); + } + }, + + parseDate(node) { + let date = Date.parse(node.getAttribute('datetime')?.trim()); + if (!isNaN(date)) { return new Date(date); } + date = Date.parse(node.textContent.trim() + ' UTC'); // e.g. onesixtwo.club + if (!isNaN(date)) { return new Date(date); } + return undefined; + }, + + parseFile(post, file) { + let info, infoNode; + const {text, link, thumb} = file; + if ($$1.x(`ancestor::${this.xpath.postContainer}[1]`, text) !== post.nodes.root) { return false; } // file belongs to a reply + if (!(infoNode = link.nextSibling?.textContent.includes('(') ? link.nextSibling : link.nextElementSibling)) { return false; } + if (!(info = infoNode.textContent.match(/\((.*,\s*)?([\d.]+ ?[KMG]?B).*\)/))) { return false; } + const nameNode = $$1('.postfilename', text); + $$1.extend(file, { + name: nameNode ? (nameNode.title || nameNode.textContent) : link.pathname.match(/[^/]*$/)[0], + size: info[2], + dimensions: info[0].match(/\d+x\d+/)?.[0] + }); + if (thumb) { + $$1.extend(file, { + thumbURL: /\/static\//.test(thumb.src) && $$1.isImage(link.href) ? link.href : thumb.src, + isSpoiler: /^Spoiler/i.test(info[1] || '') || (link.textContent === 'Spoiler Image') + } + ); + } + return true; + }, + + isThumbExpanded(file) { + // Detect old Tinyboard image expansion that changes src attribute on thumbnail. + return $$1.hasClass(file.thumb.parentNode, 'expanded') || (file.thumb.parentNode.dataset.expanded === 'true'); + }, + + isLinkified(link) { + return /\bnofollow\b/.test(link.rel); + }, + + catalogPin(threadRoot) { + return threadRoot.dataset.sticky = 'true'; + } + }; + + const passMessagePage = h("div", { class: "box-inner" }, + h("div", { class: "boxbar" }, + h("h2", null, + "Trouble buying a 4chan Pass? (a message from 4chan X)", + h("a", { href: "javascript:;", style: "text-decoration: none; float: right; margin-right: 4px;", title: "Close" }, "\u00D7"))), + h("div", { class: "boxcontent" }, + "Check the 4chan X wiki for ", + h("a", { href: `${meta.captchaFAQ}#alternatives`, target: "_blank", rel: "noopener" }, "alternative solutions"), + ".")); + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + + const PassMessage = { + init() { + if (Conf['passMessageClosed']) { return; } + const msg = $$1.el('div', + {className: 'box-outer top-box'} + , + passMessagePage); + msg.style.cssText = 'padding-bottom: 0;'; + const close = $$1('a', msg); + $$1.on(close, 'click', function() { + $$1.rm(msg); + return $$1.set('passMessageClosed', true); + }); + return $$1.ready(function() { + let hd; + if (hd = $$1.id('hd')) { + return $$1.after(hd, msg); + } else { + return $$1.prepend(d$1.body, msg); + } + }); + } + }; + + var ReportPage = ` + + + +`; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + + var Report = { + init() { + let match; + if (!(match = location.search.match(/\bno=(\d+)/))) { return; } + Captcha.replace.init(); + this.postID = +match[1]; + return $$1.ready(this.ready); + }, + + ready() { + $$1.addStyle(CSS.report); + + if (Conf['Archive Report']) { Report.archive(); } + + new MutationObserver(function() { + Report.fit('iframe[src^="https://www.google.com/recaptcha/api2/frame"]'); + return Report.fit('body'); + }).observe(d$1.body, { + childList: true, + attributes: true, + subtree: true + } + ); + return Report.fit('body'); + }, + + fit(selector) { + let el; + if (!((el = $$1(selector, doc)) && (getComputedStyle(el).visibility !== 'hidden'))) { return; } + const dy = (el.getBoundingClientRect().bottom - doc.clientHeight) + 8; + if (dy > 0) { return window.resizeBy(0, dy); } + }, + + archive() { + let match, urls; + if (!(urls = Redirect$1.report(g.BOARD.ID)).length) { return; } + + const form = $$1('form'); + const types = $$1.id('reportTypes'); + const message = $$1('h3'); + + const fieldset = $$1.el('fieldset', { + id: 'archive-report', + hidden: true + } + , + { innerHTML: ReportPage }); + const enabled = $$1('#archive-report-enabled', fieldset); + const reason = $$1('#archive-report-reason', fieldset); + const submit = $$1('#archive-report-submit', fieldset); + + $$1.on(enabled, 'change', function() { + return reason.disabled = !this.checked; + }); + + if (form && types) { + fieldset.hidden = !$$1('[value="31"]', types).checked; + $$1.on(types, 'change', function(e) { + fieldset.hidden = (e.target.value !== '31'); + return Report.fit('body'); + }); + $$1.after(types, fieldset); + Report.fit('body'); + $$1.one(form, 'submit', function(e) { + if (!fieldset.hidden && enabled.checked) { + e.preventDefault(); + return Report.archiveSubmit(urls, reason.value, results => { + this.action = '#archiveresults=' + encodeURIComponent(JSON.stringify(results)); + return this.submit(); + }); + } + }); + } else if (message) { + fieldset.hidden = /Report submitted!/.test(message.textContent); + $$1.on(enabled, 'change', function() { + return submit.hidden = !this.checked; + }); + $$1.after(message, fieldset); + $$1.on(submit, 'click', () => Report.archiveSubmit(urls, reason.value, Report.archiveResults)); + } + + if (match = location.hash.match(/^#archiveresults=(.*)$/)) { + try { + return Report.archiveResults(JSON.parse(decodeURIComponent(match[1]))); + } catch (error) {} + } + }, + + archiveSubmit(urls, reason, cb) { + const form = $$1.formData({ + board: g.BOARD.ID, + num: Report.postID, + reason + }); + const results = []; + for (var [name, url] of urls) { + (function(name, url) { + return $$1.ajax(url, { + onloadend() { + results.push([name, this.response || {error: ''}]); + if (results.length === urls.length) { + return cb(results); + } + }, + form + }); + })(name, url); + } + }, + + archiveResults(results) { + const fieldset = $$1.id('archive-report'); + for (var [name, response] of results) { + var line = $$1.el('h3', + {className: 'archive-report-response'}); + if ('success' in response) { + $$1.addClass(line, 'archive-report-success'); + line.textContent = `${name}: ${response.success}`; + } else { + $$1.addClass(line, 'archive-report-error'); + line.textContent = `${name}: ${response.error || 'Error reporting post.'}`; + } + if (fieldset) { + $$1.before(fieldset, line); + } else { + $$1.add(d$1.body, line); + } + } + } + }; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + const PostSuccessful = { + init() { + if (!Conf['Remember Your Posts']) { return; } + return $$1.ready(this.ready); + }, + + ready() { + if (d$1.title !== 'Post successful!') { return; } + + let [_, threadID, postID] = Array.from($$1('h1').nextSibling.textContent.match(/thread:(\d+),no:(\d+)/)); + postID = +postID; + threadID = +threadID || postID; + + const db = new DataBoard('yourPosts'); + return db.set({ + boardID: g.BOARD.ID, + threadID, + postID, + val: true + }); + } + }; + + function generatePostInfoHtml(ID, o, subject, capcode, email, name, tripcode, pass, capcodeLC, capcodePlural, staticPath, gifIcon, capcodeDescription, uniqueID, flag, flagCode, flagCodeTroll, dateUTC, dateText, postLink, quoteLink, boardID, threadID) { + const nameHtml = [h("span", { class: `name${capcode ? ' ' + capcode : ''}` }, name)]; + if (tripcode) + nameHtml.push(' ', h("span", { class: "postertrip" }, tripcode)); + if (pass) + nameHtml.push(' ', h("span", { title: `Pass user since ${pass}`, class: "n-pu" })); + if (capcode) { + nameHtml.push(' ', h("strong", { class: `capcode hand id_${capcodeLC}`, title: `Highlight posts by ${capcodePlural}` }, + "## ", + capcode)); + } + const nameBlockContent = email ? [' ', h("a", { href: `mailto:${email}`, class: "useremail" }, ...nameHtml)] : nameHtml; + if (!(boardID === "f" && !o.isReply || capcodeDescription)) + nameBlockContent.push(' '); + if (capcodeDescription) { + nameBlockContent.push(h("img", { src: `${staticPath}${capcodeLC}icon${gifIcon}`, alt: `${capcode} Icon}`, title: `This user is ${capcodeDescription}.`, class: "identityIcon retina" })); + if (uniqueID && !capcode) { + nameBlockContent.push(h("span", { class: `posteruid id_${uniqueID}` }, + "(ID: ", + h("span", { class: "hand", title: "Highlight posts by this ID" }, + "$", + uniqueID), + ")")); + } + } + if (flagCode) + nameBlockContent.push(' ', h("span", { title: flag, class: `flag flag-${flagCode.toLowerCase()}` })); + if (flagCodeTroll) + nameBlockContent.push(' ', h("span", { title: flag, class: `bfl bfl-${flagCodeTroll.toLowerCase()}` })); + const postNumContent = [ + h("a", { href: postLink, title: "Link to this post" }, "No."), + h("a", { href: quoteLink, title: "Reply to this post" }, ID), + ]; + if (o.isSticky) { + const src = `${staticPath}sticky${gifIcon}`; + postNumContent.push(' '); + if (boardID === "f") { + postNumContent.push(h("img", { src: src, alt: "Sticky", title: "Sticky", style: "height: 18px; width: 18px;" })); + } + else { + postNumContent.push(h("img", { src: src, alt: "Sticky", title: "Sticky", class: "stickyIcon retina" })); + } + } + if (o.isClosed && !o.isArchived) { + postNumContent.push(' '); + const src = `${staticPath}closed${gifIcon}`; + if (boardID === "f") { + postNumContent.push(h("img", { src: src, alt: "Closed", title: "Closed", style: "height: 18px; width: 18px;" })); + } + else { + postNumContent.push(h("img", { src: src, alt: "Closed", title: "Closed", class: "closedIcon retina" })); + } + } + if (o.isArchived) { + postNumContent.push(' ', h("img", { src: `${staticPath}archived${gifIcon}`, alt: "Archived", title: "Archived", class: "archivedIcon retina" })); + } + if (!o.isReply && g.VIEW === "index") { + // \u00A0 is nbsp + postNumContent.push(' \u00A0 '); + postNumContent.push(h("span", null, + "[", + h("a", { href: `/${boardID}/thread/${threadID}`, class: "replylink" }, "Reply"), + "]")); + } + return h("div", { class: "postInfo desktop", id: `pi${ID}` }, + h("input", { type: "checkbox", name: ID, value: "delete" }), + ' ', + ...((!o.isReply || boardID === "f" || subject) ? [h("span", { class: "subject" }, subject), ' '] : []), + h("span", { class: `nameBlock${capcode || ''}` }, ...nameBlockContent), + ' ', + h("span", { class: "dateTime", "data-utc": dateUTC }, dateText), + ' ', + h("span", { class: `postNum${!(boardID === " f" && !o.isReply) ? ' desktop' : ''}` }, ...postNumContent)); + } + + function generateFileHtml(file, ID, boardID, fileURL, shortFilename, fileThumb, o, staticPath, gifIcon) { + if (file) { + const fileContent = []; + if (boardID === "f") { + fileContent.push(h("div", { class: "fileInfo", "data-md5": file.MD5 }, + h("span", { class: "fileText", id: `fT${ID}` }, + 'File: ', + h("a", { "data-width": file.width, "data-height": file.height, href: fileURL, target: "_blank" }, file.name), + "-(", + file.size, + ", ", + file.dimensions, + file.tag ? ', ' + file.tag : '', + ")"))); + } + else { + fileContent.push(h("div", { class: "fileText", id: `fT${ID}`, title: file.isSpoiler ? file.name : null }, + 'File: ', + h("a", { title: file.name === shortFilename || file.isSpoiler ? null : file.name, href: fileURL, target: "_blank" }, file.isSpoiler ? 'Spoiler Image' : shortFilename), + ` (${file.size}, ${file.dimensions || "PDF"})`), h("a", { class: `fileThumb${file.isSpoiler ? ' imgspoiler' : ''}`, href: fileURL, target: "_blank", "data-m": file.hasDownscale ? '' : null }, + h("img", { src: fileThumb, alt: file.size, "data-md5": file.MD5, style: `height: ${file.isSpoiler ? '100' : file.theight}px; width: ${file.isSpoiler ? '100' : file.twidth}px;`, loading: "lazy" }))); + } + return h("div", { class: "file", id: `f${ID}` }, ...fileContent); + } + else if (o.fileDeleted) { + return h("div", { class: "file", id: `f${ID}` }, + h("span", { class: "fileThumb" }, + h("img", { src: `${staticPath}filedeleted-res${gifIcon}`, alt: "File deleted.", class: "fileDeletedRes retina" }))); + } + return { innerHTML: '', [isEscaped]: true }; + } + + function generateCatalogThreadHtml(thread, src, imgClass, data, postCount, fileCount, pageCount, staticPath, gifIcon) { + return h(hFragment, null, + h("a", { class: "catalog-link", href: `/${thread.board}/thread/${thread.ID}` }, imgClass ? + h("img", { src: src, class: `catalog-thumb ${imgClass}` }) : + h("img", { src: src, class: "catalog-thumb", "data-width": data.tn_w, "data-height": data.tn_h })), + h("div", { class: "catalog-stats" }, + h("span", { title: "Posts / Files / Page" }, + h("span", { class: `post-count${data.bumplimit ? ' warning' : ''}` }, postCount), + ' / ', + h("span", { class: `file-count${data.imagelimit ? ' warning' : ''}` }, fileCount), + ' / ', + h("span", { class: "page-count" }, pageCount)), + h("span", { class: "catalog-icons" }, + thread.isSticky ? h("img", { src: `${staticPath}sticky${gifIcon}`, class: "stickyIcon", title: "Sticky" }) : '', + thread.isClosed ? h("img", { src: `${staticPath}closed${gifIcon}`, class: "closedIcon", title: "Closed" }) : ''))); + } + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * DS205: Consider reworking code to avoid use of IIFEs + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + const SWYotsuba = { + isOPContainerThread: false, + hasIPCount: true, + archivedBoardsKnown: true, + urls: { + thread({ boardID, threadID }) { return `${location.protocol}//${BoardConfig.domain(boardID)}/${boardID}/thread/${threadID}`; }, + post({ postID }) { return `#p${postID}`; }, + index({ boardID }) { return `${location.protocol}//${BoardConfig.domain(boardID)}/${boardID}/`; }, + catalog({ boardID }) { if (boardID === 'f') { + return undefined; + } + else { + return `${location.protocol}//${BoardConfig.domain(boardID)}/${boardID}/catalog`; + } }, + archive({ boardID }) { if (BoardConfig.isArchived(boardID)) { + return `${location.protocol}//${BoardConfig.domain(boardID)}/${boardID}/archive`; + } + else { + return undefined; + } }, + threadJSON({ boardID, threadID }) { return `${location.protocol}//a.4cdn.org/${boardID}/thread/${threadID}.json`; }, + threadsListJSON({ boardID }) { return `${location.protocol}//a.4cdn.org/${boardID}/threads.json`; }, + archiveListJSON({ boardID }) { if (BoardConfig.isArchived(boardID)) { + return `${location.protocol}//a.4cdn.org/${boardID}/archive.json`; + } + else { + return ''; + } }, + catalogJSON({ boardID }) { return `${location.protocol}//a.4cdn.org/${boardID}/catalog.json`; }, + file({ boardID }, filename) { + const hostname = boardID === 'f' ? ImageHost.flashHost() : ImageHost.host(); + return `${location.protocol}//${hostname}/${boardID}/${filename}`; + }, + thumb({ boardID }, filename) { + return `${location.protocol}//${ImageHost.thumbHost()}/${boardID}/${filename}`; + } + }, + isPrunedByAge({ boardID }) { return boardID === 'f'; }, + areMD5sDeferred({ boardID }) { return boardID === 'f'; }, + isOnePage({ boardID }) { return boardID === 'f'; }, + noAudio({ boardID }) { return BoardConfig.noAudio(boardID); }, + selectors: { + board: '.board', + thread: '.thread', + threadDivider: '.board > hr', + summary: '.summary', + postContainer: '.postContainer', + replyOriginal: '.replyContainer:not([data-clone])', + sideArrows: 'div.sideArrows', + post: '.post', + infoRoot: '.postInfo', + info: { + subject: '.subject', + name: '.name', + email: '.useremail', + tripcode: '.postertrip', + uniqueIDRoot: '.posteruid', + uniqueID: '.posteruid > .hand', + capcode: '.capcode.hand', + pass: '.n-pu', + flag: '.flag, .bfl', + date: '.dateTime', + nameBlock: '.nameBlock', + quote: '.postNum > a:nth-of-type(2)', + reply: '.replylink' + }, + icons: { + isSticky: '.stickyIcon', + isClosed: '.closedIcon', + isArchived: '.archivedIcon' + }, + file: { + text: '.file > :first-child', + link: '.fileText > a', + thumb: 'a.fileThumb > [data-md5]' + }, + thumbLink: 'a.fileThumb', + highlightable: { + op: '.opContainer', + reply: ' > .reply', + catalog: '' + }, + comment: '.postMessage', + spoiler: 's', + quotelink: ':not(pre) > .quotelink', + catalog: { + board: '#threads', + thread: '.thread', + thumb: '.thumb' + }, + boardList: '#boardNavDesktop > .boardList', + boardListBottom: '#boardNavDesktopFoot > .boardList', + styleSheet: 'link[title=switch]', + psa: '#globalMessage', + psaTop: '#globalToggle', + searchBox: '#search-box', + nav: { + prev: '.prev > form > [type=submit]', + next: '.next > form > [type=submit]' + } + }, + classes: { + highlight: 'highlight' + }, + xpath: { + thread: 'div[contains(concat(" ",@class," ")," thread ")]', + postContainer: 'div[contains(@class,"postContainer")]', + replyContainer: 'div[contains(@class,"replyContainer")]' + }, + regexp: { + quotelink: new RegExp(`\ +^https?://boards\\.4chan(?:nel)?\\.org/+\ +([^/]+)\ +/+thread/+\ +(\\d+)\ +(?:[/?][^#]*)?\ +(?:#p\ +(\\d+)\ +)?\ +$\ +`), + quotelinkHTML: /]*\bhref="(?:(?:\/\/boards\.4chan(?:nel)?\.org)?\/([^\/]+)\/thread\/)?(\d+)?(?:#p(\d+))?"/g, + pass: /^https?:\/\/www\.4chan(?:nel)?\.org\/+pass(?:$|[?#])/, + captcha: /^https?:\/\/sys\.4chan(?:nel)?\.org\/+captcha(?:$|[?#])/, + }, + bgColoredEl() { + return $$1.el('div', { className: 'reply' }); + }, + isThisPageLegit() { + // not 404 error page or similar. + return ['boards.4chan.org', 'boards.4channel.org'].includes(location.hostname) && + d$1.doctype && + !$$1('link[href*="favicon-status.ico"]', d$1.head) && + !['4chan - Temporarily Offline', '4chan - Error', '504 Gateway Time-out', 'MathJax Equation Source'].includes(d$1.title); + }, + is404() { + // XXX Sometimes threads don't 404 but are left over as stubs containing one garbage reply post. + return ['4chan - Temporarily Offline', '4chan - 404 Not Found'].includes(d$1.title) || ((g.VIEW === 'thread') && $$1('.board') && !$$1('.opContainer')); + }, + isIncomplete() { + return ['index', 'thread'].includes(g.VIEW) && !$$1('.board + *'); + }, + isBoardlessPage(url) { + return ['www.4chan.org', 'www.4channel.org'].includes(url.hostname); + }, + isAuxiliaryPage(url) { + return !['boards.4chan.org', 'boards.4channel.org'].includes(url.hostname); + }, + isFileURL(url) { + return ImageHost.test(url.hostname); + }, + initAuxiliary() { + switch (location.hostname) { + case 'www.4chan.org': + case 'www.4channel.org': + if (SWYotsuba.regexp.pass.test(location.href)) { + PassMessage.init(); + } + else { + $$1.onExists(doc$1, 'body', () => $$1.addStyle(CSS.www)); + Captcha.replace.init(); + } + return; + case 'sys.4chan.org': + case 'sys.4channel.org': + var pathname = location.pathname.split(/\/+/); + if (pathname[2] === 'imgboard.php') { + let match; + if (/\bmode=report\b/.test(location.search)) { + Report.init(); + } + else if (match = location.search.match(/\bres=(\d+)/)) { + $$1.ready(function () { + if (Conf['404 Redirect'] && ($$1.id('errmsg')?.textContent === 'Error: Specified thread does not exist.')) { + return Redirect$1.navigate('thread', { + boardID: g.BOARD.ID, + postID: +match[1] + }); + } + }); + } + } + else if (pathname[2] === 'post') { + PostSuccessful.init(); + } + return; + } + }, + scriptData() { + for (var script of $$('script:not([src])', d$1.head)) { + if (/\bcooldowns *=/.test(script.textContent)) { + return script.textContent; + } + } + return ''; + }, + parseThreadMetadata(thread) { + let m; + const scriptData = this.scriptData(); + thread.postLimit = /\bbumplimit *= *1\b/.test(scriptData); + thread.fileLimit = /\bimagelimit *= *1\b/.test(scriptData); + thread.ipCount = (m = scriptData.match(/\bunique_ips *= *(\d+)\b/)) ? +m[1] : undefined; + if ((g.BOARD.ID === 'f') && thread.OP.file) { + const { file } = thread.OP; + return $$1.ajax(this.urls.threadJSON({ boardID: 'f', threadID: thread.ID }), { + timeout: MINUTE, + onloadend() { + if (this.response) { + return file.text.dataset.md5 = (file.MD5 = this.response.posts[0].md5); + } + } + }); + } + }, + parseNodes(post, nodes) { + // Add CSS classes to sticky/closed icons on /f/ to match other boards. + if (post.boardID === 'f') { + return (() => { + const result = []; + for (var type of ['Sticky', 'Closed']) { + var icon; + if (icon = $$1(`img[alt=${type}]`, nodes.info)) { + result.push($$1.addClass(icon, `${type.toLowerCase()}Icon`, 'retina')); + } + } + return result; + })(); + } + }, + parseDate(node) { + return new Date(node.dataset.utc * 1000); + }, + parseFile(post, file) { + let info; + const { text, link, thumb } = file; + if (!(info = link.nextSibling?.textContent.match(/\(([\d.]+ [KMG]?B).*\)/))) { + return false; + } + $$1.extend(file, { + name: text.title || link.title || link.textContent, + size: info[1], + dimensions: info[0].match(/\d+x\d+/)?.[0], + tag: info[0].match(/,[^,]*, ([a-z]+)\)/i)?.[1], + MD5: text.dataset.md5 + }); + if (thumb) { + $$1.extend(file, { + thumbURL: thumb.src, + MD5: thumb.dataset.md5, + isSpoiler: $$1.hasClass(thumb.parentNode, 'imgspoiler') + }); + if (file.isSpoiler) { + let m; + file.thumbURL = (m = link.href.match(/\d+(?=\.\w+$)/)) ? `${location.protocol}//${ImageHost.thumbHost()}/${post.board}/${m[0]}s.jpg` : undefined; + } + } + return true; + }, + cleanComment(bq) { + let abbr; + if (abbr = $$1('.abbr', bq)) { // 'Comment too long' or 'EXIF data available' + for (var node of $$('.abbr + br, .exif', bq)) { + $$1.rm(node); + } + for (let i = 0; i < 2; i++) { + var br; + if ((br = abbr.previousSibling) && (br.nodeName === 'BR')) { + $$1.rm(br); + } + } + return $$1.rm(abbr); + } + }, + cleanCommentDisplay(bq) { + let b; + if ((b = $$1('b', bq)) && /^Rolled /.test(b.textContent)) { + $$1.rm(b); + } + return $$1.rm($$1('.fortune', bq)); + }, + insertTags(bq) { + let node; + for (node of $$('s, .removed-spoiler', bq)) { + $$1.replace(node, [$$1.tn('[spoiler]'), ...Array.from(node.childNodes), $$1.tn('[/spoiler]')]); + } + for (node of $$('.prettyprint', bq)) { + $$1.replace(node, [$$1.tn('[code]'), ...Array.from(node.childNodes), $$1.tn('[/code]')]); + } + }, + hasCORS(url) { + return url.split('/').slice(0, 3).join('/') === (location.protocol + '//a.4cdn.org'); + }, + sfwBoards(sfw) { + return BoardConfig.sfwBoards(sfw); + }, + uidColor(uid) { + let msg = 0; + let i = 0; + while (i < 8) { + msg = ((msg << 5) - msg) + uid.charCodeAt(i++); + } + return (msg >> 8) & 0xFFFFFF; + }, + isLinkified(link) { + return ImageHost.test(link.hostname); + }, + testNativeExtension() { + return $$1.global(function () { + if (window.Parser?.postMenuIcon) { + return this.enabled = 'true'; + } + }); + }, + transformBoardList() { + let node; + const nodes = []; + const spacer = () => $$1.el('span', { className: 'spacer' }); + const items = $$1.X('.//a|.//text()[not(ancestor::a)]', $$1(SWYotsuba.selectors.boardList)); + let i = 0; + while ((node = items.snapshotItem(i++))) { + switch (node.nodeName) { + case '#text': + for (var chr of node.nodeValue) { + var span = $$1.el('span', { textContent: chr }); + if (chr === ' ') { + span.className = 'space'; + } + if (chr === ']') { + nodes.push(spacer()); + } + nodes.push(span); + if (chr === '[') { + nodes.push(spacer()); + } + } + break; + case 'A': + var a = node.cloneNode(true); + nodes.push(a); + break; + } + } + return nodes; + }, + Build: { + staticPath: '//s.4cdn.org/image/', + gifIcon: window.devicePixelRatio >= 2 ? '@2x.gif' : '.gif', + spoilerRange: Object.create(null), + shortFilename(filename) { + const ext = filename.match(/\.?[^\.]*$/)[0]; + if ((filename.length - ext.length) > 30) { + return `${filename.match(/(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[^]){0,25}/)[0]}(...)${ext}`; + } + else { + return filename; + } + }, + spoilerThumb(boardID) { + let spoilerRange; + if ((spoilerRange = this.spoilerRange[boardID])) { + // Randomize the spoiler image. + return `${this.staticPath}spoiler-${boardID}${Math.floor(1 + (spoilerRange * Math.random()))}.png`; + } + else { + return `${this.staticPath}spoiler.png`; + } + }, + sameThread(boardID, threadID) { + return (g.VIEW === 'thread') && (g.BOARD.ID === boardID) && (g.THREADID === +threadID); + }, + threadURL(boardID, threadID) { + if (boardID !== g.BOARD.ID) { + return `//${BoardConfig.domain(boardID)}/${boardID}/thread/${threadID}`; + } + else if ((g.VIEW !== 'thread') || (+threadID !== g.THREADID)) { + return `/${boardID}/thread/${threadID}`; + } + else { + return ''; + } + }, + postURL(boardID, threadID, postID) { + return `${this.threadURL(boardID, threadID)}#p${postID}`; + }, + parseJSON(data, { siteID, boardID }) { + const o = { + // id + ID: data.no, + postID: data.no, + threadID: data.resto || data.no, + boardID, + siteID, + isReply: !!data.resto, + // thread status + isSticky: !!data.sticky, + isClosed: !!data.closed, + isArchived: !!data.archived, + // file status + fileDeleted: !!data.filedeleted, + filesDeleted: data.filedeleted ? [0] : [] + }; + o.info = { + subject: $$1.unescape(data.sub), + email: $$1.unescape(data.email), + name: $$1.unescape(data.name) || '', + tripcode: data.trip, + pass: (data.since4pass != null) ? `${data.since4pass}` : undefined, + uniqueID: data.id, + flagCode: data.country, + flagCodeTroll: data.board_flag, + flag: $$1.unescape((data.country_name || data.flag_name)), + dateUTC: data.time, + dateText: data.now, + // Yes, we use the raw string here + commentHTML: { innerHTML: data.com || '', [isEscaped]: true } + }; + if (data.capcode) { + o.info.capcode = data.capcode.replace(/_highlight$/, '').replace(/_/g, ' ').replace(/\b\w/g, c => c.toUpperCase()); + o.capcodeHighlight = /_highlight$/.test(data.capcode); + delete o.info.uniqueID; + } + o.files = []; + if (data.ext) { + o.file = this.parseJSONFile(data, { siteID, boardID }); + o.files.push(o.file); + } + // Temporary JSON properties for events such as April 1 / Halloween + o.extra = dict(); + for (var key in data) { + if (key[0] === 'x') { + o.extra[key] = data[key]; + } + } + return o; + }, + parseJSONFile(data, { siteID, boardID }) { + const site = g.sites[siteID]; + const filename = (site.software === 'yotsuba') && (boardID === 'f') ? + `${encodeURIComponent(data.filename)}${data.ext}` + : + `${data.tim}${data.ext}`; + const o = { + name: ($$1.unescape(data.filename)) + data.ext, + url: site.urls.file({ siteID, boardID }, filename), + height: data.h, + width: data.w, + MD5: data.md5, + size: $$1.bytesToString(data.fsize), + thumbURL: site.urls.thumb({ siteID, boardID }, `${data.tim}s.jpg`), + theight: data.tn_h, + twidth: data.tn_w, + isSpoiler: !!data.spoiler, + tag: data.tag, + hasDownscale: !!data.m_img + }; + if ((data.h != null) && !/\.pdf$/.test(o.url)) { + o.dimensions = `${o.width}x${o.height}`; + } + return o; + }, + parseComment(html) { + html = html + .replace(//gi, '\n') + .replace(/\n\n]*>/g, ''); + return $$1.unescape(html); + }, + parseCommentDisplay(html) { + // Hide spoilers. + if (!Conf['Remove Spoilers'] && !Conf['Reveal Spoilers']) { + let html2; + while ((html2 = html.replace(/(?:(?!<\/?s>).)*<\/s>/g, '[spoiler]')) !== html) { + html = html2; + } + } + html = html + .replace(/^Rolled [^<]*<\/b>/i, '') // Rolls (/tg/, /qst/) + .replace(/>") : ''), + h("div", { id: `p${ID}`, class: `post ${postClass}${o.capcodeHighlight ? ' highlightPost' : ''}` }, + (o.isReply ? h(hFragment, null, + postInfo, + fileBlock) : h(hFragment, null, + fileBlock, + postInfo)), + h("blockquote", { class: "postMessage", id: `m${ID}` }, commentHTML))); + const container = $$1.el('div', { + className: `postContainer ${postClass}Container`, + id: `pc${ID}` + }); + $$1.extend(container, wholePost); + // Fix quotelinks + for (var quote of $$('.quotelink', container)) { + var href = quote.getAttribute('href'); + if (href[0] === '#') { + if (!this.sameThread(boardID, threadID)) { + quote.href = this.threadURL(boardID, threadID) + href; + } + } + else { + var match; + if ((match = quote.href.match(SWYotsuba.regexp.quotelink)) && (this.sameThread(match[1], match[2]))) { + quote.href = href.match(/(#[^#]*)?$/)[0] || '#'; + } + } + } + return container; + }, + summaryText(status, posts, files) { + let text = ''; + if (status) { + text += `${status} `; + } + text += `${posts} post${posts > 1 ? 's' : ''}`; + if (+files) { + text += ` and ${files} image repl${files > 1 ? 'ies' : 'y'}`; + } + return text += ` ${status === '-' ? 'shown' : 'omitted'}.`; + }, + summary(boardID, threadID, posts, files) { + return $$1.el('a', { + className: 'summary', + textContent: this.summaryText('', posts, files), + href: `/${boardID}/thread/${threadID}` + }); + }, + thread(thread, data, withReplies) { + let root; + if (root = thread.nodes.root) { + $$1.rmAll(root); + } + else { + thread.nodes.root = (root = $$1.el('div', { + className: 'thread', + id: `t${data.no}` + })); + } + if (this.hat) { + $$1.add(root, this.hat.cloneNode(false)); + } + $$1.add(root, thread.OP.nodes.root); + if (data.omitted_posts || (!withReplies && data.replies)) { + const [posts, files] = Array.from(withReplies ? + // XXX data.omitted_images is not accurate. + [data.omitted_posts, data.images - data.last_replies.filter(data => !!data.ext).length] + : + [data.replies, data.images]); + const summary = this.summary(thread.board.ID, data.no, posts, files); + $$1.add(root, summary); + } + return root; + }, + catalogThread(thread, data, pageCount) { + let cssText, imgClass, src; + const { staticPath, gifIcon } = this; + const { tn_w, tn_h } = data; + if (data.spoiler && !Conf['Reveal Spoiler Thumbnails']) { + let spoilerRange; + src = `${staticPath}spoiler`; + if (spoilerRange = this.spoilerRange[thread.board]) { + // Randomize the spoiler image. + src += (`-${thread.board}`) + Math.floor(1 + (spoilerRange * Math.random())); + } + src += '.png'; + imgClass = 'spoiler-file'; + cssText = "--tn-w: 100; --tn-h: 100;"; + } + else if (data.filedeleted) { + src = `${staticPath}filedeleted-res${gifIcon}`; + imgClass = 'deleted-file'; + } + else if (thread.OP.file) { + src = thread.OP.file.thumbURL; + const ratio = 250 / Math.max(tn_w, tn_h); + cssText = `--tn-w: ${tn_w * ratio}; --tn-h: ${tn_h * ratio};`; + } + else { + src = `${staticPath}nofile.png`; + imgClass = 'no-file'; + } + const postCount = data.replies + 1; + const fileCount = data.images + !!data.ext; + const container = $$1.el('div', generateCatalogThreadHtml(thread, src, imgClass, data, postCount, fileCount, pageCount, staticPath, gifIcon)); + $$1.before(thread.OP.nodes.info, [...Array.from(container.childNodes)]); + for (var br of $$('br', thread.OP.nodes.comment)) { + if (br.previousSibling && (br.previousSibling.nodeName === 'BR')) { + $$1.addClass(br, 'extra-linebreak'); + } + } + const root = $$1.el('div', { + className: 'thread catalog-thread', + id: `t${thread}` + }); + if (thread.OP.highlights) { + $$1.addClass(root, ...Array.from(thread.OP.highlights)); + } + if (!thread.OP.file) { + $$1.addClass(root, 'noFile'); + } + root.style.cssText = cssText || ''; + return root; + }, + catalogReply(thread, data) { + let excerpt = ''; + if (data.com) { + excerpt = this.parseCommentDisplay(data.com).replace(/>>\d+/g, '').trim().replace(/\n+/g, ' // '); + } + if (data.ext) { + if (!excerpt) { + excerpt = `${$$1.unescape(data.filename)}${data.ext}`; + } + } + if (data.com) { + if (!excerpt) { + excerpt = $$1.unescape(data.com.replace(//gi, ' // ')); + } + } + if (!excerpt) { + excerpt = '\xA0'; + } + if (excerpt.length > 73) { + excerpt = `${excerpt.slice(0, 70)}...`; + } + const link = this.postURL(thread.board.ID, thread.ID, data.no); + return $$1.el('div', { className: 'catalog-reply' }, h(hFragment, null, + h("span", null, + h("time", { "data-utc": data.time * 1000, "data-abbrev": "1" }, "..."), + ": "), + h("a", { class: "catalog-reply-excerpt", href: link }, excerpt), + h("a", { class: "catalog-reply-preview", href: link }, "..."))); + } + } + }; + + const SW = { tinyboard: SWTinyboard, yotsuba: SWYotsuba }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var FileInfo = { + init() { + if (!['index', 'thread', 'archive'].includes(g.VIEW) || !Conf['File Info Formatting']) { + return; + } + return Callbacks.Post.push({ + name: 'File Info Formatting', + cb: this.node + }); + }, + node() { + if (!this.file) { + return; + } + if (this.isClone) { + let a; + for (a of $$('.file-info .download-button', this.file.text)) { + $$1.on(a, 'click', ImageCommon.download); + } + for (a of $$('.file-info .quick-filter-md5', this.file.text)) { + $$1.on(a, 'click', Filter.quickFilterMD5); + } + return; + } + const oldInfo = $$1.el('span', { className: 'fileText-original' }); + $$1.prepend(this.file.link.parentNode, oldInfo); + $$1.add(oldInfo, [this.file.link.previousSibling, this.file.link, this.file.link.nextSibling]); + const info = $$1.el('span', { className: 'file-info' }); + FileInfo.format(Conf['fileInfo'], this, info); + return $$1.prepend(this.file.text, info); + }, + format(formatString, post, outputNode) { + let a; + const output = []; + formatString.replace(/%(.)|[^%]+/g, function (s, c) { + output.push($$1.hasOwn(FileInfo.formatters, c) ? + FileInfo.formatters[c].call(post) + : + { innerHTML: E(s) }); + return ''; + }); + $$1.extend(outputNode, { innerHTML: E.cat(output) }); + for (a of $$('.download-button', outputNode)) { + $$1.on(a, 'click', ImageCommon.download); + } + for (a of $$('.quick-filter-md5', outputNode)) { + $$1.on(a, 'click', Filter.quickFilterMD5); + } + }, + formatters: { + t() { return { innerHTML: E(this.file.url.match(/[^/]*$/)[0]), [isEscaped]: true }; }, + T() { return h("a", { href: this.file.url, target: "_blank" }, FileInfo.formatters.t.call(this)); }, + l() { return h("a", { href: this.file.url, target: "_blank" }, FileInfo.formatters.n.call(this)); }, + L() { return h("a", { href: this.file.url, target: "_blank" }, FileInfo.formatters.N.call(this)); }, + n() { + const fullname = this.file.name; + const shortname = SW.yotsuba.Build.shortFilename(this.file.name, this.isReply); + if (fullname === shortname) { + return { innerHTML: E(fullname), [isEscaped]: true }; + } + else { + return h("span", { class: "fnswitch" }, + h("span", { class: "fntrunc" }, shortname), + h("span", { class: "fnfull" }, fullname)); + } + }, + N() { return { innerHTML: E(this.file.name), [isEscaped]: true }; }, + d() { return h("a", { href: this.file.url, download: this.file.name, class: "download-button" }, "\uD83D\uDCE5\uFE0E"); }, + f() { + return { innerHTML: "", [isEscaped]: true }; + }, + p() { return { innerHTML: ((this.file.isSpoiler) ? "Spoiler, " : ""), [isEscaped]: true }; }, + s() { return { innerHTML: E(this.file.size), [isEscaped]: true }; }, + B() { return { innerHTML: Math.round(this.file.sizeInBytes) + " Bytes", [isEscaped]: true }; }, + K() { return { innerHTML: (Math.round(this.file.sizeInBytes / 1024)) + " KB", [isEscaped]: true }; }, + M() { return { innerHTML: (Math.round(this.file.sizeInBytes / 1048576 * 100) / 100) + " MB", [isEscaped]: true }; }, + r() { return { innerHTML: E(this.file.dimensions || "PDF"), [isEscaped]: true }; }, + g() { return { innerHTML: ((this.file.tag) ? ", " + E(this.file.tag) : ""), [isEscaped]: true }; }, + '%'() { return { innerHTML: "%", [isEscaped]: true }; } + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var Time = { + init() { + if (!['index', 'thread', 'archive'].includes(g.VIEW) || !Conf['Time Formatting']) { return; } + + return Callbacks.Post.push({ + name: 'Time Formatting', + cb: this.node + }); + }, + + node() { + if (!this.info.date || this.isClone) { return; } + const {textContent} = this.nodes.date; + return this.nodes.date.textContent = textContent.match(/^\s*/)[0] + Time.format(Conf['time'], this.info.date) + textContent.match(/\s*$/)[0]; + }, + + format(formatString, date) { + return formatString.replace(/%(.)/g, function(s, c) { + if ($$1.hasOwn(Time.formatters, c)) { + return Time.formatters[c].call(date); + } else { + return s; + } + }); + }, + + day: [ + 'Sunday', + 'Monday', + 'Tuesday', + 'Wednesday', + 'Thursday', + 'Friday', + 'Saturday' + ], + + month: [ + 'January', + 'February', + 'March', + 'April', + 'May', + 'June', + 'July', + 'August', + 'September', + 'October', + 'November', + 'December' + ], + + localeFormat(date, options, defaultValue) { + if (Conf['timeLocale']) { + try { + return Intl.DateTimeFormat(Conf['timeLocale'], options).format(date); + } catch (error) {} + } + return defaultValue; + }, + + localeFormatPart(date, options, part, defaultValue) { + if (Conf['timeLocale']) { + try { + const parts = Intl.DateTimeFormat(Conf['timeLocale'], options).formatToParts(date); + return parts.map(function(x) { if (x.type === part) { return x.value; } else { return ''; } }).join(''); + } catch (error) {} + } + return defaultValue; + }, + + zeroPad(n) { if (n < 10) { return `0${n}`; } else { return n; } }, + + formatters: { + a() { return Time.localeFormat(this, {weekday: 'short'}, Time.day[this.getDay()].slice(0, 3)); }, + A() { return Time.localeFormat(this, {weekday: 'long'}, Time.day[this.getDay()]); }, + b() { return Time.localeFormat(this, {month: 'short'}, Time.month[this.getMonth()].slice(0, 3)); }, + B() { return Time.localeFormat(this, {month: 'long'}, Time.month[this.getMonth()]); }, + d() { return Time.zeroPad(this.getDate()); }, + e() { return this.getDate(); }, + H() { return Time.zeroPad(this.getHours()); }, + I() { return Time.zeroPad((this.getHours() % 12) || 12); }, + k() { return this.getHours(); }, + l() { return (this.getHours() % 12) || 12; }, + m() { return Time.zeroPad(this.getMonth() + 1); }, + M() { return Time.zeroPad(this.getMinutes()); }, + p() { return Time.localeFormatPart(this, {hour: 'numeric', hour12: true}, 'dayperiod', (this.getHours() < 12 ? 'AM' : 'PM')); }, + P() { return Time.formatters.p.call(this).toLowerCase(); }, + S() { return Time.zeroPad(this.getSeconds()); }, + y() { return this.getFullYear().toString().slice(2); }, + Y() { return this.getFullYear(); }, + '%'() { return '%'; } + } + }; + + var Beep = 'UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA'; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS104: Avoid inline assignments + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var ReplyPruning = { + init() { + if ((g.VIEW !== 'thread') || !Conf['Reply Pruning']) { return; } + + this.container = $$1.frag(); + + this.summary = $$1.el('span', { + hidden: true, + className: 'summary' + } + ); + this.summary.style.cursor = 'pointer'; + $$1.on(this.summary, 'click', () => { + this.inputs.enabled.checked = !this.inputs.enabled.checked; + return $$1.event('change', null, this.inputs.enabled); + }); + + const label = UI.checkbox('Prune Replies', 'Show Last', Conf['Prune All Threads']); + const el = $$1.el('span', + {title: 'Maximum number of replies to show.'} + , + {innerHTML: " "}); + $$1.prepend(el, label); + + this.inputs = { + enabled: label.firstElementChild, + replies: el.lastElementChild + }; + + this.setEnabled.call(this.inputs.enabled); + $$1.on(this.inputs.enabled, 'change', this.setEnabled); + $$1.on(this.inputs.replies, 'change', $$1.cb.value); + + Header$1.menu.addEntry({ + el, + order: 190 + }); + + return Callbacks.Thread.push({ + name: 'Reply Pruning', + cb: this.node + }); + }, + + position: 0, + hidden: 0, + hiddenFiles: 0, + total: 0, + totalFiles: 0, + + setEnabled() { + const other = QuoteThreading.input; + if (this.checked && other?.checked) { + other.checked = false; + $$1.event('change', null, other); + } + return ReplyPruning.active = this.checked; + }, + + showIfHidden(id) { + if (ReplyPruning.container && $$1(`#${id}`, ReplyPruning.container)) { + ReplyPruning.inputs.enabled.checked = false; + return $$1.event('change', null, ReplyPruning.inputs.enabled); + } + }, + + node() { + let middle; + ReplyPruning.thread = this; + + if (this.isSticky) { + ReplyPruning.active = (ReplyPruning.inputs.enabled.checked = true); + if (QuoteThreading.input) { + // Disable Quote Threading for this thread but don't save the setting. + Conf['Thread Quotes'] = (QuoteThreading.input.checked = false); + } + } + + this.posts.forEach(function(post) { + if (post.isReply) { + ReplyPruning.total++; + if (post.file) { return ReplyPruning.totalFiles++; } + } + }); + + // If we're linked to a post that we would hide, don't hide the posts in the first place. + if ( + ReplyPruning.active && + /^#p\d+$/.test(location.hash) && + (1 <= (middle = this.posts.keys.indexOf(location.hash.slice(2))) && middle < 1 + Math.max(ReplyPruning.total - +Conf["Max Replies"], 0)) + ) { + ReplyPruning.active = (ReplyPruning.inputs.enabled.checked = false); + } + + $$1.after(this.OP.nodes.root, ReplyPruning.summary); + + $$1.on(ReplyPruning.inputs.enabled, 'change', ReplyPruning.update); + $$1.on(ReplyPruning.inputs.replies, 'change', ReplyPruning.update); + $$1.on(d$1, 'ThreadUpdate', ReplyPruning.updateCount); + $$1.on(d$1, 'ThreadUpdate', ReplyPruning.update); + + return ReplyPruning.update(); + }, + + updateCount(e) { + if (e.detail[404]) { return; } + for (var fullID of e.detail.newPosts) { + ReplyPruning.total++; + if (g.posts.get(fullID).file) { ReplyPruning.totalFiles++; } + } + }, + + update() { + let boardTop, node, post; + const hidden1 = ReplyPruning.hidden; + const hidden2 = ReplyPruning.active ? + Math.max(ReplyPruning.total - +Conf["Max Replies"], 0) + : + 0; + + // Record position from bottom of document + const oldPos = d$1.body.clientHeight - window.scrollY; + + const {posts} = ReplyPruning.thread; + + if (ReplyPruning.hidden < hidden2) { + while ((ReplyPruning.hidden < hidden2) && (ReplyPruning.position < posts.keys.length)) { + post = posts.get(posts.keys[ReplyPruning.position++]); + if (post.isReply && !post.isFetchedQuote) { + while ((node = ReplyPruning.summary.nextSibling) && (node !== post.nodes.root)) { $$1.add(ReplyPruning.container, node); } + $$1.add(ReplyPruning.container, post.nodes.root); + ReplyPruning.hidden++; + if (post.file) { ReplyPruning.hiddenFiles++; } + } + } + + } else if (ReplyPruning.hidden > hidden2) { + const frag = $$1.frag(); + while ((ReplyPruning.hidden > hidden2) && (ReplyPruning.position > 0)) { + post = posts.get(posts.keys[--ReplyPruning.position]); + if (post.isReply && !post.isFetchedQuote) { + while ((node = ReplyPruning.container.lastChild) && (node !== post.nodes.root)) { $$1.prepend(frag, node); } + $$1.prepend(frag, post.nodes.root); + ReplyPruning.hidden--; + if (post.file) { ReplyPruning.hiddenFiles--; } + } + } + $$1.after(ReplyPruning.summary, frag); + $$1.event('PostsInserted', null, ReplyPruning.summary.parentNode); + } + + ReplyPruning.summary.textContent = ReplyPruning.active ? + g.SITE.Build.summaryText('+', ReplyPruning.hidden, ReplyPruning.hiddenFiles) + : + g.SITE.Build.summaryText('-', ReplyPruning.total, ReplyPruning.totalFiles); + ReplyPruning.summary.hidden = (ReplyPruning.total <= +Conf["Max Replies"]); + + // Maintain position in thread when posts are added/removed above + if ((hidden1 !== hidden2) && ((boardTop = Header$1.getTopOf($$1('.board'))) < 0)) { + return window.scrollBy(0, Math.max(d$1.body.clientHeight - oldPos, window.scrollY + boardTop) - window.scrollY); + } + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + /* + <3 aeosynth + */ + + var QuoteThreading = { + init() { + if (!Conf['Quote Threading'] || (g.VIEW !== 'thread')) { return; } + + this.controls = $$1.el('label', + {innerHTML: " Threading"}); + + this.threadNewLink = $$1.el('span', { + className: 'brackets-wrap threadnewlink', + hidden: true + } + ); + $$1.extend(this.threadNewLink, {innerHTML: "Thread New Posts"}); + + this.input = $$1('input', this.controls); + this.input.checked = Conf['Thread Quotes']; + + $$1.on(this.input, 'change', this.setEnabled); + $$1.on(this.input, 'change', this.rethread); + $$1.on(this.threadNewLink.firstElementChild, 'click', this.rethread); + $$1.on(d$1, '4chanXInitFinished', () => { return this.ready = true; }); + + Header$1.menu.addEntry(this.entry = { + el: this.controls, + order: 99 + } + ); + + Callbacks.Thread.push({ + name: 'Quote Threading', + cb: this.setThread + }); + + return Callbacks.Post.push({ + name: 'Quote Threading', + cb: this.node + }); + }, + + parent: dict(), + children: dict(), + inserted: dict(), + + toggleThreading() { + return this.setThreadingState(!Conf['Thread Quotes']); + }, + + setThreadingState(enabled) { + this.input.checked = enabled; + this.setEnabled.call(this.input); + return this.rethread.call(this.input); + }, + + setEnabled() { + if (this.checked) { + $$1.set('Prune All Threads', false); + const other = ReplyPruning.inputs?.enabled; + if (other?.checked) { + other.checked = false; + $$1.event('change', null, other); + } + } + return $$1.cb.checked.call(this); + }, + + setThread() { + QuoteThreading.thread = this; + return $$1.asap((() => !Conf['Thread Updater'] || $$1('.navLinksBot > .updatelink')), function() { + let navLinksBot; + if (navLinksBot = $$1('.navLinksBot')) { return $$1.add(navLinksBot, [$$1.tn(' '), QuoteThreading.threadNewLink]); } + }); + }, + + node() { + let parent; + if (this.isFetchedQuote || this.isClone || !this.isReply) { return; } + + const parents = new Set(); + let lastParent = null; + for (var quote of this.quotes) { + if ((parent = g.posts.get(quote))) { + if (!parent.isFetchedQuote && parent.isReply && (parent.ID < this.ID)) { + parents.add(parent.ID); + if (!lastParent || (parent.ID > lastParent.ID)) { lastParent = parent; } + } + } + } + + if (!lastParent) { return; } + + let ancestor = lastParent; + while ((ancestor = QuoteThreading.parent[ancestor.fullID])) { + parents.delete(ancestor.ID); + } + + if (parents.size === 1) { + return QuoteThreading.parent[this.fullID] = lastParent; + } + }, + + descendants(post) { + let children; + let posts = [post]; + if (children = QuoteThreading.children[post.fullID]) { + for (var child of children) { + posts = posts.concat(QuoteThreading.descendants(child)); + } + } + return posts; + }, + + insert(post) { + let parent, x; + if (!( + Conf['Thread Quotes'] && + (parent = QuoteThreading.parent[post.fullID]) && + !QuoteThreading.inserted[post.fullID] + )) { return false; } + + const descendants = QuoteThreading.descendants(post); + if (!Unread.posts.has(parent.ID)) { + if ((function() { for (var x of descendants) { if (Unread.posts.has(x.ID)) { return true; } } })()) { + QuoteThreading.threadNewLink.hidden = false; + return false; + } + } + + const {order} = Unread; + const children = (QuoteThreading.children[parent.fullID] || (QuoteThreading.children[parent.fullID] = [])); + const threadContainer = parent.nodes.threadContainer || $$1.el('div', {className: 'threadContainer'}); + const nodes = [post.nodes.root]; + if (post.nodes.threadContainer) { nodes.push(post.nodes.threadContainer); } + + let i = children.length; + for (let j = children.length - 1; j >= 0; j--) { var child = children[j]; if (child.ID >= post.ID) { i--; } } + if (i !== children.length) { + const next = children[i]; + for (x of descendants) { order.before(order[next.ID], order[x.ID]); } + children.splice(i, 0, post); + $$1.before(next.nodes.root, nodes); + } else { + let prev2; + let prev = parent; + while ((prev2 = QuoteThreading.children[prev.fullID]) && prev2.length) { + prev = prev2[prev2.length-1]; + } + for (let k = descendants.length - 1; k >= 0; k--) { x = descendants[k]; order.after(order[prev.ID], order[x.ID]); } + children.push(post); + $$1.add(threadContainer, nodes); + } + + QuoteThreading.inserted[post.fullID] = true; + + if (!parent.nodes.threadContainer) { + parent.nodes.threadContainer = threadContainer; + $$1.addClass(parent.nodes.root, 'threadOP'); + $$1.after(parent.nodes.root, threadContainer); + } + + return true; + }, + + rethread() { + if (!QuoteThreading.ready) { return; } + const {thread} = QuoteThreading; + const {posts} = thread; + + QuoteThreading.threadNewLink.hidden = true; + + if (Conf['Thread Quotes']) { + posts.forEach(QuoteThreading.insert); + } else { + const nodes = []; + Unread.order = new RandomAccessList(); + QuoteThreading.inserted = dict(); + posts.forEach(function(post) { + if (post.isFetchedQuote) { return; } + Unread.order.push(post); + if (post.isReply) { nodes.push(post.nodes.root); } + if (QuoteThreading.children[post.fullID]) { + delete QuoteThreading.children[post.fullID]; + $$1.rmClass(post.nodes.root, 'threadOP'); + $$1.rm(post.nodes.threadContainer); + return delete post.nodes.threadContainer; + } + }); + $$1.add(thread.nodes.root, nodes); + } + + Unread.position = Unread.order.first; + Unread.updatePosition(); + Unread.setLine(true); + Unread.read(); + return Unread.update(); + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS201: Simplify complex destructure assignments + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + + var ThreadUpdater = { + init() { + let el, name, sc; + if ((g.VIEW !== 'thread') || !Conf['Thread Updater']) { return; } + this.enabled = true; + + // Chromium won't play audio created in an inactive tab until the tab has been focused, so set it up now. + // XXX Sometimes the loading stalls in Firefox, esp. when opening in private browsing window followed by normal window. + // Don't let it keep the loading icon on indefinitely. + this.audio = $$1.el('audio'); + if ($$1.engine !== 'gecko') { this.audio.src = this.beep; } + + if (Conf['Updater and Stats in Header']) { + this.dialog = (sc = $$1.el('span', + {id: 'updater'})); + $$1.extend(sc, {innerHTML: ''}); + Header$1.addShortcut('updater', sc, 100); + } else { + this.dialog = (sc = UI.dialog('updater', + {innerHTML: '
            '})); + $$1.addClass(doc$1, 'float'); + $$1.ready(() => $$1.add(d$1.body, sc)); + } + + this.checkPostCount = 0; + + this.timer = $$1('#update-timer', sc); + this.status = $$1('#update-status', sc); + + $$1.on(this.timer, 'click', this.update); + $$1.on(this.status, 'click', this.update); + + const updateLink = $$1.el('span', + {className: 'brackets-wrap updatelink'}); + $$1.extend(updateLink, {innerHTML: 'Update'}); + Main$1.ready(function() { + let navLinksBot; + if (navLinksBot = $$1('.navLinksBot')) { return $$1.add(navLinksBot, [$$1.tn(' '), updateLink]); } + }); + $$1.on(updateLink.firstElementChild, 'click', this.update); + + const subEntries = []; + for (name in Config.updater.checkbox) { + var conf = Config.updater.checkbox[name]; + el = UI.checkbox(name, name); + el.title = conf[1]; + var input = el.firstElementChild; + $$1.on(input, 'change', $$1.cb.checked); + if (input.name === 'Scroll BG') { + $$1.on(input, 'change', this.cb.scrollBG); + this.cb.scrollBG(); + } else if (input.name === 'Auto Update') { + $$1.on(input, 'change', this.setInterval); + } + subEntries.push({el}); + } + + this.settings = $$1.el('span', + {innerHTML: 'Interval'}); + + $$1.on(this.settings, 'click', this.intervalShortcut); + + subEntries.push({el: this.settings}); + + Header$1.menu.addEntry(this.entry = { + el: $$1.el('span', + {textContent: 'Updater'}), + order: 110, + subEntries + } + ); + + return Callbacks.Thread.push({ + name: 'Thread Updater', + cb: this.node + }); + }, + + node() { + ThreadUpdater.thread = this; + ThreadUpdater.root = this.nodes.root; + ThreadUpdater.outdateCount = 0; + + // We must keep track of our own list of live posts/files + // to provide an accurate deletedPosts/deletedFiles on update + // as posts may be `kill`ed elsewhere. + ThreadUpdater.postIDs = []; + ThreadUpdater.fileIDs = []; + this.posts.forEach(function(post) { + ThreadUpdater.postIDs.push(post.ID); + if (post.file) { return ThreadUpdater.fileIDs.push(post.ID); } + }); + + ThreadUpdater.cb.interval.call($$1.el('input', {value: Conf['Interval']})); + + $$1.on(d$1, 'QRPostSuccessful', ThreadUpdater.cb.checkpost); + $$1.on(d$1, 'visibilitychange', ThreadUpdater.cb.visibility); + + return ThreadUpdater.setInterval(); + }, + + /* + http://freesound.org/people/pierrecartoons1979/sounds/90112/ + cc-by-nc-3.0 + */ + beep: `data:audio/wav;base64,${Beep}`, + + playBeep() { + const {audio} = ThreadUpdater; + if (!audio.src) { audio.src = ThreadUpdater.beep; } + if (audio.paused) { + return audio.play(); + } else { + return $$1.one(audio, 'ended', ThreadUpdater.playBeep); + } + }, + + cb: { + checkpost(e) { + if (e.detail.threadID !== ThreadUpdater.thread.ID) { return; } + ThreadUpdater.postID = e.detail.postID; + ThreadUpdater.checkPostCount = 0; + ThreadUpdater.outdateCount = 0; + return ThreadUpdater.setInterval(); + }, + + visibility() { + if (d$1.hidden) { return; } + // Reset the counter when we focus this tab. + ThreadUpdater.outdateCount = 0; + if (ThreadUpdater.seconds > ThreadUpdater.interval) { + return ThreadUpdater.setInterval(); + } + }, + + scrollBG() { + return ThreadUpdater.scrollBG = Conf['Scroll BG'] ? + () => true + : + () => !d$1.hidden; + }, + + interval(e) { + let val = parseInt(this.value, 10); + if (val < 1) { val = 1; } + ThreadUpdater.interval = (this.value = val); + if (e) { return $$1.cb.value.call(this); } + }, + + load() { + if (this !== ThreadUpdater.req) { return; } // aborted + switch (this.status) { + case 200: + ThreadUpdater.parse(this); + if (ThreadUpdater.thread.isArchived) { + return ThreadUpdater.kill(); + } else { + return ThreadUpdater.setInterval(); + } + case 404: + // XXX workaround for 4chan sending false 404s + return $$1.ajax(g.SITE.urls.catalogJSON({boardID: ThreadUpdater.thread.board.ID}), { onloadend() { + let confirmed; + if (this.status === 200) { + confirmed = true; + for (var page of this.response) { + for (var thread of page.threads) { + if (thread.no === ThreadUpdater.thread.ID) { + confirmed = false; + break; + } + } + } + } else { + confirmed = false; + } + if (confirmed) { + return ThreadUpdater.kill(); + } else { + return ThreadUpdater.error(this); + } + } + } + ); + default: + return ThreadUpdater.error(this); + } + } + }, + + kill() { + ThreadUpdater.thread.kill(); + ThreadUpdater.setInterval(); + return $$1.event('ThreadUpdate', { + 404: true, + threadID: ThreadUpdater.thread.fullID + } + ); + }, + + error(req) { + if (req.status === 304) { + ThreadUpdater.set('status', ''); + } + ThreadUpdater.setInterval(); + if (!req.status) { + return ThreadUpdater.set('status', 'Connection Error', 'warning'); + } else if (req.status !== 304) { + return ThreadUpdater.set('status', `${req.statusText} (${req.status})`, 'warning'); + } + }, + + setInterval() { + clearTimeout(ThreadUpdater.timeoutID); + + if (ThreadUpdater.thread.isDead) { + ThreadUpdater.set('status', (ThreadUpdater.thread.isArchived ? 'Archived' : '404'), 'warning'); + ThreadUpdater.set('timer', ''); + return; + } + + // Fetching your own posts after posting + if (ThreadUpdater.postID && (ThreadUpdater.checkPostCount < 5)) { + ThreadUpdater.set('timer', '...', 'loading'); + ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.update, ++ThreadUpdater.checkPostCount * SECOND); + return; + } + + if (!Conf['Auto Update']) { + ThreadUpdater.set('timer', 'Update'); + return; + } + + const {interval} = ThreadUpdater; + if (Conf['Optional Increase']) { + // Lower the max refresh rate limit on visible tabs. + const limit = d$1.hidden ? 10 : 5; + const j = Math.min(ThreadUpdater.outdateCount, limit); + + // 1 second to 100, 30 to 300. + const cur = (Math.floor(interval * 0.1) || 1) * j * j; + ThreadUpdater.seconds = $$1.minmax(cur, interval, 300); + } else { + ThreadUpdater.seconds = interval; + } + + return ThreadUpdater.timeout(); + }, + + intervalShortcut() { + Settings.open('Advanced'); + const settings = $$1.id('fourchanx-settings'); + return $$1('input[name=Interval]', settings).focus(); + }, + + set(name, text, klass) { + let node; + const el = ThreadUpdater[name]; + if ((node = el.firstChild)) { + // Prevent the creation of a new DOM Node + // by setting the text node's data. + node.data = text; + } else { + el.textContent = text; + } + return el.className = klass ?? (text === '' ? 'empty' : ''); + }, + + timeout() { + if (ThreadUpdater.seconds) { + ThreadUpdater.set('timer', ThreadUpdater.seconds); + ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); + } else { + ThreadUpdater.outdateCount++; + ThreadUpdater.update(); + } + return ThreadUpdater.seconds--; + }, + + update() { + let oldReq; + clearTimeout(ThreadUpdater.timeoutID); + ThreadUpdater.set('timer', '...', 'loading'); + if (oldReq = ThreadUpdater.req) { + delete ThreadUpdater.req; + oldReq.abort(); + } + return ThreadUpdater.req = $$1.whenModified( + g.SITE.urls.threadJSON({boardID: ThreadUpdater.thread.board.ID, threadID: ThreadUpdater.thread.ID}), + 'ThreadUpdater', + ThreadUpdater.cb.load, + { timeout: MINUTE } + ); + }, + + updateThreadStatus(type, status) { + if (!(ThreadUpdater.thread[`is${type}`] !== status)) { return; } + ThreadUpdater.thread.setStatus(type, status); + if ((type === 'Closed') && ThreadUpdater.thread.isArchived) { return; } + const change = type === 'Sticky' ? + status ? + 'now a sticky' + : + 'not a sticky anymore' + : + status ? + 'now closed' + : + 'not closed anymore'; + return new Notice('info', `The thread is ${change}.`, 30); + }, + + parse(req) { + let ID, ipCountEl, post; + const postObjects = req.response.posts; + const OP = postObjects[0]; + const {thread} = ThreadUpdater; + const {board} = thread; + const lastPost = ThreadUpdater.postIDs[ThreadUpdater.postIDs.length - 1]; + + // XXX Reject updates that falsely delete the last post. + if ((postObjects[postObjects.length-1].no < lastPost) && + ((new Date(req.getResponseHeader('Last-Modified')) - thread.posts.get(lastPost).info.date) < (30 * SECOND))) { return; } + + g.SITE.Build.spoilerRange[board] = OP.custom_spoiler; + thread.setStatus('Archived', !!OP.archived); + ThreadUpdater.updateThreadStatus('Sticky', !!OP.sticky); + ThreadUpdater.updateThreadStatus('Closed', !!OP.closed); + thread.postLimit = !!OP.bumplimit; + thread.fileLimit = !!OP.imagelimit; + if (OP.unique_ips != null) { thread.ipCount = OP.unique_ips; } + + const posts = []; // new post objects + const index = []; // existing posts + const files = []; // existing files + const newPosts = []; // new post fullID list for API + + // Build the index, create posts. + for (var postObject of postObjects) { + ID = postObject.no; + index.push(ID); + if (postObject.fsize) { files.push(ID); } + + // Insert new posts, not older ones. + if (ID <= lastPost) { continue; } + + // XXX Resurrect wrongly deleted posts. + if ((post = thread.posts.get(ID)) && !post.isFetchedQuote) { + post.resurrect(); + continue; + } + + newPosts.push(`${board}.${ID}`); + var node = g.SITE.Build.postFromObject(postObject, board.ID); + posts.push(new Post(node, thread, board)); + // Fetching your own posts after posting + if (ThreadUpdater.postID === ID) { delete ThreadUpdater.postID; } + } + + // Check for deleted posts. + const deletedPosts = []; + for (ID of ThreadUpdater.postIDs) { + if (!index.includes(ID)) { + thread.posts.get(ID).kill(); + deletedPosts.push(`${board}.${ID}`); + } + } + ThreadUpdater.postIDs = index; + + // Check for deleted files. + const deletedFiles = []; + for (ID of ThreadUpdater.fileIDs) { + if (!(files.includes(ID) || deletedPosts.includes(`${board}.${ID}`))) { + thread.posts.get(ID).kill(true); + deletedFiles.push(`${board}.${ID}`); + } + } + ThreadUpdater.fileIDs = files; + + if (!posts.length) { + ThreadUpdater.set('status', ''); + } else { + ThreadUpdater.set('status', `+${posts.length}`, 'new'); + ThreadUpdater.outdateCount = 0; + + const unreadCount = Unread.posts?.size; + const unreadQYCount = Unread.postsQuotingYou?.size; + + Main$1.callbackNodes('Post', posts); + + if (d$1.hidden || !d$1.hasFocus()) { + if (Conf['Beep Quoting You'] && (Unread.postsQuotingYou?.size > unreadQYCount)) { + ThreadUpdater.playBeep(); + if (Conf['Beep']) { ThreadUpdater.playBeep(); } + } else if (Conf['Beep'] && (Unread.posts?.size > 0) && (unreadCount === 0)) { + ThreadUpdater.playBeep(); + } + } + + const scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && + ((ThreadUpdater.root.getBoundingClientRect().bottom - doc$1.clientHeight) < 25); + + let firstPost = null; + for (post of posts) { + if (!QuoteThreading.insert(post)) { + if (!firstPost) { firstPost = post.nodes.root; } + $$1.add(ThreadUpdater.root, post.nodes.root); + } + } + $$1.event('PostsInserted', null, ThreadUpdater.root); + + if (scroll) { + if (Conf['Bottom Scroll']) { + window.scrollTo(0, d$1.body.clientHeight); + } else { + if (firstPost) { Header$1.scrollTo(firstPost); } + } + } + } + + // Update IP count in original post form. + if ((OP.unique_ips != null) && (ipCountEl = $$1.id('unique-ips'))) { + ipCountEl.textContent = OP.unique_ips; + ipCountEl.previousSibling.textContent = ipCountEl.previousSibling.textContent.replace(/\b(?:is|are)\b/, OP.unique_ips === 1 ? 'is' : 'are'); + ipCountEl.nextSibling.textContent = ipCountEl.nextSibling.textContent.replace(/\bposters?\b/, OP.unique_ips === 1 ? 'poster' : 'posters'); + } + + return $$1.event('ThreadUpdate', { + 404: false, + threadID: thread.fullID, + newPosts, + deletedPosts, + deletedFiles, + postCount: OP.replies + 1, + fileCount: OP.images + !!OP.fsize, + ipCount: OP.unique_ips + } + ); + } + }; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * DS205: Consider reworking code to avoid use of IIFEs + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var Settings = { + dialog: undefined, + init() { + // 4chan X settings link + const link = $$1.el('a', { + className: 'settings-link', + textContent: '🔧︎', + title: `${meta.name} Settings`, + href: 'javascript:;' + }); + $$1.on(link, 'click', Settings.open); + Header$1.addShortcut('settings', link, 820); + const add = this.addSection; + add('Main', this.main); + add('Filter', this.filter); + add('Sauce', this.sauce); + add('Advanced', this.advanced); + add('Keybinds', this.keybinds); + $$1.on(d$1, 'AddSettingsSection', Settings.addSection); + $$1.on(d$1, 'OpenSettings', e => Settings.open(e.detail)); + if ((g.SITE.software === 'yotsuba') && Conf['Disable Native Extension']) { + if ($$1.hasStorage) { + // Run in page context to handle case where 4chan X has localStorage access but not the page. + // (e.g. Pale Moon 26.2.2, GM 3.8, cookies disabled for 4chan only) + return $$1.global(function () { + try { + const settings = JSON.parse(localStorage.getItem('4chan-settings')) || {}; + if (settings.disableAll) { + return; + } + settings.disableAll = true; + return localStorage.setItem('4chan-settings', JSON.stringify(settings)); + } + catch (error) { + return Object.defineProperty(window, 'Config', { value: { disableAll: true } }); + } + }); + } + else { + return $$1.global(() => Object.defineProperty(window, 'Config', { value: { disableAll: true } })); + } + } + }, + open(openSection) { + let dialog, sectionToOpen; + if (Settings.dialog) { + return; + } + $$1.event('CloseMenu'); + Settings.dialog = (dialog = $$1.el('div', { id: 'overlay' }, settingsHtml)); + $$1.on($$1('.export', dialog), 'click', Settings.export); + $$1.on($$1('.import', dialog), 'click', Settings.import); + $$1.on($$1('.reset', dialog), 'click', Settings.reset); + $$1.on($$1('input', dialog), 'change', Settings.onImport); + const links = []; + for (var section of Settings.sections) { + var link = $$1.el('a', { + className: `tab-${section.hyphenatedTitle}`, + textContent: section.title, + href: 'javascript:;' + }); + $$1.on(link, 'click', Settings.openSection.bind(section)); + links.push(link, $$1.tn(' | ')); + if (section.title === openSection) { + sectionToOpen = link; + } + } + links.pop(); + $$1.add($$1('.sections-list', dialog), links); + if (openSection !== 'none') { + (sectionToOpen ? sectionToOpen : links[0]).click(); + } + $$1.on($$1('.close', dialog), 'click', Settings.close); + $$1.on(window, 'beforeunload', Settings.close); + $$1.on(dialog, 'click', Settings.close); + $$1.on(dialog.firstElementChild, 'click', e => e.stopPropagation()); + $$1.add(d$1.body, dialog); + return $$1.event('OpenSettings', null, dialog); + }, + close() { + if (!Settings.dialog) { + return; + } + // Unfocus current field to trigger change event. + d$1.activeElement?.blur(); + $$1.rm(Settings.dialog); + return delete Settings.dialog; + }, + sections: [], + addSection(title, open) { + if (typeof title !== 'string') { + ({ title, open } = title.detail); + } + const hyphenatedTitle = title.toLowerCase().replace(/\s+/g, '-'); + return Settings.sections.push({ title, hyphenatedTitle, open }); + }, + openSection() { + let selected; + if (selected = $$1('.tab-selected', Settings.dialog)) { + $$1.rmClass(selected, 'tab-selected'); + } + $$1.addClass($$1(`.tab-${this.hyphenatedTitle}`, Settings.dialog), 'tab-selected'); + const section = $$1('section', Settings.dialog); + $$1.rmAll(section); + section.className = `section-${this.hyphenatedTitle}`; + this.open(section, g); + section.scrollTop = 0; + return $$1.event('OpenSettings', null, section); + }, + warnings: { + localStorage(cb) { + if ($$1.cantSync) { + const why = $$1.cantSet ? 'save your settings' : 'synchronize settings between tabs'; + return cb($$1.el('li', { + textContent: `\ +${meta.name} needs local storage to ${why}. +Enable it on boards.${location.hostname.split('.')[1]}.org in your browser's privacy settings (may be listed as part of "local data" or "cookies").\ +` + })); + } + }, + ads(cb) { + return $$1.onExists(doc$1, '.adg-rects > .desktop', ad => $$1.onExists(ad, 'iframe', function () { + const url = Redirect$1.to('thread', { boardID: 'qa', threadID: 362590 }); + return cb($$1.el('li', h(hFragment, null, + "To protect yourself from ", + h("a", { href: url, target: "_blank" }, "malicious ads"), + ", you should ", + h("a", { href: "https://github.com/gorhill/uBlock#ublock-origin", target: "_blank" }, "block ads"), + " on 4chan."))); + })); + } + }, + main(section) { + let key; + const warnings = $$1.el('fieldset', { hidden: true }, { innerHTML: 'Warnings
              ' }); + const addWarning = function (item) { + $$1.add($$1('ul', warnings), item); + return warnings.hidden = false; + }; + for (key in Settings.warnings) { + var warning = Settings.warnings[key]; + warning(addWarning); + } + $$1.add(section, warnings); + const items = dict(); + const inputs = dict(); + const addCheckboxes = function (root, obj) { + const containers = [root]; + return (() => { + const result = []; + for (key in obj) { + var arr = obj[key]; + if (arr instanceof Array) { + var description = arr[1]; + var div = $$1.el('div', { innerHTML: `: ${description}` }); + div.dataset.name = key; + var input = $$1('input', div); + $$1.on(input, 'change', $$1.cb.checked); + $$1.on(input, 'change', function () { return this.parentNode.parentNode.dataset.checked = this.checked; }); + items[key] = Conf[key]; + inputs[key] = input; + var level = arr[2] || 0; + if (containers.length <= level) { + var container = $$1.el('div', { className: 'suboption-list' }); + $$1.add(containers[containers.length - 1].lastElementChild, container); + containers[level] = container; + } + else if (containers.length > (level + 1)) { + containers.splice(level + 1, containers.length - (level + 1)); + } + result.push($$1.add(containers[level], div)); + } + } + return result; + })(); + }; + for (var keyFS in Config.main) { + var obj = Config.main[keyFS]; + var fs = $$1.el('fieldset', { innerHTML: `${keyFS}` }); + addCheckboxes(fs, obj); + if (keyFS === 'Posting and Captchas') { + $$1.add(fs, $$1.el('p', { innerHTML: 'For more info on captcha options and issues, see the captcha FAQ.' })); + } + $$1.add(section, fs); + } + addCheckboxes($$1('div[data-name="JSON Index"] > .suboption-list', section), Config.Index); + // Unsupported options + if ($$1.engine !== 'gecko') { + $$1('div[data-name="Remember QR Size"]', section).hidden = true; + } + if ($$1.perProtocolSettings || (location.protocol !== 'https:')) { + $$1('div[data-name="Redirect to HTTPS"]', section).hidden = true; + } + if (platform !== 'crx') { + $$1('div[data-name="Work around CORB Bug"]', section).hidden = true; + } + $$1.get(items, function (items) { + for (key in items) { + var val = items[key]; + inputs[key].checked = val; + inputs[key].parentNode.parentNode.dataset.checked = val; + } + }); + const div = $$1.el('div', { innerHTML: ': Clear manually-hidden threads and posts on all boards. Reload the page to apply.' }); + const button = $$1('button', div); + $$1.get({ hiddenThreads: dict(), hiddenPosts: dict() }, function ({ hiddenThreads, hiddenPosts }) { + let board, ID, site, thread; + let hiddenNum = 0; + for (ID in hiddenThreads) { + site = hiddenThreads[ID]; + if (ID !== 'boards') { + for (ID in site.boards) { + board = site.boards[ID]; + hiddenNum += Object.keys(board).length; + } + } + } + for (ID in hiddenThreads.boards) { + board = hiddenThreads.boards[ID]; + hiddenNum += Object.keys(board).length; + } + for (ID in hiddenPosts) { + site = hiddenPosts[ID]; + if (ID !== 'boards') { + for (ID in site.boards) { + board = site.boards[ID]; + for (ID in board) { + thread = board[ID]; + hiddenNum += Object.keys(thread).length; + } + } + } + } + for (ID in hiddenPosts.boards) { + board = hiddenPosts.boards[ID]; + for (ID in board) { + thread = board[ID]; + hiddenNum += Object.keys(thread).length; + } + } + return button.textContent = `Hidden: ${hiddenNum}`; + }); + $$1.on(button, 'click', function () { + this.textContent = 'Hidden: 0'; + return $$1.get('hiddenThreads', dict(), function ({ hiddenThreads }) { + if ($$1.hasStorage && (g.SITE.software === 'yotsuba')) { + let boardID; + for (boardID in hiddenThreads['4chan.org']?.boards) { + localStorage.removeItem(`4chan-hide-t-${boardID}`); + } + for (boardID in hiddenThreads.boards) { + localStorage.removeItem(`4chan-hide-t-${boardID}`); + } + } + return ($$1.delete(['hiddenThreads', 'hiddenPosts'])); + }); + }); + return $$1.after($$1('input[name="Stubs"]', section).parentNode.parentNode, div); + }, + export() { + // Make sure to export the most recent data, but don't overwrite existing `Conf` object. + const Conf2 = dict(); + $$1.extend(Conf2, Conf); + return $$1.get(Conf2, function (Conf2) { + // Don't export cached JSON data. + delete Conf2['boardConfig']; + return (Settings.downloadExport({ version: g.VERSION, date: Date.now(), Conf: Conf2 })); + }); + }, + downloadExport(data) { + const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' }); + const url = URL.createObjectURL(blob); + const a = $$1.el('a', { + download: `${meta.name} v${g.VERSION}-${data.date}.json`, + href: url + }); + const p = $$1('.imp-exp-result', Settings.dialog); + $$1.rmAll(p); + $$1.add(p, a); + return a.click(); + }, + import() { + return $$1('input[type=file]', this.parentNode).click(); + }, + onImport() { + let file; + if (!(file = this.files[0])) { + return; + } + this.value = null; + const output = $$1('.imp-exp-result'); + if (!confirm('Your current settings will be entirely overwritten, are you sure?')) { + output.textContent = 'Import aborted.'; + return; + } + const reader = new FileReader(); + reader.onload = function (e) { + try { + return Settings.loadSettings(dict.json(e.target.result), function (err) { + if (err) { + return output.textContent = 'Import failed due to an error.'; + } + else if (confirm('Import successful. Reload now?')) { + return window.location.reload(); + } + }); + } + catch (error) { + const err = error; + output.textContent = 'Import failed due to an error.'; + return c.error(err.stack); + } + }; + return reader.readAsText(file); + }, + convertFrom: { + loadletter(data) { + const convertSettings = function (data, map) { + for (var prevKey in map) { + var newKey = map[prevKey]; + if (newKey) { + data.Conf[newKey] = data.Conf[prevKey]; + } + delete data.Conf[prevKey]; + } + return data; + }; + data = convertSettings(data, { + // General confs + 'Disable 4chan\'s extension': 'Disable Native Extension', + 'Comment Auto-Expansion': '', + 'Remove Slug': '', + 'Always HTTPS': 'Redirect to HTTPS', + 'Check for Updates': '', + 'Recursive Filtering': 'Recursive Hiding', + 'Reply Hiding': 'Reply Hiding Buttons', + 'Thread Hiding': 'Thread Hiding Buttons', + 'Show Stubs': 'Stubs', + 'Image Auto-Gif': 'Replace GIF', + 'Expand All WebM': 'Expand videos', + 'Reveal Spoilers': 'Reveal Spoiler Thumbnails', + 'Expand From Current': 'Expand from here', + 'Current Page': 'Page Count in Stats', + 'Current Page Position': '', + 'Alternative captcha': 'Use Recaptcha v1', + 'Alt index captcha': 'Use Recaptcha v1 on Index', + 'Auto Submit': 'Post on Captcha Completion', + 'Open Reply in New Tab': 'Open Post in New Tab', + 'Remember QR size': 'Remember QR Size', + 'Remember Subject': '', + 'Quote Inline': 'Quote Inlining', + 'Quote Preview': 'Quote Previewing', + 'Indicate OP quote': 'Mark OP Quotes', + 'Indicate You quote': 'Mark Quotes of You', + 'Indicate Cross-thread Quotes': 'Mark Cross-thread Quotes', + // filter + 'uniqueid': 'uniqueID', + 'mod': 'capcode', + 'email': '', + 'country': 'flag', + 'md5': 'MD5', + // keybinds + 'openEmptyQR': 'Open empty QR', + 'openQR': 'Open QR', + 'openOptions': 'Open settings', + 'close': 'Close', + 'spoiler': 'Spoiler tags', + 'sageru': 'Toggle sage', + 'code': 'Code tags', + 'sjis': 'SJIS tags', + 'submit': 'Submit QR', + 'watch': 'Watch', + 'update': 'Update', + 'unreadCountTo0': '', + 'expandAllImages': 'Expand images', + 'expandImage': 'Expand image', + 'zero': 'Front page', + 'nextPage': 'Next page', + 'previousPage': 'Previous page', + 'nextThread': 'Next thread', + 'previousThread': 'Previous thread', + 'expandThread': 'Expand thread', + 'openThreadTab': 'Open thread', + 'openThread': 'Open thread tab', + 'nextReply': 'Next reply', + 'previousReply': 'Previous reply', + 'hide': 'Hide', + // updater + 'Scrolling': 'Auto Scroll', + 'Verbose': '' + }); + if ('Always CDN' in data.Conf) { + data.Conf['fourchanImageHost'] = data.Conf['Always CDN'] ? 'i.4cdn.org' : ''; + delete data.Conf['Always CDN']; + } + data.Conf.sauces = data.Conf.sauces.replace(/\$\d/g, function (c) { + switch (c) { + case '$1': + return '%TURL'; + case '$2': + return '%URL'; + case '$3': + return '%MD5'; + case '$4': + return '%board'; + default: + return c; + } + }); + for (var key in Config.hotkeys) { + Config.hotkeys[key]; + if (key in data.Conf) { + data.Conf[key] = data.Conf[key].replace(/ctrl|alt|meta/g, s => `${s[0].toUpperCase()}${s.slice(1)}`).replace(/(^|.+\+)[A-Z]$/g, s => `Shift+${s.slice(0, -1)}${s.slice(-1).toLowerCase()}`); + } + } + if (data.WatchedThreads) { + data.Conf['watchedThreads'] = dict.clone({ '4chan.org': { boards: {} } }); + for (var boardID in data.WatchedThreads) { + var threads = data.WatchedThreads[boardID]; + for (var threadID in threads) { + var threadData = threads[threadID]; + (data.Conf['watchedThreads']['4chan.org'].boards[boardID] || (data.Conf['watchedThreads']['4chan.org'].boards[boardID] = dict()))[threadID] = { excerpt: threadData.textContent }; + } + } + } + return data; + } + }, + upgrade(data, version) { + let corrupted, key, val; + const changes = dict(); + const set = (key, value) => data[key] = (changes[key] = value); + const setD = function (key, value) { + if (data[key] == null) { + return set(key, value); + } + }; + const addSauces = function (sauces) { + if (data['sauces'] != null) { + sauces = sauces.filter(s => data['sauces'].indexOf(s.match(/[^#;\s]+|$/)[0]) < 0); + if (sauces.length) { + return set('sauces', data['sauces'] + '\n\n' + sauces.join('\n')); + } + } + }; + const addCSS = function (css) { + if (data['usercss'] == null) { + set('usercss', Config['usercss']); + } + if (data['usercss'].indexOf(css) < 0) { + return set('usercss', css + '\n\n' + data['usercss']); + } + }; + // XXX https://github.com/greasemonkey/greasemonkey/issues/2600 + if (corrupted = (version[0] === '"')) { + try { + version = JSON.parse(version); + } + catch (error) { } + } + const compareString = version.replace(/\d+/g, x => ('0000' + x).slice(-5)); + if (compareString < '00001.00013.00014.00008') { + for (key in data) { + val = data[key]; + if ((typeof val === 'string') && (typeof Conf[key] !== 'string') && !['Index Sort', 'Last Long Reply Thresholds 0', 'Last Long Reply Thresholds 1'].includes(key)) { + corrupted = true; + break; + } + } + } + if (corrupted) { + for (key in data) { + val = data[key]; + if (typeof val === 'string') { + try { + var val2 = JSON.parse(val); + set(key, val2); + } + catch (error1) { } + } + } + } + if (compareString < '00001.00011.00008.00000') { + if (data['Fixed Thread Watcher'] == null) { + set('Fixed Thread Watcher', data['Toggleable Thread Watcher'] ?? true); + } + if (data['Exempt Archives from Encryption'] == null) { + set('Exempt Archives from Encryption', data['Except Archives from Encryption'] ?? false); + } + } + if (compareString < '00001.00011.00010.00001') { + if (data['selectedArchives'] != null) { + const uids = { "Moe": 0, "4plebs Archive": 3, "Nyafuu Archive": 4, "Love is Over": 5, "Rebecca Black Tech": 8, "warosu": 10, "fgts": 15, "not4plebs": 22, "DesuStorage": 23, "fireden.net": 24, "disabled": null }; + for (var boardID in data['selectedArchives']) { + var record = data['selectedArchives'][boardID]; + for (var type in record) { + var name = record[type]; + if ($$1.hasOwn(uids, name)) { + record[type] = uids[name]; + } + } + } + set('selectedArchives', data['selectedArchives']); + } + } + if (compareString < '00001.00011.00016.00000') { + let rice; + if (rice = Config['usercss'].match(/\/\* Board title rice \*\/(?:\n.+)*/)[0]) { + if ((data['usercss'] != null) && (data['usercss'].indexOf(rice) < 0)) { + set('usercss', rice + '\n\n' + data['usercss']); + } + } + } + if (compareString < '00001.00011.00017.00000') { + for (key of ['Persistent QR', 'Color User IDs', 'Fappe Tyme', 'Werk Tyme', 'Highlight Posts Quoting You', 'Highlight Own Posts']) { + if (data[key] == null) { + set(key, (key === 'Persistent QR')); + } + } + } + if (compareString < '00001.00011.00017.00006') { + if (data['sauces'] != null) { + set('sauces', data['sauces'].replace(/^(#?\s*)http:\/\/iqdb\.org\//mg, '$1//iqdb.org/')); + } + } + if ((compareString < '00001.00011.00019.00003') && !Settings.dialog) { + $$1.queueTask(() => Settings.warnings.ads(item => new Notice('warning', [...Array.from(item.childNodes)]))); + } + if (compareString < '00001.00011.00020.00003') { + const object = { 'Inline Cross-thread Quotes Only': false, 'Pass Link': true }; + for (key in object) { + var value = object[key]; + if (data[key] == null) { + set(key, value); + } + } + } + if (compareString < '00001.00011.00021.00003') { + if (data['Remember Your Posts'] == null) { + set('Remember Your Posts', data['Mark Quotes of You'] ?? true); + } + } + if (compareString < '00001.00011.00022.00000') { + if (data['sauces'] != null) { + set('sauces', data['sauces'].replace(/^(#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(?:IMG|URL))%3Fs\.jpg/mg, '$1')); + set('sauces', data['sauces'].replace(/^#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(?:IMG|T?URL)(?=$|;)/mg, '$&&safe=off')); + } + } + if (compareString < '00001.00011.00022.00002') { + if ((data['Use Recaptcha v1 in Reports'] == null) && data['Use Recaptcha v1'] && !data['Use Recaptcha v2 in Reports']) { + set('Use Recaptcha v1 in Reports', true); + } + } + if (compareString < '00001.00011.00024.00000') { + if ((data['JSON Navigation'] != null) && (data['JSON Index'] == null)) { + set('JSON Index', data['JSON Navigation']); + } + } + if (compareString < '00001.00011.00026.00000') { + if ((data['Oekaki Links'] != null) && (data['Edit Link'] == null)) { + set('Edit Link', data['Oekaki Links']); + } + if (data['Inline Cross-thread Quotes Only'] == null) { + set('Inline Cross-thread Quotes Only', true); + } + } + if (compareString < '00001.00011.00030.00000') { + if (data['Quote Threading'] && (data['Thread Quotes'] == null)) { + set('Thread Quotes', true); + } + } + if (compareString < '00001.00011.00032.00000') { + if (data['sauces'] != null) { + set('sauces', data['sauces'].replace(/^(#?\s*)http:\/\/3d\.iqdb\.org\//mg, '$1//3d.iqdb.org/')); + } + addSauces([ + '#https://desustorage.org/_/search/image/%sMD5/', + '#https://boards.fireden.net/_/search/image/%sMD5/', + '#https://foolz.fireden.net/_/search/image/%sMD5/', + '#//www.gif-explode.com/%URL;types:gif' + ]); + } + if (compareString < '00001.00011.00035.00000') { + addSauces(['https://whatanime.ga/?auto&url=%IMG;text:wait']); + } + if (compareString < '00001.00012.00000.00000') { + if (data['Exempt Archives from Encryption'] == null) { + set('Exempt Archives from Encryption', false); + } + if (data['Show New Thread Option in Threads'] == null) { + set('Show New Thread Option in Threads', false); + } + if (data['Show Name and Subject']) { + addCSS('#qr .persona .field {display: block !important;}'); + } + if (data['QR Shortcut'] === false) { + addCSS('#shortcut-qr {display: none;}'); + } + if (data['Bottom QR Link'] === false) { + addCSS('.qr-link-container-bottom {display: none;}'); + } + } + if (compareString < '00001.00012.00000.00006') { + if (data['sauces'] != null) { + set('sauces', data['sauces'].replace(/^(#?\s*)https:\/\/(?:desustorage|cuckchan)\.org\//mg, '$1https://desuarchive.org/')); + } + } + if (compareString < '00001.00012.00001.00000') { + if ((data['Persistent Thread Watcher'] == null) && (data['Toggleable Thread Watcher'] != null)) { + set('Persistent Thread Watcher', !data['Toggleable Thread Watcher']); + } + } + if (compareString < '00001.00012.00003.00000') { + for (key of ['Image Hover in Catalog', 'Auto Watch', 'Auto Watch Reply']) { + setD(key, false); + } + } + if (compareString < '00001.00013.00001.00002') { + addSauces(['#//www.bing.com/images/search?q=imgurl:%IMG&view=detailv2&iss=sbi#enterInsights']); + } + if (compareString < '00001.00013.00005.00000') { + if (data['sauces'] != null) { + set('sauces', data['sauces'].replace(/^(#?\s*)http:\/\/regex\.info\/exif\.cgi/mg, '$1http://exif.regex.info/exif.cgi')); + } + addSauces(Config['sauces'].match(/# Known filename formats:(?:\n.+)*|$/)[0].split('\n')); + } + if (compareString < '00001.00013.00007.00002') { + setD('Require OP Quote Link', true); + } + if (compareString < '00001.00013.00008.00000') { + setD('Download Link', true); + } + if (compareString < '00001.00013.00009.00003') { + if (data['jsWhitelist'] != null) { + const list = data['jsWhitelist'].split('\n'); + if (!list.includes('https://cdnjs.cloudflare.com') && list.includes('https://cdn.mathjax.org')) { + set('jsWhitelist', data['jsWhitelist'] + '\n\nhttps://cdnjs.cloudflare.com'); + } + } + } + if (compareString < '00001.00014.00000.00006') { + if (data['siteSoftware'] != null) { + set('siteSoftware', data['siteSoftware'] + '\n4cdn.org yotsuba'); + } + } + if (compareString < '00001.00014.00003.00002') { + if (data['sauces'] != null) { + set('sauces', data['sauces'].replace(/^(#?\s*)https:\/\/whatanime\.ga\//mg, '$1https://trace.moe/')); + } + } + if (compareString < '00001.00014.00004.00004') { + if ((data['siteSoftware'] != null) && !/^4channel\.org yotsuba$/m.test(data['siteSoftware'])) { + set('siteSoftware', data['siteSoftware'] + '\n4channel.org yotsuba'); + } + } + if (compareString < '00001.00014.00005.00000') { + for (var db of DataBoard.keys) { + if (data[db]?.boards) { + var { boards, lastChecked } = data[db]; + data[db]['4chan.org'] = { boards, lastChecked }; + delete data[db].boards; + delete data[db].lastChecked; + set(db, data[db]); + } + } + if ((data['siteSoftware'] != null) && (data['siteProperties'] == null)) { + const siteProperties = dict(); + for (var line of data['siteSoftware'].split('\n')) { + var [hostname, software] = Array.from(line.split(' ')); + siteProperties[hostname] = { software }; + } + set('siteProperties', siteProperties); + } + } + if (compareString < '00001.00014.00006.00006') { + if (data['sauces'] != null) { + set('sauces', data['sauces'].replace(/\/\/%\$1\.deviantart\.com\/gallery\/#\/d%\$2;regexp:\/\^\\w\+_by_\(\\w\+\)-d\(\[\\da-z\]\+\)\//g, '//www.deviantart.com/gallery/#/d%$1%$2;regexp:/^\\w+_by_\\w+[_-]d([\\da-z]{6})\\b|^d([\\da-z]{6})-[\\da-z]{8}-/')); + } + } + if (compareString < '00001.00014.00008.00000') { + if (data['sauces'] != null) { + set('sauces', data['sauces'].replace(/https:\/\/www\.yandex\.com\/images\/search/g, 'https://yandex.com/images/search')); + } + } + if (compareString < '00001.00014.00009.00000') { + if (data['sauces'] != null) { + set('sauces', data['sauces'].replace(/^(#?\s*)(?:http:)?\/\/(www\.pixiv\.net|www\.deviantart\.com|imgur\.com|flickr\.com)\//mg, '$1https://$2/')); + set('sauces', data['sauces'].replace(/https:\/\/yandex\.com\/images\/search\?rpt=imageview&img_url=%IMG/g, 'https://yandex.com/images/search?rpt=imageview&url=%IMG')); + } + } + if (compareString < '00001.00014.00009.00001') { + if ((data['Use Faster Image Host'] != null) && (data['fourchanImageHost'] == null)) { + set('fourchanImageHost', (data['Use Faster Image Host'] ? 'i.4cdn.org' : '')); + } + } + if (compareString < '00001.00014.00010.00001') { + if (data['Filter in Native Catalog'] == null) { + set('Filter in Native Catalog', false); + } + } + if (compareString < '00001.00014.00012.00008') { + if (data['boardnav'] == null) { + set('boardnav', `\ +[ toggle-all ] +a-replace +c-replace +g-replace +k-replace +v-replace +vg-replace +vr-replace +ck-replace +co-replace +fit-replace +jp-replace +mu-replace +sp-replace +tv-replace +vp-replace +[external-text:"FAQ","${meta.faq}"]\ +`); + } + } + if (compareString < '00001.00014.00016.00001') { + if (data['archiveLists'] != null) { + set('archiveLists', data['archiveLists'].replace('https://mayhemydg.github.io/archives.json/archives.json', 'https://nstepien.github.io/archives.json/archives.json')); + } + } + if (compareString < '00001.00014.00016.00007') { + if (data['sauces'] != null) { + set('sauces', data['sauces'].replace(/https:\/\/www\.deviantart\.com\/gallery\/#\/d%\$1%\$2;regexp:\/\^\\w\+_by_\\w\+\[_-\]d\(\[\\da-z\]\{6\}\)\\b\|\^d\(\[\\da-z\]\{6\}\)-\[\\da-z\]\{8\}-\//g, 'javascript:void(open("https://www.deviantart.com/"+%$1.replace(/_/g,"-")+"/art/"+parseInt(%$2,36)));regexp:/^\\w+_by_(\\w+)[_-]d([\\da-z]{6})\\b/').replace(/\/\/imgops\.com\/%URL/g, '//imgops.com/start?url=%URL')); + } + } + if (compareString < '00001.00014.00017.00002') { + if (data['jsWhitelist'] != null) { + set('jsWhitelist', data['jsWhitelist'] + '\n\nhttps://hcaptcha.com\nhttps://*.hcaptcha.com'); + } + } + if (compareString < '00001.00014.00020.00004') { + if (data['archiveLists'] != null) { + set('archiveLists', data['archiveLists'].replace('https://nstepien.github.io/archives.json/archives.json', 'https://4chenz.github.io/archives.json/archives.json')); + } + } + if (compareString < '00001.00014.00022.00003') { + if (data['sauces']) { + set('sauces', data['sauces'].replace(/^#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(IMG|T?URL)&safe=off(?=$|;)/mg, 'https://www.google.com/searchbyimage?sbisrc=4chanx&image_url=%$1&safe=off')); + if (compareString === '00001.00014.00022.00002' && !/\bsbisrc=/.test(data['sauces'])) { + set('sauces', data['sauces'].replace(/^#?\s*https:\/\/lens\.google\.com\/uploadbyurl\?url=%(IMG|T?URL)(?=$|;)/m, 'https://www.google.com/searchbyimage?sbisrc=4chanx&image_url=%$1&safe=off')); + } + } + } + return changes; + }, + loadSettings(data, cb) { + if (data.version.split('.')[0] === '2') { // https://github.com/loadletter/4chan-x + data = Settings.convertFrom.loadletter(data); + } + else if (data.version !== g.VERSION) { + Settings.upgrade(data.Conf, data.version); + } + return $$1.clear(function (err) { + if (err) { + return cb(err); + } + return $$1.set(data.Conf, cb); + }); + }, + reset() { + if (confirm('Your current settings will be entirely wiped, are you sure?')) { + return $$1.clear(function (err) { + if (err) { + return $$1('.imp-exp-result').textContent = 'Import failed due to an error.'; + } + else if (confirm('Reset successful. Reload now?')) { + return window.location.reload(); + } + }); + } + }, + filter(section) { + $$1.extend(section, { innerHTML: FilterSelectPage }); + const select = $$1('select', section); + $$1.on(select, 'change', Settings.selectFilter); + return Settings.selectFilter.call(select); + }, + selectFilter() { + let name; + const div = this.nextElementSibling; + if ((name = this.value) !== 'guide') { + if (!$$1.hasOwn(Config.filter, name)) { + return; + } + $$1.rmAll(div); + const ta = $$1.el('textarea', { + name, + className: 'field', + spellcheck: false + }); + $$1.on(ta, 'change', $$1.cb.value); + $$1.get(name, Conf[name], function (item) { + ta.value = item[name]; + return $$1.add(div, ta); + }); + return; + } + Object.keys(Config.filter).filter(x => x !== 'general').map((x, i) => ({ + innerHTML: (i ? "," : "") + `${E(x)}` + })); + $$1.extend(div, { innerHTML: FilterGuidePage }); + return $$1('.warning', div).hidden = Conf['Filter']; + }, + sauce(section) { + $$1.extend(section, { innerHTML: SaucePage }); + $$1('.warning', section).hidden = Conf['Sauce']; + const ta = $$1('textarea', section); + $$1.get('sauces', Conf['sauces'], function (item) { + ta.value = item['sauces']; + return (ta.hidden = false); + }); // XXX prevent Firefox from adding initialization to undo queue + return $$1.on(ta, 'change', $$1.cb.value); + }, + advanced(section) { + let input, name; + $$1.extend(section, { innerHTML: AdvancedPage }); + for (var warning of $$('.warning', section)) { + warning.hidden = Conf[warning.dataset.feature]; + } + const inputs = dict(); + for (input of $$('[name]', section)) { + inputs[input.name] = input; + } + $$1.on(inputs['archiveLists'], 'change', function () { + $$1.set('lastarchivecheck', 0); + Conf['lastarchivecheck'] = 0; + return $$1.id('lastarchivecheck').textContent = 'never'; + }); + const items = dict(); + for (name in inputs) { + input = inputs[name]; + if (!['Interval', 'Custom CSS'].includes(name)) { + items[name] = Conf[name]; + var event = ((input.nodeName === 'SELECT') || + ['checkbox', 'radio'].includes(input.type) || + ((input.nodeName === 'TEXTAREA') && !(name in Settings))) ? 'change' : 'input'; + $$1.on(input, event, $$1.cb[input.type === 'checkbox' ? 'checked' : 'value']); + if (name in Settings) { + $$1.on(input, event, Settings[name]); + } + } + } + $$1.get(items, function (items) { + for (var key in items) { + var val = items[key]; + input = inputs[key]; + input[input.type === 'checkbox' ? 'checked' : 'value'] = val; + input.hidden = false; // XXX prevent Firefox from adding initialization to undo queue + if (key in Settings) { + Settings[key].call(input); + } + } + }); + const listImageHost = $$1.id('list-fourchanImageHost'); + for (var textContent of ImageHost.suggestions) { + $$1.add(listImageHost, $$1.el('option', { textContent })); + } + const interval = inputs['Interval']; + const customCSS = inputs['Custom CSS']; + const applyCSS = $$1('#apply-css', section); + interval.value = Conf['Interval']; + customCSS.checked = Conf['Custom CSS']; + inputs['usercss'].disabled = !Conf['Custom CSS']; + applyCSS.disabled = !Conf['Custom CSS']; + $$1.on(interval, 'change', ThreadUpdater.cb.interval); + $$1.on(customCSS, 'change', Settings.togglecss); + $$1.on(applyCSS, 'click', () => CustomCSS.update()); + const itemsArchive = dict(); + for (name of ['archives', 'selectedArchives', 'lastarchivecheck']) { + itemsArchive[name] = Conf[name]; + } + $$1.get(itemsArchive, function (itemsArchive) { + $$1.extend(Conf, itemsArchive); + Redirect$1.selectArchives(); + return Settings.addArchiveTable(section); + }); + const boardSelect = $$1('#archive-board-select', section); + const table = $$1('#archive-table', section); + const updateArchives = $$1('#update-archives', section); + $$1.on(boardSelect, 'change', function () { + $$1('tbody > :not([hidden])', table).hidden = true; + return $$1(`tbody > .${this.value}`, table).hidden = false; + }); + return $$1.on(updateArchives, 'click', () => Redirect$1.update(() => Settings.addArchiveTable(section))); + }, + addArchiveTable(section) { + let boardID, o; + $$1('#lastarchivecheck', section).textContent = Conf['lastarchivecheck'] === 0 ? + 'never' + : + new Date(Conf['lastarchivecheck']).toLocaleString(); + const boardSelect = $$1('#archive-board-select', section); + const table = $$1('#archive-table', section); + const tbody = $$1('tbody', section); + $$1.rmAll(boardSelect); + $$1.rmAll(tbody); + const archBoards = dict(); + for (var { uid, name, boards, files, software } of Conf['archives']) { + if (!['fuuka', 'foolfuuka'].includes(software)) { + continue; + } + for (boardID of boards) { + o = archBoards[boardID] || (archBoards[boardID] = { + thread: [], + post: [], + file: [] + }); + var archive = [uid ?? name, name]; + o.thread.push(archive); + if (software === 'foolfuuka') { + o.post.push(archive); + } + if (files.includes(boardID)) { + o.file.push(archive); + } + } + } + const rows = []; + const boardOptions = []; + for (boardID of Object.keys(archBoards).sort()) { // Alphabetical order + var row = $$1.el('tr', { className: `board-${boardID}` }); + row.hidden = boardID !== g.BOARD.ID; + boardOptions.push($$1.el('option', { + textContent: `/${boardID}/`, + value: `board-${boardID}`, + selected: boardID === g.BOARD.ID + })); + o = archBoards[boardID]; + for (var item of ['thread', 'post', 'file']) { + $$1.add(row, Settings.addArchiveCell(boardID, o, item)); + } + rows.push(row); + } + if (rows.length === 0) { + boardSelect.hidden = (table.hidden = true); + return; + } + boardSelect.hidden = (table.hidden = false); + if (!(g.BOARD.ID in archBoards)) { + rows[0].hidden = false; + } + $$1.add(boardSelect, boardOptions); + $$1.add(tbody, rows); + for (boardID in Conf['selectedArchives']) { + var data = Conf['selectedArchives'][boardID]; + for (var type in data) { + var select; + var id = data[type]; + if (select = $$1(`select[data-boardid='${boardID}'][data-type='${type}']`, tbody)) { + select.value = JSON.stringify(id); + if (!select.value) { + select.value = select.firstChild.value; + } + } + } + } + }, + addArchiveCell(boardID, data, type) { + const { length } = data[type]; + const td = $$1.el('td', { className: 'archive-cell' }); + if (!length) { + td.textContent = '--'; + return td; + } + const options = []; + let i = 0; + while (i < length) { + var archive = data[type][i++]; + options.push($$1.el('option', { + value: JSON.stringify(archive[0]), + textContent: archive[1] + })); + } + $$1.extend(td, { innerHTML: '' }); + const select = td.firstElementChild; + if (!(select.disabled = length === 1)) { + // XXX GM can't into datasets + select.setAttribute('data-boardid', boardID); + select.setAttribute('data-type', type); + $$1.on(select, 'change', Settings.saveSelectedArchive); + } + $$1.add(select, options); + return td; + }, + saveSelectedArchive() { + return $$1.get('selectedArchives', Conf['selectedArchives'], ({ selectedArchives }) => { + (selectedArchives[this.dataset.boardid] || (selectedArchives[this.dataset.boardid] = dict()))[this.dataset.type] = JSON.parse(this.value); + $$1.set('selectedArchives', selectedArchives); + Conf['selectedArchives'] = selectedArchives; + return Redirect$1.selectArchives(); + }); + }, + boardnav() { + return Header$1.generateBoardList(this.value); + }, + time() { + return this.nextElementSibling.textContent = Time.format(this.value, new Date()); + }, + timeLocale() { + return Settings.time.call($$1('[name=time]', Settings.dialog)); + }, + backlink() { + return this.nextElementSibling.textContent = this.value.replace(/%(?:id|%)/g, x => ({ '%id': '123456789', '%%': '%' })[x]); + }, + fileInfo() { + const data = { + isReply: true, + file: { + url: `//${ImageHost.host()}/g/1334437723720.jpg`, + name: 'd9bb2efc98dd0df141a94399ff5880b7.jpg', + size: '276 KB', + sizeInBytes: 276 * 1024, + dimensions: '1280x720', + isImage: true, + isVideo: false, + isSpoiler: true, + tag: 'Loop' + } + }; + return FileInfo.format(this.value, data, this.nextElementSibling); + }, + favicon() { + Favicon.switch(); + if ((g.VIEW === 'thread') && Conf['Unread Favicon']) { + Unread.update(); + } + const img = this.nextElementSibling.children; + const f = Favicon; + const iterable = [f.SFW, f.unreadSFW, f.unreadSFWY, f.NSFW, f.unreadNSFW, f.unreadNSFWY, f.dead, f.unreadDead, f.unreadDeadY]; + for (let i = 0; i < iterable.length; i++) { + var icon = iterable[i]; + if (!img[i]) { + $$1.add(this.nextElementSibling, $$1.el('img')); + } + img[i].src = icon; + } + }, + togglecss() { + if (($$1('textarea[name=usercss]', $$1.x('ancestor::fieldset[1]', this)).disabled = ($$1.id('apply-css').disabled = !this.checked))) { + CustomCSS.rmStyle(); + } + else { + CustomCSS.addStyle(); + } + return $$1.cb.checked.call(this); + }, + keybinds(section) { + let key; + $$1.extend(section, { innerHTML: KeybindsPage }); + $$1('.warning', section).hidden = Conf['Keybinds']; + const tbody = $$1('tbody', section); + const items = dict(); + const inputs = dict(); + for (key in Config.hotkeys) { + var arr = Config.hotkeys[key]; + var tr = $$1.el('tr', { innerHTML: `${arr[1]}` }); + var input = $$1('input', tr); + input.name = key; + input.spellcheck = false; + items[key] = Conf[key]; + inputs[key] = input; + $$1.on(input, 'keydown', Settings.keybind); + $$1.add(tbody, tr); + } + return $$1.get(items, function (items) { + for (key in items) { + var val = items[key]; + inputs[key].value = val; + } + }); + }, + keybind(e) { + let key; + if (e.keyCode === 9) { + return; + } // tab + e.preventDefault(); + e.stopPropagation(); + if ((key = Keybinds.keyCode(e)) == null) { + return; + } + this.value = key; + return $$1.cb.value.call(this); + } + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var FappeTyme = { + init() { + if ((!Conf['Fappe Tyme'] && !Conf['Werk Tyme']) || !['index', 'thread', 'archive'].includes(g.VIEW)) { return; } + + this.nodes = {}; + this.enabled = { + fappe: false, + werk: Conf['werk'] + }; + + for (var type of ["Fappe", "Werk"]) { + if (Conf[`${type} Tyme`]) { + var lc = type.toLowerCase(); + var el = UI.checkbox(lc, `${type} Tyme`, false); + el.title = `${type} Tyme`; + + this.nodes[lc] = el.firstElementChild; + if (Conf[lc]) { this.set(lc, true); } + $$1.on(this.nodes[lc], 'change', this.toggle.bind(this, lc)); + + Header$1.menu.addEntry({ + el, + order: 97 + }); + + var indicator = $$1.el('span', { + className: 'indicator', + textContent: type[0], + title: `${type} Tyme active` + } + ); + $$1.on(indicator, 'click', function() { + const check = $$1.getOwn(FappeTyme.nodes, this.parentNode.id.replace('shortcut-', '')); + check.checked = !check.checked; + return $$1.event('change', null, check); + }); + Header$1.addShortcut(lc, indicator, 410); + } + } + + if (Conf['Werk Tyme']) { + $$1.sync('werk', this.set.bind(this, 'werk')); + } + + Callbacks.Post.push({ + name: 'Fappe Tyme', + cb: this.node + }); + + return Callbacks.CatalogThread.push({ + name: 'Werk Tyme', + cb: this.catalogNode + }); + }, + + node() { + return this.nodes.root.classList.toggle('noFile', !this.files.length); + }, + + catalogNode() { + const file = this.thread.OP.files[0]; + if (!file) { return; } + const filename = $$1.el('div', { + textContent: file.name, + className: 'werkTyme-filename' + } + ); + return $$1.add(this.nodes.thumb.parentNode, filename); + }, + + set(type, enabled) { + this.enabled[type] = (this.nodes[type].checked = enabled); + return $$1[`${enabled ? 'add' : 'rm'}Class`](doc$1, `${type}Tyme`); + }, + + toggle(type) { + this.set(type, !this.enabled[type]); + if (type === 'werk') { return $$1.cb.checked.call(this.nodes[type]); } + } + }; + + var galleryPage = `
              + + + + + × + +
              + + / + + + +
              +
              +
              + +
              +
              +
              +
              +`; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS104: Avoid inline assignments + * DS204: Change includes calls to have a more natural evaluation order + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var Sauce = { + init() { + let link; + if (!['index', 'thread'].includes(g.VIEW) || !Conf['Sauce']) { return; } + $$1.addClass(doc$1, 'show-sauce'); + + const links = []; + for (link of Conf['sauces'].split('\n')) { + var linkData; + if ((link[0] !== '#') && (linkData = this.parseLink(link))) { + links.push(linkData); + } + } + if (!links.length) { return; } + + this.links = links; + this.link = $$1.el('a', { + target: '_blank', + className: 'sauce' + } + ); + return Callbacks.Post.push({ + name: 'Sauce', + cb: this.node + }); + }, + + parseLink(link) { + if (!(link = link.trim())) { return null; } + const parts = dict(); + const iterable = link.split(/;(?=(?:text|boards|types|regexp|sandbox):?)/); + for (let i = 0; i < iterable.length; i++) { + var part = iterable[i]; + if (i === 0) { + parts['url'] = part; + } else { + var m = part.match(/^(\w*):?(.*)$/); + parts[m[1]] = m[2]; + } + } + if (!parts['text']) { parts['text'] = parts['url'].match(/(\w+)\.\w+\//)?.[1] || '?'; } + if ('boards' in parts) { + parts['boards'] = Filter.parseBoards(parts['boards']); + } + if ('regexp' in parts) { + try { + let regexp; + if (regexp = parts['regexp'].match(/^\/(.*)\/(\w*)$/)) { + parts['regexp'] = RegExp(regexp[1], regexp[2]); + } else { + parts['regexp'] = RegExp(parts['regexp']); + } + } catch (err) { + new Notice('warning', [ + $$1.tn("Invalid regexp for Sauce link:"), + $$1.el('br'), + $$1.tn(link), + $$1.el('br'), + $$1.tn(err.message) + ], 60); + return null; + } + } + return parts; + }, + + createSauceLink(link, post, file) { + let a, matches, needle; + const ext = file.url.match(/[^.]*$/)[0]; + const parts = dict(); + $$1.extend(parts, link); + + if (!!parts['boards'] && !parts['boards'][`${post.siteID}/${post.boardID}`] && !parts['boards'][`${post.siteID}/*`]) { return null; } + if (!!parts['types'] && (needle = ext, !parts['types'].split(',').includes(needle))) { return null; } + if (!!parts['regexp'] && (!(matches = file.name.match(parts['regexp'])))) { return null; } + + const missing = []; + for (var key of ['url', 'text']) { + parts[key] = parts[key].replace(/%(T?URL|IMG|[sh]?MD5|board|name|%|semi|\$\d+)/g, function(orig, parameter) { + let type; + if (parameter[0] === '$') { + if (!matches) { return orig; } + type = matches[parameter.slice(1)] || ''; + } else { + type = Sauce.formatters[parameter](post, file, ext); + if ((type == null)) { + missing.push(parameter); + return ''; + } + } + + if ((key === 'url') && !['%', 'semi'].includes(parameter)) { + if (/^javascript:/i.test(parts['url'])) { type = JSON.stringify(type); } + type = encodeURIComponent(type); + } + return type; + }); + } + + if (g.SITE.areMD5sDeferred?.(post.board) && missing.length && !missing.filter(x => !/^.?MD5$/.test(x)).length) { + a = Sauce.link.cloneNode(false); + a.dataset.skip = '1'; + return a; + } + + if (missing.length) { return null; } + + a = Sauce.link.cloneNode(false); + a.href = parts['url']; + a.textContent = parts['text']; + if (/^javascript:/i.test(parts['url'])) { a.removeAttribute('target'); } + return a; + }, + + node() { + if (this.isClone) { return; } + for (var file of this.files) { + Sauce.file(this, file); + } + }, + + file(post, file) { + let link, node; + const nodes = []; + const skipped = []; + for (link of Sauce.links) { + if (node = Sauce.createSauceLink(link, post, file)) { + nodes.push($$1.tn(' '), node); + if (node.dataset.skip) { skipped.push([link, node]); } + } + } + $$1.add(file.text, nodes); + + if (skipped.length) { + var observer = new MutationObserver(function() { + if (file.text.dataset.md5) { + for ([link, node] of skipped) { + var node2; + if (node2 = Sauce.createSauceLink(link, post, file)) { + $$1.replace(node, node2); + } + } + return observer.disconnect(); + } + }); + return observer.observe(file.text, {attributes: true}); + } + }, + + formatters: { + TURL(post, file) { return file.thumbURL; }, + URL(post, file) { return file.url; }, + IMG(post, file, ext) { if (['gif', 'jpg', 'jpeg', 'png'].includes(ext)) { return file.url; } else { return file.thumbURL; } }, + MD5(post, file) { return file.MD5; }, + sMD5(post, file) { return file.MD5?.replace(/[+/=]/g, c => ({'+': '-', '/': '_', '=': ''})[c]); }, + hMD5(post, file) { if (file.MD5) { return (atob(file.MD5).map((c) => `0${c.charCodeAt(0).toString(16)}`.slice(-2))).join(''); } }, + board(post) { return post.board.ID; }, + name(post, file) { return file.name; }, + '%'() { return '%'; }, + semi() { return ';'; } + } + }; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * DS205: Consider reworking code to avoid use of IIFEs + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + + var Gallery = { + init() { + if (!(this.enabled = Conf['Gallery'] && ['index', 'thread'].includes(g.VIEW))) { return; } + + this.delay = Conf['Slide Delay']; + + const el = $$1.el('a', { + href: 'javascript:;', + title: 'Gallery', + textContent: '🖼︎', + }); + + $$1.on(el, 'click', this.cb.toggle); + + Header$1.addShortcut('gallery', el, 530); + + return Callbacks.Post.push({ + name: 'Gallery', + cb: this.node + }); + }, + + node() { + return (() => { + const result = []; + for (var file of this.files) { + if (file.thumb) { + if (Gallery.nodes) { + Gallery.generateThumb(this, file); + Gallery.nodes.total.textContent = Gallery.images.length; + } + + if (!Conf['Image Expansion'] && ((g.SITE.software !== 'tinyboard') || !Main$1.jsEnabled)) { + result.push($$1.on(file.thumbLink, 'click', Gallery.cb.image)); + } else { + result.push(undefined); + } + } + } + return result; + })(); + }, + + build(image) { + let dialog, thumb; + const {cb} = Gallery; + + if (Conf['Fullscreen Gallery']) { + $$1.one(d$1, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', () => $$1.on(d$1, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', cb.close)); + doc$1.mozRequestFullScreen?.(); + doc$1.webkitRequestFullScreen?.(Element.ALLOW_KEYBOARD_INPUT); + } + + Gallery.images = []; + const nodes = (Gallery.nodes = {}); + Gallery.fileIDs = dict(); + Gallery.slideshow = false; + + nodes.el = (dialog = $$1.el('div', + {id: 'a-gallery'})); + $$1.extend(dialog, {innerHTML: galleryPage }); + + const object = { + buttons: '.gal-buttons', + frame: '.gal-image', + name: '.gal-name', + count: '.count', + total: '.total', + sauce: '.gal-sauce', + thumbs: '.gal-thumbnails', + next: '.gal-image a', + current: '.gal-image img' + }; + for (var key in object) { var value = object[key]; nodes[key] = $$1(value, dialog); } + + const menuButton = $$1('.menu-button', dialog); + nodes.menu = new UI.Menu('gallery'); + + $$1.on(nodes.frame, 'click', cb.blank); + if (Conf['Mouse Wheel Volume']) { $$1.on(nodes.frame, 'wheel', Volume.wheel); } + $$1.on(nodes.next, 'click', cb.click); + $$1.on(nodes.name, 'click', ImageCommon.download); + + $$1.on($$1('.gal-prev', dialog), 'click', cb.prev); + $$1.on($$1('.gal-next', dialog), 'click', cb.next); + $$1.on($$1('.gal-start', dialog), 'click', cb.start); + $$1.on($$1('.gal-stop', dialog), 'click', cb.stop); + $$1.on($$1('.gal-close', dialog), 'click', cb.close); + + $$1.on(menuButton, 'click', function(e) { + return nodes.menu.toggle(e, this, g); + }); + + for (var entry of Gallery.menu.createSubEntries()) { + entry.order = 0; + nodes.menu.addEntry(entry); + } + + $$1.on(d$1, 'keydown', cb.keybinds); + if (Conf['Keybinds']) { $$1.off(d$1, 'keydown', Keybinds.keydown); } + + $$1.on(window, 'resize', Gallery.cb.setHeight); + + for (var postThumb of $$(g.SITE.selectors.file.thumb)) { + var post; + if (!(post = Get$1.postFromNode(postThumb))) { continue; } + for (var file of post.files) { + if (file.thumb) { + Gallery.generateThumb(post, file); + // If no image to open is given, pick image we have scrolled to. + if (!image && Gallery.fileIDs[`${post.fullID}.${file.index}`]) { + var candidate = file.thumbLink; + if ((Header$1.getTopOf(candidate) + candidate.getBoundingClientRect().height) >= 0) { + image = candidate; + } + } + } + } + } + $$1.addClass(doc$1, 'gallery-open'); + + $$1.add(d$1.body, dialog); + + nodes.thumbs.scrollTop = 0; + nodes.current.parentElement.scrollTop = 0; + + if (image) { thumb = $$1(`[href='${image.href}']`, nodes.thumbs); } + if (!thumb) { thumb = Gallery.images[Gallery.images.length-1]; } + if (thumb) { Gallery.open(thumb); } + + doc$1.style.overflow = 'hidden'; + return nodes.total.textContent = Gallery.images.length; + }, + + generateThumb(post, file) { + if (post.isClone || post.isHidden) { return; } + if (!file || !file.thumb || (!file.isImage && !file.isVideo && !Conf['PDF in Gallery'])) { return; } + if (Gallery.fileIDs[`${post.fullID}.${file.index}`]) { return; } + + Gallery.fileIDs[`${post.fullID}.${file.index}`] = true; + + const thumb = $$1.el('a', { + className: 'gal-thumb', + href: file.url, + target: '_blank', + title: file.name + } + ); + + thumb.dataset.id = Gallery.images.length; + thumb.dataset.post = post.fullID; + thumb.dataset.file = file.index; + + const thumbImg = file.thumb.cloneNode(false); + thumbImg.style.cssText = ''; + $$1.add(thumb, thumbImg); + + $$1.on(thumb, 'click', Gallery.cb.open); + + Gallery.images.push(thumb); + return $$1.add(Gallery.nodes.thumbs, thumb); + }, + + load(thumb, errorCB) { + const ext = thumb.href.match(/\w*$/); + const elType = $$1.getOwn({'webm': 'video', 'mp4': 'video', 'ogv': 'video', 'pdf': 'iframe'}, ext) || 'img'; + const file = $$1.el(elType); + $$1.extend(file.dataset, thumb.dataset); + $$1.on(file, 'error', errorCB); + file.src = thumb.href; + return file; + }, + + open(thumb) { + let el, file, post; + const {nodes} = Gallery; + const oldID = +nodes.current.dataset.id; + const newID = +thumb.dataset.id; + + // Highlight, center selected thumbnail + if (el = Gallery.images[oldID]) { $$1.rmClass(el, 'gal-highlight'); } + $$1.addClass(thumb, 'gal-highlight'); + nodes.thumbs.scrollTop = (thumb.offsetTop + (thumb.offsetHeight/2)) - (nodes.thumbs.clientHeight/2); + + // Load image or use preloaded image + if (Gallery.cache?.dataset.id === (''+newID)) { + file = Gallery.cache; + $$1.off(file, 'error', Gallery.cacheError); + $$1.on(file, 'error', Gallery.error); + } else { + file = Gallery.load(thumb, Gallery.error); + } + + // Replace old image with new one + $$1.off(nodes.current, 'error', Gallery.error); + ImageCommon.pause(nodes.current); + $$1.replace(nodes.current, file); + nodes.current = file; + + if (file.nodeName === 'VIDEO') { + file.loop = true; + Volume.setup(file); + if (Conf['Autoplay']) { file.play(); } + if (Conf['Show Controls']) { ImageCommon.addControls(file); } + } + + doc$1.classList.toggle('gal-pdf', file.nodeName === 'IFRAME'); + Gallery.cb.setHeight(); + nodes.count.textContent = +thumb.dataset.id + 1; + nodes.name.download = (nodes.name.textContent = thumb.title); + nodes.name.href = thumb.href; + nodes.frame.scrollTop = 0; + nodes.next.focus(); + + // Set sauce links + $$1.rmAll(nodes.sauce); + if (Conf['Sauce'] && Sauce.links && (post = g.posts.get(file.dataset.post))) { + const sauces = []; + for (var link of Sauce.links) { + var node; + if (node = Sauce.createSauceLink(link, post, post.files[+file.dataset.file])) { + sauces.push($$1.tn(' '), node); + } + } + $$1.add(nodes.sauce, sauces); + } + + // Continue slideshow if moving forward, stop otherwise + if (Gallery.slideshow && ((newID > oldID) || ((oldID === (Gallery.images.length-1)) && (newID === 0)))) { + Gallery.setupTimer(); + } else { + Gallery.cb.stop(); + } + + // Scroll to post + if (Conf['Scroll to Post'] && (post = g.posts.get(file.dataset.post))) { + Header$1.scrollTo(post.nodes.root); + } + + // Preload next image + if (isNaN(oldID) || (newID === ((oldID + 1) % Gallery.images.length))) { + return Gallery.cache = Gallery.load(Gallery.images[(newID + 1) % Gallery.images.length], Gallery.cacheError); + } + }, + + error() { + if (this.error?.code === MediaError.MEDIA_ERR_DECODE) { + return new Notice('error', 'Corrupt or unplayable video', 30); + } + if (ImageCommon.isFromArchive(this)) { return; } + const post = g.posts.get(this.dataset.post); + const file = post.files[+this.dataset.file]; + return ImageCommon.error(this, post, file, null, url => { + if (!url) { return; } + Gallery.images[+this.dataset.id].href = url; + if (Gallery.nodes.current === this) { return this.src = url; } + }); + }, + + cacheError() { + return delete Gallery.cache; + }, + + cleanupTimer() { + clearTimeout(Gallery.timeoutID); + const {current} = Gallery.nodes; + $$1.off(current, 'canplaythrough load', Gallery.startTimer); + return $$1.off(current, 'ended', Gallery.cb.next); + }, + + startTimer() { + return Gallery.timeoutID = setTimeout(Gallery.checkTimer, Gallery.delay * SECOND); + }, + + setupTimer() { + Gallery.cleanupTimer(); + const {current} = Gallery.nodes; + const isVideo = current.nodeName === 'VIDEO'; + if (isVideo) { current.play(); } + if ((isVideo ? current.readyState >= 4 : current.complete) || (current.nodeName === 'IFRAME')) { + return Gallery.startTimer(); + } else { + return $$1.on(current, (isVideo ? 'canplaythrough' : 'load'), Gallery.startTimer); + } + }, + + checkTimer() { + const {current} = Gallery.nodes; + if ((current.nodeName === 'VIDEO') && !current.paused) { + $$1.on(current, 'ended', Gallery.cb.next); + return current.loop = false; + } else { + return Gallery.cb.next(); + } + }, + + cb: { + keybinds(e) { + let key; + if (!(key = Keybinds.keyCode(e))) { return; } + + const cb = (() => { switch (key) { + case Conf['Close']: case Conf['Open Gallery']: + return Gallery.cb.close; + case Conf['Next Gallery Image']: + return Gallery.cb.next; + case Conf['Advance Gallery']: + return Gallery.cb.advance; + case Conf['Previous Gallery Image']: + return Gallery.cb.prev; + case Conf['Pause']: + return Gallery.cb.pause; + case Conf['Slideshow']: + return Gallery.cb.toggleSlideshow; + case Conf['Rotate image anticlockwise']: + return Gallery.cb.rotateLeft; + case Conf['Rotate image clockwise']: + return Gallery.cb.rotateRight; + case Conf['Download Gallery Image']: + return Gallery.cb.download; + } })(); + + if (!cb) { return; } + e.stopPropagation(); + e.preventDefault(); + return cb(); + }, + + open(e) { + if (e) { e.preventDefault(); } + if (this) { return Gallery.open(this); } + }, + + image(e) { + e.preventDefault(); + e.stopPropagation(); + return Gallery.build(this); + }, + + prev() { + return Gallery.cb.open.call( + Gallery.images[+Gallery.nodes.current.dataset.id - 1] || Gallery.images[Gallery.images.length - 1] + ); + }, + next() { + return Gallery.cb.open.call( + Gallery.images[+Gallery.nodes.current.dataset.id + 1] || Gallery.images[0] + ); + }, + + click(e) { + if (ImageCommon.onControls(e)) { return; } + e.preventDefault(); + return Gallery.cb.advance(); + }, + + advance() { if (!Conf['Autoplay'] && Gallery.nodes.current.paused) { return Gallery.nodes.current.play(); } else { return Gallery.cb.next(); } }, + toggle() { return (Gallery.nodes ? Gallery.cb.close : Gallery.build)(); }, + blank(e) { if (e.target === this) { return Gallery.cb.close(); } }, + toggleSlideshow() { return Gallery.cb[Gallery.slideshow ? 'stop' : 'start'](); }, + + download() { + const name = $$1('.gal-name'); + return name.click(); + }, + + pause() { + Gallery.cb.stop(); + const {current} = Gallery.nodes; + if (current.nodeName === 'VIDEO') { return current[current.paused ? 'play' : 'pause'](); } + }, + + start() { + $$1.addClass(Gallery.nodes.buttons, 'gal-playing'); + Gallery.slideshow = true; + return Gallery.setupTimer(); + }, + + stop() { + if (!Gallery.slideshow) { return; } + Gallery.cleanupTimer(); + const {current} = Gallery.nodes; + if (current.nodeName === 'VIDEO') { current.loop = true; } + $$1.rmClass(Gallery.nodes.buttons, 'gal-playing'); + return Gallery.slideshow = false; + }, + + rotateLeft() { return Gallery.cb.rotate(270); }, + rotateRight() { return Gallery.cb.rotate(90); }, + + rotate: debounce(100, function(delta) { + const {current} = Gallery.nodes; + if (current.nodeName === 'IFRAME') { return; } + current.dataRotate = ((current.dataRotate || 0) + delta) % 360; + current.style.transform = `rotate(${current.dataRotate}deg)`; + return Gallery.cb.setHeight(); + }), + + close() { + $$1.off(Gallery.nodes.current, 'error', Gallery.error); + ImageCommon.pause(Gallery.nodes.current); + $$1.rm(Gallery.nodes.el); + $$1.rmClass(doc$1, 'gallery-open'); + if (Conf['Fullscreen Gallery']) { + $$1.off(d$1, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', Gallery.cb.close); + d$1.mozCancelFullScreen?.(); + d$1.webkitExitFullscreen?.(); + } + delete Gallery.nodes; + delete Gallery.fileIDs; + doc$1.style.overflow = ''; + + $$1.off(d$1, 'keydown', Gallery.cb.keybinds); + if (Conf['Keybinds']) { $$1.on(d$1, 'keydown', Keybinds.keydown); } + $$1.off(window, 'resize', Gallery.cb.setHeight); + return clearTimeout(Gallery.timeoutID); + }, + + setFitness() { + return (this.checked ? $$1.addClass : $$1.rmClass)(doc$1, `gal-${this.name.toLowerCase().replace(/\s+/g, '-')}`); + }, + + setHeight: debounce(100, function () { + let dim, margin, minHeight; + const {current, frame} = Gallery.nodes; + const {style} = current; + + if (Conf['Stretch to Fit'] && (dim = g.posts.get(current.dataset.post)?.files[+current.dataset.file].dimensions)) { + const [width, height] = Array.from(dim.split('x')); + let containerWidth = frame.clientWidth; + let containerHeight = doc$1.clientHeight - 25; + if (((current.dataRotate || 0) % 180) === 90) { + [containerWidth, containerHeight] = Array.from([containerHeight, containerWidth]); + } + minHeight = Math.min(containerHeight, (height / width) * containerWidth); + style.minHeight = minHeight + 'px'; + style.minWidth = ((width / height) * minHeight) + 'px'; + } else { + style.minHeight = (style.minWidth = ''); + } + + if (((current.dataRotate || 0) % 180) === 90) { + style.maxWidth = Conf['Fit Height'] ? `${doc$1.clientHeight - 25}px` : 'none'; + style.maxHeight = Conf['Fit Width'] ? `${frame.clientWidth}px` : 'none'; + margin = (current.clientWidth - current.clientHeight)/2; + return style.margin = `${margin}px ${-margin}px`; + } else { + return style.maxWidth = (style.maxHeight = (style.margin = '')); + } + }), + + setDelay() { return Gallery.delay = +this.value; } + }, + + menu: { + init() { + if (!Gallery.enabled) { return; } + + const el = $$1.el('span', { + textContent: 'Gallery', + className: 'gallery-link' + } + ); + + return Header$1.menu.addEntry({ + el, + order: 105, + subEntries: Gallery.menu.createSubEntries() + }); + }, + + createSubEntry(name) { + const label = UI.checkbox(name, name); + const input = label.firstElementChild; + if (['Hide Thumbnails', 'Fit Width', 'Fit Height'].includes(name)) { $$1.on(input, 'change', Gallery.cb.setFitness); } + $$1.event('change', null, input); + $$1.on(input, 'change', $$1.cb.checked); + if (['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Stretch to Fit'].includes(name)) { $$1.on(input, 'change', Gallery.cb.setHeight); } + return {el: label}; + }, + + createSubEntries() { + const subEntries = (['Hide Thumbnails', 'Fit Width', 'Fit Height', 'Stretch to Fit', 'Scroll to Post'].map((item) => Gallery.menu.createSubEntry(item))); + + const delayLabel = $$1.el('label', {innerHTML: 'Slide Delay: '}); + const delayInput = delayLabel.firstElementChild; + delayInput.value = Gallery.delay; + $$1.on(delayInput, 'change', Gallery.cb.setDelay); + $$1.on(delayInput, 'change', $$1.cb.value); + subEntries.push({el: delayLabel}); + + return subEntries; + } + } + }; + + var EmbeddingPage = `
              +
              + + × +
              +
              +`; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * DS205: Consider reworking code to avoid use of IIFEs + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + + var Embedding = { + init() { + if (!['index', 'thread', 'archive'].includes(g.VIEW) || !Conf['Linkify'] || (!Conf['Embedding'] && !Conf['Link Title'] && !Conf['Cover Preview'])) { return; } + this.types = dict(); + for (var type of this.ordered_types) { this.types[type.key] = type; } + + if (Conf['Embedding'] && (g.VIEW !== 'archive')) { + this.dialog = UI.dialog('embedding', + { innerHTML: EmbeddingPage }); + this.media = $$1('#media-embed', this.dialog); + $$1.one(d$1, '4chanXInitFinished', this.ready); + $$1.on(d$1, 'IndexRefreshInternal', () => g.posts.forEach(function(post) { + for (post of [post, ...Array.from(post.clones)]) { + for (var embed of post.nodes.embedlinks) { + Embedding.cb.catalogRemove.call(embed); + } + } + })); + } + if (Conf['Link Title']) { + return $$1.on(d$1, '4chanXInitFinished PostsInserted', function() { + for (var key in Embedding.types) { + var service = Embedding.types[key]; + if (service.title?.batchSize) { + Embedding.flushTitles(service.title); + } + } + }); + } + }, + + events(post) { + let el, i, items; + if (g.VIEW === 'archive') { return; } + if (Conf['Embedding']) { + i = 0; + items = (post.nodes.embedlinks = $$('.embedder', post.nodes.comment)); + while ((el = items[i++])) { + $$1.on(el, 'click', Embedding.cb.click); + if ($$1.hasClass(el, 'embedded')) { Embedding.cb.toggle.call(el); } + } + } + if (Conf['Cover Preview']) { + i = 0; + items = $$('.linkify', post.nodes.comment); + while ((el = items[i++])) { + var data; + if (data = Embedding.services(el)) { + Embedding.preview(data); + } + } + return; + } + }, + + process(link, post) { + let data; + if (!Conf['Embedding'] && !Conf['Link Title'] && !Conf['Cover Preview']) { return; } + if ($$1.x('ancestor::pre', link)) { return; } + if (data = Embedding.services(link)) { + data.post = post; + if (Conf['Embedding'] && (g.VIEW !== 'archive')) { Embedding.embed(data); } + if (Conf['Link Title']) { Embedding.title(data); } + if (Conf['Cover Preview'] && (g.VIEW !== 'archive')) { return Embedding.preview(data); } + } + }, + + services(link) { + const {href} = link; + for (var type of Embedding.ordered_types) { + var match; + if (match = type.regExp.exec(href)) { + return {key: type.key, uid: match[1], options: match[2], link}; + } + } + }, + + embed(data) { + const {key, uid, options, link, post} = data; + const {href} = link; + + $$1.addClass(link, key.toLowerCase()); + + const embed = $$1.el('a', { + className: 'embedder', + href: 'javascript:;' + } + , + {innerHTML: '(unembed)'}); + + const object = {key, uid, options, href}; + for (var name in object) { var value = object[name]; embed.dataset[name] = value; } + + $$1.on(embed, 'click', Embedding.cb.click); + $$1.after(link, [$$1.tn(' '), embed]); + post.nodes.embedlinks.push(embed); + + if (Conf['Auto-embed'] && !Conf['Floating Embeds'] && !post.isFetchedQuote) { + if ($$1.hasClass(doc$1, 'catalog-mode')) { + return $$1.addClass(embed, 'embed-removed'); + } else { + return Embedding.cb.toggle.call(embed); + } + } + }, + + ready() { + if (!Main$1.isThisPageLegit()) { return; } + $$1.addClass(Embedding.dialog, 'empty'); + $$1.on($$1('.close', Embedding.dialog), 'click', Embedding.closeFloat); + $$1.on($$1('.move', Embedding.dialog), 'mousedown', Embedding.dragEmbed); + $$1.on($$1('.jump', Embedding.dialog), 'click', function() { + if (doc$1.contains(Embedding.lastEmbed)) { return Header$1.scrollTo(Embedding.lastEmbed); } + }); + return $$1.add(d$1.body, Embedding.dialog); + }, + + closeFloat() { + delete Embedding.lastEmbed; + $$1.addClass(Embedding.dialog, 'empty'); + return $$1.replace(Embedding.media.firstChild, $$1.el('div')); + }, + + dragEmbed() { + // only webkit can handle a blocking div + const {style} = Embedding.media; + if (Embedding.dragEmbed.mouseup) { + $$1.off(d$1, 'mouseup', Embedding.dragEmbed); + Embedding.dragEmbed.mouseup = false; + style.pointerEvents = ''; + return; + } + $$1.on(d$1, 'mouseup', Embedding.dragEmbed); + Embedding.dragEmbed.mouseup = true; + return style.pointerEvents = 'none'; + }, + + title(data) { + let service; + const {key, uid, options, link, post} = data; + if (!(service = Embedding.types[key].title)) { return; } + $$1.addClass(link, key.toLowerCase()); + if (service.batchSize) { + (service.queue || (service.queue = [])).push(data); + if (service.queue.length >= service.batchSize) { + return Embedding.flushTitles(service); + } + } else { + return CrossOrigin$1.cache(service.api(uid), (function() { return Embedding.cb.title(this, data); })); + } + }, + + flushTitles(service) { + let data; + const {queue} = service; + if (!queue?.length) { return; } + service.queue = []; + const cb = function() { + for (data of queue) { Embedding.cb.title(this, data); } + }; + return CrossOrigin$1.cache(service.api((() => { + const result = []; + for (data of queue) { result.push(data.uid); + } + return result; + })()), cb); + }, + + preview(data) { + let service; + const {key, uid, link} = data; + if (!(service = Embedding.types[key].preview)) { return; } + return $$1.on(link, 'mouseover', function(e) { + const src = service.url(uid); + const {height} = service; + const el = $$1.el('img', { + src, + id: 'ihover' + } + ); + $$1.add(Header$1.hover, el); + return UI.hover({ + root: link, + el, + latestEvent: e, + endEvents: 'mouseout click', + height + }); + }); + }, + + cb: { + click(e) { + e.preventDefault(); + if (!$$1.hasClass(this, 'embedded') && (Conf['Floating Embeds'] || $$1.hasClass(doc$1, 'catalog-mode'))) { + let div; + if (!(div = Embedding.media.firstChild)) { return; } + $$1.replace(div, Embedding.cb.embed(this)); + Embedding.lastEmbed = Get$1.postFromNode(this).nodes.root; + return $$1.rmClass(Embedding.dialog, 'empty'); + } else { + return Embedding.cb.toggle.call(this); + } + }, + + toggle() { + if ($$1.hasClass(this, "embedded")) { + $$1.rm(this.nextElementSibling); + } else { + $$1.after(this, Embedding.cb.embed(this)); + } + return $$1.toggleClass(this, 'embedded'); + }, + + embed(a) { + // We create an element to embed + let el, type; + const container = $$1.el('div', {className: 'media-embed'}); + $$1.add(container, (el = (type = Embedding.types[a.dataset.key]).el(a))); + + // Set style values. + el.style.cssText = (type.style != null) ? + type.style + : + 'border: none; width: 640px; height: 360px;'; + + return container; + }, + + catalogRemove() { + const isCatalog = $$1.hasClass(doc$1, 'catalog-mode'); + if ((isCatalog && $$1.hasClass(this, 'embedded')) || (!isCatalog && $$1.hasClass(this, 'embed-removed'))) { + Embedding.cb.toggle.call(this); + return $$1.toggleClass(this, 'embed-removed'); + } + }, + + title(req, data) { + let text; + const {key, uid, options, link, post} = data; + const service = Embedding.types[key].title; + + let {status} = req; + if ([200, 304].includes(status) && service.status) { + status = service.status(req.response)[0]; + } + + if (!status) { return; } + + text = `[${key}] ${(() => { switch (status) { + case 200: case 304: + text = service.text(req.response, uid); + if (typeof text === 'string') { + return text; + } else { + return text = link.textContent; + } + case 404: + return "Not Found"; + case 403: case 401: + return "Forbidden or Private"; + default: + return `${status}'d`; + } })() + }`; + + link.dataset.original = link.textContent; + link.textContent = text; + for (var post2 of post.clones) { + for (var link2 of $$('a.linkify', post2.nodes.comment)) { + if (link2.href === link.href) { + if (link2.dataset.original == null) { link2.dataset.original = link2.textContent; } + link2.textContent = text; + } + } + } + } + }, + + ordered_types: [{ + key: 'audio', + regExp: /^[^?#]+\.(?:mp3|m4a|oga|wav|flac)(?:[?#]|$)/i, + style: '', + el(a) { + return $$1.el('audio', { + controls: true, + preload: 'auto', + src: a.dataset.href + } + ); + } + } + , { + key: 'image', + regExp: /^[^?#]+\.(?:gif|png|jpg|jpeg|bmp|webp)(?::\w+)?(?:[?#]|$)/i, + style: '', + el(a) { + const hrefEsc = E(a.dataset.href); + return $$1.el('div', { innerHTML: ``}); + } + } + , { + key: 'video', + regExp: /^[^?#]+\.(?:og[gv]|webm|mp4)(?:[?#]|$)/i, + style: 'max-width: 80vw; max-height: 80vh;', + el(a) { + const el = $$1.el('video', { + hidden: true, + controls: true, + preload: 'auto', + src: a.dataset.href, + loop: ImageHost.test(a.dataset.href.split('/')[2]) + }); + $$1.on(el, 'loadedmetadata', function() { + if ((el.videoHeight === 0) && el.parentNode) { + return $$1.replace(el, Embedding.types.audio.el(a)); + } else { + return el.hidden = false; + } + }); + return el; + } + } + , { + key: 'PeerTube', + regExp: /^(\w+:\/\/[^\/]+\/videos\/watch\/\w{8}-\w{4}-\w{4}-\w{4}-\w{12})(.*)/, + el(a) { + let start; + const options = (start = a.dataset.options.match(/[?&](start=\w+)/)) ? `?${start[1]}` : ''; + const el = $$1.el('iframe', + {src: a.dataset.uid.replace('/videos/watch/', '/videos/embed/') + options}); + el.setAttribute("allowfullscreen", "true"); + return el; + } + } + , { + key: 'BitChute', + regExp: /^\w+:\/\/(?:www\.)?bitchute\.com\/video\/([\w\-]+)/, + el(a) { + const el = $$1.el('iframe', + {src: `https://www.bitchute.com/embed/${a.dataset.uid}/`}); + el.setAttribute("allowfullscreen", "true"); + return el; + } + } + , { + key: 'Clyp', + regExp: /^\w+:\/\/(?:www\.)?clyp\.it\/(\w{8})/, + style: 'border: 0; width: 640px; height: 160px;', + el(a) { + return $$1.el('iframe', + {src: `https://clyp.it/${a.dataset.uid}/widget`}); + }, + title: { + api(uid) { return `https://api.clyp.it/oembed?url=https://clyp.it/${uid}`; }, + text(_) { return _.title; } + } + } + , { + key: 'Dailymotion', + regExp: /^\w+:\/\/(?:(?:www\.)?dailymotion\.com\/(?:embed\/)?video|dai\.ly)\/([A-Za-z0-9]+)[^?]*(.*)/, + el(a) { + let start; + const options = (start = a.dataset.options.match(/[?&](start=\d+)/)) ? `?${start[1]}` : ''; + const el = $$1.el('iframe', + {src: `//www.dailymotion.com/embed/video/${a.dataset.uid}${options}`}); + el.setAttribute("allowfullscreen", "true"); + return el; + }, + title: { + api(uid) { return `https://api.dailymotion.com/video/${uid}`; }, + text(_) { return _.title; } + }, + preview: { + url(uid) { return `https://www.dailymotion.com/thumbnail/video/${uid}`; }, + height: 240 + } + } + , { + key: 'Gfycat', + regExp: /^\w+:\/\/(?:www\.)?gfycat\.com\/(?:iframe\/)?(\w+)/, + el(a) { + const el = $$1.el('iframe', + {src: `//gfycat.com/ifr/${a.dataset.uid}`}); + el.setAttribute("allowfullscreen", "true"); + return el; + } + } + , { + key: 'Gist', + regExp: /^\w+:\/\/gist\.github\.com\/[\w\-]+\/(\w+)/, + style: '', + el: (function() { + let counter = 0; + return function(a) { + const el = $$1.el('pre', { + hidden: true, + id: `gist-embed-${counter++}` + } + ); + CrossOrigin$1.cache(`https://api.github.com/gists/${a.dataset.uid}`, function() { + el.textContent = Object.values(this.response.files)[0].content; + el.className = 'prettyprint'; + $$1.global(() => window.prettyPrint?.((function() {}), document.getElementById(document.currentScript.dataset.id).parentNode) + , {id: el.id}); + return el.hidden = false; + }); + return el; + }; + })(), + title: { + api(uid) { return `https://api.github.com/gists/${uid}`; }, + text({files}) { + for (var file in files) { if (files.hasOwnProperty(file)) { return file; } } + } + } + } + , { + key: 'InstallGentoo', + regExp: /^\w+:\/\/paste\.installgentoo\.com\/view\/(?:raw\/|download\/|embed\/)?(\w+)/, + el(a) { + return $$1.el('iframe', + {src: `https://paste.installgentoo.com/view/embed/${a.dataset.uid}`}); + } + } + , { + key: 'LiveLeak', + regExp: /^\w+:\/\/(?:\w+\.)?liveleak\.com\/.*\?.*[tif]=(\w+)/, + el(a) { + const el = $$1.el('iframe', + {src: `https://www.liveleak.com/e/${a.dataset.uid}`,}); + el.setAttribute("allowfullscreen", "true"); + return el; + } + } + , { + key: 'Loopvid', + regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/#?((?:pf|kd|lv|gd|gh|db|dx|nn|cp|wu|ig|ky|mf|m2|pc|1c|pi|ni|wl|ko|mm|ic|gc)\/[\w\-\/]+(?:,[\w\-\/]+)*|fc\/\w+\/\d+|https?:\/\/.+)/, + style: 'max-width: 80vw; max-height: 80vh;', + el(a) { + const el = $$1.el('video', { + controls: true, + preload: 'auto', + loop: true + } + ); + if (/^http/.test(a.dataset.uid)) { + $$1.add(el, $$1.el('source', {src: a.dataset.uid})); + return el; + } + const [_, host, names] = Array.from(a.dataset.uid.match(/(\w+)\/(.*)/)); + const types = (() => { switch (host) { + case 'gd': case 'wu': case 'fc': return ['']; + case 'gc': return ['giant', 'fat', 'zippy']; + default: return ['.webm', '.mp4']; + } })(); + for (var name of names.split(',')) { + for (var type of types) { + var base = `${name}${type}`; + var urls = (() => { switch (host) { + // list from src/common.py at http://loopvid.appspot.com/source.html + case 'pf': return [`https://kastden.org/_loopvid_media/pf/${base}`, `https://web.archive.org/web/2/http://a.pomf.se/${base}`]; + case 'kd': return [`https://kastden.org/loopvid/${base}`]; + case 'lv': return [`https://lv.kastden.org/${base}`]; + case 'gd': return [`https://docs.google.com/uc?export=download&id=${base}`]; + case 'gh': return [`https://googledrive.com/host/${base}`]; + case 'db': return [`https://dl.dropboxusercontent.com/u/${base}`]; + case 'dx': return [`https://dl.dropboxusercontent.com/${base}`]; + case 'nn': return [`https://kastden.org/_loopvid_media/nn/${base}`]; + case 'cp': return [`https://copy.com/${base}`]; + case 'wu': return [`http://webmup.com/${base}/vid.webm`]; + case 'ig': return [`https://i.imgur.com/${base}`]; + case 'ky': return [`https://kastden.org/_loopvid_media/ky/${base}`]; + case 'mf': return [`https://kastden.org/_loopvid_media/mf/${base}`, `https://web.archive.org/web/2/https://d.maxfile.ro/${base}`]; + case 'm2': return [`https://kastden.org/_loopvid_media/m2/${base}`]; + case 'pc': return [`https://kastden.org/_loopvid_media/pc/${base}`, `https://web.archive.org/web/2/http://a.pomf.cat/${base}`]; + case '1c': return [`http://b.1339.cf/${base}`]; + case 'pi': return [`https://kastden.org/_loopvid_media/pi/${base}`, `https://web.archive.org/web/2/https://u.pomf.is/${base}`]; + case 'ni': return [`https://kastden.org/_loopvid_media/ni/${base}`, `https://web.archive.org/web/2/https://u.nya.is/${base}`]; + case 'wl': return [`http://webm.land/media/${base}`]; + case 'ko': return [`https://kordy.kastden.org/loopvid/${base}`]; + case 'mm': return [`https://kastden.org/_loopvid_media/mm/${base}`, `https://web.archive.org/web/2/https://my.mixtape.moe/${base}`]; + case 'ic': return [`https://media.8ch.net/file_store/${base}`]; + case 'fc': return [`//${ImageHost.host()}/${base}.webm`]; + case 'gc': return [`https://${type}.gfycat.com/${name}.webm`]; + } })(); + + for (var url of urls) { + $$1.add(el, $$1.el('source', {src: url})); + } + } + } + return el; + } + } + , { + key: 'Openings.moe', + regExp: /^\w+:\/\/openings.moe\/\?video=([^.&=]+)/, + style: 'width: 1280px; height: 720px; max-width: 80vw; max-height: 80vh;', + el(a) { + const el = $$1.el('iframe', + {src: `https://openings.moe/?video=${a.dataset.uid}`,}); + el.setAttribute("allowfullscreen", "true"); + return el; + } + } + , { + key: 'Pastebin', + regExp: /^\w+:\/\/(?:\w+\.)?pastebin\.com\/(?!u\/)(?:[\w.]+(?:\/|\?i\=))?(\w+)/, + el(a) { + return $$1.el('iframe', + {src: `//pastebin.com/embed_iframe.php?i=${a.dataset.uid}`}); + } + } + , { + key: 'SoundCloud', + regExp: /^\w+:\/\/(?:www\.)?(?:soundcloud\.com\/|snd\.sc\/)([\w\-\/]+)/, + style: 'border: 0; width: 500px; height: 400px;', + el(a) { + return $$1.el('iframe', + {src: `https://w.soundcloud.com/player/?visual=true&show_comments=false&url=https%3A%2F%2Fsoundcloud.com%2F${encodeURIComponent(a.dataset.uid)}`}); + }, + title: { + api(uid) { return `${location.protocol}//soundcloud.com/oembed?format=json&url=https%3A%2F%2Fsoundcloud.com%2F${encodeURIComponent(uid)}`; }, + text(_) { return _.title; } + } + } + , { + key: 'StrawPoll', + regExp: /^\w+:\/\/(?:www\.)?strawpoll\.me\/(?:embed_\d+\/)?(\d+(?:\/r)?)/, + style: 'border: 0; width: 600px; height: 406px;', + el(a) { + return $$1.el('iframe', + {src: `https://www.strawpoll.me/embed_1/${a.dataset.uid}`}); + } + } + , { + key: 'Streamable', + regExp: /^\w+:\/\/(?:www\.)?streamable\.com\/(\w+)/, + el(a) { + const el = $$1.el('iframe', + {src: `https://streamable.com/o/${a.dataset.uid}`}); + el.setAttribute("allowfullscreen", "true"); + return el; + }, + title: { + api(uid) { return `https://api.streamable.com/oembed?url=https://streamable.com/${uid}`; }, + text(_) { return _.title; } + } + } + , { + key: 'TwitchTV', + regExp: /^\w+:\/\/(?:www\.|secure\.|clips\.|m\.)?twitch\.tv\/(\w[^#\&\?]*)/, + el(a) { + let url; + let m = a.dataset.href.match(/^\w+:\/\/(?:(clips\.)|\w+\.)?twitch\.tv\/(?:\w+\/)?(clip\/)?(\w[^#\&\?]*)/); + if (m[1] || m[2]) { + url = `//clips.twitch.tv/embed?clip=${m[3]}&parent=${location.hostname}`; + } else { + let time; + m = a.dataset.uid.match(/(\w+)(?:\/(?:v\/)?(\d+))?/); + url = `//player.twitch.tv/?${m[2] ? `video=v${m[2]}` : `channel=${m[1]}`}&autoplay=false&parent=${location.hostname}`; + if (time = a.dataset.href.match(/\bt=(\w+)/)) { + url += `&time=${time[1]}`; + } + } + const el = $$1.el('iframe', + {src: url}); + el.setAttribute("allowfullscreen", "true"); + return el; + } + } + , { + key: 'Twitter', + regExp: /^\w+:\/\/(?:www\.|mobile\.)?twitter\.com\/(\w+\/status\/\d+)/, + style: 'border: none; width: 550px; height: 250px; overflow: hidden; resize: both;', + el(a) { + const el = $$1.el('iframe'); + $$1.on(el, 'load', function() { + return this.contentWindow.postMessage({element: 't', query: 'height'}, 'https://twitframe.com'); + }); + var onMessage = function(e) { + if ((e.source === el.contentWindow) && (e.origin === 'https://twitframe.com')) { + $$1.off(window, 'message', onMessage); + return (cont || el).style.height = `${+$$1.minmax(e.data.height, 250, 0.8 * doc$1.clientHeight)}px`; + } + }; + $$1.on(window, 'message', onMessage); + el.src = `https://twitframe.com/show?url=https://twitter.com/${a.dataset.uid}`; + if ($$1.engine === 'gecko') { + // XXX https://bugzilla.mozilla.org/show_bug.cgi?id=680823 + el.style.cssText = 'border: none; width: 100%; height: 100%;'; + var cont = $$1.el('div'); + $$1.add(cont, el); + return cont; + } else { + return el; + } + } + } + , { + key: 'VidLii', + regExp: /^\w+:\/\/(?:www\.)?vidlii\.com\/watch\?v=(\w{11})/, + style: 'border: none; width: 640px; height: 392px;', + el(a) { + const el = $$1.el('iframe', + {src: `https://www.vidlii.com/embed?v=${a.dataset.uid}&a=0`}); + el.setAttribute("allowfullscreen", "true"); + return el; + } + } + , { + key: 'Vimeo', + regExp: /^\w+:\/\/(?:www\.)?vimeo\.com\/(\d+)/, + el(a) { + const el = $$1.el('iframe', + {src: `//player.vimeo.com/video/${a.dataset.uid}?wmode=opaque`}); + el.setAttribute("allowfullscreen", "true"); + return el; + }, + title: { + api(uid) { return `https://vimeo.com/api/oembed.json?url=https://vimeo.com/${uid}`; }, + text(_) { return _.title; } + } + } + , { + key: 'Vine', + regExp: /^\w+:\/\/(?:www\.)?vine\.co\/v\/(\w+)/, + style: 'border: none; width: 500px; height: 500px;', + el(a) { + return $$1.el('iframe', + {src: `https://vine.co/v/${a.dataset.uid}/card`}); + } + } + , { + key: 'Vocaroo', + regExp: /^\w+:\/\/(?:(?:www\.|old\.)?vocaroo\.com|voca\.ro)\/((?:i\/)?\w+)/, + style: '', + el(a) { + const el = $$1.el('iframe'); + el.width = 300; + el.height = 60; + el.setAttribute('frameborder', 0); + el.src = `https://vocaroo.com/embed/${a.dataset.uid.replace(/^i\//, '')}?autoplay=0`; + return el; + } + } + , { + key: 'YouTube', + regExp: /^\w+:\/\/(?:youtu.be\/|[\w.]*youtube[\w.]*\/.*(?:v=|\bembed\/|\bv\/|live\/))([\w\-]{11})(.*)/, + el(a) { + let start = a.dataset.options.match(/\b(?:star)?t\=(\w+)/); + if (start) { start = start[1]; } + if (start && !/^\d+$/.test(start)) { + start += ' 0h0m0s'; + start = (3600 * start.match(/(\d+)h/)[1]) + (60 * start.match(/(\d+)m/)[1]) + (1 * start.match(/(\d+)s/)[1]); + } + const el = $$1.el('iframe', + {src: `//www.youtube.com/embed/${a.dataset.uid}?rel=0&wmode=opaque${start ? '&start=' + start : ''}`}); + el.setAttribute("allowfullscreen", "true"); + return el; + }, + title: { + api(uid) { return `https://www.youtube.com/oembed?url=https%3A//www.youtube.com/watch%3Fv%3D${uid}&format=json`; }, + text(_) { return _.title; }, + status(_) { + if (_.error) { + const m = _.error.match(/^(\d*)\s*(.*)/); + return [+m[1], m[2]]; + } else { + return [200, 'OK']; + } + } + }, + preview: { + url(uid) { return `https://img.youtube.com/vi/${uid}/0.jpg`; }, + height: 360 + } + } + ] + }; + + /* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS205: Consider reworking code to avoid use of IIFEs + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + var Keybinds = { + init() { + if (!Conf['Keybinds']) { return; } + + for (var hotkey in Config.hotkeys) { + $$1.sync(hotkey, Keybinds.sync); + } + + var init = function() { + $$1.off(d$1, '4chanXInitFinished', init); + $$1.on(d$1, 'keydown', Keybinds.keydown); + for (var node of $$('[accesskey]')) { + node.removeAttribute('accesskey'); + } + }; + return $$1.on(d$1, '4chanXInitFinished', init); + }, + + sync(key, hotkey) { + return Conf[hotkey] = key; + }, + + keydown(e) { + let key, thread, threadRoot; + let catalog, notifications; + if (!(key = Keybinds.keyCode(e))) { return; } + const {target} = e; + if (['INPUT', 'TEXTAREA'].includes(target.nodeName)) { + if (!/(Esc|Alt|Ctrl|Meta|Shift\+\w{2,})/.test(key) || !!/^Alt\+(\d|Up|Down|Left|Right)$/.test(key)) { return; } + } + if (['index', 'thread'].includes(g.VIEW)) { + threadRoot = Nav.getThread(); + thread = Get$1.threadFromRoot(threadRoot); + } + switch (key) { + // QR & Options + case Conf['Toggle board list']: + if (!Conf['Custom Board Navigation']) { return; } + Header$1.toggleBoardList(); + break; + case Conf['Toggle header']: + Header$1.toggleBarVisibility(); + break; + case Conf['Open empty QR']: + if (!QR.postingIsEnabled) { return; } + Keybinds.qr(); + break; + case Conf['Open QR']: + if (!QR.postingIsEnabled || !threadRoot) { return; } + Keybinds.qr(threadRoot); + break; + case Conf['Open settings']: + Settings.open(); + break; + case Conf['Close']: + if (Settings.dialog) { + Settings.close(); + } else if ((notifications = $$('.notification')).length) { + for (var notification of notifications) { + $$1('.close', notification).click(); + } + } else if (QR.nodes && !(QR.nodes.el.hidden || (window.getComputedStyle(QR.nodes.form).display === 'none'))) { + if (Conf['Persistent QR']) { + QR.hide(); + } else { + QR.close(); + } + } else if (Embedding.lastEmbed) { + Embedding.closeFloat(); + } else { + return; + } + break; + case Conf['Spoiler tags']: + if (target.nodeName !== 'TEXTAREA') { return; } + Keybinds.tags('spoiler', target); + break; + case Conf['Code tags']: + if (target.nodeName !== 'TEXTAREA') { return; } + Keybinds.tags('code', target); + break; + case Conf['Eqn tags']: + if (target.nodeName !== 'TEXTAREA') { return; } + Keybinds.tags('eqn', target); + break; + case Conf['Math tags']: + if (target.nodeName !== 'TEXTAREA') { return; } + Keybinds.tags('math', target); + break; + case Conf['SJIS tags']: + if (target.nodeName !== 'TEXTAREA') { return; } + Keybinds.tags('sjis', target); + break; + case Conf['Toggle sage']: + if (!QR.nodes || !!QR.nodes.el.hidden) { return; } + Keybinds.sage(); + break; + case Conf['Toggle Cooldown']: + if (!QR.nodes || !!QR.nodes.el.hidden || !$$1.hasClass(QR.nodes.fileSubmit, 'custom-cooldown')) { return; } + QR.toggleCustomCooldown(); + break; + case Conf['Post from URL']: + if (!QR.postingIsEnabled) { return; } + QR.handleUrl(''); + break; + case Conf['Add new post']: + if (!QR.postingIsEnabled) { return; } + QR.addPost(); + break; + case Conf['Submit QR']: + if (!QR.nodes || !!QR.nodes.el.hidden) { return; } + if (!QR.status()) { QR.submit(); } + break; + // Index/Thread related + case Conf['Update']: + switch (g.VIEW) { + case 'thread': + if (!ThreadUpdater.enabled) { return; } + ThreadUpdater.update(); + break; + case 'index': + if (!Index$1.enabled) { return; } + Index$1.update(); + break; + default: + return; + } + break; + case Conf['Watch']: + if (!ThreadWatcher$1.enabled || !thread) { return; } + ThreadWatcher$1.toggle(thread); + break; + case Conf['Update thread watcher']: + if (!ThreadWatcher$1.enabled) { return; } + ThreadWatcher$1.buttonFetchAll(); + break; + case Conf['Toggle thread watcher']: + if (!ThreadWatcher$1.enabled) { return; } + ThreadWatcher$1.toggleWatcher(); + break; + case Conf['Toggle threading']: + if (!QuoteThreading.ready) { return; } + QuoteThreading.toggleThreading(); + break; + case Conf['Mark thread read']: + if ((g.VIEW !== 'index') || !thread || !UnreadIndex.enabled) { return; } + UnreadIndex.markRead.call(threadRoot); + break; + // Images + case Conf['Expand image']: + if (!ImageExpand.enabled || !threadRoot) { return; } + var post = Get$1.postFromNode(Keybinds.post(threadRoot)); + if (post.file) { ImageExpand.toggle(post); } + break; + case Conf['Expand images']: + if (!ImageExpand.enabled) { return; } + ImageExpand.cb.toggleAll(); + break; + case Conf['Open Gallery']: + if (!Gallery.enabled) { return; } + Gallery.cb.toggle(); + break; + case Conf['fappeTyme']: + if (!FappeTyme.nodes?.fappe) { return; } + FappeTyme.toggle('fappe'); + break; + case Conf['werkTyme']: + if (!FappeTyme.nodes?.werk) { return; } + FappeTyme.toggle('werk'); + break; + // Board Navigation + case Conf['Front page']: + if (Index$1.enabled) { + Index$1.userPageNav(1); + } else { + location.href = `/${g.BOARD}/`; + } + break; + case Conf['Open front page']: + $$1.open(`${location.origin}/${g.BOARD}/`); + break; + case Conf['Next page']: + if ((g.VIEW !== 'index') || !!g.SITE.isOnePage?.(g.BOARD)) { return; } + if (Index$1.enabled) { + if (!['paged', 'infinite'].includes(Conf['Index Mode'])) { return; } + $$1('.next button', Index$1.pagelist).click(); + } else { + $$1(g.SITE.selectors.nav.next)?.click(); + } + break; + case Conf['Previous page']: + if ((g.VIEW !== 'index') || !!g.SITE.isOnePage?.(g.BOARD)) { return; } + if (Index$1.enabled) { + if (!['paged', 'infinite'].includes(Conf['Index Mode'])) { return; } + $$1('.prev button', Index$1.pagelist).click(); + } else { + $$1(g.SITE.selectors.nav.prev)?.click(); + } + break; + case Conf['Search form']: + if (g.VIEW !== 'index') { return; } + var searchInput = Index$1.enabled ? + Index$1.searchInput + : g.SITE.selectors.searchBox ? + $$1(g.SITE.selectors.searchBox) + : + undefined; + if (!searchInput) { return; } + Header$1.scrollToIfNeeded(searchInput); + searchInput.focus(); + break; + case Conf['Paged mode']: + if (!Index$1.enabledOn(g.BOARD)) { return; } + location.href = g.VIEW === 'index' ? '#paged' : `/${g.BOARD}/#paged`; + break; + case Conf['Infinite scrolling mode']: + if (!Index$1.enabledOn(g.BOARD)) { return; } + location.href = g.VIEW === 'index' ? '#infinite' : `/${g.BOARD}/#infinite`; + break; + case Conf['All pages mode']: + if (!Index$1.enabledOn(g.BOARD)) { return; } + location.href = g.VIEW === 'index' ? '#all-pages' : `/${g.BOARD}/#all-pages`; + break; + case Conf['Open catalog']: + if (!(catalog = CatalogLinks.catalog())) { return; } + location.href = catalog; + break; + case Conf['Cycle sort type']: + if (!Index$1.enabled) { return; } + Index$1.cycleSortType(); + break; + // Thread Navigation + case Conf['Next thread']: + if ((g.VIEW !== 'index') || !threadRoot) { return; } + Nav.scroll(+1); + break; + case Conf['Previous thread']: + if ((g.VIEW !== 'index') || !threadRoot) { return; } + Nav.scroll(-1); + break; + case Conf['Expand thread']: + if ((g.VIEW !== 'index') || !threadRoot) { return; } + ExpandThread.toggle(thread); + // Keep thread from moving off screen when contracted. + Header$1.scrollTo(threadRoot); + break; + case Conf['Open thread']: + if ((g.VIEW !== 'index') || !threadRoot) { return; } + Keybinds.open(thread); + break; + case Conf['Open thread tab']: + if ((g.VIEW !== 'index') || !threadRoot) { return; } + Keybinds.open(thread, true); + break; + // Reply Navigation + case Conf['Next reply']: + if (!threadRoot) { return; } + Keybinds.hl(+1, threadRoot); + break; + case Conf['Previous reply']: + if (!threadRoot) { return; } + Keybinds.hl(-1, threadRoot); + break; + case Conf['Deselect reply']: + if (!threadRoot) { return; } + Keybinds.hl(0, threadRoot); + break; + case Conf['Hide']: + if (!thread || !ThreadHiding.db) { return; } + Header$1.scrollTo(threadRoot); + ThreadHiding.toggle(thread); + break; + case Conf['Quick Filter MD5']: + if (!threadRoot) { return; } + post = Keybinds.post(threadRoot); + Keybinds.hl(+1, threadRoot); + Filter.quickFilterMD5.call(post, e); + break; + case Conf['Previous Post Quoting You']: + if (!threadRoot || !QuoteYou.db) { return; } + QuoteYou.cb.seek('preceding'); + break; + case Conf['Next Post Quoting You']: + if (!threadRoot || !QuoteYou.db) { return; } + QuoteYou.cb.seek('following'); + break; + default: + return; + } + e.preventDefault(); + return e.stopPropagation(); + }, + + keyCode(e) { + let key = (() => { let kc; + switch ((kc = e.keyCode)) { + case 8: // return + return ''; + case 13: + return 'Enter'; + case 27: + return 'Esc'; + case 32: + return 'Space'; + case 37: + return 'Left'; + case 38: + return 'Up'; + case 39: + return 'Right'; + case 40: + return 'Down'; + case 188: + return 'Comma'; + case 190: + return 'Period'; + case 191: + return 'Slash'; + case 59: case 186: + return 'Semicolon'; + default: + if ((48 <= kc && kc <= 57) || (65 <= kc && kc <= 90)) { // 0-9, A-Z + return String.fromCharCode(kc).toLowerCase(); + } else if (96 <= kc && kc <= 105) { // numpad 0-9 + return String.fromCharCode(kc - 48).toLowerCase(); + } else { + return null; + } + } })(); + if (key) { + if (e.altKey) { key = 'Alt+' + key; } + if (e.ctrlKey) { key = 'Ctrl+' + key; } + if (e.metaKey) { key = 'Meta+' + key; } + if (e.shiftKey) { key = 'Shift+' + key; } + } + return key; + }, + + post(thread) { + const s = g.SITE.selectors; + return ( + $$1(`${s.postContainer}${s.highlightable.reply}.${g.SITE.classes.highlight}`, thread) || + $$1(`${g.SITE.isOPContainerThread ? s.thread : s.postContainer}${s.highlightable.op}`, thread) + ); + }, + + qr(thread) { + QR.open(); + if (thread != null) { + QR.quote.call(Keybinds.post(thread)); + } + return QR.nodes.com.focus(); + }, + + tags(tag, ta) { + BoardConfig.ready(function() { + const {config} = g.BOARD; + const supported = (() => { switch (tag) { + case 'spoiler': return !!config.spoilers; + case 'code': return !!config.code_tags; + case 'math': case 'eqn': return !!config.math_tags; + case 'sjis': return !!config.sjis_tags; + } })(); + if (!supported) { return new Notice('warning', `[${tag}] tags are not supported on /${g.BOARD}/.`, 20); } + }); + + const { + value + } = ta; + const selStart = ta.selectionStart; + const selEnd = ta.selectionEnd; + + ta.value = + value.slice(0, selStart) + + `[${tag}]` + value.slice(selStart, selEnd) + `[/${tag}]` + + value.slice(selEnd); + + // Move the caret to the end of the selection. + const range = (`[${tag}]`).length + selEnd; + ta.setSelectionRange(range, range); + + // Fire the 'input' event + return $$1.event('input', null, ta); + }, + + sage() { + const isSage = /sage/i.test(QR.nodes.email.value); + return QR.nodes.email.value = isSage ? + "" + : "sage"; + }, + + open(thread, tab) { + if (g.VIEW !== 'index') { return; } + const url = Get$1.url('thread', thread); + if (tab) { + return $$1.open(url); + } else { + return location.href = url; + } + }, + + hl(delta, thread) { + const replySelector = `${g.SITE.selectors.postContainer}${g.SITE.selectors.highlightable.reply}`; + const {highlight} = g.SITE.classes; + + const postEl = $$1(`${replySelector}.${highlight}`, thread); + + if (!delta) { + if (postEl) { $$1.rmClass(postEl, highlight); } + return; + } + + if (postEl) { + const {height} = postEl.getBoundingClientRect(); + if ((Header$1.getTopOf(postEl) >= -height) && (Header$1.getBottomOf(postEl) >= -height)) { // We're at least partially visible + let next; + const {root} = Get$1.postFromNode(postEl).nodes; + const axis = delta === +1 ? + 'following' + : + 'preceding'; + if (!(next = $$1.x(`${axis}-sibling::${g.SITE.xpath.replyContainer}[not(@hidden) and not(child::div[@class='stub'])][1]`, root))) { return; } + if (!next.matches(replySelector)) { next = $$1(replySelector, next); } + Header$1.scrollToIfNeeded(next, delta === +1); + $$1.addClass(next, highlight); + $$1.rmClass(postEl, highlight); + return; + } + $$1.rmClass(postEl, highlight); + } + + const replies = $$(replySelector, thread); + if (delta === -1) { replies.reverse(); } + for (var reply of replies) { + if (((delta === +1) && (Header$1.getTopOf(reply) > 0)) || ((delta === -1) && (Header$1.getBottomOf(reply) > 0))) { + $$1.addClass(reply, highlight); + return; + } + } + } + }; + + const Captcha = { + Cache: { + init() { + $$1.on(d$1, 'SaveCaptcha', e => { + return this.saveAPI(e.detail); + }); + return $$1.on(d$1, 'NoCaptcha', e => { + return this.noCaptcha(e.detail); + }); + }, + + captchas: [], + + getCount() { + return this.captchas.length; + }, + + neededRaw() { + return !( + this.haveCookie() || this.captchas.length || QR.req || this.submitCB + ) && ( + (QR.posts.length > 1) || Conf['Auto-load captcha'] || !QR.posts[0].isOnlyQuotes() || QR.posts[0].file + ); + }, + + needed() { + return this.neededRaw() && $$1.event('LoadCaptcha'); + }, + + prerequest() { + if (!Conf['Prerequest Captcha']) { return; } + // Post count temporarily off by 1 when called from QR.post.rm, QR.close, or QR.submit + return $$1.queueTask(() => { + if ( + !this.prerequested && + this.neededRaw() && + !$$1.event('LoadCaptcha') && + !QR.captcha.occupied() && + (QR.cooldown.seconds <= 60) && + (QR.selected === QR.posts[QR.posts.length - 1]) && + !QR.selected.isOnlyQuotes() + ) { + const isReply = (QR.selected.thread !== 'new'); + if (!$$1.event('RequestCaptcha', { isReply })) { + this.prerequested = true; + this.submitCB = captcha => { + if (captcha) { return this.save(captcha); } + }; + return this.updateCount(); + } + } + }); + }, + + haveCookie() { + return /\b_ct=/.test(d$1.cookie) && (QR.posts[0].thread !== 'new'); + }, + + getOne() { + let captcha; + delete this.prerequested; + this.clear(); + if (captcha = this.captchas.shift()) { + this.count(); + return captcha; + } else { + return null; + } + }, + + request(isReply) { + if (!this.submitCB) { + if ($$1.event('RequestCaptcha', { isReply })) { return; } + } + return cb => { + this.submitCB = cb; + return this.updateCount(); + }; + }, + + abort() { + if (this.submitCB) { + delete this.submitCB; + $$1.event('AbortCaptcha'); + return this.updateCount(); + } + }, + + saveAPI(captcha) { + let cb; + if (cb = this.submitCB) { + delete this.submitCB; + cb(captcha); + return this.updateCount(); + } else { + return this.save(captcha); + } + }, + + noCaptcha(detail) { + let cb; + if (cb = this.submitCB) { + if (!this.haveCookie() || detail?.error) { + QR.error(detail?.error || 'Failed to retrieve captcha.'); + QR.captcha.setup(d$1.activeElement === QR.nodes.status); + } + delete this.submitCB; + cb(); + return this.updateCount(); + } + }, + + save(captcha) { + let cb; + if (cb = this.submitCB) { + this.abort(); + cb(captcha); + return; + } + this.captchas.push(captcha); + this.captchas.sort((a, b) => a.timeout - b.timeout); + return this.count(); + }, + + clear() { + if (this.captchas.length) { + let i; + const now = Date.now(); + for (i = 0; i < this.captchas.length; i++) { + var captcha = this.captchas[i]; + if (captcha.timeout > now) { break; } + } + if (i) { + this.captchas = this.captchas.slice(i); + return this.count(); + } + } + }, + + count() { + clearTimeout(this.timer); + if (this.captchas.length) { + this.timer = setTimeout(this.clear.bind(this), this.captchas[0].timeout - Date.now()); + } + return this.updateCount(); + }, + + updateCount() { + return $$1.event('CaptchaCount', this.captchas.length); + } + }, Replace: CaptchaReplace, t: CaptchaT, v2: { + lifetime: 2 * MINUTE, + + init() { + if (d$1.cookie.indexOf('pass_enabled=1') >= 0) { return; } + if (!(this.isEnabled = !!$$1('#g-recaptcha, #captcha-forced-noscript') || !$$1.id('postForm'))) { return; } + + if (this.noscript = Conf['Force Noscript Captcha'] || !Main$1.jsEnabled) { + $$1.addClass(QR.nodes.el, 'noscript-captcha'); + } + + Captcha.cache.init(); + $$1.on(d$1, 'CaptchaCount', this.count.bind(this)); + + const root = $$1.el('div', { className: 'captcha-root' }); + $$1.extend(root, { + innerHTML: + '
              ' + } + ); + const counter = $$1('.captcha-counter > a', root); + this.nodes = { root, counter }; + this.count(); + $$1.addClass(QR.nodes.el, 'has-captcha', 'captcha-v2'); + $$1.after(QR.nodes.com.parentNode, root); + + $$1.on(counter, 'click', this.toggle.bind(this)); + $$1.on(counter, 'keydown', e => { + if (Keybinds.keyCode(e) !== 'Space') { return; } + this.toggle(); + e.preventDefault(); + return e.stopPropagation(); + }); + return $$1.on(window, 'captcha:success', () => { + // XXX Greasemonkey 1.x workaround to gain access to GM_* functions. + return $$1.queueTask(() => this.save(false)); + }); + }, + + timeouts: {}, + prevNeeded: 0, + + noscriptURL() { + let lang; + let url = `https://www.google.com/recaptcha/api/fallback?k=${meta.recaptchaKey}`; + if (lang = Conf['captchaLanguage'].trim()) { + url += `&hl=${encodeURIComponent(lang)}`; + } + return url; + }, + + moreNeeded() { + // Post count temporarily off by 1 when called from QR.post.rm, QR.close, or QR.submit + return $$1.queueTask(() => { + const needed = Captcha.cache.needed(); + if (needed && !this.prevNeeded) { + this.setup(QR.cooldown.auto && (d$1.activeElement === QR.nodes.status)); + } + return this.prevNeeded = needed; + }); + }, + + toggle() { + if (this.nodes.container && !this.timeouts.destroy) { + return this.destroy(); + } else { + return this.setup(true, true); + } + }, + + setup(focus, force) { + if (!this.isEnabled || (!Captcha.cache.needed() && !force)) { return; } + + if (focus) { + $$1.addClass(QR.nodes.el, 'focus'); + this.nodes.counter.focus(); + } + + if (this.timeouts.destroy) { + clearTimeout(this.timeouts.destroy); + delete this.timeouts.destroy; + return this.reload(); + } + + if (this.nodes.container) { + // XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1226835 + $$1.queueTask(() => { + let iframe; + if (this.nodes.container && (d$1.activeElement === this.nodes.counter) && (iframe = $$1('iframe[src^="https://www.google.com/recaptcha/"]', this.nodes.container))) { + iframe.focus(); + return QR.focus(); + } + }); // Event handler not fired in Firefox + return; + } + + this.nodes.container = $$1.el('div', { className: 'captcha-container' }); + $$1.prepend(this.nodes.root, this.nodes.container); + new MutationObserver(this.afterSetup.bind(this)).observe(this.nodes.container, { + childList: true, + subtree: true + } + ); + + if (this.noscript) { + return this.setupNoscript(); + } else { + return this.setupJS(); + } + }, + + setupNoscript() { + const iframe = $$1.el('iframe', { + id: 'qr-captcha-iframe', + scrolling: 'no', + src: this.noscriptURL() + } + ); + const div = $$1.el('div'); + const textarea = $$1.el('textarea'); + $$1.add(div, textarea); + return $$1.add(this.nodes.container, [iframe, div]); + }, + + setupJS() { + return $$1.global(function () { + const render = function () { + const { classList } = document.documentElement; + const container = document.querySelector('#qr .captcha-container'); + return container.dataset.widgetID = window.grecaptcha.render(container, { + sitekey: meta.recaptchaKey, + theme: classList.contains('tomorrow') || classList.contains('spooky') || classList.contains('dark-captcha') ? 'dark' : 'light', + callback(response) { + return window.dispatchEvent(new CustomEvent('captcha:success', { detail: response })); + } + } + ); + }; + if (window.grecaptcha) { + return render(); + } else { + const cbNative = window.onRecaptchaLoaded; + window.onRecaptchaLoaded = function () { + render(); + return cbNative(); + }; + if (!document.head.querySelector('script[src^="https://www.google.com/recaptcha/api.js"]')) { + const script = document.createElement('script'); + script.src = 'https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoaded&render=explicit'; + return document.head.appendChild(script); + } + } + }); + }, + + afterSetup(mutations) { + for (var mutation of mutations) { + for (var node of mutation.addedNodes) { + var iframe, textarea; + if (iframe = $$1.x('./descendant-or-self::iframe[starts-with(@src, "https://www.google.com/recaptcha/")]', node)) { this.setupIFrame(iframe); } + if (textarea = $$1.x('./descendant-or-self::textarea', node)) { this.setupTextArea(textarea); } + } + } + }, + + setupIFrame(iframe) { + let needle; + if (!doc.contains(iframe)) { return; } + Captcha.replace.iframe(iframe); + $$1.addClass(QR.nodes.el, 'captcha-open'); + this.fixQRPosition(); + $$1.on(iframe, 'load', this.fixQRPosition); + if (d$1.activeElement === this.nodes.counter) { iframe.focus(); } + // XXX Make sure scroll on space prevention (see src/css/style.css) doesn't cause scrolling of div + if (['blink', 'edge'].includes($$1.engine) && (needle = iframe.parentNode, $$('#qr .captcha-container > div > div:first-of-type').includes(needle))) { + return $$1.on(iframe.parentNode, 'scroll', function () { return this.scrollTop = 0; }); + } + }, + + fixQRPosition() { + if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) { + QR.nodes.el.style.top = ''; + return QR.nodes.el.style.bottom = '0px'; + } + }, + + setupTextArea(textarea) { + return $$1.one(textarea, 'input', () => this.save(true)); + }, + + destroy() { + if (!this.isEnabled) { return; } + delete this.timeouts.destroy; + $$1.rmClass(QR.nodes.el, 'captcha-open'); + if (this.nodes.container) { + $$1.global(function () { + const container = document.querySelector('#qr .captcha-container'); + return window.grecaptcha.reset(container.dataset.widgetID); + }); + $$1.rm(this.nodes.container); + return delete this.nodes.container; + } + }, + + getOne(isReply) { + return Captcha.cache.getOne(isReply); + }, + + save(pasted, token) { + Captcha.cache.save({ + response: token || $$1('textarea', this.nodes.container).value, + timeout: Date.now() + this.lifetime + }); + + const focus = (d$1.activeElement?.nodeName === 'IFRAME') && /https?:\/\/www\.google\.com\/recaptcha\//.test(d$1.activeElement.src); + if (Captcha.cache.needed()) { + if (focus) { + if (QR.cooldown.auto || Conf['Post on Captcha Completion']) { + this.nodes.counter.focus(); + } else { + QR.nodes.status.focus(); + } + } + this.reload(); + } else { + if (pasted) { + this.destroy(); + } else { + if (this.timeouts.destroy == null) { this.timeouts.destroy = setTimeout(this.destroy.bind(this), 3 * SECOND); } + } + if (focus) { QR.nodes.status.focus(); } + } + + if (Conf['Post on Captcha Completion'] && !QR.cooldown.auto) { return QR.submit(); } + }, + + count() { + const count = Captcha.cache.getCount(); + const loading = Captcha.cache.submitCB ? '...' : ''; + this.nodes.counter.textContent = `Captchas: ${count}${loading}`; + return this.moreNeeded(); + }, + + reload() { + if ($$1('iframe[src^="https://www.google.com/recaptcha/api/fallback?"]', this.nodes.container)) { + this.destroy(); + return this.setup(false, true); + } else { + return $$1.global(function () { + const container = document.querySelector('#qr .captcha-container'); + return window.grecaptcha.reset(container.dataset.widgetID); + }); + } + }, + + occupied() { + return !!this.nodes.container && !this.timeouts.destroy; + } + } + }; + + /* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * DS202: Simplify dynamic range loops + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md + */ + + var QR = { + mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/vnd.adobe.flash.movie', 'application/x-shockwave-flash', 'video/webm'], + + validExtension: /\.(jpe?g|png|gif|pdf|swf|webm)$/i, + + typeFromExtension: { + 'jpg': 'image/jpeg', + 'jpeg': 'image/jpeg', + 'png': 'image/png', + 'gif': 'image/gif', + 'pdf': 'application/pdf', + 'swf': 'application/vnd.adobe.flash.movie', + 'webm': 'video/webm' + }, + + extensionFromType: { + 'image/jpeg': 'jpg', + 'image/png': 'png', + 'image/gif': 'gif', + 'application/pdf': 'pdf', + 'application/vnd.adobe.flash.movie': 'swf', + 'application/x-shockwave-flash': 'swf', + 'video/webm': 'webm' + }, + + init() { + let sc; + if (!Conf['Quick Reply']) { return; } + + this.posts = []; + + $$1.on(d$1, '4chanXInitFinished', () => BoardConfig.ready(QR.initReady)); + + Callbacks.Post.push({ + name: 'Quick Reply', + cb: this.node + }); + + this.shortcut = (sc = $$1.el('a', { + className: 'disabled', + textContent: '↩', + title: 'Quick Reply', + href: 'javascript:;' + } + )); + $$1.on(sc, 'click', function() { + if (!QR.postingIsEnabled) { return; } + if (Conf['Persistent QR'] || !QR.nodes || QR.nodes.el.hidden) { + QR.open(); + return QR.nodes.com.focus(); + } else { + return QR.close(); + } + }); + + return Header$1.addShortcut('qr', sc, 540); + }, + + initReady() { + let origToggle; + const captchaVersion = $$1('#g-recaptcha, #captcha-forced-noscript') ? 'v2' : 't'; + QR.captcha = Captcha[captchaVersion]; + QR.postingIsEnabled = true; + + const {config} = g.BOARD; + const prop = (key, def) => +(config[key] ?? def); + + QR.min_width = prop('min_image_width', 1); + QR.min_height = prop('min_image_height', 1); + QR.max_width = (QR.max_height = 10000); + + QR.max_size = prop('max_filesize', 4194304); + QR.max_size_video = prop('max_webm_filesize', QR.max_size); + QR.max_comment = prop('max_comment_chars', 2000); + + QR.max_width_video = (QR.max_height_video = 2048); + QR.max_duration_video = prop('max_webm_duration', 120); + + QR.forcedAnon = !!config.forced_anon; + QR.spoiler = !!config.spoilers; + + if (origToggle = $$1.id('togglePostFormLink')) { + const link = $$1.el('h1', + {className: "qr-link-container"}); + $$1.extend(link, { + innerHTML: + `${g.VIEW === "thread" ? "Reply to Thread" : "Start a Thread"}` + }); + + QR.link = link.firstElementChild; + $$1.on(link.firstChild, 'click', function() { + QR.open(); + return QR.nodes.com.focus(); + }); + + $$1.before(origToggle, link); + origToggle.firstElementChild.textContent = 'Original Form'; + } + + if (g.VIEW === 'thread') { + let navLinksBot; + const linkBot = $$1.el('div', + {className: "brackets-wrap qr-link-container-bottom"}); + $$1.extend(linkBot, {innerHTML: 'Reply to Thread'}); + + $$1.on(linkBot.firstElementChild, 'click', function() { + QR.open(); + return QR.nodes.com.focus(); + }); + + if (navLinksBot = $$1('.navLinksBot')) { $$1.prepend(navLinksBot, linkBot); } + } + + $$1.on(d$1, 'QRGetFile', QR.getFile); + $$1.on(d$1, 'QRDrawFile', QR.drawFile); + $$1.on(d$1, 'QRSetFile', QR.setFile); + + $$1.on(d$1, 'paste', QR.paste); + $$1.on(d$1, 'dragover', QR.dragOver); + $$1.on(d$1, 'drop', QR.dropFile); + $$1.on(d$1, 'dragstart dragend', QR.drag); + + $$1.on(d$1, 'IndexRefreshInternal', QR.generatePostableThreadsList); + $$1.on(d$1, 'ThreadUpdate', QR.statusCheck); + + if (!Conf['Persistent QR']) { return; } + QR.open(); + if (Conf['Auto Hide QR']) { return QR.hide(); } + }, + + statusCheck() { + if (!QR.nodes) { return; } + const {thread} = QR.posts[0]; + if ((thread !== 'new') && g.threads.get(`${g.BOARD}.${thread}`).isDead) { + return QR.abort(); + } else { + return QR.status(); + } + }, + + node() { + $$1.on(this.nodes.quote, 'click', QR.quote); + if (this.isFetchedQuote) { return QR.generatePostableThreadsList(); } + }, + + open() { + if (QR.nodes) { + if (QR.nodes.el.hidden) { QR.captcha.setup(); } + QR.nodes.el.hidden = false; + QR.unhide(); + } else { + try { + QR.dialog(); + } catch (err) { + delete QR.nodes; + Main$1.handleErrors({ + message: 'Quick Reply dialog creation crashed.', + error: err + }); + return; + } + } + return $$1.rmClass(QR.shortcut, 'disabled'); + }, + + close() { + if (QR.req) { + QR.abort(); + return; + } + QR.nodes.el.hidden = true; + QR.cleanNotifications(); + QR.blur(); + $$1.rmClass(QR.nodes.el, 'dump'); + $$1.addClass(QR.shortcut, 'disabled'); + new QR.post(true); + for (var post of QR.posts.splice(0, QR.posts.length - 1)) { + post.delete(); + } + QR.cooldown.auto = false; + QR.status(); + return QR.captcha.destroy(); + }, + + focus() { + return $$1.queueTask(function() { + if (!QR.inBubble()) { + QR.hasFocus = d$1.activeElement && QR.nodes.el.contains(d$1.activeElement); + return QR.nodes.el.classList.toggle('focus', QR.hasFocus); + } + }); + }, + + inBubble() { + const bubbles = $$('iframe[src^="https://www.google.com/recaptcha/api2/frame"]'); + return bubbles.includes(d$1.activeElement) || bubbles.some(el => (getComputedStyle(el).visibility !== 'hidden') && (el.getBoundingClientRect().bottom > 0)); + }, + + hide() { + QR.blur(); + $$1.addClass(QR.nodes.el, 'autohide'); + return QR.nodes.autohide.checked = true; + }, + + unhide() { + $$1.rmClass(QR.nodes.el, 'autohide'); + return QR.nodes.autohide.checked = false; + }, + + toggleHide() { + if (this.checked) { + return QR.hide(); + } else { + return QR.unhide(); + } + }, + + blur() { + if (QR.nodes.el.contains(d$1.activeElement)) { return d$1.activeElement.blur(); } + }, + + toggleSJIS(e) { + e.preventDefault(); + Conf['sjisPreview'] = !Conf['sjisPreview']; + $$1.set('sjisPreview', Conf['sjisPreview']); + return QR.nodes.el.classList.toggle('sjis-preview', Conf['sjisPreview']); + }, + + texPreviewShow() { + if ($$1.hasClass(QR.nodes.el, 'tex-preview')) { return QR.texPreviewHide(); } + $$1.addClass(QR.nodes.el, 'tex-preview'); + QR.nodes.texPreview.textContent = QR.nodes.com.value; + return $$1.event('mathjax', null, QR.nodes.texPreview); + }, + + texPreviewHide() { + return $$1.rmClass(QR.nodes.el, 'tex-preview'); + }, + + addPost() { + const wasOpen = (QR.nodes && !QR.nodes.el.hidden); + QR.open(); + if (wasOpen) { + $$1.addClass(QR.nodes.el, 'dump'); + new QR.post(true); + } + return QR.nodes.com.focus(); + }, + + setCustomCooldown(enabled) { + Conf['customCooldownEnabled'] = enabled; + QR.cooldown.customCooldown = enabled; + return QR.nodes.customCooldown.classList.toggle('disabled', !enabled); + }, + + toggleCustomCooldown() { + const enabled = $$1.hasClass(QR.nodes.customCooldown, 'disabled'); + QR.setCustomCooldown(enabled); + return $$1.set('customCooldownEnabled', enabled); + }, + + error(err, focusOverride) { + let el; + QR.open(); + if (typeof err === 'string') { + el = $$1.tn(err); + } else { + el = err; + el.removeAttribute('style'); + } + const notice = new Notice('warning', el); + QR.notifications.push(notice); + if (!Header$1.areNotificationsEnabled) { + if (d$1.hidden && !QR.cooldown.auto) { return alert(el.textContent); } + } else if (d$1.hidden || !(focusOverride || d$1.hasFocus())) { + const notif = new Notification(el.textContent, { + body: el.textContent, + icon: Favicon.logo + } + ); + notif.onclick = () => window.focus(); + if ($$1.engine !== 'gecko') { + // Firefox automatically closes notifications + // so we can't control the onclose properly. + notif.onclose = () => notice.close(); + return notif.onshow = () => setTimeout(function() { + notif.onclose = null; + return notif.close(); + } + , 7 * SECOND); + } + } + }, + + connectionError() { + return $$1.el('span', + { innerHTML: + 'Connection error while posting. ' + + '[More info]' + } + ); + }, + + notifications: [], + + cleanNotifications() { + for (var notification of QR.notifications) { + notification.close(); + } + return QR.notifications = []; + }, + + status() { + let disabled, value; + if (!QR.nodes) { return; } + const {thread} = QR.posts[0]; + if ((thread !== 'new') && g.threads.get(`${g.BOARD}.${thread}`).isDead) { + value = 'Dead'; + disabled = true; + QR.cooldown.auto = false; + } + + value = QR.req ? + QR.req.progress + : + QR.cooldown.seconds || value; + + const {status} = QR.nodes; + status.value = !value ? + 'Submit' + : QR.cooldown.auto ? + `Auto ${value}` + : + value; + return status.disabled = disabled || false; + }, + + openPost() { + QR.open(); + if (QR.selected.isLocked) { + const index = QR.posts.indexOf(QR.selected); + (QR.posts[index+1] || new QR.post()).select(); + $$1.addClass(QR.nodes.el, 'dump'); + return QR.cooldown.auto = true; + } + }, + + quote(e) { + let range; + e?.preventDefault(); + if (!QR.postingIsEnabled) { return; } + const sel = d$1.getSelection(); + const post = Get$1.postFromNode(this); + const {root} = post.nodes; + const postRange = new Range(); + postRange.selectNode(root); + let text = post.board.ID === g.BOARD.ID ? `>>${post}\n` : `>>>/${post.board}/${post}\n`; + for (let i = 0, end = sel.rangeCount, asc = 0 <= end; asc ? i < end : i > end; asc ? i++ : i--) { + try { + var insideCode, node; + range = sel.getRangeAt(i); + // Trim range to be fully inside post + if (range.compareBoundaryPoints(Range.START_TO_START, postRange) < 0) { + range.setStartBefore(root); + } + if (range.compareBoundaryPoints(Range.END_TO_END, postRange) > 0) { + range.setEndAfter(root); + } + + if (!range.toString().trim()) { continue; } + + var frag = range.cloneContents(); + var ancestor = range.commonAncestorContainer; + // Quoting the insides of a spoiler/code tag. + if ($$1.x('ancestor-or-self::*[self::s or contains(@class,"removed-spoiler")]', ancestor)) { + $$1.prepend(frag, $$1.tn('[spoiler]')); + $$1.add(frag, $$1.tn('[/spoiler]')); + } + if (insideCode = $$1.x('ancestor-or-self::pre[contains(@class,"prettyprint")]', ancestor)) { + $$1.prepend(frag, $$1.tn('[code]')); + $$1.add(frag, $$1.tn('[/code]')); + } + for (node of $$((insideCode ? 'br' : '.prettyprint br'), frag)) { + $$1.replace(node, $$1.tn('\n')); + } + for (node of $$('br', frag)) { + if (node !== frag.lastChild) { $$1.replace(node, $$1.tn('\n>')); } + } + g.SITE.insertTags?.(frag); + for (node of $$('.linkify[data-original]', frag)) { + $$1.replace(node, $$1.tn(node.dataset.original)); + } + for (node of $$('.embedder', frag)) { + if (node.previousSibling?.nodeValue === ' ') { $$1.rm(node.previousSibling); } + $$1.rm(node); + } + text += `>${frag.textContent.trim()}\n`; + } catch (error) { } + } + + QR.openPost(); + const {com, thread} = QR.nodes; + if (!com.value) { thread.value = Get$1.threadFromNode(this); } + + const wasOnlyQuotes = QR.selected.isOnlyQuotes(); + + const caretPos = com.selectionStart; + // Replace selection for text. + com.value = com.value.slice(0, caretPos) + text + com.value.slice(com.selectionEnd); + // Move the caret to the end of the new quote. + range = caretPos + text.length; + com.setSelectionRange(range, range); + com.focus(); + + // This allows us to determine if any text other than quotes has been typed. + if (wasOnlyQuotes) { QR.selected.quotedText = com.value; } + + QR.selected.save(com); + return QR.selected.save(thread); + }, + + characterCount() { + const counter = QR.nodes.charCount; + const count = QR.nodes.com.value.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, '_').length; + counter.textContent = count; + counter.hidden = count < (QR.max_comment/2); + return (count > QR.max_comment ? $$1.addClass : $$1.rmClass)(counter, 'warning'); + }, + + getFile() { + return $$1.event('QRFile', QR.selected?.file); + }, + + drawFile(e) { + const file = QR.selected?.file; + if (!file || !/^(image|video)\//.test(file.type)) { return; } + const isVideo = /^video\//.test(file); + const el = $$1.el((isVideo ? 'video' : 'img')); + $$1.on(el, 'error', () => QR.openError()); + $$1.on(el, (isVideo ? 'loadeddata' : 'load'), function() { + e.target.getContext('2d').drawImage(el, 0, 0); + URL.revokeObjectURL(el.src); + return $$1.event('QRImageDrawn', null, e.target); + }); + return el.src = URL.createObjectURL(file); + }, + + openError() { + const div = $$1.el('div'); + $$1.extend(div, { + innerHTML: + 'Could not open file. [More info]' + }); + return QR.error(div); + }, + + setFile(e) { + const {file, name, source} = e.detail; + if (name != null) { file.name = name; } + if (source != null) { file.source = source; } + QR.open(); + return QR.handleFiles([file]); + }, + + drag(e) { + // Let it drag anything from the page. + const toggle = e.type === 'dragstart' ? $$1.off : $$1.on; + toggle(d$1, 'dragover', QR.dragOver); + return toggle(d$1, 'drop', QR.dropFile); + }, + + dragOver(e) { + e.preventDefault(); + return e.dataTransfer.dropEffect = 'copy'; + }, // cursor feedback + + dropFile(e) { + // Let it only handle files from the desktop. + if (!e.dataTransfer.files.length) { return; } + e.preventDefault(); + QR.open(); + return QR.handleFiles(e.dataTransfer.files); + }, + + paste(e) { + if (!e.clipboardData.items) { return; } + let file = null; + let score = -1; + for (var item of e.clipboardData.items) { + var file2; + if ((item.kind === 'file') && (file2 = item.getAsFile())) { + var score2 = (2*(file2.size <= QR.max_size)) + (file2.type === 'image/png'); + if (score2 > score) { + file = file2; + score = score2; + } + } + } + if (file) { + const {type} = file; + const blob = new Blob([file], {type}); + blob.name = `${Conf['pastedname']}.${$$1.getOwn(QR.extensionFromType, type) || 'jpg'}`; + QR.open(); + QR.handleFiles([blob]); + $$1.addClass(QR.nodes.el, 'dump'); + } + }, + + pasteFF() { + const {pasteArea} = QR.nodes; + if (!pasteArea.childNodes.length) { return; } + const images = $$('img', pasteArea); + $$1.rmAll(pasteArea); + for (var img of images) { + var m; + var {src} = img; + if (m = src.match(/data:(image\/(\w+));base64,(.+)/)) { + var bstr = atob(m[3]); + var arr = new Uint8Array(bstr.length); + for (var i = 0, end = bstr.length, asc = 0 <= end; asc ? i < end : i > end; asc ? i++ : i--) { + arr[i] = bstr.charCodeAt(i); + } + var blob = new Blob([arr], {type: m[1]}); + blob.name = `${Conf['pastedname']}.${m[2]}`; + QR.handleFiles([blob]); + } else if (/^https?:\/\//.test(src)) { + QR.handleUrl(src); + } + } + }, + + handleUrl(urlDefault) { + QR.open(); + QR.selected.preventAutoPost(); + return CrossOrigin$1.permission(function() { + const url = prompt('Enter a URL:', urlDefault); + if (url === null) { return; } + QR.nodes.fileButton.focus(); + return CrossOrigin$1.file(url, function(blob) { + if (blob && !/^text\//.test(blob.type)) { + return QR.handleFiles([blob]); + } else { + return QR.error("Can't load file."); + } + }); + }); + }, + + handleFiles(files) { + if (this !== QR) { // file input + files = [...Array.from(this.files)]; + this.value = null; + } + if (!files.length) { return; } + QR.cleanNotifications(); + for (var file of files) { + QR.handleFile(file, files.length); + } + if (files.length !== 1) { $$1.addClass(QR.nodes.el, 'dump'); } + if ((d$1.activeElement === QR.nodes.fileButton) && $$1.hasClass(QR.nodes.fileSubmit, 'has-file')) { + return QR.nodes.filename.focus(); + } + }, + + handleFile(file, nfiles) { + let post; + const isText = /^text\//.test(file.type); + if (nfiles === 1) { + post = QR.selected; + } else { + post = QR.posts[QR.posts.length - 1]; + if (isText ? post.com || post.pasting : post.file) { + post = new QR.post(); + } + } + return post[isText ? 'pasteText' : 'setFile'](file); + }, + + openFileInput() { + if (QR.nodes.fileButton.disabled) { return; } + QR.nodes.fileInput.click(); + return QR.nodes.fileButton.focus(); + }, + + generatePostableThreadsList() { + if (!QR.nodes) { return; } + const list = QR.nodes.thread; + const options = [list.firstElementChild]; + for (var thread of g.BOARD.threads.keys) { + options.push($$1.el('option', { + value: thread, + textContent: `Thread ${thread}` + } + ) + ); + } + const val = list.value; + $$1.rmAll(list); + $$1.add(list, options); + list.value = val; + if (list.value === val) { return; } + // Fix the value if the option disappeared. + list.value = g.VIEW === 'thread' ? + g.THREADID + : + 'new'; + return (g.VIEW === 'thread' ? $$1.addClass : $$1.rmClass)(QR.nodes.el, 'reply-to-thread'); + }, + + dialog() { + let dialog, event, nodes; + let name; + QR.nodes = (nodes = { + el: (dialog = UI.dialog('qr', + { innerHTML: QuickReplyPage })) + }); + + const setNode = (name, query) => nodes[name] = $$1(query, dialog); + + setNode('move', '.move'); + setNode('autohide', '#autohide'); + setNode('close', '.close'); + setNode('thread', 'select'); + setNode('form', 'form'); + setNode('sjisToggle', '#sjis-toggle'); + setNode('texButton', '#tex-preview-button'); + setNode('name', '[data-name=name]'); + setNode('email', '[data-name=email]'); + setNode('sub', '[data-name=sub]'); + setNode('com', '[data-name=com]'); + setNode('charCount', '#char-count'); + setNode('texPreview', '#tex-preview'); + setNode('dumpList', '#dump-list'); + setNode('addPost', '#add-post'); + setNode('oekaki', '.oekaki'); + setNode('drawButton', '#qr-draw-button'); + setNode('fileSubmit', '#file-n-submit'); + setNode('fileButton', '#qr-file-button'); + setNode('noFile', '#qr-no-file'); + setNode('filename', '#qr-filename'); + setNode('spoiler', '#qr-file-spoiler'); + setNode('oekakiButton', '#qr-oekaki-button'); + setNode('fileRM', '#qr-filerm'); + setNode('urlButton', '#url-button'); + setNode('pasteArea', '#paste-area'); + setNode('customCooldown', '#custom-cooldown-button'); + setNode('dumpButton', '#dump-button'); + setNode('status', '[type=submit]'); + setNode('flashTag', '[name=filetag]'); + setNode('fileInput', '[type=file]'); + + const {config} = g.BOARD; + const {classList} = QR.nodes.el; + classList.toggle('forced-anon', QR.forcedAnon); + classList.toggle('has-spoiler', QR.spoiler); + classList.toggle('has-sjis', !!config.sjis_tags); + classList.toggle('has-math', !!config.math_tags); + classList.toggle('sjis-preview', !!config.sjis_tags && Conf['sjisPreview']); + classList.toggle('show-new-thread-option', Conf['Show New Thread Option in Threads']); + + if (parseInt(Conf['customCooldown'], 10) > 0) { + $$1.addClass(QR.nodes.fileSubmit, 'custom-cooldown'); + $$1.get('customCooldownEnabled', Conf['customCooldownEnabled'], function({customCooldownEnabled}) { + QR.setCustomCooldown(customCooldownEnabled); + return $$1.sync('customCooldownEnabled', QR.setCustomCooldown); + }); + } + + QR.flagsInput(); + + $$1.on(nodes.autohide, 'change', QR.toggleHide); + $$1.on(nodes.close, 'click', QR.close); + $$1.on(nodes.status, 'click', QR.submit); + $$1.on(nodes.form, 'submit', QR.submit); + $$1.on(nodes.sjisToggle, 'click', QR.toggleSJIS); + $$1.on(nodes.texButton, 'mousedown', QR.texPreviewShow); + $$1.on(nodes.texButton, 'mouseup', QR.texPreviewHide); + $$1.on(nodes.addPost, 'click', () => new QR.post(true)); + $$1.on(nodes.drawButton, 'click', QR.oekaki.draw); + $$1.on(nodes.fileButton, 'click', QR.openFileInput); + $$1.on(nodes.noFile, 'click', QR.openFileInput); + $$1.on(nodes.filename, 'focus', function() { return $$1.addClass(this.parentNode, 'focus'); }); + $$1.on(nodes.filename, 'blur', function() { return $$1.rmClass(this.parentNode, 'focus'); }); + $$1.on(nodes.spoiler, 'change', () => QR.selected.nodes.spoiler.click()); + $$1.on(nodes.oekakiButton, 'click', QR.oekaki.button); + $$1.on(nodes.fileRM, 'click', () => QR.selected.rmFile()); + $$1.on(nodes.urlButton, 'click', () => QR.handleUrl('')); + $$1.on(nodes.customCooldown, 'click', QR.toggleCustomCooldown); + $$1.on(nodes.dumpButton, 'click', () => nodes.el.classList.toggle('dump')); + $$1.on(nodes.fileInput, 'change', QR.handleFiles); + + window.addEventListener('focus', QR.focus, true); + window.addEventListener('blur', QR.focus, true); + // We don't receive blur events from captcha iframe. + $$1.on(d$1, 'click', QR.focus); + + // XXX Workaround for image pasting in Firefox, obsolete as of v50. + // https://bugzilla.mozilla.org/show_bug.cgi?id=906420 + if (($$1.engine === 'gecko') && !window.DataTransferItemList) { + nodes.pasteArea.hidden = false; + } + new MutationObserver(QR.pasteFF).observe(nodes.pasteArea, {childList: true}); + + // save selected post's data + const items = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'flag']; + let i = 0; + const save = function() { return QR.selected.save(this); }; + while ((name = items[i++])) { + var node; + if (!(node = nodes[name])) { continue; } + event = node.nodeName === 'SELECT' ? 'change' : 'input'; + $$1.on(nodes[name], event, save); + } + + // XXX Blink and WebKit treat width and height of