Initial commit
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
// Document Management System JavaScript
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Auto-dismiss flash messages after 5 seconds
|
||||
window.setTimeout(function() {
|
||||
document.querySelectorAll('.alert').forEach(function(alert) {
|
||||
if (bootstrap && bootstrap.Alert) {
|
||||
var bsAlert = new bootstrap.Alert(alert);
|
||||
bsAlert.close();
|
||||
} else {
|
||||
alert.style.display = 'none';
|
||||
}
|
||||
});
|
||||
}, 5000);
|
||||
|
||||
// Copy link functionality
|
||||
window.copyLink = function(elementId) {
|
||||
var copyText = document.getElementById(elementId);
|
||||
if (copyText) {
|
||||
copyText.select();
|
||||
copyText.setSelectionRange(0, 99999);
|
||||
navigator.clipboard.writeText(copyText.value);
|
||||
|
||||
// Show a temporary tooltip
|
||||
var tooltip = document.createElement("div");
|
||||
tooltip.innerHTML = "Copied!";
|
||||
tooltip.style.position = "fixed";
|
||||
tooltip.style.backgroundColor = "#4CAF50";
|
||||
tooltip.style.color = "white";
|
||||
tooltip.style.padding = "5px 10px";
|
||||
tooltip.style.borderRadius = "5px";
|
||||
tooltip.style.zIndex = "1000";
|
||||
tooltip.style.top = (event.clientY - 30) + "px";
|
||||
tooltip.style.left = event.clientX + "px";
|
||||
document.body.appendChild(tooltip);
|
||||
|
||||
setTimeout(function() {
|
||||
document.body.removeChild(tooltip);
|
||||
}, 2000);
|
||||
}
|
||||
};
|
||||
|
||||
// Email sharing functionality
|
||||
window.shareViaEmail = function(filename, url) {
|
||||
var subject = "Shared Document: " + filename;
|
||||
var body = "I'm sharing a document with you: " + filename + "\n\nYou can access it here: " + url;
|
||||
window.location.href = "mailto:?subject=" + encodeURIComponent(subject) + "&body=" + encodeURIComponent(body);
|
||||
};
|
||||
|
||||
// WhatsApp sharing functionality
|
||||
window.shareViaWhatsApp = function(filename, url) {
|
||||
var text = "I'm sharing a document with you: " + filename + "\n\nYou can access it here: " + url;
|
||||
window.open("https://wa.me/?text=" + encodeURIComponent(text), "_blank");
|
||||
};
|
||||
|
||||
// Confirm delete
|
||||
var deleteButtons = document.querySelectorAll('[data-confirm]');
|
||||
deleteButtons.forEach(function(button) {
|
||||
button.addEventListener('click', function(e) {
|
||||
if (!confirm(this.getAttribute('data-confirm'))) {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,70 @@
|
||||
/* Main Styles */
|
||||
body {
|
||||
padding-top: 60px;
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
|
||||
.card {
|
||||
margin-bottom: 20px;
|
||||
box-shadow: 0 4px 6px rgba(0,0,0,.1);
|
||||
}
|
||||
|
||||
.document-card {
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
|
||||
.document-card:hover {
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
|
||||
.file-icon {
|
||||
font-size: 2.5rem;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.pdf-icon { color: #e74c3c; }
|
||||
.document-icon { color: #3498db; }
|
||||
.spreadsheet-icon { color: #2ecc71; }
|
||||
.image-icon { color: #9b59b6; }
|
||||
.video-icon { color: #e67e22; }
|
||||
.other-icon { color: #95a5a6; }
|
||||
|
||||
.flash-messages {
|
||||
position: fixed;
|
||||
top: 70px;
|
||||
right: 20px;
|
||||
z-index: 1000;
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
/* Dashboard Styles */
|
||||
.analytics-card {
|
||||
background-color: #f8f9fa;
|
||||
border-left: 4px solid #007bff;
|
||||
}
|
||||
|
||||
/* Document Viewer Styles */
|
||||
.document-viewer {
|
||||
min-height: 400px;
|
||||
background-color: #f8f9fa;
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 0.25rem;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
/* Responsive Adjustments */
|
||||
@media (max-width: 768px) {
|
||||
.card-body {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.btn-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.btn-group .btn {
|
||||
margin-bottom: 0.25rem;
|
||||
border-radius: 0.25rem !important;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user