Toolbar button to insert a table (#1575).

Patch by Mizuki ISHIKAWA and Hiroyuki ENDO.


git-svn-id: http://svn.redmine.org/redmine/trunk@19561 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2020-03-04 14:02:10 +00:00
parent db2118fd82
commit a748b9ba58
53 changed files with 137 additions and 0 deletions

View File

@@ -170,6 +170,24 @@ jsToolBar.prototype.elements.unbq = {
}
}
// table
jsToolBar.prototype.elements.table = {
type: 'button',
title: 'Table',
fn: {
wiki: function() {
var This = this;
this.tableMenu(function(cols, rowCount){
This.encloseLineSelection(
'|'+cols.join(' |')+' |\n' + // header
Array(cols.length+1).join('|--')+'|\n' + // second line
Array(rowCount+1).join(Array(cols.length+1).join('| ')+'|\n') // cells
);
});
}
}
}
// pre
jsToolBar.prototype.elements.pre = {
type: 'button',