<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.webos-internals.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Wtgreen</id>
	<title>WebOS Internals - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.webos-internals.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Wtgreen"/>
	<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/wiki/Special:Contributions/Wtgreen"/>
	<updated>2026-04-15T07:46:35Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=Patch_Browser_Delete_Individual_History_Items&amp;diff=6620</id>
		<title>Patch Browser Delete Individual History Items</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=Patch_Browser_Delete_Individual_History_Items&amp;diff=6620"/>
		<updated>2009-10-22T19:10:43Z</updated>

		<summary type="html">&lt;p&gt;Wtgreen: Added link to 1.2.1 .patch file, added line number and more comments for 1.2/1.2.1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{template:patch}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This will enable swipe-deletion of individual history items from the Browser history list.&lt;br /&gt;
&lt;br /&gt;
A .patch file for webOS 1.2.1 is [http://forums.precentral.net/attachments/webos-patches/35363d1256225771-help-anyone-able-install-swipe-history-patch-browser-swipe-history-1.2.1.patch.zip here] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Manual Editing Instructions==&lt;br /&gt;
Note: When I first attempted these changes, I edited the code in the files where you'd expect them to be (controllers/history-assistant.js, models/history-store.js), and found that no functionality changed. I grepped around and found that all the code from those two files (and many others is duplicated in controllers/global_code.js, and that only after I changed *that* file did it work. I don't know why, but oh well... So you'll only have to modify one file to get this working.&lt;br /&gt;
&lt;br /&gt;
First, backup the file we're going to edit.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;cd /usr/palm/applications/com.palm.app.browser/app/controllers&lt;br /&gt;
cp global_code.js global_code.js.bkp&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
['''Note for WebOS 1.2/1.2.1:''' The filename has changed.  The following changes should be made to /usr/palm/applications/com.palm.app.browser/app/controllers/'''history-assistant.js''' instead of global.js.  The line numbers aren't the same, but the section of code you should look for are.]&lt;br /&gt;
&lt;br /&gt;
Then, open global_code.js file for editing.&lt;br /&gt;
&lt;br /&gt;
First, we add the ability to swipe-delete to the historyList control itself:&lt;br /&gt;
Find ('''1.1: global_code.js''', line 1101   '''1.2.1: history-assistant.js''', line 34)&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;		this.controller.setupWidget('historyList', {&lt;br /&gt;
			itemTemplate:'history/history-entry',&lt;br /&gt;
			listTemplate:'history/history-container',&lt;br /&gt;
			itemsCallback:this._itemsCallback.bind(this)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a comma to the end of the last parameter line, and then add the swipeToDelete and autoconfirmDelete parameters, so it looks like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;		this.controller.setupWidget('historyList', {&lt;br /&gt;
			itemTemplate:'history/history-entry',&lt;br /&gt;
			listTemplate:'history/history-container',&lt;br /&gt;
			itemsCallback:this._itemsCallback.bind(this),&lt;br /&gt;
			swipeToDelete:true,&lt;br /&gt;
			autoconfirmDelete:true&lt;br /&gt;
		});&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: if you want history item deletes to have the Delete/Cancel confirmation, change autoconfirmDelete to false. But with autoconfirmDelete:true, you can delete multiple pages quickly.&lt;br /&gt;
&lt;br /&gt;
Next, we want to hook the delete event of the historyList to a handler. A few lines down, right after&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;this._onListSelectionHandler = this._onListSelection.bindAsEventListener(this);&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add the following line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;this._onListDeleteHandler = this._onListDelete.bindAsEventListener(this);&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we need to add a listener for that event. About 20 lines down in the HistoryAssistant.prototype.activate function ('''1.2.1:''' line 65), right after this line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;this._historyListWidget.addEventListener(Mojo.Event.listTap, this._onListSelectionHandler);&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
add this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;this._historyListWidget.addEventListener(Mojo.Event.listDelete, this._onListDeleteHandler);&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we need to add the stopListening in the deactivate function (just a few lines down).&lt;br /&gt;
Right after this line ('''1.2.1:''' line 74):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;Mojo.Event.stopListening(this._historyListWidget, Mojo.Event.listTap, this._onListSelectionHandler);&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
add this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;Mojo.Event.stopListening(this._historyListWidget, Mojo.Event.listDelete, this._onListDeleteHandler);&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we add the handler itself. About 80 lines down, right after the HistoryAssistant.prototype._onListSelection function (though it doesn't *really* matter where you put it.. I'm just putting like things together), add this ('''1.2.1:''' line 153):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;HistoryAssistant.prototype._onListDelete = function(event) {&lt;br /&gt;
	this.historyStore.deleteHistoryEntry(event.item.url, function() {}, function() {});&lt;br /&gt;
};&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ok! The event is all hooked up to the handler, and the list is swipeable. Now we just need to add code to the history-store model to delete the actual item from the database.&lt;br /&gt;
&lt;br /&gt;
['''Note for WebOS 1.2/1.2.1:''' The changes below should be made to /usr/palm/applications/com.palm.app.browser/app/'''models/history-store.js''' instead of global.js.  The line numbers aren't the same, but the section of code you should look for are.]&lt;br /&gt;
&lt;br /&gt;
Look for this function: ('''1.1: global_code.js''', line 7350   '''1.2.1: history-store.js''', line 17&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;function HistoryStore(options, onSuccess, onFailure) {&lt;br /&gt;
	try {&lt;br /&gt;
		this.displayName = options.displayName || this.name;&lt;br /&gt;
		this.estimatedSize = options.estimatedSize;&lt;br /&gt;
		this.database = options.database;&lt;br /&gt;
		this.database.transaction(this._createTable.bind(this, onSuccess, onFailure));&lt;br /&gt;
	} catch (e) {&lt;br /&gt;
		Mojo.Log.logException(e, 'HistoryStore()');&lt;br /&gt;
	}&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After that, add this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;HistoryStore.prototype._deleteHistoryEntry = function(url, onSuccess, onFailure, transaction) {&lt;br /&gt;
	this._executeSql(transaction, onSuccess, onFailure,&lt;br /&gt;
		&amp;quot;DELETE FROM 'history' WHERE url = ?&amp;quot;, [url] );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
HistoryStore.prototype.deleteHistoryEntry = function(url, onSuccess, onFailure) {&lt;br /&gt;
        this.database.transaction(this._deleteHistoryEntry.bind(this, url, onSuccess, onFailure));&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: because of the simplicity of the SQL statement (basically &amp;quot;delete all history items with this url&amp;quot;), one swipe could delete multiple history items. For example, if you swipe an item with the url http://forums.precentral.net/faq.php, and you have more than one of them in your history, they will all be deleted. This may or may not be what you want.&lt;br /&gt;
&lt;br /&gt;
That's all.. reboot your pre and give it a try!&lt;/div&gt;</summary>
		<author><name>Wtgreen</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=Patch_Browser_Delete_Individual_History_Items&amp;diff=6076</id>
		<title>Patch Browser Delete Individual History Items</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=Patch_Browser_Delete_Individual_History_Items&amp;diff=6076"/>
		<updated>2009-10-01T17:56:28Z</updated>

		<summary type="html">&lt;p&gt;Wtgreen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{template:patch}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This will enable swipe-deletion of individual history items from the Browser history list.&lt;br /&gt;
&lt;br /&gt;
Note: I haven't created a &amp;quot;patch&amp;quot; yet. Only manual editing instructions on this page currently. Feel free to create a patch if you can -- I'm having trouble doing the usual ssh/sftp, accessing gitorious, etc. from behind this proxy, so I'm doing this all the old-fashioned way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Editing Instructions==&lt;br /&gt;
Note: When I first attempted these changes, I edited the code in the files where you'd expect them to be (controllers/history-assistant.js, models/history-store.js), and found that no functionality changed. I grepped around and found that all the code from those two files (and many others is duplicated in controllers/global_code.js, and that only after I changed *that* file did it work. I don't know why, but oh well... So you'll only have to modify one file to get this working.&lt;br /&gt;
&lt;br /&gt;
First, backup the file we're going to edit.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;cd /usr/palm/applications/com.palm.app.browser/app/controllers&lt;br /&gt;
cp global_code.js global_code.js.bkp&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
['''Note for WebOS 1.2:''' The filename has changed.  The following changes should be made to /usr/palm/applications/com.palm.app.browser/app/controllers/'''history-assistant.js''' instead of global.js.  The line numbers aren't the same, but the section of code you should look for are.]&lt;br /&gt;
&lt;br /&gt;
Then, open global_code.js file for editing.&lt;br /&gt;
&lt;br /&gt;
First, we add the ability to swipe-delete to the historyList control itself:&lt;br /&gt;
Find (on line 1101)&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;		this.controller.setupWidget('historyList', {&lt;br /&gt;
			itemTemplate:'history/history-entry',&lt;br /&gt;
			listTemplate:'history/history-container',&lt;br /&gt;
			itemsCallback:this._itemsCallback.bind(this)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a comma to the end of the last parameter line, and then add the swipeToDelete and autoconfirmDelete parameters, so it looks like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;		this.controller.setupWidget('historyList', {&lt;br /&gt;
			itemTemplate:'history/history-entry',&lt;br /&gt;
			listTemplate:'history/history-container',&lt;br /&gt;
			itemsCallback:this._itemsCallback.bind(this),&lt;br /&gt;
			swipeToDelete:true,&lt;br /&gt;
			autoconfirmDelete:true&lt;br /&gt;
		});&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: if you want history item deletes to have the Delete/Cancel confirmation, change autoconfirmDelete to false. But with autoconfirmDelete:true, you can delete multiple pages quickly.&lt;br /&gt;
&lt;br /&gt;
Next, we want to hook the delete event of the historyList to a handler. A few lines down, right after&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;this._onListSelectionHandler = this._onListSelection.bindAsEventListener(this);&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add the following line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;this._onListDeleteHandler = this._onListDelete.bindAsEventListener(this);&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we need to add a listener for that event. About 20 lines down in the HistoryAssistant.prototype.activate function, right after this line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;this._historyListWidget.addEventListener(Mojo.Event.listTap, this._onListSelectionHandler);&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
add this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;this._historyListWidget.addEventListener(Mojo.Event.listDelete, this._onListDeleteHandler);&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we need to add the stopListening in the deactivate function (just a few lines down).&lt;br /&gt;
Right after this line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;Mojo.Event.stopListening(this._historyListWidget, Mojo.Event.listTap, this._onListSelectionHandler);&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
add this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;Mojo.Event.stopListening(this._historyListWidget, Mojo.Event.listDelete, this._onListDeleteHandler);&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we add the handler itself. About 80 lines down, right after the HistoryAssistant.prototype._onListSelection function (though it doesn't *really* matter where you put it.. I'm just putting like things together), add this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;HistoryAssistant.prototype._onListDelete = function(event) {&lt;br /&gt;
	this.historyStore.deleteHistoryEntry(event.item.url, function() {}, function() {});&lt;br /&gt;
};&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ok! The event is all hooked up to the handler, and the list is swipeable. Now we just need to add code to the history-store model to delete the actual item from the database.&lt;br /&gt;
&lt;br /&gt;
['''Note for WebOS 1.2:''' The changes below should be made to /usr/palm/applications/com.palm.app.browser/app/'''models/history-store.js''' instead of global.js.  The line numbers aren't the same, but the section of code you should look for are.]&lt;br /&gt;
&lt;br /&gt;
Look for this function, on about line 7350:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;function HistoryStore(options, onSuccess, onFailure) {&lt;br /&gt;
	try {&lt;br /&gt;
		this.displayName = options.displayName || this.name;&lt;br /&gt;
		this.estimatedSize = options.estimatedSize;&lt;br /&gt;
		this.database = options.database;&lt;br /&gt;
		this.database.transaction(this._createTable.bind(this, onSuccess, onFailure));&lt;br /&gt;
	} catch (e) {&lt;br /&gt;
		Mojo.Log.logException(e, 'HistoryStore()');&lt;br /&gt;
	}&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After that, add this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;HistoryStore.prototype._deleteHistoryEntry = function(url, onSuccess, onFailure, transaction) {&lt;br /&gt;
	this._executeSql(transaction, onSuccess, onFailure,&lt;br /&gt;
		&amp;quot;DELETE FROM 'history' WHERE url = ?&amp;quot;, [url] );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
HistoryStore.prototype.deleteHistoryEntry = function(url, onSuccess, onFailure) {&lt;br /&gt;
        this.database.transaction(this._deleteHistoryEntry.bind(this, url, onSuccess, onFailure));&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: because of the simplicity of the SQL statement (basically &amp;quot;delete all history items with this url&amp;quot;), one swipe could delete multiple history items. For example, if you swipe an item with the url http://forums.precentral.net/faq.php, and you have more than one of them in your history, they will all be deleted. This may or may not be what you want.&lt;br /&gt;
&lt;br /&gt;
That's all.. reboot your pre and give it a try!&lt;/div&gt;</summary>
		<author><name>Wtgreen</name></author>
	</entry>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=Patch_Browser_Delete_Individual_History_Items&amp;diff=6075</id>
		<title>Patch Browser Delete Individual History Items</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=Patch_Browser_Delete_Individual_History_Items&amp;diff=6075"/>
		<updated>2009-10-01T17:55:16Z</updated>

		<summary type="html">&lt;p&gt;Wtgreen: Updated with WebOS 1.2 filenames&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{template:patch}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This will enable swipe-deletion of individual history items from the Browser history list.&lt;br /&gt;
&lt;br /&gt;
Note: I haven't created a &amp;quot;patch&amp;quot; yet. Only manual editing instructions on this page currently. Feel free to create a patch if you can -- I'm having trouble doing the usual ssh/sftp, accessing gitorious, etc. from behind this proxy, so I'm doing this all the old-fashioned way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Editing Instructions==&lt;br /&gt;
Note: When I first attempted these changes, I edited the code in the files where you'd expect them to be (controllers/history-assistant.js, models/history-store.js), and found that no functionality changed. I grepped around and found that all the code from those two files (and many others is duplicated in controllers/global_code.js, and that only after I changed *that* file did it work. I don't know why, but oh well... So you'll only have to modify one file to get this working.&lt;br /&gt;
&lt;br /&gt;
First, backup the file we're going to edit.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;cd /usr/palm/applications/com.palm.app.browser/app/controllers&lt;br /&gt;
cp global_code.js global_code.js.bkp&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
['''Note for WebOS 1.2:''' The filename has changed.  The following changes should be made to /usr/palm/applications/com.palm.app.browser/app/controllers/history-assistant.js instead of global.js.  The line numbers aren't the same, but the section of code you should look for are.]&lt;br /&gt;
&lt;br /&gt;
Then, open global_code.js file for editing.&lt;br /&gt;
&lt;br /&gt;
First, we add the ability to swipe-delete to the historyList control itself:&lt;br /&gt;
Find (on line 1101)&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;		this.controller.setupWidget('historyList', {&lt;br /&gt;
			itemTemplate:'history/history-entry',&lt;br /&gt;
			listTemplate:'history/history-container',&lt;br /&gt;
			itemsCallback:this._itemsCallback.bind(this)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a comma to the end of the last parameter line, and then add the swipeToDelete and autoconfirmDelete parameters, so it looks like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;		this.controller.setupWidget('historyList', {&lt;br /&gt;
			itemTemplate:'history/history-entry',&lt;br /&gt;
			listTemplate:'history/history-container',&lt;br /&gt;
			itemsCallback:this._itemsCallback.bind(this),&lt;br /&gt;
			swipeToDelete:true,&lt;br /&gt;
			autoconfirmDelete:true&lt;br /&gt;
		});&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: if you want history item deletes to have the Delete/Cancel confirmation, change autoconfirmDelete to false. But with autoconfirmDelete:true, you can delete multiple pages quickly.&lt;br /&gt;
&lt;br /&gt;
Next, we want to hook the delete event of the historyList to a handler. A few lines down, right after&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;this._onListSelectionHandler = this._onListSelection.bindAsEventListener(this);&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add the following line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;this._onListDeleteHandler = this._onListDelete.bindAsEventListener(this);&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we need to add a listener for that event. About 20 lines down in the HistoryAssistant.prototype.activate function, right after this line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;this._historyListWidget.addEventListener(Mojo.Event.listTap, this._onListSelectionHandler);&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
add this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;this._historyListWidget.addEventListener(Mojo.Event.listDelete, this._onListDeleteHandler);&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we need to add the stopListening in the deactivate function (just a few lines down).&lt;br /&gt;
Right after this line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;Mojo.Event.stopListening(this._historyListWidget, Mojo.Event.listTap, this._onListSelectionHandler);&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
add this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;Mojo.Event.stopListening(this._historyListWidget, Mojo.Event.listDelete, this._onListDeleteHandler);&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we add the handler itself. About 80 lines down, right after the HistoryAssistant.prototype._onListSelection function (though it doesn't *really* matter where you put it.. I'm just putting like things together), add this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;HistoryAssistant.prototype._onListDelete = function(event) {&lt;br /&gt;
	this.historyStore.deleteHistoryEntry(event.item.url, function() {}, function() {});&lt;br /&gt;
};&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ok! The event is all hooked up to the handler, and the list is swipeable. Now we just need to add code to the history-store model to delete the actual item from the database.&lt;br /&gt;
&lt;br /&gt;
['''Note for WebOS 1.2:''' The changes below should be made to /usr/palm/applications/com.palm.app.browser/app/models/history-store.js instead of global.js.  The line numbers aren't the same, but the section of code you should look for are.]&lt;br /&gt;
&lt;br /&gt;
Look for this function, on about line 7350:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;function HistoryStore(options, onSuccess, onFailure) {&lt;br /&gt;
	try {&lt;br /&gt;
		this.displayName = options.displayName || this.name;&lt;br /&gt;
		this.estimatedSize = options.estimatedSize;&lt;br /&gt;
		this.database = options.database;&lt;br /&gt;
		this.database.transaction(this._createTable.bind(this, onSuccess, onFailure));&lt;br /&gt;
	} catch (e) {&lt;br /&gt;
		Mojo.Log.logException(e, 'HistoryStore()');&lt;br /&gt;
	}&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After that, add this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;HistoryStore.prototype._deleteHistoryEntry = function(url, onSuccess, onFailure, transaction) {&lt;br /&gt;
	this._executeSql(transaction, onSuccess, onFailure,&lt;br /&gt;
		&amp;quot;DELETE FROM 'history' WHERE url = ?&amp;quot;, [url] );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
HistoryStore.prototype.deleteHistoryEntry = function(url, onSuccess, onFailure) {&lt;br /&gt;
        this.database.transaction(this._deleteHistoryEntry.bind(this, url, onSuccess, onFailure));&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: because of the simplicity of the SQL statement (basically &amp;quot;delete all history items with this url&amp;quot;), one swipe could delete multiple history items. For example, if you swipe an item with the url http://forums.precentral.net/faq.php, and you have more than one of them in your history, they will all be deleted. This may or may not be what you want.&lt;br /&gt;
&lt;br /&gt;
That's all.. reboot your pre and give it a try!&lt;/div&gt;</summary>
		<author><name>Wtgreen</name></author>
	</entry>
</feed>