Created
February 16, 2018 16:05
-
-
Save malcolmocean/5690d8679de0ee0102224af8b63091c8 to your computer and use it in GitHub Desktop.
WorkflowyCompliceFormat userscript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name WorkflowyCompliceFormat | |
// @description Stylizes complice-format tasks in workflowy with their appropriate Complice goal color. | |
// @author Malcolm Ocean | |
// adapted from WorkflowyStylableTags by Nigel Thorne and LukeMT | |
// @include http*://*workflowy.com/* | |
// @version 0.1 | |
// ==/UserScript== | |
(function () { | |
var compliceUsername = 'YOUR USERNAME GOES HERE' | |
var link = window.document.createElement('link'); | |
link.rel = 'stylesheet'; | |
link.type = 'text/css'; | |
link.href = 'https://complice.co/'+compliceUsername+'/user.css'; | |
document.getElementsByTagName("HEAD")[0].appendChild(link); | |
var simpleActionRE = /^(\d|&)?\) *(\S+).*$/; | |
setInterval(function(){ | |
$('.content').map( function(){ | |
var x = $(this).text(); | |
if (simpleActionRE.test(x)) { | |
var code = x.substr(0,1); | |
code = (code === '&') ? 'x' : code; | |
$(this).addClass('ccmfg').addClass('goal-'+code); | |
} else { | |
this.className = this.className.replace(/goal-\S+/g, ""); | |
$(this).removeClass('ccmfg'); | |
} | |
}); | |
},1000); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment