| 8 |
var GB_DONE = false; |
var GB_DONE = false; |
| 9 |
var GB_HEIGHT = 400; |
var GB_HEIGHT = 400; |
| 10 |
var GB_WIDTH = 400; |
var GB_WIDTH = 400; |
| 11 |
var GB_ANIMATION = true; |
var GB_ANIMATION = false; |
| 12 |
|
var GB_REFRESHFM = 0; //possible values: 0 = no refresh, 1 = refresh file browser, 2 = refresh file and tree browser |
| 13 |
|
|
| 14 |
function GB_show(caption, url, height, width) { |
//a new parameter has been adde allowing you to specify whether the dbFM browser should be refreshed |
| 15 |
|
function GB_show(caption, url, height, width, refreshit) { |
| 16 |
|
var closepath; |
| 17 |
GB_HEIGHT = height || 400; |
GB_HEIGHT = height || 400; |
| 18 |
GB_WIDTH = width || 400; |
GB_WIDTH = width || 400; |
| 19 |
|
GB_REFRESHFM = refreshit; |
| 20 |
if(!GB_DONE) { |
if(!GB_DONE) { |
| 21 |
|
closepath = getGreyPath() + '/close.gif'; |
| 22 |
$(document.body) |
$(document.body) |
| 23 |
.append("<div id='GB_overlay'></div><div id='GB_window'><div id='GB_caption'></div>" |
.append("<div id='GB_overlay'></div><div id='GB_window'><div id='GB_caption'></div>" |
| 24 |
+ "<img src='/modules/dbfmgreybox/close.gif' alt='Close window'/></div>"); |
+ "<img src='" + closepath + "' alt='Close window'/></div>"); |
| 25 |
|
|
| 26 |
$("#GB_window img").click(GB_hide); |
$("#GB_window img").click(GB_hide); |
| 27 |
$("#GB_overlay").click(GB_hide); |
$("#GB_overlay").click(GB_hide); |
| 28 |
$(window).resize(GB_position); |
$(window).resize(GB_position); |
| 44 |
} |
} |
| 45 |
|
|
| 46 |
function GB_hide() { |
function GB_hide() { |
| 47 |
|
//need some code here to allow us to decide whether we're refreshing one or both lists. |
| 48 |
|
var retval; |
| 49 |
|
|
| 50 |
|
retval = dbFM.dirListObj; |
| 51 |
|
if (retval == null) { |
| 52 |
|
$("#GB_window,#GB_overlay").hide(); |
| 53 |
|
} |
| 54 |
|
|
| 55 |
|
if (GB_REFRESHFM > 0) { |
| 56 |
|
//this is here to refresh the browser - the only difficulty here is with replication |
| 57 |
|
//it takes a while for the database to be updated and we don't want to refresh until that's happened |
| 58 |
|
//ZZZZthe delay should really be moved to the greybox config options |
| 59 |
|
if (dowereplicate() == 'T') { |
| 60 |
|
setTimeout(refreshit(),500); |
| 61 |
|
} |
| 62 |
|
else { |
| 63 |
|
refreshit(); |
| 64 |
|
} |
| 65 |
|
} |
| 66 |
|
else { |
| 67 |
|
$("#GB_window,#GB_overlay").hide(); |
| 68 |
|
} |
| 69 |
|
} |
| 70 |
|
|
| 71 |
|
function refreshit() |
| 72 |
|
{ |
| 73 |
|
dbFM.dirListObj.refresh(); |
| 74 |
|
if (GB_REFRESHFM > 1) { |
| 75 |
|
dbFM.dirTreeObj.fetch(); |
| 76 |
|
} |
| 77 |
$("#GB_window,#GB_overlay").hide(); |
$("#GB_window,#GB_overlay").hide(); |
| 78 |
|
|
| 79 |
|
return; |
| 80 |
} |
} |
| 81 |
|
|
| 82 |
function GB_position() |
function GB_position() |