Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
flatsiedatsie authored Jan 20, 2023
1 parent 5139546 commit 65c52bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions js/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,9 @@
found_write_property = true;
}
catch(e){
console.log("Error getting fresh property value: ", e);
if(this.debug){
console.log("Privacy manager: Error getting fresh privacy-related property value: ", e);
}
}


Expand Down Expand Up @@ -1100,19 +1102,23 @@
// Forget printer button
document.getElementById('extension-privacy-manager-forget-printer-button').addEventListener('click', (target) => {
//console.log("printer forget button clicked");
document.getElementById('extension-privacy-manager-forget-printer-button').style.display = 'none';

document.getElementById('extension-privacy-manager-printer-connected').innerText = '';

document.getElementById('extension-privacy-manager-print-test-button').style.display = 'none';

window.API.postJson(
`/extensions/${this.id}/api/forget_printer` //,{'printer_log':printer_log, 'printer_interval':printer_interval}
).then((body) => {
if(this.debug){
console.log("Privacy manager: forget printer response: ", body);
}

document.getElementById('extension-privacy-manager-print-test-button').style.display = 'none';
document.getElementById('extension-privacy-manager-printer-connected').innerText = "";
document.getElementById('extension-privacy-manager-printer-list-name').innerText = "";
document.getElementById('extension-privacy-manager-printer-list-mac').innerText = "";
}).catch((e) => {
console.log("Privacy manager: error in forget printer response: ", e);
document.getElementById('extension-privacy-manager-forget-printer-button').style.display = 'block';
});
});

Expand Down Expand Up @@ -1709,7 +1715,7 @@

if(body['persistent']['printer_mac'] != ""){
document.getElementById('extension-privacy-manager-print-test-button').style.display = 'block';

document.getElementById('extension-privacy-manager-forget-printer-button').style.display = 'block';
if(typeof body.printer_connected != 'undefined'){
this.show_printer_connection_state(body.printer_connected);
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/privacy_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def handle_request(self, request):
print("warning, Privacy Manager API received a GET request")
return APIResponse(status=404)

if request.path == '/ajax' or request.path == '/get_property_data' or request.path == '/point_change_value' or request.path == '/point_delete' or request.path == '/internal_logs' or request.path == '/init' or request.path == '/sculptor_init' or request.path == '/printer_init' or request.path == '/printer_scan' or request.path == '/printer_set' or request.path == '/print_now' or request.path == '/print_test' or request.path == '/print_image':
if request.path == '/ajax' or request.path == '/get_property_data' or request.path == '/point_change_value' or request.path == '/point_delete' or request.path == '/internal_logs' or request.path == '/init' or request.path == '/sculptor_init' or request.path == '/printer_init' or request.path == '/printer_scan' or request.path == '/printer_set' or request.path == '/print_now' or request.path == '/print_test' or request.path == '/forget_printer' or request.path == '/print_image':

try:
if request.path == '/ajax':
Expand Down

0 comments on commit 65c52bb

Please sign in to comment.