<div class="box-body">
<div id="select">
<label for="sortBy">SORT BY : </label>
<select id="sortBy">
<option></option>
<option>#</option>
<option>Title</option>
<option>Created</option>
<option>Code</option>
<option>Bots</option>
<option>Comment</option>
<option>Action</option>
</select>
</div>
<table id="groups" class="table table-bordered">
<thead>
<tr>
<th></th>
<th>#</th>
<th>Title</th>
<th>Created</th>
<th>Code</th>
<th>Bots</th>
<th>Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td>84</td>
<td>3320</td>
<td>0000-00-00 00:00:00</td>
<td>3320</td>
<td>1</td>
<td></td>
</tr>
<tr>
<td></td>
<td>83</td>
<td>3309</td>
<td>0000-00-00 00:00:00</td>
<td>3309</td>
<td>1</td>
<td></td>
</tr>
<tr>
<td></td>
<td>82</td>
<td>5911</td>
<td>0000-00-00 00:00:00</td>
<td>5911</td>
<td>2</td>
<td></td>
</tr>
<tr>
<td></td>
<td>81</td>
<td>3408</td>
<td>0000-00-00 00:00:00</td>
<td>3408</td>
<td>2</td>
<td></td>
</tr>
<tr>
<td></td>
<td>80</td>
<td>1005</td>
<td>0000-00-00 00:00:00</td>
<td>1005</td>
<td>3</td>
<td></td>
</tr>
<tr>
<td></td>
<td>79</td>
<td>3337</td>
<td>0000-00-00 00:00:00</td>
<td>3337</td>
<td>2</td>
<td></td>
</tr>
<tr>
<td></td>
<td>78</td>
<td>3195</td>
<td>0000-00-00 00:00:00</td>
<td>3195</td>
<td>2</td>
<td></td>
</tr>
<tr>
<td></td>
<td>77</td>
<td>3398</td>
<td>0000-00-00 00:00:00</td>
<td>3398</td>
<td>1</td>
<td></td>
</tr>
<tr>
<td></td>
<td>76</td>
<td>3377</td>
<td>0000-00-00 00:00:00</td>
<td>3377</td>
<td>5</td>
<td></td>
</tr>
<tr>
<td></td>
<td>75</td>
<td>5915</td>
<td>0000-00-00 00:00:00</td>
<td>5915</td>
<td>1</td>
<td></td>
</tr>
<tr>
<td></td>
<td>72</td>
<td>5716</td>
<td>0000-00-00 00:00:00</td>
<td>5716</td>
<td>8</td>
<td></td>
</tr>
</tbody>
</table>
<form method="post" action="/task/delete">
<input type="hidden" name="id" value="8">
<button type="submit" class="z-index btn btn-danger">Delete</button>
</form>
</div>
</div>
<!-- end widget content -->
</div>
<!-- end widget div -->
</div>
</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<div class="col-sm-6">
<div class="form-group">
<div class="input-group">
<input class="form-control hasDatepicker" id="from" type="text" placeholder="From">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
const { createCanvas, loadImage } = require('canvas')
const canvas = createCanvas(200, 200)
const ctx = canvas.getContext('2d')
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const MiniCssExtractPlugin = require("mini-css-extract-plugin")
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const fs = require('fs')
function generateHtmlPlugins(templateDir) {
const templateFiles = fs.readdirSync(path.resolve(__dirname, templateDir));
return templateFiles.map(item => {
const parts = item.split('.');
const name = parts[0];
const extension = parts[1];
return new HtmlWebpackPlugin({
filename: `${name}.html`,
template: path.resolve(__dirname, `${templateDir}/${name}.${extension}`),
inject: false,
})
})
}
const htmlPlugins = generateHtmlPlugins('./src/html/views')
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
optimization: {
minimizer: [
new OptimizeCssAssetsPlugin({}),
new UglifyJsPlugin({})
]
},
devServer: {
contentBase: path.resolve(__dirname, 'dist'),
port: 4200
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
template: './src/html/views/index.html',
}),
new HtmlWebpackPlugin({
filename: 'header.html',
template: './src/html/includes/header.html',
}),
new HtmlWebpackPlugin({
filename: 'aside.html',
template: './src/html/includes/aside.html',
}),
new MiniCssExtractPlugin({
filename: 'css/style.css'
})
].concat(htmlPlugins),
resolve: {
extensions: ['.js', '.ts']
},
module: {
rules: [
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, 'css-loader']
},
{
test: /\.scss$/,
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader']
},
{
test: /\.html$/,
include: path.resolve(__dirname, 'src/html/includes'),
use: ['raw-loader']
},
// {
// test: /\.html$/, // tells webpack to use this loader for all ".html" files
// loader: 'html-loader'
// },
// {
//test: /\.(png|jpe?g|gif)$/i,
// use: [
// {
// loader:'file-loader',
// options:{
// name:'[name].[ext]',
// outputPath:'./',
// useRelativePath:true
// }
// }
// ]
// },
{
test: /\.(js|ts)$/,
exclude: /node_modules/,
loader: "babel-loader"
}
]
}
}
{
"name": "test",
"version": "1.0.0",
"description": "only for test from webformyself",
"main": "index.js",
"scripts": {
"dev": "webpack-dev-server --mode development --open",
"build": "webpack --mode production --open"
},
"keywords": [
"javascript"
],
"author": "Alexei",
"license": "ISC",
"devDependencies": {
"@babel/cli": "^7.6.4",
"@babel/core": "^7.6.4",
"@babel/preset-env": "^7.6.3",
"babel-loader": "^8.0.6",
"css-loader": "^3.2.0",
"file-loader": "^4.2.0",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.8.0",
"node-sass": "^4.12.0",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"raw-loader": "^3.1.0",
"sass-loader": "^8.0.0",
"style-loader": "^1.0.0",
"uglifyjs-webpack-plugin": "^2.2.0",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.9",
"webpack-dev-server": "^3.8.2"
},
"dependencies": {
"@babel/polyfill": "^7.6.0",
"bootstrap": "^4.3.1",
"canvas": "^2.6.0",
"jquery": "^3.4.1",
"popper.js": "^1.16.0"
}
}
arr.filter( (num) => num > 0 && num % parseInt(num) === 0 )
// после стрелочной =>
// Если условия num > 0 && num % parseInt(num) === 0 соответствует правде, то тогда, значение num сохраняется в массиве arr. Если нет - тогда удаляется!
num > 0 && num % parseInt(num) === 0
const squaredIntegers = arr.filter( (num) => num > 0 && num % parseInt(num) === 0 ).map( (num) => Math.pow(num, 2) );
const squaredIntegers = arr.filter( (num) => num > 0 && num % parseInt(num) === 0 ).map( (num) => Math.pow(num, 2) );