mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-10-24 00:23:36 +00:00
lint: Implement HTML Linting with htmlhint and fix indent.
* lint: Implement HTML Linting with htmlhint and fix indent. Implements HTML linting using htmlhint and uses indentation rules of zulip webapp - 4 spaces. Creates a separate file .htmlhintrc for the rules, most of which are defaults. Also, fixes indentation in html files and adds a missing title in about.html. * deps: Change versioning of various dependencies to exact versions. As we prefer to use exact working version for dependencies, changed the versions to exact versions. Fixes #676.
This commit is contained in:
25
.htmlhintrc
Normal file
25
.htmlhintrc
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"tagname-lowercase": true,
|
||||||
|
"attr-lowercase": true,
|
||||||
|
"attr-value-double-quotes": true,
|
||||||
|
"attr-value-not-empty": false,
|
||||||
|
"attr-no-duplication": true,
|
||||||
|
"doctype-first": true,
|
||||||
|
"tag-pair": true,
|
||||||
|
"empty-tag-not-self-closed": true,
|
||||||
|
"spec-char-escape": true,
|
||||||
|
"id-unique": true,
|
||||||
|
"src-not-empty": true,
|
||||||
|
"title-require": true,
|
||||||
|
"alt-require": false,
|
||||||
|
"doctype-html5": true,
|
||||||
|
"id-class-value": "dash",
|
||||||
|
"style-disabled": false,
|
||||||
|
"inline-style-disabled": false,
|
||||||
|
"inline-script-disabled": false,
|
||||||
|
"space-tab-mixed-disabled": "space4",
|
||||||
|
"id-class-ad-disabled": false,
|
||||||
|
"href-abs-or-rel": false,
|
||||||
|
"attr-unsafe-chars": true,
|
||||||
|
"head-script-disabled": true
|
||||||
|
}
|
||||||
@@ -1,46 +1,47 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<link rel="stylesheet" href="css/about.css">
|
<link rel="stylesheet" href="css/about.css">
|
||||||
</head>
|
<title>Zulip - About</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="about">
|
<div class="about">
|
||||||
<img class="logo" src="../resources/zulip.png" />
|
<img class="logo" src="../resources/zulip.png" />
|
||||||
<p class="detail" id="version">v?.?.?</p>
|
<p class="detail" id="version">v?.?.?</p>
|
||||||
<div class="maintenance-info">
|
<div class="maintenance-info">
|
||||||
<p class="detail maintainer">
|
<p class="detail maintainer">
|
||||||
Maintained by
|
Maintained by
|
||||||
<a onclick="linkInBrowser('website')">Zulip</a>
|
<a onclick="linkInBrowser('website')">Zulip</a>
|
||||||
</p>
|
</p>
|
||||||
<p class="detail license">
|
<p class="detail license">
|
||||||
Available under the
|
Available under the
|
||||||
<a onclick="linkInBrowser('license')">Apache 2.0 License</a>
|
<a onclick="linkInBrowser('license')">Apache 2.0 License</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
const { app } = require('electron').remote;
|
const { app } = require('electron').remote;
|
||||||
const { shell } = require('electron');
|
const { shell } = require('electron');
|
||||||
const version_tag = document.querySelector('#version');
|
const version_tag = document.querySelector('#version');
|
||||||
version_tag.innerHTML = 'v' + app.getVersion();
|
version_tag.innerHTML = 'v' + app.getVersion();
|
||||||
|
|
||||||
function linkInBrowser(type) {
|
function linkInBrowser(type) {
|
||||||
let url;
|
let url;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'website':
|
case 'website':
|
||||||
url = "https://zulipchat.com";
|
url = "https://zulipchat.com";
|
||||||
break;
|
break;
|
||||||
case 'license':
|
case 'license':
|
||||||
url = "https://github.com/zulip/zulip-electron/blob/master/LICENSE";
|
url = "https://github.com/zulip/zulip-electron/blob/master/LICENSE";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
shell.openExternal(url);
|
shell.openExternal(url);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script>require('./js/shared/preventdrag.js')</script>
|
<script>require('./js/shared/preventdrag.js')</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,56 +1,56 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en" class="responsive desktop">
|
<html lang="en" class="responsive desktop">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
<meta name="viewport" content="width=device-width">
|
<meta name="viewport" content="width=device-width">
|
||||||
<title>Zulip</title>
|
<title>Zulip</title>
|
||||||
<link rel="stylesheet" href="css/main.css" type="text/css" media="screen">
|
<link rel="stylesheet" href="css/main.css" type="text/css" media="screen">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="content">
|
<div id="content">
|
||||||
<div class="popup">
|
<div class="popup">
|
||||||
<span class="popuptext hidden" id="fullscreen-popup"></span>
|
<span class="popuptext hidden" id="fullscreen-popup"></span>
|
||||||
</div>
|
</div>
|
||||||
<div id="sidebar" class="toggle-sidebar">
|
<div id="sidebar" class="toggle-sidebar">
|
||||||
<div id="view-controls-container">
|
<div id="view-controls-container">
|
||||||
<div id="tabs-container"></div>
|
<div id="tabs-container"></div>
|
||||||
<div id="add-tab" class="tab functional-tab">
|
<div id="add-tab" class="tab functional-tab">
|
||||||
<div class="server-tab" id="add-action">
|
<div class="server-tab" id="add-action">
|
||||||
<i class="material-icons">add</i>
|
<i class="material-icons">add</i>
|
||||||
|
</div>
|
||||||
|
<span id="add-server-tooltip" style="display:none">Add organization</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="actions-container">
|
||||||
|
<div class="action-button" id="dnd-action">
|
||||||
|
<i class="material-icons md-48">notifications</i>
|
||||||
|
<span id="dnd-tooltip" style="display:none">Do Not Disturb</span>
|
||||||
|
</div>
|
||||||
|
<div class="action-button" id="reload-action">
|
||||||
|
<i class="material-icons md-48">refresh</i>
|
||||||
|
<span id="reload-tooltip" style="display:none">Reload</span>
|
||||||
|
</div>
|
||||||
|
<div class="action-button disable" id="back-action">
|
||||||
|
<i class="material-icons md-48">arrow_back</i>
|
||||||
|
<span id="back-tooltip" style="display:none">Go Back</span>
|
||||||
|
</div>
|
||||||
|
<div class="action-button" id="settings-action">
|
||||||
|
<i class="material-icons md-48">settings</i>
|
||||||
|
<span id="setting-tooltip" style="display:none">Settings</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="main-container">
|
||||||
|
<div id="webviews-container"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span id="add-server-tooltip" style="display:none">Add organization</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="actions-container">
|
|
||||||
<div class="action-button" id="dnd-action">
|
|
||||||
<i class="material-icons md-48">notifications</i>
|
|
||||||
<span id="dnd-tooltip" style="display:none">Do Not Disturb</span>
|
|
||||||
</div>
|
|
||||||
<div class="action-button" id="reload-action">
|
|
||||||
<i class="material-icons md-48">refresh</i>
|
|
||||||
<span id="reload-tooltip" style="display:none">Reload</span>
|
|
||||||
</div>
|
|
||||||
<div class="action-button disable" id="back-action">
|
|
||||||
<i class="material-icons md-48">arrow_back</i>
|
|
||||||
<span id="back-tooltip" style="display:none">Go Back</span>
|
|
||||||
</div>
|
|
||||||
<div class="action-button" id="settings-action">
|
|
||||||
<i class="material-icons md-48">settings</i>
|
|
||||||
<span id="setting-tooltip" style="display:none">Settings</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="main-container">
|
|
||||||
<div id="webviews-container"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="feedback-modal">
|
<div id="feedback-modal">
|
||||||
<send-feedback></send-feedback>
|
<send-feedback></send-feedback>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
<script src="js/main.js"></script>
|
<script src="js/main.js"></script>
|
||||||
<script>require('./js/shared/preventdrag.js')</script>
|
<script>require('./js/shared/preventdrag.js')</script>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en" class="responsive desktop">
|
<html lang="en" class="responsive desktop">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
<meta name="viewport" content="width=device-width">
|
<meta name="viewport" content="width=device-width">
|
||||||
<title>Zulip - Network Troubleshooting</title>
|
<title>Zulip - Network Troubleshooting</title>
|
||||||
<link rel="stylesheet" href="css/network.css" type="text/css" media="screen">
|
<link rel="stylesheet" href="css/network.css" type="text/css" media="screen">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="content">
|
<div id="content">
|
||||||
<div id="picture"><img src="img/zulip_network.png"></div>
|
<div id="picture"><img src="img/zulip_network.png"></div>
|
||||||
<div id="title">Zulip can't connect</div>
|
<div id="title">Zulip can't connect</div>
|
||||||
<div id="description">
|
<div id="description">
|
||||||
<div>Your computer seems to be offline.</div>
|
<div>Your computer seems to be offline.</div>
|
||||||
<div>We will keep trying to reconnect, or you can try now.</div>
|
<div>We will keep trying to reconnect, or you can try now.</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="reconnect">Try now</div>
|
<div id="reconnect">Try now</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
<script src="js/pages/network.js"></script>
|
<script src="js/pages/network.js"></script>
|
||||||
<script>require('./js/shared/preventdrag.js')</script>
|
<script>require('./js/shared/preventdrag.js')</script>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en" class="responsive desktop">
|
<html lang="en" class="responsive desktop">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
<meta name="viewport" content="width=device-width">
|
<meta name="viewport" content="width=device-width">
|
||||||
<title>Zulip - Settings</title>
|
<title>Zulip - Settings</title>
|
||||||
<link rel="stylesheet" href="css/preference.css" type="text/css" media="screen">
|
<link rel="stylesheet" href="css/preference.css" type="text/css" media="screen">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="content">
|
<div id="content">
|
||||||
<div id="sidebar"></div>
|
<div id="sidebar"></div>
|
||||||
<div id="settings-container"></div>
|
<div id="settings-container"></div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
<script src="js/pages/preference/preference.js"></script>
|
<script src="js/pages/preference/preference.js"></script>
|
||||||
<script>require('./js/shared/preventdrag.js')</script>
|
<script>require('./js/shared/preventdrag.js')</script>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
20
package.json
20
package.json
@@ -25,8 +25,9 @@
|
|||||||
"reinstall": "node ./tools/reinstall-node-modules.js",
|
"reinstall": "node ./tools/reinstall-node-modules.js",
|
||||||
"postinstall": "electron-builder install-app-deps",
|
"postinstall": "electron-builder install-app-deps",
|
||||||
"lint-css": "stylelint app/renderer/css/*.css",
|
"lint-css": "stylelint app/renderer/css/*.css",
|
||||||
|
"lint-html": "./node_modules/.bin/htmlhint \"app/renderer/*.html\" ",
|
||||||
"lint-js": "xo",
|
"lint-js": "xo",
|
||||||
"test": "npm run lint-css && npm run lint-js",
|
"test": "npm run lint-html && npm run lint-css && npm run lint-js",
|
||||||
"test-e2e": "gulp test-e2e",
|
"test-e2e": "gulp test-e2e",
|
||||||
"dev": "gulp dev & nodemon --watch app/main --watch app/renderer --exec 'npm test' -e html,css,js",
|
"dev": "gulp dev & nodemon --watch app/main --watch app/renderer --exec 'npm test' -e html,css,js",
|
||||||
"pack": "electron-builder --dir",
|
"pack": "electron-builder --dir",
|
||||||
@@ -121,22 +122,23 @@
|
|||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"assert": "1.4.1",
|
"assert": "1.4.1",
|
||||||
"cp-file": "^5.0.0",
|
"cp-file": "5.0.0",
|
||||||
"devtron": "1.4.0",
|
"devtron": "1.4.0",
|
||||||
"electron": "3.0.10",
|
"electron": "3.0.10",
|
||||||
"electron-builder": "20.38.4",
|
"electron-builder": "20.38.4",
|
||||||
"electron-connect": "0.6.2",
|
"electron-connect": "0.6.2",
|
||||||
"electron-debug": "1.4.0",
|
"electron-debug": "1.4.0",
|
||||||
"google-translate-api": "2.3.0",
|
"google-translate-api": "2.3.0",
|
||||||
"gulp": "^4.0.0",
|
"gulp": "4.0.0",
|
||||||
"gulp-tape": "0.0.9",
|
"gulp-tape": "0.0.9",
|
||||||
"is-ci": "^1.0.10",
|
"htmlhint": "0.11.0",
|
||||||
"nodemon": "^1.14.11",
|
"is-ci": "1.0.10",
|
||||||
|
"nodemon": "1.14.11",
|
||||||
"pre-commit": "1.2.2",
|
"pre-commit": "1.2.2",
|
||||||
"spectron": "^5.0.0",
|
"spectron": "5.0.0",
|
||||||
"stylelint": "^9.10.1",
|
"stylelint": "9.10.1",
|
||||||
"tap-colorize": "^1.2.0",
|
"tap-colorize": "1.2.0",
|
||||||
"tape": "^4.8.0",
|
"tape": "4.8.0",
|
||||||
"xo": "0.18.2"
|
"xo": "0.18.2"
|
||||||
},
|
},
|
||||||
"xo": {
|
"xo": {
|
||||||
|
|||||||
Reference in New Issue
Block a user