B2G/gecko/content/xslt/tests/buster/result-view.js
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
This Source Code Form is subject to the terms of the Mozilla Public
License, v.
This Source Code Form is subject to the terms of the Mozilla Public License v .
function onNewResultView(event)
{
    dump("onNewResultView\n");
    const db = runItem.prototype.kDatabase;
    const kXalan = runItem.prototype.kXalan;
    var index = view.boxObject.view.selection.currentIndex;
    var res = view.builder.getResourceAtIndex(index);
    var name = db.GetTarget(res, krTypeName, true);
    if (!name) {
        return false;
    }
    var cat = db.GetTarget(res, krTypeCat, true);
    var path = db.GetTarget(res, krTypePath, true);
    cat = cat.QueryInterface(nsIRDFLiteral);
    name = name.QueryInterface(nsIRDFLiteral);
    path = path.QueryInterface(nsIRDFLiteral);
    xalan_fl  = kXalan.resolve(cat.Value+"/"+path.Value);
    xalan_ref  = kXalan.resolve(cat.Value+"-gold/"+path.Value);
    var currentResultItem = new Object();
    currentResultItem.testpath = xalan_fl;
    currentResultItem.refpath = xalan_ref;
    var currentRunItem = itemCache.getItem(res);
    resultWin = window.openDialog('result-view.xul','_blank',
                                   'chrome,resizable,dialog=no',
                                   currentResultItem, currentRunItem);
    return true;
}
function onNewResultView ( event ) { dump ( "onNewResultView\n" ) ; const db = runItem . prototype . kDatabase ; const kXalan = runItem . prototype . kXalan ; var index = view . boxObject . view . selection . currentIndex ; var res = view . builder . getResourceAtIndex ( index ) ; var name = db . GetTarget ( res , krTypeName , true ) ; if ( ! name ) { return false ; } var cat = db . GetTarget ( res , krTypeCat , true ) ; var path = db . GetTarget ( res , krTypePath , true ) ; cat = cat . QueryInterface ( nsIRDFLiteral ) ; name = name . QueryInterface ( nsIRDFLiteral ) ; path = path . QueryInterface ( nsIRDFLiteral ) ; xalan_fl = kXalan . resolve ( cat . Value + "/" + path . Value ) ; xalan_ref = kXalan . resolve ( cat . Value + "-gold/" + path . Value ) ; var currentResultItem = new Object ( ) ; currentResultItem . testpath = xalan_fl ; currentResultItem . refpath = xalan_ref ; var currentRunItem = itemCache . getItem ( res ) ; resultWin = window . openDialog ( 'result-view.xul' , '_blank' , 'chrome,resizable,dialog=no' , currentResultItem , currentRunItem ) ; return true ; }
This Source Code Form is subject to the terms of the Mozilla Public
 License, v. 2.0.
This Source Code Form is subject to the terms of the Mozilla Public License v . 2 . 0 .
// XXX todo, keep a list of these windows, so that we can close them.