rjack-solr 3.6.2.0-java → 4.0.0.0-java
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +5 -0
- data/Manifest.txt +268 -33
- data/NOTICE.txt +1 -1
- data/README.rdoc +6 -6
- data/assembly.xml +2 -2
- data/bin/rjack-solr-fg +1 -1
- data/init/rjack-solr +2 -2
- data/lib/rjack-solr.rb +7 -2
- data/lib/rjack-solr/base.rb +2 -2
- data/lib/rjack-solr/commons-cli-1.2.jar +0 -0
- data/lib/rjack-solr/config.rb +1 -1
- data/lib/rjack-solr/server.rb +1 -1
- data/lib/rjack-solr/solr-core-4.0.0.jar +0 -0
- data/lib/rjack-solr/solr-solrj-4.0.0.jar +0 -0
- data/pom.xml +19 -6
- data/test/test_solr.rb +7 -5
- data/webapp/META-INF/LICENSE.txt +0 -940
- data/webapp/META-INF/MANIFEST.MF +5 -5
- data/webapp/META-INF/NOTICE.txt +160 -93
- data/webapp/WEB-INF/web.xml +57 -43
- data/webapp/admin.html +140 -0
- data/webapp/css/chosen.css +392 -0
- data/webapp/css/styles/analysis.css +293 -0
- data/webapp/css/styles/cloud.css +331 -0
- data/webapp/css/styles/common.css +593 -0
- data/webapp/css/styles/cores.css +203 -0
- data/webapp/css/styles/dashboard.css +127 -0
- data/webapp/css/styles/dataimport.css +222 -0
- data/webapp/css/styles/index.css +195 -0
- data/webapp/css/styles/java-properties.css +33 -0
- data/webapp/css/styles/logging.css +323 -0
- data/webapp/css/styles/menu.css +272 -0
- data/webapp/css/styles/plugins.css +175 -0
- data/webapp/css/styles/query.css +137 -0
- data/webapp/css/styles/replication.css +494 -0
- data/webapp/css/styles/schema-browser.css +476 -0
- data/webapp/css/styles/threads.css +153 -0
- data/webapp/img/ZeroClipboard.swf +0 -0
- data/webapp/img/chosen-sprite.png +0 -0
- data/webapp/img/div.gif +0 -0
- data/webapp/{admin → img}/favicon.ico +0 -0
- data/webapp/img/filetypes/7z.png +0 -0
- data/webapp/img/filetypes/README +27 -0
- data/webapp/img/filetypes/ai.png +0 -0
- data/webapp/img/filetypes/aiff.png +0 -0
- data/webapp/img/filetypes/asc.png +0 -0
- data/webapp/img/filetypes/audio.png +0 -0
- data/webapp/img/filetypes/bin.png +0 -0
- data/webapp/img/filetypes/bz2.png +0 -0
- data/webapp/img/filetypes/c.png +0 -0
- data/webapp/img/filetypes/cfc.png +0 -0
- data/webapp/img/filetypes/cfm.png +0 -0
- data/webapp/img/filetypes/chm.png +0 -0
- data/webapp/img/filetypes/class.png +0 -0
- data/webapp/img/filetypes/conf.png +0 -0
- data/webapp/img/filetypes/cpp.png +0 -0
- data/webapp/img/filetypes/cs.png +0 -0
- data/webapp/img/filetypes/css.png +0 -0
- data/webapp/img/filetypes/csv.png +0 -0
- data/webapp/img/filetypes/deb.png +0 -0
- data/webapp/img/filetypes/divx.png +0 -0
- data/webapp/img/filetypes/doc.png +0 -0
- data/webapp/img/filetypes/dot.png +0 -0
- data/webapp/img/filetypes/eml.png +0 -0
- data/webapp/img/filetypes/enc.png +0 -0
- data/webapp/img/filetypes/file.png +0 -0
- data/webapp/img/filetypes/gif.png +0 -0
- data/webapp/img/filetypes/gz.png +0 -0
- data/webapp/img/filetypes/hlp.png +0 -0
- data/webapp/img/filetypes/htm.png +0 -0
- data/webapp/img/filetypes/html.png +0 -0
- data/webapp/img/filetypes/image.png +0 -0
- data/webapp/img/filetypes/iso.png +0 -0
- data/webapp/img/filetypes/jar.png +0 -0
- data/webapp/img/filetypes/java.png +0 -0
- data/webapp/img/filetypes/jpeg.png +0 -0
- data/webapp/img/filetypes/jpg.png +0 -0
- data/webapp/img/filetypes/js.png +0 -0
- data/webapp/img/filetypes/lua.png +0 -0
- data/webapp/img/filetypes/m.png +0 -0
- data/webapp/img/filetypes/mm.png +0 -0
- data/webapp/img/filetypes/mov.png +0 -0
- data/webapp/img/filetypes/mp3.png +0 -0
- data/webapp/img/filetypes/mpg.png +0 -0
- data/webapp/img/filetypes/odc.png +0 -0
- data/webapp/img/filetypes/odf.png +0 -0
- data/webapp/img/filetypes/odg.png +0 -0
- data/webapp/img/filetypes/odi.png +0 -0
- data/webapp/img/filetypes/odp.png +0 -0
- data/webapp/img/filetypes/ods.png +0 -0
- data/webapp/img/filetypes/odt.png +0 -0
- data/webapp/img/filetypes/ogg.png +0 -0
- data/webapp/img/filetypes/pdf.png +0 -0
- data/webapp/img/filetypes/pgp.png +0 -0
- data/webapp/img/filetypes/php.png +0 -0
- data/webapp/img/filetypes/pl.png +0 -0
- data/webapp/img/filetypes/png.png +0 -0
- data/webapp/img/filetypes/ppt.png +0 -0
- data/webapp/img/filetypes/ps.png +0 -0
- data/webapp/img/filetypes/py.png +0 -0
- data/webapp/img/filetypes/ram.png +0 -0
- data/webapp/img/filetypes/rar.png +0 -0
- data/webapp/img/filetypes/rb.png +0 -0
- data/webapp/img/filetypes/rm.png +0 -0
- data/webapp/img/filetypes/rpm.png +0 -0
- data/webapp/img/filetypes/rtf.png +0 -0
- data/webapp/img/filetypes/sig.png +0 -0
- data/webapp/img/filetypes/sql.png +0 -0
- data/webapp/img/filetypes/swf.png +0 -0
- data/webapp/img/filetypes/sxc.png +0 -0
- data/webapp/img/filetypes/sxd.png +0 -0
- data/webapp/img/filetypes/sxi.png +0 -0
- data/webapp/img/filetypes/sxw.png +0 -0
- data/webapp/img/filetypes/tar.png +0 -0
- data/webapp/img/filetypes/tex.png +0 -0
- data/webapp/img/filetypes/tgz.png +0 -0
- data/webapp/img/filetypes/txt.png +0 -0
- data/webapp/img/filetypes/vcf.png +0 -0
- data/webapp/img/filetypes/video.png +0 -0
- data/webapp/img/filetypes/vsd.png +0 -0
- data/webapp/img/filetypes/wav.png +0 -0
- data/webapp/img/filetypes/wma.png +0 -0
- data/webapp/img/filetypes/wmv.png +0 -0
- data/webapp/img/filetypes/xls.png +0 -0
- data/webapp/img/filetypes/xml.png +0 -0
- data/webapp/img/filetypes/xpi.png +0 -0
- data/webapp/img/filetypes/xvid.png +0 -0
- data/webapp/img/filetypes/zip.png +0 -0
- data/webapp/img/ico/arrow-000-small.png +0 -0
- data/webapp/img/ico/arrow-circle.png +0 -0
- data/webapp/img/ico/arrow-switch.png +0 -0
- data/webapp/img/ico/asterisk.png +0 -0
- data/webapp/img/ico/battery.png +0 -0
- data/webapp/img/ico/block-small.png +0 -0
- data/webapp/img/ico/block.png +0 -0
- data/webapp/img/ico/book-open-text.png +0 -0
- data/webapp/img/ico/box.png +0 -0
- data/webapp/img/ico/bug.png +0 -0
- data/webapp/img/ico/chart.png +0 -0
- data/webapp/img/ico/chevron-small-expand.png +0 -0
- data/webapp/img/ico/chevron-small.png +0 -0
- data/webapp/img/ico/clipboard-list.png +0 -0
- data/webapp/img/ico/clipboard-paste-document-text.png +0 -0
- data/webapp/img/ico/clipboard-paste.png +0 -0
- data/webapp/img/ico/clock-select-remain.png +0 -0
- data/webapp/img/ico/clock-select.png +0 -0
- data/webapp/img/ico/construction.png +0 -0
- data/webapp/img/ico/cross-0.png +0 -0
- data/webapp/img/ico/cross-1.png +0 -0
- data/webapp/img/ico/cross.png +0 -0
- data/webapp/img/ico/dashboard.png +0 -0
- data/webapp/img/ico/database.png +0 -0
- data/webapp/img/ico/databases.png +0 -0
- data/webapp/img/ico/disk-black.png +0 -0
- data/webapp/img/ico/document-convert.png +0 -0
- data/webapp/img/ico/document-import.png +0 -0
- data/webapp/img/ico/document-list.png +0 -0
- data/webapp/img/ico/document-text.png +0 -0
- data/webapp/img/ico/download-cloud.png +0 -0
- data/webapp/img/ico/exclamation-button.png +0 -0
- data/webapp/img/ico/eye.png +0 -0
- data/webapp/img/ico/folder-export.png +0 -0
- data/webapp/img/ico/folder-tree.png +0 -0
- data/webapp/img/ico/folder.png +0 -0
- data/webapp/img/ico/funnel-small.png +0 -0
- data/webapp/img/ico/funnel.png +0 -0
- data/webapp/img/ico/gear.png +0 -0
- data/webapp/img/ico/globe-network.png +0 -0
- data/webapp/img/ico/globe.png +0 -0
- data/webapp/img/ico/hammer-screwdriver.png +0 -0
- data/webapp/img/ico/hand.png +0 -0
- data/webapp/img/ico/highlighter-text.png +0 -0
- data/webapp/img/ico/hourglass--exclamation.png +0 -0
- data/webapp/img/ico/hourglass.png +0 -0
- data/webapp/img/ico/inbox-document-text.png +0 -0
- data/webapp/img/ico/information-button.png +0 -0
- data/webapp/img/ico/information-small.png +0 -0
- data/webapp/img/ico/information-white.png +0 -0
- data/webapp/img/ico/information.png +0 -0
- data/webapp/img/ico/jar.png +0 -0
- data/webapp/img/ico/magnifier.png +0 -0
- data/webapp/img/ico/mail.png +0 -0
- data/webapp/img/ico/memory.png +0 -0
- data/webapp/img/ico/molecule.png +0 -0
- data/webapp/img/ico/network-cloud.png +0 -0
- data/webapp/img/ico/network-status-away.png +0 -0
- data/webapp/img/ico/network-status-busy.png +0 -0
- data/webapp/img/ico/network-status-offline.png +0 -0
- data/webapp/img/ico/network-status.png +0 -0
- data/webapp/img/ico/network.png +0 -0
- data/webapp/img/ico/node-design.png +0 -0
- data/webapp/img/ico/node-master.png +0 -0
- data/webapp/img/ico/node-select.png +0 -0
- data/webapp/img/ico/node-slave.png +0 -0
- data/webapp/img/ico/node.png +0 -0
- data/webapp/img/ico/pencil-small.png +0 -0
- data/webapp/img/ico/plus-button.png +0 -0
- data/webapp/img/ico/processor.png +0 -0
- data/webapp/img/ico/prohibition.png +0 -0
- data/webapp/img/ico/property.png +0 -0
- data/webapp/img/ico/question-small-white.png +0 -0
- data/webapp/img/ico/question-white.png +0 -0
- data/webapp/img/ico/question.png +0 -0
- data/webapp/img/ico/receipt-invoice.png +0 -0
- data/webapp/img/ico/receipt.png +0 -0
- data/webapp/img/ico/script-code.png +0 -0
- data/webapp/img/ico/server-cast.png +0 -0
- data/webapp/img/ico/server.png +0 -0
- data/webapp/img/ico/sitemap.png +0 -0
- data/webapp/img/ico/slash.png +0 -0
- data/webapp/img/ico/status-away.png +0 -0
- data/webapp/img/ico/status-busy.png +0 -0
- data/webapp/img/ico/status-offline.png +0 -0
- data/webapp/img/ico/status.png +0 -0
- data/webapp/img/ico/system-monitor--exclamation.png +0 -0
- data/webapp/img/ico/system-monitor.png +0 -0
- data/webapp/img/ico/table.png +0 -0
- data/webapp/img/ico/terminal.png +0 -0
- data/webapp/img/ico/tick-circle.png +0 -0
- data/webapp/img/ico/tick-red.png +0 -0
- data/webapp/img/ico/tick.png +0 -0
- data/webapp/img/ico/toggle-small-expand.png +0 -0
- data/webapp/img/ico/toggle-small.png +0 -0
- data/webapp/img/ico/toolbox.png +0 -0
- data/webapp/img/ico/ui-accordion.png +0 -0
- data/webapp/img/ico/ui-address-bar.png +0 -0
- data/webapp/img/ico/ui-check-box-uncheck.png +0 -0
- data/webapp/img/ico/ui-check-box.png +0 -0
- data/webapp/img/ico/ui-radio-button-uncheck.png +0 -0
- data/webapp/img/ico/ui-radio-button.png +0 -0
- data/webapp/img/ico/ui-text-field-select.png +0 -0
- data/webapp/img/ico/users.png +0 -0
- data/webapp/img/ico/wooden-box.png +0 -0
- data/webapp/img/ico/zone.png +0 -0
- data/webapp/img/loader-light.gif +0 -0
- data/webapp/img/loader.gif +0 -0
- data/webapp/img/lucene-ico.png +0 -0
- data/webapp/img/solr-ico.png +0 -0
- data/webapp/{admin/solr_small.png → img/solr.png} +0 -0
- data/webapp/img/tree.png +0 -0
- data/webapp/js/lib/ZeroClipboard.js +317 -0
- data/webapp/js/lib/chosen.js +953 -0
- data/webapp/{admin/get-properties.jsp → js/lib/console.js} +13 -10
- data/webapp/js/lib/d3.js +9342 -0
- data/webapp/js/lib/highlight.js +1 -0
- data/webapp/{admin/jquery-1.4.3.min.js → js/lib/jquery-1.7.2.min.js} +0 -0
- data/webapp/js/lib/jquery.blockUI.js +499 -0
- data/webapp/js/lib/jquery.cookie.js +47 -0
- data/webapp/js/lib/jquery.form.js +782 -0
- data/webapp/js/lib/jquery.jstree.js +3510 -0
- data/webapp/js/lib/jquery.sammy.js +1856 -0
- data/webapp/js/lib/jquery.sparkline.js +1271 -0
- data/webapp/js/lib/jquery.timeago.js +165 -0
- data/webapp/js/lib/linker.js +48 -0
- data/webapp/js/lib/order.js +189 -0
- data/webapp/js/main.js +57 -0
- data/webapp/js/require.js +11319 -0
- data/webapp/js/scripts/analysis.js +549 -0
- data/webapp/js/scripts/app.js +368 -0
- data/webapp/js/scripts/cloud.js +719 -0
- data/webapp/js/scripts/cores.js +540 -0
- data/webapp/js/scripts/dashboard.js +540 -0
- data/webapp/js/scripts/dataimport.js +567 -0
- data/webapp/js/scripts/file.js +56 -0
- data/webapp/js/scripts/index.js +344 -0
- data/webapp/js/scripts/java-properties.js +107 -0
- data/webapp/js/scripts/logging.js +519 -0
- data/webapp/js/scripts/ping.js +72 -0
- data/webapp/js/scripts/plugins.js +426 -0
- data/webapp/js/scripts/query.js +170 -0
- data/webapp/js/scripts/replication.js +557 -0
- data/webapp/js/scripts/schema-browser.js +1206 -0
- data/webapp/js/scripts/threads.js +159 -0
- data/webapp/tpl/analysis.html +83 -0
- data/webapp/tpl/cloud.html +54 -0
- data/webapp/tpl/cores.html +215 -0
- data/webapp/tpl/dashboard.html +164 -0
- data/webapp/tpl/dataimport.html +123 -0
- data/webapp/tpl/index.html +250 -0
- data/webapp/tpl/logging.html +23 -0
- data/webapp/tpl/plugins.html +39 -0
- data/webapp/tpl/query.html +318 -0
- data/webapp/tpl/replication.html +207 -0
- data/webapp/tpl/schema-browser.html +178 -0
- data/webapp/tpl/threads.html +56 -0
- metadata +307 -40
- data/lib/rjack-solr/solr-core-3.6.2.jar +0 -0
- data/lib/rjack-solr/solr-solrj-3.6.2.jar +0 -0
- data/webapp/admin/_info.jsp +0 -120
- data/webapp/admin/action.jsp +0 -94
- data/webapp/admin/analysis.jsp +0 -496
- data/webapp/admin/analysis.xsl +0 -179
- data/webapp/admin/dataimport.jsp +0 -53
- data/webapp/admin/debug.jsp +0 -103
- data/webapp/admin/distributiondump.jsp +0 -160
- data/webapp/admin/form.jsp +0 -152
- data/webapp/admin/get-file.jsp +0 -72
- data/webapp/admin/header.jsp +0 -44
- data/webapp/admin/index.jsp +0 -162
- data/webapp/admin/meta.xsl +0 -34
- data/webapp/admin/ping.jsp +0 -52
- data/webapp/admin/ping.xsl +0 -71
- data/webapp/admin/raw-schema.jsp +0 -38
- data/webapp/admin/registry.jsp +0 -107
- data/webapp/admin/registry.xsl +0 -321
- data/webapp/admin/replication/header.jsp +0 -89
- data/webapp/admin/replication/index.jsp +0 -378
- data/webapp/admin/schema.jsp +0 -690
- data/webapp/admin/solr-admin.css +0 -215
- data/webapp/admin/stats.jsp +0 -92
- data/webapp/admin/stats.xsl +0 -220
- data/webapp/admin/tabular.xsl +0 -141
- data/webapp/admin/threaddump.jsp +0 -110
- data/webapp/admin/threaddump.xsl +0 -103
- data/webapp/index.jsp +0 -49
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
File without changes
|
data/webapp/img/tree.png
ADDED
Binary file
|
@@ -0,0 +1,317 @@
|
|
1
|
+
// Simple Set Clipboard System
|
2
|
+
// Author: Joseph Huckaby
|
3
|
+
|
4
|
+
var ZeroClipboard = {
|
5
|
+
|
6
|
+
version: "1.0.7",
|
7
|
+
clients: {}, // registered upload clients on page, indexed by id
|
8
|
+
moviePath: 'ZeroClipboard.swf', // URL to movie
|
9
|
+
nextId: 1, // ID of next movie
|
10
|
+
|
11
|
+
$: function(thingy) {
|
12
|
+
// simple DOM lookup utility function
|
13
|
+
if (typeof(thingy) == 'string') thingy = document.getElementById(thingy);
|
14
|
+
if (!thingy.addClass) {
|
15
|
+
// extend element with a few useful methods
|
16
|
+
thingy.hide = function() { this.style.display = 'none'; };
|
17
|
+
thingy.show = function() { this.style.display = ''; };
|
18
|
+
thingy.addClass = function(name) { this.removeClass(name); this.className += ' ' + name; };
|
19
|
+
thingy.removeClass = function(name) {
|
20
|
+
var classes = this.className.split(/\s+/);
|
21
|
+
var idx = -1;
|
22
|
+
for (var k = 0; k < classes.length; k++) {
|
23
|
+
if (classes[k] == name) { idx = k; k = classes.length; }
|
24
|
+
}
|
25
|
+
if (idx > -1) {
|
26
|
+
classes.splice( idx, 1 );
|
27
|
+
this.className = classes.join(' ');
|
28
|
+
}
|
29
|
+
return this;
|
30
|
+
};
|
31
|
+
thingy.hasClass = function(name) {
|
32
|
+
return !!this.className.match( new RegExp("\\s*" + name + "\\s*") );
|
33
|
+
};
|
34
|
+
}
|
35
|
+
return thingy;
|
36
|
+
},
|
37
|
+
|
38
|
+
setMoviePath: function(path) {
|
39
|
+
// set path to ZeroClipboard.swf
|
40
|
+
this.moviePath = path;
|
41
|
+
},
|
42
|
+
|
43
|
+
dispatch: function(id, eventName, args) {
|
44
|
+
// receive event from flash movie, send to client
|
45
|
+
var client = this.clients[id];
|
46
|
+
if (client) {
|
47
|
+
client.receiveEvent(eventName, args);
|
48
|
+
}
|
49
|
+
},
|
50
|
+
|
51
|
+
register: function(id, client) {
|
52
|
+
// register new client to receive events
|
53
|
+
this.clients[id] = client;
|
54
|
+
},
|
55
|
+
|
56
|
+
getDOMObjectPosition: function(obj, stopObj) {
|
57
|
+
// get absolute coordinates for dom element
|
58
|
+
var info = {
|
59
|
+
left: 0,
|
60
|
+
top: 0,
|
61
|
+
width: obj.width ? obj.width : obj.offsetWidth,
|
62
|
+
height: obj.height ? obj.height : obj.offsetHeight
|
63
|
+
};
|
64
|
+
|
65
|
+
while (obj && (obj != stopObj)) {
|
66
|
+
info.left += obj.offsetLeft;
|
67
|
+
info.top += obj.offsetTop;
|
68
|
+
obj = obj.offsetParent;
|
69
|
+
}
|
70
|
+
|
71
|
+
return info;
|
72
|
+
},
|
73
|
+
|
74
|
+
Client: function(elem) {
|
75
|
+
// constructor for new simple upload client
|
76
|
+
this.handlers = {};
|
77
|
+
|
78
|
+
// unique ID
|
79
|
+
this.id = ZeroClipboard.nextId++;
|
80
|
+
this.movieId = 'ZeroClipboardMovie_' + this.id;
|
81
|
+
|
82
|
+
// register client with singleton to receive flash events
|
83
|
+
ZeroClipboard.register(this.id, this);
|
84
|
+
|
85
|
+
// create movie
|
86
|
+
if (elem) this.glue(elem);
|
87
|
+
}
|
88
|
+
};
|
89
|
+
|
90
|
+
ZeroClipboard.Client.prototype = {
|
91
|
+
|
92
|
+
id: 0, // unique ID for us
|
93
|
+
ready: false, // whether movie is ready to receive events or not
|
94
|
+
movie: null, // reference to movie object
|
95
|
+
clipText: '', // text to copy to clipboard
|
96
|
+
handCursorEnabled: true, // whether to show hand cursor, or default pointer cursor
|
97
|
+
cssEffects: true, // enable CSS mouse effects on dom container
|
98
|
+
handlers: null, // user event handlers
|
99
|
+
|
100
|
+
glue: function(elem, appendElem, stylesToAdd) {
|
101
|
+
// glue to DOM element
|
102
|
+
// elem can be ID or actual DOM element object
|
103
|
+
this.domElement = ZeroClipboard.$(elem);
|
104
|
+
|
105
|
+
// float just above object, or zIndex 99 if dom element isn't set
|
106
|
+
var zIndex = 99;
|
107
|
+
if (this.domElement.style.zIndex) {
|
108
|
+
zIndex = parseInt(this.domElement.style.zIndex, 10) + 1;
|
109
|
+
}
|
110
|
+
|
111
|
+
if (typeof(appendElem) == 'string') {
|
112
|
+
appendElem = ZeroClipboard.$(appendElem);
|
113
|
+
}
|
114
|
+
else if (typeof(appendElem) == 'undefined') {
|
115
|
+
appendElem = document.getElementsByTagName('body')[0];
|
116
|
+
}
|
117
|
+
|
118
|
+
// find X/Y position of domElement
|
119
|
+
var box = ZeroClipboard.getDOMObjectPosition(this.domElement, appendElem);
|
120
|
+
|
121
|
+
// create floating DIV above element
|
122
|
+
this.div = document.createElement('div');
|
123
|
+
var style = this.div.style;
|
124
|
+
style.position = 'absolute';
|
125
|
+
style.left = '' + box.left + 'px';
|
126
|
+
style.top = '' + box.top + 'px';
|
127
|
+
style.width = '' + box.width + 'px';
|
128
|
+
style.height = '' + box.height + 'px';
|
129
|
+
style.zIndex = zIndex;
|
130
|
+
|
131
|
+
style.left = '0px';
|
132
|
+
style.top = '0px';
|
133
|
+
|
134
|
+
if (typeof(stylesToAdd) == 'object') {
|
135
|
+
for (addedStyle in stylesToAdd) {
|
136
|
+
style[addedStyle] = stylesToAdd[addedStyle];
|
137
|
+
}
|
138
|
+
}
|
139
|
+
|
140
|
+
// style.backgroundColor = '#f00'; // debug
|
141
|
+
|
142
|
+
appendElem.appendChild(this.div);
|
143
|
+
|
144
|
+
this.div.innerHTML = this.getHTML( box.width, box.height );
|
145
|
+
},
|
146
|
+
|
147
|
+
getHTML: function(width, height) {
|
148
|
+
// return HTML for movie
|
149
|
+
var html = '';
|
150
|
+
var flashvars = 'id=' + this.id +
|
151
|
+
'&width=' + width +
|
152
|
+
'&height=' + height;
|
153
|
+
|
154
|
+
if (navigator.userAgent.match(/MSIE/)) {
|
155
|
+
// IE gets an OBJECT tag
|
156
|
+
var protocol = location.href.match(/^https/i) ? 'https://' : 'http://';
|
157
|
+
html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+protocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+width+'" height="'+height+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><param name="wmode" value="transparent"/></object>';
|
158
|
+
}
|
159
|
+
else {
|
160
|
+
// all other browsers get an EMBED tag
|
161
|
+
html += '<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'" wmode="transparent" />';
|
162
|
+
}
|
163
|
+
return html;
|
164
|
+
},
|
165
|
+
|
166
|
+
hide: function() {
|
167
|
+
// temporarily hide floater offscreen
|
168
|
+
if (this.div) {
|
169
|
+
this.div.style.left = '-2000px';
|
170
|
+
}
|
171
|
+
},
|
172
|
+
|
173
|
+
show: function() {
|
174
|
+
// show ourselves after a call to hide()
|
175
|
+
this.reposition();
|
176
|
+
},
|
177
|
+
|
178
|
+
destroy: function() {
|
179
|
+
// destroy control and floater
|
180
|
+
if (this.domElement && this.div) {
|
181
|
+
this.hide();
|
182
|
+
this.div.innerHTML = '';
|
183
|
+
|
184
|
+
var body = document.getElementsByTagName('body')[0];
|
185
|
+
try { body.removeChild( this.div ); } catch(e) {;}
|
186
|
+
|
187
|
+
this.domElement = null;
|
188
|
+
this.div = null;
|
189
|
+
}
|
190
|
+
},
|
191
|
+
|
192
|
+
reposition: function(elem) {
|
193
|
+
// reposition our floating div, optionally to new container
|
194
|
+
// warning: container CANNOT change size, only position
|
195
|
+
if (elem) {
|
196
|
+
this.domElement = ZeroClipboard.$(elem);
|
197
|
+
if (!this.domElement) this.hide();
|
198
|
+
}
|
199
|
+
|
200
|
+
console.debug( this.domElement, this.div );
|
201
|
+
|
202
|
+
if (this.domElement && this.div) {
|
203
|
+
var box = ZeroClipboard.getDOMObjectPosition(this.domElement);
|
204
|
+
console.debug( box );
|
205
|
+
var style = this.div.style;
|
206
|
+
style.left = '' + box.left + 'px';
|
207
|
+
style.top = '' + box.top + 'px';
|
208
|
+
}
|
209
|
+
},
|
210
|
+
|
211
|
+
setText: function(newText) {
|
212
|
+
// set text to be copied to clipboard
|
213
|
+
this.clipText = newText;
|
214
|
+
if (this.ready) this.movie.setText(newText);
|
215
|
+
},
|
216
|
+
|
217
|
+
addEventListener: function(eventName, func) {
|
218
|
+
// add user event listener for event
|
219
|
+
// event types: load, queueStart, fileStart, fileComplete, queueComplete, progress, error, cancel
|
220
|
+
eventName = eventName.toString().toLowerCase().replace(/^on/, '');
|
221
|
+
if (!this.handlers[eventName]) this.handlers[eventName] = [];
|
222
|
+
this.handlers[eventName].push(func);
|
223
|
+
},
|
224
|
+
|
225
|
+
setHandCursor: function(enabled) {
|
226
|
+
// enable hand cursor (true), or default arrow cursor (false)
|
227
|
+
this.handCursorEnabled = enabled;
|
228
|
+
if (this.ready) this.movie.setHandCursor(enabled);
|
229
|
+
},
|
230
|
+
|
231
|
+
setCSSEffects: function(enabled) {
|
232
|
+
// enable or disable CSS effects on DOM container
|
233
|
+
this.cssEffects = !!enabled;
|
234
|
+
},
|
235
|
+
|
236
|
+
receiveEvent: function(eventName, args) {
|
237
|
+
// receive event from flash
|
238
|
+
eventName = eventName.toString().toLowerCase().replace(/^on/, '');
|
239
|
+
|
240
|
+
// special behavior for certain events
|
241
|
+
switch (eventName) {
|
242
|
+
case 'load':
|
243
|
+
// movie claims it is ready, but in IE this isn't always the case...
|
244
|
+
// bug fix: Cannot extend EMBED DOM elements in Firefox, must use traditional function
|
245
|
+
this.movie = document.getElementById(this.movieId);
|
246
|
+
if (!this.movie) {
|
247
|
+
var self = this;
|
248
|
+
setTimeout( function() { self.receiveEvent('load', null); }, 1 );
|
249
|
+
return;
|
250
|
+
}
|
251
|
+
|
252
|
+
// firefox on pc needs a "kick" in order to set these in certain cases
|
253
|
+
if (!this.ready && navigator.userAgent.match(/Firefox/) && navigator.userAgent.match(/Windows/)) {
|
254
|
+
var self = this;
|
255
|
+
setTimeout( function() { self.receiveEvent('load', null); }, 100 );
|
256
|
+
this.ready = true;
|
257
|
+
return;
|
258
|
+
}
|
259
|
+
|
260
|
+
this.ready = true;
|
261
|
+
this.movie.setText( this.clipText );
|
262
|
+
this.movie.setHandCursor( this.handCursorEnabled );
|
263
|
+
break;
|
264
|
+
|
265
|
+
case 'mouseover':
|
266
|
+
if (this.domElement && this.cssEffects) {
|
267
|
+
this.domElement.addClass('hover');
|
268
|
+
if (this.recoverActive) this.domElement.addClass('active');
|
269
|
+
}
|
270
|
+
break;
|
271
|
+
|
272
|
+
case 'mouseout':
|
273
|
+
if (this.domElement && this.cssEffects) {
|
274
|
+
this.recoverActive = false;
|
275
|
+
if (this.domElement.hasClass('active')) {
|
276
|
+
this.domElement.removeClass('active');
|
277
|
+
this.recoverActive = true;
|
278
|
+
}
|
279
|
+
this.domElement.removeClass('hover');
|
280
|
+
}
|
281
|
+
break;
|
282
|
+
|
283
|
+
case 'mousedown':
|
284
|
+
if (this.domElement && this.cssEffects) {
|
285
|
+
this.domElement.addClass('active');
|
286
|
+
}
|
287
|
+
break;
|
288
|
+
|
289
|
+
case 'mouseup':
|
290
|
+
if (this.domElement && this.cssEffects) {
|
291
|
+
this.domElement.removeClass('active');
|
292
|
+
this.recoverActive = false;
|
293
|
+
}
|
294
|
+
break;
|
295
|
+
} // switch eventName
|
296
|
+
|
297
|
+
if (this.handlers[eventName]) {
|
298
|
+
for (var idx = 0, len = this.handlers[eventName].length; idx < len; idx++) {
|
299
|
+
var func = this.handlers[eventName][idx];
|
300
|
+
|
301
|
+
if (typeof(func) == 'function') {
|
302
|
+
// actual function reference
|
303
|
+
func(this, args);
|
304
|
+
}
|
305
|
+
else if ((typeof(func) == 'object') && (func.length == 2)) {
|
306
|
+
// PHP style object + method, i.e. [myObject, 'myMethod']
|
307
|
+
func[0][ func[1] ](this, args);
|
308
|
+
}
|
309
|
+
else if (typeof(func) == 'string') {
|
310
|
+
// name of function
|
311
|
+
window[func](this, args);
|
312
|
+
}
|
313
|
+
} // foreach event handler defined
|
314
|
+
} // user defined handler for event
|
315
|
+
}
|
316
|
+
|
317
|
+
};
|