Skip to content

Commit

Permalink
维护
Browse files Browse the repository at this point in the history
  • Loading branch information
defpt committed Sep 6, 2014
1 parent 6edaa47 commit a3e8141
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,5 @@
* [ReadLater2.uc.js](https://github.com/defpt/userChromeJs/blob/master/ReadLater2.uc.js) 标记链接或当前网页以便稍后阅读
* [TabPlus.uc.js](https://github.com/defpt/userChromeJs/blob/master/TabPlus.uc.js) 自用标签增强,整合多个功能,我的必备脚本之一
* [Updatebookmarklite.uc.js](https://github.com/defpt/userChromeJs/blob/master/Updatebookmarklite.uc.js) 用来更新书签网址、名称
* [UserCSSLoader.uc.js](https://github.com/defpt/userChromeJs/blob/master/UserCSSLoader.uc.js) 自用微改版样式管理,已经改用扩展,以后不再维护
* [UserScriptLoader.uc.js](https://github.com/defpt/userChromeJs/blob/master/UserScriptLoader.uc.js) 自用微改 uc 版油猴脚本加载器,已经改用扩展,以后不再维护
* [openImgRar.uc.js](https://github.com/defpt/userChromeJs/blob/master/openImgRar.uc.js) 解密内涵图,已集成在addmenuplus脚本配置中
* [rebuild_userChrome.uc.xul](https://github.com/defpt/userChromeJs/blob/master/rebuild_userChrome.uc.xul) 自用 UC 管理器,工具栏固定图标,精简了菜单,我的必备脚本之一
* [Example](https://github.com/defpt/userChromeJs/blob/master/Example) 学习UC脚本笔记以及范例收藏
10 changes: 5 additions & 5 deletions contextSearcher.uc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// @author Griever
// @include main
// @compatibility Firefox 4
// @version 基于原版 v0.0.8
// @version 基于原版 v0.0.9
// @note 修改自用版:添加搜索完成后自动清空搜索栏并切回默认搜索引擎
// ==/UserScript==

Expand All @@ -19,8 +19,8 @@ window.contextSearcher = {

_regexp: {
hiragana: "[\\u3040-\\u309F]+",
katakana: "[\\u30A0-\\u30FA\\u30FC]+",
kanji : "[\\u4E00-\\u9FA0]+",
katakana: "[\\u30A0-\\u30FA\\u30FC-\\u30FE]+",
kanji : "[\\u3005\\u4E00-\\u9FA0]+",
suuji : "[0-9_./,%-]+",
eisu_han: "\\w[\\w\\-]*",
eisu_zen: "[\\uFF41-\\uFF5A\\uFF21-\\uFF3A\\uFF10-\\uFF19]+",
Expand Down Expand Up @@ -48,9 +48,9 @@ window.contextSearcher = {
var c = aChar.charCodeAt(0);
//if (c >= 0x30 && c <= 0x39) return "suuji";
if (c >= 0x30 && c <= 0x39 || c >= 0x41 && c <= 0x5A || c >= 0x61 && c <= 0x7A || c === 0x5F) return "eisu_han";
if (c >= 0x30A0 && c <= 0x30FA || c === 0x30FC) return "katakana";
if (c >= 0x30A0 && c <= 0x30FA || c >= 0x30FC && c <= 0x30FE) return "katakana";
if (c >= 0x3040 && c <= 0x309F) return "hiragana";
if (c >= 0x4E00 && c <= 0x9FA0) return "kanji";
if (c >= 0x4E00 && c <= 0x9FA0 || c === 0x3005) return "kanji";
if (c >= 0xFF41 && c <= 0x9F5A || c >= 0xFF21 && c <= 0xFF3A || c >= 0xFF10 && c <= 0xFF19) return "eisu_zen";
if (c >= 0xFF00 && c <= 0xFFEF) return "hankaku";
if (c >= 0x1100 && c <= 0x11FF || c >= 0xAC00 && c <= 0xD7AF || c >= 0x3130 && c <= 0x318F) return "hangul";
Expand Down
20 changes: 10 additions & 10 deletions openImgRar.uc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ location == "chrome://browser/content/browser.xul" && (function () {
(function (m) {
m.id = "openImgRar";
m.addEventListener("command", function () {
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
try {
var path = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getCharPref("browser.cache.disk.parent_directory") + "\\Cache\\" + new Date().getTime() + ".rar";
file.initWithPath(path);
} catch (e) {
var path = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("ProfLD", Components.interfaces.nsILocalFile).path + "\\Cache\\" + new Date().getTime() + ".rar";
}
file.initWithPath(path);
Components.classes["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"].createInstance(Components.interfaces.nsIWebBrowserPersist).saveURI(Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService).newURI((gContextMenu.mediaURL || gContextMenu.imageURL), null, null), null, null, null, null, file, null);
setTimeout(function () {
var imageUrl = (gContextMenu.mediaURL || gContextMenu.imageURL);
imageUrl = imageUrl.replace(/\.jpg\.thumb\.jpg$/, '.jpg');

var file = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties).get("TmpD", Ci.nsILocalFile);
file.append(new Date().getTime() + ".rar");

Cc["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"].createInstance(Ci.nsIWebBrowserPersist)
.saveURI(Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService)
.newURI(imageUrl, null, null), null, null, null, null, file, null);
setTimeout(function() {
file.launch();
}, 100);
}, false);
Expand Down

0 comments on commit a3e8141

Please sign in to comment.