// ==UserScript== // @name Tumblr-image-sorter-get // @description Format file name & save path for current image by its tags // @version 1.3.1.0 // @author Seedmanc // @namespace https://github.com/Seedmanc/Tumblr-image-sorter // @include http*://*.amazonaws.com/data.tumblr.com/* // @include http*://*.media.tumblr.com/* //these sites were used by animage.tumblr.com to host original images // @include http://scenario.myweb.hinet.net/* // @include http*://mywareroom.files.wordpress.com/* // @include http://e.blog.xuite.net/* // @include http://voice.x.fc2.com/* // @grant none // @require https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js // @require https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js // @require https://greasyfork.org/scripts/11847-swfstore/code/SwfStore.js?version=77621 // @require https://greasyfork.org/scripts/11848-downloadify-clip/code/Downloadify%20+%20Clip.js?version=68937 // @run-at document-start // @noframes // @downloadURL https://update.greasyfork.icu/scripts/11846/Tumblr-image-sorter-get.user.js // @updateURL https://update.greasyfork.icu/scripts/11846/Tumblr-image-sorter-get.meta.js // ==/UserScript== // ==Settings===================================================== var root= 'E:\\#-A\\!Seiyuu\\'; //Main collection folder //Make sure to use double backslashes instead of single ones everywhere var ms= '!'; //Metasymbol, denotes folders for categories instead of names, must be their first character var folders= { //Folder and names matching database " !!group " : " !!group ", // used both for tag translation and providing the list of existing folders " !!solo " : " !!solo ", // trailing whitespaces are voluntary in both keys and values, " !!unsorted" : " !!unsorted ", // first three key names are not to be changed, but folder names can be anything " 原由実 " : " !iM@S\\Hara Yumi", // subfolders for categories instead of names must have the metasymbol as first symbol " 今井麻美 " : " !iM@S\\Imai Asami ", " 沼倉愛美 " : " !iM@S\\Numakura Manami", " けいおん! " : " !K-On ", //Category folders can have their own tag, which, if present, will affect the folder choice " 日笠陽子 " : " !K-On\\Hikasa Yoko ", // for solo and group images " 寿美菜子 " : " !K-On\\Kotobuki Minako", " 竹達彩奈 " : " !K-On\\Taketatsu Ayana", " 豊崎愛生 " : " !K-On\\Toyosaki Aki ", " クリスマス " : " !Kurisumasu ", " Lisp " : " !Lisp ", //Roman tags can be used as well " 阿澄佳奈 " : " !Lisp\\Asumi Kana ", " 酒井香奈子 " : " !Lovedoll\\Sakai Kanako", " らき☆すた " : " !Lucky Star ", " 遠藤綾 " : " !Lucky Star\\Endo Aya ", " 福原香織 " : " !Lucky Star\\Fukuhara Kaori", " 長谷川静香 " : " !Lucky Star\\Hasegawa Shizuka", " 加藤英美里 " : " !Lucky Star\\Kato Emiri ", " 今野宏美 " : " !Lucky Star\\Konno Hiromi ", " 井上麻里奈 " : " !Minami-ke\\Inoue Marina ", " 佐藤利奈 " : " !Minami-ke\\Sato Rina ", " Petit Milady ": " !Petit Milady ", " 悠木碧 " : " !Petit Milady\\Yuuki Aoi ", " ロウきゅーぶ! " : " !Ro-Kyu-Bu ", " Kalafina " : " !Singer\\Kalafina ", " LiSA " : " !Singer\\LiSA ", " May'n " : " !Singer\\May'n ", " 茅原実里 " : " !SOS-dan\\Chihara Minori", " 後藤邑子 " : " !SOS-dan\\Goto Yuko ", " 平野綾 " : " !SOS-dan\\Hirano Aya ", " スフィア " : " !Sphere ", " やまとなでしこ " : " !Yamato Nadeshiko ", " 堀江由衣 " : " !Yamato Nadeshiko\\Horie Yui", " 田村ゆかり " : " !Yamato Nadeshiko\\Tamura Yukari", " 雨宮天 " : " Amamiya Sora ", " 千葉紗子 " : " Chiba Saeko ", " 渕上舞 " : " Fuchigami Mai ", " 藤田咲 " : " Fujita Saki ", " 後藤沙緒里 " : " Goto Saori ", " 花澤香菜 " : " Hanazawa Kana ", " 早見沙織 " : " Hayami Saori ", " 井口裕香 " : " Iguchi Yuka ", " 井上喜久子 " : " Inoue Kikuko ", " 伊藤かな恵 " : " Ito Kanae ", " 伊藤静 " : " Ito Shizuka ", " 門脇舞以 " : " Kadowaki Mai ", " 金元寿子 " : " Kanemoto Hisako ", " 茅野愛衣 " : " Kayano Ai ", " 喜多村英梨 " : " Kitamura Eri ", " 小林ゆう " : " Kobayashi Yuu ", " 小清水亜美 " : " Koshimizu Ami ", " 釘宮理恵 " : " Kugimiya Rie ", " 宮崎羽衣 " : " Miyazaki Ui ", " 水樹奈々 " : " Mizuki Nana ", " 桃井はるこ " : " Momoi Haruko ", " 中原麻衣 " : " Nakahara Mai ", " 中島愛 " : " Nakajima Megumi ", " 名塚佳織 " : " Nazuka Kaori ", " 野川さくら " : " Nogawa Sakura ", " 野中藍 " : " Nonaka Ai ", " 能登麻美子 " : " Noto Mamiko ", " 折笠富美子 " : " Orikasa Fumiko ", " 朴璐美 " : " Paku Romi ", " 榊原ゆい " : " Sakakibara Yui ", " 坂本真綾 " : " Sakamoto Maaya ", " 佐倉綾音 " : " Sakura Ayane ", " 沢城みゆき " : " Sawashiro Miyuki ", " 椎名へきる " : " Shiina Hekiru ", " 清水愛 " : " Shimizu Ai ", " 下田麻美 " : " Shimoda Asami ", " 新谷良子 " : " Shintani Ryoko ", " 白石涼子 " : " Shiraishi Ryoko ", " 田中理恵 " : " Tanaka Rie ", " 丹下桜 " : " Tange Sakura ", " 東山奈央 " : " Toyama Nao ", " 植田佳奈 " : " Ueda Kana ", " 上坂すみれ " : " Uesaka Sumire ", " ゆかな " : " Yukana " }; var ignore= "歌手, seiyuu, 声優"; //These tags will not count towards any category and won't be included into filename var allowUnicode= false; //Whether to allow unicode characters in manual translation input, not tested var useFolderNames= true; //In addition to tags listed in keys of the folders object, recognize also folder names themselves // this way you won't have to provide both roman and kanji spellings for names as separate tags var debug= false; //Initial debug state, affects creation of flashDBs. Value saved in the DB overrides it after DB init. var storeUrl= '//dl.dropboxusercontent.com/u/74005421/js%20requisites/storage.swf'; //Flash databases are bound to the URL, must be same as in the other script // ==/Settings========================================================= tagsDB=null; //Makes sure databases are accessible from console for debugging names=null ; meta=null ; var title; var filename; var folder = ''; var DBrec=''; //Raw DB record, stringified object with fields for saved flag and tag list var N=M=T=false; //Flags indicating readiness of plugins loaded simultaneously var exclrgxp=/%|\/|:|\||>|<|\?|"|\*/g; //Pattern of characters not to be used in filepaths var downloadifySwf= '//dl.dropboxusercontent.com/u/74005421/js%20requisites/downloadify.swf'; //Flash button URL var style={ //In an object so you can fold it in any decent editor. If only you had that in chrome. s:" \ div#output { \ position: absolute; \ left: 0; top: 0; \ width: 100px; height: 30px; \ } \ div#down { \ left: 1px; \ position: fixed; \ z-index: 98; \ } \ table#port { \ top: 30px; \ left: 1px; \ position: fixed; \ background-color: \ rgba(192,192,192,0.85); \ border-bottom: 1px solid black; \ z-index: 97; \ width: 100px; \ border-collapse: collapse; \ } \ table#translations { \ position: absolute; \ background-color: \ rgba(255,255,255,0.8); \ top: 48px; \ overflow: scroll; \ font-size: 90%; \ margin-left: -1px; \ width: 103px; \ table-layout: fixed; \ } \ td.settings { \ border-left: 1px solid black; \ border-right: 1px solid black; \ } \ a.settings { \ text-decoration: none; \ } \ table, tr { \ text-align: center; \ } \ td#ex { \ padding: 0; \ } \ input.txt { \ width: 95%; \ } \ td.cell, td.radio{ \ border: 1px solid black; \ overflow: hidden; \ } \ table.cell { \ background-color: \ rgba(255,255,255,0.75); \ width: 100%; \ border-collapse: collapse; \ } \ a { \ font-family: Arial; \ font-size: small; \ } \ th { \ border: 0; \ color:black; \ } \ input#submit { \ width: 98%; \ height: 29px; \ } \ "}; //This certainly needs optimisation var out=$('
\ | \ | ||||
';
//Each cell has the following in it:
// two radiobuttons to choose a category for the tag - name or meta
// the tag itself, either in roman or in kanji
// the tag is also a link, clicking which removes the tag from results until refresh
// if the tag is in kanji, cell has a text field to input translation manually
// if there are also roman tags, they are used as options for quick input into the text field
// if the tag is in roman and consists of two words, cell has a button enabled to swap their order
// otherwise the button is disabled
var tfoot=$(' \
\
| \
|
'+swp+' |