i just had a quick look at this tsank.
very clever.
Posted by tsangk on 26 Jul 2009 07:59, last edited by gerdami on 30 Dec 2009 17:59
Related articles
Comments
tsangk,
Nice piece of coding! I have a couple of suggestions to improve this:
- Display any setup prerequisites before you start the page creation process.
- Return the user back to the package page they just installed on packages.wikidot.com.
One particular issue I had when installing the photo gallery package I made is that the last page really isn't a new page. It's the source for creating a link in the side or top navigation.
Also, the pages created were not 100% correct. My package calls for photos:_template and template:photos, but your wizard created those without the category name. Is that an oversight or something I need to change in my package so it works for you.
I don't know how much work would be involved, but it would be really slick if your installation wizard could handle prompting the user to make all of the site manager changes as necessary.
Again, nice job. I really, really like this.
-Ed
Dear god. @tsangk, wtf? I mean… wow!
Now, let's think about this for a moment. Is there anything we can do to make installation more successful, e.g. using standard names in packages, code blocks, etc?
I really like the direction this is going and it more than makes up for that "ugly toolbars" quip.
Very impressive tsangk. I haven't really payed much attention to packages yet, but a packages wizard could really revolutionize them.
@Phil and @David: thanks
@Ed: I'll try fixing those bugs asap!
@pieterh: Yeah, i think if we can make a standard with the name of the files for the scripts (i.e. /local—files/package:x/_start) we might be able to improve the setup PS Those toolbars are "not-so-ugly" now!
Kenneth Tsang (@jxeeno)
I just tried this, and it said I had no security token. I am logged in, it is my site, and it is one I resurrected from the pile of dead sites just to test this.
EDIT: A refresh worked.
Problems:
Because my installer was based on package:3, there will be bugs everywhere.
Here is a list of some of them:
Package 1 - Legal framework
- needs to be installed on category "legal:*" Enter "legal" as catagory
Package 2 - Wiki category
- automatically show instructions which are required
- needs to be installed on category "wiki:*"— Enter "wiki" as catagory
Package 3 - Issue Tracker
- needs to be installed on category "issue:*" Enter "issue" as catagory
Package 4 - Chatter
- needs to be installed on category "chatter:*" Enter "chatter" as catagory
- automatically show instructions which are required
Package 5 - New and Comments
- needs to be installed on category "news:*" Enter "news" as catagory
- automatically show instructions which are required
Package 10 - Polls
- Doesn't work altogether!
Kenneth Tsang (@jxeeno)
Ok. I discovered if you execute javascript:document.getElementById('edit-page-textarea').value+="hi"; in your wikidot wiki with the editor on (/edit/true) it will automatically add "hi" onto the editor.
So I thought I could implement this onto my package installer!
Problem is how can I execute an onclick="document.getElementById('edit-page-textarea').value="hi";" button on the parent that executes in an iframe named wikidot?
Kenneth Tsang (@jxeeno)
I'm a bit over my head, but a quick Google search found this thread: http://www.webmasterworld.com/forum91/299.htm
Does inserting
window.frames[x].document.getElementById(…
possibly help?
-Ed
I don't think you need the ID of the frame, just the element inside the frame. If you read the thread I referenced, it sounds like replacing the "x" with "0" will target the first (and presumably only) frame on the page.
Again, I'm a bit over my head since most of my PHP/Javascript coding is just massaging someone else's snippets. ;) But, if I'm reading that thread properly, he can target the frame by index number and doesn't need the ID.
Am I missing something?
-Ed
Oh sorry tsang, I misinterpreted what you were doing. This is what I thought you meant:
parent page
parent page
parent pagechild iframe
child iframe
child iframe
If there is this link in the child iframe:
<a target="_top" href="http://www.wikidot.com">Go to Wikidot</a>
The page "www.wikidot.com" will be loaded in the parent page (rather than in the child iframe) when clicked on.
As to making the child iframe go the the url that the parent page's javascript specifies, I don't know.
@ed: doesn't work
<iframe src="http://community.wikidot.com/start/edit/true"></iframe>
<a href="#" onclick='window.frames[1].document.getElementById("edit-page-textarea").value="hi"'>Here</a>
Try it on the try-it editor:
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_select2
EDIT: nor does this
<iframe name="test" src="http://community.wikidot.com/start/edit/true"></iframe>
<a href='javascript:document.getElementById("edit-page-textarea").value="hi"' target="test">Here</a>
Kenneth Tsang (@jxeeno)
i just had a quick look at this tsank.
very clever.
tsangk,
Nice piece of coding! I have a couple of suggestions to improve this:
One particular issue I had when installing the photo gallery package I made is that the last page really isn't a new page. It's the source for creating a link in the side or top navigation.
Also, the pages created were not 100% correct. My package calls for photos:_template and template:photos, but your wizard created those without the category name. Is that an oversight or something I need to change in my package so it works for you.
I don't know how much work would be involved, but it would be really slick if your installation wizard could handle prompting the user to make all of the site manager changes as necessary.
Again, nice job. I really, really like this.
-Ed
Community Admin
Dear god. @tsangk, wtf? I mean… wow!
Now, let's think about this for a moment. Is there anything we can do to make installation more successful, e.g. using standard names in packages, code blocks, etc?
I really like the direction this is going and it more than makes up for that "ugly toolbars" quip.
Portfolio
Very impressive tsangk. I haven't really payed much attention to packages yet, but a packages wizard could really revolutionize them.
@Phil and @David: thanks
@Ed: I'll try fixing those bugs asap!
@pieterh: Yeah, i think if we can make a standard with the name of the files for the scripts (i.e. /local—files/package:x/_start) we might be able to improve the setup PS Those toolbars are "not-so-ugly" now!
Kenneth Tsang (@jxeeno)
I just tried this, and it said I had no security token. I am logged in, it is my site, and it is one I resurrected from the pile of dead sites just to test this.
EDIT: A refresh worked.
Problems:
Because my installer was based on package:3, there will be bugs everywhere.
Here is a list of some of them:
Package 1 - Legal framework
Package 2 - Wiki category
Package 3 - Issue Tracker
Package 4 - Chatter
Package 5 - New and Comments
Package 10 - Polls
Kenneth Tsang (@jxeeno)
All files named "nav" is redirected to nav:side :-)
Kenneth Tsang (@jxeeno)
Ok. I discovered if you execute javascript:document.getElementById('edit-page-textarea').value+="hi"; in your wikidot wiki with the editor on (/edit/true) it will automatically add "hi" onto the editor.
So I thought I could implement this onto my package installer!
Problem is how can I execute an onclick="document.getElementById('edit-page-textarea').value="hi";" button on the parent that executes in an iframe named wikidot?
Kenneth Tsang (@jxeeno)
target="_top"
I'm a bit over my head, but a quick Google search found this thread: http://www.webmasterworld.com/forum91/299.htm
Does inserting
possibly help?
-Ed
Community Admin
He'd have to find out what the loading frame is called. What is the name of the frame that calls it. Put it in ' ' and it should work.
I don't think you need the ID of the frame, just the element inside the frame. If you read the thread I referenced, it sounds like replacing the "x" with "0" will target the first (and presumably only) frame on the page.
Again, I'm a bit over my head since most of my PHP/Javascript coding is just massaging someone else's snippets. ;) But, if I'm reading that thread properly, he can target the frame by index number and doesn't need the ID.
Am I missing something?
-Ed
Community Admin
Oh sorry tsang, I misinterpreted what you were doing. This is what I thought you meant:
If there is this link in the child iframe:
The page "www.wikidot.com" will be loaded in the parent page (rather than in the child iframe) when clicked on.
As to making the child iframe go the the url that the parent page's javascript specifies, I don't know.
Kenneth Tsang (@jxeeno)
@ed: doesn't work
Try it on the try-it editor:
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_select2
EDIT: nor does this
Kenneth Tsang (@jxeeno)
Read my earlier post about the ' ' name, or change that 1 to a 0 should work, from the iframe.