mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 03:46:39 +08:00
Refactor inline events [SCI-8434] (#5403)
Refactor inline events in task results [SCI-8434]
This commit is contained in:
parent
df8a380a87
commit
c28f86d46d
35 changed files with 215 additions and 64 deletions
7
app/assets/javascripts/assets/asset_inline.js
Normal file
7
app/assets/javascripts/assets/asset_inline.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
/* global ActiveStoragePreviews */
|
||||
|
||||
(function() {
|
||||
$('.attachment-preview .asset-inline-image')
|
||||
.on('load', (event) => ActiveStoragePreviews.showPreview(event))
|
||||
.on('error', (event) => ActiveStoragePreviews.reCheckPreview(event));
|
||||
}());
|
7
app/assets/javascripts/assets/asset_thumbnail.js
Normal file
7
app/assets/javascripts/assets/asset_thumbnail.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
/* global ActiveStoragePreviews */
|
||||
|
||||
(function() {
|
||||
$('.attachment-preview .asset-thumbnail-image')
|
||||
.on('load', (event) => ActiveStoragePreviews.showPreview(event))
|
||||
.on('error', (event) => ActiveStoragePreviews.reCheckPreview(event));
|
||||
}());
|
|
@ -181,6 +181,12 @@
|
|||
}
|
||||
}
|
||||
|
||||
function initArchive() {
|
||||
$('#results').on('click', '.form-submit-link', function(event) {
|
||||
archive(event, this);
|
||||
});
|
||||
}
|
||||
|
||||
function init() {
|
||||
initHandsOnTables($(document));
|
||||
expandAllResults();
|
||||
|
@ -200,6 +206,8 @@
|
|||
let target = '#' + getParam('ctarget');
|
||||
$(target).find('a.comment-tab-link').click();
|
||||
}
|
||||
|
||||
initArchive();
|
||||
}
|
||||
|
||||
let publicAPI = Object.freeze({
|
||||
|
|
|
@ -741,7 +741,7 @@ var RepositoryDatatable = (function(global) {
|
|||
return TABLE;
|
||||
}
|
||||
|
||||
global.onClickDeleteRecord = function() {
|
||||
function onClickDeleteRecord() {
|
||||
animateSpinner();
|
||||
$.ajax({
|
||||
url: $('table' + TABLE_ID).data('delete-record'),
|
||||
|
@ -880,6 +880,8 @@ var RepositoryDatatable = (function(global) {
|
|||
});
|
||||
});
|
||||
|
||||
$('#deleteRepositoryRecord').on('click', '.delete-record-modal-button', onClickDeleteRecord);
|
||||
|
||||
// Handle enter key
|
||||
$(document).off('keypress').keypress(function(event) {
|
||||
var keycode = (event.keyCode ? event.keyCode : event.which);
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
//= require repositories/import/records_importer.js
|
||||
|
||||
/*
|
||||
global pageReload animateSpinner repositoryRecordsImporter I18n
|
||||
global animateSpinner repositoryRecordsImporter I18n
|
||||
RepositoryDatatable PerfectScrollbar HelperModule repositoryFilterObject
|
||||
*/
|
||||
|
||||
(function(global) {
|
||||
'use strict';
|
||||
|
||||
global.pageReload = function() {
|
||||
function pageReload() {
|
||||
animateSpinner();
|
||||
location.reload();
|
||||
};
|
||||
}
|
||||
|
||||
function handleErrorSubmit(XHR) {
|
||||
var formGroup = $('#form-records-file').find('.form-group');
|
||||
|
@ -42,8 +42,10 @@
|
|||
}
|
||||
|
||||
function initParseRecordsModal() {
|
||||
var modal = $('#parse-records-modal');
|
||||
var form = $('#form-records-file');
|
||||
var submitBtn = form.find('input[type="submit"]');
|
||||
var closeBtn = modal.find('.close-button');
|
||||
form.on('ajax:success', function(ev, data) {
|
||||
$('#modal-import-records').modal('hide');
|
||||
$(data.html).appendTo('body').promise().done(function() {
|
||||
|
@ -78,6 +80,8 @@
|
|||
contentType: false
|
||||
});
|
||||
});
|
||||
|
||||
closeBtn.on('click', pageReload);
|
||||
}
|
||||
|
||||
function initImportRecordsModal() {
|
||||
|
@ -85,6 +89,9 @@
|
|||
$('#modal-import-records').modal('show');
|
||||
initParseRecordsModal();
|
||||
});
|
||||
|
||||
const closeBtn = $('#modal-import-records').find('.close-button');
|
||||
closeBtn.on('click', pageReload);
|
||||
}
|
||||
|
||||
function initShareModal() {
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
/* global numberMinMaxValidator */
|
||||
|
||||
(function() {
|
||||
const field = $('#decimals.number-column');
|
||||
|
||||
const minValue = Number(field.data('min'));
|
||||
const maxValue = Number(field.data('max'));
|
||||
|
||||
field.on('input', () => {
|
||||
field.val(numberMinMaxValidator(field.val(), minValue, maxValue));
|
||||
});
|
||||
}());
|
|
@ -0,0 +1,12 @@
|
|||
/* global numberMinMaxValidator */
|
||||
|
||||
(function() {
|
||||
const field = $('#decimals.stock-column');
|
||||
|
||||
const minValue = Number(field.data('min'));
|
||||
const maxValue = Number(field.data('max'));
|
||||
|
||||
field.on('input', () => {
|
||||
field.val(numberMinMaxValidator(field.val(), minValue, maxValue));
|
||||
});
|
||||
}());
|
7
app/assets/javascripts/results/result_assets/edit.js
Normal file
7
app/assets/javascripts/results/result_assets/edit.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
/* global Results */
|
||||
|
||||
(function() {
|
||||
$('.edit-result-assets-buttons').on('click', '.save-result', (event) => {
|
||||
Results.processResult(event, Results.ResultTypeEnum.FILE);
|
||||
});
|
||||
}());
|
15
app/assets/javascripts/results/result_assets/new.js
Normal file
15
app/assets/javascripts/results/result_assets/new.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
/* global DragNDropResults */
|
||||
|
||||
(function() {
|
||||
$('.new-result-assets-buttons')
|
||||
.on('click', '.save-result', (event) => {
|
||||
DragNDropResults.processResult(event);
|
||||
})
|
||||
.on('click', '.cancel-new', () => {
|
||||
DragNDropResults.destroyAll();
|
||||
});
|
||||
|
||||
$('#new-result-assets-select').on('change', '#drag-n-drop-assets', function() {
|
||||
DragNDropResults.init(this.files);
|
||||
});
|
||||
}());
|
7
app/assets/javascripts/results/result_tables/edit.js
Normal file
7
app/assets/javascripts/results/result_tables/edit.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
/* global Results */
|
||||
|
||||
(function() {
|
||||
$('.edit-result-tables-buttons').on('click', '.save-result', (event) => {
|
||||
Results.processResult(event, Results.ResultTypeEnum.TABLE);
|
||||
});
|
||||
}());
|
7
app/assets/javascripts/results/result_tables/new.js
Normal file
7
app/assets/javascripts/results/result_tables/new.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
/* global Results */
|
||||
|
||||
(function() {
|
||||
$('.new-result-tables-buttons').on('click', '.save-result', (event) => {
|
||||
Results.processResult(event, Results.ResultTypeEnum.TABLE);
|
||||
});
|
||||
}());
|
7
app/assets/javascripts/results/result_texts/edit.js
Normal file
7
app/assets/javascripts/results/result_texts/edit.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
/* global Results */
|
||||
|
||||
(function() {
|
||||
$('.edit-result-texts-buttons').on('click', '.save-result', (event) => {
|
||||
Results.processResult(event, Results.ResultTypeEnum.TEXT);
|
||||
});
|
||||
}());
|
7
app/assets/javascripts/results/result_texts/new.js
Normal file
7
app/assets/javascripts/results/result_texts/new.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
/* global Results */
|
||||
|
||||
(function() {
|
||||
$('.new-result-texts-buttons').on('click', '.save-result', (event) => {
|
||||
Results.processResult(event, Results.ResultTypeEnum.TEXT);
|
||||
});
|
||||
}());
|
7
app/assets/javascripts/shared/file_preview.js
Normal file
7
app/assets/javascripts/shared/file_preview.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
/* global ActiveStoragePreviews */
|
||||
|
||||
(function() {
|
||||
$('.asset-image')
|
||||
.on('load', (event) => ActiveStoragePreviews.showPreview(event))
|
||||
.on('error', (event) => ActiveStoragePreviews.reCheckPreview(event));
|
||||
}());
|
|
@ -328,7 +328,7 @@
|
|||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="control-label">Name</label>
|
||||
<input type="text" class="form-control" onChange="DragNDropResults.validateTextSize(this)"
|
||||
<input type="text" class="form-control"
|
||||
rel="results[name]" name="results[name][${i}]">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
@ -385,6 +385,9 @@
|
|||
.promise()
|
||||
.done(function() {
|
||||
removeItemHandler(droppedFiles[i].uuid);
|
||||
$('.panel-result-attachment-new').on('change', 'input[rel="results[name]"]', function() {
|
||||
DragNDropResults.validateTextSize(this);
|
||||
});
|
||||
});
|
||||
}
|
||||
validateTotalSize();
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
(function() {
|
||||
const linkedinSignInButton = $('.linkedin-signin-button');
|
||||
const hoverSrc = linkedinSignInButton.data('hover-src');
|
||||
const defaultSrc = linkedinSignInButton.data('default-src');
|
||||
const clickSrc = linkedinSignInButton.data('click-src');
|
||||
|
||||
linkedinSignInButton
|
||||
.on('mouseover', () => {
|
||||
linkedinSignInButton.attr('src', hoverSrc);
|
||||
})
|
||||
.on('mouseout', () => {
|
||||
linkedinSignInButton.attr('src', defaultSrc);
|
||||
})
|
||||
.on('click', () => {
|
||||
linkedinSignInButton.attr('src', clickSrc);
|
||||
});
|
||||
}());
|
|
@ -43,10 +43,10 @@
|
|||
<% elsif asset.previewable? %>
|
||||
<div class="image-container">
|
||||
<%= image_tag asset.large_preview,
|
||||
onerror: 'ActiveStoragePreviews.reCheckPreview(event)',
|
||||
onload: 'ActiveStoragePreviews.showPreview(event)',
|
||||
class: 'asset-inline-image',
|
||||
style: 'opacity: 0' %>
|
||||
</div>
|
||||
<%= javascript_include_tag 'assets/asset_inline', nonce: true %>
|
||||
<% else %>
|
||||
<div class="general-file-container">
|
||||
<i class="fas <%= file_fa_icon_class(asset) if asset.file_name %>"></i>
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
<div class="attachment-preview <%= asset.file.attached? ? asset.file.metadata['asset_type'] : '' %>">
|
||||
<% if asset.previewable? %>
|
||||
<%= image_tag asset.medium_preview,
|
||||
onerror: 'ActiveStoragePreviews.reCheckPreview(event)',
|
||||
onload: 'ActiveStoragePreviews.showPreview(event)',
|
||||
class: 'asset-thumbnail-image',
|
||||
style: 'opacity: 0' %>
|
||||
<%= javascript_include_tag 'assets/asset_thumbnail', nonce: true %>
|
||||
<% else %>
|
||||
<i class="fas <%= file_fa_icon_class(asset) if asset.file_name %>"></i>
|
||||
<% end %>
|
||||
|
|
|
@ -21,8 +21,7 @@
|
|||
class="btn btn-light icon-btn form-submit-link"
|
||||
data-form-id="result-archive-form-<%= result.id %>"
|
||||
data-confirm-text="<%= t('my_modules.results.archive_confirm') %>"
|
||||
title="<%= t'my_modules.results.options.archive_title' %>"
|
||||
onclick="Results.archive(event, this);">
|
||||
title="<%= t'my_modules.results.options.archive_title' %>">
|
||||
<span class="fas fa-briefcase"></span>
|
||||
</a>
|
||||
<%= form_for :result, url: result_path_of_type(result), method: :patch, html: {id: 'result-archive-form-' + result.id.to_s } do |f| %>
|
||||
|
|
|
@ -87,12 +87,12 @@
|
|||
<!-- Libraries for formulas -->
|
||||
<%= render partial: "shared/formulas_libraries.html.erb" %>
|
||||
|
||||
<%= javascript_include_tag "assets/wopi/create_wopi_file" %>
|
||||
<%= javascript_include_tag "my_modules/results" %>
|
||||
<%= javascript_include_tag "results/result_texts" %>
|
||||
<%= javascript_include_tag "results/result_tables" %>
|
||||
<%= javascript_include_tag "results/result_assets" %>
|
||||
<%= javascript_include_tag 'pdf_js' %>
|
||||
<%= javascript_include_tag "assets/wopi/create_wopi_file", nonce: true %>
|
||||
<%= javascript_include_tag "my_modules/results", nonce: true %>
|
||||
<%= javascript_include_tag "results/result_texts", nonce: true %>
|
||||
<%= javascript_include_tag "results/result_tables", nonce: true %>
|
||||
<%= javascript_include_tag "results/result_assets", nonce: true %>
|
||||
<%= javascript_include_tag 'pdf_js', nonce: true %>
|
||||
<%= stylesheet_link_tag 'pdf_js_styles' %>
|
||||
|
||||
<%= render 'shared/tiny_mce_packs' %>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><%= t("general.cancel")%></button>
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal" onclick="onClickDeleteRecord();">
|
||||
<button type="button" class="btn btn-danger delete-record-modal-button" data-dismiss="modal">
|
||||
<%= t("repositories.modal_delete_record.delete") %>
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close" onClick="pageReload()"><span aria-hidden="true">×</span></button>
|
||||
<button type="button" class="close close-button" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"><%= t('repositories.modal_import.title') %></h4>
|
||||
<%= t("repositories.modal_import.notice") %>
|
||||
</div>
|
||||
|
@ -19,7 +19,7 @@
|
|||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" onClick="pageReload()"><%= t('general.cancel')%></button>
|
||||
<button type="button" class="btn btn-default close-button" data-dismiss="modal"><%= t('general.cancel')%></button>
|
||||
<input type="submit" class="btn btn-success" value="<%= t("repositories.modal_import.upload") %>">
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close" onClick="pageReload()"><span aria-hidden="true">×</span></button>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="parse-modal-title"><%= t('repositories.modal_parse.title') %></h4>
|
||||
</div>
|
||||
<%= bootstrap_form_tag(url: import_records_repository_path(@import_data.repository, format: :json),
|
||||
|
@ -70,7 +70,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" onClick="pageReload()"><%= t('general.cancel')%></button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><%= t('general.cancel')%></button>
|
||||
<input type="submit" class="btn btn-success" value="<%= t('repositories.modal_parse.import') %>">
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -114,10 +114,10 @@
|
|||
<%= render partial: 'save_repository_filter_modal' %>
|
||||
<% end %>
|
||||
|
||||
<%= javascript_include_tag 'repositories/edit' %>
|
||||
<%= javascript_include_tag 'repositories/repository_datatable' %>
|
||||
<%= javascript_include_tag "repositories/show" %>
|
||||
<%= javascript_include_tag 'inputmask' %>
|
||||
<%= javascript_include_tag 'emoji_button' %>
|
||||
<%= javascript_include_tag 'pdf_js' %>
|
||||
<%= javascript_include_tag 'repositories/edit', nonce: true %>
|
||||
<%= javascript_include_tag 'repositories/repository_datatable', nonce: true %>
|
||||
<%= javascript_include_tag "repositories/show", nonce: true %>
|
||||
<%= javascript_include_tag 'inputmask', nonce: true %>
|
||||
<%= javascript_include_tag 'emoji_button', nonce: true %>
|
||||
<%= javascript_include_tag 'pdf_js', nonce: true %>
|
||||
<%= stylesheet_link_tag 'pdf_js_styles' %>
|
||||
|
|
|
@ -5,8 +5,12 @@
|
|||
<%= t('libraries.manange_modal_column.number_type.decimals_label') %>
|
||||
</label>
|
||||
<div class="col-sm-3">
|
||||
<%= number_field_tag('decimals', selected_decimals, between: 0...Constants::REPOSITORY_NUMBER_TYPE_MAX_DECIMALS,
|
||||
class: 'form-control',
|
||||
oninput: "this.value = numberMinMaxValidator(this.value, 0, #{Constants::REPOSITORY_NUMBER_TYPE_MAX_DECIMALS})" ) %>
|
||||
<%= number_field_tag('decimals',
|
||||
selected_decimals,
|
||||
between: 0...Constants::REPOSITORY_NUMBER_TYPE_MAX_DECIMALS,
|
||||
class: 'form-control number-column',
|
||||
data: { min: 0, max: Constants::REPOSITORY_NUMBER_TYPE_MAX_DECIMALS }) %>
|
||||
</div>
|
||||
|
||||
<%= javascript_include_tag 'repository_columns/manage_column_partials/number', nonce: true %>
|
||||
</div>
|
||||
|
|
|
@ -7,9 +7,13 @@
|
|||
<%= t('libraries.manange_modal_column.number_type.decimals_label') %>
|
||||
</label>
|
||||
<div class="col-sm-3">
|
||||
<%= number_field_tag('decimals', selected_decimals, between: 0...Constants::REPOSITORY_NUMBER_TYPE_MAX_DECIMALS,
|
||||
class: 'form-control',
|
||||
oninput: "this.value = numberMinMaxValidator(this.value, 0, #{Constants::REPOSITORY_NUMBER_TYPE_MAX_DECIMALS})" ) %>
|
||||
<%= number_field_tag('decimals',
|
||||
selected_decimals,
|
||||
between: 0...Constants::REPOSITORY_NUMBER_TYPE_MAX_DECIMALS,
|
||||
class: 'form-control stock-column',
|
||||
data: { min: 0, max: Constants::REPOSITORY_NUMBER_TYPE_MAX_DECIMALS }) %>
|
||||
|
||||
<%= javascript_include_tag 'repository_columns/manage_column_partials/stock', nonce: true %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
|
|
@ -10,13 +10,13 @@
|
|||
<%= ff.file_field :file, direct_upload: true %>
|
||||
<% end %>
|
||||
<hr>
|
||||
<div class="align-right">
|
||||
<div class="align-right edit-result-assets-buttons">
|
||||
<button type="button" class="btn btn-secondary cancel-edit">
|
||||
<%= t("general.cancel")%>
|
||||
</button>
|
||||
<%= f.button t("general.save"),
|
||||
class: 'btn btn-primary save-result',
|
||||
onclick: "Results.processResult(event, Results.ResultTypeEnum.FILE);" %>
|
||||
class: 'btn btn-primary save-result' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= javascript_include_tag 'results/result_assets/edit', nonce: true %>
|
||||
</div>
|
||||
|
|
|
@ -12,22 +12,20 @@
|
|||
id: 'drag-n-drop-assets',
|
||||
class: 'drag-n-drop-file-input',
|
||||
direct_upload: true,
|
||||
multiple: true,
|
||||
onchange: "DragNDropResults.init(this.files);" %>
|
||||
multiple: true %>
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
<br />
|
||||
<div class="align-right">
|
||||
<div class="align-right new-result-assets-buttons">
|
||||
<%= f.button t('result_assets.new.create'),
|
||||
class: 'btn btn-primary save-result',
|
||||
onclick: 'DragNDropResults.processResult(event);',
|
||||
data: { href: my_module_result_assets_path(page: params[:page], order: params[:order], format: :json) } %>
|
||||
<%= f.button t('general.cancel'),
|
||||
class: 'btn btn-secondary cancel-new',
|
||||
onclick: 'DragNDropResults.destroyAll();',
|
||||
type: 'button '%>
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
<%= javascript_include_tag 'results/result_assets/new', nonce: true %>
|
||||
</div>
|
||||
|
|
|
@ -12,13 +12,13 @@
|
|||
<% end %>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="align-right">
|
||||
<div class="align-right edit-result-tables-buttons">
|
||||
<button type="button" class="btn btn-secondary cancel-edit">
|
||||
<%= t("general.cancel")%>
|
||||
</button>
|
||||
<%= f.button t("general.save"),
|
||||
class: 'btn btn-primary save-result',
|
||||
onclick: "Results.processResult(event, Results.ResultTypeEnum.TABLE);" %>
|
||||
class: 'btn btn-primary save-result' %>
|
||||
<%= javascript_include_tag 'results/result_tables/edit', nonce: true %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -11,13 +11,13 @@
|
|||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="align-right">
|
||||
<div class="align-right new-result-tables-buttons">
|
||||
<button type="button" class="btn btn-secondary cancel-new">
|
||||
<%= t("general.cancel")%>
|
||||
</button>
|
||||
<%= f.button t("result_tables.new.create"),
|
||||
class: 'btn btn-primary save-result',
|
||||
onclick: "Results.processResult(event, Results.ResultTypeEnum.TABLE);" %>
|
||||
class: 'btn btn-primary save-result' %>
|
||||
<%= javascript_include_tag 'results/result_tables/new', nonce: true %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -12,13 +12,13 @@
|
|||
object_id: @result.result_text.id,
|
||||
last_updated: @result.updated_at.to_i * 1000 }) %>
|
||||
<% end %><br />
|
||||
<div class="align-right">
|
||||
<div class="align-right edit-result-texts-buttons'">
|
||||
<button type="button" class="btn btn-secondary cancel-edit">
|
||||
<%= t("general.cancel")%>
|
||||
</button>
|
||||
<%= f.button t("general.save"),
|
||||
class: 'btn btn-primary save-result',
|
||||
onclick: "Results.processResult(event, Results.ResultTypeEnum.TEXT);" %>
|
||||
class: 'btn btn-primary save-result' %>
|
||||
<%= javascript_include_tag 'results/result_texts/edit', nonce: true %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -11,13 +11,13 @@
|
|||
object_id: @result.result_text.id,
|
||||
last_updated: @result.updated_at.to_i * 1000 }) %>
|
||||
<% end %><br />
|
||||
<div class="align-right">
|
||||
<div class="align-right new-result-texts-buttons'">
|
||||
<button type="button" class="btn btn-secondary cancel-new">
|
||||
<%= t("general.cancel")%>
|
||||
</button>
|
||||
<%= f.button t("result_texts.new.create"),
|
||||
class: 'btn btn-primary save-result',
|
||||
onclick: "Results.processResult(event, Results.ResultTypeEnum.TEXT);" %>
|
||||
class: 'btn btn-primary save-result' %>
|
||||
<%= javascript_include_tag 'results/result_texts/new', nonce: true %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -71,8 +71,7 @@
|
|||
<%= render partial: 'shared/pdf_viewer.html.erb', locals: { asset: asset, report_document: false } %>
|
||||
<% else %>
|
||||
<%= image_tag asset.large_preview,
|
||||
onerror: 'ActiveStoragePreviews.reCheckPreview(event)',
|
||||
onload: 'ActiveStoragePreviews.showPreview(event)',
|
||||
class: 'asset-image',
|
||||
style: 'opacity: 0' %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
|
@ -91,8 +90,7 @@
|
|||
data: {id: previous_asset.id, gallery_elements: gallery} do %>
|
||||
<% if previous_asset.previewable? %>
|
||||
<%= image_tag previous_asset.medium_preview,
|
||||
onerror: 'ActiveStoragePreviews.reCheckPreview(event)',
|
||||
onload: 'ActiveStoragePreviews.showPreview(event)',
|
||||
class: 'asset-image',
|
||||
style: 'opacity: 0' %>
|
||||
<% else %>
|
||||
<i class="fas <%= file_fa_icon_class(previous_asset) if previous_asset.file_name %>"></i>
|
||||
|
@ -112,8 +110,7 @@
|
|||
<i class="fas fa-angle-right"></i>
|
||||
<% if next_asset.previewable? %>
|
||||
<%= image_tag next_asset.medium_preview,
|
||||
onerror: 'ActiveStoragePreviews.reCheckPreview(event)',
|
||||
onload: 'ActiveStoragePreviews.showPreview(event)',
|
||||
class: 'asset-image',
|
||||
style: 'opacity: 0' %>
|
||||
<% else %>
|
||||
<i class="fas <%= file_fa_icon_class(next_asset) if next_asset.file_name %>"></i>
|
||||
|
@ -123,3 +120,5 @@
|
|||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= javascript_include_tag 'shared/file_preview', nonce: true %>
|
||||
|
|
|
@ -3,8 +3,11 @@
|
|||
<%= image_tag('linkedin/Sign-in-Large---Default.png',
|
||||
class: 'linkedin-signin-button',
|
||||
alt: "Sign in with LinkedIn",
|
||||
onmouseover: "src='#{image_path('linkedin/Sign-in-Large---Hover.png')}'",
|
||||
onmouseout: "src='#{image_path('linkedin/Sign-in-Large---Default.png')}'",
|
||||
onclick: "src='#{image_path('linkedin/Sign-in-Large---Active.png')}'") %>
|
||||
data: {
|
||||
'hover-src': image_path('linkedin/Sign-in-Large---Hover.png'),
|
||||
'default-src': image_path('linkedin/Sign-in-Large---Default.png'),
|
||||
'click-src': image_path('linkedin/Sign-in-Large---Active.png')
|
||||
}) %>
|
||||
<%= javascript_include_tag 'users/shared/linkedin_sign_in_links', nonce: true %>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
|
|
@ -111,6 +111,18 @@ Rails.application.config.assets.precompile += %w(users/registrations/team_errors
|
|||
Rails.application.config.assets.precompile += %w(users/registrations/resource_errors.js)
|
||||
Rails.application.config.assets.precompile += %w(users/registrations/new_with_provider.js)
|
||||
Rails.application.config.assets.precompile += %w(team_zip_exports/load_handson.js)
|
||||
Rails.application.config.assets.precompile += %w(repository_columns/manage_column_partials/number.js)
|
||||
Rails.application.config.assets.precompile += %w(repository_columns/manage_column_partials/stock.js)
|
||||
Rails.application.config.assets.precompile += %w(assets/asset_inline.js)
|
||||
Rails.application.config.assets.precompile += %w(assets/asset_thumbnail.js)
|
||||
Rails.application.config.assets.precompile += %w(results/result_assets/new.js)
|
||||
Rails.application.config.assets.precompile += %w(results/result_assets/edit.js)
|
||||
Rails.application.config.assets.precompile += %w(results/result_tables/new.js)
|
||||
Rails.application.config.assets.precompile += %w(results/result_tables/edit.js)
|
||||
Rails.application.config.assets.precompile += %w(results/result_texts/new.js)
|
||||
Rails.application.config.assets.precompile += %w(results/result_texts/edit.js)
|
||||
Rails.application.config.assets.precompile += %w(shared/file_preview.js)
|
||||
Rails.application.config.assets.precompile += %w(users/shared/linkedin_sign_in_links.js)
|
||||
|
||||
# Libraries needed for Handsontable formulas
|
||||
Rails.application.config.assets.precompile += %w(jquery.js)
|
||||
|
|
Loading…
Add table
Reference in a new issue