Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

space-pen

Package Overview
Dependencies
Maintainers
3
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

space-pen - npm Package Compare versions

Comparing version 4.2.0 to 4.2.1

34

api.json

@@ -7,3 +7,3 @@ {

"filename": "src/space-pen.coffee",
"srcUrl": "https://github.com/atom/space-pen/blob/v4.2.0/src/space-pen.coffee#L74",
"srcUrl": "https://github.com/atom/space-pen/blob/v4.2.1/src/space-pen.coffee#L75",
"sections": [],

@@ -14,3 +14,3 @@ "classMethods": [

"sectionName": null,
"srcUrl": "https://github.com/atom/space-pen/blob/v4.2.0/src/space-pen.coffee#L84",
"srcUrl": "https://github.com/atom/space-pen/blob/v4.2.1/src/space-pen.coffee#L85",
"visibility": "Public",

@@ -37,3 +37,3 @@ "summary": "Add the given subview wired to an outlet with the given name",

"sectionName": null,
"srcUrl": "https://github.com/atom/space-pen/blob/v4.2.0/src/space-pen.coffee#L90",
"srcUrl": "https://github.com/atom/space-pen/blob/v4.2.1/src/space-pen.coffee#L91",
"visibility": "Public",

@@ -54,3 +54,3 @@ "summary": "Add a text node with the given text content",

"sectionName": null,
"srcUrl": "https://github.com/atom/space-pen/blob/v4.2.0/src/space-pen.coffee#L96",
"srcUrl": "https://github.com/atom/space-pen/blob/v4.2.1/src/space-pen.coffee#L97",
"visibility": "Public",

@@ -77,3 +77,3 @@ "summary": "Add a new tag with the given name",

"sectionName": null,
"srcUrl": "https://github.com/atom/space-pen/blob/v4.2.0/src/space-pen.coffee#L101",
"srcUrl": "https://github.com/atom/space-pen/blob/v4.2.1/src/space-pen.coffee#L102",
"visibility": "Public",

@@ -94,27 +94,5 @@ "summary": "Add new child DOM nodes from the given raw HTML string.",

{
"name": "command",
"sectionName": null,
"srcUrl": "https://github.com/atom/space-pen/blob/v4.2.0/src/space-pen.coffee#L202",
"visibility": "Public",
"summary": "Register a command handler on this element.",
"description": "Register a command handler on this element.\n\nThis method registers a command listener for this element on the Atom\ncommand registry",
"arguments": [
{
"name": "commandName",
"description": "A namespaced {String} describing the command, such as `find-and-replace:toggle`.",
"type": "String",
"isOptional": false
},
{
"name": "handler",
"description": "A {Function} to execute when the command is triggered. ",
"type": "Function",
"isOptional": false
}
]
},
{
"name": "preempt",
"sectionName": null,
"srcUrl": "https://github.com/atom/space-pen/blob/v4.2.0/src/space-pen.coffee#L209",
"srcUrl": "https://github.com/atom/space-pen/blob/v4.2.1/src/space-pen.coffee#L199",
"visibility": "Public",

@@ -121,0 +99,0 @@ "summary": "Preempt events registered with jQuery's `::on`.",

70

lib/space-pen.js
(function() {
var $, Builder, CustomElementPrototype, Events, SelfClosingTags, Tags, View, docEl, exports, idCounter, jQuery, matches, matchesSelector, registerElement, _,
var $, Builder, CustomElementPrototype, Events, Grim, JQueryEventAdd, JQueryTrigger, SelfClosingTags, Tags, View, docEl, exports, idCounter, jQuery, matches, matchesSelector, registerElement, _,
__hasProp = {}.hasOwnProperty,

@@ -10,2 +10,3 @@ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },

$ = jQuery = require('../vendor/jquery');
Grim = require('grim');
} else {

@@ -67,3 +68,3 @@ _ = window._, jQuery = window.jQuery;

_base[customTagName] = typeof document.registerElement === "function" ? document.registerElement(customTagName, {
prototype: CustomElementPrototype,
prototype: Object.create(CustomElementPrototype),
"extends": tagName

@@ -247,6 +248,2 @@ }) : void 0;

View.prototype.command = function(commandName, handler) {
return View.__super__.command.call(this, commandName, handler);
};
View.prototype.preempt = function(eventName, handler) {

@@ -538,11 +535,2 @@ return View.__super__.preempt.call(this, eventName, handler);

$.fn.command = function(eventName, handler) {
var _this = this;
if (this.length > 0) {
return atom.commands.add(this[0], eventName, function(event) {
return handler.call(_this, $.event.fix(event));
});
}
};
$.fn.iconSize = function(size) {

@@ -566,2 +554,54 @@ return this.width(size).height(size).css('font-size', size);

View.prototype.subscribe = function() {
var message, _ref;
message = "The `::subscribe` method is no longer available on SpacePen views.\n\n";
if (arguments.length === 1) {
message += "To store multiple subscription objects for later disposal, add them to a\n`CompositeDisposable` instance (https://atom.io/docs/api/v0.150.0/CompositeDisposable)\nand call `.dispose()` on it explicitly in this view's `::detached` hook.";
} else {
if ((_ref = arguments[0]) != null ? _ref.jquery : void 0) {
message += "To subscribe to events on a jQuery object, use the traditional `::on` and\n`::off methods`.";
} else {
message += "To subscribe to events on an Atom object, use an explicit event-subscription\nmethod (starting with ::onDid* or ::onWill*).\n\nTo collect multiple subscription objects for later disposal, add them to a\n`CompositeDisposable` instance:\nhttps://atom.io/docs/api/v0.150.0/CompositeDisposable\n\nCall `.dispose()` on your `CompositeDisposable` in this view's `::detached` hook.";
}
}
throw new Error(message);
};
View.prototype.subscribeToCommand = function() {
throw new Error("The `::subscribeToCommand` method is no longer available on SpacePen views.\"\n\nPlease subscribe to commands via `atom.commands.add`:\nhttps://atom.io/docs/api/latest/CommandRegistry#instance-add\n\nCollect the returned subscription objects in a CompositeDisposable:\nhttps://atom.io/docs/api/latest/CompositeDisposable\n\nCall `.dispose()` on your `CompositeDisposable` in this view's `::detached` hook.");
};
$.fn.command = function(eventName, handler) {
throw new Error("The `::command` method is no longer available on SpacePen views.\"\n\nPlease subscribe to commands via `atom.commands.add`:\nhttps://atom.io/docs/api/latest/CommandRegistry#instance-add\n\nCollect the returned subscription objects in a CompositeDisposable:\nhttps://atom.io/docs/api/latest/CompositeDisposable\n\nCall `.dispose()` on your `CompositeDisposable` in this view's `::detached` hook.");
};
JQueryEventAdd = jQuery.event.add;
jQuery.event.add = function(elem, types, handler, data, selector) {
if (/\:/.test(types)) {
if (Grim != null) {
Grim.deprecate("Are you trying to listen for an Atom command with `jQuery::on`?\n`jQuery::trigger` can no longer be used to listen for Atom commands. Please\nuse `atom.commands.add` instead. See the docs at\nhttps://atom.io/docs/api/latest/CommandRegistry#instance-add for details.");
}
}
return JQueryEventAdd.call(this, elem, types, handler, data, selector);
};
JQueryTrigger = $.fn.trigger;
$.fn.trigger = function(eventName, data) {
if (typeof eventName === 'string' && /\:/.test(eventName)) {
return Grim != null ? Grim.deprecate("Are you trying to dispatch an Atom command with `jQuery::trigger`?\n`jQuery::trigger` can no longer emit Atom commands as it will not correctly route\nthe command to its handlers. Please use `atom.commands.dispatch` instead.\nSee the docs at https://atom.io/docs/api/latest/CommandRegistry#instance-dispatch\nfor details.") : void 0;
} else {
return JQueryTrigger.call(this, eventName, data);
}
};
$.fn.setTooltip = function() {
throw new Error("setTooltip is no longer available. Please use `atom.tooltips.add` instead.\nSee the docs at https://atom.io/docs/api/latest/TooltipManager#instance-add");
};
$.fn.destroyTooltip = $.fn.hideTooltip = function() {
throw new Error("destroyTooltip is no longer available. Please dispose the object returned\nfrom `atom.tooltips.add` instead.\nSee the docs at https://atom.io/docs/api/latest/TooltipManager#instance-add");
};
exports = exports != null ? exports : this;

@@ -568,0 +608,0 @@

{
"name": "space-pen",
"version": "4.2.0",
"version": "4.2.1",
"description": "Write markup on the final frontier",

@@ -39,4 +39,5 @@ "main": "./lib/space-pen.js",

"dependencies": {
"grim": "^0.12.0",
"underscore-plus": "1.x"
}
}
# SpacePen [![Build Status](https://travis-ci.org/atom/space-pen.svg?branch=master)](https://travis-ci.org/atom/space-pen)
**Version 4.x of SpacePen is intended to be included as a direct dependency of 1.0-compatible Atom packages. If you're looking for SpacePen 3.x, used in [Atom Core](https://github.com/atom/atom), check out the [3.x branch](https://github.com/atom/space-pen/tree/3.x).**
## Write markup on the final frontier

@@ -4,0 +6,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc