diff options
| author | Atul Patel (OpenERP) <atp@tinyerp.com> | 2011-06-16 12:28:49 +0530 |
|---|---|---|
| committer | Atul Patel (OpenERP) <atp@tinyerp.com> | 2011-06-16 12:28:49 +0530 |
| commit | 1aaff7c466a8512a6dc5baddb2f1132d697b2702 (patch) | |
| tree | a503dd6c276e24a3beaff9faf3487dae47122d52 /addons/thunderbird/plugin/openerp_plugin | |
| parent | 5fea7ec991bee31f780e1f723e7b07d583a22d1f (diff) | |
[IMP]: More optimized solution
bzr revid: atp@tinyerp.com-20110616065849-7wn217nura6xzbmk
Diffstat (limited to 'addons/thunderbird/plugin/openerp_plugin')
| -rw-r--r-- | addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar | bin | 71855 -> 71871 bytes | |||
| -rw-r--r-- | addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/exportTools.js | 14 | ||||
| -rw-r--r-- | addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.js | 19 |
3 files changed, 9 insertions, 24 deletions
diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar Binary files differindex 9841e6f2246..50f2fd5184a 100644 --- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/exportTools.js b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/exportTools.js index ca1ad856930..64d1f1077f4 100644 --- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/exportTools.js +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/exportTools.js @@ -151,16 +151,10 @@ function getPredefinedFolder(type) { var dirService = Components.classes["@mozilla.org/file/directory_service;1"]. getService(Components.interfaces.nsIProperties).get("Home", Components.interfaces.nsIFile); var homeDir = dirService.path; - var dir_path=""; - if(navigator.userAgent.indexOf('Linux')!= -1){ - dir_path =homeDir+"/" - } - else if(navigator.userAgent.indexOf('Win')!= -1){ - dir_path =homeDir+"\\" - } - else if(navigator.userAgent.indexOf('Mac OS X')!= -1){ - dir_path ="/tmp" - } + var dir_path = ((homeDir.search(/\\/) != -1) ? homeDir + "\\" : homeDir + "/") + if(navigator.userAgent.indexOf('Mac OS X')!= -1){ + dir_path ="/tmp/" + } try { var localFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); localFile.initWithPath(dir_path); diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.js b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.js index 889fbc47cc2..c69de7035ec 100644 --- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.js +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.js @@ -41,6 +41,7 @@ function searchmail() var dirService = Components.classes["@mozilla.org/file/directory_service;1"].
getService(Components.interfaces.nsIProperties).get("Home", Components.interfaces.nsIFile);
var homeDir = dirService.path;
+ var path = ((homeDir.search(/\\/) != -1) ? homeDir + "\\" : homeDir + "/")
var version_obj = prefService.getBranch("extensions.");
version_obj.QueryInterface(Components.interfaces.nsIPrefBranch2);
version = version_obj.getCharPref("lastAppVersion");
@@ -151,13 +152,8 @@ function searchmail() url[i] = currentAttachments[i].url;
name[i] = currentAttachments[i].displayName;
var obj = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
- if(navigator.userAgent.indexOf('Linux')!= -1){
- obj.initWithPath(homeDir+"/");
- }
- else if(navigator.userAgent.indexOf('Win')!= -1){
- obj.initWithPath(homeDir+"\\");
- }
- else if(navigator.userAgent.indexOf('Mac OS X')!= -1){
+ obj.initWithPath(path)
+ if(navigator.userAgent.indexOf('Mac OS X')!= -1){
obj.initWithPath("/tmp/");
}
else{
@@ -341,13 +337,8 @@ function parse_eml(){ var dirService = Components.classes["@mozilla.org/file/directory_service;1"].
getService(Components.interfaces.nsIProperties).get("Home", Components.interfaces.nsIFile);
var homeDir = dirService.path;
- if(navigator.userAgent.indexOf('Linux')!= -1){
- fpath =homeDir+"/"
- }
- else if(navigator.userAgent.indexOf('Win')!= -1){
- fpath =homeDir+"\\"
- }
- else if(navigator.userAgent.indexOf('Mac OS X')!= -1){
+ fpath = ((homeDir.search(/\\/) != -1) ? homeDir + "\\" : homeDir + "/")
+ if(navigator.userAgent.indexOf('Mac OS X')!= -1){
fpath ="/tmp/"
}
name = fpath + getPref().getCharPref('fname') +".eml"
|
