Revision 49772990
b/ui/static/snf/js/utils.js | ||
---|---|---|
141 | 141 |
// TODO: implement me |
142 | 142 |
} |
143 | 143 |
|
144 |
synnefo.util.ClipHelper = function(cont) { |
|
145 |
this.cont = cont || $('<div class="clip-copy"></div>'); |
|
146 |
this.clip = new ZeroClipboard.Client(); |
|
147 |
this.clip.setHandCursor(true); |
|
148 |
this.el = this.cont; |
|
149 |
this.el.append(this.clip.getHTML(20,20)); |
|
150 |
|
|
151 |
this.setText = function(t) { |
|
152 |
this.clip.setText(t); |
|
153 |
} |
|
154 |
|
|
155 |
this.el.attr({title: "Click to copy to clipboard"}) |
|
156 |
this.clip.addEventListener('complete', _.bind(function(client, text) { |
|
157 |
//$(".tooltip").text("Copied"); |
|
158 |
}, this)); |
|
159 |
} |
|
160 |
|
|
144 | 161 |
synnefo.util.truncate = function(string, size, append, words) { |
145 | 162 |
if (string.length <= size) { |
146 | 163 |
return string; |
b/ui/templates/home.html | ||
---|---|---|
23 | 23 |
<script src="static/snf/js/lib/jquery.client.js"></script> |
24 | 24 |
<script src="static/snf/js/lib/jquery.tools.min.js"></script> |
25 | 25 |
<script src="static/snf/js/lib/jquery.dataTables.min.js"></script> |
26 |
<script src="static/snf/js/lib/ZeroClipboard.js"></script> |
|
26 | 27 |
|
27 | 28 |
<script src="static/snf/js/lib/underscore.js"></script> |
28 | 29 |
<script src="static/snf/js/lib/underscore.string.js"></script> |
... | ... | |
69 | 70 |
// empty object for console to avoid errors in browsers that don't support it |
70 | 71 |
if (!window.console) {window.console = {}; window.console.log = window.console.info = window.console.debug = |
71 | 72 |
window.console.error = function() {}}; |
73 |
|
|
74 |
// initialize zero clipboard |
|
75 |
ZeroClipboard.setMoviePath( 'static/snf/js/lib/ZeroClipboard.swf' ); |
|
72 | 76 |
|
73 | 77 |
//populate available image icons array |
74 | 78 |
var os_icons = {{image_icons|safe}}; |
Also available in: Unified diff