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

can-legacy-view-helpers

Package Overview
Dependencies
Maintainers
3
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

can-legacy-view-helpers - npm Package Compare versions

Comparing version 0.2.0 to 0.5.0

.travis.yml

25

package.json
{
"name": "can-legacy-view-helpers",
"version": "0.2.0",
"version": "0.5.0",
"description": "Legacy view helpers used by can-ejs and can-mustache.",

@@ -20,12 +20,10 @@ "license": "MIT",

"scripts": {
"preversion": "npm test && npm run build",
"version": "git commit -am \"Update dist for release\" && git checkout -b release && git add -f dist/",
"postversion": "git push --tags && git checkout master && git branch -D release && git push",
"testee": "testee src/test/test.html --browsers firefox",
"preversion": "npm test",
"testee": "testee test/test.html --browsers firefox",
"test": "npm run jshint && npm run testee",
"jshint": "jshint src/. --config",
"release:pre": "npm version pre && npm publish",
"release:patch": "npm version patch && npm publish",
"release:minor": "npm version minor && npm publish",
"release:major": "npm version major && npm publish",
"build": "node build.js",
"document": "documentjs",

@@ -51,5 +49,2 @@ "develop": "can-serve --static --develop --port 8080"

"main": "can-legacy-view-helpers",
"directories": {
"lib": "src/"
},
"configDependencies": [

@@ -67,4 +62,8 @@ "live-reload"

"dependencies": {
"can": "canjs/canjs#major",
"jquery": "~2.2.1"
"can-compute": "^3.0.0-pre.19",
"can-event": "^3.0.0-pre.17",
"can-util": "^3.0.0-pre.68",
"can-view-callbacks": "^3.0.0-pre.9",
"can-view-live": "^3.0.0-pre.5",
"can-view-parser": "^3.0.0-pre.7"
},

@@ -75,5 +74,5 @@ "devDependencies": {

"cssify": "^0.6.0",
"steal": "^0.14.0",
"steal": "^0.16.0",
"steal-qunit": "^0.1.1",
"steal-tools": "^0.14.0",
"steal-tools": "^0.16.0",
"testee": "^0.2.4",

@@ -80,0 +79,0 @@ "generator-donejs": "^0.7.0",

@@ -1,6 +0,7 @@

import can from "can/view/";
import elements from "can/view/elements";
import live from "can/view/live/";
import "can/util/string/";
var view = require("./view");
var elements = require("./elements");
var string = require("can-util/js/string/string");
var deepAssign = require("can-util/js/deep-assign/deep-assign");
var canCompute = require("can-compute");
var live = require("./live");
/**

@@ -44,3 +45,3 @@ * Helper(s)

if (tag) {
return "<" + tag + " " + can.view.hook(hook) + "></" + tag + ">";
return "<" + tag + " " + view.hook(hook) + "></" + tag + ">";
} else {

@@ -59,3 +60,3 @@ pendingHookups.push(hook);

return (typeof txt === 'string' || typeof txt === 'number') ?
can.esc(txt) :
string.esc(txt) :
contentText(txt, tag);

@@ -70,5 +71,6 @@ },

can.extend(can.view, {
deepAssign(view, {
contentText: contentText,
live: live,
// called in text to make a temporary
// called in text to make a temporary
// can.view.lists function that can be called with

@@ -79,6 +81,6 @@ // the list to iterate over and the template

var old = can.view.lists,
var old = view.lists,
data;
can.view.lists = function (list, renderer) {
view.lists = function (list, renderer) {
data = {

@@ -92,3 +94,3 @@ list: list,

return function () {
can.view.lists = old;
view.lists = old;
return data;

@@ -161,6 +163,6 @@ };

// Sets up a listener so we know any can.view.lists called
// Sets up a listener so we know any can.view.lists called
// when func is called
var listTeardown = can.view.setupLists();
//
var listTeardown = view.setupLists();
//
unbind = function () {

@@ -170,4 +172,4 @@ compute.unbind("change", emptyHandler);

// Create a compute that calls func and looks for dependencies.
// By passing `false`, this compute can not be a dependency of other
// computes. This is because live-bits are nested, but
// By passing `false`, this compute can not be a dependency of other
// computes. This is because live-bits are nested, but
// handle their own updating. For example:

@@ -177,3 +179,3 @@ // {{#if items.length}}{{#items}}{{.}}{{/items}}{{/if}}

// `{{#items}}` text changes.
compute = can.compute(func, self, false);
compute = canCompute(func, self, false);

@@ -198,3 +200,3 @@ // Bind to get and temporarily cache the value of the compute.

unbind();
return "<" + tag + can.view.hook(function (el, parentNode) {
return "<" + tag + view.hook(function (el, parentNode) {
live.list(el, listData.list, listData.renderer, self, parentNode);

@@ -220,6 +222,6 @@ }) + "></" + tag + ">";

// Return an element tag with a hookup in place of the content
return "<" + tag + can.view.hook(
return "<" + tag + view.hook(
// if value is an object, it's likely something returned by .safeString
escape && typeof value !== "object" ?
// If we are escaping, replace the parentNode with
// If we are escaping, replace the parentNode with
// a text node who's value is `func`'s return value.

@@ -270,2 +272,2 @@ function (el, parentNode) {

export default can;
module.exports = view;
/**
* This module must be CJS format because is uses `with () { ... }`
* This module must be CJS format because is uses `with () { ... }`
* statements which will not work in ES6 since it forces strict mode.
*/
var can = require("can/view/");
var elements = require("can/view/elements");
var viewCallbacks = require("can/view/callbacks/");
var elements = require("./elements");
var viewCallbacks = require("can-view-callbacks");
var deepAssign = require("can-util/js/deep-assign/deep-assign");
var view = require("./view");
var each = require("can-util/js/each/each");
/**

@@ -97,5 +98,5 @@ * Helper(s)

can.view.Scanner = Scanner = function (options) {
var Scanner = function (options) {
// Set options on self
can.extend(this, {
deepAssign(this, {
/**

@@ -336,3 +337,3 @@ * @typedef {{start: String, escape: String, scope: String, options: String}} can.view.Scanner.text

'"', clean(content), '"',
",can.view.pending({tagName:'" + tagName + "'," + (attrs) + "scope: " + (this.text.scope || "this") + this.text.options);
",CAN_LEGACY_HELPERS.view.pending({tagName:'" + tagName + "'," + (attrs) + "scope: " + (this.text.scope || "this") + this.text.options);

@@ -345,3 +346,3 @@ // if it's a self closing tag (like <content/>) close and end the tag

}
// if it's an empty tag
// if it's an empty tag
else if (tokens[i] === "<" && tokens[i + 1] === "/" + tagName) {

@@ -359,3 +360,3 @@ buff.push("}));");

// make sure / of /> is on the right of pending
var pendingPart = ",can.view.pending({" + attrs + "scope: " + (this.text.scope || "this") + this.text.options + "}),\"";
var pendingPart = ",CAN_LEGACY_HELPERS.view.pending({" + attrs + "scope: " + (this.text.scope || "this") + this.text.options + "}),\"";
if (emptyElement) {

@@ -421,3 +422,3 @@ put(content.substr(0, content.length - 1), pendingPart + "/>\"");

buff.push(insert_cmd, "can.view.txt(2,'" + getTag(tagName, tokens, i) + "'," + _status() + ",this,function(){", startTxt);
buff.push(insert_cmd, "CAN_LEGACY_HELPERS.view.txt(2,'" + getTag(tagName, tokens, i) + "'," + _status() + ",this,function(){", startTxt);
put(attrName + "=" + token);

@@ -503,4 +504,4 @@ break;

if (bracketCount === 1) {
// We are starting on.
buff.push(insert_cmd, 'can.view.txt(0,\'' + getTag(tagName, tokens, i) + '\',' + _status() + ',this,function(){', startTxt, content);
// We are starting on.
buff.push(insert_cmd, 'CAN_LEGACY_HELPERS.view.txt(0,\'' + getTag(tagName, tokens, i) + '\',' + _status() + ',this,function(){', startTxt, content);
endStack.push({

@@ -571,3 +572,3 @@ before: "",

if (content.startTxt && content.end && specialAttribute) {
buff.push(insert_cmd, "can.view.toStr( ",content.content, '() ) );');
buff.push(insert_cmd, "CAN_LEGACY_HELPERS.view.toStr( ",content.content, '() ) );');

@@ -577,6 +578,6 @@ } else {

if (content.startTxt) {
buff.push(insert_cmd, "can.view.txt(\n" +
buff.push(insert_cmd, "CAN_LEGACY_HELPERS.view.txt(\n" +
(typeof _status() === "string" || (content.escaped != null ? content.escaped : escaped)) + ",\n'" + tagName + "',\n" + _status() + ",\nthis,\n");
} else if (content.startOnlyTxt) {
buff.push(insert_cmd, 'can.view.onlytxt(this,\n');
buff.push(insert_cmd, 'CAN_LEGACY_HELPERS.view.onlytxt(this,\n');
}

@@ -596,5 +597,5 @@ buff.push(content.content);

// If we have `<%== a(function(){ %>` then we want
// `can.EJS.text(0,this, function(){ return a(function(){ var _v1ew = [];`.
// `CAN_LEGACY_HELPERS.EJS.text(0,this, function(){ return a(function(){ var _v1ew = [];`.
buff.push(insert_cmd, "can.view.txt(\n" + (typeof _status() === "string" || escaped) +
buff.push(insert_cmd, "CAN_LEGACY_HELPERS.view.txt(\n" + (typeof _status() === "string" || escaped) +
",\n'" + tagName + "',\n" + _status() + ",\nthis,\nfunction(){ " +

@@ -667,9 +668,9 @@ (this.text.escape || '') +

// This is called when there is a special tag
can.view.pending = function (viewData) {
view.pending = function (viewData) {
// we need to call any live hookups
// so get that and return the hook
// a better system will always be called with the same stuff
var hooks = can.view.getHooks();
return can.view.hook(function (el) {
can.each(hooks, function (fn) {
var hooks = view.getHooks();
return view.hook(function (el) {
each(hooks, function (fn) {
fn(el);

@@ -682,3 +683,3 @@ });

can.each(viewData && viewData.attrs || [], function (attributeName) {
each(viewData && viewData.attrs || [], function (attributeName) {
viewData.attributeName = attributeName;

@@ -695,8 +696,5 @@ var callback = viewCallbacks.attr(attributeName);

can.view.tag("content", function (el, tagData) {
return tagData.scope;
});
can.view.Scanner = Scanner;
view.Scanner = Scanner;
module.exports = Scanner;

Sorry, the diff of this file is not supported yet

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