|
From: <al...@us...> - 2008-10-23 18:02:17
|
Revision: 755
http://sciret.svn.sourceforge.net/sciret/?rev=755&view=rev
Author: alpeb
Date: 2008-10-23 18:02:08 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
use YUI's calendar widget instead of the older one
Modified Paths:
--------------
trunk/templates/EditBookmark.tpl
Modified: trunk/templates/EditBookmark.tpl
===================================================================
--- trunk/templates/EditBookmark.tpl 2008-10-23 17:45:25 UTC (rev 754)
+++ trunk/templates/EditBookmark.tpl 2008-10-23 18:02:08 UTC (rev 755)
@@ -66,11 +66,14 @@
[l]Expiration Date[/l]:
</td>
<td>
- <input type="hidden" id="hiddenDate" name="expDate" value="{expDate}" />
- <span id="dateShow">{expDateContents}</span>
- <img src="images/datepopup.gif" id="expDateButton" style="cursor:pointer" />
- <span id="labelSetDate" style="display:{labelSetExpDateDisplay}">([l]Currently none.<br />Click icon to set one.[/l])</span>
- <a id="removeDateLink" href="javascript:void(0);" onclick="removeExpirationDate();" style="display:{removeExpDateLinkDisplay}; font-weight:bold; font-size:10px">[l]Remove expiration date[/l]</a>
+ <div style="position:relative">
+ <input type="hidden" id="hiddenDate" name="expDate" value="{expDate}" />
+ <span id="dateShow">{expDateContents}</span>
+ <img src="images/datepopup.gif" id="expDateButton" style="cursor:pointer" />
+ <div id="expirationCalContainer" style="display:none; position:absolute; left:10px; z-index:1"></div>
+ <span id="labelSetDate" style="display:{labelSetExpDateDisplay}">([l]Currently none.<br />Click icon to set one.[/l])</span>
+ <a id="removeDateLink" href="javascript:void(0);" onclick="removeArticeExpiration();" style="display:{removeExpDateLinkDisplay}; font-weight:bold; font-size:10px">[l]Remove expiration date[/l]</a>
+ </div>
</td>
</tr>
<tr class="row_on">
@@ -102,13 +105,36 @@
</table>
</form>
<script type="text/javascript">
- Calendar.setup(
- {
- inputField : "hiddenDate",
- ifFormat : "%Y-%m-%d",
- daFormat : "{jsCalDateFormat}",
- button : "expDateButton",
- onSelect : dateSelected
- }
- );
+ YAHOO.util.Event.onDOMReady(function() {
+ YAHOO.util.Event.addListener($("expDateButton"),
+ "click",
+ showArticleCalendar);
+ });
+
+ function showArticleCalendar() {
+ var cal = new YAHOO.widget.Calendar("expirationCalContainer", {
+ close: true
+ });
+ cal.selectEvent.subscribe(articleDateSelected, cal, true);
+ cal.render();
+ cal.show();
+ }
+
+ function articleDateSelected(type, args, cal) {
+ var dates = args[0];
+ var date = dates[0];
+ var year = date[0], month = date[1], day = date[2];
+ $("hiddenDate").value = year + "-" + month + "-" + day;
+ $('dateShow').innerHTML = formatDate("{jsCalDateFormat}", month, day, year);
+ cal.hide();
+ $('labelSetDate').style.display = 'none';
+ $('removeDateLink').style.display = '';
+ }
+
+ function removeArticleExpiration() {
+ $('hiddenDate').value = '';
+ $('dateShow').innerHTML = '';
+ $('labelSetDate').style.display = '';
+ $('removeDateLink').style.display = 'none';
+ }
</script>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|