1
0
mirror of synced 2025-11-06 04:30:40 +08:00
Files
Mergely/examples/app-styles.js
Jamie Peabody 37fedd05c8 v5.0 (#174)
* feat: v5

BREAKING CHANGE: Mergely is no longer a jQuery plugin.

BREAKING CHANGE: Removed `options.autoresize`

BREAKING CHANGE: Removed `options.editor_width`

BREAKING CHANGE: Removed `options.editor_height`

BREAKING CHANGE: Removed `options.fadein`

BREAKING CHANGE: Removed `options.fgcolor`

BREAKING CHANGE: Removed `options.resize`

BREAKING CHANGE: Removed `options.width`

BREAKING CHANGE: Removed `options.height`

BREAKING CHANGE: Removed `options.loaded` callback

BREAKING CHANGE: Removed `options.resized` callback

BREAKING CHANGE: Removed styles `.mergely-resizer`, `.mergely-full-screen-0`, and `.mergely-full-screen-8`

BREAKING CHANGE: Changed default for `options.change_timeout` changed from `150` to `50`.

BREAKING CHANGE: No longer automatically scrolls to first change.

feat: CodeMirror is now an explicit dependency.

feat: No longer necessary to separately require codemirror/addon/search/searchcursor

feat: No longer necessary to separately require codemirror/addon/selection/mark-selection

feat: `mergely.js` is now unminimized, and added new minimized version `mergely.min.js`

feat: Gutter click now scrolls to any line

feat: Mergely now emits `resize` event on resize

feat: The UI is now non-blocking as diff now runs in background

feat: Added support to provide `options.lhs` and `options.rhs` as strings

feat: #16 added titles to editor.mergely.com

fix: #165 block of changes at end of file are now distinguishable

fix: #140 fixed performance issue with large files

fix: Fixed issue where canvas markup was not rendered when `viewport` enabled

fix: Fixed timing issue where swap sides may not work as expected.

fix: Fixed issue where unmarkup did not emit an updated event.

fix: Fixed documentation issue where `merge` incorrectly stated: from the specified `side` to the opposite side.

fix: Fixed performance issue scrolling

fix: Fixed issue where initial render scrolled to first change, showing it at the bottom (as opposed to middle as expected)

fix: Fixed issue where line-diffs failed to diff non-alphanumeric characters

* chore: tweaked no-start/end styles

* feat: dark mode

* chore: updated examples

* chore(ci): updated webpack

* chore(ci): alpha, beta, next branches

* chore(ci): test

* chore(ci): package-lock.json

* chore(ci): ignore alpha, beta, next on branch

* fix: fixes firefox scroll-linked effect issue

* fix: fixes firefox scroll-linked effect issue

* chore: fix css

* chore: debug
2023-04-23 16:29:59 +01:00

93 lines
3.2 KiB
JavaScript

require('codemirror/addon/selection/mark-selection.js');
require('codemirror/lib/codemirror.css');
require('../src/mergely.css');
document.onreadystatechange = function () {
if (document.readyState !== 'complete') {
return;
}
new Mergely('#mergely0', {
license: 'lgpl-separate-notice',
lhs: (setValue) => setValue('the quick brown fox\njumped over the lazy dog\n'),
rhs: (setValue) => setValue('\nthe quick red fox\njumped over the hairy dog\n')
});
new Mergely('#mergely1', {
license: 'lgpl-separate-notice',
lhs: (setValue) => setValue('\nthe quick red fox\njumped over the hairy dog\n'),
rhs: (setValue) => setValue('the quick brown fox\njumped over the lazy dog\n')
});
new Mergely('#mergely2', {
license: 'lgpl-separate-notice',
lhs: (setValue) => setValue('\nthe quick red fox\njumped over the hairy dog\n\n'),
rhs: (setValue) => setValue('\n\nthe quick brown fox\njumped over the lazy dog\n')
});
new Mergely('#mergely3', {
license: 'lgpl-separate-notice',
lhs: (setValue) => setValue('\nthe quick brown fox\njumped over the lazy dog\n\n'),
rhs: (setValue) => setValue('\n\nthe quick red fox\njumped over the hairy dog\n')
});
new Mergely('#mergely4', {
license: 'lgpl-separate-notice',
lhs: (setValue) => setValue('the quick brown fox\n'),
});
new Mergely('#mergely5', {
license: 'lgpl-separate-notice',
rhs: (setValue) => setValue('the quick brown fox\n')
});
new Mergely('#mergely6', {
license: 'lgpl-separate-notice',
lhs: (setValue) => setValue('the quick brown fox\njumped over the lazy dog\n'),
});
new Mergely('#mergely7', {
license: 'lgpl-separate-notice',
rhs: (setValue) => setValue('the quick brown fox\njumped over the lazy dog\n')
});
new Mergely('#mergely8', {
license: 'lgpl-separate-notice',
lhs: (setValue) => setValue('the quick brown fox\njumped over the lazy dog'),
rhs: (setValue) => setValue('the quick brown fox\njumped over the lazy dog\n\nand the fence')
});
new Mergely('#mergely9', {
license: 'lgpl-separate-notice',
lhs: (setValue) => setValue('the quick brown fox\njumped over the lazy dog\n\nand the fence'),
rhs: (setValue) => setValue('the quick brown fox\njumped over the lazy dog')
});
new Mergely('#mergely10', {
license: 'lgpl-separate-notice',
});
new Mergely('#mergely11', {
license: 'lgpl-separate-notice',
lhs: (setValue) => setValue('the quick brown fox\njumped over the lazy dog'),
rhs: (setValue) => setValue('the quick brown fox\njumped over the lazy dog')
});
new Mergely('#mergely12', {
license: 'lgpl-separate-notice',
lhs: (setValue) => setValue('the quick red fox\njumped over the hairy dog'),
rhs: (setValue) => setValue('the quick brown fox\njumped over the lazy dog')
});
new Mergely('#mergely13', {
license: 'lgpl-separate-notice',
lhs: (setValue) => setValue('\nthe quick red fox\njumped over the hairy dog'),
rhs: (setValue) => setValue('\nthe quick brown fox\njumped over the lazy dog')
});
new Mergely('#mergely14', {
license: 'lgpl-separate-notice',
ignorecase: true,
ignorews: true,
ignoreaccents: true,
lhs: (setValue) => setValue('ignore ws\n\nignore CASE\n\nignore áccents\n'),
rhs: (setValue) => setValue('ignore\tws\n\nignore case\n\nignore accents\n')
});
};