[wp-hackers] zeroclipboard in WP backend

24/7 24-7 at gmx.net
Fri May 7 12:36:41 UTC 2010

Servus Frank,

It's contained in the "TableTools"-Plugin for "DataTables"
(http://datatables.net/plug-ins/) too. I don't use it as a standalone and
you are not really specific, what your usage is, so i guess, you just want
to know how the definitions are?

/* All just copy/paste from a theme */

/* How i register it for themes: */
$path = get_bloginfo('stylesheet_directory);
If (is_admin()) {
add_action('hook_scripts',  wp_enqueue_script( 'jquery_zero_clip_board',
$path . '/media/ZeroClipboard/ZeroClipboard.js', array('jquery') ), 32 );

/* Def: */
function get_admin_script_def() {
// Globale Definitionen
$path = get_bloginfo('stylesheet_directory);
$no_conflict = 'jQuery.noConflict();' . "\n";
$jquery_doc_ready_func = "\t" . 'jQuery(document).ready(function() {' .
$jquery_end_func = "\t" .'} );' . "\n";

$table_tools_def = $jquery_doc_ready_func;
$table_tools_def .= "\t\t\t" . '"sSwfPath": "' . $path .
'/media/swf/ZeroClipboard.swf",' . "\n";
$table_tools_def .= $jquery_end_func;

$scripts = "\n";
$scripts .= "\n";
$scripts .= '<script type="text/javascript">' . "\n";
$scripts .= $table_tools_def;
$scripts .= '';
$scripts .= '</script>' . "\n";

print apply_filters('get_admin_script_def', $scripts);

The Problem was, that i could not change the original path that came with
the download. It's all hard-coded as far as i remember.

I know that you are some sort of wp-guru (i'm often reading your page), so i
know that i can't help you more than this. But maybe you want to take a look
at the support forum of Allan Jardin(?) who makes the DataTables-Plugin.
There are a lot of threads about TableTools and ZeroClipboard.

Best wishes,

Ps. Da es auf Deutsch manchmal leichter ist, kannst Du mich auch gerne
direkt anschreiben.

-----Ursprüngliche Nachricht-----
Von: Frank Bueltge [mailto:frank at bueltge.de] 
Gesendet: Freitag, 07. Mai 2010 10:55
An: wp-hackers at lists.automattic.com
Betreff: [wp-hackers] zeroclipboard in WP backend


i will include the http://code.google.com/p/zeroclipboard/ on a plugin in WP
backend and works not, i'm frustrated.
I use this js on other sites, works perfectly. Maybe a reader of this mail
has an example for use this js on the backend of WP?

thanks for reply
best wishes

More information about the wp-hackers mailing list