├── .gitignore ├── icon.png ├── .vscodeignore ├── jsconfig.json ├── .eslintrc.json ├── README.md ├── extension.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | test 2 | node_modules 3 | .vscode -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omarr45/fazakir/HEAD/icon.png -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | test/** 4 | .gitignore 5 | .yarnrc 6 | vsc-extension-quickstart.md 7 | **/jsconfig.json 8 | **/*.map 9 | **/.eslintrc.json 10 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "ES2020", 5 | "checkJs": false, /* Typecheck .js files. */ 6 | "lib": [ 7 | "ES2020" 8 | ] 9 | }, 10 | "exclude": [ 11 | "node_modules" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": false, 4 | "commonjs": true, 5 | "es6": true, 6 | "node": true, 7 | "mocha": true 8 | }, 9 | "parserOptions": { 10 | "ecmaVersion": 2018, 11 | "ecmaFeatures": { 12 | "jsx": true 13 | }, 14 | "sourceType": "module" 15 | }, 16 | "rules": { 17 | "no-const-assign": "warn", 18 | "no-this-before-super": "warn", 19 | "no-undef": "warn", 20 | "no-unreachable": "warn", 21 | "no-unused-vars": "warn", 22 | "constructor-super": "warn", 23 | "valid-typeof": "warn" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🕋 Fazakir - فذكّر 2 | 3 | Fazakir - فذكّـــر is an extension that aims to increase your hasanat insha'Allah by reminding you to say Azkar every now and then, based on an interval that you choose 4 | 5 | ![Demo](https://i.imgur.com/khZRza8.gif) 6 | 7 | ## Extension Settings 8 | 9 | - `fazakir.interval`: Choose the time interval (in mins) 'eg. 30 mins'. 10 | - `fazakir.popup`: Choose whether the notification pops up in the middle or shows silently on the side. 11 | 12 | ## Extension Functions 13 | 14 | - To get an instant Zikr 15 | - `Ctrl + Shift + P` then select/type `Get Azkar` 16 | 17 | ## 1.0.0 18 | 19 | Initial release 20 | 21 | 30 | 31 | ## Developed by 32 | 33 | [Omar AbdulRahman](https://omar45.com/) 34 | -------------------------------------------------------------------------------- /extension.js: -------------------------------------------------------------------------------- 1 | const vscode = require('vscode'); 2 | const axios = require('axios'); 3 | 4 | const showModal = async (popup) => { 5 | const response = await axios.get( 6 | 'https://azkar-api.nawafhq.repl.co/zekr?t&json' 7 | ); 8 | const zikr = response.data; 9 | if (popup == 'middle') { 10 | vscode.window.showInformationMessage(zikr.content, { 11 | modal: true, 12 | detail: 'ثوابها: ' + zikr.description.slice(0, -1), 13 | }); 14 | } else { 15 | vscode.window.showInformationMessage(zikr.content); 16 | } 17 | }; 18 | 19 | async function activate(context) { 20 | const config = vscode.workspace.getConfiguration('fazakir'); 21 | const interval = config.get('interval'); 22 | const popup = config.get('popUp'); 23 | 24 | const intervalInMs = interval * 60 * 1000; 25 | //function convert minutes to milliseconds 26 | 27 | setInterval(async () => { 28 | showModal(popup); 29 | }, intervalInMs); 30 | 31 | const show = vscode.commands.registerCommand('fazakir.getAzkar', () => { 32 | showModal(popup); 33 | }); 34 | 35 | context.subscriptions.push(show); 36 | } 37 | 38 | function deactivate() {} 39 | 40 | module.exports = { 41 | activate, 42 | deactivate, 43 | }; 44 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fazakir", 3 | "displayName": "Fazakir", 4 | "publisher": "OmarAbdulRahman", 5 | "description": "A light extension to remind you of Azkar every now and then", 6 | "version": "0.0.1", 7 | "icon": "icon.png", 8 | "engines": { 9 | "vscode": "^1.70.0" 10 | }, 11 | "categories": [ 12 | "Other" 13 | ], 14 | "activationEvents": [ 15 | "onStartupFinished" 16 | ], 17 | "main": "./extension.js", 18 | "contributes": { 19 | "commands": [ 20 | { 21 | "command": "fazakir.getAzkar", 22 | "title": "Get Azkar" 23 | } 24 | ], 25 | "configuration": [ 26 | { 27 | "title": "Fazakir", 28 | "properties": { 29 | "fazakir.interval": { 30 | "type": "integer", 31 | "default": 30, 32 | "description": "The interval between each Azkar in minutes" 33 | }, 34 | "fazakir.popUp": { 35 | "type": "string", 36 | "default": "side", 37 | "enum": [ 38 | "middle", 39 | "side" 40 | ], 41 | "description": "Do you want the Azkar to pop up in the middle (with sound) or on the side (silent)" 42 | } 43 | } 44 | } 45 | ] 46 | }, 47 | "scripts": { 48 | "lint": "eslint .", 49 | "pretest": "npm run lint", 50 | "test": "node ./test/runTest.js" 51 | }, 52 | "devDependencies": { 53 | "@types/glob": "^7.2.0", 54 | "@types/mocha": "^9.1.1", 55 | "@types/node": "16.x", 56 | "@types/vscode": "^1.70.0", 57 | "@vscode/test-electron": "^2.1.5", 58 | "eslint": "^8.20.0", 59 | "glob": "^8.0.3", 60 | "mocha": "^10.0.0", 61 | "typescript": "^4.7.4" 62 | }, 63 | "dependencies": { 64 | "axios": "^0.27.2" 65 | } 66 | } 67 | --------------------------------------------------------------------------------