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

@htmlguyllc/jpack

Package Overview
Dependencies
Maintainers
1
Versions
191
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@htmlguyllc/jpack - npm Package Compare versions

Comparing version 0.5.12 to 0.5.13

2

package.json
{
"name": "@htmlguyllc/jpack",
"version": "0.5.12",
"version": "0.5.13",
"description": "Core Javascript Library of Everyday Objects, Events, and Utilities",

@@ -5,0 +5,0 @@ "keywords": [

@@ -152,46 +152,2 @@ import axios from 'axios';

/**
* Allows you to insert the form wherever you want on the page
* Override this method to customize where the form is inserted
* (maybe you want to open a modal first and place it there?)
*
* parsed_content.html will always be the HTML
*
* parsed_content may contain other data like route and title if the form was pulled out of
* a full HTML page which contains those items
*
* response is the full server response (html string or object from JSON - not provided if the response is only the form's HTML)
*
* form is provided if this is after the form was submitted and HTML was returned form the server
*
* @param parsed_content
* @param response
* @param form
* @returns {*|Element|HTMLDocument}
*/
this.insertForm = function(parsed_content, response, form) {
//selector for where the form will go
let el = this.getInsertIntoElement();
//if not provided
if( el === null ) throw 'Cannot determine where to insert form. Overwrite insertForm() or provide insertIntoElement';
//get the container element - error if not found
el = dom.getElement(el, true);
//put the form in the container element
el.innerHTML = parsed_content.html;
//find the newly added form
form = el.querySelector('form');
//attach an on-submit listener to send the form's values via XHR
this.attachSubmitHandler(form);
//run the onload callback now that the form is there
this.triggerOnload()();
return el;
};
/**
* Use this method to modify the form immediately after it's displayed

@@ -462,2 +418,47 @@ *

}
};
/**
* Allows you to insert the form wherever you want on the page
* Override this method to customize where the form is inserted
* (maybe you want to open a modal first and place it there?)
*
* parsed_content.html will always be the HTML
*
* parsed_content may contain other data like route and title if the form was pulled out of
* a full HTML page which contains those items
*
* response is the full server response (html string or object from JSON - not provided if the response is only the form's HTML)
*
* form is provided if this is after the form was submitted and HTML was returned form the server
*
* @param parsed_content
* @param response
* @param form
* @returns {*|Element|HTMLDocument}
*/
form.fromURL.prototype.insertForm = function(parsed_content, response, form) {
//selector for where the form will go
let el = this.getInsertIntoElement();
//if not provided
if( el === null ) throw 'Cannot determine where to insert form. Overwrite insertForm() or provide insertIntoElement';
//get the container element - error if not found
el = dom.getElement(el, true);
//put the form in the container element
el.innerHTML = parsed_content.html;
//find the newly added form
form = el.querySelector('form');
//attach an on-submit listener to send the form's values via XHR
this.attachSubmitHandler(form);
//run the onload callback now that the form is there
this.triggerOnload()();
return el;
};
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