Last active
August 29, 2015 13:57
-
-
Save so-c/9369368 to your computer and use it in GitHub Desktop.
Mirror House Annex更新用ユーティリティ。サクラエディタで動作。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 台詞を発言者を現すクラスを指定したタグで括る。 | |
* 事前条件:双司の台詞と希の台詞が空行を挟んで交互に並んでいること。 | |
* | |
* 1:双司の台詞 | |
* 2:空行 | |
* 3:希の台詞 | |
* ... | |
* 2n+1: 双司の台詞 | |
* 2n+2: 空行 | |
* 2n+3: 希の台詞 | |
* ... | |
*/ | |
(function(){ | |
var lineCounts = Editor.GetLineCount(0), | |
soshiStartTag = "<div class=\"kakko soshi\">", | |
nozomiStartTag ="<div class=\"kakko nozomi\">" , | |
endTag = "</div>", | |
i; | |
Editor.TextWrapMethod(0); // 0:折り返さない | |
Editor.GoFileTop( ); | |
for (i = 0; i < lineCounts; i += 2) { | |
Editor.GoLineTop(1); | |
if (i % 4 === 0) { | |
Editor.InsText(soshiStartTag); | |
} | |
if (i % 4 === 2) { | |
Editor.InsText(nozomiStartTag); | |
} | |
Editor.GoLineEnd(); | |
Editor.InsText(endTag); | |
Editor.Down2( ); | |
} | |
}()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment