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
 
@@ -273,13 +273,13 @@ body {
 
     
 
      /* 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 {
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(); };
 
  }
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>
 
@@ -99,43 +101,43 @@ function BranchRenderer(canvas_id, conte
 
				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;
 
						}
 
					}
 
@@ -189,24 +191,24 @@ function BranchRenderer(canvas_id, conte
 
					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);
kallithea/templates/admin/admin.html
Show inline comments
 
@@ -24,13 +24,13 @@
 
    </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('');
 
    }
kallithea/templates/admin/admin_log.html
Show inline comments
 
@@ -34,13 +34,13 @@
 
        <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();
kallithea/templates/admin/auth/auth_settings.html
Show inline comments
 
@@ -102,13 +102,13 @@
 
                </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);
kallithea/templates/admin/gists/edit.html
Show inline comments
 
@@ -32,13 +32,13 @@
 
        <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>
 

	
 
@@ -76,13 +76,13 @@
 
                            <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(){
 
@@ -143,13 +143,13 @@
 

	
 
            <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))},
kallithea/templates/admin/gists/new.html
Show inline comments
 
@@ -52,13 +52,13 @@
 
            <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(){
kallithea/templates/admin/my_account/my_account_api_keys.html
Show inline comments
 
@@ -87,13 +87,13 @@ password.
 
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'))}},
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'))}},
kallithea/templates/admin/repo_groups/repo_group_add.html
Show inline comments
 
@@ -58,13 +58,13 @@
 
                    ${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{
kallithea/templates/admin/repo_groups/repo_group_edit_perms.html
Show inline comments
 
@@ -99,15 +99,15 @@ ${h.form(url('edit_repo_group_perms', gr
 
            ${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});
 
        }
 
    };
kallithea/templates/admin/repo_groups/repo_group_edit_settings.html
Show inline comments
 
@@ -38,13 +38,13 @@ ${h.form(url('delete_repo_group', group_
 
                ${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
 
@@ -27,13 +27,13 @@
 
        </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'))}},
kallithea/templates/admin/repos/repo_add_base.html
Show inline comments
 
@@ -62,13 +62,13 @@ ${h.form(url('repos'))}
 
        <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{
kallithea/templates/admin/repos/repo_creating.html
Show inline comments
 
@@ -39,13 +39,13 @@
 
                ${_("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.
kallithea/templates/admin/repos/repo_edit_advanced.html
Show inline comments
 
@@ -6,13 +6,13 @@ ${h.form(url('edit_repo_advanced_fork', 
 
       <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>
kallithea/templates/admin/repos/repo_edit_permissions.html
Show inline comments
 
@@ -84,15 +84,15 @@ ${h.form(url('edit_repo_perms_update', r
 
            ${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);
 
        }
 
    };
 

	
kallithea/templates/admin/repos/repo_edit_settings.html
Show inline comments
 
@@ -100,13 +100,13 @@ ${h.form(url('update_repo', repo_name=c.
 
                    ${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
kallithea/templates/admin/repos/repos.html
Show inline comments
 
@@ -26,13 +26,13 @@
 
    </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'))}},
kallithea/templates/admin/settings/settings_hooks.html
Show inline comments
 
@@ -47,13 +47,13 @@ ${h.form(url('admin_settings_hooks'), me
 
            </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) {
kallithea/templates/admin/settings/settings_vcs.html
Show inline comments
 
@@ -66,13 +66,13 @@ ${h.form(url('admin_settings'), method='
 
                    ${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');
 
            });
kallithea/templates/admin/user_groups/user_group_add.html
Show inline comments
 
@@ -49,12 +49,12 @@
 
                </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
 
@@ -89,15 +89,15 @@ ${h.form(url('edit_user_group_perms_upda
 
            ${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);
 
        }
 
    };
 

	
kallithea/templates/admin/user_groups/user_group_edit_settings.html
Show inline comments
 
@@ -45,9 +45,9 @@ ${h.form(url('update_users_group', id=c.
 
                    <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
 
@@ -26,13 +26,13 @@
 
        </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},
kallithea/templates/admin/users/user_add.html
Show inline comments
 
@@ -81,12 +81,12 @@
 
                </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
 
@@ -74,13 +74,13 @@
 
                </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
 
@@ -25,13 +25,13 @@
 
    </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'))}},
kallithea/templates/base/base.html
Show inline comments
 
@@ -174,13 +174,13 @@
 
             </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,
 
@@ -396,13 +396,13 @@
 
          %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){
 
@@ -524,12 +524,12 @@
 
             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
 
@@ -6,12 +6,12 @@
 
            <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
 
@@ -94,13 +94,13 @@
 
          %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();
 
            }
kallithea/templates/base/root.html
Show inline comments
 
@@ -18,13 +18,13 @@
 

	
 
        ## 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"))},
 
@@ -74,13 +74,13 @@
 
        <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'))}, []);
kallithea/templates/changelog/changelog.html
Show inline comments
 
@@ -78,13 +78,13 @@ ${self.repo_context_bar('changelog', c.f
 
                  <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');
 

	
kallithea/templates/changelog/changelog_table.html
Show inline comments
 
@@ -107,13 +107,13 @@
 
        </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};
 
    });
 
  });
kallithea/templates/changeset/changeset.html
Show inline comments
 
@@ -19,13 +19,13 @@
 
<%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">
 
@@ -181,13 +181,13 @@ ${self.repo_context_bar('changelog', c.c
 
    ## 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"));
kallithea/templates/changeset/changeset_file_comment.html
Show inline comments
 
@@ -189,13 +189,13 @@
 
            ${'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 ||
kallithea/templates/changeset/diff_block.html
Show inline comments
 
@@ -93,13 +93,13 @@
 
            %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){
kallithea/templates/compare/compare_cs.html
Show inline comments
 
@@ -63,13 +63,13 @@
 
%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);
 

	
kallithea/templates/compare/compare_diff.html
Show inline comments
 
@@ -95,13 +95,13 @@ ${self.repo_context_bar('changelog')}
 
          <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({
kallithea/templates/files/diff_2way.html
Show inline comments
 
@@ -57,13 +57,13 @@ ${self.repo_context_bar('changelog')}
 
                    </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',
kallithea/templates/files/files.html
Show inline comments
 
@@ -33,13 +33,13 @@ ${self.repo_context_bar('files', c.revis
 
        <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
 
@@ -122,22 +122,22 @@ var post_load_state = function(state) {
 
        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++){
kallithea/templates/files/files_add.html
Show inline comments
 
@@ -67,13 +67,13 @@ ${self.repo_context_bar('files')}
 
              <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');
kallithea/templates/files/files_browser.html
Show inline comments
 
@@ -106,13 +106,13 @@
 
            <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();
 
        }
kallithea/templates/files/files_edit.html
Show inline comments
 
@@ -74,13 +74,13 @@ ${self.repo_context_bar('files')}
 
            </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');
kallithea/templates/followers/followers.html
Show inline comments
 
@@ -22,13 +22,13 @@ ${self.repo_context_bar('followers')}
 
    <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();
kallithea/templates/forks/fork.html
Show inline comments
 
@@ -85,13 +85,13 @@ ${self.repo_context_bar('createfork')}
 
                    ${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
kallithea/templates/forks/forks.html
Show inline comments
 
@@ -22,13 +22,13 @@ ${self.repo_context_bar('showforks')}
 
    <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();
kallithea/templates/index_base.html
Show inline comments
 
@@ -41,13 +41,13 @@
 
        </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: {
kallithea/templates/journal/journal.html
Show inline comments
 
@@ -38,13 +38,13 @@
 
        </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('');
 
        }
 
@@ -69,13 +69,13 @@
 
            });
 
        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();
kallithea/templates/login.html
Show inline comments
 
@@ -61,13 +61,13 @@
 
                <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>
kallithea/templates/password_reset.html
Show inline comments
 
@@ -50,13 +50,13 @@
 

	
 
                <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>
kallithea/templates/pullrequests/pullrequest.html
Show inline comments
 
@@ -89,13 +89,13 @@ ${self.repo_context_bar('showpullrequest
 

	
 
    ${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);
 
@@ -159,13 +159,13 @@ ${self.repo_context_bar('showpullrequest
 
          '__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;
kallithea/templates/pullrequests/pullrequest_show.html
Show inline comments
 
@@ -309,13 +309,13 @@ ${self.repo_context_bar('showpullrequest
 
                  <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']);
 
@@ -340,13 +340,13 @@ ${self.repo_context_bar('showpullrequest
 
    ## 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));
kallithea/templates/register.html
Show inline comments
 
@@ -87,13 +87,13 @@
 
                            <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>
kallithea/templates/summary/statistics.html
Show inline comments
 
@@ -48,13 +48,13 @@ ${self.repo_context_bar('summary')}
 
        </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++){
 
@@ -100,13 +100,13 @@ for (var i=0;i<data.length;i++){
 
    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);
 

	
 
@@ -115,13 +115,13 @@ for (var i=0;i<data.length;i++){
 
        tbl.appendChild(show_more);
 
    }
 

	
 
}
 

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

	
 
/**
 
 * Plots summary graph
 
 *
 
 * @class SummaryPlot
 
 * @param {from} initial from for detailed graph
 
@@ -257,13 +257,13 @@ function SummaryPlot(from,to,dataset,ove
 
        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,
 
@@ -285,13 +285,13 @@ function SummaryPlot(from,to,dataset,ove
 
    }
 

	
 
    /**
 
    * 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();
kallithea/templates/summary/summary.html
Show inline comments
 
@@ -24,13 +24,13 @@
 
</%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);
 
    }
 
@@ -235,13 +235,13 @@ hg push ${c.clone_repo_url}
 
    <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{
 
@@ -306,13 +306,13 @@ $(document).ready(function(){
 
        }
 
    });
 
    // 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();
 
@@ -331,13 +331,13 @@ $(document).ready(function(){
 
      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;
 
@@ -390,13 +390,13 @@ $(document).ready(function(){
 
        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);
 

	
0 comments (0 inline, 0 general)