diff --git a/doc/index.html b/doc/index.html
index 36d98e3..fe4c606 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -113,6 +113,8 @@ $(document).ready(function () {
bgcolor
The background color that mergely fills the margin canvas with. Defaults to '#eeeeee'
+ vwcolor
+ The margin/viewport indicator color. Defaults to 'rgba(0, 0, 200, 0.5)'
fadein
A jQuery fade-in value to enable the editor to fade in. Set to empty string to disable. Defaults to 'fast'
@@ -159,10 +161,13 @@ $(document).ready(function () {
$(selector).mergely('clear', side)
Clears the editor contents.
+ $(selector).mergely('unmarkup')
+ Clears the editor markup.
+
$(selector).mergely('search', side, text)
Search the editor for text. Repeating the call will find the next available token.
- $(selector).resize()
+ $(selector).mergely('resize')
Resize the editor.
$(selector).mergely('update')
diff --git a/editor/editor.css b/editor/editor.css
index e4a24e8..9df6030 100755
--- a/editor/editor.css
+++ b/editor/editor.css
@@ -6,10 +6,9 @@ body { margin: 0px; font-family: "trebuchet ms"; }
#info h3, #info p { display: none; }
#info button { visibility: hidden; font-size: 0.75em; }
#about, #editor, #settings { float: right !important; margin: 6px 5px 0 5px; }
-#settings { }
#settings img { display: inline-block; height: 16px; vertical-align: middle; padding-bottom: 3px; }
-.toolbar { display: none; margin: 0px; background: #e2e8ec url(../../images/toolbar_bg.png); border-bottom: 1px solid #A7BCC8; line-height: 14px; }
+.toolbar { display: none; margin: 0px; background: #e2e8ec url(../../images/toolbar_bg.png); line-height: 15px; }
.title { display: none; font-weight: bold; }
.toolbar .ui-button { width: 1em; }
.toolbar input[type=text] { float: left; border: 1px solid #888; font-size: 12px; font-weight: bold; font-family: tahoma; letter-spacing: 1px; width: 150px; color: #444; margin-right: 2px; }
@@ -29,3 +28,4 @@ body { margin: 0px; font-family: "trebuchet ms"; }
#dialog-settings input[type=text] { width: 70px; border: 1px solid #444; float:right; }
#dialog-settings label.checkbox { width: auto; }
#dialog-settings fieldset { -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; border: 1px solid #ccc; width: 222px; padding-right: 15px; }
+#mergely-resizer { position: fixed; bottom: 0; top: 73px; width: 100%;}
diff --git a/editor/editor.js b/editor/editor.js
index d2d2692..4f33d2d 100755
--- a/editor/editor.js
+++ b/editor/editor.js
@@ -93,26 +93,26 @@ $(document).ready(function () {
ignorews: parameters.get('ws', false),
lcs: parameters.get('lcs', true),
sidebar: parameters.get('sb', true),
- height: function(h) {
- return h - 100;
- },
loaded: function() {
- $('.toolbar, .title').fadeIn('fast');
+ $('.toolbar').fadeIn('fast');
$('button').css({'visibility':'visible'});
},
resized: function() {
- var lhsx = $('#compare-editor-lhs .CodeMirror-gutter').offset().left + $('#compare-editor-lhs .CodeMirror-gutter').width() + 1;
- var rhsx = $('#compare-editor-rhs .CodeMirror-gutter').offset().left + $('#compare-editor-rhs .CodeMirror-gutter').width() + 1 - $('#lhs-toolbar').width();
+ var lhsx = $('.mergely-margin:first-child').width();
+ var rhsx = lhsx + $('#compare-editor-rhs .CodeMirror').width() + 25 - $('#lhs-toolbar').width();
$('#lhs-toolbar, #title-lhs').css({'position':'relative', 'left':lhsx});
$('#rhs-toolbar, #title-rhs').css({'position':'relative', 'left':rhsx});
$('#title-rhs').css({'left':rhsx});
},
+ height: 'auto',
+ width: 'auto',
cmsettings: {
mode: 'text/plain',
lineWrapping: parameters.get('wrap') || false,
readOnly: (key == '4qsmsDyb') || parameters.get('ro')
}
});
+
if (key.length == 8) {
$.when(
$.ajax({
@@ -293,6 +293,7 @@ $(document).ready(function () {
var readOnly = $('#compare').mergely('cm', 'lhs').getOption('readOnly') || $('#compare').mergely('cm', 'rhs').getOption('readOnly');
var lcs = $('#compare').mergely('options').lcs;
var sidebar = $('#compare').mergely('options').sidebar;
+ var ignoreunchanged = $('#compare').mergely('options').ignoreunchanged;
$.each(conf, function(key, item){ $(item.id).val(item.getColor()); });
$('#ignore-ws').prop('checked', ignorews);
@@ -300,6 +301,9 @@ $(document).ready(function () {
$('#readonly').prop('checked', readOnly);
$('#lcs').prop('checked', lcs);
$('#sidebar').prop('checked', sidebar);
+ /*
+ $('#ignoreunchanged').prop('checked', ignoreunchanged);
+ */
$('#settings').click(function(){
dlg.dialog({
@@ -317,6 +321,9 @@ $(document).ready(function () {
var readonly = $('#readonly').prop('checked');
var lcs = $('#lcs').prop('checked');
var sidebar = $('#sidebar').prop('checked');
+ /*
+ var ignoreunchanged = $('#ignoreunchanged').prop('checked');
+ */
var text =
'.mergely.a.rhs.start { border-top: 1px solid ' + aborder + '; }\n\
.mergely.a.lhs.start.end,\n\
@@ -337,7 +344,7 @@ $(document).ready(function () {
.mergely.ch.d.lhs { background-color: ' + dbg + '; text-decoration: line-through; color: #888; }';
$('').appendTo('head');
- $('#compare').mergely('options', {ignorews: ignorews, lcs: lcs, sidebar: sidebar, fgcolor:{a:aborder,c:cborder,d:dborder}});
+ $('#compare').mergely('options', {ignorews: ignorews, lcs: lcs, sidebar: sidebar, ignoreunchanged: ignoreunchanged, fgcolor:{a:aborder,c:cborder,d:dborder}});
$('#compare').mergely('cm', 'lhs').setOption('lineWrapping', wraplines);
$('#compare').mergely('cm', 'rhs').setOption('lineWrapping', wraplines);
$('#compare').mergely('cm', 'lhs').setOption('readOnly', readonly);
diff --git a/examples/example2.html b/examples/ajax.html
similarity index 100%
rename from examples/example2.html
rename to examples/ajax.html
diff --git a/examples/example3.html b/examples/example3.html
deleted file mode 100644
index ba9f012..0000000
--- a/examples/example3.html
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
- Mergely - Simple Example
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/examples/lhs_long.txt b/examples/lhs_long.txt
deleted file mode 100644
index d155599..0000000
--- a/examples/lhs_long.txt
+++ /dev/null
@@ -1 +0,0 @@
-the quick red fox jumped over the hairy dog on a cold, wet, and windy day in January
diff --git a/examples/rhs_long.txt b/examples/rhs_long.txt
deleted file mode 100644
index 2c3f250..0000000
--- a/examples/rhs_long.txt
+++ /dev/null
@@ -1 +0,0 @@
-the quick brown fox jumped over the lazy dog on a cold, wet, and windy day in December
diff --git a/examples/example1.html b/examples/simple.html
similarity index 100%
rename from examples/example1.html
rename to examples/simple.html
diff --git a/examples/example4.html b/examples/size.html
similarity index 88%
rename from examples/example4.html
rename to examples/size.html
index c8dc82e..4110515 100755
--- a/examples/example4.html
+++ b/examples/size.html
@@ -57,24 +57,36 @@ This example demonstrates how to enable line wrapping
lineWrapping: true,
}
});
+ $('#compare5').mergely({
+ width: 'auto',
+ height: 200,
+ autoresize: false,
+ cmsettings: {
+ readOnly: false,
+ lineWrapping: true,
+ }
+ });
+
$.ajax({
type: 'GET', async: true, dataType: 'text',
- url: 'lhs_long.txt',
+ url: 'lhs.txt',
success: function (response) {
$('#compare1').mergely('lhs', response);
$('#compare2').mergely('lhs', response);
$('#compare3').mergely('lhs', response);
$('#compare4').mergely('lhs', response);
+ $('#compare5').mergely('lhs', response);
}
});
$.ajax({
type: 'GET', async: true, dataType: 'text',
- url: 'rhs_long.txt',
+ url: 'rhs.txt',
success: function (response) {
$('#compare1').mergely('rhs', response);
$('#compare2').mergely('rhs', response);
$('#compare3').mergely('rhs', response);
$('#compare4').mergely('rhs', response);
+ $('#compare5').mergely('rhs', response);
}
});
});
@@ -91,6 +103,8 @@ This example demonstrates how to enable line wrapping
|
+
+