inline-js —— wordpress plugin

inline-js —— wordpress plugin

Table of content

Description

本插件可在文章或页面中插入javascript的内容。

Plugin Name: Inline Javascript Plugin
Plugin URI: http://www.ooso.net/inline-js
Feed URI: http://feed.ooso.net
Description: Plugin that insert inline javascript in Posts/Pages
Version: 0.6
Author: Volcano
Author URI: http://www.ooso.net

Usage

English version:

  • Unzip
  • Copy inline-js.php to direcotry wp-contents/plugin and activate the plugin.
  • Setup
    • Disable tag balancing ‘WordPress should correct invalidly nested XHTML automatically’ through the ‘Options / Write’ menu in WordPress
    • Disable the WYSIWYG rich editor in the user’s settings through the ‘Users / Your Profile’ menu
    • Assign the ‘unfiltered_html’ capability to the user. Assigning capabilities to roles or users is out of the scope of this plugin. Because WordPress has no built-in configuration menu in the admin menu to assign roles/capabilities, you need to install the role/capability manager plugins role-manager.
  • Use [inline] and [/inline] tag around the javascript,and post it
  • Ok

中文版本:

  • 解压
  • 复制inline-js.php到wp-contents/plugin目录并激活插件.
  • 设置
    • 在设置 / 撰写中关闭这个选项”WordPress 应当自动修正无效的 XHTML 嵌套”(‘WordPress should correct invalidly nested XHTML automatically)
    • 在用户 / 您的个人资料中关闭Use the visual editor when writing
    • 给你的帐号添加 ‘unfiltered_html’ 权限. 可以通过安装role-manager插件来搞定。
  • 在写博客的时候使用[inline],[/inline]包住javascript,并发表

Example


[inline]

[/inline]

ChangeLog

0.6 [download]

  • work with excerpt box
  • fix minor bug

0.5 [download]

  • fix && operator

Join the Conversation

80 Comments

  1. Well, is there an update yet? Mmh, if i use the code, no other plugins will work such as Smileys aren’t displayed, spoilers don’t work. Any fix there yet?

  2. Hi,

    Thanks a lot for this wonderful work. I was looking for this kind of plugin for more than 2 weeks.
    I am using wordpress-mu1.2.1 and it worked like charm… 🙂

    Few things to ask.
    —————————-
    We have a line of code that says “document.write(‘ tag and other part of code nice. Once it reaches “

  3. Hi,

    Thanks a lot for this wonderful work. I was looking for this kind of plugin for more than 2 weeks.
    I am using wordpress-mu1.2.1 and it worked like charm… 🙂

    One thing to ask.
    —————————-
    We are porting hml source into post. In html source we have (javascript adscript) a line of code that says “document.write(‘

  4. i cannot post the content completely, text gets stripped off by wordpress formatting i guess.
    Probably, it removes the text after the “less than symbol”. Please look into it.

  5. Hi,

    Sorry to bother with lot of posts. Below is what i want clarify..

    Thanks a lot for this wonderful work. I was looking for this kind of plugin for more than 2 weeks.
    I am using wordpress-mu1.2.1 and it worked like charm… 🙂

    One thing to ask.
    —————————-
    We are porting hml source into post. In html source we have (javascript adscript) a line of code that says “document.write(‘less than symbol SCR’);”. Once i submit the post, the lines of code after “less than symbol ” tag gets removed. We cannot alter the javascript because its an adscript. I am using the [inline] tags before and after the javascript tag.

    Since the text gets removed from this comment area by wordpress, i have used “less than symbol” instead of it corresponding tag.

    Thanks,
    Naveen

  6. 请教一下,我在用wp2.3,js不是可以直接调用的吗?我好像没有安装任何插件,也可以在我的文章里插入js而没有问题啊……难道是我的错觉?
    (建议安装 Subscribe to Comments 插件哦,人们才能够在第一时间知道你已经回复了!)

  7. Plugin works great except for one small promlem. Using JS in a post, I see the words “[inline] and [/inline] appearing as test before and after the javascript. Any ideas how to fix this behavior?

  8. I added two Javascripts to my Jan. 17th post “What are the Best Ad Networks to Monetize Your Websites or Blogs”.

    The first script is suppose to put a referral link at the end of second paragraph. But it shown at the beginning of the post. The second script is suppose to put another link at the end of third paragraph. But it does not exist.

    Volcano, do you know what is the problem?

  9. Nice plugin! I really thank you *smack*
    I juste have a problem. I’m French 🙂 and I use the accent é è ê à . The plugin dont accept them. What can I do?
    Thank you 🙂

  10. I think you should setup wordpress like this:

    • Disable tag balancing ‘WordPress should correct invalidly nested XHTML automatically’ through the ‘Options / Write’ menu in WordPress
    • Disable the WYSIWYG rich editor in the user’s settings through the ‘Users / Your Profile’ menu
    • Assign the ‘unfiltered_html’ capability to the user. Assigning capabilities to roles or users is out of the scope of this plugin. Because WordPress has no built-in configuration menu in the admin menu to assign roles/capabilities, you need to install the role/capability manager plugins role-manager.

    Good luck!

  11. It looks like the script is inserting breaks with every return within the inline brackets, which is resulting in w3c compliancy errors. Is there a way to prevent the breaks?

  12. I found a solution. This line should be added in the function inline_render section (put the brackets around the ‘br /’:

    $str = str_replace(‘br /’, ”, $str);

    then it’s w3c compliant.

  13. Hi,

    I’ve done all the steps you mentioned but still I can’t get it working with wordpress 2.6.1. Can YOu please tell me whether or not this works with 2.6.1?

    Regards

Leave a comment

Your email address will not be published.