This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<!-- Favicons Start --> | |
<!-- In case image.ico --> | |
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* jQuery Validate Emails with Regex */ | |
function validateEmail(Email) { | |
var pattern = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; | |
return $.trim(Email).match(pattern) ? true : false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* jQuery Validate Strings with Regex */ | |
function validateStrings(string) { | |
var pattern = /^[0-9a-zA-Z@_-]+$/; | |
return $.trim(string).match(pattern) ? true : false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sirv from 'sirv'; | |
import polka from 'polka'; | |
import compression from 'compression'; | |
import { createProxyMiddleware } from 'http-proxy-middleware'; | |
import * as sapper from '@sapper/server'; | |
const { PORT, NODE_ENV } = process.env; | |
const dev = NODE_ENV === 'development'; | |
const server = polka(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import request from 'utils/request'; | |
export const downloadFileRequest = id => | |
request.get(`/files/${id}`, { | |
responseType: 'blob', | |
timeout: 30000, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fileSaver from 'utils/fileSaver'; | |
import fileReader from 'utils/fileReader'; | |
import { downloadFileRequest } from './api'; | |
import * as types from './actionTypes'; | |
export const downloadFile = id => async dispatch => { | |
try { | |
dispatch({ | |
type: types.DOWNLOAD_FILE_REQUEST, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default file => { | |
const fileReader = new FileReader(); | |
return new Promise((resolve, reject) => { | |
fileReader.onerror = () => { | |
fileReader.abort(); | |
reject(new Error('Problem parsing file')); | |
}; | |
fileReader.onload = () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fileSaver from 'utils/fileSaver'; | |
import { downloadFileRequest } from './api'; | |
import * as types from './actionTypes'; | |
export const downloadFile = id => async dispatch => { | |
try { | |
dispatch({ | |
type: types.DOWNLOAD_FILE_REQUEST, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import FileSaver from 'file-saver'; | |
export default (fileData, fileName) => FileSaver.saveAs(fileData, fileName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { uploadFileRequest } from './api'; | |
import * as types from './actionTypes'; | |
export const uploadFile = data => async dispatch => { | |
try { | |
dispatch({ | |
type: types.UPLOAD_FILE_REQUEST, | |
}); | |
await uploadFileRequest(data); |
NewerOlder