diff options
author | Alex Goodman <wgoodman@goodbox.(none)> | 2015-04-25 00:09:50 -0400 |
---|---|---|
committer | Alex Goodman <wgoodman@goodbox.(none)> | 2015-04-25 00:09:50 -0400 |
commit | 2c44bb77c7f241415a2101f6cb33edcdf976d622 (patch) | |
tree | 437f2169f86613e76a668b99c822370773088970 /deps/diff.js | |
parent | 00acacb129c7458a4090f22739c2ede00959b0de (diff) | |
download | wsdiff-2c44bb77c7f241415a2101f6cb33edcdf976d622.tar.gz wsdiff-2c44bb77c7f241415a2101f6cb33edcdf976d622.tar.bz2 wsdiff-2c44bb77c7f241415a2101f6cb33edcdf976d622.zip |
initial commit
Diffstat (limited to 'deps/diff.js')
-rw-r--r-- | deps/diff.js | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/deps/diff.js b/deps/diff.js new file mode 100644 index 0000000..b4141d9 --- /dev/null +++ b/deps/diff.js @@ -0,0 +1,103 @@ +$( document ).ready(function() {
+
+
+
+ // selector cache
+ var
+ $showoriginal = $('.menuoption#showoriginal'),
+ $showmodified = $('.menuoption#showmodified'),
+ $codeprintmargin = $('.menuoption#codeprintmargin'),
+ $highlight = $('.menuoption#highlight'),
+ $dosyntaxhighlight = $('.menuoption#dosyntaxhighlight');
+
+ $showoriginal.state = true
+ $showoriginal.on("click", function(){
+ switch ($showoriginal.state) {
+ case false:
+ $('#leftcode').show()
+ $('.right_diff_del').show()
+ $('.lineno_rightdel').show()
+ $showoriginal.state = true
+ break;
+ case true:
+ $('#leftcode').hide()
+ $('.right_diff_del').hide()
+ $('.lineno_rightdel').hide()
+ $showoriginal.state = false
+ break;
+ }
+ });
+
+ $showmodified.state = true
+ $showmodified.on("click", function(){
+ switch ($showmodified.state) {
+ case false:
+ $('#rightcode').show()
+ $('.left_diff_add').show()
+ $('.lineno_leftadd').show()
+ $showmodified.state = true
+ break;
+ case true:
+ $('#rightcode').hide()
+ $('.left_diff_add').hide()
+ $('.lineno_leftadd').hide()
+ $showmodified.state = false
+ break;
+ }
+ });
+
+
+ $codeprintmargin.state = true
+ $codeprintmargin.on("click", function(){
+ switch ($codeprintmargin.state) {
+ case false:
+ $('.printmargin').show()
+ $codeprintmargin.state = true
+ break;
+ case true:
+ $('.printmargin').hide()
+ $codeprintmargin.state = false
+ break;
+ }
+ });
+
+
+ $highlight.state = true
+ $highlight.on("click", function(){
+ switch ($highlight.state) {
+ case false:
+ $('.left_diff_change').removeClass('clearbg');
+ $('.left_diff_del').removeClass('clearbg');
+
+ $('.right_diff_add').removeClass('clearbg');
+ $('.right_diff_change').removeClass('clearbg');
+ $highlight.state = true
+ break;
+ case true:
+ $('.left_diff_change').addClass('clearbg');
+ $('.left_diff_del').addClass('clearbg');
+
+ $('.right_diff_add').addClass('clearbg');
+ $('.right_diff_change').addClass('clearbg');
+ $highlight.state = false
+ break;
+ }
+ });
+
+ var originalStyle = $("link.syntaxdef").attr("href")
+ $dosyntaxhighlight.state = true
+ $dosyntaxhighlight.on("click", function(){
+ switch ($dosyntaxhighlight.state) {
+ case false:
+ $("link.syntaxdef").attr("href", originalStyle);
+ $dosyntaxhighlight.state = true
+ break;
+ case true:
+ $("link.syntaxdef").attr("href","/deps/codeformats/bw.css");
+ $dosyntaxhighlight.state = false
+ break;
+ }
+ });
+
+
+});
\ No newline at end of file |