Skip to content

Commit

Permalink
Improve asset management via utilizing bower.
Browse files Browse the repository at this point in the history
Signed-off-by: crynobone <crynobone@gmail.com>
  • Loading branch information
crynobone committed Jun 10, 2014
1 parent e5a63a1 commit 4ceb05b
Show file tree
Hide file tree
Showing 22 changed files with 11,317 additions and 125 deletions.
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "public/components"
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
/build.xml export-ignore
/package.json export-ignore
/phpunit.xml export-ignore
/public/.gitignore export-ignore
/LICENSE.md export-ignore
/README.md export-ignore
16 changes: 16 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "orchestra/foundation",
"homepage": "http://orchestraplatform.com",
"authors": [
"crynobone <crynobone@gmail.com>"
],
"description": "Orchestra Platform Foundation Component",
"license": "MIT",
"private": true,
"dependencies": {
"javie": "~1.1.4",
"jquery": "~1.10.2",
"underscore": "~1.6.0",
"select2": "~3.4.8"
}
}
23 changes: 23 additions & 0 deletions public/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#Javie
/components/javie/*
!/components/javie/javie.js
!/components/javie/javie.min.js

# jQuery
/components/jquery/*
!/components/jquery/jquery.js
!/components/jquery/jquery.min.js
!/components/jquery/jquery.min.map

# Select2
/components/select2/*
!/components/select2/select2-spinner.gif
!/components/select2/select2.css
!/components/select2/select2.min.js
!/components/select2/select2.png
!/components/select2/select2x2.png
!/components/select2/spinner.gif

# Underscore
/components/underscore/*
!/components/underscore/underscore.js
65 changes: 34 additions & 31 deletions public/vendor/javie/javie.js → public/components/javie/javie.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* ========================================================================
*/

// Generated by CoffeeScript 1.6.3
(function() {
var Application, root, _;

Expand Down Expand Up @@ -102,7 +103,7 @@
root.Javie = Application;

}).call(this);
// Generated by CoffeeScript 1.6.3

/*
* ==========================================================
* Javie.EventDispatcher
Expand All @@ -119,8 +120,7 @@
* @author Mior Muhammad Zaki <https://github.com/crynobone>
* @license MIT License
* ==========================================================
*/

*/

(function() {
var EventDispatcher, EventRepository, dispatcher, events, root, _;
Expand Down Expand Up @@ -289,7 +289,7 @@
}

}).call(this);
// Generated by CoffeeScript 1.6.3

/*
* ==========================================================
* Javie.Logger
Expand All @@ -300,13 +300,12 @@
* @package Javie
* @class Logger
* @require console
* @version 1.1.0-dev
* @version 1.1.1
* @since 0.1.0
* @author Mior Muhammad Zaki <https://github.com/crynobone>
* @license MIT License
* ==========================================================
*/

*/

(function() {
var Logger, LoggerRepository, array_make, dispatch, enabled, level, logger, post, root;
Expand Down Expand Up @@ -436,7 +435,7 @@
}

}).call(this);
// Generated by CoffeeScript 1.6.3

/*
* ==========================================================
* Javie.Profiler
Expand All @@ -447,13 +446,12 @@
* @package Javie
* @class Profiler
* @require console
* @version 1.1.0-dev
* @version 1.1.1
* @since 0.1.0
* @author Mior Muhammad Zaki <https://github.com/crynobone>
* @license MIT License
* ==========================================================
*/

*/

(function() {
var Profiler, ProfilerRepository, enabled, profilers, root;
Expand Down Expand Up @@ -633,7 +631,7 @@
}

}).call(this);
// Generated by CoffeeScript 1.6.3

/*
* ==========================================================
* Javie.Request
Expand All @@ -644,13 +642,12 @@
* @package Javie
* @class Request
* @require underscore, jQuery/Zepto
* @version 1.1.0-dev
* @version 1.1.3
* @since 0.1.1
* @author Mior Muhammad Zaki <https://github.com/crynobone>
* @license MIT
* ==========================================================
*/

*/

(function() {
var Request, RequestRepository, api, dispatcher, requests, root, _;
Expand Down Expand Up @@ -706,6 +703,8 @@

Request.prototype.executed = false;

Request.prototype.response = null;

Request.prototype.config = {
'name': '',
'type': 'GET',
Expand All @@ -728,9 +727,8 @@
var config;
config = key;
if (!_.isObject(key)) {
config = {
key: value
};
config = {};
config[key] = value;
}
return this.config = _.defaults(config, this.config);
};
Expand All @@ -744,9 +742,12 @@
if (_.isUndefined(url)) {
throw new Error("Missing required url parameter");
}
if (object != null) {
if (object == null) {
object = root.document;
}
this.put({
'object': object
});
segment = url.split(' ');
if (segment.length === 1) {
uri = segment[0];
Expand All @@ -759,7 +760,9 @@
queries = uri.split('?');
if (queries.length > 1) {
url = queries[0];
this.put('query', queries[1]);
this.put({
'query': queries[1]
});
}
}
uri = uri.replace(':baseUrl', this.get('baseUrl', ''));
Expand All @@ -778,8 +781,8 @@
};

Request.prototype.execute = function(data) {
var name, request, self;
self = this;
var me, name, request;
me = this;
name = this.get('name');
if (!_.isObject(data)) {
data = "" + (api(this.get('object')).serialize()) + "&" + (this.get('query'));
Expand All @@ -800,15 +803,16 @@
var status;
data = json_parse(xhr.responseText);
status = xhr.status;
me.response = xhr;
if (!_.isUndefined(data) && data.hasOwnProperty('errors')) {
dispatcher.fire('Request.onError', [data.errors, status, self]);
dispatcher.fire("Request.onError: " + name, [data.errors, status, self]);
self.config['onError'](data.errors, status, self);
dispatcher.fire('Request.onError', [data.errors, status, me]);
dispatcher.fire("Request.onError: " + name, [data.errors, status, me]);
me.config['onError'](data.errors, status, me);
data.errors = null;
}
dispatcher.fire('Request.onComplete', [data, status, self]);
dispatcher.fire("Request.onComplete: " + name, [data, status, self]);
self.config['onComplete'](data, status, self);
dispatcher.fire('Request.onComplete', [data, status, me]);
dispatcher.fire("Request.onComplete: " + name, [data, status, me]);
me.config['onComplete'](data, status, me);
return true;
}
};
Expand Down Expand Up @@ -881,9 +885,8 @@
var config;
config = key;
if (!_.isObject(key)) {
config = {
key: value
};
config = {};
config[key] = value;
}
return this.config = _.defaults(config, this.config);
};
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4ceb05b

Please sign in to comment.