Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
frameworkless-view
Advanced tools
A simple view-presenter module for frameworkless.
bower:
bower install frameworkless-view
# copy the stuff you want
cp bower_components/frameworkless-view/dist/view.js src/lib
npm:
npm install frameworkless-view
# copy the stuff you want
cp node_modules/frameworkless-view/dist/view.js src/lib
Get started right away, so you can disassemble and play around at your lesure.
# Clone frameworkless-view
git clone git@github.com:synacorinc/frameworkless-view.git
# Install development dependencies
npm install
# Build the library
npm run-script build # or just `grunt` if you have grunt-cli installed globally
# Check out the demo
PORT=8080 npm start # this just does `node server.js`
require(['view'], function(view) {
// We're using Handlebars templates:
var template = '<h1>{{{title}}}</h1> <button id="hi">Click Me</button>';
// Instantiate a view:
var page = view( template );
// Wire up some events:
page.hookEvents({
'click button#hi' : function() {
alert( 'Title: ' + page.$$('h1').textContent );
}
});
// Insert the view into the DOM:
page.insertInto( document.body );
});
var view = require('view');
var list = view({
template : '<ul> {{#items}}<li>{{.}}</li>{{/items}} </ul>',
events : {
'click li' : 'clickItem'
},
// a delegated event handler
clickItem : function(e) {
console.log(e.delegationTarget.getAttribute('title'));
}
};
// insert into a parent node:
list.insertInto(document.body);
// template some data:
list.render({
items : [ 'Peach', 'Mango', 'Orange' ]
});
define([
'view',
'text!templates/index.html' // just an HTML file
], function(view, template) {
var page = {
events : {
'click #submit' : 'submit',
'mouseover .tip' : 'showTip'
},
submit : function() {
this.view.$$('form').subimt();
},
showTip : function(e) {
var tip = this.view.$$('#tip');
tip.textContent = e.delegationTarget.getAttribute('title');
tip.style.display = '';
},
load : function(params, router) {
if (!this.view) {
// initialize a view:
this.view = view(template);
// wire up event handlers:
this.view.hookEvents(this.events, this);
}
// Template some data into the view:
this.view.template({
title : 'Test Title',
params : params
});
// insert view into DOM:
this.view.insertInto(document.body);
},
unload : function() {
// remove view from DOM:
this.view.remove();
}
};
return page;
});
/src
is where the source code lives/dist
is the built library/demo
is a simple demo, using requirejsBSD
FAQs
A View-Presenter implementation for Frameworkless.
The npm package frameworkless-view receives a total of 6 weekly downloads. As such, frameworkless-view popularity was classified as not popular.
We found that frameworkless-view demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.