Tokyoj

Topic: Inserting Java script into a new page via Admin.

I'm creating an FAQ page and have been trying to insert java script into the page using Jobberbase's 'Pages' Admin function using the Tiny_mce Editor's HTML window.

The page is created in Dreamweaver so I was hoping to just copy&paste the whole code into the window and save the page but the java script isn't performing. I checked the links to the CSS and script and all seem fine.

The page is perfect as a separate .html file but when I use the same code in the Tiny_mce Editor it's a no-go.

Is there something special that I need to be doing to get this to work from within the 'Pages' section of Admin?

---------------
Tokyoj
"You can't build a reputation on what you're going to do." (Henry Ford)
"Insanity is doing the same thing over and over, expecting different results." (Albert Einstein)

evertsemeijn

Re: Inserting Java script into a new page via Admin.

I'm struggling with the same problem. Seems that TinyMCE transforms the HTML code you paste (try editing the widget page). There is a workaround: posting directly into the database by SQL.

Member of Jobberbase Development Team - Templates/Usability :: Looking for installation and/or custom design? :: Beautiful Wordpress themes

Tokyoj

Re: Inserting Java script into a new page via Admin.

Thanks. Yep...I edited the widget until I got tied of looking at the code.
My MySQL skills are low so not sure how to post directly into MySQL...how is that done?

---------------
Tokyoj
"You can't build a reputation on what you're going to do." (Henry Ford)
"Insanity is doing the same thing over and over, expecting different results." (Albert Einstein)

Canada

Re: Inserting Java script into a new page via Admin.

http://www.jobberbase.com/forum/post2570.html#p2570

http://www.jobberbase.com/forum/post1706.html#p1706

evertsemeijn

Re: Inserting Java script into a new page via Admin.

But still no solution. Seems the problem lies with TinyMCE (how strange wink).

Possible solution?
"Add the media plugin, this is the only way to keep object/embed tags since the browsers mess then DOM elements up not TinyMCE." according to Spocke (Main developer of TinyMCE)

http://tinymce.moxiecode.com/punbb/viewtopic.php?id=735

Gonna try to embed that now. Report later big_smile

Member of Jobberbase Development Team - Templates/Usability :: Looking for installation and/or custom design? :: Beautiful Wordpress themes

evertsemeijn

Re: Inserting Java script into a new page via Admin.

Media plugin already added :S

No solution... Anyone?

Member of Jobberbase Development Team - Templates/Usability :: Looking for installation and/or custom design? :: Beautiful Wordpress themes

Tokyoj

Re: Inserting Java script into a new page via Admin.

Solved. Tested in FF3.0.05 and IE7....In editor.js  add the extended element (whole line as is)

extended_valid_elements : "script[charset|defer|language|src|type]",

into the bottom area of the code. See below...
That gave me the ability to copy&paste from Dreamweaver into the HTML window.

            tinyMCE.init({
                mode : "textareas",
                theme : "advanced",
                plugins : "style,layer,table,save,advhr,advimage,advlink,media,searchreplace,contextmenu,paste,directionality,nonbreaking,xhtmlxtras,",
                theme_advanced_buttons1 : "bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect",
                theme_advanced_buttons2 : "forecolor,backcolor,cut,copy,paste,/*pastetext*/,/*pasteword*/,/*search*/,/*replace,*/,bullist,numlist,outdent,indent,/*blockquote*/,undo,redo,link,unlink,anchor,hr,removeformat,image,sub,sup,media,charmap,cleanup,/*help*/,code",
                theme_advanced_buttons3 :
"style,layer,table,save,advhr,advimage,advlink,media,searchreplace,contextmenu,paste,directionality,nonbreaking,xhtmlxtras,",
                theme_advanced_buttons4 :
"",
                extended_valid_elements : "script[charset|defer|language|src|type]",
                theme_advanced_toolbar_location : "top",
                theme_advanced_toolbar_align : "left",
                theme_advanced_statusbar_location : "bottom",
                editor_selector : "mceEditor"
            });

The solution came from evertsemeijn's link and a search of the TinyMCE forum to get this...
http://tinymce.moxiecode.com/punbb/view … hp?id=4686

---------------
Tokyoj
"You can't build a reputation on what you're going to do." (Henry Ford)
"Insanity is doing the same thing over and over, expecting different results." (Albert Einstein)

evertsemeijn

Re: Inserting Java script into a new page via Admin.

Great! Tested it in ie6 and works to. But there is still one problem that needs to be solved. When using the script tag as "&lt;script&gt;" it's being transformed to <script>. The next time you open a page to edit it the <script> is not being posted... Even when wrapping it in a code tag :S

Member of Jobberbase Development Team - Templates/Usability :: Looking for installation and/or custom design? :: Beautiful Wordpress themes

Tokyoj

Re: Inserting Java script into a new page via Admin.

I save each page as xyz.html so if I need to, I can edit the full page in the original html in Dreamweaver then paste it back into the HTML window.

For minor edits it's possible to do so inside the HTML window as long as the core structure of the page is not affected.

---------------
Tokyoj
"You can't build a reputation on what you're going to do." (Henry Ford)
"Insanity is doing the same thing over and over, expecting different results." (Albert Einstein)