Results 1 to 2 of 2
  1.    #1  
    The old Pre swipe delete browser history patch doesn't appear to have ever been ported to 2.x. Having a Pre2 now I've figured out what needs to be changed but not quite sure how to deliver it as a patch in Preware. Until I get that sorted out I thought I'd post the diff results for those that want to try to do it manually. Feedback is appreciated.

    This is *NOT* at a patch produced in Linux but instead was produced with WinMerge. As such I don't think you can use WOQI or anything else to install it, but if you understand diffs it's easy enough to figure out what the changes are. They're pretty simple. If someone else wants to convert it to the correct .patch file format and deliver it to the Preware feeds, by all means go ahead as it might take me a while to get it done myself.

    I've updated the path from the WinMerge results so the filenames correctly reference the full filenames as they exist on the phone. Modified lines are in red, the revision or additions are shown in green. My phone is running 2.2.4. The changes might work with 2.1 too, but if you're interested you'll have to investigate that. Post back if you know.

    WinMerge patch/diff results


    *** .orig/usr/palm/applications/com.palm.app.browser/app/controllers/history-assistant.jsjsjs
    --- /usr/palm/applications/com.palm.app.browser/app/controllers/history-assistant.jsjsjs
    ***************
    *** 45,59 ****
    }
    catch (e) {
    Mojo.Log.logException(e, 'HistoryAssistant#setup');
    }
    };

    HistoryAssistant.prototype.cleanup = function() {
    !
    };

    HistoryAssistant.prototype.activate = function() {
    this._historyListWidget.observe(Mojo.Event.listTap, this._onListSelectionHandler);
    };

    HistoryAssistant.prototype.deactivate = function() {
    --- 45,59 ----
    }
    catch (e) {
    Mojo.Log.logException(e, 'HistoryAssistant#setup');
    }
    };

    HistoryAssistant.prototype.cleanup = function() {
    ! this._historyListWidget.removeEventListener(Mojo.Event.listDelete, this._onListDeleteHandler);
    };

    HistoryAssistant.prototype.activate = function() {
    this._historyListWidget.observe(Mojo.Event.listTap, this._onListSelectionHandler);
    };

    HistoryAssistant.prototype.deactivate = function() {
    ***************
    *** 85,98 ****
    --- 85,102 ----
    var url = event.item.url;
    this.controller.stageController.popScene({
    type: 'history',
    payload: url
    });
    };

    + HistoryAssistant.prototype._onListDelete = function(event) {
    + this._deleteHistoryEntry(event.item.url, function() {}, function() {});
    + };
    +

    /**
    * handle a menu command.
    */
    HistoryAssistant.prototype.handleCommand = function(event) {

    try {
    switch (event.type) {
    ***************
    *** 152,165 ****
    --- 156,173 ----
    this.controller.stageController.swapScene({
    name: 'bookmarks',
    transition: Mojo.Transition.crossFade
    },
    this._webPreferences);
    };

    + HistoryAssistant.prototype._deleteHistoryEntry = function(url, onSuccess, onFailure, transaction) {
    + self.historyStore.delUrlHistory(url, onSuccess, onFailure);
    + };
    +

    HistoryAssistant.prototype._clearHistory = function(){

    var self = this;
    var clearResponse =function(response){
    Mojo.Log.info("Clear Universal Search response: %j",response);
    }
    this.controller.showAlertDialog({
    ***************
    *** 197,210 ****
    --- 205,219 ----

    HistoryAssistant.prototype._showHelpCommand = function() {

    // Launch the help system.
    AppAssistant.launchHelp();
    };

    +
    // utility functions to set up a list

    HistoryAssistant.prototype.setupList= function() {
    var emptyTemplate, assistant, dataSource, attributes;

    try {
    // assistant setup
    ***************
    *** 224,243 ****
    dataSource: dataSource,
    uniquenessProperty: '_id',
    decorator: this.listDecorator.bind(this),
    templates: {
    item: "history/history-entry",
    container: "history/history-container"
    },
    ! onItemRendered: this._itemsCallback.bind(this)
    };

    // finally, set up the widget

    this._historyListWidget = this.controller.get('historyList');
    this._onListSelectionHandler = this._onListSelection.bind(this);

    this.controller.setupWidget('historyList', attributes, {});

    }catch (e){
    Mojo.Log.info(e);
    }
    --- 233,256 ----
    dataSource: dataSource,
    uniquenessProperty: '_id',
    decorator: this.listDecorator.bind(this),
    templates: {
    item: "history/history-entry",
    container: "history/history-container"
    },
    ! onItemRendered: this._itemsCallback.bind(this),
    ! swipeDelete: {
    ! autoConfirm: true
    ! },

    };

    // finally, set up the widget

    this._historyListWidget = this.controller.get('historyList');
    + this._historyListWidget.addEventListener(Mojo.Event.listDelete, this._onListDelete.bind(this));
    this._onListSelectionHandler = this._onListSelection.bind(this);

    this.controller.setupWidget('historyList', attributes, {});

    }catch (e){
    Mojo.Log.info(e);
    }
    *** .orig/usr/palm/applications/com.palm.app.browser/app/models/history-store.jsjsjs
    --- /usr/palm/applications/com.palm.app.browser/app/models/history-store.jsjsjs
    ***************
    *** 40,53 ****
    --- 40,71 ----
    }
    } catch (e) {
    Mojo.Log.logException(e, 'deleteHistoryBefore');
    onFailure(undefined, e);
    }
    };

    + HistoryStore.prototype.delUrlHistory = function(url, onSuccess, onFailure) {
    + var response;
    + try {
    + if (!url || (url.length === 0)) {
    + response={returnValue:"No URL"};
    + onFailure(response);
    + return;
    + }
    + //delete all the history for this item in the past
    + var propOpValueArray=[{"prop":"url","op":"=","val":url}];
    + this.mojoDbInterface.deleteHistory(propOpValueArray,onSuccess,onFailure);
    + } catch (e) {
    + Mojo.Log.logException(e);
    + response={returnValue:"Unknown error"};
    + onFailure(response);
    + }
    + };
    +

    HistoryStore.prototype.addHistory = function(url, title, date, onSuccess, onFailure) {
    var response;
    try {
    if (!url || (url.length === 0)) {
    response={returnValue:"No URL"};
    onFailure(response);
    return;
    Last edited by ALuckyGuy; 07/10/2012 at 09:31 AM.
  2.    #2  
    In case anyone is interested, here are the .patch files created by the Unified Patch Creator. This has only been tested on 2.2.4 on the Pre 2 but it may very well work on 2.2.1.
    Attached Files Attached Files

Posting Permissions