-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ismail irfan <98257637+Ismailirfan@users.noreply.github.com>
- Loading branch information
1 parent
6c05dbb
commit c9bbf13
Showing
1 changed file
with
36 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
// $.ajax({url: "shortcutkeys.html", success: function(result){ | ||
// $("#Shortcutkeys").html(result); | ||
// }}); | ||
$.ajax({url: "shortcutkeys.html", success: function(result){ | ||
$("#Shortcutkeys").html(result); | ||
}}); | ||
|
||
// Tabbed Menu | ||
|
||
//$(document).ready(function() { | ||
// const API_KEY = 'AIzaSyAAVEyh_nSUsyhpZq-N1oeb1qGNanbz_Kc'; | ||
// const FOLDER_ID = '1_iCnZEDJpQEK524YzL3v8RWUtM9sDqge'; // Replace with your public Google Drive folder ID | ||
$(document).ready(function() { | ||
const API_KEY = 'AIzaSyAAVEyh_nSUsyhpZq-N1oeb1qGNanbz_Kc'; | ||
const FOLDER_ID = '1_iCnZEDJpQEK524YzL3v8RWUtM9sDqge'; // Replace with your public Google Drive folder ID | ||
|
||
// listFiles(); // Automatically fetch files when the page loads | ||
listFiles(); // Automatically fetch files when the page loads | ||
|
||
// function listFiles() { | ||
// $.ajax({ | ||
// url: `https://www.googleapis.com/drive/v3/files?q='${FOLDER_ID}'+in+parents+and+mimeType='text/html'&key=${API_KEY}`, | ||
// method: 'GET', | ||
// success: function(data) { | ||
// $('#fileList').empty(); | ||
// data.files.forEach(function(file) { | ||
// fetchFileContent(file.id); | ||
// }); | ||
// }, | ||
// error: function(error) { | ||
// console.error('Error:', error); | ||
// } | ||
// }); | ||
// } | ||
function listFiles() { | ||
$.ajax({ | ||
url: `https://www.googleapis.com/drive/v3/files?q='${FOLDER_ID}'+in+parents+and+mimeType='text/html'&key=${API_KEY}`, | ||
method: 'GET', | ||
success: function(data) { | ||
$('#fileList').empty(); | ||
data.files.forEach(function(file) { | ||
fetchFileContent(file.id); | ||
}); | ||
}, | ||
error: function(error) { | ||
console.error('Error:', error); | ||
} | ||
}); | ||
} | ||
|
||
// window.fetchFileContent = function(fileId) { | ||
// $.ajax({ | ||
// url: `https://www.googleapis.com/drive/v3/files/${fileId}?alt=media&key=${API_KEY}`, | ||
// method: 'GET', | ||
// success: function(data) { | ||
// $('#fileContent').html(data); | ||
// $('#mymodal').modal('show'); // Show the modal with fetched content | ||
// }, | ||
// error: function(error) { | ||
// console.error('Error:', error); | ||
// } | ||
// }); | ||
// } | ||
// }); | ||
window.fetchFileContent = function(fileId) { | ||
$.ajax({ | ||
url: `https://www.googleapis.com/drive/v3/files/${fileId}?alt=media&key=${API_KEY}`, | ||
method: 'GET', | ||
success: function(data) { | ||
$('#fileContent').html(data); | ||
$('#mymodal').modal('show'); // Show the modal with fetched content | ||
}, | ||
error: function(error) { | ||
console.error('Error:', error); | ||
} | ||
}); | ||
} | ||
}); |