Skip to content

Instantly share code, notes, and snippets.

@n1ce0n3
n1ce0n3 / old_login_widget_copycat.js
Created December 10, 2021 15:13
ning2.0 login widget for 3.0
(function(){
const appendLogin = async () => {
if (!!ning.CurrentProfile)
while ("function" !== typeof globalThis.jQuery)
await new Promise(resolve => setTimeout(resolve, 150))
if (x$(".content-body.entry .row > div").length !== 2) return;
x$(".content-body.entry .row > div:last").prepend(` <div class="grid-frame sheet section-html"> <header class="module-header"></header> <section class="module-body htmlSection"> <div class="entry-content cf"> <div class="xg_module_body xg_signup xg_lightborder"> <p>Welcome to<br>${ning.CurrentApp.name}</p> <p><big><strong><a href="/main/authorization/signUp">Sign Up</a></strong></big><br>or <a href="/main/authorization/signIn" style="white-space:nowrap">Sign In</a></p></div> </div> </section> </div>`);
let style = document.createElement('style');
style.textContent = `.xg_signup.xg_lightborder.xg_module_body { line-height: 1.3; font-weight: normal; font-family: "Lucida Grande", "Lucida Sans", Verdana, sans-serif
@n1ce0n3
n1ce0n3 / ning2.0_iframe_fixer.js
Last active December 1, 2021 22:25
fix iframe mce
window.onload = () => {
(function(){
if (!ning.CurrentProfile.id === ning.CurrentApp.owner) return
if (!x$('.texteditor').length) return;
x$('.texteditor').each(function(){
let HTMLmode = x$(this).find('.mce-tabs a:contains(HTML)');
if (HTMLmode.length) {
x$(HTMLmode).on('click', function(){
setTimeout(() => addListeners(HTMLmode[0]), 100)
});
@n1ce0n3
n1ce0n3 / photoSorting-autoExecute.js
Last active October 11, 2021 11:05
photoSorting async onload
(function(){
let links = [];
$(".photoListPage-entry a").each(function () {
links.push({ element: $(this).parent(), link: this.href });
});
const photosPage = "photos";
const getLikes = async (el) => {
if (!el) return;
let promise = new Promise(async resolve => {
@n1ce0n3
n1ce0n3 / photoSorting.js
Created October 11, 2021 10:31
Photo Asc/Desc sorting by likes
let links = [];
$(".photoListPage-entry a").each(function () {
links.push({ element: $(this).parent(), link: this.href });
});
const photosPage = "photos";
const getLikes = async (el) => {
if (!el) return;
let promise = new Promise(async resolve => {
el.forEach((photo,index) => {
<!-- disable mobile responsiveness -->
<script>
document.onreadystatechange = () => {
(async () => {
while (typeof document.getElementsByTagName('meta').viewport !== "object")
await new Promise(resolve => setTimeout(resolve, 250))
eval(`document.getElementsByTagName('meta').viewport.content = ""`);
})();
}
</script>
@n1ce0n3
n1ce0n3 / fbcolor.js
Last active October 2, 2021 08:28
fb-likebox-recolor
(async () => {
while ("function" !== typeof window.jQuery)
await new Promise((resolve) => setTimeout(resolve, 250));
try {
$ = window.jQuery;
} catch (e) {}
$(".wait ~ iframe").ready(function () {
$(".wait").text("");
$(".wait")
.next()
@n1ce0n3
n1ce0n3 / smileys_v2.js
Created September 28, 2021 16:14
smileys_v2
;(function () {
try{$ = x$}catch(e){}
let _twemoji = document.createElement('script')
_twemoji.src = 'https://twemoji.maxcdn.com/v/latest/twemoji.min.js'
_twemoji.crossorigin = 'anonymous'
document.head.appendChild(_twemoji)
;(async () => {
while ('object' !== typeof window.twemoji)
await new Promise((resolve) => setTimeout(resolve, 500))
let smileys = [
@n1ce0n3
n1ce0n3 / chat_2.0_wannabe.js
Created September 27, 2021 16:04
chat_2.0_wannabe
//no additional online checks (faster)
$ !== x$ && ($ = x$);
const chat = $('.module_chat_v4 .xg_module_body');
chat.parent().css({
"display": "flex",
"place-content": "flex-end",
"max-width": "inherit",
width: '100%'
}).children('.xg_module_body').css({
"width": "65%",
@n1ce0n3
n1ce0n3 / awaiter-async.js
Last active September 22, 2021 12:25
wtf is this shit m8
const SECTIONS = [
'forum',
'article',
'blog',
'photo',
'video',
'group',
'events'
]
var linksFound = [],
@n1ce0n3
n1ce0n3 / navbar.css
Created September 19, 2021 09:07
navbar [wip]
@import url("https://fonts.googleapis.com/css?family=Lora:400,400i,700");
#burger-toggle {
position: absolute;
appearance: none;
opacity: 0;
}
#burger-toggle:checked~.menu {
opacity: 1;