From 312fb5729ae43e3d45e7b189caa5f3141ab45dac Mon Sep 17 00:00:00 2001 From: Sergey Korotkov Date: Fri, 30 Sep 2011 15:53:15 +0400 Subject: [PATCH] SKI-11, SKI-12 https things --- certificate.pem | 15 + certrequest.csr | 12 + modules/cash/test.js | 8 +- modules/core/lib/Gettext.js | 1197 ----------------------------- modules/core/lib/core.js | 55 +- modules/core/lib/coreapi.js | 13 + modules/core/views/users.mustache | 4 +- package.json | 1 + privatekey.pem | 15 + 9 files changed, 100 insertions(+), 1220 deletions(-) create mode 100644 certificate.pem create mode 100644 certrequest.csr delete mode 100644 modules/core/lib/Gettext.js create mode 100644 privatekey.pem diff --git a/certificate.pem b/certificate.pem new file mode 100644 index 0000000..a81d42e --- /dev/null +++ b/certificate.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICXzCCAcgCCQDgOcwewVb9ATANBgkqhkiG9w0BAQUFADB0MQswCQYDVQQGEwJS +VTEMMAoGA1UECBMDUlpOMQ8wDQYDVQQHEwZSeWF6YW4xDzANBgNVBAoTBlB1c2hP +azETMBEGA1UEAxMKc2tpbGFwLm9yZzEgMB4GCSqGSIb3DQEJARYRc2VyZ2V5QHB1 +c2hvay5jb20wHhcNMTEwOTI5MTQ0MDM5WhcNMTExMDI5MTQ0MDM5WjB0MQswCQYD +VQQGEwJSVTEMMAoGA1UECBMDUlpOMQ8wDQYDVQQHEwZSeWF6YW4xDzANBgNVBAoT +BlB1c2hPazETMBEGA1UEAxMKc2tpbGFwLm9yZzEgMB4GCSqGSIb3DQEJARYRc2Vy +Z2V5QHB1c2hvay5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMDp70Jc +JF+Qcbe5tj/HOIg9GKSV1kf7vo3f6wA42On+IZBkT7ocl2dmptiGGL26UE+qk4AM +PZ9XPtWRcOKH78cfKNkWfpLJ/8/6QdkwIeR80MGOaajerQml8wKC1eSOtzhWUmPu +dladS598iilbEsTlNSvu0Dk5zWyvL3sTTXUbAgMBAAEwDQYJKoZIhvcNAQEFBQAD +gYEAMIBkRdW+T7Sp0KCVrnsRnknjgrAudhxCiD4Dom6cQ8BlpD4UpqcOD7/jInhU +Y/uC933VUWNCzxW+NHmcejjAFLP3goayLW9hodb0teEws+DL7C/m0KE/UY+1vDkD +KzWDX+Fw8meybthawlrip4k4BcBed1a8TAWUdeICzhYgt9g= +-----END CERTIFICATE----- diff --git a/certrequest.csr b/certrequest.csr new file mode 100644 index 0000000..c996c61 --- /dev/null +++ b/certrequest.csr @@ -0,0 +1,12 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIBtDCCAR0CAQAwdDELMAkGA1UEBhMCUlUxDDAKBgNVBAgTA1JaTjEPMA0GA1UE +BxMGUnlhemFuMQ8wDQYDVQQKEwZQdXNoT2sxEzARBgNVBAMTCnNraWxhcC5vcmcx +IDAeBgkqhkiG9w0BCQEWEXNlcmdleUBwdXNob2suY29tMIGfMA0GCSqGSIb3DQEB +AQUAA4GNADCBiQKBgQDA6e9CXCRfkHG3ubY/xziIPRikldZH+76N3+sAONjp/iGQ +ZE+6HJdnZqbYhhi9ulBPqpOADD2fVz7VkXDih+/HHyjZFn6Syf/P+kHZMCHkfNDB +jmmo3q0JpfMCgtXkjrc4VlJj7nZWnUuffIopWxLE5TUr7tA5Oc1sry97E011GwID +AQABoAAwDQYJKoZIhvcNAQEFBQADgYEAmbJAnYqgTI7waFrcNDGKh6M1zhTzsipu +nxprzXpAuzneh+gZg2bpbFsEDBQmuN1ga4R4hgqOhSh0r4U4WJlwKO61oNkpxrAD +4+fqXHOYXfdlkvYGS0r/3exZ80YcB0XBp7Z2zX0Mfj+Pg1Q0k0KDVzbmmri1F1rO +dNL5d6C5UG0= +-----END CERTIFICATE REQUEST----- diff --git a/modules/cash/test.js b/modules/cash/test.js index e19e1d1..0ae4427 100644 --- a/modules/cash/test.js +++ b/modules/cash/test.js @@ -6,7 +6,7 @@ var adb = null; var cash_accounts = null; var cash_transactions = null; -alfred.open('/home/pushok/work/joker/data', function(err, db) { +alfred.open('../../data/db', function(err, db) { if (err) { throw err; } adb = db; adb.ensure("cash_accounts", {type:'cached_key_map',buffered:false}, function(err,_cash_accounts) { @@ -127,9 +127,3 @@ fs.createReadStream("./samples/home.xml") .pipe(saxStream); console.log(new Date()); - -http.createServer(function (req, res) { - res.writeHead(200, {'Content-Type': 'text/plain'}); - res.end('Hello World\n'); -}).listen(1337, "127.0.0.1"); -console.log('Server running at http://127.0.0.1:1337/'); diff --git a/modules/core/lib/Gettext.js b/modules/core/lib/Gettext.js deleted file mode 100644 index e0aeae5..0000000 --- a/modules/core/lib/Gettext.js +++ /dev/null @@ -1,1197 +0,0 @@ -/* -Pure Javascript implementation of Uniforum message translation. -Copyright (C) 2008 Joshua I. Miller , all rights reserved - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU Library General Public License as published -by the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -USA. - -=head1 NAME - -Javascript Gettext - Javascript implemenation of GNU Gettext API. - -=head1 SYNOPSIS - - // ////////////////////////////////////////////////////////// - // Optimum caching way - - - - var gt = new Gettext({ "domain" : "myDomain" }); - // rest is the same - - - // ////////////////////////////////////////////////////////// - // The reson the shortcuts aren't exported by default is because they'd be - // glued to the single domain you created. So, if you're adding i18n support - // to some js library, you should use it as so: - - if (typeof(MyNamespace) == 'undefined') MyNamespace = {}; - MyNamespace.MyClass = function () { - var gtParms = { "domain" : 'MyNamespace_MyClass' }; - this.gt = new Gettext(gtParams); - return this; - }; - MyNamespace.MyClass.prototype._ = function (msgid) { - return this.gt.gettext(msgid); - }; - MyNamespace.MyClass.prototype.something = function () { - var myString = this._("this will get translated"); - }; - - // ////////////////////////////////////////////////////////// - // Adding the shortcuts to a global scope is easier. If that's - // ok in your app, this is certainly easier. - var myGettext = new Gettext({ 'domain' : 'myDomain' }); - function _ (msgid) { - return myGettext.gettext(msgid); - } - alert( _("text") ); - - // ////////////////////////////////////////////////////////// - // Data structure of the json data - // NOTE: if you're loading via the - - // in domain.json - json_locale_data = { - "mydomain" : { - // po header fields - "" : { - "plural-forms" : "...", - "lang" : "en", - }, - // all the msgid strings and translations - "msgid" : [ "msgid_plural", "translation", "plural_translation" ], - }, - }; - // please see the included bin/po2json script for the details on this format - -This method also allows you to use unsupported file formats, so long as you can parse them into the above format. - -=item 2. Use AJAX to load language file. - -Use XMLHttpRequest (actually, SJAX - syncronous) to load an external resource. - -Supported external formats are: - -=over - -=item * Javascript Object Notation (.json) - -(see bin/po2json) - - type=application/json - -=item * Uniforum Portable Object (.po) - -(see GNU Gettext's xgettext) - - type=application/x-po - -=item * Machine Object (compiled .po) (.mo) - -NOTE: .mo format isn't actually supported just yet, but support is planned. - -(see GNU Gettext's msgfmt) - - type=application/x-mo - -=back - -=back - -=head1 METHODS - -The following methods are implemented: - - new Gettext(args) - textdomain (domain) - gettext (msgid) - dgettext (domainname, msgid) - dcgettext (domainname, msgid, LC_MESSAGES) - ngettext (msgid, msgid_plural, count) - dngettext (domainname, msgid, msgid_plural, count) - dcngettext (domainname, msgid, msgid_plural, count, LC_MESSAGES) - pgettext (msgctxt, msgid) - dpgettext (domainname, msgctxt, msgid) - dcpgettext (domainname, msgctxt, msgid, LC_MESSAGES) - npgettext (msgctxt, msgid, msgid_plural, count) - dnpgettext (domainname, msgctxt, msgid, msgid_plural, count) - dcnpgettext (domainname, msgctxt, msgid, msgid_plural, count, LC_MESSAGES) - strargs (string, args_array) - - -=head2 new Gettext (args) - -Several methods of loading locale data are included. You may specify a plugin or alternative method of loading data by passing the data in as the "locale_data" option. For example: - - var get_locale_data = function () { - // plugin does whatever to populate locale_data - return locale_data; - }; - var gt = new Gettext( 'domain' : 'messages', - 'locale_data' : get_locale_data() ); - -The above can also be used if locale data is specified in a statically included