My favorites | Sign in
Project Home Downloads Issues
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 27 attachment: fileType.js (1.3 KB)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Determine the filetype regarding the link DOM element
function fileType() {
var from = currentSettings.from;

if (from) {
if (from && from.nodeName.toLowerCase() == 'form') {
if (from.enctype == 'multipart/form-data')
return 'formData';
return 'form';
}

if (from.rev == 'modal')
currentSettings.modal = true;

var image = new RegExp('[^\.]\.('+currentSettings.extImg+')\s*$', 'i');
if (image.test(from.href)) {
if (from.rel)
return 'gallery';
else
return 'image';
}

var swf = new RegExp('[^\.]\.(swf)\s*$', 'i');
if (swf.test(from.href))
return 'swf';

if (from.target.toLowerCase() == '_blank' || (from.hostname != window.location.hostname))
return 'iframe';

/* Begin modification */

var hash = getHash(from.href);

var end = this.location.href.length - this.location.hash.length;
if (this.location.href.indexOf('#') > 0)
end -= 1;
var curLoc = this.location.href.substring(0, end);

var fromHash = getHash(from.href);
var fromEnd = from.href.length - fromHash.length;
if (from.href.indexOf('#') > 0)
fromEnd -= 1;
var reqLoc = from.href.substring(0, fromEnd);

if (curLoc == reqLoc)
return fromHash;
else
currentSettings.selector = hash;

/* End modification */
}
}
Powered by Google Project Hosting