JSToolbar fixed (#100)

This commit is contained in:
Hugo Zilliox 2022-12-27 23:58:11 +01:00
parent 127af3ae25
commit 17714c542b
4 changed files with 15 additions and 5 deletions

View File

@ -37,6 +37,7 @@ Feel free to edit `assets/stylesheets/issue_dynamic_edit.css` to update the look
### 🆕 Changelog
* **v 0.9.2** : JSToolbar fixed (#100)
* **v 0.9.1** : Check version improved (avoiding update conflicts) : using [Redmine REST API](https://www.redmine.org/projects/redmine/wiki/rest_issues) and disabling check when tab is not focused (#97)
* **v 0.9.0** : JS rewritten to remove jQuery code
* **v 0.8.1** : fixed Github issue #89 : Issue version check (AJAX call) may give glitch while editing text + disable global event listener on ajaxSend

View File

@ -180,7 +180,10 @@ const cloneEditForm = function(){
cfg.height = 100;
CKEDITOR.replace("issue_description_dynamic", cfg)
}else if (typeof(jsToolBar) === typeof(Function)) {
const wikiToolbar = new jsToolBar(document.querySelector('#issue_description_dynamic')); wikiToolbar.draw();
const DynamicDescriptionToolbar = new jsToolBar(document.querySelector('#issue_description_dynamic'));
DynamicDescriptionToolbar.setHelpLink('/help/en/wiki_syntax_common_mark.html');
DynamicDescriptionToolbar.setPreviewUrl('/issues/preview?issue_id=' + _ISSUE_ID + '&project_id=' + _PROJECT_ID);
DynamicDescriptionToolbar.draw();
}
}
@ -319,7 +322,6 @@ const checkVersion = function(callback){
}
if(callback) getVersion(callback);
} else {
if(document.querySelector('#content .conflict')) document.querySelector('#content .conflict').remove();
if(callback) callback(parseInt(document.querySelector('#issue_lock_version').value));
}
} catch (e) {
@ -423,6 +425,9 @@ let sendData = function(serialized_data){
setCSRFTokenInput(doc.querySelector('input[name="authenticity_token"]').value);
updateCSRFToken(doc.querySelector('input[name="authenticity_token"]').value);
/* Once we've updated our issue, we have to reset the loadedDate to now to be up to date with the check version */
loadedDate = new Date();
setCheckVersionInterval(true);
} else {
callError(this.status);

View File

@ -78,6 +78,8 @@ body.controller-issues.action-show .dynamicEditField.open {
opacity: 1;
z-index: 999;
pointer-events: auto;
resize: horizontal;
overflow: auto;
}
body.controller-issues.action-show #TitleInput.dynamicEditField {

View File

@ -26,9 +26,11 @@ class DetailsIssueHooks < Redmine::Hook::ViewListener
def view_issues_show_details_bottom(context)
content = "<script>\n"
content << " var _TXT_CONFLICT_TITLE = \"" + l(:ide_txt_notice_conflict_title) + "\";\n"
content << " var _TXT_CONFLICT_TXT = \"" + l(:ide_txt_notice_conflict_text) + "\";\n"
content << " var _TXT_CONFLICT_LINK = \"" + l(:ide_txt_notice_conflict_link) + "\";\n"
content << " const _ISSUE_ID = \"#{context[:request].path_parameters[:id]}\";\n"
content << " const _PROJECT_ID = \"#{Issue.find(context[:request].path_parameters[:id]).project_id}\";\n"
content << " const _TXT_CONFLICT_TITLE = \"" + l(:ide_txt_notice_conflict_title) + "\";\n"
content << " const _TXT_CONFLICT_TXT = \"" + l(:ide_txt_notice_conflict_text) + "\";\n"
content << " const _TXT_CONFLICT_LINK = \"" + l(:ide_txt_notice_conflict_link) + "\";\n"
content << "</script>\n"
content << "<style>/* PRINT MEDIAQUERY */\n"
content << "@media print {\n"