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]
<script type="text/javascript">
document.write("hello world!");
</script>
[/inline]

ChangeLog

0.6 [download]

  • work with excerpt box
  • fix minor bug

0.5 [download]

  • fix && operator

80 条评论 »

  1. mark 于 2006-09-14 @ 16:31:24 留言

    激活后怎样使用。

  2. volcano 于 2006-09-14 @ 20:56:51 留言

    用[inline]和[/inline]包含你要用的javascript,提交就可以了

  3. Alexander Lazarev 于 2007-01-23 @ 22:59:02 留言

    hello, nice plugin, did it works with new wordpress 2.1 series? Possible updates?

  4. volcano 于 2007-01-25 @ 21:20:17 留言

    I will update the plugin when I have time.

  5. 前~博客 于 2007-04-07 @ 15:42:37 留言

    好棒的插件!
    如果能跟上2.1就更好了:0

  6. issen1 于 2007-04-22 @ 20:31:52 留言

    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?

  7. volcano 于 2007-04-23 @ 09:49:11 留言

    Sorry…I will update the plugin this week and fix some bug.

  8. vanBetty 于 2007-04-25 @ 00:02:18 留言

    I would like to use the plugin on wordpress mu. But I can’t get it to work! can you help me out?

  9. icyfeng 于 2007-04-26 @ 03:57:26 留言

    update it!

  10. treadmill 于 2007-05-03 @ 22:50:42 留言

    我喜欢这种blog,在哪下

  11. gestroud 于 2007-05-12 @ 00:51:24 留言

    download not working. :(

  12. Luca 于 2007-05-12 @ 05:48:18 留言

    DOWNLOAD NOT WORKING!!!

  13. volcano 于 2007-05-12 @ 07:13:15 留言

    download fixed :p

  14. JAVASCRIPT NEI TUOI ARTICOLI at 于 2007-05-13 @ 06:53:28 留言

    […] Plugin Home | Download […]

  15. wordpress是什么 » Blog Archive » wordpress插件 - 更新于05/11 于 2007-05-17 @ 08:05:57 留言

    […] Inline Javascript Pluginenable you plug javascript in blog directly.使你可以在博客内直接插入javascript. […]

  16. Naveen 于 2007-07-18 @ 14:53:07 留言

    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 “

  17. volcano 于 2007-07-18 @ 21:41:40 留言

    Hi Naveen:
    I hope you can finish your question so that I answer it.

  18. Naveen 于 2007-07-19 @ 13:33:04 留言

    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(‘

  19. Naveen 于 2007-07-19 @ 13:36:35 留言

    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.

  20. Naveen 于 2007-07-19 @ 13:42:18 留言

    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

  21. volcano 于 2007-07-19 @ 13:46:45 留言

    Did you mean “<“?

    I will look into this problem.

  22. Martino 于 2007-08-28 @ 23:04:01 留言

    Cool plugin!
    I’ve been searching for this.
    Thanks a lot!
    MARTINO :)

  23. GoogleGoogle 于 2007-10-12 @ 01:31:31 留言

    Great plugin thanks

  24. 心想事成的秘密 于 2007-10-13 @ 12:42:14 留言

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

  25. volcano 于 2007-10-15 @ 11:44:33 留言

    之前的版本是不可以的,至于2.3,我还没来得及试验:)

  26. ..::DeUCeD::.. 于 2007-11-16 @ 14:43:22 留言

    great plugin my friend!
    thx a lot!

  27. turnip 于 2007-11-20 @ 02:22:28 留言

    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?

  28. Random Woman 于 2008-01-25 @ 16:38:42 留言

    This is a GREAT plugin thank you so much for developing and updating it!

  29. goldendragon 于 2008-02-14 @ 10:20:31 留言

    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?

  30. blog tools 于 2008-02-18 @ 06:48:49 留言

    hello. this plugin completely mess up my design.

    Font size change, line breaks dissapear, and more stuff like that.
    I tried bidvertiser referral banner.

  31. JimmY2K. 于 2008-03-10 @ 06:53:13 留言

    Hi, inline-js makes exec-php stop working.
    http://bluesome.net/post/2005/08/18/50/

    The author says “The issue lies in the way Inline-JS applies wpautop() to the content”.

    Check it out. Bye

  32. volcano 于 2008-03-11 @ 00:13:14 留言

    Hi JimmY2K. I had update inline-js plugin and it now work fine with exec-php. just try it:)

    http://customcode.googlecode.com/files/inline-js.latest.zip

  33. inline-js 0.4发布 - wordpress是什么 于 2008-03-16 @ 09:20:48 留言

    […] plugin inline-js 0.4发布。这个插件可以在文章中直接插入javascript。 Inline-js plugin minor update. It […]

  34. zhang 于 2008-04-10 @ 14:45:28 留言

    I don’t know ,what’s ‘inline ‘ mean in c++?

  35. 阿草哥 于 2008-04-18 @ 10:27:40 留言

    这个插件是可以在写文章的时候在文章编辑器中就可以写js脚本吗
    如果这样 那非常好啊

  36. volcano 于 2008-04-18 @ 14:43:28 留言

  37. Matti 于 2008-04-22 @ 04:01:26 留言

    great plugin !!!!!!!!!!!!!!!!!

  38. Les_Singes 于 2008-06-04 @ 23:40:55 留言

    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 :)

  39. volcano 于 2008-06-05 @ 00:44:54 留言

    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!

  40. Jeff 于 2008-07-10 @ 15:21:12 留言

    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?

  41. Jeff 于 2008-07-11 @ 02:45:09 留言

    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.

  42. volcano 于 2008-07-14 @ 20:35:16 留言

    If you assign the ‘unfiltered_html’ capability to the user, the script will not inserting return.

  43. Philix 于 2008-07-23 @ 22:37:48 留言

    Thanks, this is exactly what i was looking for.

  44. Khan 于 2008-09-07 @ 11:16:01 留言

    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

  45. GreenLiveForever - Irene 于 2008-09-09 @ 20:44:34 留言

    Thanks for very great info.
    I’ve done what you said. Newbie :)
    Is javascript include Adsense code?

    Please assist me if i do wrong.
    Less known about js and php.

    Thank you very much,

    Irene

  46. Volcano 于 2008-09-23 @ 20:13:05 留言

    @ Khan
    I get it work with 2.6.2. You should assign the ‘unfiltered_html’ capability to the user.

  47. Robin Majumdar 于 2008-10-07 @ 06:43:38 留言

    So this is confirmed to work 2.6.2 ? If so, excellent, I’ll give it a try on some test blogs :)

    Thank you!

  48. Lesley 于 2008-11-07 @ 21:52:40 留言

    Will this be updated to work with 2.6.3 soon?

  49. Xevo 于 2008-11-08 @ 05:10:35 留言

    @ Lesley: The 2.6.3 only has a template update, so this plugin should just work, seeing that it worked in 2.6.2..

  50. Tshering 于 2008-12-04 @ 13:52:38 留言

    perfect. all i need was this. i have implemented it and its working like a charm. thanks again

  51. Time Synchronisation 于 2008-12-10 @ 19:21:03 留言

    This plugin is ace

  52. JC 于 2009-02-03 @ 00:10:34 留言

    Anyone test this with 2.7? If so, please respond.

  53. Volcano 于 2009-02-03 @ 10:08:20 留言

    It work great with 2.7

  54. marke 于 2009-03-02 @ 05:53:58 留言

    how do you assign the ‘unfiltered_html’ capability to the user?

  55. Alexwebmaster 于 2009-03-03 @ 18:39:18 留言

    Hello webmaster
    I would like to share with you a link to your site
    write me here preonrelt@mail.ru

  56. Volcano 于 2009-03-03 @ 20:42:21 留言

    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.

  57. Nobuko 于 2009-07-01 @ 04:10:28 留言

    Hi. Is’s seem work on index page but it’s not working on archive page. I’m using WordPress 2.8.1.

  58. Claude @ Clickbank Profit System 于 2009-09-01 @ 05:15:13 留言

    Thank you for the pluging information.Its such a pain when links are open as we lose commisions. Now I can protect them better.

  59. Buntköchin 于 2009-10-09 @ 18:47:05 留言

    Thank you so much. Your plugin was a great help for me and it is really simple to let it work.

  60. Alex 于 2009-10-14 @ 04:37:10 留言

    How about insert Javascript code like this

    if (typeof a1==”string” && typeof a2==”string” )
    {

    }

    && was posted as && and script does n’t work!!!

  61. Monte 于 2009-12-08 @ 09:02:07 留言

    Hi. Great plugin.

    It appears that if the AND operator is used, it doesn’t work correctly:

    if (document.getElementById(“myImage”)) // THIS WORKS
    if (document.all && document.getElementById(“myImage”)) // THIS DOESN’T WORK

    The code (your code or WordPress) replaces one of the ampersands with its entity code &

    monte

    {x:

  62. Volcano 于 2009-12-10 @ 07:26:10 留言

    Hi Mnote & Alex

    I just updated the plugin, tested with 2.8.6.

    Please try it.

  63. Mark 于 2009-12-21 @ 14:55:12 留言

    Nice plugin thanks! Keep up the good work.

  64. Jan 于 2010-01-02 @ 17:01:08 留言

    Hi there, your plugin unfortunately messes up published source code in a post if the WordPress site uses a syntax highlighter plugin like Syntax Highlighter or Highlighter Evolved. Obviously, your plugin modifies content that is outside the inline tag which I think is a very bad idea.

  65. pantelis 于 2010-01-09 @ 22:42:28 留言

    Great plugin.Works with version 2.9.0

  66. Stephen 于 2010-03-16 @ 02:16:23 留言

    Wow, I can’t believe your plugin work wonderfully well with 2.9.
    Great work!

  67. Tom 于 2010-03-17 @ 09:57:27 留言

    Been looking for something like this all day. Got it working on one of my blog. Thanks for the plugin work perfectly.

  68. Roger 于 2010-03-20 @ 07:53:49 留言

    This plugin is amazing – small problem cannot get rid of seeing [inline] and [/inline] on my page and also not sure if related but seems to crach ie6? with kb927917 issue?

  69. fernand 于 2010-03-23 @ 04:03:44 留言

    hey great plugin, just installed and it works in the preview section of the post, but shows up as code in the published version. thoughts?

  70. sebbi83 于 2010-07-07 @ 17:09:07 留言

    Very nice plugin… It works perfect for me…

  71. Jason King 于 2010-08-12 @ 09:57:04 留言

    I followed the instructions above but used role scooper instead, then wrapped my js in the short code. No results though on WP 3.0

  72. zanes 于 2010-09-30 @ 04:45:00 留言

    I see the words [inline] and [/inline] appearing as test before and after the JS.
    WP 3.0.1
    How to fix this?

  73. Neil 于 2010-10-10 @ 22:31:05 留言

    Hi I cant get it to work, I have folowed all the steps, and inseted the tags, doesnt work for me. I am trying to play a pop over video across the fronmt of the pager, it’s javascript, th epage is :

    this ithe js:

    video(‘id1′,www.biztekwebvideo.com/wp-content/uploads/popover/deviant.mp4′,320,240);
    form(‘id2′,’http://www.biztekwebvideo.com/wp-content/uploads/popover/form.htm’,300,320);
    addFloating(‘id1′,100,-240);
    addFloating(‘id2′,550,-345);
    runFloating();

    </scr
    should the inline tags be stripped out when you vies the source?

    regsrds
    NM

  74. Neil 于 2010-10-10 @ 22:32:14 留言

    sorry the js didn’t format properly:

    &&&&&&&&&&&&&&&&&&&&&&&&&&&&

    video(‘id1′,www.biztekwebvideo.com/wp-content/uploads/popover/deviant.mp4′,320,240);
    form(‘id2′,’http://www.biztekwebvideo.com/wp-content/uploads/popover/form.htm’,300,320);
    addFloating(‘id1′,100,-240);
    addFloating(‘id2′,550,-345);
    runFloating();

    $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

  75. peter 于 2010-12-14 @ 11:43:27 留言

    it seems to work fine in wordpres mu 3.03, leaving the sywwig on but not using it obviously , as it corrupts code as always.
    even without role manager.

    the only issue is that is seems to remove the new line to BR, so all th eformatign goes.

    I can’t see where in the pre replace it would do this.

    if it was possible to put that back in, that would be enourmous.

  76. Tuttoirlanda 于 2011-05-18 @ 00:02:44 留言

    Just to inform you that the plug in work fine with my website.

    It is excellent because it solved almost all my issues.

    Great plugin. Magic!!!!

    Thanks indeed
    Donald

  77. รองเท้าเพื่อสุขภาพ 于 2011-06-21 @ 11:24:35 留言

    the only issue is that is seems to remove the new line to BR, so all th eformatign goes.

  78. Cepj 于 2011-08-30 @ 16:21:16 留言

    The plugin does not work with wp 3.2.1. It did work before wp update.

  79. simK 于 2011-11-02 @ 01:45:33 留言

    Need updtate for WP 3.2.1, the plugin doesn’t work!!!

  80. Suresh 于 2012-05-08 @ 12:27:50 留言

    Nice Plugin. Thanks

RSS 为此帖反馈评论

留条评论