diff --git a/chrome/chromeFiles/content/scholar/itemPane.js b/chrome/chromeFiles/content/scholar/itemPane.js index 3d9a67ae7..80cf305d1 100644 --- a/chrome/chromeFiles/content/scholar/itemPane.js +++ b/chrome/chromeFiles/content/scholar/itemPane.js @@ -138,6 +138,7 @@ ScholarItemPane = new function() var label = document.createElement('label'); label.setAttribute('value',_noteToTitle(notes[i].getNote())); + label.setAttribute('flex','1'); //so that the long names will flex smaller label.setAttribute('crop','end'); var box = document.createElement('box'); @@ -177,6 +178,7 @@ ScholarItemPane = new function() var label = document.createElement('label'); label.setAttribute('value',files[i].getField('title')); + label.setAttribute('flex','1'); //so that the long names will flex smaller label.setAttribute('crop','end'); var box = document.createElement('box'); @@ -442,26 +444,12 @@ ScholarItemPane = new function() function addFileFromDialog(link) { - var nsIFilePicker = Components.interfaces.nsIFilePicker; - var fp = Components.classes["@mozilla.org/filepicker;1"] - .createInstance(nsIFilePicker); - fp.init(window, "Select a File", nsIFilePicker.modeOpen); - - if(fp.show() == nsIFilePicker.returnOK) - { - if(link) - Scholar.Files.linkFromFile(fp.file, _itemBeingEdited.getID()); - else - Scholar.Files.importFromFile(fp.file, _itemBeingEdited.getID()); - } + ScholarPane.addFileFromDialog(link, _itemBeingEdited.getID()); } function addFileFromPage(link) { - if(link) - Scholar.Files.linkFromDocument(window.content.document, _itemBeingEdited.getID()); - else - Scholar.Files.importFromDocument(window.content.document, _itemBeingEdited.getID()); + ScholarPane.addFileFromPage(link, _itemBeingEdited.getID()); } } diff --git a/chrome/chromeFiles/content/scholar/overlay.js b/chrome/chromeFiles/content/scholar/overlay.js index ebbc1779d..7147b4099 100644 --- a/chrome/chromeFiles/content/scholar/overlay.js +++ b/chrome/chromeFiles/content/scholar/overlay.js @@ -27,6 +27,8 @@ var ScholarPane = new function() this.buildItemContextMenu = buildItemContextMenu; this.openNoteWindow = openNoteWindow; this.newNote = newNote; + this.addFileFromDialog = addFileFromDialog; + this.addFileFromPage = addFileFromPage; /* * Called when the window is open @@ -346,6 +348,30 @@ var ScholarPane = new function() { window.open('chrome://scholar/content/note.xul?v=1'+(id ? '&id='+id : '')+(parent ? '&coll='+parent : ''),'','chrome,resizable,centerscreen'); } + + function addFileFromDialog(link, id) + { + var nsIFilePicker = Components.interfaces.nsIFilePicker; + var fp = Components.classes["@mozilla.org/filepicker;1"] + .createInstance(nsIFilePicker); + fp.init(window, "Select a File", nsIFilePicker.modeOpen); + + if(fp.show() == nsIFilePicker.returnOK) + { + if(link) + Scholar.Files.linkFromFile(fp.file, id); + else + Scholar.Files.importFromFile(fp.file, id); + } + } + + function addFileFromPage(link, id) + { + if(link) + Scholar.Files.linkFromDocument(window.content.document, id); + else + Scholar.Files.importFromDocument(window.content.document, id); + } } window.addEventListener("load", function(e) { ScholarPane.onLoad(e); }, false); diff --git a/chrome/chromeFiles/content/scholar/overlay.xul b/chrome/chromeFiles/content/scholar/overlay.xul index f38bf8d2d..58764ede5 100644 --- a/chrome/chromeFiles/content/scholar/overlay.xul +++ b/chrome/chromeFiles/content/scholar/overlay.xul @@ -81,6 +81,14 @@ + + + + + + + +