webmaster@troop997.org
Joined: 13 Jun 2006 Posts: 3
|
Posted: Sat Nov 11, 2006 Post subject: Enhancement Requests |
|
|
I have two requests for enhancements to be included in the next release.
I am including the code changes I have made for these - would just like to share with everybody else and of course not have to keep putting them back in after updates. The references to code below are all at the 7.8.1 version.
The first is to support <dl> as another format to be used for the upcoming events list. I have added the following after line 229 of upcoming_events.js (between the <li> and <table> support). With this, the script will also support the list being enclosed within <dl>...</dl> (it also excludes the background color for the events and provides a css class on the tags)
// This mod add support for the dl tag
} else if (this.anchor_element.tagName.toLowerCase() == 'dl') {
results += '<dt class="upcoming_events_list">';
results += '<span class="date">'+nice_event_date+'</span>';
results += '</dt>';
results += '<dd class="upcoming_events_list">';
if (event.icon && event.icon != "blank")
results += '<img class="icon" src="'+this.plans_theme_url+'/icons/'+event.icon+'_16x16.gif"/>';
results += '<a href="'+link_text+'">';
// results += '<span class="title" style="background-color:'+event.bgcolor+';">';
results += '<span class="title";>';
results += event.title+'</span></a>';
if (this.include_details) results += upcoming_events_format_details(event.details);
results += '</dd>';
The second request is to provide support for default text to be placed in the event description when a new event is created. I did this by putting the default text directly in plans.cgi ... a better permanent approach would of course be to move the default text into plans_config.pl.
I added the following after line 2939 of plans.cgi
# This mod inserts a default template for newly created events
if ($current_event_id ne "") {
$event_detail_default = "";
} else {
$event_detail_default .=<<pl;
DEFAULT EVENT TEXT
pl
}
and then modified the textarea on line 3003 to include the $event_detail_default value:
<textarea name="evt_details" id="evt_details" rows=10 cols=0 style="width:100%;">$current_event{details}$event_detail_default</textarea> |
|