メソッド分割
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6678 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
496757fd9c
commit
8d9d3bcb02
@ -778,17 +778,7 @@ catch(e) {
|
|||||||
if (!draggedTab) {
|
if (!draggedTab) {
|
||||||
aEvent.stopPropagation();
|
aEvent.stopPropagation();
|
||||||
|
|
||||||
let url;
|
let url = this.retrieveURLFromDataTransfer(dt);
|
||||||
let types = ['text/x-moz-url', 'text/uri-list', 'text/plain', 'application/x-moz-file'];
|
|
||||||
for (let i = 0; i < types.length; i++) {
|
|
||||||
let dataType = types[i];
|
|
||||||
let isURLList = dataType == 'text/uri-list';
|
|
||||||
let urlData = dt.mozGetDataAt(isURLList ? 'URL' : dataType , 0);
|
|
||||||
if (urlData) {
|
|
||||||
url = this.retrieveURLFromData(urlData, isURLList ? 'text/plain' : dataType);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!url || !url.length || url.indexOf(' ', 0) != -1 || /^\s*(javascript|data):/.test(url))
|
if (!url || !url.length || url.indexOf(' ', 0) != -1 || /^\s*(javascript|data):/.test(url))
|
||||||
return;
|
return;
|
||||||
@ -842,7 +832,22 @@ catch(e) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
retrieveURLFromData: function TSTService_retrieveURLFromData(aData, aType)
|
retrieveURLFromDataTransfer : function TSTService_retrieveURLFromDataTransfer(aDataTransfer)
|
||||||
|
{
|
||||||
|
let url;
|
||||||
|
let types = ['text/x-moz-url', 'text/uri-list', 'text/plain', 'application/x-moz-file'];
|
||||||
|
for (let i = 0; i < types.length; i++) {
|
||||||
|
let dataType = types[i];
|
||||||
|
let isURLList = dataType == 'text/uri-list';
|
||||||
|
let urlData = aDataTransfer.mozGetDataAt(isURLList ? 'URL' : dataType , 0);
|
||||||
|
if (urlData) {
|
||||||
|
url = this.retrieveURLFromData(urlData, isURLList ? 'text/plain' : dataType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return url;
|
||||||
|
},
|
||||||
|
retrieveURLFromData : function TSTService_retrieveURLFromData(aData, aType)
|
||||||
{
|
{
|
||||||
switch (aType)
|
switch (aType)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user