Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"directory": "3rdparty",
"json": "bower.json"
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
3rdparty
dist
94 changes: 94 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/*jslint node: true */
"use strict";


module.exports = function(grunt) {

grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),

uglify: {
dist: {
files: {
"dist/jpak.min.js": [ "dist/jpak.js" ]
},
options: {
mangle: false
}
}
},

clean: {
temp: {
src: [ "tmp" ]
},
dist: {
src: [ "dist/*.js" ]
}
},

concat: {
dist: {
src: ["jssrc/*.js" ],
dest: "dist/jpak.js"
}
},

jshint: {
all: [ "Gruntfile.js", "jssrc/*.js" ]
},

connect: {
server: {
options: {
hostname: "localhost",
port: 8082
}
}
},

watch: {
dev: {
files: [ "Gruntfile.js", "jssrc/*.js" ],
tasks: [ "jshint", "concat:dist", "clean:temp" ],
options: {
atBegin: true
}
},
min: {
files: [ "Gruntfile.js", "jssrc/*.js" ],
tasks: [ "jshint", "concat:dist", "clean:temp", "uglify:dist" ],
options: {
atBegin: true
}
}
},

compress: {
dist: {
options: {
archive: "dist/<%= pkg.name %>-<%= pkg.version %>.zip"
},
files: [{
src: [ "dist/*.js", "dist/*.css" ]
}]
}
},
});

grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-less");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.loadNpmTasks("grunt-contrib-compress");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-watch");

grunt.registerTask("dev", [ "clean:dist", "connect:server", "watch:dev" ]);
grunt.registerTask("test", [ "clean:dist", "jshint" ]);
grunt.registerTask("junit", [ "clean:dist", "jshint" ] );
grunt.registerTask("minified", [ "clean:dist", "connect:server", "watch:min" ]);
grunt.registerTask("package", [ "clean:dist", "jshint", "concat:dist",
"uglify:dist", "less:dist", "clean:temp", "compress:dist" ]);
};
29 changes: 29 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "JPAK",
"version": "2.0.0",
"homepage": "https://github.com/TeskeVirtualSystem/jpak",
"authors": [
"Lucas Teske"
],
"description": "JPAK is a multi-use Javascript Package System, developed for loading several files at once with only one package.",
"keywords" : [
"file system",
"distribuited",
"package"
],
"dependencies" : {

},
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"cpp",
"doc",
"test",
"tests",
"spec",
"example"
]
}
2 changes: 1 addition & 1 deletion doc/JPAK1.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Multiuse Javascript Package
By: Lucas Teske
https://github.com/racerxdl/jpak
https://github.com/TeskeVirtualSystem/jpak

JPAK v1.0 Specification File

Expand Down
2 changes: 1 addition & 1 deletion doc/JPAK2/Extended Mode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

Multiuse Javascript Package
By: Lucas Teske
https://github.com/racerxdl/jpak
https://github.com/TeskeVirtualSystem/jpak

#JPAK v2.0 Extended Mode

Expand Down
2 changes: 1 addition & 1 deletion doc/JPAK2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Multiuse Javascript Package
By: Lucas Teske
https://github.com/racerxdl/jpak
https://github.com/TeskeVirtualSystem/jpak

#JPAK v2.0 Specification File

Expand Down
3 changes: 2 additions & 1 deletion js/jpak.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

Multiuse Javascript Package
By: Lucas Teske
https://github.com/racerxdl/jpak
https://github.com/TeskeVirtualSystem/jpak
*/


Expand Down Expand Up @@ -150,6 +150,7 @@ JPAK.ArrayBufferToBase64 = function(arrayBuffer) {

return base64;
};

/**
* Logs a message, if enabled
* @expose
Expand Down
2 changes: 1 addition & 1 deletion jsdoc/symbols/src/jpak.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<span class='line'> 8</span>
<span class='line'> 9</span> Multiuse Javascript Package
<span class='line'> 10</span> By: Lucas Teske
<span class='line'> 11</span> https://github.com/racerxdl/jpak
<span class='line'> 11</span> https://github.com/TeskeVirtualSystem/jpak
<span class='line'> 12</span> */</span><span class="WHIT">
<span class='line'> 13</span>
<span class='line'> 14</span> </span><span class="COMM">/**
Expand Down
138 changes: 138 additions & 0 deletions jssrc/alpha.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
/**
_ ____ _ _ __ ____ ___
| | _ \ / \ | |/ / __ _|___ \ / _ \
_ | | |_) / _ \ | ' / \ \ / / __) || | | |
| |_| | __/ ___ \| . \ \ V / / __/ | |_| |
\___/|_| /_/ \_\_|\_\ \_/ |_____(_)___/

Multiuse Javascript Package
https://github.com/TeskeVirtualSystem/jpak

The MIT License (MIT)

Copyright (c) 2013 Lucas Teske

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

**/

var JPAK = {
Generics: {},
Loader: {},
Classes: {},
Tools : {}
};

(function() {

var inNode = (typeof module !== 'undefined' && typeof module.exports !== 'undefined');

if (inNode) {
JPAK.Tools.toBuffer = function(ab) {
var buffer = new Buffer(ab.byteLength);
var view = new Uint8Array(ab);
for (var i = 0; i < buffer.length; ++i) {
buffer[i] = view[i];
}
return buffer;
};

JPAK.Tools.toArrayBuffer = function(buffer) {
var ab = new ArrayBuffer(buffer.length);
var view = new Uint8Array(ab);
for (var i = 0; i < buffer.length; ++i) {
view[i] = buffer[i];
}
return ab;
};
}

/*
* Extends the Uint8Array to be able to be converted to a string
*/
Uint8Array.prototype.asString = function() {
var o = "";
for(var i=0;i<this.byteLength;i++)
o += String.fromCharCode(this[i]);
return o;
};

/*
* Puts a string inside the UInt8Array
*/
Uint8Array.prototype.putString = function(offset, string) {
if (string === undefined) {
string = offset;
offset = 0;
}
for (var i=0;i<string.length;i++) {
this[offset+i] = string.charCodeAt(i);
}
return offset+string.length;
};

/*
* Converts itself to an object.
*
* To associate with a prototype.
*/
JPAK.Generics.genericToObject = function() {
var output = {};
for (var property in this) {
if (this.hasOwnProperty(property)) {
output[property] = this[property].toObject !== undefined ? this[property].toObject() : this[property];
}
}
return output;
};

/*
* Fills its own properties based on a input object.
*
* To associate with a prototype.
*/
JPAK.Generics.genericFromObject = function(object) {
for (var property in object) {
if (object.hasOwnProperty(property)) {
this[property] = object[property];
}
}
};


/*
* Converts itself to a JSON.
*
* To associate with a prototype.
*/
JPAK.Generics.genericjToJSON = function() {
return JSON.stringify(this.toObject());
};


/*
* Fills its own properties based on a json
*
* To associate with a prototype.
*/
JPAK.Generics.genericjFromJSON = function(json) {
this.fromObject(JSON.parse(json));
};


})();
Loading