| 1 |
<?xml version="1.0"?> |
|---|
| 2 |
<!-- |
|---|
| 3 |
|
|---|
| 4 |
Flickr Uploadr |
|---|
| 5 |
|
|---|
| 6 |
Copyright (c) 2007-2009 Yahoo! Inc. All rights reserved. This library is |
|---|
| 7 |
free software; you can redistribute it and/or modify it under the terms of |
|---|
| 8 |
the GNU General Public License (GPL), version 2 only. This library is |
|---|
| 9 |
distributed WITHOUT ANY WARRANTY, whether express or implied. See the GNU |
|---|
| 10 |
GPL for more details (http://www.gnu.org/licenses/gpl.html) |
|---|
| 11 |
|
|---|
| 12 |
--> |
|---|
| 13 |
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
|---|
| 14 |
id="dock" title="" width="0" height="0"> |
|---|
| 15 |
<script src="chrome://global/content/nsUserSettings.js" /> |
|---|
| 16 |
<script src="chrome://uploadr/content/clh.js" /> |
|---|
| 17 |
<script><![CDATA[ |
|---|
| 18 |
window.addEventListener('load', function() { |
|---|
| 19 |
|
|---|
| 20 |
// This is a hacked handler for drags that happen after the app |
|---|
| 21 |
// was opened |
|---|
| 22 |
// It prevents clobbering photos by strict ordering in the event |
|---|
| 23 |
// queue, but it enables upload too early and therefore can cause |
|---|
| 24 |
// problems |
|---|
| 25 |
|
|---|
| 26 |
if (window.arguments && window.arguments[0]){ |
|---|
| 27 |
const Cc = Components.classes; |
|---|
| 28 |
const Ci = Components.interfaces; |
|---|
| 29 |
|
|---|
| 30 |
// Get the main window |
|---|
| 31 |
var singleton = nsPreferences.copyUnicharPref( |
|---|
| 32 |
'toolkit.singletonWindowType'); |
|---|
| 33 |
var mediator = Cc['@mozilla.org/appshell/window-mediator;1'] |
|---|
| 34 |
.getService(Ci.nsIWindowMediator); |
|---|
| 35 |
var win = mediator.getMostRecentWindow(singleton); |
|---|
| 36 |
|
|---|
| 37 |
// Add this photo, converting file:// URL to a native path |
|---|
| 38 |
var arg = window.arguments[0]; |
|---|
| 39 |
if (win) { |
|---|
| 40 |
if( arg && (0 == arg.indexOf("flickrup")) ) { // frob command line |
|---|
| 41 |
win.clh(true, arg); |
|---|
| 42 |
} |
|---|
| 43 |
else { |
|---|
| 44 |
win.threads.worker.dispatch(new win.PhotoAdd(arg), |
|---|
| 45 |
win.threads.worker.DISPATCH_NORMAL); |
|---|
| 46 |
} |
|---|
| 47 |
window.close(); |
|---|
| 48 |
win.focus(); |
|---|
| 49 |
} |
|---|
| 50 |
|
|---|
| 51 |
} |
|---|
| 52 |
}, false); |
|---|
| 53 |
]]></script> |
|---|
| 54 |
</window> |
|---|