~ubuntu-branches/ubuntu/quantal/yelp-xsl/quantal

« back to all changes in this revision

Viewing changes to js/jquery.syntax.brush.diff.js

  • Committer: Bazaar Package Importer
  • Author(s): Michael Terry
  • Date: 2011-07-09 10:02:21 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20110709100221-5ys7oh9pzgyaaoo4
Tags: 3.1.2-0ubuntu1
* New upstream release.
* debian/control.in:
  - Build-Depend on itstool
  - Point at Ubuntu's branch
* debian/watch:
  - Fix URL

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// brush: "diff" aliases: ["patch"]
2
2
 
3
 
//      This file is part of the "jQuery.Syntax" project, and is licensed under the GNU AGPLv3.
4
 
//      Copyright 2010 Samuel Williams. All rights reserved.
 
3
//      This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
 
4
//      Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
5
5
//      See <jquery.syntax.js> for licensing details.
6
6
 
7
7
Syntax.register('diff', function(brush) {
12
12
        
13
13
        brush.push({pattern: /^\+[^\+]{1}.*$/gm, klass: 'insert'});
14
14
        brush.push({pattern: /^\-[^\-]{1}.*$/gm, klass: 'remove'});
 
15
        
 
16
        brush.postprocess = function (options, html, container) {
 
17
                $('.insert', html).closest('.source').addClass('insert-line');
 
18
                $('.remove', html).closest('.source').addClass('remove-line');
 
19
                $('.offset', html).closest('.source').addClass('offset-line');
 
20
                
 
21
                return html;
 
22
        };
15
23
});
16
24