Changeset - fb9550946c26
[Not reviewed]
default
0 58 0
Mads Kiilerich - 6 years ago 2020-02-17 17:49:45
mads@kiilerich.com
Grafted from: edc09f90d6f0
js: use strict ... and fix the problems it points out

"use strict" gives stricter checks, both statically and at runtime. The
strictness tightens up the code and prevents some kinds of problems.

The <script> tag addition might not be pretty, but has consistently been added
with:

sed -i 's,<script>$,&'"'"'use strict'"'"';,g' `hg loc '*.html'`
58 files changed with 105 insertions and 101 deletions:
0 comments (0 inline, 0 general)
kallithea/public/fontello/demo.html
Show inline comments
 
@@ -267,25 +267,25 @@ body {
 
      /* You can be more comfortable with increased icons size */
 
      /* font-size: 120%; */
 
     
 
      /* Font smoothing. That was taken from TWBS */
 
      -webkit-font-smoothing: antialiased;
 
      -moz-osx-font-smoothing: grayscale;
 
     
 
      /* Uncomment for 3D effect */
 
      /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
 
    }
 
     </style>
 
    <link rel="stylesheet" href="css/animation.css"><!--[if IE 7]><link rel="stylesheet" href="css/kallithea-ie7.css"><![endif]-->
 
    <script>
 
    <script>'use strict';
 
      function toggleCodes(on) {
 
        var obj = document.getElementById('icons');
 
      
 
        if (on) {
 
          obj.className += ' codesOn';
 
        } else {
 
          obj.className = obj.className.replace(' codesOn', '');
 
        }
 
      }
 
      
 
    </script>
 
  </head>
kallithea/public/js/codemirror_loadmode.js
Show inline comments
 
'use strict';
 

	
 
(function() {
 
  var loading = {};
 
  function splitCallback(cont, n) {
 
    var countDown = n;
 
    return function() { if (--countDown == 0) cont(); };
 
  }
 
  function ensureDeps(mode, cont) {
 
    var deps = CodeMirror.modes[mode].dependencies;
 
    if (!deps) return cont();
 
    var missing = [];
 
    for (var i = 0; i < deps.length; ++i) {
 
      if (!CodeMirror.modes.hasOwnProperty(deps[i]))
kallithea/public/js/graph.js
Show inline comments
 
'use strict';
 

	
 
// branch_renderer.js - Rendering of branch DAGs on the client side
 
//
 
// Copyright 2010 Marcin Kuzminski <marcin AT python-works DOT com>
 
// Copyright 2008 Jesper Noehr <jesper AT noehr DOT org>
 
// Copyright 2008 Dirkjan Ochtman <dirkjan AT ochtman DOT nl>
 
// Copyright 2006 Alexander Schremmer <alex AT alexanderweb DOT de>
 
//
 
// derived from code written by Scott James Remnant <scott@ubuntu.com>
 
// Copyright 2005 Canonical Ltd.
 
//
 
// This software may be used and distributed according to the terms
 
// of the GNU General Public License, incorporated herein by reference.
 
@@ -93,55 +95,55 @@ function BranchRenderer(canvas_id, conte
 
		var box_size = Math.min(18, (canvasWidth - edge_pad * 2) / lineCount);
 
		var base_x = canvasWidth - edge_pad;
 

	
 
		for (var i=0; i < data.length; ++i) {
 
			var row = document.getElementById(row_id_prefix+idx);
 
			if (row == null) {
 
				console.log("error: row "+row_id_prefix+idx+" not found");
 
				continue;
 
			}
 
			var next = document.getElementById(row_id_prefix+(idx+1));
 
			var extra = 0;
 

	
 
			cur = data[i];
 
			node = cur[0];
 
			in_l = cur[1];
 
			closing = cur[2];
 
			obsolete_node = cur[3];
 
			bumped_node = cur[4];
 
			divergent_node = cur[5];
 
			extinct_node = cur[6];
 
			unstable_node = cur[7];
 
			const cur = data[i];
 
			const node = cur[0];
 
			const in_l = cur[1];
 
			const closing = cur[2];
 
			const obsolete_node = cur[3];
 
			const bumped_node = cur[4];
 
			const divergent_node = cur[5];
 
			const extinct_node = cur[6];
 
			const unstable_node = cur[7];
 

	
 
			// center dots on the first element in a td (not necessarily the first one, but there must be one)
 
			var firstincell = $(row).find('td>*:visible')[0];
 
			var nextFirstincell = $(next).find('td>*:visible')[0];
 
			var rowY = Math.floor(row.offsetTop + firstincell.offsetTop + firstincell.offsetHeight/2);
 
			var nextY = Math.floor((next == null) ? rowY + row.offsetHeight/2 : next.offsetTop + nextFirstincell.offsetTop + nextFirstincell.offsetHeight/2);
 

	
 
			for (var j in in_l) {
 
				line = in_l[j];
 
				start = line[0];
 
				end = line[1];
 
				color = line[2];
 
				obsolete_line = line[3];
 
				const line = in_l[j];
 
				const start = line[0];
 
				const end = line[1];
 
				const color = line[2];
 
				const obsolete_line = line[3];
 

	
 
				x = Math.floor(base_x - box_size * start);
 
				const x = Math.floor(base_x - box_size * start);
 

	
 
				// figure out if this is a dead-end;
 
				// we want to fade away this line
 
				var dead_end = true;
 
				if (next != null) {
 
					nextdata = data[i+1];
 
					next_l = nextdata[1];
 
					const nextdata = data[i+1];
 
					const next_l = nextdata[1];
 
					for (var k=0; k < next_l.length; ++k) {
 
						if (next_l[k][0] == end) {
 
							dead_end = false;
 
							break;
 
						}
 
					}
 
					if (nextdata[0][0] == end) // this is a root - not a dead end
 
						dead_end = false;
 
				}
 

	
 
				if (dead_end) {
 
					var gradient = this.ctx.createLinearGradient(x,rowY,x,nextY);
 
@@ -183,36 +185,36 @@ function BranchRenderer(canvas_id, conte
 
					var x2 = Math.floor(base_x - box_size * end);
 
					var ymid = (rowY+nextY) / 2;
 
					if (obsolete_node)
 
					{
 
						this.ctx.setLineDash([5]);
 
					}
 
					this.ctx.bezierCurveTo (x,ymid,x2,ymid,x2,nextY);
 
				}
 
				this.ctx.stroke();
 
				this.ctx.setLineDash([]); // reset the dashed line, if any
 
			}
 

	
 
			column = node[0];
 
			color = node[1];
 
			const column = node[0];
 
			const color = node[1];
 

	
 
			x = Math.floor(base_x - box_size * column);
 
			const x = Math.floor(base_x - box_size * column);
 

	
 
			this.setColor(color, 0.25, 0.75);
 
			if(unstable_node)
 
			{
 
				this.ctx.fillStyle = 'rgb(255, 0, 0)';
 
			}
 

	
 
			r = this.dot_radius
 
			let r = this.dot_radius
 
			if (obsolete_node)
 
			{
 
				this.ctx.beginPath();
 
				this.ctx.moveTo(x - this.close_x, rowY - this.close_y - 3);
 
				this.ctx.lineTo(x - this.close_x + 2*this.close_x, rowY - this.close_y + 4*this.close_y - 1);
 
				this.ctx.moveTo(x - this.close_x, rowY - this.close_y + 4*this.close_y - 1);
 
				this.ctx.lineTo(x - this.close_x + 2*this.close_x, rowY - this.close_y - 3);
 
				this.ctx.stroke();
 
				r -= 0.5
 
			}
 
			if (closing)
 
			{
kallithea/templates/admin/admin.html
Show inline comments
 
@@ -18,25 +18,25 @@
 
    ${self.menu('admin')}
 
</%block>
 
<%def name="main()">
 
<div class="panel panel-primary">
 
    <div class="panel-heading clearfix">
 
        ${self.breadcrumbs()}
 
    </div>
 
    <div id="user_log" class="panel-body">
 
            <%include file='admin_log.html'/>
 
    </div>
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
$(document).ready(function() {
 
  $('#j_filter').click(function(){
 
    var $jfilter = $('#j_filter');
 
    if($jfilter.hasClass('initial')){
 
        $jfilter.val('');
 
    }
 
  });
 
  var fix_j_filter_width = function(len){
 
      $('#j_filter').css('width', Math.max(80, len*6.50)+'px');
 
  };
 
  $('#j_filter').keyup(function () {
 
    fix_j_filter_width($('#j_filter').val().length);
kallithea/templates/admin/admin_log.html
Show inline comments
 
@@ -28,25 +28,25 @@
 
              ${h.link_to(l.repository.repo_name,h.url('summary_home',repo_name=l.repository.repo_name))}
 
            %else:
 
              ${l.repository_name}
 
            %endif
 
        </td>
 

	
 
        <td>${h.fmt_date(l.action_date)}</td>
 
        <td>${l.user_ip}</td>
 
    </tr>
 
    %endfor
 
</table>
 

	
 
<script>
 
<script>'use strict';
 
  $(document).ready(function(){
 
    var $user_log = $('#user_log');
 
    $user_log.on('click','.pager_link',function(e){
 
      asynchtml(e.target.href, $user_log, function(){
 
        show_more_event();
 
        tooltip_activate();
 
      });
 
      e.preventDefault();
 
    });
 
    $user_log.on('click','.show_more',function(e){
 
      var el = e.target;
 
      $('#'+el.id.substring(1)).show();
kallithea/templates/admin/auth/auth_settings.html
Show inline comments
 
@@ -96,25 +96,25 @@
 
            %endif
 
        %endfor
 
    %endfor
 
            <div class="form-group">
 
                <div class="buttons">
 
                    ${h.submit('save',_('Save'),class_="btn btn-default")}
 
                </div>
 
            </div>
 
    ${h.end_form()}
 
    </div>
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
    $('.toggle-plugin').click(function(e){
 
        var $auth_plugins_input = $('#auth_plugins');
 
        var notEmpty = function(element, index, array) {
 
            return (element != "");
 
        }
 
        var elems = $auth_plugins_input.val().split(',').filter(notEmpty);
 
        var $cur_button = $(e.currentTarget);
 
        var plugin_id = $cur_button.data('plugin_id');
 

	
 
        if($cur_button.hasClass('active')){
 
            elems.splice(elems.indexOf(plugin_id), 1);
 
            $auth_plugins_input.val(elems.join(','));
kallithea/templates/admin/gists/edit.html
Show inline comments
 
@@ -26,25 +26,25 @@
 
<div class="panel panel-primary">
 
    <div class="panel-heading clearfix">
 
        ${self.breadcrumbs()}
 
    </div>
 

	
 
    <div class="panel-body">
 
        <div id="edit_error" style="display: none" class="flash_msg">
 
            <div class="alert alert-dismissable alert-warning">
 
              <button type="button" class="close" data-dismiss="alert" aria-hidden="true"><i class="icon-cancel-circled"></i></button>
 
              ${(h.HTML(_('Gist was updated since you started editing. Copy your changes and click %(here)s to reload new version.'))
 
                             % {'here': h.link_to(_('here'),h.url('edit_gist', gist_id=c.gist.gist_access_id))})}
 
            </div>
 
            <script>
 
            <script>'use strict';
 
            if (typeof jQuery != 'undefined') {
 
                $(".alert").alert();
 
            }
 
            </script>
 
        </div>
 

	
 
        <div id="files_data">
 
          ${h.form(h.url('edit_gist', gist_id=c.gist.gist_access_id), method='post', id='eform')}
 
            <div>
 
                <input type="hidden" value="${c.file_changeset.raw_id}" name="parent_hash">
 
                <textarea class="form-control"
 
                          id="description" name="description"
 
@@ -70,25 +70,25 @@
 
                        <input type="hidden" value="${file.path}" name="org_files">
 
                        <input class="form-control" id="filename_${h.FID('f',file.path)}" name="files" size="30" type="text" value="${file.path}">
 
                        <select class="form-control" id="mimetype_${h.FID('f',file.path)}" name="mimetypes"></select>
 
                    </div>
 
                    <div class="panel-body no-padding">
 
                        <div id="editor_container">
 
                            <textarea id="editor_${h.FID('f',file.path)}" name="contents" style="display:none">${safe_str(file.content)}</textarea>
 
                        </div>
 
                    </div>
 
                </div>
 

	
 
                ## dynamic edit box.
 
                <script>
 
                <script>'use strict';
 
                    $(document).ready(function(){
 
                        var myCodeMirror = initCodeMirror(${h.js('editor_' + h.FID('f',file.path))}, ${h.jshtml(request.script_name)}, '');
 

	
 
                        //inject new modes
 
                        var $mimetype_select = $(${h.js('#mimetype_' + h.FID('f',file.path))});
 
                        $mimetype_select.each(function(){
 
                            var modes_select = this;
 
                            var index = 1;
 
                            for(var i=0;i<CodeMirror.modeInfo.length;i++) {
 
                                var m = CodeMirror.modeInfo[i];
 
                                var opt = new Option(m.name, m.mime);
 
                                $(opt).attr('mode', m.mode);
 
@@ -137,25 +137,25 @@
 
                            $mimetype_select.val(detected_mode.mime);
 
                        }
 
                    });
 
                </script>
 

	
 
            %endfor
 

	
 
            <div>
 
            ${h.submit('update',_('Update Gist'),class_="btn btn-success")}
 
            <a class="btn btn-default" href="${h.url('gist', gist_id=c.gist.gist_access_id)}">${_('Cancel')}</a>
 
            </div>
 
          ${h.end_form()}
 
          <script>
 
          <script>'use strict';
 
              $('#update').on('click', function(e){
 
                  e.preventDefault();
 

	
 
                  // check for newer version.
 
                  $.ajax({
 
                    url: ${h.js(h.url('edit_gist_check_revision', gist_id=c.gist.gist_access_id))},
 
                    data: {'revision': ${h.js(c.file_changeset.raw_id)}, '_session_csrf_secret_token': _session_csrf_secret_token},
 
                    dataType: 'json',
 
                    type: 'POST',
 
                    success: function(data) {
 
                      if(data.success == false){
 
                          $('#edit_error').show();
kallithea/templates/admin/gists/new.html
Show inline comments
 
@@ -46,25 +46,25 @@
 
                    <select class="form-control" id="mimetype" name="mimetype"></select>
 
                </div>
 
                <div class="panel-body no-padding">
 
                        <textarea id="editor" name="content"></textarea>
 
                </div>
 
            </div>
 
            <div>
 
            ${h.submit('private',_('Create Private Gist'),class_="btn btn-success btn-xs")}
 
            ${h.submit('public',_('Create Public Gist'),class_="btn btn-default btn-xs")}
 
            ${h.reset('reset',_('Reset'),class_="btn btn-default btn-xs")}
 
            </div>
 
          ${h.end_form()}
 
          <script>
 
          <script>'use strict';
 
            $(document).ready(function(){
 
                var myCodeMirror = initCodeMirror('editor', ${h.jshtml(request.script_name)}, '');
 

	
 
                //inject new modes
 
                var $mimetype_select = $('#mimetype');
 
                $mimetype_select.each(function(){
 
                    var modes_select = this;
 
                    var index = 1;
 
                    for(var i=0;i<CodeMirror.modeInfo.length;i++) {
 
                        var m = CodeMirror.modeInfo[i];
 
                        var opt = new Option(m.name, m.mime);
 
                        $(opt).attr('mode', m.mode);
kallithea/templates/admin/my_account/my_account_api_keys.html
Show inline comments
 
@@ -81,19 +81,19 @@
 
<p>${_('''
 
API keys are used to let scripts or services access %s using your
 
account, as if you had provided the script or service with your actual
 
password.
 
''') % (c.site_name or 'Kallithea')}</p>
 
<p>${_('''
 
Like passwords, API keys should therefore never be shared with others,
 
nor passed to untrusted scripts or services. If such sharing should
 
happen anyway, reset the API key on this page to prevent further use.
 
''')}</p>
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        $("#lifetime").select2({
 
            'dropdownAutoWidth': true
 
        });
 
    });
 
</script>
kallithea/templates/admin/my_account/my_account_repos.html
Show inline comments
 
<h4>${_('Repositories You Own')}</h4>
 

	
 
<div>
 
    <table class="table" id="datatable_list_wrap" width="100%"></table>
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
  var data = ${h.js(c.data)};
 
  var myDataTable = $("#datatable_list_wrap").DataTable({
 
        data: data.records,
 
        columns: [
 
            {data: "raw_name", "visible": false, searchable: false},
 
            {data: "name", "orderData": 1, title: ${h.jshtml(_('Name'))}},
 
            {data: "last_rev_raw", "visible": false, searchable: false},
 
            {data: "last_changeset", "orderData": 3, title: ${h.jshtml(_('Tip'))}, searchable: false},
 
            {data: "action", title: ${h.jshtml(_('Action'))}, sortable: false, searchable: false}
 
        ],
 
        order: [[2, "asc"]],
 
        dom: '<"dataTables_left"f><"dataTables_right"ip>t',
kallithea/templates/admin/my_account/my_account_watched.html
Show inline comments
 
<h4>${_('Repositories You are Watching')}</h4>
 

	
 
<div>
 
    <table class="table" id="datatable_list_wrap" width="100%"></table>
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
  var data = ${h.js(c.data)};
 
  var myDataTable = $("#datatable_list_wrap").DataTable({
 
        data: data.records,
 
        columns: [
 
            {data: "raw_name", "visible": false, searchable: false},
 
            {data: "name", "orderData": 1, title: ${h.jshtml(_('Name'))}},
 
            {data: "last_rev_raw", "visible": false, searchable: false},
 
            {data: "last_changeset", "orderData": 3, title: ${h.jshtml(_('Tip'))}, searchable: false},
 
        ],
 
        order: [[2, "asc"]],
 
        dom: '<"dataTables_left"f><"dataTables_right"ip>t',
 
        pageLength: 100
kallithea/templates/admin/repo_groups/repo_group_add.html
Show inline comments
 
@@ -52,25 +52,25 @@
 
                    <span class="help-block">${_('Copy permission set from parent repository group.')}</span>
 
                </div>
 
            </div>
 

	
 
            <div class="form-group">
 
                <div class="buttons">
 
                    ${h.submit('save',_('Save'),class_="btn btn-default")}
 
                </div>
 
            </div>
 
    </div>
 
    ${h.end_form()}
 
</div>
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        var setCopyPermsOption = function(group_val){
 
            if(group_val != "-1"){
 
                $('#copy_perms').show();
 
            }
 
            else{
 
                $('#copy_perms').hide();
 
            }
 
        }
 
        $("#parent_group_id").select2({
 
            'dropdownAutoWidth': true
 
        });
kallithea/templates/admin/repo_groups/repo_group_edit_perms.html
Show inline comments
 
@@ -93,27 +93,27 @@ ${h.form(url('edit_repo_group_perms', gr
 
                    </td>
 
                </tr>
 
            </table>
 
        </div>
 
        <div class="buttons">
 
            ${h.submit('save',_('Save'),class_="btn btn-default")}
 
            ${h.reset('reset',_('Reset'),class_="btn btn-default")}
 
        </div>
 
    </div>
 
</div>
 
${h.end_form()}
 

	
 
<script>
 
<script>'use strict';
 
    function ajaxActionRevoke(obj_id, obj_type, field_id, obj_name) {
 
        url = ${h.jshtml(h.url('edit_repo_group_perms_delete', group_name=c.repo_group.group_name))};
 
        let url = ${h.jshtml(h.url('edit_repo_group_perms_delete', group_name=c.repo_group.group_name))};
 
        var revoke_msg = _TM['Confirm to revoke permission for {0}: {1} ?'].format(obj_type.replace('_', ' '), obj_name);
 
        if (confirm(revoke_msg)){
 
            var recursive = $('input[name=recursive]:checked').val();
 
            ajaxActionRevokePermission(url, obj_id, obj_type, field_id, {recursive:recursive});
 
        }
 
    };
 

	
 
    $(document).ready(function () {
 
        if (!$('#perm_new_member_name').hasClass('error')) {
 
            $('#add_perm_input').hide();
 
        }
 
        $('#add_perm').click(function () {
kallithea/templates/admin/repo_groups/repo_group_edit_settings.html
Show inline comments
 
@@ -32,19 +32,19 @@ ${h.form(url('update_repos_group',group_
 
${h.end_form()}
 

	
 
${h.form(url('delete_repo_group', group_name=c.repo_group.group_name))}
 
<div class="form">
 
        <div class="form-group">
 
            <div class="buttons">
 
                ${h.submit('remove_%s' % c.repo_group.group_name,_('Remove this group'),class_="btn btn-danger",onclick="return confirm('"+_('Confirm to delete this group')+"');")}
 
            </div>
 
        </div>
 
</div>
 
${h.end_form()}
 

	
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        $("#parent_group_id").select2({
 
            'dropdownAutoWidth': true
 
        });
 
    });
 
</script>
kallithea/templates/admin/repo_groups/repo_groups.html
Show inline comments
 
@@ -21,25 +21,25 @@
 
            ${self.breadcrumbs()}
 
        </div>
 
        <div class="pull-right">
 
            %if h.HasPermissionAny('hg.admin')():
 
               <a href="${h.url('new_repos_group')}" class="btn btn-success btn-xs"><i class="icon-plus"></i>${_('Add Repository Group')}</a>
 
            %endif
 
        </div>
 
    </div>
 
    <div class="panel-body">
 
        <table class="table" id="datatable_list_wrap" width="100%"></table>
 
    </div>
 
</div>
 
<script>
 
<script>'use strict';
 
  var data = ${h.js(c.data)};
 
  var myDataTable = $("#datatable_list_wrap").DataTable({
 
        data: data.records,
 
        columns: [
 
            {data: "raw_name", visible: false, searchable: false},
 
            {data: "group_name", orderData: 0, title: ${h.jshtml(_('Name'))}},
 
            {data: "desc", title: ${h.jshtml(_('Description'))}, searchable: false},
 
            {data: "repos", title: ${h.jshtml(_('Number of Top-level Repositories'))}, searchable: false},
 
            {data: "owner", title: ${h.jshtml(_('Owner'))}, searchable: false},
 
            {data: "action", title: ${h.jshtml(_('Action'))}, sortable: false, searchable: false}
 
        ],
 
        drawCallback: updateRowCountCallback($("#repo_group_count")),
kallithea/templates/admin/repos/repo_add_base.html
Show inline comments
 
@@ -56,25 +56,25 @@ ${h.form(url('repos'))}
 
            <label class="control-label" for="repo_private">${_('Private repository')}:</label>
 
            <div>
 
                ${h.checkbox('repo_private',value="True")}
 
                <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span>
 
            </div>
 
        </div>
 
        <div class="form-group">
 
            <div class="buttons">
 
                ${h.submit('add',_('Add'),class_="btn btn-default")}
 
            </div>
 
        </div>
 
</div>
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        var setCopyPermsOption = function(group_val){
 
            if(group_val != "-1"){
 
                $('#copy_perms').show();
 
            }
 
            else{
 
                $('#copy_perms').hide();
 
            }
 
        }
 

	
 
        $("#repo_group").select2({
 
            'dropdownAutoWidth': true
kallithea/templates/admin/repos/repo_creating.html
Show inline comments
 
@@ -33,25 +33,25 @@
 
                    aria-valuenow="100" aria-valuemin="0" aria-valuemax="100">
 
                </div>
 
            </div>
 
        </div>
 
        <div id="progress_error" style="display: none;">
 
            <div class="alert alert-danger">
 
                ${_("We're sorry but error occurred during this operation. Please check your Kallithea server logs, or contact administrator.")}
 
            </div>
 
        </div>
 
    </div>
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
(function worker() {
 
  $.ajax({
 
    url: ${h.js(h.url('repo_check_home', repo_name=c.repo_name, repo=c.repo, task_id=c.task_id))},
 
    success: function(data) {
 
      if(data.result === true){
 
          //redirect to created fork if our ajax loop tells us to do so.
 
          window.location = ${h.js(h.url('summary_home', repo_name = c.repo))};
 
      }
 
    },
 
    complete: function(resp, status) {
 
      if (resp.status == 200){
 
          // Schedule the next request when the current one's complete
kallithea/templates/admin/repos/repo_edit_advanced.html
Show inline comments
 
<h3>${_('Parent')}</h3>
 
${h.form(url('edit_repo_advanced_fork', repo_name=c.repo_info.repo_name))}
 
<div class="form">
 
       ${h.select('id_fork_of','',c.repos_list)}
 
       ${h.submit('set_as_fork_%s' % c.repo_info.repo_name,_('Set'),class_="btn btn-default btn-sm")}
 
       <div class="text-muted">
 
       ${_('''Manually set this repository as a fork of another from the list.''')}
 
       </div>
 
</div>
 
${h.end_form()}
 

	
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        $("#id_fork_of").select2({
 
            'dropdownAutoWidth': true
 
        });
 
    });
 
</script>
 

	
 
<h3>${_('Public Journal Visibility')}</h3>
 
${h.form(url('edit_repo_advanced_journal', repo_name=c.repo_info.repo_name))}
 
<div class="form">
 
  <div>
 
  %if c.in_public_journal:
kallithea/templates/admin/repos/repo_edit_permissions.html
Show inline comments
 
@@ -78,27 +78,27 @@ ${h.form(url('edit_repo_perms_update', r
 
                        </button>
 
                    </td>
 
                </tr>
 
            </table>
 
        </div>
 
        <div class="form-group">
 
            ${h.submit('save',_('Save'),class_="btn btn-default")}
 
            ${h.reset('reset',_('Reset'),class_="btn btn-default")}
 
        </div>
 
</div>
 
${h.end_form()}
 

	
 
<script>
 
<script>'use strict';
 
    function ajaxActionRevoke(obj_id, obj_type, field_id, obj_name) {
 
        url = ${h.js(h.url('edit_repo_perms_revoke',repo_name=c.repo_name))};
 
        let url = ${h.js(h.url('edit_repo_perms_revoke',repo_name=c.repo_name))};
 
        var revoke_msg = _TM['Confirm to revoke permission for {0}: {1} ?'].format(obj_type.replace('_', ' '), obj_name);
 
        if (confirm(revoke_msg)){
 
            ajaxActionRevokePermission(url, obj_id, obj_type, field_id);
 
        }
 
    };
 

	
 
    $(document).ready(function () {
 
        if (!$('#perm_new_member_name').hasClass('error')) {
 
            $('#add_perm_input').hide();
 
        }
 
        $('#add_perm').click(function () {
 
            addPermAction('repository');
kallithea/templates/admin/repos/repo_edit_settings.html
Show inline comments
 
@@ -94,25 +94,25 @@ ${h.form(url('update_repo', repo_name=c.
 
                 </div>
 
              %endfor
 
            %endif
 
            <div class="form-group">
 
                <div class="buttons">
 
                    ${h.submit('save',_('Save'),class_="btn btn-default")}
 
                    ${h.reset('reset',_('Reset'),class_="btn btn-default")}
 
                </div>
 
            </div>
 
    </div>
 
    ${h.end_form()}
 

	
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        $('#repo_landing_rev').select2({
 
            'dropdownAutoWidth': true
 
        });
 
        $('#repo_group').select2({
 
            'dropdownAutoWidth': true
 
        });
 

	
 
        // autocomplete
 
        SimpleUserAutoComplete($('#owner'));
 
    });
 
</script>
kallithea/templates/admin/repos/repos.html
Show inline comments
 
@@ -20,25 +20,25 @@
 
        </div>
 
        <div class="pull-right">
 
         %if h.HasPermissionAny('hg.admin','hg.create.repository')():
 
            <a href="${h.url('new_repo')}" class="btn btn-success btn-xs"><i class="icon-plus"></i>${_('Add Repository')}</a>
 
         %endif
 
        </div>
 
    </div>
 
    <div class="panel-body">
 
        <table class="table" id="datatable_list_wrap" width="100%"></table>
 
    </div>
 

	
 
</div>
 
<script>
 
<script>'use strict';
 
  var data = ${h.js(c.data)};
 
  var myDataTable = $("#datatable_list_wrap").DataTable({
 
        data: data.records,
 
        columns: [
 
            {data: "raw_name", visible: false, searchable: false},
 
            {data: "name", orderData: 1, title: ${h.jshtml(_('Name'))}},
 
            {data: "desc", title: ${h.jshtml(_('Description'))}, searchable: false},
 
            {data: "last_rev_raw", visible: false, searchable: false},
 
            {data: "last_changeset", orderData: 4, title: ${h.jshtml(_('Tip'))}, searchable: false},
 
            {data: "owner", title: ${h.jshtml(_('Owner'))}, searchable: false},
 
            {data: "state", title: ${h.jshtml(_('State'))}, searchable: false},
 
            {data: "action", title: ${h.jshtml(_('Action'))}, sortable: false, searchable: false}
kallithea/templates/admin/settings/settings_hooks.html
Show inline comments
 
@@ -41,25 +41,25 @@ ${h.form(url('admin_settings_hooks'), me
 
                ${h.text('new_hook_ui_value',size=50,class_='form-control')}
 
            </div>
 
        </div>
 
        <div class="form-group">
 
            <div class="buttons">
 
                ${h.submit('save',_('Save'),class_="btn btn-default")}
 
            </div>
 
        </div>
 
</div>
 
${h.end_form()}
 
% endif
 

	
 
<script>
 
<script>'use strict';
 
function delete_hook(hook_id, field_id) {
 
    var sUrl = ${h.js(h.url('admin_settings_hooks_delete'))};
 
    var success = function (o) {
 
            $('#' + field_id).remove();
 
        };
 
    var failure = function (o) {
 
            alert(${h.js(_('Failed to remove hook'))});
 
        };
 
    var postData = {'hook_id': hook_id};
 
    ajaxPOST(sUrl, postData, success, failure);
 
};
 
</script>
kallithea/templates/admin/settings/settings_vcs.html
Show inline comments
 
@@ -60,21 +60,21 @@ ${h.form(url('admin_settings'), method='
 
            ## form still requires this but we cannot internally change it anyway
 
            ${h.hidden('paths_root_path',size=30,readonly="readonly")}
 
            %endif
 
            <div class="form-group">
 
                <div class="buttons">
 
                    ${h.submit('save',_('Save Settings'),class_="btn btn-default")}
 
                    ${h.reset('reset',_('Reset'),class_="btn btn-default")}
 
                </div>
 
           </div>
 
    </div>
 
    ${h.end_form()}
 

	
 
    <script>
 
    <script>'use strict';
 
        $(document).ready(function(){
 
            $('#path_unlock').on('click', function(e){
 
                $('#path_unlock_icon').removeClass('icon-lock');
 
                $('#path_unlock_icon').addClass('icon-lock-open-alt');
 
                $('#paths_root_path').removeAttr('readonly');
 
            });
 
        });
 
    </script>
kallithea/templates/admin/user_groups/user_group_add.html
Show inline comments
 
@@ -43,18 +43,18 @@
 
                </div>
 
            </div>
 

	
 
            <div class="form-group">
 
                <div class="buttons">
 
                    ${h.submit('save',_('Save'),class_="btn btn-default")}
 
                </div>
 
            </div>
 
    </div>
 
    ${h.end_form()}
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        $('#users_group_name').focus();
 
    });
 
</script>
 
</%def>
kallithea/templates/admin/user_groups/user_group_edit_perms.html
Show inline comments
 
@@ -83,27 +83,27 @@ ${h.form(url('edit_user_group_perms_upda
 
                    </td>
 
                </tr>
 
            </table>
 
        </div>
 
        <div class="buttons">
 
            ${h.submit('save',_('Save'),class_="btn btn-default")}
 
            ${h.reset('reset',_('Reset'),class_="btn btn-default")}
 
        </div>
 
   </div>
 
</div>
 
${h.end_form()}
 

	
 
<script>
 
<script>'use strict';
 
    function ajaxActionRevoke(obj_id, obj_type, field_id, obj_name) {
 
        url = ${h.js(h.url('edit_user_group_perms_delete', id=c.user_group.users_group_id))};
 
        let url = ${h.js(h.url('edit_user_group_perms_delete', id=c.user_group.users_group_id))};
 
        var revoke_msg = _TM['Confirm to revoke permission for {0}: {1} ?'].format(obj_type.replace('_', ' '), obj_name);
 
        if (confirm(revoke_msg)){
 
            ajaxActionRevokePermission(url, obj_id, obj_type, field_id);
 
        }
 
    };
 

	
 
    $(document).ready(function () {
 
        if (!$('#perm_new_member_name').hasClass('error')) {
 
            $('#add_perm_input').hide();
 
        }
 
        $('#add_perm').click(function () {
 
            addPermAction('usergroup');
kallithea/templates/admin/user_groups/user_group_edit_settings.html
Show inline comments
 
@@ -39,15 +39,15 @@ ${h.form(url('update_users_group', id=c.
 
                            <div class="text">${_('Available members')}</div>
 
                            ${h.select('available_members',[],c.available_members,multiple=True,size=8,style="width:210px",class_='form-control')}
 
                        </div>
 
                    </div>
 
                </div>
 
                <div class="form-group">
 
                    <div class="buttons">
 
                        ${h.submit('Save',_('Save'),class_="btn btn-default")}
 
                    </div>
 
                </div>
 
    </div>
 
${h.end_form()}
 
<script>
 
<script>'use strict';
 
  MultiSelectWidget('users_group_members','available_members','edit_users_group');
 
</script>
kallithea/templates/admin/user_groups/user_groups.html
Show inline comments
 
@@ -20,25 +20,25 @@
 
            ${self.breadcrumbs()}
 
        </div>
 
        <div class="pull-right">
 
        %if h.HasPermissionAny('hg.admin', 'hg.usergroup.create.true')():
 
            <a href="${h.url('new_users_group')}" class="btn btn-success btn-xs"><i class="icon-plus"></i>${_('Add User Group')}</a>
 
        %endif
 
        </div>
 
    </div>
 
    <div class="panel-body">
 
        <table class="table" id="datatable_list_wrap" width="100%"></table>
 
    </div>
 
</div>
 
<script>
 
<script>'use strict';
 
    var data = ${h.js(c.data)};
 
    var $dataTable = $("#datatable_list_wrap").DataTable({
 
        data: data.records,
 
        columns: [
 
            {data: "raw_name", visible: false, searchable: false},
 
            {data: "group_name", title: ${h.jshtml(_('Name'))}, orderData: 0},
 
            {data: "desc", title: ${h.jshtml(_('Description'))}, searchable: false},
 
            {data: "members", title: ${h.jshtml(_('Members'))}, searchable: false},
 
            {data: "active", title: ${h.jshtml(_('Active'))}, searchable: false, 'sType': 'str'},
 
            {data: "owner", title: ${h.jshtml(_('Owner'))}, searchable: false},
 
            {data: "action", title: ${h.jshtml(_('Action'))}, searchable: false, sortable: false}
 
        ],
kallithea/templates/admin/users/user_add.html
Show inline comments
 
@@ -75,18 +75,18 @@
 
            ${h.hidden('extern_type', c.default_extern_type)}
 
            ${h.hidden('extern_name', c.default_extern_name)}
 

	
 
            <div class="form-group">
 
                <div class="buttons">
 
                    ${h.submit('save',_('Save'),class_="btn btn-default")}
 
                </div>
 
            </div>
 
    </div>
 
    ${h.end_form()}
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        $('#username').focus();
 
    });
 
</script>
 
</%def>
kallithea/templates/admin/users/user_edit_api_keys.html
Show inline comments
 
@@ -68,19 +68,19 @@
 
                </div>
 
            </div>
 
            <div class="form-group">
 
                <div class="buttons">
 
                    ${h.submit('save',_('Add'),class_="btn btn-default")}
 
                    ${h.reset('reset',_('Reset'),class_="btn btn-default")}
 
                </div>
 
            </div>
 
    </div>
 
    ${h.end_form()}
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        $("#lifetime").select2({
 
            'dropdownAutoWidth': true
 
        });
 
    });
 
</script>
kallithea/templates/admin/users/users.html
Show inline comments
 
@@ -19,25 +19,25 @@
 
        <div class="pull-left">
 
            ${self.breadcrumbs()}
 
        </div>
 
        <div class="pull-right">
 
            <a href="${h.url('new_user')}" class="btn btn-success btn-xs"><i class="icon-plus"></i>${_('Add User')}</a>
 
        </div>
 
    </div>
 
    <div class="panel-body">
 
        <table class="table" id="datatable_list_wrap" width="100%"></table>
 
    </div>
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
    var data = ${h.js(c.data)};
 
    var $dataTable = $("#datatable_list_wrap").DataTable({
 
        data: data.records,
 
        columns: [
 
            {data: "gravatar", sortable: false, searchable: false},
 
            {data: "username", title: ${h.jshtml(_('Username'))}},
 
            {data: "firstname", title: ${h.jshtml(_('First Name'))}},
 
            {data: "lastname", title: ${h.jshtml(_('Last Name'))}},
 
            {data: "last_login_raw", visible: false, searchable: false},
 
            {data: "last_login", title: ${h.jshtml(_('Last Login'))}, orderData: 4, searchable: false},
 
            {data: "active", title: ${h.jshtml(_('Active'))}, searchable: false, 'sType': 'str'},
 
            {data: "admin", title: ${h.jshtml(_('Admin'))}, searchable: false, 'sType': 'str'},
kallithea/templates/base/base.html
Show inline comments
 
@@ -168,25 +168,25 @@
 
                    <span class="show-following"><i class="icon-heart"></i>${_('Unfollow')}</span>
 
                   </a>
 
                  </li>
 
                  <li><a href="${h.url('repo_fork_home',repo_name=c.repo_name)}"><i class="icon-fork"></i>${_('Fork')}</a></li>
 
                  <li><a href="${h.url('pullrequest_home',repo_name=c.repo_name)}"><i class="icon-git-pull-request"></i>${_('Create Pull Request')}</a></li>
 
              %endif
 
             </ul>
 
        </li>
 
    </ul>
 
    </div>
 
    </div>
 
  </nav>
 
  <script>
 
  <script>'use strict';
 
    $(document).ready(function() {
 
      var bcache = {};
 

	
 
      var branch_switcher_placeholder = '<i class="icon-exchange"></i>' + ${h.jshtml(_('Switch To'))} + ' <span class="caret"></span>';
 
      $("#branch_switcher").select2({
 
          placeholder: branch_switcher_placeholder,
 
          dropdownAutoWidth: true,
 
          sortResults: prefixFirstSort,
 
          formatResult: function(obj) {
 
              return obj.text.html_escape();
 
          },
 
          formatSelection: function(obj) {
 
@@ -390,25 +390,25 @@
 
              ${h.link_to(_('My Account'),h.url('my_account'),class_='list-group-item')}
 
              %if not request.authuser.is_external_auth:
 
                ## Cannot log out if using external (container) authentication.
 
                ${h.link_to(_('Log Out'), h.url('logout_home'),class_='list-group-item')}
 
              %endif
 
            </div>
 
          %endif
 
        </div>
 
      </div>
 
    </li>
 
  </ul>
 

	
 
    <script>
 
    <script>'use strict';
 
        $(document).ready(function(){
 
            var visual_show_public_icon = ${h.js(c.visual.show_public_icon)};
 
            var cache = {}
 
            /*format the look of items in the list*/
 
            var format = function(state){
 
                if (!state.id){
 
                  return state.text.html_escape(); // optgroup
 
                }
 
                var obj_dict = state.obj;
 
                var tmpl = '';
 

	
 
                if(obj_dict && state.type == 'repo'){
 
@@ -518,18 +518,18 @@
 
        </div>
 
    </div>
 

	
 
    <div class="pull-right">
 
        <div class="parent-child-link"
 
             data-ajax-url="${h.url('changeset_children',repo_name=c.repo_name, revision=c.changeset.raw_id)}"
 
             data-linktype="child"
 
             data-reponame="${c.repo_name}">
 
            <a href="#">${_('Child rev.')}</a><i class="icon-right-open"></i>
 
        </div>
 
    </div>
 

	
 
    <script>
 
    <script>'use strict';
 
      $(document).ready(function(){
 
          activate_parent_child_links();
 
      });
 
    </script>
 
</%def>
kallithea/templates/base/flash_msg.html
Show inline comments
 
<div class="flash_msg">
 
    <% messages = h.pop_flash_messages() %>
 
    % if messages:
 
        <% alert_categories = {'warning': 'alert-warning', 'notice': 'alert-info', 'error': 'alert-danger', 'success': 'alert-success'} %>
 
        % for message in messages:
 
            <div class="alert alert-dismissable ${alert_categories[message.category]}" role="alert">
 
              <button type="button" class="close" data-dismiss="alert" aria-hidden="true"><i class="icon-cancel-circled"></i></button>
 
              ${message.message|n}
 
            </div>
 
        % endfor
 
    % endif
 
    <script>
 
    <script>'use strict';
 
    if (typeof jQuery != 'undefined') {
 
        $(".alert").alert();
 
    }
 
    </script>
 
</div>
kallithea/templates/base/perms_summary.html
Show inline comments
 
@@ -88,25 +88,25 @@
 
                      %endif
 
                  </tr>
 
                  %endif
 
              %endfor
 
              <tr id="empty_${section}" style="display: none"><td colspan="${3 if actions else 2}">${_('No permission defined')}</td></tr>
 
              </tbody>
 
          %endif
 
         </table>
 
        </div>
 
        %endif
 
     %endfor
 
</div>
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        var show_empty = function(section){
 
            var visible = $('.section_{0} tr.perm_row:visible'.format(section)).length;
 
            if(visible == 0){
 
                $('#empty_{0}'.format(section)).show();
 
            }
 
            else{
 
                $('#empty_{0}'.format(section)).hide();
 
            }
 
        }
 
        var update_show = function($checkbox){
 
            var section = $checkbox.data('section');
kallithea/templates/base/root.html
Show inline comments
 
@@ -12,25 +12,25 @@
 
        <link rel="icon" type="image/png" href="${h.url('/images/favicon-16x16.png')}" sizes="16x16">
 
        <link rel="apple-touch-icon" sizes="180x180" href="${h.url('/images/apple-touch-icon.png')}">
 
        <link rel="manifest" href="${h.url('/images/manifest.json')}">
 
        <link rel="mask-icon" href="${h.url('/images/safari-pinned-tab.svg')}" color="#b1d579">
 
        <meta name="msapplication-config" content="${h.url('/images/browserconfig.xml')}">
 
        <meta name="theme-color" content="#ffffff">
 

	
 
        ## CSS ###
 
        <link rel="stylesheet" type="text/css" href="${h.url('/css/style.css', ver=c.kallithea_version)}" media="screen"/>
 
        <%block name="css_extra"/>
 

	
 
        ## JAVASCRIPT ##
 
        <script>
 
        <script>'use strict';
 
            ## JS translations map
 
            var TRANSLATION_MAP = {
 
                'Cancel': ${h.jshtml(_("Cancel"))},
 
                'Retry': ${h.jshtml(_("Retry"))},
 
                'Submitting ...': ${h.jshtml(_("Submitting ..."))},
 
                'Unable to post': ${h.jshtml(_("Unable to post"))},
 
                'Add Another Comment': ${h.jshtml(_("Add Another Comment"))},
 
                'Stop following this repository': ${h.jshtml(_('Stop following this repository'))},
 
                'Start following this repository': ${h.jshtml(_('Start following this repository'))},
 
                'Group': ${h.jshtml(_('Group'))},
 
                'Loading ...': ${h.jshtml(_('Loading ...'))},
 
                'loading ...': ${h.jshtml(_('loading ...'))},
 
@@ -68,25 +68,25 @@
 
            var _session_csrf_secret_token = ${h.js(h.session_csrf_secret_token())};
 
        </script>
 
        <script src="${h.url('/js/jquery.min.js', ver=c.kallithea_version)}"></script>
 
        <script src="${h.url('/js/jquery.dataTables.js', ver=c.kallithea_version)}"></script>
 
        <script src="${h.url('/js/dataTables.bootstrap.js', ver=c.kallithea_version)}"></script>
 
        <script src="${h.url('/js/bootstrap.js', ver=c.kallithea_version)}"></script>
 
        <script src="${h.url('/js/select2.js', ver=c.kallithea_version)}"></script>
 
        <script src="${h.url('/js/jquery.caret.min.js', ver=c.kallithea_version)}"></script>
 
        <script src="${h.url('/js/jquery.atwho.min.js', ver=c.kallithea_version)}"></script>
 
        <script src="${h.url('/js/base.js', ver=c.kallithea_version)}"></script>
 
        ## EXTRA FOR JS
 
        <%block name="js_extra"/>
 
        <script>
 
        <script>'use strict';
 
            $(document).ready(function(){
 
              tooltip_activate();
 
              show_more_event();
 
              // routes registration
 
              pyroutes.register('home', ${h.js(h.url('home'))}, []);
 
              pyroutes.register('new_gist', ${h.js(h.url('new_gist'))}, []);
 
              pyroutes.register('gists', ${h.js(h.url('gists'))}, []);
 
              pyroutes.register('new_repo', ${h.js(h.url('new_repo'))}, []);
 

	
 
              pyroutes.register('summary_home', ${h.js(h.url('summary_home', repo_name='%(repo_name)s'))}, ['repo_name']);
 
              pyroutes.register('changelog_home', ${h.js(h.url('changelog_home', repo_name='%(repo_name)s'))}, ['repo_name']);
 
              pyroutes.register('files_home', ${h.js(h.url('files_home', repo_name='%(repo_name)s',revision='%(revision)s',f_path='%(f_path)s'))}, ['repo_name', 'revision', 'f_path']);
kallithea/templates/changelog/changelog.html
Show inline comments
 
@@ -72,25 +72,25 @@ ${self.repo_context_bar('changelog', c.f
 

	
 
                <div id="graph_content" style="${'margin: 0px' if c.changelog_for_path else ''}">
 
                  ${changelog_table.changelog(c.repo_name, c.cs_pagination, c.cs_statuses, c.cs_comments,
 
                                              show_checkbox=not c.changelog_for_path,
 
                                              show_branch=not c.branch_name,
 
                                              resize_js='graph.render(jsdata)')}
 
                  <input type="checkbox" id="singlerange" style="display:none"/>
 
                </div>
 

	
 
                ${c.cs_pagination.pager()}
 

	
 
        <script src="${h.url('/js/graph.js', ver=c.kallithea_version)}"></script>
 
        <script>
 
        <script>'use strict';
 
            var jsdata = ${h.js(c.jsdata)};
 
            var graph = new BranchRenderer('graph_canvas', 'graph_content', 'chg_');
 

	
 
            $(document).ready(function(){
 
                var $checkboxes = $('.changeset_range');
 

	
 
                pyroutes.register('changeset_home', ${h.js(h.url('changeset_home', repo_name='%(repo_name)s', revision='%(revision)s'))}, ['repo_name', 'revision']);
 

	
 
                var checkbox_checker = function(e) {
 
                    var $checked_checkboxes = $checkboxes.filter(':checked');
 
                    var $singlerange = $('#singlerange');
 

	
kallithea/templates/changelog/changelog_table.html
Show inline comments
 
@@ -101,21 +101,21 @@
 
                %for branch in cs.branches:
 
                  <span class="label label-branch" title="${_('Branch %s' % branch)}">${h.link_to(branch,h.url('changelog_home',repo_name=repo_name,branch=branch))}</span>
 
                %endfor
 
              %endif
 
            </div>
 
          </div>
 
        </td>
 
      </tr>
 
      %endfor
 
    </tbody>
 
    </table>
 

	
 
<script>
 
<script>'use strict';
 
  $(document).ready(function() {
 
    $('#changesets .expand_commit').on('click',function(e){
 
      $(this).next('.mid').find('.message > div').toggleClass('hidden');
 
      ${resize_js};
 
    });
 
  });
 
</script>
 
</%def>
kallithea/templates/changeset/changeset.html
Show inline comments
 
@@ -13,25 +13,25 @@
 
</%def>
 

	
 
<%block name="header_menu">
 
    ${self.menu('repositories')}
 
</%block>
 

	
 
<%def name="main()">
 
${self.repo_context_bar('changelog', c.changeset.raw_id)}
 
<div class="panel panel-primary">
 
  <div class="panel-heading clearfix">
 
    ${self.breadcrumbs()}
 
  </div>
 
  <script>
 
  <script>'use strict';
 
    AJAX_COMMENT_URL = ${h.js(url('changeset_comment',repo_name=c.repo_name,revision=c.changeset.raw_id))};
 
    AJAX_COMMENT_DELETE_URL = ${h.js(url('changeset_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__'))};
 
  </script>
 
  <div class="panel-body">
 
    <div class="panel panel-default">
 
        <div class="panel-heading clearfix">
 
            ${self.parent_child_navigation()}
 

	
 
                <div class="pull-left" title="${_('Changeset status')}">
 
                    %if c.statuses:
 
                        <i class="icon-circle changeset-status-${c.statuses[0]}"></i>
 
                        [${h.changeset_status_lbl(c.statuses[0])}]
 
@@ -175,25 +175,25 @@ ${self.repo_context_bar('changelog', c.c
 
    ## template for inline comment form
 
    ${comment.comment_inline_form()}
 

	
 
    ## render comments and inlines
 
    ${comment.generate_comments()}
 

	
 
    ## main comment form and it status
 
    ${comment.comments()}
 

	
 
    </div>
 

	
 
    ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS
 
    <script>
 
    <script>'use strict';
 
      $(document).ready(function(){
 
          $('.code-difftable').on('click', '.add-bubble', function(e){
 
              show_comment_form($(this));
 
          });
 

	
 
          move_comments($(".comments .comments-list-chunk"));
 

	
 
          // hack: re-navigate to target after JS is done ... if a target is set and setting href thus won't reload
 
          if (window.location.hash != "") {
 
              window.location.href = window.location.href;
 
          }
 
      });
kallithea/templates/changeset/changeset_file_comment.html
Show inline comments
 
@@ -183,25 +183,25 @@
 
</div>
 
</%def>
 

	
 
## MAIN COMMENT FORM
 
<%def name="comments(change_status=True)">
 
<div class="inline-comments inline-comments-general
 
            ${'show-general-status' if change_status else ''}">
 
  <div id="comments-general-comments" class="">
 
  ## comment_div for general comments
 
  </div>
 
</div>
 

	
 
<script>
 
<script>'use strict';
 

	
 
$(document).ready(function () {
 

	
 
   $(window).on('beforeunload', function(){
 
      var $textareas = $('.comment-inline-form textarea[name=text]');
 
      if($textareas.length > 1 ||
 
         $textareas.val()) {
 
         // this message will not be displayed on all browsers
 
         // (e.g. some versions of Firefox), but the user will still be warned
 
         return 'There are uncommitted comments.';
 
      }
 
   });
kallithea/templates/changeset/diff_block.html
Show inline comments
 
@@ -87,25 +87,25 @@
 
                %endif
 
                %if op in 'AM':
 
                  <img id="${id_fid}_image-diff-img-b" class="img-diff img-diff-swapable" style="display:none"
 
                      realsrc="${h.url('files_raw_home',repo_name=cs_repo_name,revision=cs_rev,f_path=cs_filename)}" />
 
                %endif
 
              </div>
 
            %endif
 
        </div>
 
    </div>
 
</%def>
 

	
 
<%def name="diff_block_js()">
 
<script>
 
<script>'use strict';
 
$(document).ready(function(){
 
    $('.btn-image-diff-show').click(function(e){
 
        $('.btn-image-diff-show').hide();
 
        $('.btn-image-diff-swap').show();
 
        $('.img-diff-swapable')
 
            .each(function(i,e){
 
                    $(e).prop('src', $(e).attr('realsrc'));
 
                })
 
            .show();
 
        });
 

	
 
    $('.btn-image-diff-swap').mousedown(function(e){
kallithea/templates/compare/compare_cs.html
Show inline comments
 
@@ -57,25 +57,25 @@
 
        ${h.link_to_ref(c.a_repo.repo_name, c.a_ref_type, c.a_ref_name)}
 
      </div>
 
    %endif
 
  %endif
 
</div>
 

	
 
%if c.is_ajax_preview:
 
<div id="jsdata" style="display:none">${h.js(c.jsdata)}</div>
 
%else:
 
<script src="${h.url('/js/graph.js', ver=c.kallithea_version)}"></script>
 
%endif
 

	
 
<script>
 
<script>'use strict';
 
    var jsdata = ${h.js(c.jsdata)};
 
    var graph = new BranchRenderer('graph_canvas', 'graph_content_pr', 'chg_');
 

	
 
    $(document).ready(function(){
 
        graph.render(jsdata);
 

	
 
        $('.expand_commit').click(function(e){
 
            $(this).next('.mid').find('.message').toggleClass('expanded');
 
            graph.render(jsdata);
 
        });
 
    });
 
    $(window).resize(function(){
kallithea/templates/compare/compare_diff.html
Show inline comments
 
@@ -89,25 +89,25 @@ ${self.repo_context_bar('changelog')}
 
        ## diff block
 
        <%namespace name="diff_block" file="/changeset/diff_block.html"/>
 
        ${diff_block.diff_block_js()}
 
        ${diff_block.diff_block(c.a_repo.repo_name, c.a_ref_type, c.a_ref_name, c.a_rev,
 
                                c.cs_repo.repo_name, c.cs_ref_type, c.cs_ref_name, c.cs_rev, c.file_diff_data)}
 
        % if c.limited_diff:
 
          <h4>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff')}</a></h4>
 
        % endif
 
    %endif
 
    </div>
 

	
 
</div>
 
    <script>
 
    <script>'use strict';
 

	
 
   $(document).ready(function(){
 
    var cache = {};
 

	
 
    function make_revision_dropdown(css_selector, repo_name, ref_name, cache_key) {
 
      $(css_selector).select2({
 
        placeholder: '{0}@{1}'.format(repo_name, ref_name || ${h.jshtml(_('Select changeset'))}),
 
        formatSelection: function(obj){
 
            return '{0}@{1}'.format(repo_name, obj.text).html_escape();
 
        },
 
        dropdownAutoWidth: true,
 
        maxResults: 50,
kallithea/templates/files/diff_2way.html
Show inline comments
 
@@ -51,25 +51,25 @@ ${self.repo_context_bar('changelog')}
 
                         title="${_('Raw diff')}"><i class="icon-diff"></i></a>
 
                      <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=c.node1.path,diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='download')}"
 
                         data-toggle="tooltip"
 
                         title="${_('Download diff')}"><i class="icon-floppy"></i></a>
 
                      ${h.checkbox('ignorews', label=_('Ignore whitespace'))}
 
                      ${h.checkbox('edit_mode', label=_('Edit'))}
 
                    </div>
 
            </div>
 
            <div id="compare" class="overflow-x-visible"></div>
 
        </div>
 
    </div>
 

	
 
<script>
 
<script>'use strict';
 
var orig1_url = ${h.jshtml(h.url('files_raw_home',repo_name=c.repo_name,f_path=c.node1.path,revision=c.cs1.raw_id))};
 
var orig2_url = ${h.jshtml(h.url('files_raw_home',repo_name=c.repo_name,f_path=c.node2.path,revision=c.cs2.raw_id))};
 

	
 
$(document).ready(function () {
 
    $('#compare').mergely({
 
        width: 'auto',
 
        /* let the 2 compare panes use all the window space currently available
 
           below footer (i.e. on an empty page with just header and footer): */
 
        height: $(window).height()
 
                - $('.footer').offset().top
 
                - $('.footer').height(),
 
        fgcolor: {a:'#ddffdd',c:'#cccccc',d:'#ffdddd'},
kallithea/templates/files/files.html
Show inline comments
 
@@ -27,25 +27,25 @@ ${self.repo_context_bar('files', c.revis
 
        </div>
 
        <div class="pull-right">
 
              ${_("Branch filter:")} ${h.select('branch_selector',c.changeset.raw_id,c.revision_options)}
 
        </div>
 
    </div>
 
    <div class="panel-body">
 
        <div id="files_data">
 
            <%include file='files_ypjax.html'/>
 
        </div>
 
    </div>
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
var CACHE = {};
 
var CACHE_EXPIRE = 5*60*1000; //cache for 5*60s
 
//used to construct links from the search list
 
var _repo_files_url = ${h.jshtml(h.url("files_home",repo_name=c.repo_name,revision='',f_path='').replace('//', '/'))};
 
var url_base = ${h.js(h.url("files_home",repo_name=c.repo_name,revision='__REV__',f_path='__FPATH__'))};
 
//send the nodelist request to this url
 
var node_list_url = ${h.js(h.url("files_nodelist_home",repo_name=c.repo_name,revision='__REV__',f_path='__FPATH__'))};
 

	
 
## new pyroutes URLs
 
pyroutes.register('files_nodelist_home', ${h.js(h.url('files_nodelist_home', repo_name=c.repo_name,revision='%(revision)s',f_path='%(f_path)s'))}, ['revision', 'f_path']);
 
pyroutes.register('files_history_home', ${h.js(h.url('files_history_home', repo_name=c.repo_name,revision='%(revision)s',f_path='%(f_path)s'))}, ['revision', 'f_path']);
 
pyroutes.register('files_authors_home', ${h.js(h.url('files_authors_home', repo_name=c.repo_name,revision='%(revision)s',f_path='%(f_path)s'))}, ['revision', 'f_path']);
 
@@ -116,34 +116,34 @@ var post_load_state = function(state) {
 
        //initially loaded stuff
 
        var _f_path = state.f_path;
 
        var _rev = state.rev;
 

	
 
        fileBrowserListeners(state.node_list_url, state.url_base);
 
        // Inform Google Analytics of the change
 
        if ( typeof window.pageTracker !== 'undefined' ) {
 
            window.pageTracker._trackPageview(state.url);
 
        }
 
    }
 

	
 
    function highlight_lines(lines){
 
        for(pos in lines){
 
        for(let pos in lines){
 
          $('#L'+lines[pos]).css('background-color','#FFFFBE');
 
        }
 
    }
 
    page_highlights = location.href.substring(location.href.indexOf('#')+1).split('L');
 
    let page_highlights = location.href.substring(location.href.indexOf('#')+1).split('L');
 
    if (page_highlights.length == 2){
 
       highlight_ranges  = page_highlights[1].split(",");
 
       let highlight_ranges  = page_highlights[1].split(",");
 

	
 
       var h_lines = [];
 
       for (pos in highlight_ranges){
 
       for (let pos in highlight_ranges){
 
            var _range = highlight_ranges[pos].split('-');
 
            if(_range.length == 2){
 
                var start = parseInt(_range[0]);
 
                var end = parseInt(_range[1]);
 
                if (start < end){
 
                    for(var i=start;i<=end;i++){
 
                        h_lines.push(i);
 
                    }
 
                }
 
            }
 
            else{
 
                h_lines.push(parseInt(highlight_ranges[pos]));
kallithea/templates/files/files_add.html
Show inline comments
 
@@ -61,25 +61,25 @@ ${self.repo_context_bar('files')}
 
            </div>
 
            <div>
 
              <div>
 
                  <div>${_('Commit Message')}</div>
 
                  <textarea class="form-control" name="message" placeholder="${c.default_message}"></textarea>
 
              </div>
 
              <div class="buttons">
 
                ${h.submit('commit',_('Commit Changes'),class_="btn btn-success")}
 
                ${h.reset('reset',_('Reset'),class_="btn btn-default")}
 
              </div>
 
            </div>
 
            ${h.end_form()}
 
            <script>
 
            <script>'use strict';
 
                $(document).ready(function(){
 
                    var reset_url = ${h.jshtml(h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path))};
 
                    var myCodeMirror = initCodeMirror('editor', ${h.jshtml(request.script_name)}, reset_url);
 

	
 
                    //inject new modes, based on codeMirrors modeInfo object
 
                    var $mimetype_select = $('#mimetype');
 
                    $mimetype_select.each(function(){
 
                        var modes_select = this;
 
                        var index = 1;
 
                        for(var i=0;i<CodeMirror.modeInfo.length;i++){
 
                            var m = CodeMirror.modeInfo[i];
 
                            var opt = new Option(m.name, m.mime);
kallithea/templates/files/files_browser.html
Show inline comments
 
@@ -100,21 +100,21 @@
 
                            </span>
 
                         %endif
 
                     </td>
 
                </tr>
 
            %endfor
 
            </tbody>
 
            <tbody id="tbody_filtered" style="display:none">
 
            </tbody>
 
        </table>
 
    </div>
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        // init node filter if we pass GET param ?search=1
 
        var search_GET = ${h.js(request.GET.get('search',''))};
 
        if(search_GET == "1"){
 
            $("#filter_activate").click();
 
        }
 
    });
 
</script>
kallithea/templates/files/files_edit.html
Show inline comments
 
@@ -68,25 +68,25 @@ ${self.repo_context_bar('files')}
 
                  <textarea class="form-control" id="commit" name="message" placeholder="${c.default_message}"></textarea>
 
              </div>
 
              <div class="form-group buttons">
 
                ${h.submit('commit',_('Commit Changes'),class_="btn btn-success")}
 
                ${h.reset('reset',_('Reset'),class_="btn btn-default")}
 
              </div>
 
            </div>
 
            ${h.end_form()}
 
        </div>
 
    </div>
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        var reset_url = ${h.jshtml(h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.file.path))};
 
        var myCodeMirror = initCodeMirror('editor', ${h.jshtml(request.script_name)}, reset_url);
 

	
 
       //inject new modes, based on codeMirrors modeInfo object
 
        var $mimetype_select = $('#mimetype');
 
        $mimetype_select.each(function(){
 
            var modes_select = this;
 
            var index = 1;
 
            for(var i=0;i<CodeMirror.modeInfo.length;i++){
 
                var m = CodeMirror.modeInfo[i];
 
                var opt = new Option(m.name, m.mime);
kallithea/templates/followers/followers.html
Show inline comments
 
@@ -16,25 +16,25 @@
 
<%def name="main()">
 
${self.repo_context_bar('followers')}
 
<div class="panel panel-primary">
 
    <div class="panel-heading clearfix">
 
        ${self.breadcrumbs()}
 
    </div>
 
    <div class="panel-body">
 
        <div id="followers">
 
            <%include file='followers_data.html'/>
 
        </div>
 
    </div>
 
</div>
 
<script>
 
<script>'use strict';
 
  $(document).ready(function(){
 
    var $followers = $('#followers');
 
    $followers.on('click','.pager_link',function(e){
 
        asynchtml(e.target.href, $followers, function(){
 
            show_more_event();
 
            tooltip_activate();
 
        });
 
        e.preventDefault();
 
    });
 
  });
 
</script>
 
</%def>
kallithea/templates/forks/fork.html
Show inline comments
 
@@ -79,24 +79,24 @@ ${self.repo_context_bar('createfork')}
 
                </div>
 
            </div>
 
            %endif
 

	
 
            <div class="form-group">
 
                <div class="buttons">
 
                    ${h.submit('fork-submit',_('Fork this Repository'),class_="btn btn-default")}
 
                </div>
 
            </div>
 
    </div>
 
    ${h.end_form()}
 
</div>
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        $("#repo_group").select2({
 
            'dropdownAutoWidth': true
 
        });
 
        $("#landing_rev").select2({
 
            'minimumResultsForSearch': -1
 
        });
 
        $('#repo_name').focus();
 
    });
 
</script>
 
</%def>
kallithea/templates/forks/forks.html
Show inline comments
 
@@ -16,25 +16,25 @@
 
<%def name="main()">
 
${self.repo_context_bar('showforks')}
 
<div class="panel panel-primary">
 
    <div class="panel-heading clearfix">
 
        ${self.breadcrumbs()}
 
    </div>
 
    <div class="panel-body">
 
        <div id="forks">
 
            <%include file='forks_data.html'/>
 
        </div>
 
    </div>
 
</div>
 
<script>
 
<script>'use strict';
 
  $(document).ready(function(){
 
      var $forks = $('#forks');
 
      $forks.on('click','.pager_link',function(e){
 
          asynchtml(e.target.href, $forks, function(){
 
              show_more_event();
 
              tooltip_activate();
 
          });
 
          e.preventDefault();
 
      });
 
  });
 
</script>
 
</%def>
kallithea/templates/index_base.html
Show inline comments
 
@@ -35,25 +35,25 @@
 
                %endif
 
                %if c.group and h.HasRepoGroupPermissionLevel('admin')(c.group.group_name):
 
                    <a href="${h.url('edit_repo_group',group_name=c.group.group_name)}" title="${_('You have admin right to this group, and can edit it')}" class="btn btn-default btn-xs"><i class="icon-pencil"></i>${_('Edit Repository Group')}</a>
 
                %endif
 
              </div>
 
            %endif
 
        </div>
 
        <div class="panel-body">
 
            <table class="table" id="repos_list_wrap" width="100%"></table>
 
        </div>
 
    </div>
 

	
 
      <script>
 
      <script>'use strict';
 
        var data = ${h.js(c.data)},
 
            $dataTable = $("#repos_list_wrap").DataTable({
 
                data: data.records,
 
                columns: [
 
                    {data: "raw_name", visible: false, searchable: false},
 
                    {title: ${h.jshtml(_('Repository'))}, data: "name", orderData: [0,], render: {
 
                        filter: function(data, type, row, meta) {
 
                            return row.just_name;
 
                        }
 
                    }},
 
                    {data: "following", defaultContent: '', sortable: false},
 
                    {data: "desc", title: ${h.jshtml(_('Description'))}, searchable: false},
kallithea/templates/journal/journal.html
Show inline comments
 
@@ -32,25 +32,25 @@
 
            <div class="pull-right panel-title">
 
                <a href="${h.url('my_account_watched')}"><i class="icon-eye"></i>${_('Watched Repositories')}</a>
 
                <a href="${h.url('my_account_repos')}"><i class="icon-database"></i>${_('My Repositories')}</a>
 
                <a id="refresh" href="${h.url('journal')}"><i class="icon-arrows-cw"></i></a>
 
                <a href="${h.url('journal_atom', api_key=request.authuser.api_key)}"><i class="icon-rss-squared"></i></a>
 
            </div>
 
        </div>
 
        <div id="journal" class="panel-body">
 
            <%include file='journal_data.html'/>
 
        </div>
 
    </div>
 

	
 
<script>
 
<script>'use strict';
 

	
 
    $('#j_filter').click(function(){
 
        var $jfilter = $('#j_filter');
 
        if($jfilter.hasClass('initial')){
 
            $jfilter.val('');
 
        }
 
    });
 
    var fix_j_filter_width = function(len){
 
        $('#j_filter').css('width', Math.max(80, len*6.50)+'px');
 
    };
 
    $('#j_filter').keyup(function(){
 
        fix_j_filter_width($('#j_filter').val().length);
 
@@ -63,25 +63,25 @@
 
    fix_j_filter_width($('#j_filter').val().length);
 

	
 
    $('#refresh').click(function(e){
 
        asynchtml(${h.js(h.url.current(filter=c.search_term))}, $("#journal"), function(){
 
            show_more_event();
 
            tooltip_activate();
 
            });
 
        e.preventDefault();
 
    });
 

	
 
</script>
 

	
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        var $journal = $('#journal');
 
        $journal.on('click','.pager_link',function(e){
 
            asynchtml(e.target.href, $journal, function(){
 
                show_more_event();
 
                tooltip_activate();
 
            });
 
            e.preventDefault();
 
        });
 
        $('#journal').on('click','.show_more',function(e){
 
            var el = e.target;
 
            $('#'+el.id.substring(1)).show();
kallithea/templates/login.html
Show inline comments
 
@@ -55,22 +55,22 @@
 
                        ${h.link_to(_("Don't have an account ?"),h.url('register'))}
 
                    %endif
 
                </div>
 
            </div>
 

	
 
            <div class="form-group">
 
                <div class="buttons">
 
                    ${h.submit('sign_in',_('Sign In'),class_="btn btn-default")}
 
                </div>
 
            </div>
 
        </div>
 
        ${h.end_form()}
 
        <script>
 
        <script>'use strict';
 
        $(document).ready(function(){
 
            $('#username').focus();
 
        });
 
        </script>
 
    </div>
 
</div>
 
</div>
 
</div>
 
</div>
kallithea/templates/password_reset.html
Show inline comments
 
@@ -44,22 +44,22 @@
 

	
 
                <div class="form-group">
 
                    <div class="buttons">
 
                        ${h.submit('send',_('Send Password Reset Email'),class_="btn btn-default")}
 
                    </div>
 
                </div>
 

	
 
                <div class="alert alert-info">
 
                    ${_('A password reset link will be sent to the specified email address if it is registered in the system.')}
 
                </div>
 
        </div>
 
        ${h.end_form()}
 
        <script>
 
        <script>'use strict';
 
         $(document).ready(function(){
 
            $('#email').focus();
 
         });
 
        </script>
 
    </div>
 
</div>
 
</div>
 
</div>
 
</div>
kallithea/templates/pullrequests/pullrequest.html
Show inline comments
 
@@ -83,25 +83,25 @@ ${self.repo_context_bar('showpullrequest
 
        <div>
 
           <h4>${_('Changesets')}</h4>
 
           ## overview pulled by ajax
 
           <div id="pull_request_overview"></div>
 
        </div>
 
    </div>
 

	
 
    ${h.end_form()}
 

	
 
</div>
 

	
 
<script src="${h.url('/js/graph.js', ver=c.kallithea_version)}"></script>
 
<script>
 
<script>'use strict';
 
  pyroutes.register('pullrequest_repo_info', ${h.js(url('pullrequest_repo_info',repo_name='%(repo_name)s'))}, ['repo_name']);
 

	
 
  var pendingajax = undefined;
 
  var otherrepoChanged = function(){
 
      var $other_ref = $('#other_ref');
 
      $other_ref.prop('disabled', true);
 
      var repo_name = $('#other_repo').val();
 
      if (pendingajax) {
 
          pendingajax.abort();
 
          pendingajax = undefined;
 
      }
 
      pendingajax = ajaxGET(pyroutes.url('pullrequest_repo_info', {"repo_name": repo_name}),
 
@@ -153,25 +153,25 @@ ${self.repo_context_bar('showpullrequest
 

	
 
      var other_repo = $('#pull_request_form #other_repo').val();
 
      var other_ref = $('#pull_request_form #other_ref').val().split(':');
 
      $('#other_rev_span').html(other_ref[2].substr(0,12));
 

	
 
      var rev_data = {
 
          '__org_repo__': org_repo,
 
          '__org_ref_name__': org_ref[2],
 
          '__other_repo__': other_repo,
 
          '__other_ref_name__': other_ref[2]
 
      }; // gather the org/other ref and repo here
 

	
 
      for (k in rev_data){
 
      for (let k in rev_data){
 
          url = url.replace(k,rev_data[k]);
 
      }
 

	
 
      if (pendingajax) {
 
          pendingajax.abort();
 
          pendingajax = undefined;
 
      }
 
      pendingajax = asynchtml(url, $('#pull_request_overview'), function(o){
 
          pendingajax = undefined;
 
      });
 
  }
 

	
kallithea/templates/pullrequests/pullrequest_show.html
Show inline comments
 
@@ -303,25 +303,25 @@ ${self.repo_context_bar('showpullrequest
 
                          ${h.link_to(path, '#%s' % fid)}
 
                      </span>
 
                      <div class="changes">${h.fancy_file_stats(stats)}</div>
 
                    </div>
 
                %endfor
 
                %if c.limited_diff:
 
                  <h5>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff anyway')}</a></h5>
 
                %endif
 
              </div>
 
            </div>
 
        </div>
 
    </div>
 
    <script>
 
    <script>'use strict';
 
    // TODO: switch this to pyroutes
 
    AJAX_COMMENT_URL = ${h.js(url('pullrequest_comment',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id))};
 
    AJAX_COMMENT_DELETE_URL = ${h.js(url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__'))};
 

	
 
    pyroutes.register('pullrequest_comment', ${h.js(url('pullrequest_comment',repo_name='%(repo_name)s',pull_request_id='%(pull_request_id)s'))}, ['repo_name', 'pull_request_id']);
 
    pyroutes.register('pullrequest_comment_delete', ${h.js(url('pullrequest_comment_delete',repo_name='%(repo_name)s',comment_id='%(comment_id)s'))}, ['repo_name', 'comment_id']);
 

	
 
    </script>
 

	
 
    ## diff block
 
    <div class="panel-body">
 
    <div class="commentable-diff">
 
@@ -334,25 +334,25 @@ ${self.repo_context_bar('showpullrequest
 
    % endif
 
    </div>
 

	
 
    ## template for inline comment form
 
    ${comment.comment_inline_form()}
 

	
 
    ## render comments and inlines
 
    ${comment.generate_comments()}
 

	
 
    ## main comment form and it status
 
    ${comment.comments(change_status=c.allowed_to_change_status)}
 

	
 
    <script>
 
    <script>'use strict';
 
      $(document).ready(function(){
 
          PullRequestAutoComplete($('#user'));
 
          SimpleUserAutoComplete($('#owner'));
 

	
 
          $('.code-difftable').on('click', '.add-bubble', function(e){
 
              show_comment_form($(this));
 
          });
 

	
 
          var avail_jsdata = ${h.js(c.avail_jsdata)};
 
          var avail_r = new BranchRenderer('avail_graph_canvas', 'updaterevs-table', 'chg_available_');
 
          avail_r.render(avail_jsdata);
 

	
kallithea/templates/register.html
Show inline comments
 
@@ -81,22 +81,22 @@
 
                <div class="form-group">
 
                    <div class="buttons">
 
                        ${h.submit('sign_up',_('Sign Up'),class_="btn btn-default")}
 
                        %if c.auto_active:
 
                            <div class="alert alert-info">${_('Registered accounts are ready to use and need no further action.')}</div>
 
                        %else:
 
                            <div class="alert alert-info">${_('Please wait for an administrator to activate your account.')}</div>
 
                        %endif
 
                    </div>
 
                </div>
 
        </div>
 
        ${h.end_form()}
 
        <script>
 
        <script>'use strict';
 
        $(document).ready(function(){
 
            $('#username').focus();
 
        });
 
        </script>
 
    </div>
 
 </div>
 
 </div>
 
 </div>
 
 </div>
kallithea/templates/summary/statistics.html
Show inline comments
 
@@ -42,25 +42,25 @@ ${self.repo_context_bar('summary')}
 

	
 
        <div id="legend_data" class="pull-left">
 
            <div id="legend_container"></div>
 
            <div id="legend_choices">
 
                <table class="table" id="legend_choices_tables"></table>
 
            </div>
 
        </div>
 

	
 
        <div id="overview"></div>
 
    </div>
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
var data = ${h.js(c.trending_languages)};
 
var total = 0;
 
var tbl = document.createElement('table');
 
tbl.setAttribute('class','trending_language_tbl');
 
var cnt = 0;
 
for (var i=0;i<data.length;i++){
 
    total+= data[i][1].count;
 
}
 
for (var i=0;i<data.length;i++){
 
    cnt += 1;
 

	
 
    var hide = cnt>2;
 
@@ -94,40 +94,40 @@ for (var i=0;i<data.length;i++){
 
    }
 

	
 
    trending_language.setAttribute("class", 'trending_language top-right-rounded-corner bottom-right-rounded-corner');
 
    trending_language.style.width=percentage+"%";
 
    td2.appendChild(trending_language);
 

	
 
    tr.appendChild(td1);
 
    tr.appendChild(td2);
 
    tbl.appendChild(tr);
 
    if(cnt == 3){
 
        var show_more = document.createElement('tr');
 
        var td = document.createElement('td');
 
        lnk = document.createElement('a');
 
        let lnk = document.createElement('a');
 

	
 
        lnk.href='#';
 
        lnk.innerHTML = ${h.jshtml(_('Show more'))};
 
        lnk.id='code_stats_show_more';
 
        td.appendChild(lnk);
 

	
 
        show_more.appendChild(td);
 
        show_more.appendChild(document.createElement('td'));
 
        tbl.appendChild(show_more);
 
    }
 

	
 
}
 

	
 
</script>
 
<script>
 
<script>'use strict';
 

	
 
/**
 
 * Plots summary graph
 
 *
 
 * @class SummaryPlot
 
 * @param {from} initial from for detailed graph
 
 * @param {to} initial to for detailed graph
 
 * @param {dataset}
 
 * @param {overview_dataset}
 
 */
 
function SummaryPlot(from,to,dataset,overview_dataset) {
 
    var initial_ranges = {
 
@@ -251,25 +251,25 @@ function SummaryPlot(from,to,dataset,ove
 
       for this user if it does this data is then pushed for displaying
 
       Additionally it will only display users that are selected by the checkbox
 
    */
 
    function getDataAccordingToRanges(ranges) {
 

	
 
        var data = [];
 
        var new_dataset = {};
 
        var keys = [];
 
        var max_commits = 0;
 
        for(var key in dataset){
 

	
 
            for(var ds in dataset[key].data){
 
                commit_data = dataset[key].data[ds];
 
                let commit_data = dataset[key].data[ds];
 
                if (commit_data.time >= ranges.xaxis.from && commit_data.time <= ranges.xaxis.to){
 
                    if(new_dataset[key] === undefined){
 
                        new_dataset[key] = {data:[],label:key};
 
                    }
 
                    new_dataset[key].data.push([
 
                      commit_data.time,
 
                      commit_data.commits]);
 
                }
 
            }
 
            if (new_dataset[key] !== undefined){
 
                data.push(new_dataset[key]);
 
            }
 
@@ -279,25 +279,25 @@ function SummaryPlot(from,to,dataset,ove
 
            return data;
 
        }
 
        else{
 
            //just return dummy data for graph to plot itself
 
            return [getDummyData('')];
 
        }
 
    }
 

	
 
    /**
 
    * redraw using new checkbox data
 
    */
 
    function plotchoiced(e){
 
        args = e.data;
 
        let args = e.data;
 
        var cur_data = args[0];
 
        var cur_ranges = args[1];
 

	
 
        var new_data = [];
 
        var inputs = choiceContainer.getElementsByTagName("input");
 
        inputs[$(e.target).parents('tr').index()].click();
 

	
 
        //show only checked labels
 
        for(var i=0; i<inputs.length; i++) {
 
            var checkbox_key = inputs[i].name;
 

	
 
            if(inputs[i].checked){
kallithea/templates/summary/summary.html
Show inline comments
 
@@ -18,25 +18,25 @@
 
       - <i class="icon-fork"></i>${_('Clone from')} "<a href="${h.url(str(h.hide_credentials(c.db_repo.clone_uri)))}">${h.hide_credentials(c.db_repo.clone_uri)}</a>"
 
    %endif
 
</%def>
 

	
 
<%block name="header_menu">
 
    ${self.menu('repositories')}
 
</%block>
 

	
 
<%block name="head_extra">
 
  <link href="${h.url('atom_feed_home',repo_name=c.db_repo.repo_name,api_key=request.authuser.api_key)}" rel="alternate" title="${_('%s ATOM feed') % c.repo_name}" type="application/atom+xml" />
 
  <link href="${h.url('rss_feed_home',repo_name=c.db_repo.repo_name,api_key=request.authuser.api_key)}" rel="alternate" title="${_('%s RSS feed') % c.repo_name}" type="application/rss+xml" />
 

	
 
  <script>
 
  <script>'use strict';
 
  redirect_hash_branch = function(){
 
    var branch = window.location.hash.replace(/^#(.*)/, '$1');
 
    if (branch){
 
      window.location = ${h.js(h.url('changelog_home',repo_name=c.repo_name,branch='__BRANCH__'))}
 
        .replace('__BRANCH__',branch);
 
    }
 
  }
 
  redirect_hash_branch();
 
  window.onhashchange = function() {
 
    redirect_hash_branch();
 
  };
 
  </script>
 
@@ -229,25 +229,25 @@ hg push ${c.clone_repo_url}
 
<div class="panel panel-primary">
 
    <div class="panel-heading" title="${_('Readme file from revision %s:%s') % (c.db_repo.landing_rev[0], c.db_repo.landing_rev[1])}">
 
        <div class="panel-title">
 
            <a href="${h.url('files_home',repo_name=c.repo_name,revision='tip',f_path=c.readme_file)}">${c.readme_file}</a>
 
        </div>
 
    </div>
 
    <div class="readme panel-body">
 
        ${c.readme_data|n}
 
    </div>
 
</div>
 
%endif
 

	
 
<script>
 
<script>'use strict';
 
$(document).ready(function(){
 
    $('#clone-url input').click(function(e){
 
        if($(this).hasClass('selected')){
 
            $(this).removeClass('selected');
 
            return ;
 
        }else{
 
            $(this).addClass('selected');
 
            $(this).select();
 
        }
 
    });
 

	
 
    var $clone_url = $('#clone-url');
 
@@ -300,50 +300,50 @@ $(document).ready(function(){
 
                success: function(data) {
 
                  cache[key] = data;
 
                  query.callback({results: data.results});
 
                }
 
              });
 
          }
 
        }
 
    });
 
    // on change of download options
 
    $('#download_options').change(function(e){
 
       var new_cs = e.added
 

	
 
       for(k in tmpl_links){
 
       for(let k in tmpl_links){
 
           var s = $('#'+k+'_link');
 
           if(s){
 
             var title_tmpl = ${h.jshtml(_('Download %s as %s') % ('__CS_NAME__','__CS_EXT__'))};
 
             title_tmpl= title_tmpl.replace('__CS_NAME__',new_cs.text);
 
             title_tmpl = title_tmpl.replace('__CS_EXT__',k);
 
             title_tmpl = '<i class="icon-file-zip"></i>'+ title_tmpl.html_escape();
 
             var url = tmpl_links[k].replace('__CS__',new_cs.id);
 
             var subrepos = $('#archive_subrepos').is(':checked');
 
             url = url.replace('__SUB__',subrepos);
 
             url = url.replace('__NAME__',title_tmpl);
 

	
 
             s.html(url);
 
           }
 
       }
 
    });
 

	
 
    var tmpl_links = {};
 
    %for cnt,archive in enumerate(c.db_repo_scm_instance._get_archives()):
 
      tmpl_links[${h.jshtml(archive['type'])}] = ${h.js(h.link_to('__NAME__', h.url('files_archive_home',repo_name=c.db_repo.repo_name, fname='__CS__'+archive['extension'],subrepos='__SUB__'),class_='btn btn-default btn-sm'))};
 
    %endfor
 
});
 
</script>
 

	
 
%if c.show_stats:
 
<script>
 
<script>'use strict';
 
$(document).ready(function(){
 
    var data = ${h.js(c.trending_languages)};
 
    var total = 0;
 
    var tbl = document.createElement('table');
 
    tbl.setAttribute('class','table');
 
    var cnt = 0;
 
    for (var i=0;i<data.length;i++){
 
        total+= data[i][1].count;
 
    }
 
    for (var i=0;i<data.length;i++){
 
        cnt += 1;
 

	
 
@@ -384,25 +384,25 @@ $(document).ready(function(){
 
                + "aria-valuemin='0' aria-valuemax='100' aria-valuenow='" + percentage
 
                + "' style='width: " + percentage + "%;'>&nbsp;</b>&nbsp;" + percentage + "%";
 
        }
 

	
 
        td2.appendChild(trending_language);
 

	
 
        tr.appendChild(td1);
 
        tr.appendChild(td2);
 
        tbl.appendChild(tr);
 
        if(cnt == 3){
 
            var show_more = document.createElement('tr');
 
            var td = document.createElement('td');
 
            lnk = document.createElement('a');
 
            let lnk = document.createElement('a');
 

	
 
            lnk.href='#';
 
            lnk.innerHTML = ${h.jshtml(_('Show more'))};
 
            lnk.id='code_stats_show_more';
 
            td.appendChild(lnk);
 

	
 
            show_more.appendChild(td);
 
            show_more.appendChild(document.createElement('td'));
 
            tbl.appendChild(show_more);
 
        }
 

	
 
    }
0 comments (0 inline, 0 general)