Skip to content
Browse files

removed tunnel and added support for mojito 5

replaced the getAppconfig function
  • Loading branch information...
1 parent d00d3ef commit 09db4c43ee97e726b841f12f098bd48ca110694e @diervo diervo committed
View
7 addons/ac/shaker.server.js
@@ -34,8 +34,9 @@ YUI.add('mojito-shaker-addon', function(Y, NAME) {
}
},
_initShaker: function (){
- var shakerMeta = YUI._mojito._cache && YUI._mojito._cache.shaker && YUI._mojito._cache.shaker.meta;
- this._shakerConfig = this._ac.app.config.shaker || {};
+ var shakerMeta = YUI._mojito._cache && YUI._mojito._cache.shaker && YUI._mojito._cache.shaker.meta,
+ config = this._ac.app ? this._ac.app.config.shaker : this._ac.config.getAppConfig().shaker;
+ this._shakerConfig = config && config.shaker || {};
this._meta = shakerMeta || {};
return shakerMeta;
},
@@ -127,4 +128,4 @@ YUI.add('mojito-shaker-addon', function(Y, NAME) {
Y.mojito.addons.ac.shaker = ShakerAddon;
-}, '0.0.1', {requires: ['mojito']});
+}, '0.0.1', {requires: ['mojito', 'mojito-config-addon']});
View
47 mojits/TunnelProxy/autoload/store-provider.server.js
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-
-/*jslint anon:true, sloppy:true*/
-/*global YUI*/
-
-
-YUI.add('tunnel-store-provider-addon', function(Y, NAME) {
-
- function Addon(command, adapter, ac) {
- this.instance = command.instance;
- this.scripts = {};
- this.ac = ac;
- this.dispatch = ac.dispatch;
- }
-
-
- Addon.prototype = {
-
- namespace: 'store',
-
- /**
- * Declaration of store requirement.
- * @private
- * @param {ResourceStore} rs The resource store.
- */
- setStore: function(rs) {
- this.rs = rs;
- if (rs) {
- Y.log('Initialized and activated with Resource Store', 'info',
- NAME);
- }
- },
-
-
- getStore: function() {
- return this.rs;
- }
- };
-
- Y.namespace('mojito.addons.ac').store = Addon;
-
-}, '0.1.0');
View
106 mojits/TunnelProxy/controller.server.js
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2011-2012, Yahoo! Inc. All rights reserved.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-
-/*jslint anon:true, sloppy:true nomen:true*/
-/*global YUI*/
-
-YUI.add('TunnelProxy', function(Y, NAME) {
-
-
- function makeAdapter(ac) {
- var oldAdapter = ac._adapter,
- newAdapter;
-
- newAdapter = Y.mix(oldAdapter, {
-
- rpc: {
- originalDone: oldAdapter.done,
- ac: ac,
- buffer: {
- data: '',
- meta: {}
- }
- },
-
- _updateBuffer: function(data, meta) {
- var buff = this.rpc.buffer;
- buff.data = buff.data + data;
- buff.meta = Y.mojito.util.metaMerge(buff.meta, meta);
- // metaMerge will strip off the view info, but we need that for
- // RPC calls, so we put it back
- if (meta.view) {
- if (buff.meta.view) {
- buff.meta.view = Y.mojito.util.metaMerge(
- buff.meta.view,
- meta.view
- );
- } else {
- buff.meta.view = meta.view;
- }
- }
- },
-
- flush: function(data, meta) {
- this._updateBuffer(data, meta);
- },
-
- done: function(data, meta) {
- var out,
- buffer = this.rpc.buffer;
- this._updateBuffer(data, meta);
- out = {
- status: meta.http.code,
- data: {
- html: buffer.data,
- // including the meta data for resolution on the
- // client
- meta: buffer.meta
- }
- };
- // We need to do this so that the original done method will
- // (eventually) be called. If we don't, we'll loop back to
- // this method, recursing forever.
- this.done = this.rpc.originalDone;
- this.rpc.ac.done(out, 'json');
- }
-
- }, true);
-
- return newAdapter;
- }
-
-
- Y.namespace('mojito.controllers')[NAME] = {
-
- init: function(config) {
- this.config = config;
- },
-
- index: function(ac) {
- // This key is set by the TunnelServer in _handleRpc().
- var proxyCommand = ac.params.body('proxyCommand'),
- txId = ac.params.body('txId');
-
- if (!proxyCommand) {
- ac.error(
- 'Cannot execute TunnelProxy mojit without a proxy command.'
- );
- return;
- }
- //Shaker change: we need the action to pass to expandInstance
- if (proxyCommand.instance) {
- proxyCommand.instance.action = proxyCommand.action;
- }
- // dispatch the command as the proxy
- ac._dispatch(proxyCommand, makeAdapter(ac));
- }
- };
-
-}, '0.1.0', {requires: [
- 'mojito-http-addon',
- 'mojito-util'
-]});
View
7 mojits/TunnelProxy/defaults.json
@@ -1,7 +0,0 @@
-[
- {
- "settings": [ "master" ],
- "config": {
- }
- }
-]
View
5 mojits/TunnelProxy/definition.json
@@ -1,5 +0,0 @@
-[
- {
- "settings": [ "master" ]
- }
-]
View
2 package.json
@@ -1,6 +1,6 @@
{
"name": "mojito-shaker",
- "version": "2.0.29",
+ "version": "2.0.30",
"description": "Compiles and deploys asset rollups for Mojito applications.",
"author": "shaker-users@yahoo-inc.com <shaker-users@yahoo-inc.com>",
"contributors": [

0 comments on commit 09db4c4

Please sign in to comment.
Something went wrong with that request. Please try again.