Ray's changes for css and js

This commit is contained in:
chris committed 2013-07-22 16:31:44 +08:00
1 parent 408bebaa4b
commit fe82427baa
306 files changed
+20659 -607

No files matched your search

+15 -14
View File
@@ -1,27 +1,28 @@
$(function () {
var $fileList = $('.file-list'),
$fileType = $('.file-type');
$type = ['pdf', 'psd', 'ai', 'fla', 'swf', 'in', 'acc', 'do', 'xl', 'pp', 'zip', 'rar', '7z', 'txt', 'jp', 'gif', 'png', 'mp3', 'wav']
$fileType = $('.file-type'),
$type = ['pdf', 'psd', 'ai', 'fla', 'swf', 'in', 'acc', 'do', 'xl', 'pp', 'zip', 'rar', '7z', 'txt', 'jp', 'gif', 'png', 'mp3', 'wav'];
$fileType.each(function (i) {
var $fileTypeHref = $(this).children('a').attr('href');
$fileTypeHref = $fileTypeHref.split("/");
$fileTypeHref = $fileTypeHref[$fileTypeHref.length-1];
$fileTypeHref = $fileTypeHref.split(".");
$fileTypeHref = $fileTypeHref[$fileTypeHref.length-1];
for(var j = 0; j<$type.length; j++) {
if($fileTypeHref.indexOf($type[j])!=-1) {
if($type[j] == "swf") {
$fileTypeHref = $fileTypeHref.split("/");
$fileTypeHref = $fileTypeHref[$fileTypeHref.length-1];
$fileTypeHref = $fileTypeHref.split(".");
$fileTypeHref = $fileTypeHref[$fileTypeHref.length-1];
$.map($type, function(type, index) {
if($fileTypeHref.indexOf(type)!=-1) {
if(type == "swf") {
$fileType.eq(i).addClass('type-fla');
} else if($type[j] == "zip" || $type[j] == "rar" || $type[j] == "7z") {
} else if(type == "zip" || type == "rar" || type == "7z") {
$fileType.eq(i).addClass('type-zip');
} else if($type[j] == "mp3" || $type[j] == "wav") {
} else if(type == "mp3" || type == "wav") {
$fileType.eq(i).addClass('type-audio');
} else {
$fileType.eq(i).addClass('type-'+$type[j]);
$fileType.eq(i).addClass('type-'+type);
}
}
}
})
});
});