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
 
@@ -276,7 +276,7 @@ body {
 
    }
 
     </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');
 
      
kallithea/public/js/codemirror_loadmode.js
Show inline comments
 
'use strict';
 

	
 
(function() {
 
  var loading = {};
 
  function splitCallback(cont, n) {
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>
 
@@ -102,15 +104,15 @@ function BranchRenderer(canvas_id, conte
 
			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];
 
@@ -119,20 +121,20 @@ function BranchRenderer(canvas_id, conte
 
			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;
 
@@ -192,10 +194,10 @@ function BranchRenderer(canvas_id, conte
 
				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)
 
@@ -203,7 +205,7 @@ function BranchRenderer(canvas_id, conte
 
				this.ctx.fillStyle = 'rgb(255, 0, 0)';
 
			}
 

	
 
			r = this.dot_radius
 
			let r = this.dot_radius
 
			if (obsolete_node)
 
			{
 
				this.ctx.beginPath();
kallithea/templates/admin/admin.html
Show inline comments
 
@@ -27,7 +27,7 @@
 
    </div>
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
$(document).ready(function() {
 
  $('#j_filter').click(function(){
 
    var $jfilter = $('#j_filter');
kallithea/templates/admin/admin_log.html
Show inline comments
 
@@ -37,7 +37,7 @@
 
    %endfor
 
</table>
 

	
 
<script>
 
<script>'use strict';
 
  $(document).ready(function(){
 
    var $user_log = $('#user_log');
 
    $user_log.on('click','.pager_link',function(e){
kallithea/templates/admin/auth/auth_settings.html
Show inline comments
 
@@ -105,7 +105,7 @@
 
    </div>
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
    $('.toggle-plugin').click(function(e){
 
        var $auth_plugins_input = $('#auth_plugins');
 
        var notEmpty = function(element, index, array) {
kallithea/templates/admin/gists/edit.html
Show inline comments
 
@@ -35,7 +35,7 @@
 
              ${(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();
 
            }
 
@@ -79,7 +79,7 @@
 
                </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)}, '');
 

	
 
@@ -146,7 +146,7 @@
 
            <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();
 

	
kallithea/templates/admin/gists/new.html
Show inline comments
 
@@ -55,7 +55,7 @@
 
            ${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)}, '');
 

	
kallithea/templates/admin/my_account/my_account_api_keys.html
Show inline comments
 
@@ -90,7 +90,7 @@ happen anyway, reset the API key on this
 
''')}</p>
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        $("#lifetime").select2({
 
            'dropdownAutoWidth': true
kallithea/templates/admin/my_account/my_account_repos.html
Show inline comments
 
@@ -4,7 +4,7 @@
 
    <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,
kallithea/templates/admin/my_account/my_account_watched.html
Show inline comments
 
@@ -4,7 +4,7 @@
 
    <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,
kallithea/templates/admin/repo_groups/repo_group_add.html
Show inline comments
 
@@ -61,7 +61,7 @@
 
    </div>
 
    ${h.end_form()}
 
</div>
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        var setCopyPermsOption = function(group_val){
 
            if(group_val != "-1"){
kallithea/templates/admin/repo_groups/repo_group_edit_perms.html
Show inline comments
 
@@ -102,9 +102,9 @@ ${h.form(url('edit_repo_group_perms', gr
 
</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();
kallithea/templates/admin/repo_groups/repo_group_edit_settings.html
Show inline comments
 
@@ -41,7 +41,7 @@ ${h.form(url('delete_repo_group', group_
 
</div>
 
${h.end_form()}
 

	
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        $("#parent_group_id").select2({
 
            'dropdownAutoWidth': true
kallithea/templates/admin/repo_groups/repo_groups.html
Show inline comments
 
@@ -30,7 +30,7 @@
 
        <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,
kallithea/templates/admin/repos/repo_add_base.html
Show inline comments
 
@@ -65,7 +65,7 @@ ${h.form(url('repos'))}
 
            </div>
 
        </div>
 
</div>
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        var setCopyPermsOption = function(group_val){
 
            if(group_val != "-1"){
kallithea/templates/admin/repos/repo_creating.html
Show inline comments
 
@@ -42,7 +42,7 @@
 
    </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))},
kallithea/templates/admin/repos/repo_edit_advanced.html
Show inline comments
 
@@ -9,7 +9,7 @@ ${h.form(url('edit_repo_advanced_fork', 
 
</div>
 
${h.end_form()}
 

	
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        $("#id_fork_of").select2({
 
            'dropdownAutoWidth': true
kallithea/templates/admin/repos/repo_edit_permissions.html
Show inline comments
 
@@ -87,9 +87,9 @@ ${h.form(url('edit_repo_perms_update', r
 
</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
 
@@ -103,7 +103,7 @@ ${h.form(url('update_repo', repo_name=c.
 
    </div>
 
    ${h.end_form()}
 

	
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        $('#repo_landing_rev').select2({
 
            'dropdownAutoWidth': true
kallithea/templates/admin/repos/repos.html
Show inline comments
 
@@ -29,7 +29,7 @@
 
    </div>
 

	
 
</div>
 
<script>
 
<script>'use strict';
 
  var data = ${h.js(c.data)};
 
  var myDataTable = $("#datatable_list_wrap").DataTable({
 
        data: data.records,
kallithea/templates/admin/settings/settings_hooks.html
Show inline comments
 
@@ -50,7 +50,7 @@ ${h.form(url('admin_settings_hooks'), me
 
${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) {
kallithea/templates/admin/settings/settings_vcs.html
Show inline comments
 
@@ -69,7 +69,7 @@ ${h.form(url('admin_settings'), method='
 
    </div>
 
    ${h.end_form()}
 

	
 
    <script>
 
    <script>'use strict';
 
        $(document).ready(function(){
 
            $('#path_unlock').on('click', function(e){
 
                $('#path_unlock_icon').removeClass('icon-lock');
kallithea/templates/admin/user_groups/user_group_add.html
Show inline comments
 
@@ -52,7 +52,7 @@
 
    ${h.end_form()}
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        $('#users_group_name').focus();
 
    });
kallithea/templates/admin/user_groups/user_group_edit_perms.html
Show inline comments
 
@@ -92,9 +92,9 @@ ${h.form(url('edit_user_group_perms_upda
 
</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
 
@@ -48,6 +48,6 @@ ${h.form(url('update_users_group', id=c.
 
                </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
 
@@ -29,7 +29,7 @@
 
        <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,
kallithea/templates/admin/users/user_add.html
Show inline comments
 
@@ -84,7 +84,7 @@
 
    ${h.end_form()}
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        $('#username').focus();
 
    });
kallithea/templates/admin/users/user_edit_api_keys.html
Show inline comments
 
@@ -77,7 +77,7 @@
 
    ${h.end_form()}
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        $("#lifetime").select2({
 
            'dropdownAutoWidth': true
kallithea/templates/admin/users/users.html
Show inline comments
 
@@ -28,7 +28,7 @@
 
    </div>
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
    var data = ${h.js(c.data)};
 
    var $dataTable = $("#datatable_list_wrap").DataTable({
 
        data: data.records,
kallithea/templates/base/base.html
Show inline comments
 
@@ -177,7 +177,7 @@
 
    </div>
 
    </div>
 
  </nav>
 
  <script>
 
  <script>'use strict';
 
    $(document).ready(function() {
 
      var bcache = {};
 

	
 
@@ -399,7 +399,7 @@
 
    </li>
 
  </ul>
 

	
 
    <script>
 
    <script>'use strict';
 
        $(document).ready(function(){
 
            var visual_show_public_icon = ${h.js(c.visual.show_public_icon)};
 
            var cache = {}
 
@@ -527,7 +527,7 @@
 
        </div>
 
    </div>
 

	
 
    <script>
 
    <script>'use strict';
 
      $(document).ready(function(){
 
          activate_parent_child_links();
 
      });
kallithea/templates/base/flash_msg.html
Show inline comments
 
@@ -9,7 +9,7 @@
 
            </div>
 
        % endfor
 
    % endif
 
    <script>
 
    <script>'use strict';
 
    if (typeof jQuery != 'undefined') {
 
        $(".alert").alert();
 
    }
kallithea/templates/base/perms_summary.html
Show inline comments
 
@@ -97,7 +97,7 @@
 
        %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;
kallithea/templates/base/root.html
Show inline comments
 
@@ -21,7 +21,7 @@
 
        <%block name="css_extra"/>
 

	
 
        ## JAVASCRIPT ##
 
        <script>
 
        <script>'use strict';
 
            ## JS translations map
 
            var TRANSLATION_MAP = {
 
                'Cancel': ${h.jshtml(_("Cancel"))},
 
@@ -77,7 +77,7 @@
 
        <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();
kallithea/templates/changelog/changelog.html
Show inline comments
 
@@ -81,7 +81,7 @@ ${self.repo_context_bar('changelog', c.f
 
                ${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_');
 

	
kallithea/templates/changelog/changelog_table.html
Show inline comments
 
@@ -110,7 +110,7 @@
 
    </tbody>
 
    </table>
 

	
 
<script>
 
<script>'use strict';
 
  $(document).ready(function() {
 
    $('#changesets .expand_commit').on('click',function(e){
 
      $(this).next('.mid').find('.message > div').toggleClass('hidden');
kallithea/templates/changeset/changeset.html
Show inline comments
 
@@ -22,7 +22,7 @@ ${self.repo_context_bar('changelog', c.c
 
  <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>
 
@@ -184,7 +184,7 @@ ${self.repo_context_bar('changelog', c.c
 
    </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));
kallithea/templates/changeset/changeset_file_comment.html
Show inline comments
 
@@ -192,7 +192,7 @@
 
  </div>
 
</div>
 

	
 
<script>
 
<script>'use strict';
 

	
 
$(document).ready(function () {
 

	
kallithea/templates/changeset/diff_block.html
Show inline comments
 
@@ -96,7 +96,7 @@
 
</%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();
kallithea/templates/compare/compare_cs.html
Show inline comments
 
@@ -66,7 +66,7 @@
 
<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_');
 

	
kallithea/templates/compare/compare_diff.html
Show inline comments
 
@@ -98,7 +98,7 @@ ${self.repo_context_bar('changelog')}
 
    </div>
 

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

	
 
   $(document).ready(function(){
 
    var cache = {};
kallithea/templates/files/diff_2way.html
Show inline comments
 
@@ -60,7 +60,7 @@ ${self.repo_context_bar('changelog')}
 
        </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))};
 

	
kallithea/templates/files/files.html
Show inline comments
 
@@ -36,7 +36,7 @@ ${self.repo_context_bar('files', c.revis
 
    </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
 
@@ -125,16 +125,16 @@ var post_load_state = function(state) {
 
    }
 

	
 
    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]);
kallithea/templates/files/files_add.html
Show inline comments
 
@@ -70,7 +70,7 @@ ${self.repo_context_bar('files')}
 
              </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);
kallithea/templates/files/files_browser.html
Show inline comments
 
@@ -109,7 +109,7 @@
 
    </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',''))};
kallithea/templates/files/files_edit.html
Show inline comments
 
@@ -77,7 +77,7 @@ ${self.repo_context_bar('files')}
 
    </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);
kallithea/templates/followers/followers.html
Show inline comments
 
@@ -25,7 +25,7 @@ ${self.repo_context_bar('followers')}
 
        </div>
 
    </div>
 
</div>
 
<script>
 
<script>'use strict';
 
  $(document).ready(function(){
 
    var $followers = $('#followers');
 
    $followers.on('click','.pager_link',function(e){
kallithea/templates/forks/fork.html
Show inline comments
 
@@ -88,7 +88,7 @@ ${self.repo_context_bar('createfork')}
 
    </div>
 
    ${h.end_form()}
 
</div>
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        $("#repo_group").select2({
 
            'dropdownAutoWidth': true
kallithea/templates/forks/forks.html
Show inline comments
 
@@ -25,7 +25,7 @@ ${self.repo_context_bar('showforks')}
 
        </div>
 
    </div>
 
</div>
 
<script>
 
<script>'use strict';
 
  $(document).ready(function(){
 
      var $forks = $('#forks');
 
      $forks.on('click','.pager_link',function(e){
kallithea/templates/index_base.html
Show inline comments
 
@@ -44,7 +44,7 @@
 
        </div>
 
    </div>
 

	
 
      <script>
 
      <script>'use strict';
 
        var data = ${h.js(c.data)},
 
            $dataTable = $("#repos_list_wrap").DataTable({
 
                data: data.records,
kallithea/templates/journal/journal.html
Show inline comments
 
@@ -41,7 +41,7 @@
 
        </div>
 
    </div>
 

	
 
<script>
 
<script>'use strict';
 

	
 
    $('#j_filter').click(function(){
 
        var $jfilter = $('#j_filter');
 
@@ -72,7 +72,7 @@
 

	
 
</script>
 

	
 
<script>
 
<script>'use strict';
 
    $(document).ready(function(){
 
        var $journal = $('#journal');
 
        $journal.on('click','.pager_link',function(e){
kallithea/templates/login.html
Show inline comments
 
@@ -64,7 +64,7 @@
 
            </div>
 
        </div>
 
        ${h.end_form()}
 
        <script>
 
        <script>'use strict';
 
        $(document).ready(function(){
 
            $('#username').focus();
 
        });
kallithea/templates/password_reset.html
Show inline comments
 
@@ -53,7 +53,7 @@
 
                </div>
 
        </div>
 
        ${h.end_form()}
 
        <script>
 
        <script>'use strict';
 
         $(document).ready(function(){
 
            $('#email').focus();
 
         });
kallithea/templates/pullrequests/pullrequest.html
Show inline comments
 
@@ -92,7 +92,7 @@ ${self.repo_context_bar('showpullrequest
 
</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;
 
@@ -162,7 +162,7 @@ ${self.repo_context_bar('showpullrequest
 
          '__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]);
 
      }
 

	
kallithea/templates/pullrequests/pullrequest_show.html
Show inline comments
 
@@ -312,7 +312,7 @@ ${self.repo_context_bar('showpullrequest
 
            </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__'))};
 
@@ -343,7 +343,7 @@ ${self.repo_context_bar('showpullrequest
 
    ## 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'));
kallithea/templates/register.html
Show inline comments
 
@@ -90,7 +90,7 @@
 
                </div>
 
        </div>
 
        ${h.end_form()}
 
        <script>
 
        <script>'use strict';
 
        $(document).ready(function(){
 
            $('#username').focus();
 
        });
kallithea/templates/summary/statistics.html
Show inline comments
 
@@ -51,7 +51,7 @@ ${self.repo_context_bar('summary')}
 
    </div>
 
</div>
 

	
 
<script>
 
<script>'use strict';
 
var data = ${h.js(c.trending_languages)};
 
var total = 0;
 
var tbl = document.createElement('table');
 
@@ -103,7 +103,7 @@ for (var i=0;i<data.length;i++){
 
    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'))};
 
@@ -118,7 +118,7 @@ for (var i=0;i<data.length;i++){
 
}
 

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

	
 
/**
 
 * Plots summary graph
 
@@ -260,7 +260,7 @@ function SummaryPlot(from,to,dataset,ove
 
        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};
 
@@ -288,7 +288,7 @@ 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];
 

	
kallithea/templates/summary/summary.html
Show inline comments
 
@@ -27,7 +27,7 @@
 
  <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){
 
@@ -238,7 +238,7 @@ hg push ${c.clone_repo_url}
 
</div>
 
%endif
 

	
 
<script>
 
<script>'use strict';
 
$(document).ready(function(){
 
    $('#clone-url input').click(function(e){
 
        if($(this).hasClass('selected')){
 
@@ -309,7 +309,7 @@ $(document).ready(function(){
 
    $('#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__'))};
 
@@ -334,7 +334,7 @@ $(document).ready(function(){
 
</script>
 

	
 
%if c.show_stats:
 
<script>
 
<script>'use strict';
 
$(document).ready(function(){
 
    var data = ${h.js(c.trending_languages)};
 
    var total = 0;
 
@@ -393,7 +393,7 @@ $(document).ready(function(){
 
        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'))};
0 comments (0 inline, 0 general)