ginebra2/chrome/bedrockchrome/historyview.superpage/clearhistorydialog.js
changeset 3 0954f5dd2cd0
child 12 afcd8e6d025b
equal deleted inserted replaced
1:b0dd75e285d2 3:0954f5dd2cd0
       
     1 //clearhistorydialog.js
       
     2 
       
     3 function clearHistoryDialog()
       
     4 {
       
     5 	window.bookmarksManager.confirmHistoryClear.connect(showClearHistoryDialog);
       
     6 	  
       
     7     this.write = writeClearHistoryDialog;
       
     8     // do setup
       
     9     this.write();
       
    10     
       
    11 }
       
    12 
       
    13 function writeClearHistoryDialog()
       
    14 {
       
    15     var message = window.localeDelegate.translateText("txt_browser_history_delete_are_you_sure");
       
    16     var html =
       
    17         '<div class="textLabel">'+message +'</div>' +
       
    18         '<div class="controls">' +
       
    19             '<div type="button" onmouseup="clearAllHistoryDialog();" class="historyDialogButton clearDoneButton"></div>'+ 
       
    20             '<div type="button" onmouseup="clearHistoryDialogIdHide();" class="historyDialogButton clearCancelButton"></div>'+         
       
    21         '</div>' +
       
    22         '<div id="hiddenDialogOK"></div>' +
       
    23         '<div id="hiddenDialogCancel"></div>';
       
    24   document.write(html);
       
    25 }
       
    26 
       
    27 function showClearHistoryDialog() {
       
    28   try{
       
    29       window.snippets.ClearHistoryDialogId.show(false);
       
    30       window.snippets.RecentUrlViewToolbarId.enabled = false;
       
    31   }catch(e){ alert(e); }
       
    32 } 
       
    33 
       
    34 function clearAllHistoryDialog()
       
    35 {
       
    36     window.bookmarksManager.clearHistory();
       
    37     window.views.WebView.reload();    
       
    38     clearHistoryDialogIdHide();
       
    39 }
       
    40 
       
    41 function clearHistoryDialogIdHide(){
       
    42     window.snippets.ClearHistoryDialogId.hide();
       
    43     window.snippets.RecentUrlViewToolbarId.enabled = true;
       
    44 }