Skip to content

Instantly share code, notes, and snippets.

@ucnv
Created February 15, 2009 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ucnv/64755 to your computer and use it in GitHub Desktop.
Save ucnv/64755 to your computer and use it in GitHub Desktop.
--- 30_Tombloo.Service.js 2009-02-15 21:26:10.000000000 +0900
+++ 30_Tombloo.Service.js.modified 2009-02-16 01:21:21.000000000 +0900
@@ -37,6 +37,8 @@
if(ps.type == 'quote'&& ctx.window.getSelection().rangeCount)
ctx.window.getSelection().collapseToStart();
+ if(ctx.window['ps'] && ctx.window['ps'].type == ps.type) ps = ctx.window['ps'];
+
debug(ps);
if(!ps)
@@ -107,7 +109,7 @@
}
if(errs.length)
- self.alertError(errs.join('\n'), ps.page, ps.pageUrl);
+ self.alertError(errs.join('\n'), ps.page, ps.pageUrl, ps);
}).addErrback(function(err){
self.alertError(err, ps.page, ps.pageUrl);
});
@@ -151,11 +153,14 @@
* @param {String} page エラー発生ページタイトル。
* @param {String} pageUrl エラー発生ページURL。
*/
- alertError : function(msg, page, pageUrl){
+ alertError : function(msg, page, pageUrl, ps){
error(msg);
+ var stash = (ps)? (function(win) {
+ win['ps'] = ps;
+ }) : (function() {});
if(confirm(getMessage('error.post', this.reprError(msg).indent(8), page, pageUrl))){
- addTab(pageUrl);
+ addTab(pageUrl).addCallback(stash);
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment