Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b9bc901dd2 | ||
|
|
b49c9ce40f | ||
|
|
712cbe8472 | ||
|
|
8c541ba51c | ||
|
|
aa36977685 |
12
CHANGES.md
12
CHANGES.md
@@ -1,5 +1,17 @@
|
||||
# Changes
|
||||
|
||||
## 4.3.3
|
||||
* patch: Fixes resize issue when using zoom [#152](https://github.com/wickedest/Mergely/issues/152).
|
||||
|
||||
## 4.3.2
|
||||
* patch: Reset the current change position when [setValue](https://mergely.com/doc##options_callbacks), [clear](https://mergely.com/doc#clear), [lhs](https://mergely.com/doc#lhs) or [rhs](https://mergely.com/doc#rhs) are called.
|
||||
|
||||
## 4.3.1
|
||||
* patch: Updated README.md to fix incorrect option name.
|
||||
|
||||
## 4.3.0
|
||||
* feat: Added `summary` method
|
||||
|
||||
## 4.2.4
|
||||
* patch: fixes [#142](https://github.com/wickedest/Mergely/issues/142). Added README.md to examples.
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ Unpack mergely.tgz into a folder, for example, `./lib`, and add the following to
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.32.0/codemirror.min.js"></script>
|
||||
<link rel="stylesheet" media="all" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.32.0/codemirror.css" />
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.32.0/addon/search/searchcursor.min.js"></script>
|
||||
<script src="lib/mergely/lib/mergely.js" type="text/javascript"></script>
|
||||
<link rel="stylesheet" media="all" href="lib/mergely/lib/mergely.css" />
|
||||
<script src="package/lib/mergely.js" type="text/javascript"></script>
|
||||
<link rel="stylesheet" media="all" href="package/lib/mergely.css" />
|
||||
```
|
||||
|
||||
Create a div for the editor in `<body>`.
|
||||
@@ -100,7 +100,7 @@ $(document).ready(function () {
|
||||
|<a name="fgcolor"></a>fgcolor|string\|number\|object|`{a:'#4ba3fa', c:'#a3a3a3', d:'#ff7f7f', ca:'#4b73ff', cc:'#434343', cd:'#ff4f4f'}`|The foreground color that mergely marks changes with on the canvas. The value **a** is additions, **c** changes, **d** deletions, and the prefix *c* indicates current/active change (e.g. **cd** current delection).|
|
||||
|<a name="ignorews"></a>ignorews|boolean|`false`|Ignores white-space.|
|
||||
|<a name="ignorecase"></a>ignorecase|boolean|`false`|Ignores case when differientiating.|
|
||||
|<a name="ignoreaccents"></a>ignorews|boolean|`false`|Ignores accented characters.|
|
||||
|<a name="ignoreaccents"></a>ignoreaccents|boolean|`false`|Ignores accented characters.|
|
||||
|<a name="lcs"></a>lcs|boolean|`true`|Enables/disables LCS computation for paragraphs (word-by-word changes). Disabling can give a performance gain for large documents.|
|
||||
|<a name="license"></a>license|string|`lgpl`|The choice of license to use with Mergely. Valid values are: `lgpl`, `gpl`, `mpl` or `lgpl-separate-notice`, `gpl-separate-notice`, `mpl-separate-notice` (the license requirements are met in a separate notice file).|
|
||||
|<a name="line_numbers"></a>line_numbers|boolean|`true`|Enables/disables line numbers. Enabling line numbers will toggle the visibility of the line number margins.|
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mergely",
|
||||
"version": "4.3.0",
|
||||
"version": "4.3.3",
|
||||
"description": "A javascript UI for diff/merge",
|
||||
"directories": {
|
||||
"doc": "doc",
|
||||
|
||||
@@ -489,11 +489,15 @@ jQuery.extend(Mgly.CodeMirrorDiffView.prototype, {
|
||||
this.unbind();
|
||||
},
|
||||
lhs: function(text) {
|
||||
this.changes = []; // invalidate existing changes
|
||||
// invalidate existing changes and current position
|
||||
this.changes = [];
|
||||
delete this._current_diff;
|
||||
this.editor[this.id + '-lhs'].setValue(text);
|
||||
},
|
||||
rhs: function(text) {
|
||||
this.changes = []; // invalidate existing changes
|
||||
// invalidate existing changes and current position
|
||||
this.changes = [];
|
||||
delete this._current_diff;
|
||||
this.editor[this.id + '-rhs'].setValue(text);
|
||||
},
|
||||
update: function() {
|
||||
@@ -607,7 +611,6 @@ jQuery.extend(Mgly.CodeMirrorDiffView.prototype, {
|
||||
else if (!this.rhs_cmsettings.readOnly) re.setValue(le.getValue());
|
||||
},
|
||||
summary: function() {
|
||||
//console.log('HERE');
|
||||
return {
|
||||
numChanges: this.changes.length,
|
||||
lhsLength: this.editor[this.id + '-lhs'].getValue().length,
|
||||
@@ -634,6 +637,7 @@ jQuery.extend(Mgly.CodeMirrorDiffView.prototype, {
|
||||
if (side == 'rhs' && this.rhs_cmsettings.readOnly) return;
|
||||
var ed = this.editor[this.id + '-' + side];
|
||||
ed.setValue('');
|
||||
delete this._current_diff;
|
||||
},
|
||||
cm: function(side) {
|
||||
return this.editor[this.id + '-' + side];
|
||||
@@ -659,6 +663,8 @@ jQuery.extend(Mgly.CodeMirrorDiffView.prototype, {
|
||||
}
|
||||
},
|
||||
resize: function() {
|
||||
// recalculate line height as it may be zoomed
|
||||
this.em_height = null;
|
||||
this.settings.resize();
|
||||
this._changing(this.id + '-lhs', this.id + '-rhs');
|
||||
this._set_top_offset(this.id + '-lhs');
|
||||
@@ -820,6 +826,7 @@ jQuery.extend(Mgly.CodeMirrorDiffView.prototype, {
|
||||
var sz_timeout1 = null;
|
||||
var sz = function(init) {
|
||||
if (self.settings.resize) self.settings.resize(init);
|
||||
self.resize();
|
||||
self.editor[self.id + '-lhs'].refresh();
|
||||
self.editor[self.id + '-rhs'].refresh();
|
||||
};
|
||||
@@ -870,6 +877,7 @@ jQuery.extend(Mgly.CodeMirrorDiffView.prototype, {
|
||||
self.trace('init', 'setting lhs value');
|
||||
this.settings.lhs(function setValue(value) {
|
||||
this._initializing = true;
|
||||
delete this._current_diff;
|
||||
this.editor[this.id + '-lhs'].getDoc().setValue(value);
|
||||
}.bind(this));
|
||||
}
|
||||
@@ -877,6 +885,7 @@ jQuery.extend(Mgly.CodeMirrorDiffView.prototype, {
|
||||
self.trace('init', 'setting rhs value');
|
||||
this.settings.rhs(function setValue(value) {
|
||||
this._initializing = true;
|
||||
delete this._current_diff;
|
||||
this.editor[this.id + '-rhs'].getDoc().setValue(value);
|
||||
}.bind(this));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user