Skip to content

Instantly share code, notes, and snippets.

@hklcf
Last active May 7, 2016 06:06
Show Gist options
  • Save hklcf/e8583242b6af081df1e57bbbc058f60c to your computer and use it in GitHub Desktop.
Save hklcf/e8583242b6af081df1e57bbbc058f60c to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Ctrl+Enter for HKGalden
// @version 0.1
// @description add Ctrl+Enter function for HKGalden
// @include http://www.hkgalden.com/*
// @include https://www.hkgalden.com/*
// @match http://www.hkgalden.com/*
// @match https://www.hkgalden.com/*
// @author 超膠
// ==/UserScript==
var load,execute,loadAndExecute;load=function(a,b,c){var d;d=document.createElement("script"),d.setAttribute("src",a),b!=null&&d.addEventListener("load",b),c!=null&&d.addEventListener("error",c),document.body.appendChild(d);return d},execute=function(a){var b,c;typeof a=="function"?b="("+a+")();":b=a,c=document.createElement("script"),c.textContent=b,document.body.appendChild(c);return c},loadAndExecute=function(a,b){return load(a,function(){return execute(b)})};
loadAndExecute("//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js", function() {
$('#fast_reply').keydown(function (e) {
if (e.ctrlKey && e.keyCode == 13) {
$("#submit_fast_reply").click();
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment