mirror of
https://github.com/wickedest/Mergely.git
synced 2026-02-26 11:07:56 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a3277de59 | ||
|
|
014a482984 |
49
CHANGELOG.md
49
CHANGELOG.md
@@ -1,52 +1,3 @@
|
||||
## [5.4.4](https://github.com/wickedest/Mergely/compare/v5.4.3...v5.4.4) (2026-02-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Updated examples README.md ([f1e58f5](https://github.com/wickedest/Mergely/commit/f1e58f58fea85628b1dd345b98b23923f05d8c2e))
|
||||
|
||||
## [5.4.3](https://github.com/wickedest/Mergely/compare/v5.4.2...v5.4.3) (2026-02-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Removed whitespace from example ([69ecf76](https://github.com/wickedest/Mergely/commit/69ecf76fe6066ded1efca06f9ee0ad985e8ed047))
|
||||
|
||||
## [5.4.2](https://github.com/wickedest/Mergely/compare/v5.4.1...v5.4.2) (2026-02-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Removed whitespace from example ([00a7917](https://github.com/wickedest/Mergely/commit/00a79170a8d4b701d6da98c1d6ea921b592fb3d1))
|
||||
|
||||
## [5.4.1](https://github.com/wickedest/Mergely/compare/v5.4.0...v5.4.1) (2026-02-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **#225:** Fixes rendering issue when there are multiple editors ([1a2ee6a](https://github.com/wickedest/Mergely/commit/1a2ee6af3d7d87160e72e8faca5e38cf01b36fcb))
|
||||
|
||||
# [5.4.0](https://github.com/wickedest/Mergely/compare/v5.3.6...v5.4.0) (2025-11-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **#220:** Exposes Mergely's instance of CodeMirror as Mergely.CodeMirror ([#221](https://github.com/wickedest/Mergely/issues/221)) ([d6d8d06](https://github.com/wickedest/Mergely/commit/d6d8d06accaa4fa3a4352b95620e3e456226d444)), closes [#220](https://github.com/wickedest/Mergely/issues/220)
|
||||
|
||||
## [5.3.6](https://github.com/wickedest/Mergely/compare/v5.3.5...v5.3.6) (2024-10-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **#207:** Updated documentation for search method. ([#214](https://github.com/wickedest/Mergely/issues/214)) ([350e5af](https://github.com/wickedest/Mergely/commit/350e5af2e8b2e852364dc5a5729e03e3bc75358b)), closes [#207](https://github.com/wickedest/Mergely/issues/207)
|
||||
|
||||
## [5.3.5](https://github.com/wickedest/Mergely/compare/v5.3.4...v5.3.5) (2024-10-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* bump dependencies ([#213](https://github.com/wickedest/Mergely/issues/213)) ([83df02d](https://github.com/wickedest/Mergely/commit/83df02d967ce3100a33216f8ca77c2168bd53234))
|
||||
|
||||
## [5.3.4](https://github.com/wickedest/Mergely/compare/v5.3.3...v5.3.4) (2024-10-11)
|
||||
|
||||
|
||||
|
||||
16
README.md
16
README.md
@@ -84,15 +84,13 @@ Mergely will emit an `updated` event when the editor is first initialized, and e
|
||||
|
||||
### Visualization modes
|
||||
|
||||
Mergely does not support any CodeMirror highlighting for different languages (xml, html, javascript etc.) out of the box.
|
||||
You can compile your own Mergely-Version with support for the desired modes by adding them to diff-view.js. For example:
|
||||
```
|
||||
require('codemirror/mode/go/go.js');
|
||||
require('codemirror/mode/javascript/javascript.js');
|
||||
require('codemirror/mode/htmlmixed/htmlmixed.js');
|
||||
require('codemirror/mode/markdown/markdown.js');
|
||||
require('codemirror/mode/python/python.js');
|
||||
```
|
||||
Mergely supports the following CodeMirror visualizations for [mode](codemirror.net/5/doc/manual.html#option_mode):
|
||||
|
||||
* go
|
||||
* javascript
|
||||
* htmlmixed
|
||||
* markdown
|
||||
* python
|
||||
|
||||
## Options
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# Mergely examples
|
||||
|
||||
|
||||
## Mergely development server
|
||||
|
||||
To run the hot dev-server for development, you need to run:
|
||||
|
||||
@@ -2,6 +2,9 @@ require('codemirror/addon/selection/mark-selection.js');
|
||||
require('codemirror/lib/codemirror.css');
|
||||
require('../src/mergely.css');
|
||||
|
||||
|
||||
|
||||
|
||||
document.onreadystatechange = function () {
|
||||
if (document.readyState !== 'complete') {
|
||||
return;
|
||||
|
||||
@@ -14,6 +14,7 @@ the quick brown fox
|
||||
jumped over the lazy dog
|
||||
`;
|
||||
|
||||
|
||||
document.onreadystatechange = function () {
|
||||
if (document.readyState !== 'complete') {
|
||||
return;
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "mergely",
|
||||
"version": "5.4.4",
|
||||
"version": "5.3.4",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "mergely",
|
||||
"version": "5.4.4",
|
||||
"version": "5.3.4",
|
||||
"license": "(GPL-3.0 OR LGPL-3.0 OR MPL-1.1 OR SEE LICENSE IN LICENSE)",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.1.6",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mergely",
|
||||
"version": "5.4.4",
|
||||
"version": "5.3.4",
|
||||
"description": "A javascript UI for diff/merge",
|
||||
"license": "(GPL-3.0 OR LGPL-3.0 OR MPL-1.1 OR SEE LICENSE IN LICENSE)",
|
||||
"author": {
|
||||
|
||||
@@ -18,11 +18,9 @@ function CodeMirrorDiffView(el, options) {
|
||||
const coords = this.cursorCoords(null, 'local');
|
||||
this.scrollTo(null,
|
||||
(coords.top + coords.bottom) / 2 - (this.getScrollerElement().clientHeight / 2));
|
||||
});
|
||||
this.init(el, options);
|
||||
};
|
||||
|
||||
CodeMirrorDiffView.CodeMirror = CodeMirror;
|
||||
});
|
||||
this.init(el, options);
|
||||
};
|
||||
|
||||
const trace = console.log;
|
||||
const traceTimeStart = console.time;
|
||||
@@ -318,7 +316,7 @@ CodeMirrorDiffView.prototype.bind = function(container) {
|
||||
if (!notice) {
|
||||
notice = noticeTypes.lgpl;
|
||||
}
|
||||
const editor = this.el;
|
||||
const editor = this._queryElement(`#${this.id}`);
|
||||
const splash = dom.getSplash({
|
||||
notice,
|
||||
left: (editor.offsetWidth - 300) / 2,
|
||||
@@ -1200,7 +1198,7 @@ CodeMirrorDiffView.prototype._renderDiff = function(changes) {
|
||||
|
||||
CodeMirrorDiffView.prototype._queryElement = function(selector) {
|
||||
const cacheName = `_element:${selector}`;
|
||||
const element = this[cacheName] || this.el.querySelector(selector);
|
||||
const element = this[cacheName] || document.querySelector(selector);
|
||||
if (!this[cacheName]) {
|
||||
this[cacheName] = element;
|
||||
}
|
||||
|
||||
@@ -253,8 +253,6 @@ class Mergely {
|
||||
}
|
||||
}
|
||||
|
||||
Mergely.CodeMirror = CodeMirrorDiffView.CodeMirror;
|
||||
|
||||
window.Mergely = Mergely;
|
||||
|
||||
module.exports = Mergely;
|
||||
|
||||
Reference in New Issue
Block a user