mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-11-03 21:17:33 +08:00
fix (format): code formatting
This commit is contained in:
@ -1,44 +1,44 @@
|
|||||||
export const URL_HOME = '/';
|
export const URL_HOME = "/";
|
||||||
export function goToHome(history){
|
export function goToHome(history){
|
||||||
history.push(URL_HOME);
|
history.push(URL_HOME);
|
||||||
return Promise.resolve('ok');
|
return Promise.resolve("ok");
|
||||||
}
|
}
|
||||||
|
|
||||||
export const URL_FILES = '/files';
|
export const URL_FILES = "/files";
|
||||||
export function goToFiles(history, path, state){
|
export function goToFiles(history, path, state){
|
||||||
history.push(URL_FILES+"?path="+encode_path(path), state);
|
history.push(URL_FILES+"?path="+encode_path(path), state);
|
||||||
return Promise.resolve('ok');
|
return Promise.resolve("ok");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export const URL_VIEWER = '/view';
|
export const URL_VIEWER = "/view";
|
||||||
export function goToViewer(history, path, state){
|
export function goToViewer(history, path, state){
|
||||||
history.push(URL_VIEWER+'?path='+encode_path(path), state);
|
history.push(URL_VIEWER+"?path="+encode_path(path), state);
|
||||||
return Promise.resolve('ok');
|
return Promise.resolve("ok");
|
||||||
}
|
}
|
||||||
|
|
||||||
export const URL_LOGIN = '/login';
|
export const URL_LOGIN = "/login";
|
||||||
export function goToLogin(history){
|
export function goToLogin(history){
|
||||||
history.push(URL_EDIT);
|
history.push(URL_EDIT);
|
||||||
return Promise.resolve('ok');
|
return Promise.resolve("ok");
|
||||||
}
|
}
|
||||||
|
|
||||||
export const URL_LOGOUT = '/logout';
|
export const URL_LOGOUT = "/logout";
|
||||||
export function goToLogout(history){
|
export function goToLogout(history){
|
||||||
history.push(URL_LOGOUT);
|
history.push(URL_LOGOUT);
|
||||||
return Promise.resolve('ok');
|
return Promise.resolve("ok");
|
||||||
}
|
}
|
||||||
|
|
||||||
function encode_path(path){
|
function encode_path(path){
|
||||||
if(/%2F/.test(path) === false){
|
if(/%2F/.test(path) === false){
|
||||||
return encodeURIComponent(path).replace(/%2F/g, '/'); // replace slash to make url more friendly
|
return encodeURIComponent(path).replace(/%2F/g, "/"); // replace slash to make url more friendly
|
||||||
}else{
|
}else{
|
||||||
return encodeURIComponent(path) // in case you got a %2F folder somewhere ...
|
return encodeURIComponent(path) // in case you got a %2F folder somewhere ...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function prepare(path){
|
export function prepare(path){
|
||||||
return encodeURIComponent(decodeURIComponent(path.replace(/%/g, '%25')));
|
return encodeURIComponent(decodeURIComponent(path.replace(/%/g, "%25")));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function urlParams() {
|
export function urlParams() {
|
||||||
|
|||||||
@ -38,10 +38,10 @@ export class Submenu extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount(){
|
componentDidMount(){
|
||||||
window.addEventListener('keydown', this._onKeyPress);
|
window.addEventListener("keydown", this._onKeyPress);
|
||||||
}
|
}
|
||||||
componentWillUnmount(){
|
componentWillUnmount(){
|
||||||
window.removeEventListener('keydown', this._onKeyPress);
|
window.removeEventListener("keydown", this._onKeyPress);
|
||||||
}
|
}
|
||||||
|
|
||||||
onNew(type){
|
onNew(type){
|
||||||
|
|||||||
Reference in New Issue
Block a user