Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  nodelist  faq  login

Most people have two reasons for doing anything -- a good reason, and the real reason.


rocksolid / Offtopic / Re: view-source:http://overchan.oniichan.i2p/static/overchan.js

SubjectAuthor
* view-source:http://overchan.oniichan.i2p/static/overchan.jsanon
`* Re: view-source:http://overchan.oniichan.i2p/static/overchan.jsAnonUser
 `- Re: view-source:http://overchan.oniichan.i2p/static/overchan.jsanon

1
Subject: view-source:http://overchan.oniichan.i2p/static/overchan.js
From: anon
Newsgroups: rocksolid.shared.offtopic
Organization: def4
Date: Wed, 11 Jul 2018 22:46 UTC
Path: rocksolid2!def3!.POSTED.localhost!not-for-mail
From: ano...@anon.com (anon)
Newsgroups: rocksolid.shared.offtopic
Message-ID: <bcd16ee6c7b6e16952c66ed71a2a2b41@def4.com>
Subject: view-source:http://overchan.oniichan.i2p/static/overchan.js
Date: Wed, 11 Jul 2018 22:46:22+0000
Organization: def4
Lines:
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
View all headers

var _onreadyfuncs = [];

var onready = function(f) {
  _onreadyfuncs.push(function() {f();});
};

var ready = function() {
  for(var idx = 0; idx < _onreadyfuncs.length; idx++) _onreadyfuncs[idx]();
};


var quickreply = function(shorthash, longhash, url) {
  if (!window.location.pathname.startsWith("/t/"))
  {
    window.location.href = url;
    return;
  }
  var elem = document.getElementById("comment");
  if(!elem) return;
  elem.value += ">>" + shorthash + "
";
};

var get_storage = function() {
  var st = null;
  if (window.localStorage) {
    st = window.localStorage;
  } else if (localStorage) {
    st = localStorage;
  }
  return st;
};

var setSrcQuery = function(e, q) {
var src  = e.src;
var p = src.indexOf('?');
if (p >= 0) {
src = src.substr(0, p);
}
e.src = src + "?" + q
};


var reloadImg = function(el) {
setSrcQuery(el, "reload=" + (new Date()).getTime());
return false;
};

var reloadThreadJSON = function(ourPost) {
  var url = window.location.pathname + "/json";
  var ajax = new XMLHttpRequest();
  ajax.onreadystatechange = function() {
    if(ajax.readyState == 4) {
      if(ajax.status == 404) {
        console.log("thread gone");
      } else if (ajax.status == 200) {
        var rootelem = document.getElementById("thread_"+window.location.pathname.split("/")[2]);
        var posts = JSON.parse(ajax.responseText);
        for(var idx = 0; idx < posts.length; idx ++ )
        {
          var id = posts[idx].HashLong;
          var e = document.getElementById(id);
          if(!e) {
            e = document.createElement("div");
            e.innerHTML = posts[idx].PostMarkup;
            rootelem.appendChild(e.childNodes[0]);
            e.remove();
            if(ourPost && posts[idx].Message_id == ourPost) {
              // focus on our post
              window.location.hash = id;
            }
          }
        }
      }
    }
  };
  ajax.open("GET", url);
  ajax.send();
}

// form resubmit
onready(function() {
  var submitPost = function(form, elem, cb) {
    var ajax = new XMLHttpRequest();
    ajax.onreadystatechange = function() {
      if (ajax.readyState == 4) {
        var err = "unknown error";
        var j = null;
        try {
          j = JSON.parse(ajax.responseText);
          err = j.error || err;
        } catch (ex) {
          err = "error parsing reply: "+ ex;
        }
        if(ajax.status == 201) {
          // success
          form.reset();
          cb(null, j);
        } else if (ajax.status == 200) {
          cb(err, j);
        } else {
          cb("http "+ajax.status, j);
        }
      } else {
        elem.value += ".";
      }
    };
    var data = new FormData();
    data.append("message", document.getElementById("comment").value);
    var inputs = form.getElementsByTagName("input");
    for(var idx = 0; idx < inputs.length; idx++)
    {
      var input = inputs[idx];
      console.log(input);
      if(input.files)
      {
        for (var i =0 ; i < input.files.length; i++)
        {
          var file = input.files[i];
          data.append(input.name, file, file.name);
        }
      }
      else if(input.name)
        data.append(input.name, input.value);
    }
    console.log("posting...");
    ajax.open("POST", form.action+"/json");
    ajax.send(data);
  };
  var elems = document.getElementsByClassName("postbutton");
  if(elems && elems.length > 0 && elems[0]) {
    var e = elems[0];
    var parent = e.parentElement;
    var origText = e.value;
    e.remove();
    e = document.createElement("input");
    e.type = "button";
    parent.appendChild(e);
    e.value = origText;
    e.onclick = function(ev) {
      console.log("clicked post");
      e.disabled = true;
      e.value = "posting ";
      submitPost(document.forms[0], e, function(err, j) {
        if(err) {
          var captcha = document.getElementById("captcha_solution");
          if(captcha) {
            captcha.value = "";
          }
        }
        var msg = err || "posted";
        console.log(msg, j.url);



Posted on def4.i2p


Subject: Re: view-source:http://overchan.oniichan.i2p/static/overchan.js
From: AnonUser
Newsgroups: rocksolid.shared.offtopic
Organization: Rocksolid Light
Date: Thu, 12 Jul 2018 12:35 UTC
References: 1
Path: rocksolid2!.POSTED.local_inn!not-for-mail
From: AnonU...@retrobbs.rocksolidbbs.com (AnonUser)
Newsgroups: rocksolid.shared.offtopic
Subject: Re: view-source:http://overchan.oniichan.i2p/static/overchan.js
Date: Thu, 12 Jul 2018 12:35:24 -0000 (UTC)
Organization: Rocksolid Light
Message-ID: <53b4319c669a117d8c63bf5734b9f2a4$1@rslight.i2p>
References: <bcd16ee6c7b6e16952c66ed71a2a2b41@def4.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 12 Jul 2018 12:35:24 -0000 (UTC)
Injection-Info: novabbs.com; posting-host="local_inn:10.13.0.7";
logging-data="27808"; mail-complaints-to="usenet@novabbs.com"
View all headers
ah, javascript. how else could you make a site?

Posted on Rocksolid Light.




Subject: Re: view-source:http://overchan.oniichan.i2p/static/overchan.js
From: anon
Newsgroups: rocksolid.shared.offtopic
Organization: def4
Date: Thu, 12 Jul 2018 12:41 UTC
References: 1
Path: rocksolid2!def3!.POSTED.localhost!not-for-mail
From: ano...@anon.com (anon)
Newsgroups: rocksolid.shared.offtopic
Message-ID: <b73954d91778604790427c0e6c4499e5@def4.com>
Subject: Re: view-source:http://overchan.oniichan.i2p/static/overchan.js
Date: Thu, 12 Jul 2018 12:41:05+0000
Organization: def4
In-Reply-To: <53b4319c669a117d8c63bf5734b9f2a4$1@rslight.i2p>
References: <53b4319c669a117d8c63bf5734b9f2a4$1@rslight.i2p>
Lines:
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
View all headers
ah, javascript. how else could you make a site?

yeah, well...i have given up a bit on the js bashing.. although i have not changed my mind. but it is just so many sites on the darknets doing it...

i was wondering that if you do a validation of a captcha in a js (meaning: on the clients side), could you not hack that easily ? or is the actual validation done on the server ?

Posted on def4.i2p


1
rocksolid light 0.7.2
clearneti2ptor