Kaynağa Gözat

lgtm minor fixes (#3580)

* Replace a typeof test against undefined with comparison against a string

* Add rel='noopener noreferrer' attributes to target='_blank' links

* Remove a duplicate object property definition

* Remove superfluous argument to function call

* Remove some variable declarations for which the assigned value is never read

* Remove an assignment to a variable that is never read
version-14
Alex Ford 8 yıl önce
committed by Rushabh Mehta
ebeveyn
işleme
78c03b90c3
12 değiştirilmiş dosya ile 11 ekleme ve 16 silme
  1. +1
    -1
      frappe/core/page/permission_manager/permission_manager_help.html
  2. +1
    -1
      frappe/desk/page/applications/application_row.html
  3. +1
    -1
      frappe/desk/page/backups/backups.html
  4. +1
    -1
      frappe/public/js/frappe/form/footer/timeline_item.html
  5. +0
    -1
      frappe/public/js/frappe/misc/common.js
  6. +1
    -1
      frappe/public/js/frappe/query_string.js
  7. +1
    -3
      frappe/public/js/frappe/toolbar.js
  8. +2
    -2
      frappe/public/js/frappe/ui/toolbar/navbar.html
  9. +0
    -1
      frappe/public/js/frappe/views/reports/grid_report.js
  10. +0
    -1
      frappe/public/js/frappe/views/reports/query_report.js
  11. +2
    -2
      frappe/website/doctype/web_form/templates/web_form.html
  12. +1
    -1
      frappe/website/js/web_form.js

+ 1
- 1
frappe/core/page/permission_manager/permission_manager_help.html Dosyayı Görüntüle

@@ -36,6 +36,6 @@
<li>{%= __("Apart from System Manager, roles with Set User Permissions right can set permissions for other users for that Document Type.") %}</li>
</ol>
<p>{%= __("If these instructions where not helpful, please add in your suggestions on GitHub Issues.") %}
<a href="https://github.com/frappe/frappe/issues" target="_blank">{%= __("Submit an Issue") %}</a>
<a href="https://github.com/frappe/frappe/issues" target="_blank" rel="noopener noreferrer">{%= __("Submit an Issue") %}</a>
</p>
</div>

+ 1
- 1
frappe/desk/page/applications/application_row.html Dosyayı Görüntüle

@@ -5,7 +5,7 @@
<div class="media">
<div class="pull-right app-buttons">
<a class="btn btn-default btn-xs"
href="{{ app.app_url }}" target="_blank">{{ __("Website") }}</a>
href="{{ app.app_url }}" target="_blank" rel="noopener noreferrer">{{ __("Website") }}</a>
{% if (app.installed) { %}
<button class="btn btn-danger btn-xs btn-remove"
data-title="{{ app.app_title }}"


+ 1
- 1
frappe/desk/page/backups/backups.html Dosyayı Görüntüle

@@ -21,7 +21,7 @@
{{ f[1] }}
</td>
<td>
<a href="{{ f[0] }}" target="_blank">{{ f[0] }}</a>
<a href="{{ f[0] }}" target="_blank" rel="noopener noreferrer">{{ f[0] }}</a>
</td>
<td>
{{ f[2] }}


+ 1
- 1
frappe/public/js/frappe/form/footer/timeline_item.html Dosyayı Görüntüle

@@ -110,7 +110,7 @@
{% $.each(data.attachments, function(i, a) { %}
<div class="ellipsis">
<a href="{%= encodeURI(a.file_url).replace(/#/g, \'%23\') %}"
class="text-muted small" target="_blank">
class="text-muted small" target="_blank" rel="noopener noreferrer">
<i class="fa fa-paperclip"></i>
{%= a.file_url.split("/").slice(-1)[0] %}
{% if (a.is_private) { %}


+ 0
- 1
frappe/public/js/frappe/misc/common.js Dosyayı Görüntüle

@@ -4,7 +4,6 @@ frappe.avatar = function(user, css_class, title) {
if(user) {
// desk
var user_info = frappe.user_info(user);
var image = frappe.utils.get_file_link(user_info.image);
} else {
// website
user_info = {


+ 1
- 1
frappe/public/js/frappe/query_string.js Dosyayı Görüntüle

@@ -23,7 +23,7 @@ function get_query_params(query_string) {
}

if (key in query_params) {
if (typeof query_params[key] === undefined) {
if (typeof query_params[key] === "undefined") {
query_params[key] = [];
} else if (typeof query_params[key] === "string") {
query_params[key] = [query_params[key]];


+ 1
- 3
frappe/public/js/frappe/toolbar.js Dosyayı Görüntüle

@@ -3,8 +3,6 @@

$(document).on("toolbar_setup", function() {
var help_links = [];
var support_link = "#upgrade";
var chat_link = "#upgrade";
var limits = frappe.boot.limits;

if(frappe.boot.expiry_message) {
@@ -24,7 +22,7 @@ $(document).on("toolbar_setup", function() {
}

if(limits.support_email) {
support_link = 'mailto:'+frappe.boot.limits.support_email;
var support_link = 'mailto:'+frappe.boot.limits.support_email;
help_links.push('<li><a href="'+support_link+'">' + frappe._('Email Support') + '</a></li>');
}



+ 2
- 2
frappe/public/js/frappe/ui/toolbar/navbar.html Dosyayı Görüntüle

@@ -28,7 +28,7 @@
{%= __("My Settings") %}</a></li>
<li><a href="#" onclick="return frappe.ui.toolbar.clear_cache();">
{%= __("Reload") %}</a></li>
<li><a href="/index" target="_blank">
<li><a href="/index" target="_blank" rel="noopener noreferrer">
{%= __("View Website") %}</a></li>
<li><a href="#background_jobs">
{%= __("Background Jobs") %}</a></li>
@@ -54,7 +54,7 @@
<li class="divider"></li>
<li>
<a data-link-type="documentation"
data-path="/documentation/index" target="_blank">{{ __("Documentation") }}</a>
data-path="/documentation/index" target="_blank" rel="noopener noreferrer">{{ __("Documentation") }}</a>
</li>
<li class="divider documentation-links"></li>
<li><a href="#" onclick="return frappe.ui.toolbar.show_about();">


+ 0
- 1
frappe/public/js/frappe/views/reports/grid_report.js Dosyayı Görüntüle

@@ -767,7 +767,6 @@ frappe.views.TreeGridReport = frappe.views.GridReportWithPlot.extend({
},
tree_formatter: function (row, cell, value, columnDef, dataContext) {
var me = frappe.cur_grid_report;
value = value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
var data = me.data;
var spacer = "<span style='display:inline-block;height:1px;width:" +
(15 * dataContext["indent"]) + "px'></span>";


+ 0
- 1
frappe/public/js/frappe/views/reports/query_report.js Dosyayı Görüntüle

@@ -228,7 +228,6 @@ frappe.views.QueryReport = Class.extend({

//Render Report in HTML
var html = frappe.render_template("print_template", {
columns:columns,
content:content,
title:__(this.report_name),
base_url: base_url,


+ 2
- 2
frappe/website/doctype/web_form/templates/web_form.html Dosyayı Görüntüle

@@ -35,7 +35,7 @@
{%- if allow_print and not is_list and not _login_required -%}
<div class='text-right'>
<a class='text-muted small' href='/printview?doctype={{ doc.doctype}}&name={{ doc.name }}
{%- if print_format -%}&format={{ print_format }}{%- endif -%}' target="_blank">
{%- if print_format -%}&format={{ print_format }}{%- endif -%}' target="_blank" rel="noopener noreferrer">
<i class='fa fa-print'></i> {{ _("Print") }}</a>
</div>
{%- endif -%}
@@ -250,7 +250,7 @@
<div class="row">
<div class="col-sm-9">
<p class="text-muted">
<a class="btn btn-default btn-sm" href="{{ doc.route }}" target="_blank">
<a class="btn btn-default btn-sm" href="{{ doc.route }}" target="_blank" rel="noopener noreferrer">
{{ web_page_link_text }}</a>
</p>
</div>


+ 1
- 1
frappe/website/js/web_form.js Dosyayı Görüntüle

@@ -166,7 +166,7 @@ frappe.ready(function() {
$(this).find('[data-child-row=1]').each(function() {
if(!$(this).hasClass('hidden')) {
frappe.mandatory_missing_in_last_doc = [];
var d = get_data_for_doctype($(this), doctype, true);
var d = get_data_for_doctype($(this), doctype);

// set name of child record (if set)
var name = $(this).attr('data-name');


Yükleniyor…
İptal
Kaydet