Commit 9cab4945 authored by George Popoff's avatar George Popoff

Добавил webpack конфигурацию, добавил входной файл бандла typos-page.js,…

Добавил webpack конфигурацию, добавил входной файл бандла typos-page.js, переименовал старый файл в typos_old.js
parent b328491b
......@@ -23,6 +23,8 @@ user_guide_src/cilexer/pycilexer.egg-info/*
node_modules/
javascript/dist
## Sublime Text cache files
*.tmlanguage.cache
*.tmPreferences.cache
......
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
document.addEventListener("DOMContentLoaded", function() {
Typos._init();
});
var Typos = {
_init: function() {
this.contextBlock = $("#context-block");
this.contextBlockText = this.contextBlock.children().first();
},
/**
* Показывает окно, содержащее информацию о контексте.
* @param {type} link Элемент a.typos_context
* @returns {Boolean}
*/
handleLink: function(link) {
var text = link.getAttribute("context");
var typo = link.getAttribute("typo");
var correct = link.getAttribute("correct");
var self = this;
text = text.replace(typo, "<span class='typo'>" + typo + " -> " + correct + "</span>");
self.contextBlockText.html(text);
self.contextBlock.dialog();
return false;
}
};
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -6,6 +6,7 @@
"private": true,
"dependencies": {},
"devDependencies": {
"webpack": "^4.4.1"
"webpack": "^4.4.1",
"webpack-cli": "^2.0.13"
}
}
const path = require("path");
module.exports = {
entry: "./javascript/typos.js",
output: {
filename: "typos-page.js",
path: path.resolve(__dirname, "javascript/dist")
},
mode: "development"
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment