|
Joined: Mar 2008
Posts: 1,049
Very Senior Member
|
OP
Very Senior Member
Joined: Mar 2008
Posts: 1,049 |
With so many improvements in note templates area, I'll be happy if note manu bar could have a option to hide itself  (and could be reabilited in right-button menu for example) 
"A user interface is like a joke. If you have to explain it, it's not that good."
|
|
|
|
Joined: May 2008
Posts: 4,930 Likes: 24
Very Senior Member
|
Very Senior Member
Joined: May 2008
Posts: 4,930 Likes: 24 |
But I can't say if the system have a image entry in one of the websites. The point is: QMC2 doesn't know either  ! It's all up to QtWebKit...
A mind is like a parachute. It doesn't work unless it's open. [Frank Zappa]
|
|
|
|
Joined: May 2008
Posts: 4,930 Likes: 24
Very Senior Member
|
Very Senior Member
Joined: May 2008
Posts: 4,930 Likes: 24 |
I tried using this simple JavaScript function in the template to check if an image URL exists / is valid:
<script language="JavaScript">
function imageExists(url)
{
var img = new Image();
img.src = url;
return img.height != 0;
}
</script>
Then do something like this to react on the result of the check:
<script>
if ( imageExists("http://some.domain.net/snaps/$ID$.png") )
document.write("<img src=\"http://some.domain.net/snaps/$ID$.png\">");
else
document.write("<img src=\"$GHOST_IMAGE$\">");
</script>
Works nicely here!
A mind is like a parachute. It doesn't work unless it's open. [Frank Zappa]
|
|
|
|
Joined: May 2008
Posts: 4,930 Likes: 24
Very Senior Member
|
Very Senior Member
Joined: May 2008
Posts: 4,930 Likes: 24 |
I've been asked to add a PDF viewer several times in the past, and though it's basically not too difficult with libraries like poppler or MuPDF, the common issue with all of them is that they have many library-dependencies. Now I found a nice Mozilla pet-project ( PDF.js) which allows me to do it with QtWebKit  ! This is the outcome from my tests:  (It's exactly what's available on their demo-page, just integrated into QMC2's source tree.) It's a bit slow at the moment and has some obvious bugs (mostly known to the developers), however, it's still already doing a nice job and I think it's probably the best alternative I have! What do you think?
A mind is like a parachute. It doesn't work unless it's open. [Frank Zappa]
|
|
|
|
Joined: May 2012
Posts: 429 Likes: 1
Senior Member
|
Senior Member
Joined: May 2012
Posts: 429 Likes: 1 |
Nice, that could be a good way to include the manual archive from progettosnaps.
|
|
|
|
Joined: May 2008
Posts: 4,930 Likes: 24
Very Senior Member
|
Very Senior Member
Joined: May 2008
Posts: 4,930 Likes: 24 |
Right, that's what it's meant for in the first place  ! I will actually not use it in the MiniWebBrowser itself (that was just to do a basic integration test), but I will create a new "manuals" game/machine detail-widget which will use the same technique (and also allow you to select the PDFs and probably other files like image- and text-files). The idea is to have a folder for each game/machine with one or more documents in it...
A mind is like a parachute. It doesn't work unless it's open. [Frank Zappa]
|
|
|
|
Joined: Mar 2008
Posts: 1,049
Very Senior Member
|
OP
Very Senior Member
Joined: Mar 2008
Posts: 1,049 |
I'll add manual support for pdf in the templates soon  Just for curiosity, new versions of QMC2 already have support for open new windows in notes, like it does in MiniWebBrowser?
"A user interface is like a joke. If you have to explain it, it's not that good."
|
|
|
|
Joined: May 2008
Posts: 4,930 Likes: 24
Very Senior Member
|
Very Senior Member
Joined: May 2008
Posts: 4,930 Likes: 24 |
I'll add manual support for pdf in the templates soon  That wouldn't work  . Just for curiosity, new versions of QMC2 already have support for open new windows in notes, like it does in MiniWebBrowser? Yes, but it depends on how you do it (normal link works). It doesn't work through a button with JavaScript, though, because I can only support JS while loading from a template, not when editing (nearly all editing functions are JS based, so that's used internally).
A mind is like a parachute. It doesn't work unless it's open. [Frank Zappa]
|
|
|
|
Joined: Mar 2008
Posts: 1,049
Very Senior Member
|
OP
Very Senior Member
Joined: Mar 2008
Posts: 1,049 |
Just for curiosity, new versions of QMC2 already have support for open new windows in notes, like it does in MiniWebBrowser? Yes, but it depends on how you do it (normal link works). It doesn't work through a button with JavaScript, though, because I can only support JS while loading from a template, not when editing (nearly all editing functions are JS based, so that's used internally). That means that maybe QMC2 notes never will support buttons that open windows (just normal links) or maybe that could come someday?
"A user interface is like a joke. If you have to explain it, it's not that good."
|
|
|
|
Joined: May 2008
Posts: 4,930 Likes: 24
Very Senior Member
|
Very Senior Member
Joined: May 2008
Posts: 4,930 Likes: 24 |
It means right now this isn't supported. I know what I'd have to do to make it work, but the HTML editor doesn't support this in the same way as the browser right now (simply because it was never meant to be used like a browser  ).
A mind is like a parachute. It doesn't work unless it's open. [Frank Zappa]
|
|
|
2 members (2 invisible),
20
guests, and
3
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
Forums9
Topics9,103
Posts119,286
Members5,019
|
Most Online890 Jan 17th, 2020
|
|
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!
|
|
|
|