Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Almost finished..
Thanks Stef. Please check the site now in your browser (what are you using on Windows?) I changed the livesearch div from float:left to position:absolute. According to http://ipinfo.info/netrenderer/index.php its correct now.
Offline
Re: Almost finished..
jstubbs wrote:
Thanks Stef. Please check the site now in your browser (what are you using on Windows?)
Fixed. I’m using FF 2.0.0.11 and IE6 (the SP2 edition) under XP.
EDIT: also renders fine in Opera 9.25 (8827)
Last edited by Bloke (2008-01-05 22:11:49)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Almost finished..
Great! Any other problems you see? If its ok in IE6, I guess its ok everywhere! Appreciate the help from you and Peter.
Fixed a lot of the validation errors, but the rest are caused by 2 plugins, and the first one by a body onLoad JS thing. Sigh..
Offline
Re: Almost finished..
It’s looking good, Jonathan! In Opera 8.5 (which I use most being the awkward sod I am ;) hovering over the thumbnail for Multi causes the text to push down the whole body. I notice that Keramick and Global village are also nearly full of text, so depending on the font users have they may get the same jerky motion when they hover. Nothing breaks, it’s just a bit off-putting that’s all.
Your site reminds me a little bit of the new beta BBC website which is fabulous.
Offline
Re: Almost finished..
Looks good – English page doesn’t have Textile’d bullets though (asterisks show up).
For onload, you can use addLoadEvent in your external JS or window.onload.
window.onload = p7_expmenu;
//or
addLoadEvent(p7_expmenu); //be sure include the addLoadEvent function in your js file
Last edited by jm (2008-01-05 22:34:11)
Offline
Re: Almost finished..
@Peter: Thanks! I guess you are referring to the rollover text that displays when moving over the 6 images on the top right of the front page? Yes its ras_rollover plugin. I can’t control that too much because ultimately it depends what the clients put in. Opera 9 seems fine.
@JM: Thanks for the “English” page tip. I fixed it, but now remember I forgot to add a good ul/li style…
For the window.onload event – do you have an example? I am using a drop menu by Project Seven – its their code.
Offline
Re: Almost finished..
Just append the following to your ?js=menu file:
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}
addLoadEvent(p7_expmenu);
That should do it. On second glance, you’ve got a ton of JS – do you really need more than jQuery or mootools? You could just recreate mootools effects in jQuery, or vice versa.
Couple of things Safari’s web inspector shows:
- You’ve got two
body
elements - ./?file=livesearch is being served as text/html instead of text/javascript. Not a browser killer though.
Last edited by jm (2008-01-05 23:15:02)
Offline
Re: Almost finished..
jm wrote:
Couple of things Safari’s web inspector shows:
- You’ve got two
body
elements- ./?file=livesearch is being served as text/html instead of text/javascript. Not a browser killer though.
Thanks for the JS code! I put it in and it works beautifully!
The second BODY element was my mistake last night. Removed.
Livesearch being served as text/html – that’s the <txp:rss_live_search_js />
tag, and that’s what it outputs.
jm wrote:
That should do it. On second glance, you’ve got a ton of JS – do you really need more than jQuery or mootools? You could just recreate mootools effects in jQuery, or vice versa.
No, but its all caused by the plugins:
- aro_slideshow requires Mootools
- ras_rollover requires JQuery (Rick kindly posted jquery code that would work with Mootools)
- Drop-down menu uses a little JS
- Live Search too
I admit to knowing virtually nothing about JS. It would be much better if the only library were JQuery. I use more JS (smd_slimbox) in the other sections, but use conditionals in the header form to check which section we are in before serving the JS. At least that reduces the output.
Any suggestions welcome!
Offline
Re: Almost finished..
You know prototype.js, jQuery and mootools all contain the same functions, so you could change little code little and one library is enough. And coz Rick kindly posted jquery code that would work with Mootools as you said, you could do it, and then you could remove old-fashioned jQuery and stick with Mootools.
If you use both those libraries, you would in some point notice that everything wouldn’t work. In example, if you try in future add fancy js Tooltips to your site, you could notice that it won’t work, as prototype.js and mootools in example include the absolute same function that will cause conflict.
Libraries in the end are only libraries, containing gathered code from all over the web, causing dublication.
Livesearch being served as text/html – that’s the <txp:rss_live_search_js /> tag, and that’s what it outputs.
<txp:rss_live_search_js />
only makes the link, and the plugin outputs the js-code as the link is entered. But the misstake comes when the rss_live_search
outputs the javascript code, as it doesn’t serve it with JavaScript
-application – it just basically doesn’t send header, just outputs text.
You could fix that by adding headers
to the Rob’s plugin, but easier way is copying the JavaScript code and putting it to inside js-file and serving it without Rob’s plugin. Then that error could go away, as some browsers really don’t like wrong headers.
Cheers!
Offline
Re: Almost finished..
Hi Jukka.
I guess you mean this line from Rob’s Live Search plugin:
function rss_live_search_js() {
return '<script type="text/javascript" src="'.hu.'?file=livesearch"></script>';
}
I understand what you mean except for the headers (I don’t know JS). Its preferable to leave things alone unless one knows what one is doing, and I don’t when it comes to JS.
The JS libraries is a pain, frankly. The clients really wanted the rollover text thing (ras_rollover), aro_slideshow and smd_slimbox. The last two run on Mootools, but Stef has already mentioned that he is going to be using Thickbox in the future which uses the JQuery library. That would leave only the aro_slideshow.
Since TXP is moving in the JQuery direction, my thinking was to use whatever I could that runs on JQuery.
Offline
Re: Almost finished..
I understand what you mean except for the headers (I don’t know JS). Its preferable to leave things alone unless one knows what one is doing, and I don’t when it comes to JS.
Yep, JavaScript is pain in the ass, for me also, althought I write it little. Althought I write also Java and Pascal little, but I don’t like them neither.
But what becomes to the headers. They have nothing to do with JavaScript. Headers are served while client loads the file, url so said. And this case the header should be done with PHP.
At Rob’s code there is function that outputs the javascript code inside if(gps('file') == 'rss_livesearch')
-conditional. If you add top of it Header("content-type: application/x-javascript");
, the issue should be fixed. Not in the echo, but to the php-thingy.
But I still suggest to put the Javascript code inside a real js-file and call it throught site’s head. That would automatically fix the headers, as then you would have to use manually made headers. And then it also would load faster and won’t require php-magic that causes load to the server.
The JS libraries is a pain, frankly. The clients really wanted the rollover text thing (ras_rollover), aro_slideshow and smd_slimbox
Yes they are. Remember that every visitor doesn’t have mega sized ram, or super-sonic-computer ;) Also only one JS library should be used at the time. I myself always use prototype, cause I found it’s Ajax best. In another areas Mootools is more fancy looking and easier to use, and have more docs, but mootools have it own misleads, like enourmous amount of code if you want to do “Ajax loaded dropdown menu, with hover-stylechanging and slide-efect”. Basically it requires the hole library that have, er – a quite lot of a size.
Cheers!
Last edited by Gocom (2008-01-06 10:34:07)
Offline
Re: Almost finished..
Since TXP is moving in the JQuery direction, my thinking was to use whatever I could that runs on JQuery.
Yes, the backend uses one jquery function, or two: sortable and form. It refreshes the sort of articles without pageload. Wasn’t the jQuery supose to be removed from the core. As it’s quite big for so small thing.
Cheers!
Last edited by Gocom (2008-01-06 10:44:47)
Offline