[CLEAN] cleaning the plugin

bzr revid: mva@openerp.com-20111223102253-yievl616vlyx85kf
This commit is contained in:
MVA
2011-12-23 11:22:53 +01:00
parent fb306bd2bb
commit 32bffc2330
10 changed files with 18 additions and 23 deletions
Binary file not shown.
@@ -4,7 +4,7 @@
<!DOCTYPE window SYSTEM "chrome://openerp_plugin/locale/create.dtd">
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
title="&title.label;" onload="load_createContact();" height="250" width="400">
title="&title.label;" onload="load_createContact();" >
<script type="text/javascript" src="chrome://openerp_plugin/content/js/tiny_xmlrpc.js"></script>
<script type="text/javascript" src="chrome://openerp_plugin/content/js/tools.js"></script>
<script type="text/javascript" src="chrome://openerp_plugin/content/js/create.js"></script>
@@ -2,12 +2,7 @@ function load_contact_dialog() {
log_message("load contact dialog")
}
function load_document(){
log_message("ceci est un test");
log_message(getPreference('statutdoc'));
log_message("fin de test");
if (getPreference('statutdoc')=='open'){
document.getElementById('open_document').hidden=false;
document.getElementById('open').hidden=true;
@@ -18,3 +13,8 @@ function load_document(){
}
}
function message_setlabel(){
log_message(getPreference('subject'));
document.getElementById('message_label').value=getPreference('subject');
}
@@ -162,16 +162,12 @@ var listDocumentHandler = {
log_message("open document")
window.open('chrome://openerp_plugin/content/push_dialog.xul', '', 'chrome', resizable='yes');
if(res[RES_ID]==0) {
//alert("Document is not available.");
//document.getElementById('message_label').setAttribute('value', 'No document was found');
setPreference('statutdoc','create');
}
else {
setPreference('statutdoc', 'open');
//open_url(res[URL]);
}
setPreference('urldoc', res[URL]);
}
},
onFault: function (client, ctxt, fault) {
log_message(fault);
@@ -40,7 +40,6 @@ function clear_search_box(element) {
}
}
function open_url(url) {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger);
@@ -12,20 +12,20 @@
<menubar id="mail-menubar" >
<menu insertafter="messageMenu" id="menu_openerp" label="&openerpMenu.label;" accesskey="&openerpMenu.accesskey;">
<menupopup id="taskPopup">
<menuitem id="tiny-openpartner" label="contact"
<menuitem id="tiny-openpartner" label="Contact"
oncommand="check(open_partner);"
image="&menuicon.value;"
class="menuitem-iconic"
tooltiptext="&openpartnertooltip.value;"
/>
<menuitem id="tiny-opendocument" label="document"
<menuitem id="tiny-opendocument" label="Documents"
oncommand="check(open_document);"
image="&menuicon.value;"
class="menuitem-iconic"
tooltiptext="&opendocumenttooltip.value;"
/>
<menuitem id="tiny-plugin3" label="&tinyplugin;"
<menuitem id="tiny-plugin3" label="Configuration"
oncommand="window.open('chrome://openerp_plugin/content/config.xul', '', 'chrome', 'resizable=yes');"
image="&menuicon.settings;"
class="menuitem-iconic"
@@ -28,8 +28,7 @@
</menulist>
</row>
<row>
<label id="lblex3" align="right" width="135" control="section" value="Operation :" class="text-prompt"/>
<menulist id="operation" width="150" oncommand="changeForm()">
<menulist id="operation" hidden="true" width="150" oncommand="changeForm()">
<menupopup>
<menuitem label="Attach to an existing one" value="add"/>
</menupopup>
@@ -1,22 +1,22 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!-- Extremely recommended to keep this css include!! -->
<window id="rootWnd" title="push box" onload="load_contact_dialog();load_document();"
<window id="rootWnd" title="push box" onload="load_contact_dialog();load_document();message_setlabel();"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="text/javascript" src="chrome://openerp_plugin/content/js/tiny_xmlrpc.js"></script>
<script type="text/javascript" src="chrome://openerp_plugin/content/js/tools.js"></script>
<script type="text/javascript" src="chrome://openerp_plugin/content/js/dialog.js"></script>
<script type="text/javascript" src="chrome://openerp_plugin/content/js/overlay.js"></script>
<vbox>
<hbox>
<hbox height="50px">
<caption label="Subject:" />
<label value="Message" id="message_label"/>
</hbox>
<hbox>
<hbox align="right">
<button label="Cancel" accesskey="c" oncommand="window.close();"/>
<button id="push_new" label="Push Email" accesskey="a" oncommand=" window.close();window.open('chrome://openerp_plugin/content/push.xul', '', 'chrome', resizable='yes');"/>
<button id="open" label="Create Document" accesskey="c" oncommand="window.close();window.open('chrome://openerp_plugin/content/create_new.xul', '', 'chrome', resizable='yes');"/>
<button id="open_document" label="Open Document" accesskey="d" oncommand="check_document();"/>
<!-- link open document and show create or open but not both-->
<button id="open_document" label="Open Document" accesskey="d" oncommand="open_url(getPreference('urldoc'));window.close();"/>
</hbox>
</vbox>
</window>
@@ -10,6 +10,7 @@ pref("extensions.tiny.password","admin");
pref("extensions.tiny.senderemail","");
pref("extensions.tiny.sendername","");
pref("extensions.tiny.statutdoc","");// add to have a statut to hidde or not the button
pref("extensions.tiny.message_label","");// add to message in push dialog
pref("extensions.tiny.receiveremail","");
pref("extensions.tiny.subject","");
pref("extensions.tiny.receiveddate","");