The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
3 posters

    Suggested Script (Need Someone that can read script)

    Yima Qwin
    Yima Qwin
    Forumember


    Posts : 28
    Reputation : 1
    Language : english
    Location : http://kingdomhearts.forumotion.net/

    Solved Suggested Script (Need Someone that can read script)

    Post by Yima Qwin September 7th 2014, 6:06 am

    I have had a member of the forum I operate suggest a coding addition to the website but I myself do not understand coding on any level I trust and I would like it very much if I could get some second opinions on the coding.  Th bit following the coding were the instructions and comments that came with the coding in the pm.

    Code:
    window.localStorage&&$(function(){
    $(function(){
    if($("#text_editor_textarea").length&&typeof $.sceditor!="undefined"){
    var a=$(document.post.mode).val(),
    d=$("#text_editor_textarea").sceditor("instance"),
    e,f,g=function(){
    localStorage.setItem(a,d.val());
    f=0},
    b=JSON.parse(localStorage.getItem("br-data"))||[],c;
    switch(a){
    case"editpost":return;
    case"reply":a+=$(document.post.t).val();
    break;
    case"newtopic":a+=$(document.post.f).val()
    }
    a=parseInt((my_getcookie("fa_"+location.hostname.replace(/\./g,"_")+"_data")||"0").replace(/.*s:6:"userid";(i:([0-9]+)|s:[0-9]+:"([0-9]+)");.*/,"$2$3"))+a;
    -1!=(c=$.inArray(a,b))&&b.splice(c,1);
    if(20<b.length){
    for(c=b.length-1;0<=c;c--)/^\s*$/.test(localStorage.getItem(b[c])||"")&&(localStorage.removeItem(b[c]),
    b.splice(c,1));
    20<b.length&&(localStorage.removeItem(b[0]),
    b.splice(0,1))}b.push(a);
    localStorage.setItem("br-data",JSON.stringify(b));
    $(document.post).submit(function(){
    localStorage.setItem("br-target",a)
    });
    !d.val()&&((e=localStorage.getItem(a))&&d.val(e));
    d.keyUp(function(){
    f||(f=setTimeout(g,3E3))
    })}})});
    window.localStorage&&(localStorage.getItem("br-target")&&function(){
    $("meta[http-equiv='refresh'][content]:first").length&&function(){
    var a=JSON.parse(localStorage.getItem("br-data")),
    b=localStorage.getItem("br-target"),c;
    if(-1!=(c=$.inArray(b,a)))a.splice(c,1),
    localStorage.setItem("br-data",JSON.stringify(a));
    localStorage.removeItem(b)}();
    localStorage.removeItem("br-target")}());


    Additional Comments and Instructions Following Code in Originating pm wrote:Enter the admin panel, head to the "Modules" tab.
    Scroll to the bottom, should be a section titled "HTML & JAVASCRIPT"
    Click the link that says Javascript Codes Management
    Create a New Javascript
    Name it something conspicuous like "KH AUTOSAVE POST THINGY" or what have you
    Paste the code into the area below

    Save, and you should be golden. To know it it worked, the topic will create a URL. It'll be right after the name. If you click the tiny screen after it, it'll take you to page like this one:
    http://genesisproject.forumotion.com/10294.js

    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: Suggested Script (Need Someone that can read script)

    Post by SLGray September 7th 2014, 6:46 am

    So what is the problem?



    Suggested Script (Need Someone that can read script) Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    Yima Qwin
    Yima Qwin
    Forumember


    Posts : 28
    Reputation : 1
    Language : english
    Location : http://kingdomhearts.forumotion.net/

    Solved Re: Suggested Script (Need Someone that can read script)

    Post by Yima Qwin September 7th 2014, 6:51 am

    I woudl like someone who can read the coding to tell me what it does and if it is a safe addition to the web page if possible; I apologize for not making that more clear.
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: Suggested Script (Need Someone that can read script)

    Post by SLGray September 7th 2014, 7:03 am




    Suggested Script (Need Someone that can read script) Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    Yima Qwin
    Yima Qwin
    Forumember


    Posts : 28
    Reputation : 1
    Language : english
    Location : http://kingdomhearts.forumotion.net/

    Solved Re: Suggested Script (Need Someone that can read script)

    Post by Yima Qwin September 7th 2014, 7:12 am

    Thank you for your assistance.
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Suggested Script (Need Someone that can read script)

    Post by Ange Tuteur September 8th 2014, 1:01 am

    Topic archived

    If you have anymore questions, do not hesitate to open another topic. Smile

      Current date/time is September 22nd 2024, 6:34 pm