MCPcopy
hub / github.com/ollm/OpenComic / updateReadingPagesConfig

Function updateReadingPagesConfig

scripts/reading.js:3113–3159  ·  view source on GitHub ↗
(key, value)

Source from the content-addressed store, hash-verified

3111}
3112
3113function updateReadingPagesConfig(key, value)
3114{
3115 _config[key] = value;
3116
3117 if(currentReadingConfigKey === false)
3118 {
3119 var readingPagesConfig = storage.getKey('readingPagesConfig', dom.history.mainPath);
3120 if(!readingPagesConfig || readingPagesConfig.configKey > 0)
3121 {
3122 if(readingPagesConfig && readingPagesConfig.configKey > 0)
3123 {
3124 var readingShortcutPagesConfig = storage.getKey('readingShortcutPagesConfig', readingPagesConfig.configKey);
3125
3126 if(readingShortcutPagesConfig)
3127 readingPagesConfig = copy(readingShortcutPagesConfig);
3128 else
3129 readingPagesConfig = copy(config);
3130 }
3131 else
3132 {
3133 readingPagesConfig = copy(config);
3134 }
3135 }
3136
3137 template.globalElement('.reading-shortcut-pages-config .menu-simple-element-icon-select').removeClass('active');
3138
3139 readingPagesConfig.configKey = false;
3140 readingPagesConfig[key] = value;
3141
3142 storage.updateVar('readingPagesConfig', dom.history.mainPath, readingPagesConfig);
3143 }
3144 else if(currentReadingConfigKey > 0)
3145 {
3146 var readingShortcutPagesConfig = storage.getKey('readingShortcutPagesConfig', currentReadingConfigKey);
3147
3148 if(readingShortcutPagesConfig)
3149 {
3150 readingShortcutPagesConfig[key] = value;
3151
3152 storage.updateVar('readingShortcutPagesConfig', currentReadingConfigKey, readingShortcutPagesConfig);
3153 }
3154 }
3155 else if(currentReadingConfigKey == 0)
3156 {
3157 storage.updateVar('config', key, value);
3158 }
3159}
3160
3161//Controls the page view
3162function changePagesView(mode, value, save)

Callers 1

changePagesViewFunction · 0.85

Calls 1

copyFunction · 0.70

Tested by

no test coverage detected