MozillaZine

modify calendar-event-dialog to add default text

For discussing the Mozilla Calendar, Sunbird and Lightning projects.
Caeles
 
Posts: 7
Joined: February 23rd, 2018, 5:54 am

Post Posted March 15th, 2018, 6:16 am

Hi all,

did someone know if i can modify calendar-event-dialog.xul to add a default text to my event and task ?
thansk all

morat
 
Posts: 2951
Joined: February 3rd, 2009, 6:29 pm

Post Posted March 15th, 2018, 12:09 pm

Caeles (private message) wrote:i have seen an oldest post of your you have modify calendar-event-dialog.js

In version 52.X, .js dont exist but a .xul exist can i modify this one to add a default text ?

Are you talking about the following thread?

viewtopic.php?f=46&t=2864153

Thunderbird 45
http://dxr.mozilla.org/comm-esr45/source/calendar/base/content/dialogs/calendar-event-dialog.js
http://dxr.mozilla.org/comm-esr45/search?q=setElementValue("item-description

Thunderbird 52
http://dxr.mozilla.org/comm-esr52/source/calendar/lightning/content/lightning-item-iframe.js
http://dxr.mozilla.org/comm-esr52/search?q=setElementValue("item-description

Try testing the following code in the error console.

Code: Select all
var iframe = Services.wm.getMostRecentWindow("Calendar:EventDialog").
  document.getElementById("lightning-item-panel-iframe");
var win = iframe.contentWindow;
win.setElementValue("item-description", "Example");

Instructions:

* open config editor
* set devtools.chrome.enabled preference to true
* events and tasks > new task
* tools > developer tools > error console
* copy and paste code into error console
* press enter to run

Error Console command line
http://developer.mozilla.org/en-US/docs/Tools/Browser_Console#Browser_Console_command_line

Similar thread: viewtopic.php?f=46&t=3038776

Return to Calendar


Who is online

Users browsing this forum: No registered users and 2 guests