Last active
September 8, 2015 23:05
-
-
Save chancancode/a92d7a68d438d7acdfa2 to your computer and use it in GitHub Desktop.
<link-supressor>
This file contains 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
import Ember from 'ember'; | |
export default Ember.GlimmerComponent.extend({ | |
click(event) { | |
var pattern = new RegExp(this.attrs.pattern || ".*"); | |
var href = (event.target.tagName === "A") && (event.target.href); | |
if (href && pattern.test(href)) { | |
alert(this.attrs.message || "Link blocked!"); | |
event.preventDefault(); | |
} | |
} | |
}); |
This file contains 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
{ | |
"version": "0.4.10", | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"hax": "https://cdn.rawgit.com/chancancode/5b7b95b6268d51cdcaae/raw/92e0654083305c73cd601381a6cea705be9f8890/hax.js", | |
"ember": "http://builds.emberjs.com/canary/ember.debug.js", | |
"ember-template-compiler": "http://builds.emberjs.com/canary/ember-template-compiler.js" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment