@@ -1305,7 +1305,7 @@ function(data) {
1305
1305
1306
1306
//Prepare clipboard copies
1307
1307
if ($('#edit_pw1').val() !== "") {
1308
- new Clipboard ("#menu_button_copy_pw, #button_quick_pw_copy", {
1308
+ new ClipboardJS ("#menu_button_copy_pw, #button_quick_pw_copy", {
1309
1309
text: function() {
1310
1310
return unsanitizeString($('#edit_pw1').val());
1311
1311
}
@@ -1316,7 +1316,7 @@ function(data) {
1316
1316
$("#button_quick_pw_copy").addClass("hidden");
1317
1317
}
1318
1318
if ($('#edit_item_login').val() != "") {
1319
- var clipboard_elogin = new Clipboard ("#menu_button_copy_login, #button_quick_login_copy", {
1319
+ var clipboard_elogin = new ClipboardJS ("#menu_button_copy_login, #button_quick_login_copy", {
1320
1320
text: function() {
1321
1321
return unsanitizeString($('#edit_item_login').val());
1322
1322
}
@@ -1830,7 +1830,7 @@ function(data_raw) {
1830
1830
1831
1831
//Prepare clipboard copies
1832
1832
if (data.pw != "") {
1833
- var clipboard_pw = new Clipboard ("#menu_button_copy_pw, #button_quick_pw_copy", {
1833
+ var clipboard_pw = new ClipboardJS ("#menu_button_copy_pw, #button_quick_pw_copy", {
1834
1834
text: function() {
1835
1835
return (unsanitizeString(data.pw));
1836
1836
}
@@ -1851,7 +1851,7 @@ function(data_raw) {
1851
1851
$("#button_quick_pw_copy").addClass("hidden");
1852
1852
}
1853
1853
if (data.login != "") {
1854
- var clipboard_login = new Clipboard ("#menu_button_copy_login, #button_quick_login_copy", {
1854
+ var clipboard_login = new ClipboardJS ("#menu_button_copy_login, #button_quick_login_copy", {
1855
1855
text: function() {
1856
1856
return (data.login);
1857
1857
}
@@ -1867,7 +1867,7 @@ function(data_raw) {
1867
1867
}
1868
1868
// #525
1869
1869
if (data.url != "") {
1870
- var clipboard_url = new Clipboard ("#menu_button_copy_url", {
1870
+ var clipboard_url = new ClipboardJS ("#menu_button_copy_url", {
1871
1871
text: function() {
1872
1872
return unsanitizeString(data.url);
1873
1873
}
@@ -1880,7 +1880,7 @@ function(data_raw) {
1880
1880
}
1881
1881
1882
1882
//prepare link to clipboard
1883
- var clipboard_link = new Clipboard ("#menu_button_copy_link", {
1883
+ var clipboard_link = new ClipboardJS ("#menu_button_copy_link", {
1884
1884
text: function() {
1885
1885
return "<?php echo $ SETTINGS ['cpassman_url ' ]; ?> "+"/index.php?page=items&group="+data.folder+"&id="+data.id;
1886
1886
}
@@ -2839,16 +2839,11 @@ function openReasonToAccess() {
2839
2839
//###########
2840
2840
$(function() {
2841
2841
2842
- var clear_tp_clipboard = new Clipboard ("#but_empty_clipboard", {
2842
+ var clear_tp_clipboard = new ClipboardJS ("#but_empty_clipboard", {
2843
2843
text: function() {
2844
2844
return "cleared";
2845
2845
}
2846
2846
});
2847
- clear_tp_clipboard.on('success', function(e) {
2848
- $("#message_box").html("super").show().fadeOut(1000);
2849
-
2850
- e.clearSelection();
2851
- });
2852
2847
2853
2848
$.ajaxSetup({
2854
2849
error: function(jqXHR, exception) {
@@ -3967,6 +3962,22 @@ function(data) {
3967
3962
});
3968
3963
//<=
3969
3964
3965
+
3966
+ // => OTV LINK
3967
+ $("#dialog_otv").dialog({
3968
+ bgiframe: true,
3969
+ modal: true,
3970
+ height:300,
3971
+ autoOpen: false,
3972
+ minWidth:750,
3973
+ title: "<?php echo addslashes ($ LANG ['request_access_to_item ' ]); ?> ",
3974
+ close: function(event,ui) {
3975
+ $(this).dialog('close');
3976
+ }
3977
+ });
3978
+ //<=
3979
+
3980
+
3970
3981
// => ATTACHMENTS INIT
3971
3982
var uploader_attachments = new plupload.Uploader({
3972
3983
runtimes : "html5,flash,silverlight,html4",
@@ -4644,13 +4655,13 @@ function proceed_list_update(stop_proceeding)
4644
4655
$("#items_list_loader").addClass("hidden");
4645
4656
4646
4657
// prepare clipboard items
4647
- clipboard = new Clipboard ('.mini_login');
4658
+ clipboard = new ClipboardJS ('.mini_login');
4648
4659
clipboard.on('success', function(e) {
4649
4660
$("#message_box").html("<?php echo addslashes ($ LANG ['login_copied_clipboard ' ]); ?> ").show().fadeOut(1000);
4650
4661
e.clearSelection();
4651
4662
});
4652
4663
4653
- clipboard = new Clipboard ('.mini_pw');
4664
+ clipboard = new ClipboardJS ('.mini_pw');
4654
4665
clipboard.on('success', function(e) {
4655
4666
$("#message_box").html("<?php echo addslashes ($ LANG ['pw_copied_clipboard ' ]); ?> ").show().fadeOut(1000);
4656
4667
itemLog(
@@ -4832,6 +4843,7 @@ function(data) {
4832
4843
}
4833
4844
4834
4845
4846
+
4835
4847
/*
4836
4848
* Launch the redirection to OTV page
4837
4849
*/
@@ -4851,30 +4863,15 @@ function prepareOneTimeView()
4851
4863
function(data) {
4852
4864
//check if format error
4853
4865
if (data.error == "") {
4854
- $("#div_dialog_message").dialog({
4855
- height:300,
4856
- minWidth:750,
4857
- close: function(event,ui) {
4858
- $("#div_dialog_message_text").html('');
4859
- $(this).dialog('close');
4860
- }
4861
- });
4862
- $("#div_dialog_message").dialog('open');
4863
- $("#div_dialog_message_text").html(data.url+
4864
- '<div style="margin-top:30px;font-size:13px;text-align:center;"><span id="show_otv_copied" class="ui-state-focus ui-corner-all" style="padding:10px;display:none;"></span></div>'
4865
- );
4866
-
4867
- var clipboard = new Clipboard("#" + data.element_id, {
4868
- text: function(trigger) {
4869
- return $('#' + data.element_id).data('clipboard-text');
4870
- }
4871
- });
4872
- clipboard.on('success', function(e) {
4873
- $("#show_otv_copied").html("<?php echo addslashes ($ LANG ['link_is_copied ' ]); ?> ").show().fadeOut(2000);
4874
- e.clearSelection();
4875
- });
4866
+ var str = "<?php echo addslashes ($ LANG ['one_time_view_item_url_box ' ]);?> ";
4867
+ var html = str.replace("#URL#", data.url + '<i class="fa-stack tip otv-link" title="<?php echo addslashes ($ LANG ['copy ' ]);?> " style="cursor:pointer;"><span class="fa fa-square fa-stack-2x"></span><span class="fa fa-clipboard fa-stack-1x fa-inverse"></span></i>');
4868
+ html = html.replace("#DAY#", data.date);
4869
+ $('#dialog_otv_text').html(html);
4870
+
4871
+ $('.tip').tooltipster({multiple: true});
4876
4872
4877
- $(".tip").tooltipster({multiple: true});
4873
+ $('#otv-url').val(data.url);
4874
+ $("#dialog_otv").dialog('open');
4878
4875
} else {
4879
4876
$("#item_history_log_error").html(data.error).show();
4880
4877
}
0 commit comments