snipt

Ctrl+h for KB shortcuts

JavaScript

Codepad.co - Set Default Language to JavaScript.js

// ==UserScript==
// @name         CodePad | New Snipped Hack
// @version      1.0.0
// @description  When creating a new CodePad snippet, the default language will be set to 'JavaScript'.
// @author       Uunknownn
// @match        https://codepad.co/snippet
// @grant        none
// ==/UserScript==

(function(){
    document.getElementsByClassName("icn-arrow-down")[0].parentElement.innerHTML="<span>JavaScript<i class=\"icn-arrow-down\"></i></span>";
    document.getElementById("snippet_type_id-193").checked=true;
})();

Description

When creating a new https://codepad.co/ snippet, the default language will be set to 'JavaScript'.
https://snipt.net/embed/7f28d996aaad1ca900a195d13a168bd6/
/raw/7f28d996aaad1ca900a195d13a168bd6/
7f28d996aaad1ca900a195d13a168bd6
js
JavaScript
13
2019-08-18T21:12:30
True
False
False
Jan 13, 2016 at 03:42 AM
/api/public/snipt/143534/
codepadco-set-default-language-to-javascriptjs
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1"> 1</a> <a href="#L-2"> 2</a> <a href="#L-3"> 3</a> <a href="#L-4"> 4</a> <a href="#L-5"> 5</a> <a href="#L-6"> 6</a> <a href="#L-7"> 7</a> <a href="#L-8"> 8</a> <a href="#L-9"> 9</a> <a href="#L-10">10</a> <a href="#L-11">11</a> <a href="#L-12">12</a> <a href="#L-13">13</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1">// ==UserScript==</span> </span><span id="L-2"><a name="L-2"></a><span class="c1">// @name CodePad | New Snipped Hack</span> </span><span id="L-3"><a name="L-3"></a><span class="c1">// @version 1.0.0</span> </span><span id="L-4"><a name="L-4"></a><span class="c1">// @description When creating a new CodePad snippet, the default language will be set to &#39;JavaScript&#39;.</span> </span><span id="L-5"><a name="L-5"></a><span class="c1">// @author Uunknownn</span> </span><span id="L-6"><a name="L-6"></a><span class="c1">// @match https://codepad.co/snippet</span> </span><span id="L-7"><a name="L-7"></a><span class="c1">// @grant none</span> </span><span id="L-8"><a name="L-8"></a><span class="c1">// ==/UserScript==</span> </span><span id="L-9"><a name="L-9"></a> </span><span id="L-10"><a name="L-10"></a><span class="p">(</span><span class="kd">function</span><span class="p">(){</span> </span><span id="L-11"><a name="L-11"></a> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementsByClassName</span><span class="p">(</span><span class="s2">&quot;icn-arrow-down&quot;</span><span class="p">)[</span><span class="mi">0</span><span class="p">].</span><span class="nx">parentElement</span><span class="p">.</span><span class="nx">innerHTML</span><span class="o">=</span><span class="s2">&quot;&lt;span&gt;JavaScript&lt;i class=\&quot;icn-arrow-down\&quot;&gt;&lt;/i&gt;&lt;/span&gt;&quot;</span><span class="p">;</span> </span><span id="L-12"><a name="L-12"></a> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s2">&quot;snippet_type_id-193&quot;</span><span class="p">).</span><span class="nx">checked</span><span class="o">=</span><span class="kc">true</span><span class="p">;</span> </span><span id="L-13"><a name="L-13"></a><span class="p">})();</span> </span></pre></div> </td></tr></table>
javascript, js
--- 
+++ 
@@ -0,0 +1,13 @@
+// ==UserScript==
+// @name         CodePad | New Snipped Hack
+// @version      1.0.0
+// @description  When creating a new CodePad snippet, the default language will be set to 'JavaScript'.
+// @author       Uunknownn
+// @match        https://codepad.co/snippet
+// @grant        none
+// ==/UserScript==
+
+(function(){
+    document.getElementsByClassName("icn-arrow-down")[0].parentElement.innerHTML="<span>JavaScript<i class=\"icn-arrow-down\"></i></span>";
+    document.getElementById("snippet_type_id-193").checked=true;
+})();