File tree Expand file tree Collapse file tree 14 files changed +28
-21
lines changed Expand file tree Collapse file tree 14 files changed +28
-21
lines changed Original file line number Diff line number Diff line change 22 "manifest_version" : 2 ,
33 "name" : " DjVu.js Viewer" ,
44 "short_name" : " DV" ,
5- "version" : " 0.9.1 .0" ,
5+ "version" : " 0.9.2 .0" ,
66 "author" : " RussCoder" ,
77 "homepage_url" : " https://github.com/RussCoder/djvujs" ,
88 "description" : " Opens links to .djvu files. Allows opening files from a local disk. Processes <object> & <embed> tags." ,
Original file line number Diff line number Diff line change 11# DjVu.js Viewer's Changelog
22
3+ ## v.0.9.2 (09.04.2023)
4+
5+ - Support for "data:" URLs
6+
37## v.0.9.1 (01.02.2023)
48
59- Spanish translation update.
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ const Events = constant({
1717
1818export default class DjVuViewer extends EventEmitter {
1919
20- static VERSION = '0.9.1 ' ;
20+ static VERSION = '0.9.2 ' ;
2121
2222 static Events = Events ;
2323 static Constants = Constants ;
Original file line number Diff line number Diff line change @@ -41,13 +41,14 @@ const LinkBlock = () => {
4141 return (
4242 < LinkBlockRoot onSubmit = { ( e ) => {
4343 e . preventDefault ( ) ;
44- if ( / ^ h t t p s ? : \/ \/ .+ / . test ( url . trim ( ) ) ) {
44+ const trimmedUrl = url . trim ( ) ;
45+ if ( / ( ( ^ h t t p s ? : \/ \/ ) | ( ^ d a t a : ) ) .+ / . test ( trimmedUrl ) ) {
4546 dispatch ( {
4647 type : ActionTypes . LOAD_DOCUMENT_BY_URL ,
47- url : url ,
48+ url : trimmedUrl ,
4849 } ) ;
4950 } else {
50- alert ( t ( 'Enter a valid URL (it should start with "http(s)://")' ) ) ;
51+ alert ( t ( 'Enter a valid URL (it should start with "http(s)://" | "data:" )' ) ) ;
5152 }
5253 } } >
5354 < input
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ import { get } from './reducers';
44
55export default function initHotkeys ( store ) {
66 document . addEventListener ( 'keydown' , ( e ) => {
7+ if ( ! get . isDocumentLoaded ( store . getState ( ) ) ) return ;
8+
79 if ( ( e . key === 's' || e . code === 'KeyS' ) && e . ctrlKey ) { // code property isn't supported in Edge yet
810 e . preventDefault ( ) ;
911 store . dispatch ( Actions . tryToSaveDocument ( ) ) ;
Original file line number Diff line number Diff line change @@ -46,8 +46,8 @@ export default {
4646 "在此处粘贴djvu文件的地址" ,
4747 "Open URL" :
4848 "打开地址" ,
49- 'Enter a valid URL (it should start with "http(s)://")' : // an alert shown when you try to open an empty URL
50- '输入一个有效的地址 (应当以 "http(s)://" 开头)' ,
49+ 'Enter a valid URL (it should start with "http(s)://" | "data:" )' : // an alert shown when you try to open an empty URL
50+ '输入一个有效的地址 (应当以 "http(s)://" | "data:" 开头)' ,
5151
5252 // Errors. Usually there is a header and a message for each error type.
5353 // For the web request error there are different types of messages depending on the HTTP status.
Original file line number Diff line number Diff line change @@ -46,8 +46,8 @@ export default {
4646 "Paste a URL to a djvu file here" ,
4747 "Open URL" :
4848 "Open URL" ,
49- 'Enter a valid URL (it should start with "http(s)://")' : // an alert shown when you try to open an empty URL
50- 'Enter a valid URL (it should start with "http(s)://")' ,
49+ 'Enter a valid URL (it should start with "http(s)://" | "data:" )' : // an alert shown when you try to open an empty URL
50+ 'Enter a valid URL (it should start with "http(s)://" | "data:" )' ,
5151
5252 // Errors. Usually there is a header and a message for each error type.
5353 // For the web request error there are different types of messages depending on the HTTP status.
Original file line number Diff line number Diff line change @@ -46,8 +46,8 @@ export default {
4646 "Copier un lien vers un fichier .djvu" ,
4747 "Open URL" :
4848 "Ouvrir le lien" ,
49- 'Enter a valid URL (it should start with "http(s)://")' : // an alert shown when you try to open an empty URL
50- 'Insérer une URL valide (doit commencer par "http(s)://")' ,
49+ 'Enter a valid URL (it should start with "http(s)://" | "data:" )' : // an alert shown when you try to open an empty URL
50+ 'Insérer une URL valide (doit commencer par "http(s)://" | "data:" )' ,
5151
5252 // Errors. Usually there is a header and a message for each error type.
5353 // For the web request error there are different types of messages depending on the HTTP status.
Original file line number Diff line number Diff line change @@ -46,8 +46,8 @@ export default {
4646 "Incolla qui l'URL al file DjVu" ,
4747 "Open URL" :
4848 "Apri URL" ,
49- 'Enter a valid URL (it should start with "http(s)://")' : // an alert shown when you try to open an empty URL
50- 'Inserire un URL valido (deve iniziare con "http(s)://")' ,
49+ 'Enter a valid URL (it should start with "http(s)://" | "data:" )' : // an alert shown when you try to open an empty URL
50+ 'Inserire un URL valido (deve iniziare con "http(s)://" | "data:" )' ,
5151
5252 // Errors. Usually there is a header and a message for each error type.
5353 // For the web request error there are different types of messages depending on the HTTP status.
Original file line number Diff line number Diff line change @@ -46,8 +46,8 @@ export default {
4646 "Colar aqui um URL a um ficheiro djvu" ,
4747 "Open URL" :
4848 "Abrir URL" ,
49- 'Enter a valid URL (it should start with "http(s)://")' : // an alert shown when you try to open an empty URL
50- 'Introduza um URL válido (deve começar com "http(s)://")' ,
49+ 'Enter a valid URL (it should start with "http(s)://" | "data:" )' : // an alert shown when you try to open an empty URL
50+ 'Introduza um URL válido (deve começar com "http(s)://" | "data:" )' ,
5151
5252 // Errors. Usually there is a header and a message for each error type.
5353 // For the web request error there are different types of messages depending on the HTTP status.
You can’t perform that action at this time.
0 commit comments