Browse Source

Fix for Google Doc type detection

pull/13/merge
Zach Wise 13 years ago
parent
commit
a78e7a0af1
  1. 27
      source/js/VMM.js
  2. 2
      timeline-min.js
  3. 27
      timeline.js

27
source/js/VMM.js

@ -1437,8 +1437,8 @@ if (typeof VMM == 'undefined') {
media.type = "image"; media.type = "image";
media.id = d; media.id = d;
success = true; success = true;
} else if (VMM.FileExtention.googleDocType(d)) {
} else if (d.match(/docs.google.com|.DOC|.DOCX|.XLS|.XLSX|.PPT|.PPTX|.PDF|.PAGES|.AI|.PSD|.TIFF|.DXF|.SVG|.EPS|.PS|.TTF|.XPS|.ZIP|.RAR/i)) { trace("GOOGLE DOC " + d);
media.type = "googledoc"; media.type = "googledoc";
media.id = d; media.id = d;
success = true; success = true;
@ -1461,6 +1461,29 @@ if (typeof VMM == 'undefined') {
} }
return false; return false;
} }
//VMM.FileExtention.googleDocType(url);
VMM.FileExtention = {
googleDocType: function(url) {
var fileName = url;
var fileExtension = "";
//fileExtension = fileName.substr(5);
fileExtension = fileName.substr(fileName.length - 5, 5);
var validFileExtensions = ["DOC","DOCX","XLS","XLSX","PPT","PPTX","PDF","PAGES","AI","PSD","TIFF","DXF","SVG","EPS","PS","TTF","XPS","ZIP","RAR"];
var flag = false;
for (var i = 0; i < validFileExtensions.length; i++) {
trace("TEST " + fileExtension);
if (fileExtension.toLowerCase().match(validFileExtensions[i].toString().toLowerCase()) || fileName.match("docs.google.com") ) {
flag = true;
}
}
return flag;
}
}
VMM.Keys = { VMM.Keys = {
flickr: "6d6f59d8d30d79f4f402a7644d5073e3", flickr: "6d6f59d8d30d79f4f402a7644d5073e3",

2
timeline-min.js vendored

File diff suppressed because one or more lines are too long

27
timeline.js

@ -1437,8 +1437,8 @@ if (typeof VMM == 'undefined') {
media.type = "image"; media.type = "image";
media.id = d; media.id = d;
success = true; success = true;
} else if (VMM.FileExtention.googleDocType(d)) {
} else if (d.match(/docs.google.com|.DOC|.DOCX|.XLS|.XLSX|.PPT|.PPTX|.PDF|.PAGES|.AI|.PSD|.TIFF|.DXF|.SVG|.EPS|.PS|.TTF|.XPS|.ZIP|.RAR/i)) { trace("GOOGLE DOC " + d);
media.type = "googledoc"; media.type = "googledoc";
media.id = d; media.id = d;
success = true; success = true;
@ -1461,6 +1461,29 @@ if (typeof VMM == 'undefined') {
} }
return false; return false;
} }
//VMM.FileExtention.googleDocType(url);
VMM.FileExtention = {
googleDocType: function(url) {
var fileName = url;
var fileExtension = "";
//fileExtension = fileName.substr(5);
fileExtension = fileName.substr(fileName.length - 5, 5);
var validFileExtensions = ["DOC","DOCX","XLS","XLSX","PPT","PPTX","PDF","PAGES","AI","PSD","TIFF","DXF","SVG","EPS","PS","TTF","XPS","ZIP","RAR"];
var flag = false;
for (var i = 0; i < validFileExtensions.length; i++) {
trace("TEST " + fileExtension);
if (fileExtension.toLowerCase().match(validFileExtensions[i].toString().toLowerCase()) || fileName.match("docs.google.com") ) {
flag = true;
}
}
return flag;
}
}
VMM.Keys = { VMM.Keys = {
flickr: "6d6f59d8d30d79f4f402a7644d5073e3", flickr: "6d6f59d8d30d79f4f402a7644d5073e3",

Loading…
Cancel
Save