├── .npmrc ├── public ├── robots.txt ├── images │ ├── child.webp │ ├── icon.png │ ├── fav-icon.png │ ├── nawikurdi-cover.jpg │ └── bkra.svg ├── js │ ├── main.js │ ├── general.js │ ├── submit-name.js │ ├── favorites.js │ ├── dist │ │ └── main.css │ └── index.js ├── sitemap.xml └── css │ ├── main.min.css │ ├── grid-lite.css │ └── main.css ├── .parcel-cache ├── data.mdb ├── lock.mdb ├── 00d44b4c0e57f9e6 ├── 047a22f4a329426f ├── 11cb1bf4ad566702 ├── 150bc07ca2d5a4f7 ├── 3c1fd8ea3f8f242e ├── 55c7c17cd4e0d370 ├── 87db294bb2165d0e └── 91f338522e924423 ├── views ├── error.ejs ├── templates │ ├── footer.ejs │ ├── styles.ejs │ ├── scripts.ejs │ ├── header.ejs │ └── seo.ejs ├── single.ejs ├── layout.ejs ├── favorites.ejs ├── submit-name.ejs ├── about.ejs └── index.ejs ├── helpers ├── makePlainText.js ├── dataHelpers │ ├── sortData.js │ └── filterData.js ├── customRender.js ├── decodeHTMLEntities.js └── viewFunctions.js ├── database ├── seeds │ └── names.js ├── knex.js ├── knexfile.js └── migrations │ ├── 20200313222432_createVotesTable.js │ └── 20200305113828_createNamesTable.js ├── .env.sample.txt ├── config.js ├── middlewares └── validators │ ├── validate.js │ ├── common │ ├── searchQuery.js │ └── paginate.js │ └── main.js ├── .gitignore ├── .eslintrc.json ├── .cache ├── 15 │ └── 67792d57a4022e2443de88a68fa461.json ├── 19 │ └── 97ddd0fcf11b2c672f84ac4a014035.json ├── 24 │ └── 22ab86c6902f4323bfc163a6786776.json ├── 26 │ └── 5a68d9da80034653411148bf6da7eb.json ├── 31 │ └── 8d6b61a53d5ada402c2d05624b59e8.json ├── 35 │ └── 82b196b00e02fa61b230047b9aff19.json ├── 44 │ └── 46faf117461e516e6f53a2dba15ad7.json ├── 53 │ └── b4ca6e964ef8d9ccd55ec8c9f8e800.json ├── 59 │ └── d5e9f454a54db2e0ccd1b0cc6cd1d2.json ├── 86 │ └── cdf3bfe72280e9c628ab0e22dc4b39.json ├── 92 │ └── 85d6b955ec99a104f19fc55134c9a6.json ├── f1 │ └── 859b7b8623f0f994d670b4c356189d.json ├── c3 │ └── 55fe836d5bea7a7f5d22f7ff3b8c4c.json ├── 0b │ └── 5c7c8ed6ae61ed0532ffaedf5da9fa.json ├── c9 │ ├── 7488b1ef9b56ad2e7ee2b4512a8c96.json │ └── 209d10a4185542f0197a16fa8da77b.json ├── 5a │ └── 7712e6a084997629eb40eea68df2f3.json ├── b0 │ └── 7e0cfe706fe895feef6178c43c69f6.json ├── b7 │ └── 2ab41e12ccf0f517f726b92c878366.json ├── e7 │ └── 5c10888750cbf78e75c8715912ccec.json ├── fd │ └── f404f81a5c46e927a4a98836a404e5.json ├── 3d │ └── 1f67c7837ae25347a92e63549fe6c9.json ├── 9d │ └── 40865e4c07f966af4925716c581515.json ├── 0c │ └── 0bdab1ca4d585f2597563d6aff2bae.json ├── 02 │ └── 1bd56691dff93528ba0b0380dcc30d.json ├── c8 │ └── 02239e08576993846d9b27d73bc084.json ├── 9a │ └── e604b62f9be01356e6fc48888f8cd3.json ├── c7 │ └── 19683beffe90d524c1f70805c474ab.json ├── 0e │ └── a470b50dcbeaa5e8eddc0c138443f1.json ├── 4e │ └── 12c6582c6c0f5c63b0734b794f0924.json └── b6 │ └── 4b7486415f2c6d25a4571f00338d2e.json ├── LICENSE ├── package.json ├── app.js ├── routes ├── api.js └── ui.js ├── bin └── www ├── README.md └── queries.js /.npmrc: -------------------------------------------------------------------------------- 1 | scripts-prepend-node-path=true -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | Sitemap: https://nawikurdi.com/sitemap.xml 2 | User-agent: * 3 | Allow: / -------------------------------------------------------------------------------- /.parcel-cache/data.mdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopersTree/nawikurdi/HEAD/.parcel-cache/data.mdb -------------------------------------------------------------------------------- /.parcel-cache/lock.mdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopersTree/nawikurdi/HEAD/.parcel-cache/lock.mdb -------------------------------------------------------------------------------- /public/images/child.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopersTree/nawikurdi/HEAD/public/images/child.webp -------------------------------------------------------------------------------- /public/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopersTree/nawikurdi/HEAD/public/images/icon.png -------------------------------------------------------------------------------- /public/images/fav-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopersTree/nawikurdi/HEAD/public/images/fav-icon.png -------------------------------------------------------------------------------- /views/error.ejs: -------------------------------------------------------------------------------- 1 |

<%= message %>

2 |

<%= error.status %>

3 |
<%= error.stack %>
4 | -------------------------------------------------------------------------------- /.parcel-cache/00d44b4c0e57f9e6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopersTree/nawikurdi/HEAD/.parcel-cache/00d44b4c0e57f9e6 -------------------------------------------------------------------------------- /.parcel-cache/047a22f4a329426f: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopersTree/nawikurdi/HEAD/.parcel-cache/047a22f4a329426f -------------------------------------------------------------------------------- /.parcel-cache/11cb1bf4ad566702: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopersTree/nawikurdi/HEAD/.parcel-cache/11cb1bf4ad566702 -------------------------------------------------------------------------------- /.parcel-cache/150bc07ca2d5a4f7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopersTree/nawikurdi/HEAD/.parcel-cache/150bc07ca2d5a4f7 -------------------------------------------------------------------------------- /.parcel-cache/3c1fd8ea3f8f242e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopersTree/nawikurdi/HEAD/.parcel-cache/3c1fd8ea3f8f242e -------------------------------------------------------------------------------- /.parcel-cache/55c7c17cd4e0d370: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopersTree/nawikurdi/HEAD/.parcel-cache/55c7c17cd4e0d370 -------------------------------------------------------------------------------- /.parcel-cache/87db294bb2165d0e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopersTree/nawikurdi/HEAD/.parcel-cache/87db294bb2165d0e -------------------------------------------------------------------------------- /.parcel-cache/91f338522e924423: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopersTree/nawikurdi/HEAD/.parcel-cache/91f338522e924423 -------------------------------------------------------------------------------- /helpers/makePlainText.js: -------------------------------------------------------------------------------- 1 | module.exports = (content = '') =>{ 2 | return (content+"").replace(/<[^>]*>?/gm, ''); 3 | } -------------------------------------------------------------------------------- /public/images/nawikurdi-cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevelopersTree/nawikurdi/HEAD/public/images/nawikurdi-cover.jpg -------------------------------------------------------------------------------- /helpers/dataHelpers/sortData.js: -------------------------------------------------------------------------------- 1 | module.exports = (sortArray = [], query) => { 2 | sortArray.map(sort => query.orderBy(sort.column, sort.value)); 3 | }; 4 | -------------------------------------------------------------------------------- /database/seeds/names.js: -------------------------------------------------------------------------------- 1 | const namesJson = require('./names.json'); 2 | exports.seed = (knex) => knex('names').del() 3 | .then(() => knex('names').insert(namesJson)); 4 | -------------------------------------------------------------------------------- /helpers/dataHelpers/filterData.js: -------------------------------------------------------------------------------- 1 | module.exports = (filters = [], query) => { 2 | filters.map(filter => query.andWhere(filter.column, 'like', `${filter.value}%`)); 3 | }; 4 | -------------------------------------------------------------------------------- /.env.sample.txt: -------------------------------------------------------------------------------- 1 | PORT=3001 2 | host=localhost 3 | user=root 4 | password= 5 | database=nawikurdi_db 6 | public_website_link = "https://nawikurdi.com" 7 | cookie_secret="secret" 8 | 9 | -------------------------------------------------------------------------------- /public/js/main.js: -------------------------------------------------------------------------------- 1 | import * as index from './index'; 2 | import * as favorites from './favorites'; 3 | import * as submit_name from './submit-name'; 4 | 5 | window.nawikurdi = { 6 | index: index, 7 | favorites: favorites, 8 | submit_name: submit_name 9 | } -------------------------------------------------------------------------------- /config.js: -------------------------------------------------------------------------------- 1 | var db = require('knex')({ 2 | client: 'mysql', 3 | connection: { 4 | host: process.env.host, 5 | user: process.env.user, 6 | password: process.env.password, 7 | database: process.env.database 8 | } 9 | }); 10 | 11 | module.exports = db; -------------------------------------------------------------------------------- /database/knex.js: -------------------------------------------------------------------------------- 1 | 2 | const db = require('knex')({ 3 | client: 'mysql', 4 | connection: { 5 | host: process.env.host, 6 | user: process.env.user, 7 | password: process.env.password, 8 | database: process.env.database, 9 | debug: false, 10 | }, 11 | }); 12 | 13 | module.exports = db; 14 | -------------------------------------------------------------------------------- /middlewares/validators/validate.js: -------------------------------------------------------------------------------- 1 | const { validationResult } = require('express-validator'); 2 | 3 | module.exports = (req, res, next) => { 4 | const errors = validationResult(req); 5 | if (!errors.isEmpty()) { 6 | return res.status(422).json({ errors: errors.array() }); 7 | } 8 | next(); 9 | return null; 10 | }; 11 | -------------------------------------------------------------------------------- /middlewares/validators/common/searchQuery.js: -------------------------------------------------------------------------------- 1 | const { query } = require('express-validator'); 2 | const validate = require('../validate'); 3 | 4 | module.exports = [ 5 | query('q') 6 | .optional() 7 | .isLength({ min: 1, max: 255 }) 8 | .withMessage('invalid query length must be between 1->255'), 9 | validate, 10 | ]; 11 | -------------------------------------------------------------------------------- /public/sitemap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | https://nawikurdi.com/ 4 | 5 | 6 | https://nawikurdi.com/submit-name 7 | 8 | 9 | https://nawikurdi.com/about 10 | 11 | 12 | https://nawikurdi.com/favorites 13 | 14 | 15 | -------------------------------------------------------------------------------- /views/templates/footer.ejs: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_STORE 2 | node_modules 3 | scripts/flow/*/.flowconfig 4 | *~ 5 | *.pyc 6 | .grunt 7 | _SpecRunner.html 8 | __benchmarks__ 9 | build/ 10 | remote-repo/ 11 | coverage/ 12 | .module-cache 13 | fixtures/dom/public/react-dom.js 14 | fixtures/dom/public/react.js 15 | test/the-files-to-test.generated.js 16 | *.log* 17 | chrome-user-data 18 | *.sublime-project 19 | *.sublime-workspace 20 | .idea 21 | *.iml 22 | .vscode 23 | *.swp 24 | *.swo 25 | .env -------------------------------------------------------------------------------- /helpers/customRender.js: -------------------------------------------------------------------------------- 1 | const {globalVars} = require('./viewFunctions'); 2 | const makePlainText = require('./makePlainText'); 3 | const decodeHTMLEntities = require('./decodeHTMLEntities'); 4 | module.exports = (req, res, info = { 5 | view: 'index', 6 | title: 'ماڵپه‌ری ناوی كوردی', 7 | }) =>{ 8 | res.render(info.view, { 9 | ...globalVars(req, res), 10 | makePlainText, 11 | decodeHTMLEntities, 12 | ...info 13 | }) 14 | } -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "commonjs": true, 4 | "es6": true, 5 | "node": true 6 | }, 7 | "extends": [ 8 | "airbnb-base" 9 | ], 10 | "globals": { 11 | "Atomics": "readonly", 12 | "SharedArrayBuffer": "readonly" 13 | }, 14 | "parserOptions": { 15 | "ecmaVersion": 2018 16 | }, 17 | "rules": { 18 | "linebreak-style": "off", 19 | "no-param-reassign": "off" 20 | } 21 | } -------------------------------------------------------------------------------- /helpers/decodeHTMLEntities.js: -------------------------------------------------------------------------------- 1 | module.exports = (text = '') => { 2 | var entities = [ 3 | ['&', '&'], 4 | ['amp', '&'], 5 | ['apos', '\''], 6 | ['#x27', '\''], 7 | ['#x2F', '/'], 8 | ['#39', '\''], 9 | ['#47', '/'], 10 | ['lt', '<'], 11 | ['gt', '>'], 12 | ['nbsp', ' '], 13 | ['quot', '"'] 14 | ]; 15 | 16 | for (var i = 0, max = entities.length; i < max; ++i) 17 | text = (text+"").replace(new RegExp('&'+entities[i][0]+';', 'g'), entities[i][1]); 18 | 19 | return text; 20 | } -------------------------------------------------------------------------------- /database/knexfile.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | require('dotenv').config({ path: path.join(__dirname, '../', '.env') }); 3 | 4 | module.exports = { 5 | client: 'mysql', 6 | connection: { 7 | database: process.env.database, 8 | user: process.env.user, 9 | password: process.env.password, 10 | }, 11 | port: 80, 12 | pool: { 13 | min: 2, 14 | max: 10, 15 | }, 16 | seeds: { 17 | directory: path.join(__dirname, './seeds/'), 18 | }, 19 | migrations: { 20 | tableName: 'knex_migrations', 21 | directory: path.join(__dirname, './migrations/'), 22 | }, 23 | 24 | }; 25 | -------------------------------------------------------------------------------- /views/templates/styles.ejs: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /database/migrations/20200313222432_createVotesTable.js: -------------------------------------------------------------------------------- 1 | 2 | exports.up = (knex) => knex.schema.createTable('votes', (table) => { 3 | table.increments('id').primary(); 4 | table.string('uid', 350).notNullable().defaultTo('default user id'); 5 | table.integer('nameid').notNullable().defaultTo(0); 6 | table.enu('impact', ['positive','negative']).defaultTo('negative'); 7 | table.datetime('created_at', { precision: 6 }) 8 | // .defaultTo(knex.fn.now()); 9 | table.charset('utf8'); 10 | table.collate('utf8_general_ci'); 11 | }); 12 | 13 | exports.down = (knex) => knex.schema.dropTable('votes'); 14 | -------------------------------------------------------------------------------- /views/templates/scripts.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /helpers/viewFunctions.js: -------------------------------------------------------------------------------- 1 | const url = require('url'); 2 | module.exports = { 3 | globalVars: (req, res) =>{ 4 | const originalUrl = (req.originalUrl).split('/') 5 | var activePage = originalUrl[1] || 'home'; 6 | console.log() 7 | return { 8 | seoFromContent: false, 9 | activePage: activePage, 10 | public_website_link: process.env.public_website_link, 11 | isSingle: !isNaN(activePage), 12 | // API_LINK: process.env.API_LINK, 13 | // BASE_API_LINK: `${parsedURL.protocol}//${parsedURL.host}`, 14 | title: 'ماڵپه‌ری ناوی كوردی', 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /views/single.ejs: -------------------------------------------------------------------------------- 1 | <% let gender = 'هاوبه‌ش'; 2 | if(gender == 'M' || gender == 'm') gender ='كور'; 3 | else if(gender == 'F' || gender == 'F') gender ='كچ'; 4 | %> 5 |
6 |
7 |

<%=name%> ( <%= gender %> )

8 |

9 | <%=desc%> 10 |

11 |
12 |
13 |
بنێرە بۆ هاوڕێکانت
14 |
15 |
16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /views/layout.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | <%- include('templates/seo.ejs') %> 7 | 8 | <%- include('templates/styles.ejs') %> 9 | 10 | 11 | 12 | 13 | <%- include('templates/header.ejs') %> 14 | 15 | <%-body%> 16 | 17 | <%- include('templates/footer.ejs') %> 18 | 19 | 20 | <%- include('templates/scripts.ejs') %> 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /middlewares/validators/common/paginate.js: -------------------------------------------------------------------------------- 1 | const { query } = require('express-validator'); 2 | const validate = require('../validate'); 3 | 4 | module.exports = [ 5 | query('limit') 6 | .exists() 7 | .withMessage('limit value is required') 8 | .isInt({ gt: 0 }) 9 | .withMessage('invalid limit value') 10 | .customSanitizer((value) => { 11 | if (Number.isNaN(value)) { 12 | return 10; 13 | } 14 | return Number.parseInt(value, 10); 15 | }), 16 | query('offset') 17 | .exists() 18 | .withMessage('offset value is required') 19 | .isInt({ gt: -1 }) 20 | .withMessage('invalid offset value') 21 | .customSanitizer((value) => { 22 | if (Number.isNaN(value)) { 23 | return 0; 24 | } 25 | return Number.parseInt(value, 10); 26 | }), 27 | validate, 28 | ]; 29 | -------------------------------------------------------------------------------- /public/js/general.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // Returns a function, that, as long as it continues to be invoked, will not 3 | // be triggered. The function will be called after it stops being called for 4 | // N milliseconds. If `immediate` is passed, trigger the function on the 5 | // leading edge, instead of the trailing. 6 | debounce: (func, wait, immediate)=>{ 7 | var timeout; 8 | return function() { 9 | var context = this, args = arguments; 10 | var later = function() { 11 | timeout = null; 12 | if (!immediate) func.apply(context, args); 13 | }; 14 | var callNow = immediate && !timeout; 15 | clearTimeout(timeout); 16 | timeout = setTimeout(later, wait); 17 | if (callNow) func.apply(context, args); 18 | }; 19 | } 20 | } -------------------------------------------------------------------------------- /database/migrations/20200305113828_createNamesTable.js: -------------------------------------------------------------------------------- 1 | 2 | exports.up = (knex) => knex.schema.createTable('names', (table) => { 3 | table.increments('nameid').primary(); 4 | table.string('name', 350).notNullable().defaultTo('default name'); 5 | table.string('desc', 350).defaultTo(''); 6 | table.enu('gender', ['M','F','O']).defaultTo('O'); 7 | table.boolean('sended').notNullable().defaultTo(0); 8 | table.boolean('deleted').notNullable().defaultTo(0); 9 | table.boolean('activated').notNullable().defaultTo(0); 10 | table.integer('positive_votes').notNullable().defaultTo(0); 11 | table.integer('negative_votes').notNullable().defaultTo(0); 12 | table.datetime('created_at', { precision: 6 }) 13 | // .defaultTo(knex.fn.now()); 14 | table.charset('utf8'); 15 | table.collate('utf8_general_ci'); 16 | }); 17 | 18 | exports.down = (knex) => knex.schema.dropTable('names'); 19 | -------------------------------------------------------------------------------- /.cache/f1/859b7b8623f0f994d670b4c356189d.json: -------------------------------------------------------------------------------- 1 | {"id":"general.js","dependencies":[{"name":"/home/aram/Desktop/nawikurdi/API/package.json","includedInParent":true,"mtime":1590908189847}],"generated":{"js":"module.exports = {\n // Returns a function, that, as long as it continues to be invoked, will not\n // be triggered. The function will be called after it stops being called for\n // N milliseconds. If `immediate` is passed, trigger the function on the\n // leading edge, instead of the trailing.\n debounce: function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this,\n args = arguments;\n\n var later = function later() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n }\n};"},"sourceMaps":null,"error":null,"hash":"67a53b2cc1b82c58571b95c4c9af6e52","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /.cache/c3/55fe836d5bea7a7f5d22f7ff3b8c4c.json: -------------------------------------------------------------------------------- 1 | {"id":"general.js","dependencies":[{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/package.json","includedInParent":true,"mtime":1590877042665}],"generated":{"js":"module.exports = {\n // Returns a function, that, as long as it continues to be invoked, will not\n // be triggered. The function will be called after it stops being called for\n // N milliseconds. If `immediate` is passed, trigger the function on the\n // leading edge, instead of the trailing.\n debounce: function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this,\n args = arguments;\n\n var later = function later() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n }\n};"},"sourceMaps":null,"error":null,"hash":"67a53b2cc1b82c58571b95c4c9af6e52","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 hozan7 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.cache/0b/5c7c8ed6ae61ed0532ffaedf5da9fa.json: -------------------------------------------------------------------------------- 1 | {"id":"../../node_modules/superagent/lib/is-object.js","dependencies":[{"name":"/home/aram/Desktop/nawikurdi/API/package.json","includedInParent":true,"mtime":1590908189847},{"name":"/home/aram/Desktop/nawikurdi/API/node_modules/superagent/package.json","includedInParent":true,"mtime":1590908293929},{"name":"/home/aram/Desktop/nawikurdi/API/node_modules/superagent/.browserslistrc","includedInParent":true,"mtime":1590908293929}],"generated":{"js":"\"use strict\";\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n/**\n * Check if `obj` is an object.\n *\n * @param {Object} obj\n * @return {Boolean}\n * @api private\n */\n\n\nfunction isObject(obj) {\n return obj !== null && _typeof(obj) === 'object';\n}\n\nmodule.exports = isObject;"},"sourceMaps":null,"error":null,"hash":"b2cc9a035cc88475b29c20c93250ff33","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /.cache/c9/7488b1ef9b56ad2e7ee2b4512a8c96.json: -------------------------------------------------------------------------------- 1 | {"id":"../../node_modules/superagent/lib/is-object.js","dependencies":[{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/package.json","includedInParent":true,"mtime":1590877042665},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/superagent/package.json","includedInParent":true,"mtime":1585830670205},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/superagent/.browserslistrc","includedInParent":true,"mtime":1585830670205}],"generated":{"js":"\"use strict\";\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n/**\n * Check if `obj` is an object.\n *\n * @param {Object} obj\n * @return {Boolean}\n * @api private\n */\n\n\nfunction isObject(obj) {\n return obj !== null && _typeof(obj) === 'object';\n}\n\nmodule.exports = isObject;"},"sourceMaps":null,"error":null,"hash":"b2cc9a035cc88475b29c20c93250ff33","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /.cache/5a/7712e6a084997629eb40eea68df2f3.json: -------------------------------------------------------------------------------- 1 | {"id":"../../node_modules/parcel/src/builtins/bundle-url.js","dependencies":[{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/package.json","includedInParent":true,"mtime":1590870273646},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/parcel/package.json","includedInParent":true,"mtime":1589055656075},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/parcel/src/.babelrc","includedInParent":true,"mtime":1589055656075}],"generated":{"js":"var bundleURL = null;\n\nfunction getBundleURLCached() {\n if (!bundleURL) {\n bundleURL = getBundleURL();\n }\n\n return bundleURL;\n}\n\nfunction getBundleURL() {\n // Attempt to find the URL of the current script and use that as the base URL\n try {\n throw new Error();\n } catch (err) {\n var matches = ('' + err.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\\/\\/[^)\\n]+/g);\n\n if (matches) {\n return getBaseURL(matches[0]);\n }\n }\n\n return '/';\n}\n\nfunction getBaseURL(url) {\n return ('' + url).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\\/\\/.+)\\/[^/]+$/, '$1') + '/';\n}\n\nexports.getBundleURL = getBundleURLCached;\nexports.getBaseURL = getBaseURL;"},"sourceMaps":null,"error":null,"hash":"60f34b2b826c8fa35ec86744f3cd5cbd","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /views/favorites.ejs: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 |

ورده‌كاری زیاتر‌

6 | 25 |
26 |
27 |
28 |
29 | 30 | 31 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "api", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "node ./bin/www", 7 | "dev": "npx nodemon ./bin/www & npx parcel watch public/js/main.js --dist-dir public/js/dist --no-source-maps", 8 | "dbMigration": "npx knex migrate:latest --knexfile ./database/knexfile.js", 9 | "dbSeeds": "npx knex seed:run --knexfile ./database/knexfile.js", 10 | "parcel:build": "npx parcel build public/js/main.js --dist-dir public/js/dist" 11 | }, 12 | "dependencies": { 13 | "@fingerprintjs/fingerprintjs": "^3.3.2", 14 | "compression": "^1.7.4", 15 | "cookie-parser": "^1.4.6", 16 | "cors": "2.8.5", 17 | "debug": "^4.3.3", 18 | "dotenv": "^14.3.2", 19 | "ejs": "^3.1.8", 20 | "express": "^4.17.2", 21 | "express-ejs-layouts": "^2.5.0", 22 | "express-validator": "^6.14.0", 23 | "helmet": "^5.0.2", 24 | "http-errors": "^2.0.0", 25 | "jquery": "^3.5.1", 26 | "knex": "^1.0.1", 27 | "morgan": "^1.10.0", 28 | "mysql": "^2.18.1", 29 | "mysql2": "^2.3.3", 30 | "notyf": "^3.7.0", 31 | "serve-favicon": "^2.5.0", 32 | "slugify": "^1.4.0", 33 | "superagent": "^7.1.1", 34 | "uniqid": "^5.2.0" 35 | }, 36 | "devDependencies": { 37 | "eslint": "6.2.2", 38 | "eslint-config-airbnb-base": "14.0.0", 39 | "eslint-plugin-import": "2.18.2", 40 | "parcel": "^2.2.1" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /views/submit-name.ejs: -------------------------------------------------------------------------------- 1 |
2 |
3 |

ناوێكی نوێ بنێره‌

4 |

5 | هه‌ركاتێك ناوێكی نوێمان بۆدێت ئه‌وا دوای ماوه‌یه‌ك هه‌ڵده‌ستین به‌ زیادكردنی دوای پێداچوونه‌وه‌ 6 |

7 |
8 |
9 | 10 | 11 |
12 |
13 | 14 | 15 |
16 |
17 | 18 | 23 |
24 |
25 | 26 |
27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /views/templates/header.ejs: -------------------------------------------------------------------------------- 1 |
2 | 21 | 22 | -------------------------------------------------------------------------------- /.cache/b0/7e0cfe706fe895feef6178c43c69f6.json: -------------------------------------------------------------------------------- 1 | {"id":"../../node_modules/parcel/src/builtins/css-loader.js","dependencies":[{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/package.json","includedInParent":true,"mtime":1590870273646},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/parcel/package.json","includedInParent":true,"mtime":1589055656075},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/parcel/src/.babelrc","includedInParent":true,"mtime":1589055656075},{"name":"./bundle-url","loc":{"line":1,"column":21},"parent":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/parcel/src/builtins/css-loader.js","resolved":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/parcel/src/builtins/bundle-url.js"}],"generated":{"js":"var bundle = require('./bundle-url');\n\nfunction updateLink(link) {\n var newLink = link.cloneNode();\n\n newLink.onload = function () {\n link.remove();\n };\n\n newLink.href = link.href.split('?')[0] + '?' + Date.now();\n link.parentNode.insertBefore(newLink, link.nextSibling);\n}\n\nvar cssTimeout = null;\n\nfunction reloadCSS() {\n if (cssTimeout) {\n return;\n }\n\n cssTimeout = setTimeout(function () {\n var links = document.querySelectorAll('link[rel=\"stylesheet\"]');\n\n for (var i = 0; i < links.length; i++) {\n if (bundle.getBaseURL(links[i].href) === bundle.getBundleURL()) {\n updateLink(links[i]);\n }\n }\n\n cssTimeout = null;\n }, 50);\n}\n\nmodule.exports = reloadCSS;"},"sourceMaps":null,"error":null,"hash":"2362605f1e2a582dfd603514573f7e08","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /middlewares/validators/main.js: -------------------------------------------------------------------------------- 1 | const { query, body } = require('express-validator'); 2 | const validate = require('./validate'); 3 | const db = require('../../config'); 4 | 5 | module.exports = { 6 | genderValidator: [ 7 | query('gender') 8 | .optional() 9 | .isIn(['M', 'F', 'O']) 10 | .withMessage('invalid gender option it should be one of M,F,O'), 11 | validate, 12 | ], 13 | submitNameValidator: [ 14 | body('name') 15 | .isString() 16 | .isLength({ min: 2 }) 17 | .withMessage('min length for a name is 2 char'), 18 | body('desc') 19 | .exists(), 20 | body('gender') 21 | .exists() 22 | .isIn(['M', 'F', 'O']) 23 | .withMessage('invalid gender option it should be one of M,F,O'), 24 | validate, 25 | ], 26 | voteNameValidator: [ 27 | body('name_id') 28 | .isInt({ gt: 0 }) 29 | .withMessage('invalid id for name'), 30 | body('uid') 31 | .isString() 32 | .escape() 33 | .custom((value, { req }) => { 34 | const { body: b } = req; 35 | return db('votes').count('id as count') 36 | .where('uid', b.uid) 37 | .andWhere('nameid', b.name_id) 38 | .andWhere('impact', b.impact) 39 | .then(([result]) => { 40 | if (result.count > 0) { return Promise.reject(new Error('you cannot vote same name twice with same impact')); } 41 | 42 | return Promise.resolve(true); 43 | }); 44 | }), 45 | 46 | body('impact') 47 | .isIn(['positive', 'negative']) 48 | .withMessage('invalid impact value'), 49 | validate, 50 | ], 51 | }; 52 | -------------------------------------------------------------------------------- /views/about.ejs: -------------------------------------------------------------------------------- 1 |
2 |
3 |

ده‌رباره‌ی ماڵپه‌ری ناوی كوردی

4 |

5 | ماڵپەری ناوەکان بە یەکەم پرۆژەی درەختی گەشەپێدەران دادەنرێت کە وەک سەرچاوەیەک و ئەرشیفێک کاردەکات بۆ ناوەکانی زمانی کوردی و ماناکانیان . 6 |
7 | تێبینی: سوپاسی ھەموو لایەک و سەرچاوەیەکی کوردی دەکەین کە بەشداربوونە لە کۆکردنەوەی ناوەکان ھەروەھا سوپاسی ئەوانەش دەکەین کە کارێکیان بەشداربوونە لە دەولەمەند کردنی زمانی کوردی و ئێمە سوودمان لێیان وەرگرتووە و زانیاریەکانمان وەرگرتوە لێیان. 8 |

9 |
10 |
11 |

سەرچاوەکراوەیە

12 |

13 | بە مانای ئەوەی هەموو سەرچاوەی کۆدەکەی لە گیتهەب هەیە دەتوانیت بەشداربیت لە پەرەپێدان و باشترکردنی یان سود لە کۆدەکەی وەربگریت 14 | سه‌رچاوه‌ 15 |

16 |
17 |
18 |

پەیوەندیمان پێوەبکە

19 |

20 | خۆشحاڵ دەبین بە زانینی هەر رەخنەو پێشنیارێک دەتوانن لە رێگای پەرەی فەیسبووکی درەختی گەشەپێدەرانەوە نامەو پێشنیارەکانتان بگەیەنن 21 | په‌ره‌ی دره‌ختی گه‌شه‌پێده‌ران 22 |

23 |
24 |
25 |

درەختی گەشەپێدەران

26 |

27 | ماڵپەرەکەمان سەرچاوەیەکی ئەکادیمی زانستی کۆمپیتەرە دەتوانیت جۆرەها بابەت و زانیاری وەربگریت ئاستی خۆت بەرەوپێش بەشداربیت 28 | ماڵپه‌ری دره‌ختی گه‌شه‌پێده‌ران 29 |

30 |
31 | 32 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | const createError = require('http-errors'); 2 | const helmet = require('helmet'); 3 | const compression = require('compression'); 4 | const path = require('path'); 5 | const uniqid = require('uniqid'); 6 | const favicon = require('serve-favicon'); 7 | 8 | const express = require('express'); 9 | const cookieParser = require('cookie-parser'); 10 | const expressLayouts = require('express-ejs-layouts'); 11 | 12 | const cors = require('cors'); 13 | require('dotenv').config(); 14 | 15 | const app = express(); 16 | // app.use(helmet()); 17 | app.use(compression()); 18 | app.use(favicon(path.join(__dirname, 'public', 'images', 'fav-icon.png'))); 19 | app.use(cors()); 20 | 21 | // view engine setup 22 | app.set('views', path.join(__dirname, 'views')); 23 | app.set('view engine', 'ejs'); 24 | app.use(expressLayouts); 25 | app.use(express.static(path.join(__dirname, 'public'))); 26 | 27 | app.use(express.json({ limit: '500mb' })); 28 | app.use(express.urlencoded({ extended: true, limit: '20mb' })); 29 | app.use(cookieParser(process.env.cookie_secret)); 30 | 31 | 32 | const ApiRouter = require('./routes/api'); 33 | const UiRouter = require('./routes/ui'); 34 | 35 | app.use((req, res, next) => { 36 | if (!req.cookies.uid) { 37 | const id = uniqid(); 38 | res.cookie('uid', id, { maxAge: 3.154e+10 }); 39 | } 40 | next(); 41 | }); 42 | 43 | app.use('/api/', ApiRouter); 44 | app.use('/', UiRouter); 45 | 46 | 47 | // catch 404 and forward to error handler 48 | // app.use((err, req, res, next) => { 49 | // next(createError(404)); 50 | // }); 51 | 52 | // // error handler 53 | // app.use((err, req, res, next) => { 54 | // // set locals, only providing error in development 55 | // res.locals.message = err.message; 56 | // res.locals.error = req.app.get('env') === 'development' ? err : {}; 57 | // // render the error page 58 | // res.status(err.status || 500); 59 | // res.render('error'); 60 | // }); 61 | 62 | module.exports = app; 63 | -------------------------------------------------------------------------------- /public/images/bkra.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.cache/86/cdf3bfe72280e9c628ab0e22dc4b39.json: -------------------------------------------------------------------------------- 1 | {"id":"../../node_modules/superagent/lib/utils.js","dependencies":[{"name":"/home/aram/Desktop/nawikurdi/API/package.json","includedInParent":true,"mtime":1590908189847},{"name":"/home/aram/Desktop/nawikurdi/API/node_modules/superagent/package.json","includedInParent":true,"mtime":1590908293929},{"name":"/home/aram/Desktop/nawikurdi/API/node_modules/superagent/.browserslistrc","includedInParent":true,"mtime":1590908293929}],"generated":{"js":"\"use strict\";\n/**\n * Return the mime type for the given `str`.\n *\n * @param {String} str\n * @return {String}\n * @api private\n */\n\nexports.type = function (str) {\n return str.split(/ *; */).shift();\n};\n/**\n * Return header field parameters.\n *\n * @param {String} str\n * @return {Object}\n * @api private\n */\n\n\nexports.params = function (str) {\n return str.split(/ *; */).reduce(function (obj, str) {\n var parts = str.split(/ *= */);\n var key = parts.shift();\n var val = parts.shift();\n if (key && val) obj[key] = val;\n return obj;\n }, {});\n};\n/**\n * Parse Link header fields.\n *\n * @param {String} str\n * @return {Object}\n * @api private\n */\n\n\nexports.parseLinks = function (str) {\n return str.split(/ *, */).reduce(function (obj, str) {\n var parts = str.split(/ *; */);\n var url = parts[0].slice(1, -1);\n var rel = parts[1].split(/ *= */)[1].slice(1, -1);\n obj[rel] = url;\n return obj;\n }, {});\n};\n/**\n * Strip content related fields from `header`.\n *\n * @param {Object} header\n * @return {Object} header\n * @api private\n */\n\n\nexports.cleanHeader = function (header, changesOrigin) {\n delete header['content-type'];\n delete header['content-length'];\n delete header['transfer-encoding'];\n delete header.host; // secuirty\n\n if (changesOrigin) {\n delete header.authorization;\n delete header.cookie;\n }\n\n return header;\n};"},"sourceMaps":null,"error":null,"hash":"b80a1e308cbd155e23ed1735ea6f46b8","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /routes/api.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | 3 | const router = express.Router(); 4 | const paginateValidator = require('../middlewares/validators/common/paginate'); 5 | const searchQueryValidator = require('../middlewares/validators/common/searchQuery'); 6 | const { genderValidator, submitNameValidator, voteNameValidator } = require('../middlewares/validators/main'); 7 | const { 8 | getBaseNames, getBaseRecordCount, vote, newName, 9 | } = require('../queries'); 10 | 11 | router.get('/greeting', (req, res) => { 12 | res.json({ 13 | msg: 'welcome to nawikurdi api visitor 😊', 14 | }); 15 | }); 16 | 17 | router.get('/', paginateValidator, searchQueryValidator, genderValidator, (req, res) => { 18 | const query = getBaseNames(req.query.limit, req.query.offset, req); 19 | const countQuery = getBaseRecordCount(); 20 | const searchQuery = req.query.q; 21 | if (searchQuery) { 22 | countQuery.whereRaw('name like ?', `%${searchQuery}%`); 23 | } 24 | if (req.query.gender) { 25 | countQuery.andWhere('gender', req.query.gender); 26 | } 27 | 28 | query.then((names) => { 29 | countQuery.then(([records]) => { 30 | res.status(200).json({ 31 | names, 32 | recordCount: records.recordCount, 33 | }); 34 | }); 35 | }); 36 | }); 37 | 38 | router.get('/records', (req, res) => { 39 | getBaseRecordCount().then(([recordCount]) => { 40 | res.status(200).json(recordCount); 41 | }); 42 | }); 43 | 44 | router.post('/', submitNameValidator, (req, res) => { 45 | newName(req.body).then(() => { 46 | res.status(200).json({ 47 | status: 1, 48 | }); 49 | }).catch((err) => { 50 | res.json(err); 51 | }); 52 | }); 53 | 54 | router.post('/vote', voteNameValidator, (req, res) => { 55 | const { body } = req; 56 | vote(body).then(() => { 57 | res.status(200).json({ 58 | status: 1, 59 | }); 60 | }).catch((err) => { 61 | res.json(err); 62 | }); 63 | }); 64 | 65 | module.exports = router; 66 | -------------------------------------------------------------------------------- /.cache/b7/2ab41e12ccf0f517f726b92c878366.json: -------------------------------------------------------------------------------- 1 | {"id":"../../node_modules/superagent/lib/agent-base.js","dependencies":[{"name":"/home/aram/Desktop/nawikurdi/API/package.json","includedInParent":true,"mtime":1590908189847},{"name":"/home/aram/Desktop/nawikurdi/API/node_modules/superagent/package.json","includedInParent":true,"mtime":1590908293929},{"name":"/home/aram/Desktop/nawikurdi/API/node_modules/superagent/.browserslistrc","includedInParent":true,"mtime":1590908293929}],"generated":{"js":"\"use strict\";\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\nfunction _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n}\n\nfunction Agent() {\n this._defaults = [];\n}\n\n['use', 'on', 'once', 'set', 'query', 'type', 'accept', 'auth', 'withCredentials', 'sortQuery', 'retry', 'ok', 'redirects', 'timeout', 'buffer', 'serialize', 'parse', 'ca', 'key', 'pfx', 'cert', 'disableTLSCerts'].forEach(function (fn) {\n // Default setting for all requests from this agent\n Agent.prototype[fn] = function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n this._defaults.push({\n fn: fn,\n args: args\n });\n\n return this;\n };\n});\n\nAgent.prototype._setDefaults = function (req) {\n this._defaults.forEach(function (def) {\n req[def.fn].apply(req, _toConsumableArray(def.args));\n });\n};\n\nmodule.exports = Agent;"},"sourceMaps":null,"error":null,"hash":"14f9a3ac1583a9e80a872ba49e817d11","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /bin/www: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /** 4 | * Module dependencies. 5 | */ 6 | 7 | var app = require('../app'); 8 | var debug = require('debug')('api:server'); 9 | var http = require('http'); 10 | 11 | /** 12 | * Get port from environment and store in Express. 13 | */ 14 | 15 | var port = normalizePort(process.env.PORT || '3001'); 16 | app.set('port', port); 17 | 18 | /** 19 | * Create HTTP server. 20 | */ 21 | 22 | var server = http.createServer(app); 23 | 24 | /** 25 | * Listen on provided port, on all network interfaces. 26 | */ 27 | 28 | server.listen(port); 29 | server.on('error', onError); 30 | server.on('listening', onListening); 31 | 32 | /** 33 | * Normalize a port into a number, string, or false. 34 | */ 35 | 36 | function normalizePort(val) { 37 | var port = parseInt(val, 10); 38 | 39 | if (isNaN(port)) { 40 | // named pipe 41 | return val; 42 | } 43 | 44 | if (port >= 0) { 45 | // port number 46 | return port; 47 | } 48 | 49 | return false; 50 | } 51 | 52 | /** 53 | * Event listener for HTTP server "error" event. 54 | */ 55 | 56 | function onError(error) { 57 | if (error.syscall !== 'listen') { 58 | throw error; 59 | } 60 | 61 | var bind = typeof port === 'string' 62 | ? 'Pipe ' + port 63 | : 'Port ' + port; 64 | 65 | // handle specific listen errors with friendly messages 66 | switch (error.code) { 67 | case 'EACCES': 68 | console.error(bind + ' requires elevated privileges'); 69 | process.exit(1); 70 | break; 71 | case 'EADDRINUSE': 72 | console.error(bind + ' is already in use'); 73 | process.exit(1); 74 | break; 75 | default: 76 | throw error; 77 | } 78 | } 79 | 80 | /** 81 | * Event listener for HTTP server "listening" event. 82 | */ 83 | 84 | function onListening() { 85 | var addr = server.address(); 86 | var bind = typeof addr === 'string' 87 | ? 'pipe ' + addr 88 | : 'port ' + addr.port; 89 | debug('Listening on ' + bind); 90 | } 91 | -------------------------------------------------------------------------------- /.cache/59/d5e9f454a54db2e0ccd1b0cc6cd1d2.json: -------------------------------------------------------------------------------- 1 | {"id":"../../node_modules/superagent/lib/utils.js","dependencies":[{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/package.json","includedInParent":true,"mtime":1590877042665},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/superagent/package.json","includedInParent":true,"mtime":1585830670205},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/superagent/.browserslistrc","includedInParent":true,"mtime":1585830670205}],"generated":{"js":"\"use strict\";\n/**\n * Return the mime type for the given `str`.\n *\n * @param {String} str\n * @return {String}\n * @api private\n */\n\nexports.type = function (str) {\n return str.split(/ *; */).shift();\n};\n/**\n * Return header field parameters.\n *\n * @param {String} str\n * @return {Object}\n * @api private\n */\n\n\nexports.params = function (str) {\n return str.split(/ *; */).reduce(function (obj, str) {\n var parts = str.split(/ *= */);\n var key = parts.shift();\n var val = parts.shift();\n if (key && val) obj[key] = val;\n return obj;\n }, {});\n};\n/**\n * Parse Link header fields.\n *\n * @param {String} str\n * @return {Object}\n * @api private\n */\n\n\nexports.parseLinks = function (str) {\n return str.split(/ *, */).reduce(function (obj, str) {\n var parts = str.split(/ *; */);\n var url = parts[0].slice(1, -1);\n var rel = parts[1].split(/ *= */)[1].slice(1, -1);\n obj[rel] = url;\n return obj;\n }, {});\n};\n/**\n * Strip content related fields from `header`.\n *\n * @param {Object} header\n * @return {Object} header\n * @api private\n */\n\n\nexports.cleanHeader = function (header, changesOrigin) {\n delete header['content-type'];\n delete header['content-length'];\n delete header['transfer-encoding'];\n delete header.host; // secuirty\n\n if (changesOrigin) {\n delete header.authorization;\n delete header.cookie;\n }\n\n return header;\n};"},"sourceMaps":null,"error":null,"hash":"b80a1e308cbd155e23ed1735ea6f46b8","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /.cache/31/8d6b61a53d5ada402c2d05624b59e8.json: -------------------------------------------------------------------------------- 1 | {"id":"../../node_modules/superagent/lib/agent-base.js","dependencies":[{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/package.json","includedInParent":true,"mtime":1590877042665},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/superagent/package.json","includedInParent":true,"mtime":1585830670205},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/superagent/.browserslistrc","includedInParent":true,"mtime":1585830670205}],"generated":{"js":"\"use strict\";\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\nfunction _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n}\n\nfunction Agent() {\n this._defaults = [];\n}\n\n['use', 'on', 'once', 'set', 'query', 'type', 'accept', 'auth', 'withCredentials', 'sortQuery', 'retry', 'ok', 'redirects', 'timeout', 'buffer', 'serialize', 'parse', 'ca', 'key', 'pfx', 'cert', 'disableTLSCerts'].forEach(function (fn) {\n // Default setting for all requests from this agent\n Agent.prototype[fn] = function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n this._defaults.push({\n fn: fn,\n args: args\n });\n\n return this;\n };\n});\n\nAgent.prototype._setDefaults = function (req) {\n this._defaults.forEach(function (def) {\n req[def.fn].apply(req, _toConsumableArray(def.args));\n });\n};\n\nmodule.exports = Agent;"},"sourceMaps":null,"error":null,"hash":"14f9a3ac1583a9e80a872ba49e817d11","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /.cache/e7/5c10888750cbf78e75c8715912ccec.json: -------------------------------------------------------------------------------- 1 | {"id":"main.js","dependencies":[{"name":"/home/aram/Desktop/nawikurdi/API/package.json","includedInParent":true,"mtime":1590908189847},{"name":"./index","loc":{"line":1,"column":23},"parent":"/home/aram/Desktop/nawikurdi/API/public/js/main.js","resolved":"/home/aram/Desktop/nawikurdi/API/public/js/index.js"},{"name":"./favorites","loc":{"line":2,"column":27},"parent":"/home/aram/Desktop/nawikurdi/API/public/js/main.js","resolved":"/home/aram/Desktop/nawikurdi/API/public/js/favorites.js"},{"name":"./submit-name","loc":{"line":3,"column":29},"parent":"/home/aram/Desktop/nawikurdi/API/public/js/main.js","resolved":"/home/aram/Desktop/nawikurdi/API/public/js/submit-name.js"}],"generated":{"js":"\"use strict\";\n\nvar index = _interopRequireWildcard(require(\"./index\"));\n\nvar favorites = _interopRequireWildcard(require(\"./favorites\"));\n\nvar submit_name = _interopRequireWildcard(require(\"./submit-name\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nwindow.nawikurdi = {\n index: index,\n favorites: favorites,\n submit_name: submit_name\n};"},"sourceMaps":null,"error":null,"hash":"0fc4549626b8bfbf6091f4a3a41befa3","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /.cache/fd/f404f81a5c46e927a4a98836a404e5.json: -------------------------------------------------------------------------------- 1 | {"id":"main.js","dependencies":[{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/package.json","includedInParent":true,"mtime":1590877042665},{"name":"./index","loc":{"line":1,"column":23},"parent":"/Users/hozan/Desktop/devstree/nawikurdi/API/public/js/main.js","resolved":"/Users/hozan/Desktop/devstree/nawikurdi/API/public/js/index.js"},{"name":"./favorites","loc":{"line":2,"column":27},"parent":"/Users/hozan/Desktop/devstree/nawikurdi/API/public/js/main.js","resolved":"/Users/hozan/Desktop/devstree/nawikurdi/API/public/js/favorites.js"},{"name":"./submit-name","loc":{"line":3,"column":29},"parent":"/Users/hozan/Desktop/devstree/nawikurdi/API/public/js/main.js","resolved":"/Users/hozan/Desktop/devstree/nawikurdi/API/public/js/submit-name.js"}],"generated":{"js":"\"use strict\";\n\nvar index = _interopRequireWildcard(require(\"./index\"));\n\nvar favorites = _interopRequireWildcard(require(\"./favorites\"));\n\nvar submit_name = _interopRequireWildcard(require(\"./submit-name\"));\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nwindow.nawikurdi = {\n index: index,\n favorites: favorites,\n submit_name: submit_name\n};"},"sourceMaps":null,"error":null,"hash":"0fc4549626b8bfbf6091f4a3a41befa3","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # nawikurdi.com 3 | 4 | source files 5 | 6 | * UI contains react project and source code 7 | 8 | * API contains express.js app 9 | 10 | 11 | 12 | ## API documentation 13 | 14 | public API link is `nawikurdi.com/api` routes 15 | 16 | ### GET routes 17 | `/` main route will accept these query parameters 18 | 19 | |Parameter name | description | 20 | |--|--| 21 | | **limit** | limit is positive integer greater than 0 and its `required` the api will throw 422 error code if it wasn't provided or have an invalid value this indicates how many records to fetch | 22 | | **offset** | an integer greater than -1 which indicates where to start fetching from dataset | 23 | | **q** | an optional parameter if it exists the length of this search parameter should be between 1->255 it will search names similar to this search query | 24 | | **gender** | an optional parameter if it exists it should take one of these values `[O,F,M]` | 25 | | **sort** | an optional parameter if it exists it should take one of these values `[positive,negative]` and it will sort by positive or negative votes on each name| 26 | 27 | Note: `q`,`gender` parameters are optional and additive if you add them they will effect the result set together, `limit`,`offset` are relative to final dataset after applying wanted filter parameters 28 | 29 | `/records` will fetch total number of active names in the dataset no params required 30 | 31 | ------------------------ 32 | 33 | ### POST routes 34 | `/` if you want to submit a new name to our dataset make a post request to main route you should provide some parameters in body of the post request 35 | 36 | |Parameter name | description | 37 | |--|--| 38 | | **name** | name to be submited | 39 | | **desc** | a description of the name | 40 | | **gender** |it should take one of these values `[O,F,M]` `O` indicates that this name is for both genders | 41 | 42 | `/vote` if you want to submit a new vote to our dataset make a post request to this route you should provide some parameters in body of the post request 43 | 44 | |Parameter name | description | 45 | |--|--| 46 | | **name_id** | id of the name that you want to review | 47 | | **uid** | a unique id for the person that makes the request | 48 | | **impact** | is this vote have a positive or negative impact this will take one of `[positive,negative]` | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /routes/ui.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const slugify = require('slugify'); 3 | 4 | const router = express.Router(); 5 | const render = require('./../helpers/customRender'); 6 | 7 | const { getBaseNames, getBaseRecordCount, getSingleName } = require('./../queries'); 8 | 9 | function loadIndexData(req) { 10 | return Promise.all([ 11 | getBaseNames(req.query.limit, req.query.offset, req), 12 | getBaseRecordCount(), 13 | ]) 14 | .then((values) => { 15 | const [names, [records]] = values; 16 | return { 17 | names: names || [], 18 | records: records.recordCount || 0, 19 | }; 20 | }); 21 | } 22 | function loadSingleData(req) { 23 | return Promise.all([ 24 | getSingleName(req.params.id), 25 | ]) 26 | .then((values) => { 27 | const [name] = values; 28 | return name || undefined; 29 | }); 30 | } 31 | function loadFavoritesData() { 32 | return Promise.all([ 33 | getBaseRecordCount(), 34 | ]) 35 | .then((values) => { 36 | const [[records]] = values; 37 | return { 38 | records: records.recordCount || 0, 39 | }; 40 | }); 41 | } 42 | 43 | 44 | /* GET HOME PAGE */ 45 | router.get('/', async (req, res) => { 46 | const indexData = await loadIndexData(req); 47 | render(req, res, { 48 | view: 'index', 49 | title: ' ناوی كوردی | په‌ره‌ی سه‌ره‌كی', 50 | ...indexData, 51 | slugify, 52 | }); 53 | }); 54 | router.get('/favorites', async (req, res) => { 55 | const favoritesData = await loadFavoritesData(req); 56 | 57 | render(req, res, { 58 | view: 'favorites', 59 | title: ' ناوی كوردی | هه‌ڵبژاردنه‌كانم', 60 | ...favoritesData, 61 | slugify, 62 | }); 63 | }); 64 | router.get('/about', async (req, res) => { 65 | render(req, res, { 66 | view: 'about', 67 | title: ' ناوی كوردی | ده‌رباره‌ی ئێمه‌', 68 | slugify, 69 | }); 70 | }); 71 | router.get('/submit-name', async (req, res) => { 72 | render(req, res, { 73 | view: 'submit-name', 74 | title: ' ناوی كوردی | ناوێكی نوێ بنێره‌', 75 | slugify, 76 | }); 77 | }); 78 | router.get('/:id', async (req, res) => { 79 | const nameData = await loadSingleData(req); 80 | if(!nameData){ 81 | res.redirect('/') 82 | }else{ 83 | render(req, res, { 84 | view: 'single', 85 | title: ` ناوی كوردی | ${nameData.name}`, 86 | slugify, 87 | ...nameData 88 | }); 89 | } 90 | }); 91 | 92 | 93 | module.exports = router; 94 | -------------------------------------------------------------------------------- /queries.js: -------------------------------------------------------------------------------- 1 | const db = require('./config'); 2 | 3 | function getBaseNames(limit = 10, offset = 0, req = {}) { 4 | const query = db('names') 5 | .select( 6 | 'nameId', 'name', 'desc', 'gender', 7 | 'positive_votes', 'negative_votes' 8 | ) 9 | .where('deleted', 0) 10 | .andWhere('activated', 1) 11 | .limit(limit) 12 | .offset(offset); 13 | const searchQuery = req.query.q; 14 | if (searchQuery) { 15 | query.whereRaw('name like ?', `%${searchQuery}%`); 16 | } 17 | if (req.query.gender) { 18 | query.andWhere('gender', req.query.gender); 19 | } 20 | if (req.query.sort && ['positive', 'negative', 'positive'].indexOf(req.query.sort) > -1) { 21 | const sort = req.query.sort; 22 | if(sort === 'positive') { 23 | query.orderBy('positive_votes', 'desc'); 24 | } 25 | else if(sort === 'negative') { 26 | query.orderBy('negative_votes', 'desc'); 27 | } 28 | }else { 29 | query.orderByRaw('CHAR_LENGTH(`desc`) DESC'); 30 | } 31 | return query; 32 | } 33 | function getSingleName(id=0) { 34 | const query = db('names') 35 | .select( 36 | 'nameId', 'name', 'desc', 'gender', 37 | 'positive_votes', 'negative_votes' 38 | ) 39 | .where('deleted', 0) 40 | .andWhere('activated', 1) 41 | .andWhere('nameId', id) 42 | .first() 43 | 44 | return query; 45 | } 46 | 47 | function getBaseRecordCount() { 48 | return db('names').count({ 49 | recordCount: 'nameId', 50 | }) 51 | .where('deleted', 0) 52 | .andWhere('activated', 1); 53 | } 54 | function vote(body) { 55 | let impactSection = 'positive_votes = positive_votes+1'; 56 | if(body.impact === 'negative') impactSection = 'negative_votes = negative_votes+1'; 57 | const promiseArray = []; 58 | if(body.impact) { 59 | promiseArray.push(db.raw(`UPDATE names SET ${impactSection} WHERE nameid=?`, [body.name_id])) 60 | } 61 | promiseArray.push( 62 | db('votes').insert({ 63 | nameid: body.name_id, 64 | uid: body.uid, 65 | impact: body.impact, 66 | }) 67 | ) 68 | return Promise.all(promiseArray); 69 | } 70 | function newName(body) { 71 | return db('names').insert({ 72 | name: body.name, 73 | desc: body.desc, 74 | gender: body.gender, 75 | sended: 1, 76 | }) 77 | } 78 | 79 | 80 | module.exports = { 81 | getBaseNames, 82 | getBaseRecordCount, 83 | getSingleName, 84 | vote, 85 | newName, 86 | } -------------------------------------------------------------------------------- /public/js/submit-name.js: -------------------------------------------------------------------------------- 1 | import superagent from 'superagent'; 2 | import $ from 'jquery'; 3 | import { Notyf } from 'notyf'; 4 | // Create an instance of Notyf 5 | 6 | 7 | // scroll logic 8 | let mybutton = document.getElementById("to-top"); 9 | window.onscroll = function() {scrollFunction()}; 10 | function scrollFunction() { 11 | try{ 12 | if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { 13 | mybutton.style.display = "block"; 14 | } else { 15 | mybutton.style.display = "none"; 16 | } 17 | }catch(e){} 18 | 19 | } 20 | function topFunction() { 21 | document.body.scrollTop = 0; // For Safari 22 | document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera 23 | } 24 | 25 | const notyf = new Notyf(); 26 | function submitname(data, cb = ()=>{}){ 27 | return superagent 28 | .post(`/api`) 29 | .send(data) 30 | .end((err, res)=>{ 31 | cb(err, res) 32 | }); 33 | } 34 | module.exports = { 35 | init: function() { 36 | window.topFunction = topFunction; 37 | 38 | $('.submit-button').click(function(){ 39 | const btn = this; 40 | const submited_name = { 41 | desc: ' ', 42 | gender: 'O', 43 | }; 44 | const gender = `${$('select[name=gender]').val()}`.trim(); 45 | const name = `${$('input[name=name]').val()}`.trim(); 46 | const desc = `${$('input[name=desc]').val()}`.trim(); 47 | if (name!= '' && gender) { 48 | // submitname(name).then((result) => { 49 | // if (result.data.status === 1) { 50 | // alert('سوپاس لە ماوەیەکی کەمدا ناوەکات لە پەڕەکە دەردەجێت'); 51 | // this.setState({ open: false }); 52 | // } else { 53 | // alert('ببورە ناوەکەت زیاد نەکرا تکایە دوبارەی بکەوە'); 54 | // } 55 | // }).catch(() => { 56 | // // error handling goes here 57 | // }); 58 | submitname({ 59 | ...submited_name, 60 | name: name, 61 | gender: gender, 62 | desc: desc, 63 | }, 64 | (err, res)=>{ 65 | if(err){ 66 | // const errors = err.response.body.errors; 67 | // notyf.error(errors[0].msg); 68 | notyf.error('هەڵەیەک رویدا لەکاتی ناردنی ناوی نوێ') 69 | } else { 70 | notyf.success('ناوەکەت بە سەرکەوتویی نێردرا'); 71 | $('input[name=name]').val('') 72 | $('input[name=desc]').val('') 73 | } 74 | }) 75 | } else { 76 | console.log(name, gender) 77 | notyf.error('ناو و رەگەز پێویستە بۆ ناردنی ناوێکی نوێ') 78 | } 79 | 80 | }); 81 | 82 | }, 83 | } 84 | -------------------------------------------------------------------------------- /public/css/main.min.css: -------------------------------------------------------------------------------- 1 | body{margin:0;height:100%;overflow-x:hidden}:not(.fas){font-family:vazir,Arial,Helvetica,sans-serif}.txt-red{color:#e71d36}.btn-group button{background-color:#f8f8f8;border:1px solid #f3f3f3;color:#011627;padding:10px 24px;cursor:pointer;float:left;outline:0}.btn-group button:not(:last-child){border-right:none}.btn-group:after{content:"";clear:both;display:table}.addthis_inline_share_toolbox_sl27{min-height:42px}.btn-group button.active,.btn-group button:hover{background-color:#011627;color:#f8f8f8}._4btn button{width:25%}._3btn button{width:33.33%}._2btn button{width:50%}@media only screen and (max-width:973px){.btn-group button.gender-filter,.btn-group button.popularity-filter{width:100%!important}.submit-name-container{width:100%!important}nav .nav-item{padding:0!important}}.btn-group button:first-child{border-top-left-radius:3px;border-bottom-left-radius:3px}.btn-group button:last-child{border-top-right-radius:3px;border-bottom-right-radius:3px}.txt-center{text-align:center}.submit-name-container{direction:rtl;text-align:right;padding:20px;width:50%;margin:0 auto}.submit-name-container label{font-size:20px;padding-right:5px}.input-container{padding:15px}.submit-button{width:100%;padding:15px;border-radius:4px;background:#2ec5b6;border:none;color:#fff}.main-grid{flex-direction:column;margin:20px}nav{direction:rtl;text-align:center;border-radius:5px;box-shadow:10px 4px 10px #eaeaea}nav .header-icon{font-size:12px}nav .nav-item{color:#011627;text-decoration:none;padding:16px}nav .nav-item.active{border-bottom:3px solid #ff9f1c;background:#f9f9f9}nav .nav-item:first-of-type{border-top-right-radius:3px;border-bottom-right-radius:3px}nav .nav-item:last-of-type{border-top-left-radius:3px;border-bottom-left-radius:3px}.notfound-container{text-align:center}.notfound-container img{width:120px;margin:0 auto}.about-container{text-align:right;direction:rtl;padding:20px}.filters-grid{padding:0}.at-share-btn-elements{text-align:center;margin-bottom:15px}.detail-container,.social-container{border:1px solid #f3f3f3;margin-top:25px;width:100%;border-radius:4px;text-align:right}.filters-container{border:1px solid #f3f3f3;width:100%;border-radius:4px;text-align:right}.filters-container h3{background:#011627;color:#fff;margin-top:0;padding:5px;text-align:center}.social-container h3{background:#f35e29;color:#fff;margin-top:0;padding:15px;text-align:center}.detail-container h3{background:#e71d36;color:#fff;margin-top:0;padding:15px;text-align:center}.detail-container ul{direction:rtl}.input-filter-container{padding:15px}.gender-filter-container,.popularity-filter-container{padding-left:15px;padding-right:15px;padding-bottom:5px}.input,.input-filter{width:100%;height:50px;font-size:13px;text-align:right;background:#fff;border:1px solid #2ec5b6;border-radius:4px;direction:rtl}.input{padding-right:5px}.card-container{text-decoration:none}.card{background:#f8f8f8;direction:rtl;border-radius:4px;color:#011627;border:1px solid #f3f3f3}.card .card-body,.card a,.card a .card-title{padding:15px;padding-top:0;padding-bottom:0;text-decoration:none!important;color:#000}.card .card-body{padding-top:3px}footer{text-align:center;font-size:13px;height:70px}footer p{color:#011627}footer p a{color:#ff9f1c;text-decoration:none}#to-top{display:none;position:fixed;bottom:20px;left:30px;z-index:99;border:none;outline:0;background-color:#011627;color:#fff;cursor:pointer;padding:10px;border-radius:100px;font-size:18px;width:50px;height:50px}#to-top:hover{background-color:#555} -------------------------------------------------------------------------------- /public/css/grid-lite.css: -------------------------------------------------------------------------------- 1 | .grid{box-sizing:border-box;display:-webkit-flex;display:-ms-flexbox;display:-webkit-box;display:flex;-webkit-flex:0 1 auto;-ms-flex:0 1 auto;-webkit-box-flex:0;flex:0 1 auto;-webkit-flex-direction:row;-ms-flex-direction:row;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:0 -8px 0 -8px}.grid.grid-nogutter{margin:0}.grid.grid-nogutter>.col{padding:0}.col{box-sizing:border-box;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;-webkit-flex-grow:1;-ms-flex-positive:1;-webkit-box-flex:1;flex-grow:1;-ms-flex-preferred-size:0;-webkit-flex-basis:0;flex-basis:0;max-width:100%;min-width:0;padding:0 8px 0 8px}.col-align-top{-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start}.col-align-bottom{align-self:flex-end}.col-align-middle{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.col-top{justify-content:flex-start !important;flex-direction:column;display:flex}.col-bottom{justify-content:flex-end !important;flex-direction:column;display:flex}.col-middle{justify-content:center;flex-direction:column;display:flex}.grid-start{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.grid-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.grid-end{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.grid-around{justify-content:space-around}.grid-between{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.col-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.col-last{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.grid-reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.col-fixed{flex:initial}.col-grow-2{flex-grow:2}.col-grow-3{flex-grow:3}.col-grow-4{flex-grow:4}.col-grow-5{flex-grow:5}.col-grow-6{flex-grow:6}.col-grow-7{flex-grow:7}.col-grow-8{flex-grow:8}.col-grow-9{flex-grow:9}.col-grow-10{flex-grow:10}.col-grow-11{flex-grow:11}.col-1{-ms-flex-preferred-size:8.33333%;-webkit-flex-basis:8.33333%;flex-basis:8.33333%;max-width:8.33333%}.col-2{-ms-flex-preferred-size:16.66667%;-webkit-flex-basis:16.66667%;flex-basis:16.66667%;max-width:16.66667%}.col-3{-ms-flex-preferred-size:25%;-webkit-flex-basis:25%;flex-basis:25%;max-width:25%}.col-4{-ms-flex-preferred-size:33.33333%;-webkit-flex-basis:33.33333%;flex-basis:33.33333%;max-width:33.33333%}.col-5{-ms-flex-preferred-size:41.66667%;-webkit-flex-basis:41.66667%;flex-basis:41.66667%;max-width:41.66667%}.col-6{-ms-flex-preferred-size:50%;-webkit-flex-basis:50%;flex-basis:50%;max-width:50%}.col-7{-ms-flex-preferred-size:58.33333%;-webkit-flex-basis:58.33333%;flex-basis:58.33333%;max-width:58.33333%}.col-8{-ms-flex-preferred-size:66.66667%;-webkit-flex-basis:66.66667%;flex-basis:66.66667%;max-width:66.66667%}.col-9{-ms-flex-preferred-size:75%;-webkit-flex-basis:75%;flex-basis:75%;max-width:75%}.col-10{-ms-flex-preferred-size:83.33333%;-webkit-flex-basis:83.33333%;flex-basis:83.33333%;max-width:83.33333%}.col-11{-ms-flex-preferred-size:91.66667%;-webkit-flex-basis:91.66667%;flex-basis:91.66667%;max-width:91.66667%}.col-12{-ms-flex-preferred-size:100%;-webkit-flex-basis:100%;flex-basis:100%;max-width:100%}@media only screen and (max-width: 480px){.col-sm{flex:100%;max-width:100%}}@media only screen and (max-width: 624px){.col-md{flex:100%;max-width:100%}}@media only screen and (max-width: 744px){.col-lg{flex:100%;max-width:100%}} -------------------------------------------------------------------------------- /.cache/26/5a68d9da80034653411148bf6da7eb.json: -------------------------------------------------------------------------------- 1 | {"id":"../../node_modules/superagent/lib/response-base.js","dependencies":[{"name":"/home/aram/Desktop/nawikurdi/API/package.json","includedInParent":true,"mtime":1590908189847},{"name":"/home/aram/Desktop/nawikurdi/API/node_modules/superagent/package.json","includedInParent":true,"mtime":1590908293929},{"name":"/home/aram/Desktop/nawikurdi/API/node_modules/superagent/.browserslistrc","includedInParent":true,"mtime":1590908293929},{"name":"./utils","loc":{"line":6,"column":20},"parent":"/home/aram/Desktop/nawikurdi/API/node_modules/superagent/lib/response-base.js","resolved":"/home/aram/Desktop/nawikurdi/API/node_modules/superagent/lib/utils.js"}],"generated":{"js":"\"use strict\";\n/**\n * Module dependencies.\n */\n\nvar utils = require('./utils');\n/**\n * Expose `ResponseBase`.\n */\n\n\nmodule.exports = ResponseBase;\n/**\n * Initialize a new `ResponseBase`.\n *\n * @api public\n */\n\nfunction ResponseBase(obj) {\n if (obj) return mixin(obj);\n}\n/**\n * Mixin the prototype properties.\n *\n * @param {Object} obj\n * @return {Object}\n * @api private\n */\n\n\nfunction mixin(obj) {\n for (var key in ResponseBase.prototype) {\n if (Object.prototype.hasOwnProperty.call(ResponseBase.prototype, key)) obj[key] = ResponseBase.prototype[key];\n }\n\n return obj;\n}\n/**\n * Get case-insensitive `field` value.\n *\n * @param {String} field\n * @return {String}\n * @api public\n */\n\n\nResponseBase.prototype.get = function (field) {\n return this.header[field.toLowerCase()];\n};\n/**\n * Set header related properties:\n *\n * - `.type` the content type without params\n *\n * A response of \"Content-Type: text/plain; charset=utf-8\"\n * will provide you with a `.type` of \"text/plain\".\n *\n * @param {Object} header\n * @api private\n */\n\n\nResponseBase.prototype._setHeaderProperties = function (header) {\n // TODO: moar!\n // TODO: make this a util\n // content-type\n var ct = header['content-type'] || '';\n this.type = utils.type(ct); // params\n\n var params = utils.params(ct);\n\n for (var key in params) {\n if (Object.prototype.hasOwnProperty.call(params, key)) this[key] = params[key];\n }\n\n this.links = {}; // links\n\n try {\n if (header.link) {\n this.links = utils.parseLinks(header.link);\n }\n } catch (_unused) {// ignore\n }\n};\n/**\n * Set flags such as `.ok` based on `status`.\n *\n * For example a 2xx response will give you a `.ok` of __true__\n * whereas 5xx will be __false__ and `.error` will be __true__. The\n * `.clientError` and `.serverError` are also available to be more\n * specific, and `.statusType` is the class of error ranging from 1..5\n * sometimes useful for mapping respond colors etc.\n *\n * \"sugar\" properties are also defined for common cases. Currently providing:\n *\n * - .noContent\n * - .badRequest\n * - .unauthorized\n * - .notAcceptable\n * - .notFound\n *\n * @param {Number} status\n * @api private\n */\n\n\nResponseBase.prototype._setStatusProperties = function (status) {\n var type = status / 100 | 0; // status / class\n\n this.statusCode = status;\n this.status = this.statusCode;\n this.statusType = type; // basics\n\n this.info = type === 1;\n this.ok = type === 2;\n this.redirect = type === 3;\n this.clientError = type === 4;\n this.serverError = type === 5;\n this.error = type === 4 || type === 5 ? this.toError() : false; // sugar\n\n this.created = status === 201;\n this.accepted = status === 202;\n this.noContent = status === 204;\n this.badRequest = status === 400;\n this.unauthorized = status === 401;\n this.notAcceptable = status === 406;\n this.forbidden = status === 403;\n this.notFound = status === 404;\n this.unprocessableEntity = status === 422;\n};"},"sourceMaps":null,"error":null,"hash":"8267a31b47d6ea86fb41bb1c0c1eb872","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /.cache/19/97ddd0fcf11b2c672f84ac4a014035.json: -------------------------------------------------------------------------------- 1 | {"id":"../../node_modules/superagent/lib/response-base.js","dependencies":[{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/package.json","includedInParent":true,"mtime":1590877042665},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/superagent/package.json","includedInParent":true,"mtime":1585830670205},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/superagent/.browserslistrc","includedInParent":true,"mtime":1585830670205},{"name":"./utils","loc":{"line":6,"column":20},"parent":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/superagent/lib/response-base.js","resolved":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/superagent/lib/utils.js"}],"generated":{"js":"\"use strict\";\n/**\n * Module dependencies.\n */\n\nvar utils = require('./utils');\n/**\n * Expose `ResponseBase`.\n */\n\n\nmodule.exports = ResponseBase;\n/**\n * Initialize a new `ResponseBase`.\n *\n * @api public\n */\n\nfunction ResponseBase(obj) {\n if (obj) return mixin(obj);\n}\n/**\n * Mixin the prototype properties.\n *\n * @param {Object} obj\n * @return {Object}\n * @api private\n */\n\n\nfunction mixin(obj) {\n for (var key in ResponseBase.prototype) {\n if (Object.prototype.hasOwnProperty.call(ResponseBase.prototype, key)) obj[key] = ResponseBase.prototype[key];\n }\n\n return obj;\n}\n/**\n * Get case-insensitive `field` value.\n *\n * @param {String} field\n * @return {String}\n * @api public\n */\n\n\nResponseBase.prototype.get = function (field) {\n return this.header[field.toLowerCase()];\n};\n/**\n * Set header related properties:\n *\n * - `.type` the content type without params\n *\n * A response of \"Content-Type: text/plain; charset=utf-8\"\n * will provide you with a `.type` of \"text/plain\".\n *\n * @param {Object} header\n * @api private\n */\n\n\nResponseBase.prototype._setHeaderProperties = function (header) {\n // TODO: moar!\n // TODO: make this a util\n // content-type\n var ct = header['content-type'] || '';\n this.type = utils.type(ct); // params\n\n var params = utils.params(ct);\n\n for (var key in params) {\n if (Object.prototype.hasOwnProperty.call(params, key)) this[key] = params[key];\n }\n\n this.links = {}; // links\n\n try {\n if (header.link) {\n this.links = utils.parseLinks(header.link);\n }\n } catch (_unused) {// ignore\n }\n};\n/**\n * Set flags such as `.ok` based on `status`.\n *\n * For example a 2xx response will give you a `.ok` of __true__\n * whereas 5xx will be __false__ and `.error` will be __true__. The\n * `.clientError` and `.serverError` are also available to be more\n * specific, and `.statusType` is the class of error ranging from 1..5\n * sometimes useful for mapping respond colors etc.\n *\n * \"sugar\" properties are also defined for common cases. Currently providing:\n *\n * - .noContent\n * - .badRequest\n * - .unauthorized\n * - .notAcceptable\n * - .notFound\n *\n * @param {Number} status\n * @api private\n */\n\n\nResponseBase.prototype._setStatusProperties = function (status) {\n var type = status / 100 | 0; // status / class\n\n this.statusCode = status;\n this.status = this.statusCode;\n this.statusType = type; // basics\n\n this.info = type === 1;\n this.ok = type === 2;\n this.redirect = type === 3;\n this.clientError = type === 4;\n this.serverError = type === 5;\n this.error = type === 4 || type === 5 ? this.toError() : false; // sugar\n\n this.created = status === 201;\n this.accepted = status === 202;\n this.noContent = status === 204;\n this.badRequest = status === 400;\n this.unauthorized = status === 401;\n this.notAcceptable = status === 406;\n this.forbidden = status === 403;\n this.notFound = status === 404;\n this.unprocessableEntity = status === 422;\n};"},"sourceMaps":null,"error":null,"hash":"8267a31b47d6ea86fb41bb1c0c1eb872","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /.cache/3d/1f67c7837ae25347a92e63549fe6c9.json: -------------------------------------------------------------------------------- 1 | {"id":"../../node_modules/component-emitter/index.js","dependencies":[{"name":"/home/aram/Desktop/nawikurdi/API/package.json","includedInParent":true,"mtime":1590908189847},{"name":"/home/aram/Desktop/nawikurdi/API/node_modules/component-emitter/package.json","includedInParent":true,"mtime":1590908292989}],"generated":{"js":"\r\n/**\r\n * Expose `Emitter`.\r\n */\r\n\r\nif (typeof module !== 'undefined') {\r\n module.exports = Emitter;\r\n}\r\n\r\n/**\r\n * Initialize a new `Emitter`.\r\n *\r\n * @api public\r\n */\r\n\r\nfunction Emitter(obj) {\r\n if (obj) return mixin(obj);\r\n};\r\n\r\n/**\r\n * Mixin the emitter properties.\r\n *\r\n * @param {Object} obj\r\n * @return {Object}\r\n * @api private\r\n */\r\n\r\nfunction mixin(obj) {\r\n for (var key in Emitter.prototype) {\r\n obj[key] = Emitter.prototype[key];\r\n }\r\n return obj;\r\n}\r\n\r\n/**\r\n * Listen on the given `event` with `fn`.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.on =\r\nEmitter.prototype.addEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\r\n .push(fn);\r\n return this;\r\n};\r\n\r\n/**\r\n * Adds an `event` listener that will be invoked a single\r\n * time then automatically removed.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.once = function(event, fn){\r\n function on() {\r\n this.off(event, on);\r\n fn.apply(this, arguments);\r\n }\r\n\r\n on.fn = fn;\r\n this.on(event, on);\r\n return this;\r\n};\r\n\r\n/**\r\n * Remove the given callback for `event` or all\r\n * registered callbacks.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.off =\r\nEmitter.prototype.removeListener =\r\nEmitter.prototype.removeAllListeners =\r\nEmitter.prototype.removeEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n\r\n // all\r\n if (0 == arguments.length) {\r\n this._callbacks = {};\r\n return this;\r\n }\r\n\r\n // specific event\r\n var callbacks = this._callbacks['$' + event];\r\n if (!callbacks) return this;\r\n\r\n // remove all handlers\r\n if (1 == arguments.length) {\r\n delete this._callbacks['$' + event];\r\n return this;\r\n }\r\n\r\n // remove specific handler\r\n var cb;\r\n for (var i = 0; i < callbacks.length; i++) {\r\n cb = callbacks[i];\r\n if (cb === fn || cb.fn === fn) {\r\n callbacks.splice(i, 1);\r\n break;\r\n }\r\n }\r\n\r\n // Remove event specific arrays for event types that no\r\n // one is subscribed for to avoid memory leak.\r\n if (callbacks.length === 0) {\r\n delete this._callbacks['$' + event];\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Emit `event` with the given args.\r\n *\r\n * @param {String} event\r\n * @param {Mixed} ...\r\n * @return {Emitter}\r\n */\r\n\r\nEmitter.prototype.emit = function(event){\r\n this._callbacks = this._callbacks || {};\r\n\r\n var args = new Array(arguments.length - 1)\r\n , callbacks = this._callbacks['$' + event];\r\n\r\n for (var i = 1; i < arguments.length; i++) {\r\n args[i - 1] = arguments[i];\r\n }\r\n\r\n if (callbacks) {\r\n callbacks = callbacks.slice(0);\r\n for (var i = 0, len = callbacks.length; i < len; ++i) {\r\n callbacks[i].apply(this, args);\r\n }\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Return array of callbacks for `event`.\r\n *\r\n * @param {String} event\r\n * @return {Array}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.listeners = function(event){\r\n this._callbacks = this._callbacks || {};\r\n return this._callbacks['$' + event] || [];\r\n};\r\n\r\n/**\r\n * Check if this emitter has `event` handlers.\r\n *\r\n * @param {String} event\r\n * @return {Boolean}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.hasListeners = function(event){\r\n return !! this.listeners(event).length;\r\n};\r\n"},"sourceMaps":null,"error":null,"hash":"5285e3dad02b925316128c69257aaf55","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /.cache/92/85d6b955ec99a104f19fc55134c9a6.json: -------------------------------------------------------------------------------- 1 | {"id":"../../node_modules/component-emitter/index.js","dependencies":[{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/package.json","includedInParent":true,"mtime":1590877042665},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/component-emitter/package.json","includedInParent":true,"mtime":1573387915060}],"generated":{"js":"\r\n/**\r\n * Expose `Emitter`.\r\n */\r\n\r\nif (typeof module !== 'undefined') {\r\n module.exports = Emitter;\r\n}\r\n\r\n/**\r\n * Initialize a new `Emitter`.\r\n *\r\n * @api public\r\n */\r\n\r\nfunction Emitter(obj) {\r\n if (obj) return mixin(obj);\r\n};\r\n\r\n/**\r\n * Mixin the emitter properties.\r\n *\r\n * @param {Object} obj\r\n * @return {Object}\r\n * @api private\r\n */\r\n\r\nfunction mixin(obj) {\r\n for (var key in Emitter.prototype) {\r\n obj[key] = Emitter.prototype[key];\r\n }\r\n return obj;\r\n}\r\n\r\n/**\r\n * Listen on the given `event` with `fn`.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.on =\r\nEmitter.prototype.addEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\r\n .push(fn);\r\n return this;\r\n};\r\n\r\n/**\r\n * Adds an `event` listener that will be invoked a single\r\n * time then automatically removed.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.once = function(event, fn){\r\n function on() {\r\n this.off(event, on);\r\n fn.apply(this, arguments);\r\n }\r\n\r\n on.fn = fn;\r\n this.on(event, on);\r\n return this;\r\n};\r\n\r\n/**\r\n * Remove the given callback for `event` or all\r\n * registered callbacks.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.off =\r\nEmitter.prototype.removeListener =\r\nEmitter.prototype.removeAllListeners =\r\nEmitter.prototype.removeEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n\r\n // all\r\n if (0 == arguments.length) {\r\n this._callbacks = {};\r\n return this;\r\n }\r\n\r\n // specific event\r\n var callbacks = this._callbacks['$' + event];\r\n if (!callbacks) return this;\r\n\r\n // remove all handlers\r\n if (1 == arguments.length) {\r\n delete this._callbacks['$' + event];\r\n return this;\r\n }\r\n\r\n // remove specific handler\r\n var cb;\r\n for (var i = 0; i < callbacks.length; i++) {\r\n cb = callbacks[i];\r\n if (cb === fn || cb.fn === fn) {\r\n callbacks.splice(i, 1);\r\n break;\r\n }\r\n }\r\n\r\n // Remove event specific arrays for event types that no\r\n // one is subscribed for to avoid memory leak.\r\n if (callbacks.length === 0) {\r\n delete this._callbacks['$' + event];\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Emit `event` with the given args.\r\n *\r\n * @param {String} event\r\n * @param {Mixed} ...\r\n * @return {Emitter}\r\n */\r\n\r\nEmitter.prototype.emit = function(event){\r\n this._callbacks = this._callbacks || {};\r\n\r\n var args = new Array(arguments.length - 1)\r\n , callbacks = this._callbacks['$' + event];\r\n\r\n for (var i = 1; i < arguments.length; i++) {\r\n args[i - 1] = arguments[i];\r\n }\r\n\r\n if (callbacks) {\r\n callbacks = callbacks.slice(0);\r\n for (var i = 0, len = callbacks.length; i < len; ++i) {\r\n callbacks[i].apply(this, args);\r\n }\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Return array of callbacks for `event`.\r\n *\r\n * @param {String} event\r\n * @return {Array}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.listeners = function(event){\r\n this._callbacks = this._callbacks || {};\r\n return this._callbacks['$' + event] || [];\r\n};\r\n\r\n/**\r\n * Check if this emitter has `event` handlers.\r\n *\r\n * @param {String} event\r\n * @return {Boolean}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.hasListeners = function(event){\r\n return !! this.listeners(event).length;\r\n};\r\n"},"sourceMaps":null,"error":null,"hash":"5285e3dad02b925316128c69257aaf55","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /.cache/9d/40865e4c07f966af4925716c581515.json: -------------------------------------------------------------------------------- 1 | {"id":"submit-name.js","dependencies":[{"name":"/home/aram/Desktop/nawikurdi/API/package.json","includedInParent":true,"mtime":1590908189847},{"name":"superagent","loc":{"line":1,"column":23},"parent":"/home/aram/Desktop/nawikurdi/API/public/js/submit-name.js","resolved":"/home/aram/Desktop/nawikurdi/API/node_modules/superagent/lib/client.js"},{"name":"jquery","loc":{"line":2,"column":14},"parent":"/home/aram/Desktop/nawikurdi/API/public/js/submit-name.js","resolved":"/home/aram/Desktop/nawikurdi/API/node_modules/jquery/dist/jquery.js"},{"name":"notyf","loc":{"line":3,"column":22},"parent":"/home/aram/Desktop/nawikurdi/API/public/js/submit-name.js","resolved":"/home/aram/Desktop/nawikurdi/API/node_modules/notyf/notyf.es.js"}],"generated":{"js":"\"use strict\";\n\nvar _superagent = _interopRequireDefault(require(\"superagent\"));\n\nvar _jquery = _interopRequireDefault(require(\"jquery\"));\n\nvar _notyf = require(\"notyf\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n// Create an instance of Notyf\n// scroll logic\nvar mybutton = document.getElementById(\"to-top\");\n\nwindow.onscroll = function () {\n scrollFunction();\n};\n\nfunction scrollFunction() {\n try {\n if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {\n mybutton.style.display = \"block\";\n } else {\n mybutton.style.display = \"none\";\n }\n } catch (e) {}\n}\n\nfunction topFunction() {\n document.body.scrollTop = 0; // For Safari\n\n document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera\n}\n\nvar notyf = new _notyf.Notyf();\n\nfunction submitname(data) {\n var cb = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};\n return _superagent.default.post(\"/api\").send(data).end(function (err, res) {\n cb(err, res);\n });\n}\n\nmodule.exports = {\n init: function init() {\n window.topFunction = topFunction;\n (0, _jquery.default)('.submit-button').click(function () {\n var btn = this;\n var submited_name = {\n desc: ' ',\n gender: 'O'\n };\n var gender = \"\".concat((0, _jquery.default)('select[name=gender]').val()).trim();\n var name = \"\".concat((0, _jquery.default)('input[name=name]').val()).trim();\n var desc = \"\".concat((0, _jquery.default)('input[name=desc]').val()).trim();\n\n if (name != '' && gender) {\n // submitname(name).then((result) => {\n // if (result.data.status === 1) {\n // alert('سوپاس لە ماوەیەکی کەمدا ناوەکات لە پەڕەکە دەردەجێت');\n // this.setState({ open: false });\n // } else {\n // alert('ببورە ناوەکەت زیاد نەکرا تکایە دوبارەی بکەوە');\n // }\n // }).catch(() => {\n // // error handling goes here\n // });\n submitname(_objectSpread(_objectSpread({}, submited_name), {}, {\n name: name,\n gender: gender,\n desc: desc\n }), function (err, res) {\n if (err) {\n // const errors = err.response.body.errors;\n // notyf.error(errors[0].msg);\n notyf.error('هەڵەیەک رویدا لەکاتی ناردنی ناوی نوێ');\n } else {\n notyf.success('ناوەکەت بە سەرکەوتویی نێردرا');\n (0, _jquery.default)('input[name=name]').val('');\n (0, _jquery.default)('input[name=desc]').val('');\n }\n });\n } else {\n console.log(name, gender);\n notyf.error('ناو و رەگەز پێویستە بۆ ناردنی ناوێکی نوێ');\n }\n });\n }\n};"},"sourceMaps":null,"error":null,"hash":"3bdf70f8560a7f012c67c5b23ea88563","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /public/js/favorites.js: -------------------------------------------------------------------------------- 1 | import superagent from 'superagent'; 2 | import $ from 'jquery'; 3 | import { Notyf } from 'notyf'; 4 | // Create an instance of Notyf 5 | const notyf = new Notyf(); 6 | 7 | // scroll logic 8 | let mybutton = document.getElementById("to-top"); 9 | window.onscroll = function() {scrollFunction()}; 10 | function scrollFunction() { 11 | if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { 12 | mybutton.style.display = "block"; 13 | } else { 14 | mybutton.style.display = "none"; 15 | } 16 | } 17 | function topFunction() { 18 | document.body.scrollTop = 0; // For Safari 19 | document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera 20 | } 21 | 22 | function vote(data, cb = ()=>{}){ 23 | return superagent 24 | .post(`/api/vote`) 25 | .send(data) 26 | .end((err, res)=>{ 27 | cb(err, res) 28 | }); 29 | } 30 | 31 | 32 | function getCookie(cname) { 33 | var name = cname + "="; 34 | var decodedCookie = decodeURIComponent(document.cookie); 35 | var ca = decodedCookie.split(';'); 36 | for(var i = 0; i 51 | 52 |

چه‌ند ناوێك هه‌ڵبژێره‌ بۆ ئه‌وه‌ی لێره‌ ده‌ربچێت

53 |
54 | `); 55 | } 56 | function hideNotFound(){ 57 | $('.notfound-container').remove() 58 | } 59 | 60 | module.exports = { 61 | init: function() { 62 | window.topFunction = topFunction; 63 | 64 | let favs = localStorage.getItem('favs'); 65 | try{ 66 | let found = false; 67 | favs = JSON.parse(favs); 68 | for (var key in favs) { 69 | if (favs.hasOwnProperty(key)) { 70 | var val = favs[key]; 71 | $('.names-container').append(val); 72 | found = true; 73 | } 74 | } 75 | if(!found) showNotFound(); 76 | }catch(e){ 77 | console.log(e) 78 | } 79 | $(document).delegate('.up-vote', 'click', function(){ 80 | const btn = this; 81 | vote({ 82 | name_id: $(this).data('id'), 83 | uid: getCookie('uid'), 84 | impact: 'positive' 85 | }, 86 | (err, res)=>{ 87 | if(err){ 88 | const errors = err.response.body.errors; 89 | notyf.error(errors[0].msg); 90 | } else { 91 | $(btn).html(` نێردرا`) 92 | } 93 | }) 94 | }); 95 | $(document).delegate('.down-vote', 'click', function(){ 96 | const btn = this; 97 | vote({ 98 | name_id: $(this).data('id'), 99 | uid: getCookie('uid'), 100 | impact: 'negative' 101 | }, 102 | (err, res)=>{ 103 | if(err){ 104 | const errors = err.response.body.errors; 105 | notyf.error(errors[0].msg); 106 | } else { 107 | $(btn).html(` نێردرا`) 108 | } 109 | }) 110 | }); 111 | $(document).delegate('.remove-fav', 'click', function(){ 112 | let favs = localStorage.getItem('favs'); 113 | let fav_ids = localStorage.getItem('fav_ids'); 114 | 115 | const id = $(this).data('id'); 116 | if(favs){ 117 | favs = JSON.parse(favs); 118 | delete favs[id]; 119 | localStorage.setItem('favs', JSON.stringify(favs)) 120 | } 121 | if(fav_ids){ 122 | fav_ids = fav_ids.split(','); 123 | const index = fav_ids.indexOf(id+""); 124 | if (index > -1) { 125 | fav_ids.splice(index, 1); 126 | } 127 | if(!fav_ids.length == 0) showNotFound(); 128 | localStorage.setItem('fav_ids', fav_ids.join(',')) 129 | } 130 | $(this).parents('.card-container').remove() 131 | }); 132 | 133 | }, 134 | } 135 | -------------------------------------------------------------------------------- /.cache/0c/0bdab1ca4d585f2597563d6aff2bae.json: -------------------------------------------------------------------------------- 1 | {"id":"submit-name.js","dependencies":[{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/package.json","includedInParent":true,"mtime":1590877042665},{"name":"superagent","loc":{"line":1,"column":23},"parent":"/Users/hozan/Desktop/devstree/nawikurdi/API/public/js/submit-name.js","resolved":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/superagent/lib/client.js"},{"name":"jquery","loc":{"line":2,"column":14},"parent":"/Users/hozan/Desktop/devstree/nawikurdi/API/public/js/submit-name.js","resolved":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/jquery/dist/jquery.js"},{"name":"notyf","loc":{"line":3,"column":22},"parent":"/Users/hozan/Desktop/devstree/nawikurdi/API/public/js/submit-name.js","resolved":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/notyf/notyf.es.js"}],"generated":{"js":"\"use strict\";\n\nvar _superagent = _interopRequireDefault(require(\"superagent\"));\n\nvar _jquery = _interopRequireDefault(require(\"jquery\"));\n\nvar _notyf = require(\"notyf\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n// Create an instance of Notyf\n// scroll logic\nvar mybutton = document.getElementById(\"to-top\");\n\nwindow.onscroll = function () {\n scrollFunction();\n};\n\nfunction scrollFunction() {\n try {\n if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {\n mybutton.style.display = \"block\";\n } else {\n mybutton.style.display = \"none\";\n }\n } catch (e) {}\n}\n\nfunction topFunction() {\n document.body.scrollTop = 0; // For Safari\n\n document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera\n}\n\nvar notyf = new _notyf.Notyf();\n\nfunction submitname(data) {\n var cb = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};\n return _superagent.default.post(\"/api\").send(data).end(function (err, res) {\n cb(err, res);\n });\n}\n\nmodule.exports = {\n init: function init() {\n window.topFunction = topFunction;\n (0, _jquery.default)('.submit-button').click(function () {\n var btn = this;\n var submited_name = {\n desc: ' ',\n gender: 'O'\n };\n var gender = \"\".concat((0, _jquery.default)('select[name=gender]').val()).trim();\n var name = \"\".concat((0, _jquery.default)('input[name=name]').val()).trim();\n var desc = \"\".concat((0, _jquery.default)('input[name=desc]').val()).trim();\n\n if (name != '' && gender) {\n // submitname(name).then((result) => {\n // if (result.data.status === 1) {\n // alert('سوپاس لە ماوەیەکی کەمدا ناوەکات لە پەڕەکە دەردەجێت');\n // this.setState({ open: false });\n // } else {\n // alert('ببورە ناوەکەت زیاد نەکرا تکایە دوبارەی بکەوە');\n // }\n // }).catch(() => {\n // // error handling goes here\n // });\n submitname(_objectSpread(_objectSpread({}, submited_name), {}, {\n name: name,\n gender: gender,\n desc: desc\n }), function (err, res) {\n if (err) {\n // const errors = err.response.body.errors;\n // notyf.error(errors[0].msg);\n notyf.error('هەڵەیەک رویدا لەکاتی ناردنی ناوی نوێ');\n } else {\n notyf.success('ناوەکەت بە سەرکەوتویی نێردرا');\n (0, _jquery.default)('input[name=name]').val('');\n (0, _jquery.default)('input[name=desc]').val('');\n }\n });\n } else {\n console.log(name, gender);\n notyf.error('ناو و رەگەز پێویستە بۆ ناردنی ناوێکی نوێ');\n }\n });\n }\n};"},"sourceMaps":null,"error":null,"hash":"3bdf70f8560a7f012c67c5b23ea88563","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /.cache/02/1bd56691dff93528ba0b0380dcc30d.json: -------------------------------------------------------------------------------- 1 | {"id":"../../node_modules/fast-safe-stringify/index.js","dependencies":[{"name":"/home/aram/Desktop/nawikurdi/API/package.json","includedInParent":true,"mtime":1590908189847},{"name":"/home/aram/Desktop/nawikurdi/API/node_modules/fast-safe-stringify/package.json","includedInParent":true,"mtime":1590908293939}],"generated":{"js":"module.exports = stringify\nstringify.default = stringify\nstringify.stable = deterministicStringify\nstringify.stableStringify = deterministicStringify\n\nvar arr = []\nvar replacerStack = []\n\n// Regular stringify\nfunction stringify (obj, replacer, spacer) {\n decirc(obj, '', [], undefined)\n var res\n if (replacerStack.length === 0) {\n res = JSON.stringify(obj, replacer, spacer)\n } else {\n res = JSON.stringify(obj, replaceGetterValues(replacer), spacer)\n }\n while (arr.length !== 0) {\n var part = arr.pop()\n if (part.length === 4) {\n Object.defineProperty(part[0], part[1], part[3])\n } else {\n part[0][part[1]] = part[2]\n }\n }\n return res\n}\nfunction decirc (val, k, stack, parent) {\n var i\n if (typeof val === 'object' && val !== null) {\n for (i = 0; i < stack.length; i++) {\n if (stack[i] === val) {\n var propertyDescriptor = Object.getOwnPropertyDescriptor(parent, k)\n if (propertyDescriptor.get !== undefined) {\n if (propertyDescriptor.configurable) {\n Object.defineProperty(parent, k, { value: '[Circular]' })\n arr.push([parent, k, val, propertyDescriptor])\n } else {\n replacerStack.push([val, k])\n }\n } else {\n parent[k] = '[Circular]'\n arr.push([parent, k, val])\n }\n return\n }\n }\n stack.push(val)\n // Optimize for Arrays. Big arrays could kill the performance otherwise!\n if (Array.isArray(val)) {\n for (i = 0; i < val.length; i++) {\n decirc(val[i], i, stack, val)\n }\n } else {\n var keys = Object.keys(val)\n for (i = 0; i < keys.length; i++) {\n var key = keys[i]\n decirc(val[key], key, stack, val)\n }\n }\n stack.pop()\n }\n}\n\n// Stable-stringify\nfunction compareFunction (a, b) {\n if (a < b) {\n return -1\n }\n if (a > b) {\n return 1\n }\n return 0\n}\n\nfunction deterministicStringify (obj, replacer, spacer) {\n var tmp = deterministicDecirc(obj, '', [], undefined) || obj\n var res\n if (replacerStack.length === 0) {\n res = JSON.stringify(tmp, replacer, spacer)\n } else {\n res = JSON.stringify(tmp, replaceGetterValues(replacer), spacer)\n }\n while (arr.length !== 0) {\n var part = arr.pop()\n if (part.length === 4) {\n Object.defineProperty(part[0], part[1], part[3])\n } else {\n part[0][part[1]] = part[2]\n }\n }\n return res\n}\n\nfunction deterministicDecirc (val, k, stack, parent) {\n var i\n if (typeof val === 'object' && val !== null) {\n for (i = 0; i < stack.length; i++) {\n if (stack[i] === val) {\n var propertyDescriptor = Object.getOwnPropertyDescriptor(parent, k)\n if (propertyDescriptor.get !== undefined) {\n if (propertyDescriptor.configurable) {\n Object.defineProperty(parent, k, { value: '[Circular]' })\n arr.push([parent, k, val, propertyDescriptor])\n } else {\n replacerStack.push([val, k])\n }\n } else {\n parent[k] = '[Circular]'\n arr.push([parent, k, val])\n }\n return\n }\n }\n if (typeof val.toJSON === 'function') {\n return\n }\n stack.push(val)\n // Optimize for Arrays. Big arrays could kill the performance otherwise!\n if (Array.isArray(val)) {\n for (i = 0; i < val.length; i++) {\n deterministicDecirc(val[i], i, stack, val)\n }\n } else {\n // Create a temporary object in the required way\n var tmp = {}\n var keys = Object.keys(val).sort(compareFunction)\n for (i = 0; i < keys.length; i++) {\n var key = keys[i]\n deterministicDecirc(val[key], key, stack, val)\n tmp[key] = val[key]\n }\n if (parent !== undefined) {\n arr.push([parent, k, val])\n parent[k] = tmp\n } else {\n return tmp\n }\n }\n stack.pop()\n }\n}\n\n// wraps replacer function to handle values we couldn't replace\n// and mark them as [Circular]\nfunction replaceGetterValues (replacer) {\n replacer = replacer !== undefined ? replacer : function (k, v) { return v }\n return function (key, val) {\n if (replacerStack.length > 0) {\n for (var i = 0; i < replacerStack.length; i++) {\n var part = replacerStack[i]\n if (part[1] === key && part[0] === val) {\n val = '[Circular]'\n replacerStack.splice(i, 1)\n break\n }\n }\n }\n return replacer.call(this, key, val)\n }\n}\n"},"sourceMaps":null,"error":null,"hash":"f273a599d3f28e54d0075deab9c8434d","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /.cache/24/22ab86c6902f4323bfc163a6786776.json: -------------------------------------------------------------------------------- 1 | {"id":"../../node_modules/fast-safe-stringify/index.js","dependencies":[{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/package.json","includedInParent":true,"mtime":1590877042665},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/fast-safe-stringify/package.json","includedInParent":true,"mtime":1585830670204}],"generated":{"js":"module.exports = stringify\nstringify.default = stringify\nstringify.stable = deterministicStringify\nstringify.stableStringify = deterministicStringify\n\nvar arr = []\nvar replacerStack = []\n\n// Regular stringify\nfunction stringify (obj, replacer, spacer) {\n decirc(obj, '', [], undefined)\n var res\n if (replacerStack.length === 0) {\n res = JSON.stringify(obj, replacer, spacer)\n } else {\n res = JSON.stringify(obj, replaceGetterValues(replacer), spacer)\n }\n while (arr.length !== 0) {\n var part = arr.pop()\n if (part.length === 4) {\n Object.defineProperty(part[0], part[1], part[3])\n } else {\n part[0][part[1]] = part[2]\n }\n }\n return res\n}\nfunction decirc (val, k, stack, parent) {\n var i\n if (typeof val === 'object' && val !== null) {\n for (i = 0; i < stack.length; i++) {\n if (stack[i] === val) {\n var propertyDescriptor = Object.getOwnPropertyDescriptor(parent, k)\n if (propertyDescriptor.get !== undefined) {\n if (propertyDescriptor.configurable) {\n Object.defineProperty(parent, k, { value: '[Circular]' })\n arr.push([parent, k, val, propertyDescriptor])\n } else {\n replacerStack.push([val, k])\n }\n } else {\n parent[k] = '[Circular]'\n arr.push([parent, k, val])\n }\n return\n }\n }\n stack.push(val)\n // Optimize for Arrays. Big arrays could kill the performance otherwise!\n if (Array.isArray(val)) {\n for (i = 0; i < val.length; i++) {\n decirc(val[i], i, stack, val)\n }\n } else {\n var keys = Object.keys(val)\n for (i = 0; i < keys.length; i++) {\n var key = keys[i]\n decirc(val[key], key, stack, val)\n }\n }\n stack.pop()\n }\n}\n\n// Stable-stringify\nfunction compareFunction (a, b) {\n if (a < b) {\n return -1\n }\n if (a > b) {\n return 1\n }\n return 0\n}\n\nfunction deterministicStringify (obj, replacer, spacer) {\n var tmp = deterministicDecirc(obj, '', [], undefined) || obj\n var res\n if (replacerStack.length === 0) {\n res = JSON.stringify(tmp, replacer, spacer)\n } else {\n res = JSON.stringify(tmp, replaceGetterValues(replacer), spacer)\n }\n while (arr.length !== 0) {\n var part = arr.pop()\n if (part.length === 4) {\n Object.defineProperty(part[0], part[1], part[3])\n } else {\n part[0][part[1]] = part[2]\n }\n }\n return res\n}\n\nfunction deterministicDecirc (val, k, stack, parent) {\n var i\n if (typeof val === 'object' && val !== null) {\n for (i = 0; i < stack.length; i++) {\n if (stack[i] === val) {\n var propertyDescriptor = Object.getOwnPropertyDescriptor(parent, k)\n if (propertyDescriptor.get !== undefined) {\n if (propertyDescriptor.configurable) {\n Object.defineProperty(parent, k, { value: '[Circular]' })\n arr.push([parent, k, val, propertyDescriptor])\n } else {\n replacerStack.push([val, k])\n }\n } else {\n parent[k] = '[Circular]'\n arr.push([parent, k, val])\n }\n return\n }\n }\n if (typeof val.toJSON === 'function') {\n return\n }\n stack.push(val)\n // Optimize for Arrays. Big arrays could kill the performance otherwise!\n if (Array.isArray(val)) {\n for (i = 0; i < val.length; i++) {\n deterministicDecirc(val[i], i, stack, val)\n }\n } else {\n // Create a temporary object in the required way\n var tmp = {}\n var keys = Object.keys(val).sort(compareFunction)\n for (i = 0; i < keys.length; i++) {\n var key = keys[i]\n deterministicDecirc(val[key], key, stack, val)\n tmp[key] = val[key]\n }\n if (parent !== undefined) {\n arr.push([parent, k, val])\n parent[k] = tmp\n } else {\n return tmp\n }\n }\n stack.pop()\n }\n}\n\n// wraps replacer function to handle values we couldn't replace\n// and mark them as [Circular]\nfunction replaceGetterValues (replacer) {\n replacer = replacer !== undefined ? replacer : function (k, v) { return v }\n return function (key, val) {\n if (replacerStack.length > 0) {\n for (var i = 0; i < replacerStack.length; i++) {\n var part = replacerStack[i]\n if (part[1] === key && part[0] === val) {\n val = '[Circular]'\n replacerStack.splice(i, 1)\n break\n }\n }\n }\n return replacer.call(this, key, val)\n }\n}\n"},"sourceMaps":null,"error":null,"hash":"f273a599d3f28e54d0075deab9c8434d","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /public/js/dist/main.css: -------------------------------------------------------------------------------- 1 | @-webkit-keyframes notyf-fadeinup{0%{opacity:0;transform:translateY(25%)}to{opacity:1;transform:translateY(0)}}@keyframes notyf-fadeinup{0%{opacity:0;transform:translateY(25%)}to{opacity:1;transform:translateY(0)}}@-webkit-keyframes notyf-fadeinleft{0%{opacity:0;transform:translateX(25%)}to{opacity:1;transform:translateX(0)}}@keyframes notyf-fadeinleft{0%{opacity:0;transform:translateX(25%)}to{opacity:1;transform:translateX(0)}}@-webkit-keyframes notyf-fadeoutright{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(25%)}}@keyframes notyf-fadeoutright{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(25%)}}@-webkit-keyframes notyf-fadeoutdown{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(25%)}}@keyframes notyf-fadeoutdown{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(25%)}}@-webkit-keyframes ripple{0%{transform:scale(0) translateY(-45%) translateX(13%)}to{transform:scale(1) translateY(-45%) translateX(13%)}}@keyframes ripple{0%{transform:scale(0) translateY(-45%) translateX(13%)}to{transform:scale(1) translateY(-45%) translateX(13%)}}.notyf{position:fixed;top:0;left:0;height:100%;width:100%;color:#fff;z-index:9999;display:flex;flex-direction:column;align-items:flex-end;justify-content:flex-end;pointer-events:none;box-sizing:border-box;padding:20px}.notyf__icon--error,.notyf__icon--success{height:21px;width:21px;background:#fff;border-radius:50%;display:block;margin:0 auto;position:relative}.notyf__icon--error:after,.notyf__icon--error:before{content:"";background:currentColor;display:block;position:absolute;width:3px;border-radius:3px;left:9px;height:12px;top:5px}.notyf__icon--error:after{transform:rotate(-45deg)}.notyf__icon--error:before{transform:rotate(45deg)}.notyf__icon--success:after,.notyf__icon--success:before{content:"";background:currentColor;display:block;position:absolute;width:3px;border-radius:3px}.notyf__icon--success:after{height:6px;transform:rotate(-45deg);top:9px;left:6px}.notyf__icon--success:before{height:11px;transform:rotate(45deg);top:5px;left:10px}.notyf__toast{display:block;overflow:hidden;pointer-events:auto;-webkit-animation:notyf-fadeinup .3s ease-in forwards;animation:notyf-fadeinup .3s ease-in forwards;box-shadow:0 3px 7px 0 rgba(0,0,0,.25);position:relative;padding:0 15px;border-radius:2px;max-width:300px;transform:translateY(25%);box-sizing:border-box}.notyf__toast--disappear{transform:translateY(0);-webkit-animation:notyf-fadeoutdown .3s forwards;animation:notyf-fadeoutdown .3s forwards;-webkit-animation-delay:.25s;animation-delay:.25s}.notyf__toast--disappear .notyf__icon,.notyf__toast--disappear .notyf__message{-webkit-animation:notyf-fadeoutdown .3s forwards;animation:notyf-fadeoutdown .3s forwards;opacity:1;transform:translateY(0)}.notyf__toast--disappear .notyf__dismiss{-webkit-animation:notyf-fadeoutright .3s forwards;animation:notyf-fadeoutright .3s forwards;opacity:1;transform:translateX(0)}.notyf__toast--disappear .notyf__message{-webkit-animation-delay:.05s;animation-delay:.05s}.notyf__toast--upper{margin-bottom:20px}.notyf__toast--lower{margin-top:20px}.notyf__toast--dismissible .notyf__wrapper{padding-right:30px}.notyf__ripple{height:400px;width:400px;position:absolute;transform-origin:bottom right;right:0;top:0;border-radius:50%;transform:scale(0) translateY(-51%) translateX(13%);z-index:5;-webkit-animation:ripple .4s ease-out forwards;animation:ripple .4s ease-out forwards}.notyf__wrapper{display:flex;align-items:center;padding-top:17px;padding-bottom:17px;padding-right:15px;border-radius:3px;position:relative;z-index:10}.notyf__icon{width:22px;text-align:center;font-size:1.3em;opacity:0;-webkit-animation:notyf-fadeinup .3s forwards;animation:notyf-fadeinup .3s forwards;-webkit-animation-delay:.3s;animation-delay:.3s;margin-right:13px}.notyf__dismiss{position:absolute;top:0;right:0;height:100%;width:26px;margin-right:-15px;-webkit-animation:notyf-fadeinleft .3s forwards;animation:notyf-fadeinleft .3s forwards;-webkit-animation-delay:.35s;animation-delay:.35s;opacity:0}.notyf__dismiss-btn{background-color:rgba(0,0,0,.25);border:none;cursor:pointer;transition:opacity .2s ease,background-color .2s ease;outline:none;opacity:.35;height:100%;width:100%}.notyf__dismiss-btn:after,.notyf__dismiss-btn:before{content:"";background:#fff;height:12px;width:2px;border-radius:3px;position:absolute;left:calc(50% - 1px);top:calc(50% - 5px)}.notyf__dismiss-btn:after{transform:rotate(-45deg)}.notyf__dismiss-btn:before{transform:rotate(45deg)}.notyf__dismiss-btn:hover{opacity:.7;background-color:rgba(0,0,0,.15)}.notyf__dismiss-btn:active{opacity:.8}.notyf__message{vertical-align:middle;position:relative;opacity:0;-webkit-animation:notyf-fadeinup .3s forwards;animation:notyf-fadeinup .3s forwards;-webkit-animation-delay:.25s;animation-delay:.25s;line-height:1.5em}@media only screen and (max-width:480px){.notyf{padding:0}.notyf__ripple{height:600px;width:600px;-webkit-animation-duration:.5s;animation-duration:.5s}.notyf__toast{max-width:none;border-radius:0;box-shadow:0 -2px 7px 0 rgba(0,0,0,.13);width:100%}.notyf__dismiss{width:56px}} -------------------------------------------------------------------------------- /.cache/44/46faf117461e516e6f53a2dba15ad7.json: -------------------------------------------------------------------------------- 1 | {"id":"favorites.js","dependencies":[{"name":"/home/aram/Desktop/nawikurdi/API/package.json","includedInParent":true,"mtime":1590908189847},{"name":"superagent","loc":{"line":1,"column":23},"parent":"/home/aram/Desktop/nawikurdi/API/public/js/favorites.js","resolved":"/home/aram/Desktop/nawikurdi/API/node_modules/superagent/lib/client.js"},{"name":"jquery","loc":{"line":2,"column":14},"parent":"/home/aram/Desktop/nawikurdi/API/public/js/favorites.js","resolved":"/home/aram/Desktop/nawikurdi/API/node_modules/jquery/dist/jquery.js"},{"name":"notyf","loc":{"line":3,"column":22},"parent":"/home/aram/Desktop/nawikurdi/API/public/js/favorites.js","resolved":"/home/aram/Desktop/nawikurdi/API/node_modules/notyf/notyf.es.js"}],"generated":{"js":"\"use strict\";\n\nvar _superagent = _interopRequireDefault(require(\"superagent\"));\n\nvar _jquery = _interopRequireDefault(require(\"jquery\"));\n\nvar _notyf = require(\"notyf\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Create an instance of Notyf\nvar notyf = new _notyf.Notyf(); // scroll logic\n\nvar mybutton = document.getElementById(\"to-top\");\n\nwindow.onscroll = function () {\n scrollFunction();\n};\n\nfunction scrollFunction() {\n if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {\n mybutton.style.display = \"block\";\n } else {\n mybutton.style.display = \"none\";\n }\n}\n\nfunction topFunction() {\n document.body.scrollTop = 0; // For Safari\n\n document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera\n}\n\nfunction vote(data) {\n var cb = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};\n return _superagent.default.post(\"/api/vote\").send(data).end(function (err, res) {\n cb(err, res);\n });\n}\n\nfunction getCookie(cname) {\n var name = cname + \"=\";\n var decodedCookie = decodeURIComponent(document.cookie);\n var ca = decodedCookie.split(';');\n\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n\n if (c.indexOf(name) == 0) {\n return c.substring(name.length, c.length);\n }\n }\n\n return \"\";\n}\n\nfunction showNotFound() {\n (0, _jquery.default)('.names-container').prepend(\"\\n
\\n \\n

\\u0686\\u0647\\u200C\\u0646\\u062F \\u0646\\u0627\\u0648\\u06CE\\u0643 \\u0647\\u0647\\u200C\\u06B5\\u0628\\u0698\\u06CE\\u0631\\u0647\\u200C \\u0628\\u06C6 \\u0626\\u0647\\u200C\\u0648\\u0647\\u200C\\u06CC \\u0644\\u06CE\\u0631\\u0647\\u200C \\u062F\\u0647\\u200C\\u0631\\u0628\\u0686\\u06CE\\u062A

\\n
\\n \");\n}\n\nfunction hideNotFound() {\n (0, _jquery.default)('.notfound-container').remove();\n}\n\nmodule.exports = {\n init: function init() {\n window.topFunction = topFunction;\n var favs = localStorage.getItem('favs');\n\n try {\n var found = false;\n favs = JSON.parse(favs);\n\n for (var key in favs) {\n if (favs.hasOwnProperty(key)) {\n var val = favs[key];\n (0, _jquery.default)('.names-container').append(val);\n found = true;\n }\n }\n\n if (!found) showNotFound();\n } catch (e) {\n console.log(e);\n }\n\n (0, _jquery.default)(document).delegate('.up-vote', 'click', function () {\n var btn = this;\n vote({\n name_id: (0, _jquery.default)(this).data('id'),\n uid: getCookie('uid'),\n impact: 'positive'\n }, function (err, res) {\n if (err) {\n var errors = err.response.body.errors;\n notyf.error(errors[0].msg);\n } else {\n (0, _jquery.default)(btn).html(\" \\u0646\\u06CE\\u0631\\u062F\\u0631\\u0627\");\n }\n });\n });\n (0, _jquery.default)(document).delegate('.down-vote', 'click', function () {\n var btn = this;\n vote({\n name_id: (0, _jquery.default)(this).data('id'),\n uid: getCookie('uid'),\n impact: 'negative'\n }, function (err, res) {\n if (err) {\n var errors = err.response.body.errors;\n notyf.error(errors[0].msg);\n } else {\n (0, _jquery.default)(btn).html(\" \\u0646\\u06CE\\u0631\\u062F\\u0631\\u0627\");\n }\n });\n });\n (0, _jquery.default)(document).delegate('.remove-fav', 'click', function () {\n var favs = localStorage.getItem('favs');\n var fav_ids = localStorage.getItem('fav_ids');\n var id = (0, _jquery.default)(this).data('id');\n\n if (favs) {\n favs = JSON.parse(favs);\n delete favs[id];\n localStorage.setItem('favs', JSON.stringify(favs));\n }\n\n if (fav_ids) {\n fav_ids = fav_ids.split(',');\n var index = fav_ids.indexOf(id + \"\");\n\n if (index > -1) {\n fav_ids.splice(index, 1);\n }\n\n if (!fav_ids.length == 0) showNotFound();\n localStorage.setItem('fav_ids', fav_ids.join(','));\n }\n\n (0, _jquery.default)(this).parents('.card-container').remove();\n });\n }\n};"},"sourceMaps":null,"error":null,"hash":"f6f3ea9b7514835b1da4279d3f2390d4","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /.cache/c8/02239e08576993846d9b27d73bc084.json: -------------------------------------------------------------------------------- 1 | {"id":"MZOt","dependencies":[{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/package.json","includedInParent":true,"mtime":1591020629913}],"generated":{"js":"module.exports={debounce:function(e,n,t){var u;return function(){var o=this,i=arguments,l=t&&!u;clearTimeout(u),u=setTimeout(function(){u=null,t||e.apply(o,i)},n),l&&e.apply(o,i)}}};"},"sourceMaps":{"js":{"mappings":[{"source":"general.js","name":"module","original":{"line":1,"column":0},"generated":{"line":1,"column":0}},{"source":"general.js","name":"exports","original":{"line":1,"column":7},"generated":{"line":1,"column":7}},{"source":"general.js","original":{"line":1,"column":17},"generated":{"line":1,"column":15}},{"source":"general.js","name":"debounce","original":{"line":6,"column":4},"generated":{"line":1,"column":16}},{"source":"general.js","original":{"line":6,"column":14},"generated":{"line":1,"column":25}},{"source":"general.js","name":"func","original":{"line":6,"column":15},"generated":{"line":1,"column":34}},{"source":"general.js","name":"wait","original":{"line":6,"column":21},"generated":{"line":1,"column":36}},{"source":"general.js","name":"immediate","original":{"line":6,"column":27},"generated":{"line":1,"column":38}},{"source":"general.js","name":"timeout","original":{"line":7,"column":12},"generated":{"line":1,"column":41}},{"source":"general.js","name":"timeout","original":{"line":7,"column":12},"generated":{"line":1,"column":45}},{"source":"general.js","original":{"line":8,"column":15},"generated":{"line":1,"column":47}},{"source":"general.js","original":{"line":8,"column":15},"generated":{"line":1,"column":54}},{"source":"general.js","name":"context","original":{"line":9,"column":16},"generated":{"line":1,"column":65}},{"source":"general.js","name":"context","original":{"line":9,"column":16},"generated":{"line":1,"column":69}},{"source":"general.js","original":{"line":9,"column":26},"generated":{"line":1,"column":71}},{"source":"general.js","name":"args","original":{"line":9,"column":32},"generated":{"line":1,"column":76}},{"source":"general.js","name":"arguments","original":{"line":9,"column":39},"generated":{"line":1,"column":78}},{"source":"general.js","name":"callNow","original":{"line":14,"column":16},"generated":{"line":1,"column":88}},{"source":"general.js","name":"immediate","original":{"line":14,"column":26},"generated":{"line":1,"column":90}},{"source":"general.js","name":"timeout","original":{"line":14,"column":40},"generated":{"line":1,"column":94}},{"source":"general.js","name":"clearTimeout","original":{"line":15,"column":12},"generated":{"line":1,"column":96}},{"source":"general.js","name":"timeout","original":{"line":15,"column":25},"generated":{"line":1,"column":109}},{"source":"general.js","name":"timeout","original":{"line":16,"column":12},"generated":{"line":1,"column":112}},{"source":"general.js","name":"setTimeout","original":{"line":16,"column":22},"generated":{"line":1,"column":114}},{"source":"general.js","original":{"line":10,"column":24},"generated":{"line":1,"column":125}},{"source":"general.js","name":"timeout","original":{"line":11,"column":16},"generated":{"line":1,"column":136}},{"source":"general.js","original":{"line":11,"column":26},"generated":{"line":1,"column":138}},{"source":"general.js","name":"immediate","original":{"line":12,"column":21},"generated":{"line":1,"column":143}},{"source":"general.js","name":"func","original":{"line":12,"column":32},"generated":{"line":1,"column":146}},{"source":"general.js","name":"apply","original":{"line":12,"column":37},"generated":{"line":1,"column":148}},{"source":"general.js","name":"context","original":{"line":12,"column":43},"generated":{"line":1,"column":154}},{"source":"general.js","name":"args","original":{"line":12,"column":52},"generated":{"line":1,"column":156}},{"source":"general.js","name":"wait","original":{"line":16,"column":40},"generated":{"line":1,"column":160}},{"source":"general.js","name":"callNow","original":{"line":17,"column":16},"generated":{"line":1,"column":163}},{"source":"general.js","name":"func","original":{"line":17,"column":25},"generated":{"line":1,"column":166}},{"source":"general.js","name":"apply","original":{"line":17,"column":30},"generated":{"line":1,"column":168}},{"source":"general.js","name":"context","original":{"line":17,"column":36},"generated":{"line":1,"column":174}},{"source":"general.js","name":"args","original":{"line":17,"column":45},"generated":{"line":1,"column":176}}],"sources":{"general.js":"module.exports = {\n // Returns a function, that, as long as it continues to be invoked, will not\n // be triggered. The function will be called after it stops being called for\n // N milliseconds. If `immediate` is passed, trigger the function on the\n // leading edge, instead of the trailing.\n debounce: (func, wait, immediate)=>{\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n }\n}"},"lineCount":null}},"error":null,"hash":"21150bd937272cb22d3fb2807e4490f1","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /.cache/53/b4ca6e964ef8d9ccd55ec8c9f8e800.json: -------------------------------------------------------------------------------- 1 | {"id":"favorites.js","dependencies":[{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/package.json","includedInParent":true,"mtime":1590877042665},{"name":"superagent","loc":{"line":1,"column":23},"parent":"/Users/hozan/Desktop/devstree/nawikurdi/API/public/js/favorites.js","resolved":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/superagent/lib/client.js"},{"name":"jquery","loc":{"line":2,"column":14},"parent":"/Users/hozan/Desktop/devstree/nawikurdi/API/public/js/favorites.js","resolved":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/jquery/dist/jquery.js"},{"name":"notyf","loc":{"line":3,"column":22},"parent":"/Users/hozan/Desktop/devstree/nawikurdi/API/public/js/favorites.js","resolved":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/notyf/notyf.es.js"}],"generated":{"js":"\"use strict\";\n\nvar _superagent = _interopRequireDefault(require(\"superagent\"));\n\nvar _jquery = _interopRequireDefault(require(\"jquery\"));\n\nvar _notyf = require(\"notyf\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Create an instance of Notyf\nvar notyf = new _notyf.Notyf(); // scroll logic\n\nvar mybutton = document.getElementById(\"to-top\");\n\nwindow.onscroll = function () {\n scrollFunction();\n};\n\nfunction scrollFunction() {\n if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {\n mybutton.style.display = \"block\";\n } else {\n mybutton.style.display = \"none\";\n }\n}\n\nfunction topFunction() {\n document.body.scrollTop = 0; // For Safari\n\n document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera\n}\n\nfunction vote(data) {\n var cb = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};\n return _superagent.default.post(\"/api/vote\").send(data).end(function (err, res) {\n cb(err, res);\n });\n}\n\nfunction getCookie(cname) {\n var name = cname + \"=\";\n var decodedCookie = decodeURIComponent(document.cookie);\n var ca = decodedCookie.split(';');\n\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n\n if (c.indexOf(name) == 0) {\n return c.substring(name.length, c.length);\n }\n }\n\n return \"\";\n}\n\nfunction showNotFound() {\n (0, _jquery.default)('.names-container').prepend(\"\\n
\\n \\n

\\u0686\\u0647\\u200C\\u0646\\u062F \\u0646\\u0627\\u0648\\u06CE\\u0643 \\u0647\\u0647\\u200C\\u06B5\\u0628\\u0698\\u06CE\\u0631\\u0647\\u200C \\u0628\\u06C6 \\u0626\\u0647\\u200C\\u0648\\u0647\\u200C\\u06CC \\u0644\\u06CE\\u0631\\u0647\\u200C \\u062F\\u0647\\u200C\\u0631\\u0628\\u0686\\u06CE\\u062A

\\n
\\n \");\n}\n\nfunction hideNotFound() {\n (0, _jquery.default)('.notfound-container').remove();\n}\n\nmodule.exports = {\n init: function init() {\n window.topFunction = topFunction;\n var favs = localStorage.getItem('favs');\n\n try {\n var found = false;\n favs = JSON.parse(favs);\n\n for (var key in favs) {\n if (favs.hasOwnProperty(key)) {\n var val = favs[key];\n (0, _jquery.default)('.names-container').append(val);\n found = true;\n }\n }\n\n if (!found) showNotFound();\n } catch (e) {\n console.log(e);\n }\n\n (0, _jquery.default)(document).delegate('.up-vote', 'click', function () {\n var btn = this;\n vote({\n name_id: (0, _jquery.default)(this).data('id'),\n uid: getCookie('uid'),\n impact: 'positive'\n }, function (err, res) {\n if (err) {\n var errors = err.response.body.errors;\n notyf.error(errors[0].msg);\n } else {\n (0, _jquery.default)(btn).html(\" \\u0646\\u06CE\\u0631\\u062F\\u0631\\u0627\");\n }\n });\n });\n (0, _jquery.default)(document).delegate('.down-vote', 'click', function () {\n var btn = this;\n vote({\n name_id: (0, _jquery.default)(this).data('id'),\n uid: getCookie('uid'),\n impact: 'negative'\n }, function (err, res) {\n if (err) {\n var errors = err.response.body.errors;\n notyf.error(errors[0].msg);\n } else {\n (0, _jquery.default)(btn).html(\" \\u0646\\u06CE\\u0631\\u062F\\u0631\\u0627\");\n }\n });\n });\n (0, _jquery.default)(document).delegate('.remove-fav', 'click', function () {\n var favs = localStorage.getItem('favs');\n var fav_ids = localStorage.getItem('fav_ids');\n var id = (0, _jquery.default)(this).data('id');\n\n if (favs) {\n favs = JSON.parse(favs);\n delete favs[id];\n localStorage.setItem('favs', JSON.stringify(favs));\n }\n\n if (fav_ids) {\n fav_ids = fav_ids.split(',');\n var index = fav_ids.indexOf(id + \"\");\n\n if (index > -1) {\n fav_ids.splice(index, 1);\n }\n\n if (!fav_ids.length == 0) showNotFound();\n localStorage.setItem('fav_ids', fav_ids.join(','));\n }\n\n (0, _jquery.default)(this).parents('.card-container').remove();\n });\n }\n};"},"sourceMaps":null,"error":null,"hash":"f6f3ea9b7514835b1da4279d3f2390d4","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /.cache/c9/209d10a4185542f0197a16fa8da77b.json: -------------------------------------------------------------------------------- 1 | {"id":"../../node_modules/process/browser.js","dependencies":[{"name":"/home/aram/Desktop/nawikurdi/API/package.json","includedInParent":true,"mtime":1590908189847},{"name":"/home/aram/Desktop/nawikurdi/API/node_modules/process/package.json","includedInParent":true,"mtime":1590908300145}],"generated":{"js":"\n// shim for using process in browser\nvar process = module.exports = {}; // cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\n\nfunction defaultClearTimeout() {\n throw new Error('clearTimeout has not been defined');\n}\n\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n})();\n\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n } // if setTimeout wasn't available but was latter defined\n\n\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n}\n\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n } // if clearTimeout wasn't available but was latter defined\n\n\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n}\n\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n\n draining = false;\n\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n var len = queue.length;\n\n while (len) {\n currentQueue = queue;\n queue = [];\n\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n\n queueIndex = -1;\n len = queue.length;\n }\n\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n\n queue.push(new Item(fun, args));\n\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n}; // v8 likes predictible objects\n\n\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\n\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\n\nprocess.title = 'browser';\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\n\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) {\n return [];\n};\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () {\n return '/';\n};\n\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\n\nprocess.umask = function () {\n return 0;\n};"},"sourceMaps":null,"error":null,"hash":"0804c1d0742bd944c5891f44ef60f909","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /.cache/9a/e604b62f9be01356e6fc48888f8cd3.json: -------------------------------------------------------------------------------- 1 | {"id":"../../node_modules/process/browser.js","dependencies":[{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/package.json","includedInParent":true,"mtime":1590877042665},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/process/package.json","includedInParent":true,"mtime":1573387902828}],"generated":{"js":"\n// shim for using process in browser\nvar process = module.exports = {}; // cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\n\nfunction defaultClearTimeout() {\n throw new Error('clearTimeout has not been defined');\n}\n\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n})();\n\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n } // if setTimeout wasn't available but was latter defined\n\n\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n}\n\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n } // if clearTimeout wasn't available but was latter defined\n\n\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n}\n\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n\n draining = false;\n\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n var len = queue.length;\n\n while (len) {\n currentQueue = queue;\n queue = [];\n\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n\n queueIndex = -1;\n len = queue.length;\n }\n\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n\n queue.push(new Item(fun, args));\n\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n}; // v8 likes predictible objects\n\n\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\n\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\n\nprocess.title = 'browser';\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\n\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) {\n return [];\n};\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () {\n return '/';\n};\n\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\n\nprocess.umask = function () {\n return 0;\n};"},"sourceMaps":null,"error":null,"hash":"0804c1d0742bd944c5891f44ef60f909","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /.cache/c7/19683beffe90d524c1f70805c474ab.json: -------------------------------------------------------------------------------- 1 | {"id":"../../node_modules/notyf/notyf.min.css","dependencies":[{"name":"_css_loader","parent":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/notyf/notyf.min.css","resolved":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/parcel/src/builtins/css-loader.js"},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/package.json","includedInParent":true,"mtime":1590870273646},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/notyf/package.json","includedInParent":true,"mtime":1590870270678}],"generated":{"css":"@-webkit-keyframes notyf-fadeinup{0%{opacity:0;transform:translateY(25%)}to{opacity:1;transform:translateY(0)}}@keyframes notyf-fadeinup{0%{opacity:0;transform:translateY(25%)}to{opacity:1;transform:translateY(0)}}@-webkit-keyframes notyf-fadeinleft{0%{opacity:0;transform:translateX(25%)}to{opacity:1;transform:translateX(0)}}@keyframes notyf-fadeinleft{0%{opacity:0;transform:translateX(25%)}to{opacity:1;transform:translateX(0)}}@-webkit-keyframes notyf-fadeoutright{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(25%)}}@keyframes notyf-fadeoutright{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(25%)}}@-webkit-keyframes notyf-fadeoutdown{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(25%)}}@keyframes notyf-fadeoutdown{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(25%)}}@-webkit-keyframes ripple{0%{transform:scale(0) translateY(-45%) translateX(13%)}to{transform:scale(1) translateY(-45%) translateX(13%)}}@keyframes ripple{0%{transform:scale(0) translateY(-45%) translateX(13%)}to{transform:scale(1) translateY(-45%) translateX(13%)}}.notyf{position:fixed;top:0;left:0;height:100%;width:100%;color:#fff;z-index:9999;display:flex;flex-direction:column;align-items:flex-end;justify-content:flex-end;pointer-events:none;box-sizing:border-box;padding:20px}.notyf__icon--error,.notyf__icon--success{height:21px;width:21px;background:#fff;border-radius:50%;display:block;margin:0 auto;position:relative}.notyf__icon--error:after,.notyf__icon--error:before{content:\"\";background:currentColor;display:block;position:absolute;width:3px;border-radius:3px;left:9px;height:12px;top:5px}.notyf__icon--error:after{transform:rotate(-45deg)}.notyf__icon--error:before{transform:rotate(45deg)}.notyf__icon--success:after,.notyf__icon--success:before{content:\"\";background:currentColor;display:block;position:absolute;width:3px;border-radius:3px}.notyf__icon--success:after{height:6px;transform:rotate(-45deg);top:9px;left:6px}.notyf__icon--success:before{height:11px;transform:rotate(45deg);top:5px;left:10px}.notyf__toast{display:block;overflow:hidden;pointer-events:auto;-webkit-animation:notyf-fadeinup .3s ease-in forwards;animation:notyf-fadeinup .3s ease-in forwards;box-shadow:0 3px 7px 0 rgba(0,0,0,.25);position:relative;padding:0 15px;border-radius:2px;max-width:300px;transform:translateY(25%);box-sizing:border-box}.notyf__toast--disappear{transform:translateY(0);-webkit-animation:notyf-fadeoutdown .3s forwards;animation:notyf-fadeoutdown .3s forwards;-webkit-animation-delay:.25s;animation-delay:.25s}.notyf__toast--disappear .notyf__icon,.notyf__toast--disappear .notyf__message{-webkit-animation:notyf-fadeoutdown .3s forwards;animation:notyf-fadeoutdown .3s forwards;opacity:1;transform:translateY(0)}.notyf__toast--disappear .notyf__dismiss{-webkit-animation:notyf-fadeoutright .3s forwards;animation:notyf-fadeoutright .3s forwards;opacity:1;transform:translateX(0)}.notyf__toast--disappear .notyf__message{-webkit-animation-delay:.05s;animation-delay:.05s}.notyf__toast--upper{margin-bottom:20px}.notyf__toast--lower{margin-top:20px}.notyf__toast--dismissible .notyf__wrapper{padding-right:30px}.notyf__ripple{height:400px;width:400px;position:absolute;transform-origin:bottom right;right:0;top:0;border-radius:50%;transform:scale(0) translateY(-51%) translateX(13%);z-index:5;-webkit-animation:ripple .4s ease-out forwards;animation:ripple .4s ease-out forwards}.notyf__wrapper{display:flex;align-items:center;padding-top:17px;padding-bottom:17px;padding-right:15px;border-radius:3px;position:relative;z-index:10}.notyf__icon{width:22px;text-align:center;font-size:1.3em;opacity:0;-webkit-animation:notyf-fadeinup .3s forwards;animation:notyf-fadeinup .3s forwards;-webkit-animation-delay:.3s;animation-delay:.3s;margin-right:13px}.notyf__dismiss{position:absolute;top:0;right:0;height:100%;width:26px;margin-right:-15px;-webkit-animation:notyf-fadeinleft .3s forwards;animation:notyf-fadeinleft .3s forwards;-webkit-animation-delay:.35s;animation-delay:.35s;opacity:0}.notyf__dismiss-btn{background-color:rgba(0,0,0,.25);border:none;cursor:pointer;transition:opacity .2s ease,background-color .2s ease;outline:none;opacity:.35;height:100%;width:100%}.notyf__dismiss-btn:after,.notyf__dismiss-btn:before{content:\"\";background:#fff;height:12px;width:2px;border-radius:3px;position:absolute;left:calc(50% - 1px);top:calc(50% - 5px)}.notyf__dismiss-btn:after{transform:rotate(-45deg)}.notyf__dismiss-btn:before{transform:rotate(45deg)}.notyf__dismiss-btn:hover{opacity:.7;background-color:rgba(0,0,0,.15)}.notyf__dismiss-btn:active{opacity:.8}.notyf__message{vertical-align:middle;position:relative;opacity:0;-webkit-animation:notyf-fadeinup .3s forwards;animation:notyf-fadeinup .3s forwards;-webkit-animation-delay:.25s;animation-delay:.25s;line-height:1.5em}@media only screen and (max-width:480px){.notyf{padding:0}.notyf__ripple{height:600px;width:600px;-webkit-animation-duration:.5s;animation-duration:.5s}.notyf__toast{max-width:none;border-radius:0;box-shadow:0 -2px 7px 0 rgba(0,0,0,.13);width:100%}.notyf__dismiss{width:56px}}","js":"\n var reloadCSS = require('_css_loader');\n module.hot.dispose(reloadCSS);\n module.hot.accept(reloadCSS);\n "},"sourceMaps":null,"error":null,"hash":"614d33f9a0944f0f78a2bbcaccdede9c","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /views/templates/seo.ejs: -------------------------------------------------------------------------------- 1 | 2 | <%= title %> 3 | 4 | 5 | 8 | 9 | <% if(activePage=='home'){ %> 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | <% } %> 27 | <% if(activePage=='submit-name'){ %> 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | <% } %> 45 | <% if(isSingle){ %> 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | <% } %> 63 | <% if(activePage=='about'){ %> 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | <% } %> -------------------------------------------------------------------------------- /.cache/35/82b196b00e02fa61b230047b9aff19.json: -------------------------------------------------------------------------------- 1 | {"id":"ymYf","dependencies":[{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/package.json","includedInParent":true,"mtime":1591020629913},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/superagent/package.json","includedInParent":true,"mtime":1585830670205},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/superagent/.browserslistrc","includedInParent":true,"mtime":1585830670205}],"generated":{"js":"\"use strict\";function o(t){return(o=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&\"function\"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?\"symbol\":typeof o})(t)}function t(t){return null!==t&&\"object\"===o(t)}module.exports=t;"},"sourceMaps":{"js":{"mappings":[{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":0}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":13}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":22}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":24}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":27}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":34}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":36}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":55}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":63}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":80}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":87}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":96}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":105}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":108}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":122}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":125}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":134}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":137}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":144}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":147}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":166}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":174}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":176}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":190}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":198}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":202}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":209}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":219}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":235}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":239}},{"source":"../src/is-object.js","name":null,"original":{"line":9,"column":0},"generated":{"line":1,"column":242}},{"source":"../src/is-object.js","name":"isObject","original":{"line":9,"column":9},"generated":{"line":1,"column":251}},{"source":"../src/is-object.js","name":"obj","original":{"line":9,"column":18},"generated":{"line":1,"column":253}},{"source":"../src/is-object.js","name":"obj","original":{"line":10,"column":9},"generated":{"line":1,"column":256}},{"source":"../src/is-object.js","name":null,"original":{"line":10,"column":17},"generated":{"line":1,"column":263}},{"source":"../src/is-object.js","name":"obj","original":{"line":10,"column":9},"generated":{"line":1,"column":270}},{"source":"../src/is-object.js","name":null,"original":{"line":10,"column":40},"generated":{"line":1,"column":273}},{"source":"../src/is-object.js","name":null,"original":{"line":10,"column":25},"generated":{"line":1,"column":284}},{"source":"../src/is-object.js","name":"obj","original":{"line":10,"column":32},"generated":{"line":1,"column":286}},{"source":"../src/is-object.js","name":"module","original":{"line":13,"column":0},"generated":{"line":1,"column":289}},{"source":"../src/is-object.js","name":"exports","original":{"line":13,"column":7},"generated":{"line":1,"column":296}},{"source":"../src/is-object.js","name":"isObject","original":{"line":13,"column":17},"generated":{"line":1,"column":304}}],"sources":{"../src/is-object.js":"/**\n * Check if `obj` is an object.\n *\n * @param {Object} obj\n * @return {Boolean}\n * @api private\n */\n\nfunction isObject(obj) {\n return obj !== null && typeof obj === 'object';\n}\n\nmodule.exports = isObject;\n"},"lineCount":null}},"error":null,"hash":"31d260d1bcfee6e216ed48c2e275a04d","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /.cache/0e/a470b50dcbeaa5e8eddc0c138443f1.json: -------------------------------------------------------------------------------- 1 | {"id":"../../node_modules/parcel/src/builtins/hmr-runtime.js","dependencies":[{"name":"/home/aram/Desktop/nawikurdi/API/package.json","includedInParent":true,"mtime":1590908189847},{"name":"/home/aram/Desktop/nawikurdi/API/node_modules/parcel/package.json","includedInParent":true,"mtime":1590908296526},{"name":"/home/aram/Desktop/nawikurdi/API/node_modules/parcel/src/.babelrc","includedInParent":true,"mtime":1590908296526}],"generated":{"js":"var global = arguments[3];\nvar OVERLAY_ID = '__parcel__error__overlay__';\nvar OldModule = module.bundle.Module;\n\nfunction Module(moduleName) {\n OldModule.call(this, moduleName);\n this.hot = {\n data: module.bundle.hotData,\n _acceptCallbacks: [],\n _disposeCallbacks: [],\n accept: function (fn) {\n this._acceptCallbacks.push(fn || function () {});\n },\n dispose: function (fn) {\n this._disposeCallbacks.push(fn);\n }\n };\n module.bundle.hotData = null;\n}\n\nmodule.bundle.Module = Module;\nvar checkedAssets, assetsToAccept;\nvar parent = module.bundle.parent;\n\nif ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {\n var hostname = \"\" || location.hostname;\n var protocol = location.protocol === 'https:' ? 'wss' : 'ws';\n var ws = new WebSocket(protocol + '://' + hostname + ':' + \"42127\" + '/');\n\n ws.onmessage = function (event) {\n checkedAssets = {};\n assetsToAccept = [];\n var data = JSON.parse(event.data);\n\n if (data.type === 'update') {\n var handled = false;\n data.assets.forEach(function (asset) {\n if (!asset.isNew) {\n var didAccept = hmrAcceptCheck(global.parcelRequire, asset.id);\n\n if (didAccept) {\n handled = true;\n }\n }\n }); // Enable HMR for CSS by default.\n\n handled = handled || data.assets.every(function (asset) {\n return asset.type === 'css' && asset.generated.js;\n });\n\n if (handled) {\n console.clear();\n data.assets.forEach(function (asset) {\n hmrApply(global.parcelRequire, asset);\n });\n assetsToAccept.forEach(function (v) {\n hmrAcceptRun(v[0], v[1]);\n });\n } else if (location.reload) {\n // `location` global exists in a web worker context but lacks `.reload()` function.\n location.reload();\n }\n }\n\n if (data.type === 'reload') {\n ws.close();\n\n ws.onclose = function () {\n location.reload();\n };\n }\n\n if (data.type === 'error-resolved') {\n console.log('[parcel] ✨ Error resolved');\n removeErrorOverlay();\n }\n\n if (data.type === 'error') {\n console.error('[parcel] 🚨 ' + data.error.message + '\\n' + data.error.stack);\n removeErrorOverlay();\n var overlay = createErrorOverlay(data);\n document.body.appendChild(overlay);\n }\n };\n}\n\nfunction removeErrorOverlay() {\n var overlay = document.getElementById(OVERLAY_ID);\n\n if (overlay) {\n overlay.remove();\n }\n}\n\nfunction createErrorOverlay(data) {\n var overlay = document.createElement('div');\n overlay.id = OVERLAY_ID; // html encode message and stack trace\n\n var message = document.createElement('div');\n var stackTrace = document.createElement('pre');\n message.innerText = data.error.message;\n stackTrace.innerText = data.error.stack;\n overlay.innerHTML = '
' + 'ERROR' + '🚨' + '
' + message.innerHTML + '
' + '
' + stackTrace.innerHTML + '
' + '
';\n return overlay;\n}\n\nfunction getParents(bundle, id) {\n var modules = bundle.modules;\n\n if (!modules) {\n return [];\n }\n\n var parents = [];\n var k, d, dep;\n\n for (k in modules) {\n for (d in modules[k][1]) {\n dep = modules[k][1][d];\n\n if (dep === id || Array.isArray(dep) && dep[dep.length - 1] === id) {\n parents.push(k);\n }\n }\n }\n\n if (bundle.parent) {\n parents = parents.concat(getParents(bundle.parent, id));\n }\n\n return parents;\n}\n\nfunction hmrApply(bundle, asset) {\n var modules = bundle.modules;\n\n if (!modules) {\n return;\n }\n\n if (modules[asset.id] || !bundle.parent) {\n var fn = new Function('require', 'module', 'exports', asset.generated.js);\n asset.isNew = !modules[asset.id];\n modules[asset.id] = [fn, asset.deps];\n } else if (bundle.parent) {\n hmrApply(bundle.parent, asset);\n }\n}\n\nfunction hmrAcceptCheck(bundle, id) {\n var modules = bundle.modules;\n\n if (!modules) {\n return;\n }\n\n if (!modules[id] && bundle.parent) {\n return hmrAcceptCheck(bundle.parent, id);\n }\n\n if (checkedAssets[id]) {\n return;\n }\n\n checkedAssets[id] = true;\n var cached = bundle.cache[id];\n assetsToAccept.push([bundle, id]);\n\n if (cached && cached.hot && cached.hot._acceptCallbacks.length) {\n return true;\n }\n\n return getParents(global.parcelRequire, id).some(function (id) {\n return hmrAcceptCheck(global.parcelRequire, id);\n });\n}\n\nfunction hmrAcceptRun(bundle, id) {\n var cached = bundle.cache[id];\n bundle.hotData = {};\n\n if (cached) {\n cached.hot.data = bundle.hotData;\n }\n\n if (cached && cached.hot && cached.hot._disposeCallbacks.length) {\n cached.hot._disposeCallbacks.forEach(function (cb) {\n cb(bundle.hotData);\n });\n }\n\n delete bundle.cache[id];\n bundle(id);\n cached = bundle.cache[id];\n\n if (cached && cached.hot && cached.hot._acceptCallbacks.length) {\n cached.hot._acceptCallbacks.forEach(function (cb) {\n cb();\n });\n\n return true;\n }\n}"},"sourceMaps":null,"error":null,"hash":"06d72b9b31ebbfd3e2d6e67fa55e3e81","cacheData":{"env":{"HMR_HOSTNAME":"","HMR_PORT":"42127"}}} -------------------------------------------------------------------------------- /.cache/15/67792d57a4022e2443de88a68fa461.json: -------------------------------------------------------------------------------- 1 | {"id":"../../node_modules/parcel/src/builtins/hmr-runtime.js","dependencies":[{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/package.json","includedInParent":true,"mtime":1590877042665},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/parcel/package.json","includedInParent":true,"mtime":1589055656075},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/parcel/src/.babelrc","includedInParent":true,"mtime":1589055656075}],"generated":{"js":"var global = arguments[3];\nvar OVERLAY_ID = '__parcel__error__overlay__';\nvar OldModule = module.bundle.Module;\n\nfunction Module(moduleName) {\n OldModule.call(this, moduleName);\n this.hot = {\n data: module.bundle.hotData,\n _acceptCallbacks: [],\n _disposeCallbacks: [],\n accept: function (fn) {\n this._acceptCallbacks.push(fn || function () {});\n },\n dispose: function (fn) {\n this._disposeCallbacks.push(fn);\n }\n };\n module.bundle.hotData = null;\n}\n\nmodule.bundle.Module = Module;\nvar checkedAssets, assetsToAccept;\nvar parent = module.bundle.parent;\n\nif ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {\n var hostname = \"\" || location.hostname;\n var protocol = location.protocol === 'https:' ? 'wss' : 'ws';\n var ws = new WebSocket(protocol + '://' + hostname + ':' + \"61022\" + '/');\n\n ws.onmessage = function (event) {\n checkedAssets = {};\n assetsToAccept = [];\n var data = JSON.parse(event.data);\n\n if (data.type === 'update') {\n var handled = false;\n data.assets.forEach(function (asset) {\n if (!asset.isNew) {\n var didAccept = hmrAcceptCheck(global.parcelRequire, asset.id);\n\n if (didAccept) {\n handled = true;\n }\n }\n }); // Enable HMR for CSS by default.\n\n handled = handled || data.assets.every(function (asset) {\n return asset.type === 'css' && asset.generated.js;\n });\n\n if (handled) {\n console.clear();\n data.assets.forEach(function (asset) {\n hmrApply(global.parcelRequire, asset);\n });\n assetsToAccept.forEach(function (v) {\n hmrAcceptRun(v[0], v[1]);\n });\n } else if (location.reload) {\n // `location` global exists in a web worker context but lacks `.reload()` function.\n location.reload();\n }\n }\n\n if (data.type === 'reload') {\n ws.close();\n\n ws.onclose = function () {\n location.reload();\n };\n }\n\n if (data.type === 'error-resolved') {\n console.log('[parcel] ✨ Error resolved');\n removeErrorOverlay();\n }\n\n if (data.type === 'error') {\n console.error('[parcel] 🚨 ' + data.error.message + '\\n' + data.error.stack);\n removeErrorOverlay();\n var overlay = createErrorOverlay(data);\n document.body.appendChild(overlay);\n }\n };\n}\n\nfunction removeErrorOverlay() {\n var overlay = document.getElementById(OVERLAY_ID);\n\n if (overlay) {\n overlay.remove();\n }\n}\n\nfunction createErrorOverlay(data) {\n var overlay = document.createElement('div');\n overlay.id = OVERLAY_ID; // html encode message and stack trace\n\n var message = document.createElement('div');\n var stackTrace = document.createElement('pre');\n message.innerText = data.error.message;\n stackTrace.innerText = data.error.stack;\n overlay.innerHTML = '
' + 'ERROR' + '🚨' + '
' + message.innerHTML + '
' + '
' + stackTrace.innerHTML + '
' + '
';\n return overlay;\n}\n\nfunction getParents(bundle, id) {\n var modules = bundle.modules;\n\n if (!modules) {\n return [];\n }\n\n var parents = [];\n var k, d, dep;\n\n for (k in modules) {\n for (d in modules[k][1]) {\n dep = modules[k][1][d];\n\n if (dep === id || Array.isArray(dep) && dep[dep.length - 1] === id) {\n parents.push(k);\n }\n }\n }\n\n if (bundle.parent) {\n parents = parents.concat(getParents(bundle.parent, id));\n }\n\n return parents;\n}\n\nfunction hmrApply(bundle, asset) {\n var modules = bundle.modules;\n\n if (!modules) {\n return;\n }\n\n if (modules[asset.id] || !bundle.parent) {\n var fn = new Function('require', 'module', 'exports', asset.generated.js);\n asset.isNew = !modules[asset.id];\n modules[asset.id] = [fn, asset.deps];\n } else if (bundle.parent) {\n hmrApply(bundle.parent, asset);\n }\n}\n\nfunction hmrAcceptCheck(bundle, id) {\n var modules = bundle.modules;\n\n if (!modules) {\n return;\n }\n\n if (!modules[id] && bundle.parent) {\n return hmrAcceptCheck(bundle.parent, id);\n }\n\n if (checkedAssets[id]) {\n return;\n }\n\n checkedAssets[id] = true;\n var cached = bundle.cache[id];\n assetsToAccept.push([bundle, id]);\n\n if (cached && cached.hot && cached.hot._acceptCallbacks.length) {\n return true;\n }\n\n return getParents(global.parcelRequire, id).some(function (id) {\n return hmrAcceptCheck(global.parcelRequire, id);\n });\n}\n\nfunction hmrAcceptRun(bundle, id) {\n var cached = bundle.cache[id];\n bundle.hotData = {};\n\n if (cached) {\n cached.hot.data = bundle.hotData;\n }\n\n if (cached && cached.hot && cached.hot._disposeCallbacks.length) {\n cached.hot._disposeCallbacks.forEach(function (cb) {\n cb(bundle.hotData);\n });\n }\n\n delete bundle.cache[id];\n bundle(id);\n cached = bundle.cache[id];\n\n if (cached && cached.hot && cached.hot._acceptCallbacks.length) {\n cached.hot._acceptCallbacks.forEach(function (cb) {\n cb();\n });\n\n return true;\n }\n}"},"sourceMaps":null,"error":null,"hash":"2f478bf1da6b8535c272fdfa0ea277fc","cacheData":{"env":{"HMR_HOSTNAME":"","HMR_PORT":"61022"}}} -------------------------------------------------------------------------------- /public/css/main.css: -------------------------------------------------------------------------------- 1 | /* :not(button){ 2 | transition: all 0.2s ease; 3 | } */ 4 | body{ 5 | margin: 0; 6 | /* width: 100%; */ 7 | height: 100%; 8 | overflow-x: hidden; 9 | } 10 | :not(.fas){ 11 | font-family: 'vazir', Arial, Helvetica, sans-serif; 12 | } 13 | /* text colors */ 14 | .txt-red{ 15 | color: #E71D36; 16 | } 17 | .btn-group button { 18 | background-color: #f8f8f8; /* Green background */ 19 | border: 1px solid #f3f3f3; /* Green border */ 20 | color: #011627; /* White text */ 21 | padding: 10px 24px; /* Some padding */ 22 | cursor: pointer; /* Pointer/hand icon */ 23 | float: left; /* Float the buttons side by side */ 24 | outline: none; 25 | } 26 | 27 | .btn-group button:not(:last-child) { 28 | border-right: none; /* Prevent double borders */ 29 | } 30 | 31 | /* Clear floats (clearfix hack) */ 32 | .btn-group:after { 33 | content: ""; 34 | clear: both; 35 | display: table; 36 | } 37 | 38 | .addthis_inline_share_toolbox_sl27{ 39 | min-height: 42px;; 40 | } 41 | /* Add a background color on hover */ 42 | .btn-group button:hover, .btn-group button.active { 43 | background-color: #011627; 44 | color: #f8f8f8; 45 | } 46 | ._4btn button { 47 | width: 25%; 48 | } 49 | ._3btn button { 50 | width: 33.33%; 51 | } 52 | ._2btn button { 53 | width: 50%; 54 | } 55 | @media only screen and (max-width: 973px) { 56 | .btn-group button.gender-filter,.btn-group button.popularity-filter{ 57 | width: 100% !important; 58 | } 59 | .submit-name-container{ 60 | width: 100% !important; 61 | } 62 | nav .nav-item{ 63 | padding: 0px !important; 64 | } 65 | } 66 | .btn-group button:first-child{ 67 | border-top-left-radius: 3px; 68 | border-bottom-left-radius: 3px; 69 | } 70 | .btn-group button:last-child{ 71 | border-top-right-radius: 3px; 72 | border-bottom-right-radius: 3px; 73 | } 74 | .txt-center{ 75 | text-align: center; 76 | } 77 | /* submit new name */ 78 | .submit-name-container{ 79 | direction: rtl; 80 | text-align: right; 81 | padding: 20px; 82 | width: 50%; 83 | margin: 0 auto; 84 | } 85 | .submit-name-container label{ 86 | font-size: 20px; 87 | padding-right: 5px; 88 | } 89 | .input-container{ 90 | padding: 15px; 91 | } 92 | .submit-button{ 93 | width:100%; 94 | padding: 15px; 95 | border-radius: 4px; 96 | background: #2ec5b6; 97 | border: none; 98 | color: white; 99 | } 100 | /* main container */ 101 | .main-grid{ 102 | flex-direction: column; 103 | margin: 20px; 104 | } 105 | /* navigation area */ 106 | nav{ 107 | direction: rtl; 108 | text-align: center; 109 | border-radius: 5px; 110 | box-shadow: 10px 4px 10px #eaeaea; 111 | } 112 | nav .header-icon{ 113 | font-size: 12px; 114 | } 115 | 116 | nav .nav-item{ 117 | color: #011627; 118 | text-decoration: none; 119 | padding: 16px; 120 | } 121 | nav .nav-item.active{ 122 | border-bottom: 3px solid #FF9F1C; 123 | background: #f9f9f9; 124 | } 125 | nav .nav-item:first-of-type{ 126 | border-top-right-radius: 3px; 127 | border-bottom-right-radius: 3px; 128 | } 129 | nav .nav-item:last-of-type{ 130 | border-top-left-radius: 3px; 131 | border-bottom-left-radius: 3px; 132 | } 133 | /* not found container */ 134 | .notfound-container{ 135 | text-align: center; 136 | } 137 | .notfound-container img{ 138 | width: 120px; 139 | margin: 0 auto; 140 | } 141 | /* about container */ 142 | .about-container{ 143 | text-align: right; 144 | direction: rtl; 145 | padding: 20px; 146 | } 147 | /* names and filters container */ 148 | .filters-grid{ 149 | padding: 0; 150 | } 151 | .at-share-btn-elements{ 152 | text-align: center; 153 | margin-bottom: 15px; 154 | } 155 | .social-container, .detail-container{ 156 | border: 1px solid #f3f3f3; 157 | /* height: 100%; */ 158 | margin-top: 25px; 159 | width: 100%; 160 | border-radius: 4px; 161 | text-align: right; 162 | } 163 | .filters-container{ 164 | border: 1px solid #f3f3f3; 165 | /* height: 100%; */ 166 | /* margin-top: 25px; */ 167 | width: 100%; 168 | border-radius: 4px; 169 | text-align: right; 170 | } 171 | .filters-container h3{ 172 | /* background: #2EC4B6; */ 173 | background: #011627; 174 | color:white; 175 | margin-top: 0; 176 | padding: 5px; 177 | text-align: center; 178 | } 179 | .social-container h3{ 180 | background: #F35E29; 181 | color:white; 182 | margin-top: 0; 183 | padding: 15px; 184 | text-align: center; 185 | } 186 | .detail-container h3{ 187 | background: #E71D36; 188 | color:white; 189 | margin-top: 0; 190 | padding: 15px; 191 | text-align: center; 192 | } 193 | .detail-container ul { 194 | direction: rtl; 195 | } 196 | .input-filter-container{ 197 | padding: 15px; 198 | } 199 | .gender-filter-container, .popularity-filter-container{ 200 | /* padding: 15px; */ 201 | padding-left: 15px; 202 | padding-right: 15px; 203 | padding-bottom: 5px;; 204 | } 205 | .input-filter, .input{ 206 | width: 100%; 207 | height: 50px; 208 | font-size: 13px; 209 | text-align: right; 210 | background: white; 211 | border: 1px solid #2ec5b6; 212 | border-radius: 4px; 213 | direction: rtl; 214 | } 215 | .input { 216 | padding-right: 5px; 217 | } 218 | .names-container{ 219 | /* direction: rtl; */ 220 | } 221 | /* card design */ 222 | .card-container{ 223 | text-decoration: none; 224 | } 225 | .card{ 226 | /* background: pink; 227 | direction: rtl; 228 | border-radius: 3px; 229 | color: #011627; */ 230 | background: #f8f8f8; 231 | direction: rtl; 232 | border-radius: 4px; 233 | color: #011627; 234 | border: 1px solid #f3f3f3; 235 | } 236 | .card .card-body, .card a .card-title,.card a{ 237 | padding:15px; 238 | padding-top: 0; 239 | padding-bottom: 0; 240 | text-decoration: none !important; 241 | color: black; 242 | } 243 | .card .card-body{ 244 | padding-top:3px; 245 | } 246 | /* footer */ 247 | footer { 248 | /* position: absolute; */ 249 | /* bottom: 0; */ 250 | /* width: 100%; */ 251 | text-align: center; 252 | font-size: 13px; 253 | height: 70px; 254 | } 255 | footer p{ 256 | color: #011627; 257 | } 258 | footer p a{ 259 | color: #FF9F1C; 260 | text-decoration: none; 261 | } 262 | 263 | /* to top button */ 264 | #to-top { 265 | display: none; 266 | position: fixed; 267 | bottom: 20px; 268 | left: 30px; 269 | z-index: 99; 270 | border: none; 271 | outline: none; 272 | background-color: #011627; 273 | color: white; 274 | cursor: pointer; 275 | padding: 10px; 276 | border-radius: 100px; 277 | font-size: 18px; 278 | width: 50px; 279 | height: 50px; 280 | } 281 | 282 | #to-top:hover { 283 | background-color: #555; /* Add a dark-grey background on hover */ 284 | } -------------------------------------------------------------------------------- /views/index.ejs: -------------------------------------------------------------------------------- 1 |
2 |
3 |

گه‌ران و پاڵاوتن

4 |
5 |
6 | ره‌گه‌ز 7 |
8 | 9 | 10 | 11 | 12 |
13 |
14 |
15 | به‌پێی ده‌نگ 16 |
17 | 18 | 19 | 20 |
21 |
22 |
23 | 24 |
25 | ده‌سته‌واژه‌یه‌ك بنوسه‌ بۆ گه‌ران 26 | 27 |
28 |
29 |
30 |
31 |
32 | 40 | 44 | 45 | 69 |
70 |

ورده‌كاری زیاتر‌

71 | 90 |
91 |
92 |
93 | <% names.forEach((record)=>{ %> 94 | <% let gender = 'هاوبه‌ش'; 95 | if(record.gender == 'M' || record.gender == 'm') gender ='كور'; 96 | else if(record.gender == 'F' || record.gender == 'F') gender ='كچ'; 97 | %> 98 | 99 |
100 | 101 |

<%= record.name %> ( <%= gender %> )

102 |

103 | <%= record.desc %> 104 | ‌

105 |
106 | 113 |
114 |
115 | <% }) %> 116 |
117 | 118 |
119 | 120 | 121 | 126 | -------------------------------------------------------------------------------- /.cache/4e/12c6582c6c0f5c63b0734b794f0924.json: -------------------------------------------------------------------------------- 1 | {"id":"../../node_modules/slugify/slugify.js","dependencies":[{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/package.json","includedInParent":true,"mtime":1590845434402},{"name":"/Users/hozan/Desktop/devstree/nawikurdi/API/node_modules/slugify/package.json","includedInParent":true,"mtime":1589490412703}],"generated":{"js":"var define;\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n;\n\n(function (name, root, factory) {\n if ((typeof exports === \"undefined\" ? \"undefined\" : _typeof(exports)) === 'object') {\n module.exports = factory();\n module.exports['default'] = factory();\n }\n /* istanbul ignore next */\n else if (typeof define === 'function' && define.amd) {\n define(factory);\n } else {\n root[name] = factory();\n }\n})('slugify', this, function () {\n var charMap = JSON.parse('{\"$\":\"dollar\",\"%\":\"percent\",\"&\":\"and\",\"<\":\"less\",\">\":\"greater\",\"|\":\"or\",\"¢\":\"cent\",\"£\":\"pound\",\"¤\":\"currency\",\"¥\":\"yen\",\"©\":\"(c)\",\"ª\":\"a\",\"®\":\"(r)\",\"º\":\"o\",\"À\":\"A\",\"Á\":\"A\",\"Â\":\"A\",\"Ã\":\"A\",\"Ä\":\"A\",\"Å\":\"A\",\"Æ\":\"AE\",\"Ç\":\"C\",\"È\":\"E\",\"É\":\"E\",\"Ê\":\"E\",\"Ë\":\"E\",\"Ì\":\"I\",\"Í\":\"I\",\"Î\":\"I\",\"Ï\":\"I\",\"Ð\":\"D\",\"Ñ\":\"N\",\"Ò\":\"O\",\"Ó\":\"O\",\"Ô\":\"O\",\"Õ\":\"O\",\"Ö\":\"O\",\"Ø\":\"O\",\"Ù\":\"U\",\"Ú\":\"U\",\"Û\":\"U\",\"Ü\":\"U\",\"Ý\":\"Y\",\"Þ\":\"TH\",\"ß\":\"ss\",\"à\":\"a\",\"á\":\"a\",\"â\":\"a\",\"ã\":\"a\",\"ä\":\"a\",\"å\":\"a\",\"æ\":\"ae\",\"ç\":\"c\",\"è\":\"e\",\"é\":\"e\",\"ê\":\"e\",\"ë\":\"e\",\"ì\":\"i\",\"í\":\"i\",\"î\":\"i\",\"ï\":\"i\",\"ð\":\"d\",\"ñ\":\"n\",\"ò\":\"o\",\"ó\":\"o\",\"ô\":\"o\",\"õ\":\"o\",\"ö\":\"o\",\"ø\":\"o\",\"ù\":\"u\",\"ú\":\"u\",\"û\":\"u\",\"ü\":\"u\",\"ý\":\"y\",\"þ\":\"th\",\"ÿ\":\"y\",\"Ā\":\"A\",\"ā\":\"a\",\"Ă\":\"A\",\"ă\":\"a\",\"Ą\":\"A\",\"ą\":\"a\",\"Ć\":\"C\",\"ć\":\"c\",\"Č\":\"C\",\"č\":\"c\",\"Ď\":\"D\",\"ď\":\"d\",\"Đ\":\"DJ\",\"đ\":\"dj\",\"Ē\":\"E\",\"ē\":\"e\",\"Ė\":\"E\",\"ė\":\"e\",\"Ę\":\"e\",\"ę\":\"e\",\"Ě\":\"E\",\"ě\":\"e\",\"Ğ\":\"G\",\"ğ\":\"g\",\"Ģ\":\"G\",\"ģ\":\"g\",\"Ĩ\":\"I\",\"ĩ\":\"i\",\"Ī\":\"i\",\"ī\":\"i\",\"Į\":\"I\",\"į\":\"i\",\"İ\":\"I\",\"ı\":\"i\",\"Ķ\":\"k\",\"ķ\":\"k\",\"Ļ\":\"L\",\"ļ\":\"l\",\"Ľ\":\"L\",\"ľ\":\"l\",\"Ł\":\"L\",\"ł\":\"l\",\"Ń\":\"N\",\"ń\":\"n\",\"Ņ\":\"N\",\"ņ\":\"n\",\"Ň\":\"N\",\"ň\":\"n\",\"Ő\":\"O\",\"ő\":\"o\",\"Œ\":\"OE\",\"œ\":\"oe\",\"Ŕ\":\"R\",\"ŕ\":\"r\",\"Ř\":\"R\",\"ř\":\"r\",\"Ś\":\"S\",\"ś\":\"s\",\"Ş\":\"S\",\"ş\":\"s\",\"Š\":\"S\",\"š\":\"s\",\"Ţ\":\"T\",\"ţ\":\"t\",\"Ť\":\"T\",\"ť\":\"t\",\"Ũ\":\"U\",\"ũ\":\"u\",\"Ū\":\"u\",\"ū\":\"u\",\"Ů\":\"U\",\"ů\":\"u\",\"Ű\":\"U\",\"ű\":\"u\",\"Ų\":\"U\",\"ų\":\"u\",\"Ŵ\":\"W\",\"ŵ\":\"w\",\"Ŷ\":\"Y\",\"ŷ\":\"y\",\"Ÿ\":\"Y\",\"Ź\":\"Z\",\"ź\":\"z\",\"Ż\":\"Z\",\"ż\":\"z\",\"Ž\":\"Z\",\"ž\":\"z\",\"ƒ\":\"f\",\"Ơ\":\"O\",\"ơ\":\"o\",\"Ư\":\"U\",\"ư\":\"u\",\"Lj\":\"LJ\",\"lj\":\"lj\",\"Nj\":\"NJ\",\"nj\":\"nj\",\"Ș\":\"S\",\"ș\":\"s\",\"Ț\":\"T\",\"ț\":\"t\",\"˚\":\"o\",\"Ά\":\"A\",\"Έ\":\"E\",\"Ή\":\"H\",\"Ί\":\"I\",\"Ό\":\"O\",\"Ύ\":\"Y\",\"Ώ\":\"W\",\"ΐ\":\"i\",\"Α\":\"A\",\"Β\":\"B\",\"Γ\":\"G\",\"Δ\":\"D\",\"Ε\":\"E\",\"Ζ\":\"Z\",\"Η\":\"H\",\"Θ\":\"8\",\"Ι\":\"I\",\"Κ\":\"K\",\"Λ\":\"L\",\"Μ\":\"M\",\"Ν\":\"N\",\"Ξ\":\"3\",\"Ο\":\"O\",\"Π\":\"P\",\"Ρ\":\"R\",\"Σ\":\"S\",\"Τ\":\"T\",\"Υ\":\"Y\",\"Φ\":\"F\",\"Χ\":\"X\",\"Ψ\":\"PS\",\"Ω\":\"W\",\"Ϊ\":\"I\",\"Ϋ\":\"Y\",\"ά\":\"a\",\"έ\":\"e\",\"ή\":\"h\",\"ί\":\"i\",\"ΰ\":\"y\",\"α\":\"a\",\"β\":\"b\",\"γ\":\"g\",\"δ\":\"d\",\"ε\":\"e\",\"ζ\":\"z\",\"η\":\"h\",\"θ\":\"8\",\"ι\":\"i\",\"κ\":\"k\",\"λ\":\"l\",\"μ\":\"m\",\"ν\":\"n\",\"ξ\":\"3\",\"ο\":\"o\",\"π\":\"p\",\"ρ\":\"r\",\"ς\":\"s\",\"σ\":\"s\",\"τ\":\"t\",\"υ\":\"y\",\"φ\":\"f\",\"χ\":\"x\",\"ψ\":\"ps\",\"ω\":\"w\",\"ϊ\":\"i\",\"ϋ\":\"y\",\"ό\":\"o\",\"ύ\":\"y\",\"ώ\":\"w\",\"Ё\":\"Yo\",\"Ђ\":\"DJ\",\"Є\":\"Ye\",\"І\":\"I\",\"Ї\":\"Yi\",\"Ј\":\"J\",\"Љ\":\"LJ\",\"Њ\":\"NJ\",\"Ћ\":\"C\",\"Џ\":\"DZ\",\"А\":\"A\",\"Б\":\"B\",\"В\":\"V\",\"Г\":\"G\",\"Д\":\"D\",\"Е\":\"E\",\"Ж\":\"Zh\",\"З\":\"Z\",\"И\":\"I\",\"Й\":\"J\",\"К\":\"K\",\"Л\":\"L\",\"М\":\"M\",\"Н\":\"N\",\"О\":\"O\",\"П\":\"P\",\"Р\":\"R\",\"С\":\"S\",\"Т\":\"T\",\"У\":\"U\",\"Ф\":\"F\",\"Х\":\"H\",\"Ц\":\"C\",\"Ч\":\"Ch\",\"Ш\":\"Sh\",\"Щ\":\"Sh\",\"Ъ\":\"U\",\"Ы\":\"Y\",\"Ь\":\"\",\"Э\":\"E\",\"Ю\":\"Yu\",\"Я\":\"Ya\",\"а\":\"a\",\"б\":\"b\",\"в\":\"v\",\"г\":\"g\",\"д\":\"d\",\"е\":\"e\",\"ж\":\"zh\",\"з\":\"z\",\"и\":\"i\",\"й\":\"j\",\"к\":\"k\",\"л\":\"l\",\"м\":\"m\",\"н\":\"n\",\"о\":\"o\",\"п\":\"p\",\"р\":\"r\",\"с\":\"s\",\"т\":\"t\",\"у\":\"u\",\"ф\":\"f\",\"х\":\"h\",\"ц\":\"c\",\"ч\":\"ch\",\"ш\":\"sh\",\"щ\":\"sh\",\"ъ\":\"u\",\"ы\":\"y\",\"ь\":\"\",\"э\":\"e\",\"ю\":\"yu\",\"я\":\"ya\",\"ё\":\"yo\",\"ђ\":\"dj\",\"є\":\"ye\",\"і\":\"i\",\"ї\":\"yi\",\"ј\":\"j\",\"љ\":\"lj\",\"њ\":\"nj\",\"ћ\":\"c\",\"ѝ\":\"u\",\"џ\":\"dz\",\"Ґ\":\"G\",\"ґ\":\"g\",\"Ғ\":\"GH\",\"ғ\":\"gh\",\"Қ\":\"KH\",\"қ\":\"kh\",\"Ң\":\"NG\",\"ң\":\"ng\",\"Ү\":\"UE\",\"ү\":\"ue\",\"Ұ\":\"U\",\"ұ\":\"u\",\"Һ\":\"H\",\"һ\":\"h\",\"Ә\":\"AE\",\"ә\":\"ae\",\"Ө\":\"OE\",\"ө\":\"oe\",\"฿\":\"baht\",\"ა\":\"a\",\"ბ\":\"b\",\"გ\":\"g\",\"დ\":\"d\",\"ე\":\"e\",\"ვ\":\"v\",\"ზ\":\"z\",\"თ\":\"t\",\"ი\":\"i\",\"კ\":\"k\",\"ლ\":\"l\",\"მ\":\"m\",\"ნ\":\"n\",\"ო\":\"o\",\"პ\":\"p\",\"ჟ\":\"zh\",\"რ\":\"r\",\"ს\":\"s\",\"ტ\":\"t\",\"უ\":\"u\",\"ფ\":\"f\",\"ქ\":\"k\",\"ღ\":\"gh\",\"ყ\":\"q\",\"შ\":\"sh\",\"ჩ\":\"ch\",\"ც\":\"ts\",\"ძ\":\"dz\",\"წ\":\"ts\",\"ჭ\":\"ch\",\"ხ\":\"kh\",\"ჯ\":\"j\",\"ჰ\":\"h\",\"Ẁ\":\"W\",\"ẁ\":\"w\",\"Ẃ\":\"W\",\"ẃ\":\"w\",\"Ẅ\":\"W\",\"ẅ\":\"w\",\"ẞ\":\"SS\",\"Ạ\":\"A\",\"ạ\":\"a\",\"Ả\":\"A\",\"ả\":\"a\",\"Ấ\":\"A\",\"ấ\":\"a\",\"Ầ\":\"A\",\"ầ\":\"a\",\"Ẩ\":\"A\",\"ẩ\":\"a\",\"Ẫ\":\"A\",\"ẫ\":\"a\",\"Ậ\":\"A\",\"ậ\":\"a\",\"Ắ\":\"A\",\"ắ\":\"a\",\"Ằ\":\"A\",\"ằ\":\"a\",\"Ẳ\":\"A\",\"ẳ\":\"a\",\"Ẵ\":\"A\",\"ẵ\":\"a\",\"Ặ\":\"A\",\"ặ\":\"a\",\"Ẹ\":\"E\",\"ẹ\":\"e\",\"Ẻ\":\"E\",\"ẻ\":\"e\",\"Ẽ\":\"E\",\"ẽ\":\"e\",\"Ế\":\"E\",\"ế\":\"e\",\"Ề\":\"E\",\"ề\":\"e\",\"Ể\":\"E\",\"ể\":\"e\",\"Ễ\":\"E\",\"ễ\":\"e\",\"Ệ\":\"E\",\"ệ\":\"e\",\"Ỉ\":\"I\",\"ỉ\":\"i\",\"Ị\":\"I\",\"ị\":\"i\",\"Ọ\":\"O\",\"ọ\":\"o\",\"Ỏ\":\"O\",\"ỏ\":\"o\",\"Ố\":\"O\",\"ố\":\"o\",\"Ồ\":\"O\",\"ồ\":\"o\",\"Ổ\":\"O\",\"ổ\":\"o\",\"Ỗ\":\"O\",\"ỗ\":\"o\",\"Ộ\":\"O\",\"ộ\":\"o\",\"Ớ\":\"O\",\"ớ\":\"o\",\"Ờ\":\"O\",\"ờ\":\"o\",\"Ở\":\"O\",\"ở\":\"o\",\"Ỡ\":\"O\",\"ỡ\":\"o\",\"Ợ\":\"O\",\"ợ\":\"o\",\"Ụ\":\"U\",\"ụ\":\"u\",\"Ủ\":\"U\",\"ủ\":\"u\",\"Ứ\":\"U\",\"ứ\":\"u\",\"Ừ\":\"U\",\"ừ\":\"u\",\"Ử\":\"U\",\"ử\":\"u\",\"Ữ\":\"U\",\"ữ\":\"u\",\"Ự\":\"U\",\"ự\":\"u\",\"Ỳ\":\"Y\",\"ỳ\":\"y\",\"Ỵ\":\"Y\",\"ỵ\":\"y\",\"Ỷ\":\"Y\",\"ỷ\":\"y\",\"Ỹ\":\"Y\",\"ỹ\":\"y\",\"‘\":\"\\'\",\"’\":\"\\'\",\"“\":\"\\\\\\\"\",\"”\":\"\\\\\\\"\",\"†\":\"+\",\"•\":\"*\",\"…\":\"...\",\"₠\":\"ecu\",\"₢\":\"cruzeiro\",\"₣\":\"french franc\",\"₤\":\"lira\",\"₥\":\"mill\",\"₦\":\"naira\",\"₧\":\"peseta\",\"₨\":\"rupee\",\"₩\":\"won\",\"₪\":\"new shequel\",\"₫\":\"dong\",\"€\":\"euro\",\"₭\":\"kip\",\"₮\":\"tugrik\",\"₯\":\"drachma\",\"₰\":\"penny\",\"₱\":\"peso\",\"₲\":\"guarani\",\"₳\":\"austral\",\"₴\":\"hryvnia\",\"₵\":\"cedi\",\"₸\":\"kazakhstani tenge\",\"₹\":\"indian rupee\",\"₽\":\"russian ruble\",\"₿\":\"bitcoin\",\"℠\":\"sm\",\"™\":\"tm\",\"∂\":\"d\",\"∆\":\"delta\",\"∑\":\"sum\",\"∞\":\"infinity\",\"♥\":\"love\",\"元\":\"yuan\",\"円\":\"yen\",\"﷼\":\"rial\"}');\n var locales = JSON.parse('{\"vi\":{\"Đ\":\"D\",\"đ\":\"d\"}}');\n\n function replace(string, options) {\n if (typeof string !== 'string') {\n throw new Error('slugify: string argument expected');\n }\n\n options = typeof options === 'string' ? {\n replacement: options\n } : options || {};\n var locale = locales[options.locale] || {};\n var replacement = options.replacement || '-';\n var slug = string.split('') // replace characters based on charMap\n .reduce(function (result, ch) {\n return result + (locale[ch] || charMap[ch] || ch);\n }, '') // remove not allowed characters\n .replace(options.remove || /[^\\w\\s$*_+~.()'\"!\\-:@]+/g, '') // trim leading/trailing spaces\n .trim() // convert spaces to replacement character\n // also remove duplicates of the replacement character\n .replace(new RegExp('[\\\\s' + replacement + ']+', 'g'), replacement);\n\n if (options.lower) {\n slug = slug.toLowerCase();\n }\n\n if (options.strict) {\n // remove anything besides letters, numbers, and the replacement char\n slug = slug.replace(new RegExp('[^a-zA-Z0-9' + replacement + ']', 'g'), '');\n }\n\n return slug;\n }\n\n replace.extend = function (customMap) {\n for (var key in customMap) {\n charMap[key] = customMap[key];\n }\n };\n\n return replace;\n});"},"sourceMaps":null,"error":null,"hash":"0500da7a1167f6cb1abcde0eeadb38f5","cacheData":{"env":{}}} -------------------------------------------------------------------------------- /public/js/index.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable camelcase */ 2 | /* eslint-disable no-undef */ 3 | import superagent from 'superagent'; 4 | import FingerprintJS from '@fingerprintjs/fingerprintjs'; 5 | import $ from 'jquery'; 6 | import { Notyf } from 'notyf'; 7 | import { debounce } from './general'; 8 | 9 | // Initialize an agent at application startup. 10 | const fpPromise = FingerprintJS.load(); 11 | 12 | // Create an instance of Notyf 13 | const notyf = new Notyf(); 14 | 15 | // scroll logic 16 | const mybutton = document.getElementById('to-top'); 17 | function scrollFunction() { 18 | try { 19 | if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { 20 | mybutton.style.display = 'block'; 21 | } else { 22 | mybutton.style.display = 'none'; 23 | } 24 | } catch (e) { 25 | // useless comment 26 | } 27 | } 28 | window.onscroll = function scrolling() { scrollFunction(); }; 29 | 30 | function topFunction() { 31 | document.body.scrollTop = 0; // For Safari 32 | document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera 33 | } 34 | // end of scroll logic 35 | 36 | const params = { 37 | limit: 10, 38 | offset: 0, 39 | }; 40 | 41 | function load(param) { 42 | return superagent 43 | .get('/api') 44 | .query(param) 45 | .then((data) => data.body.names).catch(() => []); 46 | } 47 | 48 | function vote(data, cb = () => {}) { 49 | return superagent 50 | .post('/api/vote') 51 | .send(data) 52 | .end((err, res) => { 53 | cb(err, res); 54 | }); 55 | } 56 | function showLoader() { 57 | $('.names-container').append(` 58 | 59 |

60 |
61 | `); 62 | } 63 | function showNotFound() { 64 | $('.names-container').prepend(` 65 |
66 | 67 |

ببوره‌ هیچ ناوێك نه‌دۆزرایه‌وه‌ ده‌سته‌واژه‌یه‌كی جیاواز به‌كاربهێنه‌

68 |
69 | `); 70 | } 71 | function hideNotFound() { 72 | $('.notfound-container').remove(); 73 | } 74 | function hideLoader() { 75 | $('.loader').remove(); 76 | } 77 | function display(container, data, mode = 'append') { 78 | // mode will be one of overwrite, append, prepend 79 | let alterMethod = 'html'; 80 | if (mode === 'append') { 81 | alterMethod = 'append'; 82 | } else if (mode === 'prepend') { 83 | alterMethod = 'prepend'; 84 | } 85 | 86 | let html = ''; 87 | data.map((record) => { 88 | let gender = 'هاوبه‌ش'; 89 | if (record.gender === 'M' || record.gender === 'm') gender = 'كور'; 90 | else if (record.gender === 'F' || record.gender === 'F') gender = 'كچ'; 91 | 92 | html += ` 93 | 94 |
95 |

${record.name} ( ${gender} )

96 |

97 | ${record.desc} 98 | ‌

99 | 106 |
107 |
108 | `; 109 | return null; 110 | }); 111 | $(container)[alterMethod](html); 112 | if (data.length === 0) { 113 | showNotFound(); 114 | } else { 115 | hideNotFound(); 116 | } 117 | return html; 118 | } 119 | 120 | async function getUID() { 121 | const fp = await fpPromise; 122 | const result = await fp.get(); 123 | // console.log(result.visitorId); 124 | return result.visitorId; 125 | 126 | // const name = `${cname}=`; 127 | // const decodedCookie = decodeURIComponent(document.cookie); 128 | // const ca = decodedCookie.split(';'); 129 | // for (let i = 0; i < ca.length; i += 1) { 130 | // let c = ca[i]; 131 | // while (c.charAt(0) === ' ') { 132 | // c = c.substring(1); 133 | // } 134 | // if (c.indexOf(name) === 0) { 135 | // return c.substring(name.length, c.length); 136 | // } 137 | // } 138 | // return ''; 139 | } 140 | function makeHeartsRed() { 141 | let favIds = localStorage.getItem('fav_ids'); 142 | if (favIds) { 143 | favIds = favIds.split(','); 144 | favIds.forEach((id) => { 145 | $(`.make-fav[data-id=${id}]`).removeClass('make-fav').addClass('remove-fav').html(''); 146 | }); 147 | } 148 | } 149 | module.exports = { 150 | init() { 151 | window.topFunction = topFunction; 152 | makeHeartsRed(); 153 | $(window).scroll(() => { 154 | const triggerMargin = 100; 155 | if ($(window).scrollTop() >= $(document).height() - $(window).height() - triggerMargin) { 156 | let page = $('body').data('page') || 1; 157 | const calculatedOffset = params.limit * page; 158 | params.offset = calculatedOffset; 159 | page += 1; 160 | $('body').data('page', page); 161 | showLoader(); 162 | load(params).then((data) => { 163 | hideLoader(); 164 | display('.names-container', data, 'append'); 165 | makeHeartsRed(); 166 | }); 167 | } 168 | }); 169 | $('.input-filter').keyup(debounce(function () { 170 | $('body').data('page', 1); 171 | params.offset = 0; 172 | const val = $(this).val(); 173 | if (val.trim() !== '') params.q = val; 174 | else delete params.q; 175 | showLoader(); 176 | load(params).then((data) => { 177 | hideLoader(); 178 | display('.names-container', data, 'overwrite'); 179 | makeHeartsRed(); 180 | }); 181 | }, 300)); 182 | $('.gender-filter').click(function () { 183 | $('body').data('page', 1); 184 | params.offset = 0; 185 | const val = `${$(this).data('value')}`; 186 | if (val.trim() != '-1') params.gender = val; 187 | else delete params.gender; 188 | $('.gender-filter').removeClass('active'); 189 | $(this).addClass('active'); 190 | showLoader(); 191 | load(params).then((data) => { 192 | hideLoader(); 193 | display('.names-container', data, 'overwrite'); 194 | makeHeartsRed(); 195 | }); 196 | }); 197 | $('.popularity-filter').click(function () { 198 | $('body').data('page', 1); 199 | params.offset = 0; 200 | const val = `${$(this).data('value')}`; 201 | if (val.trim() != '-1') params.sort = val; 202 | else delete params.sort; 203 | $('.popularity-filter').removeClass('active'); 204 | $(this).addClass('active'); 205 | showLoader(); 206 | load(params).then((data) => { 207 | hideLoader(); 208 | display('.names-container', data, 'overwrite'); 209 | makeHeartsRed(); 210 | }); 211 | }); 212 | 213 | $(document).delegate('.up-vote', 'click', async function () { 214 | const btn = this; 215 | vote({ 216 | name_id: $(this).data('id'), 217 | uid: await getUID(), 218 | impact: 'positive', 219 | }, 220 | (err) => { 221 | if (err) { 222 | const { errors } = err.response.body; 223 | notyf.error(errors[0].msg); 224 | } else { 225 | $(btn).html(' نێردرا'); 226 | } 227 | }); 228 | }); 229 | $(document).delegate('.down-vote', 'click', async function () { 230 | const btn = this; 231 | vote({ 232 | name_id: $(this).data('id'), 233 | uid: await getUID(), 234 | impact: 'negative', 235 | }, 236 | (err) => { 237 | if (err) { 238 | const { errors } = err.response.body; 239 | notyf.error(errors[0].msg); 240 | } else { 241 | $(btn).html(' نێردرا'); 242 | } 243 | }); 244 | }); 245 | $(document).delegate('.make-fav', 'click', function () { 246 | let favs = localStorage.getItem('favs'); 247 | const id = $(this).data('id'); 248 | $(this).removeClass('make-fav').addClass('remove-fav').html(''); 249 | const html = `${$(this).parents('.card-container').html()}`; 250 | let fav_ids = localStorage.getItem('fav_ids'); 251 | if (fav_ids) { 252 | fav_ids = fav_ids.split(','); 253 | if (fav_ids.indexOf(id) <= -1) { 254 | fav_ids.push(id); 255 | localStorage.setItem('fav_ids', fav_ids.join(',')); 256 | } 257 | } else { 258 | localStorage.setItem('fav_ids', [id].join(',')); 259 | } 260 | if (favs) { 261 | favs = JSON.parse(favs); 262 | favs[id] = html; 263 | localStorage.setItem('favs', JSON.stringify(favs)); 264 | } else { 265 | const newFavs = {}; 266 | newFavs[id] = html; 267 | localStorage.setItem('favs', JSON.stringify(newFavs)); 268 | } 269 | }); 270 | $(document).delegate('.remove-fav', 'click', function () { 271 | let favs = localStorage.getItem('favs'); 272 | let fav_ids = localStorage.getItem('fav_ids'); 273 | const id = $(this).data('id'); 274 | if (favs) { 275 | favs = JSON.parse(favs); 276 | delete favs[id]; 277 | localStorage.setItem('favs', JSON.stringify(favs)); 278 | } 279 | if (fav_ids) { 280 | fav_ids = fav_ids.split(','); 281 | const index = fav_ids.indexOf(`${id}`); 282 | if (index > -1) { 283 | fav_ids.splice(index, 1); 284 | } 285 | localStorage.setItem('fav_ids', fav_ids.join(',')); 286 | } 287 | $(this).removeClass('remove-fav').addClass('make-fav').html(''); 288 | }); 289 | }, 290 | }; 291 | -------------------------------------------------------------------------------- /.cache/b6/4b7486415f2c6d25a4571f00338d2e.json: -------------------------------------------------------------------------------- 1 | {"id":"index.js","dependencies":[{"name":"/home/aram/Desktop/nawikurdi/API/package.json","includedInParent":true,"mtime":1590908189847},{"name":"./general","loc":{"line":1,"column":23},"parent":"/home/aram/Desktop/nawikurdi/API/public/js/index.js","resolved":"/home/aram/Desktop/nawikurdi/API/public/js/general.js"},{"name":"superagent","loc":{"line":2,"column":23},"parent":"/home/aram/Desktop/nawikurdi/API/public/js/index.js","resolved":"/home/aram/Desktop/nawikurdi/API/node_modules/superagent/lib/client.js"},{"name":"jquery","loc":{"line":3,"column":14},"parent":"/home/aram/Desktop/nawikurdi/API/public/js/index.js","resolved":"/home/aram/Desktop/nawikurdi/API/node_modules/jquery/dist/jquery.js"},{"name":"notyf","loc":{"line":4,"column":22},"parent":"/home/aram/Desktop/nawikurdi/API/public/js/index.js","resolved":"/home/aram/Desktop/nawikurdi/API/node_modules/notyf/notyf.es.js"}],"generated":{"js":"\"use strict\";\n\nvar _general = require(\"./general\");\n\nvar _superagent = _interopRequireDefault(require(\"superagent\"));\n\nvar _jquery = _interopRequireDefault(require(\"jquery\"));\n\nvar _notyf = require(\"notyf\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Create an instance of Notyf\nvar notyf = new _notyf.Notyf(); // scroll logic\n\nvar mybutton = document.getElementById(\"to-top\");\n\nwindow.onscroll = function () {\n scrollFunction();\n};\n\nfunction scrollFunction() {\n try {\n if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {\n mybutton.style.display = \"block\";\n } else {\n mybutton.style.display = \"none\";\n }\n } catch (e) {}\n}\n\nfunction topFunction() {\n document.body.scrollTop = 0; // For Safari\n\n document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera\n} // end of scroll logic\n\n\nvar params = {\n limit: 10,\n offset: 0\n};\n\nfunction load(params) {\n return _superagent.default.get(\"/api\").query(params).then(function (data) {\n return data.body.names;\n }).catch(function (err) {\n return [];\n });\n}\n\nfunction vote(data) {\n var cb = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};\n return _superagent.default.post(\"/api/vote\").send(data).end(function (err, res) {\n cb(err, res);\n });\n}\n\nfunction display(container, data) {\n var mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'append';\n // mode will be one of overwrite, append, prepend\n var alterMethod = 'html';\n\n if (mode === 'append') {\n alterMethod = 'append';\n } else if (mode == 'prepend') {\n alterMethod = 'prepend';\n }\n\n var html = \"\";\n data.map(function (record) {\n var gender = 'هاوبه‌ش';\n if (record.gender == 'M' || record.gender == 'm') gender = 'كور';else if (record.gender == 'F' || record.gender == 'F') gender = 'كچ';\n html += \"\\n \\n
\\n

\".concat(record.name, \" ( \").concat(gender, \" )

\\n

\\n \").concat(record.desc, \"\\n \\u200C

\\n
\\n
\\n \\n \\n \\n
\\n
\\n
\\n
\\n \");\n return null;\n });\n (0, _jquery.default)(container)[alterMethod](html);\n\n if (data.length == 0) {\n showNotFound();\n } else {\n hideNotFound();\n }\n\n return html;\n}\n\nfunction showLoader() {\n (0, _jquery.default)('.names-container').append(\"\\n \\n

\\n
\\n \");\n}\n\nfunction showNotFound() {\n (0, _jquery.default)('.names-container').prepend(\"\\n
\\n \\n

\\u0628\\u0628\\u0648\\u0631\\u0647\\u200C \\u0647\\u06CC\\u0686 \\u0646\\u0627\\u0648\\u06CE\\u0643 \\u0646\\u0647\\u200C\\u062F\\u06C6\\u0632\\u0631\\u0627\\u06CC\\u0647\\u200C\\u0648\\u0647\\u200C \\u062F\\u0647\\u200C\\u0633\\u062A\\u0647\\u200C\\u0648\\u0627\\u0698\\u0647\\u200C\\u06CC\\u0647\\u200C\\u0643\\u06CC \\u062C\\u06CC\\u0627\\u0648\\u0627\\u0632 \\u0628\\u0647\\u200C\\u0643\\u0627\\u0631\\u0628\\u0647\\u06CE\\u0646\\u0647\\u200C

\\n
\\n \");\n}\n\nfunction hideNotFound() {\n (0, _jquery.default)('.notfound-container').remove();\n}\n\nfunction hideLoader() {\n (0, _jquery.default)('.loader').remove();\n}\n\nfunction getCookie(cname) {\n var name = cname + \"=\";\n var decodedCookie = decodeURIComponent(document.cookie);\n var ca = decodedCookie.split(';');\n\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n\n if (c.indexOf(name) == 0) {\n return c.substring(name.length, c.length);\n }\n }\n\n return \"\";\n}\n\nfunction makeHeartsRed() {\n var fav_ids = localStorage.getItem('fav_ids');\n\n if (fav_ids) {\n fav_ids = fav_ids.split(',');\n fav_ids.forEach(function (id) {\n (0, _jquery.default)(\".make-fav[data-id=\".concat(id, \"]\")).removeClass('make-fav').addClass('remove-fav').html('');\n });\n }\n}\n\nmodule.exports = {\n init: function init() {\n window.topFunction = topFunction;\n makeHeartsRed();\n (0, _jquery.default)(window).scroll(function () {\n var triggerMargin = 100;\n\n if ((0, _jquery.default)(window).scrollTop() >= (0, _jquery.default)(document).height() - (0, _jquery.default)(window).height() - triggerMargin) {\n var page = (0, _jquery.default)('body').data('page') || 1;\n var calculatedOffset = params.limit * page;\n params.offset = calculatedOffset;\n (0, _jquery.default)('body').data('page', ++page);\n showLoader();\n load(params).then(function (data) {\n hideLoader();\n display('.names-container', data, 'append');\n makeHeartsRed();\n });\n }\n });\n (0, _jquery.default)('.input-filter').keyup((0, _general.debounce)(function () {\n (0, _jquery.default)('body').data('page', 1);\n params.offset = 0;\n var val = (0, _jquery.default)(this).val();\n if (val.trim() != '') params.q = val;else delete params.q;\n showLoader();\n load(params).then(function (data) {\n hideLoader();\n display('.names-container', data, 'overwrite');\n makeHeartsRed();\n });\n }, 300));\n (0, _jquery.default)('.gender-filter').click(function () {\n (0, _jquery.default)('body').data('page', 1);\n params.offset = 0;\n var val = \"\".concat((0, _jquery.default)(this).data('value'));\n if (val.trim() != '-1') params.gender = val;else delete params.gender;\n (0, _jquery.default)(\".gender-filter\").removeClass(\"active\");\n (0, _jquery.default)(this).addClass(\"active\");\n showLoader();\n load(params).then(function (data) {\n hideLoader();\n display('.names-container', data, 'overwrite');\n makeHeartsRed();\n });\n });\n (0, _jquery.default)('.popularity-filter').click(function () {\n (0, _jquery.default)('body').data('page', 1);\n params.offset = 0;\n var val = \"\".concat((0, _jquery.default)(this).data('value'));\n if (val.trim() != '-1') params.sort = val;else delete params.sort;\n (0, _jquery.default)(\".popularity-filter\").removeClass(\"active\");\n (0, _jquery.default)(this).addClass(\"active\");\n showLoader();\n load(params).then(function (data) {\n hideLoader();\n display('.names-container', data, 'overwrite');\n makeHeartsRed();\n });\n });\n (0, _jquery.default)(document).delegate('.up-vote', 'click', function () {\n var btn = this;\n vote({\n name_id: (0, _jquery.default)(this).data('id'),\n uid: getCookie('uid'),\n impact: 'positive'\n }, function (err, res) {\n if (err) {\n var errors = err.response.body.errors;\n notyf.error(errors[0].msg);\n } else {\n (0, _jquery.default)(btn).html(\" \\u0646\\u06CE\\u0631\\u062F\\u0631\\u0627\");\n }\n });\n });\n (0, _jquery.default)(document).delegate('.down-vote', 'click', function () {\n var btn = this;\n vote({\n name_id: (0, _jquery.default)(this).data('id'),\n uid: getCookie('uid'),\n impact: 'negative'\n }, function (err, res) {\n if (err) {\n var errors = err.response.body.errors;\n notyf.error(errors[0].msg);\n } else {\n (0, _jquery.default)(btn).html(\" \\u0646\\u06CE\\u0631\\u062F\\u0631\\u0627\");\n }\n });\n });\n (0, _jquery.default)(document).delegate('.make-fav', 'click', function () {\n var favs = localStorage.getItem('favs');\n var id = (0, _jquery.default)(this).data('id');\n (0, _jquery.default)(this).removeClass('make-fav').addClass('remove-fav').html('');\n var html = \"\".concat((0, _jquery.default)(this).parents('.card-container').html(), \"\");\n var fav_ids = localStorage.getItem('fav_ids');\n\n if (fav_ids) {\n fav_ids = fav_ids.split(',');\n\n if (fav_ids.indexOf(id) <= -1) {\n fav_ids.push(id);\n localStorage.setItem('fav_ids', fav_ids.join(','));\n }\n } else {\n localStorage.setItem('fav_ids', [id].join(','));\n }\n\n if (favs) {\n favs = JSON.parse(favs);\n favs[id] = html;\n localStorage.setItem('favs', JSON.stringify(favs));\n } else {\n var newFavs = {};\n newFavs[id] = html;\n localStorage.setItem('favs', JSON.stringify(newFavs));\n }\n });\n (0, _jquery.default)(document).delegate('.remove-fav', 'click', function () {\n var favs = localStorage.getItem('favs');\n var fav_ids = localStorage.getItem('fav_ids');\n var id = (0, _jquery.default)(this).data('id');\n\n if (favs) {\n favs = JSON.parse(favs);\n delete favs[id];\n localStorage.setItem('favs', JSON.stringify(favs));\n }\n\n if (fav_ids) {\n fav_ids = fav_ids.split(',');\n var index = fav_ids.indexOf(id + \"\");\n console.log(fav_ids);\n\n if (index > -1) {\n fav_ids.splice(index, 1);\n }\n\n localStorage.setItem('fav_ids', fav_ids.join(','));\n }\n\n (0, _jquery.default)(this).removeClass('remove-fav').addClass('make-fav').html('');\n });\n }\n};"},"sourceMaps":null,"error":null,"hash":"2e14c53d866921d4ac81f148568d0ce8","cacheData":{"env":{}}} --------------------------------------------------------------------------------