MCPcopy Index your code
hub / github.com/DataTables/TableTools / factory

Function factory

js/dataTables.tableTools.js:36–3212  ·  view source on GitHub ↗
( $, DataTable )

Source from the content-addressed store, hash-verified

34
35
36var factory = function( $, DataTable ) {
37"use strict";
38
39
40//include ZeroClipboard.js
41/* ZeroClipboard 1.0.4
42 * Author: Joseph Huckaby
43 */
44
45var ZeroClipboard_TableTools = {
46
47 version: "1.0.4-TableTools2",
48 clients: {}, // registered upload clients on page, indexed by id
49 moviePath: '', // URL to movie
50 nextId: 1, // ID of next movie
51
52 $: function(thingy) {
53 // simple DOM lookup utility function
54 if (typeof(thingy) == 'string') {
55 thingy = document.getElementById(thingy);
56 }
57 if (!thingy.addClass) {
58 // extend element with a few useful methods
59 thingy.hide = function() { this.style.display = 'none'; };
60 thingy.show = function() { this.style.display = ''; };
61 thingy.addClass = function(name) { this.removeClass(name); this.className += ' ' + name; };
62 thingy.removeClass = function(name) {
63 this.className = this.className.replace( new RegExp("\\s*" + name + "\\s*"), " ").replace(/^\s+/, '').replace(/\s+$/, '');
64 };
65 thingy.hasClass = function(name) {
66 return !!this.className.match( new RegExp("\\s*" + name + "\\s*") );
67 };
68 }
69 return thingy;
70 },
71
72 setMoviePath: function(path) {
73 // set path to ZeroClipboard.swf
74 this.moviePath = path;
75 },
76
77 dispatch: function(id, eventName, args) {
78 // receive event from flash movie, send to client
79 var client = this.clients[id];
80 if (client) {
81 client.receiveEvent(eventName, args);
82 }
83 },
84
85 register: function(id, client) {
86 // register new client to receive events
87 this.clients[id] = client;
88 },
89
90 getDOMObjectPosition: function(obj) {
91 // get absolute coordinates for dom element
92 var info = {
93 left: 0,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected