From: Silvio Rhatto Date: Fri, 1 Feb 2013 13:50:03 +0000 (-0200) Subject: Adding licenses, pentadactyl plugins and misc scripts X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=e37d51cc735cdb037b140eb7ced86d25a80e020d;p=metadot.git Adding licenses, pentadactyl plugins and misc scripts --- diff --git a/.gitmodules b/.gitmodules index 5dff19f..f254142 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "modules/vim/vim.dot.link/bundle/syntastic"] path = modules/vim/vim.dot.link/bundle/syntastic url = https://github.com/scrooloose/syntastic.git +[submodule "modules/scripts/apps/scripts.link"] + path = modules/scripts/apps/scripts.link + url = git://git.sarava.org/scripts.git diff --git a/LICENSE b/licenses/GPLv3.txt similarity index 100% rename from LICENSE rename to licenses/GPLv3.txt diff --git a/licenses/MIT.txt b/licenses/MIT.txt new file mode 100644 index 0000000..0522ac2 --- /dev/null +++ b/licenses/MIT.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/modules/mutt/mutt.dot.link/colors b/modules/mutt/mutt.dot.link/colors index c0a01db..0472c38 100644 --- a/modules/mutt/mutt.dot.link/colors +++ b/modules/mutt/mutt.dot.link/colors @@ -3,39 +3,39 @@ # #color attachment brightmagenta black # guess :-) -#color error brightwhite red # errors yell at you in red -#color hdrdefault red black # headers -#color indicator brightyellow red # currently selected message, etc -#color markers brightcyan black # the + for wrapped pager lines -#color message brightcyan black # informational messages, *not mail* -#color normal white black # plain text -#color quoted green black # quoted text -#color search brightgreen black # hilite search patterns in the pager -#color signature red black # signature (after "-- ") is red -#color status brightyellow blue # status bar is yellow *on blue* -#color tilde blue black # ~'s after message body -#color tree red black # thread tree in index menu is magenta +#color error brightwhite red # errors yell at you in red +#color hdrdefault red black # headers +#color indicator brightyellow red # currently selected message, etc +#color markers brightcyan black # the + for wrapped pager lines +#color message brightcyan black # informational messages, *not mail* +#color normal white black # plain text +#color quoted green black # quoted text +#color search brightgreen black # hilite search patterns in the pager +#color signature red black # signature (after "-- ") is red +#color status brightyellow blue # status bar is yellow *on blue* +#color tilde blue black # ~'s after message body +#color tree red black # thread tree in index menu is magenta -color normal brightwhite default -color indicator brightyellow red -color status white blue -color hdrdefault cyan default -color header brightyellow default ^Subject: -color header brightgreen default ^From: -color quoted cyan default -color quoted1 green default -color quoted2 cyan default -color quoted3 green default -color attachment yellow default -color signature magenta default -color tree red default -color tilde blue default -color markers red default -color error red default +color normal brightwhite default +color indicator brightyellow red +color status white blue +color hdrdefault cyan default +color header brightyellow default ^Subject: +color header brightgreen default ^From: +color quoted cyan default +color quoted1 green default +color quoted2 cyan default +color quoted3 green default +color attachment yellow default +color signature magenta default +color tree red default +color tilde blue default +color markers red default +color error red default # hiliting bold patterns in body -color bold red default +color bold red default # hiliting underlined patterns in body -color underline green default +color underline green default # INDEX ############################################################################## diff --git a/modules/pentadactyl/pentadactyl.dot/plugins.link/noscript.js b/modules/pentadactyl/pentadactyl.dot/plugins.link/noscript.js new file mode 100644 index 0000000..1c69c68 --- /dev/null +++ b/modules/pentadactyl/pentadactyl.dot/plugins.link/noscript.js @@ -0,0 +1,461 @@ +/* + * Copyright ©2010 Kris Maglione + * Distributable under the terms of the MIT license. + * + * Documentation is at the tail of this file. + */ +/* use strict */ + +dactyl.assert("noscriptOverlay" in window, + "This plugin requires the NoScript add-on."); + +/* + * this.globalJS ? !this.alwaysBlockUntrustedContent || !this.untrustedSites.matches(s) + * : this.jsPolicySites.matches(s) && !this.untrustedSites.matches(s) && !this.isForbiddenByHttpsStatus(s)); + */ + +function getSites() { + // This logic comes directly from NoScript. To my mind, it's insane. + const ns = services.noscript; + const global = options["script"]; + const groups = { allowed: ns.jsPolicySites, temp: ns.tempSites, untrusted: ns.untrustedSites }; + const show = Set(options["noscript-list"]); + const sites = window.noscriptOverlay.getSites(); + + const blockUntrusted = global && ns.alwaysBlockUntrustedContent; + + let res = []; + for (let site in array.iterValues(Array.concat(sites.topSite, sites))) { + let ary = []; + + let untrusted = groups.untrusted.matches(site); + let matchingSite = null; + if (!untrusted) + matchingSite = groups.allowed.matches(site) || blockUntrusted && site; + + let enabled = Boolean(matchingSite); + if (site == sites.topSite && !ns.dom.getDocShellForWindow(content).allowJavascript) + enabled = false; + + let hasPort = /:\d+$/.test(site); + + if (enabled && !global || untrusted) { + if (!enabled || global) + matchingSite = untrusted; + + if (hasPort && ns.ignorePorts) + if (site = groups.allowed.matches(site.replace(/:\d+$/, ""))) + matchingSite = site; + ary.push(matchingSite); + } + else { + if ((!hasPort || ns.ignorePorts) && (show.full || show.base)) { + let domain = !ns.isForbiddenByHttpsStatus(site) && ns.getDomain(site); + if (domain && ns.isJSEnabled(domain) == enabled) { + ary = util.subdomains(domain); + if (!show.base && ary.length > 1) + ary = ary.slice(1); + if (!show.full) + ary = ary.slice(0, 1); + } + } + + if (show.address || ary.length == 0) { + ary.push(site); + + if (hasPort && ns.ignorePorts) { + site = site.replace(/:\d+$/, ""); + if (!groups.allowed.matches(site)) + ary.push(site); + } + } + } + res = res.concat(ary); + } + + let seen = {}; + return res.filter(function (h) !Set.add(seen, h)); +} +function getObjects() { + let sites = noscriptOverlay.getSites(); + let general = [], specific = []; + for (let group in values(sites.pluginExtras)) + for (let obj in array.iterValues(group)) { + if (!obj.placeholder && (ns.isAllowedObject(obj.url, obj.mime) || obj.tag)) + continue; + specific.push(obj.mime + "@" + obj.url); + general.push("*@" + obj.url); + general.push("*@" + obj.site); + } + let sites = buffer.allFrames().map(function (f) f.location.host); + for (let filter in values(options["noscript-objects"])) { + let host = util.getHost(util.split(filter, /@/, 2)[1]); + if (sites.some(function (s) s == host)) + specific.push(filter); + } + let seen = {}; + return specific.concat(general).filter(function (site) !Set.add(seen, site)); +} + +var onUnload = overlay.overlayObject(gBrowser, { + // Extend NoScript's bookmarklet handling hack to the command-line + // Modified from NoScript's own wrapper. + loadURIWithFlags: function loadURIWithFlags(url) { + let args = arguments; + function load() loadURIWithFlags.superapply(gBrowser, args); + + if (!commandline.command || !util.isDactyl(Components.stack.caller)) + return load(); + + try { + for (let [cmd, args] in commands.parseCommands(commandline.command)) + var origURL = args.literalArg; + + let isJS = function isJS(url) /^(?:data|javascript):/i.test(url); + let allowJS = prefs.get("noscript.allowURLBarJS", true); + + if (isJS(origURL) && allowJS) { + if (services.noscript.executeJSURL(origURL, load)) + return; + } + else if (url != origURL && isJS(url)) { + if(services.noscript.handleBookmark(url, load)) + return; + } + } + catch (e) { + util.reportError(e); + } + return load(); + } +}); + +highlight.loadCSS( + NoScriptAllowed color: green; + NoScriptBlocked color: #444; font-style: italic; + NoScriptTemp color: blue; + NoScriptUntrusted color: #c00; font-style: italic; +); + +let groupProto = {}; +["temp", "jsPolicy", "untrusted"].forEach(function (group) + memoize(groupProto, group, function () services.noscript[group + "Sites"].matches(this.site))); +let groupDesc = { + NoScriptTemp: "Temporarily allowed", + NoScriptAllowed: "Allowed permanently", + NoScriptUntrusted: "Untrusted", + NoScriptBlocked: "Blocked" +}; + +function splitContext(context, list) { + for (let [name, title, filter] in values(list)) { + let ctxt = context.split(name); + ctxt.title = [title]; + ctxt.filters.push(filter); + } +} + +completion.noscriptObjects = function (context) { + let whitelist = options.get("noscript-objects").set; + context = context.fork(); + context.compare = CompletionContext.Sort.unsorted; + context.generate = getObjects; + context.keys = { + text: util.identity, + description: function (key) Set.has(whitelist, key) ? "Allowed" : "Forbidden" + }; + splitContext(context, getObjects, [ + ["forbidden", "Forbidden objects", function (item) !Set.has(whitelist, item.item)], + ["allowed", "Allowed objects", function (item) Set.has(whitelist, item.item)]]); +}; +completion.noscriptSites = function (context) { + context.compare = CompletionContext.Sort.unsorted; + context.generate = getSites; + context.keys = { + text: util.identity, + description: function (site) groupDesc[this.highlight] + + (this.groups.untrusted && this.highlight != "NoScriptUntrusted" ? " (untrusted)" : ""), + + highlight: function (site) this.groups.temp ? "NoScriptTemp" : + this.groups.jsPolicy ? "NoScriptAllowed" : + this.groups.untrusted ? "NoScriptUntrusted" : + "NoScriptBlocked", + groups: function (site) ({ site: site, __proto__: groupProto }) + }; + splitContext(context, [ + ["normal", "Active sites", function (item) item.groups.jsPolicy || !item.groups.untrusted], + ["untrusted", "Untrusted sites", function (item) !item.groups.jsPolicy && item.groups.untrusted]]); + context.maxItems = 100; +} + +services.add("noscript", "@maone.net/noscript-service;1"); + +var PrefBase = "noscript."; +var Pref = Struct("text", "pref", "description"); +let prefs = { + forbid: [ + ["bookmarklet", "forbidBookmarklets", "Forbid bookmarklets"], + ["collapse", "collapseObject", "Collapse forbidden objects"], + ["flash", "forbidFlash", "Block Adobe® Flash® animations"], + ["fonts", "forbidFonts", "Forbid remote font loading"], + ["frame", "forbidFrames", "Block foreign elements"], + ["iframe", "forbidIFrames", "Block foreign