Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit b2b4b869 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Merge branch 'master' into 'production'

Release 0.9.2

* Add the class `Dbui.grid.plugin.ContextMenu`

See merge request !28
parents 3f7ff919 6f78d8ba
0.9.1
\ No newline at end of file
0.9.2
\ No newline at end of file
......@@ -2,19 +2,22 @@
HEAD
0.9.2 (Sep 2016)
- Add the base class Dbui.grid.plugin.ContextMenu
0.9.1 (Aug 2016)
- Migrate to Ext JS 6.0.1.250
- Migrate to the new build system build-version6 in w2pext/utilities.
0.9.0 (Jun 2016)
- Change the name space for the JavaScript code from App to Dbui.
- Fix the latex conversion for special character.
0.8.3 (Jun 2016)
- Migrate to web2py 2.14.6 and pyDAL 16.03.
- Release requires web2py 2.14 or higher due to changes in pyDAL.
- Update build_version to run third party tools via a docker container.
0.8.2 (Feb 2016)
- Add missing files in the compressed version of the ace plugin.
- Minor modification to run the application via a docker image.
......@@ -25,12 +28,12 @@ HEAD
- Relase non backward compatible. Signatures of methods have changed:
App.buildDBURI, App.save, App.saveAs. In addition the download of pdf and
png files required a base64 String encoding on the server side.
0.7.2 - 0.7.3 (Nov - Dec 2015)
- Improve code compliance with pylint and jslint.
- build_version can generate small size version of the plugin files.
- Add the helper function inline_alert.
- Display the versions of the matplotlib and pandas libraries
- Display the versions of the matplotlib and pandas libraries
- List widget follows the allowBlank construct.
- Fix a bug in ComboBoxSlave.onMasterChange.
......
......@@ -15,7 +15,7 @@ Ext.define('Dbui', {
* The version of the plugin
* @property {String}
*/
version: '0.9.1',
version: '0.9.2',
/**
* The name of the application
......
......@@ -246,16 +246,9 @@ Ext.define('Dbui.container.Viewport', {
// unique tab identifier based on the node path
tabId = record.getPath('text', '_');
// strict rule in ExtJS 5.1 for the itemId: /^[a-z_][a-z0-9\-_]*$/i
// the itemId is the equal to the tabId
// therefore replace local character
tabId = tabId.replace(/à/g, "a");
tabId = tabId.replace(/ç/g, "c");
tabId = tabId.replace(/[éèê]/g, "e");
tabId = tabId.replace(/[ïî]/g, "i");
tabId = tabId.replace(/[öô]/g, "o");
tabId = tabId.replace(/[üû]/g, "u");
tabId = tabId.replace(/ /g, "_");
// strict rule in ExtJS 5.1 for the itemId: [a-zA-Z0-9\-_]
// replace invalid character since the itemId is the equal to the tabId
tabId = tabId.replace(/[^a-zA-Z0-9_\-]/g, "_");
// activate an existing tab
if (me.tabPanel.getComponent(tabId)) {
......
/**
* The plugin instantiating the base class for context menu.
*
* Display the context menu when the user right click on a row.
*
* @since 0.9.2
*
*/
Ext.define('Dbui.grid.plugin.ContextMenu', {
extend: 'Ext.AbstractPlugin',
alias: 'plugin.pGridContextMenu',
uses: ['Ext.menu.Menu'],
/**
* @cfg {String} menu
* The configuration of the Ext.menu.Menu to be displayed
*
*/
menu: undefined,
/**
* Initialize the plugin.
*
* @param {Dbui.grid.Panel} grid
*/
init: function (grid) {
"use strict";
var me = this;
me.setCmp(grid);
me.menu = Ext.create('Ext.menu.Menu', me.menu);
grid.on({
'containercontextmenu': me.onContainerContextMenu,
'headercontextmenu': me.onHeaderContextMenu,
'itemcontextmenu': me.onItemContextMenu,
scope: me
});
},
/**
* Destroy the plugin.
*/
destroy: function () {
"use strict";
var me = this,
grid = me.getCmp();
grid.un('containercontextmenu', me.onContainerContextMenu, me);
grid.un('headercontextmenu', me.onHeaderContextMenu, me);
grid.un('itemcontextmenu', me.onItemContextMenu, me);
Ext.destroyMembers(me, 'menu');
},
/**
* Show the context menu when right clicking in an empty grid.
*
* @param {Dbui.grid.Panel} grid
* @param {Ext.EventObject} event
*
*/
onContainerContextMenu: function (grid, event) {
"use strict";
var me = this;
event.stopEvent();
me.getCmp().getSelectionModel().deselectAll();
me.menu.showAt(event.getXY());
},
/**
* Inhibit the context menu when right clicking in the grid header.
*
* @param {Ext.grid.header.Container} gridheader
* @param {Ext.grid.column.Column} column
* @param {Ext.EventObject} event
*
*/
onHeaderContextMenu: function (gridheader, colum, event) {
"use strict";
event.stopEvent();
},
/**
* Show the context menu when right clicking in the non-empty grid.
*
* @param {Ext.view.View} view
* @param {Ext.data.Model} record
* @param {HTMLElement} item
* @param {Ext.EventObject} event
*
*/
onItemContextMenu: function (view, record, item, index, event) {
"use strict";
var me = this;
event.stopEvent();
me.menu.showAt(event.getXY());
}
});
\ No newline at end of file
......@@ -9,12 +9,8 @@
*/
Ext.define('Dbui.grid.plugin.RowEditorContextMenu', {
extend: 'Ext.AbstractPlugin',
extend: 'Dbui.grid.plugin.ContextMenu',
alias: 'plugin.pGridRowEditorContextMenu',
uses: ['Ext.menu.Menu'],
// private short cut
menu: null,
// private properties for internationalization
textAdd: 'Add',
......@@ -24,6 +20,8 @@ Ext.define('Dbui.grid.plugin.RowEditorContextMenu', {
textUpdate: 'Update',
textView: 'View',
// jshint strict: false
/**
* Initialize the plugin.
*
......@@ -31,19 +29,15 @@ Ext.define('Dbui.grid.plugin.RowEditorContextMenu', {
*/
init: function (grid) {
"use strict";
var me = this,
rowEditor = grid.getPlugin('rowEditor');
me.setCmp(grid);
// protection
if (!rowEditor) {
throw new Error('no grid row editor !!!');
}
me.menu = Ext.create('Ext.menu.Menu', {
me.menu = {
items: [{
text: me.textAdd,
iconCls: 'xaction-create',
......@@ -70,105 +64,10 @@ Ext.define('Dbui.grid.plugin.RowEditorContextMenu', {
handler: rowEditor.onDeleteRow,
scope: rowEditor
}]
});
grid.on({
'containercontextmenu': me.onContainerContextMenu,
'headercontextmenu': me.onHeaderContextMenu,
'itemcontextmenu': me.onItemContextMenu,
scope: me
});
},
/**
* Destroy the plugin.
*/
destroy: function () {
"use strict";
var me = this,
grid = me.getCmp();
grid.un('containercontextmenu', me.onContainerContextMenu, me);
grid.un('headercontextmenu', me.onHeaderContextMenu, me);
grid.un('itemcontextmenu', me.onItemContextMenu, me);
Ext.destroyMembers(me, 'menu');
},
/**
* Show the context menu when right clicking in an empty grid.
*
* @param {Dbui.grid.Panel} grid
* @param {Ext.EventObject} event
*
*/
onContainerContextMenu: function (grid, event) {
"use strict";
var me = this;
event.stopEvent();
me.protectBufferedStore();
me.getCmp().getSelectionModel().deselectAll();
me.menu.showAt(event.getXY());
},
};
/**
* Inhibit the context menu when right clicking in the grid header.
*
* @param {Ext.grid.header.Container} gridheader
* @param {Ext.grid.column.Column} column
* @param {Ext.EventObject} event
*
*/
onHeaderContextMenu: function (gridheader, colum, event) {
"use strict";
event.stopEvent();
},
/**
* Show the context menu when right clicking in the non-empty grid.
*
* @param {Ext.view.View} view
* @param {Ext.data.Model} record
* @param {HTMLElement} item
* @param {Ext.EventObject} event
*
*/
onItemContextMenu: function (view, record, item, index, event) {
"use strict";
var me = this;
event.stopEvent();
me.protectBufferedStore();
me.menu.showAt(event.getXY());
},
// private method to protected buffered store.
// NOTE: in ExtJS 4.2.1 the editor operations crashed with a buffered store
protectBufferedStore: function () {
"use strict";
var me = this,
i,
items,
store = me.getCmp().getStore();
if (store.buffered && Ext.getVersion('extjs').version === '4.2.1.883') {
items = me.menu.query('menuitem');
for (i = 0; i < items.length; i += 1) {
// separate menuitem from menuseparator
if (items[i].getXType() === 'menuitem') {
items[i].setDisabled(true);
}
}
}
// initialise the base class
me.callParent(arguments);
}
// jshint strict: true
});
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment