Update index.html
This commit is contained in:
parent
bc738ae3e8
commit
5047522fec
1 changed files with 104 additions and 62 deletions
166
index.html
166
index.html
|
|
@ -1523,48 +1523,87 @@
|
||||||
try {
|
try {
|
||||||
const files = [];
|
const files = [];
|
||||||
|
|
||||||
// Get actual files from the current directory
|
// Common .md file patterns to check
|
||||||
const knownFiles = [
|
const commonMdFiles = [
|
||||||
'index.html',
|
|
||||||
'script.js',
|
|
||||||
'style.css',
|
|
||||||
'.replit'
|
|
||||||
];
|
|
||||||
|
|
||||||
// Add any additional files that might exist
|
|
||||||
const potentialFiles = [
|
|
||||||
'README.md',
|
'README.md',
|
||||||
'main.py',
|
'CHANGELOG.md',
|
||||||
'app.js',
|
'CONTRIBUTING.md',
|
||||||
'server.js',
|
'LICENSE.md',
|
||||||
'package.json',
|
'DOCS.md',
|
||||||
'requirements.txt',
|
'INSTALL.md',
|
||||||
'config.js',
|
'USAGE.md',
|
||||||
'data.json',
|
'API.md',
|
||||||
'utils.js',
|
'GUIDE.md',
|
||||||
'helpers.py',
|
'TUTORIAL.md'
|
||||||
'styles.css',
|
|
||||||
'script.min.js',
|
|
||||||
'favicon.ico',
|
|
||||||
'manifest.json'
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const allFiles = [...knownFiles, ...potentialFiles];
|
// Common directory patterns that might contain .md files
|
||||||
|
const commonDirectories = [
|
||||||
|
'docs/',
|
||||||
|
'documentation/',
|
||||||
|
'guides/',
|
||||||
|
'tutorials/',
|
||||||
|
'examples/',
|
||||||
|
'samples/',
|
||||||
|
'prompts/',
|
||||||
|
'jailbreaks/',
|
||||||
|
'techniques/',
|
||||||
|
'methods/',
|
||||||
|
'security/',
|
||||||
|
'tools/',
|
||||||
|
'resources/',
|
||||||
|
'collection/',
|
||||||
|
'archive/',
|
||||||
|
'latest/',
|
||||||
|
'legendary/',
|
||||||
|
'ultra/',
|
||||||
|
'advanced/',
|
||||||
|
'basic/',
|
||||||
|
'premium/',
|
||||||
|
'free/',
|
||||||
|
'public/',
|
||||||
|
'private/'
|
||||||
|
];
|
||||||
|
|
||||||
|
// Generate potential .md file paths
|
||||||
|
const potentialMdFiles = [
|
||||||
|
...commonMdFiles,
|
||||||
|
// Add numbered patterns
|
||||||
|
...Array.from({length: 50}, (_, i) => `${i + 1}.md`),
|
||||||
|
...Array.from({length: 20}, (_, i) => `prompt${i + 1}.md`),
|
||||||
|
...Array.from({length: 20}, (_, i) => `jailbreak${i + 1}.md`),
|
||||||
|
...Array.from({length: 20}, (_, i) => `technique${i + 1}.md`),
|
||||||
|
// Add files in subdirectories
|
||||||
|
...commonDirectories.flatMap(dir => [
|
||||||
|
...commonMdFiles.map(file => `${dir}${file}`),
|
||||||
|
...Array.from({length: 30}, (_, i) => `${dir}${i + 1}.md`),
|
||||||
|
...Array.from({length: 15}, (_, i) => `${dir}prompt${i + 1}.md`),
|
||||||
|
...Array.from({length: 15}, (_, i) => `${dir}jailbreak${i + 1}.md`),
|
||||||
|
...Array.from({length: 15}, (_, i) => `${dir}technique${i + 1}.md`)
|
||||||
|
])
|
||||||
|
];
|
||||||
|
|
||||||
|
console.log(`Scanning for ${potentialMdFiles.length} potential .md files...`);
|
||||||
|
|
||||||
for (const fileName of allFiles) {
|
for (const filePath of potentialMdFiles) {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(fileName);
|
const response = await fetch(filePath);
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const content = await response.text();
|
const content = await response.text();
|
||||||
const size = new Blob([content]).size;
|
|
||||||
|
|
||||||
files.push({
|
// Only include if it's actually markdown content (has some content)
|
||||||
name: fileName.replace(/\.[^/.]+$/, ""), // Remove extension
|
if (content && content.trim().length > 0) {
|
||||||
folder: determineFolder(fileName),
|
const size = new Blob([content]).size;
|
||||||
path: fileName,
|
const fileName = filePath.split('/').pop() || filePath;
|
||||||
size: size,
|
|
||||||
content: content
|
files.push({
|
||||||
});
|
name: fileName.replace(/\.md$/, ""), // Remove .md extension
|
||||||
|
folder: determineFolder(filePath),
|
||||||
|
path: filePath,
|
||||||
|
size: size,
|
||||||
|
content: content
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// File doesn't exist or can't be loaded, skip silently
|
// File doesn't exist or can't be loaded, skip silently
|
||||||
|
|
@ -1572,6 +1611,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(`Found ${files.length} .md files`);
|
||||||
return files;
|
return files;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error scanning directory:', error);
|
console.error('Error scanning directory:', error);
|
||||||
|
|
@ -1592,38 +1632,40 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function determineFolder(fileName) {
|
function determineFolder(filePath) {
|
||||||
const ext = fileName.split('.').pop().toLowerCase();
|
const fileName = filePath.toLowerCase();
|
||||||
const name = fileName.toLowerCase();
|
const path = filePath.toLowerCase();
|
||||||
|
|
||||||
// Web files
|
// Determine folder based on directory structure first
|
||||||
if (ext === 'html' || ext === 'htm') return 'Web Pages';
|
if (path.includes('jailbreak')) return 'Latest Jailbreaks';
|
||||||
if (ext === 'css' || ext === 'scss' || ext === 'sass') return 'Stylesheets';
|
if (path.includes('legendary') || path.includes('leak')) return 'Legendary Leaks';
|
||||||
if (ext === 'js' || ext === 'jsx' || ext === 'ts' || ext === 'tsx') return 'JavaScript';
|
if (path.includes('security') || path.includes('protection')) return 'Prompt Security';
|
||||||
|
if (path.includes('ultra') || path.includes('advanced') || path.includes('premium')) return 'Ultra Prompts';
|
||||||
|
if (path.includes('injection') || path.includes('bypass')) return 'Injection Techniques';
|
||||||
|
if (path.includes('tool') || path.includes('utility')) return 'Security Tools';
|
||||||
|
if (path.includes('guide') || path.includes('tutorial')) return 'Guides & Tutorials';
|
||||||
|
if (path.includes('example') || path.includes('sample')) return 'Examples';
|
||||||
|
if (path.includes('doc') || fileName === 'readme.md') return 'Documentation';
|
||||||
|
if (path.includes('prompt') && !path.includes('security')) return 'Prompt Collection';
|
||||||
|
if (path.includes('technique') || path.includes('method')) return 'Techniques';
|
||||||
|
if (path.includes('collection') || path.includes('archive')) return 'Archives';
|
||||||
|
if (path.includes('resource')) return 'Resources';
|
||||||
|
|
||||||
// Programming languages
|
// Determine folder based on file name patterns
|
||||||
if (ext === 'py' || ext === 'python') return 'Python';
|
if (fileName.includes('jailbreak')) return 'Latest Jailbreaks';
|
||||||
if (ext === 'java' || ext === 'class') return 'Java';
|
if (fileName.includes('legendary') || fileName.includes('leak')) return 'Legendary Leaks';
|
||||||
if (ext === 'cpp' || ext === 'c' || ext === 'h') return 'C/C++';
|
if (fileName.includes('security') || fileName.includes('protection')) return 'Prompt Security';
|
||||||
if (ext === 'php') return 'PHP';
|
if (fileName.includes('ultra') || fileName.includes('advanced')) return 'Ultra Prompts';
|
||||||
if (ext === 'rb' || ext === 'ruby') return 'Ruby';
|
if (fileName.includes('injection') || fileName.includes('bypass')) return 'Injection Techniques';
|
||||||
|
if (fileName.includes('tool') || fileName.includes('utility')) return 'Security Tools';
|
||||||
|
if (fileName.includes('guide') || fileName.includes('tutorial')) return 'Guides & Tutorials';
|
||||||
|
if (fileName.includes('prompt')) return 'Prompt Collection';
|
||||||
|
if (fileName.includes('technique') || fileName.includes('method')) return 'Techniques';
|
||||||
|
|
||||||
// Documentation and text
|
// Numeric files go to general prompt collection
|
||||||
if (ext === 'md' || ext === 'markdown') return 'Documentation';
|
if (/^\d+\.md$/.test(fileName.split('/').pop())) return 'Prompt Collection';
|
||||||
if (ext === 'txt' || ext === 'text') return 'Text Files';
|
|
||||||
if (ext === 'json') return 'Data Files';
|
|
||||||
if (ext === 'xml' || ext === 'yaml' || ext === 'yml') return 'Data Files';
|
|
||||||
|
|
||||||
// Configuration
|
return 'General';
|
||||||
if (name.includes('config') || name.includes('.env') || fileName === '.replit') return 'Configuration';
|
|
||||||
if (ext === 'toml' || ext === 'ini' || ext === 'conf') return 'Configuration';
|
|
||||||
if (fileName === 'package.json' || fileName === 'requirements.txt') return 'Dependencies';
|
|
||||||
|
|
||||||
// Media
|
|
||||||
if (ext === 'jpg' || ext === 'jpeg' || ext === 'png' || ext === 'gif' || ext === 'svg') return 'Images';
|
|
||||||
if (ext === 'ico') return 'Assets';
|
|
||||||
|
|
||||||
return 'Miscellaneous';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GPT Arsenal Application
|
// GPT Arsenal Application
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue