Actually could ht
tps://hlf-polls.appspot.com/#/polls/
3
?height=
646
be embedded into:
<
iframe src="ht
tps://
embed-dot-
hlf-polls.appspot.com/#/polls/
3
"
style="margin:auto; display: block;"
height="
646
"
width="450"
></iframe>
My reasoning is that non-linkify users should see a link to the non-embedded link, so the non-embedded link should embed the embedded iframe for linkify users. The reason for the "embed-dot-" and not "embed." subdomain is that appspot doesn't support subdomains but lets users use "-dot-" instead. It's a little strange but it's only the embedded url and the way it's being used should mean it won't get seen.
I have tried doing that and my main problem is linkify doesn't know when a thread no longer exists, so you end up lots of data stored that has no use. The more data the slower linkify becomes and there is a limit on how much I can store.
Basically I have a number of obstacles to overcome and I'm not sure I can do it well from within the scope of the browser. It is something I'm still looking into tho
Well since :visited doesn't allow background images as per Mozilla, how about something like this? https://developer.mozilla.org/en-US/docs/Web/CSS/:visited
Tried looking into some JS that would then read CSS values but overall it seems more of a hassle than it is worth. It would be nice if images would work with :visited pseudo classes, but they just won't.
Thanks Blasty, I totally missed that with the url.
I have made the changes you suggested. There is still one issue and that's the size difference between the vote page and the results page.
The best way I can describe it is create a poll, you'll see it embeds nicely. But once you vote the size changes and requires scrolling (depending on the poll). I only mention this because it's the results that will get the most views rather than the vote page.
Chances are I'm missing something else, so I appreciate your patience. Just want to get it 100% right before I go any further
Version 3.1.8.45 is live and has the changes.
here's some example polls, watch what happens after voting...
Ryan M
said
:
Tried looking into some JS that would then read CSS values but overall it seems more of a hassle than it is worth. It would be nice if images would work with :visited pseudo classes, but they just won't.
The visited thing isn't something I have looked into, there is some nice potential there. I'll definitely look into the info you have given
Never used it but I'm keen to give postMessage a try.
I'm very familiar with message parsing among srcipts (same origin) so I expect it should be pretty straight forward. The only thing I need to check up on is permissions from within an extension.
Edit: If using postMessage there will be some things to consider, such as if there are multiple polls on the page. I guess the poll id and height can be sent to solve that.
It looks very simple for the iframe to send a message to the parent, pretty sure I can inject a listener and then take action from there.
20-Jun-2015 08:51:53
- Last edited on
20-Jun-2015 09:14:32
by
Indecent Act
var receiveMessage=function(e){
var message;
try{
message=JSON.parse(e.data)
}catch(err){return false};
$('#hlfpolls-frame'+message.id).height(message.height)}
Hmm, actually could a unique identifier be passed through the url instead, since it'll mean it'll be more able to support the create page better and and also it'll support multiple of the same poll (although neither are necessary). Otherwise, I could set the id to -1 or "create" for creation maybe.
With the id being passed through the url, It would be something like this:
That locates the iframe by src and applies the new height and ensures the hight is assigned to correct iframe.
I assume the /#/polls/
4
<--- the number is unique to that poll.
I figure since it's already in the url there is no need to create more parameters because every poll has it's own unique url.
As for your question about id parameters, yes but for me to use it must identify the url. But remember we can get other stuff via post message to keep the url small and clean. Also we may be able to eliminate the height parameter altogether since I can get it via message. But I think first of all we should get the basics sorted and get the height and target iframe wrapped up.
Then we can refine a few things and build on it
20-Jun-2015 12:21:50
- Last edited on
20-Jun-2015 12:59:09
by
Indecent Act
Passing an id to the poll through postMessage instead of url would make it neater for sure
, but to use postMessage to do it I think I have to send you a postMessage first to say the iframe is ready to receive an id. (no onload for iframes)
If that's the case, perhaps it could go something like this: