Warning: fopen(/www/sites/update.greasyfork.icu/index/store/temp/b9f76a346e4090d6f631f587a76d4ee6.js): failed to open stream: No space left on device in /www/sites/update.greasyfork.icu/index/scriptControl.php on line 65
// ==UserScript==
// @name F - Emote Organization
// @author ChrisTurk
// @description Fixes the smiley clown fiesta
// @include http://www.mturkgrind.com/threads/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
// @version 0.0.1.20160815153635
// @namespace https://greasyfork.org/users/53857
// @downloadURL https://update.greasyfork.icu/scripts/22325/F%20-%20Emote%20Organization.user.js
// @updateURL https://update.greasyfork.icu/scripts/22325/F%20-%20Emote%20Organization.meta.js
// ==/UserScript==
//MTurkGrind
var defaultShow = 'block'; //set to 'block' if you want smilies to show by default or set to 'none' if you only want the category headers to show
// This is super nifty.. the smilie box isn't created on page load, so need this to find it when the user clicks on the smilie box so we can grab it and slap some makeup on there, should work before the page finishes loading even.
/*
* arrive.js v2.3.1
* https://github.com/uzairfarooq/arrive
* MIT licensed
* Copyright (c) 2014-2016 Uzair Farooq
*/
var Arrive=function(a,b,c){"use strict";function l(a,b,c){e.addMethod(b,c,a.unbindEvent),e.addMethod(b,c,a.unbindEventWithSelectorOrCallback),e.addMethod(b,c,a.unbindEventWithSelectorAndCallback)}function m(a){a.arrive=j.bindEvent,l(j,a,"unbindArrive"),a.leave=k.bindEvent,l(k,a,"unbindLeave")}if(a.MutationObserver&&"undefined"!=typeof HTMLElement){var d=0,e=function(){var b=HTMLElement.prototype.matches||HTMLElement.prototype.webkitMatchesSelector||HTMLElement.prototype.mozMatchesSelector||HTMLElement.prototype.msMatchesSelector;return{matchesSelector:function(a,c){return a instanceof HTMLElement&&b.call(a,c)},addMethod:function(a,b,c){var d=a[b];a[b]=function(){return c.length==arguments.length?c.apply(this,arguments):"function"==typeof d?d.apply(this,arguments):void 0}},callCallbacks:function(a){for(var c,b=0;c=a[b];b++)c.callback.call(c.elem)},checkChildNodesRecursively:function(a,b,c,d){for(var g,f=0;g=a[f];f++)c(g,b,d)&&d.push({callback:b.callback,elem:g}),g.childNodes.length>0&&e.checkChildNodesRecursively(g.childNodes,b,c,d)},mergeArrays:function(a,b){var d,c={};for(d in a)c[d]=a[d];for(d in b)c[d]=b[d];return c},toElementsArray:function(b){return"undefined"==typeof b||"number"==typeof b.length&&b!==a||(b=[b]),b}}}(),f=function(){var a=function(){this._eventsBucket=[],this._beforeAdding=null,this._beforeRemoving=null};return a.prototype.addEvent=function(a,b,c,d){var e={target:a,selector:b,options:c,callback:d,firedElems:[]};return this._beforeAdding&&this._beforeAdding(e),this._eventsBucket.push(e),e},a.prototype.removeEvent=function(a){for(var c,b=this._eventsBucket.length-1;c=this._eventsBucket[b];b--)a(c)&&(this._beforeRemoving&&this._beforeRemoving(c),this._eventsBucket.splice(b,1))},a.prototype.beforeAdding=function(a){this._beforeAdding=a},a.prototype.beforeRemoving=function(a){this._beforeRemoving=a},a}(),g=function(b,d){var g=new f,h=this,i={fireOnAttributesModification:!1};return g.beforeAdding(function(c){var i,e=c.target;c.selector,c.callback;(e===a.document||e===a)&&(e=document.getElementsByTagName("html")[0]),i=new MutationObserver(function(a){d.call(this,a,c)});var j=b(c.options);i.observe(e,j),c.observer=i,c.me=h}),g.beforeRemoving(function(a){a.observer.disconnect()}),this.bindEvent=function(a,b,c){b=e.mergeArrays(i,b);for(var d=e.toElementsArray(this),f=0;f0?e.checkChildNodesRecursively(c,b,k,f):"attributes"===a.type&&k(d,b,f)&&f.push({callback:b.callback,elem:node}),e.callCallbacks(f)})}function k(a,b,f){if(e.matchesSelector(a,b.selector)&&(a._id===c&&(a._id=d++),-1==b.firedElems.indexOf(a._id))){if(b.options.onceOnly){if(0!==b.firedElems.length)return;b.me.unbindEventWithSelectorAndCallback.call(b.target,b.selector,b.callback)}b.firedElems.push(a._id),f.push({callback:b.callback,elem:a})}}var f={fireOnAttributesModification:!1,onceOnly:!1,existing:!1};j=new g(h,i);var l=j.bindEvent;return j.bindEvent=function(a,b,c){"undefined"==typeof c?(c=b,b=f):b=e.mergeArrays(f,b);var d=e.toElementsArray(this);if(b.existing){for(var g=[],h=0;h0&&e.checkChildNodesRecursively(c,b,h,f),e.callCallbacks(f)})}function h(a,b){return e.matchesSelector(a,b.selector)}var c={};k=new g(d,f);var i=k.bindEvent;return k.bindEvent=function(a,b,d){"undefined"==typeof d?(d=b,b=c):b=e.mergeArrays(c,b),i.call(this,a,b,d)},k},j=new h,k=new i;b&&m(b.fn),m(HTMLElement.prototype),m(NodeList.prototype),m(HTMLCollection.prototype),m(HTMLDocument.prototype),m(Window.prototype);var n={};return l(j,n,"unbindAllArrive"),l(k,n,"unbindAllLeave"),n}}(window,"undefined"==typeof jQuery?null:jQuery,void 0);
$(document).arrive(".redactor_smilies", function() {
FixSmilies();
});
// this is currently a cluster because all the html is formatted in notepad++ then I just copy/pasta the single line into this script
// dealwithit.jpg
function FixSmilies(){
console.log('ayyy');
$( '.redactor_smilies' ).css('height', '500px');
$( '.secondaryContent.smilieContainer' ).css('height', '500px').css('overflow', 'scroll').css('max-height', '500px');
// HTML/CSS clown fiesta. I format this in notepad++ and then shove it to a single line and copy/paste into the script.. sorry homies.
$( 'li.smilieCategory' ).html('Welcome! Hello! Goodbye!
Happy, Joy, Fun
Bored, Tired, Dead
Love, Teasing, Flirting
Shock, Amazement, Congrats
Attention, Help, Confused
Sad, Upset
Anger & Frustration
Snark, Arguments, Fighting
Coffee, Tea, & Food
Drinking & Drugs
Holidays, Parties, & Patriotism
Animals
Misc
Stock Smilies
Bananas?
Small Signs & Bubbles
Billboard Signs
');
// In the html/css itself the smilies will not display by default, but I threw this in so people could set how they want it at the top of the script
$( 'li.smilieCategory' ).children('ul').css('display', defaultShow);
// I like it centered, you can delete/commentout/change as you see fit
$( 'li.smilieCategory' ).children().css('text-align', 'center');
// Togglers.. there are better ways to do this o.O
$( '#welcomeToggler' ).click(function(){
$( '#welcomeSmilie' ).toggle( 'fast' );
});
$( '#happyToggler' ).click(function(){
$( '#happySmilie' ).toggle( 'fast' );
});
$( '#boredToggler' ).click(function(){
$( '#boredSmilie' ).toggle( 'fast' );
});
$( '#loveToggler' ).click(function(){
$( '#loveSmilie' ).toggle( 'fast' );
});
$( '#shockToggler' ).click(function(){
$( '#shockSmilie' ).toggle( 'fast' );
});
$( '#attentionToggler' ).click(function(){
$( '#attentionSmilie' ).toggle( 'fast' );
});
$( '#sadToggler' ).click(function(){
$( '#sadSmilie' ).toggle( 'fast' );
});
$( '#angerToggler' ).click(function(){
$( '#angerSmilie' ).toggle( 'fast' );
});
$( '#snarkToggler' ).click(function(){
$( '#snarkmilie' ).toggle( 'fast' );
});
$( '#coffeeToggler' ).click(function(){
$( '#coffeeSmilie' ).toggle( 'fast' );
});
$( '#drugsToggler' ).click(function(){
$( '#drugsSmilie' ).toggle( 'fast' );
});
$( '#holidayToggler' ).click(function(){
$( '#holidaySmilie' ).toggle( 'fast' );
});
$( '#animalToggler' ).click(function(){
$( '#animalSmilie' ).toggle( 'fast' );
});
$( '#miscToggler' ).click(function(){
$( '#miscSmilie' ).toggle( 'fast' );
});
$( '#stockToggler' ).click(function(){
$( '#stockSmilie' ).toggle( 'fast' );
});
$( '#bananaToggler' ).click(function(){
$( '#bananaSmilie' ).toggle( 'fast' );
});
$( '#signToggler' ).click(function(){
$( '#signSmilie' ).toggle( 'fast' );
});
$( '#billboardToggler' ).click(function(){
$( '#billboardSmilie' ).toggle( 'fast' );
});
}