Git Product home page Git Product logo

mergely's People

Contributors

alibitek avatar andreamussap avatar controlboy38 avatar cvara avatar dbluestein avatar dependabot[bot] avatar ecksters avatar edgarcosta avatar huangyq23 avatar johan456789 avatar kljh avatar nahakiole avatar semantic-release-bot avatar sphinxxxx avatar tenuki avatar twostone avatar wickedest avatar zhudock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mergely's Issues

Can I Use This As A Viewer With A Different Back End?

I have quite complex requirements for what constitutes a diff or not in XML.
For this purpose I am using xmlunit as it gives me a lot of flexibility.

Is it possible to take the output of my xmlunit result and tell mergely what constitutes a diff?
i.e. just use the mergely viewer and not the mergely difference engine

Merged Output

I love this library. Really well done ! It is the first I found that comes close to Apple's FileMerge.

FileMerge also shows an (editable) bottom area of the merge results, which is extremely helpful for understanding the final result and even allows to edit that merge block (basically overriding that sections output). Is this something that will be added sometime ?

interested in a challenge? :-)

First, this is awesome. Impressive job.

I'm working on a proof-of-concept node.js tool that will "deconstruct" HTML pages into components and sections. So, for example, you could use it to reverse engineer all of Bootstrap's built pages back into components and partials/includes.

I actually have everything working, but it would be awesome to automatically:

  • have the tool perform diffs on each file,
  • then "extract" out text that differs from one file to the next
  • push those differences into an array
  • write the resulting array to the disk as valid JSON

For example, given these two files:

image

The tool would automatically merge the two files into one, and create the following JSON file (using the basename of each file as the property name):

{
  "css": "CSS · Upstage",
  "components": "Components  · Upstage"
}

The only thing I need help with is the extraction of differences, e.g. where in the code is the actual diff'ed text being highlighted, etc. and possible a strategy for merging files like those in the examples.

If you could even just point me in the right direction in the code, that would be great.

scrolling one side before changes are computed

Hi,

Thanks for this great tool.
I'm loading one side and I disable the difference calculation. I only enable the difference calculation after loading the second text, because it does not make sense to show the difference between a text and an empty one.
There is only a small problem, because if the user tries to scroll down the first text, before loading the second one, there is a Javascript error.

I fixed it (just a hack), in _scrolling, by adding:

if (!this.hasOwnProperty('changes')) return;

before the cycle where the property changes is used.

If this hack makes sense, I can submit a pull request.

How to keep the cursor position unchanged

When you enter a character, the cursor always returns to the beginning of the line.
So I have to undo and redo, so that the characters can be entered normally.
Is there a more effective way??

editor_height - documentation

sorry to say this, but the documentation is severely lacking. I have no idea how exactly to set the height. I tried setting editor_height as presented in documentation, but all it does is make the boxes taller. The content inside it is still confined to the original height. Can you please include examples in documentation?

Restrict merging in only one direction?

Hi,

Is it possible to restrict merging to happen in only one direction? e.g. left to right or right to left only?
I couldn't find any settings for this.

Thank you.

Inline changes broken

If the changed word within a line has different length on both side, the right side is displayed incorrectly. E.g. see http://www.mergely.com/lKGcLOqu/

Changing 'lhs' to 'rhs" in the second part of
jQuery.extend(Mgly.LCS.prototype, { ...
seems to correct the problem.

Insert diff above or below

Hi,
is it possible to merge/insert a diff line above or below the opposite reference line?
Like in Meld with pressing the Ctrl-key?

Regards,
Stefan

Please tag the releases

Please Tag the releases with the versions so that tools can automatically reference them.
Right now they seem to be missing completely an exist only on your site in the download section.

Thank you.

Where are PHP files accessed with AJAX from editor/editor.js ?

Hello,

I cannot find where is the source code for the following PHP files access from:

editor/editor.js
168:                            url: '/ajax/handle_get.php',
178:                            url: '/ajax/handle_get.php',
427:                            url: '/ajax/handle_file.php',
432:                                            var url = '/ajax/handle_save.php?key=' + key;
476:                    url: '/ajax/handle_crossdomain.php',

The menu options do not work without them.

Any ideas?

Live JSFiddle example.

Please add a JSFiddle example of Mergely.

This would allow users to try it right away, but would be also much easier
this way to send bug test cases by just forking and modifying that example.

Thank you.

Feature request: Git diff

I noticed there's already Save .diff option available, but it has some kind of unknown syntax to me. Would it be possible to implement more export options for saving diffs, for example git diff? Yes, I know I can just use git, or if I'm online I can go play with github's diff, but Mergely provides a very nice split diff where you can merge stuff in both directions. For github, or real code editor I'd need to:

  • edit the line
  • save
  • git diff again
  • check if it's actually the diff I want and then export to file

and there's only one-side merge option if I don't want to copy the exact lines of code.

With this feature available I could just dump what I edit in Mergely right to the .patch file and send away.

The default resize function uses a mix of parent element and window size components

Hi, I'm not sure if this is by design, but the default resize function ( https://github.com/wickedest/Mergely/blob/master/lib/mergely.js#L374 ) uses element's parent to get the 'width' (non-auto case) but to get the hieght, the window's height is used.

Is this deliberate? (it seems to break embedding mergely into a page part way down the sccreen)

It is work-aroundable, by setting both width + height to 'auto' and by providing the following settings methods:

        _auto_height: function(h) { 
            return $(that._comparerElement).parent().height() - 20;
        },
        _auto_width: function(h) { 
            return $(that._comparerElement).parent().width();
        },

but is this the correct thing for me to be doing ?

Make mergely work inside shadow-dom elements (stop referencing by global ID)

It should be possible to use mergely within a polymer element. Polymer elements use shadow dom (i.e. ids are unique within a "dom-module", but not guaranteed to be unique for the whole doc, or even queryable from the main document.

For all invocations of $() or jQuery() search beneath the main mergely element.

Can it sign diff only?

I paste some words that may have '/t' in a word, then '/t' will be convert a label of span, so if it has a diff, The whole sentence will be signed, how can l t solve this ##problem?

Change tracking

I appreciate developing this really handy project.

Instead of merging I need to use Megely for change tracking. In the same way that it works in MS word or Google Docs.

I need to present the user a single text editor pre-filled with some paragraphs and once user start typing he sees changes real-time and in-line.

Can you please advise how can I achieve this result please?

Online Diff Tool Pane Label

Love this tool, it would be great if you could label each pane.

Example. When you are comparing dev and production code, you could easily identify which one is which.

[Suggestion, UX] make the diff indicators filled in with color.

Hi,

I want to make a small suggestion, could it be possible to fill in the diff inidicators with a solid color ?

On large screens very thin lines are hard to see. When the diff block indicators would be filled in it would make the visibility much better.

Please see screenshot.

screen shot 2015-11-09 at 12 31 54

ed[oside].removeLine is not a function

To delete the new changes made on left side by pressing Merge button on the right side, it is throwing the 'ed[oside].removeLine is not a function' error in the console.

The is happened by using upgraded version of codemirror.

After viewing the upgrade notes of codemirror, it is identified that removeLine function is removed from the codemirror library which is why this error is happening now in codemirror version 4.

The refactoring is required to replace the old method with the new method called 'replaceRange'.

Lots of FOR( x in y) missing hasOwnProperty

I pulled your last version of mergely (pre-3.0) SHA: b5e669d and when used with some other libraries that extend some of the prototypes (like Array); mergely will break because it doesn't check to verify that the property it is trying to use is its own.

I can submit a patch for this version if you want; but I realize this is now a "obsolete" version as you are working on the 3.0 branch. I do NOT know if the 3.0 has the same issue; but it was only a couple minutes of work to change doing a search for all "for" and then on any of the "in" for's, adding a "if (!y.hasOwnProperty(x)) continue; " as the first line in the loop.

Support for 'clearing out differences/overlays/gutters/canvas lines'

I couldn't see from the current API how I would 'remove' the differencing overlays, say I have 'autoupdate' turned off, and want explicit control over when the differences are applied (or more accurately _un_applied!).

To achieve this I added the following external code :

var d= jQuery.data(this._comparerElement, "mergely");
        for (var name in d.editor) {
            if (!d.editor.hasOwnProperty(name)) continue;
            var editor = d.editor[name];
            // clear editor changes
            editor.operation(function() {
                var timer = new Mgly.Timer();
                for (var i = 0, l = editor.lineCount(); i < l; ++i) {
                    editor.removeLineClass(i, 'background');
                }
                for (var i = 0; i < d.change_funcs.length; ++i) {
                    var edid = editor.getDoc().id;
                    var change =d.change_funcs[i];
                    if (change.doc.id != edid) continue;
                    if (change.lines.length) {
                        d.trace('change', 'clear text', edid, change.lines[0].text);
                    }
                    change.clear();
                }
                editor.clearGutter('merge');
                d.trace('change', 'clear time', timer.stop());
            });
        }
        d.change_funcs = [];
        d._draw_diff(d.id + '-lhs', d.id + '-rhs', []);

(Taken from the mergely#_changed method with a minor difference in the last line.) Is there a correct way to achieve what I'm doing here without exposing the internals of mergely to the consuming code ?

Alternatively would you accept a pull request adding support for this to the mergely interface, if so what form would you like that call to take ?

Thank you :)

Install from bower

I think it would be nice to be able to easily install mergely as a bower dependency. There is a repo, erahhal/bower-mergely, that provides that functionality but it is quite out of date as of now. I would suggest a bower.json in this repo, as it would assure that it remains up to date in the future. I could draw one up if there is no opposition.

Question

Does Mergely require anything but a webserver to run? (eg: node, frameworks, etc)

Readonly but merge?

How to make the edit panes "read-only" for user edits (with the keyboard), but allow the merge operations.
If I set:

...
cmsettings: {
    readOnly: true,
    lineNumbers: true 
},
...

the merging buttons/actions on each side disappear too, so the merging operations are not possible anymore.

Thank you.

'autoresize:false' ignored for window resizes

It seems that the only effect of setting autoresize to true is that we get some style applied to the element, the background window-resize event listener is always applied even when autoresize is false.

Is that the expected behaviour? I had hoped to control resizing myself (as resizing also fires a 'changing' event, and I do not neccessarily wish this to fire)

mergely too eager to find common text

Mergely sometimes it a little too eager when trying to find common text. Here's a silly, made up example:

http://www.mergely.com/HA4vHsTS/

Line 5 (on the left, or line 4 on the right), the content is pretty much entirely different. However, mergely highlights it to show that "ar and "o" are in common between both lines. This in practice, is useless, since these are letters in the middle of works that happen to be common. I'd prefer it if mergely simply marked these entire lines as different (like is does for line 4left, 3right)

Is this a reasonable tweak to make?

"Ignore white space" does not ignore newlines

Even when the "Ignore white space" menu option is selected, extra and/or missing newlines are marked as differences in the editor, which is not the behavior that I would expect.

Examples don't prepopulate the .txt files

The included /examples/ include some .txt files which I assume the browser is supposed to read and pre-populate the lhs/rhs diff panes, but they don't seem to load in any of my browsers: Chrome, Firefox, IE

Feature Request

is it possible to get a summary of diff result?

like number of modification, number of add, number of deletion

Thank you

Using jQuery instead of $ for jQuery.

It would be probably better if you used the full spelled out "jQuery" in mergely library for those using other libraries that take over the $ symbol and when using jQuery.noConflict(). Again I can submit a patch for the last 2.x branch if you want; it was a two second change to do quick search & replace of all $ -> jQuery in the mergly.js file.

Way to call callback when diff rendering finished

I'm looking for a way to scroll to first change once editor is loaded, and both lhs and rhs sides loaded as well. The problem is that i think there's no callback once the diff calculation is done.

In case of large files generating diffs takes some time, and there's no nice way to call the scrollToDiff function then.

Am i missing something ?

Mergely with Bootstrap?

How to combine Mergely with Twitter Bootstrap?

I have a editor_width: '500px' setting for mergely but how can I make it to take the entire width available by Bootstrap?
e.g.

<div id="compare" class="col-sm-12"><div>

seems to ignore the width exposed by the '.col-sm-12'
IMHO there should be more a "min_editor_width" setting.

XML Compare Is Misleading

The about page says It can be embedded within your own Web application to compare files, text, C, C++, Java, HTML, XML, CSS, and javascript.
http://www.mergely.com/about

When I compare 2 xml files with attributes in different order or tags in different order mergely marks these as differences when in fact they are identical in terms of xml.

Is it in fact only doing a basic text diff?

Are there plans for proper xml diff?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.