Standardize share toast notifications and fix PC scanning/editing
Share Toast Notifications: - Unified toast style across all pages (purple gradient, top-right position) - Updated displayapplication.asp, displaytopic.asp, displayudc.asp - Updated printerlinksgenerator.asp (replaced alert with toast) - Same text: "Link Copied!" / "This link will show the search term..." PC Scanning/Editing Fixes: - savedevicedirect.asp: Use machinetypeid=33 to detect PCs (not pctypeid) - savedevicedirect.asp: Use new Dell TBD model (ID 110) for new PCs - editpc.asp: Model dropdown includes current model even if vendor ispc=0 - editpc.asp: Fixed vendor query to use ispc=1 instead of ismachine=1 Database changes (manual): - Set ispc=1 for Dell, Dell Inc., DellInc., HP vendors - Created Dell TBD model (ID 110) as default PC model 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -158,79 +158,66 @@
|
||||
<script src="assets/js/app-script.js"></script>
|
||||
|
||||
<style>
|
||||
.toast-notification {
|
||||
/* Share toast notification */
|
||||
#shareToast {
|
||||
position: fixed;
|
||||
top: 20px;
|
||||
top: 80px;
|
||||
right: 20px;
|
||||
z-index: 9999;
|
||||
min-width: 300px;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: white;
|
||||
padding: 15px 25px;
|
||||
padding: 15px 20px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 15px rgba(0,0,0,0.3);
|
||||
z-index: 10000;
|
||||
box-shadow: 0 4px 20px rgba(0,0,0,0.3);
|
||||
display: none;
|
||||
animation: slideIn 0.3s ease-out;
|
||||
}
|
||||
|
||||
@keyframes slideIn {
|
||||
from {
|
||||
transform: translateX(400px);
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
transform: translateX(0);
|
||||
opacity: 1;
|
||||
}
|
||||
@keyframes toastSlideIn {
|
||||
from { transform: translateX(100%); opacity: 0; }
|
||||
to { transform: translateX(0); opacity: 1; }
|
||||
}
|
||||
@keyframes toastSlideOut {
|
||||
from { transform: translateX(0); opacity: 1; }
|
||||
to { transform: translateX(100%); opacity: 0; }
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- Share toast notification -->
|
||||
<div id="shareToast">
|
||||
<div style="display: flex; align-items: center;">
|
||||
<i class="zmdi zmdi-check-circle" style="font-size: 24px; margin-right: 12px;"></i>
|
||||
<div>
|
||||
<strong style="display: block; margin-bottom: 5px;">Link Copied!</strong>
|
||||
<span style="font-size: 13px; opacity: 0.9;">This link will show the search term and highlight the result</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function shareApplication() {
|
||||
var shareUrl = window.location.href;
|
||||
|
||||
if (navigator.clipboard && navigator.clipboard.writeText) {
|
||||
navigator.clipboard.writeText(shareUrl).then(function() {
|
||||
showToast();
|
||||
}).catch(function(err) {
|
||||
console.error('Failed to copy: ', err);
|
||||
});
|
||||
} else {
|
||||
// Fallback for older browsers
|
||||
copyToClipboardFallback(shareUrl);
|
||||
}
|
||||
}
|
||||
var temp = document.createElement('textarea');
|
||||
temp.value = shareUrl;
|
||||
temp.style.position = 'fixed';
|
||||
temp.style.left = '-9999px';
|
||||
document.body.appendChild(temp);
|
||||
temp.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(temp);
|
||||
|
||||
function copyToClipboardFallback(text) {
|
||||
var textArea = document.createElement("textarea");
|
||||
textArea.value = text;
|
||||
textArea.style.position = "fixed";
|
||||
textArea.style.top = "-9999px";
|
||||
document.body.appendChild(textArea);
|
||||
textArea.focus();
|
||||
textArea.select();
|
||||
|
||||
try {
|
||||
document.execCommand('copy');
|
||||
showToast();
|
||||
} catch (err) {
|
||||
console.error('Fallback: Could not copy text: ', err);
|
||||
}
|
||||
|
||||
document.body.removeChild(textArea);
|
||||
showToast();
|
||||
}
|
||||
|
||||
function showToast() {
|
||||
var toast = document.createElement('div');
|
||||
toast.className = 'toast-notification';
|
||||
toast.innerHTML = '<i class="zmdi zmdi-check-circle" style="margin-right:10px;"></i> Link copied to clipboard!';
|
||||
document.body.appendChild(toast);
|
||||
|
||||
var toast = document.getElementById('shareToast');
|
||||
toast.style.display = 'block';
|
||||
toast.style.animation = 'toastSlideIn 0.3s ease-out';
|
||||
|
||||
setTimeout(function() {
|
||||
toast.style.animation = 'slideIn 0.3s ease-out reverse';
|
||||
toast.style.animation = 'toastSlideOut 0.3s ease-out';
|
||||
setTimeout(function() {
|
||||
document.body.removeChild(toast);
|
||||
toast.style.display = 'none';
|
||||
}, 300);
|
||||
}, 2500);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user