feat ContextMenu: Rename and Delete

This commit is contained in:
Mahdi Dibaiee
2015-09-03 15:02:46 +04:30
parent ee6f5d6ffb
commit 79ae4c1a47
94 changed files with 4211 additions and 2216 deletions

View File

@ -1,6 +1,7 @@
import { CHANGE_DIRECTORY } from 'actions/types';
export default function changedir(dir) {
if (dir === 'sdcard') dir = '';
return {
type: CHANGE_DIRECTORY,
dir

32
src/js/actions/dialog.js Normal file
View File

@ -0,0 +1,32 @@
import { DIALOG } from 'actions/types';
export function show(id) {
return {
type: DIALOG,
active: true,
id
}
}
export function hide(id) {
return {
type: DIALOG,
active: false,
id
}
}
export function toggle(id) {
return {
type: DIALOG,
active: 'toggle',
id
}
}
export function hideAll() {
return {
type: DIALOG,
active: false
}
}

35
src/js/actions/file.js Normal file
View File

@ -0,0 +1,35 @@
import { CREATE_FILE, SHARE_FILE, RENAME_FILE, ACTIVE_FILE, DELETE_FILE } from 'actions/types';
export function create(path, name) {
return {
type: CREATE_FILE,
path, name
}
}
export function share() {
return {
type: SHARE_FILE
}
}
export function rename(file, name) {
return {
type: RENAME_FILE,
file, name
}
}
export function active(file) {
return {
type: ACTIVE_FILE,
file
}
}
export function deleteFile(file) {
return {
type: DELETE_FILE,
file
}
}

View File

@ -0,0 +1,29 @@
import { LIST_FILES, FILES_VIEW, REFRESH } from 'actions/types';
import store from 'store';
export function refresh() {
return {
type: REFRESH
}
}
export function toggle(state) {
return {
type: FILES_VIEW,
view: 'toggle'
}
}
export function details(state) {
return {
type: FILES_VIEW,
view: 'details'
}
}
export function list(state) {
return {
type: FILES_VIEW,
view: 'list'
}
}

32
src/js/actions/menu.js Normal file
View File

@ -0,0 +1,32 @@
import { MENU } from 'actions/types';
export function show(id, x, y) {
return {
type: MENU,
active: true,
id, x, y
}
}
export function hide(id) {
return {
type: MENU,
active: false,
id
}
}
export function toggle(id, x, y) {
return {
type: MENU,
active: 'toggle',
id, x, y
}
}
export function hideAll() {
return {
type: MENU,
active: false
}
}

View File

@ -0,0 +1,22 @@
import { NAVIGATION, TOGGLE } from 'actions/types';
export function show() {
return {
type: NAVIGATION,
active: true
}
}
export function hide() {
return {
type: NAVIGATION,
active: false
}
}
export function toggle() {
return {
type: NAVIGATION,
active: TOGGLE
}
}

View File

@ -1,9 +1,26 @@
const TYPES = {
CHANGE_DIRECTORY: Symbol(),
LIST_FILES: Symbol(),
SORT: Symbol(),
SEARCH: Symbol(),
REFRESH: Symbol()
CHANGE_DIRECTORY: Symbol('CHANGE_DIRECTORY'),
LIST_FILES: Symbol('LIST_FILES'),
FILES_VIEW: Symbol('FILES_VIEW'),
NAVIGATION: Symbol('NAVIGATION'),
TOGGLE: Symbol('TOGGLE'),
REFRESH: Symbol('REFRESH'),
SORT: Symbol('SORT'),
NEW_FILE: Symbol('NEW_FILE'),
CREATE_FILE: Symbol('CREATE_FILE'),
SHARE_FILE: Symbol('SHARE_FILE'),
RENAME_FILE: Symbol('RENAME_FILE'),
ACTIVE_FILE: Symbol('ACTIVE_FILE'),
DELETE_FILE: Symbol('DELETE_FILE'),
MENU: Symbol('MENU'),
DIALOG: Symbol('DEBUG'),
SEARCH: Symbol('SEARCH')
};
export default TYPES;