From 7ecca728cfa3ee9132c54294949eef3440161b0c Mon Sep 17 00:00:00 2001 From: Alejandro Navarro Date: Mon, 16 Dec 2013 21:42:48 +0100 Subject: [PATCH] Copy to clipboard message editable Now, there is a way to customise the "copy to clipboard message" using "sInfo" inside "copy" button options. Two other new vars added: "sLine" and "sLines" to show lines copied in any language. --- media/js/TableTools.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/media/js/TableTools.js b/media/js/TableTools.js index a3e5bca..c12ff93 100755 --- a/media/js/TableTools.js +++ b/media/js/TableTools.js @@ -2276,6 +2276,9 @@ TableTools.BUTTONS = { "sAction": "flash_copy", "sButtonClass": "DTTT_button_copy", "sButtonText": "Copy", + "sInfo": "
Table copied

Table copied to the clipboard.

", + "sLines": "lines", + "sLine": "line", "fnClick": function( nButton, oConfig, flash ) { this.fnSetText( flash, this.fnGetTableData(oConfig) ); }, @@ -2283,11 +2286,8 @@ TableTools.BUTTONS = { var lines = text.split('\n').length, len = this.s.dt.nTFoot === null ? lines-1 : lines-2, - plural = (len==1) ? "" : "s"; - this.fnInfo( '
Table copied
'+ - '

Copied '+len+' row'+plural+' to the clipboard.

', - 1500 - ); + text = (len==1) ? oConfig.sInfo + "(" + lines + " " + oConfig.sLine + ")" : oConfig.sInfo + "(" + lines + " " + oConfig.sLines + ")"; + this.fnInfo( text, 1500 ); } } ),