Skip to content

Commit

Permalink
Add New Release Note
Browse files Browse the repository at this point in the history
  • Loading branch information
RealLowMaster committed Feb 15, 2022
1 parent 521b99d commit e51fe8a
Show file tree
Hide file tree
Showing 9 changed files with 120 additions and 139 deletions.
30 changes: 28 additions & 2 deletions CSS/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ input::-webkit-input-placeholder { user-select: none }
flex-flow: column;
width: 100%;
height: calc(100% - var(--topMenuSize));
z-index: 0;
}

#main > div:first-child {
Expand All @@ -129,6 +130,7 @@ input::-webkit-input-placeholder { user-select: none }
background-color: var(--obr-con-bgc);
overflow-y: auto;
position: relative;
z-index: -1;
}

/* Menu */
Expand Down Expand Up @@ -206,7 +208,7 @@ input::-webkit-input-placeholder { user-select: none }
min-width: 110px;
height: auto;
position: absolute;
z-index: +1;
/* z-index: +1; */
}

.menu-dropdown > div > button { padding: 10px }
Expand Down Expand Up @@ -1687,4 +1689,28 @@ input::-webkit-input-placeholder { user-select: none }
color: #222;
text-transform: capitalize;
user-select: text;
}
}

/* New Release Note */
#nrelease-note {
display: none;
width: 100%;
height: calc(100% - var(--topMenuSize));
padding: 20px 35px;
background-color: #F8F8FC;
color: #000;
overflow-y: auto;
position: fixed;
top: var(--topMenuSize);
left: 0;
}

#nrelease-note > h1, #nrelease-note > h2, #nrelease-note > h3 { display: block; width: 100%; margin-bottom: 30px; font-size: 36px; font-weight: 400; }
#nrelease-note > h1 { font-weight: 600; }
#nrelease-note > h2 { margin-bottom: 50px; font-size: 24px; }
#nrelease-note > h3 { margin-bottom: 12px; font-size: 18px; }
#nrelease-note > ul { display: block; width: 100%; padding-left: 40px; margin-bottom: 30px; line-height: 32px; }
#nrelease-note > ul > li > span { color: #7d7d89; }
#nrelease-note > div { width: 100%; margin-bottom: 20px; text-align: right }
#nrelease-note > div > div { display: inline-block; padding: 7px 10px; cursor: pointer; user-select: none; border-radius: 4px; }
#nrelease-note > div > div:hover { background-color: #e9e9ea; }
105 changes: 75 additions & 30 deletions JS/requires.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const defaultSetting = {
"rdls": false,
"full_screen": true,
"open_br_startup": false,
"rc": 0,
"auto_backup": true,
"developer_mode": false
}
Expand Down Expand Up @@ -66,7 +67,7 @@ const keydownEvents = [
'SettingKeyEvents({ctrl},{shift},{key})', // 4
'InfoKeyEvents({ctrl},{shift},{key})' // 5
]
const ThisWindow = remote.getCurrentWindow(), loading = new Loading(9), Downloader = new DownloadManager(), PageManager = new OfflinePageManager(), db = {}, procressPanel = new ProcressPanel(0), update_number = 13, SliderManager = new Slider()
const ThisWindow = remote.getCurrentWindow(), loading = new Loading(9), Downloader = new DownloadManager(), PageManager = new OfflinePageManager(), db = {}, procressPanel = new ProcressPanel(0), SliderManager = new Slider(), update_number = 14
let comicDeleting = false, wt_fps = 20, dirDB, dirUL, dirBU, dirTmp, isOptimizing = false, browserLastTabs = [], tabsHistory = [], dirHistory = '', keydownEventIndex = 0, new_update, save_value = null, save_value2 = null, afterDLReload = true, setting, openedMenuTabIndex, copiedTab = null, tabs = [], lastComicId, searchTimer, activeTabComicId = null, activeTabIndex = null, tabsPos = [], tabsPosParent = [], isUpdating = false, collectionsDB = [], groupsDB = [], artistsDB = [], parodiesDB = [], tagsDB = [], charactersDB = [], languagesDB = [], categoriesDB = [], comicGroupsDB = [], comicArtistsDB = [], comicParodiesDB = [], comicTagsDB = [], comicCharactersDB = [], comicLanguagesDB = [], comicCategoriesDB = [], indexDB = [], haveDBSite = [], haveDBId = [], haveDBComic = []

/*
Expand Down Expand Up @@ -938,55 +939,99 @@ function CreateDatabase() {
}

function CheckSettings() {
if (typeof(setting.theme) != 'number' || setting.theme < 0) setting.theme = defaultSetting.theme
if (typeof setting.theme != 'number' || setting.theme < 0) setting.theme = defaultSetting.theme
if (setting.theme > 1) setting.theme = 1
if (typeof(setting.pagination_theme) != 'number' || setting.pagination_theme < 0) setting.pagination_theme = defaultSetting.pagination_theme
if (typeof setting.pagination_theme != 'number' || setting.pagination_theme < 0) setting.pagination_theme = defaultSetting.pagination_theme
if (setting.pagination_theme > 6) setting.pagination_theme = 6
if (typeof(setting.waiting_quality) != 'number') setting.waiting_quality = defaultSetting.waiting_quality
if (typeof setting.waiting_quality != 'number') setting.waiting_quality = defaultSetting.waiting_quality
if (setting.waiting_quality > 2) setting.waiting_quality = 2
else if (setting.waiting_quality < 0) setting.waiting_quality = 0
if (typeof(setting.max_per_page) != 'number') setting.max_per_page = defaultSetting.max_per_page
if (typeof setting.max_per_page != 'number') setting.max_per_page = defaultSetting.max_per_page
if (setting.max_per_page < 1) setting.max_per_page = 1
if (typeof(setting.img_graphic) != 'number' || setting.img_graphic < 0) setting.img_graphic = defaultSetting.img_graphic
if (typeof setting.img_graphic != 'number' || setting.img_graphic < 0) setting.img_graphic = defaultSetting.img_graphic
if (setting.img_graphic > 1) setting.img_graphic = 1
if (typeof(setting.notification_download_finish) != 'boolean') setting.notification_download_finish = defaultSetting.notification_download_finish
if (typeof(setting.notification_optimization_finish) != 'boolean') setting.notification_optimization_finish = defaultSetting.notification_optimization_finish
if (typeof(setting.lazy_loading) != 'boolean') setting.lazy_loading = defaultSetting.lazy_loading
if (typeof setting.notification_download_finish != 'boolean') setting.notification_download_finish = defaultSetting.notification_download_finish
if (typeof setting.notification_optimization_finish != 'boolean') setting.notification_optimization_finish = defaultSetting.notification_optimization_finish
if (typeof setting.lazy_loading != 'boolean') setting.lazy_loading = defaultSetting.lazy_loading
if (setting.lazy_loading == false) imageLazyLoadingOptions.rootMargin = "0px 0px 1200px 0px"
if (typeof(setting.tabs_limit) != 'number') setting.tabs_limit = defaultSetting.tabs_limit
if (typeof setting.tabs_limit != 'number') setting.tabs_limit = defaultSetting.tabs_limit
if (setting.tabs_limit < 1) setting.tabs_limit = 1
if (typeof(setting.download_limit) != 'number') setting.download_limit = defaultSetting.download_limit
if (typeof setting.download_limit != 'number') setting.download_limit = defaultSetting.download_limit
if (setting.download_limit < 1) setting.download_limit = 1
if (typeof(setting.show_unoptimize) != 'boolean') setting.show_unoptimize = defaultSetting.show_unoptimize
if (typeof(setting.check_update) != 'boolean') setting.check_update = defaultSetting.check_update
if (typeof(setting.auto_close_optimize_panel) != 'boolean') setting.auto_close_optimize_panel = defaultSetting.auto_close_optimize_panel
if (typeof(setting.open_br_startup) != 'boolean') setting.open_br_startup = defaultSetting.open_br_startup
if (typeof setting.rc !== 'number') setting.rc = defaultSetting.rc
if (typeof setting.show_unoptimize != 'boolean') setting.show_unoptimize = defaultSetting.show_unoptimize
if (typeof setting.check_update != 'boolean') setting.check_update = defaultSetting.check_update
if (typeof setting.auto_close_optimize_panel != 'boolean') setting.auto_close_optimize_panel = defaultSetting.auto_close_optimize_panel
if (typeof setting.open_br_startup != 'boolean') setting.open_br_startup = defaultSetting.open_br_startup
if (typeof setting.rdls != 'boolean') setting.rdls = defaultSetting.rdls
if (typeof(setting.full_screen) != 'boolean') setting.full_screen = defaultSetting.full_screen
if (typeof(setting.auto_backup) != 'boolean') setting.auto_backup = defaultSetting.auto_backup
if (typeof(setting.developer_mode) != 'boolean') setting.developer_mode = defaultSetting.developer_mode
if (typeof setting.full_screen != 'boolean') setting.full_screen = defaultSetting.full_screen
if (typeof setting.auto_backup != 'boolean') setting.auto_backup = defaultSetting.auto_backup
if (typeof setting.developer_mode != 'boolean') setting.developer_mode = defaultSetting.developer_mode
if (setting.developer_mode == true) {
window.addEventListener('keydown', e => {
if (e.ctrlKey && e.shiftKey && e.which == 73) remote.getCurrentWebContents().toggleDevTools()
})
}
}

function CheckReleaseNote() {
if (fs.existsSync(__dirname+'/release-note.json')) {
new_update = jsonfile.readFileSync(__dirname+'/release-note.json')
fs.unlinkSync(__dirname+'/release-note.json')
function OpenReleaseNotes() {
if (!fs.existsSync(__dirname+'/rn.json')) return
let data
try { data = jsonfile.readFileSync(__dirname+'/rn.json') || null } catch(err) { console.error(err) }
if (data == null) return
// data = {
// version: '',
// new: [],
// bug: [],
// impr: [],
// plan: []
// }

const container = document.getElementById('nrelease-note')
let html = ''

if (data.version != null) html += '<h1>Release Notes v'+data.version+'</h1>'
html += "<h2>🚀 What's New</h2>"

if (data.new != null) {
html += '<h3>🔥 New Features</h3><ul>'
for (let i = 0, l = data.new.length; i < l; i++) html += '<li><span>'+data.new[i]+'</span></li>'
html += '</ul>'
}

if (data.bug != null) {
html += '<h3>🔧 Bug Fixes</h3><ul>'
for (let i = 0, l = data.bug.length; i < l; i++) html += '<li><span>'+data.bug[i]+'</span></li>'
html += '</ul>'
}

document.getElementById('r-n-n-v').innerHTML = "What's new in v"+new_update.v
let html = '<h2>Important Changes</h2>'
for (let i = 0; i < new_update.s.length; i++) {
html += `<p class="${new_update.c[i]}">${new_update.s[i]}</p>`
}
document.getElementById('r-n-n-n').innerHTML = html
document.getElementById('release-note').style.display = 'flex'
if (data.impr != null) {
html += '<h3>🌟 Improvements</h3><ul>'
for (let i = 0, l = data.impr.length; i < l; i++) html += '<li><span>'+data.impr[i]+'</span></li>'
html += '</ul>'
}

if (data.plan != null) {
html += '<h3>🚢 Plans</h3><ul>'
for (let i = 0, l = data.plan.length; i < l; i++) html += '<li><span>'+data.plan[i]+'</span></li>'
html += '</ul>'
}

if (setting.rc == update_number) html += '<div><div onclick="CloseReleaseNotes()">Close</div></div>'
else html += '<div><div onclick="CloseReleaseNotes()">Show This Later</div><div onclick="CloseReleaseNotes(true)">I Undrestand</div></div>'

container.innerHTML = html
container.style.display = 'block'
container.scrollTop = 0
}

new_update = null
function CloseReleaseNotes(save = false) {
const container = document.getElementById('nrelease-note')
container.style.display = 'none'
container.innerHTML = null
if (save) {
setting.rc = update_number
try { jsonfile.writeFileSync(dirDocument+'/setting.json', setting) } catch(err) { console.error(err) }
}
}

Expand Down
2 changes: 1 addition & 1 deletion JS/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function AfterDatabaseDoneOnStartup() {
}

try {
CheckReleaseNote()
if (setting.rc != update_number) OpenReleaseNotes()
} catch(err) {
error("Startup->CheckReleaseNote->Err: "+err)
console.error(err)
Expand Down
6 changes: 5 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<body>
<div id="window">
<div id="window-menu">
<div>X Comic Downloader v2.2.0</div>
<div>X Comic Downloader v2.3.3</div>
<div>
<button type="button" onclick="remote.app.quit()"><svg aria-hidden="true" focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512"><path fill="currentColor" d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"></path></svg></button>
<button type="button" onclick="maximizeApp()"><svg aria-hidden="true" focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M464 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm0 394c0 3.3-2.7 6-6 6H54c-3.3 0-6-2.7-6-6V192h416v234z"></path></svg></button>
Expand Down Expand Up @@ -81,6 +81,7 @@
</div>
<button type="button" onclick="Downloader.OpenPanel()" title="Open Downloads">Downloads</button>
<button type="button" onclick="RepairAllComicInfos()" title="Repair All Comics Infos">Repair All</button>
<button type="button" onclick="OpenReleaseNotes()" title="Release Notes">Release Notes</button>
</div>
</div>
<button onclick="openSetting()">Setting</button>
Expand Down Expand Up @@ -720,6 +721,9 @@
</div>
</div>

<!-- New Release Note -->
<div id="nrelease-note"></div>

<!-- Export Panel -->
<div id="export-panel">
<div onclick="closeComicExportPanel()"></div>
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function createWindow () {
minHeight: 600,
frame: false,
center: true,
title: 'X Comic Downloader v2.2.0',
title: 'X Comic Downloader v2.3.3',
webPreferences: {
enableRemoteModule: true,
nodeIntegration: true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "x-comic-downloader",
"version": "2.2.0",
"version": "2.3.3",
"description": "A Software for Downloading Adult and Hentai Comic and Manga and Manage Theme.",
"main": "index.js",
"author": "Mehdi Enayatzadeh (LowMaster)",
Expand Down
85 changes: 0 additions & 85 deletions release-maker.html

This file was deleted.

1 change: 1 addition & 0 deletions rn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":"2.3.3","new":["Add Ability To Sort With Multiple Tags/etc... (Requested By Zogarth23)","Add Right Click Ability To Browser Links","Add Comic Properties * Right Click Comic -> Properties","Add Download Button To nhentai Related Comics","Add More Choose Location Checkup"],"bug":["Fix Bug: When renaming still can use hotkeys","Fix Some Database Optimization Bugs","Fix Some Right Click Menu Bugs","Fix Some Gallery Comic Loading","Fix Some Slider Mouse Event Bugs"],"impr":["Optimize Have Database and its System","Merge Collections To Normal Gallery View","Change Slider Mouse System","Make Image LoadingStop System Work Better","Make History Checkboxs Hitbox Bigger"],"plan":["Add Download Log (Requested By SmartBadger)","Add Tab System In Personal Gallery (Requested By Zogarth23)","Add Ability To ReDownload an Image","Add Bookmark System To Browser","Add Ability To Edit Comic Infos Such as Tags/Artists/etc..."]}
Loading

0 comments on commit e51fe8a

Please sign in to comment.