Include vanilla file in Wicket? - wicket

It would be useful to be able to include some vanilla text files, containing simple scripts (with no HTML-relevant content), in an HTML page in my Wicket portal. There's no end to support for .css and .js, but I would just like to drop simple text inside a
<pre>
...
</pre>
paragraph so that I don't have to keep copying and pasting when these change. Or, am I in too much of a hurry and have asked the wrong question?
Profuse thanks for any and all comments.
Later, ...
The answer I got triggered it for me. It was just what I needed. Unfamiliar as I am with Wicket, this was pretty much over my head. However, thanks to the marvel of Google and a more knowledgeable friend, I was able to get this going. A pretty thorough description of my complete solution can be found at http://www.javahotchocolate.com/notes/wicket.html. Thanks to Nicktar!

Just give your pre-tag a wicket-id and fill it with a Label, setting EscapeModelStrings to false for the Label...

Related

PrestaShop: How to find the origin of any peace of code that we see in browser's code source view?

I am writting this post because I am sometimes confronted to this problem as a web developper. And I must admit I am a bit ashamed about it.
Some peaces of codes are quite easy to find into a CMS content. But some are much harder.
To illustrate my post I will give an example of a peace of code I really cannot find on a Prestashop website, see this photo:
screenshot
So, I would like to find the origin of this script tag surrounded in red in the prestashop files...
First thing I tried was to search into the prestashop directory files for a string like => "script type="text/javascript src="http://tatouagetemporaire ..", I tested other strings but could not find a match.
My guess is that this peace of code is created from with a function (in php/JS or even smarty), and that is why I can't find any match in the whole code of the theme.
So, my question:
How can we find 100% of time the origin of any peace of code that we see in the browser's source code view ?
And if you have an answer for this specific case that would be very cool.
Thanks
You must turn off the CCC and cache from BackOffice to see the source codes

Strike through page header in DokuWiki

I am looking for a way to strike through page header in DokuWiki. I checked on Dokuwiki page but couldn't find it. Can anyone please help me with it.
Another alternative would be to use an external tool like http://manytools.org/facebook-twitter/strikethrough-text/ to generate UTF-8 text that is already stricken through and then to copy&paste it into DokuWiki as your headline.
One advantage is that then also your links will display the headline as stricken through.
Also, you don't have to meddle with custom CSS or additional plugins.
it's a limitation of how headlines work in DokuWiki
See explanation here.

How to integrate TinyMce with Zend Framework with Gzipping and Image managers?

I have done some research on this subject, and found out, that Gzipping and adding a new image manager through a plugin would not be as difficult. The only question is the Image manager.
I have seen some quite good ones, like the Image Manager for JCE, which is a Joomla wysiwyg editor, but none for TinyMce for itself.
Could someone show me a good image plugin?
P.S. SwampyFoot is out of question, as it's download links are broken, and PhP Letters Ajax image manager is quite hard to install.
Thanks!
EDIT: I just found Mad File Manager, which seems to work excelently except for a little glitch: An image can be uploaded, but cant be selected... Thats sad...
EDIT2: I've found KCFinder, which seems to be very promising, but I just can't get it to work properly. Somehow, the configuration is quite difficult.
Ok, So I have been able to answer my question myself. So here it goes:
Set up TinyMce with Sozfo solution. The important ting to remember here is, instead of extending your Forms from Zend_Form, you have to extend them from Sozfo_Form. As to the defining your own extendable controller, it didnt work for me, So I put the path defining helpers in my Bootstrap. And if the whole ordeal works, there is a textarea that should have TinyMCE controls, but there aren't any, try checking the comments at Sozfo, or checking if the page is cached or not. It took me a good hour, to find out, that the only reason why no JavaScript was pushed to the header was because of a very persistent cache.
Set up KCFinder. The main problems I faced here were due to wrong paths to corresponding files. When the paths were correct, the only thing to remember is to enable it. There is a boolean to change in configuration file.
The last issue was adding the KCFinder to my Tinymce, and what I ended up doing was, I added the function needed to call KCFinder in TinyMCE.php View helper. ( Due to some glitch I seem to be unable to post the code here). Once you have set up your paths correctly, everything should work splendidly.
All in all, it took me about 3 days to figure this whole thing out. Talk about steep learning curve...
Have you looked at MCImageManager - its not free but its an option if you're happy to pay for it
Not really a suggest as you've got it but swampy foot download does work
As you're already using zend framework, why not use dojo, set up the dojo form and call the editor element and integrate this http://docs.dojocampus.org/dijit/_editor/plugins/LinkDialog into it?

TinyMCE writes terrible HTML!

I've currently got TinyMCE incorporated into the backend editor of a simple blogging/page-editing app, but I'm extremely unhappy with the HTML code it creates. It does all sorts of messy things like:
Adding inline style information to span tags that you can't ever find to get rid of without editing the HTML directly.
Nesting tags in nonsense ways (e.g. <p><strong><p><span>some text</span></p><strong></p> just to make something bold.)
Adding empty <p> </p> lines where they don't belong and I'm not trying to create blank lines.
EDIT: I've looked at lists of the other editors out there (including on SO), but I want to know if people firsthand have had better luck getting clean code out of their wysiwyg editors.
Any recommendations for one that outputs better code behind the scenes?
How about a rather drastic alternative, and using a WYMIWYG (What You Mean is What You Get) editor rather that another WYSIWYG editor. That way the author is in full control of the schematic markup as well as the content he/she is entering.
Unfortunately I haven't found one that is as feature rich and usable as tinyMCE, but it seems to have come a long way - see http://www.wymeditor.org/demo/
Use HTML purifier before saving the content into the database.
HTML Purifier
I found JoomlaFCK to be a very good alternative to Tiny MCE.
Hope you like it.
bye
BTW I know it is an old thread but someone might use it. ;)

How can I search in an UIWebView?

I need to perform search in an html page displayed in a UIWebView control. The functionality I need is something that Safari has, when you hit command/ctrl F for searching the document for some word and the program highlights the hits for you. Is there any easy solution for this problem?
I know it's been a long time since you asked this question, but it's still a pretty common question people have so I put together a sample project in case anyone else is asking the same question. The project is a super simple app that loads an HTML file and can search and highlight any keyword. You can download the sample project here:
https://www.dropbox.com/s/jietctrvrtnec28/TheSearcher.zip?dl=0
Scott
Edit: changed link above as the old one had broken.
You could do this with javascript. Check out the "Find in this page" bookmarklet:
http://www.lifeclever.com/17-powerful-bookmarklets-for-your-iphone/
Something like that, combined with:
http://developer.apple.com/iphone/library/documentation/uikit/reference/UIWebView_Class/Reference/Reference.html#//apple_ref/occ/instm/UIWebView/stringByEvaluatingJavaScriptFromString:
might do the trick.