Changeset 16515 in josm for trunk/resources/images/presets


Ignore:
Timestamp:
2020-05-29T10:58:38+02:00 (5 years ago)
Author:
Klumbumbus
Message:

remove equalizer script code sometimes added by a firefox addon when downloading files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/resources/images/presets/sightseeing/fort.svg

    r15931 r16515  
    1313  <rect width="14" height="14" x="0" y="0" id="canvas" style="fill:none;stroke:none;visibility:hidden"/>
    1414  <path id="fort" d="M 1 1 L 1 3 L 6 3 L 6 1 L 5 1 L 5 2 L 4 2 L 4 1 L 3 1 L 3 2 L 2 2 L 2 1 L 1 1 z M 8 1 L 8 3 L 13 3 L 13 1 L 12 1 L 12 2 L 11 2 L 11 1 L 10 1 L 10 2 L 9 2 L 9 1 L 8 1 z M 1 4 L 1 10 L 13 10 L 13 4 L 8 4 L 8 6 L 6 6 L 6 4 L 1 4 z M 3 6 L 4 6 L 4 7 L 3.5 8 L 3 7 L 3 6 z M 10 6 L 11 6 L 11 7 L 10.5 8 L 10 7 L 10 6 z M 1 11 L 0 14 L 14 14 L 13 11 L 1 11 z " style="fill:#734a08;fill-opacity:1;stroke:none"/>
    15 <script xmlns="">(function (AESD) {
    16   var core = {
    17     "log": false,
    18     "whitelist": function (status) {
    19       window.postMessage({
    20         "app": "audio-equalizer",
    21         "action": "page-whitelist",
    22         "value": {
    23           "status": status,
    24           "action": "page-whitelist"
    25         }
    26       }, '*');
    27     },
    28     "hostname": function (url) {
    29       if ("blob:" === url.substring(0, 5)) {
    30         url = url.replace("blob:", '');
    31         url = unescape(url);
    32       }
    33       /*  */
    34       var match = url.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);
    35       var flag = (match !== null) &amp;&amp; (match.length &gt; 2) &amp;&amp; (typeof match[2] === "string") &amp;&amp; (match[2].length &gt; 0);
    36       return flag ? match[2] : null;
    37     },
    38     "equalizer": {
    39       "targets": [],
    40       "filters": [],
    41       "storage": {},
    42       "audioContext": null,
    43       "gain": function () {
    44         var filter = core.equalizer.audioContext.createGain();
    45         filter.channelCountMode = "explicit";
    46         filter.gain.value = 1;
    47         return filter;
    48       },
    49       "biquad": function (e) {
    50         var filter = core.equalizer.audioContext.createBiquadFilter();
    51         filter.type = e.type || core.equalizer.storage.FT.LOWPASS;
    52         filter.frequency.value = e.f || 0;
    53         filter.gain.value = e.gain || 0;
    54         filter.Q.value = 1;
    55         return filter;
    56       },
    57       "set": function (o) {
    58         if (o) {
    59           if (o.eq &amp;&amp; o.config) {
    60             if (core.equalizer.filters.length &gt; 0) {
    61               if (core.equalizer.filters[0]) {
    62                 core.equalizer.filters[0].channelCount = o.config.mono ? 1 : (core.equalizer.filters[0]._defaultChannelCount ? core.equalizer.filters[0]._defaultChannelCount : 2);
    63                 core.equalizer.filters.forEach(function (f, i) {f.gain.value = o.eq[i].gain});
    64               }
    65             }
    66           }
    67         }
    68       },
    69       "load": function () {
    70         if (core.log) console.error(" &gt;&gt; Searching for video/audio elements...");
    71         core.equalizer.filters = [];
    72         delete core.equalizer.audioContext;
    73         /*  */
    74         core.equalizer.audioContext = new AudioContext();
    75         for (var i = 0; i &lt; core.equalizer.storage.eq.length; i++) {
    76           var node = core.equalizer.storage.eq[i];
    77           var filter = node.f ? core.equalizer.biquad(node) : core.equalizer.gain();
    78           if (filter) core.equalizer.filters.push(filter);
    79         }
    80         /*  */
    81         if (core.log) console.error(" &gt;&gt; Equalizer is loaded!");
    82         core.equalizer.attach(2);
    83       },
    84       "attach": function (w) {         
    85         if (!core.equalizer.audioContext) core.equalizer.load();
    86         else {
    87           core.equalizer.targets.forEach(function (t, k) {
    88             if (t.getAttribute("equalizer-state") !== "attached") {
    89               var src = (t.src ? t.src : t.currentSrc);
    90               var crossorigin = t.getAttribute("crossorigin");
    91               if (src) {
    92                 t.setAttribute("equalizer-state", "attached");
    93                 if (core.log) console.error(" &gt;&gt; Equalizer is attached, loc", w, t.className);
    94                 if (!crossorigin &amp;&amp; document.location.hostname !== core.hostname(src) &amp;&amp; src.substring(0, 5) !== "blob:") {
    95                   t.setAttribute('crossorigin', (crossorigin ? crossorigin : "anonymous"));
    96                   if (t.src) t.src = t.src + '';
    97                   else if (t.currentSrc) t.load();
    98                 }
    99                 /*  */
    100                 var source = core.equalizer.audioContext.createMediaElementSource(t);
    101                 core.equalizer.filters[0]._defaultChannelCount = (source.channelCount) ? source.channelCount : 2;
    102                 source.connect(core.equalizer.filters[0]);
    103                 /*  */
    104                 for (var i = 0; i &lt; core.equalizer.filters.length; i++) {
    105                   var next = core.equalizer.filters[i + 1];
    106                   var current = core.equalizer.filters[i];
    107                   if (next) current.connect(next);
    108                 }
    109                 /*  */
    110                 var last = core.equalizer.filters.length - 1;
    111                 core.equalizer.filters[last].connect(core.equalizer.audioContext.destination);
    112               }
    113             }
    114           });
    115         }
    116       }
    117     }
    118   };
    119   /*  */
    120   core.equalizer.storage = AESD;
    121   /*  */
    122   window.addEventListener("message", function (e) {
    123     if (e.data.app === "audio-equalizer") {
    124       if (e.data.action === "app-set") core.equalizer.set(e.data.value);
    125       if (e.data.action === "page-whitelist-enable") core.whitelist(e.data.value);
    126       if (e.data.action === "page-whitelist-disable") core.whitelist(e.data.value);
    127     }
    128   }, false);
    129   /*  */
    130   window.addEventListener("play", function (e) {
    131     core.equalizer.targets.push(e.target);
    132     core.equalizer.attach(0);
    133   }, true);
    134   /*  */
    135   if (Audio) {
    136     if (Audio.prototype) {
    137       if (Audio.prototype.play) {
    138         const PROTO = Audio.prototype.play;
    139         Audio.prototype.play = function () {
    140           core.equalizer.targets.push(this);
    141           core.equalizer.attach(1);
    142           /*  */
    143           return PROTO.apply(this, arguments);
    144         };
    145       }
    146     }
    147   }
    148 })({"config":{"snap":false,"mono":false},"eq":[{"label":"master","gain":1},{"label":"64","f":64,"gain":"-12","type":"peaking"},{"label":"32","f":32,"gain":"-12","type":"lowshelf"},{"label":"125","f":125,"gain":"0.22","type":"peaking"},{"label":"250","f":250,"gain":0,"type":"peaking"},{"label":"500","f":500,"gain":0,"type":"peaking"},{"label":"1k","f":1000,"gain":0,"type":"peaking"},{"label":"2k","f":2000,"gain":0,"type":"peaking"},{"label":"4k","f":4000,"gain":0,"type":"peaking"},{"label":"8k","f":8000,"gain":0,"type":"peaking"},{"label":"16k","f":16000,"gain":0,"type":"highshelf"}],"presets":[{"name":"Club","default":true,"gains":[0,0,4.8,3.36,3.36,3.36,1.92,0,0,0]},{"name":"Live","default":true,"gains":[-2.88,0,2.4,3.36,3.36,3.36,2.4,1.44,1.44,1.44]},{"name":"Party","default":true,"gains":[4.32,4.32,0,0,0,0,0,0,4.32,4.32]},{"name":"Pop","default":true,"gains":[0.96,2.88,4.32,4.8,3.36,0,-1.44,-1.44,0.96,0.96]},{"name":"Soft","default":true,"gains":[2.88,0.96,0,-1.44,0,2.4,4.8,5.76,6.72,7.2]},{"name":"Ska","default":true,"gains":[-1.44,-2.88,-2.4,0,2.4,3.36,5.28,5.76,6.72,5.76]},{"name":"Reggae","default":true,"gains":[0,0,0,-3.36,0,3.84,3.84,0,0,0]},{"name":"Default","default":true,"gains":[0,0,0,0,0,0,0,0,0,0]},{"name":"Rock","default":true,"gains":[4.8,2.88,-3.36,-4.8,-1.92,2.4,5.28,6.72,6.72,6.72]},{"name":"Dance","default":true,"gains":[5.76,4.32,1.44,0,0,-3.36,-4.32,-4.32,0,0]},{"name":"Techno","default":true,"gains":[4.8,3.36,0,-3.36,-2.88,0,4.8,5.76,5.76,5.28]},{"name":"Headphones","default":true,"gains":[2.88,6.72,3.36,-1.92,-1.44,0.96,2.88,5.76,7.68,8.64]},{"name":"Soft rock","default":true,"gains":[2.4,2.4,1.44,0,-2.4,-3.36,-1.92,0,1.44,5.28]},{"name":"Classical","default":true,"gains":[0,0,0,0,0,0,-4.32,-4.32,-4.32,-5.76]},{"name":"Large Hall","default":true,"gains":[6.24,6.24,3.36,3.36,0,-2.88,-2.88,-2.88,0,0]},{"name":"Full Bass","default":true,"gains":[4.8,5.76,5.76,3.36,0.96,-2.4,-4.8,-6.24,-6.72,-6.72]},{"name":"Full Treble","default":true,"gains":[-5.76,-5.76,-5.76,-2.4,1.44,6.72,9.6,9.6,9.6,10.08]},{"name":"Laptop Speakers","default":true,"gains":[2.88,6.72,3.36,-1.92,-1.44,0.96,2.88,5.76,7.68,8.64]},{"name":"Full Bass &amp; Treble","default":true,"gains":[4.32,3.36,0,-4.32,-2.88,0.96,4.8,6.72,7.2,7.2]},{"name":"twitch background noise","gains":["-12","-12","-12","0.22","0","-3.78","0.89","3.56","2.22","2"]}],"selected":{"name":"Default","default":true,"gains":[0,0,0,0,0,0,0,0,0,0]},"whitelist":[]})</script></svg>
     15</svg>
Note: See TracChangeset for help on using the changeset viewer.