Permalink
Browse files

correct column swapping implemented

  • Loading branch information...
Eskat0n committed Feb 16, 2012
1 parent eaa0c46 commit 1cb04bede0985fe2232b6f54dbb6fdaa17304f73
Showing with 3 additions and 11 deletions.
  1. +3 −11 muyou.twitter.user.js
View
@@ -6,25 +6,17 @@
// ==/UserScript==
// mutabor v0.1
-window.mutabor=(function(){var b=[];var a=function(g,d){if(!g.querySelector){return false}var h=g.cloneNode(true);var e=document.createElement("div");var f=document.createElement("div");f.id="temp"+new Date().getTime()+Math.round(Math.random()*1000);e.appendChild(f);f.appendChild(h);return !!e.querySelector("#"+f.id+" > "+d)};var c=function(f,d,g){var e=function(h){var j=h.srcElement||h.target;if(d){var i=j.querySelector?j.querySelector(d):null;if(a(j,d)){g(j,h)}else{if(i){g(i,h)}}}else{g(j,h)}};document.addEventListener(f,e);b.push({type:f,handler:e})};return{insert:function(d,e){if(!e){e=d;d=null}c("DOMNodeInserted",d,function(h,g){var f=g.relatedNode;if(e(h,g)===false){if(f){f.removeChild(h)}}})},remove:function(d,e){if(!e){e=d;d=null}c("DOMNodeRemoved",d,function(g,f){e(g,f)})},attribute:function(){throw"DOMAttrModified is not supported in WebKit so this interceptor is not implemented"},text:function(){throw"DOMCharacterDataModifiedis not supported in WebKit so this interceptor is not implemented"},on:function(d){var e=Array.prototype.slice.call(arguments,1);this[d].apply(this,e)},reset:function(){b.forEach(function(d){document.removeEventListener(d.type,d.handler)});b=[]},toString:function(){return"mutabor version 0.1"}}})();
+window.mutabor=(function(){var c=[];var a=function(h,e){if(!h.querySelector){return false}var i=h.cloneNode(true);var f=document.createElement("div");var g=document.createElement("div");g.id="temp"+new Date().getTime()+Math.round(Math.random()*1000);f.appendChild(g);g.appendChild(i);return !!f.querySelector("#"+g.id+" > "+e)};var b=function(i,h){var e={};for(var g in i){if(i.hasOwnProperty(g)){e[g]=i[g]}}for(var f in h){if(h.hasOwnProperty(f)){e[f]=h[f]}}return e};var d=function(g,e,h){var f=function(i){var k=i.srcElement||i.target;if(e){var j=k.querySelector?k.querySelector(e):null;if(a(k,e)){h(k,i)}else{if(j){h(j,i)}}}else{h(k,i)}};document.addEventListener(g,f);c.push({type:g,handler:f});return b(window.mutabor,{now:function(){Array.prototype.slice.apply(document.querySelectorAll(e)).forEach(h);return window.mutabor}})};return{insert:function(e,f){if(!f){f=e;e=null}return d("DOMNodeInserted",e,function(i,h){var g=h.relatedNode;if(f(i,h)===false){if(g){g.removeChild(i)}}})},remove:function(e,f){if(!f){f=e;e=null}return d("DOMNodeRemoved",e,f)},attribute:function(){throw"DOMAttrModified is not supported in WebKit so this interceptor is not implemented"},text:function(){throw"DOMCharacterDataModifiedis not supported in WebKit so this interceptor is not implemented"},on:function(e){var f=Array.prototype.slice.call(arguments,1);this[e].apply(this,f)},reset:function(){c.forEach(function(e){document.removeEventListener(e.type,e.handler)});c=[]},toString:function(){return"mutabor version 0.1"}}})();
// IIFE hack to avoid errors for return statement outside of the function
(function () {
mutabor.insert('.dashboard', function (element) {
element.style.float = 'right';
- });
-
- var dashboard = document.querySelector('.dashboard');
- if (dashboard)
- dashboard.style.float = 'right';
+ }).now();
mutabor.insert('.content-main', function (element) {
element.style.float = 'left';
- });
-
- var contentMain = document.querySelector('.content-main');
- if (contentMain)
- contentMain.style.float = 'left';
+ }).now();
})();

0 comments on commit 1cb04be

Please sign in to comment.