<commit_before>define( [ "Ember" ], function( Ember ) {

	var get = Ember.get;

	return Ember.Component.extend({
		tagName: "a",
		classNameBindings: [ ":external-link" ],
		attributeBindings: [ "href" ],

		href: "#",

		action: "openBrowser",

		click: function( e ) {
			e.preventDefault();
			e.stopImmediatePropagation();
			this.sendAction( "action", get( this, "url" ) );
		},

		didInsertElement: function() {
			this._super.apply( this, arguments );
			this.$().on( "click", function( e ) {
				if ( e.button !== 0 ) {
					e.preventDefault();
					e.stopImmediatePropagation();
				}
			});
		}
	});

});<commit_msg>Add contextmenu to ExternalLinkComponent<commit_after>define([
	"Ember",
	"nwjs/menu",
	"nwjs/clipboard"
], function(
	Ember,
	Menu,
	clipboard
) {

	var get = Ember.get;

	return Ember.Component.extend({
		tagName: "a",
		classNameBindings: [ ":external-link" ],
		attributeBindings: [ "href" ],

		href: "#",

		action: "openBrowser",

		click: function( event ) {
			event.preventDefault();
			event.stopImmediatePropagation();
		},

		contextMenu: function( event ) {
			if ( this.attrs.noContextmenu ) { return; }

			var menu = Menu.create();

			menu.items.pushObjects([
				{
					label: "Open URL",
					click: this.openURL.bind( this )
				},
				{
					label: "Copy URL",
					click: this.copyURL.bind( this )
				}
			]);

			menu.popup( event.originalEvent.x, event.originalEvent.y );
		},

		openURL: function() {
			var url = get( this, "url" );
			this.sendAction( "action", url );
		},

		copyURL: function() {
			var url = get( this, "url" );
			clipboard.set( url );
		},

		didInsertElement: function() {
			this._super.apply( this, arguments );
			this.$().on( "click", function( e ) {
				if ( e.button !== 0 ) {
					e.preventDefault();
					e.stopImmediatePropagation();
				}
			});
		}
	});

});
{'fraction_non_alphanumeric': 0.1797509474824039, 'fraction_numerical': 0.0010828370330265296, 'mean_word_length': 2.9741935483870967, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6334892', 'n_tokens_mistral': 781, 'n_tokens_neox': 645, 'n_words': 130}