Skip navigation
Sidebar -

Advanced search options →

Welcome

Welcome to CEMB forum.
Please login or register. Did you miss your activation email?

Donations

Help keep the Forum going!
Click on Kitty to donate:

Kitty is lost

Recent Posts


News From Syria
by zeca
Today at 05:06 PM

اضواء على الطريق ....... ...
Today at 03:51 PM

New Britain
Today at 03:41 PM

Ashes to beads: South Kor...
Yesterday at 09:44 PM

Lights on the way
by akay
November 30, 2024, 09:01 AM

Qur'anic studies today
by zeca
November 30, 2024, 08:53 AM

Gaza assault
by zeca
November 27, 2024, 07:13 PM

What music are you listen...
by zeca
November 24, 2024, 06:05 PM

Do humans have needed kno...
November 22, 2024, 06:45 AM

Marcion and the introduct...
by zeca
November 19, 2024, 11:36 PM

Dutch elections
by zeca
November 15, 2024, 10:11 PM

Random Islamic History Po...
by zeca
November 15, 2024, 08:46 PM

Theme Changer

 Topic: User scripts for this forum

 (Read 16193 times)
  • 1« Previous thread | Next thread »
  • User scripts for this forum
     OP - June 26, 2008, 12:46 AM

    NOTE: Some of these scripts might not work. I will upload updated versions in a bundle some time in the future. ~~edit~~

    Hi folks!

    I thought I'd put my programming skills a bit to use for the community here. So I crafted a little JavaScript program which finds all the embedded videos on the current page and then inserts the direct link above each of them. I hope some users here will give it a try. It certainly is useful to me, saves a bit time and hassle.
    Maybe you guys have suggestions about how you'd like to customize this forum with dynamic scripting. I'd like to hear some ideas and see if I can implement them.

    Install it for Opera:
    Go to "Tools>Preferences" (or hit Ctrl+F12). Choose the tab "Advanced". Choose "Content" in the list. Click "JavaScript Options". Choose a directory at the bottom where it says "User JavaScript files", for example "C:\UserJS"
    Copy the code below and save it as a normal text file with the file ending "js" in the directory you just set in the options, for example "C:\UserJS\coem.js". After this you'll perhaps have to restart your browser.

    Install it for Firefox:
    I haven't tried this in FF yet, but I think you first have to install the Greasemonkey extension before you can make use of my JS file. Somebody should try it and tell me if it worked, thanks.


    German ex-Muslim forumMy YouTubeList of Ex-Muslims
    Wikis: en de fr ar tr
    CEMB-Chat
    I'm on an indefinite break...
  • Re: User scripts for this forum
     Reply #1 - June 28, 2008, 10:36 PM

    Hi again,

    Seems like nobody got too excited about the script I made. I hope this is gonna change now with the next script I've written to enhance this forum. This neat, little helper simply keeps track of the threads you've recently visited and prints that list in a box on the sidebar. I reckon some people complained about how they were a bit lost because of all the subforums. That's why I thought this script would be very useful when you just want to revisit a thread that you know you have visited just a few hours or days ago.

    Installation in Opera:
    See the description in the original post.

    Installation in Firefox:
    First install the Greasemonkey extension.
    Save the script below as a text file on your Desktop with the file extension "user.js" (very important in Firefox), e.g. "coem.user.js".
    Drag the script file from your Desktop on your Firefox browser window. A dialog window should pop up asking whether you want to install it. Confirm and it should work without a restart.

    Name: "List COEM Threads", File name: "coem2.user.js":

    German ex-Muslim forumMy YouTubeList of Ex-Muslims
    Wikis: en de fr ar tr
    CEMB-Chat
    I'm on an indefinite break...
  • Re: User scripts for this forum
     Reply #2 - June 28, 2008, 10:50 PM

    I think you'll find that the people who get lost on the forum will get lost in the Firefox add-ons section.  Wink

    Thanks for trying though. I might test these out myself. It would be kinda handy if the AEVC mod did automatically drop the link in quote tags above the actual vid. I'll ask over at the original mod thread. If it's a simple edit and if the mod author doesn't mind I'll have a look at it.

    ETA: You've provided two different scripts there. Why is that?

    Devious, treacherous, murderous, neanderthal, sub-human of the West. bunny
  • Re: User scripts for this forum
     Reply #3 - June 28, 2008, 11:07 PM

    I think you'll find that the people who get lost on the forum will get lost in the Firefox add-ons section.  Wink

    Thanks for trying though. I might test these out myself. It would be kinda handy if the AEVC mod did automatically drop the link in quote tags above the actual vid. I'll ask over at the original mod thread. If it's a simple edit and if the mod author doesn't mind I'll have a look at it.

    ETA: You've provided two different scripts there. Why is that?


    I trust that those who have decided to use Firefox instead of the dreaded Internet Exploder will have enough knowledge to click a button on the add-ons section in order to install Greasemonkey. It's not complicated if you follow the steps I have described.

    What language is this AEVC mod written in? I presume it would be very easy to add the code for that little feature.

    I've posted two scripts, the first one is new and the second one is an updated version of the script I posted in the original posting. I had problems with the code tag because it somehow screws things up, so unfortunately I had to use normal quote tags... Is it perhaps possible for you to give me privileges for uploading attachments to my postings? I promise I wouldn't abuse it...

    German ex-Muslim forumMy YouTubeList of Ex-Muslims
    Wikis: en de fr ar tr
    CEMB-Chat
    I'm on an indefinite break...
  • Re: User scripts for this forum
     Reply #4 - June 28, 2008, 11:33 PM

    It's written in php and I'm sure it wouldn't be difficult to modify it slightly. It's just a matter of tracking down exactly where to enter the relevant code snippet. I've posted a question over at the support forum since asking the guy who made the mod has got to be the quickest way to find the right spot in the code.
    I'll wait and see what he says. Wink

    Tell ya what: to save making more membergroups I'll just grab the scripts and attach them as txt files.
    That way anyone can use them easily.


    Devious, treacherous, murderous, neanderthal, sub-human of the West. bunny
  • Re: User scripts for this forum
     Reply #5 - June 28, 2008, 11:41 PM

    How's that? I attached your updated script to your OP and deleted the original version.
    I also attached your second script to your next post.
    The files should be correct but let me know if they aren't.

    Devious, treacherous, murderous, neanderthal, sub-human of the West. bunny
  • Re: User scripts for this forum
     Reply #6 - June 29, 2008, 03:30 PM

    How's that? I attached your updated script to your OP and deleted the original version.
    I also attached your second script to your next post.
    The files should be correct but let me know if they aren't.


    Thank you ozzie, it's perfect.

    German ex-Muslim forumMy YouTubeList of Ex-Muslims
    Wikis: en de fr ar tr
    CEMB-Chat
    I'm on an indefinite break...
  • Re: User scripts for this forum
     Reply #7 - July 03, 2008, 01:36 PM

    Here is the script that adds support for Unicode characters including Arabic Script.

    Putting it in quotes, hope a mod or admin can make it into a file attachment like the ones above.
    File name "coem3.user.js":


    German ex-Muslim forumMy YouTubeList of Ex-Muslims
    Wikis: en de fr ar tr
    CEMB-Chat
    I'm on an indefinite break...
  • Re: User scripts for this forum
     Reply #8 - July 03, 2008, 02:15 PM

    Personally I'm not the slightest bit interested in this one because I can't read Arabic anyway and neither can most of our members. How is posting reams of it going to advance any discussions here?

    Devious, treacherous, murderous, neanderthal, sub-human of the West. bunny
  • Re: User scripts for this forum
     Reply #9 - July 03, 2008, 02:30 PM

    I'm sure in some way it's going to be useful. Anyway I don't see what's bad about it. It could be quite useful if two Arabic speakers here have to debate the finer points of an Arabic text, and they can still include English transliterations and explanations for the English audience...

    German ex-Muslim forumMy YouTubeList of Ex-Muslims
    Wikis: en de fr ar tr
    CEMB-Chat
    I'm on an indefinite break...
  • Re: User scripts for this forum
     Reply #10 - July 03, 2008, 02:40 PM

    In they're going to do that why bother posting the Arabic? All that does is lock most of the forum out IMO. Anyway I wont be using it. The default language here is English. Arabic is for forums where the default language is Arabic. Ditto for German or any other language. Up to you what you do with it.

    Devious, treacherous, murderous, neanderthal, sub-human of the West. bunny
  • Re: User scripts for this forum
     Reply #11 - July 03, 2008, 06:54 PM

    Ok, I deleted the script from your post and created an attachment for it instead which is now in your post.  Smiley

    I think it's a handy thing to have Aziz, thanks for thinking of ways to help, I appreciate it.  Afro

    Inhale the good shit, exhale the bullshit.
  • Re: User scripts for this forum
     Reply #12 - July 03, 2008, 08:31 PM

    Ok, I deleted the script from your post and created an attachment for it instead which is now in your post.  Smiley

    I think it's a handy thing to have Aziz, thanks for thinking of ways to help, I appreciate it.  Afro


    Thank you Berberella. I see you named it arabicscript.txt, could you please rename it to coem3.user.js?

    When the script is installed it comes into action in the background when you press the post button. Simply write your text with any Unicode characters you like and it will show up correctly when you send your posting. It's not only Arabic you can write now, but the whole Unicode reportoire is available to you now.

    By the way, is it perhaps possible to set up a special page for all the scripts I've written. I wish that the work I've done doesn't get forgotten when this thread has become inactive after some time.

    Regards,
    Aziz

    German ex-Muslim forumMy YouTubeList of Ex-Muslims
    Wikis: en de fr ar tr
    CEMB-Chat
    I'm on an indefinite break...
  • Re: User scripts for this forum
     Reply #13 - July 04, 2008, 08:49 AM

    Stickied.

    ETA: I think if people are going to use this we will have to have a rule that any Arabic must be accompanied by a full English translation or else.


    Devious, treacherous, murderous, neanderthal, sub-human of the West. bunny
  • Re: User scripts for this forum
     Reply #14 - July 04, 2008, 05:23 PM

    Stickied.

    ETA: I think if people are going to use this we will have to have a rule that any Arabic must be accompanied by a full English translation or else.


    Thanks for making it sticky.

    Could you please update the previous file attachment of coem3.user.js with this:

    Quote
    // ==UserScript==
    // @name           COEM Unicode Support
    // @description    Adds support for Unicode characters including Arabic script.
    // @namespace      http://www.councilofexmuslims.com/
    // @include        http://www.councilofexmuslims.com/index.php*
    // @version        1.1

    // ==/UserScript==

    // History:
    // 1.1: Fixed script for Firefox.
    // 1.0: First release.

    function COEM_modifyText()
    {
      var fields = ["subject", "message"];
      var form = document.getElementById("postmodify");
      for (i in fields)
      {
        var textarea = form.elements.namedItem(fields);
        textarea.value = COEM_Text2Entities(textarea.value);
      }
      submitonce(this); // Called in the original onsubmit function.
    }

    function COEM_addUnicodeSupport()
    {
      // Look at the URL to see if a posting is being written.
      if (document.URL.indexOf("action=post") == -1)
        return; // Return if not.

      var form = document.getElementById("postmodify"); // Get a short handle to the form.

      // In FF this is the only way it works.
      // First clear the attribute then set an event handler.
      form.setAttribute("onsubmit", ""); // Clear the old handler.
      form.addEventListener("submit", COEM_modifyText, false);
    }

    /// Converts Unicode codepoints to numerical entities.
    function COEM_Text2Entities(text)
    {
      var result = "";
      for (var i = 0; i < text.length; i++)
      {
        var charCode = text.charCodeAt(i);
        if (charCode > 127)
          result += "&#" + charCode + ";";
        else
          result += String.fromCharCode(charCode);
      }
      return result;
    }

    /// Not needed at the moment.
    // function COEM_Entities2Text(text)
    // {
    //   function replaceFunction(fullMatch, subMatch1, offset, str) {
    //     return String.fromCharCode(new Number(subMatch1));
    //   }
    //   return text.replace(/&#(\d+);/g, replaceFunction);
    // }

    if (window.opera)
      document.addEventListener("load", COEM_addUnicodeSupport, false); // Opera.
    else
      COEM_addUnicodeSupport(); // Firefox.



    German ex-Muslim forumMy YouTubeList of Ex-Muslims
    Wikis: en de fr ar tr
    CEMB-Chat
    I'm on an indefinite break...
  • Re: User scripts for this forum
     Reply #15 - July 04, 2008, 10:23 PM

    Done.

    Devious, treacherous, murderous, neanderthal, sub-human of the West. bunny
  • Re: User scripts for this forum
     Reply #16 - July 05, 2008, 11:39 AM

    Done.

    Thank you, but "coem3.user.txt" isn't quite right. Could you change it to "coem3.user.js" pls?

    German ex-Muslim forumMy YouTubeList of Ex-Muslims
    Wikis: en de fr ar tr
    CEMB-Chat
    I'm on an indefinite break...
  • Re: User scripts for this forum
     Reply #17 - July 05, 2008, 09:46 PM

    Sorted.

    Devious, treacherous, murderous, neanderthal, sub-human of the West. bunny
  • Re: User scripts for this forum
     Reply #18 - July 06, 2008, 01:13 AM

    test

    Huh??

    "I'm Agnostic about God."

    Richard Dawkins
    ==
    "If there is a God, it has to be a man; no woman could or would ever fuck things up like this."
     George Carlin == "...The so-called moderates are actually the public relations arm of Al-Qaeda and the Islamic Republic of Iran."  Maryam Namazie
  • Re: User scripts for this forum
     Reply #19 - July 06, 2008, 01:34 AM

    I've loaded and dragged:

    coem1.user.js

    coem2user.js

    (loaded to desktop, dragged into firefox browser.)


    Still can't display Arabic, any missing thing?

    "I'm Agnostic about God."

    Richard Dawkins
    ==
    "If there is a God, it has to be a man; no woman could or would ever fuck things up like this."
     George Carlin == "...The so-called moderates are actually the public relations arm of Al-Qaeda and the Islamic Republic of Iran."  Maryam Namazie
  • Re: User scripts for this forum
     Reply #20 - July 06, 2008, 01:37 AM

    Huh???

    "I'm Agnostic about God."

    Richard Dawkins
    ==
    "If there is a God, it has to be a man; no woman could or would ever fuck things up like this."
     George Carlin == "...The so-called moderates are actually the public relations arm of Al-Qaeda and the Islamic Republic of Iran."  Maryam Namazie
  • Re: User scripts for this forum
     Reply #21 - July 06, 2008, 06:35 AM

     Cheesy grin12

    Umm, Emerald, the first file is for getting the raw links for embedded videos.

    The second file is for book marking threads you have recently visited.

    The third file is the one that enables you to use Arabic.

    I did mention this in Announcements. Wink

    Please note that you need to have GreaseMonkey installed on Firefox.
    Please also note that the staff did not write these scripts.
    Any support questions should be addressed to Aziz.

    Devious, treacherous, murderous, neanderthal, sub-human of the West. bunny
  • Re: User scripts for this forum
     Reply #22 - July 06, 2008, 06:55 AM

    Cheesy grin12

    Umm, Emerald, the first file is for getting the raw links for embedded videos.

    The second file is for book marking threads you have recently visited.

    The third file is the one that enables you to use Arabic.

    I did mention this in Announcements. Wink

    Please note that you need to have GreaseMonkey installed on Firefox.
    Please also note that the staff did not write these scripts.
    Any support questions should be addressed to Aziz.

    ===============

    Thx mAn  grin12

    hehhe

    Well, I installed the FF Add-on;

    Guess i need to do the 3rd file now   dance

    "I'm Agnostic about God."

    Richard Dawkins
    ==
    "If there is a God, it has to be a man; no woman could or would ever fuck things up like this."
     George Carlin == "...The so-called moderates are actually the public relations arm of Al-Qaeda and the Islamic Republic of Iran."  Maryam Namazie
  • Re: User scripts for this forum
     Reply #23 - July 06, 2008, 07:09 AM

    Another test, after....loading the 3rd file;

    Huh??

    my name..!

    "I'm Agnostic about God."

    Richard Dawkins
    ==
    "If there is a God, it has to be a man; no woman could or would ever fuck things up like this."
     George Carlin == "...The so-called moderates are actually the public relations arm of Al-Qaeda and the Islamic Republic of Iran."  Maryam Namazie
  • Re: User scripts for this forum
     Reply #24 - July 24, 2008, 06:38 PM

    Hello Os,

    I don't know if it's usefu, but this forum (with Arabic script) uses the same forum software as this one.

    Once he was in power, they needed him there, to make sense of their lives.

    (a book critic about stalin)
  • Re: User scripts for this forum
     Reply #25 - July 24, 2008, 10:48 PM

    Yes I know. It means converting everything over to UTF-8, which is a bit of a pain. I'm trying to keep things easy for the staff.

    Devious, treacherous, murderous, neanderthal, sub-human of the West. bunny
  • Re: User scripts for this forum
     Reply #26 - July 25, 2008, 04:00 PM

    Hey Ozzie,

    Is there a way I can upload a pps file ?

    I was not blessed with the ability to have blind faith. I cant beleive something just because someone says its true.
  • Re: User scripts for this forum
     Reply #27 - July 25, 2008, 11:01 PM

    You'd have to zip it first (since there's only a limited number of supported formats) but that's not really a drama as anyone can use their desktop wizard to extract it.

    Devious, treacherous, murderous, neanderthal, sub-human of the West. bunny
  • 1« Previous thread | Next thread »