-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
86 lines (63 loc) · 1.68 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// For tabs
$( function() {
$( "#tab" ).tabs();
} );
$( function() {
$( "#postsTab" ).tabs({
// collapsible: true
});
} );
$( function() {
$( "#mediaTabs" ).tabs({
// collapsible: true
});
} );
$( function() {
$( "#menuTabs" ).tabs({
// collapsible: true
});
} );
// For Initiate the Document editor
var editor = CKEDITOR.replace("editor1")
function showCOntent(){
var data = CKEDITOR.instances.editor1.getData();
alert(data)
}
function showTags(){
console.log($("#inputtag").val())
}
/// Copy Image link copy button in Image gallery
var imageLinkCopyBtn = document.querySelector(".copyImageLink")
function copyTextToClipboard(text) {
if (!navigator.clipboard) {
fallbackCopyTextToClipboard(text);
return;
}
navigator.clipboard.writeText(text).then(function() {
// console.log('Async: Copying to clipboard was successful!');
// alert('Copied!')
}, function(err) {
// console.error('Async: Could not copy text: ', err);
});
}
// Actual Button action
imageLinkCopyBtn.addEventListener('click', function(event) {
event.preventDefault()
copyTextToClipboard(imageLinkCopyBtn.href);
});
// Menu tabs in admin panel
// Disabling menu items links
// For tab 1
$( function() {
$( "#sortable" ).sortable();
$( "#sortable" ).disableSelection();
} );
// View Sorted items
var list = document.getElementById("sortable")
function show(){
var items = document.getElementById("sortable").children
var i = 0
for(i; i < items.length ; i++){
console.log(`${i+1}. `+items[i].textContent)
}
}