カテゴリ別 2003年 | 2004年 | 2005年 | 2006年 | 2007年 | 2008年
知り合いサイト: よんだもの / 暴想 / Linuxでやる夫 / 新宿Vipper / 僕だけが幸せになればいいのに。
Mozilla 1.6 Alpha Releasedメーラ周りが強化されたようです。それと about:about とアドレス欄にいれると、about:* の一覧が見れるとか。
1.6a features many Mail & Newsgroups improvements
解き放てEmEditorユーザー その3 / 858練習がてらこれをコメントレスにしてみました。ロジックは同じ、長さは 2 倍。
//InsertLineComment.jsee 選択範囲をコメント化します。
// commentRegion.jsee
function isSelected() {
var mode = document.selection.Mode;
if ((mode & eeModeMask) == eeModeNone){
return false;
}
return true;
}
function getCommentStrMap() {
var map = new Object();
map['Bat'] = "rem";
map['C#'] = "//";
map['C++'] = "//";
map['Java'] = "//";
map['JavaScript'] = "//";
map['JavaScript for EmEditor'] = "//";
map['PHP'] = "//";
map['VBScript'] = "'";
map['VBScript for EmEditor'] = "'";
map['Perl'] = "#";
map['Python'] = "#";
map['Ruby'] = "#";
map['SQL'] = "--";
map['TeX'] = "%";
return map;
}
function getCommentStr() {
var map = getCommentStrMap();
var type = document.ConfigName;
str = map[type];
if (!str){
str = "";
}
return str;
}
function getSelectedLineRegion(){
var selection = Document.selection;
var bottomPointX = selection.GetBottomPointX(eePosLogical);
var topPointY = selection.GetTopPointY(eePosLogical);
var bottomPointY = selection.GetBottomPointY(eePosLogical);
if (bottomPointX < 2){
bottomPointY--;
}
var ret = new Object();
ret['top'] = topPointY;
ret['bottom'] = bottomPointY;
return ret;
}
function doCommentRegion(top, bottom, commentStr){
for (var i = top; i <= bottom; i++){
Document.selection.SetActivePoint(eePosLogical, 1, i);
Document.selection.Text = commentStr;
}
}
function commentRegion(){
if (!isSelected()){
return;
}
var commentStr = getCommentStr();
if (commentStr.length < 1){
return;
}
var region = getSelectedLineRegion();
var top = region['top'];
var bottom = region['bottom'];
doCommentRegion(top, bottom, commentStr);
}
commentRegion();
最近のコメント:
RSS
![]()
This work is licensed under a
Creative Commons License
(note: text only. w/o web design, citations, (re)distributed softwares).