mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 21:35:39 +00:00
Some random todo hacking I want to get out of my tree, so vlad can help me
debug. r=2:52am.
This commit is contained in:
parent
751a91d6f6
commit
711c1ef9fa
@ -1,3 +1,7 @@
|
|||||||
calendar-todo-item {
|
calendar-todo-item {
|
||||||
-moz-binding: url("calendar-todo-list.xml#calendar-todo-item");
|
-moz-binding: url("calendar-todo-list.xml#calendar-todo-item");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.calendar-todo-item-label {
|
||||||
|
-moz-box-align: inherit;
|
||||||
|
}
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
<binding id="calendar-todo-item" extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
|
<binding id="calendar-todo-item" extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
|
||||||
<content>
|
<content>
|
||||||
<xul:hbox flex="1">
|
<xul:hbox flex="1">
|
||||||
<xul:checkbox anonid="todo-check" xbl:inherits="checked=completed" oncommand="document.getBindingParent(this).updateTodoFromDisplay();"/>
|
<xul:checkbox class="calendar-todo-item-checkbox" anonid="todo-check" xbl:inherits="checked=completed" oncommand="document.getBindingParent(this).updateTodoFromDisplay();"/>
|
||||||
<xul:label anonid="todo-label" crop="end" xbl:inherits="item-calendar,value=label"/>
|
<xul:label class="calendar-todo-item-label" anonid="todo-label" crop="end" xbl:inherits="item-calendar,value=label"/>
|
||||||
</xul:hbox>
|
</xul:hbox>
|
||||||
</content>
|
</content>
|
||||||
<implementation>
|
<implementation>
|
||||||
@ -90,7 +90,29 @@
|
|||||||
this.updateDisplayFromTodo();
|
this.updateDisplayFromTodo();
|
||||||
]]></body>
|
]]></body>
|
||||||
</method>
|
</method>
|
||||||
|
|
||||||
</implementation>
|
</implementation>
|
||||||
|
|
||||||
|
<handlers>
|
||||||
|
<handler event="dblclick"><![CDATA[
|
||||||
|
this.fireEvent("item-open");
|
||||||
|
]]>
|
||||||
|
</handler>
|
||||||
|
|
||||||
|
<handler event="keypress"><![CDATA[
|
||||||
|
dump("handling keypress " + event.keyCode + "\n");
|
||||||
|
const kKE = Components.interfaces.nsIDOMKeyEvent;
|
||||||
|
if (event.keyCode == 13) {
|
||||||
|
this.fireEvent("item-open");
|
||||||
|
} else if (event.keyCode == kKE.DOM_VK_BACK_SPACE ||
|
||||||
|
event.keyCode == kKE.DOM_VK_DELETE) {
|
||||||
|
this.fireEvent("item-delete");
|
||||||
|
} else if (event.keyCode == kKE.DOM_VK_SPACE) {
|
||||||
|
this.checkbox.checked = !this.checkbox.checked;
|
||||||
|
this.updateTodoFromDisplay();
|
||||||
|
}
|
||||||
|
]]>
|
||||||
|
</handler>
|
||||||
|
</handlers>
|
||||||
|
|
||||||
</binding>
|
</binding>
|
||||||
</bindings>
|
</bindings>
|
||||||
|
@ -142,7 +142,8 @@ function selectedCalendarPane(event)
|
|||||||
|
|
||||||
// give the view the calendar, but make sure that everything
|
// give the view the calendar, but make sure that everything
|
||||||
// has uncollapsed first before we try to relayout!
|
// has uncollapsed first before we try to relayout!
|
||||||
setTimeout(0, function() { showCalendar(today()); });
|
showCalendar(today());
|
||||||
|
//setTimeout(function() { showCalendar(today()); }, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
function LtnObserveDisplayDeckChange(event)
|
function LtnObserveDisplayDeckChange(event)
|
||||||
|
@ -12,6 +12,15 @@ function initialize()
|
|||||||
this.populateTodoList();
|
this.populateTodoList();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
todoListManager.rebuildList =
|
||||||
|
function rebuildList()
|
||||||
|
{
|
||||||
|
while (this.mOuterBox.firstChild)
|
||||||
|
this.mOuterBox.removeChild(this.mOuterBox.firstChild);
|
||||||
|
|
||||||
|
this.populateTodoList();
|
||||||
|
};
|
||||||
|
|
||||||
todoListManager.addTodo =
|
todoListManager.addTodo =
|
||||||
function addTodo(newTodo)
|
function addTodo(newTodo)
|
||||||
{
|
{
|
||||||
@ -48,6 +57,44 @@ todoListManager.calendarObserver =
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
todoListManager.calendarObserver.QueryInterface =
|
||||||
|
function QueryInterface(aIID)
|
||||||
|
{
|
||||||
|
if (!aIID.equals(Components.interfaces.calIObserver) &&
|
||||||
|
!aIID.equals(Components.interfaces.calICompositeObserver) &&
|
||||||
|
!aIID.equals(Components.interfaces.nsISupports)) {
|
||||||
|
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
todoListManager.calendarObserver.onCalendarAdded =
|
||||||
|
todoListManager.calendarObserver.onCalendarRemoved =
|
||||||
|
function observer_onCalendarAddedOrRemoved(calendar)
|
||||||
|
{
|
||||||
|
todoListManager.rebuildList();
|
||||||
|
};
|
||||||
|
|
||||||
|
todoListManager.calendarObserver.onModifyItem =
|
||||||
|
function observer_onModifyItem(item)
|
||||||
|
{
|
||||||
|
if (!(item instanceof Components.interfaces.calITodo))
|
||||||
|
return;
|
||||||
|
|
||||||
|
todoListManager.rebuildList();
|
||||||
|
};
|
||||||
|
|
||||||
|
todoListManager.calendarObserver.onDeleteItem =
|
||||||
|
function observer_onDeleteItem(item)
|
||||||
|
{
|
||||||
|
if (!(item instanceof Components.interfaces.calITodo))
|
||||||
|
return;
|
||||||
|
|
||||||
|
todoListManager.rebuildList();
|
||||||
|
};
|
||||||
|
|
||||||
todoListManager.calendarObserver.onAddItem =
|
todoListManager.calendarObserver.onAddItem =
|
||||||
function observer_onAddItem(item)
|
function observer_onAddItem(item)
|
||||||
{
|
{
|
||||||
|
@ -1,10 +1,17 @@
|
|||||||
/* Skin-domain style rules for lightning UI (pinstripe version) */
|
/* Skin-domain style rules for lightning UI (pinstripe version) */
|
||||||
|
|
||||||
#calendarTree {
|
calendar-todo-item {
|
||||||
background: #cccccc;
|
-moz-box-align: center;
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
treechildren::-moz-tree-cell(checked) {
|
calendar-todo-item[selected="true"] {
|
||||||
|
background-color: Highlight;
|
||||||
|
color: HighlightText;
|
||||||
|
}
|
||||||
|
|
||||||
|
#calendarTree > treechildren::-moz-tree-cell(checked) {
|
||||||
background: #ff0000;
|
background: #ff0000;
|
||||||
list-style-image: url("chrome://calendar/skin/dot.png");
|
list-style-image: url("chrome://calendar/skin/dot.png");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user