|
From: <al...@us...> - 2008-09-16 15:58:29
|
Revision: 679
http://sciret.svn.sourceforge.net/sciret/?rev=679&view=rev
Author: alpeb
Date: 2008-09-16 22:58:24 +0000 (Tue, 16 Sep 2008)
Log Message:
-----------
refactored todo popup
Modified Paths:
--------------
trunk/actions/CompleteTodo.php
trunk/actions/DeleteTodo.php
trunk/actions/SaveTodo.php
trunk/javascript/general.js
trunk/style.css
trunk/templates/EditTodo.tpl
trunk/templates/TodosDropdown.tpl
trunk/templates/footer.tpl
trunk/templates/head.tpl
trunk/views/EditTodo.php
Modified: trunk/actions/CompleteTodo.php
===================================================================
--- trunk/actions/CompleteTodo.php 2008-09-16 22:57:52 UTC (rev 678)
+++ trunk/actions/CompleteTodo.php 2008-09-16 22:58:24 UTC (rev 679)
@@ -16,15 +16,16 @@
function dispatch() {
$todo = new Todo($_POST['todoId']);
+ $jsonObj = new StdClass();
if ($todo->getUserId() != $this->user->id) {
- echo 'FAILURE|' . $this->user->lang('Cannot complete other people\'s todo\'s');
+ $jsonObj->message = $this->user->lang('Cannot complete other people\'s todo\'s');
exit;
+ } else {
+ $todo->setStatus(TODO_STATUS_COMPLETED);
+ $todo->save();
}
- $todo->setStatus(TODO_STATUS_COMPLETED);
- $todo->save();
-
- echo 'OK|OK';
+ echo Zend_Json::encode($jsonObj);
}
}
Modified: trunk/actions/DeleteTodo.php
===================================================================
--- trunk/actions/DeleteTodo.php 2008-09-16 22:57:52 UTC (rev 678)
+++ trunk/actions/DeleteTodo.php 2008-09-16 22:58:24 UTC (rev 679)
@@ -16,11 +16,13 @@
function dispatch() {
$todoGateway = new TodoGateway;
+ $jsonObj = new StdClass();
if ($todoGateway->deleteTodo($_POST['todoId'], $this->user->id)) {
- echo 'OK';
+ $jsonObj->message = $this->user->lang('To-Do deleted successfuly');
} else {
- echo 'FAILURE';
+ $jsonObj->message = $this->user->lang('There was a problem trying to delete this To-Do');
}
+ echo Zend_Json::encode($jsonObj);
}
}
Modified: trunk/actions/SaveTodo.php
===================================================================
--- trunk/actions/SaveTodo.php 2008-09-16 22:57:52 UTC (rev 678)
+++ trunk/actions/SaveTodo.php 2008-09-16 22:58:24 UTC (rev 679)
@@ -36,11 +36,11 @@
}
$todo->save();
- Library::redirect(Library::getLink(array( 'view' => 'EditTodo',
- 'id' => $todo->getId(),
- 'message' => urlencode($this->user->lang('To-do saved successfully')),
- )
- ));
+ $jsonObj = new StdClass();
+ $jsonObj->todoId = $todo->getId();
+ $jsonObj->message = $this->user->lang('To-do saved successfully');
+
+ echo Zend_Json::encode($jsonObj);
}
}
Modified: trunk/javascript/general.js
===================================================================
--- trunk/javascript/general.js 2008-09-16 22:57:52 UTC (rev 678)
+++ trunk/javascript/general.js 2008-09-16 22:58:24 UTC (rev 679)
@@ -23,6 +23,45 @@
// to avoid conflicts with YAHOO.tools' $ function
var $j = jQuery.noConflict();
+SCIRET.debugWindow = function() {
+ var popup = false;
+
+ return {
+ log: function (str) {
+ if (!popup) {
+ popup = window.open('', 'debugging', 'width=400, height=500, scrollbars=yes, resizable=yes');
+ popup.document.write('<pre>\n');
+ }
+ popup.document.write(str + '\n');
+ }
+ }
+}();
+
+SCIRET.utils = function() {
+ return {
+ isSafari: (document.childNodes && !document.all && !navigator.taintEnabled && !navigator.accentColorName)? true : false,
+
+ isKhtml: /Konqueror|Safari|KHTML/i.test(navigator.userAgent),
+
+ isIE: (document.all)? true : false,
+
+ isIE5: ( this.is_ie && /msie 5\.0/i.test(navigator.userAgent) )? true : false,
+
+ evalScripts: function (el) {
+ el = (typeof el =="string")? $(el) : el;
+ var scripts = el.getElementsByTagName("script");
+ for(var i=0; i < scripts.length;i++) {
+ eval(scripts[i].innerHTML);
+ }
+ },
+
+ replaceContent: function(responseObj, elId) {
+ $(elId).innerHTML = responseObj.responseText;
+ SCIRET.utils.evalScripts(elId);
+ }
+ };
+}();
+
// *********************************************************
// ** BROWSER DETECTION **
// *********************************************************
@@ -35,15 +74,12 @@
isIE7 = false;
}
-isSafari = (document.childNodes && !document.all && !navigator.taintEnabled && !navigator.accentColorName)? true : false;
-
var onloadFunctions = new Array();
// *********************************************************
// ** STATE VARIABLES **
// *********************************************************
var isFavoritesDropdownShown = false;
-var isTodosDropdownShown = false;
function triggerOnloadFunctions() {
for (var i = 0; i < onloadFunctions.length; i++) {
@@ -276,24 +312,74 @@
// *********************************************************
// ** CALENDAR FUNCTIONS **
// *********************************************************
-function dateSelected(calendar, date) {
- var input_field = $("hiddenDate");
- input_field.value = date;
- if (calendar.dateClicked) {
- $('dateShow').innerHTML = calendar.date.print(calendar.params.daFormat);
- calendar.callCloseHandler();
- $('labelSetDate').style.display = 'none';
- $('removeDateLink').style.display = '';
- }
+function dateSelected(type, args, cal) {
+ var dates = args[0];
+ var date = dates[0];
+ var year = date[0], month = date[1], day = date[2];
+ $("todoHiddenDate").value = year + "-" + month + "-" + day;
+ $('todoDateShow').innerHTML = formatDate(SCIRET.todos.dateFormat, month, day, year);
+ cal.hide();
+ $('todoLabelSetDate').style.display = 'none';
+ $('todoRemoveDateLink').style.display = '';
}
function removeDate() {
- $('hiddenDate').value = '';
- $('dateShow').innerHTML = '';
- $('labelSetDate').style.display = '';
- $('removeDateLink').style.display = 'none';
+ $('todoHiddenDate').value = '';
+ $('todoDateShow').innerHTML = '';
+ $('todoLabelSetDate').style.display = '';
+ $('todoRemoveDateLink').style.display = 'none';
}
+/**
+ * Based on a function from The DHTML Calendar,
+ * Copyright Mihai Bazon, 2002-2005 | www.bazon.net/mishoo
+/* Prints the date in a string according to the given format.
+*/
+function formatDate(str, m, d, y) {
+ var _MN = new Array
+ ("January",
+ "February",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December");
+
+ var ar = new Array();
+ for (var i = 12; i > 0;) {
+ ar[--i] = _MN[i].substr(0, 3);
+ }
+
+ var s = {};
+ s["%b"] = ar[m]; // abbreviated month name [FIXME: I18N]
+ s["%d"] = (d < 10) ? ("0" + d) : d; // the day of the month (range 01 to 31)
+ s["%e"] = d; // the day of the month (range 1 to 31)
+ s["%m"] = (m < 9) ? ("0" + (1+m)) : (1+m); // month, range 01 to 12
+ s["%Y"] = y; // year with the century
+ s["%%"] = "%"; // a literal '%' character
+
+ var re = /%./g;
+ if (!SCIRET.utils.isIE5 && !SCIRET.utils.isKhtml) {
+ return str.replace(re, function (par) { return s[par] || par; });
+ }
+
+ var a = str.match(re);
+ for (var i = 0; i < a.length; i++) {
+ var tmp = s[a[i]];
+ if (tmp) {
+ re = new RegExp(a[i], 'g');
+ str = str.replace(re, tmp);
+ }
+ }
+
+ return str;
+};
+
// *********************************************************
// ** Favorites FUNCTIONS **
// *********************************************************
@@ -307,8 +393,8 @@
return;
}
- if (isTodosDropdownShown) {
- isTodosDropdownShown = false;
+ if (SCIRET.todos.isTodosDropdownShown) {
+ SCIRET.todos.setIsTodosDropdownShown(false);
$('todosDropdown').style.display = 'none';
}
@@ -331,7 +417,7 @@
var favoritesDropdown = YAHOO.util.Dom.get('favoritesDropdown');
favoritesDropdown.innerHTML = responseObj.responseText;
- if (isSafari) {
+ if (SCIRET.utils.isSafari) {
favoritesDropdown.style.paddingBottom = '25px';
}
new YAHOO.widget.Effects.BlindDown('favoritesDropdown');
@@ -394,82 +480,203 @@
// *********************************************************
// ** TODOS FUNCTIONS **
// *********************************************************
-function dropdownTodos() {
- if (isTodosDropdownShown) {
- isTodosDropdownShown = false;
- $('todosDropdown').style.display = 'none';
- if (isIE && !isIE7) {
- _showSelects();
- }
- return;
- }
+SCIRET.todos = function() {
- if (isFavoritesDropdownShown) {
- isFavoritesDropdownShown = false;
- $('favoritesDropdown').style.display = 'none';
- }
+ return {
+ isTodosDropdownShown: false,
- showLoading('todosLoading');
- var transaction = YAHOO.util.Connect.asyncRequest('GET',
- 'index.php?view=GetTodosDropdown',
- {
- success: showDropDownTodos,
- failure: function() {alert('operation failed')}
- },
- null);
-}
+ todoDialog: null,
-function showDropDownTodos(responseObj) {
- successAjax('todosLoading')
- if (isIE && !isIE7) {
- _hideSelects();
- }
+ cal: null,
- var todosDropdown = YAHOO.util.Dom.get('todosDropdown');
- todosDropdown.innerHTML = responseObj.responseText;
- if (isSafari) {
- todosDropdown.style.paddingBottom = '25px';
- }
- new YAHOO.widget.Effects.BlindDown('todosDropdown');
+ dateFormat: null,
- isTodosDropdownShown = true;
-}
+ setIsTodosDropdownShow: function (is) {
+ isTodosDropdownShown = is;
+ },
-function showEditTodoForm(todoId) {
- if (!todoId) {
- todoId = 0;
- }
+ dropdown: function() {
+ if (this.isTodosDropdownShown) {
+ this.isTodosDropdownShown = false;
+ $('todosDropdown').style.display = 'none';
+ if (isIE && !isIE7) {
+ _showSelects();
+ }
+ return;
+ }
- openSimDialog('index.php?view=EditTodo&id=' + todoId, 310, 360);
-}
+ if (isFavoritesDropdownShown) {
+ isFavoritesDropdownShown = false;
+ $('favoritesDropdown').style.display = 'none';
+ }
-function tickTodo(todoId) {
- if (!confirm('Are you sure you wish to mark this TO-DO as completed?')) {
- $('todoCheck_' + todoId).checked = false;
- return;
- }
- $('todoCheck_' + todoId).style.display = 'none';
- $('todoProgressImg_' + todoId).style.display = 'inline';
+ showLoading('todosLoading');
+ YAHOO.util.Connect.asyncRequest('GET',
+ 'index.php?view=GetTodosDropdown',
+ {
+ success: this.showDropDownTodos,
+ failure: function() {alert('operation failed')}
+ },
+ null);
+ },
- var transaction = YAHOO.util.Connect.asyncRequest('POST',
- 'index.php?action=CompleteTodo',
- {
- success: function (response) {successAjax('todoProgressImg_' + todoId), completeTickTodo(response, todoId)},
- failure: function() {alert('operation failed')}
- },
- 'todoId=' + todoId);
-}
+ showDropDownTodos: function(responseObj) {
+ successAjax('todosLoading')
+ if (isIE && !isIE7) {
+ _hideSelects();
+ }
-function completeTickTodo(responseObj, todoId) {
- var responseArr = responseObj.responseText.split('|');
- if (responseArr[0] != 'OK') {
- alert('There was a problem trying to complete this TO-DO');
- return;
- }
+ var todosDropdown = YAHOO.util.Dom.get('todosDropdown');
+ todosDropdown.innerHTML = responseObj.responseText;
+ if (SCIRET.utils.isSafari) {
+ todosDropdown.style.paddingBottom = '25px';
+ }
+ new YAHOO.widget.Effects.BlindDown('todosDropdown');
- $('todoLink_' + todoId).style.textDecoration = 'line-through';
-}
+ this.isTodosDropdownShown = true;
+ },
+ showForm: function(todoId) {
+ if (!todoId) {
+ todoId = 0;
+ }
+
+ YAHOO.util.Connect.asyncRequest('GET',
+ 'index.php?view=EditTodo&id=' + todoId,
+ {
+ success: this.showEditTodoForm2,
+ argument: [todoId],
+ failure: function() {alert('operation failed')},
+ scope: this
+ },
+ null);
+ },
+
+ showEditTodoForm2: function(responseObj) {
+ SCIRET.utils.replaceContent(responseObj, 'todoDialog');
+
+ YAHOO.util.Event.onDOMReady(function() {
+ YAHOO.util.Event.addListener($("dueDateButton"),
+ "click",
+ SCIRET.todos.showCalendar);
+ });
+
+ var buttons = [{text: "Save", handler: this.save}];
+ if (responseObj.argument > 0) {
+ buttons.push({text: "Delete", handler: function() {SCIRET.todos.delete(responseObj.argument)}});
+ }
+ buttons.push({text: "Cancel", handler: function() {this.cancel()}});
+
+ this.todoDialog = new YAHOO.widget.Dialog("todoDialog",
+ {
+ fixedcenter: true,
+ buttons: buttons
+ });
+ this.todoDialog.callback.success = SCIRET.todos.saveCompleted;
+ this.todoDialog.callback.scope = this;
+ this.todoDialog.render();
+ this.todoDialog.show();
+ },
+
+ showCalendar: function() {
+ this.cal = new YAHOO.widget.Calendar("todoCalContainer", {
+ close: true
+ });
+ this.cal.selectEvent.subscribe(dateSelected, this.cal, true);
+ this.cal.render();
+ this.cal.show();
+ },
+
+ // the scope here is the dialog instance
+ save: function() {
+ $('todoProgressImg').style.display = 'inline';
+
+ $('todosDropdown').style.display = 'none';
+ SCIRET.todos.isTodosDropdownShown = false;
+
+ this.submit();
+ },
+
+ saveCompleted: function(responseObj) {
+ try {
+ var response = YAHOO.lang.JSON.parse(responseObj.responseText);
+ } catch (e) {
+ alert("Operation failed. Here's the result returned:\n\n" + responseObj.responseText);
+ return;
+ }
+ alert(response.message);
+
+ this.showForm(response.todoId);
+ },
+
+ delete: function(todoId) {
+ if (!confirm("Are you sure you wish to delete this To-Do?")) {
+ return;
+ }
+
+ showLoading('todoProgressImg');
+ YAHOO.util.Connect.asyncRequest('POST',
+ 'index.php?action=DeleteTodo',
+ {
+ success: this.deleteCompleted,
+ failure: function() {alert('operation failed')}
+ },
+ 'todoId='+todoId);
+ },
+
+ deleteCompleted: function(responseObj) {
+ successAjax('todoProgressImg');
+
+ try {
+ var response = YAHOO.lang.JSON.parse(responseObj.responseText);
+ } catch (e) {
+ alert("Operation failed. Here's the result returned:\n\n" + responseObj.responseText);
+ return;
+ }
+ alert(response.message);
+ $('todosDropdown').style.display = 'none';
+ SCIRET.todos.isTodosDropdownShown = false;
+
+ SCIRET.todos.todoDialog.cancel();
+ },
+
+ tick: function(todoId) {
+ if (!confirm('Are you sure you wish to mark this TO-DO as completed?')) {
+ $('todoCheck_' + todoId).checked = false;
+ return;
+ }
+ $('todoCheck_' + todoId).style.display = 'none';
+ $('todoProgressImg_' + todoId).style.display = 'inline';
+
+ YAHOO.util.Connect.asyncRequest('POST',
+ 'index.php?action=CompleteTodo',
+ {
+ success: function (response) {SCIRET.todos.completeTick(response, todoId)},
+ failure: function() {alert('operation failed')}
+ },
+ 'todoId=' + todoId);
+ },
+
+ completeTick: function(responseObj, todoId) {
+ successAjax('todoProgressImg_' + todoId);
+
+ try {
+ var response = YAHOO.lang.JSON.parse(responseObj.responseText);
+ } catch (e) {
+ alert("Operation failed. Here's the result returned:\n\n" + responseObj.responseText);
+ return;
+ }
+
+ if (typeof response.message != 'undefined') {
+ alert(response.message);
+ return;
+ }
+
+ $('todoLink_' + todoId).style.textDecoration = 'line-through';
+ }
+ };
+}();
+
// *********************************************************
// ** HELPER FUNCTIONS **
// *********************************************************
Modified: trunk/style.css
===================================================================
--- trunk/style.css 2008-09-16 22:57:52 UTC (rev 678)
+++ trunk/style.css 2008-09-16 22:58:24 UTC (rev 679)
@@ -200,6 +200,8 @@
background: url(images/bg_content.jpg) repeat-y;
}
+.clear { clear:both; }
+
/* ########################## */
/* MENU */
/* ########################## */
Modified: trunk/templates/EditTodo.tpl
===================================================================
--- trunk/templates/EditTodo.tpl 2008-09-16 22:57:52 UTC (rev 678)
+++ trunk/templates/EditTodo.tpl 2008-09-16 22:58:24 UTC (rev 679)
@@ -8,121 +8,44 @@
* @packager Keyboard Monkeys
*/
-->
+<div class="hd">
+ {formTitle}
+ <img id="todoProgressImg" src="images/progress.gif" style="display:none" />
+</div>
+<div class="bd">
+ <script>
+ SCIRET.todos.dateFormat = "{jsCalDateFormat}";
+ </script>
+ <form action="{formAction}" method="POST">
+ <div id="relatedArtsMessage">{message}</div>
+ <input type="hidden" name="todoId" value="{todo_id}" />
-<script type="text/javascript">
-function saveTodo(form) {
- $('todoProgressImg').style.display = 'inline';
+ <label for="title">[l]Title[/l]</label>
+ <input type="text" name="title" value="{title}" />
+ <div class="clear"></div>
- opener.isTodosDropdownShown = false;
- opener.$('todosDropdown').style.display = 'none';
+ <label for="content">[l]Contents[/l]</label>
+ <textarea id="content" name="content" style="width:170px; height:100px">{content}</textarea>
+ <div class="clear"></div>
- form.submit();
-}
+ <label for="dueDate">[l]Due Date[/l]</label>
+ <input type="hidden" id="todoHiddenDate" name="dueDate" value="{dueDate}" />
+ <span id="todoDateShow">{dueDateContents}</span>
+ <img src="images/datepopup.gif" id="dueDateButton" style="cursor:pointer" />
+ <div id="todoCalContainer" style="display:none; position:absolute; left:10px; z-index:1"></div>
+ <span id="todoLabelSetDate" style="display:{labelSetDueDateDisplay}; font: normal 12px sans-serif">([l]Currently none.<br />Click icon to set one.[/l])</span><br />
+ <a id="todoRemoveDateLink" href="javascript:void(0);" onclick="removeDate();" style="display:{removeDueDateLinkDisplay};">[l]Remove due date[/l]</a>
+ <div class="clear"></div>
-function deleteTodo() {
- new Ajax.Request(
- 'index.php?action=DeleteTodo',
- {
- method : 'post',
- parameters : 'todoId=' + {todo_id},
- onLoading : function() {showLoading('todoProgressImg');},
- onComplete : deleteTodoCompleted
- }
- );
-}
+ <label for="private">[l]Private[/l]</label>
+ <input type="checkbox" id="private" name="private" {privateChecked}/>
+ <div class="clear"></div>
-function deleteTodoCompleted(responseObj) {
- successAjax('todoProgressImg');
-
- if (responseObj.responseText == 'OK') {
- opener.isTodosDropdownShown = false;
- opener.$('todosDropdown').style.display = 'none';
-
- alert('To-Do deleted successfuly');
- setTimeout("window.close();", 100);
- } else {
- alert('There was a problem trying to delete this To-Do');
- }
-}
-
-</script>
-<div id="formWrapper" style="position:relative; background-color: #faf8f3; height:340px; overflow:scroll">
- <div style="text-align:center">
- <div id="relatedArtsMessage" style="display:inline;">{message}</div>
+ <label for="completed">[l]Completed[/l]</label>
+ <input type="checkbox" id="completed" name="completed" {completedChecked}/>
+ <div class="clear"></div>
+ </form>
+ <div id="relatedArticlesDiv">
+ {relatedArticlesTable}
</div>
- <div style="position:relative; border:1px solid black">
- <table class="todoTable" cellspacing="1" cellpadding="0" border="0">
- <form action="{formAction}" method="POST">
- <input type="hidden" name="todoId" value="{todo_id}" />
- <tr class="th">
- <td colspan="2" width="1%" style="padding:3px 0 3px 0px; font-weight:bold; text-align:center">
- <div style="position:relative; text-align:center; font-weight:bold;">
- {formTitle}
- <span style="position:absolute; right:0">
- <img id="todoProgressImg" src="images/progress.gif" style="display:none" />
- </span>
- </div>
- </td>
- </tr>
- <tr class="row_on">
- <td style="font:normal 12px sans-serif; font-weight:bold; text-align:right">[l]Title[/l]:</td>
- <td><input type="text" name="title" value="{title}" style="width:170px" /></td>
- </tr>
- <tr class="row_on">
- <td style="font:normal 12px sans-serif; font-weight:bold; text-align:right" valign="top">[l]Contents[/l]:</td>
- <td><textarea name="content" style="width:170px; height:100px">{content}</textarea></td>
- </tr>
- <tr class="row_on">
- <td style="font:normal 12px sans-serif; font-weight:bold; text-align:right">[l]Due Date[/l]:</td>
- <td>
- <input type="hidden" id="hiddenDate" name="dueDate" value="{dueDate}" />
- <span id="dateShow">{dueDateContents}</span>
- <img src="images/datepopup.gif" id="dueDateButton" style="cursor:pointer" />
- <span id="labelSetDate" style="display:{labelSetDueDateDisplay}; font: normal 12px sans-serif">([l]Currently none.<br />Click icon to set one.[/l])</span><br />
- <a id="removeDateLink" href="javascript:void(0);" onclick="removeDate();" style="display:{removeDueDateLinkDisplay}; font-weight:bold; font-size:10px">[l]Remove due date[/l]</a>
- </td>
- </tr>
- <tr class="row_on">
- <td colspan="2" style="text-align:center">
- <table width="100%" border="0">
- <tr>
- <td style="width:1%; font:normal 12px sans-serif; font-weight:bold; text-align:right" valign="bottom">[l]Private[/l]:</td>
- <td style="width:1%;" valign="bottom"><input type="checkbox" name="private" {privateChecked}/></td>
- <td style="font:normal 12px sans-serif; font-weight:bold; text-align:right" valign="bottom">[l]Completed[/l]:</td>
- <td style="width:1%;" valign="bottom"><input type="checkbox" name="completed" {completedChecked}/></td>
- </tr>
- </table>
- </td>
- </tr>
- <tr class="row_on">
- <td colspan="2" style="text-align:right">
- <input type="button" value="[l]Save[/l]" onclick="saveTodo(form);"/>
- <!-- BEGIN deleteButton_block -->
- <input type="button" value="[l]Delete[/l]" onclick="deleteTodo();" />
- <!-- END deleteButton_block -->
- </td>
- </tr>
- </form>
- </table>
- <div id="relatedArticlesDiv">
- {relatedArticlesTable}
- </div>
- </div>
</div>
-<script type="text/javascript">
- Calendar.setup(
- {
- inputField : "hiddenDate",
- ifFormat : "%Y-%m-%d",
- daFormat : "{jsCalDateFormat}",
- button : "dueDateButton",
- onSelect : dateSelected
- }
- );
- <!-- BEGIN adjustWinSize_block -->
- _adjustWinSize(300, 460);
- $('formWrapper').style.height = '450px';
- <!-- END adjustWinSize_block -->
-</script>
-</body>
-</html>
Modified: trunk/templates/TodosDropdown.tpl
===================================================================
--- trunk/templates/TodosDropdown.tpl 2008-09-16 22:57:52 UTC (rev 678)
+++ trunk/templates/TodosDropdown.tpl 2008-09-16 22:58:24 UTC (rev 679)
@@ -15,10 +15,10 @@
<!-- BEGIN todoItem_block -->
<li>
<!-- BEGIN checkTodo_block -->
- <input id="todoCheck_{todoId}" type="checkbox" onchange="tickTodo({todoId})" /><img id="todoProgressImg_{todoId}" src="images/progress.gif" style="display:none" />
+ <input id="todoCheck_{todoId}" type="checkbox" onchange="SCIRET.todos.tick({todoId})" /><img id="todoProgressImg_{todoId}" src="images/progress.gif" style="display:none" />
<!-- END checkTodo_block -->
<!-- BEGIN linkTodo1_block -->
- <a id="todoLink_{todoId}" href="javascript:void(0)" onclick="showEditTodoForm({todoId})" style="text-decoration:{textDecoration}; {colorStyle}">
+ <a id="todoLink_{todoId}" href="javascript:void(0)" onclick="SCIRET.todos.showForm({todoId})" style="text-decoration:{textDecoration}; {colorStyle}">
<!-- END linkTodo1_block -->
<span class="headerLinks" {descriptionPopup}>{todoTitle}</span>
<!-- BEGIN linkTodo2_block -->
@@ -41,5 +41,5 @@
<div class="headerLinks" style="text-align:center">[l]You have no To-Do's[/l]</div>
<!-- END noTodos_block -->
- <p class="add"><span class="button_green"><a href="javascript:void(0)" onclick="showEditTodoForm()">[l]Add new[/l]</a></span></p>
+ <p class="add"><span class="button_green"><a href="javascript:void(0)" onclick="SCIRET.todos.showForm()">[l]Add new[/l]</a></span></p>
</div>
Modified: trunk/templates/footer.tpl
===================================================================
--- trunk/templates/footer.tpl 2008-09-16 22:57:52 UTC (rev 678)
+++ trunk/templates/footer.tpl 2008-09-16 22:58:24 UTC (rev 679)
@@ -64,7 +64,7 @@
<!-- BEGIN todosLink_block -->
<div class="panel" id="favorites">
<div class="panel_title">
- <a href="javascript:void(0)" onclick="dropdownTodos();">[l]ToDo[/l]</a>
+ <a href="javascript:void(0)" onclick="SCIRET.todos.dropdown();">[l]ToDo[/l]</a>
<img id='todosLoading' src='images/progress.gif' style='visibility:hidden' />
</div>
<div class="inside_panel" id="todosDropdown"></div>
Modified: trunk/templates/head.tpl
===================================================================
--- trunk/templates/head.tpl 2008-09-16 22:57:52 UTC (rev 678)
+++ trunk/templates/head.tpl 2008-09-16 22:58:24 UTC (rev 679)
@@ -6,6 +6,8 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="javascript/yui/build/assets/skins/sam/skin.css">
<link type="text/css" rel="stylesheet" href="javascript/yui/build/logger/assets/skins/sam/logger.css">
+ <link rel="stylesheet" type="text/css" href="javascript/yui/build/container/assets/skins/sam/container.css">
+ <link rel="stylesheet" type="text/css" href="javascript/yui/build/calendar/assets/skins/sam/calendar.css">
<link rel="stylesheet" href="style.css" type="text/css" media="screen" charset="utf-8"/>
<!--[if IE 6]><link rel="stylesheet" href="style_ie6.css" type="text/css" media="screen" charset="utf-8"><![endif]-->
<!--[if IE 7]><link rel="stylesheet" href="style_ie7.css" type="text/css" media="screen" charset="utf-8"><![endif]-->
@@ -16,14 +18,16 @@
<![endif]->
<!-- basic YUI libraries -->
<script type="text/javascript" src="javascript/yui/build/yahoo-dom-event/yahoo-dom-event.js"></script>
+ <script type="text/javascript" src="javascript/yui/build/connection/connection.js"></script>
<script type="text/javascript" src="javascript/tools-min.js"></script>
- <script type="text/javascript" src="javascript/yui/build/container/container_core-min.js"></script>
<script type="text/javascript" src="javascript/yui/build/element/element-beta-min.js"></script>
<script type="text/javascript" src="javascript/yui/build/dragdrop/dragdrop-min.js"></script>
+ <script type="text/javascript" src="javascript/yui/build/container/container.js"></script>
<script type="text/javascript" src="javascript/yui/build/animation/animation-min.js"></script>
<script type="text/javascript" src="javascript/yui/build/button/button-min.js"></script>
- <script type="text/javascript" src="javascript/yui/build/connection/connection-min.js"></script>
+ <script type="text/javascript" src="javascript/yui/build/calendar/calendar-min.js"></script>
<script type="text/javascript" src="javascript/yui/build/logger/logger-min.js"></script>
+ <script type="text/javascript" src="javascript/yui/build/json/json-min.js"></script>
<!-- required by effects.js -->
<script type="text/javascript" src="javascript/effects-min.js"></script>
@@ -31,10 +35,6 @@
<script type="text/javascript" src="javascript/general.js"></script>
<script type="text/javascript" src="javascript/simModal.js"></script>
<script type="text/javascript" src="javascript/overlib.js"></script>
- <style type="text/css">@import url(javascript/jscalendar/calendar-blue.css);</style>
- <script type="text/javascript" src="javascript/jscalendar/calendar.js"></script>
- <script type="text/javascript" src="javascript/jscalendar/lang/calendar-en.js"></script>
- <script type="text/javascript" src="javascript/jscalendar/calendar-setup.js"></script>
<!-- BEGIN rtl_block -->
<style>
input, textarea {
@@ -48,3 +48,4 @@
// var myLogReader = new YAHOO.widget.LogReader();
</script>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
+ <div id="todoDialog"></div>
Modified: trunk/views/EditTodo.php
===================================================================
--- trunk/views/EditTodo.php 2008-09-16 22:57:52 UTC (rev 678)
+++ trunk/views/EditTodo.php 2008-09-16 22:58:24 UTC (rev 679)
@@ -18,8 +18,6 @@
$todoId = isset($_GET['id'])? (int)$_GET['id'] : 0;
$this->tpl->set_file('editTodo', 'EditTodo.tpl');
- $this->tpl->set_block('editTodo', 'adjustWinSize_block', 'adjustWinSize');
- $this->tpl->set_block('editTodo', 'deleteButton_block', 'deleteButton');
if (isset($_GET['message'])) {
$this->tpl->set_var('message', '<span class="successMessage"> '.$_GET['message'].' </span>');
@@ -67,8 +65,6 @@
$relatedArticles->setTemplate($this->tpl);
$this->tpl->set_var('relatedArticlesTable', $relatedArticles->dispatch(true));
- $this->tpl->parse('deleteButton', 'deleteButton_block');
- $this->tpl->parse('adjustWinSize', 'adjustWinSize_block');
} else {
$this->tpl->set_var(array(
'formTitle' => $this->user->lang('NEW TO-DO'),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|