export pdf local ok

This commit is contained in:
life
2015-12-21 23:25:36 +08:00
parent 743e752d08
commit 73584c8ff1
10 changed files with 1907 additions and 3 deletions

17
node_modules/leanote_protocol.js generated vendored
View File

@@ -25,7 +25,21 @@ var leanoteProtocol = {
callback();
}
});
}
else {
// js, 请求, 导出pdf
// leanote://public/a.js
console.log(url);
var prefix = 'leanote://public';
// leanote://public/libs/MathJax/MathJax.js?config=TeX-AMS_HTML Failed to load resource: net::ERR_FILE_NOT_FOUND
if (url.substr(0, prefix.length) == prefix) {
var path = process.cwd() + url.substr('leanote:/'.length);
if (path.indexOf('?') >= 0) {
path = path.substr(0, path.indexOf('?'));
}
callback({path: path});
}
}
// var url = request.url.substr(7);
// callback({path: '/Users/life/Desktop/newicon/blog@2x.png'});
@@ -37,6 +51,7 @@ var leanoteProtocol = {
});
// });
}
}
module.exports = leanoteProtocol;