transplanted mini_poem for irext
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
* 2015-01-24
|
* 2015-01-24
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require('../minipoem/configuration/constants');
|
require('../mini_poem/configuration/constants');
|
||||||
var Cache = require('../mini_poem/cache/redis.js');
|
var Cache = require('../mini_poem/cache/redis.js');
|
||||||
var Enums = require('../constants/enums');
|
var Enums = require('../constants/enums');
|
||||||
var ErrorCode = require('../constants/error_code');
|
var ErrorCode = require('../constants/error_code');
|
||||||
|
|||||||
120
src/web_console/mini_poem/mem/map.js
Normal file
120
src/web_console/mini_poem/mem/map.js
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
/*
|
||||||
|
* Created by Strawmanbobi
|
||||||
|
* 2014-08-30
|
||||||
|
*/
|
||||||
|
|
||||||
|
function Map() {
|
||||||
|
this.elements = [];
|
||||||
|
|
||||||
|
this.size = function() {
|
||||||
|
return this.elements.length;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.isEmpty = function() {
|
||||||
|
return (this.elements.length < 1);
|
||||||
|
};
|
||||||
|
|
||||||
|
this.clear = function() {
|
||||||
|
this.elements = [];
|
||||||
|
};
|
||||||
|
|
||||||
|
this.put = function(_key, _value) {
|
||||||
|
this.elements.push( {
|
||||||
|
key : _key,
|
||||||
|
value : _value
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.remove = function(_key) {
|
||||||
|
var bln = false;
|
||||||
|
try {
|
||||||
|
for (i = 0; i < this.elements.length; i++) {
|
||||||
|
if (this.elements[i].key == _key) {
|
||||||
|
this.elements.splice(i, 1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
bln = false;
|
||||||
|
}
|
||||||
|
return bln;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.get = function(_key) {
|
||||||
|
try {
|
||||||
|
for (i = 0; i < this.elements.length; i++) {
|
||||||
|
if (this.elements[i].key == _key) {
|
||||||
|
return this.elements[i].value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.set = function(_key, _value) {
|
||||||
|
for(i = 0; i < this.elements.length; i++) {
|
||||||
|
if (this.elements[i].key == _key) {
|
||||||
|
this.elements[i].value = _value;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.elements.push({
|
||||||
|
key : _key,
|
||||||
|
value : _value
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.element = function(_index) {
|
||||||
|
if (_index < 0 || _index >= this.elements.length) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return this.elements[_index];
|
||||||
|
};
|
||||||
|
|
||||||
|
this.containsKey = function(_key) {
|
||||||
|
var bln = false;
|
||||||
|
try {
|
||||||
|
for (i = 0; i < this.elements.length; i++) {
|
||||||
|
if (this.elements[i].key == _key) {
|
||||||
|
bln = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
bln = false;
|
||||||
|
}
|
||||||
|
return bln;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.containsValue = function(_value) {
|
||||||
|
var bln = false;
|
||||||
|
try {
|
||||||
|
for (i = 0; i < this.elements.length; i++) {
|
||||||
|
if (this.elements[i].value == _value) {
|
||||||
|
bln = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
bln = false;
|
||||||
|
}
|
||||||
|
return bln;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.values = function() {
|
||||||
|
var arr = [];
|
||||||
|
for (i = 0; i < this.elements.length; i++) {
|
||||||
|
arr.push(this.elements[i].value);
|
||||||
|
}
|
||||||
|
return arr;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.keys = function() {
|
||||||
|
var arr = [];
|
||||||
|
for (i = 0; i < this.elements.length; i++) {
|
||||||
|
arr.push(this.elements[i].key);
|
||||||
|
}
|
||||||
|
return arr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = Map;
|
||||||
@@ -44,4 +44,13 @@ npm install nodemailer@0.7
|
|||||||
echo "npm install node-mysql"
|
echo "npm install node-mysql"
|
||||||
npm install mysql
|
npm install mysql
|
||||||
|
|
||||||
|
echo "npm install redis"
|
||||||
|
npm install redis
|
||||||
|
|
||||||
echo "npm install done"
|
echo "npm install done"
|
||||||
|
|
||||||
|
echo "create logging directory"
|
||||||
|
mkdir -p logs
|
||||||
|
mkdir -p logs/production
|
||||||
|
mkdir -p logs/dev
|
||||||
|
mkdir -p logs/user_debug
|
||||||
|
|||||||
4
src/web_console/web/public_js/script_bower.sh
Normal file → Executable file
4
src/web_console/web/public_js/script_bower.sh
Normal file → Executable file
@@ -3,7 +3,7 @@
|
|||||||
echo "running script of bower install needed by irext..."
|
echo "running script of bower install needed by irext..."
|
||||||
|
|
||||||
echo "npm install bower -g"
|
echo "npm install bower -g"
|
||||||
npm install bower -g
|
sudo npm install bower -g
|
||||||
|
|
||||||
echo "bower install toastr"
|
echo "bower install toastr"
|
||||||
bower install toastr --allow-root
|
bower install toastr --allow-root
|
||||||
@@ -20,4 +20,4 @@ bower install select2 --allow-root
|
|||||||
echo "bower install bootstrap-spinner"
|
echo "bower install bootstrap-spinner"
|
||||||
bower install bootstrap-spinner --allow-root
|
bower install bootstrap-spinner --allow-root
|
||||||
|
|
||||||
echo "bower install done"
|
echo "bower install done"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ var Constants = require('../mini_poem/configuration/constants');
|
|||||||
|
|
||||||
var Admin = require('../model/admin_dao.js');
|
var Admin = require('../model/admin_dao.js');
|
||||||
var AdminAuth = require('../authority/admin_auth.js');
|
var AdminAuth = require('../authority/admin_auth.js');
|
||||||
var MD5 = require('../mini_poem/security/md5.js');
|
var MD5 = require('../mini_poem/crypto/md5.js');
|
||||||
var StringUtils = require('../mini_poem/utils/string_utils.js');
|
var StringUtils = require('../mini_poem/utils/string_utils.js');
|
||||||
var nodemailer = require('nodemailer');
|
var nodemailer = require('nodemailer');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user