Socket
Socket
Sign inDemoInstall

impress

Package Overview
Dependencies
19
Maintainers
1
Versions
718
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.2 to 0.0.3

examples/copyContentToProjectFolder/sites/localhost/hmenu.everyone.template

2

examples/copyContentToProjectFolder/setup.js

@@ -1,4 +0,4 @@

require('lib/impress');
require('impress');
impress.openDatabases(function() {
impress.prepareDataStructures();
});

@@ -7,5 +7,6 @@ module.exports = function(req, res, callback) {

{ name: "dima", age: 32, emails: ["user3@gmail.com", "user4@gmail.com", "user5@gmail.com"] },
]
],
session: JSON.stringify(impress.sessions[req.impress.session])
};
callback();
}

@@ -0,2 +1,10 @@

0.0.3 / 2010-06-11
==================
* Added template specialization for user groups. Fixed method impress.template().
* If there is active session, Impress will search for file templateName.groupName.template
* If no group name specified it will search for templateName.everyone.template
* If no such file found it will take templateName.template
* If no such file found it will look into parent directory
0.0.2 / 2010-06-10

@@ -3,0 +11,0 @@ ==================

@@ -44,4 +44,6 @@ (function(impress) {

// to be implemented following structure: {
// user: id, // optional: null of userId, if session assigned to user
// sse: [], // active SSE connections
// userId: int, // optional: null of userId, if session assigned to user
// login: string,
// group: string,
// sse: [], // active SSE connections
// }

@@ -683,3 +685,5 @@

impress.template = function(req, res, data, file, cursor, callback) { // callback(tpl)
var fileName = file+'.template',
var userGroup = '';
if (req.impress.session) userGroup = '.'+(impress.sessions[req.impress.session].group || 'everyone');
var fileName = file+userGroup+'.template',
filePath = req.impress.hostDir+lastSlash(req.impress.path)+fileName;

@@ -697,14 +701,30 @@ fileInclude = impress.cache.files[filePath];

} else {
// Try to find template in parent directory
if ((req.impress.path != '/') && (req.impress.path != '.')) {
req.impress.path = impress.path.dirname(req.impress.path);
impress.template(req, res, data, file, cursor, callback);
impress.watchCache(req.impress.hostDir+req.impress.path+(req.impress.path.endsWith("/") ? "" : "/"));
} else {
// Lose hope to fine template and cave cache
var fileOriginal = req.impress.hostDir+lastSlash(req.impress.url)+fileName;
impress.cache.files[fileOriginal] = "{{FILE_NOT_FOUND}}";
impress.watchCache(fileOriginal);
callback('No handler found');
}
// Try to find template without group name
fileName = file+'.template',
filePath = req.impress.hostDir+lastSlash(req.impress.path)+fileName;
fileInclude = impress.cache.files[filePath];
if (fileInclude) {
if (fileInclude != "{{FILE_NOT_FOUND}}") impress.include(req, res, data, fileInclude, cursor, callback);
else callback('[ Error: template not found "'+file+'" ]');
} else impress.fs.exists(filePath, function(exists) {
if (exists) {
impress.include(req, res, data, filePath, cursor, callback);
var fileOriginal = req.impress.hostDir+lastSlash(req.impress.url)+fileName;
impress.cache.files[fileOriginal] = filePath;
impress.watchCache(fileOriginal);
} else {
// Try to find template in parent directory
if ((req.impress.path != '/') && (req.impress.path != '.')) {
req.impress.path = impress.path.dirname(req.impress.path);
impress.template(req, res, data, file, cursor, callback);
impress.watchCache(req.impress.hostDir+req.impress.path+(req.impress.path.endsWith("/") ? "" : "/"));
} else {
// Lose hope to fine template and cave cache
var fileOriginal = req.impress.hostDir+lastSlash(req.impress.url)+fileName;
impress.cache.files[fileOriginal] = "{{FILE_NOT_FOUND}}";
impress.watchCache(fileOriginal);
callback('No handler found');
}
}
});
}

@@ -711,0 +731,0 @@ });

{
"name": "impress",
"version": "0.0.2",
"version": "0.0.3",
"author": "Timur Shemsedinov <timur.shemsedinov@gmail.com>",

@@ -5,0 +5,0 @@ "description": "Impressive totalitarian style web application framework",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc