mirror of
https://github.com/QingdaoU/Spirit.git
synced 2024-12-29 16:02:04 +00:00
comment.history html diff
This commit is contained in:
parent
bcbd6eb120
commit
4da1f098b6
@ -46,6 +46,7 @@ gulp.task('coffee', function() {
|
||||
pathVendors + 'atwho/jquery.caret.min.js',
|
||||
pathVendors + 'atwho/jquery.atwho.min.js',
|
||||
pathVendors + '**/*.js',
|
||||
pathVendors + '**/*.coffee',
|
||||
pathCoffee + 'util.coffee',
|
||||
pathCoffee + 'tab.coffee',
|
||||
pathCoffee + 'editor_image_upload.coffee',
|
||||
|
@ -53,6 +53,8 @@
|
||||
|
||||
hljs.initHighlightingOnLoad();
|
||||
|
||||
$('.comment-text').comment_diff();
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
374
spirit/core/static/spirit/scripts/all.min.js
vendored
374
spirit/core/static/spirit/scripts/all.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
29
spirit/core/static/spirit/scripts/js/comments_diff.no-min.js
vendored
Normal file
29
spirit/core/static/spirit/scripts/js/comments_diff.no-min.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
|
||||
/*
|
||||
HTML diff for the comment history
|
||||
requires htmldiff
|
||||
*/
|
||||
|
||||
(function() {
|
||||
var $;
|
||||
|
||||
$ = jQuery;
|
||||
|
||||
$.fn.extend({
|
||||
comment_diff: function() {
|
||||
var curr, prev;
|
||||
prev = null;
|
||||
curr = null;
|
||||
return this.each(function() {
|
||||
var diff;
|
||||
curr = $(this).html();
|
||||
if (prev != null) {
|
||||
diff = htmldiff(prev, curr);
|
||||
$(this).html(diff);
|
||||
}
|
||||
return prev = curr;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}).call(this);
|
22
spirit/core/static/spirit/scripts/src/comments_diff.coffee
Normal file
22
spirit/core/static/spirit/scripts/src/comments_diff.coffee
Normal file
@ -0,0 +1,22 @@
|
||||
###
|
||||
HTML diff for the comment history
|
||||
requires htmldiff
|
||||
###
|
||||
|
||||
$ = jQuery
|
||||
|
||||
|
||||
$.fn.extend
|
||||
comment_diff: ->
|
||||
prev = null
|
||||
curr = null
|
||||
|
||||
@each( ->
|
||||
curr = $(@).html()
|
||||
|
||||
if prev?
|
||||
diff = htmldiff(prev, curr)
|
||||
$(@).html(diff)
|
||||
|
||||
prev = curr;
|
||||
)
|
19
spirit/core/static/spirit/scripts/vendors/htmldiff/LICENSE
vendored
Normal file
19
spirit/core/static/spirit/scripts/vendors/htmldiff/LICENSE
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
Copyright (c) 2012 The Network Inc. and contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
@ -267,6 +267,16 @@ input.move-comment-checkbox {
|
||||
img {
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
|
||||
ins {
|
||||
background-color: #EAFFEA;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
del {
|
||||
background-color: #FFECEC;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
.comment-actions {
|
||||
|
File diff suppressed because one or more lines are too long
@ -940,6 +940,13 @@ input.move-comment-checkbox {
|
||||
margin-bottom: 24px; }
|
||||
.comment-text img {
|
||||
vertical-align: text-bottom; }
|
||||
.comment-text ins {
|
||||
background-color: #EAFFEA;
|
||||
text-decoration: none;
|
||||
line-height: 26px; }
|
||||
.comment-text del {
|
||||
background-color: #FFECEC;
|
||||
text-decoration: none; }
|
||||
|
||||
.comment-actions {
|
||||
font-size: 14px;
|
||||
|
Loading…
Reference in New Issue
Block a user