mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-24 20:14:37 -04:00
Cleaned js.
This commit is contained in:
parent
e07f05864c
commit
4f09cbf00e
1 changed files with 10 additions and 16 deletions
|
@ -13,14 +13,8 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************
|
|
||||||
* h5ai
|
|
||||||
*******************************/
|
|
||||||
|
|
||||||
H5ai = function ( options ) {
|
H5ai = function ( options ) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************
|
/*******************************
|
||||||
* config
|
* config
|
||||||
*******************************/
|
*******************************/
|
||||||
|
@ -123,14 +117,14 @@
|
||||||
|
|
||||||
if ( viewmode !== undefined ) {
|
if ( viewmode !== undefined ) {
|
||||||
localStorage.setItem( config.store.viewmode, viewmode );
|
localStorage.setItem( config.store.viewmode, viewmode );
|
||||||
}
|
};
|
||||||
if ( getViewmode() === "icons" ) {
|
if ( getViewmode() === "icons" ) {
|
||||||
$( "#details" ).hide();
|
$( "#details" ).hide();
|
||||||
$( "#icons" ).show();
|
$( "#icons" ).show();
|
||||||
} else {
|
} else {
|
||||||
$( "#details" ).show();
|
$( "#details" ).show();
|
||||||
$( "#icons" ).hide();
|
$( "#icons" ).hide();
|
||||||
}
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -151,8 +145,8 @@
|
||||||
if ( part !== "" ) {
|
if ( part !== "" ) {
|
||||||
path += part + "/";
|
path += part + "/";
|
||||||
$ul.append( $( "<li class='crumb'><a href='" + path + "'><img src='" + config.icons.crumb + "' alt='>' />" + part + "</a></li>" ) );
|
$ul.append( $( "<li class='crumb'><a href='" + path + "'><img src='" + config.icons.crumb + "' alt='>' />" + part + "</a></li>" ) );
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
$( "nav li a" ).closest( "li" )
|
$( "nav li a" ).closest( "li" )
|
||||||
.click( function () {
|
.click( function () {
|
||||||
|
@ -178,7 +172,7 @@
|
||||||
|
|
||||||
if ( idx >= 0 && idx < config.columnClasses.length ) {
|
if ( idx >= 0 && idx < config.columnClasses.length ) {
|
||||||
return config.columnClasses[idx];
|
return config.columnClasses[idx];
|
||||||
}
|
};
|
||||||
return "unknown";
|
return "unknown";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -219,7 +213,7 @@
|
||||||
$entries = $( "#details tr.entry" );
|
$entries = $( "#details tr.entry" );
|
||||||
if ( $entries.size() === 0 || $entries.size() === 1 && $entries.find( "td.name a" ).text() === "Parent Directory" ) {
|
if ( $entries.size() === 0 || $entries.size() === 1 && $entries.find( "td.name a" ).text() === "Parent Directory" ) {
|
||||||
$( "#details" ).append( $( "<div class='empty'>empty</div>" ) );
|
$( "#details" ).append( $( "<div class='empty'>empty</div>" ) );
|
||||||
}
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -228,20 +222,20 @@
|
||||||
var order = document.location.search;
|
var order = document.location.search;
|
||||||
if ( order === "" ) {
|
if ( order === "" ) {
|
||||||
order = config.defaultSortOrder;
|
order = config.defaultSortOrder;
|
||||||
}
|
};
|
||||||
var $icon;
|
var $icon;
|
||||||
if ( order.indexOf( "O=A" ) >= 0 ) {
|
if ( order.indexOf( "O=A" ) >= 0 ) {
|
||||||
$icon = $( "<img src='" + config.icons.ascending + "' class='sort' alt='ascending' />" );
|
$icon = $( "<img src='" + config.icons.ascending + "' class='sort' alt='ascending' />" );
|
||||||
} else {
|
} else {
|
||||||
$icon = $( "<img src='" + config.icons.descending + "' class='sort' alt='descending' />" );
|
$icon = $( "<img src='" + config.icons.descending + "' class='sort' alt='descending' />" );
|
||||||
}
|
};
|
||||||
if ( order.indexOf( "C=N" ) >= 0 ) {
|
if ( order.indexOf( "C=N" ) >= 0 ) {
|
||||||
$( "#details th.name a" ).append( $icon );
|
$( "#details th.name a" ).append( $icon );
|
||||||
} else if ( order.indexOf( "C=M" ) >= 0 ) {
|
} else if ( order.indexOf( "C=M" ) >= 0 ) {
|
||||||
$( "#details th.date a" ).prepend( $icon );
|
$( "#details th.date a" ).prepend( $icon );
|
||||||
} else if ( order.indexOf( "C=S" ) >= 0 ) {
|
} else if ( order.indexOf( "C=S" ) >= 0 ) {
|
||||||
$( "#details th.size a" ).prepend( $icon );
|
$( "#details th.size a" ).prepend( $icon );
|
||||||
}
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -275,7 +269,7 @@
|
||||||
$entry.addClass( "folder" );
|
$entry.addClass( "folder" );
|
||||||
} else {
|
} else {
|
||||||
$entry.addClass( "file" );
|
$entry.addClass( "file" );
|
||||||
}
|
};
|
||||||
} );
|
} );
|
||||||
$div.append( $( "<div class='clearfix'></div>" ) );
|
$div.append( $( "<div class='clearfix'></div>" ) );
|
||||||
$( "#icons" ).append( $div );
|
$( "#icons" ).append( $div );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue